From d82829465e5fbc3d164bed55a43c84e39a9cd27e Mon Sep 17 00:00:00 2001 From: stevejpurves Date: Fri, 6 Sep 2024 14:40:19 +0000 Subject: [PATCH] =?UTF-8?q?Deploy=20preview=20for=20PR=20770=20?= =?UTF-8?q?=F0=9F=9B=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pr-preview/pr-770/1001.index.js | 2 + pr-preview/pr-770/1001.index.js.map | 1 + pr-preview/pr-770/1066.index.js | 2 + pr-preview/pr-770/1066.index.js.map | 1 + pr-preview/pr-770/1081.index.js | 2 + pr-preview/pr-770/1081.index.js.map | 1 + pr-preview/pr-770/1302.index.js | 2 + pr-preview/pr-770/1302.index.js.map | 1 + pr-preview/pr-770/132.index.js | 2 + pr-preview/pr-770/132.index.js.map | 1 + pr-preview/pr-770/1374.index.js | 2 + pr-preview/pr-770/1374.index.js.map | 1 + pr-preview/pr-770/1405.index.js | 2 + pr-preview/pr-770/1405.index.js.map | 1 + pr-preview/pr-770/1408.index.js | 2 + pr-preview/pr-770/1408.index.js.map | 1 + pr-preview/pr-770/142.index.js | 2 + pr-preview/pr-770/142.index.js.map | 1 + pr-preview/pr-770/1524.index.js | 2 + pr-preview/pr-770/1524.index.js.map | 1 + pr-preview/pr-770/1553.index.js | 2 + pr-preview/pr-770/1553.index.js.map | 1 + pr-preview/pr-770/1560.index.js | 2 + pr-preview/pr-770/1560.index.js.map | 1 + pr-preview/pr-770/1653.index.js | 2 + pr-preview/pr-770/1653.index.js.map | 1 + pr-preview/pr-770/1911.index.js | 2 + pr-preview/pr-770/1911.index.js.map | 1 + pr-preview/pr-770/2000.index.js | 2 + pr-preview/pr-770/2000.index.js.map | 1 + pr-preview/pr-770/2293.index.js | 2 + pr-preview/pr-770/2293.index.js.map | 1 + pr-preview/pr-770/2376.index.js | 2 + pr-preview/pr-770/2376.index.js.map | 1 + pr-preview/pr-770/252.index.js | 2 + pr-preview/pr-770/252.index.js.map | 1 + pr-preview/pr-770/2681.index.js | 2 + pr-preview/pr-770/2681.index.js.map | 1 + pr-preview/pr-770/2682.index.js | 2 + pr-preview/pr-770/2682.index.js.map | 1 + pr-preview/pr-770/284.thebe-lite.min.js | 2 + pr-preview/pr-770/284.thebe-lite.min.js.map | 1 + pr-preview/pr-770/29.index.js | 2 + pr-preview/pr-770/29.index.js.map | 1 + pr-preview/pr-770/3024.index.js | 2 + pr-preview/pr-770/3024.index.js.map | 1 + pr-preview/pr-770/3180.index.js | 2 + pr-preview/pr-770/3180.index.js.map | 1 + pr-preview/pr-770/3191.index.js | 2 + pr-preview/pr-770/3191.index.js.map | 1 + pr-preview/pr-770/3220.index.js | 2 + pr-preview/pr-770/3220.index.js.map | 1 + pr-preview/pr-770/3242.index.js | 2 + pr-preview/pr-770/3242.index.js.map | 1 + pr-preview/pr-770/3426.index.js | 2 + pr-preview/pr-770/3426.index.js.map | 1 + pr-preview/pr-770/3543.index.js | 2 + pr-preview/pr-770/3543.index.js.map | 1 + pr-preview/pr-770/357.index.js | 2 + pr-preview/pr-770/357.index.js.map | 1 + pr-preview/pr-770/3722.index.js | 2 + pr-preview/pr-770/3722.index.js.map | 1 + pr-preview/pr-770/3726.index.js | 2 + pr-preview/pr-770/3726.index.js.map | 1 + pr-preview/pr-770/3805.index.js | 2 + pr-preview/pr-770/3805.index.js.map | 1 + pr-preview/pr-770/4401.index.js | 2 + pr-preview/pr-770/4401.index.js.map | 1 + pr-preview/pr-770/4424.index.js | 2 + pr-preview/pr-770/4424.index.js.map | 1 + pr-preview/pr-770/4448.index.js | 2 + pr-preview/pr-770/4448.index.js.map | 1 + pr-preview/pr-770/4451.index.js | 2 + pr-preview/pr-770/4451.index.js.map | 1 + pr-preview/pr-770/4501.index.js | 2 + pr-preview/pr-770/4501.index.js.map | 1 + pr-preview/pr-770/4704.index.js | 2 + pr-preview/pr-770/4704.index.js.map | 1 + pr-preview/pr-770/4756.index.js | 2 + pr-preview/pr-770/4756.index.js.map | 1 + pr-preview/pr-770/4872.index.js | 2 + pr-preview/pr-770/4872.index.js.map | 1 + pr-preview/pr-770/4922.index.js | 2 + pr-preview/pr-770/4922.index.js.map | 1 + pr-preview/pr-770/4957.index.js | 2 + pr-preview/pr-770/4957.index.js.map | 1 + pr-preview/pr-770/51.thebe-lite.min.js | 3 + .../pr-770/51.thebe-lite.min.js.LICENSE.txt | 9 + pr-preview/pr-770/51.thebe-lite.min.js.map | 1 + pr-preview/pr-770/5106.index.js | 2 + pr-preview/pr-770/5106.index.js.map | 1 + pr-preview/pr-770/5258.index.js | 2 + pr-preview/pr-770/5258.index.js.map | 1 + pr-preview/pr-770/5260.index.js | 2 + pr-preview/pr-770/5260.index.js.map | 1 + pr-preview/pr-770/5292.index.js | 2 + pr-preview/pr-770/5292.index.js.map | 1 + pr-preview/pr-770/5298.index.js | 2 + pr-preview/pr-770/5298.index.js.map | 1 + pr-preview/pr-770/5350.index.js | 2 + pr-preview/pr-770/5350.index.js.map | 1 + pr-preview/pr-770/5351.index.js | 2 + pr-preview/pr-770/5351.index.js.map | 1 + pr-preview/pr-770/5455.index.js | 2 + pr-preview/pr-770/5455.index.js.map | 1 + pr-preview/pr-770/5515.index.js | 2 + pr-preview/pr-770/5515.index.js.map | 1 + pr-preview/pr-770/5525.index.js | 2 + pr-preview/pr-770/5525.index.js.map | 1 + pr-preview/pr-770/5595.index.js | 2 + pr-preview/pr-770/5595.index.js.map | 1 + pr-preview/pr-770/560.index.js | 2 + pr-preview/pr-770/560.index.js.map | 1 + pr-preview/pr-770/567.index.js | 2 + pr-preview/pr-770/567.index.js.map | 1 + pr-preview/pr-770/5687.index.js | 2 + pr-preview/pr-770/5687.index.js.map | 1 + pr-preview/pr-770/5945.index.js | 2 + pr-preview/pr-770/5945.index.js.map | 1 + pr-preview/pr-770/6099.index.js | 2 + pr-preview/pr-770/6099.index.js.map | 1 + pr-preview/pr-770/615.index.js | 2 + pr-preview/pr-770/615.index.js.map | 1 + pr-preview/pr-770/6162.index.js | 2 + pr-preview/pr-770/6162.index.js.map | 1 + pr-preview/pr-770/6205.index.js | 2 + pr-preview/pr-770/6205.index.js.map | 1 + pr-preview/pr-770/6211.index.js | 2 + pr-preview/pr-770/6211.index.js.map | 1 + pr-preview/pr-770/6240.index.js | 2 + pr-preview/pr-770/6240.index.js.map | 1 + pr-preview/pr-770/6292.index.js | 2 + pr-preview/pr-770/6292.index.js.map | 1 + pr-preview/pr-770/635.thebe-lite.min.js | 3 + .../pr-770/635.thebe-lite.min.js.LICENSE.txt | 1 + pr-preview/pr-770/635.thebe-lite.min.js.map | 1 + pr-preview/pr-770/636.index.js | 2 + pr-preview/pr-770/636.index.js.map | 1 + pr-preview/pr-770/6367.index.js | 2 + pr-preview/pr-770/6367.index.js.map | 1 + pr-preview/pr-770/6446.index.js | 2 + pr-preview/pr-770/6446.index.js.map | 1 + pr-preview/pr-770/647.index.js | 2 + pr-preview/pr-770/647.index.js.map | 1 + pr-preview/pr-770/6473.index.js | 2 + pr-preview/pr-770/6473.index.js.map | 1 + pr-preview/pr-770/6590.index.js | 2 + pr-preview/pr-770/6590.index.js.map | 1 + pr-preview/pr-770/6643.index.js | 2 + pr-preview/pr-770/6643.index.js.map | 1 + pr-preview/pr-770/6742.index.js | 2 + pr-preview/pr-770/6742.index.js.map | 1 + pr-preview/pr-770/6807.index.js | 3 + pr-preview/pr-770/6807.index.js.LICENSE.txt | 5 + pr-preview/pr-770/6807.index.js.map | 1 + pr-preview/pr-770/6828.index.js | 2 + pr-preview/pr-770/6828.index.js.map | 1 + pr-preview/pr-770/7077.index.js | 2 + pr-preview/pr-770/7077.index.js.map | 1 + pr-preview/pr-770/7197.index.js | 2 + pr-preview/pr-770/7197.index.js.map | 1 + pr-preview/pr-770/7220.index.js | 2 + pr-preview/pr-770/7220.index.js.map | 1 + pr-preview/pr-770/7230.index.js | 2 + pr-preview/pr-770/7230.index.js.map | 1 + pr-preview/pr-770/7364.index.js | 2 + pr-preview/pr-770/7364.index.js.map | 1 + pr-preview/pr-770/746.thebe-lite.min.js | 3 + .../pr-770/746.thebe-lite.min.js.LICENSE.txt | 5 + pr-preview/pr-770/746.thebe-lite.min.js.map | 1 + pr-preview/pr-770/7486.index.js | 2 + pr-preview/pr-770/7486.index.js.map | 1 + pr-preview/pr-770/7727.index.js | 2 + pr-preview/pr-770/7727.index.js.map | 1 + pr-preview/pr-770/7838.index.js | 2 + pr-preview/pr-770/7838.index.js.map | 1 + pr-preview/pr-770/786.index.js | 2 + pr-preview/pr-770/786.index.js.map | 1 + pr-preview/pr-770/7911.index.js | 2 + pr-preview/pr-770/7911.index.js.map | 1 + pr-preview/pr-770/7951.index.js | 2 + pr-preview/pr-770/7951.index.js.map | 1 + pr-preview/pr-770/8122.index.js | 2 + pr-preview/pr-770/8122.index.js.map | 1 + pr-preview/pr-770/8137.index.js | 2 + pr-preview/pr-770/8137.index.js.map | 1 + pr-preview/pr-770/8188.index.js | 2 + pr-preview/pr-770/8188.index.js.map | 1 + pr-preview/pr-770/822.index.js | 2 + pr-preview/pr-770/822.index.js.map | 1 + pr-preview/pr-770/8334.index.js | 2 + pr-preview/pr-770/8334.index.js.map | 1 + pr-preview/pr-770/8391.index.js | 2 + pr-preview/pr-770/8391.index.js.map | 1 + pr-preview/pr-770/8421.index.js | 2 + pr-preview/pr-770/8421.index.js.map | 1 + pr-preview/pr-770/8539.index.js | 2 + pr-preview/pr-770/8539.index.js.map | 1 + pr-preview/pr-770/8586.index.js | 2 + pr-preview/pr-770/8586.index.js.map | 1 + pr-preview/pr-770/8665.index.js | 2 + pr-preview/pr-770/8665.index.js.map | 1 + pr-preview/pr-770/8678.index.js | 2 + pr-preview/pr-770/8678.index.js.map | 1 + pr-preview/pr-770/8727.index.js | 2 + pr-preview/pr-770/8727.index.js.map | 1 + pr-preview/pr-770/8820.index.js | 2 + pr-preview/pr-770/8820.index.js.map | 1 + pr-preview/pr-770/8955.index.js | 2 + pr-preview/pr-770/8955.index.js.map | 1 + pr-preview/pr-770/899.index.js | 2 + pr-preview/pr-770/899.index.js.map | 1 + pr-preview/pr-770/903.thebe-lite.min.js | 2 + pr-preview/pr-770/903.thebe-lite.min.js.map | 1 + pr-preview/pr-770/9114.index.js | 2 + pr-preview/pr-770/9114.index.js.map | 1 + pr-preview/pr-770/9371.index.js | 2 + pr-preview/pr-770/9371.index.js.map | 1 + pr-preview/pr-770/950.index.js | 2 + pr-preview/pr-770/950.index.js.map | 1 + pr-preview/pr-770/9561.index.js | 2 + pr-preview/pr-770/9561.index.js.map | 1 + pr-preview/pr-770/9602.index.js | 2 + pr-preview/pr-770/9602.index.js.map | 1 + pr-preview/pr-770/9638.index.js | 2 + pr-preview/pr-770/9638.index.js.map | 1 + pr-preview/pr-770/9684.index.js | 2 + pr-preview/pr-770/9684.index.js.map | 1 + pr-preview/pr-770/9779.index.js | 2 + pr-preview/pr-770/9779.index.js.map | 1 + pr-preview/pr-770/9865.index.js | 2 + pr-preview/pr-770/9865.index.js.map | 1 + pr-preview/pr-770/9981.index.js | 2 + pr-preview/pr-770/9981.index.js.map | 1 + pr-preview/pr-770/api/contents/all.json | 1 + pr-preview/pr-770/binder.html | 60 + pr-preview/pr-770/index.html | 266 ++ pr-preview/pr-770/index.js | 3 + pr-preview/pr-770/index.js.LICENSE.txt | 42 + pr-preview/pr-770/index.js.map | 1 + pr-preview/pr-770/ipywidgets-lite.html | 162 + pr-preview/pr-770/ipywidgets-local.html | 168 + pr-preview/pr-770/ipywidgets.html | 149 + pr-preview/pr-770/jupyter.html | 91 + pr-preview/pr-770/lite.html | 76 + pr-preview/pr-770/main.css | 4 + pr-preview/pr-770/mathjax.js | 16 + pr-preview/pr-770/maths.html | 106 + pr-preview/pr-770/paths.html | 96 + pr-preview/pr-770/pypi/all.json | 128 + .../pypi/ipykernel-6.9.2-py3-none-any.whl | Bin 0 -> 2731 bytes .../pypi/piplite-0.4.2-py3-none-any.whl | Bin 0 -> 7168 bytes .../pyodide_kernel-0.4.2-py3-none-any.whl | Bin 0 -> 11007 bytes ...idgetsnbextension-3.6.999-py3-none-any.whl | Bin 0 -> 2367 bytes ...idgetsnbextension-4.0.999-py3-none-any.whl | Bin 0 -> 2369 bytes pr-preview/pr-770/service-worker.js | 1 + pr-preview/pr-770/thebe-lite.min.js | 3 + .../pr-770/thebe-lite.min.js.LICENSE.txt | 21 + pr-preview/pr-770/thebe-lite.min.js.map | 1 + pr-preview/pr-770/thebe.css | 3356 +++++++++++++++++ pr-preview/pr-770/thebe_128x128.svg | 5 + pr-preview/pr-770/thebe_wide_logo.png | Bin 0 -> 5510 bytes pr-preview/pr-770/types/activate.d.ts | 6 + pr-preview/pr-770/types/codemirror.d.ts | 11 + pr-preview/pr-770/types/index.d.ts | 3 + pr-preview/pr-770/types/options.d.ts | 55 + pr-preview/pr-770/types/render.d.ts | 17 + pr-preview/pr-770/types/status.d.ts | 16 + pr-preview/pr-770/types/thebe.d.ts | 26 + pr-preview/pr-770/types/types.d.ts | 52 + pr-preview/pr-770/types/utils.d.ts | 4 + 271 files changed, 5315 insertions(+) create mode 100644 pr-preview/pr-770/1001.index.js create mode 100644 pr-preview/pr-770/1001.index.js.map create mode 100644 pr-preview/pr-770/1066.index.js create mode 100644 pr-preview/pr-770/1066.index.js.map create mode 100644 pr-preview/pr-770/1081.index.js create mode 100644 pr-preview/pr-770/1081.index.js.map create mode 100644 pr-preview/pr-770/1302.index.js create mode 100644 pr-preview/pr-770/1302.index.js.map create mode 100644 pr-preview/pr-770/132.index.js create mode 100644 pr-preview/pr-770/132.index.js.map create mode 100644 pr-preview/pr-770/1374.index.js create mode 100644 pr-preview/pr-770/1374.index.js.map create mode 100644 pr-preview/pr-770/1405.index.js create mode 100644 pr-preview/pr-770/1405.index.js.map create mode 100644 pr-preview/pr-770/1408.index.js create mode 100644 pr-preview/pr-770/1408.index.js.map create mode 100644 pr-preview/pr-770/142.index.js create mode 100644 pr-preview/pr-770/142.index.js.map create mode 100644 pr-preview/pr-770/1524.index.js create mode 100644 pr-preview/pr-770/1524.index.js.map create mode 100644 pr-preview/pr-770/1553.index.js create mode 100644 pr-preview/pr-770/1553.index.js.map create mode 100644 pr-preview/pr-770/1560.index.js create mode 100644 pr-preview/pr-770/1560.index.js.map create mode 100644 pr-preview/pr-770/1653.index.js create mode 100644 pr-preview/pr-770/1653.index.js.map create mode 100644 pr-preview/pr-770/1911.index.js create mode 100644 pr-preview/pr-770/1911.index.js.map create mode 100644 pr-preview/pr-770/2000.index.js create mode 100644 pr-preview/pr-770/2000.index.js.map create mode 100644 pr-preview/pr-770/2293.index.js create mode 100644 pr-preview/pr-770/2293.index.js.map create mode 100644 pr-preview/pr-770/2376.index.js create mode 100644 pr-preview/pr-770/2376.index.js.map create mode 100644 pr-preview/pr-770/252.index.js create mode 100644 pr-preview/pr-770/252.index.js.map create mode 100644 pr-preview/pr-770/2681.index.js create mode 100644 pr-preview/pr-770/2681.index.js.map create mode 100644 pr-preview/pr-770/2682.index.js create mode 100644 pr-preview/pr-770/2682.index.js.map create mode 100644 pr-preview/pr-770/284.thebe-lite.min.js create mode 100644 pr-preview/pr-770/284.thebe-lite.min.js.map create mode 100644 pr-preview/pr-770/29.index.js create mode 100644 pr-preview/pr-770/29.index.js.map create mode 100644 pr-preview/pr-770/3024.index.js create mode 100644 pr-preview/pr-770/3024.index.js.map create mode 100644 pr-preview/pr-770/3180.index.js create mode 100644 pr-preview/pr-770/3180.index.js.map create mode 100644 pr-preview/pr-770/3191.index.js create mode 100644 pr-preview/pr-770/3191.index.js.map create mode 100644 pr-preview/pr-770/3220.index.js create mode 100644 pr-preview/pr-770/3220.index.js.map create mode 100644 pr-preview/pr-770/3242.index.js create mode 100644 pr-preview/pr-770/3242.index.js.map create mode 100644 pr-preview/pr-770/3426.index.js create mode 100644 pr-preview/pr-770/3426.index.js.map create mode 100644 pr-preview/pr-770/3543.index.js create mode 100644 pr-preview/pr-770/3543.index.js.map create mode 100644 pr-preview/pr-770/357.index.js create mode 100644 pr-preview/pr-770/357.index.js.map create mode 100644 pr-preview/pr-770/3722.index.js create mode 100644 pr-preview/pr-770/3722.index.js.map create mode 100644 pr-preview/pr-770/3726.index.js create mode 100644 pr-preview/pr-770/3726.index.js.map create mode 100644 pr-preview/pr-770/3805.index.js create mode 100644 pr-preview/pr-770/3805.index.js.map create mode 100644 pr-preview/pr-770/4401.index.js create mode 100644 pr-preview/pr-770/4401.index.js.map create mode 100644 pr-preview/pr-770/4424.index.js create mode 100644 pr-preview/pr-770/4424.index.js.map create mode 100644 pr-preview/pr-770/4448.index.js create mode 100644 pr-preview/pr-770/4448.index.js.map create mode 100644 pr-preview/pr-770/4451.index.js create mode 100644 pr-preview/pr-770/4451.index.js.map create mode 100644 pr-preview/pr-770/4501.index.js create mode 100644 pr-preview/pr-770/4501.index.js.map create mode 100644 pr-preview/pr-770/4704.index.js create mode 100644 pr-preview/pr-770/4704.index.js.map create mode 100644 pr-preview/pr-770/4756.index.js create mode 100644 pr-preview/pr-770/4756.index.js.map create mode 100644 pr-preview/pr-770/4872.index.js create mode 100644 pr-preview/pr-770/4872.index.js.map create mode 100644 pr-preview/pr-770/4922.index.js create mode 100644 pr-preview/pr-770/4922.index.js.map create mode 100644 pr-preview/pr-770/4957.index.js create mode 100644 pr-preview/pr-770/4957.index.js.map create mode 100644 pr-preview/pr-770/51.thebe-lite.min.js create mode 100644 pr-preview/pr-770/51.thebe-lite.min.js.LICENSE.txt create mode 100644 pr-preview/pr-770/51.thebe-lite.min.js.map create mode 100644 pr-preview/pr-770/5106.index.js create mode 100644 pr-preview/pr-770/5106.index.js.map create mode 100644 pr-preview/pr-770/5258.index.js create mode 100644 pr-preview/pr-770/5258.index.js.map create mode 100644 pr-preview/pr-770/5260.index.js create mode 100644 pr-preview/pr-770/5260.index.js.map create mode 100644 pr-preview/pr-770/5292.index.js create mode 100644 pr-preview/pr-770/5292.index.js.map create mode 100644 pr-preview/pr-770/5298.index.js create mode 100644 pr-preview/pr-770/5298.index.js.map create mode 100644 pr-preview/pr-770/5350.index.js create mode 100644 pr-preview/pr-770/5350.index.js.map create mode 100644 pr-preview/pr-770/5351.index.js create mode 100644 pr-preview/pr-770/5351.index.js.map create mode 100644 pr-preview/pr-770/5455.index.js create mode 100644 pr-preview/pr-770/5455.index.js.map create mode 100644 pr-preview/pr-770/5515.index.js create mode 100644 pr-preview/pr-770/5515.index.js.map create mode 100644 pr-preview/pr-770/5525.index.js create mode 100644 pr-preview/pr-770/5525.index.js.map create mode 100644 pr-preview/pr-770/5595.index.js create mode 100644 pr-preview/pr-770/5595.index.js.map create mode 100644 pr-preview/pr-770/560.index.js create mode 100644 pr-preview/pr-770/560.index.js.map create mode 100644 pr-preview/pr-770/567.index.js create mode 100644 pr-preview/pr-770/567.index.js.map create mode 100644 pr-preview/pr-770/5687.index.js create mode 100644 pr-preview/pr-770/5687.index.js.map create mode 100644 pr-preview/pr-770/5945.index.js create mode 100644 pr-preview/pr-770/5945.index.js.map create mode 100644 pr-preview/pr-770/6099.index.js create mode 100644 pr-preview/pr-770/6099.index.js.map create mode 100644 pr-preview/pr-770/615.index.js create mode 100644 pr-preview/pr-770/615.index.js.map create mode 100644 pr-preview/pr-770/6162.index.js create mode 100644 pr-preview/pr-770/6162.index.js.map create mode 100644 pr-preview/pr-770/6205.index.js create mode 100644 pr-preview/pr-770/6205.index.js.map create mode 100644 pr-preview/pr-770/6211.index.js create mode 100644 pr-preview/pr-770/6211.index.js.map create mode 100644 pr-preview/pr-770/6240.index.js create mode 100644 pr-preview/pr-770/6240.index.js.map create mode 100644 pr-preview/pr-770/6292.index.js create mode 100644 pr-preview/pr-770/6292.index.js.map create mode 100644 pr-preview/pr-770/635.thebe-lite.min.js create mode 100644 pr-preview/pr-770/635.thebe-lite.min.js.LICENSE.txt create mode 100644 pr-preview/pr-770/635.thebe-lite.min.js.map create mode 100644 pr-preview/pr-770/636.index.js create mode 100644 pr-preview/pr-770/636.index.js.map create mode 100644 pr-preview/pr-770/6367.index.js create mode 100644 pr-preview/pr-770/6367.index.js.map create mode 100644 pr-preview/pr-770/6446.index.js create mode 100644 pr-preview/pr-770/6446.index.js.map create mode 100644 pr-preview/pr-770/647.index.js create mode 100644 pr-preview/pr-770/647.index.js.map create mode 100644 pr-preview/pr-770/6473.index.js create mode 100644 pr-preview/pr-770/6473.index.js.map create mode 100644 pr-preview/pr-770/6590.index.js create mode 100644 pr-preview/pr-770/6590.index.js.map create mode 100644 pr-preview/pr-770/6643.index.js create mode 100644 pr-preview/pr-770/6643.index.js.map create mode 100644 pr-preview/pr-770/6742.index.js create mode 100644 pr-preview/pr-770/6742.index.js.map create mode 100644 pr-preview/pr-770/6807.index.js create mode 100644 pr-preview/pr-770/6807.index.js.LICENSE.txt create mode 100644 pr-preview/pr-770/6807.index.js.map create mode 100644 pr-preview/pr-770/6828.index.js create mode 100644 pr-preview/pr-770/6828.index.js.map create mode 100644 pr-preview/pr-770/7077.index.js create mode 100644 pr-preview/pr-770/7077.index.js.map create mode 100644 pr-preview/pr-770/7197.index.js create mode 100644 pr-preview/pr-770/7197.index.js.map create mode 100644 pr-preview/pr-770/7220.index.js create mode 100644 pr-preview/pr-770/7220.index.js.map create mode 100644 pr-preview/pr-770/7230.index.js create mode 100644 pr-preview/pr-770/7230.index.js.map create mode 100644 pr-preview/pr-770/7364.index.js create mode 100644 pr-preview/pr-770/7364.index.js.map create mode 100644 pr-preview/pr-770/746.thebe-lite.min.js create mode 100644 pr-preview/pr-770/746.thebe-lite.min.js.LICENSE.txt create mode 100644 pr-preview/pr-770/746.thebe-lite.min.js.map create mode 100644 pr-preview/pr-770/7486.index.js create mode 100644 pr-preview/pr-770/7486.index.js.map create mode 100644 pr-preview/pr-770/7727.index.js create mode 100644 pr-preview/pr-770/7727.index.js.map create mode 100644 pr-preview/pr-770/7838.index.js create mode 100644 pr-preview/pr-770/7838.index.js.map create mode 100644 pr-preview/pr-770/786.index.js create mode 100644 pr-preview/pr-770/786.index.js.map create mode 100644 pr-preview/pr-770/7911.index.js create mode 100644 pr-preview/pr-770/7911.index.js.map create mode 100644 pr-preview/pr-770/7951.index.js create mode 100644 pr-preview/pr-770/7951.index.js.map create mode 100644 pr-preview/pr-770/8122.index.js create mode 100644 pr-preview/pr-770/8122.index.js.map create mode 100644 pr-preview/pr-770/8137.index.js create mode 100644 pr-preview/pr-770/8137.index.js.map create mode 100644 pr-preview/pr-770/8188.index.js create mode 100644 pr-preview/pr-770/8188.index.js.map create mode 100644 pr-preview/pr-770/822.index.js create mode 100644 pr-preview/pr-770/822.index.js.map create mode 100644 pr-preview/pr-770/8334.index.js create mode 100644 pr-preview/pr-770/8334.index.js.map create mode 100644 pr-preview/pr-770/8391.index.js create mode 100644 pr-preview/pr-770/8391.index.js.map create mode 100644 pr-preview/pr-770/8421.index.js create mode 100644 pr-preview/pr-770/8421.index.js.map create mode 100644 pr-preview/pr-770/8539.index.js create mode 100644 pr-preview/pr-770/8539.index.js.map create mode 100644 pr-preview/pr-770/8586.index.js create mode 100644 pr-preview/pr-770/8586.index.js.map create mode 100644 pr-preview/pr-770/8665.index.js create mode 100644 pr-preview/pr-770/8665.index.js.map create mode 100644 pr-preview/pr-770/8678.index.js create mode 100644 pr-preview/pr-770/8678.index.js.map create mode 100644 pr-preview/pr-770/8727.index.js create mode 100644 pr-preview/pr-770/8727.index.js.map create mode 100644 pr-preview/pr-770/8820.index.js create mode 100644 pr-preview/pr-770/8820.index.js.map create mode 100644 pr-preview/pr-770/8955.index.js create mode 100644 pr-preview/pr-770/8955.index.js.map create mode 100644 pr-preview/pr-770/899.index.js create mode 100644 pr-preview/pr-770/899.index.js.map create mode 100644 pr-preview/pr-770/903.thebe-lite.min.js create mode 100644 pr-preview/pr-770/903.thebe-lite.min.js.map create mode 100644 pr-preview/pr-770/9114.index.js create mode 100644 pr-preview/pr-770/9114.index.js.map create mode 100644 pr-preview/pr-770/9371.index.js create mode 100644 pr-preview/pr-770/9371.index.js.map create mode 100644 pr-preview/pr-770/950.index.js create mode 100644 pr-preview/pr-770/950.index.js.map create mode 100644 pr-preview/pr-770/9561.index.js create mode 100644 pr-preview/pr-770/9561.index.js.map create mode 100644 pr-preview/pr-770/9602.index.js create mode 100644 pr-preview/pr-770/9602.index.js.map create mode 100644 pr-preview/pr-770/9638.index.js create mode 100644 pr-preview/pr-770/9638.index.js.map create mode 100644 pr-preview/pr-770/9684.index.js create mode 100644 pr-preview/pr-770/9684.index.js.map create mode 100644 pr-preview/pr-770/9779.index.js create mode 100644 pr-preview/pr-770/9779.index.js.map create mode 100644 pr-preview/pr-770/9865.index.js create mode 100644 pr-preview/pr-770/9865.index.js.map create mode 100644 pr-preview/pr-770/9981.index.js create mode 100644 pr-preview/pr-770/9981.index.js.map create mode 100644 pr-preview/pr-770/api/contents/all.json create mode 100644 pr-preview/pr-770/binder.html create mode 100644 pr-preview/pr-770/index.html create mode 100644 pr-preview/pr-770/index.js create mode 100644 pr-preview/pr-770/index.js.LICENSE.txt create mode 100644 pr-preview/pr-770/index.js.map create mode 100644 pr-preview/pr-770/ipywidgets-lite.html create mode 100644 pr-preview/pr-770/ipywidgets-local.html create mode 100644 pr-preview/pr-770/ipywidgets.html create mode 100644 pr-preview/pr-770/jupyter.html create mode 100644 pr-preview/pr-770/lite.html create mode 100644 pr-preview/pr-770/main.css create mode 100644 pr-preview/pr-770/mathjax.js create mode 100644 pr-preview/pr-770/maths.html create mode 100644 pr-preview/pr-770/paths.html create mode 100644 pr-preview/pr-770/pypi/all.json create mode 100644 pr-preview/pr-770/pypi/ipykernel-6.9.2-py3-none-any.whl create mode 100644 pr-preview/pr-770/pypi/piplite-0.4.2-py3-none-any.whl create mode 100644 pr-preview/pr-770/pypi/pyodide_kernel-0.4.2-py3-none-any.whl create mode 100644 pr-preview/pr-770/pypi/widgetsnbextension-3.6.999-py3-none-any.whl create mode 100644 pr-preview/pr-770/pypi/widgetsnbextension-4.0.999-py3-none-any.whl create mode 100644 pr-preview/pr-770/service-worker.js create mode 100644 pr-preview/pr-770/thebe-lite.min.js create mode 100644 pr-preview/pr-770/thebe-lite.min.js.LICENSE.txt create mode 100644 pr-preview/pr-770/thebe-lite.min.js.map create mode 100644 pr-preview/pr-770/thebe.css create mode 100644 pr-preview/pr-770/thebe_128x128.svg create mode 100644 pr-preview/pr-770/thebe_wide_logo.png create mode 100644 pr-preview/pr-770/types/activate.d.ts create mode 100644 pr-preview/pr-770/types/codemirror.d.ts create mode 100644 pr-preview/pr-770/types/index.d.ts create mode 100644 pr-preview/pr-770/types/options.d.ts create mode 100644 pr-preview/pr-770/types/render.d.ts create mode 100644 pr-preview/pr-770/types/status.d.ts create mode 100644 pr-preview/pr-770/types/thebe.d.ts create mode 100644 pr-preview/pr-770/types/types.d.ts create mode 100644 pr-preview/pr-770/types/utils.d.ts diff --git a/pr-preview/pr-770/1001.index.js b/pr-preview/pr-770/1001.index.js new file mode 100644 index 00000000..cf37df1e --- /dev/null +++ b/pr-preview/pr-770/1001.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[1001],{1001:(e,n,t)=>{t.r(n),t.d(n,{ntriples:()=>i});function r(e,n){var t,r=e.location;t=0==r&&"<"==n?1:0==r&&"_"==n?2:3==r&&"<"==n?4:5==r&&"<"==n?6:5==r&&"_"==n?7:5==r&&'"'==n?8:1==r&&">"==n||2==r&&" "==n?3:4==r&&">"==n?5:6==r&&">"==n||7==r&&" "==n||8==r&&'"'==n||9==r&&" "==n||10==r&&">"==n?11:8==r&&"@"==n?9:8==r&&"^"==n?10:" "!=n||0!=r&&3!=r&&5!=r&&11!=r?11==r&&"."==n?0:12:r,e.location=t}const i={name:"ntriples",startState:function(){return{location:0,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(e,n){var t=e.next();if("<"==t){r(n,t);var i="";return e.eatWhile((function(e){return"#"!=e&&">"!=e&&(i+=e,!0)})),n.uris.push(i),e.match("#",!1)||(e.next(),r(n,">")),"variable"}if("#"==t){var u="";return e.eatWhile((function(e){return">"!=e&&" "!=e&&(u+=e,!0)})),n.anchors.push(u),"url"}if(">"==t)return r(n,">"),"variable";if("_"==t){r(n,t);var a="";return e.eatWhile((function(e){return" "!=e&&(a+=e,!0)})),n.bnodes.push(a),e.next(),r(n," "),"builtin"}if('"'==t)return r(n,t),e.eatWhile((function(e){return'"'!=e})),e.next(),"@"!=e.peek()&&"^"!=e.peek()&&r(n,'"'),"string";if("@"==t){r(n,"@");var s="";return e.eatWhile((function(e){return" "!=e&&(s+=e,!0)})),n.langs.push(s),e.next(),r(n," "),"string.special"}if("^"==t){e.next(),r(n,"^");var l="";return e.eatWhile((function(e){return">"!=e&&(l+=e,!0)})),n.types.push(l),e.next(),r(n,">"),"variable"}" "==t&&r(n,t),"."==t&&r(n,t)}}}}]); +//# sourceMappingURL=1001.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/1001.index.js.map b/pr-preview/pr-770/1001.index.js.map new file mode 100644 index 00000000..e0110834 --- /dev/null +++ b/pr-preview/pr-770/1001.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"1001.index.js","mappings":"6HAeA,SAASA,EAAaC,EAAWC,GAC/B,IACIC,EADAC,EAAeH,EAAUI,SAI6BF,EAnBpC,GAmBdC,GAA6C,KAALF,EAlB1B,EADA,GAoBdE,GAA6C,KAALF,EAlB1B,EACA,GAkBdE,GAA6C,KAALF,EAjB1B,EACA,GAiBdE,GAA6C,KAALF,EAhB1B,EADA,GAkBdE,GAA6C,KAALF,EAhB1B,EAFA,GAmBdE,GAA6C,KAALF,EAhB1B,EAPA,GA0BdE,GAAqD,KAALF,GAzBlC,GA0BdE,GAAqD,KAALF,EAzBlC,EACA,GAyBdE,GAAqD,KAALF,EAxBlC,EACA,GAwBdE,GAAqD,KAALF,GAvBlC,GAwBdE,GAAqD,KAALF,GAvBlC,GAwBdE,GAAqD,KAALF,GAvBlC,GAwBdE,GAAkD,KAALF,GAvB/B,IAwBdE,GAAkD,KAALF,EAvB/B,GAHA,GA6BdE,GAAqD,KAALF,EA5BlC,EADA,GA8BdE,GAAqD,KAALF,EA5BlC,GA+BR,KAALA,GAzCa,GA2CXE,GA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jB,EAAagB,EAAO,KACpB,IAAIU,EAAa,GAKjB,OAJAX,EAAOK,UAAS,SAASlB,GAAK,MAAS,KAALA,IAAawB,GAAcxB,GAAU,EAAqB,IAC5Fc,EAAMJ,MAAMS,KAAKK,GACjBX,EAAOG,OACPlB,EAAagB,EAAO,KACb,gBACT,CACA,GAAU,KAANC,EAAY,CACdF,EAAOG,OACPlB,EAAagB,EAAO,KACpB,IAAIW,EAAa,GAKjB,OAJAZ,EAAOK,UAAS,SAASlB,GAAK,MAAS,KAALA,IAAayB,GAAczB,GAAU,EAAqB,IAC5Fc,EAAMH,MAAMQ,KAAKM,GACjBZ,EAAOG,OACPlB,EAAagB,EAAO,KACb,UACT,CACU,KAANC,GACFjB,EAAagB,EAAOC,GAEZ,KAANA,GACFjB,EAAagB,EAAOC,EAExB,E","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/ntriples.js"],"sourcesContent":["var Location = {\n PRE_SUBJECT : 0,\n WRITING_SUB_URI : 1,\n WRITING_BNODE_URI : 2,\n PRE_PRED : 3,\n WRITING_PRED_URI : 4,\n PRE_OBJ : 5,\n WRITING_OBJ_URI : 6,\n WRITING_OBJ_BNODE : 7,\n WRITING_OBJ_LITERAL : 8,\n WRITING_LIT_LANG : 9,\n WRITING_LIT_TYPE : 10,\n POST_OBJ : 11,\n ERROR : 12\n};\nfunction transitState(currState, c) {\n var currLocation = currState.location;\n var ret;\n\n // Opening.\n if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI;\n else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI;\n else if(currLocation == Location.PRE_PRED && c == '<') ret = Location.WRITING_PRED_URI;\n else if(currLocation == Location.PRE_OBJ && c == '<') ret = Location.WRITING_OBJ_URI;\n else if(currLocation == Location.PRE_OBJ && c == '_') ret = Location.WRITING_OBJ_BNODE;\n else if(currLocation == Location.PRE_OBJ && c == '\"') ret = Location.WRITING_OBJ_LITERAL;\n\n // Closing.\n else if(currLocation == Location.WRITING_SUB_URI && c == '>') ret = Location.PRE_PRED;\n else if(currLocation == Location.WRITING_BNODE_URI && c == ' ') ret = Location.PRE_PRED;\n else if(currLocation == Location.WRITING_PRED_URI && c == '>') ret = Location.PRE_OBJ;\n else if(currLocation == Location.WRITING_OBJ_URI && c == '>') ret = Location.POST_OBJ;\n else if(currLocation == Location.WRITING_OBJ_BNODE && c == ' ') ret = Location.POST_OBJ;\n else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '\"') ret = Location.POST_OBJ;\n else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ;\n else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ;\n\n // Closing typed and language literal.\n else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG;\n else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE;\n\n // Spaces.\n else if( c == ' ' &&\n (\n currLocation == Location.PRE_SUBJECT ||\n currLocation == Location.PRE_PRED ||\n currLocation == Location.PRE_OBJ ||\n currLocation == Location.POST_OBJ\n )\n ) ret = currLocation;\n\n // Reset.\n else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT;\n\n // Error\n else ret = Location.ERROR;\n\n currState.location=ret;\n}\n\nexport const ntriples = {\n name: \"ntriples\",\n startState: function() {\n return {\n location : Location.PRE_SUBJECT,\n uris : [],\n anchors : [],\n bnodes : [],\n langs : [],\n types : []\n };\n },\n token: function(stream, state) {\n var ch = stream.next();\n if(ch == '<') {\n transitState(state, ch);\n var parsedURI = '';\n stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} );\n state.uris.push(parsedURI);\n if( stream.match('#', false) ) return 'variable';\n stream.next();\n transitState(state, '>');\n return 'variable';\n }\n if(ch == '#') {\n var parsedAnchor = '';\n stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false;});\n state.anchors.push(parsedAnchor);\n return 'url';\n }\n if(ch == '>') {\n transitState(state, '>');\n return 'variable';\n }\n if(ch == '_') {\n transitState(state, ch);\n var parsedBNode = '';\n stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;});\n state.bnodes.push(parsedBNode);\n stream.next();\n transitState(state, ' ');\n return 'builtin';\n }\n if(ch == '\"') {\n transitState(state, ch);\n stream.eatWhile( function(c) { return c != '\"'; } );\n stream.next();\n if( stream.peek() != '@' && stream.peek() != '^' ) {\n transitState(state, '\"');\n }\n return 'string';\n }\n if( ch == '@' ) {\n transitState(state, '@');\n var parsedLang = '';\n stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;});\n state.langs.push(parsedLang);\n stream.next();\n transitState(state, ' ');\n return 'string.special';\n }\n if( ch == '^' ) {\n stream.next();\n transitState(state, '^');\n var parsedType = '';\n stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} );\n state.types.push(parsedType);\n stream.next();\n transitState(state, '>');\n return 'variable';\n }\n if( ch == ' ' ) {\n transitState(state, ch);\n }\n if( ch == '.' ) {\n transitState(state, ch);\n }\n }\n};\n"],"names":["transitState","currState","c","ret","currLocation","location","ntriples","name","startState","uris","anchors","bnodes","langs","types","token","stream","state","ch","next","parsedURI","eatWhile","push","match","parsedAnchor","parsedBNode","peek","parsedLang","parsedType"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/1066.index.js b/pr-preview/pr-770/1066.index.js new file mode 100644 index 00000000..7cf28232 --- /dev/null +++ b/pr-preview/pr-770/1066.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[1066],{1066:(e,n,t)=>{function r(e){for(var n={},t=e.split(" "),r=0;rs});var i=r("if elsif else stop require"),u=r("true false not");function o(e,n){var t,r=e.next();if("/"==r&&e.eat("*"))return n.tokenize=a,a(e,n);if("#"===r)return e.skipToEnd(),"comment";if('"'==r)return n.tokenize=(t=r,function(e,n){for(var r,i=!1;null!=(r=e.next())&&(r!=t||i);)i=!i&&"\\"==r;return i||(n.tokenize=o),"string"}),n.tokenize(e,n);if("("==r)return n._indent.push("("),n._indent.push("{"),null;if("{"===r)return n._indent.push("{"),null;if(")"==r&&(n._indent.pop(),n._indent.pop()),"}"===r)return n._indent.pop(),null;if(","==r)return null;if(";"==r)return null;if(/[{}\(\),;]/.test(r))return null;if(/\d/.test(r))return e.eatWhile(/[\d]/),e.eat(/[KkMmGg]/),"number";if(":"==r)return e.eatWhile(/[a-zA-Z_]/),e.eatWhile(/[a-zA-Z0-9_]/),"operator";e.eatWhile(/\w/);var s=e.current();return"text"==s&&e.eat(":")?(n.tokenize=l,"string"):i.propertyIsEnumerable(s)?"keyword":u.propertyIsEnumerable(s)?"atom":null}function l(e,n){return n._multiLineString=!0,e.sol()?("."==e.next()&&e.eol()&&(n._multiLineString=!1,n.tokenize=o),"string"):(e.eatSpace(),"#"==e.peek()?(e.skipToEnd(),"comment"):(e.skipToEnd(),"string"))}function a(e,n){for(var t,r=!1;null!=(t=e.next());){if(r&&"/"==t){n.tokenize=o;break}r="*"==t}return"comment"}const s={name:"sieve",startState:function(e){return{tokenize:o,baseIndent:e||0,_indent:[]}},token:function(e,n){return e.eatSpace()?null:(n.tokenize||o)(e,n)},indent:function(e,n,t){var r=e._indent.length;return n&&"}"==n[0]&&r--,r<0&&(r=0),r*t.unit},languageData:{indentOnInput:/^\s*\}$/}}}}]); +//# sourceMappingURL=1066.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/1066.index.js.map b/pr-preview/pr-770/1066.index.js.map new file mode 100644 index 00000000..0afc4ee7 --- /dev/null +++ b/pr-preview/pr-770/1066.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"1066.index.js","mappings":"8FAAA,SAASA,EAAMC,GAEb,IADA,IAAIC,EAAM,CAAC,EAAGF,EAAQC,EAAIE,MAAM,KACvBC,EA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BH,GACzB,UAELjB,EAAMoB,qBAAqBH,GACtB,OAEF,IACT,CAEA,SAASE,EAAqBjB,EAAQC,GAIpC,OAFAA,EAAMkB,kBAAmB,EAEpBnB,EAAOoB,OAYU,KAAjBpB,EAAOI,QAAoBJ,EAAOqB,QAErCpB,EAAMkB,kBAAmB,EACzBlB,EAAMK,SAAWP,GAGZ,WAjBLC,EAAOsB,WAEc,KAAjBtB,EAAOuB,QACTvB,EAAOQ,YACA,YAGTR,EAAOQ,YACA,UAUX,CAEA,SAASD,EAAcP,EAAQC,GAE7B,IADA,IAAsBE,EAAlBqB,GAAW,EACgB,OAAvBrB,EAAKH,EAAOI,SAAiB,CACnC,GAAIoB,GAAkB,KAANrB,EAAW,CACzBF,EAAMK,SAAWP,EACjB,KACF,CACAyB,EAAkB,KAANrB,CACd,CACA,MAAO,SACT,CAeO,MAAMsB,EAAQ,CACnBC,KAAM,QACNC,WAAY,SAASC,GACnB,MAAO,CAACtB,SAAUP,EACV8B,WAAYD,GAAQ,EACpBlB,QAAS,GACnB,EAEAoB,MAAO,SAAS9B,EAAQC,GACtB,OAAID,EAAOsB,WACF,MAEDrB,EAAMK,UAAYP,GAAWC,EAAQC,EAC/C,EAEA8B,OAAQ,SAAS9B,EAAO+B,EAAYC,GAClC,IAAIrC,EAASK,EAAMS,QAAQd,OAO3B,OANIoC,GAAgC,KAAjBA,EAAW,IAC5BpC,IAEEA,EAAQ,IACVA,EAAS,GAEJA,EAASqC,EAAGC,IACrB,EAEAC,aAAc,CACZC,cAAe,W","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/sieve.js"],"sourcesContent":["function words(str) {\n var obj = {}, words = str.split(\" \");\n for (var i = 0; i < words.length; ++i) obj[words[i]] = true;\n return obj;\n}\n\nvar keywords = words(\"if elsif else stop require\");\nvar atoms = words(\"true false not\");\n\nfunction tokenBase(stream, state) {\n\n var ch = stream.next();\n if (ch == \"/\" && stream.eat(\"*\")) {\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n }\n\n if (ch === '#') {\n stream.skipToEnd();\n return \"comment\";\n }\n\n if (ch == \"\\\"\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n }\n\n if (ch == \"(\") {\n state._indent.push(\"(\");\n // add virtual angel wings so that editor behaves...\n // ...more sane incase of broken brackets\n state._indent.push(\"{\");\n return null;\n }\n\n if (ch === \"{\") {\n state._indent.push(\"{\");\n return null;\n }\n\n if (ch == \")\") {\n state._indent.pop();\n state._indent.pop();\n }\n\n if (ch === \"}\") {\n state._indent.pop();\n return null;\n }\n\n if (ch == \",\")\n return null;\n\n if (ch == \";\")\n return null;\n\n\n if (/[{}\\(\\),;]/.test(ch))\n return null;\n\n // 1*DIGIT \"K\" / \"M\" / \"G\"\n if (/\\d/.test(ch)) {\n stream.eatWhile(/[\\d]/);\n stream.eat(/[KkMmGg]/);\n return \"number\";\n }\n\n // \":\" (ALPHA / \"_\") *(ALPHA / DIGIT / \"_\")\n if (ch == \":\") {\n stream.eatWhile(/[a-zA-Z_]/);\n stream.eatWhile(/[a-zA-Z0-9_]/);\n\n return \"operator\";\n }\n\n stream.eatWhile(/\\w/);\n var cur = stream.current();\n\n // \"text:\" *(SP / HTAB) (hash-comment / CRLF)\n // *(multiline-literal / multiline-dotstart)\n // \".\" CRLF\n if ((cur == \"text\") && stream.eat(\":\"))\n {\n state.tokenize = tokenMultiLineString;\n return \"string\";\n }\n\n if (keywords.propertyIsEnumerable(cur))\n return \"keyword\";\n\n if (atoms.propertyIsEnumerable(cur))\n return \"atom\";\n\n return null;\n}\n\nfunction tokenMultiLineString(stream, state)\n{\n state._multiLineString = true;\n // the first line is special it may contain a comment\n if (!stream.sol()) {\n stream.eatSpace();\n\n if (stream.peek() == \"#\") {\n stream.skipToEnd();\n return \"comment\";\n }\n\n stream.skipToEnd();\n return \"string\";\n }\n\n if ((stream.next() == \".\") && (stream.eol()))\n {\n state._multiLineString = false;\n state.tokenize = tokenBase;\n }\n\n return \"string\";\n}\n\nfunction tokenCComment(stream, state) {\n var maybeEnd = false, ch;\n while ((ch = stream.next()) != null) {\n if (maybeEnd && ch == \"/\") {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return \"comment\";\n}\n\nfunction tokenString(quote) {\n return function(stream, state) {\n var escaped = false, ch;\n while ((ch = stream.next()) != null) {\n if (ch == quote && !escaped)\n break;\n escaped = !escaped && ch == \"\\\\\";\n }\n if (!escaped) state.tokenize = tokenBase;\n return \"string\";\n };\n}\n\nexport const sieve = {\n name: \"sieve\",\n startState: function(base) {\n return {tokenize: tokenBase,\n baseIndent: base || 0,\n _indent: []};\n },\n\n token: function(stream, state) {\n if (stream.eatSpace())\n return null;\n\n return (state.tokenize || tokenBase)(stream, state);\n },\n\n indent: function(state, _textAfter, cx) {\n var length = state._indent.length;\n if (_textAfter && (_textAfter[0] == \"}\"))\n length--;\n\n if (length <0)\n length = 0;\n\n return length * cx.unit;\n },\n\n languageData: {\n indentOnInput: /^\\s*\\}$/\n }\n};\n"],"names":["words","str","obj","split","i","length","keywords","atoms","tokenBase","stream","state","quote","ch","next","eat","tokenize","tokenCComment","skipToEnd","escaped","_indent","push","pop","test","eatWhile","cur","current","tokenMultiLineString","propertyIsEnumerable","_multiLineString","sol","eol","eatSpace","peek","maybeEnd","sieve","name","startState","base","baseIndent","token","indent","_textAfter","cx","unit","languageData","indentOnInput"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/1081.index.js b/pr-preview/pr-770/1081.index.js new file mode 100644 index 00000000..0590021e --- /dev/null +++ b/pr-preview/pr-770/1081.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[1081],{1081:(e,t,n)=>{n.r(t),n.d(t,{commonmarkLanguage:()=>Ue,deleteMarkupBackward:()=>nt,insertNewlineContinueMarkup:()=>We,markdown:()=>it,markdownKeymap:()=>rt,markdownLanguage:()=>Ye});var r,s=n(4830),i=n(3173),o=n(9587),a=n(7213),l=n(9066),h=n(9913);class f{static create(e,t,n,r,s){return new f(e,t,n,r+(r<<8)+e+(t<<4)|0,s,[],[])}constructor(e,t,n,r,s,i,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=s,this.children=i,this.positions=o,this.hashProp=[[l.uY.contextHash,r]]}addChild(e,t){e.prop(l.uY.contextHash)!=this.hash&&(e=new l.PH(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new l.PH(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new l.PH(l.Z6.none,e,t,n,this.hashProp)})}}!function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.Autolink=33]="Autolink",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel",e[e.URL=44]="URL"}(r||(r={}));class u{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class c{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return g(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let s=(e.type==r.OrderedList?C:S)(n,t,!1);return s>0&&(e.type!=r.BulletList||L(n,t,!1)<0)&&n.text.charCodeAt(n.pos+s-1)==e.value}const p={[r.Blockquote]:(e,t,n)=>62==n.next&&(n.markers.push(K(r.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(m(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0),[r.ListItem]:(e,t,n)=>!(n.indent-1||(n.moveBaseColumn(n.baseIndent+e.value),0)),[r.OrderedList]:d,[r.BulletList]:d,[r.Document]:()=>!0};function m(e){return 32==e||9==e||10==e||13==e}function g(e,t=0){for(;tn&&m(e.charCodeAt(t-1));)t--;return t}function x(e){if(96!=e.next&&126!=e.next)return-1;let t=e.pos+1;for(;t-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf($.SetextHeading)>-1||r<3?-1:1}function A(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function S(e,t,n){return 45!=e.next&&43!=e.next&&42!=e.next||e.pos!=e.text.length-1&&!m(e.text.charCodeAt(e.pos+1))||!(!n||A(t,r.BulletList)||e.skipSpace(e.pos+2)=48&&i<=57;){if(s++,s==e.text.length)return-1;i=e.text.charCodeAt(s)}return s==e.pos||s>e.pos+9||46!=i&&41!=i||se.pos+1||49!=e.next)?-1:s+1-e.pos}function w(e){if(35!=e.next)return-1;let t=e.pos+1;for(;t6?-1:n}function y(e){if(45!=e.next&&61!=e.next||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t/,B=/\?>/,E=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(s);if(o)return e.append(K(r.Comment,n,n+1+o[0].length));let a=/^\?[^]*?\?>/.exec(s);if(a)return e.append(K(r.ProcessingInstruction,n,n+1+a[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(s);return l?e.append(K(r.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(e,t,n){if(95!=t&&42!=t)return-1;let r=n+1;for(;e.char(r)==t;)r++;let s=e.slice(n-1,n),i=e.slice(r,r+1),o=re.test(s),a=re.test(i),l=/\s|^$/.test(s),h=/\s|^$/.test(i),f=!h&&(!a||l||o),u=!l&&(!o||h||a),c=f&&(42==t||!u||o),d=u&&(42==t||!f||a);return e.append(new ne(95==t?J:W,n,r,(c?1:0)|(d?2:0)))},HardBreak(e,t,n){if(92==t&&10==e.char(n+1))return e.append(K(r.HardBreak,n,n+2));if(32==t){let t=n+1;for(;32==e.char(t);)t++;if(10==e.char(t)&&t>=n+2)return e.append(K(r.HardBreak,n,t+1))}return-1},Link:(e,t,n)=>91==t?e.append(new ne(ee,n,n+1,1)):-1,Image:(e,t,n)=>33==t&&91==e.char(n+1)?e.append(new ne(te,n,n+2,1)):-1,LinkEnd(e,t,n){if(93!=t)return-1;for(let t=e.parts.length-1;t>=0;t--){let s=e.parts[t];if(s instanceof ne&&(s.type==ee||s.type==te)){if(!s.side||e.skipSpace(s.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),o=e.parts[t]=ie(e,i,s.type==ee?r.Link:r.Image,s.from,n+1);if(s.type==ee)for(let n=0;nt?K(r.URL,t+n,i+n):i==e.length&&null}}function ae(e,t,n){let s=e.charCodeAt(t);if(39!=s&&34!=s&&40!=s)return!1;let i=40==s?41:s;for(let s=t+1,o=!1;s=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,s){return this.append(new ne(e,t,n,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof ne&&(t.type==ee||t.type==te))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t=e;o--){let e=this.parts[o];if(e instanceof ne&&1&e.side&&e.type==n.type&&!(s&&(1&n.side||2&e.side)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){r=e;break}}if(!r)continue;let a=n.type.resolve,l=[],h=r.from,f=n.to;if(s){let e=Math.min(2,r.to-r.from,i);h=r.to-e,f=n.from+e,a=1==e?"Emphasis":"StrongEmphasis"}r.type.mark&&l.push(this.elt(r.type.mark,h,r.to));for(let e=o+1;e=0;t--){let n=this.parts[t];if(n instanceof ne&&n.type==e)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}skipSpace(e){return g(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return"string"==typeof e?K(this.parser.getNodeType(e),t,n,r):new G(e,t)}}function fe(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&"\n"!=this.input.read(e-1,e);)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(l.uY.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,s=this.fragmentEnd-(this.fragment.openEnd?1:0),i=e.absoluteLineStart,o=i,a=e.block.children.length,h=o,f=a;for(;;){if(t.to-n>s){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=de(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new l.PH(e.parser.nodeSet.types[r.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is("Block")&&(ue.indexOf(t.type.id)<0?(o=t.to-n,a=e.block.children.length):(o=h,a=f,h=t.to-n,f=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-i}}function de(e,t){let n=e;for(let r=1;rP[e])),Object.keys(P).map((e=>$[e])),Object.keys(P),R,p,Object.keys(se).map((e=>se[e])),Object.keys(se),[]);function ge(e,t,n){let r=[];for(let s=e.firstChild,i=t;;s=s.nextSibling){let e=s?s.from:n;if(e>i&&r.push({from:i,to:e}),!s)break;i=s.to}return r}const ke={resolve:"Strikethrough",mark:"StrikethroughMark"},xe={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":h._A.strikethrough}},{name:"StrikethroughMark",style:h._A.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(126!=t||126!=e.char(n+1)||126==e.char(n+2))return-1;let r=e.slice(n-1,n),s=e.slice(n+2,n+3),i=/\s|^$/.test(r),o=/\s|^$/.test(s),a=re.test(r),l=re.test(s);return e.addDelimiter(ke,n,n+2,!o&&(!l||i||a),!i&&(!a||o||l))},after:"Emphasis"}]};function be(e,t,n=0,r,s=0){let i=0,o=!0,a=-1,l=-1,h=!1,f=()=>{r.push(e.elt("TableCell",s+a,s+l,e.parser.parseInline(t.slice(a,l),s+a)))};for(let u=n;u-1)&&i++,o=!1,r&&(a>-1&&f(),r.push(e.elt("TableDelimiter",u+s,u+s+1))),a=l=-1),h=!h&&92==n}return a>-1&&(i++,r&&f()),i}function Le(e,t){for(let n=t;nLe(t.content,0)?new Se:null,endLeaf(e,t,n){if(n.parsers.some((e=>e instanceof Se))||!Le(t.text,t.basePos))return!1;let r=e.scanLine(e.absoluteLineEnd+1).text;return Ae.test(r)&&be(e,t.text,t.basePos)==be(e,r,t.basePos)},before:"SetextHeading"}]};class we{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const ye={defineNodes:[{name:"Task",block:!0,style:h._A.list},{name:"TaskMarker",style:h._A.atom}],parseBlock:[{name:"TaskList",leaf:(e,t)=>/^\[[ xX]\][ \t]/.test(t.content)&&"ListItem"==e.parentType().name?new we:null,after:"SetextHeading"}]},Ie=/(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy,Te=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,Be=/[\w-]+\.[\w-]+($|\/)/,Ee=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,He=/\/[a-zA-Z\d@.]+/gy;function Me(e,t,n,r){let s=0;for(let i=t;i-1)return-1;let r=t+n[0].length;for(;;){let n,s=e[r-1];if(/[?!.,:*_~]/.test(s)||")"==s&&Me(e,t,r,")")>Me(e,t,r,"("))r--;else{if(";"!=s||!(n=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))break;r=t+n.index}}return r}(e.text,r+s[0].length),i>-1&&e.hasOpenLink&&(i=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,i))[0].length)):s[3]?i=ve(e.text,r):(i=ve(e.text,r+s[0].length),i>-1&&"xmpp:"==s[0]&&(He.lastIndex=i,s=He.exec(e.text),s&&(i=s.index+s[0].length))),i<0?-1:(e.addElement(e.elt("URL",n,i+e.offset)),i+e.offset)):-1}}]}];function _e(e,t,n){return(r,s,i)=>{if(s!=e||r.char(i+1)==e)return-1;let o=[r.elt(n,i,i+1)];for(let s=i+1;s!e.is("Block")||e.is("Document")||null!=De(e)||function(e){return"OrderedList"==e.name||"BulletList"==e.name}(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to}))),ze.add(De),o.Oh.add({Document:()=>null}),o.iB.add({Document:Xe})]});function De(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function qe(e,t){let n=e;for(;;){let e,r=n.nextSibling;if(!r||null!=(e=De(r.type))&&e<=t)break;n=r}return n.to}const je=o.t.of(((e,t,n)=>{for(let r=(0,o.mv)(e).resolveInner(n,-1);r&&!(r.fromn)return{from:n,to:t}}return null}));function Ze(e){return new o.TM(Xe,e,[je],"markdown")}const Ue=Ze(Fe),Ye=Ze(Fe.configure([Pe,Ne,Oe,$e,{props:[o.b_.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));class Qe{constructor(e,t,n,r,s,i,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=s,this.type=i,this.item=o}blank(e,t=!0){let n=this.spaceBefore+("Blockquote"==this.node.name?">":"");if(null!=e){for(;n.length0;e--)n+=" ";return n+(t?this.spaceAfter:"")}marker(e,t){let n="OrderedList"==this.node.name?String(+Ge(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function Ve(e,t){let n=[];for(let t=e;t&&"Document"!=t.name;t=t.parent)"ListItem"!=t.name&&"Blockquote"!=t.name&&"FencedCode"!=t.name||n.push(t);let r=[];for(let e=n.length-1;e>=0;e--){let s,i=n[e],o=t.lineAt(i.from),a=i.from-o.from;if("FencedCode"==i.name)r.push(new Qe(i,a,a,"","","",null));else if("Blockquote"==i.name&&(s=/^ *>( ?)/.exec(o.text.slice(a))))r.push(new Qe(i,a,a+s[0].length,"",s[1],">",null));else if("ListItem"==i.name&&"OrderedList"==i.parent.name&&(s=/^( *)\d+([.)])( *)/.exec(o.text.slice(a)))){let e=s[3],t=s[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new Qe(i.parent,a,a+t,s[1],e,s[2],i))}else if("ListItem"==i.name&&"BulletList"==i.parent.name&&(s=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(a)))){let e=s[4],t=s[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=s[2];s[3]&&(n+=s[3].replace(/[xX]/," ")),r.push(new Qe(i.parent,a,a+t,s[1],e,n,i))}}return r}function Ge(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function Ke(e,t,n,r=0){for(let s=-1,i=e;;){if("ListItem"==i.name){let e=Ge(i,t),o=+e[2];if(s>=0){if(o!=s+1)return;n.push({from:i.from+e[1].length,to:i.from+e[0].length,insert:String(s+2+r)})}s=o}let e=i.nextSibling;if(!e)break;i=e}}function Je(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||"\t"!=t.facet(o.Xt))return e;let r="";for(let t=(0,s.y$)(e,4,n);t>0;)t>=4?(r+="\t",t-=4):(r+=" ",t--);return r+e.slice(n)}const We=({state:e,dispatch:t})=>{let n=(0,o.mv)(e),{doc:r}=e,i=null,a=e.changeByRange((t=>{if(!t.empty||!Ye.isActiveAt(e,t.from))return i={range:t};let o=t.from,a=r.lineAt(o),l=Ve(n.resolveInner(o,-1),r);for(;l.length&&l[l.length-1].from>o-a.from;)l.pop();if(!l.length)return i={range:t};let h=l[l.length-1];if(h.to-h.spaceAfter.length>o-a.from)return i={range:t};let f=o>=h.to-h.spaceAfter.length&&!/\S/.test(a.text.slice(h.to));if(h.item&&f){let t=h.node.firstChild,n=h.node.getChild("ListItem","ListItem");if(t.to>=o||n&&n.to0&&!/[^\s>]/.test(r.lineAt(a.from-1).text)){let e,t=l.length>1?l[l.length-2]:null,n="";t&&t.item?(e=a.from+t.from,n=t.marker(r,1)):e=a.from+(t?t.to:0);let i=[{from:e,to:o,insert:n}];return"OrderedList"==h.node.name&&Ke(h.item,r,i,-2),t&&"OrderedList"==t.node.name&&Ke(t.item,r,i),{range:s.OF.cursor(e+n.length),changes:i}}{let t=tt(l,e,a);return{range:s.OF.cursor(o+t.length+1),changes:{from:a.from,insert:t+e.lineBreak}}}}if("Blockquote"==h.node.name&&f&&a.from){let n=r.lineAt(a.from-1),s=/>\s*$/.exec(n.text);if(s&&s.index==h.from){let r=e.changes([{from:n.from+s.index,to:n.to},{from:a.from+h.from,to:a.to}]);return{range:t.map(r),changes:r}}}let u=[];"OrderedList"==h.node.name&&Ke(h.item,r,u);let c=h.item&&h.item.from]*/.exec(a.text)[0].length>=h.to)for(let e=0,t=l.length-1;e<=t;e++)d+=e!=t||c?l[e].blank(ea.from&&/\s/.test(a.text.charAt(p-a.from-1));)p--;return d=Je(d,e),function(e,t){if("OrderedList"!=e.name&&"BulletList"!=e.name)return!1;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return!1;let s=t.lineAt(n.to),i=t.lineAt(r.from),o=/^[\s>]*$/.test(s.text);return s.number+(o?0:1){let n=(0,o.mv)(e),r=null,i=e.changeByRange((t=>{let i=t.from,{doc:o}=e;if(t.empty&&Ye.isActiveAt(e,t.from)){let t=o.lineAt(i),r=Ve(function(e,t){let n=e.resolveInner(t,-1),r=t;et(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(et(e))r=e.from;else{if("OrderedList"!=e.name&&"BulletList"!=e.name)break;n=e.lastChild,r=n.to}return n}(n,i),o);if(r.length){let n=r[r.length-1],o=n.to-n.spaceAfter.length+(n.spaceAfter?1:0);if(i-t.from>o&&!/\S/.test(t.text.slice(o,i-t.from)))return{range:s.OF.cursor(t.from+o),changes:{from:t.from+o,to:i}};if(i-t.from==o&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from{if(e&&m){let t=null;if(e=/\S*/.exec(e)[0],t="function"==typeof m?m(e):o.t$.matchLanguageName(m,e,!0),t instanceof o.t$)return t.support?t.support.language.parser:o.nq.getSkippingParser(t.load());if(t)return t.parser}return g?g.parser:null}):void 0;var m,g;c.push(function(e){let{codeParser:t,htmlParser:n}=e,s=(0,l.$g)(((e,s)=>{let i=e.type.id;if(!t||i!=r.CodeBlock&&i!=r.FencedCode){if(n&&(i==r.HTMLBlock||i==r.HTMLTag))return{parser:n,overlay:ge(e.node,e.from,e.to)}}else{let n="";if(i==r.FencedCode){let t=e.node.getChild(r.CodeInfo);t&&(n=s.read(t.from,t.to))}let o=t(n);if(o)return{parser:o,overlay:e=>e.type.id==r.CodeText}}return null}));return{wrap:s}}({codeParser:p,htmlParser:st.language.parser})),a&&d.push(s.Nb.high(i.w4.of(rt)));let k=Ze(h.configure(c));return f&&d.push(k.data.of({autocomplete:ot})),new o.Yy(k,d)}function ot(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=(0,o.mv)(t).resolveInner(n,-1);for(;s&&!s.type.isTop;){if("CodeBlock"==s.name||"FencedCode"==s.name||"ProcessingInstructionBlock"==s.name||"CommentBlock"==s.name||"Link"==s.name||"Image"==s.name)return null;s=s.parent}return{from:n-r[0].length,to:n,options:lt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let at=null;function lt(){if(at)return at;let e=(0,Re.htmlCompletionSource)(new a._5(s.$t.create({extensions:st}),0,!0));return at=e?e.options:[]}}}]); +//# sourceMappingURL=1081.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/1081.index.js.map b/pr-preview/pr-770/1081.index.js.map new file mode 100644 index 00000000..b4b87646 --- /dev/null +++ b/pr-preview/pr-770/1081.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"1081.index.js","mappings":"yQAmCIA,E,4DAhCJ,MAAMC,EACF,aAAOC,CAAOC,EAAMC,EAAOC,EAAMC,EAAYC,GAEzC,OAAO,IAAIN,EAAeE,EAAMC,EAAOC,EAD3BC,GAAcA,GAAc,GAAKH,GAAQC,GAAS,GAAM,EACjBG,EAAK,GAAI,GAChE,CACA,WAAAC,CAAYL,EAEZC,EAAOC,EAAMI,EAAMF,EAAKG,EAAUC,GAC9BC,KAAKT,KAAOA,EACZS,KAAKR,MAAQA,EACbQ,KAAKP,KAAOA,EACZO,KAAKH,KAAOA,EACZG,KAAKL,IAAMA,EACXK,KAAKF,SAAWA,EAChBE,KAAKD,UAAYA,EACjBC,KAAKC,SAAW,CAAC,CAAC,KAASC,YAAaL,GAC5C,CACA,QAAAM,CAASC,EAAOC,GACRD,EAAME,KAAK,KAASJ,cAAgBF,KAAKH,OACzCO,EAAQ,IAAI,KAAKA,EAAMb,KAAMa,EAAMN,SAAUM,EAAML,UAAWK,EAAMG,OAAQP,KAAKC,WACrFD,KAAKF,SAASU,KAAKJ,GACnBJ,KAAKD,UAAUS,KAAKH,EACxB,CACA,MAAAI,CAAOC,EAASf,EAAMK,KAAKL,KACvB,IAAIgB,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KAAK,KAAOjF,GAAGuD,MACrC,IAAI2B,EAAOhF,GAAOjY,EAAO4K,UAAUsR,IAGnC,OAFIF,GACAG,EAAQxgB,KAAKshB,EAAKhG,KAAKc,GAAG,CAAEmF,aAAcC,MACvC,IAAI,KAAgBF,EAAMd,EACrC,CACA,SAASgB,GAAkBpE,GACvB,IAAI,MAAEvB,EAAK,IAAEhc,GAAQud,EAASpX,EAAI,4BAA4B+M,KAAK8I,EAAM4F,SAAS5hB,EAAM,GAAIA,IAC5F,IAAKmG,EACD,OAAO,KACX,IAAIkH,GAAO,QAAW2O,GAAOQ,aAAaxc,GAAM,GAChD,KAAOqN,IAASA,EAAKnO,KAAK2iB,OAAO,CAC7B,GAAiB,aAAbxU,EAAK2B,MAAoC,cAAb3B,EAAK2B,MAAqC,8BAAb3B,EAAK2B,MACjD,gBAAb3B,EAAK2B,MAAuC,QAAb3B,EAAK2B,MAA+B,SAAb3B,EAAK2B,KAC3D,OAAO,KACX3B,EAAOA,EAAKwJ,MAChB,CACA,MAAO,CACHzX,KAAMY,EAAMmG,EAAE,GAAGjG,OAAQiC,GAAInC,EAC7B8hB,QAASC,KACTC,SAAU,6BAElB,CACA,IAAIC,GAAkB,KACtB,SAASF,KACL,GAAIE,GACA,OAAOA,GACX,IAAItf,GAAS,KAAAuf,sBAAqB,IAAI,KAAkB,KAAYjjB,OAAO,CAAEyhB,WAAYT,KAAgB,GAAG,IAC5G,OAAOgC,GAAkBtf,EAASA,EAAOmf,QAAU,EACvD,C","sources":["webpack://thebe/../../node_modules/@lezer/markdown/dist/index.js","webpack://thebe/../../node_modules/@codemirror/lang-markdown/dist/index.js"],"sourcesContent":["import { NodeType, NodeProp, NodeSet, Tree, Parser, parseMixed } from '@lezer/common';\nimport { styleTags, tags, Tag } from '@lezer/highlight';\n\nclass CompositeBlock {\n static create(type, value, from, parentHash, end) {\n let hash = (parentHash + (parentHash << 8) + type + (value << 4)) | 0;\n return new CompositeBlock(type, value, from, hash, end, [], []);\n }\n constructor(type, \n // Used for indentation in list items, markup character in lists\n value, from, hash, end, children, positions) {\n this.type = type;\n this.value = value;\n this.from = from;\n this.hash = hash;\n this.end = end;\n this.children = children;\n this.positions = positions;\n this.hashProp = [[NodeProp.contextHash, hash]];\n }\n addChild(child, pos) {\n if (child.prop(NodeProp.contextHash) != this.hash)\n child = new Tree(child.type, child.children, child.positions, child.length, this.hashProp);\n this.children.push(child);\n this.positions.push(pos);\n }\n toTree(nodeSet, end = this.end) {\n let last = this.children.length - 1;\n if (last >= 0)\n end = Math.max(end, this.positions[last] + this.children[last].length + this.from);\n return new Tree(nodeSet.types[this.type], this.children, this.positions, end - this.from).balance({\n makeTree: (children, positions, length) => new Tree(NodeType.none, children, positions, length, this.hashProp)\n });\n }\n}\nvar Type;\n(function (Type) {\n Type[Type[\"Document\"] = 1] = \"Document\";\n Type[Type[\"CodeBlock\"] = 2] = \"CodeBlock\";\n Type[Type[\"FencedCode\"] = 3] = \"FencedCode\";\n Type[Type[\"Blockquote\"] = 4] = \"Blockquote\";\n Type[Type[\"HorizontalRule\"] = 5] = \"HorizontalRule\";\n Type[Type[\"BulletList\"] = 6] = \"BulletList\";\n Type[Type[\"OrderedList\"] = 7] = \"OrderedList\";\n Type[Type[\"ListItem\"] = 8] = \"ListItem\";\n Type[Type[\"ATXHeading1\"] = 9] = \"ATXHeading1\";\n Type[Type[\"ATXHeading2\"] = 10] = \"ATXHeading2\";\n Type[Type[\"ATXHeading3\"] = 11] = \"ATXHeading3\";\n Type[Type[\"ATXHeading4\"] = 12] = \"ATXHeading4\";\n Type[Type[\"ATXHeading5\"] = 13] = \"ATXHeading5\";\n Type[Type[\"ATXHeading6\"] = 14] = \"ATXHeading6\";\n Type[Type[\"SetextHeading1\"] = 15] = \"SetextHeading1\";\n Type[Type[\"SetextHeading2\"] = 16] = \"SetextHeading2\";\n Type[Type[\"HTMLBlock\"] = 17] = \"HTMLBlock\";\n Type[Type[\"LinkReference\"] = 18] = \"LinkReference\";\n Type[Type[\"Paragraph\"] = 19] = \"Paragraph\";\n Type[Type[\"CommentBlock\"] = 20] = \"CommentBlock\";\n Type[Type[\"ProcessingInstructionBlock\"] = 21] = \"ProcessingInstructionBlock\";\n // Inline\n Type[Type[\"Escape\"] = 22] = \"Escape\";\n Type[Type[\"Entity\"] = 23] = \"Entity\";\n Type[Type[\"HardBreak\"] = 24] = \"HardBreak\";\n Type[Type[\"Emphasis\"] = 25] = \"Emphasis\";\n Type[Type[\"StrongEmphasis\"] = 26] = \"StrongEmphasis\";\n Type[Type[\"Link\"] = 27] = \"Link\";\n Type[Type[\"Image\"] = 28] = \"Image\";\n Type[Type[\"InlineCode\"] = 29] = \"InlineCode\";\n Type[Type[\"HTMLTag\"] = 30] = \"HTMLTag\";\n Type[Type[\"Comment\"] = 31] = \"Comment\";\n Type[Type[\"ProcessingInstruction\"] = 32] = \"ProcessingInstruction\";\n Type[Type[\"Autolink\"] = 33] = \"Autolink\";\n // Smaller tokens\n Type[Type[\"HeaderMark\"] = 34] = \"HeaderMark\";\n Type[Type[\"QuoteMark\"] = 35] = \"QuoteMark\";\n Type[Type[\"ListMark\"] = 36] = \"ListMark\";\n Type[Type[\"LinkMark\"] = 37] = \"LinkMark\";\n Type[Type[\"EmphasisMark\"] = 38] = \"EmphasisMark\";\n Type[Type[\"CodeMark\"] = 39] = \"CodeMark\";\n Type[Type[\"CodeText\"] = 40] = \"CodeText\";\n Type[Type[\"CodeInfo\"] = 41] = \"CodeInfo\";\n Type[Type[\"LinkTitle\"] = 42] = \"LinkTitle\";\n Type[Type[\"LinkLabel\"] = 43] = \"LinkLabel\";\n Type[Type[\"URL\"] = 44] = \"URL\";\n})(Type || (Type = {}));\n/// Data structure used to accumulate a block's content during [leaf\n/// block parsing](#BlockParser.leaf).\nclass LeafBlock {\n /// @internal\n constructor(\n /// The start position of the block.\n start, \n /// The block's text content.\n content) {\n this.start = start;\n this.content = content;\n /// @internal\n this.marks = [];\n /// The block parsers active for this block.\n this.parsers = [];\n }\n}\n/// Data structure used during block-level per-line parsing.\nclass Line {\n constructor() {\n /// The line's full text.\n this.text = \"\";\n /// The base indent provided by the composite contexts (that have\n /// been handled so far).\n this.baseIndent = 0;\n /// The string position corresponding to the base indent.\n this.basePos = 0;\n /// The number of contexts handled @internal\n this.depth = 0;\n /// Any markers (i.e. block quote markers) parsed for the contexts. @internal\n this.markers = [];\n /// The position of the next non-whitespace character beyond any\n /// list, blockquote, or other composite block markers.\n this.pos = 0;\n /// The column of the next non-whitespace character.\n this.indent = 0;\n /// The character code of the character after `pos`.\n this.next = -1;\n }\n /// @internal\n forward() {\n if (this.basePos > this.pos)\n this.forwardInner();\n }\n /// @internal\n forwardInner() {\n let newPos = this.skipSpace(this.basePos);\n this.indent = this.countIndent(newPos, this.pos, this.indent);\n this.pos = newPos;\n this.next = newPos == this.text.length ? -1 : this.text.charCodeAt(newPos);\n }\n /// Skip whitespace after the given position, return the position of\n /// the next non-space character or the end of the line if there's\n /// only space after `from`.\n skipSpace(from) { return skipSpace(this.text, from); }\n /// @internal\n reset(text) {\n this.text = text;\n this.baseIndent = this.basePos = this.pos = this.indent = 0;\n this.forwardInner();\n this.depth = 1;\n while (this.markers.length)\n this.markers.pop();\n }\n /// Move the line's base position forward to the given position.\n /// This should only be called by composite [block\n /// parsers](#BlockParser.parse) or [markup skipping\n /// functions](#NodeSpec.composite).\n moveBase(to) {\n this.basePos = to;\n this.baseIndent = this.countIndent(to, this.pos, this.indent);\n }\n /// Move the line's base position forward to the given _column_.\n moveBaseColumn(indent) {\n this.baseIndent = indent;\n this.basePos = this.findColumn(indent);\n }\n /// Store a composite-block-level marker. Should be called from\n /// [markup skipping functions](#NodeSpec.composite) when they\n /// consume any non-whitespace characters.\n addMarker(elt) {\n this.markers.push(elt);\n }\n /// Find the column position at `to`, optionally starting at a given\n /// position and column.\n countIndent(to, from = 0, indent = 0) {\n for (let i = from; i < to; i++)\n indent += this.text.charCodeAt(i) == 9 ? 4 - indent % 4 : 1;\n return indent;\n }\n /// Find the position corresponding to the given column.\n findColumn(goal) {\n let i = 0;\n for (let indent = 0; i < this.text.length && indent < goal; i++)\n indent += this.text.charCodeAt(i) == 9 ? 4 - indent % 4 : 1;\n return i;\n }\n /// @internal\n scrub() {\n if (!this.baseIndent)\n return this.text;\n let result = \"\";\n for (let i = 0; i < this.basePos; i++)\n result += \" \";\n return result + this.text.slice(this.basePos);\n }\n}\nfunction skipForList(bl, cx, line) {\n if (line.pos == line.text.length ||\n (bl != cx.block && line.indent >= cx.stack[line.depth + 1].value + line.baseIndent))\n return true;\n if (line.indent >= line.baseIndent + 4)\n return false;\n let size = (bl.type == Type.OrderedList ? isOrderedList : isBulletList)(line, cx, false);\n return size > 0 &&\n (bl.type != Type.BulletList || isHorizontalRule(line, cx, false) < 0) &&\n line.text.charCodeAt(line.pos + size - 1) == bl.value;\n}\nconst DefaultSkipMarkup = {\n [Type.Blockquote](bl, cx, line) {\n if (line.next != 62 /* '>' */)\n return false;\n line.markers.push(elt(Type.QuoteMark, cx.lineStart + line.pos, cx.lineStart + line.pos + 1));\n line.moveBase(line.pos + (space(line.text.charCodeAt(line.pos + 1)) ? 2 : 1));\n bl.end = cx.lineStart + line.text.length;\n return true;\n },\n [Type.ListItem](bl, _cx, line) {\n if (line.indent < line.baseIndent + bl.value && line.next > -1)\n return false;\n line.moveBaseColumn(line.baseIndent + bl.value);\n return true;\n },\n [Type.OrderedList]: skipForList,\n [Type.BulletList]: skipForList,\n [Type.Document]() { return true; }\n};\nfunction space(ch) { return ch == 32 || ch == 9 || ch == 10 || ch == 13; }\nfunction skipSpace(line, i = 0) {\n while (i < line.length && space(line.charCodeAt(i)))\n i++;\n return i;\n}\nfunction skipSpaceBack(line, i, to) {\n while (i > to && space(line.charCodeAt(i - 1)))\n i--;\n return i;\n}\nfunction isFencedCode(line) {\n if (line.next != 96 && line.next != 126 /* '`~' */)\n return -1;\n let pos = line.pos + 1;\n while (pos < line.text.length && line.text.charCodeAt(pos) == line.next)\n pos++;\n if (pos < line.pos + 3)\n return -1;\n if (line.next == 96)\n for (let i = pos; i < line.text.length; i++)\n if (line.text.charCodeAt(i) == 96)\n return -1;\n return pos;\n}\nfunction isBlockquote(line) {\n return line.next != 62 /* '>' */ ? -1 : line.text.charCodeAt(line.pos + 1) == 32 ? 2 : 1;\n}\nfunction isHorizontalRule(line, cx, breaking) {\n if (line.next != 42 && line.next != 45 && line.next != 95 /* '_-*' */)\n return -1;\n let count = 1;\n for (let pos = line.pos + 1; pos < line.text.length; pos++) {\n let ch = line.text.charCodeAt(pos);\n if (ch == line.next)\n count++;\n else if (!space(ch))\n return -1;\n }\n // Setext headers take precedence\n if (breaking && line.next == 45 && isSetextUnderline(line) > -1 && line.depth == cx.stack.length &&\n cx.parser.leafBlockParsers.indexOf(DefaultLeafBlocks.SetextHeading) > -1)\n return -1;\n return count < 3 ? -1 : 1;\n}\nfunction inList(cx, type) {\n for (let i = cx.stack.length - 1; i >= 0; i--)\n if (cx.stack[i].type == type)\n return true;\n return false;\n}\nfunction isBulletList(line, cx, breaking) {\n return (line.next == 45 || line.next == 43 || line.next == 42 /* '-+*' */) &&\n (line.pos == line.text.length - 1 || space(line.text.charCodeAt(line.pos + 1))) &&\n (!breaking || inList(cx, Type.BulletList) || line.skipSpace(line.pos + 2) < line.text.length) ? 1 : -1;\n}\nfunction isOrderedList(line, cx, breaking) {\n let pos = line.pos, next = line.next;\n for (;;) {\n if (next >= 48 && next <= 57 /* '0-9' */)\n pos++;\n else\n break;\n if (pos == line.text.length)\n return -1;\n next = line.text.charCodeAt(pos);\n }\n if (pos == line.pos || pos > line.pos + 9 ||\n (next != 46 && next != 41 /* '.)' */) ||\n (pos < line.text.length - 1 && !space(line.text.charCodeAt(pos + 1))) ||\n breaking && !inList(cx, Type.OrderedList) &&\n (line.skipSpace(pos + 1) == line.text.length || pos > line.pos + 1 || line.next != 49 /* '1' */))\n return -1;\n return pos + 1 - line.pos;\n}\nfunction isAtxHeading(line) {\n if (line.next != 35 /* '#' */)\n return -1;\n let pos = line.pos + 1;\n while (pos < line.text.length && line.text.charCodeAt(pos) == 35)\n pos++;\n if (pos < line.text.length && line.text.charCodeAt(pos) != 32)\n return -1;\n let size = pos - line.pos;\n return size > 6 ? -1 : size;\n}\nfunction isSetextUnderline(line) {\n if (line.next != 45 && line.next != 61 /* '-=' */ || line.indent >= line.baseIndent + 4)\n return -1;\n let pos = line.pos + 1;\n while (pos < line.text.length && line.text.charCodeAt(pos) == line.next)\n pos++;\n let end = pos;\n while (pos < line.text.length && space(line.text.charCodeAt(pos)))\n pos++;\n return pos == line.text.length ? end : -1;\n}\nconst EmptyLine = /^[ \\t]*$/, CommentEnd = /-->/, ProcessingEnd = /\\?>/;\nconst HTMLBlockStyle = [\n [/^<(?:script|pre|style)(?:\\s|>|$)/i, /<\\/(?:script|pre|style)>/i],\n [/^\\s*/i.exec(after);\n if (comment)\n return cx.append(elt(Type.Comment, start, start + 1 + comment[0].length));\n let procInst = /^\\?[^]*?\\?>/.exec(after);\n if (procInst)\n return cx.append(elt(Type.ProcessingInstruction, start, start + 1 + procInst[0].length));\n let m = /^(?:![A-Z][^]*?>|!\\[CDATA\\[[^]*?\\]\\]>|\\/\\s*[a-zA-Z][\\w-]*\\s*>|\\s*[a-zA-Z][\\w-]*(\\s+[a-zA-Z:_][\\w-.:]*(?:\\s*=\\s*(?:[^\\s\"'=<>`]+|'[^']*'|\"[^\"]*\"))?)*\\s*(\\/\\s*)?>)/.exec(after);\n if (!m)\n return -1;\n return cx.append(elt(Type.HTMLTag, start, start + 1 + m[0].length));\n },\n Emphasis(cx, next, start) {\n if (next != 95 && next != 42)\n return -1;\n let pos = start + 1;\n while (cx.char(pos) == next)\n pos++;\n let before = cx.slice(start - 1, start), after = cx.slice(pos, pos + 1);\n let pBefore = Punctuation.test(before), pAfter = Punctuation.test(after);\n let sBefore = /\\s|^$/.test(before), sAfter = /\\s|^$/.test(after);\n let leftFlanking = !sAfter && (!pAfter || sBefore || pBefore);\n let rightFlanking = !sBefore && (!pBefore || sAfter || pAfter);\n let canOpen = leftFlanking && (next == 42 || !rightFlanking || pBefore);\n let canClose = rightFlanking && (next == 42 || !leftFlanking || pAfter);\n return cx.append(new InlineDelimiter(next == 95 ? EmphasisUnderscore : EmphasisAsterisk, start, pos, (canOpen ? 1 /* Mark.Open */ : 0 /* Mark.None */) | (canClose ? 2 /* Mark.Close */ : 0 /* Mark.None */)));\n },\n HardBreak(cx, next, start) {\n if (next == 92 /* '\\\\' */ && cx.char(start + 1) == 10 /* '\\n' */)\n return cx.append(elt(Type.HardBreak, start, start + 2));\n if (next == 32) {\n let pos = start + 1;\n while (cx.char(pos) == 32)\n pos++;\n if (cx.char(pos) == 10 && pos >= start + 2)\n return cx.append(elt(Type.HardBreak, start, pos + 1));\n }\n return -1;\n },\n Link(cx, next, start) {\n return next == 91 /* '[' */ ? cx.append(new InlineDelimiter(LinkStart, start, start + 1, 1 /* Mark.Open */)) : -1;\n },\n Image(cx, next, start) {\n return next == 33 /* '!' */ && cx.char(start + 1) == 91 /* '[' */\n ? cx.append(new InlineDelimiter(ImageStart, start, start + 2, 1 /* Mark.Open */)) : -1;\n },\n LinkEnd(cx, next, start) {\n if (next != 93 /* ']' */)\n return -1;\n // Scanning back to the next link/image start marker\n for (let i = cx.parts.length - 1; i >= 0; i--) {\n let part = cx.parts[i];\n if (part instanceof InlineDelimiter && (part.type == LinkStart || part.type == ImageStart)) {\n // If this one has been set invalid (because it would produce\n // a nested link) or there's no valid link here ignore both.\n if (!part.side || cx.skipSpace(part.to) == start && !/[(\\[]/.test(cx.slice(start + 1, start + 2))) {\n cx.parts[i] = null;\n return -1;\n }\n // Finish the content and replace the entire range in\n // this.parts with the link/image node.\n let content = cx.takeContent(i);\n let link = cx.parts[i] = finishLink(cx, content, part.type == LinkStart ? Type.Link : Type.Image, part.from, start + 1);\n // Set any open-link markers before this link to invalid.\n if (part.type == LinkStart)\n for (let j = 0; j < i; j++) {\n let p = cx.parts[j];\n if (p instanceof InlineDelimiter && p.type == LinkStart)\n p.side = 0 /* Mark.None */;\n }\n return link.to;\n }\n }\n return -1;\n }\n};\nfunction finishLink(cx, content, type, start, startPos) {\n let { text } = cx, next = cx.char(startPos), endPos = startPos;\n content.unshift(elt(Type.LinkMark, start, start + (type == Type.Image ? 2 : 1)));\n content.push(elt(Type.LinkMark, startPos - 1, startPos));\n if (next == 40 /* '(' */) {\n let pos = cx.skipSpace(startPos + 1);\n let dest = parseURL(text, pos - cx.offset, cx.offset), title;\n if (dest) {\n pos = cx.skipSpace(dest.to);\n // The destination and title must be separated by whitespace\n if (pos != dest.to) {\n title = parseLinkTitle(text, pos - cx.offset, cx.offset);\n if (title)\n pos = cx.skipSpace(title.to);\n }\n }\n if (cx.char(pos) == 41 /* ')' */) {\n content.push(elt(Type.LinkMark, startPos, startPos + 1));\n endPos = pos + 1;\n if (dest)\n content.push(dest);\n if (title)\n content.push(title);\n content.push(elt(Type.LinkMark, pos, endPos));\n }\n }\n else if (next == 91 /* '[' */) {\n let label = parseLinkLabel(text, startPos - cx.offset, cx.offset, false);\n if (label) {\n content.push(label);\n endPos = label.to;\n }\n }\n return elt(type, start, endPos, content);\n}\n// These return `null` when falling off the end of the input, `false`\n// when parsing fails otherwise (for use in the incremental link\n// reference parser).\nfunction parseURL(text, start, offset) {\n let next = text.charCodeAt(start);\n if (next == 60 /* '<' */) {\n for (let pos = start + 1; pos < text.length; pos++) {\n let ch = text.charCodeAt(pos);\n if (ch == 62 /* '>' */)\n return elt(Type.URL, start + offset, pos + 1 + offset);\n if (ch == 60 || ch == 10 /* '<\\n' */)\n return false;\n }\n return null;\n }\n else {\n let depth = 0, pos = start;\n for (let escaped = false; pos < text.length; pos++) {\n let ch = text.charCodeAt(pos);\n if (space(ch)) {\n break;\n }\n else if (escaped) {\n escaped = false;\n }\n else if (ch == 40 /* '(' */) {\n depth++;\n }\n else if (ch == 41 /* ')' */) {\n if (!depth)\n break;\n depth--;\n }\n else if (ch == 92 /* '\\\\' */) {\n escaped = true;\n }\n }\n return pos > start ? elt(Type.URL, start + offset, pos + offset) : pos == text.length ? null : false;\n }\n}\nfunction parseLinkTitle(text, start, offset) {\n let next = text.charCodeAt(start);\n if (next != 39 && next != 34 && next != 40 /* '\"\\'(' */)\n return false;\n let end = next == 40 ? 41 : next;\n for (let pos = start + 1, escaped = false; pos < text.length; pos++) {\n let ch = text.charCodeAt(pos);\n if (escaped)\n escaped = false;\n else if (ch == end)\n return elt(Type.LinkTitle, start + offset, pos + 1 + offset);\n else if (ch == 92 /* '\\\\' */)\n escaped = true;\n }\n return null;\n}\nfunction parseLinkLabel(text, start, offset, requireNonWS) {\n for (let escaped = false, pos = start + 1, end = Math.min(text.length, pos + 999); pos < end; pos++) {\n let ch = text.charCodeAt(pos);\n if (escaped)\n escaped = false;\n else if (ch == 93 /* ']' */)\n return requireNonWS ? false : elt(Type.LinkLabel, start + offset, pos + 1 + offset);\n else {\n if (requireNonWS && !space(ch))\n requireNonWS = false;\n if (ch == 91 /* '[' */)\n return false;\n else if (ch == 92 /* '\\\\' */)\n escaped = true;\n }\n }\n return null;\n}\n/// Inline parsing functions get access to this context, and use it to\n/// read the content and emit syntax nodes.\nclass InlineContext {\n /// @internal\n constructor(\n /// The parser that is being used.\n parser, \n /// The text of this inline section.\n text, \n /// The starting offset of the section in the document.\n offset) {\n this.parser = parser;\n this.text = text;\n this.offset = offset;\n /// @internal\n this.parts = [];\n }\n /// Get the character code at the given (document-relative)\n /// position.\n char(pos) { return pos >= this.end ? -1 : this.text.charCodeAt(pos - this.offset); }\n /// The position of the end of this inline section.\n get end() { return this.offset + this.text.length; }\n /// Get a substring of this inline section. Again uses\n /// document-relative positions.\n slice(from, to) { return this.text.slice(from - this.offset, to - this.offset); }\n /// @internal\n append(elt) {\n this.parts.push(elt);\n return elt.to;\n }\n /// Add a [delimiter](#DelimiterType) at this given position. `open`\n /// and `close` indicate whether this delimiter is opening, closing,\n /// or both. Returns the end of the delimiter, for convenient\n /// returning from [parse functions](#InlineParser.parse).\n addDelimiter(type, from, to, open, close) {\n return this.append(new InlineDelimiter(type, from, to, (open ? 1 /* Mark.Open */ : 0 /* Mark.None */) | (close ? 2 /* Mark.Close */ : 0 /* Mark.None */)));\n }\n /// Returns true when there is an unmatched link or image opening\n /// token before the current position.\n get hasOpenLink() {\n for (let i = this.parts.length - 1; i >= 0; i--) {\n let part = this.parts[i];\n if (part instanceof InlineDelimiter && (part.type == LinkStart || part.type == ImageStart))\n return true;\n }\n return false;\n }\n /// Add an inline element. Returns the end of the element.\n addElement(elt) {\n return this.append(elt);\n }\n /// Resolve markers between this.parts.length and from, wrapping matched markers in the\n /// appropriate node and updating the content of this.parts. @internal\n resolveMarkers(from) {\n // Scan forward, looking for closing tokens\n for (let i = from; i < this.parts.length; i++) {\n let close = this.parts[i];\n if (!(close instanceof InlineDelimiter && close.type.resolve && (close.side & 2 /* Mark.Close */)))\n continue;\n let emp = close.type == EmphasisUnderscore || close.type == EmphasisAsterisk;\n let closeSize = close.to - close.from;\n let open, j = i - 1;\n // Continue scanning for a matching opening token\n for (; j >= from; j--) {\n let part = this.parts[j];\n if (part instanceof InlineDelimiter && (part.side & 1 /* Mark.Open */) && part.type == close.type &&\n // Ignore emphasis delimiters where the character count doesn't match\n !(emp && ((close.side & 1 /* Mark.Open */) || (part.side & 2 /* Mark.Close */)) &&\n (part.to - part.from + closeSize) % 3 == 0 && ((part.to - part.from) % 3 || closeSize % 3))) {\n open = part;\n break;\n }\n }\n if (!open)\n continue;\n let type = close.type.resolve, content = [];\n let start = open.from, end = close.to;\n // Emphasis marker effect depends on the character count. Size consumed is minimum of the two\n // markers.\n if (emp) {\n let size = Math.min(2, open.to - open.from, closeSize);\n start = open.to - size;\n end = close.from + size;\n type = size == 1 ? \"Emphasis\" : \"StrongEmphasis\";\n }\n // Move the covered region into content, optionally adding marker nodes\n if (open.type.mark)\n content.push(this.elt(open.type.mark, start, open.to));\n for (let k = j + 1; k < i; k++) {\n if (this.parts[k] instanceof Element)\n content.push(this.parts[k]);\n this.parts[k] = null;\n }\n if (close.type.mark)\n content.push(this.elt(close.type.mark, close.from, end));\n let element = this.elt(type, start, end, content);\n // If there are leftover emphasis marker characters, shrink the close/open markers. Otherwise, clear them.\n this.parts[j] = emp && open.from != start ? new InlineDelimiter(open.type, open.from, start, open.side) : null;\n let keep = this.parts[i] = emp && close.to != end ? new InlineDelimiter(close.type, end, close.to, close.side) : null;\n // Insert the new element in this.parts\n if (keep)\n this.parts.splice(i, 0, element);\n else\n this.parts[i] = element;\n }\n // Collect the elements remaining in this.parts into an array.\n let result = [];\n for (let i = from; i < this.parts.length; i++) {\n let part = this.parts[i];\n if (part instanceof Element)\n result.push(part);\n }\n return result;\n }\n /// Find an opening delimiter of the given type. Returns `null` if\n /// no delimiter is found, or an index that can be passed to\n /// [`takeContent`](#InlineContext.takeContent) otherwise.\n findOpeningDelimiter(type) {\n for (let i = this.parts.length - 1; i >= 0; i--) {\n let part = this.parts[i];\n if (part instanceof InlineDelimiter && part.type == type)\n return i;\n }\n return null;\n }\n /// Remove all inline elements and delimiters starting from the\n /// given index (which you should get from\n /// [`findOpeningDelimiter`](#InlineContext.findOpeningDelimiter),\n /// resolve delimiters inside of them, and return them as an array\n /// of elements.\n takeContent(startIndex) {\n let content = this.resolveMarkers(startIndex);\n this.parts.length = startIndex;\n return content;\n }\n /// Skip space after the given (document) position, returning either\n /// the position of the next non-space character or the end of the\n /// section.\n skipSpace(from) { return skipSpace(this.text, from - this.offset) + this.offset; }\n elt(type, from, to, children) {\n if (typeof type == \"string\")\n return elt(this.parser.getNodeType(type), from, to, children);\n return new TreeElement(type, from);\n }\n}\nfunction injectMarks(elements, marks) {\n if (!marks.length)\n return elements;\n if (!elements.length)\n return marks;\n let elts = elements.slice(), eI = 0;\n for (let mark of marks) {\n while (eI < elts.length && elts[eI].to < mark.to)\n eI++;\n if (eI < elts.length && elts[eI].from < mark.from) {\n let e = elts[eI];\n if (e instanceof Element)\n elts[eI] = new Element(e.type, e.from, e.to, injectMarks(e.children, [mark]));\n }\n else {\n elts.splice(eI++, 0, mark);\n }\n }\n return elts;\n}\n// These are blocks that can span blank lines, and should thus only be\n// reused if their next sibling is also being reused.\nconst NotLast = [Type.CodeBlock, Type.ListItem, Type.OrderedList, Type.BulletList];\nclass FragmentCursor {\n constructor(fragments, input) {\n this.fragments = fragments;\n this.input = input;\n // Index into fragment array\n this.i = 0;\n // Active fragment\n this.fragment = null;\n this.fragmentEnd = -1;\n // Cursor into the current fragment, if any. When `moveTo` returns\n // true, this points at the first block after `pos`.\n this.cursor = null;\n if (fragments.length)\n this.fragment = fragments[this.i++];\n }\n nextFragment() {\n this.fragment = this.i < this.fragments.length ? this.fragments[this.i++] : null;\n this.cursor = null;\n this.fragmentEnd = -1;\n }\n moveTo(pos, lineStart) {\n while (this.fragment && this.fragment.to <= pos)\n this.nextFragment();\n if (!this.fragment || this.fragment.from > (pos ? pos - 1 : 0))\n return false;\n if (this.fragmentEnd < 0) {\n let end = this.fragment.to;\n while (end > 0 && this.input.read(end - 1, end) != \"\\n\")\n end--;\n this.fragmentEnd = end ? end - 1 : 0;\n }\n let c = this.cursor;\n if (!c) {\n c = this.cursor = this.fragment.tree.cursor();\n c.firstChild();\n }\n let rPos = pos + this.fragment.offset;\n while (c.to <= rPos)\n if (!c.parent())\n return false;\n for (;;) {\n if (c.from >= rPos)\n return this.fragment.from <= lineStart;\n if (!c.childAfter(rPos))\n return false;\n }\n }\n matches(hash) {\n let tree = this.cursor.tree;\n return tree && tree.prop(NodeProp.contextHash) == hash;\n }\n takeNodes(cx) {\n let cur = this.cursor, off = this.fragment.offset, fragEnd = this.fragmentEnd - (this.fragment.openEnd ? 1 : 0);\n let start = cx.absoluteLineStart, end = start, blockI = cx.block.children.length;\n let prevEnd = end, prevI = blockI;\n for (;;) {\n if (cur.to - off > fragEnd) {\n if (cur.type.isAnonymous && cur.firstChild())\n continue;\n break;\n }\n let pos = toRelative(cur.from - off, cx.ranges);\n if (cur.to - off <= cx.ranges[cx.rangeI].to) { // Fits in current range\n cx.addNode(cur.tree, pos);\n }\n else {\n let dummy = new Tree(cx.parser.nodeSet.types[Type.Paragraph], [], [], 0, cx.block.hashProp);\n cx.reusePlaceholders.set(dummy, cur.tree);\n cx.addNode(dummy, pos);\n }\n // Taken content must always end in a block, because incremental\n // parsing happens on block boundaries. Never stop directly\n // after an indented code block, since those can continue after\n // any number of blank lines.\n if (cur.type.is(\"Block\")) {\n if (NotLast.indexOf(cur.type.id) < 0) {\n end = cur.to - off;\n blockI = cx.block.children.length;\n }\n else {\n end = prevEnd;\n blockI = prevI;\n prevEnd = cur.to - off;\n prevI = cx.block.children.length;\n }\n }\n if (!cur.nextSibling())\n break;\n }\n while (cx.block.children.length > blockI) {\n cx.block.children.pop();\n cx.block.positions.pop();\n }\n return end - start;\n }\n}\n// Convert an input-stream-relative position to a\n// Markdown-doc-relative position by subtracting the size of all input\n// gaps before `abs`.\nfunction toRelative(abs, ranges) {\n let pos = abs;\n for (let i = 1; i < ranges.length; i++) {\n let gapFrom = ranges[i - 1].to, gapTo = ranges[i].from;\n if (gapFrom < abs)\n pos -= gapTo - gapFrom;\n }\n return pos;\n}\nconst markdownHighlighting = styleTags({\n \"Blockquote/...\": tags.quote,\n HorizontalRule: tags.contentSeparator,\n \"ATXHeading1/... SetextHeading1/...\": tags.heading1,\n \"ATXHeading2/... SetextHeading2/...\": tags.heading2,\n \"ATXHeading3/...\": tags.heading3,\n \"ATXHeading4/...\": tags.heading4,\n \"ATXHeading5/...\": tags.heading5,\n \"ATXHeading6/...\": tags.heading6,\n \"Comment CommentBlock\": tags.comment,\n Escape: tags.escape,\n Entity: tags.character,\n \"Emphasis/...\": tags.emphasis,\n \"StrongEmphasis/...\": tags.strong,\n \"Link/... Image/...\": tags.link,\n \"OrderedList/... BulletList/...\": tags.list,\n \"BlockQuote/...\": tags.quote,\n \"InlineCode CodeText\": tags.monospace,\n \"URL Autolink\": tags.url,\n \"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark\": tags.processingInstruction,\n \"CodeInfo LinkLabel\": tags.labelName,\n LinkTitle: tags.string,\n Paragraph: tags.content\n});\n/// The default CommonMark parser.\nconst parser = new MarkdownParser(new NodeSet(nodeTypes).extend(markdownHighlighting), Object.keys(DefaultBlockParsers).map(n => DefaultBlockParsers[n]), Object.keys(DefaultBlockParsers).map(n => DefaultLeafBlocks[n]), Object.keys(DefaultBlockParsers), DefaultEndLeaf, DefaultSkipMarkup, Object.keys(DefaultInline).map(n => DefaultInline[n]), Object.keys(DefaultInline), []);\n\nfunction leftOverSpace(node, from, to) {\n let ranges = [];\n for (let n = node.firstChild, pos = from;; n = n.nextSibling) {\n let nextPos = n ? n.from : to;\n if (nextPos > pos)\n ranges.push({ from: pos, to: nextPos });\n if (!n)\n break;\n pos = n.to;\n }\n return ranges;\n}\n/// Create a Markdown extension to enable nested parsing on code\n/// blocks and/or embedded HTML.\nfunction parseCode(config) {\n let { codeParser, htmlParser } = config;\n let wrap = parseMixed((node, input) => {\n let id = node.type.id;\n if (codeParser && (id == Type.CodeBlock || id == Type.FencedCode)) {\n let info = \"\";\n if (id == Type.FencedCode) {\n let infoNode = node.node.getChild(Type.CodeInfo);\n if (infoNode)\n info = input.read(infoNode.from, infoNode.to);\n }\n let parser = codeParser(info);\n if (parser)\n return { parser, overlay: node => node.type.id == Type.CodeText };\n }\n else if (htmlParser && (id == Type.HTMLBlock || id == Type.HTMLTag)) {\n return { parser: htmlParser, overlay: leftOverSpace(node.node, node.from, node.to) };\n }\n return null;\n });\n return { wrap };\n}\n\nconst StrikethroughDelim = { resolve: \"Strikethrough\", mark: \"StrikethroughMark\" };\n/// An extension that implements\n/// [GFM-style](https://github.github.com/gfm/#strikethrough-extension-)\n/// Strikethrough syntax using `~~` delimiters.\nconst Strikethrough = {\n defineNodes: [{\n name: \"Strikethrough\",\n style: { \"Strikethrough/...\": tags.strikethrough }\n }, {\n name: \"StrikethroughMark\",\n style: tags.processingInstruction\n }],\n parseInline: [{\n name: \"Strikethrough\",\n parse(cx, next, pos) {\n if (next != 126 /* '~' */ || cx.char(pos + 1) != 126 || cx.char(pos + 2) == 126)\n return -1;\n let before = cx.slice(pos - 1, pos), after = cx.slice(pos + 2, pos + 3);\n let sBefore = /\\s|^$/.test(before), sAfter = /\\s|^$/.test(after);\n let pBefore = Punctuation.test(before), pAfter = Punctuation.test(after);\n return cx.addDelimiter(StrikethroughDelim, pos, pos + 2, !sAfter && (!pAfter || sBefore || pBefore), !sBefore && (!pBefore || sAfter || pAfter));\n },\n after: \"Emphasis\"\n }]\n};\nfunction parseRow(cx, line, startI = 0, elts, offset = 0) {\n let count = 0, first = true, cellStart = -1, cellEnd = -1, esc = false;\n let parseCell = () => {\n elts.push(cx.elt(\"TableCell\", offset + cellStart, offset + cellEnd, cx.parser.parseInline(line.slice(cellStart, cellEnd), offset + cellStart)));\n };\n for (let i = startI; i < line.length; i++) {\n let next = line.charCodeAt(i);\n if (next == 124 /* '|' */ && !esc) {\n if (!first || cellStart > -1)\n count++;\n first = false;\n if (elts) {\n if (cellStart > -1)\n parseCell();\n elts.push(cx.elt(\"TableDelimiter\", i + offset, i + offset + 1));\n }\n cellStart = cellEnd = -1;\n }\n else if (esc || next != 32 && next != 9) {\n if (cellStart < 0)\n cellStart = i;\n cellEnd = i + 1;\n }\n esc = !esc && next == 92;\n }\n if (cellStart > -1) {\n count++;\n if (elts)\n parseCell();\n }\n return count;\n}\nfunction hasPipe(str, start) {\n for (let i = start; i < str.length; i++) {\n let next = str.charCodeAt(i);\n if (next == 124 /* '|' */)\n return true;\n if (next == 92 /* '\\\\' */)\n i++;\n }\n return false;\n}\nconst delimiterLine = /^\\|?(\\s*:?-+:?\\s*\\|)+(\\s*:?-+:?\\s*)?$/;\nclass TableParser {\n constructor() {\n // Null means we haven't seen the second line yet, false means this\n // isn't a table, and an array means this is a table and we've\n // parsed the given rows so far.\n this.rows = null;\n }\n nextLine(cx, line, leaf) {\n if (this.rows == null) { // Second line\n this.rows = false;\n let lineText;\n if ((line.next == 45 || line.next == 58 || line.next == 124 /* '-:|' */) &&\n delimiterLine.test(lineText = line.text.slice(line.pos))) {\n let firstRow = [], firstCount = parseRow(cx, leaf.content, 0, firstRow, leaf.start);\n if (firstCount == parseRow(cx, lineText, line.pos))\n this.rows = [cx.elt(\"TableHeader\", leaf.start, leaf.start + leaf.content.length, firstRow),\n cx.elt(\"TableDelimiter\", cx.lineStart + line.pos, cx.lineStart + line.text.length)];\n }\n }\n else if (this.rows) { // Line after the second\n let content = [];\n parseRow(cx, line.text, line.pos, content, cx.lineStart);\n this.rows.push(cx.elt(\"TableRow\", cx.lineStart + line.pos, cx.lineStart + line.text.length, content));\n }\n return false;\n }\n finish(cx, leaf) {\n if (!this.rows)\n return false;\n cx.addLeafElement(leaf, cx.elt(\"Table\", leaf.start, leaf.start + leaf.content.length, this.rows));\n return true;\n }\n}\n/// This extension provides\n/// [GFM-style](https://github.github.com/gfm/#tables-extension-)\n/// tables, using syntax like this:\n///\n/// ```\n/// | head 1 | head 2 |\n/// | --- | --- |\n/// | cell 1 | cell 2 |\n/// ```\nconst Table = {\n defineNodes: [\n { name: \"Table\", block: true },\n { name: \"TableHeader\", style: { \"TableHeader/...\": tags.heading } },\n \"TableRow\",\n { name: \"TableCell\", style: tags.content },\n { name: \"TableDelimiter\", style: tags.processingInstruction },\n ],\n parseBlock: [{\n name: \"Table\",\n leaf(_, leaf) { return hasPipe(leaf.content, 0) ? new TableParser : null; },\n endLeaf(cx, line, leaf) {\n if (leaf.parsers.some(p => p instanceof TableParser) || !hasPipe(line.text, line.basePos))\n return false;\n let next = cx.scanLine(cx.absoluteLineEnd + 1).text;\n return delimiterLine.test(next) && parseRow(cx, line.text, line.basePos) == parseRow(cx, next, line.basePos);\n },\n before: \"SetextHeading\"\n }]\n};\nclass TaskParser {\n nextLine() { return false; }\n finish(cx, leaf) {\n cx.addLeafElement(leaf, cx.elt(\"Task\", leaf.start, leaf.start + leaf.content.length, [\n cx.elt(\"TaskMarker\", leaf.start, leaf.start + 3),\n ...cx.parser.parseInline(leaf.content.slice(3), leaf.start + 3)\n ]));\n return true;\n }\n}\n/// Extension providing\n/// [GFM-style](https://github.github.com/gfm/#task-list-items-extension-)\n/// task list items, where list items can be prefixed with `[ ]` or\n/// `[x]` to add a checkbox.\nconst TaskList = {\n defineNodes: [\n { name: \"Task\", block: true, style: tags.list },\n { name: \"TaskMarker\", style: tags.atom }\n ],\n parseBlock: [{\n name: \"TaskList\",\n leaf(cx, leaf) {\n return /^\\[[ xX]\\][ \\t]/.test(leaf.content) && cx.parentType().name == \"ListItem\" ? new TaskParser : null;\n },\n after: \"SetextHeading\"\n }]\n};\nconst autolinkRE = /(www\\.)|(https?:\\/\\/)|([\\w.+-]+@)|(mailto:|xmpp:)/gy;\nconst urlRE = /[\\w-]+(\\.[\\w-]+)+(\\/[^\\s<]*)?/gy;\nconst lastTwoDomainWords = /[\\w-]+\\.[\\w-]+($|\\/)/;\nconst emailRE = /[\\w.+-]+@[\\w-]+(\\.[\\w.-]+)+/gy;\nconst xmppResourceRE = /\\/[a-zA-Z\\d@.]+/gy;\nfunction count(str, from, to, ch) {\n let result = 0;\n for (let i = from; i < to; i++)\n if (str[i] == ch)\n result++;\n return result;\n}\nfunction autolinkURLEnd(text, from) {\n urlRE.lastIndex = from;\n let m = urlRE.exec(text);\n if (!m || lastTwoDomainWords.exec(m[0])[0].indexOf(\"_\") > -1)\n return -1;\n let end = from + m[0].length;\n for (;;) {\n let last = text[end - 1], m;\n if (/[?!.,:*_~]/.test(last) ||\n last == \")\" && count(text, from, end, \")\") > count(text, from, end, \"(\"))\n end--;\n else if (last == \";\" && (m = /&(?:#\\d+|#x[a-f\\d]+|\\w+);$/.exec(text.slice(from, end))))\n end = from + m.index;\n else\n break;\n }\n return end;\n}\nfunction autolinkEmailEnd(text, from) {\n emailRE.lastIndex = from;\n let m = emailRE.exec(text);\n if (!m)\n return -1;\n let last = m[0][m[0].length - 1];\n return last == \"_\" || last == \"-\" ? -1 : from + m[0].length - (last == \".\" ? 1 : 0);\n}\n/// Extension that implements autolinking for\n/// `www.`/`http://`/`https://`/`mailto:`/`xmpp:` URLs and email\n/// addresses.\nconst Autolink = {\n parseInline: [{\n name: \"Autolink\",\n parse(cx, next, absPos) {\n let pos = absPos - cx.offset;\n autolinkRE.lastIndex = pos;\n let m = autolinkRE.exec(cx.text), end = -1;\n if (!m)\n return -1;\n if (m[1] || m[2]) { // www., http://\n end = autolinkURLEnd(cx.text, pos + m[0].length);\n if (end > -1 && cx.hasOpenLink) {\n let noBracket = /([^\\[\\]]|\\[[^\\]]*\\])*/.exec(cx.text.slice(pos, end));\n end = pos + noBracket[0].length;\n }\n }\n else if (m[3]) { // email address\n end = autolinkEmailEnd(cx.text, pos);\n }\n else { // mailto:/xmpp:\n end = autolinkEmailEnd(cx.text, pos + m[0].length);\n if (end > -1 && m[0] == \"xmpp:\") {\n xmppResourceRE.lastIndex = end;\n m = xmppResourceRE.exec(cx.text);\n if (m)\n end = m.index + m[0].length;\n }\n }\n if (end < 0)\n return -1;\n cx.addElement(cx.elt(\"URL\", absPos, end + cx.offset));\n return end + cx.offset;\n }\n }]\n};\n/// Extension bundle containing [`Table`](#Table),\n/// [`TaskList`](#TaskList), [`Strikethrough`](#Strikethrough), and\n/// [`Autolink`](#Autolink).\nconst GFM = [Table, TaskList, Strikethrough, Autolink];\nfunction parseSubSuper(ch, node, mark) {\n return (cx, next, pos) => {\n if (next != ch || cx.char(pos + 1) == ch)\n return -1;\n let elts = [cx.elt(mark, pos, pos + 1)];\n for (let i = pos + 1; i < cx.end; i++) {\n let next = cx.char(i);\n if (next == ch)\n return cx.addElement(cx.elt(node, pos, i + 1, elts.concat(cx.elt(mark, i, i + 1))));\n if (next == 92 /* '\\\\' */)\n elts.push(cx.elt(\"Escape\", i, i++ + 2));\n if (space(next))\n break;\n }\n return -1;\n };\n}\n/// Extension providing\n/// [Pandoc-style](https://pandoc.org/MANUAL.html#superscripts-and-subscripts)\n/// superscript using `^` markers.\nconst Superscript = {\n defineNodes: [\n { name: \"Superscript\", style: tags.special(tags.content) },\n { name: \"SuperscriptMark\", style: tags.processingInstruction }\n ],\n parseInline: [{\n name: \"Superscript\",\n parse: parseSubSuper(94 /* '^' */, \"Superscript\", \"SuperscriptMark\")\n }]\n};\n/// Extension providing\n/// [Pandoc-style](https://pandoc.org/MANUAL.html#superscripts-and-subscripts)\n/// subscript using `~` markers.\nconst Subscript = {\n defineNodes: [\n { name: \"Subscript\", style: tags.special(tags.content) },\n { name: \"SubscriptMark\", style: tags.processingInstruction }\n ],\n parseInline: [{\n name: \"Subscript\",\n parse: parseSubSuper(126 /* '~' */, \"Subscript\", \"SubscriptMark\")\n }]\n};\n/// Extension that parses two colons with only letters, underscores,\n/// and numbers between them as `Emoji` nodes.\nconst Emoji = {\n defineNodes: [{ name: \"Emoji\", style: tags.character }],\n parseInline: [{\n name: \"Emoji\",\n parse(cx, next, pos) {\n let match;\n if (next != 58 /* ':' */ || !(match = /^[a-zA-Z_0-9]+:/.exec(cx.slice(pos + 1, cx.end))))\n return -1;\n return cx.addElement(cx.elt(\"Emoji\", pos, pos + 1 + match[0].length));\n }\n }]\n};\n\nexport { Autolink, BlockContext, Element, Emoji, GFM, InlineContext, LeafBlock, Line, MarkdownParser, Strikethrough, Subscript, Superscript, Table, TaskList, parseCode, parser };\n","import { EditorSelection, countColumn, Prec, EditorState } from '@codemirror/state';\nimport { keymap } from '@codemirror/view';\nimport { defineLanguageFacet, foldNodeProp, indentNodeProp, languageDataProp, foldService, syntaxTree, Language, LanguageDescription, ParseContext, indentUnit, LanguageSupport } from '@codemirror/language';\nimport { CompletionContext } from '@codemirror/autocomplete';\nimport { parser, GFM, Subscript, Superscript, Emoji, MarkdownParser, parseCode } from '@lezer/markdown';\nimport { html, htmlCompletionSource } from '@codemirror/lang-html';\nimport { NodeProp } from '@lezer/common';\n\nconst data = /*@__PURE__*/defineLanguageFacet({ commentTokens: { block: { open: \"\" } } });\nconst headingProp = /*@__PURE__*/new NodeProp();\nconst commonmark = /*@__PURE__*/parser.configure({\n props: [\n /*@__PURE__*/foldNodeProp.add(type => {\n return !type.is(\"Block\") || type.is(\"Document\") || isHeading(type) != null || isList(type) ? undefined\n : (tree, state) => ({ from: state.doc.lineAt(tree.from).to, to: tree.to });\n }),\n /*@__PURE__*/headingProp.add(isHeading),\n /*@__PURE__*/indentNodeProp.add({\n Document: () => null\n }),\n /*@__PURE__*/languageDataProp.add({\n Document: data\n })\n ]\n});\nfunction isHeading(type) {\n let match = /^(?:ATX|Setext)Heading(\\d)$/.exec(type.name);\n return match ? +match[1] : undefined;\n}\nfunction isList(type) {\n return type.name == \"OrderedList\" || type.name == \"BulletList\";\n}\nfunction findSectionEnd(headerNode, level) {\n let last = headerNode;\n for (;;) {\n let next = last.nextSibling, heading;\n if (!next || (heading = isHeading(next.type)) != null && heading <= level)\n break;\n last = next;\n }\n return last.to;\n}\nconst headerIndent = /*@__PURE__*/foldService.of((state, start, end) => {\n for (let node = syntaxTree(state).resolveInner(end, -1); node; node = node.parent) {\n if (node.from < start)\n break;\n let heading = node.type.prop(headingProp);\n if (heading == null)\n continue;\n let upto = findSectionEnd(node, heading);\n if (upto > end)\n return { from: end, to: upto };\n }\n return null;\n});\nfunction mkLang(parser) {\n return new Language(data, parser, [headerIndent], \"markdown\");\n}\n/**\nLanguage support for strict CommonMark.\n*/\nconst commonmarkLanguage = /*@__PURE__*/mkLang(commonmark);\nconst extended = /*@__PURE__*/commonmark.configure([GFM, Subscript, Superscript, Emoji, {\n props: [\n /*@__PURE__*/foldNodeProp.add({\n Table: (tree, state) => ({ from: state.doc.lineAt(tree.from).to, to: tree.to })\n })\n ]\n }]);\n/**\nLanguage support for [GFM](https://github.github.com/gfm/) plus\nsubscript, superscript, and emoji syntax.\n*/\nconst markdownLanguage = /*@__PURE__*/mkLang(extended);\nfunction getCodeParser(languages, defaultLanguage) {\n return (info) => {\n if (info && languages) {\n let found = null;\n // Strip anything after whitespace\n info = /\\S*/.exec(info)[0];\n if (typeof languages == \"function\")\n found = languages(info);\n else\n found = LanguageDescription.matchLanguageName(languages, info, true);\n if (found instanceof LanguageDescription)\n return found.support ? found.support.language.parser : ParseContext.getSkippingParser(found.load());\n else if (found)\n return found.parser;\n }\n return defaultLanguage ? defaultLanguage.parser : null;\n };\n}\n\nclass Context {\n constructor(node, from, to, spaceBefore, spaceAfter, type, item) {\n this.node = node;\n this.from = from;\n this.to = to;\n this.spaceBefore = spaceBefore;\n this.spaceAfter = spaceAfter;\n this.type = type;\n this.item = item;\n }\n blank(maxWidth, trailing = true) {\n let result = this.spaceBefore + (this.node.name == \"Blockquote\" ? \">\" : \"\");\n if (maxWidth != null) {\n while (result.length < maxWidth)\n result += \" \";\n return result;\n }\n else {\n for (let i = this.to - this.from - result.length - this.spaceAfter.length; i > 0; i--)\n result += \" \";\n return result + (trailing ? this.spaceAfter : \"\");\n }\n }\n marker(doc, add) {\n let number = this.node.name == \"OrderedList\" ? String((+itemNumber(this.item, doc)[2] + add)) : \"\";\n return this.spaceBefore + number + this.type + this.spaceAfter;\n }\n}\nfunction getContext(node, doc) {\n let nodes = [];\n for (let cur = node; cur && cur.name != \"Document\"; cur = cur.parent) {\n if (cur.name == \"ListItem\" || cur.name == \"Blockquote\" || cur.name == \"FencedCode\")\n nodes.push(cur);\n }\n let context = [];\n for (let i = nodes.length - 1; i >= 0; i--) {\n let node = nodes[i], match;\n let line = doc.lineAt(node.from), startPos = node.from - line.from;\n if (node.name == \"FencedCode\") {\n context.push(new Context(node, startPos, startPos, \"\", \"\", \"\", null));\n }\n else if (node.name == \"Blockquote\" && (match = /^ *>( ?)/.exec(line.text.slice(startPos)))) {\n context.push(new Context(node, startPos, startPos + match[0].length, \"\", match[1], \">\", null));\n }\n else if (node.name == \"ListItem\" && node.parent.name == \"OrderedList\" &&\n (match = /^( *)\\d+([.)])( *)/.exec(line.text.slice(startPos)))) {\n let after = match[3], len = match[0].length;\n if (after.length >= 4) {\n after = after.slice(0, after.length - 4);\n len -= 4;\n }\n context.push(new Context(node.parent, startPos, startPos + len, match[1], after, match[2], node));\n }\n else if (node.name == \"ListItem\" && node.parent.name == \"BulletList\" &&\n (match = /^( *)([-+*])( {1,4}\\[[ xX]\\])?( +)/.exec(line.text.slice(startPos)))) {\n let after = match[4], len = match[0].length;\n if (after.length > 4) {\n after = after.slice(0, after.length - 4);\n len -= 4;\n }\n let type = match[2];\n if (match[3])\n type += match[3].replace(/[xX]/, ' ');\n context.push(new Context(node.parent, startPos, startPos + len, match[1], after, type, node));\n }\n }\n return context;\n}\nfunction itemNumber(item, doc) {\n return /^(\\s*)(\\d+)(?=[.)])/.exec(doc.sliceString(item.from, item.from + 10));\n}\nfunction renumberList(after, doc, changes, offset = 0) {\n for (let prev = -1, node = after;;) {\n if (node.name == \"ListItem\") {\n let m = itemNumber(node, doc);\n let number = +m[2];\n if (prev >= 0) {\n if (number != prev + 1)\n return;\n changes.push({ from: node.from + m[1].length, to: node.from + m[0].length, insert: String(prev + 2 + offset) });\n }\n prev = number;\n }\n let next = node.nextSibling;\n if (!next)\n break;\n node = next;\n }\n}\nfunction normalizeIndent(content, state) {\n let blank = /^[ \\t]*/.exec(content)[0].length;\n if (!blank || state.facet(indentUnit) != \"\\t\")\n return content;\n let col = countColumn(content, 4, blank);\n let space = \"\";\n for (let i = col; i > 0;) {\n if (i >= 4) {\n space += \"\\t\";\n i -= 4;\n }\n else {\n space += \" \";\n i--;\n }\n }\n return space + content.slice(blank);\n}\n/**\nThis command, when invoked in Markdown context with cursor\nselection(s), will create a new line with the markup for\nblockquotes and lists that were active on the old line. If the\ncursor was directly after the end of the markup for the old line,\ntrailing whitespace and list markers are removed from that line.\n\nThe command does nothing in non-Markdown context, so it should\nnot be used as the only binding for Enter (even in a Markdown\ndocument, HTML and code regions might use a different language).\n*/\nconst insertNewlineContinueMarkup = ({ state, dispatch }) => {\n let tree = syntaxTree(state), { doc } = state;\n let dont = null, changes = state.changeByRange(range => {\n if (!range.empty || !markdownLanguage.isActiveAt(state, range.from))\n return dont = { range };\n let pos = range.from, line = doc.lineAt(pos);\n let context = getContext(tree.resolveInner(pos, -1), doc);\n while (context.length && context[context.length - 1].from > pos - line.from)\n context.pop();\n if (!context.length)\n return dont = { range };\n let inner = context[context.length - 1];\n if (inner.to - inner.spaceAfter.length > pos - line.from)\n return dont = { range };\n let emptyLine = pos >= (inner.to - inner.spaceAfter.length) && !/\\S/.test(line.text.slice(inner.to));\n // Empty line in list\n if (inner.item && emptyLine) {\n let first = inner.node.firstChild, second = inner.node.getChild(\"ListItem\", \"ListItem\");\n // Not second item or blank line before: delete a level of markup\n if (first.to >= pos || second && second.to < pos ||\n line.from > 0 && !/[^\\s>]/.test(doc.lineAt(line.from - 1).text)) {\n let next = context.length > 1 ? context[context.length - 2] : null;\n let delTo, insert = \"\";\n if (next && next.item) { // Re-add marker for the list at the next level\n delTo = line.from + next.from;\n insert = next.marker(doc, 1);\n }\n else {\n delTo = line.from + (next ? next.to : 0);\n }\n let changes = [{ from: delTo, to: pos, insert }];\n if (inner.node.name == \"OrderedList\")\n renumberList(inner.item, doc, changes, -2);\n if (next && next.node.name == \"OrderedList\")\n renumberList(next.item, doc, changes);\n return { range: EditorSelection.cursor(delTo + insert.length), changes };\n }\n else { // Move second item down, making tight two-item list non-tight\n let insert = blankLine(context, state, line);\n return { range: EditorSelection.cursor(pos + insert.length + 1),\n changes: { from: line.from, insert: insert + state.lineBreak } };\n }\n }\n if (inner.node.name == \"Blockquote\" && emptyLine && line.from) {\n let prevLine = doc.lineAt(line.from - 1), quoted = />\\s*$/.exec(prevLine.text);\n // Two aligned empty quoted lines in a row\n if (quoted && quoted.index == inner.from) {\n let changes = state.changes([{ from: prevLine.from + quoted.index, to: prevLine.to },\n { from: line.from + inner.from, to: line.to }]);\n return { range: range.map(changes), changes };\n }\n }\n let changes = [];\n if (inner.node.name == \"OrderedList\")\n renumberList(inner.item, doc, changes);\n let continued = inner.item && inner.item.from < line.from;\n let insert = \"\";\n // If not dedented\n if (!continued || /^[\\s\\d.)\\-+*>]*/.exec(line.text)[0].length >= inner.to) {\n for (let i = 0, e = context.length - 1; i <= e; i++) {\n insert += i == e && !continued ? context[i].marker(doc, 1)\n : context[i].blank(i < e ? countColumn(line.text, 4, context[i + 1].from) - insert.length : null);\n }\n }\n let from = pos;\n while (from > line.from && /\\s/.test(line.text.charAt(from - line.from - 1)))\n from--;\n insert = normalizeIndent(insert, state);\n if (nonTightList(inner.node, state.doc))\n insert = blankLine(context, state, line) + state.lineBreak + insert;\n changes.push({ from, to: pos, insert: state.lineBreak + insert });\n return { range: EditorSelection.cursor(from + insert.length + 1), changes };\n });\n if (dont)\n return false;\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"input\" }));\n return true;\n};\nfunction isMark(node) {\n return node.name == \"QuoteMark\" || node.name == \"ListMark\";\n}\nfunction nonTightList(node, doc) {\n if (node.name != \"OrderedList\" && node.name != \"BulletList\")\n return false;\n let first = node.firstChild, second = node.getChild(\"ListItem\", \"ListItem\");\n if (!second)\n return false;\n let line1 = doc.lineAt(first.to), line2 = doc.lineAt(second.from);\n let empty = /^[\\s>]*$/.test(line1.text);\n return line1.number + (empty ? 0 : 1) < line2.number;\n}\nfunction blankLine(context, state, line) {\n let insert = \"\";\n for (let i = 0, e = context.length - 2; i <= e; i++) {\n insert += context[i].blank(i < e ? countColumn(line.text, 4, context[i + 1].from) - insert.length : null, i < e);\n }\n return normalizeIndent(insert, state);\n}\nfunction contextNodeForDelete(tree, pos) {\n let node = tree.resolveInner(pos, -1), scan = pos;\n if (isMark(node)) {\n scan = node.from;\n node = node.parent;\n }\n for (let prev; prev = node.childBefore(scan);) {\n if (isMark(prev)) {\n scan = prev.from;\n }\n else if (prev.name == \"OrderedList\" || prev.name == \"BulletList\") {\n node = prev.lastChild;\n scan = node.to;\n }\n else {\n break;\n }\n }\n return node;\n}\n/**\nThis command will, when invoked in a Markdown context with the\ncursor directly after list or blockquote markup, delete one level\nof markup. When the markup is for a list, it will be replaced by\nspaces on the first invocation (a further invocation will delete\nthe spaces), to make it easy to continue a list.\n\nWhen not after Markdown block markup, this command will return\nfalse, so it is intended to be bound alongside other deletion\ncommands, with a higher precedence than the more generic commands.\n*/\nconst deleteMarkupBackward = ({ state, dispatch }) => {\n let tree = syntaxTree(state);\n let dont = null, changes = state.changeByRange(range => {\n let pos = range.from, { doc } = state;\n if (range.empty && markdownLanguage.isActiveAt(state, range.from)) {\n let line = doc.lineAt(pos);\n let context = getContext(contextNodeForDelete(tree, pos), doc);\n if (context.length) {\n let inner = context[context.length - 1];\n let spaceEnd = inner.to - inner.spaceAfter.length + (inner.spaceAfter ? 1 : 0);\n // Delete extra trailing space after markup\n if (pos - line.from > spaceEnd && !/\\S/.test(line.text.slice(spaceEnd, pos - line.from)))\n return { range: EditorSelection.cursor(line.from + spaceEnd),\n changes: { from: line.from + spaceEnd, to: pos } };\n if (pos - line.from == spaceEnd &&\n // Only apply this if we're on the line that has the\n // construct's syntax, or there's only indentation in the\n // target range\n (!inner.item || line.from <= inner.item.from || !/\\S/.test(line.text.slice(0, inner.to)))) {\n let start = line.from + inner.from;\n // Replace a list item marker with blank space\n if (inner.item && inner.node.from < inner.item.from && /\\S/.test(line.text.slice(inner.from, inner.to))) {\n let insert = inner.blank(countColumn(line.text, 4, inner.to) - countColumn(line.text, 4, inner.from));\n if (start == line.from)\n insert = normalizeIndent(insert, state);\n return { range: EditorSelection.cursor(start + insert.length),\n changes: { from: start, to: line.from + inner.to, insert } };\n }\n // Delete one level of indentation\n if (start < pos)\n return { range: EditorSelection.cursor(start), changes: { from: start, to: pos } };\n }\n }\n }\n return dont = { range };\n });\n if (dont)\n return false;\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"delete\" }));\n return true;\n};\n\n/**\nA small keymap with Markdown-specific bindings. Binds Enter to\n[`insertNewlineContinueMarkup`](https://codemirror.net/6/docs/ref/#lang-markdown.insertNewlineContinueMarkup)\nand Backspace to\n[`deleteMarkupBackward`](https://codemirror.net/6/docs/ref/#lang-markdown.deleteMarkupBackward).\n*/\nconst markdownKeymap = [\n { key: \"Enter\", run: insertNewlineContinueMarkup },\n { key: \"Backspace\", run: deleteMarkupBackward }\n];\nconst htmlNoMatch = /*@__PURE__*/html({ matchClosingTags: false });\n/**\nMarkdown language support.\n*/\nfunction markdown(config = {}) {\n let { codeLanguages, defaultCodeLanguage, addKeymap = true, base: { parser } = commonmarkLanguage, completeHTMLTags = true } = config;\n if (!(parser instanceof MarkdownParser))\n throw new RangeError(\"Base parser provided to `markdown` should be a Markdown parser\");\n let extensions = config.extensions ? [config.extensions] : [];\n let support = [htmlNoMatch.support], defaultCode;\n if (defaultCodeLanguage instanceof LanguageSupport) {\n support.push(defaultCodeLanguage.support);\n defaultCode = defaultCodeLanguage.language;\n }\n else if (defaultCodeLanguage) {\n defaultCode = defaultCodeLanguage;\n }\n let codeParser = codeLanguages || defaultCode ? getCodeParser(codeLanguages, defaultCode) : undefined;\n extensions.push(parseCode({ codeParser, htmlParser: htmlNoMatch.language.parser }));\n if (addKeymap)\n support.push(Prec.high(keymap.of(markdownKeymap)));\n let lang = mkLang(parser.configure(extensions));\n if (completeHTMLTags)\n support.push(lang.data.of({ autocomplete: htmlTagCompletion }));\n return new LanguageSupport(lang, support);\n}\nfunction htmlTagCompletion(context) {\n let { state, pos } = context, m = /<[:\\-\\.\\w\\u00b7-\\uffff]*$/.exec(state.sliceDoc(pos - 25, pos));\n if (!m)\n return null;\n let tree = syntaxTree(state).resolveInner(pos, -1);\n while (tree && !tree.type.isTop) {\n if (tree.name == \"CodeBlock\" || tree.name == \"FencedCode\" || tree.name == \"ProcessingInstructionBlock\" ||\n tree.name == \"CommentBlock\" || tree.name == \"Link\" || tree.name == \"Image\")\n return null;\n tree = tree.parent;\n }\n return {\n from: pos - m[0].length, to: pos,\n options: htmlTagCompletions(),\n validFor: /^<[:\\-\\.\\w\\u00b7-\\uffff]*$/\n };\n}\nlet _tagCompletions = null;\nfunction htmlTagCompletions() {\n if (_tagCompletions)\n return _tagCompletions;\n let result = htmlCompletionSource(new CompletionContext(EditorState.create({ extensions: htmlNoMatch }), 0, true));\n return _tagCompletions = result ? result.options : [];\n}\n\nexport { commonmarkLanguage, deleteMarkupBackward, insertNewlineContinueMarkup, markdown, markdownKeymap, markdownLanguage };\n"],"names":["Type","CompositeBlock","create","type","value","from","parentHash","end","constructor","hash","children","positions","this","hashProp","contextHash","addChild","child","pos","prop","length","push","toTree","nodeSet","last","Math","max","types","balance","makeTree","none","LeafBlock","start","content","marks","parsers","Line","text","baseIndent","basePos","depth","markers","indent","next","forward","forwardInner","newPos","skipSpace","countIndent","charCodeAt","reset","pop","moveBase","to","moveBaseColumn","findColumn","addMarker","elt","i","goal","scrub","result","slice","skipForList","bl","cx","line","block","stack","size","OrderedList","isOrderedList","isBulletList","BulletList","isHorizontalRule","DefaultSkipMarkup","Blockquote","QuoteMark","lineStart","space","ListItem","_cx","Document","ch","skipSpaceBack","isFencedCode","isBlockquote","breaking","count","isSetextUnderline","parser","leafBlockParsers","indexOf","DefaultLeafBlocks","SetextHeading","inList","isAtxHeading","EmptyLine","CommentEnd","ProcessingEnd","HTMLBlockStyle","isHTMLBlock","rest","e","test","getListIndent","indentAfter","indented","addCodeText","CodeText","DefaultBlockParsers","LinkReference","undefined","IndentedCode","base","pendingMarks","nextLine","m","codeStart","filter","concat","addNode","buffer","writeElements","finish","CodeBlock","FencedCode","fenceEnd","len","infoFrom","infoTo","CodeMark","CodeInfo","first","textStart","textEnd","prevLineEnd","startContext","HorizontalRule","newBase","ListMark","ATXHeading","off","endOfSpace","after","buf","write","HeaderMark","parseInline","node","ATXHeading1","HTMLBlock","trailing","nodeType","CommentBlock","ProcessingInstructionBlock","LinkReferenceParser","leaf","stage","elts","advance","complete","addLeafElement","nextStage","parseLinkLabel","LinkMark","skip","title","parseLinkTitle","titleEnd","lineEnd","parseURL","SetextHeadingParser","underline","underlineMark","SetextHeading1","SetextHeading2","_","DefaultEndLeaf","p","scanLineResult","BlockContext","input","fragments","ranges","atEnd","reusePlaceholders","Map","stoppedAt","rangeI","absoluteLineStart","absoluteLineEnd","FragmentCursor","readLine","parsedPos","markI","mark","finishContext","reuseFragment","blockParsers","parse","lines","stop","endLeafBlock","finishLeaf","stopAt","RangeError","moveTo","matches","taken","takeNodes","toRelative","moveRangeI","parentType","scanLine","r","lineChunkAt","textOffset","nextFrom","handler","skipContextMarkup","Error","chunk","lineChunks","eol","startComposite","getNodeType","addElement","injectMarks","top","addGaps","tree","injectGaps","topNode","inline","Paragraph","TreeElement","Buffer","offset","dummies","rangeEnd","movePastNext","upto","inclusive","firstChild","nextSibling","reuse","get","propValues","MarkdownParser","blockNames","inlineParsers","inlineNames","wrappers","super","nodeTypes","Object","t","name","id","createParse","w","configure","spec","config","resolveConfig","nonEmpty","defineNodes","assign","styles","s","composite","style","some","group","define","props","Array","isArray","extend","remove","rm","parseBlock","found","before","findName","splice","endLeaf","wrap","InlineContext","outer","char","token","resolveMarkers","a","conf","conc","b","wrapA","wrapB","inner","names","Escape","nodes","writeTo","build","reused","topID","Element","startOff","EmphasisUnderscore","resolve","EmphasisAsterisk","LinkStart","ImageStart","InlineDelimiter","side","Punctuation","RegExp","DefaultInline","escaped","Escapable","append","Entity","exec","InlineCode","curSize","HTMLTag","url","Autolink","URL","comment","Comment","procInst","ProcessingInstruction","Emphasis","pBefore","pAfter","sBefore","sAfter","leftFlanking","rightFlanking","canOpen","canClose","HardBreak","Link","Image","LinkEnd","parts","part","takeContent","link","finishLink","j","startPos","endPos","unshift","dest","label","LinkTitle","requireNonWS","min","LinkLabel","addDelimiter","open","close","hasOpenLink","emp","closeSize","k","element","findOpeningDelimiter","startIndex","elements","eI","NotLast","fragment","fragmentEnd","cursor","nextFragment","read","c","rPos","parent","childAfter","cur","fragEnd","openEnd","blockI","prevEnd","prevI","isAnonymous","dummy","set","is","abs","gapFrom","gapTo","markdownHighlighting","quote","contentSeparator","heading1","heading2","heading3","heading4","heading5","heading6","escape","character","emphasis","strong","list","monospace","processingInstruction","labelName","string","keys","map","n","leftOverSpace","nextPos","StrikethroughDelim","Strikethrough","strikethrough","parseRow","startI","cellStart","cellEnd","esc","parseCell","hasPipe","str","delimiterLine","TableParser","rows","lineText","firstRow","Table","heading","TaskParser","TaskList","atom","autolinkRE","urlRE","lastTwoDomainWords","emailRE","xmppResourceRE","autolinkEmailEnd","lastIndex","GFM","absPos","index","autolinkURLEnd","parseSubSuper","Superscript","special","Subscript","Emoji","match","data","commentTokens","headingProp","commonmark","add","isHeading","isList","state","doc","lineAt","findSectionEnd","headerNode","level","headerIndent","of","resolveInner","mkLang","commonmarkLanguage","markdownLanguage","Context","spaceBefore","spaceAfter","item","blank","maxWidth","marker","number","String","itemNumber","getContext","context","replace","sliceString","renumberList","changes","prev","insert","normalizeIndent","facet","insertNewlineContinueMarkup","dispatch","dont","changeByRange","range","empty","isActiveAt","emptyLine","second","getChild","delTo","blankLine","lineBreak","prevLine","quoted","continued","charAt","line1","line2","nonTightList","update","scrollIntoView","userEvent","isMark","deleteMarkupBackward","scan","childBefore","lastChild","contextNodeForDelete","spaceEnd","markdownKeymap","key","run","htmlNoMatch","html","matchClosingTags","markdown","codeLanguages","defaultCodeLanguage","addKeymap","completeHTMLTags","defaultCode","extensions","support","language","codeParser","languages","defaultLanguage","info","matchLanguageName","getSkippingParser","load","htmlParser","overlay","infoNode","parseCode","high","lang","autocomplete","htmlTagCompletion","sliceDoc","isTop","options","htmlTagCompletions","validFor","_tagCompletions","htmlCompletionSource"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/1302.index.js b/pr-preview/pr-770/1302.index.js new file mode 100644 index 00000000..c5dabb3b --- /dev/null +++ b/pr-preview/pr-770/1302.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[1302],{1302:(O,Q,$)=>{$.r(Q),$.d(Q,{java:()=>l,javaLanguage:()=>s});var P=$(3643),i=$(9913);const a=(0,i.pn)({null:i._A.null,instanceof:i._A.operatorKeyword,this:i._A.self,"new super assert open to with void":i._A.keyword,"class interface extends implements enum var":i._A.definitionKeyword,"module package import":i._A.moduleKeyword,"switch while for if else case default do break continue return try catch finally throw":i._A.controlKeyword,"requires exports opens uses provides public private protected static transitive abstract final strictfp synchronized native transient volatile throws":i._A.modifier,IntegerLiteral:i._A.integer,FloatingPointLiteral:i._A.float,"StringLiteral TextBlock":i._A.string,CharacterLiteral:i._A.character,LineComment:i._A.lineComment,BlockComment:i._A.blockComment,BooleanLiteral:i._A.bool,PrimitiveType:i._A.standard(i._A.typeName),TypeName:i._A.typeName,Identifier:i._A.variableName,"MethodName/Identifier":i._A.function(i._A.variableName),Definition:i._A.definition(i._A.variableName),ArithOp:i._A.arithmeticOperator,LogicOp:i._A.logicOperator,BitOp:i._A.bitwiseOperator,CompareOp:i._A.compareOperator,AssignOp:i._A.definitionOperator,UpdateOp:i._A.updateOperator,Asterisk:i._A.punctuation,Label:i._A.labelName,"( )":i._A.paren,"[ ]":i._A.squareBracket,"{ }":i._A.brace,".":i._A.derefOperator,", ;":i._A.separator}),r={__proto__:null,true:34,false:34,null:42,void:46,byte:48,short:48,int:48,long:48,char:48,float:48,double:48,boolean:48,extends:62,super:64,class:76,this:78,new:84,public:100,protected:102,private:104,abstract:106,static:108,final:110,strictfp:112,default:114,synchronized:116,native:118,transient:120,volatile:122,throws:150,implements:160,interface:166,enum:176,instanceof:238,open:267,module:269,requires:274,transitive:276,exports:278,to:280,opens:282,uses:284,provides:286,with:288,package:292,import:296,if:308,else:310,while:314,for:318,var:325,assert:332,switch:336,case:342,do:346,break:350,continue:354,return:358,throw:364,try:368,catch:372,finally:380},e=P.U1.deserialize({version:14,states:"##jQ]QPOOQ$wQPOOO(bQQO'#H^O*iQQO'#CbOOQO'#Cb'#CbO*pQPO'#CaO*xOSO'#CpOOQO'#Hc'#HcOOQO'#Cu'#CuO,eQPO'#D_O-OQQO'#HmOOQO'#Hm'#HmO/gQQO'#HhO/nQQO'#HhOOQO'#Hh'#HhOOQO'#Hg'#HgO1rQPO'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#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%O%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o+s,Y,`-r-t-}.R.g.m/[/_/b/d/n0Z0f0kQ#f`Q&O#YQ'Y$YU)W%g'`'iQ)}&bQ*s'_Q,Q(tQ,j)oQ,k)pR.c,^Q)n%}R,i)m$SfO`copx!Y![!_!a#l#u#w#x#|#}$O$P$Q$R$S$T$U$V$Z$_$l$m$n$o$p$q%O%d%k%v&d'm(O(T(U)Q)R)])f*P*l*o+T+d+h+i+l+o+s,Y,`-r-t-}.R.g.m/[/_/b/d/n0Z0f0kT&p#t,ZQ&|#xQ(P$oQ-u+hQ/]-tR0P/_]!nP!o'^*q-^/O#PaOPX`bcx![!f!o!y#_#e#l$_$m$n$o$p$q%O%b%d&]&i'^'e'h'{(U)O)Q)R*W*q+O+d+l+s+x,Y-[-^.R/O/dU#WY!W'|Q%T!eU&k#n#s+fQ(o%VS,s*T*zT.s,u-aj#UY!W!e#n#s%V%w&W)y*T*z,u-aU&V#`&`(}Q)x&[Q+e'|Q+q(`Q-s+fQ.O+rQ/g.WR0U/hQ)i%vQ,g)fR/o.mR,h)f`!jP!o'^'h*q+O-^/OT%W!g*|R%]!hW%U!e%V*z-aQ(z%^R,V({S#d`%bR&a#eQ)X%gT*t'`'iR*y'e[!lP!o'^*q-^/OR%X!gR#h`R,b)]R)a%kT-j+]-kQ/V-mR/z/WR/z/X",nodeNames:"⚠ LineComment BlockComment Program ModuleDeclaration MarkerAnnotation Identifier ScopedIdentifier . Annotation ) ( AnnotationArgumentList AssignmentExpression FieldAccess IntegerLiteral FloatingPointLiteral BooleanLiteral CharacterLiteral StringLiteral TextBlock null ClassLiteral void PrimitiveType TypeName ScopedTypeName GenericType TypeArguments AnnotatedType Wildcard extends super , ArrayType ] Dimension [ class this ParenthesizedExpression ObjectCreationExpression new ArgumentList } { ClassBody ; FieldDeclaration Modifiers public protected private abstract static final strictfp default synchronized native transient volatile VariableDeclarator Definition AssignOp ArrayInitializer MethodDeclaration TypeParameters TypeParameter TypeBound FormalParameters ReceiverParameter FormalParameter SpreadParameter Throws throws Block ClassDeclaration Superclass SuperInterfaces implements InterfaceTypeList InterfaceDeclaration interface ExtendsInterfaces InterfaceBody ConstantDeclaration EnumDeclaration enum EnumBody EnumConstant EnumBodyDeclarations AnnotationTypeDeclaration AnnotationTypeBody AnnotationTypeElementDeclaration StaticInitializer ConstructorDeclaration ConstructorBody ExplicitConstructorInvocation ArrayAccess MethodInvocation MethodName MethodReference ArrayCreationExpression Dimension AssignOp BinaryExpression CompareOp CompareOp LogicOp LogicOp BitOp BitOp BitOp ArithOp ArithOp ArithOp BitOp InstanceofExpression instanceof LambdaExpression InferredParameters TernaryExpression LogicOp : UpdateExpression UpdateOp UnaryExpression LogicOp BitOp CastExpression ElementValueArrayInitializer ElementValuePair open module ModuleBody ModuleDirective requires transitive exports to opens uses provides with PackageDeclaration package ImportDeclaration import Asterisk ExpressionStatement LabeledStatement Label IfStatement if else WhileStatement while ForStatement for ForSpec LocalVariableDeclaration var EnhancedForStatement ForSpec AssertStatement assert SwitchStatement switch SwitchBlock SwitchLabel case DoStatement do BreakStatement break ContinueStatement continue ReturnStatement return SynchronizedStatement ThrowStatement throw TryStatement try CatchClause catch CatchFormalParameter CatchType FinallyClause finally TryWithResourcesStatement ResourceSpecification Resource ClassContent",maxTerm:276,nodeProps:[["isolate",-4,1,2,18,19,""],["group",-26,4,47,76,77,82,87,92,145,147,150,151,153,156,158,161,163,165,167,172,174,176,178,180,181,183,191,"Statement",-25,6,13,14,15,16,17,18,19,20,21,22,39,40,41,99,100,102,103,106,118,120,122,125,127,130,"Expression",-7,23,24,25,26,27,29,34,"Type"],["openedBy",10,"(",44,"{"],["closedBy",11,")",45,"}"]],propSources:[a],skippedNodes:[0,1,2],repeatNodeCount:28,tokenData:"#$f_R!_OX%QXY'fYZ)bZ^'f^p%Qpq'fqr*|rs,^st%Qtu4euv5qvw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atement:(0,X.mz)({except:/^\s*({|catch|finally)\b/}),LabeledStatement:X._Y,SwitchBlock:O=>{let Q=O.textAfter,$=/^\s*\}/.test(Q),P=/^\s*(case|default)\b/.test(Q);return O.baseIndent+($?0:P?1:2)*O.unit},Block:(0,X.Ay)({closing:"}"}),BlockComment:()=>null,Statement:(0,X.mz)({except:/^{/})}),X.b_.add({"Block SwitchBlock ClassBody ElementValueArrayInitializer ModuleBody EnumBody ConstructorBody InterfaceBody ArrayInitializer":X.yd,BlockComment:O=>({from:O.from+2,to:O.to-2})})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\})$/}});function l(){return new X.Yy(s)}}}]); +//# sourceMappingURL=1302.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/1302.index.js.map b/pr-preview/pr-770/1302.index.js.map new file mode 100644 index 00000000..97c99892 --- /dev/null +++ b/pr-preview/pr-770/1302.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"1302.index.js","mappings":"oKAGA,MAAMA,GAAmB,QAAU,CACjCC,KAAM,KAAKA,KACTC,WAAY,KAAKC,gBACnBC,KAAM,KAAKC,KACX,qCAAsC,KAAKC,QAC3C,8CAA+C,KAAKC,kBACpD,wBAAyB,KAAKC,cAC9B,yFAA0F,KAAKC,eAC/F,wJAC4D,KAAKC,SACjEC,eAAgB,KAAKC,QACrBC,qBAAsB,KAAKC,MAC3B,0BAA2B,KAAKC,OAChCC,iBAAkB,KAAKC,UACvBC,YAAa,KAAKC,YAClBC,aAAc,KAAKC,aACnBC,eAAgB,KAAKC,KACrBC,cAAe,KAAKC,SAAS,KAAKC,UAClCC,SAAU,KAAKD,SACfE,WAAY,KAAKC,aACjB,wBAAyB,KAAKC,SAAS,KAAKD,cAC5CE,WAAY,KAAKC,WAAW,KAAKH,cACjCI,QAAS,KAAKC,mBACdC,QAAS,KAAKC,cACdC,MAAO,KAAKC,gBACZC,UAAW,KAAKC,gBAChBC,SAAU,K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IAAI,CAC1B,8HACuD,KACvDxH,aAAayI,IAAe,CAAEC,KAAMD,EAAKC,KAAO,EAAGnE,GAAIkE,EAAKlE,GAAK,SAI7EoE,aAAc,CACVC,cAAe,CAAEC,KAAM,KAAMC,MAAO,CAAE5E,KAAM,KAAM6E,MAAO,OACzDC,cAAe,mCAMvB,SAASC,IACL,OAAO,IAAI,KAAgB9B,EAC/B,C","sources":["webpack://thebe/../../node_modules/@lezer/java/dist/index.js","webpack://thebe/../../node_modules/@codemirror/lang-java/dist/index.js"],"sourcesContent":["import { LRParser } from '@lezer/lr';\nimport { styleTags, tags } from '@lezer/highlight';\n\nconst javaHighlighting = styleTags({\n null: tags.null,\n instanceof: tags.operatorKeyword,\n this: tags.self,\n \"new super assert open to with void\": tags.keyword,\n \"class interface extends implements enum var\": tags.definitionKeyword,\n \"module package import\": tags.moduleKeyword,\n \"switch while for if else case default do break continue return try catch finally throw\": tags.controlKeyword,\n [\"requires exports opens uses provides public private protected static transitive abstract final \" +\n \"strictfp synchronized native transient volatile throws\"]: tags.modifier,\n IntegerLiteral: tags.integer,\n FloatingPointLiteral: tags.float,\n \"StringLiteral TextBlock\": tags.string,\n CharacterLiteral: tags.character,\n LineComment: tags.lineComment,\n BlockComment: tags.blockComment,\n BooleanLiteral: tags.bool,\n PrimitiveType: tags.standard(tags.typeName),\n TypeName: tags.typeName,\n Identifier: tags.variableName,\n \"MethodName/Identifier\": tags.function(tags.variableName),\n Definition: tags.definition(tags.variableName),\n ArithOp: tags.arithmeticOperator,\n LogicOp: tags.logicOperator,\n BitOp: tags.bitwiseOperator,\n CompareOp: tags.compareOperator,\n AssignOp: tags.definitionOperator,\n UpdateOp: tags.updateOperator,\n Asterisk: tags.punctuation,\n Label: tags.labelName,\n \"( )\": tags.paren,\n \"[ ]\": tags.squareBracket,\n \"{ }\": tags.brace,\n \".\": tags.derefOperator,\n \", ;\": tags.separator\n});\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst spec_identifier = {__proto__:null,true:34, false:34, null:42, void:46, byte:48, short:48, int:48, long:48, char:48, float:48, double:48, boolean:48, extends:62, super:64, class:76, this:78, new:84, public:100, protected:102, private:104, abstract:106, static:108, final:110, strictfp:112, default:114, synchronized:116, native:118, transient:120, volatile:122, throws:150, implements:160, interface:166, enum:176, instanceof:238, open:267, module:269, requires:274, transitive:276, exports:278, to:280, opens:282, uses:284, provides:286, with:288, package:292, import:296, if:308, else:310, while:314, for:318, var:325, assert:332, switch:336, case:342, do:346, break:350, continue:354, return:358, throw:364, try:368, catch:372, finally:380};\nconst parser = LRParser.deserialize({\n version: 14,\n states: \"##jQ]QPOOQ$wQPOOO(bQQO'#H^O*iQQO'#CbOOQO'#Cb'#CbO*pQPO'#CaO*xOSO'#CpOOQO'#Hc'#HcOOQO'#Cu'#CuO,eQPO'#D_O-OQQO'#HmOOQO'#Hm'#HmO/gQQO'#HhO/nQQO'#HhOOQO'#Hh'#HhOOQO'#Hg'#HgO1rQPO'#DUO2PQPO'#GnO4wQPO'#D_O5OQPO'#DzO*pQPO'#E[O5qQPO'#E[OOQO'#DV'#DVO7SQQO'#HaO9^QQO'#EeO9eQPO'#EdO9jQPO'#EfOOQO'#Hb'#HbO7jQQO'#HbO:pQQO'#FhO:wQPO'#ExO:|QPO'#E}O:|QPO'#FPOOQO'#Ha'#HaOOQO'#HY'#HYOOQO'#Gh'#GhOOQO'#HX'#HXO<^QPO'#FiOOQO'#HW'#HWOOQO'#Gg'#GgQ]QPOOOOQO'#Hs'#HsOQQPO'#GSO>]QPO'#GUO=kQPO'#GWO:|QPO'#GXO>dQPO'#GZO?QQQO'#HiO?mQQO'#CuO?tQPO'#HxO@SQPO'#D_O@rQPO'#DpO?wQPO'#DqO@|QPO'#HxOA_QPO'#DpOAgQPO'#IROAlQPO'#E`OOQO'#Hr'#HrOOQO'#Gm'#GmQ$wQPOOOAtQPO'#HsOOQO'#H^'#H^OCsQQO,58{OOQO'#H['#H[OOOO'#Gi'#GiOEfOSO,59[OOQO,59[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j#UY!W!e#n#s%V%w&W)y*T*z,u-aU&V#`&`(}Q)x&[Q+e'|Q+q(`Q-s+fQ.O+rQ/g.WR0U/hQ)i%vQ,g)fR/o.mR,h)f`!jP!o'^'h*q+O-^/OT%W!g*|R%]!hW%U!e%V*z-aQ(z%^R,V({S#d`%bR&a#eQ)X%gT*t'`'iR*y'e[!lP!o'^*q-^/OR%X!gR#h`R,b)]R)a%kT-j+]-kQ/V-mR/z/WR/z/X\",\n nodeNames: \"⚠ LineComment BlockComment Program ModuleDeclaration MarkerAnnotation Identifier ScopedIdentifier . Annotation ) ( AnnotationArgumentList AssignmentExpression FieldAccess IntegerLiteral FloatingPointLiteral BooleanLiteral CharacterLiteral StringLiteral TextBlock null ClassLiteral void PrimitiveType TypeName ScopedTypeName GenericType TypeArguments AnnotatedType Wildcard extends super , ArrayType ] Dimension [ class this ParenthesizedExpression ObjectCreationExpression new ArgumentList } { ClassBody ; FieldDeclaration Modifiers public protected private abstract static final strictfp default synchronized native transient volatile VariableDeclarator Definition AssignOp ArrayInitializer MethodDeclaration TypeParameters TypeParameter TypeBound FormalParameters ReceiverParameter FormalParameter SpreadParameter Throws throws Block ClassDeclaration Superclass SuperInterfaces implements InterfaceTypeList InterfaceDeclaration interface ExtendsInterfaces InterfaceBody ConstantDeclaration EnumDeclaration enum EnumBody EnumConstant EnumBodyDeclarations AnnotationTypeDeclaration AnnotationTypeBody AnnotationTypeElementDeclaration StaticInitializer ConstructorDeclaration ConstructorBody ExplicitConstructorInvocation ArrayAccess MethodInvocation MethodName MethodReference ArrayCreationExpression Dimension AssignOp BinaryExpression CompareOp CompareOp LogicOp LogicOp BitOp BitOp BitOp ArithOp ArithOp ArithOp BitOp InstanceofExpression instanceof LambdaExpression InferredParameters TernaryExpression LogicOp : UpdateExpression UpdateOp UnaryExpression LogicOp BitOp CastExpression ElementValueArrayInitializer ElementValuePair open module ModuleBody ModuleDirective requires transitive exports to opens uses provides with PackageDeclaration package ImportDeclaration import Asterisk ExpressionStatement LabeledStatement Label IfStatement if else WhileStatement while ForStatement for ForSpec LocalVariableDeclaration var EnhancedForStatement ForSpec AssertStatement assert SwitchStatement switch SwitchBlock SwitchLabel case DoStatement do BreakStatement break ContinueStatement continue ReturnStatement return SynchronizedStatement ThrowStatement throw TryStatement try CatchClause catch CatchFormalParameter CatchType FinallyClause finally TryWithResourcesStatement ResourceSpecification Resource ClassContent\",\n maxTerm: 276,\n nodeProps: [\n [\"isolate\", -4,1,2,18,19,\"\"],\n [\"group\", -26,4,47,76,77,82,87,92,145,147,150,151,153,156,158,161,163,165,167,172,174,176,178,180,181,183,191,\"Statement\",-25,6,13,14,15,16,17,18,19,20,21,22,39,40,41,99,100,102,103,106,118,120,122,125,127,130,\"Expression\",-7,23,24,25,26,27,29,34,\"Type\"],\n [\"openedBy\", 10,\"(\",44,\"{\"],\n [\"closedBy\", 11,\")\",45,\"}\"]\n ],\n propSources: [javaHighlighting],\n skippedNodes: [0,1,2],\n repeatNodeCount: 28,\n tokenData: \"#$f_R!_OX%QXY'fYZ)bZ^'f^p%Qpq'fqr*|rs,^st%Qtu4euv5qvw7Rwx8ixyAQyzAnz{B[{|CQ|}Dh}!OEU!O!PFo!P!Q! i!Q!R!,_!R![!0V![!]!>g!]!^!?w!^!_!@e!_!`!BO!`!a!Br!a!b!D`!b!c!EO!c!}!Kz!}#O!MW#O#P%Q#P#Q!Mt#Q#R!Nb#R#S4e#S#T%Q#T#o4e#o#p# U#p#q# r#q#r##[#r#s##x#s#y%Q#y#z'f#z$f%Q$f$g'f$g#BY%Q#BY#BZ'f#BZ$IS%Q$IS$I_'f$I_$I|%Q$I|$JO'f$JO$JT%Q$JT$JU'f$JU$KV%Q$KV$KW'f$KW&FU%Q&FU&FV'f&FV;'S%Q;'S;=`&s<%lO%QS%VV&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QS%qO&YSS%tVOY&ZYZ%lZr&Zrs&ys;'S&Z;'S;=`'`<%lO&ZS&^VOY%QYZ%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V!M{VsR&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QU!NiX#eQ&YSOY%QYZ%lZr%Qrs%qs!_%Q!_!`6e!`;'S%Q;'S;=`&s<%lO%QV# ]V}R&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_# {Z'OX#dQ&YSOY%QYZ%lZr%Qrs%qs!_%Q!_!`6e!`#p%Q#p#q#!n#q;'S%Q;'S;=`&s<%lO%QU#!uV#bQ&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QV##cV|R&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QT#$PV#uP&YSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q\",\n tokenizers: [0, 1, 2, 3],\n topRules: {\"Program\":[0,3],\"ClassContent\":[1,194]},\n dynamicPrecedences: {\"27\":1,\"232\":-1,\"243\":-1},\n specialized: [{term: 231, get: (value) => spec_identifier[value] || -1}],\n tokenPrec: 7144\n});\n\nexport { parser };\n","import { parser } from '@lezer/java';\nimport { LRLanguage, indentNodeProp, continuedIndent, flatIndent, delimitedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language';\n\n/**\nA language provider based on the [Lezer Java\nparser](https://github.com/lezer-parser/java), extended with\nhighlighting and indentation information.\n*/\nconst javaLanguage = /*@__PURE__*/LRLanguage.define({\n name: \"java\",\n parser: /*@__PURE__*/parser.configure({\n props: [\n /*@__PURE__*/indentNodeProp.add({\n IfStatement: /*@__PURE__*/continuedIndent({ except: /^\\s*({|else\\b)/ }),\n TryStatement: /*@__PURE__*/continuedIndent({ except: /^\\s*({|catch|finally)\\b/ }),\n LabeledStatement: flatIndent,\n SwitchBlock: context => {\n let after = context.textAfter, closed = /^\\s*\\}/.test(after), isCase = /^\\s*(case|default)\\b/.test(after);\n return context.baseIndent + (closed ? 0 : isCase ? 1 : 2) * context.unit;\n },\n Block: /*@__PURE__*/delimitedIndent({ closing: \"}\" }),\n BlockComment: () => null,\n Statement: /*@__PURE__*/continuedIndent({ except: /^{/ })\n }),\n /*@__PURE__*/foldNodeProp.add({\n [\"Block SwitchBlock ClassBody ElementValueArrayInitializer ModuleBody EnumBody \" +\n \"ConstructorBody InterfaceBody ArrayInitializer\"]: foldInside,\n BlockComment(tree) { return { from: tree.from + 2, to: tree.to - 2 }; }\n })\n ]\n }),\n languageData: {\n commentTokens: { line: \"//\", block: { open: \"/*\", close: \"*/\" } },\n indentOnInput: /^\\s*(?:case |default:|\\{|\\})$/\n }\n});\n/**\nJava language support.\n*/\nfunction java() {\n return new LanguageSupport(javaLanguage);\n}\n\nexport { java, javaLanguage };\n"],"names":["javaHighlighting","null","instanceof","operatorKeyword","this","self","keyword","definitionKeyword","moduleKeyword","controlKeyword","modifier","IntegerLiteral","integer","FloatingPointLiteral","float","string","CharacterLiteral","character","LineComment","lineComment","BlockComment","blockComment","BooleanLiteral","bool","PrimitiveType","standard","typeName","TypeName","Identifier","variableName","function","Definition","definition","ArithOp","arithmeticOperator","LogicOp","logicOperator","BitOp","bitwiseOperator","CompareOp","compareOperator","AssignOp","definitionOperator","UpdateOp","updateOperator","Asterisk","punctuation","Label","labelName","paren","squareBracket","brace","derefOperator","separator","spec_identifier","__proto__","true","false","void","byte","short","int","long","char","double","boolean","extends","super","class","new","public","protected","private","abstract","static","final","strictfp","default","synchronized","native","transient","volatile","throws","implements","interface","enum","open","module","requires","transitive","exports","to","opens","uses","provides","with","package","import","if","else","while","for","var","assert","switch","case","do","break","continue","return","throw","try","catch","finally","parser","deserialize","version","states","stateData","goto","nodeNames","maxTerm","nodeProps","propSources","skippedNodes","repeatNodeCount","tokenData","tokenizers","topRules","dynamicPrecedences","specialized","term","get","value","tokenPrec","javaLanguage","define","name","configure","props","add","IfStatement","except","TryStatement","LabeledStatement","SwitchBlock","context","after","textAfter","closed","test","isCase","baseIndent","unit","Block","closing","Statement","tree","from","languageData","commentTokens","line","block","close","indentOnInput","java"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/132.index.js b/pr-preview/pr-770/132.index.js new file mode 100644 index 00000000..c7944aba --- /dev/null +++ b/pr-preview/pr-770/132.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[132],{132:(e,t,T)=>{function n(e){for(var t={},T=e.split(" "),n=0;nR});const E={name:"ttcn-cfg",keywords:n("Yes No LogFile FileMask ConsoleMask AppendFile TimeStampFormat LogEventTypes SourceInfoFormat LogEntityName LogSourceInfo DiskFullAction LogFileNumber LogFileSize MatchingHints Detailed Compact SubCategories Stack Single None Seconds DateTime Time Stop Error Retry Delete TCPPort KillTimer NumHCs UnixSocketsEnabled LocalAddress"),fileNCtrlMaskOptions:n("TTCN_EXECUTOR TTCN_ERROR TTCN_WARNING TTCN_PORTEVENT TTCN_TIMEROP TTCN_VERDICTOP TTCN_DEFAULTOP TTCN_TESTCASE TTCN_ACTION TTCN_USER TTCN_FUNCTION TTCN_STATISTICS TTCN_PARALLEL TTCN_MATCHING TTCN_DEBUG EXECUTOR ERROR WARNING PORTEVENT TIMEROP VERDICTOP DEFAULTOP TESTCASE ACTION USER FUNCTION STATISTICS PARALLEL MATCHING DEBUG LOG_ALL LOG_NOTHING ACTION_UNQUALIFIED DEBUG_ENCDEC DEBUG_TESTPORT DEBUG_UNQUALIFIED DEFAULTOP_ACTIVATE DEFAULTOP_DEACTIVATE DEFAULTOP_EXIT DEFAULTOP_UNQUALIFIED ERROR_UNQUALIFIED EXECUTOR_COMPONENT EXECUTOR_CONFIGDATA EXECUTOR_EXTCOMMAND EXECUTOR_LOGOPTIONS EXECUTOR_RUNTIME EXECUTOR_UNQUALIFIED FUNCTION_RND FUNCTION_UNQUALIFIED MATCHING_DONE MATCHING_MCSUCCESS MATCHING_MCUNSUCC MATCHING_MMSUCCESS MATCHING_MMUNSUCC MATCHING_PCSUCCESS MATCHING_PCUNSUCC MATCHING_PMSUCCESS MATCHING_PMUNSUCC MATCHING_PROBLEM MATCHING_TIMEOUT MATCHING_UNQUALIFIED PARALLEL_PORTCONN PARALLEL_PORTMAP PARALLEL_PTC PARALLEL_UNQUALIFIED PORTEVENT_DUALRECV PORTEVENT_DUALSEND PORTEVENT_MCRECV PORTEVENT_MCSEND PORTEVENT_MMRECV PORTEVENT_MMSEND PORTEVENT_MQUEUE PORTEVENT_PCIN PORTEVENT_PCOUT PORTEVENT_PMIN PORTEVENT_PMOUT PORTEVENT_PQUEUE PORTEVENT_STATE PORTEVENT_UNQUALIFIED STATISTICS_UNQUALIFIED STATISTICS_VERDICT TESTCASE_FINISH TESTCASE_START TESTCASE_UNQUALIFIED TIMEROP_GUARD TIMEROP_READ TIMEROP_START TIMEROP_STOP TIMEROP_TIMEOUT TIMEROP_UNQUALIFIED USER_UNQUALIFIED VERDICTOP_FINAL VERDICTOP_GETVERDICT VERDICTOP_SETVERDICT VERDICTOP_UNQUALIFIED WARNING_UNQUALIFIED"),externalCommands:n("BeginControlPart EndControlPart BeginTestCase EndTestCase"),multiLineStrings:!0};var C,N=E.keywords,I=E.fileNCtrlMaskOptions,r=E.externalCommands,i=E.multiLineStrings,o=!1!==E.indentStatements,_=/[\|]/;function A(e,t){var T,n=e.next();if('"'==n||"'"==n)return t.tokenize=(T=n,function(e,t){for(var n,E=!1,C=!1;null!=(n=e.next());){if(n==T&&!E){var N=e.peek();N&&("b"!=(N=N.toLowerCase())&&"h"!=N&&"o"!=N||e.next()),C=!0;break}E=!E&&"\\"==n}return(C||!E&&!i)&&(t.tokenize=null),"string"}),t.tokenize(e,t);if(/[:=]/.test(n))return C=n,"punctuation";if("#"==n)return e.skipToEnd(),"comment";if(/\d/.test(n))return e.eatWhile(/[\w\.]/),"number";if(_.test(n))return e.eatWhile(_),"operator";if("["==n)return e.eatWhile(/[\w_\]]/),"number";e.eatWhile(/[\w\$_]/);var E=e.current();return N.propertyIsEnumerable(E)?"keyword":I.propertyIsEnumerable(E)?"atom":r.propertyIsEnumerable(E)?"deleted":"variable"}function O(e,t,T,n,E){this.indented=e,this.column=t,this.type=T,this.align=n,this.prev=E}function U(e,t,T){var n=e.indented;return e.context&&"statement"==e.context.type&&(n=e.context.indented),e.context=new O(n,t,T,null,e.context)}function a(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}const R={name:"ttcn",startState:function(){return{tokenize:null,context:new O(0,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var T=t.context;if(e.sol()&&(null==T.align&&(T.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;C=null;var n=(t.tokenize||A)(e,t);if("comment"==n)return n;if(null==T.align&&(T.align=!0),";"!=C&&":"!=C&&","!=C||"statement"!=T.type)if("{"==C)U(t,e.column(),"}");else if("["==C)U(t,e.column(),"]");else if("("==C)U(t,e.column(),")");else if("}"==C){for(;"statement"==T.type;)T=a(t);for("}"==T.type&&(T=a(t));"statement"==T.type;)T=a(t)}else C==T.type?a(t):o&&(("}"==T.type||"top"==T.type)&&";"!=C||"statement"==T.type&&"newstatement"==C)&&U(t,e.column(),"statement");else a(t);return t.startOfLine=!1,n},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{line:"#"}}}}}]); +//# sourceMappingURL=132.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/132.index.js.map b/pr-preview/pr-770/132.index.js.map new file mode 100644 index 00000000..1550fbad --- /dev/null +++ b/pr-preview/pr-770/132.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"132.index.js","mappings":"4FAAA,SAASA,EAAMC,GAEb,IADA,IAAIC,EAAM,CAAC,EAAGF,EAAQC,EAAIE,MAAM,KACvBC,EAAI,EAAGA,EAAIJ,EAAMK,SAAUD,EAClCF,EAAIF,EAAMI,KAAM,EAClB,OAAOF,CACT,C,8BAEA,MAAMI,EAAe,CACnBC,KAAM,WACNC,SAAUR,EAAM,4UAOhBS,qBAAsBT,EAAM,g9CAwC5BU,iBAAkBV,EAAM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,KAAXvB,EAAgB,CACvB,KAAmB,aAAZsC,EAAId,MAAqBc,EAAMN,EAAW3B,GAEjD,IADgB,KAAZiC,EAAId,OAAac,EAAMN,EAAW3B,IACnB,aAAZiC,EAAId,MAAqBc,EAAMN,EAAW3B,EACnD,MACSL,GAAWsC,EAAId,KAAMQ,EAAW3B,GAChCJ,KAAmC,KAAZqC,EAAId,MAA2B,OAAZc,EAAId,OACV,KAAXxB,GAAgC,aAAZsC,EAAId,MACU,gBAAXxB,IACvD4B,EAAYvB,EAAOD,EAAOmB,SAAU,kBAdpCS,EAAW3B,GAgBb,OADAA,EAAM+B,aAAc,EACbM,CACT,EAEAC,aAAc,CACZC,cAAe,YACfC,cAAe,CAACC,KAAM,M","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/ttcn-cfg.js"],"sourcesContent":["function words(str) {\n var obj = {}, words = str.split(\" \");\n for (var i = 0; i < words.length; ++i)\n obj[words[i]] = true;\n return obj;\n}\n\nconst parserConfig = {\n name: \"ttcn-cfg\",\n keywords: words(\"Yes No LogFile FileMask ConsoleMask AppendFile\" +\n \" TimeStampFormat LogEventTypes SourceInfoFormat\" +\n \" LogEntityName LogSourceInfo DiskFullAction\" +\n \" LogFileNumber LogFileSize MatchingHints Detailed\" +\n \" Compact SubCategories Stack Single None Seconds\" +\n \" DateTime Time Stop Error Retry Delete TCPPort KillTimer\" +\n \" NumHCs UnixSocketsEnabled LocalAddress\"),\n fileNCtrlMaskOptions: words(\"TTCN_EXECUTOR TTCN_ERROR TTCN_WARNING\" +\n \" TTCN_PORTEVENT TTCN_TIMEROP TTCN_VERDICTOP\" +\n \" TTCN_DEFAULTOP TTCN_TESTCASE TTCN_ACTION\" +\n \" TTCN_USER TTCN_FUNCTION TTCN_STATISTICS\" +\n \" TTCN_PARALLEL TTCN_MATCHING TTCN_DEBUG\" +\n \" EXECUTOR ERROR WARNING PORTEVENT TIMEROP\" +\n \" VERDICTOP DEFAULTOP TESTCASE ACTION USER\" +\n \" FUNCTION STATISTICS PARALLEL MATCHING DEBUG\" +\n \" LOG_ALL LOG_NOTHING ACTION_UNQUALIFIED\" +\n \" DEBUG_ENCDEC DEBUG_TESTPORT\" +\n \" DEBUG_UNQUALIFIED DEFAULTOP_ACTIVATE\" +\n \" DEFAULTOP_DEACTIVATE DEFAULTOP_EXIT\" +\n \" DEFAULTOP_UNQUALIFIED ERROR_UNQUALIFIED\" +\n \" EXECUTOR_COMPONENT EXECUTOR_CONFIGDATA\" +\n \" EXECUTOR_EXTCOMMAND EXECUTOR_LOGOPTIONS\" +\n \" EXECUTOR_RUNTIME EXECUTOR_UNQUALIFIED\" +\n \" FUNCTION_RND FUNCTION_UNQUALIFIED\" +\n \" MATCHING_DONE MATCHING_MCSUCCESS\" +\n \" MATCHING_MCUNSUCC MATCHING_MMSUCCESS\" +\n \" MATCHING_MMUNSUCC MATCHING_PCSUCCESS\" +\n \" MATCHING_PCUNSUCC MATCHING_PMSUCCESS\" +\n \" MATCHING_PMUNSUCC MATCHING_PROBLEM\" +\n \" MATCHING_TIMEOUT MATCHING_UNQUALIFIED\" +\n \" PARALLEL_PORTCONN PARALLEL_PORTMAP\" +\n \" PARALLEL_PTC PARALLEL_UNQUALIFIED\" +\n \" PORTEVENT_DUALRECV PORTEVENT_DUALSEND\" +\n \" PORTEVENT_MCRECV PORTEVENT_MCSEND\" +\n \" PORTEVENT_MMRECV PORTEVENT_MMSEND\" +\n \" PORTEVENT_MQUEUE PORTEVENT_PCIN\" +\n \" PORTEVENT_PCOUT PORTEVENT_PMIN\" +\n \" PORTEVENT_PMOUT PORTEVENT_PQUEUE\" +\n \" PORTEVENT_STATE PORTEVENT_UNQUALIFIED\" +\n \" STATISTICS_UNQUALIFIED STATISTICS_VERDICT\" +\n \" TESTCASE_FINISH TESTCASE_START\" +\n \" TESTCASE_UNQUALIFIED TIMEROP_GUARD\" +\n \" TIMEROP_READ TIMEROP_START TIMEROP_STOP\" +\n \" TIMEROP_TIMEOUT TIMEROP_UNQUALIFIED\" +\n \" USER_UNQUALIFIED VERDICTOP_FINAL\" +\n \" VERDICTOP_GETVERDICT VERDICTOP_SETVERDICT\" +\n \" VERDICTOP_UNQUALIFIED WARNING_UNQUALIFIED\"),\n externalCommands: words(\"BeginControlPart EndControlPart BeginTestCase\" +\n \" EndTestCase\"),\n multiLineStrings: true\n}\n\nvar keywords = parserConfig.keywords,\n fileNCtrlMaskOptions = parserConfig.fileNCtrlMaskOptions,\n externalCommands = parserConfig.externalCommands,\n multiLineStrings = parserConfig.multiLineStrings,\n indentStatements = parserConfig.indentStatements !== false;\nvar isOperatorChar = /[\\|]/;\nvar curPunc;\n\nfunction tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n }\n if (/[:=]/.test(ch)) {\n curPunc = ch;\n return \"punctuation\";\n }\n if (ch == \"#\"){\n stream.skipToEnd();\n return \"comment\";\n }\n if (/\\d/.test(ch)) {\n stream.eatWhile(/[\\w\\.]/);\n return \"number\";\n }\n if (isOperatorChar.test(ch)) {\n stream.eatWhile(isOperatorChar);\n return \"operator\";\n }\n if (ch == \"[\"){\n stream.eatWhile(/[\\w_\\]]/);\n return \"number\";\n }\n\n stream.eatWhile(/[\\w\\$_]/);\n var cur = stream.current();\n if (keywords.propertyIsEnumerable(cur)) return \"keyword\";\n if (fileNCtrlMaskOptions.propertyIsEnumerable(cur))\n return \"atom\";\n if (externalCommands.propertyIsEnumerable(cur)) return \"deleted\";\n\n return \"variable\";\n}\n\nfunction tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next, end = false;\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped){\n var afterNext = stream.peek();\n //look if the character if the quote is like the B in '10100010'B\n if (afterNext){\n afterNext = afterNext.toLowerCase();\n if(afterNext == \"b\" || afterNext == \"h\" || afterNext == \"o\")\n stream.next();\n }\n end = true; break;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n if (end || !(escaped || multiLineStrings))\n state.tokenize = null;\n return \"string\";\n };\n}\n\nfunction Context(indented, column, type, align, prev) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.align = align;\n this.prev = prev;\n}\nfunction pushContext(state, col, type) {\n var indent = state.indented;\n if (state.context && state.context.type == \"statement\")\n indent = state.context.indented;\n return state.context = new Context(indent, col, type, null, state.context);\n}\nfunction popContext(state) {\n var t = state.context.type;\n if (t == \")\" || t == \"]\" || t == \"}\")\n state.indented = state.context.indented;\n return state.context = state.context.prev;\n}\n\n//Interface\nexport const ttcnCfg = {\n name: \"ttcn\",\n startState: function() {\n return {\n tokenize: null,\n context: new Context(0, 0, \"top\", false),\n indented: 0,\n startOfLine: true\n };\n },\n\n token: function(stream, state) {\n var ctx = state.context;\n if (stream.sol()) {\n if (ctx.align == null) ctx.align = false;\n state.indented = stream.indentation();\n state.startOfLine = true;\n }\n if (stream.eatSpace()) return null;\n curPunc = null;\n var style = (state.tokenize || tokenBase)(stream, state);\n if (style == \"comment\") return style;\n if (ctx.align == null) ctx.align = true;\n\n if ((curPunc == \";\" || curPunc == \":\" || curPunc == \",\")\n && ctx.type == \"statement\"){\n popContext(state);\n }\n else if (curPunc == \"{\") pushContext(state, stream.column(), \"}\");\n else if (curPunc == \"[\") pushContext(state, stream.column(), \"]\");\n else if (curPunc == \"(\") pushContext(state, stream.column(), \")\");\n else if (curPunc == \"}\") {\n while (ctx.type == \"statement\") ctx = popContext(state);\n if (ctx.type == \"}\") ctx = popContext(state);\n while (ctx.type == \"statement\") ctx = popContext(state);\n }\n else if (curPunc == ctx.type) popContext(state);\n else if (indentStatements && (((ctx.type == \"}\" || ctx.type == \"top\")\n && curPunc != ';') || (ctx.type == \"statement\"\n && curPunc == \"newstatement\")))\n pushContext(state, stream.column(), \"statement\");\n state.startOfLine = false;\n return style;\n },\n\n languageData: {\n indentOnInput: /^\\s*[{}]$/,\n commentTokens: {line: \"#\"}\n }\n};\n"],"names":["words","str","obj","split","i","length","parserConfig","name","keywords","fileNCtrlMaskOptions","externalCommands","multiLineStrings","curPunc","indentStatements","isOperatorChar","tokenBase","stream","state","quote","ch","next","tokenize","escaped","end","afterNext","peek","toLowerCase","test","skipToEnd","eatWhile","cur","current","propertyIsEnumerable","Context","indented","column","type","align","prev","this","pushContext","col","indent","context","popContext","t","ttcnCfg","startState","startOfLine","token","ctx","sol","indentation","eatSpace","style","languageData","indentOnInput","commentTokens","line"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/1374.index.js b/pr-preview/pr-770/1374.index.js new file mode 100644 index 00000000..5b504d34 --- /dev/null +++ b/pr-preview/pr-770/1374.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[1374],{1374:(e,t,r)=>{r.r(t),r.d(t,{pascal:()=>u});var n=function(){for(var e={},t="absolute and array asm begin case const constructor destructor div do downto else end file for function goto if implementation in inherited inline interface label mod nil not object of operator or packed procedure program record reintroduce repeat self set shl shr string then to type unit until uses var while with xor as class dispinterface except exports finalization finally initialization inline is library on out packed property raise resourcestring threadvar try absolute abstract alias assembler bitpacked break cdecl continue cppdecl cvar default deprecated dynamic enumerator experimental export external far far16 forward generic helper implements index interrupt iocheck local message name near nodefault noreturn nostackframe oldfpccall otherwise overload override pascal platform private protected public published read register reintroduce result safecall saveregisters softfloat specialize static stdcall stored strict unaligned unimplemented varargs virtual write".split(" "),r=0;r!?|\/]/;function o(e,t){var r,o=e.next();if("#"==o&&t.startOfLine)return e.skipToEnd(),"meta";if('"'==o||"'"==o)return t.tokenize=(r=o,function(e,t){for(var n,a=!1,i=!1;null!=(n=e.next());){if(n==r&&!a){i=!0;break}a=!a&&"\\"==n}return!i&&a||(t.tokenize=null),"string"}),t.tokenize(e,t);if("("==o&&e.eat("*"))return t.tokenize=l,l(e,t);if("{"==o)return t.tokenize=s,s(e,t);if(/[\[\]\(\),;\:\.]/.test(o))return null;if(/\d/.test(o))return e.eatWhile(/[\w\.]/),"number";if("/"==o&&e.eat("/"))return e.skipToEnd(),"comment";if(i.test(o))return e.eatWhile(i),"operator";e.eatWhile(/[\w\$_]/);var u=e.current();return n.propertyIsEnumerable(u)?"keyword":a.propertyIsEnumerable(u)?"atom":"variable"}function l(e,t){for(var r,n=!1;r=e.next();){if(")"==r&&n){t.tokenize=null;break}n="*"==r}return"comment"}function s(e,t){for(var r;r=e.next();)if("}"==r){t.tokenize=null;break}return"comment"}const u={name:"pascal",startState:function(){return{tokenize:null}},token:function(e,t){return e.eatSpace()?null:(t.tokenize||o)(e,t)},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{block:{open:"(*",close:"*)"}}}}}}]); +//# sourceMappingURL=1374.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/1374.index.js.map b/pr-preview/pr-770/1374.index.js.map new file mode 100644 index 00000000..5b339de3 --- /dev/null +++ b/pr-preview/pr-770/1374.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"1374.index.js","mappings":"2HAKA,IAAIA,EALJ,WAEE,IADA,IAAIC,EAAM,CAAC,EAAGC,EAKd,u9BAL0BC,MAAM,KACvBC,EAAI,EAAGA,EAAIF,EAAMG,SAAUD,EAAGH,EAAIC,EAAME,KAAM,EACvD,OAAOH,CACT,CACeC,GAeXI,EAAQ,CAAC,MAAQ,GAEjBC,EAAiB,mBAErB,SAASC,EAAUC,EAAQC,GACzB,IAyCmBC,EAzCfC,EAAKH,EAAOI,OAChB,GAAU,KAAND,GAAaF,EAAMI,YAErB,OADAL,EAAOM,YACA,OAET,GAAU,KAANH,GAAmB,KAANA,EAEf,OADAF,EAAMM,UAmCWL,EAnCYC,EAoCxB,SAASH,EAAQC,GAEtB,IADA,IAAqBG,EAAjBI,GAAU,EAAaC,GAAM,EACA,OAAzBL,EAAOJ,EAAOI,SAAiB,CACrC,GAAIA,GAAQF,IAAUM,EAAS,CAACC,GAAM,EAAM,KAAM,CAClDD,GAAWA,GAAmB,MAARJ,CACxB,CAEA,OADIK,GAAQD,IAASP,EAAMM,SAAW,MAC/B,QACT,GA3CSN,EAAMM,SAASP,EAAQC,GAEhC,GAAU,KAANE,GAAaH,EAAOU,IAAI,KAE1B,OADAT,EAAMM,SAAWI,EACVA,EAAaX,EAAQC,GAE9B,GAAU,KAANE,EAEF,OADAF,EAAMM,SAAWK,EACVA,EAAmBZ,EAAQC,GAEpC,GAAI,mBAAmBY,KAAKV,GAC1B,OAAO,KAET,GAAI,KAAKU,KAAKV,GAEZ,OADAH,EAAOc,SAAS,UACT,SAET,GAAU,KAANX,GACEH,EAAOU,IAAI,KAEb,OADAV,EAAOM,YACA,UAGX,GAAIR,EAAee,KAAKV,GAEtB,OADAH,EAAOc,SAAShB,GACT,WAETE,EAAOc,SAAS,WAChB,IAAIC,EAAMf,EAAOgB,UACjB,OAAIzB,EAAS0B,qBAAqBF,GAAa,UAC3ClB,EAAMoB,qBAAqBF,GAAa,OACrC,UACT,CAcA,SAASJ,EAAaX,EAAQC,GAE5B,IADA,IAAsBE,EAAlBe,GAAW,EACRf,EAAKH,EAAOI,QAAQ,CACzB,GAAU,KAAND,GAAae,EAAU,CACzBjB,EAAMM,SAAW,KACjB,KACF,CACAW,EAAkB,KAANf,CACd,CACA,MAAO,SACT,CAEA,SAASS,EAAmBZ,EAAQC,GAElC,IADA,IAAIE,EACGA,EAAKH,EAAOI,QACjB,GAAU,KAAND,EAAW,CACbF,EAAMM,SAAW,KACjB,KACF,CAEF,MAAO,SACT,CAIO,MAAMY,EAAS,CACpBC,KAAM,SAENC,WAAY,WACV,MAAO,CAACd,SAAU,KACpB,EAEAe,MAAO,SAAStB,EAAQC,GACtB,OAAID,EAAOuB,WAAmB,MACjBtB,EAAMM,UAAYR,GAAWC,EAAQC,EAGpD,EAEAuB,aAAc,CACZC,cAAe,YACfC,cAAe,CAACC,MAAO,CAACC,KAAM,KAAMC,MAAO,Q","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/pascal.js"],"sourcesContent":["function words(str) {\n var obj = {}, words = str.split(\" \");\n for (var i = 0; i < words.length; ++i) obj[words[i]] = true;\n return obj;\n}\nvar keywords = words(\n \"absolute and array asm begin case const constructor destructor div do \" +\n \"downto else end file for function goto if implementation in inherited \" +\n \"inline interface label mod nil not object of operator or packed procedure \" +\n \"program record reintroduce repeat self set shl shr string then to type \" +\n \"unit until uses var while with xor as class dispinterface except exports \" +\n \"finalization finally initialization inline is library on out packed \" +\n \"property raise resourcestring threadvar try absolute abstract alias \" +\n \"assembler bitpacked break cdecl continue cppdecl cvar default deprecated \" +\n \"dynamic enumerator experimental export external far far16 forward generic \" +\n \"helper implements index interrupt iocheck local message name near \" +\n \"nodefault noreturn nostackframe oldfpccall otherwise overload override \" +\n \"pascal platform private protected public published read register \" +\n \"reintroduce result safecall saveregisters softfloat specialize static \" +\n \"stdcall stored strict unaligned unimplemented varargs virtual write\");\nvar atoms = {\"null\": true};\n\nvar isOperatorChar = /[+\\-*&%=<>!?|\\/]/;\n\nfunction tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == \"#\" && state.startOfLine) {\n stream.skipToEnd();\n return \"meta\";\n }\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n }\n if (ch == \"(\" && stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n }\n if (ch == \"{\") {\n state.tokenize = tokenCommentBraces;\n return tokenCommentBraces(stream, state);\n }\n if (/[\\[\\]\\(\\),;\\:\\.]/.test(ch)) {\n return null;\n }\n if (/\\d/.test(ch)) {\n stream.eatWhile(/[\\w\\.]/);\n return \"number\";\n }\n if (ch == \"/\") {\n if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return \"comment\";\n }\n }\n if (isOperatorChar.test(ch)) {\n stream.eatWhile(isOperatorChar);\n return \"operator\";\n }\n stream.eatWhile(/[\\w\\$_]/);\n var cur = stream.current();\n if (keywords.propertyIsEnumerable(cur)) return \"keyword\";\n if (atoms.propertyIsEnumerable(cur)) return \"atom\";\n return \"variable\";\n}\n\nfunction tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next, end = false;\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) {end = true; break;}\n escaped = !escaped && next == \"\\\\\";\n }\n if (end || !escaped) state.tokenize = null;\n return \"string\";\n };\n}\n\nfunction tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \")\" && maybeEnd) {\n state.tokenize = null;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return \"comment\";\n}\n\nfunction tokenCommentBraces(stream, state) {\n var ch;\n while (ch = stream.next()) {\n if (ch == \"}\") {\n state.tokenize = null;\n break;\n }\n }\n return \"comment\";\n}\n\n// Interface\n\nexport const pascal = {\n name: \"pascal\",\n\n startState: function() {\n return {tokenize: null};\n },\n\n token: function(stream, state) {\n if (stream.eatSpace()) return null;\n var style = (state.tokenize || tokenBase)(stream, state);\n if (style == \"comment\" || style == \"meta\") return style;\n return style;\n },\n\n languageData: {\n indentOnInput: /^\\s*[{}]$/,\n commentTokens: {block: {open: \"(*\", close: \"*)\"}}\n }\n};\n"],"names":["keywords","obj","words","split","i","length","atoms","isOperatorChar","tokenBase","stream","state","quote","ch","next","startOfLine","skipToEnd","tokenize","escaped","end","eat","tokenComment","tokenCommentBraces","test","eatWhile","cur","current","propertyIsEnumerable","maybeEnd","pascal","name","startState","token","eatSpace","languageData","indentOnInput","commentTokens","block","open","close"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/1405.index.js b/pr-preview/pr-770/1405.index.js new file mode 100644 index 00000000..0ac56cee --- /dev/null +++ b/pr-preview/pr-770/1405.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[1405],{1405:(e,t,n)=>{n.r(t),n.d(t,{scheme:()=>E});var r="comment",a="string",i="symbol",s="atom",c="number",l="bracket";function o(e){for(var t={},n=e.split(" "),r=0;rinteger char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"),u=o("define let letrec let* lambda define-macro defmacro let-syntax letrec-syntax let-values let*-values define-syntax syntax-rules define-values when unless");function m(e,t,n){this.indent=e,this.type=t,this.prev=n}function p(e,t,n){e.indentStack=new m(t,n,e.indentStack)}var f=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),h=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),g=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),x=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);function b(e){return e.match(f)}function k(e){return e.match(h)}function v(e,t){return!0===t&&e.backUp(1),e.match(x)}function y(e){return e.match(g)}function w(e,t){for(var n,r=!1;null!=(n=e.next());){if(n==t.token&&!r){t.state.mode=!1;break}r=!r&&"\\"==n}}const E={name:"scheme",startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1,sExprQuote:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),e.eatSpace())return null;var n=null;switch(t.mode){case"string":w(e,{token:'"',state:t}),n=a;break;case"symbol":w(e,{token:"|",state:t}),n=i;break;case"comment":for(var o,m=!1;null!=(o=e.next());){if("#"==o&&m){t.mode=!1;break}m="|"==o}n=r;break;case"s-expr-comment":if(t.mode=!1,"("!=e.peek()&&"["!=e.peek()){e.eatWhile(/[^\s\(\)\[\]]/),n=r;break}t.sExprComment=0;default:var f=e.next();if('"'==f)t.mode="string",n=a;else if("'"==f)"("==e.peek()||"["==e.peek()?("number"!=typeof t.sExprQuote&&(t.sExprQuote=0),n=s):(e.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/),n=s);else if("|"==f)t.mode="symbol",n=i;else if("#"==f)if(e.eat("|"))t.mode="comment",n=r;else if(e.eat(/[tf]/i))n=s;else if(e.eat(";"))t.mode="s-expr-comment",n=r;else{var h=null,g=!1,x=!0;e.eat(/[ei]/i)?g=!0:e.backUp(1),e.match(/^#b/i)?h=b:e.match(/^#o/i)?h=k:e.match(/^#x/i)?h=y:e.match(/^#d/i)?h=v:e.match(/^[-+0-9.]/,!1)?(x=!1,h=v):g||e.eat("#"),null!=h&&(x&&!g&&e.match(/^#[ei]/i),h(e)&&(n=c))}else if(/^[-+0-9.]/.test(f)&&v(e,!0))n=c;else if(";"==f)e.skipToEnd(),n=r;else if("("==f||"["==f){for(var E,S="",q=e.column();null!=(E=e.eat(/[^\s\(\[\;\)\]]/));)S+=E;S.length>0&&u.propertyIsEnumerable(S)?p(t,q+2,f):(e.eatSpace(),e.eol()||";"==e.peek()?p(t,q+1,f):p(t,q+e.current().length,f)),e.backUp(e.current().length-1),"number"==typeof t.sExprComment&&t.sExprComment++,"number"==typeof t.sExprQuote&&t.sExprQuote++,n=l}else")"==f||"]"==f?(n=l,null!=t.indentStack&&t.indentStack.type==(")"==f?"(":"[")&&(function(e){e.indentStack=e.indentStack.prev}(t),"number"==typeof t.sExprComment&&0==--t.sExprComment&&(n=r,t.sExprComment=!1),"number"==typeof t.sExprQuote&&0==--t.sExprQuote&&(n=s,t.sExprQuote=!1))):(e.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/),n=d&&d.propertyIsEnumerable(e.current())?"builtin":"variable")}return"number"==typeof t.sExprComment?r:"number"==typeof t.sExprQuote?s:n},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},languageData:{closeBrackets:{brackets:["(","[","{",'"']},commentTokens:{line:";;"}}}}}]); +//# sourceMappingURL=1405.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/1405.index.js.map b/pr-preview/pr-770/1405.index.js.map new file mode 100644 index 00000000..5ea9be6e --- /dev/null +++ b/pr-preview/pr-770/1405.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"1405.index.js","mappings":"2HAAA,IAAyBA,EAAU,UAAWC,EAAS,SACnDC,EAAS,SAAUC,EAAO,OAAQC,EAAS,SAAUC,EAAU,UAGnE,SAASC,EAAaC,GAEpB,IADA,IAAIC,EAAM,CAAC,EAAGC,EAAQF,EAAIG,MAAM,KACvBC,EAAI,EAAGA,EAAIF,EAAMG,SAAUD,EAAGH,EAAIC,EAAME,KAAM,EACvD,OAAOH,CACT,CAEA,IAAIK,EAAWP,EAAa,spEACxBQ,EAAaR,EAAa,4JAE9B,SAASS,EAAWC,EAAQC,EAAMC,GAChCC,KAAKH,OAASA,EACdG,KAAKF,KAAOA,EACZE,KAAKD,KAAOA,CACd,CAEA,SAASE,EAAUC,EAAOL,EAAQC,GAChCI,EAAMC,YAAc,IAAIP,EAAWC,EAAQC,EAAMI,EAAMC,YACzD,CAMA,IAAIC,EAAgB,IAAIC,OAAO,mMAC3BC,EAAe,IAAID,OAAO,+MAC1BE,EAAa,IAAIF,OAAO,uOACxBG,EAAiB,IAAIH,OAAO,ghBAEhC,SAASI,EAAgBC,GACvB,OAAOA,EAAOC,MAAMP,EACtB,CAEA,SAASQ,EAAeF,GACtB,OAAOA,EAAOC,MAAML,EACtB,CAEA,SAASO,EAAiBH,EAAQI,GAIhC,OAHe,IAAXA,GACFJ,EAAOK,OAAO,GAETL,EAAOC,MAAMH,EACtB,CAEA,SAASQ,EAAaN,GACpB,OAAOA,EAAO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D,OAAQ0C,IAG3DzB,EAAOK,OAAOL,EAAOsC,UAAUvD,OAAS,GAER,iBAAtBS,EAAMyB,cAA0BzB,EAAMyB,eAClB,iBAApBzB,EAAM0B,YAAwB1B,EAAM0B,aAE9CG,EAAa7C,CACf,KAAiB,KAANiD,GAAmB,KAANA,GACtBJ,EAAa7C,EACY,MAArBgB,EAAMC,aAAuBD,EAAMC,YAAYL,OAAe,KAANqC,EAAY,IAAM,OAzMtF,SAAkBjC,GAChBA,EAAMC,YAAcD,EAAMC,YAAYJ,IACxC,CAwMUkD,CAAS/C,GAEuB,iBAAtBA,EAAMyB,cACa,KAAtBzB,EAAMyB,eACTI,EAAalD,EACbqB,EAAMyB,cAAe,GAGK,iBAApBzB,EAAM0B,YACW,KAApB1B,EAAM0B,aACTG,EAAa/C,EACbkB,EAAM0B,YAAa,MAKzBlB,EAAOwB,SAAS,8BAGdH,EADErC,GAAYA,EAASoD,qBAAqBpC,EAAOsC,WAnP/C,UAqPc,YAGxB,MAAqC,iBAAtB9C,EAAMyB,aAA4B9C,EAAuC,iBAApBqB,EAAM0B,WAA0B5C,EAAO+C,CAC7G,EAEAlC,OAAQ,SAAUK,GAChB,OAAyB,MAArBA,EAAMC,YAA4BD,EAAMwB,YACrCxB,EAAMC,YAAYN,MAC3B,EAEAqD,aAAc,CACZC,cAAe,CAACC,SAAU,CAAC,IAAK,IAAK,IAAK,MAC1CC,cAAe,CAACC,KAAM,O","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/scheme.js"],"sourcesContent":["var BUILTIN = \"builtin\", COMMENT = \"comment\", STRING = \"string\",\n SYMBOL = \"symbol\", ATOM = \"atom\", NUMBER = \"number\", BRACKET = \"bracket\";\nvar INDENT_WORD_SKIP = 2;\n\nfunction makeKeywords(str) {\n var obj = {}, words = str.split(\" \");\n for (var i = 0; i < words.length; ++i) obj[words[i]] = true;\n return obj;\n}\n\nvar keywords = makeKeywords(\"λ case-lambda call/cc class cond-expand define-class define-values exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax define-macro defmacro delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?\");\nvar indentKeys = makeKeywords(\"define let letrec let* lambda define-macro defmacro let-syntax letrec-syntax let-values let*-values define-syntax syntax-rules define-values when unless\");\n\nfunction stateStack(indent, type, prev) { // represents a state stack object\n this.indent = indent;\n this.type = type;\n this.prev = prev;\n}\n\nfunction pushStack(state, indent, type) {\n state.indentStack = new stateStack(indent, type, state.indentStack);\n}\n\nfunction popStack(state) {\n state.indentStack = state.indentStack.prev;\n}\n\nvar binaryMatcher = new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\\/[01]+#*)?i|[-+]?[01]+#*(?:\\/[01]+#*)?@[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+\\.?#*|\\d+\\.\\d*#*|\\.\\d+#*|\\d+)(?:[esfdl][-+]?\\d+)?)|\\d+#*\\/\\d+#*)?i|(?:(?:(?:\\d+#+\\.?#*|\\d+\\.\\d*#*|\\.\\d+#*|\\d+)(?:[esfdl][-+]?\\d+)?)|\\d+#*\\/\\d+#*))(?=[()\\s;\"]|$)/i);\n\nfunction isBinaryNumber (stream) {\n return stream.match(binaryMatcher);\n}\n\nfunction isOctalNumber (stream) {\n return stream.match(octalMatcher);\n}\n\nfunction isDecimalNumber (stream, backup) {\n if (backup === true) {\n stream.backUp(1);\n }\n return stream.match(decimalMatcher);\n}\n\nfunction isHexNumber (stream) {\n return stream.match(hexMatcher);\n}\n\nfunction processEscapedSequence(stream, options) {\n var next, escaped = false;\n while ((next = stream.next()) != null) {\n if (next == options.token && !escaped) {\n options.state.mode = false;\n break;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n}\n\nexport const scheme = {\n name: \"scheme\",\n startState: function () {\n return {\n indentStack: null,\n indentation: 0,\n mode: false,\n sExprComment: false,\n sExprQuote: false\n };\n },\n\n token: function (stream, state) {\n if (state.indentStack == null && stream.sol()) {\n // update indentation, but only if indentStack is empty\n state.indentation = stream.indentation();\n }\n\n // skip spaces\n if (stream.eatSpace()) {\n return null;\n }\n var returnType = null;\n\n switch(state.mode){\n case \"string\": // multi-line string parsing mode\n processEscapedSequence(stream, {\n token: \"\\\"\",\n state: state\n });\n returnType = STRING; // continue on in scheme-string mode\n break;\n case \"symbol\": // escape symbol\n processEscapedSequence(stream, {\n token: \"|\",\n state: state\n });\n returnType = SYMBOL; // continue on in scheme-symbol mode\n break;\n case \"comment\": // comment parsing mode\n var next, maybeEnd = false;\n while ((next = stream.next()) != null) {\n if (next == \"#\" && maybeEnd) {\n\n state.mode = false;\n break;\n }\n maybeEnd = (next == \"|\");\n }\n returnType = COMMENT;\n break;\n case \"s-expr-comment\": // s-expr commenting mode\n state.mode = false;\n if(stream.peek() == \"(\" || stream.peek() == \"[\"){\n // actually start scheme s-expr commenting mode\n state.sExprComment = 0;\n }else{\n // if not we just comment the entire of the next token\n stream.eatWhile(/[^\\s\\(\\)\\[\\]]/); // eat symbol atom\n returnType = COMMENT;\n break;\n }\n default: // default parsing mode\n var ch = stream.next();\n\n if (ch == \"\\\"\") {\n state.mode = \"string\";\n returnType = STRING;\n\n } else if (ch == \"'\") {\n if (stream.peek() == \"(\" || stream.peek() == \"[\"){\n if (typeof state.sExprQuote != \"number\") {\n state.sExprQuote = 0;\n } // else already in a quoted expression\n returnType = ATOM;\n } else {\n stream.eatWhile(/[\\w_\\-!$%&*+\\.\\/:<=>?@\\^~]/);\n returnType = ATOM;\n }\n } else if (ch == '|') {\n state.mode = \"symbol\";\n returnType = SYMBOL;\n } else if (ch == '#') {\n if (stream.eat(\"|\")) { // Multi-line comment\n state.mode = \"comment\"; // toggle to comment mode\n returnType = COMMENT;\n } else if (stream.eat(/[tf]/i)) { // #t/#f (atom)\n returnType = ATOM;\n } else if (stream.eat(';')) { // S-Expr comment\n state.mode = \"s-expr-comment\";\n returnType = COMMENT;\n } else {\n var numTest = null, hasExactness = false, hasRadix = true;\n if (stream.eat(/[ei]/i)) {\n hasExactness = true;\n } else {\n stream.backUp(1); // must be radix specifier\n }\n if (stream.match(/^#b/i)) {\n numTest = isBinaryNumber;\n } else if (stream.match(/^#o/i)) {\n numTest = isOctalNumber;\n } else if (stream.match(/^#x/i)) {\n numTest = isHexNumber;\n } else if (stream.match(/^#d/i)) {\n numTest = isDecimalNumber;\n } else if (stream.match(/^[-+0-9.]/, false)) {\n hasRadix = false;\n numTest = isDecimalNumber;\n // re-consume the initial # if all matches failed\n } else if (!hasExactness) {\n stream.eat('#');\n }\n if (numTest != null) {\n if (hasRadix && !hasExactness) {\n // consume optional exactness after radix\n stream.match(/^#[ei]/i);\n }\n if (numTest(stream))\n returnType = NUMBER;\n }\n }\n } else if (/^[-+0-9.]/.test(ch) && isDecimalNumber(stream, true)) { // match non-prefixed number, must be decimal\n returnType = NUMBER;\n } else if (ch == \";\") { // comment\n stream.skipToEnd(); // rest of the line is a comment\n returnType = COMMENT;\n } else if (ch == \"(\" || ch == \"[\") {\n var keyWord = ''; var indentTemp = stream.column(), letter;\n /**\n Either\n (indent-word ..\n (non-indent-word ..\n (;something else, bracket, etc.\n */\n\n while ((letter = stream.eat(/[^\\s\\(\\[\\;\\)\\]]/)) != null) {\n keyWord += letter;\n }\n\n if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word\n\n pushStack(state, indentTemp + INDENT_WORD_SKIP, ch);\n } else { // non-indent word\n // we continue eating the spaces\n stream.eatSpace();\n if (stream.eol() || stream.peek() == \";\") {\n // nothing significant after\n // we restart indentation 1 space after\n pushStack(state, indentTemp + 1, ch);\n } else {\n pushStack(state, indentTemp + stream.current().length, ch); // else we match\n }\n }\n stream.backUp(stream.current().length - 1); // undo all the eating\n\n if(typeof state.sExprComment == \"number\") state.sExprComment++;\n if(typeof state.sExprQuote == \"number\") state.sExprQuote++;\n\n returnType = BRACKET;\n } else if (ch == \")\" || ch == \"]\") {\n returnType = BRACKET;\n if (state.indentStack != null && state.indentStack.type == (ch == \")\" ? \"(\" : \"[\")) {\n popStack(state);\n\n if(typeof state.sExprComment == \"number\"){\n if(--state.sExprComment == 0){\n returnType = COMMENT; // final closing bracket\n state.sExprComment = false; // turn off s-expr commenting mode\n }\n }\n if(typeof state.sExprQuote == \"number\"){\n if(--state.sExprQuote == 0){\n returnType = ATOM; // final closing bracket\n state.sExprQuote = false; // turn off s-expr quote mode\n }\n }\n }\n } else {\n stream.eatWhile(/[\\w_\\-!$%&*+\\.\\/:<=>?@\\^~]/);\n\n if (keywords && keywords.propertyIsEnumerable(stream.current())) {\n returnType = BUILTIN;\n } else returnType = \"variable\";\n }\n }\n return (typeof state.sExprComment == \"number\") ? COMMENT : ((typeof state.sExprQuote == \"number\") ? ATOM : returnType);\n },\n\n indent: function (state) {\n if (state.indentStack == null) return state.indentation;\n return state.indentStack.indent;\n },\n\n languageData: {\n closeBrackets: {brackets: [\"(\", \"[\", \"{\", '\"']},\n commentTokens: {line: \";;\"}\n }\n};\n"],"names":["COMMENT","STRING","SYMBOL","ATOM","NUMBER","BRACKET","makeKeywords","str","obj","words","split","i","length","keywords","indentKeys","stateStack","indent","type","prev","this","pushStack","state","indentStack","binaryMatcher","RegExp","octalMatcher","hexMatcher","decimalMatcher","isBinaryNumber","stream","match","isOctalNumber","isDecimalNumber","backup","backUp","isHexNumber","processEscapedSequence","options","next","escaped","token","mode","scheme","name","startState","indentation","sExprComment","sExprQuote","sol","eatSpace","returnType","maybeEnd","peek","eatWhile","ch","eat","numTest","hasExactness","hasRadix","test","skipToEnd","letter","keyWord","indentTemp","column","propertyIsEnumerable","eol","current","popStack","languageData","closeBrackets","brackets","commentTokens","line"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/1408.index.js b/pr-preview/pr-770/1408.index.js new file mode 100644 index 00000000..dad001e3 --- /dev/null +++ b/pr-preview/pr-770/1408.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[1408],{1408:(e,t,n)=>{n.r(t),n.d(t,{go:()=>s});var r,i={break:!0,case:!0,chan:!0,const:!0,continue:!0,default:!0,defer:!0,else:!0,fallthrough:!0,for:!0,func:!0,go:!0,goto:!0,if:!0,import:!0,interface:!0,map:!0,package:!0,range:!0,return:!0,select:!0,struct:!0,switch:!0,type:!0,var:!0,bool:!0,byte:!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,int:!0,uint:!0,uintptr:!0,error:!0,rune:!0,any:!0,comparable:!0},a={true:!0,false:!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,delete:!0,imag:!0,len:!0,make:!0,new:!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},o=/[+\-*&^%:=<>!|\/]/;function u(e,t){var n,l=e.next();if('"'==l||"'"==l||"`"==l)return t.tokenize=(n=l,function(e,t){for(var r,i=!1,a=!1;null!=(r=e.next());){if(r==n&&!i){a=!0;break}i=!i&&"`"!=n&&"\\"==r}return(a||!i&&"`"!=n)&&(t.tokenize=u),"string"}),t.tokenize(e,t);if(/[\d\.]/.test(l))return"."==l?e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==l?e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/):e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(l))return r=l,null;if("/"==l){if(e.eat("*"))return t.tokenize=c,c(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(o.test(l))return e.eatWhile(o),"operator";e.eatWhile(/[\w\$_\xa1-\uffff]/);var f=e.current();return i.propertyIsEnumerable(f)?("case"!=f&&"default"!=f||(r="case"),"keyword"):a.propertyIsEnumerable(f)?"atom":"variable"}function c(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=u;break}r="*"==n}return"comment"}function l(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function f(e,t,n){return e.context=new l(e.indented,t,n,null,e.context)}const s={name:"go",startState:function(e){return{tokenize:null,context:new l(-e,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0,"case"==n.type&&(n.type="}")),e.eatSpace())return null;r=null;var i=(t.tokenize||u)(e,t);return"comment"==i||(null==n.align&&(n.align=!0),"{"==r?f(t,e.column(),"}"):"["==r?f(t,e.column(),"]"):"("==r?f(t,e.column(),")"):"case"==r?n.type="case":("}"==r&&"}"==n.type||r==n.type)&&function(e){if(e.context.prev){var t=e.context.type;")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}}(t),t.startOfLine=!1),i},indent:function(e,t,n){if(e.tokenize!=u&&null!=e.tokenize)return null;var r=e.context,i=t&&t.charAt(0);if("case"==r.type&&/^(?:case|default)\b/.test(t))return r.indented;var a=i==r.type;return r.align?r.column+(a?0:1):r.indented+(a?0:n.unit)},languageData:{indentOnInput:/^\s([{}]|case |default\s*:)$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}}}}}}]); +//# sourceMappingURL=1408.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/1408.index.js.map b/pr-preview/pr-770/1408.index.js.map new file mode 100644 index 00000000..daae71a1 --- /dev/null +++ b/pr-preview/pr-770/1408.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"1408.index.js","mappings":"uHAAA,IAsBIA,EAtBAC,EAAW,CACb,OAAQ,EAAM,MAAO,EAAM,MAAO,EAAM,OAAQ,EAAM,UAAW,EACjE,SAAU,EAAM,OAAQ,EAAM,MAAO,EAAM,aAAc,EAAM,KAAM,EACrE,MAAO,EAAM,IAAK,EAAM,MAAO,EAAM,IAAK,EAAM,QAAS,EACzD,WAAY,EAAM,KAAM,EAAM,SAAU,EAAM,OAAQ,EAAM,QAAS,EACrE,QAAS,EAAM,QAAS,EAAM,QAAS,EAAM,MAAO,EAAM,KAAM,EAChE,MAAO,EAAM,MAAO,EAAM,WAAY,EAAM,YAAa,EACzD,SAAU,EAAM,SAAU,EAAM,MAAO,EAAM,OAAQ,EAAM,OAAQ,EACnE,OAAQ,EAAM,QAAS,EAAM,OAAQ,EAAM,QAAS,EAAM,QAAS,EACnE,QAAS,EAAM,KAAM,EAAM,MAAO,EAAM,SAAU,EAAM,OAAS,EACjE,MAAO,EAAM,KAAM,EAAM,YAAa,GAGpCC,EAAQ,CACV,MAAO,EAAM,OAAQ,EAAM,MAAO,EAAM,KAAM,EAAM,QAAS,EAC7D,KAAM,EAAM,OAAQ,EAAM,SAAU,EAAM,MAAO,EAAM,QAAS,EAAM,MAAO,EAC7E,KAAM,EAAM,MAAO,EAAM,KAAM,EAAM,O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AItC,EAAM0B,QAAQN,KACb,KAALkB,GAAiB,KAALA,GAAiB,KAALA,IAC1BtC,EAAMkB,SAAWlB,EAAM0B,QAAQR,UAC1BlB,EAAM0B,QAAU1B,EAAM0B,QAAQJ,IAJN,CAKjC,CAiCgDiB,CAAWvC,GAEvDA,EAAM+B,aAAc,GATWM,CAWjC,EAEAG,OAAQ,SAASxC,EAAOyC,EAAWC,GACjC,GAAI1C,EAAMI,UAAYN,GAA+B,MAAlBE,EAAMI,SAAkB,OAAO,KAClE,IAAI6B,EAAMjC,EAAM0B,QAASiB,EAAYF,GAAaA,EAAUG,OAAO,GACnE,GAAgB,QAAZX,EAAIb,MAAkB,sBAAsBb,KAAKkC,GAAY,OAAOR,EAAIf,SAC5E,IAAI2B,EAAUF,GAAaV,EAAIb,KAC/B,OAAIa,EAAIZ,MAAcY,EAAId,QAAU0B,EAAU,EAAI,GACtCZ,EAAIf,UAAY2B,EAAU,EAAIH,EAAGI,KAC/C,EAEAC,aAAc,CACZC,cAAe,+BACfC,cAAe,CAACC,KAAM,KAAMC,MAAO,CAACC,KAAM,KAAMC,MAAO,Q","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/go.js"],"sourcesContent":["var keywords = {\n \"break\":true, \"case\":true, \"chan\":true, \"const\":true, \"continue\":true,\n \"default\":true, \"defer\":true, \"else\":true, \"fallthrough\":true, \"for\":true,\n \"func\":true, \"go\":true, \"goto\":true, \"if\":true, \"import\":true,\n \"interface\":true, \"map\":true, \"package\":true, \"range\":true, \"return\":true,\n \"select\":true, \"struct\":true, \"switch\":true, \"type\":true, \"var\":true,\n \"bool\":true, \"byte\":true, \"complex64\":true, \"complex128\":true,\n \"float32\":true, \"float64\":true, \"int8\":true, \"int16\":true, \"int32\":true,\n \"int64\":true, \"string\":true, \"uint8\":true, \"uint16\":true, \"uint32\":true,\n \"uint64\":true, \"int\":true, \"uint\":true, \"uintptr\":true, \"error\": true,\n \"rune\":true, \"any\":true, \"comparable\":true\n};\n\nvar atoms = {\n \"true\":true, \"false\":true, \"iota\":true, \"nil\":true, \"append\":true,\n \"cap\":true, \"close\":true, \"complex\":true, \"copy\":true, \"delete\":true, \"imag\":true,\n \"len\":true, \"make\":true, \"new\":true, \"panic\":true, \"print\":true,\n \"println\":true, \"real\":true, \"recover\":true\n};\n\nvar isOperatorChar = /[+\\-*&^%:=<>!|\\/]/;\n\nvar curPunc;\n\nfunction tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\" || ch == \"`\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n }\n if (/[\\d\\.]/.test(ch)) {\n if (ch == \".\") {\n stream.match(/^[0-9]+([eE][\\-+]?[0-9]+)?/);\n } else if (ch == \"0\") {\n stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);\n } else {\n stream.match(/^[0-9]*\\.?[0-9]*([eE][\\-+]?[0-9]+)?/);\n }\n return \"number\";\n }\n if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n curPunc = ch;\n return null;\n }\n if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n }\n if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return \"comment\";\n }\n }\n if (isOperatorChar.test(ch)) {\n stream.eatWhile(isOperatorChar);\n return \"operator\";\n }\n stream.eatWhile(/[\\w\\$_\\xa1-\\uffff]/);\n var cur = stream.current();\n if (keywords.propertyIsEnumerable(cur)) {\n if (cur == \"case\" || cur == \"default\") curPunc = \"case\";\n return \"keyword\";\n }\n if (atoms.propertyIsEnumerable(cur)) return \"atom\";\n return \"variable\";\n}\n\nfunction tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next, end = false;\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) {end = true; break;}\n escaped = !escaped && quote != \"`\" && next == \"\\\\\";\n }\n if (end || !(escaped || quote == \"`\"))\n state.tokenize = tokenBase;\n return \"string\";\n };\n}\n\nfunction tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return \"comment\";\n}\n\nfunction Context(indented, column, type, align, prev) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.align = align;\n this.prev = prev;\n}\nfunction pushContext(state, col, type) {\n return state.context = new Context(state.indented, col, type, null, state.context);\n}\nfunction popContext(state) {\n if (!state.context.prev) return;\n var t = state.context.type;\n if (t == \")\" || t == \"]\" || t == \"}\")\n state.indented = state.context.indented;\n return state.context = state.context.prev;\n}\n\n// Interface\n\nexport const go = {\n name: \"go\",\n startState: function(indentUnit) {\n return {\n tokenize: null,\n context: new Context(-indentUnit, 0, \"top\", false),\n indented: 0,\n startOfLine: true\n };\n },\n\n token: function(stream, state) {\n var ctx = state.context;\n if (stream.sol()) {\n if (ctx.align == null) ctx.align = false;\n state.indented = stream.indentation();\n state.startOfLine = true;\n if (ctx.type == \"case\") ctx.type = \"}\";\n }\n if (stream.eatSpace()) return null;\n curPunc = null;\n var style = (state.tokenize || tokenBase)(stream, state);\n if (style == \"comment\") return style;\n if (ctx.align == null) ctx.align = true;\n\n if (curPunc == \"{\") pushContext(state, stream.column(), \"}\");\n else if (curPunc == \"[\") pushContext(state, stream.column(), \"]\");\n else if (curPunc == \"(\") pushContext(state, stream.column(), \")\");\n else if (curPunc == \"case\") ctx.type = \"case\";\n else if (curPunc == \"}\" && ctx.type == \"}\") popContext(state);\n else if (curPunc == ctx.type) popContext(state);\n state.startOfLine = false;\n return style;\n },\n\n indent: function(state, textAfter, cx) {\n if (state.tokenize != tokenBase && state.tokenize != null) return null;\n var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);\n if (ctx.type == \"case\" && /^(?:case|default)\\b/.test(textAfter)) return ctx.indented;\n var closing = firstChar == ctx.type;\n if (ctx.align) return ctx.column + (closing ? 0 : 1);\n else return ctx.indented + (closing ? 0 : cx.unit);\n },\n\n languageData: {\n indentOnInput: /^\\s([{}]|case |default\\s*:)$/,\n commentTokens: {line: \"//\", block: {open: \"/*\", close: \"*/\"}}\n }\n};\n\n"],"names":["curPunc","keywords","atoms","isOperatorChar","tokenBase","stream","state","quote","ch","next","tokenize","escaped","end","test","match","eat","tokenComment","skipToEnd","eatWhile","cur","current","propertyIsEnumerable","maybeEnd","Context","indented","column","type","align","prev","this","pushContext","col","context","go","name","startState","indentUnit","startOfLine","token","ctx","sol","indentation","eatSpace","style","t","popContext","indent","textAfter","cx","firstChar","charAt","closing","unit","languageData","indentOnInput","commentTokens","line","block","open","close"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/142.index.js b/pr-preview/pr-770/142.index.js new file mode 100644 index 00000000..60733e53 --- /dev/null +++ b/pr-preview/pr-770/142.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[142],{142:(O,Q,P)=>{P.r(Q),P.d(Q,{rust:()=>_,rustLanguage:()=>Y});var $=P(3643),X=P(9913);function i(O){return O>=48&&O<=57}function e(O){return i(O)||95==O}const n=new $.Lu(((O,Q)=>{if(i(O.next)){let Q=!1;do{O.advance()}while(e(O.next));if(46==O.next)if(Q=!0,O.advance(),i(O.next))do{O.advance()}while(e(O.next));else if(46==O.next||O.next>127||/\w/.test(String.fromCharCode(O.next)))return;if(101==O.next||69==O.next){if(Q=!0,O.advance(),43!=O.next&&45!=O.next||O.advance(),!e(O.next))return;do{O.advance()}while(e(O.next))}if(102==O.next){let P=O.peek(1);if(!(51==P&&50==O.peek(2)||54==P&&52==O.peek(2)))return;O.advance(3),Q=!0}Q&&O.acceptToken(5)}else if(98==O.next||114==O.next){if(98==O.next&&O.advance(),114!=O.next)return;O.advance();let Q=0;for(;35==O.next;)Q++,O.advance();if(34!=O.next)return;O.advance();O:for(;;){if(O.next<0)return;let P=34==O.next;if(O.advance(),P){for(let P=0;P{124==O.next&&O.acceptToken(1,1)})),S=new $.Lu((O=>{60==O.next?O.acceptToken(2,1):62==O.next&&O.acceptToken(3,1)})),r=(0,X.pn)({"const macro_rules struct union enum type fn impl trait let static":X._A.definitionKeyword,"mod use crate":X._A.moduleKeyword,"pub unsafe async mut extern default move":X._A.modifier,"for if else loop while match continue break return await":X._A.controlKeyword,"as in ref":X._A.operatorKeyword,"where _ crate super dyn":X._A.keyword,self:X._A.self,String:X._A.string,Char:X._A.character,RawString:X._A.special(X._A.string),Boolean:X._A.bool,Identifier:X._A.variableName,"CallExpression/Identifier":X._A.function(X._A.variableName),BoundIdentifier:X._A.definition(X._A.variableName),"FunctionItem/BoundIdentifier":X._A.function(X._A.definition(X._A.variableName)),LoopLabel:X._A.labelName,FieldIdentifier:X._A.propertyName,"CallExpression/FieldExpression/FieldIdentifier":X._A.function(X._A.propertyName),Lifetime:X._A.special(X._A.variableName),ScopeIdentifier:X._A.namespace,TypeIdentifier:X._A.typeName,"MacroInvocation/Identifier MacroInvocation/ScopedIdentifier/Identifier":X._A.macroName,"MacroInvocation/TypeIdentifier MacroInvocation/ScopedIdentifier/TypeIdentifier":X._A.macroName,'"!"':X._A.macroName,UpdateOp:X._A.updateOperator,LineComment:X._A.lineComment,BlockComment:X._A.blockComment,Integer:X._A.integer,Float:X._A.float,ArithOp:X._A.arithmeticOperator,LogicOp:X._A.logicOperator,BitOp:X._A.bitwiseOperator,CompareOp:X._A.compareOperator,"=":X._A.definitionOperator,".. ... => ->":X._A.punctuation,"( )":X._A.paren,"[ ]":X._A.squareBracket,"{ }":X._A.brace,". DerefOp":X._A.derefOperator,"&":X._A.operator,", ; ::":X._A.separator,"Attribute/...":X._A.meta}),s={__proto__:null,self:28,super:32,crate:34,impl:46,true:72,false:72,pub:88,in:92,const:96,unsafe:104,async:108,move:110,if:114,let:118,ref:142,mut:144,_:198,else:200,match:204,as:248,return:252,await:262,break:270,continue:276,while:312,loop:316,for:320,macro_rules:327,mod:334,extern:342,struct:346,where:364,union:379,enum:382,type:390,default:395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3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gR${xR0b+UR0W*xR0U*xR6{4PR/y*vR/x*vR0P*wR0O*wR0_+QR0^+Q%XyObxz!O!P!Q!T!n$O$u$y$|%_%b%f%n%o%p%q%y%{&P&o&p&r'](q)S)U)i)s)v)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-t-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gR0k+ZR0j+ZQ'R!qQ)c%XQ+w&|R4y1PX'Q!q%X&|1PR+y&|R+x&|T/S*S4TT/R*S4TR.o)sR.n)sR){%p",nodeNames:"⚠ | < > RawString Float LineComment BlockComment SourceFile ] InnerAttribute ! [ MetaItem self Metavariable super crate Identifier ScopedIdentifier :: QualifiedScope AbstractType impl SelfType MetaType TypeIdentifier ScopedTypeIdentifier ScopeIdentifier TypeArgList TypeBinding = Lifetime String Escape Char Boolean Integer } { Block ; ConstItem Vis pub ( in ) const BoundIdentifier : UnsafeBlock unsafe AsyncBlock async move IfExpression if LetDeclaration let LiteralPattern ArithOp MetaPattern SelfPattern ScopedIdentifier TuplePattern ScopedTypeIdentifier , StructPattern FieldPatternList FieldPattern ref mut FieldIdentifier .. RefPattern SlicePattern CapturedPattern ReferencePattern & MutPattern RangePattern ... OrPattern MacroPattern ParenthesizedTokens TokenBinding Identifier TokenRepetition ArithOp BitOp LogicOp UpdateOp CompareOp -> => ArithOp BracketedTokens BracedTokens _ else MatchExpression match MatchBlock MatchArm Attribute Guard UnaryExpression ArithOp DerefOp LogicOp ReferenceExpression TryExpression BinaryExpression ArithOp ArithOp BitOp BitOp BitOp BitOp LogicOp LogicOp AssignmentExpression TypeCastExpression as ReturnExpression return RangeExpression CallExpression ArgList AwaitExpression await FieldExpression GenericFunction BreakExpression break LoopLabel ContinueExpression continue IndexExpression ArrayExpression TupleExpression MacroInvocation UnitExpression ClosureExpression ParamList Parameter Parameter ParenthesizedExpression StructExpression FieldInitializerList ShorthandFieldInitializer FieldInitializer BaseFieldInitializer MatchArm WhileExpression while LoopExpression loop ForExpression for MacroInvocation MacroDefinition macro_rules MacroRule EmptyStatement ModItem mod DeclarationList AttributeItem ForeignModItem extern StructItem struct TypeParamList ConstrainedTypeParameter TraitBounds HigherRankedTraitBound RemovedTraitBound OptionalTypeParameter ConstParameter WhereClause where LifetimeClause TypeBoundClause FieldDeclarationList FieldDeclaration OrderedFieldDeclarationList UnionItem union EnumItem enum EnumVariantList EnumVariant TypeItem type FunctionItem default fn ParamList Parameter SelfParameter VariadicParameter VariadicParameter ImplItem TraitItem trait AssociatedType LetDeclaration UseDeclaration use ScopedIdentifier UseAsClause ScopedIdentifier UseList ScopedUseList UseWildcard ExternCrateDeclaration StaticItem static ExpressionStatement ExpressionStatement GenericType FunctionType ForLifetimes ParamList VariadicParameter Parameter VariadicParameter Parameter ReferenceType PointerType TupleType UnitType ArrayType MacroInvocation EmptyType DynamicType dyn BoundedType",maxTerm:359,nodeProps:[["isolate",-4,4,6,7,33,""],["group",-42,4,5,14,15,16,17,18,19,33,35,36,37,40,51,53,56,101,107,111,112,113,122,123,125,127,128,130,132,133,134,137,139,140,141,142,143,144,148,149,155,157,159,"Expression",-16,22,24,25,26,27,222,223,230,231,232,233,234,235,236,237,239,"Type",-20,42,161,162,165,166,169,170,172,188,190,194,196,204,205,207,208,209,217,218,220,"Statement",-17,49,60,62,63,64,65,68,74,75,76,77,78,80,81,83,84,99,"Pattern"],["openedBy",9,"[",38,"{",47,"("],["closedBy",12,"]",39,"}",45,")"]],propSources:[r],skippedNodes:[0,6,7,240],repeatNodeCount:32,tokenData:"$%h_R!XOX$nXY5gYZ6iZ]$n]^5g^p$npq5gqr7Xrs9cst:Rtu;Tuv>vvwAQwxCbxy!+Tyz!,Vz{!-X{|!/_|}!0g}!O!1i!O!P!3v!P!Q!8[!Q!R!Bw!R![!Dr![!]#+q!]!^#-{!^!_#.}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'S;=`4s<%lO$n_$#m]'|X'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_$$o]vX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n",tokenizers:[a,S,n,0,1,2,3],topRules:{SourceFile:[0,8]},specialized:[{term:281,get:O=>s[O]||-1}],tokenPrec:15596});var W=P(9587);const Y=W.bj.define({name:"rust",parser:t.configure({props:[W.Oh.add({IfExpression:(0,W.mz)({except:/^\s*({|else\b)/}),"String BlockComment":()=>null,AttributeItem:O=>O.continue(),"Statement MatchArm":(0,W.mz)()}),W.b_.add((O=>/(Block|edTokens|List)$/.test(O.name)?W.yd:"BlockComment"==O.name?O=>({from:O.from+2,to:O.to-2}):void 0))]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:\{|\})$/,closeBrackets:{stringPrefixes:["b","r","br"]}}});function _(){return new W.Yy(Y)}}}]); +//# sourceMappingURL=142.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/142.index.js.map b/pr-preview/pr-770/142.index.js.map new file mode 100644 index 00000000..9af5d540 --- /dev/null +++ b/pr-preview/pr-770/142.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"142.index.js","mappings":"kKAaA,SAASA,EAAMC,GAAM,OAAOA,GAAM,IAAMA,GAAM,EAAG,CACjD,SAASC,EAAOD,GAAM,OAAOD,EAAMC,IAAa,IAANA,CAAS,CAEnD,MAAME,EAAgB,IAAI,MAAkB,CAACC,EAAOC,KAClD,GAAIL,EAAMI,EAAME,MAAO,CACrB,IAAIC,GAAU,EACd,GAAKH,EAAMI,gBAAoBN,EAAOE,EAAME,OAC5C,GATQ,IASJF,EAAME,KAGR,GAFAC,GAAU,EACVH,EAAMI,UACFR,EAAMI,EAAME,MACd,GAAKF,EAAMI,gBAAoBN,E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G,GAAG,GAAG,GAAG,GAAG,WAC7Y,CAAC,WAAY,EAAE,IAAI,GAAG,IAAI,GAAG,KAC7B,CAAC,WAAY,GAAG,IAAI,GAAG,IAAI,GAAG,MAEhCC,YAAa,CAAC5G,GACd6G,aAAc,CAAC,EAAE,EAAE,EAAE,KACrBC,gBAAiB,GACjBC,UAAW,knXACXC,WAAY,CAAClH,EAAcC,EAASlB,EAAe,EAAG,EAAG,EAAG,GAC5DoI,SAAU,CAAC,WAAa,CAAC,EAAE,IAC3BC,YAAa,CAAC,CAACC,KAAM,IAAKC,IAAMC,GAAU5D,EAAgB4D,KAAW,IACrEC,UAAW,Q,cC3Ib,MAAMC,EAA4B,KAAWC,OAAO,CAChDC,KAAM,OACNtB,OAAqBA,EAAOuB,UAAU,CAClCC,MAAO,CACU,KAAeC,IAAI,CAC5BC,cAA2B,QAAgB,CAAEC,OAAQ,mBACrD,sBAAuB,IAAM,KAC7B,cAAiBC,GAAMA,EAAG9C,WAC1B,sBAAmC,YAE1B,KAAa2C,KAAIhC,GACtB,yBAAyBzG,KAAKyG,EAAK6B,MAC5B,KACM,gBAAb7B,EAAK6B,KACEO,IAAQ,CAAGC,KAAMD,EAAKC,KAAO,EAAGC,GAAIF,EAAKE,GAAK,SADzD,OAMZC,aAAc,CACVC,cAAe,CAAEC,KAAM,KAAMC,MAAO,CAAEC,KAAM,KAAMC,MAAO,OACzDC,cAAe,iBACfC,cAAe,CAAEC,eAAgB,CAAC,IAAK,IAAK,UAMpD,SAASC,IACL,OAAO,IAAI,KAAgBrB,EAC/B,C","sources":["webpack://thebe/../../node_modules/@lezer/rust/dist/index.js","webpack://thebe/../../node_modules/@codemirror/lang-rust/dist/index.js"],"sourcesContent":["import { ExternalTokenizer, LRParser } from '@lezer/lr';\nimport { styleTags, tags } from '@lezer/highlight';\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst closureParamDelim = 1,\n tpOpen = 2,\n tpClose = 3,\n RawString = 4,\n Float = 5;\n\nconst _b = 98, _e = 101, _f = 102, _r = 114, _E = 69, Zero = 48,\n Dot = 46, Plus = 43, Minus = 45, Hash = 35, Quote = 34, Pipe = 124, LessThan = 60, GreaterThan = 62;\n\nfunction isNum(ch) { return ch >= 48 && ch <= 57 }\nfunction isNum_(ch) { return isNum(ch) || ch == 95 }\n\nconst literalTokens = new ExternalTokenizer((input, stack) => {\n if (isNum(input.next)) {\n let isFloat = false;\n do { input.advance(); } while (isNum_(input.next))\n if (input.next == Dot) {\n isFloat = true;\n input.advance();\n if (isNum(input.next)) {\n do { input.advance(); } while (isNum_(input.next))\n } else if (input.next == Dot || input.next > 0x7f || /\\w/.test(String.fromCharCode(input.next))) {\n return\n }\n }\n if (input.next == _e || input.next == _E) {\n isFloat = true;\n input.advance();\n if (input.next == Plus || input.next == Minus) input.advance();\n if (!isNum_(input.next)) return\n do { input.advance(); } while (isNum_(input.next))\n }\n if (input.next == _f) {\n let after = input.peek(1);\n if (after == Zero + 3 && input.peek(2) == Zero + 2 ||\n after == Zero + 6 && input.peek(2) == Zero + 4) {\n input.advance(3);\n isFloat = true;\n } else {\n return\n }\n }\n if (isFloat) input.acceptToken(Float);\n } else if (input.next == _b || input.next == _r) {\n if (input.next == _b) input.advance();\n if (input.next != _r) return\n input.advance();\n let count = 0;\n while (input.next == Hash) { count++; input.advance(); }\n if (input.next != Quote) return\n input.advance();\n content: for (;;) {\n if (input.next < 0) return\n let isQuote = input.next == Quote;\n input.advance();\n if (isQuote) {\n for (let i = 0; i < count; i++) {\n if (input.next != Hash) continue content\n input.advance();\n }\n input.acceptToken(RawString);\n return\n }\n }\n }\n});\n\nconst closureParam = new ExternalTokenizer(input => {\n if (input.next == Pipe) input.acceptToken(closureParamDelim, 1);\n});\n\nconst tpDelim = new ExternalTokenizer(input => {\n if (input.next == LessThan) input.acceptToken(tpOpen, 1);\n else if (input.next == GreaterThan) input.acceptToken(tpClose, 1);\n});\n\nconst rustHighlighting = styleTags({\n \"const macro_rules struct union enum type fn impl trait let static\": tags.definitionKeyword,\n \"mod use crate\": tags.moduleKeyword,\n \"pub unsafe async mut extern default move\": tags.modifier,\n \"for if else loop while match continue break return await\": tags.controlKeyword,\n \"as in ref\": tags.operatorKeyword,\n \"where _ crate super dyn\": tags.keyword,\n \"self\": tags.self,\n String: tags.string,\n Char: tags.character,\n RawString: tags.special(tags.string),\n Boolean: tags.bool,\n Identifier: tags.variableName,\n \"CallExpression/Identifier\": tags.function(tags.variableName),\n BoundIdentifier: tags.definition(tags.variableName),\n \"FunctionItem/BoundIdentifier\": tags.function(tags.definition(tags.variableName)),\n LoopLabel: tags.labelName,\n FieldIdentifier: tags.propertyName,\n \"CallExpression/FieldExpression/FieldIdentifier\": tags.function(tags.propertyName),\n Lifetime: tags.special(tags.variableName),\n ScopeIdentifier: tags.namespace,\n TypeIdentifier: tags.typeName,\n \"MacroInvocation/Identifier MacroInvocation/ScopedIdentifier/Identifier\": tags.macroName,\n \"MacroInvocation/TypeIdentifier MacroInvocation/ScopedIdentifier/TypeIdentifier\": tags.macroName,\n \"\\\"!\\\"\": tags.macroName,\n UpdateOp: tags.updateOperator,\n LineComment: tags.lineComment,\n BlockComment: tags.blockComment,\n Integer: tags.integer,\n Float: tags.float,\n ArithOp: tags.arithmeticOperator,\n LogicOp: tags.logicOperator,\n BitOp: tags.bitwiseOperator,\n CompareOp: tags.compareOperator,\n \"=\": tags.definitionOperator,\n \".. ... => ->\": tags.punctuation,\n \"( )\": tags.paren,\n \"[ ]\": tags.squareBracket,\n \"{ }\": tags.brace,\n \". DerefOp\": tags.derefOperator,\n \"&\": tags.operator,\n \", ; ::\": tags.separator,\n \"Attribute/...\": tags.meta,\n});\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst spec_identifier = {__proto__:null,self:28, super:32, crate:34, impl:46, true:72, false:72, pub:88, in:92, const:96, unsafe:104, async:108, move:110, if:114, let:118, ref:142, mut:144, _:198, else:200, match:204, as:248, return:252, await:262, break:270, continue:276, while:312, loop:316, for:320, macro_rules:327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.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gR${xR0b+UR0W*xR0U*xR6{4PR/y*vR/x*vR0P*wR0O*wR0_+QR0^+Q%XyObxz!O!P!Q!T!n$O$u$y$|%_%b%f%n%o%p%q%y%{&P&o&p&r'](q)S)U)i)s)v)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-t-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gR0k+ZR0j+ZQ'R!qQ)c%XQ+w&|R4y1PX'Q!q%X&|1PR+y&|R+x&|T/S*S4TT/R*S4TR.o)sR.n)sR){%p\",\n nodeNames: \"⚠ | < > RawString Float LineComment BlockComment SourceFile ] InnerAttribute ! [ MetaItem self Metavariable super crate Identifier ScopedIdentifier :: QualifiedScope AbstractType impl SelfType MetaType TypeIdentifier ScopedTypeIdentifier ScopeIdentifier TypeArgList TypeBinding = Lifetime String Escape Char Boolean Integer } { Block ; ConstItem Vis pub ( in ) const BoundIdentifier : UnsafeBlock unsafe AsyncBlock async move IfExpression if LetDeclaration let LiteralPattern ArithOp MetaPattern SelfPattern ScopedIdentifier TuplePattern ScopedTypeIdentifier , StructPattern FieldPatternList FieldPattern ref mut FieldIdentifier .. RefPattern SlicePattern CapturedPattern ReferencePattern & MutPattern RangePattern ... OrPattern MacroPattern ParenthesizedTokens TokenBinding Identifier TokenRepetition ArithOp BitOp LogicOp UpdateOp CompareOp -> => ArithOp BracketedTokens BracedTokens _ else MatchExpression match MatchBlock MatchArm Attribute Guard UnaryExpression ArithOp DerefOp LogicOp ReferenceExpression TryExpression BinaryExpression ArithOp ArithOp BitOp BitOp BitOp BitOp LogicOp LogicOp AssignmentExpression TypeCastExpression as ReturnExpression return RangeExpression CallExpression ArgList AwaitExpression await FieldExpression GenericFunction BreakExpression break LoopLabel ContinueExpression continue IndexExpression ArrayExpression TupleExpression MacroInvocation UnitExpression ClosureExpression ParamList Parameter Parameter ParenthesizedExpression StructExpression FieldInitializerList ShorthandFieldInitializer FieldInitializer BaseFieldInitializer MatchArm WhileExpression while LoopExpression loop ForExpression for MacroInvocation MacroDefinition macro_rules MacroRule EmptyStatement ModItem mod DeclarationList AttributeItem ForeignModItem extern StructItem struct TypeParamList ConstrainedTypeParameter TraitBounds HigherRankedTraitBound RemovedTraitBound OptionalTypeParameter ConstParameter WhereClause where LifetimeClause TypeBoundClause FieldDeclarationList FieldDeclaration OrderedFieldDeclarationList UnionItem union EnumItem enum EnumVariantList EnumVariant TypeItem type FunctionItem default fn ParamList Parameter SelfParameter VariadicParameter VariadicParameter ImplItem TraitItem trait AssociatedType LetDeclaration UseDeclaration use ScopedIdentifier UseAsClause ScopedIdentifier UseList ScopedUseList UseWildcard ExternCrateDeclaration StaticItem static ExpressionStatement ExpressionStatement GenericType FunctionType ForLifetimes ParamList VariadicParameter Parameter VariadicParameter Parameter ReferenceType PointerType TupleType UnitType ArrayType MacroInvocation EmptyType DynamicType dyn BoundedType\",\n maxTerm: 359,\n nodeProps: [\n [\"isolate\", -4,4,6,7,33,\"\"],\n [\"group\", -42,4,5,14,15,16,17,18,19,33,35,36,37,40,51,53,56,101,107,111,112,113,122,123,125,127,128,130,132,133,134,137,139,140,141,142,143,144,148,149,155,157,159,\"Expression\",-16,22,24,25,26,27,222,223,230,231,232,233,234,235,236,237,239,\"Type\",-20,42,161,162,165,166,169,170,172,188,190,194,196,204,205,207,208,209,217,218,220,\"Statement\",-17,49,60,62,63,64,65,68,74,75,76,77,78,80,81,83,84,99,\"Pattern\"],\n [\"openedBy\", 9,\"[\",38,\"{\",47,\"(\"],\n [\"closedBy\", 12,\"]\",39,\"}\",45,\")\"]\n ],\n propSources: [rustHighlighting],\n skippedNodes: [0,6,7,240],\n repeatNodeCount: 32,\n tokenData: \"$%h_R!XOX$nXY5gYZ6iZ]$n]^5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P&[#P;'S$n;'S;=`4s<%lO$n_$!_a'rX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q!_$n!_!`@O!`#O$n#O#P&[#P#p$n#p#q$#d#q;'S$n;'S;=`4s<%lO$n_$#m]'|X'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_$$o]vX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n\",\n tokenizers: [closureParam, tpDelim, literalTokens, 0, 1, 2, 3],\n topRules: {\"SourceFile\":[0,8]},\n specialized: [{term: 281, get: (value) => spec_identifier[value] || -1}],\n tokenPrec: 15596\n});\n\nexport { parser };\n","import { parser } from '@lezer/rust';\nimport { LRLanguage, indentNodeProp, continuedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language';\n\n/**\nA syntax provider based on the [Lezer Rust\nparser](https://github.com/lezer-parser/rust), extended with\nhighlighting and indentation information.\n*/\nconst rustLanguage = /*@__PURE__*/LRLanguage.define({\n name: \"rust\",\n parser: /*@__PURE__*/parser.configure({\n props: [\n /*@__PURE__*/indentNodeProp.add({\n IfExpression: /*@__PURE__*/continuedIndent({ except: /^\\s*({|else\\b)/ }),\n \"String BlockComment\": () => null,\n \"AttributeItem\": cx => cx.continue(),\n \"Statement MatchArm\": /*@__PURE__*/continuedIndent()\n }),\n /*@__PURE__*/foldNodeProp.add(type => {\n if (/(Block|edTokens|List)$/.test(type.name))\n return foldInside;\n if (type.name == \"BlockComment\")\n return tree => ({ from: tree.from + 2, to: tree.to - 2 });\n return undefined;\n })\n ]\n }),\n languageData: {\n commentTokens: { line: \"//\", block: { open: \"/*\", close: \"*/\" } },\n indentOnInput: /^\\s*(?:\\{|\\})$/,\n closeBrackets: { stringPrefixes: [\"b\", \"r\", \"br\"] }\n }\n});\n/**\nRust language support\n*/\nfunction rust() {\n return new LanguageSupport(rustLanguage);\n}\n\nexport { rust, rustLanguage };\n"],"names":["isNum","ch","isNum_","literalTokens","input","stack","next","isFloat","advance","test","String","fromCharCode","after","peek","Zero","acceptToken","count","content","isQuote","i","closureParam","tpDelim","rustHighlighting","definitionKeyword","moduleKeyword","modifier","controlKeyword","operatorKeyword","keyword","self","string","Char","character","RawString","special","Boolean","bool","Identifier","variableName","function","BoundIdentifier","definition","LoopLabel","labelName","FieldIdentifier","propertyName","Lifetime","ScopeIdentifier","namespace","TypeIdentifier","typeName","macroName","UpdateOp","updateOperator","LineComment","lineComment","BlockComment","blockComment","Integer","integer","Float","float","ArithOp","arithmeticOperator","LogicOp","logicOperator","BitOp","bitwiseOperator","CompareOp","compareOperator","definitionOperator","punctuation","paren","squareBracket","brace","derefOperator","operator","separator","meta","spec_identifier","__proto__","super","crate","impl","true","false","pub","in","const","unsafe","async","move","if","let","ref","mut","_","else","match","as","return","await","break","continue","while","loop","for","macro_rules","mod","extern","struct","where","union","enum","type","default","fn","trait","use","static","dyn","parser","deserialize","version","states","stateData","goto","nodeNames","maxTerm","nodeProps","propSources","skippedNodes","repeatNodeCount","tokenData","tokenizers","topRules","specialized","term","get","value","tokenPrec","rustLanguage","define","name","configure","props","add","IfExpression","except","cx","tree","from","to","languageData","commentTokens","line","block","open","close","indentOnInput","closeBrackets","stringPrefixes","rust"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/1524.index.js b/pr-preview/pr-770/1524.index.js new file mode 100644 index 00000000..3d953681 --- /dev/null +++ b/pr-preview/pr-770/1524.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[1524],{1524:(e,a,t)=>{t.r(a),t.d(a,{mathematica:()=>i});var n="[a-zA-Z\\$][a-zA-Z0-9\\$]*",c="(?:\\.\\d+|\\d+\\.\\d*|\\d+)",m="(?:`(?:`?"+c+")?)",o=new RegExp("(?:(?:\\d+)(?:\\^\\^(?:\\.\\w+|\\w+\\.\\w*|\\w+)"+m+"?(?:\\*\\^[+-]?\\d+)?))"),r=new RegExp("(?:"+c+m+"?(?:\\*\\^[+-]?\\d+)?)"),z=new RegExp("(?:`?)(?:"+n+")(?:`(?:"+n+"))*(?:`?)");function A(e,a){var t;return'"'===(t=e.next())?(a.tokenize=Z,a.tokenize(e,a)):"("===t&&e.eat("*")?(a.commentLevel++,a.tokenize=$,a.tokenize(e,a)):(e.backUp(1),e.match(o,!0,!1)||e.match(r,!0,!1)?"number":e.match(/(?:In|Out)\[[0-9]*\]/,!0,!1)?"atom":e.match(/([a-zA-Z\$][a-zA-Z0-9\$]*(?:`[a-zA-Z0-9\$]+)*::usage)/,!0,!1)?"meta":e.match(/([a-zA-Z\$][a-zA-Z0-9\$]*(?:`[a-zA-Z0-9\$]+)*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/,!0,!1)?"string.special":e.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/,!0,!1)||e.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)||e.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/,!0,!1)||e.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)?"variableName.special":e.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/,!0,!1)?"character":e.match(/(?:\[|\]|{|}|\(|\))/,!0,!1)?"bracket":e.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/,!0,!1)?"variableName.constant":e.match(z,!0,!1)?"keyword":e.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/,!0,!1)?"operator":(e.next(),"error"))}function Z(e,a){for(var t,n=!1,c=!1;null!=(t=e.next());){if('"'===t&&!c){n=!0;break}c=!c&&"\\"===t}return n&&!c&&(a.tokenize=A),"string"}function $(e,a){for(var t,n;a.commentLevel>0&&null!=(n=e.next());)"("===t&&"*"===n&&a.commentLevel++,"*"===t&&")"===n&&a.commentLevel--,t=n;return a.commentLevel<=0&&(a.tokenize=A),"comment"}const i={name:"mathematica",startState:function(){return{tokenize:A,commentLevel:0}},token:function(e,a){return e.eatSpace()?null:a.tokenize(e,a)},languageData:{commentTokens:{block:{open:"(*",close:"*)"}}}}}}]); +//# sourceMappingURL=1524.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/1524.index.js.map b/pr-preview/pr-770/1524.index.js.map new file mode 100644 index 00000000..eecdd2fe --- /dev/null +++ b/pr-preview/pr-770/1524.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"1524.index.js","mappings":"gIACA,IAAIA,EAAa,6BAEbC,EAAa,+BAEbC,EAAa,YAAYD,EAAO,MAGhCE,EAAoB,IAAIC,OAAO,mDAAmCF,EAAW,2BAC7EG,EAAoB,IAAID,OAAO,MAAQH,EAASC,EAAa,0BAC7DI,EAAoB,IAAIF,OAAO,YAAcJ,EAAa,WAAaA,EAAa,aAExF,SAASO,EAAUC,EAAQC,GACzB,IAAIC,EAMJ,MAAW,OAHXA,EAAKF,EAAOG,SAIVF,EAAMG,SAAWC,EACVJ,EAAMG,SAASJ,EAAQC,IAIrB,MAAPC,GACEF,EAAOM,IAAI,MACbL,EAAMM,eACNN,EAAMG,SAAWI,EACVP,EAAMG,SAASJ,EAAQC,KAKlCD,EAAOS,OAAO,GAIVT,EAAOU,MAAMf,GAAY,GAAM,IAM/BK,EAAOU,MAAMb,GAAa,GAAM,GAL3B,SAULG,EAAOU,MAAM,wBAAwB,GAAM,GACtC,OAILV,EAAOU,MAAM,yDAAyD,GAAM,GACvE,OAILV,EAAOU,MAAM,8EAA8E,GAAM,GAC5F,iBAKLV,EAAOU,MAAM,mGAAmG,GAAM,IAOtHV,EAAOU,MAAM,sDAAsD,GAAM,IAGzEV,EAAOU,MAAM,8BAA8B,GAAM,IAGjDV,EAAOU,MAAM,8BAA8B,GAAM,GAZ5C,uBAiBLV,EAAOU,MAAM,kCAAkC,GAAM,GAChD,YAILV,EAAOU,MAAM,uBAAuB,GAAM,GACrC,UAKLV,EAAOU,MAAM,0CAA0C,GAAM,GACxD,wBAILV,EAAOU,MAAMZ,GAAe,GAAM,GAC7B,UAILE,EAAOU,MAAM,8DAA8D,GAAM,GAC5E,YAITV,EAAOG,OACA,SACT,CAEA,SAASE,EAAYL,EAAQC,GAE3B,IADA,IAAIE,EAAMQ,GAAM,EAAOC,GAAU,EACA,OAAzBT,EAAOH,EAAOG,SAAiB,CACrC,GAAa,MAATA,IAAiBS,EAAS,CAC5BD,GAAM,EACN,KACF,CACAC,GAAWA,GAAoB,OAATT,CACxB,CAIA,OAHIQ,IAAQC,IACVX,EAAMG,SAAWL,GAEZ,QACT,CAEA,SAASS,EAAaR,EAAQC,GAE5B,IADA,IAAIY,EAAMV,EACJF,EAAMM,aAAe,GAA+B,OAAzBJ,EAAOH,EAAOG,SAChC,MAATU,GAAyB,MAATV,GAAcF,EAAMM,eAC3B,MAATM,GAAyB,MAATV,GAAcF,EAAMM,eACxCM,EAAOV,EAKT,OAHIF,EAAMM,cAAgB,IACxBN,EAAMG,SAAWL,GAEZ,SACT,CAEO,MAAMe,EAAc,CACzBC,KAAM,cACNC,WAAY,WAAY,MAAO,CAACZ,SAAUL,EAAWQ,aAAc,EAAG,EACtEU,MAAO,SAASjB,EAAQC,GACtB,OAAID,EAAOkB,WAAmB,KACvBjB,EAAMG,SAASJ,EAAQC,EAChC,EACAkB,aAAc,CACZC,cAAe,CAACC,MAAO,CAACC,KAAM,KAAMC,MAAO,Q","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/mathematica.js"],"sourcesContent":["// used pattern building blocks\nvar Identifier = '[a-zA-Z\\\\$][a-zA-Z0-9\\\\$]*';\nvar pBase = \"(?:\\\\d+)\";\nvar pFloat = \"(?:\\\\.\\\\d+|\\\\d+\\\\.\\\\d*|\\\\d+)\";\nvar pFloatBase = \"(?:\\\\.\\\\w+|\\\\w+\\\\.\\\\w*|\\\\w+)\";\nvar pPrecision = \"(?:`(?:`?\"+pFloat+\")?)\";\n\n// regular expressions\nvar reBaseForm = new RegExp('(?:'+pBase+'(?:\\\\^\\\\^'+pFloatBase+pPrecision+'?(?:\\\\*\\\\^[+-]?\\\\d+)?))');\nvar reFloatForm = new RegExp('(?:' + pFloat + pPrecision + '?(?:\\\\*\\\\^[+-]?\\\\d+)?)');\nvar reIdInContext = new RegExp('(?:`?)(?:' + Identifier + ')(?:`(?:' + Identifier + '))*(?:`?)');\n\nfunction tokenBase(stream, state) {\n var ch;\n\n // get next character\n ch = stream.next();\n\n // string\n if (ch === '\"') {\n state.tokenize = tokenString;\n return state.tokenize(stream, state);\n }\n\n // comment\n if (ch === '(') {\n if (stream.eat('*')) {\n state.commentLevel++;\n state.tokenize = tokenComment;\n return state.tokenize(stream, state);\n }\n }\n\n // go back one character\n stream.backUp(1);\n\n // look for numbers\n // Numbers in a baseform\n if (stream.match(reBaseForm, true, false)) {\n return 'number';\n }\n\n // Mathematica numbers. Floats (1.2, .2, 1.) can have optionally a precision (`float) or an accuracy definition\n // (``float). Note: while 1.2` is possible 1.2`` is not. At the end an exponent (float*^+12) can follow.\n if (stream.match(reFloatForm, true, false)) {\n return 'number';\n }\n\n /* In[23] and Out[34] */\n if (stream.match(/(?:In|Out)\\[[0-9]*\\]/, true, false)) {\n return 'atom';\n }\n\n // usage\n if (stream.match(/([a-zA-Z\\$][a-zA-Z0-9\\$]*(?:`[a-zA-Z0-9\\$]+)*::usage)/, true, false)) {\n return 'meta';\n }\n\n // message\n if (stream.match(/([a-zA-Z\\$][a-zA-Z0-9\\$]*(?:`[a-zA-Z0-9\\$]+)*::[a-zA-Z\\$][a-zA-Z0-9\\$]*):?/, true, false)) {\n return 'string.special';\n }\n\n // this makes a look-ahead match for something like variable:{_Integer}\n // the match is then forwarded to the mma-patterns tokenizer.\n if (stream.match(/([a-zA-Z\\$][a-zA-Z0-9\\$]*\\s*:)(?:(?:[a-zA-Z\\$][a-zA-Z0-9\\$]*)|(?:[^:=>~@\\^\\&\\*\\)\\[\\]'\\?,\\|])).*/, true, false)) {\n return 'variableName.special';\n }\n\n // catch variables which are used together with Blank (_), BlankSequence (__) or BlankNullSequence (___)\n // Cannot start with a number, but can have numbers at any other position. Examples\n // blub__Integer, a1_, b34_Integer32\n if (stream.match(/[a-zA-Z\\$][a-zA-Z0-9\\$]*_+[a-zA-Z\\$][a-zA-Z0-9\\$]*/, true, false)) {\n return 'variableName.special';\n }\n if (stream.match(/[a-zA-Z\\$][a-zA-Z0-9\\$]*_+/, true, false)) {\n return 'variableName.special';\n }\n if (stream.match(/_+[a-zA-Z\\$][a-zA-Z0-9\\$]*/, true, false)) {\n return 'variableName.special';\n }\n\n // Named characters in Mathematica, like \\[Gamma].\n if (stream.match(/\\\\\\[[a-zA-Z\\$][a-zA-Z0-9\\$]*\\]/, true, false)) {\n return 'character';\n }\n\n // Match all braces separately\n if (stream.match(/(?:\\[|\\]|{|}|\\(|\\))/, true, false)) {\n return 'bracket';\n }\n\n // Catch Slots (#, ##, #3, ##9 and the V10 named slots #name). I have never seen someone using more than one digit after #, so we match\n // only one.\n if (stream.match(/(?:#[a-zA-Z\\$][a-zA-Z0-9\\$]*|#+[0-9]?)/, true, false)) {\n return 'variableName.constant';\n }\n\n // Literals like variables, keywords, functions\n if (stream.match(reIdInContext, true, false)) {\n return 'keyword';\n }\n\n // operators. Note that operators like @@ or /; are matched separately for each symbol.\n if (stream.match(/(?:\\\\|\\+|\\-|\\*|\\/|,|;|\\.|:|@|~|=|>|<|&|\\||_|`|'|\\^|\\?|!|%)/, true, false)) {\n return 'operator';\n }\n\n // everything else is an error\n stream.next(); // advance the stream.\n return 'error';\n}\n\nfunction tokenString(stream, state) {\n var next, end = false, escaped = false;\n while ((next = stream.next()) != null) {\n if (next === '\"' && !escaped) {\n end = true;\n break;\n }\n escaped = !escaped && next === '\\\\';\n }\n if (end && !escaped) {\n state.tokenize = tokenBase;\n }\n return 'string';\n};\n\nfunction tokenComment(stream, state) {\n var prev, next;\n while(state.commentLevel > 0 && (next = stream.next()) != null) {\n if (prev === '(' && next === '*') state.commentLevel++;\n if (prev === '*' && next === ')') state.commentLevel--;\n prev = next;\n }\n if (state.commentLevel <= 0) {\n state.tokenize = tokenBase;\n }\n return 'comment';\n}\n\nexport const mathematica = {\n name: \"mathematica\",\n startState: function() {return {tokenize: tokenBase, commentLevel: 0};},\n token: function(stream, state) {\n if (stream.eatSpace()) return null;\n return state.tokenize(stream, state);\n },\n languageData: {\n commentTokens: {block: {open: \"(*\", close: \"*)\"}}\n }\n}\n\n"],"names":["Identifier","pFloat","pPrecision","reBaseForm","RegExp","reFloatForm","reIdInContext","tokenBase","stream","state","ch","next","tokenize","tokenString","eat","commentLevel","tokenComment","backUp","match","end","escaped","prev","mathematica","name","startState","token","eatSpace","languageData","commentTokens","block","open","close"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/1553.index.js b/pr-preview/pr-770/1553.index.js new file mode 100644 index 00000000..b0a3298c --- /dev/null +++ b/pr-preview/pr-770/1553.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[1553],{1553:(e,t,n)=>{n.r(t),n.d(t,{sas:()=>l});var r={},s={eq:"operator",lt:"operator",le:"operator",gt:"operator",ge:"operator",in:"operator",ne:"operator",or:"operator"},a=/(<=|>=|!=|<>)/,o=/[=\(:\),{}.*<>+\-\/^\[\]]/;function i(e,t,n){if(n)for(var s=t.split(" "),a=0;a=|!=|<>)/;\nvar isSingleOperatorChar = /[=\\(:\\),{}.*<>+\\-\\/^\\[\\]]/;\n\n// Takes a string of words separated by spaces and adds them as\n// keys with the value of the first argument 'style'\nfunction define(style, string, context) {\n if (context) {\n var split = string.split(' ');\n for (var i = 0; i < split.length; i++) {\n words[split[i]] = {style: style, state: context};\n }\n }\n}\n//datastep\ndefine('def', 'stack pgm view source debug nesting nolist', ['inDataStep']);\ndefine('def', 'if while until for do do; end end; then else cancel', ['inDataStep']);\ndefine('def', 'label format _n_ _error_', ['inDataStep']);\ndefine('def', 'ALTER BUFNO BUFSIZE CNTLLEV COMPRESS DLDMGACTION ENCRYPT ENCRYPTKEY EXTENDOBSCOUNTER GENMAX GENNUM INDEX LABEL OBSBUF OUTREP PW PWREQ READ REPEMPTY REPLACE REUSE ROLE SORTEDBY SPILL TOBSNO TYPE WRITE FILECLOSE FIRSTOBS IN OBS POINTOBS WHERE WHEREUP IDXNAME IDXWHERE DROP KEEP RENAME', ['inDataStep']);\ndefine('def', 'filevar finfo finv fipname fipnamel fipstate first firstobs floor', ['inDataStep']);\ndefine('def', 'varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vnferr vtype vtypex weekday', ['inDataStep']);\ndefine('def', 'zipfips zipname zipnamel zipstate', ['inDataStep']);\ndefine('def', 'put putc putn', ['inDataStep']);\ndefine('builtin', 'data run', ['inDataStep']);\n\n\n//proc\ndefine('def', 'data', ['inProc']);\n\n// flow control for macros\ndefine('def', '%if %end %end; %else %else; %do %do; %then', ['inMacro']);\n\n//everywhere\ndefine('builtin', 'proc run; quit; libname filename %macro %mend option options', ['ALL']);\n\ndefine('def', 'footnote title libname ods', ['ALL']);\ndefine('def', '%let %put %global %sysfunc %eval ', ['ALL']);\n// automatic macro variables http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a003167023.htm\ndefine('variable', '&sysbuffr &syscc &syscharwidth &syscmd &sysdate &sysdate9 &sysday &sysdevic &sysdmg &sysdsn &sysencoding &sysenv &syserr &syserrortext &sysfilrc &syshostname &sysindex &sysinfo &sysjobid &syslast &syslckrc &syslibrc &syslogapplname &sysmacroname &sysmenv &sysmsg &sysncpu &sysodspath &sysparm &syspbuff &sysprocessid &sysprocessname &sysprocname &sysrc &sysscp &sysscpl &sysscpl &syssite &sysstartid &sysstartname &systcpiphostname &systime &sysuserid &sysver &sysvlong &sysvlong4 &syswarningtext', ['ALL']);\n\n//footnote[1-9]? title[1-9]?\n\n//options statement\ndefine('def', 'source2 nosource2 page pageno pagesize', ['ALL']);\n\n//proc and datastep\ndefine('def', '_all_ _character_ _cmd_ _freq_ _i_ _infile_ _last_ _msg_ _null_ _numeric_ _temporary_ _type_ abort abs addr adjrsq airy alpha alter altlog altprint and arcos array arsin as atan attrc attrib attrn authserver autoexec awscontrol awsdef awsmenu awsmenumerge awstitle backward band base betainv between blocksize blshift bnot bor brshift bufno bufsize bxor by byerr byline byte calculated call cards cards4 catcache cbufno cdf ceil center cexist change chisq cinv class cleanup close cnonct cntllev coalesce codegen col collate collin column comamid comaux1 comaux2 comdef compbl compound compress config continue convert cos cosh cpuid create cross crosstab css curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datalines datalines4 datejul datepart datetime day dbcslang dbcstype dclose ddfm ddm delete delimiter depdb depdbsl depsl depsyd deptab dequote descending descript design= device dflang dhms dif digamma dim dinfo display distinct dkricond dkrocond dlm dnum do dopen doptname doptnum dread drop dropnote dsname dsnferr echo else emaildlg emailid emailpw emailserver emailsys encrypt end endsas engine eof eov erf erfc error errorcheck errors exist exp fappend fclose fcol fdelete feedback fetch fetchobs fexist fget file fileclose fileexist filefmt filename fileref fmterr fmtsearch fnonct fnote font fontalias fopen foptname foptnum force formatted formchar formdelim formdlim forward fpoint fpos fput fread frewind frlen from fsep fuzz fwrite gaminv gamma getoption getvarc getvarn go goto group gwindow hbar hbound helpenv helploc hms honorappearance hosthelp hostprint hour hpct html hvar ibessel ibr id if index indexc indexw initcmd initstmt inner input inputc inputn inr insert int intck intnx into intrr invaliddata irr is jbessel join juldate keep kentb kurtosis label lag last lbound leave left length levels lgamma lib library libref line linesize link list log log10 log2 logpdf logpmf logsdf lostcard lowcase lrecl ls macro macrogen maps mautosource max maxdec maxr mdy mean measures median memtype merge merror min minute missing missover mlogic mod mode model modify month mopen mort mprint mrecall msglevel msymtabmax mvarsize myy n nest netpv new news nmiss no nobatch nobs nocaps nocardimage nocenter nocharcode nocmdmac nocol nocum nodate nodbcs nodetails nodmr nodms nodmsbatch nodup nodupkey noduplicates noechoauto noequals noerrorabend noexitwindows nofullstimer noicon noimplmac noint nolist noloadlist nomiss nomlogic nomprint nomrecall nomsgcase nomstored nomultenvappl nonotes nonumber noobs noovp nopad nopercent noprint noprintinit normal norow norsasuser nosetinit nosplash nosymbolgen note notes notitle notitles notsorted noverbose noxsync noxwait npv null number numkeys nummousekeys nway obs on open order ordinal otherwise out outer outp= output over ovp p(1 5 10 25 50 75 90 95 99) pad pad2 paired parm parmcards path pathdll pathname pdf peek peekc pfkey pmf point poisson poke position printer probbeta probbnml probchi probf probgam probhypr probit probnegb probnorm probsig probt procleave prt ps pw pwreq qtr quote r ranbin rancau random ranexp rangam range ranks rannor ranpoi rantbl rantri ranuni rcorr read recfm register regr remote remove rename repeat repeated replace resolve retain return reuse reverse rewind right round rsquare rtf rtrace rtraceloc s s2 samploc sasautos sascontrol sasfrscr sasmsg sasmstore sasscript sasuser saving scan sdf second select selection separated seq serror set setcomm setot sign simple sin sinh siteinfo skewness skip sle sls sortedby sortpgm sortseq sortsize soundex spedis splashlocation split spool sqrt start std stderr stdin stfips stimer stname stnamel stop stopover sub subgroup subpopn substr sum sumwgt symbol symbolgen symget symput sysget sysin sysleave sysmsg sysparm sysprint sysprintfont sysprod sysrc system t table tables tan tanh tapeclose tbufsize terminal test then timepart tinv tnonct to today tol tooldef totper transformout translate trantab tranwrd trigamma trim trimn trunc truncover type unformatted uniform union until upcase update user usericon uss validate value var weight when where while wincharset window work workinit workterm write wsum xsync xwait yearcutoff yes yyq min max', ['inDataStep', 'inProc']);\ndefine('operator', 'and not ', ['inDataStep', 'inProc']);\n\n// Main function\nfunction tokenize(stream, state) {\n // Finally advance the stream\n var ch = stream.next();\n\n // BLOCKCOMMENT\n if (ch === '/' && stream.eat('*')) {\n state.continueComment = true;\n return \"comment\";\n } else if (state.continueComment === true) { // in comment block\n //comment ends at the beginning of the line\n if (ch === '*' && stream.peek() === '/') {\n stream.next();\n state.continueComment = false;\n } else if (stream.skipTo('*')) { //comment is potentially later in line\n stream.skipTo('*');\n stream.next();\n if (stream.eat('/'))\n state.continueComment = false;\n } else {\n stream.skipToEnd();\n }\n return \"comment\";\n }\n\n if (ch == \"*\" && stream.column() == stream.indentation()) {\n stream.skipToEnd()\n return \"comment\"\n }\n\n // DoubleOperator match\n var doubleOperator = ch + stream.peek();\n\n if ((ch === '\"' || ch === \"'\") && !state.continueString) {\n state.continueString = ch\n return \"string\"\n } else if (state.continueString) {\n if (state.continueString == ch) {\n state.continueString = null;\n } else if (stream.skipTo(state.continueString)) {\n // quote found on this line\n stream.next();\n state.continueString = null;\n } else {\n stream.skipToEnd();\n }\n return \"string\";\n } else if (state.continueString !== null && stream.eol()) {\n stream.skipTo(state.continueString) || stream.skipToEnd();\n return \"string\";\n } else if (/[\\d\\.]/.test(ch)) { //find numbers\n if (ch === \".\")\n stream.match(/^[0-9]+([eE][\\-+]?[0-9]+)?/);\n else if (ch === \"0\")\n stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);\n else\n stream.match(/^[0-9]*\\.?[0-9]*([eE][\\-+]?[0-9]+)?/);\n return \"number\";\n } else if (isDoubleOperatorChar.test(ch + stream.peek())) { // TWO SYMBOL TOKENS\n stream.next();\n return \"operator\";\n } else if (isDoubleOperatorSym.hasOwnProperty(doubleOperator)) {\n stream.next();\n if (stream.peek() === ' ')\n return isDoubleOperatorSym[doubleOperator.toLowerCase()];\n } else if (isSingleOperatorChar.test(ch)) { // SINGLE SYMBOL TOKENS\n return \"operator\";\n }\n\n // Matches one whole word -- even if the word is a character\n var word;\n if (stream.match(/[%&;\\w]+/, false) != null) {\n word = ch + stream.match(/[%&;\\w]+/, true);\n if (/&/.test(word)) return 'variable'\n } else {\n word = ch;\n }\n // the word after DATA PROC or MACRO\n if (state.nextword) {\n stream.match(/[\\w]+/);\n // match memname.libname\n if (stream.peek() === '.') stream.skipTo(' ');\n state.nextword = false;\n return 'variableName.special';\n }\n\n word = word.toLowerCase()\n // Are we in a DATA Step?\n if (state.inDataStep) {\n if (word === 'run;' || stream.match(/run\\s;/)) {\n state.inDataStep = false;\n return 'builtin';\n }\n // variable formats\n if ((word) && stream.next() === '.') {\n //either a format or libname.memname\n if (/\\w/.test(stream.peek())) return 'variableName.special';\n else return 'variable';\n }\n // do we have a DATA Step keyword\n if (word && words.hasOwnProperty(word) &&\n (words[word].state.indexOf(\"inDataStep\") !== -1 ||\n words[word].state.indexOf(\"ALL\") !== -1)) {\n //backup to the start of the word\n if (stream.start < stream.pos)\n stream.backUp(stream.pos - stream.start);\n //advance the length of the word and return\n for (var i = 0; i < word.length; ++i) stream.next();\n return words[word].style;\n }\n }\n // Are we in an Proc statement?\n if (state.inProc) {\n if (word === 'run;' || word === 'quit;') {\n state.inProc = false;\n return 'builtin';\n }\n // do we have a proc keyword\n if (word && words.hasOwnProperty(word) &&\n (words[word].state.indexOf(\"inProc\") !== -1 ||\n words[word].state.indexOf(\"ALL\") !== -1)) {\n stream.match(/[\\w]+/);\n return words[word].style;\n }\n }\n // Are we in a Macro statement?\n if (state.inMacro) {\n if (word === '%mend') {\n if (stream.peek() === ';') stream.next();\n state.inMacro = false;\n return 'builtin';\n }\n if (word && words.hasOwnProperty(word) &&\n (words[word].state.indexOf(\"inMacro\") !== -1 ||\n words[word].state.indexOf(\"ALL\") !== -1)) {\n stream.match(/[\\w]+/);\n return words[word].style;\n }\n\n return 'atom';\n }\n // Do we have Keywords specific words?\n if (word && words.hasOwnProperty(word)) {\n // Negates the initial next()\n stream.backUp(1);\n // Actually move the stream\n stream.match(/[\\w]+/);\n if (word === 'data' && /=/.test(stream.peek()) === false) {\n state.inDataStep = true;\n state.nextword = true;\n return 'builtin';\n }\n if (word === 'proc') {\n state.inProc = true;\n state.nextword = true;\n return 'builtin';\n }\n if (word === '%macro') {\n state.inMacro = true;\n state.nextword = true;\n return 'builtin';\n }\n if (/title[1-9]/.test(word)) return 'def';\n\n if (word === 'footnote') {\n stream.eat(/[1-9]/);\n return 'def';\n }\n\n // Returns their value as state in the prior define methods\n if (state.inDataStep === true && words[word].state.indexOf(\"inDataStep\") !== -1)\n return words[word].style;\n if (state.inProc === true && words[word].state.indexOf(\"inProc\") !== -1)\n return words[word].style;\n if (state.inMacro === true && words[word].state.indexOf(\"inMacro\") !== -1)\n return words[word].style;\n if (words[word].state.indexOf(\"ALL\") !== -1)\n return words[word].style;\n return null;\n }\n // Unrecognized syntax\n return null;\n}\n\nexport const sas = {\n name: \"sas\",\n startState: function () {\n return {\n inDataStep: false,\n inProc: false,\n inMacro: false,\n nextword: false,\n continueString: null,\n continueComment: false\n };\n },\n token: function (stream, state) {\n // Strip the spaces, but regex will account for them either way\n if (stream.eatSpace()) return null;\n // Go through the main process\n return tokenize(stream, state);\n },\n\n languageData: {\n commentTokens: {block: {open: \"/*\", close: \"*/\"}}\n }\n};\n"],"names":["words","isDoubleOperatorSym","eq","lt","le","gt","ge","ne","or","isDoubleOperatorChar","isSingleOperatorChar","define","style","string","context","split","i","length","state","sas","name","startState","inDataStep","inProc","inMacro","nextword","continueString","continueComment","token","stream","eatSpace","ch","next","eat","peek","skipTo","skipToEnd","column","indentation","word","doubleOperator","eol","test","match","hasOwnProperty","toLowerCase","indexOf","start","pos","backUp","tokenize","languageData","commentTokens","block","open","close"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/1560.index.js b/pr-preview/pr-770/1560.index.js new file mode 100644 index 00000000..ff63ae18 --- /dev/null +++ b/pr-preview/pr-770/1560.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[1560],{1560:(e,t,n)=>{function r(e){for(var t={},n=e.split(","),r=0;rg});var o,a=r("null"),l={"`":i,$:i},u=r("abs,access,after,alias,all,and,architecture,array,assert,attribute,begin,block,body,buffer,bus,case,component,configuration,constant,disconnect,downto,else,elsif,end,end block,end case,end component,end for,end generate,end if,end loop,end process,end record,end units,entity,exit,file,for,function,generate,generic,generic map,group,guarded,if,impure,in,inertial,inout,is,label,library,linkage,literal,loop,map,mod,nand,new,next,nor,null,of,on,open,or,others,out,package,package body,port,port map,postponed,procedure,process,pure,range,record,register,reject,rem,report,return,rol,ror,select,severity,signal,sla,sll,sra,srl,subtype,then,to,transport,type,unaffected,units,until,use,variable,wait,when,while,with,xnor,xor"),s=r("architecture,entity,begin,case,port,else,elsif,end,for,function,if"),c=/[&|~>{a.r(t),a.d(t,{ebnf:()=>c});const c={name:"ebnf",startState:function(){return{stringType:null,commentType:null,braced:0,lhs:!0,localState:null,stack:[],inDefinition:!1}},token:function(e,t){if(e){switch(0===t.stack.length&&('"'==e.peek()||"'"==e.peek()?(t.stringType=e.peek(),e.next(),t.stack.unshift(1)):e.match("/*")?(t.stack.unshift(0),t.commentType=0):e.match("(*")&&(t.stack.unshift(0),t.commentType=1)),t.stack[0]){case 1:for(;1===t.stack[0]&&!e.eol();)e.peek()===t.stringType?(e.next(),t.stack.shift()):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return t.lhs?"property":"string";case 0:for(;0===t.stack[0]&&!e.eol();)0===t.commentType&&e.match("*/")||1===t.commentType&&e.match("*)")?(t.stack.shift(),t.commentType=null):e.match(/^.[^\*]*/);return"comment";case 2:for(;2===t.stack[0]&&!e.eol();)e.match(/^[^\]\\]+/)||e.match(".")||t.stack.shift();return"operator"}var a=e.peek();switch(a){case"[":return e.next(),t.stack.unshift(2),"bracket";case":":case"|":case";":return e.next(),"operator";case"%":if(e.match("%%"))return"header";if(e.match(/[%][A-Za-z]+/))return"keyword";if(e.match(/[%][}]/))return"bracket";break;case"/":if(e.match(/[\/][A-Za-z]+/))return"keyword";case"\\":if(e.match(/[\][a-z]+/))return"string.special";case".":if(e.match("."))return"atom";case"*":case"-":case"+":case"^":if(e.match(a))return"atom";case"$":if(e.match("$$"))return"builtin";if(e.match(/[$][0-9]+/))return"variableName.special";case"<":if(e.match(/<<[a-zA-Z_]+>>/))return"builtin"}return e.match("//")?(e.skipToEnd(),"comment"):e.match("return")?"operator":e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)?e.match(/(?=[\(.])/)?"variable":e.match(/(?=[\s\n]*[:=])/)?"def":"variableName.special":-1!=["[","]","(",")"].indexOf(e.peek())?(e.next(),"bracket"):(e.eatSpace()||e.next(),null)}}}}}]); +//# sourceMappingURL=1653.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/1653.index.js.map b/pr-preview/pr-770/1653.index.js.map new file mode 100644 index 00000000..cd3597dc --- /dev/null +++ b/pr-preview/pr-770/1653.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"1653.index.js","mappings":"yHAGO,MAAMA,EAAO,CAClBC,KAAM,OACNC,WAAY,WACV,MAAO,CACLC,WAAY,KACZC,YAAa,KACbC,OAAQ,EACRC,KAAK,EACLC,WAAY,KACZC,MAAO,GACPC,cAAc,EAElB,EACAC,MAAO,SAAUC,EAAQC,GACvB,GAAKD,EAAL,CAoBA,OAjB2B,IAAvBC,EAAMJ,MAAMK,SAEQ,KAAjBF,EAAOG,QAAoC,KAAjBH,EAAOG,QACpCF,EAAMT,WAAaQ,EAAOG,OAC1BH,EAAOI,OACPH,EAAMJ,MAAMQ,QAxBkB,IAyBrBL,EAAOM,MAAM,OACtBL,EAAMJ,MAAMQ,QA1BM,GA2BlBJ,EAAMR,YA5BY,GA6BTO,EAAOM,MAAM,QACtBL,EAAMJ,MAAMQ,QA7BM,GA8BlBJ,EAAMR,YA/B4B,IAqC9BQ,EAAMJ,MAAM,IACpB,KArCkC,EAsChC,KAtCgC,IAsCzBI,EAAMJ,MAAM,KA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AO,UAIX,OAAIN,EAAOM,MAAM,OACfN,EAAOS,YACA,WACET,EAAOM,MAAM,UACf,WACEN,EAAOM,MAAM,2BAClBN,EAAOM,MAAM,aACR,WACEN,EAAOM,MAAM,mBACf,MAEF,wBACkD,GAAhD,CAAC,IAAK,IAAK,IAAK,KAAKI,QAAQV,EAAOG,SAC7CH,EAAOI,OACA,YACGJ,EAAOW,YACjBX,EAAOI,OAEF,KAjIY,CAkIrB,E","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/ebnf.js"],"sourcesContent":["var commentType = {slash: 0, parenthesis: 1};\nvar stateType = {comment: 0, _string: 1, characterClass: 2};\n\nexport const ebnf = {\n name: \"ebnf\",\n startState: function () {\n return {\n stringType: null,\n commentType: null,\n braced: 0,\n lhs: true,\n localState: null,\n stack: [],\n inDefinition: false\n };\n },\n token: function (stream, state) {\n if (!stream) return;\n\n //check for state changes\n if (state.stack.length === 0) {\n //strings\n if ((stream.peek() == '\"') || (stream.peek() == \"'\")) {\n state.stringType = stream.peek();\n stream.next(); // Skip quote\n state.stack.unshift(stateType._string);\n } else if (stream.match('/*')) { //comments starting with /*\n state.stack.unshift(stateType.comment);\n state.commentType = commentType.slash;\n } else if (stream.match('(*')) { //comments starting with (*\n state.stack.unshift(stateType.comment);\n state.commentType = commentType.parenthesis;\n }\n }\n\n //return state\n //stack has\n switch (state.stack[0]) {\n case stateType._string:\n while (state.stack[0] === stateType._string && !stream.eol()) {\n if (stream.peek() === state.stringType) {\n stream.next(); // Skip quote\n state.stack.shift(); // Clear flag\n } else if (stream.peek() === \"\\\\\") {\n stream.next();\n stream.next();\n } else {\n stream.match(/^.[^\\\\\\\"\\']*/);\n }\n }\n return state.lhs ? \"property\" : \"string\"; // Token style\n\n case stateType.comment:\n while (state.stack[0] === stateType.comment && !stream.eol()) {\n if (state.commentType === commentType.slash && stream.match('*/')) {\n state.stack.shift(); // Clear flag\n state.commentType = null;\n } else if (state.commentType === commentType.parenthesis && stream.match('*)')) {\n state.stack.shift(); // Clear flag\n state.commentType = null;\n } else {\n stream.match(/^.[^\\*]*/);\n }\n }\n return \"comment\";\n\n case stateType.characterClass:\n while (state.stack[0] === stateType.characterClass && !stream.eol()) {\n if (!(stream.match(/^[^\\]\\\\]+/) || stream.match('.'))) {\n state.stack.shift();\n }\n }\n return \"operator\";\n }\n\n var peek = stream.peek();\n\n //no stack\n switch (peek) {\n case \"[\":\n stream.next();\n state.stack.unshift(stateType.characterClass);\n return \"bracket\";\n case \":\":\n case \"|\":\n case \";\":\n stream.next();\n return \"operator\";\n case \"%\":\n if (stream.match(\"%%\")) {\n return \"header\";\n } else if (stream.match(/[%][A-Za-z]+/)) {\n return \"keyword\";\n } else if (stream.match(/[%][}]/)) {\n return \"bracket\";\n }\n break;\n case \"/\":\n if (stream.match(/[\\/][A-Za-z]+/)) {\n return \"keyword\";\n }\n case \"\\\\\":\n if (stream.match(/[\\][a-z]+/)) {\n return \"string.special\";\n }\n case \".\":\n if (stream.match(\".\")) {\n return \"atom\";\n }\n case \"*\":\n case \"-\":\n case \"+\":\n case \"^\":\n if (stream.match(peek)) {\n return \"atom\";\n }\n case \"$\":\n if (stream.match(\"$$\")) {\n return \"builtin\";\n } else if (stream.match(/[$][0-9]+/)) {\n return \"variableName.special\";\n }\n case \"<\":\n if (stream.match(/<<[a-zA-Z_]+>>/)) {\n return \"builtin\";\n }\n }\n\n if (stream.match('//')) {\n stream.skipToEnd();\n return \"comment\";\n } else if (stream.match('return')) {\n return \"operator\";\n } else if (stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)) {\n if (stream.match(/(?=[\\(.])/)) {\n return \"variable\";\n } else if (stream.match(/(?=[\\s\\n]*[:=])/)) {\n return \"def\";\n }\n return \"variableName.special\";\n } else if ([\"[\", \"]\", \"(\", \")\"].indexOf(stream.peek()) != -1) {\n stream.next();\n return \"bracket\";\n } else if (!stream.eatSpace()) {\n stream.next();\n }\n return null;\n }\n};\n"],"names":["ebnf","name","startState","stringType","commentType","braced","lhs","localState","stack","inDefinition","token","stream","state","length","peek","next","unshift","match","eol","shift","skipToEnd","indexOf","eatSpace"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/1911.index.js b/pr-preview/pr-770/1911.index.js new file mode 100644 index 00000000..719aae88 --- /dev/null +++ b/pr-preview/pr-770/1911.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[1911],{1911:(e,t,r)=>{function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}r.r(t),r.d(t,{webIDL:()=>E});var a=["Clamp","Constructor","EnforceRange","Exposed","ImplicitThis","Global","PrimaryGlobal","LegacyArrayClass","LegacyUnenumerableNamedProperties","LenientThis","NamedConstructor","NewObject","NoInterfaceObject","OverrideBuiltins","PutForwards","Replaceable","SameObject","TreatNonObjectAsNull","TreatNullAs","EmptyString","Unforgeable","Unscopeable"],i=n(a),c=["unsigned","short","long","unrestricted","float","double","boolean","byte","octet","Promise","ArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","Float32Array","Float64Array","ByteString","DOMString","USVString","sequence","object","RegExp","Error","DOMException","FrozenArray","any","void"],o=n(c),l=["attribute","callback","const","deleter","dictionary","enum","getter","implements","inherit","interface","iterable","legacycaller","maplike","partial","required","serializer","setlike","setter","static","stringifier","typedef","optional","readonly","or"],m=n(l),s=["true","false","Infinity","NaN","null"],u=n(s),f=n(["callback","dictionary","enum","interface"]),b=n(["typedef"]),d=/^[:<=>?]/,y=/^-?([1-9][0-9]*|0[Xx][0-9A-Fa-f]+|0[0-7]*)/,p=/^-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)/,h=/^_?[A-Za-z][0-9A-Z_a-z-]*/,A=/^_?[A-Za-z][0-9A-Z_a-z-]*(?=\s*;)/,g=/^"[^"]*"/,k=/^\/\*.*?\*\//,D=/^\/\*.*/,C=/^.*?\*\//;const E={name:"webidl",startState:function(){return{inComment:!1,lastToken:"",startDef:!1,endDef:!1}},token:function(e,t){var r=function(e,t){if(e.eatSpace())return null;if(t.inComment)return e.match(C)?(t.inComment=!1,"comment"):(e.skipToEnd(),"comment");if(e.match("//"))return e.skipToEnd(),"comment";if(e.match(k))return"comment";if(e.match(D))return t.inComment=!0,"comment";if(e.match(/^-?[0-9\.]/,!1)&&(e.match(y)||e.match(p)))return"number";if(e.match(g))return"string";if(t.startDef&&e.match(h))return"def";if(t.endDef&&e.match(A))return t.endDef=!1,"def";if(e.match(m))return"keyword";if(e.match(o)){var r=t.lastToken,n=(e.match(/^\s*(.+?)\b/,!1)||[])[1];return":"===r||"implements"===r||"implements"===n||"="===n?"builtin":"type"}return e.match(i)?"builtin":e.match(u)?"atom":e.match(h)?"variable":e.match(d)?"operator":(e.next(),null)}(e,t);if(r){var n=e.current();t.lastToken=n,"keyword"===r?(t.startDef=f.test(n),t.endDef=t.endDef||b.test(n)):t.startDef=!1}return r},languageData:{autocomplete:a.concat(c).concat(l).concat(s)}}}}]); +//# sourceMappingURL=1911.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/1911.index.js.map b/pr-preview/pr-770/1911.index.js.map new file mode 100644 index 00000000..7f9db110 --- /dev/null +++ b/pr-preview/pr-770/1911.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"1911.index.js","mappings":"8FAAA,SAASA,EAAWC,GAClB,OAAO,IAAIC,OAAO,MAAQD,EAAME,KAAK,OAAS,QAChD,C,6BAEA,IAAIC,EAAe,CACjB,QACA,cACA,eACA,UACA,eACA,SAAU,gBACV,mBACA,oCACA,cACA,mBACA,YACA,oBACA,mBACA,cACA,cACA,aACA,uBACA,cACE,cACF,cACA,eAEEC,EAAWL,EAAWI,GAEtBE,EAAY,CACd,WAAY,QAAS,OACrB,eAAgB,QAAS,SACzB,UAAW,OAAQ,QACnB,UACA,cAAe,WAAY,YAAa,aAAc,aACtD,a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,QAAUE,EAAOI,MAAMjB,GAE/B,OADAc,EAAMH,QAAS,EACR,MAGT,GAAIE,EAAOI,MAAM1B,GAAW,MAAO,UAEnC,GAAIsB,EAAOI,MAAM5B,GAAQ,CACvB,IAAIoB,EAAYK,EAAML,UAClBU,GAAaN,EAAOI,MAAM,eAAe,IAAU,IAAI,GAE3D,MAAkB,MAAdR,GAAmC,eAAdA,GACP,eAAdU,GAA4C,MAAdA,EAEzB,UAGA,MAEX,CAEA,OAAIN,EAAOI,MAAM9B,GAAkB,UAC/B0B,EAAOI,MAAMxB,GAAe,OAC5BoB,EAAOI,MAAMlB,GAAqB,WAGlCc,EAAOI,MAAMrB,GAAyB,YAG1CiB,EAAOO,OACA,KACT,CAiBgBC,CAAUR,EAAQC,GAE9B,GAAIC,EAAO,CACT,IAAIO,EAAMT,EAAOU,UACjBT,EAAML,UAAYa,EACJ,YAAVP,GACFD,EAAMJ,SAAWhB,EAAU8B,KAAKF,GAChCR,EAAMH,OAASG,EAAMH,QAAUhB,EAAQ6B,KAAKF,IAE5CR,EAAMJ,UAAW,CAErB,CAEA,OAAOK,CACT,EAEAU,aAAc,CACZC,aAAcxC,EAAayC,OAAOvC,GAAWuC,OAAOrC,GAAcqC,OAAOnC,I","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/webidl.js"],"sourcesContent":["function wordRegexp(words) {\n return new RegExp(\"^((\" + words.join(\")|(\") + \"))\\\\b\");\n};\n\nvar builtinArray = [\n \"Clamp\",\n \"Constructor\",\n \"EnforceRange\",\n \"Exposed\",\n \"ImplicitThis\",\n \"Global\", \"PrimaryGlobal\",\n \"LegacyArrayClass\",\n \"LegacyUnenumerableNamedProperties\",\n \"LenientThis\",\n \"NamedConstructor\",\n \"NewObject\",\n \"NoInterfaceObject\",\n \"OverrideBuiltins\",\n \"PutForwards\",\n \"Replaceable\",\n \"SameObject\",\n \"TreatNonObjectAsNull\",\n \"TreatNullAs\",\n \"EmptyString\",\n \"Unforgeable\",\n \"Unscopeable\"\n];\nvar builtins = wordRegexp(builtinArray);\n\nvar typeArray = [\n \"unsigned\", \"short\", \"long\", // UnsignedIntegerType\n \"unrestricted\", \"float\", \"double\", // UnrestrictedFloatType\n \"boolean\", \"byte\", \"octet\", // Rest of PrimitiveType\n \"Promise\", // PromiseType\n \"ArrayBuffer\", \"DataView\", \"Int8Array\", \"Int16Array\", \"Int32Array\",\n \"Uint8Array\", \"Uint16Array\", \"Uint32Array\", \"Uint8ClampedArray\",\n \"Float32Array\", \"Float64Array\", // BufferRelatedType\n \"ByteString\", \"DOMString\", \"USVString\", \"sequence\", \"object\", \"RegExp\",\n \"Error\", \"DOMException\", \"FrozenArray\", // Rest of NonAnyType\n \"any\", // Rest of SingleType\n \"void\" // Rest of ReturnType\n];\nvar types = wordRegexp(typeArray);\n\nvar keywordArray = [\n \"attribute\", \"callback\", \"const\", \"deleter\", \"dictionary\", \"enum\", \"getter\",\n \"implements\", \"inherit\", \"interface\", \"iterable\", \"legacycaller\", \"maplike\",\n \"partial\", \"required\", \"serializer\", \"setlike\", \"setter\", \"static\",\n \"stringifier\", \"typedef\", // ArgumentNameKeyword except\n // \"unrestricted\"\n \"optional\", \"readonly\", \"or\"\n];\nvar keywords = wordRegexp(keywordArray);\n\nvar atomArray = [\n \"true\", \"false\", // BooleanLiteral\n \"Infinity\", \"NaN\", // FloatLiteral\n \"null\" // Rest of ConstValue\n];\nvar atoms = wordRegexp(atomArray);\n\nvar startDefArray = [\"callback\", \"dictionary\", \"enum\", \"interface\"];\nvar startDefs = wordRegexp(startDefArray);\n\nvar endDefArray = [\"typedef\"];\nvar endDefs = wordRegexp(endDefArray);\n\nvar singleOperators = /^[:<=>?]/;\nvar integers = /^-?([1-9][0-9]*|0[Xx][0-9A-Fa-f]+|0[0-7]*)/;\nvar floats = /^-?(([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)/;\nvar identifiers = /^_?[A-Za-z][0-9A-Z_a-z-]*/;\nvar identifiersEnd = /^_?[A-Za-z][0-9A-Z_a-z-]*(?=\\s*;)/;\nvar strings = /^\"[^\"]*\"/;\nvar multilineComments = /^\\/\\*.*?\\*\\//;\nvar multilineCommentsStart = /^\\/\\*.*/;\nvar multilineCommentsEnd = /^.*?\\*\\//;\n\nfunction readToken(stream, state) {\n // whitespace\n if (stream.eatSpace()) return null;\n\n // comment\n if (state.inComment) {\n if (stream.match(multilineCommentsEnd)) {\n state.inComment = false;\n return \"comment\";\n }\n stream.skipToEnd();\n return \"comment\";\n }\n if (stream.match(\"//\")) {\n stream.skipToEnd();\n return \"comment\";\n }\n if (stream.match(multilineComments)) return \"comment\";\n if (stream.match(multilineCommentsStart)) {\n state.inComment = true;\n return \"comment\";\n }\n\n // integer and float\n if (stream.match(/^-?[0-9\\.]/, false)) {\n if (stream.match(integers) || stream.match(floats)) return \"number\";\n }\n\n // string\n if (stream.match(strings)) return \"string\";\n\n // identifier\n if (state.startDef && stream.match(identifiers)) return \"def\";\n\n if (state.endDef && stream.match(identifiersEnd)) {\n state.endDef = false;\n return \"def\";\n }\n\n if (stream.match(keywords)) return \"keyword\";\n\n if (stream.match(types)) {\n var lastToken = state.lastToken;\n var nextToken = (stream.match(/^\\s*(.+?)\\b/, false) || [])[1];\n\n if (lastToken === \":\" || lastToken === \"implements\" ||\n nextToken === \"implements\" || nextToken === \"=\") {\n // Used as identifier\n return \"builtin\";\n } else {\n // Used as type\n return \"type\";\n }\n }\n\n if (stream.match(builtins)) return \"builtin\";\n if (stream.match(atoms)) return \"atom\";\n if (stream.match(identifiers)) return \"variable\";\n\n // other\n if (stream.match(singleOperators)) return \"operator\";\n\n // unrecognized\n stream.next();\n return null;\n};\n\nexport const webIDL = {\n name: \"webidl\",\n startState: function() {\n return {\n // Is in multiline comment\n inComment: false,\n // Last non-whitespace, matched token\n lastToken: \"\",\n // Next token is a definition\n startDef: false,\n // Last token of the statement is a definition\n endDef: false\n };\n },\n token: function(stream, state) {\n var style = readToken(stream, state);\n\n if (style) {\n var cur = stream.current();\n state.lastToken = cur;\n if (style === \"keyword\") {\n state.startDef = startDefs.test(cur);\n state.endDef = state.endDef || endDefs.test(cur);\n } else {\n state.startDef = false;\n }\n }\n\n return style;\n },\n\n languageData: {\n autocomplete: builtinArray.concat(typeArray).concat(keywordArray).concat(atomArray)\n }\n};\n"],"names":["wordRegexp","words","RegExp","join","builtinArray","builtins","typeArray","types","keywordArray","keywords","atomArray","atoms","startDefs","endDefs","singleOperators","integers","floats","identifiers","identifiersEnd","strings","multilineComments","multilineCommentsStart","multilineCommentsEnd","webIDL","name","startState","inComment","lastToken","startDef","endDef","token","stream","state","style","eatSpace","match","skipToEnd","nextToken","next","readToken","cur","current","test","languageData","autocomplete","concat"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/2000.index.js b/pr-preview/pr-770/2000.index.js new file mode 100644 index 00000000..8cf6e785 --- /dev/null +++ b/pr-preview/pr-770/2000.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[2e3],{2e3:(O,a,Q)=>{Q.r(a),Q.d(a,{autoCloseTags:()=>I,completionPath:()=>q,esLint:()=>D,javascript:()=>N,javascriptLanguage:()=>G,jsxLanguage:()=>V,localCompletionSource:()=>w,scopeCompletionSource:()=>j,snippets:()=>u,tsxLanguage:()=>v,typescriptLanguage:()=>T,typescriptSnippets:()=>d});var i=Q(3643),$=Q(9913);const e=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],r=new i.Aj({start:!1,shift:(O,a)=>5==a||6==a||315==a?O:316==a,strict:!1}),Z=new i.Lu(((O,a)=>{let{next:Q}=O;(125==Q||-1==Q||a.context)&&O.acceptToken(313)}),{contextual:!0,fallback:!0}),o=new i.Lu(((O,a)=>{let Q,{next:i}=O;e.indexOf(i)>-1||(47!=i||47!=(Q=O.peek(1))&&42!=Q)&&(125==i||59==i||-1==i||a.context||O.acceptToken(312))}),{contextual:!0}),t=new i.Lu(((O,a)=>{let{next:Q}=O;if(43==Q||45==Q){if(O.advance(),Q==O.next){O.advance();let Q=!a.context&&a.canShift(1);O.acceptToken(Q?1:2)}}else 63==Q&&46==O.peek(1)&&(O.advance(),O.advance(),(O.next<48||O.next>57)&&O.acceptToken(3))}),{contextual:!0});function P(O,a){return O>=65&&O<=90||O>=97&&O<=122||95==O||O>=192||!a&&O>=48&&O<=57}const p=new i.Lu(((O,a)=>{if(60!=O.next||!a.dialectEnabled(0))return;if(O.advance(),47==O.next)return;let Q=0;for(;e.indexOf(O.next)>-1;)O.advance(),Q++;if(P(O.next,!0)){for(O.advance(),Q++;P(O.next,!1);)O.advance(),Q++;for(;e.indexOf(O.next)>-1;)O.advance(),Q++;if(44==O.next)return;for(let a=0;;a++){if(7==a){if(!P(O.next,!0))return;break}if(O.next!="extends".charCodeAt(a))break;O.advance(),Q++}}O.acceptToken(4,-Q)})),n=(0,$.pn)({"get set async static":$._A.modifier,"for while do if else switch try catch finally return throw break continue default case":$._A.controlKeyword,"in of await yield void typeof delete instanceof":$._A.operatorKeyword,"let var const using function class extends":$._A.definitionKeyword,"import export from":$._A.moduleKeyword,"with debugger as new":$._A.keyword,TemplateString:$._A.special($._A.string),super:$._A.atom,BooleanLiteral:$._A.bool,this:$._A.self,null:$._A.null,Star:$._A.modifier,VariableName:$._A.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":$._A.function($._A.variableName),VariableDefinition:$._A.definition($._A.variableName),Label:$._A.labelName,PropertyName:$._A.propertyName,PrivatePropertyName:$._A.special($._A.propertyName),"CallExpression/MemberExpression/PropertyName":$._A.function($._A.propertyName),"FunctionDeclaration/VariableDefinition":$._A.function($._A.definition($._A.variableName)),"ClassDeclaration/VariableDefinition":$._A.definition($._A.className),PropertyDefinition:$._A.definition($._A.propertyName),PrivatePropertyDefinition:$._A.definition($._A.special($._A.propertyName)),UpdateOp:$._A.updateOperator,"LineComment Hashbang":$._A.lineComment,BlockComment:$._A.blockComment,Number:$._A.number,String:$._A.string,Escape:$._A.escape,ArithOp:$._A.arithmeticOperator,LogicOp:$._A.logicOperator,BitOp:$._A.bitwiseOperator,CompareOp:$._A.compareOperator,RegExp:$._A.regexp,Equals:$._A.definitionOperator,Arrow:$._A.function($._A.punctuation),": Spread":$._A.punctuation,"( )":$._A.paren,"[ ]":$._A.squareBracket,"{ }":$._A.brace,"InterpolationStart InterpolationEnd":$._A.special($._A.brace),".":$._A.derefOperator,", ;":$._A.separator,"@":$._A.meta,TypeName:$._A.typeName,TypeDefinition:$._A.definition($._A.typeName),"type enum interface implements namespace module declare":$._A.definitionKeyword,"abstract global Privacy readonly override":$._A.modifier,"is keyof unique infer":$._A.operatorKeyword,JSXAttributeValue:$._A.attributeValue,JSXText:$._A.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":$._A.angleBracket,"JSXIdentifier JSXNameSpacedName":$._A.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":$._A.attributeName,"JSXBuiltin/JSXIdentifier":$._A.standard($._A.tagName)}),l={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},s={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},h={__proto__:null,"<":187},c=i.U1.deserialize({version:14,states:"$@QO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ?NdO'#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m$YO~P#.aO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/gO(OQ#>g#@V#@e#@l#BR#Ba#C|#D[#Db#Dh#Dn#Dx#EO#EU#E`#Er#ExPPPPPPPPPP#FOPPPPPPP#Fs#Iz#KZ#Kb#KjPPP$!sP$!|$%t$,^$,a$,d$-P$-S$-Z$-cP$-i$-lP$.Y$.^$/U$0d$0i$1PPP$1U$1[$1`P$1c$1g$1k$2a$2x$3a$3e$3h$3k$3q$3t$3x$3|R!|RoqOXst!Z#d%k&o&q&r&t,k,p1|2PY!vQ']-]1a5eQ%rvQ%zyQ&R|Q&g!VS'T!e-TQ'c!iS'i!r!yU*e$|*V*jQ+i%{Q+v&TQ,[&aQ-Z'[Q-e'dQ-m'jQ0R*lQ1k,]R;v;T%QdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%k%r&P&h&k&o&q&r&t&x'Q'_'o(P(R(X(`(t(v(z)y+R+V,h,k,p-a-i-w-}.l.s/f0a0g0v1d1t1u1w1y1|2P2R2r2x3^5b5m5}6O6R6f8R8X8h8rS#q];Q!r)Z$Z$n'U)o,|-P.}2b3u5`6]9h9y;P;S;T;W;X;Y;Z;[;];^;_;`;a;b;c;d;f;i;v;x;y;{ < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:376,context:r,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[n],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(RpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p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ad#E|g$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-l[O]||-1},{term:338,get:O=>s[O]||-1},{term:92,get:O=>h[O]||-1}],tokenPrec:14749});var S=Q(9587),X=Q(4830),m=Q(3173),b=Q(7213),Y=Q(9066);const u=[(0,b.Gw)("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),(0,b.Gw)("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),(0,b.Gw)("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),(0,b.Gw)("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),(0,b.Gw)("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),(0,b.Gw)("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),(0,b.Gw)("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),(0,b.Gw)("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),(0,b.Gw)("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),(0,b.Gw)('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),(0,b.Gw)('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],d=u.concat([(0,b.Gw)("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),(0,b.Gw)("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),(0,b.Gw)("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),g=new Y.RY,R=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function f(O){return(a,Q)=>{let i=a.node.getChild("VariableDefinition");return i&&Q(i,O),!0}}const W=["FunctionDeclaration"],x={FunctionDeclaration:f("function"),ClassDeclaration:f("class"),ClassExpression:()=>!0,EnumDeclaration:f("constant"),TypeAliasDeclaration:f("type"),NamespaceDeclaration:f("namespace"),VariableDefinition(O,a){O.matchContext(W)||a(O,"variable")},TypeDefinition(O,a){a(O,"type")},__proto__:null};function _(O,a){let Q=g.get(a);if(Q)return Q;let i=[],$=!0;function e(a,Q){let $=O.sliceString(a.from,a.to);i.push({label:$,type:Q})}return a.cursor(Y.Qj.IncludeAnonymous).iterate((a=>{if($)$=!1;else if(a.name){let O=x[a.name];if(O&&O(a,e)||R.has(a.name))return!1}else if(a.to-a.from>8192){for(let Q of _(O,a.node))i.push(Q);return!1}})),g.set(a,i),i}const U=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,y=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function w(O){let a=(0,S.mv)(O.state).resolveInner(O.pos,-1);if(y.indexOf(a.name)>-1)return null;let Q="VariableName"==a.name||a.to-a.from<20&&U.test(O.state.sliceDoc(a.from,a.to));if(!Q&&!O.explicit)return null;let i=[];for(let Q=a;Q;Q=Q.parent)R.has(Q.name)&&(i=i.concat(_(O.state.doc,Q)));return{options:i,from:Q?a.from:O.pos,validFor:U}}function k(O,a,Q){var i;let $=[];for(;;){let e,r=a.firstChild;if("VariableName"==(null==r?void 0:r.name))return $.push(O(r)),{path:$.reverse(),name:Q};if("MemberExpression"!=(null==r?void 0:r.name)||"PropertyName"!=(null===(i=e=r.lastChild)||void 0===i?void 0:i.name))return null;$.push(O(e)),a=r}}function q(O){let a=a=>O.state.doc.sliceString(a.from,a.to),Q=(0,S.mv)(O.state).resolveInner(O.pos,-1);return"PropertyName"==Q.name?k(a,Q.parent,a(Q)):"."!=Q.name&&"?."!=Q.name||"MemberExpression"!=Q.parent.name?y.indexOf(Q.name)>-1?null:"VariableName"==Q.name||Q.to-Q.from<20&&U.test(a(Q))?{path:[],name:a(Q)}:"MemberExpression"==Q.name?k(a,Q,""):O.explicit?{path:[],name:""}:null:k(a,Q.parent,"")}function j(O){let a=new Map;return Q=>{let i=q(Q);if(!i)return null;let $=O;for(let O of i.path)if($=$[O],!$)return null;let e=a.get($);return e||a.set($,e=function(O,a){let Q=[],i=new Set;for(let $=0;;$++){for(let e of(Object.getOwnPropertyNames||Object.keys)(O)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(e)||i.has(e))continue;let r;i.add(e);try{r=O[e]}catch(O){continue}Q.push({label:e,type:"function"==typeof r?/^[A-Z]/.test(e)?"class":a?"function":"method":a?"variable":"property",boost:-$})}let e=Object.getPrototypeOf(O);if(!e)return Q;O=e}}($,!i.path.length)),{from:Q.pos-i.name.length,options:e,validFor:U}}}const G=S.bj.define({name:"javascript",parser:c.configure({props:[S.Oh.add({IfStatement:(0,S.mz)({except:/^\s*({|else\b)/}),TryStatement:(0,S.mz)({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:S._Y,SwitchBody:O=>{let a=O.textAfter,Q=/^\s*\}/.test(a),i=/^\s*(case|default)\b/.test(a);return O.baseIndent+(Q?0:i?1:2)*O.unit},Block:(0,S.Ay)({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"TemplateString BlockComment":()=>null,"Statement Property":(0,S.mz)({except:/^{/}),JSXElement(O){let a=/^\s*<\//.test(O.textAfter);return O.lineIndent(O.node.from)+(a?0:O.unit)},JSXEscape(O){let a=/\s*\}/.test(O.textAfter);return O.lineIndent(O.node.from)+(a?0:O.unit)},"JSXOpenTag JSXSelfClosingTag":O=>O.column(O.node.from)+O.unit}),S.b_.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":S.yd,BlockComment:O=>({from:O.from+2,to:O.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),z={test:O=>/^JSX/.test(O.name),facet:(0,S.p9)({commentTokens:{block:{open:"{/*",close:"*/}"}}})},T=G.configure({dialect:"ts"},"typescript"),V=G.configure({dialect:"jsx",props:[S.Q0.add((O=>O.isTop?[z]:void 0))]}),v=G.configure({dialect:"jsx ts",props:[S.Q0.add((O=>O.isTop?[z]:void 0))]},"typescript");let A=O=>({label:O,type:"keyword"});const E="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(A),M=E.concat(["declare","implements","private","protected","public"].map(A));function N(O={}){let a=O.jsx?O.typescript?v:V:O.typescript?T:G,Q=O.typescript?d.concat(M):u.concat(E);return new S.Yy(a,[G.data.of({autocomplete:(0,b.Ar)(y,(0,b.et)(Q))}),G.data.of({autocomplete:w}),O.jsx?I:[]])}function C(O,a,Q=O.length){for(let i=null==a?void 0:a.firstChild;i;i=i.nextSibling)if("JSXIdentifier"==i.name||"JSXBuiltin"==i.name||"JSXNamespacedName"==i.name||"JSXMemberExpression"==i.name)return O.sliceString(i.from,Math.min(i.to,Q));return""}const J="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),I=m.Lz.inputHandler.of(((O,a,Q,i,$)=>{if((J?O.composing:O.compositionStarted)||O.state.readOnly||a!=Q||">"!=i&&"/"!=i||!G.isActiveAt(O.state,a,-1))return!1;let e=$(),{state:r}=e,Z=r.changeByRange((O=>{var a;let Q,{head:$}=O,e=(0,S.mv)(r).resolveInner($-1,-1);if("JSXStartTag"==e.name&&(e=e.parent),r.doc.sliceString($-1,$)!=i||"JSXAttributeValue"==e.name&&e.to>$);else{if(">"==i&&"JSXFragmentTag"==e.name)return{range:O,changes:{from:$,insert:""}};if("/"==i&&"JSXStartCloseTag"==e.name){let O=e.parent,i=O.parent;if(i&&O.from==$-2&&((Q=C(r.doc,i.firstChild,$))||"JSXFragmentTag"==(null===(a=i.firstChild)||void 0===a?void 0:a.name))){let O=`${Q}>`;return{range:X.OF.cursor($+O.length,-1),changes:{from:$,insert:O}}}}else if(">"==i){let a=function(O){for(;;){if("JSXOpenTag"==O.name||"JSXSelfClosingTag"==O.name||"JSXFragmentTag"==O.name)return O;if("JSXEscape"==O.name||!O.parent)return null;O=O.parent}}(e);if(a&&"JSXOpenTag"==a.name&&!/^\/?>|^<\//.test(r.doc.sliceString($,$+2))&&(Q=C(r.doc,a,$)))return{range:O,changes:{from:$,insert:``}}}}return{range:O}}));return!Z.changes.empty&&(O.dispatch([e,r.update(Z,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}));function D(O,a){return a||(a={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},O.getRules().forEach(((O,Q)=>{O.meta.docs.recommended&&(a.rules[Q]=2)}))),Q=>{let{state:i}=Q,$=[];for(let{from:Q,to:e}of G.findRegions(i)){let r=i.doc.lineAt(Q),Z={line:r.number-1,col:Q-r.from,pos:Q};for(let r of O.verify(i.sliceDoc(Q,e),a))$.push(L(r,i.doc,Z))}return $}}function K(O,a,Q,i){return Q.line(O+i.line).from+a+(1==O?i.col-1:-1)}function L(O,a,Q){let i=K(O.line,O.column,a,Q),$={from:i,to:null!=O.endLine&&1!=O.endColumn?K(O.endLine,O.endColumn,a,Q):i,message:O.message,source:O.ruleId?"eslint:"+O.ruleId:"eslint",severity:1==O.severity?"warning":"error"};if(O.fix){let{range:a,text:e}=O.fix,r=a[0]+Q.pos-i,Z=a[1]+Q.pos-i;$.actions=[{name:"fix",apply(O,a){O.dispatch({changes:{from:a+r,to:a+Z,insert:e},scrollIntoView:!0})}}]}return $}}}]); +//# sourceMappingURL=2000.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/2000.index.js.map b/pr-preview/pr-770/2000.index.js.map new file mode 100644 index 00000000..6c23a681 --- /dev/null +++ b/pr-preview/pr-770/2000.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"2000.index.js","mappings":"iYAIA,MAeMA,EAAQ,CAAC,EAAG,GAAI,GAAI,GAAI,GAAI,GAAI,IAAK,IAAK,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KACvF,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,OAK7CC,EAAe,IAAI,KAAe,CACtCC,OAAO,EACPC,MAAK,CAACC,EAASC,IAfD,GAgBLA,GAfM,GAeiBA,GAlBvB,KAkB+CA,EAAiBD,EAjB/D,KAiByEC,EAEnFC,QAAQ,IAGJC,EAAkB,IAAI,MAAkB,CAACC,EAAOC,KACpD,IAAI,KAACC,GAAQF,GAZA,KAaTE,IAA2B,GAATA,GAAcD,EAAML,UACxCI,EAAMG,YA3BK,IA2BkB,GAC9B,CAACC,YAAY,EAAMC,UAAU,IAE1BC,EAAc,IAAI,MAAkB,CAACN,EAAOC,KAChD,IAAo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EACpF,CACA,SAASG,EAAoBhX,EAAO2M,EAAKiK,GACrC,IAAIlX,EAAQuX,EAAOjX,EAAM6R,KAAM7R,EAAMuR,OAAQ5E,EAAKiK,GAC9CM,EAAS,CACTjR,KAAMvG,EACNuN,GAAqB,MAAjBjN,EAAMmX,SAAsC,GAAnBnX,EAAMoX,UAAiBH,EAAOjX,EAAMmX,QAASnX,EAAMoX,UAAWzK,EAAKiK,GAAUlX,EAC1G2X,QAASrX,EAAMqX,QACfC,OAAQtX,EAAMuX,OAAS,UAAYvX,EAAMuX,OAAS,SAClDC,SAA4B,GAAlBxX,EAAMwX,SAAgB,UAAY,SAEhD,GAAIxX,EAAMyX,IAAK,CACX,IAAI,MAAE9C,EAAK,KAAET,GAASlU,EAAMyX,IAAKxR,EAAO0O,EAAM,GAAKiC,EAAO7I,IAAMrO,EAAOuN,EAAK0H,EAAM,GAAKiC,EAAO7I,IAAMrO,EACpGwX,EAAOQ,QAAU,CAAC,CACV3K,KAAM,MACN,KAAA4K,CAAM1D,EAAMvU,GACRuU,EAAKkB,SAAS,CAAEL,QAAS,CAAE7O,KAAMvG,EAAQuG,EAAMgH,GAAIvN,EAAQuN,EAAI8H,OAAQb,GAAQoB,gBAAgB,GACnG,GAEZ,CACA,OAAO4B,CACX,C","sources":["webpack://thebe/../../node_modules/@lezer/javascript/dist/index.js","webpack://thebe/../../node_modules/@codemirror/lang-javascript/dist/index.js"],"sourcesContent":["import { ContextTracker, ExternalTokenizer, LRParser, LocalTokenGroup } from '@lezer/lr';\nimport { styleTags, tags } from '@lezer/highlight';\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst noSemi = 312,\n incdec = 1,\n incdecPrefix = 2,\n questionDot = 3,\n JSXStartTag = 4,\n insertSemi = 313,\n spaces = 315,\n newline = 316,\n LineComment = 5,\n BlockComment = 6,\n Dialect_jsx = 0;\n\n/* Hand-written tokenizers for JavaScript tokens that can't be\n expressed by lezer's built-in tokenizer. */\n\nconst space = [9, 10, 11, 12, 13, 32, 133, 160, 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200,\n 8201, 8202, 8232, 8233, 8239, 8287, 12288];\n\nconst braceR = 125, semicolon = 59, slash = 47, star = 42, plus = 43, minus = 45, lt = 60, comma = 44,\n question = 63, dot = 46;\n\nconst trackNewline = new ContextTracker({\n start: false,\n shift(context, term) {\n return term == LineComment || term == BlockComment || term == spaces ? context : term == newline\n },\n strict: false\n});\n\nconst insertSemicolon = new ExternalTokenizer((input, stack) => {\n let {next} = input;\n if (next == braceR || next == -1 || stack.context)\n input.acceptToken(insertSemi);\n}, {contextual: true, fallback: true});\n\nconst noSemicolon = new ExternalTokenizer((input, stack) => {\n let {next} = input, after;\n if (space.indexOf(next) > -1) return\n if (next == slash && ((after = input.peek(1)) == slash || after == star)) return\n if (next != braceR && next != semicolon && next != -1 && !stack.context)\n input.acceptToken(noSemi);\n}, {contextual: true});\n\nconst operatorToken = new ExternalTokenizer((input, stack) => {\n let {next} = input;\n if (next == plus || next == minus) {\n input.advance();\n if (next == input.next) {\n input.advance();\n let mayPostfix = !stack.context && stack.canShift(incdec);\n input.acceptToken(mayPostfix ? incdec : incdecPrefix);\n }\n } else if (next == question && input.peek(1) == dot) {\n input.advance(); input.advance();\n if (input.next < 48 || input.next > 57) // No digit after\n input.acceptToken(questionDot);\n }\n}, {contextual: true});\n\nfunction identifierChar(ch, start) {\n return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch == 95 || ch >= 192 ||\n !start && ch >= 48 && ch <= 57\n}\n\nconst jsx = new ExternalTokenizer((input, stack) => {\n if (input.next != lt || !stack.dialectEnabled(Dialect_jsx)) return\n input.advance();\n if (input.next == slash) return\n // Scan for an identifier followed by a comma or 'extends', don't\n // treat this as a start tag if present.\n let back = 0;\n while (space.indexOf(input.next) > -1) { input.advance(); back++; }\n if (identifierChar(input.next, true)) {\n input.advance();\n back++;\n while (identifierChar(input.next, false)) { input.advance(); back++; }\n while (space.indexOf(input.next) > -1) { input.advance(); back++; }\n if (input.next == comma) return\n for (let i = 0;; i++) {\n if (i == 7) {\n if (!identifierChar(input.next, true)) return\n break\n }\n if (input.next != \"extends\".charCodeAt(i)) break\n input.advance();\n back++;\n }\n }\n input.acceptToken(JSXStartTag, -back);\n});\n\nconst jsHighlight = styleTags({\n \"get set async static\": tags.modifier,\n \"for while do if else switch try catch finally return throw break continue default case\": tags.controlKeyword,\n \"in of await yield void typeof delete instanceof\": tags.operatorKeyword,\n \"let var const using function class extends\": tags.definitionKeyword,\n \"import export from\": tags.moduleKeyword,\n \"with debugger as new\": tags.keyword,\n TemplateString: tags.special(tags.string),\n super: tags.atom,\n BooleanLiteral: tags.bool,\n this: tags.self,\n null: tags.null,\n Star: tags.modifier,\n VariableName: tags.variableName,\n \"CallExpression/VariableName TaggedTemplateExpression/VariableName\": tags.function(tags.variableName),\n VariableDefinition: tags.definition(tags.variableName),\n Label: tags.labelName,\n PropertyName: tags.propertyName,\n PrivatePropertyName: tags.special(tags.propertyName),\n \"CallExpression/MemberExpression/PropertyName\": tags.function(tags.propertyName),\n \"FunctionDeclaration/VariableDefinition\": tags.function(tags.definition(tags.variableName)),\n \"ClassDeclaration/VariableDefinition\": tags.definition(tags.className),\n PropertyDefinition: tags.definition(tags.propertyName),\n PrivatePropertyDefinition: tags.definition(tags.special(tags.propertyName)),\n UpdateOp: tags.updateOperator,\n \"LineComment Hashbang\": tags.lineComment,\n BlockComment: tags.blockComment,\n Number: tags.number,\n String: tags.string,\n Escape: tags.escape,\n ArithOp: tags.arithmeticOperator,\n LogicOp: tags.logicOperator,\n BitOp: tags.bitwiseOperator,\n CompareOp: tags.compareOperator,\n RegExp: tags.regexp,\n Equals: tags.definitionOperator,\n Arrow: tags.function(tags.punctuation),\n \": Spread\": tags.punctuation,\n \"( )\": tags.paren,\n \"[ ]\": tags.squareBracket,\n \"{ }\": tags.brace,\n \"InterpolationStart InterpolationEnd\": tags.special(tags.brace),\n \".\": tags.derefOperator,\n \", ;\": tags.separator,\n \"@\": tags.meta,\n\n TypeName: tags.typeName,\n TypeDefinition: tags.definition(tags.typeName),\n \"type enum interface implements namespace module declare\": tags.definitionKeyword,\n \"abstract global Privacy readonly override\": tags.modifier,\n \"is keyof unique infer\": tags.operatorKeyword,\n\n JSXAttributeValue: tags.attributeValue,\n JSXText: tags.content,\n \"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag\": tags.angleBracket,\n \"JSXIdentifier JSXNameSpacedName\": tags.tagName,\n \"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName\": tags.attributeName,\n \"JSXBuiltin/JSXIdentifier\": tags.standard(tags.tagName)\n});\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst spec_identifier = {__proto__:null,export:20, as:25, from:33, default:36, async:41, function:42, extends:54, this:58, true:66, false:66, null:78, void:82, typeof:86, super:102, new:136, delete:148, yield:157, await:161, class:166, public:229, private:229, protected:229, readonly:231, instanceof:250, satisfies:253, in:254, const:256, import:290, keyof:345, unique:349, infer:355, is:391, abstract:411, implements:413, type:415, let:418, var:420, using:423, interface:429, enum:433, namespace:439, module:441, declare:445, global:449, for:468, of:477, while:480, with:484, do:488, if:492, else:494, switch:498, case:504, try:510, catch:514, finally:518, return:522, throw:526, break:530, continue:534, debugger:538};\nconst spec_word = {__proto__:null,async:123, get:125, set:127, declare:189, public:191, private:191, protected:191, static:193, abstract:195, override:197, readonly:203, accessor:205, new:395};\nconst spec_LessThan = {__proto__:null,\"<\":187};\nconst parser = LRParser.deserialize({\n version: 14,\n states: \"$@QO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ?NdO'#CiO+RO!bO'#CjO+aO#tO'#CjO+oO!0LbO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DwO0fQ^O'#EPOOQ?Mr'#EX'#EXO1PQWO'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQWO'#GpO1dQWO'#ElO1iQWO'#ElO3hQ?NdO'#JmO6[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-i$-lP$.Y$.^$/U$0d$0i$1PPP$1U$1[$1`P$1c$1g$1k$2a$2x$3a$3e$3h$3k$3q$3t$3x$3|R!|RoqOXst!Z#d%k&o&q&r&t,k,p1|2PY!vQ']-]1a5eQ%rvQ%zyQ&R|Q&g!VS'T!e-TQ'c!iS'i!r!yU*e$|*V*jQ+i%{Q+v&TQ,[&aQ-Z'[Q-e'dQ-m'jQ0R*lQ1k,]R;v;T%QdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%k%r&P&h&k&o&q&r&t&x'Q'_'o(P(R(X(`(t(v(z)y+R+V,h,k,p-a-i-w-}.l.s/f0a0g0v1d1t1u1w1y1|2P2R2r2x3^5b5m5}6O6R6f8R8X8h8rS#q];Q!r)Z$Z$n'U)o,|-P.}2b3u5`6]9h9y;P;S;T;W;X;Y;Z;[;];^;_;`;a;b;c;d;f;i;v;x;y;{ < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem\",\n maxTerm: 376,\n context: trackNewline,\n nodeProps: [\n [\"isolate\", -8,5,6,14,34,36,48,50,52,\"\"],\n [\"group\", -26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,\"Statement\",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,\"Expression\",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,\"Type\",-3,85,100,106,\"ClassItem\"],\n [\"openedBy\", 23,\"<\",35,\"InterpolationStart\",53,\"[\",57,\"{\",70,\"(\",159,\"JSXSt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%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O- spec_identifier[value] || -1},{term: 338, get: (value) => spec_word[value] || -1},{term: 92, get: (value) => spec_LessThan[value] || -1}],\n tokenPrec: 14749\n});\n\nexport { parser };\n","import { parser } from '@lezer/javascript';\nimport { syntaxTree, LRLanguage, indentNodeProp, continuedIndent, flatIndent, delimitedIndent, foldNodeProp, foldInside, defineLanguageFacet, sublanguageProp, LanguageSupport } from '@codemirror/language';\nimport { EditorSelection } from '@codemirror/state';\nimport { EditorView } from '@codemirror/view';\nimport { snippetCompletion, ifNotIn, completeFromList } from '@codemirror/autocomplete';\nimport { NodeWeakMap, IterMode } from '@lezer/common';\n\n/**\nA collection of JavaScript-related\n[snippets](https://codemirror.net/6/docs/ref/#autocomplete.snippet).\n*/\nconst snippets = [\n /*@__PURE__*/snippetCompletion(\"function ${name}(${params}) {\\n\\t${}\\n}\", {\n label: \"function\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\\n\\t${}\\n}\", {\n label: \"for\",\n detail: \"loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"for (let ${name} of ${collection}) {\\n\\t${}\\n}\", {\n label: \"for\",\n detail: \"of loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"do {\\n\\t${}\\n} while (${})\", {\n label: \"do\",\n detail: \"loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"while (${}) {\\n\\t${}\\n}\", {\n label: \"while\",\n detail: \"loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"try {\\n\\t${}\\n} catch (${error}) {\\n\\t${}\\n}\", {\n label: \"try\",\n detail: \"/ catch block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"if (${}) {\\n\\t${}\\n}\", {\n label: \"if\",\n detail: \"block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"if (${}) {\\n\\t${}\\n} else {\\n\\t${}\\n}\", {\n label: \"if\",\n detail: \"/ else block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"class ${name} {\\n\\tconstructor(${params}) {\\n\\t\\t${}\\n\\t}\\n}\", {\n label: \"class\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"import {${names}} from \\\"${module}\\\"\\n${}\", {\n label: \"import\",\n detail: \"named\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"import ${name} from \\\"${module}\\\"\\n${}\", {\n label: \"import\",\n detail: \"default\",\n type: \"keyword\"\n })\n];\n/**\nA collection of snippet completions for TypeScript. Includes the\nJavaScript [snippets](https://codemirror.net/6/docs/ref/#lang-javascript.snippets).\n*/\nconst typescriptSnippets = /*@__PURE__*/snippets.concat([\n /*@__PURE__*/snippetCompletion(\"interface ${name} {\\n\\t${}\\n}\", {\n label: \"interface\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"type ${name} = ${type}\", {\n label: \"type\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"enum ${name} {\\n\\t${}\\n}\", {\n label: \"enum\",\n detail: \"definition\",\n type: \"keyword\"\n })\n]);\n\nconst cache = /*@__PURE__*/new NodeWeakMap();\nconst ScopeNodes = /*@__PURE__*/new Set([\n \"Script\", \"Block\",\n \"FunctionExpression\", \"FunctionDeclaration\", \"ArrowFunction\", \"MethodDeclaration\",\n \"ForStatement\"\n]);\nfunction defID(type) {\n return (node, def) => {\n let id = node.node.getChild(\"VariableDefinition\");\n if (id)\n def(id, type);\n return true;\n };\n}\nconst functionContext = [\"FunctionDeclaration\"];\nconst gatherCompletions = {\n FunctionDeclaration: /*@__PURE__*/defID(\"function\"),\n ClassDeclaration: /*@__PURE__*/defID(\"class\"),\n ClassExpression: () => true,\n EnumDeclaration: /*@__PURE__*/defID(\"constant\"),\n TypeAliasDeclaration: /*@__PURE__*/defID(\"type\"),\n NamespaceDeclaration: /*@__PURE__*/defID(\"namespace\"),\n VariableDefinition(node, def) { if (!node.matchContext(functionContext))\n def(node, \"variable\"); },\n TypeDefinition(node, def) { def(node, \"type\"); },\n __proto__: null\n};\nfunction getScope(doc, node) {\n let cached = cache.get(node);\n if (cached)\n return cached;\n let completions = [], top = true;\n function def(node, type) {\n let name = doc.sliceString(node.from, node.to);\n completions.push({ label: name, type });\n }\n node.cursor(IterMode.IncludeAnonymous).iterate(node => {\n if (top) {\n top = false;\n }\n else if (node.name) {\n let gather = gatherCompletions[node.name];\n if (gather && gather(node, def) || ScopeNodes.has(node.name))\n return false;\n }\n else if (node.to - node.from > 8192) {\n // Allow caching for bigger internal nodes\n for (let c of getScope(doc, node.node))\n completions.push(c);\n return false;\n }\n });\n cache.set(node, completions);\n return completions;\n}\nconst Identifier = /^[\\w$\\xa1-\\uffff][\\w$\\d\\xa1-\\uffff]*$/;\nconst dontComplete = [\n \"TemplateString\", \"String\", \"RegExp\",\n \"LineComment\", \"BlockComment\",\n \"VariableDefinition\", \"TypeDefinition\", \"Label\",\n \"PropertyDefinition\", \"PropertyName\",\n \"PrivatePropertyDefinition\", \"PrivatePropertyName\",\n \".\", \"?.\"\n];\n/**\nCompletion source that looks up locally defined names in\nJavaScript code.\n*/\nfunction localCompletionSource(context) {\n let inner = syntaxTree(context.state).resolveInner(context.pos, -1);\n if (dontComplete.indexOf(inner.name) > -1)\n return null;\n let isWord = inner.name == \"VariableName\" ||\n inner.to - inner.from < 20 && Identifier.test(context.state.sliceDoc(inner.from, inner.to));\n if (!isWord && !context.explicit)\n return null;\n let options = [];\n for (let pos = inner; pos; pos = pos.parent) {\n if (ScopeNodes.has(pos.name))\n options = options.concat(getScope(context.state.doc, pos));\n }\n return {\n options,\n from: isWord ? inner.from : context.pos,\n validFor: Identifier\n };\n}\nfunction pathFor(read, member, name) {\n var _a;\n let path = [];\n for (;;) {\n let obj = member.firstChild, prop;\n if ((obj === null || obj === void 0 ? void 0 : obj.name) == \"VariableName\") {\n path.push(read(obj));\n return { path: path.reverse(), name };\n }\n else if ((obj === null || obj === void 0 ? void 0 : obj.name) == \"MemberExpression\" && ((_a = (prop = obj.lastChild)) === null || _a === void 0 ? void 0 : _a.name) == \"PropertyName\") {\n path.push(read(prop));\n member = obj;\n }\n else {\n return null;\n }\n }\n}\n/**\nHelper function for defining JavaScript completion sources. It\nreturns the completable name and object path for a completion\ncontext, or null if no name/property completion should happen at\nthat position. For example, when completing after `a.b.c` it will\nreturn `{path: [\"a\", \"b\"], name: \"c\"}`. When completing after `x`\nit will return `{path: [], name: \"x\"}`. When not in a property or\nname, it will return null if `context.explicit` is false, and\n`{path: [], name: \"\"}` otherwise.\n*/\nfunction completionPath(context) {\n let read = (node) => context.state.doc.sliceString(node.from, node.to);\n let inner = syntaxTree(context.state).resolveInner(context.pos, -1);\n if (inner.name == \"PropertyName\") {\n return pathFor(read, inner.parent, read(inner));\n }\n else if ((inner.name == \".\" || inner.name == \"?.\") && inner.parent.name == \"MemberExpression\") {\n return pathFor(read, inner.parent, \"\");\n }\n else if (dontComplete.indexOf(inner.name) > -1) {\n return null;\n }\n else if (inner.name == \"VariableName\" || inner.to - inner.from < 20 && Identifier.test(read(inner))) {\n return { path: [], name: read(inner) };\n }\n else if (inner.name == \"MemberExpression\") {\n return pathFor(read, inner, \"\");\n }\n else {\n return context.explicit ? { path: [], name: \"\" } : null;\n }\n}\nfunction enumeratePropertyCompletions(obj, top) {\n let options = [], seen = new Set;\n for (let depth = 0;; depth++) {\n for (let name of (Object.getOwnPropertyNames || Object.keys)(obj)) {\n if (!/^[a-zA-Z_$\\xaa-\\uffdc][\\w$\\xaa-\\uffdc]*$/.test(name) || seen.has(name))\n continue;\n seen.add(name);\n let value;\n try {\n value = obj[name];\n }\n catch (_) {\n continue;\n }\n options.push({\n label: name,\n type: typeof value == \"function\" ? (/^[A-Z]/.test(name) ? \"class\" : top ? \"function\" : \"method\")\n : top ? \"variable\" : \"property\",\n boost: -depth\n });\n }\n let next = Object.getPrototypeOf(obj);\n if (!next)\n return options;\n obj = next;\n }\n}\n/**\nDefines a [completion source](https://codemirror.net/6/docs/ref/#autocomplete.CompletionSource) that\ncompletes from the given scope object (for example `globalThis`).\nWill enter properties of the object when completing properties on\na directly-named path.\n*/\nfunction scopeCompletionSource(scope) {\n let cache = new Map;\n return (context) => {\n let path = completionPath(context);\n if (!path)\n return null;\n let target = scope;\n for (let step of path.path) {\n target = target[step];\n if (!target)\n return null;\n }\n let options = cache.get(target);\n if (!options)\n cache.set(target, options = enumeratePropertyCompletions(target, !path.path.length));\n return {\n from: context.pos - path.name.length,\n options,\n validFor: Identifier\n };\n };\n}\n\n/**\nA language provider based on the [Lezer JavaScript\nparser](https://github.com/lezer-parser/javascript), extended with\nhighlighting and indentation information.\n*/\nconst javascriptLanguage = /*@__PURE__*/LRLanguage.define({\n name: \"javascript\",\n parser: /*@__PURE__*/parser.configure({\n props: [\n /*@__PURE__*/indentNodeProp.add({\n IfStatement: /*@__PURE__*/continuedIndent({ except: /^\\s*({|else\\b)/ }),\n TryStatement: /*@__PURE__*/continuedIndent({ except: /^\\s*({|catch\\b|finally\\b)/ }),\n LabeledStatement: flatIndent,\n SwitchBody: context => {\n let after = context.textAfter, closed = /^\\s*\\}/.test(after), isCase = /^\\s*(case|default)\\b/.test(after);\n return context.baseIndent + (closed ? 0 : isCase ? 1 : 2) * context.unit;\n },\n Block: /*@__PURE__*/delimitedIndent({ closing: \"}\" }),\n ArrowFunction: cx => cx.baseIndent + cx.unit,\n \"TemplateString BlockComment\": () => null,\n \"Statement Property\": /*@__PURE__*/continuedIndent({ except: /^{/ }),\n JSXElement(context) {\n let closed = /^\\s*<\\//.test(context.textAfter);\n return context.lineIndent(context.node.from) + (closed ? 0 : context.unit);\n },\n JSXEscape(context) {\n let closed = /\\s*\\}/.test(context.textAfter);\n return context.lineIndent(context.node.from) + (closed ? 0 : context.unit);\n },\n \"JSXOpenTag JSXSelfClosingTag\"(context) {\n return context.column(context.node.from) + context.unit;\n }\n }),\n /*@__PURE__*/foldNodeProp.add({\n \"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType\": foldInside,\n BlockComment(tree) { return { from: tree.from + 2, to: tree.to - 2 }; }\n })\n ]\n }),\n languageData: {\n closeBrackets: { brackets: [\"(\", \"[\", \"{\", \"'\", '\"', \"`\"] },\n commentTokens: { line: \"//\", block: { open: \"/*\", close: \"*/\" } },\n indentOnInput: /^\\s*(?:case |default:|\\{|\\}|<\\/)$/,\n wordChars: \"$\"\n }\n});\nconst jsxSublanguage = {\n test: node => /^JSX/.test(node.name),\n facet: /*@__PURE__*/defineLanguageFacet({ commentTokens: { block: { open: \"{/*\", close: \"*/}\" } } })\n};\n/**\nA language provider for TypeScript.\n*/\nconst typescriptLanguage = /*@__PURE__*/javascriptLanguage.configure({ dialect: \"ts\" }, \"typescript\");\n/**\nLanguage provider for JSX.\n*/\nconst jsxLanguage = /*@__PURE__*/javascriptLanguage.configure({\n dialect: \"jsx\",\n props: [/*@__PURE__*/sublanguageProp.add(n => n.isTop ? [jsxSublanguage] : undefined)]\n});\n/**\nLanguage provider for JSX + TypeScript.\n*/\nconst tsxLanguage = /*@__PURE__*/javascriptLanguage.configure({\n dialect: \"jsx ts\",\n props: [/*@__PURE__*/sublanguageProp.add(n => n.isTop ? [jsxSublanguage] : undefined)]\n}, \"typescript\");\nlet kwCompletion = (name) => ({ label: name, type: \"keyword\" });\nconst keywords = /*@__PURE__*/\"break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield\".split(\" \").map(kwCompletion);\nconst typescriptKeywords = /*@__PURE__*/keywords.concat(/*@__PURE__*/[\"declare\", \"implements\", \"private\", \"protected\", \"public\"].map(kwCompletion));\n/**\nJavaScript support. Includes [snippet](https://codemirror.net/6/docs/ref/#lang-javascript.snippets)\nand local variable completion.\n*/\nfunction javascript(config = {}) {\n let lang = config.jsx ? (config.typescript ? tsxLanguage : jsxLanguage)\n : config.typescript ? typescriptLanguage : javascriptLanguage;\n let completions = config.typescript ? typescriptSnippets.concat(typescriptKeywords) : snippets.concat(keywords);\n return new LanguageSupport(lang, [\n javascriptLanguage.data.of({\n autocomplete: ifNotIn(dontComplete, completeFromList(completions))\n }),\n javascriptLanguage.data.of({\n autocomplete: localCompletionSource\n }),\n config.jsx ? autoCloseTags : [],\n ]);\n}\nfunction findOpenTag(node) {\n for (;;) {\n if (node.name == \"JSXOpenTag\" || node.name == \"JSXSelfClosingTag\" || node.name == \"JSXFragmentTag\")\n return node;\n if (node.name == \"JSXEscape\" || !node.parent)\n return null;\n node = node.parent;\n }\n}\nfunction elementName(doc, tree, max = doc.length) {\n for (let ch = tree === null || tree === void 0 ? void 0 : tree.firstChild; ch; ch = ch.nextSibling) {\n if (ch.name == \"JSXIdentifier\" || ch.name == \"JSXBuiltin\" || ch.name == \"JSXNamespacedName\" ||\n ch.name == \"JSXMemberExpression\")\n return doc.sliceString(ch.from, Math.min(ch.to, max));\n }\n return \"\";\n}\nconst android = typeof navigator == \"object\" && /*@__PURE__*//Android\\b/.test(navigator.userAgent);\n/**\nExtension that will automatically insert JSX close tags when a `>` or\n`/` is typed.\n*/\nconst autoCloseTags = /*@__PURE__*/EditorView.inputHandler.of((view, from, to, text, defaultInsert) => {\n if ((android ? view.composing : view.compositionStarted) || view.state.readOnly ||\n from != to || (text != \">\" && text != \"/\") ||\n !javascriptLanguage.isActiveAt(view.state, from, -1))\n return false;\n let base = defaultInsert(), { state } = base;\n let closeTags = state.changeByRange(range => {\n var _a;\n let { head } = range, around = syntaxTree(state).resolveInner(head - 1, -1), name;\n if (around.name == \"JSXStartTag\")\n around = around.parent;\n if (state.doc.sliceString(head - 1, head) != text || around.name == \"JSXAttributeValue\" && around.to > head) ;\n else if (text == \">\" && around.name == \"JSXFragmentTag\") {\n return { range, changes: { from: head, insert: `` } };\n }\n else if (text == \"/\" && around.name == \"JSXStartCloseTag\") {\n let empty = around.parent, base = empty.parent;\n if (base && empty.from == head - 2 &&\n ((name = elementName(state.doc, base.firstChild, head)) || ((_a = base.firstChild) === null || _a === void 0 ? void 0 : _a.name) == \"JSXFragmentTag\")) {\n let insert = `${name}>`;\n return { range: EditorSelection.cursor(head + insert.length, -1), changes: { from: head, insert } };\n }\n }\n else if (text == \">\") {\n let openTag = findOpenTag(around);\n if (openTag && openTag.name == \"JSXOpenTag\" &&\n !/^\\/?>|^<\\//.test(state.doc.sliceString(head, head + 2)) &&\n (name = elementName(state.doc, openTag, head)))\n return { range, changes: { from: head, insert: `` } };\n }\n return { range };\n });\n if (closeTags.changes.empty)\n return false;\n view.dispatch([\n base,\n state.update(closeTags, { userEvent: \"input.complete\", scrollIntoView: true })\n ]);\n return true;\n});\n\n/**\nConnects an [ESLint](https://eslint.org/) linter to CodeMirror's\n[lint](https://codemirror.net/6/docs/ref/#lint) integration. `eslint` should be an instance of the\n[`Linter`](https://eslint.org/docs/developer-guide/nodejs-api#linter)\nclass, and `config` an optional ESLint configuration. The return\nvalue of this function can be passed to [`linter`](https://codemirror.net/6/docs/ref/#lint.linter)\nto create a JavaScript linting extension.\n\nNote that ESLint targets node, and is tricky to run in the\nbrowser. The\n[eslint-linter-browserify](https://github.com/UziTech/eslint-linter-browserify)\npackage may help with that (see\n[example](https://github.com/UziTech/eslint-linter-browserify/blob/master/example/script.js)).\n*/\nfunction esLint(eslint, config) {\n if (!config) {\n config = {\n parserOptions: { ecmaVersion: 2019, sourceType: \"module\" },\n env: { browser: true, node: true, es6: true, es2015: true, es2017: true, es2020: true },\n rules: {}\n };\n eslint.getRules().forEach((desc, name) => {\n if (desc.meta.docs.recommended)\n config.rules[name] = 2;\n });\n }\n return (view) => {\n let { state } = view, found = [];\n for (let { from, to } of javascriptLanguage.findRegions(state)) {\n let fromLine = state.doc.lineAt(from), offset = { line: fromLine.number - 1, col: from - fromLine.from, pos: from };\n for (let d of eslint.verify(state.sliceDoc(from, to), config))\n found.push(translateDiagnostic(d, state.doc, offset));\n }\n return found;\n };\n}\nfunction mapPos(line, col, doc, offset) {\n return doc.line(line + offset.line).from + col + (line == 1 ? offset.col - 1 : -1);\n}\nfunction translateDiagnostic(input, doc, offset) {\n let start = mapPos(input.line, input.column, doc, offset);\n let result = {\n from: start,\n to: input.endLine != null && input.endColumn != 1 ? mapPos(input.endLine, input.endColumn, doc, offset) : start,\n message: input.message,\n source: input.ruleId ? \"eslint:\" + input.ruleId : \"eslint\",\n severity: input.severity == 1 ? \"warning\" : \"error\",\n };\n if (input.fix) {\n let { range, text } = input.fix, from = range[0] + offset.pos - start, to = range[1] + offset.pos - start;\n result.actions = [{\n name: \"fix\",\n apply(view, start) {\n view.dispatch({ changes: { from: start + from, to: start + to, insert: text }, scrollIntoView: true });\n }\n }];\n }\n return result;\n}\n\nexport { autoCloseTags, completionPath, esLint, javascript, javascriptLanguage, jsxLanguage, localCompletionSource, scopeCompletionSource, snippets, tsxLanguage, typescriptLanguage, typescriptSnippets };\n"],"names":["space","trackNewline","start","shift","context","term","strict","insertSemicolon","input","stack","next","acceptToken","contextual","fallback","noSemicolon","after","indexOf","peek","operatorToken","advance","mayPostfix","canShift","identifierChar","ch","jsx","dialectEnabled","back","i","charCodeAt","jsHighlight","modifier","controlKeyword","operatorKeyword","definitionKeyword","moduleKeyword","keyword","TemplateString","special","string","super","atom","BooleanLiteral","bool","this","self","null","Star","VariableName","variableName","function","VariableDefinition","definition","Label","labelName","PropertyName","propertyName","PrivatePropertyName","className","PropertyDefinition","PrivatePropertyDefinition","UpdateOp","updateOperator","lineComment","BlockComment","blockComment","Number","number","String","Escape","escape","ArithOp","arithmeticOperator","LogicOp","logicOperator","BitOp","bitwiseOperator","CompareOp","compareOperator","RegExp","regexp","Equals","definitionOperator","Arrow","punctuation","paren","squareBracket","brace","derefOperator","separator","meta","TypeName","typeName","TypeDefinition","JSXAttributeValue","attributeValue","JSXText","content","angleBracket","tagName","attributeName","standard","spec_identifier","__proto__","export","as","from","default","async","extends","true","false","void","typeof","new","delete","yield","await","class","public","private","protected","readonly","instanceof","satisfies","in","const","import","keyof","unique","infer","is","abstract","implements","type","let","var","using","interface","enum","namespace","module","declare","global","for","of","while","with","do","if","else","switch","case","try","catch","finally","return","throw","break","continue","debugger","spec_word","get","set","static","override","accessor","spec_LessThan","parser","deserialize","version","states","stateData","goto","nodeNames","maxTerm","nodeProps","propSources","skippedNodes","repeatNodeCount","tokenData","tokenizers","topRules","dialects","ts","dynamicPrecedences","specialized","value","tokenPrec","snippets","label","detail","typescriptSnippets","concat","cache","ScopeNodes","Set","defID","node","def","id","getChild","functionContext","gatherCompletions","FunctionDeclaration","ClassDeclaration","ClassExpression","EnumDeclaration","TypeAliasDeclaration","NamespaceDeclaration","matchContext","getScope","doc","cached","completions","top","name","sliceString","to","push","cursor","IncludeAnonymous","iterate","gather","has","c","Identifier","dontComplete","localCompletionSource","inner","state","resolveInner","pos","isWord","test","sliceDoc","explicit","options","parent","validFor","pathFor","read","member","_a","path","prop","obj","firstChild","reverse","lastChild","completionPath","scopeCompletionSource","scope","Map","target","step","seen","depth","Object","getOwnPropertyNames","keys","add","_","boost","getPrototypeOf","enumeratePropertyCompletions","length","javascriptLanguage","define","configure","props","IfStatement","except","TryStatement","LabeledStatement","SwitchBody","textAfter","closed","isCase","baseIndent","unit","Block","closing","ArrowFunction","cx","JSXElement","lineIndent","JSXEscape","column","tree","languageData","closeBrackets","brackets","commentTokens","line","block","open","close","indentOnInput","wordChars","jsxSublanguage","facet","typescriptLanguage","dialect","jsxLanguage","n","isTop","undefined","tsxLanguage","kwCompletion","keywords","split","map","typescriptKeywords","javascript","config","lang","typescript","data","autocomplete","autoCloseTags","elementName","max","nextSibling","Math","min","android","navigator","userAgent","inputHandler","view","text","defaultInsert","composing","compositionStarted","readOnly","isActiveAt","base","closeTags","changeByRange","range","head","around","changes","insert","empty","openTag","findOpenTag","dispatch","update","userEvent","scrollIntoView","esLint","eslint","parserOptions","ecmaVersion","sourceType","env","browser","es6","es2015","es2017","es2020","rules","getRules","forEach","desc","docs","recommended","found","findRegions","fromLine","lineAt","offset","col","d","verify","translateDiagnostic","mapPos","result","endLine","endColumn","message","source","ruleId","severity","fix","actions","apply"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/2293.index.js b/pr-preview/pr-770/2293.index.js new file mode 100644 index 00000000..0c5736e1 --- /dev/null +++ b/pr-preview/pr-770/2293.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[2293],{2293:(i,l,e)=>{function a(i){var l=[],e="",a={".abort":"builtin",".align":"builtin",".altmacro":"builtin",".ascii":"builtin",".asciz":"builtin",".balign":"builtin",".balignw":"builtin",".balignl":"builtin",".bundle_align_mode":"builtin",".bundle_lock":"builtin",".bundle_unlock":"builtin",".byte":"builtin",".cfi_startproc":"builtin",".comm":"builtin",".data":"builtin",".def":"builtin",".desc":"builtin",".dim":"builtin",".double":"builtin",".eject":"builtin",".else":"builtin",".elseif":"builtin",".end":"builtin",".endef":"builtin",".endfunc":"builtin",".endif":"builtin",".equ":"builtin",".equiv":"builtin",".eqv":"builtin",".err":"builtin",".error":"builtin",".exitm":"builtin",".extern":"builtin",".fail":"builtin",".file":"builtin",".fill":"builtin",".float":"builtin",".func":"builtin",".global":"builtin",".gnu_attribute":"builtin",".hidden":"builtin",".hword":"builtin",".ident":"builtin",".if":"builtin",".incbin":"builtin",".include":"builtin",".int":"builtin",".internal":"builtin",".irp":"builtin",".irpc":"builtin",".lcomm":"builtin",".lflags":"builtin",".line":"builtin",".linkonce":"builtin",".list":"builtin",".ln":"builtin",".loc":"builtin",".loc_mark_labels":"builtin",".local":"builtin",".long":"builtin",".macro":"builtin",".mri":"builtin",".noaltmacro":"builtin",".nolist":"builtin",".octa":"builtin",".offset":"builtin",".org":"builtin",".p2align":"builtin",".popsection":"builtin",".previous":"builtin",".print":"builtin",".protected":"builtin",".psize":"builtin",".purgem":"builtin",".pushsection":"builtin",".quad":"builtin",".reloc":"builtin",".rept":"builtin",".sbttl":"builtin",".scl":"builtin",".section":"builtin",".set":"builtin",".short":"builtin",".single":"builtin",".size":"builtin",".skip":"builtin",".sleb128":"builtin",".space":"builtin",".stab":"builtin",".string":"builtin",".struct":"builtin",".subsection":"builtin",".symver":"builtin",".tag":"builtin",".text":"builtin",".title":"builtin",".type":"builtin",".uleb128":"builtin",".val":"builtin",".version":"builtin",".vtable_entry":"builtin",".vtable_inherit":"builtin",".warning":"builtin",".weak":"builtin",".weakref":"builtin",".word":"builtin"},t={};function n(i,l){for(var e,a=!1;null!=(e=i.next());){if("/"===e&&a){l.tokenize=null;break}a="*"===e}return"comment"}return"x86"===i?(e="#",t.al="variable",t.ah="variable",t.ax="variable",t.eax="variableName.special",t.rax="variableName.special",t.bl="variable",t.bh="variable",t.bx="variable",t.ebx="variableName.special",t.rbx="variableName.special",t.cl="variable",t.ch="variable",t.cx="variable",t.ecx="variableName.special",t.rcx="variableName.special",t.dl="variable",t.dh="variable",t.dx="variable",t.edx="variableName.special",t.rdx="variableName.special",t.si="variable",t.esi="variableName.special",t.rsi="variableName.special",t.di="variable",t.edi="variableName.special",t.rdi="variableName.special",t.sp="variable",t.esp="variableName.special",t.rsp="variableName.special",t.bp="variable",t.ebp="variableName.special",t.rbp="variableName.special",t.ip="variable",t.eip="variableName.special",t.rip="variableName.special",t.cs="keyword",t.ds="keyword",t.ss="keyword",t.es="keyword",t.fs="keyword",t.gs="keyword"):"arm"!==i&&"armv6"!==i||(e="@",a.syntax="builtin",t.r0="variable",t.r1="variable",t.r2="variable",t.r3="variable",t.r4="variable",t.r5="variable",t.r6="variable",t.r7="variable",t.r8="variable",t.r9="variable",t.r10="variable",t.r11="variable",t.r12="variable",t.sp="variableName.special",t.lr="variableName.special",t.pc="variableName.special",t.r13=t.sp,t.r14=t.lr,t.r15=t.pc,l.push((function(i,l){if("#"===i)return l.eatWhile(/\w/),"number"}))),{name:"gas",startState:function(){return{tokenize:null}},token:function(i,b){if(b.tokenize)return b.tokenize(i,b);if(i.eatSpace())return null;var r,u,s=i.next();if("/"===s&&i.eat("*"))return b.tokenize=n,n(i,b);if(s===e)return i.skipToEnd(),"comment";if('"'===s)return function(i){for(var l,e=!1;null!=(l=i.next());){if('"'===l&&!e)return!1;e=!e&&"\\"===l}}(i),"string";if("."===s)return i.eatWhile(/\w/),u=i.current().toLowerCase(),(r=a[u])||null;if("="===s)return i.eatWhile(/\w/),"tag";if("{"===s)return"bracket";if("}"===s)return"bracket";if(/\d/.test(s))return"0"===s&&i.eat("x")?(i.eatWhile(/[0-9a-fA-F]/),"number"):(i.eatWhile(/\d/),"number");if(/\w/.test(s))return i.eatWhile(/\w/),i.eat(":")?"tag":(u=i.current().toLowerCase(),(r=t[u])||null);for(var c=0;ct,gasArm:()=>n});const t=a("x86"),n=a("arm")}}]); +//# sourceMappingURL=2293.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/2293.index.js.map b/pr-preview/pr-770/2293.index.js.map new file mode 100644 index 00000000..348e1e69 --- /dev/null +++ b/pr-preview/pr-770/2293.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"2293.index.js","mappings":"8FAAA,SAASA,EAAMC,GAIb,IAAIC,EAAS,GAMTC,EAAyB,GAOzBC,EAAa,CACf,SAAW,UACX,SAAW,UACX,YAAc,UACd,SAAW,UACX,SAAW,UACX,UAAY,UACZ,WAAa,UACb,WAAa,UACb,qBAAuB,UACvB,eAAiB,UACjB,iBAAmB,UACnB,QAAU,UACV,iBAAmB,UACnB,QAAU,UACV,QAAU,UACV,OAAS,UACT,QAAU,UACV,OAAS,UACT,UAAY,UACZ,SAAW,UACX,QAAU,UACV,UAAY,UACZ,OAAS,UACT,SAAW,UACX,WAAa,UACb,SAAW,UACX,OAAS,UACT,SAAW,UACX,OAAS,UACT,OAAS,UACT,SAAW,UACX,SAAW,UACX,UAAY,UACZ,QAAU,UACV,QAAU,UACV,QAAU,UACV,SAAW,UACX,QAAU,UACV,UAAY,UACZ,iBAAmB,UACnB,UAAY,UACZ,SAAW,UACX,SAAW,UACX,MAAQ,UACR,UAAY,UACZ,WAAa,UACb,OAAS,UACT,YAAc,UACd,OAAS,UACT,QAAU,UACV,SAAW,UACX,UAAY,UACZ,QAAU,UACV,YAAc,UACd,QAAU,UACV,MAAQ,UACR,OAAS,UACT,mBAAqB,UACrB,SAAW,UACX,QAAU,UACV,SAAW,UACX,OAAS,UACT,cAAgB,UAChB,UAAY,UACZ,QAAU,UACV,UAAY,UACZ,OAAS,UACT,WAAa,UACb,cAAgB,UAChB,YAAc,UACd,SAAW,UACX,aAAe,UACf,SAAW,UACX,UAAY,UACZ,eAAiB,UACjB,QAAU,UACV,SAAW,UACX,QAAU,UACV,SAAW,UACX,OAAS,UACT,WAAa,UACb,OAAS,UACT,SAAW,UACX,UAAY,UACZ,QAAU,UACV,QAAU,UACV,WAAa,UACb,SAAW,UACX,QAAU,UACV,UAAY,UACZ,UAAY,UACZ,cAAgB,UAChB,UAAY,UACZ,OAAS,UACT,QAAU,UACV,SAAW,UACX,QAAU,UACV,WAAa,UACb,O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A,GAAoB,OAATvE,CACxB,CAEF,CA8CMwE,CAAmB5E,GACZ,SAGT,GAAW,MAAPE,EAIF,OAHAF,EAAOkE,SAAS,MAChBM,EAAMxE,EAAO6E,UAAUC,eACvBP,EAAQ1E,EAAW2E,KACH,KAGlB,GAAW,MAAPtE,EAEF,OADAF,EAAOkE,SAAS,MACT,MAGT,GAAW,MAAPhE,EACF,MAAO,UAGT,GAAW,MAAPA,EACF,MAAO,UAGT,GAAI,KAAK6E,KAAK7E,GACZ,MAAW,MAAPA,GAAcF,EAAOyE,IAAI,MAC3BzE,EAAOkE,SAAS,eACT,WAETlE,EAAOkE,SAAS,MACT,UAGT,GAAI,KAAKa,KAAK7E,GAEZ,OADAF,EAAOkE,SAAS,MACZlE,EAAOyE,IAAI,KACN,OAETD,EAAMxE,EAAO6E,UAAUC,eACvBP,EAAQzE,EAAU0E,KACF,MAGlB,IAAK,IAAIQ,EAAI,EAAGA,EAAIrF,EAAOsF,OAAQD,IAEjC,GADAT,EAAQ5E,EAAOqF,GAAG9E,EAAIF,EAAQC,GAE5B,OAAOsE,CAGb,EAEAW,aAAc,CACZC,cAAe,CACbC,KAAMxF,EACNyF,MAAO,CAACC,KAAM,KAAMC,MAAO,QAInC,C,uCAEO,MAAMC,EAAM/F,EAAM,OACZgG,EAAShG,EAAM,M","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/gas.js"],"sourcesContent":["function mkGas(arch) {\n // If an architecture is specified, its initialization function may\n // populate this array with custom parsing functions which will be\n // tried in the event that the standard functions do not find a match.\n var custom = [];\n\n // The symbol used to start a line comment changes based on the target\n // architecture.\n // If no architecture is pased in \"parserConfig\" then only multiline\n // comments will have syntax support.\n var lineCommentStartSymbol = \"\";\n\n // These directives are architecture independent.\n // Machine specific directives should go in their respective\n // architecture initialization function.\n // Reference:\n // http://sourceware.org/binutils/docs/as/Pseudo-Ops.html#Pseudo-Ops\n var directives = {\n \".abort\" : \"builtin\",\n \".align\" : \"builtin\",\n \".altmacro\" : \"builtin\",\n \".ascii\" : \"builtin\",\n \".asciz\" : \"builtin\",\n \".balign\" : \"builtin\",\n \".balignw\" : \"builtin\",\n \".balignl\" : \"builtin\",\n \".bundle_align_mode\" : \"builtin\",\n \".bundle_lock\" : \"builtin\",\n \".bundle_unlock\" : \"builtin\",\n \".byte\" : \"builtin\",\n \".cfi_startproc\" : \"builtin\",\n \".comm\" : \"builtin\",\n \".data\" : \"builtin\",\n \".def\" : \"builtin\",\n \".desc\" : \"builtin\",\n \".dim\" : \"builtin\",\n \".double\" : \"builtin\",\n \".eject\" : \"builtin\",\n \".else\" : \"builtin\",\n \".elseif\" : \"builtin\",\n \".end\" : \"builtin\",\n \".endef\" : \"builtin\",\n \".endfunc\" : \"builtin\",\n \".endif\" : \"builtin\",\n \".equ\" : \"builtin\",\n \".equiv\" : \"builtin\",\n \".eqv\" : \"builtin\",\n \".err\" : \"builtin\",\n \".error\" : \"builtin\",\n \".exitm\" : \"builtin\",\n \".extern\" : \"builtin\",\n \".fail\" : \"builtin\",\n \".file\" : \"builtin\",\n \".fill\" : \"builtin\",\n \".float\" : \"builtin\",\n \".func\" : \"builtin\",\n \".global\" : \"builtin\",\n \".gnu_attribute\" : \"builtin\",\n \".hidden\" : \"builtin\",\n \".hword\" : \"builtin\",\n \".ident\" : \"builtin\",\n \".if\" : \"builtin\",\n \".incbin\" : \"builtin\",\n \".include\" : \"builtin\",\n \".int\" : \"builtin\",\n \".internal\" : \"builtin\",\n \".irp\" : \"builtin\",\n \".irpc\" : \"builtin\",\n \".lcomm\" : \"builtin\",\n \".lflags\" : \"builtin\",\n \".line\" : \"builtin\",\n \".linkonce\" : \"builtin\",\n \".list\" : \"builtin\",\n \".ln\" : \"builtin\",\n \".loc\" : \"builtin\",\n \".loc_mark_labels\" : \"builtin\",\n \".local\" : \"builtin\",\n \".long\" : \"builtin\",\n \".macro\" : \"builtin\",\n \".mri\" : \"builtin\",\n \".noaltmacro\" : \"builtin\",\n \".nolist\" : \"builtin\",\n \".octa\" : \"builtin\",\n \".offset\" : \"builtin\",\n \".org\" : \"builtin\",\n \".p2align\" : \"builtin\",\n \".popsection\" : \"builtin\",\n \".previous\" : \"builtin\",\n \".print\" : \"builtin\",\n \".protected\" : \"builtin\",\n \".psize\" : \"builtin\",\n \".purgem\" : \"builtin\",\n \".pushsection\" : \"builtin\",\n \".quad\" : \"builtin\",\n \".reloc\" : \"builtin\",\n \".rept\" : \"builtin\",\n \".sbttl\" : \"builtin\",\n \".scl\" : \"builtin\",\n \".section\" : \"builtin\",\n \".set\" : \"builtin\",\n \".short\" : \"builtin\",\n \".single\" : \"builtin\",\n \".size\" : \"builtin\",\n \".skip\" : \"builtin\",\n \".sleb128\" : \"builtin\",\n \".space\" : \"builtin\",\n \".stab\" : \"builtin\",\n \".string\" : \"builtin\",\n \".struct\" : \"builtin\",\n \".subsection\" : \"builtin\",\n \".symver\" : \"builtin\",\n \".tag\" : \"builtin\",\n \".text\" : \"builtin\",\n \".title\" : \"builtin\",\n \".type\" : \"builtin\",\n \".uleb128\" : \"builtin\",\n \".val\" : \"builtin\",\n \".version\" : \"builtin\",\n \".vtable_entry\" : \"builtin\",\n \".vtable_inherit\" : \"builtin\",\n \".warning\" : \"builtin\",\n \".weak\" : \"builtin\",\n \".weakref\" : \"builtin\",\n \".word\" : \"builtin\"\n };\n\n var registers = {};\n\n function x86() {\n lineCommentStartSymbol = \"#\";\n\n registers.al = \"variable\";\n registers.ah = \"variable\";\n registers.ax = \"variable\";\n registers.eax = \"variableName.special\";\n registers.rax = \"variableName.special\";\n\n registers.bl = \"variable\";\n registers.bh = \"variable\";\n registers.bx = \"variable\";\n registers.ebx = \"variableName.special\";\n registers.rbx = \"variableName.special\";\n\n registers.cl = \"variable\";\n registers.ch = \"variable\";\n registers.cx = \"variable\";\n registers.ecx = \"variableName.special\";\n registers.rcx = \"variableName.special\";\n\n registers.dl = \"variable\";\n registers.dh = \"variable\";\n registers.dx = \"variable\";\n registers.edx = \"variableName.special\";\n registers.rdx = \"variableName.special\";\n\n registers.si = \"variable\";\n registers.esi = \"variableName.special\";\n registers.rsi = \"variableName.special\";\n\n registers.di = \"variable\";\n registers.edi = \"variableName.special\";\n registers.rdi = \"variableName.special\";\n\n registers.sp = \"variable\";\n registers.esp = \"variableName.special\";\n registers.rsp = \"variableName.special\";\n\n registers.bp = \"variable\";\n registers.ebp = \"variableName.special\";\n registers.rbp = \"variableName.special\";\n\n registers.ip = \"variable\";\n registers.eip = \"variableName.special\";\n registers.rip = \"variableName.special\";\n\n registers.cs = \"keyword\";\n registers.ds = \"keyword\";\n registers.ss = \"keyword\";\n registers.es = \"keyword\";\n registers.fs = \"keyword\";\n registers.gs = \"keyword\";\n }\n\n function armv6() {\n // Reference:\n // http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001l/QRC0001_UAL.pdf\n // http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf\n lineCommentStartSymbol = \"@\";\n directives.syntax = \"builtin\";\n\n registers.r0 = \"variable\";\n registers.r1 = \"variable\";\n registers.r2 = \"variable\";\n registers.r3 = \"variable\";\n registers.r4 = \"variable\";\n registers.r5 = \"variable\";\n registers.r6 = \"variable\";\n registers.r7 = \"variable\";\n registers.r8 = \"variable\";\n registers.r9 = \"variable\";\n registers.r10 = \"variable\";\n registers.r11 = \"variable\";\n registers.r12 = \"variable\";\n\n registers.sp = \"variableName.special\";\n registers.lr = \"variableName.special\";\n registers.pc = \"variableName.special\";\n registers.r13 = registers.sp;\n registers.r14 = registers.lr;\n registers.r15 = registers.pc;\n\n custom.push(function(ch, stream) {\n if (ch === '#') {\n stream.eatWhile(/\\w/);\n return \"number\";\n }\n });\n }\n\n if (arch === \"x86\") {\n x86();\n } else if (arch === \"arm\" || arch === \"armv6\") {\n armv6();\n }\n\n function nextUntilUnescaped(stream, end) {\n var escaped = false, next;\n while ((next = stream.next()) != null) {\n if (next === end && !escaped) {\n return false;\n }\n escaped = !escaped && next === \"\\\\\";\n }\n return escaped;\n }\n\n function clikeComment(stream, state) {\n var maybeEnd = false, ch;\n while ((ch = stream.next()) != null) {\n if (ch === \"/\" && maybeEnd) {\n state.tokenize = null;\n break;\n }\n maybeEnd = (ch === \"*\");\n }\n return \"comment\";\n }\n\n return {\n name: \"gas\",\n startState: function() {\n return {\n tokenize: null\n };\n },\n\n token: function(stream, state) {\n if (state.tokenize) {\n return state.tokenize(stream, state);\n }\n\n if (stream.eatSpace()) {\n return null;\n }\n\n var style, cur, ch = stream.next();\n\n if (ch === \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = clikeComment;\n return clikeComment(stream, state);\n }\n }\n\n if (ch === lineCommentStartSymbol) {\n stream.skipToEnd();\n return \"comment\";\n }\n\n if (ch === '\"') {\n nextUntilUnescaped(stream, '\"');\n return \"string\";\n }\n\n if (ch === '.') {\n stream.eatWhile(/\\w/);\n cur = stream.current().toLowerCase();\n style = directives[cur];\n return style || null;\n }\n\n if (ch === '=') {\n stream.eatWhile(/\\w/);\n return \"tag\";\n }\n\n if (ch === '{') {\n return \"bracket\";\n }\n\n if (ch === '}') {\n return \"bracket\";\n }\n\n if (/\\d/.test(ch)) {\n if (ch === \"0\" && stream.eat(\"x\")) {\n stream.eatWhile(/[0-9a-fA-F]/);\n return \"number\";\n }\n stream.eatWhile(/\\d/);\n return \"number\";\n }\n\n if (/\\w/.test(ch)) {\n stream.eatWhile(/\\w/);\n if (stream.eat(\":\")) {\n return 'tag';\n }\n cur = stream.current().toLowerCase();\n style = registers[cur];\n return style || null;\n }\n\n for (var i = 0; i < custom.length; i++) {\n style = custom[i](ch, stream, state);\n if (style) {\n return style;\n }\n }\n },\n\n languageData: {\n commentTokens: {\n line: lineCommentStartSymbol,\n block: {open: \"/*\", close: \"*/\"}\n }\n }\n };\n};\n\nexport const gas = mkGas(\"x86\")\nexport const gasArm = mkGas(\"arm\")\n"],"names":["mkGas","arch","custom","lineCommentStartSymbol","directives","registers","clikeComment","stream","state","ch","maybeEnd","next","tokenize","al","ah","ax","eax","rax","bl","bh","bx","ebx","rbx","cl","cx","ecx","rcx","dl","dh","dx","edx","rdx","si","esi","rsi","di","edi","rdi","sp","esp","rsp","bp","ebp","rbp","ip","eip","rip","cs","ds","ss","es","fs","gs","syntax","r0","r1","r2","r3","r4","r5","r6","r7","r8","r9","r10","r11","r12","lr","pc","r13","r14","r15","push","eatWhile","name","startState","token","eatSpace","style","cur","eat","skipToEnd","escaped","nextUntilUnescaped","current","toLowerCase","test","i","length","languageData","commentTokens","line","block","open","close","gas","gasArm"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/2376.index.js b/pr-preview/pr-770/2376.index.js new file mode 100644 index 00000000..becbbbb7 --- /dev/null +++ b/pr-preview/pr-770/2376.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[2376],{2376:(O,i,n)=>{n.r(i),n.d(i,{globalCompletion:()=>j,localCompletionSource:()=>b,python:()=>F,pythonLanguage:()=>A});var Q=n(3643),a=n(9913);const e=10,r=new Set([25,49,50,263,65,130,56,57,238,62,63,72,73,77,60,61,151,152,155,112]);function t(O){return O==e||13==O}function o(O){return O>=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102}const d=new Q.Lu(((O,i)=>{let n;if(O.next<0)O.acceptToken(199);else if(i.context.flags&s)t(O.next)&&O.acceptToken(198,1);else if(((n=O.peek(-1))<0||t(n))&&i.canShift(197)){let i=0;for(;32==O.next||9==O.next;)O.advance(),i++;O.next!=e&&13!=O.next&&35!=O.next||O.acceptToken(197,-i)}else t(O.next)&&O.acceptToken(196,1)}),{contextual:!0}),T=new Q.Lu(((O,i)=>{let n=i.context;if(n.flags)return;let Q=O.peek(-1);if(Q==e||13==Q){let i=0,Q=0;for(;;){if(32==O.next)i++;else{if(9!=O.next)break;i+=8-i%8}O.advance(),Q++}i!=n.indent&&O.next!=e&&13!=O.next&&35!=O.next&&(i[O,2|i]))),h=new Q.Aj({start:P,reduce:(O,i,n,Q)=>O.flags&s&&r.has(i)||(71==i||72==i)&&2&O.flags?O.parent:O,shift:(O,i,n,Q)=>194==i?new $(O,function(O){let i=0;for(let n=0;nO.hash}),g=new Q.Lu((O=>{for(let i=0;i<5;i++){if(O.next!="print".charCodeAt(i))return;O.advance()}if(!/\w/.test(String.fromCharCode(O.next)))for(let i=0;;i++){let n=O.peek(i);if(32!=n&&9!=n)return void(40!=n&&46!=n&&n!=e&&13!=n&&35!=n&&O.acceptToken(1))}})),c=new Q.Lu(((O,i)=>{let{flags:n}=i.context,Q=n&l?34:39,a=(n&S)>0,r=!(n&p),t=(n&q)>0,o=O.pos;for(;!(O.next<0);)if(t&&123==O.next){if(123!=O.peek(1)){if(O.pos==o)return void O.acceptToken(3,1);break}O.advance(2)}else{if(r&&92==O.next){if(O.pos==o){O.advance();let i=O.next;return i>=0&&(O.advance(),X(O,i)),void O.acceptToken(2)}break}if(O.next==Q&&(!a||O.peek(1)==Q&&O.peek(2)==Q)){if(O.pos==o)return void O.acceptToken(201,a?3:1);break}if(O.next==e){if(a)O.advance();else if(O.pos==o)return void O.acceptToken(201);break}O.advance()}O.pos>o&&O.acceptToken(200)}));function X(O,i){if(111==i)for(let i=0;i<2&&O.next>=48&&O.next<=55;i++)O.advance();else if(120==i)for(let i=0;i<2&&o(O.next);i++)O.advance();else if(117==i)for(let i=0;i<4&&o(O.next);i++)O.advance();else if(85==i)for(let i=0;i<8&&o(O.next);i++)O.advance();else if(78==i&&123==O.next){for(O.advance();O.next>=0&&125!=O.next&&39!=O.next&&34!=O.next&&O.next!=e;)O.advance();125==O.next&&O.advance()}}const y=(0,a.pn)({'async "*" "**" FormatConversion FormatSpec':a._A.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":a._A.controlKeyword,"in not and or is del":a._A.operatorKeyword,"from def class global nonlocal lambda":a._A.definitionKeyword,import:a._A.moduleKeyword,"with as print":a._A.keyword,Boolean:a._A.bool,None:a._A.null,VariableName:a._A.variableName,"CallExpression/VariableName":a._A.function(a._A.variableName),"FunctionDefinition/VariableName":a._A.function(a._A.definition(a._A.variableName)),"ClassDefinition/VariableName":a._A.definition(a._A.className),PropertyName:a._A.propertyName,"CallExpression/MemberExpression/PropertyName":a._A.function(a._A.propertyName),Comment:a._A.lineComment,Number:a._A.number,String:a._A.string,FormatString:a._A.special(a._A.string),Escape:a._A.escape,UpdateOp:a._A.updateOperator,"ArithOp!":a._A.arithmeticOperator,BitOp:a._A.bitwiseOperator,CompareOp:a._A.compareOperator,AssignOp:a._A.definitionOperator,Ellipsis:a._A.punctuation,At:a._A.meta,"( )":a._A.paren,"[ ]":a._A.squareBracket,"{ }":a._A.brace,".":a._A.derefOperator,", ;":a._A.separator}),W={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},z=Q.U1.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'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#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[g,T,d,c,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:O=>W[O]||-1}],tokenPrec:7652});var _=n(9587),f=n(9066),v=n(7213);const R=new f.RY,k=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function x(O){return(i,n,Q)=>{if(Q)return!1;let a=i.node.getChild("VariableName");return a&&n(a,O),!0}}const u={FunctionDefinition:x("function"),ClassDefinition:x("class"),ForStatement(O,i,n){if(n)for(let n=O.node.firstChild;n;n=n.nextSibling)if("VariableName"==n.name)i(n,"variable");else if("in"==n.name)break},ImportStatement(O,i){var n,Q;let{node:a}=O,e="from"==(null===(n=a.firstChild)||void 0===n?void 0:n.name);for(let O=a.getChild("import");O;O=O.nextSibling)"VariableName"==O.name&&"as"!=(null===(Q=O.nextSibling)||void 0===Q?void 0:Q.name)&&i(O,e?"variable":"namespace")},AssignStatement(O,i){for(let n=O.node.firstChild;n;n=n.nextSibling)if("VariableName"==n.name)i(n,"variable");else if(":"==n.name||"AssignOp"==n.name)break},ParamList(O,i){for(let n=null,Q=O.node.firstChild;Q;Q=Q.nextSibling)"VariableName"!=Q.name||n&&/\*|AssignOp/.test(n.name)||i(Q,"variable"),n=Q},CapturePattern:x("variable"),AsPattern:x("variable"),__proto__:null};function U(O,i){let n=R.get(i);if(n)return n;let Q=[],a=!0;function e(i,n){let a=O.sliceString(i.from,i.to);Q.push({label:a,type:n})}return i.cursor(f.Qj.IncludeAnonymous).iterate((i=>{if(i.name){let O=u[i.name];if(O&&O(i,e,a)||!a&&k.has(i.name))return!1;a=!1}else if(i.to-i.from>8192){for(let n of U(O,i.node))Q.push(n);return!1}})),R.set(i,Q),Q}const V=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,G=["String","FormatString","Comment","PropertyName"];function b(O){let i=(0,_.mv)(O.state).resolveInner(O.pos,-1);if(G.indexOf(i.name)>-1)return null;let n="VariableName"==i.name||i.to-i.from<20&&V.test(O.state.sliceDoc(i.from,i.to));if(!n&&!O.explicit)return null;let Q=[];for(let n=i;n;n=n.parent)k.has(n.name)&&(Q=Q.concat(U(O.state.doc,n)));return{options:Q,from:n?i.from:O.pos,validFor:V}}const w=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map((O=>({label:O,type:"constant"}))).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map((O=>({label:O,type:"type"})))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map((O=>({label:O,type:"class"})))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map((O=>({label:O,type:"function"})))),Z=[(0,v.Gw)("def ${name}(${params}):\n\t${}",{label:"def",detail:"function",type:"keyword"}),(0,v.Gw)("for ${name} in ${collection}:\n\t${}",{label:"for",detail:"loop",type:"keyword"}),(0,v.Gw)("while ${}:\n\t${}",{label:"while",detail:"loop",type:"keyword"}),(0,v.Gw)("try:\n\t${}\nexcept ${error}:\n\t${}",{label:"try",detail:"/ except block",type:"keyword"}),(0,v.Gw)("if ${}:\n\t\n",{label:"if",detail:"block",type:"keyword"}),(0,v.Gw)("if ${}:\n\t${}\nelse:\n\t${}",{label:"if",detail:"/ else block",type:"keyword"}),(0,v.Gw)("class ${name}:\n\tdef __init__(self, ${params}):\n\t\t\t${}",{label:"class",detail:"definition",type:"keyword"}),(0,v.Gw)("import ${module}",{label:"import",detail:"statement",type:"keyword"}),(0,v.Gw)("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],j=(0,v.Ar)(G,(0,v.et)(w.concat(Z)));function E(O){let{node:i,pos:n}=O,Q=O.lineIndent(n,-1),a=null;for(;;){let e=i.childBefore(n);if(!e)break;if("Comment"==e.name)n=e.from;else if("Body"==e.name)O.baseIndentFor(e)+O.unit<=Q&&(a=e),i=e;else{if(!e.type.is("Statement"))break;i=e}}return a}function Y(O,i){let n=O.baseIndentFor(i),Q=O.lineAt(O.pos,-1),a=Q.from+Q.text.length;return/^\s*($|#)/.test(Q.text)&&O.node.ton?null:n+O.unit}const A=_.bj.define({name:"python",parser:z.configure({props:[_.Oh.add({Body:O=>{var i;return null!==(i=Y(O,E(O)||O.node))&&void 0!==i?i:O.continue()},IfStatement:O=>/^\s*(else:|elif )/.test(O.textAfter)?O.baseIndent:O.continue(),"ForStatement WhileStatement":O=>/^\s*else:/.test(O.textAfter)?O.baseIndent:O.continue(),TryStatement:O=>/^\s*(except |finally:|else:)/.test(O.textAfter)?O.baseIndent:O.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":(0,_.Ay)({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":(0,_.Ay)({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":(0,_.Ay)({closing:"]"}),"String FormatString":()=>null,Script:O=>{var i;let n=E(O);return null!==(i=n&&Y(O,n))&&void 0!==i?i:O.continue()}}),_.b_.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":_.yd,Body:(O,i)=>({from:O.from+1,to:O.to-(O.to==i.doc.length?0:1)})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});function F(){return new _.Yy(A,[A.data.of({autocomplete:b}),A.data.of({autocomplete:j})])}}}]); +//# sourceMappingURL=2376.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/2376.index.js.map b/pr-preview/pr-770/2376.index.js.map new file mode 100644 index 00000000..526b67c7 --- /dev/null +++ b/pr-preview/pr-770/2376.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"2376.index.js","mappings":"2NAIA,MAoDMA,EAAU,GAIVC,EAAY,IAAIC,IAAI,CA5CE,GACR,GACQ,GA+Bb,IAtBH,GAwBE,IA/BM,GACa,GAOnB,IAHI,GACa,GAYd,GASK,GACM,GAzBH,GACa,GA4BlB,IACD,IACA,IAJD,MAkBlB,SAASC,EAAYC,GACnB,OAAOA,GAAMJ,GAbsB,IAaXI,CAC1B,CAEA,SAASC,EAAMD,GACb,OAAOA,GAAM,IAAMA,GAAM,IAAMA,GAAM,IAAMA,GAAM,IAAMA,GAAM,IAAMA,GAAM,GAC3E,CAEA,MAAME,EAAW,IAAI,MAAkB,CAACC,EAAOC,KAC7C,IAAIC,EACJ,GAAIF,EAAMG,KAAO,EACfH,EAAMI,YArEF,UAsEC,GAAIH,EAAMI,QAAQC,MAAQC,EAC3BX,EAAYI,EAAMG,OAAOH,EAAMI,YAxElB,IAwEgD,QAC5D,KAAMF,EAAOF,EAAMQ,MAAM,IAAM,GAAKZ,EAAYM,KAC5CD,EAAMQ,SA3EA,KA2E0B,CACzC,IAAIC,EAAS,EACb,KA7B6C,IA6BtCV,EAAMG,MA7B0C,GA6BzBH,EAAMG,MAAeH,EAAMW,UAAWD,IAChEV,EAAMG,MAAQV,GA9Be,IA8BJO,EAAMG,MA9B8B,IA8BJH,EAAMG,MACjEH,EAAMI,YA/EO,KA+EsBM,EACvC,MAAWd,EAA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AAK,IAAK,IAAK,MAAO,OAC3CC,eAAgB,CAAC,IAAK,KAAM,KAAM,IAAK,IAAK,IAAK,KAAM,KACnD,IAAK,KAAM,KAAM,IAAK,IAAK,IAAK,KAAM,OAE9CC,cAAe,CAAEpB,KAAM,KACvBqB,cAAe,kDAMvB,SAASC,IACL,OAAO,IAAI,KAAgBlB,EAAgB,CACvCA,EAAemB,KAAKC,GAAG,CAAEC,aAAclD,IACvC6B,EAAemB,KAAKC,GAAG,CAAEC,aAAcnC,KAE/C,C","sources":["webpack://thebe/../../node_modules/@lezer/python/dist/index.js","webpack://thebe/../../node_modules/@codemirror/lang-python/dist/index.js"],"sourcesContent":["import { ExternalTokenizer, ContextTracker, LRParser } from '@lezer/lr';\nimport { styleTags, tags } from '@lezer/highlight';\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst printKeyword = 1,\n indent = 194,\n dedent = 195,\n newline$1 = 196,\n blankLineStart = 197,\n newlineBracketed = 198,\n eof = 199,\n stringContent = 200,\n Escape = 2,\n replacementStart = 3,\n stringEnd = 201,\n ParenL = 24,\n ParenthesizedExpression = 25,\n TupleExpression = 49,\n ComprehensionExpression = 50,\n BracketL = 55,\n ArrayExpression = 56,\n ArrayComprehensionExpression = 57,\n BraceL = 59,\n DictionaryExpression = 60,\n DictionaryComprehensionExpression = 61,\n SetExpression = 62,\n SetComprehensionExpression = 63,\n ArgList = 65,\n subscript = 238,\n String$1 = 71,\n stringStart = 241,\n stringStartD = 242,\n stringStartL = 243,\n stringStartLD = 244,\n stringStartR = 245,\n stringStartRD = 246,\n stringStartRL = 247,\n stringStartRLD = 248,\n FormatString = 72,\n stringStartF = 249,\n stringStartFD = 250,\n stringStartFL = 251,\n stringStartFLD = 252,\n stringStartFR = 253,\n stringStartFRD = 254,\n stringStartFRL = 255,\n stringStartFRLD = 256,\n FormatReplacement = 73,\n nestedFormatReplacement = 77,\n importList = 263,\n TypeParamList = 112,\n ParamList = 130,\n SequencePattern = 151,\n MappingPattern = 152,\n PatternArgList = 155;\n\nconst newline = 10, carriageReturn = 13, space = 32, tab = 9, hash = 35, parenOpen = 40, dot = 46,\n braceOpen = 123, braceClose = 125, singleQuote = 39, doubleQuote = 34, backslash = 92,\n letter_o = 111, letter_x = 120, letter_N = 78, letter_u = 117, letter_U = 85;\n\nconst bracketed = new Set([\n ParenthesizedExpression, TupleExpression, ComprehensionExpression, importList, ArgList, ParamList,\n ArrayExpression, ArrayComprehensionExpression, subscript,\n SetExpression, SetComprehensionExpression, FormatString, FormatReplacement, nestedFormatReplacement,\n DictionaryExpression, DictionaryComprehensionExpression,\n SequencePattern, MappingPattern, PatternArgList, TypeParamList\n]);\n\nfunction isLineBreak(ch) {\n return ch == newline || ch == carriageReturn\n}\n\nfunction isHex(ch) {\n return ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102\n}\n\nconst newlines = new ExternalTokenizer((input, stack) => {\n let prev;\n if (input.next < 0) {\n input.acceptToken(eof);\n } else if (stack.context.flags & cx_Bracketed) {\n if (isLineBreak(input.next)) input.acceptToken(newlineBracketed, 1);\n } else if (((prev = input.peek(-1)) < 0 || isLineBreak(prev)) &&\n stack.canShift(blankLineStart)) {\n let spaces = 0;\n while (input.next == space || input.next == tab) { input.advance(); spaces++; }\n if (input.next == newline || input.next == carriageReturn || input.next == hash)\n input.acceptToken(blankLineStart, -spaces);\n } else if (isLineBreak(input.next)) {\n input.acceptToken(newline$1, 1);\n }\n}, {contextual: true});\n\nconst indentation = new ExternalTokenizer((input, stack) => {\n let context = stack.context;\n if (context.flags) return\n let prev = input.peek(-1);\n if (prev == newline || prev == carriageReturn) {\n let depth = 0, chars = 0;\n for (;;) {\n if (input.next == space) depth++;\n else if (input.next == tab) depth += 8 - (depth % 8);\n else break\n input.advance();\n chars++;\n }\n if (depth != context.indent &&\n input.next != newline && input.next != carriageReturn && input.next != hash) {\n if (depth < context.indent) input.acceptToken(dedent, -chars);\n else input.acceptToken(indent);\n }\n }\n});\n\n// Flags used in Context objects\nconst cx_Bracketed = 1, cx_String = 2, cx_DoubleQuote = 4, cx_Long = 8, cx_Raw = 16, cx_Format = 32;\n\nfunction Context(parent, indent, flags) {\n this.parent = parent;\n this.indent = indent;\n this.flags = flags;\n this.hash = (parent ? parent.hash + parent.hash << 8 : 0) + indent + (indent << 4) + flags + (flags << 6);\n}\n\nconst topIndent = new Context(null, 0, 0);\n\nfunction countIndent(space) {\n let depth = 0;\n for (let i = 0; i < space.length; i++)\n depth += space.charCodeAt(i) == tab ? 8 - (depth % 8) : 1;\n return depth\n}\n\nconst stringFlags = new Map([\n [stringStart, 0],\n [stringStartD, cx_DoubleQuote],\n [stringStartL, cx_Long],\n [stringStartLD, cx_Long | cx_DoubleQuote],\n [stringStartR, cx_Raw],\n [stringStartRD, cx_Raw | cx_DoubleQuote],\n [stringStartRL, cx_Raw | cx_Long],\n [stringStartRLD, cx_Raw | cx_Long | cx_DoubleQuote],\n [stringStartF, cx_Format],\n [stringStartFD, cx_Format | cx_DoubleQuote],\n [stringStartFL, cx_Format | cx_Long],\n [stringStartFLD, cx_Format | cx_Long | cx_DoubleQuote],\n [stringStartFR, cx_Format | cx_Raw],\n [stringStartFRD, cx_Format | cx_Raw | cx_DoubleQuote],\n [stringStartFRL, cx_Format | cx_Raw | cx_Long],\n [stringStartFRLD, cx_Format | cx_Raw | cx_Long | cx_DoubleQuote]\n].map(([term, flags]) => [term, flags | cx_String]));\n\nconst trackIndent = new ContextTracker({\n start: topIndent,\n reduce(context, term, _, input) {\n if ((context.flags & cx_Bracketed) && bracketed.has(term) ||\n (term == String$1 || term == FormatString) && (context.flags & cx_String))\n return context.parent\n return context\n },\n shift(context, term, stack, input) {\n if (term == indent)\n return new Context(context, countIndent(input.read(input.pos, stack.pos)), 0)\n if (term == dedent)\n return context.parent\n if (term == ParenL || term == BracketL || term == BraceL || term == replacementStart)\n return new Context(context, 0, cx_Bracketed)\n if (stringFlags.has(term))\n return new Context(context, 0, stringFlags.get(term) | (context.flags & cx_Bracketed))\n return context\n },\n hash(context) { return context.hash }\n});\n\nconst legacyPrint = new ExternalTokenizer(input => {\n for (let i = 0; i < 5; i++) {\n if (input.next != \"print\".charCodeAt(i)) return\n input.advance();\n }\n if (/\\w/.test(String.fromCharCode(input.next))) return\n for (let off = 0;; off++) {\n let next = input.peek(off);\n if (next == space || next == tab) continue\n if (next != parenOpen && next != dot && next != newline && next != carriageReturn && next != hash)\n input.acceptToken(printKeyword);\n return\n }\n});\n\nconst strings = new ExternalTokenizer((input, stack) => {\n let {flags} = stack.context;\n let quote = (flags & cx_DoubleQuote) ? doubleQuote : singleQuote;\n let long = (flags & cx_Long) > 0;\n let escapes = !(flags & cx_Raw);\n let format = (flags & cx_Format) > 0;\n\n let start = input.pos;\n for (;;) {\n if (input.next < 0) {\n break\n } else if (format && input.next == braceOpen) {\n if (input.peek(1) == braceOpen) {\n input.advance(2);\n } else {\n if (input.pos == start) {\n input.acceptToken(replacementStart, 1);\n return\n }\n break\n }\n } else if (escapes && input.next == backslash) {\n if (input.pos == start) {\n input.advance();\n let escaped = input.next;\n if (escaped >= 0) {\n input.advance();\n skipEscape(input, escaped);\n }\n input.acceptToken(Escape);\n return\n }\n break\n } else if (input.next == quote && (!long || input.peek(1) == quote && input.peek(2) == quote)) {\n if (input.pos == start) {\n input.acceptToken(stringEnd, long ? 3 : 1);\n return\n }\n break\n } else if (input.next == newline) {\n if (long) {\n input.advance();\n } else if (input.pos == start) {\n input.acceptToken(stringEnd);\n return\n }\n break\n } else {\n input.advance();\n }\n }\n if (input.pos > start) input.acceptToken(stringContent);\n});\n\nfunction skipEscape(input, ch) {\n if (ch == letter_o) {\n for (let i = 0; i < 2 && input.next >= 48 && input.next <= 55; i++) input.advance();\n } else if (ch == letter_x) {\n for (let i = 0; i < 2 && isHex(input.next); i++) input.advance();\n } else if (ch == letter_u) {\n for (let i = 0; i < 4 && isHex(input.next); i++) input.advance();\n } else if (ch == letter_U) {\n for (let i = 0; i < 8 && isHex(input.next); i++) input.advance();\n } else if (ch == letter_N) {\n if (input.next == braceOpen) {\n input.advance();\n while (input.next >= 0 && input.next != braceClose && input.next != singleQuote &&\n input.next != doubleQuote && input.next != newline) input.advance();\n if (input.next == braceClose) input.advance();\n }\n }\n}\n\nconst pythonHighlighting = styleTags({\n \"async \\\"*\\\" \\\"**\\\" FormatConversion FormatSpec\": tags.modifier,\n \"for while if elif else try except finally return raise break continue with pass assert await yield match case\": tags.controlKeyword,\n \"in not and or is del\": tags.operatorKeyword,\n \"from def class global nonlocal lambda\": tags.definitionKeyword,\n import: tags.moduleKeyword,\n \"with as print\": tags.keyword,\n Boolean: tags.bool,\n None: tags.null,\n VariableName: tags.variableName,\n \"CallExpression/VariableName\": tags.function(tags.variableName),\n \"FunctionDefinition/VariableName\": tags.function(tags.definition(tags.variableName)),\n \"ClassDefinition/VariableName\": tags.definition(tags.className),\n PropertyName: tags.propertyName,\n \"CallExpression/MemberExpression/PropertyName\": tags.function(tags.propertyName),\n Comment: tags.lineComment,\n Number: tags.number,\n String: tags.string,\n FormatString: tags.special(tags.string),\n Escape: tags.escape,\n UpdateOp: tags.updateOperator,\n \"ArithOp!\": tags.arithmeticOperator,\n BitOp: tags.bitwiseOperator,\n CompareOp: tags.compareOperator,\n AssignOp: tags.definitionOperator,\n Ellipsis: tags.punctuation,\n At: tags.meta,\n \"( )\": tags.paren,\n \"[ ]\": tags.squareBracket,\n \"{ }\": tags.brace,\n \".\": tags.derefOperator,\n \", ;\": tags.separator\n});\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst spec_identifier = {__proto__:null,await:44, or:54, and:56, in:60, not:62, is:64, if:70, else:72, lambda:76, yield:94, from:96, async:102, for:104, None:162, True:164, False:164, del:178, pass:182, break:186, continue:190, return:194, raise:202, import:206, as:208, global:212, nonlocal:214, assert:218, type:223, elif:236, while:240, try:246, except:248, finally:250, with:254, def:258, class:268, match:279, case:285};\nconst parser = LRParser.deserialize({\n version: 14,\n states: \"##jO`QeOOP$}OSOOO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;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T\",\n tokenizers: [legacyPrint, indentation, newlines, strings, 0, 1, 2, 3, 4],\n topRules: {\"Script\":[0,5]},\n specialized: [{term: 221, get: (value) => spec_identifier[value] || -1}],\n tokenPrec: 7652\n});\n\nexport { parser };\n","import { parser } from '@lezer/python';\nimport { syntaxTree, LRLanguage, indentNodeProp, delimitedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language';\nimport { NodeWeakMap, IterMode } from '@lezer/common';\nimport { snippetCompletion, ifNotIn, completeFromList } from '@codemirror/autocomplete';\n\nconst cache = /*@__PURE__*/new NodeWeakMap();\nconst ScopeNodes = /*@__PURE__*/new Set([\n \"Script\", \"Body\",\n \"FunctionDefinition\", \"ClassDefinition\", \"LambdaExpression\",\n \"ForStatement\", \"MatchClause\"\n]);\nfunction defID(type) {\n return (node, def, outer) => {\n if (outer)\n return false;\n let id = node.node.getChild(\"VariableName\");\n if (id)\n def(id, type);\n return true;\n };\n}\nconst gatherCompletions = {\n FunctionDefinition: /*@__PURE__*/defID(\"function\"),\n ClassDefinition: /*@__PURE__*/defID(\"class\"),\n ForStatement(node, def, outer) {\n if (outer)\n for (let child = node.node.firstChild; child; child = child.nextSibling) {\n if (child.name == \"VariableName\")\n def(child, \"variable\");\n else if (child.name == \"in\")\n break;\n }\n },\n ImportStatement(_node, def) {\n var _a, _b;\n let { node } = _node;\n let isFrom = ((_a = node.firstChild) === null || _a === void 0 ? void 0 : _a.name) == \"from\";\n for (let ch = node.getChild(\"import\"); ch; ch = ch.nextSibling) {\n if (ch.name == \"VariableName\" && ((_b = ch.nextSibling) === null || _b === void 0 ? void 0 : _b.name) != \"as\")\n def(ch, isFrom ? \"variable\" : \"namespace\");\n }\n },\n AssignStatement(node, def) {\n for (let child = node.node.firstChild; child; child = child.nextSibling) {\n if (child.name == \"VariableName\")\n def(child, \"variable\");\n else if (child.name == \":\" || child.name == \"AssignOp\")\n break;\n }\n },\n ParamList(node, def) {\n for (let prev = null, child = node.node.firstChild; child; child = child.nextSibling) {\n if (child.name == \"VariableName\" && (!prev || !/\\*|AssignOp/.test(prev.name)))\n def(child, \"variable\");\n prev = child;\n }\n },\n CapturePattern: /*@__PURE__*/defID(\"variable\"),\n AsPattern: /*@__PURE__*/defID(\"variable\"),\n __proto__: null\n};\nfunction getScope(doc, node) {\n let cached = cache.get(node);\n if (cached)\n return cached;\n let completions = [], top = true;\n function def(node, type) {\n let name = doc.sliceString(node.from, node.to);\n completions.push({ label: name, type });\n }\n node.cursor(IterMode.IncludeAnonymous).iterate(node => {\n if (node.name) {\n let gather = gatherCompletions[node.name];\n if (gather && gather(node, def, top) || !top && ScopeNodes.has(node.name))\n return false;\n top = false;\n }\n else if (node.to - node.from > 8192) {\n // Allow caching for bigger internal nodes\n for (let c of getScope(doc, node.node))\n completions.push(c);\n return false;\n }\n });\n cache.set(node, completions);\n return completions;\n}\nconst Identifier = /^[\\w\\xa1-\\uffff][\\w\\d\\xa1-\\uffff]*$/;\nconst dontComplete = [\"String\", \"FormatString\", \"Comment\", \"PropertyName\"];\n/**\nCompletion source that looks up locally defined names in\nPython code.\n*/\nfunction localCompletionSource(context) {\n let inner = syntaxTree(context.state).resolveInner(context.pos, -1);\n if (dontComplete.indexOf(inner.name) > -1)\n return null;\n let isWord = inner.name == \"VariableName\" ||\n inner.to - inner.from < 20 && Identifier.test(context.state.sliceDoc(inner.from, inner.to));\n if (!isWord && !context.explicit)\n return null;\n let options = [];\n for (let pos = inner; pos; pos = pos.parent) {\n if (ScopeNodes.has(pos.name))\n options = options.concat(getScope(context.state.doc, pos));\n }\n return {\n options,\n from: isWord ? inner.from : context.pos,\n validFor: Identifier\n };\n}\nconst globals = /*@__PURE__*/[\n \"__annotations__\", \"__builtins__\", \"__debug__\", \"__doc__\", \"__import__\", \"__name__\",\n \"__loader__\", \"__package__\", \"__spec__\",\n \"False\", \"None\", \"True\"\n].map(n => ({ label: n, type: \"constant\" })).concat(/*@__PURE__*/[\n \"ArithmeticError\", \"AssertionError\", \"AttributeError\", \"BaseException\", \"BlockingIOError\",\n \"BrokenPipeError\", \"BufferError\", \"BytesWarning\", \"ChildProcessError\", \"ConnectionAbortedError\",\n \"ConnectionError\", \"ConnectionRefusedError\", \"ConnectionResetError\", \"DeprecationWarning\",\n \"EOFError\", \"Ellipsis\", \"EncodingWarning\", \"EnvironmentError\", \"Exception\", \"FileExistsError\",\n \"FileNotFoundError\", \"FloatingPointError\", \"FutureWarning\", \"GeneratorExit\", \"IOError\",\n \"ImportError\", \"ImportWarning\", \"IndentationError\", \"IndexError\", \"InterruptedError\",\n \"IsADirectoryError\", \"KeyError\", \"KeyboardInterrupt\", \"LookupError\", \"MemoryError\",\n \"ModuleNotFoundError\", \"NameError\", \"NotADirectoryError\", \"NotImplemented\", \"NotImplementedError\",\n \"OSError\", \"OverflowError\", \"PendingDeprecationWarning\", \"PermissionError\", \"ProcessLookupError\",\n \"RecursionError\", \"ReferenceError\", \"ResourceWarning\", \"RuntimeError\", \"RuntimeWarning\",\n \"StopAsyncIteration\", \"StopIteration\", \"SyntaxError\", \"SyntaxWarning\", \"SystemError\",\n \"SystemExit\", \"TabError\", \"TimeoutError\", \"TypeError\", \"UnboundLocalError\", \"UnicodeDecodeError\",\n \"UnicodeEncodeError\", \"UnicodeError\", \"UnicodeTranslateError\", \"UnicodeWarning\", \"UserWarning\",\n \"ValueError\", \"Warning\", \"ZeroDivisionError\"\n].map(n => ({ label: n, type: \"type\" }))).concat(/*@__PURE__*/[\n \"bool\", \"bytearray\", \"bytes\", \"classmethod\", \"complex\", \"float\", \"frozenset\", \"int\", \"list\",\n \"map\", \"memoryview\", \"object\", \"range\", \"set\", \"staticmethod\", \"str\", \"super\", \"tuple\", \"type\"\n].map(n => ({ label: n, type: \"class\" }))).concat(/*@__PURE__*/[\n \"abs\", \"aiter\", \"all\", \"anext\", \"any\", \"ascii\", \"bin\", \"breakpoint\", \"callable\", \"chr\",\n \"compile\", \"delattr\", \"dict\", \"dir\", \"divmod\", \"enumerate\", \"eval\", \"exec\", \"exit\", \"filter\",\n \"format\", \"getattr\", \"globals\", \"hasattr\", \"hash\", \"help\", \"hex\", \"id\", \"input\", \"isinstance\",\n \"issubclass\", \"iter\", \"len\", \"license\", \"locals\", \"max\", \"min\", \"next\", \"oct\", \"open\",\n \"ord\", \"pow\", \"print\", \"property\", \"quit\", \"repr\", \"reversed\", \"round\", \"setattr\", \"slice\",\n \"sorted\", \"sum\", \"vars\", \"zip\"\n].map(n => ({ label: n, type: \"function\" })));\nconst snippets = [\n /*@__PURE__*/snippetCompletion(\"def ${name}(${params}):\\n\\t${}\", {\n label: \"def\",\n detail: \"function\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"for ${name} in ${collection}:\\n\\t${}\", {\n label: \"for\",\n detail: \"loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"while ${}:\\n\\t${}\", {\n label: \"while\",\n detail: \"loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"try:\\n\\t${}\\nexcept ${error}:\\n\\t${}\", {\n label: \"try\",\n detail: \"/ except block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"if ${}:\\n\\t\\n\", {\n label: \"if\",\n detail: \"block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"if ${}:\\n\\t${}\\nelse:\\n\\t${}\", {\n label: \"if\",\n detail: \"/ else block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"class ${name}:\\n\\tdef __init__(self, ${params}):\\n\\t\\t\\t${}\", {\n label: \"class\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"import ${module}\", {\n label: \"import\",\n detail: \"statement\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"from ${module} import ${names}\", {\n label: \"from\",\n detail: \"import\",\n type: \"keyword\"\n })\n];\n/**\nAutocompletion for built-in Python globals and keywords.\n*/\nconst globalCompletion = /*@__PURE__*/ifNotIn(dontComplete, /*@__PURE__*/completeFromList(/*@__PURE__*/globals.concat(snippets)));\n\nfunction innerBody(context) {\n let { node, pos } = context;\n let lineIndent = context.lineIndent(pos, -1);\n let found = null;\n for (;;) {\n let before = node.childBefore(pos);\n if (!before) {\n break;\n }\n else if (before.name == \"Comment\") {\n pos = before.from;\n }\n else if (before.name == \"Body\") {\n if (context.baseIndentFor(before) + context.unit <= lineIndent)\n found = before;\n node = before;\n }\n else if (before.type.is(\"Statement\")) {\n node = before;\n }\n else {\n break;\n }\n }\n return found;\n}\nfunction indentBody(context, node) {\n let base = context.baseIndentFor(node);\n let line = context.lineAt(context.pos, -1), to = line.from + line.text.length;\n // Don't consider blank, deindented lines at the end of the\n // block part of the block\n if (/^\\s*($|#)/.test(line.text) &&\n context.node.to < to + 100 &&\n !/\\S/.test(context.state.sliceDoc(to, context.node.to)) &&\n context.lineIndent(context.pos, -1) <= base)\n return null;\n // A normally deindenting keyword that appears at a higher\n // indentation than the block should probably be handled by the next\n // level\n if (/^\\s*(else:|elif |except |finally:)/.test(context.textAfter) && context.lineIndent(context.pos, -1) > base)\n return null;\n return base + context.unit;\n}\n/**\nA language provider based on the [Lezer Python\nparser](https://github.com/lezer-parser/python), extended with\nhighlighting and indentation information.\n*/\nconst pythonLanguage = /*@__PURE__*/LRLanguage.define({\n name: \"python\",\n parser: /*@__PURE__*/parser.configure({\n props: [\n /*@__PURE__*/indentNodeProp.add({\n Body: context => {\n var _a;\n let inner = innerBody(context);\n return (_a = indentBody(context, inner || context.node)) !== null && _a !== void 0 ? _a : context.continue();\n },\n IfStatement: cx => /^\\s*(else:|elif )/.test(cx.textAfter) ? cx.baseIndent : cx.continue(),\n \"ForStatement WhileStatement\": cx => /^\\s*else:/.test(cx.textAfter) ? cx.baseIndent : cx.continue(),\n TryStatement: cx => /^\\s*(except |finally:|else:)/.test(cx.textAfter) ? cx.baseIndent : cx.continue(),\n \"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression\": /*@__PURE__*/delimitedIndent({ closing: \")\" }),\n \"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression\": /*@__PURE__*/delimitedIndent({ closing: \"}\" }),\n \"ArrayExpression ArrayComprehensionExpression\": /*@__PURE__*/delimitedIndent({ closing: \"]\" }),\n \"String FormatString\": () => null,\n Script: context => {\n var _a;\n let inner = innerBody(context);\n return (_a = (inner && indentBody(context, inner))) !== null && _a !== void 0 ? _a : context.continue();\n }\n }),\n /*@__PURE__*/foldNodeProp.add({\n \"ArrayExpression DictionaryExpression SetExpression TupleExpression\": foldInside,\n Body: (node, state) => ({ from: node.from + 1, to: node.to - (node.to == state.doc.length ? 0 : 1) })\n })\n ],\n }),\n languageData: {\n closeBrackets: {\n brackets: [\"(\", \"[\", \"{\", \"'\", '\"', \"'''\", '\"\"\"'],\n stringPrefixes: [\"f\", \"fr\", \"rf\", \"r\", \"u\", \"b\", \"br\", \"rb\",\n \"F\", \"FR\", \"RF\", \"R\", \"U\", \"B\", \"BR\", \"RB\"]\n },\n commentTokens: { line: \"#\" },\n indentOnInput: /^\\s*([\\}\\]\\)]|else:|elif |except |finally:)$/\n }\n});\n/**\nPython language support.\n*/\nfunction python() {\n return new LanguageSupport(pythonLanguage, [\n pythonLanguage.data.of({ autocomplete: localCompletionSource }),\n pythonLanguage.data.of({ autocomplete: globalCompletion }),\n ]);\n}\n\nexport { globalCompletion, localCompletionSource, python, pythonLanguage };\n"],"names":["newline","bracketed","Set","isLineBreak","ch","isHex","newlines","input","stack","prev","next","acceptToken","context","flags","cx_Bracketed","peek","canShift","spaces","advance","contextual","indentation","depth","chars","indent","cx_DoubleQuote","cx_Long","cx_Raw","cx_Format","Context","parent","this","hash","topIndent","stringFlags","Map","map","term","trackIndent","start","reduce","_","has","shift","space","i","length","charCodeAt","countIndent","read","pos","get","legacyPrint","test","String","fromCharCode","off","strings","quote","long","escapes","format","escaped","skipEscape","pythonHighlighting","modifier","controlKeyword","operatorKeyword","definitionKeyword","import","moduleKeyword","keyword","Boolean","bool","None","null","VariableName","variableName","function","definition","className","PropertyName","propertyName","Comment","lineComment","Number","number","string","FormatString","special","Escape","escape","UpdateOp","updateOperator","arithmeticOperator","BitOp","bitwiseOperator","CompareOp","compareOperator","AssignOp","definitionOperator","Ellipsis","punctuation","At","meta","paren","squareBracket","brace","derefOperator","separator","spec_identifier","__proto__","await","or","and","in","not","is","if","else","lambda","yield","from","async","for","True","False","del","pass","break","continue","return","raise","as","global","nonlocal","assert","type","elif","while","try","except","finally","with","def","class","match","case","parser","deserialize","version","states","stateData","goto","nodeNames","maxTerm","nodeProps","propSources","skippedNodes","repeatNodeCount","tokenData","tokenizers","topRules","specialized","value","tokenPrec","cache","ScopeNodes","defID","node","outer","id","getChild","gatherCompletions","FunctionDefinition","ClassDefinition","ForStatement","child","firstChild","nextSibling","name","ImportStatement","_node","_a","_b","isFrom","AssignStatement","ParamList","CapturePattern","AsPattern","getScope","doc","cached","completions","top","sliceString","to","push","label","cursor","IncludeAnonymous","iterate","gather","c","set","Identifier","dontComplete","localCompletionSource","inner","state","resolveInner","indexOf","isWord","sliceDoc","explicit","options","concat","validFor","globals","n","snippets","detail","globalCompletion","innerBody","lineIndent","found","before","childBefore","baseIndentFor","unit","indentBody","base","line","lineAt","text","textAfter","pythonLanguage","define","configure","props","add","Body","IfStatement","cx","baseIndent","TryStatement","closing","Script","languageData","closeBrackets","brackets","stringPrefixes","commentTokens","indentOnInput","python","data","of","autocomplete"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/252.index.js b/pr-preview/pr-770/252.index.js new file mode 100644 index 00000000..c3baa2c1 --- /dev/null +++ b/pr-preview/pr-770/252.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[252],{252:(e,r,o)=>{function t(e){var r={as:"keyword",do:"keyword",else:"keyword",end:"keyword",exception:"keyword",fun:"keyword",functor:"keyword",if:"keyword",in:"keyword",include:"keyword",let:"keyword",of:"keyword",open:"keyword",rec:"keyword",struct:"keyword",then:"keyword",type:"keyword",val:"keyword",while:"keyword",with:"keyword"},o=e.extraWords||{};for(var t in o)o.hasOwnProperty(t)&&(r[t]=e.extraWords[t]);var n=[];for(var i in r)n.push(i);function d(o,t){var n=o.next();if('"'===n)return t.tokenize=k,t.tokenize(o,t);if("{"===n&&o.eat("|"))return t.longString=!0,t.tokenize=y,t.tokenize(o,t);if("("===n&&o.match(/^\*(?!\))/))return t.commentLevel++,t.tokenize=w,t.tokenize(o,t);if("~"===n||"?"===n)return o.eatWhile(/\w/),"variableName.special";if("`"===n)return o.eatWhile(/\w/),"quote";if("/"===n&&e.slashComments&&o.eat("/"))return o.skipToEnd(),"comment";if(/\d/.test(n))return"0"===n&&o.eat(/[bB]/)&&o.eatWhile(/[01]/),"0"===n&&o.eat(/[xX]/)&&o.eatWhile(/[0-9a-fA-F]/),"0"===n&&o.eat(/[oO]/)?o.eatWhile(/[0-7]/):(o.eatWhile(/[\d_]/),o.eat(".")&&o.eatWhile(/[\d]/),o.eat(/[eE]/)&&o.eatWhile(/[\d\-+]/)),"number";if(/[+\-*&%=<>!?|@\.~:]/.test(n))return"operator";if(/[\w\xa1-\uffff]/.test(n)){o.eatWhile(/[\w\xa1-\uffff]/);var i=o.current();return r.hasOwnProperty(i)?r[i]:"variable"}return null}function k(e,r){for(var o,t=!1,n=!1;null!=(o=e.next());){if('"'===o&&!n){t=!0;break}n=!n&&"\\"===o}return t&&!n&&(r.tokenize=d),"string"}function w(e,r){for(var o,t;r.commentLevel>0&&null!=(t=e.next());)"("===o&&"*"===t&&r.commentLevel++,"*"===o&&")"===t&&r.commentLevel--,o=t;return r.commentLevel<=0&&(r.tokenize=d),"comment"}function y(e,r){for(var o,t;r.longString&&null!=(t=e.next());)"|"===o&&"}"===t&&(r.longString=!1),o=t;return r.longString||(r.tokenize=d),"string"}return{startState:function(){return{tokenize:d,commentLevel:0,longString:!1}},token:function(e,r){return e.eatSpace()?null:r.tokenize(e,r)},languageData:{autocomplete:n,commentTokens:{line:e.slashComments?"//":void 0,block:{open:"(*",close:"*)"}}}}}o.r(r),o.d(r,{fSharp:()=>i,oCaml:()=>n,sml:()=>d});const n=t({name:"ocaml",extraWords:{and:"keyword",assert:"keyword",begin:"keyword",class:"keyword",constraint:"keyword",done:"keyword",downto:"keyword",external:"keyword",function:"keyword",initializer:"keyword",lazy:"keyword",match:"keyword",method:"keyword",module:"keyword",mutable:"keyword",new:"keyword",nonrec:"keyword",object:"keyword",private:"keyword",sig:"keyword",to:"keyword",try:"keyword",value:"keyword",virtual:"keyword",when:"keyword",raise:"builtin",failwith:"builtin",true:"builtin",false:"builtin",asr:"builtin",land:"builtin",lor:"builtin",lsl:"builtin",lsr:"builtin",lxor:"builtin",mod:"builtin",or:"builtin",raise_notrace:"builtin",trace:"builtin",exit:"builtin",print_string:"builtin",print_endline:"builtin",int:"type",float:"type",bool:"type",char:"type",string:"type",unit:"type",List:"builtin"}}),i=t({name:"fsharp",extraWords:{abstract:"keyword",assert:"keyword",base:"keyword",begin:"keyword",class:"keyword",default:"keyword",delegate:"keyword","do!":"keyword",done:"keyword",downcast:"keyword",downto:"keyword",elif:"keyword",extern:"keyword",finally:"keyword",for:"keyword",function:"keyword",global:"keyword",inherit:"keyword",inline:"keyword",interface:"keyword",internal:"keyword",lazy:"keyword","let!":"keyword",match:"keyword",member:"keyword",module:"keyword",mutable:"keyword",namespace:"keyword",new:"keyword",null:"keyword",override:"keyword",private:"keyword",public:"keyword","return!":"keyword",return:"keyword",select:"keyword",static:"keyword",to:"keyword",try:"keyword",upcast:"keyword","use!":"keyword",use:"keyword",void:"keyword",when:"keyword","yield!":"keyword",yield:"keyword",atomic:"keyword",break:"keyword",checked:"keyword",component:"keyword",const:"keyword",constraint:"keyword",constructor:"keyword",continue:"keyword",eager:"keyword",event:"keyword",external:"keyword",fixed:"keyword",method:"keyword",mixin:"keyword",object:"keyword",parallel:"keyword",process:"keyword",protected:"keyword",pure:"keyword",sealed:"keyword",tailcall:"keyword",trait:"keyword",virtual:"keyword",volatile:"keyword",List:"builtin",Seq:"builtin",Map:"builtin",Set:"builtin",Option:"builtin",int:"builtin",string:"builtin",not:"builtin",true:"builtin",false:"builtin",raise:"builtin",failwith:"builtin"},slashComments:!0}),d=t({name:"sml",extraWords:{abstype:"keyword",and:"keyword",andalso:"keyword",case:"keyword",datatype:"keyword",fn:"keyword",handle:"keyword",infix:"keyword",infixr:"keyword",local:"keyword",nonfix:"keyword",op:"keyword",orelse:"keyword",raise:"keyword",withtype:"keyword",eqtype:"keyword",sharing:"keyword",sig:"keyword",signature:"keyword",structure:"keyword",where:"keyword",true:"keyword",false:"keyword",int:"builtin",real:"builtin",string:"builtin",char:"builtin",bool:"builtin"},slashComments:!0})}}]); +//# sourceMappingURL=252.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/252.index.js.map b/pr-preview/pr-770/252.index.js.map new file mode 100644 index 00000000..1ad98b93 --- /dev/null +++ b/pr-preview/pr-770/252.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"252.index.js","mappings":"4FAAA,SAASA,EAAOC,GACd,IAAIC,EAAQ,CACV,GAAM,UACN,GAAM,UACN,KAAQ,UACR,IAAO,UACP,UAAa,UACb,IAAO,UACP,QAAW,UACX,GAAM,UACN,GAAM,UACN,QAAW,UACX,IAAO,UACP,GAAM,UACN,KAAQ,UACR,IAAO,UACP,OAAU,UACV,KAAQ,UACR,KAAQ,UACR,IAAO,UACP,MAAS,UACT,KAAQ,WAGNC,EAAaF,EAAaE,YAAc,CAAC,EAC7C,IAAK,I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AAQ,UACR,IAAO,UACP,IAAO,UACP,IAAO,UACP,OAAU,UACV,IAAO,UACP,OAAU,UACV,IAAO,UACP,KAAQ,UACR,MAAS,UAET,MAAS,UACT,SAAY,WAEdoB,eAAe,IAGJsB,EAAM7C,EAAO,CACxB2C,KAAM,MACNxC,WAAY,CACV,QAAW,UACX,IAAO,UACP,QAAW,UACX,KAAQ,UACR,SAAY,UACZ,GAAM,UACN,OAAU,UACV,MAAS,UACT,OAAU,UACV,MAAS,UACT,OAAU,UACV,GAAM,UACN,OAAU,UACV,MAAS,UACT,SAAY,UACZ,OAAU,UACV,QAAW,UACX,IAAO,UACP,UAAa,UACb,UAAa,UACb,MAAS,UACT,KAAQ,UACR,MAAS,UAGT,IAAO,UACP,KAAQ,UACR,OAAU,UACV,KAAQ,UACR,KAAQ,WAEVoB,eAAe,G","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/mllike.js"],"sourcesContent":["function mlLike(parserConfig) {\n var words = {\n 'as': 'keyword',\n 'do': 'keyword',\n 'else': 'keyword',\n 'end': 'keyword',\n 'exception': 'keyword',\n 'fun': 'keyword',\n 'functor': 'keyword',\n 'if': 'keyword',\n 'in': 'keyword',\n 'include': 'keyword',\n 'let': 'keyword',\n 'of': 'keyword',\n 'open': 'keyword',\n 'rec': 'keyword',\n 'struct': 'keyword',\n 'then': 'keyword',\n 'type': 'keyword',\n 'val': 'keyword',\n 'while': 'keyword',\n 'with': 'keyword'\n };\n\n var extraWords = parserConfig.extraWords || {};\n for (var prop in extraWords) {\n if (extraWords.hasOwnProperty(prop)) {\n words[prop] = parserConfig.extraWords[prop];\n }\n }\n var hintWords = [];\n for (var k in words) { hintWords.push(k); }\n\n function tokenBase(stream, state) {\n var ch = stream.next();\n\n if (ch === '\"') {\n state.tokenize = tokenString;\n return state.tokenize(stream, state);\n }\n if (ch === '{') {\n if (stream.eat('|')) {\n state.longString = true;\n state.tokenize = tokenLongString;\n return state.tokenize(stream, state);\n }\n }\n if (ch === '(') {\n if (stream.match(/^\\*(?!\\))/)) {\n state.commentLevel++;\n state.tokenize = tokenComment;\n return state.tokenize(stream, state);\n }\n }\n if (ch === '~' || ch === '?') {\n stream.eatWhile(/\\w/);\n return 'variableName.special';\n }\n if (ch === '`') {\n stream.eatWhile(/\\w/);\n return 'quote';\n }\n if (ch === '/' && parserConfig.slashComments && stream.eat('/')) {\n stream.skipToEnd();\n return 'comment';\n }\n if (/\\d/.test(ch)) {\n if (ch === '0' && stream.eat(/[bB]/)) {\n stream.eatWhile(/[01]/);\n } if (ch === '0' && stream.eat(/[xX]/)) {\n stream.eatWhile(/[0-9a-fA-F]/)\n } if (ch === '0' && stream.eat(/[oO]/)) {\n stream.eatWhile(/[0-7]/);\n } else {\n stream.eatWhile(/[\\d_]/);\n if (stream.eat('.')) {\n stream.eatWhile(/[\\d]/);\n }\n if (stream.eat(/[eE]/)) {\n stream.eatWhile(/[\\d\\-+]/);\n }\n }\n return 'number';\n }\n if ( /[+\\-*&%=<>!?|@\\.~:]/.test(ch)) {\n return 'operator';\n }\n if (/[\\w\\xa1-\\uffff]/.test(ch)) {\n stream.eatWhile(/[\\w\\xa1-\\uffff]/);\n var cur = stream.current();\n return words.hasOwnProperty(cur) ? words[cur] : 'variable';\n }\n return null\n }\n\n function tokenString(stream, state) {\n var next, end = false, escaped = false;\n while ((next = stream.next()) != null) {\n if (next === '\"' && !escaped) {\n end = true;\n break;\n }\n escaped = !escaped && next === '\\\\';\n }\n if (end && !escaped) {\n state.tokenize = tokenBase;\n }\n return 'string';\n };\n\n function tokenComment(stream, state) {\n var prev, next;\n while(state.commentLevel > 0 && (next = stream.next()) != null) {\n if (prev === '(' && next === '*') state.commentLevel++;\n if (prev === '*' && next === ')') state.commentLevel--;\n prev = next;\n }\n if (state.commentLevel <= 0) {\n state.tokenize = tokenBase;\n }\n return 'comment';\n }\n\n function tokenLongString(stream, state) {\n var prev, next;\n while (state.longString && (next = stream.next()) != null) {\n if (prev === '|' && next === '}') state.longString = false;\n prev = next;\n }\n if (!state.longString) {\n state.tokenize = tokenBase;\n }\n return 'string';\n }\n\n return {\n startState: function() {return {tokenize: tokenBase, commentLevel: 0, longString: false};},\n token: function(stream, state) {\n if (stream.eatSpace()) return null;\n return state.tokenize(stream, state);\n },\n\n languageData: {\n autocomplete: hintWords,\n commentTokens: {\n line: parserConfig.slashComments ? \"//\" : undefined,\n block: {open: \"(*\", close: \"*)\"}\n }\n }\n };\n};\n\nexport const oCaml = mlLike({\n name: \"ocaml\",\n extraWords: {\n 'and': 'keyword',\n 'assert': 'keyword',\n 'begin': 'keyword',\n 'class': 'keyword',\n 'constraint': 'keyword',\n 'done': 'keyword',\n 'downto': 'keyword',\n 'external': 'keyword',\n 'function': 'keyword',\n 'initializer': 'keyword',\n 'lazy': 'keyword',\n 'match': 'keyword',\n 'method': 'keyword',\n 'module': 'keyword',\n 'mutable': 'keyword',\n 'new': 'keyword',\n 'nonrec': 'keyword',\n 'object': 'keyword',\n 'private': 'keyword',\n 'sig': 'keyword',\n 'to': 'keyword',\n 'try': 'keyword',\n 'value': 'keyword',\n 'virtual': 'keyword',\n 'when': 'keyword',\n\n // builtins\n 'raise': 'builtin',\n 'failwith': 'builtin',\n 'true': 'builtin',\n 'false': 'builtin',\n\n // Pervasives builtins\n 'asr': 'builtin',\n 'land': 'builtin',\n 'lor': 'builtin',\n 'lsl': 'builtin',\n 'lsr': 'builtin',\n 'lxor': 'builtin',\n 'mod': 'builtin',\n 'or': 'builtin',\n\n // More Pervasives\n 'raise_notrace': 'builtin',\n 'trace': 'builtin',\n 'exit': 'builtin',\n 'print_string': 'builtin',\n 'print_endline': 'builtin',\n\n 'int': 'type',\n 'float': 'type',\n 'bool': 'type',\n 'char': 'type',\n 'string': 'type',\n 'unit': 'type',\n\n // Modules\n 'List': 'builtin'\n }\n});\n\nexport const fSharp = mlLike({\n name: \"fsharp\",\n extraWords: {\n 'abstract': 'keyword',\n 'assert': 'keyword',\n 'base': 'keyword',\n 'begin': 'keyword',\n 'class': 'keyword',\n 'default': 'keyword',\n 'delegate': 'keyword',\n 'do!': 'keyword',\n 'done': 'keyword',\n 'downcast': 'keyword',\n 'downto': 'keyword',\n 'elif': 'keyword',\n 'extern': 'keyword',\n 'finally': 'keyword',\n 'for': 'keyword',\n 'function': 'keyword',\n 'global': 'keyword',\n 'inherit': 'keyword',\n 'inline': 'keyword',\n 'interface': 'keyword',\n 'internal': 'keyword',\n 'lazy': 'keyword',\n 'let!': 'keyword',\n 'match': 'keyword',\n 'member': 'keyword',\n 'module': 'keyword',\n 'mutable': 'keyword',\n 'namespace': 'keyword',\n 'new': 'keyword',\n 'null': 'keyword',\n 'override': 'keyword',\n 'private': 'keyword',\n 'public': 'keyword',\n 'return!': 'keyword',\n 'return': 'keyword',\n 'select': 'keyword',\n 'static': 'keyword',\n 'to': 'keyword',\n 'try': 'keyword',\n 'upcast': 'keyword',\n 'use!': 'keyword',\n 'use': 'keyword',\n 'void': 'keyword',\n 'when': 'keyword',\n 'yield!': 'keyword',\n 'yield': 'keyword',\n\n // Reserved words\n 'atomic': 'keyword',\n 'break': 'keyword',\n 'checked': 'keyword',\n 'component': 'keyword',\n 'const': 'keyword',\n 'constraint': 'keyword',\n 'constructor': 'keyword',\n 'continue': 'keyword',\n 'eager': 'keyword',\n 'event': 'keyword',\n 'external': 'keyword',\n 'fixed': 'keyword',\n 'method': 'keyword',\n 'mixin': 'keyword',\n 'object': 'keyword',\n 'parallel': 'keyword',\n 'process': 'keyword',\n 'protected': 'keyword',\n 'pure': 'keyword',\n 'sealed': 'keyword',\n 'tailcall': 'keyword',\n 'trait': 'keyword',\n 'virtual': 'keyword',\n 'volatile': 'keyword',\n\n // builtins\n 'List': 'builtin',\n 'Seq': 'builtin',\n 'Map': 'builtin',\n 'Set': 'builtin',\n 'Option': 'builtin',\n 'int': 'builtin',\n 'string': 'builtin',\n 'not': 'builtin',\n 'true': 'builtin',\n 'false': 'builtin',\n\n 'raise': 'builtin',\n 'failwith': 'builtin'\n },\n slashComments: true\n});\n\nexport const sml = mlLike({\n name: \"sml\",\n extraWords: {\n 'abstype': 'keyword',\n 'and': 'keyword',\n 'andalso': 'keyword',\n 'case': 'keyword',\n 'datatype': 'keyword',\n 'fn': 'keyword',\n 'handle': 'keyword',\n 'infix': 'keyword',\n 'infixr': 'keyword',\n 'local': 'keyword',\n 'nonfix': 'keyword',\n 'op': 'keyword',\n 'orelse': 'keyword',\n 'raise': 'keyword',\n 'withtype': 'keyword',\n 'eqtype': 'keyword',\n 'sharing': 'keyword',\n 'sig': 'keyword',\n 'signature': 'keyword',\n 'structure': 'keyword',\n 'where': 'keyword',\n 'true': 'keyword',\n 'false': 'keyword',\n\n // types\n 'int': 'builtin',\n 'real': 'builtin',\n 'string': 'builtin',\n 'char': 'builtin',\n 'bool': 'builtin'\n },\n slashComments: true\n});\n"],"names":["mlLike","parserConfig","words","extraWords","prop","hasOwnProperty","hintWords","k","push","tokenBase","stream","state","ch","next","tokenize","tokenString","eat","longString","tokenLongString","match","commentLevel","tokenComment","eatWhile","slashComments","skipToEnd","test","cur","current","end","escaped","prev","startState","token","eatSpace","languageData","autocomplete","commentTokens","line","undefined","block","open","close","oCaml","name","fSharp","sml"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/2681.index.js b/pr-preview/pr-770/2681.index.js new file mode 100644 index 00000000..49b9a357 --- /dev/null +++ b/pr-preview/pr-770/2681.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[2681],{2681:(e,n,t)=>{t.r(n),t.d(n,{fcl:()=>s});var r={term:!0,method:!0,accu:!0,rule:!0,then:!0,is:!0,and:!0,or:!0,if:!0,default:!0},o={var_input:!0,var_output:!0,fuzzify:!0,defuzzify:!0,function_block:!0,ruleblock:!0},i={end_ruleblock:!0,end_defuzzify:!0,end_function_block:!0,end_fuzzify:!0,end_var:!0},a={true:!0,false:!0,nan:!0,real:!0,min:!0,max:!0,cog:!0,cogs:!0},u=/[+\-*&^%:=<>!|\/]/;function c(e,n){var t=e.next();if(/[\d\.]/.test(t))return"."==t?e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==t?e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/):e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if("/"==t||"("==t){if(e.eat("*"))return n.tokenize=l,l(e,n);if(e.eat("/"))return e.skipToEnd(),"comment"}if(u.test(t))return e.eatWhile(u),"operator";e.eatWhile(/[\w\$_\xa1-\uffff]/);var c=e.current().toLowerCase();return r.propertyIsEnumerable(c)||o.propertyIsEnumerable(c)||i.propertyIsEnumerable(c)?"keyword":a.propertyIsEnumerable(c)?"atom":"variable"}function l(e,n){for(var t,r=!1;t=e.next();){if(("/"==t||")"==t)&&r){n.tokenize=c;break}r="*"==t}return"comment"}function f(e,n,t,r,o){this.indented=e,this.column=n,this.type=t,this.align=r,this.prev=o}const s={name:"fcl",startState:function(e){return{tokenize:null,context:new f(-e,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,n){var t=n.context;if(e.sol()&&(null==t.align&&(t.align=!1),n.indented=e.indentation(),n.startOfLine=!0),e.eatSpace())return null;var r=(n.tokenize||c)(e,n);if("comment"==r)return r;null==t.align&&(t.align=!0);var a=e.current().toLowerCase();return o.propertyIsEnumerable(a)?function(e,n){e.context=new f(e.indented,n,"end_block",null,e.context)}(n,e.column()):i.propertyIsEnumerable(a)&&function(e){e.context.prev&&("end_block"==e.context.type&&(e.indented=e.context.indented),e.context=e.context.prev)}(n),n.startOfLine=!1,r},indent:function(e,n,t){if(e.tokenize!=c&&null!=e.tokenize)return 0;var r=e.context,o=i.propertyIsEnumerable(n);return r.align?r.column+(o?0:1):r.indented+(o?0:t.unit)},languageData:{commentTokens:{line:"//",block:{open:"(*",close:"*)"}}}}}}]); +//# sourceMappingURL=2681.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/2681.index.js.map b/pr-preview/pr-770/2681.index.js.map new file mode 100644 index 00000000..60945ef4 --- /dev/null +++ b/pr-preview/pr-770/2681.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"2681.index.js","mappings":"wHAAA,IAAIA,EAAW,CACb,MAAQ,EACR,QAAU,EAAM,MAAQ,EACxB,MAAQ,EAAM,MAAQ,EAAM,IAAM,EAAM,KAAO,EAAM,IAAM,EAC3D,IAAM,EAAM,SAAW,GAGrBC,EAAe,CACjB,WAAa,EACb,YAAc,EACd,SAAW,EACX,WAAa,EACb,gBAAkB,EAClB,WAAa,GAGXC,EAAa,CACf,eAAiB,EACjB,eAAiB,EACjB,oBAAsB,EACtB,aAAe,EACf,SAAW,GAGTC,EAAQ,CACV,MAAQ,EAAM,OAAS,EAAM,KAAO,EACpC,MAAQ,EAAM,KAAO,EAAM,KAAO,EAAM,KAAO,EAAM,MAAQ,GAG3DC,EAAiB,oBAErB,SAASC,EAAUC,EAAQC,GACzB,IAAIC,EAAKF,EAAOG,OAEhB,GAAI,SAASC,KAAKF,GAQhB,MAPU,KAANA,EACFF,EAAOK,MAAM,8BACE,KAANH,EACTF,EAAOK,MAAM,sBAAwBL,EAAOK,MAAM,YAElDL,EAAOK,MAAM,uCAER,SAGT,GAAU,KAANH,GAAmB,KAANA,EAAW,CAC1B,GAAIF,EAAOM,IAAI,KAEb,OADAL,EAAMM,SAAWC,EACVA,EAAaR,EAAQC,GAE9B,GAAID,EAAOM,IAAI,KAEb,OADAN,EAAOS,YACA,SAEX,CACA,GAAIX,EAAeM,KAAKF,GAEtB,OADAF,EAAOU,SAASZ,GACT,WAETE,EAAOU,SAAS,sBAEhB,IAAIC,EAAMX,EAAOY,UAAUC,cAC3B,OAAInB,EAASoB,qBAAqBH,IAC9BhB,EAAamB,qBAAqBH,IAClCf,EAAWkB,qBAAqBH,GAC3B,UAELd,EAAMiB,qBAAqBH,GAAa,OACrC,UACT,CAGA,SAASH,EAAaR,EAAQC,GAE5B,IADA,IAAsBC,EAAlBa,GAAW,EACRb,EAAKF,EAAOG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T,EAEAI,OAAQ,SAASrC,EAAOsC,EAAWC,GACjC,GAAIvC,EAAMM,UAAYR,GAA+B,MAAlBE,EAAMM,SAAkB,OAAO,EAClE,IAAIuB,EAAM7B,EAAM0B,QAEZc,EAAU7C,EAAWkB,qBAAqByB,GAC9C,OAAIT,EAAIV,MAAcU,EAAIZ,QAAUuB,EAAU,EAAI,GACtCX,EAAIb,UAAYwB,EAAU,EAAID,EAAGE,KAC/C,EAEAC,aAAc,CACZC,cAAe,CAACC,KAAM,KAAMC,MAAO,CAACC,KAAM,KAAMC,MAAO,Q","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/fcl.js"],"sourcesContent":["var keywords = {\n \"term\": true,\n \"method\": true, \"accu\": true,\n \"rule\": true, \"then\": true, \"is\": true, \"and\": true, \"or\": true,\n \"if\": true, \"default\": true\n};\n\nvar start_blocks = {\n \"var_input\": true,\n \"var_output\": true,\n \"fuzzify\": true,\n \"defuzzify\": true,\n \"function_block\": true,\n \"ruleblock\": true\n};\n\nvar end_blocks = {\n \"end_ruleblock\": true,\n \"end_defuzzify\": true,\n \"end_function_block\": true,\n \"end_fuzzify\": true,\n \"end_var\": true\n};\n\nvar atoms = {\n \"true\": true, \"false\": true, \"nan\": true,\n \"real\": true, \"min\": true, \"max\": true, \"cog\": true, \"cogs\": true\n};\n\nvar isOperatorChar = /[+\\-*&^%:=<>!|\\/]/;\n\nfunction tokenBase(stream, state) {\n var ch = stream.next();\n\n if (/[\\d\\.]/.test(ch)) {\n if (ch == \".\") {\n stream.match(/^[0-9]+([eE][\\-+]?[0-9]+)?/);\n } else if (ch == \"0\") {\n stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);\n } else {\n stream.match(/^[0-9]*\\.?[0-9]*([eE][\\-+]?[0-9]+)?/);\n }\n return \"number\";\n }\n\n if (ch == \"/\" || ch == \"(\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n }\n if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return \"comment\";\n }\n }\n if (isOperatorChar.test(ch)) {\n stream.eatWhile(isOperatorChar);\n return \"operator\";\n }\n stream.eatWhile(/[\\w\\$_\\xa1-\\uffff]/);\n\n var cur = stream.current().toLowerCase();\n if (keywords.propertyIsEnumerable(cur) ||\n start_blocks.propertyIsEnumerable(cur) ||\n end_blocks.propertyIsEnumerable(cur)) {\n return \"keyword\";\n }\n if (atoms.propertyIsEnumerable(cur)) return \"atom\";\n return \"variable\";\n}\n\n\nfunction tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if ((ch == \"/\" || ch == \")\") && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return \"comment\";\n}\n\nfunction Context(indented, column, type, align, prev) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.align = align;\n this.prev = prev;\n}\n\nfunction pushContext(state, col, type) {\n return state.context = new Context(state.indented, col, type, null, state.context);\n}\n\nfunction popContext(state) {\n if (!state.context.prev) return;\n var t = state.context.type;\n if (t == \"end_block\")\n state.indented = state.context.indented;\n return state.context = state.context.prev;\n}\n\n// Interface\n\nexport const fcl = {\n name: \"fcl\",\n startState: function(indentUnit) {\n return {\n tokenize: null,\n context: new Context(-indentUnit, 0, \"top\", false),\n indented: 0,\n startOfLine: true\n };\n },\n\n token: function(stream, state) {\n var ctx = state.context;\n if (stream.sol()) {\n if (ctx.align == null) ctx.align = false;\n state.indented = stream.indentation();\n state.startOfLine = true;\n }\n if (stream.eatSpace()) return null;\n\n var style = (state.tokenize || tokenBase)(stream, state);\n if (style == \"comment\") return style;\n if (ctx.align == null) ctx.align = true;\n\n var cur = stream.current().toLowerCase();\n\n if (start_blocks.propertyIsEnumerable(cur)) pushContext(state, stream.column(), \"end_block\");\n else if (end_blocks.propertyIsEnumerable(cur)) popContext(state);\n\n state.startOfLine = false;\n return style;\n },\n\n indent: function(state, textAfter, cx) {\n if (state.tokenize != tokenBase && state.tokenize != null) return 0;\n var ctx = state.context;\n\n var closing = end_blocks.propertyIsEnumerable(textAfter);\n if (ctx.align) return ctx.column + (closing ? 0 : 1);\n else return ctx.indented + (closing ? 0 : cx.unit);\n },\n\n languageData: {\n commentTokens: {line: \"//\", block: {open: \"(*\", close: \"*)\"}}\n }\n};\n\n"],"names":["keywords","start_blocks","end_blocks","atoms","isOperatorChar","tokenBase","stream","state","ch","next","test","match","eat","tokenize","tokenComment","skipToEnd","eatWhile","cur","current","toLowerCase","propertyIsEnumerable","maybeEnd","Context","indented","column","type","align","prev","this","fcl","name","startState","indentUnit","context","startOfLine","token","ctx","sol","indentation","eatSpace","style","col","pushContext","popContext","indent","textAfter","cx","closing","unit","languageData","commentTokens","line","block","open","close"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/2682.index.js b/pr-preview/pr-770/2682.index.js new file mode 100644 index 00000000..1afb1d78 --- /dev/null +++ b/pr-preview/pr-770/2682.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[2682],{2682:(e,t,a)=>{a.r(t),a.d(t,{asterisk:()=>o});var n=["exten","same","include","ignorepat","switch"],i=["#include","#exec"],r=["addqueuemember","adsiprog","aelsub","agentlogin","agentmonitoroutgoing","agi","alarmreceiver","amd","answer","authenticate","background","backgrounddetect","bridge","busy","callcompletioncancel","callcompletionrequest","celgenuserevent","changemonitor","chanisavail","channelredirect","chanspy","clearhash","confbridge","congestion","continuewhile","controlplayback","dahdiacceptr2call","dahdibarge","dahdiras","dahdiscan","dahdisendcallreroutingfacility","dahdisendkeypadfacility","datetime","dbdel","dbdeltree","deadagi","dial","dictate","directory","disa","dumpchan","eagi","echo","endwhile","exec","execif","execiftime","exitwhile","extenspy","externalivr","festival","flash","followme","forkcdr","getcpeid","gosub","gosubif","goto","gotoif","gotoiftime","hangup","iax2provision","ices","importvar","incomplete","ivrdemo","jabberjoin","jabberleave","jabbersend","jabbersendgroup","jabberstatus","jack","log","macro","macroexclusive","macroexit","macroif","mailboxexists","meetme","meetmeadmin","meetmechanneladmin","meetmecount","milliwatt","minivmaccmess","minivmdelete","minivmgreet","minivmmwi","minivmnotify","minivmrecord","mixmonitor","monitor","morsecode","mp3player","mset","musiconhold","nbscat","nocdr","noop","odbc","odbc","odbcfinish","originate","ospauth","ospfinish","osplookup","ospnext","page","park","parkandannounce","parkedcall","pausemonitor","pausequeuemember","pickup","pickupchan","playback","playtones","privacymanager","proceeding","progress","queue","queuelog","raiseexception","read","readexten","readfile","receivefax","receivefax","receivefax","record","removequeuemember","resetcdr","retrydial","return","ringing","sayalpha","saycountedadj","saycountednoun","saycountpl","saydigits","saynumber","sayphonetic","sayunixtime","senddtmf","sendfax","sendfax","sendfax","sendimage","sendtext","sendurl","set","setamaflags","setcallerpres","setmusiconhold","sipaddheader","sipdtmfmode","sipremoveheader","skel","slastation","slatrunk","sms","softhangup","speechactivategrammar","speechbackground","speechcreate","speechdeactivategrammar","speechdestroy","speechloadgrammar","speechprocessingsound","speechstart","speechunloadgrammar","stackpop","startmusiconhold","stopmixmonitor","stopmonitor","stopmusiconhold","stopplaytones","system","testclient","testserver","transfer","tryexec","trysystem","unpausemonitor","unpausequeuemember","userevent","verbose","vmauthenticate","vmsayname","voicemail","voicemailmain","wait","waitexten","waitfornoise","waitforring","waitforsilence","waitmusiconhold","waituntil","while","zapateller"];const o={name:"asterisk",startState:function(){return{blockComment:!1,extenStart:!1,extenSame:!1,extenInclude:!1,extenExten:!1,extenPriority:!1,extenApplication:!1}},token:function(e,t){var a="";return e.eatSpace()?null:t.extenStart?(e.eatWhile(/[^\s]/),a=e.current(),/^=>?$/.test(a)?(t.extenExten=!0,t.extenStart=!1,"strong"):(t.extenStart=!1,e.skipToEnd(),"error")):t.extenExten?(t.extenExten=!1,t.extenPriority=!0,e.eatWhile(/[^,]/),t.extenInclude&&(e.skipToEnd(),t.extenPriority=!1,t.extenInclude=!1),t.extenSame&&(t.extenPriority=!1,t.extenSame=!1,t.extenApplication=!0),"tag"):t.extenPriority?(t.extenPriority=!1,t.extenApplication=!0,e.next(),t.extenSame?null:(e.eatWhile(/[^,]/),"number")):t.extenApplication?(e.eatWhile(/,/),","===(a=e.current())?null:(e.eatWhile(/\w/),a=e.current().toLowerCase(),t.extenApplication=!1,-1!==r.indexOf(a)?"def":null)):function(e,t){var a="",r=e.next();if(t.blockComment)return"-"==r&&e.match("-;",!0)?t.blockComment=!1:e.skipTo("--;")?(e.next(),e.next(),e.next(),t.blockComment=!1):e.skipToEnd(),"comment";if(";"==r)return e.match("--",!0)&&!e.match("-",!1)?(t.blockComment=!0,"comment"):(e.skipToEnd(),"comment");if("["==r)return e.skipTo("]"),e.eat("]"),"header";if('"'==r)return e.skipTo('"'),"string";if("'"==r)return e.skipTo("'"),"string.special";if("#"==r&&(e.eatWhile(/\w/),a=e.current(),-1!==i.indexOf(a)))return e.skipToEnd(),"strong";if("$"==r&&"{"==e.peek())return e.skipTo("}"),e.eat("}"),"variableName.special";if(e.eatWhile(/\w/),a=e.current(),-1!==n.indexOf(a)){switch(t.extenStart=!0,a){case"same":t.extenSame=!0;break;case"include":case"switch":case"ignorepat":t.extenInclude=!0}return"atom"}}(e,t)},languageData:{commentTokens:{line:";",block:{open:";--",close:"--;"}}}}}}]); +//# sourceMappingURL=2682.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/2682.index.js.map b/pr-preview/pr-770/2682.index.js.map new file mode 100644 index 00000000..2f86bd2f --- /dev/null +++ b/pr-preview/pr-770/2682.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"2682.index.js","mappings":"6HAAA,IAAIA,EAAW,CAAC,QAAS,OAAQ,UAAU,YAAY,UACnDC,EAAW,CAAC,WAAW,SACvBC,EAAW,CACT,iBAAiB,WAAW,SAAS,aAAa,uBAAuB,MACzE,gBAAgB,MAAM,SAAS,eAAe,aAAa,mBAC3D,SAAS,OAAO,uBAAuB,wBAAwB,kBAC/D,gBAAgB,cAAc,kBA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AAOO,YACA,WAGT,GAAS,KAANI,EAGD,OAFAX,EAAOa,OAAO,KACdb,EAAOc,IAAI,KACJ,SAGT,GAAS,KAANH,EAED,OADAX,EAAOa,OAAO,KACP,SAET,GAAS,KAANF,EAED,OADAX,EAAOa,OAAO,KACP,iBAGT,GAAS,KAANF,IACDX,EAAOI,SAAS,MAChBF,EAAMF,EAAOK,WACc,IAAxBlB,EAAMuB,QAAQR,IAEf,OADAF,EAAOO,YACA,SAIX,GAAS,KAANI,GAES,KADAX,EAAOe,OAIf,OAFAf,EAAOa,OAAO,KACdb,EAAOc,IAAI,KACJ,uBAMX,GAFAd,EAAOI,SAAS,MAChBF,EAAMF,EAAOK,WACc,IAAxBnB,EAAMwB,QAAQR,GAAa,CAE5B,OADAD,EAAMR,YAAa,EACZS,GACP,IAAK,OAAQD,EAAMP,WAAY,EAAM,MACrC,IAAK,UACL,IAAK,SACL,IAAK,YACHO,EAAMN,cAAe,EAGvB,MAAO,MACT,CACF,CAkEaqB,CAAWhB,EAAOC,EAI7B,EAEAgB,aAAc,CACZC,cAAe,CAACC,KAAM,IAAKC,MAAO,CAACC,KAAM,MAAOC,MAAO,S","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/asterisk.js"],"sourcesContent":["var atoms = [\"exten\", \"same\", \"include\",\"ignorepat\",\"switch\"],\n dpcmd = [\"#include\",\"#exec\"],\n apps = [\n \"addqueuemember\",\"adsiprog\",\"aelsub\",\"agentlogin\",\"agentmonitoroutgoing\",\"agi\",\n \"alarmreceiver\",\"amd\",\"answer\",\"authenticate\",\"background\",\"backgrounddetect\",\n \"bridge\",\"busy\",\"callcompletioncancel\",\"callcompletionrequest\",\"celgenuserevent\",\n \"changemonitor\",\"chanisavail\",\"channelredirect\",\"chanspy\",\"clearhash\",\"confbridge\",\n \"congestion\",\"continuewhile\",\"controlplayback\",\"dahdiacceptr2call\",\"dahdibarge\",\n \"dahdiras\",\"dahdiscan\",\"dahdisendcallreroutingfacility\",\"dahdisendkeypadfacility\",\n \"datetime\",\"dbdel\",\"dbdeltree\",\"deadagi\",\"dial\",\"dictate\",\"directory\",\"disa\",\n \"dumpchan\",\"eagi\",\"echo\",\"endwhile\",\"exec\",\"execif\",\"execiftime\",\"exitwhile\",\"extenspy\",\n \"externalivr\",\"festival\",\"flash\",\"followme\",\"forkcdr\",\"getcpeid\",\"gosub\",\"gosubif\",\n \"goto\",\"gotoif\",\"gotoiftime\",\"hangup\",\"iax2provision\",\"ices\",\"importvar\",\"incomplete\",\n \"ivrdemo\",\"jabberjoin\",\"jabberleave\",\"jabbersend\",\"jabbersendgroup\",\"jabberstatus\",\n \"jack\",\"log\",\"macro\",\"macroexclusive\",\"macroexit\",\"macroif\",\"mailboxexists\",\"meetme\",\n \"meetmeadmin\",\"meetmechanneladmin\",\"meetmecount\",\"milliwatt\",\"minivmaccmess\",\"minivmdelete\",\n \"minivmgreet\",\"minivmmwi\",\"minivmnotify\",\"minivmrecord\",\"mixmonitor\",\"monitor\",\"morsecode\",\n \"mp3player\",\"mset\",\"musiconhold\",\"nbscat\",\"nocdr\",\"noop\",\"odbc\",\"odbc\",\"odbcfinish\",\n \"originate\",\"ospauth\",\"ospfinish\",\"osplookup\",\"ospnext\",\"page\",\"park\",\"parkandannounce\",\n \"parkedcall\",\"pausemonitor\",\"pausequeuemember\",\"pickup\",\"pickupchan\",\"playback\",\"playtones\",\n \"privacymanager\",\"proceeding\",\"progress\",\"queue\",\"queuelog\",\"raiseexception\",\"read\",\"readexten\",\n \"readfile\",\"receivefax\",\"receivefax\",\"receivefax\",\"record\",\"removequeuemember\",\n \"resetcdr\",\"retrydial\",\"return\",\"ringing\",\"sayalpha\",\"saycountedadj\",\"saycountednoun\",\n \"saycountpl\",\"saydigits\",\"saynumber\",\"sayphonetic\",\"sayunixtime\",\"senddtmf\",\"sendfax\",\n \"sendfax\",\"sendfax\",\"sendimage\",\"sendtext\",\"sendurl\",\"set\",\"setamaflags\",\n \"setcallerpres\",\"setmusiconhold\",\"sipaddheader\",\"sipdtmfmode\",\"sipremoveheader\",\"skel\",\n \"slastation\",\"slatrunk\",\"sms\",\"softhangup\",\"speechactivategrammar\",\"speechbackground\",\n \"speechcreate\",\"speechdeactivategrammar\",\"speechdestroy\",\"speechloadgrammar\",\"speechprocessingsound\",\n \"speechstart\",\"speechunloadgrammar\",\"stackpop\",\"startmusiconhold\",\"stopmixmonitor\",\"stopmonitor\",\n \"stopmusiconhold\",\"stopplaytones\",\"system\",\"testclient\",\"testserver\",\"transfer\",\"tryexec\",\n \"trysystem\",\"unpausemonitor\",\"unpausequeuemember\",\"userevent\",\"verbose\",\"vmauthenticate\",\n \"vmsayname\",\"voicemail\",\"voicemailmain\",\"wait\",\"waitexten\",\"waitfornoise\",\"waitforring\",\n \"waitforsilence\",\"waitmusiconhold\",\"waituntil\",\"while\",\"zapateller\"\n ];\n\nfunction basicToken(stream,state){\n var cur = '';\n var ch = stream.next();\n // comment\n if (state.blockComment) {\n if (ch == \"-\" && stream.match(\"-;\", true)) {\n state.blockComment = false;\n } else if (stream.skipTo(\"--;\")) {\n stream.next();\n stream.next();\n stream.next();\n state.blockComment = false;\n } else {\n stream.skipToEnd();\n }\n return \"comment\";\n }\n if(ch == \";\") {\n if (stream.match(\"--\", true)) {\n if (!stream.match(\"-\", false)) { // Except ;--- is not a block comment\n state.blockComment = true;\n return \"comment\";\n }\n }\n stream.skipToEnd();\n return \"comment\";\n }\n // context\n if(ch == '[') {\n stream.skipTo(']');\n stream.eat(']');\n return \"header\";\n }\n // string\n if(ch == '\"') {\n stream.skipTo('\"');\n return \"string\";\n }\n if(ch == \"'\") {\n stream.skipTo(\"'\");\n return \"string.special\";\n }\n // dialplan commands\n if(ch == '#') {\n stream.eatWhile(/\\w/);\n cur = stream.current();\n if(dpcmd.indexOf(cur) !== -1) {\n stream.skipToEnd();\n return \"strong\";\n }\n }\n // application args\n if(ch == '$'){\n var ch1 = stream.peek();\n if(ch1 == '{'){\n stream.skipTo('}');\n stream.eat('}');\n return \"variableName.special\";\n }\n }\n // extension\n stream.eatWhile(/\\w/);\n cur = stream.current();\n if(atoms.indexOf(cur) !== -1) {\n state.extenStart = true;\n switch(cur) {\n case 'same': state.extenSame = true; break;\n case 'include':\n case 'switch':\n case 'ignorepat':\n state.extenInclude = true;break;\n default:break;\n }\n return \"atom\";\n }\n}\n\nexport const asterisk = {\n name: \"asterisk\",\n startState: function() {\n return {\n blockComment: false,\n extenStart: false,\n extenSame: false,\n extenInclude: false,\n extenExten: false,\n extenPriority: false,\n extenApplication: false\n };\n },\n token: function(stream, state) {\n\n var cur = '';\n if(stream.eatSpace()) return null;\n // extension started\n if(state.extenStart){\n stream.eatWhile(/[^\\s]/);\n cur = stream.current();\n if(/^=>?$/.test(cur)){\n state.extenExten = true;\n state.extenStart = false;\n return \"strong\";\n } else {\n state.extenStart = false;\n stream.skipToEnd();\n return \"error\";\n }\n } else if(state.extenExten) {\n // set exten and priority\n state.extenExten = false;\n state.extenPriority = true;\n stream.eatWhile(/[^,]/);\n if(state.extenInclude) {\n stream.skipToEnd();\n state.extenPriority = false;\n state.extenInclude = false;\n }\n if(state.extenSame) {\n state.extenPriority = false;\n state.extenSame = false;\n state.extenApplication = true;\n }\n return \"tag\";\n } else if(state.extenPriority) {\n state.extenPriority = false;\n state.extenApplication = true;\n stream.next(); // get comma\n if(state.extenSame) return null;\n stream.eatWhile(/[^,]/);\n return \"number\";\n } else if(state.extenApplication) {\n stream.eatWhile(/,/);\n cur = stream.current();\n if(cur === ',') return null;\n stream.eatWhile(/\\w/);\n cur = stream.current().toLowerCase();\n state.extenApplication = false;\n if(apps.indexOf(cur) !== -1){\n return \"def\";\n }\n } else{\n return basicToken(stream,state);\n }\n\n return null;\n },\n\n languageData: {\n commentTokens: {line: \";\", block: {open: \";--\", close: \"--;\"}}\n }\n};\n"],"names":["atoms","dpcmd","apps","asterisk","name","startState","blockComment","extenStart","extenSame","extenInclude","extenExten","extenPriority","extenApplication","token","stream","state","cur","eatSpace","eatWhile","current","test","skipToEnd","next","toLowerCase","indexOf","ch","match","skipTo","eat","peek","basicToken","languageData","commentTokens","line","block","open","close"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/284.thebe-lite.min.js b/pr-preview/pr-770/284.thebe-lite.min.js new file mode 100644 index 00000000..59f7df07 --- /dev/null +++ b/pr-preview/pr-770/284.thebe-lite.min.js @@ -0,0 +1,2 @@ +(()=>{var e,r,t={903:e=>{function r(e){return Promise.resolve().then((()=>{var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}))}r.keys=()=>[],r.resolve=r,r.id=903,e.exports=r}},o={};function i(e){var r=o[e];if(void 0!==r)return r.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,i),n.exports}i.m=t,i.x=()=>{var e=i.O(void 0,[746],(()=>i(2746)));return i.O(e)},i.amdO={},e=[],i.O=(r,t,o,n)=>{if(!t){var a=1/0;for(l=0;l=n)&&Object.keys(i.O).every((e=>i.O[e](t[c])))?t.splice(c--,1):(p=!1,n0&&e[l-1][2]>n;l--)e[l]=e[l-1];e[l]=[t,o,n]},i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((r,t)=>(i.f[t](e,r),r)),[])),i.u=e=>e+".thebe-lite.min.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var r=i.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={284:1,903:1};i.f.i=(r,t)=>{e[r]||importScripts(i.p+i.u(r))};var r=self.webpackChunkthebe_lite=self.webpackChunkthebe_lite||[],t=r.push.bind(r);r.push=r=>{var[o,n,a]=r;for(var p in n)i.o(n,p)&&(i.m[p]=n[p]);for(a&&a(i);o.length;)e[o.pop()]=1;t(r)}})(),r=i.x,i.x=()=>i.e(746).then(r),i.x()})(); +//# sourceMappingURL=284.thebe-lite.min.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/284.thebe-lite.min.js.map b/pr-preview/pr-770/284.thebe-lite.min.js.map new file mode 100644 index 00000000..00895532 --- /dev/null +++ b/pr-preview/pr-770/284.thebe-lite.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"284.thebe-lite.min.js","mappings":"UAAIA,ECAAC,E,WCAJ,SAASC,EAAyBC,GAGjC,OAAOC,QAAQC,UAAUC,MAAK,KAC7B,IAAIC,EAAI,IAAIC,MAAM,uBAAyBL,EAAM,KAEjD,MADAI,EAAEE,KAAO,mBACHF,CAAC,GAET,CACAL,EAAyBQ,KAAO,IAAM,GACtCR,EAAyBG,QAAUH,EACnCA,EAAyBS,GAAK,IAC9BC,EAAOC,QAAUX,C,GCXbY,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaJ,QAGrB,IAAID,EAASE,EAAyBE,GAAY,CAGjDH,QAAS,CAAC,GAOX,OAHAM,EAAoBH,GAAUJ,EAAQA,EAAOC,QAASE,GAG/CH,EAAOC,OACf,CAGAE,EAAoBK,EAAID,EAGxBJ,EAAoBM,EAAI,KAGvB,IAAIC,EAAsBP,EAAoBQ,OAAEL,EAAW,CAAC,MAAM,IAAOH,EAAoB,QAE7F,OADsBA,EAAoBQ,EAAED,EAClB,ECjC3BP,EAAoBS,KAAO,CAAC,EJAxBxB,EAAW,GAC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mE,GAASA,EAAQpE,GACdW,EAASM,QACd2C,EAAgBjD,EAAS0D,OAAS,EACnCN,EAA2BG,EAAK,C,KVpB7BhF,EAAOc,EAAoBM,EAC/BN,EAAoBM,EAAI,IAChBN,EAAoBR,EAAE,KAAKD,KAAKL,GWDdc,EAAoBM,G","sources":["webpack://thebe-lite/webpack/runtime/chunk loaded","webpack://thebe-lite/webpack/runtime/startup chunk dependencies","webpack://thebe-lite/../../node_modules/@jupyterlite/pyodide-kernel/lib/ lazy namespace object","webpack://thebe-lite/webpack/bootstrap","webpack://thebe-lite/webpack/runtime/amd options","webpack://thebe-lite/webpack/runtime/define property getters","webpack://thebe-lite/webpack/runtime/ensure chunk","webpack://thebe-lite/webpack/runtime/get javascript chunk filename","webpack://thebe-lite/webpack/runtime/global","webpack://thebe-lite/webpack/runtime/hasOwnProperty shorthand","webpack://thebe-lite/webpack/runtime/publicPath","webpack://thebe-lite/webpack/runtime/importScripts chunk loading","webpack://thebe-lite/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn __webpack_require__.e(746).then(next);\n};","function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(() => {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = () => ([]);\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = 903;\nmodule.exports = webpackEmptyAsyncContext;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [746], () => (__webpack_require__(2746)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","__webpack_require__.amdO = {};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".thebe-lite.min.js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t284: 1,\n\t903: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = self[\"webpackChunkthebe_lite\"] = self[\"webpackChunkthebe_lite\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","webpackEmptyAsyncContext","req","Promise","resolve","then","e","Error","code","keys","id","module","exports","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","m","x","__webpack_exports__","O","amdO","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","every","key","splice","r","d","definition","o","defineProperty","enumerable","get","f","chunkId","all","reduce","promises","u","g","globalThis","this","Function","window","obj","prop","prototype","hasOwnProperty","call","scriptUrl","importScripts","location","document","currentScript","tagName","toUpperCase","src","scripts","getElementsByTagName","test","replace","p","installedChunks","chunkLoadingGlobal","self","parentChunkLoadingFunction","push","bind","data","moreModules","runtime","pop"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/29.index.js b/pr-preview/pr-770/29.index.js new file mode 100644 index 00000000..f63978d1 --- /dev/null +++ b/pr-preview/pr-770/29.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[29],{29:(e,t,n)=>{n.r(t),n.d(t,{erlang:()=>C});var r=["-type","-spec","-export_type","-opaque"],i=["after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"],o=/[\->,;]/,a=["->",";",","],c=["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"],u=/[\+\-\*\/<>=\|:!]/,s=["=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"],l=/[<\(\[\{]/,_=["<<","(","[","{"],f=/[>\)\]\}]/,p=["}","]",")",">>"],m=["is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_record","is_reference","is_tuple","atom","binary","bitstring","boolean","function","integer","list","number","pid","port","record","reference","tuple"],b=["abs","adler32","adler32_combine","alive","apply","atom_to_binary","atom_to_list","binary_to_atom","binary_to_existing_atom","binary_to_list","binary_to_term","bit_size","bitstring_to_list","byte_size","check_process_code","contact_binary","crc32","crc32_combine","date","decode_packet","delete_module","disconnect_node","element","erase","exit","float","float_to_list","garbage_collect","get","get_keys","group_leader","halt","hd","integer_to_list","internal_bif","iolist_size","iolist_to_binary","is_alive","is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_process_alive","is_record","is_reference","is_tuple","length","link","list_to_atom","list_to_binary","list_to_bitstring","list_to_existing_atom","list_to_float","list_to_integer","list_to_pid","list_to_tuple","load_module","make_ref","module_loaded","monitor_node","node","node_link","node_unlink","nodes","notalive","now","open_port","pid_to_list","port_close","port_command","port_connect","port_control","pre_loaded","process_flag","process_info","processes","purge_module","put","register","registered","round","self","setelement","size","spawn","spawn_link","spawn_monitor","spawn_opt","split_binary","statistics","term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"],d=/[\w@Ø-ÞÀ-Öß-öø-ÿ]/,k=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;function g(e,t,n){if(1==e.current().length&&t.test(e.current())){for(e.backUp(1);t.test(e.peek());)if(e.next(),x(e.current(),n))return!0;e.backUp(e.current().length-1)}return!1}function h(e,t,n){if(1==e.current().length&&t.test(e.current())){for(;t.test(e.peek());)e.next();for(;01&&"fun"===e[t].type&&"fun"===e[t-1].token)return e.slice(0,t-1);switch(e[t].token){case"}":return A(e,{g:["{"]});case"]":return A(e,{i:["["]});case")":return A(e,{i:["("]});case">>":return A(e,{i:["<<"]});case"end":return A(e,{i:["begin","case","fun","if","receive","try"]});case",":return A(e,{e:["begin","try","when","->",",","(","[","{","<<"]});case"->":return A(e,{r:["when"],m:["try","if","case","receive"]});case";":return A(e,{E:["case","fun","if","receive","try","when"]});case"catch":return A(e,{e:["try"]});case"of":return A(e,{e:["case"]});case"after":return A(e,{e:["receive","try"]});default:return e}}(e.tokenStack))}(e,function(e,t){return z(t.current(),t.column(),t.indentation(),e)}(n,t)),n){case"atom":case"boolean":return"atom";case"attribute":return"attribute";case"builtin":return"builtin";case"close_paren":case"colon":case"dot":case"open_paren":case"separator":default:return null;case"comment":return"comment";case"error":return"error";case"fun":return"meta";case"function":return"tag";case"guard":return"property";case"keyword":return"keyword";case"macro":return"macroName";case"number":return"number";case"operator":return"operator";case"record":return"bracket";case"string":return"string";case"type":return"def";case"variable":return"variable"}}function z(e,t,n,r){return{token:e,column:t,indent:n,type:r}}function W(e){return z(e,0,0,e)}function U(e,t){var n=e.tokenStack.length,r=t||1;return!(n({tokenStack:[],in_string:!1,in_atom:!1}),token:function(e,t){if(t.in_string)return t.in_string=!y(e),S(t,e,"string");if(t.in_atom)return t.in_atom=!v(e),S(t,e,"atom");if(e.eatSpace())return S(t,e,"whitespace");if(!U(t)&&e.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/))return x(e.current(),r)?S(t,e,"type"):S(t,e,"attribute");var n=e.next();if("%"==n)return e.skipToEnd(),S(t,e,"comment");if(":"==n)return S(t,e,"colon");if("?"==n)return e.eatSpace(),e.eatWhile(d),S(t,e,"macro");if("#"==n)return e.eatSpace(),e.eatWhile(d),S(t,e,"record");if("$"==n)return"\\"!=e.next()||e.match(k)?S(t,e,"number"):S(t,e,"error");if("."==n)return S(t,e,"dot");if("'"==n){if(!(t.in_atom=!v(e))){if(e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),S(t,e,"fun");if(e.match(/\s*\(/,!1)||e.match(/\s*:/,!1))return S(t,e,"function")}return S(t,e,"atom")}if('"'==n)return t.in_string=!y(e),S(t,e,"string");if(/[A-Z_Ø-ÞÀ-Ö]/.test(n))return e.eatWhile(d),S(t,e,"variable");if(/[a-z_ß-öø-ÿ]/.test(n)){if(e.eatWhile(d),e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),S(t,e,"fun");var w=e.current();return x(w,i)?S(t,e,"keyword"):x(w,c)?S(t,e,"operator"):e.match(/\s*\(/,!1)?!x(w,b)||":"==U(t).token&&"erlang"!=U(t,2).token?x(w,m)?S(t,e,"guard"):S(t,e,"function"):S(t,e,"builtin"):":"==function(e){var t=e.match(/^\s*([^\s%])/,!1);return t?t[1]:""}(e)?S(t,e,"erlang"==w?"builtin":"function"):x(w,["true","false"])?S(t,e,"boolean"):S(t,e,"atom")}var z=/[0-9]/;return z.test(n)?(e.eatWhile(z),e.eat("#")?e.eatWhile(/[0-9a-zA-Z]/)||e.backUp(1):e.eat(".")&&(e.eatWhile(z)?e.eat(/[eE]/)&&(e.eat(/[-+]/)?e.eatWhile(z)||e.backUp(2):e.eatWhile(z)||e.backUp(1)):e.backUp(1)),S(t,e,"number")):g(e,l,_)?S(t,e,"open_paren"):g(e,f,p)?S(t,e,"close_paren"):h(e,o,a)?S(t,e,"separator"):h(e,u,s)?S(t,e,"operator"):S(t,e,null)},indent:function(e,t,n){var r,i,o=q(i=t.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/))&&0===i.index?i[0]:"",a=U(e,1),c=U(e,2);return e.in_string||e.in_atom?null:c?"when"==a.token?a.column+n.unit:"when"===o&&"function"===c.type?c.indent+n.unit:"("===o&&"fun"===a.token?a.column+3:"catch"===o&&(r=E(e,["try"]))?r.column:x(o,["end","after","of"])?(r=E(e,["begin","case","fun","if","receive","try"]))?r.column:null:x(o,p)?(r=E(e,_))?r.column:null:x(a.token,[",","|","||"])||x(o,[",","|","||"])?(r=function(e){var t=e.tokenStack.slice(0,-1),n=Z(t,"type",["open_paren"]);return!!q(t[n])&&t[n]}(e))?r.column+r.token.length:n.unit:"->"==a.token?x(c.token,["receive","case","if","try"])?c.column+n.unit+n.unit:c.column+n.unit:x(a.token,_)?a.column+a.token.length:(r=function(e){var t=e.tokenStack,n=Z(t,"type",["open_paren","separator","keyword"]),r=Z(t,"type",["operator"]);return q(n)&&q(r)&&n,;]/;\nvar separatorWords = [\n \"->\",\";\",\",\"];\n\nvar operatorAtomWords = [\n \"and\",\"andalso\",\"band\",\"bnot\",\"bor\",\"bsl\",\"bsr\",\"bxor\",\n \"div\",\"not\",\"or\",\"orelse\",\"rem\",\"xor\"];\n\nvar operatorSymbolRE = /[\\+\\-\\*\\/<>=\\|:!]/;\nvar operatorSymbolWords = [\n \"=\",\"+\",\"-\",\"*\",\"/\",\">\",\">=\",\"<\",\"=<\",\"=:=\",\"==\",\"=/=\",\"/=\",\"||\",\"<-\",\"!\"];\n\nvar openParenRE = /[<\\(\\[\\{]/;\nvar openParenWords = [\n \"<<\",\"(\",\"[\",\"{\"];\n\nvar closeParenRE = /[>\\)\\]\\}]/;\nvar closeParenWords = [\n \"}\",\"]\",\")\",\">>\"];\n\nvar guardWords = [\n \"is_atom\",\"is_binary\",\"is_bitstring\",\"is_boolean\",\"is_float\",\n \"is_function\",\"is_integer\",\"is_list\",\"is_number\",\"is_pid\",\n \"is_port\",\"is_record\",\"is_reference\",\"is_tuple\",\n \"atom\",\"binary\",\"bitstring\",\"boolean\",\"function\",\"integer\",\"list\",\n \"number\",\"pid\",\"port\",\"record\",\"reference\",\"tuple\"];\n\nvar bifWords = [\n \"abs\",\"adler32\",\"adler32_combine\",\"alive\",\"apply\",\"atom_to_binary\",\n \"atom_to_list\",\"binary_to_atom\",\"binary_to_existing_atom\",\n \"binary_to_list\",\"binary_to_term\",\"bit_size\",\"bitstring_to_list\",\n \"byte_size\",\"check_process_code\",\"contact_binary\",\"crc32\",\n \"crc32_combine\",\"date\",\"decode_packet\",\"delete_module\",\n \"disconnect_node\",\"element\",\"erase\",\"exit\",\"float\",\"float_to_list\",\n \"garbage_collect\",\"get\",\"get_keys\",\"group_leader\",\"halt\",\"hd\",\n \"integer_to_list\",\"internal_bif\",\"iolist_size\",\"iolist_to_binary\",\n \"is_alive\",\"is_atom\",\"is_binary\",\"is_bitstring\",\"is_boolean\",\n \"is_float\",\"is_function\",\"is_integer\",\"is_list\",\"is_number\",\"is_pid\",\n \"is_port\",\"is_process_alive\",\"is_record\",\"is_reference\",\"is_tuple\",\n \"length\",\"link\",\"list_to_atom\",\"list_to_binary\",\"list_to_bitstring\",\n \"list_to_existing_atom\",\"list_to_float\",\"list_to_integer\",\n \"list_to_pid\",\"list_to_tuple\",\"load_module\",\"make_ref\",\"module_loaded\",\n \"monitor_node\",\"node\",\"node_link\",\"node_unlink\",\"nodes\",\"notalive\",\n \"now\",\"open_port\",\"pid_to_list\",\"port_close\",\"port_command\",\n \"port_connect\",\"port_control\",\"pre_loaded\",\"process_flag\",\n \"process_info\",\"processes\",\"purge_module\",\"put\",\"register\",\n \"registered\",\"round\",\"self\",\"setelement\",\"size\",\"spawn\",\"spawn_link\",\n \"spawn_monitor\",\"spawn_opt\",\"split_binary\",\"statistics\",\n \"term_to_binary\",\"time\",\"throw\",\"tl\",\"trunc\",\"tuple_size\",\n \"tuple_to_list\",\"unlink\",\"unregister\",\"whereis\"];\n\n// upper case: [A-Z] [Ø-Þ] [À-Ö]\n// lower case: [a-z] [ß-ö] [ø-ÿ]\nvar anumRE = /[\\w@Ø-ÞÀ-Öß-öø-ÿ]/;\nvar escapesRE =\n /[0-7]{1,3}|[bdefnrstv\\\\\"']|\\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;\n\n/////////////////////////////////////////////////////////////////////////////\n// tokenizer\n\nfunction tokenizer(stream,state) {\n // in multi-line string\n if (state.in_string) {\n state.in_string = (!doubleQuote(stream));\n return rval(state,stream,\"string\");\n }\n\n // in multi-line atom\n if (state.in_atom) {\n state.in_atom = (!singleQuote(stream));\n return rval(state,stream,\"atom\");\n }\n\n // whitespace\n if (stream.eatSpace()) {\n return rval(state,stream,\"whitespace\");\n }\n\n // attributes and type specs\n if (!peekToken(state) &&\n stream.match(/-\\s*[a-zß-öø-ÿ][\\wØ-ÞÀ-Öß-öø-ÿ]*/)) {\n if (is_member(stream.current(),typeWords)) {\n return rval(state,stream,\"type\");\n }else{\n return rval(state,stream,\"attribute\");\n }\n }\n\n var ch = stream.next();\n\n // comment\n if (ch == '%') {\n stream.skipToEnd();\n return rval(state,stream,\"comment\");\n }\n\n // colon\n if (ch == \":\") {\n return rval(state,stream,\"colon\");\n }\n\n // macro\n if (ch == '?') {\n stream.eatSpace();\n stream.eatWhile(anumRE);\n return rval(state,stream,\"macro\");\n }\n\n // record\n if (ch == \"#\") {\n stream.eatSpace();\n stream.eatWhile(anumRE);\n return rval(state,stream,\"record\");\n }\n\n // dollar escape\n if (ch == \"$\") {\n if (stream.next() == \"\\\\\" && !stream.match(escapesRE)) {\n return rval(state,stream,\"error\");\n }\n return rval(state,stream,\"number\");\n }\n\n // dot\n if (ch == \".\") {\n return rval(state,stream,\"dot\");\n }\n\n // quoted atom\n if (ch == '\\'') {\n if (!(state.in_atom = (!singleQuote(stream)))) {\n if (stream.match(/\\s*\\/\\s*[0-9]/,false)) {\n stream.match(/\\s*\\/\\s*[0-9]/,true);\n return rval(state,stream,\"fun\"); // 'f'/0 style fun\n }\n if (stream.match(/\\s*\\(/,false) || stream.match(/\\s*:/,false)) {\n return rval(state,stream,\"function\");\n }\n }\n return rval(state,stream,\"atom\");\n }\n\n // string\n if (ch == '\"') {\n state.in_string = (!doubleQuote(stream));\n return rval(state,stream,\"string\");\n }\n\n // variable\n if (/[A-Z_Ø-ÞÀ-Ö]/.test(ch)) {\n stream.eatWhile(anumRE);\n return rval(state,stream,\"variable\");\n }\n\n // atom/keyword/BIF/function\n if (/[a-z_ß-öø-ÿ]/.test(ch)) {\n stream.eatWhile(anumRE);\n\n if (stream.match(/\\s*\\/\\s*[0-9]/,false)) {\n stream.match(/\\s*\\/\\s*[0-9]/,true);\n return rval(state,stream,\"fun\"); // f/0 style fun\n }\n\n var w = stream.current();\n\n if (is_member(w,keywordWords)) {\n return rval(state,stream,\"keyword\");\n }else if (is_member(w,operatorAtomWords)) {\n return rval(state,stream,\"operator\");\n }else if (stream.match(/\\s*\\(/,false)) {\n // 'put' and 'erlang:put' are bifs, 'foo:put' is not\n if (is_member(w,bifWords) &&\n ((peekToken(state).token != \":\") ||\n (peekToken(state,2).token == \"erlang\"))) {\n return rval(state,stream,\"builtin\");\n }else if (is_member(w,guardWords)) {\n return rval(state,stream,\"guard\");\n }else{\n return rval(state,stream,\"function\");\n }\n }else if (lookahead(stream) == \":\") {\n if (w == \"erlang\") {\n return rval(state,stream,\"builtin\");\n } else {\n return rval(state,stream,\"function\");\n }\n }else if (is_member(w,[\"true\",\"false\"])) {\n return rval(state,stream,\"boolean\");\n }else{\n return rval(state,stream,\"atom\");\n }\n }\n\n // number\n var digitRE = /[0-9]/;\n var radixRE = /[0-9a-zA-Z]/; // 36#zZ style int\n if (digitRE.test(ch)) {\n stream.eatWhile(digitRE);\n if (stream.eat('#')) { // 36#aZ style integer\n if (!stream.eatWhile(radixRE)) {\n stream.backUp(1); //\"36#\" - syntax error\n }\n } else if (stream.eat('.')) { // float\n if (!stream.eatWhile(digitRE)) {\n stream.backUp(1); // \"3.\" - probably end of function\n } else {\n if (stream.eat(/[eE]/)) { // float with exponent\n if (stream.eat(/[-+]/)) {\n if (!stream.eatWhile(digitRE)) {\n stream.backUp(2); // \"2e-\" - syntax error\n }\n } else {\n if (!stream.eatWhile(digitRE)) {\n stream.backUp(1); // \"2e\" - syntax error\n }\n }\n }\n }\n }\n return rval(state,stream,\"number\"); // normal integer\n }\n\n // open parens\n if (nongreedy(stream,openParenRE,openParenWords)) {\n return rval(state,stream,\"open_paren\");\n }\n\n // close parens\n if (nongreedy(stream,closeParenRE,closeParenWords)) {\n return rval(state,stream,\"close_paren\");\n }\n\n // separators\n if (greedy(stream,separatorRE,separatorWords)) {\n return rval(state,stream,\"separator\");\n }\n\n // operators\n if (greedy(stream,operatorSymbolRE,operatorSymbolWords)) {\n return rval(state,stream,\"operator\");\n }\n\n return rval(state,stream,null);\n}\n\n/////////////////////////////////////////////////////////////////////////////\n// utilities\nfunction nongreedy(stream,re,words) {\n if (stream.current().length == 1 && re.test(stream.current())) {\n stream.backUp(1);\n while (re.test(stream.peek())) {\n stream.next();\n if (is_member(stream.current(),words)) {\n return true;\n }\n }\n stream.backUp(stream.current().length-1);\n }\n return false;\n}\n\nfunction greedy(stream,re,words) {\n if (stream.current().length == 1 && re.test(stream.current())) {\n while (re.test(stream.peek())) {\n stream.next();\n }\n while (0 < stream.current().length) {\n if (is_member(stream.current(),words)) {\n return true;\n }else{\n stream.backUp(1);\n }\n }\n stream.next();\n }\n return false;\n}\n\nfunction doubleQuote(stream) {\n return quote(stream, '\"', '\\\\');\n}\n\nfunction singleQuote(stream) {\n return quote(stream,'\\'','\\\\');\n}\n\nfunction quote(stream,quoteChar,escapeChar) {\n while (!stream.eol()) {\n var ch = stream.next();\n if (ch == quoteChar) {\n return true;\n }else if (ch == escapeChar) {\n stream.next();\n }\n }\n return false;\n}\n\nfunction lookahead(stream) {\n var m = stream.match(/^\\s*([^\\s%])/, false)\n return m ? m[1] : \"\";\n}\n\nfunction is_member(element,list) {\n return (-1 < list.indexOf(element));\n}\n\nfunction rval(state,stream,type) {\n\n // parse stack\n pushToken(state,realToken(type,stream));\n\n // map erlang token type to CodeMirror style class\n // erlang -> CodeMirror tag\n switch (type) {\n case \"atom\": return \"atom\";\n case \"attribute\": return \"attribute\";\n case \"boolean\": return \"atom\";\n case \"builtin\": return \"builtin\";\n case \"close_paren\": return null;\n case \"colon\": return null;\n case \"comment\": return \"comment\";\n case \"dot\": return null;\n case \"error\": return \"error\";\n case \"fun\": return \"meta\";\n case \"function\": return \"tag\";\n case \"guard\": return \"property\";\n case \"keyword\": return \"keyword\";\n case \"macro\": return \"macroName\";\n case \"number\": return \"number\";\n case \"open_paren\": return null;\n case \"operator\": return \"operator\";\n case \"record\": return \"bracket\";\n case \"separator\": return null;\n case \"string\": return \"string\";\n case \"type\": return \"def\";\n case \"variable\": return \"variable\";\n default: return null;\n }\n}\n\nfunction aToken(tok,col,ind,typ) {\n return {token: tok,\n column: col,\n indent: ind,\n type: typ};\n}\n\nfunction realToken(type,stream) {\n return aToken(stream.current(),\n stream.column(),\n stream.indentation(),\n type);\n}\n\nfunction fakeToken(type) {\n return aToken(type,0,0,type);\n}\n\nfunction peekToken(state,depth) {\n var len = state.tokenStack.length;\n var dep = (depth ? depth : 1);\n\n if (len < dep) {\n return false;\n }else{\n return state.tokenStack[len-dep];\n }\n}\n\nfunction pushToken(state,token) {\n\n if (!(token.type == \"comment\" || token.type == \"whitespace\")) {\n state.tokenStack = maybe_drop_pre(state.tokenStack,token);\n state.tokenStack = maybe_drop_post(state.tokenStack);\n }\n}\n\nfunction maybe_drop_pre(s,token) {\n var last = s.length-1;\n\n if (0 < last && s[last].type === \"record\" && token.type === \"dot\") {\n s.pop();\n }else if (0 < last && s[last].type === \"group\") {\n s.pop();\n s.push(token);\n }else{\n s.push(token);\n }\n return s;\n}\n\nfunction maybe_drop_post(s) {\n if (!s.length) return s\n var last = s.length-1;\n\n if (s[last].type === \"dot\") {\n return [];\n }\n if (last > 1 && s[last].type === \"fun\" && s[last-1].token === \"fun\") {\n return s.slice(0,last-1);\n }\n switch (s[last].token) {\n case \"}\": return d(s,{g:[\"{\"]});\n case \"]\": return d(s,{i:[\"[\"]});\n case \")\": return d(s,{i:[\"(\"]});\n case \">>\": return d(s,{i:[\"<<\"]});\n case \"end\": return d(s,{i:[\"begin\",\"case\",\"fun\",\"if\",\"receive\",\"try\"]});\n case \",\": return d(s,{e:[\"begin\",\"try\",\"when\",\"->\",\n \",\",\"(\",\"[\",\"{\",\"<<\"]});\n case \"->\": return d(s,{r:[\"when\"],\n m:[\"try\",\"if\",\"case\",\"receive\"]});\n case \";\": return d(s,{E:[\"case\",\"fun\",\"if\",\"receive\",\"try\",\"when\"]});\n case \"catch\":return d(s,{e:[\"try\"]});\n case \"of\": return d(s,{e:[\"case\"]});\n case \"after\":return d(s,{e:[\"receive\",\"try\"]});\n default: return s;\n }\n}\n\nfunction d(stack,tt) {\n // stack is a stack of Token objects.\n // tt is an object; {type:tokens}\n // type is a char, tokens is a list of token strings.\n // The function returns (possibly truncated) stack.\n // It will descend the stack, looking for a Token such that Token.token\n // is a member of tokens. If it does not find that, it will normally (but\n // see \"E\" below) return stack. If it does find a match, it will remove\n // all the Tokens between the top and the matched Token.\n // If type is \"m\", that is all it does.\n // If type is \"i\", it will also remove the matched Token and the top Token.\n // If type is \"g\", like \"i\", but add a fake \"group\" token at the top.\n // If type is \"r\", it will remove the matched Token, but not the top Token.\n // If type is \"e\", it will keep the matched Token but not the top Token.\n // If type is \"E\", it behaves as for type \"e\", except if there is no match,\n // in which case it will return an empty stack.\n\n for (var type in tt) {\n var len = stack.length-1;\n var tokens = tt[type];\n for (var i = len-1; -1 < i ; i--) {\n if (is_member(stack[i].token,tokens)) {\n var ss = stack.slice(0,i);\n switch (type) {\n case \"m\": return ss.concat(stack[i]).concat(stack[len]);\n case \"r\": return ss.concat(stack[len]);\n case \"i\": return ss;\n case \"g\": return ss.concat(fakeToken(\"group\"));\n case \"E\": return ss.concat(stack[i]);\n case \"e\": return ss.concat(stack[i]);\n }\n }\n }\n }\n return (type == \"E\" ? [] : stack);\n}\n\n/////////////////////////////////////////////////////////////////////////////\n// indenter\n\nfunction indenter(state, textAfter, cx) {\n var t;\n var wordAfter = wordafter(textAfter);\n var currT = peekToken(state,1);\n var prevT = peekToken(state,2);\n\n if (state.in_string || state.in_atom) {\n return null;\n }else if (!prevT) {\n return 0;\n }else if (currT.token == \"when\") {\n return currT.column + cx.unit;\n }else if (wordAfter === \"when\" && prevT.type === \"function\") {\n return prevT.indent+cx.unit;\n }else if (wordAfter === \"(\" && currT.token === \"fun\") {\n return currT.column+3;\n }else if (wordAfter === \"catch\" && (t = getToken(state,[\"try\"]))) {\n return t.column;\n }else if (is_member(wordAfter,[\"end\",\"after\",\"of\"])) {\n t = getToken(state,[\"begin\",\"case\",\"fun\",\"if\",\"receive\",\"try\"]);\n return t ? t.column : null;\n }else if (is_member(wordAfter,closeParenWords)) {\n t = getToken(state,openParenWords);\n return t ? t.column : null;\n }else if (is_member(currT.token,[\",\",\"|\",\"||\"]) ||\n is_member(wordAfter,[\",\",\"|\",\"||\"])) {\n t = postcommaToken(state);\n return t ? t.column+t.token.length : cx.unit;\n }else if (currT.token == \"->\") {\n if (is_member(prevT.token, [\"receive\",\"case\",\"if\",\"try\"])) {\n return prevT.column+cx.unit+cx.unit;\n }else{\n return prevT.column+cx.unit;\n }\n }else if (is_member(currT.token,openParenWords)) {\n return currT.column+currT.token.length;\n }else{\n t = defaultToken(state);\n return truthy(t) ? t.column+cx.unit : 0;\n }\n}\n\nfunction wordafter(str) {\n var m = str.match(/,|[a-z]+|\\}|\\]|\\)|>>|\\|+|\\(/);\n\n return truthy(m) && (m.index === 0) ? m[0] : \"\";\n}\n\nfunction postcommaToken(state) {\n var objs = state.tokenStack.slice(0,-1);\n var i = getTokenIndex(objs,\"type\",[\"open_paren\"]);\n\n return truthy(objs[i]) ? objs[i] : false;\n}\n\nfunction defaultToken(state) {\n var objs = state.tokenStack;\n var stop = getTokenIndex(objs,\"type\",[\"open_paren\",\"separator\",\"keyword\"]);\n var oper = getTokenIndex(objs,\"type\",[\"operator\"]);\n\n if (truthy(stop) && truthy(oper) && stop < oper) {\n return objs[stop+1];\n } else if (truthy(stop)) {\n return objs[stop];\n } else {\n return false;\n }\n}\n\nfunction getToken(state,tokens) {\n var objs = state.tokenStack;\n var i = getTokenIndex(objs,\"token\",tokens);\n\n return truthy(objs[i]) ? objs[i] : false;\n}\n\nfunction getTokenIndex(objs,propname,propvals) {\n\n for (var i = objs.length-1; -1 < i ; i--) {\n if (is_member(objs[i][propname],propvals)) {\n return i;\n }\n }\n return false;\n}\n\nfunction truthy(x) {\n return (x !== false) && (x != null);\n}\n\n/////////////////////////////////////////////////////////////////////////////\n// this object defines the mode\n\nexport const erlang = {\n name: \"erlang\",\n startState() {\n return {tokenStack: [],\n in_string: false,\n in_atom: false};\n },\n\n token: tokenizer,\n\n indent: indenter,\n\n languageData: {\n commentTokens: {line: \"%\"}\n }\n};\n\n"],"names":["typeWords","keywordWords","separatorRE","separatorWords","operatorAtomWords","operatorSymbolRE","operatorSymbolWords","openParenRE","openParenWords","closeParenRE","closeParenWords","guardWords","bifWords","anumRE","escapesRE","nongreedy","stream","re","words","current","length","test","backUp","peek","next","is_member","greedy","doubleQuote","quote","singleQuote","quoteChar","escapeChar","eol","ch","element","list","indexOf","rval","state","type","token","tokenStack","s","last","pop","push","maybe_drop_pre","slice","d","g","i","e","r","m","E","maybe_drop_post","pushToken","aToken","column","indentation","realToken","tok","col","ind","typ","indent","fakeToken","peekToken","depth","len","dep","stack","tt","tokens","ss","concat","getToken","objs","getTokenIndex","truthy","propname","propvals","x","erlang","name","startState","in_string","in_atom","eatSpace","match","skipToEnd","eatWhile","w","lookahead","digitRE","eat","textAfter","cx","t","wordAfter","index","currT","prevT","unit","postcommaToken","stop","oper","defaultToken","languageData","commentTokens","line"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/3024.index.js b/pr-preview/pr-770/3024.index.js new file mode 100644 index 00000000..0cbbd450 --- /dev/null +++ b/pr-preview/pr-770/3024.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[3024],{3024:(e,t,n)=>{n.r(t),n.d(t,{clojure:()=>g});var r=["false","nil","true"],a=[".","catch","def","do","if","monitor-enter","monitor-exit","new","quote","recur","set!","throw","try","var"],s=["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","cast","cat","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop","pop!","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seqable?","seque","sequence","sequential?","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","uri?","use","uuid?","val","vals","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"],o=y(r),i=y(a),c=y(s),d=y(["->","->>","as->","binding","bound-fn","case","catch","comment","cond","cond->","cond->>","condp","def","definterface","defmethod","defn","defmacro","defprotocol","defrecord","defstruct","deftype","do","doseq","dotimes","doto","extend","extend-protocol","extend-type","fn","for","future","if","if-let","if-not","if-some","let","letfn","locking","loop","ns","proxy","reify","struct-map","some->","some->>","try","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn"]),l=/^(?:[\\\[\]\s"(),;@^`{}~]|$)/,u=/^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,p=/^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,m=/^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~.][^\\\[\]\s"(),;@^`{}~.\/]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~.][^\\\[\]\s"(),;@^`{}~.\/]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/;function f(e,t){if(e.eatSpace()||e.eat(","))return["space",null];if(e.match(u))return[null,"number"];if(e.match(p))return[null,"string.special"];if(e.eat(/^"/))return(t.tokenize=h)(e,t);if(e.eat(/^[(\[{]/))return["open","bracket"];if(e.eat(/^[)\]}]/))return["close","bracket"];if(e.eat(/^;/))return e.skipToEnd(),["space","comment"];if(e.eat(/^[#'@^`~]/))return[null,"meta"];var n=e.match(m),r=n&&n[0];return r?"comment"===r&&"("===t.lastToken?(t.tokenize=b)(e,t):k(r,o)||":"===r.charAt(0)?["symbol","atom"]:k(r,i)||k(r,c)?["symbol","keyword"]:"("===t.lastToken?["symbol","builtin"]:["symbol","variable"]:(e.next(),e.eatWhile((function(e){return!k(e,l)})),[null,"error"])}function h(e,t){for(var n,r=!1;n=e.next();){if('"'===n&&!r){t.tokenize=f;break}r=!r&&"\\"===n}return[null,"string"]}function b(e,t){for(var n,r=1;n=e.next();)if(")"===n&&r--,"("===n&&r++,0===r){e.backUp(1),t.tokenize=f;break}return["space","comment"]}function y(e){for(var t={},n=0;n\", \"->>\", \"->ArrayChunk\", \"->Eduction\", \"->Vec\", \"->VecNode\",\n \"->VecSeq\", \"-cache-protocol-fn\", \"-reset-methods\", \"..\", \"/\", \"<\", \"<=\",\n \"=\", \"==\", \">\", \">=\", \"EMPTY-NODE\", \"Inst\", \"StackTraceElement->vec\",\n \"Throwable->map\", \"accessor\", \"aclone\", \"add-classpath\", \"add-watch\",\n \"agent\", \"agent-error\", \"agent-errors\", \"aget\", \"alength\", \"alias\",\n \"all-ns\", \"alter\", \"alter-meta!\", \"alter-var-root\", \"amap\", \"ancestors\",\n \"and\", \"any?\", \"apply\", \"areduce\", \"array-map\", \"as->\", \"aset\",\n \"aset-boolean\", \"aset-byte\", \"aset-char\", \"aset-double\", \"aset-float\",\n \"aset-int\", \"aset-long\", \"aset-short\", \"assert\", \"assoc\", \"assoc!\",\n \"assoc-in\", \"associative?\", \"atom\", \"await\", \"await-for\", \"await1\",\n \"bases\", \"bean\", \"bigdec\", \"bigint\", \"biginteger\", \"binding\", \"bit-and\",\n \"bit-and-not\", \"bit-clear\", \"bit-flip\", \"bit-not\", \"bit-or\", \"bit-set\",\n \"bit-shift-left\", \"bit-shift-right\", \"bit-test\", \"bit-xor\", \"boolean\",\n \"boolean-array\", \"boolean?\", \"booleans\", \"bound-fn\", \"bound-fn*\",\n \"bound?\", \"bounded-count\", \"butlast\", \"byte\", \"byte-array\", \"bytes\",\n \"bytes?\", \"case\", \"cast\", \"cat\", \"char\", \"char-array\",\n \"char-escape-string\", \"char-name-string\", \"char?\", \"chars\", \"chunk\",\n \"chunk-append\", \"chunk-buffer\", \"chunk-cons\", \"chunk-first\", \"chunk-next\",\n \"chunk-rest\", \"chunked-seq?\", \"class\", \"class?\", \"clear-agent-errors\",\n \"clojure-version\", \"coll?\", \"comment\", \"commute\", \"comp\", \"comparator\",\n \"compare\", \"compare-and-set!\", \"compile\", \"complement\", \"completing\",\n \"concat\", \"cond\", \"cond->\", \"cond->>\", \"condp\", \"conj\", \"conj!\", \"cons\",\n \"constantly\", \"construct-proxy\", \"contains?\", \"count\", \"counted?\",\n \"create-ns\", \"create-struct\", \"cycle\", \"dec\", \"dec'\", \"decimal?\",\n \"declare\", \"dedupe\", \"default-data-readers\", \"definline\", \"definterface\",\n \"defmacro\", \"defmethod\", \"defmulti\", \"defn\", \"defn-\", \"defonce\",\n \"defprotocol\", \"defrecord\", \"defstruct\", \"deftype\", \"delay\", \"delay?\",\n \"deliver\", \"denominator\", \"deref\", \"derive\", \"descendants\", \"destructure\",\n \"disj\", \"disj!\", \"dissoc\", \"dissoc!\", \"distinct\", \"distinct?\", \"doall\",\n \"dorun\", \"doseq\", \"dosync\", \"dotimes\", \"doto\", \"double\", \"double-array\",\n \"double?\", \"doubles\", \"drop\", \"drop-last\", \"drop-while\", \"eduction\",\n \"empty\", \"empty?\", \"ensure\", \"ensure-reduced\", \"enumeration-seq\",\n \"error-handler\", \"error-mode\", \"eval\", \"even?\", \"every-pred\", \"every?\",\n \"ex-data\", \"ex-info\", \"extend\", \"extend-protocol\", \"extend-type\",\n \"extenders\", \"extends?\", \"false?\", \"ffirst\", \"file-seq\", \"filter\",\n \"filterv\", \"find\", \"find-keyword\", \"find-ns\", \"find-protocol-impl\",\n \"find-protocol-method\", \"find-var\", \"first\", \"flatten\", \"float\",\n \"float-array\", \"float?\", \"floats\", \"flush\", \"fn\", \"fn?\", \"fnext\", \"fnil\",\n \"for\", \"force\", \"format\", \"frequencies\", \"future\", \"future-call\",\n \"future-cancel\", \"future-cancelled?\", \"future-done?\", \"future?\",\n \"gen-class\", \"gen-interface\", \"gensym\", \"get\", \"get-in\", \"get-method\",\n \"get-proxy-class\", \"get-thread-bindings\", \"get-validator\", \"group-by\",\n \"halt-when\", \"hash\", \"hash-combine\", \"hash-map\", \"hash-ordered-coll\",\n \"hash-set\", \"hash-unordered-coll\", \"ident?\", \"identical?\", \"identity\",\n \"if-let\", \"if-not\", \"if-some\", \"ifn?\", \"import\", \"in-ns\", \"inc\", \"inc'\",\n \"indexed?\", \"init-proxy\", \"inst-ms\", \"inst-ms*\", \"inst?\", \"instance?\",\n \"int\", \"int-array\", \"int?\", \"integer?\", \"interleave\", \"intern\",\n \"interpose\", \"into\", \"into-array\", \"ints\", \"io!\", \"isa?\", \"iterate\",\n \"iterator-seq\", \"juxt\", \"keep\", \"keep-indexed\", \"key\", \"keys\", \"keyword\",\n \"keyword?\", \"last\", \"lazy-cat\", \"lazy-seq\", \"let\", \"letfn\", \"line-seq\",\n \"list\", \"list*\", \"list?\", \"load\", \"load-file\", \"load-reader\",\n \"load-string\", \"loaded-libs\", \"locking\", \"long\", \"long-array\", \"longs\",\n \"loop\", \"macroexpand\", \"macroexpand-1\", \"make-array\", \"make-hierarchy\",\n \"map\", \"map-entry?\", \"map-indexed\", \"map?\", \"mapcat\", \"mapv\", \"max\",\n \"max-key\", \"memfn\", \"memoize\", \"merge\", \"merge-with\", \"meta\",\n \"method-sig\", \"methods\", \"min\", \"min-key\", \"mix-collection-hash\", \"mod\",\n \"munge\", \"name\", \"namespace\", \"namespace-munge\", \"nat-int?\", \"neg-int?\",\n \"neg?\", \"newline\", \"next\", \"nfirst\", \"nil?\", \"nnext\", \"not\", \"not-any?\",\n \"not-empty\", \"not-every?\", \"not=\", \"ns\", \"ns-aliases\", \"ns-imports\",\n \"ns-interns\", \"ns-map\", \"ns-name\", \"ns-publics\", \"ns-refers\",\n \"ns-resolve\", \"ns-unalias\", \"ns-unmap\", \"nth\", \"nthnext\", \"nthrest\",\n \"num\", \"number?\", \"numerator\", \"object-array\", \"odd?\", \"or\", \"parents\",\n \"partial\", \"partition\", \"partition-all\", \"partition-by\", \"pcalls\", \"peek\",\n \"persistent!\", \"pmap\", \"pop\", \"pop!\", \"pop-thread-bindings\", \"pos-int?\",\n \"pos?\", \"pr\", \"pr-str\", \"prefer-method\", \"prefers\",\n \"primitives-classnames\", \"print\", \"print-ctor\", \"print-dup\",\n \"print-method\", \"print-simple\", \"print-str\", \"printf\", \"println\",\n \"println-str\", \"prn\", \"prn-str\", \"promise\", \"proxy\",\n \"proxy-call-with-super\", \"proxy-mappings\", \"proxy-name\", \"proxy-super\",\n \"push-thread-bindings\", \"pvalues\", \"qualified-ident?\",\n \"qualified-keyword?\", \"qualified-symbol?\", \"quot\", \"rand\", \"rand-int\",\n \"rand-nth\", \"random-sample\", \"range\", \"ratio?\", \"rational?\",\n \"rationalize\", \"re-find\", \"re-groups\", \"re-matcher\", \"re-matches\",\n \"re-pattern\", \"re-seq\", \"read\", \"read-line\", \"read-string\",\n \"reader-conditional\", \"reader-conditional?\", \"realized?\", \"record?\",\n \"reduce\", \"reduce-kv\", \"reduced\", \"reduced?\", \"reductions\", \"ref\",\n \"ref-history-count\", \"ref-max-history\", \"ref-min-history\", \"ref-set\",\n \"refer\", \"refer-clojure\", \"reify\", \"release-pending-sends\", \"rem\",\n \"remove\", \"remove-all-methods\", \"remove-method\", \"remove-ns\",\n \"remove-watch\", \"repeat\", \"repeatedly\", \"replace\", \"replicate\", \"require\",\n \"reset!\", \"reset-meta!\", \"reset-vals!\", \"resolve\", \"rest\",\n \"restart-agent\", \"resultset-seq\", \"reverse\", \"reversible?\", \"rseq\",\n \"rsubseq\", \"run!\", \"satisfies?\", \"second\", \"select-keys\", \"send\",\n \"send-off\", \"send-via\", \"seq\", \"seq?\", \"seqable?\", \"seque\", \"sequence\",\n \"sequential?\", \"set\", \"set-agent-send-executor!\",\n \"set-agent-send-off-executor!\", \"set-error-handler!\", \"set-error-mode!\",\n \"set-validator!\", \"set?\", \"short\", \"short-array\", \"shorts\", \"shuffle\",\n \"shutdown-agents\", \"simple-ident?\", \"simple-keyword?\", \"simple-symbol?\",\n \"slurp\", \"some\", \"some->\", \"some->>\", \"some-fn\", \"some?\", \"sort\",\n \"sort-by\", \"sorted-map\", \"sorted-map-by\", \"sorted-set\", \"sorted-set-by\",\n \"sorted?\", \"special-symbol?\", \"spit\", \"split-at\", \"split-with\", \"str\",\n \"string?\", \"struct\", \"struct-map\", \"subs\", \"subseq\", \"subvec\", \"supers\",\n \"swap!\", \"swap-vals!\", \"symbol\", \"symbol?\", \"sync\", \"tagged-literal\",\n \"tagged-literal?\", \"take\", \"take-last\", \"take-nth\", \"take-while\", \"test\",\n \"the-ns\", \"thread-bound?\", \"time\", \"to-array\", \"to-array-2d\",\n \"trampoline\", \"transduce\", \"transient\", \"tree-seq\", \"true?\", \"type\",\n \"unchecked-add\", \"unchecked-add-int\", \"unchecked-byte\", \"unchecked-char\",\n \"unchecked-dec\", \"unchecked-dec-int\", \"unchecked-divide-int\",\n \"unchecked-double\", \"unchecked-float\", \"unchecked-inc\",\n \"unchecked-inc-int\", \"unchecked-int\", \"unchecked-long\",\n \"unchecked-multiply\", \"unchecked-multiply-int\", \"unchecked-negate\",\n \"unchecked-negate-int\", \"unchecked-remainder-int\", \"unchecked-short\",\n \"unchecked-subtract\", \"unchecked-subtract-int\", \"underive\", \"unquote\",\n \"unquote-splicing\", \"unreduced\", \"unsigned-bit-shift-right\", \"update\",\n \"update-in\", \"update-proxy\", \"uri?\", \"use\", \"uuid?\", \"val\", \"vals\",\n \"var-get\", \"var-set\", \"var?\", \"vary-meta\", \"vec\", \"vector\", \"vector-of\",\n \"vector?\", \"volatile!\", \"volatile?\", \"vreset!\", \"vswap!\", \"when\",\n \"when-first\", \"when-let\", \"when-not\", \"when-some\", \"while\",\n \"with-bindings\", \"with-bindings*\", \"with-in-str\", \"with-loading-context\",\n \"with-local-vars\", \"with-meta\", \"with-open\", \"with-out-str\",\n \"with-precision\", \"with-redefs\", \"with-redefs-fn\", \"xml-seq\", \"zero?\",\n \"zipmap\"];\nvar haveBodyParameter = [\n \"->\", \"->>\", \"as->\", \"binding\", \"bound-fn\", \"case\", \"catch\", \"comment\",\n \"cond\", \"cond->\", \"cond->>\", \"condp\", \"def\", \"definterface\", \"defmethod\",\n \"defn\", \"defmacro\", \"defprotocol\", \"defrecord\", \"defstruct\", \"deftype\",\n \"do\", \"doseq\", \"dotimes\", \"doto\", \"extend\", \"extend-protocol\",\n \"extend-type\", \"fn\", \"for\", \"future\", \"if\", \"if-let\", \"if-not\", \"if-some\",\n \"let\", \"letfn\", \"locking\", \"loop\", \"ns\", \"proxy\", \"reify\", \"struct-map\",\n \"some->\", \"some->>\", \"try\", \"when\", \"when-first\", \"when-let\", \"when-not\",\n \"when-some\", \"while\", \"with-bindings\", \"with-bindings*\", \"with-in-str\",\n \"with-loading-context\", \"with-local-vars\", \"with-meta\", \"with-open\",\n \"with-out-str\", \"with-precision\", \"with-redefs\", \"with-redefs-fn\"];\n\nvar atom = createLookupMap(atoms);\nvar specialForm = createLookupMap(specialForms);\nvar coreSymbol = createLookupMap(coreSymbols);\nvar hasBodyParameter = createLookupMap(haveBodyParameter);\nvar delimiter = /^(?:[\\\\\\[\\]\\s\"(),;@^`{}~]|$)/;\nvar numberLiteral = /^(?:[+\\-]?\\d+(?:(?:N|(?:[eE][+\\-]?\\d+))|(?:\\.?\\d*(?:M|(?:[eE][+\\-]?\\d+))?)|\\/\\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\\\\[\\]\\s\"#'(),;@^`{}~]|$))/;\nvar characterLiteral = /^(?:\\\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\\\\[\\]\\s\"(),;@^`{}~]|$))/;\n\n// simple-namespace := /^[^\\\\\\/\\[\\]\\d\\s\"#'(),;@^`{}~.][^\\\\\\[\\]\\s\"(),;@^`{}~.\\/]*/\n// simple-symbol := /^(?:\\/|[^\\\\\\/\\[\\]\\d\\s\"#'(),;@^`{}~][^\\\\\\[\\]\\s\"(),;@^`{}~]*)/\n// qualified-symbol := ((<.>)*)?\nvar qualifiedSymbol = /^(?:(?:[^\\\\\\/\\[\\]\\d\\s\"#'(),;@^`{}~.][^\\\\\\[\\]\\s\"(),;@^`{}~.\\/]*(?:\\.[^\\\\\\/\\[\\]\\d\\s\"#'(),;@^`{}~.][^\\\\\\[\\]\\s\"(),;@^`{}~.\\/]*)*\\/)?(?:\\/|[^\\\\\\/\\[\\]\\d\\s\"#'(),;@^`{}~][^\\\\\\[\\]\\s\"(),;@^`{}~]*)*(?=[\\\\\\[\\]\\s\"(),;@^`{}~]|$))/;\n\nfunction base(stream, state) {\n if (stream.eatSpace() || stream.eat(\",\")) return [\"space\", null];\n if (stream.match(numberLiteral)) return [null, \"number\"];\n if (stream.match(characterLiteral)) return [null, \"string.special\"];\n if (stream.eat(/^\"/)) return (state.tokenize = inString)(stream, state);\n if (stream.eat(/^[(\\[{]/)) return [\"open\", \"bracket\"];\n if (stream.eat(/^[)\\]}]/)) return [\"close\", \"bracket\"];\n if (stream.eat(/^;/)) {stream.skipToEnd(); return [\"space\", \"comment\"];}\n if (stream.eat(/^[#'@^`~]/)) return [null, \"meta\"];\n\n var matches = stream.match(qualifiedSymbol);\n var symbol = matches && matches[0];\n\n if (!symbol) {\n // advance stream by at least one character so we don't get stuck.\n stream.next();\n stream.eatWhile(function (c) {return !is(c, delimiter);});\n return [null, \"error\"];\n }\n\n if (symbol === \"comment\" && state.lastToken === \"(\")\n return (state.tokenize = inComment)(stream, state);\n if (is(symbol, atom) || symbol.charAt(0) === \":\") return [\"symbol\", \"atom\"];\n if (is(symbol, specialForm) || is(symbol, coreSymbol)) return [\"symbol\", \"keyword\"];\n if (state.lastToken === \"(\") return [\"symbol\", \"builtin\"]; // other operator\n\n return [\"symbol\", \"variable\"];\n}\n\nfunction inString(stream, state) {\n var escaped = false, next;\n\n while (next = stream.next()) {\n if (next === \"\\\"\" && !escaped) {state.tokenize = base; break;}\n escaped = !escaped && next === \"\\\\\";\n }\n\n return [null, \"string\"];\n}\n\nfunction inComment(stream, state) {\n var parenthesisCount = 1;\n var next;\n\n while (next = stream.next()) {\n if (next === \")\") parenthesisCount--;\n if (next === \"(\") parenthesisCount++;\n if (parenthesisCount === 0) {\n stream.backUp(1);\n state.tokenize = base;\n break;\n }\n }\n\n return [\"space\", \"comment\"];\n}\n\nfunction createLookupMap(words) {\n var obj = {};\n\n for (var i = 0; i < words.length; ++i) obj[words[i]] = true;\n\n return obj;\n}\n\nfunction is(value, test) {\n if (test instanceof RegExp) return test.test(value);\n if (test instanceof Object) return test.propertyIsEnumerable(value);\n}\n\nexport const clojure = {\n name: \"clojure\",\n startState: function () {\n return {\n ctx: {prev: null, start: 0, indentTo: 0},\n lastToken: null,\n tokenize: base\n };\n },\n\n token: function (stream, state) {\n if (stream.sol() && (typeof state.ctx.indentTo !== \"number\"))\n state.ctx.indentTo = state.ctx.start + 1;\n\n var typeStylePair = state.tokenize(stream, state);\n var type = typeStylePair[0];\n var style = typeStylePair[1];\n var current = stream.current();\n\n if (type !== \"space\") {\n if (state.lastToken === \"(\" && state.ctx.indentTo === null) {\n if (type === \"symbol\" && is(current, hasBodyParameter))\n state.ctx.indentTo = state.ctx.start + stream.indentUnit;\n else state.ctx.indentTo = \"next\";\n } else if (state.ctx.indentTo === \"next\") {\n state.ctx.indentTo = stream.column();\n }\n\n state.lastToken = current;\n }\n\n if (type === \"open\")\n state.ctx = {prev: state.ctx, start: stream.column(), indentTo: null};\n else if (type === \"close\") state.ctx = state.ctx.prev || state.ctx;\n\n return style;\n },\n\n indent: function (state) {\n var i = state.ctx.indentTo;\n\n return (typeof i === \"number\") ?\n i :\n state.ctx.start + 1;\n },\n\n languageData: {\n closeBrackets: {brackets: [\"(\", \"[\", \"{\", '\"']},\n commentTokens: {line: \";;\"},\n autocomplete: [].concat(atoms, specialForms, coreSymbols)\n }\n};\n"],"names":["atoms","specialForms","coreSymbols","atom","createLookupMap","specialForm","coreSymbol","hasBodyParameter","delimiter","numberLiteral","characterLiteral","qualifiedSymbol","base","stream","state","eatSpace","eat","match","tokenize","inString","skipToEnd","matches","symbol","lastToken","inComment","is","charAt","next","eatWhile","c","escaped","parenthesisCount","backUp","words","obj","i","length","value","test","RegExp","Object","propertyIsEnumerable","clojure","name","startState","ctx","prev","start","indentTo","token","sol","typeStylePair","type","style","current","indentUnit","column","indent","languageData","closeBrackets","brackets","commentTokens","line","autocomplete","concat"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/3180.index.js b/pr-preview/pr-770/3180.index.js new file mode 100644 index 00000000..d95326f1 --- /dev/null +++ b/pr-preview/pr-770/3180.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[3180],{3180:(e,_,t)=>{function r(e){for(var _={},t=e.split(" "),r=0;ru});var s,i=r("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),a=r("http mail events server types location upstream charset_map limit_except if geo map"),o=r("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files");function n(e,_){return s=_,e}function c(e,_){e.eatWhile(/[\w\$_]/);var t=e.current();if(i.propertyIsEnumerable(t))return"keyword";if(a.propertyIsEnumerable(t))return"controlKeyword";if(o.propertyIsEnumerable(t))return"controlKeyword";var r,s=e.next();return"@"==s?(e.eatWhile(/[\w\\\-]/),n("meta",e.current())):"/"==s&&e.eat("*")?(_.tokenize=l,l(e,_)):"<"==s&&e.eat("!")?(_.tokenize=p,p(e,_)):"="!=s?"~"!=s&&"|"!=s||!e.eat("=")?'"'==s||"'"==s?(_.tokenize=(r=s,function(e,_){for(var t,s=!1;null!=(t=e.next())&&(t!=r||s);)s=!s&&"\\"==t;return s||(_.tokenize=c),n("string","string")}),_.tokenize(e,_)):"#"==s?(e.skipToEnd(),n("comment","comment")):"!"==s?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(s)?(e.eatWhile(/[\w.%]/),n("number","unit")):/[,.+>*\/]/.test(s)?n(null,"select-op"):/[;{}:\[\]]/.test(s)?n(null,s):(e.eatWhile(/[\w\\\-]/),n("variable","variable")):n(null,"compare"):void n(null,"compare")}function l(e,_){for(var t,r=!1;null!=(t=e.next());){if(r&&"/"==t){_.tokenize=c;break}r="*"==t}return n("comment","comment")}function p(e,_){for(var t,r=0;null!=(t=e.next());){if(r>=2&&">"==t){_.tokenize=c;break}r="-"==t?r+1:0}return n("comment","comment")}const u={name:"nginx",startState:function(){return{tokenize:c,baseIndent:0,stack:[]}},token:function(e,_){if(e.eatSpace())return null;s=null;var t=_.tokenize(e,_),r=_.stack[_.stack.length-1];return"hash"==s&&"rule"==r?t="atom":"variable"==t&&("rule"==r?t="number":r&&"@media{"!=r||(t="tag")),"rule"==r&&/^[\{\};]$/.test(s)&&_.stack.pop(),"{"==s?"@media"==r?_.stack[_.stack.length-1]="@media{":_.stack.push("{"):"}"==s?_.stack.pop():"@media"==s?_.stack.push("@media"):"{"==r&&"comment"!=s&&_.stack.push("rule"),t},indent:function(e,_,t){var r=e.stack.length;return/^\}/.test(_)&&(r-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+r*t.unit},languageData:{indentOnInput:/^\s*\}$/}}}}]); +//# sourceMappingURL=3180.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/3180.index.js.map b/pr-preview/pr-770/3180.index.js.map new file mode 100644 index 00000000..aa34e041 --- /dev/null +++ b/pr-preview/pr-770/3180.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"3180.index.js","mappings":"8FAAA,SAASA,EAAMC,GAEb,IADA,IAAIC,EAAM,CAAC,EAAGF,EAAQC,EAAIE,MAAM,KACvBC,EAAI,EAAGA,EAAIJ,EAAMK,SAAUD,EAAGF,EAAIF,EAAMI,KAAM,EACvD,OAAOF,CACT,C,4BAEA,IAaII,EAbAC,EAAWP,EACa,wgKAIxBQ,EAAiBR,EACK,uFAGtBS,EAAqBT,EACK,oGAI9B,SAASU,EAAIC,EAAOC,GAAgB,OAAXN,EAAOM,EAAWD,CAAM,CAEjD,SAASE,EAAUC,EAAQC,GAGzBD,EAAOE,SAAS,WAEhB,IAAIC,EAAMH,EAAOI,UAGjB,GAAIX,EAASY,qBAAqBF,GAChC,MAAO,UAEJ,GAAIT,EAAeW,qBAAqBF,GAC3C,MAAO,iBAEJ,GAAIR,EAAmBU,qBAAqBF,GAC/C,MAAO,iBAIT,IAgEmBG,EAhEfC,EAAKP,EAAOQ,OAChB,MAAU,KAAND,GAAYP,EAAOE,SAAS,YAAoBN,EAAI,OAAQI,EAAOI,YACxD,KAANG,GAAaP,EAAOS,IAAI,MAC/BR,EAAMS,SAAWC,EACVA,EAAcX,EAAQC,IAEhB,KAANM,GAAaP,EAAOS,IAAI,MAC/BR,EAAMS,SAAWE,EACVA,EAAiBZ,EAAQC,IAEnB,KAANM,EACO,KAANA,GAAmB,KAANA,IAAcP,EAAOS,IAAI,KACjC,KAANF,GAAoB,KAANA,GACrBN,EAAMS,UAmDWJ,EAnDYC,EAoDxB,SAASP,EAAQC,GAEtB,IADA,IAAqBM,EAAjBM,GAAU,EACiB,O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,GAgB7C,MAfY,QAARC,GAA6B,QAAXkC,EAAmB7B,EAAQ,OAC/B,YAATA,IACQ,QAAX6B,EAAmB7B,EAAQ,SACrB6B,GAAsB,WAAXA,IAAsB7B,EAAQ,QAGtC,QAAX6B,GAAqB,YAAYV,KAAKxB,IACxCS,EAAMsB,MAAMI,MACF,KAARnC,EACa,UAAXkC,EAAqBzB,EAAMsB,MAAMtB,EAAMsB,MAAMhC,OAAO,GAAK,UACxDU,EAAMsB,MAAMK,KAAK,KAEP,KAARpC,EAAaS,EAAMsB,MAAMI,MACjB,UAARnC,EAAkBS,EAAMsB,MAAMK,KAAK,UACxB,KAAXF,GAA0B,WAARlC,GAAmBS,EAAMsB,MAAMK,KAAK,QACxD/B,CACT,EAEAgC,OAAQ,SAAS5B,EAAO6B,EAAWC,GACjC,IAAIC,EAAI/B,EAAMsB,MAAMhC,OAGpB,MAFI,MAAMyB,KAAKc,KACbE,GAA0C,QAArC/B,EAAMsB,MAAMtB,EAAMsB,MAAMhC,OAAO,GAAe,EAAI,GAClDU,EAAMqB,WAAaU,EAAID,EAAGE,IACnC,EAEAC,aAAc,CACZC,cAAe,W","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/nginx.js"],"sourcesContent":["function words(str) {\n var obj = {}, words = str.split(\" \");\n for (var i = 0; i < words.length; ++i) obj[words[i]] = true;\n return obj;\n}\n\nvar keywords = words(\n /* ngxDirectiveControl */ \"break return rewrite set\" +\n /* ngxDirective */ \" accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23\"\n);\n\nvar keywords_block = words(\n /* ngxDirectiveBlock */ \"http mail events server types location upstream charset_map limit_except if geo map\"\n);\n\nvar keywords_important = words(\n /* ngxDirectiveImportant */ \"include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files\"\n);\n\nvar type;\nfunction ret(style, tp) {type = tp; return style;}\n\nfunction tokenBase(stream, state) {\n\n\n stream.eatWhile(/[\\w\\$_]/);\n\n var cur = stream.current();\n\n\n if (keywords.propertyIsEnumerable(cur)) {\n return \"keyword\";\n }\n else if (keywords_block.propertyIsEnumerable(cur)) {\n return \"controlKeyword\";\n }\n else if (keywords_important.propertyIsEnumerable(cur)) {\n return \"controlKeyword\";\n }\n /**/\n\n var ch = stream.next();\n if (ch == \"@\") {stream.eatWhile(/[\\w\\\\\\-]/); return ret(\"meta\", stream.current());}\n else if (ch == \"/\" && stream.eat(\"*\")) {\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n }\n else if (ch == \"<\" && stream.eat(\"!\")) {\n state.tokenize = tokenSGMLComment;\n return tokenSGMLComment(stream, state);\n }\n else if (ch == \"=\") ret(null, \"compare\");\n else if ((ch == \"~\" || ch == \"|\") && stream.eat(\"=\")) return ret(null, \"compare\");\n else if (ch == \"\\\"\" || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n }\n else if (ch == \"#\") {\n stream.skipToEnd();\n return ret(\"comment\", \"comment\");\n }\n else if (ch == \"!\") {\n stream.match(/^\\s*\\w*/);\n return ret(\"keyword\", \"important\");\n }\n else if (/\\d/.test(ch)) {\n stream.eatWhile(/[\\w.%]/);\n return ret(\"number\", \"unit\");\n }\n else if (/[,.+>*\\/]/.test(ch)) {\n return ret(null, \"select-op\");\n }\n else if (/[;{}:\\[\\]]/.test(ch)) {\n return ret(null, ch);\n }\n else {\n stream.eatWhile(/[\\w\\\\\\-]/);\n return ret(\"variable\", \"variable\");\n }\n}\n\nfunction tokenCComment(stream, state) {\n var maybeEnd = false, ch;\n while ((ch = stream.next()) != null) {\n if (maybeEnd && ch == \"/\") {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return ret(\"comment\", \"comment\");\n}\n\nfunction tokenSGMLComment(stream, state) {\n var dashes = 0, ch;\n while ((ch = stream.next()) != null) {\n if (dashes >= 2 && ch == \">\") {\n state.tokenize = tokenBase;\n break;\n }\n dashes = (ch == \"-\") ? dashes + 1 : 0;\n }\n return ret(\"comment\", \"comment\");\n}\n\nfunction tokenString(quote) {\n return function(stream, state) {\n var escaped = false, ch;\n while ((ch = stream.next()) != null) {\n if (ch == quote && !escaped)\n break;\n escaped = !escaped && ch == \"\\\\\";\n }\n if (!escaped) state.tokenize = tokenBase;\n return ret(\"string\", \"string\");\n };\n}\n\nexport const nginx = {\n name: \"nginx\",\n startState: function() {\n return {tokenize: tokenBase,\n baseIndent: 0,\n stack: []};\n },\n\n token: function(stream, state) {\n if (stream.eatSpace()) return null;\n type = null;\n var style = state.tokenize(stream, state);\n\n var context = state.stack[state.stack.length-1];\n if (type == \"hash\" && context == \"rule\") style = \"atom\";\n else if (style == \"variable\") {\n if (context == \"rule\") style = \"number\";\n else if (!context || context == \"@media{\") style = \"tag\";\n }\n\n if (context == \"rule\" && /^[\\{\\};]$/.test(type))\n state.stack.pop();\n if (type == \"{\") {\n if (context == \"@media\") state.stack[state.stack.length-1] = \"@media{\";\n else state.stack.push(\"{\");\n }\n else if (type == \"}\") state.stack.pop();\n else if (type == \"@media\") state.stack.push(\"@media\");\n else if (context == \"{\" && type != \"comment\") state.stack.push(\"rule\");\n return style;\n },\n\n indent: function(state, textAfter, cx) {\n var n = state.stack.length;\n if (/^\\}/.test(textAfter))\n n -= state.stack[state.stack.length-1] == \"rule\" ? 2 : 1;\n return state.baseIndent + n * cx.unit;\n },\n\n languageData: {\n indentOnInput: /^\\s*\\}$/\n }\n};\n"],"names":["words","str","obj","split","i","length","type","keywords","keywords_block","keywords_important","ret","style","tp","tokenBase","stream","state","eatWhile","cur","current","propertyIsEnumerable","quote","ch","next","eat","tokenize","tokenCComment","tokenSGMLComment","escaped","skipToEnd","match","test","maybeEnd","dashes","nginx","name","startState","baseIndent","stack","token","eatSpace","context","pop","push","indent","textAfter","cx","n","unit","languageData","indentOnInput"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/3191.index.js b/pr-preview/pr-770/3191.index.js new file mode 100644 index 00000000..5749aa60 --- /dev/null +++ b/pr-preview/pr-770/3191.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[3191],{3191:(e,t,r)=>{function n(e,t){return e.string.charAt(e.pos+(t||0))}function i(e,t){if(t){var r=e.pos-t;return e.string.substr(r>=0?r:0,t)}return e.string.substr(0,e.pos-1)}function s(e,t){var r=e.string.length,n=r-e.pos+1;return e.string.substr(e.pos,t&&t=(r=e.string.length-1)?e.pos=r:e.pos=n}r.r(t),r.d(t,{perl:()=>R});var u={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,if:[1,1],elsif:[1,1],else:[1,1],while:[1,1],unless:[1,1],for:[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,break:1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,continue:[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,default:1,defined:1,delete:1,die:1,do:1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,goto:1,grep:1,hex:1,import:1,index:1,int:1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,new:1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,package:1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,return:1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},o="string.special",$=/[goseximacplud]/;function l(e,t,r,n,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){for(var s,a=!1,u=0;s=e.next();){if(s===r[u]&&!a)return void 0!==r[++u]?(t.chain=r[u],t.style=n,t.tail=i):i&&e.eatWhile(i),t.tokenize=f,n;a=!a&&"\\"==s}return n},t.tokenize(e,t)}function E(e,t,r){return t.tokenize=function(e,t){return e.string==r&&(t.tokenize=f),e.skipToEnd(),"string"},t.tokenize(e,t)}function f(e,t){if(e.eatSpace())return null;if(t.chain)return l(e,t,t.chain,t.style,t.tail);if(e.match(/^(\-?((\d[\d_]*)?\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F_]+|0b[01_]+|\d[\d_]*(e[+-]?\d+)?)/))return"number";if(e.match(/^<<(?=[_a-zA-Z])/))return e.eatWhile(/\w/),E(e,t,e.current().substr(2));if(e.sol()&&e.match(/^\=item(?!\w)/))return E(e,t,"=cut");var r=e.next();if('"'==r||"'"==r){if(i(e,3)=="<<"+r){var f=e.pos;e.eatWhile(/\w/);var R=e.current().substr(1);if(R&&e.eat(r))return E(e,t,R);e.pos=f}return l(e,t,[r],"string")}if(!("q"!=r||(_=n(e,-2))&&/\w/.test(_)))if("x"==(_=n(e,0))){if("("==(_=n(e,1)))return a(e,2),l(e,t,[")"],o,$);if("["==_)return a(e,2),l(e,t,["]"],o,$);if("{"==_)return a(e,2),l(e,t,["}"],o,$);if("<"==_)return a(e,2),l(e,t,[">"],o,$);if(/[\^'"!~\/]/.test(_))return a(e,1),l(e,t,[e.eat(_)],o,$)}else if("q"==_){if("("==(_=n(e,1)))return a(e,2),l(e,t,[")"],"string");if("["==_)return a(e,2),l(e,t,["]"],"string");if("{"==_)return a(e,2),l(e,t,["}"],"string");if("<"==_)return a(e,2),l(e,t,[">"],"string");if(/[\^'"!~\/]/.test(_))return a(e,1),l(e,t,[e.eat(_)],"string")}else if("w"==_){if("("==(_=n(e,1)))return a(e,2),l(e,t,[")"],"bracket");if("["==_)return a(e,2),l(e,t,["]"],"bracket");if("{"==_)return a(e,2),l(e,t,["}"],"bracket");if("<"==_)return a(e,2),l(e,t,[">"],"bracket");if(/[\^'"!~\/]/.test(_))return a(e,1),l(e,t,[e.eat(_)],"bracket")}else if("r"==_){if("("==(_=n(e,1)))return a(e,2),l(e,t,[")"],o,$);if("["==_)return a(e,2),l(e,t,["]"],o,$);if("{"==_)return a(e,2),l(e,t,["}"],o,$);if("<"==_)return a(e,2),l(e,t,[">"],o,$);if(/[\^'"!~\/]/.test(_))return a(e,1),l(e,t,[e.eat(_)],o,$)}else if(/[\^'"!~\/(\[{<]/.test(_)){if("("==_)return a(e,1),l(e,t,[")"],"string");if("["==_)return a(e,1),l(e,t,["]"],"string");if("{"==_)return a(e,1),l(e,t,["}"],"string");if("<"==_)return a(e,1),l(e,t,[">"],"string");if(/[\^'"!~\/]/.test(_))return l(e,t,[e.eat(_)],"string")}if("m"==r&&(!(_=n(e,-2))||!/\w/.test(_))&&(_=e.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(_))return l(e,t,[_],o,$);if("("==_)return l(e,t,[")"],o,$);if("["==_)return l(e,t,["]"],o,$);if("{"==_)return l(e,t,["}"],o,$);if("<"==_)return l(e,t,[">"],o,$)}if("s"==r&&!(_=/[\/>\]})\w]/.test(n(e,-2)))&&(_=e.eat(/[(\[{<\^'"!~\/]/)))return l(e,t,"["==_?["]","]"]:"{"==_?["}","}"]:"<"==_?[">",">"]:"("==_?[")",")"]:[_,_],o,$);if("y"==r&&!(_=/[\/>\]})\w]/.test(n(e,-2)))&&(_=e.eat(/[(\[{<\^'"!~\/]/)))return l(e,t,"["==_?["]","]"]:"{"==_?["}","}"]:"<"==_?[">",">"]:"("==_?[")",")"]:[_,_],o,$);if("t"==r&&!(_=/[\/>\]})\w]/.test(n(e,-2)))&&(_=e.eat("r"))&&(_=e.eat(/[(\[{<\^'"!~\/]/)))return l(e,t,"["==_?["]","]"]:"{"==_?["}","}"]:"<"==_?[">",">"]:"("==_?[")",")"]:[_,_],o,$);if("`"==r)return l(e,t,[r],"builtin");if("/"==r)return/~\s*$/.test(i(e))?l(e,t,[r],o,$):"operator";if("$"==r){if(f=e.pos,e.eatWhile(/\d/)||e.eat("{")&&e.eatWhile(/\d/)&&e.eat("}"))return"builtin";e.pos=f}if(/[$@%]/.test(r)){if(f=e.pos,e.eat("^")&&e.eat(/[A-Z]/)||!/[@$%&]/.test(n(e,-2))&&e.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var _=e.current();if(u[_])return"builtin"}e.pos=f}if(/[$@%&]/.test(r)&&(e.eatWhile(/[\w$]/)||e.eat("{")&&e.eatWhile(/[\w$]/)&&e.eat("}")))return _=e.current(),u[_]?"builtin":"variable";if("#"==r&&"$"!=n(e,-2))return e.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(r)){if(f=e.pos,e.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),u[e.current()])return"operator";e.pos=f}if("_"==r&&1==e.pos){if("_END__"==s(e,6))return l(e,t,["\0"],"comment");if("_DATA__"==s(e,7))return l(e,t,["\0"],"builtin");if("_C__"==s(e,7))return l(e,t,["\0"],"string")}if(/\w/.test(r)){if(f=e.pos,"{"==n(e,-2)&&("}"==n(e,0)||e.eatWhile(/\w/)&&"}"==n(e,0)))return"string";e.pos=f}if(/[A-Z]/.test(r)){var T=n(e,-2);if(f=e.pos,e.eatWhile(/[A-Z_]/),!/[\da-z]/.test(n(e,0)))return(_=u[e.current()])?(_[1]&&(_=_[0]),":"!=T?1==_?"keyword":2==_?"def":3==_?"atom":4==_?"operator":5==_?"builtin":"meta":"meta"):"meta";e.pos=f}return/[a-zA-Z_]/.test(r)?(T=n(e,-2),e.eatWhile(/\w/),(_=u[e.current()])?(_[1]&&(_=_[0]),":"!=T?1==_?"keyword":2==_?"def":3==_?"atom":4==_?"operator":5==_?"builtin":"meta":"meta"):"meta"):null}const R={name:"perl",startState:function(){return{tokenize:f,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||f)(e,t)},languageData:{commentTokens:{line:"#"},wordChars:"$"}}}}]); +//# sourceMappingURL=3191.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/3191.index.js.map b/pr-preview/pr-770/3191.index.js.map new file mode 100644 index 00000000..a3ee0ba4 --- /dev/null +++ b/pr-preview/pr-770/3191.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"3191.index.js","mappings":"8FAEA,SAASA,EAAKC,EAAQC,GACpB,OAAOD,EAAOE,OAAOC,OAAOH,EAAOI,KAAKH,GAAG,GAC7C,CAGA,SAASI,EAAOL,EAAQC,GACtB,GAAGA,EAAE,CACH,IAAIK,EAAEN,EAAOI,IAA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xO,EAAKC,EAAQ,IAI7B,OADIC,EAAEW,EAAKZ,EAAOiO,aAGfhO,EAAE,KACHA,EAAEA,EAAE,IACA,KAAHuO,EACK,GAAHvO,EACM,UACE,GAAHA,EACC,MACE,GAAHA,EACC,OACE,GAAHA,EACC,WACE,GAAHA,EACC,UAEA,OAEF,QAjBA,OAJTD,EAAOI,IAAIgO,CAqBM,CACrB,MAAG,YAAYG,KAAKJ,IACdK,EAAEzO,EAAKC,GAAS,GACpBA,EAAO2N,SAAS,OACZ1N,EAAEW,EAAKZ,EAAOiO,aAGfhO,EAAE,KACHA,EAAEA,EAAE,IACA,KAAHuO,EACK,GAAHvO,EACM,UACE,GAAHA,EACC,MACE,GAAHA,EACC,OACE,GAAHA,EACC,WACE,GAAHA,EACC,UAEA,OAEF,QAjBA,QAkBJ,IAAK,CAEP,MAAMwO,EAAO,CAClBC,KAAM,OAENC,WAAY,WACV,MAAO,CACLpB,SAAUK,EACVR,MAAO,KACPC,MAAO,KACPC,KAAM,KAEV,EACAsB,MAAO,SAAS5O,EAAQ8K,GACtB,OAAQA,EAAMyC,UAAYK,GAAW5N,EAAQ8K,EAC/C,EACA+D,aAAc,CACZC,cAAe,CAACC,KAAM,KACtBC,UAAW,K","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/perl.js"],"sourcesContent":["\n// it's like \"peek\", but need for look-ahead or look-behind if index < 0\nfunction look(stream, c){\n return stream.string.charAt(stream.pos+(c||0));\n}\n\n// return a part of prefix of current stream from current position\nfunction prefix(stream, c){\n if(c){\n var x=stream.pos-c;\n return stream.string.substr((x>=0?x:0),c);}\n else{\n return stream.string.substr(0,stream.pos-1);\n }\n}\n\n// return a part of suffix of current stream from current position\nfunction suffix(stream, c){\n var y=stream.string.length;\n var x=y-stream.pos+1;\n return stream.string.substr(stream.pos,(c&&c=(y=stream.string.length-1))\n stream.pos=y;\n else\n stream.pos=x;\n}\n\n// http://perldoc.perl.org\nvar PERL={ // null - magic touch\n // 1 - keyword\n // 2 - def\n // 3 - atom\n // 4 - operator\n // 5 - builtin (predefined)\n // [x,y] - x=1,2,3; y=must be defined if x{...}\n // PERL operators\n '->': 4,\n '++': 4,\n '--': 4,\n '**': 4,\n // ! ~ \\ and unary + and -\n '=~': 4,\n '!~': 4,\n '*': 4,\n '/': 4,\n '%': 4,\n 'x': 4,\n '+': 4,\n '-': 4,\n '.': 4,\n '<<': 4,\n '>>': 4,\n // named unary operators\n '<': 4,\n '>': 4,\n '<=': 4,\n '>=': 4,\n 'lt': 4,\n 'gt': 4,\n 'le': 4,\n 'ge': 4,\n '==': 4,\n '!=': 4,\n '<=>': 4,\n 'eq': 4,\n 'ne': 4,\n 'cmp': 4,\n '~~': 4,\n '&': 4,\n '|': 4,\n '^': 4,\n '&&': 4,\n '||': 4,\n '//': 4,\n '..': 4,\n '...': 4,\n '?': 4,\n ':': 4,\n '=': 4,\n '+=': 4,\n '-=': 4,\n '*=': 4, // etc. ???\n ',': 4,\n '=>': 4,\n '::': 4,\n // list operators (rightward)\n 'not': 4,\n 'and': 4,\n 'or': 4,\n 'xor': 4,\n // PERL predefined variables (I know, what this is a paranoid idea, but may be needed for people, who learn PERL, and for me as well, ...and may be for you?;)\n 'BEGIN': [5,1],\n 'END': [5,1],\n 'PRINT': [5,1],\n 'PRINTF': [5,1],\n 'GETC': [5,1],\n 'READ': [5,1],\n 'READLINE': [5,1],\n 'DESTROY': [5,1],\n 'TIE': [5,1],\n 'TIEHANDLE': [5,1],\n 'UNTIE': [5,1],\n 'STDIN': 5,\n 'STDIN_TOP': 5,\n 'STDOUT': 5,\n 'STDOUT_TOP': 5,\n 'STDERR': 5,\n 'STDERR_TOP': 5,\n '$ARG': 5,\n '$_': 5,\n '@ARG': 5,\n '@_': 5,\n '$LIST_SEPARATOR': 5,\n '$\"': 5,\n '$PROCESS_ID': 5,\n '$PID': 5,\n '$$': 5,\n '$REAL_GROUP_ID': 5,\n '$GID': 5,\n '$(': 5,\n '$EFFECTIVE_GROUP_ID': 5,\n '$EGID': 5,\n '$)': 5,\n '$PROGRAM_NAME': 5,\n '$0': 5,\n '$SUBSCRIPT_SEPARATOR': 5,\n '$SUBSEP': 5,\n '$;': 5,\n '$REAL_USER_ID': 5,\n '$UID': 5,\n '$<': 5,\n '$EFFECTIVE_USER_ID': 5,\n '$EUID': 5,\n '$>': 5,\n '$a': 5,\n '$b': 5,\n '$COMPILING': 5,\n '$^C': 5,\n '$DEBUGGING': 5,\n '$^D': 5,\n '${^ENCODING}': 5,\n '$ENV': 5,\n '%ENV': 5,\n '$SYSTEM_FD_MAX': 5,\n '$^F': 5,\n '@F': 5,\n '${^GLOBAL_PHASE}': 5,\n '$^H': 5,\n '%^H': 5,\n '@INC': 5,\n '%INC': 5,\n '$INPLACE_EDIT': 5,\n '$^I': 5,\n '$^M': 5,\n '$OSNAME': 5,\n '$^O': 5,\n '${^OPEN}': 5,\n '$PERLDB': 5,\n '$^P': 5,\n '$SIG': 5,\n '%SIG': 5,\n '$BASETIME': 5,\n '$^T': 5,\n '${^TAINT}': 5,\n '${^UNICODE}': 5,\n '${^UTF8CACHE}': 5,\n '${^UTF8LOCALE}': 5,\n '$PERL_VERSION': 5,\n '$^V': 5,\n '${^WIN32_SLOPPY_STAT}': 5,\n '$EXECUTABLE_NAME': 5,\n '$^X': 5,\n '$1': 5, // - regexp $1, $2...\n '$MATCH': 5,\n '$&': 5,\n '${^MATCH}': 5,\n '$PREMATCH': 5,\n '$`': 5,\n '${^PREMATCH}': 5,\n '$POSTMATCH': 5,\n \"$'\": 5,\n '${^POSTMATCH}': 5,\n '$LAST_PAREN_MATCH': 5,\n '$+': 5,\n '$LAST_SUBMATCH_RESULT': 5,\n '$^N': 5,\n '@LAST_MATCH_END': 5,\n '@+': 5,\n '%LAST_PAREN_MATCH': 5,\n '%+': 5,\n '@LAST_MATCH_START': 5,\n '@-': 5,\n '%LAST_MATCH_START': 5,\n '%-': 5,\n '$LAST_REGEXP_CODE_RESULT': 5,\n '$^R': 5,\n '${^RE_DEBUG_FLAGS}': 5,\n '${^RE_TRIE_MAXBUF}': 5,\n '$ARGV': 5,\n '@ARGV': 5,\n 'ARGV': 5,\n 'ARGVOUT': 5,\n '$OUTPUT_FIELD_SEPARATOR': 5,\n '$OFS': 5,\n '$,': 5,\n '$INPUT_LINE_NUMBER': 5,\n '$NR': 5,\n '$.': 5,\n '$INPUT_RECORD_SEPARATOR': 5,\n '$RS': 5,\n '$/': 5,\n '$OUTPUT_RECORD_SEPARATOR': 5,\n '$ORS': 5,\n '$\\\\': 5,\n '$OUTPUT_AUTOFLUSH': 5,\n '$|': 5,\n '$ACCUMULATOR': 5,\n '$^A': 5,\n '$FORMAT_FORMFEED': 5,\n '$^L': 5,\n '$FORMAT_PAGE_NUMBER': 5,\n '$%': 5,\n '$FORMAT_LINES_LEFT': 5,\n '$-': 5,\n '$FORMAT_LINE_BREAK_CHARACTERS': 5,\n '$:': 5,\n '$FORMAT_LINES_PER_PAGE': 5,\n '$=': 5,\n '$FORMAT_TOP_NAME': 5,\n '$^': 5,\n '$FORMAT_NAME': 5,\n '$~': 5,\n '${^CHILD_ERROR_NATIVE}': 5,\n '$EXTENDED_OS_ERROR': 5,\n '$^E': 5,\n '$EXCEPTIONS_BEING_CAUGHT': 5,\n '$^S': 5,\n '$WARNING': 5,\n '$^W': 5,\n '${^WARNING_BITS}': 5,\n '$OS_ERROR': 5,\n '$ERRNO': 5,\n '$!': 5,\n '%OS_ERROR': 5,\n '%ERRNO': 5,\n '%!': 5,\n '$CHILD_ERROR': 5,\n '$?': 5,\n '$EVAL_ERROR': 5,\n '$@': 5,\n '$OFMT': 5,\n '$#': 5,\n '$*': 5,\n '$ARRAY_BASE': 5,\n '$[': 5,\n '$OLD_PERL_VERSION': 5,\n '$]': 5,\n // PERL blocks\n 'if':[1,1],\n elsif:[1,1],\n 'else':[1,1],\n 'while':[1,1],\n unless:[1,1],\n 'for':[1,1],\n foreach:[1,1],\n // PERL functions\n 'abs':1, // - absolute value function\n accept:1, // - accept an incoming socket connect\n alarm:1, // - schedule a SIGALRM\n 'atan2':1, // - arctangent of Y/X in the range -PI to PI\n bind:1, // - binds an address to a socket\n binmode:1, // - prepare binary files for I/O\n bless:1, // - create an object\n bootstrap:1, //\n 'break':1, // - break out of a \"given\" block\n caller:1, // - get context of the current subroutine call\n chdir:1, // - change your current working directory\n chmod:1, // - changes the permissions on a list of files\n chomp:1, // - remove a trailing record separator from a string\n chop:1, // - remove the last character from a string\n chown:1, // - change the ownership on a list of files\n chr:1, // - get character this number represents\n chroot:1, // - make directory new root for path lookups\n close:1, // - close file (or pipe or socket) handle\n closedir:1, // - close directory handle\n connect:1, // - connect to a remote socket\n 'continue':[1,1], // - optional trailing block in a while or foreach\n 'cos':1, // - cosine function\n crypt:1, // - one-way passwd-style encryption\n dbmclose:1, // - breaks binding on a tied dbm file\n dbmopen:1, // - create binding on a tied dbm file\n 'default':1, //\n defined:1, // - test whether a value, variable, or function is defined\n 'delete':1, // - deletes a value from a hash\n die:1, // - raise an exception or bail out\n 'do':1, // - turn a BLOCK into a TERM\n dump:1, // - create an immediate core dump\n each:1, // - retrieve the next key/value pair from a hash\n endgrent:1, // - be done using group file\n endhostent:1, // - be done using hosts file\n endnetent:1, // - be done using networks file\n endprotoent:1, // - be done using protocols file\n endpwent:1, // - be done using passwd file\n endservent:1, // - be done using services file\n eof:1, // - test a filehandle for its end\n 'eval':1, // - catch exceptions or compile and run code\n 'exec':1, // - abandon this program to run another\n exists:1, // - test whether a hash key is present\n exit:1, // - terminate this program\n 'exp':1, // - raise I to a power\n fcntl:1, // - file control system call\n fileno:1, // - return file descriptor from filehandle\n flock:1, // - lock an entire file with an advisory lock\n fork:1, // - create a new process just like this one\n format:1, // - declare a picture format with use by the write() function\n formline:1, // - internal function used for formats\n getc:1, // - get the next character from the filehandle\n getgrent:1, // - get next group record\n getgrgid:1, // - get group record given group user ID\n getgrnam:1, // - get group record given group name\n gethostbyaddr:1, // - get host record given its address\n gethostbyname:1, // - get host record given name\n gethostent:1, // - get next hosts record\n getlogin:1, // - return who logged in at this tty\n getnetbyaddr:1, // - get network record given its address\n getnetbyname:1, // - get networks record given name\n getnetent:1, // - get next networks record\n getpeername:1, // - find the other end of a socket connection\n getpgrp:1, // - get process group\n getppid:1, // - get parent process ID\n getpriority:1, // - get current nice value\n getprotobyname:1, // - get protocol record given name\n getprotobynumber:1, // - get protocol record numeric protocol\n getprotoent:1, // - get next protocols record\n getpwent:1, // - get next passwd record\n getpwnam:1, // - get passwd record given user login name\n getpwuid:1, // - get passwd record given user ID\n getservbyname:1, // - get services record given its name\n getservbyport:1, // - get services record given numeric port\n getservent:1, // - get next services record\n getsockname:1, // - retrieve the sockaddr for a given socket\n getsockopt:1, // - get socket options on a given socket\n given:1, //\n glob:1, // - expand filenames using wildcards\n gmtime:1, // - convert UNIX time into record or string using Greenwich time\n 'goto':1, // - create spaghetti code\n grep:1, // - locate elements in a list test true against a given criterion\n hex:1, // - convert a string to a hexadecimal number\n 'import':1, // - patch a module's namespace into your own\n index:1, // - find a substring within a string\n 'int':1, // - get the integer portion of a number\n ioctl:1, // - system-dependent device control system call\n 'join':1, // - join a list into a string using a separator\n keys:1, // - retrieve list of indices from a hash\n kill:1, // - send a signal to a process or process group\n last:1, // - exit a block prematurely\n lc:1, // - return lower-case version of a string\n lcfirst:1, // - return a string with just the next letter in lower case\n length:1, // - return the number of bytes in a string\n 'link':1, // - create a hard link in the filesystem\n listen:1, // - register your socket as a server\n local: 2, // - create a temporary value for a global variable (dynamic scoping)\n localtime:1, // - convert UNIX time into record or string using local time\n lock:1, // - get a thread lock on a variable, subroutine, or method\n 'log':1, // - retrieve the natural logarithm for a number\n lstat:1, // - stat a symbolic link\n m:null, // - match a string with a regular expression pattern\n map:1, // - apply a change to a list to get back a new list with the changes\n mkdir:1, // - create a directory\n msgctl:1, // - SysV IPC message control operations\n msgget:1, // - get SysV IPC message queue\n msgrcv:1, // - receive a SysV IPC message from a message queue\n msgsnd:1, // - send a SysV IPC message to a message queue\n my: 2, // - declare and assign a local variable (lexical scoping)\n 'new':1, //\n next:1, // - iterate a block prematurely\n no:1, // - unimport some module symbols or semantics at compile time\n oct:1, // - convert a string to an octal number\n open:1, // - open a file, pipe, or descriptor\n opendir:1, // - open a directory\n ord:1, // - find a character's numeric representation\n our: 2, // - declare and assign a package variable (lexical scoping)\n pack:1, // - convert a list into a binary representation\n 'package':1, // - declare a separate global namespace\n pipe:1, // - open a pair of connected filehandles\n pop:1, // - remove the last element from an array and return it\n pos:1, // - find or set the offset for the last/next m//g search\n print:1, // - output a list to a filehandle\n printf:1, // - output a formatted list to a filehandle\n prototype:1, // - get the prototype (if any) of a subroutine\n push:1, // - append one or more elements to an array\n q:null, // - singly quote a string\n qq:null, // - doubly quote a string\n qr:null, // - Compile pattern\n quotemeta:null, // - quote regular expression magic characters\n qw:null, // - quote a list of words\n qx:null, // - backquote quote a string\n rand:1, // - retrieve the next pseudorandom number\n read:1, // - fixed-length buffered input from a filehandle\n readdir:1, // - get a directory from a directory handle\n readline:1, // - fetch a record from a file\n readlink:1, // - determine where a symbolic link is pointing\n readpipe:1, // - execute a system command and collect standard output\n recv:1, // - receive a message over a Socket\n redo:1, // - start this loop iteration over again\n ref:1, // - find out the type of thing being referenced\n rename:1, // - change a filename\n require:1, // - load in external functions from a library at runtime\n reset:1, // - clear all variables of a given name\n 'return':1, // - get out of a function early\n reverse:1, // - flip a string or a list\n rewinddir:1, // - reset directory handle\n rindex:1, // - right-to-left substring search\n rmdir:1, // - remove a directory\n s:null, // - replace a pattern with a string\n say:1, // - print with newline\n scalar:1, // - force a scalar context\n seek:1, // - reposition file pointer for random-access I/O\n seekdir:1, // - reposition directory pointer\n select:1, // - reset default output or do I/O multiplexing\n semctl:1, // - SysV semaphore control operations\n semget:1, // - get set of SysV semaphores\n semop:1, // - SysV semaphore operations\n send:1, // - send a message over a socket\n setgrent:1, // - prepare group file for use\n sethostent:1, // - prepare hosts file for use\n setnetent:1, // - prepare networks file for use\n setpgrp:1, // - set the process group of a process\n setpriority:1, // - set a process's nice value\n setprotoent:1, // - prepare protocols file for use\n setpwent:1, // - prepare passwd file for use\n setservent:1, // - prepare services file for use\n setsockopt:1, // - set some socket options\n shift:1, // - remove the first element of an array, and return it\n shmctl:1, // - SysV shared memory operations\n shmget:1, // - get SysV shared memory segment identifier\n shmread:1, // - read SysV shared memory\n shmwrite:1, // - write SysV shared memory\n shutdown:1, // - close down just half of a socket connection\n 'sin':1, // - return the sine of a number\n sleep:1, // - block for some number of seconds\n socket:1, // - create a socket\n socketpair:1, // - create a pair of sockets\n 'sort':1, // - sort a list of values\n splice:1, // - add or remove elements anywhere in an array\n 'split':1, // - split up a string using a regexp delimiter\n sprintf:1, // - formatted print into a string\n 'sqrt':1, // - square root function\n srand:1, // - seed the random number generator\n stat:1, // - get a file's status information\n state:1, // - declare and assign a state variable (persistent lexical scoping)\n study:1, // - optimize input data for repeated searches\n 'sub':1, // - declare a subroutine, possibly anonymously\n 'substr':1, // - get or alter a portion of a string\n symlink:1, // - create a symbolic link to a file\n syscall:1, // - execute an arbitrary system call\n sysopen:1, // - open a file, pipe, or descriptor\n sysread:1, // - fixed-length unbuffered input from a filehandle\n sysseek:1, // - position I/O pointer on handle used with sysread and syswrite\n system:1, // - run a separate program\n syswrite:1, // - fixed-length unbuffered output to a filehandle\n tell:1, // - get current seekpointer on a filehandle\n telldir:1, // - get current seekpointer on a directory handle\n tie:1, // - bind a variable to an object class\n tied:1, // - get a reference to the object underlying a tied variable\n time:1, // - return number of seconds since 1970\n times:1, // - return elapsed time for self and child processes\n tr:null, // - transliterate a string\n truncate:1, // - shorten a file\n uc:1, // - return upper-case version of a string\n ucfirst:1, // - return a string with just the next letter in upper case\n umask:1, // - set file creation mode mask\n undef:1, // - remove a variable or function definition\n unlink:1, // - remove one link to a file\n unpack:1, // - convert binary structure into normal perl variables\n unshift:1, // - prepend more elements to the beginning of a list\n untie:1, // - break a tie binding to a variable\n use:1, // - load in a module at compile time\n utime:1, // - set a file's last access and modify times\n values:1, // - return a list of the values in a hash\n vec:1, // - test or set particular bits in a string\n wait:1, // - wait for any child process to die\n waitpid:1, // - wait for a particular child process to die\n wantarray:1, // - get void vs scalar vs list context of current subroutine call\n warn:1, // - print debugging info\n when:1, //\n write:1, // - print a picture record\n y:null}; // - transliterate a string\n\nvar RXstyle=\"string.special\";\nvar RXmodifiers=/[goseximacplud]/; // NOTE: \"m\", \"s\", \"y\" and \"tr\" need to correct real modifiers for each regexp type\n\nfunction tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;)\n state.chain=null; // 12 3tail\n state.style=null;\n state.tail=null;\n state.tokenize=function(stream,state){\n var e=false,c,i=0;\n while(c=stream.next()){\n if(c===chain[i]&&!e){\n if(chain[++i]!==undefined){\n state.chain=chain[i];\n state.style=style;\n state.tail=tail;}\n else if(tail)\n stream.eatWhile(tail);\n state.tokenize=tokenPerl;\n return style;}\n e=!e&&c==\"\\\\\";}\n return style;};\n return state.tokenize(stream,state);}\n\nfunction tokenSOMETHING(stream,state,string){\n state.tokenize=function(stream,state){\n if(stream.string==string)\n state.tokenize=tokenPerl;\n stream.skipToEnd();\n return \"string\";};\n return state.tokenize(stream,state);}\n\nfunction tokenPerl(stream,state){\n if(stream.eatSpace())\n return null;\n if(state.chain)\n return tokenChain(stream,state,state.chain,state.style,state.tail);\n if(stream.match(/^(\\-?((\\d[\\d_]*)?\\.\\d+(e[+-]?\\d+)?|\\d+\\.\\d*)|0x[\\da-fA-F_]+|0b[01_]+|\\d[\\d_]*(e[+-]?\\d+)?)/))\n return 'number';\n if(stream.match(/^<<(?=[_a-zA-Z])/)){ // NOTE: <\"],RXstyle,RXmodifiers);}\n if(/[\\^'\"!~\\/]/.test(c)){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}}\n else if(c==\"q\"){\n c=look(stream, 1);\n if(c==\"(\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\")\"],\"string\");}\n if(c==\"[\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"]\"],\"string\");}\n if(c==\"{\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"}\"],\"string\");}\n if(c==\"<\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\">\"],\"string\");}\n if(/[\\^'\"!~\\/]/.test(c)){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[stream.eat(c)],\"string\");}}\n else if(c==\"w\"){\n c=look(stream, 1);\n if(c==\"(\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\")\"],\"bracket\");}\n if(c==\"[\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"]\"],\"bracket\");}\n if(c==\"{\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"}\"],\"bracket\");}\n if(c==\"<\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\">\"],\"bracket\");}\n if(/[\\^'\"!~\\/]/.test(c)){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[stream.eat(c)],\"bracket\");}}\n else if(c==\"r\"){\n c=look(stream, 1);\n if(c==\"(\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\")\"],RXstyle,RXmodifiers);}\n if(c==\"[\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"]\"],RXstyle,RXmodifiers);}\n if(c==\"{\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"}\"],RXstyle,RXmodifiers);}\n if(c==\"<\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\">\"],RXstyle,RXmodifiers);}\n if(/[\\^'\"!~\\/]/.test(c)){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}}\n else if(/[\\^'\"!~\\/(\\[{<]/.test(c)){\n if(c==\"(\"){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[\")\"],\"string\");}\n if(c==\"[\"){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[\"]\"],\"string\");}\n if(c==\"{\"){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[\"}\"],\"string\");}\n if(c==\"<\"){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[\">\"],\"string\");}\n if(/[\\^'\"!~\\/]/.test(c)){\n return tokenChain(stream,state,[stream.eat(c)],\"string\");}}}}\n if(ch==\"m\"){\n var c=look(stream, -2);\n if(!(c&&/\\w/.test(c))){\n c=stream.eat(/[(\\[{<\\^'\"!~\\/]/);\n if(c){\n if(/[\\^'\"!~\\/]/.test(c)){\n return tokenChain(stream,state,[c],RXstyle,RXmodifiers);}\n if(c==\"(\"){\n return tokenChain(stream,state,[\")\"],RXstyle,RXmodifiers);}\n if(c==\"[\"){\n return tokenChain(stream,state,[\"]\"],RXstyle,RXmodifiers);}\n if(c==\"{\"){\n return tokenChain(stream,state,[\"}\"],RXstyle,RXmodifiers);}\n if(c==\"<\"){\n return tokenChain(stream,state,[\">\"],RXstyle,RXmodifiers);}}}}\n if(ch==\"s\"){\n var c=/[\\/>\\]})\\w]/.test(look(stream, -2));\n if(!c){\n c=stream.eat(/[(\\[{<\\^'\"!~\\/]/);\n if(c){\n if(c==\"[\")\n return tokenChain(stream,state,[\"]\",\"]\"],RXstyle,RXmodifiers);\n if(c==\"{\")\n return tokenChain(stream,state,[\"}\",\"}\"],RXstyle,RXmodifiers);\n if(c==\"<\")\n return tokenChain(stream,state,[\">\",\">\"],RXstyle,RXmodifiers);\n if(c==\"(\")\n return tokenChain(stream,state,[\")\",\")\"],RXstyle,RXmodifiers);\n return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}\n if(ch==\"y\"){\n var c=/[\\/>\\]})\\w]/.test(look(stream, -2));\n if(!c){\n c=stream.eat(/[(\\[{<\\^'\"!~\\/]/);\n if(c){\n if(c==\"[\")\n return tokenChain(stream,state,[\"]\",\"]\"],RXstyle,RXmodifiers);\n if(c==\"{\")\n return tokenChain(stream,state,[\"}\",\"}\"],RXstyle,RXmodifiers);\n if(c==\"<\")\n return tokenChain(stream,state,[\">\",\">\"],RXstyle,RXmodifiers);\n if(c==\"(\")\n return tokenChain(stream,state,[\")\",\")\"],RXstyle,RXmodifiers);\n return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}\n if(ch==\"t\"){\n var c=/[\\/>\\]})\\w]/.test(look(stream, -2));\n if(!c){\n c=stream.eat(\"r\");if(c){\n c=stream.eat(/[(\\[{<\\^'\"!~\\/]/);\n if(c){\n if(c==\"[\")\n return tokenChain(stream,state,[\"]\",\"]\"],RXstyle,RXmodifiers);\n if(c==\"{\")\n return tokenChain(stream,state,[\"}\",\"}\"],RXstyle,RXmodifiers);\n if(c==\"<\")\n return tokenChain(stream,state,[\">\",\">\"],RXstyle,RXmodifiers);\n if(c==\"(\")\n return tokenChain(stream,state,[\")\",\")\"],RXstyle,RXmodifiers);\n return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}}\n if(ch==\"`\"){\n return tokenChain(stream,state,[ch],\"builtin\");}\n if(ch==\"/\"){\n if(!/~\\s*$/.test(prefix(stream)))\n return \"operator\";\n else\n return tokenChain(stream,state,[ch],RXstyle,RXmodifiers);}\n if(ch==\"$\"){\n var p=stream.pos;\n if(stream.eatWhile(/\\d/)||stream.eat(\"{\")&&stream.eatWhile(/\\d/)&&stream.eat(\"}\"))\n return \"builtin\";\n else\n stream.pos=p;}\n if(/[$@%]/.test(ch)){\n var p=stream.pos;\n if(stream.eat(\"^\")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(look(stream, -2))&&stream.eat(/[=|\\\\\\-#?@;:&`~\\^!\\[\\]*'\"$+.,\\/<>()]/)){\n var c=stream.current();\n if(PERL[c])\n return \"builtin\";}\n stream.pos=p;}\n if(/[$@%&]/.test(ch)){\n if(stream.eatWhile(/[\\w$]/)||stream.eat(\"{\")&&stream.eatWhile(/[\\w$]/)&&stream.eat(\"}\")){\n var c=stream.current();\n if(PERL[c])\n return \"builtin\";\n else\n return \"variable\";}}\n if(ch==\"#\"){\n if(look(stream, -2)!=\"$\"){\n stream.skipToEnd();\n return \"comment\";}}\n if(/[:+\\-\\^*$&%@=<>!?|\\/~\\.]/.test(ch)){\n var p=stream.pos;\n stream.eatWhile(/[:+\\-\\^*$&%@=<>!?|\\/~\\.]/);\n if(PERL[stream.current()])\n return \"operator\";\n else\n stream.pos=p;}\n if(ch==\"_\"){\n if(stream.pos==1){\n if(suffix(stream, 6)==\"_END__\"){\n return tokenChain(stream,state,['\\0'],\"comment\");}\n else if(suffix(stream, 7)==\"_DATA__\"){\n return tokenChain(stream,state,['\\0'],\"builtin\");}\n else if(suffix(stream, 7)==\"_C__\"){\n return tokenChain(stream,state,['\\0'],\"string\");}}}\n if(/\\w/.test(ch)){\n var p=stream.pos;\n if(look(stream, -2)==\"{\"&&(look(stream, 0)==\"}\"||stream.eatWhile(/\\w/)&&look(stream, 0)==\"}\"))\n return \"string\";\n else\n stream.pos=p;}\n if(/[A-Z]/.test(ch)){\n var l=look(stream, -2);\n var p=stream.pos;\n stream.eatWhile(/[A-Z_]/);\n if(/[\\da-z]/.test(look(stream, 0))){\n stream.pos=p;}\n else{\n var c=PERL[stream.current()];\n if(!c)\n return \"meta\";\n if(c[1])\n c=c[0];\n if(l!=\":\"){\n if(c==1)\n return \"keyword\";\n else if(c==2)\n return \"def\";\n else if(c==3)\n return \"atom\";\n else if(c==4)\n return \"operator\";\n else if(c==5)\n return \"builtin\";\n else\n return \"meta\";}\n else\n return \"meta\";}}\n if(/[a-zA-Z_]/.test(ch)){\n var l=look(stream, -2);\n stream.eatWhile(/\\w/);\n var c=PERL[stream.current()];\n if(!c)\n return \"meta\";\n if(c[1])\n c=c[0];\n if(l!=\":\"){\n if(c==1)\n return \"keyword\";\n else if(c==2)\n return \"def\";\n else if(c==3)\n return \"atom\";\n else if(c==4)\n return \"operator\";\n else if(c==5)\n return \"builtin\";\n else\n return \"meta\";}\n else\n return \"meta\";}\n return null;}\n\nexport const perl = {\n name: \"perl\",\n\n startState: function() {\n return {\n tokenize: tokenPerl,\n chain: null,\n style: null,\n tail: null\n };\n },\n token: function(stream, state) {\n return (state.tokenize || tokenPerl)(stream, state);\n },\n languageData: {\n commentTokens: {line: \"#\"},\n wordChars: \"$\"\n }\n};\n"],"names":["look","stream","c","string","charAt","pos","prefix","x","substr","suffix","y","length","eatSuffix","PERL","elsif","unless","foreach","accept","alarm","bind","binmode","bless","bootstrap","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","crypt","dbmclose","dbmopen","defined","die","dump","each","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","exists","exit","fcntl","fileno","flock","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getppid","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","grep","hex","index","ioctl","keys","kill","last","lc","lcfirst","listen","local","localtime","lock","lstat","m","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","next","no","oct","open","opendir","ord","our","pack","pipe","pop","print","printf","prototype","push","q","qq","qr","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","reverse","rewinddir","rindex","rmdir","s","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sleep","socket","socketpair","splice","sprintf","srand","stat","state","study","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unlink","unpack","unshift","untie","use","utime","values","vec","wait","waitpid","wantarray","warn","when","write","RXstyle","RXmodifiers","tokenChain","chain","style","tail","tokenize","e","i","undefined","eatWhile","tokenPerl","tokenSOMETHING","skipToEnd","eatSpace","match","current","sol","ch","p","n","eat","test","l","perl","name","startState","token","languageData","commentTokens","line","wordChars"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/3220.index.js b/pr-preview/pr-770/3220.index.js new file mode 100644 index 00000000..cd8ca47b --- /dev/null +++ b/pr-preview/pr-770/3220.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[3220],{3220:(t,e,n)=>{function r(t){function e(t,e){t.cmdState.push(e)}function n(t){return t.cmdState.length>0?t.cmdState[t.cmdState.length-1]:null}function r(t,e,n){return function(){this.name=t,this.bracketNo=0,this.style=e,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var a={};function i(t,e){t.f=e}function c(t,r){var c;if(t.match(/^\\[a-zA-Z@\xc0-\u1fff\u2060-\uffff]+/)){var f=t.current().slice(1);return e(r,c=new(c=a.hasOwnProperty(f)?a[f]:a.DEFAULT)),i(r,o),c.style}if(t.match(/^\\[$&%#{}_]/))return"tag";if(t.match(/^\\[,;!\/\\]/))return"tag";if(t.match("\\["))return i(r,(function(t,e){return u(t,e,"\\]")})),"keyword";if(t.match("\\("))return i(r,(function(t,e){return u(t,e,"\\)")})),"keyword";if(t.match("$$"))return i(r,(function(t,e){return u(t,e,"$$")})),"keyword";if(t.match("$"))return i(r,(function(t,e){return u(t,e,"$")})),"keyword";var m=t.next();return"%"==m?(t.skipToEnd(),"comment"):"}"==m||"]"==m?(c=n(r))?(c.closeBracket(m),i(r,o),"bracket"):"error":"{"==m||"["==m?(e(r,c=new(c=a.DEFAULT)),"bracket"):/\d/.test(m)?(t.eatWhile(/[\w.%]/),"atom"):(t.eatWhile(/[\w\-_]/),c=function(t){for(var e=t.cmdState,n=e.length-1;n>=0;n--){var r=e[n];if("DEFAULT"!=r.name)return r}return{styleIdentifier:function(){return null}}}(r),"begin"==c.name&&(c.argument=t.current()),c.styleIdentifier())}function u(t,e,n){if(t.eatSpace())return null;if(n&&t.match(n))return i(e,c),"keyword";if(t.match(/^\\[a-zA-Z@]+/))return"tag";if(t.match(/^[a-zA-Z]+/))return"variableName.special";if(t.match(/^\\[$&%#{}_]/))return"tag";if(t.match(/^\\[,;!\/]/))return"tag";if(t.match(/^[\^_&]/))return"tag";if(t.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(t.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=t.next();return"{"==r||"}"==r||"["==r||"]"==r||"("==r||")"==r?"bracket":"%"==r?(t.skipToEnd(),"comment"):"error"}function o(t,e){var r=t.peek();return"{"==r||"["==r?(n(e).openBracket(r),t.eat(r),i(e,c),"bracket"):/[ \t\r]/.test(r)?(t.eat(r),null):(i(e,c),function(t){var e=t.cmdState.pop();e&&e.closeBracket()}(e),c(t,e))}return a.importmodule=r("importmodule","tag",["string","builtin"]),a.documentclass=r("documentclass","tag",["","atom"]),a.usepackage=r("usepackage","tag",["atom"]),a.begin=r("begin","tag",["atom"]),a.end=r("end","tag",["atom"]),a.label=r("label","tag",["atom"]),a.ref=r("ref","tag",["atom"]),a.eqref=r("eqref","tag",["atom"]),a.cite=r("cite","tag",["atom"]),a.bibitem=r("bibitem","tag",["atom"]),a.Bibitem=r("Bibitem","tag",["atom"]),a.RBibitem=r("RBibitem","tag",["atom"]),a.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{name:"stex",startState:function(){return{cmdState:[],f:t?function(t,e){return u(t,e)}:c}},copyState:function(t){return{cmdState:t.cmdState.slice(),f:t.f}},token:function(t,e){return e.f(t,e)},blankLine:function(t){t.f=c,t.cmdState.length=0},languageData:{commentTokens:{line:"%"}}}}n.r(e),n.d(e,{stex:()=>a,stexMath:()=>i});const a=r(!1),i=r(!0)}}]); +//# sourceMappingURL=3220.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/3220.index.js.map b/pr-preview/pr-770/3220.index.js.map new file mode 100644 index 00000000..136b47fc --- /dev/null +++ b/pr-preview/pr-770/3220.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"3220.index.js","mappings":"8FAAA,SAASA,EAAOC,GACd,SAASC,EAAYC,EAAOC,GAC1BD,EAAME,SAASC,KAAKF,EACtB,CAEA,SAASG,EAAYJ,GACnB,OAAIA,EAAME,SAASG,OAAS,EACnBL,EAAME,SAASF,EAAME,SAASG,OAAS,GAEvC,IAEX,CAsBA,SAASC,EAAiBC,EAAYC,EAAUC,GAC9C,OAAO,WACLC,KAAKC,KAAOJ,EACZG,KAAKE,UAAY,EACjBF,KAAKG,MAAQL,EACbE,KAAKD,OAASA,EACdC,KAAKI,SAAW,KAEhBJ,KAAKK,gBAAkB,WACrB,OAAOL,KAAKD,OAAOC,KAAKE,UAAY,IAAM,IAC5C,EACAF,KAAKM,YAAc,WAEjB,OADAN,KAAKE,YACE,SACT,EACAF,KAAKO,aAAe,WAAY,CAClC,CACF,CAEA,IAAIC,EAAU,CAAC,EAuBf,SAASC,EAASnB,EAAOoB,GACvBpB,EAAMoB,EAAIA,CACZ,CAGA,SAASC,EAAOC,EAAQtB,GACtB,IAAIuB,EAEJ,GAAID,EAAOE,MAAM,yCAA0C,CACzD,IAAIC,EAAUH,EAAOI,UAAUC,MAAM,GAKrC,OAFA5B,EAAYC,EADZuB,EAAO,IADPA,EAAOL,EAAQU,eAAeH,GAAWP,EAAQO,GAAWP,EAAiB,UAG7EC,EAASnB,EAAO6B,GACTN,EAAKV,KACd,CAGA,GAAIS,EAAOE,MAAM,gBACf,MAAO,MAIT,GAAIF,EAAOE,MAAM,gBACf,MAAO,MAIT,GAAIF,EAAOE,MAAM,OAEf,OADAL,EAASnB,GAAO,SAASsB,EAAQtB,GAAQ,OAAO8B,EAAWR,EAAQtB,EAAO,MAAQ,IAC3E,UAET,GAAIsB,EAAOE,MAAM,OAEf,OADAL,EAASnB,GAAO,SAASsB,EAAQtB,GAAQ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Aa,MAAO,CAAC,SAE7DY,EAAiB,QAAI,WACnBR,KAAKC,KAAO,UACZD,KAAKG,MAAQ,MAEbH,KAAKK,gBAAkBL,KAAKM,YAAcN,KAAKO,aAAe,WAAY,CAC5E,EA8IO,CACLN,KAAM,OACNkC,WAAY,WAEV,MAAO,CACL3C,SAAU,GACVkB,EAHMtB,EAAW,SAASwB,EAAQtB,GAAQ,OAAO8B,EAAWR,EAAQtB,EAAQ,EAAIqB,EAKpF,EACAyB,UAAW,SAASC,GAClB,MAAO,CACL7C,SAAU6C,EAAE7C,SAASyB,QACrBP,EAAG2B,EAAE3B,EAET,EACA4B,MAAO,SAASC,EAAQjD,GACtB,OAAOA,EAAMoB,EAAE6B,EAAQjD,EACzB,EACAkD,UAAW,SAASlD,GAClBA,EAAMoB,EAAIC,EACVrB,EAAME,SAASG,OAAS,CAC1B,EACA8C,aAAc,CACZC,cAAe,CAACC,KAAM,MAG5B,C,0CAEO,MAAMC,EAAOzD,GAAO,GACd0D,EAAW1D,GAAO,E","sources":["webpack://thebe/../../node_modules/@codemirror/legacy-modes/mode/stex.js"],"sourcesContent":["function mkStex(mathMode) {\n function pushCommand(state, command) {\n state.cmdState.push(command);\n }\n\n function peekCommand(state) {\n if (state.cmdState.length > 0) {\n return state.cmdState[state.cmdState.length - 1];\n } else {\n return null;\n }\n }\n\n function popCommand(state) {\n var plug = state.cmdState.pop();\n if (plug) {\n plug.closeBracket();\n }\n }\n\n // returns the non-default plugin closest to the end of the list\n function getMostPowerful(state) {\n var context = state.cmdState;\n for (var i = context.length - 1; i >= 0; i--) {\n var plug = context[i];\n if (plug.name == \"DEFAULT\") {\n continue;\n }\n return plug;\n }\n return { styleIdentifier: function() { return null; } };\n }\n\n function addPluginPattern(pluginName, cmdStyle, styles) {\n return function () {\n this.name = pluginName;\n this.bracketNo = 0;\n this.style = cmdStyle;\n this.styles = styles;\n this.argument = null; // \\begin and \\end have arguments that follow. These are stored in the plugin\n\n this.styleIdentifier = function() {\n return this.styles[this.bracketNo - 1] || null;\n };\n this.openBracket = function() {\n this.bracketNo++;\n return \"bracket\";\n };\n this.closeBracket = function() {};\n };\n }\n\n var plugins = {};\n\n plugins[\"importmodule\"] = addPluginPattern(\"importmodule\", \"tag\", [\"string\", \"builtin\"]);\n plugins[\"documentclass\"] = addPluginPattern(\"documentclass\", \"tag\", [\"\", \"atom\"]);\n plugins[\"usepackage\"] = addPluginPattern(\"usepackage\", \"tag\", [\"atom\"]);\n plugins[\"begin\"] = addPluginPattern(\"begin\", \"tag\", [\"atom\"]);\n plugins[\"end\"] = addPluginPattern(\"end\", \"tag\", [\"atom\"]);\n\n plugins[\"label\" ] = addPluginPattern(\"label\" , \"tag\", [\"atom\"]);\n plugins[\"ref\" ] = addPluginPattern(\"ref\" , \"tag\", [\"atom\"]);\n plugins[\"eqref\" ] = addPluginPattern(\"eqref\" , \"tag\", [\"atom\"]);\n plugins[\"cite\" ] = addPluginPattern(\"cite\" , \"tag\", [\"atom\"]);\n plugins[\"bibitem\" ] = addPluginPattern(\"bibitem\" , \"tag\", [\"atom\"]);\n plugins[\"Bibitem\" ] = addPluginPattern(\"Bibitem\" , \"tag\", [\"atom\"]);\n plugins[\"RBibitem\" ] = addPluginPattern(\"RBibitem\" , \"tag\", [\"atom\"]);\n\n plugins[\"DEFAULT\"] = function () {\n this.name = \"DEFAULT\";\n this.style = \"tag\";\n\n this.styleIdentifier = this.openBracket = this.closeBracket = function() {};\n };\n\n function setState(state, f) {\n state.f = f;\n }\n\n // called when in a normal (no environment) context\n function normal(source, state) {\n var plug;\n // Do we look like '\\command' ? If so, attempt to apply the plugin 'command'\n if (source.match(/^\\\\[a-zA-Z@\\xc0-\\u1fff\\u2060-\\uffff]+/)) {\n var cmdName = source.current().slice(1);\n plug = plugins.hasOwnProperty(cmdName) ? plugins[cmdName] : plugins[\"DEFAULT\"];\n plug = new plug();\n pushCommand(state, plug);\n setState(state, beginParams);\n return plug.style;\n }\n\n // escape characters\n if (source.match(/^\\\\[$&%#{}_]/)) {\n return \"tag\";\n }\n\n // white space control characters\n if (source.match(/^\\\\[,;!\\/\\\\]/)) {\n return \"tag\";\n }\n\n // find if we're starting various math modes\n if (source.match(\"\\\\[\")) {\n setState(state, function(source, state){ return inMathMode(source, state, \"\\\\]\"); });\n return \"keyword\";\n }\n if (source.match(\"\\\\(\")) {\n setState(state, function(source, state){ return inMathMode(source, state, \"\\\\)\"); });\n return \"keyword\";\n }\n if (source.match(\"$$\")) {\n setState(state, function(source, state){ return inMathMode(source, state, \"$$\"); });\n return \"keyword\";\n }\n if (source.match(\"$\")) {\n setState(state, function(source, state){ return inMathMode(source, state, \"$\"); });\n return \"keyword\";\n }\n\n var ch = source.next();\n if (ch == \"%\") {\n source.skipToEnd();\n return \"comment\";\n } else if (ch == '}' || ch == ']') {\n plug = peekCommand(state);\n if (plug) {\n plug.closeBracket(ch);\n setState(state, beginParams);\n } else {\n return \"error\";\n }\n return \"bracket\";\n } else if (ch == '{' || ch == '[') {\n plug = plugins[\"DEFAULT\"];\n plug = new plug();\n pushCommand(state, plug);\n return \"bracket\";\n } else if (/\\d/.test(ch)) {\n source.eatWhile(/[\\w.%]/);\n return \"atom\";\n } else {\n source.eatWhile(/[\\w\\-_]/);\n plug = getMostPowerful(state);\n if (plug.name == 'begin') {\n plug.argument = source.current();\n }\n return plug.styleIdentifier();\n }\n }\n\n function inMathMode(source, state, endModeSeq) {\n if (source.eatSpace()) {\n return null;\n }\n if (endModeSeq && source.match(endModeSeq)) {\n setState(state, normal);\n return \"keyword\";\n }\n if (source.match(/^\\\\[a-zA-Z@]+/)) {\n return \"tag\";\n }\n if (source.match(/^[a-zA-Z]+/)) {\n return \"variableName.special\";\n }\n // escape characters\n if (source.match(/^\\\\[$&%#{}_]/)) {\n return \"tag\";\n }\n // white space control characters\n if (source.match(/^\\\\[,;!\\/]/)) {\n return \"tag\";\n }\n // special math-mode characters\n if (source.match(/^[\\^_&]/)) {\n return \"tag\";\n }\n // non-special characters\n if (source.match(/^[+\\-<>|=,\\/@!*:;'\"`~#?]/)) {\n return null;\n }\n if (source.match(/^(\\d+\\.\\d*|\\d*\\.\\d+|\\d+)/)) {\n return \"number\";\n }\n var ch = source.next();\n if (ch == \"{\" || ch == \"}\" || ch == \"[\" || ch == \"]\" || ch == \"(\" || ch == \")\") {\n return \"bracket\";\n }\n\n if (ch == \"%\") {\n source.skipToEnd();\n return \"comment\";\n }\n return \"error\";\n }\n\n function beginParams(source, state) {\n var ch = source.peek(), lastPlug;\n if (ch == '{' || ch == '[') {\n lastPlug = peekCommand(state);\n lastPlug.openBracket(ch);\n source.eat(ch);\n setState(state, normal);\n return \"bracket\";\n }\n if (/[ \\t\\r]/.test(ch)) {\n source.eat(ch);\n return null;\n }\n setState(state, normal);\n popCommand(state);\n\n return normal(source, state);\n }\n\n return {\n name: \"stex\",\n startState: function() {\n var f = mathMode ? function(source, state){ return inMathMode(source, state); } : normal;\n return {\n cmdState: [],\n f: f\n };\n },\n copyState: function(s) {\n return {\n cmdState: s.cmdState.slice(),\n f: s.f\n };\n },\n token: function(stream, state) {\n return state.f(stream, state);\n },\n blankLine: function(state) {\n state.f = normal;\n state.cmdState.length = 0;\n },\n languageData: {\n commentTokens: {line: \"%\"}\n }\n };\n};\n\nexport const stex = mkStex(false)\nexport const stexMath = mkStex(true)\n"],"names":["mkStex","mathMode","pushCommand","state","command","cmdState","push","peekCommand","length","addPluginPattern","pluginName","cmdStyle","styles","this","name","bracketNo","style","argument","styleIdentifier","openBracket","closeBracket","plugins","setState","f","normal","source","plug","match","cmdName","current","slice","hasOwnProperty","beginParams","inMathMode","ch","next","skipToEnd","test","eatWhile","context","i","getMostPowerful","endModeSeq","eatSpace","peek","eat","pop","popCommand","startState","copyState","s","token","stream","blankLine","languageData","commentTokens","line","stex","stexMath"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/3242.index.js b/pr-preview/pr-770/3242.index.js new file mode 100644 index 00000000..8dafa733 --- /dev/null +++ b/pr-preview/pr-770/3242.index.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkthebe=self.webpackChunkthebe||[]).push([[3242],{3242:(e,t,a)=>{a.r(t),a.d(t,{autoCloseTags:()=>be,html:()=>he,htmlCompletionSource:()=>ce,htmlCompletionSourceWith:()=>pe,htmlLanguage:()=>ge,htmlPlain:()=>Se});var l=a(3643),r=a(9913),n=a(9066);const s=20,o=22,O=23,i=24,u=26,c=27,p=28,d=31,m=34,f=37,S={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},g={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},h={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function x(e){return 9==e||10==e||13==e||32==e}let b=null,P=null,V=0;function w(e,t){let a=e.pos+t;if(V==a&&P==e)return b;let l=e.peek(t);for(;x(l);)l=e.peek(++t);let r="";for(;45==(n=l)||46==n||58==n||n>=65&&n<=90||95==n||n>=97&&n<=122||n>=161;)r+=String.fromCharCode(l),l=e.peek(++t);var n;return P=e,V=a,b=r?r.toLowerCase():l==v||l==T?void 0:null}const v=63,T=33;function X(e,t){this.name=e,this.parent=t}const y=[6,10,7,8,9],k=new l.Aj({start:null,shift:(e,t,a,l)=>y.indexOf(t)>-1?new X(w(l,1)||"",e):e,reduce:(e,t)=>t==s&&e?e.parent:e,reuse(e,t,a,l){let r=t.type.id;return 6==r||36==r?new X(w(l,1)||"",e):e},strict:!1}),$=new l.Lu(((e,t)=>{if(60!=e.next)return void(e.next<0&&t.context&&e.acceptToken(57));e.advance();let a=47==e.next;a&&e.advance();let l=w(e,0);if(void 0===l)return;if(!l)return e.acceptToken(a?14:6);let r=t.context?t.context.name:null;if(a){if(l==r)return e.acceptToken(11);if(r&&g[r])return e.acceptToken(57,-2);if(t.dialectEnabled(0))return e.acceptToken(12);for(let e=t.context;e;e=e.parent)if(e.name==l)return;e.acceptToken(13)}else{if("script"==l)return e.acceptToken(7);if("style"==l)return e.acceptToken(8);if("textarea"==l)return e.acceptToken(9);if(S.hasOwnProperty(l))return e.acceptToken(10);r&&h[r]&&h[r][l]?e.acceptToken(57,-1):e.acceptToken(6)}}),{contextual:!0}),_=new l.Lu((e=>{for(let t=0,a=0;;a++){if(e.next<0){a&&e.acceptToken(58);break}if(45==e.next)t++;else{if(62==e.next&&t>=2){a>=3&&e.acceptToken(58,-2);break}t=0}e.advance()}})),q=new l.Lu(((e,t)=>{if(47==e.next&&62==e.peek(1)){let a=t.dialectEnabled(1)||function(e){for(;e;e=e.parent)if("svg"==e.name||"math"==e.name)return!0;return!1}(t.context);e.acceptToken(a?5:4,2)}else 62==e.next&&e.acceptToken(4,1)}));function Q(e,t,a){let r=2+e.length;return new l.Lu((l=>{for(let n=0,s=0,o=0;;o++){if(l.next<0){o&&l.acceptToken(t);break}if(0==n&&60==l.next||1==n&&47==l.next||n>=2&&ns?l.acceptToken(t,-s):l.acceptToken(a,-(s-2));break}if((10==l.next||13==l.next)&&o){l.acceptToken(t,1);break}n=s=0}else s++;l.advance()}}))}const A=Q("script",54,1),C=Q("style",55,2),Y=Q("textarea",56,3),M=(0,r.pn)({"Text RawText":r._A.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":r._A.angleBracket,TagName:r._A.tagName,"MismatchedCloseTag/TagName":[r._A.tagName,r._A.invalid],AttributeName:r._A.attributeName,"AttributeValue UnquotedAttributeValue":r._A.attributeValue,Is:r._A.definitionOperator,"EntityReference CharacterReference":r._A.character,Comment:r._A.blockComment,ProcessingInst:r._A.processingInstruction,DoctypeDecl:r._A.documentMeta}),R=l.U1.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$o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rXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:k,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[M],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ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v)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let n=e.type.id;if(n==p)return E(e,t,a);if(n==d)return E(e,t,l);if(n==m)return E(e,t,r);if(n==s&&o.length){let a,l=e.node,r=l.firstChild,n=r&&B(r,t);if(n)for(let e of o)if(e.tag==n&&(!e.attrs||e.attrs(a||(a=Z(r,t))))){let t=l.lastChild,a=t.type.id==f?t.from:l.to;if(a>r.to)return{parser:e.parser,overlay:[{from:r.to,to:a}]}}}if(i&&n==O){let a,l=e.node;if(a=l.firstChild){let e=i[t.read(a.from,a.to)];if(e)for(let a of e){if(a.tagName&&a.tagName!=B(l.parent,t))continue;let e=l.lastChild;if(e.type.id==u){let t=e.from+1,l=e.lastChild,r=e.to-(l&&l.isError?0:1);if(r>t)return{parser:a.parser,overlay:[{from:t,to:r}]}}else if(e.type.id==c)return{parser:a.parser,overlay:[{from:e.from,to:e.to}]}}}}return null}))}var W=a(4448),D=a(2e3),G=a(3173),j=a(4830),I=a(9587);const U=["_blank","_self","_top","_parent"],N=["ascii","utf-8","utf-16","latin1","latin1"],L=["get","post","put","delete"],F=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],H=["true","false"],K={},J={a:{attrs:{href:null,ping:null,type:null,media:null,target:U,hreflang:null}},abbr:K,address:K,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:K,aside:K,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:K,base:{attrs:{href:null,target:U}},bdi:K,bdo:K,blockquote:{attrs:{cite:null}},body:K,br:K,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:F,formmethod:L,formnovalidate:["novalidate"],formtarget:U,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:K,center:K,cite:K,code:K,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:K,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:K,div:K,dl:K,dt:K,em:K,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:K,figure:K,footer:K,form:{attrs:{action:null,name:null,"accept-charset":N,autocomplete:["on","off"],enctype:F,method:L,novalidate:["novalidate"],target:U}},h1:K,h2:K,h3:K,h4:K,h5:K,h6:K,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:K,hgroup:K,hr:K,html:{attrs:{manifest:null}},i:K,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:F,formmethod:L,formnovalidate:["novalidate"],formtarget:U,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:K,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:K,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:K,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:N,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:K,noscript:K,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:K,param:{attrs:{name:null,value:null}},pre:K,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:K,rt:K,ruby:K,samp:K,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:N}},section:K,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:K,source:{attrs:{src:null,type:null,media:null}},span:K,strong:K,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:K,summary:K,sup:K,table:K,tbody:K,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:K,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:K,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:K,time:{attrs:{datetime:null}},title:K,tr:K,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:K,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:K},ee={accesskey:null,class:null,contenteditable:H,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:H,autocorrect:H,autocapitalize:H,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":H,"aria-autocomplete":["inline","list","both","none"],"aria-busy":H,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":H,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":H,"aria-hidden":H,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":H,"aria-multiselectable":H,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":H,"aria-relevant":null,"aria-required":H,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},te="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map((e=>"on"+e));for(let e of te)ee[e]=null;class ae{constructor(e,t){this.tags=Object.assign(Object.assign({},J),e),this.globalAttrs=Object.assign(Object.assign({},ee),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}function le(e,t,a=e.length){if(!t)return"";let l=t.firstChild,r=l&&l.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,a)):""}function re(e,t=!1){for(;e;e=e.parent)if("Element"==e.name){if(!t)return e;t=!1}return null}function ne(e,t,a){let l=a.tags[le(e,re(t))];return(null==l?void 0:l.children)||a.allTags}function se(e,t){let a=[];for(let l=re(t);l&&!l.type.isTop;l=re(l.parent)){let r=le(e,l);if(r&&"CloseTag"==l.lastChild.name)break;r&&a.indexOf(r)<0&&("EndTag"==t.name||t.from>=l.firstChild.to)&&a.push(r)}return a}ae.default=new ae;const oe=/^[:\-\.\w\u00b7-\uffff]*$/;function Oe(e,t,a,l,r){let n=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",s=re(a,!0);return{from:l,to:r,options:ne(e.doc,s,t).map((e=>({label:e,type:"type"}))).concat(se(e.doc,a).map(((e,t)=>({label:"/"+e,apply:"/"+e+n,type:"type",boost:99-t})))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function ie(e,t,a,l){let r=/\s*>/.test(e.sliceDoc(l,l+5))?"":">";return{from:a,to:l,options:se(e.doc,t).map(((e,t)=>({label:e,apply:e+r,type:"type",boost:99-t}))),validFor:oe}}function ue(e,t){let{state:a,pos:l}=t,r=(0,I.mv)(a).resolveInner(l,-1),n=r.resolve(l);for(let e,t=l;n==r&&(e=r.childBefore(t));){let a=e.lastChild;if(!a||!a.type.isError||a.from({label:e,type:"property"}))),validFor:oe}}(a,e,r,"AttributeName"==r.name?r.from:l,l):"Is"==r.name||"AttributeValue"==r.name||"UnquotedAttributeValue"==r.name?function(e,t,a,l,r){var n;let s,o=null===(n=a.parent)||void 0===n?void 0:n.getChild("AttributeName"),O=[];if(o){let n=e.sliceDoc(o.from,o.to),i=t.globalAttrs[n];if(!i){let l=re(a),r=l?t.tags[le(e.doc,l)]:null;i=(null==r?void 0:r.attrs)&&r.attrs[n]}if(i){let t=e.sliceDoc(l,r).toLowerCase(),a='"',n='"';/^['"]/.test(t)?(s='"'==t[0]?/^[^"]*$/:/^[^']*$/,a="",n=e.sliceDoc(r,r+1)==t[0]?"":t[0],t=t.slice(1),l++):s=/^[^\s<>='"]*$/;for(let e of i)O.push({label:e,apply:a+e+n,type:"constant"})}}return{from:l,to:r,options:O,validFor:s}}(a,e,r,"Is"==r.name?l:r.from,l):!t.explicit||"Element"!=n.name&&"Text"!=n.name&&"Document"!=n.name?null:function(e,t,a,l){let r=[],n=0;for(let l of ne(e.doc,a,t))r.push({label:"<"+l,type:"type"});for(let t of se(e.doc,a))r.push({label:"",type:"type",boost:99-n++});return{from:l,to:l,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}(a,e,r,l)}function ce(e){return ue(ae.default,e)}function pe(e){let{extraTags:t,extraGlobalAttributes:a}=e,l=a||t?new ae(t,a):ae.default;return e=>ue(l,e)}const de=D.javascriptLanguage.parser.configure({top:"SingleExpression"}),me=[{tag:"script",attrs:e=>"text/typescript"==e.type||"ts"==e.lang,parser:D.typescriptLanguage.parser},{tag:"script",attrs:e=>"text/babel"==e.type||"text/jsx"==e.type,parser:D.jsxLanguage.parser},{tag:"script",attrs:e=>"text/typescript-jsx"==e.type,parser:D.tsxLanguage.parser},{tag:"script",attrs:e=>/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type),parser:de},{tag:"script",attrs:e=>!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type),parser:D.javascriptLanguage.parser},{tag:"style",attrs:e=>(!e.lang||"css"==e.lang)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type)),parser:W.cssLanguage.parser}],fe=[{name:"style",parser:W.cssLanguage.parser.configure({top:"Styles"})}].concat(te.map((e=>({name:e,parser:D.javascriptLanguage.parser})))),Se=I.bj.define({name:"html",parser:R.configure({props:[I.Oh.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag":e=>e.column(e.node.from)+e.unit,Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),ge=Se.configure({wrap:z(me,fe)});function he(e={}){let t,a="";!1===e.matchClosingTags&&(a="noMatch"),!0===e.selfClosingTags&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(t=z((e.nestedLanguages||[]).concat(me),(e.nestedAttributes||[]).concat(fe)));let l=t?Se.configure({wrap:t,dialect:a}):a?ge.configure({dialect:a}):ge;return new I.Yy(l,[ge.data.of({autocomplete:pe(e)}),!1!==e.autoCloseTags?be:[],(0,D.javascript)().support,(0,W.css)().support])}const xe=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),be=G.Lz.inputHandler.of(((e,t,a,l,r)=>{if(e.composing||e.state.readOnly||t!=a||">"!=l&&"/"!=l||!ge.isActiveAt(e.state,t,-1))return!1;let n=r(),{state:s}=n,o=s.changeByRange((e=>{var t,a,r;let n,o=s.doc.sliceString(e.from-1,e.to)==l,{head:O}=e,i=(0,I.mv)(s).resolveInner(O,-1);if(o&&">"==l&&"EndTag"==i.name){let l=i.parent;if("CloseTag"!=(null===(a=null===(t=l.parent)||void 0===t?void 0:t.lastChild)||void 0===a?void 0:a.name)&&(n=le(s.doc,l.parent,O))&&!xe.has(n))return{range:e,changes:{from:O,to:O+(">"===s.doc.sliceString(O,O+1)?1:0),insert:``}}}else if(o&&"/"==l&&"IncompleteCloseTag"==i.name){let e=i.parent;if(i.from==O-2&&"CloseTag"!=(null===(r=e.lastChild)||void 0===r?void 0:r.name)&&(n=le(s.doc,e,O))&&!xe.has(n)){let e=O+(">"===s.doc.sliceString(O,O+1)?1:0),t=`${n}>`;return{range:j.OF.cursor(O+t.length,-1),changes:{from:O,to:e,insert:t}}}}return{range:e}}));return!o.changes.empty&&(e.dispatch([n,s.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}))}}]); +//# sourceMappingURL=3242.index.js.map \ No newline at end of file diff --git a/pr-preview/pr-770/3242.index.js.map b/pr-preview/pr-770/3242.index.js.map new file mode 100644 index 00000000..33d3eb87 --- /dev/null +++ b/pr-preview/pr-770/3242.index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"3242.index.js","mappings":"kRAKA,MAmBEA,EAAU,GACVC,EAAU,GACVC,EAAY,GACZC,EAAgB,GAChBC,EAAiB,GACjBC,EAAyB,GACzBC,EAAa,GACbC,EAAY,GACZC,EAAe,GAEfC,EAAW,GAMPC,EAAc,CAClBC,MAAM,EAAMC,MAAM,EAAMC,IAAI,EAAMC,KAAK,EAAMC,SAAS,EACtDC,OAAO,EAAMC,OAAO,EAAMC,IAAI,EAAMC,KAAK,EAAMC,OAAO,EACtDC,QAAQ,EAAMC,MAAM,EAAMC,MAAM,EAAMC,OAAO,EAAMC,QAAQ,EAC3DC,OAAO,EAAMC,KAAK,EAAMC,UAAU,GAG9BC,EAAmB,CACvBC,IAAI,EAAMC,IAAI,EAAMC,UAAU,EAAMC,QAAQ,EAAMC,GAAG,EACrDC,IAAI,EAAMC,IAAI,EAAMC,OAAO,EAAMC,IAAI,EAAMC,OAAO,EAClDC,IAAI,EAAMC,IAAI,GAGVC,EAAc,CAClBZ,GAAI,CAACA,IAAI,EAAMa,IAAI,GACnBA,GAAI,CAACb,IAAI,EAAMa,IAAI,GACnBZ,GAAI,CAACA,IAAI,GACTE,OAA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EAAW,CACpBa,UAAW,iBACXC,gBAAgB,OAGjB,EAAI,G","sources":["webpack://thebe/../../node_modules/@lezer/html/dist/index.js","webpack://thebe/../../node_modules/@codemirror/lang-html/dist/index.js"],"sourcesContent":["import { ContextTracker, ExternalTokenizer, LRParser } from '@lezer/lr';\nimport { styleTags, tags } from '@lezer/highlight';\nimport { parseMixed } from '@lezer/common';\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst scriptText = 54,\n StartCloseScriptTag = 1,\n styleText = 55,\n StartCloseStyleTag = 2,\n textareaText = 56,\n StartCloseTextareaTag = 3,\n EndTag = 4,\n SelfClosingEndTag = 5,\n StartTag = 6,\n StartScriptTag = 7,\n StartStyleTag = 8,\n StartTextareaTag = 9,\n StartSelfClosingTag = 10,\n StartCloseTag = 11,\n NoMatchStartCloseTag = 12,\n MismatchedStartCloseTag = 13,\n missingCloseTag = 57,\n IncompleteCloseTag = 14,\n commentContent$1 = 58,\n Element = 20,\n TagName = 22,\n Attribute = 23,\n AttributeName = 24,\n AttributeValue = 26,\n UnquotedAttributeValue = 27,\n ScriptText = 28,\n StyleText = 31,\n TextareaText = 34,\n OpenTag = 36,\n CloseTag = 37,\n Dialect_noMatch = 0,\n Dialect_selfClosing = 1;\n\n/* Hand-written tokenizers for HTML. */\n\nconst selfClosers = {\n area: true, base: true, br: true, col: true, command: true,\n embed: true, frame: true, hr: true, img: true, input: true,\n keygen: true, link: true, meta: true, param: true, source: true,\n track: true, wbr: true, menuitem: true\n};\n\nconst implicitlyClosed = {\n dd: true, li: true, optgroup: true, option: true, p: true,\n rp: true, rt: true, tbody: true, td: true, tfoot: true,\n th: true, tr: true\n};\n\nconst closeOnOpen = {\n dd: {dd: true, dt: true},\n dt: {dd: true, dt: true},\n li: {li: true},\n option: {option: true, optgroup: true},\n optgroup: {optgroup: true},\n p: {\n address: true, article: true, aside: true, blockquote: true, dir: true,\n div: true, dl: true, fieldset: true, footer: true, form: true,\n h1: true, h2: true, h3: true, h4: true, h5: true, h6: true,\n header: true, hgroup: true, hr: true, menu: true, nav: true, ol: true,\n p: true, pre: true, section: true, table: true, ul: true\n },\n rp: {rp: true, rt: true},\n rt: {rp: true, rt: true},\n tbody: {tbody: true, tfoot: true},\n td: {td: true, th: true},\n tfoot: {tbody: true},\n th: {td: true, th: true},\n thead: {tbody: true, tfoot: true},\n tr: {tr: true}\n};\n\nfunction nameChar(ch) {\n return ch == 45 || ch == 46 || ch == 58 || ch >= 65 && ch <= 90 || ch == 95 || ch >= 97 && ch <= 122 || ch >= 161\n}\n\nfunction isSpace(ch) {\n return ch == 9 || ch == 10 || ch == 13 || ch == 32\n}\n\nlet cachedName = null, cachedInput = null, cachedPos = 0;\nfunction tagNameAfter(input, offset) {\n let pos = input.pos + offset;\n if (cachedPos == pos && cachedInput == input) return cachedName\n let next = input.peek(offset);\n while (isSpace(next)) next = input.peek(++offset);\n let name = \"\";\n for (;;) {\n if (!nameChar(next)) break\n name += String.fromCharCode(next);\n next = input.peek(++offset);\n }\n // Undefined to signal there's a -1 ? new ElementContext(tagNameAfter(input, 1) || \"\", context) : context\n },\n reduce(context, term) {\n return term == Element && context ? context.parent : context\n },\n reuse(context, node, stack, input) {\n let type = node.type.id;\n return type == StartTag || type == OpenTag\n ? new ElementContext(tagNameAfter(input, 1) || \"\", context) : context\n },\n strict: false\n});\n\nconst tagStart = new ExternalTokenizer((input, stack) => {\n if (input.next != lessThan) {\n // End of file, close any open tags\n if (input.next < 0 && stack.context) input.acceptToken(missingCloseTag);\n return\n }\n input.advance();\n let close = input.next == slash;\n if (close) input.advance();\n let name = tagNameAfter(input, 0);\n if (name === undefined) return\n if (!name) return input.acceptToken(close ? IncompleteCloseTag : StartTag)\n\n let parent = stack.context ? stack.context.name : null;\n if (close) {\n if (name == parent) return input.acceptToken(StartCloseTag)\n if (parent && implicitlyClosed[parent]) return input.acceptToken(missingCloseTag, -2)\n if (stack.dialectEnabled(Dialect_noMatch)) return input.acceptToken(NoMatchStartCloseTag)\n for (let cx = stack.context; cx; cx = cx.parent) if (cx.name == name) return\n input.acceptToken(MismatchedStartCloseTag);\n } else {\n if (name == \"script\") return input.acceptToken(StartScriptTag)\n if (name == \"style\") return input.acceptToken(StartStyleTag)\n if (name == \"textarea\") return input.acceptToken(StartTextareaTag)\n if (selfClosers.hasOwnProperty(name)) return input.acceptToken(StartSelfClosingTag)\n if (parent && closeOnOpen[parent] && closeOnOpen[parent][name]) input.acceptToken(missingCloseTag, -1);\n else input.acceptToken(StartTag);\n }\n}, {contextual: true});\n\nconst commentContent = new ExternalTokenizer(input => {\n for (let dashes = 0, i = 0;; i++) {\n if (input.next < 0) {\n if (i) input.acceptToken(commentContent$1);\n break\n }\n if (input.next == dash) {\n dashes++;\n } else if (input.next == greaterThan && dashes >= 2) {\n if (i >= 3) input.acceptToken(commentContent$1, -2);\n break\n } else {\n dashes = 0;\n }\n input.advance();\n }\n});\n\nfunction inForeignElement(context) {\n for (; context; context = context.parent)\n if (context.name == \"svg\" || context.name == \"math\") return true\n return false\n}\n\nconst endTag = new ExternalTokenizer((input, stack) => {\n if (input.next == slash && input.peek(1) == greaterThan) {\n let selfClosing = stack.dialectEnabled(Dialect_selfClosing) || inForeignElement(stack.context);\n input.acceptToken(selfClosing ? SelfClosingEndTag : EndTag, 2);\n } else if (input.next == greaterThan) {\n input.acceptToken(EndTag, 1);\n }\n});\n\nfunction contentTokenizer(tag, textToken, endToken) {\n let lastState = 2 + tag.length;\n return new ExternalTokenizer(input => {\n // state means:\n // - 0 nothing matched\n // - 1 '<' matched\n // - 2 '= 2 && state < lastState && input.next == tag.charCodeAt(state - 2)) {\n state++;\n matchedLen++;\n } else if ((state == 2 || state == lastState) && isSpace(input.next)) {\n matchedLen++;\n } else if (state == lastState && input.next == greaterThan) {\n if (i > matchedLen)\n input.acceptToken(textToken, -matchedLen);\n else\n input.acceptToken(endToken, -(matchedLen - 2));\n break\n } else if ((input.next == 10 /* '\\n' */ || input.next == 13 /* '\\r' */) && i) {\n input.acceptToken(textToken, 1);\n break\n } else {\n state = matchedLen = 0;\n }\n input.advance();\n }\n })\n}\n\nconst scriptTokens = contentTokenizer(\"script\", scriptText, StartCloseScriptTag);\n\nconst styleTokens = contentTokenizer(\"style\", styleText, StartCloseStyleTag);\n\nconst textareaTokens = contentTokenizer(\"textarea\", textareaText, StartCloseTextareaTag);\n\nconst htmlHighlighting = styleTags({\n \"Text RawText\": tags.content,\n \"StartTag StartCloseTag SelfClosingEndTag EndTag\": tags.angleBracket,\n TagName: tags.tagName,\n \"MismatchedCloseTag/TagName\": [tags.tagName, tags.invalid],\n AttributeName: tags.attributeName,\n \"AttributeValue UnquotedAttributeValue\": tags.attributeValue,\n Is: tags.definitionOperator,\n \"EntityReference CharacterReference\": tags.character,\n Comment: tags.blockComment,\n ProcessingInst: tags.processingInstruction,\n DoctypeDecl: tags.documentMeta\n});\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst parser = LRParser.deserialize({\n version: 14,\n states: \",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1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OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~\",\n goto: \"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp\",\n nodeNames: \"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl\",\n maxTerm: 67,\n context: elementContext,\n nodeProps: [\n [\"closedBy\", -10,1,2,3,7,8,9,10,11,12,13,\"EndTag\",6,\"EndTag SelfClosingEndTag\",-4,21,30,33,36,\"CloseTag\"],\n [\"openedBy\", 4,\"StartTag StartCloseTag\",5,\"StartTag\",-4,29,32,35,37,\"OpenTag\"],\n [\"group\", -9,14,17,18,19,20,39,40,41,42,\"Entity\",16,\"Entity TextContent\",-3,28,31,34,\"TextContent Entity\"],\n [\"isolate\", -11,21,29,30,32,33,35,36,37,38,41,42,\"ltr\",-3,26,27,39,\"\"]\n ],\n propSources: [htmlHighlighting],\n skippedNodes: [0],\n repeatNodeCount: 9,\n tokenData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5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V! boolean,\n// parser: Parser\n// }[]\n// attributes?: {\n// name: string,\n// tagName?: string,\n// parser: Parser\n// }[]\n \nfunction configureNesting(tags = [], attributes = []) {\n let script = [], style = [], textarea = [], other = [];\n for (let tag of tags) {\n let array = tag.tag == \"script\" ? script : tag.tag == \"style\" ? style : tag.tag == \"textarea\" ? textarea : other;\n array.push(tag);\n }\n let attrs = attributes.length ? Object.create(null) : null;\n for (let attr of attributes) (attrs[attr.name] || (attrs[attr.name] = [])).push(attr);\n\n return parseMixed((node, input) => {\n let id = node.type.id;\n if (id == ScriptText) return maybeNest(node, input, script)\n if (id == StyleText) return maybeNest(node, input, style)\n if (id == TextareaText) return maybeNest(node, input, textarea)\n\n if (id == Element && other.length) {\n let n = node.node, open = n.firstChild, tagName = open && findTagName(open, input), attrs;\n if (tagName) for (let tag of other) {\n if (tag.tag == tagName && (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(open, input))))) {\n let close = n.lastChild;\n let to = close.type.id == CloseTag ? close.from : n.to;\n if (to > open.to)\n return {parser: tag.parser, overlay: [{from: open.to, to}]}\n }\n }\n }\n\n if (attrs && id == Attribute) {\n let n = node.node, nameNode;\n if (nameNode = n.firstChild) {\n let matches = attrs[input.read(nameNode.from, nameNode.to)];\n if (matches) for (let attr of matches) {\n if (attr.tagName && attr.tagName != findTagName(n.parent, input)) continue\n let value = n.lastChild;\n if (value.type.id == AttributeValue) {\n let from = value.from + 1;\n let last = value.lastChild, to = value.to - (last && last.isError ? 0 : 1);\n if (to > from) return {parser: attr.parser, overlay: [{from, to}]}\n } else if (value.type.id == UnquotedAttributeValue) {\n return {parser: attr.parser, overlay: [{from: value.from, to: value.to}]}\n }\n }\n }\n }\n return null\n })\n}\n\nexport { configureNesting, parser };\n","import { parser, configureNesting } from '@lezer/html';\nimport { cssLanguage, css } from '@codemirror/lang-css';\nimport { javascriptLanguage, typescriptLanguage, jsxLanguage, tsxLanguage, javascript } from '@codemirror/lang-javascript';\nimport { EditorView } from '@codemirror/view';\nimport { EditorSelection } from '@codemirror/state';\nimport { syntaxTree, LRLanguage, indentNodeProp, foldNodeProp, bracketMatchingHandle, LanguageSupport } from '@codemirror/language';\n\nconst Targets = [\"_blank\", \"_self\", \"_top\", \"_parent\"];\nconst Charsets = [\"ascii\", \"utf-8\", \"utf-16\", \"latin1\", \"latin1\"];\nconst Methods = [\"get\", \"post\", \"put\", \"delete\"];\nconst Encs = [\"application/x-www-form-urlencoded\", \"multipart/form-data\", \"text/plain\"];\nconst Bool = [\"true\", \"false\"];\nconst S = {}; // Empty tag spec\nconst Tags = {\n a: {\n attrs: {\n href: null, ping: null, type: null,\n media: null,\n target: Targets,\n hreflang: null\n }\n },\n abbr: S,\n address: S,\n area: {\n attrs: {\n alt: null, coords: null, href: null, target: null, ping: null,\n media: null, hreflang: null, type: null,\n shape: [\"default\", \"rect\", \"circle\", \"poly\"]\n }\n },\n article: S,\n aside: S,\n audio: {\n attrs: {\n src: null, mediagroup: null,\n crossorigin: [\"anonymous\", \"use-credentials\"],\n preload: [\"none\", \"metadata\", \"auto\"],\n autoplay: [\"autoplay\"],\n loop: [\"loop\"],\n controls: [\"controls\"]\n }\n },\n b: S,\n base: { attrs: { href: null, target: Targets } },\n bdi: S,\n bdo: S,\n blockquote: { attrs: { cite: null } },\n body: S,\n br: S,\n button: {\n attrs: {\n form: null, formaction: null, name: null, value: null,\n autofocus: [\"autofocus\"],\n disabled: [\"autofocus\"],\n formenctype: Encs,\n formmethod: Methods,\n formnovalidate: [\"novalidate\"],\n formtarget: Targets,\n type: [\"submit\", \"reset\", \"button\"]\n }\n },\n canvas: { attrs: { width: null, height: null } },\n caption: S,\n center: S,\n cite: S,\n code: S,\n col: { attrs: { span: null } },\n colgroup: { attrs: { span: null } },\n command: {\n attrs: {\n type: [\"command\", \"checkbox\", \"radio\"],\n label: null, icon: null, radiogroup: null, command: null, title: null,\n disabled: [\"disabled\"],\n checked: [\"checked\"]\n }\n },\n data: { attrs: { value: null } },\n datagrid: { attrs: { disabled: [\"disabled\"], multiple: [\"multiple\"] } },\n datalist: { attrs: { data: null } },\n dd: S,\n del: { attrs: { cite: null, datetime: null } },\n details: { attrs: { open: [\"open\"] } },\n dfn: S,\n div: S,\n dl: S,\n dt: S,\n em: S,\n embed: { attrs: { src: null, type: null, width: null, height: null } },\n eventsource: { attrs: { src: null } },\n fieldset: { attrs: { disabled: [\"disabled\"], form: null, name: null } },\n figcaption: S,\n figure: S,\n footer: S,\n form: {\n attrs: {\n action: null, name: null,\n \"accept-charset\": Charsets,\n autocomplete: [\"on\", \"off\"],\n enctype: Encs,\n method: Methods,\n novalidate: [\"novalidate\"],\n target: Targets\n }\n },\n h1: S, h2: S, h3: S, h4: S, h5: S, h6: S,\n head: {\n children: [\"title\", \"base\", \"link\", \"style\", \"meta\", \"script\", \"noscript\", \"command\"]\n },\n header: S,\n hgroup: S,\n hr: S,\n html: {\n attrs: { manifest: null }\n },\n i: S,\n iframe: {\n attrs: {\n src: null, srcdoc: null, name: null, width: null, height: null,\n sandbox: [\"allow-top-navigation\", \"allow-same-origin\", \"allow-forms\", \"allow-scripts\"],\n seamless: [\"seamless\"]\n }\n },\n img: {\n attrs: {\n alt: null, src: null, ismap: null, usemap: null, width: null, height: null,\n crossorigin: [\"anonymous\", \"use-credentials\"]\n }\n },\n input: {\n attrs: {\n alt: null, dirname: null, form: null, formaction: null,\n height: null, list: null, max: null, maxlength: null, min: null,\n name: null, pattern: null, placeholder: null, size: null, src: null,\n step: null, value: null, width: null,\n accept: [\"audio/*\", \"video/*\", \"image/*\"],\n autocomplete: [\"on\", \"off\"],\n autofocus: [\"autofocus\"],\n checked: [\"checked\"],\n disabled: [\"disabled\"],\n formenctype: Encs,\n formmethod: Methods,\n formnovalidate: [\"novalidate\"],\n formtarget: Targets,\n multiple: [\"multiple\"],\n readonly: [\"readonly\"],\n required: [\"required\"],\n type: [\"hidden\", \"text\", \"search\", \"tel\", \"url\", \"email\", \"password\", \"datetime\", \"date\", \"month\",\n \"week\", \"time\", \"datetime-local\", \"number\", \"range\", \"color\", \"checkbox\", \"radio\",\n \"file\", \"submit\", \"image\", \"reset\", \"button\"]\n }\n },\n ins: { attrs: { cite: null, datetime: null } },\n kbd: S,\n keygen: {\n attrs: {\n challenge: null, form: null, name: null,\n autofocus: [\"autofocus\"],\n disabled: [\"disabled\"],\n keytype: [\"RSA\"]\n }\n },\n label: { attrs: { for: null, form: null } },\n legend: S,\n li: { attrs: { value: null } },\n link: {\n attrs: {\n href: null, type: null,\n hreflang: null,\n media: null,\n sizes: [\"all\", \"16x16\", \"16x16 32x32\", \"16x16 32x32 64x64\"]\n }\n },\n map: { attrs: { name: null } },\n mark: S,\n menu: { attrs: { label: null, type: [\"list\", \"context\", \"toolbar\"] } },\n meta: {\n attrs: {\n content: null,\n charset: Charsets,\n name: [\"viewport\", \"application-name\", \"author\", \"description\", \"generator\", \"keywords\"],\n \"http-equiv\": [\"content-language\", \"content-type\", \"default-style\", \"refresh\"]\n }\n },\n meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } },\n nav: S,\n noscript: S,\n object: {\n attrs: {\n data: null, type: null, name: null, usemap: null, form: null, width: null, height: null,\n typemustmatch: [\"typemustmatch\"]\n }\n },\n ol: { attrs: { reversed: [\"reversed\"], start: null, type: [\"1\", \"a\", \"A\", \"i\", \"I\"] },\n children: [\"li\", \"script\", \"template\", \"ul\", \"ol\"] },\n optgroup: { attrs: { disabled: [\"disabled\"], label: null } },\n option: { attrs: { disabled: [\"disabled\"], label: null, selected: [\"selected\"], value: null } },\n output: { attrs: { for: null, form: null, name: null } },\n p: S,\n param: { attrs: { name: null, value: null } },\n pre: S,\n progress: { attrs: { value: null, max: null } },\n q: { attrs: { cite: null } },\n rp: S,\n rt: S,\n ruby: S,\n samp: S,\n script: {\n attrs: {\n type: [\"text/javascript\"],\n src: null,\n async: [\"async\"],\n defer: [\"defer\"],\n charset: Charsets\n }\n },\n section: S,\n select: {\n attrs: {\n form: null, name: null, size: null,\n autofocus: [\"autofocus\"],\n disabled: [\"disabled\"],\n multiple: [\"multiple\"]\n }\n },\n slot: { attrs: { name: null } },\n small: S,\n source: { attrs: { src: null, type: null, media: null } },\n span: S,\n strong: S,\n style: {\n attrs: {\n type: [\"text/css\"],\n media: null,\n scoped: null\n }\n },\n sub: S,\n summary: S,\n sup: S,\n table: S,\n tbody: S,\n td: { attrs: { colspan: null, rowspan: null, headers: null } },\n template: S,\n textarea: {\n attrs: {\n dirname: null, form: null, maxlength: null, name: null, placeholder: null,\n rows: null, cols: null,\n autofocus: [\"autofocus\"],\n disabled: [\"disabled\"],\n readonly: [\"readonly\"],\n required: [\"required\"],\n wrap: [\"soft\", \"hard\"]\n }\n },\n tfoot: S,\n th: { attrs: { colspan: null, rowspan: null, headers: null, scope: [\"row\", \"col\", \"rowgroup\", \"colgroup\"] } },\n thead: S,\n time: { attrs: { datetime: null } },\n title: S,\n tr: S,\n track: {\n attrs: {\n src: null, label: null, default: null,\n kind: [\"subtitles\", \"captions\", \"descriptions\", \"chapters\", \"metadata\"],\n srclang: null\n }\n },\n ul: { children: [\"li\", \"script\", \"template\", \"ul\", \"ol\"] },\n var: S,\n video: {\n attrs: {\n src: null, poster: null, width: null, height: null,\n crossorigin: [\"anonymous\", \"use-credentials\"],\n preload: [\"auto\", \"metadata\", \"none\"],\n autoplay: [\"autoplay\"],\n mediagroup: [\"movie\"],\n muted: [\"muted\"],\n controls: [\"controls\"]\n }\n },\n wbr: S\n};\nconst GlobalAttrs = {\n accesskey: null,\n class: null,\n contenteditable: Bool,\n contextmenu: null,\n dir: [\"ltr\", \"rtl\", \"auto\"],\n draggable: [\"true\", \"false\", \"auto\"],\n dropzone: [\"copy\", \"move\", \"link\", \"string:\", \"file:\"],\n hidden: [\"hidden\"],\n id: null,\n inert: [\"inert\"],\n itemid: null,\n itemprop: null,\n itemref: null,\n itemscope: [\"itemscope\"],\n itemtype: null,\n lang: [\"ar\", \"bn\", \"de\", \"en-GB\", \"en-US\", \"es\", \"fr\", \"hi\", \"id\", \"ja\", \"pa\", \"pt\", \"ru\", \"tr\", \"zh\"],\n spellcheck: Bool,\n autocorrect: Bool,\n autocapitalize: Bool,\n style: null,\n tabindex: null,\n title: null,\n translate: [\"yes\", \"no\"],\n rel: [\"stylesheet\", \"alternate\", \"author\", \"bookmark\", \"help\", \"license\", \"next\", \"nofollow\", \"noreferrer\", \"prefetch\", \"prev\", \"search\", \"tag\"],\n role: /*@__PURE__*/\"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer\".split(\" \"),\n \"aria-activedescendant\": null,\n \"aria-atomic\": Bool,\n \"aria-autocomplete\": [\"inline\", \"list\", \"both\", \"none\"],\n \"aria-busy\": Bool,\n \"aria-checked\": [\"true\", \"false\", \"mixed\", \"undefined\"],\n \"aria-controls\": null,\n \"aria-describedby\": null,\n \"aria-disabled\": Bool,\n \"aria-dropeffect\": null,\n \"aria-expanded\": [\"true\", \"false\", \"undefined\"],\n \"aria-flowto\": null,\n \"aria-grabbed\": [\"true\", \"false\", \"undefined\"],\n \"aria-haspopup\": Bool,\n \"aria-hidden\": Bool,\n \"aria-invalid\": [\"true\", \"false\", \"grammar\", \"spelling\"],\n \"aria-label\": null,\n \"aria-labelledby\": null,\n \"aria-level\": null,\n \"aria-live\": [\"off\", \"polite\", \"assertive\"],\n \"aria-multiline\": Bool,\n \"aria-multiselectable\": Bool,\n \"aria-owns\": null,\n \"aria-posinset\": null,\n \"aria-pressed\": [\"true\", \"false\", \"mixed\", \"undefined\"],\n \"aria-readonly\": Bool,\n \"aria-relevant\": null,\n \"aria-required\": Bool,\n \"aria-selected\": [\"true\", \"false\", \"undefined\"],\n \"aria-setsize\": null,\n \"aria-sort\": [\"ascending\", \"descending\", \"none\", \"other\"],\n \"aria-valuemax\": null,\n \"aria-valuemin\": null,\n \"aria-valuenow\": null,\n \"aria-valuetext\": null\n};\nconst eventAttributes = /*@__PURE__*/(\"beforeunload copy cut dragstart dragover dragleave dragenter dragend \" +\n \"drag paste focus blur change click load mousedown mouseenter mouseleave \" +\n \"mouseup keydown keyup resize scroll unload\").split(\" \").map(n => \"on\" + n);\nfor (let a of eventAttributes)\n GlobalAttrs[a] = null;\nclass Schema {\n constructor(extraTags, extraAttrs) {\n this.tags = Object.assign(Object.assign({}, Tags), extraTags);\n this.globalAttrs = Object.assign(Object.assign({}, GlobalAttrs), extraAttrs);\n this.allTags = Object.keys(this.tags);\n this.globalAttrNames = Object.keys(this.globalAttrs);\n }\n}\nSchema.default = /*@__PURE__*/new Schema;\nfunction elementName(doc, tree, max = doc.length) {\n if (!tree)\n return \"\";\n let tag = tree.firstChild;\n let name = tag && tag.getChild(\"TagName\");\n return name ? doc.sliceString(name.from, Math.min(name.to, max)) : \"\";\n}\nfunction findParentElement(tree, skip = false) {\n for (; tree; tree = tree.parent)\n if (tree.name == \"Element\") {\n if (skip)\n skip = false;\n else\n return tree;\n }\n return null;\n}\nfunction allowedChildren(doc, tree, schema) {\n let parentInfo = schema.tags[elementName(doc, findParentElement(tree))];\n return (parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.children) || schema.allTags;\n}\nfunction openTags(doc, tree) {\n let open = [];\n for (let parent = findParentElement(tree); parent && !parent.type.isTop; parent = findParentElement(parent.parent)) {\n let tagName = elementName(doc, parent);\n if (tagName && parent.lastChild.name == \"CloseTag\")\n break;\n if (tagName && open.indexOf(tagName) < 0 && (tree.name == \"EndTag\" || tree.from >= parent.firstChild.to))\n open.push(tagName);\n }\n return open;\n}\nconst identifier = /^[:\\-\\.\\w\\u00b7-\\uffff]*$/;\nfunction completeTag(state, schema, tree, from, to) {\n let end = /\\s*>/.test(state.sliceDoc(to, to + 5)) ? \"\" : \">\";\n let parent = findParentElement(tree, true);\n return { from, to,\n options: allowedChildren(state.doc, parent, schema).map(tagName => ({ label: tagName, type: \"type\" })).concat(openTags(state.doc, tree).map((tag, i) => ({ label: \"/\" + tag, apply: \"/\" + tag + end,\n type: \"type\", boost: 99 - i }))),\n validFor: /^\\/?[:\\-\\.\\w\\u00b7-\\uffff]*$/ };\n}\nfunction completeCloseTag(state, tree, from, to) {\n let end = /\\s*>/.test(state.sliceDoc(to, to + 5)) ? \"\" : \">\";\n return { from, to,\n options: openTags(state.doc, tree).map((tag, i) => ({ label: tag, apply: tag + end, type: \"type\", boost: 99 - i })),\n validFor: identifier };\n}\nfunction completeStartTag(state, schema, tree, pos) {\n let options = [], level = 0;\n for (let tagName of allowedChildren(state.doc, tree, schema))\n options.push({ label: \"<\" + tagName, type: \"type\" });\n for (let open of openTags(state.doc, tree))\n options.push({ label: \"\", type: \"type\", boost: 99 - level++ });\n return { from: pos, to: pos, options, validFor: /^<\\/?[:\\-\\.\\w\\u00b7-\\uffff]*$/ };\n}\nfunction completeAttrName(state, schema, tree, from, to) {\n let elt = findParentElement(tree), info = elt ? schema.tags[elementName(state.doc, elt)] : null;\n let localAttrs = info && info.attrs ? Object.keys(info.attrs) : [];\n let names = info && info.globalAttrs === false ? localAttrs\n : localAttrs.length ? localAttrs.concat(schema.globalAttrNames) : schema.globalAttrNames;\n return { from, to,\n options: names.map(attrName => ({ label: attrName, type: \"property\" })),\n validFor: identifier };\n}\nfunction completeAttrValue(state, schema, tree, from, to) {\n var _a;\n let nameNode = (_a = tree.parent) === null || _a === void 0 ? void 0 : _a.getChild(\"AttributeName\");\n let options = [], token = undefined;\n if (nameNode) {\n let attrName = state.sliceDoc(nameNode.from, nameNode.to);\n let attrs = schema.globalAttrs[attrName];\n if (!attrs) {\n let elt = findParentElement(tree), info = elt ? schema.tags[elementName(state.doc, elt)] : null;\n attrs = (info === null || info === void 0 ? void 0 : info.attrs) && info.attrs[attrName];\n }\n if (attrs) {\n let base = state.sliceDoc(from, to).toLowerCase(), quoteStart = '\"', quoteEnd = '\"';\n if (/^['\"]/.test(base)) {\n token = base[0] == '\"' ? /^[^\"]*$/ : /^[^']*$/;\n quoteStart = \"\";\n quoteEnd = state.sliceDoc(to, to + 1) == base[0] ? \"\" : base[0];\n base = base.slice(1);\n from++;\n }\n else {\n token = /^[^\\s<>='\"]*$/;\n }\n for (let value of attrs)\n options.push({ label: value, apply: quoteStart + value + quoteEnd, type: \"constant\" });\n }\n }\n return { from, to, options, validFor: token };\n}\nfunction htmlCompletionFor(schema, context) {\n let { state, pos } = context, tree = syntaxTree(state).resolveInner(pos, -1), around = tree.resolve(pos);\n for (let scan = pos, before; around == tree && (before = tree.childBefore(scan));) {\n let last = before.lastChild;\n if (!last || !last.type.isError || last.from < last.to)\n break;\n around = tree = before;\n scan = last.from;\n }\n if (tree.name == \"TagName\") {\n return tree.parent && /CloseTag$/.test(tree.parent.name) ? completeCloseTag(state, tree, tree.from, pos)\n : completeTag(state, schema, tree, tree.from, pos);\n }\n else if (tree.name == \"StartTag\") {\n return completeTag(state, schema, tree, pos, pos);\n }\n else if (tree.name == \"StartCloseTag\" || tree.name == \"IncompleteCloseTag\") {\n return completeCloseTag(state, tree, pos, pos);\n }\n else if (tree.name == \"OpenTag\" || tree.name == \"SelfClosingTag\" || tree.name == \"AttributeName\") {\n return completeAttrName(state, schema, tree, tree.name == \"AttributeName\" ? tree.from : pos, pos);\n }\n else if (tree.name == \"Is\" || tree.name == \"AttributeValue\" || tree.name == \"UnquotedAttributeValue\") {\n return completeAttrValue(state, schema, tree, tree.name == \"Is\" ? pos : tree.from, pos);\n }\n else if (context.explicit && (around.name == \"Element\" || around.name == \"Text\" || around.name == \"Document\")) {\n return completeStartTag(state, schema, tree, pos);\n }\n else {\n return null;\n }\n}\n/**\nHTML tag completion. Opens and closes tags and attributes in a\ncontext-aware way.\n*/\nfunction htmlCompletionSource(context) {\n return htmlCompletionFor(Schema.default, context);\n}\n/**\nCreate a completion source for HTML extended with additional tags\nor attributes.\n*/\nfunction htmlCompletionSourceWith(config) {\n let { extraTags, extraGlobalAttributes: extraAttrs } = config;\n let schema = extraAttrs || extraTags ? new Schema(extraTags, extraAttrs) : Schema.default;\n return (context) => htmlCompletionFor(schema, context);\n}\n\nconst jsonParser = /*@__PURE__*/javascriptLanguage.parser.configure({ top: \"SingleExpression\" });\nconst defaultNesting = [\n { tag: \"script\",\n attrs: attrs => attrs.type == \"text/typescript\" || attrs.lang == \"ts\",\n parser: typescriptLanguage.parser },\n { tag: \"script\",\n attrs: attrs => attrs.type == \"text/babel\" || attrs.type == \"text/jsx\",\n parser: jsxLanguage.parser },\n { tag: \"script\",\n attrs: attrs => attrs.type == \"text/typescript-jsx\",\n parser: tsxLanguage.parser },\n { tag: \"script\",\n attrs(attrs) {\n return /^(importmap|speculationrules|application\\/(.+\\+)?json)$/i.test(attrs.type);\n },\n parser: jsonParser },\n { tag: \"script\",\n attrs(attrs) {\n return !attrs.type || /^(?:text|application)\\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(attrs.type);\n },\n parser: javascriptLanguage.parser },\n { tag: \"style\",\n attrs(attrs) {\n return (!attrs.lang || attrs.lang == \"css\") && (!attrs.type || /^(text\\/)?(x-)?(stylesheet|css)$/i.test(attrs.type));\n },\n parser: cssLanguage.parser }\n];\nconst defaultAttrs = /*@__PURE__*/[\n { name: \"style\",\n parser: /*@__PURE__*/cssLanguage.parser.configure({ top: \"Styles\" }) }\n].concat(/*@__PURE__*/eventAttributes.map(name => ({ name, parser: javascriptLanguage.parser })));\n/**\nA language provider based on the [Lezer HTML\nparser](https://github.com/lezer-parser/html), extended with the\nJavaScript and CSS parsers to parse the content of ` + + + + + + + +
+

Simple plots using mybinder.org

+

+ Activating this page will connect to the public my binder service at + https://mybinder.org, launch a server and connect to a `python3` kernel. +

+
+
+
+import numpy as np
+import matplotlib.pyplot as plt
+%matplotlib inline
+
+fig, ax = plt.subplots()
+ax.scatter(*np.random.randn(2, 100), c=np.random.randn(100))
+ax.set(title="Wow, a python plot on my webpage!")
+    
+
+ + diff --git a/pr-preview/pr-770/index.html b/pr-preview/pr-770/index.html new file mode 100644 index 00000000..322d122e --- /dev/null +++ b/pr-preview/pr-770/index.html @@ -0,0 +1,266 @@ + + + + Simple Thebe Demos + + + + + + + + + + + + + + + + +
+
+

Simple Demos

+
+

+ This is designed to take a simple static html website (like this one) and turn any code it + finds into interactive editors. This page is intended to be a demo of that functionality + so is more descriptive and uses + jupyterlite. +

+

+ For additional, very static and more specific, html examples, see the table + at the bottom of the page. +

+
+
+

Configuration

+

+ thebe can be configured by adding a script tag to your web page with an + options object, that will be loaded by the `bootstrap` function. +

+

+ By default this demo used the pyodide WASM kernel with + jupyterlite but you can also configure it to use + a local jupyter server or the + mybinder.org service. +

+

Configuration for jupyterlite is simply:

+
+<‍script type="text/x-thebe-config">
+  {
+    useBinder: false,
+    useJupyterLite: true,
+    mountActivateWidget: true,
+    mountStatusWidget: true,
+  }
+<‍/script>
+
+

Thebe's Default UI

+

+ By adding the following tags to the page, once loaded, thebe will add default + UI elements to the page (these are customisable by css). +

+
+  <‍div class="thebe-activate"><‍/div>
+  <‍div class="thebe-status"><‍/div>
+

These should appear below 👇

+
+
+
+
+

+ The following code snippet has been marked as + <‍pre data-executable="true" data-language="python"><‍/pre> meaning + thebe will turn it into an editor when activated! +

+

+ Note: this is quite a lot of code, thanks because it's producing the excellent Lorentz + Attractor plot - taken from the + ipywidgets documentation. +

+
+
+%pip install ipywidgets
+
+import numpy as np
+import matplotlib.pyplot as plt
+%matplotlib inline
+
+from ipywidgets import interact, interactive
+from IPython.display import clear_output, display, HTML
+
+import numpy as np
+from scipy import integrate
+
+from matplotlib import pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+from matplotlib.colors import cnames
+from matplotlib import animation
+
+def solve_lorenz(
+  N=10, angle=0.0, max_time=4.0, 
+  sigma=10.0, beta=8./3, rho=28.0):
+
+    fig = plt.figure()
+    ax = fig.add_axes([0, 0, 1, 1], projection='3d')
+    ax.axis('off')
+
+    # prepare the axes limits
+    ax.set_xlim((-25, 25))
+    ax.set_ylim((-35, 35))
+    ax.set_zlim((5, 55))
+    
+    def lorenz_deriv(x_y_z, t0, sigma=sigma, beta=beta, rho=rho):
+        """Compute the time-derivative of a Lorenz system."""
+        x, y, z = x_y_z
+        return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]
+
+    # Choose random starting points, uniformly distributed from -15 to 15
+    np.random.seed(1)
+    x0 = -15 + 30 * np.random.random((N, 3))
+
+    # Solve for the trajectories
+    t = np.linspace(0, max_time, int(250*max_time))
+    x_t = np.asarray([integrate.odeint(lorenz_deriv, x0i, t)
+                      for x0i in x0])
+    
+    # choose a different color for each trajectory
+    colors = plt.cm.viridis(np.linspace(0, 1, N))
+
+    for i in range(N):
+        x, y, z = x_t[i,:,:].T
+        lines = ax.plot(x, y, z, '-', c=colors[i])
+        plt.setp(lines, linewidth=2)
+
+    ax.view_init(30, angle)
+    plt.show()
+
+    return t, x_t
+
+w = interactive(solve_lorenz, angle=(0.,360.), max_time=(0.1, 4.0), 
+                N=(0,50), sigma=(0.0,50.0), rho=(0.0,50.0))
+display(w)
+
+
+
+

Other static examples

+

+ Follow the links in the table to check out minimal examples of thebe in + different configurations, in each case "view source" to see how each is configured. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
demodescription
Running on a local jupyter server + simple plots +
ipywidgets examples
math rendering
Using JupyterLite with the pyodide kernelsimple plots
ipywidget examples
Running on mybinder.orgsimple Plots
ipywidgets examples
+
+
+

Running a local jupyter server

+

+ Some of the demos require you to run a jupyter server on your machine, which is pretty + easy if you are a regular jupyter user. +

+

+ If needed, setup a new virtual environment using the + requirements.txt file here. +

+
+python -m venv thebe-env
+source thebe-env/bin/activate
+python -m pip install -r requirements.txt
+python -m pip install jupyterlab
+

Then start a jupyter server using the command:

+
+jupyter lab --NotebookApp.token=test-secret --NotebookApp.allow_origin='*'
+
+
+ + diff --git a/pr-preview/pr-770/index.js b/pr-preview/pr-770/index.js new file mode 100644 index 00000000..86f810c4 --- /dev/null +++ b/pr-preview/pr-770/index.js @@ -0,0 +1,3 @@ +/*! For license information please see index.js.LICENSE.txt */ +(()=>{var __webpack_modules__={7998:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BROKEN_FILE_SVG_ICON:()=>m,DOMWidgetModel:()=>j,DOMWidgetView:()=>N,ErrorWidgetView:()=>K,IJupyterWidgetRegistry:()=>V,JUPYTER_WIDGETS_VERSION:()=>D,JupyterLuminoPanelWidget:()=>R,JupyterLuminoWidget:()=>I,JupyterPhosphorPanelWidget:()=>L,JupyterPhosphorWidget:()=>P,LayoutModel:()=>z,LayoutView:()=>U,PROTOCOL_VERSION:()=>S,StyleModel:()=>H,StyleView:()=>W,ViewList:()=>$,WidgetModel:()=>M,WidgetView:()=>O,assign:()=>l,createErrorWidgetModel:()=>G,createErrorWidgetView:()=>Y,difference:()=>o,isEqual:()=>a,isObject:()=>f,isSerializable:()=>p,pack_models:()=>k,put_buffers:()=>h,reject:()=>c,remove_buffers:()=>g,resolvePromisesDict:()=>d,shims:()=>q,unpack_models:()=>B,uuid:()=>u});var i=n(5764),r=n(6343),s=n.n(r);function o(e,t){return e.filter((e=>-1===t.indexOf(e)))}function a(e,t){return s()(e,t)}const l=Object.assign||function(e,...t){for(let n=1;n{const n={};for(let i=0;i=0&&t.item(n)!==this;);return n>-1};class E extends b.View{_removeElement(){this.undelegateEvents(),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}_setElement(e){this.el=e}_setAttributes(e){for(const t in e)t in this.el?this.el[t]=e[t]:this.el.setAttribute(t,e[t])}delegate(e,t,n){"string"!=typeof t&&(n=t,t=null),void 0===this._domEvents&&(this._domEvents=[]);const i=this.el,r=t?function(e){let r=e.target||e.srcElement;for(;r&&r!==i;r=r.parentNode)if(_.call(r,t))return e.delegateTarget=r,n.handleEvent?n.handleEvent(e):n(e)}:n;return this.el.addEventListener(e,r,!1),this._domEvents.push({eventName:e,handler:r,listener:n,selector:t}),r}undelegate(e,t,n){if("function"==typeof t&&(n=t,t=null),this.el&&this._domEvents){const i=this._domEvents.slice();let r=i.length;for(;r--;){const s=i[r];!(s.eventName!==e||n&&s.listener!==n||t&&s.selector!==t)&&(this.el.removeEventListener(s.eventName,s.handler,!1),this._domEvents.splice(r,1))}}return this}undelegateEvents(){if(this.el&&this._domEvents){const e=this._domEvents.length;for(let t=0;tthis.views[e].then((e=>e.remove()))));return delete this.views,Promise.all(e).then((()=>{}))}return Promise.resolve()}_handle_comm_closed(e){this.trigger("comm:close"),this.close(!0)}_handle_comm_msg(e){const t=e.content.data,n=t.method;switch(n){case"update":case"echo_update":return this.state_change=this.state_change.then((()=>{var i,r,s;const o=t.state,a=null!==(i=t.buffer_paths)&&void 0!==i?i:[],l=null!==(s=null===(r=e.buffers)||void 0===r?void 0:r.slice(0,a.length))&&void 0!==s?s:[];if(h(o,a,l),e.parent_header&&"echo_update"===n){const t=e.parent_header.msg_id;Object.keys(o).filter((e=>this._expectedEchoMsgIds.has(e))).forEach((e=>{this._expectedEchoMsgIds.get(e)!==t?delete o[e]:(this._expectedEchoMsgIds.delete(e),null!==this._msg_buffer&&Object.prototype.hasOwnProperty.call(this._msg_buffer,e)&&delete o[e])}))}return this.constructor._deserialize_state(o,this.widget_manager)})).then((e=>{this.set_state(e)})).catch(c(`Could not process update msg for model id: ${this.model_id}`,!0)),this.state_change;case"custom":return this.trigger("msg:custom",t.content,e.buffers),Promise.resolve()}return Promise.resolve()}set_state(e){this._state_lock=e;try{this.set(e)}catch(e){console.error(`Error setting state: ${e instanceof Error?e.message:e}`)}finally{this._state_lock=null}}get_state(e){const t=this.attributes;if(e){const e=this.defaults,n="function"==typeof e?e.call(this):e,i={};return Object.keys(t).forEach((e=>{a(t[e],n[e])||(i[e]=t[e])})),i}return Object.assign({},t)}_handle_status(e){if(void 0!==this.comm&&"idle"===e.content.execution_state&&(this._pending_msgs--,this._pending_msgs<0&&(console.error(`Jupyter Widgets message throttle: Pending messages < 0 (=${this._pending_msgs}), which is unexpected. Resetting to 0 to continue.`),this._pending_msgs=0),null!==this._msg_buffer&&this._pending_msgs<1)){const e=this.send_sync_message(this._msg_buffer,this._msg_buffer_callbacks);this.rememberLastUpdateFor(e),this._msg_buffer=null,this._msg_buffer_callbacks=null}}callbacks(e){return this.widget_manager.callbacks(e)}set(e,t,n){const i=v.call(this,e,t,n);if(void 0!==this._buffered_state_diff){const e=this.changedAttributes()||{};if(this._state_lock)for(const t of Object.keys(this._state_lock))e[t]===this._state_lock[t]&&delete e[t];if(this._buffered_state_diff_synced)for(const t of Object.keys(this._buffered_state_diff_synced))e[t]===this._buffered_state_diff_synced[t]&&delete e[t];this._buffered_state_diff=l(this._buffered_state_diff,e)}return!1===this._changing&&(this._buffered_state_diff_synced={}),i}sync(e,t,n={}){if(void 0===this.comm)throw"Syncing error: no comm channel defined";const i="patch"===e?n.attrs:t.get_state(n.drop_defaults);if(this._state_lock)for(const e of Object.keys(this._state_lock))i[e]===this._state_lock[e]&&delete i[e];Object.keys(i).forEach((e=>{this._attrsToUpdate.add(e)}));const r=this.serialize(i);if(Object.keys(r).length>0){const t=n.callbacks||this.callbacks();if(this._pending_msgs>=1){switch(e){case"patch":this._msg_buffer=l(this._msg_buffer||{},r);break;case"update":case"create":this._msg_buffer=r;break;default:throw"unrecognized syncing method"}this._msg_buffer_callbacks=t}else{const e=this.send_sync_message(i,t);this.rememberLastUpdateFor(e)}}}rememberLastUpdateFor(e){this._attrsToUpdate.forEach((t=>{this._expectedEchoMsgIds.set(t,e)})),this._attrsToUpdate=new Set}serialize(e){const t=this.constructor.serializers||i.JSONExt.emptyObject;for(const n of Object.keys(e))try{t[n]&&t[n].serialize?e[n]=t[n].serialize(e[n],this):e[n]=JSON.parse(JSON.stringify(e[n])),e[n]&&e[n].toJSON&&(e[n]=e[n].toJSON())}catch(e){throw console.error("Error serializing widget state attribute: ",n),e}return e}send_sync_message(e,t={}){if(!this.comm)return"";try{const n=(t={shell:Object.assign({},t.shell),iopub:Object.assign({},t.iopub),input:t.input}).iopub.status;t.iopub.status=e=>{this._handle_status(e),n&&n(e)};const i=g(e),r=this.comm.send({method:"update",state:i.state,buffer_paths:i.buffer_paths},t,{},i.buffers);return this._pending_msgs++,r}catch(e){console.error("Could not send widget sync message",e)}return""}save_changes(e){if(this.comm_live){const t={patch:!0};e&&(t.callbacks=e),this.save(this._buffered_state_diff,t),this._changing&&l(this._buffered_state_diff_synced,this._buffered_state_diff),this._buffered_state_diff={}}}on_some_change(e,t,n){this.on("change",((...i)=>{e.some(this.hasChanged,this)&&t.apply(n,i)}),this)}toJSON(e){return`IPY_MODEL_${this.model_id}`}static _deserialize_state(e,t){const n=this.serializers;let i;if(n){i={};for(const r in e)n[r]&&n[r].deserialize?i[r]=n[r].deserialize(e[r],t):i[r]=e[r]}else i=e;return d(i)}}class j extends M{defaults(){return l(super.defaults(),{_dom_classes:[],tabbable:null,tooltip:null})}}j.serializers=Object.assign(Object.assign({},M.serializers),{layout:{deserialize:B},style:{deserialize:B}});class O extends E{constructor(e){super(e)}initialize(e){this.listenTo(this.model,"change",((e,t)=>{const n=Object.keys(this.model.changedAttributes()||{});"_view_count"===n[0]&&1===n.length||this.update(t)})),this.options=e.options,this.once("remove",(()=>{"number"==typeof this.model.get("_view_count")&&(this.model.set("_view_count",this.model.get("_view_count")-1),this.model.save_changes())})),this.once("displayed",(()=>{"number"==typeof this.model.get("_view_count")&&(this.model.set("_view_count",this.model.get("_view_count")+1),this.model.save_changes())})),this.displayed=new Promise(((e,t)=>{this.once("displayed",e),this.model.on("msg:custom",this.handle_message.bind(this))}))}handle_message(e){"focus"===e.do?this.el.focus():"blur"===e.do&&this.el.blur()}update(e){}render(){}create_child_view(e,t={}){return t=Object.assign({parent:this},t),this.model.widget_manager.create_view(e,t).catch(c("Could not create child view",!0))}callbacks(){return this.model.callbacks(this)}send(e,t){this.model.send(e,this.callbacks(),t)}touch(){this.model.save_changes(this.callbacks())}remove(){return super.remove(),this.trigger("remove"),this}}class I extends x.x0{constructor(e){const t=e.view;delete e.view,super(e),this._view=t}dispose(){this.isDisposed||(super.dispose(),this._view.remove(),this._view=null)}processMessage(e){super.processMessage(e),this._view.processLuminoMessage(e)}}const P=I;class R extends x.Zk{constructor(e){const t=e.view;delete e.view,super(e),this._view=t}processMessage(e){super.processMessage(e),this._view.processLuminoMessage(e)}dispose(){var e;this.isDisposed||(super.dispose(),null===(e=this._view)||void 0===e||e.remove(),this._view=null)}}const L=R;class N extends O{initialize(e){super.initialize(e),this.listenTo(this.model,"change:_dom_classes",((e,t)=>{const n=e.previous("_dom_classes");this.update_classes(n,t)})),this.layoutPromise=Promise.resolve(),this.listenTo(this.model,"change:layout",((e,t)=>{this.setLayout(t,e.previous("layout"))})),this.stylePromise=Promise.resolve(),this.listenTo(this.model,"change:style",((e,t)=>{this.setStyle(t,e.previous("style"))})),this.displayed.then((()=>{this.update_classes([],this.model.get("_dom_classes")),this.setLayout(this.model.get("layout")),this.setStyle(this.model.get("style"))})),this._comm_live_update(),this.listenTo(this.model,"comm_live_update",(()=>{this._comm_live_update()})),this.listenTo(this.model,"change:tooltip",this.updateTooltip),this.updateTooltip()}setLayout(e,t){e&&(this.layoutPromise=this.layoutPromise.then((t=>(t&&(t.unlayout(),this.stopListening(t.model),t.remove()),this.create_child_view(e).then((e=>this.displayed.then((()=>(e.trigger("displayed"),this.listenTo(e.model,"change",(()=>{C.Mu.postMessage(this.luminoWidget,x.x0.ResizeMessage.UnknownSize)})),C.Mu.postMessage(this.luminoWidget,x.x0.ResizeMessage.UnknownSize),this.trigger("layout-changed"),e))))).catch(c("Could not add LayoutView to DOMWidgetView",!0))))))}setStyle(e,t){e&&(this.stylePromise=this.stylePromise.then((t=>(t&&(t.unstyle(),this.stopListening(t.model),t.remove()),this.create_child_view(e).then((e=>this.displayed.then((()=>(e.trigger("displayed"),this.trigger("style-changed"),e))))).catch(c("Could not add styleView to DOMWidgetView",!0))))))}updateTooltip(){const e=this.model.get("tooltip");e?0===this.model.get("description").length&&this.el.setAttribute("title",e):this.el.removeAttribute("title")}update_classes(e,t,n){void 0===n&&(n=this.el),o(e,t).map((function(e){n.classList?n.classList.remove(e):n.setAttribute("class",n.getAttribute("class").replace(e,""))})),o(t,e).map((function(e){n.classList?n.classList.add(e):n.setAttribute("class",n.getAttribute("class").concat(" ",e))}))}update_mapped_classes(e,t,n){let i=this.model.previous(t);const r=e[i]?e[i]:[];i=this.model.get(t);const s=e[i]?e[i]:[];this.update_classes(r,s,n||this.el)}set_mapped_classes(e,t,n){const i=this.model.get(t),r=e[i]?e[i]:[];this.update_classes([],r,n||this.el)}_setElement(e){this.luminoWidget&&this.luminoWidget.dispose(),this.$el=e instanceof y()?e:y()(e),this.el=this.$el[0],this.luminoWidget=new I({node:e,view:this})}remove(){return this.luminoWidget&&this.luminoWidget.dispose(),super.remove()}processLuminoMessage(e){switch(e.type){case"after-attach":this.trigger("displayed");break;case"show":this.trigger("shown")}}_comm_live_update(){this.model.comm_live?this.luminoWidget.removeClass("jupyter-widgets-disconnected"):this.luminoWidget.addClass("jupyter-widgets-disconnected")}updateTabindex(){const e=this.model.get("tabbable");!0===e?this.el.setAttribute("tabIndex","0"):!1===e?this.el.setAttribute("tabIndex","-1"):null===e&&this.el.removeAttribute("tabIndex")}get pWidget(){return this.luminoWidget}set pWidget(e){this.luminoWidget=e}}const F={align_content:null,align_items:null,align_self:null,border_top:null,border_right:null,border_bottom:null,border_left:null,bottom:null,display:null,flex:null,flex_flow:null,height:null,justify_content:null,justify_items:null,left:null,margin:null,max_height:null,max_width:null,min_height:null,min_width:null,overflow:null,order:null,padding:null,right:null,top:null,visibility:null,width:null,object_fit:null,object_position:null,grid_auto_columns:null,grid_auto_flow:null,grid_auto_rows:null,grid_gap:null,grid_template_rows:null,grid_template_columns:null,grid_template_areas:null,grid_row:null,grid_column:null,grid_area:null};class z extends M{defaults(){return l(super.defaults(),{_model_name:"LayoutModel",_view_name:"LayoutView"},F)}}class U extends O{initialize(e){this._traitNames=[],super.initialize(e);for(const e of Object.keys(F))this.registerTrait(e)}registerTrait(e){this._traitNames.push(e),this.listenTo(this.model,"change:"+e,((t,n)=>{this.handleChange(e,n)})),this.handleChange(e,this.model.get(e))}css_name(e){return e.replace(/_/g,"-")}handleChange(e,t){const n=this.options.parent;n?null===t?n.el.style.removeProperty(this.css_name(e)):n.el.style.setProperty(this.css_name(e),t):console.warn("Style not applied because a parent view does not exist")}unlayout(){const e=this.options.parent;this._traitNames.forEach((t=>{e?e.el.style.removeProperty(this.css_name(t)):console.warn("Style not removed because a parent view does not exist")}),this)}}class H extends M{defaults(){const e=this.constructor;return l(super.defaults(),{_model_name:"StyleModel",_view_name:"StyleView"},Object.keys(e.styleProperties).reduce(((t,n)=>(t[n]=e.styleProperties[n].default,t)),{}))}}H.styleProperties={};class W extends O{initialize(e){this._traitNames=[],super.initialize(e);const t=this.model.constructor;for(const e of Object.keys(t.styleProperties))this.registerTrait(e);this.style()}registerTrait(e){this._traitNames.push(e),this.listenTo(this.model,"change:"+e,((t,n)=>{this.handleChange(e,n)}))}handleChange(e,t){const n=this.options.parent;if(n){const i=this.model.constructor.styleProperties,r=i[e].attribute,s=i[e].selector,o=s?n.el.querySelectorAll(s):[n.el];if(null===t)for(let e=0;e!==o.length;++e)o[e].style.removeProperty(r);else for(let e=0;e!==o.length;++e)o[e].style.setProperty(r,t)}else console.warn("Style not applied because a parent view does not exist")}style(){for(const e of this._traitNames)this.handleChange(e,this.model.get(e))}unstyle(){const e=this.options.parent,t=this.model.constructor.styleProperties;this._traitNames.forEach((n=>{if(e){const i=t[n].attribute,r=t[n].selector,s=r?e.el.querySelectorAll(r):[e.el];for(let e=0;e!==s.length;++e)s[e].style.removeProperty(i)}else console.warn("Style not removed because a parent view does not exist")}),this)}}var q;!function(e){let t;!function(e){e.CommManager=class{constructor(e){this.targets=Object.create(null),this.comms=Object.create(null),this.init_kernel(e)}init_kernel(e){this.kernel=e,this.jsServicesKernel=e}async new_comm(e,n,i,r,s,o){const a=this.jsServicesKernel.createComm(e,s),l=new t(a);return this.register_comm(l),l.open(n,i,r,o),l}register_target(e,n){const i=this.jsServicesKernel.registerCommTarget(e,((e,i)=>{const r=new t(e);this.register_comm(r);try{return n(r,i)}catch(e){r.close(),console.error(e),console.error(new Error("Exception opening new comm"))}}));this.targets[e]=i}unregister_target(e,t){this.targets[e].dispose(),delete this.targets[e]}register_comm(e){return this.comms[e.comm_id]=Promise.resolve(e),e.kernel=this.kernel,e.comm_id}};class t{constructor(e){this.jsServicesComm=e}get comm_id(){return this.jsServicesComm.commId}get target_name(){return this.jsServicesComm.targetName}open(e,t,n,i){const r=this.jsServicesComm.open(e,n,i);return this._hookupCallbacks(r,t),r.msg.header.msg_id}send(e,t,n,i){const r=this.jsServicesComm.send(e,n,i);return this._hookupCallbacks(r,t),r.msg.header.msg_id}close(e,t,n,i){const r=this.jsServicesComm.close(e,n,i);return this._hookupCallbacks(r,t),r.msg.header.msg_id}on_msg(e){this.jsServicesComm.onMsg=e.bind(this)}on_close(e){this.jsServicesComm.onClose=e.bind(this)}_hookupCallbacks(e,t){t&&(e.onReply=function(e){t.shell&&t.shell.reply&&t.shell.reply(e)},e.onStdin=function(e){t.input&&t.input(e)},e.onIOPub=function(e){if(t.iopub)if(t.iopub.status&&"status"===e.header.msg_type)t.iopub.status(e);else if(t.iopub.clear_output&&"clear_output"===e.header.msg_type)t.iopub.clear_output(e);else if(t.iopub.output)switch(e.header.msg_type){case"display_data":case"execute_result":case"stream":case"error":t.iopub.output(e)}})}}e.Comm=t}(t=e.services||(e.services={}))}(q||(q={}));class ${constructor(e,t,n){this.initialize(e,t,n)}initialize(e,t,n){this._handler_context=n||this,this._models=[],this.views=[],this._create_view=e,this._remove_view=t||function(e){e.remove()}}update(e,t,n,i){const r=n||this._remove_view,s=t||this._create_view;i=i||this._handler_context;let o=0;for(;o=this._models.length||e[o]!==this._models[o]);o++);const a=o,l=this.views.splice(a,this.views.length-a);for(let e=0;e{e.forEach((e=>this._remove_view.call(this._handler_context,e))),this.views=[],this._models=[]}))}dispose(){this.views=null,this._models=null}}const V=new i.Token("jupyter.extensions.jupyterWidgetRegistry");function G(e,t){return class extends j{constructor(n,i){super(n=Object.assign(Object.assign({},n),{_view_name:"ErrorWidgetView",_view_module:"@jupyter-widgets/base",_model_module_version:D,_view_module_version:D,msg:t,error:e}),i),this.comm_live=!0}}}class K extends N{generateErrorMessage(){return{msg:this.model.get("msg"),stack:String(this.model.get("error").stack)}}render(){const{msg:e,stack:t}=this.generateErrorMessage();this.el.classList.add("jupyter-widgets");const n=document.createElement("div");n.classList.add("jupyter-widgets-error-widget","icon-error"),n.innerHTML=m;const i=document.createElement("pre");let r,s;i.style.textAlign="center",i.innerText="Click to show javascript error.",n.append(i),this.el.appendChild(n),this.el.onclick=()=>{n.classList.contains("icon-error")&&(s=s||n.clientHeight,r=r||n.clientWidth,n.classList.remove("icon-error"),n.innerHTML=`\n
[Open Browser Console for more detailed log - Double click to close this message]\n${e}\n${t}
\n `,n.style.height=`${s}px`,n.style.width=`${r}px`,n.classList.add("text-error"))},this.el.ondblclick=()=>{n.classList.contains("text-error")&&(n.classList.remove("text-error"),n.innerHTML=m,n.append(i),n.classList.add("icon-error"))}}}function Y(e,t){return class extends K{generateErrorMessage(){return{msg:t,stack:String(e instanceof Error?e.stack:e)}}}}},5803:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AccordionModel:()=>qt,AccordionView:()=>Vt,AudioModel:()=>G,AudioView:()=>K,BaseIntSliderView:()=>Le,BoolModel:()=>y,BoundedFloatModel:()=>Ye,BoundedFloatTextModel:()=>it,BoundedIntModel:()=>Oe,BoundedIntTextModel:()=>Ue,BoxModel:()=>P,BoxView:()=>N,ButtonModel:()=>T,ButtonStyleModel:()=>S,ButtonView:()=>B,CheckboxModel:()=>w,CheckboxStyleModel:()=>b,CheckboxView:()=>_,ColorPickerModel:()=>J,ColorPickerView:()=>X,ColorsInputModel:()=>Nn,ColorsInputView:()=>Fn,ComboboxModel:()=>ci,ComboboxView:()=>hi,ControllerAxisModel:()=>lt,ControllerAxisView:()=>ut,ControllerButtonModel:()=>ot,ControllerButtonView:()=>at,ControllerModel:()=>dt,ControllerView:()=>ct,DatePickerModel:()=>ee,DatePickerView:()=>te,DatetimeModel:()=>ce,DatetimeView:()=>he,DescriptionModel:()=>u,DescriptionStyleModel:()=>l,DescriptionView:()=>d,DirectionalLinkModel:()=>m,DropdownModel:()=>ft,DropdownView:()=>gt,FileUploadModel:()=>pi,FileUploadView:()=>fi,FloatLogSliderModel:()=>Xe,FloatLogSliderView:()=>et,FloatModel:()=>Ke,FloatProgressModel:()=>st,FloatRangeSliderModel:()=>Ze,FloatRangeSliderView:()=>tt,FloatSliderModel:()=>Je,FloatSliderView:()=>Qe,FloatTextModel:()=>nt,FloatTextView:()=>rt,FloatsInputModel:()=>Hn,FloatsInputView:()=>Wn,GridBoxModel:()=>H,GridBoxView:()=>U,HBoxModel:()=>R,HBoxView:()=>F,HTMLMathModel:()=>ti,HTMLMathStyleModel:()=>Kn,HTMLMathView:()=>ni,HTMLModel:()=>Qn,HTMLStyleModel:()=>Gn,HTMLView:()=>ei,ImageModel:()=>W,ImageView:()=>q,IntModel:()=>je,IntProgressModel:()=>qe,IntRangeSliderModel:()=>Re,IntRangeSliderView:()=>Ne,IntSliderModel:()=>Pe,IntSliderView:()=>Fe,IntTextModel:()=>ze,IntTextView:()=>He,IntsInputModel:()=>qn,IntsInputView:()=>$n,JUPYTER_CONTROLS_VERSION:()=>a.A,JupyterLuminoAccordionWidget:()=>$t,JupyterLuminoTabPanelWidget:()=>Kt,LabelModel:()=>ii,LabelStyleModel:()=>Yn,LabelView:()=>ri,LabeledDOMWidgetModel:()=>c,LabeledDOMWidgetView:()=>h,LinkModel:()=>v,MultipleSelectionModel:()=>xt,NaiveDatetimeModel:()=>ve,PasswordModel:()=>ui,PasswordView:()=>di,PlayModel:()=>Ve,PlayView:()=>Ge,ProgressStyleModel:()=>We,ProgressView:()=>$e,RadioButtonsModel:()=>bt,RadioButtonsView:()=>At,SelectModel:()=>mt,SelectMultipleModel:()=>Dt,SelectMultipleView:()=>St,SelectView:()=>vt,SelectionContainerModel:()=>Wt,SelectionModel:()=>ht,SelectionRangeSliderModel:()=>Tt,SelectionRangeSliderView:()=>Bt,SelectionSliderModel:()=>Et,SelectionSliderView:()=>Ct,SelectionView:()=>pt,SliderStyleModel:()=>Ie,StackModel:()=>Jt,StackView:()=>Xt,StringModel:()=>Xn,StringView:()=>Zn,TabModel:()=>Gt,TabView:()=>Yt,TagsInputModel:()=>Rn,TagsInputView:()=>Ln,TextModel:()=>ai,TextStyleModel:()=>Jn,TextView:()=>li,TextareaModel:()=>si,TextareaView:()=>oi,TimeModel:()=>oe,TimeView:()=>ae,ToggleButtonModel:()=>E,ToggleButtonStyleModel:()=>A,ToggleButtonView:()=>C,ToggleButtonsModel:()=>wt,ToggleButtonsStyleModel:()=>yt,ToggleButtonsView:()=>_t,VBoxModel:()=>L,VBoxView:()=>z,ValidModel:()=>x,ValidView:()=>D,VideoModel:()=>$,VideoView:()=>V,datetime_serializers:()=>de,deserialize_date:()=>Q,deserialize_datetime:()=>ue,deserialize_naive:()=>ge,deserialize_time:()=>re,escape_html:()=>s,naive_serializers:()=>me,reject:()=>o,resolvePromisesDict:()=>i.resolvePromisesDict,serialize_date:()=>Z,serialize_datetime:()=>le,serialize_naive:()=>fe,serialize_time:()=>ie,time_serializers:()=>se,typeset:()=>r,uuid:()=>i.uuid,version:()=>gi});var i=n(7998);function r(e,t){void 0!==t&&(e.textContent=t),void 0!==window.MathJax&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,e])}function s(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}function o(e,t){return function(n){throw t&&console.error(new Error(e)),n}}var a=n(9874);class l extends i.StyleModel{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"DescriptionStyleModel",_model_module:"@jupyter-widgets/controls",_model_module_version:a.A})}}l.styleProperties={description_width:{selector:".widget-label",attribute:"width",default:null}};class u extends i.DOMWidgetModel{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"DescriptionModel",_view_name:"DescriptionView",_view_module:"@jupyter-widgets/controls",_model_module:"@jupyter-widgets/controls",_view_module_version:a.A,_model_module_version:a.A,description:"",description_allow_html:!1})}}class d extends i.DOMWidgetView{render(){this.label=document.createElement("label"),this.el.appendChild(this.label),this.label.className="widget-label",this.label.style.display="none",this.listenTo(this.model,"change:description",this.updateDescription),this.listenTo(this.model,"change:description_allow_html",this.updateDescription),this.listenTo(this.model,"change:tabbable",this.updateTabindex),this.updateDescription(),this.updateTabindex(),this.updateTooltip()}typeset(e,t){this.displayed.then((()=>{var n,i,s;if(null===(i=null===(n=window.MathJax)||void 0===n?void 0:n.Hub)||void 0===i?void 0:i.Queue)return r(e,t);const o=null===(s=this.model.widget_manager._rendermime)||void 0===s?void 0:s.latexTypesetter;o&&(void 0!==t&&(e.textContent=t),o.typeset(e))}))}updateDescription(){const e=this.model.get("description");0===e.length?this.label.style.display="none":(this.model.get("description_allow_html")?this.label.innerHTML=this.model.widget_manager.inline_sanitize(e):this.label.textContent=e,this.typeset(this.label),this.label.style.display="")}updateTooltip(){this.label&&(this.label.title=this.model.get("tooltip"))}}class c extends u{}class h extends d{}class p extends i.WidgetModel{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"CoreWidgetModel",_view_module:"@jupyter-widgets/controls",_model_module:"@jupyter-widgets/controls",_view_module_version:a.A,_model_module_version:a.A})}}class f extends i.DOMWidgetModel{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"CoreDOMWidgetModel",_view_module:"@jupyter-widgets/controls",_model_module:"@jupyter-widgets/controls",_view_module_version:a.A,_model_module_version:a.A})}}class g extends u{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"CoreDescriptionModel",_view_module:"@jupyter-widgets/controls",_model_module:"@jupyter-widgets/controls",_view_module_version:a.A,_model_module_version:a.A})}}class m extends p{defaults(){return Object.assign(Object.assign({},super.defaults()),{target:void 0,source:void 0,_model_name:"DirectionalLinkModel"})}initialize(e,t){super.initialize(e,t),this.on("change",this.updateBindings,this),this.updateBindings()}updateValue(e,t,n,i){if(!this._updating){this._updating=!0;try{n&&(n.set(i,e.get(t)),n.save_changes())}finally{this._updating=!1}}}updateBindings(){this.cleanup(),[this.sourceModel,this.sourceAttr]=this.get("source")||[null,null],[this.targetModel,this.targetAttr]=this.get("target")||[null,null],this.sourceModel&&(this.listenTo(this.sourceModel,"change:"+this.sourceAttr,(()=>{this.updateValue(this.sourceModel,this.sourceAttr,this.targetModel,this.targetAttr)})),this.updateValue(this.sourceModel,this.sourceAttr,this.targetModel,this.targetAttr),this.listenToOnce(this.sourceModel,"destroy",this.cleanup)),this.targetModel&&this.listenToOnce(this.targetModel,"destroy",this.cleanup)}cleanup(){this.sourceModel&&(this.stopListening(this.sourceModel,"change:"+this.sourceAttr,void 0),this.stopListening(this.sourceModel,"destroy",void 0)),this.targetModel&&this.stopListening(this.targetModel,"destroy",void 0)}}m.serializers=Object.assign(Object.assign({},p.serializers),{target:{deserialize:i.unpack_models},source:{deserialize:i.unpack_models}});class v extends m{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"LinkModel"})}updateBindings(){super.updateBindings(),this.targetModel&&this.listenTo(this.targetModel,"change:"+this.targetAttr,(()=>{this.updateValue(this.targetModel,this.targetAttr,this.sourceModel,this.sourceAttr)}))}cleanup(){super.cleanup(),this.targetModel&&this.stopListening(this.targetModel,"change:"+this.targetAttr,void 0)}}class b extends l{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"CheckboxStyleModel"})}}b.styleProperties=Object.assign(Object.assign({},l.styleProperties),{background:{selector:"",attribute:"background",default:null}});class A extends l{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"ToggleButtonStyleModel"})}}A.styleProperties=Object.assign(Object.assign({},l.styleProperties),{font_family:{selector:"",attribute:"font-family",default:""},font_size:{selector:"",attribute:"font-size",default:""},font_style:{selector:"",attribute:"font-style",default:""},font_variant:{selector:"",attribute:"font-variant",default:""},font_weight:{selector:"",attribute:"font-weight",default:""},text_color:{selector:"",attribute:"color",default:""},text_decoration:{selector:"",attribute:"text-decoration",default:""}});class y extends g{defaults(){return Object.assign(Object.assign({},super.defaults()),{value:!1,disabled:!1,_model_name:"BoolModel"})}}class w extends g{defaults(){return Object.assign(Object.assign({},super.defaults()),{indent:!0,style:null,_view_name:"CheckboxView",_model_name:"CheckboxModel"})}}class _ extends d{render(){super.render(),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-checkbox"),this.label.innerHTML="​",this.checkboxLabel=document.createElement("label"),this.checkboxLabel.classList.add("widget-label-basic"),this.el.appendChild(this.checkboxLabel),this.checkbox=document.createElement("input"),this.checkbox.setAttribute("type","checkbox"),this.checkboxLabel.appendChild(this.checkbox),this.descriptionSpan=document.createElement("span"),this.checkboxLabel.appendChild(this.descriptionSpan),this.listenTo(this.model,"change:indent",this.updateIndent),this.listenTo(this.model,"change:tabbable",this.updateTabindex),this.update(),this.updateDescription(),this.updateIndent(),this.updateTabindex(),this.updateTooltip()}updateDescription(){if(null==this.checkboxLabel)return;const e=this.model.get("description");this.model.get("description_allow_html")?this.descriptionSpan.innerHTML=this.model.widget_manager.inline_sanitize(e):this.descriptionSpan.textContent=e,this.typeset(this.descriptionSpan),this.descriptionSpan.title=e,this.checkbox.title=e}updateIndent(){const e=this.model.get("indent");this.label.style.display=e?"":"none"}updateTabindex(){if(!this.checkbox)return;const e=this.model.get("tabbable");!0===e?this.checkbox.setAttribute("tabIndex","0"):!1===e?this.checkbox.setAttribute("tabIndex","-1"):null===e&&this.checkbox.removeAttribute("tabIndex")}updateTooltip(){if(!this.checkbox)return;const e=this.model.get("tooltip");e?0===this.model.get("description").length&&this.checkbox.setAttribute("title",e):this.checkbox.removeAttribute("title")}events(){return{'click input[type="checkbox"]':"_handle_click"}}_handle_click(){const e=this.model.get("value");this.model.set("value",!e,{updated_view:this}),this.touch()}update(e){return this.checkbox.checked=this.model.get("value"),void 0!==e&&e.updated_view==this||(this.checkbox.disabled=this.model.get("disabled")),super.update()}handle_message(e){"focus"==e.do?this.checkbox.focus():"blur"==e.do&&this.checkbox.blur()}}class E extends y{defaults(){return Object.assign(Object.assign({},super.defaults()),{_view_name:"ToggleButtonView",_model_name:"ToggleButtonModel",tooltip:"",icon:"",button_style:"",style:null})}}class C extends i.DOMWidgetView{render(){super.render(),this.el.classList.add("jupyter-widgets"),this.el.classList.add("jupyter-button"),this.el.classList.add("widget-toggle-button"),this.listenTo(this.model,"change:button_style",this.update_button_style),this.listenTo(this.model,"change:tabbable",this.updateTabindex),this.set_button_style(),this.update()}update_button_style(){this.update_mapped_classes(C.class_map,"button_style")}set_button_style(){this.set_mapped_classes(C.class_map,"button_style")}update(e){if(this.model.get("value")?this.el.classList.add("mod-active"):this.el.classList.remove("mod-active"),void 0===e||e.updated_view!==this){this.el.disabled=this.model.get("disabled"),this.el.setAttribute("tabbable",this.model.get("tabbable")),this.el.setAttribute("title",this.model.get("tooltip"));const e=this.model.get("description"),t=this.model.get("icon");if(0===e.trim().length&&0===t.trim().length)this.el.innerHTML=" ";else{if(this.el.textContent="",t.trim().length){const e=document.createElement("i");this.el.appendChild(e),e.classList.add("fa"),e.classList.add("fa-"+t)}this.el.appendChild(document.createTextNode(e))}}return this.updateTabindex(),super.update()}events(){return{click:"_handle_click"}}_handle_click(e){e.preventDefault();const t=this.model.get("value");this.model.set("value",!t,{updated_view:this}),this.touch()}preinitialize(){this.tagName="button"}}C.class_map={primary:["mod-primary"],success:["mod-success"],info:["mod-info"],warning:["mod-warning"],danger:["mod-danger"]};class x extends y{defaults(){return Object.assign(Object.assign({},super.defaults()),{readout:"Invalid",_view_name:"ValidView",_model_name:"ValidModel"})}}class D extends d{render(){super.render(),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-valid"),this.el.classList.add("widget-inline-hbox"),this.icon=document.createElement("i"),this.icon.classList.add("fa","fa-fw"),this.el.appendChild(this.icon),this.readout=document.createElement("span"),this.readout.classList.add("widget-valid-readout"),this.readout.classList.add("widget-readout"),this.el.appendChild(this.readout),this.update()}update(){this.el.classList.remove("mod-valid"),this.el.classList.remove("mod-invalid"),this.icon.classList.remove("fa-check"),this.icon.classList.remove("fa-times"),this.readout.textContent=this.model.get("readout"),this.model.get("value")?(this.el.classList.add("mod-valid"),this.icon.classList.add("fa-check")):(this.el.classList.add("mod-invalid"),this.icon.classList.add("fa-times"))}}class S extends i.StyleModel{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"ButtonStyleModel",_model_module:"@jupyter-widgets/controls",_model_module_version:a.A})}}S.styleProperties={button_color:{selector:"",attribute:"background-color",default:null},font_family:{selector:"",attribute:"font-family",default:""},font_size:{selector:"",attribute:"font-size",default:""},font_style:{selector:"",attribute:"font-style",default:""},font_variant:{selector:"",attribute:"font-variant",default:""},font_weight:{selector:"",attribute:"font-weight",default:""},text_color:{selector:"",attribute:"color",default:""},text_decoration:{selector:"",attribute:"text-decoration",default:""}};class T extends f{defaults(){return Object.assign(Object.assign({},super.defaults()),{description:"",tooltip:"",disabled:!1,icon:"",button_style:"",_view_name:"ButtonView",_model_name:"ButtonModel",style:null})}}class B extends i.DOMWidgetView{render(){super.render(),this.el.classList.add("jupyter-widgets"),this.el.classList.add("jupyter-button"),this.el.classList.add("widget-button"),this.listenTo(this.model,"change:button_style",this.update_button_style),this.listenTo(this.model,"change:tabbable",this.updateTabindex),this.set_button_style(),this.update()}update(){this.el.disabled=this.model.get("disabled"),this.updateTabindex();const e=this.model.get("tooltip"),t=this.model.get("description"),n=this.model.get("icon");if(this.el.setAttribute("title",null!=e?e:t),t.length||n.length){if(this.el.textContent="",n.length){const e=document.createElement("i");e.classList.add("fa"),e.classList.add(...n.split(/[\s]+/).filter(Boolean).map((e=>`fa-${e}`))),0===t.length&&e.classList.add("center"),this.el.appendChild(e)}this.el.appendChild(document.createTextNode(t))}return super.update()}update_button_style(){this.update_mapped_classes(B.class_map,"button_style")}set_button_style(){this.set_mapped_classes(B.class_map,"button_style")}events(){return{click:"_handle_click"}}_handle_click(e){e.preventDefault(),this.send({event:"click"})}preinitialize(){this.tagName="button"}}B.class_map={primary:["mod-primary"],success:["mod-success"],info:["mod-info"],warning:["mod-warning"],danger:["mod-danger"]};var k=n(8135),M=n(3326),j=n(5070),O=n(4651),I=n.n(O);class P extends f{defaults(){return Object.assign(Object.assign({},super.defaults()),{_view_name:"BoxView",_model_name:"BoxModel",children:[],box_style:""})}}P.serializers=Object.assign(Object.assign({},f.serializers),{children:{deserialize:i.unpack_models}});class R extends P{defaults(){return Object.assign(Object.assign({},super.defaults()),{_view_name:"HBoxView",_model_name:"HBoxModel"})}}class L extends P{defaults(){return Object.assign(Object.assign({},super.defaults()),{_view_name:"VBoxView",_model_name:"VBoxModel"})}}class N extends i.DOMWidgetView{_createElement(e){return this.luminoWidget=new i.JupyterLuminoPanelWidget({view:this}),this.luminoWidget.node}_setElement(e){if(this.el||e!==this.luminoWidget.node)throw new Error("Cannot reset the DOM element.");this.el=this.luminoWidget.node,this.$el=I()(this.luminoWidget.node)}initialize(e){super.initialize(e),this.children_views=new i.ViewList(this.add_child_model,null,this),this.listenTo(this.model,"change:children",this.update_children),this.listenTo(this.model,"change:box_style",this.update_box_style),this.luminoWidget.addClass("jupyter-widgets"),this.luminoWidget.addClass("widget-container"),this.luminoWidget.addClass("widget-box")}render(){super.render(),this.update_children(),this.set_box_style()}update_children(){var e;null===(e=this.children_views)||void 0===e||e.update(this.model.get("children")).then((e=>{e.forEach((e=>{M.Mu.postMessage(e.luminoWidget,j.x0.ResizeMessage.UnknownSize)}))}))}update_box_style(){this.update_mapped_classes(N.class_map,"box_style")}set_box_style(){this.set_mapped_classes(N.class_map,"box_style")}add_child_model(e){const t=new j.x0;return this.luminoWidget.addWidget(t),this.create_child_view(e).then((e=>{const n=k.Rw.firstIndexOf(this.luminoWidget.widgets,t);return this.luminoWidget.insertWidget(n,e.luminoWidget),t.dispose(),e})).catch((0,i.reject)("Could not add child view to box",!0))}remove(){this.children_views=null,super.remove()}}N.class_map={success:["alert","alert-success"],info:["alert","alert-info"],warning:["alert","alert-warning"],danger:["alert","alert-danger"]};class F extends N{initialize(e){super.initialize(e),this.luminoWidget.addClass("widget-hbox")}}class z extends N{initialize(e){super.initialize(e),this.luminoWidget.addClass("widget-vbox")}}class U extends N{initialize(e){super.initialize(e),this.luminoWidget.addClass("widget-gridbox"),this.luminoWidget.removeClass("widget-box")}}class H extends P{defaults(){return Object.assign(Object.assign({},super.defaults()),{_view_name:"GridBoxView",_model_name:"GridBoxModel"})}}class W extends f{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"ImageModel",_view_name:"ImageView",format:"png",width:"",height:"",value:new DataView(new ArrayBuffer(0))})}}W.serializers=Object.assign(Object.assign({},f.serializers),{value:{serialize:e=>new DataView(e.buffer.slice(0))}});class q extends i.DOMWidgetView{render(){super.render(),this.luminoWidget.addClass("jupyter-widgets"),this.luminoWidget.addClass("widget-image"),this.update()}update(){let e;const t=this.model.get("format"),n=this.model.get("value");if("url"!==t){const t=new Blob([n],{type:`image/${this.model.get("format")}`});e=URL.createObjectURL(t)}else e=new TextDecoder("utf-8").decode(n.buffer);const i=this.el.src;this.el.src=e,i&&URL.revokeObjectURL(i);const r=this.model.get("width");void 0!==r&&r.length>0?this.el.setAttribute("width",r):this.el.removeAttribute("width");const s=this.model.get("height");return void 0!==s&&s.length>0?this.el.setAttribute("height",s):this.el.removeAttribute("height"),super.update()}remove(){this.el.src&&URL.revokeObjectURL(this.el.src),super.remove()}preinitialize(){this.tagName="img"}}class $ extends f{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"VideoModel",_view_name:"VideoView",format:"mp4",width:"",height:"",autoplay:!0,loop:!0,controls:!0,value:new DataView(new ArrayBuffer(0))})}}$.serializers=Object.assign(Object.assign({},f.serializers),{value:{serialize:e=>new DataView(e.buffer.slice(0))}});class V extends i.DOMWidgetView{render(){super.render(),this.luminoWidget.addClass("jupyter-widgets"),this.luminoWidget.addClass("widget-image"),this.update()}update(){let e;const t=this.model.get("format"),n=this.model.get("value");if("url"!==t){const t=new Blob([n],{type:`video/${this.model.get("format")}`});e=URL.createObjectURL(t)}else e=new TextDecoder("utf-8").decode(n.buffer);const i=this.el.src;this.el.src=e,i&&URL.revokeObjectURL(i);const r=this.model.get("width");void 0!==r&&r.length>0?this.el.setAttribute("width",r):this.el.removeAttribute("width");const s=this.model.get("height");return void 0!==s&&s.length>0?this.el.setAttribute("height",s):this.el.removeAttribute("height"),this.el.loop=this.model.get("loop"),this.el.autoplay=this.model.get("autoplay"),this.el.controls=this.model.get("controls"),super.update()}remove(){this.el.src&&URL.revokeObjectURL(this.el.src),super.remove()}preinitialize(){this.tagName="video"}}class G extends f{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"AudioModel",_view_name:"AudioView",format:"mp3",autoplay:!0,loop:!0,controls:!0,value:new DataView(new ArrayBuffer(0))})}}G.serializers=Object.assign(Object.assign({},f.serializers),{value:{serialize:e=>new DataView(e.buffer.slice(0))}});class K extends i.DOMWidgetView{render(){super.render(),this.luminoWidget.addClass("jupyter-widgets"),this.update()}update(){let e;const t=this.model.get("format"),n=this.model.get("value");if("url"!==t){const t=new Blob([n],{type:`audio/${this.model.get("format")}`});e=URL.createObjectURL(t)}else e=new TextDecoder("utf-8").decode(n.buffer);const i=this.el.src;return this.el.src=e,i&&URL.revokeObjectURL(i),this.el.loop=this.model.get("loop"),this.el.autoplay=this.model.get("autoplay"),this.el.controls=this.model.get("controls"),super.update()}remove(){this.el.src&&URL.revokeObjectURL(this.el.src),super.remove()}preinitialize(){this.tagName="audio"}}const Y={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgreen:"#90ee90",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};class J extends g{defaults(){return Object.assign(Object.assign({},super.defaults()),{value:"black",concise:!1,_model_name:"ColorPickerModel",_view_name:"ColorPickerView"})}}class X extends d{render(){super.render(),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-colorpicker"),this._color_container=document.createElement("div"),this._color_container.className="widget-inline-hbox widget-colorpicker-input",this.el.appendChild(this._color_container),this._textbox=document.createElement("input"),this._textbox.setAttribute("type","text"),this._textbox.id=this.label.htmlFor=(0,i.uuid)(),this._color_container.appendChild(this._textbox),this._textbox.value=this.model.get("value"),this._colorpicker=document.createElement("input"),this._colorpicker.setAttribute("type","color"),this._color_container.appendChild(this._colorpicker),this.listenTo(this.model,"change:value",this._update_value),this.listenTo(this.model,"change:concise",this._update_concise),this._update_concise(),this._update_value(),this.update()}update(e){if(void 0===e||e.updated_view!=this){const e=this.model.get("disabled");this._textbox.disabled=e,this._colorpicker.disabled=e}return super.update()}events(){return this._picker_change,this._text_change,{'change [type="color"]':"_picker_change",'change [type="text"]':"_text_change"}}_update_value(){const e=this.model.get("value");var t,n;this._colorpicker.value=Y[(t=e).toLowerCase()]||(7===(n=t).length?n:"#"+n.charAt(1)+n.charAt(1)+n.charAt(2)+n.charAt(2)+n.charAt(3)+n.charAt(3)),this._textbox.value=e}_update_concise(){this.model.get("concise")?(this.el.classList.add("concise"),this._textbox.style.display="none"):(this.el.classList.remove("concise"),this._textbox.style.display="")}_picker_change(){this.model.set("value",this._colorpicker.value),this.touch()}_text_change(){const e=this._validate_color(this._textbox.value,this.model.get("value"));this.model.set("value",e),this.touch()}_validate_color(e,t){return e.match(/#[a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?$/)||Y[e.toLowerCase()]?e:t}}function Z(e){return null===e?null:{year:e.getUTCFullYear(),month:e.getUTCMonth(),date:e.getUTCDate()}}function Q(e){if(null===e)return null;{const t=new Date;return t.setUTCFullYear(e.year,e.month,e.date),t.setUTCHours(0,0,0,0),t}}class ee extends g{defaults(){return Object.assign(Object.assign({},super.defaults()),{value:null,_model_name:"DatePickerModel",_view_name:"DatePickerView"})}}ee.serializers=Object.assign(Object.assign({},g.serializers),{value:{serialize:Z,deserialize:Q}});class te extends d{render(){super.render(),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-datepicker"),this._datepicker=document.createElement("input"),this._datepicker.setAttribute("type","date"),this._datepicker.id=this.label.htmlFor=(0,i.uuid)(),this.el.appendChild(this._datepicker),this.listenTo(this.model,"change:value",this._update_value),this._update_value(),this.update()}update(e){return void 0!==e&&e.updated_view===this||(this._datepicker.disabled=this.model.get("disabled")),super.update()}events(){return this._picker_change,this._picker_focusout,{'change [type="date"]':"_picker_change",'focusout [type="date"]':"_picker_focusout"}}_update_value(){const e=this.model.get("value");this._datepicker.valueAsDate=e}_picker_change(){this._datepicker.validity.badInput||(this.model.set("value",this._datepicker.valueAsDate),this.touch())}_picker_focusout(){this._datepicker.validity.badInput&&(this.model.set("value",null),this.touch())}}const ne=/(\d\d):(\d\d)(:(\d\d)(.(\d{1,3})\d*)?)?/;function ie(e){if(null===e)return null;{const t=ne.exec(e);return null===t?null:{hours:Math.min(23,parseInt(t[1],10)),minutes:Math.min(59,parseInt(t[2],10)),seconds:t[4]?Math.min(59,parseInt(t[4],10)):0,milliseconds:t[6]?parseInt(t[6],10):0}}}function re(e){if(null===e)return null;{const t=[`${e.hours.toString().padStart(2,"0")}:${e.minutes.toString().padStart(2,"0")}`];return(e.seconds>0||e.milliseconds>0)&&(t.push(`:${e.seconds.toString().padStart(2,"0")}`),e.milliseconds>0&&t.push(`.${e.milliseconds.toString().padStart(3,"0")}`)),t.join("")}}const se={serialize:ie,deserialize:re};class oe extends g{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:oe.model_name,_view_name:oe.view_name,value:null,disabled:!1,min:null,max:null,step:60})}}oe.serializers=Object.assign(Object.assign({},g.serializers),{value:se,min:se,max:se}),oe.model_name="TimeModel",oe.view_name="TimeView";class ae extends d{render(){super.render(),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-timepicker"),this._timepicker=document.createElement("input"),this._timepicker.setAttribute("type","time"),this._timepicker.id=this.label.htmlFor=(0,i.uuid)(),this.el.appendChild(this._timepicker),this.listenTo(this.model,"change:value",this._update_value),this.listenTo(this.model,"change",this.update2),this._update_value(),this.update2()}update2(e,t){return void 0!==t&&t.updated_view===this||(this._timepicker.disabled=this.model.get("disabled"),this._timepicker.min=this.model.get("min"),this._timepicker.max=this.model.get("max"),this._timepicker.step=this.model.get("step")),super.update()}events(){return this._picker_change,this._picker_focusout,{'change [type="time"]':"_picker_change",'focusout [type="time"]':"_picker_focusout"}}_update_value(e,t,n){void 0!==n&&n.updated_view===this||(this._timepicker.value=this.model.get("value"))}_picker_change(){this._timepicker.validity.badInput||(this.model.set("value",this._timepicker.value,{updated_view:this}),this.touch())}_picker_focusout(){this._timepicker.validity.badInput&&(this.model.set("value",null,{updated_view:this}),this.touch())}}function le(e){return null===e?null:{year:e.getUTCFullYear(),month:e.getUTCMonth(),date:e.getUTCDate(),hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds(),milliseconds:e.getUTCMilliseconds()}}function ue(e){if(null===e)return null;{const t=new Date;return t.setUTCFullYear(e.year,e.month,e.date),t.setUTCHours(e.hours,e.minutes,e.seconds,e.milliseconds),t}}const de={serialize:le,deserialize:ue};class ce extends g{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"DatetimeModel",_view_name:"DatetimeView",value:null,disabled:!1,min:null,max:null})}}ce.serializers=Object.assign(Object.assign({},g.serializers),{value:de,min:de,max:de});class he extends d{render(){super.render(),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-datetimepicker");const e=document.createElement("input");e.type="datetime-local","text"===e.type?(this._datepicker=document.createElement("input"),this._datepicker.setAttribute("type","date"),this._datepicker.id=this.label.htmlFor=(0,i.uuid)(),this._timepicker=document.createElement("input"),this._timepicker.setAttribute("type","time"),this._timepicker.id=(0,i.uuid)(),this.el.appendChild(this._datepicker),this.el.appendChild(this._timepicker)):(this._datetimepicker=e,this._datetimepicker.id=this.label.htmlFor=(0,i.uuid)(),this.el.appendChild(this._datetimepicker)),this.listenTo(this.model,"change:value",this._update_value),this.listenTo(this.model,"change",this.update2),this._update_value(),this.update2()}update2(e,t){if(void 0===t||t.updated_view!==this){const e=this.model.get("min"),t=this.model.get("max");this._datetimepicker?(this._datetimepicker.disabled=this.model.get("disabled"),this._datetimepicker.min=pe.dt_as_dt_string(e),this._datetimepicker.max=pe.dt_as_dt_string(t)):(this._datepicker.disabled=this.model.get("disabled"),this._datepicker.min=pe.dt_as_date_string(e),this._datepicker.max=pe.dt_as_date_string(t),this._timepicker.disabled=this.model.get("disabled"))}}events(){return this._picker_change,this._picker_focusout,{'change [type="date"]':"_picker_change",'change [type="time"]':"_picker_change",'change [type="datetime-local"]':"_picker_change",'focusout [type="date"]':"_picker_focusout",'focusout [type="datetime-local"]':"_picker_focusout",'focusout [type="time"]':"_picker_focusout"}}_update_value(e,t,n){if(void 0===n||n.updated_view!==this){const e=this.model.get("value");this._datetimepicker?this._datetimepicker.value=pe.dt_as_dt_string(e):(this._datepicker.valueAsDate=e,this._timepicker.value=pe.dt_as_time_string(e))}}_picker_change(){if(this._datetimepicker){if(!this._datetimepicker.validity.badInput){const e=this._datetimepicker.value;let t=e?new Date(e):null;t&&isNaN(t.valueOf())&&(t=null),this.model.set("value",t,{updated_view:this}),this.touch()}}else if(!this._datepicker.validity.badInput&&!this._timepicker.validity.badInput){const e=this._datepicker.valueAsDate,t=ie(this._timepicker.value);null!==e&&null!==t&&e.setHours(t.hours,t.minutes,t.seconds,t.milliseconds),this.model.set("value",null!==t&&e,{updated_view:this}),this.touch()}}_picker_focusout(){[this._datetimepicker,this._datepicker,this._timepicker].some((e=>e&&e.validity.badInput))&&(this.model.set("value",null),this.touch())}}var pe;function fe(e){return null===e?null:{year:e.getFullYear(),month:e.getMonth(),date:e.getDate(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds(),milliseconds:e.getMilliseconds()}}function ge(e){if(null===e)return null;{const t=new Date;return t.setFullYear(e.year,e.month,e.date),t.setHours(e.hours,e.minutes,e.seconds,e.milliseconds),t}}!function(e){function t(e){if(null===e)return"";const t=[];return t.push(`${e.getFullYear().toString().padStart(4,"0")}`),t.push(`-${(e.getMonth()+1).toString().padStart(2,"0")}`),t.push(`-${e.getDate().toString().padStart(2,"0")}`),t.push(`T${e.getHours().toString().padStart(2,"0")}`),t.push(`:${e.getMinutes().toString().padStart(2,"0")}`),(e.getSeconds()>0||e.getMilliseconds()>0)&&(t.push(`:${e.getSeconds().toString().padStart(2,"0")}`),e.getMilliseconds()>0&&t.push(`.${e.getMilliseconds().toString().padStart(3,"0")}`)),t.join("")}e.dt_as_dt_string=t,e.dt_as_date_string=function(e){return e?t(e).split("T",2)[0]:""},e.dt_as_time_string=function(e){return e?t(e).split("T",2)[1]:""}}(pe||(pe={}));const me={serialize:fe,deserialize:ge};class ve extends ce{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"NaiveDatetimeModel"})}}function be(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}ve.serializers=Object.assign(Object.assign({},g.serializers),{value:me,min:me,max:me});var Ae,ye=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function we(e){if(!(t=ye.exec(e)))throw new Error("invalid format: "+e);var t;return new _e({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function _e(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Ee(e,t){var n=be(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}we.prototype=_e.prototype,_e.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Ce={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Ee(100*e,t),r:Ee,s:function(e,t){var n=be(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(Ae=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+be(e,Math.max(0,t+s-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function xe(e){return e}var De,Se,Te=Array.prototype.map,Be=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];De=function(e){var t,n,i=void 0===e.grouping||void 0===e.thousands?xe:(t=Te.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var r=e.length,s=[],o=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(e.substring(r-=a,r+a)),!((l+=a+1)>i));)a=t[o=(o+1)%t.length];return s.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",s=void 0===e.currency?"":e.currency[1]+"",o=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?xe:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Te.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"−":e.minus+"",d=void 0===e.nan?"NaN":e.nan+"";function c(e){var t=(e=we(e)).fill,n=e.align,c=e.sign,h=e.symbol,p=e.zero,f=e.width,g=e.comma,m=e.precision,v=e.trim,b=e.type;"n"===b?(g=!0,b="g"):Ce[b]||(void 0===m&&(m=12),v=!0,b="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var A="$"===h?r:"#"===h&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",y="$"===h?s:/[%p]/.test(b)?l:"",w=Ce[b],_=/[defgprs%]/.test(b);function E(e){var r,s,l,h=A,E=y;if("c"===b)E=w(e)+E,e="";else{var C=(e=+e)<0||1/e<0;if(e=isNaN(e)?d:w(Math.abs(e),m),v&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),C&&0==+e&&"+"!==c&&(C=!1),h=(C?"("===c?c:u:"-"===c||"("===c?"":c)+h,E=("s"===b?Be[8+Ae/3]:"")+E+(C&&"("===c?")":""),_)for(r=-1,s=e.length;++r(l=e.charCodeAt(r))||l>57){E=(46===l?o+e.slice(r+1):e.slice(r))+E,e=e.slice(0,r);break}}g&&!p&&(e=i(e,1/0));var x=h.length+e.length+E.length,D=x>1)+h+e+E+D.slice(x);break;default:e=D+h+e+E}return a(e)}return m=void 0===m?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),E.toString=function(){return e+""},E}return{format:c,formatPrefix:function(e,t){var n,i=c(((e=we(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor((n=t,((n=be(Math.abs(n)))?n[1]:NaN)/3)))),s=Math.pow(10,-r),o=Be[8+r/3];return function(e){return i(s*e)+o}}}}({thousands:",",grouping:[3],currency:["$",""]}),Se=De.format,De.formatPrefix;var ke=n(5715),Me=n.n(ke);class je extends g{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"IntModel",value:0})}}class Oe extends je{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"BoundedIntModel",max:100,min:0})}}class Ie extends l{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"SliderStyleModel"})}}Ie.styleProperties=Object.assign(Object.assign({},l.styleProperties),{handle_color:{selector:".noUi-handle",attribute:"background-color",default:null}});class Pe extends Oe{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"IntSliderModel",_view_name:"IntSliderView",step:1,orientation:"horizontal",readout:!0,readout_format:"d",continuous_update:!0,style:null,disabled:!1})}initialize(e,t){super.initialize(e,t),this.on("change:readout_format",this.update_readout_format,this),this.update_readout_format()}update_readout_format(){this.readout_formatter=Se(this.get("readout_format"))}}class Re extends Pe{}class Le extends d{constructor(){super(...arguments),this._parse_value=parseInt}render(){super.render(),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-slider"),this.el.classList.add("widget-hslider"),this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.slider_container=document.createElement("div"),this.slider_container.classList.add("slider-container"),this.slider_container.appendChild(this.$slider),this.el.appendChild(this.slider_container),this.readout=document.createElement("div"),this.el.appendChild(this.readout),this.readout.classList.add("widget-readout"),this.readout.contentEditable="true",this.readout.style.display="none",this.createSlider(),this.model.on("change:orientation",this.regenSlider,this),this.model.on("change:max",this.updateSliderOptions,this),this.model.on("change:min",this.updateSliderOptions,this),this.model.on("change:step",this.updateSliderOptions,this),this.model.on("change:value",this.updateSliderValue,this),this.update()}update(e){return void 0!==e&&e.updated_view===this||(this.model.get("disabled")?(this.readout.contentEditable="false",this.$slider.setAttribute("disabled",!0)):(this.readout.contentEditable="true",this.$slider.removeAttribute("disabled")),"vertical"===this.model.get("orientation")?(this.el.classList.remove("widget-hslider"),this.el.classList.add("widget-vslider"),this.el.classList.remove("widget-inline-hbox"),this.el.classList.add("widget-inline-vbox")):(this.el.classList.remove("widget-vslider"),this.el.classList.add("widget-hslider"),this.el.classList.remove("widget-inline-vbox"),this.el.classList.add("widget-inline-hbox")),this.model.get("readout")?(this.readout.style.display="",this.displayed.then((()=>{this.readout_overflow()?this.readout.classList.add("overflow"):this.readout.classList.remove("overflow")}))):this.readout.style.display="none"),super.update()}readout_overflow(){return this.readout.scrollWidth>this.readout.clientWidth}events(){return{"blur [contentEditable=true]":"handleTextChange","keydown [contentEditable=true]":"handleKeyDown"}}handleKeyDown(e){13===e.keyCode&&(e.preventDefault(),this.handleTextChange())}createSlider(){const e=this.model.get("orientation"),t=this.model.get("behavior");Me().create(this.$slider,{start:this.model.get("value"),connect:!0,behaviour:t,range:{min:this.model.get("min"),max:this.model.get("max")},step:this.model.get("step"),animate:!1,orientation:e,direction:"horizontal"===e?"ltr":"rtl",format:{from:e=>Number(e),to:e=>this._validate_slide_value(e)}}),this.$slider.noUiSlider.on("update",((e,t)=>{this.handleSliderUpdateEvent(e,t)})),this.$slider.noUiSlider.on("change",((e,t)=>{this.handleSliderChangeEvent(e,t)}))}regenSlider(e){this.$slider.noUiSlider.destroy(),this.createSlider()}_validate_slide_value(e){return Math.round(e)}}class Ne extends Le{constructor(){super(...arguments),this._range_regex=/^\s*([+-]?\d+)\s*[-:–]\s*([+-]?\d+)/}update(e){super.update(e);const t=this.model.get("value");this.readout.textContent=this.valueToString(t),this.model.get("value")!==t&&(this.model.set("value",t,{updated_view:this}),this.touch())}valueToString(e){const t=this.model.readout_formatter;return e.map((function(e){return t(e)})).join(" – ")}stringToValue(e){if(null===e)return null;const t=this._range_regex.exec(e);return t?[this._parse_value(t[1]),this._parse_value(t[2])]:null}handleTextChange(){let e=this.stringToValue(this.readout.textContent);const t=this.model.get("min"),n=this.model.get("max");null===e||isNaN(e[0])||isNaN(e[1])||e[0]>e[1]?this.readout.textContent=this.valueToString(this.model.get("value")):(e=[Math.max(Math.min(e[0],n),t),Math.max(Math.min(e[1],n),t)],e[0]!==this.model.get("value")[0]||e[1]!==this.model.get("value")[1]?(this.readout.textContent=this.valueToString(e),this.model.set("value",e),this.touch()):this.readout.textContent=this.valueToString(this.model.get("value")))}handleSliderChangeEvent(e,t){const n=e.map(this._validate_slide_value);this.readout.textContent=this.valueToString(n),this.handleSliderChanged(e,t)}handleSliderUpdateEvent(e,t){const n=e.map(this._validate_slide_value);this.readout.textContent=this.valueToString(n),this.model.get("continuous_update")&&this.handleSliderChanged(e,t)}handleSliderChanged(e,t){const n=e.map(this._validate_slide_value);this.model.set("value",n,{updated_view:this}),this.touch()}updateSliderOptions(e){this.$slider.noUiSlider.updateOptions({start:this.model.get("value"),range:{min:this.model.get("min"),max:this.model.get("max")},step:this.model.get("step")})}updateSliderValue(e,t,n){if(n.updated_view===this)return;const i=this.$slider.noUiSlider.get(),r=this.model.get("value");i[0]===r[0]&&i[1]===r[1]||this.$slider.noUiSlider.set(r)}}class Fe extends Le{update(e){super.update(e);const t=this.model.get("min"),n=this.model.get("max");let i=this.model.get("value");i>n?i=n:i=1){const e=n.substr(1);n=n[0]+e.replace(/[+-]/g,"")}t.value!==n&&(e.preventDefault(),t.value=n)}handleChanging(e){const t=e.target.value.trim();""===t||["-","-.",".","+.","+"].indexOf(t)>=0||this.model.get("continuous_update")&&this.handleChanged(e)}handleChanged(e){const t=e.target;let n=this._parse_value(t.value);if(isNaN(n))t.value=this.model.get("value");else{let e=n;void 0!==this.model.get("max")&&(e=Math.min(this.model.get("max"),e)),void 0!==this.model.get("min")&&(e=Math.max(this.model.get("min"),e)),e!==n&&(t.value=e,n=e),n!==this.model.get("value")&&(this.model.set("value",n,{updated_view:this}),this.touch())}}}class We extends l{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"ProgressStyleModel"})}}We.styleProperties=Object.assign(Object.assign({},l.styleProperties),{bar_color:{selector:".progress-bar",attribute:"background-color",default:null}});class qe extends Oe{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"IntProgressModel",_view_name:"ProgressView",orientation:"horizontal",bar_style:"",style:null})}}class $e extends d{initialize(e){super.initialize(e),this.listenTo(this.model,"change:bar_style",this.update_bar_style),this.luminoWidget.addClass("jupyter-widgets")}render(){super.render();const e="horizontal"===this.model.get("orientation")?"widget-hprogress":"widget-vprogress";this.el.classList.add(e),this.progress=document.createElement("div"),this.progress.classList.add("progress"),this.progress.style.position="relative",this.el.appendChild(this.progress),this.bar=document.createElement("div"),this.bar.classList.add("progress-bar"),this.bar.style.position="absolute",this.bar.style.bottom="0px",this.bar.style.left="0px",this.progress.appendChild(this.bar),this.update(),this.set_bar_style()}update(){const e=this.model.get("value"),t=this.model.get("max"),n=this.model.get("min"),i=100*(e-n)/(t-n);return"horizontal"===this.model.get("orientation")?(this.el.classList.remove("widget-inline-vbox"),this.el.classList.remove("widget-vprogress"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-hprogress"),this.bar.style.width=i+"%",this.bar.style.height="100%"):(this.el.classList.remove("widget-inline-hbox"),this.el.classList.remove("widget-hprogress"),this.el.classList.add("widget-inline-vbox"),this.el.classList.add("widget-vprogress"),this.bar.style.width="100%",this.bar.style.height=i+"%"),super.update()}update_bar_style(){this.update_mapped_classes($e.class_map,"bar_style",this.bar)}set_bar_style(){this.set_mapped_classes($e.class_map,"bar_style",this.bar)}}$e.class_map={success:["progress-bar-success"],info:["progress-bar-info"],warning:["progress-bar-warning"],danger:["progress-bar-danger"]};class Ve extends Oe{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"PlayModel",_view_name:"PlayView",repeat:!1,playing:!1,show_repeat:!0,interval:100,step:1,disabled:!1})}initialize(e,t){super.initialize(e,t)}loop(){if(!this.get("playing"))return;const e=this.get("value")+this.get("step");e<=this.get("max")?(this.set("value",e),this.schedule_next()):this.get("repeat")?(this.set("value",this.get("min")),this.schedule_next()):this.pause(),this.save_changes()}schedule_next(){this._timerId=window.setTimeout(this.loop.bind(this),this.get("interval"))}stop(){this.pause(),this.set("value",this.get("min")),this.save_changes()}pause(){window.clearTimeout(this._timerId),this._timerId=void 0,this.set("playing",!1),this.save_changes()}animate(){void 0===this._timerId&&(this.get("value")===this.get("max")?(this.set("value",this.get("min")),this.schedule_next(),this.save_changes()):this.loop(),this.save_changes())}play(){this.set("playing",!this.get("playing")),this.save_changes()}repeat(){this.set("repeat",!this.get("repeat")),this.save_changes()}}class Ge extends i.DOMWidgetView{render(){super.render(),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-play"),this.playPauseButton=document.createElement("button"),this.stopButton=document.createElement("button"),this.repeatButton=document.createElement("button"),this.playPauseButton.className="jupyter-button",this.stopButton.className="jupyter-button",this.repeatButton.className="jupyter-button",this.el.appendChild(this.playPauseButton),this.el.appendChild(this.stopButton),this.el.appendChild(this.repeatButton);const e=document.createElement("i");e.className="fa fa-play",this.playPauseButton.appendChild(e);const t=document.createElement("i");t.className="fa fa-stop",this.stopButton.appendChild(t);const n=document.createElement("i");n.className="fa fa-retweet",this.repeatButton.appendChild(n),this.playPauseButton.onclick=this.model.play.bind(this.model),this.stopButton.onclick=this.model.stop.bind(this.model),this.repeatButton.onclick=this.model.repeat.bind(this.model),this.listenTo(this.model,"change:playing",this.onPlayingChanged),this.listenTo(this.model,"change:repeat",this.updateRepeat),this.listenTo(this.model,"change:show_repeat",this.updateRepeat),this.updatePlaying(),this.updateRepeat(),this.update()}update(){const e=this.model.get("disabled");this.playPauseButton.disabled=e,this.stopButton.disabled=e,this.repeatButton.disabled=e,this.updatePlaying()}onPlayingChanged(){this.updatePlaying();const e=this.model.previous("playing"),t=this.model.get("playing");!e&&t?this.model.animate():this.model.pause()}updatePlaying(){const e=this.model.get("playing");this.playPauseButton.getElementsByTagName("i")[0].className=e?"fa fa-pause":"fa fa-play"}updateRepeat(){const e=this.model.get("repeat");this.repeatButton.style.display=this.model.get("show_repeat")?this.playPauseButton.style.display:"none",e?this.repeatButton.classList.add("mod-active"):this.repeatButton.classList.remove("mod-active")}}class Ke extends g{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"FloatModel",value:0})}}class Ye extends Ke{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"BoundedFloatModel",max:100,min:0})}}class Je extends Ye{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"FloatSliderModel",_view_name:"FloatSliderView",step:1,orientation:"horizontal",_range:!1,readout:!0,readout_format:".2f",slider_color:null,continuous_update:!0,disabled:!1})}initialize(e,t){super.initialize(e,t),this.on("change:readout_format",this.update_readout_format,this),this.update_readout_format()}update_readout_format(){this.readout_formatter=Se(this.get("readout_format"))}}class Xe extends Ye{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"FloatLogSliderModel",_view_name:"FloatLogSliderView",step:.1,orientation:"horizontal",_range:!1,readout:!0,readout_format:".3g",slider_color:null,continuous_update:!0,disabled:!1,base:10,value:1,min:0,max:4})}initialize(e,t){super.initialize(e,t),this.on("change:readout_format",this.update_readout_format,this),this.update_readout_format()}update_readout_format(){this.readout_formatter=Se(this.get("readout_format"))}}class Ze extends Je{}class Qe extends Fe{constructor(){super(...arguments),this._parse_value=parseFloat}_validate_slide_value(e){return e}}class et extends Le{constructor(){super(...arguments),this._parse_value=parseFloat}update(e){super.update(e);const t=this.model.get("value");this.readout.textContent=this.valueToString(t)}logCalc(e){const t=this.model.get("min"),n=this.model.get("max"),i=this.model.get("base");let r=Math.log(e)/Math.log(i);return r>n?r=n:rNumber(e),to:e=>e}}),this.$slider.noUiSlider.on("update",((e,t)=>{this.handleSliderUpdateEvent(e,t)})),this.$slider.noUiSlider.on("change",((e,t)=>{this.handleSliderChangeEvent(e,t)}))}valueToString(e){return(0,this.model.readout_formatter)(e)}stringToValue(e){return null===e?NaN:this._parse_value(e)}handleTextChange(){let e=this.stringToValue(this.readout.textContent);const t=this.model.get("min"),n=this.model.get("max"),i=this.model.get("base");isNaN(e)?this.readout.textContent=this.valueToString(this.model.get("value")):(e=Math.max(Math.min(e,Math.pow(i,n)),Math.pow(i,t)),e!==this.model.get("value")?(this.readout.textContent=this.valueToString(e),this.model.set("value",e),this.touch()):this.readout.textContent=this.valueToString(this.model.get("value")))}handleSliderUpdateEvent(e,t){const n=this.model.get("base"),i=Math.pow(n,this._validate_slide_value(e[0]));this.readout.textContent=this.valueToString(i),this.model.get("continuous_update")&&this.handleSliderChanged(e,t)}handleSliderChangeEvent(e,t){const n=this.model.get("base"),i=Math.pow(n,this._validate_slide_value(e[0]));this.readout.textContent=this.valueToString(i),this.handleSliderChanged(e,t)}handleSliderChanged(e,t){if(this._updating_slider)return;const n=this.model.get("base"),i=Math.pow(n,this._validate_slide_value(e[0]));this.model.set("value",i,{updated_view:this}),this.touch()}updateSliderValue(e,t,n){if(n.updated_view===this)return;const i=this.logCalc(this.model.get("value"));this.$slider.noUiSlider.set(i)}updateSliderOptions(e){this.$slider.noUiSlider.updateOptions({start:this.logCalc(this.model.get("value")),range:{min:this.model.get("min"),max:this.model.get("max")},step:this.model.get("step")})}_validate_slide_value(e){return e}}class tt extends Ne{constructor(){super(...arguments),this._parse_value=parseFloat,this._range_regex=/^\s*([+-]?(?:\d*\.?\d+|\d+\.)(?:[eE][-:]?\d+)?)\s*[-:–]\s*([+-]?(?:\d*\.?\d+|\d+\.)(?:[eE][+-]?\d+)?)/}_validate_slide_value(e){return e}}class nt extends Ke{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"FloatTextModel",_view_name:"FloatTextView",disabled:!1,continuous_update:!1})}}class it extends Ye{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"BoundedFloatTextModel",_view_name:"FloatTextView",disabled:!1,continuous_update:!1,step:.1})}}class rt extends He{constructor(){super(...arguments),this._parse_value=parseFloat,this._default_step="any"}handleKeypress(e){e.stopPropagation()}handleKeyUp(e){}}class st extends Ye{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"FloatProgressModel",_view_name:"ProgressView",orientation:"horizontal",bar_style:"",style:null})}}class ot extends f{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"ControllerButtonModel",_view_name:"ControllerButtonView",value:0,pressed:!1})}}class at extends i.DOMWidgetView{render(){this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-controller-button"),this.el.style.width="fit-content",this.support=document.createElement("div"),this.support.style.position="relative",this.support.style.margin="1px",this.support.style.width="16px",this.support.style.height="16px",this.support.style.border="1px solid black",this.support.style.background="lightgray",this.el.appendChild(this.support),this.bar=document.createElement("div"),this.bar.style.position="absolute",this.bar.style.width="100%",this.bar.style.bottom="0px",this.bar.style.background="gray",this.support.appendChild(this.bar),this.update(),this.label=document.createElement("div"),this.label.textContent=this.model.get("description"),this.label.style.textAlign="center",this.el.appendChild(this.label)}update(){this.bar.style.height=100*this.model.get("value")+"%"}}class lt extends f{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"ControllerAxisModel",_view_name:"ControllerAxisView",value:0})}}class ut extends i.DOMWidgetView{render(){this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-controller-axis"),this.el.style.width="16px",this.el.style.padding="4px",this.support=document.createElement("div"),this.support.style.position="relative",this.support.style.margin="1px",this.support.style.width="4px",this.support.style.height="64px",this.support.style.border="1px solid black",this.support.style.background="lightgray",this.bullet=document.createElement("div"),this.bullet.style.position="absolute",this.bullet.style.margin="-3px",this.bullet.style.boxSizing="unset",this.bullet.style.width="10px",this.bullet.style.height="10px",this.bullet.style.background="gray",this.label=document.createElement("div"),this.label.textContent=this.model.get("description"),this.label.style.textAlign="center",this.support.appendChild(this.bullet),this.el.appendChild(this.support),this.el.appendChild(this.label),this.update()}update(){this.bullet.style.top=50*(this.model.get("value")+1)+"%"}}class dt extends f{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"ControllerModel",_view_name:"ControllerView",index:0,name:"",mapping:"",connected:!1,timestamp:0,buttons:[],axes:[]})}initialize(e,t){super.initialize(e,t),void 0===navigator.getGamepads?(this.readout="This browser does not support gamepads.",console.error(this.readout)):(this.readout="Connect gamepad and press any button.",this.get("connected")?this.update_loop():this.wait_loop())}wait_loop(){const e=this.get("index"),t=navigator.getGamepads()[e];t?this.setup(t).then((e=>{this.set(e),this.save_changes(),window.requestAnimationFrame(this.update_loop.bind(this))})):window.requestAnimationFrame(this.wait_loop.bind(this))}setup(e){return this.set({name:e.id,mapping:e.mapping,connected:e.connected,timestamp:e.timestamp}),i.resolvePromisesDict({buttons:Promise.all(e.buttons.map(((e,t)=>this._create_button_model(t)))),axes:Promise.all(e.axes.map(((e,t)=>this._create_axis_model(t))))})}update_loop(){const e=this.get("index"),t=this.get("name"),n=navigator.getGamepads()[e];n&&e===n.index&&t===n.id?(this.set({timestamp:n.timestamp,connected:n.connected}),this.save_changes(),this.get("buttons").forEach((function(e,t){e.set({value:n.buttons[t].value,pressed:n.buttons[t].pressed}),e.save_changes()})),this.get("axes").forEach((function(e,t){e.set("value",n.axes[t]),e.save_changes()})),window.requestAnimationFrame(this.update_loop.bind(this))):this.reset_gamepad()}reset_gamepad(){this.get("buttons").forEach((function(e){e.close()})),this.get("axes").forEach((function(e){e.close()})),this.set({name:"",mapping:"",connected:!1,timestamp:0,buttons:[],axes:[]}),this.save_changes(),window.requestAnimationFrame(this.wait_loop.bind(this))}_create_button_model(e){return this.widget_manager.new_widget({model_name:"ControllerButtonModel",model_module:"@jupyter-widgets/controls",model_module_version:this.get("_model_module_version"),view_name:"ControllerButtonView",view_module:"@jupyter-widgets/controls",view_module_version:this.get("_view_module_version")}).then((function(t){return t.set("description",e),t}))}_create_axis_model(e){return this.widget_manager.new_widget({model_name:"ControllerAxisModel",model_module:"@jupyter-widgets/controls",model_module_version:this.get("_model_module_version"),view_name:"ControllerAxisView",view_module:"@jupyter-widgets/controls",view_module_version:this.get("_view_module_version")}).then((function(t){return t.set("description",e),t}))}}dt.serializers=Object.assign(Object.assign({},f.serializers),{buttons:{deserialize:i.unpack_models},axes:{deserialize:i.unpack_models}});class ct extends i.DOMWidgetView{_createElement(e){return this.luminoWidget=new i.JupyterLuminoPanelWidget({view:this}),this.luminoWidget.node}_setElement(e){if(this.el||e!==this.luminoWidget.node)throw new Error("Cannot reset the DOM element.");this.el=this.luminoWidget.node,this.$el=I()(this.luminoWidget.node)}initialize(e){super.initialize(e),this.button_views=new i.ViewList(this.add_button,null,this),this.listenTo(this.model,"change:buttons",((e,t)=>{this.button_views.update(t)})),this.axis_views=new i.ViewList(this.add_axis,null,this),this.listenTo(this.model,"change:axes",((e,t)=>{this.axis_views.update(t)})),this.listenTo(this.model,"change:name",this.update_label)}render(){this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-controller"),this.label=document.createElement("div"),this.el.appendChild(this.label),this.axis_box=new j.Zk,this.axis_box.node.style.display="flex",this.luminoWidget.addWidget(this.axis_box),this.button_box=new j.Zk,this.button_box.node.style.display="flex",this.luminoWidget.addWidget(this.button_box),this.button_views.update(this.model.get("buttons")),this.axis_views.update(this.model.get("axes")),this.update_label()}update_label(){this.label.textContent=this.model.get("name")||this.model.readout}add_button(e){const t=new j.x0;return this.button_box.addWidget(t),this.create_child_view(e).then((e=>{const n=k.Rw.firstIndexOf(this.button_box.widgets,t);return this.button_box.insertWidget(n,e.luminoWidget),t.dispose(),e})).catch((0,i.reject)("Could not add child button view to controller",!0))}add_axis(e){const t=new j.x0;return this.axis_box.addWidget(t),this.create_child_view(e).then((e=>{const n=k.Rw.firstIndexOf(this.axis_box.widgets,t);return this.axis_box.insertWidget(n,e.luminoWidget),t.dispose(),e})).catch((0,i.reject)("Could not add child axis view to controller",!0))}remove(){super.remove(),this.button_views.remove(),this.axis_views.remove()}}class ht extends g{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"SelectionModel",index:"",_options_labels:[],disabled:!1})}}class pt extends d{render(){super.render(),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox")}update(){super.update(),this.listbox&&(this.listbox.disabled=this.model.get("disabled")),this.updateTabindex(),this.updateTooltip()}updateTabindex(){if(!this.listbox)return;const e=this.model.get("tabbable");!0===e?this.listbox.setAttribute("tabIndex","0"):!1===e?this.listbox.setAttribute("tabIndex","-1"):null===e&&this.listbox.removeAttribute("tabIndex")}updateTooltip(){if(!this.listbox)return;const e=this.model.get("tooltip");e?0===this.model.get("description").length&&this.listbox.setAttribute("title",e):this.listbox.removeAttribute("title")}}class ft extends ht{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"DropdownModel",_view_name:"DropdownView",button_style:""})}}class gt extends pt{render(){super.render(),this.el.classList.add("widget-dropdown"),this.listbox=document.createElement("select"),this.listbox.id=this.label.htmlFor=(0,i.uuid)(),this.el.appendChild(this.listbox),this._updateOptions(),this.update()}update(e){(null==e?void 0:e.updated_view)!==this&&this.model.hasChanged("_options_labels")&&this._updateOptions();const t=this.model.get("index");return this.listbox.selectedIndex=null===t?-1:t,super.update()}_updateOptions(){this.listbox.textContent="";const e=this.model.get("_options_labels");for(let t=0;te.value));let i=t.length!==n.length;if(!i)for(let e=0,r=t.length;e{const n=document.createElement("label");n.textContent=e,this.container.appendChild(n);const i=document.createElement("input");i.setAttribute("type","radio"),i.value=t.toString(),i.setAttribute("data-value",encodeURIComponent(e)),n.appendChild(i)}))),t.forEach(((e,t)=>{const n='input[data-value="'+encodeURIComponent(e)+'"]',i=this.container.querySelectorAll(n);if(i.length>0){const e=i[0];e.checked=this.model.get("index")===t,e.disabled=this.model.get("disabled")}})),setTimeout(this.adjustPadding,0,this),super.update(e)}adjustPadding(e){const t=window.getComputedStyle(e.el),n=parseInt(t.marginTop,10)+parseInt(t.marginBottom,10),i=e.label.offsetHeight+n,r=window.getComputedStyle(e.container),s=parseInt(r.marginBottom,10),o=(e.el.offsetHeight+n-s)%i,a=0===o?0:i-o;e.container.style.marginBottom=a+"px"}events(){return{'click input[type="radio"]':"_handle_click"}}_handle_click(e){const t=e.target;this.model.set("index",parseInt(t.value,10),{updated_view:this}),this.touch()}handle_message(e){if("focus"==e.do)this.container.firstElementChild.focus();else if("blur"==e.do)for(let e=0;ee.value));let d=!1;for(let e=0,r=t.length;e{let i;i=0!==e.trim().length||n[t]&&0!==n[t].trim().length?s(e):" ";const l=document.createElement("i"),u=document.createElement("button");n[t]&&(l.className="fa fa-"+n[t]),u.setAttribute("type","button"),u.className="widget-toggle-button jupyter-button",r&&u.classList.add(r),u.innerHTML=i,u.setAttribute("data-value",encodeURIComponent(e)),u.setAttribute("value",t.toString()),u.appendChild(l),u.disabled=a,o[t]&&u.setAttribute("title",o[t]),this.update_style_traits(u),this.buttongroup.appendChild(u)}))),t.forEach(((e,t)=>{const n='[data-value="'+encodeURIComponent(e)+'"]',i=this.buttongroup.querySelector(n);this.model.get("index")===t?i.classList.add("mod-active"):i.classList.remove("mod-active")})),this.stylePromise.then((function(e){e&&e.style()})),super.update(e)}update_style_traits(e){for(const t in this._css_state)if(Object.prototype.hasOwnProperty.call(this._css_state,"name"))if("margin"===t)this.buttongroup.style[t]=this._css_state[t];else if("width"!==t)if(e)e.style[t]=this._css_state[t];else{const e=this.buttongroup.querySelectorAll("button");e.length&&(e[0].style[t]=this._css_state[t])}}update_button_style(){const e=this.buttongroup.querySelectorAll("button");for(let t=0;tNumber(e),to:e=>Math.round(e)}}),this.$slider.noUiSlider.on("update",((e,t)=>{this.handleSliderUpdateEvent(e,t)})),this.$slider.noUiSlider.on("change",((e,t)=>{this.handleSliderChangeEvent(e,t)}))}events(){return{slide:"handleSliderChange",slidestop:"handleSliderChanged"}}updateSelection(){const e=this.model.get("index");this.updateReadout(e)}updateReadout(e){const t=this.model.get("_options_labels")[e];this.readout.textContent=t}handleSliderUpdateEvent(e,t){const n=e[0];this.updateReadout(n),this.model.get("continuous_update")&&this.handleSliderChanged(e,t)}handleSliderChangeEvent(e,t){const n=e[0];this.updateReadout(n),this.handleSliderChanged(e,t)}handleSliderChanged(e,t){const n=e[0];this.updateReadout(n),this.model.set("index",n,{updated_view:this}),this.touch()}updateSliderOptions(e){const t=this.model.get("_options_labels").length-1;this.$slider.noUiSlider.updateOptions({start:this.model.get("index"),range:{min:0,max:t},step:1})}updateSliderValue(e,t,n){if(n.updated_view===this)return;const i=this.$slider.noUiSlider.get(),r=this.model.get("index");i!==r&&this.$slider.noUiSlider.set(r)}}class xt extends ht{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"MultipleSelectionModel"})}}class Dt extends xt{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"SelectMultipleModel",_view_name:"SelectMultipleView",rows:null})}}class St extends vt{initialize(e){super.initialize(e),this.listbox.multiple=!0}render(){super.render(),this.el.classList.add("widget-select-multiple")}updateSelection(){const e=this.model.get("index")||[],t=this.listbox.options;this.listbox.selectedIndex=-1,e.forEach((e=>{t[e].selected=!0}))}_handle_change(){const e=Array.prototype.map.call(this.listbox.selectedOptions||[],(function(e){return e.index}));this.model.set("index",e,{updated_view:this}),this.touch()}}class Tt extends xt{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"SelectionSliderModel",_view_name:"SelectionSliderView",orientation:"horizontal",readout:!0,continuous_update:!0})}}class Bt extends Ct{render(){super.render()}updateSelection(e){e=e||this.model.get("index"),this.updateReadout(e)}updateReadout(e){const t=this.model.get("_options_labels"),n=t[e[0]],i=t[e[1]];this.readout.textContent=`${n}-${i}`}handleSliderUpdateEvent(e,t){const n=e.map(Math.trunc);this.updateReadout(n),this.model.get("continuous_update")&&this.handleSliderChanged(e,t)}handleSliderChanged(e,t){const n=e.map(Math.round);this.updateReadout(n),this.model.set("index",n.slice(),{updated_view:this}),this.touch()}updateSliderValue(e,t,n){if(n.updated_view===this)return;const i=this.$slider.noUiSlider.get().map(Math.round),r=this.model.get("index").map(Math.round);i[0]===r[0]&&i[1]===r[1]||this.$slider.noUiSlider.set(r)}}var kt,Mt,jt,Ot,It,Pt=n(8571);!function(e){e.copyText=function(e){var t=document.body,n=function(i){i.preventDefault(),i.stopPropagation(),i.clipboardData.setData("text",e),t.removeEventListener("copy",n,!0)};t.addEventListener("copy",n,!0),document.execCommand("copy")}}(kt||(kt={})),function(e){e.boxSizing=function(e){var t=window.getComputedStyle(e),n=parseFloat(t.borderTopWidth)||0,i=parseFloat(t.borderLeftWidth)||0,r=parseFloat(t.borderRightWidth)||0,s=parseFloat(t.borderBottomWidth)||0,o=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingLeft)||0,l=parseFloat(t.paddingRight)||0,u=parseFloat(t.paddingBottom)||0;return{borderTop:n,borderLeft:i,borderRight:r,borderBottom:s,paddingTop:o,paddingLeft:a,paddingRight:l,paddingBottom:u,horizontalSum:i+a+l+r,verticalSum:n+o+u+s}},e.sizeLimits=function(e){var t=window.getComputedStyle(e),n=parseFloat(t.minWidth)||0,i=parseFloat(t.minHeight)||0,r=parseFloat(t.maxWidth)||1/0,s=parseFloat(t.maxHeight)||1/0;return{minWidth:n,minHeight:i,maxWidth:r=Math.max(n,r),maxHeight:s=Math.max(i,s)}},e.hitTest=function(e,t,n){var i=e.getBoundingClientRect();return t>=i.left&&t=i.top&&n=n.bottom||(i.topn.bottom&&i.height>=n.height?e.scrollTop-=n.top-i.top:(i.topn.height||i.bottom>n.bottom&&i.height0;)if(h(n))t++;else if(h(i))d++;else if(h(r))d++;else if(h(o))c++;else if(h(a))d++;else if(h(s))c++;else if(!h(l))return 0;return(t=Math.min(t,255))<<16|(d=Math.min(d,255))<<8|Math.min(c,255)};var n=/^#[^\s\+>~#\.\[:]+/,i=/^\.[^\s\+>~#\.\[:]+/,r=/^\[[^\]]+\]/,s=/^[^\s\+>~#\.\[:]+/,o=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,a=/^:[^\s\+>~#\.\[:]+/,l=/^[\s\+>~\*]+/,u=/:not\(([^\)]+)\)/g}(It||(It={}));class Rt extends j.Zk{constructor(){super(...arguments),this._widgetRemoved=new Pt.Signal(this)}get widgetRemoved(){return this._widgetRemoved}onChildRemoved(e){this._widgetRemoved.emit(e.child)}}class Lt extends j.x0{constructor(e={}){super(),this._currentChanged=new Pt.Signal(this),this.addClass("jupyter-widget-TabPanel"),this.tabBar=new j.VQ(e),this.tabBar.addClass("jupyter-widget-TabPanel-tabBar"),this.tabContents=new Rt,this.tabContents.addClass("jupyter-widget-TabPanel-tabContents"),this.tabBar.tabMoved.connect(this._onTabMoved,this),this.tabBar.currentChanged.connect(this._onCurrentChanged,this),this.tabBar.tabCloseRequested.connect(this._onTabCloseRequested,this),this.tabBar.tabActivateRequested.connect(this._onTabActivateRequested,this),this.tabContents.widgetRemoved.connect(this._onWidgetRemoved,this);const t=new j.DG;t.addWidget(this.tabBar),t.addWidget(this.tabContents),this.layout=t}get currentChanged(){return this._currentChanged}get currentIndex(){const e=this.tabBar.currentIndex;return-1===e?null:e}set currentIndex(e){this.tabBar.currentIndex=null===e?-1:e}get currentWidget(){const e=this.tabBar.currentTitle;return e?e.owner:null}set currentWidget(e){this.tabBar.currentTitle=e?e.title:null}get tabsMovable(){return this.tabBar.tabsMovable}set tabsMovable(e){this.tabBar.tabsMovable=e}get widgets(){return this.tabContents.widgets}addWidget(e){this.insertWidget(this.widgets.length,e)}insertWidget(e,t){t!==this.currentWidget&&t.hide(),this.tabContents.insertWidget(e,t),this.tabBar.insertTab(e,t.title)}_onCurrentChanged(e,t){const{previousIndex:n,previousTitle:i,currentIndex:r,currentTitle:s}=t,o=i?i.owner:null,a=s?s.owner:null;o&&o.hide(),a&&a.show(),this._currentChanged.emit({previousIndex:n,previousWidget:o,currentIndex:r,currentWidget:a}),(jt.IS_EDGE||jt.IS_IE)&&M.Mu.flush()}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabMoved(e,t){this.tabContents.insertWidget(t.toIndex,t.title.owner)}_onWidgetRemoved(e,t){this.tabBar.removeTab(t.title)}}class Nt{constructor(e,t={}){this._array=null,this._value=null,this._previousValue=null,this._selectionChanged=new Pt.Signal(this),this._array=e,this._insertBehavior=t.insertBehavior||"select-item-if-needed",this._removeBehavior=t.removeBehavior||"select-item-after"}get selectionChanged(){return this._selectionChanged}adjustSelectionForSet(e){const t=this.index,n=this.value;if(e!==t)return;this._updateSelectedValue();const i=this.value;this._previousValue=null,n!==i&&this._selectionChanged.emit({previousIndex:t,previousValue:n,currentIndex:t,currentValue:i})}get value(){return this._value}set value(e){null===e||null===this._array?this.index=null:this.index=k.Rw.firstIndexOf(this._array,e)}get index(){return this._index}set index(e){let t;if(null!==e&&null!==this._array?(t=Math.floor(e),(t<0||t>=this._array.length)&&(t=null)):t=null,this._index===t)return;const n=this._index,i=this._value;this._index=t,this._updateSelectedValue(),this._previousValue=i,this._selectionChanged.emit({previousIndex:n,previousValue:i,currentIndex:t,currentValue:this._value})}get insertBehavior(){return this._insertBehavior}set insertBehavior(e){this._insertBehavior=e}get removeBehavior(){return this._removeBehavior}set removeBehavior(e){this._removeBehavior=e}adjustSelectionForInsert(e,t){const n=this._value,i=this._index,r=this._insertBehavior;if("select-item"===r||"select-item-if-needed"===r&&null===i)return this._index=e,this._value=t,this._previousValue=n,void this._selectionChanged.emit({previousIndex:i,previousValue:n,currentIndex:e,currentValue:t});null!==i&&i>=e&&this._index++}clearSelection(){const e=this._index,t=this._value;this._index=null,this._value=null,this._previousValue=null,null!==e&&this._selectionChanged.emit({previousIndex:e,previousValue:t,currentIndex:this._index,currentValue:this._value})}adjustSelectionForRemove(e,t){if(null===this._index)return;const n=this._index,i=this._removeBehavior;if(n===e){if(!this._array||0===this._array.length)return this._index=null,this._value=null,this._previousValue=null,void this._selectionChanged.emit({previousIndex:e,previousValue:t,currentIndex:this._index,currentValue:this._value});if("select-item-after"===i)return this._index=Math.min(e,this._array.length-1),this._updateSelectedValue(),this._previousValue=null,void this._selectionChanged.emit({previousIndex:e,previousValue:t,currentIndex:this._index,currentValue:this._value});if("select-item-before"===i)return this._index=Math.max(0,e-1),this._updateSelectedValue(),this._previousValue=null,void this._selectionChanged.emit({previousIndex:e,previousValue:t,currentIndex:this._index,currentValue:this._value});if("select-previous-item"===i)return this._previousValue?this.value=this._previousValue:(this._index=Math.min(e,this._array.length-1),this._updateSelectedValue()),this._previousValue=null,void this._selectionChanged.emit({previousIndex:e,previousValue:t,currentIndex:this._index,currentValue:this.value});this._index=null,this._value=null,this._previousValue=null,this._selectionChanged.emit({previousIndex:e,previousValue:t,currentIndex:this._index,currentValue:this._value})}else n>e&&this._index--}_updateSelectedValue(){const e=this._index;this._value=null!==e&&this._array?this._array[e]:null}}const Ft="jupyter-widget-Collapse-open";class zt extends j.x0{constructor(e){super(e),this._collapseChanged=new Pt.Signal(this),this.addClass("jupyter-widget-Collapse"),this._header=new j.x0,this._header.addClass("jupyter-widget-Collapse-header"),this._header.node.addEventListener("click",this);const t=document.createElement("i");t.classList.add("fa","fa-fw","fa-caret-right"),this._header.node.appendChild(t),this._header.node.appendChild(document.createElement("span")),this._content=new j.Zk,this._content.addClass("jupyter-widget-Collapse-contents");const n=new j.DG;this.layout=n,n.addWidget(this._header),n.addWidget(this._content),e.widget&&(this.widget=e.widget),this.collapsed=!1}dispose(){this.isDisposed||(super.dispose(),this._header=null,this._widget=null,this._content=null)}get widget(){return this._widget}set widget(e){const t=this._widget;t&&(t.disposed.disconnect(this._onChildDisposed,this),t.title.changed.disconnect(this._onTitleChanged,this),t.parent=null),this._widget=e,e.disposed.connect(this._onChildDisposed,this),e.title.changed.connect(this._onTitleChanged,this),this._onTitleChanged(e.title),this._content.addWidget(e)}get collapsed(){return this._collapsed}set collapsed(e){e!==this._collapsed&&(e?this._collapse():this._uncollapse())}toggle(){this.collapsed=!this.collapsed}get collapseChanged(){return this._collapseChanged}_collapse(){this._collapsed=!0,this._content&&this._content.hide(),this.removeClass(Ft),this._header.node.children[0].classList.add("fa-caret-right"),this._header.node.children[0].classList.remove("fa-caret-down"),this._collapseChanged.emit(void 0)}_uncollapse(){this._collapsed=!1,this._content&&this._content.show(),this.addClass(Ft),this._header.node.children[0].classList.add("fa-caret-down"),this._header.node.children[0].classList.remove("fa-caret-right"),this._collapseChanged.emit(void 0)}handleEvent(e){"click"===e.type&&this._evtClick(e)}_evtClick(e){this.toggle()}_onTitleChanged(e){this._header.node.children[1].textContent=this._widget.title.label}_onChildDisposed(e){this.dispose()}}const Ut="jupyter-widget-Accordion-child-active";class Ht extends j.Zk{constructor(e){super(e),this._selection=new Nt(this.widgets),this._selection.selectionChanged.connect(this._onSelectionChanged,this),this.addClass("jupyter-widget-Accordion")}get collapseWidgets(){return this.layout.widgets}get selection(){return this._selection}indexOf(e){return k.Rw.findFirstIndex(this.collapseWidgets,(t=>t.widget===e))}addWidget(e){const t=this._wrapWidget(e);return t.collapsed=!0,super.addWidget(t),this._selection.adjustSelectionForInsert(this.widgets.length-1,t),t}insertWidget(e,t){const n=this._wrapWidget(t);n.collapsed=!0,super.insertWidget(e,n),this._selection.adjustSelectionForInsert(e,n)}removeWidget(e){const t=this.indexOf(e);if(t>=0){const n=this.collapseWidgets[t];e.parent=null,n.dispose(),this._selection.adjustSelectionForRemove(t,null)}}_wrapWidget(e){const t=new zt({widget:e});return t.addClass("jupyter-widget-Accordion-child"),t.collapseChanged.connect(this._onCollapseChange,this),t}_onCollapseChange(e){e.collapsed?this._selection.value===e&&e.collapsed&&(this._selection.value=null):this._selection.value=e}_onSelectionChanged(e,t){const n=t.previousValue,i=t.currentValue;n&&(n.collapsed=!0,n.removeClass(Ut)),i&&(i.collapsed=!1,i.addClass(Ut))}}class Wt extends P{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"SelectionContainerModel",selected_index:null,titles:[]})}}class qt extends Wt{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"AccordionModel",_view_name:"AccordionView"})}}class $t extends Ht{constructor(e){const t=e.view;delete e.view,super(e),this._view=t}processMessage(e){var t;super.processMessage(e),null===(t=this._view)||void 0===t||t.processLuminoMessage(e)}dispose(){this.isDisposed||(super.dispose(),this._view.remove(),this._view=null)}}class Vt extends i.DOMWidgetView{_createElement(e){return this.luminoWidget=new $t({view:this}),this.luminoWidget.node}_setElement(e){if(this.el||e!==this.luminoWidget.node)throw new Error("Cannot reset the DOM element.");this.el=this.luminoWidget.node,this.$el=I()(this.luminoWidget.node)}initialize(e){super.initialize(e),this.children_views=new i.ViewList(this.add_child_view,this.remove_child_view,this),this.listenTo(this.model,"change:children",(()=>this.updateChildren())),this.listenTo(this.model,"change:selected_index",(()=>this.update_selected_index())),this.listenTo(this.model,"change:titles",(()=>this.update_titles()))}render(){var e;super.render();const t=this.luminoWidget;t.addClass("jupyter-widgets"),t.addClass("widget-accordion"),t.addClass("widget-container"),t.selection.selectionChanged.connect((e=>{this.updatingChildren||(this.model.set("selected_index",t.selection.index),this.touch())})),null===(e=this.children_views)||void 0===e||e.update(this.model.get("children")),this.update_titles(),this.update_selected_index()}updateChildren(){var e;this.updatingChildren=!0,this.luminoWidget.selection.index=null,null===(e=this.children_views)||void 0===e||e.update(this.model.get("children")),this.update_selected_index(),this.updatingChildren=!1}update_titles(){const e=this.luminoWidget.collapseWidgets,t=this.model.get("titles");for(let n=0;n{const t=e.luminoWidget;return t.title.label=r.title.label,n.collapseWidgets[n.indexOf(r)].widget=t,r.dispose(),e})).catch((0,i.reject)("Could not add child view to box",!0))}remove(){this.children_views=null,super.remove()}}class Gt extends Wt{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"TabModel",_view_name:"TabView"})}}class Kt extends Lt{constructor(e){const t=e.view;delete e.view,super(e),this._view=t,M.Mu.installMessageHook(this.tabContents,((e,t)=>(this._view.processLuminoMessage(t),!0)))}dispose(){this.isDisposed||(super.dispose(),this._view.remove(),this._view=null)}}class Yt extends i.DOMWidgetView{constructor(){super(...arguments),this.updatingTabs=!1}_createElement(e){return this.luminoWidget=new Kt({view:this}),this.luminoWidget.node}_setElement(e){if(this.el||e!==this.luminoWidget.node)throw new Error("Cannot reset the DOM element.");this.el=this.luminoWidget.node,this.$el=I()(this.luminoWidget.node)}initialize(e){super.initialize(e),this.childrenViews=new i.ViewList(this.addChildView,(e=>{e.remove()}),this),this.listenTo(this.model,"change:children",(()=>this.updateTabs())),this.listenTo(this.model,"change:titles",(()=>this.updateTitles()))}render(){super.render();const e=this.luminoWidget;e.addClass("jupyter-widgets"),e.addClass("widget-container"),e.addClass("jupyter-widget-tab"),e.addClass("widget-tab"),e.tabsMovable=!0,e.tabBar.insertBehavior="none",e.tabBar.currentChanged.connect(this._onTabChanged,this),e.tabBar.tabMoved.connect(this._onTabMoved,this),e.tabBar.addClass("widget-tab-bar"),e.tabContents.addClass("widget-tab-contents"),e.tabBar.tabsMovable=!1,this.updateTabs(),this.update()}updateTabs(){var e;this.updatingTabs=!0,this.luminoWidget.currentIndex=null,null===(e=this.childrenViews)||void 0===e||e.update(this.model.get("children")),this.luminoWidget.currentIndex=this.model.get("selected_index"),this.updatingTabs=!1}addChildView(e,t){const n=this.model.get("titles")[t]||"",r=this.luminoWidget,s=new j.x0;return s.title.label=n,r.addWidget(s),this.create_child_view(e).then((e=>{const t=e.luminoWidget;t.title.label=s.title.label,t.title.closable=!1;const n=k.Rw.firstIndexOf(r.widgets,s);return r.insertWidget(n+1,t),s.dispose(),e})).catch((0,i.reject)("Could not add child view to box",!0))}update(){return this.updateSelectedIndex(),super.update()}updateTitles(){const e=this.model.get("titles")||[];(0,k.__)(this.luminoWidget.widgets,((t,n)=>{t.title.label=e[n]||""}))}updateSelectedIndex(){this.luminoWidget.currentIndex=this.model.get("selected_index")}remove(){this.childrenViews=null,super.remove()}_onTabChanged(e,t){if(!this.updatingTabs){const e=t.currentIndex;this.model.set("selected_index",-1===e?null:e),this.touch()}}_onTabMoved(e,t){const n=this.model.get("children").slice();k.Rw.move(n,t.fromIndex,t.toIndex),this.model.set("children",n),this.touch()}}class Jt extends Wt{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"StackModel",_view_name:"StackView"})}}class Xt extends N{initialize(e){super.initialize(e),this.listenTo(this.model,"change:selected_index",this.update_children)}update_children(){var e;let t;t=null===this.model.get("selected_index")?[]:[this.model.get("children")[this.model.get("selected_index")]],null===(e=this.children_views)||void 0===e||e.update(t).then((e=>{e.forEach((e=>{M.Mu.postMessage(e.luminoWidget,j.x0.ResizeMessage.UnknownSize)}))}))}}function Zt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Qt(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function en(){}var tn=.7,nn=1/tn,rn="\\s*([+-]?\\d+)\\s*",sn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",on="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",an=/^#([0-9a-f]{3,8})$/,ln=new RegExp(`^rgb\\(${rn},${rn},${rn}\\)$`),un=new RegExp(`^rgb\\(${on},${on},${on}\\)$`),dn=new RegExp(`^rgba\\(${rn},${rn},${rn},${sn}\\)$`),cn=new RegExp(`^rgba\\(${on},${on},${on},${sn}\\)$`),hn=new RegExp(`^hsl\\(${sn},${on},${on}\\)$`),pn=new RegExp(`^hsla\\(${sn},${on},${on},${sn}\\)$`),fn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function gn(){return this.rgb().formatHex()}function mn(){return this.rgb().formatRgb()}function vn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=an.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?bn(t):3===n?new yn(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?An(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?An(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ln.exec(e))?new yn(t[1],t[2],t[3],1):(t=un.exec(e))?new yn(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=dn.exec(e))?An(t[1],t[2],t[3],t[4]):(t=cn.exec(e))?An(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=hn.exec(e))?Dn(t[1],t[2]/100,t[3]/100,1):(t=pn.exec(e))?Dn(t[1],t[2]/100,t[3]/100,t[4]):fn.hasOwnProperty(e)?bn(fn[e]):"transparent"===e?new yn(NaN,NaN,NaN,0):null}function bn(e){return new yn(e>>16&255,e>>8&255,255&e,1)}function An(e,t,n,i){return i<=0&&(e=t=n=NaN),new yn(e,t,n,i)}function yn(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function wn(){return`#${xn(this.r)}${xn(this.g)}${xn(this.b)}`}function _n(){const e=En(this.opacity);return`${1===e?"rgb(":"rgba("}${Cn(this.r)}, ${Cn(this.g)}, ${Cn(this.b)}${1===e?")":`, ${e})`}`}function En(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Cn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function xn(e){return((e=Cn(e))<16?"0":"")+e.toString(16)}function Dn(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Tn(e,t,n,i)}function Sn(e){if(e instanceof Tn)return new Tn(e.h,e.s,e.l,e.opacity);if(e instanceof en||(e=vn(e)),!e)return new Tn;if(e instanceof Tn)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,a=s-r,l=(s+r)/2;return a?(o=t===s?(n-i)/a+6*(n0&&l<1?0:o,new Tn(o,a,l,e.opacity)}function Tn(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Bn(e){return(e=(e||0)%360)<0?e+360:e}function kn(e){return Math.max(0,Math.min(1,e||0))}function Mn(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function jn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}Zt(en,vn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:gn,formatHex:gn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Sn(this).formatHsl()},formatRgb:mn,toString:mn}),Zt(yn,(function(e,t,n,i){return 1===arguments.length?((r=e)instanceof en||(r=vn(r)),r?new yn((r=r.rgb()).r,r.g,r.b,r.opacity):new yn):new yn(e,t,n,null==i?1:i);var r}),Qt(en,{brighter(e){return e=null==e?nn:Math.pow(nn,e),new yn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?tn:Math.pow(tn,e),new yn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yn(Cn(this.r),Cn(this.g),Cn(this.b),En(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:wn,formatHex:wn,formatHex8:function(){return`#${xn(this.r)}${xn(this.g)}${xn(this.b)}${xn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:_n,toString:_n})),Zt(Tn,(function(e,t,n,i){return 1===arguments.length?Sn(e):new Tn(e,t,n,null==i?1:i)}),Qt(en,{brighter(e){return e=null==e?nn:Math.pow(nn,e),new Tn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?tn:Math.pow(tn,e),new Tn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new yn(Mn(e>=240?e-240:e+120,r,i),Mn(e,r,i),Mn(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Tn(Bn(this.h),kn(this.s),kn(this.l),En(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=En(this.opacity);return`${1===e?"hsl(":"hsla("}${Bn(this.h)}, ${100*kn(this.s)}%, ${100*kn(this.l)}%${1===e?")":`, ${e})`}`}}));class On{constructor(e,t,n){this.start=e,this.dx=t,this.max=n}isSelected(e){let t,n;return this.dx>=0?(t=this.start,n=this.start+this.dx):(t=this.start+this.dx,n=this.start),t<=e&&ethis.max&&(this.dx=this.max-this.start),this.start+this.dx<0&&(this.dx=-this.start)}}class In extends f{defaults(){return Object.assign(Object.assign({},super.defaults()),{value:[],placeholder:"​",allowed_tags:null,allow_duplicates:!0})}}class Pn extends i.DOMWidgetView{constructor(){super(...arguments),this.hoveredTag=null,this.hoveredTagIndex=null}render(){super.render(),this.el.classList.add("jupyter-widgets"),this.el.classList.add("jupyter-widget-tagsinput"),this.taginputWrapper=document.createElement("div"),this.model.get("value").length?this.taginputWrapper.style.display="none":this.taginputWrapper.style.display="inline-block",this.datalistID=(0,i.uuid)(),this.taginput=document.createElement("input"),this.taginput.classList.add("jupyter-widget-tag"),this.taginput.classList.add("jupyter-widget-taginput"),this.taginput.setAttribute("list",this.datalistID),this.taginput.setAttribute("type","text"),this.autocompleteList=document.createElement("datalist"),this.autocompleteList.id=this.datalistID,this.updateAutocomplete(),this.model.on("change:allowed_tags",this.updateAutocomplete.bind(this)),this.updatePlaceholder(),this.model.on("change:placeholder",this.updatePlaceholder.bind(this)),this.taginputWrapper.classList.add("widget-text"),this.taginputWrapper.appendChild(this.taginput),this.taginputWrapper.appendChild(this.autocompleteList),this.el.onclick=this.focus.bind(this),this.el.ondrop=e=>{const t=null==this.hoveredTagIndex?this.tags.length:this.hoveredTagIndex;return this.ondrop(e,t)},this.el.ondragover=this.ondragover.bind(this),this.taginput.onchange=this.handleValueAdded.bind(this),this.taginput.oninput=this.resizeInput.bind(this),this.taginput.onkeydown=this.handleKeyEvent.bind(this),this.taginput.onblur=this.loseFocus.bind(this),this.resizeInput(),this.inputIndex=this.model.get("value").length,this.selection=null,this.preventLoosingFocus=!1,this.update()}update(){this.preventLoosingFocus=!0,jn(this.el),this.tags=[];const e=this.model.get("value");this.inputIndex=e.length;for(const t in e){const n=parseInt(t),i=this.createTag(e[n],n,null!=this.selection&&this.selection.isSelected(n));i.draggable=!0,i.ondragstart=((e,t)=>n=>{this.ondragstart(n,e,t,this.model.model_id)})(n,e[n]),i.ondrop=(e=>t=>{this.ondrop(t,e)})(n),i.ondragover=this.ondragover.bind(this),i.ondragenter=(e=>t=>{this.ondragenter(t,e)})(n),i.ondragend=this.ondragend.bind(this),this.tags.push(i),this.el.appendChild(i)}return this.el.insertBefore(this.taginputWrapper,this.el.children[this.inputIndex]),this.model.get("value").length?this.taginputWrapper.style.display="none":this.taginputWrapper.style.display="inline-block",this.preventLoosingFocus=!1,super.update()}updateAutocomplete(){jn(this.autocompleteList);const e=this.model.get("allowed_tags");for(const t of e){const e=document.createElement("option");e.value=t,this.autocompleteList.appendChild(e)}}updatePlaceholder(){this.taginput.placeholder=this.model.get("placeholder"),this.resizeInput()}updateTags(){const e=this.model.get("value");for(const t in this.tags){const n=parseInt(t);this.updateTag(this.tags[n],e[n],n,null!=this.selection&&this.selection.isSelected(n))}}handleValueAdded(e){const t=this.taginput.value.replace(/^\s+|\s+$/g,""),n=this.inputIndex;""!=t&&(this.inputIndex++,this.addTag(n,t)&&(this.taginput.value="",this.resizeInput(),this.focus()))}addTag(e,t){const n=this.model.get("value");let i;try{i=this.validateValue(t)}catch(e){return!1}const r=this.model.get("allowed_tags");if(r.length&&!r.includes(i))return!1;if(!this.model.get("allow_duplicates")&&n.includes(i))return!1;this.selection=null;const s=[...n];return s.splice(e,0,i),this.model.set("value",s),this.model.save_changes(),!0}resizeInput(){let e;e=0!=this.taginput.value.length?this.taginput.value:this.model.get("placeholder");const t=e.length+1;this.taginput.setAttribute("size",String(t))}handleKeyEvent(e){const t=this.model.get("value").length;if(this.taginput.value.length)return;const n=this.inputIndex;switch(e.key){case"ArrowLeft":e.ctrlKey&&e.shiftKey&&this.select(n,-n),!e.ctrlKey&&e.shiftKey&&this.select(n,-1),e.ctrlKey?this.inputIndex=0:this.inputIndex--;break;case"ArrowRight":e.ctrlKey&&e.shiftKey&&this.select(n,t-n),!e.ctrlKey&&e.shiftKey&&this.select(n,1),e.ctrlKey?this.inputIndex=t:this.inputIndex++;break;case"Backspace":this.selection?this.removeSelectedTags():this.removeTag(this.inputIndex-1);break;case"Delete":this.selection?this.removeSelectedTags():this.removeTag(this.inputIndex);break;default:return}var i,r;e.shiftKey||(this.selection=null),this.inputIndex=(i=this.inputIndex,r=t,Math.min(Math.max(i,0),r)),this.update(),this.focus()}ondragstart(e,t,n,i){null!=e.dataTransfer&&(e.dataTransfer.setData("index",String(t)),e.dataTransfer.setData("tagValue",String(n)),e.dataTransfer.setData("origin",i))}ondrop(e,t){if(null==e.dataTransfer)return;e.preventDefault(),e.stopPropagation();const n=e.dataTransfer.getData("tagValue"),i=parseInt(e.dataTransfer.getData("index")),r=e.dataTransfer.getData("origin")==this.model.model_id;if(!isNaN(i)){if(r){const e=[...this.model.get("value")];return i=0;t--)null!=this.selection&&this.selection.isSelected(t)&&(e.splice(t,1),t()=>{this.removeTag(e),this.loseFocus()})(t),i}getTagText(e){return e}updateTag(e,t,n,i){i?e.classList.add("mod-active"):e.classList.remove("mod-active")}}Ln.class_map={primary:"mod-primary",success:"mod-success",info:"mod-info",warning:"mod-warning",danger:"mod-danger"};class Nn extends In{defaults(){return Object.assign(Object.assign({},super.defaults()),{value:[],_view_name:"ColorsInputView",_model_name:"ColorsInputModel"})}}class Fn extends Pn{createTag(e,t,n){const i=document.createElement("div"),r=e,s=vn(e).darker().toString();i.classList.add("jupyter-widget-tag"),i.classList.add("jupyter-widget-colortag"),n?(i.classList.add("mod-active"),i.style.backgroundColor=s):i.style.backgroundColor=r;const o=document.createElement("i");return o.classList.add("fa"),o.classList.add("fa-times"),o.classList.add("jupyter-widget-tag-close"),i.appendChild(o),o.onmousedown=(e=>()=>{this.removeTag(e),this.loseFocus()})(t),i}updateTag(e,t,n,i){const r=t,s=vn(t).darker().toString();i?(e.classList.add("mod-active"),e.style.backgroundColor=s):(e.classList.remove("mod-active"),e.style.backgroundColor=r)}validateValue(e){if(null==vn(e))throw e+" is not a valid Color";return e}}class zn extends Rn{defaults(){return Object.assign(Object.assign({},super.defaults()),{min:null,max:null})}}class Un extends Ln{render(){this.model.on("change:format",(()=>{this.formatter=Se(this.model.get("format")),this.update()})),this.formatter=Se(this.model.get("format")),super.render()}getTagText(e){return this.formatter(this.parseNumber(e))}validateValue(e){const t=this.parseNumber(e),n=this.model.get("min"),i=this.model.get("max");if(isNaN(t)||null!=n&&ti)throw e+" is not a valid number, it should be in the range ["+n+", "+i+"]";return t}}class Hn extends zn{defaults(){return Object.assign(Object.assign({},super.defaults()),{_view_name:"FloatsInputView",_model_name:"FloatsInputModel",format:".1f"})}}class Wn extends Un{parseNumber(e){return parseFloat(e)}}class qn extends zn{defaults(){return Object.assign(Object.assign({},super.defaults()),{_view_name:"IntsInputView",_model_name:"IntsInputModel",format:"d"})}}class $n extends Un{parseNumber(e){const t=parseInt(e);if(t!=parseFloat(e))throw e+" should be an integer";return t}}class Vn extends l{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"StringStyleModel",_model_module:"@jupyter-widgets/controls",_model_module_version:a.A})}}Vn.styleProperties=Object.assign(Object.assign({},l.styleProperties),{background:{selector:"",attribute:"background",default:null},font_size:{selector:"",attribute:"font-size",default:""},text_color:{selector:"",attribute:"color",default:""}});class Gn extends Vn{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"HTMLStyleModel",_model_module:"@jupyter-widgets/controls",_model_module_version:a.A})}}Gn.styleProperties=Object.assign({},Vn.styleProperties);class Kn extends Vn{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"HTMLMathStyleModel",_model_module:"@jupyter-widgets/controls",_model_module_version:a.A})}}Kn.styleProperties=Object.assign({},Vn.styleProperties);class Yn extends Vn{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"LabelStyleModel",_model_module:"@jupyter-widgets/controls",_model_module_version:a.A})}}Yn.styleProperties=Object.assign(Object.assign({},Vn.styleProperties),{font_family:{selector:"",attribute:"font-family",default:""},font_style:{selector:"",attribute:"font-style",default:""},font_variant:{selector:"",attribute:"font-variant",default:""},font_weight:{selector:"",attribute:"font-weight",default:""},text_decoration:{selector:"",attribute:"text-decoration",default:""}});class Jn extends l{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"TextStyleModel",_model_module:"@jupyter-widgets/controls",_model_module_version:a.A})}}Jn.styleProperties=Object.assign(Object.assign({},l.styleProperties),{background:{selector:".widget-input",attribute:"background",default:null},font_size:{selector:".widget-input",attribute:"font-size",default:""},text_color:{selector:".widget-input",attribute:"color",default:""}});class Xn extends g{defaults(){return Object.assign(Object.assign({},super.defaults()),{value:"",disabled:!1,placeholder:"​",_model_name:"StringModel"})}}class Zn extends d{render(){super.render(),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox")}}class Qn extends Xn{defaults(){return Object.assign(Object.assign({},super.defaults()),{_view_name:"HTMLView",_model_name:"HTMLModel"})}}class ei extends Zn{render(){super.render(),this.el.classList.add("widget-html"),this.content=document.createElement("div"),this.content.classList.add("widget-html-content"),this.el.appendChild(this.content),this.update()}update(){return this.content.innerHTML=this.model.get("value"),super.update()}handle_message(e){"focus"===e.do?this.content.focus():"blur"===e.do&&this.content.blur()}}class ti extends Xn{defaults(){return Object.assign(Object.assign({},super.defaults()),{_view_name:"HTMLMathView",_model_name:"HTMLMathModel"})}}class ni extends Zn{render(){super.render(),this.el.classList.add("widget-htmlmath"),this.content=document.createElement("div"),this.content.classList.add("widget-htmlmath-content"),this.el.appendChild(this.content),this.update()}update(){return this.content.innerHTML=this.model.get("value"),this.typeset(this.content),super.update()}handle_message(e){"focus"===e.do?this.content.focus():"blur"===e.do&&this.content.blur()}}class ii extends Xn{defaults(){return Object.assign(Object.assign({},super.defaults()),{_view_name:"LabelView",_model_name:"LabelModel"})}}class ri extends Zn{render(){super.render(),this.el.classList.add("widget-label"),this.update()}update(){return this.typeset(this.el,this.model.get("value")),super.update()}}class si extends Xn{defaults(){return Object.assign(Object.assign({},super.defaults()),{_view_name:"TextareaView",_model_name:"TextareaModel",rows:null,continuous_update:!0})}}class oi extends Zn{render(){super.render(),this.el.classList.add("widget-textarea"),this.textbox=document.createElement("textarea"),this.textbox.setAttribute("rows","5"),this.textbox.id=this.label.htmlFor=(0,i.uuid)(),this.textbox.classList.add("widget-input"),this.el.appendChild(this.textbox),this.update(),this.listenTo(this.model,"change:placeholder",((e,t,n)=>{this.update_placeholder(t)})),this.update_placeholder(),this.updateTooltip()}update_placeholder(e){const t=e||this.model.get("placeholder");this.textbox.setAttribute("placeholder",t.toString())}update(e){if(void 0===e||e.updated_view!==this){this.textbox.value=this.model.get("value");let e=this.model.get("rows");null===e&&(e=""),this.textbox.setAttribute("rows",e),this.textbox.disabled=this.model.get("disabled")}return this.updateTabindex(),this.updateTooltip(),super.update()}updateTabindex(){if(!this.textbox)return;const e=this.model.get("tabbable");!0===e?this.textbox.setAttribute("tabIndex","0"):!1===e?this.textbox.setAttribute("tabIndex","-1"):null===e&&this.textbox.removeAttribute("tabIndex")}updateTooltip(){if(!this.textbox)return;const e=this.model.get("tooltip");e?0===this.model.get("description").length&&this.textbox.setAttribute("title",e):this.textbox.removeAttribute("title")}events(){return{"keydown input":"handleKeyDown","keypress input":"handleKeypress","input textarea":"handleChanging","change textarea":"handleChanged"}}handleKeyDown(e){e.stopPropagation()}handleKeypress(e){e.stopPropagation()}handleChanging(e){this.model.get("continuous_update")&&this.handleChanged(e)}handleChanged(e){const t=e.target;this.model.set("value",t.value,{updated_view:this}),this.touch()}handle_message(e){"focus"===e.do?this.textbox.focus():"blur"===e.do&&this.textbox.blur()}}class ai extends Xn{defaults(){return Object.assign(Object.assign({},super.defaults()),{_view_name:"TextView",_model_name:"TextModel",continuous_update:!0})}}class li extends Zn{constructor(){super(...arguments),this.inputType="text"}render(){super.render(),this.el.classList.add("widget-text"),this.textbox=document.createElement("input"),this.textbox.setAttribute("type",this.inputType),this.textbox.id=this.label.htmlFor=(0,i.uuid)(),this.textbox.classList.add("widget-input"),this.el.appendChild(this.textbox),this.update(),this.listenTo(this.model,"change:placeholder",((e,t,n)=>{this.update_placeholder(t)})),this.update_placeholder(),this.updateTabindex(),this.updateTooltip()}update_placeholder(e){this.textbox.setAttribute("placeholder",e||this.model.get("placeholder"))}updateTabindex(){if(!this.textbox)return;const e=this.model.get("tabbable");!0===e?this.textbox.setAttribute("tabIndex","0"):!1===e?this.textbox.setAttribute("tabIndex","-1"):null===e&&this.textbox.removeAttribute("tabIndex")}updateTooltip(){if(!this.textbox)return;const e=this.model.get("tooltip");e?0===this.model.get("description").length&&this.textbox.setAttribute("title",e):this.textbox.removeAttribute("title")}update(e){return void 0!==e&&e.updated_view===this||(this.textbox.value!==this.model.get("value")&&(this.textbox.value=this.model.get("value")),this.textbox.disabled=this.model.get("disabled")),super.update()}events(){return{"keydown input":"handleKeyDown","keypress input":"handleKeypress","input input":"handleChanging","change input":"handleChanged"}}handleKeyDown(e){e.stopPropagation()}handleKeypress(e){e.stopPropagation(),13===e.keyCode&&this.send({event:"submit"})}handleChanging(e){this.model.get("continuous_update")&&this.handleChanged(e)}handleChanged(e){const t=e.target;this.model.set("value",t.value,{updated_view:this}),this.touch()}handle_message(e){"focus"===e.do?this.textbox.focus():"blur"===e.do&&this.textbox.blur()}}class ui extends ai{defaults(){return Object.assign(Object.assign({},super.defaults()),{_view_name:"PasswordView",_model_name:"PasswordModel"})}}class di extends li{constructor(){super(...arguments),this.inputType="password"}}class ci extends ai{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"ComboboxModel",_view_name:"ComboboxView",options:[],ensure_options:!1})}}class hi extends li{constructor(){super(...arguments),this.isInitialRender=!0}render(){this.datalist=document.createElement("datalist"),this.datalist.id=(0,i.uuid)(),super.render(),this.textbox.setAttribute("list",this.datalist.id),this.el.appendChild(this.datalist),this.updateTooltip()}update(e){if(super.update(e),!this.datalist)return;const t=this.isValid(this.model.get("value"));if(this.highlightValidState(t),void 0!==e&&e.updated_view||!this.model.hasChanged("options")&&!this.isInitialRender)return;this.isInitialRender=!1;const n=this.model.get("options"),i=document.createDocumentFragment();for(const e of n){const t=document.createElement("option");t.value=e,i.appendChild(t)}this.datalist.replaceChildren(...i.children)}isValid(e){return!0!==this.model.get("ensure_option")||-1!==this.model.get("options").indexOf(e)}handleChanging(e){const t=e.target,n=this.isValid(t.value);this.highlightValidState(n),n&&super.handleChanging(e)}handleChanged(e){const t=e.target,n=this.isValid(t.value);this.highlightValidState(n),n&&super.handleChanged(e)}handle_message(e){"focus"===e.do?this.textbox.focus():"blur"===e.do&&this.textbox.blur()}highlightValidState(e){this.textbox.classList.toggle("jpwidgets-invalidComboValue",!e)}}class pi extends f{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"FileUploadModel",_view_name:"FileUploadView",accept:"",description:"Upload",disabled:!1,icon:"upload",button_style:"",multiple:!1,value:[],error:"",style:null})}}pi.serializers=Object.assign(Object.assign({},f.serializers),{value:{serialize:e=>e}});class fi extends i.DOMWidgetView{preinitialize(){this.tagName="button"}render(){super.render(),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-upload"),this.el.classList.add("jupyter-button"),this.fileInput=document.createElement("input"),this.fileInput.type="file",this.fileInput.style.display="none",this.el.addEventListener("click",(()=>{this.fileInput.click()})),this.fileInput.addEventListener("click",(()=>{this.fileInput.value=""})),this.fileInput.addEventListener("change",(()=>{var e;const t=[];Array.from(null!==(e=this.fileInput.files)&&void 0!==e?e:[]).forEach((e=>{t.push(new Promise(((t,n)=>{const i=new FileReader;i.onload=()=>{const n=i.result;t({content:n,name:e.name,type:e.type,size:e.size,last_modified:e.lastModified})},i.onerror=()=>{n()},i.onabort=i.onerror,i.readAsArrayBuffer(e)})))})),Promise.all(t).then((e=>{this.model.set({value:e,error:""}),this.touch()})).catch((e=>{console.error("error in file upload: %o",e),this.model.set({error:e}),this.touch()}))})),this.listenTo(this.model,"change:button_style",this.update_button_style),this.set_button_style(),this.update()}update(){this.el.disabled=this.model.get("disabled"),this.el.setAttribute("title",this.model.get("tooltip"));const e=this.model.get("value"),t=`${this.model.get("description")} (${e.length})`,n=this.model.get("icon");if(t.length||n.length){if(this.el.textContent="",n.length){const e=document.createElement("i");e.classList.add("fa"),e.classList.add("fa-"+n),0===t.length&&e.classList.add("center"),this.el.appendChild(e)}this.el.appendChild(document.createTextNode(t))}return this.fileInput.accept=this.model.get("accept"),this.fileInput.multiple=this.model.get("multiple"),super.update()}update_button_style(){this.update_mapped_classes(fi.class_map,"button_style",this.el)}set_button_style(){this.set_mapped_classes(fi.class_map,"button_style",this.el)}}fi.class_map={primary:["mod-primary"],success:["mod-success"],info:["mod-info"],warning:["mod-warning"],danger:["mod-danger"]};const gi=n(7093).rE},9874:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});const i="2.0.0"},1137:(e,t,n)=>{"use strict";n.r(t),n.d(t,{KernelWidgetManager:()=>g.zS,LabWidgetManager:()=>g.tl,WidgetManager:()=>g.SS,WidgetRenderer:()=>f.u,default:()=>z,output:()=>m,registerWidgetManager:()=>k});var i=n(5764);const r=new i.Token("@jupyterlab/coreutils:ISettingRegistry",'A service for the JupyterLab settings system.\n Use this if you want to store settings for your application.\n See "schemaDir" for more information.'),s=new i.Token("@jupyterlab/console:IConsoleTracker","A widget tracker for code consoles.\n Use this if you want to be able to iterate over and interact with code consoles\n created by the application."),o=(new i.Token("@jupyterlab/console:IConsoleCellExecutor","The console cell executor"),new i.Token("@jupyterlab/notebook:INotebookWidgetFactory","A service to create the notebook viewer."),new i.Token("@jupyterlab/notebook:INotebookTools",'A service for the "Notebook Tools" panel in the\n right sidebar. Use this to add your own functionality to the panel.'),new i.Token("@jupyterlab/notebook:INotebookTracker","A widget tracker for notebooks.\n Use this if you want to be able to iterate over and interact with notebooks\n created by the application.")),a=(new i.Token("@jupyterlab/notebook:INotebookCellExecutor","The notebook cell executor"),new i.Token("@jupyterlab/mainmenu:IMainMenu","A service for the main menu bar for the application.\n Use this if you want to add your own menu items or provide implementations for standardized menu items for specific activities.")),l=new i.Token("@jupyterlab/rendermime:IRenderMimeRegistry",'A service for the rendermime registry for the application. Use this to create renderers for various mime-types in your extension. Many times it will be easier to create a "mime renderer extension" rather than using this service directly.'),u=(new i.Token("@jupyterlab/rendermime:ILatexTypesetter","A service for the LaTeX typesetter for the application. Use this if you want to typeset math in your extension."),new i.Token("@jupyterlab/rendermime:IMarkdownParser","A service for rendering markdown syntax as HTML content."),new i.Token("@jupyterlab/logconsole:ILoggerRegistry","A service providing a logger infrastructure."));var d,c,h;!function(e){function t(e,t,n=0,i=-1){let r,s=e.length;if(0===s)return-1;n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,r=o+i;n(e[r],t)<0?(o=r+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,r=-1){let s=e.length;if(0===s)return 0;let o=i=i<0?Math.max(0,i+s):Math.min(i,s-1),a=(r=r<0?Math.max(0,r+s):Math.min(r,s-1))-i+1;for(;a>0;){let i=a>>1,r=o+i;n(e[r],t)>0?a=i:(o=r+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,r=e.length;i=o&&(n=r<0?o-1:o),void 0===i?i=r<0?-1:o:i<0?i=Math.max(i+o,r<0?-1:0):i>=o&&(i=r<0?o-1:o),s=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;s(e,n,a-1),s(e,a,i),s(e,n,i)},e.fill=function(e,t,n=0,i=-1){let r,s=e.length;if(0!==s){n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,r=-1){let s=t(e,n,i,r);return-1!==s&&o(e,s),s},e.removeLastOf=function(e,t,i=-1,r=0){let s=n(e,t,i,r);return-1!==s&&o(e,s),s},e.removeAllOf=function(e,t,n=0,i=-1){let r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s},e.removeFirstWhere=function(e,t,n=0,r=-1){let s,a=i(e,t,n,r);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeLastWhere=function(e,t,n=-1,i=0){let s,a=r(e,t,n,i);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeAllWhere=function(e,t,n=0,i=-1){let r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s}}(d||(d={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(h||(h={}));var p=n(7556),f=n(603),g=n(1043),m=n(6278),v=n(7998),b=n(9874),A=n(5072),y=n.n(A),w=n(698);y()(w.A,{insert:"head",singleton:!1}),w.A.locals;var _=n(5584);y()(_.A,{insert:"head",singleton:!1}),_.A.locals;var E=n(7883),C=n(509);const x=[],D={saveState:!1};function*S(...e){for(const t of e)yield*t}async function T(e){return await e.ready,e.session.kernel.id}async function B(e,t,n,i,r){const s=await T(t);let o,a=F.widgetManagerProperty.get(s);a||(a=r(),x.forEach((e=>a.register(e))),F.widgetManagerProperty.set(s,a),o=s,e.disposed.connect((e=>{F.widgetManagerProperty.get(o)&&F.widgetManagerProperty.delete(o)})),t.kernelChanged.connect(((e,t)=>{const{newValue:n}=t;if(n){const e=n.id,t=F.widgetManagerProperty.get(o);t&&(F.widgetManagerProperty.delete(o),F.widgetManagerProperty.set(e,t)),o=e}})));for(const e of i)e.manager=a;return n.removeMimeType(g.kn),n.addFactory({safe:!1,mimeTypes:[g.kn],createRenderer:e=>new f.u(e,a)},-10),new p.DisposableDelegate((()=>{n&&n.removeMimeType(g.kn),a.dispose()}))}function k(e,t,n){let i;const r=T(e.sessionContext).then((r=>{const s=F.widgetManagerProperty.get(r);s?i=s:(i=new g.SS(e,t,D),x.forEach((e=>i.register(e))),F.widgetManagerProperty.set(r,i));for(const e of n)e.manager=i;t.removeMimeType(g.kn),t.addFactory({safe:!1,mimeTypes:[g.kn],createRenderer:e=>new f.u(e,i)},-10)}));return new p.DisposableDelegate((async()=>{await r,t&&t.removeMimeType(g.kn),i.dispose()}))}async function M(e,t){const n=e.content,i=e.context,r=i.sessionContext,s=n.rendermime;return B(n,r,s,t,(()=>new g.SS(i,s,D)))}async function j(e,t){const n=e.console,i=n.sessionContext,r=n.rendermime;return B(n,i,r,t,(()=>new g.zS(i.session.kernel,r)))}const O={id:"@jupyter-widgets/jupyterlab-manager:plugin",requires:[l],optional:[o,s,r,a,u,C.sQ],provides:v.IJupyterWidgetRegistry,activate:function(e,t,n,i,r,s,o,a){const{commands:l}=e,u=(null!=a?a:C.wK).load("jupyterlab_widgets"),d=async e=>{if(!o)return;const t=await T(e.context.sessionContext),n=F.widgetManagerProperty.get(t);n&&n.onUnhandledIOPubMessage.connect(((t,n)=>{const i=o.getLogger(e.context.path);let r="warning";(E.KernelMessage.isErrorMsg(n)||E.KernelMessage.isStreamMsg(n)&&"stderr"===n.content.name)&&(r="error");const s=Object.assign(Object.assign({},n.content),{output_type:n.header.msg_type});i.rendermime=e.content.rendermime,i.log({type:"output",data:s,level:r})}))};if(null!==r&&r.load(O.id).then((e=>{e.changed.connect(I),I(e)})).catch((e=>{console.error(e.message)})),t.addFactory({safe:!1,mimeTypes:[g.kn],createRenderer:e=>new f.u(e)},-10),null!==n){const t=t=>S(function*(e){for(const t of e.widgets)if("code"===t.model.type)for(const e of t.outputArea.widgets)for(const t of Array.from(e.children()))t instanceof f.u&&(yield t)}(t.content),function*(e,t){const n=function*(e){for(const i of e)(n=i).id.startsWith("LinkedOutputView-")&&n.path===t&&(yield i);var n}(e.shell.widgets());for(const e of Array.from(n))for(const t of Array.from(e.children()))for(const e of Array.from(t.children()))e instanceof f.u&&(yield e)}(e,t.context.path));n.forEach((async e=>{await M(e,t(e)),d(e)})),n.widgetAdded.connect((async(e,n)=>{await M(n,t(n)),d(n)}))}if(null!==i){const e=e=>S(function*(e){for(const t of Array.from(e.cells))if("code"===t.model.type)for(const e of t.outputArea.widgets)for(const t of Array.from(e.children()))t instanceof f.u&&(yield t)}(e.console));i.forEach((async t=>{await j(t,e(t))})),i.widgetAdded.connect((async(t,n)=>{await j(n,e(n))}))}return null!==r&&l.addCommand("@jupyter-widgets/jupyterlab-manager:saveWidgetState",{label:u.__("Save Widget State Automatically"),execute:e=>r.set(O.id,"saveState",!D.saveState).catch((e=>{console.error(`Failed to set ${O.id}: ${e.message}`)})),isToggled:()=>D.saveState}),s&&s.settingsMenu.addGroup([{command:"@jupyter-widgets/jupyterlab-manager:saveWidgetState"}]),{registerWidget(e){x.push(e)}}},autoStart:!0};function I(e){D.saveState=e.get("saveState").composite}const P={id:`@jupyter-widgets/jupyterlab-manager:base-${v.JUPYTER_WIDGETS_VERSION}`,requires:[v.IJupyterWidgetRegistry],autoStart:!0,activate:(e,t)=>{t.registerWidget({name:"@jupyter-widgets/base",version:v.JUPYTER_WIDGETS_VERSION,exports:{WidgetModel:v.WidgetModel,WidgetView:v.WidgetView,DOMWidgetView:v.DOMWidgetView,DOMWidgetModel:v.DOMWidgetModel,LayoutModel:v.LayoutModel,LayoutView:v.LayoutView,StyleModel:v.StyleModel,StyleView:v.StyleView,ErrorWidgetView:v.ErrorWidgetView}})}},R={id:`@jupyter-widgets/jupyterlab-manager:controls-${b.A}`,requires:[v.IJupyterWidgetRegistry],autoStart:!0,activate:(e,t)=>{t.registerWidget({name:"@jupyter-widgets/controls",version:b.A,exports:()=>new Promise(((e,t)=>{Promise.resolve().then((t=>{e(n(5803))}).bind(null,n)).catch((e=>{t(e)}))}))})}},L={id:`@jupyter-widgets/jupyterlab-manager:output-${m.OUTPUT_WIDGET_VERSION}`,requires:[v.IJupyterWidgetRegistry],autoStart:!0,activate:(e,t)=>{t.registerWidget({name:"@jupyter-widgets/output",version:m.OUTPUT_WIDGET_VERSION,exports:{OutputModel:m.OutputModel,OutputView:m.OutputView}})}},N=[O,P,R,L];var F;!function(e){e.widgetManagerProperty=new Map}(F||(F={}));const z=N},1043:(e,t,n)=>{"use strict";n.d(t,{zS:()=>_,tl:()=>w,kn:()=>A,SS:()=>E});var i=n(7998),r=n(5764),s=n(7991);function o(e){const t=new Uint8Array(e.length/2);for(let n=0;n/g,">");for(navigator&&"Microsoft Internet Explorer"===navigator.appName&&(s=s.replace(/(%[^\n]*)\n/g,"$1
\n"));t>e;)r[t]="",t--;return r[e]="@@"+i.length+"@@",n&&(s=n(s)),i.push(s),r}var c=n(7521),h=n.n(c);const p=i.PROTOCOL_VERSION.split(".",1)[0];class f{constructor(){this.comm_target_name="jupyter.widget",this._models=Object.create(null)}setViewOptions(e={}){return e}create_view(e,t={}){const n=(0,i.uuid)(),r=e.state_change=e.state_change.then((async()=>{const r=e.get("_view_name"),s=e.get("_view_module");try{const i=new(await this.loadViewClass(r,s,e.get("_view_module_version")))({model:e,options:this.setViewOptions(t)});return i.listenTo(e,"destroy",i.remove),await i.render(),i.once("remove",(()=>{e.views&&delete e.views[n]})),i}catch(n){console.error(`Could not create a view for model id ${e.model_id}`);const o=`Failed to create view for '${r}' from module '${s}' with model '${e.name}' from module '${e.module}'`,a=new(i.createErrorWidgetModel(n,o)),l=new i.ErrorWidgetView({model:a,options:this.setViewOptions(t)});return await l.render(),l}}));return e.views&&(e.views[n]=r),r}callbacks(e){return{}}async get_model(e){const t=this._models[e];if(void 0===t)throw new Error("widget model not found");return t}has_model(e){return void 0!==this._models[e]}handle_comm_open(e,t){const n=(t.metadata||{}).version||"";if(n.split(".",1)[0]!==p){const e=`Wrong widget protocol version: received protocol version '${n}', but was expecting major version '${p}'`;return console.error(e),Promise.reject(e)}const r=t.content.data,s=r.buffer_paths||[],o=t.buffers||[];return(0,i.put_buffers)(r.state,s,o),this.new_model({model_name:r.state._model_name,model_module:r.state._model_module,model_module_version:r.state._model_module_version,comm:e},r.state).catch((0,i.reject)("Could not create a model.",!0))}new_widget(e,t={}){let n;if(void 0===e.view_name||void 0===e.view_module||void 0===e.view_module_version)return Promise.reject("new_widget(...) must be given view information in the options.");n=e.comm?Promise.resolve(e.comm):this._create_comm(this.comm_target_name,e.model_id,{state:{_model_module:e.model_module,_model_module_version:e.model_module_version,_model_name:e.model_name,_view_module:e.view_module,_view_module_version:e.view_module_version,_view_name:e.view_name}},{version:i.PROTOCOL_VERSION});const r=Object.assign({},e);return n.then((e=>(r.comm=e,this.new_model(r,t).then((e=>(e.sync("create",e),e))))),(()=>(r.model_id||(r.model_id=(0,i.uuid)()),this.new_model(r,t))))}register_model(e,t){this._models[e]=t,t.then((t=>{t.once("comm:close",(()=>{delete this._models[e]}))}))}async new_model(e,t={}){var n,i;const r=null!==(n=e.model_id)&&void 0!==n?n:null===(i=e.comm)||void 0===i?void 0:i.comm_id;if(!r)throw new Error("Neither comm nor model_id provided in options object. At least one must exist.");e.model_id=r;const s=this._make_model(e,t);return this.register_model(r,s),await s}async _loadFromKernel(){let e,t;try{const n=await this._create_comm("jupyter.widget.control",(0,i.uuid)(),{},{version:"1.0.0"});await new Promise(((i,r)=>{n.on_msg((n=>{e=n.content.data,"update_states"===e.method?(t=(n.buffers||[]).map((e=>e instanceof DataView?e:new DataView(e instanceof ArrayBuffer?e:e.buffer))),i(null)):console.warn(`\n Unknown ${e.method} message on the Control channel\n `)})),n.on_close((()=>r("Control comm was closed too early"))),n.send({method:"request_states"},{}),setTimeout((()=>r("Control comm did not respond in time")),4e3)})),n.close()}catch(e){return this._loadFromKernelModels()}const n=e.states,r={},s={};for(let n=0;n({widget_id:e,comm:this.has_model(e)?void 0:await this._create_comm("jupyter.widget",e)}))));await Promise.all(o.map((async({widget_id:e,comm:t})=>{const o=n[e];e in r&&(0,i.put_buffers)(o,r[e],s[e]);try{if(t)await this.new_model({model_name:o.model_name,model_module:o.model_module,model_module_version:o.model_module_version,model_id:e,comm:t},o.state);else{const t=await this.get_model(e),n=await t.constructor._deserialize_state(o.state,this);t.set_state(n)}}catch(e){console.error(e)}})))}async _loadFromKernelModels(){const e=await this._get_comm_info(),t=await Promise.all(Object.keys(e).map((async e=>{if(this.has_model(e))return;const t=await this._create_comm(this.comm_target_name,e);let n="";const s=new r.PromiseDelegate;return t.on_msg((e=>{if(e.parent_header.msg_id===n&&"comm_msg"===e.header.msg_type&&"update"===e.content.data.method){const n=e.content.data,r=n.buffer_paths||[],o=e.buffers||[];(0,i.put_buffers)(n.state,r,o),s.resolve({comm:t,msg:e})}})),n=t.send({method:"request_state"},this.callbacks(void 0)),s.promise})));await Promise.all(t.map((async e=>{if(!e)return;const t=e.msg.content;await this.new_model({model_name:t.data.state._model_name,model_module:t.data.state._model_module,model_module_version:t.data.state._model_module_version,comm:e.comm},t.data.state)})))}async _make_model(e,t={}){const n=e.model_id,r=this.loadModelClass(e.model_name,e.model_module,e.model_module_version);let s;const o=(e,t)=>new(i.createErrorWidgetModel(e,t));try{s=await r}catch(e){const t="Could not instantiate widget";return console.error(t),o(e,t)}if(!s){const t="Could not instantiate widget";return console.error(t),o(new Error(`Cannot find model module ${e.model_module}@${e.model_module_version}, ${e.model_name}`),t)}let a;try{const i=await s._deserialize_state(t,this);a=new s(i,{widget_manager:this,model_id:n,comm:e.comm})}catch(t){console.error(t),a=o(t,`Model class '${e.model_name}' from module '${e.model_module}' is loaded but can not be instantiated`)}return a.name=e.model_name,a.module=e.model_module,a}clear_state(){return(0,i.resolvePromisesDict)(this._models).then((e=>{Object.keys(e).forEach((t=>e[t].close())),this._models=Object.create(null)}))}get_state(e={}){const t=Object.keys(this._models).map((e=>this._models[e]));return Promise.all(t).then((t=>g(t,e)))}set_state(e){if(!(e.version_major&&e.version_major<=2))throw"Unsupported widget state format";const t=e.state;return this._get_comm_info().then((e=>Promise.all(Object.keys(t).map((n=>{const r={base64:l,hex:o},s=t[n],a=s.state;if(s.buffers){const e=s.buffers.map((e=>e.path)),t=s.buffers.map((e=>new DataView(r[e.encoding](e.data))));(0,i.put_buffers)(s.state,e,t)}if(this.has_model(n))return this.get_model(n).then((e=>e.constructor._deserialize_state(a||{},this).then((t=>(e.set_state(t),e)))));const u={model_id:n,model_name:s.model_name,model_module:s.model_module,model_module_version:s.model_module_version};return Object.prototype.hasOwnProperty.call(e,"model_id")?this._create_comm(this.comm_target_name,n).then((e=>(u.comm=e,this.new_model(u)))):this.new_model(u,a)})))))}disconnect(){Object.keys(this._models).forEach((e=>{this._models[e].then((e=>{e.comm_live=!1}))}))}resolveUrl(e){return Promise.resolve(e)}inline_sanitize(e){const t=function(e){const t=[];let n,i=null,r=null,s=null,o=0;/`/.test(e)?(e=e.replace(/~/g,"~T").replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm,(e=>e.replace(/\$/g,"~D"))),n=e=>e.replace(/~([TD])/g,((e,t)=>"T"===t?"~":"$"))):n=e=>e;let a=e.replace(/\r\n?/g,"\n").split(u);for(let e=1,l=a.length;e{let n=r[t];return"\\\\("===n.substr(0,3)&&"\\\\)"===n.substr(n.length-3)?n="\\("+n.substring(3,n.length-3)+"\\)":"\\\\["===n.substr(0,3)&&"\\\\]"===n.substr(n.length-3)&&(n="\\["+n.substring(3,n.length-3)+"\\]"),n}))}async loadModelClass(e,t,n){try{const i=this.loadClass(e,t,n);return await i,i}catch(n){console.error(n);const r=`Failed to load model class '${e}' from module '${t}'`;return i.createErrorWidgetModel(n,r)}}async loadViewClass(e,t,n){try{const i=this.loadClass(e,t,n);return await i,i}catch(n){console.error(n);const r=`Failed to load view class '${e}' from module '${t}'`;return i.createErrorWidgetView(n,r)}}filterExistingModelState(e){let t=e.state;return t=Object.keys(t).filter((e=>!this.has_model(e))).reduce(((e,n)=>(e[n]=t[n],e)),{}),Object.assign(Object.assign({},e),{state:t})}}function g(e,t={}){const n={};return e.forEach((e=>{const r=e.model_id,s=(0,i.remove_buffers)(e.serialize(e.get_state(t.drop_defaults))),o=s.buffers.map(((e,t)=>({data:a(e),path:s.buffer_paths[t],encoding:"base64"})));n[r]={model_name:e.name,model_module:e.module,model_module_version:e.get("_model_module_version"),state:s.state},o.length>0&&(n[r].buffers=o)})),{version_major:2,version_minor:0,state:n}}var m=n(8571),v=n(2722);class b{constructor(){this._cache=Object.create(null)}set(e,t,n){if(e in this._cache||(this._cache[e]=Object.create(null)),t in this._cache[e])throw`Version ${t} of key ${e} already registered.`;this._cache[e][t]=n}get(e,t){if(e in this._cache){const n=this._cache[e],i=(0,v.maxSatisfying)(Object.keys(n),t);if(null!==i)return n[i]}}getAllVersions(e){if(e in this._cache)return this._cache[e]}}const A="application/vnd.jupyter.widget-view+json",y="application/vnd.jupyter.widget-state+json";class w extends f{constructor(e){super(),this._handleCommOpen=async(e,t)=>{const n=new i.shims.services.Comm(e);await this.handle_comm_open(n,t)},this._restored=new m.Signal(this),this._restoredStatus=!1,this._kernelRestoreInProgress=!1,this._isDisposed=!1,this._registry=new b,this._modelsSync=new Map,this._onUnhandledIOPubMessage=new m.Signal(this),this._rendermime=e}callbacks(e){return{iopub:{output:e=>{this._onUnhandledIOPubMessage.emit(e)}}}}_handleKernelChanged({oldValue:e,newValue:t}){e&&e.removeCommTarget(this.comm_target_name,this._handleCommOpen),t&&t.registerCommTarget(this.comm_target_name,this._handleCommOpen)}disconnect(){super.disconnect(),this._restoredStatus=!1}async _loadFromKernel(){var e;if(!this.kernel)throw new Error("Kernel not set");if(!1!==(null===(e=this.kernel)||void 0===e?void 0:e.handleComms))return super._loadFromKernel()}async _create_comm(e,t,n,r,s){const o=this.kernel;if(!o)throw new Error("No current kernel");const a=o.createComm(e,t);return(n||r)&&a.open(n,r,s),new i.shims.services.Comm(a)}async _get_comm_info(){const e=this.kernel;if(!e)throw new Error("No current kernel");const t=await e.requestCommInfo({target_name:this.comm_target_name});return"ok"===t.content.status?t.content.comms:{}}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._commRegistration&&this._commRegistration.dispose())}async resolveUrl(e){return e}async loadClass(e,t,n){"@jupyter-widgets/base"!==t&&"@jupyter-widgets/controls"!==t||!(0,v.valid)(n)||(n=`^${n}`);const i=this._registry.getAllVersions(t);if(!i)throw new Error(`No version of module ${t} is registered`);const r=this._registry.get(t,n);if(!r){const e=Object.keys(i);throw new Error(`Module ${t}, version ${n} is not registered, however, ${e.join(",")} ${e.length>1?"are":"is"}`)}let s;s="function"==typeof r?await r():await r;const o=s[e];if(!o)throw new Error(`Class ${e} not found in module ${t}`);return o}get rendermime(){return this._rendermime}get restored(){return this._restored}get restoredStatus(){return this._restoredStatus}get onUnhandledIOPubMessage(){return this._onUnhandledIOPubMessage}register(e){this._registry.set(e.name,e.version,e.exports)}register_model(e,t){super.register_model(e,t),t.then((t=>{this._modelsSync.set(e,t),t.once("comm:close",(()=>{this._modelsSync.delete(e)}))}))}async clear_state(){await super.clear_state(),this._modelsSync=new Map}get_state_sync(e={}){const t=[];for(const e of this._modelsSync.values())e.comm_live&&t.push(e);return g(t,e)}}class _ extends w{constructor(e,t){super(t),this._kernel=e,e.statusChanged.connect(((e,t)=>{this._handleKernelStatusChange(t)})),e.connectionStatusChanged.connect(((e,t)=>{this._handleKernelConnectionStatusChange(t)})),this._handleKernelChanged({name:"kernel",oldValue:null,newValue:e}),this.restoreWidgets()}_handleKernelConnectionStatusChange(e){"connected"===e&&(this._kernelRestoreInProgress||this.restoreWidgets())}_handleKernelStatusChange(e){"restarting"===e&&this.disconnect()}async restoreWidgets(){try{this._kernelRestoreInProgress=!0,await this._loadFromKernel(),this._restoredStatus=!0,this._restored.emit()}catch(e){}this._kernelRestoreInProgress=!1}dispose(){this.isDisposed||(this._kernel=null,super.dispose())}get kernel(){return this._kernel}}class E extends w{constructor(e,t,n){var i,r;super(t),this._context=e,e.sessionContext.kernelChanged.connect(((e,t)=>{this._handleKernelChanged(t)})),e.sessionContext.statusChanged.connect(((e,t)=>{this._handleKernelStatusChange(t)})),e.sessionContext.connectionStatusChanged.connect(((e,t)=>{this._handleKernelConnectionStatusChange(t)})),(null===(i=e.sessionContext.session)||void 0===i?void 0:i.kernel)&&this._handleKernelChanged({name:"kernel",oldValue:null,newValue:null===(r=e.sessionContext.session)||void 0===r?void 0:r.kernel}),this.restoreWidgets(this._context.model),this._settings=n,e.saveState.connect(((e,t)=>{"started"===t&&n.saveState&&this._saveState()}))}_saveState(){const e=this.get_state_sync({drop_defaults:!0});this._context.model.setMetadata?this._context.model.setMetadata("widgets",{"application/vnd.jupyter.widget-state+json":e}):this._context.model.metadata.set("widgets",{"application/vnd.jupyter.widget-state+json":e})}_handleKernelConnectionStatusChange(e){"connected"===e&&(this._kernelRestoreInProgress||this.restoreWidgets(this._context.model,{loadKernel:!0,loadNotebook:!1}))}_handleKernelStatusChange(e){"restarting"===e&&this.disconnect()}async restoreWidgets(e,{loadKernel:t,loadNotebook:n}={loadKernel:!0,loadNotebook:!0}){try{if(await this.context.sessionContext.ready,t)try{this._kernelRestoreInProgress=!0,await this._loadFromKernel()}finally{this._kernelRestoreInProgress=!1}n&&await this._loadFromNotebook(e),this._restoredStatus=!0,this._restored.emit()}catch(e){}}async _loadFromNotebook(e){const t=e.getMetadata?e.getMetadata("widgets"):e.metadata.get("widgets");if(t&&t[y]){let e=t[y];e=this.filterExistingModelState(e),await this.set_state(e)}}dispose(){this.isDisposed||(this._context=null,super.dispose())}async resolveUrl(e){const t=await this.context.urlResolver.resolveUrl(e);return this.context.urlResolver.getDownloadUrl(t)}get context(){return this._context}get kernel(){var e,t,n;return null!==(n=null===(t=null===(e=this._context.sessionContext)||void 0===e?void 0:e.session)||void 0===t?void 0:t.kernel)&&void 0!==n?n:null}register_model(e,t){super.register_model(e,t),this.setDirty()}async clear_state(){await super.clear_state(),this.setDirty()}setDirty(){this._settings.saveState&&(this._context.model.dirty=!0)}}},6278:(e,t,n)=>{"use strict";n.r(t),n.d(t,{OUTPUT_WIDGET_VERSION:()=>h,OutputModel:()=>p,OutputView:()=>f});var i=n(7998);const r="1.0.0";class s extends i.DOMWidgetModel{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:"OutputModel",_view_name:"OutputView",_model_module:"@jupyter-widgets/output",_view_module:"@jupyter-widgets/output",_model_module_version:r,_view_module_version:r})}}class o extends i.DOMWidgetView{}var a=n(1043),l=n(478),u=n(8044),d=n(4651),c=n.n(d);const h=r;class p extends s{defaults(){return Object.assign(Object.assign({},super.defaults()),{msg_id:"",outputs:[]})}initialize(e,t){super.initialize(e,t),this._outputs=new l.c({trusted:!0}),this._msgHook=e=>(this.add(e),!1),this.widget_manager instanceof a.SS&&this.widget_manager.context.sessionContext.kernelChanged.connect(((e,t)=>{this._handleKernelChanged(t)})),this.listenTo(this,"change:msg_id",this.reset_msg_id),this.listenTo(this,"change:outputs",this.setOutputs),this.setOutputs()}_handleKernelChanged({oldValue:e}){const t=this.get("msg_id");t&&e&&(e.removeMessageHook(t,this._msgHook),this.set("msg_id",null))}reset_msg_id(){const e=this.widget_manager.kernel,t=this.get("msg_id"),n=this.previous("msg_id");n&&e&&e.removeMessageHook(n,this._msgHook),t&&e&&e.registerMessageHook(t,this._msgHook)}add(e){const t=e.header.msg_type;switch(t){case"execute_result":case"display_data":case"stream":case"error":{const n=e.content;n.output_type=t,this._outputs.add(n);break}case"clear_output":this.clear_output(e.content.wait)}this.set("outputs",this._outputs.toJSON(),{newMessage:!0}),this.save_changes()}clear_output(e=!1){this._outputs.clear(e)}get outputs(){return this._outputs}setOutputs(e,t,n){n&&n.newMessage||(this.clear_output(),this._outputs.fromJSON(JSON.parse(JSON.stringify(this.get("outputs")))))}}class f extends o{_createElement(e){return this.luminoWidget=new i.JupyterLuminoPanelWidget({view:this}),this.luminoWidget.node}_setElement(e){if(this.el||e!==this.luminoWidget.node)throw new Error("Cannot reset the DOM element.");this.el=this.luminoWidget.node,this.$el=c()(this.luminoWidget.node)}render(){super.render(),this._outputView=new u.Bw({rendermime:this.model.widget_manager.rendermime,contentFactory:u.Bw.defaultContentFactory,model:this.model.outputs}),this.luminoWidget.insertWidget(0,this._outputView),this.luminoWidget.addClass("jupyter-widgets"),this.luminoWidget.addClass("widget-output"),this.update()}remove(){return this._outputView.dispose(),super.remove()}}},603:(e,t,n)=>{"use strict";n.d(t,{u:()=>s});var i=n(5764),r=n(5070);class s extends r.Zk{constructor(e,t){super(),this._manager=new i.PromiseDelegate,this._rerenderMimeModel=null,this.mimeType=e.mimeType,t&&(this.manager=t)}set manager(e){e.restored.connect(this._rerender,this),this._manager.resolve(e)}async renderModel(e){const t=e.data[this.mimeType];this.node.textContent="Loading widget...";const n=await this._manager.promise;if(""===t.model_id)return this.hide(),Promise.resolve();let i,r;try{i=await n.get_model(t.model_id)}catch(t){return n.restoredStatus?(this.node.textContent="Error displaying widget: model not found",this.addClass("jupyter-widgets"),void console.error(t)):void(this._rerenderMimeModel=e)}this._rerenderMimeModel=null;try{const e=await n.create_view(i);r=e.luminoWidget||e.pWidget}catch(e){return this.node.textContent="Error displaying widget",this.addClass("jupyter-widgets"),void console.error(e)}this.node.textContent="",this.addWidget(r),r.disposed.connect((()=>{this.hide(),t.model_id=""}))}dispose(){this.isDisposed||(this._manager=null,super.dispose())}_rerender(){this._rerenderMimeModel&&(this.node.textContent="",this.removeClass("jupyter-widgets"),this.renderModel(this._rerenderMimeModel))}}},1530:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.attributeNames=t.elementNames=void 0,t.elementNames=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((function(e){return[e.toLowerCase(),e]}))),t.attributeNames=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((function(e){return[e.toLowerCase(),e]})))},5552:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n");case a.Comment:return"\x3c!--".concat(e.data,"--\x3e");case a.CDATA:return function(e){return"")}(e);case a.Script:case a.Style:case a.Tag:return function(e,t){var n;"foreign"===t.xmlMode&&(e.name=null!==(n=u.elementNames.get(e.name))&&void 0!==n?n:e.name,e.parent&&g.has(e.parent.name)&&(t=i(i({},t),{xmlMode:!1}))),!t.xmlMode&&m.has(e.name)&&(t=i(i({},t),{xmlMode:"foreign"}));var r="<".concat(e.name),s=function(e,t){var n;if(e){var i=!1===(null!==(n=t.encodeEntities)&&void 0!==n?n:t.decodeEntities)?c:t.xmlMode||"utf8"!==t.encodeEntities?l.encodeXML:l.escapeAttribute;return Object.keys(e).map((function(n){var r,s,o=null!==(r=e[n])&&void 0!==r?r:"";return"foreign"===t.xmlMode&&(n=null!==(s=u.attributeNames.get(n))&&void 0!==s?s:n),t.emptyAttrs||t.xmlMode||""!==o?"".concat(n,'="').concat(i(o),'"'):n})).join(" ")}}(e.attribs,t);return s&&(r+=" ".concat(s)),0===e.children.length&&(t.xmlMode?!1!==t.selfClosingTags:t.selfClosingTags&&h.has(e.name))?(t.xmlMode||(r+=" "),r+="/>"):(r+=">",e.children.length>0&&(r+=p(e.children,t)),!t.xmlMode&&h.has(e.name)||(r+=""))),r}(e,t);case a.Text:return function(e,t){var n,i=e.data||"";return!1===(null!==(n=t.encodeEntities)&&void 0!==n?n:t.decodeEntities)||!t.xmlMode&&e.parent&&d.has(e.parent.name)||(i=t.xmlMode||"utf8"!==t.encodeEntities?(0,l.encodeXML)(i):(0,l.escapeText)(i)),i}(e,t)}}t.render=p,t.default=p;var g=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),m=new Set(["svg","math"])},2159:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var s=n(3338),o=n(4879);r(n(4879),t);var a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function e(e,t,n){this.dom=[],this.root=new o.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=a),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:a,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new o.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?s.ElementType.Tag:void 0,i=new o.Element(e,t,void 0,n);this.addNode(i),this.tagStack.push(i)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===s.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new o.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===s.ElementType.Comment)this.lastNode.data+=e;else{var t=new o.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new o.Text(""),t=new o.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new o.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=l,t.default=l},4879:function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__assign||function(){return s=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(a);t.NodeWithChildren=h;var p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=o.ElementType.CDATA,t}return r(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(h);t.CDATA=p;var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=o.ElementType.Root,t}return r(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(h);t.Document=f;var g=function(e){function t(t,n,i,r){void 0===i&&(i=[]),void 0===r&&(r="script"===t?o.ElementType.Script:"style"===t?o.ElementType.Style:o.ElementType.Tag);var s=e.call(this,i)||this;return s.name=t,s.attribs=n,s.type=r,s}return r(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,i;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(i=e["x-attribsPrefix"])||void 0===i?void 0:i[t]}}))},enumerable:!1,configurable:!0}),t}(h);function m(e){return(0,o.isTag)(e)}function v(e){return e.type===o.ElementType.CDATA}function b(e){return e.type===o.ElementType.Text}function A(e){return e.type===o.ElementType.Comment}function y(e){return e.type===o.ElementType.Directive}function w(e){return e.type===o.ElementType.Root}function _(e,t){var n;if(void 0===t&&(t=!1),b(e))n=new u(e.data);else if(A(e))n=new d(e.data);else if(m(e)){var i=t?E(e.children):[],r=new g(e.name,s({},e.attribs),i);i.forEach((function(e){return e.parent=r})),null!=e.namespace&&(r.namespace=e.namespace),e["x-attribsNamespace"]&&(r["x-attribsNamespace"]=s({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(r["x-attribsPrefix"]=s({},e["x-attribsPrefix"])),n=r}else if(v(e)){i=t?E(e.children):[];var o=new p(i);i.forEach((function(e){return e.parent=o})),n=o}else if(w(e)){i=t?E(e.children):[];var a=new f(i);i.forEach((function(e){return e.parent=a})),e["x-mode"]&&(a["x-mode"]=e["x-mode"]),n=a}else{if(!y(e))throw new Error("Not implemented yet: ".concat(e.type));var l=new c(e.name,e.data);null!=e["x-name"]&&(l["x-name"]=e["x-name"],l["x-publicId"]=e["x-publicId"],l["x-systemId"]=e["x-systemId"]),n=l}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function E(e){for(var t=e.map((function(e){return _(e,!0)})),n=1;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFeed=void 0;var i=n(1523),r=n(2839);t.getFeed=function(e){var t=l(c,e);return t?"feed"===t.name?function(e){var t,n=e.children,i={type:"atom",items:(0,r.getElementsByTagName)("entry",n).map((function(e){var t,n=e.children,i={media:a(n)};d(i,"id","id",n),d(i,"title","title",n);var r=null===(t=l("link",n))||void 0===t?void 0:t.attribs.href;r&&(i.link=r);var s=u("summary",n)||u("content",n);s&&(i.description=s);var o=u("updated",n);return o&&(i.pubDate=new Date(o)),i}))};d(i,"id","id",n),d(i,"title","title",n);var s=null===(t=l("link",n))||void 0===t?void 0:t.attribs.href;s&&(i.link=s),d(i,"description","subtitle",n);var o=u("updated",n);return o&&(i.updated=new Date(o)),d(i,"author","email",n,!0),i}(t):function(e){var t,n,i=null!==(n=null===(t=l("channel",e.children))||void 0===t?void 0:t.children)&&void 0!==n?n:[],s={type:e.name.substr(0,3),id:"",items:(0,r.getElementsByTagName)("item",e.children).map((function(e){var t=e.children,n={media:a(t)};d(n,"id","guid",t),d(n,"title","title",t),d(n,"link","link",t),d(n,"description","description",t);var i=u("pubDate",t)||u("dc:date",t);return i&&(n.pubDate=new Date(i)),n}))};d(s,"title","title",i),d(s,"link","link",i),d(s,"description","description",i);var o=u("lastBuildDate",i);return o&&(s.updated=new Date(o)),d(s,"author","managingEditor",i,!0),s}(t):null};var s=["url","type","lang"],o=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function a(e){return(0,r.getElementsByTagName)("media:content",e).map((function(e){for(var t=e.attribs,n={medium:t.medium,isDefault:!!t.isDefault},i=0,r=s;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uniqueSort=t.compareDocumentPosition=t.DocumentPosition=t.removeSubsets=void 0;var i,r=n(2159);function s(e,t){var n=[],s=[];if(e===t)return 0;for(var o=(0,r.hasChildren)(e)?e:e.parent;o;)n.unshift(o),o=o.parent;for(o=(0,r.hasChildren)(t)?t:t.parent;o;)s.unshift(o),o=o.parent;for(var a=Math.min(n.length,s.length),l=0;ld.indexOf(h)?u===t?i.FOLLOWING|i.CONTAINED_BY:i.FOLLOWING:u===e?i.PRECEDING|i.CONTAINS:i.PRECEDING}t.removeSubsets=function(e){for(var t=e.length;--t>=0;){var n=e[t];if(t>0&&e.lastIndexOf(n,t-1)>=0)e.splice(t,1);else for(var i=n.parent;i;i=i.parent)if(e.includes(i)){e.splice(t,1);break}}return e},function(e){e[e.DISCONNECTED=1]="DISCONNECTED",e[e.PRECEDING=2]="PRECEDING",e[e.FOLLOWING=4]="FOLLOWING",e[e.CONTAINS=8]="CONTAINS",e[e.CONTAINED_BY=16]="CONTAINED_BY"}(i=t.DocumentPosition||(t.DocumentPosition={})),t.compareDocumentPosition=s,t.uniqueSort=function(e){return(e=e.filter((function(e,t,n){return!n.includes(e,t+1)}))).sort((function(e,t){var n=s(e,t);return n&i.PRECEDING?-1:n&i.FOLLOWING?1:0})),e}},9086:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.hasChildren=t.isDocument=t.isComment=t.isText=t.isCDATA=t.isTag=void 0,r(n(1523),t),r(n(4484),t),r(n(7549),t),r(n(1480),t),r(n(2839),t),r(n(2591),t),r(n(2615),t);var s=n(2159);Object.defineProperty(t,"isTag",{enumerable:!0,get:function(){return s.isTag}}),Object.defineProperty(t,"isCDATA",{enumerable:!0,get:function(){return s.isCDATA}}),Object.defineProperty(t,"isText",{enumerable:!0,get:function(){return s.isText}}),Object.defineProperty(t,"isComment",{enumerable:!0,get:function(){return s.isComment}}),Object.defineProperty(t,"isDocument",{enumerable:!0,get:function(){return s.isDocument}}),Object.defineProperty(t,"hasChildren",{enumerable:!0,get:function(){return s.hasChildren}})},2839:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getElementsByTagType=t.getElementsByTagName=t.getElementById=t.getElements=t.testElement=void 0;var i=n(2159),r=n(1480),s={tag_name:function(e){return"function"==typeof e?function(t){return(0,i.isTag)(t)&&e(t.name)}:"*"===e?i.isTag:function(t){return(0,i.isTag)(t)&&t.name===e}},tag_type:function(e){return"function"==typeof e?function(t){return e(t.type)}:function(t){return t.type===e}},tag_contains:function(e){return"function"==typeof e?function(t){return(0,i.isText)(t)&&e(t.data)}:function(t){return(0,i.isText)(t)&&t.data===e}}};function o(e,t){return"function"==typeof t?function(n){return(0,i.isTag)(n)&&t(n.attribs[e])}:function(n){return(0,i.isTag)(n)&&n.attribs[e]===t}}function a(e,t){return function(n){return e(n)||t(n)}}function l(e){var t=Object.keys(e).map((function(t){var n=e[t];return Object.prototype.hasOwnProperty.call(s,t)?s[t](n):o(t,n)}));return 0===t.length?null:t.reduce(a)}t.testElement=function(e,t){var n=l(e);return!n||n(t)},t.getElements=function(e,t,n,i){void 0===i&&(i=1/0);var s=l(e);return s?(0,r.filter)(s,t,n,i):[]},t.getElementById=function(e,t,n){return void 0===n&&(n=!0),Array.isArray(t)||(t=[t]),(0,r.findOne)(o("id",e),t,n)},t.getElementsByTagName=function(e,t,n,i){return void 0===n&&(n=!0),void 0===i&&(i=1/0),(0,r.filter)(s.tag_name(e),t,n,i)},t.getElementsByTagType=function(e,t,n,i){return void 0===n&&(n=!0),void 0===i&&(i=1/0),(0,r.filter)(s.tag_type(e),t,n,i)}},7549:(e,t)=>{"use strict";function n(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){var t=e.parent.children,n=t.lastIndexOf(e);n>=0&&t.splice(n,1)}e.next=null,e.prev=null,e.parent=null}Object.defineProperty(t,"__esModule",{value:!0}),t.prepend=t.prependChild=t.append=t.appendChild=t.replaceElement=t.removeElement=void 0,t.removeElement=n,t.replaceElement=function(e,t){var n=t.prev=e.prev;n&&(n.next=t);var i=t.next=e.next;i&&(i.prev=t);var r=t.parent=e.parent;if(r){var s=r.children;s[s.lastIndexOf(e)]=t,e.parent=null}},t.appendChild=function(e,t){if(n(t),t.next=null,t.parent=e,e.children.push(t)>1){var i=e.children[e.children.length-2];i.next=t,t.prev=i}else t.prev=null},t.append=function(e,t){n(t);var i=e.parent,r=e.next;if(t.next=r,t.prev=e,e.next=t,t.parent=i,r){if(r.prev=t,i){var s=i.children;s.splice(s.lastIndexOf(r),0,t)}}else i&&i.children.push(t)},t.prependChild=function(e,t){if(n(t),t.parent=e,t.prev=null,1!==e.children.unshift(t)){var i=e.children[1];i.prev=t,t.next=i}else t.next=null},t.prepend=function(e,t){n(t);var i=e.parent;if(i){var r=i.children;r.splice(r.indexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=i,t.prev=e.prev,t.next=e,e.prev=t}},1480:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findAll=t.existsOne=t.findOne=t.findOneChild=t.find=t.filter=void 0;var i=n(2159);function r(e,t,n,r){for(var s=[],o=[t],a=[0];;)if(a[0]>=o[0].length){if(1===a.length)return s;o.shift(),a.shift()}else{var l=o[0][a[0]++];if(e(l)&&(s.push(l),--r<=0))return s;n&&(0,i.hasChildren)(l)&&l.children.length>0&&(a.unshift(0),o.unshift(l.children))}}t.filter=function(e,t,n,i){return void 0===n&&(n=!0),void 0===i&&(i=1/0),r(e,Array.isArray(t)?t:[t],n,i)},t.find=r,t.findOneChild=function(e,t){return t.find(e)},t.findOne=function e(t,n,r){void 0===r&&(r=!0);for(var s=null,o=0;o0&&(s=e(t,a.children,!0)))}return s},t.existsOne=function e(t,n){return n.some((function(n){return(0,i.isTag)(n)&&(t(n)||e(t,n.children))}))},t.findAll=function(e,t){for(var n=[],r=[t],s=[0];;)if(s[0]>=r[0].length){if(1===r.length)return n;r.shift(),s.shift()}else{var o=r[0][s[0]++];(0,i.isTag)(o)&&(e(o)&&n.push(o),o.children.length>0&&(s.unshift(0),r.unshift(o.children)))}}},1523:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.innerText=t.textContent=t.getText=t.getInnerHTML=t.getOuterHTML=void 0;var r=n(2159),s=i(n(5552)),o=n(3338);function a(e,t){return(0,s.default)(e,t)}t.getOuterHTML=a,t.getInnerHTML=function(e,t){return(0,r.hasChildren)(e)?e.children.map((function(e){return a(e,t)})).join(""):""},t.getText=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,r.isTag)(t)?"br"===t.name?"\n":e(t.children):(0,r.isCDATA)(t)?e(t.children):(0,r.isText)(t)?t.data:""},t.textContent=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,r.hasChildren)(t)&&!(0,r.isComment)(t)?e(t.children):(0,r.isText)(t)?t.data:""},t.innerText=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,r.hasChildren)(t)&&(t.type===o.ElementType.Tag||(0,r.isCDATA)(t))?e(t.children):(0,r.isText)(t)?t.data:""}},4484:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prevElementSibling=t.nextElementSibling=t.getName=t.hasAttrib=t.getAttributeValue=t.getSiblings=t.getParent=t.getChildren=void 0;var i=n(2159);function r(e){return(0,i.hasChildren)(e)?e.children:[]}function s(e){return e.parent||null}t.getChildren=r,t.getParent=s,t.getSiblings=function(e){var t=s(e);if(null!=t)return r(t);for(var n=[e],i=e.prev,o=e.next;null!=i;)n.unshift(i),i=i.prev;for(;null!=o;)n.push(o),o=o.next;return n},t.getAttributeValue=function(e,t){var n;return null===(n=e.attribs)||void 0===n?void 0:n[t]},t.hasAttrib=function(e,t){return null!=e.attribs&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&null!=e.attribs[t]},t.getName=function(e){return e.name},t.nextElementSibling=function(e){for(var t=e.next;null!==t&&!(0,i.isTag)(t);)t=t.next;return t},t.prevElementSibling=function(e){for(var t=e.prev;null!==t&&!(0,i.isTag)(t);)t=t.prev;return t}},2978:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=void 0;var o=s(n(8544)),a=n(3379),l=new Set(["input","option","optgroup","select","button","datalist","textarea"]),u=new Set(["p"]),d=new Set(["thead","tbody"]),c=new Set(["dd","dt"]),h=new Set(["rt","rp"]),p=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",u],["h1",u],["h2",u],["h3",u],["h4",u],["h5",u],["h6",u],["select",l],["input",l],["output",l],["button",l],["datalist",l],["textarea",l],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",c],["dt",c],["address",u],["article",u],["aside",u],["blockquote",u],["details",u],["div",u],["dl",u],["fieldset",u],["figcaption",u],["figure",u],["footer",u],["form",u],["header",u],["hr",u],["main",u],["nav",u],["ol",u],["pre",u],["section",u],["table",u],["ul",u],["rt",h],["rp",h],["tbody",d],["tfoot",d]]),f=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),g=new Set(["math","svg"]),m=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),v=/\s|\//,b=function(){function e(e,t){var n,i,r,s,a;void 0===t&&(t={}),this.options=t,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.foreignContext=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=null!=e?e:{},this.lowerCaseTagNames=null!==(n=t.lowerCaseTags)&&void 0!==n?n:!t.xmlMode,this.lowerCaseAttributeNames=null!==(i=t.lowerCaseAttributeNames)&&void 0!==i?i:!t.xmlMode,this.tokenizer=new(null!==(r=t.Tokenizer)&&void 0!==r?r:o.default)(this.options,this),null===(a=(s=this.cbs).onparserinit)||void 0===a||a.call(s,this)}return e.prototype.ontext=function(e,t){var n,i,r=this.getSlice(e,t);this.endIndex=t-1,null===(i=(n=this.cbs).ontext)||void 0===i||i.call(n,r),this.startIndex=t},e.prototype.ontextentity=function(e){var t,n,i=this.tokenizer.getSectionStart();this.endIndex=i-1,null===(n=(t=this.cbs).ontext)||void 0===n||n.call(t,(0,a.fromCodePoint)(e)),this.startIndex=i},e.prototype.isVoidElement=function(e){return!this.options.xmlMode&&f.has(e)},e.prototype.onopentagname=function(e,t){this.endIndex=t;var n=this.getSlice(e,t);this.lowerCaseTagNames&&(n=n.toLowerCase()),this.emitOpenTag(n)},e.prototype.emitOpenTag=function(e){var t,n,i,r;this.openTagStart=this.startIndex,this.tagname=e;var s=!this.options.xmlMode&&p.get(e);if(s)for(;this.stack.length>0&&s.has(this.stack[this.stack.length-1]);){var o=this.stack.pop();null===(n=(t=this.cbs).onclosetag)||void 0===n||n.call(t,o,!0)}this.isVoidElement(e)||(this.stack.push(e),g.has(e)?this.foreignContext.push(!0):m.has(e)&&this.foreignContext.push(!1)),null===(r=(i=this.cbs).onopentagname)||void 0===r||r.call(i,e),this.cbs.onopentag&&(this.attribs={})},e.prototype.endOpenTag=function(e){var t,n;this.startIndex=this.openTagStart,this.attribs&&(null===(n=(t=this.cbs).onopentag)||void 0===n||n.call(t,this.tagname,this.attribs,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""},e.prototype.onopentagend=function(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1},e.prototype.onclosetag=function(e,t){var n,i,r,s,o,a;this.endIndex=t;var l=this.getSlice(e,t);if(this.lowerCaseTagNames&&(l=l.toLowerCase()),(g.has(l)||m.has(l))&&this.foreignContext.pop(),this.isVoidElement(l))this.options.xmlMode||"br"!==l||(null===(i=(n=this.cbs).onopentagname)||void 0===i||i.call(n,"br"),null===(s=(r=this.cbs).onopentag)||void 0===s||s.call(r,"br",{},!0),null===(a=(o=this.cbs).onclosetag)||void 0===a||a.call(o,"br",!1));else{var u=this.stack.lastIndexOf(l);if(-1!==u)if(this.cbs.onclosetag)for(var d=this.stack.length-u;d--;)this.cbs.onclosetag(this.stack.pop(),0!==d);else this.stack.length=u;else this.options.xmlMode||"p"!==l||(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=t+1},e.prototype.onselfclosingtag=function(e){this.endIndex=e,this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)},e.prototype.closeCurrentTag=function(e){var t,n,i=this.tagname;this.endOpenTag(e),this.stack[this.stack.length-1]===i&&(null===(n=(t=this.cbs).onclosetag)||void 0===n||n.call(t,i,!e),this.stack.pop())},e.prototype.onattribname=function(e,t){this.startIndex=e;var n=this.getSlice(e,t);this.attribname=this.lowerCaseAttributeNames?n.toLowerCase():n},e.prototype.onattribdata=function(e,t){this.attribvalue+=this.getSlice(e,t)},e.prototype.onattribentity=function(e){this.attribvalue+=(0,a.fromCodePoint)(e)},e.prototype.onattribend=function(e,t){var n,i;this.endIndex=t,null===(i=(n=this.cbs).onattribute)||void 0===i||i.call(n,this.attribname,this.attribvalue,e===o.QuoteType.Double?'"':e===o.QuoteType.Single?"'":e===o.QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""},e.prototype.getInstructionName=function(e){var t=e.search(v),n=t<0?e:e.substr(0,t);return this.lowerCaseTagNames&&(n=n.toLowerCase()),n},e.prototype.ondeclaration=function(e,t){this.endIndex=t;var n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){var i=this.getInstructionName(n);this.cbs.onprocessinginstruction("!".concat(i),"!".concat(n))}this.startIndex=t+1},e.prototype.onprocessinginstruction=function(e,t){this.endIndex=t;var n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){var i=this.getInstructionName(n);this.cbs.onprocessinginstruction("?".concat(i),"?".concat(n))}this.startIndex=t+1},e.prototype.oncomment=function(e,t,n){var i,r,s,o;this.endIndex=t,null===(r=(i=this.cbs).oncomment)||void 0===r||r.call(i,this.getSlice(e,t-n)),null===(o=(s=this.cbs).oncommentend)||void 0===o||o.call(s),this.startIndex=t+1},e.prototype.oncdata=function(e,t,n){var i,r,s,o,a,l,u,d,c,h;this.endIndex=t;var p=this.getSlice(e,t-n);this.options.xmlMode||this.options.recognizeCDATA?(null===(r=(i=this.cbs).oncdatastart)||void 0===r||r.call(i),null===(o=(s=this.cbs).ontext)||void 0===o||o.call(s,p),null===(l=(a=this.cbs).oncdataend)||void 0===l||l.call(a)):(null===(d=(u=this.cbs).oncomment)||void 0===d||d.call(u,"[CDATA[".concat(p,"]]")),null===(h=(c=this.cbs).oncommentend)||void 0===h||h.call(c)),this.startIndex=t+1},e.prototype.onend=function(){var e,t;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(var n=this.stack.length;n>0;this.cbs.onclosetag(this.stack[--n],!0));}null===(t=(e=this.cbs).onend)||void 0===t||t.call(e)},e.prototype.reset=function(){var e,t,n,i;null===(t=(e=this.cbs).onreset)||void 0===t||t.call(e),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,null===(i=(n=this.cbs).onparserinit)||void 0===i||i.call(n,this),this.buffers.length=0,this.bufferOffset=0,this.writeIndex=0,this.ended=!1},e.prototype.parseComplete=function(e){this.reset(),this.end(e)},e.prototype.getSlice=function(e,t){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();for(var n=this.buffers[0].slice(e-this.bufferOffset,t-this.bufferOffset);t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),n+=this.buffers[0].slice(0,t-this.bufferOffset);return n},e.prototype.shiftBuffer=function(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()},e.prototype.write=function(e){var t,n;this.ended?null===(n=(t=this.cbs).onerror)||void 0===n||n.call(t,new Error(".write() after done!")):(this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++))},e.prototype.end=function(e){var t,n;this.ended?null===(n=(t=this.cbs).onerror)||void 0===n||n.call(t,new Error(".end() after done!")):(e&&this.write(e),this.ended=!0,this.tokenizer.end())},e.prototype.pause=function(){this.tokenizer.pause()},e.prototype.resume=function(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuoteType=void 0;var i,r,s,o=n(3379);function a(e){return e===i.Space||e===i.NewLine||e===i.Tab||e===i.FormFeed||e===i.CarriageReturn}function l(e){return e===i.Slash||e===i.Gt||a(e)}function u(e){return e>=i.Zero&&e<=i.Nine}!function(e){e[e.Tab=9]="Tab",e[e.NewLine=10]="NewLine",e[e.FormFeed=12]="FormFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.Number=35]="Number",e[e.Amp=38]="Amp",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Zero=48]="Zero",e[e.Nine=57]="Nine",e[e.Semi=59]="Semi",e[e.Lt=60]="Lt",e[e.Eq=61]="Eq",e[e.Gt=62]="Gt",e[e.Questionmark=63]="Questionmark",e[e.UpperA=65]="UpperA",e[e.LowerA=97]="LowerA",e[e.UpperF=70]="UpperF",e[e.LowerF=102]="LowerF",e[e.UpperZ=90]="UpperZ",e[e.LowerZ=122]="LowerZ",e[e.LowerX=120]="LowerX",e[e.OpeningSquareBracket=91]="OpeningSquareBracket"}(i||(i={})),function(e){e[e.Text=1]="Text",e[e.BeforeTagName=2]="BeforeTagName",e[e.InTagName=3]="InTagName",e[e.InSelfClosingTag=4]="InSelfClosingTag",e[e.BeforeClosingTagName=5]="BeforeClosingTagName",e[e.InClosingTagName=6]="InClosingTagName",e[e.AfterClosingTagName=7]="AfterClosingTagName",e[e.BeforeAttributeName=8]="BeforeAttributeName",e[e.InAttributeName=9]="InAttributeName",e[e.AfterAttributeName=10]="AfterAttributeName",e[e.BeforeAttributeValue=11]="BeforeAttributeValue",e[e.InAttributeValueDq=12]="InAttributeValueDq",e[e.InAttributeValueSq=13]="InAttributeValueSq",e[e.InAttributeValueNq=14]="InAttributeValueNq",e[e.BeforeDeclaration=15]="BeforeDeclaration",e[e.InDeclaration=16]="InDeclaration",e[e.InProcessingInstruction=17]="InProcessingInstruction",e[e.BeforeComment=18]="BeforeComment",e[e.CDATASequence=19]="CDATASequence",e[e.InSpecialComment=20]="InSpecialComment",e[e.InCommentLike=21]="InCommentLike",e[e.BeforeSpecialS=22]="BeforeSpecialS",e[e.SpecialStartSequence=23]="SpecialStartSequence",e[e.InSpecialTag=24]="InSpecialTag",e[e.BeforeEntity=25]="BeforeEntity",e[e.BeforeNumericEntity=26]="BeforeNumericEntity",e[e.InNamedEntity=27]="InNamedEntity",e[e.InNumericEntity=28]="InNumericEntity",e[e.InHexEntity=29]="InHexEntity"}(r||(r={})),function(e){e[e.NoValue=0]="NoValue",e[e.Unquoted=1]="Unquoted",e[e.Single=2]="Single",e[e.Double=3]="Double"}(s=t.QuoteType||(t.QuoteType={}));var d={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])},c=function(){function e(e,t){var n=e.xmlMode,i=void 0!==n&&n,s=e.decodeEntities,a=void 0===s||s;this.cbs=t,this.state=r.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=r.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.trieIndex=0,this.trieCurrent=0,this.entityResult=0,this.entityExcess=0,this.xmlMode=i,this.decodeEntities=a,this.entityTrie=i?o.xmlDecodeTree:o.htmlDecodeTree}return e.prototype.reset=function(){this.state=r.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=r.Text,this.currentSequence=void 0,this.running=!0,this.offset=0},e.prototype.write=function(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()},e.prototype.end=function(){this.running&&this.finish()},e.prototype.pause=function(){this.running=!1},e.prototype.resume=function(){this.running=!0,this.indexthis.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=r.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===i.Amp&&(this.state=r.BeforeEntity)},e.prototype.stateSpecialStartSequence=function(e){var t=this.sequenceIndex===this.currentSequence.length;if(t?l(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t)return void this.sequenceIndex++}else this.isSpecial=!1;this.sequenceIndex=0,this.state=r.InTagName,this.stateInTagName(e)},e.prototype.stateInSpecialTag=function(e){if(this.sequenceIndex===this.currentSequence.length){if(e===i.Gt||a(e)){var t=this.index-this.currentSequence.length;if(this.sectionStart=i.LowerA&&e<=i.LowerZ||e>=i.UpperA&&e<=i.UpperZ}(e)},e.prototype.startSpecial=function(e,t){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=t,this.state=r.SpecialStartSequence},e.prototype.stateBeforeTagName=function(e){if(e===i.ExclamationMark)this.state=r.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===i.Questionmark)this.state=r.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){var t=32|e;this.sectionStart=this.index,this.xmlMode||t!==d.TitleEnd[2]?this.state=this.xmlMode||t!==d.ScriptEnd[2]?r.InTagName:r.BeforeSpecialS:this.startSpecial(d.TitleEnd,3)}else e===i.Slash?this.state=r.BeforeClosingTagName:(this.state=r.Text,this.stateText(e))},e.prototype.stateInTagName=function(e){l(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(e))},e.prototype.stateBeforeClosingTagName=function(e){a(e)||(e===i.Gt?this.state=r.Text:(this.state=this.isTagStartChar(e)?r.InClosingTagName:r.InSpecialComment,this.sectionStart=this.index))},e.prototype.stateInClosingTagName=function(e){(e===i.Gt||a(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=r.AfterClosingTagName,this.stateAfterClosingTagName(e))},e.prototype.stateAfterClosingTagName=function(e){(e===i.Gt||this.fastForwardTo(i.Gt))&&(this.state=r.Text,this.baseState=r.Text,this.sectionStart=this.index+1)},e.prototype.stateBeforeAttributeName=function(e){e===i.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=r.InSpecialTag,this.sequenceIndex=0):this.state=r.Text,this.baseState=this.state,this.sectionStart=this.index+1):e===i.Slash?this.state=r.InSelfClosingTag:a(e)||(this.state=r.InAttributeName,this.sectionStart=this.index)},e.prototype.stateInSelfClosingTag=function(e){e===i.Gt?(this.cbs.onselfclosingtag(this.index),this.state=r.Text,this.baseState=r.Text,this.sectionStart=this.index+1,this.isSpecial=!1):a(e)||(this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(e))},e.prototype.stateInAttributeName=function(e){(e===i.Eq||l(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=-1,this.state=r.AfterAttributeName,this.stateAfterAttributeName(e))},e.prototype.stateAfterAttributeName=function(e){e===i.Eq?this.state=r.BeforeAttributeValue:e===i.Slash||e===i.Gt?(this.cbs.onattribend(s.NoValue,this.index),this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(e)):a(e)||(this.cbs.onattribend(s.NoValue,this.index),this.state=r.InAttributeName,this.sectionStart=this.index)},e.prototype.stateBeforeAttributeValue=function(e){e===i.DoubleQuote?(this.state=r.InAttributeValueDq,this.sectionStart=this.index+1):e===i.SingleQuote?(this.state=r.InAttributeValueSq,this.sectionStart=this.index+1):a(e)||(this.sectionStart=this.index,this.state=r.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))},e.prototype.handleInAttributeValue=function(e,t){e===t||!this.decodeEntities&&this.fastForwardTo(t)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(t===i.DoubleQuote?s.Double:s.Single,this.index),this.state=r.BeforeAttributeName):this.decodeEntities&&e===i.Amp&&(this.baseState=this.state,this.state=r.BeforeEntity)},e.prototype.stateInAttributeValueDoubleQuotes=function(e){this.handleInAttributeValue(e,i.DoubleQuote)},e.prototype.stateInAttributeValueSingleQuotes=function(e){this.handleInAttributeValue(e,i.SingleQuote)},e.prototype.stateInAttributeValueNoQuotes=function(e){a(e)||e===i.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(s.Unquoted,this.index),this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===i.Amp&&(this.baseState=this.state,this.state=r.BeforeEntity)},e.prototype.stateBeforeDeclaration=function(e){e===i.OpeningSquareBracket?(this.state=r.CDATASequence,this.sequenceIndex=0):this.state=e===i.Dash?r.BeforeComment:r.InDeclaration},e.prototype.stateInDeclaration=function(e){(e===i.Gt||this.fastForwardTo(i.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=r.Text,this.sectionStart=this.index+1)},e.prototype.stateInProcessingInstruction=function(e){(e===i.Gt||this.fastForwardTo(i.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=r.Text,this.sectionStart=this.index+1)},e.prototype.stateBeforeComment=function(e){e===i.Dash?(this.state=r.InCommentLike,this.currentSequence=d.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=r.InDeclaration},e.prototype.stateInSpecialComment=function(e){(e===i.Gt||this.fastForwardTo(i.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=r.Text,this.sectionStart=this.index+1)},e.prototype.stateBeforeSpecialS=function(e){var t=32|e;t===d.ScriptEnd[3]?this.startSpecial(d.ScriptEnd,4):t===d.StyleEnd[3]?this.startSpecial(d.StyleEnd,4):(this.state=r.InTagName,this.stateInTagName(e))},e.prototype.stateBeforeEntity=function(e){this.entityExcess=1,this.entityResult=0,e===i.Number?this.state=r.BeforeNumericEntity:e===i.Amp||(this.trieIndex=0,this.trieCurrent=this.entityTrie[0],this.state=r.InNamedEntity,this.stateInNamedEntity(e))},e.prototype.stateInNamedEntity=function(e){if(this.entityExcess+=1,this.trieIndex=(0,o.determineBranch)(this.entityTrie,this.trieCurrent,this.trieIndex+1,e),this.trieIndex<0)return this.emitNamedEntity(),void this.index--;this.trieCurrent=this.entityTrie[this.trieIndex];var t=this.trieCurrent&o.BinTrieFlags.VALUE_LENGTH;if(t){var n=(t>>14)-1;if(this.allowLegacyEntity()||e===i.Semi){var r=this.index-this.entityExcess+1;r>this.sectionStart&&this.emitPartial(this.sectionStart,r),this.entityResult=this.trieIndex,this.trieIndex+=n,this.entityExcess=0,this.sectionStart=this.index+1,0===n&&this.emitNamedEntity()}else this.trieIndex+=n}},e.prototype.emitNamedEntity=function(){if(this.state=this.baseState,0!==this.entityResult)switch((this.entityTrie[this.entityResult]&o.BinTrieFlags.VALUE_LENGTH)>>14){case 1:this.emitCodePoint(this.entityTrie[this.entityResult]&~o.BinTrieFlags.VALUE_LENGTH);break;case 2:this.emitCodePoint(this.entityTrie[this.entityResult+1]);break;case 3:this.emitCodePoint(this.entityTrie[this.entityResult+1]),this.emitCodePoint(this.entityTrie[this.entityResult+2])}},e.prototype.stateBeforeNumericEntity=function(e){(32|e)===i.LowerX?(this.entityExcess++,this.state=r.InHexEntity):(this.state=r.InNumericEntity,this.stateInNumericEntity(e))},e.prototype.emitNumericEntity=function(e){var t=this.index-this.entityExcess-1;t+2+Number(this.state===r.InHexEntity)!==this.index&&(t>this.sectionStart&&this.emitPartial(this.sectionStart,t),this.sectionStart=this.index+Number(e),this.emitCodePoint((0,o.replaceCodePoint)(this.entityResult))),this.state=this.baseState},e.prototype.stateInNumericEntity=function(e){e===i.Semi?this.emitNumericEntity(!0):u(e)?(this.entityResult=10*this.entityResult+(e-i.Zero),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},e.prototype.stateInHexEntity=function(e){e===i.Semi?this.emitNumericEntity(!0):u(e)?(this.entityResult=16*this.entityResult+(e-i.Zero),this.entityExcess++):function(e){return e>=i.UpperA&&e<=i.UpperF||e>=i.LowerA&&e<=i.LowerF}(e)?(this.entityResult=16*this.entityResult+((32|e)-i.LowerA+10),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},e.prototype.allowLegacyEntity=function(){return!this.xmlMode&&(this.baseState===r.Text||this.baseState===r.InSpecialTag)},e.prototype.cleanup=function(){this.running&&this.sectionStart!==this.index&&(this.state===r.Text||this.state===r.InSpecialTag&&0===this.sequenceIndex?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):this.state!==r.InAttributeValueDq&&this.state!==r.InAttributeValueSq&&this.state!==r.InAttributeValueNq||(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))},e.prototype.shouldContinue=function(){return this.index{"use strict";function n(e){return"[object Object]"===Object.prototype.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isPlainObject=function(e){var t,i;return!1!==n(e)&&(void 0===(t=e.constructor)||!1!==n(i=t.prototype)&&!1!==i.hasOwnProperty("isPrototypeOf"))}},1622:(e,t,n)=>{const i=n(4493),r=n(2189),{isPlainObject:s}=n(9244),o=n(2743),a=n(8287),{parse:l}=n(1412),u=["img","audio","video","picture","svg","object","map","iframe","embed"],d=["script","style"];function c(e,t){e&&Object.keys(e).forEach((function(n){t(e[n],n)}))}function h(e,t){return{}.hasOwnProperty.call(e,t)}function p(e,t){const n=[];return c(e,(function(e){t(e)&&n.push(e)})),n}e.exports=g;const f=/^[^\0\t\n\f\r /<=>]+$/;function g(e,t,n){if(null==e)return"";"number"==typeof e&&(e=e.toString());let v="",b="";function A(e,t){const n=this;this.tag=e,this.attribs=t||{},this.tagPosition=v.length,this.text="",this.mediaChildren=[],this.updateParentNodeText=function(){k.length&&(k[k.length-1].text+=n.text)},this.updateParentNodeMediaChildren=function(){k.length&&u.includes(this.tag)&&k[k.length-1].mediaChildren.push(this.tag)}}(t=Object.assign({},g.defaults,t)).parser=Object.assign({},m,t.parser);const y=function(e){return!1===t.allowedTags||(t.allowedTags||[]).indexOf(e)>-1};d.forEach((function(e){y(e)&&!t.allowVulnerableTags&&console.warn(`\n\n⚠️ Your \`allowedTags\` option includes, \`${e}\`, which is inherently\nvulnerable to XSS attacks. Please remove it from \`allowedTags\`.\nOr, to disable this warning, add the \`allowVulnerableTags\` option\nand ensure you are accounting for this risk.\n\n`)}));const w=t.nonTextTags||["script","style","textarea","option"];let _,E;t.allowedAttributes&&(_={},E={},c(t.allowedAttributes,(function(e,t){_[t]=[];const n=[];e.forEach((function(e){"string"==typeof e&&e.indexOf("*")>=0?n.push(r(e).replace(/\\\*/g,".*")):_[t].push(e)})),n.length&&(E[t]=new RegExp("^("+n.join("|")+")$"))})));const C={},x={},D={};c(t.allowedClasses,(function(e,t){if(_&&(h(_,t)||(_[t]=[]),_[t].push("class")),C[t]=e,Array.isArray(e)){const n=[];C[t]=[],D[t]=[],e.forEach((function(e){"string"==typeof e&&e.indexOf("*")>=0?n.push(r(e).replace(/\\\*/g,".*")):e instanceof RegExp?D[t].push(e):C[t].push(e)})),n.length&&(x[t]=new RegExp("^("+n.join("|")+")$"))}}));const S={};let T,B,k,M,j,O,I;c(t.transformTags,(function(e,t){let n;"function"==typeof e?n=e:"string"==typeof e&&(n=g.simpleTransform(e)),"*"===t?T=n:S[t]=n}));let P=!1;L();const R=new i.Parser({onopentag:function(e,n){if(t.enforceHtmlBoundary&&"html"===e&&L(),O)return void I++;const i=new A(e,n);k.push(i);let r=!1;const u=!!i.text;let d;if(h(S,e)&&(d=S[e](e,n),i.attribs=n=d.attribs,void 0!==d.text&&(i.innerText=d.text),e!==d.tagName&&(i.name=e=d.tagName,j[B]=d.tagName)),T&&(d=T(e,n),i.attribs=n=d.attribs,e!==d.tagName&&(i.name=e=d.tagName,j[B]=d.tagName)),(!y(e)||"recursiveEscape"===t.disallowedTagsMode&&!function(e){for(const t in e)if(h(e,t))return!1;return!0}(M)||null!=t.nestingLimit&&B>=t.nestingLimit)&&(r=!0,M[B]=!0,"discard"===t.disallowedTagsMode&&-1!==w.indexOf(e)&&(O=!0,I=1),M[B]=!0),B++,r){if("discard"===t.disallowedTagsMode)return;b=v,v=""}v+="<"+e,"script"===e&&(t.allowedScriptHostnames||t.allowedScriptDomains)&&(i.innerText=""),(!_||h(_,e)||_["*"])&&c(n,(function(n,r){if(!f.test(r))return void delete i.attribs[r];if(""===n&&!t.allowedEmptyAttributes.includes(r)&&(t.nonBooleanAttributes.includes(r)||t.nonBooleanAttributes.includes("*")))return void delete i.attribs[r];let u=!1;if(!_||h(_,e)&&-1!==_[e].indexOf(r)||_["*"]&&-1!==_["*"].indexOf(r)||h(E,e)&&E[e].test(r)||E["*"]&&E["*"].test(r))u=!0;else if(_&&_[e])for(const t of _[e])if(s(t)&&t.name&&t.name===r){u=!0;let e="";if(!0===t.multiple){const i=n.split(" ");for(const n of i)-1!==t.values.indexOf(n)&&(""===e?e=n:e+=" "+n)}else t.values.indexOf(n)>=0&&(e=n);n=e}if(u){if(-1!==t.allowedSchemesAppliedToAttributes.indexOf(r)&&F(e,n))return void delete i.attribs[r];if("script"===e&&"src"===r){let e=!0;try{const i=z(n);if(t.allowedScriptHostnames||t.allowedScriptDomains){const n=(t.allowedScriptHostnames||[]).find((function(e){return e===i.url.hostname})),r=(t.allowedScriptDomains||[]).find((function(e){return i.url.hostname===e||i.url.hostname.endsWith(`.${e}`)}));e=n||r}}catch(t){e=!1}if(!e)return void delete i.attribs[r]}if("iframe"===e&&"src"===r){let e=!0;try{const i=z(n);if(i.isRelativeUrl)e=h(t,"allowIframeRelativeUrls")?t.allowIframeRelativeUrls:!t.allowedIframeHostnames&&!t.allowedIframeDomains;else if(t.allowedIframeHostnames||t.allowedIframeDomains){const n=(t.allowedIframeHostnames||[]).find((function(e){return e===i.url.hostname})),r=(t.allowedIframeDomains||[]).find((function(e){return i.url.hostname===e||i.url.hostname.endsWith(`.${e}`)}));e=n||r}}catch(t){e=!1}if(!e)return void delete i.attribs[r]}if("srcset"===r)try{let e=a(n);if(e.forEach((function(e){F("srcset",e.url)&&(e.evil=!0)})),e=p(e,(function(e){return!e.evil})),!e.length)return void delete i.attribs[r];n=p(e,(function(e){return!e.evil})).map((function(e){if(!e.url)throw new Error("URL missing");return e.url+(e.w?` ${e.w}w`:"")+(e.h?` ${e.h}h`:"")+(e.d?` ${e.d}x`:"")})).join(", "),i.attribs[r]=n}catch(e){return void delete i.attribs[r]}if("class"===r){const t=C[e],s=C["*"],a=x[e],l=D[e],u=[a,x["*"]].concat(l).filter((function(e){return e}));if(!(d=n,c=t&&s?o(t,s):t||s,g=u,n=c?(d=d.split(/\s+/)).filter((function(e){return-1!==c.indexOf(e)||g.some((function(t){return t.test(e)}))})).join(" "):d).length)return void delete i.attribs[r]}if("style"===r)if(t.parseStyleAttributes)try{if(n=function(e){return e.nodes[0].nodes.reduce((function(e,t){return e.push(`${t.prop}:${t.value}${t.important?" !important":""}`),e}),[]).join(";")}(function(e,t){if(!t)return e;const n=e.nodes[0];let i;return i=t[n.selector]&&t["*"]?o(t[n.selector],t["*"]):t[n.selector]||t["*"],i&&(e.nodes[0].nodes=n.nodes.reduce(function(e){return function(t,n){return h(e,n.prop)&&e[n.prop].some((function(e){return e.test(n.value)}))&&t.push(n),t}}(i),[])),e}(l(e+" {"+n+"}",{map:!1}),t.allowedStyles)),0===n.length)return void delete i.attribs[r]}catch(t){return"undefined"!=typeof window&&console.warn('Failed to parse "'+e+" {"+n+"}\", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547"),void delete i.attribs[r]}else if(t.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.");v+=" "+r,n&&n.length?v+='="'+N(n,!0)+'"':t.allowedEmptyAttributes.includes(r)&&(v+='=""')}else delete i.attribs[r];var d,c,g})),-1!==t.selfClosing.indexOf(e)?v+=" />":(v+=">",!i.innerText||u||t.textFilter||(v+=N(i.innerText),P=!0)),r&&(v=b+N(v),b="")},ontext:function(e){if(O)return;const n=k[k.length-1];let i;if(n&&(i=n.tag,e=void 0!==n.innerText?n.innerText:e),"discard"!==t.disallowedTagsMode||"script"!==i&&"style"!==i){const n=N(e,!1);t.textFilter&&!P?v+=t.textFilter(n,i):P||(v+=n)}else v+=e;k.length&&(k[k.length-1].text+=e)},onclosetag:function(e,n){if(O){if(I--,I)return;O=!1}const i=k.pop();if(!i)return;if(i.tag!==e)return void k.push(i);O=!!t.enforceHtmlBoundary&&"html"===e,B--;const r=M[B];if(r){if(delete M[B],"discard"===t.disallowedTagsMode)return void i.updateParentNodeText();b=v,v=""}j[B]&&(e=j[B],delete j[B]),t.exclusiveFilter&&t.exclusiveFilter(i)?v=v.substr(0,i.tagPosition):(i.updateParentNodeMediaChildren(),i.updateParentNodeText(),-1!==t.selfClosing.indexOf(e)||n&&!y(e)&&["escape","recursiveEscape"].indexOf(t.disallowedTagsMode)>=0?r&&(v=b,b=""):(v+="",r&&(v=b+N(v),b=""),P=!1))}},t.parser);return R.write(e),R.end(),v;function L(){v="",B=0,k=[],M={},j={},O=!1,I=0}function N(e,n){return"string"!=typeof e&&(e+=""),t.parser.decodeEntities&&(e=e.replace(/&/g,"&").replace(//g,">"),n&&(e=e.replace(/"/g,"""))),e=e.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&").replace(//g,">"),n&&(e=e.replace(/"/g,""")),e}function F(e,n){for(n=n.replace(/[\x00-\x20]+/g,"");;){const e=n.indexOf("\x3c!--");if(-1===e)break;const t=n.indexOf("--\x3e",e+4);if(-1===t)break;n=n.substring(0,e)+n.substring(t+3)}const i=n.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!i)return!!n.match(/^[/\\]{2}/)&&!t.allowProtocolRelative;const r=i[1].toLowerCase();return h(t.allowedSchemesByTag,e)?-1===t.allowedSchemesByTag[e].indexOf(r):!t.allowedSchemes||-1===t.allowedSchemes.indexOf(r)}function z(e){if((e=e.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//")).startsWith("relative:"))throw new Error("relative: exploit attempt");let t="relative://relative-site";for(let e=0;e<100;e++)t+=`/${e}`;const n=new URL(e,t);return{isRelativeUrl:n&&"relative-site"===n.hostname&&"relative:"===n.protocol,url:n}}}const m={decodeEntities:!0};g.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","main","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},allowedEmptyAttributes:["alt"],selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0},g.simpleTransform=function(e,t,n){return n=void 0===n||n,t=t||{},function(i,r){let s;if(n)for(s in t)r[s]=t[s];else r=t;return{tagName:e,attribs:r}}}},9704:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivityMonitor=void 0;const i=n(8571);t.ActivityMonitor=class{constructor(e){this._timer=-1,this._timeout=-1,this._isDisposed=!1,this._activityStopped=new i.Signal(this),e.signal.connect(this._onSignalFired,this),this._timeout=e.timeout||1e3}get activityStopped(){return this._activityStopped}get timeout(){return this._timeout}set timeout(e){this._timeout=e}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,i.Signal.clearData(this))}_onSignalFired(e,t){clearTimeout(this._timer),this._sender=e,this._args=t,this._timer=setTimeout((()=>{this._activityStopped.emit({sender:this._sender,args:this._args})}),this._timeout)}}},8925:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(9704),t),r(n(9269),t),r(n(1232),t),r(n(9547),t),r(n(5964),t),r(n(9830),t),r(n(7361),t),r(n(8126),t),r(n(1796),t),r(n(1692),t)},9269:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LruCache=void 0,t.LruCache=class{constructor(e={}){this._map=new Map,this._maxSize=(null==e?void 0:e.maxSize)||128}get size(){return this._map.size}clear(){this._map.clear()}get(e){const t=this._map.get(e)||null;return null!=t&&(this._map.delete(e),this._map.set(e,t)),t}set(e,t){this._map.size>=this._maxSize&&this._map.delete(this._map.keys().next().value),this._map.set(e,t)}}},9547:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownCodeBlocks=void 0,function(e){e.CODE_BLOCK_MARKER="```";const t=[".markdown",".mdown",".mkdn",".md",".mkd",".mdwn",".mdtxt",".mdtext",".text",".txt",".Rmd"];class n{constructor(e){this.startLine=e,this.code="",this.endLine=-1}}e.MarkdownCodeBlock=n,e.isMarkdown=function(e){return t.indexOf(e)>-1},e.findMarkdownCodeBlocks=function(t){if(!t||""===t)return[];const i=t.split("\n"),r=[];let s=null;for(let t=0;te===t||i&&e===i))},e.isDisabled=function(t){const n=t.indexOf(":");let i="";return-1!==n&&(i=t.slice(0,n)),e.disabled.some((e=>e===t||i&&e===i))}}(Extension=PageConfig.Extension||(PageConfig.Extension={}))})(PageConfig||(exports.PageConfig=PageConfig={}))},9830:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PathExt=void 0;const i=n(9942);var r;!function(e){function t(e){return 0===e.indexOf("/")&&(e=e.slice(1)),e}e.join=function(...e){const n=i.posix.join(...e);return"."===n?"":t(n)},e.joinWithLeadingSlash=function(...e){const t=i.posix.join(...e);return"."===t?"":t},e.basename=function(e,t){return i.posix.basename(e,t)},e.dirname=function(e){const n=t(i.posix.dirname(e));return"."===n?"":n},e.extname=function(e){return i.posix.extname(e)},e.normalize=function(e){return""===e?"":t(i.posix.normalize(e))},e.resolve=function(...e){return t(i.posix.resolve(...e))},e.relative=function(e,n){return t(i.posix.relative(e,n))},e.normalizeExtension=function(e){return e.length>0&&0!==e.indexOf(".")&&(e=`.${e}`),e},e.removeSlash=t}(r||(t.PathExt=r={}))},7361:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signalToPromise=void 0;const i=n(5764);t.signalToPromise=function(e,t){const n=new i.PromiseDelegate;function r(){e.disconnect(s)}function s(e,t){r(),n.resolve([e,t])}return e.connect(s),(null!=t?t:0)>0&&setTimeout((()=>{r(),n.reject(`Signal not emitted within ${t} ms.`)}),t),n.promise}},8126:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Text=void 0,function(e){e.jsIndexToCharIndex=function(e,t){return e},e.charIndexToJsIndex=function(e,t){return e},e.camelCase=function(e,t=!1){return e.replace(/^(\w)|[\s-_:]+(\w)/g,(function(e,n,i){return i?i.toUpperCase():t?n.toUpperCase():n.toLowerCase()}))},e.titleCase=function(e){return(e||"").toLowerCase().split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}}(n||(t.Text=n={}))},1796:(e,t)=>{},1692:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.URLExt=void 0;const r=n(9942),s=i(n(2225));var o;!function(e){function t(e){if("undefined"!=typeof document&&document){const t=document.createElement("a");return t.href=e,t}return(0,s.default)(e)}function n(...e){let t=(0,s.default)(e[0],{});const n=""===t.protocol&&t.slashes;n&&(t=(0,s.default)(e[0],"https:"+e[0]));const i=`${n?"":t.protocol}${t.slashes?"//":""}${t.auth}${t.auth?"@":""}${t.host}`,o=r.posix.join(`${i&&"/"!==t.pathname[0]?"/":""}${t.pathname}`,...e.slice(1));return`${i}${"."===o?"":o}`}e.parse=t,e.getHostName=function(e){return(0,s.default)(e).hostname},e.normalize=function(e){return e&&t(e).toString()},e.join=n,e.encodeParts=function(e){return n(...e.split("/").map(encodeURIComponent))},e.objectToQueryString=function(e){const t=Object.keys(e).filter((e=>e.length>0));return t.length?"?"+t.map((t=>{const n=encodeURIComponent(String(e[t]));return t+(n?"="+n:"")})).join("&"):""},e.queryStringToObject=function(e){return e.replace(/^\?/,"").split("&").reduce(((e,t)=>{const[n,i]=t.split("=");return n.length>0&&(e[n]=decodeURIComponent(i||"")),e}),{})},e.isLocal=function(e,n=!1){const{protocol:i}=t(e);return(!i||0!==e.toLowerCase().indexOf(i))&&(n?0!==e.indexOf("//"):0!==e.indexOf("/"))}}(o||(t.URLExt=o={}))},6008:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{es:()=>rendererFactory});var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5865);const TEXT_JAVASCRIPT_MIMETYPE="text/javascript",APPLICATION_JAVASCRIPT_MIMETYPE="application/javascript";function evalInContext(code,element,document,window){return eval(code)}class ExperimentalRenderedJavascript extends _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_0__.TS{render(e){const t=this.translator.load("jupyterlab"),n=()=>{try{const t=e.data[this.mimeType];return t&&evalInContext(t,this.node,document,window),Promise.resolve()}catch(e){return Promise.reject(e)}};if(!e.trusted){const e=document.createElement("pre");e.textContent=t.__("Are you sure that you want to run arbitrary Javascript within your JupyterLab session?");const i=document.createElement("button");return i.textContent=t.__("Run"),this.node.appendChild(e),this.node.appendChild(i),i.onclick=e=>{this.node.textContent="",n()},Promise.resolve()}return n()}}const rendererFactory={safe:!1,mimeTypes:[TEXT_JAVASCRIPT_MIMETYPE,APPLICATION_JAVASCRIPT_MIMETYPE],createRenderer:e=>new ExperimentalRenderedJavascript(e)},extension={id:"@jupyterlab/javascript-extension:factory",description:"Adds renderer for JavaScript content.",rendererFactory,rank:0,dataType:"string"};var __WEBPACK_DEFAULT_EXPORT__=extension},3328:function(e,t){!function(e){"use strict";e.JSONExt=void 0,function(e){function t(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e}function n(e){return Array.isArray(e)}function i(e,r){if(e===r)return!0;if(t(e)||t(r))return!1;var s=n(e),o=n(r);return s===o&&(s&&o?function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0,r=e.length;n>>0),e[n]=255&t,t>>>=8}e.Random=void 0,(e.Random||(e.Random={})).getRandomValues=function(){var e="undefined"!=typeof window&&(window.crypto||window.msCrypto)||null;return e&&"function"==typeof e.getRandomValues?function(t){return e.getRandomValues(t)}:r}(),e.UUID=void 0,(e.UUID||(e.UUID={})).uuid4=function(e){for(var t=new Uint8Array(16),n=new Array(256),i=0;i<16;++i)n[i]="0"+i.toString(16);for(i=16;i<256;++i)n[i]=i.toString(16);return function(){return e(t),t[6]=64|15&t[6],t[8]=128|63&t[8],n[t[0]]+n[t[1]]+n[t[2]]+n[t[3]]+"-"+n[t[4]]+n[t[5]]+"-"+n[t[6]]+n[t[7]]+"-"+n[t[8]]+n[t[9]]+"-"+n[t[10]]+n[t[11]]+n[t[12]]+n[t[13]]+n[t[14]]+n[t[15]]}}(e.Random.getRandomValues),e.MimeData=t,e.PromiseDelegate=n,e.Token=i,Object.defineProperty(e,"__esModule",{value:!0})}(t)},478:(e,t,n)=>{"use strict";n.d(t,{c:()=>D});var i,r,s,o=n(5764);function a(e){return"execute_result"===e.output_type}function l(e){return"display_data"===e.output_type}function u(e){return"stream"===e.output_type}!function(e){function t(e,t,n=0,i=-1){let r,s=e.length;if(0===s)return-1;n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,r=o+i;n(e[r],t)<0?(o=r+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,r=-1){let s=e.length;if(0===s)return 0;let o=i=i<0?Math.max(0,i+s):Math.min(i,s-1),a=(r=r<0?Math.max(0,r+s):Math.min(r,s-1))-i+1;for(;a>0;){let i=a>>1,r=o+i;n(e[r],t)>0?a=i:(o=r+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,r=e.length;i=o&&(n=r<0?o-1:o),void 0===i?i=r<0?-1:o:i<0?i=Math.max(i+o,r<0?-1:0):i>=o&&(i=r<0?o-1:o),s=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;s(e,n,a-1),s(e,a,i),s(e,n,i)},e.fill=function(e,t,n=0,i=-1){let r,s=e.length;if(0!==s){n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,r=-1){let s=t(e,n,i,r);return-1!==s&&o(e,s),s},e.removeLastOf=function(e,t,i=-1,r=0){let s=n(e,t,i,r);return-1!==s&&o(e,s),s},e.removeAllOf=function(e,t,n=0,i=-1){let r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s},e.removeFirstWhere=function(e,t,n=0,r=-1){let s,a=i(e,t,n,r);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeLastWhere=function(e,t,n=-1,i=0){let s,a=r(e,t,n,i);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeAllWhere=function(e,t,n=0,i=-1){let r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s}}(i||(i={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(s||(s={}));var d,c,h,p,f,g,m,v,b,A=n(8571);class y{constructor(e={}){if(this._array=[],this._isDisposed=!1,this._changed=new A.Signal(this),e.values)for(const t of e.values)this._array.push(t);this._itemCmp=e.itemCmp||d.itemCmp}get type(){return"List"}get changed(){return this._changed}get length(){return this._array.length}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,A.Signal.clearData(this),this.clear())}[Symbol.iterator](){return this._array[Symbol.iterator]()}get(e){return this._array[e]}set(e,t){const n=this._array[e];if(void 0===t)throw new Error("Cannot set an undefined item");(0,this._itemCmp)(n,t)||(this._array[e]=t,this._changed.emit({type:"set",oldIndex:e,newIndex:e,oldValues:[n],newValues:[t]}))}push(e){const t=this._array.push(e);return this._changed.emit({type:"add",oldIndex:-1,newIndex:this.length-1,oldValues:[],newValues:[e]}),t}insert(e,t){e===this._array.length?this._array.push(t):i.insert(this._array,e,t),this._changed.emit({type:"add",oldIndex:-2,newIndex:e,oldValues:[],newValues:[t]})}removeValue(e){const t=this._itemCmp,n=i.findFirstIndex(this._array,(n=>t(n,e)));return this.remove(n),n}remove(e){const t=i.removeAt(this._array,e);if(void 0!==t)return this._changed.emit({type:"remove",oldIndex:e,newIndex:-1,newValues:[],oldValues:[t]}),t}clear(){const e=this._array.slice();this._array.length=0,this._changed.emit({type:"remove",oldIndex:0,newIndex:0,newValues:[],oldValues:e})}move(e,t){if(this.length<=1||e===t)return;const n=[this._array[e]];i.move(this._array,e,t),this._changed.emit({type:"move",oldIndex:e,newIndex:t,oldValues:n,newValues:n})}pushAll(e){const t=this.length;for(const t of e)this._array.push(t);return this._changed.emit({type:"add",oldIndex:-1,newIndex:t,oldValues:[],newValues:Array.from(e)}),this.length}insertAll(e,t){const n=e;for(const n of t)i.insert(this._array,e++,n);this._changed.emit({type:"add",oldIndex:-2,newIndex:n,oldValues:[],newValues:Array.from(t)})}removeRange(e,t){const n=this._array.slice(e,t);for(let n=e;n{let t=!1;return r.then((()=>!t&&e())),()=>{t=!0}});var r;function s(e,t){let n=a.get(e);if(!n||0===n.length)return void c(e,t);let i=function(e,t){let n=0;for(const i of e)if(!1===t(i,n++))return!1;return!0}(function*(e){if("function"==typeof e.retro)yield*e.retro();else for(let t=e.length-1;t>-1;t--)yield e[t]}(n),(n=>!n||function(e,t,n){let i=!0;try{i="function"==typeof e?e(t,n):e.messageHook(t,n)}catch(e){u(e)}return i}(n,e,t)));i&&c(e,t)}e.sendMessage=s,e.postMessage=function(e,t){t.isConflatable&&function(n){for(const r of n)if((i=r).handler===e&&i.msg&&i.msg.type===t.type&&i.msg.isConflatable&&i.msg.conflate(t))return!0;var i;return!1}(o)||h(e,t)},e.installMessageHook=function(e,t){let n=a.get(e);n&&-1!==n.indexOf(t)||(n?n.push(t):a.set(e,[t]))},e.removeMessageHook=function(e,t){let n=a.get(e);if(!n)return;let i=n.indexOf(t);-1!==i&&(n[i]=null,f(n))},e.clearData=function(e){let t=a.get(e);t&&t.length>0&&(i.fill(t,null),f(t));for(const t of o)t.handler===e&&(t.handler=null,t.msg=null)},e.flush=function(){d||null===t||(t(),t=null,d=!0,p(),d=!1)},e.getExceptionHandler=function(){return u},e.setExceptionHandler=function(e){let t=u;return u=e,t};const o=new w,a=new WeakMap,l=new Set;let u=e=>{console.error(e)},d=!1;function c(e,t){try{e.processMessage(t)}catch(e){u(e)}}function h(e,i){o.addLast({handler:e,msg:i}),null===t&&(t=n(p))}function p(){if(t=null,o.isEmpty)return;let e={handler:null,msg:null};for(o.addLast(e);;){let t=o.removeFirst();if(t===e)return;t.handler&&t.msg&&s(t.handler,t.msg)}}function f(e){0===l.size&&n(g),l.add(e)}function g(){l.forEach(m),l.clear()}function m(e){i.removeAllWhere(e,v)}function v(e){return null===e}}(h||(h={}));class E{constructor(e={}){if(this._map=new Map,this._changed=new A.Signal(this),this._isDisposed=!1,this._itemCmp=e.itemCmp||p.itemCmp,e.values)for(const t in e.values)this._map.set(t,e.values[t])}get type(){return"Map"}get changed(){return this._changed}get isDisposed(){return this._isDisposed}get size(){return this._map.size}set(e,t){const n=this._map.get(e);if(void 0===t)throw Error("Cannot set an undefined value, use remove");const i=this._itemCmp;return void 0!==n&&i(n,t)||(this._map.set(e,t),this._changed.emit({type:n?"change":"add",key:e,oldValue:n,newValue:t})),n}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){const e=[];return this._map.forEach(((t,n)=>{e.push(n)})),e}values(){const e=[];return this._map.forEach(((t,n)=>{e.push(t)})),e}delete(e){const t=this._map.get(e);return this._map.delete(e)&&this._changed.emit({type:"remove",key:e,oldValue:t,newValue:void 0}),t}clear(){const e=this.keys();for(let t=0;t=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,r=o+i;n(e[r],t)<0?(o=r+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,r=-1){let s=e.length;if(0===s)return 0;let o=i=i<0?Math.max(0,i+s):Math.min(i,s-1),a=(r=r<0?Math.max(0,r+s):Math.min(r,s-1))-i+1;for(;a>0;){let i=a>>1,r=o+i;n(e[r],t)>0?a=i:(o=r+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,r=e.length;i=o&&(n=r<0?o-1:o),void 0===i?i=r<0?-1:o:i<0?i=Math.max(i+o,r<0?-1:0):i>=o&&(i=r<0?o-1:o),s=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;s(e,n,a-1),s(e,a,i),s(e,n,i)},e.fill=function(e,t,n=0,i=-1){let r,s=e.length;if(0!==s){n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,r=-1){let s=t(e,n,i,r);return-1!==s&&o(e,s),s},e.removeLastOf=function(e,t,i=-1,r=0){let s=n(e,t,i,r);return-1!==s&&o(e,s),s},e.removeAllOf=function(e,t,n=0,i=-1){let r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s},e.removeFirstWhere=function(e,t,n=0,r=-1){let s,a=i(e,t,n,r);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeLastWhere=function(e,t,n=-1,i=0){let s,a=r(e,t,n,i);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeAllWhere=function(e,t,n=0,i=-1){let r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s}}(g||(g={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(v||(v={}));class D{constructor(e={}){if(this.clearNext=!1,this._lastStream="",this._trusted=!1,this._isDisposed=!1,this._stateChanged=new A.Signal(this),this._changed=new A.Signal(this),this._trusted=!!e.trusted,this.contentFactory=e.contentFactory||D.defaultContentFactory,this.list=new y,e.values)for(const t of e.values){const e=this._add(t)-1;this.list.get(e).changed.connect(this._onGenericChange,this)}this.list.changed.connect(this._onListChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get length(){return this.list?this.list.length:0}get trusted(){return this._trusted}set trusted(e){if(e===this._trusted)return;const t=this._trusted=e;for(let e=0;e{e.changed.connect(this._onGenericChange,this)}));break;case"remove":t.oldValues.forEach((e=>{e.changed.disconnect(this._onGenericChange,this)}));break;case"set":t.newValues.forEach((e=>{e.changed.connect(this._onGenericChange,this)})),t.oldValues.forEach((e=>{e.changed.disconnect(this._onGenericChange,this)}))}this._changed.emit(t)}_onGenericChange(e){let t,n=null;for(t=0;t-1;){const t=e.match(/^(.*)\r+/m)[1];let n=e.match(/\r+(.*)$/m)[1];n+=t.slice(n.length,t.length),e=e.replace(/\r+.*$/m,"\r").replace(/^.*\r/m,n)}return e}(function(e){let t=e;do{t=(e=t).replace(/[^\n]\x08/gm,"")}while(t.length{"use strict";n.d(t,{Bw:()=>f});var i=n(1670),r=n(8571),s=n(5070);class o{constructor(e){this._currentChanged=new r.Signal(this),this._deferred=null,this._isDisposed=!1,this._widgetAdded=new r.Signal(this),this._widgetUpdated=new r.Signal(this);const t=this._focusTracker=new s.$x,n=this._pool=new i.RestorablePool(e);this.namespace=e.namespace,t.currentChanged.connect(((e,t)=>{t.newValue!==this.currentWidget&&(n.current=t.newValue)}),this),n.added.connect(((e,t)=>{this._widgetAdded.emit(t)}),this),n.currentChanged.connect(((e,i)=>{null===i&&t.currentWidget?n.current=t.currentWidget:(this.onCurrentChanged(i),this._currentChanged.emit(i))}),this),n.updated.connect(((e,t)=>{this._widgetUpdated.emit(t)}),this)}get currentChanged(){return this._currentChanged}get currentWidget(){return this._pool.current||null}get restored(){return this._deferred?Promise.resolve():this._pool.restored}get size(){return this._pool.size}get widgetAdded(){return this._widgetAdded}get widgetUpdated(){return this._widgetUpdated}async add(e){this._focusTracker.add(e),await this._pool.add(e),this._focusTracker.activeWidget||(this._pool.current=e)}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._pool.dispose(),this._focusTracker.dispose(),r.Signal.clearData(this))}find(e){return this._pool.find(e)}forEach(e){return this._pool.forEach(e)}filter(e){return this._pool.filter(e)}inject(e){return this._pool.inject(e)}has(e){return this._pool.has(e)}async restore(e){const t=this._deferred;return t?(this._deferred=null,this._pool.restore(t)):e?this._pool.restore(e):void console.warn("No options provided to restore the tracker.")}defer(e){this._deferred=e}async save(e){return this._pool.save(e)}onCurrentChanged(e){}}var a=n(7883),l=n(509),u=n(5764),d=n(6573);const c="jp-OutputArea-child",h="jp-OutputArea-output",p="jp-OutputArea-prompt";class f extends s.x0{constructor(e){var t,n,i,a;super(),this.outputLengthChanged=new r.Signal(this),this._onIOPub=e=>{const t=this.model,n=e.header.msg_type;let i;const r=(e.content.transient||{}).display_id;let s;switch(n){case"execute_result":case"display_data":case"stream":case"error":i={...e.content,output_type:n},t.add(i);break;case"clear_output":{const n=e.content.wait;t.clear(n);break}case"update_display_data":if(i={...e.content,output_type:"display_data"},s=this._displayIdMap.get(r),s)for(const e of s)t.set(e,i);break;case"status":"idle"===e.content.execution_state&&(this._pendingInput=!1)}r&&"display_data"===n&&(s=this._displayIdMap.get(r)||[],s.push(t.length-1),this._displayIdMap.set(r,s))},this._onExecuteReply=e=>{const t=this.model,n=e.content;if("ok"!==n.status)return;const i=n&&n.payload;if(!i||!i.length)return;const r=i.filter((e=>"page"===e.source));if(!r.length)return;const s={output_type:"display_data",data:JSON.parse(JSON.stringify(r[0])).data,metadata:{}};t.add(s)},this._displayIdMap=new Map,this._minHeightTimeout=null,this._inputRequested=new r.Signal(this),this._toggleScrolling=new r.Signal(this),this._initialize=new r.Signal(this),this._outputTracker=new o({namespace:u.UUID.uuid4()}),this._inputHistoryScope="global",this._pendingInput=!1,super.layout=new s.DG,this.addClass("jp-OutputArea"),this.contentFactory=null!==(t=e.contentFactory)&&void 0!==t?t:f.defaultContentFactory,this.rendermime=e.rendermime,this._maxNumberOutputs=null!==(n=e.maxNumberOutputs)&&void 0!==n?n:1/0,this._translator=null!==(i=e.translator)&&void 0!==i?i:l.wK,this._inputHistoryScope=null!==(a=e.inputHistoryScope)&&void 0!==a?a:"global";const d=this.model=e.model;for(let e=0;e{this._pendingInput=!1})).catch((()=>{})),this.model.clear(),this.widgets.length&&(this._clear(),this.outputLengthChanged.emit(Math.min(this.model.length,this._maxNumberOutputs))),e.onIOPub=this._onIOPub,e.onReply=this._onExecuteReply,e.onStdin=t=>{a.KernelMessage.isInputRequestMsg(t)&&this.onInputRequest(t,e)})}get inputRequested(){return this._inputRequested}get pendingInput(){return this._pendingInput}get maxNumberOutputs(){return this._maxNumberOutputs}set maxNumberOutputs(e){if(e<=0)return void console.warn("OutputArea.maxNumberOutputs must be strictly positive.");const t=this._maxNumberOutputs;this._maxNumberOutputs=e,t{this._toggleScrolling.emit()})),this.node.appendChild(e),requestAnimationFrame((()=>{this._initialize.emit()}))}_moveDisplayIdIndices(e,t){this._displayIdMap.forEach((n=>{const i=e+t;for(let r=n.length-1;r>=0;--r){const s=n[r];s>=e&&s=i&&(n[r]-=t)}}))}onStateChanged(e,t){const n=Math.min(this.model.length,this._maxNumberOutputs);if(t){if(t>=this._maxNumberOutputs)return;this._setOutput(t,this.model.get(t))}else for(let e=0;e{this.isDisposed||(this.node.style.minHeight="")}),50)}onInputRequest(e,t){const n=this.contentFactory,i=e.content.prompt,r=e.content.password,o=new s.Zk;o.addClass(c),o.addClass("jp-OutputArea-stdin-item");const a=n.createOutputPrompt();a.addClass(p),o.addWidget(a),this._pendingInput=!0;const l=n.createStdin({parent_header:e.header,prompt:i,password:r,future:t,translator:this._translator,inputHistoryScope:this._inputHistoryScope});l.addClass(h),o.addWidget(l),this.model.length>=this.maxNumberOutputs&&(this.maxNumberOutputs=this.model.length),this._inputRequested.emit(l);const u=l.node.getElementsByTagName("input")[0];l.value.then((e=>{this.model.length>=this.maxNumberOutputs&&(this.maxNumberOutputs=this.model.length+1),o.addClass("jp-OutputArea-stdin-hiding"),this.model.add({output_type:"stream",name:"stdin",text:e+"\n"}),u.focus(),this._pendingInput=!1,window.setTimeout((()=>{const e=document.activeElement;o.dispose(),e&&e instanceof HTMLElement&&e.focus()}),500)})),this.layout.addWidget(o)}_setOutput(e,t){if(e>=this._maxNumberOutputs)return;const n=this.layout.widgets[e],i=n.widgets?n.widgets.filter((e=>"renderModel"in e)).pop():n,r=this.rendermime.preferredMimeType(t.data,t.trusted?"any":"ensure");v.currentPreferredMimetype.get(i)===r&&f.isIsolated(r,t.metadata)===i instanceof v.IsolatedRenderer?i.renderModel(t):(this.layout.widgets[e].dispose(),this._insertOutput(e,t))}_insertOutput(e,t){if(e>this._maxNumberOutputs)return;const n=this.layout;if(e===this._maxNumberOutputs){const t=new v.TrimmedOutputs(this._maxNumberOutputs,(()=>{const e=this._maxNumberOutputs;this._maxNumberOutputs=1/0,this._showTrimmedOutputs(e)}));n.insertWidget(e,this._wrappedOutput(t))}else{let i=this.createOutputItem(t);i?i.toggleClass("jp-OutputArea-executeResult",null!==t.executionCount):i=new s.x0,this._outputTracker.has(i)||this._outputTracker.add(i),n.insertWidget(e,i)}}get outputTracker(){return this._outputTracker}_showTrimmedOutputs(e){this.widgets[e].dispose();for(let t=e;t{const t=document.createElement("pre"),i=this._translator.load("jupyterlab");t.textContent=i.__("Javascript Error: %1",e.message),n.node.appendChild(t),n.node.className="lm-Widget jp-RenderedText",n.node.setAttribute("data-mime-type","application/vnd.jupyter.stderr")})),n}_wrappedOutput(e,t=null){const n=new v.OutputPanel;n.addClass(c);const i=this.contentFactory.createOutputPrompt();return i.executionCount=t,i.addClass(p),n.addWidget(i),e.addClass(h),n.addWidget(e),n}}!function(e){e.execute=async function(e,t,n,i){var r;let s=!0;i&&Array.isArray(i.tags)&&-1!==i.tags.indexOf("raises-exception")&&(s=!1);const o={code:e,stop_on_error:s},a=null===(r=n.session)||void 0===r?void 0:r.kernel;if(!a)throw new Error("Session has no kernel.");const l=a.requestExecute(o,!1,i);return t.future=l,l.done},e.isIsolated=function(e,t){const n=t[e];return n&&void 0!==n.isolated?!!n.isolated:!!t.isolated};class t{createOutputPrompt(){return new g}createStdin(e){return new m(e)}}e.ContentFactory=t,e.defaultContentFactory=new t}(f||(f={}));class g extends s.x0{constructor(){super(),this._executionCount=null,this.addClass("jp-OutputPrompt")}get executionCount(){return this._executionCount}set executionCount(e){this._executionCount=e,this.node.textContent=null===e?"":`[${e}]:`}}class m extends s.x0{static _historyIx(e,t){const n=m._history.get(e);if(!n)return;const i=n.length;return t<=0?i+t:void 0}static _historyAt(e,t){const n=m._history.get(e);if(!n)return;const i=n.length,r=m._historyIx(e,t);return void 0!==r&&r1e3&&n.shift()}static _historySearch(e,t,n,i=!0){const r=m._history.get(e),s=r.length,o=m._historyIx(e,n),a=e=>-1!==e.search(t);if(void 0!==o)if(i){if(0===o)return;const e=r.slice(0,o).findLastIndex(a);if(-1!==e)return e-s}else{if(o>=s-1)return;const e=r.slice(o+1).findIndex(a);if(-1!==e)return e-s+o+1}}constructor(e){var t;super({node:v.createInputWidgetNode(e.prompt,e.password)}),this._promise=new u.PromiseDelegate,this._resolved=!1,this.addClass("jp-Stdin"),this._future=e.future,this._historyIndex=0,this._historyKey="session"===e.inputHistoryScope?e.parent_header.session:"",this._historyPat="",this._parentHeader=e.parent_header,this._password=e.password,this._trans=(null!==(t=e.translator)&&void 0!==t?t:l.wK).load("jupyterlab"),this._value=e.prompt+" ",this._input=this.node.getElementsByTagName("input")[0],this._password?this._input.placeholder="":this._input.placeholder=this._trans.__("↑↓ for history. Search history with c-↑/c-↓"),m._history.has(this._historyKey)||m._history.set(this._historyKey,[])}get value(){return this._promise.promise.then((()=>this._value))}handleEvent(e){if(this._resolved)return void e.preventDefault();const t=this._input;if("keydown"===e.type)if("Enter"===e.key)this.resetSearch(),this._future.sendInputReply({status:"ok",value:t.value},this._parentHeader),this._password?this._value+="········":(this._value+=t.value,m._historyPush(this._historyKey,t.value)),this._resolved=!0,this._promise.resolve(void 0);else if("Escape"===e.key)this.resetSearch(),t.blur();else if(!e.ctrlKey||"ArrowUp"!==e.key&&"ArrowDown"!==e.key){if("ArrowUp"===e.key){this.resetSearch();const n=m._historyAt(this._historyKey,this._historyIndex-1);n&&(0===this._historyIndex&&(this._valueCache=t.value),this._setInputValue(n),--this._historyIndex,e.preventDefault())}else if("ArrowDown"===e.key)if(this.resetSearch(),0===this._historyIndex);else if(-1===this._historyIndex)this._setInputValue(this._valueCache),++this._historyIndex;else{const e=m._historyAt(this._historyKey,this._historyIndex+1);e&&(this._setInputValue(e),++this._historyIndex)}}else{""===this._historyPat&&(this._historyPat=t.value);const n="ArrowUp"===e.key,i=m._historySearch(this._historyKey,this._historyPat,this._historyIndex,n);if(void 0!==i){const n=m._historyAt(this._historyKey,i);void 0!==n&&(0===this._historyIndex&&(this._valueCache=t.value),this._setInputValue(n),this._historyIndex=i,e.preventDefault())}}}resetSearch(){this._historyPat=""}onAfterAttach(e){this._input.addEventListener("keydown",this),this._input.focus()}onBeforeDetach(e){this._input.removeEventListener("keydown",this)}_setInputValue(e){this._input.value=e,this._input.setSelectionRange(e.length,e.length)}}var v;m._history=new Map,function(e){e.createInputWidgetNode=function(e,t){const n=document.createElement("div"),i=document.createElement("pre");i.className="jp-Stdin-prompt",i.textContent=e;const r=document.createElement("input");return r.className="jp-Stdin-input",t&&(r.type="password"),n.appendChild(i),i.appendChild(r),n};class t extends s.x0{constructor(e){super({node:document.createElement("iframe")}),this.addClass("jp-mod-isolated"),this._wrapped=e;const t=this.node;t.frameBorder="0",t.scrolling="auto",t.addEventListener("load",(()=>{t.contentDocument.open(),t.contentDocument.write(this._wrapped.node.innerHTML),t.contentDocument.close();const e=t.contentDocument.body;t.style.height=`${e.scrollHeight}px`,t.heightChangeObserver=new ResizeObserver((()=>{t.style.height=`${e.scrollHeight}px`})),t.heightChangeObserver.observe(e)}))}renderModel(e){return this._wrapped.renderModel(e)}}e.IsolatedRenderer=t,e.currentPreferredMimetype=new d.AttachedProperty({name:"preferredMimetype",create:e=>""});class n extends s.Zk{constructor(e){super(e)}_onContext(e){this.node.focus()}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("contextmenu",this._onContext.bind(this))}onBeforeDetach(e){super.onAfterDetach(e),this.node.removeEventListener("contextmenu",this._onContext.bind(this))}}e.OutputPanel=n;class i extends s.x0{constructor(e,t){const n=document.createElement("div"),i=`The first ${e} are displayed`;n.insertAdjacentHTML("afterbegin",`\n
Show more outputs
\n
`),super({node:n}),this._onClick=t,this.addClass("jp-TrimmedOutputs"),this.addClass("jp-RenderedHTMLCommon")}handleEvent(e){"click"===e.type&&this._onClick(e)}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("click",this)}onBeforeDetach(e){super.onBeforeDetach(e),this.node.removeEventListener("click",this)}}e.TrimmedOutputs=i}(v||(v={}))},5865:(e,t,n)=>{"use strict";n.d(t,{A6:()=>B,TH:()=>E,vf:()=>x,TS:()=>k,Kc:()=>C,jL:()=>D,Yk:()=>S,Vx:()=>T});var i=n(509),r=n(5070),s=n(8925),o=n(9452),a=n.n(o);const l=/(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[{}$]|[{}]|(?:\n\s*)+|@@\d+@@|\\\\(?:\(|\)|\[|\]))/i;function u(e,t,n,i,r){let s=r.slice(e,t+1).join("").replace(/&/g,"&").replace(//g,">");for(navigator&&"Microsoft Internet Explorer"===navigator.appName&&(s=s.replace(/(%[^\n]*)\n/g,"$1
\n"));t>e;)r[t]="",t--;return r[e]="@@"+i.length+"@@",n&&(s=n(s)),i.push(s),r}function d(e){let{host:t,source:n,trusted:r,sanitizer:s,resolver:o,linkHandler:a,shouldTypeset:l,latexTypesetter:u,translator:d}=e;d=d||i.wK;const c=null==d?void 0:d.load("jupyterlab");let h,f=n;if(!n)return t.textContent="",Promise.resolve(void 0);if(r||(f=`${n}`,n=s.sanitize(n)),t.innerHTML=n,t.getElementsByTagName("script").length>0)if(r)p.evalInnerHTMLScriptTags(t);else{const e=document.createElement("div"),n=document.createElement("pre");n.textContent=c.__("This HTML output contains inline scripts. Are you sure that you want to run arbitrary Javascript within your JupyterLab session?");const i=document.createElement("button");i.textContent=c.__("Run"),i.onclick=e=>{t.innerHTML=f,p.evalInnerHTMLScriptTags(t),t.firstChild&&t.removeChild(t.firstChild)},e.appendChild(n),e.appendChild(i),t.insertBefore(e,t.firstChild)}return p.handleDefaults(t,o),h=o?p.handleUrls(t,o,a):Promise.resolve(void 0),h.then((()=>{l&&u&&u.typeset(t)}))}async function c(e){const{host:t,source:n,markdownParser:i,...r}=e;if(!n)return void(t.textContent="");let s="";if(i){const e=function(e){const t=[];let n,i=null,r=null,s=null,o=0;e.includes("`")||e.includes("~~~")?(e=e.replace(/~/g,"~T").replace(/^(?`{3,}|(~T){3,})[^`\n]*\n([\s\S]*?)^\k`*$/gm,(e=>e.replace(/\$/g,"~D"))).replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm,(e=>e.replace(/\$/g,"~D"))),n=e=>e.replace(/~([TD])/g,((e,t)=>"T"===t?"~":"$"))):n=e=>e;let a=e.replace(/\r\n?/g,"\n").split(l);for(let e=1,l=a.length;e{let n=a[t];return"\\\\("===n.substr(0,3)&&"\\\\)"===n.substr(n.length-3)?n="\\("+n.substring(3,n.length-3)+"\\)":"\\\\["===n.substr(0,3)&&"\\\\]"===n.substr(n.length-3)&&(n="\\["+n.substring(3,n.length-3)+"\\]"),n}))}else s=`
${n}
`;var o,a;await d({host:t,source:s,...r}),p.headerAnchors(t)}var h,p;!function(e){e.createHeaderId=function(e){var t;return(null!==(t=e.textContent)&&void 0!==t?t:"").replace(/ /g,"-")}}(c||(c={})),function(e){const t="\\u0000-\\u0020\\u007f-\\u009f";e.webLinkRegex=new RegExp("(?(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|data:|www\\.)[^\\s"+t+'"]{2,}[^\\s'+t+"\"'(){}\\[\\],:;.!?])","ug");const n=new RegExp(`(${/(?:[a-zA-Z]:(?:(?:\\|\/)[\w\.-]*)+)/.source}|${/(?:(?:\~|\.)(?:(?:\\|\/)[\w\.-]*)+)/.source})`),i=navigator.userAgent.indexOf("Windows")>=0;e.pathLinkRegex=new RegExp(`(?${i?n.source:/((?:\~|\.)?(?:\/[\w\.-]*)+)/.source})${/(?:(?:\:|", line )(?[\d]+))?(?:\:(?[\d]+))?/.source}`,"g")}(h||(h={}));class f{constructor(){this.regex=h.webLinkRegex}createAnchor(e,t){const n=document.createElement("a");return n.href=e.startsWith("www.")?"https://"+e:e,n.rel="noopener",n.target="_blank",n.appendChild(document.createTextNode(t)),n}processPath(e){const t=e.slice(-1),n=-1!==[">","<"].indexOf(t)?e.length-1:e.length;return e.slice(0,n)}processLabel(e){return this.processPath(e)}}class g{constructor(){this.regex=h.pathLinkRegex}createAnchor(e,t,n){const i=document.createElement("a");i.dataset.path=e;const r=parseInt(n.line,10);let s=isNaN(r)?"":"line="+(r-1);return i.dataset.locator=s,i.appendChild(document.createTextNode(t)),i}}function m(e,t){const n=[];t.checkWeb&&n.push(new f),t.checkPaths&&n.push(new g);const i=[],r=(e,t)=>{if(t>=n.length)return void i.push(document.createTextNode(e));const s=n[t];let o,a=0;const l=s.regex;for(l.lastIndex=0;null!=(o=l.exec(e));){const n=e.substring(a,o.index);n&&r(n,t+1);const{path:l,...u}=o.groups,d=s.processPath?s.processPath(l):l,c=s.processLabel?s.processLabel(o[0]):o[0];i.push(s.createAnchor(d,c,u)),a=o.index+c.length}const u=e.substring(a);u&&r(u,t+1)};return r(e,0),i}function v(e,t){var n,i;const r=e.cloneNode();r.textContent=null===(n=e.textContent)||void 0===n?void 0:n.slice(0,t);const s=e.cloneNode();return s.textContent=null===(i=e.textContent)||void 0===i?void 0:i.slice(t),{pre:r,post:s}}function*b(e){var t;let n,i=0;for(let r of e)n=i+((null===(t=r.textContent)||void 0===t?void 0:t.length)||0),yield{node:r,start:i,end:n,isText:r.nodeType===Node.TEXT_NODE},i=n}function A(e){var t,n;const{host:i,sanitizer:r,source:s}=e,o=r.sanitize(p.ansiSpan(s),{allowedTags:["span"]}),a=document.createElement("pre");a.innerHTML=o;const l=a.textContent;let u;if(l){const e=null===(n=null===(t=r.getAutolink)||void 0===t?void 0:t.call(r))||void 0===n||n?m(l,{checkWeb:!0,checkPaths:!1}):[document.createTextNode(o)];u=y(Array.from(a.childNodes),e)}else u=document.createElement("pre");return i.appendChild(u),Promise.resolve(void 0)}function y(e,t){const n=document.createElement("pre");let i=!1;const r=[];for(let n of function*(e,t){var n,i;let r=b(e),s=b(t),o=r.next(),a=s.next();for(;!o.done&&!a.done;){let e=o.value,t=a.value;if(e.isText&&e.start<=t.start&&e.end>=t.end)yield[null,t.node],a=s.next();else if(t.isText&&t.start<=e.start&&t.end>=e.end)yield[e.node,null],o=r.next();else if(e.end===t.end&&e.start===t.start)yield[e.node,t.node],o=r.next(),a=s.next();else if(e.end>t.end){let{pre:i,post:r}=v(e.node,t.end-e.start);t.starte.end))throw new Error(`Unexpected intersection: ${JSON.stringify(e)} ${JSON.stringify(t)}`);{let{pre:n,post:s}=v(t.node,e.end-t.start);e.start{const r=decodeURIComponent(i);return n&&n.handleLink(e,r,o),t.getDownloadUrl(i)})).then((t=>{e.href=t+o})).catch((t=>{e.href=""}))}async function i(e,t,n){let i=e.dataset.path||"",r=e.dataset.locator?"#"+e.dataset.locator:"";delete e.dataset.path,delete e.dataset.locator;const o=!0,a=t.isLocal?t.isLocal(i,o):s.URLExt.isLocal(i,o);if(!(i&&a&&t.resolvePath&&n&&n.handlePath))return e.replaceWith(...e.childNodes),Promise.resolve(void 0);try{const s=await t.resolvePath(i);if(!s)return console.log("Path resolution bailing: does not exist"),Promise.resolve(void 0);n.handlePath(e,s.path,s.scope,r),e.href=s.path+r}catch(t){console.warn("Path anchor error:",t),e.href="#linking-failed-see-console"}}e.evalInnerHTMLScriptTags=function(e){const t=Array.from(e.getElementsByTagName("script"));for(const e of t){if(!e.parentNode)continue;const t=document.createElement("script"),n=e.attributes;for(let e=0,i=n.length;e{}))},e.handlePaths=async function(e,t,n){const r=e.getElementsByTagName("a");for(let e=0;e"),a.push(e),a.push("")):a.push(e)}}function l(e){let t,n,i;const r=e.shift();if(2===r&&e.length>=3){if(t=e.shift(),n=e.shift(),i=e.shift(),[t,n,i].some((e=>e<0||255=1))throw new RangeError("Invalid extended color specification");{const r=e.shift();if(r<0)throw new RangeError("Color index must be >= 0");if(r<16)return r;if(r<232)t=Math.floor((r-16)/36),t=t>0?55+40*t:0,n=Math.floor((r-16)%36/6),n=n>0?55+40*n:0,i=(r-16)%6,i=i>0?55+40*i:0;else{if(!(r<256))throw new RangeError("Color index must be < 256");t=n=i=10*(r-232)+8}}}return[t,n,i]}e.ansiSpan=function(e){const t=/\x1b\[(.*?)([@-~])/g;let n,i=[],r=[],s=!1,u=!1,d=!1;const c=[],h=[];let p=0;for(e=a()(e),e+="";n=t.exec(e);){if("m"===n[2]){const e=n[1].split(";");for(let t=0;t{this.latexTypesetter&&this.latexTypesetter.typeset(this.node)})).catch(console.warn)}}class C extends w{constructor(e){super(e),this._rendered=Promise.resolve(),this.addClass("jp-RenderedLatex")}render(e){return this._rendered=function(e){const{host:t,source:n,shouldTypeset:i,latexTypesetter:r}=e;return t.textContent=n,i&&r&&r.typeset(t),Promise.resolve(void 0)}({host:this.node,source:String(e.data[this.mimeType]),shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter})}onAfterAttach(e){this._rendered.then((()=>{this.latexTypesetter&&this.latexTypesetter.typeset(this.node)})).catch(console.warn)}}class x extends w{constructor(e){super(e),this.addClass("jp-RenderedImage")}render(e){const t=e.metadata[this.mimeType];return function(e){const{host:t,mimeType:n,source:i,width:r,height:s,needsBackground:o,unconfined:a}=e;t.textContent="";const l=document.createElement("img");return l.src=`data:${n};base64,${i}`,"number"==typeof s&&(l.height=s),"number"==typeof r&&(l.width=r),"light"===o?l.classList.add("jp-needs-light-background"):"dark"===o&&l.classList.add("jp-needs-dark-background"),!0===a&&l.classList.add("jp-mod-unconfined"),t.appendChild(l),Promise.resolve(void 0)}({host:this.node,mimeType:this.mimeType,source:String(e.data[this.mimeType]),width:t&&t.width,height:t&&t.height,needsBackground:e.metadata.needs_background,unconfined:t&&t.unconfined})}}class D extends _{constructor(e){super(e),this._rendered=Promise.resolve(),this.addClass("jp-RenderedMarkdown")}render(e){return this._rendered=c({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}async renderModel(e){await super.renderModel(e,!0)}onAfterAttach(e){this._rendered.then((()=>{this.latexTypesetter&&this.latexTypesetter.typeset(this.node)})).catch(console.warn)}}class S extends w{constructor(e){super(e),this._rendered=Promise.resolve(),this.addClass("jp-RenderedSVG")}render(e){const t=e.metadata[this.mimeType];return this._rendered=function(e){let{host:t,source:n,trusted:i,unconfined:r}=e;if(!n)return t.textContent="",Promise.resolve(void 0);if(!i)return t.textContent="Cannot display an untrusted SVG. Maybe you need to run the cell?",Promise.resolve(void 0);n.search("]+xmlns=[^>]+svg")<0&&(n=n.replace("{this.latexTypesetter&&this.latexTypesetter.typeset(this.node)})).catch(console.warn)}}class T extends w{constructor(e){super(e),this.addClass("jp-RenderedText")}render(e){return A({host:this.node,sanitizer:this.sanitizer,source:String(e.data[this.mimeType]),translator:this.translator})}}class B extends w{constructor(e){super(e),this.addClass("jp-RenderedText")}render(e){return function(e){var t,n;const{host:i,linkHandler:r,sanitizer:s,resolver:o,source:a}=e,l=s.sanitize(p.ansiSpan(a),{allowedTags:["span"]}),u=document.createElement("pre");u.innerHTML=l;const d=u.textContent;let c,h;if(d){const e=null===(n=null===(t=s.getAutolink)||void 0===t?void 0:t.call(s))||void 0===n||n?m(d,{checkWeb:!0,checkPaths:!0}):[document.createTextNode(l)];c=y(Array.from(u.childNodes),e)}else c=document.createElement("pre");return i.appendChild(c),h=o?p.handlePaths(i,o,r):Promise.resolve(void 0),h}({host:this.node,sanitizer:this.sanitizer,source:String(e.data[this.mimeType]),linkHandler:this.linkHandler,resolver:this.resolver,translator:this.translator})}}class k extends w{constructor(e){super(e),this.addClass("jp-RenderedJavaScript")}render(e){const t=this.translator.load("jupyterlab");return A({host:this.node,sanitizer:this.sanitizer,source:t.__("JavaScript output is disabled in JupyterLab"),translator:this.translator})}}},3867:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseManager=void 0;const i=n(8571),r=n(2920);t.BaseManager=class{constructor(e){var t;this._isDisposed=!1,this._disposed=new i.Signal(this),this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:r.ServerConnection.makeSettings()}get disposed(){return this._disposed}get isDisposed(){return this._isDisposed}get isActive(){return!0}dispose(){this.isDisposed||(this._isDisposed=!0,this._disposed.emit(void 0),i.Signal.clearData(this))}}},4219:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BuildManager=void 0;const i=n(8925),r=n(2920);t.BuildManager=class{constructor(e={}){var t;this._url="",this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:r.ServerConnection.makeSettings();const{baseUrl:n,appUrl:s}=this.serverSettings;this._url=i.URLExt.join(n,s,"api/build")}get isAvailable(){return"true"===i.PageConfig.getOption("buildAvailable").toLowerCase()}get shouldCheck(){return"true"===i.PageConfig.getOption("buildCheck").toLowerCase()}getStatus(){const{_url:e,serverSettings:t}=this;return r.ServerConnection.makeRequest(e,{},t).then((e=>{if(200!==e.status)throw new r.ServerConnection.ResponseError(e);return e.json()})).then((e=>{if("string"!=typeof e.status)throw new Error("Invalid data");if("string"!=typeof e.message)throw new Error("Invalid data");return e}))}build(){const{_url:e,serverSettings:t}=this;return r.ServerConnection.makeRequest(e,{method:"POST"},t).then((e=>{if(400===e.status)throw new r.ServerConnection.ResponseError(e,"Build aborted");if(200!==e.status){const t=`Build failed with ${e.status}.\n\n If you are experiencing the build failure after installing an extension (or trying to include previously installed extension after updating JupyterLab) please check the extension repository for new installation instructions as many extensions migrated to the prebuilt extensions system which no longer requires rebuilding JupyterLab (but uses a different installation procedure, typically involving a package manager such as 'pip' or 'conda').\n\n If you specifically intended to install a source extension, please run 'jupyter lab build' on the server for full output.`;throw new r.ServerConnection.ResponseError(e,t)}}))}cancel(){const{_url:e,serverSettings:t}=this;return r.ServerConnection.makeRequest(e,{method:"DELETE"},t).then((e=>{if(204!==e.status)throw new r.ServerConnection.ResponseError(e)}))}}},2170:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigWithDefaults=t.ConfigSection=void 0;const i=n(8925),r=n(7883);var s;!function(e){e.create=function(e){const t=new o(e);return t.load().then((()=>t))}}(s||(t.ConfigSection=s={}));class o{constructor(e){var t;this._url="unknown";const n=this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:r.ServerConnection.makeSettings();this._url=i.URLExt.join(n.baseUrl,"api/config",encodeURIComponent(e.name))}get data(){return this._data}async load(){const e=await r.ServerConnection.makeRequest(this._url,{},this.serverSettings);if(200!==e.status)throw await r.ServerConnection.ResponseError.create(e);this._data=await e.json()}async update(e){this._data={...this._data,...e};const t={method:"PATCH",body:JSON.stringify(e)},n=await r.ServerConnection.makeRequest(this._url,t,this.serverSettings);if(200!==n.status)throw await r.ServerConnection.ResponseError.create(n);return this._data=await n.json(),this._data}}t.ConfigWithDefaults=class{constructor(e){var t,n;this._className="",this._section=e.section,this._defaults=null!==(t=e.defaults)&&void 0!==t?t:{},this._className=null!==(n=e.className)&&void 0!==n?n:""}get(e){const t=this._classData();return e in t?t[e]:this._defaults[e]}set(e,t){const n={};if(n[e]=t,this._className){const e={};return e[this._className]=n,this._section.update(e)}return this._section.update(n)}_classData(){const e=this._section.data;return this._className&&this._className in e?e[this._className]:e}}},8790:(e,t)=>{},9480:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventManager=void 0;const i=n(8925),r=n(6049),s=n(8571),o=n(2920),a="api/events";t.EventManager=class{constructor(e={}){var t;this._socket=null,this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:o.ServerConnection.makeSettings(),this._poll=new r.Poll({factory:()=>this._subscribe()}),this._stream=new s.Stream(this),this._poll.start()}get isDisposed(){return this._poll.isDisposed}get stream(){return this._stream}dispose(){if(this.isDisposed)return;this._poll.dispose();const e=this._socket;e&&(this._socket=null,e.onopen=()=>{},e.onerror=()=>{},e.onmessage=()=>{},e.onclose=()=>{},e.close()),s.Signal.clearData(this),this._stream.stop()}async emit(e){const{serverSettings:t}=this,{baseUrl:n}=t,{makeRequest:r,ResponseError:s}=o.ServerConnection,l=i.URLExt.join(n,a),u={body:JSON.stringify(e),method:"POST"},d=await r(l,u,t);if(204!==d.status)throw new s(d)}_subscribe(){return new Promise(((e,t)=>{if(this.isDisposed)return;const{appendToken:n,token:r,WebSocket:s,wsUrl:o}=this.serverSettings;let l=i.URLExt.join(o,a,"subscribe");n&&""!==r&&(l+=`?token=${encodeURIComponent(r)}`);const u=this._socket=new s(l),d=this._stream;u.onclose=()=>t(new Error("EventManager socket closed")),u.onmessage=e=>e.data&&d.emit(JSON.parse(e.data))}))}}},7883:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(3867),t),r(n(2170),t),r(n(8790),t),r(n(9480),t),r(n(973),t),r(n(2946),t),r(n(9740),t),r(n(2920),t),r(n(7668),t),r(n(7780),t),r(n(9040),t),r(n(9191),t),r(n(8053),t),r(n(8683),t)},7489:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.CommHandler=void 0;const o=n(7556),a=s(n(9909));class l extends o.DisposableDelegate{constructor(e,t,n,i){super(i),this._target="",this._id="",this._id=t,this._target=e,this._kernel=n}get commId(){return this._id}get targetName(){return this._target}get onClose(){return this._onClose}set onClose(e){this._onClose=e}get onMsg(){return this._onMsg}set onMsg(e){this._onMsg=e}open(e,t,n=[]){if(this.isDisposed||this._kernel.isDisposed)throw new Error("Cannot open");const i=a.createMessage({msgType:"comm_open",channel:"shell",username:this._kernel.username,session:this._kernel.clientId,content:{comm_id:this._id,target_name:this._target,data:null!=e?e:{}},metadata:t,buffers:n});return this._kernel.sendShellMessage(i,!1,!0)}send(e,t,n=[],i=!0){if(this.isDisposed||this._kernel.isDisposed)throw new Error("Cannot send");const r=a.createMessage({msgType:"comm_msg",channel:"shell",username:this._kernel.username,session:this._kernel.clientId,content:{comm_id:this._id,data:e},metadata:t,buffers:n});return this._kernel.sendShellMessage(r,!1,i)}close(e,t,n=[]){if(this.isDisposed||this._kernel.isDisposed)throw new Error("Cannot close");const i=a.createMessage({msgType:"comm_close",channel:"shell",username:this._kernel.username,session:this._kernel.clientId,content:{comm_id:this._id,data:null!=e?e:{}},metadata:t,buffers:n}),r=this._kernel.sendShellMessage(i,!1,!0),s=this._onClose;return s&&s(a.createMessage({msgType:"comm_close",channel:"iopub",username:this._kernel.username,session:this._kernel.clientId,content:{comm_id:this._id,data:null!=e?e:{}},metadata:t,buffers:n})),this.dispose(),r}}t.CommHandler=l},2456:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.KernelConnection=void 0;const o=n(8925),a=n(5764),l=n(8571),u=n(7883),d=n(7489),c=s(n(9909)),h=n(134),p=s(n(5855)),f=n(2946),g=s(n(8235)),m="_RESTARTING_";class v{constructor(e){var t,n,i,r;this._createSocket=(e=!0)=>{this._errorIfDisposed(),this._clearSocket(),this._updateConnectionStatus("connecting");const t=this.serverSettings,n=o.URLExt.join(t.wsUrl,g.KERNEL_SERVICE_URL,encodeURIComponent(this._id)),i=n.replace(/^((?:\w+:)?\/\/)(?:[^@\/]+@)/,"$1");console.debug(`Starting WebSocket: ${i}`);let r=o.URLExt.join(n,"channels?session_id="+encodeURIComponent(this._clientId));const s=t.token;t.appendToken&&""!==s&&(r+=`&token=${encodeURIComponent(s)}`);const a=e?this._supportedProtocols:[];this._ws=new t.WebSocket(r,a),this._ws.binaryType="arraybuffer";let l=!1;const d=async e=>{var n,i;if(!this._isDisposed){this._reason="",this._model=void 0;try{const n=await g.getKernelModel(this._id,t);this._model=n,"dead"===(null==n?void 0:n.execution_state)?this._updateStatus("dead"):this._onWSClose(e)}catch(t){if(t instanceof u.ServerConnection.NetworkError||503===(null===(n=t.response)||void 0===n?void 0:n.status)||424===(null===(i=t.response)||void 0===i?void 0:i.status)){const t=1e3*b.getRandomIntInclusive(10,30);setTimeout(d,t,e)}else this._reason="Kernel died unexpectedly",this._updateStatus("dead")}}},c=async e=>{l||(l=!0,await d(e))};this._ws.onmessage=this._onWSMessage,this._ws.onopen=this._onWSOpen,this._ws.onclose=c,this._ws.onerror=c},this._onWSOpen=e=>{if(""!==this._ws.protocol&&!this._supportedProtocols.includes(this._ws.protocol))throw console.log("Server selected unknown kernel wire protocol:",this._ws.protocol),this._updateStatus("dead"),new Error(`Unknown kernel wire protocol: ${this._ws.protocol}`);this._selectedProtocol=this._ws.protocol,this._ws.onclose=this._onWSClose,this._ws.onerror=this._onWSClose,this._updateConnectionStatus("connected")},this._onWSMessage=e=>{let t;try{t=this.serverSettings.serializer.deserialize(e.data,this._ws.protocol),p.validateMessage(t)}catch(e){throw e.message=`Kernel message validation error: ${e.message}`,e}this._kernelSession=t.header.session,this._msgChain=this._msgChain.then((()=>this._handleMessage(t))).catch((e=>{e.message.startsWith("Canceled future for ")&&console.error(e)})),this._anyMessage.emit({msg:t,direction:"recv"})},this._onWSClose=e=>{this.isDisposed||this._reconnect()},this._id="",this._name="",this._status="unknown",this._connectionStatus="connecting",this._kernelSession="",this._isDisposed=!1,this._ws=null,this._username="",this._reconnectLimit=7,this._reconnectAttempt=0,this._reconnectTimeout=null,this._supportedProtocols=Object.values(c.supportedKernelWebSocketProtocols),this._selectedProtocol="",this._futures=new Map,this._comms=new Map,this._targetRegistry=Object.create(null),this._info=new a.PromiseDelegate,this._pendingMessages=[],this._statusChanged=new l.Signal(this),this._connectionStatusChanged=new l.Signal(this),this._disposed=new l.Signal(this),this._iopubMessage=new l.Signal(this),this._anyMessage=new l.Signal(this),this._pendingInput=new l.Signal(this),this._unhandledMessage=new l.Signal(this),this._displayIdToParentIds=new Map,this._msgIdToDisplayIds=new Map,this._msgChain=Promise.resolve(),this._hasPendingInput=!1,this._reason="",this._noOp=()=>{},this._name=e.model.name,this._id=e.model.id,this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:u.ServerConnection.makeSettings(),this._clientId=null!==(n=e.clientId)&&void 0!==n?n:a.UUID.uuid4(),this._username=null!==(i=e.username)&&void 0!==i?i:"",this.handleComms=null===(r=e.handleComms)||void 0===r||r,this._createSocket()}get disposed(){return this._disposed}get statusChanged(){return this._statusChanged}get connectionStatusChanged(){return this._connectionStatusChanged}get iopubMessage(){return this._iopubMessage}get unhandledMessage(){return this._unhandledMessage}get model(){return this._model||{id:this.id,name:this.name,reason:this._reason}}get anyMessage(){return this._anyMessage}get pendingInput(){return this._pendingInput}get id(){return this._id}get name(){return this._name}get username(){return this._username}get clientId(){return this._clientId}get status(){return this._status}get connectionStatus(){return this._connectionStatus}get isDisposed(){return this._isDisposed}get info(){return this._info.promise}get spec(){return this._specPromise||(this._specPromise=f.KernelSpecAPI.getSpecs(this.serverSettings).then((e=>e.kernelspecs[this._name]))),this._specPromise}clone(e={}){return new v({model:this.model,username:this.username,serverSettings:this.serverSettings,handleComms:!1,...e})}dispose(){this.isDisposed||(this._isDisposed=!0,this._disposed.emit(),this._updateConnectionStatus("disconnected"),this._clearKernelState(),this._pendingMessages=[],this._clearSocket(),l.Signal.clearData(this))}sendShellMessage(e,t=!1,n=!0){return this._sendKernelShellControl(h.KernelShellFutureHandler,e,t,n)}sendControlMessage(e,t=!1,n=!0){return this._sendKernelShellControl(h.KernelControlFutureHandler,e,t,n)}_sendKernelShellControl(e,t,n=!1,i=!0){this._sendMessage(t),this._anyMessage.emit({msg:t,direction:"send"});const r=new e((()=>{const e=t.header.msg_id;this._futures.delete(e);const n=this._msgIdToDisplayIds.get(e);n&&(n.forEach((t=>{const n=this._displayIdToParentIds.get(t);if(n){const i=n.indexOf(e);if(-1===i)return;1===n.length?this._displayIdToParentIds.delete(t):(n.splice(i,1),this._displayIdToParentIds.set(t,n))}})),this._msgIdToDisplayIds.delete(e))}),t,n,i,this);return this._futures.set(t.header.msg_id,r),r}_sendMessage(e,t=!0){if("dead"===this.status)throw new Error("Kernel is dead");if((""===this._kernelSession||this._kernelSession===m)&&c.isInfoRequestMsg(e)){if("connected"===this.connectionStatus)return void this._ws.send(this.serverSettings.serializer.serialize(e,this._ws.protocol));throw new Error("Could not send message: status is not connected")}if(t&&this._pendingMessages.length>0)this._pendingMessages.push(e);else if("connected"===this.connectionStatus&&this._kernelSession!==m)this._ws.send(this.serverSettings.serializer.serialize(e,this._ws.protocol));else{if(!t)throw new Error("Could not send message");this._pendingMessages.push(e)}}async interrupt(){if(this.hasPendingInput=!1,"dead"===this.status)throw new Error("Kernel is dead");return g.interruptKernel(this.id,this.serverSettings)}async restart(){if("dead"===this.status)throw new Error("Kernel is dead");this._updateStatus("restarting"),this._clearKernelState(),this._kernelSession=m,await g.restartKernel(this.id,this.serverSettings),await this.reconnect(),this.hasPendingInput=!1}reconnect(){this._errorIfDisposed();const e=new a.PromiseDelegate,t=(n,i)=>{"connected"===i?(e.resolve(),this.connectionStatusChanged.disconnect(t,this)):"disconnected"===i&&(e.reject(new Error("Kernel connection disconnected")),this.connectionStatusChanged.disconnect(t,this))};return this.connectionStatusChanged.connect(t,this),this._reconnectAttempt=0,this._reconnect(),e.promise}async shutdown(){"dead"!==this.status&&await g.shutdownKernel(this.id,this.serverSettings),this.handleShutdown()}handleShutdown(){this._updateStatus("dead"),this.dispose()}async requestKernelInfo(){const e=c.createMessage({msgType:"kernel_info_request",channel:"shell",username:this._username,session:this._clientId,content:{}});let t;try{t=await b.handleShellMessage(this,e)}catch(e){if(this.isDisposed)return;throw e}if(this._errorIfDisposed(),t)return void 0===t.content.status&&(t.content.status="ok"),"ok"!==t.content.status?(this._info.reject("Kernel info reply errored"),t):(this._info.resolve(t.content),this._kernelSession=t.header.session,t)}requestComplete(e){const t=c.createMessage({msgType:"complete_request",channel:"shell",username:this._username,session:this._clientId,content:e});return b.handleShellMessage(this,t)}requestInspect(e){const t=c.createMessage({msgType:"inspect_request",channel:"shell",username:this._username,session:this._clientId,content:e});return b.handleShellMessage(this,t)}requestHistory(e){const t=c.createMessage({msgType:"history_request",channel:"shell",username:this._username,session:this._clientId,content:e});return b.handleShellMessage(this,t)}requestExecute(e,t=!0,n){const i=c.createMessage({msgType:"execute_request",channel:"shell",username:this._username,session:this._clientId,content:{silent:!1,store_history:!0,user_expressions:{},allow_stdin:!0,stop_on_error:!1,...e},metadata:n});return this.sendShellMessage(i,!0,t)}requestDebug(e,t=!0){const n=c.createMessage({msgType:"debug_request",channel:"control",username:this._username,session:this._clientId,content:e});return this.sendControlMessage(n,!0,t)}requestIsComplete(e){const t=c.createMessage({msgType:"is_complete_request",channel:"shell",username:this._username,session:this._clientId,content:e});return b.handleShellMessage(this,t)}requestCommInfo(e){const t=c.createMessage({msgType:"comm_info_request",channel:"shell",username:this._username,session:this._clientId,content:e});return b.handleShellMessage(this,t)}sendInputReply(e,t){const n=c.createMessage({msgType:"input_reply",channel:"stdin",username:this._username,session:this._clientId,content:e});n.parent_header=t,this._sendMessage(n),this._anyMessage.emit({msg:n,direction:"send"}),this.hasPendingInput=!1}createComm(e,t=a.UUID.uuid4()){if(!this.handleComms)throw new Error("Comms are disabled on this kernel connection");if(this._comms.has(t))throw new Error("Comm is already created");const n=new d.CommHandler(e,t,this,(()=>{this._unregisterComm(t)}));return this._comms.set(t,n),n}hasComm(e){return this._comms.has(e)}registerCommTarget(e,t){this.handleComms&&(this._targetRegistry[e]=t)}removeCommTarget(e,t){this.handleComms&&(this.isDisposed||this._targetRegistry[e]!==t||delete this._targetRegistry[e])}registerMessageHook(e,t){var n;const i=null===(n=this._futures)||void 0===n?void 0:n.get(e);i&&i.registerMessageHook(t)}removeMessageHook(e,t){var n;const i=null===(n=this._futures)||void 0===n?void 0:n.get(e);i&&i.removeMessageHook(t)}removeInputGuard(){this.hasPendingInput=!1}async _handleDisplayId(e,t){var n,i;const r=t.parent_header.msg_id;let s=this._displayIdToParentIds.get(e);if(s){const e={header:a.JSONExt.deepCopy(t.header),parent_header:a.JSONExt.deepCopy(t.parent_header),metadata:a.JSONExt.deepCopy(t.metadata),content:a.JSONExt.deepCopy(t.content),channel:t.channel,buffers:t.buffers?t.buffers.slice():[]};e.header.msg_type="update_display_data",await Promise.all(s.map((async t=>{const n=this._futures&&this._futures.get(t);n&&await n.handleMsg(e)})))}if("update_display_data"===t.header.msg_type)return!0;s=null!==(n=this._displayIdToParentIds.get(e))&&void 0!==n?n:[],-1===s.indexOf(r)&&s.push(r),this._displayIdToParentIds.set(e,s);const o=null!==(i=this._msgIdToDisplayIds.get(r))&&void 0!==i?i:[];return-1===o.indexOf(r)&&o.push(r),this._msgIdToDisplayIds.set(r,o),!1}_clearSocket(){null!==this._ws&&(this._ws.onopen=this._noOp,this._ws.onclose=this._noOp,this._ws.onerror=this._noOp,this._ws.onmessage=this._noOp,this._ws.close(),this._ws=null)}_updateStatus(e){this._status!==e&&"dead"!==this._status&&(this._status=e,b.logKernelStatus(this),this._statusChanged.emit(e),"dead"===e&&this.dispose())}_sendPending(){for(;"connected"===this.connectionStatus&&this._kernelSession!==m&&this._pendingMessages.length>0;)this._sendMessage(this._pendingMessages[0],!1),this._pendingMessages.shift()}_clearKernelState(){this._kernelSession="",this._pendingMessages=[],this._futures.forEach((e=>{e.dispose()})),this._comms.forEach((e=>{e.dispose()})),this._msgChain=Promise.resolve(),this._futures=new Map,this._comms=new Map,this._displayIdToParentIds.clear(),this._msgIdToDisplayIds.clear()}_assertCurrentMessage(e){if(this._errorIfDisposed(),e.header.session!==this._kernelSession)throw new Error(`Canceling handling of old message: ${e.header.msg_type}`)}async _handleCommOpen(e){this._assertCurrentMessage(e);const t=e.content,n=new d.CommHandler(t.target_name,t.comm_id,this,(()=>{this._unregisterComm(t.comm_id)}));this._comms.set(t.comm_id,n);try{const i=await b.loadObject(t.target_name,t.target_module,this._targetRegistry);await i(n,e)}catch(e){throw n.close(),console.error("Exception opening new comm"),e}}async _handleCommClose(e){this._assertCurrentMessage(e);const t=e.content,n=this._comms.get(t.comm_id);if(!n)return void console.error("Comm not found for comm id "+t.comm_id);this._unregisterComm(n.commId);const i=n.onClose;i&&await i(e),n.dispose()}async _handleCommMsg(e){this._assertCurrentMessage(e);const t=e.content,n=this._comms.get(t.comm_id);if(!n)return;const i=n.onMsg;i&&await i(e)}_unregisterComm(e){this._comms.delete(e)}_updateConnectionStatus(e){if(this._connectionStatus!==e){if(this._connectionStatus=e,"connecting"!==e&&(this._reconnectAttempt=0,clearTimeout(this._reconnectTimeout)),"dead"!==this.status)if("connected"===e){let e=this._kernelSession===m,t=this.requestKernelInfo(),n=!1,i=()=>{n||(n=!0,e&&this._kernelSession===m&&(this._kernelSession=""),clearTimeout(r),this._pendingMessages.length>0&&this._sendPending())};t.then(i);let r=setTimeout(i,3e3)}else this._updateStatus("unknown");this._connectionStatusChanged.emit(e)}}async _handleMessage(e){var t,n;let i=!1;if(e.parent_header&&"iopub"===e.channel&&(c.isDisplayDataMsg(e)||c.isUpdateDisplayDataMsg(e)||c.isExecuteResultMsg(e))){const n=(null!==(t=e.content.transient)&&void 0!==t?t:{}).display_id;n&&(i=await this._handleDisplayId(n,e),this._assertCurrentMessage(e))}if(!i&&e.parent_header){const t=e.parent_header,i=null===(n=this._futures)||void 0===n?void 0:n.get(t.msg_id);if(i)await i.handleMsg(e),this._assertCurrentMessage(e);else{const n=t.session===this.clientId;"iopub"!==e.channel&&n&&this._unhandledMessage.emit(e)}}if("iopub"===e.channel){switch(e.header.msg_type){case"status":{const t=e.content.execution_state;"restarting"===t&&Promise.resolve().then((async()=>{this._updateStatus("autorestarting"),this._clearKernelState(),await this.reconnect()})),this._updateStatus(t);break}case"comm_open":this.handleComms&&await this._handleCommOpen(e);break;case"comm_msg":this.handleComms&&await this._handleCommMsg(e);break;case"comm_close":this.handleComms&&await this._handleCommClose(e)}this.isDisposed||(this._assertCurrentMessage(e),this._iopubMessage.emit(e))}}_reconnect(){if(this._errorIfDisposed(),clearTimeout(this._reconnectTimeout),this._reconnectAttempt{if(t){if("undefined"==typeof requirejs)throw new Error("requirejs not found");requirejs([t],(n=>{void 0===n[e]?r(new Error(`Object '${e}' not found in module '${t}'`)):i(n[e])}),r)}else(null==n?void 0:n[e])?i(n[e]):r(new Error(`Object '${e}' not found in registry`))}))},e.getRandomIntInclusive=function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}}(b||(b={}))},134:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.KernelShellFutureHandler=t.KernelControlFutureHandler=t.KernelFutureHandler=void 0;const o=n(5764),a=n(7556),l=s(n(9909));class u extends a.DisposableDelegate{constructor(e,t,n,i,r){super(e),this._status=0,this._stdin=d.noOp,this._iopub=d.noOp,this._reply=d.noOp,this._done=new o.PromiseDelegate,this._hooks=new d.HookList,this._disposeOnDone=!0,this._msg=t,n||this._setFlag(d.KernelFutureFlag.GotReply),this._disposeOnDone=i,this._kernel=r}get msg(){return this._msg}get done(){return this._done.promise}get onReply(){return this._reply}set onReply(e){this._reply=e}get onIOPub(){return this._iopub}set onIOPub(e){this._iopub=e}get onStdin(){return this._stdin}set onStdin(e){this._stdin=e}registerMessageHook(e){if(this.isDisposed)throw new Error("Kernel future is disposed");this._hooks.add(e)}removeMessageHook(e){this.isDisposed||this._hooks.remove(e)}sendInputReply(e,t){this._kernel.sendInputReply(e,t)}dispose(){this._stdin=d.noOp,this._iopub=d.noOp,this._reply=d.noOp,this._hooks=null,this._testFlag(d.KernelFutureFlag.IsDone)||(this._done.promise.catch((()=>{})),this._done.reject(new Error(`Canceled future for ${this.msg.header.msg_type} message before replies were done`))),super.dispose()}async handleMsg(e){switch(e.channel){case"control":case"shell":e.channel===this.msg.channel&&e.parent_header.msg_id===this.msg.header.msg_id&&await this._handleReply(e);break;case"stdin":await this._handleStdin(e);break;case"iopub":await this._handleIOPub(e)}}async _handleReply(e){const t=this._reply;t&&await t(e),this._replyMsg=e,this._setFlag(d.KernelFutureFlag.GotReply),this._testFlag(d.KernelFutureFlag.GotIdle)&&this._handleDone()}async _handleStdin(e){this._kernel.hasPendingInput=!0;const t=this._stdin;t&&await t(e)}async _handleIOPub(e){const t=await this._hooks.process(e),n=this._iopub;t&&n&&await n(e),l.isStatusMsg(e)&&"idle"===e.content.execution_state&&(this._setFlag(d.KernelFutureFlag.GotIdle),this._testFlag(d.KernelFutureFlag.GotReply)&&this._handleDone())}_handleDone(){this._testFlag(d.KernelFutureFlag.IsDone)||(this._setFlag(d.KernelFutureFlag.IsDone),this._done.resolve(this._replyMsg),this._disposeOnDone&&this.dispose())}_testFlag(e){return!!(this._status&e)}_setFlag(e){this._status|=e}}var d;t.KernelFutureHandler=u,t.KernelControlFutureHandler=class extends u{},t.KernelShellFutureHandler=class extends u{},function(e){e.noOp=()=>{};const t="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;let n;e.HookList=class{constructor(){this._hooks=[]}add(e){this.remove(e),this._hooks.push(e)}remove(e){const t=this._hooks.indexOf(e);t>=0&&(this._hooks[t]=null,this._scheduleCompact())}async process(e){await this._processing;const t=new o.PromiseDelegate;let n;this._processing=t.promise;for(let i=this._hooks.length-1;i>=0;i--){const r=this._hooks[i];if(null!==r){try{n=await r(e)}catch(e){n=!0,console.error(e)}if(!1===n)return t.resolve(void 0),!1}}return t.resolve(void 0),!0}_scheduleCompact(){this._compactScheduled||(this._compactScheduled=!0,t((()=>{this._processing=this._processing.then((()=>{this._compactScheduled=!1,this._compact()}))})))}_compact(){let e=0;for(let t=0,n=this._hooks.length;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5198:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KernelManager=void 0;const i=n(6049),r=n(8571),s=n(7883),o=n(3867),a=n(8235),l=n(2456);class u extends o.BaseManager{constructor(e={}){var t;super(e),this._isReady=!1,this._kernelConnections=new Set,this._models=new Map,this._runningChanged=new r.Signal(this),this._connectionFailure=new r.Signal(this),this._pollModels=new i.Poll({auto:!1,factory:()=>this.requestRunning(),frequency:{interval:1e4,backoff:!0,max:3e5},name:"@jupyterlab/services:KernelManager#models",standby:null!==(t=e.standby)&&void 0!==t?t:"when-hidden"}),this._ready=(async()=>{await this._pollModels.start(),await this._pollModels.tick,this._isReady=!0})()}get isReady(){return this._isReady}get ready(){return this._ready}get runningChanged(){return this._runningChanged}get connectionFailure(){return this._connectionFailure}dispose(){this.isDisposed||(this._models.clear(),this._kernelConnections.forEach((e=>e.dispose())),this._pollModels.dispose(),super.dispose())}connectTo(e){var t;const{id:n}=e.model;let i=null===(t=e.handleComms)||void 0===t||t;if(void 0===e.handleComms)for(const e of this._kernelConnections)if(e.id===n&&e.handleComms){i=!1;break}const r=new l.KernelConnection({handleComms:i,...e,serverSettings:this.serverSettings});return this._onStarted(r),this._models.has(n)||this.refreshRunning().catch((()=>{})),r}running(){return this._models.values()}async refreshRunning(){await this._pollModels.refresh(),await this._pollModels.tick}async startNew(e={},t={}){const n=await(0,a.startNew)(e,this.serverSettings);return this.connectTo({...t,model:n})}async shutdown(e){await(0,a.shutdownKernel)(e,this.serverSettings),await this.refreshRunning()}async shutdownAll(){await this.refreshRunning(),await Promise.all([...this._models.keys()].map((e=>(0,a.shutdownKernel)(e,this.serverSettings)))),await this.refreshRunning()}async findById(e){return this._models.has(e)||await this.refreshRunning(),this._models.get(e)}async requestRunning(){var e,t;let n;try{n=await(0,a.listRunning)(this.serverSettings)}catch(n){throw(n instanceof s.ServerConnection.NetworkError||503===(null===(e=n.response)||void 0===e?void 0:e.status)||424===(null===(t=n.response)||void 0===t?void 0:t.status))&&this._connectionFailure.emit(n),n}this.isDisposed||this._models.size===n.length&&n.every((e=>{const t=this._models.get(e.id);return!!t&&t.connections===e.connections&&t.execution_state===e.execution_state&&t.last_activity===e.last_activity&&t.name===e.name&&t.reason===e.reason&&t.traceback===e.traceback}))||(this._models=new Map(n.map((e=>[e.id,e]))),this._kernelConnections.forEach((e=>{this._models.has(e.id)||e.handleShutdown()})),this._runningChanged.emit(n))}_onStarted(e){this._kernelConnections.add(e),e.statusChanged.connect(this._onStatusChanged,this),e.disposed.connect(this._onDisposed,this)}_onDisposed(e){this._kernelConnections.delete(e),this.refreshRunning().catch((()=>{}))}_onStatusChanged(e,t){"dead"===t&&this.refreshRunning().catch((()=>{}))}}t.KernelManager=u,function(e){e.NoopManager=class extends e{constructor(){super(...arguments),this._readyPromise=new Promise((()=>{}))}get isActive(){return!1}get parentReady(){return super.ready}async startNew(e={},t={}){return Promise.reject(new Error("Not implemented in no-op Kernel Manager"))}connectTo(e){throw new Error("Not implemented in no-op Kernel Manager")}async shutdown(e){return Promise.reject(new Error("Not implemented in no-op Kernel Manager"))}get ready(){return this.parentReady.then((()=>this._readyPromise))}async requestRunning(){return Promise.resolve()}}}(u||(t.KernelManager=u={}))},9909:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportedKernelWebSocketProtocols=t.isInputReplyMsg=t.isInputRequestMsg=t.isDebugReplyMsg=t.isDebugRequestMsg=t.isExecuteReplyMsg=t.isInfoRequestMsg=t.isCommMsgMsg=t.isCommCloseMsg=t.isCommOpenMsg=t.isDebugEventMsg=t.isClearOutputMsg=t.isStatusMsg=t.isErrorMsg=t.isExecuteResultMsg=t.isExecuteInputMsg=t.isUpdateDisplayDataMsg=t.isDisplayDataMsg=t.isStreamMsg=t.createMessage=void 0;const i=n(5764);var r;t.createMessage=function(e){var t,n,r,s,o;return{buffers:null!==(t=e.buffers)&&void 0!==t?t:[],channel:e.channel,content:e.content,header:{date:(new Date).toISOString(),msg_id:null!==(n=e.msgId)&&void 0!==n?n:i.UUID.uuid4(),msg_type:e.msgType,session:e.session,username:null!==(r=e.username)&&void 0!==r?r:"",version:"5.2"},metadata:null!==(s=e.metadata)&&void 0!==s?s:{},parent_header:null!==(o=e.parentHeader)&&void 0!==o?o:{}}},t.isStreamMsg=function(e){return"stream"===e.header.msg_type},t.isDisplayDataMsg=function(e){return"display_data"===e.header.msg_type},t.isUpdateDisplayDataMsg=function(e){return"update_display_data"===e.header.msg_type},t.isExecuteInputMsg=function(e){return"execute_input"===e.header.msg_type},t.isExecuteResultMsg=function(e){return"execute_result"===e.header.msg_type},t.isErrorMsg=function(e){return"error"===e.header.msg_type},t.isStatusMsg=function(e){return"status"===e.header.msg_type},t.isClearOutputMsg=function(e){return"clear_output"===e.header.msg_type},t.isDebugEventMsg=function(e){return"debug_event"===e.header.msg_type},t.isCommOpenMsg=function(e){return"comm_open"===e.header.msg_type},t.isCommCloseMsg=function(e){return"comm_close"===e.header.msg_type},t.isCommMsgMsg=function(e){return"comm_msg"===e.header.msg_type},t.isInfoRequestMsg=function(e){return"kernel_info_request"===e.header.msg_type},t.isExecuteReplyMsg=function(e){return"execute_reply"===e.header.msg_type},t.isDebugRequestMsg=function(e){return"debug_request"===e.header.msg_type},t.isDebugReplyMsg=function(e){return"debug_reply"===e.header.msg_type},t.isInputRequestMsg=function(e){return"input_request"===e.header.msg_type},t.isInputReplyMsg=function(e){return"input_reply"===e.header.msg_type},function(e){e.v1KernelWebsocketJupyterOrg="v1.kernel.websocket.jupyter.org"}(r||(t.supportedKernelWebSocketProtocols=r={}))},8235:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getKernelModel=t.shutdownKernel=t.interruptKernel=t.restartKernel=t.startNew=t.listRunning=t.KERNEL_SERVICE_URL=void 0;const i=n(2920),r=n(8925),s=n(5855);t.KERNEL_SERVICE_URL="api/kernels",t.listRunning=async function(e=i.ServerConnection.makeSettings()){const n=r.URLExt.join(e.baseUrl,t.KERNEL_SERVICE_URL),o=await i.ServerConnection.makeRequest(n,{},e);if(200!==o.status)throw await i.ServerConnection.ResponseError.create(o);const a=await o.json();return(0,s.validateModels)(a),a},t.startNew=async function(e={},n=i.ServerConnection.makeSettings()){const o=r.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL),a={method:"POST",body:JSON.stringify(e)},l=await i.ServerConnection.makeRequest(o,a,n);if(201!==l.status)throw await i.ServerConnection.ResponseError.create(l);const u=await l.json();return(0,s.validateModel)(u),u},t.restartKernel=async function(e,n=i.ServerConnection.makeSettings()){const o=r.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e),"restart"),a=await i.ServerConnection.makeRequest(o,{method:"POST"},n);if(200!==a.status)throw await i.ServerConnection.ResponseError.create(a);const l=await a.json();(0,s.validateModel)(l)},t.interruptKernel=async function(e,n=i.ServerConnection.makeSettings()){const s=r.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e),"interrupt"),o=await i.ServerConnection.makeRequest(s,{method:"POST"},n);if(204!==o.status)throw await i.ServerConnection.ResponseError.create(o)},t.shutdownKernel=async function(e,n=i.ServerConnection.makeSettings()){const s=r.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e)),o=await i.ServerConnection.makeRequest(s,{method:"DELETE"},n);if(404===o.status){const t=`The kernel "${e}" does not exist on the server`;console.warn(t)}else if(204!==o.status)throw await i.ServerConnection.ResponseError.create(o)},t.getKernelModel=async function(e,n=i.ServerConnection.makeSettings()){const o=r.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e)),a=await i.ServerConnection.makeRequest(o,{},n);if(404===a.status)return;if(200!==a.status)throw await i.ServerConnection.ResponseError.create(a);const l=await a.json();return(0,s.validateModel)(l),l}},7179:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.deserialize=t.serialize=void 0;const o=s(n(9909));var a;t.serialize=function(e,t=""){return t===o.supportedKernelWebSocketProtocols.v1KernelWebsocketJupyterOrg?a.serializeV1KernelWebsocketJupyterOrg(e):a.serializeDefault(e)},t.deserialize=function(e,t=""){return t===o.supportedKernelWebSocketProtocols.v1KernelWebsocketJupyterOrg?a.deserializeV1KernelWebsocketJupyterOrg(e):a.deserializeDefault(e)},function(e){e.deserializeV1KernelWebsocketJupyterOrg=function(e){let t;const n=new DataView(e),i=Number(n.getBigUint64(0,!0));let r=[];for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateModels=t.validateModel=t.validateMessage=void 0;const i=n(7441),r=["username","version","session","msg_id","msg_type"],s={stream:{name:"string",text:"string"},display_data:{data:"object",metadata:"object"},execute_input:{code:"string",execution_count:"number"},execute_result:{execution_count:"number",data:"object",metadata:"object"},error:{ename:"string",evalue:"string",traceback:"object"},status:{execution_state:["string",["starting","idle","busy","restarting","dead"]]},clear_output:{wait:"boolean"},comm_open:{comm_id:"string",target_name:"string",data:"object"},comm_msg:{comm_id:"string",data:"object"},comm_close:{comm_id:"string"},shutdown_reply:{restart:"boolean"}};function o(e){(0,i.validateProperty)(e,"name","string"),(0,i.validateProperty)(e,"id","string")}t.validateMessage=function(e){(0,i.validateProperty)(e,"metadata","object"),(0,i.validateProperty)(e,"content","object"),(0,i.validateProperty)(e,"channel","string"),function(e){for(let t=0;to(e)))}},2946:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t},o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.KernelSpecAPI=t.KernelSpec=void 0;const a=s(n(4806));t.KernelSpec=a;const l=s(n(6492));t.KernelSpecAPI=l,o(n(733),t)},4806:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},733:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.KernelSpecManager=void 0;const o=n(5764),a=n(6049),l=n(8571),u=s(n(6492)),d=n(3867);class c extends d.BaseManager{constructor(e={}){var t;super(e),this._isReady=!1,this._connectionFailure=new l.Signal(this),this._specs=null,this._specsChanged=new l.Signal(this),this._ready=Promise.all([this.requestSpecs()]).then((e=>{})).catch((e=>{})).then((()=>{this.isDisposed||(this._isReady=!0)})),this._pollSpecs=new a.Poll({auto:!1,factory:()=>this.requestSpecs(),frequency:{interval:61e3,backoff:!0,max:3e5},name:"@jupyterlab/services:KernelSpecManager#specs",standby:null!==(t=e.standby)&&void 0!==t?t:"when-hidden"}),this.ready.then((()=>{this._pollSpecs.start()}))}get isReady(){return this._isReady}get ready(){return this._ready}get specs(){return this._specs}get specsChanged(){return this._specsChanged}get connectionFailure(){return this._connectionFailure}dispose(){this._pollSpecs.dispose(),super.dispose()}async refreshSpecs(){await this._pollSpecs.refresh(),await this._pollSpecs.tick}async requestSpecs(){const e=await u.getSpecs(this.serverSettings);this.isDisposed||o.JSONExt.deepEqual(e,this._specs)||(this._specs=e,this._specsChanged.emit(e))}}t.KernelSpecManager=c},6492:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSpecs=void 0;const i=n(2920),r=n(2598),s=n(8925);t.getSpecs=async function(e=i.ServerConnection.makeSettings()){const t=s.URLExt.join(e.baseUrl,"api/kernelspecs"),n=await i.ServerConnection.makeRequest(t,{},e);if(200!==n.status)throw await i.ServerConnection.ResponseError.create(n);const o=await n.json();return(0,r.validateSpecModels)(o)}},2598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSpecModels=t.validateSpecModel=void 0;const i=n(7441);function r(e){const t=e.spec;if(!t)throw new Error("Invalid kernel spec");(0,i.validateProperty)(e,"name","string"),(0,i.validateProperty)(e,"resources","object"),(0,i.validateProperty)(t,"language","string"),(0,i.validateProperty)(t,"display_name","string"),(0,i.validateProperty)(t,"argv","array");let n=null;t.hasOwnProperty("metadata")&&((0,i.validateProperty)(t,"metadata","object"),n=t.metadata);let r=null;return t.hasOwnProperty("env")&&((0,i.validateProperty)(t,"env","object"),r=t.env),{name:e.name,resources:e.resources,language:t.language,display_name:t.display_name,argv:t.argv,metadata:n,env:r}}t.validateSpecModel=r,t.validateSpecModels=function(e){if(!e.hasOwnProperty("kernelspecs"))throw new Error("No kernelspecs found");let t=Object.keys(e.kernelspecs);const n=Object.create(null);let i=e.default;for(let i=0;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceManager=void 0;const i=n(8571),r=n(4219),s=n(8790),o=n(9480),a=n(973),l=n(2946),u=n(8683),d=n(2920),c=n(7668),h=n(7780),p=n(9040),f=n(9191),g=n(8053);t.ServiceManager=class{constructor(e={}){var t,n;this._isDisposed=!1,this._connectionFailure=new i.Signal(this),this._isReady=!1;const m=e.defaultDrive,v=null!==(t=e.serverSettings)&&void 0!==t?t:d.ServerConnection.makeSettings(),b={defaultDrive:m,serverSettings:v,standby:null!==(n=e.standby)&&void 0!==n?n:"when-hidden"};this.serverSettings=v,this.contents=e.contents||new s.ContentsManager(b),this.events=e.events||new o.EventManager(b),this.kernels=e.kernels||new a.KernelManager(b),this.sessions=e.sessions||new c.SessionManager({...b,kernelManager:this.kernels}),this.settings=e.settings||new h.SettingManager(b),this.terminals=e.terminals||new p.TerminalManager(b),this.builder=e.builder||new r.BuildManager(b),this.workspaces=e.workspaces||new g.WorkspaceManager(b),this.nbconvert=e.nbconvert||new u.NbConvertManager(b),this.kernelspecs=e.kernelspecs||new l.KernelSpecManager(b),this.user=e.user||new f.UserManager(b),this.kernelspecs.connectionFailure.connect(this._onConnectionFailure,this),this.sessions.connectionFailure.connect(this._onConnectionFailure,this),this.terminals.connectionFailure.connect(this._onConnectionFailure,this);const A=[this.sessions.ready,this.kernelspecs.ready];this.terminals.isAvailable()&&A.push(this.terminals.ready),this._readyPromise=Promise.all(A).then((()=>{this._isReady=!0}))}get connectionFailure(){return this._connectionFailure}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,i.Signal.clearData(this),this.contents.dispose(),this.events.dispose(),this.sessions.dispose(),this.terminals.dispose())}get isReady(){return this._isReady}get ready(){return this._readyPromise}_onConnectionFailure(e,t){this._connectionFailure.emit(t)}}},8683:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NbConvertManager=void 0;const i=n(8925),r=n(2920),s=n(5764);t.NbConvertManager=class{constructor(e={}){var t;this._exportFormats=null,this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:r.ServerConnection.makeSettings()}async fetchExportFormats(){this._requestingFormats=new s.PromiseDelegate,this._exportFormats=null;const e=this.serverSettings.baseUrl,t=i.URLExt.join(e,"api/nbconvert"),{serverSettings:n}=this,o=await r.ServerConnection.makeRequest(t,{},n);if(200!==o.status)throw await r.ServerConnection.ResponseError.create(o);const a=await o.json(),l={};return Object.keys(a).forEach((function(e){const t=a[e].output_mimetype;l[e]={output_mimetype:t}})),this._exportFormats=l,this._requestingFormats.resolve(l),l}async getExportFormats(e=!0){return this._requestingFormats?this._requestingFormats.promise:e||!this._exportFormats?await this.fetchExportFormats():this._exportFormats}}},2920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServerConnection=void 0;const i=n(8925),r=n(7179);let s;var o,a;s="undefined"==typeof window?n(7251):WebSocket,function(e){e.makeSettings=function(e){return a.makeSettings(e)},e.makeRequest=function(e,t,n){return a.handleRequest(e,t,n)};class t extends Error{static async create(e){try{const n=await e.json(),{message:i,traceback:r}=n;return r&&console.error(r),new t(e,null!=i?i:t._defaultMessage(e),null!=r?r:"")}catch(n){return console.debug(n),new t(e)}}constructor(e,n=t._defaultMessage(e),i=""){super(n),this.response=e,this.traceback=i}static _defaultMessage(e){return`Invalid response: ${e.status} ${e.statusText}`}}e.ResponseError=t;class n extends TypeError{constructor(e){super(e.message),this.stack=e.stack}}e.NetworkError=n}(o||(t.ServerConnection=o={})),function(e){e.makeSettings=function(e={}){var t;const n=i.PageConfig.getBaseUrl(),o=i.PageConfig.getWsUrl(),a=i.URLExt.normalize(e.baseUrl)||n;let l=e.wsUrl;l||a!==n||(l=o),l||0!==a.indexOf("http")||(l="ws"+a.slice(4)),l=null!=l?l:o;const u=i.PageConfig.getOption("appendToken").toLowerCase();let d;return d=""===u?"undefined"==typeof window||"undefined"!=typeof process&&void 0!==(null===(t=null===process||void 0===process?void 0:process.env)||void 0===t?void 0:t.JEST_WORKER_ID)||i.URLExt.getHostName(n)!==i.URLExt.getHostName(l):"true"===u,{init:{cache:"no-store",credentials:"same-origin"},fetch,Headers,Request,WebSocket:s,token:i.PageConfig.getToken(),appUrl:i.PageConfig.getOption("appUrl"),appendToken:d,serializer:{serialize:r.serialize,deserialize:r.deserialize},...e,baseUrl:a,wsUrl:l}},e.handleRequest=function(e,t,n){var i;if(0!==e.indexOf(n.baseUrl))throw new Error("Can only be used for notebook server requests");"no-store"===(null!==(i=t.cache)&&void 0!==i?i:n.init.cache)&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime());const r=new n.Request(e,{...n.init,...t});let s=!1;if(n.token&&(s=!0,r.headers.append("Authorization",`token ${n.token}`)),"undefined"!=typeof document){const e=function(){let e="";try{e=document.cookie}catch(e){return}const t=e.match("\\b_xsrf=([^;]*)\\b");return null==t?void 0:t[1]}();void 0!==e&&(s=!0,r.headers.append("X-XSRFToken",e))}return!r.headers.has("Content-Type")&&s&&r.headers.set("Content-Type","application/json"),n.fetch.call(null,r).catch((e=>{throw new o.NetworkError(e)}))}}(a||(a={}))},5341:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionConnection=void 0;const i=n(8571),r=n(7883),s=n(7570),o=n(5764);t.SessionConnection=class{constructor(e){var t,n,s,a;this._id="",this._path="",this._name="",this._type="",this._kernel=null,this._isDisposed=!1,this._disposed=new i.Signal(this),this._kernelChanged=new i.Signal(this),this._statusChanged=new i.Signal(this),this._connectionStatusChanged=new i.Signal(this),this._pendingInput=new i.Signal(this),this._iopubMessage=new i.Signal(this),this._unhandledMessage=new i.Signal(this),this._anyMessage=new i.Signal(this),this._propertyChanged=new i.Signal(this),this._id=e.model.id,this._name=e.model.name,this._path=e.model.path,this._type=e.model.type,this._username=null!==(t=e.username)&&void 0!==t?t:"",this._clientId=null!==(n=e.clientId)&&void 0!==n?n:o.UUID.uuid4(),this._connectToKernel=e.connectToKernel,this._kernelConnectionOptions=null!==(s=e.kernelConnectionOptions)&&void 0!==s?s:{},this.serverSettings=null!==(a=e.serverSettings)&&void 0!==a?a:r.ServerConnection.makeSettings(),this.setupKernel(e.model.kernel)}get disposed(){return this._disposed}get kernelChanged(){return this._kernelChanged}get statusChanged(){return this._statusChanged}get connectionStatusChanged(){return this._connectionStatusChanged}get pendingInput(){return this._pendingInput}get iopubMessage(){return this._iopubMessage}get unhandledMessage(){return this._unhandledMessage}get anyMessage(){return this._anyMessage}get propertyChanged(){return this._propertyChanged}get id(){return this._id}get kernel(){return this._kernel}get path(){return this._path}get type(){return this._type}get name(){return this._name}get model(){return{id:this.id,kernel:this.kernel&&{id:this.kernel.id,name:this.kernel.name},path:this._path,type:this._type,name:this._name}}get isDisposed(){return this._isDisposed}update(e){const t=this.model;if(this._path=e.path,this._name=e.name,this._type=e.type,null===this._kernel&&null!==e.kernel||null!==this._kernel&&null===e.kernel||null!==this._kernel&&null!==e.kernel&&this._kernel.id!==e.kernel.id){null!==this._kernel&&this._kernel.dispose();const t=this._kernel||null;this.setupKernel(e.kernel);const n=this._kernel||null;this._kernelChanged.emit({name:"kernel",oldValue:t,newValue:n})}this._handleModelChange(t)}dispose(){if(!this.isDisposed){if(this._isDisposed=!0,this._disposed.emit(),this._kernel){this._kernel.dispose();const e=this._kernel;this._kernel=null;const t=this._kernel;this._kernelChanged.emit({name:"kernel",oldValue:e,newValue:t})}i.Signal.clearData(this)}}async setPath(e){if(this.isDisposed)throw new Error("Session is disposed");await this._patch({path:e})}async setName(e){if(this.isDisposed)throw new Error("Session is disposed");await this._patch({name:e})}async setType(e){if(this.isDisposed)throw new Error("Session is disposed");await this._patch({type:e})}async changeKernel(e){if(this.isDisposed)throw new Error("Session is disposed");return await this._patch({kernel:e}),this.kernel}async shutdown(){if(this.isDisposed)throw new Error("Session is disposed");await(0,s.shutdownSession)(this.id,this.serverSettings),this.dispose()}setupKernel(e){if(null===e)return void(this._kernel=null);const t=this._connectToKernel({...this._kernelConnectionOptions,model:e,username:this._username,clientId:this._clientId,serverSettings:this.serverSettings});this._kernel=t,t.statusChanged.connect(this.onKernelStatus,this),t.connectionStatusChanged.connect(this.onKernelConnectionStatus,this),t.pendingInput.connect(this.onPendingInput,this),t.unhandledMessage.connect(this.onUnhandledMessage,this),t.iopubMessage.connect(this.onIOPubMessage,this),t.anyMessage.connect(this.onAnyMessage,this)}onKernelStatus(e,t){this._statusChanged.emit(t)}onKernelConnectionStatus(e,t){this._connectionStatusChanged.emit(t)}onPendingInput(e,t){this._pendingInput.emit(t)}onIOPubMessage(e,t){this._iopubMessage.emit(t)}onUnhandledMessage(e,t){this._unhandledMessage.emit(t)}onAnyMessage(e,t){this._anyMessage.emit(t)}async _patch(e){const t=await(0,s.updateSession)({...e,id:this._id},this.serverSettings);return this.update(t),t}_handleModelChange(e){e.name!==this._name&&this._propertyChanged.emit("name"),e.type!==this._type&&this._propertyChanged.emit("type"),e.path!==this._path&&this._propertyChanged.emit("path")}}},7668:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t},o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.SessionAPI=t.Session=void 0;const a=s(n(7240));t.Session=a;const l=s(n(7570));t.SessionAPI=l,o(n(6919),t)},6919:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionManager=void 0;const i=n(6049),r=n(8571),s=n(2920),o=n(3867),a=n(5341),l=n(7570);class u extends o.BaseManager{constructor(e){var t;super(e),this._isReady=!1,this._sessionConnections=new Set,this._models=new Map,this._runningChanged=new r.Signal(this),this._connectionFailure=new r.Signal(this),this._connectToKernel=e=>this._kernelManager.connectTo(e),this._kernelManager=e.kernelManager,this._pollModels=new i.Poll({auto:!1,factory:()=>this.requestRunning(),frequency:{interval:1e4,backoff:!0,max:3e5},name:"@jupyterlab/services:SessionManager#models",standby:null!==(t=e.standby)&&void 0!==t?t:"when-hidden"}),this._ready=(async()=>{await this._pollModels.start(),await this._pollModels.tick,this._kernelManager.isActive&&await this._kernelManager.ready,this._isReady=!0})()}get isReady(){return this._isReady}get ready(){return this._ready}get runningChanged(){return this._runningChanged}get connectionFailure(){return this._connectionFailure}dispose(){this.isDisposed||(this._models.clear(),this._sessionConnections.forEach((e=>e.dispose())),this._pollModels.dispose(),super.dispose())}connectTo(e){const t=new a.SessionConnection({...e,connectToKernel:this._connectToKernel,serverSettings:this.serverSettings});return this._onStarted(t),this._models.has(e.model.id)||this.refreshRunning().catch((()=>{})),t}running(){return this._models.values()}async refreshRunning(){await this._pollModels.refresh(),await this._pollModels.tick}async startNew(e,t={}){const n=await(0,l.startSession)(e,this.serverSettings);return await this.refreshRunning(),this.connectTo({...t,model:n})}async shutdown(e){await(0,l.shutdownSession)(e,this.serverSettings),await this.refreshRunning()}async shutdownAll(){await this.refreshRunning(),await Promise.all([...this._models.keys()].map((e=>(0,l.shutdownSession)(e,this.serverSettings)))),await this.refreshRunning()}async stopIfNeeded(e){try{const t=(await(0,l.listRunning)(this.serverSettings)).filter((t=>t.path===e));if(1===t.length){const e=t[0].id;await this.shutdown(e)}}catch(e){}}async findById(e){return this._models.has(e)||await this.refreshRunning(),this._models.get(e)}async findByPath(e){for(const t of this._models.values())if(t.path===e)return t;await this.refreshRunning();for(const t of this._models.values())if(t.path===e)return t}async requestRunning(){var e,t;let n;try{n=await(0,l.listRunning)(this.serverSettings)}catch(n){throw(n instanceof s.ServerConnection.NetworkError||503===(null===(e=n.response)||void 0===e?void 0:e.status)||424===(null===(t=n.response)||void 0===t?void 0:t.status))&&this._connectionFailure.emit(n),n}this.isDisposed||this._models.size===n.length&&n.every((e=>{var t,n,i,r;const s=this._models.get(e.id);return!!s&&(null===(t=s.kernel)||void 0===t?void 0:t.id)===(null===(n=e.kernel)||void 0===n?void 0:n.id)&&(null===(i=s.kernel)||void 0===i?void 0:i.name)===(null===(r=e.kernel)||void 0===r?void 0:r.name)&&s.name===e.name&&s.path===e.path&&s.type===e.type}))||(this._models=new Map(n.map((e=>[e.id,e]))),this._sessionConnections.forEach((e=>{this._models.has(e.id)?e.update(this._models.get(e.id)):e.dispose()})),this._runningChanged.emit(n))}_onStarted(e){this._sessionConnections.add(e),e.disposed.connect(this._onDisposed,this),e.propertyChanged.connect(this._onChanged,this),e.kernelChanged.connect(this._onChanged,this)}_onDisposed(e){this._sessionConnections.delete(e),this.refreshRunning().catch((()=>{}))}_onChanged(){this.refreshRunning().catch((()=>{}))}}t.SessionManager=u,function(e){e.NoopManager=class extends e{constructor(){super(...arguments),this._readyPromise=new Promise((()=>{}))}get isActive(){return!1}get parentReady(){return super.ready}async startNew(e,t={}){return Promise.reject(new Error("Not implemented in no-op Session Manager"))}connectTo(e){throw Error("Not implemented in no-op Session Manager")}get ready(){return this.parentReady.then((()=>this._readyPromise))}async shutdown(e){return Promise.reject(new Error("Not implemented in no-op Session Manager"))}async requestRunning(){return Promise.resolve()}}}(u||(t.SessionManager=u={}))},7570:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateSession=t.startSession=t.getSessionModel=t.shutdownSession=t.getSessionUrl=t.listRunning=t.SESSION_SERVICE_URL=void 0;const i=n(2920),r=n(8925),s=n(5684);function o(e,n){const i=r.URLExt.join(e,t.SESSION_SERVICE_URL),s=r.URLExt.join(i,n);if(!s.startsWith(i))throw new Error("Can only be used for services requests");return s}t.SESSION_SERVICE_URL="api/sessions",t.listRunning=async function(e=i.ServerConnection.makeSettings()){const n=r.URLExt.join(e.baseUrl,t.SESSION_SERVICE_URL),o=await i.ServerConnection.makeRequest(n,{},e);if(200!==o.status)throw await i.ServerConnection.ResponseError.create(o);const a=await o.json();if(!Array.isArray(a))throw new Error("Invalid Session list");return a.forEach((e=>{(0,s.updateLegacySessionModel)(e),(0,s.validateModel)(e)})),a},t.getSessionUrl=o,t.shutdownSession=async function(e,t=i.ServerConnection.makeSettings()){var n;const r=o(t.baseUrl,e),s=await i.ServerConnection.makeRequest(r,{method:"DELETE"},t);if(404===s.status){const t=null!==(n=(await s.json()).message)&&void 0!==n?n:`The session "${e}"" does not exist on the server`;console.warn(t)}else{if(410===s.status)throw new i.ServerConnection.ResponseError(s,"The kernel was deleted but the session was not");if(204!==s.status)throw await i.ServerConnection.ResponseError.create(s)}},t.getSessionModel=async function(e,t=i.ServerConnection.makeSettings()){const n=o(t.baseUrl,e),r=await i.ServerConnection.makeRequest(n,{},t);if(200!==r.status)throw await i.ServerConnection.ResponseError.create(r);const a=await r.json();return(0,s.updateLegacySessionModel)(a),(0,s.validateModel)(a),a},t.startSession=async function(e,n=i.ServerConnection.makeSettings()){const o=r.URLExt.join(n.baseUrl,t.SESSION_SERVICE_URL),a={method:"POST",body:JSON.stringify(e)},l=await i.ServerConnection.makeRequest(o,a,n);if(201!==l.status)throw await i.ServerConnection.ResponseError.create(l);const u=await l.json();return(0,s.updateLegacySessionModel)(u),(0,s.validateModel)(u),u},t.updateSession=async function(e,t=i.ServerConnection.makeSettings()){const n=o(t.baseUrl,e.id),r={method:"PATCH",body:JSON.stringify(e)},a=await i.ServerConnection.makeRequest(n,r,t);if(200!==a.status)throw await i.ServerConnection.ResponseError.create(a);const l=await a.json();return(0,s.updateLegacySessionModel)(l),(0,s.validateModel)(l),l}},7240:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5684:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateModels=t.updateLegacySessionModel=t.validateModel=void 0;const i=n(5855),r=n(7441);function s(e){(0,r.validateProperty)(e,"id","string"),(0,r.validateProperty)(e,"type","string"),(0,r.validateProperty)(e,"name","string"),(0,r.validateProperty)(e,"path","string"),(0,r.validateProperty)(e,"kernel","object"),(0,i.validateModel)(e.kernel)}t.validateModel=s,t.updateLegacySessionModel=function(e){void 0===e.path&&void 0!==e.notebook&&(e.path=e.notebook.path,e.type="notebook",e.name="")},t.validateModels=function(e){if(!Array.isArray(e))throw new Error("Invalid session list");e.forEach((e=>s(e)))}},7780:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SettingManager=void 0;const i=n(8925),r=n(1670),s=n(2920);class o extends r.DataConnector{constructor(e={}){var t;super(),this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:s.ServerConnection.makeSettings()}async fetch(e){if(!e)throw new Error("Plugin `id` parameter is required for settings fetch.");const{serverSettings:t}=this,{baseUrl:n,appUrl:i}=t,{makeRequest:r,ResponseError:o}=s.ServerConnection,l=n+i,u=a.url(l,e),d=await r(u,{},t);if(200!==d.status)throw await o.create(d);return d.json()}async list(e){var t,n,i,r;const{serverSettings:o}=this,{baseUrl:l,appUrl:u}=o,{makeRequest:d,ResponseError:c}=s.ServerConnection,h=l+u,p=a.url(h,"","ids"===e),f=await d(p,{},o);if(200!==f.status)throw new c(f);const g=await f.json(),m=null!==(n=null===(t=null==g?void 0:g.settings)||void 0===t?void 0:t.map((e=>e.id)))&&void 0!==n?n:[];let v=[];return e||(v=null!==(r=null===(i=null==g?void 0:g.settings)||void 0===i?void 0:i.map((e=>(e.data={composite:{},user:{}},e))))&&void 0!==r?r:[]),{ids:m,values:v}}async save(e,t){const{serverSettings:n}=this,{baseUrl:i,appUrl:r}=n,{makeRequest:o,ResponseError:l}=s.ServerConnection,u=i+r,d=a.url(u,e),c={body:JSON.stringify({raw:t}),method:"PUT"},h=await o(d,c,n);if(204!==h.status)throw new l(h)}}var a;t.SettingManager=o,function(e){e.url=function(e,t,n){const r=n?i.URLExt.objectToQueryString({ids_only:!0}):"",s=i.URLExt.join(e,"api/settings"),o=i.URLExt.join(s,t);if(!o.startsWith(s))throw new Error("Can only be used for workspaces requests");return`${o}${r}`}}(a||(a={}))},7251:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=WebSocket},9040:(e,t)=>{},9191:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManager=void 0;const i=n(8925),r=n(5764),s=n(6049),o=n(8571),a=n(2920),l=n(3867),u="@jupyterlab/services:UserManager#user";class d extends l.BaseManager{constructor(e={}){var t;super(e),this._isReady=!1,this._userChanged=new o.Signal(this),this._connectionFailure=new o.Signal(this),this._ready=this.requestUser().then((()=>{this.isDisposed||(this._isReady=!0)})).catch((e=>new Promise((()=>{})))),this._pollSpecs=new s.Poll({auto:!1,factory:()=>this.requestUser(),frequency:{interval:61e3,backoff:!0,max:3e5},name:u,standby:null!==(t=e.standby)&&void 0!==t?t:"when-hidden"}),this.ready.then((()=>{this._pollSpecs.start()}))}get isReady(){return this._isReady}get ready(){return this._ready}get identity(){return this._identity}get permissions(){return this._permissions}get userChanged(){return this._userChanged}get connectionFailure(){return this._connectionFailure}dispose(){this._pollSpecs.dispose(),super.dispose()}async refreshUser(){await this._pollSpecs.refresh(),await this._pollSpecs.tick}async requestUser(){if(this.isDisposed)return;const{baseUrl:e}=this.serverSettings,{makeRequest:t,ResponseError:n}=a.ServerConnection,s=i.URLExt.join(e,"api/me"),o=await t(s,{},this.serverSettings);if(200!==o.status)throw await n.create(o);const l={identity:this._identity,permissions:this._permissions},d=await o.json(),h=d.identity,{localStorage:p}=window,f=p.getItem(u);if(f&&(!h.initials||!h.color)){const e=JSON.parse(f);h.initials=h.initials||e.initials||h.name.substring(0,1),h.color=h.color||e.color||c.getRandomColor()}r.JSONExt.deepEqual(d,l)||(this._identity=h,this._permissions=d.permissions,p.setItem(u,JSON.stringify(h)),this._userChanged.emit(d))}}var c;t.UserManager=d,function(e){const t=["var(--jp-collaborator-color1)","var(--jp-collaborator-color2)","var(--jp-collaborator-color3)","var(--jp-collaborator-color4)","var(--jp-collaborator-color5)","var(--jp-collaborator-color6)","var(--jp-collaborator-color7)"];e.getRandomColor=()=>t[Math.floor(Math.random()*t.length)]}(c||(c={}))},7441:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateProperty=void 0,t.validateProperty=function(e,t,n,i=[]){if(!e.hasOwnProperty(t))throw Error(`Missing property '${t}'`);const r=e[t];if(void 0!==n){let e=!0;switch(n){case"array":e=Array.isArray(r);break;case"object":e=void 0!==r;break;default:e=typeof r===n}if(!e)throw new Error(`Property '${t}' is not of type '${n}'`);if(i.length>0){let e=!0;switch(n){case"string":case"number":case"boolean":e=i.includes(r);break;default:e=i.findIndex((e=>e===r))>=0}if(!e)throw new Error(`Property '${t}' is not one of the valid values ${JSON.stringify(i)}`)}}}},8053:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceManager=void 0;const i=n(8925),r=n(1670),s=n(2920);class o extends r.DataConnector{constructor(e={}){var t;super(),this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:s.ServerConnection.makeSettings()}async fetch(e){const{serverSettings:t}=this,{baseUrl:n,appUrl:i}=t,{makeRequest:r,ResponseError:o}=s.ServerConnection,l=n+i,u=a.url(l,e),d=await r(u,{},t);if(200!==d.status)throw await o.create(d);return d.json()}async list(){const{serverSettings:e}=this,{baseUrl:t,appUrl:n}=e,{makeRequest:i,ResponseError:r}=s.ServerConnection,o=t+n,l=a.url(o,""),u=await i(l,{},e);if(200!==u.status)throw await r.create(u);return(await u.json()).workspaces}async remove(e){const{serverSettings:t}=this,{baseUrl:n,appUrl:i}=t,{makeRequest:r,ResponseError:o}=s.ServerConnection,l=n+i,u=a.url(l,e),d=await r(u,{method:"DELETE"},t);if(204!==d.status)throw await o.create(d)}async save(e,t){const{serverSettings:n}=this,{baseUrl:i,appUrl:r}=n,{makeRequest:o,ResponseError:l}=s.ServerConnection,u=i+r,d=a.url(u,e),c={body:JSON.stringify(t),method:"PUT"},h=await o(d,c,n);if(204!==h.status)throw await l.create(h)}}var a;t.WorkspaceManager=o,function(e){e.url=function(e,t){const n=i.URLExt.join(e,"api/workspaces"),r=i.URLExt.join(n,t);if(!r.startsWith(n))throw new Error("Can only be used for workspaces requests");return r}}(a||(a={}))},4949:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataConnector=void 0,t.DataConnector=class{async list(e){throw new Error("DataConnector#list method has not been implemented.")}async remove(e){throw new Error("DataConnector#remove method has not been implemented.")}async save(e,t){throw new Error("DataConnector#save method has not been implemented.")}}},1670:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(4949),t),r(n(9708),t),r(n(4025),t),r(n(2133),t),r(n(8022),t)},9708:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4025:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RestorablePool=void 0;const i=n(5764),r=n(6573),s=n(8571);var o;t.RestorablePool=class{constructor(e){this._added=new s.Signal(this),this._current=null,this._currentChanged=new s.Signal(this),this._hasRestored=!1,this._isDisposed=!1,this._objects=new Set,this._restore=null,this._restored=new i.PromiseDelegate,this._updated=new s.Signal(this),this.namespace=e.namespace}get added(){return this._added}get current(){return this._current}set current(e){this._current!==e&&null!==e&&this._objects.has(e)&&(this._current=e,this._currentChanged.emit(this._current))}get currentChanged(){return this._currentChanged}get isDisposed(){return this._isDisposed}get restored(){return this._restored.promise}get size(){return this._objects.size}get updated(){return this._updated}async add(e){var t,n;if(e.isDisposed){const t="A disposed object cannot be added.";throw console.warn(t,e),new Error(t)}if(this._objects.has(e)){const t="This object already exists in the pool.";throw console.warn(t,e),new Error(t)}if(this._objects.add(e),e.disposed.connect(this._onInstanceDisposed,this),!o.injectedProperty.get(e)){if(this._restore){const{connector:i}=this._restore,r=this._restore.name(e);if(r){const s=`${this.namespace}:${r}`,a=null===(n=(t=this._restore).args)||void 0===n?void 0:n.call(t,e);o.nameProperty.set(e,s),await i.save(s,{data:a})}}this._added.emit(e)}}dispose(){this.isDisposed||(this._current=null,this._isDisposed=!0,this._objects.clear(),s.Signal.clearData(this))}find(e){const t=this._objects.values();for(const n of t)if(e(n))return n}forEach(e){this._objects.forEach(e)}filter(e){const t=[];return this.forEach((n=>{e(n)&&t.push(n)})),t}inject(e){return o.injectedProperty.set(e,!0),this.add(e)}has(e){return this._objects.has(e)}async restore(e){if(this._hasRestored)throw new Error("This pool has already been restored.");this._hasRestored=!0;const{command:t,connector:n,registry:i,when:r}=e,s=this.namespace,o=r?[n.list(s)].concat(r):[n.list(s)];this._restore=e;const[a]=await Promise.all(o),l=await Promise.all(a.ids.map((async(e,r)=>{const s=a.values[r],o=s&&s.data;return void 0===o?n.remove(e):i.execute(t,o).catch((()=>n.remove(e)))})));return this._restored.resolve(),l}async save(e){var t,n;const i=o.injectedProperty.get(e);if(!this._restore||!this.has(e)||i)return;const{connector:r}=this._restore,s=this._restore.name(e),a=o.nameProperty.get(e),l=s?`${this.namespace}:${s}`:"";if(a&&a!==l&&await r.remove(a),o.nameProperty.set(e,l),l){const i=null===(n=(t=this._restore).args)||void 0===n?void 0:n.call(t,e);await r.save(l,{data:i})}a!==l&&this._updated.emit(e)}_onInstanceDisposed(e){if(this._objects.delete(e),e===this._current&&(this._current=null,this._currentChanged.emit(this._current)),o.injectedProperty.get(e))return;if(!this._restore)return;const{connector:t}=this._restore,n=o.nameProperty.get(e);n&&t.remove(n)}},function(e){e.injectedProperty=new r.AttachedProperty({name:"injected",create:()=>!1}),e.nameProperty=new r.AttachedProperty({name:"name",create:()=>""})}(o||(o={}))},2133:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StateDB=void 0;const i=n(8571);class r{constructor(e={}){this._changed=new i.Signal(this);const{connector:t,transform:n}=e;this._connector=t||new r.Connector,this._ready=n?n.then((e=>{const{contents:t,type:n}=e;switch(n){case"cancel":default:return;case"clear":return this._clear();case"merge":return this._merge(t||{});case"overwrite":return this._overwrite(t||{})}})):Promise.resolve(void 0)}get changed(){return this._changed}async clear(){await this._ready,await this._clear()}async fetch(e){return await this._ready,this._fetch(e)}async list(e){return await this._ready,this._list(e)}async remove(e){await this._ready,await this._remove(e),this._changed.emit({id:e,type:"remove"})}async save(e,t){await this._ready,await this._save(e,t),this._changed.emit({id:e,type:"save"})}async toJSON(){await this._ready;const{ids:e,values:t}=await this._list();return t.reduce(((t,n,i)=>(t[e[i]]=n,t)),{})}async _clear(){await Promise.all((await this._list()).ids.map((e=>this._remove(e))))}async _fetch(e){const t=await this._connector.fetch(e);if(t)return JSON.parse(t).v}async _list(e=""){const{ids:t,values:n}=await this._connector.list(e);return{ids:t,values:n.map((e=>JSON.parse(e).v))}}async _merge(e){await Promise.all(Object.keys(e).map((t=>e[t]&&this._save(t,e[t]))))}async _overwrite(e){await this._clear(),await this._merge(e)}async _remove(e){return this._connector.remove(e)}async _save(e,t){return this._connector.save(e,JSON.stringify({v:t}))}}t.StateDB=r,function(e){e.Connector=class{constructor(){this._storage={}}async fetch(e){return this._storage[e]}async list(e=""){return Object.keys(this._storage).reduce(((t,n)=>(""!==e&&e!==n.split(":")[0]||(t.ids.push(n),t.values.push(this._storage[n])),t)),{ids:[],values:[]})}async remove(e){delete this._storage[e]}async save(e,t){this._storage[e]=t}}}(r||(t.StateDB=r={}))},8022:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IStateDB=void 0;const i=n(5764);t.IStateDB=new i.Token("@jupyterlab/coreutils:IStateDB",'A service for the JupyterLab state database.\n Use this if you want to store data that will persist across page loads.\n See "state database" for more information.')},509:(e,t,n)=>{"use strict";function i(e){return e.replace("-","_")}n.d(t,{sQ:()=>l,wK:()=>s});class r{constructor(e){e=e||{},this._defaults={domain:"messages",locale:document.documentElement.getAttribute("lang")||"en",pluralFunc:function(e){return{nplurals:2,plural:1!=e?1:0}},contextDelimiter:String.fromCharCode(4),stringsPrefix:""},this._locale=(e.locale||this._defaults.locale).replace("_","-"),this._domain=i(e.domain||this._defaults.domain),this._contextDelimiter=e.contextDelimiter||this._defaults.contextDelimiter,this._stringsPrefix=e.stringsPrefix||this._defaults.stringsPrefix,this._pluralFuncs={},this._dictionary={},this._pluralForms={},e.messages&&(this._dictionary[this._domain]={},this._dictionary[this._domain][this._locale]=e.messages),e.pluralForms&&(this._pluralForms[this._locale]=e.pluralForms)}setContextDelimiter(e){this._contextDelimiter=e}getContextDelimiter(){return this._contextDelimiter}setLocale(e){this._locale=e.replace("_","-")}getLocale(){return this._locale}setDomain(e){this._domain=i(e)}getDomain(){return this._domain}setStringsPrefix(e){this._stringsPrefix=e}getStringsPrefix(){return this._stringsPrefix}static strfmt(e,...t){return e.replace(/%%/g,"%% ").replace(/%(\d+)/g,(function(e,n){return t[n-1]})).replace(/%% /g,"%")}loadJSON(e,t){if(!e[""]||!e[""].language||!e[""].pluralForms)throw new Error(`Wrong jsonData, it must have an empty key ("") with "language" and "pluralForms" information: ${e}`);t=i(t);let n=e[""],r=JSON.parse(JSON.stringify(e));delete r[""],this.setMessages(t||this._defaults.domain,n.language,r,n.pluralForms)}__(e,...t){return this.gettext(e,...t)}_n(e,t,n,...i){return this.ngettext(e,t,n,...i)}_p(e,t,...n){return this.pgettext(e,t,...n)}_np(e,t,n,i,...r){return this.npgettext(e,t,n,i,...r)}gettext(e,...t){return this.dcnpgettext("","",e,"",0,...t)}ngettext(e,t,n,...i){return this.dcnpgettext("","",e,t,n,...i)}pgettext(e,t,...n){return this.dcnpgettext("",e,t,"",0,...n)}npgettext(e,t,n,i,...r){return this.dcnpgettext("",e,t,n,i,...r)}dcnpgettext(e,t,n,r,s,...o){let a;e=i(e)||this._domain;let l=t?t+this._contextDelimiter+n:n,u={pluralForm:!1},d=!1,c=this._locale,h=this.expandLocale(this._locale);for(let t in h)if(c=h[t],d=this._dictionary[e]&&this._dictionary[e][c]&&this._dictionary[e][c][l],d=r?d&&this._dictionary[e][c][l].length>1:d&&1==this._dictionary[e][c][l].length,d){u.locale=c;break}if(d?a=this._dictionary[e][c][l]:(a=[n],u.pluralFunc=this._defaults.pluralFunc),!r)return this.t(a,s,u,...o);u.pluralForm=!0;let p=d?a:[n,r];return this.t(p,s,u,...o)}expandLocale(e){let t=[e],n=e.lastIndexOf("-");for(;n>0;)e=e.slice(0,n),t.push(e),n=e.lastIndexOf("-");return t}getPluralFunc(e){if(!new RegExp("^\\s*nplurals\\s*=\\s*[0-9]+\\s*;\\s*plural\\s*=\\s*(?:\\s|[-\\?\\|&=!<>+*/%:;n0-9_()])+").test(e))throw new Error(r.strfmt('The plural form "%1" is not valid',e));return new Function("n","let plural, nplurals; "+e+" return { nplurals: nplurals, plural: (plural === true ? 1 : (plural ? plural : 0)) };")}removeContext(e){return-1!==e.indexOf(this._contextDelimiter)?e.split(this._contextDelimiter)[1]:e}t(e,t,n,...i){if(!n.pluralForm)return this._stringsPrefix+r.strfmt(this.removeContext(e[0]),...i);let s;return n.pluralFunc?s=n.pluralFunc(t):(this._pluralFuncs[n.locale||""]||(this._pluralFuncs[n.locale||""]=this.getPluralFunc(this._pluralForms[n.locale||""])),s=this._pluralFuncs[n.locale||""](t)),(void 0===!s.plural||s.plural>s.nplurals||e.length<=s.plural)&&(s.plural=0),this._stringsPrefix+r.strfmt(this.removeContext(e[s.plural]),...[t].concat(i))}setMessages(e,t,n,r){e=i(e),r&&(this._pluralForms[t]=r),this._dictionary[e]||(this._dictionary[e]={}),this._dictionary[e][t]=n}}const s=new class{constructor(e){this.languageCode="en",this._languageBundle=e}load(e){return this._languageBundle}}(new class{__(e,...t){return this.gettext(e,...t)}_n(e,t,n,...i){return this.ngettext(e,t,n,...i)}_p(e,t,...n){return this.pgettext(e,t,...n)}_np(e,t,n,i,...r){return this.npgettext(e,t,n,i,...r)}gettext(e,...t){return r.strfmt(e,...t)}ngettext(e,t,n,...i){return r.strfmt(1==n?e:t,...[n].concat(i))}pgettext(e,t,...n){return r.strfmt(t,...n)}npgettext(e,t,n,i,...r){return this.ngettext(t,n,i,...r)}dcnpgettext(e,t,n,i,r,...s){return this.ngettext(n,i,r,...s)}});var o=n(1670),a=n(5764);n(8925),n(7883),new a.Token("@jupyterlab/translation:ITranslatorConnector","A service to connect to the server translation endpoint."),o.DataConnector;const l=new a.Token("@jupyterlab/translation:ITranslator","A service to translate strings.")},8135:(e,t,n)=>{"use strict";var i;function r(e){return"function"==typeof e.iter?e.iter():new l(e)}function s(e,t){for(var n,i=0,s=r(e);void 0!==(n=s.next());)if(!1===t(n,i++))return}function o(e,t){for(var n,i=0,s=r(e);void 0!==(n=s.next());)if(!t(n,i++))return!1;return!0}function a(e,t){for(var n,i=0,s=r(e);void 0!==(n=s.next());)if(t(n,i++))return!0;return!1}n.d(t,{$0:()=>h,Ie:()=>u,Rw:()=>i,Si:()=>o,__:()=>s,zN:()=>a}),function(e){function t(e,t,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,s=e.length;if(0===s)return-1;n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))=n)){for(var i=e[t],r=t+1;r0;){var l=a>>1,u=o+l;n(e[u],t)<0?(o=u+1,a-=l+1):a=l}return o},e.upperBound=function(e,t,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var s=e.length;if(0===s)return 0;for(var o=i=i<0?Math.max(0,i+s):Math.min(i,s-1),a=(r=r<0?Math.max(0,r+s):Math.min(r,s-1))-i+1;a>0;){var l=a>>1,u=o+l;n(e[u],t)>0?a=l:(o=u+1,a-=l+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(var i=0,r=e.length;i=o&&(n=r<0?o-1:o),void 0===i?i=r<0?-1:o:i<0?i=Math.max(i+o,r<0?-1:0):i>=o&&(i=r<0?o-1:o),s=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);for(var a=[],l=0;l=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))){var o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0!==t){var a=n+t;s(e,n,a-1),s(e,a,i),s(e,n,i)}}},e.fill=function(e,t,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=e.length;if(0!==r){var s;n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))t;--r)e[r]=e[r-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var s=t(e,n,i,r);return-1!==s&&o(e,s),s},e.removeLastOf=function(e,t,i,r){void 0===i&&(i=-1),void 0===r&&(r=0);var s=n(e,t,i,r);return-1!==s&&o(e,s),s},e.removeAllOf=function(e,t,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var s=0,o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s},e.removeFirstWhere=function(e,t,n,r){var s;void 0===n&&(n=0),void 0===r&&(r=-1);var a=i(e,t,n,r);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeLastWhere=function(e,t,n,i){var s;void 0===n&&(n=-1),void 0===i&&(i=0);var a=r(e,t,n,i);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeAllWhere=function(e,t,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var s=0,o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s}}(i||(i={}));var l=function(){function e(e){this._index=0,this._source=e}return e.prototype.iter=function(){return this},e.prototype.clone=function(){var t=new e(this._source);return t._index=this._index,t},e.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},e}();function u(){return new c}(function(){function e(e,t){void 0===t&&(t=Object.keys(e)),this._index=0,this._source=e,this._keys=t}e.prototype.iter=function(){return this},e.prototype.clone=function(){var t=new e(this._source,this._keys);return t._index=this._index,t},e.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?e:this.next()}}})(),function(){function e(e,t){void 0===t&&(t=Object.keys(e)),this._index=0,this._source=e,this._keys=t}e.prototype.iter=function(){return this},e.prototype.clone=function(){var t=new e(this._source,this._keys);return t._index=this._index,t},e.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?this._source[e]:this.next()}}}(),function(){function e(e,t){void 0===t&&(t=Object.keys(e)),this._index=0,this._source=e,this._keys=t}e.prototype.iter=function(){return this},e.prototype.clone=function(){var t=new e(this._source,this._keys);return t._index=this._index,t},e.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?[e,this._source[e]]:this.next()}}}(),function(){function e(e){this._fn=e}e.prototype.iter=function(){return this},e.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},e.prototype.next=function(){return this._fn.call(void 0)}}(),function(){function e(e){this._cloned=!1,this._source=e,this._active=void 0}e.prototype.iter=function(){return this},e.prototype.clone=function(){var t=new e(this._source.clone());return t._active=this._active&&this._active.clone(),t._cloned=!0,this._cloned=!0,t},e.prototype.next=function(){if(void 0===this._active){var e=this._source.next();if(void 0===e)return;this._active=this._cloned?e.clone():e}var t=this._active.next();return void 0!==t?t:(this._active=void 0,this.next())}}();var d,c=function(){function e(){}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e},e.prototype.next=function(){},e}();function h(e){return"function"==typeof e.retro?e.retro():new f(e)}!function(){function e(e,t){this._source=e,this._index=t}e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._source.clone(),this._index)},e.prototype.next=function(){var e=this._source.next();if(void 0!==e)return[this._index++,e]}}(),function(){function e(e,t){this._index=0,this._source=e,this._fn=t}e.prototype.iter=function(){return this},e.prototype.clone=function(){var t=new e(this._source.clone(),this._fn);return t._index=this._index,t},e.prototype.next=function(){for(var e,t=this._fn,n=this._source;void 0!==(e=n.next());)if(t(e,this._index++))return e}}(),function(){function e(e,t){this._index=0,this._source=e,this._fn=t}e.prototype.iter=function(){return this},e.prototype.clone=function(){var t=new e(this._source.clone(),this._fn);return t._index=this._index,t},e.prototype.next=function(){var e=this._source.next();if(void 0!==e)return this._fn.call(void 0,e,this._index++)}}(),function(){function e(e,t,n){this._index=0,this._start=e,this._stop=t,this._step=n,this._length=d.rangeLength(e,t,n)}e.prototype.iter=function(){return this},e.prototype.clone=function(){var t=new e(this._start,this._stop,this._step);return t._index=this._index,t},e.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++}}(),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||e=this._source.length))return this._source[this._index--]},e}();!function(){function e(e,t){this._source=e,this._step=t}e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._source.clone(),this._step)},e.prototype.next=function(){for(var e=this._source.next(),t=this._step-1;t>0;--t)this._source.next();return e}}(),function(e){function t(e,t,n){void 0===n&&(n=0);for(var i=new Array(t.length),r=0,s=n,o=t.length;rt?1:0}}(p||(p={})),function(){function e(e,t){this._source=e,this._count=t}e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._source.clone(),this._count)},e.prototype.next=function(){if(!(this._count<=0)){var e=this._source.next();if(void 0!==e)return this._count--,e}}}(),function(){function e(e){this._source=e}e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._source.map((function(e){return e.clone()})))},e.prototype.next=function(){for(var e=new Array(this._source.length),t=0,n=this._source.length;t{if(i===e.provides)return!0;const o=n.get(i);if(!o)return!1;const a=t.get(o),l=[...a.requires,...a.optional];return 0!==l.length&&(s.push(o),!!l.some(r)||(s.pop(),!1))};if(!e.provides||0===i.length)return;const s=[e.id];if(i.some(r))throw new ReferenceError(`Cycle detected: ${s.join(" -> ")}.`)},e.findDependents=function(e,n,i){const r=new Array,s=e=>{const t=n.get(e),s=[...t.requires,...t.optional];r.push(...s.reduce(((t,n)=>{const r=i.get(n);return r&&t.push([e,r]),t}),[]))};for(const e of n.keys())s(e);const o=r.filter((t=>t[1]===e));let a=0;for(;o.length>a;){const e=o.length,t=new Set(o.map((e=>e[0])));for(const e of t)r.filter((t=>t[1]===e)).forEach((e=>{o.includes(e)||o.push(e)}));a=e}const l=t.topologicSort(o),u=l.findIndex((t=>t===e));return-1===u?[e]:l.slice(0,u+1)},e.collectStartupPlugins=function(e,t){const n=new Set;for(const t of e.keys())!0===e.get(t).autoStart&&n.add(t);if(t.startPlugins)for(const e of t.startPlugins)n.add(e);if(t.ignorePlugins)for(const e of t.ignorePlugins)n.delete(e);return Array.from(n)}}(n||(n={}));function i(e){let t=0;for(let n=0,i=e.length;n>>0),e[n]=255&t,t>>>=8}e.Random=void 0,(e.Random||(e.Random={})).getRandomValues=(()=>{const e="undefined"!=typeof window&&(window.crypto||window.msCrypto)||null;return e&&"function"==typeof e.getRandomValues?function(t){return e.getRandomValues(t)}:i})(),e.UUID=void 0,(e.UUID||(e.UUID={})).uuid4=function(e){const t=new Uint8Array(16),n=new Array(256);for(let e=0;e<16;++e)n[e]="0"+e.toString(16);for(let e=16;e<256;++e)n[e]=e.toString(16);return function(){return e(t),t[6]=64|15&t[6],t[8]=128|63&t[8],n[t[0]]+n[t[1]]+n[t[2]]+n[t[3]]+"-"+n[t[4]]+n[t[5]]+"-"+n[t[6]]+n[t[7]]+"-"+n[t[8]]+n[t[9]]+"-"+n[t[10]]+n[t[11]]+n[t[12]]+n[t[13]]+n[t[14]]+n[t[15]]}}(e.Random.getRandomValues),e.MimeData=class{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(e){return-1!==this._types.indexOf(e)}getData(e){let t=this._types.indexOf(e);return-1!==t?this._values[t]:void 0}setData(e,t){this.clearData(e),this._types.push(e),this._values.push(t)}clearData(e){let t=this._types.indexOf(e);-1!==t&&(this._types.splice(t,1),this._values.splice(t,1))}clear(){this._types.length=0,this._values.length=0}},e.PluginRegistry=class{constructor(e={}){this._application=null,this._validatePlugin=()=>!0,this._plugins=new Map,this._services=new Map,e.validatePlugin&&(console.info("Plugins may be rejected by the custom validation plugin method."),this._validatePlugin=e.validatePlugin)}get application(){return this._application}set application(e){if(null!==this._application)throw Error("PluginRegistry.application is already set. It cannot be overridden.");this._application=e}get deferredPlugins(){return Array.from(this._plugins).filter((([e,t])=>"defer"===t.autoStart)).map((([e,t])=>e))}getPluginDescription(e){var t,n;return null!==(n=null===(t=this._plugins.get(e))||void 0===t?void 0:t.description)&&void 0!==n?n:""}hasPlugin(e){return this._plugins.has(e)}isPluginActivated(e){var t,n;return null!==(n=null===(t=this._plugins.get(e))||void 0===t?void 0:t.activated)&&void 0!==n&&n}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(e){if(this._plugins.has(e.id))throw new TypeError(`Plugin '${e.id}' is already registered.`);if(!this._validatePlugin(e))throw new Error(`Plugin '${e.id}' is not valid.`);const t=n.createPluginData(e);n.ensureNoCycle(t,this._plugins,this._services),t.provides&&this._services.set(t.provides,t.id),this._plugins.set(t.id,t)}registerPlugins(e){for(const t of e)this.registerPlugin(t)}deregisterPlugin(e,t){const n=this._plugins.get(e);if(n){if(n.activated&&!t)throw new Error(`Plugin '${e}' is still active.`);this._plugins.delete(e)}}async activatePlugin(e){const t=this._plugins.get(e);if(!t)throw new ReferenceError(`Plugin '${e}' is not registered.`);if(t.activated)return;if(t.promise)return t.promise;const n=t.requires.map((e=>this.resolveRequiredService(e))),i=t.optional.map((e=>this.resolveOptionalService(e)));return t.promise=Promise.all([...n,...i]).then((e=>t.activate.apply(void 0,[this.application,...e]))).then((e=>{t.service=e,t.activated=!0,t.promise=null})).catch((e=>{throw t.promise=null,e})),t.promise}async activatePlugins(e,t={}){switch(e){case"defer":{const e=this.deferredPlugins.filter((e=>this._plugins.get(e).autoStart)).map((e=>this.activatePlugin(e)));await Promise.all(e);break}case"startUp":{const e=n.collectStartupPlugins(this._plugins,t).map((async e=>{try{return await this.activatePlugin(e)}catch(t){console.error(`Plugin '${e}' failed to activate.`,t)}}));await Promise.all(e);break}}}async deactivatePlugin(e){const t=this._plugins.get(e);if(!t)throw new ReferenceError(`Plugin '${e}' is not registered.`);if(!t.activated)return[];if(!t.deactivate)throw new TypeError(`Plugin '${e}'#deactivate() method missing`);const i=n.findDependents(e,this._plugins,this._services),r=i.map((e=>this._plugins.get(e)));for(const t of r)if(!t.deactivate)throw new TypeError(`Plugin ${t.id}#deactivate() method missing (depends on ${e})`);for(const e of r){const t=[...e.requires,...e.optional].map((e=>{const t=this._services.get(e);return t?this._plugins.get(t).service:null}));await e.deactivate(this.application,...t),e.service=null,e.activated=!1}return i.pop(),i}async resolveRequiredService(e){const t=this._services.get(e);if(!t)throw new TypeError(`No provider for: ${e.name}.`);const n=this._plugins.get(t);return n.activated||await this.activatePlugin(t),n.service}async resolveOptionalService(e){const t=this._services.get(e);if(!t)return null;const n=this._plugins.get(t);if(!n.activated)try{await this.activatePlugin(t)}catch(e){return console.error(e),null}return n.service}},e.PromiseDelegate=class{constructor(){this.promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}resolve(e){(0,this._resolve)(e)}reject(e){(0,this._reject)(e)}},e.Token=class{constructor(e,t){this.name=e,this.description=null!=t?t:"",this._tokenStructuralPropertyT=null}}}(t,n(5102))},5102:(e,t,n)=>{"use strict";var i,r,s;function*o(...e){for(const t of e)yield*t}function*a(){}function*l(e,t=0){for(const n of e)yield[t++,n]}function*u(e,t){let n=0;for(const i of e)t(i,n++)&&(yield i)}function d(e,t){let n=0;for(const i of e)if(t(i,n++))return i}function c(e,t){let n=0;for(const i of e)if(t(i,n++))return n-1;return-1}function h(e,t){let n;for(const i of e)void 0!==n?t(i,n)<0&&(n=i):n=i;return n}function p(e,t){let n;for(const i of e)void 0!==n?t(i,n)>0&&(n=i):n=i;return n}function f(e,t){let n,i,r=!0;for(const s of e)r?(n=s,i=s,r=!1):t(s,n)<0?n=s:t(s,i)>0&&(i=s);return r?void 0:[n,i]}function g(e){return Array.from(e)}function m(e){const t={};for(const[n,i]of e)t[n]=i;return t}function v(e,t){let n=0;for(const i of e)if(!1===t(i,n++))return}function b(e,t){let n=0;for(const i of e)if(!1===t(i,n++))return!1;return!0}function A(e,t){let n=0;for(const i of e)if(t(i,n++))return!0;return!1}function*y(e,t){let n=0;for(const i of e)yield t(i,n++)}function*w(e,t,n){void 0===t?(t=e,e=0,n=1):void 0===n&&(n=1);const i=r.rangeLength(e,t,n);for(let t=0;t-1;t--)yield e[t]}function D(e){let t=[],n=new Set,i=new Map;for(const t of e)r(t);for(const[e]of i)s(e);return t;function r(e){let[t,n]=e,r=i.get(n);r?r.push(t):i.set(n,[t])}function s(e){if(n.has(e))return;n.add(e);let r=i.get(e);if(r)for(const e of r)s(e);t.push(e)}}function*S(e,t){let n=0;for(const i of e)0==n++%t&&(yield i)}function*T(e,t){if(t<1)return;const n=e[Symbol.iterator]();let i;for(;0e[Symbol.iterator]()));let n=t.map((e=>e.next()));for(;b(n,(e=>!e.done));n=t.map((e=>e.next())))yield n.map((e=>e.value))}n.r(t),n.d(t,{ArrayExt:()=>i,StringExt:()=>s,chain:()=>o,each:()=>v,empty:()=>a,enumerate:()=>l,every:()=>b,filter:()=>u,find:()=>d,findIndex:()=>c,map:()=>y,max:()=>p,min:()=>h,minmax:()=>f,once:()=>C,range:()=>w,reduce:()=>_,repeat:()=>E,retro:()=>x,some:()=>A,stride:()=>S,take:()=>T,toArray:()=>g,toObject:()=>m,topologicSort:()=>D,zip:()=>B}),function(e){function t(e,t,n=0,i=-1){let r,s=e.length;if(0===s)return-1;n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,r=o+i;n(e[r],t)<0?(o=r+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,r=-1){let s=e.length;if(0===s)return 0;let o=i=i<0?Math.max(0,i+s):Math.min(i,s-1),a=(r=r<0?Math.max(0,r+s):Math.min(r,s-1))-i+1;for(;a>0;){let i=a>>1,r=o+i;n(e[r],t)>0?a=i:(o=r+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,r=e.length;i=o&&(n=r<0?o-1:o),void 0===i?i=r<0?-1:o:i<0?i=Math.max(i+o,r<0?-1:0):i>=o&&(i=r<0?o-1:o),s=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;s(e,n,a-1),s(e,a,i),s(e,n,i)},e.fill=function(e,t,n=0,i=-1){let r,s=e.length;if(0!==s){n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,r=-1){let s=t(e,n,i,r);return-1!==s&&o(e,s),s},e.removeLastOf=function(e,t,i=-1,r=0){let s=n(e,t,i,r);return-1!==s&&o(e,s),s},e.removeAllOf=function(e,t,n=0,i=-1){let r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s},e.removeFirstWhere=function(e,t,n=0,r=-1){let s,a=i(e,t,n,r);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeLastWhere=function(e,t,n=-1,i=0){let s,a=r(e,t,n,i);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeAllWhere=function(e,t,n=0,i=-1){let r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s}}(i||(i={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(s||(s={}))},7556:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DisposableDelegate:()=>r,DisposableSet:()=>o,ObservableDisposableDelegate:()=>s,ObservableDisposableSet:()=>a});var i=n(8571);class r{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}}class s extends r{constructor(){super(...arguments),this._disposed=new i.Signal(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),i.Signal.clearData(this))}}class o{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach((e=>{e.dispose()})),this._items.clear())}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}}!function(e){e.from=function(t){let n=new e;for(const e of t)n.add(e);return n}}(o||(o={}));class a extends o{constructor(){super(...arguments),this._disposed=new i.Signal(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),i.Signal.clearData(this))}}!function(e){e.from=function(t){let n=new e;for(const e of t)n.add(e);return n}}(a||(a={}))},3326:(e,t,n)=>{"use strict";n.d(t,{Mu:()=>l});var i,r=n(8135),s=function(){function e(e){this._root=new i.LeafNode,this.cmp=e}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"first",{get:function(){var e=i.firstLeaf(this._root);return e.size>0?e.items[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){var e=i.lastLeaf(this._root);return e.size>0?e.items[e.size-1]:void 0},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return i.iterItems(this._root)},e.prototype.retro=function(){return i.retroItems(this._root)},e.prototype.slice=function(e,t){return i.sliceItems(this._root,e,t)},e.prototype.retroSlice=function(e,t){return i.retroSliceItems(this._root,e,t)},e.prototype.at=function(e){return i.itemAt(this._root,e)},e.prototype.has=function(e,t){return i.hasItem(this._root,e,t)},e.prototype.indexOf=function(e,t){return i.indexOf(this._root,e,t)},e.prototype.get=function(e,t){return i.getItem(this._root,e,t)},e.prototype.assign=function(e){this.clear(),this.update(e)},e.prototype.insert=function(e){var t=i.insertItem(this._root,e,this.cmp);return this._root=i.maybeSplitRoot(this._root),t},e.prototype.update=function(e){var t=this;(0,r.__)(e,(function(e){t.insert(e)}))},e.prototype.delete=function(e,t){var n=i.deleteItem(this._root,e,t);return this._root=i.maybeExtractRoot(this._root),n},e.prototype.remove=function(e){var t=i.removeItem(this._root,e);return this._root=i.maybeExtractRoot(this._root),t},e.prototype.clear=function(){i.clear(this._root),this._root=new i.LeafNode},e}();!function(e){e.from=function(t,n){var i=new e(n);return i.assign(t),i}}(s||(s={})),function(e){var t=function(){function e(){this.items=[],this.sizes=[],this.children=[]}return Object.defineProperty(e.prototype,"type",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.sizes[this.sizes.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),e}();e.BranchNode=t;var n=function(){function e(){this.next=null,this.prev=null,this.items=[]}return Object.defineProperty(e.prototype,"type",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),e}();function i(e){for(;0===e.type;)e=e.children[0];return e}function s(e){for(;0===e.type;)e=e.children[e.children.length-1];return e}function o(e){0===e.type?((0,r.__)(e.children,o),e.children.length=0,e.sizes.length=0,e.items.length=0):(e.items.length=0,e.next=null,e.prev=null)}e.LeafNode=n,e.firstLeaf=i,e.lastLeaf=s,e.iterItems=function(e){var t=i(e);return new u(t,0,-1)},e.retroItems=function(e){var t=s(e);return new d(t,t.size-1,-1)},e.sliceItems=function(e,t,n){t=void 0===t?0:t<0?Math.max(0,t+e.size):Math.min(t,e.size),n=void 0===n?e.size:n<0?Math.max(0,n+e.size):Math.min(n,e.size);var i=Math.max(0,n-t);if(0===i)return(0,r.Ie)();for(;0===e.type;){var s=c(e.sizes,t);s>0&&(t-=e.sizes[s-1]),e=e.children[s]}return new u(e,t,i)},e.retroSliceItems=function(e,t,n){t=void 0===t?e.size-1:t<0?Math.max(-1,t+e.size):Math.min(t,e.size-1),n=void 0===n?-1:n<0?Math.max(-1,n+e.size):Math.min(n,e.size-1);var i=Math.max(0,t-n);if(0===i)return(0,r.Ie)();for(;0===e.type;){var s=c(e.sizes,t);s>0&&(t-=e.sizes[s-1]),e=e.children[s]}return new d(e,t,i)},e.itemAt=function(e,t){if(t<0&&(t+=e.size),!(t<0||t>=e.size)){for(;0===e.type;){var n=c(e.sizes,t);n>0&&(t-=e.sizes[n-1]),e=e.children[n]}return e.items[t]}},e.hasItem=function(e,t,n){for(;0===e.type;){var i=h(e.items,t,n);e=e.children[i]}return p(e.items,t,n)>=0},e.indexOf=function(e,t,n){for(var i=0;0===e.type;){var r=h(e.items,t,n);r>0&&(i+=e.sizes[r-1]),e=e.children[r]}var s=p(e.items,t,n);return s>=0?i+s:-i+s},e.getItem=function(e,t,n){for(;0===e.type;){var i=h(e.items,t,n);e=e.children[i]}var r=p(e.items,t,n);return r>=0?e.items[r]:void 0},e.insertItem=function e(t,n,i){if(1===t.type){var s,o=p(t.items,n,i);return o>=0?(s=t.items[o],t.items[o]=n):(s=void 0,r.Rw.insert(t.items,-o-1,n)),s}var l=h(t.items,n,i),u=t.children[l],d=u.size,c=e(u,n,i),m=u.size;if(t.items[l]=u.items[0],d===m)return c;if(u.width>a){var v=g(u);r.Rw.insert(t.children,l+1,v),r.Rw.insert(t.items,l+1,v.items[0])}return f(t,l),c},e.deleteItem=function e(t,n,i){if(1===t.type){var s=p(t.items,n,i);if(s<0)return;return r.Rw.removeAt(t.items,s)}var o=h(t.items,n,i),a=t.children[o],u=a.size,d=e(a,n,i);return u===a.size||(t.items[o]=a.items[0],a.width=t.size)){if(1===t.type)return r.Rw.removeAt(t.items,n);var i=c(t.sizes,n);i>0&&(n-=t.sizes[i]);var s=t.children[i],o=e(s,n);return t.items[i]=s.items[0],s.width1)return e;var t=e.children.pop();return o(e),t};var a=32,l=a>>1,u=function(){function e(e,t,n){this._node=e,this._index=t,this._count=n}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._node,this._index,this._count)},e.prototype.next=function(){if(null!==this._node&&0!==this._count)return this._index>=this._node.size?(this._node=this._node.next,this._index=0,this.next()):(this._count>0&&this._count--,this._node.items[this._index++])},e}(),d=function(){function e(e,t,n){this._node=e,this._index=t,this._count=n}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._node,this._index,this._count)},e.prototype.next=function(){if(null!==this._node&&0!==this._count)return this._index>=this._node.size&&(this._index=this._node.size-1),this._index<0?(this._node=this._node.prev,this._index=this._node?this._node.size-1:-1,this.next()):(this._count>0&&this._count--,this._node.items[this._index--])},e}();function c(e,t){for(var n=e.length,i=0;it)return i;return n-1}function h(e,t,n){for(var i=e.length,r=1;r0)return r-1;return i-1}function p(e,t,n){for(var i=e.length,r=0;r0)return-r-1}return-i-1}function f(e,t){for(var n=e.sizes,i=e.children,r=t>0?n[t-1]:0,s=i.length;tl;if(g&&m&&p){var v=h;return(b=c).items.push(v.items.shift()),e.items[t+1]=v.items[0],t}if(g&&m&&!p)return v=h,(b=c).items.unshift(v.items.pop()),e.items[t]=b.items[0],t-1;if(g&&!m&&p){var b=c;return(n=(v=h).items).unshift.apply(n,b.items),r.Rw.removeAt(e.children,t),r.Rw.removeAt(e.items,t+1),b.prev&&(b.prev.next=v),v.prev=b.prev,o(b),t}if(g&&!m&&!p)return b=c,(i=(v=h).items).push.apply(i,b.items),r.Rw.removeAt(e.children,t),r.Rw.removeAt(e.items,t),b.next&&(b.next.prev=v),v.next=b.next,o(b),t-1;if(!g&&m&&p)return v=h,(b=c).children.push(v.children.shift()),b.items.push(v.items.shift()),e.items[t+1]=v.items[0],f(b,b.width-1),f(v,0),t;if(!g&&m&&!p)return v=h,(b=c).children.unshift(v.children.pop()),b.items.unshift(v.items.pop()),e.items[t]=b.items[0],f(b,0),f(v,v.width-1),t-1;if(!g&&!m&&p)return b=c,(s=(v=h).children).unshift.apply(s,b.children),(a=v.items).unshift.apply(a,b.items),r.Rw.removeAt(e.children,t),r.Rw.removeAt(e.items,t+1),f(v,0),b.children.length=0,o(b),t;if(!g&&!m&&!p)return b=c,(u=(v=h).children).push.apply(u,b.children),(d=v.items).push.apply(d,b.items),r.Rw.removeAt(e.children,t),r.Rw.removeAt(e.items,t),f(v,0),b.children.length=0,o(b),t-1;throw"unreachable"}}(i||(i={}));var o,a=function(){function e(){this._first=null,this._last=null,this._size=0}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"first",{get:function(){return this._first?this._first.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){return this._last?this._last.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstNode",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastNode",{get:function(){return this._last},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return new e.ForwardValueIterator(this._first)},e.prototype.retro=function(){return new e.RetroValueIterator(this._last)},e.prototype.nodes=function(){return new e.ForwardNodeIterator(this._first)},e.prototype.retroNodes=function(){return new e.RetroNodeIterator(this._last)},e.prototype.assign=function(e){var t=this;this.clear(),(0,r.__)(e,(function(e){t.addLast(e)}))},e.prototype.push=function(e){this.addLast(e)},e.prototype.pop=function(){return this.removeLast()},e.prototype.shift=function(e){this.addFirst(e)},e.prototype.unshift=function(){return this.removeFirst()},e.prototype.addFirst=function(e){var t=new o.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._size++,t},e.prototype.addLast=function(e){var t=new o.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t,this._last=t):(this._first=t,this._last=t),this._size++,t},e.prototype.insertBefore=function(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof o.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");var n=new o.LinkedListNode(this,e),i=t,r=i.prev;return n.next=i,n.prev=r,i.prev=n,r.next=n,this._size++,n},e.prototype.insertAfter=function(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof o.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");var n=new o.LinkedListNode(this,e),i=t,r=i.next;return n.next=r,n.prev=i,i.next=n,r.prev=n,this._size++,n},e.prototype.removeFirst=function(){var e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value},e.prototype.removeLast=function(){var e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value},e.prototype.removeNode=function(e){if(!(e instanceof o.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");var t=e;t===this._first&&t===this._last?(this._first=null,this._last=null):t===this._first?(this._first=t.next,this._first.prev=null):t===this._last?(this._last=t.prev,this._last.next=null):(t.next.prev=t.prev,t.prev.next=t.next),t.list=null,t.next=null,t.prev=null,this._size--},e.prototype.clear=function(){for(var e=this._first;e;){var t=e.next;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._size=0},e}();!function(e){e.from=function(t){var n=new e;return n.assign(t),n};var t=function(){function e(e){this._node=e}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._node)},e.prototype.next=function(){if(this._node){var e=this._node;return this._node=e.next,e.value}},e}();e.ForwardValueIterator=t;var n=function(){function e(e){this._node=e}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._node)},e.prototype.next=function(){if(this._node){var e=this._node;return this._node=e.prev,e.value}},e}();e.RetroValueIterator=n;var i=function(){function e(e){this._node=e}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._node)},e.prototype.next=function(){if(this._node){var e=this._node;return this._node=e.next,e}},e}();e.ForwardNodeIterator=i;var r=function(){function e(e){this._node=e}return e.prototype.iter=function(){return this},e.prototype.clone=function(){return new e(this._node)},e.prototype.next=function(){if(this._node){var e=this._node;return this._node=e.prev,e}},e}();e.RetroNodeIterator=r}(a||(a={})),function(e){e.LinkedListNode=function(e,t){this.list=null,this.next=null,this.prev=null,this.list=e,this.value=t}}(o||(o={}));var l,u=function(e,t){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},u(e,t)};!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(t,e),Object.defineProperty(t.prototype,"isConflatable",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.conflate=function(e){return!0}}(function(){function e(e){this.type=e}return Object.defineProperty(e.prototype,"isConflatable",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype.conflate=function(e){return!1},e}()),function(e){function t(e,t){var n=i.get(e);if(n&&0!==n.length){var s=(0,r.Si)((0,r.$0)(n),(function(n){return!n||function(e,t,n){var i=!0;try{i="function"==typeof e?e(t,n):e.messageHook(t,n)}catch(e){o(e)}return i}(n,e,t)}));s&&h(e,t)}else h(e,t)}e.sendMessage=t,e.postMessage=function(e,t){t.isConflatable&&(0,r.zN)(n,(function(n){return n.handler===e&&!!n.msg&&n.msg.type===t.type&&!!n.msg.isConflatable&&n.msg.conflate(t)}))||function(e,t){n.addLast({handler:e,msg:t}),0===l&&(l=d(p))}(e,t)},e.installMessageHook=function(e,t){var n=i.get(e);n&&-1!==n.indexOf(t)||(n?n.push(t):i.set(e,[t]))},e.removeMessageHook=function(e,t){var n=i.get(e);if(n){var r=n.indexOf(t);-1!==r&&(n[r]=null,f(n))}},e.clearData=function(e){var t=i.get(e);t&&t.length>0&&(r.Rw.fill(t,null),f(t)),(0,r.__)(n,(function(t){t.handler===e&&(t.handler=null,t.msg=null)}))},e.flush=function(){u||0===l||(c(l),u=!0,p(),u=!1)},e.getExceptionHandler=function(){return o},e.setExceptionHandler=function(e){var t=o;return o=e,t};var n=new a,i=new WeakMap,s=new Set,o=function(e){console.error(e)},l=0,u=!1,d="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate,c="function"==typeof cancelAnimationFrame?cancelAnimationFrame:clearImmediate;function h(e,t){try{e.processMessage(t)}catch(e){o(e)}}function p(){if(l=0,!n.isEmpty){var e={handler:null,msg:null};for(n.addLast(e);;){var i=n.removeFirst();if(i===e)return;i.handler&&i.msg&&t(i.handler,i.msg)}}}function f(e){0===s.size&&d(g),s.add(e)}function g(){s.forEach(m),s.clear()}function m(e){r.Rw.removeAllWhere(e,v)}function v(e){return null===e}}(l||(l={}))},6049:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Debouncer:()=>l,Poll:()=>o,RateLimiter:()=>a,Throttler:()=>u});var i,r=n(5764),s=n(8571);class o{constructor(e){var t;this._disposed=new s.Signal(this),this._lingered=0,this._tick=new r.PromiseDelegate,this._ticked=new s.Signal(this),this._factory=e.factory,this._linger=null!==(t=e.linger)&&void 0!==t?t:i.DEFAULT_LINGER,this._standby=e.standby||i.DEFAULT_STANDBY,this._state={...i.DEFAULT_STATE,timestamp:(new Date).getTime()};const n=e.frequency||{},o=Math.max(n.interval||0,n.max||0,i.DEFAULT_FREQUENCY.max);this.frequency={...i.DEFAULT_FREQUENCY,...n,max:o},this.name=e.name||i.DEFAULT_NAME,"auto"in e&&!e.auto||setTimeout((()=>this.start()))}get disposed(){return this._disposed}get frequency(){return this._frequency}set frequency(e){if(this.isDisposed||r.JSONExt.deepEqual(e,this.frequency||{}))return;let{backoff:t,interval:n,max:i}=e;if(n=Math.round(n),i=Math.round(i),"number"==typeof t&&t<1)throw new Error("Poll backoff growth factor must be at least 1");if((n<0||n>i)&&n!==o.NEVER)throw new Error("Poll interval must be between 0 and max");if(i>o.MAX_INTERVAL&&i!==o.NEVER)throw new Error(`Max interval must be less than ${o.MAX_INTERVAL}`);this._frequency={backoff:t,interval:n,max:i}}get isDisposed(){return"disposed"===this.state.phase}get standby(){return this._standby}set standby(e){this.isDisposed||this.standby===e||(this._standby=e)}get state(){return this._state}get tick(){return this._tick.promise}get ticked(){return this._ticked}async*[Symbol.asyncIterator](){for(;!this.isDisposed;)yield this.state,await this.tick.catch((()=>{}))}dispose(){this.isDisposed||(this._state={...i.DISPOSED_STATE,timestamp:(new Date).getTime()},this._tick.promise.catch((e=>{})),this._tick.reject(new Error(`Poll (${this.name}) is disposed.`)),this._disposed.emit(void 0),s.Signal.clearData(this))}refresh(){return this.schedule({cancel:({phase:e})=>"refreshed"===e,interval:o.IMMEDIATE,phase:"refreshed"})}async schedule(e={}){if(this.isDisposed)return;if(e.cancel&&e.cancel(this.state))return;const t=this._tick,n=new r.PromiseDelegate,i={interval:this.frequency.interval,payload:null,phase:"standby",timestamp:(new Date).getTime(),...e};this._state=i,this._tick=n,clearTimeout(this._timeout),this._ticked.emit(this.state),t.resolve(this),await t.promise,i.interval!==o.NEVER?this._timeout=setTimeout((()=>{this.isDisposed||this.tick!==n.promise||this._execute()}),i.interval):this._timeout=void 0}start(){return this.schedule({cancel:({phase:e})=>"constructed"!==e&&"standby"!==e&&"stopped"!==e,interval:o.IMMEDIATE,phase:"started"})}stop(){return this.schedule({cancel:({phase:e})=>"stopped"===e,interval:o.NEVER,phase:"stopped"})}get hidden(){return i.hidden}_execute(){let e="function"==typeof this.standby?this.standby():this.standby;if("never"===e?e=!1:"when-hidden"===e&&(this.hidden?e=++this._lingered>this._linger:(this._lingered=0,e=!1)),e)return void this.schedule();const t=this.tick;this._factory(this.state).then((e=>{this.isDisposed||this.tick!==t||this.schedule({payload:e,phase:"rejected"===this.state.phase?"reconnected":"resolved"})})).catch((e=>{this.isDisposed||this.tick!==t||this.schedule({interval:i.sleep(this.frequency,this.state),payload:e,phase:"rejected"})}))}}!function(e){e.IMMEDIATE=0,e.MAX_INTERVAL=2147483647,e.NEVER=1/0}(o||(o={})),function(e){e.DEFAULT_BACKOFF=3,e.DEFAULT_FREQUENCY={backoff:!0,interval:1e3,max:3e4},e.DEFAULT_LINGER=1,e.DEFAULT_NAME="unknown",e.DEFAULT_STANDBY="when-hidden",e.DEFAULT_STATE={interval:o.NEVER,payload:null,phase:"constructed",timestamp:new Date(0).getTime()},e.DISPOSED_STATE={interval:o.NEVER,payload:null,phase:"disposed",timestamp:new Date(0).getTime()},e.sleep=function(t,n){const{backoff:i,interval:r,max:s}=t;if(r===o.NEVER)return r;const a=!0===i?e.DEFAULT_BACKOFF:!1===i?1:i,l=function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}(r,n.interval*a);return Math.min(s,l)},e.hidden="undefined"!=typeof document&&(document.addEventListener("visibilitychange",(()=>{e.hidden="hidden"===document.visibilityState})),document.addEventListener("pagehide",(()=>{e.hidden="hidden"===document.visibilityState})),"hidden"===document.visibilityState)}(i||(i={}));class a{constructor(e,t=500){this.args=void 0,this.payload=null,this.limit=t,this.poll=new o({auto:!1,factory:async()=>{const{args:t}=this;return this.args=void 0,e(...t)},frequency:{backoff:!1,interval:o.NEVER,max:o.NEVER},standby:"never"}),this.payload=new r.PromiseDelegate,this.poll.ticked.connect(((e,t)=>{const{payload:n}=this;return"resolved"===t.phase?(this.payload=new r.PromiseDelegate,void n.resolve(t.payload)):"rejected"===t.phase||"stopped"===t.phase?(this.payload=new r.PromiseDelegate,n.promise.catch((e=>{})),void n.reject(t.payload)):void 0}),this)}get isDisposed(){return null===this.payload}dispose(){this.isDisposed||(this.args=void 0,this.payload=null,this.poll.dispose())}async stop(){return this.poll.stop()}}class l extends a{invoke(...e){return this.args=e,this.poll.schedule({interval:this.limit,phase:"invoked"}),this.payload.promise}}class u extends a{constructor(e,t){super(e,"number"==typeof t?t:t&&t.limit),this._trailing=!1,"number"!=typeof t&&t&&"trailing"===t.edge&&(this._trailing=!0),this._interval=this._trailing?this.limit:o.IMMEDIATE}invoke(...e){const t="invoked"!==this.poll.state.phase;return(t||this._trailing)&&(this.args=e),t&&this.poll.schedule({interval:this._interval,phase:"invoked"}),this.payload.promise}}},6573:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AttachedProperty:()=>i});class i{constructor(e){this._pid=r.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}get(e){let t,n=r.ensureMap(e);return t=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e),t}set(e,t){let n,i=r.ensureMap(e);n=this._pid in i?i[this._pid]:i[this._pid]=this._createValue(e);let s=this._coerceValue(e,t);this._maybeNotify(e,n,i[this._pid]=s)}coerce(e){let t,n=r.ensureMap(e);t=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e);let i=this._coerceValue(e,t);this._maybeNotify(e,t,n[this._pid]=i)}_createValue(e){return(0,this._create)(e)}_coerceValue(e,t){let n=this._coerce;return n?n(e,t):t}_compareValue(e,t){let n=this._compare;return n?n(e,t):e===t}_maybeNotify(e,t,n){let i=this._changed;i&&!this._compareValue(t,n)&&i(e,t,n)}}var r;!function(e){e.clearData=function(e){r.ownerData.delete(e)}}(i||(i={})),function(e){e.ownerData=new WeakMap,e.nextPID=(()=>{let e=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${e++}`})(),e.ensureMap=function(t){let n=e.ownerData.get(t);return n||(n=Object.create(null),e.ownerData.set(t,n),n)}}(r||(r={}))},8571:(e,t,n)=>{"use strict";var i,r,s;n.r(t),n.d(t,{Signal:()=>l,Stream:()=>u}),function(e){function t(e,t,n=0,i=-1){let r,s=e.length;if(0===s)return-1;n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,r=o+i;n(e[r],t)<0?(o=r+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,r=-1){let s=e.length;if(0===s)return 0;let o=i=i<0?Math.max(0,i+s):Math.min(i,s-1),a=(r=r<0?Math.max(0,r+s):Math.min(r,s-1))-i+1;for(;a>0;){let i=a>>1,r=o+i;n(e[r],t)>0?a=i:(o=r+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,r=e.length;i=o&&(n=r<0?o-1:o),void 0===i?i=r<0?-1:o:i<0?i=Math.max(i+o,r<0?-1:0):i>=o&&(i=r<0?o-1:o),s=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;s(e,n,a-1),s(e,a,i),s(e,n,i)},e.fill=function(e,t,n=0,i=-1){let r,s=e.length;if(0!==s){n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,r=-1){let s=t(e,n,i,r);return-1!==s&&o(e,s),s},e.removeLastOf=function(e,t,i=-1,r=0){let s=n(e,t,i,r);return-1!==s&&o(e,s),s},e.removeAllOf=function(e,t,n=0,i=-1){let r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s},e.removeFirstWhere=function(e,t,n=0,r=-1){let s,a=i(e,t,n,r);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeLastWhere=function(e,t,n=-1,i=0){let s,a=r(e,t,n,i);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeAllWhere=function(e,t,n=0,i=-1){let r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s}}(i||(i={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(s||(s={}));var o,a=n(5764);class l{constructor(e){this.sender=e}connect(e,t){return o.connect(this,e,t)}disconnect(e,t){return o.disconnect(this,e,t)}emit(e){o.emit(this,e)}}!function(e){e.disconnectBetween=function(e,t){o.disconnectBetween(e,t)},e.disconnectSender=function(e){o.disconnectSender(e)},e.disconnectReceiver=function(e){o.disconnectReceiver(e)},e.disconnectAll=function(e){o.disconnectAll(e)},e.clearData=function(e){o.disconnectAll(e)},e.getExceptionHandler=function(){return o.exceptionHandler},e.setExceptionHandler=function(e){let t=o.exceptionHandler;return o.exceptionHandler=e,t}}(l||(l={}));class u extends l{constructor(){super(...arguments),this._pending=new a.PromiseDelegate}async*[Symbol.asyncIterator](){let e=this._pending;for(;;)try{const{args:t,next:n}=await e.promise;e=n,yield t}catch(e){return}}emit(e){const t=this._pending,n=this._pending=new a.PromiseDelegate;t.resolve({args:e,next:n}),super.emit(e)}stop(){this._pending.promise.catch((()=>{})),this._pending.reject("stop"),this._pending=new a.PromiseDelegate}}!function(e){function t(e){let t=r.get(e);if(t&&0!==t.length){for(const e of t){if(!e.signal)continue;let t=e.thisArg||e.slot;e.signal=null,d(s.get(t))}d(t)}}function n(e){let t=s.get(e);if(t&&0!==t.length){for(const e of t){if(!e.signal)continue;let t=e.signal.sender;e.signal=null,d(r.get(t))}d(t)}}e.exceptionHandler=e=>{console.error(e)},e.connect=function(e,t,n){n=n||void 0;let i=r.get(e.sender);if(i||(i=[],r.set(e.sender,i)),l(i,e,t,n))return!1;let o=n||t,a=s.get(o);a||(a=[],s.set(o,a));let u={signal:e,slot:t,thisArg:n};return i.push(u),a.push(u),!0},e.disconnect=function(e,t,n){n=n||void 0;let i=r.get(e.sender);if(!i||0===i.length)return!1;let o=l(i,e,t,n);if(!o)return!1;let a=n||t,u=s.get(a);return o.signal=null,d(i),d(u),!0},e.disconnectBetween=function(e,t){let n=r.get(e);if(!n||0===n.length)return;let i=s.get(t);if(i&&0!==i.length){for(const t of i)t.signal&&t.signal.sender===e&&(t.signal=null);d(n),d(i)}},e.disconnectSender=t,e.disconnectReceiver=n,e.disconnectAll=function(e){t(e),n(e)},e.emit=function(e,t){let n=r.get(e.sender);if(n&&0!==n.length)for(let i=0,r=n.length;i{"use strict";var i,r,s;function*o(){}function a(e,t){let n=0;for(const i of e)if(t(i,n++))return i}n.d(t,{$x:()=>_e,Zk:()=>ie,DG:()=>W,VQ:()=>ce,x0:()=>z}),function(e){function t(e,t,n=0,i=-1){let r,s=e.length;if(0===s)return-1;n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,r=o+i;n(e[r],t)<0?(o=r+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,r=-1){let s=e.length;if(0===s)return 0;let o=i=i<0?Math.max(0,i+s):Math.min(i,s-1),a=(r=r<0?Math.max(0,r+s):Math.min(r,s-1))-i+1;for(;a>0;){let i=a>>1,r=o+i;n(e[r],t)>0?a=i:(o=r+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,r=e.length;i=o&&(n=r<0?o-1:o),void 0===i?i=r<0?-1:o:i<0?i=Math.max(i+o,r<0?-1:0):i>=o&&(i=r<0?o-1:o),s=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;s(e,n,a-1),s(e,a,i),s(e,n,i)},e.fill=function(e,t,n=0,i=-1){let r,s=e.length;if(0!==s){n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,r=-1){let s=t(e,n,i,r);return-1!==s&&o(e,s),s},e.removeLastOf=function(e,t,i=-1,r=0){let s=n(e,t,i,r);return-1!==s&&o(e,s),s},e.removeAllOf=function(e,t,n=0,i=-1){let r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s},e.removeFirstWhere=function(e,t,n=0,r=-1){let s,a=i(e,t,n,r);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeLastWhere=function(e,t,n=-1,i=0){let s,a=r(e,t,n,i);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeAllWhere=function(e,t,n=0,i=-1){let r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s}}(i||(i={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(s||(s={}));var l,u,d,c,h,p,f,g=n(5764);!function(e){e.copyText=function(e){const t=document.body,n=i=>{i.preventDefault(),i.stopPropagation(),i.clipboardData.setData("text",e),t.removeEventListener("copy",n,!0)};t.addEventListener("copy",n,!0),document.execCommand("copy")}}(l||(l={})),function(e){e.boxSizing=function(e){let t=window.getComputedStyle(e),n=parseFloat(t.borderTopWidth)||0,i=parseFloat(t.borderLeftWidth)||0,r=parseFloat(t.borderRightWidth)||0,s=parseFloat(t.borderBottomWidth)||0,o=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingLeft)||0,l=parseFloat(t.paddingRight)||0,u=parseFloat(t.paddingBottom)||0;return{borderTop:n,borderLeft:i,borderRight:r,borderBottom:s,paddingTop:o,paddingLeft:a,paddingRight:l,paddingBottom:u,horizontalSum:i+a+l+r,verticalSum:n+o+u+s}},e.sizeLimits=function(e){let t=window.getComputedStyle(e),n=parseFloat(t.minWidth)||0,i=parseFloat(t.minHeight)||0,r=parseFloat(t.maxWidth)||1/0,s=parseFloat(t.maxHeight)||1/0;return r=Math.max(n,r),s=Math.max(i,s),{minWidth:n,minHeight:i,maxWidth:r,maxHeight:s}},e.hitTest=function(e,t,n){let i=e.getBoundingClientRect();return t>=i.left&&t=i.top&&n=n.bottom||(i.topn.bottom&&i.height>=n.height?e.scrollTop-=n.top-i.top:(i.topn.height||i.bottom>n.bottom&&i.height{let e=Element.prototype;return e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(e){let t=this,n=t.ownerDocument?t.ownerDocument.querySelectorAll(e):[];return-1!==Array.prototype.indexOf.call(n,t)}})(),e.calculateSingle=function(e){let u=0,d=0,c=0;function h(t){let n=e.match(t);return null!==n&&(e=e.slice(n[0].length),!0)}for(e=(e=e.split(",",1)[0]).replace(l," $1 ");e.length>0;)if(h(t))u++;else if(h(n))d++;else if(h(i))d++;else if(h(s))c++;else if(h(o))d++;else if(h(r))c++;else if(!h(a))return 0;return u=Math.min(u,255),d=Math.min(d,255),c=Math.min(c,255),u<<16|d<<8|c};const t=/^#[^\s\+>~#\.\[:]+/,n=/^\.[^\s\+>~#\.\[:]+/,i=/^\[[^\]]+\]/,r=/^[^\s\+>~#\.\[:]+/,s=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,o=/^:[^\s\+>~#\.\[:]+/,a=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g}(h||(h={}));class m{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return 0===this._size}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let e=this._first;for(;e;)yield e.value,e=e.next}*retro(){let e=this._last;for(;e;)yield e.value,e=e.prev}*nodes(){let e=this._first;for(;e;)yield e,e=e.next}*retroNodes(){let e=this._last;for(;e;)yield e,e=e.prev}assign(e){this.clear();for(const t of e)this.addLast(t)}push(e){this.addLast(e)}pop(){return this.removeLast()}shift(e){this.addFirst(e)}unshift(){return this.removeFirst()}addFirst(e){let t=new p.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._size++,t}addLast(e){let t=new p.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t,this._last=t):(this._first=t,this._last=t),this._size++,t}insertBefore(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof p.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let n=new p.LinkedListNode(this,e),i=t,r=i.prev;return n.next=i,n.prev=r,i.prev=n,r.next=n,this._size++,n}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof p.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let n=new p.LinkedListNode(this,e),i=t,r=i.next;return n.next=r,n.prev=i,i.next=n,r.prev=n,this._size++,n}removeFirst(){let e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeLast(){let e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeNode(e){if(!(e instanceof p.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");let t=e;t===this._first&&t===this._last?(this._first=null,this._last=null):t===this._first?(this._first=t.next,this._first.prev=null):t===this._last?(this._last=t.prev,this._last.next=null):(t.next.prev=t.prev,t.prev.next=t.next),t.list=null,t.next=null,t.prev=null,this._size--}clear(){let e=this._first;for(;e;){let t=e.next;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._size=0}}!function(e){e.from=function(t){let n=new e;return n.assign(t),n}}(m||(m={})),function(e){e.LinkedListNode=class{constructor(e,t){this.list=null,this.next=null,this.prev=null,this.list=e,this.value=t}}}(p||(p={}));class v{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}}class b extends v{get isConflatable(){return!0}conflate(e){return!0}}!function(e){let t=null;const n=(r=Promise.resolve(),e=>{let t=!1;return r.then((()=>!t&&e())),()=>{t=!0}});var r;function s(e,t){let n=a.get(e);if(!n||0===n.length)return void c(e,t);let i=function(e,t){let n=0;for(const i of e)if(!1===t(i,n++))return!1;return!0}(function*(e){if("function"==typeof e.retro)yield*e.retro();else for(let t=e.length-1;t>-1;t--)yield e[t]}(n),(n=>!n||function(e,t,n){let i=!0;try{i="function"==typeof e?e(t,n):e.messageHook(t,n)}catch(e){u(e)}return i}(n,e,t)));i&&c(e,t)}e.sendMessage=s,e.postMessage=function(e,t){t.isConflatable&&function(n){for(const r of n)if((i=r).handler===e&&i.msg&&i.msg.type===t.type&&i.msg.isConflatable&&i.msg.conflate(t))return!0;var i;return!1}(o)||h(e,t)},e.installMessageHook=function(e,t){let n=a.get(e);n&&-1!==n.indexOf(t)||(n?n.push(t):a.set(e,[t]))},e.removeMessageHook=function(e,t){let n=a.get(e);if(!n)return;let i=n.indexOf(t);-1!==i&&(n[i]=null,f(n))},e.clearData=function(e){let t=a.get(e);t&&t.length>0&&(i.fill(t,null),f(t));for(const t of o)t.handler===e&&(t.handler=null,t.msg=null)},e.flush=function(){d||null===t||(t(),t=null,d=!0,p(),d=!1)},e.getExceptionHandler=function(){return u},e.setExceptionHandler=function(e){let t=u;return u=e,t};const o=new m,a=new WeakMap,l=new Set;let u=e=>{console.error(e)},d=!1;function c(e,t){try{e.processMessage(t)}catch(e){u(e)}}function h(e,i){o.addLast({handler:e,msg:i}),null===t&&(t=n(p))}function p(){if(t=null,o.isEmpty)return;let e={handler:null,msg:null};for(o.addLast(e);;){let t=o.removeFirst();if(t===e)return;t.handler&&t.msg&&s(t.handler,t.msg)}}function f(e){0===l.size&&n(g),l.add(e)}function g(){l.forEach(v),l.clear()}function v(e){i.removeAllWhere(e,b)}function b(e){return null===e}}(f||(f={}));var A,y,w,_,E,C=n(6573),x=n(8571),D=n(1412);!function(e){function t(e,t,n=0,i=-1){let r,s=e.length;if(0===s)return-1;n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,r=o+i;n(e[r],t)<0?(o=r+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,r=-1){let s=e.length;if(0===s)return 0;let o=i=i<0?Math.max(0,i+s):Math.min(i,s-1),a=(r=r<0?Math.max(0,r+s):Math.min(r,s-1))-i+1;for(;a>0;){let i=a>>1,r=o+i;n(e[r],t)>0?a=i:(o=r+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,r=e.length;i=o&&(n=r<0?o-1:o),void 0===i?i=r<0?-1:o:i<0?i=Math.max(i+o,r<0?-1:0):i>=o&&(i=r<0?o-1:o),s=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;s(e,n,a-1),s(e,a,i),s(e,n,i)},e.fill=function(e,t,n=0,i=-1){let r,s=e.length;if(0!==s){n=n<0?Math.max(0,n+s):Math.min(n,s-1),r=(i=i<0?Math.max(0,i+s):Math.min(i,s-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,r=-1){let s=t(e,n,i,r);return-1!==s&&o(e,s),s},e.removeLastOf=function(e,t,i=-1,r=0){let s=n(e,t,i,r);return-1!==s&&o(e,s),s},e.removeAllOf=function(e,t,n=0,i=-1){let r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s},e.removeFirstWhere=function(e,t,n=0,r=-1){let s,a=i(e,t,n,r);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeLastWhere=function(e,t,n=-1,i=0){let s,a=r(e,t,n,i);return-1!==a&&(s=o(e,a)),{index:a,value:s}},e.removeAllWhere=function(e,t,n=0,i=-1){let r=e.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);let s=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?s++:s>0&&(e[o-s]=e[o]);return s>0&&(e.length=r-s),s}}(A||(A={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(w||(w={}));class S{constructor(e){this.type="text",this.content=e}}class T{constructor(e,t,n,i){this.type="element",this.tag=e,this.attrs=t,this.children=n,this.renderer=i}}function B(e){let t,n={},i=[];for(let e=1,s=arguments.length;e=i;--s){const i=t[s],o=r?e.lastChild:e.childNodes[s];"text"===i.type||(i.renderer&&i.renderer.unrender?i.renderer.unrender(o,{attrs:i.attrs,children:i.children}):n(o,i.children,0,!1)),r&&e.removeChild(o)}}e.hostMap=new WeakMap,e.asContentArray=function(e){return e?e instanceof Array?e:[e]:[]},e.createDOMNode=t,e.updateContent=function e(i,s,o){if(s===o)return;let a=function(e,t){let n=e.firstChild,i=Object.create(null);for(let e of t)"element"===e.type&&e.attrs.key&&(i[e.attrs.key]={vNode:e,element:n}),n=n.nextSibling;return i}(i,s),l=s.slice(),u=i.firstChild,d=o.length;for(let n=0;n=l.length){t(o[n],i);continue}let s=l[n],d=o[n];if(s===d){u=u.nextSibling;continue}if("text"===s.type&&"text"===d.type){u.textContent!==d.content&&(u.textContent=d.content),u=u.nextSibling;continue}if("text"===s.type||"text"===d.type){A.insert(l,n,d),t(d,i,u);continue}if(!s.renderer!=!d.renderer){A.insert(l,n,d),t(d,i,u);continue}let c=d.attrs.key;if(c&&c in a){let e=a[c];e.vNode!==s&&(A.move(l,l.indexOf(e.vNode,n+1),n),i.insertBefore(e.element,u),s=e.vNode,u=e.element)}if(s===d){u=u.nextSibling;continue}let h=s.attrs.key;h&&h!==c?(A.insert(l,n,d),t(d,i,u)):s.tag===d.tag?(r(u,s.attrs,d.attrs),d.renderer?d.renderer.render(u,{attrs:d.attrs,children:d.children}):e(u,s.children,d.children),u=u.nextSibling):(A.insert(l,n,d),t(d,i,u))}n(i,l,d,!0)};const i={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function r(e,t,n){if(t===n)return;let r;for(r in t)r in i||r in n||("on"===r.substr(0,2)?e[r]=null:e.removeAttribute(r));for(r in n)r in i||t[r]===n[r]||("on"===r.substr(0,2)?e[r]=n[r]:e.setAttribute(r,n[r]));t.className!==n.className&&(void 0!==n.className?e.setAttribute("class",n.className):e.removeAttribute("class")),t.htmlFor!==n.htmlFor&&(void 0!==n.htmlFor?e.setAttribute("for",n.htmlFor):e.removeAttribute("for")),t.dataset!==n.dataset&&function(e,t,n){for(let i in t)i in n||e.removeAttribute(`data-${i}`);for(let i in n)t[i]!==n[i]&&e.setAttribute(`data-${i}`,n[i])}(e,t.dataset||{},n.dataset||{}),t.style!==n.style&&function(e,t,n){let i,r=e.style;for(i in t)i in n||(r[i]="");for(i in n)t[i]!==n[i]&&(r[i]=n[i])}(e,t.style||{},n.style||{})}}(E||(E={})),n(7556);class M{constructor(e,t,n=[]){this.name=e,this._codes=t,this._keys=M.extractKeys(t),this._modifierKeys=M.convertToKeySet(n)}keys(){return Object.keys(this._keys)}isValidKey(e){return e in this._keys}isModifierKey(e){return e in this._modifierKeys}keyForKeydownEvent(e){return this._codes[e.keyCode]||""}}!function(e){e.extractKeys=function(e){let t=Object.create(null);for(let n in e)t[e[n]]=!0;return t},e.convertToKeySet=function(e){let t=Object(null);for(let n=0,i=e.length;n0&&(o+=n.stretch,a++)}if(t===s)return 0;if(t<=i){for(let t=0;t=r){for(let t=0;t0&&i>l;){let t=i,r=o;for(let s=0;s0&&i>l;){let t=i/u;for(let r=0;r0&&i>l;){let t=i,r=o;for(let s=0;s=n.maxSize?(i-=n.maxSize-n.size,o-=n.stretch,n.size=n.maxSize,n.done=!0,u--,a--):(i-=l,n.size+=l)}}for(;u>0&&i>l;){let t=i/u;for(let r=0;r=n.maxSize?(i-=n.maxSize-n.size,n.size=n.maxSize,n.done=!0,u--):(i-=t,n.size+=t))}}}return 0},e.adjust=function(e,t,n){0!==e.length&&0!==n&&(n>0?function(e,t,n){let i=0;for(let n=0;n<=t;++n){let t=e[n];i+=t.maxSize-t.size}let r=0;for(let n=t+1,i=e.length;n=0&&s>0;--n){let t=e[n],i=t.maxSize-t.size;i>=s?(t.sizeHint=t.size+s,s=0):(t.sizeHint=t.size+i,s-=i)}let o=n;for(let n=t+1,i=e.length;n0;++n){let t=e[n],i=t.size-t.minSize;i>=o?(t.sizeHint=t.size-o,o=0):(t.sizeHint=t.size-i,o-=i)}}(e,t,n):function(e,t,n){let i=0;for(let n=t+1,r=e.length;n0;++n){let t=e[n],i=t.maxSize-t.size;i>=s?(t.sizeHint=t.size+s,s=0):(t.sizeHint=t.size+i,s-=i)}let o=n;for(let n=t;n>=0&&o>0;--n){let t=e[n],i=t.size-t.minSize;i>=o?(t.sizeHint=t.size-o,o=0):(t.sizeHint=t.size-i,o-=i)}}(e,t,-n))}}(I||(I={}));class F{constructor(e){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new x.Signal(this),this._isDisposed=!1,this.owner=e.owner,void 0!==e.label&&(this._label=e.label),void 0!==e.mnemonic&&(this._mnemonic=e.mnemonic),void 0!==e.icon&&(this._icon=e.icon),void 0!==e.iconClass&&(this._iconClass=e.iconClass),void 0!==e.iconLabel&&(this._iconLabel=e.iconLabel),void 0!==e.caption&&(this._caption=e.caption),void 0!==e.className&&(this._className=e.className),void 0!==e.closable&&(this._closable=e.closable),this._dataset=e.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))}get icon(){return this._icon}set icon(e){this._icon!==e&&(this._icon=e,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))}get caption(){return this._caption}set caption(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))}get className(){return this._className}set className(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))}get closable(){return this._closable}set closable(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,x.Signal.clearData(this))}}class z{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new x.Signal(this),this._hiddenMode=z.HiddenMode.Display,this.node=P.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(z.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&z.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),x.Signal.clearData(this),f.clearData(this),C.AttachedProperty.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(z.Flag.IsDisposed)}get isAttached(){return this.testFlag(z.Flag.IsAttached)}get isHidden(){return this.testFlag(z.Flag.IsHidden)}get isVisible(){return this.testFlag(z.Flag.IsVisible)}get title(){return P.titleProperty.get(this)}get id(){return this.node.id}set id(e){this.node.id=e}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){this._hiddenMode!==e&&(this.isHidden&&this._toggleHidden(!1),e==z.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let e=new z.ChildMessage("child-removed",this);f.sendMessage(this._parent,e)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let e=new z.ChildMessage("child-added",this);f.sendMessage(this._parent,e)}this.isDisposed||f.sendMessage(this,z.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(z.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(e){for(let t=e;t;t=t._parent)if(t===this)return!0;return!1}hasClass(e){return this.node.classList.contains(e)}addClass(e){this.node.classList.add(e)}removeClass(e){this.node.classList.remove(e)}toggleClass(e,t){return!0===t?(this.node.classList.add(e),!0):!1===t?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)}update(){f.postMessage(this,z.Msg.UpdateRequest)}fit(){f.postMessage(this,z.Msg.FitRequest)}activate(){f.postMessage(this,z.Msg.ActivateRequest)}close(){f.sendMessage(this,z.Msg.CloseRequest)}show(){if(this.testFlag(z.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||f.sendMessage(this,z.Msg.BeforeShow),this.clearFlag(z.Flag.IsHidden),this._toggleHidden(!1),!this.isAttached||this.parent&&!this.parent.isVisible||f.sendMessage(this,z.Msg.AfterShow),this.parent)){let e=new z.ChildMessage("child-shown",this);f.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(z.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||f.sendMessage(this,z.Msg.BeforeHide),this.setFlag(z.Flag.IsHidden),this._toggleHidden(!0),!this.isAttached||this.parent&&!this.parent.isVisible||f.sendMessage(this,z.Msg.AfterHide),this.parent)){let e=new z.ChildMessage("child-hidden",this);f.sendMessage(this.parent,e)}}setHidden(e){e?this.hide():this.show()}testFlag(e){return!!(this._flags&e)}setFlag(e){this._flags|=e}clearFlag(e){this._flags&=~e}processMessage(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(z.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(z.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":this.isHidden||this.parent&&!this.parent.isVisible||this.setFlag(z.Flag.IsVisible),this.setFlag(z.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(z.Flag.IsVisible),this.clearFlag(z.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e)}}notifyLayout(e){this._layout&&this._layout.processParentMessage(e)}onCloseRequest(e){this.parent?this.parent=null:this.isAttached&&z.detach(this)}onResize(e){}onUpdateRequest(e){}onFitRequest(e){}onActivateRequest(e){}onBeforeShow(e){}onAfterShow(e){}onBeforeHide(e){}onAfterHide(e){}onBeforeAttach(e){}onAfterAttach(e){}onBeforeDetach(e){}onAfterDetach(e){}onChildAdded(e){}onChildRemoved(e){}_toggleHidden(e){if(e)switch(this._hiddenMode){case z.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case z.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case z.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1"}else switch(this._hiddenMode){case z.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case z.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case z.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex=""}}}!function(e){var t,n,i;(t=e.HiddenMode||(e.HiddenMode={}))[t.Display=0]="Display",t[t.Scale=1]="Scale",t[t.ContentVisibility=2]="ContentVisibility",(n=e.Flag||(e.Flag={}))[n.IsDisposed=1]="IsDisposed",n[n.IsAttached=2]="IsAttached",n[n.IsHidden=4]="IsHidden",n[n.IsVisible=8]="IsVisible",n[n.DisallowLayout=16]="DisallowLayout",(i=e.Msg||(e.Msg={})).BeforeShow=new v("before-show"),i.AfterShow=new v("after-show"),i.BeforeHide=new v("before-hide"),i.AfterHide=new v("after-hide"),i.BeforeAttach=new v("before-attach"),i.AfterAttach=new v("after-attach"),i.BeforeDetach=new v("before-detach"),i.AfterDetach=new v("after-detach"),i.ParentChanged=new v("parent-changed"),i.UpdateRequest=new b("update-request"),i.FitRequest=new b("fit-request"),i.ActivateRequest=new b("activate-request"),i.CloseRequest=new b("close-request"),e.ChildMessage=class extends v{constructor(e,t){super(e),this.child=t}};class r extends v{constructor(e,t){super("resize"),this.width=e,this.height=t}}e.ResizeMessage=r,function(e){e.UnknownSize=new e(-1,-1)}(r=e.ResizeMessage||(e.ResizeMessage={})),e.attach=function(t,n,i=null){if(t.parent)throw new Error("Cannot attach a child widget.");if(t.isAttached||t.node.isConnected)throw new Error("Widget is already attached.");if(!n.isConnected)throw new Error("Host is not attached.");f.sendMessage(t,e.Msg.BeforeAttach),n.insertBefore(t.node,i),f.sendMessage(t,e.Msg.AfterAttach)},e.detach=function(t){if(t.parent)throw new Error("Cannot detach a child widget.");if(!t.isAttached||!t.node.isConnected)throw new Error("Widget is not attached.");f.sendMessage(t,e.Msg.BeforeDetach),t.node.parentNode.removeChild(t.node),f.sendMessage(t,e.Msg.AfterDetach)}}(z||(z={})),function(e){e.titleProperty=new C.AttachedProperty({name:"title",create:e=>new F({owner:e})}),e.createNode=function(e){return e.node||document.createElement(e.tag||"div")}}(P||(P={}));class U{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,x.Signal.clearData(this),C.AttachedProperty.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){let e=this._parent.node.style;e.minWidth="",e.minHeight="",e.maxWidth="",e.maxHeight="",this._parent.fit()}}processParentMessage(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e)}}init(){for(const e of this)e.parent=this.parent}onResize(e){for(const e of this)f.sendMessage(e,z.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(const e of this)f.sendMessage(e,z.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(const t of this)f.sendMessage(t,e)}onAfterAttach(e){for(const t of this)f.sendMessage(t,e)}onBeforeDetach(e){for(const t of this)f.sendMessage(t,e)}onAfterDetach(e){for(const t of this)f.sendMessage(t,e)}onBeforeShow(e){for(const t of this)t.isHidden||f.sendMessage(t,e)}onAfterShow(e){for(const t of this)t.isHidden||f.sendMessage(t,e)}onBeforeHide(e){for(const t of this)t.isHidden||f.sendMessage(t,e)}onAfterHide(e){for(const t of this)t.isHidden||f.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}}!function(e){e.getHorizontalAlignment=function(e){return R.horizontalAlignmentProperty.get(e)},e.setHorizontalAlignment=function(e,t){R.horizontalAlignmentProperty.set(e,t)},e.getVerticalAlignment=function(e){return R.verticalAlignmentProperty.get(e)},e.setVerticalAlignment=function(e,t){R.verticalAlignmentProperty.set(e,t)}}(U||(U={}));class H{constructor(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height="",e.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let e=u.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,n,i){let r=Math.max(this._minWidth,Math.min(n,this._maxWidth)),s=Math.max(this._minHeight,Math.min(i,this._maxHeight));if(r"center",changed:t}),e.verticalAlignmentProperty=new C.AttachedProperty({name:"verticalAlignment",create:()=>"top",changed:t})}(R||(R={}));class W extends U{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(e){this.insertWidget(this._widgets.length,e)}insertWidget(e,t){t.parent=this.parent;let n=this._widgets.indexOf(t),r=Math.max(0,Math.min(e,this._widgets.length));if(-1===n)return i.insert(this._widgets,r,t),void(this.parent&&this.attachWidget(r,t));r===this._widgets.length&&r--,n!==r&&(i.move(this._widgets,n,r),this.parent&&this.moveWidget(n,r,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=i.removeAt(this._widgets,e);t&&this.parent&&this.detachWidget(e,t)}init(){super.init();let e=0;for(const t of this)this.attachWidget(e++,t)}attachWidget(e,t){let n=this.parent.node.children[e];this.parent.isAttached&&f.sendMessage(t,z.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,n),this.parent.isAttached&&f.sendMessage(t,z.Msg.AfterAttach)}moveWidget(e,t,n){this.parent.isAttached&&f.sendMessage(n,z.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&f.sendMessage(n,z.Msg.AfterDetach);let i=this.parent.node.children[t];this.parent.isAttached&&f.sendMessage(n,z.Msg.BeforeAttach),this.parent.node.insertBefore(n.node,i),this.parent.isAttached&&f.sendMessage(n,z.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&f.sendMessage(t,z.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&f.sendMessage(t,z.Msg.AfterDetach)}}!function(e){e.clampDimension=function(e){return Math.max(0,Math.floor(e))}}(L||(L={}));var q,$,V,G,K,Y,J,X,Z,Q,ee=L;class te extends W{constructor(e){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=e.renderer,void 0!==e.orientation&&(this._orientation=e.orientation),void 0!==e.alignment&&(this._alignment=e.alignment),void 0!==e.spacing&&(this._spacing=L.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.parent&&(this.parent.dataset.orientation=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=L.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map((e=>e.size))}relativeSizes(){return q.normalize(this._sizers.map((e=>e.size)))}setRelativeSizes(e,t=!0){let n=this._sizers.length,i=e.slice(0,n);for(;i.length0&&(e.sizeHint=e.size);I.adjust(this._sizers,e,n),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){let n=new H(t),r=q.createHandle(this.renderer),s=q.averageSize(this._sizers),o=q.createSizer(s);i.insert(this._items,e,n),i.insert(this._sizers,e,o),i.insert(this._handles,e,r),this.parent.isAttached&&f.sendMessage(t,z.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(r),this.parent.isAttached&&f.sendMessage(t,z.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){i.move(this._items,e,t),i.move(this._sizers,e,t),i.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let n=i.removeAt(this._items,e),r=i.removeAt(this._handles,e);i.removeAt(this._sizers,e),this.parent.isAttached&&f.sendMessage(t,z.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(r),this.parent.isAttached&&f.sendMessage(t,z.Msg.AfterDetach),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}updateItemPosition(e,t,n,i,r,s,o){const a=this._items[e];if(a.isHidden)return;let l=this._handles[e].style;t?(n+=this.widgetOffset,a.update(n,i,o,r),n+=o,l.top=`${i}px`,l.left=`${n}px`,l.width=`${this._spacing}px`,l.height=`${r}px`):(i+=this.widgetOffset,a.update(n,i,s,o),i+=o,l.top=`${i}px`,l.left=`${n}px`,l.width=`${s}px`,l.height=`${this._spacing}px`)}_fit(){let e=0,t=-1;for(let n=0,i=this._items.length;n0&&(s.sizeHint=s.size),t.isHidden?(s.minSize=0,s.maxSize=0):(t.fit(),s.stretch=te.getStretch(t.widget),n?(s.minSize=t.minWidth,s.maxSize=t.maxWidth,i+=t.minWidth,r=Math.max(r,t.minHeight)):(s.minSize=t.minHeight,s.maxSize=t.maxHeight,r+=t.minHeight,i=Math.max(i,t.minWidth)))}let s=this._box=u.boxSizing(this.parent.node);i+=s.horizontalSum,r+=s.verticalSum;let o=this.parent.node.style;o.minWidth=`${i}px`,o.minHeight=`${r}px`,this._dirty=!0,this.parent.parent&&f.sendMessage(this.parent.parent,z.Msg.FitRequest),this._dirty&&f.sendMessage(this.parent,z.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let n=0;for(let e=0,t=this._items.length;e0){let e;if(e=d?Math.max(0,s-this._fixed):Math.max(0,o-this._fixed),this._hasNormedSizes){for(let t of this._sizers)t.sizeHint*=e;this._hasNormedSizes=!1}let t=I.calc(this._sizers,e);if(t>0)switch(this._alignment){case"start":break;case"center":a=0,l=t/2;break;case"end":a=0,l=t;break;case"justify":a=t/n,l=0;break;default:throw"unreachable"}}for(let e=0,t=this._items.length;e0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:function(e){e.parent&&e.parent.layout instanceof te&&e.parent.fit()}}),e.createSizer=function(e){let t=new N;return t.sizeHint=Math.floor(e),t},e.createHandle=function(e){let t=e.createHandle();return t.style.position="absolute",t.style.contain="style",t},e.averageSize=function(e){return e.reduce(((e,t)=>e+t.size),0)/e.length||0},e.normalize=function(e){let t=e.length;if(0===t)return[];let n=e.reduce(((e,t)=>e+Math.abs(t)),0);return 0===n?e.map((e=>1/t)):e.map((e=>e/n))}}(q||(q={}));class ne extends te{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=ee.clampDimension(e),this.widgetOffset!==e&&(this.widgetOffset=e,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(e,t){const n=this._titles[e],i=n.classList.contains("lm-mod-expanded"),r=$.createTitle(this.renderer,t.title,i);this._titles[e]=r,this.parent.node.replaceChild(r,n)}insertWidget(e,t){t.id||(t.id=`id-${g.UUID.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){const n=$.createTitle(this.renderer,t.title);i.insert(this._titles,e,n),this.parent.node.appendChild(n),t.node.setAttribute("role","region"),t.node.setAttribute("aria-labelledby",n.id),super.attachWidget(e,t)}moveWidget(e,t,n){i.move(this._titles,e,t),super.moveWidget(e,t,n)}detachWidget(e,t){const n=i.removeAt(this._titles,e);this.parent.node.removeChild(n),super.detachWidget(e,t)}updateItemPosition(e,t,n,i,r,s,o){const a=this._titles[e].style;a.top=`${i}px`,a.left=`${n}px`,a.height=`${this.widgetOffset}px`,a.width=t?`${r}px`:`${s}px`,super.updateItemPosition(e,t,n,i,r,s,o)}}!function(e){e.createTitle=function(e,t,n=!0){const i=e.createSectionTitle(t);return i.style.position="absolute",i.style.contain="strict",i.setAttribute("aria-label",`${t.label} Section`),i.setAttribute("aria-expanded",n?"true":"false"),i.setAttribute("aria-controls",t.owner.id),n&&i.classList.add("lm-mod-expanded"),i}}($||($={}));class ie extends z{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=V.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}}!function(e){e.createLayout=function(e){return e.layout||new W}}(V||(V={}));class re extends ie{constructor(e={}){super({layout:G.createLayout(e)}),this._handleMoved=new x.Signal(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(e){this.layout.orientation=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(e,t=!0){this.layout.setRelativeSizes(e,t)}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){e.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(e){e.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),27===e.keyCode&&this._releaseMouse()}_evtPointerDown(e){if(0!==e.button)return;let t,n=this.layout,r=i.findFirstIndex(n.handles,(t=>t.contains(e.target)));if(-1===r)return;e.preventDefault(),e.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let s=n.handles[r],o=s.getBoundingClientRect();t="horizontal"===n.orientation?e.clientX-o.left:e.clientY-o.top;let a=window.getComputedStyle(s),l=D.Drag.overrideCursor(a.cursor);this._pressData={index:r,delta:t,override:l}}_evtPointerMove(e){let t;e.preventDefault(),e.stopPropagation();let n=this.layout,i=this.node.getBoundingClientRect();t="horizontal"===n.orientation?e.clientX-i.left-this._pressData.delta:e.clientY-i.top-this._pressData.delta,n.moveHandle(this._pressData.index,t)}_evtPointerUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}}!function(e){class t{createHandle(){let e=document.createElement("div");return e.className="lm-SplitPanel-handle",e}}e.Renderer=t,e.defaultRenderer=new t,e.getStretch=function(e){return te.getStretch(e)},e.setStretch=function(e,t){te.setStretch(e,t)}}(re||(re={})),function(e){e.createLayout=function(e){return e.layout||new te({renderer:e.renderer||re.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing})}}(G||(G={}));class se extends re{constructor(e={}){super({...e,layout:K.createLayout(e)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new x.Signal(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(e){this.layout.titleSpace=e}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(e){super.addWidget(e),e.title.changed.connect(this._onTitleChanged,this)}collapse(e){const t=this.layout.widgets[e];t&&!t.isHidden&&this._toggleExpansion(e)}expand(e){const t=this.layout.widgets[e];t&&t.isHidden&&this._toggleExpansion(e)}insertWidget(e,t){super.insertWidget(e,t),t.title.changed.connect(this._onTitleChanged,this)}handleEvent(e){switch(super.handleEvent(e),e.type){case"click":this._evtClick(e);break;case"keydown":this._eventKeyDown(e)}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(e)}onAfterDetach(e){super.onAfterDetach(e),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(e){const t=i.findFirstIndex(this.widgets,(t=>t.contains(e.owner)));t>=0&&(this.layout.updateTitle(t,e.owner),this.update())}_computeWidgetSize(e){const t=this.layout,n=t.widgets[e];if(!n)return;const i=n.isHidden,r=t.absoluteSizes(),s=(i?-1:1)*this.spacing,o=r.reduce(((e,t)=>e+t));let a=[...r];if(i){const t=this._widgetSizesCache.get(n);if(!t)return;a[e]+=t;const i=a.map((e=>e-t>0)).lastIndexOf(!0);-1===i?a.forEach(((n,i)=>{i!==e&&(a[i]-=r[i]/o*(t-s))})):a[i]-=t-s}else{const t=r[e];this._widgetSizesCache.set(n,t),a[e]=0;const i=a.map((e=>e>0)).lastIndexOf(!0);if(-1===i)return;a[i]=r[i]+t+s}return a.map((e=>e/(o+s)))}_evtClick(e){const t=e.target;if(t){const n=i.findFirstIndex(this.titles,(e=>e.contains(t)));n>=0&&(e.preventDefault(),e.stopPropagation(),this._toggleExpansion(n))}}_eventKeyDown(e){if(e.defaultPrevented)return;const t=e.target;let n=!1;if(t){const r=i.findFirstIndex(this.titles,(e=>e.contains(t)));if(r>=0){const i=e.keyCode.toString();if(e.key.match(/Space|Enter/)||i.match(/13|32/))t.click(),n=!0;else if("horizontal"===this.orientation?e.key.match(/ArrowLeft|ArrowRight/)||i.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||i.match(/38|40/)){const t=e.key.match(/ArrowLeft|ArrowUp/)||i.match(/37|38/)?-1:1,s=this.titles.length,o=(r+s+t)%s;this.titles[o].focus(),n=!0}else"End"===e.key||"35"===i?(this.titles[this.titles.length-1].focus(),n=!0):"Home"!==e.key&&"36"!==i||(this.titles[0].focus(),n=!0)}n&&e.preventDefault()}}_toggleExpansion(e){const t=this.titles[e],n=this.layout.widgets[e],i=this._computeWidgetSize(e);i&&this.setRelativeSizes(i,!1),n.isHidden?(t.classList.add("lm-mod-expanded"),t.setAttribute("aria-expanded","true"),n.show()):(t.classList.remove("lm-mod-expanded"),t.setAttribute("aria-expanded","false"),n.hide()),this._expansionToggled.emit(e)}}!function(e){class t extends re.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++t._nInstance}createCollapseIcon(e){return document.createElement("span")}createSectionTitle(e){const t=document.createElement("h3");t.setAttribute("tabindex","0"),t.id=this.createTitleKey(e),t.className=this.titleClassName;for(const n in e.dataset)t.dataset[n]=e.dataset[n];t.appendChild(this.createCollapseIcon(e)).className="lm-AccordionPanel-titleCollapser";const n=t.appendChild(document.createElement("span"));return n.className="lm-AccordionPanel-titleLabel",n.textContent=e.label,n.title=e.caption||e.label,t}createTitleKey(e){let t=this._titleKeys.get(e);return void 0===t&&(t=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(e,t)),t}}t._nInstance=0,e.Renderer=t,e.defaultRenderer=new t}(se||(se={})),function(e){e.createLayout=function(e){return e.layout||new ne({renderer:e.renderer||se.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing,titleSpace:e.titleSpace})}}(K||(K={}));class oe extends W{constructor(e={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",void 0!==e.direction&&(this._direction=e.direction),void 0!==e.alignment&&(this._alignment=e.alignment),void 0!==e.spacing&&(this._spacing=ee.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(e){this._direction!==e&&(this._direction=e,this.parent&&(this.parent.dataset.direction=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=ee.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){i.insert(this._items,e,new H(t)),i.insert(this._sizers,e,new N),this.parent.isAttached&&f.sendMessage(t,z.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&f.sendMessage(t,z.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){i.move(this._items,e,t),i.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let n=i.removeAt(this._items,e);i.removeAt(this._sizers,e),this.parent.isAttached&&f.sendMessage(t,z.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&f.sendMessage(t,z.Msg.AfterDetach),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0;for(let t=0,n=this._items.length;t0)switch(this._alignment){case"start":break;case"center":l=0,d=i/2;break;case"end":l=0,d=i;break;case"justify":l=i/n,d=0;break;default:throw"unreachable"}for(let e=0,t=this._items.length;e0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:t}),e.sizeBasisProperty=new C.AttachedProperty({name:"sizeBasis",create:()=>0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:t}),e.isHorizontal=function(e){return"left-to-right"===e||"right-to-left"===e},e.clampSpacing=function(e){return Math.max(0,Math.floor(e))}}(Y||(Y={}));class ae extends ie{constructor(e={}){super({layout:J.createLayout(e)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(e){this.layout.direction=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}onChildAdded(e){e.child.addClass("lm-BoxPanel-child")}onChildRemoved(e){e.child.removeClass("lm-BoxPanel-child")}}!function(e){e.getStretch=function(e){return oe.getStretch(e)},e.setStretch=function(e,t){oe.setStretch(e,t)},e.getSizeBasis=function(e){return oe.getSizeBasis(e)},e.setSizeBasis=function(e,t){oe.setSizeBasis(e,t)}}(ae||(ae={})),function(e){e.createLayout=function(e){return e.layout||new oe(e)}}(J||(J={}));class le extends z{constructor(e){super({node:X.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(z.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||le.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(e){let t=X.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){const t=e.map((e=>X.createItem(this.commands,e)));return t.forEach((e=>this._items.push(e))),this.refresh(),t}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){i.removeAt(this._items,e)&&this.refresh()}clearItems(){0!==this._items.length&&(this._items.length=0,this.refresh())}refresh(){this._results=null,""!==this.inputNode.value?this.node.getElementsByClassName("lm-close-icon")[0].style.display="inherit":this.node.getElementsByClassName("lm-close-icon")[0].style.display="none",this.update()}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"keydown":this._evtKeyDown(e);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(e){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(e){this.update(),super.onAfterShow(e)}onActivateRequest(e){if(this.isAttached){let e=this.inputNode;e.focus(),e.select()}}onUpdateRequest(e){if(this.isHidden)return;let t=this.inputNode.value,n=this.contentNode,r=this._results;if(r||(r=this._results=X.search(this._items,t),this._activeIndex=t?i.findFirstIndex(r,X.canActivate):-1),!t&&0===r.length)return void _.render(null,n);if(t&&0===r.length){let e=this.renderer.renderEmptyMessage({query:t});return void _.render(e,n)}let s=this.renderer,o=this._activeIndex,a=new Array(r.length);for(let e=0,t=r.length;e=r.length)n.scrollTop=0;else{let e=n.children[o];u.scrollIntoViewIfNeeded(n,e)}}_evtClick(e){if(0!==e.button)return;if(e.target.classList.contains("lm-close-icon"))return this.inputNode.value="",void this.refresh();let t=i.findFirstIndex(this.contentNode.children,(t=>t.contains(e.target)));-1!==t&&(e.preventDefault(),e.stopPropagation(),this._execute(t))}_evtKeyDown(e){if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))switch(e.keyCode){case 13:e.preventDefault(),e.stopPropagation(),this._execute(this._activeIndex);break;case 38:e.preventDefault(),e.stopPropagation(),this._activatePreviousItem();break;case 40:e.preventDefault(),e.stopPropagation(),this._activateNextItem()}}_activateNextItem(){if(!this._results||0===this._results.length)return;let e=this._activeIndex,t=this._results.length,n=ee-t)),c=a.slice(0,d),h=a.slice(d);for(let e=0,t=h.length;en.command===e&&g.JSONExt.deepEqual(n.args,t)))||null}}}(X||(X={}));class ue extends z{constructor(e){super({node:Z.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new x.Signal(this),this._menuRequested=new x.Signal(this),this.addClass("lm-Menu"),this.setFlag(z.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||ue.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let e=this;for(;e._parentMenu;)e=e._parentMenu;return e}get leafMenu(){let e=this;for(;e._childMenu;)e=e._childMenu;return e}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(e){this.activeIndex=e?this._items.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._items.length)&&(e=-1),-1===e||Z.canActivate(this._items[e])||(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let e=this._items.length,t=this._activeIndex,n=t{this.activeIndex=e}})}_.render(s,this.contentNode)}onCloseRequest(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let t=this._childMenu;t&&(this._childIndex=-1,this._childMenu=null,t._parentMenu=null,t.close());let n=this._parentMenu;n&&(this._parentMenu=null,n._childIndex=-1,n._childMenu=null,n.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(e)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation();let t=e.keyCode;if(13===t)return void this.triggerActiveItem();if(27===t)return void this.close();if(37===t)return void(this._parentMenu?this.close():this._menuRequested.emit("previous"));if(38===t)return void this.activatePreviousItem();if(39===t){let e=this.activeItem;return void(e&&"submenu"===e.type?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next"))}if(40===t)return void this.activateNextItem();let n=k().keyForKeydownEvent(e);if(!n)return;let i=this._activeIndex+1,r=Z.findMnemonic(this._items,n,i);-1===r.index||r.multiple?-1!==r.index?this.activeIndex=r.index:-1!==r.auto&&(this.activeIndex=r.auto):(this.activeIndex=r.index,this.triggerActiveItem())}_evtMouseUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(e){let t=i.findFirstIndex(this.contentNode.children,(t=>u.hitTest(t,e.clientX,e.clientY)));if(t===this._activeIndex)return;if(this.activeIndex=t,t=this.activeIndex,t===this._childIndex)return this._cancelOpenTimer(),void this._cancelCloseTimer();-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();let n=this.activeItem;n&&"submenu"===n.type&&n.submenu&&this._startOpenTimer()}_evtMouseEnter(e){for(let e=this._parentMenu;e;e=e._parentMenu)e._cancelOpenTimer(),e._cancelCloseTimer(),e.activeIndex=e._childIndex}_evtMouseLeave(e){if(this._cancelOpenTimer(),!this._childMenu)return void(this.activeIndex=-1);let{clientX:t,clientY:n}=e;u.hitTest(this._childMenu.node,t,n)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}_evtMouseDown(e){this._parentMenu||(Z.hitTestMenus(this,e.clientX,e.clientY)?(e.preventDefault(),e.stopPropagation()):this.close())}_openChildMenu(e=!1){let t=this.activeItem;if(!t||"submenu"!==t.type||!t.submenu)return void this._closeChildMenu();let n=t.submenu;if(n===this._childMenu)return;ue.saveWindowData(),this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,f.sendMessage(this,z.Msg.UpdateRequest);let i=this.contentNode.children[this._activeIndex];Z.openSubmenu(n,i),e&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){0===this._openTimerID&&(this._openTimerID=window.setTimeout((()=>{this._openTimerID=0,this._openChildMenu()}),Z.TIMER_DELAY))}_startCloseTimer(){0===this._closeTimerID&&(this._closeTimerID=window.setTimeout((()=>{this._closeTimerID=0,this._closeChildMenu()}),Z.TIMER_DELAY))}_cancelOpenTimer(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){Z.saveWindowData()}}!function(e){class t{renderItem(e){let t=this.createItemClass(e),n=this.createItemDataset(e),i=this.createItemARIA(e);return B.li({className:t,dataset:n,tabindex:"0",onfocus:e.onfocus,...i},this.renderIcon(e),this.renderLabel(e),this.renderShortcut(e),this.renderSubmenu(e))}renderIcon(e){let t=this.createIconClass(e);return B.div({className:t},e.item.icon,e.item.iconLabel)}renderLabel(e){let t=this.formatLabel(e);return B.div({className:"lm-Menu-itemLabel"},t)}renderShortcut(e){let t=this.formatShortcut(e);return B.div({className:"lm-Menu-itemShortcut"},t)}renderSubmenu(e){return B.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(e){let t="lm-Menu-item";e.item.isEnabled||(t+=" lm-mod-disabled"),e.item.isToggled&&(t+=" lm-mod-toggled"),e.item.isVisible||(t+=" lm-mod-hidden"),e.active&&(t+=" lm-mod-active"),e.collapsed&&(t+=" lm-mod-collapsed");let n=e.item.className;return n&&(t+=` ${n}`),t}createItemDataset(e){let t,{type:n,command:i,dataset:r}=e.item;return t="command"===n?{...r,type:n,command:i}:{...r,type:n},t}createIconClass(e){let t="lm-Menu-itemIcon",n=e.item.iconClass;return n?`${t} ${n}`:t}createItemARIA(e){let t={};switch(e.item.type){case"separator":t.role="presentation";break;case"submenu":t["aria-haspopup"]="true",e.item.isEnabled||(t["aria-disabled"]="true");break;default:e.item.isEnabled||(t["aria-disabled"]="true"),t.role="menuitem"}return t}formatLabel(e){let{label:t,mnemonic:n}=e.item;if(n<0||n>=t.length)return t;let i=t.slice(0,n),r=t.slice(n+1),s=t[n];return[i,B.span({className:"lm-Menu-itemMnemonic"},s),r]}formatShortcut(e){let t=e.item.keyBinding;return t?D.CommandRegistry.formatKeystroke(t.keys):null}}e.Renderer=t,e.defaultRenderer=new t}(ue||(ue={})),function(e){e.TIMER_DELAY=300,e.SUBMENU_OVERLAP=3;let t=null,n=0;function r(){return n>0?(n--,t):o()}function s(e){return"separator"!==e.type&&e.isEnabled&&e.isVisible}function o(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}e.saveWindowData=function(){t=o(),n++},e.createNode=function(){let e=document.createElement("div"),t=document.createElement("ul");return t.className="lm-Menu-content",e.appendChild(t),t.setAttribute("role","menu"),e.tabIndex=0,e},e.canActivate=s,e.createItem=function(e,t){return new a(e.commands,t)},e.hitTestMenus=function(e,t,n){for(let i=e;i;i=i.childMenu)if(u.hitTest(i.node,t,n))return!0;return!1},e.computeCollapsed=function(e){let t=new Array(e.length);i.fill(t,!1);let n=0,r=e.length;for(;n=0;--s){let n=e[s];if(n.isVisible){if("separator"!==n.type)break;t[s]=!0}}let o=!1;for(;++nu+c&&(t=u+c-v),!s&&n+b>d+h&&(n>d+h?n=d+h-b:n-=b),m.transform=`translate(${Math.max(0,t)}px, ${Math.max(0,n)}px`,m.opacity="1"},e.openSubmenu=function(t,n){const i=r();let s=i.pageXOffset,o=i.pageYOffset,a=i.clientWidth,l=i.clientHeight;f.sendMessage(t,z.Msg.UpdateRequest);let d=l,c=t.node,h=c.style;h.opacity="0",h.maxHeight=`${d}px`,z.attach(t,document.body);let{width:p,height:g}=c.getBoundingClientRect(),m=u.boxSizing(t.node),v=n.getBoundingClientRect(),b=v.right-e.SUBMENU_OVERLAP;b+p>s+a&&(b=v.left+e.SUBMENU_OVERLAP-p);let A=v.top-m.borderTop-m.paddingTop;A+g>o+l&&(A=v.bottom+m.borderBottom+m.paddingBottom-g),h.transform=`translate(${Math.max(0,b)}px, ${Math.max(0,A)}px`,h.opacity="1"},e.findMnemonic=function(e,t,n){let i=-1,r=-1,o=!1,a=t.toUpperCase();for(let t=0,l=e.length;t=0&&hn.command===e&&g.JSONExt.deepEqual(n.args,t)))||null}return null}}}(Z||(Z={})),function(e){function t(e,t){let n=e.rank,i=t.rank;return n!==i?n=this._titles.length)&&(e=-1),this._currentIndex===e)return;let t=this._currentIndex,n=this._titles[t]||null,i=e,r=this._titles[i]||null;this._currentIndex=i,this._previousTitle=n,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:n,currentIndex:i,currentTitle:r})}get name(){return this._name}set name(e){this._name=e,e?this.contentNode.setAttribute("aria-label",e):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.contentNode.setAttribute("aria-orientation",e))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled!==e&&(this._addButtonEnabled=e,e?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(e){return this.insertTab(this._titles.length,e)}insertTab(e,t){this._releaseMouse();let n=he.asTitle(t),r=this._titles.indexOf(n),s=Math.max(0,Math.min(e,this._titles.length));return-1===r?(i.insert(this._titles,s,n),n.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(s,n),n):(s===this._titles.length&&s--,r===s||(i.move(this._titles,r,s),this.update(),this._adjustCurrentForMove(r,s)),n)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=i.removeAt(this._titles,e);t&&(t.changed.disconnect(this._onTitleChanged,this),t===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(e,t))}clearTabs(){if(0===this._titles.length)return;this._releaseMouse();for(let e of this._titles)e.changed.disconnect(this._onTitleChanged,this);let e=this.currentIndex,t=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),-1!==e&&this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"dblclick":this._evtDblClick(e);break;case"keydown":e.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(e):this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this),this.node.addEventListener("keydown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this.node.removeEventListener("keydown",this),this._releaseMouse()}onUpdateRequest(e){var t;let n=this._titles,i=this.renderer,r=this.currentTitle,s=new Array(n.length);const o=null!==(t=this._getCurrentTabindex())&&void 0!==t?t:this._currentIndex>-1?this._currentIndex:0;for(let e=0,t=n.length;eu.hitTest(t,e.clientX,e.clientY)));if(-1===n)return;let r=this.titles[n],s=t[n].querySelector(".lm-TabBar-tabLabel");if(s&&s.contains(e.target)){let e=r.label||"",t=s.innerHTML;s.innerHTML="";let n=document.createElement("input");n.classList.add("lm-TabBar-tabInput"),n.value=e,s.appendChild(n);let i=()=>{n.removeEventListener("blur",i),s.innerHTML=t,this.node.addEventListener("keydown",this)};n.addEventListener("dblclick",(e=>e.stopPropagation())),n.addEventListener("blur",i),n.addEventListener("keydown",(e=>{"Enter"===e.key?(""!==n.value&&(r.label=r.caption=n.value),i()):"Escape"===e.key&&i()})),this.node.removeEventListener("keydown",this),n.select(),n.focus(),s.children.length>0&&s.children[0].focus()}}_evtKeyDownCapturing(e){e.eventPhase===Event.CAPTURING_PHASE&&(e.preventDefault(),e.stopPropagation(),"Escape"===e.key&&this._releaseMouse())}_evtKeyDown(e){var t,n,r;if("Tab"!==e.key&&e.eventPhase!==Event.CAPTURING_PHASE)if("Enter"===e.key||"Spacebar"===e.key||" "===e.key){const t=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(t))e.preventDefault(),e.stopPropagation(),this._addRequested.emit();else{const n=i.findFirstIndex(this.contentNode.children,(e=>e.contains(t)));n>=0&&(e.preventDefault(),e.stopPropagation(),this.currentIndex=n)}}else if(de.includes(e.key)){const i=[...this.contentNode.children];if(this.addButtonEnabled&&i.push(this.addButtonNode),i.length<=1)return;e.preventDefault(),e.stopPropagation();let s,o=i.indexOf(document.activeElement);-1===o&&(o=this._currentIndex),"ArrowRight"===e.key&&"horizontal"===this._orientation||"ArrowDown"===e.key&&"vertical"===this._orientation?s=null!==(t=i[o+1])&&void 0!==t?t:i[0]:"ArrowLeft"===e.key&&"horizontal"===this._orientation||"ArrowUp"===e.key&&"vertical"===this._orientation?s=null!==(n=i[o-1])&&void 0!==n?n:i[i.length-1]:"Home"===e.key?s=i[0]:"End"===e.key&&(s=i[i.length-1]),s&&(null===(r=i[o])||void 0===r||r.setAttribute("tabindex","-1"),null==s||s.setAttribute("tabindex","0"),s.focus())}}_evtPointerDown(e){if(0!==e.button&&1!==e.button)return;if(this._dragData)return;if(e.target.classList.contains("lm-TabBar-tabInput"))return;let t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),n=this.contentNode.children,r=i.findFirstIndex(n,(t=>u.hitTest(t,e.clientX,e.clientY)));if(-1===r&&!t)return;if(e.preventDefault(),e.stopPropagation(),this._dragData={tab:n[r],index:r,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),1===e.button||t)return;let s=n[r].querySelector(this.renderer.closeIconSelector);s&&s.contains(e.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===r?this.currentIndex=-1:this.currentIndex=r,-1!==this.currentIndex&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}_evtPointerMove(e){let t=this._dragData;if(!t)return;e.preventDefault(),e.stopPropagation();let n=this.contentNode.children;if(t.dragActive||he.dragExceeded(t,e)){if(!t.dragActive){let e=t.tab.getBoundingClientRect();"horizontal"===this._orientation?(t.tabPos=t.tab.offsetLeft,t.tabSize=e.width,t.tabPressPos=t.pressX-e.left):(t.tabPos=t.tab.offsetTop,t.tabSize=e.height,t.tabPressPos=t.pressY-e.top),t.tabPressOffset={x:t.pressX-e.left,y:t.pressY-e.top},t.tabLayout=he.snapTabLayout(n,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=D.Drag.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&he.detachExceeded(t,e)){t.detachRequested=!0;let i=t.index,r=e.clientX,s=e.clientY,o=n[i],a=this._titles[i];if(this._tabDetachRequested.emit({index:i,title:a,tab:o,clientX:r,clientY:s,offset:t.tabPressOffset}),t.dragAborted)return}he.layoutTabs(n,t,e,this._orientation)}}_evtPointerUp(e){if(0!==e.button&&1!==e.button)return;const t=this._dragData;if(!t)return;if(e.preventDefault(),e.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!t.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(e.target))return void this._addRequested.emit(void 0);let n=this.contentNode.children,r=i.findFirstIndex(n,(t=>u.hitTest(t,e.clientX,e.clientY)));if(r!==t.index)return;let s=this._titles[r];if(!s.closable)return;if(1===e.button)return void this._tabCloseRequested.emit({index:r,title:s});let o=n[r].querySelector(this.renderer.closeIconSelector);return o&&o.contains(e.target)?void this._tabCloseRequested.emit({index:r,title:s}):void 0}if(0!==e.button)return;he.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging");let n=he.parseTransitionDuration(t.tab);setTimeout((()=>{if(t.dragAborted)return;this._dragData=null,he.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let e=t.index,n=t.targetIndex;-1!==n&&e!==n&&(i.move(this._titles,e,n),this._adjustCurrentForMove(e,n),this._tabMoved.emit({fromIndex:e,toIndex:n,title:this._titles[n]}),f.sendMessage(this,z.Msg.UpdateRequest))}),n)}_releaseMouse(){let e=this._dragData;e&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),e.dragAborted=!0,e.dragActive&&(he.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),e.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(e,t){let n=this.currentTitle,i=this._currentIndex,r=this.insertBehavior;if("select-tab"===r||"select-tab-if-needed"===r&&-1===i)return this._currentIndex=e,this._previousTitle=n,void this._currentChanged.emit({previousIndex:i,previousTitle:n,currentIndex:e,currentTitle:t});i>=e&&this._currentIndex++}_adjustCurrentForMove(e,t){this._currentIndex===e?this._currentIndex=t:this._currentIndex=t?this._currentIndex++:this._currentIndex>e&&this._currentIndex<=t&&this._currentIndex--}_adjustCurrentForRemove(e,t){let n=this._currentIndex,i=this.removeBehavior;if(n===e){if(0===this._titles.length)return this._currentIndex=-1,void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null});if("select-tab-after"===i)return this._currentIndex=Math.min(e,this._titles.length-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-tab-before"===i)return this._currentIndex=Math.max(0,e-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-previous-tab"===i)return this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(e,this._titles.length-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}else n>e&&this._currentIndex--}_onTitleChanged(e){this.update()}}var he,pe,fe,ge,me,ve,be,Ae;!function(e){class t{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++t._nInstance}renderTab(e){let t=e.title.caption,n=this.createTabKey(e),i=n,r=this.createTabStyle(e),s=this.createTabClass(e),o=this.createTabDataset(e),a=this.createTabARIA(e);return e.title.closable?B.li({id:i,key:n,className:s,title:t,style:r,dataset:o,...a},this.renderIcon(e),this.renderLabel(e),this.renderCloseIcon(e)):B.li({id:i,key:n,className:s,title:t,style:r,dataset:o,...a},this.renderIcon(e),this.renderLabel(e))}renderIcon(e){const{title:t}=e;let n=this.createIconClass(e);return B.div({className:n},t.icon,t.iconLabel)}renderLabel(e){return B.div({className:"lm-TabBar-tabLabel"},e.title.label)}renderCloseIcon(e){return B.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(e){let t=this._tabKeys.get(e.title);return void 0===t&&(t=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(e.title,t)),t}createTabStyle(e){return{zIndex:`${e.zIndex}`}}createTabClass(e){let t="lm-TabBar-tab";return e.title.className&&(t+=` ${e.title.className}`),e.title.closable&&(t+=" lm-mod-closable"),e.current&&(t+=" lm-mod-current"),t}createTabDataset(e){return e.title.dataset}createTabARIA(e){var t;return{role:"tab","aria-selected":e.current.toString(),tabindex:`${null!==(t=e.tabIndex)&&void 0!==t?t:"-1"}`}}createIconClass(e){let t="lm-TabBar-tabIcon",n=e.title.iconClass;return n?`${t} ${n}`:t}}t._nInstance=0,e.Renderer=t,e.defaultRenderer=new t,e.addButtonSelector=".lm-TabBar-addButton"}(ce||(ce={})),function(e){e.DRAG_THRESHOLD=5,e.DETACH_THRESHOLD=20,e.createNode=function(){let e=document.createElement("div"),t=document.createElement("ul");t.setAttribute("role","tablist"),t.className="lm-TabBar-content",e.appendChild(t);let n=document.createElement("div");return n.className="lm-TabBar-addButton lm-mod-hidden",n.setAttribute("tabindex","-1"),n.setAttribute("role","button"),e.appendChild(n),e},e.asTitle=function(e){return e instanceof F?e:new F(e)},e.parseTransitionDuration=function(e){let t=window.getComputedStyle(e);return 1e3*(parseFloat(t.transitionDuration)||0)},e.snapTabLayout=function(e,t){let n=new Array(e.length);for(let i=0,r=e.length;i=e.DRAG_THRESHOLD||r>=e.DRAG_THRESHOLD},e.detachExceeded=function(t,n){let i=t.contentRect;return n.clientX=i.right+e.DETACH_THRESHOLD||n.clientY=i.bottom+e.DETACH_THRESHOLD},e.layoutTabs=function(e,t,n,i){let r,s,o,a;"horizontal"===i?(r=t.pressX,s=n.clientX-t.contentRect.left,o=n.clientX,a=t.contentRect.width):(r=t.pressY,s=n.clientY-t.contentRect.top,o=n.clientY,a=t.contentRect.height);let l=t.index,u=s-t.tabPressPos,d=u+t.tabSize;for(let n=0,s=e.length;n>1);if(nt.index&&d>h)s=-t.tabSize-c.margin+"px",l=Math.max(l,n);else if(n===t.index){let e=o-r,n=a-(t.tabPos+t.tabSize);s=`${Math.max(-t.tabPos,Math.min(e,n))}px`}else s="";"horizontal"===i?e[n].style.left=s:e[n].style.top=s}t.targetIndex=l},e.finalizeTabPosition=function(e,t){let n,i;if(n="horizontal"===t?e.contentRect.width:e.contentRect.height,e.targetIndex===e.index)i=0;else if(e.targetIndex>e.index){let t=e.tabLayout[e.targetIndex];i=t.pos+t.size-e.tabSize-e.tabPos}else i=e.tabLayout[e.targetIndex].pos-e.tabPos;let r=n-(e.tabPos+e.tabSize),s=Math.max(-e.tabPos,Math.min(i,r));"horizontal"===t?e.tab.style.left=`${s}px`:e.tab.style.top=`${s}px`},e.resetTabPositions=function(e,t){for(const n of e)"horizontal"===t?n.style.left="":n.style.top=""}}(he||(he={}));class ye extends U{constructor(e){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=e.renderer,void 0!==e.spacing&&(this._spacing=ee.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:z.HiddenMode.Display}dispose(){let e=this[Symbol.iterator]();this._items.forEach((e=>{e.dispose()})),this._box=null,this._root=null,this._items.clear();for(const t of e)t.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e){this._hiddenMode=e;for(const e of this.tabBars())if(e.titles.length>1)for(const t of e.titles)t.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(e){e=ee.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get isEmpty(){return null===this._root}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():o()}widgets(){return this._root?this._root.iterUserWidgets():o()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():o()}tabBars(){return this._root?this._root.iterTabBars():o()}handles(){return this._root?this._root.iterHandles():o()}moveHandle(e,t,n){let i=e.classList.contains("lm-mod-hidden");if(!this._root||i)return;let r,s=this._root.findSplitNode(e);s&&(r="horizontal"===s.node.orientation?t-e.offsetLeft:n-e.offsetTop,0!==r&&(s.node.holdSizes(),I.adjust(s.node.sizers,s.index,r),this.parent&&this.parent.update()))}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(e){let t,n=new Set;t=e.main?pe.normalizeAreaConfig(e.main,n):null;let i=this.widgets(),r=this.tabBars(),s=this.handles();this._root=null;for(const e of i)n.has(e)||(e.parent=null);for(const e of r)e.dispose();for(const e of s)e.parentNode&&e.parentNode.removeChild(e);for(const e of n)e.parent=this.parent;this._root=t?pe.realizeAreaConfig(t,{createTabBar:e=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):null,this.parent&&(n.forEach((e=>{this.attachWidget(e)})),this.parent.fit())}addWidget(e,t={}){let n=t.ref||null,i=t.mode||"tab-after",r=null;if(this._root&&n&&(r=this._root.findTabNode(n)),n&&!r)throw new Error("Reference widget is not in the layout.");switch(e.parent=this.parent,i){case"tab-after":this._insertTab(e,n,r,!0);break;case"tab-before":this._insertTab(e,n,r,!1);break;case"split-top":this._insertSplit(e,n,r,"vertical",!1);break;case"split-left":this._insertSplit(e,n,r,"horizontal",!1);break;case"split-right":this._insertSplit(e,n,r,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,n,r,"vertical",!0);break;case"merge-top":this._insertSplit(e,n,r,"vertical",!1,!0);break;case"merge-left":this._insertSplit(e,n,r,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(e,n,r,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(e,n,r,"vertical",!0,!0)}this.parent&&(this.attachWidget(e),this.parent.fit())}removeWidget(e){this._removeWidget(e),this.parent&&(this.detachWidget(e),this.parent.fit())}hitTestTabAreas(e,t){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=u.boxSizing(this.parent.node));let n=this.parent.node.getBoundingClientRect(),i=e-n.left-this._box.borderLeft,r=t-n.top-this._box.borderTop,s=this._root.hitTestTabNodes(i,r);if(!s)return null;let{tabBar:o,top:a,left:l,width:d,height:c}=s,h=this._box.borderLeft+this._box.borderRight,p=this._box.borderTop+this._box.borderBottom;return{tabBar:o,x:i,y:r,top:a,left:l,right:n.width-h-(l+d),bottom:n.height-p-(a+c),width:d,height:c}}init(){super.init();for(const e of this)this.attachWidget(e);for(const e of this.handles())this.parent.node.appendChild(e);this.parent.fit()}attachWidget(e){this.parent.node!==e.node.parentNode&&(this._items.set(e,new H(e)),this.parent.isAttached&&f.sendMessage(e,z.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&f.sendMessage(e,z.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&f.sendMessage(e,z.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&f.sendMessage(e,z.Msg.AfterDetach);let t=this._items.get(e);t&&(this._items.delete(e),t.dispose())}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_removeWidget(e){if(!this._root)return;let t=this._root.findTabNode(e);if(!t)return;if(pe.removeAria(e),t.tabBar.titles.length>1)return t.tabBar.removeTab(e.title),void(this._hiddenMode===z.HiddenMode.Scale&&1==t.tabBar.titles.length&&(t.tabBar.titles[0].owner.hiddenMode=z.HiddenMode.Display));if(t.tabBar.dispose(),this._root===t)return void(this._root=null);this._root.holdAllSizes();let n=t.parent;t.parent=null;let r=i.removeFirstOf(n.children,t),s=i.removeAt(n.handles,r);if(i.removeAt(n.sizers,r),s.parentNode&&s.parentNode.removeChild(s),n.children.length>1)return void n.syncHandles();let o=n.parent;n.parent=null;let a=n.children[0],l=n.handles[0];if(n.children.length=0,n.handles.length=0,n.sizers.length=0,l.parentNode&&l.parentNode.removeChild(l),this._root===n)return a.parent=null,void(this._root=a);let u=o,d=u.children.indexOf(n);if(a instanceof pe.TabLayoutNode)return a.parent=u,void(u.children[d]=a);let c=i.removeAt(u.handles,d);i.removeAt(u.children,d),i.removeAt(u.sizers,d),c.parentNode&&c.parentNode.removeChild(c);for(let e=0,t=a.children.length;e=n.length)&&(i=0),{type:"tab-area",widgets:n,currentIndex:i}}(t,n):function(t,n){let i=t.orientation,r=[],s=[];for(let o=0,a=t.children.length;o{let l=r(i,n,s),u=t(e.sizes[a]),d=n.createHandle();o.children.push(l),o.handles.push(d),o.sizers.push(u),l.parent=o})),o.syncHandles(),o.normalizeSizes(),o}(s,o,a),l};class n{constructor(e){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;let t=new N,n=new N;t.stretch=0,n.stretch=1,this.tabBar=e,this.sizers=[t,n]}get top(){return this._top}get left(){return this._left}get width(){return this._width}get height(){return this._height}*iterAllWidgets(){yield this.tabBar,yield*this.iterUserWidgets()}*iterUserWidgets(){for(const e of this.tabBar.titles)yield e.owner}*iterSelectedWidgets(){let e=this.tabBar.currentTitle;e&&(yield e.owner)}*iterTabBars(){yield this.tabBar}*iterHandles(){}findTabNode(e){return-1!==this.tabBar.titles.indexOf(e.title)?this:null}findSplitNode(e){return null}findFirstTabNode(){return this}hitTestTabNodes(e,t){return e=this._left+this._width||t=this._top+this._height?null:this}createConfig(){return{type:"tab-area",widgets:this.tabBar.titles.map((e=>e.owner)),currentIndex:this.tabBar.currentIndex}}holdAllSizes(){}fit(e,t){let n=0,i=0,r=t.get(this.tabBar),s=this.tabBar.currentTitle,o=s?t.get(s.owner):void 0,[a,l]=this.sizers;return r&&r.fit(),o&&o.fit(),r&&!r.isHidden?(n=Math.max(n,r.minWidth),i+=r.minHeight,a.minSize=r.minHeight,a.maxSize=r.maxHeight):(a.minSize=0,a.maxSize=0),o&&!o.isHidden?(n=Math.max(n,o.minWidth),i+=o.minHeight,l.minSize=o.minHeight,l.maxSize=1/0):(l.minSize=0,l.maxSize=1/0),{minWidth:n,minHeight:i,maxWidth:1/0,maxHeight:1/0}}update(e,t,n,i,r,s){this._top=t,this._left=e,this._width=n,this._height=i;let o=s.get(this.tabBar),a=this.tabBar.currentTitle,l=a?s.get(a.owner):void 0;if(I.calc(this.sizers,i),o&&!o.isHidden){let i=this.sizers[0].size;o.update(e,t,n,i),t+=i}if(l&&!l.isHidden){let i=this.sizers[1].size;l.update(e,t,n,i)}}}e.TabLayoutNode=n;class i{constructor(e){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=e}*iterAllWidgets(){for(const e of this.children)yield*e.iterAllWidgets()}*iterUserWidgets(){for(const e of this.children)yield*e.iterUserWidgets()}*iterSelectedWidgets(){for(const e of this.children)yield*e.iterSelectedWidgets()}*iterTabBars(){for(const e of this.children)yield*e.iterTabBars()}*iterHandles(){yield*this.handles;for(const e of this.children)yield*e.iterHandles()}findTabNode(e){for(let t=0,n=this.children.length;te.createConfig())),sizes:t}}syncHandles(){this.handles.forEach(((e,t)=>{e.setAttribute("data-orientation",this.orientation),t===this.handles.length-1?e.classList.add("lm-mod-hidden"):e.classList.remove("lm-mod-hidden")}))}holdSizes(){for(const e of this.sizers)e.sizeHint=e.size}holdAllSizes(){for(const e of this.children)e.holdAllSizes();this.holdSizes()}normalizeSizes(){let e=this.sizers.length;if(0===e)return;this.holdSizes();let t=this.sizers.reduce(((e,t)=>e+t.sizeHint),0);if(0===t)for(const t of this.sizers)t.size=t.sizeHint=1/e;else for(const e of this.sizers)e.size=e.sizeHint/=t;this.normalized=!0}createNormalizedSizes(){let e=this.sizers.length;if(0===e)return[];let t=this.sizers.map((e=>e.size)),n=t.reduce(((e,t)=>e+t),0);if(0===n)for(let n=t.length-1;n>-1;n--)t[n]=1/e;else for(let e=t.length-1;e>-1;e--)t[e]/=n;return t}fit(e,t){let n="horizontal"===this.orientation,i=Math.max(0,this.children.length-1)*e,r=n?i:0,s=n?0:i;for(let i=0,o=this.children.length;ithis._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new ye({document:this._document,renderer:t,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new we.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(e){this.layout.hiddenMode=e}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get mode(){return this._mode}set mode(e){if(this._mode===e)return;this._mode=e,this.dataset.mode=e;let t=this.layout;switch(e){case"multiple-document":for(const e of t.tabBars())e.show();break;case"single-document":t.restoreLayout(fe.createSingleDocumentConfig(this));break;default:throw"unreachable"}f.postMessage(this,fe.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(e){this._tabsMovable=e;for(const t of this.tabBars())t.tabsMovable=e}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(e){this._tabsConstrained=e}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled=e;for(const t of this.tabBars())t.addButtonEnabled=e}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(e){let t=a(this.tabBars(),(t=>-1!==t.titles.indexOf(e.title)));if(!t)throw new Error("Widget is not contained in the dock panel.");t.currentTitle=e.title}activateWidget(e){this.selectWidget(e),e.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(e){this._mode="multiple-document",this.layout.restoreLayout(e),(d.IS_EDGE||d.IS_IE)&&f.flush(),f.postMessage(this,fe.LayoutModified)}addWidget(e,t={}){"single-document"===this._mode?this.layout.addWidget(e):this.layout.addWidget(e,t),f.postMessage(this,fe.LayoutModified)}processMessage(e){"layout-modified"===e.type?this._layoutModified.emit(void 0):super.processMessage(e)}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){fe.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){fe.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),f.postMessage(this,fe.LayoutModified))}_evtDragEnter(e){e.mimeData.hasData("application/vnd.lumino.widget-factory")&&(e.preventDefault(),e.stopPropagation())}_evtDragLeave(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||(e.stopPropagation(),this.overlay.hide(1))}_evtDragOver(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||"invalid"===this._showOverlay(e.clientX,e.clientY)?e.dropAction="none":(e.stopPropagation(),e.dropAction=e.proposedAction)}_evtDrop(e){if(e.preventDefault(),this.overlay.hide(0),"none"===e.proposedAction)return void(e.dropAction="none");let{clientX:t,clientY:n}=e,{zone:i,target:r}=fe.findDropTarget(this,t,n,this._edges);if(this._tabsConstrained&&e.source!==this||"invalid"===i)return void(e.dropAction="none");let s=e.mimeData.getData("application/vnd.lumino.widget-factory");if("function"!=typeof s)return void(e.dropAction="none");let o=s();if(!(o instanceof z))return void(e.dropAction="none");if(o.contains(this))return void(e.dropAction="none");let a=r?fe.getDropRef(r.tabBar):null;switch(i){case"root-all":this.addWidget(o);break;case"root-top":this.addWidget(o,{mode:"split-top"});break;case"root-left":this.addWidget(o,{mode:"split-left"});break;case"root-right":this.addWidget(o,{mode:"split-right"});break;case"root-bottom":this.addWidget(o,{mode:"split-bottom"});break;case"widget-all":case"widget-tab":this.addWidget(o,{mode:"tab-after",ref:a});break;case"widget-top":this.addWidget(o,{mode:"split-top",ref:a});break;case"widget-left":this.addWidget(o,{mode:"split-left",ref:a});break;case"widget-right":this.addWidget(o,{mode:"split-right",ref:a});break;case"widget-bottom":this.addWidget(o,{mode:"split-bottom",ref:a});break;default:throw"unreachable"}e.dropAction=e.proposedAction,e.stopPropagation(),this.activateWidget(o)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&(this._releaseMouse(),f.postMessage(this,fe.LayoutModified))}_evtPointerDown(e){if(0!==e.button)return;let t=this.layout,n=e.target,i=a(t.handles(),(e=>e.contains(n)));if(!i)return;e.preventDefault(),e.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let r=i.getBoundingClientRect(),s=e.clientX-r.left,o=e.clientY-r.top,l=window.getComputedStyle(i),u=D.Drag.overrideCursor(l.cursor,this._document);this._pressData={handle:i,deltaX:s,deltaY:o,override:u}}_evtPointerMove(e){if(!this._pressData)return;e.preventDefault(),e.stopPropagation();let t=this.node.getBoundingClientRect(),n=e.clientX-t.left-this._pressData.deltaX,i=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,n,i)}_evtPointerUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse(),f.postMessage(this,fe.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(e,t){let n,i,r,s,{zone:o,target:a}=fe.findDropTarget(this,e,t,this._edges);if("invalid"===o)return this.overlay.hide(100),o;let l=u.boxSizing(this.node),d=this.node.getBoundingClientRect();switch(o){case"root-all":n=l.paddingTop,i=l.paddingLeft,r=l.paddingRight,s=l.paddingBottom;break;case"root-top":n=l.paddingTop,i=l.paddingLeft,r=l.paddingRight,s=d.height*fe.GOLDEN_RATIO;break;case"root-left":n=l.paddingTop,i=l.paddingLeft,r=d.width*fe.GOLDEN_RATIO,s=l.paddingBottom;break;case"root-right":n=l.paddingTop,i=d.width*fe.GOLDEN_RATIO,r=l.paddingRight,s=l.paddingBottom;break;case"root-bottom":n=d.height*fe.GOLDEN_RATIO,i=l.paddingLeft,r=l.paddingRight,s=l.paddingBottom;break;case"widget-all":n=a.top,i=a.left,r=a.right,s=a.bottom;break;case"widget-top":n=a.top,i=a.left,r=a.right,s=a.bottom+a.height/2;break;case"widget-left":n=a.top,i=a.left,r=a.right+a.width/2,s=a.bottom;break;case"widget-right":n=a.top,i=a.left+a.width/2,r=a.right,s=a.bottom;break;case"widget-bottom":n=a.top+a.height/2,i=a.left,r=a.right,s=a.bottom;break;case"widget-tab":{const e=a.tabBar.node.getBoundingClientRect().height;n=a.top,i=a.left,r=a.right,s=a.bottom+a.height-e;break}default:throw"unreachable"}return this.overlay.show({top:n,left:i,right:r,bottom:s}),o}_createTabBar(){let e=this._renderer.createTabBar(this._document);return fe.isGeneratedTabBarProperty.set(e,!0),"single-document"===this._mode&&e.hide(),e.tabsMovable=this._tabsMovable,e.allowDeselect=!1,e.addButtonEnabled=this._addButtonEnabled,e.removeBehavior="select-previous-tab",e.insertBehavior="select-tab-if-needed",e.tabMoved.connect(this._onTabMoved,this),e.currentChanged.connect(this._onCurrentChanged,this),e.tabCloseRequested.connect(this._onTabCloseRequested,this),e.tabDetachRequested.connect(this._onTabDetachRequested,this),e.tabActivateRequested.connect(this._onTabActivateRequested,this),e.addRequested.connect(this._onTabAddRequested,this),e}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){f.postMessage(this,fe.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:n,currentTitle:i}=t;n&&n.owner.hide(),i&&i.owner.show(),(d.IS_EDGE||d.IS_IE)&&f.flush(),f.postMessage(this,fe.LayoutModified)}_onTabAddRequested(e){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabDetachRequested(e,t){if(this._drag)return;e.releaseMouse();let{title:n,tab:i,clientX:r,clientY:s,offset:o}=t,a=new g.MimeData;a.setData("application/vnd.lumino.widget-factory",(()=>n.owner));let l=i.cloneNode(!0);o&&(l.style.top=`-${o.y}px`,l.style.left=`-${o.x}px`),this._drag=new D.Drag({document:this._document,mimeData:a,dragImage:l,proposedAction:"move",supportedActions:"move",source:this}),i.classList.add("lm-mod-hidden"),this._drag.start(r,s).then((()=>{this._drag=null,i.classList.remove("lm-mod-hidden")}))}}!function(e){e.Overlay=class{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(e){let t=this.node.style;t.top=`${e.top}px`,t.left=`${e.left}px`,t.right=`${e.right}px`,t.bottom=`${e.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(e){if(!this._hidden)return e<=0?(clearTimeout(this._timer),this._timer=-1,this._hidden=!0,void this.node.classList.add("lm-mod-hidden")):void(-1===this._timer&&(this._timer=window.setTimeout((()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")}),e)))}};class t{createTabBar(e){let t=new ce({document:e});return t.addClass("lm-DockPanel-tabBar"),t}createHandle(){let e=document.createElement("div");return e.className="lm-DockPanel-handle",e}}e.Renderer=t,e.defaultRenderer=new t}(we||(we={})),function(e){e.GOLDEN_RATIO=.618,e.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},e.LayoutModified=new b("layout-modified"),e.isGeneratedTabBarProperty=new C.AttachedProperty({name:"isGeneratedTabBar",create:()=>!1}),e.createSingleDocumentConfig=function(e){if(e.isEmpty)return{main:null};let t=Array.from(e.widgets()),n=e.selectedWidgets().next().value,i=n?t.indexOf(n):-1;return{main:{type:"tab-area",widgets:t,currentIndex:i}}},e.findDropTarget=function(e,t,n,i){if(!u.hitTest(e.node,t,n))return{zone:"invalid",target:null};let r=e.layout;if(r.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===e.mode){let r=e.node.getBoundingClientRect(),s=t-r.left+1,o=n-r.top+1,a=r.right-t,l=r.bottom-n;switch(Math.min(o,a,l,s)){case o:if(oh&&l>h&&a>p&&d>p)return{zone:"widget-all",target:s};switch(o/=h,a/=p,l/=h,d/=p,Math.min(o,a,l,d)){case o:c="widget-left";break;case a:c="widget-top";break;case l:c="widget-right";break;case d:c="widget-bottom";break;default:throw"unreachable"}return{zone:c,target:s}},e.getDropRef=function(e){return 0===e.titles.length?null:e.currentTitle?e.currentTitle.owner:e.titles[e.titles.length-1].owner}}(fe||(fe={}));class _e{constructor(){this._counter=0,this._widgets=[],this._activeWidget=null,this._currentWidget=null,this._numbers=new Map,this._nodes=new Map,this._activeChanged=new x.Signal(this),this._currentChanged=new x.Signal(this)}dispose(){if(!(this._counter<0)){this._counter=-1,x.Signal.clearData(this);for(const e of this._widgets)e.node.removeEventListener("focus",this,!0),e.node.removeEventListener("blur",this,!0);this._activeWidget=null,this._currentWidget=null,this._nodes.clear(),this._numbers.clear(),this._widgets.length=0}}get currentChanged(){return this._currentChanged}get activeChanged(){return this._activeChanged}get isDisposed(){return this._counter<0}get currentWidget(){return this._currentWidget}get activeWidget(){return this._activeWidget}get widgets(){return this._widgets}focusNumber(e){let t=this._numbers.get(e);return void 0===t?-1:t}has(e){return this._numbers.has(e)}add(e){if(this._numbers.has(e))return;let t=e.node.contains(document.activeElement),n=t?this._counter++:-1;this._widgets.push(e),this._numbers.set(e,n),this._nodes.set(e.node,e),e.node.addEventListener("focus",this,!0),e.node.addEventListener("blur",this,!0),e.disposed.connect(this._onWidgetDisposed,this),t&&this._setWidgets(e,e)}remove(e){if(!this._numbers.has(e))return;if(e.disposed.disconnect(this._onWidgetDisposed,this),e.node.removeEventListener("focus",this,!0),e.node.removeEventListener("blur",this,!0),i.removeFirstOf(this._widgets,e),this._nodes.delete(e.node),this._numbers.delete(e),this._currentWidget!==e)return;let t=function(e,t){let n;for(const i of e)void 0!==n?t(i,n)>0&&(n=i):n=i;return n}(this._widgets.filter((e=>-1!==this._numbers.get(e))),((e,t)=>this._numbers.get(e)-this._numbers.get(t)))||null;this._setWidgets(t,null)}handleEvent(e){switch(e.type){case"focus":this._evtFocus(e);break;case"blur":this._evtBlur(e)}}_setWidgets(e,t){let n=this._currentWidget;this._currentWidget=e;let i=this._activeWidget;this._activeWidget=t,n!==e&&this._currentChanged.emit({oldValue:n,newValue:e}),i!==t&&this._activeChanged.emit({oldValue:i,newValue:t})}_evtFocus(e){let t=this._nodes.get(e.currentTarget);t!==this._currentWidget&&this._numbers.set(t,this._counter++),this._setWidgets(t,t)}_evtBlur(e){let t=this._nodes.get(e.currentTarget),n=e.relatedTarget;n&&(t.node.contains(n)||a(this._widgets,(e=>e.node.contains(n))))||this._setWidgets(this._currentWidget,null)}_onWidgetDisposed(e){this.remove(e)}}class Ee extends U{constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new N],this._columnSizers=[new N],this._box=null,void 0!==e.rowCount&&ge.reallocSizers(this._rowSizers,e.rowCount),void 0!==e.columnCount&&ge.reallocSizers(this._columnSizers,e.columnCount),void 0!==e.rowSpacing&&(this._rowSpacing=ge.clampValue(e.rowSpacing)),void 0!==e.columnSpacing&&(this._columnSpacing=ge.clampValue(e.columnSpacing))}dispose(){for(const e of this._items){let t=e.widget;e.dispose(),t.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(e){e!==this.rowCount&&(ge.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(ge.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=ge.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=ge.clampValue(e),this._columnSpacing!==e&&(this._columnSpacing=e,this.parent&&this.parent.fit())}rowStretch(e){let t=this._rowSizers[e];return t?t.stretch:-1}setRowStretch(e,t){let n=this._rowSizers[e];n&&(t=ge.clampValue(t),n.stretch!==t&&(n.stretch=t,this.parent&&this.parent.update()))}columnStretch(e){let t=this._columnSizers[e];return t?t.stretch:-1}setColumnStretch(e,t){let n=this._columnSizers[e];n&&(t=ge.clampValue(t),n.stretch!==t&&(n.stretch=t,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(const e of this._items)yield e.widget}addWidget(e){-1===i.findFirstIndex(this._items,(t=>t.widget===e))&&(this._items.push(new H(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=i.findFirstIndex(this._items,(t=>t.widget===e));if(-1===t)return;let n=i.removeAt(this._items,t);this.parent&&this.detachWidget(e),n.dispose()}init(){super.init();for(const e of this)this.attachWidget(e)}attachWidget(e){this.parent.isAttached&&f.sendMessage(e,z.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&f.sendMessage(e,z.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&f.sendMessage(e,z.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&f.sendMessage(e,z.Msg.AfterDetach),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(let e=0,t=this.rowCount;e!e.isHidden));for(let t=0,n=e.length;t({row:0,column:0,rowSpan:1,columnSpan:1}),changed:function(e){e.parent&&e.parent.layout instanceof Ee&&e.parent.fit()}}),e.normalizeConfig=function(e){return{row:Math.max(0,Math.floor(e.row||0)),column:Math.max(0,Math.floor(e.column||0)),rowSpan:Math.max(1,Math.floor(e.rowSpan||0)),columnSpan:Math.max(1,Math.floor(e.columnSpan||0))}},e.clampValue=function(e){return Math.max(0,Math.floor(e))},e.rowSpanCmp=function(t,n){let i=e.cellConfigProperty.get(t.widget),r=e.cellConfigProperty.get(n.widget);return i.rowSpan-r.rowSpan},e.columnSpanCmp=function(t,n){let i=e.cellConfigProperty.get(t.widget),r=e.cellConfigProperty.get(n.widget);return i.columnSpan-r.columnSpan},e.reallocSizers=function(e,t){for(t=Math.max(1,Math.floor(t));e.lengtht&&(e.length=t)},e.distributeMin=function(e,t,n,i){if(n=i)return;let s=(i-r)/(n-t+1);for(let i=t;i<=n;++i)e[i].minSize+=s}}(ge||(ge={}));class Ce extends z{constructor(e={}){super({node:me.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(z.Flag.DisallowLayout),this.renderer=e.renderer||Ce.defaultRenderer,this._forceItemsPosition=e.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=e.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(e){this.activeIndex=e?this._menus.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._menus.length)&&(e=-1),e>-1&&0===this._menus[e].items.length&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this.update())}get menus(){return this._menus}openActiveMenu(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(e,t=!0){this.insertMenu(this._menus.length,e,t)}insertMenu(e,t,n=!0){this._closeChildMenu();let r=this._menus.indexOf(t),s=Math.max(0,Math.min(e,this._menus.length));if(-1===r)return i.insert(this._menus,s,t),t.addClass("lm-MenuBar-menu"),t.aboutToClose.connect(this._onMenuAboutToClose,this),t.menuRequested.connect(this._onMenuMenuRequested,this),t.title.changed.connect(this._onTitleChanged,this),void(n&&this.update());s===this._menus.length&&s--,r!==s&&(i.move(this._menus,r,s),n&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let n=i.removeAt(this._menus,e);n&&(n.aboutToClose.disconnect(this._onMenuAboutToClose,this),n.menuRequested.disconnect(this._onMenuMenuRequested,this),n.title.changed.disconnect(this._onTitleChanged,this),n.removeClass("lm-MenuBar-menu"),t&&this.update())}clearMenus(){if(0!==this._menus.length){this._closeChildMenu();for(let e of this._menus)e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"focusout":this._evtFocusOut(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(e){this.isAttached&&this._focusItemAt(0)}onResize(e){this.update(),super.onResize(e)}onUpdateRequest(e){var t;let n=this._menus,i=this.renderer,r=this._activeIndex,s=this._tabFocusIndex>=0&&this._tabFocusIndex-1?this._overflowIndex:n.length,a=0,l=!1;o=null!==this._overflowMenu?o-1:o;let u=new Array(o);for(let e=0;e{this._tabFocusIndex=e,this.activeIndex=e}}),a+=this._menuItemSizes[e],n[e].title.label===this._overflowMenuOptions.title&&(l=!0,o--);if(this._overflowMenuOptions.isVisible)if(this._overflowIndex>-1&&!l){if(null===this._overflowMenu){const e=null!==(t=this._overflowMenuOptions.title)&&void 0!==t?t:"...";this._overflowMenu=new ue({commands:new D.CommandRegistry}),this._overflowMenu.title.label=e,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let e=n.length-2;e>=o;e--){const t=this.menus[e];t.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:t}),this.removeMenu(t,!1)}u[o]=i.renderItem({title:this._overflowMenu.title,active:o===r&&0!==n[o].items.length,tabbable:o===s,disabled:0===n[o].items.length,onfocus:()=>{this._tabFocusIndex=o,this.activeIndex=o}}),o++}else if(null!==this._overflowMenu){let e=this._overflowMenu.items,t=this.node.offsetWidth,r=this._overflowMenu.items.length;for(let l=0;lthis._menuItemSizes[r]){let t=e[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(o,t,!1),u[o]=i.renderItem({title:t.title,active:!1,tabbable:o===s,disabled:0===n[o].items.length,onfocus:()=>{this._tabFocusIndex=o,this.activeIndex=o}}),o++}}0===this._overflowMenu.items.length&&(this.removeMenu(this._overflowMenu,!1),u.pop(),this._overflowMenu=null,this._overflowIndex=-1)}_.render(u,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;const e=this.contentNode.childNodes;let t=this.node.offsetWidth,n=0,i=-1,r=e.length;if(0==this._menuItemSizes.length)for(let s=0;st&&-1===i&&(i=s)}else for(let e=0;et){i=e;break}this._overflowIndex=i}_evtKeyDown(e){let t=e.keyCode;if(9===t)return void(this.activeIndex=-1);if(e.preventDefault(),e.stopPropagation(),13===t||32===t||38===t||40===t){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;return void this.openActiveMenu()}if(27===t)return this._closeChildMenu(),void this._focusItemAt(this.activeIndex);if(37===t||39===t){let e=37===t?-1:1,n=this._tabFocusIndex+e,i=this._menus.length;for(let t=0;tu.hitTest(t,e.clientX,e.clientY)));if(-1!==t){if(0===e.button)if(this._childMenu)this._closeChildMenu(),this.activeIndex=t;else{e.preventDefault();const n=this._positionForMenu(t);ue.saveWindowData(),this.activeIndex=t,this._openChildMenu(n)}}else this._closeChildMenu()}_evtMouseMove(e){let t=i.findFirstIndex(this.contentNode.children,(t=>u.hitTest(t,e.clientX,e.clientY)));if(t===this._activeIndex)return;if(-1===t&&this._childMenu)return;const n=t>=0&&this._childMenu?this._positionForMenu(t):null;ue.saveWindowData(),this.activeIndex=t,n&&this._openChildMenu(n)}_positionForMenu(e){let t=this.contentNode.children[e],{left:n,bottom:i}=t.getBoundingClientRect();return{top:i,left:n}}_evtFocusOut(e){this._childMenu||this.node.contains(e.relatedTarget)||(this.activeIndex=-1)}_focusItemAt(e){const t=this.contentNode.childNodes[e];t&&t.focus()}_openChildMenu(e={}){let t=this.activeMenu;if(!t)return void this._closeChildMenu();let n=this._childMenu;if(n===t)return;this._childMenu=t,n?n.close():document.addEventListener("mousedown",this,!0),this._tabFocusIndex=this.activeIndex,f.sendMessage(this,z.Msg.UpdateRequest);let{left:i,top:r}=e;void 0!==i&&void 0!==r||({left:i,top:r}=this._positionForMenu(this._activeIndex)),n||this.addClass("lm-mod-active"),t.items.length>0&&t.open(i,r,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0);let e=this._childMenu;this._childMenu=null,e.close(),this.activeIndex=-1}_onMenuAboutToClose(e){e===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(e,t){if(e!==this._childMenu)return;let n=this._activeIndex,i=this._menus.length;switch(t){case"next":this.activeIndex=n===i-1?0:n+1;break;case"previous":this.activeIndex=0===n?i-1:n-1}this.openActiveMenu()}_onTitleChanged(){this.update()}}!function(e){class t{renderItem(e){let t=this.createItemClass(e),n=this.createItemDataset(e),i=this.createItemARIA(e);return B.li({className:t,dataset:n,...e.disabled?{}:{tabindex:e.tabbable?"0":"-1"},onfocus:e.onfocus,...i},this.renderIcon(e),this.renderLabel(e))}renderIcon(e){let t=this.createIconClass(e);return B.div({className:t},e.title.icon,e.title.iconLabel)}renderLabel(e){let t=this.formatLabel(e);return B.div({className:"lm-MenuBar-itemLabel"},t)}createItemClass(e){let t="lm-MenuBar-item";return e.title.className&&(t+=` ${e.title.className}`),e.active&&!e.disabled&&(t+=" lm-mod-active"),t}createItemDataset(e){return e.title.dataset}createItemARIA(e){return{role:"menuitem","aria-haspopup":"true","aria-disabled":e.disabled?"true":"false"}}createIconClass(e){let t="lm-MenuBar-itemIcon",n=e.title.iconClass;return n?`${t} ${n}`:t}formatLabel(e){let{label:t,mnemonic:n}=e.title;if(n<0||n>=t.length)return t;let i=t.slice(0,n),r=t.slice(n+1),s=t[n];return[i,B.span({className:"lm-MenuBar-itemMnemonic"},s),r]}}e.Renderer=t,e.defaultRenderer=new t}(Ce||(Ce={})),function(e){e.createNode=function(){let e=document.createElement("div"),t=document.createElement("ul");return t.className="lm-MenuBar-content",e.appendChild(t),t.setAttribute("role","menubar"),e},e.findMnemonic=function(e,t,n){let i=-1,r=-1,s=!1,o=t.toUpperCase();for(let t=0,a=e.length;t=0&&d1&&this.widgets.forEach((e=>{e.hiddenMode=this._hiddenMode})))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(e,t){this._hiddenMode===z.HiddenMode.Scale&&this._items.length>0?(1===this._items.length&&(this.widgets[0].hiddenMode=z.HiddenMode.Scale),t.hiddenMode=z.HiddenMode.Scale):t.hiddenMode=z.HiddenMode.Display,i.insert(this._items,e,new H(t)),this.parent.isAttached&&f.sendMessage(t,z.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&f.sendMessage(t,z.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){i.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let n=i.removeAt(this._items,e);this.parent.isAttached&&f.sendMessage(t,z.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&f.sendMessage(t,z.Msg.AfterDetach),n.widget.node.style.zIndex="",this._hiddenMode===z.HiddenMode.Scale&&(t.hiddenMode=z.HiddenMode.Display,1===this._items.length&&(this._items[0].widget.hiddenMode=z.HiddenMode.Display)),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0,t=0;for(let n=0,i=this._items.length;n{var i,r,s;s="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g,i=[n(2562),n(4651),t],r=function(e,t,n){s.Backbone=function(e,t,n,i){var r=e.Backbone,s=Array.prototype.slice;t.VERSION="1.4.0",t.$=i,t.noConflict=function(){return e.Backbone=r,this},t.emulateHTTP=!1,t.emulateJSON=!1;var o,a=t.Events={},l=/\s+/,u=function(e,t,i,r,s){var o,a=0;if(i&&"object"==typeof i){void 0!==r&&"context"in s&&void 0===s.context&&(s.context=r);for(o=n.keys(i);athis.length&&(r=this.length),r<0&&(r+=this.length+1);var s,o,a=[],l=[],u=[],d=[],c={},h=t.add,p=t.merge,f=t.remove,g=!1,m=this.comparator&&null==r&&!1!==t.sort,v=n.isString(this.comparator)?this.comparator:null;for(o=0;o7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(U,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var i=document.body,r=i.insertBefore(this.iframe,i.firstChild).contentWindow;r.document.open(),r.document.close(),r.location.hash="#"+this.fragment}var s=window.addEventListener||function(e,t){return attachEvent("on"+e,t)};if(this._usePushState?s("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?s("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var e=window.removeEventListener||function(e,t){return detachEvent("on"+e,t)};this._usePushState?e("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&e("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),F.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();if(t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe.contentWindow)),t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(e){return!!this.matchRoot()&&(e=this.fragment=this.getFragment(e),n.some(this.handlers,(function(t){if(t.route.test(e))return t.callback(e),!0})))},navigate:function(e,t){if(!F.started)return!1;t&&!0!==t||(t={trigger:!!t}),e=this.getFragment(e||"");var n=this.root;""!==e&&"?"!==e.charAt(0)||(n=n.slice(0,-1)||"/");var i=n+e;e=e.replace(H,"");var r=this.decodeFragment(e);if(this.fragment!==r){if(this.fragment=r,this._usePushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);if(this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getHash(this.iframe.contentWindow)){var s=this.iframe.contentWindow;t.replace||(s.document.open(),s.document.close()),this._updateHash(s.location,e,t.replace)}}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,n){if(n){var i=e.href.replace(/(javascript:|#).*$/,"");e.replace(i+"#"+t)}else e.hash="#"+t}}),t.history=new F;v.extend=b.extend=I.extend=S.extend=F.extend=function(e,t){var i,r=this;return i=e&&n.has(e,"constructor")?e.constructor:function(){return r.apply(this,arguments)},n.extend(i,r,t),i.prototype=n.create(r.prototype,e),i.prototype.constructor=i,i.__super__=r.prototype,i};var W=function(){throw new Error('A "url" property or function must be specified')},q=function(e,t){var n=t.error;t.error=function(i){n&&n.call(t.context,e,i,t),e.trigger("error",e,i,t)}};return t}(s,n,e,t)}.apply(t,i),void 0===r||(e.exports=r)},7991:(e,t)=>{"use strict";t.bg=function(e){var t,n,s=function(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}(e),o=s[0],a=s[1],l=new r(function(e,t,n){return 3*(t+n)/4-n}(0,o,a)),u=0,d=a>0?o-4:o;for(n=0;n>16&255,l[u++]=t>>8&255,l[u++]=255&t;return 2===a&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,l[u++]=255&t),1===a&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t),l},t.iI=function(e){for(var t,i=e.length,r=i%3,s=[],o=16383,l=0,u=i-r;lu?u:l+o));return 1===r?(t=e[i-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),s.join("")};for(var n=[],i=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=s[o],i[s.charCodeAt(o)]=o;function a(e,t,i){for(var r,s,o=[],a=t;a>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},1050:(e,t,n)=>{!function(e){"use strict";function t(t,n){clearTimeout(n.timeout),e.off(window,"mouseup",n.hurry),e.off(window,"keyup",n.hurry)}e.defineOption("autoRefresh",!1,(function(n,i){n.state.autoRefresh&&(t(0,n.state.autoRefresh),n.state.autoRefresh=null),i&&0==n.display.wrapper.offsetHeight&&function(n,i){function r(){n.display.wrapper.offsetHeight?(t(0,i),n.display.lastWrapHeight!=n.display.wrapper.clientHeight&&n.refresh()):i.timeout=setTimeout(r,i.delay)}i.timeout=setTimeout(r,i.delay),i.hurry=function(){clearTimeout(i.timeout),i.timeout=setTimeout(r,50)},e.on(window,"mouseup",i.hurry),e.on(window,"keyup",i.hurry)}(n,n.state.autoRefresh={delay:i.delay||250})}))}(n(1448))},7122:(e,t,n)=>{!function(e){"use strict";var t="CodeMirror-hint-active";function n(e,t){if(this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}}e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var i={hint:t};if(n)for(var r in n)i[r]=n[r];return e.showHint(i)},e.defineExtension("showHint",(function(t){t=function(e,t,n){var i=e.options.hintOptions,r={};for(var s in u)r[s]=u[s];if(i)for(var s in i)void 0!==i[s]&&(r[s]=i[s]);if(n)for(var s in n)void 0!==n[s]&&(r[s]=n[s]);return r.hint.resolve&&(r.hint=r.hint.resolve(e,t)),r}(this,this.getCursor("start"),t);var i=this.listSelections();if(!(i.length>1)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var r=0;rd.clientHeight+1;if(setTimeout((function(){B=a.getScrollInfo()})),k.bottom-T>0){var j=k.bottom-k.top;if(b.top-(b.bottom-k.top)-j>0)d.style.top=(y=b.top-j-E)+"px",w=!1;else if(j>T){d.style.height=T-5+"px",d.style.top=(y=b.bottom-k.top-E)+"px";var O=a.getCursor();i.from.ch!=O.ch&&(b=a.cursorCoords(O),d.style.left=(A=b.left-_)+"px",k=d.getBoundingClientRect())}}var I,P=k.right-S;if(M&&(P+=a.display.nativeBarWidth),P>0&&(k.right-k.left>S&&(d.style.width=S-5+"px",P-=k.right-k.left-S),d.style.left=(A=b.left-P-_)+"px"),M)for(var R=d.firstChild;R;R=R.nextSibling)R.style.paddingRight=a.display.nativeBarWidth+"px";a.addKeyMap(this.keyMap=function(e,t){var n={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(1-t.menuSize(),!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close};/Mac/.test(navigator.platform)&&(n["Ctrl-P"]=function(){t.moveFocus(-1)},n["Ctrl-N"]=function(){t.moveFocus(1)});var i=e.options.customKeys,r=i?{}:n;function s(e,i){var s;s="string"!=typeof i?function(e){return i(e,t)}:n.hasOwnProperty(i)?n[i]:i,r[e]=s}if(i)for(var o in i)i.hasOwnProperty(o)&&s(o,i[o]);var a=e.options.extraKeys;if(a)for(var o in a)a.hasOwnProperty(o)&&s(o,a[o]);return r}(n,{moveFocus:function(e,t){r.changeActive(r.selectedHint+e,t)},setFocus:function(e){r.changeActive(e)},menuSize:function(){return r.screenAmount()},length:h.length,close:function(){n.close()},pick:function(){r.pick()},data:i})),n.options.closeOnUnfocus&&(a.on("blur",this.onBlur=function(){I=setTimeout((function(){n.close()}),100)}),a.on("focus",this.onFocus=function(){clearTimeout(I)})),a.on("scroll",this.onScroll=function(){var e=a.getScrollInfo(),t=a.getWrapperElement().getBoundingClientRect();B||(B=a.getScrollInfo());var i=y+B.top-e.top,r=i-(u.pageYOffset||(l.documentElement||l.body).scrollTop);if(w||(r+=d.offsetHeight),r<=t.top||r>=t.bottom)return n.close();d.style.top=i+"px",d.style.left=A+B.left-e.left+"px"}),e.on(d,"dblclick",(function(e){var t=o(d,e.target||e.srcElement);t&&null!=t.hintId&&(r.changeActive(t.hintId),r.pick())})),e.on(d,"click",(function(e){var t=o(d,e.target||e.srcElement);t&&null!=t.hintId&&(r.changeActive(t.hintId),n.options.completeOnSingleClick&&r.pick())})),e.on(d,"mousedown",(function(){setTimeout((function(){a.focus()}),20)}));var L=this.getSelectedHintRange();return 0===L.from&&0===L.to||this.scrollToActive(),e.signal(i,"select",h[this.selectedHint],d.childNodes[this.selectedHint]),!0}function l(e,t,n,i){if(e.async)e(t,i,n);else{var r=e(t,n);r&&r.then?r.then(i):i(r)}}n.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var i=t.list[n],r=this;this.cm.operation((function(){i.hint?i.hint(r.cm,t,i):r.cm.replaceRange(s(i),i.from||t.from,i.to||t.to,"complete"),e.signal(t,"pick",i),r.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(r(this.debounce),this.debounce=0);var e=this.startPos;this.data&&(e=this.data.from);var t=this.cm.getCursor(),n=this.cm.getLine(t.line);if(t.line!=this.startPos.line||n.length-t.ch!=this.startLen-this.startPos.ch||t.ch=this.data.list.length?n=i?this.data.list.length-1:0:n<0&&(n=i?0:this.data.list.length-1),this.selectedHint!=n){var r=this.hints.childNodes[this.selectedHint];r&&(r.className=r.className.replace(" "+t,"")),(r=this.hints.childNodes[this.selectedHint=n]).className+=" "+t,this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],r)}},scrollToActive:function(){var e=this.getSelectedHintRange(),t=this.hints.childNodes[e.from],n=this.hints.childNodes[e.to],i=this.hints.firstChild;t.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+i.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}},e.registerHelper("hint","auto",{resolve:function(t,n){var i,r=t.getHelpers(n,"hint");if(r.length){var s=function(e,t,n){var i=function(e,t){if(!e.somethingSelected())return t;for(var n=[],i=0;i0?t(e):r(s+1)}))}(0)};return s.async=!0,s.supportsSelection=!0,s}return(i=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:i})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}}),e.registerHelper("hint","fromList",(function(t,n){var i,r=t.getCursor(),s=t.getTokenAt(r),o=e.Pos(r.line,s.start),a=r;s.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)}(n(1448))},1448:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),i=/MSIE \d/.test(e),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),s=/Edge\/(\d+)/.exec(e),o=i||r||s,a=o&&(i?document.documentMode||6:+(s||r)[1]),l=!s&&/WebKit\//.test(e),u=l&&/Qt\/\d+\.\d+/.test(e),d=!s&&/Chrome\//.test(e),c=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),f=/PhantomJS/.test(e),g=h&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),m=/Android/.test(e),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=g||/Mac/.test(t),A=/\bCrOS\b/.test(e),y=/win/i.test(t),w=c&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(c=!1,l=!0);var _=b&&(u||c&&(null==w||w<12.11)),E=n||o&&a>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var x,D=function(e,t){var n=e.className,i=C(t).exec(n);if(i){var r=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function S(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return S(e).appendChild(t)}function B(e,t,n,i){var r=document.createElement(e);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof t)r.appendChild(document.createTextNode(t));else if(t)for(var s=0;s=t)return o+(t-s);o+=a-s,o+=n-o%n,s=a+1}}g?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:o&&(P=function(e){try{e.select()}catch(e){}});var F=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function z(e,t){for(var n=0;n=t)return i+Math.min(o,t-r);if(r+=s-i,i=s+1,(r+=n-r%n)>=t)return i}}var G=[""];function K(e){for(;G.length<=e;)G.push(Y(G)+" ");return G[e]}function Y(e){return e[e.length-1]}function J(e,t){for(var n=[],i=0;i"€"&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function re(e){return e.charCodeAt(0)>=768&&ie.test(e)}function se(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var r=(t+n)/2,s=i<0?Math.ceil(r):Math.floor(r);if(s==t)return e(s)?t:n;e(s)?n=s:t=s+i}}var ae=null;function le(e,t,n){var i;ae=null;for(var r=0;rt)return r;s.to==t&&(s.from!=s.to&&"before"==n?i=r:ae=r),s.from==t&&(s.from!=s.to&&"before"!=n?i=r:ae=r)}return null!=i?i:ae}var ue=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,i=/[Lb1n]/,r=/[1n]/;function s(e,t,n){this.level=e,this.from=t,this.to=n}return function(o,a){var l,u="ltr"==a?"L":"R";if(0==o.length||"ltr"==a&&!e.test(o))return!1;for(var d=o.length,c=[],h=0;h-1&&(i[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function ge(e,t){var n=pe(e,t);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r0}function Ae(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){fe(this,e,t)}}function ye(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function we(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function _e(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ee(e){ye(e),we(e)}function Ce(e){return e.target||e.srcElement}function xe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var De,Se,Te=function(){if(o&&a<9)return!1;var e=B("div");return"draggable"in e||"dragDrop"in e}();function Be(e){if(null==De){var t=B("span","​");T(e,B("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(De=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&a<8))}var n=De?B("span","​"):B("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function ke(e){if(null!=Se)return Se;var t=T(e,document.createTextNode("AخA")),n=x(t,0,1).getBoundingClientRect(),i=x(t,1,2).getBoundingClientRect();return S(e),!(!n||n.left==n.right)&&(Se=i.right-n.right<3)}var Me,je=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],i=e.length;t<=i;){var r=e.indexOf("\n",t);-1==r&&(r=e.length);var s=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),o=s.indexOf("\r");-1!=o?(n.push(s.slice(0,o)),t+=o+1):(n.push(s),t=r+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Oe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ie="oncopy"in(Me=B("div"))||(Me.setAttribute("oncopy","return;"),"function"==typeof Me.oncopy),Pe=null;var Re={},Le={};function Ne(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Re[e]=t}function Fe(e){if("string"==typeof e&&Le.hasOwnProperty(e))e=Le[e];else if(e&&"string"==typeof e.name&&Le.hasOwnProperty(e.name)){var t=Le[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Fe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Fe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function ze(e,t){t=Fe(t);var n=Re[t.name];if(!n)return ze(e,"text/plain");var i=n(e,t);if(Ue.hasOwnProperty(t.name)){var r=Ue[t.name];for(var s in r)r.hasOwnProperty(s)&&(i.hasOwnProperty(s)&&(i["_"+s]=i[s]),i[s]=r[s])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)i[o]=t.modeProps[o];return i}var Ue={};function He(e,t){L(t,Ue.hasOwnProperty(e)?Ue[e]:Ue[e]={})}function We(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function qe(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function $e(e,t,n){return!e.startState||e.startState(t,n)}var Ve=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ge(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],s=r.chunkSize();if(t=e.first&&tn?tt(n,Ge(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?tt(e.line,t):n<0?tt(e.line,0):e}(t,Ge(e,t.line).text.length)}function ut(e,t){for(var n=[],i=0;i=this.string.length},Ve.prototype.sol=function(){return this.pos==this.lineStart},Ve.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ve.prototype.next=function(){if(this.post},Ve.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ve.prototype.skipToEnd=function(){this.pos=this.string.length},Ve.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ve.prototype.backUp=function(e){this.pos-=e},Ve.prototype.column=function(){return this.lastColumnPos0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var r=function(e){return n?e.toLowerCase():e};if(r(this.string.substr(this.pos,e.length))==r(e))return!1!==t&&(this.pos+=e.length),!0},Ve.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ve.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ve.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ve.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var dt=function(e,t){this.state=e,this.lookAhead=t},ct=function(e,t,n,i){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function ht(e,t,n,i){var r=[e.state.modeGen],s={};wt(e,t.text,e.doc.mode,n,(function(e,t){return r.push(e,t)}),s,i);for(var o=n.state,a=function(i){n.baseTokens=r;var a=e.state.overlays[i],l=1,u=0;n.state=!0,wt(e,t.text,a.mode,n,(function(e,t){for(var n=l;ue&&r.splice(l,1,e,r[l+1],i),l+=2,u=Math.min(e,i)}if(t)if(a.opaque)r.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&We(e.doc.mode,i.state),s=ht(e,t,i);r&&(i.state=r),t.stateAfter=i.save(!r),t.styles=s.styles,s.classes?t.styleClasses=s.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ft(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return new ct(i,!0,t);var s=function(e,t,n){for(var i,r,s=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>o;--a){if(a<=s.first)return s.first;var l=Ge(s,a-1),u=l.stateAfter;if(u&&(!n||a+(u instanceof dt?u.lookAhead:0)<=s.modeFrontier))return a;var d=N(l.text,null,e.options.tabSize);(null==r||i>d)&&(r=a-1,i=d)}return r}(e,t,n),o=s>i.first&&Ge(i,s-1).stateAfter,a=o?ct.fromSaved(i,o,s):new ct(i,$e(i.mode),s);return i.iter(s,t,(function(n){gt(e,n.text,a);var i=a.line;n.stateAfter=i==t-1||i%5==0||i>=r.viewFrom&&it.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}ct.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ct.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ct.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ct.fromSaved=function(e,t,n){return t instanceof dt?new ct(e,We(e.mode,t.state),n,t.lookAhead):new ct(e,We(e.mode,t),n)},ct.prototype.save=function(e){var t=!1!==e?We(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new dt(t,this.maxLookAhead):t};var bt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function At(e,t,n,i){var r,s,o=e.doc,a=o.mode,l=Ge(o,(t=lt(o,t)).line),u=ft(e,t.line,n),d=new Ve(l.text,e.options.tabSize,u);for(i&&(s=[]);(i||d.pose.options.maxHighlightLength?(a=!1,o&>(e,t,i,c.pos),c.pos=t.length,l=null):l=yt(vt(n,c,i.state,h),s),h){var p=h[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!a||d!=l){for(;u=t:s.to>t);(i||(i=[])).push(new Ct(o,s.from,a?null:s.to))}}return i}(n,r,o),l=function(e,t,n){var i;if(e)for(var r=0;r=t:s.to>t)||s.from==t&&"bookmark"==o.type&&(!n||s.marker.insertLeft)){var a=null==s.from||(o.inclusiveLeft?s.from<=t:s.from0&&a)for(var A=0;At)&&(!n||Ot(n,s.marker)<0)&&(n=s.marker)}return n}function Nt(e,t,n,i,r){var s=Ge(e,t),o=Et&&s.markedSpans;if(o)for(var a=0;a=0&&c<=0||d<=0&&c>=0)&&(d<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?nt(u.to,n)>=0:nt(u.to,n)>0)||d>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?nt(u.from,i)<=0:nt(u.from,i)<0)))return!0}}}function Ft(e){for(var t;t=Pt(e);)e=t.find(-1,!0).line;return e}function zt(e,t){var n=Ge(e,t),i=Ft(n);return n==i?t:Xe(i)}function Ut(e,t){if(t>e.lastLine())return t;var n,i=Ge(e,t);if(!Ht(e,i))return t;for(;n=Rt(i);)i=n.find(1,!0).line;return Xe(i)+1}function Ht(e,t){var n=Et&&t.markedSpans;if(n)for(var i=void 0,r=0;rt.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Gt=function(e,t,n){this.text=e,kt(this,t),this.height=n?n(this):1};function Kt(e){e.parent=null,Bt(e)}Gt.prototype.lineNo=function(){return Xe(this)},Ae(Gt);var Yt={},Jt={};function Xt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Jt:Yt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var n=k("span",null,null,l?"padding-right: .1px":null),i={pre:k("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var s=r?t.rest[r-1]:t.line,o=void 0;i.pos=0,i.addToken=en,ke(e.display.measure)&&(o=de(s,e.doc.direction))&&(i.addToken=tn(i.addToken,o)),i.map=[],rn(s,i,pt(e,s,t!=e.display.externalMeasured&&Xe(s))),s.styleClasses&&(s.styleClasses.bgClass&&(i.bgClass=I(s.styleClasses.bgClass,i.bgClass||"")),s.styleClasses.textClass&&(i.textClass=I(s.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Be(e.display.measure))),0==r?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var a=i.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return ge(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=I(i.pre.className,i.textClass||"")),i}function Qt(e){var t=B("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function en(e,t,n,i,r,s,l){if(t){var u,d=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",r=0;ru&&c.from<=u);h++);if(c.to>=d)return e(n,i,r,s,o,a,l);e(n,i.slice(0,c.to-u),r,s,null,a,l),s=null,i=i.slice(c.to-u),u=c.to}}}function nn(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!i&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function rn(e,t,n){var i=e.markedSpans,r=e.text,s=0;if(i)for(var o,a,l,u,d,c,h,p=r.length,f=0,g=1,m="",v=0;;){if(v==f){l=u=d=a="",h=null,c=null,v=1/0;for(var b=[],A=void 0,y=0;yf||_.collapsed&&w.to==f&&w.from==f)){if(null!=w.to&&w.to!=f&&v>w.to&&(v=w.to,u=""),_.className&&(l+=" "+_.className),_.css&&(a=(a?a+";":"")+_.css),_.startStyle&&w.from==f&&(d+=" "+_.startStyle),_.endStyle&&w.to==v&&(A||(A=[])).push(_.endStyle,w.to),_.title&&((h||(h={})).title=_.title),_.attributes)for(var E in _.attributes)(h||(h={}))[E]=_.attributes[E];_.collapsed&&(!c||Ot(c.marker,_)<0)&&(c=w)}else w.from>f&&v>w.from&&(v=w.from)}if(A)for(var C=0;C=p)break;for(var D=Math.min(p,v);;){if(m){var S=f+m.length;if(!c){var T=S>D?m.slice(0,D-f):m;t.addToken(t,T,o?o+l:l,d,f+T.length==v?u:"",a,h)}if(S>=D){m=m.slice(D-f),f=D;break}f=S,d=""}m=r.slice(s,s=n[g++]),o=Xt(n[g++],t.cm.options)}}else for(var B=1;Bn)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Mn(e,t,n,i){return In(e,On(e,t),n,i)}function jn(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&s.push((l.bottom+u.top)/2-n.top)}}s.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(s=function(e,t,n,i){var r,s=Ln(t.map,n,i),l=s.node,u=s.start,d=s.end,c=s.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;u&&re(t.line.text.charAt(s.coverStart+u));)--u;for(;s.coverStart+d1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}(e.display.measure,r))}else{var p;u>0&&(c=i="right"),r=e.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==i?p.length-1:0]:l.getBoundingClientRect()}if(o&&a<9&&!u&&(!r||!r.left&&!r.right)){var f=l.parentNode.getClientRects()[0];r=f?{left:f.left,right:f.left+si(e.display),top:f.top,bottom:f.bottom}:Rn}for(var g=r.top-t.rect.top,m=r.bottom-t.rect.top,v=(g+m)/2,b=t.view.measure.heights,A=0;At)&&(r=(s=l-a)-1,t>=l&&(o="right")),null!=r){if(i=e[u+2],a==l&&n==(i.insertLeft?"left":"right")&&(o=n),"left"==n&&0==r)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)i=e[2+(u-=3)],o="left";if("right"==n&&r==l-a)for(;u=0&&(n=e[r]).left==n.right;r--);return n}function Fn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=i.text.length?(l=i.text.length,u="before"):l<=0&&(l=0,u="after"),!a)return o("before"==u?l-1:l,"before"==u);function d(e,t,n){return o(n?e-1:e,1==a[t].level!=n)}var c=le(a,l,u),h=ae,p=d(l,c,"before"==u);return null!=h&&(p.other=d(l,h,"before"!=u)),p}function Yn(e,t){var n=0;t=lt(e.doc,t),e.options.lineWrapping||(n=si(e.display)*t.ch);var i=Ge(e.doc,t.line),r=qt(i)+Cn(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function Jn(e,t,n,i,r){var s=tt(e,t,n);return s.xRel=r,i&&(s.outside=i),s}function Xn(e,t,n){var i=e.doc;if((n+=e.display.viewOffset)<0)return Jn(i.first,0,null,-1,-1);var r=Ze(i,n),s=i.first+i.size-1;if(r>s)return Jn(i.first+i.size-1,Ge(i,s).text.length,null,1,1);t<0&&(t=0);for(var o=Ge(i,r);;){var a=ti(e,o,r,t,n),l=Lt(o,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var u=l.find(1);if(u.line==r)return u;o=Ge(i,r=u.line)}}function Zn(e,t,n,i){i-=qn(t);var r=t.text.length,s=oe((function(t){return In(e,n,t-1).bottom<=i}),r,0);return{begin:s,end:r=oe((function(t){return In(e,n,t).top>i}),s,r)}}function Qn(e,t,n,i){return n||(n=On(e,t)),Zn(e,t,n,$n(e,t,In(e,n,i),"line").top)}function ei(e,t,n,i){return!(e.bottom<=n)&&(e.top>n||(i?e.left:e.right)>t)}function ti(e,t,n,i,r){r-=qt(t);var s=On(e,t),o=qn(t),a=0,l=t.text.length,u=!0,d=de(t,e.doc.direction);if(d){var c=(e.options.lineWrapping?ii:ni)(e,t,n,s,d,i,r);a=(u=1!=c.level)?c.from:c.to-1,l=u?c.to:c.from-1}var h,p,f=null,g=null,m=oe((function(t){var n=In(e,s,t);return n.top+=o,n.bottom+=o,!!ei(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(f=t,g=n),!0)}),a,l),v=!1;if(g){var b=i-g.left=y.bottom?1:0}return Jn(n,m=se(t.text,m,1),p,v,i-h)}function ni(e,t,n,i,r,s,o){var a=oe((function(a){var l=r[a],u=1!=l.level;return ei(Kn(e,tt(n,u?l.to:l.from,u?"before":"after"),"line",t,i),s,o,!0)}),0,r.length-1),l=r[a];if(a>0){var u=1!=l.level,d=Kn(e,tt(n,u?l.from:l.to,u?"after":"before"),"line",t,i);ei(d,s,o,!0)&&d.top>o&&(l=r[a-1])}return l}function ii(e,t,n,i,r,s,o){var a=Zn(e,t,i,o),l=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var d=null,c=null,h=0;h=u||p.to<=l)){var f=In(e,i,1!=p.level?Math.min(u,p.to)-1:Math.max(l,p.from)).right,g=fg)&&(d=p,c=g)}}return d||(d=r[r.length-1]),d.fromu&&(d={from:d.from,to:u,level:d.level}),d}function ri(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Pn){Pn=B("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Pn.appendChild(document.createTextNode("x")),Pn.appendChild(B("br"));Pn.appendChild(document.createTextNode("x"))}T(e.measure,Pn);var n=Pn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),S(e.measure),n||1}function si(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=B("span","xxxxxxxxxx"),n=B("pre",[t],"CodeMirror-line-like");T(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function oi(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,s=t.gutters.firstChild,o=0;s;s=s.nextSibling,++o){var a=e.display.gutterSpecs[o].className;n[a]=s.offsetLeft+s.clientLeft+r,i[a]=s.clientWidth}return{fixedPos:ai(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function ai(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function li(e){var t=ri(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/si(e.display)-3);return function(r){if(Ht(e.doc,r))return 0;var s=0;if(r.widgets)for(var o=0;o0&&(l=Ge(e.doc,u.line).text).length==u.ch){var d=N(l,l.length,e.options.tabSize)-l.length;u=tt(u.line,Math.max(0,Math.round((s-Dn(e.display).left)/si(e.display))-d))}return u}function ci(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,i=0;it)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Et&&zt(e.doc,t)r.viewFrom?fi(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)fi(e);else if(t<=r.viewFrom){var s=gi(e,n,n+i,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=i):fi(e)}else if(n>=r.viewTo){var o=gi(e,t,t,-1);o?(r.view=r.view.slice(0,o.index),r.viewTo=o.lineN):fi(e)}else{var a=gi(e,t,t,-1),l=gi(e,n,n+i,1);a&&l?(r.view=r.view.slice(0,a.index).concat(on(e,a.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):fi(e)}var u=r.externalMeasured;u&&(n=r.lineN&&t=i.viewTo)){var s=i.view[ci(e,t)];if(null!=s.node){var o=s.changes||(s.changes=[]);-1==z(o,n)&&o.push(n)}}}function fi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function gi(e,t,n,i){var r,s=ci(e,t),o=e.display.view;if(!Et||n==e.doc.first+e.doc.size)return{index:s,lineN:n};for(var a=e.display.viewFrom,l=0;l0){if(s==o.length-1)return null;r=a+o[s].size-t,s++}else r=a-t;t+=r,n+=r}for(;zt(e.doc,n)!=n;){if(s==(i<0?0:o.length-1))return null;n+=i*o[s-(i<0?1:0)].size,s+=i}return{index:s,lineN:n}}function mi(e){for(var t=e.display.view,n=0,i=0;i=e.display.viewTo||a.to().linet||t==n&&o.to==t)&&(i(Math.max(o.from,t),Math.min(o.to,n),1==o.level?"rtl":"ltr",s),r=!0)}r||i(t,n,"ltr")}(g,n||0,null==i?h:i,(function(e,t,r,c){var m="ltr"==r,v=p(e,m?"left":"right"),b=p(t-1,m?"right":"left"),A=null==n&&0==e,y=null==i&&t==h,w=0==c,_=!g||c==g.length-1;if(b.top-v.top<=3){var E=(u?y:A)&&_,C=(u?A:y)&&w?a:(m?v:b).left,x=E?l:(m?b:v).right;d(C,v.top,x-C,v.bottom)}else{var D,S,T,B;m?(D=u&&A&&w?a:v.left,S=u?l:f(e,r,"before"),T=u?a:f(t,r,"after"),B=u&&y&&_?l:b.right):(D=u?f(e,r,"before"):a,S=!u&&A&&w?l:v.right,T=!u&&y&&_?a:b.left,B=u?f(t,r,"after"):l),d(D,v.top,S-D,v.bottom),v.bottom0?t.blinker=setInterval((function(){e.hasFocus()||Di(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Ei(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||xi(e))}function Ci(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Di(e))}),100)}function xi(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ge(e,"focus",e,t),e.state.focused=!0,O(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),_i(e))}function Di(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ge(e,"blur",e,t),e.state.focused=!1,D(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Si(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i.005||h<-.005)&&(Je(r.line,l),Ti(r.line),r.rest))for(var p=0;pe.display.sizerWidth){var f=Math.ceil(u/si(e.display));f>e.display.maxLineLength&&(e.display.maxLineLength=f,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}}function Ti(e){if(e.widgets)for(var t=0;t=o&&(s=Ze(t,qt(Ge(t,l))-e.wrapper.clientHeight),o=l)}return{from:s,to:Math.max(o,s+1)}}function ki(e,t){var n=e.display,i=ri(e.display);t.top<0&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,s=Bn(e),o={};t.bottom-t.top>s&&(t.bottom=t.top+s);var a=e.doc.height+xn(n),l=t.topa-i;if(t.topr+s){var d=Math.min(t.top,(u?a:t.bottom)-s);d!=r&&(o.scrollTop=d)}var c=e.options.fixedGutter?0:n.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-c,p=Tn(e)-n.gutters.offsetWidth,f=t.right-t.left>p;return f&&(t.right=t.left+p),t.left<10?o.scrollLeft=0:t.leftp+h-3&&(o.scrollLeft=t.right+(f?0:10)-p),o}function Mi(e,t){null!=t&&(Ii(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function ji(e){Ii(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Oi(e,t,n){null==t&&null==n||Ii(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Ii(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Pi(e,Yn(e,t.from),Yn(e,t.to),t.margin))}function Pi(e,t,n,i){var r=ki(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});Oi(e,r.scrollLeft,r.scrollTop)}function Ri(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||ur(e,{top:t}),Li(e,t,!0),n&&ur(e),rr(e,100))}function Li(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Ni(e,t,n,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i||(e.doc.scrollLeft=t,hr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Fi(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+xn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var zi=function(e,t,n){this.cm=n;var i=this.vert=B("div",[B("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=B("div",[B("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,e(i),e(r),he(i,"scroll",(function(){i.clientHeight&&t(i.scrollTop,"vertical")})),he(r,"scroll",(function(){r.clientWidth&&t(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,o&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var r=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+s)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},zi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zi.prototype.zeroWidthHack=function(){var e=b&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new F,this.disableVert=new F},zi.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function i(){var r=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,i)}))},zi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ui=function(){};function Hi(e,t){t||(t=Fi(e));var n=e.display.barWidth,i=e.display.barHeight;Wi(e,t);for(var r=0;r<4&&n!=e.display.barWidth||i!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&Si(e),Wi(e,Fi(e)),n=e.display.barWidth,i=e.display.barHeight}function Wi(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Ui.prototype.update=function(){return{bottom:0,right:0}},Ui.prototype.setScrollLeft=function(){},Ui.prototype.setScrollTop=function(){},Ui.prototype.clear=function(){};var qi={native:zi,null:Ui};function $i(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&D(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new qi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Ni(e,t):Ri(e,t)}),e),e.display.scrollbars.addClass&&O(e.display.wrapper,e.display.scrollbars.addClass)}var Vi=0;function Gi(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Vi,markArrays:null},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function Ki(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new or(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ji(e){e.updatedDisplay=e.mustUpdate&&ar(e.cm,e.update)}function Xi(e){var t=e.cm,n=t.display;e.updatedDisplay&&Si(t),e.barMeasure=Fi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Mn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Tn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Zi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!f){var s=B("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Cn(e.display))+"px;\n height: "+(t.bottom-t.top+Sn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(r),e.display.lineSpace.removeChild(s)}}}(t,function(e,t,n,i){var r;null==i&&(i=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?tt(t.line,t.ch+1,"before"):t,t=t.ch?tt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var s=0;s<5;s++){var o=!1,a=Kn(e,t),l=n&&n!=t?Kn(e,n):a,u=ki(e,r={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-i,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+i}),d=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=u.scrollTop&&(Ri(e,u.scrollTop),Math.abs(e.doc.scrollTop-d)>1&&(o=!0)),null!=u.scrollLeft&&(Ni(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return r}(t,lt(i,e.scrollToPos.from),lt(i,e.scrollToPos.to),e.scrollToPos.margin));var r=e.maybeHiddenMarkers,s=e.maybeUnhiddenMarkers;if(r)for(var o=0;o=e.display.viewTo)){var n=+new Date+e.options.workTime,i=ft(e,t.highlightFrontier),r=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(s){if(i.line>=e.display.viewFrom){var o=s.styles,a=s.text.length>e.options.maxHighlightLength?We(t.mode,i.state):null,l=ht(e,s,i,!0);a&&(i.state=a),s.styles=l.styles;var u=s.styleClasses,d=l.classes;d?s.styleClasses=d:u&&(s.styleClasses=null);for(var c=!o||o.length!=s.styles.length||u!=d&&(!u||!d||u.bgClass!=d.bgClass||u.textClass!=d.textClass),h=0;!c&&hn)return rr(e,e.options.workDelay),!0})),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),r.length&&er(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mi(e))return!1;pr(e)&&(fi(e),t.dims=oi(e));var r=i.first+i.size,s=Math.max(t.visible.from-e.options.viewportMargin,i.first),o=Math.min(r,t.visible.to+e.options.viewportMargin);n.viewFromo&&n.viewTo-o<20&&(o=Math.min(r,n.viewTo)),Et&&(s=zt(e.doc,s),o=Ut(e.doc,o));var a=s!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;(function(e,t,n){var i=e.display;0==i.view.length||t>=i.viewTo||n<=i.viewFrom?(i.view=on(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=on(e,t,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,ci(e,n)))),i.viewTo=n})(e,s,o),n.viewOffset=qt(Ge(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=mi(e);if(!a&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var d=function(e){if(e.hasFocus())return null;var t=j();if(!t||!M(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&M(e.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}(e);return u>4&&(n.lineDiv.style.display="none"),function(e,t,n){var i=e.display,r=e.options.lineNumbers,s=i.lineDiv,o=s.firstChild;function a(t){var n=t.nextSibling;return l&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=i.view,d=i.viewFrom,c=0;c-1&&(p=!1),cn(e,h,d,n)),p&&(S(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(et(e.options,d)))),o=h.node.nextSibling}else{var f=bn(e,h,d,n);s.insertBefore(f,o)}d+=h.size}for(;o;)o=a(o)}(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=j()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&M(document.body,e.anchorNode)&&M(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(d),S(n.cursorDiv),S(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,rr(e,400)),n.updateLineNumbers=null,!0}function lr(e,t){for(var n=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Tn(e))i&&(t.visible=Bi(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+xn(e.display)-Bn(e),n.top)}),t.visible=Bi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ar(e,t))break;Si(e);var r=Fi(e);vi(e),Hi(e,r),cr(e,r),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ur(e,t){var n=new or(e,t);if(ar(e,n)){Si(e),lr(e,n);var i=Fi(e);vi(e),Hi(e,i),cr(e,i),n.finish()}}function dr(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",un(e,"gutterChanged",e)}function cr(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Sn(e)+"px"}function hr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=ai(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=i+"px",o=0;oa.clientWidth,d=a.scrollHeight>a.clientHeight;if(r&&u||s&&d){if(s&&b&&l)e:for(var h=t.target,p=o.view;h!=a;h=h.parentNode)for(var f=0;f=0&&nt(e,i.to())<=0)return n}return-1};var Cr=function(e,t){this.anchor=e,this.head=t};function xr(e,t,n){var i=e&&e.options.selectionsMayTouch,r=t[n];t.sort((function(e,t){return nt(e.from(),t.from())})),n=z(t,r);for(var s=1;s0:l>=0){var u=ot(a.from(),o.from()),d=st(a.to(),o.to()),c=a.empty()?o.from()==o.head:a.from()==a.head;s<=n&&--n,t.splice(--s,2,new Cr(c?d:u,c?u:d))}}return new Er(t,n)}function Dr(e,t){return new Er([new Cr(e,t||e)],0)}function Sr(e){return e.text?tt(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Tr(e,t){if(nt(e,t.from)<0)return e;if(nt(e,t.to)<=0)return Sr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Sr(t).ch-t.to.ch),tt(n,i)}function Br(e,t){for(var n=[],i=0;i1&&e.remove(a.line+1,f-1),e.insert(a.line+1,v)}un(e,"change",e,t)}function Pr(e,t,n){!function e(i,r,s){if(i.linked)for(var o=0;oa-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(s=function(e,t){return t?(zr(e.done),Y(e.done)):e.done.length&&!Y(e.done).ranges?Y(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}(r,r.lastOp==i)))o=Y(s.changes),0==nt(t.from,t.to)&&0==nt(t.from,o.to)?o.to=Sr(t):s.changes.push(Fr(e,t));else{var l=Y(r.done);for(l&&l.ranges||Wr(e.sel,r.done),s={changes:[Fr(e,t)],generation:r.generation},r.done.push(s);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=t.origin,o||ge(e,"historyAdded")}function Hr(e,t,n,i){var r=e.history,s=i&&i.origin;n==r.lastSelOp||s&&r.lastSelOrigin==s&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==s||function(e,t,n,i){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,s,Y(r.done),t))?r.done[r.done.length-1]=t:Wr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=n,i&&!1!==i.clearRedo&&zr(r.undone)}function Wr(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function qr(e,t,n,i){var r=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),(function(n){n.markedSpans&&((r||(r=t["spans_"+e.id]={}))[s]=n.markedSpans),++s}))}function $r(e){if(!e)return null;for(var t,n=0;n-1&&(Y(a)[c]=u[c],delete u[c])}}}return i}function Kr(e,t,n,i){if(i){var r=e.anchor;if(n){var s=nt(t,r)<0;s!=nt(n,r)<0?(r=t,t=n):s!=nt(t,n)<0&&(t=n)}return new Cr(r,t)}return new Cr(n||t,t)}function Yr(e,t,n,i,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),es(e,new Er([Kr(e.sel.primary(),t,n,r)],0),i)}function Jr(e,t,n){for(var i=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;s=t.ch:a.to>t.ch))){if(r&&(ge(l,"beforeCursorEnter"),l.explicitlyCleared)){if(s.markedSpans){--o;continue}break}if(!l.atomic)continue;if(n){var c=l.find(i<0?1:-1),h=void 0;if((i<0?d:u)&&(c=as(e,c,-i,c&&c.line==t.line?s:null)),c&&c.line==t.line&&(h=nt(c,n))&&(i<0?h<0:h>0))return ss(e,c,t,i,r)}var p=l.find(i<0?-1:1);return(i<0?u:d)&&(p=as(e,p,i,p.line==t.line?s:null)),p?ss(e,p,t,i,r):null}}return t}function os(e,t,n,i,r){var s=i||1;return ss(e,t,n,s,r)||!r&&ss(e,t,n,s,!0)||ss(e,t,n,-s,r)||!r&&ss(e,t,n,-s,!0)||(e.cantEdit=!0,tt(e.first,0))}function as(e,t,n,i){return n<0&&0==t.ch?t.line>e.first?lt(e,tt(t.line-1)):null:n>0&&t.ch==(i||Ge(e,t.line)).text.length?t.line0)){var d=[l,1],c=nt(u.from,a.from),h=nt(u.to,a.to);(c<0||!o.inclusiveLeft&&!c)&&d.push({from:u.from,to:a.from}),(h>0||!o.inclusiveRight&&!h)&&d.push({from:a.to,to:u.to}),r.splice.apply(r,d),l+=d.length-3}}return r}(e,t.from,t.to);if(i)for(var r=i.length-1;r>=0;--r)cs(e,{from:i[r].from,to:i[r].to,text:r?[""]:t.text,origin:t.origin});else cs(e,t)}}function cs(e,t){if(1!=t.text.length||""!=t.text[0]||0!=nt(t.from,t.to)){var n=Br(e,t);Ur(e,t,n,e.cm?e.cm.curOp.id:NaN),fs(e,t,n,St(e,t));var i=[];Pr(e,(function(e,n){n||-1!=z(i,e.history)||(bs(e.history,t),i.push(e.history)),fs(e,t,null,St(e,t))}))}}function hs(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(!i||n){for(var r,s=e.history,o=e.sel,a="undo"==t?s.done:s.undone,l="undo"==t?s.undone:s.done,u=0;u=0;--p){var f=h(p);if(f)return f.v}}}}function ps(e,t){if(0!=t&&(e.first+=t,e.sel=new Er(J(e.sel.ranges,(function(e){return new Cr(tt(e.anchor.line+t,e.anchor.ch),tt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){hi(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;ie.lastLine())){if(t.from.lines&&(t={from:t.from,to:tt(s,Ge(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ke(e,t.from,t.to),n||(n=Br(e,t)),e.cm?function(e,t,n){var i=e.doc,r=e.display,s=t.from,o=t.to,a=!1,l=s.line;e.options.lineWrapping||(l=Xe(Ft(Ge(i,s.line))),i.iter(l,o.line+1,(function(e){if(e==r.maxLine)return a=!0,!0}))),i.sel.contains(t.from,t.to)>-1&&ve(e),Ir(i,t,n,li(e)),e.options.lineWrapping||(i.iter(l,s.line+t.text.length,(function(e){var t=$t(e);t>r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;i--){var r=Ge(e,i).stateAfter;if(r&&(!(r instanceof dt)||i+r.lookAhead1||!(this.children[0]instanceof ys))){var a=[];this.collapse(a),this.children=[new ys(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var o=r.lines.length%25+25,a=o;a10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var i=0;i0||0==o&&!1!==s.clearWhenEmpty)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=k("span",[s.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(Nt(e,t.line,t,n,s)||t.line!=n.line&&Nt(e,n.line,t,n,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Et=!0}s.addToHistory&&Ur(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(i){u&&s.collapsed&&!u.options.lineWrapping&&Ft(i)==u.display.maxLine&&(a=!0),s.collapsed&&l!=t.line&&Je(i,0),function(e,t,n){var i=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));i&&i.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],i&&i.add(e.markedSpans)),t.marker.attachLine(e)}(i,new Ct(s,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l})),s.collapsed&&e.iter(t.line,n.line+1,(function(t){Ht(e,t)&&Je(t,0)})),s.clearOnEnter&&he(s,"beforeCursorEnter",(function(){return s.clear()})),s.readOnly&&(_t=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++Cs,s.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),s.collapsed)hi(u,t.line,n.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var d=t.line;d<=n.line;d++)pi(u,d,"text");s.atomic&&is(u.doc),un(u,"markerAdded",u,s)}return s}xs.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Gi(e),be(this,"clear")){var n=this.find();n&&un(this,"clear",n.from,n.to)}for(var i=null,r=null,s=0;se.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=d,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&hi(e,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&is(e.doc)),e&&un(e,"markerCleared",e,this,i,r),t&&Ki(e),this.parent&&this.parent.clear()}},xs.prototype.find=function(e,t){var n,i;null==e&&"bookmark"==this.type&&(e=1);for(var r=0;r=0;l--)ds(this,i[l]);a?Qr(this,a):this.cm&&ji(this.cm)})),undo:ir((function(){hs(this,"undo")})),redo:ir((function(){hs(this,"redo")})),undoSelection:ir((function(){hs(this,"undo",!0)})),redoSelection:ir((function(){hs(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,n){e=lt(this,e),t=lt(this,t);var i=[],r=e.line;return this.iter(e.line,t.line+1,(function(s){var o=s.markedSpans;if(o)for(var a=0;a=l.to||null==l.from&&r!=e.line||null!=l.from&&r==t.line&&l.from>=t.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r})),i},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var i=0;ie)return t=e,!0;e-=s,++n})),lt(this,tt(n,t))},indexFromPos:function(e){var t=(e=lt(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var c=e.dataTransfer.getData("Text");if(c){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),ts(t.doc,Dr(n,n)),h)for(var p=0;p=0;t--)gs(e.doc,"",i[t].from,i[t].to,"+delete");ji(e)}))}function Zs(e,t,n){var i=se(e.text,t+n,n);return i<0||i>e.text.length?null:i}function Qs(e,t,n){var i=Zs(e,t.ch,n);return null==i?null:new tt(t.line,i,n<0?"after":"before")}function eo(e,t,n,i,r){if(e){"rtl"==t.doc.direction&&(r=-r);var s=de(n,t.doc.direction);if(s){var o,a=r<0?Y(s):s[0],l=r<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var u=On(t,n);o=r<0?n.text.length-1:0;var d=In(t,u,o).top;o=oe((function(e){return In(t,u,e).top==d}),r<0==(1==a.level)?a.from:a.to-1,o),"before"==l&&(o=Zs(n,o,1))}else o=r<0?a.to:a.from;return new tt(i,o,l)}}return new tt(i,r<0?n.text.length:0,r<0?"before":"after")}Ws.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ws.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ws.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ws.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ws.default=b?Ws.macDefault:Ws.pcDefault;var to={selectAll:ls,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),W)},killLine:function(e){return Xs(e,(function(t){if(t.empty()){var n=Ge(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)r=new tt(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),tt(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var o=Ge(e.doc,r.line-1).text;o&&(r=new tt(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),tt(r.line-1,o.length-1),r,"+transpose"))}n.push(new Cr(r,r))}e.setSelections(n)}))},newlineAndIndent:function(e){return er(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var i=0;i-1&&(nt((r=u.ranges[r]).from(),t)<0||t.xRel>0)&&(nt(r.to(),t)>0||t.xRel<0)?function(e,t,n,i){var r=e.display,s=!1,u=tr(e,(function(t){l&&(r.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Ci(e)),fe(r.wrapper.ownerDocument,"mouseup",u),fe(r.wrapper.ownerDocument,"mousemove",d),fe(r.scroller,"dragstart",c),fe(r.scroller,"drop",u),s||(ye(t),i.addNew||Yr(e.doc,n,null,null,i.extend),l&&!h||o&&9==a?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),d=function(e){s=s||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},c=function(){return s=!0};l&&(r.scroller.draggable=!0),e.state.draggingText=u,u.copy=!i.moveOnDrag,he(r.wrapper.ownerDocument,"mouseup",u),he(r.wrapper.ownerDocument,"mousemove",d),he(r.scroller,"dragstart",c),he(r.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout((function(){return r.input.focus()}),20),r.scroller.dragDrop&&r.scroller.dragDrop()}(e,i,t,s):function(e,t,n,i){o&&Ci(e);var r=e.display,s=e.doc;ye(t);var a,l,u=s.sel,d=u.ranges;if(i.addNew&&!i.extend?(l=s.sel.contains(n),a=l>-1?d[l]:new Cr(n,n)):(a=s.sel.primary(),l=s.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new Cr(n,n)),n=di(e,t,!0,!0),l=-1;else{var c=bo(e,n,i.unit);a=i.extend?Kr(a,c.anchor,c.head,i.extend):c}i.addNew?-1==l?(l=d.length,es(s,xr(e,d.concat([a]),l),{scroll:!1,origin:"*mouse"})):d.length>1&&d[l].empty()&&"char"==i.unit&&!i.extend?(es(s,xr(e,d.slice(0,l).concat(d.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=s.sel):Xr(s,l,a,q):(l=0,es(s,new Er([a],0),q),u=s.sel);var h=n;function p(t){if(0!=nt(h,t))if(h=t,"rectangle"==i.unit){for(var r=[],o=e.options.tabSize,d=N(Ge(s,n.line).text,n.ch,o),c=N(Ge(s,t.line).text,t.ch,o),p=Math.min(d,c),f=Math.max(d,c),g=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));g<=m;g++){var v=Ge(s,g).text,b=V(v,p,o);p==f?r.push(new Cr(tt(g,b),tt(g,b))):v.length>b&&r.push(new Cr(tt(g,b),tt(g,V(v,f,o))))}r.length||r.push(new Cr(n,n)),es(s,xr(e,u.ranges.slice(0,l).concat(r),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var A,y=a,w=bo(e,t,i.unit),_=y.anchor;nt(w.anchor,_)>0?(A=w.head,_=ot(y.from(),w.anchor)):(A=w.anchor,_=st(y.to(),w.head));var E=u.ranges.slice(0);E[l]=function(e,t){var n=t.anchor,i=t.head,r=Ge(e.doc,n.line);if(0==nt(n,i)&&n.sticky==i.sticky)return t;var s=de(r);if(!s)return t;var o=le(s,n.ch,n.sticky),a=s[o];if(a.from!=n.ch&&a.to!=n.ch)return t;var l,u=o+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==s.length)return t;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var d=le(s,i.ch,i.sticky),c=d-o||(i.ch-n.ch)*(1==a.level?-1:1);l=d==u-1||d==u?c<0:c>0}var h=s[u+(l?-1:0)],p=l==(1==h.level),f=p?h.from:h.to,g=p?"after":"before";return n.ch==f&&n.sticky==g?t:new Cr(new tt(n.line,f,g),i)}(e,new Cr(lt(s,_),A)),es(s,xr(e,E,l),q)}}var f=r.wrapper.getBoundingClientRect(),g=0;function m(t){var n=++g,o=di(e,t,!0,"rectangle"==i.unit);if(o)if(0!=nt(o,h)){e.curOp.focus=j(),p(o);var a=Bi(r,s);(o.line>=a.to||o.linef.bottom?20:0;l&&setTimeout(tr(e,(function(){g==n&&(r.scroller.scrollTop+=l,m(t))})),50)}}function v(t){e.state.selectingText=!1,g=1/0,t&&(ye(t),r.input.focus()),fe(r.wrapper.ownerDocument,"mousemove",b),fe(r.wrapper.ownerDocument,"mouseup",A),s.history.lastSelOrigin=null}var b=tr(e,(function(e){0!==e.buttons&&xe(e)?m(e):v(e)})),A=tr(e,v);e.state.selectingText=A,he(r.wrapper.ownerDocument,"mousemove",b),he(r.wrapper.ownerDocument,"mouseup",A)}(e,i,t,s)}(t,i,s,e):Ce(e)==n.scroller&&ye(e):2==r?(i&&Yr(t.doc,i),setTimeout((function(){return n.input.focus()}),20)):3==r&&(E?t.display.input.onContextMenu(e):Ci(t)))}}function bo(e,t,n){if("char"==n)return new Cr(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Cr(tt(t.line,0),lt(e.doc,tt(t.line+1,0)));var i=n(e,t);return new Cr(i.from,i.to)}function Ao(e,t,n,i){var r,s;if(t.touches)r=t.touches[0].clientX,s=t.touches[0].clientY;else try{r=t.clientX,s=t.clientY}catch(e){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&ye(t);var o=e.display,a=o.lineDiv.getBoundingClientRect();if(s>a.bottom||!be(e,n))return _e(t);s-=a.top-o.viewOffset;for(var l=0;l=r)return ge(e,n,e,Ze(e.doc,s),e.display.gutterSpecs[l].className,t),_e(t)}}function yo(e,t){return Ao(e,t,"gutterClick",!0)}function wo(e,t){En(e.display,t)||function(e,t){return!!be(e,"gutterContextMenu")&&Ao(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||E||e.display.input.onContextMenu(t)}function _o(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Un(e)}mo.prototype.compare=function(e,t,n){return this.time+400>e&&0==nt(t,this.pos)&&n==this.button};var Eo={toString:function(){return"CodeMirror.Init"}},Co={},xo={};function Do(e,t,n){if(!t!=!(n&&n!=Eo)){var i=e.display.dragFunctions,r=t?he:fe;r(e.display.scroller,"dragstart",i.start),r(e.display.scroller,"dragenter",i.enter),r(e.display.scroller,"dragover",i.over),r(e.display.scroller,"dragleave",i.leave),r(e.display.scroller,"drop",i.drop)}}function So(e){e.options.lineWrapping?(O(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(D(e.display.wrapper,"CodeMirror-wrap"),Vt(e)),ui(e),hi(e),Un(e),setTimeout((function(){return Hi(e)}),100)}function To(e,t){var n=this;if(!(this instanceof To))return new To(e,t);this.options=t=t?L(t):{},L(Co,t,!1);var i=t.value;"string"==typeof i?i=new Ms(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var r=new To.inputStyles[t.inputStyle](this),s=this.display=new vr(e,i,r,t);for(var u in s.wrapper.CodeMirror=this,_o(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),$i(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new F,keySeq:null,specialChars:null},t.autofocus&&!v&&s.input.focus(),o&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;he(t.scroller,"mousedown",tr(e,vo)),he(t.scroller,"dblclick",o&&a<11?tr(e,(function(t){if(!me(e,t)){var n=di(e,t);if(n&&!yo(e,t)&&!En(e.display,t)){ye(t);var i=e.findWordAt(n);Yr(e.doc,i.anchor,i.head)}}})):function(t){return me(e,t)||ye(t)}),he(t.scroller,"contextmenu",(function(t){return wo(e,t)})),he(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||wo(e,n)}));var n,i={end:0};function r(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(i=t.activeTouch).end=+new Date)}function s(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function l(e,t){if(null==t.left)return!0;var n=t.left-e.left,i=t.top-e.top;return n*n+i*i>400}he(t.scroller,"touchstart",(function(r){if(!me(e,r)&&!s(r)&&!yo(e,r)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-i.end<=300?i:null},1==r.touches.length&&(t.activeTouch.left=r.touches[0].pageX,t.activeTouch.top=r.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(n){var i=t.activeTouch;if(i&&!En(t,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var s,o=e.coordsChar(t.activeTouch,"page");s=!i.prev||l(i,i.prev)?new Cr(o,o):!i.prev.prev||l(i,i.prev.prev)?e.findWordAt(o):new Cr(tt(o.line,0),lt(e.doc,tt(o.line+1,0))),e.setSelection(s.anchor,s.head),e.focus(),ye(n)}r()})),he(t.scroller,"touchcancel",r),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Ri(e,t.scroller.scrollTop),Ni(e,t.scroller.scrollLeft,!0),ge(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return _r(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return _r(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||Ee(t)},over:function(t){me(e,t)||(function(e,t){var n=di(e,t);if(n){var i=document.createDocumentFragment();Ai(e,n,i),e.display.dragCursor||(e.display.dragCursor=B("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),T(e.display.dragCursor,i)}}(e,t),Ee(t))},start:function(t){return function(e,t){if(o&&(!e.state.draggingText||+new Date-js<100))Ee(t);else if(!me(e,t)&&!En(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h)){var n=B("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",c&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),c&&n.parentNode.removeChild(n)}}(e,t)},drop:tr(e,Os),leave:function(t){me(e,t)||Is(e)}};var u=t.input.getField();he(u,"keyup",(function(t){return ho.call(e,t)})),he(u,"keydown",tr(e,co)),he(u,"keypress",tr(e,po)),he(u,"focus",(function(t){return xi(e,t)})),he(u,"blur",(function(t){return Di(e,t)}))}(this),Ls(),Gi(this),this.curOp.forceUpdate=!0,Rr(this,i),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&xi(n)}),20):Di(this),xo)xo.hasOwnProperty(u)&&xo[u](this,t[u],Eo);pr(this),t.finishInit&&t.finishInit(this);for(var d=0;d150)){if(!i)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>s.first?N(Ge(s,t-1).text,null,o):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var c="",h=0;if(e.options.indentWithTabs)for(var p=Math.floor(u/o);p;--p)h+=o,c+="\t";if(ho,l=je(t),u=null;if(a&&i.ranges.length>1)if(Mo&&Mo.text.join("\n")==t){if(i.ranges.length%Mo.text.length==0){u=[];for(var d=0;d=0;h--){var p=i.ranges[h],f=p.from(),g=p.to();p.empty()&&(n&&n>0?f=tt(f.line,f.ch-n):e.state.overwrite&&!a?g=tt(g.line,Math.min(Ge(s,g.line).text.length,g.ch+Y(l).length)):a&&Mo&&Mo.lineWise&&Mo.text.join("\n")==l.join("\n")&&(f=g=tt(f.line,0)));var m={from:f,to:g,text:u?u[h%u.length]:l,origin:r||(a?"paste":e.state.cutIncoming>o?"cut":"+input")};ds(e.doc,m),un(e,"inputRead",e,m)}t&&!a&&Po(e,t),ji(e),e.curOp.updateInput<2&&(e.curOp.updateInput=c),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Io(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||er(t,(function(){return Oo(t,n,0,null,"paste")})),!0}function Po(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var s=e.getModeAt(r.head),o=!1;if(s.electricChars){for(var a=0;a-1){o=ko(e,r.head.line,"smart");break}}else s.electricInput&&s.electricInput.test(Ge(e.doc,r.head.line).text.slice(0,r.head.ch))&&(o=ko(e,r.head.line,"smart"));o&&un(e,"electricInput",e,r.head.line)}}}function Ro(e){for(var t=[],n=[],i=0;i0?0:-1));if(isNaN(d))o=null;else{var c=n>0?d>=55296&&d<56320:d>=56320&&d<57343;o=new tt(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(c?2:1))),-n)}}else o=r?function(e,t,n,i){var r=de(t,e.doc.direction);if(!r)return Qs(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var s=le(r,n.ch,n.sticky),o=r[s];if("ltr"==e.doc.direction&&o.level%2==0&&(i>0?o.to>n.ch:o.from=o.from&&h>=d.begin)){var p=c?"before":"after";return new tt(n.line,h,p)}}var f=function(e,t,i){for(var s=function(e,t){return t?new tt(n.line,l(e,1),"before"):new tt(n.line,e,"after")};e>=0&&e0==(1!=o.level),u=a?i.begin:l(i.end,-1);if(o.from<=u&&u0?d.end:l(d.begin,-1);return null==m||i>0&&m==t.text.length||!(g=f(i>0?0:r.length-1,i,u(m)))?null:g}(e.cm,a,t,n):Qs(a,t,n);if(null==o){if(s||((u=t.line+l)=e.first+e.size||(t=new tt(u,t.ch,t.sticky),!(a=Ge(e,u)))))return!1;t=eo(r,e.cm,a,t.line,l)}else t=o;return!0}if("char"==i||"codepoint"==i)u();else if("column"==i)u(!0);else if("word"==i||"group"==i)for(var d=null,c="group"==i,h=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||u(!p);p=!1){var f=a.text.charAt(t.ch)||"\n",g=te(f,h)?"w":c&&"\n"==f?"n":!c||/\s/.test(f)?null:"p";if(!c||p||g||(g="s"),d&&d!=g){n<0&&(n=1,u(),t.sticky="after");break}if(g&&(d=g),n>0&&!u(!p))break}var m=os(e,t,s,o,!0);return it(s,m)&&(m.hitSide=!0),m}function zo(e,t,n,i){var r,s,o=e.doc,a=t.left;if("page"==i){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*ri(e.display),3);r=(n>0?t.bottom:t.top)+n*u}else"line"==i&&(r=n>0?t.bottom+3:t.top-3);for(;(s=Xn(e,a,r)).outside;){if(n<0?r<=0:r>=o.height){s.hitSide=!0;break}r+=5*n}return s}var Uo=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new F,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ho(e,t){var n=jn(e,t.line);if(!n||n.hidden)return null;var i=Ge(e.doc,t.line),r=kn(n,i,t.line),s=de(i,e.doc.direction),o="left";s&&(o=le(s,t.ch)%2?"right":"left");var a=Ln(r.map,t.ch,o);return a.offset="right"==a.collapse?a.end:a.start,a}function Wo(e,t){return t&&(e.bad=!0),e}function qo(e,t,n){var i;if(t==e.display.lineDiv){if(!(i=e.display.lineDiv.childNodes[n]))return Wo(e.clipPos(tt(e.display.viewTo-1)),!0);t=null,n=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var r=0;r=t.display.viewTo||s.line=t.display.viewFrom&&Ho(t,r)||{node:l[0].measure.map[2],offset:0},d=s.linei.firstLine()&&(o=tt(o.line-1,Ge(i.doc,o.line-1).length)),a.ch==Ge(i.doc,a.line).text.length&&a.liner.viewTo-1)return!1;o.line==r.viewFrom||0==(e=ci(i,o.line))?(t=Xe(r.view[0].line),n=r.view[0].node):(t=Xe(r.view[e].line),n=r.view[e-1].node.nextSibling);var l,u,d=ci(i,a.line);if(d==r.view.length-1?(l=r.viewTo-1,u=r.lineDiv.lastChild):(l=Xe(r.view[d+1].line)-1,u=r.view[d+1].node.previousSibling),!n)return!1;for(var c=i.doc.splitLines(function(e,t,n,i,r){var s="",o=!1,a=e.doc.lineSeparator(),l=!1;function u(){o&&(s+=a,l&&(s+=a),o=l=!1)}function d(e){e&&(u(),s+=e)}function c(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void d(n);var s,h=t.getAttribute("cm-marker");if(h){var p=e.findMarks(tt(i,0),tt(r+1,0),(m=+h,function(e){return e.id==m}));return void(p.length&&(s=p[0].find(0))&&d(Ke(e.doc,s.from,s.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var f=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;f&&u();for(var g=0;g1&&h.length>1;)if(Y(c)==Y(h))c.pop(),h.pop(),l--;else{if(c[0]!=h[0])break;c.shift(),h.shift(),t++}for(var p=0,f=0,g=c[0],m=h[0],v=Math.min(g.length,m.length);po.ch&&b.charCodeAt(b.length-f-1)==A.charCodeAt(A.length-f-1);)p--,f++;c[c.length-1]=b.slice(0,b.length-f).replace(/^\u200b+/,""),c[0]=c[0].slice(p).replace(/\u200b+$/,"");var w=tt(t,p),_=tt(l,h.length?Y(h).length-f:0);return c.length>1||c[0]||nt(w,_)?(gs(i.doc,c,w,_,"+input"),!0):void 0},Uo.prototype.ensurePolled=function(){this.forceCompositionEnd()},Uo.prototype.reset=function(){this.forceCompositionEnd()},Uo.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Uo.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Uo.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||er(this.cm,(function(){return hi(e.cm)}))},Uo.prototype.setUneditable=function(e){e.contentEditable="false"},Uo.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||tr(this.cm,Oo)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Uo.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Uo.prototype.onContextMenu=function(){},Uo.prototype.resetPosition=function(){},Uo.prototype.needsContentAttribute=!0;var Vo=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new F,this.hasSelection=!1,this.composing=null};Vo.prototype.init=function(e){var t=this,n=this,i=this.cm;this.createField(e);var r=this.textarea;function s(e){if(!me(i,e)){if(i.somethingSelected())jo({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Ro(i);jo({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,W):(n.prevInput="",r.value=t.text.join("\n"),P(r))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(r.style.width="0px"),he(r,"input",(function(){o&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),he(r,"paste",(function(e){me(i,e)||Io(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),he(r,"cut",s),he(r,"copy",s),he(e.scroller,"paste",(function(t){if(!En(e,t)&&!me(i,t)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var s=new Event("paste");s.clipboardData=t.clipboardData,r.dispatchEvent(s)}})),he(e.lineSpace,"selectstart",(function(t){En(e,t)||ye(t)})),he(r,"compositionstart",(function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}})),he(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Vo.prototype.createField=function(e){this.wrapper=No(),this.textarea=this.wrapper.firstChild},Vo.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Vo.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,i=bi(e);if(e.options.moveInputWithCursor){var r=Kn(e,n.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+o.top-s.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+o.left-s.left))}return i},Vo.prototype.showSelection=function(e){var t=this.cm.display;T(t.cursorDiv,e.cursors),T(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Vo.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&P(this.textarea),o&&a>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",o&&a>=9&&(this.hasSelection=null))}},Vo.prototype.getField=function(){return this.textarea},Vo.prototype.supportsTouch=function(){return!1},Vo.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},Vo.prototype.blur=function(){this.textarea.blur()},Vo.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Vo.prototype.receivedFocus=function(){this.slowPoll()},Vo.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Vo.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Vo.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||Oe(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=n.value;if(r==i&&!t.somethingSelected())return!1;if(o&&a>=9&&this.hasSelection===r||b&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=r.charCodeAt(0);if(8203!=s||i||(i="​"),8666==s)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(i.length,r.length);l1e3||r.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Vo.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Vo.prototype.onKeyPress=function(){o&&a>=9&&(this.hasSelection=null),this.fastPoll()},Vo.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=di(n,e),u=i.scroller.scrollTop;if(s&&!c){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(s)&&tr(n,es)(n.doc,Dr(s),W);var d,h=r.style.cssText,p=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(o?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(d=window.scrollY),i.input.focus(),l&&window.scrollTo(null,d),i.input.reset(),n.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=v,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),o&&a>=9&&m(),E){Ee(e);var g=function(){fe(window,"mouseup",g),setTimeout(v,20)};he(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=r.selectionStart){var e=n.somethingSelected(),s="​"+(e?r.value:"");r.value="⇚",r.value=s,t.prevInput=e?"":"​",r.selectionStart=1,r.selectionEnd=s.length,i.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,r.style.cssText=h,o&&a<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=u),null!=r.selectionStart)){(!o||o&&a<9)&&m();var e=0,s=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&"​"==t.prevInput?tr(n,ls)(n):e++<10?i.detectingSelectAll=setTimeout(s,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(s,200)}}},Vo.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Vo.prototype.setUneditable=function(){},Vo.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,i,r,s){e.defaults[n]=i,r&&(t[n]=s?function(e,t,n){n!=Eo&&r(e,t,n)}:r)}e.defineOption=n,e.Init=Eo,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Mr(e)}),!0),n("indentUnit",2,Mr,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){jr(e),Un(e),hi(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],i=e.doc.first;e.doc.iter((function(e){for(var r=0;;){var s=e.text.indexOf(t,r);if(-1==s)break;r=s+t.length,n.push(tt(i,s))}i++}));for(var r=n.length-1;r>=0;r--)gs(e.doc,t,n[r],tt(n[r].line,n[r].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Eo&&e.refresh()})),n("specialCharPlaceholder",Qt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!y),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){_o(e),mr(e)}),!0),n("keyMap","default",(function(e,t,n){var i=Js(t),r=n!=Eo&&Js(n);r&&r.detach&&r.detach(e,i),i.attach&&i.attach(e,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,So,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=fr(t,e.options.lineNumbers),mr(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ai(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Hi(e)}),!0),n("scrollbarStyle","native",(function(e){$i(e),Hi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=fr(e.options.gutters,t),mr(e)}),!0),n("firstLineNumber",1,mr,!0),n("lineNumberFormatter",(function(e){return e}),mr,!0),n("showCursorWhenSelecting",!1,vi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Di(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Do),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vi,!0),n("singleCursorHeightPerLine",!0,vi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,jr,!0),n("addModeClass",!1,jr,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,jr,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(To),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var i=this.options,r=i[e];i[e]==n&&"mode"!=e||(i[e]=n,t.hasOwnProperty(e)&&tr(this,t[e])(this,n,r),ge(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Js(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(ko(this,r.head.line,e,!0),n=r.head.line,i==this.doc.sel.primIndex&&ji(this));else{var s=r.from(),o=r.to(),a=Math.max(n,s.line);n=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1;for(var l=a;l0&&Xr(this.doc,i,new Cr(s,u[i].to()),W)}}})),getTokenAt:function(e,t){return At(this,e,t)},getLineTokens:function(e,t){return At(this,tt(e),t,!0)},getTokenTypeAt:function(e){e=lt(this.doc,e);var t,n=pt(this,Ge(this.doc,e.line)),i=0,r=(n.length-1)/2,s=e.ch;if(0==s)t=n[2];else for(;;){var o=i+r>>1;if((o?n[2*o-1]:0)>=s)r=o;else{if(!(n[2*o+1]s&&(e=s,r=!0),i=Ge(this.doc,e)}else i=e;return $n(this,i,{top:0,left:0},t||"page",n||r).top+(r?this.doc.height-qt(i):0)},defaultTextHeight:function(){return ri(this.display)},defaultCharWidth:function(){return si(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,i,r){var s,o,a,l=this.display,u=(e=Kn(this,lt(this.doc,e))).bottom,d=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==i)u=e.top;else if("above"==i||"near"==i){var c=Math.max(l.wrapper.clientHeight,this.doc.height),h=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>c)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=c&&(u=e.bottom),d+t.offsetWidth>h&&(d=h-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==r?(d=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?d=0:"middle"==r&&(d=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=d+"px"),n&&(s=this,o={left:d,top:u,right:d+t.offsetWidth,bottom:u+t.offsetHeight},null!=(a=ki(s,o)).scrollTop&&Ri(s,a.scrollTop),null!=a.scrollLeft&&Ni(s,a.scrollLeft))},triggerOnKeyDown:nr(co),triggerOnKeyPress:nr(po),triggerOnKeyUp:ho,triggerOnMouseDown:nr(vo),execCommand:function(e){if(to.hasOwnProperty(e))return to[e].call(null,this)},triggerElectric:nr((function(e){Po(this,e)})),findPosH:function(e,t,n,i){var r=1;t<0&&(r=-1,t=-t);for(var s=lt(this.doc,e),o=0;o0&&o(t.charAt(n-1));)--n;for(;i.5||this.options.lineWrapping)&&ui(this),ge(this,"refresh",this)})),swapDoc:nr((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Rr(this,e),Un(this),this.display.input.reset(),Oi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,un(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ae(e),e.registerHelper=function(t,i,r){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][i]=r},e.registerGlobalHelper=function(t,i,r,s){e.registerHelper(t,i,s),n[t]._global.push({pred:r,val:s})}}(To);var Go="iter insert remove copy getEditor constructor".split(" ");for(var Ko in Ms.prototype)Ms.prototype.hasOwnProperty(Ko)&&z(Go,Ko)<0&&(To.prototype[Ko]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ms.prototype[Ko]));return Ae(Ms),To.inputStyles={textarea:Vo,contenteditable:Uo},To.defineMode=function(e){To.defaults.mode||"null"==e||(To.defaults.mode=e),Ne.apply(this,arguments)},To.defineMIME=function(e,t){Le[e]=t},To.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),To.defineMIME("text/plain","null"),To.defineExtension=function(e,t){To.prototype[e]=t},To.defineDocExtension=function(e,t){Ms.prototype[e]=t},To.fromTextArea=function(e,t){if((t=t?L(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=j();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function i(){e.value=a.getValue()}var r;if(e.form&&(he(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var s=e.form;r=s.submit;try{var o=s.submit=function(){i(),s.submit=r,s.submit(),s.submit=o}}catch(e){}}t.finishInit=function(n){n.save=i,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,i(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(fe(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=r))}},e.style.display="none";var a=To((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a},function(e){e.off=fe,e.on=he,e.wheelEventPixels=wr,e.Doc=Ms,e.splitLines=je,e.countColumn=N,e.findColumn=V,e.isWordChar=ee,e.Pass=H,e.signal=ge,e.Line=Gt,e.changeEnd=Sr,e.scrollbarModel=qi,e.Pos=tt,e.cmpPos=nt,e.modes=Re,e.mimeModes=Le,e.resolveMode=Fe,e.getMode=ze,e.modeExtensions=Ue,e.extendMode=He,e.copyState=We,e.startState=$e,e.innerMode=qe,e.commands=to,e.keyMap=Ws,e.keyName=Ys,e.isModifierKey=Gs,e.lookupKey=Vs,e.normalizeKeyMap=$s,e.StringStream=Ve,e.SharedTextMarker=Ss,e.TextMarker=xs,e.LineWidget=_s,e.e_preventDefault=ye,e.e_stopPropagation=we,e.e_stop=Ee,e.addClass=O,e.contains=M,e.rmClass=D,e.keyNames=Fs}(To),To.version="5.61.1",To}()},1755:(e,t,n)=>{!function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var n=t(["and","or","not","is"]),i=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],r=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];function s(e){return e.scopes[e.scopes.length-1]}e.registerHelper("hintWords","python",i.concat(r)),e.defineMode("python",(function(o,a){for(var l="error",u=a.delimiters||a.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,d=[a.singleOperators,a.doubleOperators,a.doubleDelimiters,a.tripleDelimiters,a.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],c=0;ci?_(t):r0&&E(e,t)&&(o+=" "+l),o}return w(e,t)}function w(e,t,i){if(e.eatSpace())return null;if(!i&&e.match(/^#.*/))return"comment";if(e.match(/^[0-9\.]/,!1)){var r=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(r=!0),e.match(/^[\d_]+\.\d*/)&&(r=!0),e.match(/^\.\d+/)&&(r=!0),r)return e.eat(/J/i),"number";var s=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(s=!0),e.match(/^0b[01_]+/i)&&(s=!0),e.match(/^0o[0-7_]+/i)&&(s=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),s=!0),e.match(/^0(?![\dx])/i)&&(s=!0),s)return e.eat(/L/i),"number"}if(e.match(v))return-1!==e.current().toLowerCase().indexOf("f")?(t.tokenize=function(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,i="string";function r(e){return function(t,n){var i=w(t,n,!0);return"punctuation"==i&&("{"==t.current()?n.tokenize=r(e+1):"}"==t.current()&&(n.tokenize=e>1?r(e-1):s)),i}}function s(s,o){for(;!s.eol();)if(s.eatWhile(/[^'"\{\}\\]/),s.eat("\\")){if(s.next(),n&&s.eol())return i}else{if(s.match(e))return o.tokenize=t,i;if(s.match("{{"))return i;if(s.match("{",!1))return o.tokenize=r(0),s.current()?i:o.tokenize(s,o);if(s.match("}}"))return i;if(s.match("}"))return l;s.eat(/['"]/)}if(n){if(a.singleLineStringErrors)return l;o.tokenize=t}return i}return s.isString=!0,s}(e.current(),t.tokenize),t.tokenize(e,t)):(t.tokenize=function(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,i="string";function r(r,s){for(;!r.eol();)if(r.eatWhile(/[^'"\\]/),r.eat("\\")){if(r.next(),n&&r.eol())return i}else{if(r.match(e))return s.tokenize=t,i;r.eat(/['"]/)}if(n){if(a.singleLineStringErrors)return l;s.tokenize=t}return i}return r.isString=!0,r}(e.current(),t.tokenize),t.tokenize(e,t));for(var o=0;o1&&s(t).offset>n;){if("py"!=s(t).type)return!0;t.scopes.pop()}return s(t).offset!=n}function C(e,t){e.sol()&&(t.beginningOfLine=!0);var n=t.tokenize(e,t),i=e.current();if(t.beginningOfLine&&"@"==i)return e.match(m,!1)?"meta":g?"operator":l;if(/\S/.test(i)&&(t.beginningOfLine=!1),"variable"!=n&&"builtin"!=n||"meta"!=t.lastToken||(n="meta"),"pass"!=i&&"return"!=i||(t.dedent+=1),"lambda"==i&&(t.lambda=!0),":"==i&&!t.lambda&&"py"==s(t).type&&e.match(/^\s*(?:#|$)/,!1)&&_(t),1==i.length&&!/string|comment/.test(n)){var r="[({".indexOf(i);if(-1!=r&&function(e,t,n){var i=e.match(/^[\s\[\{\(]*(?:#|$)/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+h,type:n,align:i})}(e,t,"])}".slice(r,r+1)),-1!=(r="])}".indexOf(i))){if(s(t).type!=i)return l;t.indent=t.scopes.pop().offset-h}}return t.dedent>0&&e.eol()&&"py"==s(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),n}return{startState:function(e){return{tokenize:y,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var i=C(e,t);return i&&"comment"!=i&&(t.lastToken="keyword"==i||"punctuation"==i?e.current():i),"punctuation"==i&&(i=null),e.eol()&&t.lambda&&(t.lambda=!1),n?i+" "+l:i},indent:function(t,n){if(t.tokenize!=y)return t.tokenize.isString?e.Pass:0;var i=s(t),r=i.type==n.charAt(0);return null!=i.align?i.align-(r?1:0):i.offset-(r?h:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}})),e.defineMIME("text/x-python","python");var o;e.defineMIME("text/x-cython",{name:"python",extra_keywords:(o="by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE",o.split(" "))})}(n(1448))},2743:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function r(e,t,n){return e.concat(t).map((function(e){return i(e,n)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function o(e,t){try{return t in e}catch(e){return!1}}function a(e,n,l){(l=l||{}).arrayMerge=l.arrayMerge||r,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=i;var u=Array.isArray(n);return u===Array.isArray(e)?u?l.arrayMerge(e,n,l):function(e,t,n){var r={};return n.isMergeableObject(e)&&s(e).forEach((function(t){r[t]=i(e[t],n)})),s(t).forEach((function(s){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,s)||(o(e,s)&&n.isMergeableObject(t[s])?r[s]=function(e,t){if(!t.customMerge)return a;var n=t.customMerge(e);return"function"==typeof n?n:a}(s,n)(e[s],t[s],n):r[s]=i(t[s],n))})),r}(e,n,l):i(n,l)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return a(e,n,t)}),{})};var l=a;e.exports=l},3338:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},3379:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXML=t.decodeHTMLStrict=t.decodeHTMLAttribute=t.decodeHTML=t.determineBranch=t.EntityDecoder=t.DecodingMode=t.BinTrieFlags=t.fromCodePoint=t.replaceCodePoint=t.decodeCodePoint=t.xmlDecodeTree=t.htmlDecodeTree=void 0;var a=o(n(7346));t.htmlDecodeTree=a.default;var l=o(n(8622));t.xmlDecodeTree=l.default;var u=s(n(2809));t.decodeCodePoint=u.default;var d,c,h,p,f=n(2809);function g(e){return e>=d.ZERO&&e<=d.NINE}Object.defineProperty(t,"replaceCodePoint",{enumerable:!0,get:function(){return f.replaceCodePoint}}),Object.defineProperty(t,"fromCodePoint",{enumerable:!0,get:function(){return f.fromCodePoint}}),function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"}(d||(d={})),function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"}(c=t.BinTrieFlags||(t.BinTrieFlags={})),function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"}(h||(h={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(p=t.DecodingMode||(t.DecodingMode={}));var m=function(){function e(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=h.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=p.Strict}return e.prototype.startEntity=function(e){this.decodeMode=e,this.state=h.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1},e.prototype.write=function(e,t){switch(this.state){case h.EntityStart:return e.charCodeAt(t)===d.NUM?(this.state=h.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=h.NamedEntity,this.stateNamedEntity(e,t));case h.NumericStart:return this.stateNumericStart(e,t);case h.NumericDecimal:return this.stateNumericDecimal(e,t);case h.NumericHex:return this.stateNumericHex(e,t);case h.NamedEntity:return this.stateNamedEntity(e,t)}},e.prototype.stateNumericStart=function(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===d.LOWER_X?(this.state=h.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=h.NumericDecimal,this.stateNumericDecimal(e,t))},e.prototype.addToNumericResult=function(e,t,n,i){if(t!==n){var r=n-t;this.result=this.result*Math.pow(i,r)+parseInt(e.substr(t,r),i),this.consumed+=r}},e.prototype.stateNumericHex=function(e,t){for(var n,i=t;t=d.UPPER_A&&n<=d.UPPER_F||n>=d.LOWER_A&&n<=d.LOWER_F)))return this.addToNumericResult(e,i,t,16),this.emitNumericEntity(r,3);t+=1}return this.addToNumericResult(e,i,t,16),-1},e.prototype.stateNumericDecimal=function(e,t){for(var n=t;t>14;t=d.UPPER_A&&e<=d.UPPER_Z||e>=d.LOWER_A&&e<=d.LOWER_Z||g(e)}(o)))?0:this.emitNotTerminatedNamedEntity();if(0!=(r=((i=n[this.treeIndex])&c.VALUE_LENGTH)>>14)){if(s===d.SEMI)return this.emitNamedEntityData(this.treeIndex,r,this.consumed+this.excess);this.decodeMode!==p.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}var o;return-1},e.prototype.emitNotTerminatedNamedEntity=function(){var e,t=this.result,n=(this.decodeTree[t]&c.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,n,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed},e.prototype.emitNamedEntityData=function(e,t,n){var i=this.decodeTree;return this.emitCodePoint(1===t?i[e]&~c.VALUE_LENGTH:i[e+1],n),3===t&&this.emitCodePoint(i[e+2],n),n},e.prototype.end=function(){var e;switch(this.state){case h.NamedEntity:return 0===this.result||this.decodeMode===p.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case h.NumericDecimal:return this.emitNumericEntity(0,2);case h.NumericHex:return this.emitNumericEntity(0,3);case h.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case h.EntityStart:return 0}},e}();function v(e){var t="",n=new m(e,(function(e){return t+=(0,u.fromCodePoint)(e)}));return function(e,i){for(var r=0,s=0;(s=e.indexOf("&",s))>=0;){t+=e.slice(r,s),n.startEntity(i);var o=n.write(e,s+1);if(o<0){r=s+n.end();break}r=s+o,s=0===o?r+1:r}var a=t+e.slice(r);return t="",a}}function b(e,t,n,i){var r=(t&c.BRANCH_LENGTH)>>7,s=t&c.JUMP_TABLE;if(0===r)return 0!==s&&i===s?n:-1;if(s){var o=i-s;return o<0||o>=r?-1:e[n+o]-1}for(var a=n,l=a+r-1;a<=l;){var u=a+l>>>1,d=e[u];if(di))return e[u+r];l=u-1}}return-1}t.EntityDecoder=m,t.determineBranch=b;var A=v(a.default),y=v(l.default);t.decodeHTML=function(e,t){return void 0===t&&(t=p.Legacy),A(e,t)},t.decodeHTMLAttribute=function(e){return A(e,p.Attribute)},t.decodeHTMLStrict=function(e){return A(e,p.Strict)},t.decodeXML=function(e){return y(e,p.Strict)}},2809:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.replaceCodePoint=t.fromCodePoint=void 0;var i=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function r(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=i.get(e))&&void 0!==t?t:e}t.fromCodePoint=null!==(n=String.fromCodePoint)&&void 0!==n?n:function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+String.fromCharCode(e)},t.replaceCodePoint=r,t.default=function(e){return(0,t.fromCodePoint)(r(e))}},3231:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.encodeNonAsciiHTML=t.encodeHTML=void 0;var r=i(n(8635)),s=n(7078),o=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function a(e,t){for(var n,i="",o=0;null!==(n=e.exec(t));){var a=n.index;i+=t.substring(o,a);var l=t.charCodeAt(a),u=r.default.get(l);if("object"==typeof u){if(a+1{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.escapeText=t.escapeAttribute=t.escapeUTF8=t.escape=t.encodeXML=t.getCodePoint=t.xmlReplacer=void 0,t.xmlReplacer=/["&'<>$\x80-\uFFFF]/g;var n=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]);function i(e){for(var i,r="",s=0;null!==(i=t.xmlReplacer.exec(e));){var o=i.index,a=e.charCodeAt(o),l=n.get(a);void 0!==l?(r+=e.substring(s,o)+l,s=o+1):(r+="".concat(e.substring(s,o),"&#x").concat((0,t.getCodePoint)(e,o).toString(16),";"),s=t.xmlReplacer.lastIndex+=Number(55296==(64512&a)))}return r+e.substr(s)}function r(e,t){return function(n){for(var i,r=0,s="";i=e.exec(n);)r!==i.index&&(s+=n.substring(r,i.index)),s+=t.get(i[0].charCodeAt(0)),r=i.index+1;return s+n.substring(r)}}t.getCodePoint=null!=String.prototype.codePointAt?function(e,t){return e.codePointAt(t)}:function(e,t){return 55296==(64512&e.charCodeAt(t))?1024*(e.charCodeAt(t)-55296)+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t)},t.encodeXML=i,t.escape=i,t.escapeUTF8=r(/[&<>'"]/g,n),t.escapeAttribute=r(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),t.escapeText=r(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]))},7346:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((function(e){return e.charCodeAt(0)})))},8622:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((function(e){return e.charCodeAt(0)})))},8635:(e,t)=>{"use strict";function n(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXMLStrict=t.decodeHTML5Strict=t.decodeHTML4Strict=t.decodeHTML5=t.decodeHTML4=t.decodeHTMLAttribute=t.decodeHTMLStrict=t.decodeHTML=t.decodeXML=t.DecodingMode=t.EntityDecoder=t.encodeHTML5=t.encodeHTML4=t.encodeNonAsciiHTML=t.encodeHTML=t.escapeText=t.escapeAttribute=t.escapeUTF8=t.escape=t.encodeXML=t.encode=t.decodeStrict=t.decode=t.EncodingMode=t.EntityLevel=void 0;var i,r,s=n(3379),o=n(3231),a=n(7078);function l(e,t){if(void 0===t&&(t=i.XML),("number"==typeof t?t:t.level)===i.HTML){var n="object"==typeof t?t.mode:void 0;return(0,s.decodeHTML)(e,n)}return(0,s.decodeXML)(e)}!function(e){e[e.XML=0]="XML",e[e.HTML=1]="HTML"}(i=t.EntityLevel||(t.EntityLevel={})),function(e){e[e.UTF8=0]="UTF8",e[e.ASCII=1]="ASCII",e[e.Extensive=2]="Extensive",e[e.Attribute=3]="Attribute",e[e.Text=4]="Text"}(r=t.EncodingMode||(t.EncodingMode={})),t.decode=l,t.decodeStrict=function(e,t){var n;void 0===t&&(t=i.XML);var r="number"==typeof t?{level:t}:t;return null!==(n=r.mode)&&void 0!==n||(r.mode=s.DecodingMode.Strict),l(e,r)},t.encode=function(e,t){void 0===t&&(t=i.XML);var n="number"==typeof t?{level:t}:t;return n.mode===r.UTF8?(0,a.escapeUTF8)(e):n.mode===r.Attribute?(0,a.escapeAttribute)(e):n.mode===r.Text?(0,a.escapeText)(e):n.level===i.HTML?n.mode===r.ASCII?(0,o.encodeNonAsciiHTML)(e):(0,o.encodeHTML)(e):(0,a.encodeXML)(e)};var u=n(7078);Object.defineProperty(t,"encodeXML",{enumerable:!0,get:function(){return u.encodeXML}}),Object.defineProperty(t,"escape",{enumerable:!0,get:function(){return u.escape}}),Object.defineProperty(t,"escapeUTF8",{enumerable:!0,get:function(){return u.escapeUTF8}}),Object.defineProperty(t,"escapeAttribute",{enumerable:!0,get:function(){return u.escapeAttribute}}),Object.defineProperty(t,"escapeText",{enumerable:!0,get:function(){return u.escapeText}});var d=n(3231);Object.defineProperty(t,"encodeHTML",{enumerable:!0,get:function(){return d.encodeHTML}}),Object.defineProperty(t,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return d.encodeNonAsciiHTML}}),Object.defineProperty(t,"encodeHTML4",{enumerable:!0,get:function(){return d.encodeHTML}}),Object.defineProperty(t,"encodeHTML5",{enumerable:!0,get:function(){return d.encodeHTML}});var c=n(3379);Object.defineProperty(t,"EntityDecoder",{enumerable:!0,get:function(){return c.EntityDecoder}}),Object.defineProperty(t,"DecodingMode",{enumerable:!0,get:function(){return c.DecodingMode}}),Object.defineProperty(t,"decodeXML",{enumerable:!0,get:function(){return c.decodeXML}}),Object.defineProperty(t,"decodeHTML",{enumerable:!0,get:function(){return c.decodeHTML}}),Object.defineProperty(t,"decodeHTMLStrict",{enumerable:!0,get:function(){return c.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTMLAttribute",{enumerable:!0,get:function(){return c.decodeHTMLAttribute}}),Object.defineProperty(t,"decodeHTML4",{enumerable:!0,get:function(){return c.decodeHTML}}),Object.defineProperty(t,"decodeHTML5",{enumerable:!0,get:function(){return c.decodeHTML}}),Object.defineProperty(t,"decodeHTML4Strict",{enumerable:!0,get:function(){return c.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTML5Strict",{enumerable:!0,get:function(){return c.decodeHTMLStrict}}),Object.defineProperty(t,"decodeXMLStrict",{enumerable:!0,get:function(){return c.decodeXML}})},2189:e=>{"use strict";e.exports=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}},4651:function(e,t){var n;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,(function(i,r){"use strict";var s=[],o=Object.getPrototypeOf,a=s.slice,l=s.flat?function(e){return s.flat.call(e)}:function(e){return s.concat.apply([],e)},u=s.push,d=s.indexOf,c={},h=c.toString,p=c.hasOwnProperty,f=p.toString,g=f.call(Object),m={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},b=function(e){return null!=e&&e===e.window},A=i.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function w(e,t,n){var i,r,s=(n=n||A).createElement("script");if(s.text=e,t)for(i in y)(r=t[i]||t.getAttribute&&t.getAttribute(i))&&s.setAttribute(i,r);n.head.appendChild(s).parentNode.removeChild(s)}function _(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[h.call(e)]||"object":typeof e}var E="3.7.1",C=/HTML$/i,x=function(e,t){return new x.fn.init(e,t)};function D(e){var t=!!e&&"length"in e&&e.length,n=_(e);return!v(e)&&!b(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function S(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}x.fn=x.prototype={jquery:E,constructor:x,length:0,toArray:function(){return a.call(this)},get:function(e){return null==e?a.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return x.each(this,e)},map:function(e){return this.pushStack(x.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(x.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(x.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),H=new RegExp(L),W=new RegExp("^"+O+"$"),q={ID:new RegExp("^#("+O+")"),CLASS:new RegExp("^\\.("+O+")"),TAG:new RegExp("^("+O+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+L),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+D+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},$=/^(?:input|select|textarea|button)$/i,V=/^h\d$/i,G=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Y=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),J=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},X=function(){le()},Z=he((function(e){return!0===e.disabled&&S(e,"fieldset")}),{dir:"parentNode",next:"legend"});try{g.apply(s=a.call(P.childNodes),P.childNodes),s[P.childNodes.length].nodeType}catch(e){g={apply:function(e,t){R.apply(e,a.call(t))},call:function(e){R.apply(e,a.call(arguments,1))}}}function Q(e,t,n,i){var r,s,o,a,u,d,p,f=t&&t.ownerDocument,b=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==b&&9!==b&&11!==b)return n;if(!i&&(le(t),t=t||l,c)){if(11!==b&&(u=G.exec(e)))if(r=u[1]){if(9===b){if(!(o=t.getElementById(r)))return n;if(o.id===r)return g.call(n,o),n}else if(f&&(o=f.getElementById(r))&&Q.contains(t,o)&&o.id===r)return g.call(n,o),n}else{if(u[2])return g.apply(n,t.getElementsByTagName(e)),n;if((r=u[3])&&t.getElementsByClassName)return g.apply(n,t.getElementsByClassName(r)),n}if(!(E[e+" "]||h&&h.test(e))){if(p=e,f=t,1===b&&(U.test(e)||z.test(e))){for((f=K.test(e)&&ae(t.parentNode)||t)==t&&m.scope||((a=t.getAttribute("id"))?a=x.escapeSelector(a):t.setAttribute("id",a=v)),s=(d=de(e)).length;s--;)d[s]=(a?"#"+a:":scope")+" "+ce(d[s]);p=d.join(",")}try{return g.apply(n,f.querySelectorAll(p)),n}catch(t){E(e,!0)}finally{a===v&&t.removeAttribute("id")}}}return be(e.replace(j,"$1"),t,n,i)}function ee(){var e=[];return function n(i,r){return e.push(i+" ")>t.cacheLength&&delete n[e.shift()],n[i+" "]=r}}function te(e){return e[v]=!0,e}function ne(e){var t=l.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ie(e){return function(t){return S(t,"input")&&t.type===e}}function re(e){return function(t){return(S(t,"input")||S(t,"button"))&&t.type===e}}function se(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Z(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function oe(e){return te((function(t){return t=+t,te((function(n,i){for(var r,s=e([],n.length,t),o=s.length;o--;)n[r=s[o]]&&(n[r]=!(i[r]=n[r]))}))}))}function ae(e){return e&&void 0!==e.getElementsByTagName&&e}function le(e){var n,i=e?e.ownerDocument||e:P;return i!=l&&9===i.nodeType&&i.documentElement?(u=(l=i).documentElement,c=!x.isXMLDoc(l),f=u.matches||u.webkitMatchesSelector||u.msMatchesSelector,u.msMatchesSelector&&P!=l&&(n=l.defaultView)&&n.top!==n&&n.addEventListener("unload",X),m.getById=ne((function(e){return u.appendChild(e).id=x.expando,!l.getElementsByName||!l.getElementsByName(x.expando).length})),m.disconnectedMatch=ne((function(e){return f.call(e,"*")})),m.scope=ne((function(){return l.querySelectorAll(":scope")})),m.cssHas=ne((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),m.getById?(t.filter.ID=function(e){var t=e.replace(Y,J);return function(e){return e.getAttribute("id")===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&c){var n=t.getElementById(e);return n?[n]:[]}}):(t.filter.ID=function(e){var t=e.replace(Y,J);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&c){var n,i,r,s=t.getElementById(e);if(s){if((n=s.getAttributeNode("id"))&&n.value===e)return[s];for(r=t.getElementsByName(e),i=0;s=r[i++];)if((n=s.getAttributeNode("id"))&&n.value===e)return[s]}return[]}}),t.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},t.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&c)return t.getElementsByClassName(e)},h=[],ne((function(e){var t;u.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||h.push("\\["+M+"*(?:value|"+D+")"),e.querySelectorAll("[id~="+v+"-]").length||h.push("~="),e.querySelectorAll("a#"+v+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll(":checked").length||h.push(":checked"),(t=l.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),u.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),(t=l.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")")})),m.cssHas||h.push(":has"),h=h.length&&new RegExp(h.join("|")),C=function(e,t){if(e===t)return o=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!m.sortDetached&&t.compareDocumentPosition(e)===n?e===l||e.ownerDocument==P&&Q.contains(P,e)?-1:t===l||t.ownerDocument==P&&Q.contains(P,t)?1:r?d.call(r,e)-d.call(r,t):0:4&n?-1:1)},l):l}for(e in Q.matches=function(e,t){return Q(e,null,null,t)},Q.matchesSelector=function(e,t){if(le(e),c&&!E[t+" "]&&(!h||!h.test(t)))try{var n=f.call(e,t);if(n||m.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){E(t,!0)}return Q(t,l,null,[e]).length>0},Q.contains=function(e,t){return(e.ownerDocument||e)!=l&&le(e),x.contains(e,t)},Q.attr=function(e,n){(e.ownerDocument||e)!=l&&le(e);var i=t.attrHandle[n.toLowerCase()],r=i&&p.call(t.attrHandle,n.toLowerCase())?i(e,n,!c):void 0;return void 0!==r?r:e.getAttribute(n)},Q.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},x.uniqueSort=function(e){var t,n=[],i=0,s=0;if(o=!m.sortStable,r=!m.sortStable&&a.call(e,0),B.call(e,C),o){for(;t=e[s++];)t===e[s]&&(i=n.push(s));for(;i--;)k.call(e,n[i],1)}return r=null,e},x.fn.uniqueSort=function(){return this.pushStack(x.uniqueSort(a.apply(this)))},t=x.expr={cacheLength:50,createPseudo:te,match:q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Y,J),e[3]=(e[3]||e[4]||e[5]||"").replace(Y,J),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Q.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Q.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return q.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&H.test(n)&&(t=de(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Y,J).toLowerCase();return"*"===e?function(){return!0}:function(e){return S(e,t)}},CLASS:function(e){var t=y[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&y(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(i){var r=Q.attr(i,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&r.indexOf(n)>-1:"$="===t?n&&r.slice(-n.length)===n:"~="===t?(" "+r.replace(N," ")+" ").indexOf(n)>-1:"|="===t&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,r){var s="nth"!==e.slice(0,3),o="last"!==e.slice(-4),a="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,l){var u,d,c,h,p,f=s!==o?"nextSibling":"previousSibling",g=t.parentNode,m=a&&t.nodeName.toLowerCase(),A=!l&&!a,y=!1;if(g){if(s){for(;f;){for(c=t;c=c[f];)if(a?S(c,m):1===c.nodeType)return!1;p=f="only"===e&&!p&&"nextSibling"}return!0}if(p=[o?g.firstChild:g.lastChild],o&&A){for(y=(h=(u=(d=g[v]||(g[v]={}))[e]||[])[0]===b&&u[1])&&u[2],c=h&&g.childNodes[h];c=++h&&c&&c[f]||(y=h=0)||p.pop();)if(1===c.nodeType&&++y&&c===t){d[e]=[b,h,y];break}}else if(A&&(y=h=(u=(d=t[v]||(t[v]={}))[e]||[])[0]===b&&u[1]),!1===y)for(;(c=++h&&c&&c[f]||(y=h=0)||p.pop())&&(!(a?S(c,m):1===c.nodeType)||!++y||(A&&((d=c[v]||(c[v]={}))[e]=[b,y]),c!==t)););return(y-=r)===i||y%i==0&&y/i>=0}}},PSEUDO:function(e,n){var i,r=t.pseudos[e]||t.setFilters[e.toLowerCase()]||Q.error("unsupported pseudo: "+e);return r[v]?r(n):r.length>1?(i=[e,e,"",n],t.setFilters.hasOwnProperty(e.toLowerCase())?te((function(e,t){for(var i,s=r(e,n),o=s.length;o--;)e[i=d.call(e,s[o])]=!(t[i]=s[o])})):function(e){return r(e,0,i)}):r}},pseudos:{not:te((function(e){var t=[],n=[],i=ve(e.replace(j,"$1"));return i[v]?te((function(e,t,n,r){for(var s,o=i(e,null,r,[]),a=e.length;a--;)(s=o[a])&&(e[a]=!(t[a]=s))})):function(e,r,s){return t[0]=e,i(t,null,s,n),t[0]=null,!n.pop()}})),has:te((function(e){return function(t){return Q(e,t).length>0}})),contains:te((function(e){return e=e.replace(Y,J),function(t){return(t.textContent||x.text(t)).indexOf(e)>-1}})),lang:te((function(e){return W.test(e||"")||Q.error("unsupported lang: "+e),e=e.replace(Y,J).toLowerCase(),function(t){var n;do{if(n=c?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(e){var t=i.location&&i.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===u},focus:function(e){return e===function(){try{return l.activeElement}catch(e){}}()&&l.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:se(!1),disabled:se(!0),checked:function(e){return S(e,"input")&&!!e.checked||S(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!t.pseudos.empty(e)},header:function(e){return V.test(e.nodeName)},input:function(e){return $.test(e.nodeName)},button:function(e){return S(e,"input")&&"button"===e.type||S(e,"button")},text:function(e){var t;return S(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:oe((function(){return[0]})),last:oe((function(e,t){return[t-1]})),eq:oe((function(e,t,n){return[n<0?n+t:n]})),even:oe((function(e,t){for(var n=0;nt?t:n;--i>=0;)e.push(i);return e})),gt:oe((function(e,t,n){for(var i=n<0?n+t:n;++i1?function(t,n,i){for(var r=e.length;r--;)if(!e[r](t,n,i))return!1;return!0}:e[0]}function fe(e,t,n,i,r){for(var s,o=[],a=0,l=e.length,u=null!=t;a-1&&(s[u]=!(o[u]=h))}}else p=fe(p===o?p.splice(v,p.length):p),r?r(null,o,p,l):g.apply(o,p)}))}function me(e){for(var i,r,s,o=e.length,a=t.relative[e[0].type],l=a||t.relative[" "],u=a?1:0,c=he((function(e){return e===i}),l,!0),h=he((function(e){return d.call(i,e)>-1}),l,!0),p=[function(e,t,r){var s=!a&&(r||t!=n)||((i=t).nodeType?c(e,t,r):h(e,t,r));return i=null,s}];u1&&pe(p),u>1&&ce(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(j,"$1"),r,u0,s=e.length>0,o=function(o,a,u,d,h){var p,f,m,v=0,A="0",y=o&&[],w=[],_=n,E=o||s&&t.find.TAG("*",h),C=b+=null==_?1:Math.random()||.1,D=E.length;for(h&&(n=a==l||a||h);A!==D&&null!=(p=E[A]);A++){if(s&&p){for(f=0,a||p.ownerDocument==l||(le(p),u=!c);m=e[f++];)if(m(p,a||l,u)){g.call(d,p);break}h&&(b=C)}r&&((p=!m&&p)&&v--,o&&y.push(p))}if(v+=A,r&&A!==v){for(f=0;m=i[f++];)m(y,w,a,u);if(o){if(v>0)for(;A--;)y[A]||w[A]||(w[A]=T.call(d));w=fe(w)}g.apply(d,w),h&&!o&&w.length>0&&v+i.length>1&&x.uniqueSort(d)}return h&&(b=C,n=_),y};return r?te(o):o}(o,s)),a.selector=e}return a}function be(e,n,i,r){var s,o,a,l,u,d="function"==typeof e&&e,h=!r&&de(e=d.selector||e);if(i=i||[],1===h.length){if((o=h[0]=h[0].slice(0)).length>2&&"ID"===(a=o[0]).type&&9===n.nodeType&&c&&t.relative[o[1].type]){if(!(n=(t.find.ID(a.matches[0].replace(Y,J),n)||[])[0]))return i;d&&(n=n.parentNode),e=e.slice(o.shift().value.length)}for(s=q.needsContext.test(e)?0:o.length;s--&&(a=o[s],!t.relative[l=a.type]);)if((u=t.find[l])&&(r=u(a.matches[0].replace(Y,J),K.test(o[0].type)&&ae(n.parentNode)||n))){if(o.splice(s,1),!(e=r.length&&ce(o)))return g.apply(i,r),i;break}}return(d||ve(e,h))(r,n,!c,i,!n||K.test(e)&&ae(n.parentNode)||n),i}ue.prototype=t.filters=t.pseudos,t.setFilters=new ue,m.sortStable=v.split("").sort(C).join("")===v,le(),m.sortDetached=ne((function(e){return 1&e.compareDocumentPosition(l.createElement("fieldset"))})),x.find=Q,x.expr[":"]=x.expr.pseudos,x.unique=x.uniqueSort,Q.compile=ve,Q.select=be,Q.setDocument=le,Q.tokenize=de,Q.escape=x.escapeSelector,Q.getText=x.text,Q.isXML=x.isXMLDoc,Q.selectors=x.expr,Q.support=x.support,Q.uniqueSort=x.uniqueSort}();var L=function(e,t,n){for(var i=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&x(e).is(n))break;i.push(e)}return i},N=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},F=x.expr.match.needsContext,z=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function U(e,t,n){return v(t)?x.grep(e,(function(e,i){return!!t.call(e,i,e)!==n})):t.nodeType?x.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?x.grep(e,(function(e){return d.call(t,e)>-1!==n})):x.filter(t,e,n)}x.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?x.find.matchesSelector(i,e)?[i]:[]:x.find.matches(e,x.grep(t,(function(e){return 1===e.nodeType})))},x.fn.extend({find:function(e){var t,n,i=this.length,r=this;if("string"!=typeof e)return this.pushStack(x(e).filter((function(){for(t=0;t1?x.uniqueSort(n):n},filter:function(e){return this.pushStack(U(this,e||[],!1))},not:function(e){return this.pushStack(U(this,e||[],!0))},is:function(e){return!!U(this,"string"==typeof e&&F.test(e)?x(e):e||[],!1).length}});var H,W=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(x.fn.init=function(e,t,n){var i,r;if(!e)return this;if(n=n||H,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:W.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof x?t[0]:t,x.merge(this,x.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:A,!0)),z.test(i[1])&&x.isPlainObject(t))for(i in t)v(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(r=A.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(x):x.makeArray(e,this)}).prototype=x.fn,H=x(A);var q=/^(?:parents|prev(?:Until|All))/,$={children:!0,contents:!0,next:!0,prev:!0};function V(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}x.fn.extend({has:function(e){var t=x(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&x.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(s.length>1?x.uniqueSort(s):s)},index:function(e){return e?"string"==typeof e?d.call(x(e),this[0]):d.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(x.uniqueSort(x.merge(this.get(),x(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return L(e,"parentNode")},parentsUntil:function(e,t,n){return L(e,"parentNode",n)},next:function(e){return V(e,"nextSibling")},prev:function(e){return V(e,"previousSibling")},nextAll:function(e){return L(e,"nextSibling")},prevAll:function(e){return L(e,"previousSibling")},nextUntil:function(e,t,n){return L(e,"nextSibling",n)},prevUntil:function(e,t,n){return L(e,"previousSibling",n)},siblings:function(e){return N((e.parentNode||{}).firstChild,e)},children:function(e){return N(e.firstChild)},contents:function(e){return null!=e.contentDocument&&o(e.contentDocument)?e.contentDocument:(S(e,"template")&&(e=e.content||e),x.merge([],e.childNodes))}},(function(e,t){x.fn[e]=function(n,i){var r=x.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=x.filter(i,r)),this.length>1&&($[e]||x.uniqueSort(r),q.test(e)&&r.reverse()),this.pushStack(r)}}));var G=/[^\x20\t\r\n\f]+/g;function K(e){return e}function Y(e){throw e}function J(e,t,n,i){var r;try{e&&v(r=e.promise)?r.call(e).done(t).fail(n):e&&v(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(i))}catch(e){n.apply(void 0,[e])}}x.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return x.each(e.match(G)||[],(function(e,n){t[n]=!0})),t}(e):x.extend({},e);var t,n,i,r,s=[],o=[],a=-1,l=function(){for(r=r||e.once,i=t=!0;o.length;a=-1)for(n=o.shift();++a-1;)s.splice(n,1),n<=a&&a--})),this},has:function(e){return e?x.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return r=o=[],s=n="",this},disabled:function(){return!s},lock:function(){return r=o=[],n||t||(s=n=""),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=[e,(n=n||[]).slice?n.slice():n],o.push(n),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!i}};return u},x.extend({Deferred:function(e){var t=[["notify","progress",x.Callbacks("memory"),x.Callbacks("memory"),2],["resolve","done",x.Callbacks("once memory"),x.Callbacks("once memory"),0,"resolved"],["reject","fail",x.Callbacks("once memory"),x.Callbacks("once memory"),1,"rejected"]],n="pending",r={state:function(){return n},always:function(){return s.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return x.Deferred((function(n){x.each(t,(function(t,i){var r=v(e[i[4]])&&e[i[4]];s[i[1]]((function(){var e=r&&r.apply(this,arguments);e&&v(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,r?[e]:arguments)}))})),e=null})).promise()},then:function(e,n,r){var s=0;function o(e,t,n,r){return function(){var a=this,l=arguments,u=function(){var i,u;if(!(e=s&&(n!==Y&&(a=void 0,l=[i]),t.rejectWith(a,l))}};e?d():(x.Deferred.getErrorHook?d.error=x.Deferred.getErrorHook():x.Deferred.getStackHook&&(d.error=x.Deferred.getStackHook()),i.setTimeout(d))}}return x.Deferred((function(i){t[0][3].add(o(0,i,v(r)?r:K,i.notifyWith)),t[1][3].add(o(0,i,v(e)?e:K)),t[2][3].add(o(0,i,v(n)?n:Y))})).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},s={};return x.each(t,(function(e,i){var o=i[2],a=i[5];r[i[1]]=o.add,a&&o.add((function(){n=a}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),o.add(i[3].fire),s[i[0]]=function(){return s[i[0]+"With"](this===s?void 0:this,arguments),this},s[i[0]+"With"]=o.fireWith})),r.promise(s),e&&e.call(s,s),s},when:function(e){var t=arguments.length,n=t,i=Array(n),r=a.call(arguments),s=x.Deferred(),o=function(e){return function(n){i[e]=this,r[e]=arguments.length>1?a.call(arguments):n,--t||s.resolveWith(i,r)}};if(t<=1&&(J(e,s.done(o(n)).resolve,s.reject,!t),"pending"===s.state()||v(r[n]&&r[n].then)))return s.then();for(;n--;)J(r[n],o(n),s.reject);return s.promise()}});var X=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;x.Deferred.exceptionHook=function(e,t){i.console&&i.console.warn&&e&&X.test(e.name)&&i.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},x.readyException=function(e){i.setTimeout((function(){throw e}))};var Z=x.Deferred();function Q(){A.removeEventListener("DOMContentLoaded",Q),i.removeEventListener("load",Q),x.ready()}x.fn.ready=function(e){return Z.then(e).catch((function(e){x.readyException(e)})),this},x.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--x.readyWait:x.isReady)||(x.isReady=!0,!0!==e&&--x.readyWait>0||Z.resolveWith(A,[x]))}}),x.ready.then=Z.then,"complete"===A.readyState||"loading"!==A.readyState&&!A.documentElement.doScroll?i.setTimeout(x.ready):(A.addEventListener("DOMContentLoaded",Q),i.addEventListener("load",Q));var ee=function(e,t,n,i,r,s,o){var a=0,l=e.length,u=null==n;if("object"===_(n))for(a in r=!0,n)ee(e,t,a,n[a],!0,s,o);else if(void 0!==i&&(r=!0,v(i)||(o=!0),u&&(o?(t.call(e,i),t=null):(u=t,t=function(e,t,n){return u.call(x(e),n)})),t))for(;a1,null,!0)},removeData:function(e){return this.each((function(){le.remove(this,e)}))}}),x.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=ae.get(e,t),n&&(!i||Array.isArray(n)?i=ae.access(e,t,x.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),i=n.length,r=n.shift(),s=x._queueHooks(e,t);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===t&&n.unshift("inprogress"),delete s.stop,r.call(e,(function(){x.dequeue(e,t)}),s)),!i&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ae.get(e,n)||ae.access(e,n,{empty:x.Callbacks("once memory").add((function(){ae.remove(e,[t+"queue",n])}))})}}),x.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,Se=/^$|^module$|\/(?:java|ecma)script/i;Ee=A.createDocumentFragment().appendChild(A.createElement("div")),(Ce=A.createElement("input")).setAttribute("type","radio"),Ce.setAttribute("checked","checked"),Ce.setAttribute("name","t"),Ee.appendChild(Ce),m.checkClone=Ee.cloneNode(!0).cloneNode(!0).lastChild.checked,Ee.innerHTML="",m.noCloneChecked=!!Ee.cloneNode(!0).lastChild.defaultValue,Ee.innerHTML="",m.option=!!Ee.lastChild;var Te={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Be(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&S(e,t)?x.merge([e],n):n}function ke(e,t){for(var n=0,i=e.length;n",""]);var Me=/<|&#?\w+;/;function je(e,t,n,i,r){for(var s,o,a,l,u,d,c=t.createDocumentFragment(),h=[],p=0,f=e.length;p-1)r&&r.push(s);else if(u=me(s),o=Be(c.appendChild(s),"script"),u&&ke(o),n)for(d=0;s=o[d++];)Se.test(s.type||"")&&n.push(s);return c}var Oe=/^([^.]*)(?:\.(.+)|)/;function Ie(){return!0}function Pe(){return!1}function Re(e,t,n,i,r,s){var o,a;if("object"==typeof t){for(a in"string"!=typeof n&&(i=i||n,n=void 0),t)Re(e,a,n,i,t[a],s);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=Pe;else if(!r)return e;return 1===s&&(o=r,r=function(e){return x().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=x.guid++)),e.each((function(){x.event.add(this,t,r,i,n)}))}function Le(e,t,n){n?(ae.set(e,t,!1),x.event.add(e,t,{namespace:!1,handler:function(e){var n,i=ae.get(this,t);if(1&e.isTrigger&&this[t]){if(i)(x.event.special[t]||{}).delegateType&&e.stopPropagation();else if(i=a.call(arguments),ae.set(this,t,i),this[t](),n=ae.get(this,t),ae.set(this,t,!1),i!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else i&&(ae.set(this,t,x.event.trigger(i[0],i.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Ie)}})):void 0===ae.get(e,t)&&x.event.add(e,t,Ie)}x.event={global:{},add:function(e,t,n,i,r){var s,o,a,l,u,d,c,h,p,f,g,m=ae.get(e);if(se(e))for(n.handler&&(n=(s=n).handler,r=s.selector),r&&x.find.matchesSelector(ge,r),n.guid||(n.guid=x.guid++),(l=m.events)||(l=m.events=Object.create(null)),(o=m.handle)||(o=m.handle=function(t){return void 0!==x&&x.event.triggered!==t.type?x.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(G)||[""]).length;u--;)p=g=(a=Oe.exec(t[u])||[])[1],f=(a[2]||"").split(".").sort(),p&&(c=x.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,c=x.event.special[p]||{},d=x.extend({type:p,origType:g,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&x.expr.match.needsContext.test(r),namespace:f.join(".")},s),(h=l[p])||((h=l[p]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(e,i,f,o)||e.addEventListener&&e.addEventListener(p,o)),c.add&&(c.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),r?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[p]=!0)},remove:function(e,t,n,i,r){var s,o,a,l,u,d,c,h,p,f,g,m=ae.hasData(e)&&ae.get(e);if(m&&(l=m.events)){for(u=(t=(t||"").match(G)||[""]).length;u--;)if(p=g=(a=Oe.exec(t[u])||[])[1],f=(a[2]||"").split(".").sort(),p){for(c=x.event.special[p]||{},h=l[p=(i?c.delegateType:c.bindType)||p]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=h.length;s--;)d=h[s],!r&&g!==d.origType||n&&n.guid!==d.guid||a&&!a.test(d.namespace)||i&&i!==d.selector&&("**"!==i||!d.selector)||(h.splice(s,1),d.selector&&h.delegateCount--,c.remove&&c.remove.call(e,d));o&&!h.length&&(c.teardown&&!1!==c.teardown.call(e,f,m.handle)||x.removeEvent(e,p,m.handle),delete l[p])}else for(p in l)x.event.remove(e,p+t[u],n,i,!0);x.isEmptyObject(l)&&ae.remove(e,"handle events")}},dispatch:function(e){var t,n,i,r,s,o,a=new Array(arguments.length),l=x.event.fix(e),u=(ae.get(this,"events")||Object.create(null))[l.type]||[],d=x.event.special[l.type]||{};for(a[0]=l,t=1;t=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(s=[],o={},n=0;n-1:x.find(r,this,null,[u]).length),o[r]&&s.push(i);s.length&&a.push({elem:u,handlers:s})}return u=this,l\s*$/g;function Ue(e,t){return S(e,"table")&&S(11!==t.nodeType?t:t.firstChild,"tr")&&x(e).children("tbody")[0]||e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function qe(e,t){var n,i,r,s,o,a;if(1===t.nodeType){if(ae.hasData(e)&&(a=ae.get(e).events))for(r in ae.remove(t,"handle events"),a)for(n=0,i=a[r].length;n1&&"string"==typeof f&&!m.checkClone&&Fe.test(f))return e.each((function(r){var s=e.eq(r);g&&(t[0]=f.call(this,r,s.html())),Ve(s,t,n,i)}));if(h&&(s=(r=je(t,e[0].ownerDocument,!1,e,i)).firstChild,1===r.childNodes.length&&(r=s),s||i)){for(a=(o=x.map(Be(r,"script"),He)).length;c0&&ke(o,!l&&Be(e,"script")),a},cleanData:function(e){for(var t,n,i,r=x.event.special,s=0;void 0!==(n=e[s]);s++)if(se(n)){if(t=n[ae.expando]){if(t.events)for(i in t.events)r[i]?x.event.remove(n,i):x.removeEvent(n,i,t.handle);n[ae.expando]=void 0}n[le.expando]&&(n[le.expando]=void 0)}}}),x.fn.extend({detach:function(e){return Ge(this,e,!0)},remove:function(e){return Ge(this,e)},text:function(e){return ee(this,(function(e){return void 0===e?x.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Ve(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ue(this,e).appendChild(e)}))},prepend:function(){return Ve(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ue(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Ve(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Ve(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(x.cleanData(Be(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return x.clone(this,e,t)}))},html:function(e){return ee(this,(function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!Te[(De.exec(e)||["",""])[1].toLowerCase()]){e=x.htmlPrefilter(e);try{for(;n=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-s-l-a-.5))||0),l+u}function dt(e,t,n){var i=Je(e),r=(!m.boxSizingReliable()||n)&&"border-box"===x.css(e,"boxSizing",!1,i),s=r,o=Qe(e,t,i),a="offset"+t[0].toUpperCase()+t.slice(1);if(Ke.test(o)){if(!n)return o;o="auto"}return(!m.boxSizingReliable()&&r||!m.reliableTrDimensions()&&S(e,"tr")||"auto"===o||!parseFloat(o)&&"inline"===x.css(e,"display",!1,i))&&e.getClientRects().length&&(r="border-box"===x.css(e,"boxSizing",!1,i),(s=a in e)&&(o=e[a])),(o=parseFloat(o)||0)+ut(e,t,n||(r?"border":"content"),s,i,o)+"px"}function ct(e,t,n,i,r){return new ct.prototype.init(e,t,n,i,r)}x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Qe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,s,o,a=re(t),l=Ye.test(t),u=e.style;if(l||(t=rt(a)),o=x.cssHooks[t]||x.cssHooks[a],void 0===n)return o&&"get"in o&&void 0!==(r=o.get(e,!1,i))?r:u[t];"string"==(s=typeof n)&&(r=pe.exec(n))&&r[1]&&(n=Ae(e,t,r),s="number"),null!=n&&n==n&&("number"!==s||l||(n+=r&&r[3]||(x.cssNumber[a]?"":"px")),m.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),o&&"set"in o&&void 0===(n=o.set(e,n,i))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,i){var r,s,o,a=re(t);return Ye.test(t)||(t=rt(a)),(o=x.cssHooks[t]||x.cssHooks[a])&&"get"in o&&(r=o.get(e,!0,n)),void 0===r&&(r=Qe(e,t,i)),"normal"===r&&t in at&&(r=at[t]),""===n||n?(s=parseFloat(r),!0===n||isFinite(s)?s||0:r):r}}),x.each(["height","width"],(function(e,t){x.cssHooks[t]={get:function(e,n,i){if(n)return!st.test(x.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?dt(e,t,i):Xe(e,ot,(function(){return dt(e,t,i)}))},set:function(e,n,i){var r,s=Je(e),o=!m.scrollboxSize()&&"absolute"===s.position,a=(o||i)&&"border-box"===x.css(e,"boxSizing",!1,s),l=i?ut(e,t,i,a,s):0;return a&&o&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(s[t])-ut(e,t,"border",!1,s)-.5)),l&&(r=pe.exec(n))&&"px"!==(r[3]||"px")&&(e.style[t]=n,n=x.css(e,t)),lt(0,n,l)}}})),x.cssHooks.marginLeft=et(m.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Qe(e,"marginLeft"))||e.getBoundingClientRect().left-Xe(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),x.each({margin:"",padding:"",border:"Width"},(function(e,t){x.cssHooks[e+t]={expand:function(n){for(var i=0,r={},s="string"==typeof n?n.split(" "):[n];i<4;i++)r[e+fe[i]+t]=s[i]||s[i-2]||s[0];return r}},"margin"!==e&&(x.cssHooks[e+t].set=lt)})),x.fn.extend({css:function(e,t){return ee(this,(function(e,t,n){var i,r,s={},o=0;if(Array.isArray(t)){for(i=Je(e),r=t.length;o1)}}),x.Tween=ct,ct.prototype={constructor:ct,init:function(e,t,n,i,r,s){this.elem=e,this.prop=n,this.easing=r||x.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=s||(x.cssNumber[n]?"":"px")},cur:function(){var e=ct.propHooks[this.prop];return e&&e.get?e.get(this):ct.propHooks._default.get(this)},run:function(e){var t,n=ct.propHooks[this.prop];return this.options.duration?this.pos=t=x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ct.propHooks._default.set(this),this}},ct.prototype.init.prototype=ct.prototype,ct.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=x.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):1!==e.elem.nodeType||!x.cssHooks[e.prop]&&null==e.elem.style[rt(e.prop)]?e.elem[e.prop]=e.now:x.style(e.elem,e.prop,e.now+e.unit)}}},ct.propHooks.scrollTop=ct.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},x.fx=ct.prototype.init,x.fx.step={};var ht,pt,ft=/^(?:toggle|show|hide)$/,gt=/queueHooks$/;function mt(){pt&&(!1===A.hidden&&i.requestAnimationFrame?i.requestAnimationFrame(mt):i.setTimeout(mt,x.fx.interval),x.fx.tick())}function vt(){return i.setTimeout((function(){ht=void 0})),ht=Date.now()}function bt(e,t){var n,i=0,r={height:e};for(t=t?1:0;i<4;i+=2-t)r["margin"+(n=fe[i])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function At(e,t,n){for(var i,r=(yt.tweeners[t]||[]).concat(yt.tweeners["*"]),s=0,o=r.length;s1)},removeAttr:function(e){return this.each((function(){x.removeAttr(this,e)}))}}),x.extend({attr:function(e,t,n){var i,r,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===e.getAttribute?x.prop(e,t,n):(1===s&&x.isXMLDoc(e)||(r=x.attrHooks[t.toLowerCase()]||(x.expr.match.bool.test(t)?wt:void 0)),void 0!==n?null===n?void x.removeAttr(e,t):r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=x.find.attr(e,t))?void 0:i)},attrHooks:{type:{set:function(e,t){if(!m.radioValue&&"radio"===t&&S(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i=0,r=t&&t.match(G);if(r&&1===e.nodeType)for(;n=r[i++];)e.removeAttribute(n)}}),wt={set:function(e,t,n){return!1===t?x.removeAttr(e,n):e.setAttribute(n,n),n}},x.each(x.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=_t[t]||x.find.attr;_t[t]=function(e,t,i){var r,s,o=t.toLowerCase();return i||(s=_t[o],_t[o]=r,r=null!=n(e,t,i)?o:null,_t[o]=s),r}}));var Et=/^(?:input|select|textarea|button)$/i,Ct=/^(?:a|area)$/i;function xt(e){return(e.match(G)||[]).join(" ")}function Dt(e){return e.getAttribute&&e.getAttribute("class")||""}function St(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(G)||[]}x.fn.extend({prop:function(e,t){return ee(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[x.propFix[e]||e]}))}}),x.extend({prop:function(e,t,n){var i,r,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&x.isXMLDoc(e)||(t=x.propFix[t]||t,r=x.propHooks[t]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:e[t]=n:r&&"get"in r&&null!==(i=r.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Et.test(e.nodeName)||Ct.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){x.propFix[this.toLowerCase()]=this})),x.fn.extend({addClass:function(e){var t,n,i,r,s,o;return v(e)?this.each((function(t){x(this).addClass(e.call(this,t,Dt(this)))})):(t=St(e)).length?this.each((function(){if(i=Dt(this),n=1===this.nodeType&&" "+xt(i)+" "){for(s=0;s-1;)n=n.replace(" "+r+" "," ");o=xt(n),i!==o&&this.setAttribute("class",o)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,i,r,s,o=typeof e,a="string"===o||Array.isArray(e);return v(e)?this.each((function(n){x(this).toggleClass(e.call(this,n,Dt(this),t),t)})):"boolean"==typeof t&&a?t?this.addClass(e):this.removeClass(e):(n=St(e),this.each((function(){if(a)for(s=x(this),r=0;r-1)return!0;return!1}});var Tt=/\r/g;x.fn.extend({val:function(e){var t,n,i,r=this[0];return arguments.length?(i=v(e),this.each((function(n){var r;1===this.nodeType&&(null==(r=i?e.call(this,n,x(this).val()):e)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=x.map(r,(function(e){return null==e?"":e+""}))),(t=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))}))):r?(t=x.valHooks[r.type]||x.valHooks[r.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(Tt,""):null==n?"":n:void 0}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:xt(x.text(e))}},select:{get:function(e){var t,n,i,r=e.options,s=e.selectedIndex,o="select-one"===e.type,a=o?null:[],l=o?s+1:r.length;for(i=s<0?l:o?s:0;i-1)&&(n=!0);return n||(e.selectedIndex=-1),s}}}}),x.each(["radio","checkbox"],(function(){x.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=x.inArray(x(e).val(),t)>-1}},m.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var Bt=i.location,kt={guid:Date.now()},Mt=/\?/;x.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new i.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||x.error("Invalid XML: "+(n?x.map(n.childNodes,(function(e){return e.textContent})).join("\n"):e)),t};var jt=/^(?:focusinfocus|focusoutblur)$/,Ot=function(e){e.stopPropagation()};x.extend(x.event,{trigger:function(e,t,n,r){var s,o,a,l,u,d,c,h,f=[n||A],g=p.call(e,"type")?e.type:e,m=p.call(e,"namespace")?e.namespace.split("."):[];if(o=h=a=n=n||A,3!==n.nodeType&&8!==n.nodeType&&!jt.test(g+x.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),u=g.indexOf(":")<0&&"on"+g,(e=e[x.expando]?e:new x.Event(g,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=m.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:x.makeArray(t,[e]),c=x.event.special[g]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!b(n)){for(l=c.delegateType||g,jt.test(l+g)||(o=o.parentNode);o;o=o.parentNode)f.push(o),a=o;a===(n.ownerDocument||A)&&f.push(a.defaultView||a.parentWindow||i)}for(s=0;(o=f[s++])&&!e.isPropagationStopped();)h=o,e.type=s>1?l:c.bindType||g,(d=(ae.get(o,"events")||Object.create(null))[e.type]&&ae.get(o,"handle"))&&d.apply(o,t),(d=u&&o[u])&&d.apply&&se(o)&&(e.result=d.apply(o,t),!1===e.result&&e.preventDefault());return e.type=g,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(f.pop(),t)||!se(n)||u&&v(n[g])&&!b(n)&&((a=n[u])&&(n[u]=null),x.event.triggered=g,e.isPropagationStopped()&&h.addEventListener(g,Ot),n[g](),e.isPropagationStopped()&&h.removeEventListener(g,Ot),x.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0});x.event.trigger(i,null,t)}}),x.fn.extend({trigger:function(e,t){return this.each((function(){x.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return x.event.trigger(e,t,n,!0)}});var It=/\[\]$/,Pt=/\r?\n/g,Rt=/^(?:submit|button|image|reset|file)$/i,Lt=/^(?:input|select|textarea|keygen)/i;function Nt(e,t,n,i){var r;if(Array.isArray(t))x.each(t,(function(t,r){n||It.test(e)?i(e,r):Nt(e+"["+("object"==typeof r&&null!=r?t:"")+"]",r,n,i)}));else if(n||"object"!==_(t))i(e,t);else for(r in t)Nt(e+"["+r+"]",t[r],n,i)}x.param=function(e,t){var n,i=[],r=function(e,t){var n=v(t)?t():t;i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,(function(){r(this.name,this.value)}));else for(n in e)Nt(n,e[n],t,r);return i.join("&")},x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&Lt.test(this.nodeName)&&!Rt.test(e)&&(this.checked||!xe.test(e))})).map((function(e,t){var n=x(this).val();return null==n?null:Array.isArray(n)?x.map(n,(function(e){return{name:t.name,value:e.replace(Pt,"\r\n")}})):{name:t.name,value:n.replace(Pt,"\r\n")}})).get()}});var Ft=/%20/g,zt=/#.*$/,Ut=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Wt=/^(?:GET|HEAD)$/,qt=/^\/\//,$t={},Vt={},Gt="*/".concat("*"),Kt=A.createElement("a");function Yt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,r=0,s=t.toLowerCase().match(G)||[];if(v(n))for(;i=s[r++];)"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function Jt(e,t,n,i){var r={},s=e===Vt;function o(a){var l;return r[a]=!0,x.each(e[a]||[],(function(e,a){var u=a(t,n,i);return"string"!=typeof u||s||r[u]?s?!(l=u):void 0:(t.dataTypes.unshift(u),o(u),!1)})),l}return o(t.dataTypes[0])||!r["*"]&&o("*")}function Xt(e,t){var n,i,r=x.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:i||(i={}))[n]=t[n]);return i&&x.extend(!0,e,i),e}Kt.href=Bt.href,x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Bt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Gt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Xt(Xt(e,x.ajaxSettings),t):Xt(x.ajaxSettings,e)},ajaxPrefilter:Yt($t),ajaxTransport:Yt(Vt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,r,s,o,a,l,u,d,c,h,p=x.ajaxSetup({},t),f=p.context||p,g=p.context&&(f.nodeType||f.jquery)?x(f):x.event,m=x.Deferred(),v=x.Callbacks("once memory"),b=p.statusCode||{},y={},w={},_="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(u){if(!o)for(o={};t=Ht.exec(s);)o[t[1].toLowerCase()+" "]=(o[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=o[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?s:null},setRequestHeader:function(e,t){return null==u&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,y[e]=t),this},overrideMimeType:function(e){return null==u&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)E.always(e[E.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||_;return n&&n.abort(t),C(0,t),this}};if(m.promise(E),p.url=((e||p.url||Bt.href)+"").replace(qt,Bt.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(G)||[""],null==p.crossDomain){l=A.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Kt.protocol+"//"+Kt.host!=l.protocol+"//"+l.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),Jt($t,p,t,E),u)return E;for(c in(d=x.event&&p.global)&&0==x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Wt.test(p.type),r=p.url.replace(zt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Ft,"+")):(h=p.url.slice(r.length),p.data&&(p.processData||"string"==typeof p.data)&&(r+=(Mt.test(r)?"&":"?")+p.data,delete p.data),!1===p.cache&&(r=r.replace(Ut,"$1"),h=(Mt.test(r)?"&":"?")+"_="+kt.guid+++h),p.url=r+h),p.ifModified&&(x.lastModified[r]&&E.setRequestHeader("If-Modified-Since",x.lastModified[r]),x.etag[r]&&E.setRequestHeader("If-None-Match",x.etag[r])),(p.data&&p.hasContent&&!1!==p.contentType||t.contentType)&&E.setRequestHeader("Content-Type",p.contentType),E.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Gt+"; q=0.01":""):p.accepts["*"]),p.headers)E.setRequestHeader(c,p.headers[c]);if(p.beforeSend&&(!1===p.beforeSend.call(f,E,p)||u))return E.abort();if(_="abort",v.add(p.complete),E.done(p.success),E.fail(p.error),n=Jt(Vt,p,t,E)){if(E.readyState=1,d&&g.trigger("ajaxSend",[E,p]),u)return E;p.async&&p.timeout>0&&(a=i.setTimeout((function(){E.abort("timeout")}),p.timeout));try{u=!1,n.send(y,C)}catch(e){if(u)throw e;C(-1,e)}}else C(-1,"No Transport");function C(e,t,o,l){var c,h,A,y,w,_=t;u||(u=!0,a&&i.clearTimeout(a),n=void 0,s=l||"",E.readyState=e>0?4:0,c=e>=200&&e<300||304===e,o&&(y=function(e,t,n){for(var i,r,s,o,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){l.unshift(r);break}if(l[0]in n)s=l[0];else{for(r in n){if(!l[0]||e.converters[r+" "+l[0]]){s=r;break}o||(o=r)}s=s||o}if(s)return s!==l[0]&&l.unshift(s),n[s]}(p,E,o)),!c&&x.inArray("script",p.dataTypes)>-1&&x.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),y=function(e,t,n,i){var r,s,o,a,l,u={},d=e.dataTypes.slice();if(d[1])for(o in e.converters)u[o.toLowerCase()]=e.converters[o];for(s=d.shift();s;)if(e.responseFields[s]&&(n[e.responseFields[s]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=s,s=d.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(!(o=u[l+" "+s]||u["* "+s]))for(r in u)if((a=r.split(" "))[1]===s&&(o=u[l+" "+a[0]]||u["* "+a[0]])){!0===o?o=u[r]:!0!==u[r]&&(s=a[0],d.unshift(a[1]));break}if(!0!==o)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+l+" to "+s}}}return{state:"success",data:t}}(p,y,E,c),c?(p.ifModified&&((w=E.getResponseHeader("Last-Modified"))&&(x.lastModified[r]=w),(w=E.getResponseHeader("etag"))&&(x.etag[r]=w)),204===e||"HEAD"===p.type?_="nocontent":304===e?_="notmodified":(_=y.state,h=y.data,c=!(A=y.error))):(A=_,!e&&_||(_="error",e<0&&(e=0))),E.status=e,E.statusText=(t||_)+"",c?m.resolveWith(f,[h,_,E]):m.rejectWith(f,[E,_,A]),E.statusCode(b),b=void 0,d&&g.trigger(c?"ajaxSuccess":"ajaxError",[E,p,c?h:A]),v.fireWith(f,[E,_]),d&&(g.trigger("ajaxComplete",[E,p]),--x.active||x.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,t){return x.get(e,void 0,t,"script")}}),x.each(["get","post"],(function(e,t){x[t]=function(e,n,i,r){return v(n)&&(r=r||i,i=n,n=void 0),x.ajax(x.extend({url:e,type:t,dataType:r,data:n,success:i},x.isPlainObject(e)&&e))}})),x.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),x._evalUrl=function(e,t,n){return x.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){x.globalEval(e,t,n)}})},x.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=x(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return v(e)?this.each((function(t){x(this).wrapInner(e.call(this,t))})):this.each((function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=v(e);return this.each((function(n){x(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){x(this).replaceWith(this.childNodes)})),this}}),x.expr.pseudos.hidden=function(e){return!x.expr.pseudos.visible(e)},x.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},x.ajaxSettings.xhr=function(){try{return new i.XMLHttpRequest}catch(e){}};var Zt={0:200,1223:204},Qt=x.ajaxSettings.xhr();m.cors=!!Qt&&"withCredentials"in Qt,m.ajax=Qt=!!Qt,x.ajaxTransport((function(e){var t,n;if(m.cors||Qt&&!e.crossDomain)return{send:function(r,s){var o,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)a[o]=e.xhrFields[o];for(o in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(o,r[o]);t=function(e){return function(){t&&(t=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?s(0,"error"):s(a.status,a.statusText):s(Zt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=t(),n=a.onerror=a.ontimeout=t("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&i.setTimeout((function(){t&&n()}))},t=t("abort");try{a.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),x.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),x.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(i,r){t=x("`.\n this.sequenceIndex = Number(c === CharCodes.Lt);\n }\n };\n Tokenizer.prototype.stateCDATASequence = function (c) {\n if (c === Sequences.Cdata[this.sequenceIndex]) {\n if (++this.sequenceIndex === Sequences.Cdata.length) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CdataEnd;\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n }\n }\n else {\n this.sequenceIndex = 0;\n this.state = State.InDeclaration;\n this.stateInDeclaration(c); // Reconsume the character\n }\n };\n /**\n * When we wait for one specific character, we can speed things up\n * by skipping through the buffer until we find it.\n *\n * @returns Whether the character was found.\n */\n Tokenizer.prototype.fastForwardTo = function (c) {\n while (++this.index < this.buffer.length + this.offset) {\n if (this.buffer.charCodeAt(this.index - this.offset) === c) {\n return true;\n }\n }\n /*\n * We increment the index at the end of the `parse` loop,\n * so set it to `buffer.length - 1` here.\n *\n * TODO: Refactor `parse` to increment index before calling states.\n */\n this.index = this.buffer.length + this.offset - 1;\n return false;\n };\n /**\n * Comments and CDATA end with `-->` and `]]>`.\n *\n * Their common qualities are:\n * - Their end sequences have a distinct character they start with.\n * - That character is then repeated, so we have to check multiple repeats.\n * - All characters but the start character of the sequence can be skipped.\n */\n Tokenizer.prototype.stateInCommentLike = function (c) {\n if (c === this.currentSequence[this.sequenceIndex]) {\n if (++this.sequenceIndex === this.currentSequence.length) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, this.index, 2);\n }\n else {\n this.cbs.oncomment(this.sectionStart, this.index, 2);\n }\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n this.state = State.Text;\n }\n }\n else if (this.sequenceIndex === 0) {\n // Fast-forward to the first character of the sequence\n if (this.fastForwardTo(this.currentSequence[0])) {\n this.sequenceIndex = 1;\n }\n }\n else if (c !== this.currentSequence[this.sequenceIndex - 1]) {\n // Allow long sequences, eg. --->, ]]]>\n this.sequenceIndex = 0;\n }\n };\n /**\n * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.\n *\n * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).\n * We allow anything that wouldn't end the tag.\n */\n Tokenizer.prototype.isTagStartChar = function (c) {\n return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);\n };\n Tokenizer.prototype.startSpecial = function (sequence, offset) {\n this.isSpecial = true;\n this.currentSequence = sequence;\n this.sequenceIndex = offset;\n this.state = State.SpecialStartSequence;\n };\n Tokenizer.prototype.stateBeforeTagName = function (c) {\n if (c === CharCodes.ExclamationMark) {\n this.state = State.BeforeDeclaration;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Questionmark) {\n this.state = State.InProcessingInstruction;\n this.sectionStart = this.index + 1;\n }\n else if (this.isTagStartChar(c)) {\n var lower = c | 0x20;\n this.sectionStart = this.index;\n if (!this.xmlMode && lower === Sequences.TitleEnd[2]) {\n this.startSpecial(Sequences.TitleEnd, 3);\n }\n else {\n this.state =\n !this.xmlMode && lower === Sequences.ScriptEnd[2]\n ? State.BeforeSpecialS\n : State.InTagName;\n }\n }\n else if (c === CharCodes.Slash) {\n this.state = State.BeforeClosingTagName;\n }\n else {\n this.state = State.Text;\n this.stateText(c);\n }\n };\n Tokenizer.prototype.stateInTagName = function (c) {\n if (isEndOfTagSection(c)) {\n this.cbs.onopentagname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n };\n Tokenizer.prototype.stateBeforeClosingTagName = function (c) {\n if (isWhitespace(c)) {\n // Ignore\n }\n else if (c === CharCodes.Gt) {\n this.state = State.Text;\n }\n else {\n this.state = this.isTagStartChar(c)\n ? State.InClosingTagName\n : State.InSpecialComment;\n this.sectionStart = this.index;\n }\n };\n Tokenizer.prototype.stateInClosingTagName = function (c) {\n if (c === CharCodes.Gt || isWhitespace(c)) {\n this.cbs.onclosetag(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterClosingTagName;\n this.stateAfterClosingTagName(c);\n }\n };\n Tokenizer.prototype.stateAfterClosingTagName = function (c) {\n // Skip everything until \">\"\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.state = State.Text;\n this.baseState = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateBeforeAttributeName = function (c) {\n if (c === CharCodes.Gt) {\n this.cbs.onopentagend(this.index);\n if (this.isSpecial) {\n this.state = State.InSpecialTag;\n this.sequenceIndex = 0;\n }\n else {\n this.state = State.Text;\n }\n this.baseState = this.state;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Slash) {\n this.state = State.InSelfClosingTag;\n }\n else if (!isWhitespace(c)) {\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n };\n Tokenizer.prototype.stateInSelfClosingTag = function (c) {\n if (c === CharCodes.Gt) {\n this.cbs.onselfclosingtag(this.index);\n this.state = State.Text;\n this.baseState = State.Text;\n this.sectionStart = this.index + 1;\n this.isSpecial = false; // Reset special state, in case of self-closing special tags\n }\n else if (!isWhitespace(c)) {\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n };\n Tokenizer.prototype.stateInAttributeName = function (c) {\n if (c === CharCodes.Eq || isEndOfTagSection(c)) {\n this.cbs.onattribname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterAttributeName;\n this.stateAfterAttributeName(c);\n }\n };\n Tokenizer.prototype.stateAfterAttributeName = function (c) {\n if (c === CharCodes.Eq) {\n this.state = State.BeforeAttributeValue;\n }\n else if (c === CharCodes.Slash || c === CharCodes.Gt) {\n this.cbs.onattribend(QuoteType.NoValue, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (!isWhitespace(c)) {\n this.cbs.onattribend(QuoteType.NoValue, this.index);\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n };\n Tokenizer.prototype.stateBeforeAttributeValue = function (c) {\n if (c === CharCodes.DoubleQuote) {\n this.state = State.InAttributeValueDq;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.SingleQuote) {\n this.state = State.InAttributeValueSq;\n this.sectionStart = this.index + 1;\n }\n else if (!isWhitespace(c)) {\n this.sectionStart = this.index;\n this.state = State.InAttributeValueNq;\n this.stateInAttributeValueNoQuotes(c); // Reconsume token\n }\n };\n Tokenizer.prototype.handleInAttributeValue = function (c, quote) {\n if (c === quote ||\n (!this.decodeEntities && this.fastForwardTo(quote))) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(quote === CharCodes.DoubleQuote\n ? QuoteType.Double\n : QuoteType.Single, this.index);\n this.state = State.BeforeAttributeName;\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.baseState = this.state;\n this.state = State.BeforeEntity;\n }\n };\n Tokenizer.prototype.stateInAttributeValueDoubleQuotes = function (c) {\n this.handleInAttributeValue(c, CharCodes.DoubleQuote);\n };\n Tokenizer.prototype.stateInAttributeValueSingleQuotes = function (c) {\n this.handleInAttributeValue(c, CharCodes.SingleQuote);\n };\n Tokenizer.prototype.stateInAttributeValueNoQuotes = function (c) {\n if (isWhitespace(c) || c === CharCodes.Gt) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(QuoteType.Unquoted, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.baseState = this.state;\n this.state = State.BeforeEntity;\n }\n };\n Tokenizer.prototype.stateBeforeDeclaration = function (c) {\n if (c === CharCodes.OpeningSquareBracket) {\n this.state = State.CDATASequence;\n this.sequenceIndex = 0;\n }\n else {\n this.state =\n c === CharCodes.Dash\n ? State.BeforeComment\n : State.InDeclaration;\n }\n };\n Tokenizer.prototype.stateInDeclaration = function (c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.ondeclaration(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateInProcessingInstruction = function (c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.onprocessinginstruction(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateBeforeComment = function (c) {\n if (c === CharCodes.Dash) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CommentEnd;\n // Allow short comments (eg. )\n this.sequenceIndex = 2;\n this.sectionStart = this.index + 1;\n }\n else {\n this.state = State.InDeclaration;\n }\n };\n Tokenizer.prototype.stateInSpecialComment = function (c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.oncomment(this.sectionStart, this.index, 0);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateBeforeSpecialS = function (c) {\n var lower = c | 0x20;\n if (lower === Sequences.ScriptEnd[3]) {\n this.startSpecial(Sequences.ScriptEnd, 4);\n }\n else if (lower === Sequences.StyleEnd[3]) {\n this.startSpecial(Sequences.StyleEnd, 4);\n }\n else {\n this.state = State.InTagName;\n this.stateInTagName(c); // Consume the token again\n }\n };\n Tokenizer.prototype.stateBeforeEntity = function (c) {\n // Start excess with 1 to include the '&'\n this.entityExcess = 1;\n this.entityResult = 0;\n if (c === CharCodes.Number) {\n this.state = State.BeforeNumericEntity;\n }\n else if (c === CharCodes.Amp) {\n // We have two `&` characters in a row. Stay in the current state.\n }\n else {\n this.trieIndex = 0;\n this.trieCurrent = this.entityTrie[0];\n this.state = State.InNamedEntity;\n this.stateInNamedEntity(c);\n }\n };\n Tokenizer.prototype.stateInNamedEntity = function (c) {\n this.entityExcess += 1;\n this.trieIndex = (0, decode_js_1.determineBranch)(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c);\n if (this.trieIndex < 0) {\n this.emitNamedEntity();\n this.index--;\n return;\n }\n this.trieCurrent = this.entityTrie[this.trieIndex];\n var masked = this.trieCurrent & decode_js_1.BinTrieFlags.VALUE_LENGTH;\n // If the branch is a value, store it and continue\n if (masked) {\n // The mask is the number of bytes of the value, including the current byte.\n var valueLength = (masked >> 14) - 1;\n // If we have a legacy entity while parsing strictly, just skip the number of bytes\n if (!this.allowLegacyEntity() && c !== CharCodes.Semi) {\n this.trieIndex += valueLength;\n }\n else {\n // Add 1 as we have already incremented the excess\n var entityStart = this.index - this.entityExcess + 1;\n if (entityStart > this.sectionStart) {\n this.emitPartial(this.sectionStart, entityStart);\n }\n // If this is a surrogate pair, consume the next two bytes\n this.entityResult = this.trieIndex;\n this.trieIndex += valueLength;\n this.entityExcess = 0;\n this.sectionStart = this.index + 1;\n if (valueLength === 0) {\n this.emitNamedEntity();\n }\n }\n }\n };\n Tokenizer.prototype.emitNamedEntity = function () {\n this.state = this.baseState;\n if (this.entityResult === 0) {\n return;\n }\n var valueLength = (this.entityTrie[this.entityResult] & decode_js_1.BinTrieFlags.VALUE_LENGTH) >>\n 14;\n switch (valueLength) {\n case 1: {\n this.emitCodePoint(this.entityTrie[this.entityResult] &\n ~decode_js_1.BinTrieFlags.VALUE_LENGTH);\n break;\n }\n case 2: {\n this.emitCodePoint(this.entityTrie[this.entityResult + 1]);\n break;\n }\n case 3: {\n this.emitCodePoint(this.entityTrie[this.entityResult + 1]);\n this.emitCodePoint(this.entityTrie[this.entityResult + 2]);\n }\n }\n };\n Tokenizer.prototype.stateBeforeNumericEntity = function (c) {\n if ((c | 0x20) === CharCodes.LowerX) {\n this.entityExcess++;\n this.state = State.InHexEntity;\n }\n else {\n this.state = State.InNumericEntity;\n this.stateInNumericEntity(c);\n }\n };\n Tokenizer.prototype.emitNumericEntity = function (strict) {\n var entityStart = this.index - this.entityExcess - 1;\n var numberStart = entityStart + 2 + Number(this.state === State.InHexEntity);\n if (numberStart !== this.index) {\n // Emit leading data if any\n if (entityStart > this.sectionStart) {\n this.emitPartial(this.sectionStart, entityStart);\n }\n this.sectionStart = this.index + Number(strict);\n this.emitCodePoint((0, decode_js_1.replaceCodePoint)(this.entityResult));\n }\n this.state = this.baseState;\n };\n Tokenizer.prototype.stateInNumericEntity = function (c) {\n if (c === CharCodes.Semi) {\n this.emitNumericEntity(true);\n }\n else if (isNumber(c)) {\n this.entityResult = this.entityResult * 10 + (c - CharCodes.Zero);\n this.entityExcess++;\n }\n else {\n if (this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n }\n else {\n this.state = this.baseState;\n }\n this.index--;\n }\n };\n Tokenizer.prototype.stateInHexEntity = function (c) {\n if (c === CharCodes.Semi) {\n this.emitNumericEntity(true);\n }\n else if (isNumber(c)) {\n this.entityResult = this.entityResult * 16 + (c - CharCodes.Zero);\n this.entityExcess++;\n }\n else if (isHexDigit(c)) {\n this.entityResult =\n this.entityResult * 16 + ((c | 0x20) - CharCodes.LowerA + 10);\n this.entityExcess++;\n }\n else {\n if (this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n }\n else {\n this.state = this.baseState;\n }\n this.index--;\n }\n };\n Tokenizer.prototype.allowLegacyEntity = function () {\n return (!this.xmlMode &&\n (this.baseState === State.Text ||\n this.baseState === State.InSpecialTag));\n };\n /**\n * Remove data that has already been consumed from the buffer.\n */\n Tokenizer.prototype.cleanup = function () {\n // If we are inside of text or attributes, emit what we already have.\n if (this.running && this.sectionStart !== this.index) {\n if (this.state === State.Text ||\n (this.state === State.InSpecialTag && this.sequenceIndex === 0)) {\n this.cbs.ontext(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n else if (this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueNq) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n }\n };\n Tokenizer.prototype.shouldContinue = function () {\n return this.index < this.buffer.length + this.offset && this.running;\n };\n /**\n * Iterates through the buffer, calling the function corresponding to the current state.\n *\n * States that are more likely to be hit are higher up, as a performance improvement.\n */\n Tokenizer.prototype.parse = function () {\n while (this.shouldContinue()) {\n var c = this.buffer.charCodeAt(this.index - this.offset);\n switch (this.state) {\n case State.Text: {\n this.stateText(c);\n break;\n }\n case State.SpecialStartSequence: {\n this.stateSpecialStartSequence(c);\n break;\n }\n case State.InSpecialTag: {\n this.stateInSpecialTag(c);\n break;\n }\n case State.CDATASequence: {\n this.stateCDATASequence(c);\n break;\n }\n case State.InAttributeValueDq: {\n this.stateInAttributeValueDoubleQuotes(c);\n break;\n }\n case State.InAttributeName: {\n this.stateInAttributeName(c);\n break;\n }\n case State.InCommentLike: {\n this.stateInCommentLike(c);\n break;\n }\n case State.InSpecialComment: {\n this.stateInSpecialComment(c);\n break;\n }\n case State.BeforeAttributeName: {\n this.stateBeforeAttributeName(c);\n break;\n }\n case State.InTagName: {\n this.stateInTagName(c);\n break;\n }\n case State.InClosingTagName: {\n this.stateInClosingTagName(c);\n break;\n }\n case State.BeforeTagName: {\n this.stateBeforeTagName(c);\n break;\n }\n case State.AfterAttributeName: {\n this.stateAfterAttributeName(c);\n break;\n }\n case State.InAttributeValueSq: {\n this.stateInAttributeValueSingleQuotes(c);\n break;\n }\n case State.BeforeAttributeValue: {\n this.stateBeforeAttributeValue(c);\n break;\n }\n case State.BeforeClosingTagName: {\n this.stateBeforeClosingTagName(c);\n break;\n }\n case State.AfterClosingTagName: {\n this.stateAfterClosingTagName(c);\n break;\n }\n case State.BeforeSpecialS: {\n this.stateBeforeSpecialS(c);\n break;\n }\n case State.InAttributeValueNq: {\n this.stateInAttributeValueNoQuotes(c);\n break;\n }\n case State.InSelfClosingTag: {\n this.stateInSelfClosingTag(c);\n break;\n }\n case State.InDeclaration: {\n this.stateInDeclaration(c);\n break;\n }\n case State.BeforeDeclaration: {\n this.stateBeforeDeclaration(c);\n break;\n }\n case State.BeforeComment: {\n this.stateBeforeComment(c);\n break;\n }\n case State.InProcessingInstruction: {\n this.stateInProcessingInstruction(c);\n break;\n }\n case State.InNamedEntity: {\n this.stateInNamedEntity(c);\n break;\n }\n case State.BeforeEntity: {\n this.stateBeforeEntity(c);\n break;\n }\n case State.InHexEntity: {\n this.stateInHexEntity(c);\n break;\n }\n case State.InNumericEntity: {\n this.stateInNumericEntity(c);\n break;\n }\n default: {\n // `this._state === State.BeforeNumericEntity`\n this.stateBeforeNumericEntity(c);\n }\n }\n this.index++;\n }\n this.cleanup();\n };\n Tokenizer.prototype.finish = function () {\n if (this.state === State.InNamedEntity) {\n this.emitNamedEntity();\n }\n // If there is remaining data, emit it in a reasonable way\n if (this.sectionStart < this.index) {\n this.handleTrailingData();\n }\n this.cbs.onend();\n };\n /** Handle any trailing data. */\n Tokenizer.prototype.handleTrailingData = function () {\n var endIndex = this.buffer.length + this.offset;\n if (this.state === State.InCommentLike) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, endIndex, 0);\n }\n else {\n this.cbs.oncomment(this.sectionStart, endIndex, 0);\n }\n }\n else if (this.state === State.InNumericEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InHexEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InTagName ||\n this.state === State.BeforeAttributeName ||\n this.state === State.BeforeAttributeValue ||\n this.state === State.AfterAttributeName ||\n this.state === State.InAttributeName ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueNq ||\n this.state === State.InClosingTagName) {\n /*\n * If we are currently in an opening or closing tag, us not calling the\n * respective callback signals that the tag should be ignored.\n */\n }\n else {\n this.cbs.ontext(this.sectionStart, endIndex);\n }\n };\n Tokenizer.prototype.emitPartial = function (start, endIndex) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n this.cbs.onattribdata(start, endIndex);\n }\n else {\n this.cbs.ontext(start, endIndex);\n }\n };\n Tokenizer.prototype.emitCodePoint = function (cp) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n this.cbs.onattribentity(cp);\n }\n else {\n this.cbs.ontextentity(cp);\n }\n };\n return Tokenizer;\n}());\nexports.default = Tokenizer;\n//# sourceMappingURL=Tokenizer.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DomUtils = exports.parseFeed = exports.getFeed = exports.ElementType = exports.Tokenizer = exports.createDomStream = exports.parseDOM = exports.parseDocument = exports.DefaultHandler = exports.DomHandler = exports.Parser = void 0;\nvar Parser_js_1 = require(\"./Parser.js\");\nvar Parser_js_2 = require(\"./Parser.js\");\nObject.defineProperty(exports, \"Parser\", { enumerable: true, get: function () { return Parser_js_2.Parser; } });\nvar domhandler_1 = require(\"domhandler\");\nvar domhandler_2 = require(\"domhandler\");\nObject.defineProperty(exports, \"DomHandler\", { enumerable: true, get: function () { return domhandler_2.DomHandler; } });\n// Old name for DomHandler\nObject.defineProperty(exports, \"DefaultHandler\", { enumerable: true, get: function () { return domhandler_2.DomHandler; } });\n// Helper methods\n/**\n * Parses the data, returns the resulting document.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM builder.\n */\nfunction parseDocument(data, options) {\n var handler = new domhandler_1.DomHandler(undefined, options);\n new Parser_js_1.Parser(handler, options).end(data);\n return handler.root;\n}\nexports.parseDocument = parseDocument;\n/**\n * Parses data, returns an array of the root nodes.\n *\n * Note that the root nodes still have a `Document` node as their parent.\n * Use `parseDocument` to get the `Document` node instead.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM builder.\n * @deprecated Use `parseDocument` instead.\n */\nfunction parseDOM(data, options) {\n return parseDocument(data, options).children;\n}\nexports.parseDOM = parseDOM;\n/**\n * Creates a parser instance, with an attached DOM handler.\n *\n * @param callback A callback that will be called once parsing has been completed.\n * @param options Optional options for the parser and DOM builder.\n * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM.\n */\nfunction createDomStream(callback, options, elementCallback) {\n var handler = new domhandler_1.DomHandler(callback, options, elementCallback);\n return new Parser_js_1.Parser(handler, options);\n}\nexports.createDomStream = createDomStream;\nvar Tokenizer_js_1 = require(\"./Tokenizer.js\");\nObject.defineProperty(exports, \"Tokenizer\", { enumerable: true, get: function () { return __importDefault(Tokenizer_js_1).default; } });\n/*\n * All of the following exports exist for backwards-compatibility.\n * They should probably be removed eventually.\n */\nexports.ElementType = __importStar(require(\"domelementtype\"));\nvar domutils_1 = require(\"domutils\");\nvar domutils_2 = require(\"domutils\");\nObject.defineProperty(exports, \"getFeed\", { enumerable: true, get: function () { return domutils_2.getFeed; } });\nvar parseFeedDefaultOptions = { xmlMode: true };\n/**\n * Parse a feed.\n *\n * @param feed The feed that should be parsed, as a string.\n * @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`.\n */\nfunction parseFeed(feed, options) {\n if (options === void 0) { options = parseFeedDefaultOptions; }\n return (0, domutils_1.getFeed)(parseDOM(feed, options));\n}\nexports.parseFeed = parseFeed;\nexports.DomUtils = __importStar(require(\"domutils\"));\n//# sourceMappingURL=index.js.map","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/*!\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObject(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nfunction isPlainObject(o) {\n var ctor,prot;\n\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n\nexports.isPlainObject = isPlainObject;\n","const htmlparser = require('htmlparser2');\nconst escapeStringRegexp = require('escape-string-regexp');\nconst { isPlainObject } = require('is-plain-object');\nconst deepmerge = require('deepmerge');\nconst parseSrcset = require('parse-srcset');\nconst { parse: postcssParse } = require('postcss');\n// Tags that can conceivably represent stand-alone media.\nconst mediaTags = [\n 'img', 'audio', 'video', 'picture', 'svg',\n 'object', 'map', 'iframe', 'embed'\n];\n// Tags that are inherently vulnerable to being used in XSS attacks.\nconst vulnerableTags = [ 'script', 'style' ];\n\nfunction each(obj, cb) {\n if (obj) {\n Object.keys(obj).forEach(function (key) {\n cb(obj[key], key);\n });\n }\n}\n\n// Avoid false positives with .__proto__, .hasOwnProperty, etc.\nfunction has(obj, key) {\n return ({}).hasOwnProperty.call(obj, key);\n}\n\n// Returns those elements of `a` for which `cb(a)` returns truthy\nfunction filter(a, cb) {\n const n = [];\n each(a, function(v) {\n if (cb(v)) {\n n.push(v);\n }\n });\n return n;\n}\n\nfunction isEmptyObject(obj) {\n for (const key in obj) {\n if (has(obj, key)) {\n return false;\n }\n }\n return true;\n}\n\nfunction stringifySrcset(parsedSrcset) {\n return parsedSrcset.map(function(part) {\n if (!part.url) {\n throw new Error('URL missing');\n }\n\n return (\n part.url +\n (part.w ? ` ${part.w}w` : '') +\n (part.h ? ` ${part.h}h` : '') +\n (part.d ? ` ${part.d}x` : '')\n );\n }).join(', ');\n}\n\nmodule.exports = sanitizeHtml;\n\n// A valid attribute name.\n// We use a tolerant definition based on the set of strings defined by\n// html.spec.whatwg.org/multipage/parsing.html#before-attribute-name-state\n// and html.spec.whatwg.org/multipage/parsing.html#attribute-name-state .\n// The characters accepted are ones which can be appended to the attribute\n// name buffer without triggering a parse error:\n// * unexpected-equals-sign-before-attribute-name\n// * unexpected-null-character\n// * unexpected-character-in-attribute-name\n// We exclude the empty string because it's impossible to get to the after\n// attribute name state with an empty attribute name buffer.\nconst VALID_HTML_ATTRIBUTE_NAME = /^[^\\0\\t\\n\\f\\r /<=>]+$/;\n\n// Ignore the _recursing flag; it's there for recursive\n// invocation as a guard against this exploit:\n// https://github.com/fb55/htmlparser2/issues/105\n\nfunction sanitizeHtml(html, options, _recursing) {\n if (html == null) {\n return '';\n }\n if (typeof html === 'number') {\n html = html.toString();\n }\n\n let result = '';\n // Used for hot swapping the result variable with an empty string in order to \"capture\" the text written to it.\n let tempResult = '';\n\n function Frame(tag, attribs) {\n const that = this;\n this.tag = tag;\n this.attribs = attribs || {};\n this.tagPosition = result.length;\n this.text = ''; // Node inner text\n this.mediaChildren = [];\n\n this.updateParentNodeText = function() {\n if (stack.length) {\n const parentFrame = stack[stack.length - 1];\n parentFrame.text += that.text;\n }\n };\n\n this.updateParentNodeMediaChildren = function() {\n if (stack.length && mediaTags.includes(this.tag)) {\n const parentFrame = stack[stack.length - 1];\n parentFrame.mediaChildren.push(this.tag);\n }\n };\n }\n\n options = Object.assign({}, sanitizeHtml.defaults, options);\n options.parser = Object.assign({}, htmlParserDefaults, options.parser);\n\n const tagAllowed = function (name) {\n return options.allowedTags === false || (options.allowedTags || []).indexOf(name) > -1;\n };\n\n // vulnerableTags\n vulnerableTags.forEach(function (tag) {\n if (tagAllowed(tag) && !options.allowVulnerableTags) {\n console.warn(`\\n\\n⚠️ Your \\`allowedTags\\` option includes, \\`${tag}\\`, which is inherently\\nvulnerable to XSS attacks. Please remove it from \\`allowedTags\\`.\\nOr, to disable this warning, add the \\`allowVulnerableTags\\` option\\nand ensure you are accounting for this risk.\\n\\n`);\n }\n });\n\n // Tags that contain something other than HTML, or where discarding\n // the text when the tag is disallowed makes sense for other reasons.\n // If we are not allowing these tags, we should drop their content too.\n // For other tags you would drop the tag but keep its content.\n const nonTextTagsArray = options.nonTextTags || [\n 'script',\n 'style',\n 'textarea',\n 'option'\n ];\n let allowedAttributesMap;\n let allowedAttributesGlobMap;\n if (options.allowedAttributes) {\n allowedAttributesMap = {};\n allowedAttributesGlobMap = {};\n each(options.allowedAttributes, function(attributes, tag) {\n allowedAttributesMap[tag] = [];\n const globRegex = [];\n attributes.forEach(function(obj) {\n if (typeof obj === 'string' && obj.indexOf('*') >= 0) {\n globRegex.push(escapeStringRegexp(obj).replace(/\\\\\\*/g, '.*'));\n } else {\n allowedAttributesMap[tag].push(obj);\n }\n });\n if (globRegex.length) {\n allowedAttributesGlobMap[tag] = new RegExp('^(' + globRegex.join('|') + ')$');\n }\n });\n }\n const allowedClassesMap = {};\n const allowedClassesGlobMap = {};\n const allowedClassesRegexMap = {};\n each(options.allowedClasses, function(classes, tag) {\n // Implicitly allows the class attribute\n if (allowedAttributesMap) {\n if (!has(allowedAttributesMap, tag)) {\n allowedAttributesMap[tag] = [];\n }\n allowedAttributesMap[tag].push('class');\n }\n\n allowedClassesMap[tag] = classes;\n\n if (Array.isArray(classes)) {\n const globRegex = [];\n allowedClassesMap[tag] = [];\n allowedClassesRegexMap[tag] = [];\n classes.forEach(function(obj) {\n if (typeof obj === 'string' && obj.indexOf('*') >= 0) {\n globRegex.push(escapeStringRegexp(obj).replace(/\\\\\\*/g, '.*'));\n } else if (obj instanceof RegExp) {\n allowedClassesRegexMap[tag].push(obj);\n } else {\n allowedClassesMap[tag].push(obj);\n }\n });\n if (globRegex.length) {\n allowedClassesGlobMap[tag] = new RegExp('^(' + globRegex.join('|') + ')$');\n }\n }\n });\n\n const transformTagsMap = {};\n let transformTagsAll;\n each(options.transformTags, function(transform, tag) {\n let transFun;\n if (typeof transform === 'function') {\n transFun = transform;\n } else if (typeof transform === 'string') {\n transFun = sanitizeHtml.simpleTransform(transform);\n }\n if (tag === '*') {\n transformTagsAll = transFun;\n } else {\n transformTagsMap[tag] = transFun;\n }\n });\n\n let depth;\n let stack;\n let skipMap;\n let transformMap;\n let skipText;\n let skipTextDepth;\n let addedText = false;\n\n initializeState();\n\n const parser = new htmlparser.Parser({\n onopentag: function(name, attribs) {\n // If `enforceHtmlBoundary` is `true` and this has found the opening\n // `html` tag, reset the state.\n if (options.enforceHtmlBoundary && name === 'html') {\n initializeState();\n }\n\n if (skipText) {\n skipTextDepth++;\n return;\n }\n const frame = new Frame(name, attribs);\n stack.push(frame);\n\n let skip = false;\n const hasText = !!frame.text;\n let transformedTag;\n if (has(transformTagsMap, name)) {\n transformedTag = transformTagsMap[name](name, attribs);\n\n frame.attribs = attribs = transformedTag.attribs;\n\n if (transformedTag.text !== undefined) {\n frame.innerText = transformedTag.text;\n }\n\n if (name !== transformedTag.tagName) {\n frame.name = name = transformedTag.tagName;\n transformMap[depth] = transformedTag.tagName;\n }\n }\n if (transformTagsAll) {\n transformedTag = transformTagsAll(name, attribs);\n\n frame.attribs = attribs = transformedTag.attribs;\n if (name !== transformedTag.tagName) {\n frame.name = name = transformedTag.tagName;\n transformMap[depth] = transformedTag.tagName;\n }\n }\n\n if (!tagAllowed(name) || (options.disallowedTagsMode === 'recursiveEscape' && !isEmptyObject(skipMap)) || (options.nestingLimit != null && depth >= options.nestingLimit)) {\n skip = true;\n skipMap[depth] = true;\n if (options.disallowedTagsMode === 'discard') {\n if (nonTextTagsArray.indexOf(name) !== -1) {\n skipText = true;\n skipTextDepth = 1;\n }\n }\n skipMap[depth] = true;\n }\n depth++;\n if (skip) {\n if (options.disallowedTagsMode === 'discard') {\n // We want the contents but not this tag\n return;\n }\n tempResult = result;\n result = '';\n }\n result += '<' + name;\n\n if (name === 'script') {\n if (options.allowedScriptHostnames || options.allowedScriptDomains) {\n frame.innerText = '';\n }\n }\n\n if (!allowedAttributesMap || has(allowedAttributesMap, name) || allowedAttributesMap['*']) {\n each(attribs, function(value, a) {\n if (!VALID_HTML_ATTRIBUTE_NAME.test(a)) {\n // This prevents part of an attribute name in the output from being\n // interpreted as the end of an attribute, or end of a tag.\n delete frame.attribs[a];\n return;\n }\n // If the value is empty, check if the attribute is in the allowedEmptyAttributes array.\n // If it is not in the allowedEmptyAttributes array, and it is a known non-boolean attribute, delete it\n // List taken from https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n if (value === '' && (!options.allowedEmptyAttributes.includes(a)) &&\n (options.nonBooleanAttributes.includes(a) || options.nonBooleanAttributes.includes('*'))) {\n delete frame.attribs[a];\n return;\n }\n // check allowedAttributesMap for the element and attribute and modify the value\n // as necessary if there are specific values defined.\n let passedAllowedAttributesMapCheck = false;\n if (!allowedAttributesMap ||\n (has(allowedAttributesMap, name) && allowedAttributesMap[name].indexOf(a) !== -1) ||\n (allowedAttributesMap['*'] && allowedAttributesMap['*'].indexOf(a) !== -1) ||\n (has(allowedAttributesGlobMap, name) && allowedAttributesGlobMap[name].test(a)) ||\n (allowedAttributesGlobMap['*'] && allowedAttributesGlobMap['*'].test(a))) {\n passedAllowedAttributesMapCheck = true;\n } else if (allowedAttributesMap && allowedAttributesMap[name]) {\n for (const o of allowedAttributesMap[name]) {\n if (isPlainObject(o) && o.name && (o.name === a)) {\n passedAllowedAttributesMapCheck = true;\n let newValue = '';\n if (o.multiple === true) {\n // verify the values that are allowed\n const splitStrArray = value.split(' ');\n for (const s of splitStrArray) {\n if (o.values.indexOf(s) !== -1) {\n if (newValue === '') {\n newValue = s;\n } else {\n newValue += ' ' + s;\n }\n }\n }\n } else if (o.values.indexOf(value) >= 0) {\n // verified an allowed value matches the entire attribute value\n newValue = value;\n }\n value = newValue;\n }\n }\n }\n if (passedAllowedAttributesMapCheck) {\n if (options.allowedSchemesAppliedToAttributes.indexOf(a) !== -1) {\n if (naughtyHref(name, value)) {\n delete frame.attribs[a];\n return;\n }\n }\n\n if (name === 'script' && a === 'src') {\n\n let allowed = true;\n\n try {\n const parsed = parseUrl(value);\n\n if (options.allowedScriptHostnames || options.allowedScriptDomains) {\n const allowedHostname = (options.allowedScriptHostnames || []).find(function (hostname) {\n return hostname === parsed.url.hostname;\n });\n const allowedDomain = (options.allowedScriptDomains || []).find(function(domain) {\n return parsed.url.hostname === domain || parsed.url.hostname.endsWith(`.${domain}`);\n });\n allowed = allowedHostname || allowedDomain;\n }\n } catch (e) {\n allowed = false;\n }\n\n if (!allowed) {\n delete frame.attribs[a];\n return;\n }\n }\n\n if (name === 'iframe' && a === 'src') {\n let allowed = true;\n try {\n const parsed = parseUrl(value);\n\n if (parsed.isRelativeUrl) {\n // default value of allowIframeRelativeUrls is true\n // unless allowedIframeHostnames or allowedIframeDomains specified\n allowed = has(options, 'allowIframeRelativeUrls')\n ? options.allowIframeRelativeUrls\n : (!options.allowedIframeHostnames && !options.allowedIframeDomains);\n } else if (options.allowedIframeHostnames || options.allowedIframeDomains) {\n const allowedHostname = (options.allowedIframeHostnames || []).find(function (hostname) {\n return hostname === parsed.url.hostname;\n });\n const allowedDomain = (options.allowedIframeDomains || []).find(function(domain) {\n return parsed.url.hostname === domain || parsed.url.hostname.endsWith(`.${domain}`);\n });\n allowed = allowedHostname || allowedDomain;\n }\n } catch (e) {\n // Unparseable iframe src\n allowed = false;\n }\n if (!allowed) {\n delete frame.attribs[a];\n return;\n }\n }\n if (a === 'srcset') {\n try {\n let parsed = parseSrcset(value);\n parsed.forEach(function(value) {\n if (naughtyHref('srcset', value.url)) {\n value.evil = true;\n }\n });\n parsed = filter(parsed, function(v) {\n return !v.evil;\n });\n if (!parsed.length) {\n delete frame.attribs[a];\n return;\n } else {\n value = stringifySrcset(filter(parsed, function(v) {\n return !v.evil;\n }));\n frame.attribs[a] = value;\n }\n } catch (e) {\n // Unparseable srcset\n delete frame.attribs[a];\n return;\n }\n }\n if (a === 'class') {\n const allowedSpecificClasses = allowedClassesMap[name];\n const allowedWildcardClasses = allowedClassesMap['*'];\n const allowedSpecificClassesGlob = allowedClassesGlobMap[name];\n const allowedSpecificClassesRegex = allowedClassesRegexMap[name];\n const allowedWildcardClassesGlob = allowedClassesGlobMap['*'];\n const allowedClassesGlobs = [\n allowedSpecificClassesGlob,\n allowedWildcardClassesGlob\n ]\n .concat(allowedSpecificClassesRegex)\n .filter(function (t) {\n return t;\n });\n if (allowedSpecificClasses && allowedWildcardClasses) {\n value = filterClasses(value, deepmerge(allowedSpecificClasses, allowedWildcardClasses), allowedClassesGlobs);\n } else {\n value = filterClasses(value, allowedSpecificClasses || allowedWildcardClasses, allowedClassesGlobs);\n }\n if (!value.length) {\n delete frame.attribs[a];\n return;\n }\n }\n if (a === 'style') {\n if (options.parseStyleAttributes) {\n try {\n const abstractSyntaxTree = postcssParse(name + ' {' + value + '}', { map: false });\n const filteredAST = filterCss(abstractSyntaxTree, options.allowedStyles);\n\n value = stringifyStyleAttributes(filteredAST);\n\n if (value.length === 0) {\n delete frame.attribs[a];\n return;\n }\n } catch (e) {\n if (typeof window !== 'undefined') {\n console.warn('Failed to parse \"' + name + ' {' + value + '}' + '\", If you\\'re running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547');\n }\n delete frame.attribs[a];\n return;\n }\n } else if (options.allowedStyles) {\n throw new Error('allowedStyles option cannot be used together with parseStyleAttributes: false.');\n }\n }\n result += ' ' + a;\n if (value && value.length) {\n result += '=\"' + escapeHtml(value, true) + '\"';\n } else if (options.allowedEmptyAttributes.includes(a)) {\n result += '=\"\"';\n }\n } else {\n delete frame.attribs[a];\n }\n });\n }\n if (options.selfClosing.indexOf(name) !== -1) {\n result += ' />';\n } else {\n result += '>';\n if (frame.innerText && !hasText && !options.textFilter) {\n result += escapeHtml(frame.innerText);\n addedText = true;\n }\n }\n if (skip) {\n result = tempResult + escapeHtml(result);\n tempResult = '';\n }\n },\n ontext: function(text) {\n if (skipText) {\n return;\n }\n const lastFrame = stack[stack.length - 1];\n let tag;\n\n if (lastFrame) {\n tag = lastFrame.tag;\n // If inner text was set by transform function then let's use it\n text = lastFrame.innerText !== undefined ? lastFrame.innerText : text;\n }\n\n if (options.disallowedTagsMode === 'discard' && ((tag === 'script') || (tag === 'style'))) {\n // htmlparser2 gives us these as-is. Escaping them ruins the content. Allowing\n // script tags is, by definition, game over for XSS protection, so if that's\n // your concern, don't allow them. The same is essentially true for style tags\n // which have their own collection of XSS vectors.\n result += text;\n } else {\n const escaped = escapeHtml(text, false);\n if (options.textFilter && !addedText) {\n result += options.textFilter(escaped, tag);\n } else if (!addedText) {\n result += escaped;\n }\n }\n if (stack.length) {\n const frame = stack[stack.length - 1];\n frame.text += text;\n }\n },\n onclosetag: function(name, isImplied) {\n\n if (skipText) {\n skipTextDepth--;\n if (!skipTextDepth) {\n skipText = false;\n } else {\n return;\n }\n }\n\n const frame = stack.pop();\n if (!frame) {\n // Do not crash on bad markup\n return;\n }\n\n if (frame.tag !== name) {\n // Another case of bad markup.\n // Push to stack, so that it will be used in future closing tags.\n stack.push(frame);\n return;\n }\n\n skipText = options.enforceHtmlBoundary ? name === 'html' : false;\n depth--;\n const skip = skipMap[depth];\n if (skip) {\n delete skipMap[depth];\n if (options.disallowedTagsMode === 'discard') {\n frame.updateParentNodeText();\n return;\n }\n tempResult = result;\n result = '';\n }\n\n if (transformMap[depth]) {\n name = transformMap[depth];\n delete transformMap[depth];\n }\n\n if (options.exclusiveFilter && options.exclusiveFilter(frame)) {\n result = result.substr(0, frame.tagPosition);\n return;\n }\n\n frame.updateParentNodeMediaChildren();\n frame.updateParentNodeText();\n\n if (\n // Already output />\n options.selfClosing.indexOf(name) !== -1 ||\n // Escaped tag, closing tag is implied\n (isImplied && !tagAllowed(name) && [ 'escape', 'recursiveEscape' ].indexOf(options.disallowedTagsMode) >= 0)\n ) {\n if (skip) {\n result = tempResult;\n tempResult = '';\n }\n return;\n }\n\n result += '';\n if (skip) {\n result = tempResult + escapeHtml(result);\n tempResult = '';\n }\n addedText = false;\n }\n }, options.parser);\n parser.write(html);\n parser.end();\n\n return result;\n\n function initializeState() {\n result = '';\n depth = 0;\n stack = [];\n skipMap = {};\n transformMap = {};\n skipText = false;\n skipTextDepth = 0;\n }\n\n function escapeHtml(s, quote) {\n if (typeof (s) !== 'string') {\n s = s + '';\n }\n if (options.parser.decodeEntities) {\n s = s.replace(/&/g, '&').replace(//g, '>');\n if (quote) {\n s = s.replace(/\"/g, '"');\n }\n }\n // TODO: this is inadequate because it will pass `&0;`. This approach\n // will not work, each & must be considered with regard to whether it\n // is followed by a 100% syntactically valid entity or not, and escaped\n // if it is not. If this bothers you, don't set parser.decodeEntities\n // to false. (The default is true.)\n s = s.replace(/&(?![a-zA-Z0-9#]{1,20};)/g, '&') // Match ampersands not part of existing HTML entity\n .replace(//g, '>');\n if (quote) {\n s = s.replace(/\"/g, '"');\n }\n return s;\n }\n\n function naughtyHref(name, href) {\n // Browsers ignore character codes of 32 (space) and below in a surprising\n // number of situations. Start reading here:\n // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Embedded_tab\n // eslint-disable-next-line no-control-regex\n href = href.replace(/[\\x00-\\x20]+/g, '');\n // Clobber any comments in URLs, which the browser might\n // interpret inside an XML data island, allowing\n // a javascript: URL to be snuck through\n while (true) {\n const firstIndex = href.indexOf('', firstIndex + 4);\n if (lastIndex === -1) {\n break;\n }\n href = href.substring(0, firstIndex) + href.substring(lastIndex + 3);\n }\n // Case insensitive so we don't get faked out by JAVASCRIPT #1\n // Allow more characters after the first so we don't get faked\n // out by certain schemes browsers accept\n const matches = href.match(/^([a-zA-Z][a-zA-Z0-9.\\-+]*):/);\n if (!matches) {\n // Protocol-relative URL starting with any combination of '/' and '\\'\n if (href.match(/^[/\\\\]{2}/)) {\n return !options.allowProtocolRelative;\n }\n\n // No scheme\n return false;\n }\n const scheme = matches[1].toLowerCase();\n\n if (has(options.allowedSchemesByTag, name)) {\n return options.allowedSchemesByTag[name].indexOf(scheme) === -1;\n }\n\n return !options.allowedSchemes || options.allowedSchemes.indexOf(scheme) === -1;\n }\n\n function parseUrl(value) {\n value = value.replace(/^(\\w+:)?\\s*[\\\\/]\\s*[\\\\/]/, '$1//');\n if (value.startsWith('relative:')) {\n // An attempt to exploit our workaround for base URLs being\n // mandatory for relative URL validation in the WHATWG\n // URL parser, reject it\n throw new Error('relative: exploit attempt');\n }\n // naughtyHref is in charge of whether protocol relative URLs\n // are cool. Here we are concerned just with allowed hostnames and\n // whether to allow relative URLs.\n //\n // Build a placeholder \"base URL\" against which any reasonable\n // relative URL may be parsed successfully\n let base = 'relative://relative-site';\n for (let i = 0; (i < 100); i++) {\n base += `/${i}`;\n }\n\n const parsed = new URL(value, base);\n\n const isRelativeUrl = parsed && parsed.hostname === 'relative-site' && parsed.protocol === 'relative:';\n return {\n isRelativeUrl,\n url: parsed\n };\n }\n /**\n * Filters user input css properties by allowlisted regex attributes.\n * Modifies the abstractSyntaxTree object.\n *\n * @param {object} abstractSyntaxTree - Object representation of CSS attributes.\n * @property {array[Declaration]} abstractSyntaxTree.nodes[0] - Each object cointains prop and value key, i.e { prop: 'color', value: 'red' }.\n * @param {object} allowedStyles - Keys are properties (i.e color), value is list of permitted regex rules (i.e /green/i).\n * @return {object} - The modified tree.\n */\n function filterCss(abstractSyntaxTree, allowedStyles) {\n if (!allowedStyles) {\n return abstractSyntaxTree;\n }\n\n const astRules = abstractSyntaxTree.nodes[0];\n let selectedRule;\n\n // Merge global and tag-specific styles into new AST.\n if (allowedStyles[astRules.selector] && allowedStyles['*']) {\n selectedRule = deepmerge(\n allowedStyles[astRules.selector],\n allowedStyles['*']\n );\n } else {\n selectedRule = allowedStyles[astRules.selector] || allowedStyles['*'];\n }\n\n if (selectedRule) {\n abstractSyntaxTree.nodes[0].nodes = astRules.nodes.reduce(filterDeclarations(selectedRule), []);\n }\n\n return abstractSyntaxTree;\n }\n\n /**\n * Extracts the style attributes from an AbstractSyntaxTree and formats those\n * values in the inline style attribute format.\n *\n * @param {AbstractSyntaxTree} filteredAST\n * @return {string} - Example: \"color:yellow;text-align:center !important;font-family:helvetica;\"\n */\n function stringifyStyleAttributes(filteredAST) {\n return filteredAST.nodes[0].nodes\n .reduce(function(extractedAttributes, attrObject) {\n extractedAttributes.push(\n `${attrObject.prop}:${attrObject.value}${attrObject.important ? ' !important' : ''}`\n );\n return extractedAttributes;\n }, [])\n .join(';');\n }\n\n /**\n * Filters the existing attributes for the given property. Discards any attributes\n * which don't match the allowlist.\n *\n * @param {object} selectedRule - Example: { color: red, font-family: helvetica }\n * @param {array} allowedDeclarationsList - List of declarations which pass the allowlist.\n * @param {object} attributeObject - Object representing the current css property.\n * @property {string} attributeObject.type - Typically 'declaration'.\n * @property {string} attributeObject.prop - The CSS property, i.e 'color'.\n * @property {string} attributeObject.value - The corresponding value to the css property, i.e 'red'.\n * @return {function} - When used in Array.reduce, will return an array of Declaration objects\n */\n function filterDeclarations(selectedRule) {\n return function (allowedDeclarationsList, attributeObject) {\n // If this property is allowlisted...\n if (has(selectedRule, attributeObject.prop)) {\n const matchesRegex = selectedRule[attributeObject.prop].some(function(regularExpression) {\n return regularExpression.test(attributeObject.value);\n });\n\n if (matchesRegex) {\n allowedDeclarationsList.push(attributeObject);\n }\n }\n return allowedDeclarationsList;\n };\n }\n\n function filterClasses(classes, allowed, allowedGlobs) {\n if (!allowed) {\n // The class attribute is allowed without filtering on this tag\n return classes;\n }\n classes = classes.split(/\\s+/);\n return classes.filter(function(clss) {\n return allowed.indexOf(clss) !== -1 || allowedGlobs.some(function(glob) {\n return glob.test(clss);\n });\n }).join(' ');\n }\n}\n\n// Defaults are accessible to you so that you can use them as a starting point\n// programmatically if you wish\n\nconst htmlParserDefaults = {\n decodeEntities: true\n};\nsanitizeHtml.defaults = {\n allowedTags: [\n // Sections derived from MDN element categories and limited to the more\n // benign categories.\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element\n // Content sectioning\n 'address', 'article', 'aside', 'footer', 'header',\n 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hgroup',\n 'main', 'nav', 'section',\n // Text content\n 'blockquote', 'dd', 'div', 'dl', 'dt', 'figcaption', 'figure',\n 'hr', 'li', 'main', 'ol', 'p', 'pre', 'ul',\n // Inline text semantics\n 'a', 'abbr', 'b', 'bdi', 'bdo', 'br', 'cite', 'code', 'data', 'dfn',\n 'em', 'i', 'kbd', 'mark', 'q',\n 'rb', 'rp', 'rt', 'rtc', 'ruby',\n 's', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'time', 'u', 'var', 'wbr',\n // Table content\n 'caption', 'col', 'colgroup', 'table', 'tbody', 'td', 'tfoot', 'th',\n 'thead', 'tr'\n ],\n // Tags that cannot be boolean\n nonBooleanAttributes: [\n 'abbr', 'accept', 'accept-charset', 'accesskey', 'action',\n 'allow', 'alt', 'as', 'autocapitalize', 'autocomplete',\n 'blocking', 'charset', 'cite', 'class', 'color', 'cols',\n 'colspan', 'content', 'contenteditable', 'coords', 'crossorigin',\n 'data', 'datetime', 'decoding', 'dir', 'dirname', 'download',\n 'draggable', 'enctype', 'enterkeyhint', 'fetchpriority', 'for',\n 'form', 'formaction', 'formenctype', 'formmethod', 'formtarget',\n 'headers', 'height', 'hidden', 'high', 'href', 'hreflang',\n 'http-equiv', 'id', 'imagesizes', 'imagesrcset', 'inputmode',\n 'integrity', 'is', 'itemid', 'itemprop', 'itemref', 'itemtype',\n 'kind', 'label', 'lang', 'list', 'loading', 'low', 'max',\n 'maxlength', 'media', 'method', 'min', 'minlength', 'name',\n 'nonce', 'optimum', 'pattern', 'ping', 'placeholder', 'popover',\n 'popovertarget', 'popovertargetaction', 'poster', 'preload',\n 'referrerpolicy', 'rel', 'rows', 'rowspan', 'sandbox', 'scope',\n 'shape', 'size', 'sizes', 'slot', 'span', 'spellcheck', 'src',\n 'srcdoc', 'srclang', 'srcset', 'start', 'step', 'style',\n 'tabindex', 'target', 'title', 'translate', 'type', 'usemap',\n 'value', 'width', 'wrap',\n // Event handlers\n 'onauxclick', 'onafterprint', 'onbeforematch', 'onbeforeprint',\n 'onbeforeunload', 'onbeforetoggle', 'onblur', 'oncancel',\n 'oncanplay', 'oncanplaythrough', 'onchange', 'onclick', 'onclose',\n 'oncontextlost', 'oncontextmenu', 'oncontextrestored', 'oncopy',\n 'oncuechange', 'oncut', 'ondblclick', 'ondrag', 'ondragend',\n 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart',\n 'ondrop', 'ondurationchange', 'onemptied', 'onended',\n 'onerror', 'onfocus', 'onformdata', 'onhashchange', 'oninput',\n 'oninvalid', 'onkeydown', 'onkeypress', 'onkeyup',\n 'onlanguagechange', 'onload', 'onloadeddata', 'onloadedmetadata',\n 'onloadstart', 'onmessage', 'onmessageerror', 'onmousedown',\n 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout',\n 'onmouseover', 'onmouseup', 'onoffline', 'ononline', 'onpagehide',\n 'onpageshow', 'onpaste', 'onpause', 'onplay', 'onplaying',\n 'onpopstate', 'onprogress', 'onratechange', 'onreset', 'onresize',\n 'onrejectionhandled', 'onscroll', 'onscrollend',\n 'onsecuritypolicyviolation', 'onseeked', 'onseeking', 'onselect',\n 'onslotchange', 'onstalled', 'onstorage', 'onsubmit', 'onsuspend',\n 'ontimeupdate', 'ontoggle', 'onunhandledrejection', 'onunload',\n 'onvolumechange', 'onwaiting', 'onwheel'\n ],\n disallowedTagsMode: 'discard',\n allowedAttributes: {\n a: [ 'href', 'name', 'target' ],\n // We don't currently allow img itself by default, but\n // these attributes would make sense if we did.\n img: [ 'src', 'srcset', 'alt', 'title', 'width', 'height', 'loading' ]\n },\n allowedEmptyAttributes: [\n 'alt'\n ],\n // Lots of these won't come up by default because we don't allow them\n selfClosing: [ 'img', 'br', 'hr', 'area', 'base', 'basefont', 'input', 'link', 'meta' ],\n // URL schemes we permit\n allowedSchemes: [ 'http', 'https', 'ftp', 'mailto', 'tel' ],\n allowedSchemesByTag: {},\n allowedSchemesAppliedToAttributes: [ 'href', 'src', 'cite' ],\n allowProtocolRelative: true,\n enforceHtmlBoundary: false,\n parseStyleAttributes: true\n};\n\nsanitizeHtml.simpleTransform = function(newTagName, newAttribs, merge) {\n merge = (merge === undefined) ? true : merge;\n newAttribs = newAttribs || {};\n\n return function(tagName, attribs) {\n let attrib;\n if (merge) {\n for (attrib in newAttribs) {\n attribs[attrib] = newAttribs[attrib];\n }\n } else {\n attribs = newAttribs;\n }\n\n return {\n tagName: newTagName,\n attribs: attribs\n };\n };\n};\n","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ActivityMonitor = void 0;\nconst signaling_1 = require(\"@lumino/signaling\");\n/**\n * A class that monitors activity on a signal.\n */\nclass ActivityMonitor {\n /**\n * Construct a new activity monitor.\n */\n constructor(options) {\n this._timer = -1;\n this._timeout = -1;\n this._isDisposed = false;\n this._activityStopped = new signaling_1.Signal(this);\n options.signal.connect(this._onSignalFired, this);\n this._timeout = options.timeout || 1000;\n }\n /**\n * A signal emitted when activity has ceased.\n */\n get activityStopped() {\n return this._activityStopped;\n }\n /**\n * The timeout associated with the monitor, in milliseconds.\n */\n get timeout() {\n return this._timeout;\n }\n set timeout(value) {\n this._timeout = value;\n }\n /**\n * Test whether the monitor has been disposed.\n *\n * #### Notes\n * This is a read-only property.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * Dispose of the resources used by the activity monitor.\n */\n dispose() {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n signaling_1.Signal.clearData(this);\n }\n /**\n * A signal handler for the monitored signal.\n */\n _onSignalFired(sender, args) {\n clearTimeout(this._timer);\n this._sender = sender;\n this._args = args;\n this._timer = setTimeout(() => {\n this._activityStopped.emit({\n sender: this._sender,\n args: this._args\n });\n }, this._timeout);\n }\n}\nexports.ActivityMonitor = ActivityMonitor;\n//# sourceMappingURL=activitymonitor.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module coreutils\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./activitymonitor\"), exports);\n__exportStar(require(\"./interfaces\"), exports);\n__exportStar(require(\"./lru\"), exports);\n__exportStar(require(\"./markdowncodeblocks\"), exports);\n__exportStar(require(\"./pageconfig\"), exports);\n__exportStar(require(\"./path\"), exports);\n__exportStar(require(\"./signal\"), exports);\n__exportStar(require(\"./text\"), exports);\n__exportStar(require(\"./time\"), exports);\n__exportStar(require(\"./url\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=interfaces.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LruCache = void 0;\nconst DEFAULT_MAX_SIZE = 128;\n/** A least-recently-used cache. */\nclass LruCache {\n constructor(options = {}) {\n this._map = new Map();\n this._maxSize = (options === null || options === void 0 ? void 0 : options.maxSize) || DEFAULT_MAX_SIZE;\n }\n /**\n * Return the current size of the cache.\n */\n get size() {\n return this._map.size;\n }\n /**\n * Clear the values in the cache.\n */\n clear() {\n this._map.clear();\n }\n /**\n * Get a value (or null) from the cache, pushing the item to the front of the cache.\n */\n get(key) {\n const item = this._map.get(key) || null;\n if (item != null) {\n this._map.delete(key);\n this._map.set(key, item);\n }\n return item;\n }\n /**\n * Set a value in the cache, potentially evicting an old item.\n */\n set(key, value) {\n if (this._map.size >= this._maxSize) {\n this._map.delete(this._map.keys().next().value);\n }\n this._map.set(key, value);\n }\n}\nexports.LruCache = LruCache;\n//# sourceMappingURL=lru.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MarkdownCodeBlocks = void 0;\n/**\n * The namespace for code block functions which help\n * in extract code from markdown text\n */\nvar MarkdownCodeBlocks;\n(function (MarkdownCodeBlocks) {\n MarkdownCodeBlocks.CODE_BLOCK_MARKER = '```';\n const markdownExtensions = [\n '.markdown',\n '.mdown',\n '.mkdn',\n '.md',\n '.mkd',\n '.mdwn',\n '.mdtxt',\n '.mdtext',\n '.text',\n '.txt',\n '.Rmd'\n ];\n class MarkdownCodeBlock {\n constructor(startLine) {\n this.startLine = startLine;\n this.code = '';\n this.endLine = -1;\n }\n }\n MarkdownCodeBlocks.MarkdownCodeBlock = MarkdownCodeBlock;\n /**\n * Check whether the given file extension is a markdown extension\n * @param extension - A file extension\n *\n * @returns true/false depending on whether this is a supported markdown extension\n */\n function isMarkdown(extension) {\n return markdownExtensions.indexOf(extension) > -1;\n }\n MarkdownCodeBlocks.isMarkdown = isMarkdown;\n /**\n * Construct all code snippets from current text\n * (this could be potentially optimized if we can cache and detect differences)\n * @param text - A string to parse codeblocks from\n *\n * @returns An array of MarkdownCodeBlocks.\n */\n function findMarkdownCodeBlocks(text) {\n if (!text || text === '') {\n return [];\n }\n const lines = text.split('\\n');\n const codeBlocks = [];\n let currentBlock = null;\n for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {\n const line = lines[lineIndex];\n const lineContainsMarker = line.indexOf(MarkdownCodeBlocks.CODE_BLOCK_MARKER) === 0;\n const constructingBlock = currentBlock != null;\n // Skip this line if it is not part of any code block and doesn't contain a marker.\n if (!lineContainsMarker && !constructingBlock) {\n continue;\n }\n // Check if we are already constructing a code block.\n if (!constructingBlock) {\n // Start constructing a new code block.\n currentBlock = new MarkdownCodeBlock(lineIndex);\n // Check whether this is a single line code block of the form ```a = 10```.\n const firstIndex = line.indexOf(MarkdownCodeBlocks.CODE_BLOCK_MARKER);\n const lastIndex = line.lastIndexOf(MarkdownCodeBlocks.CODE_BLOCK_MARKER);\n const isSingleLine = firstIndex !== lastIndex;\n if (isSingleLine) {\n currentBlock.code = line.substring(firstIndex + MarkdownCodeBlocks.CODE_BLOCK_MARKER.length, lastIndex);\n currentBlock.endLine = lineIndex;\n codeBlocks.push(currentBlock);\n currentBlock = null;\n }\n }\n else if (currentBlock) {\n if (lineContainsMarker) {\n // End of block, finish it up.\n currentBlock.endLine = lineIndex - 1;\n codeBlocks.push(currentBlock);\n currentBlock = null;\n }\n else {\n // Append the current line.\n currentBlock.code += line + '\\n';\n }\n }\n }\n return codeBlocks;\n }\n MarkdownCodeBlocks.findMarkdownCodeBlocks = findMarkdownCodeBlocks;\n})(MarkdownCodeBlocks || (exports.MarkdownCodeBlocks = MarkdownCodeBlocks = {}));\n//# sourceMappingURL=markdowncodeblocks.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PageConfig = void 0;\nconst coreutils_1 = require(\"@lumino/coreutils\");\nconst minimist_1 = __importDefault(require(\"minimist\"));\nconst url_1 = require(\"./url\");\n/**\n * The namespace for `PageConfig` functions.\n */\nvar PageConfig;\n(function (PageConfig) {\n /**\n * Get global configuration data for the Jupyter application.\n *\n * @param name - The name of the configuration option.\n *\n * @returns The config value or an empty string if not found.\n *\n * #### Notes\n * All values are treated as strings.\n * For browser based applications, it is assumed that the page HTML\n * includes a script tag with the id `jupyter-config-data` containing the\n * configuration as valid JSON. In order to support the classic Notebook,\n * we fall back on checking for `body` data of the given `name`.\n *\n * For node applications, it is assumed that the process was launched\n * with a `--jupyter-config-data` option pointing to a JSON settings\n * file.\n */\n function getOption(name) {\n if (configData) {\n return configData[name] || getBodyData(name);\n }\n configData = Object.create(null);\n let found = false;\n // Use script tag if available.\n if (typeof document !== 'undefined' && document) {\n const el = document.getElementById('jupyter-config-data');\n if (el) {\n configData = JSON.parse(el.textContent || '');\n found = true;\n }\n }\n // Otherwise use CLI if given.\n if (!found && typeof process !== 'undefined' && process.argv) {\n try {\n const cli = (0, minimist_1.default)(process.argv.slice(2));\n const path = require('path');\n let fullPath = '';\n if ('jupyter-config-data' in cli) {\n fullPath = path.resolve(cli['jupyter-config-data']);\n }\n else if ('JUPYTER_CONFIG_DATA' in process.env) {\n fullPath = path.resolve(process.env['JUPYTER_CONFIG_DATA']);\n }\n if (fullPath) {\n // Force Webpack to ignore this require.\n // eslint-disable-next-line\n configData = eval('require')(fullPath);\n }\n }\n catch (e) {\n console.error(e);\n }\n }\n if (!coreutils_1.JSONExt.isObject(configData)) {\n configData = Object.create(null);\n }\n else {\n for (const key in configData) {\n // PageConfig expects strings\n if (typeof configData[key] !== 'string') {\n configData[key] = JSON.stringify(configData[key]);\n }\n }\n }\n return configData[name] || getBodyData(name);\n }\n PageConfig.getOption = getOption;\n /**\n * Set global configuration data for the Jupyter application.\n *\n * @param name - The name of the configuration option.\n * @param value - The value to set the option to.\n *\n * @returns The last config value or an empty string if it doesn't exist.\n */\n function setOption(name, value) {\n const last = getOption(name);\n configData[name] = value;\n return last;\n }\n PageConfig.setOption = setOption;\n /**\n * Get the base url for a Jupyter application, or the base url of the page.\n */\n function getBaseUrl() {\n return url_1.URLExt.normalize(getOption('baseUrl') || '/');\n }\n PageConfig.getBaseUrl = getBaseUrl;\n /**\n * Get the tree url for a JupyterLab application.\n */\n function getTreeUrl() {\n return url_1.URLExt.join(getBaseUrl(), getOption('treeUrl'));\n }\n PageConfig.getTreeUrl = getTreeUrl;\n /**\n * Get the base url for sharing links (usually baseUrl)\n */\n function getShareUrl() {\n return url_1.URLExt.normalize(getOption('shareUrl') || getBaseUrl());\n }\n PageConfig.getShareUrl = getShareUrl;\n /**\n * Get the tree url for shareable links.\n * Usually the same as treeUrl,\n * but overrideable e.g. when sharing with JupyterHub.\n */\n function getTreeShareUrl() {\n return url_1.URLExt.normalize(url_1.URLExt.join(getShareUrl(), getOption('treeUrl')));\n }\n PageConfig.getTreeShareUrl = getTreeShareUrl;\n /**\n * Create a new URL given an optional mode and tree path.\n *\n * This is used to create URLS when the mode or tree path change as the user\n * changes mode or the current document in the main area. If fields in\n * options are omitted, the value in PageConfig will be used.\n *\n * @param options - IGetUrlOptions for the new path.\n */\n function getUrl(options) {\n var _a, _b, _c, _d;\n let path = options.toShare ? getShareUrl() : getBaseUrl();\n const mode = (_a = options.mode) !== null && _a !== void 0 ? _a : getOption('mode');\n const workspace = (_b = options.workspace) !== null && _b !== void 0 ? _b : getOption('workspace');\n const labOrDoc = mode === 'single-document' ? 'doc' : 'lab';\n path = url_1.URLExt.join(path, labOrDoc);\n if (workspace !== PageConfig.defaultWorkspace) {\n path = url_1.URLExt.join(path, 'workspaces', encodeURIComponent((_c = getOption('workspace')) !== null && _c !== void 0 ? _c : PageConfig.defaultWorkspace));\n }\n const treePath = (_d = options.treePath) !== null && _d !== void 0 ? _d : getOption('treePath');\n if (treePath) {\n path = url_1.URLExt.join(path, 'tree', url_1.URLExt.encodeParts(treePath));\n }\n return path;\n }\n PageConfig.getUrl = getUrl;\n PageConfig.defaultWorkspace = 'default';\n /**\n * Get the base websocket url for a Jupyter application, or an empty string.\n */\n function getWsUrl(baseUrl) {\n let wsUrl = getOption('wsUrl');\n if (!wsUrl) {\n baseUrl = baseUrl ? url_1.URLExt.normalize(baseUrl) : getBaseUrl();\n if (baseUrl.indexOf('http') !== 0) {\n return '';\n }\n wsUrl = 'ws' + baseUrl.slice(4);\n }\n return url_1.URLExt.normalize(wsUrl);\n }\n PageConfig.getWsUrl = getWsUrl;\n /**\n * Returns the URL converting this notebook to a certain\n * format with nbconvert.\n */\n function getNBConvertURL({ path, format, download }) {\n const notebookPath = url_1.URLExt.encodeParts(path);\n const url = url_1.URLExt.join(getBaseUrl(), 'nbconvert', format, notebookPath);\n if (download) {\n return url + '?download=true';\n }\n return url;\n }\n PageConfig.getNBConvertURL = getNBConvertURL;\n /**\n * Get the authorization token for a Jupyter application.\n */\n function getToken() {\n return getOption('token') || getBodyData('jupyterApiToken');\n }\n PageConfig.getToken = getToken;\n /**\n * Get the Notebook version info [major, minor, patch].\n */\n function getNotebookVersion() {\n const notebookVersion = getOption('notebookVersion');\n if (notebookVersion === '') {\n return [0, 0, 0];\n }\n return JSON.parse(notebookVersion);\n }\n PageConfig.getNotebookVersion = getNotebookVersion;\n /**\n * Private page config data for the Jupyter application.\n */\n let configData = null;\n /**\n * Get a url-encoded item from `body.data` and decode it\n * We should never have any encoded URLs anywhere else in code\n * until we are building an actual request.\n */\n function getBodyData(key) {\n if (typeof document === 'undefined' || !document.body) {\n return '';\n }\n const val = document.body.dataset[key];\n if (typeof val === 'undefined') {\n return '';\n }\n return decodeURIComponent(val);\n }\n /**\n * The namespace for page config `Extension` functions.\n */\n let Extension;\n (function (Extension) {\n /**\n * Populate an array from page config.\n *\n * @param key - The page config key (e.g., `deferredExtensions`).\n *\n * #### Notes\n * This is intended for `deferredExtensions` and `disabledExtensions`.\n */\n function populate(key) {\n try {\n const raw = getOption(key);\n if (raw) {\n return JSON.parse(raw);\n }\n }\n catch (error) {\n console.warn(`Unable to parse ${key}.`, error);\n }\n return [];\n }\n /**\n * The collection of deferred extensions in page config.\n */\n Extension.deferred = populate('deferredExtensions');\n /**\n * The collection of disabled extensions in page config.\n */\n Extension.disabled = populate('disabledExtensions');\n /**\n * Returns whether a plugin is deferred.\n *\n * @param id - The plugin ID.\n */\n function isDeferred(id) {\n // Check for either a full plugin id match or an extension\n // name match.\n const separatorIndex = id.indexOf(':');\n let extName = '';\n if (separatorIndex !== -1) {\n extName = id.slice(0, separatorIndex);\n }\n return Extension.deferred.some(val => val === id || (extName && val === extName));\n }\n Extension.isDeferred = isDeferred;\n /**\n * Returns whether a plugin is disabled.\n *\n * @param id - The plugin ID.\n */\n function isDisabled(id) {\n // Check for either a full plugin id match or an extension\n // name match.\n const separatorIndex = id.indexOf(':');\n let extName = '';\n if (separatorIndex !== -1) {\n extName = id.slice(0, separatorIndex);\n }\n return Extension.disabled.some(val => val === id || (extName && val === extName));\n }\n Extension.isDisabled = isDisabled;\n })(Extension = PageConfig.Extension || (PageConfig.Extension = {}));\n})(PageConfig || (exports.PageConfig = PageConfig = {}));\n//# sourceMappingURL=pageconfig.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PathExt = void 0;\nconst path_1 = require(\"path\");\n/**\n * The namespace for path-related functions.\n *\n * Note that Jupyter server paths do not start with a leading slash.\n */\nvar PathExt;\n(function (PathExt) {\n /**\n * Join all arguments together and normalize the resulting path.\n * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.\n *\n * @param paths - The string paths to join.\n */\n function join(...paths) {\n const path = path_1.posix.join(...paths);\n return path === '.' ? '' : removeSlash(path);\n }\n PathExt.join = join;\n /**\n * Join all arguments together and normalize the resulting path and preserve the leading slash.\n *\n * @param paths - The string paths to join.\n */\n function joinWithLeadingSlash(...paths) {\n const path = path_1.posix.join(...paths);\n return path === '.' ? '' : path;\n }\n PathExt.joinWithLeadingSlash = joinWithLeadingSlash;\n /**\n * Return the last portion of a path. Similar to the Unix basename command.\n * Often used to extract the file name from a fully qualified path.\n *\n * @param path - The path to evaluate.\n *\n * @param ext - An extension to remove from the result.\n */\n function basename(path, ext) {\n return path_1.posix.basename(path, ext);\n }\n PathExt.basename = basename;\n /**\n * Get the directory name of a path, similar to the Unix dirname command.\n * When an empty path is given, returns the root path.\n *\n * @param path - The file path.\n */\n function dirname(path) {\n const dir = removeSlash(path_1.posix.dirname(path));\n return dir === '.' ? '' : dir;\n }\n PathExt.dirname = dirname;\n /**\n * Get the extension of the path.\n *\n * @param path - The file path.\n *\n * @returns the extension of the file.\n *\n * #### Notes\n * The extension is the string from the last occurrence of the `.`\n * character to end of string in the last portion of the path, inclusive.\n * If there is no `.` in the last portion of the path, or if the first\n * character of the basename of path [[basename]] is `.`, then an\n * empty string is returned.\n */\n function extname(path) {\n return path_1.posix.extname(path);\n }\n PathExt.extname = extname;\n /**\n * Normalize a string path, reducing '..' and '.' parts.\n * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.\n * When an empty path is given, returns the root path.\n *\n * @param path - The string path to normalize.\n */\n function normalize(path) {\n if (path === '') {\n return '';\n }\n return removeSlash(path_1.posix.normalize(path));\n }\n PathExt.normalize = normalize;\n /**\n * Resolve a sequence of paths or path segments into an absolute path.\n * The root path in the application has no leading slash, so it is removed.\n *\n * @param parts - The paths to join.\n *\n * #### Notes\n * The right-most parameter is considered \\{to\\}. Other parameters are considered an array of \\{from\\}.\n *\n * Starting from leftmost \\{from\\} parameter, resolves \\{to\\} to an absolute path.\n *\n * If \\{to\\} isn't already absolute, \\{from\\} arguments are prepended in right to left order, until an absolute path is found. If after using all \\{from\\} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.\n */\n function resolve(...parts) {\n return removeSlash(path_1.posix.resolve(...parts));\n }\n PathExt.resolve = resolve;\n /**\n * Solve the relative path from \\{from\\} to \\{to\\}.\n *\n * @param from - The source path.\n *\n * @param to - The target path.\n *\n * #### Notes\n * If from and to each resolve to the same path (after calling\n * path.resolve() on each), a zero-length string is returned.\n * If a zero-length string is passed as from or to, `/`\n * will be used instead of the zero-length strings.\n */\n function relative(from, to) {\n return removeSlash(path_1.posix.relative(from, to));\n }\n PathExt.relative = relative;\n /**\n * Normalize a file extension to be of the type `'.foo'`.\n *\n * @param extension - the file extension.\n *\n * #### Notes\n * Adds a leading dot if not present and converts to lower case.\n */\n function normalizeExtension(extension) {\n if (extension.length > 0 && extension.indexOf('.') !== 0) {\n extension = `.${extension}`;\n }\n return extension;\n }\n PathExt.normalizeExtension = normalizeExtension;\n /**\n * Remove the leading slash from a path.\n *\n * @param path the path from which to remove a leading slash.\n */\n function removeSlash(path) {\n if (path.indexOf('/') === 0) {\n path = path.slice(1);\n }\n return path;\n }\n PathExt.removeSlash = removeSlash;\n})(PathExt || (exports.PathExt = PathExt = {}));\n//# sourceMappingURL=path.js.map","\"use strict\";\n/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.signalToPromise = void 0;\nconst coreutils_1 = require(\"@lumino/coreutils\");\n/**\n * Convert a signal into a promise for the first emitted value.\n *\n * @param signal - The signal we are listening to.\n * @param timeout - Timeout to wait for signal in ms (not timeout if not defined or 0)\n *\n * @returns a Promise that resolves with a `(sender, args)` pair.\n */\nfunction signalToPromise(signal, timeout) {\n const waitForSignal = new coreutils_1.PromiseDelegate();\n function cleanup() {\n signal.disconnect(slot);\n }\n function slot(sender, args) {\n cleanup();\n waitForSignal.resolve([sender, args]);\n }\n signal.connect(slot);\n if ((timeout !== null && timeout !== void 0 ? timeout : 0) > 0) {\n setTimeout(() => {\n cleanup();\n waitForSignal.reject(`Signal not emitted within ${timeout} ms.`);\n }, timeout);\n }\n return waitForSignal.promise;\n}\nexports.signalToPromise = signalToPromise;\n//# sourceMappingURL=signal.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Text = void 0;\n/**\n * The namespace for text-related functions.\n */\nvar Text;\n(function (Text) {\n // javascript stores text as utf16 and string indices use \"code units\",\n // which stores high-codepoint characters as \"surrogate pairs\",\n // which occupy two indices in the javascript string.\n // We need to translate cursor_pos in the Jupyter protocol (in characters)\n // to js offset (with surrogate pairs taking two spots).\n const HAS_SURROGATES = '𝐚'.length > 1;\n /**\n * Convert a javascript string index into a unicode character offset\n *\n * @param jsIdx - The javascript string index (counting surrogate pairs)\n *\n * @param text - The text in which the offset is calculated\n *\n * @returns The unicode character offset\n */\n function jsIndexToCharIndex(jsIdx, text) {\n if (HAS_SURROGATES) {\n // not using surrogates, nothing to do\n return jsIdx;\n }\n let charIdx = jsIdx;\n for (let i = 0; i + 1 < text.length && i < jsIdx; i++) {\n const charCode = text.charCodeAt(i);\n // check for surrogate pair\n if (charCode >= 0xd800 && charCode <= 0xdbff) {\n const nextCharCode = text.charCodeAt(i + 1);\n if (nextCharCode >= 0xdc00 && nextCharCode <= 0xdfff) {\n charIdx--;\n i++;\n }\n }\n }\n return charIdx;\n }\n Text.jsIndexToCharIndex = jsIndexToCharIndex;\n /**\n * Convert a unicode character offset to a javascript string index.\n *\n * @param charIdx - The index in unicode characters\n *\n * @param text - The text in which the offset is calculated\n *\n * @returns The js-native index\n */\n function charIndexToJsIndex(charIdx, text) {\n if (HAS_SURROGATES) {\n // not using surrogates, nothing to do\n return charIdx;\n }\n let jsIdx = charIdx;\n for (let i = 0; i + 1 < text.length && i < jsIdx; i++) {\n const charCode = text.charCodeAt(i);\n // check for surrogate pair\n if (charCode >= 0xd800 && charCode <= 0xdbff) {\n const nextCharCode = text.charCodeAt(i + 1);\n if (nextCharCode >= 0xdc00 && nextCharCode <= 0xdfff) {\n jsIdx++;\n i++;\n }\n }\n }\n return jsIdx;\n }\n Text.charIndexToJsIndex = charIndexToJsIndex;\n /**\n * Given a 'snake-case', 'snake_case', 'snake:case', or\n * 'snake case' string, will return the camel case version: 'snakeCase'.\n *\n * @param str the snake-case input string.\n *\n * @param upper default = false. If true, the first letter of the\n * returned string will be capitalized.\n *\n * @returns the camel case version of the input string.\n */\n function camelCase(str, upper = false) {\n return str.replace(/^(\\w)|[\\s-_:]+(\\w)/g, function (match, p1, p2) {\n if (p2) {\n return p2.toUpperCase();\n }\n else {\n return upper ? p1.toUpperCase() : p1.toLowerCase();\n }\n });\n }\n Text.camelCase = camelCase;\n /**\n * Given a string, title case the words in the string.\n *\n * @param str the string to title case.\n *\n * @returns the same string, but with each word capitalized.\n */\n function titleCase(str) {\n return (str || '')\n .toLowerCase()\n .split(' ')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n }\n Text.titleCase = titleCase;\n})(Text || (exports.Text = Text = {}));\n//# sourceMappingURL=text.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.URLExt = void 0;\nconst path_1 = require(\"path\");\nconst url_parse_1 = __importDefault(require(\"url-parse\"));\n/**\n * The namespace for URL-related functions.\n */\nvar URLExt;\n(function (URLExt) {\n /**\n * Parse a url into a URL object.\n *\n * @param url - The URL string to parse.\n *\n * @returns A URL object.\n */\n function parse(url) {\n if (typeof document !== 'undefined' && document) {\n const a = document.createElement('a');\n a.href = url;\n return a;\n }\n return (0, url_parse_1.default)(url);\n }\n URLExt.parse = parse;\n /**\n * Parse URL and retrieve hostname\n *\n * @param url - The URL string to parse\n *\n * @returns a hostname string value\n */\n function getHostName(url) {\n return (0, url_parse_1.default)(url).hostname;\n }\n URLExt.getHostName = getHostName;\n function normalize(url) {\n return url && parse(url).toString();\n }\n URLExt.normalize = normalize;\n /**\n * Join a sequence of url components and normalizes as in node `path.join`.\n *\n * @param parts - The url components.\n *\n * @returns the joined url.\n */\n function join(...parts) {\n let u = (0, url_parse_1.default)(parts[0], {});\n // Schema-less URL can be only parsed as relative to a base URL\n // see https://github.com/unshiftio/url-parse/issues/219#issuecomment-1002219326\n const isSchemaLess = u.protocol === '' && u.slashes;\n if (isSchemaLess) {\n u = (0, url_parse_1.default)(parts[0], 'https:' + parts[0]);\n }\n const prefix = `${isSchemaLess ? '' : u.protocol}${u.slashes ? '//' : ''}${u.auth}${u.auth ? '@' : ''}${u.host}`;\n // If there was a prefix, then the first path must start at the root.\n const path = path_1.posix.join(`${!!prefix && u.pathname[0] !== '/' ? '/' : ''}${u.pathname}`, ...parts.slice(1));\n return `${prefix}${path === '.' ? '' : path}`;\n }\n URLExt.join = join;\n /**\n * Encode the components of a multi-segment url.\n *\n * @param url - The url to encode.\n *\n * @returns the encoded url.\n *\n * #### Notes\n * Preserves the `'/'` separators.\n * Should not include the base url, since all parts are escaped.\n */\n function encodeParts(url) {\n return join(...url.split('/').map(encodeURIComponent));\n }\n URLExt.encodeParts = encodeParts;\n /**\n * Return a serialized object string suitable for a query.\n *\n * @param value The source object.\n *\n * @returns an encoded url query.\n *\n * #### Notes\n * Modified version of [stackoverflow](http://stackoverflow.com/a/30707423).\n */\n function objectToQueryString(value) {\n const keys = Object.keys(value).filter(key => key.length > 0);\n if (!keys.length) {\n return '';\n }\n return ('?' +\n keys\n .map(key => {\n const content = encodeURIComponent(String(value[key]));\n return key + (content ? '=' + content : '');\n })\n .join('&'));\n }\n URLExt.objectToQueryString = objectToQueryString;\n /**\n * Return a parsed object that represents the values in a query string.\n */\n function queryStringToObject(value) {\n return value\n .replace(/^\\?/, '')\n .split('&')\n .reduce((acc, val) => {\n const [key, value] = val.split('=');\n if (key.length > 0) {\n acc[key] = decodeURIComponent(value || '');\n }\n return acc;\n }, {});\n }\n URLExt.queryStringToObject = queryStringToObject;\n /**\n * Test whether the url is a local url.\n *\n * @param allowRoot - Whether the paths starting at Unix-style filesystem root (`/`) are permitted.\n *\n * #### Notes\n * This function returns `false` for any fully qualified url, including\n * `data:`, `file:`, and `//` protocol URLs.\n */\n function isLocal(url, allowRoot = false) {\n const { protocol } = parse(url);\n return ((!protocol || url.toLowerCase().indexOf(protocol) !== 0) &&\n (allowRoot ? url.indexOf('//') !== 0 : url.indexOf('/') !== 0));\n }\n URLExt.isLocal = isLocal;\n})(URLExt || (exports.URLExt = URLExt = {}));\n//# sourceMappingURL=url.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module javascript-extension\n */\nimport { RenderedJavaScript } from '@jupyterlab/rendermime';\nexport const TEXT_JAVASCRIPT_MIMETYPE = 'text/javascript';\nexport const APPLICATION_JAVASCRIPT_MIMETYPE = 'application/javascript';\nfunction evalInContext(code, element, document, window) {\n // eslint-disable-next-line\n return eval(code);\n}\nexport class ExperimentalRenderedJavascript extends RenderedJavaScript {\n render(model) {\n const trans = this.translator.load('jupyterlab');\n const renderJavascript = () => {\n try {\n const data = model.data[this.mimeType];\n if (data) {\n evalInContext(data, this.node, document, window);\n }\n return Promise.resolve();\n }\n catch (error) {\n return Promise.reject(error);\n }\n };\n if (!model.trusted) {\n // If output is not trusted or if arbitrary Javascript execution is not enabled, render an informative error message\n const pre = document.createElement('pre');\n pre.textContent = trans.__('Are you sure that you want to run arbitrary Javascript within your JupyterLab session?');\n const button = document.createElement('button');\n button.textContent = trans.__('Run');\n this.node.appendChild(pre);\n this.node.appendChild(button);\n button.onclick = event => {\n this.node.textContent = '';\n void renderJavascript();\n };\n return Promise.resolve();\n }\n return renderJavascript();\n }\n}\n/**\n * A mime renderer factory for text/javascript data.\n */\nexport const rendererFactory = {\n safe: false,\n mimeTypes: [TEXT_JAVASCRIPT_MIMETYPE, APPLICATION_JAVASCRIPT_MIMETYPE],\n createRenderer: options => new ExperimentalRenderedJavascript(options)\n};\nconst extension = {\n id: '@jupyterlab/javascript-extension:factory',\n description: 'Adds renderer for JavaScript content.',\n rendererFactory,\n rank: 0,\n dataType: 'string'\n};\nexport default extension;\n//# sourceMappingURL=index.js.map","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.lumino_coreutils = {}));\n}(this, (function (exports) { 'use strict';\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /*-----------------------------------------------------------------------------\n | Copyright (c) 2014-2017, PhosphorJS Contributors\n |\n | Distributed under the terms of the BSD 3-Clause License.\n |\n | The full license is in the file LICENSE, distributed with this software.\n |----------------------------------------------------------------------------*/\n /**\n * The namespace for JSON-specific functions.\n */\n exports.JSONExt = void 0;\n (function (JSONExt) {\n /**\n * A shared frozen empty JSONObject\n */\n JSONExt.emptyObject = Object.freeze({});\n /**\n * A shared frozen empty JSONArray\n */\n JSONExt.emptyArray = Object.freeze([]);\n /**\n * Test whether a JSON value is a primitive.\n *\n * @param value - The JSON value of interest.\n *\n * @returns `true` if the value is a primitive,`false` otherwise.\n */\n function isPrimitive(value) {\n return (value === null ||\n typeof value === 'boolean' ||\n typeof value === 'number' ||\n typeof value === 'string');\n }\n JSONExt.isPrimitive = isPrimitive;\n function isArray(value) {\n return Array.isArray(value);\n }\n JSONExt.isArray = isArray;\n function isObject(value) {\n return !isPrimitive(value) && !isArray(value);\n }\n JSONExt.isObject = isObject;\n /**\n * Compare two JSON values for deep equality.\n *\n * @param first - The first JSON value of interest.\n *\n * @param second - The second JSON value of interest.\n *\n * @returns `true` if the values are equivalent, `false` otherwise.\n */\n function deepEqual(first, second) {\n // Check referential and primitive equality first.\n if (first === second) {\n return true;\n }\n // If one is a primitive, the `===` check ruled out the other.\n if (isPrimitive(first) || isPrimitive(second)) {\n return false;\n }\n // Test whether they are arrays.\n var a1 = isArray(first);\n var a2 = isArray(second);\n // Bail if the types are different.\n if (a1 !== a2) {\n return false;\n }\n // If they are both arrays, compare them.\n if (a1 && a2) {\n return deepArrayEqual(first, second);\n }\n // At this point, they must both be objects.\n return deepObjectEqual(first, second);\n }\n JSONExt.deepEqual = deepEqual;\n /**\n * Create a deep copy of a JSON value.\n *\n * @param value - The JSON value to copy.\n *\n * @returns A deep copy of the given JSON value.\n */\n function deepCopy(value) {\n // Do nothing for primitive values.\n if (isPrimitive(value)) {\n return value;\n }\n // Deep copy an array.\n if (isArray(value)) {\n return deepArrayCopy(value);\n }\n // Deep copy an object.\n return deepObjectCopy(value);\n }\n JSONExt.deepCopy = deepCopy;\n /**\n * Compare two JSON arrays for deep equality.\n */\n function deepArrayEqual(first, second) {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n // Test the arrays for equal length.\n if (first.length !== second.length) {\n return false;\n }\n // Compare the values for equality.\n for (var i = 0, n = first.length; i < n; ++i) {\n if (!deepEqual(first[i], second[i])) {\n return false;\n }\n }\n // At this point, the arrays are equal.\n return true;\n }\n /**\n * Compare two JSON objects for deep equality.\n */\n function deepObjectEqual(first, second) {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n // Check for the first object's keys in the second object.\n for (var key in first) {\n if (first[key] !== undefined && !(key in second)) {\n return false;\n }\n }\n // Check for the second object's keys in the first object.\n for (var key in second) {\n if (second[key] !== undefined && !(key in first)) {\n return false;\n }\n }\n // Compare the values for equality.\n for (var key in first) {\n // Get the values.\n var firstValue = first[key];\n var secondValue = second[key];\n // If both are undefined, ignore the key.\n if (firstValue === undefined && secondValue === undefined) {\n continue;\n }\n // If only one value is undefined, the objects are not equal.\n if (firstValue === undefined || secondValue === undefined) {\n return false;\n }\n // Compare the values.\n if (!deepEqual(firstValue, secondValue)) {\n return false;\n }\n }\n // At this point, the objects are equal.\n return true;\n }\n /**\n * Create a deep copy of a JSON array.\n */\n function deepArrayCopy(value) {\n var result = new Array(value.length);\n for (var i = 0, n = value.length; i < n; ++i) {\n result[i] = deepCopy(value[i]);\n }\n return result;\n }\n /**\n * Create a deep copy of a JSON object.\n */\n function deepObjectCopy(value) {\n var result = {};\n for (var key in value) {\n // Ignore undefined values.\n var subvalue = value[key];\n if (subvalue === undefined) {\n continue;\n }\n result[key] = deepCopy(subvalue);\n }\n return result;\n }\n })(exports.JSONExt || (exports.JSONExt = {}));\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /*-----------------------------------------------------------------------------\n | Copyright (c) 2014-2017, PhosphorJS Contributors\n |\n | Distributed under the terms of the BSD 3-Clause License.\n |\n | The full license is in the file LICENSE, distributed with this software.\n |----------------------------------------------------------------------------*/\n /**\n * An object which stores MIME data for general application use.\n *\n * #### Notes\n * This class does not attempt to enforce \"correctness\" of MIME types\n * and their associated data. Since this class is designed to transfer\n * arbitrary data and objects within the same application, it assumes\n * that the user provides correct and accurate data.\n */\n var MimeData = /** @class */ (function () {\n function MimeData() {\n this._types = [];\n this._values = [];\n }\n /**\n * Get an array of the MIME types contained within the dataset.\n *\n * @returns A new array of the MIME types, in order of insertion.\n */\n MimeData.prototype.types = function () {\n return this._types.slice();\n };\n /**\n * Test whether the dataset has an entry for the given type.\n *\n * @param mime - The MIME type of interest.\n *\n * @returns `true` if the dataset contains a value for the given\n * MIME type, `false` otherwise.\n */\n MimeData.prototype.hasData = function (mime) {\n return this._types.indexOf(mime) !== -1;\n };\n /**\n * Get the data value for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * @returns The value for the given MIME type, or `undefined` if\n * the dataset does not contain a value for the type.\n */\n MimeData.prototype.getData = function (mime) {\n var i = this._types.indexOf(mime);\n return i !== -1 ? this._values[i] : undefined;\n };\n /**\n * Set the data value for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * @param data - The data value for the given MIME type.\n *\n * #### Notes\n * This will overwrite any previous entry for the MIME type.\n */\n MimeData.prototype.setData = function (mime, data) {\n this.clearData(mime);\n this._types.push(mime);\n this._values.push(data);\n };\n /**\n * Remove the data entry for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * #### Notes\n * This is a no-op if there is no entry for the given MIME type.\n */\n MimeData.prototype.clearData = function (mime) {\n var i = this._types.indexOf(mime);\n if (i !== -1) {\n this._types.splice(i, 1);\n this._values.splice(i, 1);\n }\n };\n /**\n * Remove all data entries from the dataset.\n */\n MimeData.prototype.clear = function () {\n this._types.length = 0;\n this._values.length = 0;\n };\n return MimeData;\n }());\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /*-----------------------------------------------------------------------------\n | Copyright (c) 2014-2017, PhosphorJS Contributors\n |\n | Distributed under the terms of the BSD 3-Clause License.\n |\n | The full license is in the file LICENSE, distributed with this software.\n |----------------------------------------------------------------------------*/\n /**\n * A class which wraps a promise into a delegate object.\n *\n * #### Notes\n * This class is useful when the logic to resolve or reject a promise\n * cannot be defined at the point where the promise is created.\n */\n var PromiseDelegate = /** @class */ (function () {\n /**\n * Construct a new promise delegate.\n */\n function PromiseDelegate() {\n var _this = this;\n this.promise = new Promise(function (resolve, reject) {\n _this._resolve = resolve;\n _this._reject = reject;\n });\n }\n /**\n * Resolve the wrapped promise with the given value.\n *\n * @param value - The value to use for resolving the promise.\n */\n PromiseDelegate.prototype.resolve = function (value) {\n var resolve = this._resolve;\n resolve(value);\n };\n /**\n * Reject the wrapped promise with the given value.\n *\n * @reason - The reason for rejecting the promise.\n */\n PromiseDelegate.prototype.reject = function (reason) {\n var reject = this._reject;\n reject(reason);\n };\n return PromiseDelegate;\n }());\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /*-----------------------------------------------------------------------------\n | Copyright (c) 2014-2017, PhosphorJS Contributors\n |\n | Distributed under the terms of the BSD 3-Clause License.\n |\n | The full license is in the file LICENSE, distributed with this software.\n |----------------------------------------------------------------------------*/\n /**\n * A runtime object which captures compile-time type information.\n *\n * #### Notes\n * A token captures the compile-time type of an interface or class in\n * an object which can be used at runtime in a type-safe fashion.\n */\n var Token = /** @class */ (function () {\n /**\n * Construct a new token.\n *\n * @param name - A human readable name for the token.\n */\n function Token(name) {\n this.name = name;\n this._tokenStructuralPropertyT = null;\n }\n return Token;\n }());\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /*-----------------------------------------------------------------------------\n | Copyright (c) 2014-2017, PhosphorJS Contributors\n |\n | Distributed under the terms of the BSD 3-Clause License.\n |\n | The full license is in the file LICENSE, distributed with this software.\n |----------------------------------------------------------------------------*/\n // Fallback\n function fallbackRandomValues(buffer) {\n var value = 0;\n for (var i = 0, n = buffer.length; i < n; ++i) {\n if (i % 4 === 0) {\n value = (Math.random() * 0xffffffff) >>> 0;\n }\n buffer[i] = value & 0xff;\n value >>>= 8;\n }\n }\n\n // Copyright (c) Jupyter Development Team.\n /**\n * The namespace for random number related functionality.\n */\n exports.Random = void 0;\n (function (Random) {\n /**\n * A function which generates random bytes.\n *\n * @param buffer - The `Uint8Array` to fill with random bytes.\n *\n * #### Notes\n * A cryptographically strong random number generator will be used if\n * available. Otherwise, `Math.random` will be used as a fallback for\n * randomness.\n *\n * The following RNGs are supported, listed in order of precedence:\n * - `window.crypto.getRandomValues`\n * - `window.msCrypto.getRandomValues`\n * - `require('crypto').randomFillSync\n * - `require('crypto').randomBytes\n * - `Math.random`\n */\n Random.getRandomValues = (function () {\n // Look up the crypto module if available.\n var crypto = (typeof window !== 'undefined' && (window.crypto || window.msCrypto)) ||\n null;\n // Modern browsers and IE 11\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return function getRandomValues(buffer) {\n return crypto.getRandomValues(buffer);\n };\n }\n // Fallback\n return fallbackRandomValues;\n })();\n })(exports.Random || (exports.Random = {}));\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /*-----------------------------------------------------------------------------\n | Copyright (c) 2014-2017, PhosphorJS Contributors\n |\n | Distributed under the terms of the BSD 3-Clause License.\n |\n | The full license is in the file LICENSE, distributed with this software.\n |----------------------------------------------------------------------------*/\n /**\n * A function which creates a function that generates UUID v4 identifiers.\n *\n * @returns A new function that creates a UUID v4 string.\n *\n * #### Notes\n * This implementation complies with RFC 4122.\n *\n * This uses `Random.getRandomValues()` for random bytes, which in\n * turn will use the underlying `crypto` module of the platform if\n * it is available. The fallback for randomness is `Math.random`.\n */\n function uuid4Factory(getRandomValues) {\n // Create a 16 byte array to hold the random values.\n var bytes = new Uint8Array(16);\n // Create a look up table from bytes to hex strings.\n var lut = new Array(256);\n // Pad the single character hex digits with a leading zero.\n for (var i = 0; i < 16; ++i) {\n lut[i] = '0' + i.toString(16);\n }\n // Populate the rest of the hex digits.\n for (var i = 16; i < 256; ++i) {\n lut[i] = i.toString(16);\n }\n // Return a function which generates the UUID.\n return function uuid4() {\n // Get a new batch of random values.\n getRandomValues(bytes);\n // Set the UUID version number to 4.\n bytes[6] = 0x40 | (bytes[6] & 0x0f);\n // Set the clock sequence bit to the RFC spec.\n bytes[8] = 0x80 | (bytes[8] & 0x3f);\n // Assemble the UUID string.\n return (lut[bytes[0]] +\n lut[bytes[1]] +\n lut[bytes[2]] +\n lut[bytes[3]] +\n '-' +\n lut[bytes[4]] +\n lut[bytes[5]] +\n '-' +\n lut[bytes[6]] +\n lut[bytes[7]] +\n '-' +\n lut[bytes[8]] +\n lut[bytes[9]] +\n '-' +\n lut[bytes[10]] +\n lut[bytes[11]] +\n lut[bytes[12]] +\n lut[bytes[13]] +\n lut[bytes[14]] +\n lut[bytes[15]]);\n };\n }\n\n // Copyright (c) Jupyter Development Team.\n /**\n * The namespace for UUID related functionality.\n */\n exports.UUID = void 0;\n (function (UUID) {\n /**\n * A function which generates UUID v4 identifiers.\n *\n * @returns A new UUID v4 string.\n *\n * #### Notes\n * This implementation complies with RFC 4122.\n *\n * This uses `Random.getRandomValues()` for random bytes, which in\n * turn will use the underlying `crypto` module of the platform if\n * it is available. The fallback for randomness is `Math.random`.\n */\n UUID.uuid4 = uuid4Factory(exports.Random.getRandomValues);\n })(exports.UUID || (exports.UUID = {}));\n\n exports.MimeData = MimeData;\n exports.PromiseDelegate = PromiseDelegate;\n exports.Token = Token;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=index.js.map\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for array-specific algorithms.\n */\nvar ArrayExt;\n(function (ArrayExt) {\n /**\n * Find the index of the first occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.firstIndexOf(data, 'red'); // -1\n * ArrayExt.firstIndexOf(data, 'one'); // 0\n * ArrayExt.firstIndexOf(data, 'one', 1); // 4\n * ArrayExt.firstIndexOf(data, 'two', 2); // -1\n * ArrayExt.firstIndexOf(data, 'two', 2, 1); // 1\n * ```\n */\n function firstIndexOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.firstIndexOf = firstIndexOf;\n /**\n * Find the index of the last occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.lastIndexOf(data, 'red'); // -1\n * ArrayExt.lastIndexOf(data, 'one'); // 4\n * ArrayExt.lastIndexOf(data, 'one', 1); // 0\n * ArrayExt.lastIndexOf(data, 'two', 0); // -1\n * ArrayExt.lastIndexOf(data, 'two', 0, 1); // 1\n * ```\n */\n function lastIndexOf(array, value, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (start < stop) {\n span = start + 1 + (n - stop);\n }\n else {\n span = start - stop + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start - i + n) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.lastIndexOf = lastIndexOf;\n /**\n * Find the index of the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstIndex(data, isEven); // 1\n * ArrayExt.findFirstIndex(data, isEven, 4); // 5\n * ArrayExt.findFirstIndex(data, isEven, 6); // -1\n * ArrayExt.findFirstIndex(data, isEven, 6, 5); // 1\n * ```\n */\n function findFirstIndex(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findFirstIndex = findFirstIndex;\n /**\n * Find the index of the last value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastIndex(data, isEven); // 5\n * ArrayExt.findLastIndex(data, isEven, 4); // 3\n * ArrayExt.findLastIndex(data, isEven, 0); // -1\n * ArrayExt.findLastIndex(data, isEven, 0, 1); // 5\n * ```\n */\n function findLastIndex(array, fn, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let d;\n if (start < stop) {\n d = start + 1 + (n - stop);\n }\n else {\n d = start - stop + 1;\n }\n for (let i = 0; i < d; ++i) {\n let j = (start - i + n) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findLastIndex = findLastIndex;\n /**\n * Find the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstValue(data, isEven); // 2\n * ArrayExt.findFirstValue(data, isEven, 2); // 4\n * ArrayExt.findFirstValue(data, isEven, 6); // undefined\n * ArrayExt.findFirstValue(data, isEven, 6, 5); // 2\n * ```\n */\n function findFirstValue(array, fn, start = 0, stop = -1) {\n let index = findFirstIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findFirstValue = findFirstValue;\n /**\n * Find the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The last matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastValue(data, isEven); // 2\n * ArrayExt.findLastValue(data, isEven, 4); // 4\n * ArrayExt.findLastValue(data, isEven, 0); // undefined\n * ArrayExt.findLastValue(data, isEven, 0, 1); // 2\n * ```\n */\n function findLastValue(array, fn, start = -1, stop = 0) {\n let index = findLastIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findLastValue = findLastValue;\n /**\n * Find the index of the first element which compares `>=` to a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>=` to the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.lowerBound(data, 0, numberCmp); // 0\n * ArrayExt.lowerBound(data, 6, numberCmp); // 3\n * ArrayExt.lowerBound(data, 7, numberCmp); // 3\n * ArrayExt.lowerBound(data, -1, numberCmp); // 0\n * ArrayExt.lowerBound(data, 10, numberCmp); // 6\n * ```\n */\n function lowerBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) < 0) {\n begin = middle + 1;\n span -= half + 1;\n }\n else {\n span = half;\n }\n }\n return begin;\n }\n ArrayExt.lowerBound = lowerBound;\n /**\n * Find the index of the first element which compares `>` than a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>` than the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.upperBound(data, 0, numberCmp); // 1\n * ArrayExt.upperBound(data, 6, numberCmp); // 3\n * ArrayExt.upperBound(data, 7, numberCmp); // 5\n * ArrayExt.upperBound(data, -1, numberCmp); // 0\n * ArrayExt.upperBound(data, 10, numberCmp); // 6\n * ```\n */\n function upperBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) > 0) {\n span = half;\n }\n else {\n begin = middle + 1;\n span -= half + 1;\n }\n }\n return begin;\n }\n ArrayExt.upperBound = upperBound;\n /**\n * Test whether two arrays are shallowly equal.\n *\n * @param a - The first array-like object to compare.\n *\n * @param b - The second array-like object to compare.\n *\n * @param fn - The comparison function to apply to the elements. It\n * should return `true` if the elements are \"equal\". The default\n * compares elements using strict `===` equality.\n *\n * @returns Whether the two arrays are shallowly equal.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * Modifying the length of the arrays while comparing.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let d1 = [0, 3, 4, 7, 7, 9];\n * let d2 = [0, 3, 4, 7, 7, 9];\n * let d3 = [42];\n * ArrayExt.shallowEqual(d1, d2); // true\n * ArrayExt.shallowEqual(d2, d3); // false\n * ```\n */\n function shallowEqual(a, b, fn) {\n // Check for object identity first.\n if (a === b) {\n return true;\n }\n // Bail early if the lengths are different.\n if (a.length !== b.length) {\n return false;\n }\n // Compare each element for equality.\n for (let i = 0, n = a.length; i < n; ++i) {\n if (fn ? !fn(a[i], b[i]) : a[i] !== b[i]) {\n return false;\n }\n }\n // The array are shallowly equal.\n return true;\n }\n ArrayExt.shallowEqual = shallowEqual;\n /**\n * Create a slice of an array subject to an optional step.\n *\n * @param array - The array-like object of interest.\n *\n * @param options - The options for configuring the slice.\n *\n * @returns A new array with the specified values.\n *\n * @throws An exception if the slice `step` is `0`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start`, `stop`, or `step` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.slice(data); // [0, 3, 4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 2 }); // [4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 0, stop: 4 }); // [0, 3, 4, 7]\n * ArrayExt.slice(data, { step: 2 }); // [0, 4, 7]\n * ArrayExt.slice(data, { step: -1 }); // [9, 7, 7, 4, 3, 0]\n * ```\n */\n function slice(array, options = {}) {\n // Extract the options.\n let { start, stop, step } = options;\n // Set up the `step` value.\n if (step === undefined) {\n step = 1;\n }\n // Validate the step size.\n if (step === 0) {\n throw new Error('Slice `step` cannot be zero.');\n }\n // Look up the length of the array.\n let n = array.length;\n // Set up the `start` value.\n if (start === undefined) {\n start = step < 0 ? n - 1 : 0;\n }\n else if (start < 0) {\n start = Math.max(start + n, step < 0 ? -1 : 0);\n }\n else if (start >= n) {\n start = step < 0 ? n - 1 : n;\n }\n // Set up the `stop` value.\n if (stop === undefined) {\n stop = step < 0 ? -1 : n;\n }\n else if (stop < 0) {\n stop = Math.max(stop + n, step < 0 ? -1 : 0);\n }\n else if (stop >= n) {\n stop = step < 0 ? n - 1 : n;\n }\n // Compute the slice length.\n let length;\n if ((step < 0 && stop >= start) || (step > 0 && start >= stop)) {\n length = 0;\n }\n else if (step < 0) {\n length = Math.floor((stop - start + 1) / step + 1);\n }\n else {\n length = Math.floor((stop - start - 1) / step + 1);\n }\n // Compute the sliced result.\n let result = [];\n for (let i = 0; i < length; ++i) {\n result[i] = array[start + i * step];\n }\n // Return the result.\n return result;\n }\n ArrayExt.slice = slice;\n /**\n * Move an element in an array from one index to another.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param fromIndex - The index of the element to move. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param toIndex - The target index of the element. Negative\n * values are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `fromIndex` or `toIndex` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.move(data, 1, 2); // [0, 2, 1, 3, 4]\n * ArrayExt.move(data, 4, 2); // [0, 2, 4, 1, 3]\n * ```\n */\n function move(array, fromIndex, toIndex) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (fromIndex < 0) {\n fromIndex = Math.max(0, fromIndex + n);\n }\n else {\n fromIndex = Math.min(fromIndex, n - 1);\n }\n if (toIndex < 0) {\n toIndex = Math.max(0, toIndex + n);\n }\n else {\n toIndex = Math.min(toIndex, n - 1);\n }\n if (fromIndex === toIndex) {\n return;\n }\n let value = array[fromIndex];\n let d = fromIndex < toIndex ? 1 : -1;\n for (let i = fromIndex; i !== toIndex; i += d) {\n array[i] = array[i + d];\n }\n array[toIndex] = value;\n }\n ArrayExt.move = move;\n /**\n * Reverse an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param start - The index of the first element in the range to be\n * reversed, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * reversed, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` index which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.reverse(data, 1, 3); // [0, 3, 2, 1, 4]\n * ArrayExt.reverse(data, 3); // [0, 3, 2, 4, 1]\n * ArrayExt.reverse(data); // [1, 4, 2, 3, 0]\n * ```\n */\n function reverse(array, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n while (start < stop) {\n let a = array[start];\n let b = array[stop];\n array[start++] = b;\n array[stop--] = a;\n }\n }\n ArrayExt.reverse = reverse;\n /**\n * Rotate the elements of an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param delta - The amount of rotation to apply to the elements. A\n * positive value will rotate the elements to the left. A negative\n * value will rotate the elements to the right.\n *\n * @param start - The index of the first element in the range to be\n * rotated, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * rotated, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `delta`, `start`, or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.rotate(data, 2); // [2, 3, 4, 0, 1]\n * ArrayExt.rotate(data, -2); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 10); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 9); // [4, 0, 1, 2, 3]\n * ArrayExt.rotate(data, 2, 1, 3); // [4, 2, 0, 1, 3]\n * ```\n */\n function rotate(array, delta, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n if (start >= stop) {\n return;\n }\n let length = stop - start + 1;\n if (delta > 0) {\n delta = delta % length;\n }\n else if (delta < 0) {\n delta = ((delta % length) + length) % length;\n }\n if (delta === 0) {\n return;\n }\n let pivot = start + delta;\n reverse(array, start, pivot - 1);\n reverse(array, pivot, stop);\n reverse(array, start, stop);\n }\n ArrayExt.rotate = rotate;\n /**\n * Fill an array with a static value.\n *\n * @param array - The mutable array-like object to fill.\n *\n * @param value - The static value to use to fill the array.\n *\n * @param start - The index of the first element in the range to be\n * filled, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * filled, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Notes\n * If `stop < start` the fill will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four'];\n * ArrayExt.fill(data, 'r'); // ['r', 'r', 'r', 'r']\n * ArrayExt.fill(data, 'g', 1); // ['r', 'g', 'g', 'g']\n * ArrayExt.fill(data, 'b', 2, 3); // ['r', 'g', 'b', 'b']\n * ArrayExt.fill(data, 'z', 3, 1); // ['z', 'z', 'b', 'z']\n * ```\n */\n function fill(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n array[(start + i) % n] = value;\n }\n }\n ArrayExt.fill = fill;\n /**\n * Insert a value into an array at a specific index.\n *\n * @param array - The array of interest.\n *\n * @param index - The index at which to insert the value. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param value - The value to set at the specified index.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2];\n * ArrayExt.insert(data, 0, -1); // [-1, 0, 1, 2]\n * ArrayExt.insert(data, 2, 12); // [-1, 0, 12, 1, 2]\n * ArrayExt.insert(data, -1, 7); // [-1, 0, 12, 1, 7, 2]\n * ArrayExt.insert(data, 6, 19); // [-1, 0, 12, 1, 7, 2, 19]\n * ```\n */\n function insert(array, index, value) {\n let n = array.length;\n if (index < 0) {\n index = Math.max(0, index + n);\n }\n else {\n index = Math.min(index, n);\n }\n for (let i = n; i > index; --i) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n }\n ArrayExt.insert = insert;\n /**\n * Remove and return a value at a specific index in an array.\n *\n * @param array - The array of interest.\n *\n * @param index - The index of the value to remove. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The value at the specified index, or `undefined` if the\n * index is out of range.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeAt(data, 2); // 23\n * ArrayExt.removeAt(data, -2); // 12\n * ArrayExt.removeAt(data, 10); // undefined;\n * ```\n */\n function removeAt(array, index) {\n let n = array.length;\n if (index < 0) {\n index += n;\n }\n if (index < 0 || index >= n) {\n return undefined;\n }\n let value = array[index];\n for (let i = index + 1; i < n; ++i) {\n array[i - 1] = array[i];\n }\n array.length = n - 1;\n return value;\n }\n ArrayExt.removeAt = removeAt;\n /**\n * Remove the first occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstOf(data, 12); // 1\n * ArrayExt.removeFirstOf(data, 17); // -1\n * ArrayExt.removeFirstOf(data, 39, 3); // -1\n * ArrayExt.removeFirstOf(data, 39, 3, 2); // 2\n * ```\n */\n function removeFirstOf(array, value, start = 0, stop = -1) {\n let index = firstIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeFirstOf = removeFirstOf;\n /**\n * Remove the last occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastOf(data, 12); // 5\n * ArrayExt.removeLastOf(data, 17); // -1\n * ArrayExt.removeLastOf(data, 39, 2); // -1\n * ArrayExt.removeLastOf(data, 39, 2, 3); // 3\n * ```\n */\n function removeLastOf(array, value, start = -1, stop = 0) {\n let index = lastIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeLastOf = removeLastOf;\n /**\n * Remove all occurrences of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [14, 12, 23, 39, 14, 12, 19, 14];\n * ArrayExt.removeAllOf(data, 12); // 2\n * ArrayExt.removeAllOf(data, 17); // 0\n * ArrayExt.removeAllOf(data, 14, 1, 4); // 1\n * ```\n */\n function removeAllOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && array[i] === value) {\n count++;\n }\n else if (stop < start &&\n (i <= stop || i >= start) &&\n array[i] === value) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllOf = removeAllOf;\n /**\n * Remove the first occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstWhere(data, isEven); // { index: 0, value: 0 }\n * ArrayExt.removeFirstWhere(data, isEven, 2); // { index: 3, value: 14 }\n * ArrayExt.removeFirstWhere(data, isEven, 4); // { index: -1, value: undefined }\n * ```\n */\n function removeFirstWhere(array, fn, start = 0, stop = -1) {\n let value;\n let index = findFirstIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeFirstWhere = removeFirstWhere;\n /**\n * Remove the last occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastWhere(data, isEven); // { index: 5, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2); // { index: 1, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2, 1); // { index: -1, value: undefined }\n * ```\n */\n function removeLastWhere(array, fn, start = -1, stop = 0) {\n let value;\n let index = findLastIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeLastWhere = removeLastWhere;\n /**\n * Remove all occurrences of values which match a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * function isNegative(value: number): boolean {\n * return value < 0;\n * }\n *\n * let data = [0, 12, -13, -9, 23, 39, 14, -15, 12, 75];\n * ArrayExt.removeAllWhere(data, isEven); // 4\n * ArrayExt.removeAllWhere(data, isNegative, 0, 3); // 2\n * ```\n */\n function removeAllWhere(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && fn(array[i], i)) {\n count++;\n }\n else if (stop < start && (i <= stop || i >= start) && fn(array[i], i)) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllWhere = removeAllWhere;\n})(ArrayExt || (ArrayExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Chain together several iterables.\n *\n * @deprecated\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields the values of the iterables\n * in the order in which they are supplied.\n *\n * #### Example\n * ```typescript\n * import { chain } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = chain(data1, data2);\n *\n * Array.from(stream); // [1, 2, 3, 4, 5, 6]\n * ```\n */\nfunction* chain(...objects) {\n for (const object of objects) {\n yield* object;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an empty iterator.\n *\n * @returns A new iterator which yields nothing.\n *\n * #### Example\n * ```typescript\n * import { empty } from '@lumino/algorithm';\n *\n * let stream = empty();\n *\n * Array.from(stream); // []\n * ```\n */\n// eslint-disable-next-line require-yield\nfunction* empty() {\n return;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Enumerate an iterable object.\n *\n * @param object - The iterable object of interest.\n *\n * @param start - The starting enum value. The default is `0`.\n *\n * @returns An iterator which yields the enumerated values.\n *\n * #### Example\n * ```typescript\n * import { enumerate } from '@lumino/algorithm';\n *\n * let data = ['foo', 'bar', 'baz'];\n *\n * let stream = enumerate(data, 1);\n *\n * Array.from(stream); // [[1, 'foo'], [2, 'bar'], [3, 'baz']]\n * ```\n */\nfunction* enumerate(object, start = 0) {\n for (const value of object) {\n yield [start++, value];\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Filter an iterable for values which pass a test.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns An iterator which yields the values which pass the test.\n *\n * #### Example\n * ```typescript\n * import { filter } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = filter(data, value => value % 2 === 0);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* filter(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Find the first value in an iterable which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { find } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * find(data, isCat).name; // 'fluffy'\n * ```\n */\nfunction find(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return value;\n }\n }\n return undefined;\n}\n/**\n * Find the index of the first value which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { findIndex } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * findIndex(data, isCat); // 1\n * ```\n */\nfunction findIndex(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return index - 1;\n }\n }\n return -1;\n}\n/**\n * Find the minimum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The minimum value in the iterable. If multiple values are\n * equivalent to the minimum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { min } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * min([7, 4, 0, 3, 9, 4], numberCmp); // 0\n * ```\n */\nfunction min(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) < 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the maximum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The maximum value in the iterable. If multiple values are\n * equivalent to the maximum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { max } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * max([7, 4, 0, 3, 9, 4], numberCmp); // 9\n * ```\n */\nfunction max(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) > 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the minimum and maximum values in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns A 2-tuple of the `[min, max]` values in the iterable. If\n * multiple values are equivalent, the left-most values are returned.\n * If the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { minmax } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * minmax([7, 4, 0, 3, 9, 4], numberCmp); // [0, 9]\n * ```\n */\nfunction minmax(object, fn) {\n let empty = true;\n let vmin;\n let vmax;\n for (const value of object) {\n if (empty) {\n vmin = value;\n vmax = value;\n empty = false;\n }\n else if (fn(value, vmin) < 0) {\n vmin = value;\n }\n else if (fn(value, vmax) > 0) {\n vmax = value;\n }\n }\n return empty ? undefined : [vmin, vmax];\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an array from an iterable of values.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new array of values from the given object.\n *\n * #### Example\n * ```typescript\n * import { toArray } from '@lumino/algorithm';\n *\n * let stream = [1, 2, 3, 4, 5, 6][Symbol.iterator]();\n *\n * toArray(stream); // [1, 2, 3, 4, 5, 6];\n * ```\n */\nfunction toArray(object) {\n return Array.from(object);\n}\n/**\n * Create an object from an iterable of key/value pairs.\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new object mapping keys to values.\n *\n * #### Example\n * ```typescript\n * import { toObject } from '@lumino/algorithm';\n *\n * let data: [string, number][] = [['one', 1], ['two', 2], ['three', 3]];\n *\n * toObject(data); // { one: 1, two: 2, three: 3 }\n * ```\n */\nfunction toObject(object) {\n const result = {};\n for (const [key, value] of object) {\n result[key] = value;\n }\n return result;\n}\n/**\n * Invoke a function for each value in an iterable.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The callback function to invoke for each value.\n *\n * #### Notes\n * Iteration can be terminated early by returning `false` from the\n * callback function.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each } from '@lumino/algorithm';\n *\n * let data = [5, 7, 0, -2, 9];\n *\n * each(data, value => { console.log(value); });\n * ```\n */\nfunction each(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return;\n }\n }\n}\n/**\n * Test whether all values in an iterable satisfy a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if all values pass the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `false` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { every } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * every(data, value => value % 2 === 0); // false\n * every(data, value => value % 2 === 1); // true\n * ```\n */\nfunction every(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Test whether any value in an iterable satisfies a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if any value passes the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `true` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { some } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * some(data, value => value === 7); // true\n * some(data, value => value === 3); // false\n * ```\n */\nfunction some(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return true;\n }\n }\n return false;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Transform the values of an iterable with a mapping function.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The mapping function to invoke for each value.\n *\n * @returns An iterator which yields the transformed values.\n *\n * #### Example\n * ```typescript\n * import { map } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3];\n *\n * let stream = map(data, value => value * 2);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* map(object, fn) {\n let index = 0;\n for (const value of object) {\n yield fn(value, index++);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator of evenly spaced values.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns An iterator which produces evenly spaced values.\n *\n * #### Notes\n * In the single argument form of `range(stop)`, `start` defaults to\n * `0` and `step` defaults to `1`.\n *\n * In the two argument form of `range(start, stop)`, `step` defaults\n * to `1`.\n *\n * #### Example\n * ```typescript\n * import { range } from '@lumino/algorithm';\n *\n * let stream = range(2, 4);\n *\n * Array.from(stream); // [2, 3]\n * ```\n */\nfunction* range(start, stop, step) {\n if (stop === undefined) {\n stop = start;\n start = 0;\n step = 1;\n }\n else if (step === undefined) {\n step = 1;\n }\n const length = Private.rangeLength(start, stop, step);\n for (let index = 0; index < length; index++) {\n yield start + step * index;\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Compute the effective length of a range.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns The number of steps need to traverse the range.\n */\n function rangeLength(start, stop, step) {\n if (step === 0) {\n return Infinity;\n }\n if (start > stop && step > 0) {\n return 0;\n }\n if (start < stop && step < 0) {\n return 0;\n }\n return Math.ceil((stop - start) / step);\n }\n Private.rangeLength = rangeLength;\n})(Private || (Private = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nfunction reduce(object, fn, initial) {\n // Setup the iterator and fetch the first value.\n const it = object[Symbol.iterator]();\n let index = 0;\n let first = it.next();\n // An empty iterator and no initial value is an error.\n if (first.done && initial === undefined) {\n throw new TypeError('Reduce of empty iterable with no initial value.');\n }\n // If the iterator is empty, return the initial value.\n if (first.done) {\n return initial;\n }\n // If the iterator has a single item and no initial value, the\n // reducer is not invoked and the first item is the return value.\n let second = it.next();\n if (second.done && initial === undefined) {\n return first.value;\n }\n // If iterator has a single item and an initial value is provided,\n // the reducer is invoked and that result is the return value.\n if (second.done) {\n return fn(initial, first.value, index++);\n }\n // Setup the initial accumlated value.\n let accumulator;\n if (initial === undefined) {\n accumulator = fn(first.value, second.value, index++);\n }\n else {\n accumulator = fn(fn(initial, first.value, index++), second.value, index++);\n }\n // Iterate the rest of the values, updating the accumulator.\n let next;\n while (!(next = it.next()).done) {\n accumulator = fn(accumulator, next.value, index++);\n }\n // Return the final accumulated value.\n return accumulator;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator which repeats a value a number of times.\n *\n * @deprecated\n *\n * @param value - The value to repeat.\n *\n * @param count - The number of times to repeat the value.\n *\n * @returns A new iterator which repeats the specified value.\n *\n * #### Example\n * ```typescript\n * import { repeat } from '@lumino/algorithm';\n *\n * let stream = repeat(7, 3);\n *\n * Array.from(stream); // [7, 7, 7]\n * ```\n */\nfunction* repeat(value, count) {\n while (0 < count--) {\n yield value;\n }\n}\n/**\n * Create an iterator which yields a value a single time.\n *\n * @deprecated\n *\n * @param value - The value to wrap in an iterator.\n *\n * @returns A new iterator which yields the value a single time.\n *\n * #### Example\n * ```typescript\n * import { once } from '@lumino/algorithm';\n *\n * let stream = once(7);\n *\n * Array.from(stream); // [7]\n * ```\n */\nfunction* once(value) {\n yield value;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator for a retroable object.\n *\n * @param object - The retroable or array-like object of interest.\n *\n * @returns An iterator which traverses the object's values in reverse.\n *\n * #### Example\n * ```typescript\n * import { retro } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = retro(data);\n *\n * Array.from(stream); // [6, 5, 4, 3, 2, 1]\n * ```\n */\nfunction* retro(object) {\n if (typeof object.retro === 'function') {\n yield* object.retro();\n }\n else {\n for (let index = object.length - 1; index > -1; index--) {\n yield object[index];\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Topologically sort an iterable of edges.\n *\n * @param edges - The iterable object of edges to sort.\n * An edge is represented as a 2-tuple of `[fromNode, toNode]`.\n *\n * @returns The topologically sorted array of nodes.\n *\n * #### Notes\n * If a cycle is present in the graph, the cycle will be ignored and\n * the return value will be only approximately sorted.\n *\n * #### Example\n * ```typescript\n * import { topologicSort } from '@lumino/algorithm';\n *\n * let data = [\n * ['d', 'e'],\n * ['c', 'd'],\n * ['a', 'b'],\n * ['b', 'c']\n * ];\n *\n * topologicSort(data); // ['a', 'b', 'c', 'd', 'e']\n * ```\n */\nfunction topologicSort(edges) {\n // Setup the shared sorting state.\n let sorted = [];\n let visited = new Set();\n let graph = new Map();\n // Add the edges to the graph.\n for (const edge of edges) {\n addEdge(edge);\n }\n // Visit each node in the graph.\n for (const [k] of graph) {\n visit(k);\n }\n // Return the sorted results.\n return sorted;\n // Add an edge to the graph.\n function addEdge(edge) {\n let [fromNode, toNode] = edge;\n let children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n }\n else {\n graph.set(toNode, [fromNode]);\n }\n }\n // Recursively visit the node.\n function visit(node) {\n if (visited.has(node)) {\n return;\n }\n visited.add(node);\n let children = graph.get(node);\n if (children) {\n for (const child of children) {\n visit(child);\n }\n }\n sorted.push(node);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate over an iterable using a stepped increment.\n *\n * @param object - The iterable object of interest.\n *\n * @param step - The distance to step on each iteration. A value\n * of less than `1` will behave the same as a value of `1`.\n *\n * @returns An iterator which traverses the iterable step-wise.\n *\n * #### Example\n * ```typescript\n * import { stride } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = stride(data, 2);\n *\n * Array.from(stream); // [1, 3, 5];\n * ```\n */\nfunction* stride(object, step) {\n let count = 0;\n for (const value of object) {\n if (0 === count++ % step) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for string-specific algorithms.\n */\nvar StringExt;\n(function (StringExt) {\n /**\n * Find the indices of characters in a source text.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The matched indices, or `null` if there is no match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * In order for there to be a match, all of the characters in `query`\n * **must** appear in `source` in the order given by `query`.\n *\n * Characters are matched using strict `===` equality.\n */\n function findIndices(source, query, start = 0) {\n let indices = new Array(query.length);\n for (let i = 0, j = start, n = query.length; i < n; ++i, ++j) {\n j = source.indexOf(query[i], j);\n if (j === -1) {\n return null;\n }\n indices[i] = j;\n }\n return indices;\n }\n StringExt.findIndices = findIndices;\n /**\n * A string matcher which uses a sum-of-squares algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-squares approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The index of each\n * matching character is squared and added to the score. This means\n * that early and consecutive character matches are preferred, while\n * late matches are heavily penalized.\n */\n function matchSumOfSquares(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i] - start;\n score += j * j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfSquares = matchSumOfSquares;\n /**\n * A string matcher which uses a sum-of-deltas algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-deltas approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The delta between\n * the indices are summed to create the score. This means that groups\n * of matched characters are preferred, while fragmented matches are\n * penalized.\n */\n function matchSumOfDeltas(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n let last = start - 1;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i];\n score += j - last - 1;\n last = j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfDeltas = matchSumOfDeltas;\n /**\n * Highlight the matched characters of a source text.\n *\n * @param source - The text which should be highlighted.\n *\n * @param indices - The indices of the matched characters. They must\n * appear in increasing order and must be in bounds of the source.\n *\n * @param fn - The function to apply to the matched chunks.\n *\n * @returns An array of unmatched and highlighted chunks.\n */\n function highlight(source, indices, fn) {\n // Set up the result array.\n let result = [];\n // Set up the counter variables.\n let k = 0;\n let last = 0;\n let n = indices.length;\n // Iterator over each index.\n while (k < n) {\n // Set up the chunk indices.\n let i = indices[k];\n let j = indices[k];\n // Advance the right chunk index until it's non-contiguous.\n while (++k < n && indices[k] === j + 1) {\n j++;\n }\n // Extract the unmatched text.\n if (last < i) {\n result.push(source.slice(last, i));\n }\n // Extract and highlight the matched text.\n if (i < j + 1) {\n result.push(fn(source.slice(i, j + 1)));\n }\n // Update the last visited index.\n last = j + 1;\n }\n // Extract any remaining unmatched text.\n if (last < source.length) {\n result.push(source.slice(last));\n }\n // Return the highlighted result.\n return result;\n }\n StringExt.highlight = highlight;\n /**\n * A 3-way string comparison function.\n *\n * @param a - The first string of interest.\n *\n * @param b - The second string of interest.\n *\n * @returns `-1` if `a < b`, else `1` if `a > b`, else `0`.\n */\n function cmp(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n }\n StringExt.cmp = cmp;\n})(StringExt || (StringExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Take a fixed number of items from an iterable.\n *\n * @param object - The iterable object of interest.\n *\n * @param count - The number of items to take from the iterable.\n *\n * @returns An iterator which yields the specified number of items\n * from the source iterable.\n *\n * #### Notes\n * The returned iterator will exhaust early if the source iterable\n * contains an insufficient number of items.\n *\n * #### Example\n * ```typescript\n * import { take } from '@lumino/algorithm';\n *\n * let stream = take([5, 4, 3, 2, 1, 0, -1], 3);\n *\n * Array.from(stream); // [5, 4, 3]\n * ```\n */\nfunction* take(object, count) {\n if (count < 1) {\n return;\n }\n const it = object[Symbol.iterator]();\n let item;\n while (0 < count-- && !(item = it.next()).done) {\n yield item.value;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate several iterables in lockstep.\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields successive tuples of values where\n * each value is taken in turn from the provided iterables. It will\n * be as long as the shortest provided iterable.\n *\n * #### Example\n * ```typescript\n * import { zip } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = zip(data1, data2);\n *\n * Array.from(stream); // [[1, 4], [2, 5], [3, 6]]\n * ```\n */\nfunction* zip(...objects) {\n const iters = objects.map(obj => obj[Symbol.iterator]());\n let tuple = iters.map(it => it.next());\n for (; every(tuple, item => !item.done); tuple = iters.map(it => it.next())) {\n yield tuple.map(item => item.value);\n }\n}\n\nexport { ArrayExt, StringExt, chain, each, empty, enumerate, every, filter, find, findIndex, map, max, min, minmax, once, range, reduce, repeat, retro, some, stride, take, toArray, toObject, topologicSort, zip };\n//# sourceMappingURL=index.es6.js.map\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module nbformat\n */\n// Notebook format interfaces\n// https://nbformat.readthedocs.io/en/latest/format_description.html\n// https://github.com/jupyter/nbformat/blob/master/nbformat/v4/nbformat.v4.schema.json\nimport { JSONExt } from '@lumino/coreutils';\n/**\n * The earliest major version of the notebook format we support.\n */\nexport const MAJOR_VERSION = 4;\n/**\n * The earliest minor version of the notebook format we support.\n */\nexport const MINOR_VERSION = 4;\n/**\n * Validate a mime type/value pair.\n *\n * @param type - The mimetype name.\n *\n * @param value - The value associated with the type.\n *\n * @returns Whether the type/value pair are valid.\n */\nexport function validateMimeValue(type, value) {\n // Check if \"application/json\" or \"application/foo+json\"\n const jsonTest = /^application\\/.+\\+json$/;\n const isJSONType = type === 'application/json' || jsonTest.test(type);\n const isString = (x) => {\n return Object.prototype.toString.call(x) === '[object String]';\n };\n // If it is an array, make sure if is not a JSON type and it is an\n // array of strings.\n if (Array.isArray(value)) {\n if (isJSONType) {\n return false;\n }\n let valid = true;\n value.forEach(v => {\n if (!isString(v)) {\n valid = false;\n }\n });\n return valid;\n }\n // If it is a string, make sure we are not a JSON type.\n if (isString(value)) {\n return !isJSONType;\n }\n // It is not a string, make sure it is a JSON type.\n if (!isJSONType) {\n return false;\n }\n // It is a JSON type, make sure it is a valid JSON object.\n return JSONExt.isObject(value);\n}\n/**\n * Test whether a cell is a raw cell.\n */\nexport function isRaw(cell) {\n return cell.cell_type === 'raw';\n}\n/**\n * Test whether a cell is a markdown cell.\n */\nexport function isMarkdown(cell) {\n return cell.cell_type === 'markdown';\n}\n/**\n * Test whether a cell is a code cell.\n */\nexport function isCode(cell) {\n return cell.cell_type === 'code';\n}\n/**\n * Test whether an output is an execute result.\n */\nexport function isExecuteResult(output) {\n return output.output_type === 'execute_result';\n}\n/**\n * Test whether an output is from display data.\n */\nexport function isDisplayData(output) {\n return output.output_type === 'display_data';\n}\n/**\n * Test whether an output is from updated display data.\n */\nexport function isDisplayUpdate(output) {\n return output.output_type === 'update_display_data';\n}\n/**\n * Test whether an output is from a stream.\n */\nexport function isStream(output) {\n return output.output_type === 'stream';\n}\n/**\n * Test whether an output is an error.\n */\nexport function isError(output) {\n return output.output_type === 'error';\n}\n//# sourceMappingURL=index.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { ArrayExt } from '@lumino/algorithm';\nimport { Signal } from '@lumino/signaling';\n/**\n * A concrete implementation of [[IObservableList]].\n */\nexport class ObservableList {\n /**\n * Construct a new observable map.\n */\n constructor(options = {}) {\n this._array = [];\n this._isDisposed = false;\n this._changed = new Signal(this);\n if (options.values) {\n for (const value of options.values) {\n this._array.push(value);\n }\n }\n this._itemCmp = options.itemCmp || Private.itemCmp;\n }\n /**\n * The type of this object.\n */\n get type() {\n return 'List';\n }\n /**\n * A signal emitted when the list has changed.\n */\n get changed() {\n return this._changed;\n }\n /**\n * The length of the list.\n */\n get length() {\n return this._array.length;\n }\n /**\n * Test whether the list has been disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * Dispose of the resources held by the list.\n */\n dispose() {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n Signal.clearData(this);\n this.clear();\n }\n /**\n * Create an iterator over the values in the list.\n *\n * @returns A new iterator starting at the front of the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Iterator Validity\n * No changes.\n */\n [Symbol.iterator]() {\n return this._array[Symbol.iterator]();\n }\n /**\n * Get the value at the specified index.\n *\n * @param index - The positive integer index of interest.\n *\n * @returns The value at the specified index.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral or out of range.\n */\n get(index) {\n return this._array[index];\n }\n /**\n * Set the value at the specified index.\n *\n * @param index - The positive integer index of interest.\n *\n * @param value - The value to set at the specified index.\n *\n * #### Complexity\n * Constant.\n *\n * #### Iterator Validity\n * No changes.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral or out of range.\n */\n set(index, value) {\n const oldValue = this._array[index];\n if (value === undefined) {\n throw new Error('Cannot set an undefined item');\n }\n // Bail if the value does not change.\n const itemCmp = this._itemCmp;\n if (itemCmp(oldValue, value)) {\n return;\n }\n this._array[index] = value;\n this._changed.emit({\n type: 'set',\n oldIndex: index,\n newIndex: index,\n oldValues: [oldValue],\n newValues: [value]\n });\n }\n /**\n * Add a value to the end of the list.\n *\n * @param value - The value to add to the end of the list.\n *\n * @returns The new length of the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * By convention, the oldIndex is set to -1 to indicate\n * an push operation.\n *\n * #### Iterator Validity\n * No changes.\n */\n push(value) {\n const num = this._array.push(value);\n this._changed.emit({\n type: 'add',\n oldIndex: -1,\n newIndex: this.length - 1,\n oldValues: [],\n newValues: [value]\n });\n return num;\n }\n /**\n * Insert a value into the list at a specific index.\n *\n * @param index - The index at which to insert the value.\n *\n * @param value - The value to set at the specified index.\n *\n * #### Complexity\n * Linear.\n *\n * #### Iterator Validity\n * No changes.\n *\n * #### Notes\n * The `index` will be clamped to the bounds of the list.\n *\n * By convention, the oldIndex is set to -2 to indicate\n * an insert operation.\n *\n * The value -2 as oldIndex can be used to distinguish from the push\n * method which will use a value -1.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n */\n insert(index, value) {\n if (index === this._array.length) {\n this._array.push(value);\n }\n else {\n ArrayExt.insert(this._array, index, value);\n }\n this._changed.emit({\n type: 'add',\n oldIndex: -2,\n newIndex: index,\n oldValues: [],\n newValues: [value]\n });\n }\n /**\n * Remove the first occurrence of a value from the list.\n *\n * @param value - The value of interest.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the list.\n *\n * #### Complexity\n * Linear.\n *\n * #### Iterator Validity\n * Iterators pointing at the removed value and beyond are invalidated.\n */\n removeValue(value) {\n const itemCmp = this._itemCmp;\n const index = ArrayExt.findFirstIndex(this._array, item => {\n return itemCmp(item, value);\n });\n this.remove(index);\n return index;\n }\n /**\n * Remove and return the value at a specific index.\n *\n * @param index - The index of the value of interest.\n *\n * @returns The value at the specified index, or `undefined` if the\n * index is out of range.\n *\n * #### Complexity\n * Constant.\n *\n * #### Iterator Validity\n * Iterators pointing at the removed value and beyond are invalidated.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n */\n remove(index) {\n const value = ArrayExt.removeAt(this._array, index);\n if (value === undefined) {\n return;\n }\n this._changed.emit({\n type: 'remove',\n oldIndex: index,\n newIndex: -1,\n newValues: [],\n oldValues: [value]\n });\n return value;\n }\n /**\n * Remove all values from the list.\n *\n * #### Complexity\n * Linear.\n *\n * #### Iterator Validity\n * All current iterators are invalidated.\n */\n clear() {\n const copy = this._array.slice();\n this._array.length = 0;\n this._changed.emit({\n type: 'remove',\n oldIndex: 0,\n newIndex: 0,\n newValues: [],\n oldValues: copy\n });\n }\n /**\n * Move a value from one index to another.\n *\n * @param fromIndex - The index of the element to move.\n *\n * @param toIndex - The index to move the element to.\n *\n * #### Complexity\n * Constant.\n *\n * #### Iterator Validity\n * Iterators pointing at the lesser of the `fromIndex` and the `toIndex`\n * and beyond are invalidated.\n *\n * #### Undefined Behavior\n * A `fromIndex` or a `toIndex` which is non-integral.\n */\n move(fromIndex, toIndex) {\n if (this.length <= 1 || fromIndex === toIndex) {\n return;\n }\n const values = [this._array[fromIndex]];\n ArrayExt.move(this._array, fromIndex, toIndex);\n this._changed.emit({\n type: 'move',\n oldIndex: fromIndex,\n newIndex: toIndex,\n oldValues: values,\n newValues: values\n });\n }\n /**\n * Push a set of values to the back of the list.\n *\n * @param values - An iterable set of values to add.\n *\n * @returns The new length of the list.\n *\n * #### Complexity\n * Linear.\n *\n * #### Notes\n * By convention, the oldIndex is set to -1 to indicate\n * an push operation.\n *\n * #### Iterator Validity\n * No changes.\n */\n pushAll(values) {\n const newIndex = this.length;\n for (const value of values) {\n this._array.push(value);\n }\n this._changed.emit({\n type: 'add',\n oldIndex: -1,\n newIndex,\n oldValues: [],\n newValues: Array.from(values)\n });\n return this.length;\n }\n /**\n * Insert a set of items into the list at the specified index.\n *\n * @param index - The index at which to insert the values.\n *\n * @param values - The values to insert at the specified index.\n *\n * #### Complexity.\n * Linear.\n *\n * #### Iterator Validity\n * No changes.\n *\n * #### Notes\n * The `index` will be clamped to the bounds of the list.\n * By convention, the oldIndex is set to -2 to indicate\n * an insert operation.\n *\n * #### Undefined Behavior.\n * An `index` which is non-integral.\n */\n insertAll(index, values) {\n const newIndex = index;\n for (const value of values) {\n ArrayExt.insert(this._array, index++, value);\n }\n this._changed.emit({\n type: 'add',\n oldIndex: -2,\n newIndex,\n oldValues: [],\n newValues: Array.from(values)\n });\n }\n /**\n * Remove a range of items from the list.\n *\n * @param startIndex - The start index of the range to remove (inclusive).\n *\n * @param endIndex - The end index of the range to remove (exclusive).\n *\n * @returns The new length of the list.\n *\n * #### Complexity\n * Linear.\n *\n * #### Iterator Validity\n * Iterators pointing to the first removed value and beyond are invalid.\n *\n * #### Undefined Behavior\n * A `startIndex` or `endIndex` which is non-integral.\n */\n removeRange(startIndex, endIndex) {\n const oldValues = this._array.slice(startIndex, endIndex);\n for (let i = startIndex; i < endIndex; i++) {\n ArrayExt.removeAt(this._array, startIndex);\n }\n this._changed.emit({\n type: 'remove',\n oldIndex: startIndex,\n newIndex: -1,\n oldValues,\n newValues: []\n });\n return this.length;\n }\n}\n/**\n * The namespace for module private data.\n */\nvar Private;\n(function (Private) {\n /**\n * The default strict equality item cmp.\n */\n function itemCmp(first, second) {\n return first === second;\n }\n Private.itemCmp = itemCmp;\n})(Private || (Private = {}));\n//# sourceMappingURL=observablelist.js.map","/**\n * A generic doubly-linked list.\n */\nclass LinkedList {\n constructor() {\n this._first = null;\n this._last = null;\n this._size = 0;\n }\n /**\n * Whether the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get isEmpty() {\n return this._size === 0;\n }\n /**\n * The size of the list.\n *\n * #### Complexity\n * `O(1)`\n *\n * #### Notes\n * This is equivalent to `length`.\n */\n get size() {\n return this._size;\n }\n /**\n * The length of the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `size`.\n *\n * This property is deprecated.\n */\n get length() {\n return this._size;\n }\n /**\n * The first value in the list.\n *\n * This is `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get first() {\n return this._first ? this._first.value : undefined;\n }\n /**\n * The last value in the list.\n *\n * This is `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get last() {\n return this._last ? this._last.value : undefined;\n }\n /**\n * The first node in the list.\n *\n * This is `null` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get firstNode() {\n return this._first;\n }\n /**\n * The last node in the list.\n *\n * This is `null` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get lastNode() {\n return this._last;\n }\n /**\n * Create an iterator over the values in the list.\n *\n * @returns A new iterator starting with the first value.\n *\n * #### Complexity\n * Constant.\n */\n *[Symbol.iterator]() {\n let node = this._first;\n while (node) {\n yield node.value;\n node = node.next;\n }\n }\n /**\n * Create a reverse iterator over the values in the list.\n *\n * @returns A new iterator starting with the last value.\n *\n * #### Complexity\n * Constant.\n */\n *retro() {\n let node = this._last;\n while (node) {\n yield node.value;\n node = node.prev;\n }\n }\n /**\n * Create an iterator over the nodes in the list.\n *\n * @returns A new iterator starting with the first node.\n *\n * #### Complexity\n * Constant.\n */\n *nodes() {\n let node = this._first;\n while (node) {\n yield node;\n node = node.next;\n }\n }\n /**\n * Create a reverse iterator over the nodes in the list.\n *\n * @returns A new iterator starting with the last node.\n *\n * #### Complexity\n * Constant.\n */\n *retroNodes() {\n let node = this._last;\n while (node) {\n yield node;\n node = node.prev;\n }\n }\n /**\n * Assign new values to the list, replacing all current values.\n *\n * @param values - The values to assign to the list.\n *\n * #### Complexity\n * Linear.\n */\n assign(values) {\n this.clear();\n for (const value of values) {\n this.addLast(value);\n }\n }\n /**\n * Add a value to the end of the list.\n *\n * @param value - The value to add to the end of the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `addLast`.\n */\n push(value) {\n this.addLast(value);\n }\n /**\n * Remove and return the value at the end of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `removeLast`.\n */\n pop() {\n return this.removeLast();\n }\n /**\n * Add a value to the beginning of the list.\n *\n * @param value - The value to add to the beginning of the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `addFirst`.\n */\n shift(value) {\n this.addFirst(value);\n }\n /**\n * Remove and return the value at the beginning of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `removeFirst`.\n */\n unshift() {\n return this.removeFirst();\n }\n /**\n * Add a value to the beginning of the list.\n *\n * @param value - The value to add to the beginning of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Complexity\n * Constant.\n */\n addFirst(value) {\n let node = new Private.LinkedListNode(this, value);\n if (!this._first) {\n this._first = node;\n this._last = node;\n }\n else {\n node.next = this._first;\n this._first.prev = node;\n this._first = node;\n }\n this._size++;\n return node;\n }\n /**\n * Add a value to the end of the list.\n *\n * @param value - The value to add to the end of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Complexity\n * Constant.\n */\n addLast(value) {\n let node = new Private.LinkedListNode(this, value);\n if (!this._last) {\n this._first = node;\n this._last = node;\n }\n else {\n node.prev = this._last;\n this._last.next = node;\n this._last = node;\n }\n this._size++;\n return node;\n }\n /**\n * Insert a value before a specific node in the list.\n *\n * @param value - The value to insert before the reference node.\n *\n * @param ref - The reference node of interest. If this is `null`,\n * the value will be added to the beginning of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Notes\n * The reference node must be owned by the list.\n *\n * #### Complexity\n * Constant.\n */\n insertBefore(value, ref) {\n if (!ref || ref === this._first) {\n return this.addFirst(value);\n }\n if (!(ref instanceof Private.LinkedListNode) || ref.list !== this) {\n throw new Error('Reference node is not owned by the list.');\n }\n let node = new Private.LinkedListNode(this, value);\n let _ref = ref;\n let prev = _ref.prev;\n node.next = _ref;\n node.prev = prev;\n _ref.prev = node;\n prev.next = node;\n this._size++;\n return node;\n }\n /**\n * Insert a value after a specific node in the list.\n *\n * @param value - The value to insert after the reference node.\n *\n * @param ref - The reference node of interest. If this is `null`,\n * the value will be added to the end of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Notes\n * The reference node must be owned by the list.\n *\n * #### Complexity\n * Constant.\n */\n insertAfter(value, ref) {\n if (!ref || ref === this._last) {\n return this.addLast(value);\n }\n if (!(ref instanceof Private.LinkedListNode) || ref.list !== this) {\n throw new Error('Reference node is not owned by the list.');\n }\n let node = new Private.LinkedListNode(this, value);\n let _ref = ref;\n let next = _ref.next;\n node.next = next;\n node.prev = _ref;\n _ref.next = node;\n next.prev = node;\n this._size++;\n return node;\n }\n /**\n * Remove and return the value at the beginning of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n removeFirst() {\n let node = this._first;\n if (!node) {\n return undefined;\n }\n if (node === this._last) {\n this._first = null;\n this._last = null;\n }\n else {\n this._first = node.next;\n this._first.prev = null;\n }\n node.list = null;\n node.next = null;\n node.prev = null;\n this._size--;\n return node.value;\n }\n /**\n * Remove and return the value at the end of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n removeLast() {\n let node = this._last;\n if (!node) {\n return undefined;\n }\n if (node === this._first) {\n this._first = null;\n this._last = null;\n }\n else {\n this._last = node.prev;\n this._last.next = null;\n }\n node.list = null;\n node.next = null;\n node.prev = null;\n this._size--;\n return node.value;\n }\n /**\n * Remove a specific node from the list.\n *\n * @param node - The node to remove from the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * The node must be owned by the list.\n */\n removeNode(node) {\n if (!(node instanceof Private.LinkedListNode) || node.list !== this) {\n throw new Error('Node is not owned by the list.');\n }\n let _node = node;\n if (_node === this._first && _node === this._last) {\n this._first = null;\n this._last = null;\n }\n else if (_node === this._first) {\n this._first = _node.next;\n this._first.prev = null;\n }\n else if (_node === this._last) {\n this._last = _node.prev;\n this._last.next = null;\n }\n else {\n _node.next.prev = _node.prev;\n _node.prev.next = _node.next;\n }\n _node.list = null;\n _node.next = null;\n _node.prev = null;\n this._size--;\n }\n /**\n * Remove all values from the list.\n *\n * #### Complexity\n * Linear.\n */\n clear() {\n let node = this._first;\n while (node) {\n let next = node.next;\n node.list = null;\n node.prev = null;\n node.next = null;\n node = next;\n }\n this._first = null;\n this._last = null;\n this._size = 0;\n }\n}\n/**\n * The namespace for the `LinkedList` class statics.\n */\n(function (LinkedList) {\n /**\n * Create a linked list from an iterable of values.\n *\n * @param values - The iterable object of interest.\n *\n * @returns A new linked list initialized with the given values.\n *\n * #### Complexity\n * Linear.\n */\n function from(values) {\n let list = new LinkedList();\n list.assign(values);\n return list;\n }\n LinkedList.from = from;\n})(LinkedList || (LinkedList = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The internal linked list node implementation.\n */\n class LinkedListNode {\n /**\n * Construct a new linked list node.\n *\n * @param list - The list which owns the node.\n *\n * @param value - The value for the link.\n */\n constructor(list, value) {\n /**\n * The linked list which created and owns the node.\n */\n this.list = null;\n /**\n * The next node in the list.\n */\n this.next = null;\n /**\n * The previous node in the list.\n */\n this.prev = null;\n this.list = list;\n this.value = value;\n }\n }\n Private.LinkedListNode = LinkedListNode;\n})(Private || (Private = {}));\n\nexport { LinkedList };\n//# sourceMappingURL=index.es6.js.map\n","import { every, retro, some, ArrayExt } from '@lumino/algorithm';\nimport { LinkedList } from '@lumino/collections';\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module messaging\n */\n/**\n * A message which can be delivered to a message handler.\n *\n * #### Notes\n * This class may be subclassed to create complex message types.\n */\nclass Message {\n /**\n * Construct a new message.\n *\n * @param type - The type of the message.\n */\n constructor(type) {\n this.type = type;\n }\n /**\n * Test whether the message is conflatable.\n *\n * #### Notes\n * Message conflation is an advanced topic. Most message types will\n * not make use of this feature.\n *\n * If a conflatable message is posted to a handler while another\n * conflatable message of the same `type` has already been posted\n * to the handler, the `conflate()` method of the existing message\n * will be invoked. If that method returns `true`, the new message\n * will not be enqueued. This allows messages to be compressed, so\n * that only a single instance of the message type is processed per\n * cycle, no matter how many times messages of that type are posted.\n *\n * Custom message types may reimplement this property.\n *\n * The default implementation is always `false`.\n */\n get isConflatable() {\n return false;\n }\n /**\n * Conflate this message with another message of the same `type`.\n *\n * @param other - A conflatable message of the same `type`.\n *\n * @returns `true` if the message was successfully conflated, or\n * `false` otherwise.\n *\n * #### Notes\n * Message conflation is an advanced topic. Most message types will\n * not make use of this feature.\n *\n * This method is called automatically by the message loop when the\n * given message is posted to the handler paired with this message.\n * This message will already be enqueued and conflatable, and the\n * given message will have the same `type` and also be conflatable.\n *\n * This method should merge the state of the other message into this\n * message as needed so that when this message is finally delivered\n * to the handler, it receives the most up-to-date information.\n *\n * If this method returns `true`, it signals that the other message\n * was successfully conflated and that message will not be enqueued.\n *\n * If this method returns `false`, the other message will be enqueued\n * for normal delivery.\n *\n * Custom message types may reimplement this method.\n *\n * The default implementation always returns `false`.\n */\n conflate(other) {\n return false;\n }\n}\n/**\n * A convenience message class which conflates automatically.\n *\n * #### Notes\n * Message conflation is an advanced topic. Most user code will not\n * make use of this class.\n *\n * This message class is useful for creating message instances which\n * should be conflated, but which have no state other than `type`.\n *\n * If conflation of stateful messages is required, a custom `Message`\n * subclass should be created.\n */\nclass ConflatableMessage extends Message {\n /**\n * Test whether the message is conflatable.\n *\n * #### Notes\n * This property is always `true`.\n */\n get isConflatable() {\n return true;\n }\n /**\n * Conflate this message with another message of the same `type`.\n *\n * #### Notes\n * This method always returns `true`.\n */\n conflate(other) {\n return true;\n }\n}\n/**\n * The namespace for the global singleton message loop.\n */\nvar MessageLoop;\n(function (MessageLoop) {\n /**\n * A function that cancels the pending loop task; `null` if unavailable.\n */\n let pending = null;\n /**\n * Schedules a function for invocation as soon as possible asynchronously.\n *\n * @param fn The function to invoke when called back.\n *\n * @returns An anonymous function that will unschedule invocation if possible.\n */\n const schedule = (resolved => (fn) => {\n let rejected = false;\n resolved.then(() => !rejected && fn());\n return () => {\n rejected = true;\n };\n })(Promise.resolve());\n /**\n * Send a message to a message handler to process immediately.\n *\n * @param handler - The handler which should process the message.\n *\n * @param msg - The message to deliver to the handler.\n *\n * #### Notes\n * The message will first be sent through any installed message hooks\n * for the handler. If the message passes all hooks, it will then be\n * delivered to the `processMessage` method of the handler.\n *\n * The message will not be conflated with pending posted messages.\n *\n * Exceptions in hooks and handlers will be caught and logged.\n */\n function sendMessage(handler, msg) {\n // Lookup the message hooks for the handler.\n let hooks = messageHooks.get(handler);\n // Handle the common case of no installed hooks.\n if (!hooks || hooks.length === 0) {\n invokeHandler(handler, msg);\n return;\n }\n // Invoke the message hooks starting with the newest first.\n let passed = every(retro(hooks), hook => {\n return hook ? invokeHook(hook, handler, msg) : true;\n });\n // Invoke the handler if the message passes all hooks.\n if (passed) {\n invokeHandler(handler, msg);\n }\n }\n MessageLoop.sendMessage = sendMessage;\n /**\n * Post a message to a message handler to process in the future.\n *\n * @param handler - The handler which should process the message.\n *\n * @param msg - The message to post to the handler.\n *\n * #### Notes\n * The message will be conflated with the pending posted messages for\n * the handler, if possible. If the message is not conflated, it will\n * be queued for normal delivery on the next cycle of the event loop.\n *\n * Exceptions in hooks and handlers will be caught and logged.\n */\n function postMessage(handler, msg) {\n // Handle the common case of a non-conflatable message.\n if (!msg.isConflatable) {\n enqueueMessage(handler, msg);\n return;\n }\n // Conflate the message with an existing message if possible.\n let conflated = some(messageQueue, posted => {\n if (posted.handler !== handler) {\n return false;\n }\n if (!posted.msg) {\n return false;\n }\n if (posted.msg.type !== msg.type) {\n return false;\n }\n if (!posted.msg.isConflatable) {\n return false;\n }\n return posted.msg.conflate(msg);\n });\n // Enqueue the message if it was not conflated.\n if (!conflated) {\n enqueueMessage(handler, msg);\n }\n }\n MessageLoop.postMessage = postMessage;\n /**\n * Install a message hook for a message handler.\n *\n * @param handler - The message handler of interest.\n *\n * @param hook - The message hook to install.\n *\n * #### Notes\n * A message hook is invoked before a message is delivered to the\n * handler. If the hook returns `false`, no other hooks will be\n * invoked and the message will not be delivered to the handler.\n *\n * The most recently installed message hook is executed first.\n *\n * If the hook is already installed, this is a no-op.\n */\n function installMessageHook(handler, hook) {\n // Look up the hooks for the handler.\n let hooks = messageHooks.get(handler);\n // Bail early if the hook is already installed.\n if (hooks && hooks.indexOf(hook) !== -1) {\n return;\n }\n // Add the hook to the end, so it will be the first to execute.\n if (!hooks) {\n messageHooks.set(handler, [hook]);\n }\n else {\n hooks.push(hook);\n }\n }\n MessageLoop.installMessageHook = installMessageHook;\n /**\n * Remove an installed message hook for a message handler.\n *\n * @param handler - The message handler of interest.\n *\n * @param hook - The message hook to remove.\n *\n * #### Notes\n * It is safe to call this function while the hook is executing.\n *\n * If the hook is not installed, this is a no-op.\n */\n function removeMessageHook(handler, hook) {\n // Lookup the hooks for the handler.\n let hooks = messageHooks.get(handler);\n // Bail early if the hooks do not exist.\n if (!hooks) {\n return;\n }\n // Lookup the index of the hook and bail if not found.\n let i = hooks.indexOf(hook);\n if (i === -1) {\n return;\n }\n // Clear the hook and schedule a cleanup of the array.\n hooks[i] = null;\n scheduleCleanup(hooks);\n }\n MessageLoop.removeMessageHook = removeMessageHook;\n /**\n * Clear all message data associated with a message handler.\n *\n * @param handler - The message handler of interest.\n *\n * #### Notes\n * This will clear all posted messages and hooks for the handler.\n */\n function clearData(handler) {\n // Lookup the hooks for the handler.\n let hooks = messageHooks.get(handler);\n // Clear all messsage hooks for the handler.\n if (hooks && hooks.length > 0) {\n ArrayExt.fill(hooks, null);\n scheduleCleanup(hooks);\n }\n // Clear all posted messages for the handler.\n for (const posted of messageQueue) {\n if (posted.handler === handler) {\n posted.handler = null;\n posted.msg = null;\n }\n }\n }\n MessageLoop.clearData = clearData;\n /**\n * Process the pending posted messages in the queue immediately.\n *\n * #### Notes\n * This function is useful when posted messages must be processed immediately.\n *\n * This function should normally not be needed, but it may be\n * required to work around certain browser idiosyncrasies.\n *\n * Recursing into this function is a no-op.\n */\n function flush() {\n // Bail if recursion is detected or if there is no pending task.\n if (flushGuard || pending === null) {\n return;\n }\n // Unschedule the pending loop task.\n pending();\n pending = null;\n // Run the message loop within the recursion guard.\n flushGuard = true;\n runMessageLoop();\n flushGuard = false;\n }\n MessageLoop.flush = flush;\n /**\n * Get the message loop exception handler.\n *\n * @returns The current exception handler.\n *\n * #### Notes\n * The default exception handler is `console.error`.\n */\n function getExceptionHandler() {\n return exceptionHandler;\n }\n MessageLoop.getExceptionHandler = getExceptionHandler;\n /**\n * Set the message loop exception handler.\n *\n * @param handler - The function to use as the exception handler.\n *\n * @returns The old exception handler.\n *\n * #### Notes\n * The exception handler is invoked when a message handler or a\n * message hook throws an exception.\n */\n function setExceptionHandler(handler) {\n let old = exceptionHandler;\n exceptionHandler = handler;\n return old;\n }\n MessageLoop.setExceptionHandler = setExceptionHandler;\n /**\n * The queue of posted message pairs.\n */\n const messageQueue = new LinkedList();\n /**\n * A mapping of handler to array of installed message hooks.\n */\n const messageHooks = new WeakMap();\n /**\n * A set of message hook arrays which are pending cleanup.\n */\n const dirtySet = new Set();\n /**\n * The message loop exception handler.\n */\n let exceptionHandler = (err) => {\n console.error(err);\n };\n /**\n * A guard flag to prevent flush recursion.\n */\n let flushGuard = false;\n /**\n * Invoke a message hook with the specified handler and message.\n *\n * Returns the result of the hook, or `true` if the hook throws.\n *\n * Exceptions in the hook will be caught and logged.\n */\n function invokeHook(hook, handler, msg) {\n let result = true;\n try {\n if (typeof hook === 'function') {\n result = hook(handler, msg);\n }\n else {\n result = hook.messageHook(handler, msg);\n }\n }\n catch (err) {\n exceptionHandler(err);\n }\n return result;\n }\n /**\n * Invoke a message handler with the specified message.\n *\n * Exceptions in the handler will be caught and logged.\n */\n function invokeHandler(handler, msg) {\n try {\n handler.processMessage(msg);\n }\n catch (err) {\n exceptionHandler(err);\n }\n }\n /**\n * Add a message to the end of the message queue.\n *\n * This will automatically schedule a run of the message loop.\n */\n function enqueueMessage(handler, msg) {\n // Add the posted message to the queue.\n messageQueue.addLast({ handler, msg });\n // Bail if a loop task is already pending.\n if (pending !== null) {\n return;\n }\n // Schedule a run of the message loop.\n pending = schedule(runMessageLoop);\n }\n /**\n * Run an iteration of the message loop.\n *\n * This will process all pending messages in the queue. If a message\n * is added to the queue while the message loop is running, it will\n * be processed on the next cycle of the loop.\n */\n function runMessageLoop() {\n // Clear the task so the next loop can be scheduled.\n pending = null;\n // If the message queue is empty, there is nothing else to do.\n if (messageQueue.isEmpty) {\n return;\n }\n // Add a sentinel value to the end of the queue. The queue will\n // only be processed up to the sentinel. Messages posted during\n // this cycle will execute on the next cycle.\n let sentinel = { handler: null, msg: null };\n messageQueue.addLast(sentinel);\n // Enter the message loop.\n // eslint-disable-next-line no-constant-condition\n while (true) {\n // Remove the first posted message in the queue.\n let posted = messageQueue.removeFirst();\n // If the value is the sentinel, exit the loop.\n if (posted === sentinel) {\n return;\n }\n // Dispatch the message if it has not been cleared.\n if (posted.handler && posted.msg) {\n sendMessage(posted.handler, posted.msg);\n }\n }\n }\n /**\n * Schedule a cleanup of a message hooks array.\n *\n * This will add the array to the dirty set and schedule a deferred\n * cleanup of the array contents. On cleanup, any `null` hook will\n * be removed from the array.\n */\n function scheduleCleanup(hooks) {\n if (dirtySet.size === 0) {\n schedule(cleanupDirtySet);\n }\n dirtySet.add(hooks);\n }\n /**\n * Cleanup the message hook arrays in the dirty set.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupDirtySet() {\n dirtySet.forEach(cleanupHooks);\n dirtySet.clear();\n }\n /**\n * Cleanup the dirty hooks in a message hooks array.\n *\n * This will remove any `null` hook from the array.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupHooks(hooks) {\n ArrayExt.removeAllWhere(hooks, isNull);\n }\n /**\n * Test whether a value is `null`.\n */\n function isNull(value) {\n return value === null;\n }\n})(MessageLoop || (MessageLoop = {}));\n\nexport { ConflatableMessage, Message, MessageLoop };\n//# sourceMappingURL=index.es6.js.map\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { Signal } from '@lumino/signaling';\n/**\n * A concrete implementation of IObservableMap.\n */\nexport class ObservableMap {\n /**\n * Construct a new observable map.\n */\n constructor(options = {}) {\n this._map = new Map();\n this._changed = new Signal(this);\n this._isDisposed = false;\n this._itemCmp = options.itemCmp || Private.itemCmp;\n if (options.values) {\n for (const key in options.values) {\n this._map.set(key, options.values[key]);\n }\n }\n }\n /**\n * The type of the Observable.\n */\n get type() {\n return 'Map';\n }\n /**\n * A signal emitted when the map has changed.\n */\n get changed() {\n return this._changed;\n }\n /**\n * Whether this map has been disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * The number of key-value pairs in the map.\n */\n get size() {\n return this._map.size;\n }\n /**\n * Set a key-value pair in the map\n *\n * @param key - The key to set.\n *\n * @param value - The value for the key.\n *\n * @returns the old value for the key, or undefined\n * if that did not exist.\n *\n * @throws if the new value is undefined.\n *\n * #### Notes\n * This is a no-op if the value does not change.\n */\n set(key, value) {\n const oldVal = this._map.get(key);\n if (value === undefined) {\n throw Error('Cannot set an undefined value, use remove');\n }\n // Bail if the value does not change.\n const itemCmp = this._itemCmp;\n if (oldVal !== undefined && itemCmp(oldVal, value)) {\n return oldVal;\n }\n this._map.set(key, value);\n this._changed.emit({\n type: oldVal ? 'change' : 'add',\n key: key,\n oldValue: oldVal,\n newValue: value\n });\n return oldVal;\n }\n /**\n * Get a value for a given key.\n *\n * @param key - the key.\n *\n * @returns the value for that key.\n */\n get(key) {\n return this._map.get(key);\n }\n /**\n * Check whether the map has a key.\n *\n * @param key - the key to check.\n *\n * @returns `true` if the map has the key, `false` otherwise.\n */\n has(key) {\n return this._map.has(key);\n }\n /**\n * Get a list of the keys in the map.\n *\n * @returns - a list of keys.\n */\n keys() {\n const keyList = [];\n this._map.forEach((v, k) => {\n keyList.push(k);\n });\n return keyList;\n }\n /**\n * Get a list of the values in the map.\n *\n * @returns - a list of values.\n */\n values() {\n const valList = [];\n this._map.forEach((v, k) => {\n valList.push(v);\n });\n return valList;\n }\n /**\n * Remove a key from the map\n *\n * @param key - the key to remove.\n *\n * @returns the value of the given key,\n * or undefined if that does not exist.\n *\n * #### Notes\n * This is a no-op if the value does not change.\n */\n delete(key) {\n const oldVal = this._map.get(key);\n const removed = this._map.delete(key);\n if (removed) {\n this._changed.emit({\n type: 'remove',\n key: key,\n oldValue: oldVal,\n newValue: undefined\n });\n }\n return oldVal;\n }\n /**\n * Set the ObservableMap to an empty map.\n */\n clear() {\n // Delete one by one to emit the correct signals.\n const keyList = this.keys();\n for (let i = 0; i < keyList.length; i++) {\n this.delete(keyList[i]);\n }\n }\n /**\n * Dispose of the resources held by the map.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n Signal.clearData(this);\n this._map.clear();\n }\n}\n/**\n * The namespace for module private data.\n */\nvar Private;\n(function (Private) {\n /**\n * The default strict equality item comparator.\n */\n function itemCmp(first, second) {\n return first === second;\n }\n Private.itemCmp = itemCmp;\n})(Private || (Private = {}));\n//# sourceMappingURL=observablemap.js.map","/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\nimport * as nbformat from '@jupyterlab/nbformat';\nimport { ObservableJSON } from '@jupyterlab/observables';\nimport { JSONExt } from '@lumino/coreutils';\nimport { Signal } from '@lumino/signaling';\n/**\n * The default implementation of a notebook output model.\n */\nexport class OutputModel {\n /**\n * Construct a new output model.\n */\n constructor(options) {\n this._changed = new Signal(this);\n this._raw = {};\n const { data, metadata, trusted } = Private.getBundleOptions(options);\n this._data = new ObservableJSON({ values: data });\n this._rawData = data;\n this._metadata = new ObservableJSON({ values: metadata });\n this._rawMetadata = metadata;\n this.trusted = trusted;\n // Make a copy of the data.\n const value = options.value;\n for (const key in value) {\n // Ignore data and metadata that were stripped.\n switch (key) {\n case 'data':\n case 'metadata':\n break;\n default:\n this._raw[key] = Private.extract(value, key);\n }\n }\n this.type = value.output_type;\n if (nbformat.isExecuteResult(value)) {\n this.executionCount = value.execution_count;\n }\n else {\n this.executionCount = null;\n }\n }\n /**\n * A signal emitted when the output model changes.\n */\n get changed() {\n return this._changed;\n }\n /**\n * Dispose of the resources used by the output model.\n */\n dispose() {\n this._data.dispose();\n this._metadata.dispose();\n Signal.clearData(this);\n }\n /**\n * The data associated with the model.\n */\n get data() {\n return this._rawData;\n }\n /**\n * The metadata associated with the model.\n */\n get metadata() {\n return this._rawMetadata;\n }\n /**\n * Set the data associated with the model.\n *\n * #### Notes\n * Depending on the implementation of the mime model,\n * this call may or may not have deferred effects,\n */\n setData(options) {\n if (options.data) {\n this._updateObservable(this._data, options.data);\n this._rawData = options.data;\n }\n if (options.metadata) {\n this._updateObservable(this._metadata, options.metadata);\n this._rawMetadata = options.metadata;\n }\n this._changed.emit();\n }\n /**\n * Serialize the model to JSON.\n */\n toJSON() {\n const output = {};\n for (const key in this._raw) {\n output[key] = Private.extract(this._raw, key);\n }\n switch (this.type) {\n case 'display_data':\n case 'execute_result':\n case 'update_display_data':\n output['data'] = this.data;\n output['metadata'] = this.metadata;\n break;\n default:\n break;\n }\n // Remove transient data.\n delete output['transient'];\n return output;\n }\n /**\n * Update an observable JSON object using a readonly JSON object.\n */\n _updateObservable(observable, data) {\n const oldKeys = observable.keys();\n const newKeys = Object.keys(data);\n // Handle removed keys.\n for (const key of oldKeys) {\n if (newKeys.indexOf(key) === -1) {\n observable.delete(key);\n }\n }\n // Handle changed data.\n for (const key of newKeys) {\n const oldValue = observable.get(key);\n const newValue = data[key];\n if (oldValue !== newValue) {\n observable.set(key, newValue);\n }\n }\n }\n}\n/**\n * The namespace for OutputModel statics.\n */\n(function (OutputModel) {\n /**\n * Get the data for an output.\n *\n * @param output - A kernel output message payload.\n *\n * @returns - The data for the payload.\n */\n function getData(output) {\n return Private.getData(output);\n }\n OutputModel.getData = getData;\n /**\n * Get the metadata from an output message.\n *\n * @param output - A kernel output message payload.\n *\n * @returns - The metadata for the payload.\n */\n function getMetadata(output) {\n return Private.getMetadata(output);\n }\n OutputModel.getMetadata = getMetadata;\n})(OutputModel || (OutputModel = {}));\n/**\n * The namespace for module private data.\n */\nvar Private;\n(function (Private) {\n /**\n * Get the data from a notebook output.\n */\n function getData(output) {\n let bundle = {};\n if (nbformat.isExecuteResult(output) ||\n nbformat.isDisplayData(output) ||\n nbformat.isDisplayUpdate(output)) {\n bundle = output.data;\n }\n else if (nbformat.isStream(output)) {\n if (output.name === 'stderr') {\n bundle['application/vnd.jupyter.stderr'] = output.text;\n }\n else {\n bundle['application/vnd.jupyter.stdout'] = output.text;\n }\n }\n else if (nbformat.isError(output)) {\n bundle['application/vnd.jupyter.error'] = output;\n const traceback = output.traceback.join('\\n');\n bundle['application/vnd.jupyter.stderr'] =\n traceback || `${output.ename}: ${output.evalue}`;\n }\n return convertBundle(bundle);\n }\n Private.getData = getData;\n /**\n * Get the metadata from an output message.\n */\n function getMetadata(output) {\n const value = Object.create(null);\n if (nbformat.isExecuteResult(output) || nbformat.isDisplayData(output)) {\n for (const key in output.metadata) {\n value[key] = extract(output.metadata, key);\n }\n }\n return value;\n }\n Private.getMetadata = getMetadata;\n /**\n * Get the bundle options given output model options.\n */\n function getBundleOptions(options) {\n const data = getData(options.value);\n const metadata = getMetadata(options.value);\n const trusted = !!options.trusted;\n return { data, metadata, trusted };\n }\n Private.getBundleOptions = getBundleOptions;\n /**\n * Extract a value from a JSONObject.\n */\n function extract(value, key) {\n const item = value[key];\n if (item === undefined || JSONExt.isPrimitive(item)) {\n return item;\n }\n return JSON.parse(JSON.stringify(item));\n }\n Private.extract = extract;\n /**\n * Convert a mime bundle to mime data.\n */\n function convertBundle(bundle) {\n const map = Object.create(null);\n for (const mimeType in bundle) {\n map[mimeType] = extract(bundle, mimeType);\n }\n return map;\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=outputmodel.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for array-specific algorithms.\n */\nvar ArrayExt;\n(function (ArrayExt) {\n /**\n * Find the index of the first occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.firstIndexOf(data, 'red'); // -1\n * ArrayExt.firstIndexOf(data, 'one'); // 0\n * ArrayExt.firstIndexOf(data, 'one', 1); // 4\n * ArrayExt.firstIndexOf(data, 'two', 2); // -1\n * ArrayExt.firstIndexOf(data, 'two', 2, 1); // 1\n * ```\n */\n function firstIndexOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.firstIndexOf = firstIndexOf;\n /**\n * Find the index of the last occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.lastIndexOf(data, 'red'); // -1\n * ArrayExt.lastIndexOf(data, 'one'); // 4\n * ArrayExt.lastIndexOf(data, 'one', 1); // 0\n * ArrayExt.lastIndexOf(data, 'two', 0); // -1\n * ArrayExt.lastIndexOf(data, 'two', 0, 1); // 1\n * ```\n */\n function lastIndexOf(array, value, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (start < stop) {\n span = start + 1 + (n - stop);\n }\n else {\n span = start - stop + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start - i + n) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.lastIndexOf = lastIndexOf;\n /**\n * Find the index of the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstIndex(data, isEven); // 1\n * ArrayExt.findFirstIndex(data, isEven, 4); // 5\n * ArrayExt.findFirstIndex(data, isEven, 6); // -1\n * ArrayExt.findFirstIndex(data, isEven, 6, 5); // 1\n * ```\n */\n function findFirstIndex(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findFirstIndex = findFirstIndex;\n /**\n * Find the index of the last value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastIndex(data, isEven); // 5\n * ArrayExt.findLastIndex(data, isEven, 4); // 3\n * ArrayExt.findLastIndex(data, isEven, 0); // -1\n * ArrayExt.findLastIndex(data, isEven, 0, 1); // 5\n * ```\n */\n function findLastIndex(array, fn, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let d;\n if (start < stop) {\n d = start + 1 + (n - stop);\n }\n else {\n d = start - stop + 1;\n }\n for (let i = 0; i < d; ++i) {\n let j = (start - i + n) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findLastIndex = findLastIndex;\n /**\n * Find the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstValue(data, isEven); // 2\n * ArrayExt.findFirstValue(data, isEven, 2); // 4\n * ArrayExt.findFirstValue(data, isEven, 6); // undefined\n * ArrayExt.findFirstValue(data, isEven, 6, 5); // 2\n * ```\n */\n function findFirstValue(array, fn, start = 0, stop = -1) {\n let index = findFirstIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findFirstValue = findFirstValue;\n /**\n * Find the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The last matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastValue(data, isEven); // 2\n * ArrayExt.findLastValue(data, isEven, 4); // 4\n * ArrayExt.findLastValue(data, isEven, 0); // undefined\n * ArrayExt.findLastValue(data, isEven, 0, 1); // 2\n * ```\n */\n function findLastValue(array, fn, start = -1, stop = 0) {\n let index = findLastIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findLastValue = findLastValue;\n /**\n * Find the index of the first element which compares `>=` to a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>=` to the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.lowerBound(data, 0, numberCmp); // 0\n * ArrayExt.lowerBound(data, 6, numberCmp); // 3\n * ArrayExt.lowerBound(data, 7, numberCmp); // 3\n * ArrayExt.lowerBound(data, -1, numberCmp); // 0\n * ArrayExt.lowerBound(data, 10, numberCmp); // 6\n * ```\n */\n function lowerBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) < 0) {\n begin = middle + 1;\n span -= half + 1;\n }\n else {\n span = half;\n }\n }\n return begin;\n }\n ArrayExt.lowerBound = lowerBound;\n /**\n * Find the index of the first element which compares `>` than a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>` than the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.upperBound(data, 0, numberCmp); // 1\n * ArrayExt.upperBound(data, 6, numberCmp); // 3\n * ArrayExt.upperBound(data, 7, numberCmp); // 5\n * ArrayExt.upperBound(data, -1, numberCmp); // 0\n * ArrayExt.upperBound(data, 10, numberCmp); // 6\n * ```\n */\n function upperBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) > 0) {\n span = half;\n }\n else {\n begin = middle + 1;\n span -= half + 1;\n }\n }\n return begin;\n }\n ArrayExt.upperBound = upperBound;\n /**\n * Test whether two arrays are shallowly equal.\n *\n * @param a - The first array-like object to compare.\n *\n * @param b - The second array-like object to compare.\n *\n * @param fn - The comparison function to apply to the elements. It\n * should return `true` if the elements are \"equal\". The default\n * compares elements using strict `===` equality.\n *\n * @returns Whether the two arrays are shallowly equal.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * Modifying the length of the arrays while comparing.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let d1 = [0, 3, 4, 7, 7, 9];\n * let d2 = [0, 3, 4, 7, 7, 9];\n * let d3 = [42];\n * ArrayExt.shallowEqual(d1, d2); // true\n * ArrayExt.shallowEqual(d2, d3); // false\n * ```\n */\n function shallowEqual(a, b, fn) {\n // Check for object identity first.\n if (a === b) {\n return true;\n }\n // Bail early if the lengths are different.\n if (a.length !== b.length) {\n return false;\n }\n // Compare each element for equality.\n for (let i = 0, n = a.length; i < n; ++i) {\n if (fn ? !fn(a[i], b[i]) : a[i] !== b[i]) {\n return false;\n }\n }\n // The array are shallowly equal.\n return true;\n }\n ArrayExt.shallowEqual = shallowEqual;\n /**\n * Create a slice of an array subject to an optional step.\n *\n * @param array - The array-like object of interest.\n *\n * @param options - The options for configuring the slice.\n *\n * @returns A new array with the specified values.\n *\n * @throws An exception if the slice `step` is `0`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start`, `stop`, or `step` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.slice(data); // [0, 3, 4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 2 }); // [4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 0, stop: 4 }); // [0, 3, 4, 7]\n * ArrayExt.slice(data, { step: 2 }); // [0, 4, 7]\n * ArrayExt.slice(data, { step: -1 }); // [9, 7, 7, 4, 3, 0]\n * ```\n */\n function slice(array, options = {}) {\n // Extract the options.\n let { start, stop, step } = options;\n // Set up the `step` value.\n if (step === undefined) {\n step = 1;\n }\n // Validate the step size.\n if (step === 0) {\n throw new Error('Slice `step` cannot be zero.');\n }\n // Look up the length of the array.\n let n = array.length;\n // Set up the `start` value.\n if (start === undefined) {\n start = step < 0 ? n - 1 : 0;\n }\n else if (start < 0) {\n start = Math.max(start + n, step < 0 ? -1 : 0);\n }\n else if (start >= n) {\n start = step < 0 ? n - 1 : n;\n }\n // Set up the `stop` value.\n if (stop === undefined) {\n stop = step < 0 ? -1 : n;\n }\n else if (stop < 0) {\n stop = Math.max(stop + n, step < 0 ? -1 : 0);\n }\n else if (stop >= n) {\n stop = step < 0 ? n - 1 : n;\n }\n // Compute the slice length.\n let length;\n if ((step < 0 && stop >= start) || (step > 0 && start >= stop)) {\n length = 0;\n }\n else if (step < 0) {\n length = Math.floor((stop - start + 1) / step + 1);\n }\n else {\n length = Math.floor((stop - start - 1) / step + 1);\n }\n // Compute the sliced result.\n let result = [];\n for (let i = 0; i < length; ++i) {\n result[i] = array[start + i * step];\n }\n // Return the result.\n return result;\n }\n ArrayExt.slice = slice;\n /**\n * Move an element in an array from one index to another.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param fromIndex - The index of the element to move. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param toIndex - The target index of the element. Negative\n * values are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `fromIndex` or `toIndex` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.move(data, 1, 2); // [0, 2, 1, 3, 4]\n * ArrayExt.move(data, 4, 2); // [0, 2, 4, 1, 3]\n * ```\n */\n function move(array, fromIndex, toIndex) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (fromIndex < 0) {\n fromIndex = Math.max(0, fromIndex + n);\n }\n else {\n fromIndex = Math.min(fromIndex, n - 1);\n }\n if (toIndex < 0) {\n toIndex = Math.max(0, toIndex + n);\n }\n else {\n toIndex = Math.min(toIndex, n - 1);\n }\n if (fromIndex === toIndex) {\n return;\n }\n let value = array[fromIndex];\n let d = fromIndex < toIndex ? 1 : -1;\n for (let i = fromIndex; i !== toIndex; i += d) {\n array[i] = array[i + d];\n }\n array[toIndex] = value;\n }\n ArrayExt.move = move;\n /**\n * Reverse an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param start - The index of the first element in the range to be\n * reversed, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * reversed, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` index which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.reverse(data, 1, 3); // [0, 3, 2, 1, 4]\n * ArrayExt.reverse(data, 3); // [0, 3, 2, 4, 1]\n * ArrayExt.reverse(data); // [1, 4, 2, 3, 0]\n * ```\n */\n function reverse(array, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n while (start < stop) {\n let a = array[start];\n let b = array[stop];\n array[start++] = b;\n array[stop--] = a;\n }\n }\n ArrayExt.reverse = reverse;\n /**\n * Rotate the elements of an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param delta - The amount of rotation to apply to the elements. A\n * positive value will rotate the elements to the left. A negative\n * value will rotate the elements to the right.\n *\n * @param start - The index of the first element in the range to be\n * rotated, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * rotated, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `delta`, `start`, or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.rotate(data, 2); // [2, 3, 4, 0, 1]\n * ArrayExt.rotate(data, -2); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 10); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 9); // [4, 0, 1, 2, 3]\n * ArrayExt.rotate(data, 2, 1, 3); // [4, 2, 0, 1, 3]\n * ```\n */\n function rotate(array, delta, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n if (start >= stop) {\n return;\n }\n let length = stop - start + 1;\n if (delta > 0) {\n delta = delta % length;\n }\n else if (delta < 0) {\n delta = ((delta % length) + length) % length;\n }\n if (delta === 0) {\n return;\n }\n let pivot = start + delta;\n reverse(array, start, pivot - 1);\n reverse(array, pivot, stop);\n reverse(array, start, stop);\n }\n ArrayExt.rotate = rotate;\n /**\n * Fill an array with a static value.\n *\n * @param array - The mutable array-like object to fill.\n *\n * @param value - The static value to use to fill the array.\n *\n * @param start - The index of the first element in the range to be\n * filled, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * filled, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Notes\n * If `stop < start` the fill will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four'];\n * ArrayExt.fill(data, 'r'); // ['r', 'r', 'r', 'r']\n * ArrayExt.fill(data, 'g', 1); // ['r', 'g', 'g', 'g']\n * ArrayExt.fill(data, 'b', 2, 3); // ['r', 'g', 'b', 'b']\n * ArrayExt.fill(data, 'z', 3, 1); // ['z', 'z', 'b', 'z']\n * ```\n */\n function fill(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n array[(start + i) % n] = value;\n }\n }\n ArrayExt.fill = fill;\n /**\n * Insert a value into an array at a specific index.\n *\n * @param array - The array of interest.\n *\n * @param index - The index at which to insert the value. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param value - The value to set at the specified index.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2];\n * ArrayExt.insert(data, 0, -1); // [-1, 0, 1, 2]\n * ArrayExt.insert(data, 2, 12); // [-1, 0, 12, 1, 2]\n * ArrayExt.insert(data, -1, 7); // [-1, 0, 12, 1, 7, 2]\n * ArrayExt.insert(data, 6, 19); // [-1, 0, 12, 1, 7, 2, 19]\n * ```\n */\n function insert(array, index, value) {\n let n = array.length;\n if (index < 0) {\n index = Math.max(0, index + n);\n }\n else {\n index = Math.min(index, n);\n }\n for (let i = n; i > index; --i) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n }\n ArrayExt.insert = insert;\n /**\n * Remove and return a value at a specific index in an array.\n *\n * @param array - The array of interest.\n *\n * @param index - The index of the value to remove. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The value at the specified index, or `undefined` if the\n * index is out of range.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeAt(data, 2); // 23\n * ArrayExt.removeAt(data, -2); // 12\n * ArrayExt.removeAt(data, 10); // undefined;\n * ```\n */\n function removeAt(array, index) {\n let n = array.length;\n if (index < 0) {\n index += n;\n }\n if (index < 0 || index >= n) {\n return undefined;\n }\n let value = array[index];\n for (let i = index + 1; i < n; ++i) {\n array[i - 1] = array[i];\n }\n array.length = n - 1;\n return value;\n }\n ArrayExt.removeAt = removeAt;\n /**\n * Remove the first occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstOf(data, 12); // 1\n * ArrayExt.removeFirstOf(data, 17); // -1\n * ArrayExt.removeFirstOf(data, 39, 3); // -1\n * ArrayExt.removeFirstOf(data, 39, 3, 2); // 2\n * ```\n */\n function removeFirstOf(array, value, start = 0, stop = -1) {\n let index = firstIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeFirstOf = removeFirstOf;\n /**\n * Remove the last occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastOf(data, 12); // 5\n * ArrayExt.removeLastOf(data, 17); // -1\n * ArrayExt.removeLastOf(data, 39, 2); // -1\n * ArrayExt.removeLastOf(data, 39, 2, 3); // 3\n * ```\n */\n function removeLastOf(array, value, start = -1, stop = 0) {\n let index = lastIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeLastOf = removeLastOf;\n /**\n * Remove all occurrences of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [14, 12, 23, 39, 14, 12, 19, 14];\n * ArrayExt.removeAllOf(data, 12); // 2\n * ArrayExt.removeAllOf(data, 17); // 0\n * ArrayExt.removeAllOf(data, 14, 1, 4); // 1\n * ```\n */\n function removeAllOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && array[i] === value) {\n count++;\n }\n else if (stop < start &&\n (i <= stop || i >= start) &&\n array[i] === value) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllOf = removeAllOf;\n /**\n * Remove the first occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstWhere(data, isEven); // { index: 0, value: 0 }\n * ArrayExt.removeFirstWhere(data, isEven, 2); // { index: 3, value: 14 }\n * ArrayExt.removeFirstWhere(data, isEven, 4); // { index: -1, value: undefined }\n * ```\n */\n function removeFirstWhere(array, fn, start = 0, stop = -1) {\n let value;\n let index = findFirstIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeFirstWhere = removeFirstWhere;\n /**\n * Remove the last occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastWhere(data, isEven); // { index: 5, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2); // { index: 1, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2, 1); // { index: -1, value: undefined }\n * ```\n */\n function removeLastWhere(array, fn, start = -1, stop = 0) {\n let value;\n let index = findLastIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeLastWhere = removeLastWhere;\n /**\n * Remove all occurrences of values which match a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * function isNegative(value: number): boolean {\n * return value < 0;\n * }\n *\n * let data = [0, 12, -13, -9, 23, 39, 14, -15, 12, 75];\n * ArrayExt.removeAllWhere(data, isEven); // 4\n * ArrayExt.removeAllWhere(data, isNegative, 0, 3); // 2\n * ```\n */\n function removeAllWhere(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && fn(array[i], i)) {\n count++;\n }\n else if (stop < start && (i <= stop || i >= start) && fn(array[i], i)) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllWhere = removeAllWhere;\n})(ArrayExt || (ArrayExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Chain together several iterables.\n *\n * @deprecated\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields the values of the iterables\n * in the order in which they are supplied.\n *\n * #### Example\n * ```typescript\n * import { chain } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = chain(data1, data2);\n *\n * Array.from(stream); // [1, 2, 3, 4, 5, 6]\n * ```\n */\nfunction* chain(...objects) {\n for (const object of objects) {\n yield* object;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an empty iterator.\n *\n * @returns A new iterator which yields nothing.\n *\n * #### Example\n * ```typescript\n * import { empty } from '@lumino/algorithm';\n *\n * let stream = empty();\n *\n * Array.from(stream); // []\n * ```\n */\n// eslint-disable-next-line require-yield\nfunction* empty() {\n return;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Enumerate an iterable object.\n *\n * @param object - The iterable object of interest.\n *\n * @param start - The starting enum value. The default is `0`.\n *\n * @returns An iterator which yields the enumerated values.\n *\n * #### Example\n * ```typescript\n * import { enumerate } from '@lumino/algorithm';\n *\n * let data = ['foo', 'bar', 'baz'];\n *\n * let stream = enumerate(data, 1);\n *\n * Array.from(stream); // [[1, 'foo'], [2, 'bar'], [3, 'baz']]\n * ```\n */\nfunction* enumerate(object, start = 0) {\n for (const value of object) {\n yield [start++, value];\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Filter an iterable for values which pass a test.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns An iterator which yields the values which pass the test.\n *\n * #### Example\n * ```typescript\n * import { filter } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = filter(data, value => value % 2 === 0);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* filter(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Find the first value in an iterable which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { find } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * find(data, isCat).name; // 'fluffy'\n * ```\n */\nfunction find(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return value;\n }\n }\n return undefined;\n}\n/**\n * Find the index of the first value which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { findIndex } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * findIndex(data, isCat); // 1\n * ```\n */\nfunction findIndex(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return index - 1;\n }\n }\n return -1;\n}\n/**\n * Find the minimum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The minimum value in the iterable. If multiple values are\n * equivalent to the minimum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { min } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * min([7, 4, 0, 3, 9, 4], numberCmp); // 0\n * ```\n */\nfunction min(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) < 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the maximum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The maximum value in the iterable. If multiple values are\n * equivalent to the maximum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { max } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * max([7, 4, 0, 3, 9, 4], numberCmp); // 9\n * ```\n */\nfunction max(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) > 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the minimum and maximum values in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns A 2-tuple of the `[min, max]` values in the iterable. If\n * multiple values are equivalent, the left-most values are returned.\n * If the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { minmax } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * minmax([7, 4, 0, 3, 9, 4], numberCmp); // [0, 9]\n * ```\n */\nfunction minmax(object, fn) {\n let empty = true;\n let vmin;\n let vmax;\n for (const value of object) {\n if (empty) {\n vmin = value;\n vmax = value;\n empty = false;\n }\n else if (fn(value, vmin) < 0) {\n vmin = value;\n }\n else if (fn(value, vmax) > 0) {\n vmax = value;\n }\n }\n return empty ? undefined : [vmin, vmax];\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an array from an iterable of values.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new array of values from the given object.\n *\n * #### Example\n * ```typescript\n * import { toArray } from '@lumino/algorithm';\n *\n * let stream = [1, 2, 3, 4, 5, 6][Symbol.iterator]();\n *\n * toArray(stream); // [1, 2, 3, 4, 5, 6];\n * ```\n */\nfunction toArray(object) {\n return Array.from(object);\n}\n/**\n * Create an object from an iterable of key/value pairs.\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new object mapping keys to values.\n *\n * #### Example\n * ```typescript\n * import { toObject } from '@lumino/algorithm';\n *\n * let data: [string, number][] = [['one', 1], ['two', 2], ['three', 3]];\n *\n * toObject(data); // { one: 1, two: 2, three: 3 }\n * ```\n */\nfunction toObject(object) {\n const result = {};\n for (const [key, value] of object) {\n result[key] = value;\n }\n return result;\n}\n/**\n * Invoke a function for each value in an iterable.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The callback function to invoke for each value.\n *\n * #### Notes\n * Iteration can be terminated early by returning `false` from the\n * callback function.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each } from '@lumino/algorithm';\n *\n * let data = [5, 7, 0, -2, 9];\n *\n * each(data, value => { console.log(value); });\n * ```\n */\nfunction each(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return;\n }\n }\n}\n/**\n * Test whether all values in an iterable satisfy a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if all values pass the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `false` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { every } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * every(data, value => value % 2 === 0); // false\n * every(data, value => value % 2 === 1); // true\n * ```\n */\nfunction every(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Test whether any value in an iterable satisfies a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if any value passes the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `true` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { some } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * some(data, value => value === 7); // true\n * some(data, value => value === 3); // false\n * ```\n */\nfunction some(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return true;\n }\n }\n return false;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Transform the values of an iterable with a mapping function.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The mapping function to invoke for each value.\n *\n * @returns An iterator which yields the transformed values.\n *\n * #### Example\n * ```typescript\n * import { map } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3];\n *\n * let stream = map(data, value => value * 2);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* map(object, fn) {\n let index = 0;\n for (const value of object) {\n yield fn(value, index++);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator of evenly spaced values.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns An iterator which produces evenly spaced values.\n *\n * #### Notes\n * In the single argument form of `range(stop)`, `start` defaults to\n * `0` and `step` defaults to `1`.\n *\n * In the two argument form of `range(start, stop)`, `step` defaults\n * to `1`.\n *\n * #### Example\n * ```typescript\n * import { range } from '@lumino/algorithm';\n *\n * let stream = range(2, 4);\n *\n * Array.from(stream); // [2, 3]\n * ```\n */\nfunction* range(start, stop, step) {\n if (stop === undefined) {\n stop = start;\n start = 0;\n step = 1;\n }\n else if (step === undefined) {\n step = 1;\n }\n const length = Private.rangeLength(start, stop, step);\n for (let index = 0; index < length; index++) {\n yield start + step * index;\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Compute the effective length of a range.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns The number of steps need to traverse the range.\n */\n function rangeLength(start, stop, step) {\n if (step === 0) {\n return Infinity;\n }\n if (start > stop && step > 0) {\n return 0;\n }\n if (start < stop && step < 0) {\n return 0;\n }\n return Math.ceil((stop - start) / step);\n }\n Private.rangeLength = rangeLength;\n})(Private || (Private = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nfunction reduce(object, fn, initial) {\n // Setup the iterator and fetch the first value.\n const it = object[Symbol.iterator]();\n let index = 0;\n let first = it.next();\n // An empty iterator and no initial value is an error.\n if (first.done && initial === undefined) {\n throw new TypeError('Reduce of empty iterable with no initial value.');\n }\n // If the iterator is empty, return the initial value.\n if (first.done) {\n return initial;\n }\n // If the iterator has a single item and no initial value, the\n // reducer is not invoked and the first item is the return value.\n let second = it.next();\n if (second.done && initial === undefined) {\n return first.value;\n }\n // If iterator has a single item and an initial value is provided,\n // the reducer is invoked and that result is the return value.\n if (second.done) {\n return fn(initial, first.value, index++);\n }\n // Setup the initial accumlated value.\n let accumulator;\n if (initial === undefined) {\n accumulator = fn(first.value, second.value, index++);\n }\n else {\n accumulator = fn(fn(initial, first.value, index++), second.value, index++);\n }\n // Iterate the rest of the values, updating the accumulator.\n let next;\n while (!(next = it.next()).done) {\n accumulator = fn(accumulator, next.value, index++);\n }\n // Return the final accumulated value.\n return accumulator;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator which repeats a value a number of times.\n *\n * @deprecated\n *\n * @param value - The value to repeat.\n *\n * @param count - The number of times to repeat the value.\n *\n * @returns A new iterator which repeats the specified value.\n *\n * #### Example\n * ```typescript\n * import { repeat } from '@lumino/algorithm';\n *\n * let stream = repeat(7, 3);\n *\n * Array.from(stream); // [7, 7, 7]\n * ```\n */\nfunction* repeat(value, count) {\n while (0 < count--) {\n yield value;\n }\n}\n/**\n * Create an iterator which yields a value a single time.\n *\n * @deprecated\n *\n * @param value - The value to wrap in an iterator.\n *\n * @returns A new iterator which yields the value a single time.\n *\n * #### Example\n * ```typescript\n * import { once } from '@lumino/algorithm';\n *\n * let stream = once(7);\n *\n * Array.from(stream); // [7]\n * ```\n */\nfunction* once(value) {\n yield value;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator for a retroable object.\n *\n * @param object - The retroable or array-like object of interest.\n *\n * @returns An iterator which traverses the object's values in reverse.\n *\n * #### Example\n * ```typescript\n * import { retro } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = retro(data);\n *\n * Array.from(stream); // [6, 5, 4, 3, 2, 1]\n * ```\n */\nfunction* retro(object) {\n if (typeof object.retro === 'function') {\n yield* object.retro();\n }\n else {\n for (let index = object.length - 1; index > -1; index--) {\n yield object[index];\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Topologically sort an iterable of edges.\n *\n * @param edges - The iterable object of edges to sort.\n * An edge is represented as a 2-tuple of `[fromNode, toNode]`.\n *\n * @returns The topologically sorted array of nodes.\n *\n * #### Notes\n * If a cycle is present in the graph, the cycle will be ignored and\n * the return value will be only approximately sorted.\n *\n * #### Example\n * ```typescript\n * import { topologicSort } from '@lumino/algorithm';\n *\n * let data = [\n * ['d', 'e'],\n * ['c', 'd'],\n * ['a', 'b'],\n * ['b', 'c']\n * ];\n *\n * topologicSort(data); // ['a', 'b', 'c', 'd', 'e']\n * ```\n */\nfunction topologicSort(edges) {\n // Setup the shared sorting state.\n let sorted = [];\n let visited = new Set();\n let graph = new Map();\n // Add the edges to the graph.\n for (const edge of edges) {\n addEdge(edge);\n }\n // Visit each node in the graph.\n for (const [k] of graph) {\n visit(k);\n }\n // Return the sorted results.\n return sorted;\n // Add an edge to the graph.\n function addEdge(edge) {\n let [fromNode, toNode] = edge;\n let children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n }\n else {\n graph.set(toNode, [fromNode]);\n }\n }\n // Recursively visit the node.\n function visit(node) {\n if (visited.has(node)) {\n return;\n }\n visited.add(node);\n let children = graph.get(node);\n if (children) {\n for (const child of children) {\n visit(child);\n }\n }\n sorted.push(node);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate over an iterable using a stepped increment.\n *\n * @param object - The iterable object of interest.\n *\n * @param step - The distance to step on each iteration. A value\n * of less than `1` will behave the same as a value of `1`.\n *\n * @returns An iterator which traverses the iterable step-wise.\n *\n * #### Example\n * ```typescript\n * import { stride } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = stride(data, 2);\n *\n * Array.from(stream); // [1, 3, 5];\n * ```\n */\nfunction* stride(object, step) {\n let count = 0;\n for (const value of object) {\n if (0 === count++ % step) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for string-specific algorithms.\n */\nvar StringExt;\n(function (StringExt) {\n /**\n * Find the indices of characters in a source text.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The matched indices, or `null` if there is no match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * In order for there to be a match, all of the characters in `query`\n * **must** appear in `source` in the order given by `query`.\n *\n * Characters are matched using strict `===` equality.\n */\n function findIndices(source, query, start = 0) {\n let indices = new Array(query.length);\n for (let i = 0, j = start, n = query.length; i < n; ++i, ++j) {\n j = source.indexOf(query[i], j);\n if (j === -1) {\n return null;\n }\n indices[i] = j;\n }\n return indices;\n }\n StringExt.findIndices = findIndices;\n /**\n * A string matcher which uses a sum-of-squares algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-squares approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The index of each\n * matching character is squared and added to the score. This means\n * that early and consecutive character matches are preferred, while\n * late matches are heavily penalized.\n */\n function matchSumOfSquares(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i] - start;\n score += j * j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfSquares = matchSumOfSquares;\n /**\n * A string matcher which uses a sum-of-deltas algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-deltas approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The delta between\n * the indices are summed to create the score. This means that groups\n * of matched characters are preferred, while fragmented matches are\n * penalized.\n */\n function matchSumOfDeltas(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n let last = start - 1;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i];\n score += j - last - 1;\n last = j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfDeltas = matchSumOfDeltas;\n /**\n * Highlight the matched characters of a source text.\n *\n * @param source - The text which should be highlighted.\n *\n * @param indices - The indices of the matched characters. They must\n * appear in increasing order and must be in bounds of the source.\n *\n * @param fn - The function to apply to the matched chunks.\n *\n * @returns An array of unmatched and highlighted chunks.\n */\n function highlight(source, indices, fn) {\n // Set up the result array.\n let result = [];\n // Set up the counter variables.\n let k = 0;\n let last = 0;\n let n = indices.length;\n // Iterator over each index.\n while (k < n) {\n // Set up the chunk indices.\n let i = indices[k];\n let j = indices[k];\n // Advance the right chunk index until it's non-contiguous.\n while (++k < n && indices[k] === j + 1) {\n j++;\n }\n // Extract the unmatched text.\n if (last < i) {\n result.push(source.slice(last, i));\n }\n // Extract and highlight the matched text.\n if (i < j + 1) {\n result.push(fn(source.slice(i, j + 1)));\n }\n // Update the last visited index.\n last = j + 1;\n }\n // Extract any remaining unmatched text.\n if (last < source.length) {\n result.push(source.slice(last));\n }\n // Return the highlighted result.\n return result;\n }\n StringExt.highlight = highlight;\n /**\n * A 3-way string comparison function.\n *\n * @param a - The first string of interest.\n *\n * @param b - The second string of interest.\n *\n * @returns `-1` if `a < b`, else `1` if `a > b`, else `0`.\n */\n function cmp(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n }\n StringExt.cmp = cmp;\n})(StringExt || (StringExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Take a fixed number of items from an iterable.\n *\n * @param object - The iterable object of interest.\n *\n * @param count - The number of items to take from the iterable.\n *\n * @returns An iterator which yields the specified number of items\n * from the source iterable.\n *\n * #### Notes\n * The returned iterator will exhaust early if the source iterable\n * contains an insufficient number of items.\n *\n * #### Example\n * ```typescript\n * import { take } from '@lumino/algorithm';\n *\n * let stream = take([5, 4, 3, 2, 1, 0, -1], 3);\n *\n * Array.from(stream); // [5, 4, 3]\n * ```\n */\nfunction* take(object, count) {\n if (count < 1) {\n return;\n }\n const it = object[Symbol.iterator]();\n let item;\n while (0 < count-- && !(item = it.next()).done) {\n yield item.value;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate several iterables in lockstep.\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields successive tuples of values where\n * each value is taken in turn from the provided iterables. It will\n * be as long as the shortest provided iterable.\n *\n * #### Example\n * ```typescript\n * import { zip } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = zip(data1, data2);\n *\n * Array.from(stream); // [[1, 4], [2, 5], [3, 6]]\n * ```\n */\nfunction* zip(...objects) {\n const iters = objects.map(obj => obj[Symbol.iterator]());\n let tuple = iters.map(it => it.next());\n for (; every(tuple, item => !item.done); tuple = iters.map(it => it.next())) {\n yield tuple.map(item => item.value);\n }\n}\n\nexport { ArrayExt, StringExt, chain, each, empty, enumerate, every, filter, find, findIndex, map, max, min, minmax, once, range, reduce, repeat, retro, some, stride, take, toArray, toObject, topologicSort, zip };\n//# sourceMappingURL=index.es6.js.map\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport * as nbformat from '@jupyterlab/nbformat';\nimport { ObservableList } from '@jupyterlab/observables';\nimport { OutputModel } from '@jupyterlab/rendermime';\nimport { map } from '@lumino/algorithm';\nimport { JSONExt } from '@lumino/coreutils';\nimport { Signal } from '@lumino/signaling';\n/**\n * The default implementation of the IOutputAreaModel.\n */\nexport class OutputAreaModel {\n /**\n * Construct a new observable outputs instance.\n */\n constructor(options = {}) {\n /**\n * A flag that is set when we want to clear the output area\n * *after* the next addition to it.\n */\n this.clearNext = false;\n this._lastStream = '';\n this._trusted = false;\n this._isDisposed = false;\n this._stateChanged = new Signal(this);\n this._changed = new Signal(this);\n this._trusted = !!options.trusted;\n this.contentFactory =\n options.contentFactory || OutputAreaModel.defaultContentFactory;\n this.list = new ObservableList();\n if (options.values) {\n for (const value of options.values) {\n const index = this._add(value) - 1;\n const item = this.list.get(index);\n item.changed.connect(this._onGenericChange, this);\n }\n }\n this.list.changed.connect(this._onListChanged, this);\n }\n /**\n * A signal emitted when an item changes.\n */\n get stateChanged() {\n return this._stateChanged;\n }\n /**\n * A signal emitted when the list of items changes.\n */\n get changed() {\n return this._changed;\n }\n /**\n * Get the length of the items in the model.\n */\n get length() {\n return this.list ? this.list.length : 0;\n }\n /**\n * Get whether the model is trusted.\n */\n get trusted() {\n return this._trusted;\n }\n /**\n * Set whether the model is trusted.\n *\n * #### Notes\n * Changing the value will cause all of the models to re-set.\n */\n set trusted(value) {\n if (value === this._trusted) {\n return;\n }\n const trusted = (this._trusted = value);\n for (let i = 0; i < this.list.length; i++) {\n const oldItem = this.list.get(i);\n const value = oldItem.toJSON();\n const item = this._createItem({ value, trusted });\n this.list.set(i, item);\n oldItem.dispose();\n }\n }\n /**\n * Test whether the model is disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * Dispose of the resources used by the model.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n this.list.dispose();\n Signal.clearData(this);\n }\n /**\n * Get an item at the specified index.\n */\n get(index) {\n return this.list.get(index);\n }\n /**\n * Set the value at the specified index.\n */\n set(index, value) {\n value = JSONExt.deepCopy(value);\n // Normalize stream data.\n Private.normalize(value);\n const item = this._createItem({ value, trusted: this._trusted });\n this.list.set(index, item);\n }\n /**\n * Add an output, which may be combined with previous output.\n *\n * @returns The total number of outputs.\n *\n * #### Notes\n * The output bundle is copied.\n * Contiguous stream outputs of the same `name` are combined.\n */\n add(output) {\n // If we received a delayed clear message, then clear now.\n if (this.clearNext) {\n this.clear();\n this.clearNext = false;\n }\n return this._add(output);\n }\n /**\n * Clear all of the output.\n *\n * @param wait Delay clearing the output until the next message is added.\n */\n clear(wait = false) {\n this._lastStream = '';\n if (wait) {\n this.clearNext = true;\n return;\n }\n for (const item of this.list) {\n item.dispose();\n }\n this.list.clear();\n }\n /**\n * Deserialize the model from JSON.\n *\n * #### Notes\n * This will clear any existing data.\n */\n fromJSON(values) {\n this.clear();\n for (const value of values) {\n this._add(value);\n }\n }\n /**\n * Serialize the model to JSON.\n */\n toJSON() {\n return Array.from(map(this.list, (output) => output.toJSON()));\n }\n /**\n * Add a copy of the item to the list.\n *\n * @returns The list length\n */\n _add(value) {\n const trusted = this._trusted;\n value = JSONExt.deepCopy(value);\n // Normalize the value.\n Private.normalize(value);\n // Consolidate outputs if they are stream outputs of the same kind.\n if (nbformat.isStream(value) &&\n this._lastStream &&\n value.name === this._lastName &&\n this.shouldCombine({\n value,\n lastModel: this.list.get(this.length - 1)\n })) {\n // In order to get a list change event, we add the previous\n // text to the current item and replace the previous item.\n // This also replaces the metadata of the last item.\n this._lastStream += value.text;\n this._lastStream = Private.removeOverwrittenChars(this._lastStream);\n value.text = this._lastStream;\n const item = this._createItem({ value, trusted });\n const index = this.length - 1;\n const prev = this.list.get(index);\n this.list.set(index, item);\n prev.dispose();\n return this.length;\n }\n if (nbformat.isStream(value)) {\n value.text = Private.removeOverwrittenChars(value.text);\n }\n // Create the new item.\n const item = this._createItem({ value, trusted });\n // Update the stream information.\n if (nbformat.isStream(value)) {\n this._lastStream = value.text;\n this._lastName = value.name;\n }\n else {\n this._lastStream = '';\n }\n // Add the item to our list and return the new length.\n return this.list.push(item);\n }\n /**\n * Whether a new value should be consolidated with the previous output.\n *\n * This will only be called if the minimal criteria of both being stream\n * messages of the same type.\n */\n shouldCombine(options) {\n return true;\n }\n /**\n * Create an output item and hook up its signals.\n */\n _createItem(options) {\n const factory = this.contentFactory;\n const item = factory.createOutputModel(options);\n return item;\n }\n /**\n * Handle a change to the list.\n */\n _onListChanged(sender, args) {\n switch (args.type) {\n case 'add':\n args.newValues.forEach(item => {\n item.changed.connect(this._onGenericChange, this);\n });\n break;\n case 'remove':\n args.oldValues.forEach(item => {\n item.changed.disconnect(this._onGenericChange, this);\n });\n break;\n case 'set':\n args.newValues.forEach(item => {\n item.changed.connect(this._onGenericChange, this);\n });\n args.oldValues.forEach(item => {\n item.changed.disconnect(this._onGenericChange, this);\n });\n break;\n }\n this._changed.emit(args);\n }\n /**\n * Handle a change to an item.\n */\n _onGenericChange(itemModel) {\n let idx;\n let item = null;\n for (idx = 0; idx < this.list.length; idx++) {\n item = this.list.get(idx);\n if (item === itemModel) {\n break;\n }\n }\n if (item != null) {\n this._stateChanged.emit(idx);\n this._changed.emit({\n type: 'set',\n newIndex: idx,\n oldIndex: idx,\n oldValues: [item],\n newValues: [item]\n });\n }\n }\n}\n/**\n * The namespace for OutputAreaModel class statics.\n */\n(function (OutputAreaModel) {\n /**\n * The default implementation of a `IModelOutputFactory`.\n */\n class ContentFactory {\n /**\n * Create an output model.\n */\n createOutputModel(options) {\n return new OutputModel(options);\n }\n }\n OutputAreaModel.ContentFactory = ContentFactory;\n /**\n * The default output model factory.\n */\n OutputAreaModel.defaultContentFactory = new ContentFactory();\n})(OutputAreaModel || (OutputAreaModel = {}));\n/**\n * A namespace for module-private functionality.\n */\nvar Private;\n(function (Private) {\n /**\n * Normalize an output.\n */\n function normalize(value) {\n if (nbformat.isStream(value)) {\n if (Array.isArray(value.text)) {\n value.text = value.text.join('\\n');\n }\n }\n }\n Private.normalize = normalize;\n /**\n * Remove characters that are overridden by backspace characters.\n */\n function fixBackspace(txt) {\n let tmp = txt;\n do {\n txt = tmp;\n // Cancel out anything-but-newline followed by backspace\n tmp = txt.replace(/[^\\n]\\x08/gm, ''); // eslint-disable-line no-control-regex\n } while (tmp.length < txt.length);\n return txt;\n }\n /**\n * Remove chunks that should be overridden by the effect of\n * carriage return characters.\n */\n function fixCarriageReturn(txt) {\n txt = txt.replace(/\\r+\\n/gm, '\\n'); // \\r followed by \\n --> newline\n while (txt.search(/\\r[^$]/g) > -1) {\n const base = txt.match(/^(.*)\\r+/m)[1];\n let insert = txt.match(/\\r+(.*)$/m)[1];\n insert = insert + base.slice(insert.length, base.length);\n txt = txt.replace(/\\r+.*$/m, '\\r').replace(/^.*\\r/m, insert);\n }\n return txt;\n }\n /*\n * Remove characters overridden by backspaces and carriage returns\n */\n function removeOverwrittenChars(text) {\n return fixCarriageReturn(fixBackspace(text));\n }\n Private.removeOverwrittenChars = removeOverwrittenChars;\n})(Private || (Private = {}));\n//# sourceMappingURL=model.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { JSONExt } from '@lumino/coreutils';\nimport { Message } from '@lumino/messaging';\nimport { ObservableMap } from './observablemap';\n/**\n * A concrete Observable map for JSON data.\n */\nexport class ObservableJSON extends ObservableMap {\n /**\n * Construct a new observable JSON object.\n */\n constructor(options = {}) {\n super({\n itemCmp: JSONExt.deepEqual,\n values: options.values\n });\n }\n /**\n * Serialize the model to JSON.\n */\n toJSON() {\n const out = Object.create(null);\n const keys = this.keys();\n for (const key of keys) {\n const value = this.get(key);\n if (value !== undefined) {\n out[key] = JSONExt.deepCopy(value);\n }\n }\n return out;\n }\n}\n/**\n * The namespace for ObservableJSON static data.\n */\n(function (ObservableJSON) {\n /**\n * An observable JSON change message.\n */\n class ChangeMessage extends Message {\n /**\n * Create a new metadata changed message.\n */\n constructor(type, args) {\n super(type);\n this.args = args;\n }\n }\n ObservableJSON.ChangeMessage = ChangeMessage;\n})(ObservableJSON || (ObservableJSON = {}));\n//# sourceMappingURL=observablejson.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { RestorablePool } from '@jupyterlab/statedb';\nimport { Signal } from '@lumino/signaling';\nimport { FocusTracker } from '@lumino/widgets';\n/**\n * A class that keeps track of widget instances on an Application shell.\n *\n * @typeparam T - The type of widget being tracked. Defaults to `Widget`.\n *\n * #### Notes\n * The API surface area of this concrete implementation is substantially larger\n * than the widget tracker interface it implements. The interface is intended\n * for export by JupyterLab plugins that create widgets and have clients who may\n * wish to keep track of newly created widgets. This class, however, can be used\n * internally by plugins to restore state as well.\n */\nexport class WidgetTracker {\n /**\n * Create a new widget tracker.\n *\n * @param options - The instantiation options for a widget tracker.\n */\n constructor(options) {\n this._currentChanged = new Signal(this);\n this._deferred = null;\n this._isDisposed = false;\n this._widgetAdded = new Signal(this);\n this._widgetUpdated = new Signal(this);\n const focus = (this._focusTracker = new FocusTracker());\n const pool = (this._pool = new RestorablePool(options));\n this.namespace = options.namespace;\n focus.currentChanged.connect((_, current) => {\n if (current.newValue !== this.currentWidget) {\n pool.current = current.newValue;\n }\n }, this);\n pool.added.connect((_, widget) => {\n this._widgetAdded.emit(widget);\n }, this);\n pool.currentChanged.connect((_, widget) => {\n // If the pool's current reference is `null` but the focus tracker has a\n // current widget, update the pool to match the focus tracker.\n if (widget === null && focus.currentWidget) {\n pool.current = focus.currentWidget;\n return;\n }\n this.onCurrentChanged(widget);\n this._currentChanged.emit(widget);\n }, this);\n pool.updated.connect((_, widget) => {\n this._widgetUpdated.emit(widget);\n }, this);\n }\n /**\n * A signal emitted when the current widget changes.\n */\n get currentChanged() {\n return this._currentChanged;\n }\n /**\n * The current widget is the most recently focused or added widget.\n *\n * #### Notes\n * It is the most recently focused widget, or the most recently added\n * widget if no widget has taken focus.\n */\n get currentWidget() {\n return this._pool.current || null;\n }\n /**\n * A promise resolved when the tracker has been restored.\n */\n get restored() {\n if (this._deferred) {\n return Promise.resolve();\n }\n else {\n return this._pool.restored;\n }\n }\n /**\n * The number of widgets held by the tracker.\n */\n get size() {\n return this._pool.size;\n }\n /**\n * A signal emitted when a widget is added.\n *\n * #### Notes\n * This signal will only fire when a widget is added to the tracker. It will\n * not fire if a widget is injected into the tracker.\n */\n get widgetAdded() {\n return this._widgetAdded;\n }\n /**\n * A signal emitted when a widget is updated.\n */\n get widgetUpdated() {\n return this._widgetUpdated;\n }\n /**\n * Add a new widget to the tracker.\n *\n * @param widget - The widget being added.\n *\n * #### Notes\n * The widget passed into the tracker is added synchronously; its existence in\n * the tracker can be checked with the `has()` method. The promise this method\n * returns resolves after the widget has been added and saved to an underlying\n * restoration connector, if one is available.\n *\n * The newly added widget becomes the current widget unless the focus tracker\n * already had a focused widget.\n */\n async add(widget) {\n this._focusTracker.add(widget);\n await this._pool.add(widget);\n if (!this._focusTracker.activeWidget) {\n this._pool.current = widget;\n }\n }\n /**\n * Test whether the tracker is disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * Dispose of the resources held by the tracker.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n this._pool.dispose();\n this._focusTracker.dispose();\n Signal.clearData(this);\n }\n /**\n * Find the first widget in the tracker that satisfies a filter function.\n *\n * @param fn The filter function to call on each widget.\n *\n * #### Notes\n * If no widget is found, the value returned is `undefined`.\n */\n find(fn) {\n return this._pool.find(fn);\n }\n /**\n * Iterate through each widget in the tracker.\n *\n * @param fn - The function to call on each widget.\n */\n forEach(fn) {\n return this._pool.forEach(fn);\n }\n /**\n * Filter the widgets in the tracker based on a predicate.\n *\n * @param fn - The function by which to filter.\n */\n filter(fn) {\n return this._pool.filter(fn);\n }\n /**\n * Inject a foreign widget into the widget tracker.\n *\n * @param widget - The widget to inject into the tracker.\n *\n * #### Notes\n * Injected widgets will not have their state saved by the tracker.\n *\n * The primary use case for widget injection is for a plugin that offers a\n * sub-class of an extant plugin to have its instances share the same commands\n * as the parent plugin (since most relevant commands will use the\n * `currentWidget` of the parent plugin's widget tracker). In this situation,\n * the sub-class plugin may well have its own widget tracker for layout and\n * state restoration in addition to injecting its widgets into the parent\n * plugin's widget tracker.\n */\n inject(widget) {\n return this._pool.inject(widget);\n }\n /**\n * Check if this tracker has the specified widget.\n *\n * @param widget - The widget whose existence is being checked.\n */\n has(widget) {\n return this._pool.has(widget);\n }\n /**\n * Restore the widgets in this tracker's namespace.\n *\n * @param options - The configuration options that describe restoration.\n *\n * @returns A promise that resolves when restoration has completed.\n *\n * #### Notes\n * This function should not typically be invoked by client code.\n * Its primary use case is to be invoked by a restorer.\n */\n async restore(options) {\n const deferred = this._deferred;\n if (deferred) {\n this._deferred = null;\n return this._pool.restore(deferred);\n }\n if (options) {\n return this._pool.restore(options);\n }\n console.warn('No options provided to restore the tracker.');\n }\n /**\n * Save the restore options for this tracker, but do not restore yet.\n *\n * @param options - The configuration options that describe restoration.\n *\n * ### Notes\n * This function is useful when starting the shell in 'single-document' mode,\n * to avoid restoring all useless widgets. It should not ordinarily be called\n * by client code.\n */\n defer(options) {\n this._deferred = options;\n }\n /**\n * Save the restore data for a given widget.\n *\n * @param widget - The widget being saved.\n */\n async save(widget) {\n return this._pool.save(widget);\n }\n /**\n * Handle the current change event.\n *\n * #### Notes\n * The default implementation is a no-op.\n */\n onCurrentChanged(value) {\n /* no-op */\n }\n}\n//# sourceMappingURL=widgettracker.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { WidgetTracker } from '@jupyterlab/apputils';\nimport { KernelMessage } from '@jupyterlab/services';\nimport { nullTranslator } from '@jupyterlab/translation';\nimport { PromiseDelegate, UUID } from '@lumino/coreutils';\nimport { AttachedProperty } from '@lumino/properties';\nimport { Signal } from '@lumino/signaling';\nimport { Panel, PanelLayout, Widget } from '@lumino/widgets';\n/**\n * The class name added to an output area widget.\n */\nconst OUTPUT_AREA_CLASS = 'jp-OutputArea';\n/**\n * The class name added to the direction children of OutputArea\n */\nconst OUTPUT_AREA_ITEM_CLASS = 'jp-OutputArea-child';\n/**\n * The class name added to actual outputs\n */\nconst OUTPUT_AREA_OUTPUT_CLASS = 'jp-OutputArea-output';\n/**\n * The class name added to prompt children of OutputArea.\n */\nconst OUTPUT_AREA_PROMPT_CLASS = 'jp-OutputArea-prompt';\nconst OUTPUT_AREA_STDIN_HIDING_CLASS = 'jp-OutputArea-stdin-hiding';\n/**\n * The class name added to OutputPrompt.\n */\nconst OUTPUT_PROMPT_CLASS = 'jp-OutputPrompt';\n/**\n * The class name added to an execution result.\n */\nconst EXECUTE_CLASS = 'jp-OutputArea-executeResult';\n/**\n * The class name added stdin items of OutputArea\n */\nconst OUTPUT_AREA_STDIN_ITEM_CLASS = 'jp-OutputArea-stdin-item';\n/**\n * The class name added to stdin widgets.\n */\nconst STDIN_CLASS = 'jp-Stdin';\n/**\n * The class name added to stdin data prompt nodes.\n */\nconst STDIN_PROMPT_CLASS = 'jp-Stdin-prompt';\n/**\n * The class name added to stdin data input nodes.\n */\nconst STDIN_INPUT_CLASS = 'jp-Stdin-input';\n/**\n * The overlay that can be clicked to switch between output scrolling modes.\n */\nconst OUTPUT_PROMPT_OVERLAY = 'jp-OutputArea-promptOverlay';\n/** ****************************************************************************\n * OutputArea\n ******************************************************************************/\n/**\n * An output area widget.\n *\n * #### Notes\n * The widget model must be set separately and can be changed\n * at any time. Consumers of the widget must account for a\n * `null` model, and may want to listen to the `modelChanged`\n * signal.\n */\nexport class OutputArea extends Widget {\n /**\n * Construct an output area widget.\n */\n constructor(options) {\n var _a, _b, _c, _d;\n super();\n /**\n * A public signal used to indicate the number of displayed outputs has changed.\n *\n * #### Notes\n * This is useful for parents who want to apply styling based on the number\n * of outputs. Emits the current number of outputs.\n */\n this.outputLengthChanged = new Signal(this);\n /**\n * Handle an iopub message.\n */\n this._onIOPub = (msg) => {\n const model = this.model;\n const msgType = msg.header.msg_type;\n let output;\n const transient = (msg.content.transient || {});\n const displayId = transient['display_id'];\n let targets;\n switch (msgType) {\n case 'execute_result':\n case 'display_data':\n case 'stream':\n case 'error':\n output = { ...msg.content, output_type: msgType };\n model.add(output);\n break;\n case 'clear_output': {\n const wait = msg.content.wait;\n model.clear(wait);\n break;\n }\n case 'update_display_data':\n output = { ...msg.content, output_type: 'display_data' };\n targets = this._displayIdMap.get(displayId);\n if (targets) {\n for (const index of targets) {\n model.set(index, output);\n }\n }\n break;\n case 'status': {\n const executionState = msg.content\n .execution_state;\n if (executionState === 'idle') {\n // If status is idle, the kernel is no longer blocked by the input\n this._pendingInput = false;\n }\n break;\n }\n default:\n break;\n }\n if (displayId && msgType === 'display_data') {\n targets = this._displayIdMap.get(displayId) || [];\n targets.push(model.length - 1);\n this._displayIdMap.set(displayId, targets);\n }\n };\n /**\n * Handle an execute reply message.\n */\n this._onExecuteReply = (msg) => {\n // API responses that contain a pager are special cased and their type\n // is overridden from 'execute_reply' to 'display_data' in order to\n // render output.\n const model = this.model;\n const content = msg.content;\n if (content.status !== 'ok') {\n return;\n }\n const payload = content && content.payload;\n if (!payload || !payload.length) {\n return;\n }\n const pages = payload.filter((i) => i.source === 'page');\n if (!pages.length) {\n return;\n }\n const page = JSON.parse(JSON.stringify(pages[0]));\n const output = {\n output_type: 'display_data',\n data: page.data,\n metadata: {}\n };\n model.add(output);\n };\n this._displayIdMap = new Map();\n this._minHeightTimeout = null;\n this._inputRequested = new Signal(this);\n this._toggleScrolling = new Signal(this);\n this._initialize = new Signal(this);\n this._outputTracker = new WidgetTracker({\n namespace: UUID.uuid4()\n });\n this._inputHistoryScope = 'global';\n this._pendingInput = false;\n super.layout = new PanelLayout();\n this.addClass(OUTPUT_AREA_CLASS);\n this.contentFactory =\n (_a = options.contentFactory) !== null && _a !== void 0 ? _a : OutputArea.defaultContentFactory;\n this.rendermime = options.rendermime;\n this._maxNumberOutputs = (_b = options.maxNumberOutputs) !== null && _b !== void 0 ? _b : Infinity;\n this._translator = (_c = options.translator) !== null && _c !== void 0 ? _c : nullTranslator;\n this._inputHistoryScope = (_d = options.inputHistoryScope) !== null && _d !== void 0 ? _d : 'global';\n const model = (this.model = options.model);\n for (let i = 0; i < Math.min(model.length, this._maxNumberOutputs + 1); i++) {\n const output = model.get(i);\n this._insertOutput(i, output);\n }\n model.changed.connect(this.onModelChanged, this);\n model.stateChanged.connect(this.onStateChanged, this);\n if (options.promptOverlay) {\n this._addPromptOverlay();\n }\n }\n /**\n * Narrow the type of OutputArea's layout prop\n */\n get layout() {\n return super.layout;\n }\n /**\n * A read-only sequence of the children widgets in the output area.\n */\n get widgets() {\n return this.layout.widgets;\n }\n /**\n * The kernel future associated with the output area.\n */\n get future() {\n return this._future;\n }\n set future(value) {\n // Bail if the model is disposed.\n if (this.model.isDisposed) {\n throw Error('Model is disposed');\n }\n if (this._future === value) {\n return;\n }\n if (this._future) {\n this._future.dispose();\n }\n this._future = value;\n value.done\n .finally(() => {\n this._pendingInput = false;\n })\n .catch(() => {\n // No-op, required because `finally` re-raises any rejections,\n // even if caught on the `done` promise level before.\n });\n this.model.clear();\n // Make sure there were no input widgets.\n if (this.widgets.length) {\n this._clear();\n this.outputLengthChanged.emit(Math.min(this.model.length, this._maxNumberOutputs));\n }\n // Handle published messages.\n value.onIOPub = this._onIOPub;\n // Handle the execute reply.\n value.onReply = this._onExecuteReply;\n // Handle stdin.\n value.onStdin = msg => {\n if (KernelMessage.isInputRequestMsg(msg)) {\n this.onInputRequest(msg, value);\n }\n };\n }\n /**\n * Signal emitted when an output area is requesting an input. The signal\n * carries the input widget that this class creates in response to the input\n * request.\n */\n get inputRequested() {\n return this._inputRequested;\n }\n /**\n * A flag indicating if the output area has pending input.\n */\n get pendingInput() {\n return this._pendingInput;\n }\n /**\n * The maximum number of output items to display on top and bottom of cell output.\n *\n * ### Notes\n * It is set to Infinity if no trim is applied.\n */\n get maxNumberOutputs() {\n return this._maxNumberOutputs;\n }\n set maxNumberOutputs(limit) {\n if (limit <= 0) {\n console.warn(`OutputArea.maxNumberOutputs must be strictly positive.`);\n return;\n }\n const lastShown = this._maxNumberOutputs;\n this._maxNumberOutputs = limit;\n if (lastShown < limit) {\n this._showTrimmedOutputs(lastShown);\n }\n }\n /**\n * Dispose of the resources used by the output area.\n */\n dispose() {\n if (this._future) {\n this._future.dispose();\n this._future = null;\n }\n this._displayIdMap.clear();\n this._outputTracker.dispose();\n super.dispose();\n }\n /**\n * Follow changes on the model state.\n */\n onModelChanged(sender, args) {\n switch (args.type) {\n case 'add':\n this._insertOutput(args.newIndex, args.newValues[0]);\n break;\n case 'remove':\n if (this.widgets.length) {\n // all items removed from model\n if (this.model.length === 0) {\n this._clear();\n }\n else {\n // range of items removed from model\n // remove widgets corresponding to removed model items\n const startIndex = args.oldIndex;\n for (let i = 0; i < args.oldValues.length && startIndex < this.widgets.length; ++i) {\n const widget = this.widgets[startIndex];\n widget.parent = null;\n widget.dispose();\n }\n // apply item offset to target model item indices in _displayIdMap\n this._moveDisplayIdIndices(startIndex, args.oldValues.length);\n // prevent jitter caused by immediate height change\n this._preventHeightChangeJitter();\n }\n }\n break;\n case 'set':\n this._setOutput(args.newIndex, args.newValues[0]);\n break;\n default:\n break;\n }\n this.outputLengthChanged.emit(Math.min(this.model.length, this._maxNumberOutputs));\n }\n /**\n * Emitted when user requests toggling of the output scrolling mode.\n */\n get toggleScrolling() {\n return this._toggleScrolling;\n }\n get initialize() {\n return this._initialize;\n }\n /**\n * Add overlay allowing to toggle scrolling.\n */\n _addPromptOverlay() {\n const overlay = document.createElement('div');\n overlay.className = OUTPUT_PROMPT_OVERLAY;\n overlay.addEventListener('click', () => {\n this._toggleScrolling.emit();\n });\n this.node.appendChild(overlay);\n requestAnimationFrame(() => {\n this._initialize.emit();\n });\n }\n /**\n * Update indices in _displayIdMap in response to element remove from model items\n *\n * @param startIndex - The index of first element removed\n *\n * @param count - The number of elements removed from model items\n *\n */\n _moveDisplayIdIndices(startIndex, count) {\n this._displayIdMap.forEach((indices) => {\n const rangeEnd = startIndex + count;\n const numIndices = indices.length;\n // reverse loop in order to prevent removing element affecting the index\n for (let i = numIndices - 1; i >= 0; --i) {\n const index = indices[i];\n // remove model item indices in removed range\n if (index >= startIndex && index < rangeEnd) {\n indices.splice(i, 1);\n }\n else if (index >= rangeEnd) {\n // move model item indices that were larger than range end\n indices[i] -= count;\n }\n }\n });\n }\n /**\n * Follow changes on the output model state.\n */\n onStateChanged(sender, change) {\n const outputLength = Math.min(this.model.length, this._maxNumberOutputs);\n if (change) {\n if (change >= this._maxNumberOutputs) {\n // Bail early\n return;\n }\n this._setOutput(change, this.model.get(change));\n }\n else {\n for (let i = 0; i < outputLength; i++) {\n this._setOutput(i, this.model.get(i));\n }\n }\n this.outputLengthChanged.emit(outputLength);\n }\n /**\n * Clear the widget outputs.\n */\n _clear() {\n // Bail if there is no work to do.\n if (!this.widgets.length) {\n return;\n }\n // Remove all of our widgets.\n const length = this.widgets.length;\n for (let i = 0; i < length; i++) {\n const widget = this.widgets[0];\n widget.parent = null;\n widget.dispose();\n }\n // Clear the display id map.\n this._displayIdMap.clear();\n // prevent jitter caused by immediate height change\n this._preventHeightChangeJitter();\n }\n _preventHeightChangeJitter() {\n // When an output area is cleared and then quickly replaced with new\n // content (as happens with @interact in widgets, for example), the\n // quickly changing height can make the page jitter.\n // We introduce a small delay in the minimum height\n // to prevent this jitter.\n const rect = this.node.getBoundingClientRect();\n this.node.style.minHeight = `${rect.height}px`;\n if (this._minHeightTimeout) {\n window.clearTimeout(this._minHeightTimeout);\n }\n this._minHeightTimeout = window.setTimeout(() => {\n if (this.isDisposed) {\n return;\n }\n this.node.style.minHeight = '';\n }, 50);\n }\n /**\n * Handle an input request from a kernel.\n */\n onInputRequest(msg, future) {\n // Add an output widget to the end.\n const factory = this.contentFactory;\n const stdinPrompt = msg.content.prompt;\n const password = msg.content.password;\n const panel = new Panel();\n panel.addClass(OUTPUT_AREA_ITEM_CLASS);\n panel.addClass(OUTPUT_AREA_STDIN_ITEM_CLASS);\n const prompt = factory.createOutputPrompt();\n prompt.addClass(OUTPUT_AREA_PROMPT_CLASS);\n panel.addWidget(prompt);\n // Indicate that input is pending\n this._pendingInput = true;\n const input = factory.createStdin({\n parent_header: msg.header,\n prompt: stdinPrompt,\n password,\n future,\n translator: this._translator,\n inputHistoryScope: this._inputHistoryScope\n });\n input.addClass(OUTPUT_AREA_OUTPUT_CLASS);\n panel.addWidget(input);\n // Increase number of outputs to display the result up to the input request.\n if (this.model.length >= this.maxNumberOutputs) {\n this.maxNumberOutputs = this.model.length;\n }\n this._inputRequested.emit(input);\n // Get the input node to ensure focus after updating the model upon user reply.\n const inputNode = input.node.getElementsByTagName('input')[0];\n /**\n * Wait for the stdin to complete, add it to the model (so it persists)\n * and remove the stdin widget.\n */\n void input.value.then(value => {\n // Increase number of outputs to display the result of stdin if needed.\n if (this.model.length >= this.maxNumberOutputs) {\n this.maxNumberOutputs = this.model.length + 1;\n }\n panel.addClass(OUTPUT_AREA_STDIN_HIDING_CLASS);\n // Use stdin as the stream so it does not get combined with stdout.\n // Note: because it modifies DOM it may (will) shift focus away from the input node.\n this.model.add({\n output_type: 'stream',\n name: 'stdin',\n text: value + '\\n'\n });\n // Refocus the input node after it lost focus due to update of the model.\n inputNode.focus();\n // Indicate that input is no longer pending\n this._pendingInput = false;\n // Keep the input in view for a little while; this (along refocusing)\n // ensures that we can avoid the cell editor stealing the focus, and\n // leading to user inadvertently modifying editor content when executing\n // consecutive commands in short succession.\n window.setTimeout(() => {\n // Tack currently focused element to ensure that it remains on it\n // after disposal of the panel with the old input\n // (which modifies DOM and can lead to focus jump).\n const focusedElement = document.activeElement;\n // Dispose the old panel with no longer needed input box.\n panel.dispose();\n // Refocus the element that was focused before.\n if (focusedElement && focusedElement instanceof HTMLElement) {\n focusedElement.focus();\n }\n }, 500);\n });\n // Note: the `input.value` promise must be listened to before we attach the panel\n this.layout.addWidget(panel);\n }\n /**\n * Update an output in the layout in place.\n */\n _setOutput(index, model) {\n if (index >= this._maxNumberOutputs) {\n return;\n }\n const panel = this.layout.widgets[index];\n const renderer = (panel.widgets\n ? panel.widgets.filter(it => 'renderModel' in it).pop()\n : panel);\n // Check whether it is safe to reuse renderer:\n // - Preferred mime type has not changed\n // - Isolation has not changed\n const mimeType = this.rendermime.preferredMimeType(model.data, model.trusted ? 'any' : 'ensure');\n if (Private.currentPreferredMimetype.get(renderer) === mimeType &&\n OutputArea.isIsolated(mimeType, model.metadata) ===\n renderer instanceof Private.IsolatedRenderer) {\n void renderer.renderModel(model);\n }\n else {\n this.layout.widgets[index].dispose();\n this._insertOutput(index, model);\n }\n }\n /**\n * Render and insert a single output into the layout.\n *\n * @param index - The index of the output to be inserted.\n * @param model - The model of the output to be inserted.\n */\n _insertOutput(index, model) {\n if (index > this._maxNumberOutputs) {\n return;\n }\n const layout = this.layout;\n if (index === this._maxNumberOutputs) {\n const warning = new Private.TrimmedOutputs(this._maxNumberOutputs, () => {\n const lastShown = this._maxNumberOutputs;\n this._maxNumberOutputs = Infinity;\n this._showTrimmedOutputs(lastShown);\n });\n layout.insertWidget(index, this._wrappedOutput(warning));\n }\n else {\n let output = this.createOutputItem(model);\n if (output) {\n output.toggleClass(EXECUTE_CLASS, model.executionCount !== null);\n }\n else {\n output = new Widget();\n }\n if (!this._outputTracker.has(output)) {\n void this._outputTracker.add(output);\n }\n layout.insertWidget(index, output);\n }\n }\n /**\n * A widget tracker for individual output widgets in the output area.\n */\n get outputTracker() {\n return this._outputTracker;\n }\n /**\n * Dispose information message and show output models from the given\n * index to maxNumberOutputs\n *\n * @param lastShown Starting model index to insert.\n */\n _showTrimmedOutputs(lastShown) {\n // Dispose information widget\n this.widgets[lastShown].dispose();\n for (let idx = lastShown; idx < this.model.length; idx++) {\n this._insertOutput(idx, this.model.get(idx));\n }\n this.outputLengthChanged.emit(Math.min(this.model.length, this._maxNumberOutputs));\n }\n /**\n * Create an output item with a prompt and actual output\n *\n * @returns a rendered widget, or null if we cannot render\n * #### Notes\n */\n createOutputItem(model) {\n const output = this.createRenderedMimetype(model);\n if (!output) {\n return null;\n }\n return this._wrappedOutput(output, model.executionCount);\n }\n /**\n * Render a mimetype\n */\n createRenderedMimetype(model) {\n const mimeType = this.rendermime.preferredMimeType(model.data, model.trusted ? 'any' : 'ensure');\n if (!mimeType) {\n return null;\n }\n let output = this.rendermime.createRenderer(mimeType);\n const isolated = OutputArea.isIsolated(mimeType, model.metadata);\n if (isolated === true) {\n output = new Private.IsolatedRenderer(output);\n }\n Private.currentPreferredMimetype.set(output, mimeType);\n output.renderModel(model).catch(error => {\n // Manually append error message to output\n const pre = document.createElement('pre');\n const trans = this._translator.load('jupyterlab');\n pre.textContent = trans.__('Javascript Error: %1', error.message);\n output.node.appendChild(pre);\n // Remove mime-type-specific CSS classes\n output.node.className = 'lm-Widget jp-RenderedText';\n output.node.setAttribute('data-mime-type', 'application/vnd.jupyter.stderr');\n });\n return output;\n }\n /**\n * Wrap a output widget within a output panel\n *\n * @param output Output widget to wrap\n * @param executionCount Execution count\n * @returns The output panel\n */\n _wrappedOutput(output, executionCount = null) {\n const panel = new Private.OutputPanel();\n panel.addClass(OUTPUT_AREA_ITEM_CLASS);\n const prompt = this.contentFactory.createOutputPrompt();\n prompt.executionCount = executionCount;\n prompt.addClass(OUTPUT_AREA_PROMPT_CLASS);\n panel.addWidget(prompt);\n output.addClass(OUTPUT_AREA_OUTPUT_CLASS);\n panel.addWidget(output);\n return panel;\n }\n}\nexport class SimplifiedOutputArea extends OutputArea {\n /**\n * Handle an input request from a kernel by doing nothing.\n */\n onInputRequest(msg, future) {\n return;\n }\n /**\n * Create an output item without a prompt, just the output widgets\n */\n createOutputItem(model) {\n const output = this.createRenderedMimetype(model);\n if (!output) {\n return null;\n }\n const panel = new Private.OutputPanel();\n panel.addClass(OUTPUT_AREA_ITEM_CLASS);\n output.addClass(OUTPUT_AREA_OUTPUT_CLASS);\n panel.addWidget(output);\n return panel;\n }\n}\n/**\n * A namespace for OutputArea statics.\n */\n(function (OutputArea) {\n /**\n * Execute code on an output area.\n */\n async function execute(code, output, sessionContext, metadata) {\n var _a;\n // Override the default for `stop_on_error`.\n let stopOnError = true;\n if (metadata &&\n Array.isArray(metadata.tags) &&\n metadata.tags.indexOf('raises-exception') !== -1) {\n stopOnError = false;\n }\n const content = {\n code,\n stop_on_error: stopOnError\n };\n const kernel = (_a = sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;\n if (!kernel) {\n throw new Error('Session has no kernel.');\n }\n const future = kernel.requestExecute(content, false, metadata);\n output.future = future;\n return future.done;\n }\n OutputArea.execute = execute;\n function isIsolated(mimeType, metadata) {\n const mimeMd = metadata[mimeType];\n // mime-specific higher priority\n if (mimeMd && mimeMd['isolated'] !== undefined) {\n return !!mimeMd['isolated'];\n }\n else {\n // fallback on global\n return !!metadata['isolated'];\n }\n }\n OutputArea.isIsolated = isIsolated;\n /**\n * The default implementation of `IContentFactory`.\n */\n class ContentFactory {\n /**\n * Create the output prompt for the widget.\n */\n createOutputPrompt() {\n return new OutputPrompt();\n }\n /**\n * Create an stdin widget.\n */\n createStdin(options) {\n return new Stdin(options);\n }\n }\n OutputArea.ContentFactory = ContentFactory;\n /**\n * The default `ContentFactory` instance.\n */\n OutputArea.defaultContentFactory = new ContentFactory();\n})(OutputArea || (OutputArea = {}));\n/**\n * The default output prompt implementation\n */\nexport class OutputPrompt extends Widget {\n /*\n * Create an output prompt widget.\n */\n constructor() {\n super();\n this._executionCount = null;\n this.addClass(OUTPUT_PROMPT_CLASS);\n }\n /**\n * The execution count for the prompt.\n */\n get executionCount() {\n return this._executionCount;\n }\n set executionCount(value) {\n this._executionCount = value;\n if (value === null) {\n this.node.textContent = '';\n }\n else {\n this.node.textContent = `[${value}]:`;\n }\n }\n}\n/**\n * The default stdin widget.\n */\nexport class Stdin extends Widget {\n static _historyIx(key, ix) {\n const history = Stdin._history.get(key);\n if (!history) {\n return undefined;\n }\n const len = history.length;\n // wrap nonpositive ix to nonnegative ix\n if (ix <= 0) {\n return len + ix;\n }\n }\n static _historyAt(key, ix) {\n const history = Stdin._history.get(key);\n if (!history) {\n return undefined;\n }\n const len = history.length;\n const ixpos = Stdin._historyIx(key, ix);\n if (ixpos !== undefined && ixpos < len) {\n return history[ixpos];\n }\n // return undefined if ix is out of bounds\n }\n static _historyPush(key, line) {\n const history = Stdin._history.get(key);\n history.push(line);\n if (history.length > 1000) {\n // truncate line history if it's too long\n history.shift();\n }\n }\n static _historySearch(key, pat, ix, reverse = true) {\n const history = Stdin._history.get(key);\n const len = history.length;\n const ixpos = Stdin._historyIx(key, ix);\n const substrFound = (x) => x.search(pat) !== -1;\n if (ixpos === undefined) {\n return;\n }\n if (reverse) {\n if (ixpos === 0) {\n // reverse search fails if already at start of history\n return;\n }\n const ixFound = history.slice(0, ixpos).findLastIndex(substrFound);\n if (ixFound !== -1) {\n // wrap ix to negative\n return ixFound - len;\n }\n }\n else {\n if (ixpos >= len - 1) {\n // forward search fails if already at end of history\n return;\n }\n const ixFound = history.slice(ixpos + 1).findIndex(substrFound);\n if (ixFound !== -1) {\n // wrap ix to negative and adjust for slice\n return ixFound - len + ixpos + 1;\n }\n }\n }\n /**\n * Construct a new input widget.\n */\n constructor(options) {\n var _a;\n super({\n node: Private.createInputWidgetNode(options.prompt, options.password)\n });\n this._promise = new PromiseDelegate();\n this._resolved = false;\n this.addClass(STDIN_CLASS);\n this._future = options.future;\n this._historyIndex = 0;\n this._historyKey =\n options.inputHistoryScope === 'session'\n ? options.parent_header.session\n : '';\n this._historyPat = '';\n this._parentHeader = options.parent_header;\n this._password = options.password;\n this._trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : nullTranslator).load('jupyterlab');\n this._value = options.prompt + ' ';\n this._input = this.node.getElementsByTagName('input')[0];\n // make users aware of the line history feature\n if (!this._password) {\n this._input.placeholder = this._trans.__('↑↓ for history. Search history with c-↑/c-↓');\n }\n else {\n this._input.placeholder = '';\n }\n // initialize line history\n if (!Stdin._history.has(this._historyKey)) {\n Stdin._history.set(this._historyKey, []);\n }\n }\n /**\n * The value of the widget.\n */\n get value() {\n return this._promise.promise.then(() => this._value);\n }\n /**\n * Handle the DOM events for the widget.\n *\n * @param event - The DOM event sent to the widget.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the dock panel's node. It should\n * not be called directly by user code.\n */\n handleEvent(event) {\n if (this._resolved) {\n // Do not handle any more key events if the promise was resolved.\n event.preventDefault();\n return;\n }\n const input = this._input;\n if (event.type === 'keydown') {\n if (event.key === 'Enter') {\n this.resetSearch();\n this._future.sendInputReply({\n status: 'ok',\n value: input.value\n }, this._parentHeader);\n if (this._password) {\n this._value += '········';\n }\n else {\n this._value += input.value;\n Stdin._historyPush(this._historyKey, input.value);\n }\n this._resolved = true;\n this._promise.resolve(void 0);\n }\n else if (event.key === 'Escape') {\n // currently this gets clobbered by the documentsearch:end command at the notebook level\n this.resetSearch();\n input.blur();\n }\n else if (event.ctrlKey &&\n (event.key === 'ArrowUp' || event.key === 'ArrowDown')) {\n // if _historyPat is blank, use input as search pattern. Otherwise, reuse the current search pattern\n if (this._historyPat === '') {\n this._historyPat = input.value;\n }\n const reverse = event.key === 'ArrowUp';\n const searchHistoryIx = Stdin._historySearch(this._historyKey, this._historyPat, this._historyIndex, reverse);\n if (searchHistoryIx !== undefined) {\n const historyLine = Stdin._historyAt(this._historyKey, searchHistoryIx);\n if (historyLine !== undefined) {\n if (this._historyIndex === 0) {\n this._valueCache = input.value;\n }\n this._setInputValue(historyLine);\n this._historyIndex = searchHistoryIx;\n // The default action for ArrowUp is moving to first character\n // but we want to keep the cursor at the end.\n event.preventDefault();\n }\n }\n }\n else if (event.key === 'ArrowUp') {\n this.resetSearch();\n const historyLine = Stdin._historyAt(this._historyKey, this._historyIndex - 1);\n if (historyLine) {\n if (this._historyIndex === 0) {\n this._valueCache = input.value;\n }\n this._setInputValue(historyLine);\n --this._historyIndex;\n // The default action for ArrowUp is moving to first character\n // but we want to keep the cursor at the end.\n event.preventDefault();\n }\n }\n else if (event.key === 'ArrowDown') {\n this.resetSearch();\n if (this._historyIndex === 0) {\n // do nothing\n }\n else if (this._historyIndex === -1) {\n this._setInputValue(this._valueCache);\n ++this._historyIndex;\n }\n else {\n const historyLine = Stdin._historyAt(this._historyKey, this._historyIndex + 1);\n if (historyLine) {\n this._setInputValue(historyLine);\n ++this._historyIndex;\n }\n }\n }\n }\n }\n resetSearch() {\n this._historyPat = '';\n }\n /**\n * Handle `after-attach` messages sent to the widget.\n */\n onAfterAttach(msg) {\n this._input.addEventListener('keydown', this);\n this._input.focus();\n }\n /**\n * Handle `before-detach` messages sent to the widget.\n */\n onBeforeDetach(msg) {\n this._input.removeEventListener('keydown', this);\n }\n _setInputValue(value) {\n this._input.value = value;\n // Set cursor at the end; this is usually not necessary when input is\n // focused but having the explicit placement ensures consistency.\n this._input.setSelectionRange(value.length, value.length);\n }\n}\nStdin._history = new Map();\n/** ****************************************************************************\n * Private namespace\n ******************************************************************************/\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n /**\n * Create the node for an InputWidget.\n */\n function createInputWidgetNode(prompt, password) {\n const node = document.createElement('div');\n const promptNode = document.createElement('pre');\n promptNode.className = STDIN_PROMPT_CLASS;\n promptNode.textContent = prompt;\n const input = document.createElement('input');\n input.className = STDIN_INPUT_CLASS;\n if (password) {\n input.type = 'password';\n }\n node.appendChild(promptNode);\n promptNode.appendChild(input);\n return node;\n }\n Private.createInputWidgetNode = createInputWidgetNode;\n /**\n * A renderer for IFrame data.\n */\n class IsolatedRenderer extends Widget {\n /**\n * Create an isolated renderer.\n */\n constructor(wrapped) {\n super({ node: document.createElement('iframe') });\n this.addClass('jp-mod-isolated');\n this._wrapped = wrapped;\n // Once the iframe is loaded, the subarea is dynamically inserted\n const iframe = this.node;\n iframe.frameBorder = '0';\n iframe.scrolling = 'auto';\n iframe.addEventListener('load', () => {\n // Workaround needed by Firefox, to properly render svg inside\n // iframes, see https://stackoverflow.com/questions/10177190/\n // svg-dynamically-added-to-iframe-does-not-render-correctly\n iframe.contentDocument.open();\n // Insert the subarea into the iframe\n // We must directly write the html. At this point, subarea doesn't\n // contain any user content.\n iframe.contentDocument.write(this._wrapped.node.innerHTML);\n iframe.contentDocument.close();\n const body = iframe.contentDocument.body;\n // Adjust the iframe height automatically\n iframe.style.height = `${body.scrollHeight}px`;\n iframe.heightChangeObserver = new ResizeObserver(() => {\n iframe.style.height = `${body.scrollHeight}px`;\n });\n iframe.heightChangeObserver.observe(body);\n });\n }\n /**\n * Render a mime model.\n *\n * @param model - The mime model to render.\n *\n * @returns A promise which resolves when rendering is complete.\n *\n * #### Notes\n * This method may be called multiple times during the lifetime\n * of the widget to update it if and when new data is available.\n */\n renderModel(model) {\n return this._wrapped.renderModel(model);\n }\n }\n Private.IsolatedRenderer = IsolatedRenderer;\n Private.currentPreferredMimetype = new AttachedProperty({\n name: 'preferredMimetype',\n create: owner => ''\n });\n /**\n * A `Panel` that's focused by a `contextmenu` event.\n */\n class OutputPanel extends Panel {\n /**\n * Construct a new `OutputPanel` widget.\n */\n constructor(options) {\n super(options);\n }\n /**\n * A callback that focuses on the widget.\n */\n _onContext(_) {\n this.node.focus();\n }\n /**\n * Handle `after-attach` messages sent to the widget.\n */\n onAfterAttach(msg) {\n super.onAfterAttach(msg);\n this.node.addEventListener('contextmenu', this._onContext.bind(this));\n }\n /**\n * Handle `before-detach` messages sent to the widget.\n */\n onBeforeDetach(msg) {\n super.onAfterDetach(msg);\n this.node.removeEventListener('contextmenu', this._onContext.bind(this));\n }\n }\n Private.OutputPanel = OutputPanel;\n /**\n * Trimmed outputs information widget.\n */\n class TrimmedOutputs extends Widget {\n /**\n * Widget constructor\n *\n * ### Notes\n * The widget will be disposed on click after calling the callback.\n *\n * @param maxNumberOutputs Maximal number of outputs to display\n * @param _onClick Callback on click event on the widget\n */\n constructor(maxNumberOutputs, onClick) {\n const node = document.createElement('div');\n const title = `The first ${maxNumberOutputs} are displayed`;\n const msg = 'Show more outputs';\n node.insertAdjacentHTML('afterbegin', `\n
${msg}
\n
`);\n super({\n node\n });\n this._onClick = onClick;\n this.addClass('jp-TrimmedOutputs');\n this.addClass('jp-RenderedHTMLCommon');\n }\n /**\n * Handle the DOM events for widget.\n *\n * @param event - The DOM event sent to the widget.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the widget's DOM node. It should\n * not be called directly by user code.\n */\n handleEvent(event) {\n if (event.type === 'click') {\n this._onClick(event);\n }\n }\n /**\n * Handle `after-attach` messages for the widget.\n */\n onAfterAttach(msg) {\n super.onAfterAttach(msg);\n this.node.addEventListener('click', this);\n }\n /**\n * A message handler invoked on a `'before-detach'`\n * message\n */\n onBeforeDetach(msg) {\n super.onBeforeDetach(msg);\n this.node.removeEventListener('click', this);\n }\n }\n Private.TrimmedOutputs = TrimmedOutputs;\n})(Private || (Private = {}));\n//# sourceMappingURL=widget.js.map","/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n// Some magic for deferring mathematical expressions to MathJax\n// by hiding them from the Markdown parser.\n// Some of the code here is adapted with permission from Davide Cervone\n// under the terms of the Apache2 license governing the MathJax project.\n// Other minor modifications are also due to StackExchange and are used with\n// permission.\nconst inline = '$'; // the inline math delimiter\n// MATHSPLIT contains the pattern for math delimiters and special symbols\n// needed for searching for math in the text input.\nconst MATHSPLIT = /(\\$\\$?|\\\\(?:begin|end)\\{[a-z]*\\*?\\}|\\\\[{}$]|[{}]|(?:\\n\\s*)+|@@\\d+@@|\\\\\\\\(?:\\(|\\)|\\[|\\]))/i;\n/**\n * Break up the text into its component parts and search\n * through them for math delimiters, braces, linebreaks, etc.\n * Math delimiters must match and braces must balance.\n * Don't allow math to pass through a double linebreak\n * (which will be a paragraph).\n */\nexport function removeMath(text) {\n const math = []; // stores math strings for later\n let start = null;\n let end = null;\n let last = null;\n let braces = 0;\n let deTilde;\n // Except for extreme edge cases, this should catch precisely those pieces of the markdown\n // source that will later be turned into code spans. While MathJax will not TeXify code spans,\n // we still have to consider them at this point; the following issue has happened several times:\n //\n // `$foo` and `$bar` are variables. --> $foo ` and `$bar are variables.\n const hasCodeSpans = text.includes('`') || text.includes('~~~');\n if (hasCodeSpans) {\n text = text\n .replace(/~/g, '~T')\n // note: the `fence` (three or more consecutive tildes or backticks)\n // can be followed by an `info string` but this cannot include backticks,\n // see specification: https://spec.commonmark.org/0.30/#info-string\n .replace(/^(?`{3,}|(~T){3,})[^`\\n]*\\n([\\s\\S]*?)^\\k`*$/gm, wholematch => wholematch.replace(/\\$/g, '~D'))\n .replace(/(^|[^\\\\])(`+)([^\\n]*?[^`\\n])\\2(?!`)/gm, wholematch => wholematch.replace(/\\$/g, '~D'));\n deTilde = (text) => {\n return text.replace(/~([TD])/g, (wholematch, character) => character === 'T' ? '~' : inline);\n };\n }\n else {\n deTilde = (text) => {\n return text;\n };\n }\n let blocks = text.replace(/\\r\\n?/g, '\\n').split(MATHSPLIT);\n for (let i = 1, m = blocks.length; i < m; i += 2) {\n const block = blocks[i];\n if (block.charAt(0) === '@') {\n //\n // Things that look like our math markers will get\n // stored and then retrieved along with the math.\n //\n blocks[i] = '@@' + math.length + '@@';\n math.push(block);\n }\n else if (start !== null) {\n //\n // If we are in math, look for the end delimiter,\n // but don't go past double line breaks, and\n // and balance braces within the math.\n //\n if (block === end) {\n if (braces) {\n last = i;\n }\n else {\n blocks = processMath(start, i, deTilde, math, blocks);\n start = null;\n end = null;\n last = null;\n }\n }\n else if (block.match(/\\n.*\\n/)) {\n if (last !== null) {\n i = last;\n blocks = processMath(start, i, deTilde, math, blocks);\n }\n start = null;\n end = null;\n last = null;\n braces = 0;\n }\n else if (block === '{') {\n braces++;\n }\n else if (block === '}' && braces) {\n braces--;\n }\n }\n else {\n //\n // Look for math start delimiters and when\n // found, set up the end delimiter.\n //\n if (block === inline || block === '$$') {\n start = i;\n end = block;\n braces = 0;\n }\n else if (block === '\\\\\\\\(' || block === '\\\\\\\\[') {\n start = i;\n end = block.slice(-1) === '(' ? '\\\\\\\\)' : '\\\\\\\\]';\n braces = 0;\n }\n else if (block.substr(1, 5) === 'begin') {\n start = i;\n end = '\\\\end' + block.substr(6);\n braces = 0;\n }\n }\n }\n if (start !== null && last !== null) {\n blocks = processMath(start, last, deTilde, math, blocks);\n start = null;\n end = null;\n last = null;\n }\n return { text: deTilde(blocks.join('')), math };\n}\n/**\n * Put back the math strings that were saved,\n * and clear the math array (no need to keep it around).\n */\nexport function replaceMath(text, math) {\n /**\n * Replace a math placeholder with its corresponding group.\n * The math delimiters \"\\\\(\", \"\\\\[\", \"\\\\)\" and \"\\\\]\" are replaced\n * removing one backslash in order to be interpreted correctly by MathJax.\n */\n const process = (match, n) => {\n let group = math[n];\n if (group.substr(0, 3) === '\\\\\\\\(' &&\n group.substr(group.length - 3) === '\\\\\\\\)') {\n group = '\\\\(' + group.substring(3, group.length - 3) + '\\\\)';\n }\n else if (group.substr(0, 3) === '\\\\\\\\[' &&\n group.substr(group.length - 3) === '\\\\\\\\]') {\n group = '\\\\[' + group.substring(3, group.length - 3) + '\\\\]';\n }\n return group;\n };\n // Replace all the math group placeholders in the text\n // with the saved strings.\n return text.replace(/@@(\\d+)@@/g, process);\n}\n/**\n * Process math blocks.\n *\n * The math is in blocks i through j, so\n * collect it into one block and clear the others.\n * Replace &, <, and > by named entities.\n * For IE, put
at the ends of comments since IE removes \\n.\n * Clear the current math positions and store the index of the\n * math, then push the math string onto the storage array.\n * The preProcess function is called on all blocks if it has been passed in\n */\nfunction processMath(i, j, preProcess, math, blocks) {\n let block = blocks\n .slice(i, j + 1)\n .join('')\n .replace(/&/g, '&') // use HTML entity for &\n .replace(//g, '>'); // use HTML entity for >\n if (navigator && navigator.appName === 'Microsoft Internet Explorer') {\n block = block.replace(/(%[^\\n]*)\\n/g, '$1
\\n');\n }\n while (j > i) {\n blocks[j] = '';\n j--;\n }\n blocks[i] = '@@' + math.length + '@@'; // replace the current block text with a unique tag to find later\n if (preProcess) {\n block = preProcess(block);\n }\n math.push(block);\n return blocks;\n}\n//# sourceMappingURL=latex.js.map","/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\nimport { URLExt } from '@jupyterlab/coreutils';\nimport { nullTranslator } from '@jupyterlab/translation';\nimport escape from 'lodash.escape';\nimport { removeMath, replaceMath } from './latex';\n/**\n * Render HTML into a host node.\n *\n * @param options - The options for rendering.\n *\n * @returns A promise which resolves when rendering is complete.\n */\nexport function renderHTML(options) {\n // Unpack the options.\n let { host, source, trusted, sanitizer, resolver, linkHandler, shouldTypeset, latexTypesetter, translator } = options;\n translator = translator || nullTranslator;\n const trans = translator === null || translator === void 0 ? void 0 : translator.load('jupyterlab');\n let originalSource = source;\n // Bail early if the source is empty.\n if (!source) {\n host.textContent = '';\n return Promise.resolve(undefined);\n }\n // Sanitize the source if it is not trusted. This removes all\n // ``.\n this.sequenceIndex = Number(c === CharCodes.Lt);\n }\n };\n Tokenizer.prototype.stateCDATASequence = function (c) {\n if (c === Sequences.Cdata[this.sequenceIndex]) {\n if (++this.sequenceIndex === Sequences.Cdata.length) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CdataEnd;\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n }\n }\n else {\n this.sequenceIndex = 0;\n this.state = State.InDeclaration;\n this.stateInDeclaration(c); // Reconsume the character\n }\n };\n /**\n * When we wait for one specific character, we can speed things up\n * by skipping through the buffer until we find it.\n *\n * @returns Whether the character was found.\n */\n Tokenizer.prototype.fastForwardTo = function (c) {\n while (++this.index < this.buffer.length + this.offset) {\n if (this.buffer.charCodeAt(this.index - this.offset) === c) {\n return true;\n }\n }\n /*\n * We increment the index at the end of the `parse` loop,\n * so set it to `buffer.length - 1` here.\n *\n * TODO: Refactor `parse` to increment index before calling states.\n */\n this.index = this.buffer.length + this.offset - 1;\n return false;\n };\n /**\n * Comments and CDATA end with `-->` and `]]>`.\n *\n * Their common qualities are:\n * - Their end sequences have a distinct character they start with.\n * - That character is then repeated, so we have to check multiple repeats.\n * - All characters but the start character of the sequence can be skipped.\n */\n Tokenizer.prototype.stateInCommentLike = function (c) {\n if (c === this.currentSequence[this.sequenceIndex]) {\n if (++this.sequenceIndex === this.currentSequence.length) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, this.index, 2);\n }\n else {\n this.cbs.oncomment(this.sectionStart, this.index, 2);\n }\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n this.state = State.Text;\n }\n }\n else if (this.sequenceIndex === 0) {\n // Fast-forward to the first character of the sequence\n if (this.fastForwardTo(this.currentSequence[0])) {\n this.sequenceIndex = 1;\n }\n }\n else if (c !== this.currentSequence[this.sequenceIndex - 1]) {\n // Allow long sequences, eg. --->, ]]]>\n this.sequenceIndex = 0;\n }\n };\n /**\n * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.\n *\n * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).\n * We allow anything that wouldn't end the tag.\n */\n Tokenizer.prototype.isTagStartChar = function (c) {\n return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);\n };\n Tokenizer.prototype.startSpecial = function (sequence, offset) {\n this.isSpecial = true;\n this.currentSequence = sequence;\n this.sequenceIndex = offset;\n this.state = State.SpecialStartSequence;\n };\n Tokenizer.prototype.stateBeforeTagName = function (c) {\n if (c === CharCodes.ExclamationMark) {\n this.state = State.BeforeDeclaration;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Questionmark) {\n this.state = State.InProcessingInstruction;\n this.sectionStart = this.index + 1;\n }\n else if (this.isTagStartChar(c)) {\n var lower = c | 0x20;\n this.sectionStart = this.index;\n if (!this.xmlMode && lower === Sequences.TitleEnd[2]) {\n this.startSpecial(Sequences.TitleEnd, 3);\n }\n else {\n this.state =\n !this.xmlMode && lower === Sequences.ScriptEnd[2]\n ? State.BeforeSpecialS\n : State.InTagName;\n }\n }\n else if (c === CharCodes.Slash) {\n this.state = State.BeforeClosingTagName;\n }\n else {\n this.state = State.Text;\n this.stateText(c);\n }\n };\n Tokenizer.prototype.stateInTagName = function (c) {\n if (isEndOfTagSection(c)) {\n this.cbs.onopentagname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n };\n Tokenizer.prototype.stateBeforeClosingTagName = function (c) {\n if (isWhitespace(c)) {\n // Ignore\n }\n else if (c === CharCodes.Gt) {\n this.state = State.Text;\n }\n else {\n this.state = this.isTagStartChar(c)\n ? State.InClosingTagName\n : State.InSpecialComment;\n this.sectionStart = this.index;\n }\n };\n Tokenizer.prototype.stateInClosingTagName = function (c) {\n if (c === CharCodes.Gt || isWhitespace(c)) {\n this.cbs.onclosetag(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterClosingTagName;\n this.stateAfterClosingTagName(c);\n }\n };\n Tokenizer.prototype.stateAfterClosingTagName = function (c) {\n // Skip everything until \">\"\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.state = State.Text;\n this.baseState = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateBeforeAttributeName = function (c) {\n if (c === CharCodes.Gt) {\n this.cbs.onopentagend(this.index);\n if (this.isSpecial) {\n this.state = State.InSpecialTag;\n this.sequenceIndex = 0;\n }\n else {\n this.state = State.Text;\n }\n this.baseState = this.state;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Slash) {\n this.state = State.InSelfClosingTag;\n }\n else if (!isWhitespace(c)) {\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n };\n Tokenizer.prototype.stateInSelfClosingTag = function (c) {\n if (c === CharCodes.Gt) {\n this.cbs.onselfclosingtag(this.index);\n this.state = State.Text;\n this.baseState = State.Text;\n this.sectionStart = this.index + 1;\n this.isSpecial = false; // Reset special state, in case of self-closing special tags\n }\n else if (!isWhitespace(c)) {\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n };\n Tokenizer.prototype.stateInAttributeName = function (c) {\n if (c === CharCodes.Eq || isEndOfTagSection(c)) {\n this.cbs.onattribname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterAttributeName;\n this.stateAfterAttributeName(c);\n }\n };\n Tokenizer.prototype.stateAfterAttributeName = function (c) {\n if (c === CharCodes.Eq) {\n this.state = State.BeforeAttributeValue;\n }\n else if (c === CharCodes.Slash || c === CharCodes.Gt) {\n this.cbs.onattribend(QuoteType.NoValue, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (!isWhitespace(c)) {\n this.cbs.onattribend(QuoteType.NoValue, this.index);\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n };\n Tokenizer.prototype.stateBeforeAttributeValue = function (c) {\n if (c === CharCodes.DoubleQuote) {\n this.state = State.InAttributeValueDq;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.SingleQuote) {\n this.state = State.InAttributeValueSq;\n this.sectionStart = this.index + 1;\n }\n else if (!isWhitespace(c)) {\n this.sectionStart = this.index;\n this.state = State.InAttributeValueNq;\n this.stateInAttributeValueNoQuotes(c); // Reconsume token\n }\n };\n Tokenizer.prototype.handleInAttributeValue = function (c, quote) {\n if (c === quote ||\n (!this.decodeEntities && this.fastForwardTo(quote))) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(quote === CharCodes.DoubleQuote\n ? QuoteType.Double\n : QuoteType.Single, this.index);\n this.state = State.BeforeAttributeName;\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.baseState = this.state;\n this.state = State.BeforeEntity;\n }\n };\n Tokenizer.prototype.stateInAttributeValueDoubleQuotes = function (c) {\n this.handleInAttributeValue(c, CharCodes.DoubleQuote);\n };\n Tokenizer.prototype.stateInAttributeValueSingleQuotes = function (c) {\n this.handleInAttributeValue(c, CharCodes.SingleQuote);\n };\n Tokenizer.prototype.stateInAttributeValueNoQuotes = function (c) {\n if (isWhitespace(c) || c === CharCodes.Gt) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(QuoteType.Unquoted, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.baseState = this.state;\n this.state = State.BeforeEntity;\n }\n };\n Tokenizer.prototype.stateBeforeDeclaration = function (c) {\n if (c === CharCodes.OpeningSquareBracket) {\n this.state = State.CDATASequence;\n this.sequenceIndex = 0;\n }\n else {\n this.state =\n c === CharCodes.Dash\n ? State.BeforeComment\n : State.InDeclaration;\n }\n };\n Tokenizer.prototype.stateInDeclaration = function (c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.ondeclaration(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateInProcessingInstruction = function (c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.onprocessinginstruction(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateBeforeComment = function (c) {\n if (c === CharCodes.Dash) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CommentEnd;\n // Allow short comments (eg. )\n this.sequenceIndex = 2;\n this.sectionStart = this.index + 1;\n }\n else {\n this.state = State.InDeclaration;\n }\n };\n Tokenizer.prototype.stateInSpecialComment = function (c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.oncomment(this.sectionStart, this.index, 0);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateBeforeSpecialS = function (c) {\n var lower = c | 0x20;\n if (lower === Sequences.ScriptEnd[3]) {\n this.startSpecial(Sequences.ScriptEnd, 4);\n }\n else if (lower === Sequences.StyleEnd[3]) {\n this.startSpecial(Sequences.StyleEnd, 4);\n }\n else {\n this.state = State.InTagName;\n this.stateInTagName(c); // Consume the token again\n }\n };\n Tokenizer.prototype.stateBeforeEntity = function (c) {\n // Start excess with 1 to include the '&'\n this.entityExcess = 1;\n this.entityResult = 0;\n if (c === CharCodes.Number) {\n this.state = State.BeforeNumericEntity;\n }\n else if (c === CharCodes.Amp) {\n // We have two `&` characters in a row. Stay in the current state.\n }\n else {\n this.trieIndex = 0;\n this.trieCurrent = this.entityTrie[0];\n this.state = State.InNamedEntity;\n this.stateInNamedEntity(c);\n }\n };\n Tokenizer.prototype.stateInNamedEntity = function (c) {\n this.entityExcess += 1;\n this.trieIndex = (0, decode_js_1.determineBranch)(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c);\n if (this.trieIndex < 0) {\n this.emitNamedEntity();\n this.index--;\n return;\n }\n this.trieCurrent = this.entityTrie[this.trieIndex];\n var masked = this.trieCurrent & decode_js_1.BinTrieFlags.VALUE_LENGTH;\n // If the branch is a value, store it and continue\n if (masked) {\n // The mask is the number of bytes of the value, including the current byte.\n var valueLength = (masked >> 14) - 1;\n // If we have a legacy entity while parsing strictly, just skip the number of bytes\n if (!this.allowLegacyEntity() && c !== CharCodes.Semi) {\n this.trieIndex += valueLength;\n }\n else {\n // Add 1 as we have already incremented the excess\n var entityStart = this.index - this.entityExcess + 1;\n if (entityStart > this.sectionStart) {\n this.emitPartial(this.sectionStart, entityStart);\n }\n // If this is a surrogate pair, consume the next two bytes\n this.entityResult = this.trieIndex;\n this.trieIndex += valueLength;\n this.entityExcess = 0;\n this.sectionStart = this.index + 1;\n if (valueLength === 0) {\n this.emitNamedEntity();\n }\n }\n }\n };\n Tokenizer.prototype.emitNamedEntity = function () {\n this.state = this.baseState;\n if (this.entityResult === 0) {\n return;\n }\n var valueLength = (this.entityTrie[this.entityResult] & decode_js_1.BinTrieFlags.VALUE_LENGTH) >>\n 14;\n switch (valueLength) {\n case 1: {\n this.emitCodePoint(this.entityTrie[this.entityResult] &\n ~decode_js_1.BinTrieFlags.VALUE_LENGTH);\n break;\n }\n case 2: {\n this.emitCodePoint(this.entityTrie[this.entityResult + 1]);\n break;\n }\n case 3: {\n this.emitCodePoint(this.entityTrie[this.entityResult + 1]);\n this.emitCodePoint(this.entityTrie[this.entityResult + 2]);\n }\n }\n };\n Tokenizer.prototype.stateBeforeNumericEntity = function (c) {\n if ((c | 0x20) === CharCodes.LowerX) {\n this.entityExcess++;\n this.state = State.InHexEntity;\n }\n else {\n this.state = State.InNumericEntity;\n this.stateInNumericEntity(c);\n }\n };\n Tokenizer.prototype.emitNumericEntity = function (strict) {\n var entityStart = this.index - this.entityExcess - 1;\n var numberStart = entityStart + 2 + Number(this.state === State.InHexEntity);\n if (numberStart !== this.index) {\n // Emit leading data if any\n if (entityStart > this.sectionStart) {\n this.emitPartial(this.sectionStart, entityStart);\n }\n this.sectionStart = this.index + Number(strict);\n this.emitCodePoint((0, decode_js_1.replaceCodePoint)(this.entityResult));\n }\n this.state = this.baseState;\n };\n Tokenizer.prototype.stateInNumericEntity = function (c) {\n if (c === CharCodes.Semi) {\n this.emitNumericEntity(true);\n }\n else if (isNumber(c)) {\n this.entityResult = this.entityResult * 10 + (c - CharCodes.Zero);\n this.entityExcess++;\n }\n else {\n if (this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n }\n else {\n this.state = this.baseState;\n }\n this.index--;\n }\n };\n Tokenizer.prototype.stateInHexEntity = function (c) {\n if (c === CharCodes.Semi) {\n this.emitNumericEntity(true);\n }\n else if (isNumber(c)) {\n this.entityResult = this.entityResult * 16 + (c - CharCodes.Zero);\n this.entityExcess++;\n }\n else if (isHexDigit(c)) {\n this.entityResult =\n this.entityResult * 16 + ((c | 0x20) - CharCodes.LowerA + 10);\n this.entityExcess++;\n }\n else {\n if (this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n }\n else {\n this.state = this.baseState;\n }\n this.index--;\n }\n };\n Tokenizer.prototype.allowLegacyEntity = function () {\n return (!this.xmlMode &&\n (this.baseState === State.Text ||\n this.baseState === State.InSpecialTag));\n };\n /**\n * Remove data that has already been consumed from the buffer.\n */\n Tokenizer.prototype.cleanup = function () {\n // If we are inside of text or attributes, emit what we already have.\n if (this.running && this.sectionStart !== this.index) {\n if (this.state === State.Text ||\n (this.state === State.InSpecialTag && this.sequenceIndex === 0)) {\n this.cbs.ontext(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n else if (this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueNq) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n }\n };\n Tokenizer.prototype.shouldContinue = function () {\n return this.index < this.buffer.length + this.offset && this.running;\n };\n /**\n * Iterates through the buffer, calling the function corresponding to the current state.\n *\n * States that are more likely to be hit are higher up, as a performance improvement.\n */\n Tokenizer.prototype.parse = function () {\n while (this.shouldContinue()) {\n var c = this.buffer.charCodeAt(this.index - this.offset);\n switch (this.state) {\n case State.Text: {\n this.stateText(c);\n break;\n }\n case State.SpecialStartSequence: {\n this.stateSpecialStartSequence(c);\n break;\n }\n case State.InSpecialTag: {\n this.stateInSpecialTag(c);\n break;\n }\n case State.CDATASequence: {\n this.stateCDATASequence(c);\n break;\n }\n case State.InAttributeValueDq: {\n this.stateInAttributeValueDoubleQuotes(c);\n break;\n }\n case State.InAttributeName: {\n this.stateInAttributeName(c);\n break;\n }\n case State.InCommentLike: {\n this.stateInCommentLike(c);\n break;\n }\n case State.InSpecialComment: {\n this.stateInSpecialComment(c);\n break;\n }\n case State.BeforeAttributeName: {\n this.stateBeforeAttributeName(c);\n break;\n }\n case State.InTagName: {\n this.stateInTagName(c);\n break;\n }\n case State.InClosingTagName: {\n this.stateInClosingTagName(c);\n break;\n }\n case State.BeforeTagName: {\n this.stateBeforeTagName(c);\n break;\n }\n case State.AfterAttributeName: {\n this.stateAfterAttributeName(c);\n break;\n }\n case State.InAttributeValueSq: {\n this.stateInAttributeValueSingleQuotes(c);\n break;\n }\n case State.BeforeAttributeValue: {\n this.stateBeforeAttributeValue(c);\n break;\n }\n case State.BeforeClosingTagName: {\n this.stateBeforeClosingTagName(c);\n break;\n }\n case State.AfterClosingTagName: {\n this.stateAfterClosingTagName(c);\n break;\n }\n case State.BeforeSpecialS: {\n this.stateBeforeSpecialS(c);\n break;\n }\n case State.InAttributeValueNq: {\n this.stateInAttributeValueNoQuotes(c);\n break;\n }\n case State.InSelfClosingTag: {\n this.stateInSelfClosingTag(c);\n break;\n }\n case State.InDeclaration: {\n this.stateInDeclaration(c);\n break;\n }\n case State.BeforeDeclaration: {\n this.stateBeforeDeclaration(c);\n break;\n }\n case State.BeforeComment: {\n this.stateBeforeComment(c);\n break;\n }\n case State.InProcessingInstruction: {\n this.stateInProcessingInstruction(c);\n break;\n }\n case State.InNamedEntity: {\n this.stateInNamedEntity(c);\n break;\n }\n case State.BeforeEntity: {\n this.stateBeforeEntity(c);\n break;\n }\n case State.InHexEntity: {\n this.stateInHexEntity(c);\n break;\n }\n case State.InNumericEntity: {\n this.stateInNumericEntity(c);\n break;\n }\n default: {\n // `this._state === State.BeforeNumericEntity`\n this.stateBeforeNumericEntity(c);\n }\n }\n this.index++;\n }\n this.cleanup();\n };\n Tokenizer.prototype.finish = function () {\n if (this.state === State.InNamedEntity) {\n this.emitNamedEntity();\n }\n // If there is remaining data, emit it in a reasonable way\n if (this.sectionStart < this.index) {\n this.handleTrailingData();\n }\n this.cbs.onend();\n };\n /** Handle any trailing data. */\n Tokenizer.prototype.handleTrailingData = function () {\n var endIndex = this.buffer.length + this.offset;\n if (this.state === State.InCommentLike) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, endIndex, 0);\n }\n else {\n this.cbs.oncomment(this.sectionStart, endIndex, 0);\n }\n }\n else if (this.state === State.InNumericEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InHexEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InTagName ||\n this.state === State.BeforeAttributeName ||\n this.state === State.BeforeAttributeValue ||\n this.state === State.AfterAttributeName ||\n this.state === State.InAttributeName ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueNq ||\n this.state === State.InClosingTagName) {\n /*\n * If we are currently in an opening or closing tag, us not calling the\n * respective callback signals that the tag should be ignored.\n */\n }\n else {\n this.cbs.ontext(this.sectionStart, endIndex);\n }\n };\n Tokenizer.prototype.emitPartial = function (start, endIndex) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n this.cbs.onattribdata(start, endIndex);\n }\n else {\n this.cbs.ontext(start, endIndex);\n }\n };\n Tokenizer.prototype.emitCodePoint = function (cp) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n this.cbs.onattribentity(cp);\n }\n else {\n this.cbs.ontextentity(cp);\n }\n };\n return Tokenizer;\n}());\nexports.default = Tokenizer;\n//# sourceMappingURL=Tokenizer.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DomUtils = exports.parseFeed = exports.getFeed = exports.ElementType = exports.Tokenizer = exports.createDomStream = exports.parseDOM = exports.parseDocument = exports.DefaultHandler = exports.DomHandler = exports.Parser = void 0;\nvar Parser_js_1 = require(\"./Parser.js\");\nvar Parser_js_2 = require(\"./Parser.js\");\nObject.defineProperty(exports, \"Parser\", { enumerable: true, get: function () { return Parser_js_2.Parser; } });\nvar domhandler_1 = require(\"domhandler\");\nvar domhandler_2 = require(\"domhandler\");\nObject.defineProperty(exports, \"DomHandler\", { enumerable: true, get: function () { return domhandler_2.DomHandler; } });\n// Old name for DomHandler\nObject.defineProperty(exports, \"DefaultHandler\", { enumerable: true, get: function () { return domhandler_2.DomHandler; } });\n// Helper methods\n/**\n * Parses the data, returns the resulting document.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM builder.\n */\nfunction parseDocument(data, options) {\n var handler = new domhandler_1.DomHandler(undefined, options);\n new Parser_js_1.Parser(handler, options).end(data);\n return handler.root;\n}\nexports.parseDocument = parseDocument;\n/**\n * Parses data, returns an array of the root nodes.\n *\n * Note that the root nodes still have a `Document` node as their parent.\n * Use `parseDocument` to get the `Document` node instead.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM builder.\n * @deprecated Use `parseDocument` instead.\n */\nfunction parseDOM(data, options) {\n return parseDocument(data, options).children;\n}\nexports.parseDOM = parseDOM;\n/**\n * Creates a parser instance, with an attached DOM handler.\n *\n * @param callback A callback that will be called once parsing has been completed.\n * @param options Optional options for the parser and DOM builder.\n * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM.\n */\nfunction createDomStream(callback, options, elementCallback) {\n var handler = new domhandler_1.DomHandler(callback, options, elementCallback);\n return new Parser_js_1.Parser(handler, options);\n}\nexports.createDomStream = createDomStream;\nvar Tokenizer_js_1 = require(\"./Tokenizer.js\");\nObject.defineProperty(exports, \"Tokenizer\", { enumerable: true, get: function () { return __importDefault(Tokenizer_js_1).default; } });\n/*\n * All of the following exports exist for backwards-compatibility.\n * They should probably be removed eventually.\n */\nexports.ElementType = __importStar(require(\"domelementtype\"));\nvar domutils_1 = require(\"domutils\");\nvar domutils_2 = require(\"domutils\");\nObject.defineProperty(exports, \"getFeed\", { enumerable: true, get: function () { return domutils_2.getFeed; } });\nvar parseFeedDefaultOptions = { xmlMode: true };\n/**\n * Parse a feed.\n *\n * @param feed The feed that should be parsed, as a string.\n * @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`.\n */\nfunction parseFeed(feed, options) {\n if (options === void 0) { options = parseFeedDefaultOptions; }\n return (0, domutils_1.getFeed)(parseDOM(feed, options));\n}\nexports.parseFeed = parseFeed;\nexports.DomUtils = __importStar(require(\"domutils\"));\n//# sourceMappingURL=index.js.map","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/*!\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObject(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nfunction isPlainObject(o) {\n var ctor,prot;\n\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n\nexports.isPlainObject = isPlainObject;\n","const ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n comp = comp.trim().split(/\\s+/).join(' ')\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n options = parseOptions(options)\n\n // Special cases where nothing can possibly be lower\n if (options.includePrerelease &&\n (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {\n return false\n }\n if (!options.includePrerelease &&\n (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {\n return false\n }\n\n // Same direction increasing (> or >=)\n if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {\n return true\n }\n // Same direction decreasing (< or <=)\n if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {\n return true\n }\n // same SemVer and both sides are inclusive (<= or >=)\n if (\n (this.semver.version === comp.semver.version) &&\n this.operator.includes('=') && comp.operator.includes('=')) {\n return true\n }\n // opposite directions less than\n if (cmp(this.semver, '<', comp.semver, options) &&\n this.operator.startsWith('>') && comp.operator.startsWith('<')) {\n return true\n }\n // opposite directions greater than\n if (cmp(this.semver, '>', comp.semver, options) &&\n this.operator.startsWith('<') && comp.operator.startsWith('>')) {\n return true\n }\n return false\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst { safeRe: re, t } = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","const SPACE_CHARACTERS = /\\s+/g\n\n// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.formatted = undefined\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')\n\n // First, split on ||\n this.set = this.raw\n .split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${this.raw}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0) {\n this.set = [first]\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.formatted = undefined\n }\n\n get range () {\n if (this.formatted === undefined) {\n this.formatted = ''\n for (let i = 0; i < this.set.length; i++) {\n if (i > 0) {\n this.formatted += '||'\n }\n const comps = this.set[i]\n for (let k = 0; k < comps.length; k++) {\n if (k > 0) {\n this.formatted += ' '\n }\n this.formatted += comps[k].toString().trim()\n }\n }\n }\n return this.formatted\n }\n\n format () {\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts =\n (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |\n (this.options.loose && FLAG_LOOSE)\n const memoKey = memoOpts + ':' + range\n const cached = cache.get(memoKey)\n if (cached) {\n return cached\n }\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range)\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n debug('tilde trim', range)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n debug('caret trim', range)\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n let rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options)\n return !!comp.match(re[t.COMPARATORLOOSE])\n })\n }\n debug('range list', rangeList)\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const rangeMap = new Map()\n const comparators = rangeList.map(comp => new Comparator(comp, this.options))\n for (const comp of comparators) {\n if (isNullSet(comp)) {\n return [comp]\n }\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('')\n }\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\n\nmodule.exports = Range\n\nconst LRU = require('../internal/lrucache')\nconst cache = new LRU()\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n safeRe: re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace,\n} = require('../internal/re')\nconst { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n// ~0.0.1 --> >=0.0.1 <0.1.0-0\nconst replaceTildes = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceTilde(c, options))\n .join(' ')\n}\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\n// ^0.0.1 --> >=0.0.1 <0.0.2-0\n// ^0.1.0 --> >=0.1.0 <0.2.0-0\nconst replaceCarets = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceCaret(c, options))\n .join(' ')\n}\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp\n .split(/\\s+/)\n .map((c) => replaceXRange(c, options))\n .join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<') {\n pr = '-0'\n }\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp\n .trim()\n .replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp\n .trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n// TODO build?\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return `${from} ${to}`.trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('build compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier, identifierBase) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre': {\n const base = Number(identifierBase) ? 1 : 0\n\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty')\n }\n\n if (this.prerelease.length === 0) {\n this.prerelease = [base]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists')\n }\n this.prerelease.push(base)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base]\n if (identifierBase === false) {\n prerelease = [identifier]\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease\n }\n } else {\n this.prerelease = prerelease\n }\n }\n break\n }\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.raw = this.format()\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`\n }\n return this\n }\n}\n\nmodule.exports = SemVer\n","const parse = require('./parse')\nconst clean = (version, options) => {\n const s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\nmodule.exports = clean\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a === b\n\n case '!==':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]\n let next\n while ((next = coerceRtlRegex.exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n coerceRtlRegex.lastIndex = -1\n }\n\n if (match === null) {\n return null\n }\n\n const major = match[2]\n const minor = match[3] || '0'\n const patch = match[4] || '0'\n const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''\n const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''\n\n return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)\n}\nmodule.exports = coerce\n","const SemVer = require('../classes/semver')\nconst compareBuild = (a, b, loose) => {\n const versionA = new SemVer(a, loose)\n const versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\nmodule.exports = compareBuild\n","const compare = require('./compare')\nconst compareLoose = (a, b) => compare(a, b, true)\nmodule.exports = compareLoose\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const parse = require('./parse.js')\n\nconst diff = (version1, version2) => {\n const v1 = parse(version1, null, true)\n const v2 = parse(version2, null, true)\n const comparison = v1.compare(v2)\n\n if (comparison === 0) {\n return null\n }\n\n const v1Higher = comparison > 0\n const highVersion = v1Higher ? v1 : v2\n const lowVersion = v1Higher ? v2 : v1\n const highHasPre = !!highVersion.prerelease.length\n const lowHasPre = !!lowVersion.prerelease.length\n\n if (lowHasPre && !highHasPre) {\n // Going from prerelease -> no prerelease requires some special casing\n\n // If the low version has only a major, then it will always be a major\n // Some examples:\n // 1.0.0-1 -> 1.0.0\n // 1.0.0-1 -> 1.1.1\n // 1.0.0-1 -> 2.0.0\n if (!lowVersion.patch && !lowVersion.minor) {\n return 'major'\n }\n\n // Otherwise it can be determined by checking the high version\n\n if (highVersion.patch) {\n // anything higher than a patch bump would result in the wrong version\n return 'patch'\n }\n\n if (highVersion.minor) {\n // anything higher than a minor bump would result in the wrong version\n return 'minor'\n }\n\n // bumping major/minor/patch all have same result\n return 'major'\n }\n\n // add the `pre` prefix if we are going to a prerelease version\n const prefix = highHasPre ? 'pre' : ''\n\n if (v1.major !== v2.major) {\n return prefix + 'major'\n }\n\n if (v1.minor !== v2.minor) {\n return prefix + 'minor'\n }\n\n if (v1.patch !== v2.patch) {\n return prefix + 'patch'\n }\n\n // high and low are preleases\n return 'prerelease'\n}\n\nmodule.exports = diff\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const SemVer = require('../classes/semver')\n\nconst inc = (version, release, options, identifier, identifierBase) => {\n if (typeof (options) === 'string') {\n identifierBase = identifier\n identifier = options\n options = undefined\n }\n\n try {\n return new SemVer(\n version instanceof SemVer ? version.version : version,\n options\n ).inc(release, identifier, identifierBase).version\n } catch (er) {\n return null\n }\n}\nmodule.exports = inc\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const SemVer = require('../classes/semver')\nconst major = (a, loose) => new SemVer(a, loose).major\nmodule.exports = major\n","const SemVer = require('../classes/semver')\nconst minor = (a, loose) => new SemVer(a, loose).minor\nmodule.exports = minor\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const SemVer = require('../classes/semver')\nconst parse = (version, options, throwErrors = false) => {\n if (version instanceof SemVer) {\n return version\n }\n try {\n return new SemVer(version, options)\n } catch (er) {\n if (!throwErrors) {\n return null\n }\n throw er\n }\n}\n\nmodule.exports = parse\n","const SemVer = require('../classes/semver')\nconst patch = (a, loose) => new SemVer(a, loose).patch\nmodule.exports = patch\n","const parse = require('./parse')\nconst prerelease = (version, options) => {\n const parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\nmodule.exports = prerelease\n","const compare = require('./compare')\nconst rcompare = (a, b, loose) => compare(b, a, loose)\nmodule.exports = rcompare\n","const compareBuild = require('./compare-build')\nconst rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))\nmodule.exports = rsort\n","const Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","const compareBuild = require('./compare-build')\nconst sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))\nmodule.exports = sort\n","const parse = require('./parse')\nconst valid = (version, options) => {\n const v = parse(version, options)\n return v ? v.version : null\n}\nmodule.exports = valid\n","// just pre-load all the stuff that index.js lazily exports\nconst internalRe = require('./internal/re')\nconst constants = require('./internal/constants')\nconst SemVer = require('./classes/semver')\nconst identifiers = require('./internal/identifiers')\nconst parse = require('./functions/parse')\nconst valid = require('./functions/valid')\nconst clean = require('./functions/clean')\nconst inc = require('./functions/inc')\nconst diff = require('./functions/diff')\nconst major = require('./functions/major')\nconst minor = require('./functions/minor')\nconst patch = require('./functions/patch')\nconst prerelease = require('./functions/prerelease')\nconst compare = require('./functions/compare')\nconst rcompare = require('./functions/rcompare')\nconst compareLoose = require('./functions/compare-loose')\nconst compareBuild = require('./functions/compare-build')\nconst sort = require('./functions/sort')\nconst rsort = require('./functions/rsort')\nconst gt = require('./functions/gt')\nconst lt = require('./functions/lt')\nconst eq = require('./functions/eq')\nconst neq = require('./functions/neq')\nconst gte = require('./functions/gte')\nconst lte = require('./functions/lte')\nconst cmp = require('./functions/cmp')\nconst coerce = require('./functions/coerce')\nconst Comparator = require('./classes/comparator')\nconst Range = require('./classes/range')\nconst satisfies = require('./functions/satisfies')\nconst toComparators = require('./ranges/to-comparators')\nconst maxSatisfying = require('./ranges/max-satisfying')\nconst minSatisfying = require('./ranges/min-satisfying')\nconst minVersion = require('./ranges/min-version')\nconst validRange = require('./ranges/valid')\nconst outside = require('./ranges/outside')\nconst gtr = require('./ranges/gtr')\nconst ltr = require('./ranges/ltr')\nconst intersects = require('./ranges/intersects')\nconst simplifyRange = require('./ranges/simplify')\nconst subset = require('./ranges/subset')\nmodule.exports = {\n parse,\n valid,\n clean,\n inc,\n diff,\n major,\n minor,\n patch,\n prerelease,\n compare,\n rcompare,\n compareLoose,\n compareBuild,\n sort,\n rsort,\n gt,\n lt,\n eq,\n neq,\n gte,\n lte,\n cmp,\n coerce,\n Comparator,\n Range,\n satisfies,\n toComparators,\n maxSatisfying,\n minSatisfying,\n minVersion,\n validRange,\n outside,\n gtr,\n ltr,\n intersects,\n simplifyRange,\n subset,\n SemVer,\n re: internalRe.re,\n src: internalRe.src,\n tokens: internalRe.t,\n SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,\n RELEASE_TYPES: constants.RELEASE_TYPES,\n compareIdentifiers: identifiers.compareIdentifiers,\n rcompareIdentifiers: identifiers.rcompareIdentifiers,\n}\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n/* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\n// Max safe length for a build identifier. The max length minus 6 characters for\n// the shortest version with a build 0.0.0+BUILD.\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6\n\nconst RELEASE_TYPES = [\n 'major',\n 'premajor',\n 'minor',\n 'preminor',\n 'patch',\n 'prepatch',\n 'prerelease',\n]\n\nmodule.exports = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010,\n}\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers,\n}\n","class LRUCache {\n constructor () {\n this.max = 1000\n this.map = new Map()\n }\n\n get (key) {\n const value = this.map.get(key)\n if (value === undefined) {\n return undefined\n } else {\n // Remove the key from the map and add it to the end\n this.map.delete(key)\n this.map.set(key, value)\n return value\n }\n }\n\n delete (key) {\n return this.map.delete(key)\n }\n\n set (key, value) {\n const deleted = this.delete(key)\n\n if (!deleted && value !== undefined) {\n // If cache is full, delete the least recently used item\n if (this.map.size >= this.max) {\n const firstKey = this.map.keys().next().value\n this.delete(firstKey)\n }\n\n this.map.set(key, value)\n }\n\n return this\n }\n}\n\nmodule.exports = LRUCache\n","// parse out just the options we care about\nconst looseOption = Object.freeze({ loose: true })\nconst emptyOpts = Object.freeze({ })\nconst parseOptions = options => {\n if (!options) {\n return emptyOpts\n }\n\n if (typeof options !== 'object') {\n return looseOption\n }\n\n return options\n}\nmodule.exports = parseOptions\n","const {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH,\n} = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst safeRe = exports.safeRe = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst LETTERDASHNUMBER = '[a-zA-Z0-9-]'\n\n// Replace some greedy regex tokens to prevent regex dos issues. These regex are\n// used internally via the safeRe object since all inputs in this library get\n// normalized first to trim and collapse all extra whitespace. The original\n// regexes are exported for userland consumption and lower level usage. A\n// future breaking change could export the safer regex only with a note that\n// all input should have extra whitespace removed.\nconst safeRegexReplacements = [\n ['\\\\s', 1],\n ['\\\\d', MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],\n]\n\nconst makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value\n .split(`${token}*`).join(`${token}{0,${max}}`)\n .split(`${token}+`).join(`${token}{1,${max}}`)\n }\n return value\n}\n\nconst createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value)\n const index = R++\n debug(name, index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '\\\\d+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCEPLAIN', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)\ncreateToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\\\d])`)\ncreateToken('COERCEFULL', src[t.COERCEPLAIN] +\n `(?:${src[t.PRERELEASE]})?` +\n `(?:${src[t.BUILD]})?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\ncreateToken('COERCERTLFULL', src[t.COERCEFULL], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$')\n","// Determine if version is greater than all the versions possible in the range.\nconst outside = require('./outside')\nconst gtr = (version, range, options) => outside(version, range, '>', options)\nmodule.exports = gtr\n","const Range = require('../classes/range')\nconst intersects = (r1, r2, options) => {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2, options)\n}\nmodule.exports = intersects\n","const outside = require('./outside')\n// Determine if version is less than all the versions possible in the range\nconst ltr = (version, range, options) => outside(version, range, '<', options)\nmodule.exports = ltr\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\n\nconst maxSatisfying = (versions, range, options) => {\n let max = null\n let maxSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\nmodule.exports = maxSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst minSatisfying = (versions, range, options) => {\n let min = null\n let minSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\nmodule.exports = minSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst gt = require('../functions/gt')\n\nconst minVersion = (range, loose) => {\n range = new Range(range, loose)\n\n let minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let setMin = null\n comparators.forEach((comparator) => {\n // Clone to avoid manipulating the comparator's semver object.\n const compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!setMin || gt(compver, setMin)) {\n setMin = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error(`Unexpected operation: ${comparator.operator}`)\n }\n })\n if (setMin && (!minver || gt(minver, setMin))) {\n minver = setMin\n }\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\nmodule.exports = minVersion\n","const SemVer = require('../classes/semver')\nconst Comparator = require('../classes/comparator')\nconst { ANY } = Comparator\nconst Range = require('../classes/range')\nconst satisfies = require('../functions/satisfies')\nconst gt = require('../functions/gt')\nconst lt = require('../functions/lt')\nconst lte = require('../functions/lte')\nconst gte = require('../functions/gte')\n\nconst outside = (version, range, hilo, options) => {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n let gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisfies the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let high = null\n let low = null\n\n comparators.forEach((comparator) => {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nmodule.exports = outside\n","// given a set of versions and a range, create a \"simplified\" range\n// that includes the same versions that the original range does\n// If the original range is shorter than the simplified one, return that.\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\nmodule.exports = (versions, range, options) => {\n const set = []\n let first = null\n let prev = null\n const v = versions.sort((a, b) => compare(a, b, options))\n for (const version of v) {\n const included = satisfies(version, range, options)\n if (included) {\n prev = version\n if (!first) {\n first = version\n }\n } else {\n if (prev) {\n set.push([first, prev])\n }\n prev = null\n first = null\n }\n }\n if (first) {\n set.push([first, null])\n }\n\n const ranges = []\n for (const [min, max] of set) {\n if (min === max) {\n ranges.push(min)\n } else if (!max && min === v[0]) {\n ranges.push('*')\n } else if (!max) {\n ranges.push(`>=${min}`)\n } else if (min === v[0]) {\n ranges.push(`<=${max}`)\n } else {\n ranges.push(`${min} - ${max}`)\n }\n }\n const simplified = ranges.join(' || ')\n const original = typeof range.raw === 'string' ? range.raw : String(range)\n return simplified.length < original.length ? simplified : range\n}\n","const Range = require('../classes/range.js')\nconst Comparator = require('../classes/comparator.js')\nconst { ANY } = Comparator\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\n\n// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:\n// - Every simple range `r1, r2, ...` is a null set, OR\n// - Every simple range `r1, r2, ...` which is not a null set is a subset of\n// some `R1, R2, ...`\n//\n// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:\n// - If c is only the ANY comparator\n// - If C is only the ANY comparator, return true\n// - Else if in prerelease mode, return false\n// - else replace c with `[>=0.0.0]`\n// - If C is only the ANY comparator\n// - if in prerelease mode, return true\n// - else replace C with `[>=0.0.0]`\n// - Let EQ be the set of = comparators in c\n// - If EQ is more than one, return true (null set)\n// - Let GT be the highest > or >= comparator in c\n// - Let LT be the lowest < or <= comparator in c\n// - If GT and LT, and GT.semver > LT.semver, return true (null set)\n// - If any C is a = range, and GT or LT are set, return false\n// - If EQ\n// - If GT, and EQ does not satisfy GT, return true (null set)\n// - If LT, and EQ does not satisfy LT, return true (null set)\n// - If EQ satisfies every C, return true\n// - Else return false\n// - If GT\n// - If GT.semver is lower than any > or >= comp in C, return false\n// - If GT is >=, and GT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the GT.semver tuple, return false\n// - If LT\n// - If LT.semver is greater than any < or <= comp in C, return false\n// - If LT is <=, and LT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the LT.semver tuple, return false\n// - Else return true\n\nconst subset = (sub, dom, options = {}) => {\n if (sub === dom) {\n return true\n }\n\n sub = new Range(sub, options)\n dom = new Range(dom, options)\n let sawNonNull = false\n\n OUTER: for (const simpleSub of sub.set) {\n for (const simpleDom of dom.set) {\n const isSub = simpleSubset(simpleSub, simpleDom, options)\n sawNonNull = sawNonNull || isSub !== null\n if (isSub) {\n continue OUTER\n }\n }\n // the null set is a subset of everything, but null simple ranges in\n // a complex range should be ignored. so if we saw a non-null range,\n // then we know this isn't a subset, but if EVERY simple range was null,\n // then it is a subset.\n if (sawNonNull) {\n return false\n }\n }\n return true\n}\n\nconst minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]\nconst minimumVersion = [new Comparator('>=0.0.0')]\n\nconst simpleSubset = (sub, dom, options) => {\n if (sub === dom) {\n return true\n }\n\n if (sub.length === 1 && sub[0].semver === ANY) {\n if (dom.length === 1 && dom[0].semver === ANY) {\n return true\n } else if (options.includePrerelease) {\n sub = minimumVersionWithPreRelease\n } else {\n sub = minimumVersion\n }\n }\n\n if (dom.length === 1 && dom[0].semver === ANY) {\n if (options.includePrerelease) {\n return true\n } else {\n dom = minimumVersion\n }\n }\n\n const eqSet = new Set()\n let gt, lt\n for (const c of sub) {\n if (c.operator === '>' || c.operator === '>=') {\n gt = higherGT(gt, c, options)\n } else if (c.operator === '<' || c.operator === '<=') {\n lt = lowerLT(lt, c, options)\n } else {\n eqSet.add(c.semver)\n }\n }\n\n if (eqSet.size > 1) {\n return null\n }\n\n let gtltComp\n if (gt && lt) {\n gtltComp = compare(gt.semver, lt.semver, options)\n if (gtltComp > 0) {\n return null\n } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {\n return null\n }\n }\n\n // will iterate one or zero times\n for (const eq of eqSet) {\n if (gt && !satisfies(eq, String(gt), options)) {\n return null\n }\n\n if (lt && !satisfies(eq, String(lt), options)) {\n return null\n }\n\n for (const c of dom) {\n if (!satisfies(eq, String(c), options)) {\n return false\n }\n }\n\n return true\n }\n\n let higher, lower\n let hasDomLT, hasDomGT\n // if the subset has a prerelease, we need a comparator in the superset\n // with the same tuple and a prerelease, or it's not a subset\n let needDomLTPre = lt &&\n !options.includePrerelease &&\n lt.semver.prerelease.length ? lt.semver : false\n let needDomGTPre = gt &&\n !options.includePrerelease &&\n gt.semver.prerelease.length ? gt.semver : false\n // exception: <1.2.3-0 is the same as <1.2.3\n if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&\n lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {\n needDomLTPre = false\n }\n\n for (const c of dom) {\n hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='\n hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='\n if (gt) {\n if (needDomGTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomGTPre.major &&\n c.semver.minor === needDomGTPre.minor &&\n c.semver.patch === needDomGTPre.patch) {\n needDomGTPre = false\n }\n }\n if (c.operator === '>' || c.operator === '>=') {\n higher = higherGT(gt, c, options)\n if (higher === c && higher !== gt) {\n return false\n }\n } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {\n return false\n }\n }\n if (lt) {\n if (needDomLTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomLTPre.major &&\n c.semver.minor === needDomLTPre.minor &&\n c.semver.patch === needDomLTPre.patch) {\n needDomLTPre = false\n }\n }\n if (c.operator === '<' || c.operator === '<=') {\n lower = lowerLT(lt, c, options)\n if (lower === c && lower !== lt) {\n return false\n }\n } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {\n return false\n }\n }\n if (!c.operator && (lt || gt) && gtltComp !== 0) {\n return false\n }\n }\n\n // if there was a < or >, and nothing in the dom, then must be false\n // UNLESS it was limited by another range in the other direction.\n // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0\n if (gt && hasDomLT && !lt && gtltComp !== 0) {\n return false\n }\n\n if (lt && hasDomGT && !gt && gtltComp !== 0) {\n return false\n }\n\n // we needed a prerelease range in a specific tuple, but didn't get one\n // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,\n // because it includes prereleases in the 1.2.3 tuple\n if (needDomGTPre || needDomLTPre) {\n return false\n }\n\n return true\n}\n\n// >=1.2.3 is lower than >1.2.3\nconst higherGT = (a, b, options) => {\n if (!a) {\n return b\n }\n const comp = compare(a.semver, b.semver, options)\n return comp > 0 ? a\n : comp < 0 ? b\n : b.operator === '>' && a.operator === '>=' ? b\n : a\n}\n\n// <=1.2.3 is higher than <1.2.3\nconst lowerLT = (a, b, options) => {\n if (!a) {\n return b\n }\n const comp = compare(a.semver, b.semver, options)\n return comp < 0 ? a\n : comp > 0 ? b\n : b.operator === '<' && a.operator === '<=' ? b\n : a\n}\n\nmodule.exports = subset\n","const Range = require('../classes/range')\n\n// Mostly just for testing and legacy API reasons\nconst toComparators = (range, options) =>\n new Range(range, options).set\n .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))\n\nmodule.exports = toComparators\n","const Range = require('../classes/range')\nconst validRange = (range, options) => {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\nmodule.exports = validRange\n","import type { Config } from './config';\nimport type { BinderUrlSet, RepoProviderSpec } from './types';\n\nexport function makeDefaultStorageKey(storagePrefix: string, url: string) {\n const urlObj = new URL(url);\n // ignore the query string and hash\n return `${storagePrefix}-${urlObj.origin + urlObj.pathname}`;\n}\n\nfunction makeDefaultBuildSpec(storagePrefix: string, binderUrl: string, stub: string) {\n const build = `${binderUrl}/build/${stub}`;\n const launch = `${binderUrl}/v2/${stub}`;\n\n return {\n build,\n launch,\n storageKey: makeDefaultStorageKey(storagePrefix, build),\n };\n}\n\n/**\n * Make a binder url for git providers\n *\n * - trim trailing or leading '/' on repo\n * - trailing / on binderUrl\n * - convert to URL acceptable string. Required for git\n *\n * @param opts BinderOptions\n * @returns a binder compatible url\n */\nfunction makeGitUrls(config: Config) {\n if (!config.binder.repo) throw Error('repo is required for git provider');\n const { repo, binderUrl, ref } = config.binder;\n const encodedRepo = encodeURIComponent(repo.replace(/(^\\/)|(\\/?$)/g, ''));\n const base = binderUrl?.replace(/(\\/?$)/g, '');\n const stub = `git/${encodedRepo}/${ref ?? 'HEAD'}`;\n return makeDefaultBuildSpec(config.savedSessions.storagePrefix, base, stub);\n}\n\n/**\n * Make a binder url for gitlab providers\n *\n * - trim gitlab.com from repo\n * - trim trailing or leading '/' on repo\n * - convert to URL acceptable string. Required for gitlab\n * - trailing / on binderUrl\n *\n * @param opts BinderOptions\n * @returns a binder compatible url\n */\nfunction makeGitLabUrl(config: Config) {\n if (!config.binder.repo) throw Error('repo is required for gitlab provider');\n const binderUrl = config.binder.binderUrl?.replace(/(\\/?$)/g, '');\n const repo = encodeURIComponent(\n (config.binder.repo ?? '')\n .replace(/^(https?:\\/\\/)?gitlab.com\\//, '')\n .replace(/(^\\/)|(\\/?$)/g, ''),\n );\n const stub = `gl/${repo}/${config.binder.ref ?? 'HEAD'}`;\n return makeDefaultBuildSpec(config.savedSessions.storagePrefix, binderUrl, stub);\n}\n\n/**\n * Make a binder url for gitlab providers\n *\n * - trim github.com from repo\n * - trim trailing or leading '/' on repo\n * - convert to URL acceptable string. Required for gitlab\n * - trailing / on binderUrl\n *\n * @param opts BinderOptions\n * @returns a binder compatible url\n */\nfunction makeGitHubUrl(config: Config) {\n if (!config.binder.repo) throw Error('repo is required for github provider');\n const repo = config.binder.repo\n .replace(/^(https?:\\/\\/)?github.com\\//, '')\n .replace(/(^\\/)|(\\/?$)/g, '');\n const binderUrl = config.binder.binderUrl?.replace(/(\\/?$)/g, '');\n const stub = `gh/${repo}/${config.binder.ref ?? 'HEAD'}`;\n\n return makeDefaultBuildSpec(config.savedSessions.storagePrefix, binderUrl, stub);\n}\n\nfunction makeGistUrl(config: Config) {\n if (!config.binder.repo) throw Error('repo is required for gist provider');\n const repo = config.binder.repo\n .replace(/^(https?:\\/\\/)?github.com\\//, '')\n .replace(/(^\\/)|(\\/?$)/g, '');\n const binderUrl = config.binder.binderUrl?.replace(/(\\/?$)/g, '');\n const stub = `gist/${repo}/${config.binder.ref ?? 'HEAD'}`;\n\n return makeDefaultBuildSpec(config.savedSessions.storagePrefix, binderUrl, stub);\n}\n\nexport const GITHUB_SPEC: RepoProviderSpec = {\n name: 'github',\n makeUrls: makeGitHubUrl,\n};\n\nexport const GITLAB_SPEC: RepoProviderSpec = {\n name: 'gitlab',\n makeUrls: makeGitLabUrl,\n};\n\nexport const GIT_SPEC: RepoProviderSpec = {\n name: 'git',\n makeUrls: makeGitUrls,\n};\n\nexport const GIST_SPEC: RepoProviderSpec = {\n name: 'gist',\n makeUrls: makeGistUrl,\n};\n\nexport const WELL_KNOWN_REPO_PROVIDERS = [GITHUB_SPEC, GITLAB_SPEC, GIT_SPEC, GIST_SPEC];\n\n/**\n * Make a binder url for both well known or custom providers\n *\n * Custom providers are supported by passing in an array of CustomRepoProviderSpecs.\n *\n */\nexport function makeBinderUrls(config: Config, repoProviders: RepoProviderSpec[]): BinderUrlSet {\n const providerMap: Record =\n repoProviders.reduce((obj, spec) => ({ ...obj, [spec.name]: spec }), {}) ?? {};\n\n const provider = config.binder.repoProvider ?? 'github';\n if (!Object.keys(providerMap).includes(provider))\n throw Error(`Unknown provider ${config.binder.repoProvider}`);\n\n if (!providerMap[provider].makeUrls) throw Error(`No makeUrls function for ${provider}`);\n\n return providerMap[provider].makeUrls(config);\n}\n","import type ThebeCodeCell from './cell';\nimport type ThebeNotebook from './notebook';\nimport type ThebeServer from './server';\nimport type ThebeSession from './session';\nimport type { IError } from '@jupyterlab/nbformat';\n\n// value of some of these enums are not arbitrary\n// but relate to events sent from the server via the\n// event stream\nexport enum ServerStatusEvent {\n 'launching' = 'launching',\n 'ready' = 'server-ready',\n 'closed' = 'closed',\n 'unknown' = 'unknown',\n}\n\nexport enum SessionStatusEvent {\n 'starting' = 'starting',\n 'ready' = 'ready',\n 'shutdown' = 'shutdown',\n}\n\nexport enum KernelStatusEvent {\n 'starting' = 'starting',\n 'ready' = 'ready',\n 'shutdown' = 'shutdown',\n}\n\nexport enum NotebookStatusEvent {\n 'attached' = 'attached',\n 'detached' = 'detached',\n 'executing' = 'executing',\n 'idle' = 'idle',\n}\n\nexport enum CellStatusEvent {\n 'attached' = 'attached',\n 'detached' = 'detached',\n 'executing' = 'executing',\n 'idle' = 'idle',\n}\n\nexport enum EventSubject {\n 'server' = 'server',\n 'session' = 'session',\n 'kernel' = 'kernel',\n 'notebook' = 'notebook',\n 'cell' = 'cell',\n}\n\n// TODO improve typing around status's\nexport enum ErrorStatusEvent {\n 'warning' = 'warning',\n 'executeError' = 'execute-error',\n 'error' = 'error',\n 'server' = 'server-error',\n 'session' = 'session-error',\n}\n\nexport function errorToMessage(json: IError): string {\n if (!json.traceback) {\n return json.evalue;\n } else if (Array.isArray(json.traceback)) {\n return `${json.evalue}\\n${(json.traceback ?? []).join('')}`;\n } else {\n return `${json.evalue}\\n${JSON.stringify(json.traceback)}`;\n }\n}\n\nexport enum ThebeEventType {\n 'status' = 'status',\n 'error' = 'error',\n}\n\nexport type EventObject = ThebeServer | ThebeSession | ThebeNotebook | ThebeCodeCell;\n\nexport type StatusEvent =\n | ServerStatusEvent\n | SessionStatusEvent\n | NotebookStatusEvent\n | CellStatusEvent\n | KernelStatusEvent\n | ErrorStatusEvent;\n\nexport interface ThebeEventData {\n subject?: EventSubject;\n id?: string;\n status?: StatusEvent;\n message: string;\n object?: EventObject;\n}\n\nexport type ThebeEventCb = (event: string, data: ThebeEventData) => void;\n\nexport class ThebeEvents {\n listeners: Record>;\n\n constructor() {\n this.listeners = {};\n }\n\n _ensureMap(event: string) {\n if (!(event in this.listeners)) this.listeners[event] = new Map();\n }\n\n trigger(event: ThebeEventType, evt: ThebeEventData) {\n if (!(event in this.listeners)) return;\n this.listeners[event].forEach(({ unbind }, cb) => {\n cb(event, evt);\n if (unbind) this.listeners[event].delete(cb);\n });\n }\n\n on(event: ThebeEventType, cb: ThebeEventCb) {\n this._ensureMap(event);\n this.listeners[event].set(cb, { unbind: false });\n return () => this.off(event, cb);\n }\n\n one(event: ThebeEventType, cb: ThebeEventCb) {\n this._ensureMap(event);\n this.listeners[event].set(cb, { unbind: true });\n return () => this.off(event, cb);\n }\n\n off(event: ThebeEventType, cb: ThebeEventCb) {\n if (!(event in this.listeners)) return;\n this.listeners[event].delete(cb);\n }\n}\n","import { KernelAPI, ServerConnection } from '@jupyterlab/services';\nimport type { SavedSessionInfo, SavedSessionOptions, ServerSettings } from './types';\n\nexport function removeServerInfo(storageKey: string) {\n window.localStorage.removeItem(storageKey);\n}\n\nexport function updateLastUsedTimestamp(storageKey: string) {\n const saved = window.localStorage.getItem(storageKey);\n if (!saved) return;\n const obj = JSON.parse(saved);\n window.localStorage.setItem(storageKey, JSON.stringify({ ...obj, lastUsed: new Date() }));\n}\n\nexport function saveServerInfo(\n storageKey: string,\n id: string,\n serverSettings: Required,\n) {\n try {\n // save the current connection url+token to reuse later\n const { baseUrl, token, wsUrl } = serverSettings;\n window.localStorage.setItem(\n storageKey,\n JSON.stringify({\n id,\n baseUrl,\n token,\n wsUrl,\n lastUsed: new Date(),\n }),\n );\n } catch (e) {\n // storage quota full, gently ignore nonfatal error\n console.warn(\"Couldn't save thebe binder connection info to local storage\", e);\n }\n}\n\nexport async function getExistingServer(\n savedSessionOptions: Required,\n storageKey: string,\n): Promise {\n if (!savedSessionOptions.enabled) return null;\n const storedInfoJSON = window.localStorage.getItem(storageKey);\n if (storedInfoJSON == null) {\n console.debug('thebe:getExistingServer No session saved in ', storageKey);\n return null;\n }\n\n console.debug('thebe:getExistingServer Saved binder session found');\n const existingSettings = JSON.parse(storedInfoJSON ?? '') as SavedSessionInfo;\n const lastUsed = new Date(existingSettings.lastUsed);\n const now = new Date();\n const ageSeconds = (now.getTime() - lastUsed.getTime()) / 1000;\n if (ageSeconds > savedSessionOptions.maxAge) {\n console.debug(\n `thebe:getExistingServer Not using expired binder session for ${existingSettings.baseUrl} from ${lastUsed}`,\n );\n window.localStorage.removeItem(storageKey);\n return null;\n }\n\n try {\n await KernelAPI.listRunning(ServerConnection.makeSettings(existingSettings));\n } catch (err) {\n console.debug(\n 'thebe:getExistingServer Saved binder connection appears to be invalid, requesting new session',\n err,\n );\n window.localStorage.removeItem(storageKey);\n return null;\n }\n\n // refresh lastUsed timestamp in stored info\n updateLastUsedTimestamp(storageKey);\n console.debug(\n `thebe:getExistingServer Saved binder session is valid and will be reused ${existingSettings.baseUrl}`,\n );\n\n return existingSettings;\n}\n\n/**\n * Remove all saved sessions items from local storage based on the storagePrefix provided.\n * The appropriate (default) storage prefix will be available in the SavedSessionOptions object\n * in the Config object.\n *\n * @param storagePrefix\n */\nexport function clearAllSavedSessions(storagePrefix = 'thebe-binder') {\n const keysToRemove: string[] = [];\n for (let i = 0; i < window.localStorage.length; i++) {\n const key = window.localStorage.key(i);\n if (key?.startsWith(storagePrefix)) {\n keysToRemove.push(key);\n }\n }\n console.debug(\n `thebe:clearAllSavedSessions - removing ${keysToRemove.length} saved sessions`,\n keysToRemove.join(','),\n );\n keysToRemove.forEach((key) => window.localStorage.removeItem(key));\n}\n\n/**\n * Remove all saved sessions items from local storage based on the storagePrefix provided.\n * The appropriate (default) storage prefix will be available in the SavedSessionOptions object\n * in the Config object.\n *\n * @param storagePrefix\n * @param url\n */\nexport function clearSavedSession(storageKey: string) {\n console.debug(`thebe:clearSavedSession - removing ${storageKey}`);\n window.localStorage.removeItem(storageKey);\n}\n","import { urlAlphabet } from './url-alphabet/index.js'\nlet random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nlet customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nlet customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\nlet nanoid = (size = 21) =>\n crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {\n byte &= 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte > 62) {\n id += '-'\n } else {\n id += '_'\n }\n return id\n }, '')\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","import { customAlphabet } from 'nanoid';\nimport { WIDGET_MIMETYPE } from './manager';\nimport type * as nbformat from '@jupyterlab/nbformat';\n\nconst nanoid = customAlphabet('1234567890abcdef', 8);\n\n/**\n * Creates a compact random id for use in runtime objects\n *\n * @returns string\n */\nexport function shortId() {\n return nanoid();\n}\n\nexport function ensureString(maybeString: string[] | string): string {\n if (Array.isArray(maybeString)) return maybeString.join('\\n');\n return maybeString;\n}\n\nexport function isMimeBundle({ output_type }: nbformat.IOutput) {\n return output_type === 'display_data' || output_type === 'execute_result';\n}\n\nexport function placeholder(plainText?: string) {\n return `\n
\n
\n
ipywidgets - a Jupyter kernel connection is required to fully display this output.
\n ${plainText && `
${plainText}
`}\n
\n`;\n}\n\nexport function stripWidgets(\n outputs: nbformat.IOutput[],\n hideWidgets = true,\n placeholderFn: (plainText?: string) => string = placeholder,\n) {\n return outputs.map((output: nbformat.IOutput) => {\n if (!isMimeBundle(output)) return output;\n const { [WIDGET_MIMETYPE]: widgets, ...others } = output.data as nbformat.IMimeBundle;\n if (!widgets) return output;\n\n let data = output.data;\n if (hideWidgets) data = { ...others };\n\n if (placeholderFn && !('text/html' in (data as nbformat.IMimeBundle)))\n // if there is not already an html bundle, add a placeholder to hide the plain/text field\n (data as nbformat.IMimeBundle)['text/html'] = placeholderFn(\n ensureString((data as nbformat.IMimeBundle)['text/plain'] as string | string[]),\n );\n\n const stripped = {\n ...output,\n data,\n };\n return stripped;\n });\n}\n","/**\n * Inspired by https://github.com/jupyterlab/jupyterlab-plugin-playground/blob/main/src/requirejs.ts\n */\n\nconst REQUIREJS_CDN_URL = 'https://cdn.jsdelivr.net/npm/';\nconst REQUIREJS_URL = 'https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js';\n\nexport interface IRequireJS {\n readonly require: Require;\n readonly define: RequireDefine;\n}\n\nasync function fetchAndLoadInFrame(baseUrl: string): Promise {\n if (typeof document === 'undefined')\n throw new Error('Cannot load requirejs outside of the browser');\n\n const res = await fetch(REQUIREJS_URL);\n if (!res.ok) {\n throw new Error(`Could not fetch requirejs ${res.status} ${res.statusText}`);\n }\n\n const requireJsSource = await res.text();\n\n return new Promise((resolve, reject) => {\n const iframe = document.createElement('iframe');\n iframe.style.display = 'none';\n iframe.onload = () => {\n const contentWindow = iframe.contentWindow;\n if (!contentWindow) return reject('Cannot load in isolated: no contentWindow, origin error?');\n\n contentWindow.window.eval(requireJsSource);\n const requirejs: IRequireJS = {\n require: (contentWindow.window as any).require,\n define: (contentWindow.window as any).define,\n };\n if (!requirejs.require || !requirejs.define)\n return reject(\n 'Require.js loading did not result in `require` and `define` objects attachment to window',\n );\n\n requirejs.require.config({ baseUrl });\n\n resolve(requirejs);\n iframe.onload = null;\n };\n document.body.appendChild(iframe);\n });\n}\n\nexport class RequireJsLoader {\n requested: boolean;\n readonly baseUrl: string;\n readonly ready: Promise;\n requirejs?: IRequireJS;\n private resolveFn: (value: IRequireJS | PromiseLike) => void;\n\n constructor(baseUrl?: string) {\n this.baseUrl = baseUrl ?? REQUIREJS_CDN_URL;\n this.requested = false;\n this.resolveFn = () => ({});\n this.ready = new Promise((resolve) => (this.resolveFn = resolve));\n }\n\n async load(postLoadFn?: (require: Require, define: RequireDefine) => Promise | void) {\n if (!this.requested) {\n this.requested = true;\n this.requirejs = await fetchAndLoadInFrame(this.baseUrl);\n await postLoadFn?.(this.requirejs.require, this.requirejs.define);\n this.resolveFn(this.requirejs);\n }\n return this.ready;\n }\n}\n","import type { IRequireJS } from './requireJsLoader';\n\nconst cdn = 'https://cdn.jsdelivr.net/npm/';\n\n/**\n * Load a package using requirejs and return a promise\n */\nfunction requirePromise(requirejs: IRequireJS, moduleName: string) {\n return new Promise((resolve, reject) => requirejs.require([`${moduleName}`], resolve, reject));\n}\n\n/**\n * The URL structure is /npm/package@version/file.js\n */\nfunction moduleNameToCDNUrl(moduleName: string, moduleVersion: string) {\n let packageName = moduleName;\n let fileName = 'index'; // default filename\n // if a '/' is present, like 'foo/bar', packageName is changed to 'foo', and path to 'bar'\n // We first find the first '/'\n let index = moduleName.indexOf('/');\n if (index !== -1 && moduleName[0] === '@') {\n // if we have a namespace, it's a different story\n // @foo/bar/baz should translate to @foo/bar and baz\n // so we find the 2nd '/'\n index = moduleName.indexOf('/', index + 1);\n }\n if (index !== -1) {\n fileName = moduleName.substr(index + 1);\n packageName = moduleName.substr(0, index);\n }\n return `${cdn}${packageName}@${moduleVersion}/dist/${fileName}`;\n}\n\nasync function requireFromCDN(requirejs: IRequireJS, moduleName: string, moduleVersion: string) {\n const url = moduleNameToCDNUrl(moduleName, moduleVersion);\n const conf: { paths: { [key: string]: string } } = { paths: {} };\n conf.paths[moduleName] = url;\n requirejs.require.config(conf);\n\n try {\n // note: await needed here for try/catch behaviour\n const module = await requirePromise(requirejs, moduleName);\n return module;\n } catch (err: any) {\n console.error(`thebe:loader requirejs error on cdn require`, err);\n throw err;\n }\n}\n\n/**\n * Load an amd module locally and fall back to specified CDN if unavailable.\n *\n * @param moduleName The name of the module to load..\n * @param version The semver range for the module, if loaded from a CDN.\n *\n * By default, the CDN service used is cdn.jsdelivr.net. However, this default can be\n * overridden by specifying another URL via the HTML attribute\n * \"data-jupyter-widgets-cdn\" on a script tag of the page.\n *\n * The semver range is only used with the CDN.\n */\nexport async function requireLoader(\n requirejs: IRequireJS,\n moduleName: string,\n moduleVersion: string,\n useCDNOnly = false,\n): Promise {\n console.debug(`thebe:loader loading ${moduleName}@${moduleVersion}`);\n if (useCDNOnly) {\n return requireFromCDN(requirejs, moduleName, moduleVersion);\n } else {\n if (requirejs.require.defined(moduleName)) {\n return requirePromise(requirejs, moduleName);\n }\n console.debug(`thebe:loader falling back to ${cdn} for ${moduleName}@${moduleVersion}`);\n return requireFromCDN(requirejs, moduleName, moduleVersion);\n }\n}\n","import type { IRenderMimeRegistry } from '@jupyterlab/rendermime';\nimport type { Widget } from '@lumino/widgets';\n\nimport * as LuminoWidget from '@lumino/widgets';\nimport { MessageLoop } from '@lumino/messaging';\n\nimport { KernelWidgetManager, WidgetRenderer, output } from '@jupyter-widgets/jupyterlab-manager';\n\nexport const WIDGET_MIMETYPE = 'application/vnd.jupyter.widget-view+json';\n\nimport * as base from '@jupyter-widgets/base';\nimport * as controls from '@jupyter-widgets/controls';\nimport { shortId } from './utils';\nimport { RequireJsLoader } from './requireJsLoader';\nimport { requireLoader } from './loader';\nimport type { Kernel } from '@jupyterlab/services';\n\n/**\n * A Widget Manager class for Thebe using the context-free KernelWidgetManager from\n * the JupyterLab Manager and inspierd by the implementation in Voila here:\n * https://github.dev/voila-dashboards/voila/blob/main/packages/voila/src/manager.ts\n *\n */\nexport class ThebeManager extends KernelWidgetManager {\n id: string;\n _loader: RequireJsLoader;\n\n constructor(kernel: Kernel.IKernelConnection, rendermime: IRenderMimeRegistry) {\n super(kernel, rendermime);\n\n this.id = shortId();\n /** ensure this registry always gets the widget renderer.\n * This is essential for cases where widgets are rendered heirarchically\n */\n this.addWidgetFactories();\n\n this._registerWidgets();\n this._loader = new RequireJsLoader();\n }\n\n addWidgetFactories() {\n this.rendermime.addFactory(\n {\n safe: false,\n mimeTypes: [WIDGET_MIMETYPE],\n createRenderer: (options) => new WidgetRenderer(options, this as any),\n },\n 1,\n );\n }\n\n removeWidgetFactories() {\n this.rendermime.removeMimeType(WIDGET_MIMETYPE);\n }\n\n /**\n * TODO implement a reasonable method for thebe-core that can load serialized widget state\n * see: https://github.dev/voila-dashboards/voila/blob/7090eb3e30c0c4aa25c2b7d5d2d45e8de1333b3b/packages/voila/src/manager.ts#L52\n *\n */\n async build_widgets(): Promise {\n throw new Error('ThebeManager:build_widgets not implmented');\n }\n\n async display_view(msg: any, view: any, options: any): Promise {\n if (options.el) {\n LuminoWidget.Widget.attach(view.luminoWidget, options.el);\n }\n if (view.el) {\n view.el.setAttribute('data-thebe-jupyter-widget', '');\n view.el.addEventListener('jupyterWidgetResize', () => {\n MessageLoop.postMessage(view.luminoWidget, LuminoWidget.Widget.ResizeMessage.UnknownSize);\n });\n }\n return view.luminoWidget;\n }\n\n async loadClass(\n className: string,\n moduleName: string,\n moduleVersion: string,\n ): Promise {\n if (!this._loader.requested) {\n console.debug(`thebe:manager:loadClass initial requirejs load ${this.id}`);\n this._loader.load((require, define) => {\n define('@jupyter-widgets/base', base as any);\n define('@jupyter-widgets/controls', controls as any);\n define('@jupyter-widgets/output', output as any);\n });\n }\n\n console.debug(`thebe:manager:loadClass ${moduleName}@${moduleVersion}`);\n const rjs = await this._loader.ready;\n\n if (\n moduleName === '@jupyter-widgets/base' ||\n moduleName === '@jupyter-widgets/controls' ||\n moduleName === '@jupyter-widgets/output'\n ) {\n return super.loadClass(className, moduleName, moduleVersion);\n } else {\n let mod;\n try {\n mod = await requireLoader(rjs, moduleName, moduleVersion);\n } catch (err) {\n console.error(`thebe:manager:loadClass loader error`, err);\n throw err;\n }\n if (mod[className]) {\n return mod[className];\n } else {\n console.error(\n `thebe:manager:loadClass ${className} not found in module ${moduleName}@${moduleVersion}`,\n );\n throw new Error(`Class ${className} not found in module ${moduleName}@${moduleVersion}`);\n }\n }\n }\n\n private _registerWidgets() {\n this.register({\n name: '@jupyter-widgets/base',\n version: base.JUPYTER_WIDGETS_VERSION,\n exports: base as unknown as base.ExportData, // TODO improve typing\n });\n this.register({\n name: '@jupyter-widgets/controls',\n version: controls.JUPYTER_CONTROLS_VERSION,\n exports: controls as unknown as base.ExportData, // TODO improve typing\n });\n this.register({\n name: '@jupyter-widgets/output',\n version: output.OUTPUT_WIDGET_VERSION,\n exports: output as any,\n });\n }\n}\n","import type { Config } from './config';\nimport type { EventObject, EventSubject, StatusEvent, ErrorStatusEvent } from './events';\nimport { ThebeEventType } from './events';\n\nexport class EventEmitter {\n private _id: string;\n private _config: Config;\n private _subject: EventSubject;\n private _object: EventObject;\n\n constructor(id: string, config: Config, subject: EventSubject, object: EventObject) {\n this._id = id;\n this._config = config;\n this._subject = subject;\n this._object = object;\n }\n\n triggerStatus({ status, message }: { status: StatusEvent; message: string }) {\n console.debug(`${status} ${message}`);\n this._config.events.trigger(ThebeEventType.status, {\n subject: this._subject,\n id: this._id,\n object: this._object,\n status,\n message,\n });\n }\n\n triggerError({ status, message }: { status: ErrorStatusEvent; message: string }) {\n console.debug(`Error [${this._subject}][${this._id}] ${message}`);\n\n this._config.events.trigger(ThebeEventType.error, {\n subject: this._subject,\n id: this._id,\n object: this._object,\n status,\n message,\n });\n }\n}\n","import type { ISessionConnection } from '@jupyterlab/services/lib/session/session';\nimport { ErrorStatusEvent, EventSubject, SessionStatusEvent } from './events';\nimport { ThebeManager } from './manager';\nimport type ThebeServer from './server';\nimport { EventEmitter } from './emitter';\nimport type { IRenderMimeRegistry } from '@jupyterlab/rendermime';\n\nclass ThebeSession {\n readonly server: ThebeServer;\n readonly manager: ThebeManager;\n // see https://github.dev/jupyterlab/jupyterlab/blob/d48e0c04efb786561137fb20773fc15788507f0a/packages/logconsole/src/widget.ts line 43\n private connection: ISessionConnection;\n private events: EventEmitter;\n\n constructor(\n server: ThebeServer,\n connection: ISessionConnection,\n rendermime: IRenderMimeRegistry,\n ) {\n this.server = server;\n this.connection = connection;\n this.events = new EventEmitter(this.connection.id, server.config, EventSubject.session, this);\n\n if (this.connection.kernel == null) throw Error('ThebeSession - kernel is null');\n this.manager = new ThebeManager(this.connection.kernel, rendermime);\n\n this.connection.statusChanged.connect((_, s) => {\n // 'unknown' | 'starting' | 'idle' | 'busy' | 'terminating' | 'restarting' | 'autorestarting' | 'dead'\n let status;\n switch (s) {\n case 'starting':\n case 'restarting':\n case 'autorestarting':\n status = SessionStatusEvent.starting;\n break;\n case 'idle':\n case 'busy':\n status = SessionStatusEvent.ready;\n break;\n case 'terminating':\n case 'dead':\n default:\n status = SessionStatusEvent.shutdown;\n break;\n }\n\n this.events.triggerStatus({\n status,\n message: `kernel ${this.connection.name} status changed to ${status}[${s}]`,\n });\n if (s === 'dead') {\n this.events.triggerError({\n status: ErrorStatusEvent.session,\n message: `kernel ${this.connection.name} is dead`,\n });\n this.dispose();\n }\n });\n\n this.connection.disposed.connect(() => {\n this.events.triggerStatus({\n status: SessionStatusEvent.shutdown,\n message: `kernel ${this.connection.name} disposed`,\n });\n });\n\n this.events.triggerStatus({\n status: SessionStatusEvent.ready,\n message: `ThebeSession created, kernel '${this.connection.kernel?.name}' available`,\n });\n }\n\n get id() {\n return this.connection.id;\n }\n\n get kernel() {\n return this.connection?.kernel;\n }\n\n get path() {\n return this.connection.path;\n }\n\n get name() {\n return this.connection.name;\n }\n\n async restart() {\n console.debug(`requesting restart for kernel ${this.id}`);\n const p = this.connection.kernel?.restart();\n\n this.events.triggerStatus({\n status: SessionStatusEvent.starting,\n message: `Kernel restart requested`,\n });\n\n await p;\n\n this.events.triggerStatus({\n status: SessionStatusEvent.ready,\n message: `session restarted, kernel '${this.connection.kernel?.name}' available`,\n });\n }\n\n async shutdown() {\n if (this.connection.isDisposed) return;\n await this.connection.shutdown();\n this.events.triggerStatus({\n status: SessionStatusEvent.shutdown,\n message: `session ${this.name}`,\n });\n this.dispose();\n }\n\n dispose() {\n if (!this.connection.isDisposed) this.connection.dispose();\n }\n}\n\nexport default ThebeSession;\n","import type {\n BinderUrlSet,\n KernelOptions,\n RepoProviderSpec,\n RestAPIContentsResponse,\n ServerRestAPI,\n ServerRuntime,\n ServerSettings,\n SessionIModel,\n} from './types';\nimport type { Config } from './config';\nimport type { ServiceManager, Session } from '@jupyterlab/services';\nimport type { LiteServerConfig } from 'thebe-lite';\nimport type { IRenderMimeRegistry } from '@jupyterlab/rendermime';\nimport type { StatusEvent } from './events';\nimport { WELL_KNOWN_REPO_PROVIDERS, makeBinderUrls } from './url';\nimport { getExistingServer, saveServerInfo } from './sessions';\nimport {\n KernelManager,\n KernelSpecAPI,\n ServerConnection,\n SessionManager,\n} from '@jupyterlab/services';\nimport ThebeSession from './session';\nimport { shortId } from './utils';\nimport { ServerStatusEvent, EventSubject, ErrorStatusEvent } from './events';\nimport { EventEmitter } from './emitter';\n\nasync function responseToJson(res: Response) {\n if (!res.ok) throw Error(`${res.status} - ${res.statusText}`);\n const json = await res.json();\n return json as RestAPIContentsResponse;\n}\n\nfunction errorAsString(errorLike: any): string {\n if (typeof errorLike === 'string') return errorLike;\n if (errorLike.message) return errorLike.message;\n if (errorLike.status && errorLike.statusText)\n return `${errorLike.status} - ${errorLike.statusText}`;\n return JSON.stringify(errorLike);\n}\n\nclass ThebeServer implements ServerRuntime, ServerRestAPI {\n readonly id: string;\n readonly config: Config;\n readonly ready: Promise;\n sessionManager?: Session.IManager;\n serviceManager?: ServiceManager; // jlite only\n repoProviders?: RepoProviderSpec[];\n binderUrls?: BinderUrlSet;\n userServerUrl?: string;\n private resolveReadyFn?: (value: ThebeServer | PromiseLike) => void;\n private rejectReadyFn?: (reason?: any) => void;\n private _isDisposed: boolean;\n private events: EventEmitter;\n\n constructor(config: Config) {\n this.id = shortId();\n this.config = config;\n this.events = new EventEmitter(this.id, config, EventSubject.server, this);\n this.ready = new Promise((resolve, reject) => {\n this.resolveReadyFn = resolve;\n this.rejectReadyFn = reject;\n });\n this._isDisposed = false;\n }\n\n get isBinder(): boolean {\n return !!this.binderUrls;\n }\n\n get isReady(): boolean {\n return this.sessionManager?.isReady ?? false;\n }\n\n get isDisposed(): boolean {\n return this._isDisposed;\n }\n\n get settings() {\n return this.sessionManager?.serverSettings;\n }\n\n async shutdownSession(id: string) {\n return this.sessionManager?.shutdown(id);\n }\n\n async shutdownAllSessions() {\n return this.sessionManager?.shutdownAll();\n }\n\n async check(): Promise {\n const resp = await ThebeServer.status(\n this.sessionManager?.serverSettings ?? this.config.serverSettings,\n );\n return resp.ok;\n }\n\n dispose() {\n if (this._isDisposed) return;\n if (!this.serviceManager?.isDisposed) this.serviceManager?.dispose();\n if (!this.sessionManager?.isDisposed) this.sessionManager?.dispose();\n\n // Implementing the flag at this level as\n this._isDisposed = true;\n }\n\n async startNewSession(\n rendermime: IRenderMimeRegistry,\n kernelOptions?: KernelOptions,\n ): Promise {\n await this.ready;\n\n if (!this.sessionManager) {\n throw Error('Requesting session from a server, with no SessionManager available');\n }\n\n await this.sessionManager.ready;\n\n // name is assumed to be a non empty string but is otherwise not required\n // if a notebook name has been supplied on the path, use that otherwise use a default\n // https://jupyterlab.readthedocs.io/en/3.4.x/api/modules/services.session.html#isessionoptions\n let path = kernelOptions?.path ?? this.config.kernels.path;\n let name = 'thebe.ipynb';\n const match = path.match(/\\/*([a-zA-Z0-9-]+.ipynb)$/);\n if (match) {\n name = match[1];\n }\n\n const kernelName = kernelOptions?.kernelName ?? this.config.kernels.kernelName;\n\n console.debug('thebe:api:startNewSession server', this);\n console.debug('thebe:api:startNewSession', { name, path, kernelName });\n\n if (this.serviceManager) {\n // Temporary Fix: thebe-lite does not yet support filesystem based resouces fully,\n // so we can't use a path that points to a sub folder.\n path = path.slice(1).replace(/\\//g, '-');\n }\n\n const connection = await this.sessionManager?.startNew({\n name,\n path,\n type: 'notebook',\n kernel: {\n name: kernelName,\n },\n });\n\n return new ThebeSession(this, connection, rendermime);\n }\n\n async listRunningSessions(): Promise {\n await this.ready;\n const iter = this.sessionManager?.running();\n const models: SessionIModel[] = [];\n let result = iter?.next();\n while (result && !result.done) {\n models.push(result.value);\n result = iter?.next();\n }\n return models;\n }\n\n async refreshRunningSessions(): Promise {\n await this.ready;\n await this.sessionManager?.refreshRunning();\n return this.listRunningSessions();\n }\n\n async connectToExistingSession(model: SessionIModel, rendermime: IRenderMimeRegistry) {\n await this.ready;\n if (!this.sessionManager) {\n throw Error('Requesting session from a server, with no SessionManager available');\n }\n\n await this.sessionManager.ready;\n\n const connection = this.sessionManager?.connectTo({ model });\n return new ThebeSession(this, connection, rendermime);\n }\n\n async clearSavedBinderSessions() {\n const urls = this.makeBinderUrls();\n window.localStorage.removeItem(urls.storageKey);\n }\n\n /**\n * Connect to a Jupyter server directly\n *\n */\n async connectToJupyterServer(): Promise {\n console.debug('thebe:api:connectToJupyterServer:serverSettings:', this.config.serverSettings);\n const serverSettings = ServerConnection.makeSettings(this.config.serverSettings);\n\n // ping the server to check it is alive before trying to\n // hook up services\n try {\n this.events.triggerStatus({\n status: ServerStatusEvent.launching,\n message: `Checking server url`,\n });\n await ThebeServer.status(serverSettings);\n this.events.triggerStatus({\n status: ServerStatusEvent.launching,\n message: `Server reachable`,\n });\n // eslint-disable-next-line no-empty\n } catch (err: any) {\n const message = `Server not reachable (${serverSettings.baseUrl}) - ${err}`;\n this.events.triggerError({\n status: ErrorStatusEvent.error,\n message,\n });\n this.rejectReadyFn?.(message);\n return;\n }\n\n const kernelManager = new KernelManager({ serverSettings });\n this.events.triggerStatus({\n status: ServerStatusEvent.launching,\n message: `Created KernelManager`,\n });\n\n this.sessionManager = new SessionManager({\n kernelManager,\n serverSettings,\n });\n\n this.sessionManager.connectionFailure.connect((_, err) => {\n this.events.triggerError({\n status: ErrorStatusEvent.server,\n message: `connection failure: ${err}`,\n });\n });\n\n this.sessionManager.runningChanged.connect((_, models) => {\n this.events.triggerStatus({\n status: ServerStatusEvent.ready,\n message: `${models.length} running sessions changed: ${models\n .map((m) => m.name)\n .join(',')}`,\n });\n });\n\n this.events.triggerStatus({\n status: ServerStatusEvent.ready,\n message: `Created SessionManager`,\n });\n\n // Resolve the ready promise\n return this.sessionManager.ready.then(\n () => {\n this.userServerUrl = `${serverSettings.baseUrl}?token=${serverSettings.token}`;\n this.events.triggerStatus({\n status: ServerStatusEvent.ready,\n message: `Server connection ready`,\n });\n this.resolveReadyFn?.(this);\n },\n (err) => this.rejectReadyFn?.(errorAsString(err)),\n );\n }\n\n /**\n * Connect to Jupyterlite Server\n */\n async connectToJupyterLiteServer(config?: LiteServerConfig): Promise {\n this.events.triggerStatus({\n status: ServerStatusEvent.launching,\n message: `Connecting to JupyterLite`,\n });\n\n if (!window.thebeLite)\n throw new Error(\n `thebe-lite is not available at window.thebeLite - load this onto your page before loading thebe or thebe-core.`,\n );\n\n this.serviceManager = await window.thebeLite.startJupyterLiteServer(config);\n\n this.events.triggerStatus({\n status: ServerStatusEvent.launching,\n message: `Started JupyterLite server`,\n });\n\n console.debug(\n 'thebe:api:connectToJupyterLiteServer:serverSettings:',\n this.serviceManager.serverSettings,\n );\n\n this.sessionManager = this.serviceManager.sessions;\n\n this.events.triggerStatus({\n status: ServerStatusEvent.launching,\n message: `Received SessionMananger from JupyterLite`,\n });\n\n return this.sessionManager?.ready.then(\n () => {\n this.userServerUrl = '/'; // TODO bundle jlite UI `${this.serviceManager?.serverSettings.baseUrl}?token=${this.serviceManager?.serverSettings.token}`;\n this.events.triggerStatus({\n status: ServerStatusEvent.ready,\n message: `Server connection established`,\n });\n this.resolveReadyFn?.(this);\n },\n (err) => this.rejectReadyFn?.(errorAsString(err)),\n );\n }\n\n makeBinderUrls() {\n return makeBinderUrls(this.config, this.repoProviders ?? WELL_KNOWN_REPO_PROVIDERS);\n }\n\n async checkForSavedBinderSession() {\n try {\n const { storageKey } = makeBinderUrls(\n this.config,\n this.repoProviders ?? WELL_KNOWN_REPO_PROVIDERS,\n );\n return getExistingServer(this.config.savedSessions, storageKey);\n } catch (err: any) {\n this.events.triggerError({\n status: ErrorStatusEvent.error,\n message: `${err} - Failed to check for saved session.`,\n });\n return null;\n }\n }\n\n /**\n * Connect to a Binder instance in order to\n * access a Jupyter server that can provide kernels\n *\n * @param ctx\n * @param opts\n * @returns\n */\n async connectToServerViaBinder(customProviders?: RepoProviderSpec[]): Promise {\n // request new server\n this.events.triggerStatus({\n status: ServerStatusEvent.launching,\n message: `Connecting to binderhub at ${this.config.binder.binderUrl}`,\n });\n\n // TODO binder connection setup probably better as a a factory independent of the server\n this.repoProviders = [...WELL_KNOWN_REPO_PROVIDERS, ...(customProviders ?? [])];\n\n try {\n this.binderUrls = makeBinderUrls(this.config, this.repoProviders);\n } catch (err: any) {\n this.events.triggerError({\n status: ErrorStatusEvent.error,\n message: `${err} - Failed to connect to binderhub at ${this.config.binder.binderUrl}`,\n });\n return;\n }\n const urls = this.binderUrls;\n\n this.events.triggerStatus({\n status: ServerStatusEvent.launching,\n message: `Binder build url is ${urls.build}`,\n });\n\n if (this.config.savedSessions.enabled) {\n console.debug('thebe:server:connectToServerViaBinder Checking for saved session...');\n // the follow function will ping the server based on the settings and only return\n // non-null if the server is still alive. So highly likely that the remainder of\n // the connection calls below, work.\n const existingSettings = await this.checkForSavedBinderSession();\n if (existingSettings) {\n // Connect to the existing session\n const serverSettings = ServerConnection.makeSettings(existingSettings);\n const kernelManager = new KernelManager({ serverSettings });\n\n this.events.triggerStatus({\n status: ServerStatusEvent.launching,\n message: `Created KernelManager`,\n });\n\n this.sessionManager = new SessionManager({\n kernelManager,\n serverSettings,\n });\n\n this.events.triggerStatus({\n status: ServerStatusEvent.launching,\n message: `Created KernelManager`,\n });\n\n return this.sessionManager.ready.then(\n () => {\n this.userServerUrl = `${serverSettings.baseUrl}?token=${serverSettings.token}`;\n this.events.triggerStatus({\n status: ServerStatusEvent.ready,\n message: `Re-connected to binder server`,\n });\n this.resolveReadyFn?.(this);\n },\n (err) => this.rejectReadyFn?.(errorAsString(err)),\n );\n // else drop out of this block and request a new session\n }\n }\n\n // TODO we can get rid of one level of promise here?\n // Talk to the binder server\n const state: { status: StatusEvent } = {\n status: ServerStatusEvent.launching,\n };\n const es = new EventSource(urls.build);\n this.events.triggerStatus({\n status: state.status,\n message: `Opened connection to binder: ${urls.build}`,\n });\n\n // handle errors\n es.onerror = (evt: Event) => {\n console.error(`Lost connection to binder: ${urls.build}`, evt);\n es?.close();\n state.status = ErrorStatusEvent.error;\n const data = (evt as MessageEvent)?.data;\n const phase = data ? data.phase : 'unknown';\n const message = `Lost connection to binder: ${urls.build}\\nphase: ${phase} - ${\n data ? data.message : 'no message'\n }`;\n this.events.triggerError({\n status: ErrorStatusEvent.error,\n message,\n });\n this.rejectReadyFn?.(message);\n };\n\n es.onmessage = async (evt: MessageEvent) => {\n const msg: {\n // TODO must be in Jupyterlab types somewhere\n phase: string;\n message: string;\n url: string;\n token: string;\n } = JSON.parse(evt.data);\n\n const phase = msg.phase?.toLowerCase() ?? '';\n switch (phase) {\n case 'failed':\n es?.close();\n state.status = ErrorStatusEvent.error;\n this.events.triggerError({\n status: ErrorStatusEvent.error,\n message: `Binder: failed to build - ${urls.build} - ${msg.message}`,\n });\n this.rejectReadyFn?.(msg.message);\n break;\n case 'ready':\n {\n es?.close();\n\n const settings: ServerSettings = {\n baseUrl: msg.url,\n wsUrl: 'ws' + msg.url.slice(4),\n token: msg.token,\n appendToken: true,\n };\n\n const serverSettings = ServerConnection.makeSettings(settings);\n const kernelManager = new KernelManager({ serverSettings });\n this.sessionManager = new SessionManager({\n kernelManager,\n serverSettings,\n });\n\n if (this.config.savedSessions.enabled) {\n saveServerInfo(urls.storageKey, this.id, serverSettings);\n console.debug(\n `thebe:server:connectToServerViaBinder Saved session for ${this.id} at ${urls.build}`,\n );\n }\n\n // promise has already been returned to the caller\n // so we can await here\n await this.sessionManager.ready;\n\n this.userServerUrl = `${msg.url}?token=${msg.token}`;\n\n state.status = ServerStatusEvent.ready;\n this.events.triggerStatus({\n status: state.status,\n message: `Binder server is ready: ${msg.message}`,\n });\n\n this.resolveReadyFn?.(this);\n }\n break;\n default:\n this.events.triggerStatus({\n status: state.status,\n message: `Binder is: ${phase} - ${msg.message}`,\n });\n }\n };\n }\n\n //\n // ServerRestAPI Implementation\n //\n getFetchUrl(relativeUrl: string) {\n // TODO use ServerConnection.makeRequest - this willadd the token\n // and use any internal fetch overrides\n // TODO BUG this is the wrong serverSetting, they should be for the active connection\n if (!this.sessionManager)\n throw new Error('Must connect to a server before requesting KernelSpecs');\n if (!this.sessionManager?.serverSettings)\n throw new Error('No server settings available in session manager');\n const settings = this.sessionManager?.serverSettings;\n const baseUrl = new URL(settings.baseUrl);\n const url = new URL(`${baseUrl.pathname}${relativeUrl}`.replace('//', '/'), baseUrl.origin);\n url.searchParams.append('token', settings.token);\n return url;\n }\n\n static status(serverSettings: ServerSettings) {\n return ServerConnection.makeRequest(\n `${serverSettings.baseUrl}api/status`,\n {},\n ServerConnection.makeSettings(serverSettings),\n );\n }\n\n async getKernelSpecs() {\n if (!this.sessionManager)\n throw new Error('Must connect to a server before requesting KernelSpecs');\n return KernelSpecAPI.getSpecs(\n ServerConnection.makeSettings(this.sessionManager?.serverSettings),\n );\n }\n\n async getContents(opts: {\n path: string;\n type?: 'notebook' | 'file' | 'directory';\n format?: 'text' | 'base64';\n returnContent?: boolean;\n }) {\n const url = this.getFetchUrl(`/api/contents/${opts.path}`);\n if (opts.type) url.searchParams.append('type', opts.type);\n if (opts.format) url.searchParams.append('format', opts.format);\n url.searchParams.append('content', opts.returnContent ? '1' : '0');\n return responseToJson(await fetch(url));\n }\n\n async duplicateFile(opts: {\n path: string;\n copy_from: string;\n ext?: string;\n type?: 'notebook' | 'file';\n }) {\n const url = this.getFetchUrl(`/api/contents/${opts.path}`);\n const { copy_from, ext, type } = opts;\n return responseToJson(\n await fetch(url, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ copy_from, ext, type }),\n }),\n );\n }\n\n async createDirectory(opts: { path: string }) {\n const url = this.getFetchUrl(`/api/contents/${opts.path}`);\n return responseToJson(\n await fetch(url, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ type: 'directory' }),\n }),\n );\n }\n\n async renameContents(opts: { path: string; newPath: string }) {\n const { path, newPath } = opts;\n const url = this.getFetchUrl(`/api/contents/${path}`);\n return responseToJson(\n await fetch(url, {\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ path: newPath }),\n }),\n );\n }\n\n async uploadFile(opts: {\n path: string;\n content: string;\n format?: 'json' | 'text' | 'base64';\n type?: 'notebook' | 'file';\n }) {\n const { path, content, format, type } = opts;\n const url = this.getFetchUrl(`/api/contents/${path}`);\n console.debug('thebe:api:server:uploadFile', url);\n return responseToJson(\n await fetch(url, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n path,\n content,\n format: format ?? 'json',\n type: type ?? 'notebook',\n }),\n }),\n );\n }\n}\n\nexport default ThebeServer;\n","import * as widgets from './widgets';\n/**\n * A mime renderer factory for raw html.\n */\nexport const htmlRendererFactory = {\n safe: true,\n mimeTypes: ['text/html'],\n defaultRank: 50,\n createRenderer: options => new widgets.RenderedHTML(options)\n};\n/**\n * A mime renderer factory for images.\n */\nexport const imageRendererFactory = {\n safe: true,\n mimeTypes: [\n 'image/bmp',\n 'image/png',\n 'image/jpeg',\n 'image/gif',\n 'image/webp'\n ],\n defaultRank: 90,\n createRenderer: options => new widgets.RenderedImage(options)\n};\n/**\n * A mime renderer factory for LaTeX.\n */\nexport const latexRendererFactory = {\n safe: true,\n mimeTypes: ['text/latex'],\n defaultRank: 70,\n createRenderer: options => new widgets.RenderedLatex(options)\n};\n/**\n * A mime renderer factory for Markdown.\n */\nexport const markdownRendererFactory = {\n safe: true,\n mimeTypes: ['text/markdown'],\n defaultRank: 60,\n createRenderer: options => new widgets.RenderedMarkdown(options)\n};\n/**\n * A mime renderer factory for svg.\n */\nexport const svgRendererFactory = {\n safe: false,\n mimeTypes: ['image/svg+xml'],\n defaultRank: 80,\n createRenderer: options => new widgets.RenderedSVG(options)\n};\n/**\n * A mime renderer factory for rendering stderr outputs\n */\nexport const errorRendererFactory = {\n safe: true,\n mimeTypes: ['application/vnd.jupyter.stderr'],\n defaultRank: 110,\n createRenderer: options => new widgets.RenderedError(options)\n};\n/**\n * A mime renderer factory for plain and jupyter console text data.\n */\nexport const textRendererFactory = {\n safe: true,\n mimeTypes: ['text/plain', 'application/vnd.jupyter.stdout'],\n defaultRank: 120,\n createRenderer: options => new widgets.RenderedText(options)\n};\n/**\n * A placeholder factory for rendered JavaScript.\n */\nexport const javaScriptRendererFactory = {\n safe: false,\n mimeTypes: ['text/javascript', 'application/javascript'],\n defaultRank: 110,\n createRenderer: options => new widgets.RenderedJavaScript(options)\n};\n/**\n * The standard factories provided by the rendermime package.\n */\nexport const standardRendererFactories = [\n htmlRendererFactory,\n markdownRendererFactory,\n latexRendererFactory,\n svgRendererFactory,\n imageRendererFactory,\n javaScriptRendererFactory,\n errorRendererFactory,\n textRendererFactory\n];\n//# sourceMappingURL=factories.js.map","/* eslint-disable camelcase */\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport sanitize from 'sanitize-html';\n/**\n * Helper class that contains regular expressions for inline CSS style validation.\n *\n * Which properties (and values) to allow is largely based on the Google Caja project:\n * https://github.com/google/caja\n *\n * The regular expressions are largly based on the syntax definition found at\n * https://developer.mozilla.org/en-US/docs/Web/CSS.\n */\nclass CssProp {\n static reg(r) {\n return new RegExp('^' + r + '$', 'i');\n }\n}\n/*\n * Numeric base expressions used to help build more complex regular expressions\n */\nCssProp.N = {\n integer: `[+-]?[0-9]+`,\n integer_pos: `[+]?[0-9]+`,\n integer_zero_ff: `([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])`,\n number: `[+-]?([0-9]*[.])?[0-9]+(e-?[0-9]*)?`,\n number_pos: `[+]?([0-9]*[.])?[0-9]+(e-?[0-9]*)?`,\n number_zero_hundred: `[+]?(([0-9]|[1-9][0-9])([.][0-9]+)?|100)`,\n number_zero_one: `[+]?(1([.][0]+)?|0?([.][0-9]+)?)`\n};\n/*\n * Base expressions of common CSS syntax elements\n */\nCssProp.B = {\n angle: `(${CssProp.N.number}(deg|rad|grad|turn)|0)`,\n frequency: `${CssProp.N.number}(Hz|kHz)`,\n ident: String.raw `-?([_a-z]|[\\xA0-\\xFF]|\\\\[0-9a-f]{1,6}(\\r\\n|[ \\t\\r\\n\\f])?|\\\\[^\\r\\n\\f0-9a-f])([_a-z0-9-]|[\\xA0-\\xFF]|\\\\[0-9a-f]{1,6}(\\r\\n|[ \\t\\r\\n\\f])?|\\\\[^\\r\\n\\f0-9a-f])*`,\n len_or_perc: `(0|${CssProp.N.number}(px|em|rem|ex|in|cm|mm|pt|pc|%))`,\n length: `(${CssProp.N.number}(px|em|rem|ex|in|cm|mm|pt|pc)|0)`,\n length_pos: `(${CssProp.N.number_pos}(px|em|rem|ex|in|cm|mm|pt|pc)|0)`,\n percentage: `${CssProp.N.number}%`,\n percentage_pos: `${CssProp.N.number_pos}%`,\n percentage_zero_hundred: `${CssProp.N.number_zero_hundred}%`,\n string: String.raw `(\\\"([^\\n\\r\\f\\\\\"]|\\\\\\n|\\r\\n|\\r|\\f|\\\\[0-9a-f]{1,6}(\\r\\n|[ \\t\\r\\n\\f])?|\\\\[^\\r\\n\\f0-9a-f])*\\\")|(\\'([^\\n\\r\\f\\\\']|\\\\\\n|\\r\\n|\\r|\\f|\\\\[0-9a-f]{1,6}(\\r\\n|[ \\t\\r\\n\\f])?|\\\\[^\\r\\n\\f0-9a-f])*\\')`,\n time: `${CssProp.N.number}(s|ms)`,\n url: `url\\\\(.*?\\\\)`,\n z_index: `[+-]?[0-9]{1,7}`\n};\n/*\n * Atomic (i.e. not dependant on other regular expressions) sub RegEx segments\n */\nCssProp.A = {\n absolute_size: `xx-small|x-small|small|medium|large|x-large|xx-large`,\n attachment: `scroll|fixed|local`,\n bg_origin: `border-box|padding-box|content-box`,\n border_style: `none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset`,\n box: `border-box|padding-box|content-box`,\n display_inside: `auto|block|table|flex|grid`,\n display_outside: `block-level|inline-level|none|table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption`,\n ending_shape: `circle|ellipse`,\n generic_family: `serif|sans-serif|cursive|fantasy|monospace`,\n generic_voice: `male|female|child`,\n relative_size: `smaller|larger`,\n repeat_style: `repeat-x|repeat-y|((?:repeat|space|round|no-repeat)(?:\\\\s*(?:repeat|space|round|no-repeat))?)`,\n side_or_corner: `(left|right)?\\\\s*(top|bottom)?`,\n single_animation_direction: `normal|reverse|alternate|alternate-reverse`,\n single_animation_fill_mode: `none|forwards|backwards|both`,\n single_animation_play_state: `running|paused`\n};\n/*\n * Color definition sub expressions\n */\nCssProp._COLOR = {\n hex: `\\\\#(0x)?[0-9a-f]+`,\n name: `aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|transparent|violet|wheat|white|whitesmoke|yellow|yellowgreen`,\n rgb: String.raw `rgb\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*\\)`,\n rgba: String.raw `rgba\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(${CssProp.N.integer_zero_ff}|${CssProp.N.number_zero_one}|${CssProp.B.percentage_zero_hundred})\\s*\\)`\n};\n/*\n * Compound (i.e. dependant on other (sub) regular expressions) sub RegEx segments\n */\nCssProp._C = {\n alpha: `${CssProp.N.integer_zero_ff}|${CssProp.N.number_zero_one}|${CssProp.B.percentage_zero_hundred}`,\n alphavalue: CssProp.N.number_zero_one,\n bg_position: `((${CssProp.B.len_or_perc}|left|center|right|top|bottom)\\\\s*){1,4}`,\n bg_size: `(${CssProp.B.length_pos}|${CssProp.B.percentage}|auto){1,2}|cover|contain`,\n border_width: `thin|medium|thick|${CssProp.B.length}`,\n bottom: `${CssProp.B.length}|auto`,\n color: `${CssProp._COLOR.hex}|${CssProp._COLOR.rgb}|${CssProp._COLOR.rgba}|${CssProp._COLOR.name}`,\n color_stop_length: `(${CssProp.B.len_or_perc}\\\\s*){1,2}`,\n linear_color_hint: `${CssProp.B.len_or_perc}`,\n family_name: `${CssProp.B.string}|(${CssProp.B.ident}\\\\s*)+`,\n image_decl: CssProp.B.url,\n left: `${CssProp.B.length}|auto`,\n loose_quotable_words: `(${CssProp.B.ident})+`,\n margin_width: `${CssProp.B.len_or_perc}|auto`,\n padding_width: `${CssProp.B.length_pos}|${CssProp.B.percentage_pos}`,\n page_url: CssProp.B.url,\n position: `((${CssProp.B.len_or_perc}|left|center|right|top|bottom)\\\\s*){1,4}`,\n right: `${CssProp.B.length}|auto`,\n shadow: '',\n size: `closest-side|farthest-side|closest-corner|farthest-corner|${CssProp.B.length}|(${CssProp.B.len_or_perc})\\\\s+(${CssProp.B.len_or_perc})`,\n top: `${CssProp.B.length}|auto`\n};\nCssProp._C1 = {\n image_list: `image\\\\(\\\\s*(${CssProp.B.url})*\\\\s*(${CssProp.B.url}|${CssProp._C.color})\\\\s*\\\\)`,\n linear_color_stop: `(${CssProp._C.color})(\\\\s*${CssProp._C.color_stop_length})?`,\n shadow: `((${CssProp._C.color})\\\\s+((${CssProp.B.length})\\\\s*){2,4}(\\s+inset)?)|((inset\\\\s+)?((${CssProp.B.length})\\\\s*){2,4}\\\\s*(${CssProp._C.color})?)`\n};\nCssProp._C2 = {\n color_stop_list: `((${CssProp._C1.linear_color_stop})(\\\\s*(${CssProp._C.linear_color_hint}))?\\\\s*,\\\\s*)+(${CssProp._C1.linear_color_stop})`,\n shape: `rect\\\\(\\\\s*(${CssProp._C.top})\\\\s*,\\\\s*(${CssProp._C.right})\\\\s*,\\\\s*(${CssProp._C.bottom})\\\\s*,\\\\s*(${CssProp._C.left})\\\\s*\\\\)`\n};\nCssProp._C3 = {\n linear_gradient: `linear-gradient\\\\((((${CssProp.B.angle})|to\\\\s+(${CssProp.A.side_or_corner}))\\\\s*,\\\\s*)?\\\\s*(${CssProp._C2.color_stop_list})\\\\s*\\\\)`,\n radial_gradient: `radial-gradient\\\\(((((${CssProp.A.ending_shape})|(${CssProp._C.size}))\\\\s*)*\\\\s*(at\\\\s+${CssProp._C.position})?\\\\s*,\\\\s*)?\\\\s*(${CssProp._C2.color_stop_list})\\\\s*\\\\)`\n};\nCssProp._C4 = {\n image: `${CssProp.B.url}|${CssProp._C3.linear_gradient}|${CssProp._C3.radial_gradient}|${CssProp._C1.image_list}`,\n bg_image: `(${CssProp.B.url}|${CssProp._C3.linear_gradient}|${CssProp._C3.radial_gradient}|${CssProp._C1.image_list})|none`\n};\nCssProp.C = {\n ...CssProp._C,\n ...CssProp._C1,\n ...CssProp._C2,\n ...CssProp._C3,\n ...CssProp._C4\n};\n/*\n * Property value regular expressions not dependant on other sub expressions\n */\nCssProp.AP = {\n border_collapse: `collapse|separate`,\n box: `normal|none|contents`,\n box_sizing: `content-box|padding-box|border-box`,\n caption_side: `top|bottom`,\n clear: `none|left|right|both`,\n direction: `ltr|rtl`,\n empty_cells: `show|hide`,\n float: `left|right|none`,\n font_stretch: `normal|wider|narrower|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded`,\n font_style: `normal|italic|oblique`,\n font_variant: `normal|small-caps`,\n font_weight: `normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900`,\n list_style_position: `inside|outside`,\n list_style_type: `disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman|lower-greek|lower-latin|upper-latin|armenian|georgian|lower-alpha|upper-alpha|none`,\n overflow: `visible|hidden|scroll|auto`,\n overflow_wrap: `normal|break-word`,\n overflow_x: `visible|hidden|scroll|auto|no-display|no-content`,\n page_break_after: `auto|always|avoid|left|right`,\n page_break_before: `auto|always|avoid|left|right`,\n page_break_inside: `avoid|auto`,\n position: `static|relative|absolute`,\n resize: `none|both|horizontal|vertical`,\n speak: `normal|none|spell-out`,\n speak_header: `once|always`,\n speak_numeral: `digits|continuous`,\n speak_punctuation: `code|none`,\n table_layout: `auto|fixed`,\n text_align: `left|right|center|justify`,\n text_decoration: `none|((underline|overline|line-through|blink)\\\\s*)+`,\n text_transform: `capitalize|uppercase|lowercase|none`,\n text_wrap: `normal|unrestricted|none|suppress`,\n unicode_bidi: `normal|embed|bidi-override`,\n visibility: `visible|hidden|collapse`,\n white_space: `normal|pre|nowrap|pre-wrap|pre-line`,\n word_break: `normal|keep-all|break-all`\n};\n/*\n * Compound propertiy value regular expressions (i.e. dependant on other sub expressions)\n */\nCssProp._CP = {\n background_attachment: `${CssProp.A.attachment}(,\\\\s*${CssProp.A.attachment})*`,\n background_color: CssProp.C.color,\n background_origin: `${CssProp.A.box}(,\\\\s*${CssProp.A.box})*`,\n background_repeat: `${CssProp.A.repeat_style}(,\\\\s*${CssProp.A.repeat_style})*`,\n border: `((${CssProp.C.border_width}|${CssProp.A.border_style}|${CssProp.C.color})\\\\s*){1,3}`,\n border_radius: `((${CssProp.B.len_or_perc})\\\\s*){1,4}(\\\\/\\\\s*((${CssProp.B.len_or_perc})\\\\s*){1,4})?`,\n border_spacing: `${CssProp.B.length}\\\\s*(${CssProp.B.length})?`,\n border_top_color: CssProp.C.color,\n border_top_style: CssProp.A.border_style,\n border_width: `((${CssProp.C.border_width})\\\\s*){1,4}`,\n color: CssProp.C.color,\n cursor: `(${CssProp.B.url}(\\\\s*,\\\\s*)?)*(auto|crosshair|default|pointer|move|e-resize|ne-resize|nw-resize|n-resize|se-resize|sw-resize|s-resize|w-resize|text|wait|help|progress|all-scroll|col-resize|hand|no-drop|not-allowed|row-resize|vertical-text)`,\n display: `inline|block|list-item|run-in|inline-list-item|inline-block|table|inline-table|table-cell|table-caption|flex|inline-flex|grid|inline-grid|${CssProp.A.display_inside}|${CssProp.A.display_outside}|inherit|inline-box|inline-stack`,\n display_outside: CssProp.A.display_outside,\n elevation: `${CssProp.B.angle}|below|level|above|higher|lower`,\n font_family: `(${CssProp.C.family_name}|${CssProp.A.generic_family})(,\\\\s*(${CssProp.C.family_name}|${CssProp.A.generic_family}))*`,\n height: `${CssProp.B.length}|${CssProp.B.percentage}|auto`,\n letter_spacing: `normal|${CssProp.B.length}`,\n list_style_image: `${CssProp.C.image}|none`,\n margin_right: CssProp.C.margin_width,\n max_height: `${CssProp.B.length_pos}|${CssProp.B.percentage_pos}|none|auto`,\n min_height: `${CssProp.B.length_pos}|${CssProp.B.percentage_pos}|auto`,\n opacity: CssProp.C.alphavalue,\n outline_color: `${CssProp.C.color}|invert`,\n outline_width: CssProp.C.border_width,\n padding: `((${CssProp.C.padding_width})\\\\s*){1,4}`,\n padding_top: CssProp.C.padding_width,\n pitch_range: CssProp.N.number,\n right: `${CssProp.B.length}|${CssProp.B.percentage}|auto`,\n stress: CssProp.N.number,\n text_indent: `${CssProp.B.length}|${CssProp.B.percentage}`,\n text_shadow: `none|${CssProp.C.shadow}(,\\\\s*(${CssProp.C.shadow}))*`,\n volume: `${CssProp.N.number_pos}|${CssProp.B.percentage_pos}|silent|x-soft|soft|medium|loud|x-loud`,\n word_wrap: CssProp.AP.overflow_wrap,\n zoom: `normal|${CssProp.N.number_pos}|${CssProp.B.percentage_pos}`,\n backface_visibility: CssProp.AP.visibility,\n background_clip: `${CssProp.A.box}(,\\\\s*(${CssProp.A.box}))*`,\n background_position: `${CssProp.C.bg_position}(,\\\\s*(${CssProp.C.bg_position}))*`,\n border_bottom_color: CssProp.C.color,\n border_bottom_style: CssProp.A.border_style,\n border_color: `((${CssProp.C.color})\\\\s*){1,4}`,\n border_left_color: CssProp.C.color,\n border_right_color: CssProp.C.color,\n border_style: `((${CssProp.A.border_style})\\\\s*){1,4}`,\n border_top_left_radius: `(${CssProp.B.length}|${CssProp.B.percentage})(\\\\s*(${CssProp.B.length}|${CssProp.B.percentage}))?`,\n border_top_width: CssProp.C.border_width,\n box_shadow: `none|${CssProp.C.shadow}(,\\\\s*(${CssProp.C.shadow}))*`,\n clip: `${CssProp.C.shape}|auto`,\n display_inside: CssProp.A.display_inside,\n font_size: `${CssProp.A.absolute_size}|${CssProp.A.relative_size}|${CssProp.B.length_pos}|${CssProp.B.percentage_pos}`,\n line_height: `normal|${CssProp.N.number_pos}|${CssProp.B.length_pos}|${CssProp.B.percentage_pos}`,\n margin_left: CssProp.C.margin_width,\n max_width: `${CssProp.B.length_pos}|${CssProp.B.percentage_pos}|none|auto`,\n outline_style: CssProp.A.border_style,\n padding_bottom: CssProp.C.padding_width,\n padding_right: CssProp.C.padding_width,\n perspective: `none|${CssProp.B.length}`,\n richness: CssProp.N.number,\n text_overflow: `((clip|ellipsis|${CssProp.B.string})\\\\s*){1,2}`,\n top: `${CssProp.B.length}|${CssProp.B.percentage}|auto`,\n width: `${CssProp.B.length_pos}|${CssProp.B.percentage_pos}|auto`,\n z_index: `auto|${CssProp.B.z_index}`,\n // Simplified background\n background: `(((${CssProp.C.bg_position}\\\\s*(\\\\/\\\\s*${CssProp.C.bg_size})?)|(${CssProp.A.repeat_style})|(${CssProp.A.attachment})|(${CssProp.A.bg_origin})|(${CssProp.C.bg_image})|(${CssProp.C.color}))\\\\s*)+`,\n background_size: `${CssProp.C.bg_size}(,\\\\s*${CssProp.C.bg_size})*`,\n border_bottom_left_radius: `(${CssProp.B.length}|${CssProp.B.percentage})(\\\\s*(${CssProp.B.length}|${CssProp.B.percentage}))?`,\n border_bottom_width: CssProp.C.border_width,\n border_left_style: CssProp.A.border_style,\n border_right_style: CssProp.A.border_style,\n border_top: `((${CssProp.C.border_width}|${CssProp.A.border_style}|${CssProp.C.color})\\\\s*){1,3}`,\n bottom: `${CssProp.B.len_or_perc}|auto`,\n list_style: `((${CssProp.AP.list_style_type}|${CssProp.AP.list_style_position}|${CssProp.C.image}|none})\\\\s*){1,3}`,\n margin_top: CssProp.C.margin_width,\n outline: `((${CssProp.C.color}|invert|${CssProp.A.border_style}|${CssProp.C.border_width})\\\\s*){1,3}`,\n overflow_y: CssProp.AP.overflow_x,\n pitch: `${CssProp.B.frequency}|x-low|low|medium|high|x-high`,\n vertical_align: `baseline|sub|super|top|text-top|middle|bottom|text-bottom|${CssProp.B.len_or_perc}`,\n word_spacing: `normal|${CssProp.B.length}`,\n background_image: `${CssProp.C.bg_image}(,\\\\s*${CssProp.C.bg_image})*`,\n border_bottom_right_radius: `(${CssProp.B.length}|${CssProp.B.percentage})(\\\\s*(${CssProp.B.length}|${CssProp.B.percentage}))?`,\n border_left_width: CssProp.C.border_width,\n border_right_width: CssProp.C.border_width,\n left: `${CssProp.B.len_or_perc}|auto`,\n margin_bottom: CssProp.C.margin_width,\n pause_after: `${CssProp.B.time}|${CssProp.B.percentage}`,\n speech_rate: `${CssProp.N.number}|x-slow|slow|medium|fast|x-fast|faster|slower`,\n transition_duration: `${CssProp.B.time}(,\\\\s*${CssProp.B.time})*`,\n border_bottom: `((${CssProp.C.border_width}|${CssProp.A.border_style}|${CssProp.C.color})\\\\s*){1,3}`,\n border_right: `((${CssProp.C.border_width}|${CssProp.A.border_style}|${CssProp.C.color})\\\\s*){1,3}`,\n margin: `((${CssProp.C.margin_width})\\\\s*){1,4}`,\n padding_left: CssProp.C.padding_width,\n border_left: `((${CssProp.C.border_width}|${CssProp.A.border_style}|${CssProp.C.color})\\\\s*){1,3}`,\n quotes: `(${CssProp.B.string}\\\\s*${CssProp.B.string})+|none`,\n border_top_right_radius: `(${CssProp.B.length}|${CssProp.B.percentage})(\\\\s*(${CssProp.B.length}|${CssProp.B.percentage}))?`,\n min_width: `${CssProp.B.length_pos}|${CssProp.B.percentage_pos}|auto`\n};\nCssProp._CP1 = {\n font: `(((((${CssProp.AP.font_style}|${CssProp.AP.font_variant}|${CssProp.AP.font_weight})\\\\s*){1,3})?\\\\s*(${CssProp._CP.font_size})\\\\s*(\\\\/\\\\s*(${CssProp._CP.line_height}))?\\\\s+(${CssProp._CP.font_family}))|caption|icon|menu|message-box|small-caption|status-bar)`\n};\nCssProp.CP = { ...CssProp._CP, ...CssProp._CP1 };\n// CSS Property value validation regular expressions for use with sanitize-html\nCssProp.BORDER_COLLAPSE = CssProp.reg(CssProp.AP.border_collapse);\nCssProp.BOX = CssProp.reg(CssProp.AP.box);\nCssProp.BOX_SIZING = CssProp.reg(CssProp.AP.box_sizing);\nCssProp.CAPTION_SIDE = CssProp.reg(CssProp.AP.caption_side);\nCssProp.CLEAR = CssProp.reg(CssProp.AP.clear);\nCssProp.DIRECTION = CssProp.reg(CssProp.AP.direction);\nCssProp.EMPTY_CELLS = CssProp.reg(CssProp.AP.empty_cells);\nCssProp.FLOAT = CssProp.reg(CssProp.AP.float);\nCssProp.FONT_STRETCH = CssProp.reg(CssProp.AP.font_stretch);\nCssProp.FONT_STYLE = CssProp.reg(CssProp.AP.font_style);\nCssProp.FONT_VARIANT = CssProp.reg(CssProp.AP.font_variant);\nCssProp.FONT_WEIGHT = CssProp.reg(CssProp.AP.font_weight);\nCssProp.LIST_STYLE_POSITION = CssProp.reg(CssProp.AP.list_style_position);\nCssProp.LIST_STYLE_TYPE = CssProp.reg(CssProp.AP.list_style_type);\nCssProp.OVERFLOW = CssProp.reg(CssProp.AP.overflow);\nCssProp.OVERFLOW_WRAP = CssProp.reg(CssProp.AP.overflow_wrap);\nCssProp.OVERFLOW_X = CssProp.reg(CssProp.AP.overflow_x);\nCssProp.PAGE_BREAK_AFTER = CssProp.reg(CssProp.AP.page_break_after);\nCssProp.PAGE_BREAK_BEFORE = CssProp.reg(CssProp.AP.page_break_before);\nCssProp.PAGE_BREAK_INSIDE = CssProp.reg(CssProp.AP.page_break_inside);\nCssProp.POSITION = CssProp.reg(CssProp.AP.position);\nCssProp.RESIZE = CssProp.reg(CssProp.AP.resize);\nCssProp.SPEAK = CssProp.reg(CssProp.AP.speak);\nCssProp.SPEAK_HEADER = CssProp.reg(CssProp.AP.speak_header);\nCssProp.SPEAK_NUMERAL = CssProp.reg(CssProp.AP.speak_numeral);\nCssProp.SPEAK_PUNCTUATION = CssProp.reg(CssProp.AP.speak_punctuation);\nCssProp.TABLE_LAYOUT = CssProp.reg(CssProp.AP.table_layout);\nCssProp.TEXT_ALIGN = CssProp.reg(CssProp.AP.text_align);\nCssProp.TEXT_DECORATION = CssProp.reg(CssProp.AP.text_decoration);\nCssProp.TEXT_TRANSFORM = CssProp.reg(CssProp.AP.text_transform);\nCssProp.TEXT_WRAP = CssProp.reg(CssProp.AP.text_wrap);\nCssProp.UNICODE_BIDI = CssProp.reg(CssProp.AP.unicode_bidi);\nCssProp.VISIBILITY = CssProp.reg(CssProp.AP.visibility);\nCssProp.WHITE_SPACE = CssProp.reg(CssProp.AP.white_space);\nCssProp.WORD_BREAK = CssProp.reg(CssProp.AP.word_break);\nCssProp.BACKGROUND_ATTACHMENT = CssProp.reg(CssProp.CP.background_attachment);\nCssProp.BACKGROUND_COLOR = CssProp.reg(CssProp.CP.background_color);\nCssProp.BACKGROUND_ORIGIN = CssProp.reg(CssProp.CP.background_origin);\nCssProp.BACKGROUND_REPEAT = CssProp.reg(CssProp.CP.background_repeat);\nCssProp.BORDER = CssProp.reg(CssProp.CP.border);\nCssProp.BORDER_RADIUS = CssProp.reg(CssProp.CP.border_radius);\nCssProp.BORDER_SPACING = CssProp.reg(CssProp.CP.border_spacing);\nCssProp.BORDER_TOP_COLOR = CssProp.reg(CssProp.CP.border_top_color);\nCssProp.BORDER_TOP_STYLE = CssProp.reg(CssProp.CP.border_top_style);\nCssProp.BORDER_WIDTH = CssProp.reg(CssProp.CP.border_width);\nCssProp.COLOR = CssProp.reg(CssProp.CP.color);\nCssProp.CURSOR = CssProp.reg(CssProp.CP.cursor);\nCssProp.DISPLAY = CssProp.reg(CssProp.CP.display);\nCssProp.DISPLAY_OUTSIDE = CssProp.reg(CssProp.CP.display_outside);\nCssProp.ELEVATION = CssProp.reg(CssProp.CP.elevation);\nCssProp.FONT_FAMILY = CssProp.reg(CssProp.CP.font_family);\nCssProp.HEIGHT = CssProp.reg(CssProp.CP.height);\nCssProp.LETTER_SPACING = CssProp.reg(CssProp.CP.letter_spacing);\nCssProp.LIST_STYLE_IMAGE = CssProp.reg(CssProp.CP.list_style_image);\nCssProp.MARGIN_RIGHT = CssProp.reg(CssProp.CP.margin_right);\nCssProp.MAX_HEIGHT = CssProp.reg(CssProp.CP.max_height);\nCssProp.MIN_HEIGHT = CssProp.reg(CssProp.CP.min_height);\nCssProp.OPACITY = CssProp.reg(CssProp.CP.opacity);\nCssProp.OUTLINE_COLOR = CssProp.reg(CssProp.CP.outline_color);\nCssProp.OUTLINE_WIDTH = CssProp.reg(CssProp.CP.outline_width);\nCssProp.PADDING = CssProp.reg(CssProp.CP.padding);\nCssProp.PADDING_TOP = CssProp.reg(CssProp.CP.padding_top);\nCssProp.PITCH_RANGE = CssProp.reg(CssProp.CP.pitch_range);\nCssProp.RIGHT = CssProp.reg(CssProp.CP.right);\nCssProp.STRESS = CssProp.reg(CssProp.CP.stress);\nCssProp.TEXT_INDENT = CssProp.reg(CssProp.CP.text_indent);\nCssProp.TEXT_SHADOW = CssProp.reg(CssProp.CP.text_shadow);\nCssProp.VOLUME = CssProp.reg(CssProp.CP.volume);\nCssProp.WORD_WRAP = CssProp.reg(CssProp.CP.word_wrap);\nCssProp.ZOOM = CssProp.reg(CssProp.CP.zoom);\nCssProp.BACKFACE_VISIBILITY = CssProp.reg(CssProp.CP.backface_visibility);\nCssProp.BACKGROUND_CLIP = CssProp.reg(CssProp.CP.background_clip);\nCssProp.BACKGROUND_POSITION = CssProp.reg(CssProp.CP.background_position);\nCssProp.BORDER_BOTTOM_COLOR = CssProp.reg(CssProp.CP.border_bottom_color);\nCssProp.BORDER_BOTTOM_STYLE = CssProp.reg(CssProp.CP.border_bottom_style);\nCssProp.BORDER_COLOR = CssProp.reg(CssProp.CP.border_color);\nCssProp.BORDER_LEFT_COLOR = CssProp.reg(CssProp.CP.border_left_color);\nCssProp.BORDER_RIGHT_COLOR = CssProp.reg(CssProp.CP.border_right_color);\nCssProp.BORDER_STYLE = CssProp.reg(CssProp.CP.border_style);\nCssProp.BORDER_TOP_LEFT_RADIUS = CssProp.reg(CssProp.CP.border_top_left_radius);\nCssProp.BORDER_TOP_WIDTH = CssProp.reg(CssProp.CP.border_top_width);\nCssProp.BOX_SHADOW = CssProp.reg(CssProp.CP.box_shadow);\nCssProp.CLIP = CssProp.reg(CssProp.CP.clip);\nCssProp.DISPLAY_INSIDE = CssProp.reg(CssProp.CP.display_inside);\nCssProp.FONT_SIZE = CssProp.reg(CssProp.CP.font_size);\nCssProp.LINE_HEIGHT = CssProp.reg(CssProp.CP.line_height);\nCssProp.MARGIN_LEFT = CssProp.reg(CssProp.CP.margin_left);\nCssProp.MAX_WIDTH = CssProp.reg(CssProp.CP.max_width);\nCssProp.OUTLINE_STYLE = CssProp.reg(CssProp.CP.outline_style);\nCssProp.PADDING_BOTTOM = CssProp.reg(CssProp.CP.padding_bottom);\nCssProp.PADDING_RIGHT = CssProp.reg(CssProp.CP.padding_right);\nCssProp.PERSPECTIVE = CssProp.reg(CssProp.CP.perspective);\nCssProp.RICHNESS = CssProp.reg(CssProp.CP.richness);\nCssProp.TEXT_OVERFLOW = CssProp.reg(CssProp.CP.text_overflow);\nCssProp.TOP = CssProp.reg(CssProp.CP.top);\nCssProp.WIDTH = CssProp.reg(CssProp.CP.width);\nCssProp.Z_INDEX = CssProp.reg(CssProp.CP.z_index);\nCssProp.BACKGROUND = CssProp.reg(CssProp.CP.background);\nCssProp.BACKGROUND_SIZE = CssProp.reg(CssProp.CP.background_size);\nCssProp.BORDER_BOTTOM_LEFT_RADIUS = CssProp.reg(CssProp.CP.border_bottom_left_radius);\nCssProp.BORDER_BOTTOM_WIDTH = CssProp.reg(CssProp.CP.border_bottom_width);\nCssProp.BORDER_LEFT_STYLE = CssProp.reg(CssProp.CP.border_left_style);\nCssProp.BORDER_RIGHT_STYLE = CssProp.reg(CssProp.CP.border_right_style);\nCssProp.BORDER_TOP = CssProp.reg(CssProp.CP.border_top);\nCssProp.BOTTOM = CssProp.reg(CssProp.CP.bottom);\nCssProp.LIST_STYLE = CssProp.reg(CssProp.CP.list_style);\nCssProp.MARGIN_TOP = CssProp.reg(CssProp.CP.margin_top);\nCssProp.OUTLINE = CssProp.reg(CssProp.CP.outline);\nCssProp.OVERFLOW_Y = CssProp.reg(CssProp.CP.overflow_y);\nCssProp.PITCH = CssProp.reg(CssProp.CP.pitch);\nCssProp.VERTICAL_ALIGN = CssProp.reg(CssProp.CP.vertical_align);\nCssProp.WORD_SPACING = CssProp.reg(CssProp.CP.word_spacing);\nCssProp.BACKGROUND_IMAGE = CssProp.reg(CssProp.CP.background_image);\nCssProp.BORDER_BOTTOM_RIGHT_RADIUS = CssProp.reg(CssProp.CP.border_bottom_right_radius);\nCssProp.BORDER_LEFT_WIDTH = CssProp.reg(CssProp.CP.border_left_width);\nCssProp.BORDER_RIGHT_WIDTH = CssProp.reg(CssProp.CP.border_right_width);\nCssProp.LEFT = CssProp.reg(CssProp.CP.left);\nCssProp.MARGIN_BOTTOM = CssProp.reg(CssProp.CP.margin_bottom);\nCssProp.PAUSE_AFTER = CssProp.reg(CssProp.CP.pause_after);\nCssProp.SPEECH_RATE = CssProp.reg(CssProp.CP.speech_rate);\nCssProp.TRANSITION_DURATION = CssProp.reg(CssProp.CP.transition_duration);\nCssProp.BORDER_BOTTOM = CssProp.reg(CssProp.CP.border_bottom);\nCssProp.BORDER_RIGHT = CssProp.reg(CssProp.CP.border_right);\nCssProp.MARGIN = CssProp.reg(CssProp.CP.margin);\nCssProp.PADDING_LEFT = CssProp.reg(CssProp.CP.padding_left);\nCssProp.BORDER_LEFT = CssProp.reg(CssProp.CP.border_left);\nCssProp.FONT = CssProp.reg(CssProp.CP.font);\nCssProp.QUOTES = CssProp.reg(CssProp.CP.quotes);\nCssProp.BORDER_TOP_RIGHT_RADIUS = CssProp.reg(CssProp.CP.border_top_right_radius);\nCssProp.MIN_WIDTH = CssProp.reg(CssProp.CP.min_width);\n/**\n * A class to sanitize HTML strings.\n */\nexport class Sanitizer {\n constructor() {\n this._autolink = true;\n this._allowNamedProperties = false;\n this._generateOptions = () => ({\n // HTML tags that are allowed to be used. Tags were extracted from Google Caja\n allowedTags: [\n 'a',\n 'abbr',\n 'acronym',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'colspan',\n 'command',\n 'data',\n 'datalist',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'font',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'hgroup',\n 'hr',\n 'i',\n // 'iframe' is allowed by Google Caja, but disallowed by default by sanitize-html\n // , 'iframe'\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'map',\n 'mark',\n 'menu',\n 'meter',\n 'nav',\n 'nobr',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'pre',\n 'progress',\n 'q',\n 'rowspan',\n 's',\n 'samp',\n 'section',\n 'select',\n 'small',\n 'source',\n 'span',\n 'strike',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'track',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr'\n ],\n // Attributes that HTML tags are allowed to have, extracted from Google Caja.\n // See https://github.com/jupyterlab/jupyterlab/issues/1812#issuecomment-285848435\n allowedAttributes: {\n '*': [\n 'class',\n 'dir',\n 'draggable',\n 'hidden',\n ...(this._allowNamedProperties ? ['id'] : []),\n 'inert',\n 'itemprop',\n 'itemref',\n 'itemscope',\n 'lang',\n 'spellcheck',\n 'style',\n 'title',\n 'translate'\n ],\n // 'rel' and 'target' were *not* allowed by Google Caja\n a: [\n 'accesskey',\n 'coords',\n 'href',\n 'hreflang',\n ...(this._allowNamedProperties ? ['name'] : []),\n 'rel',\n 'shape',\n 'tabindex',\n 'target',\n 'type'\n ],\n area: [\n 'accesskey',\n 'alt',\n 'coords',\n 'href',\n 'nohref',\n 'shape',\n 'tabindex'\n ],\n // 'autoplay' was *not* allowed by Google Caja\n audio: [\n 'autoplay',\n 'controls',\n 'loop',\n 'mediagroup',\n 'muted',\n 'preload',\n 'src'\n ],\n bdo: ['dir'],\n blockquote: ['cite'],\n br: ['clear'],\n button: [\n 'accesskey',\n 'data-commandlinker-args',\n 'data-commandlinker-command',\n 'disabled',\n ...(this._allowNamedProperties ? ['name'] : []),\n 'tabindex',\n 'type',\n 'value'\n ],\n canvas: ['height', 'width'],\n caption: ['align'],\n col: ['align', 'char', 'charoff', 'span', 'valign', 'width'],\n colgroup: ['align', 'char', 'charoff', 'span', 'valign', 'width'],\n command: [\n 'checked',\n 'command',\n 'disabled',\n 'icon',\n 'label',\n 'radiogroup',\n 'type'\n ],\n data: ['value'],\n del: ['cite', 'datetime'],\n details: ['open'],\n dir: ['compact'],\n div: ['align'],\n dl: ['compact'],\n fieldset: ['disabled'],\n font: ['color', 'face', 'size'],\n form: [\n 'accept',\n 'autocomplete',\n 'enctype',\n 'method',\n ...(this._allowNamedProperties ? ['name'] : []),\n 'novalidate'\n ],\n h1: ['align'],\n h2: ['align'],\n h3: ['align'],\n h4: ['align'],\n h5: ['align'],\n h6: ['align'],\n hr: ['align', 'noshade', 'size', 'width'],\n iframe: [\n 'align',\n 'frameborder',\n 'height',\n 'marginheight',\n 'marginwidth',\n 'width'\n ],\n img: [\n 'align',\n 'alt',\n 'border',\n 'height',\n 'hspace',\n 'ismap',\n ...(this._allowNamedProperties ? ['name'] : []),\n 'src',\n 'usemap',\n 'vspace',\n 'width'\n ],\n input: [\n 'accept',\n 'accesskey',\n 'align',\n 'alt',\n 'autocomplete',\n 'checked',\n 'disabled',\n 'inputmode',\n 'ismap',\n 'list',\n 'max',\n 'maxlength',\n 'min',\n 'multiple',\n ...(this._allowNamedProperties ? ['name'] : []),\n 'placeholder',\n 'readonly',\n 'required',\n 'size',\n 'src',\n 'step',\n 'tabindex',\n 'type',\n 'usemap',\n 'value'\n ],\n ins: ['cite', 'datetime'],\n label: ['accesskey', 'for'],\n legend: ['accesskey', 'align'],\n li: ['type', 'value'],\n map: this._allowNamedProperties ? ['name'] : [],\n menu: ['compact', 'label', 'type'],\n meter: ['high', 'low', 'max', 'min', 'value'],\n ol: ['compact', 'reversed', 'start', 'type'],\n optgroup: ['disabled', 'label'],\n option: ['disabled', 'label', 'selected', 'value'],\n output: ['for', ...(this._allowNamedProperties ? ['name'] : [])],\n p: ['align'],\n pre: ['width'],\n progress: ['max', 'min', 'value'],\n q: ['cite'],\n select: [\n 'autocomplete',\n 'disabled',\n 'multiple',\n ...(this._allowNamedProperties ? ['name'] : []),\n 'required',\n 'size',\n 'tabindex'\n ],\n source: ['type'],\n table: [\n 'align',\n 'bgcolor',\n 'border',\n 'cellpadding',\n 'cellspacing',\n 'frame',\n 'rules',\n 'summary',\n 'width'\n ],\n tbody: ['align', 'char', 'charoff', 'valign'],\n td: [\n 'abbr',\n 'align',\n 'axis',\n 'bgcolor',\n 'char',\n 'charoff',\n 'colspan',\n 'headers',\n 'height',\n 'nowrap',\n 'rowspan',\n 'scope',\n 'valign',\n 'width'\n ],\n textarea: [\n 'accesskey',\n 'autocomplete',\n 'cols',\n 'disabled',\n 'inputmode',\n ...(this._allowNamedProperties ? ['name'] : []),\n 'placeholder',\n 'readonly',\n 'required',\n 'rows',\n 'tabindex',\n 'wrap'\n ],\n tfoot: ['align', 'char', 'charoff', 'valign'],\n th: [\n 'abbr',\n 'align',\n 'axis',\n 'bgcolor',\n 'char',\n 'charoff',\n 'colspan',\n 'headers',\n 'height',\n 'nowrap',\n 'rowspan',\n 'scope',\n 'valign',\n 'width'\n ],\n thead: ['align', 'char', 'charoff', 'valign'],\n tr: ['align', 'bgcolor', 'char', 'charoff', 'valign'],\n track: ['default', 'kind', 'label', 'srclang'],\n ul: ['compact', 'type'],\n video: [\n 'autoplay',\n 'controls',\n 'height',\n 'loop',\n 'mediagroup',\n 'muted',\n 'poster',\n 'preload',\n 'src',\n 'width'\n ]\n },\n // Inline CSS styles that HTML tags may have (and their allowed values)\n allowedStyles: {\n // To simplify the data, all styles are allowed on all tags that allow the style attribute\n '*': {\n 'backface-visibility': [CssProp.BACKFACE_VISIBILITY],\n background: [CssProp.BACKGROUND],\n 'background-attachment': [CssProp.BACKGROUND_ATTACHMENT],\n 'background-clip': [CssProp.BACKGROUND_CLIP],\n 'background-color': [CssProp.BACKGROUND_COLOR],\n 'background-image': [CssProp.BACKGROUND_IMAGE],\n 'background-origin': [CssProp.BACKGROUND_ORIGIN],\n 'background-position': [CssProp.BACKGROUND_POSITION],\n 'background-repeat': [CssProp.BACKGROUND_REPEAT],\n 'background-size': [CssProp.BACKGROUND_SIZE],\n border: [CssProp.BORDER],\n 'border-bottom': [CssProp.BORDER_BOTTOM],\n 'border-bottom-color': [CssProp.BORDER_BOTTOM_COLOR],\n 'border-bottom-left-radius': [CssProp.BORDER_BOTTOM_LEFT_RADIUS],\n 'border-bottom-right-radius': [CssProp.BORDER_BOTTOM_RIGHT_RADIUS],\n 'border-bottom-style': [CssProp.BORDER_BOTTOM_STYLE],\n 'border-bottom-width': [CssProp.BORDER_BOTTOM_WIDTH],\n 'border-collapse': [CssProp.BORDER_COLLAPSE],\n 'border-color': [CssProp.BORDER_COLOR],\n 'border-left': [CssProp.BORDER_LEFT],\n 'border-left-color': [CssProp.BORDER_LEFT_COLOR],\n 'border-left-style': [CssProp.BORDER_LEFT_STYLE],\n 'border-left-width': [CssProp.BORDER_LEFT_WIDTH],\n 'border-radius': [CssProp.BORDER_RADIUS],\n 'border-right': [CssProp.BORDER_RIGHT],\n 'border-right-color': [CssProp.BORDER_RIGHT_COLOR],\n 'border-right-style': [CssProp.BORDER_RIGHT_STYLE],\n 'border-right-width': [CssProp.BORDER_RIGHT_WIDTH],\n 'border-spacing': [CssProp.BORDER_SPACING],\n 'border-style': [CssProp.BORDER_STYLE],\n 'border-top': [CssProp.BORDER_TOP],\n 'border-top-color': [CssProp.BORDER_TOP_COLOR],\n 'border-top-left-radius': [CssProp.BORDER_TOP_LEFT_RADIUS],\n 'border-top-right-radius': [CssProp.BORDER_TOP_RIGHT_RADIUS],\n 'border-top-style': [CssProp.BORDER_TOP_STYLE],\n 'border-top-width': [CssProp.BORDER_TOP_WIDTH],\n 'border-width': [CssProp.BORDER_WIDTH],\n bottom: [CssProp.BOTTOM],\n box: [CssProp.BOX],\n 'box-shadow': [CssProp.BOX_SHADOW],\n 'box-sizing': [CssProp.BOX_SIZING],\n 'caption-side': [CssProp.CAPTION_SIDE],\n clear: [CssProp.CLEAR],\n clip: [CssProp.CLIP],\n color: [CssProp.COLOR],\n cursor: [CssProp.CURSOR],\n direction: [CssProp.DIRECTION],\n display: [CssProp.DISPLAY],\n 'display-inside': [CssProp.DISPLAY_INSIDE],\n 'display-outside': [CssProp.DISPLAY_OUTSIDE],\n elevation: [CssProp.ELEVATION],\n 'empty-cells': [CssProp.EMPTY_CELLS],\n float: [CssProp.FLOAT],\n font: [CssProp.FONT],\n 'font-family': [CssProp.FONT_FAMILY],\n 'font-size': [CssProp.FONT_SIZE],\n 'font-stretch': [CssProp.FONT_STRETCH],\n 'font-style': [CssProp.FONT_STYLE],\n 'font-variant': [CssProp.FONT_VARIANT],\n 'font-weight': [CssProp.FONT_WEIGHT],\n height: [CssProp.HEIGHT],\n left: [CssProp.LEFT],\n 'letter-spacing': [CssProp.LETTER_SPACING],\n 'line-height': [CssProp.LINE_HEIGHT],\n 'list-style': [CssProp.LIST_STYLE],\n 'list-style-image': [CssProp.LIST_STYLE_IMAGE],\n 'list-style-position': [CssProp.LIST_STYLE_POSITION],\n 'list-style-type': [CssProp.LIST_STYLE_TYPE],\n margin: [CssProp.MARGIN],\n 'margin-bottom': [CssProp.MARGIN_BOTTOM],\n 'margin-left': [CssProp.MARGIN_LEFT],\n 'margin-right': [CssProp.MARGIN_RIGHT],\n 'margin-top': [CssProp.MARGIN_TOP],\n 'max-height': [CssProp.MAX_HEIGHT],\n 'max-width': [CssProp.MAX_WIDTH],\n 'min-height': [CssProp.MIN_HEIGHT],\n 'min-width': [CssProp.MIN_WIDTH],\n opacity: [CssProp.OPACITY],\n outline: [CssProp.OUTLINE],\n 'outline-color': [CssProp.OUTLINE_COLOR],\n 'outline-style': [CssProp.OUTLINE_STYLE],\n 'outline-width': [CssProp.OUTLINE_WIDTH],\n overflow: [CssProp.OVERFLOW],\n 'overflow-wrap': [CssProp.OVERFLOW_WRAP],\n 'overflow-x': [CssProp.OVERFLOW_X],\n 'overflow-y': [CssProp.OVERFLOW_Y],\n padding: [CssProp.PADDING],\n 'padding-bottom': [CssProp.PADDING_BOTTOM],\n 'padding-left': [CssProp.PADDING_LEFT],\n 'padding-right': [CssProp.PADDING_RIGHT],\n 'padding-top': [CssProp.PADDING_TOP],\n 'page-break-after': [CssProp.PAGE_BREAK_AFTER],\n 'page-break-before': [CssProp.PAGE_BREAK_BEFORE],\n 'page-break-inside': [CssProp.PAGE_BREAK_INSIDE],\n 'pause-after': [CssProp.PAUSE_AFTER],\n perspective: [CssProp.PERSPECTIVE],\n pitch: [CssProp.PITCH],\n 'pitch-range': [CssProp.PITCH_RANGE],\n position: [CssProp.POSITION],\n quotes: [CssProp.QUOTES],\n resize: [CssProp.RESIZE],\n richness: [CssProp.RICHNESS],\n right: [CssProp.RIGHT],\n speak: [CssProp.SPEAK],\n 'speak-header': [CssProp.SPEAK_HEADER],\n 'speak-numeral': [CssProp.SPEAK_NUMERAL],\n 'speak-punctuation': [CssProp.SPEAK_PUNCTUATION],\n 'speech-rate': [CssProp.SPEECH_RATE],\n stress: [CssProp.STRESS],\n 'table-layout': [CssProp.TABLE_LAYOUT],\n 'text-align': [CssProp.TEXT_ALIGN],\n 'text-decoration': [CssProp.TEXT_DECORATION],\n 'text-indent': [CssProp.TEXT_INDENT],\n 'text-overflow': [CssProp.TEXT_OVERFLOW],\n 'text-shadow': [CssProp.TEXT_SHADOW],\n 'text-transform': [CssProp.TEXT_TRANSFORM],\n 'text-wrap': [CssProp.TEXT_WRAP],\n top: [CssProp.TOP],\n 'unicode-bidi': [CssProp.UNICODE_BIDI],\n 'vertical-align': [CssProp.VERTICAL_ALIGN],\n visibility: [CssProp.VISIBILITY],\n volume: [CssProp.VOLUME],\n 'white-space': [CssProp.WHITE_SPACE],\n width: [CssProp.WIDTH],\n 'word-break': [CssProp.WORD_BREAK],\n 'word-spacing': [CssProp.WORD_SPACING],\n 'word-wrap': [CssProp.WORD_WRAP],\n 'z-index': [CssProp.Z_INDEX],\n zoom: [CssProp.ZOOM]\n }\n },\n transformTags: {\n // Set the \"rel\" attribute for tags to \"nofollow\".\n a: sanitize.simpleTransform('a', { rel: 'nofollow' }),\n // Set the \"disabled\" attribute for tags.\n input: sanitize.simpleTransform('input', { disabled: 'disabled' })\n },\n allowedSchemes: [...sanitize.defaults.allowedSchemes],\n allowedSchemesByTag: {\n // Allow 'attachment:' img src (used for markdown cell attachments).\n img: sanitize.defaults.allowedSchemes.concat(['attachment'])\n },\n // Override of the default option, so we can skip 'src' attribute validation.\n // 'src' Attributes are validated to be URIs, which does not allow for embedded (image) data.\n // Since embedded data is no longer deemed to be a threat, validation can be skipped.\n // See https://github.com/jupyterlab/jupyterlab/issues/5183\n allowedSchemesAppliedToAttributes: ['href', 'cite']\n });\n this._options = this._generateOptions();\n }\n /**\n * Sanitize an HTML string.\n *\n * @param dirty - The dirty text.\n *\n * @param options - The optional sanitization options.\n *\n * @returns The sanitized string.\n */\n sanitize(dirty, options) {\n return sanitize(dirty, { ...this._options, ...(options || {}) });\n }\n /**\n * @returns Whether to replace URLs by HTML anchors.\n */\n getAutolink() {\n return this._autolink;\n }\n /**\n * Set the allowed schemes\n *\n * @param scheme Allowed schemes\n */\n setAllowedSchemes(scheme) {\n // Force copy of `scheme`\n this._options.allowedSchemes = [...scheme];\n }\n /**\n * Set the URL replacement boolean.\n *\n * @param autolink URL replacement boolean.\n */\n setAutolink(autolink) {\n this._autolink = autolink;\n }\n /**\n * Set the whether to allow `name` and `id` attributes.\n */\n setAllowNamedProperties(allowNamedProperties) {\n this._allowNamedProperties = allowNamedProperties;\n this._options = this._generateOptions();\n }\n}\n//# sourceMappingURL=sanitizer.js.map","/**\n * The default mime model implementation.\n */\nexport class MimeModel {\n /**\n * Construct a new mime model.\n */\n constructor(options = {}) {\n this.trusted = !!options.trusted;\n this._data = options.data || {};\n this._metadata = options.metadata || {};\n this._callback = options.callback || Private.noOp;\n }\n /**\n * The data associated with the model.\n */\n get data() {\n return this._data;\n }\n /**\n * The metadata associated with the model.\n */\n get metadata() {\n return this._metadata;\n }\n /**\n * Set the data associated with the model.\n *\n * #### Notes\n * Depending on the implementation of the mime model,\n * this call may or may not have deferred effects,\n */\n setData(options) {\n this._data = options.data || this._data;\n this._metadata = options.metadata || this._metadata;\n this._callback(options);\n }\n}\n/**\n * The namespace for module private data.\n */\nvar Private;\n(function (Private) {\n /**\n * A no-op callback function.\n */\n function noOp() {\n /* no-op */\n }\n Private.noOp = noOp;\n})(Private || (Private = {}));\n//# sourceMappingURL=mimemodel.js.map","/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\nimport { Sanitizer } from '@jupyterlab/apputils';\nimport { PageConfig, PathExt, URLExt } from '@jupyterlab/coreutils';\nimport { nullTranslator } from '@jupyterlab/translation';\nimport { MimeModel } from './mimemodel';\n/**\n * An object which manages mime renderer factories.\n *\n * This object is used to render mime models using registered mime\n * renderers, selecting the preferred mime renderer to render the\n * model into a widget.\n *\n * #### Notes\n * This class is not intended to be subclassed.\n */\nexport class RenderMimeRegistry {\n /**\n * Construct a new rendermime.\n *\n * @param options - The options for initializing the instance.\n */\n constructor(options = {}) {\n var _a, _b, _c, _d, _e, _f;\n this._id = 0;\n this._ranks = {};\n this._types = null;\n this._factories = {};\n // Parse the options.\n this.translator = (_a = options.translator) !== null && _a !== void 0 ? _a : nullTranslator;\n this.resolver = (_b = options.resolver) !== null && _b !== void 0 ? _b : null;\n this.linkHandler = (_c = options.linkHandler) !== null && _c !== void 0 ? _c : null;\n this.latexTypesetter = (_d = options.latexTypesetter) !== null && _d !== void 0 ? _d : null;\n this.markdownParser = (_e = options.markdownParser) !== null && _e !== void 0 ? _e : null;\n this.sanitizer = (_f = options.sanitizer) !== null && _f !== void 0 ? _f : new Sanitizer();\n // Add the initial factories.\n if (options.initialFactories) {\n for (const factory of options.initialFactories) {\n this.addFactory(factory);\n }\n }\n }\n /**\n * The ordered list of mimeTypes.\n */\n get mimeTypes() {\n return this._types || (this._types = Private.sortedTypes(this._ranks));\n }\n /**\n * Find the preferred mime type for a mime bundle.\n *\n * @param bundle - The bundle of mime data.\n *\n * @param safe - How to consider safe/unsafe factories. If 'ensure',\n * it will only consider safe factories. If 'any', any factory will be\n * considered. If 'prefer', unsafe factories will be considered, but\n * only after the safe options have been exhausted.\n *\n * @returns The preferred mime type from the available factories,\n * or `undefined` if the mime type cannot be rendered.\n */\n preferredMimeType(bundle, safe = 'ensure') {\n // Try to find a safe factory first, if preferred.\n if (safe === 'ensure' || safe === 'prefer') {\n for (const mt of this.mimeTypes) {\n if (mt in bundle && this._factories[mt].safe) {\n return mt;\n }\n }\n }\n if (safe !== 'ensure') {\n // Otherwise, search for the best factory among all factories.\n for (const mt of this.mimeTypes) {\n if (mt in bundle) {\n return mt;\n }\n }\n }\n // Otherwise, no matching mime type exists.\n return undefined;\n }\n /**\n * Create a renderer for a mime type.\n *\n * @param mimeType - The mime type of interest.\n *\n * @returns A new renderer for the given mime type.\n *\n * @throws An error if no factory exists for the mime type.\n */\n createRenderer(mimeType) {\n // Throw an error if no factory exists for the mime type.\n if (!(mimeType in this._factories)) {\n throw new Error(`No factory for mime type: '${mimeType}'`);\n }\n // Invoke the best factory for the given mime type.\n return this._factories[mimeType].createRenderer({\n mimeType,\n resolver: this.resolver,\n sanitizer: this.sanitizer,\n linkHandler: this.linkHandler,\n latexTypesetter: this.latexTypesetter,\n markdownParser: this.markdownParser,\n translator: this.translator\n });\n }\n /**\n * Create a new mime model. This is a convenience method.\n *\n * @options - The options used to create the model.\n *\n * @returns A new mime model.\n */\n createModel(options = {}) {\n return new MimeModel(options);\n }\n /**\n * Create a clone of this rendermime instance.\n *\n * @param options - The options for configuring the clone.\n *\n * @returns A new independent clone of the rendermime.\n */\n clone(options = {}) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n // Create the clone.\n const clone = new RenderMimeRegistry({\n resolver: (_b = (_a = options.resolver) !== null && _a !== void 0 ? _a : this.resolver) !== null && _b !== void 0 ? _b : undefined,\n sanitizer: (_d = (_c = options.sanitizer) !== null && _c !== void 0 ? _c : this.sanitizer) !== null && _d !== void 0 ? _d : undefined,\n linkHandler: (_f = (_e = options.linkHandler) !== null && _e !== void 0 ? _e : this.linkHandler) !== null && _f !== void 0 ? _f : undefined,\n latexTypesetter: (_h = (_g = options.latexTypesetter) !== null && _g !== void 0 ? _g : this.latexTypesetter) !== null && _h !== void 0 ? _h : undefined,\n markdownParser: (_k = (_j = options.markdownParser) !== null && _j !== void 0 ? _j : this.markdownParser) !== null && _k !== void 0 ? _k : undefined,\n translator: this.translator\n });\n // Clone the internal state.\n clone._factories = { ...this._factories };\n clone._ranks = { ...this._ranks };\n clone._id = this._id;\n // Return the cloned object.\n return clone;\n }\n /**\n * Get the renderer factory registered for a mime type.\n *\n * @param mimeType - The mime type of interest.\n *\n * @returns The factory for the mime type, or `undefined`.\n */\n getFactory(mimeType) {\n return this._factories[mimeType];\n }\n /**\n * Add a renderer factory to the rendermime.\n *\n * @param factory - The renderer factory of interest.\n *\n * @param rank - The rank of the renderer. A lower rank indicates\n * a higher priority for rendering. If not given, the rank will\n * defer to the `defaultRank` of the factory. If no `defaultRank`\n * is given, it will default to 100.\n *\n * #### Notes\n * The renderer will replace an existing renderer for the given\n * mimeType.\n */\n addFactory(factory, rank) {\n if (rank === undefined) {\n rank = factory.defaultRank;\n if (rank === undefined) {\n rank = 100;\n }\n }\n for (const mt of factory.mimeTypes) {\n this._factories[mt] = factory;\n this._ranks[mt] = { rank, id: this._id++ };\n }\n this._types = null;\n }\n /**\n * Remove a mime type.\n *\n * @param mimeType - The mime type of interest.\n */\n removeMimeType(mimeType) {\n delete this._factories[mimeType];\n delete this._ranks[mimeType];\n this._types = null;\n }\n /**\n * Get the rank for a given mime type.\n *\n * @param mimeType - The mime type of interest.\n *\n * @returns The rank of the mime type or undefined.\n */\n getRank(mimeType) {\n const rank = this._ranks[mimeType];\n return rank && rank.rank;\n }\n /**\n * Set the rank of a given mime type.\n *\n * @param mimeType - The mime type of interest.\n *\n * @param rank - The new rank to assign.\n *\n * #### Notes\n * This is a no-op if the mime type is not registered.\n */\n setRank(mimeType, rank) {\n if (!this._ranks[mimeType]) {\n return;\n }\n const id = this._id++;\n this._ranks[mimeType] = { rank, id };\n this._types = null;\n }\n}\n/**\n * The namespace for `RenderMimeRegistry` class statics.\n */\n(function (RenderMimeRegistry) {\n /**\n * A default resolver that uses a given reference path and a contents manager.\n */\n class UrlResolver {\n /**\n * Create a new url resolver.\n */\n constructor(options) {\n this._path = options.path;\n this._contents = options.contents;\n }\n /**\n * The path of the object, from which local urls can be derived.\n */\n get path() {\n return this._path;\n }\n set path(value) {\n this._path = value;\n }\n /**\n * Resolve a relative url to an absolute url path.\n */\n async resolveUrl(url) {\n if (this.isLocal(url)) {\n const cwd = encodeURI(PathExt.dirname(this.path));\n url = PathExt.resolve(cwd, url);\n }\n return url;\n }\n /**\n * Get the download url of a given absolute url path.\n *\n * #### Notes\n * The returned URL may include a query parameter.\n */\n async getDownloadUrl(urlPath) {\n if (this.isLocal(urlPath)) {\n // decode url->path before passing to contents api\n return this._contents.getDownloadUrl(decodeURIComponent(urlPath));\n }\n return urlPath;\n }\n /**\n * Whether the URL should be handled by the resolver\n * or not.\n *\n * @param allowRoot - Whether the paths starting at Unix-style filesystem root (`/`) are permitted.\n *\n * #### Notes\n * This is similar to the `isLocal` check in `URLExt`,\n * but it also checks whether the path points to any\n * of the `IDrive`s that may be registered with the contents\n * manager.\n */\n isLocal(url, allowRoot = false) {\n if (this.isMalformed(url)) {\n return false;\n }\n return (URLExt.isLocal(url, allowRoot) ||\n !!this._contents.driveName(decodeURI(url)));\n }\n /**\n * Resolve a path from Jupyter kernel to a path:\n * - relative to `root_dir` (preferrably) this is in jupyter-server scope,\n * - path understood and known by kernel (if such a path exists).\n * Returns `null` if there is no file matching provided path in neither\n * kernel nor jupyter-server contents manager.\n */\n async resolvePath(path) {\n // TODO: a clean implementation would be server-side and depends on:\n // https://github.com/jupyter-server/jupyter_server/issues/1280\n const rootDir = PageConfig.getOption('rootUri').replace('file://', '');\n // Workaround: expand `~` path using root dir (if it matches).\n if (path.startsWith('~/') && rootDir.startsWith('/home/')) {\n // For now we assume that kernel is in root dir.\n path = rootDir.split('/').slice(0, 3).join('/') + path.substring(1);\n }\n if (path.startsWith(rootDir) || path.startsWith('./')) {\n try {\n const relativePath = path.replace(rootDir, '');\n // If file exists on the server we have guessed right\n const response = await this._contents.get(relativePath, {\n content: false\n });\n return {\n path: response.path,\n scope: 'server'\n };\n }\n catch (error) {\n // The file seems like should be on the server but is not.\n console.warn(`Could not resolve location of ${path} on server`);\n return null;\n }\n }\n // The file is not accessible from jupyter-server but maybe it is\n // available from DAP `source`; we assume the path is available\n // from kernel because currently we have no way of checking this\n // without introducing a cycle (unless we were to set the debugger\n // service instance on the resolver later).\n return {\n path: path,\n scope: 'kernel'\n };\n }\n /**\n * Whether the URL can be decoded using `decodeURI`.\n */\n isMalformed(url) {\n try {\n decodeURI(url);\n return false;\n }\n catch (error) {\n if (error instanceof URIError) {\n return true;\n }\n throw error;\n }\n }\n }\n RenderMimeRegistry.UrlResolver = UrlResolver;\n})(RenderMimeRegistry || (RenderMimeRegistry = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Get the mime types in the map, ordered by rank.\n */\n function sortedTypes(map) {\n return Object.keys(map).sort((a, b) => {\n const p1 = map[a];\n const p2 = map[b];\n if (p1.rank !== p2.rank) {\n return p1.rank - p2.rank;\n }\n return p1.id - p2.id;\n });\n }\n Private.sortedTypes = sortedTypes;\n})(Private || (Private = {}));\n//# sourceMappingURL=registry.js.map","/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module mathjax2\n */\nimport { PromiseDelegate } from '@lumino/coreutils';\n/**\n * The MathJax Typesetter.\n */\nexport class MathJaxTypesetter {\n /**\n * Create a new MathJax typesetter.\n */\n constructor(options) {\n this._initPromise = new PromiseDelegate();\n this._initialized = false;\n this._url = options.url;\n this._config = options.config;\n }\n /**\n * Typeset the math in a node.\n *\n * #### Notes\n * MathJax schedules the typesetting asynchronously,\n * but there are not currently any callbacks or Promises\n * firing when it is done.\n */\n typeset(node) {\n if (!this._initialized) {\n this._init();\n }\n void this._initPromise.promise.then(() => {\n MathJax.Hub.Queue(['Typeset', MathJax.Hub, node]);\n try {\n MathJax.Hub.Queue(['Require', MathJax.Ajax, '[MathJax]/extensions/TeX/AMSmath.js'], () => {\n MathJax.InputJax.TeX.resetEquationNumbers();\n });\n }\n catch (e) {\n console.error('Error queueing resetEquationNumbers:', e);\n }\n });\n }\n /**\n * Initialize MathJax.\n */\n _init() {\n const head = document.getElementsByTagName('head')[0];\n const script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = `${this._url}?config=${this._config}&delayStartupUntil=configured`;\n script.charset = 'utf-8';\n head.appendChild(script);\n script.addEventListener('load', () => {\n this._onLoad();\n });\n this._initialized = true;\n }\n /**\n * Handle MathJax loading.\n */\n _onLoad() {\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [\n ['$', '$'],\n ['\\\\(', '\\\\)']\n ],\n displayMath: [\n ['$$', '$$'],\n ['\\\\[', '\\\\]']\n ],\n processEscapes: true,\n processEnvironments: true\n },\n // Center justify equations in code and markdown cells. Elsewhere\n // we use CSS to left justify single line equations in code cells.\n displayAlign: 'center',\n CommonHTML: {\n linebreaks: { automatic: true }\n },\n 'HTML-CSS': {\n availableFonts: [],\n imageFont: null,\n preferredFont: null,\n webFont: 'STIX-Web',\n styles: { '.MathJax_Display': { margin: 0 } },\n linebreaks: { automatic: true }\n },\n skipStartupTypeset: true,\n messageStyle: 'none'\n });\n MathJax.Hub.Register.StartupHook('End Config', () => {\n var _a, _b, _c, _d, _e, _f;\n // Disable `:hover span` styles which cause performance issues in Chromium browsers\n // c-f https://github.com/jupyterlab/jupyterlab/issues/9757\n // Note that we cannot overwrite them in config earlier due to how `CombineConfig`\n // is implemented in MathJax 2 (it does not allow removing styles, just expanding).\n (_c = (_b = (_a = MathJax.Hub) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.MathEvents) === null || _c === void 0 ? true : delete _c.styles['.MathJax_Hover_Arrow:hover span'];\n (_f = (_e = (_d = MathJax.Hub) === null || _d === void 0 ? void 0 : _d.config) === null || _e === void 0 ? void 0 : _e.MathMenu) === null || _f === void 0 ? true : delete _f.styles['.MathJax_MenuClose:hover span'];\n });\n MathJax.Hub.Configured();\n this._initPromise.resolve(void 0);\n }\n}\n//# sourceMappingURL=index.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { ServerConnection } from '@jupyterlab/services';\n/**\n * Any object is \"printable\" if it implements the `IPrintable` interface.\n *\n * To do this it, it must have a method called `Printing.symbol` which returns either a function\n * to print the object or null if it cannot be printed.\n *\n * One way of printing is to use the `printWidget` function, which creates a hidden iframe\n * and copies the DOM nodes from your widget to that iframe and printing just that iframe.\n *\n * Another way to print is to use the `printURL` function, which takes a URL and prints that page.\n */\nexport var Printing;\n(function (Printing) {\n /**\n * Symbol to use for a method that returns a function to print an object.\n */\n Printing.symbol = Symbol('printable');\n /**\n * Returns whether an object implements a print method.\n */\n function isPrintable(a) {\n if (typeof a !== 'object' || !a) {\n return false;\n }\n return Printing.symbol in a;\n }\n Printing.isPrintable = isPrintable;\n /**\n * Returns the print function for an object, or null if it does not provide a handler.\n */\n function getPrintFunction(val) {\n if (isPrintable(val)) {\n return val[Printing.symbol]();\n }\n return null;\n }\n Printing.getPrintFunction = getPrintFunction;\n /**\n * Prints a widget by copying it's DOM node\n * to a hidden iframe and printing that iframe.\n */\n function printWidget(widget) {\n return printContent(widget.node);\n }\n Printing.printWidget = printWidget;\n /**\n * Prints a URL by loading it into an iframe.\n *\n * @param url URL to load into an iframe.\n */\n async function printURL(url) {\n const settings = ServerConnection.makeSettings();\n const text = await (await ServerConnection.makeRequest(url, {}, settings)).text();\n return printContent(text);\n }\n Printing.printURL = printURL;\n /**\n * Prints a URL or an element in an iframe and then removes the iframe after printing.\n */\n async function printContent(textOrEl) {\n const isText = typeof textOrEl === 'string';\n const iframe = createIFrame();\n const parent = window.document.body;\n parent.appendChild(iframe);\n if (isText) {\n iframe.srcdoc = textOrEl;\n await resolveWhenLoaded(iframe);\n }\n else {\n iframe.src = 'about:blank';\n await resolveWhenLoaded(iframe);\n setIFrameNode(iframe, textOrEl);\n }\n const printed = resolveAfterEvent();\n launchPrint(iframe.contentWindow);\n // Once the print dialog has been dismissed, we regain event handling,\n // and it should be safe to discard the hidden iframe.\n await printed;\n parent.removeChild(iframe);\n }\n /**\n * Creates a new hidden iframe and appends it to the document\n *\n * Modified from\n * https://github.com/joseluisq/printd/blob/eb7948d602583c055ab6dee3ee294b6a421da4b6/src/index.ts#L24\n */\n function createIFrame() {\n const el = window.document.createElement('iframe');\n // We need both allow-modals and allow-same-origin to be able to\n // call print in the iframe.\n // We intentionally do not allow scripts:\n // https://github.com/jupyterlab/jupyterlab/pull/5850#pullrequestreview-230899790\n el.setAttribute('sandbox', 'allow-modals allow-same-origin');\n const css = 'visibility:hidden;width:0;height:0;position:absolute;z-index:-9999;bottom:0;';\n el.setAttribute('style', css);\n el.setAttribute('width', '0');\n el.setAttribute('height', '0');\n return el;\n }\n /**\n * Copies a node from the base document to the iframe.\n */\n function setIFrameNode(iframe, node) {\n iframe.contentDocument.body.appendChild(node.cloneNode(true));\n iframe.contentDocument.close();\n }\n /**\n * Promise that resolves when all resources are loaded in the window.\n */\n function resolveWhenLoaded(iframe) {\n return new Promise(resolve => {\n iframe.onload = () => resolve();\n });\n }\n /**\n * A promise that resolves after the next mousedown, mousemove, or\n * keydown event. We use this as a proxy for determining when the\n * main window has regained control after the print dialog is removed.\n *\n * We can't use the usual window.onafterprint handler because we\n * disallow Javascript execution in the print iframe.\n */\n function resolveAfterEvent() {\n return new Promise(resolve => {\n const onEvent = () => {\n document.removeEventListener('mousemove', onEvent, true);\n document.removeEventListener('mousedown', onEvent, true);\n document.removeEventListener('keydown', onEvent, true);\n resolve();\n };\n document.addEventListener('mousemove', onEvent, true);\n document.addEventListener('mousedown', onEvent, true);\n document.addEventListener('keydown', onEvent, true);\n });\n }\n /**\n * Prints a content window.\n */\n function launchPrint(contentWindow) {\n const result = contentWindow.document.execCommand('print', false);\n // execCommand won't work in firefox so we call the `print` method instead if it fails\n // https://github.com/joseluisq/printd/blob/eb7948d602583c055ab6dee3ee294b6a421da4b6/src/index.ts#L148\n if (!result) {\n contentWindow.print();\n }\n }\n})(Printing || (Printing = {}));\n//# sourceMappingURL=printing.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module json-extension\n */\nimport { Printing } from '@jupyterlab/apputils';\nimport { nullTranslator } from '@jupyterlab/translation';\nimport { Widget } from '@lumino/widgets';\nimport * as React from 'react';\nimport { createRoot } from 'react-dom/client';\n/**\n * The CSS class to add to the JSON Widget.\n */\nconst CSS_CLASS = 'jp-RenderedJSON';\n/**\n * The MIME type for JSON.\n */\nexport const MIME_TYPE = 'application/json';\n// NOTE: not standardized yet\nexport const MIME_TYPES_JSONL = [\n 'text/jsonl',\n 'application/jsonl',\n 'application/json-lines'\n];\n/**\n * A renderer for JSON data.\n */\nexport class RenderedJSON extends Widget {\n /**\n * Create a new widget for rendering JSON.\n */\n constructor(options) {\n super();\n this._rootDOM = null;\n this.addClass(CSS_CLASS);\n this.addClass('CodeMirror');\n this._mimeType = options.mimeType;\n this.translator = options.translator || nullTranslator;\n }\n [Printing.symbol]() {\n return () => Printing.printWidget(this);\n }\n /**\n * Render JSON into this widget's node.\n */\n async renderModel(model) {\n const { Component } = await import('./component');\n let data;\n // handle if json-lines format\n if (MIME_TYPES_JSONL.indexOf(this._mimeType) >= 0) {\n // convert into proper json\n const lines = (model.data[this._mimeType] || '')\n .trim()\n .split(/\\n/);\n data = JSON.parse(`[${lines.join(',')}]`);\n }\n else {\n data = (model.data[this._mimeType] || {});\n }\n const metadata = (model.metadata[this._mimeType] || {});\n if (this._rootDOM === null) {\n this._rootDOM = createRoot(this.node);\n }\n return new Promise((resolve, reject) => {\n this._rootDOM.render(React.createElement(Component, { data: data, metadata: metadata, translator: this.translator, forwardedRef: () => resolve() }));\n });\n }\n /**\n * Called before the widget is detached from the DOM.\n */\n onBeforeDetach(msg) {\n // Unmount the component so it can tear down.\n if (this._rootDOM) {\n this._rootDOM.unmount();\n this._rootDOM = null;\n }\n }\n}\n/**\n * A mime renderer factory for JSON data.\n */\nexport const rendererFactory = {\n safe: true,\n mimeTypes: [MIME_TYPE, ...MIME_TYPES_JSONL],\n createRenderer: options => new RenderedJSON(options)\n};\nconst extensions = [\n {\n id: '@jupyterlab/json-extension:factory',\n description: 'Adds renderer for JSON content.',\n rendererFactory,\n rank: 0,\n dataType: 'json',\n documentWidgetFactoryOptions: {\n name: 'JSON',\n // TODO: how to translate label of the factory?\n primaryFileType: 'json',\n fileTypes: ['json', 'notebook', 'geojson'],\n defaultFor: ['json']\n }\n },\n {\n id: '@jupyterlab/json-lines-extension:factory',\n description: 'Adds renderer for JSONLines content.',\n rendererFactory,\n rank: 0,\n dataType: 'string',\n documentWidgetFactoryOptions: {\n name: 'JSONLines',\n primaryFileType: 'jsonl',\n fileTypes: ['jsonl', 'ndjson'],\n defaultFor: ['jsonl', 'ndjson']\n }\n }\n];\nexport default extensions;\n//# sourceMappingURL=index.js.map","import {\n makeBinderOptions,\n makeKernelOptions,\n makeSavedSessionOptions,\n makeServerSettings,\n} from './options';\nimport { ThebeEvents } from './events';\nimport type {\n BinderOptions,\n KernelOptions,\n CoreOptions,\n SavedSessionOptions,\n ServerSettings,\n MathjaxOptions,\n} from './types';\n\nexport class Config {\n private _options: Required<\n Omit\n >;\n private _binderOptions: Required;\n private _savedSessions: Required;\n private _kernelOptions: Required;\n private _serverSettings: Required> & { wsUrl?: string };\n private _events: ThebeEvents;\n\n constructor(opts: CoreOptions = {}, extraConfig?: { events?: ThebeEvents }) {\n this._events = extraConfig?.events ?? new ThebeEvents();\n\n this._options = {\n mathjaxUrl:\n opts.mathjaxUrl ?? 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js',\n mathjaxConfig: opts.mathjaxConfig ?? 'TeX-AMS_CHTML-full,Safe',\n };\n\n this._binderOptions = makeBinderOptions(opts.binderOptions ?? {});\n this._savedSessions = makeSavedSessionOptions(opts.savedSessionOptions ?? {});\n this._kernelOptions = makeKernelOptions(opts.kernelOptions ?? {});\n this._serverSettings = makeServerSettings(opts.serverSettings ?? {});\n\n console.debug('thebe:config:constructor', this);\n }\n\n get events() {\n return this._events;\n }\n\n get base() {\n return this._options;\n }\n\n get mathjax(): MathjaxOptions {\n return {\n mathjaxUrl: this._options.mathjaxUrl,\n mathjaxConfig: this._options.mathjaxConfig,\n };\n }\n\n get binder() {\n return this._binderOptions;\n }\n\n get savedSessions() {\n return this._savedSessions;\n }\n\n get kernels() {\n return this._kernelOptions;\n }\n\n get serverSettings() {\n return this._serverSettings;\n }\n\n set serverSettings(newSettings: Required> & { wsUrl?: string }) {\n this._serverSettings = newSettings;\n }\n}\n","import { Config } from './config';\nimport type { ThebeEvents } from './events';\nimport type {\n ServerSettings,\n BinderOptions,\n KernelOptions,\n CoreOptions,\n SavedSessionOptions,\n MathjaxOptions,\n} from './types';\nimport { shortId } from './utils';\n\nexport function makeBinderOptions(opts: BinderOptions) {\n return {\n repo: 'executablebooks/thebe-binder-base',\n ref: 'HEAD',\n binderUrl: 'https://mybinder.org',\n repoProvider: 'github',\n ...opts,\n };\n}\n\nexport function makeSavedSessionOptions(opts: SavedSessionOptions): Required {\n return {\n enabled: true,\n maxAge: 86400,\n storagePrefix: 'thebe-binder',\n ...opts,\n };\n}\n\nexport function makeKernelOptions(opts: KernelOptions): Required {\n return {\n path: opts.path ?? '/',\n kernelName: opts.kernelName ?? 'python',\n };\n}\n\nexport function makeServerSettings(settings: ServerSettings): Required {\n const baseUrl = settings.baseUrl ?? 'http://localhost:8888';\n const wsUrl = settings.wsUrl ?? baseUrl.replace(/^http/, 'ws');\n\n return {\n token: shortId(), // randomized default token to prevent accidental access to a local server\n appendToken: true,\n ...settings,\n wsUrl,\n baseUrl,\n };\n}\n\nexport function makeMathjaxOptions(opts?: MathjaxOptions) {\n return {\n mathjaxUrl: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js',\n mathjaxConfig: 'TeX-AMS_CHTML-full,Safe',\n ...opts,\n };\n}\n\nexport function makeConfiguration(\n options: CoreOptions & { [k: string]: any },\n events?: ThebeEvents,\n) {\n return new Config(options, { events });\n}\n\nexport function ensureCoreOptions(\n options: CoreOptions & { [k: string]: any },\n events?: ThebeEvents,\n): Required {\n const config = new Config(options, { events });\n\n return {\n ...config.base,\n binderOptions: config.binder,\n savedSessionOptions: config.savedSessions,\n kernelOptions: config.kernels,\n serverSettings: config.serverSettings,\n };\n}\n","import type { IRenderMime } from '@jupyterlab/rendermime';\nimport {\n RenderMimeRegistry,\n htmlRendererFactory,\n markdownRendererFactory,\n latexRendererFactory,\n svgRendererFactory,\n imageRendererFactory,\n textRendererFactory,\n errorRendererFactory,\n} from '@jupyterlab/rendermime';\nimport type { MathjaxOptions } from './types';\nimport { MathJaxTypesetter } from '@jupyterlab/mathjax2';\nimport { rendererFactory as javascriptRendererFactory } from '@jupyterlab/javascript-extension';\nimport { rendererFactory as jsonRendererFactory } from '@jupyterlab/json-extension';\nimport { makeMathjaxOptions } from './options';\n\nconst EXTENDED_FACTORIES = [\n htmlRendererFactory,\n markdownRendererFactory,\n latexRendererFactory,\n svgRendererFactory,\n imageRendererFactory,\n javascriptRendererFactory,\n textRendererFactory,\n errorRendererFactory,\n];\n\nlet RENDERERS: IRenderMime.IRendererFactory[] | null = null;\n\nexport function getRenderers(mathjax: MathjaxOptions) {\n if (RENDERERS == null) {\n RENDERERS = EXTENDED_FACTORIES.filter((f) => {\n // filter out latex renderer if mathjax is unavailable\n if (f.mimeTypes.indexOf('text/latex') >= 0) {\n if (mathjax.mathjaxUrl) {\n return true;\n } else {\n console.debug('thebe:getRenderers MathJax unavailable');\n return false;\n }\n } else {\n return true;\n }\n });\n }\n let latexTypesetter;\n if (mathjax.mathjaxUrl && mathjax.mathjaxConfig) {\n latexTypesetter = new MathJaxTypesetter({\n url: mathjax.mathjaxUrl,\n config: mathjax.mathjaxConfig,\n });\n }\n return {\n initialFactories: [...RENDERERS],\n latexTypesetter,\n };\n}\n\nexport function makeRenderMimeRegistry(mathjax?: MathjaxOptions) {\n const rendermime = new RenderMimeRegistry(getRenderers(mathjax ?? makeMathjaxOptions()));\n rendermime.addFactory(jsonRendererFactory, 10);\n return rendermime;\n}\n","import type * as nbformat from '@jupyterlab/nbformat';\nimport { makeRenderMimeRegistry } from './rendermime';\nimport { OutputArea, OutputAreaModel } from '@jupyterlab/outputarea';\nimport type { IRenderMimeRegistry } from '@jupyterlab/rendermime';\nimport type { IPassiveCell, MathjaxOptions } from './types';\nimport { makeMathjaxOptions } from './options';\nimport { Widget } from '@lumino/widgets';\nimport { MessageLoop } from '@lumino/messaging';\n\nclass PassiveCellRenderer implements IPassiveCell {\n readonly id: string;\n readonly rendermime: IRenderMimeRegistry;\n protected model: OutputAreaModel;\n protected area: OutputArea;\n\n constructor(id: string, rendermime?: IRenderMimeRegistry, mathjax?: MathjaxOptions) {\n this.id = id;\n this.rendermime = rendermime ?? makeRenderMimeRegistry(mathjax ?? makeMathjaxOptions());\n this.model = new OutputAreaModel({ trusted: true });\n this.area = new OutputArea({\n model: this.model,\n rendermime: this.rendermime,\n });\n }\n\n /**\n * Serialize the model state to JSON\n */\n get outputs(): nbformat.IOutput[] {\n return this.model.toJSON();\n }\n\n get isAttachedToDOM() {\n return this.area.isAttached;\n }\n\n attachToDOM(el?: HTMLElement, strict = false) {\n if (!this.area || !el) {\n console.error(\n `thebe:renderer:attachToDOM - could not attach to DOM - area: ${this.area}, el: ${el}`,\n );\n return;\n }\n if (this.area.isAttached) {\n // TODO should we detach and reattach?\n console.debug(`thebe:renderer:attachToDOM - already attached`);\n if (strict) return;\n } else {\n // if the target element has contents, preserve it but wrap it in our output area\n console.debug(`thebe:renderer:attachToDOM ${this.id} - appending existing contents`);\n if (el.innerHTML) {\n this.area.model.add({\n output_type: 'display_data',\n data: {\n 'text/html': el.innerHTML,\n },\n });\n }\n }\n\n el.textContent = '';\n\n const div = document.createElement('div');\n div.style.position = 'relative';\n div.className = 'thebe-output';\n el.append(div);\n\n MessageLoop.sendMessage(this.area, Widget.Msg.BeforeAttach);\n div.appendChild(this.area.node);\n MessageLoop.sendMessage(this.area, Widget.Msg.AfterAttach);\n }\n\n setOutputText(text: string) {\n if (!this.area) return;\n this.area.model.clear(true);\n this.area.model.add({\n output_type: 'stream',\n name: 'stdout',\n text,\n });\n }\n\n /**\n * Clears the output area model\n *\n * @returns\n */\n clear() {\n if (!this.area) return;\n this.area.model.clear();\n }\n\n /**\n * Will trigger the output to render an error with text taken from the optional argument\n *\n * @param error\n * @returns\n */\n clearOnError(error?: any) {\n if (!this.area) return;\n this.area.model.clear();\n this.area.model.add({\n output_type: 'stream',\n name: 'stderr',\n text: `Failed to execute. ${error ?? ''} Please refresh the page.`,\n });\n }\n\n /**\n * Render output data directly from json\n *\n * @param outputs - serialised jupyter outputs\n * @returns\n */\n render(outputs: nbformat.IOutput[]) {\n this.model.fromJSON(outputs);\n }\n}\n\nexport default PassiveCellRenderer;\n","import type { CellKind, IThebeCell, IThebeCellExecuteReturn, JsonObject } from './types';\nimport type ThebeSession from './session';\nimport PassiveCellRenderer from './passive';\nimport type { IRenderMimeRegistry } from '@jupyterlab/rendermime';\nimport type { Config } from './config';\nimport { CellStatusEvent, ErrorStatusEvent, errorToMessage, EventSubject } from './events';\nimport { EventEmitter } from './emitter';\nimport type { ICodeCell, IError, IOutput } from '@jupyterlab/nbformat';\nimport { ensureString, shortId } from './utils';\n\nclass ThebeCodeCell extends PassiveCellRenderer implements IThebeCell {\n kind: CellKind;\n source: string;\n metadata: JsonObject;\n session?: ThebeSession;\n executionCount: number | null;\n protected initialOutputs: IOutput[];\n readonly notebookId: string;\n protected busy: boolean;\n protected events: EventEmitter;\n\n constructor(\n id: string,\n notebookId: string,\n source: string,\n config: Config,\n metadata: JsonObject,\n rendermime: IRenderMimeRegistry,\n ) {\n super(id, rendermime);\n this.kind = 'code';\n this.events = new EventEmitter(id, config, EventSubject.cell, this);\n this.notebookId = notebookId;\n this.source = source;\n this.metadata = metadata;\n this.busy = false;\n this.executionCount = null;\n this.initialOutputs = [];\n console.debug('thebe:cell constructor', this);\n }\n\n static fromICodeCell(\n icc: ICodeCell,\n notebookId: string,\n config: Config,\n rendermime: IRenderMimeRegistry,\n ) {\n const cell = new ThebeCodeCell(\n icc.id ?? shortId(),\n notebookId,\n ensureString(icc.source),\n config,\n icc.metadata,\n rendermime,\n );\n Object.assign(cell.metadata, icc.metadata);\n\n return cell;\n }\n\n get isBusy() {\n return this.busy;\n }\n\n get isAttached() {\n return this.session !== undefined;\n }\n\n get tags(): string[] {\n return this.metadata.tags ?? [];\n }\n\n /**\n * Attaches to the session and adds the widgets factory to the rendermine registry\n * call this version if using ThebeCell in isolation, otherwise call ThebeNotebook::attachSession\n *\n * @param session\n */\n attachSession(session: ThebeSession) {\n this.session = session;\n this.events.triggerStatus({\n status: CellStatusEvent.attached,\n message: 'Attached to session',\n });\n }\n\n /**\n * Detaches from the session and removes the widgets factory from the rendermine registry\n * call this version if using ThebeCell in isolation, otherwise call ThebeNotebook::detachSession\n *\n */\n detachSession() {\n this.session = undefined;\n this.events.triggerStatus({\n status: CellStatusEvent.detached,\n message: 'Detached from session',\n });\n }\n\n setAsBusy() {\n console.debug(`thebe:renderer:message:busy ${this.id}`);\n this.busy = true;\n this.events.triggerStatus({\n status: CellStatusEvent.executing,\n message: 'Executing...',\n });\n }\n\n setAsIdle() {\n console.debug(`thebe:renderer:message:completed ${this.id}`);\n this.busy = false;\n this.events.triggerStatus({\n status: CellStatusEvent.idle,\n message: 'Completed',\n });\n }\n\n /**\n * reset the DOM representation of the cell to the initial state\n * along with the execution count\n *\n * @param hideWidgets boolean - if true, hide widgets\n */\n initOutputs(initialOutputs: IOutput[]) {\n this.initialOutputs = initialOutputs;\n this.render(initialOutputs);\n this.executionCount = null;\n }\n\n /**\n * reset the DOM representation of the cell to the initial state\n * along with the execution count\n *\n * @param hideWidgets boolean - if true, hide widgets\n */\n reset() {\n this.render(this.initialOutputs);\n this.executionCount = null;\n }\n\n /**\n * TODO\n * - pass execute_count or timestamp or something back to redux on success/failure?\n *\n * @param source?\n * @returns\n */\n async execute(source?: string): Promise {\n if (!this.session || !this.session.kernel) {\n console.warn('Attempting to execute on a cell without an attached kernel');\n return null;\n }\n\n const code = source ?? this.source;\n\n try {\n console.debug(`thebe:renderer:execute ${this.id}`);\n if (!this.isBusy) this.setAsBusy();\n\n this.area.future = this.session.kernel.requestExecute({ code });\n\n // TODO consider how to enable execution without the await here\n const reply = await this.area.future.done;\n this.executionCount = reply.content.execution_count;\n\n let executeErrors: IError[] | undefined;\n for (let i = 0; i < this.model.length; i++) {\n const out = this.model.get(i);\n console.debug('thebecell:execute:output', { out: out.toJSON() });\n if (out.type === 'error') {\n const json = out.toJSON() as IError;\n if (json.ename === 'stderr') {\n this.events.triggerError({\n status: ErrorStatusEvent.warning,\n message: errorToMessage(json),\n });\n } else {\n if (!executeErrors) executeErrors = [json];\n else executeErrors?.push(json);\n this.events.triggerError({\n status: ErrorStatusEvent.executeError,\n message: errorToMessage(json),\n });\n }\n }\n }\n\n this.setAsIdle();\n return {\n id: this.id,\n height: this.area.node.offsetHeight,\n width: this.area.node.offsetWidth,\n error: executeErrors,\n };\n } catch (err: any) {\n console.error('thebe:renderer:execute Error:', err);\n this.clearOnError(err);\n this.events.triggerError(err.message);\n return null;\n }\n }\n}\n\nexport default ThebeCodeCell;\n","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { ICell, IOutput } from '@jupyterlab/nbformat';\nimport type { IRenderMimeRegistry } from '@jupyterlab/rendermime';\nimport PassiveCellRenderer from './passive';\nimport type ThebeSession from './session';\nimport type { CellKind, IThebeCell, IThebeCellExecuteReturn, JsonObject } from './types';\nimport { ensureString, shortId } from './utils';\n\n/**\n * A Thebe cell that is exepected to contain markdown (or raw) source.\n *\n * Currently this just separates content cells from code cells and thebe provides no\n * special handling for markdown cells.\n *\n */\nexport default class ThebeMarkdownCell extends PassiveCellRenderer implements IThebeCell {\n id: string;\n notebookId: string;\n kind: CellKind;\n source: string;\n busy: boolean;\n metadata: JsonObject;\n\n constructor(\n id: string,\n notebookId: string,\n source: string,\n metadata: JsonObject,\n rendermime: IRenderMimeRegistry,\n ) {\n super(id, rendermime);\n this.kind = 'markdown';\n this.id = id;\n this.notebookId = notebookId;\n this.source = source;\n this.busy = false;\n this.metadata = metadata;\n }\n\n static fromICell(ic: ICell, notebookId: string, rendermime: IRenderMimeRegistry) {\n const cell = new ThebeMarkdownCell(\n typeof ic.id === 'string' ? ic.id : shortId(),\n notebookId,\n ensureString(ic.source),\n ic.metadata,\n rendermime,\n );\n return cell;\n }\n\n get isAttachedToDOM() {\n return false;\n }\n\n get isBusy() {\n return false;\n }\n\n get isAttached() {\n return false;\n }\n\n get executionCount(): number | null {\n return null;\n }\n\n setAsBusy(): void {\n // no-op\n }\n\n setAsIdle(): void {\n // no-op\n }\n\n initOutputs(initialOutputs: IOutput[]) {\n // no-op\n }\n\n reset() {\n // no-op\n }\n\n attachToDOM(el?: HTMLElement) {\n // could potentially allow for markdown rendering here\n }\n\n attachSession(session: ThebeSession) {\n // no-op\n }\n\n detachSession(): void {\n // no-op\n }\n\n setOutputText(text: string) {\n // no-op\n }\n\n clear() {\n // no-op\n }\n\n clearOnError(error?: any) {\n // no-op\n }\n\n messageBusy(): void {\n // no-op\n }\n\n messageCompleted(): void {\n // no-op\n }\n\n messageError(message: string): void {\n // no-op\n }\n\n render(outputs: IOutput[]): void {\n // no-op\n }\n\n get tags(): string[] {\n return [];\n }\n\n get outputs() {\n return [] as IOutput[];\n }\n\n async execute(source?: string): Promise {\n // could potentially allow for markdown rendering here\n return { id: this.id, height: 0, width: 0 };\n }\n}\n","import ThebeCodeCell from './cell';\nimport type ThebeSession from './session';\nimport type { IThebeCell, IThebeCellExecuteReturn } from './types';\nimport { shortId } from './utils';\nimport type { IRenderMimeRegistry } from '@jupyterlab/rendermime';\nimport type { Config } from './config';\nimport { EventSubject, NotebookStatusEvent } from './events';\nimport { EventEmitter } from './emitter';\nimport type { ICodeCell, INotebookContent, INotebookMetadata } from '@jupyterlab/nbformat';\nimport ThebeMarkdownCell from './markdown';\n\nexport interface CodeBlock {\n id: string;\n source: string;\n [x: string]: any;\n}\n\nclass ThebeNotebook {\n readonly id: string;\n readonly rendermime: IRenderMimeRegistry;\n cells: IThebeCell[];\n metadata: INotebookMetadata;\n session?: ThebeSession;\n protected events: EventEmitter;\n\n constructor(id: string, config: Config, rendermime: IRenderMimeRegistry) {\n this.id = id;\n this.events = new EventEmitter(id, config, EventSubject.notebook, this);\n this.cells = [];\n this.metadata = {};\n this.rendermime = rendermime;\n console.debug('thebe:notebook constructor', this);\n }\n\n static fromCodeBlocks(blocks: CodeBlock[], config: Config, rendermime: IRenderMimeRegistry) {\n const id = shortId();\n const notebook = new ThebeNotebook(id, config, rendermime);\n notebook.cells = blocks.map((c) => {\n const metadata = {};\n const cell = new ThebeCodeCell(c.id, id, c.source, config, metadata, notebook.rendermime);\n console.debug(`thebe:notebook:fromCodeBlocks Initializing cell ${c.id}`);\n return cell;\n });\n\n return notebook;\n }\n\n static fromIpynb(ipynb: INotebookContent, config: Config, rendermime: IRenderMimeRegistry) {\n const notebook = new ThebeNotebook(shortId(), config, rendermime);\n\n Object.assign(notebook.metadata, ipynb.metadata);\n\n notebook.cells = ipynb.cells.map((c) => {\n if ((c as ICodeCell).cell_type === 'code')\n return ThebeCodeCell.fromICodeCell(\n c as ICodeCell,\n notebook.id,\n config,\n notebook.rendermime,\n );\n return ThebeMarkdownCell.fromICell(c, notebook.id, notebook.rendermime);\n });\n\n return notebook;\n }\n\n get parameters() {\n const p = this.findCells('parameters');\n if (!p || p?.length === 0) return undefined;\n if (p.length > 1) console.warn(`Mulitple parameter cells found in notebook ${this.id}`);\n return p;\n }\n\n get widgets() {\n return this.findCells('widget') ?? [];\n }\n\n get last() {\n if (this.cells.length === 0) throw new Error('empty notebook');\n return this.cells[this.cells.length - 1];\n }\n\n get markdown() {\n return this.cells.filter((c) => c.kind === 'markdown');\n }\n\n get code() {\n return this.cells.filter((c) => c.kind === 'code');\n }\n\n /**\n * reset the notebook to its initial state by resetting each cell\n *\n * @param hideWidgets boolean\n */\n reset() {\n this.cells.forEach((cell) => cell.reset());\n }\n\n numCells() {\n return this.cells?.length ?? 0;\n }\n\n findCells(tag: string) {\n const found = this.cells.filter((c) => c.tags.includes(tag));\n return found.length > 0 ? found : undefined;\n }\n\n getCell(idx: number) {\n if (!this.cells) throw Error('Dag not initialized');\n if (idx >= this.cells.length)\n throw Error(`Notebook.cells index out of range: ${idx}:${this.cells.length}`);\n return this.cells[idx];\n }\n\n getCellById(id: string) {\n const cell = this.cells?.find((c) => c.id === id);\n return cell;\n }\n\n lastCell() {\n if (!this.cells) throw Error('Notebook not initialized');\n return this.cells[this.cells.length - 1];\n }\n\n updateParameters(newSource: string, interpolate = false) {\n if (interpolate) throw new Error('Not implemented yet');\n if (this.parameters) this.parameters[0].source = newSource;\n }\n\n async waitForKernel(kernel: Promise) {\n return kernel.then((k) => {\n this.attachSession(k);\n return k;\n });\n }\n\n attachSession(session: ThebeSession) {\n if (!session.kernel) throw Error('ThebeNotebook - cannot connect to session, no kernel');\n // note all cells in a notebook share the rendermime registry\n // we only need to add the widgets factory once\n this.session = session;\n this.cells?.forEach((cell) => (cell.session = session));\n this.events.triggerStatus({\n status: NotebookStatusEvent.attached,\n message: 'Attached to session',\n });\n }\n\n detachSession() {\n this.cells?.map((cell) => (cell.session = undefined));\n this.session = undefined;\n this.events.triggerStatus({\n status: NotebookStatusEvent.detached,\n message: 'Detached from session',\n });\n }\n\n clear() {\n this.cells.forEach((cell) => cell.clear());\n }\n\n async executeUpTo(\n cellId: string,\n stopOnError = false,\n preprocessor?: (s: string) => string,\n ): Promise<(IThebeCellExecuteReturn | null)[]> {\n if (!this.cells) return [];\n this.events.triggerStatus({\n status: NotebookStatusEvent.executing,\n message: `executeUpTo ${cellId}`,\n });\n const idx = this.cells.findIndex((c) => c.id === cellId);\n if (idx === -1) return [];\n const cellsToExecute = this.cells.slice(0, idx + 1);\n cellsToExecute.map((cell) => cell.setAsBusy());\n const result = await this.executeCells(\n cellsToExecute.map((c) => c.id),\n stopOnError,\n preprocessor,\n );\n // TODO intercept errors here\n this.events.triggerStatus({\n status: NotebookStatusEvent.idle,\n message: `executeUpTo ${cellId}`,\n });\n\n return result;\n }\n\n async executeOnly(\n cellId: string,\n preprocessor?: (s: string) => string,\n ): Promise {\n if (!this.cells) return null;\n this.events.triggerStatus({\n status: NotebookStatusEvent.executing,\n message: `executeOnly ${cellId}`,\n });\n const result = await this.executeCells([cellId], false, preprocessor);\n this.events.triggerStatus({\n status: NotebookStatusEvent.idle,\n message: `executeUpTo ${cellId}`,\n });\n\n return result[0];\n }\n\n async executeCells(\n cellIds: string[],\n stopOnError = false,\n preprocessor?: (s: string) => string,\n ): Promise<(IThebeCellExecuteReturn | null)[]> {\n if (!this.cells) return [];\n this.events.triggerStatus({\n status: NotebookStatusEvent.executing,\n message: `executeCells ${cellIds.length} cells`,\n });\n const cells = this.cells.filter((c) => {\n const found = cellIds.find((id) => id === c.id);\n if (!found) {\n console.warn(`Cell ${c.id} not found in notebook`);\n }\n return Boolean(found);\n });\n\n let result: (IThebeCellExecuteReturn | null)[] = [];\n\n if (stopOnError) {\n let skipRemaining = false;\n for (const cell of cells) {\n if (skipRemaining) continue;\n const cellReturn = await cell.execute(\n preprocessor ? preprocessor(cell.source) : cell.source,\n );\n if (cellReturn == null || cellReturn.error) skipRemaining = true;\n result.push(cellReturn);\n }\n } else {\n result = await Promise.all(\n cells.map((cell) => cell.execute(preprocessor ? preprocessor(cell.source) : cell.source)),\n );\n }\n\n this.events.triggerStatus({\n status: NotebookStatusEvent.idle,\n message: `executeCells executed ${cellIds.length} cells`,\n });\n return result;\n }\n\n async executeAll(\n stopOnError = false,\n preprocessor?: (s: string) => string,\n ): Promise<(IThebeCellExecuteReturn | null)[]> {\n if (!this.cells) return [];\n\n this.events.triggerStatus({\n status: NotebookStatusEvent.executing,\n message: `executeAll`,\n });\n\n this.cells.map((cell) => cell.setAsBusy());\n\n const result = await this.executeCells(\n this.cells.map((c) => c.id),\n stopOnError,\n preprocessor,\n );\n\n this.events.triggerStatus({\n status: NotebookStatusEvent.idle,\n message: `executeAll`,\n });\n\n return result;\n }\n}\n\nexport default ThebeNotebook;\n","import ThebeServer from '../server';\nimport type { CodeBlock } from '../notebook';\nimport ThebeNotebook from '../notebook';\nimport type { INotebookContent } from '@jupyterlab/nbformat';\nimport type { Config } from '..';\nimport { ThebeEvents } from '../events';\nimport { makeConfiguration } from '../options';\nimport { makeRenderMimeRegistry } from '../rendermime';\nimport * as coreModule from '../index';\nimport type { IRenderMimeRegistry } from '@jupyterlab/rendermime';\n\nexport function connectToBinder(config: Config): ThebeServer {\n const server: ThebeServer = new ThebeServer(config);\n console.debug(`thebe:api:connect binder 📡`, config.binder);\n server.connectToServerViaBinder();\n return server;\n}\n\nexport function connectToJupyter(config: Config): ThebeServer {\n const server: ThebeServer = new ThebeServer(config);\n console.debug(`thebe:api:connect direct 🔌`, config.serverSettings);\n server.connectToJupyterServer();\n return server;\n}\n\nexport function connectToJupyterLite(config: Config): ThebeServer {\n const server: ThebeServer = new ThebeServer(config);\n console.debug(`thebe:api:connect JupyterLite 🤘`);\n server.connectToJupyterLiteServer();\n return server;\n}\n\nexport function makeEvents() {\n return new ThebeEvents();\n}\n\nexport function makeServer(config: Config) {\n return new ThebeServer(config);\n}\n\nexport function setupNotebookFromBlocks(\n blocks: CodeBlock[],\n config: Config,\n rendermime: IRenderMimeRegistry,\n) {\n return ThebeNotebook.fromCodeBlocks(blocks, config, rendermime);\n}\n\nexport function setupNotebookFromIpynb(\n ipynb: INotebookContent,\n config: Config,\n rendermime: IRenderMimeRegistry,\n) {\n return ThebeNotebook.fromIpynb(ipynb, config, rendermime);\n}\n\nexport function setupThebeCore() {\n console.debug(`thebe:api:setupThebeCore`, { coreModule });\n window.thebeCore = Object.assign(window.thebeCore ?? {}, {\n module: coreModule,\n api: {\n makeConfiguration,\n makeEvents,\n makeServer,\n makeRenderMimeRegistry,\n connectToBinder,\n connectToJupyter,\n connectToJupyterLite,\n setupNotebookFromBlocks,\n setupNotebookFromIpynb,\n },\n });\n}\n","/* eslint-disable import/no-duplicates */\n/**\n * thebe/index.js is the entrypoint for the webpack build and will\n * be invoked on module load, seting up context with an independent store\n * and adding to the window object.\n */\nimport type ThebeServer from '../server';\nimport type { CodeBlock } from '../notebook';\nimport type ThebeNotebook from '../notebook';\nimport type { CoreOptions } from '../types';\nimport type { Config } from '../config';\nimport type { ThebeEvents } from '../events';\nimport type { ThebeLiteGlobal } from 'thebe-lite';\nimport type * as coreModule from '../index';\nimport type { INotebookContent } from '@jupyterlab/nbformat';\nimport type { IRenderMimeRegistry } from '@jupyterlab/rendermime';\nimport { setupThebeCore } from './api';\n\n/**\n * This file is the main entrypoint for the cjs bundle\n * For the TS module, use setupThebeCore()\n */\n\nexport interface JsApi {\n makeEvents: () => ThebeEvents;\n makeConfiguration: (options: Partial, events?: ThebeEvents) => Config;\n makeServer: (config: Config) => ThebeServer;\n makeRenderMimeRegistry: (mathjax?: coreModule.MathjaxOptions | undefined) => IRenderMimeRegistry;\n connectToBinder: (config: Config) => ThebeServer;\n connectToJupyter: (config: Config) => ThebeServer;\n connectToJupyterLite: (config: Config) => ThebeServer;\n setupNotebookFromBlocks: (\n blocks: CodeBlock[],\n config: Config,\n rendermime: IRenderMimeRegistry,\n ) => ThebeNotebook;\n setupNotebookFromIpynb: (\n ipynb: INotebookContent,\n config: Config,\n rendermime: IRenderMimeRegistry,\n ) => ThebeNotebook;\n}\n\nexport type ThebeCore = typeof coreModule;\n\nexport interface ThebeCoreGlobal {\n module: ThebeCore;\n api: JsApi;\n}\n\ndeclare global {\n interface Window {\n define: any;\n requirejs: any;\n thebeLite?: ThebeLiteGlobal;\n thebeCore?: ThebeCoreGlobal;\n }\n}\n\nif (typeof window !== 'undefined') setupThebeCore();\n","import type { Options } from './options';\n\nexport class ActivateWidget {\n options: Partial;\n\n constructor(options?: Options) {\n this.options = options ?? {};\n }\n\n mount() {\n const el = document.querySelector('.thebe-activate');\n\n const box = document.createElement('div');\n box.classList.add('thebe-activate');\n\n const btn = document.createElement('button');\n btn.textContent = 'Activate';\n btn.classList.add('thebe-activate-button');\n btn.onclick = () => window.thebe.bootstrap(this.options);\n\n box.appendChild(btn);\n\n el?.replaceWith(box);\n }\n}\n","import CodeMirror from 'codemirror/lib/codemirror';\nimport 'codemirror/lib/codemirror.css';\nimport 'codemirror/mode/python/python.js';\nimport 'codemirror/addon/hint/show-hint';\nimport 'codemirror/addon/display/autorefresh';\nimport 'codemirror/theme/abcdef.css';\nimport 'codemirror/theme/darcula.css';\nimport 'codemirror/theme/idea.css';\n\nimport type { Options } from './options';\nimport type { IThebeCell } from 'thebe-core';\nimport type { ICompleteReplyMsg } from '@jupyterlab/services/lib/kernel/messages';\nimport type { CellDOMPlaceholder } from './types';\n\ninterface DefaultCodeMirrorConfig {\n theme: 'default';\n mode: 'python';\n readOnly: false;\n autoRefresh: true;\n lineNumbers: true;\n styleActiveLine: true;\n matchBrackets: true;\n}\n\ninterface PageCodeMirrorConfig {\n mode?: string;\n readOnly?: boolean;\n}\n\ninterface RequiredCodeMirrorConfig {\n value: string;\n extraKeys: {\n 'Shift-Enter': () => void;\n 'Ctrl-Space': () => void;\n Esc: () => void;\n };\n}\n\nexport function setupCodemirror(\n options: Options,\n item: CellDOMPlaceholder,\n cell: IThebeCell,\n cellEl: HTMLElement,\n editorEl: HTMLElement,\n setBusy: (id: string) => void,\n clearBusy: (id: string) => void,\n) {\n const { source: sourceEl } = item.placeholders;\n const modeFromPage = sourceEl.getAttribute('data-language') || 'python';\n const isReadOnlyFromPage = sourceEl.getAttribute('data-readonly');\n console.debug(`thebe:setupCodemirror isReadOnly: ${isReadOnlyFromPage}`);\n\n async function execute() {\n console.debug(`thebe:codemirror:shift-enter execute`);\n try {\n setBusy(cell.id);\n await cell.execute(cell.source);\n clearBusy(cell.id);\n } catch (error) {\n cell.clearOnError(error);\n }\n }\n\n const ref: { cm?: any } = { cm: undefined };\n\n function unFocus() {\n ref.cm?.display.input.blur();\n }\n\n function codeCompletion() {\n console.debug(`thebe:codemirror:codeCompletion`);\n const code = ref.cm?.getValue();\n const cursor = ref.cm?.getDoc().getCursor();\n if (cell.session?.kernel) {\n cell.session?.kernel\n .requestComplete({\n code,\n cursor_pos: ref.cm?.getDoc().indexFromPos(cursor),\n })\n .then((value: ICompleteReplyMsg) => {\n if (value.content.status === 'ok') {\n const from = ref.cm?.getDoc().posFromIndex(value.content.cursor_start);\n const to = ref.cm?.getDoc().posFromIndex(value.content.cursor_end);\n ref.cm?.showHint({\n container: editorEl,\n hint: () => {\n return {\n from: from,\n to: to,\n list: (value.content as { matches: string[] }).matches,\n };\n },\n });\n }\n });\n }\n }\n\n const defaultSettings: DefaultCodeMirrorConfig = {\n theme: 'default',\n mode: 'python',\n readOnly: false,\n autoRefresh: true,\n lineNumbers: true,\n styleActiveLine: true,\n matchBrackets: true,\n };\n\n const configFromPage: PageCodeMirrorConfig = {\n mode: modeFromPage,\n readOnly: undefined,\n };\n\n if (isReadOnlyFromPage != null) {\n // override settings using the cell attribute\n configFromPage.readOnly = isReadOnlyFromPage == 'false' ? false : true;\n }\n\n const requiredSettings: RequiredCodeMirrorConfig = {\n value: cell.source,\n extraKeys: {\n 'Shift-Enter': execute,\n 'Ctrl-Space': codeCompletion,\n Esc: unFocus,\n },\n };\n\n const codeMirrorConfig = Object.assign(\n {},\n defaultSettings,\n options.codeMirrorConfig ?? {},\n configFromPage,\n requiredSettings,\n );\n console.debug('thebe:setupCodemirror:codeMirrorConfig', codeMirrorConfig);\n\n ref.cm = new CodeMirror(editorEl as HTMLElement, codeMirrorConfig);\n // TODO enable loading of mode js files via configuration\n // see https://github.com/jupyterlab/jupyterlab/blob/3.6.x/packages/codemirror/src/mode.ts for\n // an example of how to do this\n ref.cm.setOption('mode', codeMirrorConfig.mode);\n\n // All cells in the notebook automatically update their sources on change\n ref.cm.on('change', () => {\n const code = ref.cm.getValue();\n cell.source = code;\n ref.cm.refresh();\n });\n\n if (codeMirrorConfig.readOnly) {\n ref.cm.display.lineDiv.setAttribute('data-readonly', 'true');\n editorEl.setAttribute('data-readonly', 'true');\n cellEl.setAttribute('data-readonly', 'true');\n }\n\n ref.cm.refresh();\n\n return ref.cm;\n}\n","import { ThebeEvents, setupThebeCore } from 'thebe-core';\nimport * as thebe from './thebe';\n\nexport * from './types';\nexport * from './thebe';\n\nexport function setupGlobals() {\n const events = new ThebeEvents();\n\n window.thebe = Object.assign(window.thebe ?? {}, {\n ...thebe,\n events,\n trigger: events.trigger.bind(events),\n on: events.on.bind(events),\n one: events.one.bind(events),\n off: events.off.bind(events),\n });\n\n window.thebelab = window.thebe;\n}\n\nif ((window as any) !== undefined) {\n setupThebeCore();\n setupGlobals();\n\n document.addEventListener('DOMContentLoaded', () => {\n const options = thebe.getPageConfig();\n if (options.mountStatusWidget) {\n thebe.mountStatusWidget();\n }\n if (options.mountActivateWidget) {\n thebe.mountActivateWidget(options);\n }\n if (options['bootstrap']) {\n thebe.bootstrap(options);\n }\n });\n}\n","import type { CoreOptions } from 'thebe-core';\nimport { ensureCoreOptions } from 'thebe-core';\nimport merge from 'lodash.merge';\nimport JSON5 from 'json5';\n\n// Exposing @jupyter-widgets/base and @jupyter-widgets/controls as amd\n// modules for custom widget bundles that depend on it.\n\nexport interface ThebeOptions {\n bootstrap?: boolean;\n useBinder?: boolean;\n useJupyterLite?: boolean;\n requestKernel?: boolean;\n // UI related options\n selector?: string;\n outputSelector?: string;\n predefinedOutput?: boolean;\n mountStatusWidget?: boolean;\n mountActivateWidget?: boolean;\n mountRunButton?: boolean;\n mountRunAllButton?: boolean;\n mountRestartButton?: boolean;\n mountRestartAllButton?: boolean;\n preRenderHook?: (() => void) | null;\n // thebe specific options\n stripPrompts?: {\n inPrompt?: string;\n continuationPrompt?: string;\n };\n stripOutputPrompts?: { outPrompt?: string };\n codeMirrorConfig?: {\n theme?: string;\n readOnly?: boolean;\n mode?: string;\n autoRefresh?: boolean;\n lineNumbers?: boolean;\n styleActiveLine?: boolean;\n matchBrackets?: boolean;\n };\n}\n\nexport type Options = ThebeOptions & CoreOptions;\n\nexport const defaultSelector = '[data-executable]';\nexport const defaultOutputSelector = '[data-output]';\n\n// options\nexport const defaultOptions: ThebeOptions = {\n bootstrap: false,\n useBinder: true,\n useJupyterLite: false,\n requestKernel: true,\n preRenderHook: null,\n predefinedOutput: true,\n mountStatusWidget: true,\n mountActivateWidget: true,\n selector: defaultSelector,\n outputSelector: defaultOutputSelector,\n mountRunButton: true,\n mountRunAllButton: true,\n mountRestartButton: true,\n mountRestartAllButton: true,\n codeMirrorConfig: {},\n};\n\nlet _pageConfigData: Options | undefined;\n\nconst getKeyValue =\n (key: U) =>\n (obj: T) =>\n obj[key];\n\nexport function mergeOptions(options: Partial): Options {\n const optionsOnPage = getPageConfig();\n const merged = merge({}, optionsOnPage, options);\n if (!merged.codeMirrorConfig && (merged.binderOptions as any).codeMirrorConfig) {\n merged.codeMirrorConfig = (merged.binderOptions as any).codeMirrorConfig;\n }\n return { ...merged, ...ensureCoreOptions(merged) };\n}\n\nexport function resetPageConfig() {\n _pageConfigData = undefined;\n}\n\nexport function getPageConfig(): Options {\n ensurePageConfigLoaded();\n return _pageConfigData as Options;\n}\n\nexport function getPageConfigValue(key: keyof Options) {\n const config = getPageConfig();\n if (!config) return getKeyValue(key)(config);\n}\n\nexport function ensurePageConfigLoaded() {\n if (!_pageConfigData) {\n let fragments = {};\n const elList = document.querySelectorAll(\"script[type='text/x-thebe-config']\");\n elList.forEach((el) => {\n if (el.getAttribute('data-thebe-loaded')) return;\n el.setAttribute('data-thebe-loaded', 'true');\n if (!el.textContent) return;\n let pageConfigFragment = undefined;\n try {\n pageConfigFragment = JSON5.parse(el.textContent);\n if (pageConfigFragment) {\n console.debug('loading thebe config', pageConfigFragment);\n fragments = merge(fragments, pageConfigFragment);\n } else {\n console.debug('No thebeConfig found in ', el);\n }\n } catch (e) {\n console.error('Error loading thebe config', e, el.textContent);\n }\n });\n\n _pageConfigData = { ...defaultOptions, ...fragments };\n }\n return _pageConfigData;\n}\n","import type { IThebeCell, ThebeNotebook } from 'thebe-core';\nimport type { Options } from './options';\nimport { randomId } from './utils';\nimport type { CellDOMItem, CellDOMPlaceholder } from './types';\nimport { setupCodemirror } from './codemirror';\n\n/**\n * findCells will find cells and outputs, associating outputs with cells\n * in fifo priority\n *\n * Note: this mirrors the original thebe behaviour\n *\n * @param selector\n * @param outputSelector\n * @returns\n */\nexport function findCells(selector: string, outputSelector: string): CellDOMPlaceholder[] {\n const cellEls = Array.from(document.querySelectorAll(selector));\n const outputEls = Array.from(document.querySelectorAll(outputSelector));\n return cellEls.map((el, idx) => ({\n id: randomId(),\n placeholders: {\n source: el,\n output: idx < outputEls.length ? outputEls[idx] : undefined,\n },\n }));\n}\n\nfunction buildButton(\n parent: Element,\n classSlug: string,\n text: string,\n title: string,\n onClickCb?: () => void,\n) {\n const btn = document.createElement('button');\n btn.classList.add('thebe-button', `thebe-${classSlug}-button`);\n btn.textContent = text;\n btn.setAttribute('title', title);\n btn.onclick = onClickCb ?? (() => console.debug(`thebe:${classSlug}`));\n parent.append(btn);\n return btn;\n}\n\nfunction buildButtonBusySpinner(parent: Element) {\n const outer = document.createElement('div');\n outer.classList.add('thebe-busy');\n outer.style.display = 'none';\n const inner = document.createElement('div');\n inner.classList.add('thebe-busy-spinner');\n outer.appendChild(inner);\n parent.append(outer);\n return outer;\n}\n\nfunction getButtonsBusy(id: string) {\n const cell = document.querySelector(`[data-thebe-id=${id}]`);\n const busy = cell?.getElementsByClassName('thebe-busy').item(0);\n if (!busy) return;\n return busy as HTMLElement;\n}\n\nexport function setButtonsBusy(id: string) {\n const busy = getButtonsBusy(id);\n if (busy) {\n busy.style.display = 'inline-block';\n }\n}\n\nexport function clearButtonsBusy(id: string) {\n setTimeout(() => {\n const busy = getButtonsBusy(id);\n if (busy) busy.style.display = 'none';\n }, 200);\n}\n\nfunction buildCellUI(\n options: Options,\n item: CellDOMPlaceholder,\n notebook: ThebeNotebook,\n cell: IThebeCell,\n): CellDOMItem {\n console.debug(`thebe:buildCellUI CellId:${item.id}`);\n const box = document.createElement('div');\n box.classList.add('thebe-cell');\n box.setAttribute('data-thebe-id', item.id);\n\n console.debug(`thebe:buildCellUI building editor`);\n const editor = document.createElement('div');\n editor.classList.add('thebe-input');\n box.append(editor);\n\n console.debug(`thebe:buildCellUI setup CodeMirror`);\n setupCodemirror(options, item, cell, box, editor, setButtonsBusy, clearButtonsBusy);\n\n console.debug(`thebe:buildCellUI adding cell controls`);\n let run, runAll, restart, restartAll;\n\n const controls = document.createElement('div');\n controls.classList.add('thebe-controls');\n\n if (options.mountRunButton)\n run = buildButton(controls, 'run', 'run', 'run this cell', async () => {\n console.debug(`thebe:run:${cell.id} run`);\n setButtonsBusy(cell.id);\n await cell.execute(cell.source);\n clearButtonsBusy(cell.id);\n });\n\n if (options.mountRunAllButton) {\n runAll = buildButton(controls, 'runall', 'run all', 'run all cells', async () => {\n console.debug(`thebe:run:${cell.id} runall`);\n notebook.cells?.forEach(({ id }: { id: string }) => setButtonsBusy(id));\n // TODO notebook should return an array of promises, one for each cell\n // TODO return the cell id along with the each promise\n await notebook.executeAll();\n notebook.cells?.forEach(({ id }: { id: string }) => clearButtonsBusy(id));\n });\n }\n\n if (options.mountRestartButton) {\n restart = buildButton(controls, 'restart', 'restart', 'restart the kernel', async () => {\n console.debug(`thebe:run:${cell.id} restart`);\n await notebook.session?.kernel?.restart();\n });\n }\n\n if (options.mountRestartAllButton) {\n restartAll = buildButton(\n controls,\n 'restartall',\n 'restart & run all',\n 'restart the kernel and run all cells',\n async () => {\n console.debug(`thebe:run:${cell.id} runall`);\n notebook.cells?.forEach(({ id }) => setButtonsBusy(id));\n // TODO notebook should return an array of promises, one for each cell\n // TODO return the cell id along with the each promise\n await notebook.executeAll();\n notebook.cells?.forEach(({ id }) => clearButtonsBusy(id));\n },\n );\n }\n\n buildButtonBusySpinner(controls);\n box.append(controls);\n\n // no output placeholder for this cell, append a new element\n let output = item.placeholders.output;\n if (output) {\n console.debug(`thebe:buildCellUI using output placeholder`);\n } else {\n console.debug(`thebe:buildCellUI no output placeholder for this cell, append a new element`);\n output = document.createElement('div');\n output.classList.add('thebe-output');\n box.append(output);\n }\n\n // preserve id of original placeholder\n box.id = item.placeholders.source.id;\n item.placeholders.source.replaceWith(box);\n\n // this must happen after the box/host is attached\n cell.attachToDOM(output as HTMLElement);\n\n return {\n ...item,\n ui: {\n cell: box,\n editor,\n output,\n buttons: {\n run,\n runAll,\n restart,\n restartAll,\n },\n },\n };\n}\n\nexport function renderAllCells(\n options: Options,\n notebook: ThebeNotebook,\n placeholders: CellDOMPlaceholder[],\n) {\n return placeholders.map((p) => {\n const cell = notebook.getCellById(p.id);\n if (!cell) return p;\n return buildCellUI(options, p, notebook, cell);\n });\n}\n","import type { ThebeEventData } from 'thebe-core';\nimport { ErrorStatusEvent, EventSubject, ServerStatusEvent, SessionStatusEvent } from 'thebe-core';\n\n// Functions for the thebe activate button and status field\nexport class KernelStatus {\n stub: string;\n constructor() {\n this.stub = 'Status:';\n this._registerHandlers();\n }\n\n _registerHandlers() {\n window.thebe.on('status', (name: string, { subject, status, message }: ThebeEventData) => {\n if (\n subject !== EventSubject.server &&\n subject !== EventSubject.session &&\n subject !== EventSubject.kernel\n )\n return;\n const field = this._fieldElement();\n if (field) {\n switch (status) {\n case ServerStatusEvent.launching:\n field.className = `thebe-status-field thebe-status-${status}`;\n field.textContent = 'Launching...';\n break;\n case ErrorStatusEvent.error:\n field.className = `thebe-status-field thebe-status-${status}`;\n field.textContent = 'Failed to connect to server';\n break;\n case ServerStatusEvent.closed:\n field.className = `thebe-status-field thebe-status-${status}`;\n field.textContent = 'Server connection closed';\n break;\n case SessionStatusEvent.shutdown:\n field.className = `thebe-status-field thebe-status-${status}`;\n field.textContent = 'Session is dead';\n break;\n case SessionStatusEvent.starting:\n field.className = `thebe-status-field thebe-status-${status}`;\n field.textContent = 'Starting session';\n break;\n case SessionStatusEvent.ready:\n field.className = `thebe-status-field thebe-status-session-ready`;\n field.textContent = 'Kernel Connected';\n break;\n case ServerStatusEvent.ready:\n field.className = `thebe-status-field thebe-status-server-ready`;\n field.textContent = 'Conected to Server';\n break;\n }\n }\n\n const msg = this._messageElement();\n if (msg) msg.textContent = message;\n });\n }\n\n _messageElement() {\n const collection = document.getElementsByClassName('thebe-status-message');\n return collection.length ? collection.item(0) : undefined;\n }\n\n _fieldElement() {\n const collection = document.getElementsByClassName('thebe-status-field');\n return collection.length ? collection.item(0) : undefined;\n }\n\n /**\n * Mount the status field widget.\n *\n * Contents of the element with class `thebe-status-field` will be replaced with a status widget\n *\n * @returns true if an element with the expected class was found\n */\n mount() {\n const el = document.querySelector('.thebe-status');\n if (!el) {\n console.debug('KernelStatus mount requested but no .thebe-status element found on page');\n return;\n }\n\n const box = document.createElement('div');\n box.className = 'thebe-status thebe-status-mounted';\n box.setAttribute('title', this.stub);\n\n const stub = document.createElement('span');\n stub.classList.add('thebe-status-stub');\n stub.textContent = this.stub;\n box.appendChild(stub);\n\n const field = document.createElement('span');\n field.classList.add('thebe-status-field');\n field.textContent = 'No Kernel Attached';\n\n const message = document.createElement('div');\n message.classList.add('thebe-status-message');\n\n box.append(stub, field, message);\n\n el.replaceWith(box);\n\n return el !== undefined;\n }\n\n unmount() {\n const el = document.querySelector('.thebe-status');\n if (!el) return;\n let child = el.lastElementChild;\n while (child) {\n el.removeChild(child);\n child = el.lastElementChild;\n }\n return el;\n }\n}\n","import { defaultOutputSelector, defaultSelector, mergeOptions } from './options';\nimport { findCells, renderAllCells } from './render';\nimport { stripPrompts, stripOutputPrompts } from './utils';\nimport { KernelStatus } from './status';\nimport { ActivateWidget } from './activate';\n\n// Exposing @jupyter-widgets/base and @jupyter-widgets/controls as amd\n// modules for custom widget bundles that depend on it.\n\nimport * as base from '@jupyter-widgets/base';\nimport * as controls from '@jupyter-widgets/controls';\nimport { output } from '@jupyter-widgets/jupyterlab-manager';\nimport type { Options } from './options';\nimport {\n makeConfiguration,\n makeRenderMimeRegistry,\n setupNotebookFromBlocks,\n ThebeServer,\n} from 'thebe-core';\nimport type { CellDOMPlaceholder } from './types';\n\nif (typeof window !== 'undefined' && typeof window.define !== 'undefined') {\n window.define('@jupyter-widgets/base', base);\n window.define('@jupyter-widgets/controls', controls);\n window.define('@jupyter-widgets/output', output);\n}\n\nexport * from './render';\nexport {\n Options,\n mergeOptions,\n getPageConfig,\n getPageConfigValue,\n ensurePageConfigLoaded,\n} from './options';\nexport * from './utils';\n\nexport function mountStatusWidget() {\n window.thebe.kernelStatus = new KernelStatus();\n window.thebe.kernelStatus.mount();\n}\n\nexport function mountActivateWidget(options: Options = {}) {\n window.thebe.activateButton = new ActivateWidget(options);\n window.thebe.activateButton.mount();\n}\n\n/**\n * Bootstrap the library based on the configuration given.\n *\n * If bootstrap === true in the configuration and the library is loaded statically\n * then this function will be called automatically on the document load event.\n *\n * @param {Object} options Object containing thebe options.\n * Same structure as x-thebe-options.\n * @returns {Promise} Promise for connected Kernel object\n */\nexport async function bootstrap(opts: Partial = {}) {\n // bootstrap thebe on the page\n // merge defaults, pageConfig, etc.\n const options = mergeOptions({ useBinder: true, requestKernel: true, ...opts });\n\n if (options.preRenderHook) options.preRenderHook();\n if (options.stripPrompts) stripPrompts(options);\n if (options.stripOutputPrompts) stripOutputPrompts(options);\n\n const { selector, outputSelector } = options;\n const items: CellDOMPlaceholder[] = findCells(\n selector ?? defaultSelector,\n outputSelector ?? defaultOutputSelector,\n );\n\n const codeWithIds = items.map(({ id, placeholders: { source: el } }) => {\n return { id, source: el.textContent?.trim() ?? '' };\n });\n\n const config = makeConfiguration(options, window.thebe.events);\n const rendermime = makeRenderMimeRegistry(config.mathjax);\n\n const notebook = setupNotebookFromBlocks(codeWithIds, config, rendermime);\n window.thebe.notebook = notebook;\n\n renderAllCells(options, notebook, items);\n\n // starting to talk to binder / server is deferred until here so that any page\n // errors cause failure first\n\n const server = new ThebeServer(config);\n\n // connect to a resource\n if (options.useBinder) {\n console.debug(`thebe:api:connect useBinder`, config.base, config.binder);\n server.connectToServerViaBinder();\n } else if (options.useJupyterLite) {\n console.debug(`thebe:api:connect JupyterLite`, config.base);\n server.connectToJupyterLiteServer();\n } else {\n server.connectToJupyterServer();\n }\n\n window.thebe.server = server;\n\n if (!opts.requestKernel) {\n return { server, notebook };\n }\n\n await server.ready;\n\n const session = await server.startNewSession(rendermime);\n if (session != null) notebook.attachSession(session);\n\n window.thebe.session = session ?? undefined;\n\n return {\n server,\n session,\n notebook,\n };\n}\n","import type { Options } from './options';\nimport { defaultSelector } from './options';\n\nexport function stripPrompts({ selector, stripPrompts: prompts }: Options) {\n // strip prompts from a cell\n document.querySelectorAll(selector ?? defaultSelector).forEach((el) => {\n splitCell(el, prompts);\n });\n}\n\nexport function stripOutputPrompts({ selector, stripOutputPrompts: prompts }: Options) {\n // strip output prompts from a cell\n document.querySelectorAll(selector ?? defaultSelector).forEach((el) => {\n splitCellOutputPrompt(el, prompts);\n });\n}\n\nfunction appendNewCell(el: Element, text: string) {\n const pre = document.createElement('pre');\n pre.setAttribute('data-executable', 'data-executable');\n pre.textContent = text;\n el.appendChild(pre);\n}\n\nfunction splitCell(\n el: Element,\n {\n inPrompt,\n continuationPrompt,\n }: {\n inPrompt?: string;\n continuationPrompt?: string;\n } = {},\n) {\n const rawText = el.textContent?.trim() ?? '';\n if (!inPrompt || rawText.indexOf(inPrompt) == -1) {\n return el;\n }\n const listOfCellContents: string[] = [];\n let cellContents: string | null = null;\n rawText.split('\\n').map((line) => {\n line = line.trim();\n if (line.slice(0, inPrompt.length) === inPrompt) {\n // line with a prompt\n line = line.slice(inPrompt.length) + '\\n';\n if (cellContents) {\n cellContents += line;\n } else {\n cellContents = line;\n }\n } else if (\n continuationPrompt &&\n line.slice(0, continuationPrompt.length) === continuationPrompt\n ) {\n // line with a continuation prompt\n cellContents += line.slice(continuationPrompt.length) + '\\n';\n } else {\n // output line\n if (cellContents) {\n listOfCellContents.push(cellContents);\n cellContents = null;\n }\n }\n });\n if (cellContents) {\n listOfCellContents.push(cellContents);\n }\n // clear the parent element\n el.innerHTML = '';\n // add the thebe-able cells\n listOfCellContents.forEach((cell) => appendNewCell(el, cell));\n}\n\nfunction splitCellOutputPrompt(el: Element, { outPrompt }: { outPrompt?: string } = {}) {\n const rawText = el.textContent?.trim() ?? '';\n if (!outPrompt || rawText.indexOf(outPrompt) == -1) {\n return el;\n }\n const listOfCellContents: string[] = [];\n let cellContents: string | null = null;\n rawText.split('\\n').map((line) => {\n line = line.trim();\n if (line.slice(0, outPrompt.length) === outPrompt) {\n // output line\n if (cellContents) {\n listOfCellContents.push(cellContents);\n cellContents = null;\n }\n } else {\n // input line\n if (cellContents) {\n cellContents += line + '\\n';\n } else {\n cellContents = line + '\\n';\n }\n }\n });\n if (cellContents) {\n listOfCellContents.push(cellContents);\n }\n // clear the parent element\n el.innerHTML = '';\n // add the thebe-able cells\n listOfCellContents.forEach((cell) => appendNewCell(el, cell));\n}\n\nexport function randomId() {\n const uint32 = window.crypto.getRandomValues(new Uint32Array(1))[0];\n return 'id-' + uint32.toString(8);\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","'use strict';\n\nvar required = require('requires-port')\n , qs = require('querystringify')\n , controlOrWhitespace = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/\n , CRHTLF = /[\\n\\r\\t]/g\n , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//\n , port = /:\\d+$/\n , protocolre = /^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i\n , windowsDriveLetter = /^[a-zA-Z]:/;\n\n/**\n * Remove control characters and whitespace from the beginning of a string.\n *\n * @param {Object|String} str String to trim.\n * @returns {String} A new string representing `str` stripped of control\n * characters and whitespace from its beginning.\n * @public\n */\nfunction trimLeft(str) {\n return (str ? str : '').toString().replace(controlOrWhitespace, '');\n}\n\n/**\n * These are the parse rules for the URL parser, it informs the parser\n * about:\n *\n * 0. The char it Needs to parse, if it's a string it should be done using\n * indexOf, RegExp using exec and NaN means set as current value.\n * 1. The property we should set when parsing this value.\n * 2. Indication if it's backwards or forward parsing, when set as number it's\n * the value of extra chars that should be split off.\n * 3. Inherit from location if non existing in the parser.\n * 4. `toLowerCase` the resulting value.\n */\nvar rules = [\n ['#', 'hash'], // Extract from the back.\n ['?', 'query'], // Extract from the back.\n function sanitize(address, url) { // Sanitize what is left of the address\n return isSpecial(url.protocol) ? address.replace(/\\\\/g, '/') : address;\n },\n ['/', 'pathname'], // Extract from the back.\n ['@', 'auth', 1], // Extract from the front.\n [NaN, 'host', undefined, 1, 1], // Set left over value.\n [/:(\\d*)$/, 'port', undefined, 1], // RegExp the back.\n [NaN, 'hostname', undefined, 1, 1] // Set left over.\n];\n\n/**\n * These properties should not be copied or inherited from. This is only needed\n * for all non blob URL's as a blob URL does not include a hash, only the\n * origin.\n *\n * @type {Object}\n * @private\n */\nvar ignore = { hash: 1, query: 1 };\n\n/**\n * The location object differs when your code is loaded through a normal page,\n * Worker or through a worker using a blob. And with the blobble begins the\n * trouble as the location object will contain the URL of the blob, not the\n * location of the page where our code is loaded in. The actual origin is\n * encoded in the `pathname` so we can thankfully generate a good \"default\"\n * location from it so we can generate proper relative URL's again.\n *\n * @param {Object|String} loc Optional default location object.\n * @returns {Object} lolcation object.\n * @public\n */\nfunction lolcation(loc) {\n var globalVar;\n\n if (typeof window !== 'undefined') globalVar = window;\n else if (typeof global !== 'undefined') globalVar = global;\n else if (typeof self !== 'undefined') globalVar = self;\n else globalVar = {};\n\n var location = globalVar.location || {};\n loc = loc || location;\n\n var finaldestination = {}\n , type = typeof loc\n , key;\n\n if ('blob:' === loc.protocol) {\n finaldestination = new Url(unescape(loc.pathname), {});\n } else if ('string' === type) {\n finaldestination = new Url(loc, {});\n for (key in ignore) delete finaldestination[key];\n } else if ('object' === type) {\n for (key in loc) {\n if (key in ignore) continue;\n finaldestination[key] = loc[key];\n }\n\n if (finaldestination.slashes === undefined) {\n finaldestination.slashes = slashes.test(loc.href);\n }\n }\n\n return finaldestination;\n}\n\n/**\n * Check whether a protocol scheme is special.\n *\n * @param {String} The protocol scheme of the URL\n * @return {Boolean} `true` if the protocol scheme is special, else `false`\n * @private\n */\nfunction isSpecial(scheme) {\n return (\n scheme === 'file:' ||\n scheme === 'ftp:' ||\n scheme === 'http:' ||\n scheme === 'https:' ||\n scheme === 'ws:' ||\n scheme === 'wss:'\n );\n}\n\n/**\n * @typedef ProtocolExtract\n * @type Object\n * @property {String} protocol Protocol matched in the URL, in lowercase.\n * @property {Boolean} slashes `true` if protocol is followed by \"//\", else `false`.\n * @property {String} rest Rest of the URL that is not part of the protocol.\n */\n\n/**\n * Extract protocol information from a URL with/without double slash (\"//\").\n *\n * @param {String} address URL we want to extract from.\n * @param {Object} location\n * @return {ProtocolExtract} Extracted information.\n * @private\n */\nfunction extractProtocol(address, location) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n location = location || {};\n\n var match = protocolre.exec(address);\n var protocol = match[1] ? match[1].toLowerCase() : '';\n var forwardSlashes = !!match[2];\n var otherSlashes = !!match[3];\n var slashesCount = 0;\n var rest;\n\n if (forwardSlashes) {\n if (otherSlashes) {\n rest = match[2] + match[3] + match[4];\n slashesCount = match[2].length + match[3].length;\n } else {\n rest = match[2] + match[4];\n slashesCount = match[2].length;\n }\n } else {\n if (otherSlashes) {\n rest = match[3] + match[4];\n slashesCount = match[3].length;\n } else {\n rest = match[4]\n }\n }\n\n if (protocol === 'file:') {\n if (slashesCount >= 2) {\n rest = rest.slice(2);\n }\n } else if (isSpecial(protocol)) {\n rest = match[4];\n } else if (protocol) {\n if (forwardSlashes) {\n rest = rest.slice(2);\n }\n } else if (slashesCount >= 2 && isSpecial(location.protocol)) {\n rest = match[4];\n }\n\n return {\n protocol: protocol,\n slashes: forwardSlashes || isSpecial(protocol),\n slashesCount: slashesCount,\n rest: rest\n };\n}\n\n/**\n * Resolve a relative URL pathname against a base URL pathname.\n *\n * @param {String} relative Pathname of the relative URL.\n * @param {String} base Pathname of the base URL.\n * @return {String} Resolved pathname.\n * @private\n */\nfunction resolve(relative, base) {\n if (relative === '') return base;\n\n var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))\n , i = path.length\n , last = path[i - 1]\n , unshift = false\n , up = 0;\n\n while (i--) {\n if (path[i] === '.') {\n path.splice(i, 1);\n } else if (path[i] === '..') {\n path.splice(i, 1);\n up++;\n } else if (up) {\n if (i === 0) unshift = true;\n path.splice(i, 1);\n up--;\n }\n }\n\n if (unshift) path.unshift('');\n if (last === '.' || last === '..') path.push('');\n\n return path.join('/');\n}\n\n/**\n * The actual URL instance. Instead of returning an object we've opted-in to\n * create an actual constructor as it's much more memory efficient and\n * faster and it pleases my OCD.\n *\n * It is worth noting that we should not use `URL` as class name to prevent\n * clashes with the global URL instance that got introduced in browsers.\n *\n * @constructor\n * @param {String} address URL we want to parse.\n * @param {Object|String} [location] Location defaults for relative paths.\n * @param {Boolean|Function} [parser] Parser for the query string.\n * @private\n */\nfunction Url(address, location, parser) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n\n if (!(this instanceof Url)) {\n return new Url(address, location, parser);\n }\n\n var relative, extracted, parse, instruction, index, key\n , instructions = rules.slice()\n , type = typeof location\n , url = this\n , i = 0;\n\n //\n // The following if statements allows this module two have compatibility with\n // 2 different API:\n //\n // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments\n // where the boolean indicates that the query string should also be parsed.\n //\n // 2. The `URL` interface of the browser which accepts a URL, object as\n // arguments. The supplied object will be used as default values / fall-back\n // for relative paths.\n //\n if ('object' !== type && 'string' !== type) {\n parser = location;\n location = null;\n }\n\n if (parser && 'function' !== typeof parser) parser = qs.parse;\n\n location = lolcation(location);\n\n //\n // Extract protocol information before running the instructions.\n //\n extracted = extractProtocol(address || '', location);\n relative = !extracted.protocol && !extracted.slashes;\n url.slashes = extracted.slashes || relative && location.slashes;\n url.protocol = extracted.protocol || location.protocol || '';\n address = extracted.rest;\n\n //\n // When the authority component is absent the URL starts with a path\n // component.\n //\n if (\n extracted.protocol === 'file:' && (\n extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||\n (!extracted.slashes &&\n (extracted.protocol ||\n extracted.slashesCount < 2 ||\n !isSpecial(url.protocol)))\n ) {\n instructions[3] = [/(.*)/, 'pathname'];\n }\n\n for (; i < instructions.length; i++) {\n instruction = instructions[i];\n\n if (typeof instruction === 'function') {\n address = instruction(address, url);\n continue;\n }\n\n parse = instruction[0];\n key = instruction[1];\n\n if (parse !== parse) {\n url[key] = address;\n } else if ('string' === typeof parse) {\n index = parse === '@'\n ? address.lastIndexOf(parse)\n : address.indexOf(parse);\n\n if (~index) {\n if ('number' === typeof instruction[2]) {\n url[key] = address.slice(0, index);\n address = address.slice(index + instruction[2]);\n } else {\n url[key] = address.slice(index);\n address = address.slice(0, index);\n }\n }\n } else if ((index = parse.exec(address))) {\n url[key] = index[1];\n address = address.slice(0, index.index);\n }\n\n url[key] = url[key] || (\n relative && instruction[3] ? location[key] || '' : ''\n );\n\n //\n // Hostname, host and protocol should be lowercased so they can be used to\n // create a proper `origin`.\n //\n if (instruction[4]) url[key] = url[key].toLowerCase();\n }\n\n //\n // Also parse the supplied query string in to an object. If we're supplied\n // with a custom parser as function use that instead of the default build-in\n // parser.\n //\n if (parser) url.query = parser(url.query);\n\n //\n // If the URL is relative, resolve the pathname against the base URL.\n //\n if (\n relative\n && location.slashes\n && url.pathname.charAt(0) !== '/'\n && (url.pathname !== '' || location.pathname !== '')\n ) {\n url.pathname = resolve(url.pathname, location.pathname);\n }\n\n //\n // Default to a / for pathname if none exists. This normalizes the URL\n // to always have a /\n //\n if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {\n url.pathname = '/' + url.pathname;\n }\n\n //\n // We should not add port numbers if they are already the default port number\n // for a given protocol. As the host also contains the port number we're going\n // override it with the hostname which contains no port number.\n //\n if (!required(url.port, url.protocol)) {\n url.host = url.hostname;\n url.port = '';\n }\n\n //\n // Parse down the `auth` for the username and password.\n //\n url.username = url.password = '';\n\n if (url.auth) {\n index = url.auth.indexOf(':');\n\n if (~index) {\n url.username = url.auth.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = url.auth.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password))\n } else {\n url.username = encodeURIComponent(decodeURIComponent(url.auth));\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n }\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n //\n // The href is just the compiled result.\n //\n url.href = url.toString();\n}\n\n/**\n * This is convenience method for changing properties in the URL instance to\n * insure that they all propagate correctly.\n *\n * @param {String} part Property we need to adjust.\n * @param {Mixed} value The newly assigned value.\n * @param {Boolean|Function} fn When setting the query, it will be the function\n * used to parse the query.\n * When setting the protocol, double slash will be\n * removed from the final url if it is true.\n * @returns {URL} URL instance for chaining.\n * @public\n */\nfunction set(part, value, fn) {\n var url = this;\n\n switch (part) {\n case 'query':\n if ('string' === typeof value && value.length) {\n value = (fn || qs.parse)(value);\n }\n\n url[part] = value;\n break;\n\n case 'port':\n url[part] = value;\n\n if (!required(value, url.protocol)) {\n url.host = url.hostname;\n url[part] = '';\n } else if (value) {\n url.host = url.hostname +':'+ value;\n }\n\n break;\n\n case 'hostname':\n url[part] = value;\n\n if (url.port) value += ':'+ url.port;\n url.host = value;\n break;\n\n case 'host':\n url[part] = value;\n\n if (port.test(value)) {\n value = value.split(':');\n url.port = value.pop();\n url.hostname = value.join(':');\n } else {\n url.hostname = value;\n url.port = '';\n }\n\n break;\n\n case 'protocol':\n url.protocol = value.toLowerCase();\n url.slashes = !fn;\n break;\n\n case 'pathname':\n case 'hash':\n if (value) {\n var char = part === 'pathname' ? '/' : '#';\n url[part] = value.charAt(0) !== char ? char + value : value;\n } else {\n url[part] = value;\n }\n break;\n\n case 'username':\n case 'password':\n url[part] = encodeURIComponent(value);\n break;\n\n case 'auth':\n var index = value.indexOf(':');\n\n if (~index) {\n url.username = value.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = value.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password));\n } else {\n url.username = encodeURIComponent(decodeURIComponent(value));\n }\n }\n\n for (var i = 0; i < rules.length; i++) {\n var ins = rules[i];\n\n if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n url.href = url.toString();\n\n return url;\n}\n\n/**\n * Transform the properties back in to a valid and full URL string.\n *\n * @param {Function} stringify Optional query stringify function.\n * @returns {String} Compiled version of the URL.\n * @public\n */\nfunction toString(stringify) {\n if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;\n\n var query\n , url = this\n , host = url.host\n , protocol = url.protocol;\n\n if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';\n\n var result =\n protocol +\n ((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : '');\n\n if (url.username) {\n result += url.username;\n if (url.password) result += ':'+ url.password;\n result += '@';\n } else if (url.password) {\n result += ':'+ url.password;\n result += '@';\n } else if (\n url.protocol !== 'file:' &&\n isSpecial(url.protocol) &&\n !host &&\n url.pathname !== '/'\n ) {\n //\n // Add back the empty userinfo, otherwise the original invalid URL\n // might be transformed into a valid one with `url.pathname` as host.\n //\n result += '@';\n }\n\n //\n // Trailing colon is removed from `url.host` when it is parsed. If it still\n // ends with a colon, then add back the trailing colon that was removed. This\n // prevents an invalid URL from being transformed into a valid one.\n //\n if (host[host.length - 1] === ':' || (port.test(url.hostname) && !url.port)) {\n host += ':';\n }\n\n result += host + url.pathname;\n\n query = 'object' === typeof url.query ? stringify(url.query) : url.query;\n if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;\n\n if (url.hash) result += url.hash;\n\n return result;\n}\n\nUrl.prototype = { set: set, toString: toString };\n\n//\n// Expose the URL parser and some additional properties that might be useful for\n// others or testing.\n//\nUrl.extractProtocol = extractProtocol;\nUrl.location = lolcation;\nUrl.trimLeft = trimLeft;\nUrl.qs = qs;\n\nmodule.exports = Url;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../packages/thebe/node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../packages/thebe/node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"/* Copyright (c) Jupyter Development Team.\\n * Distributed under the terms of the Modified BSD License.\\n */\\n\\n.jupyter-widgets-disconnected::before {\\n content: '\\\\f127'; /* chain-broken */\\n display: inline-block;\\n font: normal normal 900 14px/1 'Font Awesome 5 Free', 'FontAwesome';\\n text-rendering: auto;\\n -webkit-font-smoothing: antialiased;\\n -moz-osx-font-smoothing: grayscale;\\n color: #d9534f;\\n padding: 3px;\\n align-self: flex-start;\\n}\\n\\n.jupyter-widgets-error-widget {\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n height: 100%;\\n border: solid 1px red;\\n margin: 0 auto;\\n}\\n\\n.jupyter-widgets-error-widget.icon-error {\\n min-width: var(--jp-widgets-inline-width-short);\\n}\\n.jupyter-widgets-error-widget.text-error {\\n min-width: calc(2 * var(--jp-widgets-inline-width));\\n min-height: calc(3 * var(--jp-widgets-inline-height));\\n}\\n\\n.jupyter-widgets-error-widget p {\\n text-align: center;\\n}\\n\\n.jupyter-widgets-error-widget.text-error pre::first-line {\\n font-weight: bold;\\n}\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./../../node_modules/@jupyter-widgets/base/css/index.css\"],\"names\":[],\"mappings\":\"AAAA;;EAEE;;AAEF;EACE,gBAAgB,EAAE,iBAAiB;EACnC,qBAAqB;EACrB,mEAAmE;EACnE,oBAAoB;EACpB,mCAAmC;EACnC,kCAAkC;EAClC,cAAc;EACd,YAAY;EACZ,sBAAsB;AACxB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,uBAAuB;EACvB,YAAY;EACZ,qBAAqB;EACrB,cAAc;AAChB;;AAEA;EACE,+CAA+C;AACjD;AACA;EACE,mDAAmD;EACnD,qDAAqD;AACvD;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,iBAAiB;AACnB\",\"sourcesContent\":[\"/* Copyright (c) Jupyter Development Team.\\n * Distributed under the terms of the Modified BSD License.\\n */\\n\\n.jupyter-widgets-disconnected::before {\\n content: '\\\\f127'; /* chain-broken */\\n display: inline-block;\\n font: normal normal 900 14px/1 'Font Awesome 5 Free', 'FontAwesome';\\n text-rendering: auto;\\n -webkit-font-smoothing: antialiased;\\n -moz-osx-font-smoothing: grayscale;\\n color: #d9534f;\\n padding: 3px;\\n align-self: flex-start;\\n}\\n\\n.jupyter-widgets-error-widget {\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n height: 100%;\\n border: solid 1px red;\\n margin: 0 auto;\\n}\\n\\n.jupyter-widgets-error-widget.icon-error {\\n min-width: var(--jp-widgets-inline-width-short);\\n}\\n.jupyter-widgets-error-widget.text-error {\\n min-width: calc(2 * var(--jp-widgets-inline-width));\\n min-height: calc(3 * var(--jp-widgets-inline-height));\\n}\\n\\n.jupyter-widgets-error-widget p {\\n text-align: center;\\n}\\n\\n.jupyter-widgets-error-widget.text-error pre::first-line {\\n font-weight: bold;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../packages/thebe/node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../packages/thebe/node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"/* This file has code derived from Lumino CSS files, as noted below. The license for this Lumino code is:\\n\\nCopyright (c) 2019 Project Jupyter Contributors\\nAll rights reserved.\\n\\nRedistribution and use in source and binary forms, with or without\\nmodification, are permitted provided that the following conditions are met:\\n\\n1. Redistributions of source code must retain the above copyright notice, this\\n list of conditions and the following disclaimer.\\n\\n2. Redistributions in binary form must reproduce the above copyright notice,\\n this list of conditions and the following disclaimer in the documentation\\n and/or other materials provided with the distribution.\\n\\n3. Neither the name of the copyright holder nor the names of its\\n contributors may be used to endorse or promote products derived from\\n this software without specific prior written permission.\\n\\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\"AS IS\\\"\\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\n\\n\\nCopyright (c) 2014-2017, PhosphorJS Contributors\\nAll rights reserved.\\n\\nRedistribution and use in source and binary forms, with or without\\nmodification, are permitted provided that the following conditions are met:\\n\\n* Redistributions of source code must retain the above copyright notice, this\\n list of conditions and the following disclaimer.\\n\\n* Redistributions in binary form must reproduce the above copyright notice,\\n this list of conditions and the following disclaimer in the documentation\\n and/or other materials provided with the distribution.\\n\\n* Neither the name of the copyright holder nor the names of its\\n contributors may be used to endorse or promote products derived from\\n this software without specific prior written permission.\\n\\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\"AS IS\\\"\\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\n*/\\n\\n/*\\n * The following section is derived from https://github.com/jupyterlab/lumino/blob/23b9d075ebc5b73ab148b6ebfc20af97f85714c4/packages/widgets/style/tabbar.css \\n * We've scoped the rules so that they are consistent with exactly our code.\\n */\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar {\\n display: flex;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar[data-orientation='horizontal'], /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar[data-orientation='horizontal'], /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar[data-orientation='horizontal'] {\\n flex-direction: row;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar[data-orientation='vertical'], /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar[data-orientation='vertical'], /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar[data-orientation='vertical'] {\\n flex-direction: column;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar > .p-TabBar-content, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar > .p-TabBar-content, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar > .lm-TabBar-content {\\n margin: 0;\\n padding: 0;\\n display: flex;\\n flex: 1 1 auto;\\n list-style-type: none;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar[data-orientation='horizontal']\\n > .p-TabBar-content,\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n> .p-TabBar[data-orientation='horizontal']\\n> .p-TabBar-content,\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar[data-orientation='horizontal']\\n > .lm-TabBar-content {\\n flex-direction: row;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar[data-orientation='vertical']\\n > .p-TabBar-content,\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n> .p-TabBar[data-orientation='vertical']\\n> .p-TabBar-content,\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar[data-orientation='vertical']\\n > .lm-TabBar-content {\\n flex-direction: column;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab {\\n display: flex;\\n flex-direction: row;\\n box-sizing: border-box;\\n overflow: hidden;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabIcon, /* */\\n/* */ .jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabCloseIcon, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabIcon, /* */\\n/* */ .jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabCloseIcon, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabIcon,\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabCloseIcon {\\n flex: 0 0 auto;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabLabel, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabLabel, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabLabel {\\n flex: 1 1 auto;\\n overflow: hidden;\\n white-space: nowrap;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab.p-mod-hidden, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab.p-mod-hidden, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab.lm-mod-hidden {\\n display: none !important;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar.p-mod-dragging .p-TabBar-tab, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar.p-mod-dragging .p-TabBar-tab, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar.lm-mod-dragging .lm-TabBar-tab {\\n position: relative;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar.p-mod-dragging[data-orientation='horizontal']\\n .p-TabBar-tab,\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .p-TabBar.p-mod-dragging[data-orientation='horizontal']\\n .p-TabBar-tab,\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar.lm-mod-dragging[data-orientation='horizontal']\\n .lm-TabBar-tab {\\n left: 0;\\n transition: left 150ms ease;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar.p-mod-dragging[data-orientation='vertical']\\n .p-TabBar-tab,\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n> .p-TabBar.p-mod-dragging[data-orientation='vertical']\\n.p-TabBar-tab,\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar.lm-mod-dragging[data-orientation='vertical']\\n .lm-TabBar-tab {\\n top: 0;\\n transition: top 150ms ease;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar.p-mod-dragging\\n .p-TabBar-tab.p-mod-dragging,\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n> .p-TabBar.p-mod-dragging\\n.p-TabBar-tab.p-mod-dragging,\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar.lm-mod-dragging\\n .lm-TabBar-tab.lm-mod-dragging {\\n transition: none;\\n}\\n\\n/* End tabbar.css */\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./../../node_modules/@jupyter-widgets/controls/css/lumino.css\"],\"names\":[],\"mappings\":\"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DC;;AAED;;;EAGE;;AAEF,iBAAiB;AACjB;;;EAGE,aAAa;EACb,yBAAyB;EACzB,sBAAsB;EACtB,qBAAqB;EACrB,iBAAiB;AACnB;;AAEA,iBAAiB;AACjB;;;EAGE,mBAAmB;AACrB;;AAEA,iBAAiB;AACjB;;;EAGE,sBAAsB;AACxB;;AAEA,iBAAiB;AACjB;;;EAGE,SAAS;EACT,UAAU;EACV,aAAa;EACb,cAAc;EACd,qBAAqB;AACvB;;AAEA,iBAAiB;AACjB;;;;;;;;;;;;EAYE,mBAAmB;AACrB;;AAEA,iBAAiB;AACjB;;;;;;;;;;;;EAYE,sBAAsB;AACxB;;AAEA,iBAAiB;AACjB;;;EAGE,aAAa;EACb,mBAAmB;EACnB,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA,iBAAiB;AACjB;;;;;;EAME,cAAc;AAChB;;AAEA,iBAAiB;AACjB;;;EAGE,cAAc;EACd,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA,iBAAiB;AACjB;;;EAGE,wBAAwB;AAC1B;;AAEA,iBAAiB;AACjB;;;EAGE,kBAAkB;AACpB;;AAEA,iBAAiB;AACjB;;;;;;;;;;;;EAYE,OAAO;EACP,2BAA2B;AAC7B;;AAEA,iBAAiB;AACjB;;;;;;;;;;;;EAYE,MAAM;EACN,0BAA0B;AAC5B;;AAEA,iBAAiB;AACjB;;;;;;;;;;;;EAYE,gBAAgB;AAClB;;AAEA,mBAAmB\",\"sourcesContent\":[\"/* This file has code derived from Lumino CSS files, as noted below. The license for this Lumino code is:\\n\\nCopyright (c) 2019 Project Jupyter Contributors\\nAll rights reserved.\\n\\nRedistribution and use in source and binary forms, with or without\\nmodification, are permitted provided that the following conditions are met:\\n\\n1. Redistributions of source code must retain the above copyright notice, this\\n list of conditions and the following disclaimer.\\n\\n2. Redistributions in binary form must reproduce the above copyright notice,\\n this list of conditions and the following disclaimer in the documentation\\n and/or other materials provided with the distribution.\\n\\n3. Neither the name of the copyright holder nor the names of its\\n contributors may be used to endorse or promote products derived from\\n this software without specific prior written permission.\\n\\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\"AS IS\\\"\\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\n\\n\\nCopyright (c) 2014-2017, PhosphorJS Contributors\\nAll rights reserved.\\n\\nRedistribution and use in source and binary forms, with or without\\nmodification, are permitted provided that the following conditions are met:\\n\\n* Redistributions of source code must retain the above copyright notice, this\\n list of conditions and the following disclaimer.\\n\\n* Redistributions in binary form must reproduce the above copyright notice,\\n this list of conditions and the following disclaimer in the documentation\\n and/or other materials provided with the distribution.\\n\\n* Neither the name of the copyright holder nor the names of its\\n contributors may be used to endorse or promote products derived from\\n this software without specific prior written permission.\\n\\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\"AS IS\\\"\\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\n*/\\n\\n/*\\n * The following section is derived from https://github.com/jupyterlab/lumino/blob/23b9d075ebc5b73ab148b6ebfc20af97f85714c4/packages/widgets/style/tabbar.css \\n * We've scoped the rules so that they are consistent with exactly our code.\\n */\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar {\\n display: flex;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar[data-orientation='horizontal'], /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar[data-orientation='horizontal'], /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar[data-orientation='horizontal'] {\\n flex-direction: row;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar[data-orientation='vertical'], /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar[data-orientation='vertical'], /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar[data-orientation='vertical'] {\\n flex-direction: column;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar > .p-TabBar-content, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar > .p-TabBar-content, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar > .lm-TabBar-content {\\n margin: 0;\\n padding: 0;\\n display: flex;\\n flex: 1 1 auto;\\n list-style-type: none;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar[data-orientation='horizontal']\\n > .p-TabBar-content,\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n> .p-TabBar[data-orientation='horizontal']\\n> .p-TabBar-content,\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar[data-orientation='horizontal']\\n > .lm-TabBar-content {\\n flex-direction: row;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar[data-orientation='vertical']\\n > .p-TabBar-content,\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n> .p-TabBar[data-orientation='vertical']\\n> .p-TabBar-content,\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar[data-orientation='vertical']\\n > .lm-TabBar-content {\\n flex-direction: column;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab {\\n display: flex;\\n flex-direction: row;\\n box-sizing: border-box;\\n overflow: hidden;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabIcon, /* */\\n/* */ .jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabCloseIcon, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabIcon, /* */\\n/* */ .jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabCloseIcon, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabIcon,\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabCloseIcon {\\n flex: 0 0 auto;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabLabel, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabLabel, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabLabel {\\n flex: 1 1 auto;\\n overflow: hidden;\\n white-space: nowrap;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab.p-mod-hidden, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab.p-mod-hidden, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab.lm-mod-hidden {\\n display: none !important;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar.p-mod-dragging .p-TabBar-tab, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar.p-mod-dragging .p-TabBar-tab, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar.lm-mod-dragging .lm-TabBar-tab {\\n position: relative;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar.p-mod-dragging[data-orientation='horizontal']\\n .p-TabBar-tab,\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .p-TabBar.p-mod-dragging[data-orientation='horizontal']\\n .p-TabBar-tab,\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar.lm-mod-dragging[data-orientation='horizontal']\\n .lm-TabBar-tab {\\n left: 0;\\n transition: left 150ms ease;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar.p-mod-dragging[data-orientation='vertical']\\n .p-TabBar-tab,\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n> .p-TabBar.p-mod-dragging[data-orientation='vertical']\\n.p-TabBar-tab,\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar.lm-mod-dragging[data-orientation='vertical']\\n .lm-TabBar-tab {\\n top: 0;\\n transition: top 150ms ease;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar.p-mod-dragging\\n .p-TabBar-tab.p-mod-dragging,\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n> .p-TabBar.p-mod-dragging\\n.p-TabBar-tab.p-mod-dragging,\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar.lm-mod-dragging\\n .lm-TabBar-tab.lm-mod-dragging {\\n transition: none;\\n}\\n\\n/* End tabbar.css */\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../packages/thebe/node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../packages/thebe/node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"/*\\n\\nThe nouislider.css file is autogenerated from nouislider.less, which imports and wraps the nouislider/src/nouislider.less styles.\\n\\nMIT License\\n\\nCopyright (c) 2019 Léon Gersen\\n\\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n\\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n\\nTHE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n*/\\n/* The .widget-slider class is deprecated */\\n.widget-slider,\\n.jupyter-widget-slider {\\n /* Functional styling;\\n * These styles are required for noUiSlider to function.\\n * You don't need to change these rules to apply your design.\\n */\\n /* Wrapper for all connect elements.\\n */\\n /* Offset direction\\n */\\n /* Give origins 0 height/width so they don't interfere with clicking the\\n * connect elements.\\n */\\n /* Slider size and handle placement;\\n */\\n /* Styling;\\n * Giving the connect element a border radius causes issues with using transform: scale\\n */\\n /* Handles and cursors;\\n */\\n /* Handle stripes;\\n */\\n /* Disabled state;\\n */\\n /* Base;\\n *\\n */\\n /* Values;\\n *\\n */\\n /* Markings;\\n *\\n */\\n /* Horizontal layout;\\n *\\n */\\n /* Vertical layout;\\n *\\n */\\n /* Copyright (c) Jupyter Development Team.\\n * Distributed under the terms of the Modified BSD License.\\n */\\n /* Custom CSS for nouislider */\\n}\\n.widget-slider .noUi-target,\\n.jupyter-widget-slider .noUi-target,\\n.widget-slider .noUi-target *,\\n.jupyter-widget-slider .noUi-target * {\\n -webkit-touch-callout: none;\\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\\n -webkit-user-select: none;\\n -ms-touch-action: none;\\n touch-action: none;\\n -ms-user-select: none;\\n -moz-user-select: none;\\n user-select: none;\\n -moz-box-sizing: border-box;\\n box-sizing: border-box;\\n}\\n.widget-slider .noUi-target,\\n.jupyter-widget-slider .noUi-target {\\n position: relative;\\n}\\n.widget-slider .noUi-base,\\n.jupyter-widget-slider .noUi-base,\\n.widget-slider .noUi-connects,\\n.jupyter-widget-slider .noUi-connects {\\n width: 100%;\\n height: 100%;\\n position: relative;\\n z-index: 1;\\n}\\n.widget-slider .noUi-connects,\\n.jupyter-widget-slider .noUi-connects {\\n overflow: hidden;\\n z-index: 0;\\n}\\n.widget-slider .noUi-connect,\\n.jupyter-widget-slider .noUi-connect,\\n.widget-slider .noUi-origin,\\n.jupyter-widget-slider .noUi-origin {\\n will-change: transform;\\n position: absolute;\\n z-index: 1;\\n top: 0;\\n right: 0;\\n -ms-transform-origin: 0 0;\\n -webkit-transform-origin: 0 0;\\n -webkit-transform-style: preserve-3d;\\n transform-origin: 0 0;\\n transform-style: flat;\\n}\\n.widget-slider .noUi-connect,\\n.jupyter-widget-slider .noUi-connect {\\n height: 100%;\\n width: 100%;\\n}\\n.widget-slider .noUi-origin,\\n.jupyter-widget-slider .noUi-origin {\\n height: 10%;\\n width: 10%;\\n}\\n.widget-slider .noUi-txt-dir-rtl.noUi-horizontal .noUi-origin,\\n.jupyter-widget-slider .noUi-txt-dir-rtl.noUi-horizontal .noUi-origin {\\n left: 0;\\n right: auto;\\n}\\n.widget-slider .noUi-vertical .noUi-origin,\\n.jupyter-widget-slider .noUi-vertical .noUi-origin {\\n width: 0;\\n}\\n.widget-slider .noUi-horizontal .noUi-origin,\\n.jupyter-widget-slider .noUi-horizontal .noUi-origin {\\n height: 0;\\n}\\n.widget-slider .noUi-handle,\\n.jupyter-widget-slider .noUi-handle {\\n -webkit-backface-visibility: hidden;\\n backface-visibility: hidden;\\n position: absolute;\\n}\\n.widget-slider .noUi-touch-area,\\n.jupyter-widget-slider .noUi-touch-area {\\n height: 100%;\\n width: 100%;\\n}\\n.widget-slider .noUi-state-tap .noUi-connect,\\n.jupyter-widget-slider .noUi-state-tap .noUi-connect,\\n.widget-slider .noUi-state-tap .noUi-origin,\\n.jupyter-widget-slider .noUi-state-tap .noUi-origin {\\n -webkit-transition: transform 0.3s;\\n transition: transform 0.3s;\\n}\\n.widget-slider .noUi-state-drag *,\\n.jupyter-widget-slider .noUi-state-drag * {\\n cursor: inherit !important;\\n}\\n.widget-slider .noUi-horizontal,\\n.jupyter-widget-slider .noUi-horizontal {\\n height: 18px;\\n}\\n.widget-slider .noUi-horizontal .noUi-handle,\\n.jupyter-widget-slider .noUi-horizontal .noUi-handle {\\n width: 34px;\\n height: 28px;\\n right: -17px;\\n top: -6px;\\n}\\n.widget-slider .noUi-vertical,\\n.jupyter-widget-slider .noUi-vertical {\\n width: 18px;\\n}\\n.widget-slider .noUi-vertical .noUi-handle,\\n.jupyter-widget-slider .noUi-vertical .noUi-handle {\\n width: 28px;\\n height: 34px;\\n right: -6px;\\n top: -17px;\\n}\\n.widget-slider .noUi-txt-dir-rtl.noUi-horizontal .noUi-handle,\\n.jupyter-widget-slider .noUi-txt-dir-rtl.noUi-horizontal .noUi-handle {\\n left: -17px;\\n right: auto;\\n}\\n.widget-slider .noUi-target,\\n.jupyter-widget-slider .noUi-target {\\n background: #FAFAFA;\\n border-radius: 4px;\\n border: 1px solid #D3D3D3;\\n box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB;\\n}\\n.widget-slider .noUi-connects,\\n.jupyter-widget-slider .noUi-connects {\\n border-radius: 3px;\\n}\\n.widget-slider .noUi-connect,\\n.jupyter-widget-slider .noUi-connect {\\n background: #3FB8AF;\\n}\\n.widget-slider .noUi-draggable,\\n.jupyter-widget-slider .noUi-draggable {\\n cursor: ew-resize;\\n}\\n.widget-slider .noUi-vertical .noUi-draggable,\\n.jupyter-widget-slider .noUi-vertical .noUi-draggable {\\n cursor: ns-resize;\\n}\\n.widget-slider .noUi-handle,\\n.jupyter-widget-slider .noUi-handle {\\n border: 1px solid #D9D9D9;\\n border-radius: 3px;\\n background: #FFF;\\n cursor: default;\\n box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #EBEBEB, 0 3px 6px -3px #BBB;\\n}\\n.widget-slider .noUi-active,\\n.jupyter-widget-slider .noUi-active {\\n box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #DDD, 0 3px 6px -3px #BBB;\\n}\\n.widget-slider .noUi-handle:before,\\n.jupyter-widget-slider .noUi-handle:before,\\n.widget-slider .noUi-handle:after,\\n.jupyter-widget-slider .noUi-handle:after {\\n content: \\\"\\\";\\n display: block;\\n position: absolute;\\n height: 14px;\\n width: 1px;\\n background: #E8E7E6;\\n left: 14px;\\n top: 6px;\\n}\\n.widget-slider .noUi-handle:after,\\n.jupyter-widget-slider .noUi-handle:after {\\n left: 17px;\\n}\\n.widget-slider .noUi-vertical .noUi-handle:before,\\n.jupyter-widget-slider .noUi-vertical .noUi-handle:before,\\n.widget-slider .noUi-vertical .noUi-handle:after,\\n.jupyter-widget-slider .noUi-vertical .noUi-handle:after {\\n width: 14px;\\n height: 1px;\\n left: 6px;\\n top: 14px;\\n}\\n.widget-slider .noUi-vertical .noUi-handle:after,\\n.jupyter-widget-slider .noUi-vertical .noUi-handle:after {\\n top: 17px;\\n}\\n.widget-slider [disabled] .noUi-connect,\\n.jupyter-widget-slider [disabled] .noUi-connect {\\n background: #B8B8B8;\\n}\\n.widget-slider [disabled].noUi-target,\\n.jupyter-widget-slider [disabled].noUi-target,\\n.widget-slider [disabled].noUi-handle,\\n.jupyter-widget-slider [disabled].noUi-handle,\\n.widget-slider [disabled] .noUi-handle,\\n.jupyter-widget-slider [disabled] .noUi-handle {\\n cursor: not-allowed;\\n}\\n.widget-slider .noUi-pips,\\n.jupyter-widget-slider .noUi-pips,\\n.widget-slider .noUi-pips *,\\n.jupyter-widget-slider .noUi-pips * {\\n -moz-box-sizing: border-box;\\n box-sizing: border-box;\\n}\\n.widget-slider .noUi-pips,\\n.jupyter-widget-slider .noUi-pips {\\n position: absolute;\\n color: #999;\\n}\\n.widget-slider .noUi-value,\\n.jupyter-widget-slider .noUi-value {\\n position: absolute;\\n white-space: nowrap;\\n text-align: center;\\n}\\n.widget-slider .noUi-value-sub,\\n.jupyter-widget-slider .noUi-value-sub {\\n color: #ccc;\\n font-size: 10px;\\n}\\n.widget-slider .noUi-marker,\\n.jupyter-widget-slider .noUi-marker {\\n position: absolute;\\n background: #CCC;\\n}\\n.widget-slider .noUi-marker-sub,\\n.jupyter-widget-slider .noUi-marker-sub {\\n background: #AAA;\\n}\\n.widget-slider .noUi-marker-large,\\n.jupyter-widget-slider .noUi-marker-large {\\n background: #AAA;\\n}\\n.widget-slider .noUi-pips-horizontal,\\n.jupyter-widget-slider .noUi-pips-horizontal {\\n padding: 10px 0;\\n height: 80px;\\n top: 100%;\\n left: 0;\\n width: 100%;\\n}\\n.widget-slider .noUi-value-horizontal,\\n.jupyter-widget-slider .noUi-value-horizontal {\\n -webkit-transform: translate(-50%, 50%);\\n transform: translate(-50%, 50%);\\n}\\n.noUi-rtl .widget-slider .noUi-value-horizontal,\\n.noUi-rtl .jupyter-widget-slider .noUi-value-horizontal {\\n -webkit-transform: translate(50%, 50%);\\n transform: translate(50%, 50%);\\n}\\n.widget-slider .noUi-marker-horizontal.noUi-marker,\\n.jupyter-widget-slider .noUi-marker-horizontal.noUi-marker {\\n margin-left: -1px;\\n width: 2px;\\n height: 5px;\\n}\\n.widget-slider .noUi-marker-horizontal.noUi-marker-sub,\\n.jupyter-widget-slider .noUi-marker-horizontal.noUi-marker-sub {\\n height: 10px;\\n}\\n.widget-slider .noUi-marker-horizontal.noUi-marker-large,\\n.jupyter-widget-slider .noUi-marker-horizontal.noUi-marker-large {\\n height: 15px;\\n}\\n.widget-slider .noUi-pips-vertical,\\n.jupyter-widget-slider .noUi-pips-vertical {\\n padding: 0 10px;\\n height: 100%;\\n top: 0;\\n left: 100%;\\n}\\n.widget-slider .noUi-value-vertical,\\n.jupyter-widget-slider .noUi-value-vertical {\\n -webkit-transform: translate(0, -50%);\\n transform: translate(0, -50%);\\n padding-left: 25px;\\n}\\n.noUi-rtl .widget-slider .noUi-value-vertical,\\n.noUi-rtl .jupyter-widget-slider .noUi-value-vertical {\\n -webkit-transform: translate(0, 50%);\\n transform: translate(0, 50%);\\n}\\n.widget-slider .noUi-marker-vertical.noUi-marker,\\n.jupyter-widget-slider .noUi-marker-vertical.noUi-marker {\\n width: 5px;\\n height: 2px;\\n margin-top: -1px;\\n}\\n.widget-slider .noUi-marker-vertical.noUi-marker-sub,\\n.jupyter-widget-slider .noUi-marker-vertical.noUi-marker-sub {\\n width: 10px;\\n}\\n.widget-slider .noUi-marker-vertical.noUi-marker-large,\\n.jupyter-widget-slider .noUi-marker-vertical.noUi-marker-large {\\n width: 15px;\\n}\\n.widget-slider .noUi-tooltip,\\n.jupyter-widget-slider .noUi-tooltip {\\n display: block;\\n position: absolute;\\n border: 1px solid #D9D9D9;\\n border-radius: 3px;\\n background: #fff;\\n color: #000;\\n padding: 5px;\\n text-align: center;\\n white-space: nowrap;\\n}\\n.widget-slider .noUi-horizontal .noUi-tooltip,\\n.jupyter-widget-slider .noUi-horizontal .noUi-tooltip {\\n -webkit-transform: translate(-50%, 0);\\n transform: translate(-50%, 0);\\n left: 50%;\\n bottom: 120%;\\n}\\n.widget-slider .noUi-vertical .noUi-tooltip,\\n.jupyter-widget-slider .noUi-vertical .noUi-tooltip {\\n -webkit-transform: translate(0, -50%);\\n transform: translate(0, -50%);\\n top: 50%;\\n right: 120%;\\n}\\n.widget-slider .noUi-horizontal .noUi-origin > .noUi-tooltip,\\n.jupyter-widget-slider .noUi-horizontal .noUi-origin > .noUi-tooltip {\\n -webkit-transform: translate(50%, 0);\\n transform: translate(50%, 0);\\n left: auto;\\n bottom: 10px;\\n}\\n.widget-slider .noUi-vertical .noUi-origin > .noUi-tooltip,\\n.jupyter-widget-slider .noUi-vertical .noUi-origin > .noUi-tooltip {\\n -webkit-transform: translate(0, -18px);\\n transform: translate(0, -18px);\\n top: auto;\\n right: 28px;\\n}\\n.widget-slider .noUi-connect,\\n.jupyter-widget-slider .noUi-connect {\\n background: #2196f3;\\n}\\n.widget-slider .noUi-horizontal,\\n.jupyter-widget-slider .noUi-horizontal {\\n height: var(--jp-widgets-slider-track-thickness);\\n}\\n.widget-slider .noUi-vertical,\\n.jupyter-widget-slider .noUi-vertical {\\n width: var(--jp-widgets-slider-track-thickness);\\n height: 100%;\\n}\\n.widget-slider .noUi-horizontal .noUi-handle,\\n.jupyter-widget-slider .noUi-horizontal .noUi-handle {\\n width: var(--jp-widgets-slider-handle-size);\\n height: var(--jp-widgets-slider-handle-size);\\n border-radius: 50%;\\n top: calc((var(--jp-widgets-slider-track-thickness) - var(--jp-widgets-slider-handle-size)) / 2);\\n right: calc(var(--jp-widgets-slider-handle-size) / -2);\\n}\\n.widget-slider .noUi-vertical .noUi-handle,\\n.jupyter-widget-slider .noUi-vertical .noUi-handle {\\n height: var(--jp-widgets-slider-handle-size);\\n width: var(--jp-widgets-slider-handle-size);\\n border-radius: 50%;\\n right: calc((var(--jp-widgets-slider-handle-size) - var(--jp-widgets-slider-track-thickness)) / -2);\\n top: calc(var(--jp-widgets-slider-handle-size) / -2);\\n}\\n.widget-slider .noUi-handle:after,\\n.jupyter-widget-slider .noUi-handle:after {\\n content: none;\\n}\\n.widget-slider .noUi-handle:before,\\n.jupyter-widget-slider .noUi-handle:before {\\n content: none;\\n}\\n.widget-slider .noUi-target,\\n.jupyter-widget-slider .noUi-target {\\n background: #fafafa;\\n border-radius: 4px;\\n border: 1px;\\n /* box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB; */\\n}\\n.widget-slider .ui-slider,\\n.jupyter-widget-slider .ui-slider {\\n border: var(--jp-widgets-slider-border-width) solid var(--jp-layout-color3);\\n background: var(--jp-layout-color3);\\n box-sizing: border-box;\\n position: relative;\\n border-radius: 0px;\\n}\\n.widget-slider .noUi-handle,\\n.jupyter-widget-slider .noUi-handle {\\n width: var(--jp-widgets-slider-handle-size);\\n border: 1px solid #d9d9d9;\\n border-radius: 3px;\\n background: #fff;\\n cursor: default;\\n box-shadow: none;\\n outline: none;\\n}\\n.widget-slider .noUi-target:not([disabled]) .noUi-handle:hover,\\n.jupyter-widget-slider .noUi-target:not([disabled]) .noUi-handle:hover,\\n.widget-slider .noUi-target:not([disabled]) .noUi-handle:focus,\\n.jupyter-widget-slider .noUi-target:not([disabled]) .noUi-handle:focus {\\n background-color: var(--jp-widgets-slider-active-handle-color);\\n border: var(--jp-widgets-slider-border-width) solid var(--jp-widgets-slider-active-handle-color);\\n}\\n.widget-slider [disabled].noUi-target,\\n.jupyter-widget-slider [disabled].noUi-target {\\n opacity: 0.35;\\n}\\n.widget-slider .noUi-connects,\\n.jupyter-widget-slider .noUi-connects {\\n overflow: visible;\\n z-index: 0;\\n background: var(--jp-layout-color3);\\n}\\n.widget-slider .noUi-vertical .noUi-connect,\\n.jupyter-widget-slider .noUi-vertical .noUi-connect {\\n width: calc(100% + 2px);\\n right: -1px;\\n}\\n.widget-slider .noUi-horizontal .noUi-connect,\\n.jupyter-widget-slider .noUi-horizontal .noUi-connect {\\n height: calc(100% + 2px);\\n top: -1px;\\n}\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./../../node_modules/@jupyter-widgets/controls/css/nouislider.css\"],\"names\":[],\"mappings\":\"AAAA;;;;;;;;;;;;;CAaC;AACD,2CAA2C;AAC3C;;EAEE;;;EAGA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;;EAEA;EACA;;EAEA;EACA;;EAEA;EACA;;EAEA;EACA;;EAEA;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AS;EACT,YAAY;AACd;AACA;;EAEE,qCAAqC;EACrC,6BAA6B;EAC7B,QAAQ;EACR,WAAW;AACb;AACA;;EAEE,oCAAoC;EACpC,4BAA4B;EAC5B,UAAU;EACV,YAAY;AACd;AACA;;EAEE,sCAAsC;EACtC,8BAA8B;EAC9B,SAAS;EACT,WAAW;AACb;AACA;;EAEE,mBAAmB;AACrB;AACA;;EAEE,gDAAgD;AAClD;AACA;;EAEE,+CAA+C;EAC/C,YAAY;AACd;AACA;;EAEE,2CAA2C;EAC3C,4CAA4C;EAC5C,kBAAkB;EAClB,gGAAgG;EAChG,sDAAsD;AACxD;AACA;;EAEE,4CAA4C;EAC5C,2CAA2C;EAC3C,kBAAkB;EAClB,mGAAmG;EACnG,oDAAoD;AACtD;AACA;;EAEE,aAAa;AACf;AACA;;EAEE,aAAa;AACf;AACA;;EAEE,mBAAmB;EACnB,kBAAkB;EAClB,WAAW;EACX,8DAA8D;AAChE;AACA;;EAEE,2EAA2E;EAC3E,mCAAmC;EACnC,sBAAsB;EACtB,kBAAkB;EAClB,kBAAkB;AACpB;AACA;;EAEE,2CAA2C;EAC3C,yBAAyB;EACzB,kBAAkB;EAClB,gBAAgB;EAChB,eAAe;EACf,gBAAgB;EAChB,aAAa;AACf;AACA;;;;EAIE,8DAA8D;EAC9D,gGAAgG;AAClG;AACA;;EAEE,aAAa;AACf;AACA;;EAEE,iBAAiB;EACjB,UAAU;EACV,mCAAmC;AACrC;AACA;;EAEE,uBAAuB;EACvB,WAAW;AACb;AACA;;EAEE,wBAAwB;EACxB,SAAS;AACX\",\"sourcesContent\":[\"/*\\n\\nThe nouislider.css file is autogenerated from nouislider.less, which imports and wraps the nouislider/src/nouislider.less styles.\\n\\nMIT License\\n\\nCopyright (c) 2019 Léon Gersen\\n\\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n\\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n\\nTHE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n*/\\n/* The .widget-slider class is deprecated */\\n.widget-slider,\\n.jupyter-widget-slider {\\n /* Functional styling;\\n * These styles are required for noUiSlider to function.\\n * You don't need to change these rules to apply your design.\\n */\\n /* Wrapper for all connect elements.\\n */\\n /* Offset direction\\n */\\n /* Give origins 0 height/width so they don't interfere with clicking the\\n * connect elements.\\n */\\n /* Slider size and handle placement;\\n */\\n /* Styling;\\n * Giving the connect element a border radius causes issues with using transform: scale\\n */\\n /* Handles and cursors;\\n */\\n /* Handle stripes;\\n */\\n /* Disabled state;\\n */\\n /* Base;\\n *\\n */\\n /* Values;\\n *\\n */\\n /* Markings;\\n *\\n */\\n /* Horizontal layout;\\n *\\n */\\n /* Vertical layout;\\n *\\n */\\n /* Copyright (c) Jupyter Development Team.\\n * Distributed under the terms of the Modified BSD License.\\n */\\n /* Custom CSS for nouislider */\\n}\\n.widget-slider .noUi-target,\\n.jupyter-widget-slider .noUi-target,\\n.widget-slider .noUi-target *,\\n.jupyter-widget-slider .noUi-target * {\\n -webkit-touch-callout: none;\\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\\n -webkit-user-select: none;\\n -ms-touch-action: none;\\n touch-action: none;\\n -ms-user-select: none;\\n -moz-user-select: none;\\n user-select: none;\\n -moz-box-sizing: border-box;\\n box-sizing: border-box;\\n}\\n.widget-slider .noUi-target,\\n.jupyter-widget-slider .noUi-target {\\n position: relative;\\n}\\n.widget-slider .noUi-base,\\n.jupyter-widget-slider .noUi-base,\\n.widget-slider .noUi-connects,\\n.jupyter-widget-slider .noUi-connects {\\n width: 100%;\\n height: 100%;\\n position: relative;\\n z-index: 1;\\n}\\n.widget-slider .noUi-connects,\\n.jupyter-widget-slider .noUi-connects {\\n overflow: hidden;\\n z-index: 0;\\n}\\n.widget-slider .noUi-connect,\\n.jupyter-widget-slider .noUi-connect,\\n.widget-slider .noUi-origin,\\n.jupyter-widget-slider .noUi-origin {\\n will-change: transform;\\n position: absolute;\\n z-index: 1;\\n top: 0;\\n right: 0;\\n -ms-transform-origin: 0 0;\\n -webkit-transform-origin: 0 0;\\n -webkit-transform-style: preserve-3d;\\n transform-origin: 0 0;\\n transform-style: flat;\\n}\\n.widget-slider .noUi-connect,\\n.jupyter-widget-slider .noUi-connect {\\n height: 100%;\\n width: 100%;\\n}\\n.widget-slider .noUi-origin,\\n.jupyter-widget-slider .noUi-origin {\\n height: 10%;\\n width: 10%;\\n}\\n.widget-slider .noUi-txt-dir-rtl.noUi-horizontal .noUi-origin,\\n.jupyter-widget-slider .noUi-txt-dir-rtl.noUi-horizontal .noUi-origin {\\n left: 0;\\n right: auto;\\n}\\n.widget-slider .noUi-vertical .noUi-origin,\\n.jupyter-widget-slider .noUi-vertical .noUi-origin {\\n width: 0;\\n}\\n.widget-slider .noUi-horizontal .noUi-origin,\\n.jupyter-widget-slider .noUi-horizontal .noUi-origin {\\n height: 0;\\n}\\n.widget-slider .noUi-handle,\\n.jupyter-widget-slider .noUi-handle {\\n -webkit-backface-visibility: hidden;\\n backface-visibility: hidden;\\n position: absolute;\\n}\\n.widget-slider .noUi-touch-area,\\n.jupyter-widget-slider .noUi-touch-area {\\n height: 100%;\\n width: 100%;\\n}\\n.widget-slider .noUi-state-tap .noUi-connect,\\n.jupyter-widget-slider .noUi-state-tap .noUi-connect,\\n.widget-slider .noUi-state-tap .noUi-origin,\\n.jupyter-widget-slider .noUi-state-tap .noUi-origin {\\n -webkit-transition: transform 0.3s;\\n transition: transform 0.3s;\\n}\\n.widget-slider .noUi-state-drag *,\\n.jupyter-widget-slider .noUi-state-drag * {\\n cursor: inherit !important;\\n}\\n.widget-slider .noUi-horizontal,\\n.jupyter-widget-slider .noUi-horizontal {\\n height: 18px;\\n}\\n.widget-slider .noUi-horizontal .noUi-handle,\\n.jupyter-widget-slider .noUi-horizontal .noUi-handle {\\n width: 34px;\\n height: 28px;\\n right: -17px;\\n top: -6px;\\n}\\n.widget-slider .noUi-vertical,\\n.jupyter-widget-slider .noUi-vertical {\\n width: 18px;\\n}\\n.widget-slider .noUi-vertical .noUi-handle,\\n.jupyter-widget-slider .noUi-vertical .noUi-handle {\\n width: 28px;\\n height: 34px;\\n right: -6px;\\n top: -17px;\\n}\\n.widget-slider .noUi-txt-dir-rtl.noUi-horizontal .noUi-handle,\\n.jupyter-widget-slider .noUi-txt-dir-rtl.noUi-horizontal .noUi-handle {\\n left: -17px;\\n right: auto;\\n}\\n.widget-slider .noUi-target,\\n.jupyter-widget-slider .noUi-target {\\n background: #FAFAFA;\\n border-radius: 4px;\\n border: 1px solid #D3D3D3;\\n box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB;\\n}\\n.widget-slider .noUi-connects,\\n.jupyter-widget-slider .noUi-connects {\\n border-radius: 3px;\\n}\\n.widget-slider .noUi-connect,\\n.jupyter-widget-slider .noUi-connect {\\n background: #3FB8AF;\\n}\\n.widget-slider .noUi-draggable,\\n.jupyter-widget-slider .noUi-draggable {\\n cursor: ew-resize;\\n}\\n.widget-slider .noUi-vertical .noUi-draggable,\\n.jupyter-widget-slider .noUi-vertical .noUi-draggable {\\n cursor: ns-resize;\\n}\\n.widget-slider .noUi-handle,\\n.jupyter-widget-slider .noUi-handle {\\n border: 1px solid #D9D9D9;\\n border-radius: 3px;\\n background: #FFF;\\n cursor: default;\\n box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #EBEBEB, 0 3px 6px -3px #BBB;\\n}\\n.widget-slider .noUi-active,\\n.jupyter-widget-slider .noUi-active {\\n box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #DDD, 0 3px 6px -3px #BBB;\\n}\\n.widget-slider .noUi-handle:before,\\n.jupyter-widget-slider .noUi-handle:before,\\n.widget-slider .noUi-handle:after,\\n.jupyter-widget-slider .noUi-handle:after {\\n content: \\\"\\\";\\n display: block;\\n position: absolute;\\n height: 14px;\\n width: 1px;\\n background: #E8E7E6;\\n left: 14px;\\n top: 6px;\\n}\\n.widget-slider .noUi-handle:after,\\n.jupyter-widget-slider .noUi-handle:after {\\n left: 17px;\\n}\\n.widget-slider .noUi-vertical .noUi-handle:before,\\n.jupyter-widget-slider .noUi-vertical .noUi-handle:before,\\n.widget-slider .noUi-vertical .noUi-handle:after,\\n.jupyter-widget-slider .noUi-vertical .noUi-handle:after {\\n width: 14px;\\n height: 1px;\\n left: 6px;\\n top: 14px;\\n}\\n.widget-slider .noUi-vertical .noUi-handle:after,\\n.jupyter-widget-slider .noUi-vertical .noUi-handle:after {\\n top: 17px;\\n}\\n.widget-slider [disabled] .noUi-connect,\\n.jupyter-widget-slider [disabled] .noUi-connect {\\n background: #B8B8B8;\\n}\\n.widget-slider [disabled].noUi-target,\\n.jupyter-widget-slider [disabled].noUi-target,\\n.widget-slider [disabled].noUi-handle,\\n.jupyter-widget-slider [disabled].noUi-handle,\\n.widget-slider [disabled] .noUi-handle,\\n.jupyter-widget-slider [disabled] .noUi-handle {\\n cursor: not-allowed;\\n}\\n.widget-slider .noUi-pips,\\n.jupyter-widget-slider .noUi-pips,\\n.widget-slider .noUi-pips *,\\n.jupyter-widget-slider .noUi-pips * {\\n -moz-box-sizing: border-box;\\n box-sizing: border-box;\\n}\\n.widget-slider .noUi-pips,\\n.jupyter-widget-slider .noUi-pips {\\n position: absolute;\\n color: #999;\\n}\\n.widget-slider .noUi-value,\\n.jupyter-widget-slider .noUi-value {\\n position: absolute;\\n white-space: nowrap;\\n text-align: center;\\n}\\n.widget-slider .noUi-value-sub,\\n.jupyter-widget-slider .noUi-value-sub {\\n color: #ccc;\\n font-size: 10px;\\n}\\n.widget-slider .noUi-marker,\\n.jupyter-widget-slider .noUi-marker {\\n position: absolute;\\n background: #CCC;\\n}\\n.widget-slider .noUi-marker-sub,\\n.jupyter-widget-slider .noUi-marker-sub {\\n background: #AAA;\\n}\\n.widget-slider .noUi-marker-large,\\n.jupyter-widget-slider .noUi-marker-large {\\n background: #AAA;\\n}\\n.widget-slider .noUi-pips-horizontal,\\n.jupyter-widget-slider .noUi-pips-horizontal {\\n padding: 10px 0;\\n height: 80px;\\n top: 100%;\\n left: 0;\\n width: 100%;\\n}\\n.widget-slider .noUi-value-horizontal,\\n.jupyter-widget-slider .noUi-value-horizontal {\\n -webkit-transform: translate(-50%, 50%);\\n transform: translate(-50%, 50%);\\n}\\n.noUi-rtl .widget-slider .noUi-value-horizontal,\\n.noUi-rtl .jupyter-widget-slider .noUi-value-horizontal {\\n -webkit-transform: translate(50%, 50%);\\n transform: translate(50%, 50%);\\n}\\n.widget-slider .noUi-marker-horizontal.noUi-marker,\\n.jupyter-widget-slider .noUi-marker-horizontal.noUi-marker {\\n margin-left: -1px;\\n width: 2px;\\n height: 5px;\\n}\\n.widget-slider .noUi-marker-horizontal.noUi-marker-sub,\\n.jupyter-widget-slider .noUi-marker-horizontal.noUi-marker-sub {\\n height: 10px;\\n}\\n.widget-slider .noUi-marker-horizontal.noUi-marker-large,\\n.jupyter-widget-slider .noUi-marker-horizontal.noUi-marker-large {\\n height: 15px;\\n}\\n.widget-slider .noUi-pips-vertical,\\n.jupyter-widget-slider .noUi-pips-vertical {\\n padding: 0 10px;\\n height: 100%;\\n top: 0;\\n left: 100%;\\n}\\n.widget-slider .noUi-value-vertical,\\n.jupyter-widget-slider .noUi-value-vertical {\\n -webkit-transform: translate(0, -50%);\\n transform: translate(0, -50%);\\n padding-left: 25px;\\n}\\n.noUi-rtl .widget-slider .noUi-value-vertical,\\n.noUi-rtl .jupyter-widget-slider .noUi-value-vertical {\\n -webkit-transform: translate(0, 50%);\\n transform: translate(0, 50%);\\n}\\n.widget-slider .noUi-marker-vertical.noUi-marker,\\n.jupyter-widget-slider .noUi-marker-vertical.noUi-marker {\\n width: 5px;\\n height: 2px;\\n margin-top: -1px;\\n}\\n.widget-slider .noUi-marker-vertical.noUi-marker-sub,\\n.jupyter-widget-slider .noUi-marker-vertical.noUi-marker-sub {\\n width: 10px;\\n}\\n.widget-slider .noUi-marker-vertical.noUi-marker-large,\\n.jupyter-widget-slider .noUi-marker-vertical.noUi-marker-large {\\n width: 15px;\\n}\\n.widget-slider .noUi-tooltip,\\n.jupyter-widget-slider .noUi-tooltip {\\n display: block;\\n position: absolute;\\n border: 1px solid #D9D9D9;\\n border-radius: 3px;\\n background: #fff;\\n color: #000;\\n padding: 5px;\\n text-align: center;\\n white-space: nowrap;\\n}\\n.widget-slider .noUi-horizontal .noUi-tooltip,\\n.jupyter-widget-slider .noUi-horizontal .noUi-tooltip {\\n -webkit-transform: translate(-50%, 0);\\n transform: translate(-50%, 0);\\n left: 50%;\\n bottom: 120%;\\n}\\n.widget-slider .noUi-vertical .noUi-tooltip,\\n.jupyter-widget-slider .noUi-vertical .noUi-tooltip {\\n -webkit-transform: translate(0, -50%);\\n transform: translate(0, -50%);\\n top: 50%;\\n right: 120%;\\n}\\n.widget-slider .noUi-horizontal .noUi-origin > .noUi-tooltip,\\n.jupyter-widget-slider .noUi-horizontal .noUi-origin > .noUi-tooltip {\\n -webkit-transform: translate(50%, 0);\\n transform: translate(50%, 0);\\n left: auto;\\n bottom: 10px;\\n}\\n.widget-slider .noUi-vertical .noUi-origin > .noUi-tooltip,\\n.jupyter-widget-slider .noUi-vertical .noUi-origin > .noUi-tooltip {\\n -webkit-transform: translate(0, -18px);\\n transform: translate(0, -18px);\\n top: auto;\\n right: 28px;\\n}\\n.widget-slider .noUi-connect,\\n.jupyter-widget-slider .noUi-connect {\\n background: #2196f3;\\n}\\n.widget-slider .noUi-horizontal,\\n.jupyter-widget-slider .noUi-horizontal {\\n height: var(--jp-widgets-slider-track-thickness);\\n}\\n.widget-slider .noUi-vertical,\\n.jupyter-widget-slider .noUi-vertical {\\n width: var(--jp-widgets-slider-track-thickness);\\n height: 100%;\\n}\\n.widget-slider .noUi-horizontal .noUi-handle,\\n.jupyter-widget-slider .noUi-horizontal .noUi-handle {\\n width: var(--jp-widgets-slider-handle-size);\\n height: var(--jp-widgets-slider-handle-size);\\n border-radius: 50%;\\n top: calc((var(--jp-widgets-slider-track-thickness) - var(--jp-widgets-slider-handle-size)) / 2);\\n right: calc(var(--jp-widgets-slider-handle-size) / -2);\\n}\\n.widget-slider .noUi-vertical .noUi-handle,\\n.jupyter-widget-slider .noUi-vertical .noUi-handle {\\n height: var(--jp-widgets-slider-handle-size);\\n width: var(--jp-widgets-slider-handle-size);\\n border-radius: 50%;\\n right: calc((var(--jp-widgets-slider-handle-size) - var(--jp-widgets-slider-track-thickness)) / -2);\\n top: calc(var(--jp-widgets-slider-handle-size) / -2);\\n}\\n.widget-slider .noUi-handle:after,\\n.jupyter-widget-slider .noUi-handle:after {\\n content: none;\\n}\\n.widget-slider .noUi-handle:before,\\n.jupyter-widget-slider .noUi-handle:before {\\n content: none;\\n}\\n.widget-slider .noUi-target,\\n.jupyter-widget-slider .noUi-target {\\n background: #fafafa;\\n border-radius: 4px;\\n border: 1px;\\n /* box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB; */\\n}\\n.widget-slider .ui-slider,\\n.jupyter-widget-slider .ui-slider {\\n border: var(--jp-widgets-slider-border-width) solid var(--jp-layout-color3);\\n background: var(--jp-layout-color3);\\n box-sizing: border-box;\\n position: relative;\\n border-radius: 0px;\\n}\\n.widget-slider .noUi-handle,\\n.jupyter-widget-slider .noUi-handle {\\n width: var(--jp-widgets-slider-handle-size);\\n border: 1px solid #d9d9d9;\\n border-radius: 3px;\\n background: #fff;\\n cursor: default;\\n box-shadow: none;\\n outline: none;\\n}\\n.widget-slider .noUi-target:not([disabled]) .noUi-handle:hover,\\n.jupyter-widget-slider .noUi-target:not([disabled]) .noUi-handle:hover,\\n.widget-slider .noUi-target:not([disabled]) .noUi-handle:focus,\\n.jupyter-widget-slider .noUi-target:not([disabled]) .noUi-handle:focus {\\n background-color: var(--jp-widgets-slider-active-handle-color);\\n border: var(--jp-widgets-slider-border-width) solid var(--jp-widgets-slider-active-handle-color);\\n}\\n.widget-slider [disabled].noUi-target,\\n.jupyter-widget-slider [disabled].noUi-target {\\n opacity: 0.35;\\n}\\n.widget-slider .noUi-connects,\\n.jupyter-widget-slider .noUi-connects {\\n overflow: visible;\\n z-index: 0;\\n background: var(--jp-layout-color3);\\n}\\n.widget-slider .noUi-vertical .noUi-connect,\\n.jupyter-widget-slider .noUi-vertical .noUi-connect {\\n width: calc(100% + 2px);\\n right: -1px;\\n}\\n.widget-slider .noUi-horizontal .noUi-connect,\\n.jupyter-widget-slider .noUi-horizontal .noUi-connect {\\n height: calc(100% + 2px);\\n top: -1px;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../packages/thebe/node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../packages/thebe/node_modules/css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_0___ from \"-!../../../../packages/thebe/node_modules/css-loader/dist/cjs.js!./lumino.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_1___ from \"-!../../../../packages/thebe/node_modules/css-loader/dist/cjs.js!./nouislider.css\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"/* Copyright (c) Jupyter Development Team.\\n * Distributed under the terms of the Modified BSD License.\\n */\\n\\n/*\\n * We assume that the CSS variables in\\n * https://github.com/jupyterlab/jupyterlab/blob/master/src/default-theme/variables.css\\n * have been defined.\\n */\\n\\n:root {\\n --jp-widgets-color: var(--jp-content-font-color1);\\n --jp-widgets-label-color: var(--jp-widgets-color);\\n --jp-widgets-readout-color: var(--jp-widgets-color);\\n --jp-widgets-font-size: var(--jp-ui-font-size1);\\n --jp-widgets-margin: 2px;\\n --jp-widgets-inline-height: 28px;\\n --jp-widgets-inline-width: 300px;\\n --jp-widgets-inline-width-short: calc(\\n var(--jp-widgets-inline-width) / 2 - var(--jp-widgets-margin)\\n );\\n --jp-widgets-inline-width-tiny: calc(\\n var(--jp-widgets-inline-width-short) / 2 - var(--jp-widgets-margin)\\n );\\n --jp-widgets-inline-margin: 4px; /* margin between inline elements */\\n --jp-widgets-inline-label-width: 80px;\\n --jp-widgets-border-width: var(--jp-border-width);\\n --jp-widgets-vertical-height: 200px;\\n --jp-widgets-horizontal-tab-height: 24px;\\n --jp-widgets-horizontal-tab-width: 144px;\\n --jp-widgets-horizontal-tab-top-border: 2px;\\n --jp-widgets-progress-thickness: 20px;\\n --jp-widgets-container-padding: 15px;\\n --jp-widgets-input-padding: 4px;\\n --jp-widgets-radio-item-height-adjustment: 8px;\\n --jp-widgets-radio-item-height: calc(\\n var(--jp-widgets-inline-height) -\\n var(--jp-widgets-radio-item-height-adjustment)\\n );\\n --jp-widgets-slider-track-thickness: 4px;\\n --jp-widgets-slider-border-width: var(--jp-widgets-border-width);\\n --jp-widgets-slider-handle-size: 16px;\\n --jp-widgets-slider-handle-border-color: var(--jp-border-color1);\\n --jp-widgets-slider-handle-background-color: var(--jp-layout-color1);\\n --jp-widgets-slider-active-handle-color: var(--jp-brand-color1);\\n --jp-widgets-menu-item-height: 24px;\\n --jp-widgets-dropdown-arrow: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxOCAxOCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTggMTg7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDpub25lO30KPC9zdHlsZT4KPHBhdGggZD0iTTUuMiw1LjlMOSw5LjdsMy44LTMuOGwxLjIsMS4ybC00LjksNWwtNC45LTVMNS4yLDUuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTAtMC42aDE4djE4SDBWLTAuNnoiLz4KPC9zdmc+Cg');\\n --jp-widgets-input-color: var(--jp-ui-font-color1);\\n --jp-widgets-input-background-color: var(--jp-layout-color1);\\n --jp-widgets-input-border-color: var(--jp-border-color1);\\n --jp-widgets-input-focus-border-color: var(--jp-brand-color2);\\n --jp-widgets-input-border-width: var(--jp-widgets-border-width);\\n --jp-widgets-disabled-opacity: 0.6;\\n\\n /* From Material Design Lite */\\n --md-shadow-key-umbra-opacity: 0.2;\\n --md-shadow-key-penumbra-opacity: 0.14;\\n --md-shadow-ambient-shadow-opacity: 0.12;\\n}\\n\\n.jupyter-widgets {\\n margin: var(--jp-widgets-margin);\\n box-sizing: border-box;\\n color: var(--jp-widgets-color);\\n overflow: visible;\\n}\\n\\n.jp-Output-result > .jupyter-widgets {\\n margin-left: 0;\\n margin-right: 0;\\n}\\n\\n/* vbox and hbox */\\n\\n/* */\\n.widget-inline-hbox, /* */\\n .jupyter-widget-inline-hbox {\\n /* Horizontal widgets */\\n box-sizing: border-box;\\n display: flex;\\n flex-direction: row;\\n align-items: baseline;\\n}\\n\\n/* */\\n.widget-inline-vbox, /* */\\n .jupyter-widget-inline-vbox {\\n /* Vertical Widgets */\\n box-sizing: border-box;\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n}\\n\\n/* */\\n.widget-box, /* */\\n.jupyter-widget-box {\\n box-sizing: border-box;\\n display: flex;\\n margin: 0;\\n overflow: auto;\\n}\\n\\n/* */\\n.widget-gridbox, /* */\\n.jupyter-widget-gridbox {\\n box-sizing: border-box;\\n display: grid;\\n margin: 0;\\n overflow: auto;\\n}\\n\\n/* */\\n.widget-hbox, /* */\\n.jupyter-widget-hbox {\\n flex-direction: row;\\n}\\n\\n/* */\\n.widget-vbox, /* */\\n.jupyter-widget-vbox {\\n flex-direction: column;\\n}\\n\\n/* General Tags Styling */\\n\\n.jupyter-widget-tagsinput {\\n display: flex;\\n flex-direction: row;\\n flex-wrap: wrap;\\n align-items: center;\\n overflow: auto;\\n\\n cursor: text;\\n}\\n\\n.jupyter-widget-tag {\\n padding-left: 10px;\\n padding-right: 10px;\\n padding-top: 0px;\\n padding-bottom: 0px;\\n display: inline-block;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n text-align: center;\\n font-size: var(--jp-widgets-font-size);\\n\\n height: calc(var(--jp-widgets-inline-height) - 2px);\\n border: 0px solid;\\n line-height: calc(var(--jp-widgets-inline-height) - 2px);\\n box-shadow: none;\\n\\n color: var(--jp-ui-font-color1);\\n background-color: var(--jp-layout-color2);\\n border-color: var(--jp-border-color2);\\n border: none;\\n user-select: none;\\n\\n cursor: grab;\\n transition: margin-left 200ms;\\n margin: 1px 1px 1px 1px;\\n}\\n\\n.jupyter-widget-tag.mod-active {\\n /* MD Lite 4dp shadow */\\n box-shadow: 0 4px 5px 0 rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)),\\n 0 1px 10px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity)),\\n 0 2px 4px -1px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity));\\n color: var(--jp-ui-font-color1);\\n background-color: var(--jp-layout-color3);\\n}\\n\\n.jupyter-widget-colortag {\\n color: var(--jp-inverse-ui-font-color1);\\n}\\n\\n.jupyter-widget-colortag.mod-active {\\n color: var(--jp-inverse-ui-font-color0);\\n}\\n\\n.jupyter-widget-taginput {\\n color: var(--jp-ui-font-color0);\\n background-color: var(--jp-layout-color0);\\n\\n cursor: text;\\n text-align: left;\\n}\\n\\n.jupyter-widget-taginput:focus {\\n outline: none;\\n}\\n\\n.jupyter-widget-tag-close {\\n margin-left: var(--jp-widgets-inline-margin);\\n padding: 2px 0px 2px 2px;\\n}\\n\\n.jupyter-widget-tag-close:hover {\\n cursor: pointer;\\n}\\n\\n/* Tag \\\"Primary\\\" Styling */\\n\\n.jupyter-widget-tag.mod-primary {\\n color: var(--jp-inverse-ui-font-color1);\\n background-color: var(--jp-brand-color1);\\n}\\n\\n.jupyter-widget-tag.mod-primary.mod-active {\\n color: var(--jp-inverse-ui-font-color0);\\n background-color: var(--jp-brand-color0);\\n}\\n\\n/* Tag \\\"Success\\\" Styling */\\n\\n.jupyter-widget-tag.mod-success {\\n color: var(--jp-inverse-ui-font-color1);\\n background-color: var(--jp-success-color1);\\n}\\n\\n.jupyter-widget-tag.mod-success.mod-active {\\n color: var(--jp-inverse-ui-font-color0);\\n background-color: var(--jp-success-color0);\\n}\\n\\n/* Tag \\\"Info\\\" Styling */\\n\\n.jupyter-widget-tag.mod-info {\\n color: var(--jp-inverse-ui-font-color1);\\n background-color: var(--jp-info-color1);\\n}\\n\\n.jupyter-widget-tag.mod-info.mod-active {\\n color: var(--jp-inverse-ui-font-color0);\\n background-color: var(--jp-info-color0);\\n}\\n\\n/* Tag \\\"Warning\\\" Styling */\\n\\n.jupyter-widget-tag.mod-warning {\\n color: var(--jp-inverse-ui-font-color1);\\n background-color: var(--jp-warn-color1);\\n}\\n\\n.jupyter-widget-tag.mod-warning.mod-active {\\n color: var(--jp-inverse-ui-font-color0);\\n background-color: var(--jp-warn-color0);\\n}\\n\\n/* Tag \\\"Danger\\\" Styling */\\n\\n.jupyter-widget-tag.mod-danger {\\n color: var(--jp-inverse-ui-font-color1);\\n background-color: var(--jp-error-color1);\\n}\\n\\n.jupyter-widget-tag.mod-danger.mod-active {\\n color: var(--jp-inverse-ui-font-color0);\\n background-color: var(--jp-error-color0);\\n}\\n\\n/* General Button Styling */\\n\\n.jupyter-button {\\n padding-left: 10px;\\n padding-right: 10px;\\n padding-top: 0px;\\n padding-bottom: 0px;\\n display: inline-block;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n text-align: center;\\n font-size: var(--jp-widgets-font-size);\\n cursor: pointer;\\n\\n height: var(--jp-widgets-inline-height);\\n border: 0px solid;\\n line-height: var(--jp-widgets-inline-height);\\n box-shadow: none;\\n\\n color: var(--jp-ui-font-color1);\\n background-color: var(--jp-layout-color2);\\n border-color: var(--jp-border-color2);\\n border: none;\\n user-select: none;\\n}\\n\\n.jupyter-button i.fa {\\n margin-right: var(--jp-widgets-inline-margin);\\n pointer-events: none;\\n}\\n\\n.jupyter-button:empty:before {\\n content: '\\\\200b'; /* zero-width space */\\n}\\n\\n.jupyter-widgets.jupyter-button:disabled {\\n opacity: var(--jp-widgets-disabled-opacity);\\n}\\n\\n.jupyter-button i.fa.center {\\n margin-right: 0;\\n}\\n\\n.jupyter-button:hover:enabled,\\n.jupyter-button:focus:enabled {\\n /* MD Lite 2dp shadow */\\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)),\\n 0 3px 1px -2px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity)),\\n 0 1px 5px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity));\\n}\\n\\n.jupyter-button:active,\\n.jupyter-button.mod-active {\\n /* MD Lite 4dp shadow */\\n box-shadow: 0 4px 5px 0 rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)),\\n 0 1px 10px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity)),\\n 0 2px 4px -1px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity));\\n color: var(--jp-ui-font-color1);\\n background-color: var(--jp-layout-color3);\\n}\\n\\n.jupyter-button:focus:enabled {\\n outline: 1px solid var(--jp-widgets-input-focus-border-color);\\n}\\n\\n/* Button \\\"Primary\\\" Styling */\\n\\n.jupyter-button.mod-primary {\\n color: var(--jp-ui-inverse-font-color1);\\n background-color: var(--jp-brand-color1);\\n}\\n\\n.jupyter-button.mod-primary.mod-active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-brand-color0);\\n}\\n\\n.jupyter-button.mod-primary:active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-brand-color0);\\n}\\n\\n/* Button \\\"Success\\\" Styling */\\n\\n.jupyter-button.mod-success {\\n color: var(--jp-ui-inverse-font-color1);\\n background-color: var(--jp-success-color1);\\n}\\n\\n.jupyter-button.mod-success.mod-active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-success-color0);\\n}\\n\\n.jupyter-button.mod-success:active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-success-color0);\\n}\\n\\n/* Button \\\"Info\\\" Styling */\\n\\n.jupyter-button.mod-info {\\n color: var(--jp-ui-inverse-font-color1);\\n background-color: var(--jp-info-color1);\\n}\\n\\n.jupyter-button.mod-info.mod-active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-info-color0);\\n}\\n\\n.jupyter-button.mod-info:active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-info-color0);\\n}\\n\\n/* Button \\\"Warning\\\" Styling */\\n\\n.jupyter-button.mod-warning {\\n color: var(--jp-ui-inverse-font-color1);\\n background-color: var(--jp-warn-color1);\\n}\\n\\n.jupyter-button.mod-warning.mod-active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-warn-color0);\\n}\\n\\n.jupyter-button.mod-warning:active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-warn-color0);\\n}\\n\\n/* Button \\\"Danger\\\" Styling */\\n\\n.jupyter-button.mod-danger {\\n color: var(--jp-ui-inverse-font-color1);\\n background-color: var(--jp-error-color1);\\n}\\n\\n.jupyter-button.mod-danger.mod-active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-error-color0);\\n}\\n\\n.jupyter-button.mod-danger:active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-error-color0);\\n}\\n\\n/* Widget Button, Widget Toggle Button, Widget Upload */\\n\\n/* */\\n.widget-button, /* */\\n/* */ .widget-toggle-button, /* */\\n/* */ .widget-upload, /* */\\n.jupyter-widget-button,\\n.jupyter-widget-toggle-button,\\n.jupyter-widget-upload {\\n width: var(--jp-widgets-inline-width-short);\\n}\\n\\n/* Widget Label Styling */\\n\\n/* Override Bootstrap label css */\\n.jupyter-widgets label {\\n margin-bottom: initial;\\n}\\n\\n/* */\\n.widget-label-basic, /* */\\n.jupyter-widget-label-basic {\\n /* Basic Label */\\n color: var(--jp-widgets-label-color);\\n font-size: var(--jp-widgets-font-size);\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-label, /* */\\n.jupyter-widget-label {\\n /* Label */\\n color: var(--jp-widgets-label-color);\\n font-size: var(--jp-widgets-font-size);\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-inline-hbox .widget-label, /* */\\n.jupyter-widget-inline-hbox .jupyter-widget-label {\\n /* Horizontal Widget Label */\\n color: var(--jp-widgets-label-color);\\n text-align: right;\\n margin-right: calc(var(--jp-widgets-inline-margin) * 2);\\n width: var(--jp-widgets-inline-label-width);\\n flex-shrink: 0;\\n}\\n\\n/* */\\n.widget-inline-vbox .widget-label, /* */\\n.jupyter-widget-inline-vbox .jupyter-widget-label {\\n /* Vertical Widget Label */\\n color: var(--jp-widgets-label-color);\\n text-align: center;\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* Widget Readout Styling */\\n\\n/* */\\n.widget-readout, /* */\\n.jupyter-widget-readout {\\n color: var(--jp-widgets-readout-color);\\n font-size: var(--jp-widgets-font-size);\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n overflow: hidden;\\n white-space: nowrap;\\n text-align: center;\\n}\\n\\n/* */\\n.widget-readout.overflow, /* */\\n.jupyter-widget-readout.overflow {\\n /* Overflowing Readout */\\n\\n /* From Material Design Lite\\n shadow-key-umbra-opacity: 0.2;\\n shadow-key-penumbra-opacity: 0.14;\\n shadow-ambient-shadow-opacity: 0.12;\\n */\\n -webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2),\\n 0 3px 1px -2px rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);\\n\\n -moz-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2),\\n 0 3px 1px -2px rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);\\n\\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 1px -2px rgba(0, 0, 0, 0.14),\\n 0 1px 5px 0 rgba(0, 0, 0, 0.12);\\n}\\n\\n/* */\\n.widget-inline-hbox .widget-readout, /* */\\n.jupyter-widget-inline-hbox .jupyter-widget-readout {\\n /* Horizontal Readout */\\n text-align: center;\\n max-width: var(--jp-widgets-inline-width-short);\\n min-width: var(--jp-widgets-inline-width-tiny);\\n margin-left: var(--jp-widgets-inline-margin);\\n}\\n\\n/* */\\n.widget-inline-vbox .widget-readout, /* */\\n.jupyter-widget-inline-vbox .jupyter-widget-readout {\\n /* Vertical Readout */\\n margin-top: var(--jp-widgets-inline-margin);\\n /* as wide as the widget */\\n width: inherit;\\n}\\n\\n/* Widget Checkbox Styling */\\n\\n/* */\\n.widget-checkbox, /* */\\n.jupyter-widget-checkbox {\\n width: var(--jp-widgets-inline-width);\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-checkbox input[type='checkbox'], /* */\\n.jupyter-widget-checkbox input[type='checkbox'] {\\n margin: 0px calc(var(--jp-widgets-inline-margin) * 2) 0px 0px;\\n line-height: var(--jp-widgets-inline-height);\\n font-size: large;\\n flex-grow: 1;\\n flex-shrink: 0;\\n align-self: center;\\n}\\n\\n/* Widget Valid Styling */\\n\\n/* */\\n.widget-valid, /* */\\n.jupyter-widget-valid {\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n width: var(--jp-widgets-inline-width-short);\\n font-size: var(--jp-widgets-font-size);\\n}\\n\\n/* */\\n.widget-valid i, /* */\\n.jupyter-widget-valid i {\\n line-height: var(--jp-widgets-inline-height);\\n margin-right: var(--jp-widgets-inline-margin);\\n margin-left: var(--jp-widgets-inline-margin);\\n}\\n\\n/* */\\n.widget-valid.mod-valid i, /* */\\n.jupyter-widget-valid.mod-valid i {\\n color: green;\\n}\\n\\n/* */\\n.widget-valid.mod-invalid i, /* */\\n.jupyter-widget-valid.mod-invalid i {\\n color: red;\\n}\\n\\n/* */\\n.widget-valid.mod-valid .widget-valid-readout, /* */\\n.jupyter-widget-valid.mod-valid .jupyter-widget-valid-readout {\\n display: none;\\n}\\n\\n/* Widget Text and TextArea Styling */\\n\\n/* */\\n.widget-textarea, /* */\\n/* */ .widget-text, /* */\\n.jupyter-widget-textarea,\\n.jupyter-widget-text {\\n width: var(--jp-widgets-inline-width);\\n}\\n\\n/* */\\n.widget-text input[type='text'], /* */\\n/* */ .widget-text input[type='number'], /* */\\n/* */ .widget-text input[type='password'], /* */\\n.jupyter-widget-text input[type='text'],\\n.jupyter-widget-text input[type='number'],\\n.jupyter-widget-text input[type='password'] {\\n height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-text input[type='text']:disabled, /* */\\n/* */ .widget-text input[type='number']:disabled, /* */\\n/* */ .widget-text input[type='password']:disabled, /* */\\n/* */ .widget-textarea textarea:disabled, /* */\\n.jupyter-widget-text input[type='text']:disabled,\\n.jupyter-widget-text input[type='number']:disabled,\\n.jupyter-widget-text input[type='password']:disabled,\\n.jupyter-widget-textarea textarea:disabled {\\n opacity: var(--jp-widgets-disabled-opacity);\\n}\\n\\n/* */\\n.widget-text input[type='text'], /* */\\n/* */ .widget-text input[type='number'], /* */\\n/* */ .widget-text input[type='password'], /* */\\n/* */ .widget-textarea textarea, /* */\\n.jupyter-widget-text input[type='text'],\\n.jupyter-widget-text input[type='number'],\\n.jupyter-widget-text input[type='password'],\\n.jupyter-widget-textarea textarea {\\n box-sizing: border-box;\\n border: var(--jp-widgets-input-border-width) solid\\n var(--jp-widgets-input-border-color);\\n background-color: var(--jp-widgets-input-background-color);\\n color: var(--jp-widgets-input-color);\\n font-size: var(--jp-widgets-font-size);\\n flex-grow: 1;\\n min-width: 0; /* This makes it possible for the flexbox to shrink this input */\\n flex-shrink: 1;\\n outline: none !important;\\n}\\n\\n/* */\\n.widget-text input[type='text'], /* */\\n/* */ .widget-text input[type='password'], /* */\\n/* */ .widget-textarea textarea, /* */\\n.jupyter-widget-text input[type='text'],\\n.jupyter-widget-text input[type='password'],\\n.jupyter-widget-textarea textarea {\\n padding: var(--jp-widgets-input-padding)\\n calc(var(--jp-widgets-input-padding) * 2);\\n}\\n\\n/* */\\n.widget-text input[type='number'], /* */\\n.jupyter-widget-text input[type='number'] {\\n padding: var(--jp-widgets-input-padding) 0 var(--jp-widgets-input-padding)\\n calc(var(--jp-widgets-input-padding) * 2);\\n}\\n\\n/* */\\n.widget-textarea textarea, /* */\\n.jupyter-widget-textarea textarea {\\n height: inherit;\\n width: inherit;\\n}\\n\\n/* */\\n.widget-text input:focus, /* */\\n/* */ .widget-textarea textarea:focus, /* */\\n.jupyter-widget-text input:focus,\\n.jupyter-widget-textarea textarea:focus {\\n border-color: var(--jp-widgets-input-focus-border-color);\\n}\\n\\n/* Horizontal Slider */\\n/* */\\n.widget-hslider, /* */\\n.jupyter-widget-hslider {\\n width: var(--jp-widgets-inline-width);\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n\\n /* Override the align-items baseline. This way, the description and readout\\n still seem to align their baseline properly, and we don't have to have\\n align-self: stretch in the .slider-container. */\\n align-items: center;\\n}\\n\\n/* */\\n.widgets-slider .slider-container, /* */\\n.jupyter-widgets-slider .slider-container {\\n overflow: visible;\\n}\\n\\n/* */\\n.widget-hslider .slider-container, /* */\\n.jupyter-widget-hslider .slider-container {\\n margin-left: calc(\\n var(--jp-widgets-slider-handle-size) / 2 - 2 *\\n var(--jp-widgets-slider-border-width)\\n );\\n margin-right: calc(\\n var(--jp-widgets-slider-handle-size) / 2 - 2 *\\n var(--jp-widgets-slider-border-width)\\n );\\n flex: 1 1 var(--jp-widgets-inline-width-short);\\n}\\n\\n/* Vertical Slider */\\n\\n/* */\\n.widget-vbox .widget-label, /* */\\n.jupyter-widget-vbox .jupyter-widget-label {\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-vslider, /* */\\n.jupyter-widget-vslider {\\n /* Vertical Slider */\\n height: var(--jp-widgets-vertical-height);\\n width: var(--jp-widgets-inline-width-tiny);\\n}\\n\\n/* */\\n.widget-vslider .slider-container, /* */\\n.jupyter-widget-vslider .slider-container {\\n flex: 1 1 var(--jp-widgets-inline-width-short);\\n margin-left: auto;\\n margin-right: auto;\\n margin-bottom: calc(\\n var(--jp-widgets-slider-handle-size) / 2 - 2 *\\n var(--jp-widgets-slider-border-width)\\n );\\n margin-top: calc(\\n var(--jp-widgets-slider-handle-size) / 2 - 2 *\\n var(--jp-widgets-slider-border-width)\\n );\\n display: flex;\\n flex-direction: column;\\n}\\n\\n/* Widget Progress Styling */\\n\\n.progress-bar {\\n -webkit-transition: none;\\n -moz-transition: none;\\n -ms-transition: none;\\n -o-transition: none;\\n transition: none;\\n}\\n\\n.progress-bar {\\n height: var(--jp-widgets-inline-height);\\n}\\n\\n.progress-bar {\\n background-color: var(--jp-brand-color1);\\n}\\n\\n.progress-bar-success {\\n background-color: var(--jp-success-color1);\\n}\\n\\n.progress-bar-info {\\n background-color: var(--jp-info-color1);\\n}\\n\\n.progress-bar-warning {\\n background-color: var(--jp-warn-color1);\\n}\\n\\n.progress-bar-danger {\\n background-color: var(--jp-error-color1);\\n}\\n\\n.progress {\\n background-color: var(--jp-layout-color2);\\n border: none;\\n box-shadow: none;\\n}\\n\\n/* Horisontal Progress */\\n\\n/* */\\n.widget-hprogress, /* */\\n.jupyter-widget-hprogress {\\n /* Progress Bar */\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n width: var(--jp-widgets-inline-width);\\n align-items: center;\\n}\\n\\n/* */\\n.widget-hprogress .progress, /* */\\n.jupyter-widget-hprogress .progress {\\n flex-grow: 1;\\n margin-top: var(--jp-widgets-input-padding);\\n margin-bottom: var(--jp-widgets-input-padding);\\n align-self: stretch;\\n /* Override bootstrap style */\\n height: initial;\\n}\\n\\n/* Vertical Progress */\\n\\n/* */\\n.widget-vprogress, /* */\\n.jupyter-widget-vprogress {\\n height: var(--jp-widgets-vertical-height);\\n width: var(--jp-widgets-inline-width-tiny);\\n}\\n\\n/* */\\n.widget-vprogress .progress, /* */\\n.jupyter-widget-vprogress .progress {\\n flex-grow: 1;\\n width: var(--jp-widgets-progress-thickness);\\n margin-left: auto;\\n margin-right: auto;\\n margin-bottom: 0;\\n}\\n\\n/* Select Widget Styling */\\n\\n/* */\\n.widget-dropdown, /* */\\n.jupyter-widget-dropdown {\\n height: var(--jp-widgets-inline-height);\\n width: var(--jp-widgets-inline-width);\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-dropdown > select, /* */\\n.jupyter-widget-dropdown > select {\\n padding-right: 20px;\\n border: var(--jp-widgets-input-border-width) solid\\n var(--jp-widgets-input-border-color);\\n border-radius: 0;\\n height: inherit;\\n flex: 1 1 var(--jp-widgets-inline-width-short);\\n min-width: 0; /* This makes it possible for the flexbox to shrink this input */\\n box-sizing: border-box;\\n outline: none !important;\\n box-shadow: none;\\n background-color: var(--jp-widgets-input-background-color);\\n color: var(--jp-widgets-input-color);\\n font-size: var(--jp-widgets-font-size);\\n vertical-align: top;\\n padding-left: calc(var(--jp-widgets-input-padding) * 2);\\n appearance: none;\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n background-repeat: no-repeat;\\n background-size: 20px;\\n background-position: right center;\\n background-image: var(--jp-widgets-dropdown-arrow);\\n}\\n/* */\\n.widget-dropdown > select:focus, /* */\\n.jupyter-widget-dropdown > select:focus {\\n border-color: var(--jp-widgets-input-focus-border-color);\\n}\\n\\n/* */\\n.widget-dropdown > select:disabled, /* */\\n.jupyter-widget-dropdown > select:disabled {\\n opacity: var(--jp-widgets-disabled-opacity);\\n}\\n\\n/* To disable the dotted border in Firefox around select controls.\\n See http://stackoverflow.com/a/18853002 */\\n/* */\\n.widget-dropdown > select:-moz-focusring, /* */\\n.jupyter-widget-dropdown > select:-moz-focusring {\\n color: transparent;\\n text-shadow: 0 0 0 #000;\\n}\\n\\n/* Select and SelectMultiple */\\n\\n/* */\\n.widget-select, /* */\\n.jupyter-widget-select {\\n width: var(--jp-widgets-inline-width);\\n line-height: var(--jp-widgets-inline-height);\\n\\n /* Because Firefox defines the baseline of a select as the bottom of the\\n control, we align the entire control to the top and add padding to the\\n select to get an approximate first line baseline alignment. */\\n align-items: flex-start;\\n}\\n\\n/* */\\n.widget-select > select, /* */\\n.jupyter-widget-select > select {\\n border: var(--jp-widgets-input-border-width) solid\\n var(--jp-widgets-input-border-color);\\n background-color: var(--jp-widgets-input-background-color);\\n color: var(--jp-widgets-input-color);\\n font-size: var(--jp-widgets-font-size);\\n flex: 1 1 var(--jp-widgets-inline-width-short);\\n outline: none !important;\\n overflow: auto;\\n height: inherit;\\n\\n /* Because Firefox defines the baseline of a select as the bottom of the\\n control, we align the entire control to the top and add padding to the\\n select to get an approximate first line baseline alignment. */\\n padding-top: 5px;\\n}\\n\\n/* */\\n.widget-select > select:focus, /* */\\n.jupyter-widget-select > select:focus {\\n border-color: var(--jp-widgets-input-focus-border-color);\\n}\\n\\n.wiget-select > select > option,\\n.jupyter-wiget-select > select > option {\\n padding-left: var(--jp-widgets-input-padding);\\n line-height: var(--jp-widgets-inline-height);\\n /* line-height doesn't work on some browsers for select options */\\n padding-top: calc(\\n var(--jp-widgets-inline-height) - var(--jp-widgets-font-size) / 2\\n );\\n padding-bottom: calc(\\n var(--jp-widgets-inline-height) - var(--jp-widgets-font-size) / 2\\n );\\n}\\n\\n/* Toggle Buttons Styling */\\n\\n/* */\\n.widget-toggle-buttons, /* */\\n.jupyter-widget-toggle-buttons {\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-toggle-buttons .widget-toggle-button, /* */\\n.jupyter-widget-toggle-buttons .jupyter-widget-toggle-button {\\n margin-left: var(--jp-widgets-margin);\\n margin-right: var(--jp-widgets-margin);\\n}\\n\\n/* */\\n.widget-toggle-buttons .jupyter-button:disabled, /* */\\n.jupyter-widget-toggle-buttons .jupyter-button:disabled {\\n opacity: var(--jp-widgets-disabled-opacity);\\n}\\n\\n/* Radio Buttons Styling */\\n\\n/* */\\n.widget-radio, /* */\\n.jupyter-widget-radio {\\n width: var(--jp-widgets-inline-width);\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-radio-box, /* */\\n.jupyter-widget-radio-box {\\n display: flex;\\n flex-direction: column;\\n align-items: stretch;\\n box-sizing: border-box;\\n flex-grow: 1;\\n margin-bottom: var(--jp-widgets-radio-item-height-adjustment);\\n}\\n\\n/* */\\n.widget-radio-box-vertical, /* */\\n.jupyter-widget-radio-box-vertical {\\n flex-direction: column;\\n}\\n\\n/* */\\n.widget-radio-box-horizontal, /* */\\n.jupyter-widget-radio-box-horizontal {\\n flex-direction: row;\\n}\\n\\n/* */\\n.widget-radio-box label, /* */\\n.jupyter-widget-radio-box label {\\n height: var(--jp-widgets-radio-item-height);\\n line-height: var(--jp-widgets-radio-item-height);\\n font-size: var(--jp-widgets-font-size);\\n}\\n\\n.widget-radio-box-horizontal label,\\n.jupyter-widget-radio-box-horizontal label {\\n margin: 0 calc(var(--jp-widgets-input-padding) * 2) 0 0;\\n}\\n\\n/* */\\n.widget-radio-box input, /* */\\n.jupyter-widget-radio-box input {\\n height: var(--jp-widgets-radio-item-height);\\n line-height: var(--jp-widgets-radio-item-height);\\n margin: 0 calc(var(--jp-widgets-input-padding) * 2) 0 1px;\\n float: left;\\n}\\n\\n/* Color Picker Styling */\\n\\n/* */\\n.widget-colorpicker, /* */\\n.jupyter-widget-colorpicker {\\n width: var(--jp-widgets-inline-width);\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-colorpicker > .widget-colorpicker-input, /* */\\n.jupyter-widget-colorpicker > .jupyter-widget-colorpicker-input {\\n flex-grow: 1;\\n flex-shrink: 1;\\n min-width: var(--jp-widgets-inline-width-tiny);\\n}\\n\\n/* */\\n.widget-colorpicker input[type='color'], /* */\\n.jupyter-widget-colorpicker input[type='color'] {\\n width: var(--jp-widgets-inline-height);\\n height: var(--jp-widgets-inline-height);\\n padding: 0 2px; /* make the color square actually square on Chrome on OS X */\\n background: var(--jp-widgets-input-background-color);\\n color: var(--jp-widgets-input-color);\\n border: var(--jp-widgets-input-border-width) solid\\n var(--jp-widgets-input-border-color);\\n border-left: none;\\n flex-grow: 0;\\n flex-shrink: 0;\\n box-sizing: border-box;\\n align-self: stretch;\\n outline: none !important;\\n}\\n\\n/* */\\n.widget-colorpicker.concise input[type='color'], /* */\\n.jupyter-widget-colorpicker.concise input[type='color'] {\\n border-left: var(--jp-widgets-input-border-width) solid\\n var(--jp-widgets-input-border-color);\\n}\\n\\n/* */\\n.widget-colorpicker input[type='color']:focus, /* */\\n/* */ .widget-colorpicker input[type='text']:focus, /* */\\n.jupyter-widget-colorpicker input[type='color']:focus,\\n.jupyter-widget-colorpicker input[type='text']:focus {\\n border-color: var(--jp-widgets-input-focus-border-color);\\n}\\n\\n/* */\\n.widget-colorpicker input[type='text'], /* */\\n.jupyter-widget-colorpicker input[type='text'] {\\n flex-grow: 1;\\n outline: none !important;\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n background: var(--jp-widgets-input-background-color);\\n color: var(--jp-widgets-input-color);\\n border: var(--jp-widgets-input-border-width) solid\\n var(--jp-widgets-input-border-color);\\n font-size: var(--jp-widgets-font-size);\\n padding: var(--jp-widgets-input-padding)\\n calc(var(--jp-widgets-input-padding) * 2);\\n min-width: 0; /* This makes it possible for the flexbox to shrink this input */\\n flex-shrink: 1;\\n box-sizing: border-box;\\n}\\n\\n/* */\\n.widget-colorpicker input[type='text']:disabled, /* */\\n.jupyter-widget-colorpicker input[type='text']:disabled {\\n opacity: var(--jp-widgets-disabled-opacity);\\n}\\n\\n/* Date Picker Styling */\\n\\n/* */\\n.widget-datepicker, /* */\\n.jupyter-widget-datepicker {\\n width: var(--jp-widgets-inline-width);\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-datepicker input[type='date'], /* */\\n.jupyter-widget-datepicker input[type='date'] {\\n flex-grow: 1;\\n flex-shrink: 1;\\n min-width: 0; /* This makes it possible for the flexbox to shrink this input */\\n outline: none !important;\\n height: var(--jp-widgets-inline-height);\\n border: var(--jp-widgets-input-border-width) solid\\n var(--jp-widgets-input-border-color);\\n background-color: var(--jp-widgets-input-background-color);\\n color: var(--jp-widgets-input-color);\\n font-size: var(--jp-widgets-font-size);\\n padding: var(--jp-widgets-input-padding)\\n calc(var(--jp-widgets-input-padding) * 2);\\n box-sizing: border-box;\\n}\\n\\n/* */\\n.widget-datepicker input[type='date']:focus, /* */\\n.jupyter-widget-datepicker input[type='date']:focus {\\n border-color: var(--jp-widgets-input-focus-border-color);\\n}\\n\\n/* */\\n.widget-datepicker input[type='date']:invalid, /* */\\n.jupyter-widget-datepicker input[type='date']:invalid {\\n border-color: var(--jp-warn-color1);\\n}\\n\\n/* */\\n.widget-datepicker input[type='date']:disabled, /* */\\n.jupyter-widget-datepicker input[type='date']:disabled {\\n opacity: var(--jp-widgets-disabled-opacity);\\n}\\n\\n/* Play Widget */\\n\\n/* */\\n.widget-play, /* */\\n.jupyter-widget-play {\\n width: var(--jp-widgets-inline-width-short);\\n display: flex;\\n align-items: stretch;\\n}\\n\\n/* */\\n.widget-play .jupyter-button, /* */\\n.jupyter-widget-play .jupyter-button {\\n flex-grow: 1;\\n height: auto;\\n}\\n\\n/* */\\n.widget-play .jupyter-button:disabled, /* */\\n.jupyter-widget-play .jupyter-button:disabled {\\n opacity: var(--jp-widgets-disabled-opacity);\\n}\\n\\n/* Tab Widget */\\n\\n/* */\\n.jupyter-widgets.widget-tab, /* */\\n.jupyter-widgets.jupyter-widget-tab {\\n display: flex;\\n flex-direction: column;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar {\\n /* Necessary so that a tab can be shifted down to overlay the border of the box below. */\\n overflow-x: visible;\\n overflow-y: visible;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar > .p-TabBar-content, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar > .p-TabBar-content, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar > .lm-TabBar-content {\\n /* Make sure that the tab grows from bottom up */\\n align-items: flex-end;\\n min-width: 0;\\n min-height: 0;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .widget-tab-contents, /* */\\n.jupyter-widgets.jupyter-widget-tab > .widget-tab-contents {\\n width: 100%;\\n box-sizing: border-box;\\n margin: 0;\\n background: var(--jp-layout-color1);\\n color: var(--jp-ui-font-color1);\\n border: var(--jp-border-width) solid var(--jp-border-color1);\\n padding: var(--jp-widgets-container-padding);\\n flex-grow: 1;\\n overflow: auto;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar {\\n font: var(--jp-widgets-font-size) Helvetica, Arial, sans-serif;\\n min-height: calc(\\n var(--jp-widgets-horizontal-tab-height) + var(--jp-border-width)\\n );\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab {\\n flex: 0 1 var(--jp-widgets-horizontal-tab-width);\\n min-width: 35px;\\n min-height: calc(\\n var(--jp-widgets-horizontal-tab-height) + var(--jp-border-width)\\n );\\n line-height: var(--jp-widgets-horizontal-tab-height);\\n margin-left: calc(-1 * var(--jp-border-width));\\n padding: 0px 10px;\\n background: var(--jp-layout-color2);\\n color: var(--jp-ui-font-color2);\\n border: var(--jp-border-width) solid var(--jp-border-color1);\\n border-bottom: none;\\n position: relative;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab.p-mod-current, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab.p-mod-current, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab.lm-mod-current {\\n color: var(--jp-ui-font-color0);\\n /* We want the background to match the tab content background */\\n background: var(--jp-layout-color1);\\n min-height: calc(\\n var(--jp-widgets-horizontal-tab-height) + 2 * var(--jp-border-width)\\n );\\n transform: translateY(var(--jp-border-width));\\n overflow: visible;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab.p-mod-current:before, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab.p-mod-current:before, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab.lm-mod-current:before {\\n position: absolute;\\n top: calc(-1 * var(--jp-border-width));\\n left: calc(-1 * var(--jp-border-width));\\n content: '';\\n height: var(--jp-widgets-horizontal-tab-top-border);\\n width: calc(100% + 2 * var(--jp-border-width));\\n background: var(--jp-brand-color1);\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab:first-child, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab:first-child, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab:first-child {\\n margin-left: 0;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar\\n .p-TabBar-tab:hover:not(.p-mod-current),\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .p-TabBar\\n .p-TabBar-tab:hover:not(.p-mod-current),\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar\\n .lm-TabBar-tab:hover:not(.lm-mod-current) {\\n background: var(--jp-layout-color1);\\n color: var(--jp-ui-font-color1);\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar\\n .p-mod-closable\\n > .p-TabBar-tabCloseIcon,\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n> .p-TabBar\\n.p-mod-closable\\n> .p-TabBar-tabCloseIcon,\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar\\n .lm-mod-closable\\n > .lm-TabBar-tabCloseIcon {\\n margin-left: 4px;\\n}\\n\\n/* This font-awesome strategy may not work across FA4 and FA5, but we don't\\nactually support closable tabs, so it really doesn't matter */\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar\\n .p-mod-closable\\n > .p-TabBar-tabCloseIcon:before,\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-widget-tab\\n> .p-TabBar\\n.p-mod-closable\\n> .p-TabBar-tabCloseIcon:before,\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar\\n .lm-mod-closable\\n > .lm-TabBar-tabCloseIcon:before {\\n font-family: FontAwesome;\\n content: '\\\\f00d'; /* close */\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabIcon, /* */\\n/* */ .jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabLabel, /* */\\n/* */ .jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabCloseIcon, /* */\\n/* */ .jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabIcon, /* */\\n/* */ .jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabLabel, /* */\\n/* */ .jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabCloseIcon, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabIcon,\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabLabel,\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabCloseIcon {\\n line-height: var(--jp-widgets-horizontal-tab-height);\\n}\\n\\n/* Accordion Widget */\\n\\n.jupyter-widget-Collapse {\\n display: flex;\\n flex-direction: column;\\n align-items: stretch;\\n}\\n\\n.jupyter-widget-Collapse-header {\\n padding: var(--jp-widgets-input-padding);\\n cursor: pointer;\\n color: var(--jp-ui-font-color2);\\n background-color: var(--jp-layout-color2);\\n border: var(--jp-widgets-border-width) solid var(--jp-border-color1);\\n padding: calc(var(--jp-widgets-container-padding) * 2 / 3)\\n var(--jp-widgets-container-padding);\\n font-weight: bold;\\n}\\n\\n.jupyter-widget-Collapse-header:hover {\\n background-color: var(--jp-layout-color1);\\n color: var(--jp-ui-font-color1);\\n}\\n\\n.jupyter-widget-Collapse-open > .jupyter-widget-Collapse-header {\\n background-color: var(--jp-layout-color1);\\n color: var(--jp-ui-font-color0);\\n cursor: default;\\n border-bottom: none;\\n}\\n\\n.jupyter-widget-Collapse-contents {\\n padding: var(--jp-widgets-container-padding);\\n background-color: var(--jp-layout-color1);\\n color: var(--jp-ui-font-color1);\\n border-left: var(--jp-widgets-border-width) solid var(--jp-border-color1);\\n border-right: var(--jp-widgets-border-width) solid var(--jp-border-color1);\\n border-bottom: var(--jp-widgets-border-width) solid var(--jp-border-color1);\\n overflow: auto;\\n}\\n\\n.jupyter-widget-Accordion {\\n display: flex;\\n flex-direction: column;\\n align-items: stretch;\\n}\\n\\n.jupyter-widget-Accordion .jupyter-widget-Collapse {\\n margin-bottom: 0;\\n}\\n\\n.jupyter-widget-Accordion .jupyter-widget-Collapse + .jupyter-widget-Collapse {\\n margin-top: 4px;\\n}\\n\\n/* HTML widget */\\n\\n/* */\\n.widget-html, /* */\\n/* */ .widget-htmlmath, /* */\\n.jupyter-widget-html,\\n.jupyter-widget-htmlmath {\\n font-size: var(--jp-widgets-font-size);\\n}\\n\\n/* */\\n.widget-html > .widget-html-content, /* */\\n/* */.widget-htmlmath > .widget-html-content, /* */\\n.jupyter-widget-html > .jupyter-widget-html-content,\\n.jupyter-widget-htmlmath > .jupyter-widget-html-content {\\n /* Fill out the area in the HTML widget */\\n align-self: stretch;\\n flex-grow: 1;\\n flex-shrink: 1;\\n /* Makes sure the baseline is still aligned with other elements */\\n line-height: var(--jp-widgets-inline-height);\\n /* Make it possible to have absolutely-positioned elements in the html */\\n position: relative;\\n}\\n\\n/* Image widget */\\n\\n/* */\\n.widget-image, /* */\\n.jupyter-widget-image {\\n max-width: 100%;\\n height: auto;\\n}\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./../../node_modules/@jupyter-widgets/controls/css/widgets-base.css\"],\"names\":[],\"mappings\":\"AAAA;;EAEE;;AAEF;;;;EAIE;;AAKF;EACE,iDAAiD;EACjD,iDAAiD;EACjD,mDAAmD;EACnD,+CAA+C;EAC/C,wBAAwB;EACxB,gCAAgC;EAChC,gCAAgC;EAChC;;GAEC;EACD;;GAEC;EACD,+BAA+B,EAAE,mCAAmC;EACpE,qCAAqC;EACrC,iDAAiD;EACjD,mCAAmC;EACnC,wCAAwC;EACxC,wCAAwC;EACxC,2CAA2C;EAC3C,qCAAqC;EACrC,oCAAoC;EACpC,+BAA+B;EAC/B,8CAA8C;EAC9C;;;GAGC;EACD,wCAAwC;EACxC,gEAAgE;EAChE,qCAAqC;EACrC,gEAAgE;EAChE,oEAAoE;EACpE,+DAA+D;EAC/D,mCAAmC;EACnC,4uBAA4uB;EAC5uB,kDAAkD;EAClD,4DAA4D;EAC5D,wDAAwD;EACxD,6DAA6D;EAC7D,+DAA+D;EAC/D,kCAAkC;;EAElC,8BAA8B;EAC9B,kCAAkC;EAClC,sCAAsC;EACtC,wCAAwC;AAC1C;;AAEA;EACE,gCAAgC;EAChC,sBAAsB;EACtB,8BAA8B;EAC9B,iBAAiB;AACnB;;AAEA;EACE,cAAc;EACd,eAAe;AACjB;;AAEA,kBAAkB;;AAElB,iBAAiB;AACjB;;EAEE,uBAAuB;EACvB,sBAAsB;EACtB,aAAa;EACb,mBAAmB;EACnB,qBAAqB;AACvB;;AAEA,iBAAiB;AACjB;;EAEE,qBAAqB;EACrB,sBAAsB;EACtB,aAAa;EACb,sBAAsB;EACtB,mBAAmB;AACrB;;AAEA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C;;AAEA,iBAAiB;AACjB;;;EAGE,cAAc;AAChB;;AAEA,iBAAiB;AACjB;;;;;;;;;;;;EAYE,mCAAmC;EACnC,+BAA+B;AACjC;;AAEA,iBAAiB;AACjB;;;;;;;;;;;;;;;EAeE,gBAAgB;AAClB;;AAEA;6DAC6D;AAC7D,iBAAiB;AACjB;;;;;;;;;;;;;;;EAeE,wBAAwB;EACxB,gBAAgB,EAAE,UAAU;AAC9B;;AAEA,iBAAiB;AACjB;;;;;;;;;EASE,oDAAoD;AACtD;;AAEA,qBAAqB;;AAErB;EACE,aAAa;EACb,sBAAsB;EACtB,oBAAoB;AACtB;;AAEA;EACE,wCAAwC;EACxC,eAAe;EACf,+BAA+B;EAC/B,yCAAyC;EACzC,oEAAoE;EACpE;uCACqC;EACrC,iBAAiB;AACnB;;AAEA;EACE,yCAAyC;EACzC,+BAA+B;AACjC;;AAEA;EACE,yCAAyC;EACzC,+BAA+B;EAC/B,eAAe;EACf,mBAAmB;AACrB;;AAEA;EACE,4CAA4C;EAC5C,yCAAyC;EACzC,+BAA+B;EAC/B,yEAAyE;EACzE,0EAA0E;EAC1E,2EAA2E;EAC3E,cAAc;AAChB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,oBAAoB;AACtB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,eAAe;AACjB;;AAEA,gBAAgB;;AAEhB,iBAAiB;AACjB;;;;EAIE,sCAAsC;AACxC;;AAEA,iBAAiB;AACjB;;;;EAIE,yCAAyC;EACzC,mBAAmB;EACnB,YAAY;EACZ,cAAc;EACd,iEAAiE;EACjE,4CAA4C;EAC5C,wEAAwE;EACxE,kBAAkB;AACpB;;AAEA,kBAAkB;;AAElB,iBAAiB;AACjB;;EAEE,eAAe;EACf,YAAY;AACd\",\"sourcesContent\":[\"/* Copyright (c) Jupyter Development Team.\\n * Distributed under the terms of the Modified BSD License.\\n */\\n\\n/*\\n * We assume that the CSS variables in\\n * https://github.com/jupyterlab/jupyterlab/blob/master/src/default-theme/variables.css\\n * have been defined.\\n */\\n\\n@import './lumino.css';\\n@import './nouislider.css';\\n\\n:root {\\n --jp-widgets-color: var(--jp-content-font-color1);\\n --jp-widgets-label-color: var(--jp-widgets-color);\\n --jp-widgets-readout-color: var(--jp-widgets-color);\\n --jp-widgets-font-size: var(--jp-ui-font-size1);\\n --jp-widgets-margin: 2px;\\n --jp-widgets-inline-height: 28px;\\n --jp-widgets-inline-width: 300px;\\n --jp-widgets-inline-width-short: calc(\\n var(--jp-widgets-inline-width) / 2 - var(--jp-widgets-margin)\\n );\\n --jp-widgets-inline-width-tiny: calc(\\n var(--jp-widgets-inline-width-short) / 2 - var(--jp-widgets-margin)\\n );\\n --jp-widgets-inline-margin: 4px; /* margin between inline elements */\\n --jp-widgets-inline-label-width: 80px;\\n --jp-widgets-border-width: var(--jp-border-width);\\n --jp-widgets-vertical-height: 200px;\\n --jp-widgets-horizontal-tab-height: 24px;\\n --jp-widgets-horizontal-tab-width: 144px;\\n --jp-widgets-horizontal-tab-top-border: 2px;\\n --jp-widgets-progress-thickness: 20px;\\n --jp-widgets-container-padding: 15px;\\n --jp-widgets-input-padding: 4px;\\n --jp-widgets-radio-item-height-adjustment: 8px;\\n --jp-widgets-radio-item-height: calc(\\n var(--jp-widgets-inline-height) -\\n var(--jp-widgets-radio-item-height-adjustment)\\n );\\n --jp-widgets-slider-track-thickness: 4px;\\n --jp-widgets-slider-border-width: var(--jp-widgets-border-width);\\n --jp-widgets-slider-handle-size: 16px;\\n --jp-widgets-slider-handle-border-color: var(--jp-border-color1);\\n --jp-widgets-slider-handle-background-color: var(--jp-layout-color1);\\n --jp-widgets-slider-active-handle-color: var(--jp-brand-color1);\\n --jp-widgets-menu-item-height: 24px;\\n --jp-widgets-dropdown-arrow: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxOCAxOCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTggMTg7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDpub25lO30KPC9zdHlsZT4KPHBhdGggZD0iTTUuMiw1LjlMOSw5LjdsMy44LTMuOGwxLjIsMS4ybC00LjksNWwtNC45LTVMNS4yLDUuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTAtMC42aDE4djE4SDBWLTAuNnoiLz4KPC9zdmc+Cg');\\n --jp-widgets-input-color: var(--jp-ui-font-color1);\\n --jp-widgets-input-background-color: var(--jp-layout-color1);\\n --jp-widgets-input-border-color: var(--jp-border-color1);\\n --jp-widgets-input-focus-border-color: var(--jp-brand-color2);\\n --jp-widgets-input-border-width: var(--jp-widgets-border-width);\\n --jp-widgets-disabled-opacity: 0.6;\\n\\n /* From Material Design Lite */\\n --md-shadow-key-umbra-opacity: 0.2;\\n --md-shadow-key-penumbra-opacity: 0.14;\\n --md-shadow-ambient-shadow-opacity: 0.12;\\n}\\n\\n.jupyter-widgets {\\n margin: var(--jp-widgets-margin);\\n box-sizing: border-box;\\n color: var(--jp-widgets-color);\\n overflow: visible;\\n}\\n\\n.jp-Output-result > .jupyter-widgets {\\n margin-left: 0;\\n margin-right: 0;\\n}\\n\\n/* vbox and hbox */\\n\\n/* */\\n.widget-inline-hbox, /* */\\n .jupyter-widget-inline-hbox {\\n /* Horizontal widgets */\\n box-sizing: border-box;\\n display: flex;\\n flex-direction: row;\\n align-items: baseline;\\n}\\n\\n/* */\\n.widget-inline-vbox, /* */\\n .jupyter-widget-inline-vbox {\\n /* Vertical Widgets */\\n box-sizing: border-box;\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n}\\n\\n/* */\\n.widget-box, /* */\\n.jupyter-widget-box {\\n box-sizing: border-box;\\n display: flex;\\n margin: 0;\\n overflow: auto;\\n}\\n\\n/* */\\n.widget-gridbox, /* */\\n.jupyter-widget-gridbox {\\n box-sizing: border-box;\\n display: grid;\\n margin: 0;\\n overflow: auto;\\n}\\n\\n/* */\\n.widget-hbox, /* */\\n.jupyter-widget-hbox {\\n flex-direction: row;\\n}\\n\\n/* */\\n.widget-vbox, /* */\\n.jupyter-widget-vbox {\\n flex-direction: column;\\n}\\n\\n/* General Tags Styling */\\n\\n.jupyter-widget-tagsinput {\\n display: flex;\\n flex-direction: row;\\n flex-wrap: wrap;\\n align-items: center;\\n overflow: auto;\\n\\n cursor: text;\\n}\\n\\n.jupyter-widget-tag {\\n padding-left: 10px;\\n padding-right: 10px;\\n padding-top: 0px;\\n padding-bottom: 0px;\\n display: inline-block;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n text-align: center;\\n font-size: var(--jp-widgets-font-size);\\n\\n height: calc(var(--jp-widgets-inline-height) - 2px);\\n border: 0px solid;\\n line-height: calc(var(--jp-widgets-inline-height) - 2px);\\n box-shadow: none;\\n\\n color: var(--jp-ui-font-color1);\\n background-color: var(--jp-layout-color2);\\n border-color: var(--jp-border-color2);\\n border: none;\\n user-select: none;\\n\\n cursor: grab;\\n transition: margin-left 200ms;\\n margin: 1px 1px 1px 1px;\\n}\\n\\n.jupyter-widget-tag.mod-active {\\n /* MD Lite 4dp shadow */\\n box-shadow: 0 4px 5px 0 rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)),\\n 0 1px 10px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity)),\\n 0 2px 4px -1px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity));\\n color: var(--jp-ui-font-color1);\\n background-color: var(--jp-layout-color3);\\n}\\n\\n.jupyter-widget-colortag {\\n color: var(--jp-inverse-ui-font-color1);\\n}\\n\\n.jupyter-widget-colortag.mod-active {\\n color: var(--jp-inverse-ui-font-color0);\\n}\\n\\n.jupyter-widget-taginput {\\n color: var(--jp-ui-font-color0);\\n background-color: var(--jp-layout-color0);\\n\\n cursor: text;\\n text-align: left;\\n}\\n\\n.jupyter-widget-taginput:focus {\\n outline: none;\\n}\\n\\n.jupyter-widget-tag-close {\\n margin-left: var(--jp-widgets-inline-margin);\\n padding: 2px 0px 2px 2px;\\n}\\n\\n.jupyter-widget-tag-close:hover {\\n cursor: pointer;\\n}\\n\\n/* Tag \\\"Primary\\\" Styling */\\n\\n.jupyter-widget-tag.mod-primary {\\n color: var(--jp-inverse-ui-font-color1);\\n background-color: var(--jp-brand-color1);\\n}\\n\\n.jupyter-widget-tag.mod-primary.mod-active {\\n color: var(--jp-inverse-ui-font-color0);\\n background-color: var(--jp-brand-color0);\\n}\\n\\n/* Tag \\\"Success\\\" Styling */\\n\\n.jupyter-widget-tag.mod-success {\\n color: var(--jp-inverse-ui-font-color1);\\n background-color: var(--jp-success-color1);\\n}\\n\\n.jupyter-widget-tag.mod-success.mod-active {\\n color: var(--jp-inverse-ui-font-color0);\\n background-color: var(--jp-success-color0);\\n}\\n\\n/* Tag \\\"Info\\\" Styling */\\n\\n.jupyter-widget-tag.mod-info {\\n color: var(--jp-inverse-ui-font-color1);\\n background-color: var(--jp-info-color1);\\n}\\n\\n.jupyter-widget-tag.mod-info.mod-active {\\n color: var(--jp-inverse-ui-font-color0);\\n background-color: var(--jp-info-color0);\\n}\\n\\n/* Tag \\\"Warning\\\" Styling */\\n\\n.jupyter-widget-tag.mod-warning {\\n color: var(--jp-inverse-ui-font-color1);\\n background-color: var(--jp-warn-color1);\\n}\\n\\n.jupyter-widget-tag.mod-warning.mod-active {\\n color: var(--jp-inverse-ui-font-color0);\\n background-color: var(--jp-warn-color0);\\n}\\n\\n/* Tag \\\"Danger\\\" Styling */\\n\\n.jupyter-widget-tag.mod-danger {\\n color: var(--jp-inverse-ui-font-color1);\\n background-color: var(--jp-error-color1);\\n}\\n\\n.jupyter-widget-tag.mod-danger.mod-active {\\n color: var(--jp-inverse-ui-font-color0);\\n background-color: var(--jp-error-color0);\\n}\\n\\n/* General Button Styling */\\n\\n.jupyter-button {\\n padding-left: 10px;\\n padding-right: 10px;\\n padding-top: 0px;\\n padding-bottom: 0px;\\n display: inline-block;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n text-align: center;\\n font-size: var(--jp-widgets-font-size);\\n cursor: pointer;\\n\\n height: var(--jp-widgets-inline-height);\\n border: 0px solid;\\n line-height: var(--jp-widgets-inline-height);\\n box-shadow: none;\\n\\n color: var(--jp-ui-font-color1);\\n background-color: var(--jp-layout-color2);\\n border-color: var(--jp-border-color2);\\n border: none;\\n user-select: none;\\n}\\n\\n.jupyter-button i.fa {\\n margin-right: var(--jp-widgets-inline-margin);\\n pointer-events: none;\\n}\\n\\n.jupyter-button:empty:before {\\n content: '\\\\200b'; /* zero-width space */\\n}\\n\\n.jupyter-widgets.jupyter-button:disabled {\\n opacity: var(--jp-widgets-disabled-opacity);\\n}\\n\\n.jupyter-button i.fa.center {\\n margin-right: 0;\\n}\\n\\n.jupyter-button:hover:enabled,\\n.jupyter-button:focus:enabled {\\n /* MD Lite 2dp shadow */\\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)),\\n 0 3px 1px -2px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity)),\\n 0 1px 5px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity));\\n}\\n\\n.jupyter-button:active,\\n.jupyter-button.mod-active {\\n /* MD Lite 4dp shadow */\\n box-shadow: 0 4px 5px 0 rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)),\\n 0 1px 10px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity)),\\n 0 2px 4px -1px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity));\\n color: var(--jp-ui-font-color1);\\n background-color: var(--jp-layout-color3);\\n}\\n\\n.jupyter-button:focus:enabled {\\n outline: 1px solid var(--jp-widgets-input-focus-border-color);\\n}\\n\\n/* Button \\\"Primary\\\" Styling */\\n\\n.jupyter-button.mod-primary {\\n color: var(--jp-ui-inverse-font-color1);\\n background-color: var(--jp-brand-color1);\\n}\\n\\n.jupyter-button.mod-primary.mod-active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-brand-color0);\\n}\\n\\n.jupyter-button.mod-primary:active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-brand-color0);\\n}\\n\\n/* Button \\\"Success\\\" Styling */\\n\\n.jupyter-button.mod-success {\\n color: var(--jp-ui-inverse-font-color1);\\n background-color: var(--jp-success-color1);\\n}\\n\\n.jupyter-button.mod-success.mod-active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-success-color0);\\n}\\n\\n.jupyter-button.mod-success:active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-success-color0);\\n}\\n\\n/* Button \\\"Info\\\" Styling */\\n\\n.jupyter-button.mod-info {\\n color: var(--jp-ui-inverse-font-color1);\\n background-color: var(--jp-info-color1);\\n}\\n\\n.jupyter-button.mod-info.mod-active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-info-color0);\\n}\\n\\n.jupyter-button.mod-info:active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-info-color0);\\n}\\n\\n/* Button \\\"Warning\\\" Styling */\\n\\n.jupyter-button.mod-warning {\\n color: var(--jp-ui-inverse-font-color1);\\n background-color: var(--jp-warn-color1);\\n}\\n\\n.jupyter-button.mod-warning.mod-active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-warn-color0);\\n}\\n\\n.jupyter-button.mod-warning:active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-warn-color0);\\n}\\n\\n/* Button \\\"Danger\\\" Styling */\\n\\n.jupyter-button.mod-danger {\\n color: var(--jp-ui-inverse-font-color1);\\n background-color: var(--jp-error-color1);\\n}\\n\\n.jupyter-button.mod-danger.mod-active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-error-color0);\\n}\\n\\n.jupyter-button.mod-danger:active {\\n color: var(--jp-ui-inverse-font-color0);\\n background-color: var(--jp-error-color0);\\n}\\n\\n/* Widget Button, Widget Toggle Button, Widget Upload */\\n\\n/* */\\n.widget-button, /* */\\n/* */ .widget-toggle-button, /* */\\n/* */ .widget-upload, /* */\\n.jupyter-widget-button,\\n.jupyter-widget-toggle-button,\\n.jupyter-widget-upload {\\n width: var(--jp-widgets-inline-width-short);\\n}\\n\\n/* Widget Label Styling */\\n\\n/* Override Bootstrap label css */\\n.jupyter-widgets label {\\n margin-bottom: initial;\\n}\\n\\n/* */\\n.widget-label-basic, /* */\\n.jupyter-widget-label-basic {\\n /* Basic Label */\\n color: var(--jp-widgets-label-color);\\n font-size: var(--jp-widgets-font-size);\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-label, /* */\\n.jupyter-widget-label {\\n /* Label */\\n color: var(--jp-widgets-label-color);\\n font-size: var(--jp-widgets-font-size);\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-inline-hbox .widget-label, /* */\\n.jupyter-widget-inline-hbox .jupyter-widget-label {\\n /* Horizontal Widget Label */\\n color: var(--jp-widgets-label-color);\\n text-align: right;\\n margin-right: calc(var(--jp-widgets-inline-margin) * 2);\\n width: var(--jp-widgets-inline-label-width);\\n flex-shrink: 0;\\n}\\n\\n/* */\\n.widget-inline-vbox .widget-label, /* */\\n.jupyter-widget-inline-vbox .jupyter-widget-label {\\n /* Vertical Widget Label */\\n color: var(--jp-widgets-label-color);\\n text-align: center;\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* Widget Readout Styling */\\n\\n/* */\\n.widget-readout, /* */\\n.jupyter-widget-readout {\\n color: var(--jp-widgets-readout-color);\\n font-size: var(--jp-widgets-font-size);\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n overflow: hidden;\\n white-space: nowrap;\\n text-align: center;\\n}\\n\\n/* */\\n.widget-readout.overflow, /* */\\n.jupyter-widget-readout.overflow {\\n /* Overflowing Readout */\\n\\n /* From Material Design Lite\\n shadow-key-umbra-opacity: 0.2;\\n shadow-key-penumbra-opacity: 0.14;\\n shadow-ambient-shadow-opacity: 0.12;\\n */\\n -webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2),\\n 0 3px 1px -2px rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);\\n\\n -moz-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2),\\n 0 3px 1px -2px rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);\\n\\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 1px -2px rgba(0, 0, 0, 0.14),\\n 0 1px 5px 0 rgba(0, 0, 0, 0.12);\\n}\\n\\n/* */\\n.widget-inline-hbox .widget-readout, /* */\\n.jupyter-widget-inline-hbox .jupyter-widget-readout {\\n /* Horizontal Readout */\\n text-align: center;\\n max-width: var(--jp-widgets-inline-width-short);\\n min-width: var(--jp-widgets-inline-width-tiny);\\n margin-left: var(--jp-widgets-inline-margin);\\n}\\n\\n/* */\\n.widget-inline-vbox .widget-readout, /* */\\n.jupyter-widget-inline-vbox .jupyter-widget-readout {\\n /* Vertical Readout */\\n margin-top: var(--jp-widgets-inline-margin);\\n /* as wide as the widget */\\n width: inherit;\\n}\\n\\n/* Widget Checkbox Styling */\\n\\n/* */\\n.widget-checkbox, /* */\\n.jupyter-widget-checkbox {\\n width: var(--jp-widgets-inline-width);\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-checkbox input[type='checkbox'], /* */\\n.jupyter-widget-checkbox input[type='checkbox'] {\\n margin: 0px calc(var(--jp-widgets-inline-margin) * 2) 0px 0px;\\n line-height: var(--jp-widgets-inline-height);\\n font-size: large;\\n flex-grow: 1;\\n flex-shrink: 0;\\n align-self: center;\\n}\\n\\n/* Widget Valid Styling */\\n\\n/* */\\n.widget-valid, /* */\\n.jupyter-widget-valid {\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n width: var(--jp-widgets-inline-width-short);\\n font-size: var(--jp-widgets-font-size);\\n}\\n\\n/* */\\n.widget-valid i, /* */\\n.jupyter-widget-valid i {\\n line-height: var(--jp-widgets-inline-height);\\n margin-right: var(--jp-widgets-inline-margin);\\n margin-left: var(--jp-widgets-inline-margin);\\n}\\n\\n/* */\\n.widget-valid.mod-valid i, /* */\\n.jupyter-widget-valid.mod-valid i {\\n color: green;\\n}\\n\\n/* */\\n.widget-valid.mod-invalid i, /* */\\n.jupyter-widget-valid.mod-invalid i {\\n color: red;\\n}\\n\\n/* */\\n.widget-valid.mod-valid .widget-valid-readout, /* */\\n.jupyter-widget-valid.mod-valid .jupyter-widget-valid-readout {\\n display: none;\\n}\\n\\n/* Widget Text and TextArea Styling */\\n\\n/* */\\n.widget-textarea, /* */\\n/* */ .widget-text, /* */\\n.jupyter-widget-textarea,\\n.jupyter-widget-text {\\n width: var(--jp-widgets-inline-width);\\n}\\n\\n/* */\\n.widget-text input[type='text'], /* */\\n/* */ .widget-text input[type='number'], /* */\\n/* */ .widget-text input[type='password'], /* */\\n.jupyter-widget-text input[type='text'],\\n.jupyter-widget-text input[type='number'],\\n.jupyter-widget-text input[type='password'] {\\n height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-text input[type='text']:disabled, /* */\\n/* */ .widget-text input[type='number']:disabled, /* */\\n/* */ .widget-text input[type='password']:disabled, /* */\\n/* */ .widget-textarea textarea:disabled, /* */\\n.jupyter-widget-text input[type='text']:disabled,\\n.jupyter-widget-text input[type='number']:disabled,\\n.jupyter-widget-text input[type='password']:disabled,\\n.jupyter-widget-textarea textarea:disabled {\\n opacity: var(--jp-widgets-disabled-opacity);\\n}\\n\\n/* */\\n.widget-text input[type='text'], /* */\\n/* */ .widget-text input[type='number'], /* */\\n/* */ .widget-text input[type='password'], /* */\\n/* */ .widget-textarea textarea, /* */\\n.jupyter-widget-text input[type='text'],\\n.jupyter-widget-text input[type='number'],\\n.jupyter-widget-text input[type='password'],\\n.jupyter-widget-textarea textarea {\\n box-sizing: border-box;\\n border: var(--jp-widgets-input-border-width) solid\\n var(--jp-widgets-input-border-color);\\n background-color: var(--jp-widgets-input-background-color);\\n color: var(--jp-widgets-input-color);\\n font-size: var(--jp-widgets-font-size);\\n flex-grow: 1;\\n min-width: 0; /* This makes it possible for the flexbox to shrink this input */\\n flex-shrink: 1;\\n outline: none !important;\\n}\\n\\n/* */\\n.widget-text input[type='text'], /* */\\n/* */ .widget-text input[type='password'], /* */\\n/* */ .widget-textarea textarea, /* */\\n.jupyter-widget-text input[type='text'],\\n.jupyter-widget-text input[type='password'],\\n.jupyter-widget-textarea textarea {\\n padding: var(--jp-widgets-input-padding)\\n calc(var(--jp-widgets-input-padding) * 2);\\n}\\n\\n/* */\\n.widget-text input[type='number'], /* */\\n.jupyter-widget-text input[type='number'] {\\n padding: var(--jp-widgets-input-padding) 0 var(--jp-widgets-input-padding)\\n calc(var(--jp-widgets-input-padding) * 2);\\n}\\n\\n/* */\\n.widget-textarea textarea, /* */\\n.jupyter-widget-textarea textarea {\\n height: inherit;\\n width: inherit;\\n}\\n\\n/* */\\n.widget-text input:focus, /* */\\n/* */ .widget-textarea textarea:focus, /* */\\n.jupyter-widget-text input:focus,\\n.jupyter-widget-textarea textarea:focus {\\n border-color: var(--jp-widgets-input-focus-border-color);\\n}\\n\\n/* Horizontal Slider */\\n/* */\\n.widget-hslider, /* */\\n.jupyter-widget-hslider {\\n width: var(--jp-widgets-inline-width);\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n\\n /* Override the align-items baseline. This way, the description and readout\\n still seem to align their baseline properly, and we don't have to have\\n align-self: stretch in the .slider-container. */\\n align-items: center;\\n}\\n\\n/* */\\n.widgets-slider .slider-container, /* */\\n.jupyter-widgets-slider .slider-container {\\n overflow: visible;\\n}\\n\\n/* */\\n.widget-hslider .slider-container, /* */\\n.jupyter-widget-hslider .slider-container {\\n margin-left: calc(\\n var(--jp-widgets-slider-handle-size) / 2 - 2 *\\n var(--jp-widgets-slider-border-width)\\n );\\n margin-right: calc(\\n var(--jp-widgets-slider-handle-size) / 2 - 2 *\\n var(--jp-widgets-slider-border-width)\\n );\\n flex: 1 1 var(--jp-widgets-inline-width-short);\\n}\\n\\n/* Vertical Slider */\\n\\n/* */\\n.widget-vbox .widget-label, /* */\\n.jupyter-widget-vbox .jupyter-widget-label {\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-vslider, /* */\\n.jupyter-widget-vslider {\\n /* Vertical Slider */\\n height: var(--jp-widgets-vertical-height);\\n width: var(--jp-widgets-inline-width-tiny);\\n}\\n\\n/* */\\n.widget-vslider .slider-container, /* */\\n.jupyter-widget-vslider .slider-container {\\n flex: 1 1 var(--jp-widgets-inline-width-short);\\n margin-left: auto;\\n margin-right: auto;\\n margin-bottom: calc(\\n var(--jp-widgets-slider-handle-size) / 2 - 2 *\\n var(--jp-widgets-slider-border-width)\\n );\\n margin-top: calc(\\n var(--jp-widgets-slider-handle-size) / 2 - 2 *\\n var(--jp-widgets-slider-border-width)\\n );\\n display: flex;\\n flex-direction: column;\\n}\\n\\n/* Widget Progress Styling */\\n\\n.progress-bar {\\n -webkit-transition: none;\\n -moz-transition: none;\\n -ms-transition: none;\\n -o-transition: none;\\n transition: none;\\n}\\n\\n.progress-bar {\\n height: var(--jp-widgets-inline-height);\\n}\\n\\n.progress-bar {\\n background-color: var(--jp-brand-color1);\\n}\\n\\n.progress-bar-success {\\n background-color: var(--jp-success-color1);\\n}\\n\\n.progress-bar-info {\\n background-color: var(--jp-info-color1);\\n}\\n\\n.progress-bar-warning {\\n background-color: var(--jp-warn-color1);\\n}\\n\\n.progress-bar-danger {\\n background-color: var(--jp-error-color1);\\n}\\n\\n.progress {\\n background-color: var(--jp-layout-color2);\\n border: none;\\n box-shadow: none;\\n}\\n\\n/* Horisontal Progress */\\n\\n/* */\\n.widget-hprogress, /* */\\n.jupyter-widget-hprogress {\\n /* Progress Bar */\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n width: var(--jp-widgets-inline-width);\\n align-items: center;\\n}\\n\\n/* */\\n.widget-hprogress .progress, /* */\\n.jupyter-widget-hprogress .progress {\\n flex-grow: 1;\\n margin-top: var(--jp-widgets-input-padding);\\n margin-bottom: var(--jp-widgets-input-padding);\\n align-self: stretch;\\n /* Override bootstrap style */\\n height: initial;\\n}\\n\\n/* Vertical Progress */\\n\\n/* */\\n.widget-vprogress, /* */\\n.jupyter-widget-vprogress {\\n height: var(--jp-widgets-vertical-height);\\n width: var(--jp-widgets-inline-width-tiny);\\n}\\n\\n/* */\\n.widget-vprogress .progress, /* */\\n.jupyter-widget-vprogress .progress {\\n flex-grow: 1;\\n width: var(--jp-widgets-progress-thickness);\\n margin-left: auto;\\n margin-right: auto;\\n margin-bottom: 0;\\n}\\n\\n/* Select Widget Styling */\\n\\n/* */\\n.widget-dropdown, /* */\\n.jupyter-widget-dropdown {\\n height: var(--jp-widgets-inline-height);\\n width: var(--jp-widgets-inline-width);\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-dropdown > select, /* */\\n.jupyter-widget-dropdown > select {\\n padding-right: 20px;\\n border: var(--jp-widgets-input-border-width) solid\\n var(--jp-widgets-input-border-color);\\n border-radius: 0;\\n height: inherit;\\n flex: 1 1 var(--jp-widgets-inline-width-short);\\n min-width: 0; /* This makes it possible for the flexbox to shrink this input */\\n box-sizing: border-box;\\n outline: none !important;\\n box-shadow: none;\\n background-color: var(--jp-widgets-input-background-color);\\n color: var(--jp-widgets-input-color);\\n font-size: var(--jp-widgets-font-size);\\n vertical-align: top;\\n padding-left: calc(var(--jp-widgets-input-padding) * 2);\\n appearance: none;\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n background-repeat: no-repeat;\\n background-size: 20px;\\n background-position: right center;\\n background-image: var(--jp-widgets-dropdown-arrow);\\n}\\n/* */\\n.widget-dropdown > select:focus, /* */\\n.jupyter-widget-dropdown > select:focus {\\n border-color: var(--jp-widgets-input-focus-border-color);\\n}\\n\\n/* */\\n.widget-dropdown > select:disabled, /* */\\n.jupyter-widget-dropdown > select:disabled {\\n opacity: var(--jp-widgets-disabled-opacity);\\n}\\n\\n/* To disable the dotted border in Firefox around select controls.\\n See http://stackoverflow.com/a/18853002 */\\n/* */\\n.widget-dropdown > select:-moz-focusring, /* */\\n.jupyter-widget-dropdown > select:-moz-focusring {\\n color: transparent;\\n text-shadow: 0 0 0 #000;\\n}\\n\\n/* Select and SelectMultiple */\\n\\n/* */\\n.widget-select, /* */\\n.jupyter-widget-select {\\n width: var(--jp-widgets-inline-width);\\n line-height: var(--jp-widgets-inline-height);\\n\\n /* Because Firefox defines the baseline of a select as the bottom of the\\n control, we align the entire control to the top and add padding to the\\n select to get an approximate first line baseline alignment. */\\n align-items: flex-start;\\n}\\n\\n/* */\\n.widget-select > select, /* */\\n.jupyter-widget-select > select {\\n border: var(--jp-widgets-input-border-width) solid\\n var(--jp-widgets-input-border-color);\\n background-color: var(--jp-widgets-input-background-color);\\n color: var(--jp-widgets-input-color);\\n font-size: var(--jp-widgets-font-size);\\n flex: 1 1 var(--jp-widgets-inline-width-short);\\n outline: none !important;\\n overflow: auto;\\n height: inherit;\\n\\n /* Because Firefox defines the baseline of a select as the bottom of the\\n control, we align the entire control to the top and add padding to the\\n select to get an approximate first line baseline alignment. */\\n padding-top: 5px;\\n}\\n\\n/* */\\n.widget-select > select:focus, /* */\\n.jupyter-widget-select > select:focus {\\n border-color: var(--jp-widgets-input-focus-border-color);\\n}\\n\\n.wiget-select > select > option,\\n.jupyter-wiget-select > select > option {\\n padding-left: var(--jp-widgets-input-padding);\\n line-height: var(--jp-widgets-inline-height);\\n /* line-height doesn't work on some browsers for select options */\\n padding-top: calc(\\n var(--jp-widgets-inline-height) - var(--jp-widgets-font-size) / 2\\n );\\n padding-bottom: calc(\\n var(--jp-widgets-inline-height) - var(--jp-widgets-font-size) / 2\\n );\\n}\\n\\n/* Toggle Buttons Styling */\\n\\n/* */\\n.widget-toggle-buttons, /* */\\n.jupyter-widget-toggle-buttons {\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-toggle-buttons .widget-toggle-button, /* */\\n.jupyter-widget-toggle-buttons .jupyter-widget-toggle-button {\\n margin-left: var(--jp-widgets-margin);\\n margin-right: var(--jp-widgets-margin);\\n}\\n\\n/* */\\n.widget-toggle-buttons .jupyter-button:disabled, /* */\\n.jupyter-widget-toggle-buttons .jupyter-button:disabled {\\n opacity: var(--jp-widgets-disabled-opacity);\\n}\\n\\n/* Radio Buttons Styling */\\n\\n/* */\\n.widget-radio, /* */\\n.jupyter-widget-radio {\\n width: var(--jp-widgets-inline-width);\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-radio-box, /* */\\n.jupyter-widget-radio-box {\\n display: flex;\\n flex-direction: column;\\n align-items: stretch;\\n box-sizing: border-box;\\n flex-grow: 1;\\n margin-bottom: var(--jp-widgets-radio-item-height-adjustment);\\n}\\n\\n/* */\\n.widget-radio-box-vertical, /* */\\n.jupyter-widget-radio-box-vertical {\\n flex-direction: column;\\n}\\n\\n/* */\\n.widget-radio-box-horizontal, /* */\\n.jupyter-widget-radio-box-horizontal {\\n flex-direction: row;\\n}\\n\\n/* */\\n.widget-radio-box label, /* */\\n.jupyter-widget-radio-box label {\\n height: var(--jp-widgets-radio-item-height);\\n line-height: var(--jp-widgets-radio-item-height);\\n font-size: var(--jp-widgets-font-size);\\n}\\n\\n.widget-radio-box-horizontal label,\\n.jupyter-widget-radio-box-horizontal label {\\n margin: 0 calc(var(--jp-widgets-input-padding) * 2) 0 0;\\n}\\n\\n/* */\\n.widget-radio-box input, /* */\\n.jupyter-widget-radio-box input {\\n height: var(--jp-widgets-radio-item-height);\\n line-height: var(--jp-widgets-radio-item-height);\\n margin: 0 calc(var(--jp-widgets-input-padding) * 2) 0 1px;\\n float: left;\\n}\\n\\n/* Color Picker Styling */\\n\\n/* */\\n.widget-colorpicker, /* */\\n.jupyter-widget-colorpicker {\\n width: var(--jp-widgets-inline-width);\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-colorpicker > .widget-colorpicker-input, /* */\\n.jupyter-widget-colorpicker > .jupyter-widget-colorpicker-input {\\n flex-grow: 1;\\n flex-shrink: 1;\\n min-width: var(--jp-widgets-inline-width-tiny);\\n}\\n\\n/* */\\n.widget-colorpicker input[type='color'], /* */\\n.jupyter-widget-colorpicker input[type='color'] {\\n width: var(--jp-widgets-inline-height);\\n height: var(--jp-widgets-inline-height);\\n padding: 0 2px; /* make the color square actually square on Chrome on OS X */\\n background: var(--jp-widgets-input-background-color);\\n color: var(--jp-widgets-input-color);\\n border: var(--jp-widgets-input-border-width) solid\\n var(--jp-widgets-input-border-color);\\n border-left: none;\\n flex-grow: 0;\\n flex-shrink: 0;\\n box-sizing: border-box;\\n align-self: stretch;\\n outline: none !important;\\n}\\n\\n/* */\\n.widget-colorpicker.concise input[type='color'], /* */\\n.jupyter-widget-colorpicker.concise input[type='color'] {\\n border-left: var(--jp-widgets-input-border-width) solid\\n var(--jp-widgets-input-border-color);\\n}\\n\\n/* */\\n.widget-colorpicker input[type='color']:focus, /* */\\n/* */ .widget-colorpicker input[type='text']:focus, /* */\\n.jupyter-widget-colorpicker input[type='color']:focus,\\n.jupyter-widget-colorpicker input[type='text']:focus {\\n border-color: var(--jp-widgets-input-focus-border-color);\\n}\\n\\n/* */\\n.widget-colorpicker input[type='text'], /* */\\n.jupyter-widget-colorpicker input[type='text'] {\\n flex-grow: 1;\\n outline: none !important;\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n background: var(--jp-widgets-input-background-color);\\n color: var(--jp-widgets-input-color);\\n border: var(--jp-widgets-input-border-width) solid\\n var(--jp-widgets-input-border-color);\\n font-size: var(--jp-widgets-font-size);\\n padding: var(--jp-widgets-input-padding)\\n calc(var(--jp-widgets-input-padding) * 2);\\n min-width: 0; /* This makes it possible for the flexbox to shrink this input */\\n flex-shrink: 1;\\n box-sizing: border-box;\\n}\\n\\n/* */\\n.widget-colorpicker input[type='text']:disabled, /* */\\n.jupyter-widget-colorpicker input[type='text']:disabled {\\n opacity: var(--jp-widgets-disabled-opacity);\\n}\\n\\n/* Date Picker Styling */\\n\\n/* */\\n.widget-datepicker, /* */\\n.jupyter-widget-datepicker {\\n width: var(--jp-widgets-inline-width);\\n height: var(--jp-widgets-inline-height);\\n line-height: var(--jp-widgets-inline-height);\\n}\\n\\n/* */\\n.widget-datepicker input[type='date'], /* */\\n.jupyter-widget-datepicker input[type='date'] {\\n flex-grow: 1;\\n flex-shrink: 1;\\n min-width: 0; /* This makes it possible for the flexbox to shrink this input */\\n outline: none !important;\\n height: var(--jp-widgets-inline-height);\\n border: var(--jp-widgets-input-border-width) solid\\n var(--jp-widgets-input-border-color);\\n background-color: var(--jp-widgets-input-background-color);\\n color: var(--jp-widgets-input-color);\\n font-size: var(--jp-widgets-font-size);\\n padding: var(--jp-widgets-input-padding)\\n calc(var(--jp-widgets-input-padding) * 2);\\n box-sizing: border-box;\\n}\\n\\n/* */\\n.widget-datepicker input[type='date']:focus, /* */\\n.jupyter-widget-datepicker input[type='date']:focus {\\n border-color: var(--jp-widgets-input-focus-border-color);\\n}\\n\\n/* */\\n.widget-datepicker input[type='date']:invalid, /* */\\n.jupyter-widget-datepicker input[type='date']:invalid {\\n border-color: var(--jp-warn-color1);\\n}\\n\\n/* */\\n.widget-datepicker input[type='date']:disabled, /* */\\n.jupyter-widget-datepicker input[type='date']:disabled {\\n opacity: var(--jp-widgets-disabled-opacity);\\n}\\n\\n/* Play Widget */\\n\\n/* */\\n.widget-play, /* */\\n.jupyter-widget-play {\\n width: var(--jp-widgets-inline-width-short);\\n display: flex;\\n align-items: stretch;\\n}\\n\\n/* */\\n.widget-play .jupyter-button, /* */\\n.jupyter-widget-play .jupyter-button {\\n flex-grow: 1;\\n height: auto;\\n}\\n\\n/* */\\n.widget-play .jupyter-button:disabled, /* */\\n.jupyter-widget-play .jupyter-button:disabled {\\n opacity: var(--jp-widgets-disabled-opacity);\\n}\\n\\n/* Tab Widget */\\n\\n/* */\\n.jupyter-widgets.widget-tab, /* */\\n.jupyter-widgets.jupyter-widget-tab {\\n display: flex;\\n flex-direction: column;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar {\\n /* Necessary so that a tab can be shifted down to overlay the border of the box below. */\\n overflow-x: visible;\\n overflow-y: visible;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar > .p-TabBar-content, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar > .p-TabBar-content, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar > .lm-TabBar-content {\\n /* Make sure that the tab grows from bottom up */\\n align-items: flex-end;\\n min-width: 0;\\n min-height: 0;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .widget-tab-contents, /* */\\n.jupyter-widgets.jupyter-widget-tab > .widget-tab-contents {\\n width: 100%;\\n box-sizing: border-box;\\n margin: 0;\\n background: var(--jp-layout-color1);\\n color: var(--jp-ui-font-color1);\\n border: var(--jp-border-width) solid var(--jp-border-color1);\\n padding: var(--jp-widgets-container-padding);\\n flex-grow: 1;\\n overflow: auto;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar {\\n font: var(--jp-widgets-font-size) Helvetica, Arial, sans-serif;\\n min-height: calc(\\n var(--jp-widgets-horizontal-tab-height) + var(--jp-border-width)\\n );\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab {\\n flex: 0 1 var(--jp-widgets-horizontal-tab-width);\\n min-width: 35px;\\n min-height: calc(\\n var(--jp-widgets-horizontal-tab-height) + var(--jp-border-width)\\n );\\n line-height: var(--jp-widgets-horizontal-tab-height);\\n margin-left: calc(-1 * var(--jp-border-width));\\n padding: 0px 10px;\\n background: var(--jp-layout-color2);\\n color: var(--jp-ui-font-color2);\\n border: var(--jp-border-width) solid var(--jp-border-color1);\\n border-bottom: none;\\n position: relative;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab.p-mod-current, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab.p-mod-current, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab.lm-mod-current {\\n color: var(--jp-ui-font-color0);\\n /* We want the background to match the tab content background */\\n background: var(--jp-layout-color1);\\n min-height: calc(\\n var(--jp-widgets-horizontal-tab-height) + 2 * var(--jp-border-width)\\n );\\n transform: translateY(var(--jp-border-width));\\n overflow: visible;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab.p-mod-current:before, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab.p-mod-current:before, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab.lm-mod-current:before {\\n position: absolute;\\n top: calc(-1 * var(--jp-border-width));\\n left: calc(-1 * var(--jp-border-width));\\n content: '';\\n height: var(--jp-widgets-horizontal-tab-top-border);\\n width: calc(100% + 2 * var(--jp-border-width));\\n background: var(--jp-brand-color1);\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab:first-child, /* */\\n/* */.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab:first-child, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab:first-child {\\n margin-left: 0;\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar\\n .p-TabBar-tab:hover:not(.p-mod-current),\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .p-TabBar\\n .p-TabBar-tab:hover:not(.p-mod-current),\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar\\n .lm-TabBar-tab:hover:not(.lm-mod-current) {\\n background: var(--jp-layout-color1);\\n color: var(--jp-ui-font-color1);\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar\\n .p-mod-closable\\n > .p-TabBar-tabCloseIcon,\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n> .p-TabBar\\n.p-mod-closable\\n> .p-TabBar-tabCloseIcon,\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar\\n .lm-mod-closable\\n > .lm-TabBar-tabCloseIcon {\\n margin-left: 4px;\\n}\\n\\n/* This font-awesome strategy may not work across FA4 and FA5, but we don't\\nactually support closable tabs, so it really doesn't matter */\\n/* */\\n.jupyter-widgets.widget-tab\\n > .p-TabBar\\n .p-mod-closable\\n > .p-TabBar-tabCloseIcon:before,\\n/* */\\n/* */\\n.jupyter-widgets.jupyter-widget-widget-tab\\n> .p-TabBar\\n.p-mod-closable\\n> .p-TabBar-tabCloseIcon:before,\\n/* */\\n.jupyter-widgets.jupyter-widget-tab\\n > .lm-TabBar\\n .lm-mod-closable\\n > .lm-TabBar-tabCloseIcon:before {\\n font-family: FontAwesome;\\n content: '\\\\f00d'; /* close */\\n}\\n\\n/* */\\n.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabIcon, /* */\\n/* */ .jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabLabel, /* */\\n/* */ .jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabCloseIcon, /* */\\n/* */ .jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabIcon, /* */\\n/* */ .jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabLabel, /* */\\n/* */ .jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabCloseIcon, /* */\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabIcon,\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabLabel,\\n.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabCloseIcon {\\n line-height: var(--jp-widgets-horizontal-tab-height);\\n}\\n\\n/* Accordion Widget */\\n\\n.jupyter-widget-Collapse {\\n display: flex;\\n flex-direction: column;\\n align-items: stretch;\\n}\\n\\n.jupyter-widget-Collapse-header {\\n padding: var(--jp-widgets-input-padding);\\n cursor: pointer;\\n color: var(--jp-ui-font-color2);\\n background-color: var(--jp-layout-color2);\\n border: var(--jp-widgets-border-width) solid var(--jp-border-color1);\\n padding: calc(var(--jp-widgets-container-padding) * 2 / 3)\\n var(--jp-widgets-container-padding);\\n font-weight: bold;\\n}\\n\\n.jupyter-widget-Collapse-header:hover {\\n background-color: var(--jp-layout-color1);\\n color: var(--jp-ui-font-color1);\\n}\\n\\n.jupyter-widget-Collapse-open > .jupyter-widget-Collapse-header {\\n background-color: var(--jp-layout-color1);\\n color: var(--jp-ui-font-color0);\\n cursor: default;\\n border-bottom: none;\\n}\\n\\n.jupyter-widget-Collapse-contents {\\n padding: var(--jp-widgets-container-padding);\\n background-color: var(--jp-layout-color1);\\n color: var(--jp-ui-font-color1);\\n border-left: var(--jp-widgets-border-width) solid var(--jp-border-color1);\\n border-right: var(--jp-widgets-border-width) solid var(--jp-border-color1);\\n border-bottom: var(--jp-widgets-border-width) solid var(--jp-border-color1);\\n overflow: auto;\\n}\\n\\n.jupyter-widget-Accordion {\\n display: flex;\\n flex-direction: column;\\n align-items: stretch;\\n}\\n\\n.jupyter-widget-Accordion .jupyter-widget-Collapse {\\n margin-bottom: 0;\\n}\\n\\n.jupyter-widget-Accordion .jupyter-widget-Collapse + .jupyter-widget-Collapse {\\n margin-top: 4px;\\n}\\n\\n/* HTML widget */\\n\\n/* */\\n.widget-html, /* */\\n/* */ .widget-htmlmath, /* */\\n.jupyter-widget-html,\\n.jupyter-widget-htmlmath {\\n font-size: var(--jp-widgets-font-size);\\n}\\n\\n/* */\\n.widget-html > .widget-html-content, /* */\\n/* */.widget-htmlmath > .widget-html-content, /* */\\n.jupyter-widget-html > .jupyter-widget-html-content,\\n.jupyter-widget-htmlmath > .jupyter-widget-html-content {\\n /* Fill out the area in the HTML widget */\\n align-self: stretch;\\n flex-grow: 1;\\n flex-shrink: 1;\\n /* Makes sure the baseline is still aligned with other elements */\\n line-height: var(--jp-widgets-inline-height);\\n /* Make it possible to have absolutely-positioned elements in the html */\\n position: relative;\\n}\\n\\n/* Image widget */\\n\\n/* */\\n.widget-image, /* */\\n.jupyter-widget-image {\\n max-width: 100%;\\n height: auto;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../packages/thebe/node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../packages/thebe/node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"/* BASICS */\\n\\n.CodeMirror {\\n /* Set height, width, borders, and global font properties here */\\n font-family: monospace;\\n height: 300px;\\n color: black;\\n direction: ltr;\\n}\\n\\n/* PADDING */\\n\\n.CodeMirror-lines {\\n padding: 4px 0; /* Vertical padding around content */\\n}\\n.CodeMirror pre.CodeMirror-line,\\n.CodeMirror pre.CodeMirror-line-like {\\n padding: 0 4px; /* Horizontal padding of content */\\n}\\n\\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\\n background-color: white; /* The little square between H and V scrollbars */\\n}\\n\\n/* GUTTER */\\n\\n.CodeMirror-gutters {\\n border-right: 1px solid #ddd;\\n background-color: #f7f7f7;\\n white-space: nowrap;\\n}\\n.CodeMirror-linenumbers {}\\n.CodeMirror-linenumber {\\n padding: 0 3px 0 5px;\\n min-width: 20px;\\n text-align: right;\\n color: #999;\\n white-space: nowrap;\\n}\\n\\n.CodeMirror-guttermarker { color: black; }\\n.CodeMirror-guttermarker-subtle { color: #999; }\\n\\n/* CURSOR */\\n\\n.CodeMirror-cursor {\\n border-left: 1px solid black;\\n border-right: none;\\n width: 0;\\n}\\n/* Shown when moving in bi-directional text */\\n.CodeMirror div.CodeMirror-secondarycursor {\\n border-left: 1px solid silver;\\n}\\n.cm-fat-cursor .CodeMirror-cursor {\\n width: auto;\\n border: 0 !important;\\n background: #7e7;\\n}\\n.cm-fat-cursor div.CodeMirror-cursors {\\n z-index: 1;\\n}\\n.cm-fat-cursor-mark {\\n background-color: rgba(20, 255, 20, 0.5);\\n -webkit-animation: blink 1.06s steps(1) infinite;\\n -moz-animation: blink 1.06s steps(1) infinite;\\n animation: blink 1.06s steps(1) infinite;\\n}\\n.cm-animate-fat-cursor {\\n width: auto;\\n border: 0;\\n -webkit-animation: blink 1.06s steps(1) infinite;\\n -moz-animation: blink 1.06s steps(1) infinite;\\n animation: blink 1.06s steps(1) infinite;\\n background-color: #7e7;\\n}\\n@-moz-keyframes blink {\\n 0% {}\\n 50% { background-color: transparent; }\\n 100% {}\\n}\\n@-webkit-keyframes blink {\\n 0% {}\\n 50% { background-color: transparent; }\\n 100% {}\\n}\\n@keyframes blink {\\n 0% {}\\n 50% { background-color: transparent; }\\n 100% {}\\n}\\n\\n/* Can style cursor different in overwrite (non-insert) mode */\\n.CodeMirror-overwrite .CodeMirror-cursor {}\\n\\n.cm-tab { display: inline-block; text-decoration: inherit; }\\n\\n.CodeMirror-rulers {\\n position: absolute;\\n left: 0; right: 0; top: -50px; bottom: 0;\\n overflow: hidden;\\n}\\n.CodeMirror-ruler {\\n border-left: 1px solid #ccc;\\n top: 0; bottom: 0;\\n position: absolute;\\n}\\n\\n/* DEFAULT THEME */\\n\\n.cm-s-default .cm-header {color: blue;}\\n.cm-s-default .cm-quote {color: #090;}\\n.cm-negative {color: #d44;}\\n.cm-positive {color: #292;}\\n.cm-header, .cm-strong {font-weight: bold;}\\n.cm-em {font-style: italic;}\\n.cm-link {text-decoration: underline;}\\n.cm-strikethrough {text-decoration: line-through;}\\n\\n.cm-s-default .cm-keyword {color: #708;}\\n.cm-s-default .cm-atom {color: #219;}\\n.cm-s-default .cm-number {color: #164;}\\n.cm-s-default .cm-def {color: #00f;}\\n.cm-s-default .cm-variable,\\n.cm-s-default .cm-punctuation,\\n.cm-s-default .cm-property,\\n.cm-s-default .cm-operator {}\\n.cm-s-default .cm-variable-2 {color: #05a;}\\n.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}\\n.cm-s-default .cm-comment {color: #a50;}\\n.cm-s-default .cm-string {color: #a11;}\\n.cm-s-default .cm-string-2 {color: #f50;}\\n.cm-s-default .cm-meta {color: #555;}\\n.cm-s-default .cm-qualifier {color: #555;}\\n.cm-s-default .cm-builtin {color: #30a;}\\n.cm-s-default .cm-bracket {color: #997;}\\n.cm-s-default .cm-tag {color: #170;}\\n.cm-s-default .cm-attribute {color: #00c;}\\n.cm-s-default .cm-hr {color: #999;}\\n.cm-s-default .cm-link {color: #00c;}\\n\\n.cm-s-default .cm-error {color: #f00;}\\n.cm-invalidchar {color: #f00;}\\n\\n.CodeMirror-composing { border-bottom: 2px solid; }\\n\\n/* Default styles for common addons */\\n\\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}\\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}\\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\\n.CodeMirror-activeline-background {background: #e8f2ff;}\\n\\n/* STOP */\\n\\n/* The rest of this file contains styles related to the mechanics of\\n the editor. You probably shouldn't touch them. */\\n\\n.CodeMirror {\\n position: relative;\\n overflow: hidden;\\n background: white;\\n}\\n\\n.CodeMirror-scroll {\\n overflow: scroll !important; /* Things will break if this is overridden */\\n /* 50px is the magic margin used to hide the element's real scrollbars */\\n /* See overflow: hidden in .CodeMirror */\\n margin-bottom: -50px; margin-right: -50px;\\n padding-bottom: 50px;\\n height: 100%;\\n outline: none; /* Prevent dragging from highlighting the element */\\n position: relative;\\n}\\n.CodeMirror-sizer {\\n position: relative;\\n border-right: 50px solid transparent;\\n}\\n\\n/* The fake, visible scrollbars. Used to force redraw during scrolling\\n before actual scrolling happens, thus preventing shaking and\\n flickering artifacts. */\\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\\n position: absolute;\\n z-index: 6;\\n display: none;\\n outline: none;\\n}\\n.CodeMirror-vscrollbar {\\n right: 0; top: 0;\\n overflow-x: hidden;\\n overflow-y: scroll;\\n}\\n.CodeMirror-hscrollbar {\\n bottom: 0; left: 0;\\n overflow-y: hidden;\\n overflow-x: scroll;\\n}\\n.CodeMirror-scrollbar-filler {\\n right: 0; bottom: 0;\\n}\\n.CodeMirror-gutter-filler {\\n left: 0; bottom: 0;\\n}\\n\\n.CodeMirror-gutters {\\n position: absolute; left: 0; top: 0;\\n min-height: 100%;\\n z-index: 3;\\n}\\n.CodeMirror-gutter {\\n white-space: normal;\\n height: 100%;\\n display: inline-block;\\n vertical-align: top;\\n margin-bottom: -50px;\\n}\\n.CodeMirror-gutter-wrapper {\\n position: absolute;\\n z-index: 4;\\n background: none !important;\\n border: none !important;\\n}\\n.CodeMirror-gutter-background {\\n position: absolute;\\n top: 0; bottom: 0;\\n z-index: 4;\\n}\\n.CodeMirror-gutter-elt {\\n position: absolute;\\n cursor: default;\\n z-index: 4;\\n}\\n.CodeMirror-gutter-wrapper ::selection { background-color: transparent }\\n.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }\\n\\n.CodeMirror-lines {\\n cursor: text;\\n min-height: 1px; /* prevents collapsing before first draw */\\n}\\n.CodeMirror pre.CodeMirror-line,\\n.CodeMirror pre.CodeMirror-line-like {\\n /* Reset some styles that the rest of the page might have set */\\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\\n border-width: 0;\\n background: transparent;\\n font-family: inherit;\\n font-size: inherit;\\n margin: 0;\\n white-space: pre;\\n word-wrap: normal;\\n line-height: inherit;\\n color: inherit;\\n z-index: 2;\\n position: relative;\\n overflow: visible;\\n -webkit-tap-highlight-color: transparent;\\n -webkit-font-variant-ligatures: contextual;\\n font-variant-ligatures: contextual;\\n}\\n.CodeMirror-wrap pre.CodeMirror-line,\\n.CodeMirror-wrap pre.CodeMirror-line-like {\\n word-wrap: break-word;\\n white-space: pre-wrap;\\n word-break: normal;\\n}\\n\\n.CodeMirror-linebackground {\\n position: absolute;\\n left: 0; right: 0; top: 0; bottom: 0;\\n z-index: 0;\\n}\\n\\n.CodeMirror-linewidget {\\n position: relative;\\n z-index: 2;\\n padding: 0.1px; /* Force widget margins to stay inside of the container */\\n}\\n\\n.CodeMirror-widget {}\\n\\n.CodeMirror-rtl pre { direction: rtl; }\\n\\n.CodeMirror-code {\\n outline: none;\\n}\\n\\n/* Force content-box sizing for the elements where we expect it */\\n.CodeMirror-scroll,\\n.CodeMirror-sizer,\\n.CodeMirror-gutter,\\n.CodeMirror-gutters,\\n.CodeMirror-linenumber {\\n -moz-box-sizing: content-box;\\n box-sizing: content-box;\\n}\\n\\n.CodeMirror-measure {\\n position: absolute;\\n width: 100%;\\n height: 0;\\n overflow: hidden;\\n visibility: hidden;\\n}\\n\\n.CodeMirror-cursor {\\n position: absolute;\\n pointer-events: none;\\n}\\n.CodeMirror-measure pre { position: static; }\\n\\ndiv.CodeMirror-cursors {\\n visibility: hidden;\\n position: relative;\\n z-index: 3;\\n}\\ndiv.CodeMirror-dragcursors {\\n visibility: visible;\\n}\\n\\n.CodeMirror-focused div.CodeMirror-cursors {\\n visibility: visible;\\n}\\n\\n.CodeMirror-selected { background: #d9d9d9; }\\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\\n.CodeMirror-crosshair { cursor: crosshair; }\\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\\n\\n.cm-searching {\\n background-color: #ffa;\\n background-color: rgba(255, 255, 0, .4);\\n}\\n\\n/* Used to force a border model for a node */\\n.cm-force-border { padding-right: .1px; }\\n\\n@media print {\\n /* Hide the cursor when printing */\\n .CodeMirror div.CodeMirror-cursors {\\n visibility: hidden;\\n }\\n}\\n\\n/* See issue #2901 */\\n.cm-tab-wrap-hack:after { content: ''; }\\n\\n/* Help users use markselection to safely style text background */\\nspan.CodeMirror-selectedtext { background: none; }\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./../../node_modules/codemirror/lib/codemirror.css\"],\"names\":[],\"mappings\":\"AAAA,WAAW;;AAEX;EACE,gEAAgE;EAChE,sBAAsB;EACtB,aAAa;EACb,YAAY;EACZ,cAAc;AAChB;;AAEA,YAAY;;AAEZ;EACE,cAAc,EAAE,oCAAoC;AACtD;AACA;;EAEE,cAAc,EAAE,kCAAkC;AACpD;;AAEA;EACE,uBAAuB,EAAE,iDAAiD;AAC5E;;AAEA,WAAW;;AAEX;EACE,4BAA4B;EAC5B,yBAAyB;EACzB,mBAAmB;AACrB;AACA,yBAAyB;AACzB;EACE,oBAAoB;EACpB,eAAe;EACf,iBAAiB;EACjB,WAAW;EACX,mBAAmB;AACrB;;AAEA,2BAA2B,YAAY,EAAE;AACzC,kCAAkC,WAAW,EAAE;;AAE/C,WAAW;;AAEX;EACE,4BAA4B;EAC5B,kBAAkB;EAClB,QAAQ;AACV;AACA,6CAA6C;AAC7C;EACE,6BAA6B;AAC/B;AACA;EACE,WAAW;EACX,oBAAoB;EACpB,gBAAgB;AAClB;AACA;EACE,UAAU;AACZ;AACA;EACE,wCAAwC;EACxC,gDAAgD;EAChD,6CAA6C;EAC7C,wCAAwC;AAC1C;AACA;EACE,WAAW;EACX,SAAS;EACT,gDAAgD;EAChD,6CAA6C;EAC7C,wCAAwC;EACxC,sBAAsB;AACxB;AACA;EACE,IAAI;EACJ,MAAM,6BAA6B,EAAE;EACrC,MAAM;AACR;AACA;EACE,IAAI;EACJ,MAAM,6BAA6B,EAAE;EACrC,MAAM;AACR;AACA;EACE,IAAI;EACJ,MAAM,6BAA6B,EAAE;EACrC,MAAM;AACR;;AAEA,8DAA8D;AAC9D,0CAA0C;;AAE1C,UAAU,qBAAqB,EAAE,wBAAwB,EAAE;;AAE3D;EACE,kBAAkB;EAClB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS;EACxC,gBAAgB;AAClB;AACA;EACE,2BAA2B;EAC3B,MAAM,EAAE,SAAS;EACjB,kBAAkB;AACpB;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EA,iEAAiE;AACjE;;;;;EAKE,4BAA4B;EAC5B,uBAAuB;AACzB;;AAEA;EACE,kBAAkB;EAClB,WAAW;EACX,SAAS;EACT,gBAAgB;EAChB,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;EAClB,oBAAoB;AACtB;AACA,0BAA0B,gBAAgB,EAAE;;AAE5C;EACE,kBAAkB;EAClB,kBAAkB;EAClB,UAAU;AACZ;AACA;EACE,mBAAmB;AACrB;;AAEA;EACE,mBAAmB;AACrB;;AAEA,uBAAuB,mBAAmB,EAAE;AAC5C,2CAA2C,mBAAmB,EAAE;AAChE,wBAAwB,iBAAiB,EAAE;AAC3C,6GAA6G,mBAAmB,EAAE;AAClI,4HAA4H,mBAAmB,EAAE;;AAEjJ;EACE,sBAAsB;EACtB,uCAAuC;AACzC;;AAEA,4CAA4C;AAC5C,mBAAmB,mBAAmB,EAAE;;AAExC;EACE,kCAAkC;EAClC;IACE,kBAAkB;EACpB;AACF;;AAEA,oBAAoB;AACpB,0BAA0B,WAAW,EAAE;;AAEvC,iEAAiE;AACjE,+BAA+B,gBAAgB,EAAE\",\"sourcesContent\":[\"/* BASICS */\\n\\n.CodeMirror {\\n /* Set height, width, borders, and global font properties here */\\n font-family: monospace;\\n height: 300px;\\n color: black;\\n direction: ltr;\\n}\\n\\n/* PADDING */\\n\\n.CodeMirror-lines {\\n padding: 4px 0; /* Vertical padding around content */\\n}\\n.CodeMirror pre.CodeMirror-line,\\n.CodeMirror pre.CodeMirror-line-like {\\n padding: 0 4px; /* Horizontal padding of content */\\n}\\n\\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\\n background-color: white; /* The little square between H and V scrollbars */\\n}\\n\\n/* GUTTER */\\n\\n.CodeMirror-gutters {\\n border-right: 1px solid #ddd;\\n background-color: #f7f7f7;\\n white-space: nowrap;\\n}\\n.CodeMirror-linenumbers {}\\n.CodeMirror-linenumber {\\n padding: 0 3px 0 5px;\\n min-width: 20px;\\n text-align: right;\\n color: #999;\\n white-space: nowrap;\\n}\\n\\n.CodeMirror-guttermarker { color: black; }\\n.CodeMirror-guttermarker-subtle { color: #999; }\\n\\n/* CURSOR */\\n\\n.CodeMirror-cursor {\\n border-left: 1px solid black;\\n border-right: none;\\n width: 0;\\n}\\n/* Shown when moving in bi-directional text */\\n.CodeMirror div.CodeMirror-secondarycursor {\\n border-left: 1px solid silver;\\n}\\n.cm-fat-cursor .CodeMirror-cursor {\\n width: auto;\\n border: 0 !important;\\n background: #7e7;\\n}\\n.cm-fat-cursor div.CodeMirror-cursors {\\n z-index: 1;\\n}\\n.cm-fat-cursor-mark {\\n background-color: rgba(20, 255, 20, 0.5);\\n -webkit-animation: blink 1.06s steps(1) infinite;\\n -moz-animation: blink 1.06s steps(1) infinite;\\n animation: blink 1.06s steps(1) infinite;\\n}\\n.cm-animate-fat-cursor {\\n width: auto;\\n border: 0;\\n -webkit-animation: blink 1.06s steps(1) infinite;\\n -moz-animation: blink 1.06s steps(1) infinite;\\n animation: blink 1.06s steps(1) infinite;\\n background-color: #7e7;\\n}\\n@-moz-keyframes blink {\\n 0% {}\\n 50% { background-color: transparent; }\\n 100% {}\\n}\\n@-webkit-keyframes blink {\\n 0% {}\\n 50% { background-color: transparent; }\\n 100% {}\\n}\\n@keyframes blink {\\n 0% {}\\n 50% { background-color: transparent; }\\n 100% {}\\n}\\n\\n/* Can style cursor different in overwrite (non-insert) mode */\\n.CodeMirror-overwrite .CodeMirror-cursor {}\\n\\n.cm-tab { display: inline-block; text-decoration: inherit; }\\n\\n.CodeMirror-rulers {\\n position: absolute;\\n left: 0; right: 0; top: -50px; bottom: 0;\\n overflow: hidden;\\n}\\n.CodeMirror-ruler {\\n border-left: 1px solid #ccc;\\n top: 0; bottom: 0;\\n position: absolute;\\n}\\n\\n/* DEFAULT THEME */\\n\\n.cm-s-default .cm-header {color: blue;}\\n.cm-s-default .cm-quote {color: #090;}\\n.cm-negative {color: #d44;}\\n.cm-positive {color: #292;}\\n.cm-header, .cm-strong {font-weight: bold;}\\n.cm-em {font-style: italic;}\\n.cm-link {text-decoration: underline;}\\n.cm-strikethrough {text-decoration: line-through;}\\n\\n.cm-s-default .cm-keyword {color: #708;}\\n.cm-s-default .cm-atom {color: #219;}\\n.cm-s-default .cm-number {color: #164;}\\n.cm-s-default .cm-def {color: #00f;}\\n.cm-s-default .cm-variable,\\n.cm-s-default .cm-punctuation,\\n.cm-s-default .cm-property,\\n.cm-s-default .cm-operator {}\\n.cm-s-default .cm-variable-2 {color: #05a;}\\n.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}\\n.cm-s-default .cm-comment {color: #a50;}\\n.cm-s-default .cm-string {color: #a11;}\\n.cm-s-default .cm-string-2 {color: #f50;}\\n.cm-s-default .cm-meta {color: #555;}\\n.cm-s-default .cm-qualifier {color: #555;}\\n.cm-s-default .cm-builtin {color: #30a;}\\n.cm-s-default .cm-bracket {color: #997;}\\n.cm-s-default .cm-tag {color: #170;}\\n.cm-s-default .cm-attribute {color: #00c;}\\n.cm-s-default .cm-hr {color: #999;}\\n.cm-s-default .cm-link {color: #00c;}\\n\\n.cm-s-default .cm-error {color: #f00;}\\n.cm-invalidchar {color: #f00;}\\n\\n.CodeMirror-composing { border-bottom: 2px solid; }\\n\\n/* Default styles for common addons */\\n\\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}\\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}\\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\\n.CodeMirror-activeline-background {background: #e8f2ff;}\\n\\n/* STOP */\\n\\n/* The rest of this file contains styles related to the mechanics of\\n the editor. You probably shouldn't touch them. */\\n\\n.CodeMirror {\\n position: relative;\\n overflow: hidden;\\n background: white;\\n}\\n\\n.CodeMirror-scroll {\\n overflow: scroll !important; /* Things will break if this is overridden */\\n /* 50px is the magic margin used to hide the element's real scrollbars */\\n /* See overflow: hidden in .CodeMirror */\\n margin-bottom: -50px; margin-right: -50px;\\n padding-bottom: 50px;\\n height: 100%;\\n outline: none; /* Prevent dragging from highlighting the element */\\n position: relative;\\n}\\n.CodeMirror-sizer {\\n position: relative;\\n border-right: 50px solid transparent;\\n}\\n\\n/* The fake, visible scrollbars. Used to force redraw during scrolling\\n before actual scrolling happens, thus preventing shaking and\\n flickering artifacts. */\\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\\n position: absolute;\\n z-index: 6;\\n display: none;\\n outline: none;\\n}\\n.CodeMirror-vscrollbar {\\n right: 0; top: 0;\\n overflow-x: hidden;\\n overflow-y: scroll;\\n}\\n.CodeMirror-hscrollbar {\\n bottom: 0; left: 0;\\n overflow-y: hidden;\\n overflow-x: scroll;\\n}\\n.CodeMirror-scrollbar-filler {\\n right: 0; bottom: 0;\\n}\\n.CodeMirror-gutter-filler {\\n left: 0; bottom: 0;\\n}\\n\\n.CodeMirror-gutters {\\n position: absolute; left: 0; top: 0;\\n min-height: 100%;\\n z-index: 3;\\n}\\n.CodeMirror-gutter {\\n white-space: normal;\\n height: 100%;\\n display: inline-block;\\n vertical-align: top;\\n margin-bottom: -50px;\\n}\\n.CodeMirror-gutter-wrapper {\\n position: absolute;\\n z-index: 4;\\n background: none !important;\\n border: none !important;\\n}\\n.CodeMirror-gutter-background {\\n position: absolute;\\n top: 0; bottom: 0;\\n z-index: 4;\\n}\\n.CodeMirror-gutter-elt {\\n position: absolute;\\n cursor: default;\\n z-index: 4;\\n}\\n.CodeMirror-gutter-wrapper ::selection { background-color: transparent }\\n.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }\\n\\n.CodeMirror-lines {\\n cursor: text;\\n min-height: 1px; /* prevents collapsing before first draw */\\n}\\n.CodeMirror pre.CodeMirror-line,\\n.CodeMirror pre.CodeMirror-line-like {\\n /* Reset some styles that the rest of the page might have set */\\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\\n border-width: 0;\\n background: transparent;\\n font-family: inherit;\\n font-size: inherit;\\n margin: 0;\\n white-space: pre;\\n word-wrap: normal;\\n line-height: inherit;\\n color: inherit;\\n z-index: 2;\\n position: relative;\\n overflow: visible;\\n -webkit-tap-highlight-color: transparent;\\n -webkit-font-variant-ligatures: contextual;\\n font-variant-ligatures: contextual;\\n}\\n.CodeMirror-wrap pre.CodeMirror-line,\\n.CodeMirror-wrap pre.CodeMirror-line-like {\\n word-wrap: break-word;\\n white-space: pre-wrap;\\n word-break: normal;\\n}\\n\\n.CodeMirror-linebackground {\\n position: absolute;\\n left: 0; right: 0; top: 0; bottom: 0;\\n z-index: 0;\\n}\\n\\n.CodeMirror-linewidget {\\n position: relative;\\n z-index: 2;\\n padding: 0.1px; /* Force widget margins to stay inside of the container */\\n}\\n\\n.CodeMirror-widget {}\\n\\n.CodeMirror-rtl pre { direction: rtl; }\\n\\n.CodeMirror-code {\\n outline: none;\\n}\\n\\n/* Force content-box sizing for the elements where we expect it */\\n.CodeMirror-scroll,\\n.CodeMirror-sizer,\\n.CodeMirror-gutter,\\n.CodeMirror-gutters,\\n.CodeMirror-linenumber {\\n -moz-box-sizing: content-box;\\n box-sizing: content-box;\\n}\\n\\n.CodeMirror-measure {\\n position: absolute;\\n width: 100%;\\n height: 0;\\n overflow: hidden;\\n visibility: hidden;\\n}\\n\\n.CodeMirror-cursor {\\n position: absolute;\\n pointer-events: none;\\n}\\n.CodeMirror-measure pre { position: static; }\\n\\ndiv.CodeMirror-cursors {\\n visibility: hidden;\\n position: relative;\\n z-index: 3;\\n}\\ndiv.CodeMirror-dragcursors {\\n visibility: visible;\\n}\\n\\n.CodeMirror-focused div.CodeMirror-cursors {\\n visibility: visible;\\n}\\n\\n.CodeMirror-selected { background: #d9d9d9; }\\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\\n.CodeMirror-crosshair { cursor: crosshair; }\\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\\n\\n.cm-searching {\\n background-color: #ffa;\\n background-color: rgba(255, 255, 0, .4);\\n}\\n\\n/* Used to force a border model for a node */\\n.cm-force-border { padding-right: .1px; }\\n\\n@media print {\\n /* Hide the cursor when printing */\\n .CodeMirror div.CodeMirror-cursors {\\n visibility: hidden;\\n }\\n}\\n\\n/* See issue #2901 */\\n.cm-tab-wrap-hack:after { content: ''; }\\n\\n/* Help users use markselection to safely style text background */\\nspan.CodeMirror-selectedtext { background: none; }\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../packages/thebe/node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../packages/thebe/node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".cm-s-abcdef.CodeMirror { background: #0f0f0f; color: #defdef; }\\n.cm-s-abcdef div.CodeMirror-selected { background: #515151; }\\n.cm-s-abcdef .CodeMirror-line::selection, .cm-s-abcdef .CodeMirror-line > span::selection, .cm-s-abcdef .CodeMirror-line > span > span::selection { background: rgba(56, 56, 56, 0.99); }\\n.cm-s-abcdef .CodeMirror-line::-moz-selection, .cm-s-abcdef .CodeMirror-line > span::-moz-selection, .cm-s-abcdef .CodeMirror-line > span > span::-moz-selection { background: rgba(56, 56, 56, 0.99); }\\n.cm-s-abcdef .CodeMirror-gutters { background: #555; border-right: 2px solid #314151; }\\n.cm-s-abcdef .CodeMirror-guttermarker { color: #222; }\\n.cm-s-abcdef .CodeMirror-guttermarker-subtle { color: azure; }\\n.cm-s-abcdef .CodeMirror-linenumber { color: #FFFFFF; }\\n.cm-s-abcdef .CodeMirror-cursor { border-left: 1px solid #00FF00; }\\n\\n.cm-s-abcdef span.cm-keyword { color: darkgoldenrod; font-weight: bold; }\\n.cm-s-abcdef span.cm-atom { color: #77F; }\\n.cm-s-abcdef span.cm-number { color: violet; }\\n.cm-s-abcdef span.cm-def { color: #fffabc; }\\n.cm-s-abcdef span.cm-variable { color: #abcdef; }\\n.cm-s-abcdef span.cm-variable-2 { color: #cacbcc; }\\n.cm-s-abcdef span.cm-variable-3, .cm-s-abcdef span.cm-type { color: #def; }\\n.cm-s-abcdef span.cm-property { color: #fedcba; }\\n.cm-s-abcdef span.cm-operator { color: #ff0; }\\n.cm-s-abcdef span.cm-comment { color: #7a7b7c; font-style: italic;}\\n.cm-s-abcdef span.cm-string { color: #2b4; }\\n.cm-s-abcdef span.cm-meta { color: #C9F; }\\n.cm-s-abcdef span.cm-qualifier { color: #FFF700; }\\n.cm-s-abcdef span.cm-builtin { color: #30aabc; }\\n.cm-s-abcdef span.cm-bracket { color: #8a8a8a; }\\n.cm-s-abcdef span.cm-tag { color: #FFDD44; }\\n.cm-s-abcdef span.cm-attribute { color: #DDFF00; }\\n.cm-s-abcdef span.cm-error { color: #FF0000; }\\n.cm-s-abcdef span.cm-header { color: aquamarine; font-weight: bold; }\\n.cm-s-abcdef span.cm-link { color: blueviolet; }\\n\\n.cm-s-abcdef .CodeMirror-activeline-background { background: #314151; }\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./../../node_modules/codemirror/theme/abcdef.css\"],\"names\":[],\"mappings\":\"AAAA,0BAA0B,mBAAmB,EAAE,cAAc,EAAE;AAC/D,uCAAuC,mBAAmB,EAAE;AAC5D,oJAAoJ,kCAAkC,EAAE;AACxL,mKAAmK,kCAAkC,EAAE;AACvM,mCAAmC,gBAAgB,EAAE,+BAA+B,EAAE;AACtF,wCAAwC,WAAW,EAAE;AACrD,+CAA+C,YAAY,EAAE;AAC7D,sCAAsC,cAAc,EAAE;AACtD,kCAAkC,8BAA8B,EAAE;;AAElE,+BAA+B,oBAAoB,EAAE,iBAAiB,EAAE;AACxE,4BAA4B,WAAW,EAAE;AACzC,8BAA8B,aAAa,EAAE;AAC7C,2BAA2B,cAAc,EAAE;AAC3C,gCAAgC,cAAc,EAAE;AAChD,kCAAkC,cAAc,EAAE;AAClD,6DAA6D,WAAW,EAAE;AAC1E,gCAAgC,cAAc,EAAE;AAChD,gCAAgC,WAAW,EAAE;AAC7C,+BAA+B,cAAc,EAAE,kBAAkB,CAAC;AAClE,8BAA8B,WAAW,EAAE;AAC3C,4BAA4B,WAAW,EAAE;AACzC,iCAAiC,cAAc,EAAE;AACjD,+BAA+B,cAAc,EAAE;AAC/C,+BAA+B,cAAc,EAAE;AAC/C,2BAA2B,cAAc,EAAE;AAC3C,iCAAiC,cAAc,EAAE;AACjD,6BAA6B,cAAc,EAAE;AAC7C,8BAA8B,iBAAiB,EAAE,iBAAiB,EAAE;AACpE,4BAA4B,iBAAiB,EAAE;;AAE/C,iDAAiD,mBAAmB,EAAE\",\"sourcesContent\":[\".cm-s-abcdef.CodeMirror { background: #0f0f0f; color: #defdef; }\\n.cm-s-abcdef div.CodeMirror-selected { background: #515151; }\\n.cm-s-abcdef .CodeMirror-line::selection, .cm-s-abcdef .CodeMirror-line > span::selection, .cm-s-abcdef .CodeMirror-line > span > span::selection { background: rgba(56, 56, 56, 0.99); }\\n.cm-s-abcdef .CodeMirror-line::-moz-selection, .cm-s-abcdef .CodeMirror-line > span::-moz-selection, .cm-s-abcdef .CodeMirror-line > span > span::-moz-selection { background: rgba(56, 56, 56, 0.99); }\\n.cm-s-abcdef .CodeMirror-gutters { background: #555; border-right: 2px solid #314151; }\\n.cm-s-abcdef .CodeMirror-guttermarker { color: #222; }\\n.cm-s-abcdef .CodeMirror-guttermarker-subtle { color: azure; }\\n.cm-s-abcdef .CodeMirror-linenumber { color: #FFFFFF; }\\n.cm-s-abcdef .CodeMirror-cursor { border-left: 1px solid #00FF00; }\\n\\n.cm-s-abcdef span.cm-keyword { color: darkgoldenrod; font-weight: bold; }\\n.cm-s-abcdef span.cm-atom { color: #77F; }\\n.cm-s-abcdef span.cm-number { color: violet; }\\n.cm-s-abcdef span.cm-def { color: #fffabc; }\\n.cm-s-abcdef span.cm-variable { color: #abcdef; }\\n.cm-s-abcdef span.cm-variable-2 { color: #cacbcc; }\\n.cm-s-abcdef span.cm-variable-3, .cm-s-abcdef span.cm-type { color: #def; }\\n.cm-s-abcdef span.cm-property { color: #fedcba; }\\n.cm-s-abcdef span.cm-operator { color: #ff0; }\\n.cm-s-abcdef span.cm-comment { color: #7a7b7c; font-style: italic;}\\n.cm-s-abcdef span.cm-string { color: #2b4; }\\n.cm-s-abcdef span.cm-meta { color: #C9F; }\\n.cm-s-abcdef span.cm-qualifier { color: #FFF700; }\\n.cm-s-abcdef span.cm-builtin { color: #30aabc; }\\n.cm-s-abcdef span.cm-bracket { color: #8a8a8a; }\\n.cm-s-abcdef span.cm-tag { color: #FFDD44; }\\n.cm-s-abcdef span.cm-attribute { color: #DDFF00; }\\n.cm-s-abcdef span.cm-error { color: #FF0000; }\\n.cm-s-abcdef span.cm-header { color: aquamarine; font-weight: bold; }\\n.cm-s-abcdef span.cm-link { color: blueviolet; }\\n\\n.cm-s-abcdef .CodeMirror-activeline-background { background: #314151; }\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../packages/thebe/node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../packages/thebe/node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"/**\\n Name: IntelliJ IDEA darcula theme\\n From IntelliJ IDEA by JetBrains\\n */\\n\\n.cm-s-darcula { font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;}\\n.cm-s-darcula.CodeMirror { background: #2B2B2B; color: #A9B7C6; }\\n\\n.cm-s-darcula span.cm-meta { color: #BBB529; }\\n.cm-s-darcula span.cm-number { color: #6897BB; }\\n.cm-s-darcula span.cm-keyword { color: #CC7832; line-height: 1em; font-weight: bold; }\\n.cm-s-darcula span.cm-def { color: #A9B7C6; font-style: italic; }\\n.cm-s-darcula span.cm-variable { color: #A9B7C6; }\\n.cm-s-darcula span.cm-variable-2 { color: #A9B7C6; }\\n.cm-s-darcula span.cm-variable-3 { color: #9876AA; }\\n.cm-s-darcula span.cm-type { color: #AABBCC; font-weight: bold; }\\n.cm-s-darcula span.cm-property { color: #FFC66D; }\\n.cm-s-darcula span.cm-operator { color: #A9B7C6; }\\n.cm-s-darcula span.cm-string { color: #6A8759; }\\n.cm-s-darcula span.cm-string-2 { color: #6A8759; }\\n.cm-s-darcula span.cm-comment { color: #61A151; font-style: italic; }\\n.cm-s-darcula span.cm-link { color: #CC7832; }\\n.cm-s-darcula span.cm-atom { color: #CC7832; }\\n.cm-s-darcula span.cm-error { color: #BC3F3C; }\\n.cm-s-darcula span.cm-tag { color: #629755; font-weight: bold; font-style: italic; text-decoration: underline; }\\n.cm-s-darcula span.cm-attribute { color: #6897bb; }\\n.cm-s-darcula span.cm-qualifier { color: #6A8759; }\\n.cm-s-darcula span.cm-bracket { color: #A9B7C6; }\\n.cm-s-darcula span.cm-builtin { color: #FF9E59; }\\n.cm-s-darcula span.cm-special { color: #FF9E59; }\\n.cm-s-darcula span.cm-matchhighlight { color: #FFFFFF; background-color: rgba(50, 89, 48, .7); font-weight: normal;}\\n.cm-s-darcula span.cm-searching { color: #FFFFFF; background-color: rgba(61, 115, 59, .7); font-weight: normal;}\\n\\n.cm-s-darcula .CodeMirror-cursor { border-left: 1px solid #A9B7C6; }\\n.cm-s-darcula .CodeMirror-activeline-background { background: #323232; }\\n.cm-s-darcula .CodeMirror-gutters { background: #313335; border-right: 1px solid #313335; }\\n.cm-s-darcula .CodeMirror-guttermarker { color: #FFEE80; }\\n.cm-s-darcula .CodeMirror-guttermarker-subtle { color: #D0D0D0; }\\n.cm-s-darcula .CodeMirrir-linenumber { color: #606366; }\\n.cm-s-darcula .CodeMirror-matchingbracket { background-color: #3B514D; color: #FFEF28 !important; font-weight: bold; }\\n\\n.cm-s-darcula div.CodeMirror-selected { background: #214283; }\\n\\n.CodeMirror-hints.darcula {\\n font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;\\n color: #9C9E9E;\\n background-color: #3B3E3F !important;\\n}\\n\\n.CodeMirror-hints.darcula .CodeMirror-hint-active {\\n background-color: #494D4E !important;\\n color: #9C9E9E !important;\\n}\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./../../node_modules/codemirror/theme/darcula.css\"],\"names\":[],\"mappings\":\"AAAA;;;EAGE;;AAEF,iBAAiB,0JAA0J,CAAC;AAC5K,2BAA2B,mBAAmB,EAAE,cAAc,EAAE;;AAEhE,6BAA6B,cAAc,EAAE;AAC7C,+BAA+B,cAAc,EAAE;AAC/C,gCAAgC,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE;AACrF,4BAA4B,cAAc,EAAE,kBAAkB,EAAE;AAChE,iCAAiC,cAAc,EAAE;AACjD,mCAAmC,cAAc,EAAE;AACnD,mCAAmC,cAAc,EAAE;AACnD,6BAA6B,cAAc,EAAE,iBAAiB,EAAE;AAChE,iCAAiC,cAAc,EAAE;AACjD,iCAAiC,cAAc,EAAE;AACjD,+BAA+B,cAAc,EAAE;AAC/C,iCAAiC,cAAc,EAAE;AACjD,gCAAgC,cAAc,EAAE,kBAAkB,EAAE;AACpE,6BAA6B,cAAc,EAAE;AAC7C,6BAA6B,cAAc,EAAE;AAC7C,8BAA8B,cAAc,EAAE;AAC9C,4BAA4B,cAAc,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,0BAA0B,EAAE;AAC/G,kCAAkC,cAAc,EAAE;AAClD,kCAAkC,cAAc,EAAE;AAClD,gCAAgC,cAAc,EAAE;AAChD,gCAAgC,cAAc,EAAE;AAChD,gCAAgC,cAAc,EAAE;AAChD,uCAAuC,cAAc,EAAE,sCAAsC,EAAE,mBAAmB,CAAC;AACnH,kCAAkC,cAAc,EAAE,uCAAuC,EAAE,mBAAmB,CAAC;;AAE/G,mCAAmC,8BAA8B,EAAE;AACnE,kDAAkD,mBAAmB,EAAE;AACvE,oCAAoC,mBAAmB,EAAE,+BAA+B,EAAE;AAC1F,yCAAyC,cAAc,EAAE;AACzD,gDAAgD,cAAc,EAAE;AAChE,uCAAuC,cAAc,EAAE;AACvD,4CAA4C,yBAAyB,EAAE,yBAAyB,EAAE,iBAAiB,EAAE;;AAErH,wCAAwC,mBAAmB,EAAE;;AAE7D;EACE,8DAA8D;EAC9D,cAAc;EACd,oCAAoC;AACtC;;AAEA;EACE,oCAAoC;EACpC,yBAAyB;AAC3B\",\"sourcesContent\":[\"/**\\n Name: IntelliJ IDEA darcula theme\\n From IntelliJ IDEA by JetBrains\\n */\\n\\n.cm-s-darcula { font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;}\\n.cm-s-darcula.CodeMirror { background: #2B2B2B; color: #A9B7C6; }\\n\\n.cm-s-darcula span.cm-meta { color: #BBB529; }\\n.cm-s-darcula span.cm-number { color: #6897BB; }\\n.cm-s-darcula span.cm-keyword { color: #CC7832; line-height: 1em; font-weight: bold; }\\n.cm-s-darcula span.cm-def { color: #A9B7C6; font-style: italic; }\\n.cm-s-darcula span.cm-variable { color: #A9B7C6; }\\n.cm-s-darcula span.cm-variable-2 { color: #A9B7C6; }\\n.cm-s-darcula span.cm-variable-3 { color: #9876AA; }\\n.cm-s-darcula span.cm-type { color: #AABBCC; font-weight: bold; }\\n.cm-s-darcula span.cm-property { color: #FFC66D; }\\n.cm-s-darcula span.cm-operator { color: #A9B7C6; }\\n.cm-s-darcula span.cm-string { color: #6A8759; }\\n.cm-s-darcula span.cm-string-2 { color: #6A8759; }\\n.cm-s-darcula span.cm-comment { color: #61A151; font-style: italic; }\\n.cm-s-darcula span.cm-link { color: #CC7832; }\\n.cm-s-darcula span.cm-atom { color: #CC7832; }\\n.cm-s-darcula span.cm-error { color: #BC3F3C; }\\n.cm-s-darcula span.cm-tag { color: #629755; font-weight: bold; font-style: italic; text-decoration: underline; }\\n.cm-s-darcula span.cm-attribute { color: #6897bb; }\\n.cm-s-darcula span.cm-qualifier { color: #6A8759; }\\n.cm-s-darcula span.cm-bracket { color: #A9B7C6; }\\n.cm-s-darcula span.cm-builtin { color: #FF9E59; }\\n.cm-s-darcula span.cm-special { color: #FF9E59; }\\n.cm-s-darcula span.cm-matchhighlight { color: #FFFFFF; background-color: rgba(50, 89, 48, .7); font-weight: normal;}\\n.cm-s-darcula span.cm-searching { color: #FFFFFF; background-color: rgba(61, 115, 59, .7); font-weight: normal;}\\n\\n.cm-s-darcula .CodeMirror-cursor { border-left: 1px solid #A9B7C6; }\\n.cm-s-darcula .CodeMirror-activeline-background { background: #323232; }\\n.cm-s-darcula .CodeMirror-gutters { background: #313335; border-right: 1px solid #313335; }\\n.cm-s-darcula .CodeMirror-guttermarker { color: #FFEE80; }\\n.cm-s-darcula .CodeMirror-guttermarker-subtle { color: #D0D0D0; }\\n.cm-s-darcula .CodeMirrir-linenumber { color: #606366; }\\n.cm-s-darcula .CodeMirror-matchingbracket { background-color: #3B514D; color: #FFEF28 !important; font-weight: bold; }\\n\\n.cm-s-darcula div.CodeMirror-selected { background: #214283; }\\n\\n.CodeMirror-hints.darcula {\\n font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;\\n color: #9C9E9E;\\n background-color: #3B3E3F !important;\\n}\\n\\n.CodeMirror-hints.darcula .CodeMirror-hint-active {\\n background-color: #494D4E !important;\\n color: #9C9E9E !important;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../packages/thebe/node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../packages/thebe/node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"/**\\n Name: IDEA default theme\\n From IntelliJ IDEA by JetBrains\\n */\\n\\n.cm-s-idea span.cm-meta { color: #808000; }\\n.cm-s-idea span.cm-number { color: #0000FF; }\\n.cm-s-idea span.cm-keyword { line-height: 1em; font-weight: bold; color: #000080; }\\n.cm-s-idea span.cm-atom { font-weight: bold; color: #000080; }\\n.cm-s-idea span.cm-def { color: #000000; }\\n.cm-s-idea span.cm-variable { color: black; }\\n.cm-s-idea span.cm-variable-2 { color: black; }\\n.cm-s-idea span.cm-variable-3, .cm-s-idea span.cm-type { color: black; }\\n.cm-s-idea span.cm-property { color: black; }\\n.cm-s-idea span.cm-operator { color: black; }\\n.cm-s-idea span.cm-comment { color: #808080; }\\n.cm-s-idea span.cm-string { color: #008000; }\\n.cm-s-idea span.cm-string-2 { color: #008000; }\\n.cm-s-idea span.cm-qualifier { color: #555; }\\n.cm-s-idea span.cm-error { color: #FF0000; }\\n.cm-s-idea span.cm-attribute { color: #0000FF; }\\n.cm-s-idea span.cm-tag { color: #000080; }\\n.cm-s-idea span.cm-link { color: #0000FF; }\\n.cm-s-idea .CodeMirror-activeline-background { background: #FFFAE3; }\\n\\n.cm-s-idea span.cm-builtin { color: #30a; }\\n.cm-s-idea span.cm-bracket { color: #cc7; }\\n.cm-s-idea { font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;}\\n\\n\\n.cm-s-idea .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; }\\n\\n.CodeMirror-hints.idea {\\n font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;\\n color: #616569;\\n background-color: #ebf3fd !important;\\n}\\n\\n.CodeMirror-hints.idea .CodeMirror-hint-active {\\n background-color: #a2b8c9 !important;\\n color: #5c6065 !important;\\n}\", \"\",{\"version\":3,\"sources\":[\"webpack://./../../node_modules/codemirror/theme/idea.css\"],\"names\":[],\"mappings\":\"AAAA;;;EAGE;;AAEF,0BAA0B,cAAc,EAAE;AAC1C,4BAA4B,cAAc,EAAE;AAC5C,6BAA6B,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE;AAClF,0BAA0B,iBAAiB,EAAE,cAAc,EAAE;AAC7D,yBAAyB,cAAc,EAAE;AACzC,8BAA8B,YAAY,EAAE;AAC5C,gCAAgC,YAAY,EAAE;AAC9C,yDAAyD,YAAY,EAAE;AACvE,8BAA8B,YAAY,EAAE;AAC5C,8BAA8B,YAAY,EAAE;AAC5C,6BAA6B,cAAc,EAAE;AAC7C,4BAA4B,cAAc,EAAE;AAC5C,8BAA8B,cAAc,EAAE;AAC9C,+BAA+B,WAAW,EAAE;AAC5C,2BAA2B,cAAc,EAAE;AAC3C,+BAA+B,cAAc,EAAE;AAC/C,yBAAyB,cAAc,EAAE;AACzC,0BAA0B,cAAc,EAAE;AAC1C,+CAA+C,mBAAmB,EAAE;;AAEpE,6BAA6B,WAAW,EAAE;AAC1C,6BAA6B,WAAW,EAAE;AAC1C,cAAc,gJAAgJ,CAAC;;;AAG/J,yCAAyC,sBAAsB,EAAE,sBAAsB,EAAE;;AAEzF;EACE,8DAA8D;EAC9D,cAAc;EACd,oCAAoC;AACtC;;AAEA;EACE,oCAAoC;EACpC,yBAAyB;AAC3B\",\"sourcesContent\":[\"/**\\n Name: IDEA default theme\\n From IntelliJ IDEA by JetBrains\\n */\\n\\n.cm-s-idea span.cm-meta { color: #808000; }\\n.cm-s-idea span.cm-number { color: #0000FF; }\\n.cm-s-idea span.cm-keyword { line-height: 1em; font-weight: bold; color: #000080; }\\n.cm-s-idea span.cm-atom { font-weight: bold; color: #000080; }\\n.cm-s-idea span.cm-def { color: #000000; }\\n.cm-s-idea span.cm-variable { color: black; }\\n.cm-s-idea span.cm-variable-2 { color: black; }\\n.cm-s-idea span.cm-variable-3, .cm-s-idea span.cm-type { color: black; }\\n.cm-s-idea span.cm-property { color: black; }\\n.cm-s-idea span.cm-operator { color: black; }\\n.cm-s-idea span.cm-comment { color: #808080; }\\n.cm-s-idea span.cm-string { color: #008000; }\\n.cm-s-idea span.cm-string-2 { color: #008000; }\\n.cm-s-idea span.cm-qualifier { color: #555; }\\n.cm-s-idea span.cm-error { color: #FF0000; }\\n.cm-s-idea span.cm-attribute { color: #0000FF; }\\n.cm-s-idea span.cm-tag { color: #000080; }\\n.cm-s-idea span.cm-link { color: #0000FF; }\\n.cm-s-idea .CodeMirror-activeline-background { background: #FFFAE3; }\\n\\n.cm-s-idea span.cm-builtin { color: #30a; }\\n.cm-s-idea span.cm-bracket { color: #cc7; }\\n.cm-s-idea { font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;}\\n\\n\\n.cm-s-idea .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; }\\n\\n.CodeMirror-hints.idea {\\n font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;\\n color: #616569;\\n background-color: #ebf3fd !important;\\n}\\n\\n.CodeMirror-hints.idea .CodeMirror-hint-active {\\n background-color: #a2b8c9 !important;\\n color: #5c6065 !important;\\n}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === \"string\") {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, \"\"]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};","\"use strict\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nmodule.exports = function cssWithMappingToString(item) {\n var _item = _slicedToArray(item, 4),\n content = _item[1],\n cssMapping = _item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (typeof btoa === \"function\") {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || \"\").concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join(\"\\n\");\n }\n\n return [content].join(\"\\n\");\n};","import api from \"!../../../packages/thebe/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../packages/thebe/node_modules/css-loader/dist/cjs.js!./codemirror.css\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import api from \"!../../../packages/thebe/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../packages/thebe/node_modules/css-loader/dist/cjs.js!./abcdef.css\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import api from \"!../../../packages/thebe/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../packages/thebe/node_modules/css-loader/dist/cjs.js!./darcula.css\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import api from \"!../../../packages/thebe/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../packages/thebe/node_modules/css-loader/dist/cjs.js!./idea.css\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of + + + + + diff --git a/pr-preview/pr-770/ipywidgets-local.html b/pr-preview/pr-770/ipywidgets-local.html new file mode 100644 index 00000000..58cc6855 --- /dev/null +++ b/pr-preview/pr-770/ipywidgets-local.html @@ -0,0 +1,168 @@ + + + + ipywidgets - Thebe Demo + + + + + + + + + + + +
+

ipywidgets using a local server

+

+ To use this demo you to to have a jupyter server available and able to receive connections + from localhost. To start a local server, use the following command: +

+

+ jupyter lab --NotebookApp.token= + --NotebookApp.allow_origin='*' --no-browser +

+
+
+

ipywidgets

+

A simple widgets example.

+
+# borrowed from https://jupyterlite.readthedocs.io/en/latest/_static/lab/index.html
+from ipywidgets import interact, IntSlider
+from IPython.display import Markdown, display
+
+slider = IntSlider()
+
+@interact(cookies=slider)
+def cookies(cookies=slider.value, calories=(0, 150)):
+    total_calories = calories * cookies
+    if cookies:
+        display(
+          Markdown(
+            f"If each cookie contains _{calories} calories_, \
+            _{cookies} cookies_ contain **{total_calories} calories**!"
+          )
+        )
+    else:
+        display(Markdown(f"No cookies!"))
+    if total_calories > 2000:
+        display(Markdown(f"> Maybe that's too many cookies..."))
+    
+ +

ipywidgets + matplotlib

+
+import numpy as np
+import matplotlib.pyplot as plt
+%matplotlib inline
+
+from ipywidgets import interact, interactive
+from IPython.display import clear_output, display, HTML
+
+import numpy as np
+from scipy import integrate
+
+from matplotlib import pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+from matplotlib.colors import cnames
+from matplotlib import animation
+
+def solve_lorenz(
+  N=10, angle=0.0, max_time=4.0, 
+  sigma=10.0, beta=8./3, rho=28.0):
+
+    fig = plt.figure()
+    ax = fig.add_axes([0, 0, 1, 1], projection='3d')
+    ax.axis('off')
+
+    # prepare the axes limits
+    ax.set_xlim((-25, 25))
+    ax.set_ylim((-35, 35))
+    ax.set_zlim((5, 55))
+    
+    def lorenz_deriv(x_y_z, t0, sigma=sigma, beta=beta, rho=rho):
+        """Compute the time-derivative of a Lorenz system."""
+        x, y, z = x_y_z
+        return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]
+
+    # Choose random starting points, uniformly distributed from -15 to 15
+    np.random.seed(1)
+    x0 = -15 + 30 * np.random.random((N, 3))
+
+    # Solve for the trajectories
+    t = np.linspace(0, max_time, int(250*max_time))
+    x_t = np.asarray([integrate.odeint(lorenz_deriv, x0i, t)
+                      for x0i in x0])
+    
+    # choose a different color for each trajectory
+    colors = plt.cm.viridis(np.linspace(0, 1, N))
+
+    for i in range(N):
+        x, y, z = x_t[i,:,:].T
+        lines = ax.plot(x, y, z, '-', c=colors[i])
+        plt.setp(lines, linewidth=2)
+
+    ax.view_init(30, angle)
+    plt.show()
+
+    return t, x_t
+
+w = interactive(solve_lorenz, angle=(0.,360.), max_time=(0.1, 4.0), 
+                N=(0,50), sigma=(0.0,50.0), rho=(0.0,50.0))
+display(w)
+    
+
+ + + diff --git a/pr-preview/pr-770/ipywidgets.html b/pr-preview/pr-770/ipywidgets.html new file mode 100644 index 00000000..3d508f52 --- /dev/null +++ b/pr-preview/pr-770/ipywidgets.html @@ -0,0 +1,149 @@ + + + + ipywidgets - Thebe Demo + + + + + + + + + + +
+

ipywidgets using mybinder.org

+

+ As with the binder example activating this page will connect to + the public my binder service at https://mybinder.org service. +

+

+ Although, here we launch from a different repo and create an ipywidgets based + plot using ipympl +

+

+ In addition, ipympl in turn requires font-awesome fonts to be + loaded on the page. Other ipywidgets based libraries and custom widgets may + also require additional fonts, css or libraries to be side loaded. +

+
+
+

ipywidgets

+

A simple widgets example.

+
+# borrowed from https://jupyterlite.readthedocs.io/en/latest/_static/lab/index.html
+from ipywidgets import interact, IntSlider
+from IPython.display import Markdown, display
+
+slider = IntSlider()
+
+@interact(cookies=slider)
+def cookies(cookies=slider.value, calories=(0, 150)):
+    total_calories = calories * cookies
+    if cookies:
+        display(
+          Markdown(
+            f"If each cookie contains _{calories} calories_, \
+            _{cookies} cookies_ contain **{total_calories} calories**!"
+          )
+        )
+    else:
+        display(Markdown(f"No cookies!"))
+    if total_calories > 2000:
+        display(Markdown(f"> Maybe that's too many cookies..."))
+    
+ +

ipywidgets + matplotlib

+
+import numpy as np
+import matplotlib.pyplot as plt
+%matplotlib inline
+
+from ipywidgets import interact, interactive
+from IPython.display import clear_output, display, HTML
+
+import numpy as np
+from scipy import integrate
+
+from matplotlib import pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+from matplotlib.colors import cnames
+from matplotlib import animation
+
+def solve_lorenz(
+  N=10, angle=0.0, max_time=4.0, 
+  sigma=10.0, beta=8./3, rho=28.0):
+
+    fig = plt.figure()
+    ax = fig.add_axes([0, 0, 1, 1], projection='3d')
+    ax.axis('off')
+
+    # prepare the axes limits
+    ax.set_xlim((-25, 25))
+    ax.set_ylim((-35, 35))
+    ax.set_zlim((5, 55))
+    
+    def lorenz_deriv(x_y_z, t0, sigma=sigma, beta=beta, rho=rho):
+        """Compute the time-derivative of a Lorenz system."""
+        x, y, z = x_y_z
+        return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]
+
+    # Choose random starting points, uniformly distributed from -15 to 15
+    np.random.seed(1)
+    x0 = -15 + 30 * np.random.random((N, 3))
+
+    # Solve for the trajectories
+    t = np.linspace(0, max_time, int(250*max_time))
+    x_t = np.asarray([integrate.odeint(lorenz_deriv, x0i, t)
+                      for x0i in x0])
+    
+    # choose a different color for each trajectory
+    colors = plt.cm.viridis(np.linspace(0, 1, N))
+
+    for i in range(N):
+        x, y, z = x_t[i,:,:].T
+        lines = ax.plot(x, y, z, '-', c=colors[i])
+        plt.setp(lines, linewidth=2)
+
+    ax.view_init(30, angle)
+    plt.show()
+
+    return t, x_t
+
+w = interactive(solve_lorenz, angle=(0.,360.), max_time=(0.1, 4.0), 
+                N=(0,50), sigma=(0.0,50.0), rho=(0.0,50.0))
+display(w)
+    
+
+ + diff --git a/pr-preview/pr-770/jupyter.html b/pr-preview/pr-770/jupyter.html new file mode 100644 index 00000000..18895bc0 --- /dev/null +++ b/pr-preview/pr-770/jupyter.html @@ -0,0 +1,91 @@ + + + + Jupyter - Thebe Demo + + + + + + + + + + +
+

Simple plots using a local server

+

+ To use this demo you to to have a jupyter server available and able to receive connections + from localhost. To start a local server, use the following command: +

+

+ jupyter lab --NotebookApp.token= + --NotebookApp.allow_origin='*' --no-browser +

+
+
+
+%matplotlib inline
+import numpy as np
+import matplotlib.pyplot as plt
+plt.ion()
+fig, ax = plt.subplots()
+ax.scatter(*np.random.randn(2, 100), c=np.random.randn(100))
+ax.set(title="Wow, an interactive plot!")
+      
+
+ + + diff --git a/pr-preview/pr-770/lite.html b/pr-preview/pr-770/lite.html new file mode 100644 index 00000000..c0b429e0 --- /dev/null +++ b/pr-preview/pr-770/lite.html @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + +
+

Simple plots using JupyterLite + pyodide-kernel

+

+ In this example, we connect to a pyodide kernel using wrapper classes and + in-browser Jupyter server the from the + jupyterlite project. +

+

+ Thebe code that uses jupyterlite has been bindles separately in the + thebe-lite library, which should be side-loaded on the page prior to + thebe being loaded. thebe-lite is not a standalone library but + when thebe is bootstrapped with the useJupyterLite option set, it + will detect and use thebe-lite or throw an error. +

+
+
+
+%matplotlib inline
+import numpy as np
+import matplotlib.pyplot as plt
+
+plt.ion()
+fig, ax = plt.subplots()
+ax.scatter(*np.random.randn(2, 100), c=np.random.randn(100))
+ax.set(title="Wow, an interactive plot!")
+      
+
+ + diff --git a/pr-preview/pr-770/main.css b/pr-preview/pr-770/main.css new file mode 100644 index 00000000..9f8c2434 --- /dev/null +++ b/pr-preview/pr-770/main.css @@ -0,0 +1,4 @@ +.thebe-activate, +.thebe-status { + margin-bottom: 8px; +} diff --git a/pr-preview/pr-770/mathjax.js b/pr-preview/pr-770/mathjax.js new file mode 100644 index 00000000..dba61b70 --- /dev/null +++ b/pr-preview/pr-770/mathjax.js @@ -0,0 +1,16 @@ +MathJax.Hub.Config({ + extensions: ['tex2jax.js'], + jax: ['input/TeX', 'output/HTML-CSS'], + tex2jax: { + inlineMath: [ + ['$', '$'], + ['\\(', '\\)'], + ], + displayMath: [ + ['$$', '$$'], + ['\\[', '\\]'], + ], + processEscapes: true, + }, + 'HTML-CSS': { fonts: ['TeX'] }, +}); diff --git a/pr-preview/pr-770/maths.html b/pr-preview/pr-770/maths.html new file mode 100644 index 00000000..488191cb --- /dev/null +++ b/pr-preview/pr-770/maths.html @@ -0,0 +1,106 @@ + + + + Maths - Thebe Demo + + + + + + + + + + + + +
+

Math Rendering Example

+

+ When using thebe you may need to load other assets onto the page in order for certain + jupyter outputs to display as expected. thebe loads css and other + assets for core @jupyterlab and ipywidgets modules, but leaves the + rest to the consumer. +

+

+ In this case, we're using Mathjax as a latex typesetter, so we need to preload that on our + page (view html source for details). +

+

+ To use this demo you to to have a jupyter server available and able to receive connections + from localhost. To start a local server, use the following command: +

+

+ jupyter lab --NotebookApp.token= + --NotebookApp.allow_origin='*' --no-browser +

+
+
+

maths with ipython display

+
+from IPython.display import Math
+Math(rf'\int_{{t=0}}^1 \frac{{1}}{{1+t^2}}\,\text{{d}}t = ')
+    
+

maths with LaTeX magic

+
+%%latex
+\begin{align}
+\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\
+\nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
+\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
+\nabla \cdot \vec{\mathbf{B}} & = -42
+\end{align}
+    
+
+ + + diff --git a/pr-preview/pr-770/paths.html b/pr-preview/pr-770/paths.html new file mode 100644 index 00000000..86c4c09b --- /dev/null +++ b/pr-preview/pr-770/paths.html @@ -0,0 +1,96 @@ + + + + Jupyter - Thebe Demo + + + + + + + + + +
+

Executing cells in context of the crrect notebook path

+

+ Even though thebe works with individual cells, it still executes them in the context of the + a session. Sessions pair an individual kernel with a notebook context that requires a notebook's location + to be specified. As no notebook exists this can see suplerflous but it is still required in order + to propoerly execute code that is dependent on relative paths. +

+

+ Consider a jupyter server started in a root folder, which in turn contains a folder called notebooks. + ipynb files are located in the notebooks folder and are developed with + paths suitable for locaing a data file in a data folder located in the same folder as the notebook. + Without the path being correctly set to the notebook's location, the code will fail to execute. +

+

+ To use this demo you will need to start a local jupyter folder in a root folder with the following structure: +

+        .
+        -- notebooks/
+           -- screening.ipynb 
+           -- data/
+              -- data.csv
+        
+ The file data.csv can contain anything and the notebook should simply include the following python code: + +
+            with open('data/data.csv', 'r') as f:
+                print(f.read())
+        
+

+ + to to have a jupyter server available and able to receive connections + from localhost. To start a local server, use the following command: +

+

+ jupyter lab --NotebookApp.token=test-secret --NotebookApp.allow_origin='*' +

+
+
+
+%matplotlib inline
+import numpy as np
+import pandas as pd
+import matplotlib.pyplot as plt
+
+df = pd.read_csv('data/data.csv')
+df.head()
+      
+
+ + diff --git a/pr-preview/pr-770/pypi/all.json b/pr-preview/pr-770/pypi/all.json new file mode 100644 index 00000000..e639d0dc --- /dev/null +++ b/pr-preview/pr-770/pypi/all.json @@ -0,0 +1,128 @@ +{ + "ipykernel": { + "releases": { + "6.9.2": [ + { + "comment_text": "", + "digests": { + "md5": "5f91018a6c5cde77b8ae2521cc2f78b4", + "sha256": "9525bc401a9257575e3564669404a0680276bb961538a3242bc191e35d7e2c75" + }, + "downloads": -1, + "filename": "ipykernel-6.9.2-py3-none-any.whl", + "has_sig": false, + "md5_digest": "5f91018a6c5cde77b8ae2521cc2f78b4", + "packagetype": "bdist_wheel", + "python_version": "py3", + "requires_python": ">=3.10", + "size": 2731, + "upload_time": "2024-09-03T08:29:30.141935Z", + "upload_time_iso_8601": "2024-09-03T08:29:30.141935Z", + "url": "./ipykernel-6.9.2-py3-none-any.whl", + "yanked": false, + "yanked_reason": null + } + ] + } + }, + "piplite": { + "releases": { + "0.4.2": [ + { + "comment_text": "", + "digests": { + "md5": "edff988393a9a2e5acd89cca9122a86b", + "sha256": "e508c140070243c175173ae64f8dda2d150276ea8fbdfd4f0af58c884fa0b30c" + }, + "downloads": -1, + "filename": "piplite-0.4.2-py3-none-any.whl", + "has_sig": false, + "md5_digest": "edff988393a9a2e5acd89cca9122a86b", + "packagetype": "bdist_wheel", + "python_version": "py3", + "requires_python": "<3.12,>=3.11", + "size": 7168, + "upload_time": "2024-09-03T08:29:30.141935Z", + "upload_time_iso_8601": "2024-09-03T08:29:30.141935Z", + "url": "./piplite-0.4.2-py3-none-any.whl", + "yanked": false, + "yanked_reason": null + } + ] + } + }, + "pyodide-kernel": { + "releases": { + "0.4.2": [ + { + "comment_text": "", + "digests": { + "md5": "5a8eb5ce00fe93d916afe21d0efc57cd", + "sha256": "6dd6f1d5124a77fa973b503cff9d8b0154c193022d2c5bd1d294fe2c1b39515c" + }, + "downloads": -1, + "filename": "pyodide_kernel-0.4.2-py3-none-any.whl", + "has_sig": false, + "md5_digest": "5a8eb5ce00fe93d916afe21d0efc57cd", + "packagetype": "bdist_wheel", + "python_version": "py3", + "requires_python": "<3.12,>=3.11", + "size": 11007, + "upload_time": "2024-09-03T08:29:30.141935Z", + "upload_time_iso_8601": "2024-09-03T08:29:30.141935Z", + "url": "./pyodide_kernel-0.4.2-py3-none-any.whl", + "yanked": false, + "yanked_reason": null + } + ] + } + }, + "widgetsnbextension": { + "releases": { + "3.6.999": [ + { + "comment_text": "", + "digests": { + "md5": "1b330bab5251a8c4b365eb4e73c7607d", + "sha256": "be7680deb1282135a439ab443248b49e053256477dec14ee71ad8f485bfe2e59" + }, + "downloads": -1, + "filename": "widgetsnbextension-3.6.999-py3-none-any.whl", + "has_sig": false, + "md5_digest": "1b330bab5251a8c4b365eb4e73c7607d", + "packagetype": "bdist_wheel", + "python_version": "py3", + "requires_python": "<3.12,>=3.11", + "size": 2367, + "upload_time": "2024-09-03T08:29:30.141935Z", + "upload_time_iso_8601": "2024-09-03T08:29:30.141935Z", + "url": "./widgetsnbextension-3.6.999-py3-none-any.whl", + "yanked": false, + "yanked_reason": null + } + ], + "4.0.999": [ + { + "comment_text": "", + "digests": { + "md5": "a924de0092ef40fe93fd4464d35e5be2", + "sha256": "9d88fa0e2e496413454a4bc215d2af9f0c33612ce6bb459bd1a61f4eec59358c" + }, + "downloads": -1, + "filename": "widgetsnbextension-4.0.999-py3-none-any.whl", + "has_sig": false, + "md5_digest": "a924de0092ef40fe93fd4464d35e5be2", + "packagetype": "bdist_wheel", + "python_version": "py3", + "requires_python": "<3.12,>=3.11", + "size": 2369, + "upload_time": "2024-09-03T08:29:30.141935Z", + "upload_time_iso_8601": "2024-09-03T08:29:30.141935Z", + "url": "./widgetsnbextension-4.0.999-py3-none-any.whl", + "yanked": false, + "yanked_reason": null + } + ] + } + } +} \ No newline at end of file diff --git a/pr-preview/pr-770/pypi/ipykernel-6.9.2-py3-none-any.whl b/pr-preview/pr-770/pypi/ipykernel-6.9.2-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..b32e1c5ac0556fd7a2026c5800d21bdde913b958 GIT binary patch literal 2731 zcmaKu2{hDu8^_0teXs2Mt_)+}-Yi1~jcp7O5ek(D~FjIk>Q?aCT4vWzv!mSr$w zO}1PaQIUypEtTBq-uK*I&RhTgdCu?r{^vZO^PKPh_j|q%!V1L52LJ$A0b{1JE^!tH z&dLn*9S{KEr+@Vixg6jV7UUDC>fzxZ%ZS6r^hi z8l8L+BF!0ssXW3XZY!Yr86So5s=;*3>dg>0w-w!&)Zs3|mwG^nM_#DE2pJ|6&hISy zXR}c1|9I_wOvAe+KD2q4s3u(!J&`hv^R$j0LCDoKYdbv-?UVO>FbYMN*5|qjd#4&FBQ>VW z^hvStQS9c7u8S7sQjBC097u@$ck*!i3KyCBU4yCkok+fHaR&jmKnx41MT6}z+ z3utI{Y3<eeylXZC8z^-@BJQWO@BA918M5XY>uc0(^Zk*1sT>zKTPeFuffJBz|D<2ax7 z>*TCq{j`zl({QYQ#>X>gk>jC!!6VaXIp3C>DP>}PdD-ZeOA)?_{EETlGBJ1Ol%B;W zOnx@#H%hu!brM`y<6dQ0xSXU;XnFj&dx2M-ZAR!;=jbfbjKezJ*WzAV_howocIy1P zrTdDL@*|p$zTl|s6}vMXjaNdT4?3-yeow9=M|&9#@Vs5I699kZTo_WUyqcDV*t$sB z_zWKya=xx?G30G&P9i>SP)}P+B(P46FP`BDjeN>^)S=E4FS^eAaBNR*&Rm1jP^K)g zjc+olG+{i{h*~PHma{Gxwfugur??`ts*+tCbsrsX#NWDK>4d30v=d!nXL?BfQfX&P z7|fbu(9(u9%w?sbL>?F6ax1 z`k(g+3ik+!bGz|4l)9H`BqGh1d3wIr-^nH>Ks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Cr!>sKd|bg`fo2`WQQ5 zA_=JXNqLk-1l{B>&II@ep}1z`O>xdbnG6^wqL zqF2;#Z4h)A3Yj zM~Cc}yJDT!KMq_t!*}g%O22egz;^Z3>Z@o1d$f&fTv-g4B!AMX(C?qE(@eXBz5H$& zo{*6p$R1=Q{?0dtMIi@;wAD+ZsOb6wykiF4n&dSNCAYu6P#p_sVH1$JCg)DaxyL$D z8FG?Gl}tcC1o>3xgs81l-Y`DIybIVOf4w~aqXrh)q*;t+psq-~JFvczZCq=!h(P)} z;GHvVRxupgFT|o|W^<{I(YbI;yef+-#`_TM-G_20Z?^&cMUEjamZ9AIeV=_0qgu>i zPGHG7_GB&gU9mFPC~Q6d>T52u9%T8QzE$j`xcUonU^=8l)XAb!Nm$b4 zir=E_IB$gQ+$vJwm1AVIoB}Cz$}qI%baegMn+DC8%vA4$jGL3UbSur$5tTGOFEspb z(6rT1P|48#^~~pYVE*g+9Q>b;|7Qa9C&8bCn18?lfX~4t|A*ioW0^m(e>TGY!a896 z_42>kVt?ZQEDin_kCObmulC=#f7)RGQz-n&_NN^E#pd?=d;Kf6{}QJ^ss0p_zo<~i s|25U0vhpYEpBeNQs|Dr1X8lJ#X{%xUo|XXsSikS9-&uG{^`EQ%092gPwEzGB literal 0 HcmV?d00001 diff --git a/pr-preview/pr-770/pypi/pyodide_kernel-0.4.2-py3-none-any.whl b/pr-preview/pr-770/pypi/pyodide_kernel-0.4.2-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..f6205016f169d8420c01c797f7cf0dc7f5f2948c GIT binary patch literal 11007 zcmai)1yJ1EvafNsV8PwV-~`v;?(XjH?(QBS5Hz?axVyW%yUXA_&bja1{WkmFIy3d3 zshXPr=7Q_7$qAOm0^AUN;8+PT{rnHw4FS{ggp z7+cZn>YCe_JL&4u*||F>RNHhDp@g_*Z3(3qQAtc!;4`Tl$x$Qohc(U&U{P%polOI+ z#HPuP3<#eI-^PDzWZG_ekCeMk=sTHh{!B+=#S>WqE}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@X>hVp{iFv2Z|G=w5#cP#auM0siW>WZReb(qtCjHRo^<2N70)rzdDSWUEP{I zNyWm5QHn1Vb1|PiK&RJ7{T$%CT$7k*)BQS+i(;@&*W8hS?C<$&Eafp_r(E3=D`Pdl?tDLXm5%icO1{LJs_oxGyoH*PVMl^YjpW zr~(_2Y$=;UG7si4d6rzJoeb@-?>7V}7&`d>J`VTp!vB8d`~U0fe;cUkg*^MB{MJ~BQ|9{t52e!s;&F#eiD`iS{B{qYxO=lvr5fcg6@$Vb%2Zueg( zzW33R52*jI_x+Lcv7G%Er|{E1IR9PT{z&;)8~Tfq{XRVRVKpBsMgM?($ix1E`QiQp z_W!c7kC2ag{4YrB``pck75$~oKVm*A*#E|WP7!>>{I7cUBlM#x`wOZ_^dF)B)@UDz zANAB<#N+=={HU%z!arUlf5BznHRa#8@*jKfU)PG9BqY?o{)YJeUU`og#D8T2ApZyC C!OJlK literal 0 HcmV?d00001 diff --git a/pr-preview/pr-770/pypi/widgetsnbextension-3.6.999-py3-none-any.whl b/pr-preview/pr-770/pypi/widgetsnbextension-3.6.999-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..210cfb5e1e5006eae06ae1e8f7c49f8cdab7c4a4 GIT binary patch literal 2367 zcma)7c{tQ-8~zz&%cSgU*)`1AX+AjyO_QG7{E&3;#h;}XOaO4e z0Q9Fxq3SR#7#t3Vx#0o`P@MNQA7wM7mHq{NEB!#C3;MMRPfX*ytypZn^W`ywou!L6 zuUud}R!`g0XPKfUm{v3r?z7Zq&KW_hlMi0o9nW6CBqaaQee-JCt1}XX(cUW2!4PeQ z@#0U0U7sEQi{_s04bc!Oz+ER8B01lYaaGHG_0xh%GPiEE8Khpeolv!s8pt!LkSrLn zcJNJmSw-e0XmZGrr%9+p^1|_f8)K*zSo9-t5-W=w{!Mowf6x_oD;8ZLN36KpHF`U~ z{BeOvNqwHC%hrw=;^C|J{$N*6@kW>7#?p-5C*)gAgBfBw3k_U~ktKAOP_=UnFWCp< z9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zI&N2H@--r{Ma2t`4EifDytG^r_k6265V);dy^`Xbyt~yvY5IcC(#WalDOI}EzQYA!o$cJ-0Z&|jIw2qj!<&PE=mbZ>Q5@zSI?y`F*Rbn zDT(&E9RFdhAFLvF+~r|b*#&Xf%>)2XnF4>x z^$(_cnEJ2{e5d9C{jAKNQ2%8Lhj|YV@bA3OkIH*^oF7hcSh?R*2pv0O>3{3k0?o>} R0069vUB~za-fZ8Z{{c9))i3}6 literal 0 HcmV?d00001 diff --git a/pr-preview/pr-770/pypi/widgetsnbextension-4.0.999-py3-none-any.whl b/pr-preview/pr-770/pypi/widgetsnbextension-4.0.999-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..600eee3b5cb1cc0eb182cdd63c2066af9416683a GIT binary patch literal 2369 zcma)7cU03?8~%|nRRX1K1ZB?z5F`y$b{Gi={MZx-R8k3q9fnrw$6m4mC{&RT0!1h& zdzMN>Kq_GwhE!xPSwd8XfQ{`R9{K!wxc9v0p7)RYJny;hbKl1r3uWa80Du#q8%jG1 z4VhJ-nAyjWU`9B>>oT4c;{QE9f`s=EAq4oV;&23i0ttsh1YWTP!C*UuehYIexMCj` zQ>kE1Q|{~Sw|zph>T>|WnVIBtRV*CB)!D5)rlgR!B(mh};-VD90$6`Wnmk?91+p;N zAOHaWA}L%Gp@u-APzWzV2nkN`{~)nlW*)L+w=D27~`5FGOa1E1asN zFDhnc#3rZR7}xYdw8>10Ix(h_&Ryq4mf&c#>e$lOQC zf3PJZHTL;5SMKjo5Hnd#qbp^emq|wG6IcG!91rzb-4Q>TxyI^d8J)D&RLn<_)sCru)d*H&r#)l5SfW_Of;4^O@*PD440ueo?KtwD zdk1c3PnH=}ww0nhcUol6T27%6H()?A;!tv!G)ZPV=T36l5Y~<(BSSpym&JFWbaKgS4GOLosf{Bw zSrn&8=;zIeAOApdU^c~(8A``(j-weGZE>>S%#t?9jfE>QHBk$y(KV)mt!P*{Mx{r! z27F?sV&3^-tDK(U_#Q;OU zW+*iukq&DWnJ5GWfDJYPIDg#gh=fZ_E#pH}EzFJ37j4lwAl3iRZ+P1n%Ip`;pY(e- z@ZGktZ5=I6rCdf})D&GL1|fSVlA`w`6Y64`S~~^X#-#gtZ*RZs#oT(mY^4>p=usHl zmLDS61_vL9x{>V#1Gx+2XEE z{3tymBu~b`#3^dQt(Ob8Op)PFl}{g>i-WkkUV}WGyM8^*Yb!>l<##N=MoNjxa+4FH zh)>n+Tt<5E7PKVl2^w?_K5W_*d-IcotIvsMLd~XzB+1zYXzvkYtgAOgKZnr#<@W^3Ka9R85e zzMIswLH^ILb=2*}o<4P*6sIwU(B8UwV>^BNrW-OoJe~1<@GSR1#k~duvSjXsrB&)nuZVq~gNvbaMhMq2J= zFXy2!Zs^g2ZRoVudy@Xx!jLn3nY8fqtGK{Sj|Rh-o4&QB$LLazS5`|ffrJj>c(ahd&-kF4H?>1S(@umso~-2U zGHga;!DoWr4mQ=Z^A|35C$*o6@Y4?<*dN&8XAWb!1Wd^!`yjG>;UAzvp9PsAp-zJB z+OsXiYh*$Wb11^)uucJ6hALdplblU5Mc!MRRaK$pS2=9D&D_vk3M)xftDLUNtg$fp znl>Ec;rf9)hyJ|MfdRqzcuU;i^%nR=-M!w$>zT1%6XS+)4IG0}z$a)vrfdIinO}hZ+Z2xC9v$GHaI21sdvu&1r8uhGPZXl;$1MFH W9b04Bm=^$mjk#Ny-yo3VWA+yv#ma*K literal 0 HcmV?d00001 diff --git a/pr-preview/pr-770/service-worker.js b/pr-preview/pr-770/service-worker.js new file mode 100644 index 00000000..65801cef --- /dev/null +++ b/pr-preview/pr-770/service-worker.js @@ -0,0 +1 @@ +"use strict";const CACHE="precache",broadcast=new BroadcastChannel("/api/drive.v1");let enableCache=!1;function onInstall(a){self.skipWaiting(),a.waitUntil(cacheAll())}function onActivate(a){const e=new URL(location.href).searchParams;enableCache="true"===e.get("enableCache"),a.waitUntil(self.clients.claim())}async function onFetch(a){const{request:e}=a,t=new URL(a.request.url);let n=null;shouldBroadcast(t)?n=broadcastOne(e):shouldDrop(e,t)||(n=maybeFromCache(a)),n&&a.respondWith(n)}async function maybeFromCache(a){const{request:e}=a;if(!enableCache)return await fetch(e);let t=await fromCache(e);return t?a.waitUntil(refetch(e)):(t=await fetch(e),a.waitUntil(updateCache(e,t.clone()))),t}async function fromCache(a){const e=await openCache(),t=await e.match(a);return t&&404!==t.status?t:null}async function refetch(a){const e=await fetch(a);return await updateCache(a,e),e}function shouldBroadcast(a){return a.origin===location.origin&&a.pathname.includes("/api/drive")}function shouldDrop(a,e){return"GET"!==a.method||null===e.origin.match(/^http/)||e.pathname.includes("/api/")}async function broadcastOne(a){const e=new Promise((a=>{broadcast.onmessage=e=>{a(new Response(JSON.stringify(e.data)))}})),t=await a.json();return t.receiver="broadcast.ts",broadcast.postMessage(t),await e}async function openCache(){return await caches.open(CACHE)}async function updateCache(a,e){return(await openCache()).put(a,e)}async function cacheAll(){const a=await openCache();return await a.addAll([])}self.addEventListener("install",onInstall),self.addEventListener("activate",onActivate),self.addEventListener("fetch",onFetch); \ No newline at end of file diff --git a/pr-preview/pr-770/thebe-lite.min.js b/pr-preview/pr-770/thebe-lite.min.js new file mode 100644 index 00000000..eb8804d7 --- /dev/null +++ b/pr-preview/pr-770/thebe-lite.min.js @@ -0,0 +1,3 @@ +/*! For license information please see thebe-lite.min.js.LICENSE.txt */ +(()=>{var __webpack_modules__={9704:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivityMonitor=void 0;const i=n(8571);t.ActivityMonitor=class{constructor(e){this._timer=-1,this._timeout=-1,this._isDisposed=!1,this._activityStopped=new i.Signal(this),e.signal.connect(this._onSignalFired,this),this._timeout=e.timeout||1e3}get activityStopped(){return this._activityStopped}get timeout(){return this._timeout}set timeout(e){this._timeout=e}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,i.Signal.clearData(this))}_onSignalFired(e,t){clearTimeout(this._timer),this._sender=e,this._args=t,this._timer=setTimeout((()=>{this._activityStopped.emit({sender:this._sender,args:this._args})}),this._timeout)}}},8925:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),s(n(9704),t),s(n(9269),t),s(n(1232),t),s(n(9547),t),s(n(5964),t),s(n(9830),t),s(n(7361),t),s(n(8126),t),s(n(1796),t),s(n(1692),t)},9269:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1232:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LruCache=void 0,t.LruCache=class{constructor(e={}){this._map=new Map,this._maxSize=(null==e?void 0:e.maxSize)||128}get size(){return this._map.size}clear(){this._map.clear()}get(e){const t=this._map.get(e)||null;return null!=t&&(this._map.delete(e),this._map.set(e,t)),t}set(e,t){this._map.size>=this._maxSize&&this._map.delete(this._map.keys().next().value),this._map.set(e,t)}}},9547:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownCodeBlocks=void 0,function(e){e.CODE_BLOCK_MARKER="```";const t=[".markdown",".mdown",".mkdn",".md",".mkd",".mdwn",".mdtxt",".mdtext",".text",".txt",".Rmd"];class n{constructor(e){this.startLine=e,this.code="",this.endLine=-1}}e.MarkdownCodeBlock=n,e.isMarkdown=function(e){return t.indexOf(e)>-1},e.findMarkdownCodeBlocks=function(t){if(!t||""===t)return[];const i=t.split("\n"),s=[];let r=null;for(let t=0;te===t||i&&e===i))},e.isDisabled=function(t){const n=t.indexOf(":");let i="";return-1!==n&&(i=t.slice(0,n)),e.disabled.some((e=>e===t||i&&e===i))}}(Extension=PageConfig.Extension||(PageConfig.Extension={}))})(PageConfig||(exports.PageConfig=PageConfig={}))},9830:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PathExt=void 0;const i=n(9942);var s;!function(e){function t(e){return 0===e.indexOf("/")&&(e=e.slice(1)),e}e.join=function(...e){const n=i.posix.join(...e);return"."===n?"":t(n)},e.joinWithLeadingSlash=function(...e){const t=i.posix.join(...e);return"."===t?"":t},e.basename=function(e,t){return i.posix.basename(e,t)},e.dirname=function(e){const n=t(i.posix.dirname(e));return"."===n?"":n},e.extname=function(e){return i.posix.extname(e)},e.normalize=function(e){return""===e?"":t(i.posix.normalize(e))},e.resolve=function(...e){return t(i.posix.resolve(...e))},e.relative=function(e,n){return t(i.posix.relative(e,n))},e.normalizeExtension=function(e){return e.length>0&&0!==e.indexOf(".")&&(e=`.${e}`),e},e.removeSlash=t}(s||(t.PathExt=s={}))},7361:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signalToPromise=void 0;const i=n(5764);t.signalToPromise=function(e,t){const n=new i.PromiseDelegate;function s(){e.disconnect(r)}function r(e,t){s(),n.resolve([e,t])}return e.connect(r),(null!=t?t:0)>0&&setTimeout((()=>{s(),n.reject(`Signal not emitted within ${t} ms.`)}),t),n.promise}},8126:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Text=void 0,function(e){e.jsIndexToCharIndex=function(e,t){return e},e.charIndexToJsIndex=function(e,t){return e},e.camelCase=function(e,t=!1){return e.replace(/^(\w)|[\s-_:]+(\w)/g,(function(e,n,i){return i?i.toUpperCase():t?n.toUpperCase():n.toLowerCase()}))},e.titleCase=function(e){return(e||"").toLowerCase().split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}}(n||(t.Text=n={}))},1796:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Time=void 0;const n=[{name:"years",milliseconds:31536e6},{name:"months",milliseconds:2592e6},{name:"days",milliseconds:864e5},{name:"hours",milliseconds:36e5},{name:"minutes",milliseconds:6e4},{name:"seconds",milliseconds:1e3}];var i;!function(e){e.formatHuman=function(e,t="long"){const i=document.documentElement.lang||"en",s=new Intl.RelativeTimeFormat(i,{numeric:"auto",style:t}),r=new Date(e).getTime()-Date.now();for(let e of n){const t=Math.ceil(r/e.milliseconds);if(0!==t)return s.format(t,e.name)}return s.format(0,"seconds")},e.format=function(e){const t=document.documentElement.lang||"en";return new Intl.DateTimeFormat(t,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}}(i||(t.Time=i={}))},1692:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.URLExt=void 0;const s=n(9942),r=i(n(2225));var o;!function(e){function t(e){if("undefined"!=typeof document&&document){const t=document.createElement("a");return t.href=e,t}return(0,r.default)(e)}function n(...e){let t=(0,r.default)(e[0],{});const n=""===t.protocol&&t.slashes;n&&(t=(0,r.default)(e[0],"https:"+e[0]));const i=`${n?"":t.protocol}${t.slashes?"//":""}${t.auth}${t.auth?"@":""}${t.host}`,o=s.posix.join(`${i&&"/"!==t.pathname[0]?"/":""}${t.pathname}`,...e.slice(1));return`${i}${"."===o?"":o}`}e.parse=t,e.getHostName=function(e){return(0,r.default)(e).hostname},e.normalize=function(e){return e&&t(e).toString()},e.join=n,e.encodeParts=function(e){return n(...e.split("/").map(encodeURIComponent))},e.objectToQueryString=function(e){const t=Object.keys(e).filter((e=>e.length>0));return t.length?"?"+t.map((t=>{const n=encodeURIComponent(String(e[t]));return t+(n?"="+n:"")})).join("&"):""},e.queryStringToObject=function(e){return e.replace(/^\?/,"").split("&").reduce(((e,t)=>{const[n,i]=t.split("=");return n.length>0&&(e[n]=decodeURIComponent(i||"")),e}),{})},e.isLocal=function(e,n=!1){const{protocol:i}=t(e);return(!i||0!==e.toLowerCase().indexOf(i))&&(n?0!==e.indexOf("//"):0!==e.indexOf("/"))}}(o||(t.URLExt=o={}))},3867:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseManager=void 0;const i=n(8571),s=n(2920);t.BaseManager=class{constructor(e){var t;this._isDisposed=!1,this._disposed=new i.Signal(this),this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:s.ServerConnection.makeSettings()}get disposed(){return this._disposed}get isDisposed(){return this._isDisposed}get isActive(){return!0}dispose(){this.isDisposed||(this._isDisposed=!0,this._disposed.emit(void 0),i.Signal.clearData(this))}}},4219:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BuildManager=void 0;const i=n(8925),s=n(2920);t.BuildManager=class{constructor(e={}){var t;this._url="",this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:s.ServerConnection.makeSettings();const{baseUrl:n,appUrl:r}=this.serverSettings;this._url=i.URLExt.join(n,r,"api/build")}get isAvailable(){return"true"===i.PageConfig.getOption("buildAvailable").toLowerCase()}get shouldCheck(){return"true"===i.PageConfig.getOption("buildCheck").toLowerCase()}getStatus(){const{_url:e,serverSettings:t}=this;return s.ServerConnection.makeRequest(e,{},t).then((e=>{if(200!==e.status)throw new s.ServerConnection.ResponseError(e);return e.json()})).then((e=>{if("string"!=typeof e.status)throw new Error("Invalid data");if("string"!=typeof e.message)throw new Error("Invalid data");return e}))}build(){const{_url:e,serverSettings:t}=this;return s.ServerConnection.makeRequest(e,{method:"POST"},t).then((e=>{if(400===e.status)throw new s.ServerConnection.ResponseError(e,"Build aborted");if(200!==e.status){const t=`Build failed with ${e.status}.\n\n If you are experiencing the build failure after installing an extension (or trying to include previously installed extension after updating JupyterLab) please check the extension repository for new installation instructions as many extensions migrated to the prebuilt extensions system which no longer requires rebuilding JupyterLab (but uses a different installation procedure, typically involving a package manager such as 'pip' or 'conda').\n\n If you specifically intended to install a source extension, please run 'jupyter lab build' on the server for full output.`;throw new s.ServerConnection.ResponseError(e,t)}}))}cancel(){const{_url:e,serverSettings:t}=this;return s.ServerConnection.makeRequest(e,{method:"DELETE"},t).then((e=>{if(204!==e.status)throw new s.ServerConnection.ResponseError(e)}))}}},2170:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigWithDefaults=t.ConfigSection=void 0;const i=n(8925),s=n(7883);var r;!function(e){e.create=function(e){const t=new o(e);return t.load().then((()=>t))}}(r||(t.ConfigSection=r={}));class o{constructor(e){var t;this._url="unknown";const n=this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:s.ServerConnection.makeSettings();this._url=i.URLExt.join(n.baseUrl,"api/config",encodeURIComponent(e.name))}get data(){return this._data}async load(){const e=await s.ServerConnection.makeRequest(this._url,{},this.serverSettings);if(200!==e.status)throw await s.ServerConnection.ResponseError.create(e);this._data=await e.json()}async update(e){this._data={...this._data,...e};const t={method:"PATCH",body:JSON.stringify(e)},n=await s.ServerConnection.makeRequest(this._url,t,this.serverSettings);if(200!==n.status)throw await s.ServerConnection.ResponseError.create(n);return this._data=await n.json(),this._data}}t.ConfigWithDefaults=class{constructor(e){var t,n;this._className="",this._section=e.section,this._defaults=null!==(t=e.defaults)&&void 0!==t?t:{},this._className=null!==(n=e.className)&&void 0!==n?n:""}get(e){const t=this._classData();return e in t?t[e]:this._defaults[e]}set(e,t){const n={};if(n[e]=t,this._className){const e={};return e[this._className]=n,this._section.update(e)}return this._section.update(n)}_classData(){const e=this._section.data;return this._className&&this._className in e?e[this._className]:e}}},8790:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Drive=t.ContentsManager=t.Contents=void 0;const o=n(8925),a=n(8571),l=n(7883),u=r(n(2706));var c,d;!function(e){e.validateContentsModel=function(e){u.validateContentsModel(e)},e.validateCheckpointModel=function(e){u.validateCheckpointModel(e)}}(c||(t.Contents=c={})),t.ContentsManager=class{constructor(e={}){var t,n;this._isDisposed=!1,this._additionalDrives=new Map,this._fileChanged=new a.Signal(this);const i=this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:l.ServerConnection.makeSettings();this._defaultDrive=null!==(n=e.defaultDrive)&&void 0!==n?n:new h({serverSettings:i}),this._defaultDrive.fileChanged.connect(this._onFileChanged,this)}get fileChanged(){return this._fileChanged}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}addDrive(e){this._additionalDrives.set(e.name,e),e.fileChanged.connect(this._onFileChanged,this)}getSharedModelFactory(e){var t;const[n]=this._driveForPath(e);return null!==(t=null==n?void 0:n.sharedModelFactory)&&void 0!==t?t:null}localPath(e){const t=e.split("/"),n=t[0].split(":");return 1!==n.length&&this._additionalDrives.has(n[0])?o.PathExt.join(n.slice(1).join(":"),...t.slice(1)):o.PathExt.removeSlash(e)}normalize(e){const t=e.split(":");return 1===t.length?o.PathExt.normalize(e):`${t[0]}:${o.PathExt.normalize(t.slice(1).join(":"))}`}resolvePath(e,t){const n=this.driveName(e),i=this.localPath(e),s=o.PathExt.resolve("/",i,t);return n?`${n}:${s}`:s}driveName(e){const t=e.split("/")[0].split(":");return 1===t.length?"":this._additionalDrives.has(t[0])?t[0]:""}get(e,t){const[n,i]=this._driveForPath(e);return n.get(i,t).then((e=>{const t=[];if("directory"===e.type&&e.content){for(const i of e.content)t.push({...i,path:this._toGlobalPath(n,i.path)});return{...e,path:this._toGlobalPath(n,i),content:t,serverPath:e.path}}return{...e,path:this._toGlobalPath(n,i),serverPath:e.path}}))}getDownloadUrl(e){const[t,n]=this._driveForPath(e);return t.getDownloadUrl(n)}newUntitled(e={}){if(e.path){const t=this.normalize(e.path),[n,i]=this._driveForPath(t);return n.newUntitled({...e,path:i}).then((e=>({...e,path:o.PathExt.join(t,e.name),serverPath:e.path})))}return this._defaultDrive.newUntitled(e)}delete(e){const[t,n]=this._driveForPath(e);return t.delete(n)}rename(e,t){const[n,i]=this._driveForPath(e),[s,r]=this._driveForPath(t);if(n!==s)throw Error("ContentsManager: renaming files must occur within a Drive");return n.rename(i,r).then((e=>({...e,path:this._toGlobalPath(n,r),serverPath:e.path})))}save(e,t={}){const n=this.normalize(e),[i,s]=this._driveForPath(e);return i.save(s,{...t,path:s}).then((e=>({...e,path:n,serverPath:e.path})))}copy(e,t){const[n,i]=this._driveForPath(e),[s,r]=this._driveForPath(t);if(n===s)return n.copy(i,r).then((e=>({...e,path:this._toGlobalPath(n,e.path),serverPath:e.path})));throw Error("Copying files between drives is not currently implemented")}createCheckpoint(e){const[t,n]=this._driveForPath(e);return t.createCheckpoint(n)}listCheckpoints(e){const[t,n]=this._driveForPath(e);return t.listCheckpoints(n)}restoreCheckpoint(e,t){const[n,i]=this._driveForPath(e);return n.restoreCheckpoint(i,t)}deleteCheckpoint(e,t){const[n,i]=this._driveForPath(e);return n.deleteCheckpoint(i,t)}_toGlobalPath(e,t){return e===this._defaultDrive?o.PathExt.removeSlash(t):`${e.name}:${o.PathExt.removeSlash(t)}`}_driveForPath(e){const t=this.driveName(e),n=this.localPath(e);return t?[this._additionalDrives.get(t),n]:[this._defaultDrive,n]}_onFileChanged(e,t){var n,i;if(e===this._defaultDrive)this._fileChanged.emit(t);else{let s=null,r=null;(null===(n=t.newValue)||void 0===n?void 0:n.path)&&(s={...t.newValue,path:this._toGlobalPath(e,t.newValue.path)}),(null===(i=t.oldValue)||void 0===i?void 0:i.path)&&(r={...t.oldValue,path:this._toGlobalPath(e,t.oldValue.path)}),this._fileChanged.emit({type:t.type,newValue:s,oldValue:r})}}};class h{constructor(e={}){var t,n,i;this._isDisposed=!1,this._fileChanged=new a.Signal(this),this.name=null!==(t=e.name)&&void 0!==t?t:"Default",this._apiEndpoint=null!==(n=e.apiEndpoint)&&void 0!==n?n:"api/contents",this.serverSettings=null!==(i=e.serverSettings)&&void 0!==i?i:l.ServerConnection.makeSettings()}get fileChanged(){return this._fileChanged}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}async get(e,t){let n=this._getUrl(e);if(t){"notebook"===t.type&&delete t.format;const e=t.content?"1":"0",i=t.hash?"1":"0",s={...t,content:e,hash:i};n+=o.URLExt.objectToQueryString(s)}const i=this.serverSettings,s=await l.ServerConnection.makeRequest(n,{},i);if(200!==s.status)throw await l.ServerConnection.ResponseError.create(s);const r=await s.json();return u.validateContentsModel(r),r}getDownloadUrl(e){const t=this.serverSettings.baseUrl;let n=o.URLExt.join(t,"files",o.URLExt.encodeParts(e)),i="";try{i=document.cookie}catch(e){}const s=i.match("\\b_xsrf=([^;]*)\\b");if(s){const e=new URL(n);e.searchParams.append("_xsrf",s[1]),n=e.toString()}return Promise.resolve(n)}async newUntitled(e={}){var t;let n="{}";e&&(e.ext&&(e.ext=d.normalizeExtension(e.ext)),n=JSON.stringify(e));const i=this.serverSettings,s=this._getUrl(null!==(t=e.path)&&void 0!==t?t:""),r={method:"POST",body:n},o=await l.ServerConnection.makeRequest(s,r,i);if(201!==o.status)throw await l.ServerConnection.ResponseError.create(o);const a=await o.json();return u.validateContentsModel(a),this._fileChanged.emit({type:"new",oldValue:null,newValue:a}),a}async delete(e){const t=this._getUrl(e),n=this.serverSettings,i=await l.ServerConnection.makeRequest(t,{method:"DELETE"},n);if(204!==i.status)throw await l.ServerConnection.ResponseError.create(i);this._fileChanged.emit({type:"delete",oldValue:{path:e},newValue:null})}async rename(e,t){const n=this.serverSettings,i=this._getUrl(e),s={method:"PATCH",body:JSON.stringify({path:t})},r=await l.ServerConnection.makeRequest(i,s,n);if(200!==r.status)throw await l.ServerConnection.ResponseError.create(r);const o=await r.json();return u.validateContentsModel(o),this._fileChanged.emit({type:"rename",oldValue:{path:e},newValue:o}),o}async save(e,t={}){const n=this.serverSettings,i=this._getUrl(e),s={method:"PUT",body:JSON.stringify(t)},r=await l.ServerConnection.makeRequest(i,s,n);if(200!==r.status&&201!==r.status)throw await l.ServerConnection.ResponseError.create(r);const o=await r.json();return u.validateContentsModel(o),this._fileChanged.emit({type:"save",oldValue:null,newValue:o}),o}async copy(e,t){const n=this.serverSettings,i=this._getUrl(t),s={method:"POST",body:JSON.stringify({copy_from:e})},r=await l.ServerConnection.makeRequest(i,s,n);if(201!==r.status)throw await l.ServerConnection.ResponseError.create(r);const o=await r.json();return u.validateContentsModel(o),this._fileChanged.emit({type:"new",oldValue:null,newValue:o}),o}async createCheckpoint(e){const t=this._getUrl(e,"checkpoints"),n=await l.ServerConnection.makeRequest(t,{method:"POST"},this.serverSettings);if(201!==n.status)throw await l.ServerConnection.ResponseError.create(n);const i=await n.json();return u.validateCheckpointModel(i),i}async listCheckpoints(e){const t=this._getUrl(e,"checkpoints"),n=await l.ServerConnection.makeRequest(t,{},this.serverSettings);if(200!==n.status)throw await l.ServerConnection.ResponseError.create(n);const i=await n.json();if(!Array.isArray(i))throw new Error("Invalid Checkpoint list");for(let e=0;eo.URLExt.encodeParts(e))),n=this.serverSettings.baseUrl;return o.URLExt.join(n,this._apiEndpoint,...t)}}t.Drive=h,function(e){e.normalizeExtension=function(e){return e.length>0&&0!==e.indexOf(".")&&(e=`.${e}`),e}}(d||(d={}))},2706:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateCheckpointModel=t.validateContentsModel=void 0;const i=n(7441);t.validateContentsModel=function(e){(0,i.validateProperty)(e,"name","string"),(0,i.validateProperty)(e,"path","string"),(0,i.validateProperty)(e,"type","string"),(0,i.validateProperty)(e,"created","string"),(0,i.validateProperty)(e,"last_modified","string"),(0,i.validateProperty)(e,"mimetype","object"),(0,i.validateProperty)(e,"content","object"),(0,i.validateProperty)(e,"format","object")},t.validateCheckpointModel=function(e){(0,i.validateProperty)(e,"id","string"),(0,i.validateProperty)(e,"last_modified","string")}},9480:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventManager=void 0;const i=n(8925),s=n(6049),r=n(8571),o=n(2920),a="api/events";t.EventManager=class{constructor(e={}){var t;this._socket=null,this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:o.ServerConnection.makeSettings(),this._poll=new s.Poll({factory:()=>this._subscribe()}),this._stream=new r.Stream(this),this._poll.start()}get isDisposed(){return this._poll.isDisposed}get stream(){return this._stream}dispose(){if(this.isDisposed)return;this._poll.dispose();const e=this._socket;e&&(this._socket=null,e.onopen=()=>{},e.onerror=()=>{},e.onmessage=()=>{},e.onclose=()=>{},e.close()),r.Signal.clearData(this),this._stream.stop()}async emit(e){const{serverSettings:t}=this,{baseUrl:n}=t,{makeRequest:s,ResponseError:r}=o.ServerConnection,l=i.URLExt.join(n,a),u={body:JSON.stringify(e),method:"POST"},c=await s(l,u,t);if(204!==c.status)throw new r(c)}_subscribe(){return new Promise(((e,t)=>{if(this.isDisposed)return;const{appendToken:n,token:s,WebSocket:r,wsUrl:o}=this.serverSettings;let l=i.URLExt.join(o,a,"subscribe");n&&""!==s&&(l+=`?token=${encodeURIComponent(s)}`);const u=this._socket=new r(l),c=this._stream;u.onclose=()=>t(new Error("EventManager socket closed")),u.onmessage=e=>e.data&&c.emit(JSON.parse(e.data))}))}}},7883:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),s(n(3867),t),s(n(2170),t),s(n(8790),t),s(n(9480),t),s(n(973),t),s(n(2946),t),s(n(9740),t),s(n(2920),t),s(n(7668),t),s(n(7780),t),s(n(9040),t),s(n(9191),t),s(n(8053),t),s(n(8683),t)},7489:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.CommHandler=void 0;const o=n(7556),a=r(n(9909));class l extends o.DisposableDelegate{constructor(e,t,n,i){super(i),this._target="",this._id="",this._id=t,this._target=e,this._kernel=n}get commId(){return this._id}get targetName(){return this._target}get onClose(){return this._onClose}set onClose(e){this._onClose=e}get onMsg(){return this._onMsg}set onMsg(e){this._onMsg=e}open(e,t,n=[]){if(this.isDisposed||this._kernel.isDisposed)throw new Error("Cannot open");const i=a.createMessage({msgType:"comm_open",channel:"shell",username:this._kernel.username,session:this._kernel.clientId,content:{comm_id:this._id,target_name:this._target,data:null!=e?e:{}},metadata:t,buffers:n});return this._kernel.sendShellMessage(i,!1,!0)}send(e,t,n=[],i=!0){if(this.isDisposed||this._kernel.isDisposed)throw new Error("Cannot send");const s=a.createMessage({msgType:"comm_msg",channel:"shell",username:this._kernel.username,session:this._kernel.clientId,content:{comm_id:this._id,data:e},metadata:t,buffers:n});return this._kernel.sendShellMessage(s,!1,i)}close(e,t,n=[]){if(this.isDisposed||this._kernel.isDisposed)throw new Error("Cannot close");const i=a.createMessage({msgType:"comm_close",channel:"shell",username:this._kernel.username,session:this._kernel.clientId,content:{comm_id:this._id,data:null!=e?e:{}},metadata:t,buffers:n}),s=this._kernel.sendShellMessage(i,!1,!0),r=this._onClose;return r&&r(a.createMessage({msgType:"comm_close",channel:"iopub",username:this._kernel.username,session:this._kernel.clientId,content:{comm_id:this._id,data:null!=e?e:{}},metadata:t,buffers:n})),this.dispose(),s}}t.CommHandler=l},2456:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.KernelConnection=void 0;const o=n(8925),a=n(5764),l=n(8571),u=n(7883),c=n(7489),d=r(n(9909)),h=n(134),p=r(n(5855)),f=n(2946),m=r(n(8235)),g="_RESTARTING_";class v{constructor(e){var t,n,i,s;this._createSocket=(e=!0)=>{this._errorIfDisposed(),this._clearSocket(),this._updateConnectionStatus("connecting");const t=this.serverSettings,n=o.URLExt.join(t.wsUrl,m.KERNEL_SERVICE_URL,encodeURIComponent(this._id)),i=n.replace(/^((?:\w+:)?\/\/)(?:[^@\/]+@)/,"$1");console.debug(`Starting WebSocket: ${i}`);let s=o.URLExt.join(n,"channels?session_id="+encodeURIComponent(this._clientId));const r=t.token;t.appendToken&&""!==r&&(s+=`&token=${encodeURIComponent(r)}`);const a=e?this._supportedProtocols:[];this._ws=new t.WebSocket(s,a),this._ws.binaryType="arraybuffer";let l=!1;const c=async e=>{var n,i;if(!this._isDisposed){this._reason="",this._model=void 0;try{const n=await m.getKernelModel(this._id,t);this._model=n,"dead"===(null==n?void 0:n.execution_state)?this._updateStatus("dead"):this._onWSClose(e)}catch(t){if(t instanceof u.ServerConnection.NetworkError||503===(null===(n=t.response)||void 0===n?void 0:n.status)||424===(null===(i=t.response)||void 0===i?void 0:i.status)){const t=1e3*_.getRandomIntInclusive(10,30);setTimeout(c,t,e)}else this._reason="Kernel died unexpectedly",this._updateStatus("dead")}}},d=async e=>{l||(l=!0,await c(e))};this._ws.onmessage=this._onWSMessage,this._ws.onopen=this._onWSOpen,this._ws.onclose=d,this._ws.onerror=d},this._onWSOpen=e=>{if(""!==this._ws.protocol&&!this._supportedProtocols.includes(this._ws.protocol))throw console.log("Server selected unknown kernel wire protocol:",this._ws.protocol),this._updateStatus("dead"),new Error(`Unknown kernel wire protocol: ${this._ws.protocol}`);this._selectedProtocol=this._ws.protocol,this._ws.onclose=this._onWSClose,this._ws.onerror=this._onWSClose,this._updateConnectionStatus("connected")},this._onWSMessage=e=>{let t;try{t=this.serverSettings.serializer.deserialize(e.data,this._ws.protocol),p.validateMessage(t)}catch(e){throw e.message=`Kernel message validation error: ${e.message}`,e}this._kernelSession=t.header.session,this._msgChain=this._msgChain.then((()=>this._handleMessage(t))).catch((e=>{e.message.startsWith("Canceled future for ")&&console.error(e)})),this._anyMessage.emit({msg:t,direction:"recv"})},this._onWSClose=e=>{this.isDisposed||this._reconnect()},this._id="",this._name="",this._status="unknown",this._connectionStatus="connecting",this._kernelSession="",this._isDisposed=!1,this._ws=null,this._username="",this._reconnectLimit=7,this._reconnectAttempt=0,this._reconnectTimeout=null,this._supportedProtocols=Object.values(d.supportedKernelWebSocketProtocols),this._selectedProtocol="",this._futures=new Map,this._comms=new Map,this._targetRegistry=Object.create(null),this._info=new a.PromiseDelegate,this._pendingMessages=[],this._statusChanged=new l.Signal(this),this._connectionStatusChanged=new l.Signal(this),this._disposed=new l.Signal(this),this._iopubMessage=new l.Signal(this),this._anyMessage=new l.Signal(this),this._pendingInput=new l.Signal(this),this._unhandledMessage=new l.Signal(this),this._displayIdToParentIds=new Map,this._msgIdToDisplayIds=new Map,this._msgChain=Promise.resolve(),this._hasPendingInput=!1,this._reason="",this._noOp=()=>{},this._name=e.model.name,this._id=e.model.id,this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:u.ServerConnection.makeSettings(),this._clientId=null!==(n=e.clientId)&&void 0!==n?n:a.UUID.uuid4(),this._username=null!==(i=e.username)&&void 0!==i?i:"",this.handleComms=null===(s=e.handleComms)||void 0===s||s,this._createSocket()}get disposed(){return this._disposed}get statusChanged(){return this._statusChanged}get connectionStatusChanged(){return this._connectionStatusChanged}get iopubMessage(){return this._iopubMessage}get unhandledMessage(){return this._unhandledMessage}get model(){return this._model||{id:this.id,name:this.name,reason:this._reason}}get anyMessage(){return this._anyMessage}get pendingInput(){return this._pendingInput}get id(){return this._id}get name(){return this._name}get username(){return this._username}get clientId(){return this._clientId}get status(){return this._status}get connectionStatus(){return this._connectionStatus}get isDisposed(){return this._isDisposed}get info(){return this._info.promise}get spec(){return this._specPromise||(this._specPromise=f.KernelSpecAPI.getSpecs(this.serverSettings).then((e=>e.kernelspecs[this._name]))),this._specPromise}clone(e={}){return new v({model:this.model,username:this.username,serverSettings:this.serverSettings,handleComms:!1,...e})}dispose(){this.isDisposed||(this._isDisposed=!0,this._disposed.emit(),this._updateConnectionStatus("disconnected"),this._clearKernelState(),this._pendingMessages=[],this._clearSocket(),l.Signal.clearData(this))}sendShellMessage(e,t=!1,n=!0){return this._sendKernelShellControl(h.KernelShellFutureHandler,e,t,n)}sendControlMessage(e,t=!1,n=!0){return this._sendKernelShellControl(h.KernelControlFutureHandler,e,t,n)}_sendKernelShellControl(e,t,n=!1,i=!0){this._sendMessage(t),this._anyMessage.emit({msg:t,direction:"send"});const s=new e((()=>{const e=t.header.msg_id;this._futures.delete(e);const n=this._msgIdToDisplayIds.get(e);n&&(n.forEach((t=>{const n=this._displayIdToParentIds.get(t);if(n){const i=n.indexOf(e);if(-1===i)return;1===n.length?this._displayIdToParentIds.delete(t):(n.splice(i,1),this._displayIdToParentIds.set(t,n))}})),this._msgIdToDisplayIds.delete(e))}),t,n,i,this);return this._futures.set(t.header.msg_id,s),s}_sendMessage(e,t=!0){if("dead"===this.status)throw new Error("Kernel is dead");if((""===this._kernelSession||this._kernelSession===g)&&d.isInfoRequestMsg(e)){if("connected"===this.connectionStatus)return void this._ws.send(this.serverSettings.serializer.serialize(e,this._ws.protocol));throw new Error("Could not send message: status is not connected")}if(t&&this._pendingMessages.length>0)this._pendingMessages.push(e);else if("connected"===this.connectionStatus&&this._kernelSession!==g)this._ws.send(this.serverSettings.serializer.serialize(e,this._ws.protocol));else{if(!t)throw new Error("Could not send message");this._pendingMessages.push(e)}}async interrupt(){if(this.hasPendingInput=!1,"dead"===this.status)throw new Error("Kernel is dead");return m.interruptKernel(this.id,this.serverSettings)}async restart(){if("dead"===this.status)throw new Error("Kernel is dead");this._updateStatus("restarting"),this._clearKernelState(),this._kernelSession=g,await m.restartKernel(this.id,this.serverSettings),await this.reconnect(),this.hasPendingInput=!1}reconnect(){this._errorIfDisposed();const e=new a.PromiseDelegate,t=(n,i)=>{"connected"===i?(e.resolve(),this.connectionStatusChanged.disconnect(t,this)):"disconnected"===i&&(e.reject(new Error("Kernel connection disconnected")),this.connectionStatusChanged.disconnect(t,this))};return this.connectionStatusChanged.connect(t,this),this._reconnectAttempt=0,this._reconnect(),e.promise}async shutdown(){"dead"!==this.status&&await m.shutdownKernel(this.id,this.serverSettings),this.handleShutdown()}handleShutdown(){this._updateStatus("dead"),this.dispose()}async requestKernelInfo(){const e=d.createMessage({msgType:"kernel_info_request",channel:"shell",username:this._username,session:this._clientId,content:{}});let t;try{t=await _.handleShellMessage(this,e)}catch(e){if(this.isDisposed)return;throw e}if(this._errorIfDisposed(),t)return void 0===t.content.status&&(t.content.status="ok"),"ok"!==t.content.status?(this._info.reject("Kernel info reply errored"),t):(this._info.resolve(t.content),this._kernelSession=t.header.session,t)}requestComplete(e){const t=d.createMessage({msgType:"complete_request",channel:"shell",username:this._username,session:this._clientId,content:e});return _.handleShellMessage(this,t)}requestInspect(e){const t=d.createMessage({msgType:"inspect_request",channel:"shell",username:this._username,session:this._clientId,content:e});return _.handleShellMessage(this,t)}requestHistory(e){const t=d.createMessage({msgType:"history_request",channel:"shell",username:this._username,session:this._clientId,content:e});return _.handleShellMessage(this,t)}requestExecute(e,t=!0,n){const i=d.createMessage({msgType:"execute_request",channel:"shell",username:this._username,session:this._clientId,content:{silent:!1,store_history:!0,user_expressions:{},allow_stdin:!0,stop_on_error:!1,...e},metadata:n});return this.sendShellMessage(i,!0,t)}requestDebug(e,t=!0){const n=d.createMessage({msgType:"debug_request",channel:"control",username:this._username,session:this._clientId,content:e});return this.sendControlMessage(n,!0,t)}requestIsComplete(e){const t=d.createMessage({msgType:"is_complete_request",channel:"shell",username:this._username,session:this._clientId,content:e});return _.handleShellMessage(this,t)}requestCommInfo(e){const t=d.createMessage({msgType:"comm_info_request",channel:"shell",username:this._username,session:this._clientId,content:e});return _.handleShellMessage(this,t)}sendInputReply(e,t){const n=d.createMessage({msgType:"input_reply",channel:"stdin",username:this._username,session:this._clientId,content:e});n.parent_header=t,this._sendMessage(n),this._anyMessage.emit({msg:n,direction:"send"}),this.hasPendingInput=!1}createComm(e,t=a.UUID.uuid4()){if(!this.handleComms)throw new Error("Comms are disabled on this kernel connection");if(this._comms.has(t))throw new Error("Comm is already created");const n=new c.CommHandler(e,t,this,(()=>{this._unregisterComm(t)}));return this._comms.set(t,n),n}hasComm(e){return this._comms.has(e)}registerCommTarget(e,t){this.handleComms&&(this._targetRegistry[e]=t)}removeCommTarget(e,t){this.handleComms&&(this.isDisposed||this._targetRegistry[e]!==t||delete this._targetRegistry[e])}registerMessageHook(e,t){var n;const i=null===(n=this._futures)||void 0===n?void 0:n.get(e);i&&i.registerMessageHook(t)}removeMessageHook(e,t){var n;const i=null===(n=this._futures)||void 0===n?void 0:n.get(e);i&&i.removeMessageHook(t)}removeInputGuard(){this.hasPendingInput=!1}async _handleDisplayId(e,t){var n,i;const s=t.parent_header.msg_id;let r=this._displayIdToParentIds.get(e);if(r){const e={header:a.JSONExt.deepCopy(t.header),parent_header:a.JSONExt.deepCopy(t.parent_header),metadata:a.JSONExt.deepCopy(t.metadata),content:a.JSONExt.deepCopy(t.content),channel:t.channel,buffers:t.buffers?t.buffers.slice():[]};e.header.msg_type="update_display_data",await Promise.all(r.map((async t=>{const n=this._futures&&this._futures.get(t);n&&await n.handleMsg(e)})))}if("update_display_data"===t.header.msg_type)return!0;r=null!==(n=this._displayIdToParentIds.get(e))&&void 0!==n?n:[],-1===r.indexOf(s)&&r.push(s),this._displayIdToParentIds.set(e,r);const o=null!==(i=this._msgIdToDisplayIds.get(s))&&void 0!==i?i:[];return-1===o.indexOf(s)&&o.push(s),this._msgIdToDisplayIds.set(s,o),!1}_clearSocket(){null!==this._ws&&(this._ws.onopen=this._noOp,this._ws.onclose=this._noOp,this._ws.onerror=this._noOp,this._ws.onmessage=this._noOp,this._ws.close(),this._ws=null)}_updateStatus(e){this._status!==e&&"dead"!==this._status&&(this._status=e,_.logKernelStatus(this),this._statusChanged.emit(e),"dead"===e&&this.dispose())}_sendPending(){for(;"connected"===this.connectionStatus&&this._kernelSession!==g&&this._pendingMessages.length>0;)this._sendMessage(this._pendingMessages[0],!1),this._pendingMessages.shift()}_clearKernelState(){this._kernelSession="",this._pendingMessages=[],this._futures.forEach((e=>{e.dispose()})),this._comms.forEach((e=>{e.dispose()})),this._msgChain=Promise.resolve(),this._futures=new Map,this._comms=new Map,this._displayIdToParentIds.clear(),this._msgIdToDisplayIds.clear()}_assertCurrentMessage(e){if(this._errorIfDisposed(),e.header.session!==this._kernelSession)throw new Error(`Canceling handling of old message: ${e.header.msg_type}`)}async _handleCommOpen(e){this._assertCurrentMessage(e);const t=e.content,n=new c.CommHandler(t.target_name,t.comm_id,this,(()=>{this._unregisterComm(t.comm_id)}));this._comms.set(t.comm_id,n);try{const i=await _.loadObject(t.target_name,t.target_module,this._targetRegistry);await i(n,e)}catch(e){throw n.close(),console.error("Exception opening new comm"),e}}async _handleCommClose(e){this._assertCurrentMessage(e);const t=e.content,n=this._comms.get(t.comm_id);if(!n)return void console.error("Comm not found for comm id "+t.comm_id);this._unregisterComm(n.commId);const i=n.onClose;i&&await i(e),n.dispose()}async _handleCommMsg(e){this._assertCurrentMessage(e);const t=e.content,n=this._comms.get(t.comm_id);if(!n)return;const i=n.onMsg;i&&await i(e)}_unregisterComm(e){this._comms.delete(e)}_updateConnectionStatus(e){if(this._connectionStatus!==e){if(this._connectionStatus=e,"connecting"!==e&&(this._reconnectAttempt=0,clearTimeout(this._reconnectTimeout)),"dead"!==this.status)if("connected"===e){let e=this._kernelSession===g,t=this.requestKernelInfo(),n=!1,i=()=>{n||(n=!0,e&&this._kernelSession===g&&(this._kernelSession=""),clearTimeout(s),this._pendingMessages.length>0&&this._sendPending())};t.then(i);let s=setTimeout(i,3e3)}else this._updateStatus("unknown");this._connectionStatusChanged.emit(e)}}async _handleMessage(e){var t,n;let i=!1;if(e.parent_header&&"iopub"===e.channel&&(d.isDisplayDataMsg(e)||d.isUpdateDisplayDataMsg(e)||d.isExecuteResultMsg(e))){const n=(null!==(t=e.content.transient)&&void 0!==t?t:{}).display_id;n&&(i=await this._handleDisplayId(n,e),this._assertCurrentMessage(e))}if(!i&&e.parent_header){const t=e.parent_header,i=null===(n=this._futures)||void 0===n?void 0:n.get(t.msg_id);if(i)await i.handleMsg(e),this._assertCurrentMessage(e);else{const n=t.session===this.clientId;"iopub"!==e.channel&&n&&this._unhandledMessage.emit(e)}}if("iopub"===e.channel){switch(e.header.msg_type){case"status":{const t=e.content.execution_state;"restarting"===t&&Promise.resolve().then((async()=>{this._updateStatus("autorestarting"),this._clearKernelState(),await this.reconnect()})),this._updateStatus(t);break}case"comm_open":this.handleComms&&await this._handleCommOpen(e);break;case"comm_msg":this.handleComms&&await this._handleCommMsg(e);break;case"comm_close":this.handleComms&&await this._handleCommClose(e)}this.isDisposed||(this._assertCurrentMessage(e),this._iopubMessage.emit(e))}}_reconnect(){if(this._errorIfDisposed(),clearTimeout(this._reconnectTimeout),this._reconnectAttempt{if(t){if("undefined"==typeof requirejs)throw new Error("requirejs not found");requirejs([t],(n=>{void 0===n[e]?s(new Error(`Object '${e}' not found in module '${t}'`)):i(n[e])}),s)}else(null==n?void 0:n[e])?i(n[e]):s(new Error(`Object '${e}' not found in registry`))}))},e.getRandomIntInclusive=function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}}(_||(_={}))},134:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.KernelShellFutureHandler=t.KernelControlFutureHandler=t.KernelFutureHandler=void 0;const o=n(5764),a=n(7556),l=r(n(9909));class u extends a.DisposableDelegate{constructor(e,t,n,i,s){super(e),this._status=0,this._stdin=c.noOp,this._iopub=c.noOp,this._reply=c.noOp,this._done=new o.PromiseDelegate,this._hooks=new c.HookList,this._disposeOnDone=!0,this._msg=t,n||this._setFlag(c.KernelFutureFlag.GotReply),this._disposeOnDone=i,this._kernel=s}get msg(){return this._msg}get done(){return this._done.promise}get onReply(){return this._reply}set onReply(e){this._reply=e}get onIOPub(){return this._iopub}set onIOPub(e){this._iopub=e}get onStdin(){return this._stdin}set onStdin(e){this._stdin=e}registerMessageHook(e){if(this.isDisposed)throw new Error("Kernel future is disposed");this._hooks.add(e)}removeMessageHook(e){this.isDisposed||this._hooks.remove(e)}sendInputReply(e,t){this._kernel.sendInputReply(e,t)}dispose(){this._stdin=c.noOp,this._iopub=c.noOp,this._reply=c.noOp,this._hooks=null,this._testFlag(c.KernelFutureFlag.IsDone)||(this._done.promise.catch((()=>{})),this._done.reject(new Error(`Canceled future for ${this.msg.header.msg_type} message before replies were done`))),super.dispose()}async handleMsg(e){switch(e.channel){case"control":case"shell":e.channel===this.msg.channel&&e.parent_header.msg_id===this.msg.header.msg_id&&await this._handleReply(e);break;case"stdin":await this._handleStdin(e);break;case"iopub":await this._handleIOPub(e)}}async _handleReply(e){const t=this._reply;t&&await t(e),this._replyMsg=e,this._setFlag(c.KernelFutureFlag.GotReply),this._testFlag(c.KernelFutureFlag.GotIdle)&&this._handleDone()}async _handleStdin(e){this._kernel.hasPendingInput=!0;const t=this._stdin;t&&await t(e)}async _handleIOPub(e){const t=await this._hooks.process(e),n=this._iopub;t&&n&&await n(e),l.isStatusMsg(e)&&"idle"===e.content.execution_state&&(this._setFlag(c.KernelFutureFlag.GotIdle),this._testFlag(c.KernelFutureFlag.GotReply)&&this._handleDone())}_handleDone(){this._testFlag(c.KernelFutureFlag.IsDone)||(this._setFlag(c.KernelFutureFlag.IsDone),this._done.resolve(this._replyMsg),this._disposeOnDone&&this.dispose())}_testFlag(e){return!!(this._status&e)}_setFlag(e){this._status|=e}}var c;t.KernelFutureHandler=u,t.KernelControlFutureHandler=class extends u{},t.KernelShellFutureHandler=class extends u{},function(e){e.noOp=()=>{};const t="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;let n;e.HookList=class{constructor(){this._hooks=[]}add(e){this.remove(e),this._hooks.push(e)}remove(e){const t=this._hooks.indexOf(e);t>=0&&(this._hooks[t]=null,this._scheduleCompact())}async process(e){await this._processing;const t=new o.PromiseDelegate;let n;this._processing=t.promise;for(let i=this._hooks.length-1;i>=0;i--){const s=this._hooks[i];if(null!==s){try{n=await s(e)}catch(e){n=!0,console.error(e)}if(!1===n)return t.resolve(void 0),!1}}return t.resolve(void 0),!0}_scheduleCompact(){this._compactScheduled||(this._compactScheduled=!0,t((()=>{this._processing=this._processing.then((()=>{this._compactScheduled=!1,this._compact()}))})))}_compact(){let e=0;for(let t=0,n=this._hooks.length;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5198:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KernelManager=void 0;const i=n(6049),s=n(8571),r=n(7883),o=n(3867),a=n(8235),l=n(2456);class u extends o.BaseManager{constructor(e={}){var t;super(e),this._isReady=!1,this._kernelConnections=new Set,this._models=new Map,this._runningChanged=new s.Signal(this),this._connectionFailure=new s.Signal(this),this._pollModels=new i.Poll({auto:!1,factory:()=>this.requestRunning(),frequency:{interval:1e4,backoff:!0,max:3e5},name:"@jupyterlab/services:KernelManager#models",standby:null!==(t=e.standby)&&void 0!==t?t:"when-hidden"}),this._ready=(async()=>{await this._pollModels.start(),await this._pollModels.tick,this._isReady=!0})()}get isReady(){return this._isReady}get ready(){return this._ready}get runningChanged(){return this._runningChanged}get connectionFailure(){return this._connectionFailure}dispose(){this.isDisposed||(this._models.clear(),this._kernelConnections.forEach((e=>e.dispose())),this._pollModels.dispose(),super.dispose())}connectTo(e){var t;const{id:n}=e.model;let i=null===(t=e.handleComms)||void 0===t||t;if(void 0===e.handleComms)for(const e of this._kernelConnections)if(e.id===n&&e.handleComms){i=!1;break}const s=new l.KernelConnection({handleComms:i,...e,serverSettings:this.serverSettings});return this._onStarted(s),this._models.has(n)||this.refreshRunning().catch((()=>{})),s}running(){return this._models.values()}async refreshRunning(){await this._pollModels.refresh(),await this._pollModels.tick}async startNew(e={},t={}){const n=await(0,a.startNew)(e,this.serverSettings);return this.connectTo({...t,model:n})}async shutdown(e){await(0,a.shutdownKernel)(e,this.serverSettings),await this.refreshRunning()}async shutdownAll(){await this.refreshRunning(),await Promise.all([...this._models.keys()].map((e=>(0,a.shutdownKernel)(e,this.serverSettings)))),await this.refreshRunning()}async findById(e){return this._models.has(e)||await this.refreshRunning(),this._models.get(e)}async requestRunning(){var e,t;let n;try{n=await(0,a.listRunning)(this.serverSettings)}catch(n){throw(n instanceof r.ServerConnection.NetworkError||503===(null===(e=n.response)||void 0===e?void 0:e.status)||424===(null===(t=n.response)||void 0===t?void 0:t.status))&&this._connectionFailure.emit(n),n}this.isDisposed||this._models.size===n.length&&n.every((e=>{const t=this._models.get(e.id);return!!t&&t.connections===e.connections&&t.execution_state===e.execution_state&&t.last_activity===e.last_activity&&t.name===e.name&&t.reason===e.reason&&t.traceback===e.traceback}))||(this._models=new Map(n.map((e=>[e.id,e]))),this._kernelConnections.forEach((e=>{this._models.has(e.id)||e.handleShutdown()})),this._runningChanged.emit(n))}_onStarted(e){this._kernelConnections.add(e),e.statusChanged.connect(this._onStatusChanged,this),e.disposed.connect(this._onDisposed,this)}_onDisposed(e){this._kernelConnections.delete(e),this.refreshRunning().catch((()=>{}))}_onStatusChanged(e,t){"dead"===t&&this.refreshRunning().catch((()=>{}))}}t.KernelManager=u,function(e){e.NoopManager=class extends e{constructor(){super(...arguments),this._readyPromise=new Promise((()=>{}))}get isActive(){return!1}get parentReady(){return super.ready}async startNew(e={},t={}){return Promise.reject(new Error("Not implemented in no-op Kernel Manager"))}connectTo(e){throw new Error("Not implemented in no-op Kernel Manager")}async shutdown(e){return Promise.reject(new Error("Not implemented in no-op Kernel Manager"))}get ready(){return this.parentReady.then((()=>this._readyPromise))}async requestRunning(){return Promise.resolve()}}}(u||(t.KernelManager=u={}))},9909:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportedKernelWebSocketProtocols=t.isInputReplyMsg=t.isInputRequestMsg=t.isDebugReplyMsg=t.isDebugRequestMsg=t.isExecuteReplyMsg=t.isInfoRequestMsg=t.isCommMsgMsg=t.isCommCloseMsg=t.isCommOpenMsg=t.isDebugEventMsg=t.isClearOutputMsg=t.isStatusMsg=t.isErrorMsg=t.isExecuteResultMsg=t.isExecuteInputMsg=t.isUpdateDisplayDataMsg=t.isDisplayDataMsg=t.isStreamMsg=t.createMessage=void 0;const i=n(5764);var s;t.createMessage=function(e){var t,n,s,r,o;return{buffers:null!==(t=e.buffers)&&void 0!==t?t:[],channel:e.channel,content:e.content,header:{date:(new Date).toISOString(),msg_id:null!==(n=e.msgId)&&void 0!==n?n:i.UUID.uuid4(),msg_type:e.msgType,session:e.session,username:null!==(s=e.username)&&void 0!==s?s:"",version:"5.2"},metadata:null!==(r=e.metadata)&&void 0!==r?r:{},parent_header:null!==(o=e.parentHeader)&&void 0!==o?o:{}}},t.isStreamMsg=function(e){return"stream"===e.header.msg_type},t.isDisplayDataMsg=function(e){return"display_data"===e.header.msg_type},t.isUpdateDisplayDataMsg=function(e){return"update_display_data"===e.header.msg_type},t.isExecuteInputMsg=function(e){return"execute_input"===e.header.msg_type},t.isExecuteResultMsg=function(e){return"execute_result"===e.header.msg_type},t.isErrorMsg=function(e){return"error"===e.header.msg_type},t.isStatusMsg=function(e){return"status"===e.header.msg_type},t.isClearOutputMsg=function(e){return"clear_output"===e.header.msg_type},t.isDebugEventMsg=function(e){return"debug_event"===e.header.msg_type},t.isCommOpenMsg=function(e){return"comm_open"===e.header.msg_type},t.isCommCloseMsg=function(e){return"comm_close"===e.header.msg_type},t.isCommMsgMsg=function(e){return"comm_msg"===e.header.msg_type},t.isInfoRequestMsg=function(e){return"kernel_info_request"===e.header.msg_type},t.isExecuteReplyMsg=function(e){return"execute_reply"===e.header.msg_type},t.isDebugRequestMsg=function(e){return"debug_request"===e.header.msg_type},t.isDebugReplyMsg=function(e){return"debug_reply"===e.header.msg_type},t.isInputRequestMsg=function(e){return"input_request"===e.header.msg_type},t.isInputReplyMsg=function(e){return"input_reply"===e.header.msg_type},function(e){e.v1KernelWebsocketJupyterOrg="v1.kernel.websocket.jupyter.org"}(s||(t.supportedKernelWebSocketProtocols=s={}))},8235:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getKernelModel=t.shutdownKernel=t.interruptKernel=t.restartKernel=t.startNew=t.listRunning=t.KERNEL_SERVICE_URL=void 0;const i=n(2920),s=n(8925),r=n(5855);t.KERNEL_SERVICE_URL="api/kernels",t.listRunning=async function(e=i.ServerConnection.makeSettings()){const n=s.URLExt.join(e.baseUrl,t.KERNEL_SERVICE_URL),o=await i.ServerConnection.makeRequest(n,{},e);if(200!==o.status)throw await i.ServerConnection.ResponseError.create(o);const a=await o.json();return(0,r.validateModels)(a),a},t.startNew=async function(e={},n=i.ServerConnection.makeSettings()){const o=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL),a={method:"POST",body:JSON.stringify(e)},l=await i.ServerConnection.makeRequest(o,a,n);if(201!==l.status)throw await i.ServerConnection.ResponseError.create(l);const u=await l.json();return(0,r.validateModel)(u),u},t.restartKernel=async function(e,n=i.ServerConnection.makeSettings()){const o=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e),"restart"),a=await i.ServerConnection.makeRequest(o,{method:"POST"},n);if(200!==a.status)throw await i.ServerConnection.ResponseError.create(a);const l=await a.json();(0,r.validateModel)(l)},t.interruptKernel=async function(e,n=i.ServerConnection.makeSettings()){const r=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e),"interrupt"),o=await i.ServerConnection.makeRequest(r,{method:"POST"},n);if(204!==o.status)throw await i.ServerConnection.ResponseError.create(o)},t.shutdownKernel=async function(e,n=i.ServerConnection.makeSettings()){const r=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e)),o=await i.ServerConnection.makeRequest(r,{method:"DELETE"},n);if(404===o.status){const t=`The kernel "${e}" does not exist on the server`;console.warn(t)}else if(204!==o.status)throw await i.ServerConnection.ResponseError.create(o)},t.getKernelModel=async function(e,n=i.ServerConnection.makeSettings()){const o=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e)),a=await i.ServerConnection.makeRequest(o,{},n);if(404===a.status)return;if(200!==a.status)throw await i.ServerConnection.ResponseError.create(a);const l=await a.json();return(0,r.validateModel)(l),l}},7179:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.deserialize=t.serialize=void 0;const o=r(n(9909));var a;t.serialize=function(e,t=""){return t===o.supportedKernelWebSocketProtocols.v1KernelWebsocketJupyterOrg?a.serializeV1KernelWebsocketJupyterOrg(e):a.serializeDefault(e)},t.deserialize=function(e,t=""){return t===o.supportedKernelWebSocketProtocols.v1KernelWebsocketJupyterOrg?a.deserializeV1KernelWebsocketJupyterOrg(e):a.deserializeDefault(e)},function(e){e.deserializeV1KernelWebsocketJupyterOrg=function(e){let t;const n=new DataView(e),i=Number(n.getBigUint64(0,!0));let s=[];for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateModels=t.validateModel=t.validateMessage=void 0;const i=n(7441),s=["username","version","session","msg_id","msg_type"],r={stream:{name:"string",text:"string"},display_data:{data:"object",metadata:"object"},execute_input:{code:"string",execution_count:"number"},execute_result:{execution_count:"number",data:"object",metadata:"object"},error:{ename:"string",evalue:"string",traceback:"object"},status:{execution_state:["string",["starting","idle","busy","restarting","dead"]]},clear_output:{wait:"boolean"},comm_open:{comm_id:"string",target_name:"string",data:"object"},comm_msg:{comm_id:"string",data:"object"},comm_close:{comm_id:"string"},shutdown_reply:{restart:"boolean"}};function o(e){(0,i.validateProperty)(e,"name","string"),(0,i.validateProperty)(e,"id","string")}t.validateMessage=function(e){(0,i.validateProperty)(e,"metadata","object"),(0,i.validateProperty)(e,"content","object"),(0,i.validateProperty)(e,"channel","string"),function(e){for(let t=0;to(e)))}},2946:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t},o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.KernelSpecAPI=t.KernelSpec=void 0;const a=r(n(4806));t.KernelSpec=a;const l=r(n(6492));t.KernelSpecAPI=l,o(n(733),t)},4806:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},733:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.KernelSpecManager=void 0;const o=n(5764),a=n(6049),l=n(8571),u=r(n(6492)),c=n(3867);class d extends c.BaseManager{constructor(e={}){var t;super(e),this._isReady=!1,this._connectionFailure=new l.Signal(this),this._specs=null,this._specsChanged=new l.Signal(this),this._ready=Promise.all([this.requestSpecs()]).then((e=>{})).catch((e=>{})).then((()=>{this.isDisposed||(this._isReady=!0)})),this._pollSpecs=new a.Poll({auto:!1,factory:()=>this.requestSpecs(),frequency:{interval:61e3,backoff:!0,max:3e5},name:"@jupyterlab/services:KernelSpecManager#specs",standby:null!==(t=e.standby)&&void 0!==t?t:"when-hidden"}),this.ready.then((()=>{this._pollSpecs.start()}))}get isReady(){return this._isReady}get ready(){return this._ready}get specs(){return this._specs}get specsChanged(){return this._specsChanged}get connectionFailure(){return this._connectionFailure}dispose(){this._pollSpecs.dispose(),super.dispose()}async refreshSpecs(){await this._pollSpecs.refresh(),await this._pollSpecs.tick}async requestSpecs(){const e=await u.getSpecs(this.serverSettings);this.isDisposed||o.JSONExt.deepEqual(e,this._specs)||(this._specs=e,this._specsChanged.emit(e))}}t.KernelSpecManager=d},6492:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSpecs=void 0;const i=n(2920),s=n(2598),r=n(8925);t.getSpecs=async function(e=i.ServerConnection.makeSettings()){const t=r.URLExt.join(e.baseUrl,"api/kernelspecs"),n=await i.ServerConnection.makeRequest(t,{},e);if(200!==n.status)throw await i.ServerConnection.ResponseError.create(n);const o=await n.json();return(0,s.validateSpecModels)(o)}},2598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSpecModels=t.validateSpecModel=void 0;const i=n(7441);function s(e){const t=e.spec;if(!t)throw new Error("Invalid kernel spec");(0,i.validateProperty)(e,"name","string"),(0,i.validateProperty)(e,"resources","object"),(0,i.validateProperty)(t,"language","string"),(0,i.validateProperty)(t,"display_name","string"),(0,i.validateProperty)(t,"argv","array");let n=null;t.hasOwnProperty("metadata")&&((0,i.validateProperty)(t,"metadata","object"),n=t.metadata);let s=null;return t.hasOwnProperty("env")&&((0,i.validateProperty)(t,"env","object"),s=t.env),{name:e.name,resources:e.resources,language:t.language,display_name:t.display_name,argv:t.argv,metadata:n,env:s}}t.validateSpecModel=s,t.validateSpecModels=function(e){if(!e.hasOwnProperty("kernelspecs"))throw new Error("No kernelspecs found");let t=Object.keys(e.kernelspecs);const n=Object.create(null);let i=e.default;for(let i=0;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceManager=void 0;const i=n(8571),s=n(4219),r=n(8790),o=n(9480),a=n(973),l=n(2946),u=n(8683),c=n(2920),d=n(7668),h=n(7780),p=n(9040),f=n(9191),m=n(8053);t.ServiceManager=class{constructor(e={}){var t,n;this._isDisposed=!1,this._connectionFailure=new i.Signal(this),this._isReady=!1;const g=e.defaultDrive,v=null!==(t=e.serverSettings)&&void 0!==t?t:c.ServerConnection.makeSettings(),_={defaultDrive:g,serverSettings:v,standby:null!==(n=e.standby)&&void 0!==n?n:"when-hidden"};this.serverSettings=v,this.contents=e.contents||new r.ContentsManager(_),this.events=e.events||new o.EventManager(_),this.kernels=e.kernels||new a.KernelManager(_),this.sessions=e.sessions||new d.SessionManager({..._,kernelManager:this.kernels}),this.settings=e.settings||new h.SettingManager(_),this.terminals=e.terminals||new p.TerminalManager(_),this.builder=e.builder||new s.BuildManager(_),this.workspaces=e.workspaces||new m.WorkspaceManager(_),this.nbconvert=e.nbconvert||new u.NbConvertManager(_),this.kernelspecs=e.kernelspecs||new l.KernelSpecManager(_),this.user=e.user||new f.UserManager(_),this.kernelspecs.connectionFailure.connect(this._onConnectionFailure,this),this.sessions.connectionFailure.connect(this._onConnectionFailure,this),this.terminals.connectionFailure.connect(this._onConnectionFailure,this);const y=[this.sessions.ready,this.kernelspecs.ready];this.terminals.isAvailable()&&y.push(this.terminals.ready),this._readyPromise=Promise.all(y).then((()=>{this._isReady=!0}))}get connectionFailure(){return this._connectionFailure}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,i.Signal.clearData(this),this.contents.dispose(),this.events.dispose(),this.sessions.dispose(),this.terminals.dispose())}get isReady(){return this._isReady}get ready(){return this._readyPromise}_onConnectionFailure(e,t){this._connectionFailure.emit(t)}}},8683:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NbConvertManager=void 0;const i=n(8925),s=n(2920),r=n(5764);t.NbConvertManager=class{constructor(e={}){var t;this._exportFormats=null,this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:s.ServerConnection.makeSettings()}async fetchExportFormats(){this._requestingFormats=new r.PromiseDelegate,this._exportFormats=null;const e=this.serverSettings.baseUrl,t=i.URLExt.join(e,"api/nbconvert"),{serverSettings:n}=this,o=await s.ServerConnection.makeRequest(t,{},n);if(200!==o.status)throw await s.ServerConnection.ResponseError.create(o);const a=await o.json(),l={};return Object.keys(a).forEach((function(e){const t=a[e].output_mimetype;l[e]={output_mimetype:t}})),this._exportFormats=l,this._requestingFormats.resolve(l),l}async getExportFormats(e=!0){return this._requestingFormats?this._requestingFormats.promise:e||!this._exportFormats?await this.fetchExportFormats():this._exportFormats}}},2920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServerConnection=void 0;const i=n(8925),s=n(7179);let r;var o,a;r="undefined"==typeof window?n(7251):WebSocket,function(e){e.makeSettings=function(e){return a.makeSettings(e)},e.makeRequest=function(e,t,n){return a.handleRequest(e,t,n)};class t extends Error{static async create(e){try{const n=await e.json(),{message:i,traceback:s}=n;return s&&console.error(s),new t(e,null!=i?i:t._defaultMessage(e),null!=s?s:"")}catch(n){return console.debug(n),new t(e)}}constructor(e,n=t._defaultMessage(e),i=""){super(n),this.response=e,this.traceback=i}static _defaultMessage(e){return`Invalid response: ${e.status} ${e.statusText}`}}e.ResponseError=t;class n extends TypeError{constructor(e){super(e.message),this.stack=e.stack}}e.NetworkError=n}(o||(t.ServerConnection=o={})),function(e){e.makeSettings=function(e={}){var t;const n=i.PageConfig.getBaseUrl(),o=i.PageConfig.getWsUrl(),a=i.URLExt.normalize(e.baseUrl)||n;let l=e.wsUrl;l||a!==n||(l=o),l||0!==a.indexOf("http")||(l="ws"+a.slice(4)),l=null!=l?l:o;const u=i.PageConfig.getOption("appendToken").toLowerCase();let c;return c=""===u?"undefined"==typeof window||"undefined"!=typeof process&&void 0!==(null===(t=null===process||void 0===process?void 0:{})||void 0===t?void 0:t.JEST_WORKER_ID)||i.URLExt.getHostName(n)!==i.URLExt.getHostName(l):"true"===u,{init:{cache:"no-store",credentials:"same-origin"},fetch,Headers,Request,WebSocket:r,token:i.PageConfig.getToken(),appUrl:i.PageConfig.getOption("appUrl"),appendToken:c,serializer:{serialize:s.serialize,deserialize:s.deserialize},...e,baseUrl:a,wsUrl:l}},e.handleRequest=function(e,t,n){var i;if(0!==e.indexOf(n.baseUrl))throw new Error("Can only be used for notebook server requests");"no-store"===(null!==(i=t.cache)&&void 0!==i?i:n.init.cache)&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime());const s=new n.Request(e,{...n.init,...t});let r=!1;if(n.token&&(r=!0,s.headers.append("Authorization",`token ${n.token}`)),"undefined"!=typeof document){const e=function(){let e="";try{e=document.cookie}catch(e){return}const t=e.match("\\b_xsrf=([^;]*)\\b");return null==t?void 0:t[1]}();void 0!==e&&(r=!0,s.headers.append("X-XSRFToken",e))}return!s.headers.has("Content-Type")&&r&&s.headers.set("Content-Type","application/json"),n.fetch.call(null,s).catch((e=>{throw new o.NetworkError(e)}))}}(a||(a={}))},5341:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionConnection=void 0;const i=n(8571),s=n(7883),r=n(7570),o=n(5764);t.SessionConnection=class{constructor(e){var t,n,r,a;this._id="",this._path="",this._name="",this._type="",this._kernel=null,this._isDisposed=!1,this._disposed=new i.Signal(this),this._kernelChanged=new i.Signal(this),this._statusChanged=new i.Signal(this),this._connectionStatusChanged=new i.Signal(this),this._pendingInput=new i.Signal(this),this._iopubMessage=new i.Signal(this),this._unhandledMessage=new i.Signal(this),this._anyMessage=new i.Signal(this),this._propertyChanged=new i.Signal(this),this._id=e.model.id,this._name=e.model.name,this._path=e.model.path,this._type=e.model.type,this._username=null!==(t=e.username)&&void 0!==t?t:"",this._clientId=null!==(n=e.clientId)&&void 0!==n?n:o.UUID.uuid4(),this._connectToKernel=e.connectToKernel,this._kernelConnectionOptions=null!==(r=e.kernelConnectionOptions)&&void 0!==r?r:{},this.serverSettings=null!==(a=e.serverSettings)&&void 0!==a?a:s.ServerConnection.makeSettings(),this.setupKernel(e.model.kernel)}get disposed(){return this._disposed}get kernelChanged(){return this._kernelChanged}get statusChanged(){return this._statusChanged}get connectionStatusChanged(){return this._connectionStatusChanged}get pendingInput(){return this._pendingInput}get iopubMessage(){return this._iopubMessage}get unhandledMessage(){return this._unhandledMessage}get anyMessage(){return this._anyMessage}get propertyChanged(){return this._propertyChanged}get id(){return this._id}get kernel(){return this._kernel}get path(){return this._path}get type(){return this._type}get name(){return this._name}get model(){return{id:this.id,kernel:this.kernel&&{id:this.kernel.id,name:this.kernel.name},path:this._path,type:this._type,name:this._name}}get isDisposed(){return this._isDisposed}update(e){const t=this.model;if(this._path=e.path,this._name=e.name,this._type=e.type,null===this._kernel&&null!==e.kernel||null!==this._kernel&&null===e.kernel||null!==this._kernel&&null!==e.kernel&&this._kernel.id!==e.kernel.id){null!==this._kernel&&this._kernel.dispose();const t=this._kernel||null;this.setupKernel(e.kernel);const n=this._kernel||null;this._kernelChanged.emit({name:"kernel",oldValue:t,newValue:n})}this._handleModelChange(t)}dispose(){if(!this.isDisposed){if(this._isDisposed=!0,this._disposed.emit(),this._kernel){this._kernel.dispose();const e=this._kernel;this._kernel=null;const t=this._kernel;this._kernelChanged.emit({name:"kernel",oldValue:e,newValue:t})}i.Signal.clearData(this)}}async setPath(e){if(this.isDisposed)throw new Error("Session is disposed");await this._patch({path:e})}async setName(e){if(this.isDisposed)throw new Error("Session is disposed");await this._patch({name:e})}async setType(e){if(this.isDisposed)throw new Error("Session is disposed");await this._patch({type:e})}async changeKernel(e){if(this.isDisposed)throw new Error("Session is disposed");return await this._patch({kernel:e}),this.kernel}async shutdown(){if(this.isDisposed)throw new Error("Session is disposed");await(0,r.shutdownSession)(this.id,this.serverSettings),this.dispose()}setupKernel(e){if(null===e)return void(this._kernel=null);const t=this._connectToKernel({...this._kernelConnectionOptions,model:e,username:this._username,clientId:this._clientId,serverSettings:this.serverSettings});this._kernel=t,t.statusChanged.connect(this.onKernelStatus,this),t.connectionStatusChanged.connect(this.onKernelConnectionStatus,this),t.pendingInput.connect(this.onPendingInput,this),t.unhandledMessage.connect(this.onUnhandledMessage,this),t.iopubMessage.connect(this.onIOPubMessage,this),t.anyMessage.connect(this.onAnyMessage,this)}onKernelStatus(e,t){this._statusChanged.emit(t)}onKernelConnectionStatus(e,t){this._connectionStatusChanged.emit(t)}onPendingInput(e,t){this._pendingInput.emit(t)}onIOPubMessage(e,t){this._iopubMessage.emit(t)}onUnhandledMessage(e,t){this._unhandledMessage.emit(t)}onAnyMessage(e,t){this._anyMessage.emit(t)}async _patch(e){const t=await(0,r.updateSession)({...e,id:this._id},this.serverSettings);return this.update(t),t}_handleModelChange(e){e.name!==this._name&&this._propertyChanged.emit("name"),e.type!==this._type&&this._propertyChanged.emit("type"),e.path!==this._path&&this._propertyChanged.emit("path")}}},7668:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t},o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.SessionAPI=t.Session=void 0;const a=r(n(7240));t.Session=a;const l=r(n(7570));t.SessionAPI=l,o(n(6919),t)},6919:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionManager=void 0;const i=n(6049),s=n(8571),r=n(2920),o=n(3867),a=n(5341),l=n(7570);class u extends o.BaseManager{constructor(e){var t;super(e),this._isReady=!1,this._sessionConnections=new Set,this._models=new Map,this._runningChanged=new s.Signal(this),this._connectionFailure=new s.Signal(this),this._connectToKernel=e=>this._kernelManager.connectTo(e),this._kernelManager=e.kernelManager,this._pollModels=new i.Poll({auto:!1,factory:()=>this.requestRunning(),frequency:{interval:1e4,backoff:!0,max:3e5},name:"@jupyterlab/services:SessionManager#models",standby:null!==(t=e.standby)&&void 0!==t?t:"when-hidden"}),this._ready=(async()=>{await this._pollModels.start(),await this._pollModels.tick,this._kernelManager.isActive&&await this._kernelManager.ready,this._isReady=!0})()}get isReady(){return this._isReady}get ready(){return this._ready}get runningChanged(){return this._runningChanged}get connectionFailure(){return this._connectionFailure}dispose(){this.isDisposed||(this._models.clear(),this._sessionConnections.forEach((e=>e.dispose())),this._pollModels.dispose(),super.dispose())}connectTo(e){const t=new a.SessionConnection({...e,connectToKernel:this._connectToKernel,serverSettings:this.serverSettings});return this._onStarted(t),this._models.has(e.model.id)||this.refreshRunning().catch((()=>{})),t}running(){return this._models.values()}async refreshRunning(){await this._pollModels.refresh(),await this._pollModels.tick}async startNew(e,t={}){const n=await(0,l.startSession)(e,this.serverSettings);return await this.refreshRunning(),this.connectTo({...t,model:n})}async shutdown(e){await(0,l.shutdownSession)(e,this.serverSettings),await this.refreshRunning()}async shutdownAll(){await this.refreshRunning(),await Promise.all([...this._models.keys()].map((e=>(0,l.shutdownSession)(e,this.serverSettings)))),await this.refreshRunning()}async stopIfNeeded(e){try{const t=(await(0,l.listRunning)(this.serverSettings)).filter((t=>t.path===e));if(1===t.length){const e=t[0].id;await this.shutdown(e)}}catch(e){}}async findById(e){return this._models.has(e)||await this.refreshRunning(),this._models.get(e)}async findByPath(e){for(const t of this._models.values())if(t.path===e)return t;await this.refreshRunning();for(const t of this._models.values())if(t.path===e)return t}async requestRunning(){var e,t;let n;try{n=await(0,l.listRunning)(this.serverSettings)}catch(n){throw(n instanceof r.ServerConnection.NetworkError||503===(null===(e=n.response)||void 0===e?void 0:e.status)||424===(null===(t=n.response)||void 0===t?void 0:t.status))&&this._connectionFailure.emit(n),n}this.isDisposed||this._models.size===n.length&&n.every((e=>{var t,n,i,s;const r=this._models.get(e.id);return!!r&&(null===(t=r.kernel)||void 0===t?void 0:t.id)===(null===(n=e.kernel)||void 0===n?void 0:n.id)&&(null===(i=r.kernel)||void 0===i?void 0:i.name)===(null===(s=e.kernel)||void 0===s?void 0:s.name)&&r.name===e.name&&r.path===e.path&&r.type===e.type}))||(this._models=new Map(n.map((e=>[e.id,e]))),this._sessionConnections.forEach((e=>{this._models.has(e.id)?e.update(this._models.get(e.id)):e.dispose()})),this._runningChanged.emit(n))}_onStarted(e){this._sessionConnections.add(e),e.disposed.connect(this._onDisposed,this),e.propertyChanged.connect(this._onChanged,this),e.kernelChanged.connect(this._onChanged,this)}_onDisposed(e){this._sessionConnections.delete(e),this.refreshRunning().catch((()=>{}))}_onChanged(){this.refreshRunning().catch((()=>{}))}}t.SessionManager=u,function(e){e.NoopManager=class extends e{constructor(){super(...arguments),this._readyPromise=new Promise((()=>{}))}get isActive(){return!1}get parentReady(){return super.ready}async startNew(e,t={}){return Promise.reject(new Error("Not implemented in no-op Session Manager"))}connectTo(e){throw Error("Not implemented in no-op Session Manager")}get ready(){return this.parentReady.then((()=>this._readyPromise))}async shutdown(e){return Promise.reject(new Error("Not implemented in no-op Session Manager"))}async requestRunning(){return Promise.resolve()}}}(u||(t.SessionManager=u={}))},7570:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateSession=t.startSession=t.getSessionModel=t.shutdownSession=t.getSessionUrl=t.listRunning=t.SESSION_SERVICE_URL=void 0;const i=n(2920),s=n(8925),r=n(5684);function o(e,n){const i=s.URLExt.join(e,t.SESSION_SERVICE_URL),r=s.URLExt.join(i,n);if(!r.startsWith(i))throw new Error("Can only be used for services requests");return r}t.SESSION_SERVICE_URL="api/sessions",t.listRunning=async function(e=i.ServerConnection.makeSettings()){const n=s.URLExt.join(e.baseUrl,t.SESSION_SERVICE_URL),o=await i.ServerConnection.makeRequest(n,{},e);if(200!==o.status)throw await i.ServerConnection.ResponseError.create(o);const a=await o.json();if(!Array.isArray(a))throw new Error("Invalid Session list");return a.forEach((e=>{(0,r.updateLegacySessionModel)(e),(0,r.validateModel)(e)})),a},t.getSessionUrl=o,t.shutdownSession=async function(e,t=i.ServerConnection.makeSettings()){var n;const s=o(t.baseUrl,e),r=await i.ServerConnection.makeRequest(s,{method:"DELETE"},t);if(404===r.status){const t=null!==(n=(await r.json()).message)&&void 0!==n?n:`The session "${e}"" does not exist on the server`;console.warn(t)}else{if(410===r.status)throw new i.ServerConnection.ResponseError(r,"The kernel was deleted but the session was not");if(204!==r.status)throw await i.ServerConnection.ResponseError.create(r)}},t.getSessionModel=async function(e,t=i.ServerConnection.makeSettings()){const n=o(t.baseUrl,e),s=await i.ServerConnection.makeRequest(n,{},t);if(200!==s.status)throw await i.ServerConnection.ResponseError.create(s);const a=await s.json();return(0,r.updateLegacySessionModel)(a),(0,r.validateModel)(a),a},t.startSession=async function(e,n=i.ServerConnection.makeSettings()){const o=s.URLExt.join(n.baseUrl,t.SESSION_SERVICE_URL),a={method:"POST",body:JSON.stringify(e)},l=await i.ServerConnection.makeRequest(o,a,n);if(201!==l.status)throw await i.ServerConnection.ResponseError.create(l);const u=await l.json();return(0,r.updateLegacySessionModel)(u),(0,r.validateModel)(u),u},t.updateSession=async function(e,t=i.ServerConnection.makeSettings()){const n=o(t.baseUrl,e.id),s={method:"PATCH",body:JSON.stringify(e)},a=await i.ServerConnection.makeRequest(n,s,t);if(200!==a.status)throw await i.ServerConnection.ResponseError.create(a);const l=await a.json();return(0,r.updateLegacySessionModel)(l),(0,r.validateModel)(l),l}},7240:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5684:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateModels=t.updateLegacySessionModel=t.validateModel=void 0;const i=n(5855),s=n(7441);function r(e){(0,s.validateProperty)(e,"id","string"),(0,s.validateProperty)(e,"type","string"),(0,s.validateProperty)(e,"name","string"),(0,s.validateProperty)(e,"path","string"),(0,s.validateProperty)(e,"kernel","object"),(0,i.validateModel)(e.kernel)}t.validateModel=r,t.updateLegacySessionModel=function(e){void 0===e.path&&void 0!==e.notebook&&(e.path=e.notebook.path,e.type="notebook",e.name="")},t.validateModels=function(e){if(!Array.isArray(e))throw new Error("Invalid session list");e.forEach((e=>r(e)))}},7780:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SettingManager=void 0;const i=n(8925),s=n(1670),r=n(2920);class o extends s.DataConnector{constructor(e={}){var t;super(),this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:r.ServerConnection.makeSettings()}async fetch(e){if(!e)throw new Error("Plugin `id` parameter is required for settings fetch.");const{serverSettings:t}=this,{baseUrl:n,appUrl:i}=t,{makeRequest:s,ResponseError:o}=r.ServerConnection,l=n+i,u=a.url(l,e),c=await s(u,{},t);if(200!==c.status)throw await o.create(c);return c.json()}async list(e){var t,n,i,s;const{serverSettings:o}=this,{baseUrl:l,appUrl:u}=o,{makeRequest:c,ResponseError:d}=r.ServerConnection,h=l+u,p=a.url(h,"","ids"===e),f=await c(p,{},o);if(200!==f.status)throw new d(f);const m=await f.json(),g=null!==(n=null===(t=null==m?void 0:m.settings)||void 0===t?void 0:t.map((e=>e.id)))&&void 0!==n?n:[];let v=[];return e||(v=null!==(s=null===(i=null==m?void 0:m.settings)||void 0===i?void 0:i.map((e=>(e.data={composite:{},user:{}},e))))&&void 0!==s?s:[]),{ids:g,values:v}}async save(e,t){const{serverSettings:n}=this,{baseUrl:i,appUrl:s}=n,{makeRequest:o,ResponseError:l}=r.ServerConnection,u=i+s,c=a.url(u,e),d={body:JSON.stringify({raw:t}),method:"PUT"},h=await o(c,d,n);if(204!==h.status)throw new l(h)}}var a;t.SettingManager=o,function(e){e.url=function(e,t,n){const s=n?i.URLExt.objectToQueryString({ids_only:!0}):"",r=i.URLExt.join(e,"api/settings"),o=i.URLExt.join(r,t);if(!o.startsWith(r))throw new Error("Can only be used for workspaces requests");return`${o}${s}`}}(a||(a={}))},7251:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=WebSocket},9822:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalConnection=void 0;const i=n(8925),s=n(5764),r=n(8571),o=n(7883),a=n(6134);class l{constructor(e){var t;this._createSocket=()=>{this._errorIfDisposed(),this._clearSocket(),this._updateConnectionStatus("connecting");const e=this._name,t=this.serverSettings;let n=i.URLExt.join(t.wsUrl,"terminals","websocket",encodeURIComponent(e));const s=t.token;t.appendToken&&""!==s&&(n+=`?token=${encodeURIComponent(s)}`),this._ws=new t.WebSocket(n),this._ws.onmessage=this._onWSMessage,this._ws.onclose=this._onWSClose,this._ws.onerror=this._onWSClose},this._onWSMessage=e=>{if(this._isDisposed)return;const t=JSON.parse(e.data);"disconnect"===t[0]&&this.dispose(),"connecting"!==this._connectionStatus?this._messageReceived.emit({type:t[0],content:t.slice(1)}):"setup"===t[0]&&this._updateConnectionStatus("connected")},this._onWSClose=e=>{console.warn(`Terminal websocket closed: ${e.code}`),this.isDisposed||this._reconnect()},this._connectionStatus="connecting",this._connectionStatusChanged=new r.Signal(this),this._isDisposed=!1,this._disposed=new r.Signal(this),this._messageReceived=new r.Signal(this),this._reconnectTimeout=null,this._ws=null,this._noOp=()=>{},this._reconnectLimit=7,this._reconnectAttempt=0,this._pendingMessages=[],this._name=e.model.name,this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:o.ServerConnection.makeSettings(),this._createSocket()}get disposed(){return this._disposed}get messageReceived(){return this._messageReceived}get name(){return this._name}get model(){return{name:this._name}}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._disposed.emit(),this._updateConnectionStatus("disconnected"),this._clearSocket(),r.Signal.clearData(this))}send(e){this._sendMessage(e)}_sendMessage(e,t=!0){if(!this._isDisposed&&e.content)if("connected"===this.connectionStatus&&this._ws){const t=[e.type,...e.content];this._ws.send(JSON.stringify(t))}else{if(!t)throw new Error(`Could not send message: ${JSON.stringify(e)}`);this._pendingMessages.push(e)}}_sendPending(){for(;"connected"===this.connectionStatus&&this._pendingMessages.length>0;)this._sendMessage(this._pendingMessages[0],!1),this._pendingMessages.shift()}reconnect(){this._errorIfDisposed();const e=new s.PromiseDelegate,t=(n,i)=>{"connected"===i?(e.resolve(),this.connectionStatusChanged.disconnect(t,this)):"disconnected"===i&&(e.reject(new Error("Terminal connection disconnected")),this.connectionStatusChanged.disconnect(t,this))};return this.connectionStatusChanged.connect(t,this),this._reconnectAttempt=0,this._reconnect(),e.promise}_reconnect(){if(this._errorIfDisposed(),clearTimeout(this._reconnectTimeout),this._reconnectAttempt{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalManager=void 0;const i=n(6049),s=n(8571),r=n(7883),o=n(3867),a=n(6134),l=n(9822);class u extends o.BaseManager{constructor(e={}){var t;if(super(e),this._isReady=!1,this._names=[],this._terminalConnections=new Set,this._runningChanged=new s.Signal(this),this._connectionFailure=new s.Signal(this),!this.isAvailable())return this._ready=Promise.reject("Terminals unavailable"),void this._ready.catch((e=>{}));this._pollModels=new i.Poll({auto:!1,factory:()=>this.requestRunning(),frequency:{interval:1e4,backoff:!0,max:3e5},name:"@jupyterlab/services:TerminalManager#models",standby:null!==(t=e.standby)&&void 0!==t?t:"when-hidden"}),this._ready=(async()=>{await this._pollModels.start(),await this._pollModels.tick,this._isReady=!0})()}get isReady(){return this._isReady}get ready(){return this._ready}get runningChanged(){return this._runningChanged}get connectionFailure(){return this._connectionFailure}dispose(){this.isDisposed||(this._names.length=0,this._terminalConnections.forEach((e=>e.dispose())),this._pollModels.dispose(),super.dispose())}isAvailable(){return(0,a.isAvailable)()}connectTo(e){const t=new l.TerminalConnection({...e,serverSettings:this.serverSettings});return this._onStarted(t),this._names.includes(e.model.name)||this.refreshRunning().catch((()=>{})),t}running(){return this._models[Symbol.iterator]()}async refreshRunning(){await this._pollModels.refresh(),await this._pollModels.tick}async startNew(e){const t=await(0,a.startNew)(this.serverSettings,null==e?void 0:e.name,null==e?void 0:e.cwd);return await this.refreshRunning(),this.connectTo({model:t})}async shutdown(e){await(0,a.shutdownTerminal)(e,this.serverSettings),await this.refreshRunning()}async shutdownAll(){await this.refreshRunning(),await Promise.all(this._names.map((e=>(0,a.shutdownTerminal)(e,this.serverSettings)))),await this.refreshRunning()}async requestRunning(){var e,t;let n;try{n=await(0,a.listRunning)(this.serverSettings)}catch(n){throw(n instanceof r.ServerConnection.NetworkError||503===(null===(e=n.response)||void 0===e?void 0:e.status)||424===(null===(t=n.response)||void 0===t?void 0:t.status))&&this._connectionFailure.emit(n),n}if(this.isDisposed)return;const i=n.map((({name:e})=>e)).sort();i!==this._names&&(this._names=i,this._terminalConnections.forEach((e=>{i.includes(e.name)||e.dispose()})),this._runningChanged.emit(this._models))}_onStarted(e){this._terminalConnections.add(e),e.disposed.connect(this._onDisposed,this)}_onDisposed(e){this._terminalConnections.delete(e),this.refreshRunning().catch((()=>{}))}get _models(){return this._names.map((e=>({name:e})))}}t.TerminalManager=u,function(e){e.NoopManager=class extends e{constructor(){super(...arguments),this._readyPromise=new Promise((()=>{}))}get isActive(){return!1}get parentReady(){return super.ready}get ready(){return this.parentReady.then((()=>this._readyPromise))}async startNew(e){return Promise.reject(new Error("Not implemented in no-op Terminal Manager"))}connectTo(e){throw Error("Not implemented in no-op Terminal Manager")}async shutdown(e){return Promise.reject(new Error("Not implemented in no-op Terminal Manager"))}async requestRunning(){return Promise.resolve()}}}(u||(t.TerminalManager=u={}))},6134:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shutdownTerminal=t.listRunning=t.startNew=t.isAvailable=t.TERMINAL_SERVICE_URL=void 0;const i=n(8925),s=n(2920);function r(){return"true"===String(i.PageConfig.getOption("terminalsAvailable")).toLowerCase()}var o;t.TERMINAL_SERVICE_URL="api/terminals",t.isAvailable=r,t.startNew=async function(e=s.ServerConnection.makeSettings(),n,r){o.errorIfNotAvailable();const a=i.URLExt.join(e.baseUrl,t.TERMINAL_SERVICE_URL),l={method:"POST",body:JSON.stringify({name:n,cwd:r})},u=await s.ServerConnection.makeRequest(a,l,e);if(200!==u.status)throw await s.ServerConnection.ResponseError.create(u);return await u.json()},t.listRunning=async function(e=s.ServerConnection.makeSettings()){o.errorIfNotAvailable();const n=i.URLExt.join(e.baseUrl,t.TERMINAL_SERVICE_URL),r=await s.ServerConnection.makeRequest(n,{},e);if(200!==r.status)throw await s.ServerConnection.ResponseError.create(r);const a=await r.json();if(!Array.isArray(a))throw new Error("Invalid terminal list");return a},t.shutdownTerminal=async function(e,n=s.ServerConnection.makeSettings()){var r;o.errorIfNotAvailable();const a=i.URLExt.join(n.baseUrl,t.TERMINAL_SERVICE_URL),l=i.URLExt.join(a,e);if(!l.startsWith(a))throw new Error("Can only be used for terminal requests");const u=await s.ServerConnection.makeRequest(l,{method:"DELETE"},n);if(404===u.status){const t=null!==(r=(await u.json()).message)&&void 0!==r?r:`The terminal session "${e}"" does not exist on the server`;console.warn(t)}else if(204!==u.status)throw await s.ServerConnection.ResponseError.create(u)},function(e){e.errorIfNotAvailable=function(){if(!r())throw new Error("Terminals Unavailable")}}(o||(o={}))},6994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAvailable=void 0;const i=n(6134);Object.defineProperty(t,"isAvailable",{enumerable:!0,get:function(){return i.isAvailable}})},9191:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManager=void 0;const i=n(8925),s=n(5764),r=n(6049),o=n(8571),a=n(2920),l=n(3867),u="@jupyterlab/services:UserManager#user";class c extends l.BaseManager{constructor(e={}){var t;super(e),this._isReady=!1,this._userChanged=new o.Signal(this),this._connectionFailure=new o.Signal(this),this._ready=this.requestUser().then((()=>{this.isDisposed||(this._isReady=!0)})).catch((e=>new Promise((()=>{})))),this._pollSpecs=new r.Poll({auto:!1,factory:()=>this.requestUser(),frequency:{interval:61e3,backoff:!0,max:3e5},name:u,standby:null!==(t=e.standby)&&void 0!==t?t:"when-hidden"}),this.ready.then((()=>{this._pollSpecs.start()}))}get isReady(){return this._isReady}get ready(){return this._ready}get identity(){return this._identity}get permissions(){return this._permissions}get userChanged(){return this._userChanged}get connectionFailure(){return this._connectionFailure}dispose(){this._pollSpecs.dispose(),super.dispose()}async refreshUser(){await this._pollSpecs.refresh(),await this._pollSpecs.tick}async requestUser(){if(this.isDisposed)return;const{baseUrl:e}=this.serverSettings,{makeRequest:t,ResponseError:n}=a.ServerConnection,r=i.URLExt.join(e,"api/me"),o=await t(r,{},this.serverSettings);if(200!==o.status)throw await n.create(o);const l={identity:this._identity,permissions:this._permissions},c=await o.json(),h=c.identity,{localStorage:p}=window,f=p.getItem(u);if(f&&(!h.initials||!h.color)){const e=JSON.parse(f);h.initials=h.initials||e.initials||h.name.substring(0,1),h.color=h.color||e.color||d.getRandomColor()}s.JSONExt.deepEqual(c,l)||(this._identity=h,this._permissions=c.permissions,p.setItem(u,JSON.stringify(h)),this._userChanged.emit(c))}}var d;t.UserManager=c,function(e){const t=["var(--jp-collaborator-color1)","var(--jp-collaborator-color2)","var(--jp-collaborator-color3)","var(--jp-collaborator-color4)","var(--jp-collaborator-color5)","var(--jp-collaborator-color6)","var(--jp-collaborator-color7)"];e.getRandomColor=()=>t[Math.floor(Math.random()*t.length)]}(d||(d={}))},7441:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateProperty=void 0,t.validateProperty=function(e,t,n,i=[]){if(!e.hasOwnProperty(t))throw Error(`Missing property '${t}'`);const s=e[t];if(void 0!==n){let e=!0;switch(n){case"array":e=Array.isArray(s);break;case"object":e=void 0!==s;break;default:e=typeof s===n}if(!e)throw new Error(`Property '${t}' is not of type '${n}'`);if(i.length>0){let e=!0;switch(n){case"string":case"number":case"boolean":e=i.includes(s);break;default:e=i.findIndex((e=>e===s))>=0}if(!e)throw new Error(`Property '${t}' is not one of the valid values ${JSON.stringify(i)}`)}}}},8053:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceManager=void 0;const i=n(8925),s=n(1670),r=n(2920);class o extends s.DataConnector{constructor(e={}){var t;super(),this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:r.ServerConnection.makeSettings()}async fetch(e){const{serverSettings:t}=this,{baseUrl:n,appUrl:i}=t,{makeRequest:s,ResponseError:o}=r.ServerConnection,l=n+i,u=a.url(l,e),c=await s(u,{},t);if(200!==c.status)throw await o.create(c);return c.json()}async list(){const{serverSettings:e}=this,{baseUrl:t,appUrl:n}=e,{makeRequest:i,ResponseError:s}=r.ServerConnection,o=t+n,l=a.url(o,""),u=await i(l,{},e);if(200!==u.status)throw await s.create(u);return(await u.json()).workspaces}async remove(e){const{serverSettings:t}=this,{baseUrl:n,appUrl:i}=t,{makeRequest:s,ResponseError:o}=r.ServerConnection,l=n+i,u=a.url(l,e),c=await s(u,{method:"DELETE"},t);if(204!==c.status)throw await o.create(c)}async save(e,t){const{serverSettings:n}=this,{baseUrl:i,appUrl:s}=n,{makeRequest:o,ResponseError:l}=r.ServerConnection,u=i+s,c=a.url(u,e),d={body:JSON.stringify(t),method:"PUT"},h=await o(c,d,n);if(204!==h.status)throw await l.create(h)}}var a;t.WorkspaceManager=o,function(e){e.url=function(e,t){const n=i.URLExt.join(e,"api/workspaces"),s=i.URLExt.join(n,t);if(!s.startsWith(n))throw new Error("Can only be used for workspaces requests");return s}}(a||(a={}))},4949:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataConnector=void 0,t.DataConnector=class{async list(e){throw new Error("DataConnector#list method has not been implemented.")}async remove(e){throw new Error("DataConnector#remove method has not been implemented.")}async save(e,t){throw new Error("DataConnector#save method has not been implemented.")}}},1670:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),s(n(4949),t),s(n(9708),t),s(n(4025),t),s(n(2133),t),s(n(8022),t)},9708:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4025:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RestorablePool=void 0;const i=n(5764),s=n(6573),r=n(8571);var o;t.RestorablePool=class{constructor(e){this._added=new r.Signal(this),this._current=null,this._currentChanged=new r.Signal(this),this._hasRestored=!1,this._isDisposed=!1,this._objects=new Set,this._restore=null,this._restored=new i.PromiseDelegate,this._updated=new r.Signal(this),this.namespace=e.namespace}get added(){return this._added}get current(){return this._current}set current(e){this._current!==e&&null!==e&&this._objects.has(e)&&(this._current=e,this._currentChanged.emit(this._current))}get currentChanged(){return this._currentChanged}get isDisposed(){return this._isDisposed}get restored(){return this._restored.promise}get size(){return this._objects.size}get updated(){return this._updated}async add(e){var t,n;if(e.isDisposed){const t="A disposed object cannot be added.";throw console.warn(t,e),new Error(t)}if(this._objects.has(e)){const t="This object already exists in the pool.";throw console.warn(t,e),new Error(t)}if(this._objects.add(e),e.disposed.connect(this._onInstanceDisposed,this),!o.injectedProperty.get(e)){if(this._restore){const{connector:i}=this._restore,s=this._restore.name(e);if(s){const r=`${this.namespace}:${s}`,a=null===(n=(t=this._restore).args)||void 0===n?void 0:n.call(t,e);o.nameProperty.set(e,r),await i.save(r,{data:a})}}this._added.emit(e)}}dispose(){this.isDisposed||(this._current=null,this._isDisposed=!0,this._objects.clear(),r.Signal.clearData(this))}find(e){const t=this._objects.values();for(const n of t)if(e(n))return n}forEach(e){this._objects.forEach(e)}filter(e){const t=[];return this.forEach((n=>{e(n)&&t.push(n)})),t}inject(e){return o.injectedProperty.set(e,!0),this.add(e)}has(e){return this._objects.has(e)}async restore(e){if(this._hasRestored)throw new Error("This pool has already been restored.");this._hasRestored=!0;const{command:t,connector:n,registry:i,when:s}=e,r=this.namespace,o=s?[n.list(r)].concat(s):[n.list(r)];this._restore=e;const[a]=await Promise.all(o),l=await Promise.all(a.ids.map((async(e,s)=>{const r=a.values[s],o=r&&r.data;return void 0===o?n.remove(e):i.execute(t,o).catch((()=>n.remove(e)))})));return this._restored.resolve(),l}async save(e){var t,n;const i=o.injectedProperty.get(e);if(!this._restore||!this.has(e)||i)return;const{connector:s}=this._restore,r=this._restore.name(e),a=o.nameProperty.get(e),l=r?`${this.namespace}:${r}`:"";if(a&&a!==l&&await s.remove(a),o.nameProperty.set(e,l),l){const i=null===(n=(t=this._restore).args)||void 0===n?void 0:n.call(t,e);await s.save(l,{data:i})}a!==l&&this._updated.emit(e)}_onInstanceDisposed(e){if(this._objects.delete(e),e===this._current&&(this._current=null,this._currentChanged.emit(this._current)),o.injectedProperty.get(e))return;if(!this._restore)return;const{connector:t}=this._restore,n=o.nameProperty.get(e);n&&t.remove(n)}},function(e){e.injectedProperty=new s.AttachedProperty({name:"injected",create:()=>!1}),e.nameProperty=new s.AttachedProperty({name:"name",create:()=>""})}(o||(o={}))},2133:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StateDB=void 0;const i=n(8571);class s{constructor(e={}){this._changed=new i.Signal(this);const{connector:t,transform:n}=e;this._connector=t||new s.Connector,this._ready=n?n.then((e=>{const{contents:t,type:n}=e;switch(n){case"cancel":default:return;case"clear":return this._clear();case"merge":return this._merge(t||{});case"overwrite":return this._overwrite(t||{})}})):Promise.resolve(void 0)}get changed(){return this._changed}async clear(){await this._ready,await this._clear()}async fetch(e){return await this._ready,this._fetch(e)}async list(e){return await this._ready,this._list(e)}async remove(e){await this._ready,await this._remove(e),this._changed.emit({id:e,type:"remove"})}async save(e,t){await this._ready,await this._save(e,t),this._changed.emit({id:e,type:"save"})}async toJSON(){await this._ready;const{ids:e,values:t}=await this._list();return t.reduce(((t,n,i)=>(t[e[i]]=n,t)),{})}async _clear(){await Promise.all((await this._list()).ids.map((e=>this._remove(e))))}async _fetch(e){const t=await this._connector.fetch(e);if(t)return JSON.parse(t).v}async _list(e=""){const{ids:t,values:n}=await this._connector.list(e);return{ids:t,values:n.map((e=>JSON.parse(e).v))}}async _merge(e){await Promise.all(Object.keys(e).map((t=>e[t]&&this._save(t,e[t]))))}async _overwrite(e){await this._clear(),await this._merge(e)}async _remove(e){return this._connector.remove(e)}async _save(e,t){return this._connector.save(e,JSON.stringify({v:t}))}}t.StateDB=s,function(e){e.Connector=class{constructor(){this._storage={}}async fetch(e){return this._storage[e]}async list(e=""){return Object.keys(this._storage).reduce(((t,n)=>(""!==e&&e!==n.split(":")[0]||(t.ids.push(n),t.values.push(this._storage[n])),t)),{ids:[],values:[]})}async remove(e){delete this._storage[e]}async save(e,t){this._storage[e]=t}}}(s||(t.StateDB=s={}))},8022:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IStateDB=void 0;const i=n(5764);t.IStateDB=new i.Token("@jupyterlab/coreutils:IStateDB",'A service for the JupyterLab state database.\n Use this if you want to store data that will persist across page loads.\n See "state database" for more information.')},2115:(e,t,n)=>{"use strict";n.d(t,{l:()=>o});var i=n(8925),s=n(6409);const r=16895;class o{constructor(e){this.contentsManager=e.contentsManager}async processDriveRequest(e){switch(e.method){case"readdir":return this.readdir(e);case"rmdir":return this.rmdir(e);case"rename":return this.rename(e);case"getmode":return this.getmode(e);case"lookup":return this.lookup(e);case"mknod":return this.mknod(e);case"getattr":return this.getattr(e);case"get":return this.get(e);case"put":return this.put(e)}throw`Drive request ${e.method} does not exist.`}async readdir(e){const t=await this.contentsManager.get(e.path,{content:!0});let n=[];return"directory"===t.type&&t.content&&(n=t.content.map((e=>e.name))),n}async rmdir(e){return await this.contentsManager.delete(e.path),null}async rename(e){return await this.contentsManager.rename(e.path,e.data.newPath),null}async getmode(e){let t;return t="directory"===(await this.contentsManager.get(e.path)).type?r:33206,t}async lookup(e){let t;try{t={ok:!0,mode:"directory"===(await this.contentsManager.get(e.path)).type?r:33206}}catch(e){t={ok:!1}}return t}async mknod(e){const t=await this.contentsManager.newUntitled({path:i.PathExt.dirname(e.path),type:e.data.mode===r?"directory":"file",ext:i.PathExt.extname(e.path)});return await this.contentsManager.rename(t.path,e.path),null}async getattr(e){const t=await this.contentsManager.get(e.path),n=new Date(0).toISOString();return{dev:1,nlink:1,uid:0,gid:0,rdev:0,size:t.size||0,blksize:s.cS,blocks:Math.ceil(t.size||0/s.cS),atime:t.last_modified||n,mtime:t.last_modified||n,ctime:t.created||n,timestamp:0}}async get(e){const t=await this.contentsManager.get(e.path,{content:!0});let n;return"directory"!==t.type&&(n={content:"json"===t.format?JSON.stringify(t.content):t.content,format:t.format}),n}async put(e){return await this.contentsManager.save(e.path,{content:"json"===e.data.format?JSON.parse(e.data.data):e.data.data,type:"file",format:e.data.format}),null}}},6409:(e,t,n)=>{"use strict";n.d(t,{cS:()=>s,cW:()=>i});const i="/api/drive.v1",s=4096;new TextEncoder,new TextDecoder("utf-8")},9342:(e,t,n)=>{"use strict";n.d(t,{GJ:()=>a,LX:()=>c,PW:()=>u,xG:()=>l});var i=n(8925),s=n(3178),r=n.n(s),o=n(5764);const a=new o.Token("@jupyterlite/contents:IContents");var l,u;!function(e){e.JSON="application/json",e.PLAIN_TEXT="text/plain",e.OCTET_STREAM="octet/stream"}(l||(l={})),function(e){const t=JSON.parse(i.PageConfig.getOption("fileTypes")||"{}");e.getType=function(e,n=null){e=e.toLowerCase();for(const n of Object.values(t))for(const t of n.extensions||[])if(t===e&&n.mimeTypes&&n.mimeTypes.length)return n.mimeTypes[0];return r().getType(e)||n||l.OCTET_STREAM},e.hasFormat=function(e,n){e=e.toLowerCase();for(const i of Object.values(t))if(i.fileFormat===n)for(const t of i.extensions||[])if(t===e)return!0;return!1}}(u||(u={}));const c=new o.Token("@jupyterlite/contents:IBroadcastChannelWrapper")},6203:(e,t,n)=>{"use strict";n.d(t,{PN:()=>r,X:()=>o,il:()=>s});var i=n(5764);const s=new i.Token("@jupyterlite/kernel:IKernels"),r="javascript",o=new i.Token("@jupyterlite/kernel:IKernelSpecs")},2015:(e,t,n)=>{"use strict";n.r(t),n.d(t,{KERNEL_SETTINGS_SCHEMA:()=>l,default:()=>h});var i=n(8925),s=n(9401),r=n(6203),o=n(9342);const a=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"https://jupyterlite-pyodide-kernel.readthedocs.org/en/latest/reference/schema/settings-v0.html#","title":"Pyodide Kernel Settings Schema v0","description":"Pyodide-specific configuration values. Will be defined in another location in the future.","type":"object","properties":{"pyodideUrl":{"description":"The path to the main pyodide.js entry point","type":"string","default":"https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js","format":"uri"},"disablePyPIFallback":{"description":"Disable the piplite behavior of falling back to https://pypi.org/pypi/","default":false,"type":"boolean"},"pipliteUrls":{"description":"Paths to PyPI-compatible API endpoints for wheels. If ending in ``all.json``, assumed to be an aggregate, keyed by package name, with relative paths","type":"array","items":{"type":"string"},"default":[],"format":"uri"},"loadPyodideOptions":{"type":"object","description":"additional options to provide to `loadPyodide`, see https://pyodide.org/en/stable/usage/api/js-api.html#globalThis.loadPyodide","default":{},"properties":{"packages":{"type":"array","items":{"type":"string"}}}}}}');var l=n.t(a,2),u=n(5237);const c=`data:image/svg+xml;base64,${btoa(n.n(u)())}`,d="@jupyterlite/pyodide-kernel-extension:kernel",h=[{id:d,autoStart:!0,requires:[r.X],optional:[s.u,o.LX],activate:(e,t,s,r)=>{const o=e.serviceManager.contents,a=JSON.parse(i.PageConfig.getOption("litePluginSettings")||"{}")[d]||{},l=i.PageConfig.getBaseUrl(),u=a.pyodideUrl||"https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js",h=i.URLExt.parse(u).href,p=a.pipliteWheelUrl?i.URLExt.parse(a.pipliteWheelUrl).href:void 0,f=(a.pipliteUrls||[]).map((e=>i.URLExt.parse(e).href)),m=!!a.disablePyPIFallback,g=a.loadPyodideOptions||{};for(const[e,t]of Object.entries(g))e.endsWith("URL")&&"string"==typeof t&&(g[e]=new URL(t,l).href);t.register({spec:{name:"python",display_name:"Python (Pyodide)",language:"python",argv:[],resources:{"logo-32x32":c,"logo-64x64":c}},create:async e=>{const{PyodideKernel:t}=await n.e(635).then(n.bind(n,7992)),i=!!((null==s?void 0:s.enabled)&&(null==r?void 0:r.enabled)||crossOriginIsolated);return i?console.info("Pyodide contents will be synced with Jupyter Contents"):console.warn("Pyodide contents will NOT be synced with Jupyter Contents"),new t({...e,pyodideUrl:h,pipliteWheelUrl:p,pipliteUrls:f,disablePyPIFallback:m,mountDrive:i,loadPyodideOptions:g,contentsManager:o})}})}}]},7070:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>ie});var i=n(8925),s=n(9342),r=n(5764);const o="JupyterLite Storage";class a{constructor(e){this.reduceBytesToString=(e,t)=>e+String.fromCharCode(t),this._serverContents=new Map,this._storageName=o,this._storageDrivers=null,this._localforage=e.localforage,this._storageName=e.storageName||o,this._storageDrivers=e.storageDrivers||null,this._ready=new r.PromiseDelegate}async initialize(){await this.initStorage(),this._ready.resolve(void 0)}async initStorage(){this._storage=this.createDefaultStorage(),this._counters=this.createDefaultCounters(),this._checkpoints=this.createDefaultCheckpoints()}get ready(){return this._ready.promise}get storage(){return this.ready.then((()=>this._storage))}get counters(){return this.ready.then((()=>this._counters))}get checkpoints(){return this.ready.then((()=>this._checkpoints))}get defaultStorageOptions(){const e=this._storageDrivers&&this._storageDrivers.length?this._storageDrivers:null;return{version:1,name:this._storageName,...e?{driver:e}:{}}}createDefaultStorage(){return this._localforage.createInstance({description:"Offline Storage for Notebooks and Files",storeName:"files",...this.defaultStorageOptions})}createDefaultCounters(){return this._localforage.createInstance({description:"Store the current file suffix counters",storeName:"counters",...this.defaultStorageOptions})}createDefaultCheckpoints(){return this._localforage.createInstance({description:"Offline Storage for Checkpoints",storeName:"checkpoints",...this.defaultStorageOptions})}async newUntitled(e){var t,n,r;const o=null!==(t=null==e?void 0:e.path)&&void 0!==t?t:"",a=null!==(n=null==e?void 0:e.type)&&void 0!==n?n:"notebook",u=(new Date).toISOString();let c=i.PathExt.dirname(o);const d=i.PathExt.basename(o),h=i.PathExt.extname(o),p=await this.get(c);let f,m="";switch(o&&!h&&p?(c=`${o}/`,m=""):c&&d?(c=`${c}/`,m=d):(c="",m=o),a){case"directory":m=`Untitled Folder${await this._incrementCounter("directory")||""}`,f={name:m,path:`${c}${m}`,last_modified:u,created:u,format:"json",mimetype:"",content:null,size:0,writable:!0,type:"directory"};break;case"notebook":{const e=await this._incrementCounter("notebook");m=m||`Untitled${e||""}.ipynb`,f={name:m,path:`${c}${m}`,last_modified:u,created:u,format:"json",mimetype:s.xG.JSON,content:l.EMPTY_NB,size:JSON.stringify(l.EMPTY_NB).length,writable:!0,type:"notebook"};break}default:{const t=null!==(r=null==e?void 0:e.ext)&&void 0!==r?r:".txt",n=await this._incrementCounter("file"),i=s.PW.getType(t)||s.xG.OCTET_STREAM;let o;o=s.PW.hasFormat(t,"text")||-1!==i.indexOf("text")?"text":-1!==t.indexOf("json")||-1!==t.indexOf("ipynb")?"json":"base64",m=m||`untitled${n||""}${t}`,f={name:m,path:`${c}${m}`,last_modified:u,created:u,format:o,mimetype:i,content:"",size:0,writable:!0,type:"file"};break}}const g=f.path;return await(await this.storage).setItem(g,f),f}async copy(e,t){let n=i.PathExt.basename(e);for(t=""===t?"":`${t.slice(1)}/`;await this.get(`${t}${n}`,{content:!0});){const e=i.PathExt.extname(n),t=n.replace(e,"");n=`${t} (copy)${e}`}const s=`${t}${n}`;let r=await this.get(e,{content:!0});if(!r)throw Error(`Could not find file with path ${e}`);return r={...r,name:n,path:s},await(await this.storage).setItem(s,r),r}async get(e,t){if(""===(e=decodeURIComponent(e.replace(/^\//,""))))return await this._getFolder(e);const n=await this.storage,r=await n.getItem(e),o=await this._getServerContents(e,t),a=r||o;if(!a)return null;if(!(null==t?void 0:t.content))return{size:0,...a,content:null};if("directory"===a.type){const t=new Map;await n.iterate(((n,i)=>{i===`${e}/${n.name}`&&t.set(n.name,n)}));const r=o?o.content:Array.from((await this._getServerDirectory(e)).values());for(const e of r)t.has(e.name)||t.set(e.name,e);const l=[...t.values()];return{name:i.PathExt.basename(e),path:e,last_modified:a.last_modified,created:a.created,format:"json",mimetype:s.xG.JSON,content:l,size:0,writable:!0,type:"directory"}}return a}async rename(e,t){const n=decodeURIComponent(e),s=await this.get(n,{content:!0});if(!s)throw Error(`Could not find file with path ${n}`);const r=(new Date).toISOString(),o=i.PathExt.basename(t),a={...s,name:o,path:t,last_modified:r},l=await this.storage;if(await l.setItem(t,a),await l.removeItem(n),await(await this.checkpoints).removeItem(n),"directory"===s.type){let n;for(n of s.content)await this.rename(i.URLExt.join(e,n.name),i.URLExt.join(t,n.name))}return a}async save(e,t={}){var n;e=decodeURIComponent(e);const r=i.PathExt.extname(null!==(n=t.name)&&void 0!==n?n:""),o=t.chunk,a=!!o&&(o>1||-1===o);let l=await this.get(e,{content:a});if(l||(l=await this.newUntitled({path:e,ext:r,type:"file"})),!l)return null;const u=l.content,c=(new Date).toISOString();if(l={...l,...t,last_modified:c},t.content&&"base64"===t.format){const e=!o||-1===o;if(".ipynb"===r){const n=this._handleChunk(t.content,u,a);l={...l,content:e?JSON.parse(n):n,format:"json",type:"notebook",size:n.length}}else if(s.PW.hasFormat(r,"json")){const n=this._handleChunk(t.content,u,a);l={...l,content:e?JSON.parse(n):n,format:"json",type:"file",size:n.length}}else if(s.PW.hasFormat(r,"text")){const e=this._handleChunk(t.content,u,a);l={...l,content:e,format:"text",type:"file",size:e.length}}else{const e=t.content;l={...l,content:e,size:atob(e).length}}}return await(await this.storage).setItem(e,l),l}async delete(e){const t=`${e=decodeURIComponent(e)}/`,n=(await(await this.storage).keys()).filter((n=>n===e||n.startsWith(t)));await Promise.all(n.map(this.forgetPath,this))}async forgetPath(e){await Promise.all([(await this.storage).removeItem(e),(await this.checkpoints).removeItem(e)])}async createCheckpoint(e){var t;const n=await this.checkpoints;e=decodeURIComponent(e);const i=await this.get(e,{content:!0});if(!i)throw Error(`Could not find file with path ${e}`);const s=(null!==(t=await n.getItem(e))&&void 0!==t?t:[]).filter(Boolean);return s.push(i),s.length>5&&s.splice(0,s.length-5),await n.setItem(e,s),{id:""+(s.length-1),last_modified:i.last_modified}}async listCheckpoints(e){return(await(await this.checkpoints).getItem(e)||[]).filter(Boolean).map(this.normalizeCheckpoint,this)}normalizeCheckpoint(e,t){return{id:t.toString(),last_modified:e.last_modified}}async restoreCheckpoint(e,t){e=decodeURIComponent(e);const n=(await(await this.checkpoints).getItem(e)||[])[parseInt(t)];await(await this.storage).setItem(e,n)}async deleteCheckpoint(e,t){e=decodeURIComponent(e);const n=await(await this.checkpoints).getItem(e)||[],i=parseInt(t);n.splice(i,1),await(await this.checkpoints).setItem(e,n)}_handleChunk(e,t,n){const i=decodeURIComponent(escape(atob(e)));return n?t+i:i}async _getFolder(e){const t=new Map,n=await this.storage;await n.iterate(((e,n)=>{n.includes("/")||t.set(e.path,e)}));for(const n of(await this._getServerDirectory(e)).values())t.has(n.path)||t.set(n.path,n);return e&&0===t.size?null:{name:"",path:e,last_modified:new Date(0).toISOString(),created:new Date(0).toISOString(),format:"json",mimetype:s.xG.JSON,content:Array.from(t.values()),size:0,writable:!0,type:"directory"}}async _getServerContents(e,t){const n=i.PathExt.basename(e);let r=(await this._getServerDirectory(i.URLExt.join(e,".."))).get(n);if(!r)return null;if(r=r||{name:n,path:e,last_modified:new Date(0).toISOString(),created:new Date(0).toISOString(),format:"text",mimetype:s.xG.PLAIN_TEXT,type:"file",writable:!0,size:0,content:""},null==t?void 0:t.content)if("directory"===r.type){const t=await this._getServerDirectory(e);r={...r,content:Array.from(t.values())}}else{const t=i.URLExt.join(i.PageConfig.getBaseUrl(),"files",e),o=await fetch(t);if(!o.ok)return null;const a=r.mimetype||o.headers.get("Content-Type"),l=i.PathExt.extname(n);if("notebook"===r.type||s.PW.hasFormat(l,"json")||-1!==(null==a?void 0:a.indexOf("json"))||e.match(/\.(ipynb|[^/]*json[^/]*)$/)){const e=await o.text();r={...r,content:JSON.parse(e),format:"json",mimetype:r.mimetype||s.xG.JSON,size:e.length}}else if(s.PW.hasFormat(l,"text")||-1!==a.indexOf("text")){const e=await o.text();r={...r,content:e,format:"text",mimetype:a||s.xG.PLAIN_TEXT,size:e.length}}else{const e=await o.arrayBuffer(),t=new Uint8Array(e);r={...r,content:btoa(t.reduce(this.reduceBytesToString,"")),format:"base64",mimetype:a||s.xG.OCTET_STREAM,size:t.length}}}return r}async _getServerDirectory(e){const t=this._serverContents.get(e)||new Map;if(!this._serverContents.has(e)){const n=i.URLExt.join(i.PageConfig.getBaseUrl(),"api/contents",e,"all.json");try{const e=await fetch(n),i=JSON.parse(await e.text());for(const e of i.content)t.set(e.name,e)}catch(e){console.warn(`don't worry, about ${e}... nothing's broken. If there had been a\n file at ${n}, you might see some more files.`)}this._serverContents.set(e,t)}return t}async _incrementCounter(e){var t;const n=await this.counters,i=(null!==(t=await n.getItem(e))&&void 0!==t?t:-1)+1;return await n.setItem(e,i),i}}var l;!function(e){e.EMPTY_NB={metadata:{orig_nbformat:4},nbformat_minor:4,nbformat:4,cells:[]}}(l||(l={}));var u=n(6409),c=n(2115);class d{constructor(e){this.isDisposed=!1,this._onMessage=async e=>{if(!this._channel)return;const t=e.data;if("broadcast.ts"!==(null==t?void 0:t.receiver))return;const n=await this._driveContentsProcessor.processDriveRequest(t);this._channel.postMessage(n)},this._channel=null,this._enabled=!1,this._contents=e.contents,this._driveContentsProcessor=new c.l({contentsManager:this._contents})}get enabled(){return this._enabled}enable(){this._channel?console.warn("BroadcastChannel already created and enabled"):(this._channel=new BroadcastChannel(u.cW),this._channel.addEventListener("message",this._onMessage),this._enabled=!0)}disable(){this._channel&&(this._channel.removeEventListener("message",this._onMessage),this._channel=null),this._enabled=!1}dispose(){this.isDisposed||(this.disable(),this.isDisposed=!0)}}var h,p=n(6203),f=n(8571);class m{constructor(e={}){if(this._map=new Map,this._changed=new f.Signal(this),this._isDisposed=!1,this._itemCmp=e.itemCmp||h.itemCmp,e.values)for(const t in e.values)this._map.set(t,e.values[t])}get type(){return"Map"}get changed(){return this._changed}get isDisposed(){return this._isDisposed}get size(){return this._map.size}set(e,t){const n=this._map.get(e);if(void 0===t)throw Error("Cannot set an undefined value, use remove");const i=this._itemCmp;return void 0!==n&&i(n,t)||(this._map.set(e,t),this._changed.emit({type:n?"change":"add",key:e,oldValue:n,newValue:t})),n}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){const e=[];return this._map.forEach(((t,n)=>{e.push(n)})),e}values(){const e=[];return this._map.forEach(((t,n)=>{e.push(t)})),e}delete(e){const t=this._map.get(e);return this._map.delete(e)&&this._changed.emit({type:"remove",key:e,oldValue:t,newValue:void 0}),t}clear(){const e=this.keys();for(let t=0;tthis._queue.push({resolve:e,reject:t})));return e||this._dispatch(),t}runExclusive(e){return b(this,void 0,void 0,(function*(){const[t,n]=yield this.acquire();try{return yield e(t)}finally{n()}}))}waitForUnlock(){return b(this,void 0,void 0,(function*(){return this.isLocked()?new Promise((e=>this._waiters.push({resolve:e}))):Promise.resolve()}))}isLocked(){return this._value<=0}release(){if(this._maxConcurrency>1)throw new Error("this method is unavailable on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){const e=this._currentReleaser;this._currentReleaser=void 0,e()}}cancel(){this._queue.forEach((e=>e.reject(this._cancelError))),this._queue=[]}_dispatch(){const e=this._queue.shift();if(!e)return;let t=!1;this._currentReleaser=()=>{t||(t=!0,this._value++,this._resolveWaiters(),this._dispatch())},e.resolve([this._value--,this._currentReleaser])}_resolveWaiters(){this._waiters.forEach((e=>e.resolve())),this._waiters=[]}}class D{constructor(e){this._semaphore=new w(1,e)}acquire(){return e=this,t=void 0,i=function*(){const[,e]=yield this._semaphore.acquire();return e},new((n=void 0)||(n=Promise))((function(s,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}));var e,t,n,i}runExclusive(e){return this._semaphore.runExclusive((()=>e()))}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.release()}cancel(){return this._semaphore.cancel()}}const x=v.supportedKernelWebSocketProtocols.v1KernelWebsocketJupyterOrg;class C{constructor(e){this._kernels=new m,this._clients=new m,this._kernelClients=new m;const{kernelspecs:t}=e;this._kernelspecs=t}async startNew(e){const{id:t,name:n,location:i}=e,s=this._kernelspecs.factories.get(n);if(!s)return{id:t,name:n};const o=new D,a=(e,t,n)=>{var i;const s=this._kernels.get(e);if(!s)throw Error(`No kernel ${e}`);this._clients.set(t,n),null===(i=this._kernelClients.get(e))||void 0===i||i.add(t),n.on("message",(async e=>{let t;if(e instanceof ArrayBuffer)e=new Uint8Array(e).buffer,t=(0,g.deserialize)(e,x);else{if("string"!=typeof e)return;{const n=(new TextEncoder).encode(e);t=(0,g.deserialize)(n.buffer,x)}}"input_reply"===t.header.msg_type?s.handleMessage(t):(async e=>{await o.runExclusive((async()=>{await s.ready,await s.handleMessage(e)}))})(t)}));const r=()=>{var n;this._clients.delete(t),null===(n=this._kernelClients.get(e))||void 0===n||n.delete(t)};s.disposed.connect(r),n.onclose=r},l=null!=t?t:r.UUID.uuid4(),u=`${C.WS_BASE_URL}api/kernels/${l}/channels`,c=this._kernels.get(l);if(c)return{id:c.id,name:c.name};const d=await s({id:l,sendMessage:e=>{const t=e.header.session,n=this._clients.get(t);if(!n)return void console.warn(`Trying to send message on removed socket for kernel ${l}`);const i=(0,g.serialize)(e,x);if("iopub"!==e.channel)n.send(i);else{const e=this._kernelClients.get(l);null==e||e.forEach((e=>{var t;null===(t=this._clients.get(e))||void 0===t||t.send(i)}))}},name:n,location:i});this._kernels.set(l,d),this._kernelClients.set(l,new Set);const h=new _.Server(u,{mock:!1,selectProtocol:()=>x});return h.on("connection",(e=>{var t;const n=null!==(t=new URL(e.url).searchParams.get("session_id"))&&void 0!==t?t:"";a(l,n,e)})),h.on("close",(()=>{this._clients.keys().forEach((e=>{var t;const n=this._clients.get(e);(null==n?void 0:n.readyState)===WebSocket.CLOSED&&(this._clients.delete(e),null===(t=this._kernelClients.get(l))||void 0===t||t.delete(e))}))})),d.disposed.connect((()=>{h.close(),this._kernels.delete(l),this._kernelClients.delete(l)})),{id:d.id,name:d.name}}async restart(e){const t=this._kernels.get(e);if(!t)throw Error(`Kernel ${e} does not exist`);const{id:n,name:i,location:s}=t;return t.dispose(),this.startNew({id:n,name:i,location:s})}async list(){return[...this._kernels.values()].map((e=>({id:e.id,name:e.name})))}async shutdown(e){var t;null===(t=this._kernels.delete(e))||void 0===t||t.dispose()}async get(e){return this._kernels.get(e)}}!function(e){e.WS_BASE_URL=i.PageConfig.getBaseUrl().replace(/^http/,"ws")}(C||(C={}));class E{constructor(){this._specs=new Map,this._factories=new Map}get specs(){return 0===this._specs.size?null:{default:this.defaultKernelName,kernelspecs:Object.fromEntries(this._specs)}}get defaultKernelName(){let e=i.PageConfig.getOption("defaultKernelName");if(!e&&this._specs.size){const t=Array.from(this._specs.keys());t.sort(),e=t[0]}return e||p.PN}get factories(){return this._factories}register(e){const{spec:t,create:n}=e;this._specs.set(t.name,t),this._factories.set(t.name,n)}}const S="third-party-licenses.json",M=new r.Token("@jupyterlite/licenses:ILicenses"),A=Object.freeze({packages:[]});class k{async get(){return{bundles:{...await this._getFederated(),[this.appName]:await this._getAppLicenses()}}}get appName(){return i.PageConfig.getOption("appName")||"JupyterLite"}get appLicensesUrl(){return i.URLExt.join(i.PageConfig.getBaseUrl(),"build",S)}get labExtensionsUrl(){return i.PageConfig.getOption("fullLabextensionsUrl")}async _getAppLicenses(){let e=A;try{e=(await fetch(this.appLicensesUrl)).json()}catch(e){console.warn("Could not resolve licenses for",this.appName)}return e}async _getFederated(){const e={};let t;try{t=JSON.parse(i.PageConfig.getOption("federated_extensions"))}catch{return e}const n=[];for(const i of t)n.push(this._getOneFederated(i,e));try{await Promise.all(n)}catch(e){console.warn("Error resolving licenses",e)}return e}async _getOneFederated(e,t){try{const n=i.URLExt.join(this.labExtensionsUrl,e.name,"static",S),s=await fetch(n);t[e.name]=await s.json()}catch{console.warn("Could not resolve licenses for",e),t[e.name]=A}}}var F=n(9401),I=n(5026);const O=new r.Token("@jupyterlite/session:ISessions");var P,B,R;!function(e){function t(e,t,n=0,i=-1){let s,r=e.length;if(0===r)return-1;n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,s=o+i;n(e[s],t)<0?(o=s+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,s=-1){let r=e.length;if(0===r)return 0;let o=i=i<0?Math.max(0,i+r):Math.min(i,r-1),a=(s=s<0?Math.max(0,s+r):Math.min(s,r-1))-i+1;for(;a>0;){let i=a>>1,s=o+i;n(e[s],t)>0?a=i:(o=s+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i=o&&(n=s<0?o-1:o),void 0===i?i=s<0?-1:o:i<0?i=Math.max(i+o,s<0?-1:0):i>=o&&(i=s<0?o-1:o),r=s<0&&i>=n||s>0&&n>=i?0:s<0?Math.floor((i-n+1)/s+1):Math.floor((i-n-1)/s+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+s):Math.min(i,s-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;r(e,n,a-1),r(e,a,i),r(e,n,i)},e.fill=function(e,t,n=0,i=-1){let s,r=e.length;if(0!==r){n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,s=-1){let r=t(e,n,i,s);return-1!==r&&o(e,r),r},e.removeLastOf=function(e,t,i=-1,s=0){let r=n(e,t,i,s);return-1!==r&&o(e,r),r},e.removeAllOf=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r},e.removeFirstWhere=function(e,t,n=0,s=-1){let r,a=i(e,t,n,s);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeLastWhere=function(e,t,n=-1,i=0){let r,a=s(e,t,n,i);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeAllWhere=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r}}(P||(P={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(R||(R={}));class T{constructor(e){this._sessions=[],this._kernels=e.kernels}async get(e){const t=this._sessions.find((t=>t.id===e));if(!t)throw Error(`Session ${e} not found`);return t}async list(){return this._sessions}async patch(e){const{id:t,path:n,name:s,kernel:o}=e,a=this._sessions.findIndex((e=>e.id===t)),l=this._sessions[a];if(!l)throw Error(`Session ${t} not found`);const u={...l,path:null!=n?n:l.path,name:null!=s?s:l.name};if(o)if(o.id){const e=this._sessions.find((e=>{var t;return(null===(t=e.kernel)||void 0===t?void 0:t.id)===(null==o?void 0:o.id)}));e&&(u.kernel=e.kernel)}else if(o.name){const e=await this._kernels.startNew({id:r.UUID.uuid4(),name:o.name,location:i.PathExt.dirname(u.path)});e&&(u.kernel=e),this._handleKernelShutdown({kernelId:e.id,sessionId:l.id})}return this._sessions[a]=u,u}async startNew(e){var t,n,s,o;const{path:a,name:l}=e,u=this._sessions.find((e=>e.name===l));if(u)return u;const c=null!==(n=null===(t=e.kernel)||void 0===t?void 0:t.name)&&void 0!==n?n:"",d=null!==(s=e.id)&&void 0!==s?s:r.UUID.uuid4(),h=null!==(o=e.name)&&void 0!==o?o:e.path,p=i.PathExt.dirname(e.name)||i.PathExt.dirname(e.path),f=h.includes(":")?h.split(":")[0]:"",m=p.includes(f)?p:`${f}:${p}`,g=await this._kernels.startNew({id:d,name:c,location:m}),v={id:d,path:a,name:null!=l?l:a,type:"notebook",kernel:{id:g.id,name:g.name}};return this._sessions.push(v),this._handleKernelShutdown({kernelId:d,sessionId:v.id}),v}async shutdown(e){var t;const n=this._sessions.find((t=>t.id===e));if(!n)throw Error(`Session ${e} not found`);const i=null===(t=n.kernel)||void 0===t?void 0:t.id;i&&await this._kernels.shutdown(i),P.removeFirstOf(this._sessions,n)}async _handleKernelShutdown({kernelId:e,sessionId:t}){const n=await this._kernels.get(e);n&&n.disposed.connect((()=>{this.shutdown(t)}))}}const L=new r.Token("@jupyterlite/settings:ISettings");var N=n(8696);const j="JupyterLite Storage";class z{constructor(e){this._storageName=j,this._storageDrivers=null,this._localforage=e.localforage,this._storageName=e.storageName||j,this._storageDrivers=e.storageDrivers||null,this._ready=new r.PromiseDelegate}get ready(){return this._ready.promise}get storage(){return this.ready.then((()=>this._storage))}async initialize(){await this.initStorage(),this._ready.resolve(void 0)}async initStorage(){this._storage=this.defaultSettingsStorage()}get defaultStorageOptions(){var e;const t=(null===(e=this._storageDrivers)||void 0===e?void 0:e.length)?this._storageDrivers:null;return{version:1,name:this._storageName,...t?{driver:t}:{}}}defaultSettingsStorage(){return this._localforage.createInstance({description:"Offline Storage for Settings",storeName:"settings",...this.defaultStorageOptions})}async get(e){return(await this.getAll()).settings.find((t=>t.id===e))}async getAll(){const e=await this._getAll("all.json");let t=[];try{t=await this._getAll("all_federated.json")}catch{}const n=e.concat(t),i=await this.storage;return{settings:await Promise.all(n.map((async e=>{var t;const{id:n}=e,s=null!==(t=await i.getItem(n))&&void 0!==t?t:e.raw;return{...U.override(e),raw:s,settings:N.parse(s)}})))}}async save(e,t){await(await this.storage).setItem(e,t)}async _getAll(e){var t;const n=null!==(t=i.PageConfig.getOption("settingsUrl"))&&void 0!==t?t:"/";return await(await fetch(i.URLExt.join(n,e))).json()}}var U;!function(e){const t=JSON.parse(i.PageConfig.getOption("settingsOverrides")||"{}");e.override=function(e){if(t[e.id]){e.schema.properties||(e.schema.properties={});for(const[n,i]of Object.entries(t[e.id]||{}))e.schema.properties[n].default=i}return e}}(U||(U={}));const q=new r.Token("@jupyterlite/translation:ITranslation");class W{constructor(){this._prevLocale=""}async get(e){const t=i.URLExt.join(i.PageConfig.getBaseUrl(),`api/translations/${e}.json`);try{const n=await fetch(t),i=JSON.parse(await n.text());if("all"!==this._prevLocale&&"all"===e){const e=this._prevLocale;i.data[e].displayName=i.data[e].nativeName,"en"!==e&&(i.data.en.displayName=`${i.data.en.nativeName} (default)`)}return this._prevLocale=e,i}catch(t){return e?{data:{},message:`Language pack '${e}' not installed!`}:{data:{en:{displayName:"English",nativeName:"English"}},message:""}}}}const H=new r.Token("@jupyterlite/localforge:ILocalForage");var K=n(5691),$=n.n(K),V=n(3917),J=n.n(V);const G={id:"@jupyterlite/server-extension:localforage",autoStart:!0,provides:H,activate:e=>({localforage:J()})},X={id:"@jupyterlite/server-extension:localforage-memory-storage",autoStart:!0,requires:[H],activate:async(e,t)=>{JSON.parse(i.PageConfig.getOption("enableMemoryStorage")||"false")&&(console.warn("Memory storage fallback enabled: contents and settings may not be saved"),await async function(e){return await e.defineDriver($())}(t.localforage))}},Y={id:"@jupyterlite/server-extension:config-section-routes",autoStart:!0,activate:e=>{const t={};e.router.get("/api/config/(.*)",(async(e,n)=>{var i;const s=null!==(i=t[n])&&void 0!==i?i:JSON.stringify({});return new Response(s)})),e.router.patch("/api/config/(.*)",(async(e,n)=>{const i=e.body;return t[n]=i,new Response(i)}))}},Z={id:"@jupyterlite/server-extension:contents",requires:[H],autoStart:!0,provides:s.GJ,activate:(e,t)=>{const n=i.PageConfig.getOption("contentsStorageName"),s=JSON.parse(i.PageConfig.getOption("contentsStorageDrivers")||"null"),{localforage:r}=t,o=new a({storageName:n,storageDrivers:s,localforage:r});return e.started.then((()=>o.initialize().catch(console.warn))),o}},Q={id:"@jupyterlite/server-extension:contents-routes",autoStart:!0,requires:[s.GJ],activate:(e,t)=>{e.router.get("/api/contents/(.+)/checkpoints",(async(e,n)=>{const i=await t.listCheckpoints(n);return new Response(JSON.stringify(i))})),e.router.post("/api/contents/(.+)/checkpoints/(.*)",(async(e,n,i)=>{const s=await t.restoreCheckpoint(n,i);return new Response(JSON.stringify(s),{status:204})})),e.router.post("/api/contents/(.+)/checkpoints",(async(e,n)=>{const i=await t.createCheckpoint(n);return new Response(JSON.stringify(i),{status:201})})),e.router.delete("/api/contents/(.+)/checkpoints/(.*)",(async(e,n,i)=>{const s=await t.deleteCheckpoint(n,i);return new Response(JSON.stringify(s),{status:204})})),e.router.get("/api/contents(.*)",(async(e,n)=>{var i;const s={content:"1"===(null===(i=e.query)||void 0===i?void 0:i.content)},r=await t.get(n,s);return r?new Response(JSON.stringify(r)):new Response(null,{status:404})})),e.router.post("/api/contents(.*)",(async(e,n)=>{const i=e.body,s=null==i?void 0:i.copy_from;let r;return r=s?await t.copy(s,n):await t.newUntitled(i),r?new Response(JSON.stringify(r),{status:201}):new Response(null,{status:400})})),e.router.patch("/api/contents(.*)",(async(e,n)=>{var i,s;const r=null!==(s=null===(i=e.body)||void 0===i?void 0:i.path)&&void 0!==s?s:"";n="/"===n[0]?n.slice(1):n;const o=await t.rename(n,r);return new Response(JSON.stringify(o))})),e.router.put("/api/contents/(.+)",(async(e,n)=>{const i=e.body,s=await t.save(n,i);return new Response(JSON.stringify(s))})),e.router.delete("/api/contents/(.+)",(async(e,n)=>(await t.delete(n),new Response(null,{status:204}))))}},ee={id:"@jupyterlite/server-extension:service-worker",autoStart:!0,provides:F.u,activate:e=>new I.J},te={id:"@jupyterlite/server-extension:settings",autoStart:!0,requires:[H],provides:L,activate:(e,t)=>{const n=i.PageConfig.getOption("settingsStorageName"),s=JSON.parse(i.PageConfig.getOption("settingsStorageDrivers")||"null"),{localforage:r}=t,o=new z({storageName:n,storageDrivers:s,localforage:r});return e.started.then((()=>o.initialize().catch(console.warn))),o}},ne={id:"@jupyterlite/server-extension:settings-routes",autoStart:!0,requires:[L],activate:(e,t)=>{const n="/api/settings/((?:@([^/]+?)[/])?([^/]+?):([^:]+))$";e.router.get(n,(async(e,n)=>{const i=await t.get(n);return new Response(JSON.stringify(i))})),e.router.put(n,(async(e,n)=>{const i=e.body,{raw:s}=i;return await t.save(n,s),new Response(null,{status:204})})),e.router.get("/api/settings",(async e=>{const n=await t.getAll();return new Response(JSON.stringify(n))}))}},ie=[Y,Z,Q,{id:"@jupyterlite/server-extension:emscripten-filesystem",autoStart:!0,optional:[F.u],provides:s.LX,activate:(e,t)=>{const{contents:n}=e.serviceManager,i=new d({contents:n}),s="Kernel filesystem and JupyterLite contents";function r(e,t){t&&console.warn(t),e&&console.warn(e),t||e?console.warn(`${s} will NOT be synced`):console.info(`${s} will be synced`)}return t?t.ready.then((()=>{i.enable(),r()})).catch((e=>{r("JupyterLite ServiceWorker failed to become available",e)})):r("JupyterLite ServiceWorker not available"),i}},{id:"@jupyterlite/server-extension:kernels",autoStart:!0,provides:p.il,requires:[p.X],activate:(e,t)=>new C({kernelspecs:t})},{id:"@jupyterlite/server-extension:kernels-routes",autoStart:!0,requires:[p.il],activate:(e,t)=>{e.router.get("/api/kernels",(async e=>{const n=await t.list();return new Response(JSON.stringify(n))})),e.router.post("/api/kernels/(.*)/restart",(async(e,n)=>{const i=await t.restart(n);return new Response(JSON.stringify(i))})),e.router.delete("/api/kernels/(.*)",(async(e,n)=>{const i=await t.shutdown(n);return new Response(JSON.stringify(i),{status:204})}))}},{id:"@jupyterlite/server-extension:kernelspec",autoStart:!0,provides:p.X,activate:e=>new E},{id:"@jupyterlite/server-extension:kernelspec-routes",autoStart:!0,requires:[p.X],activate:(e,t)=>{e.router.get("/api/kernelspecs",(async e=>{const{specs:n}=t;if(!n)return new Response(null);const i={},s=n.kernelspecs;Object.keys(s).forEach((e=>{const t=s[e],{resources:n}=null!=t?t:{};i[e]={name:e,spec:t,resources:n}}));const r={default:n.default,kernelspecs:i};return new Response(JSON.stringify(r))}))}},{id:"@jupyterlite/server-extension:licenses",autoStart:!0,provides:M,activate:e=>new k},{id:"@jupyterlite/server-extension:licenses-routes",autoStart:!0,requires:[M],activate(e,t){e.router.get("/api/licenses",(async e=>{const n=await t.get();return new Response(JSON.stringify(n))}))}},X,G,{id:"@jupyterlite/server-extension:lsp-routes",autoStart:!0,activate:e=>{e.router.get("/lsp/status",(async e=>new Response(JSON.stringify({version:2,sessions:{},specs:{}}))))}},{id:"@jupyterlite/server-extension:nbconvert-routes",autoStart:!0,activate:e=>{e.router.get("/api/nbconvert",(async e=>new Response(JSON.stringify({}))))}},ee,{id:"@jupyterlite/server-extension:sessions",autoStart:!0,provides:O,requires:[p.il],activate:(e,t)=>new T({kernels:t})},{id:"@jupyterlite/server-extension:sessions-routes",autoStart:!0,requires:[O],activate:(e,t)=>{e.router.get("/api/sessions/(.+)",(async(e,n)=>{const i=await t.get(n);return new Response(JSON.stringify(i),{status:200})})),e.router.get("/api/sessions",(async e=>{const n=await t.list();return new Response(JSON.stringify(n),{status:200})})),e.router.patch("/api/sessions(.*)",(async(e,n)=>{const i=e.body,s=await t.patch(i);return new Response(JSON.stringify(s),{status:200})})),e.router.delete("/api/sessions/(.+)",(async(e,n)=>(await t.shutdown(n),new Response(null,{status:204})))),e.router.post("/api/sessions",(async e=>{const n=e.body,i=await t.startNew(n);return new Response(JSON.stringify(i),{status:201})}))}},te,ne,{id:"@jupyterlite/server-extension:translation",autoStart:!0,provides:q,activate:e=>{const t=new W;return e.router.get("/api/translations/?(.*)",(async(e,n)=>{"default"===n&&(n="en");const i=await t.get(n||"all");return new Response(JSON.stringify(i))})),t}},{id:"@jupyterlite/server-extension:translation-routes",autoStart:!0,requires:[q],activate:(e,t)=>{e.router.get("/api/translations/?(.*)",(async(e,n)=>{const i=await t.get(n||"all");return new Response(JSON.stringify(i))}))}}]},2964:(e,t,n)=>{"use strict";n.r(t),n.d(t,{IServiceWorkerManager:()=>He.u,JupyterLiteServer:()=>We,Router:()=>Ue,ServiceWorkerManager:()=>Ke.J,WORKER_NAME:()=>He.H});var i,s,r,o=n(7883);!function(e){function t(e,t,n=0,i=-1){let s,r=e.length;if(0===r)return-1;n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,s=o+i;n(e[s],t)<0?(o=s+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,s=-1){let r=e.length;if(0===r)return 0;let o=i=i<0?Math.max(0,i+r):Math.min(i,r-1),a=(s=s<0?Math.max(0,s+r):Math.min(s,r-1))-i+1;for(;a>0;){let i=a>>1,s=o+i;n(e[s],t)>0?a=i:(o=s+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i=o&&(n=s<0?o-1:o),void 0===i?i=s<0?-1:o:i<0?i=Math.max(i+o,s<0?-1:0):i>=o&&(i=s<0?o-1:o),r=s<0&&i>=n||s>0&&n>=i?0:s<0?Math.floor((i-n+1)/s+1):Math.floor((i-n-1)/s+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+s):Math.min(i,s-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;r(e,n,a-1),r(e,a,i),r(e,n,i)},e.fill=function(e,t,n=0,i=-1){let s,r=e.length;if(0!==r){n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,s=-1){let r=t(e,n,i,s);return-1!==r&&o(e,r),r},e.removeLastOf=function(e,t,i=-1,s=0){let r=n(e,t,i,s);return-1!==r&&o(e,r),r},e.removeAllOf=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r},e.removeFirstWhere=function(e,t,n=0,s=-1){let r,a=i(e,t,n,s);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeLastWhere=function(e,t,n=-1,i=0){let r,a=s(e,t,n,i);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeAllWhere=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r}}(i||(i={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(r||(r={}));var a,l,u,c,d,h=n(5764),p=n(7556);function f(){return v.keyboardLayout}!function(e){e.copyText=function(e){const t=document.body,n=i=>{i.preventDefault(),i.stopPropagation(),i.clipboardData.setData("text",e),t.removeEventListener("copy",n,!0)};t.addEventListener("copy",n,!0),document.execCommand("copy")}}(a||(a={})),function(e){e.boxSizing=function(e){let t=window.getComputedStyle(e),n=parseFloat(t.borderTopWidth)||0,i=parseFloat(t.borderLeftWidth)||0,s=parseFloat(t.borderRightWidth)||0,r=parseFloat(t.borderBottomWidth)||0,o=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingLeft)||0,l=parseFloat(t.paddingRight)||0,u=parseFloat(t.paddingBottom)||0;return{borderTop:n,borderLeft:i,borderRight:s,borderBottom:r,paddingTop:o,paddingLeft:a,paddingRight:l,paddingBottom:u,horizontalSum:i+a+l+s,verticalSum:n+o+u+r}},e.sizeLimits=function(e){let t=window.getComputedStyle(e),n=parseFloat(t.minWidth)||0,i=parseFloat(t.minHeight)||0,s=parseFloat(t.maxWidth)||1/0,r=parseFloat(t.maxHeight)||1/0;return s=Math.max(n,s),r=Math.max(i,r),{minWidth:n,minHeight:i,maxWidth:s,maxHeight:r}},e.hitTest=function(e,t,n){let i=e.getBoundingClientRect();return t>=i.left&&t=i.top&&n=n.bottom||(i.topn.bottom&&i.height>=n.height?e.scrollTop-=n.top-i.top:(i.topn.height||i.bottom>n.bottom&&i.height{let e=Element.prototype;return e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(e){let t=this,n=t.ownerDocument?t.ownerDocument.querySelectorAll(e):[];return-1!==Array.prototype.indexOf.call(n,t)}})(),e.calculateSingle=function(e){let u=0,c=0,d=0;function h(t){let n=e.match(t);return null!==n&&(e=e.slice(n[0].length),!0)}for(e=(e=e.split(",",1)[0]).replace(l," $1 ");e.length>0;)if(h(t))u++;else if(h(n))c++;else if(h(i))c++;else if(h(r))d++;else if(h(o))c++;else if(h(s))d++;else if(!h(a))return 0;return u=Math.min(u,255),c=Math.min(c,255),d=Math.min(d,255),u<<16|c<<8|d};const t=/^#[^\s\+>~#\.\[:]+/,n=/^\.[^\s\+>~#\.\[:]+/,i=/^\[[^\]]+\]/,s=/^[^\s\+>~#\.\[:]+/,r=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,o=/^:[^\s\+>~#\.\[:]+/,a=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g}(d||(d={}));class m{constructor(e,t,n=[]){this.name=e,this._codes=t,this._keys=m.extractKeys(t),this._modifierKeys=m.convertToKeySet(n)}keys(){return Object.keys(this._keys)}isValidKey(e){return e in this._keys}isModifierKey(e){return e in this._modifierKeys}keyForKeydownEvent(e){return this._codes[e.keyCode]||""}}!function(e){e.extractKeys=function(e){let t=Object.create(null);for(let n in e)t[e[n]]=!0;return t},e.convertToKeySet=function(e){let t=Object(null);for(let n=0,i=e.length;n{this._commands.delete(e),this._commandChanged.emit({id:e,type:"removed"})}))}notifyCommandChanged(e){if(void 0!==e&&!this._commands.has(e))throw new Error(`Command '${e}' is not registered.`);this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})}describedBy(e,t=h.JSONExt.emptyObject){var n;let i=this._commands.get(e);return Promise.resolve(null!==(n=null==i?void 0:i.describedBy.call(void 0,t))&&void 0!==n?n:{args:null})}label(e,t=h.JSONExt.emptyObject){var n;let i=this._commands.get(e);return null!==(n=null==i?void 0:i.label.call(void 0,t))&&void 0!==n?n:""}mnemonic(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.mnemonic.call(void 0,t):-1}icon(e,t=h.JSONExt.emptyObject){var n;return null===(n=this._commands.get(e))||void 0===n?void 0:n.icon.call(void 0,t)}iconClass(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.iconClass.call(void 0,t):""}iconLabel(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.iconLabel.call(void 0,t):""}caption(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.caption.call(void 0,t):""}usage(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.usage.call(void 0,t):""}className(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.className.call(void 0,t):""}dataset(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.dataset.call(void 0,t):{}}isEnabled(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isEnabled.call(void 0,t)}isToggled(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isToggled.call(void 0,t)}isToggleable(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isToggleable}isVisible(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isVisible.call(void 0,t)}execute(e,t=h.JSONExt.emptyObject){let n,i=this._commands.get(e);if(!i)return Promise.reject(new Error(`Command '${e}' not registered.`));try{n=i.execute.call(void 0,t)}catch(e){n=Promise.reject(e)}let s=Promise.resolve(n);return this._commandExecuted.emit({id:e,args:t,result:s}),s}addKeyBinding(e){let t=_.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new p.DisposableDelegate((()=>{i.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})}))}processKeydownEvent(e){if(e.defaultPrevented||this._replaying)return;const t=F.keystrokeForKeydownEvent(e);if(!t)return this._replayKeydownEvents(),void this._clearPendingState();if(F.isModifierKeyPressed(e)){let{exact:n}=_.matchKeyBinding(this._keyBindings,[t],e);return void(n?(e.preventDefault(),e.stopPropagation(),this._startModifierTimer(n)):this._clearModifierTimer())}this._keystrokes.push(t);const{exact:n,partial:i}=_.matchKeyBinding(this._keyBindings,this._keystrokes,e),s=0!==i.length;return n||s?(((null==n?void 0:n.preventDefault)||i.some((e=>e.preventDefault)))&&(e.preventDefault(),e.stopPropagation()),this._keydownEvents.push(e),n&&!s?(this._executeKeyBinding(n),void this._clearPendingState()):(n&&(this._exactKeyMatch=n),void this._startTimer())):(this._replayKeydownEvents(),void this._clearPendingState())}holdKeyBindingExecution(e,t){this._holdKeyBindingPromises.set(e,t)}processKeyupEvent(e){this._clearModifierTimer()}_startModifierTimer(e){this._clearModifierTimer(),this._timerModifierID=window.setTimeout((()=>{this._executeKeyBinding(e)}),_.modifierkeyTimeOut)}_clearModifierTimer(){0!==this._timerModifierID&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout((()=>{this._onPendingTimeout()}),_.CHORD_TIMEOUT)}_clearTimer(){0!==this._timerID&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){0!==this._keydownEvents.length&&(this._replaying=!0,this._keydownEvents.forEach(_.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(e){if(0!==this._holdKeyBindingPromises.size){const e=[...this._keydownEvents],t=(await Promise.race([Promise.all(e.map((async e=>{var t;return null!==(t=this._holdKeyBindingPromises.get(e))&&void 0!==t?t:Promise.resolve(!0)}))),new Promise((e=>{setTimeout((()=>e([!1])),_.KEYBINDING_HOLD_TIMEOUT)}))])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!t)return}let{command:t,args:n}=e,i={_luminoEvent:{type:"keybinding",keys:e.keys},...n};if(this.hasCommand(t)&&this.isEnabled(t,i))await this.execute(t,i);else{let n=this.hasCommand(t)?"enabled":"registered",i=`Cannot execute key binding '${e.keys.join(", ")}':`,s=`command '${t}' is not ${n}.`;console.warn(`${i} ${s}`)}}_clearPendingState(){this._clearTimer(),this._clearModifierTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}}function*I(){}function O(e,t){let n=0;for(const i of e)if(t(i,n++))return i}!function(e){function t(e){let t="",n=!1,i=!1,s=!1,r=!1;for(let o of e.split(/\s+/))"Accel"===o?u.IS_MAC?i=!0:s=!0:"Alt"===o?n=!0:"Cmd"===o?i=!0:"Ctrl"===o?s=!0:"Shift"===o?r=!0:o.length>0&&(t=o);return{cmd:i,ctrl:s,alt:n,shift:r,key:t}}function n(e){let n="",i=t(e);return i.ctrl&&(n+="Ctrl "),i.alt&&(n+="Alt "),i.shift&&(n+="Shift "),i.cmd&&u.IS_MAC&&(n+="Cmd "),i.key?n+i.key:n.trim()}e.parseKeystroke=t,e.normalizeKeystroke=n,e.normalizeKeys=function(e){let t;return t=u.IS_WIN?e.winKeys||e.keys:u.IS_MAC?e.macKeys||e.keys:e.linuxKeys||e.keys,t.map(n)},e.formatKeystroke=function(e){return"string"==typeof e?n(e):e.map(n).join(", ");function n(e){let n=[],i=u.IS_MAC?" ":"+",s=t(e);return s.ctrl&&n.push("Ctrl"),s.alt&&n.push("Alt"),s.shift&&n.push("Shift"),u.IS_MAC&&s.cmd&&n.push("Cmd"),n.push(s.key),n.map(_.formatKey).join(i)}},e.isModifierKeyPressed=function(e){let t=f(),n=t.keyForKeydownEvent(e);return t.isModifierKey(n)},e.keystrokeForKeydownEvent=function(e){let t=f(),n=t.keyForKeydownEvent(e),i=[];return e.ctrlKey&&i.push("Ctrl"),e.altKey&&i.push("Alt"),e.shiftKey&&i.push("Shift"),e.metaKey&&u.IS_MAC&&i.push("Cmd"),t.isModifierKey(n)||i.push(n),i.join(" ")}}(F||(F={})),function(e){e.CHORD_TIMEOUT=1e3,e.KEYBINDING_HOLD_TIMEOUT=1e3,e.modifierkeyTimeOut=500,e.createCommand=function(e){return{execute:e.execute,describedBy:d("function"==typeof e.describedBy?e.describedBy:{args:null,...e.describedBy},(()=>({args:null}))),label:d(e.label,i),mnemonic:d(e.mnemonic,s),icon:d(e.icon,l),iconClass:d(e.iconClass,i),iconLabel:d(e.iconLabel,i),caption:d(e.caption,i),usage:d(e.usage,i),className:d(e.className,i),dataset:d(e.dataset,a),isEnabled:e.isEnabled||r,isToggled:e.isToggled||o,isToggleable:e.isToggleable||!!e.isToggled,isVisible:e.isVisible||r}},e.createKeyBinding=function(e){var t;return{keys:F.normalizeKeys(e),selector:p(e),command:e.command,args:e.args||h.JSONExt.emptyObject,preventDefault:null===(t=e.preventDefault)||void 0===t||t}},e.matchKeyBinding=function(e,t,n){let i=null,s=[],r=1/0,o=0;for(let a=0,l=e.length;ar)continue;let h=c.calculateSpecificity(l.selector);(!i||d=o)&&(i=l,r=d,o=h)}return{exact:i,partial:s}},e.replayKeyEvent=function(e){e.target.dispatchEvent(function(e){let t=document.createEvent("Event"),n=e.bubbles||!0,i=e.cancelable||!0;return t.initEvent(e.type||"keydown",n,i),t.key=e.key||"",t.keyCode=e.keyCode||0,t.which=e.keyCode||0,t.ctrlKey=e.ctrlKey||!1,t.altKey=e.altKey||!1,t.shiftKey=e.shiftKey||!1,t.metaKey=e.metaKey||!1,t.view=e.view||window,t}(e))},e.formatKey=function(e){return u.IS_MAC?t.hasOwnProperty(e)?t[e]:e:n.hasOwnProperty(e)?n[e]:e};const t={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},n={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},i=()=>"",s=()=>-1,r=()=>!0,o=()=>!1,a=()=>({}),l=()=>{};function d(e,t){return void 0===e?t:"function"==typeof e?e:()=>e}function p(e){if(-1!==e.selector.indexOf(","))throw new Error(`Selector cannot contain commas: ${e.selector}`);if(!c.isValid(e.selector))throw new Error(`Invalid selector: ${e.selector}`);return e.selector}function f(e,t){if(e.lengtht.length?2:1}function m(e,t){let n=t.target,i=t.currentTarget;for(let t=0;null!==n;n=n.parentElement,++t){if(n.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(c.matches(n,e))return t;if(n===i)return-1}return-1}}(_||(_={})),function(e){function t(e,t,n=0,i=-1){let s,r=e.length;if(0===r)return-1;n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,s=o+i;n(e[s],t)<0?(o=s+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,s=-1){let r=e.length;if(0===r)return 0;let o=i=i<0?Math.max(0,i+r):Math.min(i,r-1),a=(s=s<0?Math.max(0,s+r):Math.min(s,r-1))-i+1;for(;a>0;){let i=a>>1,s=o+i;n(e[s],t)>0?a=i:(o=s+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i=o&&(n=s<0?o-1:o),void 0===i?i=s<0?-1:o:i<0?i=Math.max(i+o,s<0?-1:0):i>=o&&(i=s<0?o-1:o),r=s<0&&i>=n||s>0&&n>=i?0:s<0?Math.floor((i-n+1)/s+1):Math.floor((i-n-1)/s+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+s):Math.min(i,s-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;r(e,n,a-1),r(e,a,i),r(e,n,i)},e.fill=function(e,t,n=0,i=-1){let s,r=e.length;if(0!==r){n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,s=-1){let r=t(e,n,i,s);return-1!==r&&o(e,r),r},e.removeLastOf=function(e,t,i=-1,s=0){let r=n(e,t,i,s);return-1!==r&&o(e,r),r},e.removeAllOf=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r},e.removeFirstWhere=function(e,t,n=0,s=-1){let r,a=i(e,t,n,s);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeLastWhere=function(e,t,n=-1,i=0){let r,a=s(e,t,n,i);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeAllWhere=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r}}(y||(y={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(w||(w={})),function(e){e.copyText=function(e){const t=document.body,n=i=>{i.preventDefault(),i.stopPropagation(),i.clipboardData.setData("text",e),t.removeEventListener("copy",n,!0)};t.addEventListener("copy",n,!0),document.execCommand("copy")}}(D||(D={})),function(e){e.boxSizing=function(e){let t=window.getComputedStyle(e),n=parseFloat(t.borderTopWidth)||0,i=parseFloat(t.borderLeftWidth)||0,s=parseFloat(t.borderRightWidth)||0,r=parseFloat(t.borderBottomWidth)||0,o=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingLeft)||0,l=parseFloat(t.paddingRight)||0,u=parseFloat(t.paddingBottom)||0;return{borderTop:n,borderLeft:i,borderRight:s,borderBottom:r,paddingTop:o,paddingLeft:a,paddingRight:l,paddingBottom:u,horizontalSum:i+a+l+s,verticalSum:n+o+u+r}},e.sizeLimits=function(e){let t=window.getComputedStyle(e),n=parseFloat(t.minWidth)||0,i=parseFloat(t.minHeight)||0,s=parseFloat(t.maxWidth)||1/0,r=parseFloat(t.maxHeight)||1/0;return s=Math.max(n,s),r=Math.max(i,r),{minWidth:n,minHeight:i,maxWidth:s,maxHeight:r}},e.hitTest=function(e,t,n){let i=e.getBoundingClientRect();return t>=i.left&&t=i.top&&n=n.bottom||(i.topn.bottom&&i.height>=n.height?e.scrollTop-=n.top-i.top:(i.topn.height||i.bottom>n.bottom&&i.height{let e=Element.prototype;return e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(e){let t=this,n=t.ownerDocument?t.ownerDocument.querySelectorAll(e):[];return-1!==Array.prototype.indexOf.call(n,t)}})(),e.calculateSingle=function(e){let u=0,c=0,d=0;function h(t){let n=e.match(t);return null!==n&&(e=e.slice(n[0].length),!0)}for(e=(e=e.split(",",1)[0]).replace(l," $1 ");e.length>0;)if(h(t))u++;else if(h(n))c++;else if(h(i))c++;else if(h(r))d++;else if(h(o))c++;else if(h(s))d++;else if(!h(a))return 0;return u=Math.min(u,255),c=Math.min(c,255),d=Math.min(d,255),u<<16|c<<8|d};const t=/^#[^\s\+>~#\.\[:]+/,n=/^\.[^\s\+>~#\.\[:]+/,i=/^\[[^\]]+\]/,s=/^[^\s\+>~#\.\[:]+/,r=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,o=/^:[^\s\+>~#\.\[:]+/,a=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g}(S||(S={}));class P{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return 0===this._size}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let e=this._first;for(;e;)yield e.value,e=e.next}*retro(){let e=this._last;for(;e;)yield e.value,e=e.prev}*nodes(){let e=this._first;for(;e;)yield e,e=e.next}*retroNodes(){let e=this._last;for(;e;)yield e,e=e.prev}assign(e){this.clear();for(const t of e)this.addLast(t)}push(e){this.addLast(e)}pop(){return this.removeLast()}shift(e){this.addFirst(e)}unshift(){return this.removeFirst()}addFirst(e){let t=new M.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._size++,t}addLast(e){let t=new M.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t,this._last=t):(this._first=t,this._last=t),this._size++,t}insertBefore(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof M.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let n=new M.LinkedListNode(this,e),i=t,s=i.prev;return n.next=i,n.prev=s,i.prev=n,s.next=n,this._size++,n}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof M.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let n=new M.LinkedListNode(this,e),i=t,s=i.next;return n.next=s,n.prev=i,i.next=n,s.prev=n,this._size++,n}removeFirst(){let e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeLast(){let e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeNode(e){if(!(e instanceof M.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");let t=e;t===this._first&&t===this._last?(this._first=null,this._last=null):t===this._first?(this._first=t.next,this._first.prev=null):t===this._last?(this._last=t.prev,this._last.next=null):(t.next.prev=t.prev,t.prev.next=t.next),t.list=null,t.next=null,t.prev=null,this._size--}clear(){let e=this._first;for(;e;){let t=e.next;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._size=0}}!function(e){e.from=function(t){let n=new e;return n.assign(t),n}}(P||(P={})),function(e){e.LinkedListNode=class{constructor(e,t){this.list=null,this.next=null,this.prev=null,this.list=e,this.value=t}}}(M||(M={}));class B{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}}class R extends B{get isConflatable(){return!0}conflate(e){return!0}}!function(e){let t=null;const n=(i=Promise.resolve(),e=>{let t=!1;return i.then((()=>!t&&e())),()=>{t=!0}});var i;function s(e,t){let n=o.get(e);if(!n||0===n.length)return void c(e,t);let i=function(e,t){let n=0;for(const i of e)if(!1===t(i,n++))return!1;return!0}(function*(e){if("function"==typeof e.retro)yield*e.retro();else for(let t=e.length-1;t>-1;t--)yield e[t]}(n),(n=>!n||function(e,t,n){let i=!0;try{i="function"==typeof e?e(t,n):e.messageHook(t,n)}catch(e){l(e)}return i}(n,e,t)));i&&c(e,t)}e.sendMessage=s,e.postMessage=function(e,t){t.isConflatable&&function(n){for(const s of n)if((i=s).handler===e&&i.msg&&i.msg.type===t.type&&i.msg.isConflatable&&i.msg.conflate(t))return!0;var i;return!1}(r)||d(e,t)},e.installMessageHook=function(e,t){let n=o.get(e);n&&-1!==n.indexOf(t)||(n?n.push(t):o.set(e,[t]))},e.removeMessageHook=function(e,t){let n=o.get(e);if(!n)return;let i=n.indexOf(t);-1!==i&&(n[i]=null,p(n))},e.clearData=function(e){let t=o.get(e);t&&t.length>0&&(y.fill(t,null),p(t));for(const t of r)t.handler===e&&(t.handler=null,t.msg=null)},e.flush=function(){u||null===t||(t(),t=null,u=!0,h(),u=!1)},e.getExceptionHandler=function(){return l},e.setExceptionHandler=function(e){let t=l;return l=e,t};const r=new P,o=new WeakMap,a=new Set;let l=e=>{console.error(e)},u=!1;function c(e,t){try{e.processMessage(t)}catch(e){l(e)}}function d(e,i){r.addLast({handler:e,msg:i}),null===t&&(t=n(h))}function h(){if(t=null,r.isEmpty)return;let e={handler:null,msg:null};for(r.addLast(e);;){let t=r.removeFirst();if(t===e)return;t.handler&&t.msg&&s(t.handler,t.msg)}}function p(e){0===a.size&&n(f),a.add(e)}function f(){a.forEach(m),a.clear()}function m(e){y.removeAllWhere(e,g)}function g(e){return null===e}}(A||(A={}));var T,L,N,j,z,U,q,W,H,K,$=n(6573);class V{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:e,edge:t,distance:n}=this._scrollTarget,i=T.SCROLL_EDGE_SIZE-n,s=Math.pow(i/T.SCROLL_EDGE_SIZE,2),r=Math.max(1,Math.round(s*T.SCROLL_EDGE_SIZE));switch(t){case"top":e.scrollTop-=r;break;case"left":e.scrollLeft-=r;break;case"right":e.scrollLeft+=r;break;case"bottom":e.scrollTop+=r}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let e=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});T.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}}get isDisposed(){return this._disposed}start(e,t){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise((e=>{this._resolve=e}));let n=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:e,clientY:t});return document.dispatchEvent(n),this._promise}handleEvent(e){switch(e.type){case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation()}}moveDragImage(e,t){this.dragImage&&(this.dragImage.style.transform=`translate(${e}px, ${t}px)`)}_evtPointerMove(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)}_evtPointerUp(e){if(e.preventDefault(),e.stopPropagation(),0!==e.button)return;if(this._updateCurrentTarget(e),!this._currentTarget)return void this._finalize("none");if("none"===this._dropAction)return T.dispatchDragLeave(this,this._currentTarget,null,e),void this._finalize("none");let t=T.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(e){let t=T.findScrollTarget(e);(this._scrollTarget||t)&&(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)}_updateCurrentTarget(e){let t=this._currentTarget,n=this._currentTarget,i=this._currentElement,s=T.findElementBehindBackdrop(e,this.document);this._currentElement=s,s!==i&&s!==n&&T.dispatchDragExit(this,n,s,e),s!==i&&s!==n&&(n=T.dispatchDragEnter(this,s,n,e)),n!==t&&(this._currentTarget=n,T.dispatchDragLeave(this,t,n,e));let r=T.dispatchDragOver(this,n,e);this._setDropAction(r)}_attachDragImage(e,t){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let n=this.dragImage.style;n.pointerEvents="none",n.position="fixed",n.transform=`translate(${e}px, ${t}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}_setDropAction(e){if(e=T.validateAction(e,this.supportedActions),!this._override||this._dropAction!==e)switch(e){case"none":this._dropAction=e,this._override=V.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=V.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=V.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=V.overrideCursor("move",this.document)}}_finalize(e){let t=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,t&&t(e)}}!function(e){class t extends DragEvent{constructor(e,t){super(t.type,{bubbles:!0,cancelable:!0,altKey:e.altKey,button:e.button,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,detail:0,metaKey:e.metaKey,relatedTarget:t.related,screenX:e.screenX,screenY:e.screenY,shiftKey:e.shiftKey,view:window});const{drag:n}=t;this.dropAction="none",this.mimeData=n.mimeData,this.proposedAction=n.proposedAction,this.supportedActions=n.supportedActions,this.source=n.source}}e.Event=t,e.overrideCursor=function(e,t=document){return T.overrideCursor(e,t)}}(V||(V={})),function(e){function t(t,s=document){if(t){if(n&&t==n.event)return n.element;e.cursorBackdrop.style.zIndex="-1000";const i=s.elementFromPoint(t.clientX,t.clientY);return e.cursorBackdrop.style.zIndex="",n={event:t,element:i},i}{const t=e.cursorBackdrop.style.transform;if(i&&t===i.transform)return i.element;const n=e.cursorBackdrop.getBoundingClientRect();e.cursorBackdrop.style.zIndex="-1000";const r=s.elementFromPoint(n.left+n.width/2,n.top+n.height/2);return e.cursorBackdrop.style.zIndex="",i={transform:t,element:r},r}}e.SCROLL_EDGE_SIZE=20,e.validateAction=function(e,t){return s[e]&r[t]?e:"none"},e.findElementBehindBackdrop=t;let n=null,i=null;e.findScrollTarget=function(n){let i=n.clientX,s=n.clientY,r=t(n);for(;r;r=r.parentElement){if(!r.hasAttribute("data-lm-dragscroll"))continue;let t=0,n=0;r===document.body&&(t=window.pageXOffset,n=window.pageYOffset);let o=r.getBoundingClientRect(),a=o.top+n,l=o.left+t,u=l+o.width,c=a+o.height;if(i=u||s=c)continue;let d,h=i-l+1,p=s-a+1,f=u-i,m=c-s,g=Math.min(h,p,f,m);if(g>e.SCROLL_EDGE_SIZE)continue;switch(g){case m:d="bottom";break;case p:d="top";break;case f:d="right";break;case h:d="left";break;default:throw"unreachable"}let v,_=r.scrollWidth-r.clientWidth,y=r.scrollHeight-r.clientHeight;switch(d){case"top":v=y>0&&r.scrollTop>0;break;case"left":v=_>0&&r.scrollLeft>0;break;case"right":v=_>0&&r.scrollLeft<_;break;case"bottom":v=y>0&&r.scrollTop{i===c&&e.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",o,!0),e.cursorBackdrop.removeEventListener("scroll",a,!0),s.removeChild(e.cursorBackdrop))}))};const u=500;let c=0;e.cursorBackdrop=function(){const e=document.createElement("div");return e.classList.add("lm-cursor-backdrop"),e}()}(T||(T={})),function(e){function t(e,t,n=0,i=-1){let s,r=e.length;if(0===r)return-1;n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,s=o+i;n(e[s],t)<0?(o=s+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,s=-1){let r=e.length;if(0===r)return 0;let o=i=i<0?Math.max(0,i+r):Math.min(i,r-1),a=(s=s<0?Math.max(0,s+r):Math.min(s,r-1))-i+1;for(;a>0;){let i=a>>1,s=o+i;n(e[s],t)>0?a=i:(o=s+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i=o&&(n=s<0?o-1:o),void 0===i?i=s<0?-1:o:i<0?i=Math.max(i+o,s<0?-1:0):i>=o&&(i=s<0?o-1:o),r=s<0&&i>=n||s>0&&n>=i?0:s<0?Math.floor((i-n+1)/s+1):Math.floor((i-n-1)/s+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+s):Math.min(i,s-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;r(e,n,a-1),r(e,a,i),r(e,n,i)},e.fill=function(e,t,n=0,i=-1){let s,r=e.length;if(0!==r){n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,s=-1){let r=t(e,n,i,s);return-1!==r&&o(e,r),r},e.removeLastOf=function(e,t,i=-1,s=0){let r=n(e,t,i,s);return-1!==r&&o(e,r),r},e.removeAllOf=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r},e.removeFirstWhere=function(e,t,n=0,s=-1){let r,a=i(e,t,n,s);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeLastWhere=function(e,t,n=-1,i=0){let r,a=s(e,t,n,i);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeAllWhere=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r}}(L||(L={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(j||(j={}));class J{constructor(e){this.type="text",this.content=e}}class G{constructor(e,t,n,i){this.type="element",this.tag=e,this.attrs=t,this.children=n,this.renderer=i}}function X(e){let t,n={},i=[];for(let e=1,r=arguments.length;e=i;--r){const i=t[r],o=s?e.lastChild:e.childNodes[r];"text"===i.type||(i.renderer&&i.renderer.unrender?i.renderer.unrender(o,{attrs:i.attrs,children:i.children}):n(o,i.children,0,!1)),s&&e.removeChild(o)}}e.hostMap=new WeakMap,e.asContentArray=function(e){return e?e instanceof Array?e:[e]:[]},e.createDOMNode=t,e.updateContent=function e(i,r,o){if(r===o)return;let a=function(e,t){let n=e.firstChild,i=Object.create(null);for(let e of t)"element"===e.type&&e.attrs.key&&(i[e.attrs.key]={vNode:e,element:n}),n=n.nextSibling;return i}(i,r),l=r.slice(),u=i.firstChild,c=o.length;for(let n=0;n=l.length){t(o[n],i);continue}let r=l[n],c=o[n];if(r===c){u=u.nextSibling;continue}if("text"===r.type&&"text"===c.type){u.textContent!==c.content&&(u.textContent=c.content),u=u.nextSibling;continue}if("text"===r.type||"text"===c.type){L.insert(l,n,c),t(c,i,u);continue}if(!r.renderer!=!c.renderer){L.insert(l,n,c),t(c,i,u);continue}let d=c.attrs.key;if(d&&d in a){let e=a[d];e.vNode!==r&&(L.move(l,l.indexOf(e.vNode,n+1),n),i.insertBefore(e.element,u),r=e.vNode,u=e.element)}if(r===c){u=u.nextSibling;continue}let h=r.attrs.key;h&&h!==d?(L.insert(l,n,c),t(c,i,u)):r.tag===c.tag?(s(u,r.attrs,c.attrs),c.renderer?c.renderer.render(u,{attrs:c.attrs,children:c.children}):e(u,r.children,c.children),u=u.nextSibling):(L.insert(l,n,c),t(c,i,u))}n(i,l,c,!0)};const i={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function s(e,t,n){if(t===n)return;let s;for(s in t)s in i||s in n||("on"===s.substr(0,2)?e[s]=null:e.removeAttribute(s));for(s in n)s in i||t[s]===n[s]||("on"===s.substr(0,2)?e[s]=n[s]:e.setAttribute(s,n[s]));t.className!==n.className&&(void 0!==n.className?e.setAttribute("class",n.className):e.removeAttribute("class")),t.htmlFor!==n.htmlFor&&(void 0!==n.htmlFor?e.setAttribute("for",n.htmlFor):e.removeAttribute("for")),t.dataset!==n.dataset&&function(e,t,n){for(let i in t)i in n||e.removeAttribute(`data-${i}`);for(let i in n)t[i]!==n[i]&&e.setAttribute(`data-${i}`,n[i])}(e,t.dataset||{},n.dataset||{}),t.style!==n.style&&function(e,t,n){let i,s=e.style;for(i in t)i in n||(s[i]="");for(i in n)t[i]!==n[i]&&(s[i]=n[i])}(e,t.style||{},n.style||{})}}(U||(U={}));class Y{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}}!function(e){e.calc=function(e,t){let n=e.length;if(0===n)return t;let i=0,s=0,r=0,o=0,a=0;for(let t=0;t0&&(o+=n.stretch,a++)}if(t===r)return 0;if(t<=i){for(let t=0;t=s){for(let t=0;t0&&i>l;){let t=i,s=o;for(let r=0;r0&&i>l;){let t=i/u;for(let s=0;s0&&i>l;){let t=i,s=o;for(let r=0;r=n.maxSize?(i-=n.maxSize-n.size,o-=n.stretch,n.size=n.maxSize,n.done=!0,u--,a--):(i-=l,n.size+=l)}}for(;u>0&&i>l;){let t=i/u;for(let s=0;s=n.maxSize?(i-=n.maxSize-n.size,n.size=n.maxSize,n.done=!0,u--):(i-=t,n.size+=t))}}}return 0},e.adjust=function(e,t,n){0!==e.length&&0!==n&&(n>0?function(e,t,n){let i=0;for(let n=0;n<=t;++n){let t=e[n];i+=t.maxSize-t.size}let s=0;for(let n=t+1,i=e.length;n=0&&r>0;--n){let t=e[n],i=t.maxSize-t.size;i>=r?(t.sizeHint=t.size+r,r=0):(t.sizeHint=t.size+i,r-=i)}let o=n;for(let n=t+1,i=e.length;n0;++n){let t=e[n],i=t.size-t.minSize;i>=o?(t.sizeHint=t.size-o,o=0):(t.sizeHint=t.size-i,o-=i)}}(e,t,n):function(e,t,n){let i=0;for(let n=t+1,s=e.length;n0;++n){let t=e[n],i=t.maxSize-t.size;i>=r?(t.sizeHint=t.size+r,r=0):(t.sizeHint=t.size+i,r-=i)}let o=n;for(let n=t;n>=0&&o>0;--n){let t=e[n],i=t.size-t.minSize;i>=o?(t.sizeHint=t.size-o,o=0):(t.sizeHint=t.size-i,o-=i)}}(e,t,-n))}}(q||(q={}));class Z{constructor(e){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new k.Signal(this),this._isDisposed=!1,this.owner=e.owner,void 0!==e.label&&(this._label=e.label),void 0!==e.mnemonic&&(this._mnemonic=e.mnemonic),void 0!==e.icon&&(this._icon=e.icon),void 0!==e.iconClass&&(this._iconClass=e.iconClass),void 0!==e.iconLabel&&(this._iconLabel=e.iconLabel),void 0!==e.caption&&(this._caption=e.caption),void 0!==e.className&&(this._className=e.className),void 0!==e.closable&&(this._closable=e.closable),this._dataset=e.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))}get icon(){return this._icon}set icon(e){this._icon!==e&&(this._icon=e,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))}get caption(){return this._caption}set caption(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))}get className(){return this._className}set className(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))}get closable(){return this._closable}set closable(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,k.Signal.clearData(this))}}class Q{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new k.Signal(this),this._hiddenMode=Q.HiddenMode.Display,this.node=W.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(Q.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&Q.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),k.Signal.clearData(this),A.clearData(this),$.AttachedProperty.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(Q.Flag.IsDisposed)}get isAttached(){return this.testFlag(Q.Flag.IsAttached)}get isHidden(){return this.testFlag(Q.Flag.IsHidden)}get isVisible(){return this.testFlag(Q.Flag.IsVisible)}get title(){return W.titleProperty.get(this)}get id(){return this.node.id}set id(e){this.node.id=e}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){this._hiddenMode!==e&&(this.isHidden&&this._toggleHidden(!1),e==Q.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let e=new Q.ChildMessage("child-removed",this);A.sendMessage(this._parent,e)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let e=new Q.ChildMessage("child-added",this);A.sendMessage(this._parent,e)}this.isDisposed||A.sendMessage(this,Q.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(Q.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(e){for(let t=e;t;t=t._parent)if(t===this)return!0;return!1}hasClass(e){return this.node.classList.contains(e)}addClass(e){this.node.classList.add(e)}removeClass(e){this.node.classList.remove(e)}toggleClass(e,t){return!0===t?(this.node.classList.add(e),!0):!1===t?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)}update(){A.postMessage(this,Q.Msg.UpdateRequest)}fit(){A.postMessage(this,Q.Msg.FitRequest)}activate(){A.postMessage(this,Q.Msg.ActivateRequest)}close(){A.sendMessage(this,Q.Msg.CloseRequest)}show(){if(this.testFlag(Q.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||A.sendMessage(this,Q.Msg.BeforeShow),this.clearFlag(Q.Flag.IsHidden),this._toggleHidden(!1),!this.isAttached||this.parent&&!this.parent.isVisible||A.sendMessage(this,Q.Msg.AfterShow),this.parent)){let e=new Q.ChildMessage("child-shown",this);A.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(Q.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||A.sendMessage(this,Q.Msg.BeforeHide),this.setFlag(Q.Flag.IsHidden),this._toggleHidden(!0),!this.isAttached||this.parent&&!this.parent.isVisible||A.sendMessage(this,Q.Msg.AfterHide),this.parent)){let e=new Q.ChildMessage("child-hidden",this);A.sendMessage(this.parent,e)}}setHidden(e){e?this.hide():this.show()}testFlag(e){return!!(this._flags&e)}setFlag(e){this._flags|=e}clearFlag(e){this._flags&=~e}processMessage(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(Q.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(Q.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":this.isHidden||this.parent&&!this.parent.isVisible||this.setFlag(Q.Flag.IsVisible),this.setFlag(Q.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(Q.Flag.IsVisible),this.clearFlag(Q.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e)}}notifyLayout(e){this._layout&&this._layout.processParentMessage(e)}onCloseRequest(e){this.parent?this.parent=null:this.isAttached&&Q.detach(this)}onResize(e){}onUpdateRequest(e){}onFitRequest(e){}onActivateRequest(e){}onBeforeShow(e){}onAfterShow(e){}onBeforeHide(e){}onAfterHide(e){}onBeforeAttach(e){}onAfterAttach(e){}onBeforeDetach(e){}onAfterDetach(e){}onChildAdded(e){}onChildRemoved(e){}_toggleHidden(e){if(e)switch(this._hiddenMode){case Q.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case Q.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case Q.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1"}else switch(this._hiddenMode){case Q.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case Q.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case Q.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex=""}}}!function(e){var t,n,i;(t=e.HiddenMode||(e.HiddenMode={}))[t.Display=0]="Display",t[t.Scale=1]="Scale",t[t.ContentVisibility=2]="ContentVisibility",(n=e.Flag||(e.Flag={}))[n.IsDisposed=1]="IsDisposed",n[n.IsAttached=2]="IsAttached",n[n.IsHidden=4]="IsHidden",n[n.IsVisible=8]="IsVisible",n[n.DisallowLayout=16]="DisallowLayout",(i=e.Msg||(e.Msg={})).BeforeShow=new B("before-show"),i.AfterShow=new B("after-show"),i.BeforeHide=new B("before-hide"),i.AfterHide=new B("after-hide"),i.BeforeAttach=new B("before-attach"),i.AfterAttach=new B("after-attach"),i.BeforeDetach=new B("before-detach"),i.AfterDetach=new B("after-detach"),i.ParentChanged=new B("parent-changed"),i.UpdateRequest=new R("update-request"),i.FitRequest=new R("fit-request"),i.ActivateRequest=new R("activate-request"),i.CloseRequest=new R("close-request"),e.ChildMessage=class extends B{constructor(e,t){super(e),this.child=t}};class s extends B{constructor(e,t){super("resize"),this.width=e,this.height=t}}e.ResizeMessage=s,function(e){e.UnknownSize=new e(-1,-1)}(s=e.ResizeMessage||(e.ResizeMessage={})),e.attach=function(t,n,i=null){if(t.parent)throw new Error("Cannot attach a child widget.");if(t.isAttached||t.node.isConnected)throw new Error("Widget is already attached.");if(!n.isConnected)throw new Error("Host is not attached.");A.sendMessage(t,e.Msg.BeforeAttach),n.insertBefore(t.node,i),A.sendMessage(t,e.Msg.AfterAttach)},e.detach=function(t){if(t.parent)throw new Error("Cannot detach a child widget.");if(!t.isAttached||!t.node.isConnected)throw new Error("Widget is not attached.");A.sendMessage(t,e.Msg.BeforeDetach),t.node.parentNode.removeChild(t.node),A.sendMessage(t,e.Msg.AfterDetach)}}(Q||(Q={})),function(e){e.titleProperty=new $.AttachedProperty({name:"title",create:e=>new Z({owner:e})}),e.createNode=function(e){return e.node||document.createElement(e.tag||"div")}}(W||(W={}));class ee{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,k.Signal.clearData(this),$.AttachedProperty.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){let e=this._parent.node.style;e.minWidth="",e.minHeight="",e.maxWidth="",e.maxHeight="",this._parent.fit()}}processParentMessage(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e)}}init(){for(const e of this)e.parent=this.parent}onResize(e){for(const e of this)A.sendMessage(e,Q.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(const e of this)A.sendMessage(e,Q.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(const t of this)A.sendMessage(t,e)}onAfterAttach(e){for(const t of this)A.sendMessage(t,e)}onBeforeDetach(e){for(const t of this)A.sendMessage(t,e)}onAfterDetach(e){for(const t of this)A.sendMessage(t,e)}onBeforeShow(e){for(const t of this)t.isHidden||A.sendMessage(t,e)}onAfterShow(e){for(const t of this)t.isHidden||A.sendMessage(t,e)}onBeforeHide(e){for(const t of this)t.isHidden||A.sendMessage(t,e)}onAfterHide(e){for(const t of this)t.isHidden||A.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}}!function(e){e.getHorizontalAlignment=function(e){return H.horizontalAlignmentProperty.get(e)},e.setHorizontalAlignment=function(e,t){H.horizontalAlignmentProperty.set(e,t)},e.getVerticalAlignment=function(e){return H.verticalAlignmentProperty.get(e)},e.setVerticalAlignment=function(e,t){H.verticalAlignmentProperty.set(e,t)}}(ee||(ee={}));class te{constructor(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height="",e.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let e=x.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,n,i){let s=Math.max(this._minWidth,Math.min(n,this._maxWidth)),r=Math.max(this._minHeight,Math.min(i,this._maxHeight));if(s"center",changed:t}),e.verticalAlignmentProperty=new $.AttachedProperty({name:"verticalAlignment",create:()=>"top",changed:t})}(H||(H={}));class ne extends ee{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(e){this.insertWidget(this._widgets.length,e)}insertWidget(e,t){t.parent=this.parent;let n=this._widgets.indexOf(t),i=Math.max(0,Math.min(e,this._widgets.length));if(-1===n)return y.insert(this._widgets,i,t),void(this.parent&&this.attachWidget(i,t));i===this._widgets.length&&i--,n!==i&&(y.move(this._widgets,n,i),this.parent&&this.moveWidget(n,i,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=y.removeAt(this._widgets,e);t&&this.parent&&this.detachWidget(e,t)}init(){super.init();let e=0;for(const t of this)this.attachWidget(e++,t)}attachWidget(e,t){let n=this.parent.node.children[e];this.parent.isAttached&&A.sendMessage(t,Q.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,n),this.parent.isAttached&&A.sendMessage(t,Q.Msg.AfterAttach)}moveWidget(e,t,n){this.parent.isAttached&&A.sendMessage(n,Q.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&A.sendMessage(n,Q.Msg.AfterDetach);let i=this.parent.node.children[t];this.parent.isAttached&&A.sendMessage(n,Q.Msg.BeforeAttach),this.parent.node.insertBefore(n.node,i),this.parent.isAttached&&A.sendMessage(n,Q.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&A.sendMessage(t,Q.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&A.sendMessage(t,Q.Msg.AfterDetach)}}!function(e){e.clampDimension=function(e){return Math.max(0,Math.floor(e))}}(K||(K={}));var ie,se,re,oe,ae,le,ue,ce,de,he,pe=K;class fe extends ne{constructor(e){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=e.renderer,void 0!==e.orientation&&(this._orientation=e.orientation),void 0!==e.alignment&&(this._alignment=e.alignment),void 0!==e.spacing&&(this._spacing=K.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.parent&&(this.parent.dataset.orientation=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=K.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map((e=>e.size))}relativeSizes(){return ie.normalize(this._sizers.map((e=>e.size)))}setRelativeSizes(e,t=!0){let n=this._sizers.length,i=e.slice(0,n);for(;i.length0&&(e.sizeHint=e.size);q.adjust(this._sizers,e,n),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){let n=new te(t),i=ie.createHandle(this.renderer),s=ie.averageSize(this._sizers),r=ie.createSizer(s);y.insert(this._items,e,n),y.insert(this._sizers,e,r),y.insert(this._handles,e,i),this.parent.isAttached&&A.sendMessage(t,Q.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(i),this.parent.isAttached&&A.sendMessage(t,Q.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){y.move(this._items,e,t),y.move(this._sizers,e,t),y.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let n=y.removeAt(this._items,e),i=y.removeAt(this._handles,e);y.removeAt(this._sizers,e),this.parent.isAttached&&A.sendMessage(t,Q.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(i),this.parent.isAttached&&A.sendMessage(t,Q.Msg.AfterDetach),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}updateItemPosition(e,t,n,i,s,r,o){const a=this._items[e];if(a.isHidden)return;let l=this._handles[e].style;t?(n+=this.widgetOffset,a.update(n,i,o,s),n+=o,l.top=`${i}px`,l.left=`${n}px`,l.width=`${this._spacing}px`,l.height=`${s}px`):(i+=this.widgetOffset,a.update(n,i,r,o),i+=o,l.top=`${i}px`,l.left=`${n}px`,l.width=`${r}px`,l.height=`${this._spacing}px`)}_fit(){let e=0,t=-1;for(let n=0,i=this._items.length;n0&&(r.sizeHint=r.size),t.isHidden?(r.minSize=0,r.maxSize=0):(t.fit(),r.stretch=fe.getStretch(t.widget),n?(r.minSize=t.minWidth,r.maxSize=t.maxWidth,i+=t.minWidth,s=Math.max(s,t.minHeight)):(r.minSize=t.minHeight,r.maxSize=t.maxHeight,s+=t.minHeight,i=Math.max(i,t.minWidth)))}let r=this._box=x.boxSizing(this.parent.node);i+=r.horizontalSum,s+=r.verticalSum;let o=this.parent.node.style;o.minWidth=`${i}px`,o.minHeight=`${s}px`,this._dirty=!0,this.parent.parent&&A.sendMessage(this.parent.parent,Q.Msg.FitRequest),this._dirty&&A.sendMessage(this.parent,Q.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let n=0;for(let e=0,t=this._items.length;e0){let e;if(e=u?Math.max(0,r-this._fixed):Math.max(0,o-this._fixed),this._hasNormedSizes){for(let t of this._sizers)t.sizeHint*=e;this._hasNormedSizes=!1}let t=q.calc(this._sizers,e);if(t>0)switch(this._alignment){case"start":break;case"center":a=0,l=t/2;break;case"end":a=0,l=t;break;case"justify":a=t/n,l=0;break;default:throw"unreachable"}}for(let e=0,t=this._items.length;e0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:function(e){e.parent&&e.parent.layout instanceof fe&&e.parent.fit()}}),e.createSizer=function(e){let t=new Y;return t.sizeHint=Math.floor(e),t},e.createHandle=function(e){let t=e.createHandle();return t.style.position="absolute",t.style.contain="style",t},e.averageSize=function(e){return e.reduce(((e,t)=>e+t.size),0)/e.length||0},e.normalize=function(e){let t=e.length;if(0===t)return[];let n=e.reduce(((e,t)=>e+Math.abs(t)),0);return 0===n?e.map((e=>1/t)):e.map((e=>e/n))}}(ie||(ie={}));class me extends fe{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=pe.clampDimension(e),this.widgetOffset!==e&&(this.widgetOffset=e,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(e,t){const n=this._titles[e],i=n.classList.contains("lm-mod-expanded"),s=se.createTitle(this.renderer,t.title,i);this._titles[e]=s,this.parent.node.replaceChild(s,n)}insertWidget(e,t){t.id||(t.id=`id-${h.UUID.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){const n=se.createTitle(this.renderer,t.title);y.insert(this._titles,e,n),this.parent.node.appendChild(n),t.node.setAttribute("role","region"),t.node.setAttribute("aria-labelledby",n.id),super.attachWidget(e,t)}moveWidget(e,t,n){y.move(this._titles,e,t),super.moveWidget(e,t,n)}detachWidget(e,t){const n=y.removeAt(this._titles,e);this.parent.node.removeChild(n),super.detachWidget(e,t)}updateItemPosition(e,t,n,i,s,r,o){const a=this._titles[e].style;a.top=`${i}px`,a.left=`${n}px`,a.height=`${this.widgetOffset}px`,a.width=t?`${s}px`:`${r}px`,super.updateItemPosition(e,t,n,i,s,r,o)}}!function(e){e.createTitle=function(e,t,n=!0){const i=e.createSectionTitle(t);return i.style.position="absolute",i.style.contain="strict",i.setAttribute("aria-label",`${t.label} Section`),i.setAttribute("aria-expanded",n?"true":"false"),i.setAttribute("aria-controls",t.owner.id),n&&i.classList.add("lm-mod-expanded"),i}}(se||(se={}));class ge extends Q{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=re.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}}!function(e){e.createLayout=function(e){return e.layout||new ne}}(re||(re={}));class ve extends ge{constructor(e={}){super({layout:oe.createLayout(e)}),this._handleMoved=new k.Signal(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(e){this.layout.orientation=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(e,t=!0){this.layout.setRelativeSizes(e,t)}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){e.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(e){e.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),27===e.keyCode&&this._releaseMouse()}_evtPointerDown(e){if(0!==e.button)return;let t,n=this.layout,i=y.findFirstIndex(n.handles,(t=>t.contains(e.target)));if(-1===i)return;e.preventDefault(),e.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let s=n.handles[i],r=s.getBoundingClientRect();t="horizontal"===n.orientation?e.clientX-r.left:e.clientY-r.top;let o=window.getComputedStyle(s),a=V.overrideCursor(o.cursor);this._pressData={index:i,delta:t,override:a}}_evtPointerMove(e){let t;e.preventDefault(),e.stopPropagation();let n=this.layout,i=this.node.getBoundingClientRect();t="horizontal"===n.orientation?e.clientX-i.left-this._pressData.delta:e.clientY-i.top-this._pressData.delta,n.moveHandle(this._pressData.index,t)}_evtPointerUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}}!function(e){class t{createHandle(){let e=document.createElement("div");return e.className="lm-SplitPanel-handle",e}}e.Renderer=t,e.defaultRenderer=new t,e.getStretch=function(e){return fe.getStretch(e)},e.setStretch=function(e,t){fe.setStretch(e,t)}}(ve||(ve={})),function(e){e.createLayout=function(e){return e.layout||new fe({renderer:e.renderer||ve.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing})}}(oe||(oe={}));class _e extends ve{constructor(e={}){super({...e,layout:ae.createLayout(e)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new k.Signal(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(e){this.layout.titleSpace=e}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(e){super.addWidget(e),e.title.changed.connect(this._onTitleChanged,this)}collapse(e){const t=this.layout.widgets[e];t&&!t.isHidden&&this._toggleExpansion(e)}expand(e){const t=this.layout.widgets[e];t&&t.isHidden&&this._toggleExpansion(e)}insertWidget(e,t){super.insertWidget(e,t),t.title.changed.connect(this._onTitleChanged,this)}handleEvent(e){switch(super.handleEvent(e),e.type){case"click":this._evtClick(e);break;case"keydown":this._eventKeyDown(e)}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(e)}onAfterDetach(e){super.onAfterDetach(e),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(e){const t=y.findFirstIndex(this.widgets,(t=>t.contains(e.owner)));t>=0&&(this.layout.updateTitle(t,e.owner),this.update())}_computeWidgetSize(e){const t=this.layout,n=t.widgets[e];if(!n)return;const i=n.isHidden,s=t.absoluteSizes(),r=(i?-1:1)*this.spacing,o=s.reduce(((e,t)=>e+t));let a=[...s];if(i){const t=this._widgetSizesCache.get(n);if(!t)return;a[e]+=t;const i=a.map((e=>e-t>0)).lastIndexOf(!0);-1===i?a.forEach(((n,i)=>{i!==e&&(a[i]-=s[i]/o*(t-r))})):a[i]-=t-r}else{const t=s[e];this._widgetSizesCache.set(n,t),a[e]=0;const i=a.map((e=>e>0)).lastIndexOf(!0);if(-1===i)return;a[i]=s[i]+t+r}return a.map((e=>e/(o+r)))}_evtClick(e){const t=e.target;if(t){const n=y.findFirstIndex(this.titles,(e=>e.contains(t)));n>=0&&(e.preventDefault(),e.stopPropagation(),this._toggleExpansion(n))}}_eventKeyDown(e){if(e.defaultPrevented)return;const t=e.target;let n=!1;if(t){const i=y.findFirstIndex(this.titles,(e=>e.contains(t)));if(i>=0){const s=e.keyCode.toString();if(e.key.match(/Space|Enter/)||s.match(/13|32/))t.click(),n=!0;else if("horizontal"===this.orientation?e.key.match(/ArrowLeft|ArrowRight/)||s.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||s.match(/38|40/)){const t=e.key.match(/ArrowLeft|ArrowUp/)||s.match(/37|38/)?-1:1,r=this.titles.length,o=(i+r+t)%r;this.titles[o].focus(),n=!0}else"End"===e.key||"35"===s?(this.titles[this.titles.length-1].focus(),n=!0):"Home"!==e.key&&"36"!==s||(this.titles[0].focus(),n=!0)}n&&e.preventDefault()}}_toggleExpansion(e){const t=this.titles[e],n=this.layout.widgets[e],i=this._computeWidgetSize(e);i&&this.setRelativeSizes(i,!1),n.isHidden?(t.classList.add("lm-mod-expanded"),t.setAttribute("aria-expanded","true"),n.show()):(t.classList.remove("lm-mod-expanded"),t.setAttribute("aria-expanded","false"),n.hide()),this._expansionToggled.emit(e)}}!function(e){class t extends ve.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++t._nInstance}createCollapseIcon(e){return document.createElement("span")}createSectionTitle(e){const t=document.createElement("h3");t.setAttribute("tabindex","0"),t.id=this.createTitleKey(e),t.className=this.titleClassName;for(const n in e.dataset)t.dataset[n]=e.dataset[n];t.appendChild(this.createCollapseIcon(e)).className="lm-AccordionPanel-titleCollapser";const n=t.appendChild(document.createElement("span"));return n.className="lm-AccordionPanel-titleLabel",n.textContent=e.label,n.title=e.caption||e.label,t}createTitleKey(e){let t=this._titleKeys.get(e);return void 0===t&&(t=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(e,t)),t}}t._nInstance=0,e.Renderer=t,e.defaultRenderer=new t}(_e||(_e={})),function(e){e.createLayout=function(e){return e.layout||new me({renderer:e.renderer||_e.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing,titleSpace:e.titleSpace})}}(ae||(ae={}));class ye extends ne{constructor(e={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",void 0!==e.direction&&(this._direction=e.direction),void 0!==e.alignment&&(this._alignment=e.alignment),void 0!==e.spacing&&(this._spacing=pe.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(e){this._direction!==e&&(this._direction=e,this.parent&&(this.parent.dataset.direction=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=pe.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){y.insert(this._items,e,new te(t)),y.insert(this._sizers,e,new Y),this.parent.isAttached&&A.sendMessage(t,Q.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&A.sendMessage(t,Q.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){y.move(this._items,e,t),y.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let n=y.removeAt(this._items,e);y.removeAt(this._sizers,e),this.parent.isAttached&&A.sendMessage(t,Q.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&A.sendMessage(t,Q.Msg.AfterDetach),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0;for(let t=0,n=this._items.length;t0)switch(this._alignment){case"start":break;case"center":l=0,u=i/2;break;case"end":l=0,u=i;break;case"justify":l=i/n,u=0;break;default:throw"unreachable"}for(let e=0,t=this._items.length;e0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:t}),e.sizeBasisProperty=new $.AttachedProperty({name:"sizeBasis",create:()=>0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:t}),e.isHorizontal=function(e){return"left-to-right"===e||"right-to-left"===e},e.clampSpacing=function(e){return Math.max(0,Math.floor(e))}}(le||(le={}));class be extends ge{constructor(e={}){super({layout:ue.createLayout(e)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(e){this.layout.direction=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}onChildAdded(e){e.child.addClass("lm-BoxPanel-child")}onChildRemoved(e){e.child.removeClass("lm-BoxPanel-child")}}!function(e){e.getStretch=function(e){return ye.getStretch(e)},e.setStretch=function(e,t){ye.setStretch(e,t)},e.getSizeBasis=function(e){return ye.getSizeBasis(e)},e.setSizeBasis=function(e,t){ye.setSizeBasis(e,t)}}(be||(be={})),function(e){e.createLayout=function(e){return e.layout||new ye(e)}}(ue||(ue={}));class we extends Q{constructor(e){super({node:ce.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(Q.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||we.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(e){let t=ce.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){const t=e.map((e=>ce.createItem(this.commands,e)));return t.forEach((e=>this._items.push(e))),this.refresh(),t}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){y.removeAt(this._items,e)&&this.refresh()}clearItems(){0!==this._items.length&&(this._items.length=0,this.refresh())}refresh(){this._results=null,""!==this.inputNode.value?this.node.getElementsByClassName("lm-close-icon")[0].style.display="inherit":this.node.getElementsByClassName("lm-close-icon")[0].style.display="none",this.update()}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"keydown":this._evtKeyDown(e);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(e){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(e){this.update(),super.onAfterShow(e)}onActivateRequest(e){if(this.isAttached){let e=this.inputNode;e.focus(),e.select()}}onUpdateRequest(e){if(this.isHidden)return;let t=this.inputNode.value,n=this.contentNode,i=this._results;if(i||(i=this._results=ce.search(this._items,t),this._activeIndex=t?y.findFirstIndex(i,ce.canActivate):-1),!t&&0===i.length)return void z.render(null,n);if(t&&0===i.length){let e=this.renderer.renderEmptyMessage({query:t});return void z.render(e,n)}let s=this.renderer,r=this._activeIndex,o=new Array(i.length);for(let e=0,t=i.length;e=i.length)n.scrollTop=0;else{let e=n.children[r];x.scrollIntoViewIfNeeded(n,e)}}_evtClick(e){if(0!==e.button)return;if(e.target.classList.contains("lm-close-icon"))return this.inputNode.value="",void this.refresh();let t=y.findFirstIndex(this.contentNode.children,(t=>t.contains(e.target)));-1!==t&&(e.preventDefault(),e.stopPropagation(),this._execute(t))}_evtKeyDown(e){if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))switch(e.keyCode){case 13:e.preventDefault(),e.stopPropagation(),this._execute(this._activeIndex);break;case 38:e.preventDefault(),e.stopPropagation(),this._activatePreviousItem();break;case 40:e.preventDefault(),e.stopPropagation(),this._activateNextItem()}}_activateNextItem(){if(!this._results||0===this._results.length)return;let e=this._activeIndex,t=this._results.length,n=ee-t)),u=r.slice(0,l),c=r.slice(l);for(let e=0,t=c.length;en.command===e&&h.JSONExt.deepEqual(n.args,t)))||null}}}(ce||(ce={}));class De extends Q{constructor(e){super({node:de.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new k.Signal(this),this._menuRequested=new k.Signal(this),this.addClass("lm-Menu"),this.setFlag(Q.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||De.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let e=this;for(;e._parentMenu;)e=e._parentMenu;return e}get leafMenu(){let e=this;for(;e._childMenu;)e=e._childMenu;return e}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(e){this.activeIndex=e?this._items.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._items.length)&&(e=-1),-1===e||de.canActivate(this._items[e])||(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let e=this._items.length,t=this._activeIndex,n=t{this.activeIndex=e}})}z.render(r,this.contentNode)}onCloseRequest(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let t=this._childMenu;t&&(this._childIndex=-1,this._childMenu=null,t._parentMenu=null,t.close());let n=this._parentMenu;n&&(this._parentMenu=null,n._childIndex=-1,n._childMenu=null,n.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(e)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation();let t=e.keyCode;if(13===t)return void this.triggerActiveItem();if(27===t)return void this.close();if(37===t)return void(this._parentMenu?this.close():this._menuRequested.emit("previous"));if(38===t)return void this.activatePreviousItem();if(39===t){let e=this.activeItem;return void(e&&"submenu"===e.type?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next"))}if(40===t)return void this.activateNextItem();let n=f().keyForKeydownEvent(e);if(!n)return;let i=this._activeIndex+1,s=de.findMnemonic(this._items,n,i);-1===s.index||s.multiple?-1!==s.index?this.activeIndex=s.index:-1!==s.auto&&(this.activeIndex=s.auto):(this.activeIndex=s.index,this.triggerActiveItem())}_evtMouseUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(e){let t=y.findFirstIndex(this.contentNode.children,(t=>x.hitTest(t,e.clientX,e.clientY)));if(t===this._activeIndex)return;if(this.activeIndex=t,t=this.activeIndex,t===this._childIndex)return this._cancelOpenTimer(),void this._cancelCloseTimer();-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();let n=this.activeItem;n&&"submenu"===n.type&&n.submenu&&this._startOpenTimer()}_evtMouseEnter(e){for(let e=this._parentMenu;e;e=e._parentMenu)e._cancelOpenTimer(),e._cancelCloseTimer(),e.activeIndex=e._childIndex}_evtMouseLeave(e){if(this._cancelOpenTimer(),!this._childMenu)return void(this.activeIndex=-1);let{clientX:t,clientY:n}=e;x.hitTest(this._childMenu.node,t,n)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}_evtMouseDown(e){this._parentMenu||(de.hitTestMenus(this,e.clientX,e.clientY)?(e.preventDefault(),e.stopPropagation()):this.close())}_openChildMenu(e=!1){let t=this.activeItem;if(!t||"submenu"!==t.type||!t.submenu)return void this._closeChildMenu();let n=t.submenu;if(n===this._childMenu)return;De.saveWindowData(),this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,A.sendMessage(this,Q.Msg.UpdateRequest);let i=this.contentNode.children[this._activeIndex];de.openSubmenu(n,i),e&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){0===this._openTimerID&&(this._openTimerID=window.setTimeout((()=>{this._openTimerID=0,this._openChildMenu()}),de.TIMER_DELAY))}_startCloseTimer(){0===this._closeTimerID&&(this._closeTimerID=window.setTimeout((()=>{this._closeTimerID=0,this._closeChildMenu()}),de.TIMER_DELAY))}_cancelOpenTimer(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){de.saveWindowData()}}!function(e){class t{renderItem(e){let t=this.createItemClass(e),n=this.createItemDataset(e),i=this.createItemARIA(e);return X.li({className:t,dataset:n,tabindex:"0",onfocus:e.onfocus,...i},this.renderIcon(e),this.renderLabel(e),this.renderShortcut(e),this.renderSubmenu(e))}renderIcon(e){let t=this.createIconClass(e);return X.div({className:t},e.item.icon,e.item.iconLabel)}renderLabel(e){let t=this.formatLabel(e);return X.div({className:"lm-Menu-itemLabel"},t)}renderShortcut(e){let t=this.formatShortcut(e);return X.div({className:"lm-Menu-itemShortcut"},t)}renderSubmenu(e){return X.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(e){let t="lm-Menu-item";e.item.isEnabled||(t+=" lm-mod-disabled"),e.item.isToggled&&(t+=" lm-mod-toggled"),e.item.isVisible||(t+=" lm-mod-hidden"),e.active&&(t+=" lm-mod-active"),e.collapsed&&(t+=" lm-mod-collapsed");let n=e.item.className;return n&&(t+=` ${n}`),t}createItemDataset(e){let t,{type:n,command:i,dataset:s}=e.item;return t="command"===n?{...s,type:n,command:i}:{...s,type:n},t}createIconClass(e){let t="lm-Menu-itemIcon",n=e.item.iconClass;return n?`${t} ${n}`:t}createItemARIA(e){let t={};switch(e.item.type){case"separator":t.role="presentation";break;case"submenu":t["aria-haspopup"]="true",e.item.isEnabled||(t["aria-disabled"]="true");break;default:e.item.isEnabled||(t["aria-disabled"]="true"),t.role="menuitem"}return t}formatLabel(e){let{label:t,mnemonic:n}=e.item;if(n<0||n>=t.length)return t;let i=t.slice(0,n),s=t.slice(n+1),r=t[n];return[i,X.span({className:"lm-Menu-itemMnemonic"},r),s]}formatShortcut(e){let t=e.item.keyBinding;return t?F.formatKeystroke(t.keys):null}}e.Renderer=t,e.defaultRenderer=new t}(De||(De={})),function(e){e.TIMER_DELAY=300,e.SUBMENU_OVERLAP=3;let t=null,n=0;function i(){return n>0?(n--,t):r()}function s(e){return"separator"!==e.type&&e.isEnabled&&e.isVisible}function r(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}e.saveWindowData=function(){t=r(),n++},e.createNode=function(){let e=document.createElement("div"),t=document.createElement("ul");return t.className="lm-Menu-content",e.appendChild(t),t.setAttribute("role","menu"),e.tabIndex=0,e},e.canActivate=s,e.createItem=function(e,t){return new o(e.commands,t)},e.hitTestMenus=function(e,t,n){for(let i=e;i;i=i.childMenu)if(x.hitTest(i.node,t,n))return!0;return!1},e.computeCollapsed=function(e){let t=new Array(e.length);y.fill(t,!1);let n=0,i=e.length;for(;n=0;--s){let n=e[s];if(n.isVisible){if("separator"!==n.type)break;t[s]=!0}}let r=!1;for(;++nu+d&&(t=u+d-g),!r&&n+v>c+h&&(n>c+h?n=c+h-v:n-=v),m.transform=`translate(${Math.max(0,t)}px, ${Math.max(0,n)}px`,m.opacity="1"},e.openSubmenu=function(t,n){const s=i();let r=s.pageXOffset,o=s.pageYOffset,a=s.clientWidth,l=s.clientHeight;A.sendMessage(t,Q.Msg.UpdateRequest);let u=l,c=t.node,d=c.style;d.opacity="0",d.maxHeight=`${u}px`,Q.attach(t,document.body);let{width:h,height:p}=c.getBoundingClientRect(),f=x.boxSizing(t.node),m=n.getBoundingClientRect(),g=m.right-e.SUBMENU_OVERLAP;g+h>r+a&&(g=m.left+e.SUBMENU_OVERLAP-h);let v=m.top-f.borderTop-f.paddingTop;v+p>o+l&&(v=m.bottom+f.borderBottom+f.paddingBottom-p),d.transform=`translate(${Math.max(0,g)}px, ${Math.max(0,v)}px`,d.opacity="1"},e.findMnemonic=function(e,t,n){let i=-1,r=-1,o=!1,a=t.toUpperCase();for(let t=0,l=e.length;t=0&&hn.command===e&&h.JSONExt.deepEqual(n.args,t)))||null}return null}}}(de||(de={}));class xe{constructor(e){this._groupByTarget=!0,this._idTick=0,this._items=[],this._sortBySelector=!0;const{groupByTarget:t,sortBySelector:n,...i}=e;this.menu=new De(i),this._groupByTarget=!1!==t,this._sortBySelector=!1!==n}addItem(e){let t=he.createItem(e,this._idTick++);return this._items.push(t),new p.DisposableDelegate((()=>{y.removeFirstOf(this._items,t)}))}open(e){if(De.saveWindowData(),this.menu.clearItems(),0===this._items.length)return!1;let t=he.matchItems(this._items,e,this._groupByTarget,this._sortBySelector);if(!t||0===t.length)return!1;for(const e of t)this.menu.addItem(e);return this.menu.open(e.clientX,e.clientY),!0}}!function(e){function t(e,t){let n=e.rank,i=t.rank;return n!==i?n=this._titles.length)&&(e=-1),this._currentIndex===e)return;let t=this._currentIndex,n=this._titles[t]||null,i=e,s=this._titles[i]||null;this._currentIndex=i,this._previousTitle=n,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:n,currentIndex:i,currentTitle:s})}get name(){return this._name}set name(e){this._name=e,e?this.contentNode.setAttribute("aria-label",e):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.contentNode.setAttribute("aria-orientation",e))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled!==e&&(this._addButtonEnabled=e,e?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(e){return this.insertTab(this._titles.length,e)}insertTab(e,t){this._releaseMouse();let n=Se.asTitle(t),i=this._titles.indexOf(n),s=Math.max(0,Math.min(e,this._titles.length));return-1===i?(y.insert(this._titles,s,n),n.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(s,n),n):(s===this._titles.length&&s--,i===s||(y.move(this._titles,i,s),this.update(),this._adjustCurrentForMove(i,s)),n)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=y.removeAt(this._titles,e);t&&(t.changed.disconnect(this._onTitleChanged,this),t===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(e,t))}clearTabs(){if(0===this._titles.length)return;this._releaseMouse();for(let e of this._titles)e.changed.disconnect(this._onTitleChanged,this);let e=this.currentIndex,t=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),-1!==e&&this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"dblclick":this._evtDblClick(e);break;case"keydown":e.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(e):this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this),this.node.addEventListener("keydown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this.node.removeEventListener("keydown",this),this._releaseMouse()}onUpdateRequest(e){var t;let n=this._titles,i=this.renderer,s=this.currentTitle,r=new Array(n.length);const o=null!==(t=this._getCurrentTabindex())&&void 0!==t?t:this._currentIndex>-1?this._currentIndex:0;for(let e=0,t=n.length;ex.hitTest(t,e.clientX,e.clientY)));if(-1===n)return;let i=this.titles[n],s=t[n].querySelector(".lm-TabBar-tabLabel");if(s&&s.contains(e.target)){let e=i.label||"",t=s.innerHTML;s.innerHTML="";let n=document.createElement("input");n.classList.add("lm-TabBar-tabInput"),n.value=e,s.appendChild(n);let r=()=>{n.removeEventListener("blur",r),s.innerHTML=t,this.node.addEventListener("keydown",this)};n.addEventListener("dblclick",(e=>e.stopPropagation())),n.addEventListener("blur",r),n.addEventListener("keydown",(e=>{"Enter"===e.key?(""!==n.value&&(i.label=i.caption=n.value),r()):"Escape"===e.key&&r()})),this.node.removeEventListener("keydown",this),n.select(),n.focus(),s.children.length>0&&s.children[0].focus()}}_evtKeyDownCapturing(e){e.eventPhase===Event.CAPTURING_PHASE&&(e.preventDefault(),e.stopPropagation(),"Escape"===e.key&&this._releaseMouse())}_evtKeyDown(e){var t,n,i;if("Tab"!==e.key&&e.eventPhase!==Event.CAPTURING_PHASE)if("Enter"===e.key||"Spacebar"===e.key||" "===e.key){const t=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(t))e.preventDefault(),e.stopPropagation(),this._addRequested.emit();else{const n=y.findFirstIndex(this.contentNode.children,(e=>e.contains(t)));n>=0&&(e.preventDefault(),e.stopPropagation(),this.currentIndex=n)}}else if(Ce.includes(e.key)){const s=[...this.contentNode.children];if(this.addButtonEnabled&&s.push(this.addButtonNode),s.length<=1)return;e.preventDefault(),e.stopPropagation();let r,o=s.indexOf(document.activeElement);-1===o&&(o=this._currentIndex),"ArrowRight"===e.key&&"horizontal"===this._orientation||"ArrowDown"===e.key&&"vertical"===this._orientation?r=null!==(t=s[o+1])&&void 0!==t?t:s[0]:"ArrowLeft"===e.key&&"horizontal"===this._orientation||"ArrowUp"===e.key&&"vertical"===this._orientation?r=null!==(n=s[o-1])&&void 0!==n?n:s[s.length-1]:"Home"===e.key?r=s[0]:"End"===e.key&&(r=s[s.length-1]),r&&(null===(i=s[o])||void 0===i||i.setAttribute("tabindex","-1"),null==r||r.setAttribute("tabindex","0"),r.focus())}}_evtPointerDown(e){if(0!==e.button&&1!==e.button)return;if(this._dragData)return;if(e.target.classList.contains("lm-TabBar-tabInput"))return;let t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),n=this.contentNode.children,i=y.findFirstIndex(n,(t=>x.hitTest(t,e.clientX,e.clientY)));if(-1===i&&!t)return;if(e.preventDefault(),e.stopPropagation(),this._dragData={tab:n[i],index:i,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),1===e.button||t)return;let s=n[i].querySelector(this.renderer.closeIconSelector);s&&s.contains(e.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===i?this.currentIndex=-1:this.currentIndex=i,-1!==this.currentIndex&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}_evtPointerMove(e){let t=this._dragData;if(!t)return;e.preventDefault(),e.stopPropagation();let n=this.contentNode.children;if(t.dragActive||Se.dragExceeded(t,e)){if(!t.dragActive){let e=t.tab.getBoundingClientRect();"horizontal"===this._orientation?(t.tabPos=t.tab.offsetLeft,t.tabSize=e.width,t.tabPressPos=t.pressX-e.left):(t.tabPos=t.tab.offsetTop,t.tabSize=e.height,t.tabPressPos=t.pressY-e.top),t.tabPressOffset={x:t.pressX-e.left,y:t.pressY-e.top},t.tabLayout=Se.snapTabLayout(n,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=V.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&Se.detachExceeded(t,e)){t.detachRequested=!0;let i=t.index,s=e.clientX,r=e.clientY,o=n[i],a=this._titles[i];if(this._tabDetachRequested.emit({index:i,title:a,tab:o,clientX:s,clientY:r,offset:t.tabPressOffset}),t.dragAborted)return}Se.layoutTabs(n,t,e,this._orientation)}}_evtPointerUp(e){if(0!==e.button&&1!==e.button)return;const t=this._dragData;if(!t)return;if(e.preventDefault(),e.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!t.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(e.target))return void this._addRequested.emit(void 0);let n=this.contentNode.children,i=y.findFirstIndex(n,(t=>x.hitTest(t,e.clientX,e.clientY)));if(i!==t.index)return;let s=this._titles[i];if(!s.closable)return;if(1===e.button)return void this._tabCloseRequested.emit({index:i,title:s});let r=n[i].querySelector(this.renderer.closeIconSelector);return r&&r.contains(e.target)?void this._tabCloseRequested.emit({index:i,title:s}):void 0}if(0!==e.button)return;Se.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging");let n=Se.parseTransitionDuration(t.tab);setTimeout((()=>{if(t.dragAborted)return;this._dragData=null,Se.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let e=t.index,n=t.targetIndex;-1!==n&&e!==n&&(y.move(this._titles,e,n),this._adjustCurrentForMove(e,n),this._tabMoved.emit({fromIndex:e,toIndex:n,title:this._titles[n]}),A.sendMessage(this,Q.Msg.UpdateRequest))}),n)}_releaseMouse(){let e=this._dragData;e&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),e.dragAborted=!0,e.dragActive&&(Se.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),e.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(e,t){let n=this.currentTitle,i=this._currentIndex,s=this.insertBehavior;if("select-tab"===s||"select-tab-if-needed"===s&&-1===i)return this._currentIndex=e,this._previousTitle=n,void this._currentChanged.emit({previousIndex:i,previousTitle:n,currentIndex:e,currentTitle:t});i>=e&&this._currentIndex++}_adjustCurrentForMove(e,t){this._currentIndex===e?this._currentIndex=t:this._currentIndex=t?this._currentIndex++:this._currentIndex>e&&this._currentIndex<=t&&this._currentIndex--}_adjustCurrentForRemove(e,t){let n=this._currentIndex,i=this.removeBehavior;if(n===e){if(0===this._titles.length)return this._currentIndex=-1,void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null});if("select-tab-after"===i)return this._currentIndex=Math.min(e,this._titles.length-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-tab-before"===i)return this._currentIndex=Math.max(0,e-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-previous-tab"===i)return this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(e,this._titles.length-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}else n>e&&this._currentIndex--}_onTitleChanged(e){this.update()}}var Se,Me,Ae,ke,Fe,Ie,Oe,Pe;!function(e){class t{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++t._nInstance}renderTab(e){let t=e.title.caption,n=this.createTabKey(e),i=n,s=this.createTabStyle(e),r=this.createTabClass(e),o=this.createTabDataset(e),a=this.createTabARIA(e);return e.title.closable?X.li({id:i,key:n,className:r,title:t,style:s,dataset:o,...a},this.renderIcon(e),this.renderLabel(e),this.renderCloseIcon(e)):X.li({id:i,key:n,className:r,title:t,style:s,dataset:o,...a},this.renderIcon(e),this.renderLabel(e))}renderIcon(e){const{title:t}=e;let n=this.createIconClass(e);return X.div({className:n},t.icon,t.iconLabel)}renderLabel(e){return X.div({className:"lm-TabBar-tabLabel"},e.title.label)}renderCloseIcon(e){return X.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(e){let t=this._tabKeys.get(e.title);return void 0===t&&(t=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(e.title,t)),t}createTabStyle(e){return{zIndex:`${e.zIndex}`}}createTabClass(e){let t="lm-TabBar-tab";return e.title.className&&(t+=` ${e.title.className}`),e.title.closable&&(t+=" lm-mod-closable"),e.current&&(t+=" lm-mod-current"),t}createTabDataset(e){return e.title.dataset}createTabARIA(e){var t;return{role:"tab","aria-selected":e.current.toString(),tabindex:`${null!==(t=e.tabIndex)&&void 0!==t?t:"-1"}`}}createIconClass(e){let t="lm-TabBar-tabIcon",n=e.title.iconClass;return n?`${t} ${n}`:t}}t._nInstance=0,e.Renderer=t,e.defaultRenderer=new t,e.addButtonSelector=".lm-TabBar-addButton"}(Ee||(Ee={})),function(e){e.DRAG_THRESHOLD=5,e.DETACH_THRESHOLD=20,e.createNode=function(){let e=document.createElement("div"),t=document.createElement("ul");t.setAttribute("role","tablist"),t.className="lm-TabBar-content",e.appendChild(t);let n=document.createElement("div");return n.className="lm-TabBar-addButton lm-mod-hidden",n.setAttribute("tabindex","-1"),n.setAttribute("role","button"),e.appendChild(n),e},e.asTitle=function(e){return e instanceof Z?e:new Z(e)},e.parseTransitionDuration=function(e){let t=window.getComputedStyle(e);return 1e3*(parseFloat(t.transitionDuration)||0)},e.snapTabLayout=function(e,t){let n=new Array(e.length);for(let i=0,s=e.length;i=e.DRAG_THRESHOLD||s>=e.DRAG_THRESHOLD},e.detachExceeded=function(t,n){let i=t.contentRect;return n.clientX=i.right+e.DETACH_THRESHOLD||n.clientY=i.bottom+e.DETACH_THRESHOLD},e.layoutTabs=function(e,t,n,i){let s,r,o,a;"horizontal"===i?(s=t.pressX,r=n.clientX-t.contentRect.left,o=n.clientX,a=t.contentRect.width):(s=t.pressY,r=n.clientY-t.contentRect.top,o=n.clientY,a=t.contentRect.height);let l=t.index,u=r-t.tabPressPos,c=u+t.tabSize;for(let n=0,r=e.length;n>1);if(nt.index&&c>h)r=-t.tabSize-d.margin+"px",l=Math.max(l,n);else if(n===t.index){let e=o-s,n=a-(t.tabPos+t.tabSize);r=`${Math.max(-t.tabPos,Math.min(e,n))}px`}else r="";"horizontal"===i?e[n].style.left=r:e[n].style.top=r}t.targetIndex=l},e.finalizeTabPosition=function(e,t){let n,i;if(n="horizontal"===t?e.contentRect.width:e.contentRect.height,e.targetIndex===e.index)i=0;else if(e.targetIndex>e.index){let t=e.tabLayout[e.targetIndex];i=t.pos+t.size-e.tabSize-e.tabPos}else i=e.tabLayout[e.targetIndex].pos-e.tabPos;let s=n-(e.tabPos+e.tabSize),r=Math.max(-e.tabPos,Math.min(i,s));"horizontal"===t?e.tab.style.left=`${r}px`:e.tab.style.top=`${r}px`},e.resetTabPositions=function(e,t){for(const n of e)"horizontal"===t?n.style.left="":n.style.top=""}}(Se||(Se={}));class Be extends ee{constructor(e){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=e.renderer,void 0!==e.spacing&&(this._spacing=pe.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:Q.HiddenMode.Display}dispose(){let e=this[Symbol.iterator]();this._items.forEach((e=>{e.dispose()})),this._box=null,this._root=null,this._items.clear();for(const t of e)t.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e){this._hiddenMode=e;for(const e of this.tabBars())if(e.titles.length>1)for(const t of e.titles)t.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(e){e=pe.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get isEmpty(){return null===this._root}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():I()}widgets(){return this._root?this._root.iterUserWidgets():I()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():I()}tabBars(){return this._root?this._root.iterTabBars():I()}handles(){return this._root?this._root.iterHandles():I()}moveHandle(e,t,n){let i=e.classList.contains("lm-mod-hidden");if(!this._root||i)return;let s,r=this._root.findSplitNode(e);r&&(s="horizontal"===r.node.orientation?t-e.offsetLeft:n-e.offsetTop,0!==s&&(r.node.holdSizes(),q.adjust(r.node.sizers,r.index,s),this.parent&&this.parent.update()))}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(e){let t,n=new Set;t=e.main?Me.normalizeAreaConfig(e.main,n):null;let i=this.widgets(),s=this.tabBars(),r=this.handles();this._root=null;for(const e of i)n.has(e)||(e.parent=null);for(const e of s)e.dispose();for(const e of r)e.parentNode&&e.parentNode.removeChild(e);for(const e of n)e.parent=this.parent;this._root=t?Me.realizeAreaConfig(t,{createTabBar:e=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):null,this.parent&&(n.forEach((e=>{this.attachWidget(e)})),this.parent.fit())}addWidget(e,t={}){let n=t.ref||null,i=t.mode||"tab-after",s=null;if(this._root&&n&&(s=this._root.findTabNode(n)),n&&!s)throw new Error("Reference widget is not in the layout.");switch(e.parent=this.parent,i){case"tab-after":this._insertTab(e,n,s,!0);break;case"tab-before":this._insertTab(e,n,s,!1);break;case"split-top":this._insertSplit(e,n,s,"vertical",!1);break;case"split-left":this._insertSplit(e,n,s,"horizontal",!1);break;case"split-right":this._insertSplit(e,n,s,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,n,s,"vertical",!0);break;case"merge-top":this._insertSplit(e,n,s,"vertical",!1,!0);break;case"merge-left":this._insertSplit(e,n,s,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(e,n,s,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(e,n,s,"vertical",!0,!0)}this.parent&&(this.attachWidget(e),this.parent.fit())}removeWidget(e){this._removeWidget(e),this.parent&&(this.detachWidget(e),this.parent.fit())}hitTestTabAreas(e,t){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=x.boxSizing(this.parent.node));let n=this.parent.node.getBoundingClientRect(),i=e-n.left-this._box.borderLeft,s=t-n.top-this._box.borderTop,r=this._root.hitTestTabNodes(i,s);if(!r)return null;let{tabBar:o,top:a,left:l,width:u,height:c}=r,d=this._box.borderLeft+this._box.borderRight,h=this._box.borderTop+this._box.borderBottom;return{tabBar:o,x:i,y:s,top:a,left:l,right:n.width-d-(l+u),bottom:n.height-h-(a+c),width:u,height:c}}init(){super.init();for(const e of this)this.attachWidget(e);for(const e of this.handles())this.parent.node.appendChild(e);this.parent.fit()}attachWidget(e){this.parent.node!==e.node.parentNode&&(this._items.set(e,new te(e)),this.parent.isAttached&&A.sendMessage(e,Q.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&A.sendMessage(e,Q.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&A.sendMessage(e,Q.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&A.sendMessage(e,Q.Msg.AfterDetach);let t=this._items.get(e);t&&(this._items.delete(e),t.dispose())}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_removeWidget(e){if(!this._root)return;let t=this._root.findTabNode(e);if(!t)return;if(Me.removeAria(e),t.tabBar.titles.length>1)return t.tabBar.removeTab(e.title),void(this._hiddenMode===Q.HiddenMode.Scale&&1==t.tabBar.titles.length&&(t.tabBar.titles[0].owner.hiddenMode=Q.HiddenMode.Display));if(t.tabBar.dispose(),this._root===t)return void(this._root=null);this._root.holdAllSizes();let n=t.parent;t.parent=null;let i=y.removeFirstOf(n.children,t),s=y.removeAt(n.handles,i);if(y.removeAt(n.sizers,i),s.parentNode&&s.parentNode.removeChild(s),n.children.length>1)return void n.syncHandles();let r=n.parent;n.parent=null;let o=n.children[0],a=n.handles[0];if(n.children.length=0,n.handles.length=0,n.sizers.length=0,a.parentNode&&a.parentNode.removeChild(a),this._root===n)return o.parent=null,void(this._root=o);let l=r,u=l.children.indexOf(n);if(o instanceof Me.TabLayoutNode)return o.parent=l,void(l.children[u]=o);let c=y.removeAt(l.handles,u);y.removeAt(l.children,u),y.removeAt(l.sizers,u),c.parentNode&&c.parentNode.removeChild(c);for(let e=0,t=o.children.length;e=n.length)&&(i=0),{type:"tab-area",widgets:n,currentIndex:i}}(t,n):function(t,n){let i=t.orientation,s=[],r=[];for(let o=0,a=t.children.length;o{let l=s(i,n,r),u=t(e.sizes[a]),c=n.createHandle();o.children.push(l),o.handles.push(c),o.sizers.push(u),l.parent=o})),o.syncHandles(),o.normalizeSizes(),o}(r,o,a),l};class n{constructor(e){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;let t=new Y,n=new Y;t.stretch=0,n.stretch=1,this.tabBar=e,this.sizers=[t,n]}get top(){return this._top}get left(){return this._left}get width(){return this._width}get height(){return this._height}*iterAllWidgets(){yield this.tabBar,yield*this.iterUserWidgets()}*iterUserWidgets(){for(const e of this.tabBar.titles)yield e.owner}*iterSelectedWidgets(){let e=this.tabBar.currentTitle;e&&(yield e.owner)}*iterTabBars(){yield this.tabBar}*iterHandles(){}findTabNode(e){return-1!==this.tabBar.titles.indexOf(e.title)?this:null}findSplitNode(e){return null}findFirstTabNode(){return this}hitTestTabNodes(e,t){return e=this._left+this._width||t=this._top+this._height?null:this}createConfig(){return{type:"tab-area",widgets:this.tabBar.titles.map((e=>e.owner)),currentIndex:this.tabBar.currentIndex}}holdAllSizes(){}fit(e,t){let n=0,i=0,s=t.get(this.tabBar),r=this.tabBar.currentTitle,o=r?t.get(r.owner):void 0,[a,l]=this.sizers;return s&&s.fit(),o&&o.fit(),s&&!s.isHidden?(n=Math.max(n,s.minWidth),i+=s.minHeight,a.minSize=s.minHeight,a.maxSize=s.maxHeight):(a.minSize=0,a.maxSize=0),o&&!o.isHidden?(n=Math.max(n,o.minWidth),i+=o.minHeight,l.minSize=o.minHeight,l.maxSize=1/0):(l.minSize=0,l.maxSize=1/0),{minWidth:n,minHeight:i,maxWidth:1/0,maxHeight:1/0}}update(e,t,n,i,s,r){this._top=t,this._left=e,this._width=n,this._height=i;let o=r.get(this.tabBar),a=this.tabBar.currentTitle,l=a?r.get(a.owner):void 0;if(q.calc(this.sizers,i),o&&!o.isHidden){let i=this.sizers[0].size;o.update(e,t,n,i),t+=i}if(l&&!l.isHidden){let i=this.sizers[1].size;l.update(e,t,n,i)}}}e.TabLayoutNode=n;class i{constructor(e){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=e}*iterAllWidgets(){for(const e of this.children)yield*e.iterAllWidgets()}*iterUserWidgets(){for(const e of this.children)yield*e.iterUserWidgets()}*iterSelectedWidgets(){for(const e of this.children)yield*e.iterSelectedWidgets()}*iterTabBars(){for(const e of this.children)yield*e.iterTabBars()}*iterHandles(){yield*this.handles;for(const e of this.children)yield*e.iterHandles()}findTabNode(e){for(let t=0,n=this.children.length;te.createConfig())),sizes:t}}syncHandles(){this.handles.forEach(((e,t)=>{e.setAttribute("data-orientation",this.orientation),t===this.handles.length-1?e.classList.add("lm-mod-hidden"):e.classList.remove("lm-mod-hidden")}))}holdSizes(){for(const e of this.sizers)e.sizeHint=e.size}holdAllSizes(){for(const e of this.children)e.holdAllSizes();this.holdSizes()}normalizeSizes(){let e=this.sizers.length;if(0===e)return;this.holdSizes();let t=this.sizers.reduce(((e,t)=>e+t.sizeHint),0);if(0===t)for(const t of this.sizers)t.size=t.sizeHint=1/e;else for(const e of this.sizers)e.size=e.sizeHint/=t;this.normalized=!0}createNormalizedSizes(){let e=this.sizers.length;if(0===e)return[];let t=this.sizers.map((e=>e.size)),n=t.reduce(((e,t)=>e+t),0);if(0===n)for(let n=t.length-1;n>-1;n--)t[n]=1/e;else for(let e=t.length-1;e>-1;e--)t[e]/=n;return t}fit(e,t){let n="horizontal"===this.orientation,i=Math.max(0,this.children.length-1)*e,s=n?i:0,r=n?0:i;for(let i=0,o=this.children.length;ithis._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new Be({document:this._document,renderer:t,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new Re.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(e){this.layout.hiddenMode=e}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get mode(){return this._mode}set mode(e){if(this._mode===e)return;this._mode=e,this.dataset.mode=e;let t=this.layout;switch(e){case"multiple-document":for(const e of t.tabBars())e.show();break;case"single-document":t.restoreLayout(Ae.createSingleDocumentConfig(this));break;default:throw"unreachable"}A.postMessage(this,Ae.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(e){this._tabsMovable=e;for(const t of this.tabBars())t.tabsMovable=e}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(e){this._tabsConstrained=e}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled=e;for(const t of this.tabBars())t.addButtonEnabled=e}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(e){let t=O(this.tabBars(),(t=>-1!==t.titles.indexOf(e.title)));if(!t)throw new Error("Widget is not contained in the dock panel.");t.currentTitle=e.title}activateWidget(e){this.selectWidget(e),e.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(e){this._mode="multiple-document",this.layout.restoreLayout(e),(C.IS_EDGE||C.IS_IE)&&A.flush(),A.postMessage(this,Ae.LayoutModified)}addWidget(e,t={}){"single-document"===this._mode?this.layout.addWidget(e):this.layout.addWidget(e,t),A.postMessage(this,Ae.LayoutModified)}processMessage(e){"layout-modified"===e.type?this._layoutModified.emit(void 0):super.processMessage(e)}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){Ae.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){Ae.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),A.postMessage(this,Ae.LayoutModified))}_evtDragEnter(e){e.mimeData.hasData("application/vnd.lumino.widget-factory")&&(e.preventDefault(),e.stopPropagation())}_evtDragLeave(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||(e.stopPropagation(),this.overlay.hide(1))}_evtDragOver(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||"invalid"===this._showOverlay(e.clientX,e.clientY)?e.dropAction="none":(e.stopPropagation(),e.dropAction=e.proposedAction)}_evtDrop(e){if(e.preventDefault(),this.overlay.hide(0),"none"===e.proposedAction)return void(e.dropAction="none");let{clientX:t,clientY:n}=e,{zone:i,target:s}=Ae.findDropTarget(this,t,n,this._edges);if(this._tabsConstrained&&e.source!==this||"invalid"===i)return void(e.dropAction="none");let r=e.mimeData.getData("application/vnd.lumino.widget-factory");if("function"!=typeof r)return void(e.dropAction="none");let o=r();if(!(o instanceof Q))return void(e.dropAction="none");if(o.contains(this))return void(e.dropAction="none");let a=s?Ae.getDropRef(s.tabBar):null;switch(i){case"root-all":this.addWidget(o);break;case"root-top":this.addWidget(o,{mode:"split-top"});break;case"root-left":this.addWidget(o,{mode:"split-left"});break;case"root-right":this.addWidget(o,{mode:"split-right"});break;case"root-bottom":this.addWidget(o,{mode:"split-bottom"});break;case"widget-all":case"widget-tab":this.addWidget(o,{mode:"tab-after",ref:a});break;case"widget-top":this.addWidget(o,{mode:"split-top",ref:a});break;case"widget-left":this.addWidget(o,{mode:"split-left",ref:a});break;case"widget-right":this.addWidget(o,{mode:"split-right",ref:a});break;case"widget-bottom":this.addWidget(o,{mode:"split-bottom",ref:a});break;default:throw"unreachable"}e.dropAction=e.proposedAction,e.stopPropagation(),this.activateWidget(o)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&(this._releaseMouse(),A.postMessage(this,Ae.LayoutModified))}_evtPointerDown(e){if(0!==e.button)return;let t=this.layout,n=e.target,i=O(t.handles(),(e=>e.contains(n)));if(!i)return;e.preventDefault(),e.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let s=i.getBoundingClientRect(),r=e.clientX-s.left,o=e.clientY-s.top,a=window.getComputedStyle(i),l=V.overrideCursor(a.cursor,this._document);this._pressData={handle:i,deltaX:r,deltaY:o,override:l}}_evtPointerMove(e){if(!this._pressData)return;e.preventDefault(),e.stopPropagation();let t=this.node.getBoundingClientRect(),n=e.clientX-t.left-this._pressData.deltaX,i=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,n,i)}_evtPointerUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse(),A.postMessage(this,Ae.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(e,t){let n,i,s,r,{zone:o,target:a}=Ae.findDropTarget(this,e,t,this._edges);if("invalid"===o)return this.overlay.hide(100),o;let l=x.boxSizing(this.node),u=this.node.getBoundingClientRect();switch(o){case"root-all":n=l.paddingTop,i=l.paddingLeft,s=l.paddingRight,r=l.paddingBottom;break;case"root-top":n=l.paddingTop,i=l.paddingLeft,s=l.paddingRight,r=u.height*Ae.GOLDEN_RATIO;break;case"root-left":n=l.paddingTop,i=l.paddingLeft,s=u.width*Ae.GOLDEN_RATIO,r=l.paddingBottom;break;case"root-right":n=l.paddingTop,i=u.width*Ae.GOLDEN_RATIO,s=l.paddingRight,r=l.paddingBottom;break;case"root-bottom":n=u.height*Ae.GOLDEN_RATIO,i=l.paddingLeft,s=l.paddingRight,r=l.paddingBottom;break;case"widget-all":n=a.top,i=a.left,s=a.right,r=a.bottom;break;case"widget-top":n=a.top,i=a.left,s=a.right,r=a.bottom+a.height/2;break;case"widget-left":n=a.top,i=a.left,s=a.right+a.width/2,r=a.bottom;break;case"widget-right":n=a.top,i=a.left+a.width/2,s=a.right,r=a.bottom;break;case"widget-bottom":n=a.top+a.height/2,i=a.left,s=a.right,r=a.bottom;break;case"widget-tab":{const e=a.tabBar.node.getBoundingClientRect().height;n=a.top,i=a.left,s=a.right,r=a.bottom+a.height-e;break}default:throw"unreachable"}return this.overlay.show({top:n,left:i,right:s,bottom:r}),o}_createTabBar(){let e=this._renderer.createTabBar(this._document);return Ae.isGeneratedTabBarProperty.set(e,!0),"single-document"===this._mode&&e.hide(),e.tabsMovable=this._tabsMovable,e.allowDeselect=!1,e.addButtonEnabled=this._addButtonEnabled,e.removeBehavior="select-previous-tab",e.insertBehavior="select-tab-if-needed",e.tabMoved.connect(this._onTabMoved,this),e.currentChanged.connect(this._onCurrentChanged,this),e.tabCloseRequested.connect(this._onTabCloseRequested,this),e.tabDetachRequested.connect(this._onTabDetachRequested,this),e.tabActivateRequested.connect(this._onTabActivateRequested,this),e.addRequested.connect(this._onTabAddRequested,this),e}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){A.postMessage(this,Ae.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:n,currentTitle:i}=t;n&&n.owner.hide(),i&&i.owner.show(),(C.IS_EDGE||C.IS_IE)&&A.flush(),A.postMessage(this,Ae.LayoutModified)}_onTabAddRequested(e){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabDetachRequested(e,t){if(this._drag)return;e.releaseMouse();let{title:n,tab:i,clientX:s,clientY:r,offset:o}=t,a=new h.MimeData;a.setData("application/vnd.lumino.widget-factory",(()=>n.owner));let l=i.cloneNode(!0);o&&(l.style.top=`-${o.y}px`,l.style.left=`-${o.x}px`),this._drag=new V({document:this._document,mimeData:a,dragImage:l,proposedAction:"move",supportedActions:"move",source:this}),i.classList.add("lm-mod-hidden"),this._drag.start(s,r).then((()=>{this._drag=null,i.classList.remove("lm-mod-hidden")}))}}!function(e){e.Overlay=class{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(e){let t=this.node.style;t.top=`${e.top}px`,t.left=`${e.left}px`,t.right=`${e.right}px`,t.bottom=`${e.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(e){if(!this._hidden)return e<=0?(clearTimeout(this._timer),this._timer=-1,this._hidden=!0,void this.node.classList.add("lm-mod-hidden")):void(-1===this._timer&&(this._timer=window.setTimeout((()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")}),e)))}};class t{createTabBar(e){let t=new Ee({document:e});return t.addClass("lm-DockPanel-tabBar"),t}createHandle(){let e=document.createElement("div");return e.className="lm-DockPanel-handle",e}}e.Renderer=t,e.defaultRenderer=new t}(Re||(Re={})),function(e){e.GOLDEN_RATIO=.618,e.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},e.LayoutModified=new R("layout-modified"),e.isGeneratedTabBarProperty=new $.AttachedProperty({name:"isGeneratedTabBar",create:()=>!1}),e.createSingleDocumentConfig=function(e){if(e.isEmpty)return{main:null};let t=Array.from(e.widgets()),n=e.selectedWidgets().next().value,i=n?t.indexOf(n):-1;return{main:{type:"tab-area",widgets:t,currentIndex:i}}},e.findDropTarget=function(e,t,n,i){if(!x.hitTest(e.node,t,n))return{zone:"invalid",target:null};let s=e.layout;if(s.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===e.mode){let s=e.node.getBoundingClientRect(),r=t-s.left+1,o=n-s.top+1,a=s.right-t,l=s.bottom-n;switch(Math.min(o,a,l,r)){case o:if(od&&l>d&&a>h&&u>h)return{zone:"widget-all",target:r};switch(o/=d,a/=h,l/=d,u/=h,Math.min(o,a,l,u)){case o:c="widget-left";break;case a:c="widget-top";break;case l:c="widget-right";break;case u:c="widget-bottom";break;default:throw"unreachable"}return{zone:c,target:r}},e.getDropRef=function(e){return 0===e.titles.length?null:e.currentTitle?e.currentTitle.owner:e.titles[e.titles.length-1].owner}}(Ae||(Ae={}));class Te extends ee{constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new Y],this._columnSizers=[new Y],this._box=null,void 0!==e.rowCount&&ke.reallocSizers(this._rowSizers,e.rowCount),void 0!==e.columnCount&&ke.reallocSizers(this._columnSizers,e.columnCount),void 0!==e.rowSpacing&&(this._rowSpacing=ke.clampValue(e.rowSpacing)),void 0!==e.columnSpacing&&(this._columnSpacing=ke.clampValue(e.columnSpacing))}dispose(){for(const e of this._items){let t=e.widget;e.dispose(),t.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(e){e!==this.rowCount&&(ke.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(ke.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=ke.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=ke.clampValue(e),this._columnSpacing!==e&&(this._columnSpacing=e,this.parent&&this.parent.fit())}rowStretch(e){let t=this._rowSizers[e];return t?t.stretch:-1}setRowStretch(e,t){let n=this._rowSizers[e];n&&(t=ke.clampValue(t),n.stretch!==t&&(n.stretch=t,this.parent&&this.parent.update()))}columnStretch(e){let t=this._columnSizers[e];return t?t.stretch:-1}setColumnStretch(e,t){let n=this._columnSizers[e];n&&(t=ke.clampValue(t),n.stretch!==t&&(n.stretch=t,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(const e of this._items)yield e.widget}addWidget(e){-1===y.findFirstIndex(this._items,(t=>t.widget===e))&&(this._items.push(new te(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=y.findFirstIndex(this._items,(t=>t.widget===e));if(-1===t)return;let n=y.removeAt(this._items,t);this.parent&&this.detachWidget(e),n.dispose()}init(){super.init();for(const e of this)this.attachWidget(e)}attachWidget(e){this.parent.isAttached&&A.sendMessage(e,Q.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&A.sendMessage(e,Q.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&A.sendMessage(e,Q.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&A.sendMessage(e,Q.Msg.AfterDetach),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(let e=0,t=this.rowCount;e!e.isHidden));for(let t=0,n=e.length;t({row:0,column:0,rowSpan:1,columnSpan:1}),changed:function(e){e.parent&&e.parent.layout instanceof Te&&e.parent.fit()}}),e.normalizeConfig=function(e){return{row:Math.max(0,Math.floor(e.row||0)),column:Math.max(0,Math.floor(e.column||0)),rowSpan:Math.max(1,Math.floor(e.rowSpan||0)),columnSpan:Math.max(1,Math.floor(e.columnSpan||0))}},e.clampValue=function(e){return Math.max(0,Math.floor(e))},e.rowSpanCmp=function(t,n){let i=e.cellConfigProperty.get(t.widget),s=e.cellConfigProperty.get(n.widget);return i.rowSpan-s.rowSpan},e.columnSpanCmp=function(t,n){let i=e.cellConfigProperty.get(t.widget),s=e.cellConfigProperty.get(n.widget);return i.columnSpan-s.columnSpan},e.reallocSizers=function(e,t){for(t=Math.max(1,Math.floor(t));e.lengtht&&(e.length=t)},e.distributeMin=function(e,t,n,i){if(n=i)return;let r=(i-s)/(n-t+1);for(let i=t;i<=n;++i)e[i].minSize+=r}}(ke||(ke={}));class Le extends Q{constructor(e={}){super({node:Fe.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(Q.Flag.DisallowLayout),this.renderer=e.renderer||Le.defaultRenderer,this._forceItemsPosition=e.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=e.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(e){this.activeIndex=e?this._menus.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._menus.length)&&(e=-1),e>-1&&0===this._menus[e].items.length&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this.update())}get menus(){return this._menus}openActiveMenu(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(e,t=!0){this.insertMenu(this._menus.length,e,t)}insertMenu(e,t,n=!0){this._closeChildMenu();let i=this._menus.indexOf(t),s=Math.max(0,Math.min(e,this._menus.length));if(-1===i)return y.insert(this._menus,s,t),t.addClass("lm-MenuBar-menu"),t.aboutToClose.connect(this._onMenuAboutToClose,this),t.menuRequested.connect(this._onMenuMenuRequested,this),t.title.changed.connect(this._onTitleChanged,this),void(n&&this.update());s===this._menus.length&&s--,i!==s&&(y.move(this._menus,i,s),n&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let n=y.removeAt(this._menus,e);n&&(n.aboutToClose.disconnect(this._onMenuAboutToClose,this),n.menuRequested.disconnect(this._onMenuMenuRequested,this),n.title.changed.disconnect(this._onTitleChanged,this),n.removeClass("lm-MenuBar-menu"),t&&this.update())}clearMenus(){if(0!==this._menus.length){this._closeChildMenu();for(let e of this._menus)e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"focusout":this._evtFocusOut(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(e){this.isAttached&&this._focusItemAt(0)}onResize(e){this.update(),super.onResize(e)}onUpdateRequest(e){var t;let n=this._menus,i=this.renderer,s=this._activeIndex,r=this._tabFocusIndex>=0&&this._tabFocusIndex-1?this._overflowIndex:n.length,a=0,l=!1;o=null!==this._overflowMenu?o-1:o;let u=new Array(o);for(let e=0;e{this._tabFocusIndex=e,this.activeIndex=e}}),a+=this._menuItemSizes[e],n[e].title.label===this._overflowMenuOptions.title&&(l=!0,o--);if(this._overflowMenuOptions.isVisible)if(this._overflowIndex>-1&&!l){if(null===this._overflowMenu){const e=null!==(t=this._overflowMenuOptions.title)&&void 0!==t?t:"...";this._overflowMenu=new De({commands:new F}),this._overflowMenu.title.label=e,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let e=n.length-2;e>=o;e--){const t=this.menus[e];t.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:t}),this.removeMenu(t,!1)}u[o]=i.renderItem({title:this._overflowMenu.title,active:o===s&&0!==n[o].items.length,tabbable:o===r,disabled:0===n[o].items.length,onfocus:()=>{this._tabFocusIndex=o,this.activeIndex=o}}),o++}else if(null!==this._overflowMenu){let e=this._overflowMenu.items,t=this.node.offsetWidth,s=this._overflowMenu.items.length;for(let l=0;lthis._menuItemSizes[s]){let t=e[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(o,t,!1),u[o]=i.renderItem({title:t.title,active:!1,tabbable:o===r,disabled:0===n[o].items.length,onfocus:()=>{this._tabFocusIndex=o,this.activeIndex=o}}),o++}}0===this._overflowMenu.items.length&&(this.removeMenu(this._overflowMenu,!1),u.pop(),this._overflowMenu=null,this._overflowIndex=-1)}z.render(u,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;const e=this.contentNode.childNodes;let t=this.node.offsetWidth,n=0,i=-1,s=e.length;if(0==this._menuItemSizes.length)for(let r=0;rt&&-1===i&&(i=r)}else for(let e=0;et){i=e;break}this._overflowIndex=i}_evtKeyDown(e){let t=e.keyCode;if(9===t)return void(this.activeIndex=-1);if(e.preventDefault(),e.stopPropagation(),13===t||32===t||38===t||40===t){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;return void this.openActiveMenu()}if(27===t)return this._closeChildMenu(),void this._focusItemAt(this.activeIndex);if(37===t||39===t){let e=37===t?-1:1,n=this._tabFocusIndex+e,i=this._menus.length;for(let t=0;tx.hitTest(t,e.clientX,e.clientY)));if(-1!==t){if(0===e.button)if(this._childMenu)this._closeChildMenu(),this.activeIndex=t;else{e.preventDefault();const n=this._positionForMenu(t);De.saveWindowData(),this.activeIndex=t,this._openChildMenu(n)}}else this._closeChildMenu()}_evtMouseMove(e){let t=y.findFirstIndex(this.contentNode.children,(t=>x.hitTest(t,e.clientX,e.clientY)));if(t===this._activeIndex)return;if(-1===t&&this._childMenu)return;const n=t>=0&&this._childMenu?this._positionForMenu(t):null;De.saveWindowData(),this.activeIndex=t,n&&this._openChildMenu(n)}_positionForMenu(e){let t=this.contentNode.children[e],{left:n,bottom:i}=t.getBoundingClientRect();return{top:i,left:n}}_evtFocusOut(e){this._childMenu||this.node.contains(e.relatedTarget)||(this.activeIndex=-1)}_focusItemAt(e){const t=this.contentNode.childNodes[e];t&&t.focus()}_openChildMenu(e={}){let t=this.activeMenu;if(!t)return void this._closeChildMenu();let n=this._childMenu;if(n===t)return;this._childMenu=t,n?n.close():document.addEventListener("mousedown",this,!0),this._tabFocusIndex=this.activeIndex,A.sendMessage(this,Q.Msg.UpdateRequest);let{left:i,top:s}=e;void 0!==i&&void 0!==s||({left:i,top:s}=this._positionForMenu(this._activeIndex)),n||this.addClass("lm-mod-active"),t.items.length>0&&t.open(i,s,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0);let e=this._childMenu;this._childMenu=null,e.close(),this.activeIndex=-1}_onMenuAboutToClose(e){e===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(e,t){if(e!==this._childMenu)return;let n=this._activeIndex,i=this._menus.length;switch(t){case"next":this.activeIndex=n===i-1?0:n+1;break;case"previous":this.activeIndex=0===n?i-1:n-1}this.openActiveMenu()}_onTitleChanged(){this.update()}}!function(e){class t{renderItem(e){let t=this.createItemClass(e),n=this.createItemDataset(e),i=this.createItemARIA(e);return X.li({className:t,dataset:n,...e.disabled?{}:{tabindex:e.tabbable?"0":"-1"},onfocus:e.onfocus,...i},this.renderIcon(e),this.renderLabel(e))}renderIcon(e){let t=this.createIconClass(e);return X.div({className:t},e.title.icon,e.title.iconLabel)}renderLabel(e){let t=this.formatLabel(e);return X.div({className:"lm-MenuBar-itemLabel"},t)}createItemClass(e){let t="lm-MenuBar-item";return e.title.className&&(t+=` ${e.title.className}`),e.active&&!e.disabled&&(t+=" lm-mod-active"),t}createItemDataset(e){return e.title.dataset}createItemARIA(e){return{role:"menuitem","aria-haspopup":"true","aria-disabled":e.disabled?"true":"false"}}createIconClass(e){let t="lm-MenuBar-itemIcon",n=e.title.iconClass;return n?`${t} ${n}`:t}formatLabel(e){let{label:t,mnemonic:n}=e.title;if(n<0||n>=t.length)return t;let i=t.slice(0,n),s=t.slice(n+1),r=t[n];return[i,X.span({className:"lm-MenuBar-itemMnemonic"},r),s]}}e.Renderer=t,e.defaultRenderer=new t}(Le||(Le={})),function(e){e.createNode=function(){let e=document.createElement("div"),t=document.createElement("ul");return t.className="lm-MenuBar-content",e.appendChild(t),t.setAttribute("role","menubar"),e},e.findMnemonic=function(e,t,n){let i=-1,s=-1,r=!1,o=t.toUpperCase();for(let t=0,a=e.length;t=0&&c1&&this.widgets.forEach((e=>{e.hiddenMode=this._hiddenMode})))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(e,t){this._hiddenMode===Q.HiddenMode.Scale&&this._items.length>0?(1===this._items.length&&(this.widgets[0].hiddenMode=Q.HiddenMode.Scale),t.hiddenMode=Q.HiddenMode.Scale):t.hiddenMode=Q.HiddenMode.Display,y.insert(this._items,e,new te(t)),this.parent.isAttached&&A.sendMessage(t,Q.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&A.sendMessage(t,Q.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){y.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let n=y.removeAt(this._items,e);this.parent.isAttached&&A.sendMessage(t,Q.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&A.sendMessage(t,Q.Msg.AfterDetach),n.widget.node.style.zIndex="",this._hiddenMode===Q.HiddenMode.Scale&&(t.hiddenMode=Q.HiddenMode.Display,1===this._items.length&&(this._items[0].widget.hiddenMode=Q.HiddenMode.Display)),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0,t=0;for(let n=0,i=this._items.length;n{try{this.registerPlugin(e)}catch(e){console.error(e)}}))}registerPluginModules(e){e.forEach((e=>{this.registerPluginModule(e)}))}}var He=n(9401),Ke=n(5026)},5026:(e,t,n)=>{"use strict";n.d(t,{J:()=>l});var i=n(5764),s=n(8571),r=n(8925),o=n(9401);const a=r.PageConfig.getOption("appVersion");class l{constructor(e){var t;this.unregisterOldServiceWorkers=e=>{const t=`${e}-version`,n=localStorage.getItem(t);(n&&n!==a||!n)&&(console.info("New version, unregistering existing service workers."),navigator.serviceWorker.getRegistrations().then((e=>{for(const t of e)t.unregister()})).then((()=>{console.info("All existing service workers have been unregistered.")}))),localStorage.setItem(t,a)},this._registration=null,this._registrationChanged=new s.Signal(this),this._ready=new i.PromiseDelegate;const n=null!==(t=null==e?void 0:e.workerUrl)&&void 0!==t?t:r.URLExt.join(r.PageConfig.getBaseUrl(),o.H),l=new URL(n,window.location.href),u=r.PageConfig.getOption("enableServiceWorkerCache")||"false";l.searchParams.set("enableCache",u),this.initialize(l.href).catch(console.warn)}get registrationChanged(){return this._registrationChanged}get enabled(){return null!==this._registration}get ready(){return this._ready.promise}async initialize(e){const{serviceWorker:t}=navigator;let n=null;if(t){if(t.controller){const e=t.controller.scriptURL;this.unregisterOldServiceWorkers(e),n=await t.getRegistration(e)||null,console.info("JupyterLite ServiceWorker was already registered")}}else console.warn("ServiceWorkers not supported in this browser");if(!n&&t)try{console.info("Registering new JupyterLite ServiceWorker",e),n=await t.register(e),console.info("JupyterLite ServiceWorker was sucessfully registered")}catch(e){console.warn(e),console.warn(`JupyterLite ServiceWorker registration unexpectedly failed: ${e}`)}this._setRegistration(n),n?this._ready.resolve(void 0):this._ready.reject(void 0)}_setRegistration(e){this._registration=e,this._registrationChanged.emit(this._registration)}}},9401:(e,t,n)=>{"use strict";n.d(t,{u:()=>r,H:()=>o});var i=n(5764);const s=n.p+"service-worker.js",r=new i.Token("@jupyterlite/server-extension:IServiceWorkerManager"),o=`${s}`.split("/").slice(-1)[0]},5764:function(e,t,n){!function(e,t){"use strict";e.JSONExt=void 0,function(e){function t(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e}function n(e){return Array.isArray(e)}function i(e,s){if(e===s)return!0;if(t(e)||t(s))return!1;let r=n(e),o=n(s);return r===o&&(r&&o?function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,s=e.length;n{if(i===e.provides)return!0;const o=n.get(i);if(!o)return!1;const a=t.get(o),l=[...a.requires,...a.optional];return 0!==l.length&&(r.push(o),!!l.some(s)||(r.pop(),!1))};if(!e.provides||0===i.length)return;const r=[e.id];if(i.some(s))throw new ReferenceError(`Cycle detected: ${r.join(" -> ")}.`)},e.findDependents=function(e,n,i){const s=new Array,r=e=>{const t=n.get(e),r=[...t.requires,...t.optional];s.push(...r.reduce(((t,n)=>{const s=i.get(n);return s&&t.push([e,s]),t}),[]))};for(const e of n.keys())r(e);const o=s.filter((t=>t[1]===e));let a=0;for(;o.length>a;){const e=o.length,t=new Set(o.map((e=>e[0])));for(const e of t)s.filter((t=>t[1]===e)).forEach((e=>{o.includes(e)||o.push(e)}));a=e}const l=t.topologicSort(o),u=l.findIndex((t=>t===e));return-1===u?[e]:l.slice(0,u+1)},e.collectStartupPlugins=function(e,t){const n=new Set;for(const t of e.keys())!0===e.get(t).autoStart&&n.add(t);if(t.startPlugins)for(const e of t.startPlugins)n.add(e);if(t.ignorePlugins)for(const e of t.ignorePlugins)n.delete(e);return Array.from(n)}}(n||(n={}));function i(e){let t=0;for(let n=0,i=e.length;n>>0),e[n]=255&t,t>>>=8}e.Random=void 0,(e.Random||(e.Random={})).getRandomValues=(()=>{const e="undefined"!=typeof window&&(window.crypto||window.msCrypto)||null;return e&&"function"==typeof e.getRandomValues?function(t){return e.getRandomValues(t)}:i})(),e.UUID=void 0,(e.UUID||(e.UUID={})).uuid4=function(e){const t=new Uint8Array(16),n=new Array(256);for(let e=0;e<16;++e)n[e]="0"+e.toString(16);for(let e=16;e<256;++e)n[e]=e.toString(16);return function(){return e(t),t[6]=64|15&t[6],t[8]=128|63&t[8],n[t[0]]+n[t[1]]+n[t[2]]+n[t[3]]+"-"+n[t[4]]+n[t[5]]+"-"+n[t[6]]+n[t[7]]+"-"+n[t[8]]+n[t[9]]+"-"+n[t[10]]+n[t[11]]+n[t[12]]+n[t[13]]+n[t[14]]+n[t[15]]}}(e.Random.getRandomValues),e.MimeData=class{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(e){return-1!==this._types.indexOf(e)}getData(e){let t=this._types.indexOf(e);return-1!==t?this._values[t]:void 0}setData(e,t){this.clearData(e),this._types.push(e),this._values.push(t)}clearData(e){let t=this._types.indexOf(e);-1!==t&&(this._types.splice(t,1),this._values.splice(t,1))}clear(){this._types.length=0,this._values.length=0}},e.PluginRegistry=class{constructor(e={}){this._application=null,this._validatePlugin=()=>!0,this._plugins=new Map,this._services=new Map,e.validatePlugin&&(console.info("Plugins may be rejected by the custom validation plugin method."),this._validatePlugin=e.validatePlugin)}get application(){return this._application}set application(e){if(null!==this._application)throw Error("PluginRegistry.application is already set. It cannot be overridden.");this._application=e}get deferredPlugins(){return Array.from(this._plugins).filter((([e,t])=>"defer"===t.autoStart)).map((([e,t])=>e))}getPluginDescription(e){var t,n;return null!==(n=null===(t=this._plugins.get(e))||void 0===t?void 0:t.description)&&void 0!==n?n:""}hasPlugin(e){return this._plugins.has(e)}isPluginActivated(e){var t,n;return null!==(n=null===(t=this._plugins.get(e))||void 0===t?void 0:t.activated)&&void 0!==n&&n}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(e){if(this._plugins.has(e.id))throw new TypeError(`Plugin '${e.id}' is already registered.`);if(!this._validatePlugin(e))throw new Error(`Plugin '${e.id}' is not valid.`);const t=n.createPluginData(e);n.ensureNoCycle(t,this._plugins,this._services),t.provides&&this._services.set(t.provides,t.id),this._plugins.set(t.id,t)}registerPlugins(e){for(const t of e)this.registerPlugin(t)}deregisterPlugin(e,t){const n=this._plugins.get(e);if(n){if(n.activated&&!t)throw new Error(`Plugin '${e}' is still active.`);this._plugins.delete(e)}}async activatePlugin(e){const t=this._plugins.get(e);if(!t)throw new ReferenceError(`Plugin '${e}' is not registered.`);if(t.activated)return;if(t.promise)return t.promise;const n=t.requires.map((e=>this.resolveRequiredService(e))),i=t.optional.map((e=>this.resolveOptionalService(e)));return t.promise=Promise.all([...n,...i]).then((e=>t.activate.apply(void 0,[this.application,...e]))).then((e=>{t.service=e,t.activated=!0,t.promise=null})).catch((e=>{throw t.promise=null,e})),t.promise}async activatePlugins(e,t={}){switch(e){case"defer":{const e=this.deferredPlugins.filter((e=>this._plugins.get(e).autoStart)).map((e=>this.activatePlugin(e)));await Promise.all(e);break}case"startUp":{const e=n.collectStartupPlugins(this._plugins,t).map((async e=>{try{return await this.activatePlugin(e)}catch(t){console.error(`Plugin '${e}' failed to activate.`,t)}}));await Promise.all(e);break}}}async deactivatePlugin(e){const t=this._plugins.get(e);if(!t)throw new ReferenceError(`Plugin '${e}' is not registered.`);if(!t.activated)return[];if(!t.deactivate)throw new TypeError(`Plugin '${e}'#deactivate() method missing`);const i=n.findDependents(e,this._plugins,this._services),s=i.map((e=>this._plugins.get(e)));for(const t of s)if(!t.deactivate)throw new TypeError(`Plugin ${t.id}#deactivate() method missing (depends on ${e})`);for(const e of s){const t=[...e.requires,...e.optional].map((e=>{const t=this._services.get(e);return t?this._plugins.get(t).service:null}));await e.deactivate(this.application,...t),e.service=null,e.activated=!1}return i.pop(),i}async resolveRequiredService(e){const t=this._services.get(e);if(!t)throw new TypeError(`No provider for: ${e.name}.`);const n=this._plugins.get(t);return n.activated||await this.activatePlugin(t),n.service}async resolveOptionalService(e){const t=this._services.get(e);if(!t)return null;const n=this._plugins.get(t);if(!n.activated)try{await this.activatePlugin(t)}catch(e){return console.error(e),null}return n.service}},e.PromiseDelegate=class{constructor(){this.promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}resolve(e){(0,this._resolve)(e)}reject(e){(0,this._reject)(e)}},e.Token=class{constructor(e,t){this.name=e,this.description=null!=t?t:"",this._tokenStructuralPropertyT=null}}}(t,n(5102))},5102:(e,t,n)=>{"use strict";var i,s,r;function*o(...e){for(const t of e)yield*t}function*a(){}function*l(e,t=0){for(const n of e)yield[t++,n]}function*u(e,t){let n=0;for(const i of e)t(i,n++)&&(yield i)}function c(e,t){let n=0;for(const i of e)if(t(i,n++))return i}function d(e,t){let n=0;for(const i of e)if(t(i,n++))return n-1;return-1}function h(e,t){let n;for(const i of e)void 0!==n?t(i,n)<0&&(n=i):n=i;return n}function p(e,t){let n;for(const i of e)void 0!==n?t(i,n)>0&&(n=i):n=i;return n}function f(e,t){let n,i,s=!0;for(const r of e)s?(n=r,i=r,s=!1):t(r,n)<0?n=r:t(r,i)>0&&(i=r);return s?void 0:[n,i]}function m(e){return Array.from(e)}function g(e){const t={};for(const[n,i]of e)t[n]=i;return t}function v(e,t){let n=0;for(const i of e)if(!1===t(i,n++))return}function _(e,t){let n=0;for(const i of e)if(!1===t(i,n++))return!1;return!0}function y(e,t){let n=0;for(const i of e)if(t(i,n++))return!0;return!1}function*b(e,t){let n=0;for(const i of e)yield t(i,n++)}function*w(e,t,n){void 0===t?(t=e,e=0,n=1):void 0===n&&(n=1);const i=s.rangeLength(e,t,n);for(let t=0;t-1;t--)yield e[t]}function S(e){let t=[],n=new Set,i=new Map;for(const t of e)s(t);for(const[e]of i)r(e);return t;function s(e){let[t,n]=e,s=i.get(n);s?s.push(t):i.set(n,[t])}function r(e){if(n.has(e))return;n.add(e);let s=i.get(e);if(s)for(const e of s)r(e);t.push(e)}}function*M(e,t){let n=0;for(const i of e)0==n++%t&&(yield i)}function*A(e,t){if(t<1)return;const n=e[Symbol.iterator]();let i;for(;0e[Symbol.iterator]()));let n=t.map((e=>e.next()));for(;_(n,(e=>!e.done));n=t.map((e=>e.next())))yield n.map((e=>e.value))}n.r(t),n.d(t,{ArrayExt:()=>i,StringExt:()=>r,chain:()=>o,each:()=>v,empty:()=>a,enumerate:()=>l,every:()=>_,filter:()=>u,find:()=>c,findIndex:()=>d,map:()=>b,max:()=>p,min:()=>h,minmax:()=>f,once:()=>C,range:()=>w,reduce:()=>D,repeat:()=>x,retro:()=>E,some:()=>y,stride:()=>M,take:()=>A,toArray:()=>m,toObject:()=>g,topologicSort:()=>S,zip:()=>k}),function(e){function t(e,t,n=0,i=-1){let s,r=e.length;if(0===r)return-1;n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,s=o+i;n(e[s],t)<0?(o=s+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,s=-1){let r=e.length;if(0===r)return 0;let o=i=i<0?Math.max(0,i+r):Math.min(i,r-1),a=(s=s<0?Math.max(0,s+r):Math.min(s,r-1))-i+1;for(;a>0;){let i=a>>1,s=o+i;n(e[s],t)>0?a=i:(o=s+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i=o&&(n=s<0?o-1:o),void 0===i?i=s<0?-1:o:i<0?i=Math.max(i+o,s<0?-1:0):i>=o&&(i=s<0?o-1:o),r=s<0&&i>=n||s>0&&n>=i?0:s<0?Math.floor((i-n+1)/s+1):Math.floor((i-n-1)/s+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+s):Math.min(i,s-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;r(e,n,a-1),r(e,a,i),r(e,n,i)},e.fill=function(e,t,n=0,i=-1){let s,r=e.length;if(0!==r){n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,s=-1){let r=t(e,n,i,s);return-1!==r&&o(e,r),r},e.removeLastOf=function(e,t,i=-1,s=0){let r=n(e,t,i,s);return-1!==r&&o(e,r),r},e.removeAllOf=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r},e.removeFirstWhere=function(e,t,n=0,s=-1){let r,a=i(e,t,n,s);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeLastWhere=function(e,t,n=-1,i=0){let r,a=s(e,t,n,i);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeAllWhere=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r}}(i||(i={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(r||(r={}))},7556:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DisposableDelegate:()=>s,DisposableSet:()=>o,ObservableDisposableDelegate:()=>r,ObservableDisposableSet:()=>a});var i=n(8571);class s{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}}class r extends s{constructor(){super(...arguments),this._disposed=new i.Signal(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),i.Signal.clearData(this))}}class o{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach((e=>{e.dispose()})),this._items.clear())}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}}!function(e){e.from=function(t){let n=new e;for(const e of t)n.add(e);return n}}(o||(o={}));class a extends o{constructor(){super(...arguments),this._disposed=new i.Signal(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),i.Signal.clearData(this))}}!function(e){e.from=function(t){let n=new e;for(const e of t)n.add(e);return n}}(a||(a={}))},6049:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Debouncer:()=>l,Poll:()=>o,RateLimiter:()=>a,Throttler:()=>u});var i,s=n(5764),r=n(8571);class o{constructor(e){var t;this._disposed=new r.Signal(this),this._lingered=0,this._tick=new s.PromiseDelegate,this._ticked=new r.Signal(this),this._factory=e.factory,this._linger=null!==(t=e.linger)&&void 0!==t?t:i.DEFAULT_LINGER,this._standby=e.standby||i.DEFAULT_STANDBY,this._state={...i.DEFAULT_STATE,timestamp:(new Date).getTime()};const n=e.frequency||{},o=Math.max(n.interval||0,n.max||0,i.DEFAULT_FREQUENCY.max);this.frequency={...i.DEFAULT_FREQUENCY,...n,max:o},this.name=e.name||i.DEFAULT_NAME,"auto"in e&&!e.auto||setTimeout((()=>this.start()))}get disposed(){return this._disposed}get frequency(){return this._frequency}set frequency(e){if(this.isDisposed||s.JSONExt.deepEqual(e,this.frequency||{}))return;let{backoff:t,interval:n,max:i}=e;if(n=Math.round(n),i=Math.round(i),"number"==typeof t&&t<1)throw new Error("Poll backoff growth factor must be at least 1");if((n<0||n>i)&&n!==o.NEVER)throw new Error("Poll interval must be between 0 and max");if(i>o.MAX_INTERVAL&&i!==o.NEVER)throw new Error(`Max interval must be less than ${o.MAX_INTERVAL}`);this._frequency={backoff:t,interval:n,max:i}}get isDisposed(){return"disposed"===this.state.phase}get standby(){return this._standby}set standby(e){this.isDisposed||this.standby===e||(this._standby=e)}get state(){return this._state}get tick(){return this._tick.promise}get ticked(){return this._ticked}async*[Symbol.asyncIterator](){for(;!this.isDisposed;)yield this.state,await this.tick.catch((()=>{}))}dispose(){this.isDisposed||(this._state={...i.DISPOSED_STATE,timestamp:(new Date).getTime()},this._tick.promise.catch((e=>{})),this._tick.reject(new Error(`Poll (${this.name}) is disposed.`)),this._disposed.emit(void 0),r.Signal.clearData(this))}refresh(){return this.schedule({cancel:({phase:e})=>"refreshed"===e,interval:o.IMMEDIATE,phase:"refreshed"})}async schedule(e={}){if(this.isDisposed)return;if(e.cancel&&e.cancel(this.state))return;const t=this._tick,n=new s.PromiseDelegate,i={interval:this.frequency.interval,payload:null,phase:"standby",timestamp:(new Date).getTime(),...e};this._state=i,this._tick=n,clearTimeout(this._timeout),this._ticked.emit(this.state),t.resolve(this),await t.promise,i.interval!==o.NEVER?this._timeout=setTimeout((()=>{this.isDisposed||this.tick!==n.promise||this._execute()}),i.interval):this._timeout=void 0}start(){return this.schedule({cancel:({phase:e})=>"constructed"!==e&&"standby"!==e&&"stopped"!==e,interval:o.IMMEDIATE,phase:"started"})}stop(){return this.schedule({cancel:({phase:e})=>"stopped"===e,interval:o.NEVER,phase:"stopped"})}get hidden(){return i.hidden}_execute(){let e="function"==typeof this.standby?this.standby():this.standby;if("never"===e?e=!1:"when-hidden"===e&&(this.hidden?e=++this._lingered>this._linger:(this._lingered=0,e=!1)),e)return void this.schedule();const t=this.tick;this._factory(this.state).then((e=>{this.isDisposed||this.tick!==t||this.schedule({payload:e,phase:"rejected"===this.state.phase?"reconnected":"resolved"})})).catch((e=>{this.isDisposed||this.tick!==t||this.schedule({interval:i.sleep(this.frequency,this.state),payload:e,phase:"rejected"})}))}}!function(e){e.IMMEDIATE=0,e.MAX_INTERVAL=2147483647,e.NEVER=1/0}(o||(o={})),function(e){e.DEFAULT_BACKOFF=3,e.DEFAULT_FREQUENCY={backoff:!0,interval:1e3,max:3e4},e.DEFAULT_LINGER=1,e.DEFAULT_NAME="unknown",e.DEFAULT_STANDBY="when-hidden",e.DEFAULT_STATE={interval:o.NEVER,payload:null,phase:"constructed",timestamp:new Date(0).getTime()},e.DISPOSED_STATE={interval:o.NEVER,payload:null,phase:"disposed",timestamp:new Date(0).getTime()},e.sleep=function(t,n){const{backoff:i,interval:s,max:r}=t;if(s===o.NEVER)return s;const a=!0===i?e.DEFAULT_BACKOFF:!1===i?1:i,l=function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}(s,n.interval*a);return Math.min(r,l)},e.hidden="undefined"!=typeof document&&(document.addEventListener("visibilitychange",(()=>{e.hidden="hidden"===document.visibilityState})),document.addEventListener("pagehide",(()=>{e.hidden="hidden"===document.visibilityState})),"hidden"===document.visibilityState)}(i||(i={}));class a{constructor(e,t=500){this.args=void 0,this.payload=null,this.limit=t,this.poll=new o({auto:!1,factory:async()=>{const{args:t}=this;return this.args=void 0,e(...t)},frequency:{backoff:!1,interval:o.NEVER,max:o.NEVER},standby:"never"}),this.payload=new s.PromiseDelegate,this.poll.ticked.connect(((e,t)=>{const{payload:n}=this;return"resolved"===t.phase?(this.payload=new s.PromiseDelegate,void n.resolve(t.payload)):"rejected"===t.phase||"stopped"===t.phase?(this.payload=new s.PromiseDelegate,n.promise.catch((e=>{})),void n.reject(t.payload)):void 0}),this)}get isDisposed(){return null===this.payload}dispose(){this.isDisposed||(this.args=void 0,this.payload=null,this.poll.dispose())}async stop(){return this.poll.stop()}}class l extends a{invoke(...e){return this.args=e,this.poll.schedule({interval:this.limit,phase:"invoked"}),this.payload.promise}}class u extends a{constructor(e,t){super(e,"number"==typeof t?t:t&&t.limit),this._trailing=!1,"number"!=typeof t&&t&&"trailing"===t.edge&&(this._trailing=!0),this._interval=this._trailing?this.limit:o.IMMEDIATE}invoke(...e){const t="invoked"!==this.poll.state.phase;return(t||this._trailing)&&(this.args=e),t&&this.poll.schedule({interval:this._interval,phase:"invoked"}),this.payload.promise}}},6573:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AttachedProperty:()=>i});class i{constructor(e){this._pid=s.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}get(e){let t,n=s.ensureMap(e);return t=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e),t}set(e,t){let n,i=s.ensureMap(e);n=this._pid in i?i[this._pid]:i[this._pid]=this._createValue(e);let r=this._coerceValue(e,t);this._maybeNotify(e,n,i[this._pid]=r)}coerce(e){let t,n=s.ensureMap(e);t=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e);let i=this._coerceValue(e,t);this._maybeNotify(e,t,n[this._pid]=i)}_createValue(e){return(0,this._create)(e)}_coerceValue(e,t){let n=this._coerce;return n?n(e,t):t}_compareValue(e,t){let n=this._compare;return n?n(e,t):e===t}_maybeNotify(e,t,n){let i=this._changed;i&&!this._compareValue(t,n)&&i(e,t,n)}}var s;!function(e){e.clearData=function(e){s.ownerData.delete(e)}}(i||(i={})),function(e){e.ownerData=new WeakMap,e.nextPID=(()=>{let e=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${e++}`})(),e.ensureMap=function(t){let n=e.ownerData.get(t);return n||(n=Object.create(null),e.ownerData.set(t,n),n)}}(s||(s={}))},8571:(e,t,n)=>{"use strict";var i,s,r;n.r(t),n.d(t,{Signal:()=>l,Stream:()=>u}),function(e){function t(e,t,n=0,i=-1){let s,r=e.length;if(0===r)return-1;n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,s=o+i;n(e[s],t)<0?(o=s+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,s=-1){let r=e.length;if(0===r)return 0;let o=i=i<0?Math.max(0,i+r):Math.min(i,r-1),a=(s=s<0?Math.max(0,s+r):Math.min(s,r-1))-i+1;for(;a>0;){let i=a>>1,s=o+i;n(e[s],t)>0?a=i:(o=s+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i=o&&(n=s<0?o-1:o),void 0===i?i=s<0?-1:o:i<0?i=Math.max(i+o,s<0?-1:0):i>=o&&(i=s<0?o-1:o),r=s<0&&i>=n||s>0&&n>=i?0:s<0?Math.floor((i-n+1)/s+1):Math.floor((i-n-1)/s+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+s):Math.min(i,s-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;r(e,n,a-1),r(e,a,i),r(e,n,i)},e.fill=function(e,t,n=0,i=-1){let s,r=e.length;if(0!==r){n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,s=-1){let r=t(e,n,i,s);return-1!==r&&o(e,r),r},e.removeLastOf=function(e,t,i=-1,s=0){let r=n(e,t,i,s);return-1!==r&&o(e,r),r},e.removeAllOf=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r},e.removeFirstWhere=function(e,t,n=0,s=-1){let r,a=i(e,t,n,s);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeLastWhere=function(e,t,n=-1,i=0){let r,a=s(e,t,n,i);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeAllWhere=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r}}(i||(i={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(r||(r={}));var o,a=n(5764);class l{constructor(e){this.sender=e}connect(e,t){return o.connect(this,e,t)}disconnect(e,t){return o.disconnect(this,e,t)}emit(e){o.emit(this,e)}}!function(e){e.disconnectBetween=function(e,t){o.disconnectBetween(e,t)},e.disconnectSender=function(e){o.disconnectSender(e)},e.disconnectReceiver=function(e){o.disconnectReceiver(e)},e.disconnectAll=function(e){o.disconnectAll(e)},e.clearData=function(e){o.disconnectAll(e)},e.getExceptionHandler=function(){return o.exceptionHandler},e.setExceptionHandler=function(e){let t=o.exceptionHandler;return o.exceptionHandler=e,t}}(l||(l={}));class u extends l{constructor(){super(...arguments),this._pending=new a.PromiseDelegate}async*[Symbol.asyncIterator](){let e=this._pending;for(;;)try{const{args:t,next:n}=await e.promise;e=n,yield t}catch(e){return}}emit(e){const t=this._pending,n=this._pending=new a.PromiseDelegate;t.resolve({args:e,next:n}),super.emit(e)}stop(){this._pending.promise.catch((()=>{})),this._pending.reject("stop"),this._pending=new a.PromiseDelegate}}!function(e){function t(e){let t=s.get(e);if(t&&0!==t.length){for(const e of t){if(!e.signal)continue;let t=e.thisArg||e.slot;e.signal=null,c(r.get(t))}c(t)}}function n(e){let t=r.get(e);if(t&&0!==t.length){for(const e of t){if(!e.signal)continue;let t=e.signal.sender;e.signal=null,c(s.get(t))}c(t)}}e.exceptionHandler=e=>{console.error(e)},e.connect=function(e,t,n){n=n||void 0;let i=s.get(e.sender);if(i||(i=[],s.set(e.sender,i)),l(i,e,t,n))return!1;let o=n||t,a=r.get(o);a||(a=[],r.set(o,a));let u={signal:e,slot:t,thisArg:n};return i.push(u),a.push(u),!0},e.disconnect=function(e,t,n){n=n||void 0;let i=s.get(e.sender);if(!i||0===i.length)return!1;let o=l(i,e,t,n);if(!o)return!1;let a=n||t,u=r.get(a);return o.signal=null,c(i),c(u),!0},e.disconnectBetween=function(e,t){let n=s.get(e);if(!n||0===n.length)return;let i=r.get(t);if(i&&0!==i.length){for(const t of i)t.signal&&t.signal.sender===e&&(t.signal=null);c(n),c(i)}},e.disconnectSender=t,e.disconnectReceiver=n,e.disconnectAll=function(e){t(e),n(e)},e.emit=function(e,t){let n=s.get(e.sender);if(n&&0!==n.length)for(let i=0,s=n.length;i0?E:C)(e)},M=function(e,t){var n,i,s=String(function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}(e)),r=S(t),o=s.length;return r<0||r>=o?void 0:(n=s.charCodeAt(r))<55296||n>56319||r+1===o||(i=s.charCodeAt(r+1))<56320||i>57343?n:i-56320+(n-55296<<10)+65536};x(x.P,"String",{codePointAt:function(e){return M(this,e)}}),n.String.codePointAt;var A=Math.max,k=Math.min,F=String.fromCharCode,I=String.fromCodePoint;x(x.S+x.F*(!!I&&1!=I.length),"String",{fromCodePoint:function(e){for(var t,n=arguments,i=[],s=arguments.length,r=0;s>r;){if(t=+n[r++],a=1114111,((o=S(o=t))<0?A(o+a,0):k(o,a))!==t)throw RangeError(t+" is not a valid code point");i.push(t<65536?F(t):F(55296+((t-=65536)>>10),t%1024+56320))}var o,a;return i.join("")}}),n.String.fromCodePoint;var O,P,B,R,T,L,N,j,z,U,q,W,H,K,$={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA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\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\u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DC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B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0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\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uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\u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\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},V={isSpaceSeparator:function(e){return"string"==typeof e&&$.Space_Separator.test(e)},isIdStartChar:function(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||$.ID_Start.test(e))},isIdContinueChar:function(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||"‌"===e||"‍"===e||$.ID_Continue.test(e))},isDigit:function(e){return"string"==typeof e&&/[0-9]/.test(e)},isHexDigit:function(e){return"string"==typeof e&&/[0-9A-Fa-f]/.test(e)}};function J(e,t,n){var i=e[t];if(null!=i&&"object"==typeof i)if(Array.isArray(i))for(var s=0;s0;){var n=X();if(!V.isHexDigit(n))throw re(Y());e+=Y()}return String.fromCodePoint(parseInt(e,16))}var ne={start:function(){if("eof"===N.type)throw oe();ie()},beforePropertyName:function(){switch(N.type){case"identifier":case"string":return j=N.value,void(P="afterPropertyName");case"punctuator":return void se();case"eof":throw oe()}},afterPropertyName:function(){if("eof"===N.type)throw oe();P="beforePropertyValue"},beforePropertyValue:function(){if("eof"===N.type)throw oe();ie()},beforeArrayValue:function(){if("eof"===N.type)throw oe();"punctuator"!==N.type||"]"!==N.value?ie():se()},afterPropertyValue:function(){if("eof"===N.type)throw oe();switch(N.value){case",":return void(P="beforePropertyName");case"}":se()}},afterArrayValue:function(){if("eof"===N.type)throw oe();switch(N.value){case",":return void(P="beforeArrayValue");case"]":se()}},end:function(){}};function ie(){var e;switch(N.type){case"punctuator":switch(N.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=N.value}if(void 0===z)z=e;else{var t=B[B.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,j,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(null!==e&&"object"==typeof e)B.push(e),P=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{var n=B[B.length-1];P=null==n?"end":Array.isArray(n)?"afterArrayValue":"afterPropertyValue"}}function se(){B.pop();var e=B[B.length-1];P=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}function re(e){return ue(void 0===e?"JSON5: invalid end of input at "+T+":"+L:"JSON5: invalid character '"+le(e)+"' at "+T+":"+L)}function oe(){return ue("JSON5: invalid end of input at "+T+":"+L)}function ae(){return ue("JSON5: invalid identifier character at "+T+":"+(L-=5))}function le(e){var t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){var n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function ue(e){var t=new SyntaxError(e);return t.lineNumber=T,t.columnNumber=L,t}return{parse:function(e,t){O=String(e),P="start",B=[],R=0,T=1,L=0,N=void 0,j=void 0,z=void 0;do{N=G(),ne[P]()}while("eof"!==N.type);return"function"==typeof t?J({"":z},"",t):z},stringify:function(e,t,n){var i,s,r,o=[],a="",l="";if(null==t||"object"!=typeof t||Array.isArray(t)||(n=t.space,r=t.quote,t=t.replacer),"function"==typeof t)s=t;else if(Array.isArray(t)){i=[];for(var u=0,c=t;u0&&(n=Math.min(10,Math.floor(n)),l=" ".substr(0,n)):"string"==typeof n&&(l=n.substr(0,10)),p("",{"":e});function p(e,t){var n=t[e];switch(null!=n&&("function"==typeof n.toJSON5?n=n.toJSON5(e):"function"==typeof n.toJSON&&(n=n.toJSON(e))),s&&(n=s.call(t,e,n)),n instanceof Number?n=Number(n):n instanceof String?n=String(n):n instanceof Boolean&&(n=n.valueOf()),n){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof n?f(n):"number"==typeof n?String(n):"object"==typeof n?Array.isArray(n)?function(e){if(o.indexOf(e)>=0)throw TypeError("Converting circular structure to JSON5");o.push(e);var t=a;a+=l;for(var n,i=[],s=0;s=0)throw TypeError("Converting circular structure to JSON5");o.push(e);var t=a;a+=l;for(var n,s,r=[],u=0,c=i||Object.keys(e);u{e.exports=function e(t,n,i){function s(o,a){if(!n[o]){if(!t[o]){if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[o]={exports:{}};t[o][0].call(u.exports,(function(e){return s(t[o][1][e]||e)}),u,u.exports,e,t,n,i)}return n[o].exports}for(var r=void 0,o=0;o=43)}})).catch((function(){return!1}))}(e).then((function(e){return h=e}))}function y(e){var t=p[e.name],n={};n.promise=new o((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function b(e){var t=p[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function w(e,t){var n=p[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function D(e,t){return new o((function(n,i){if(p[e.name]=p[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return n(e.db);y(e),e.db.close()}var r=[e.name];t&&r.push(e.version);var o=s.open.apply(s,r);t&&(o.onupgradeneeded=function(t){var n=o.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(d)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),o.onerror=function(e){e.preventDefault(),i(o.error)},o.onsuccess=function(){var t=o.result;t.onversionchange=function(e){e.target.close()},n(t),b(e)}}))}function x(e){return D(e,!1)}function C(e){return D(e,!0)}function E(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),i=e.versione.db.version;if(i&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),s||n){if(n){var r=e.db.version+1;r>e.version&&(e.version=r)}return!0}return!1}function S(e){return r([v(atob(e.data))],{type:e.type})}function M(e){return e&&e.__local_forage_encoded_blob}function A(e){var t=this,n=t._initReady().then((function(){var e=p[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return l(n,e,e),n}function k(e,t,n,i){void 0===i&&(i=1);try{var s=e.db.transaction(e.storeName,t);n(null,s)}catch(s){if(i>0&&(!e.db||"InvalidStateError"===s.name||"NotFoundError"===s.name))return o.resolve().then((function(){if(!e.db||"NotFoundError"===s.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),C(e)})).then((function(){return function(e){y(e);for(var t=p[e.name],n=t.forages,i=0;i>4,c[l++]=(15&i)<<4|s>>2,c[l++]=(3&s)<<6|63&r;return u}function V(e){var t,n=new Uint8Array(e),i="";for(t=0;t>2],i+=I[(3&n[t])<<4|n[t+1]>>4],i+=I[(15&n[t+1])<<2|n[t+2]>>6],i+=I[63&n[t+2]];return n.length%3==2?i=i.substring(0,i.length-1)+"=":n.length%3==1&&(i=i.substring(0,i.length-2)+"=="),i}var J={serialize:function(e,t){var n="";if(e&&(n=K.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===K.call(e.buffer))){var i,s=P;e instanceof ArrayBuffer?(i=e,s+=B):(i=e.buffer,"[object Int8Array]"===n?s+=T:"[object Uint8Array]"===n?s+=L:"[object Uint8ClampedArray]"===n?s+=N:"[object Int16Array]"===n?s+=j:"[object Uint16Array]"===n?s+=U:"[object Int32Array]"===n?s+=z:"[object Uint32Array]"===n?s+=q:"[object Float32Array]"===n?s+=W:"[object Float64Array]"===n?s+=H:t(new Error("Failed to get type for BinaryArray"))),t(s+V(i))}else if("[object Blob]"===n){var r=new FileReader;r.onload=function(){var n="~~local_forage_type~"+e.type+"~"+V(this.result);t(P+R+n)},r.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if(e.substring(0,9)!==P)return JSON.parse(e);var t,n=e.substring(13),i=e.substring(9,13);if(i===R&&O.test(n)){var s=n.match(O);t=s[1],n=n.substring(s[0].length)}var o=$(n);switch(i){case B:return o;case R:return r([o],{type:t});case T:return new Int8Array(o);case L:return new Uint8Array(o);case N:return new Uint8ClampedArray(o);case j:return new Int16Array(o);case U:return new Uint16Array(o);case z:return new Int32Array(o);case q:return new Uint32Array(o);case W:return new Float32Array(o);case H:return new Float64Array(o);default:throw new Error("Unkown type: "+i)}},stringToBuffer:$,bufferToString:V};function G(e,t,n,i){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,i)}function X(e,t,n,i,s,r){e.executeSql(n,i,s,(function(e,o){o.code===o.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,a){a.rows.length?r(e,o):G(e,t,(function(){e.executeSql(n,i,s,r)}),r)}),r):r(e,o)}),r)}function Y(e,t,n,i){var s=this;e=u(e);var r=new o((function(r,o){s.ready().then((function(){void 0===t&&(t=null);var a=t,l=s._dbInfo;l.serializer.serialize(t,(function(t,u){u?o(u):l.db.transaction((function(n){X(n,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){r(a)}),(function(e,t){o(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(i>0)return void r(Y.apply(s,[e,a,n,i-1]));o(t)}}))}))})).catch(o)}));return a(r,n),r}var Z={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var i in e)n[i]="string"!=typeof e[i]?e[i].toString():e[i];var s=new o((function(e,i){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return i(e)}n.db.transaction((function(s){G(s,n,(function(){t._dbInfo=n,e()}),(function(e,t){i(t)}))}),i)}));return n.serializer=J,s},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,i=new o((function(t,i){n.ready().then((function(){var s=n._dbInfo;s.db.transaction((function(n){X(n,s,"SELECT * FROM "+s.storeName,[],(function(n,i){for(var r=i.rows,o=r.length,a=0;a '__WebKitDatabaseInfoTable__'",[],(function(n,i){for(var s=[],r=0;r0}var te={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var n in e)t[n]=e[n];return t.keyPrefix=Q(e,this._defaultConfig),ee()?(this._dbInfo=t,t.serializer=J,o.resolve()):o.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var n=this,i=n.ready().then((function(){for(var t=n._dbInfo,i=t.keyPrefix,s=i.length,r=localStorage.length,o=1,a=0;a=0;n--){var i=localStorage.key(n);0===i.indexOf(e)&&localStorage.removeItem(i)}}));return a(n,e),n},length:function(e){var t=this.keys().then((function(e){return e.length}));return a(t,e),t},key:function(e,t){var n=this,i=n.ready().then((function(){var t,i=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(i.keyPrefix.length)),t}));return a(i,t),i},keys:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,i=[],s=0;s=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):o.reject("Invalid arguments"),a(i,t),i}},ne=function(e,t){for(var n=e.length,i=0;i{"use strict";function t(){this._types=Object.create(null),this._extensions=Object.create(null);for(let e=0;e{"use strict";let i=n(7488);e.exports=new i(n(679),n(310))},310:e=>{e.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},679:e=>{e.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},9600:e=>{"use strict";function t(e){return"number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function n(e,t){return"constructor"===t&&"function"==typeof e[t]||"__proto__"===t}e.exports=function(e,i){i||(i={});var s={bools:{},strings:{},unknownFn:null};"function"==typeof i.unknown&&(s.unknownFn=i.unknown),"boolean"==typeof i.boolean&&i.boolean?s.allBools=!0:[].concat(i.boolean).filter(Boolean).forEach((function(e){s.bools[e]=!0}));var r={};function o(e){return r[e].some((function(e){return s.bools[e]}))}Object.keys(i.alias||{}).forEach((function(e){r[e]=[].concat(i.alias[e]),r[e].forEach((function(t){r[t]=[e].concat(r[e].filter((function(e){return t!==e})))}))})),[].concat(i.string).filter(Boolean).forEach((function(e){s.strings[e]=!0,r[e]&&[].concat(r[e]).forEach((function(e){s.strings[e]=!0}))}));var a=i.default||{},l={_:[]};function u(e,t,i){for(var r=e,o=0;o=2&&(n=n.slice(2)):v(s)?n=i[4]:s?r&&(n=n.slice(2)):a>=2&&v(t.protocol)&&(n=i[4]),{protocol:s,slashes:r||v(s),slashesCount:a,rest:n}}function y(e,t,n){if(e=(e=p(e)).replace(l,""),!(this instanceof y))return new y(e,t,n);var s,r,o,u,c,h,m=f.slice(),b=typeof t,w=this,D=0;for("object"!==b&&"string"!==b&&(n=t,t=null),n&&"function"!=typeof n&&(n=a.parse),s=!(r=_(e||"",t=g(t))).protocol&&!r.slashes,w.slashes=r.slashes||s&&t.slashes,w.protocol=r.protocol||t.protocol||"",e=r.rest,("file:"===r.protocol&&(2!==r.slashesCount||d.test(e))||!r.slashes&&(r.protocol||r.slashesCount<2||!v(w.protocol)))&&(m[3]=[/(.*)/,"pathname"]);D=0?e.slice(0,t):e}C.prototype.addEventListener=function(e,t){"function"==typeof t&&(Array.isArray(this.listeners[e])||(this.listeners[e]=[]),0===function(e,t){void 0===e&&(e=[]);var n=[];return e.forEach((function(e){t(e)&&n.push(e)})),n}(this.listeners[e],(function(e){return e===t})).length&&this.listeners[e].push(t))},C.prototype.removeEventListener=function(e,t){var n=this.listeners[e];this.listeners[e]=x(n,(function(e){return e===t}))},C.prototype.dispatchEvent=function(e){for(var t=this,n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];var s=e.type,r=this.listeners[s];return!!Array.isArray(r)&&(r.forEach((function(i){n.length>0?i.apply(t,n):i.call(t,e)})),!0)};var S=function(){this.urlMap={}};S.prototype.attachWebSocket=function(e,t){var n=E(t),i=this.urlMap[n];if(i&&i.server&&-1===i.websockets.indexOf(e))return i.websockets.push(e),i.server},S.prototype.addMembershipToRoom=function(e,t){var n=this.urlMap[E(e.url)];n&&n.server&&-1!==n.websockets.indexOf(e)&&(n.roomMemberships[t]||(n.roomMemberships[t]=[]),n.roomMemberships[t].push(e))},S.prototype.attachServer=function(e,t){var n=E(t);if(!this.urlMap[n])return this.urlMap[n]={server:e,websockets:[],roomMemberships:{}},e},S.prototype.serverLookup=function(e){var t=E(e),n=this.urlMap[t];if(n)return n.server},S.prototype.websocketsLookup=function(e,t,n){var i,s=E(e),r=this.urlMap[s];return i=r?r.websockets:[],t&&(i=r.roomMemberships[t]||[]),n?i.filter((function(e){return e!==n})):i},S.prototype.removeServer=function(e){delete this.urlMap[E(e)]},S.prototype.removeWebSocket=function(e,t){var n=E(t),i=this.urlMap[n];i&&(i.websockets=x(i.websockets,(function(t){return t===e})))},S.prototype.removeMembershipFromRoom=function(e,t){var n=this.urlMap[E(e.url)],i=n.roomMemberships[t];n&&null!==i&&(n.roomMemberships[t]=x(i,(function(t){return t===e})))};var M=new S,A={CLOSE_NORMAL:1e3,CLOSE_GOING_AWAY:1001,CLOSE_PROTOCOL_ERROR:1002,CLOSE_UNSUPPORTED:1003,CLOSE_NO_STATUS:1005,CLOSE_ABNORMAL:1006,UNSUPPORTED_DATA:1007,POLICY_VIOLATION:1008,CLOSE_TOO_LARGE:1009,MISSING_EXTENSION:1010,INTERNAL_ERROR:1011,SERVICE_RESTART:1012,TRY_AGAIN_LATER:1013,TLS_HANDSHAKE:1015},k={CONSTRUCTOR_ERROR:"Failed to construct 'WebSocket':",CLOSE_ERROR:"Failed to execute 'close' on 'WebSocket':",EVENT:{CONSTRUCT:"Failed to construct 'Event':",MESSAGE:"Failed to construct 'MessageEvent':",CLOSE:"Failed to construct 'CloseEvent':"}},F=function(){};F.prototype.stopPropagation=function(){},F.prototype.stopImmediatePropagation=function(){},F.prototype.initEvent=function(e,t,n){void 0===e&&(e="undefined"),void 0===t&&(t=!1),void 0===n&&(n=!1),this.type=""+e,this.bubbles=Boolean(t),this.cancelable=Boolean(n)};var I=function(e){function t(t,n){if(void 0===n&&(n={}),e.call(this),!t)throw new TypeError(k.EVENT_ERROR+" 1 argument required, but only 0 present.");if("object"!=typeof n)throw new TypeError(k.EVENT_ERROR+" parameter 2 ('eventInitDict') is not an object.");var i=n.bubbles,s=n.cancelable;this.type=""+t,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=!!s&&Boolean(s),this.cancelBubble=!1,this.bubbles=!!i&&Boolean(i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(F),O=function(e){function t(t,n){if(void 0===n&&(n={}),e.call(this),!t)throw new TypeError(k.EVENT.MESSAGE+" 1 argument required, but only 0 present.");if("object"!=typeof n)throw new TypeError(k.EVENT.MESSAGE+" parameter 2 ('eventInitDict') is not an object");var i=n.bubbles,s=n.cancelable,r=n.data,o=n.origin,a=n.lastEventId,l=n.ports;this.type=""+t,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=!!s&&Boolean(s),this.canncelBubble=!1,this.bubbles=!!i&&Boolean(i),this.origin=""+o,this.ports=void 0===l?null:l,this.data=void 0===r?null:r,this.lastEventId=""+(a||"")}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(F),P=function(e){function t(t,n){if(void 0===n&&(n={}),e.call(this),!t)throw new TypeError(k.EVENT.CLOSE+" 1 argument required, but only 0 present.");if("object"!=typeof n)throw new TypeError(k.EVENT.CLOSE+" parameter 2 ('eventInitDict') is not an object");var i=n.bubbles,s=n.cancelable,r=n.code,o=n.reason,a=n.wasClean;this.type=""+t,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=!!s&&Boolean(s),this.cancelBubble=!1,this.bubbles=!!i&&Boolean(i),this.code="number"==typeof r?parseInt(r,10):0,this.reason=""+(o||""),this.wasClean=!!a&&Boolean(a)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(F);function B(e){var t=e.type,n=e.target,i=new I(t);return n&&(i.target=n,i.srcElement=n,i.currentTarget=n),i}function R(e){var t=e.type,n=e.origin,i=e.data,s=e.target,r=new O(t,{data:i,origin:n});return s&&(r.target=s,r.srcElement=s,r.currentTarget=s),r}function T(e){var t=e.code,n=e.reason,i=e.type,s=e.target,r=e.wasClean;r||(r=t===A.CLOSE_NORMAL||t===A.CLOSE_NO_STATUS);var o=new P(i,{code:t,reason:n,wasClean:r});return s&&(o.target=s,o.srcElement=s,o.currentTarget=s),o}function L(e,t,n){e.readyState=U.CLOSING;var i=M.serverLookup(e.url),s=T({type:"close",target:e.target,code:t,reason:n});w((function(){M.removeWebSocket(e,e.url),e.readyState=U.CLOSED,e.dispatchEvent(s),i&&i.dispatchEvent(s,i)}),e)}function N(e){return"[object Blob]"===Object.prototype.toString.call(e)||e instanceof ArrayBuffer||(e=String(e)),e}var j=new WeakMap;function z(e){if(j.has(e))return j.get(e);var t=new Proxy(e,{get:function(n,i){if("close"===i)return function(e){void 0===e&&(e={});var n=e.code||A.CLOSE_NORMAL,i=e.reason||"";L(t,n,i)};if("send"===i)return function(t){t=N(t),e.dispatchEvent(R({type:"message",data:t,origin:this.url,target:e}))};var s=function(e){return"message"===e?"server::"+e:e};return"on"===i?function(t,n){e.addEventListener(s(t),n)}:"off"===i?function(t,n){e.removeEventListener(s(t),n)}:"target"===i?e:n[i]}});return j.set(e,t),t}var U=function(e){function t(n,i){e.call(this),this._onopen=null,this._onmessage=null,this._onerror=null,this._onclose=null,this.url=function(e){var t=new b(e),n=t.pathname,i=t.protocol,s=t.hash;if(!e)throw new TypeError(k.CONSTRUCTOR_ERROR+" 1 argument required, but only 0 present.");if(n||(t.pathname="/"),""===i)throw new SyntaxError(k.CONSTRUCTOR_ERROR+" The URL '"+t.toString()+"' is invalid.");if("ws:"!==i&&"wss:"!==i)throw new SyntaxError(k.CONSTRUCTOR_ERROR+" The URL's scheme must be either 'ws' or 'wss'. '"+i+"' is not allowed.");if(""!==s)throw new SyntaxError(k.CONSTRUCTOR_ERROR+" The URL contains a fragment identifier ('"+s+"'). Fragment identifiers are not allowed in WebSocket URLs.");return t.toString()}(n),i=function(e){if(void 0===e&&(e=[]),!Array.isArray(e)&&"string"!=typeof e)throw new SyntaxError(k.CONSTRUCTOR_ERROR+" The subprotocol '"+e.toString()+"' is invalid.");"string"==typeof e&&(e=[e]);var t=e.map((function(e){return{count:1,protocol:e}})).reduce((function(e,t){return e[t.protocol]=(e[t.protocol]||0)+t.count,e}),{}),n=Object.keys(t).filter((function(e){return t[e]>1}));if(n.length>0)throw new SyntaxError(k.CONSTRUCTOR_ERROR+" The subprotocol '"+n[0]+"' is duplicated.");return e}(i),this.protocol=i[0]||"",this.binaryType="blob",this.readyState=t.CONNECTING;var s=z(this),r=M.attachWebSocket(s,this.url);w((function(){if(this.readyState===t.CONNECTING)if(r)if(r.options.verifyClient&&"function"==typeof r.options.verifyClient&&!r.options.verifyClient())this.readyState=t.CLOSED,D("error","WebSocket connection to '"+this.url+"' failed: HTTP Authentication failed; no valid credentials available"),M.removeWebSocket(s,this.url),this.dispatchEvent(B({type:"error",target:this})),this.dispatchEvent(T({type:"close",target:this,code:A.CLOSE_NORMAL}));else{if(r.options.selectProtocol&&"function"==typeof r.options.selectProtocol){var e=r.options.selectProtocol(i),n=""!==e,o=-1!==i.indexOf(e);if(n&&!o)return this.readyState=t.CLOSED,D("error","WebSocket connection to '"+this.url+"' failed: Invalid Sub-Protocol"),M.removeWebSocket(s,this.url),this.dispatchEvent(B({type:"error",target:this})),void this.dispatchEvent(T({type:"close",target:this,code:A.CLOSE_NORMAL}));this.protocol=e}this.readyState=t.OPEN,this.dispatchEvent(B({type:"open",target:this})),r.dispatchEvent(B({type:"connection"}),s)}else this.readyState=t.CLOSED,this.dispatchEvent(B({type:"error",target:this})),this.dispatchEvent(T({type:"close",target:this,code:A.CLOSE_NORMAL})),D("error","WebSocket connection to '"+this.url+"' failed")}),this)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={onopen:{},onmessage:{},onclose:{},onerror:{}};return n.onopen.get=function(){return this._onopen},n.onmessage.get=function(){return this._onmessage},n.onclose.get=function(){return this._onclose},n.onerror.get=function(){return this._onerror},n.onopen.set=function(e){this.removeEventListener("open",this._onopen),this._onopen=e,this.addEventListener("open",e)},n.onmessage.set=function(e){this.removeEventListener("message",this._onmessage),this._onmessage=e,this.addEventListener("message",e)},n.onclose.set=function(e){this.removeEventListener("close",this._onclose),this._onclose=e,this.addEventListener("close",e)},n.onerror.set=function(e){this.removeEventListener("error",this._onerror),this._onerror=e,this.addEventListener("error",e)},t.prototype.send=function(e){var n=this;if(this.readyState===t.CONNECTING)throw new Error("Failed to execute 'send' on 'WebSocket': Still in CONNECTING state");var i=R({type:"server::message",origin:this.url,data:N(e)}),s=M.serverLookup(this.url);s&&w((function(){n.dispatchEvent(i,e)}),s)},t.prototype.close=function(e,n){if(void 0!==e&&("number"!=typeof e||1e3!==e&&(e<3e3||e>4999)))throw new TypeError(k.CLOSE_ERROR+" The code must be either 1000, or between 3000 and 4999. "+e+" is neither.");if(void 0!==n&&(i=n,s=encodeURIComponent(i).match(/%[89ABab]/g),i.length+(s?s.length:0)>123))throw new SyntaxError(k.CLOSE_ERROR+" The message must not be greater than 123 bytes.");var i,s;if(this.readyState!==t.CLOSING&&this.readyState!==t.CLOSED){var r=z(this);this.readyState===t.CONNECTING?function(e,t,n){e.readyState=U.CLOSING;var i=M.serverLookup(e.url),s=T({type:"close",target:e.target,code:t,reason:n,wasClean:!1}),r=B({type:"error",target:e.target});w((function(){M.removeWebSocket(e,e.url),e.readyState=U.CLOSED,e.dispatchEvent(r),e.dispatchEvent(s),i&&i.dispatchEvent(s,i)}),e)}(r,e||A.CLOSE_ABNORMAL,n):L(r,e||A.CLOSE_NO_STATUS,n)}},Object.defineProperties(t.prototype,n),t}(C);U.CONNECTING=0,U.prototype.CONNECTING=U.CONNECTING,U.OPEN=1,U.prototype.OPEN=U.OPEN,U.CLOSING=2,U.prototype.CLOSING=U.CLOSING,U.CLOSED=3,U.prototype.CLOSED=U.CLOSED;var q=function(e){function t(n,i){var s=this;void 0===n&&(n="socket.io"),void 0===i&&(i=""),e.call(this),this.binaryType="blob";var r=new b(n);r.pathname||(r.pathname="/"),this.url=r.toString(),this.readyState=t.CONNECTING,this.protocol="",this.target=this,"string"==typeof i||"object"==typeof i&&null!==i?this.protocol=i:Array.isArray(i)&&i.length>0&&(this.protocol=i[0]);var o=M.attachWebSocket(this,this.url);w((function(){o?(this.readyState=t.OPEN,o.dispatchEvent(B({type:"connection"}),o,this),o.dispatchEvent(B({type:"connect"}),o,this),this.dispatchEvent(B({type:"connect",target:this}))):(this.readyState=t.CLOSED,this.dispatchEvent(B({type:"error",target:this})),this.dispatchEvent(T({type:"close",target:this,code:A.CLOSE_NORMAL})),D("error","Socket.io connection to '"+this.url+"' failed"))}),this),this.addEventListener("close",(function(e){s.dispatchEvent(T({type:"disconnect",target:e.target,code:e.code}))}))}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={broadcast:{}};return t.prototype.close=function(){if(this.readyState===t.OPEN){var e=M.serverLookup(this.url);return M.removeWebSocket(this,this.url),this.readyState=t.CLOSED,this.dispatchEvent(T({type:"close",target:this,code:A.CLOSE_NORMAL})),e&&e.dispatchEvent(T({type:"disconnect",target:this,code:A.CLOSE_NORMAL}),e),this}},t.prototype.disconnect=function(){return this.close()},t.prototype.emit=function(e){for(var n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];if(this.readyState!==t.OPEN)throw new Error("SocketIO is already in CLOSING or CLOSED state");var s=R({type:e,origin:this.url,data:n}),r=M.serverLookup(this.url);return r&&r.dispatchEvent.apply(r,[s].concat(n)),this},t.prototype.send=function(e){return this.emit("message",e),this},n.broadcast.get=function(){if(this.readyState!==t.OPEN)throw new Error("SocketIO is already in CLOSING or CLOSED state");var e=this,n=M.serverLookup(this.url);if(!n)throw new Error("SocketIO can not find a server at the specified URL ("+this.url+")");return{emit:function(t,i){return n.emit(t,i,{websockets:M.websocketsLookup(e.url,null,e)}),e},to:function(t){return n.to(t,e)},in:function(t){return n.in(t,e)}}},t.prototype.on=function(e,t){return this.addEventListener(e,t),this},t.prototype.off=function(e,t){this.removeEventListener(e,t)},t.prototype.hasListeners=function(e){var t=this.listeners[e];return!!Array.isArray(t)&&!!t.length},t.prototype.join=function(e){M.addMembershipToRoom(this,e)},t.prototype.leave=function(e){M.removeMembershipFromRoom(this,e)},t.prototype.to=function(e){return this.broadcast.to(e)},t.prototype.in=function(){return this.to.apply(null,arguments)},t.prototype.dispatchEvent=function(e){for(var t=this,n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];var s=e.type,r=this.listeners[s];if(!Array.isArray(r))return!1;r.forEach((function(i){n.length>0?i.apply(t,n):i.call(t,e.data?e.data:e)}))},Object.defineProperties(t.prototype,n),t}(C);q.CONNECTING=0,q.OPEN=1,q.CLOSING=2,q.CLOSED=3;var W=function(e,t){return new q(e,t)};W.connect=function(e,t){return W(e,t)};function H(){return"undefined"!=typeof window?window:"object"==typeof process&&"object"==typeof n.g?n.g:this}var K={mock:!0,verifyClient:null,selectProtocol:null},$=function(e){function t(t,n){void 0===n&&(n=K),e.call(this);var i=new b(t);if(i.pathname||(i.pathname="/"),this.url=i.toString(),this.originalWebSocket=null,!M.attachServer(this,this.url))throw this.dispatchEvent(B({type:"error"})),new Error("A mock server is already listening on this url");this.options=Object.assign({},K,n),this.options.mock&&this.mockWebsocket()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.mockWebsocket=function(){var e=H();this.originalWebSocket=e.WebSocket,e.WebSocket=U},t.prototype.restoreWebsocket=function(){var e=H();null!==this.originalWebSocket&&(e.WebSocket=this.originalWebSocket),this.originalWebSocket=null},t.prototype.stop=function(e){void 0===e&&(e=function(){}),this.options.mock&&this.restoreWebsocket(),M.removeServer(this.url),"function"==typeof e&&e()},t.prototype.on=function(e,t){this.addEventListener(e,t)},t.prototype.off=function(e,t){this.removeEventListener(e,t)},t.prototype.close=function(e){void 0===e&&(e={});var t=e.code,n=e.reason,i=e.wasClean,s=M.websocketsLookup(this.url);M.removeServer(this.url),s.forEach((function(e){e.readyState=U.CLOSED,e.dispatchEvent(T({type:"close",target:e.target,code:t||A.CLOSE_NORMAL,reason:n||"",wasClean:i}))})),this.dispatchEvent(T({type:"close"}),this)},t.prototype.emit=function(e,t,n){var i=this;void 0===n&&(n={});var s,r=n.websockets;r||(r=M.websocketsLookup(this.url)),"object"!=typeof n||arguments.length>3?(t=Array.prototype.slice.call(arguments,1,arguments.length),s=t.map((function(e){return N(e)}))):s=N(t),r.forEach((function(n){var r=n instanceof q?t:s;Array.isArray(r)?n.dispatchEvent.apply(n,[R({type:e,data:r,origin:i.url,target:n.target})].concat(r)):n.dispatchEvent(R({type:e,data:r,origin:i.url,target:n.target}))}))},t.prototype.clients=function(){return M.websocketsLookup(this.url)},t.prototype.to=function(e,t,n){var i=this;void 0===n&&(n=[]);var s=this,r=n.concat(M.websocketsLookup(this.url,e,t)).reduce((function(e,t){return e.indexOf(t)>-1?e:e.concat(t)}),[]);return{to:function(e,t){return i.to.call(i,e,t,r)},emit:function(e,t){s.emit(e,t,{websockets:r})}}},t.prototype.in=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return this.to.apply(null,e)},t.prototype.simulate=function(e){var t=M.websocketsLookup(this.url);"error"===e&&t.forEach((function(e){e.readyState=U.CLOSED,e.dispatchEvent(B({type:"error",target:e.target}))}))},t}(C);$.of=function(e){return new $(e)};var V=$,J=U,G=W;e.Server=V,e.WebSocket=J,e.SocketIO=G,Object.defineProperty(e,"__esModule",{value:!0})}(t)},9942:e=>{"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,i="",s=0,r=-1,o=0,a=0;a<=e.length;++a){if(a2){var l=i.lastIndexOf("/");if(l!==i.length-1){-1===l?(i="",s=0):s=(i=i.slice(0,l)).length-1-i.lastIndexOf("/"),r=a,o=0;continue}}else if(2===i.length||1===i.length){i="",s=0,r=a,o=0;continue}t&&(i.length>0?i+="/..":i="..",s=2)}else i.length>0?i+="/"+e.slice(r+1,a):i=e.slice(r+1,a),s=a-r-1;r=a,o=0}else 46===n&&-1!==o?++o:o=-1}return i}var i={resolve:function(){for(var e,i="",s=!1,r=arguments.length-1;r>=-1&&!s;r--){var o;r>=0?o=arguments[r]:(void 0===e&&(e=process.cwd()),o=e),t(o),0!==o.length&&(i=o+"/"+i,s=47===o.charCodeAt(0))}return i=n(i,!s),s?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var i=47===e.charCodeAt(0),s=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!i)).length||i||(e="."),e.length>0&&s&&(e+="/"),i?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=s:e+="/"+s)}return void 0===e?".":i.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=i.resolve(e))===(n=i.resolve(n)))return"";for(var s=1;su){if(47===n.charCodeAt(a+d))return n.slice(a+d+1);if(0===d)return n.slice(a+d)}else o>u&&(47===e.charCodeAt(s+d)?c=d:0===d&&(c=0));break}var h=e.charCodeAt(s+d);if(h!==n.charCodeAt(a+d))break;47===h&&(c=d)}var p="";for(d=s+c+1;d<=r;++d)d!==r&&47!==e.charCodeAt(d)||(0===p.length?p+="..":p+="/..");return p.length>0?p+n.slice(a+c):(a+=c,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),i=47===n,s=-1,r=!0,o=e.length-1;o>=1;--o)if(47===(n=e.charCodeAt(o))){if(!r){s=o;break}}else r=!1;return-1===s?i?"/":".":i&&1===s?"//":e.slice(0,s)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var i,s=0,r=-1,o=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,l=-1;for(i=e.length-1;i>=0;--i){var u=e.charCodeAt(i);if(47===u){if(!o){s=i+1;break}}else-1===l&&(o=!1,l=i+1),a>=0&&(u===n.charCodeAt(a)?-1==--a&&(r=i):(a=-1,r=l))}return s===r?r=l:-1===r&&(r=e.length),e.slice(s,r)}for(i=e.length-1;i>=0;--i)if(47===e.charCodeAt(i)){if(!o){s=i+1;break}}else-1===r&&(o=!1,r=i+1);return-1===r?"":e.slice(s,r)},extname:function(e){t(e);for(var n=-1,i=0,s=-1,r=!0,o=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===s&&(r=!1,s=a+1),46===l?-1===n?n=a:1!==o&&(o=1):-1!==n&&(o=-1);else if(!r){i=a+1;break}}return-1===n||-1===s||0===o||1===o&&n===s-1&&n===i+1?"":e.slice(n,s)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+i:n+"/"+i:i}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var i,s=e.charCodeAt(0),r=47===s;r?(n.root="/",i=1):i=0;for(var o=-1,a=0,l=-1,u=!0,c=e.length-1,d=0;c>=i;--c)if(47!==(s=e.charCodeAt(c)))-1===l&&(u=!1,l=c+1),46===s?-1===o?o=c:1!==d&&(d=1):-1!==o&&(d=-1);else if(!u){a=c+1;break}return-1===o||-1===l||0===d||1===d&&o===l-1&&o===a+1?-1!==l&&(n.base=n.name=0===a&&r?e.slice(1,l):e.slice(a,l)):(0===a&&r?(n.name=e.slice(1,o),n.base=e.slice(1,l)):(n.name=e.slice(a,o),n.base=e.slice(a,l)),n.ext=e.slice(o,l)),a>0?n.dir=e.slice(0,a-1):r&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,e.exports=i},1359:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function i(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function s(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var i,r,o=[];for(r in"string"!=typeof t&&(t="?"),e)if(n.call(e,r)){if((i=e[r])||null!=i&&!isNaN(i)||(i=""),r=s(r),i=s(i),null===r||null===i)continue;o.push(r+"="+i)}return o.length?t+o.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,s={};t=n.exec(e);){var r=i(t[1]),o=i(t[2]);null===r||null===o||r in s||(s[r]=o)}return s}},3062:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},7783:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupThebeLite=t.startJupyterLiteServer=void 0;const i=n(5478),s=n(1189);function r(){var e;window.thebeLite=Object.assign(null!==(e=window.thebeLite)&&void 0!==e?e:{},{startJupyterLiteServer:s.startJupyterLiteServer})}Object.defineProperty(t,"startJupyterLiteServer",{enumerable:!0,get:function(){return s.startJupyterLiteServer}}),t.setupThebeLite=r,"undefined"!=typeof window&&(console.debug("window is defined, setting up thebe-lite"),r(),console.debug("window.thebeLite",window.thebeLite)),i.__exportStar(n(2018),t)},1189:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startJupyterLiteServer=void 0;const i=n(5478),s=n(8925),r=n(2964),o=[Promise.resolve().then((()=>i.__importStar(n(7070))))];function*a(e){let t;t=Object.prototype.hasOwnProperty.call(e,"__esModule")?e.default:e;const n=Array.isArray(t)?t:[t];for(const e of n)yield e}t.startJupyterLiteServer=function(e){return i.__awaiter(this,void 0,void 0,(function*(){s.PageConfig.getOption(""),(null==e?void 0:e.litePluginSettings)&&s.PageConfig.setOption("litePluginSettings",JSON.stringify(e.litePluginSettings));const t=[];(yield Promise.all(o)).forEach((e=>{for(const n of a(e))t.push(n)}));const l=[Promise.resolve().then((()=>i.__importStar(n(2015))))];[].forEach((e=>{e.liteExtension&&l.push(function(e,t){return i.__awaiter(this,void 0,void 0,(function*(){try{return(yield window._JUPYTERLAB[e].get(t))()}catch(n){throw console.warn(`Failed to create module: package: ${e}; module: ${t}`),n}}))}(e.name,e.extension))})),(yield Promise.allSettled(l)).forEach((e=>{if("fulfilled"===e.status)for(const n of a(e.value))t.push(n);else console.error(e.reason)}));const u=new r.JupyterLiteServer({});u.registerPluginModules(t),yield u.start();const{serviceManager:c}=u;return yield c.ready,c}))}},2018:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5478:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__assign:()=>r,__asyncDelegator:()=>b,__asyncGenerator:()=>y,__asyncValues:()=>w,__await:()=>_,__awaiter:()=>c,__classPrivateFieldGet:()=>E,__classPrivateFieldSet:()=>S,__createBinding:()=>h,__decorate:()=>a,__exportStar:()=>p,__extends:()=>s,__generator:()=>d,__importDefault:()=>C,__importStar:()=>x,__makeTemplateObject:()=>D,__metadata:()=>u,__param:()=>l,__read:()=>m,__rest:()=>o,__spread:()=>g,__spreadArrays:()=>v,__values:()=>f});var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},i(e,t)};function s(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function l(e,t){return function(n,i){t(n,i,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,n,i){return new(n||(n=Promise))((function(s,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))}function d(e,t){var n,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,s,r=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(e){s={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function g(){for(var e=[],t=0;t1||a(e,t)}))})}function a(e,t){try{(n=s[e](t)).value instanceof _?Promise.resolve(n.value.v).then(l,u):c(r[0][2],n)}catch(e){c(r[0][3],e)}var n}function l(e){a("next",e)}function u(e){a("throw",e)}function c(e,t){e(t),r.shift(),r.length&&a(r[0][0],r[0][1])}}function b(e){var t,n;return t={},i("next"),i("throw",(function(e){throw e})),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,s){t[i]=e[i]?function(t){return(n=!n)?{value:_(e[i](t)),done:"return"===i}:s?s(t):t}:s}}function w(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=f(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,s){!function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)}(i,s,(t=e[n](t)).done,t.value)}))}}}function D(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function C(e){return e&&e.__esModule?e:{default:e}}function E(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function S(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},2225:(e,t,n)=>{"use strict";var i=n(3062),s=n(1359),r=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,l=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function d(e){return(e||"").toString().replace(r,"")}var h=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],p={hash:1,query:1};function f(e){var t,i=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},s={},r=typeof(e=e||i);if("blob:"===e.protocol)s=new v(unescape(e.pathname),{});else if("string"===r)for(t in s=new v(e,{}),p)delete s[t];else if("object"===r){for(t in e)t in p||(s[t]=e[t]);void 0===s.slashes&&(s.slashes=a.test(e.href))}return s}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function g(e,t){e=(e=d(e)).replace(o,""),t=t||{};var n,i=u.exec(e),s=i[1]?i[1].toLowerCase():"",r=!!i[2],a=!!i[3],l=0;return r?a?(n=i[2]+i[3]+i[4],l=i[2].length+i[3].length):(n=i[2]+i[4],l=i[2].length):a?(n=i[3]+i[4],l=i[3].length):n=i[4],"file:"===s?l>=2&&(n=n.slice(2)):m(s)?n=i[4]:s?r&&(n=n.slice(2)):l>=2&&m(t.protocol)&&(n=i[4]),{protocol:s,slashes:r||m(s),slashesCount:l,rest:n}}function v(e,t,n){if(e=(e=d(e)).replace(o,""),!(this instanceof v))return new v(e,t,n);var r,a,l,u,p,_,y=h.slice(),b=typeof t,w=this,D=0;for("object"!==b&&"string"!==b&&(n=t,t=null),n&&"function"!=typeof n&&(n=s.parse),r=!(a=g(e||"",t=f(t))).protocol&&!a.slashes,w.slashes=a.slashes||r&&t.slashes,w.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||c.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(w.protocol)))&&(y[3]=[/(.*)/,"pathname"]);D{e.exports={}}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var i={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var s=2&t&&e;"object"==typeof s&&!~leafPrototypes.indexOf(s);s=getProto(s))Object.getOwnPropertyNames(s).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,__webpack_require__.d(n,i),n},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((t,n)=>(__webpack_require__.f[n](e,t),t)),[])),__webpack_require__.u=e=>e+".thebe-lite.min.js",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),inProgress={},dataWebpackPrefix="thebe-lite:",__webpack_require__.l=(e,t,n,i)=>{if(inProgress[e])inProgress[e].push(t);else{var s,r;if(void 0!==n)for(var o=document.getElementsByTagName("script"),a=0;a{s.onerror=s.onload=null,clearTimeout(c);var i=inProgress[e];if(delete inProgress[e],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(n))),t)return t(n)},c=setTimeout(u.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=u.bind(null,s.onerror),s.onload=u.bind(null,s.onload),r&&document.head.appendChild(s)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{__webpack_require__.b=document.baseURI||self.location.href;var e={524:0};__webpack_require__.f.j=(t,n)=>{var i=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var s=new Promise(((n,s)=>i=e[t]=[n,s]));n.push(i[2]=s);var r=__webpack_require__.p+__webpack_require__.u(t),o=new Error;__webpack_require__.l(r,(n=>{if(__webpack_require__.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var s=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src;o.message="Loading chunk "+t+" failed.\n("+s+": "+r+")",o.name="ChunkLoadError",o.type=s,o.request=r,i[1](o)}}),"chunk-"+t,t)}};var t=(t,n)=>{var i,s,[r,o,a]=n,l=0;if(r.some((t=>0!==e[t]))){for(i in o)__webpack_require__.o(o,i)&&(__webpack_require__.m[i]=o[i]);a&&a(__webpack_require__)}for(t&&t(n);l {\n this._activityStopped.emit({\n sender: this._sender,\n args: this._args\n });\n }, this._timeout);\n }\n}\nexports.ActivityMonitor = ActivityMonitor;\n//# sourceMappingURL=activitymonitor.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module coreutils\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./activitymonitor\"), exports);\n__exportStar(require(\"./interfaces\"), exports);\n__exportStar(require(\"./lru\"), exports);\n__exportStar(require(\"./markdowncodeblocks\"), exports);\n__exportStar(require(\"./pageconfig\"), exports);\n__exportStar(require(\"./path\"), exports);\n__exportStar(require(\"./signal\"), exports);\n__exportStar(require(\"./text\"), exports);\n__exportStar(require(\"./time\"), exports);\n__exportStar(require(\"./url\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=interfaces.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LruCache = void 0;\nconst DEFAULT_MAX_SIZE = 128;\n/** A least-recently-used cache. */\nclass LruCache {\n constructor(options = {}) {\n this._map = new Map();\n this._maxSize = (options === null || options === void 0 ? void 0 : options.maxSize) || DEFAULT_MAX_SIZE;\n }\n /**\n * Return the current size of the cache.\n */\n get size() {\n return this._map.size;\n }\n /**\n * Clear the values in the cache.\n */\n clear() {\n this._map.clear();\n }\n /**\n * Get a value (or null) from the cache, pushing the item to the front of the cache.\n */\n get(key) {\n const item = this._map.get(key) || null;\n if (item != null) {\n this._map.delete(key);\n this._map.set(key, item);\n }\n return item;\n }\n /**\n * Set a value in the cache, potentially evicting an old item.\n */\n set(key, value) {\n if (this._map.size >= this._maxSize) {\n this._map.delete(this._map.keys().next().value);\n }\n this._map.set(key, value);\n }\n}\nexports.LruCache = LruCache;\n//# sourceMappingURL=lru.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MarkdownCodeBlocks = void 0;\n/**\n * The namespace for code block functions which help\n * in extract code from markdown text\n */\nvar MarkdownCodeBlocks;\n(function (MarkdownCodeBlocks) {\n MarkdownCodeBlocks.CODE_BLOCK_MARKER = '```';\n const markdownExtensions = [\n '.markdown',\n '.mdown',\n '.mkdn',\n '.md',\n '.mkd',\n '.mdwn',\n '.mdtxt',\n '.mdtext',\n '.text',\n '.txt',\n '.Rmd'\n ];\n class MarkdownCodeBlock {\n constructor(startLine) {\n this.startLine = startLine;\n this.code = '';\n this.endLine = -1;\n }\n }\n MarkdownCodeBlocks.MarkdownCodeBlock = MarkdownCodeBlock;\n /**\n * Check whether the given file extension is a markdown extension\n * @param extension - A file extension\n *\n * @returns true/false depending on whether this is a supported markdown extension\n */\n function isMarkdown(extension) {\n return markdownExtensions.indexOf(extension) > -1;\n }\n MarkdownCodeBlocks.isMarkdown = isMarkdown;\n /**\n * Construct all code snippets from current text\n * (this could be potentially optimized if we can cache and detect differences)\n * @param text - A string to parse codeblocks from\n *\n * @returns An array of MarkdownCodeBlocks.\n */\n function findMarkdownCodeBlocks(text) {\n if (!text || text === '') {\n return [];\n }\n const lines = text.split('\\n');\n const codeBlocks = [];\n let currentBlock = null;\n for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {\n const line = lines[lineIndex];\n const lineContainsMarker = line.indexOf(MarkdownCodeBlocks.CODE_BLOCK_MARKER) === 0;\n const constructingBlock = currentBlock != null;\n // Skip this line if it is not part of any code block and doesn't contain a marker.\n if (!lineContainsMarker && !constructingBlock) {\n continue;\n }\n // Check if we are already constructing a code block.\n if (!constructingBlock) {\n // Start constructing a new code block.\n currentBlock = new MarkdownCodeBlock(lineIndex);\n // Check whether this is a single line code block of the form ```a = 10```.\n const firstIndex = line.indexOf(MarkdownCodeBlocks.CODE_BLOCK_MARKER);\n const lastIndex = line.lastIndexOf(MarkdownCodeBlocks.CODE_BLOCK_MARKER);\n const isSingleLine = firstIndex !== lastIndex;\n if (isSingleLine) {\n currentBlock.code = line.substring(firstIndex + MarkdownCodeBlocks.CODE_BLOCK_MARKER.length, lastIndex);\n currentBlock.endLine = lineIndex;\n codeBlocks.push(currentBlock);\n currentBlock = null;\n }\n }\n else if (currentBlock) {\n if (lineContainsMarker) {\n // End of block, finish it up.\n currentBlock.endLine = lineIndex - 1;\n codeBlocks.push(currentBlock);\n currentBlock = null;\n }\n else {\n // Append the current line.\n currentBlock.code += line + '\\n';\n }\n }\n }\n return codeBlocks;\n }\n MarkdownCodeBlocks.findMarkdownCodeBlocks = findMarkdownCodeBlocks;\n})(MarkdownCodeBlocks || (exports.MarkdownCodeBlocks = MarkdownCodeBlocks = {}));\n//# sourceMappingURL=markdowncodeblocks.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PageConfig = void 0;\nconst coreutils_1 = require(\"@lumino/coreutils\");\nconst minimist_1 = __importDefault(require(\"minimist\"));\nconst url_1 = require(\"./url\");\n/**\n * The namespace for `PageConfig` functions.\n */\nvar PageConfig;\n(function (PageConfig) {\n /**\n * Get global configuration data for the Jupyter application.\n *\n * @param name - The name of the configuration option.\n *\n * @returns The config value or an empty string if not found.\n *\n * #### Notes\n * All values are treated as strings.\n * For browser based applications, it is assumed that the page HTML\n * includes a script tag with the id `jupyter-config-data` containing the\n * configuration as valid JSON. In order to support the classic Notebook,\n * we fall back on checking for `body` data of the given `name`.\n *\n * For node applications, it is assumed that the process was launched\n * with a `--jupyter-config-data` option pointing to a JSON settings\n * file.\n */\n function getOption(name) {\n if (configData) {\n return configData[name] || getBodyData(name);\n }\n configData = Object.create(null);\n let found = false;\n // Use script tag if available.\n if (typeof document !== 'undefined' && document) {\n const el = document.getElementById('jupyter-config-data');\n if (el) {\n configData = JSON.parse(el.textContent || '');\n found = true;\n }\n }\n // Otherwise use CLI if given.\n if (!found && typeof process !== 'undefined' && process.argv) {\n try {\n const cli = (0, minimist_1.default)(process.argv.slice(2));\n const path = require('path');\n let fullPath = '';\n if ('jupyter-config-data' in cli) {\n fullPath = path.resolve(cli['jupyter-config-data']);\n }\n else if ('JUPYTER_CONFIG_DATA' in process.env) {\n fullPath = path.resolve(process.env['JUPYTER_CONFIG_DATA']);\n }\n if (fullPath) {\n // Force Webpack to ignore this require.\n // eslint-disable-next-line\n configData = eval('require')(fullPath);\n }\n }\n catch (e) {\n console.error(e);\n }\n }\n if (!coreutils_1.JSONExt.isObject(configData)) {\n configData = Object.create(null);\n }\n else {\n for (const key in configData) {\n // PageConfig expects strings\n if (typeof configData[key] !== 'string') {\n configData[key] = JSON.stringify(configData[key]);\n }\n }\n }\n return configData[name] || getBodyData(name);\n }\n PageConfig.getOption = getOption;\n /**\n * Set global configuration data for the Jupyter application.\n *\n * @param name - The name of the configuration option.\n * @param value - The value to set the option to.\n *\n * @returns The last config value or an empty string if it doesn't exist.\n */\n function setOption(name, value) {\n const last = getOption(name);\n configData[name] = value;\n return last;\n }\n PageConfig.setOption = setOption;\n /**\n * Get the base url for a Jupyter application, or the base url of the page.\n */\n function getBaseUrl() {\n return url_1.URLExt.normalize(getOption('baseUrl') || '/');\n }\n PageConfig.getBaseUrl = getBaseUrl;\n /**\n * Get the tree url for a JupyterLab application.\n */\n function getTreeUrl() {\n return url_1.URLExt.join(getBaseUrl(), getOption('treeUrl'));\n }\n PageConfig.getTreeUrl = getTreeUrl;\n /**\n * Get the base url for sharing links (usually baseUrl)\n */\n function getShareUrl() {\n return url_1.URLExt.normalize(getOption('shareUrl') || getBaseUrl());\n }\n PageConfig.getShareUrl = getShareUrl;\n /**\n * Get the tree url for shareable links.\n * Usually the same as treeUrl,\n * but overrideable e.g. when sharing with JupyterHub.\n */\n function getTreeShareUrl() {\n return url_1.URLExt.normalize(url_1.URLExt.join(getShareUrl(), getOption('treeUrl')));\n }\n PageConfig.getTreeShareUrl = getTreeShareUrl;\n /**\n * Create a new URL given an optional mode and tree path.\n *\n * This is used to create URLS when the mode or tree path change as the user\n * changes mode or the current document in the main area. If fields in\n * options are omitted, the value in PageConfig will be used.\n *\n * @param options - IGetUrlOptions for the new path.\n */\n function getUrl(options) {\n var _a, _b, _c, _d;\n let path = options.toShare ? getShareUrl() : getBaseUrl();\n const mode = (_a = options.mode) !== null && _a !== void 0 ? _a : getOption('mode');\n const workspace = (_b = options.workspace) !== null && _b !== void 0 ? _b : getOption('workspace');\n const labOrDoc = mode === 'single-document' ? 'doc' : 'lab';\n path = url_1.URLExt.join(path, labOrDoc);\n if (workspace !== PageConfig.defaultWorkspace) {\n path = url_1.URLExt.join(path, 'workspaces', encodeURIComponent((_c = getOption('workspace')) !== null && _c !== void 0 ? _c : PageConfig.defaultWorkspace));\n }\n const treePath = (_d = options.treePath) !== null && _d !== void 0 ? _d : getOption('treePath');\n if (treePath) {\n path = url_1.URLExt.join(path, 'tree', url_1.URLExt.encodeParts(treePath));\n }\n return path;\n }\n PageConfig.getUrl = getUrl;\n PageConfig.defaultWorkspace = 'default';\n /**\n * Get the base websocket url for a Jupyter application, or an empty string.\n */\n function getWsUrl(baseUrl) {\n let wsUrl = getOption('wsUrl');\n if (!wsUrl) {\n baseUrl = baseUrl ? url_1.URLExt.normalize(baseUrl) : getBaseUrl();\n if (baseUrl.indexOf('http') !== 0) {\n return '';\n }\n wsUrl = 'ws' + baseUrl.slice(4);\n }\n return url_1.URLExt.normalize(wsUrl);\n }\n PageConfig.getWsUrl = getWsUrl;\n /**\n * Returns the URL converting this notebook to a certain\n * format with nbconvert.\n */\n function getNBConvertURL({ path, format, download }) {\n const notebookPath = url_1.URLExt.encodeParts(path);\n const url = url_1.URLExt.join(getBaseUrl(), 'nbconvert', format, notebookPath);\n if (download) {\n return url + '?download=true';\n }\n return url;\n }\n PageConfig.getNBConvertURL = getNBConvertURL;\n /**\n * Get the authorization token for a Jupyter application.\n */\n function getToken() {\n return getOption('token') || getBodyData('jupyterApiToken');\n }\n PageConfig.getToken = getToken;\n /**\n * Get the Notebook version info [major, minor, patch].\n */\n function getNotebookVersion() {\n const notebookVersion = getOption('notebookVersion');\n if (notebookVersion === '') {\n return [0, 0, 0];\n }\n return JSON.parse(notebookVersion);\n }\n PageConfig.getNotebookVersion = getNotebookVersion;\n /**\n * Private page config data for the Jupyter application.\n */\n let configData = null;\n /**\n * Get a url-encoded item from `body.data` and decode it\n * We should never have any encoded URLs anywhere else in code\n * until we are building an actual request.\n */\n function getBodyData(key) {\n if (typeof document === 'undefined' || !document.body) {\n return '';\n }\n const val = document.body.dataset[key];\n if (typeof val === 'undefined') {\n return '';\n }\n return decodeURIComponent(val);\n }\n /**\n * The namespace for page config `Extension` functions.\n */\n let Extension;\n (function (Extension) {\n /**\n * Populate an array from page config.\n *\n * @param key - The page config key (e.g., `deferredExtensions`).\n *\n * #### Notes\n * This is intended for `deferredExtensions` and `disabledExtensions`.\n */\n function populate(key) {\n try {\n const raw = getOption(key);\n if (raw) {\n return JSON.parse(raw);\n }\n }\n catch (error) {\n console.warn(`Unable to parse ${key}.`, error);\n }\n return [];\n }\n /**\n * The collection of deferred extensions in page config.\n */\n Extension.deferred = populate('deferredExtensions');\n /**\n * The collection of disabled extensions in page config.\n */\n Extension.disabled = populate('disabledExtensions');\n /**\n * Returns whether a plugin is deferred.\n *\n * @param id - The plugin ID.\n */\n function isDeferred(id) {\n // Check for either a full plugin id match or an extension\n // name match.\n const separatorIndex = id.indexOf(':');\n let extName = '';\n if (separatorIndex !== -1) {\n extName = id.slice(0, separatorIndex);\n }\n return Extension.deferred.some(val => val === id || (extName && val === extName));\n }\n Extension.isDeferred = isDeferred;\n /**\n * Returns whether a plugin is disabled.\n *\n * @param id - The plugin ID.\n */\n function isDisabled(id) {\n // Check for either a full plugin id match or an extension\n // name match.\n const separatorIndex = id.indexOf(':');\n let extName = '';\n if (separatorIndex !== -1) {\n extName = id.slice(0, separatorIndex);\n }\n return Extension.disabled.some(val => val === id || (extName && val === extName));\n }\n Extension.isDisabled = isDisabled;\n })(Extension = PageConfig.Extension || (PageConfig.Extension = {}));\n})(PageConfig || (exports.PageConfig = PageConfig = {}));\n//# sourceMappingURL=pageconfig.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PathExt = void 0;\nconst path_1 = require(\"path\");\n/**\n * The namespace for path-related functions.\n *\n * Note that Jupyter server paths do not start with a leading slash.\n */\nvar PathExt;\n(function (PathExt) {\n /**\n * Join all arguments together and normalize the resulting path.\n * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.\n *\n * @param paths - The string paths to join.\n */\n function join(...paths) {\n const path = path_1.posix.join(...paths);\n return path === '.' ? '' : removeSlash(path);\n }\n PathExt.join = join;\n /**\n * Join all arguments together and normalize the resulting path and preserve the leading slash.\n *\n * @param paths - The string paths to join.\n */\n function joinWithLeadingSlash(...paths) {\n const path = path_1.posix.join(...paths);\n return path === '.' ? '' : path;\n }\n PathExt.joinWithLeadingSlash = joinWithLeadingSlash;\n /**\n * Return the last portion of a path. Similar to the Unix basename command.\n * Often used to extract the file name from a fully qualified path.\n *\n * @param path - The path to evaluate.\n *\n * @param ext - An extension to remove from the result.\n */\n function basename(path, ext) {\n return path_1.posix.basename(path, ext);\n }\n PathExt.basename = basename;\n /**\n * Get the directory name of a path, similar to the Unix dirname command.\n * When an empty path is given, returns the root path.\n *\n * @param path - The file path.\n */\n function dirname(path) {\n const dir = removeSlash(path_1.posix.dirname(path));\n return dir === '.' ? '' : dir;\n }\n PathExt.dirname = dirname;\n /**\n * Get the extension of the path.\n *\n * @param path - The file path.\n *\n * @returns the extension of the file.\n *\n * #### Notes\n * The extension is the string from the last occurrence of the `.`\n * character to end of string in the last portion of the path, inclusive.\n * If there is no `.` in the last portion of the path, or if the first\n * character of the basename of path [[basename]] is `.`, then an\n * empty string is returned.\n */\n function extname(path) {\n return path_1.posix.extname(path);\n }\n PathExt.extname = extname;\n /**\n * Normalize a string path, reducing '..' and '.' parts.\n * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.\n * When an empty path is given, returns the root path.\n *\n * @param path - The string path to normalize.\n */\n function normalize(path) {\n if (path === '') {\n return '';\n }\n return removeSlash(path_1.posix.normalize(path));\n }\n PathExt.normalize = normalize;\n /**\n * Resolve a sequence of paths or path segments into an absolute path.\n * The root path in the application has no leading slash, so it is removed.\n *\n * @param parts - The paths to join.\n *\n * #### Notes\n * The right-most parameter is considered \\{to\\}. Other parameters are considered an array of \\{from\\}.\n *\n * Starting from leftmost \\{from\\} parameter, resolves \\{to\\} to an absolute path.\n *\n * If \\{to\\} isn't already absolute, \\{from\\} arguments are prepended in right to left order, until an absolute path is found. If after using all \\{from\\} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.\n */\n function resolve(...parts) {\n return removeSlash(path_1.posix.resolve(...parts));\n }\n PathExt.resolve = resolve;\n /**\n * Solve the relative path from \\{from\\} to \\{to\\}.\n *\n * @param from - The source path.\n *\n * @param to - The target path.\n *\n * #### Notes\n * If from and to each resolve to the same path (after calling\n * path.resolve() on each), a zero-length string is returned.\n * If a zero-length string is passed as from or to, `/`\n * will be used instead of the zero-length strings.\n */\n function relative(from, to) {\n return removeSlash(path_1.posix.relative(from, to));\n }\n PathExt.relative = relative;\n /**\n * Normalize a file extension to be of the type `'.foo'`.\n *\n * @param extension - the file extension.\n *\n * #### Notes\n * Adds a leading dot if not present and converts to lower case.\n */\n function normalizeExtension(extension) {\n if (extension.length > 0 && extension.indexOf('.') !== 0) {\n extension = `.${extension}`;\n }\n return extension;\n }\n PathExt.normalizeExtension = normalizeExtension;\n /**\n * Remove the leading slash from a path.\n *\n * @param path the path from which to remove a leading slash.\n */\n function removeSlash(path) {\n if (path.indexOf('/') === 0) {\n path = path.slice(1);\n }\n return path;\n }\n PathExt.removeSlash = removeSlash;\n})(PathExt || (exports.PathExt = PathExt = {}));\n//# sourceMappingURL=path.js.map","\"use strict\";\n/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.signalToPromise = void 0;\nconst coreutils_1 = require(\"@lumino/coreutils\");\n/**\n * Convert a signal into a promise for the first emitted value.\n *\n * @param signal - The signal we are listening to.\n * @param timeout - Timeout to wait for signal in ms (not timeout if not defined or 0)\n *\n * @returns a Promise that resolves with a `(sender, args)` pair.\n */\nfunction signalToPromise(signal, timeout) {\n const waitForSignal = new coreutils_1.PromiseDelegate();\n function cleanup() {\n signal.disconnect(slot);\n }\n function slot(sender, args) {\n cleanup();\n waitForSignal.resolve([sender, args]);\n }\n signal.connect(slot);\n if ((timeout !== null && timeout !== void 0 ? timeout : 0) > 0) {\n setTimeout(() => {\n cleanup();\n waitForSignal.reject(`Signal not emitted within ${timeout} ms.`);\n }, timeout);\n }\n return waitForSignal.promise;\n}\nexports.signalToPromise = signalToPromise;\n//# sourceMappingURL=signal.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Text = void 0;\n/**\n * The namespace for text-related functions.\n */\nvar Text;\n(function (Text) {\n // javascript stores text as utf16 and string indices use \"code units\",\n // which stores high-codepoint characters as \"surrogate pairs\",\n // which occupy two indices in the javascript string.\n // We need to translate cursor_pos in the Jupyter protocol (in characters)\n // to js offset (with surrogate pairs taking two spots).\n const HAS_SURROGATES = '𝐚'.length > 1;\n /**\n * Convert a javascript string index into a unicode character offset\n *\n * @param jsIdx - The javascript string index (counting surrogate pairs)\n *\n * @param text - The text in which the offset is calculated\n *\n * @returns The unicode character offset\n */\n function jsIndexToCharIndex(jsIdx, text) {\n if (HAS_SURROGATES) {\n // not using surrogates, nothing to do\n return jsIdx;\n }\n let charIdx = jsIdx;\n for (let i = 0; i + 1 < text.length && i < jsIdx; i++) {\n const charCode = text.charCodeAt(i);\n // check for surrogate pair\n if (charCode >= 0xd800 && charCode <= 0xdbff) {\n const nextCharCode = text.charCodeAt(i + 1);\n if (nextCharCode >= 0xdc00 && nextCharCode <= 0xdfff) {\n charIdx--;\n i++;\n }\n }\n }\n return charIdx;\n }\n Text.jsIndexToCharIndex = jsIndexToCharIndex;\n /**\n * Convert a unicode character offset to a javascript string index.\n *\n * @param charIdx - The index in unicode characters\n *\n * @param text - The text in which the offset is calculated\n *\n * @returns The js-native index\n */\n function charIndexToJsIndex(charIdx, text) {\n if (HAS_SURROGATES) {\n // not using surrogates, nothing to do\n return charIdx;\n }\n let jsIdx = charIdx;\n for (let i = 0; i + 1 < text.length && i < jsIdx; i++) {\n const charCode = text.charCodeAt(i);\n // check for surrogate pair\n if (charCode >= 0xd800 && charCode <= 0xdbff) {\n const nextCharCode = text.charCodeAt(i + 1);\n if (nextCharCode >= 0xdc00 && nextCharCode <= 0xdfff) {\n jsIdx++;\n i++;\n }\n }\n }\n return jsIdx;\n }\n Text.charIndexToJsIndex = charIndexToJsIndex;\n /**\n * Given a 'snake-case', 'snake_case', 'snake:case', or\n * 'snake case' string, will return the camel case version: 'snakeCase'.\n *\n * @param str the snake-case input string.\n *\n * @param upper default = false. If true, the first letter of the\n * returned string will be capitalized.\n *\n * @returns the camel case version of the input string.\n */\n function camelCase(str, upper = false) {\n return str.replace(/^(\\w)|[\\s-_:]+(\\w)/g, function (match, p1, p2) {\n if (p2) {\n return p2.toUpperCase();\n }\n else {\n return upper ? p1.toUpperCase() : p1.toLowerCase();\n }\n });\n }\n Text.camelCase = camelCase;\n /**\n * Given a string, title case the words in the string.\n *\n * @param str the string to title case.\n *\n * @returns the same string, but with each word capitalized.\n */\n function titleCase(str) {\n return (str || '')\n .toLowerCase()\n .split(' ')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n }\n Text.titleCase = titleCase;\n})(Text || (exports.Text = Text = {}));\n//# sourceMappingURL=text.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Time = void 0;\n/**\n * A list of time units with their associated value in milliseconds.\n */\nconst UNITS = [\n { name: 'years', milliseconds: 365 * 24 * 60 * 60 * 1000 },\n { name: 'months', milliseconds: 30 * 24 * 60 * 60 * 1000 },\n { name: 'days', milliseconds: 24 * 60 * 60 * 1000 },\n { name: 'hours', milliseconds: 60 * 60 * 1000 },\n { name: 'minutes', milliseconds: 60 * 1000 },\n { name: 'seconds', milliseconds: 1000 }\n];\n/**\n * The namespace for date functions.\n */\nvar Time;\n(function (Time) {\n /**\n * Convert a timestring to a human readable string (e.g. 'two minutes ago').\n *\n * @param value - The date timestring or date object.\n *\n * @returns A formatted date.\n */\n function formatHuman(value, format = 'long') {\n const lang = document.documentElement.lang || 'en';\n const formatter = new Intl.RelativeTimeFormat(lang, {\n numeric: 'auto',\n style: format\n });\n const delta = new Date(value).getTime() - Date.now();\n for (let unit of UNITS) {\n const amount = Math.ceil(delta / unit.milliseconds);\n if (amount === 0) {\n continue;\n }\n return formatter.format(amount, unit.name);\n }\n return formatter.format(0, 'seconds');\n }\n Time.formatHuman = formatHuman;\n /**\n * Convenient helper to convert a timestring to a date format.\n *\n * @param value - The date timestring or date object.\n *\n * @returns A formatted date.\n */\n function format(value) {\n const lang = document.documentElement.lang || 'en';\n const formatter = new Intl.DateTimeFormat(lang, {\n dateStyle: 'short',\n timeStyle: 'short'\n });\n return formatter.format(new Date(value));\n }\n Time.format = format;\n})(Time || (exports.Time = Time = {}));\n//# sourceMappingURL=time.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.URLExt = void 0;\nconst path_1 = require(\"path\");\nconst url_parse_1 = __importDefault(require(\"url-parse\"));\n/**\n * The namespace for URL-related functions.\n */\nvar URLExt;\n(function (URLExt) {\n /**\n * Parse a url into a URL object.\n *\n * @param url - The URL string to parse.\n *\n * @returns A URL object.\n */\n function parse(url) {\n if (typeof document !== 'undefined' && document) {\n const a = document.createElement('a');\n a.href = url;\n return a;\n }\n return (0, url_parse_1.default)(url);\n }\n URLExt.parse = parse;\n /**\n * Parse URL and retrieve hostname\n *\n * @param url - The URL string to parse\n *\n * @returns a hostname string value\n */\n function getHostName(url) {\n return (0, url_parse_1.default)(url).hostname;\n }\n URLExt.getHostName = getHostName;\n function normalize(url) {\n return url && parse(url).toString();\n }\n URLExt.normalize = normalize;\n /**\n * Join a sequence of url components and normalizes as in node `path.join`.\n *\n * @param parts - The url components.\n *\n * @returns the joined url.\n */\n function join(...parts) {\n let u = (0, url_parse_1.default)(parts[0], {});\n // Schema-less URL can be only parsed as relative to a base URL\n // see https://github.com/unshiftio/url-parse/issues/219#issuecomment-1002219326\n const isSchemaLess = u.protocol === '' && u.slashes;\n if (isSchemaLess) {\n u = (0, url_parse_1.default)(parts[0], 'https:' + parts[0]);\n }\n const prefix = `${isSchemaLess ? '' : u.protocol}${u.slashes ? '//' : ''}${u.auth}${u.auth ? '@' : ''}${u.host}`;\n // If there was a prefix, then the first path must start at the root.\n const path = path_1.posix.join(`${!!prefix && u.pathname[0] !== '/' ? '/' : ''}${u.pathname}`, ...parts.slice(1));\n return `${prefix}${path === '.' ? '' : path}`;\n }\n URLExt.join = join;\n /**\n * Encode the components of a multi-segment url.\n *\n * @param url - The url to encode.\n *\n * @returns the encoded url.\n *\n * #### Notes\n * Preserves the `'/'` separators.\n * Should not include the base url, since all parts are escaped.\n */\n function encodeParts(url) {\n return join(...url.split('/').map(encodeURIComponent));\n }\n URLExt.encodeParts = encodeParts;\n /**\n * Return a serialized object string suitable for a query.\n *\n * @param value The source object.\n *\n * @returns an encoded url query.\n *\n * #### Notes\n * Modified version of [stackoverflow](http://stackoverflow.com/a/30707423).\n */\n function objectToQueryString(value) {\n const keys = Object.keys(value).filter(key => key.length > 0);\n if (!keys.length) {\n return '';\n }\n return ('?' +\n keys\n .map(key => {\n const content = encodeURIComponent(String(value[key]));\n return key + (content ? '=' + content : '');\n })\n .join('&'));\n }\n URLExt.objectToQueryString = objectToQueryString;\n /**\n * Return a parsed object that represents the values in a query string.\n */\n function queryStringToObject(value) {\n return value\n .replace(/^\\?/, '')\n .split('&')\n .reduce((acc, val) => {\n const [key, value] = val.split('=');\n if (key.length > 0) {\n acc[key] = decodeURIComponent(value || '');\n }\n return acc;\n }, {});\n }\n URLExt.queryStringToObject = queryStringToObject;\n /**\n * Test whether the url is a local url.\n *\n * @param allowRoot - Whether the paths starting at Unix-style filesystem root (`/`) are permitted.\n *\n * #### Notes\n * This function returns `false` for any fully qualified url, including\n * `data:`, `file:`, and `//` protocol URLs.\n */\n function isLocal(url, allowRoot = false) {\n const { protocol } = parse(url);\n return ((!protocol || url.toLowerCase().indexOf(protocol) !== 0) &&\n (allowRoot ? url.indexOf('//') !== 0 : url.indexOf('/') !== 0));\n }\n URLExt.isLocal = isLocal;\n})(URLExt || (exports.URLExt = URLExt = {}));\n//# sourceMappingURL=url.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseManager = void 0;\nconst signaling_1 = require(\"@lumino/signaling\");\nconst serverconnection_1 = require(\"./serverconnection\");\nclass BaseManager {\n constructor(options) {\n var _a;\n this._isDisposed = false;\n this._disposed = new signaling_1.Signal(this);\n this.serverSettings =\n (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();\n }\n /**\n * A signal emitted when the delegate is disposed.\n */\n get disposed() {\n return this._disposed;\n }\n /**\n * Test whether the delegate has been disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * Whether the manager is active.\n */\n get isActive() {\n return true;\n }\n /**\n * Dispose of the delegate and invoke the callback function.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n this._disposed.emit(undefined);\n signaling_1.Signal.clearData(this);\n }\n}\nexports.BaseManager = BaseManager;\n//# sourceMappingURL=basemanager.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BuildManager = void 0;\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\nconst serverconnection_1 = require(\"../serverconnection\");\n/**\n * The url for the lab build service.\n */\nconst BUILD_SETTINGS_URL = 'api/build';\n/**\n * The build API service manager.\n */\nclass BuildManager {\n /**\n * Create a new setting manager.\n */\n constructor(options = {}) {\n var _a;\n this._url = '';\n this.serverSettings =\n (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();\n const { baseUrl, appUrl } = this.serverSettings;\n this._url = coreutils_1.URLExt.join(baseUrl, appUrl, BUILD_SETTINGS_URL);\n }\n /**\n * Test whether the build service is available.\n */\n get isAvailable() {\n return coreutils_1.PageConfig.getOption('buildAvailable').toLowerCase() === 'true';\n }\n /**\n * Test whether to check build status automatically.\n */\n get shouldCheck() {\n return coreutils_1.PageConfig.getOption('buildCheck').toLowerCase() === 'true';\n }\n /**\n * Get whether the application should be built.\n */\n getStatus() {\n const { _url, serverSettings } = this;\n const promise = serverconnection_1.ServerConnection.makeRequest(_url, {}, serverSettings);\n return promise\n .then(response => {\n if (response.status !== 200) {\n throw new serverconnection_1.ServerConnection.ResponseError(response);\n }\n return response.json();\n })\n .then(data => {\n if (typeof data.status !== 'string') {\n throw new Error('Invalid data');\n }\n if (typeof data.message !== 'string') {\n throw new Error('Invalid data');\n }\n return data;\n });\n }\n /**\n * Build the application.\n */\n build() {\n const { _url, serverSettings } = this;\n const init = { method: 'POST' };\n const promise = serverconnection_1.ServerConnection.makeRequest(_url, init, serverSettings);\n return promise.then(response => {\n if (response.status === 400) {\n throw new serverconnection_1.ServerConnection.ResponseError(response, 'Build aborted');\n }\n if (response.status !== 200) {\n const message = `Build failed with ${response.status}.\n\n If you are experiencing the build failure after installing an extension (or trying to include previously installed extension after updating JupyterLab) please check the extension repository for new installation instructions as many extensions migrated to the prebuilt extensions system which no longer requires rebuilding JupyterLab (but uses a different installation procedure, typically involving a package manager such as 'pip' or 'conda').\n\n If you specifically intended to install a source extension, please run 'jupyter lab build' on the server for full output.`;\n throw new serverconnection_1.ServerConnection.ResponseError(response, message);\n }\n });\n }\n /**\n * Cancel an active build.\n */\n cancel() {\n const { _url, serverSettings } = this;\n const init = { method: 'DELETE' };\n const promise = serverconnection_1.ServerConnection.makeRequest(_url, init, serverSettings);\n return promise.then(response => {\n if (response.status !== 204) {\n throw new serverconnection_1.ServerConnection.ResponseError(response);\n }\n });\n }\n}\nexports.BuildManager = BuildManager;\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConfigWithDefaults = exports.ConfigSection = void 0;\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\nconst __1 = require(\"..\");\n/**\n * The url for the config service.\n */\nconst SERVICE_CONFIG_URL = 'api/config';\n/**\n * The namespace for ConfigSection statics.\n */\nvar ConfigSection;\n(function (ConfigSection) {\n /**\n * Create a config section.\n *\n * @returns A Promise that is fulfilled with the config section is loaded.\n */\n function create(options) {\n const section = new DefaultConfigSection(options);\n return section.load().then(() => {\n return section;\n });\n }\n ConfigSection.create = create;\n})(ConfigSection || (exports.ConfigSection = ConfigSection = {}));\n/**\n * Implementation of the Configurable data section.\n */\nclass DefaultConfigSection {\n /**\n * Construct a new config section.\n */\n constructor(options) {\n var _a;\n this._url = 'unknown';\n const settings = (this.serverSettings =\n (_a = options.serverSettings) !== null && _a !== void 0 ? _a : __1.ServerConnection.makeSettings());\n this._url = coreutils_1.URLExt.join(settings.baseUrl, SERVICE_CONFIG_URL, encodeURIComponent(options.name));\n }\n /**\n * Get the data for this section.\n */\n get data() {\n return this._data;\n }\n /**\n * Load the initial data for this section.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/config).\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n */\n async load() {\n const response = await __1.ServerConnection.makeRequest(this._url, {}, this.serverSettings);\n if (response.status !== 200) {\n const err = await __1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n this._data = await response.json();\n }\n /**\n * Modify the stored config values.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/config).\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n *\n * Updates the local data immediately, sends the change to the server,\n * and updates the local data with the response, and fulfils the promise\n * with that data.\n */\n async update(newdata) {\n this._data = { ...this._data, ...newdata };\n const init = {\n method: 'PATCH',\n body: JSON.stringify(newdata)\n };\n const response = await __1.ServerConnection.makeRequest(this._url, init, this.serverSettings);\n if (response.status !== 200) {\n const err = await __1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n this._data = await response.json();\n return this._data;\n }\n}\n/**\n * Configurable object with defaults.\n */\nclass ConfigWithDefaults {\n /**\n * Create a new config with defaults.\n */\n constructor(options) {\n var _a, _b;\n this._className = '';\n this._section = options.section;\n this._defaults = (_a = options.defaults) !== null && _a !== void 0 ? _a : {};\n this._className = (_b = options.className) !== null && _b !== void 0 ? _b : '';\n }\n /**\n * Get data from the config section or fall back to defaults.\n */\n get(key) {\n const data = this._classData();\n return key in data ? data[key] : this._defaults[key];\n }\n /**\n * Set a config value.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/config).\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n *\n * Sends the update to the server, and changes our local copy of the data\n * immediately.\n */\n set(key, value) {\n const d = {};\n d[key] = value;\n if (this._className) {\n const d2 = {};\n d2[this._className] = d;\n return this._section.update(d2);\n }\n else {\n return this._section.update(d);\n }\n }\n /**\n * Get data from the Section with our classname, if available.\n *\n * #### Notes\n * If we have no classname, get all of the data in the Section\n */\n _classData() {\n const data = this._section.data;\n if (this._className && this._className in data) {\n return data[this._className];\n }\n return data;\n }\n}\nexports.ConfigWithDefaults = ConfigWithDefaults;\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Drive = exports.ContentsManager = exports.Contents = void 0;\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\nconst signaling_1 = require(\"@lumino/signaling\");\nconst __1 = require(\"..\");\nconst validate = __importStar(require(\"./validate\"));\n/**\n * The url for the default drive service.\n */\nconst SERVICE_DRIVE_URL = 'api/contents';\n/**\n * The url for the file access.\n */\nconst FILES_URL = 'files';\n/**\n * A namespace for contents interfaces.\n */\nvar Contents;\n(function (Contents) {\n /**\n * Validates an IModel, throwing an error if it does not pass.\n */\n function validateContentsModel(contents) {\n validate.validateContentsModel(contents);\n }\n Contents.validateContentsModel = validateContentsModel;\n /**\n * Validates an ICheckpointModel, throwing an error if it does not pass.\n */\n function validateCheckpointModel(checkpoint) {\n validate.validateCheckpointModel(checkpoint);\n }\n Contents.validateCheckpointModel = validateCheckpointModel;\n})(Contents || (exports.Contents = Contents = {}));\n/**\n * A contents manager that passes file operations to the server.\n * Multiple servers implementing the `IDrive` interface can be\n * attached to the contents manager, so that the same session can\n * perform file operations on multiple backends.\n *\n * This includes checkpointing with the normal file operations.\n */\nclass ContentsManager {\n /**\n * Construct a new contents manager object.\n *\n * @param options - The options used to initialize the object.\n */\n constructor(options = {}) {\n var _a, _b;\n this._isDisposed = false;\n this._additionalDrives = new Map();\n this._fileChanged = new signaling_1.Signal(this);\n const serverSettings = (this.serverSettings =\n (_a = options.serverSettings) !== null && _a !== void 0 ? _a : __1.ServerConnection.makeSettings());\n this._defaultDrive = (_b = options.defaultDrive) !== null && _b !== void 0 ? _b : new Drive({ serverSettings });\n this._defaultDrive.fileChanged.connect(this._onFileChanged, this);\n }\n /**\n * A signal emitted when a file operation takes place.\n */\n get fileChanged() {\n return this._fileChanged;\n }\n /**\n * Test whether the manager has been disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * Dispose of the resources held by the manager.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n signaling_1.Signal.clearData(this);\n }\n /**\n * Add an `IDrive` to the manager.\n */\n addDrive(drive) {\n this._additionalDrives.set(drive.name, drive);\n drive.fileChanged.connect(this._onFileChanged, this);\n }\n /**\n * Given a path, get a shared model factory from the\n * relevant backend. Returns `null` if the backend\n * does not provide one.\n */\n getSharedModelFactory(path) {\n var _a;\n const [drive] = this._driveForPath(path);\n return (_a = drive === null || drive === void 0 ? void 0 : drive.sharedModelFactory) !== null && _a !== void 0 ? _a : null;\n }\n /**\n * Given a path of the form `drive:local/portion/of/it.txt`\n * get the local part of it.\n *\n * @param path the path.\n *\n * @returns The local part of the path.\n */\n localPath(path) {\n const parts = path.split('/');\n const firstParts = parts[0].split(':');\n if (firstParts.length === 1 || !this._additionalDrives.has(firstParts[0])) {\n return coreutils_1.PathExt.removeSlash(path);\n }\n return coreutils_1.PathExt.join(firstParts.slice(1).join(':'), ...parts.slice(1));\n }\n /**\n * Normalize a global path. Reduces '..' and '.' parts, and removes\n * leading slashes from the local part of the path, while retaining\n * the drive name if it exists.\n *\n * @param path the path.\n *\n * @returns The normalized path.\n */\n normalize(path) {\n const parts = path.split(':');\n if (parts.length === 1) {\n return coreutils_1.PathExt.normalize(path);\n }\n return `${parts[0]}:${coreutils_1.PathExt.normalize(parts.slice(1).join(':'))}`;\n }\n /**\n * Resolve a global path, starting from the root path. Behaves like\n * posix-path.resolve, with 3 differences:\n * - will never prepend cwd\n * - if root has a drive name, the result is prefixed with \":\"\n * - before adding drive name, leading slashes are removed\n *\n * @param path the path.\n *\n * @returns The normalized path.\n */\n resolvePath(root, path) {\n const driveName = this.driveName(root);\n const localPath = this.localPath(root);\n const resolved = coreutils_1.PathExt.resolve('/', localPath, path);\n return driveName ? `${driveName}:${resolved}` : resolved;\n }\n /**\n * Given a path of the form `drive:local/portion/of/it.txt`\n * get the name of the drive. If the path is missing\n * a drive portion, returns an empty string.\n *\n * @param path the path.\n *\n * @returns The drive name for the path, or the empty string.\n */\n driveName(path) {\n const parts = path.split('/');\n const firstParts = parts[0].split(':');\n if (firstParts.length === 1) {\n return '';\n }\n if (this._additionalDrives.has(firstParts[0])) {\n return firstParts[0];\n }\n return '';\n }\n /**\n * Get a file or directory.\n *\n * @param path The path to the file.\n *\n * @param options The options used to fetch the file.\n *\n * @returns A promise which resolves with the file content.\n */\n get(path, options) {\n const [drive, localPath] = this._driveForPath(path);\n return drive.get(localPath, options).then(contentsModel => {\n const listing = [];\n if (contentsModel.type === 'directory' && contentsModel.content) {\n for (const item of contentsModel.content) {\n listing.push({ ...item, path: this._toGlobalPath(drive, item.path) });\n }\n return {\n ...contentsModel,\n path: this._toGlobalPath(drive, localPath),\n content: listing,\n serverPath: contentsModel.path\n };\n }\n else {\n return {\n ...contentsModel,\n path: this._toGlobalPath(drive, localPath),\n serverPath: contentsModel.path\n };\n }\n });\n }\n /**\n * Get an encoded download url given a file path.\n *\n * @param path - An absolute POSIX file path on the server.\n *\n * #### Notes\n * It is expected that the path contains no relative paths.\n *\n * The returned URL may include a query parameter.\n */\n getDownloadUrl(path) {\n const [drive, localPath] = this._driveForPath(path);\n return drive.getDownloadUrl(localPath);\n }\n /**\n * Create a new untitled file or directory in the specified directory path.\n *\n * @param options The options used to create the file.\n *\n * @returns A promise which resolves with the created file content when the\n * file is created.\n */\n newUntitled(options = {}) {\n if (options.path) {\n const globalPath = this.normalize(options.path);\n const [drive, localPath] = this._driveForPath(globalPath);\n return drive\n .newUntitled({ ...options, path: localPath })\n .then(contentsModel => {\n return {\n ...contentsModel,\n path: coreutils_1.PathExt.join(globalPath, contentsModel.name),\n serverPath: contentsModel.path\n };\n });\n }\n else {\n return this._defaultDrive.newUntitled(options);\n }\n }\n /**\n * Delete a file.\n *\n * @param path - The path to the file.\n *\n * @returns A promise which resolves when the file is deleted.\n */\n delete(path) {\n const [drive, localPath] = this._driveForPath(path);\n return drive.delete(localPath);\n }\n /**\n * Rename a file or directory.\n *\n * @param path - The original file path.\n *\n * @param newPath - The new file path.\n *\n * @returns A promise which resolves with the new file contents model when\n * the file is renamed.\n */\n rename(path, newPath) {\n const [drive1, path1] = this._driveForPath(path);\n const [drive2, path2] = this._driveForPath(newPath);\n if (drive1 !== drive2) {\n throw Error('ContentsManager: renaming files must occur within a Drive');\n }\n return drive1.rename(path1, path2).then(contentsModel => {\n return {\n ...contentsModel,\n path: this._toGlobalPath(drive1, path2),\n serverPath: contentsModel.path\n };\n });\n }\n /**\n * Save a file.\n *\n * @param path - The desired file path.\n *\n * @param options - Optional overrides to the model.\n *\n * @returns A promise which resolves with the file content model when the\n * file is saved.\n *\n * #### Notes\n * Ensure that `model.content` is populated for the file.\n */\n save(path, options = {}) {\n const globalPath = this.normalize(path);\n const [drive, localPath] = this._driveForPath(path);\n return drive\n .save(localPath, { ...options, path: localPath })\n .then(contentsModel => {\n return {\n ...contentsModel,\n path: globalPath,\n serverPath: contentsModel.path\n };\n });\n }\n /**\n * Copy a file into a given directory.\n *\n * @param path - The original file path.\n *\n * @param toDir - The destination directory path.\n *\n * @returns A promise which resolves with the new contents model when the\n * file is copied.\n *\n * #### Notes\n * The server will select the name of the copied file.\n */\n copy(fromFile, toDir) {\n const [drive1, path1] = this._driveForPath(fromFile);\n const [drive2, path2] = this._driveForPath(toDir);\n if (drive1 === drive2) {\n return drive1.copy(path1, path2).then(contentsModel => {\n return {\n ...contentsModel,\n path: this._toGlobalPath(drive1, contentsModel.path),\n serverPath: contentsModel.path\n };\n });\n }\n else {\n throw Error('Copying files between drives is not currently implemented');\n }\n }\n /**\n * Create a checkpoint for a file.\n *\n * @param path - The path of the file.\n *\n * @returns A promise which resolves with the new checkpoint model when the\n * checkpoint is created.\n */\n createCheckpoint(path) {\n const [drive, localPath] = this._driveForPath(path);\n return drive.createCheckpoint(localPath);\n }\n /**\n * List available checkpoints for a file.\n *\n * @param path - The path of the file.\n *\n * @returns A promise which resolves with a list of checkpoint models for\n * the file.\n */\n listCheckpoints(path) {\n const [drive, localPath] = this._driveForPath(path);\n return drive.listCheckpoints(localPath);\n }\n /**\n * Restore a file to a known checkpoint state.\n *\n * @param path - The path of the file.\n *\n * @param checkpointID - The id of the checkpoint to restore.\n *\n * @returns A promise which resolves when the checkpoint is restored.\n */\n restoreCheckpoint(path, checkpointID) {\n const [drive, localPath] = this._driveForPath(path);\n return drive.restoreCheckpoint(localPath, checkpointID);\n }\n /**\n * Delete a checkpoint for a file.\n *\n * @param path - The path of the file.\n *\n * @param checkpointID - The id of the checkpoint to delete.\n *\n * @returns A promise which resolves when the checkpoint is deleted.\n */\n deleteCheckpoint(path, checkpointID) {\n const [drive, localPath] = this._driveForPath(path);\n return drive.deleteCheckpoint(localPath, checkpointID);\n }\n /**\n * Given a drive and a local path, construct a fully qualified\n * path. The inverse of `_driveForPath`.\n *\n * @param drive an `IDrive`.\n *\n * @param localPath the local path on the drive.\n *\n * @returns the fully qualified path.\n */\n _toGlobalPath(drive, localPath) {\n if (drive === this._defaultDrive) {\n return coreutils_1.PathExt.removeSlash(localPath);\n }\n else {\n return `${drive.name}:${coreutils_1.PathExt.removeSlash(localPath)}`;\n }\n }\n /**\n * Given a path, get the `IDrive to which it refers,\n * where the path satisfies the pattern\n * `'driveName:path/to/file'`. If there is no `driveName`\n * prepended to the path, it returns the default drive.\n *\n * @param path a path to a file.\n *\n * @returns A tuple containing an `IDrive` object for the path,\n * and a local path for that drive.\n */\n _driveForPath(path) {\n const driveName = this.driveName(path);\n const localPath = this.localPath(path);\n if (driveName) {\n return [this._additionalDrives.get(driveName), localPath];\n }\n else {\n return [this._defaultDrive, localPath];\n }\n }\n /**\n * Respond to fileChanged signals from the drives attached to\n * the manager. This prepends the drive name to the path if necessary,\n * and then forwards the signal.\n */\n _onFileChanged(sender, args) {\n var _a, _b;\n if (sender === this._defaultDrive) {\n this._fileChanged.emit(args);\n }\n else {\n let newValue = null;\n let oldValue = null;\n if ((_a = args.newValue) === null || _a === void 0 ? void 0 : _a.path) {\n newValue = {\n ...args.newValue,\n path: this._toGlobalPath(sender, args.newValue.path)\n };\n }\n if ((_b = args.oldValue) === null || _b === void 0 ? void 0 : _b.path) {\n oldValue = {\n ...args.oldValue,\n path: this._toGlobalPath(sender, args.oldValue.path)\n };\n }\n this._fileChanged.emit({\n type: args.type,\n newValue,\n oldValue\n });\n }\n }\n}\nexports.ContentsManager = ContentsManager;\n/**\n * A default implementation for an `IDrive`, talking to the\n * server using the Jupyter REST API.\n */\nclass Drive {\n /**\n * Construct a new contents manager object.\n *\n * @param options - The options used to initialize the object.\n */\n constructor(options = {}) {\n var _a, _b, _c;\n this._isDisposed = false;\n this._fileChanged = new signaling_1.Signal(this);\n this.name = (_a = options.name) !== null && _a !== void 0 ? _a : 'Default';\n this._apiEndpoint = (_b = options.apiEndpoint) !== null && _b !== void 0 ? _b : SERVICE_DRIVE_URL;\n this.serverSettings =\n (_c = options.serverSettings) !== null && _c !== void 0 ? _c : __1.ServerConnection.makeSettings();\n }\n /**\n * A signal emitted when a file operation takes place.\n */\n get fileChanged() {\n return this._fileChanged;\n }\n /**\n * Test whether the manager has been disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * Dispose of the resources held by the manager.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n signaling_1.Signal.clearData(this);\n }\n /**\n * Get a file or directory.\n *\n * @param localPath The path to the file.\n *\n * @param options The options used to fetch the file.\n *\n * @returns A promise which resolves with the file content.\n *\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.\n */\n async get(localPath, options) {\n let url = this._getUrl(localPath);\n if (options) {\n // The notebook type cannot take an format option.\n if (options.type === 'notebook') {\n delete options['format'];\n }\n const content = options.content ? '1' : '0';\n const hash = options.hash ? '1' : '0';\n const params = { ...options, content, hash };\n url += coreutils_1.URLExt.objectToQueryString(params);\n }\n const settings = this.serverSettings;\n const response = await __1.ServerConnection.makeRequest(url, {}, settings);\n if (response.status !== 200) {\n const err = await __1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n validate.validateContentsModel(data);\n return data;\n }\n /**\n * Get an encoded download url given a file path.\n *\n * @param localPath - An absolute POSIX file path on the server.\n *\n * #### Notes\n * It is expected that the path contains no relative paths.\n *\n * The returned URL may include a query parameter.\n */\n getDownloadUrl(localPath) {\n const baseUrl = this.serverSettings.baseUrl;\n let url = coreutils_1.URLExt.join(baseUrl, FILES_URL, coreutils_1.URLExt.encodeParts(localPath));\n let cookie = '';\n try {\n cookie = document.cookie;\n }\n catch (e) {\n // e.g. SecurityError in case of CSP Sandbox\n }\n const xsrfTokenMatch = cookie.match('\\\\b_xsrf=([^;]*)\\\\b');\n if (xsrfTokenMatch) {\n const fullUrl = new URL(url);\n fullUrl.searchParams.append('_xsrf', xsrfTokenMatch[1]);\n url = fullUrl.toString();\n }\n return Promise.resolve(url);\n }\n /**\n * Create a new untitled file or directory in the specified directory path.\n *\n * @param options The options used to create the file.\n *\n * @returns A promise which resolves with the created file content when the\n * file is created.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.\n */\n async newUntitled(options = {}) {\n var _a;\n let body = '{}';\n if (options) {\n if (options.ext) {\n options.ext = Private.normalizeExtension(options.ext);\n }\n body = JSON.stringify(options);\n }\n const settings = this.serverSettings;\n const url = this._getUrl((_a = options.path) !== null && _a !== void 0 ? _a : '');\n const init = {\n method: 'POST',\n body\n };\n const response = await __1.ServerConnection.makeRequest(url, init, settings);\n if (response.status !== 201) {\n const err = await __1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n validate.validateContentsModel(data);\n this._fileChanged.emit({\n type: 'new',\n oldValue: null,\n newValue: data\n });\n return data;\n }\n /**\n * Delete a file.\n *\n * @param localPath - The path to the file.\n *\n * @returns A promise which resolves when the file is deleted.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents).\n */\n async delete(localPath) {\n const url = this._getUrl(localPath);\n const settings = this.serverSettings;\n const init = { method: 'DELETE' };\n const response = await __1.ServerConnection.makeRequest(url, init, settings);\n // TODO: update IPEP27 to specify errors more precisely, so\n // that error types can be detected here with certainty.\n if (response.status !== 204) {\n const err = await __1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n this._fileChanged.emit({\n type: 'delete',\n oldValue: { path: localPath },\n newValue: null\n });\n }\n /**\n * Rename a file or directory.\n *\n * @param oldLocalPath - The original file path.\n *\n * @param newLocalPath - The new file path.\n *\n * @returns A promise which resolves with the new file contents model when\n * the file is renamed.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.\n */\n async rename(oldLocalPath, newLocalPath) {\n const settings = this.serverSettings;\n const url = this._getUrl(oldLocalPath);\n const init = {\n method: 'PATCH',\n body: JSON.stringify({ path: newLocalPath })\n };\n const response = await __1.ServerConnection.makeRequest(url, init, settings);\n if (response.status !== 200) {\n const err = await __1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n validate.validateContentsModel(data);\n this._fileChanged.emit({\n type: 'rename',\n oldValue: { path: oldLocalPath },\n newValue: data\n });\n return data;\n }\n /**\n * Save a file.\n *\n * @param localPath - The desired file path.\n *\n * @param options - Optional overrides to the model.\n *\n * @returns A promise which resolves with the file content model when the\n * file is saved.\n *\n * #### Notes\n * Ensure that `model.content` is populated for the file.\n *\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.\n */\n async save(localPath, options = {}) {\n const settings = this.serverSettings;\n const url = this._getUrl(localPath);\n const init = {\n method: 'PUT',\n body: JSON.stringify(options)\n };\n const response = await __1.ServerConnection.makeRequest(url, init, settings);\n // will return 200 for an existing file and 201 for a new file\n if (response.status !== 200 && response.status !== 201) {\n const err = await __1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n validate.validateContentsModel(data);\n this._fileChanged.emit({\n type: 'save',\n oldValue: null,\n newValue: data\n });\n return data;\n }\n /**\n * Copy a file into a given directory.\n *\n * @param localPath - The original file path.\n *\n * @param toDir - The destination directory path.\n *\n * @returns A promise which resolves with the new contents model when the\n * file is copied.\n *\n * #### Notes\n * The server will select the name of the copied file.\n *\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.\n */\n async copy(fromFile, toDir) {\n const settings = this.serverSettings;\n const url = this._getUrl(toDir);\n const init = {\n method: 'POST',\n body: JSON.stringify({ copy_from: fromFile })\n };\n const response = await __1.ServerConnection.makeRequest(url, init, settings);\n if (response.status !== 201) {\n const err = await __1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n validate.validateContentsModel(data);\n this._fileChanged.emit({\n type: 'new',\n oldValue: null,\n newValue: data\n });\n return data;\n }\n /**\n * Create a checkpoint for a file.\n *\n * @param localPath - The path of the file.\n *\n * @returns A promise which resolves with the new checkpoint model when the\n * checkpoint is created.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.\n */\n async createCheckpoint(localPath) {\n const url = this._getUrl(localPath, 'checkpoints');\n const init = { method: 'POST' };\n const response = await __1.ServerConnection.makeRequest(url, init, this.serverSettings);\n if (response.status !== 201) {\n const err = await __1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n validate.validateCheckpointModel(data);\n return data;\n }\n /**\n * List available checkpoints for a file.\n *\n * @param localPath - The path of the file.\n *\n * @returns A promise which resolves with a list of checkpoint models for\n * the file.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.\n */\n async listCheckpoints(localPath) {\n const url = this._getUrl(localPath, 'checkpoints');\n const response = await __1.ServerConnection.makeRequest(url, {}, this.serverSettings);\n if (response.status !== 200) {\n const err = await __1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n if (!Array.isArray(data)) {\n throw new Error('Invalid Checkpoint list');\n }\n for (let i = 0; i < data.length; i++) {\n validate.validateCheckpointModel(data[i]);\n }\n return data;\n }\n /**\n * Restore a file to a known checkpoint state.\n *\n * @param localPath - The path of the file.\n *\n * @param checkpointID - The id of the checkpoint to restore.\n *\n * @returns A promise which resolves when the checkpoint is restored.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents).\n */\n async restoreCheckpoint(localPath, checkpointID) {\n const url = this._getUrl(localPath, 'checkpoints', checkpointID);\n const init = { method: 'POST' };\n const response = await __1.ServerConnection.makeRequest(url, init, this.serverSettings);\n if (response.status !== 204) {\n const err = await __1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n }\n /**\n * Delete a checkpoint for a file.\n *\n * @param localPath - The path of the file.\n *\n * @param checkpointID - The id of the checkpoint to delete.\n *\n * @returns A promise which resolves when the checkpoint is deleted.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents).\n */\n async deleteCheckpoint(localPath, checkpointID) {\n const url = this._getUrl(localPath, 'checkpoints', checkpointID);\n const init = { method: 'DELETE' };\n const response = await __1.ServerConnection.makeRequest(url, init, this.serverSettings);\n if (response.status !== 204) {\n const err = await __1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n }\n /**\n * Get a REST url for a file given a path.\n */\n _getUrl(...args) {\n const parts = args.map(path => coreutils_1.URLExt.encodeParts(path));\n const baseUrl = this.serverSettings.baseUrl;\n return coreutils_1.URLExt.join(baseUrl, this._apiEndpoint, ...parts);\n }\n}\nexports.Drive = Drive;\n/**\n * A namespace for module private data.\n */\nvar Private;\n(function (Private) {\n /**\n * Normalize a file extension to be of the type `'.foo'`.\n *\n * Adds a leading dot if not present and converts to lower case.\n */\n function normalizeExtension(extension) {\n if (extension.length > 0 && extension.indexOf('.') !== 0) {\n extension = `.${extension}`;\n }\n return extension;\n }\n Private.normalizeExtension = normalizeExtension;\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateCheckpointModel = exports.validateContentsModel = void 0;\nconst validate_1 = require(\"../validate\");\n/**\n * Validate an `Contents.IModel` object.\n */\nfunction validateContentsModel(model) {\n (0, validate_1.validateProperty)(model, 'name', 'string');\n (0, validate_1.validateProperty)(model, 'path', 'string');\n (0, validate_1.validateProperty)(model, 'type', 'string');\n (0, validate_1.validateProperty)(model, 'created', 'string');\n (0, validate_1.validateProperty)(model, 'last_modified', 'string');\n (0, validate_1.validateProperty)(model, 'mimetype', 'object');\n (0, validate_1.validateProperty)(model, 'content', 'object');\n (0, validate_1.validateProperty)(model, 'format', 'object');\n}\nexports.validateContentsModel = validateContentsModel;\n/**\n * Validate an `Contents.ICheckpointModel` object.\n */\nfunction validateCheckpointModel(model) {\n (0, validate_1.validateProperty)(model, 'id', 'string');\n (0, validate_1.validateProperty)(model, 'last_modified', 'string');\n}\nexports.validateCheckpointModel = validateCheckpointModel;\n//# sourceMappingURL=validate.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EventManager = void 0;\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\nconst polling_1 = require(\"@lumino/polling\");\nconst signaling_1 = require(\"@lumino/signaling\");\nconst serverconnection_1 = require(\"../serverconnection\");\n/**\n * The url for the jupyter-server events service.\n */\nconst SERVICE_EVENTS_URL = 'api/events';\n/**\n * The events API service manager.\n */\nclass EventManager {\n /**\n * Create a new event manager.\n */\n constructor(options = {}) {\n var _a;\n this._socket = null;\n this.serverSettings =\n (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();\n // If subscription fails, the poll attempts to reconnect and backs off.\n this._poll = new polling_1.Poll({ factory: () => this._subscribe() });\n this._stream = new signaling_1.Stream(this);\n // Subscribe to the events socket.\n void this._poll.start();\n }\n /**\n * Whether the event manager is disposed.\n */\n get isDisposed() {\n return this._poll.isDisposed;\n }\n /**\n * An event stream that emits and yields each new event.\n */\n get stream() {\n return this._stream;\n }\n /**\n * Dispose the event manager.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n // Clean up poll.\n this._poll.dispose();\n // Clean up socket.\n const socket = this._socket;\n if (socket) {\n this._socket = null;\n socket.onopen = () => undefined;\n socket.onerror = () => undefined;\n socket.onmessage = () => undefined;\n socket.onclose = () => undefined;\n socket.close();\n }\n // Clean up stream.\n signaling_1.Signal.clearData(this);\n this._stream.stop();\n }\n /**\n * Post an event request to be emitted by the event bus.\n */\n async emit(event) {\n const { serverSettings } = this;\n const { baseUrl } = serverSettings;\n const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n const url = coreutils_1.URLExt.join(baseUrl, SERVICE_EVENTS_URL);\n const init = { body: JSON.stringify(event), method: 'POST' };\n const response = await makeRequest(url, init, serverSettings);\n if (response.status !== 204) {\n throw new ResponseError(response);\n }\n }\n /**\n * Subscribe to event bus emissions.\n */\n _subscribe() {\n return new Promise((_, reject) => {\n if (this.isDisposed) {\n return;\n }\n const { appendToken, token, WebSocket, wsUrl } = this.serverSettings;\n let url = coreutils_1.URLExt.join(wsUrl, SERVICE_EVENTS_URL, 'subscribe');\n if (appendToken && token !== '') {\n url += `?token=${encodeURIComponent(token)}`;\n }\n const socket = (this._socket = new WebSocket(url));\n const stream = this._stream;\n socket.onclose = () => reject(new Error('EventManager socket closed'));\n socket.onmessage = msg => msg.data && stream.emit(JSON.parse(msg.data));\n });\n }\n}\nexports.EventManager = EventManager;\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module services\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./basemanager\"), exports);\n__exportStar(require(\"./config\"), exports);\n__exportStar(require(\"./contents\"), exports);\n__exportStar(require(\"./event\"), exports);\n__exportStar(require(\"./kernel\"), exports);\n__exportStar(require(\"./kernelspec\"), exports);\n__exportStar(require(\"./manager\"), exports);\n__exportStar(require(\"./serverconnection\"), exports);\n__exportStar(require(\"./session\"), exports);\n__exportStar(require(\"./setting\"), exports);\n__exportStar(require(\"./terminal\"), exports);\n__exportStar(require(\"./user\"), exports);\n__exportStar(require(\"./workspace\"), exports);\n__exportStar(require(\"./nbconvert\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommHandler = void 0;\nconst disposable_1 = require(\"@lumino/disposable\");\nconst KernelMessage = __importStar(require(\"./messages\"));\n/**\n * Comm channel handler.\n */\nclass CommHandler extends disposable_1.DisposableDelegate {\n /**\n * Construct a new comm channel.\n */\n constructor(target, id, kernel, disposeCb) {\n super(disposeCb);\n this._target = '';\n this._id = '';\n this._id = id;\n this._target = target;\n this._kernel = kernel;\n }\n /**\n * The unique id for the comm channel.\n */\n get commId() {\n return this._id;\n }\n /**\n * The target name for the comm channel.\n */\n get targetName() {\n return this._target;\n }\n /**\n * Get the callback for a comm close event.\n *\n * #### Notes\n * This is called when the comm is closed from either the server or client.\n *\n * **See also:** [[ICommClose]], [[close]]\n */\n get onClose() {\n return this._onClose;\n }\n /**\n * Set the callback for a comm close event.\n *\n * #### Notes\n * This is called when the comm is closed from either the server or client. If\n * the function returns a promise, and the kernel was closed from the server,\n * kernel message processing will pause until the returned promise is\n * fulfilled.\n *\n * **See also:** [[close]]\n */\n set onClose(cb) {\n this._onClose = cb;\n }\n /**\n * Get the callback for a comm message received event.\n */\n get onMsg() {\n return this._onMsg;\n }\n /**\n * Set the callback for a comm message received event.\n *\n * #### Notes\n * This is called when a comm message is received. If the function returns a\n * promise, kernel message processing will pause until it is fulfilled.\n */\n set onMsg(cb) {\n this._onMsg = cb;\n }\n /**\n * Open a comm with optional data and metadata.\n *\n * #### Notes\n * This sends a `comm_open` message to the server.\n *\n * **See also:** [[ICommOpen]]\n */\n open(data, metadata, buffers = []) {\n if (this.isDisposed || this._kernel.isDisposed) {\n throw new Error('Cannot open');\n }\n const msg = KernelMessage.createMessage({\n msgType: 'comm_open',\n channel: 'shell',\n username: this._kernel.username,\n session: this._kernel.clientId,\n content: {\n comm_id: this._id,\n target_name: this._target,\n data: data !== null && data !== void 0 ? data : {}\n },\n metadata,\n buffers\n });\n return this._kernel.sendShellMessage(msg, false, true);\n }\n /**\n * Send a `comm_msg` message to the kernel.\n *\n * #### Notes\n * This is a no-op if the comm has been closed.\n *\n * **See also:** [[ICommMsg]]\n */\n send(data, metadata, buffers = [], disposeOnDone = true) {\n if (this.isDisposed || this._kernel.isDisposed) {\n throw new Error('Cannot send');\n }\n const msg = KernelMessage.createMessage({\n msgType: 'comm_msg',\n channel: 'shell',\n username: this._kernel.username,\n session: this._kernel.clientId,\n content: {\n comm_id: this._id,\n data: data\n },\n metadata,\n buffers\n });\n return this._kernel.sendShellMessage(msg, false, disposeOnDone);\n }\n /**\n * Close the comm.\n *\n * #### Notes\n * This will send a `comm_close` message to the kernel, and call the\n * `onClose` callback if set.\n *\n * This is a no-op if the comm is already closed.\n *\n * **See also:** [[ICommClose]], [[onClose]]\n */\n close(data, metadata, buffers = []) {\n if (this.isDisposed || this._kernel.isDisposed) {\n throw new Error('Cannot close');\n }\n const msg = KernelMessage.createMessage({\n msgType: 'comm_close',\n channel: 'shell',\n username: this._kernel.username,\n session: this._kernel.clientId,\n content: {\n comm_id: this._id,\n data: data !== null && data !== void 0 ? data : {}\n },\n metadata,\n buffers\n });\n const future = this._kernel.sendShellMessage(msg, false, true);\n const onClose = this._onClose;\n if (onClose) {\n const ioMsg = KernelMessage.createMessage({\n msgType: 'comm_close',\n channel: 'iopub',\n username: this._kernel.username,\n session: this._kernel.clientId,\n content: {\n comm_id: this._id,\n data: data !== null && data !== void 0 ? data : {}\n },\n metadata,\n buffers\n });\n // In the future, we may want to communicate back to the user the possible\n // promise returned from onClose.\n void onClose(ioMsg);\n }\n this.dispose();\n return future;\n }\n}\nexports.CommHandler = CommHandler;\n//# sourceMappingURL=comm.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.KernelConnection = void 0;\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\nconst coreutils_2 = require(\"@lumino/coreutils\");\nconst signaling_1 = require(\"@lumino/signaling\");\nconst __1 = require(\"..\");\nconst comm_1 = require(\"./comm\");\nconst KernelMessage = __importStar(require(\"./messages\"));\nconst future_1 = require(\"./future\");\nconst validate = __importStar(require(\"./validate\"));\nconst kernelspec_1 = require(\"../kernelspec\");\nconst restapi = __importStar(require(\"./restapi\"));\nconst KERNEL_INFO_TIMEOUT = 3000;\nconst RESTARTING_KERNEL_SESSION = '_RESTARTING_';\nconst STARTING_KERNEL_SESSION = '';\n/**\n * Implementation of the Kernel object.\n *\n * #### Notes\n * Messages from the server are handled in the order they were received and\n * asynchronously. Any message handler can return a promise, and message\n * handling will pause until the promise is fulfilled.\n */\nclass KernelConnection {\n /**\n * Construct a kernel object.\n */\n constructor(options) {\n var _a, _b, _c, _d;\n /**\n * Create the kernel websocket connection and add socket status handlers.\n */\n this._createSocket = (useProtocols = true) => {\n this._errorIfDisposed();\n // Make sure the socket is clear\n this._clearSocket();\n // Update the connection status to reflect opening a new connection.\n this._updateConnectionStatus('connecting');\n const settings = this.serverSettings;\n const partialUrl = coreutils_1.URLExt.join(settings.wsUrl, restapi.KERNEL_SERVICE_URL, encodeURIComponent(this._id));\n // Strip any authentication from the display string.\n const display = partialUrl.replace(/^((?:\\w+:)?\\/\\/)(?:[^@\\/]+@)/, '$1');\n console.debug(`Starting WebSocket: ${display}`);\n let url = coreutils_1.URLExt.join(partialUrl, 'channels?session_id=' + encodeURIComponent(this._clientId));\n // If token authentication is in use.\n const token = settings.token;\n if (settings.appendToken && token !== '') {\n url = url + `&token=${encodeURIComponent(token)}`;\n }\n // Try opening the websocket with our list of subprotocols.\n // If the server doesn't handle subprotocols,\n // the accepted protocol will be ''.\n // But we cannot send '' as a subprotocol, so if connection fails,\n // reconnect without subprotocols.\n const supportedProtocols = useProtocols ? this._supportedProtocols : [];\n this._ws = new settings.WebSocket(url, supportedProtocols);\n // Ensure incoming binary messages are not Blobs\n this._ws.binaryType = 'arraybuffer';\n let alreadyCalledOnclose = false;\n const getKernelModel = async (evt) => {\n var _a, _b;\n if (this._isDisposed) {\n return;\n }\n this._reason = '';\n this._model = undefined;\n try {\n const model = await restapi.getKernelModel(this._id, settings);\n this._model = model;\n if ((model === null || model === void 0 ? void 0 : model.execution_state) === 'dead') {\n this._updateStatus('dead');\n }\n else {\n this._onWSClose(evt);\n }\n }\n catch (err) {\n // Try again, if there is a network failure\n // Handle network errors, as well as cases where we are on a\n // JupyterHub and the server is not running. JupyterHub returns a\n // 503 (<2.0) or 424 (>2.0) in that case.\n if (err instanceof __1.ServerConnection.NetworkError ||\n ((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 503 ||\n ((_b = err.response) === null || _b === void 0 ? void 0 : _b.status) === 424) {\n const timeout = Private.getRandomIntInclusive(10, 30) * 1e3;\n setTimeout(getKernelModel, timeout, evt);\n }\n else {\n this._reason = 'Kernel died unexpectedly';\n this._updateStatus('dead');\n }\n }\n return;\n };\n const earlyClose = async (evt) => {\n // If the websocket was closed early, that could mean\n // that the kernel is actually dead. Try getting\n // information about the kernel from the API call,\n // if that fails, then assume the kernel is dead,\n // otherwise just follow the typical websocket closed\n // protocol.\n if (alreadyCalledOnclose) {\n return;\n }\n alreadyCalledOnclose = true;\n await getKernelModel(evt);\n return;\n };\n this._ws.onmessage = this._onWSMessage;\n this._ws.onopen = this._onWSOpen;\n this._ws.onclose = earlyClose;\n this._ws.onerror = earlyClose;\n };\n // Make websocket callbacks arrow functions so they bind `this`.\n /**\n * Handle a websocket open event.\n */\n this._onWSOpen = (evt) => {\n if (this._ws.protocol !== '' &&\n !this._supportedProtocols.includes(this._ws.protocol)) {\n console.log('Server selected unknown kernel wire protocol:', this._ws.protocol);\n this._updateStatus('dead');\n throw new Error(`Unknown kernel wire protocol: ${this._ws.protocol}`);\n }\n // Remember the kernel wire protocol selected by the server.\n this._selectedProtocol = this._ws.protocol;\n this._ws.onclose = this._onWSClose;\n this._ws.onerror = this._onWSClose;\n this._updateConnectionStatus('connected');\n };\n /**\n * Handle a websocket message, validating and routing appropriately.\n */\n this._onWSMessage = (evt) => {\n // Notify immediately if there is an error with the message.\n let msg;\n try {\n msg = this.serverSettings.serializer.deserialize(evt.data, this._ws.protocol);\n validate.validateMessage(msg);\n }\n catch (error) {\n error.message = `Kernel message validation error: ${error.message}`;\n // We throw the error so that it bubbles up to the top, and displays the right stack.\n throw error;\n }\n // Update the current kernel session id\n this._kernelSession = msg.header.session;\n // Handle the message asynchronously, in the order received.\n this._msgChain = this._msgChain\n .then(() => {\n // Return so that any promises from handling a message are fulfilled\n // before proceeding to the next message.\n return this._handleMessage(msg);\n })\n .catch(error => {\n // Log any errors in handling the message, thus resetting the _msgChain\n // promise so we can process more messages.\n // Ignore the \"Canceled\" errors that are thrown during kernel dispose.\n if (error.message.startsWith('Canceled future for ')) {\n console.error(error);\n }\n });\n // Emit the message receive signal\n this._anyMessage.emit({ msg, direction: 'recv' });\n };\n /**\n * Handle a websocket close event.\n */\n this._onWSClose = (evt) => {\n if (!this.isDisposed) {\n this._reconnect();\n }\n };\n this._id = '';\n this._name = '';\n this._status = 'unknown';\n this._connectionStatus = 'connecting';\n this._kernelSession = '';\n this._isDisposed = false;\n /**\n * Websocket to communicate with kernel.\n */\n this._ws = null;\n this._username = '';\n this._reconnectLimit = 7;\n this._reconnectAttempt = 0;\n this._reconnectTimeout = null;\n this._supportedProtocols = Object.values(KernelMessage.supportedKernelWebSocketProtocols);\n this._selectedProtocol = '';\n this._futures = new Map();\n this._comms = new Map();\n this._targetRegistry = Object.create(null);\n this._info = new coreutils_2.PromiseDelegate();\n this._pendingMessages = [];\n this._statusChanged = new signaling_1.Signal(this);\n this._connectionStatusChanged = new signaling_1.Signal(this);\n this._disposed = new signaling_1.Signal(this);\n this._iopubMessage = new signaling_1.Signal(this);\n this._anyMessage = new signaling_1.Signal(this);\n this._pendingInput = new signaling_1.Signal(this);\n this._unhandledMessage = new signaling_1.Signal(this);\n this._displayIdToParentIds = new Map();\n this._msgIdToDisplayIds = new Map();\n this._msgChain = Promise.resolve();\n this._hasPendingInput = false;\n this._reason = '';\n this._noOp = () => {\n /* no-op */\n };\n this._name = options.model.name;\n this._id = options.model.id;\n this.serverSettings =\n (_a = options.serverSettings) !== null && _a !== void 0 ? _a : __1.ServerConnection.makeSettings();\n this._clientId = (_b = options.clientId) !== null && _b !== void 0 ? _b : coreutils_2.UUID.uuid4();\n this._username = (_c = options.username) !== null && _c !== void 0 ? _c : '';\n this.handleComms = (_d = options.handleComms) !== null && _d !== void 0 ? _d : true;\n this._createSocket();\n }\n get disposed() {\n return this._disposed;\n }\n /**\n * A signal emitted when the kernel status changes.\n */\n get statusChanged() {\n return this._statusChanged;\n }\n /**\n * A signal emitted when the kernel status changes.\n */\n get connectionStatusChanged() {\n return this._connectionStatusChanged;\n }\n /**\n * A signal emitted for iopub kernel messages.\n *\n * #### Notes\n * This signal is emitted after the iopub message is handled asynchronously.\n */\n get iopubMessage() {\n return this._iopubMessage;\n }\n /**\n * A signal emitted for unhandled kernel message.\n *\n * #### Notes\n * This signal is emitted for a message that was not handled. It is emitted\n * during the asynchronous message handling code.\n */\n get unhandledMessage() {\n return this._unhandledMessage;\n }\n /**\n * The kernel model\n */\n get model() {\n return (this._model || {\n id: this.id,\n name: this.name,\n reason: this._reason\n });\n }\n /**\n * A signal emitted for any kernel message.\n *\n * #### Notes\n * This signal is emitted when a message is received, before it is handled\n * asynchronously.\n *\n * This message is emitted when a message is queued for sending (either in\n * the websocket buffer, or our own pending message buffer). The message may\n * actually be sent across the wire at a later time.\n *\n * The message emitted in this signal should not be modified in any way.\n */\n get anyMessage() {\n return this._anyMessage;\n }\n /**\n * A signal emitted when a kernel has pending inputs from the user.\n */\n get pendingInput() {\n return this._pendingInput;\n }\n /**\n * The id of the server-side kernel.\n */\n get id() {\n return this._id;\n }\n /**\n * The name of the server-side kernel.\n */\n get name() {\n return this._name;\n }\n /**\n * The client username.\n */\n get username() {\n return this._username;\n }\n /**\n * The client unique id.\n */\n get clientId() {\n return this._clientId;\n }\n /**\n * The current status of the kernel.\n */\n get status() {\n return this._status;\n }\n /**\n * The current connection status of the kernel connection.\n */\n get connectionStatus() {\n return this._connectionStatus;\n }\n /**\n * Test whether the kernel has been disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * The cached kernel info.\n *\n * @returns A promise that resolves to the kernel info.\n */\n get info() {\n return this._info.promise;\n }\n /**\n * The kernel spec.\n *\n * @returns A promise that resolves to the kernel spec.\n */\n get spec() {\n if (this._specPromise) {\n return this._specPromise;\n }\n this._specPromise = kernelspec_1.KernelSpecAPI.getSpecs(this.serverSettings).then(specs => {\n return specs.kernelspecs[this._name];\n });\n return this._specPromise;\n }\n /**\n * Clone the current kernel with a new clientId.\n */\n clone(options = {}) {\n return new KernelConnection({\n model: this.model,\n username: this.username,\n serverSettings: this.serverSettings,\n // handleComms defaults to false since that is safer\n handleComms: false,\n ...options\n });\n }\n /**\n * Dispose of the resources held by the kernel.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n this._disposed.emit();\n this._updateConnectionStatus('disconnected');\n this._clearKernelState();\n this._pendingMessages = [];\n this._clearSocket();\n // Clear Lumino signals\n signaling_1.Signal.clearData(this);\n }\n /**\n * Send a shell message to the kernel.\n *\n * #### Notes\n * Send a message to the kernel's shell channel, yielding a future object\n * for accepting replies.\n *\n * If `expectReply` is given and `true`, the future is disposed when both a\n * shell reply and an idle status message are received. If `expectReply`\n * is not given or is `false`, the future is resolved when an idle status\n * message is received.\n * If `disposeOnDone` is not given or is `true`, the Future is disposed at this point.\n * If `disposeOnDone` is given and `false`, it is up to the caller to dispose of the Future.\n *\n * All replies are validated as valid kernel messages.\n *\n * If the kernel status is `dead`, this will throw an error.\n */\n sendShellMessage(msg, expectReply = false, disposeOnDone = true) {\n return this._sendKernelShellControl(future_1.KernelShellFutureHandler, msg, expectReply, disposeOnDone);\n }\n /**\n * Send a control message to the kernel.\n *\n * #### Notes\n * Send a message to the kernel's control channel, yielding a future object\n * for accepting replies.\n *\n * If `expectReply` is given and `true`, the future is disposed when both a\n * control reply and an idle status message are received. If `expectReply`\n * is not given or is `false`, the future is resolved when an idle status\n * message is received.\n * If `disposeOnDone` is not given or is `true`, the Future is disposed at this point.\n * If `disposeOnDone` is given and `false`, it is up to the caller to dispose of the Future.\n *\n * All replies are validated as valid kernel messages.\n *\n * If the kernel status is `dead`, this will throw an error.\n */\n sendControlMessage(msg, expectReply = false, disposeOnDone = true) {\n return this._sendKernelShellControl(future_1.KernelControlFutureHandler, msg, expectReply, disposeOnDone);\n }\n _sendKernelShellControl(ctor, msg, expectReply = false, disposeOnDone = true) {\n this._sendMessage(msg);\n this._anyMessage.emit({ msg, direction: 'send' });\n const future = new ctor(() => {\n const msgId = msg.header.msg_id;\n this._futures.delete(msgId);\n // Remove stored display id information.\n const displayIds = this._msgIdToDisplayIds.get(msgId);\n if (!displayIds) {\n return;\n }\n displayIds.forEach(displayId => {\n const msgIds = this._displayIdToParentIds.get(displayId);\n if (msgIds) {\n const idx = msgIds.indexOf(msgId);\n if (idx === -1) {\n return;\n }\n if (msgIds.length === 1) {\n this._displayIdToParentIds.delete(displayId);\n }\n else {\n msgIds.splice(idx, 1);\n this._displayIdToParentIds.set(displayId, msgIds);\n }\n }\n });\n this._msgIdToDisplayIds.delete(msgId);\n }, msg, expectReply, disposeOnDone, this);\n this._futures.set(msg.header.msg_id, future);\n return future;\n }\n /**\n * Send a message on the websocket.\n *\n * If queue is true, queue the message for later sending if we cannot send\n * now. Otherwise throw an error.\n *\n * #### Notes\n * As an exception to the queueing, if we are sending a kernel_info_request\n * message while we think the kernel is restarting, we send the message\n * immediately without queueing. This is so that we can trigger a message\n * back, which will then clear the kernel restarting state.\n */\n _sendMessage(msg, queue = true) {\n if (this.status === 'dead') {\n throw new Error('Kernel is dead');\n }\n // If we have a kernel_info_request and we are starting or restarting, send the\n // kernel_info_request immediately if we can, and if not throw an error so\n // we can retry later. On restarting we do this because we must get at least one message\n // from the kernel to reset the kernel session (thus clearing the restart\n // status sentinel).\n if ((this._kernelSession === STARTING_KERNEL_SESSION ||\n this._kernelSession === RESTARTING_KERNEL_SESSION) &&\n KernelMessage.isInfoRequestMsg(msg)) {\n if (this.connectionStatus === 'connected') {\n this._ws.send(this.serverSettings.serializer.serialize(msg, this._ws.protocol));\n return;\n }\n else {\n throw new Error('Could not send message: status is not connected');\n }\n }\n // If there are pending messages, add to the queue so we keep messages in order\n if (queue && this._pendingMessages.length > 0) {\n this._pendingMessages.push(msg);\n return;\n }\n // Send if the ws allows it, otherwise queue the message.\n if (this.connectionStatus === 'connected' &&\n this._kernelSession !== RESTARTING_KERNEL_SESSION) {\n this._ws.send(this.serverSettings.serializer.serialize(msg, this._ws.protocol));\n }\n else if (queue) {\n this._pendingMessages.push(msg);\n }\n else {\n throw new Error('Could not send message');\n }\n }\n /**\n * Interrupt a kernel.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels).\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n *\n * It is assumed that the API call does not mutate the kernel id or name.\n *\n * The promise will be rejected if the kernel status is `Dead` or if the\n * request fails or the response is invalid.\n */\n async interrupt() {\n this.hasPendingInput = false;\n if (this.status === 'dead') {\n throw new Error('Kernel is dead');\n }\n return restapi.interruptKernel(this.id, this.serverSettings);\n }\n /**\n * Request a kernel restart.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels)\n * and validates the response model.\n *\n * Any existing Future or Comm objects are cleared once the kernel has\n * actually be restarted.\n *\n * The promise is fulfilled on a valid server response (after the kernel restarts)\n * and rejected otherwise.\n *\n * It is assumed that the API call does not mutate the kernel id or name.\n *\n * The promise will be rejected if the request fails or the response is\n * invalid.\n */\n async restart() {\n if (this.status === 'dead') {\n throw new Error('Kernel is dead');\n }\n this._updateStatus('restarting');\n this._clearKernelState();\n this._kernelSession = RESTARTING_KERNEL_SESSION;\n await restapi.restartKernel(this.id, this.serverSettings);\n // Reconnect to the kernel to address cases where kernel ports\n // have changed during the restart.\n await this.reconnect();\n this.hasPendingInput = false;\n }\n /**\n * Reconnect to a kernel.\n *\n * #### Notes\n * This may try multiple times to reconnect to a kernel, and will sever any\n * existing connection.\n */\n reconnect() {\n this._errorIfDisposed();\n const result = new coreutils_2.PromiseDelegate();\n // Set up a listener for the connection status changing, which accepts or\n // rejects after the retries are done.\n const fulfill = (sender, status) => {\n if (status === 'connected') {\n result.resolve();\n this.connectionStatusChanged.disconnect(fulfill, this);\n }\n else if (status === 'disconnected') {\n result.reject(new Error('Kernel connection disconnected'));\n this.connectionStatusChanged.disconnect(fulfill, this);\n }\n };\n this.connectionStatusChanged.connect(fulfill, this);\n // Reset the reconnect limit so we start the connection attempts fresh\n this._reconnectAttempt = 0;\n // Start the reconnection process, which will also clear any existing\n // connection.\n this._reconnect();\n // Return the promise that should resolve on connection or reject if the\n // retries don't work.\n return result.promise;\n }\n /**\n * Shutdown a kernel.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels).\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n *\n * On a valid response, disposes this kernel connection.\n *\n * If the kernel is already `dead`, disposes this kernel connection without\n * a server request.\n */\n async shutdown() {\n if (this.status !== 'dead') {\n await restapi.shutdownKernel(this.id, this.serverSettings);\n }\n this.handleShutdown();\n }\n /**\n * Handles a kernel shutdown.\n *\n * #### Notes\n * This method should be called if we know from outside information that a\n * kernel is dead (for example, we cannot find the kernel model on the\n * server).\n */\n handleShutdown() {\n this._updateStatus('dead');\n this.dispose();\n }\n /**\n * Send a `kernel_info_request` message.\n *\n * #### Notes\n * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#kernel-info).\n *\n * Fulfills with the `kernel_info_response` content when the shell reply is\n * received and validated.\n */\n async requestKernelInfo() {\n const msg = KernelMessage.createMessage({\n msgType: 'kernel_info_request',\n channel: 'shell',\n username: this._username,\n session: this._clientId,\n content: {}\n });\n let reply;\n try {\n reply = (await Private.handleShellMessage(this, msg));\n }\n catch (e) {\n // If we rejected because the future was disposed, ignore and return.\n if (this.isDisposed) {\n return;\n }\n else {\n throw e;\n }\n }\n this._errorIfDisposed();\n if (!reply) {\n return;\n }\n // Kernels sometimes do not include a status field on kernel_info_reply\n // messages, so set a default for now.\n // See https://github.com/jupyterlab/jupyterlab/issues/6760\n if (reply.content.status === undefined) {\n reply.content.status = 'ok';\n }\n if (reply.content.status !== 'ok') {\n this._info.reject('Kernel info reply errored');\n return reply;\n }\n this._info.resolve(reply.content);\n this._kernelSession = reply.header.session;\n return reply;\n }\n /**\n * Send a `complete_request` message.\n *\n * #### Notes\n * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#completion).\n *\n * Fulfills with the `complete_reply` content when the shell reply is\n * received and validated.\n */\n requestComplete(content) {\n const msg = KernelMessage.createMessage({\n msgType: 'complete_request',\n channel: 'shell',\n username: this._username,\n session: this._clientId,\n content\n });\n return Private.handleShellMessage(this, msg);\n }\n /**\n * Send an `inspect_request` message.\n *\n * #### Notes\n * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#introspection).\n *\n * Fulfills with the `inspect_reply` content when the shell reply is\n * received and validated.\n */\n requestInspect(content) {\n const msg = KernelMessage.createMessage({\n msgType: 'inspect_request',\n channel: 'shell',\n username: this._username,\n session: this._clientId,\n content: content\n });\n return Private.handleShellMessage(this, msg);\n }\n /**\n * Send a `history_request` message.\n *\n * #### Notes\n * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#history).\n *\n * Fulfills with the `history_reply` content when the shell reply is\n * received and validated.\n */\n requestHistory(content) {\n const msg = KernelMessage.createMessage({\n msgType: 'history_request',\n channel: 'shell',\n username: this._username,\n session: this._clientId,\n content\n });\n return Private.handleShellMessage(this, msg);\n }\n /**\n * Send an `execute_request` message.\n *\n * #### Notes\n * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#execute).\n *\n * Future `onReply` is called with the `execute_reply` content when the\n * shell reply is received and validated. The future will resolve when\n * this message is received and the `idle` iopub status is received.\n * The future will also be disposed at this point unless `disposeOnDone`\n * is specified and `false`, in which case it is up to the caller to dispose\n * of the future.\n *\n * **See also:** [[IExecuteReply]]\n */\n requestExecute(content, disposeOnDone = true, metadata) {\n const defaults = {\n silent: false,\n store_history: true,\n user_expressions: {},\n allow_stdin: true,\n stop_on_error: false\n };\n const msg = KernelMessage.createMessage({\n msgType: 'execute_request',\n channel: 'shell',\n username: this._username,\n session: this._clientId,\n content: { ...defaults, ...content },\n metadata\n });\n return this.sendShellMessage(msg, true, disposeOnDone);\n }\n /**\n * Send an experimental `debug_request` message.\n *\n * @hidden\n *\n * #### Notes\n * Debug messages are experimental messages that are not in the official\n * kernel message specification. As such, this function is *NOT* considered\n * part of the public API, and may change without notice.\n */\n requestDebug(content, disposeOnDone = true) {\n const msg = KernelMessage.createMessage({\n msgType: 'debug_request',\n channel: 'control',\n username: this._username,\n session: this._clientId,\n content\n });\n return this.sendControlMessage(msg, true, disposeOnDone);\n }\n /**\n * Send an `is_complete_request` message.\n *\n * #### Notes\n * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#code-completeness).\n *\n * Fulfills with the `is_complete_response` content when the shell reply is\n * received and validated.\n */\n requestIsComplete(content) {\n const msg = KernelMessage.createMessage({\n msgType: 'is_complete_request',\n channel: 'shell',\n username: this._username,\n session: this._clientId,\n content\n });\n return Private.handleShellMessage(this, msg);\n }\n /**\n * Send a `comm_info_request` message.\n *\n * #### Notes\n * Fulfills with the `comm_info_reply` content when the shell reply is\n * received and validated.\n */\n requestCommInfo(content) {\n const msg = KernelMessage.createMessage({\n msgType: 'comm_info_request',\n channel: 'shell',\n username: this._username,\n session: this._clientId,\n content\n });\n return Private.handleShellMessage(this, msg);\n }\n /**\n * Send an `input_reply` message.\n *\n * #### Notes\n * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#messages-on-the-stdin-router-dealer-sockets).\n */\n sendInputReply(content, parent_header) {\n const msg = KernelMessage.createMessage({\n msgType: 'input_reply',\n channel: 'stdin',\n username: this._username,\n session: this._clientId,\n content\n });\n msg.parent_header = parent_header;\n this._sendMessage(msg);\n this._anyMessage.emit({ msg, direction: 'send' });\n this.hasPendingInput = false;\n }\n /**\n * Create a new comm.\n *\n * #### Notes\n * If a client-side comm already exists with the given commId, an error is thrown.\n * If the kernel does not handle comms, an error is thrown.\n */\n createComm(targetName, commId = coreutils_2.UUID.uuid4()) {\n if (!this.handleComms) {\n throw new Error('Comms are disabled on this kernel connection');\n }\n if (this._comms.has(commId)) {\n throw new Error('Comm is already created');\n }\n const comm = new comm_1.CommHandler(targetName, commId, this, () => {\n this._unregisterComm(commId);\n });\n this._comms.set(commId, comm);\n return comm;\n }\n /**\n * Check if a comm exists.\n */\n hasComm(commId) {\n return this._comms.has(commId);\n }\n /**\n * Register a comm target handler.\n *\n * @param targetName - The name of the comm target.\n *\n * @param callback - The callback invoked for a comm open message.\n *\n * @returns A disposable used to unregister the comm target.\n *\n * #### Notes\n * Only one comm target can be registered to a target name at a time, an\n * existing callback for the same target name will be overridden. A registered\n * comm target handler will take precedence over a comm which specifies a\n * `target_module`.\n *\n * If the callback returns a promise, kernel message processing will pause\n * until the returned promise is fulfilled.\n */\n registerCommTarget(targetName, callback) {\n if (!this.handleComms) {\n return;\n }\n this._targetRegistry[targetName] = callback;\n }\n /**\n * Remove a comm target handler.\n *\n * @param targetName - The name of the comm target to remove.\n *\n * @param callback - The callback to remove.\n *\n * #### Notes\n * The comm target is only removed if the callback argument matches.\n */\n removeCommTarget(targetName, callback) {\n if (!this.handleComms) {\n return;\n }\n if (!this.isDisposed && this._targetRegistry[targetName] === callback) {\n delete this._targetRegistry[targetName];\n }\n }\n /**\n * Register an IOPub message hook.\n *\n * @param msg_id - The parent_header message id the hook will intercept.\n *\n * @param hook - The callback invoked for the message.\n *\n * #### Notes\n * The IOPub hook system allows you to preempt the handlers for IOPub\n * messages that are responses to a given message id.\n *\n * The most recently registered hook is run first. A hook can return a\n * boolean or a promise to a boolean, in which case all kernel message\n * processing pauses until the promise is fulfilled. If a hook return value\n * resolves to false, any later hooks will not run and the function will\n * return a promise resolving to false. If a hook throws an error, the error\n * is logged to the console and the next hook is run. If a hook is\n * registered during the hook processing, it will not run until the next\n * message. If a hook is removed during the hook processing, it will be\n * deactivated immediately.\n *\n * See also [[IFuture.registerMessageHook]].\n */\n registerMessageHook(msgId, hook) {\n var _a;\n const future = (_a = this._futures) === null || _a === void 0 ? void 0 : _a.get(msgId);\n if (future) {\n future.registerMessageHook(hook);\n }\n }\n /**\n * Remove an IOPub message hook.\n *\n * @param msg_id - The parent_header message id the hook intercepted.\n *\n * @param hook - The callback invoked for the message.\n *\n */\n removeMessageHook(msgId, hook) {\n var _a;\n const future = (_a = this._futures) === null || _a === void 0 ? void 0 : _a.get(msgId);\n if (future) {\n future.removeMessageHook(hook);\n }\n }\n /**\n * Remove the input guard, if any.\n */\n removeInputGuard() {\n this.hasPendingInput = false;\n }\n /**\n * Handle a message with a display id.\n *\n * @returns Whether the message was handled.\n */\n async _handleDisplayId(displayId, msg) {\n var _a, _b;\n const msgId = msg.parent_header.msg_id;\n let parentIds = this._displayIdToParentIds.get(displayId);\n if (parentIds) {\n // We've seen it before, update existing outputs with same display_id\n // by handling display_data as update_display_data.\n const updateMsg = {\n header: coreutils_2.JSONExt.deepCopy(msg.header),\n parent_header: coreutils_2.JSONExt.deepCopy(msg.parent_header),\n metadata: coreutils_2.JSONExt.deepCopy(msg.metadata),\n content: coreutils_2.JSONExt.deepCopy(msg.content),\n channel: msg.channel,\n buffers: msg.buffers ? msg.buffers.slice() : []\n };\n updateMsg.header.msg_type = 'update_display_data';\n await Promise.all(parentIds.map(async (parentId) => {\n const future = this._futures && this._futures.get(parentId);\n if (future) {\n await future.handleMsg(updateMsg);\n }\n }));\n }\n // We're done here if it's update_display.\n if (msg.header.msg_type === 'update_display_data') {\n // It's an update, don't proceed to the normal display.\n return true;\n }\n // Regular display_data with id, record it for future updating\n // in _displayIdToParentIds for future lookup.\n parentIds = (_a = this._displayIdToParentIds.get(displayId)) !== null && _a !== void 0 ? _a : [];\n if (parentIds.indexOf(msgId) === -1) {\n parentIds.push(msgId);\n }\n this._displayIdToParentIds.set(displayId, parentIds);\n // Add to our map of display ids for this message.\n const displayIds = (_b = this._msgIdToDisplayIds.get(msgId)) !== null && _b !== void 0 ? _b : [];\n if (displayIds.indexOf(msgId) === -1) {\n displayIds.push(msgId);\n }\n this._msgIdToDisplayIds.set(msgId, displayIds);\n // Let the message propagate to the intended recipient.\n return false;\n }\n /**\n * Forcefully clear the socket state.\n *\n * #### Notes\n * This will clear all socket state without calling any handlers and will\n * not update the connection status. If you call this method, you are\n * responsible for updating the connection status as needed and recreating\n * the socket if you plan to reconnect.\n */\n _clearSocket() {\n if (this._ws !== null) {\n // Clear the websocket event handlers and the socket itself.\n this._ws.onopen = this._noOp;\n this._ws.onclose = this._noOp;\n this._ws.onerror = this._noOp;\n this._ws.onmessage = this._noOp;\n this._ws.close();\n this._ws = null;\n }\n }\n /**\n * Handle status iopub messages from the kernel.\n */\n _updateStatus(status) {\n if (this._status === status || this._status === 'dead') {\n return;\n }\n this._status = status;\n Private.logKernelStatus(this);\n this._statusChanged.emit(status);\n if (status === 'dead') {\n this.dispose();\n }\n }\n /**\n * Send pending messages to the kernel.\n */\n _sendPending() {\n // We check to make sure we are still connected each time. For\n // example, if a websocket buffer overflows, it may close, so we should\n // stop sending messages.\n while (this.connectionStatus === 'connected' &&\n this._kernelSession !== RESTARTING_KERNEL_SESSION &&\n this._pendingMessages.length > 0) {\n this._sendMessage(this._pendingMessages[0], false);\n // We shift the message off the queue after the message is sent so that\n // if there is an exception, the message is still pending.\n this._pendingMessages.shift();\n }\n }\n /**\n * Clear the internal state.\n */\n _clearKernelState() {\n this._kernelSession = '';\n this._pendingMessages = [];\n this._futures.forEach(future => {\n future.dispose();\n });\n this._comms.forEach(comm => {\n comm.dispose();\n });\n this._msgChain = Promise.resolve();\n this._futures = new Map();\n this._comms = new Map();\n this._displayIdToParentIds.clear();\n this._msgIdToDisplayIds.clear();\n }\n /**\n * Check to make sure it is okay to proceed to handle a message.\n *\n * #### Notes\n * Because we handle messages asynchronously, before a message is handled the\n * kernel might be disposed or restarted (and have a different session id).\n * This function throws an error in each of these cases. This is meant to be\n * called at the start of an asynchronous message handler to cancel message\n * processing if the message no longer is valid.\n */\n _assertCurrentMessage(msg) {\n this._errorIfDisposed();\n if (msg.header.session !== this._kernelSession) {\n throw new Error(`Canceling handling of old message: ${msg.header.msg_type}`);\n }\n }\n /**\n * Handle a `comm_open` kernel message.\n */\n async _handleCommOpen(msg) {\n this._assertCurrentMessage(msg);\n const content = msg.content;\n const comm = new comm_1.CommHandler(content.target_name, content.comm_id, this, () => {\n this._unregisterComm(content.comm_id);\n });\n this._comms.set(content.comm_id, comm);\n try {\n const target = await Private.loadObject(content.target_name, content.target_module, this._targetRegistry);\n await target(comm, msg);\n }\n catch (e) {\n // Close the comm asynchronously. We cannot block message processing on\n // kernel messages to wait for another kernel message.\n comm.close();\n console.error('Exception opening new comm');\n throw e;\n }\n }\n /**\n * Handle 'comm_close' kernel message.\n */\n async _handleCommClose(msg) {\n this._assertCurrentMessage(msg);\n const content = msg.content;\n const comm = this._comms.get(content.comm_id);\n if (!comm) {\n console.error('Comm not found for comm id ' + content.comm_id);\n return;\n }\n this._unregisterComm(comm.commId);\n const onClose = comm.onClose;\n if (onClose) {\n // tslint:disable-next-line:await-promise\n await onClose(msg);\n }\n comm.dispose();\n }\n /**\n * Handle a 'comm_msg' kernel message.\n */\n async _handleCommMsg(msg) {\n this._assertCurrentMessage(msg);\n const content = msg.content;\n const comm = this._comms.get(content.comm_id);\n if (!comm) {\n return;\n }\n const onMsg = comm.onMsg;\n if (onMsg) {\n // tslint:disable-next-line:await-promise\n await onMsg(msg);\n }\n }\n /**\n * Unregister a comm instance.\n */\n _unregisterComm(commId) {\n this._comms.delete(commId);\n }\n /**\n * Handle connection status changes.\n */\n _updateConnectionStatus(connectionStatus) {\n if (this._connectionStatus === connectionStatus) {\n return;\n }\n this._connectionStatus = connectionStatus;\n // If we are not 'connecting', reset any reconnection attempts.\n if (connectionStatus !== 'connecting') {\n this._reconnectAttempt = 0;\n clearTimeout(this._reconnectTimeout);\n }\n if (this.status !== 'dead') {\n if (connectionStatus === 'connected') {\n let restarting = this._kernelSession === RESTARTING_KERNEL_SESSION;\n // Send a kernel info request to make sure we send at least one\n // message to get kernel status back. Always request kernel info\n // first, to get kernel status back and ensure iopub is fully\n // established. If we are restarting, this message will skip the queue\n // and be sent immediately.\n let p = this.requestKernelInfo();\n // Send any pending messages after the kernelInfo resolves, or after a\n // timeout as a failsafe.\n let sendPendingCalled = false;\n let sendPendingOnce = () => {\n if (sendPendingCalled) {\n return;\n }\n sendPendingCalled = true;\n if (restarting && this._kernelSession === RESTARTING_KERNEL_SESSION) {\n // We were restarting and a message didn't arrive to set the\n // session, but we just assume the restart succeeded and send any\n // pending messages.\n // FIXME: it would be better to retry the kernel_info_request here\n this._kernelSession = '';\n }\n clearTimeout(timeoutHandle);\n if (this._pendingMessages.length > 0) {\n this._sendPending();\n }\n };\n void p.then(sendPendingOnce);\n // FIXME: if sent while zmq subscriptions are not established,\n // kernelInfo may not resolve, so use a timeout to ensure we don't hang forever.\n // It may be preferable to retry kernelInfo rather than give up after one timeout.\n let timeoutHandle = setTimeout(sendPendingOnce, KERNEL_INFO_TIMEOUT);\n }\n else {\n // If the connection is down, then we do not know what is happening\n // with the kernel, so set the status to unknown.\n this._updateStatus('unknown');\n }\n }\n // Notify others that the connection status changed.\n this._connectionStatusChanged.emit(connectionStatus);\n }\n async _handleMessage(msg) {\n var _a, _b;\n let handled = false;\n // Check to see if we have a display_id we need to reroute.\n if (msg.parent_header &&\n msg.channel === 'iopub' &&\n (KernelMessage.isDisplayDataMsg(msg) ||\n KernelMessage.isUpdateDisplayDataMsg(msg) ||\n KernelMessage.isExecuteResultMsg(msg))) {\n // display_data messages may re-route based on their display_id.\n const transient = ((_a = msg.content.transient) !== null && _a !== void 0 ? _a : {});\n const displayId = transient['display_id'];\n if (displayId) {\n handled = await this._handleDisplayId(displayId, msg);\n // The await above may make this message out of date, so check again.\n this._assertCurrentMessage(msg);\n }\n }\n if (!handled && msg.parent_header) {\n const parentHeader = msg.parent_header;\n const future = (_b = this._futures) === null || _b === void 0 ? void 0 : _b.get(parentHeader.msg_id);\n if (future) {\n await future.handleMsg(msg);\n this._assertCurrentMessage(msg);\n }\n else {\n // If the message was sent by us and was not iopub, it is orphaned.\n const owned = parentHeader.session === this.clientId;\n if (msg.channel !== 'iopub' && owned) {\n this._unhandledMessage.emit(msg);\n }\n }\n }\n if (msg.channel === 'iopub') {\n switch (msg.header.msg_type) {\n case 'status': {\n // Updating the status is synchronous, and we call no async user code\n const executionState = msg.content\n .execution_state;\n if (executionState === 'restarting') {\n // The kernel has been auto-restarted by the server. After\n // processing for this message is completely done, we want to\n // handle this restart, so we don't await, but instead schedule\n // the work as a microtask (i.e., in a promise resolution). We\n // schedule this here so that it comes before any microtasks that\n // might be scheduled in the status signal emission below.\n void Promise.resolve().then(async () => {\n this._updateStatus('autorestarting');\n this._clearKernelState();\n // We must reconnect since the kernel connection information may have\n // changed, and the server only refreshes its zmq connection when a new\n // websocket is opened.\n await this.reconnect();\n });\n }\n this._updateStatus(executionState);\n break;\n }\n case 'comm_open':\n if (this.handleComms) {\n await this._handleCommOpen(msg);\n }\n break;\n case 'comm_msg':\n if (this.handleComms) {\n await this._handleCommMsg(msg);\n }\n break;\n case 'comm_close':\n if (this.handleComms) {\n await this._handleCommClose(msg);\n }\n break;\n default:\n break;\n }\n // If the message was a status dead message, we might have disposed ourselves.\n if (!this.isDisposed) {\n this._assertCurrentMessage(msg);\n // the message wouldn't be emitted if we were disposed anyway.\n this._iopubMessage.emit(msg);\n }\n }\n }\n /**\n * Attempt a connection if we have not exhausted connection attempts.\n */\n _reconnect() {\n this._errorIfDisposed();\n // Clear any existing reconnection attempt\n clearTimeout(this._reconnectTimeout);\n // Update the connection status and schedule a possible reconnection.\n if (this._reconnectAttempt < this._reconnectLimit) {\n this._updateConnectionStatus('connecting');\n // The first reconnect attempt should happen immediately, and subsequent\n // attempts should pick a random number in a growing range so that we\n // don't overload the server with synchronized reconnection attempts\n // across multiple kernels.\n const timeout = Private.getRandomIntInclusive(0, 1e3 * (Math.pow(2, this._reconnectAttempt) - 1));\n console.warn(`Connection lost, reconnecting in ${Math.floor(timeout / 1000)} seconds.`);\n // Try reconnection with subprotocols if the server had supported them.\n // Otherwise, try reconnection without subprotocols.\n const useProtocols = this._selectedProtocol !== '' ? true : false;\n this._reconnectTimeout = setTimeout(this._createSocket, timeout, useProtocols);\n this._reconnectAttempt += 1;\n }\n else {\n this._updateConnectionStatus('disconnected');\n }\n // Clear the websocket event handlers and the socket itself.\n this._clearSocket();\n }\n /**\n * Utility function to throw an error if this instance is disposed.\n */\n _errorIfDisposed() {\n if (this.isDisposed) {\n throw new Error('Kernel connection is disposed');\n }\n }\n get hasPendingInput() {\n return this._hasPendingInput;\n }\n set hasPendingInput(value) {\n this._hasPendingInput = value;\n this._pendingInput.emit(value);\n }\n}\nexports.KernelConnection = KernelConnection;\n/**\n * A private namespace for the Kernel.\n */\nvar Private;\n(function (Private) {\n /**\n * Log the current kernel status.\n */\n function logKernelStatus(kernel) {\n switch (kernel.status) {\n case 'idle':\n case 'busy':\n case 'unknown':\n return;\n default:\n console.debug(`Kernel: ${kernel.status} (${kernel.id})`);\n break;\n }\n }\n Private.logKernelStatus = logKernelStatus;\n /**\n * Send a kernel message to the kernel and resolve the reply message.\n */\n async function handleShellMessage(kernel, msg) {\n const future = kernel.sendShellMessage(msg, true);\n return future.done;\n }\n Private.handleShellMessage = handleShellMessage;\n /**\n * Try to load an object from a module or a registry.\n *\n * Try to load an object from a module asynchronously if a module\n * is specified, otherwise tries to load an object from the global\n * registry, if the global registry is provided.\n *\n * #### Notes\n * Loading a module uses requirejs.\n */\n function loadObject(name, moduleName, registry) {\n return new Promise((resolve, reject) => {\n // Try loading the module using require.js\n if (moduleName) {\n if (typeof requirejs === 'undefined') {\n throw new Error('requirejs not found');\n }\n requirejs([moduleName], (mod) => {\n if (mod[name] === void 0) {\n const msg = `Object '${name}' not found in module '${moduleName}'`;\n reject(new Error(msg));\n }\n else {\n resolve(mod[name]);\n }\n }, reject);\n }\n else {\n if (registry === null || registry === void 0 ? void 0 : registry[name]) {\n resolve(registry[name]);\n }\n else {\n reject(new Error(`Object '${name}' not found in registry`));\n }\n }\n });\n }\n Private.loadObject = loadObject;\n /**\n * Get a random integer between min and max, inclusive of both.\n *\n * #### Notes\n * From\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#Getting_a_random_integer_between_two_values_inclusive\n *\n * From the MDN page: It might be tempting to use Math.round() to accomplish\n * that, but doing so would cause your random numbers to follow a non-uniform\n * distribution, which may not be acceptable for your needs.\n */\n function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }\n Private.getRandomIntInclusive = getRandomIntInclusive;\n})(Private || (Private = {}));\n//# sourceMappingURL=default.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.KernelShellFutureHandler = exports.KernelControlFutureHandler = exports.KernelFutureHandler = void 0;\nconst coreutils_1 = require(\"@lumino/coreutils\");\nconst disposable_1 = require(\"@lumino/disposable\");\nconst KernelMessage = __importStar(require(\"./messages\"));\n/**\n * Implementation of a kernel future.\n *\n * If a reply is expected, the Future is considered done when both a `reply`\n * message and an `idle` iopub status message have been received. Otherwise, it\n * is considered done when the `idle` status is received.\n *\n */\nclass KernelFutureHandler extends disposable_1.DisposableDelegate {\n /**\n * Construct a new KernelFutureHandler.\n */\n constructor(cb, msg, expectReply, disposeOnDone, kernel) {\n super(cb);\n this._status = 0;\n this._stdin = Private.noOp;\n this._iopub = Private.noOp;\n this._reply = Private.noOp;\n this._done = new coreutils_1.PromiseDelegate();\n this._hooks = new Private.HookList();\n this._disposeOnDone = true;\n this._msg = msg;\n if (!expectReply) {\n this._setFlag(Private.KernelFutureFlag.GotReply);\n }\n this._disposeOnDone = disposeOnDone;\n this._kernel = kernel;\n }\n /**\n * Get the original outgoing message.\n */\n get msg() {\n return this._msg;\n }\n /**\n * A promise that resolves when the future is done.\n */\n get done() {\n return this._done.promise;\n }\n /**\n * Get the reply handler.\n */\n get onReply() {\n return this._reply;\n }\n /**\n * Set the reply handler.\n */\n set onReply(cb) {\n this._reply = cb;\n }\n /**\n * Get the iopub handler.\n */\n get onIOPub() {\n return this._iopub;\n }\n /**\n * Set the iopub handler.\n */\n set onIOPub(cb) {\n this._iopub = cb;\n }\n /**\n * Get the stdin handler.\n */\n get onStdin() {\n return this._stdin;\n }\n /**\n * Set the stdin handler.\n */\n set onStdin(cb) {\n this._stdin = cb;\n }\n /**\n * Register hook for IOPub messages.\n *\n * @param hook - The callback invoked for an IOPub message.\n *\n * #### Notes\n * The IOPub hook system allows you to preempt the handlers for IOPub\n * messages handled by the future.\n *\n * The most recently registered hook is run first. A hook can return a\n * boolean or a promise to a boolean, in which case all kernel message\n * processing pauses until the promise is fulfilled. If a hook return value\n * resolves to false, any later hooks will not run and the function will\n * return a promise resolving to false. If a hook throws an error, the error\n * is logged to the console and the next hook is run. If a hook is\n * registered during the hook processing, it will not run until the next\n * message. If a hook is removed during the hook processing, it will be\n * deactivated immediately.\n */\n registerMessageHook(hook) {\n if (this.isDisposed) {\n throw new Error('Kernel future is disposed');\n }\n this._hooks.add(hook);\n }\n /**\n * Remove a hook for IOPub messages.\n *\n * @param hook - The hook to remove.\n *\n * #### Notes\n * If a hook is removed during the hook processing, it will be deactivated immediately.\n */\n removeMessageHook(hook) {\n if (this.isDisposed) {\n return;\n }\n this._hooks.remove(hook);\n }\n /**\n * Send an `input_reply` message.\n */\n sendInputReply(content, parent_header) {\n this._kernel.sendInputReply(content, parent_header);\n }\n /**\n * Dispose and unregister the future.\n */\n dispose() {\n this._stdin = Private.noOp;\n this._iopub = Private.noOp;\n this._reply = Private.noOp;\n this._hooks = null;\n if (!this._testFlag(Private.KernelFutureFlag.IsDone)) {\n // TODO: Uncomment the following logging code, and check for any tests that trigger it.\n // let status = [];\n // if (!this._testFlag(Private.KernelFutureFlag.GotIdle)) {\n // status.push('idle');\n // }\n // if (!this._testFlag(Private.KernelFutureFlag.GotReply)) {\n // status.push('reply');\n // }\n // console.warn(\n // `*************** DISPOSED BEFORE DONE: K${this._kernel.id.slice(\n // 0,\n // 6\n // )} M${this._msg.header.msg_id.slice(0, 6)} missing ${status.join(' ')}`\n // );\n // Reject the `done` promise, but catch its error here in case no one else\n // is waiting for the promise to resolve. This prevents the error from\n // being displayed in the console, but does not prevent it from being\n // caught by a client who is waiting for it.\n // Note: any `.then` and `.finally` attached to the `done` promise\n // will cause the error to be thrown as uncaught anyways.\n this._done.promise.catch(() => {\n /* no-op */\n });\n this._done.reject(new Error(`Canceled future for ${this.msg.header.msg_type} message before replies were done`));\n }\n super.dispose();\n }\n /**\n * Handle an incoming kernel message.\n */\n async handleMsg(msg) {\n switch (msg.channel) {\n case 'control':\n case 'shell':\n if (msg.channel === this.msg.channel &&\n msg.parent_header.msg_id === this.msg.header.msg_id) {\n await this._handleReply(msg);\n }\n break;\n case 'stdin':\n await this._handleStdin(msg);\n break;\n case 'iopub':\n await this._handleIOPub(msg);\n break;\n default:\n break;\n }\n }\n async _handleReply(msg) {\n const reply = this._reply;\n if (reply) {\n // tslint:disable-next-line:await-promise\n await reply(msg);\n }\n this._replyMsg = msg;\n this._setFlag(Private.KernelFutureFlag.GotReply);\n if (this._testFlag(Private.KernelFutureFlag.GotIdle)) {\n this._handleDone();\n }\n }\n async _handleStdin(msg) {\n this._kernel.hasPendingInput = true;\n const stdin = this._stdin;\n if (stdin) {\n // tslint:disable-next-line:await-promise\n await stdin(msg);\n }\n }\n async _handleIOPub(msg) {\n const process = await this._hooks.process(msg);\n const iopub = this._iopub;\n if (process && iopub) {\n // tslint:disable-next-line:await-promise\n await iopub(msg);\n }\n if (KernelMessage.isStatusMsg(msg) &&\n msg.content.execution_state === 'idle') {\n this._setFlag(Private.KernelFutureFlag.GotIdle);\n if (this._testFlag(Private.KernelFutureFlag.GotReply)) {\n this._handleDone();\n }\n }\n }\n _handleDone() {\n if (this._testFlag(Private.KernelFutureFlag.IsDone)) {\n return;\n }\n this._setFlag(Private.KernelFutureFlag.IsDone);\n this._done.resolve(this._replyMsg);\n if (this._disposeOnDone) {\n this.dispose();\n }\n }\n /**\n * Test whether the given future flag is set.\n */\n _testFlag(flag) {\n // tslint:disable-next-line\n return (this._status & flag) !== 0;\n }\n /**\n * Set the given future flag.\n */\n _setFlag(flag) {\n // tslint:disable-next-line\n this._status |= flag;\n }\n}\nexports.KernelFutureHandler = KernelFutureHandler;\nclass KernelControlFutureHandler extends KernelFutureHandler {\n}\nexports.KernelControlFutureHandler = KernelControlFutureHandler;\nclass KernelShellFutureHandler extends KernelFutureHandler {\n}\nexports.KernelShellFutureHandler = KernelShellFutureHandler;\nvar Private;\n(function (Private) {\n /**\n * A no-op function.\n */\n Private.noOp = () => {\n /* no-op */\n };\n /**\n * Defer a computation.\n *\n * #### NOTES\n * We can't just use requestAnimationFrame since it is not available in node.\n * This implementation is from Phosphor:\n * https://github.com/phosphorjs/phosphor/blob/e88e4321289bb1198f3098e7bda40736501f2ed8/tests/test-messaging/src/index.spec.ts#L63\n */\n const defer = (() => {\n const ok = typeof requestAnimationFrame === 'function';\n return ok ? requestAnimationFrame : setImmediate;\n })();\n class HookList {\n constructor() {\n this._hooks = [];\n }\n /**\n * Register a hook.\n *\n * @param hook - The callback to register.\n */\n add(hook) {\n this.remove(hook);\n this._hooks.push(hook);\n }\n /**\n * Remove a hook, if it exists in the hook list.\n *\n * @param hook - The callback to remove.\n */\n remove(hook) {\n const index = this._hooks.indexOf(hook);\n if (index >= 0) {\n this._hooks[index] = null;\n this._scheduleCompact();\n }\n }\n /**\n * Process a message through the hooks.\n *\n * @returns a promise resolving to false if any hook resolved as false,\n * otherwise true\n *\n * #### Notes\n * The most recently registered hook is run first. A hook can return a\n * boolean or a promise to a boolean, in which case processing pauses until\n * the promise is fulfilled. If a hook return value resolves to false, any\n * later hooks will not run and the function will return a promise resolving\n * to false. If a hook throws an error, the error is logged to the console\n * and the next hook is run. If a hook is registered during the hook\n * processing, it will not run until the next message. If a hook is removed\n * during the hook processing, it will be deactivated immediately.\n */\n async process(msg) {\n // Wait until we can start a new process run.\n await this._processing;\n // Start the next process run.\n const processing = new coreutils_1.PromiseDelegate();\n this._processing = processing.promise;\n let continueHandling;\n // Call the end hook (most recently-added) first. Starting at the end also\n // guarantees that hooks added during the processing will not be run in\n // this process run.\n for (let i = this._hooks.length - 1; i >= 0; i--) {\n const hook = this._hooks[i];\n // If the hook has been removed, continue to the next one.\n if (hook === null) {\n continue;\n }\n // Execute the hook and log any errors.\n try {\n // tslint:disable-next-line:await-promise\n continueHandling = await hook(msg);\n }\n catch (err) {\n continueHandling = true;\n console.error(err);\n }\n // If the hook resolved to false, stop processing and return.\n if (continueHandling === false) {\n processing.resolve(undefined);\n return false;\n }\n }\n // All hooks returned true (or errored out), so return true.\n processing.resolve(undefined);\n return true;\n }\n /**\n * Schedule a cleanup of the list, removing any hooks that have been nulled out.\n */\n _scheduleCompact() {\n if (!this._compactScheduled) {\n this._compactScheduled = true;\n // Schedule a compaction in between processing runs. We do the\n // scheduling in an animation frame to rate-limit our compactions. If we\n // need to compact more frequently, we can change this to directly\n // schedule the compaction.\n defer(() => {\n this._processing = this._processing.then(() => {\n this._compactScheduled = false;\n this._compact();\n });\n });\n }\n }\n /**\n * Compact the list, removing any nulls.\n */\n _compact() {\n let numNulls = 0;\n for (let i = 0, len = this._hooks.length; i < len; i++) {\n const hook = this._hooks[i];\n if (this._hooks[i] === null) {\n numNulls++;\n }\n else {\n this._hooks[i - numNulls] = hook;\n }\n }\n this._hooks.length -= numNulls;\n }\n }\n Private.HookList = HookList;\n /**\n * Bit flags for the kernel future state.\n */\n let KernelFutureFlag;\n (function (KernelFutureFlag) {\n KernelFutureFlag[KernelFutureFlag[\"GotReply\"] = 1] = \"GotReply\";\n KernelFutureFlag[KernelFutureFlag[\"GotIdle\"] = 2] = \"GotIdle\";\n KernelFutureFlag[KernelFutureFlag[\"IsDone\"] = 4] = \"IsDone\";\n KernelFutureFlag[KernelFutureFlag[\"DisposeOnDone\"] = 8] = \"DisposeOnDone\";\n })(KernelFutureFlag = Private.KernelFutureFlag || (Private.KernelFutureFlag = {}));\n})(Private || (Private = {}));\n//# sourceMappingURL=future.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.KernelConnection = exports.KernelAPI = exports.KernelMessage = exports.Kernel = void 0;\n// Namespace some of our modules for convenience and backwards compatibility.\nconst Kernel = __importStar(require(\"./kernel\"));\nexports.Kernel = Kernel;\nconst KernelMessage = __importStar(require(\"./messages\"));\nexports.KernelMessage = KernelMessage;\nconst KernelAPI = __importStar(require(\"./restapi\"));\nexports.KernelAPI = KernelAPI;\nconst default_1 = require(\"./default\");\nObject.defineProperty(exports, \"KernelConnection\", { enumerable: true, get: function () { return default_1.KernelConnection; } });\n__exportStar(require(\"./manager\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=kernel.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.KernelManager = void 0;\nconst polling_1 = require(\"@lumino/polling\");\nconst signaling_1 = require(\"@lumino/signaling\");\nconst __1 = require(\"..\");\nconst basemanager_1 = require(\"../basemanager\");\nconst restapi_1 = require(\"./restapi\");\nconst default_1 = require(\"./default\");\n/**\n * An implementation of a kernel manager.\n */\nclass KernelManager extends basemanager_1.BaseManager {\n /**\n * Construct a new kernel manager.\n *\n * @param options - The default options for kernel.\n */\n constructor(options = {}) {\n var _a;\n super(options);\n this._isReady = false;\n this._kernelConnections = new Set();\n this._models = new Map();\n this._runningChanged = new signaling_1.Signal(this);\n this._connectionFailure = new signaling_1.Signal(this);\n // Start model and specs polling with exponential backoff.\n this._pollModels = new polling_1.Poll({\n auto: false,\n factory: () => this.requestRunning(),\n frequency: {\n interval: 10 * 1000,\n backoff: true,\n max: 300 * 1000\n },\n name: `@jupyterlab/services:KernelManager#models`,\n standby: (_a = options.standby) !== null && _a !== void 0 ? _a : 'when-hidden'\n });\n // Initialize internal data.\n this._ready = (async () => {\n await this._pollModels.start();\n await this._pollModels.tick;\n this._isReady = true;\n })();\n }\n /**\n * Test whether the manager is ready.\n */\n get isReady() {\n return this._isReady;\n }\n /**\n * A promise that fulfills when the manager is ready.\n */\n get ready() {\n return this._ready;\n }\n /**\n * A signal emitted when the running kernels change.\n */\n get runningChanged() {\n return this._runningChanged;\n }\n /**\n * A signal emitted when there is a connection failure.\n */\n get connectionFailure() {\n return this._connectionFailure;\n }\n /**\n * Dispose of the resources used by the manager.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._models.clear();\n this._kernelConnections.forEach(x => x.dispose());\n this._pollModels.dispose();\n super.dispose();\n }\n /**\n * Connect to an existing kernel.\n *\n * @returns The new kernel connection.\n *\n * #### Notes\n * This will use the manager's server settings and ignore any server\n * settings passed in the options.\n */\n connectTo(options) {\n var _a;\n const { id } = options.model;\n let handleComms = (_a = options.handleComms) !== null && _a !== void 0 ? _a : true;\n // By default, handle comms only if no other kernel connection is.\n if (options.handleComms === undefined) {\n for (const kc of this._kernelConnections) {\n if (kc.id === id && kc.handleComms) {\n handleComms = false;\n break;\n }\n }\n }\n const kernelConnection = new default_1.KernelConnection({\n handleComms,\n ...options,\n serverSettings: this.serverSettings\n });\n this._onStarted(kernelConnection);\n if (!this._models.has(id)) {\n // We trust the user to connect to an existing kernel, but we verify\n // asynchronously.\n void this.refreshRunning().catch(() => {\n /* no-op */\n });\n }\n return kernelConnection;\n }\n /**\n * Create an iterator over the most recent running kernels.\n *\n * @returns A new iterator over the running kernels.\n */\n running() {\n return this._models.values();\n }\n /**\n * Force a refresh of the running kernels.\n *\n * @returns A promise that resolves when the running list has been refreshed.\n *\n * #### Notes\n * This is not typically meant to be called by the user, since the\n * manager maintains its own internal state.\n */\n async refreshRunning() {\n await this._pollModels.refresh();\n await this._pollModels.tick;\n }\n /**\n * Start a new kernel.\n *\n * @param createOptions - The kernel creation options\n *\n * @param connectOptions - The kernel connection options\n *\n * @returns A promise that resolves with the kernel connection.\n *\n * #### Notes\n * The manager `serverSettings` will be always be used.\n */\n async startNew(createOptions = {}, connectOptions = {}) {\n const model = await (0, restapi_1.startNew)(createOptions, this.serverSettings);\n return this.connectTo({\n ...connectOptions,\n model\n });\n }\n /**\n * Shut down a kernel by id.\n *\n * @param id - The id of the target kernel.\n *\n * @returns A promise that resolves when the operation is complete.\n */\n async shutdown(id) {\n await (0, restapi_1.shutdownKernel)(id, this.serverSettings);\n await this.refreshRunning();\n }\n /**\n * Shut down all kernels.\n *\n * @returns A promise that resolves when all of the kernels are shut down.\n */\n async shutdownAll() {\n // Update the list of models to make sure our list is current.\n await this.refreshRunning();\n // Shut down all models.\n await Promise.all([...this._models.keys()].map(id => (0, restapi_1.shutdownKernel)(id, this.serverSettings)));\n // Update the list of models to clear out our state.\n await this.refreshRunning();\n }\n /**\n * Find a kernel by id.\n *\n * @param id - The id of the target kernel.\n *\n * @returns A promise that resolves with the kernel's model.\n */\n async findById(id) {\n if (this._models.has(id)) {\n return this._models.get(id);\n }\n await this.refreshRunning();\n return this._models.get(id);\n }\n /**\n * Execute a request to the server to poll running kernels and update state.\n */\n async requestRunning() {\n var _a, _b;\n let models;\n try {\n models = await (0, restapi_1.listRunning)(this.serverSettings);\n }\n catch (err) {\n // Handle network errors, as well as cases where we are on a\n // JupyterHub and the server is not running. JupyterHub returns a\n // 503 (<2.0) or 424 (>2.0) in that case.\n if (err instanceof __1.ServerConnection.NetworkError ||\n ((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 503 ||\n ((_b = err.response) === null || _b === void 0 ? void 0 : _b.status) === 424) {\n this._connectionFailure.emit(err);\n }\n throw err;\n }\n if (this.isDisposed) {\n return;\n }\n if (this._models.size === models.length &&\n models.every(model => {\n const existing = this._models.get(model.id);\n if (!existing) {\n return false;\n }\n return (existing.connections === model.connections &&\n existing.execution_state === model.execution_state &&\n existing.last_activity === model.last_activity &&\n existing.name === model.name &&\n existing.reason === model.reason &&\n existing.traceback === model.traceback);\n })) {\n // Identical models list (presuming models does not contain duplicate\n // ids), so just return\n return;\n }\n this._models = new Map(models.map(x => [x.id, x]));\n // For any kernel connection to a kernel that doesn't exist, notify it of\n // the shutdown.\n this._kernelConnections.forEach(kc => {\n if (!this._models.has(kc.id)) {\n kc.handleShutdown();\n }\n });\n this._runningChanged.emit(models);\n }\n /**\n * Handle a kernel starting.\n */\n _onStarted(kernelConnection) {\n this._kernelConnections.add(kernelConnection);\n kernelConnection.statusChanged.connect(this._onStatusChanged, this);\n kernelConnection.disposed.connect(this._onDisposed, this);\n }\n _onDisposed(kernelConnection) {\n this._kernelConnections.delete(kernelConnection);\n // A dispose emission could mean the server session is deleted, or that\n // the kernel JS object is disposed and the kernel still exists on the\n // server, so we refresh from the server to make sure we reflect the\n // server state.\n void this.refreshRunning().catch(() => {\n /* no-op */\n });\n }\n _onStatusChanged(kernelConnection, status) {\n if (status === 'dead') {\n // We asynchronously update our list of kernels, which asynchronously\n // will dispose them. We do not want to immediately dispose them because\n // there may be other signal handlers that want to be called.\n void this.refreshRunning().catch(() => {\n /* no-op */\n });\n }\n }\n}\nexports.KernelManager = KernelManager;\n/**\n * The namespace for `KernelManager` class statics.\n */\n(function (KernelManager) {\n /**\n * A no-op kernel manager to be used when starting kernels.\n */\n class NoopManager extends KernelManager {\n constructor() {\n super(...arguments);\n this._readyPromise = new Promise(() => {\n /* no-op */\n });\n }\n /**\n * Whether the manager is active.\n */\n get isActive() {\n return false;\n }\n /**\n * Used for testing.\n */\n get parentReady() {\n return super.ready;\n }\n /**\n * Start a new kernel - throws an error since it is not supported.\n */\n async startNew(createOptions = {}, connectOptions = {}) {\n return Promise.reject(new Error('Not implemented in no-op Kernel Manager'));\n }\n /**\n * Connect to an existing kernel - throws an error since it is not supported.\n */\n connectTo(options) {\n throw new Error('Not implemented in no-op Kernel Manager');\n }\n /**\n * Shut down a kernel by id - throws an error since it is not supported.\n */\n async shutdown(id) {\n return Promise.reject(new Error('Not implemented in no-op Kernel Manager'));\n }\n /**\n * A promise that fulfills when the manager is ready (never).\n */\n get ready() {\n return this.parentReady.then(() => this._readyPromise);\n }\n /**\n * Execute a request to the server to poll running kernels and update state.\n */\n async requestRunning() {\n return Promise.resolve();\n }\n }\n KernelManager.NoopManager = NoopManager;\n})(KernelManager || (exports.KernelManager = KernelManager = {}));\n//# sourceMappingURL=manager.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.supportedKernelWebSocketProtocols = exports.isInputReplyMsg = exports.isInputRequestMsg = exports.isDebugReplyMsg = exports.isDebugRequestMsg = exports.isExecuteReplyMsg = exports.isInfoRequestMsg = exports.isCommMsgMsg = exports.isCommCloseMsg = exports.isCommOpenMsg = exports.isDebugEventMsg = exports.isClearOutputMsg = exports.isStatusMsg = exports.isErrorMsg = exports.isExecuteResultMsg = exports.isExecuteInputMsg = exports.isUpdateDisplayDataMsg = exports.isDisplayDataMsg = exports.isStreamMsg = exports.createMessage = void 0;\nconst coreutils_1 = require(\"@lumino/coreutils\");\nfunction createMessage(options) {\n var _a, _b, _c, _d, _e;\n return {\n buffers: (_a = options.buffers) !== null && _a !== void 0 ? _a : [],\n channel: options.channel,\n content: options.content,\n header: {\n date: new Date().toISOString(),\n msg_id: (_b = options.msgId) !== null && _b !== void 0 ? _b : coreutils_1.UUID.uuid4(),\n msg_type: options.msgType,\n session: options.session,\n username: (_c = options.username) !== null && _c !== void 0 ? _c : '',\n version: '5.2'\n },\n metadata: (_d = options.metadata) !== null && _d !== void 0 ? _d : {},\n parent_header: (_e = options.parentHeader) !== null && _e !== void 0 ? _e : {}\n };\n}\nexports.createMessage = createMessage;\n/**\n * Test whether a kernel message is a `'stream'` message.\n */\nfunction isStreamMsg(msg) {\n return msg.header.msg_type === 'stream';\n}\nexports.isStreamMsg = isStreamMsg;\n/**\n * Test whether a kernel message is an `'display_data'` message.\n */\nfunction isDisplayDataMsg(msg) {\n return msg.header.msg_type === 'display_data';\n}\nexports.isDisplayDataMsg = isDisplayDataMsg;\n/**\n * Test whether a kernel message is an `'update_display_data'` message.\n */\nfunction isUpdateDisplayDataMsg(msg) {\n return msg.header.msg_type === 'update_display_data';\n}\nexports.isUpdateDisplayDataMsg = isUpdateDisplayDataMsg;\n/**\n * Test whether a kernel message is an `'execute_input'` message.\n */\nfunction isExecuteInputMsg(msg) {\n return msg.header.msg_type === 'execute_input';\n}\nexports.isExecuteInputMsg = isExecuteInputMsg;\n/**\n * Test whether a kernel message is an `'execute_result'` message.\n */\nfunction isExecuteResultMsg(msg) {\n return msg.header.msg_type === 'execute_result';\n}\nexports.isExecuteResultMsg = isExecuteResultMsg;\n/**\n * Test whether a kernel message is an `'error'` message.\n */\nfunction isErrorMsg(msg) {\n return msg.header.msg_type === 'error';\n}\nexports.isErrorMsg = isErrorMsg;\n/**\n * Test whether a kernel message is a `'status'` message.\n */\nfunction isStatusMsg(msg) {\n return msg.header.msg_type === 'status';\n}\nexports.isStatusMsg = isStatusMsg;\n/**\n * Test whether a kernel message is a `'clear_output'` message.\n */\nfunction isClearOutputMsg(msg) {\n return msg.header.msg_type === 'clear_output';\n}\nexports.isClearOutputMsg = isClearOutputMsg;\n/**\n * Test whether a kernel message is an experimental `'debug_event'` message.\n *\n * @hidden\n *\n * #### Notes\n * Debug messages are experimental messages that are not in the official\n * kernel message specification. As such, this is *NOT* considered\n * part of the public API, and may change without notice.\n */\nfunction isDebugEventMsg(msg) {\n return msg.header.msg_type === 'debug_event';\n}\nexports.isDebugEventMsg = isDebugEventMsg;\n/**\n * Test whether a kernel message is a `'comm_open'` message.\n */\nfunction isCommOpenMsg(msg) {\n return msg.header.msg_type === 'comm_open';\n}\nexports.isCommOpenMsg = isCommOpenMsg;\n/**\n * Test whether a kernel message is a `'comm_close'` message.\n */\nfunction isCommCloseMsg(msg) {\n return msg.header.msg_type === 'comm_close';\n}\nexports.isCommCloseMsg = isCommCloseMsg;\n/**\n * Test whether a kernel message is a `'comm_msg'` message.\n */\nfunction isCommMsgMsg(msg) {\n return msg.header.msg_type === 'comm_msg';\n}\nexports.isCommMsgMsg = isCommMsgMsg;\n/**\n * Test whether a kernel message is a `'kernel_info_request'` message.\n */\nfunction isInfoRequestMsg(msg) {\n return msg.header.msg_type === 'kernel_info_request';\n}\nexports.isInfoRequestMsg = isInfoRequestMsg;\n/**\n * Test whether a kernel message is an `'execute_reply'` message.\n */\nfunction isExecuteReplyMsg(msg) {\n return msg.header.msg_type === 'execute_reply';\n}\nexports.isExecuteReplyMsg = isExecuteReplyMsg;\n/**\n * Test whether a kernel message is an experimental `'debug_request'` message.\n *\n * @hidden\n *\n * #### Notes\n * Debug messages are experimental messages that are not in the official\n * kernel message specification. As such, this is *NOT* considered\n * part of the public API, and may change without notice.\n */\nfunction isDebugRequestMsg(msg) {\n return msg.header.msg_type === 'debug_request';\n}\nexports.isDebugRequestMsg = isDebugRequestMsg;\n/**\n * Test whether a kernel message is an experimental `'debug_reply'` message.\n *\n * @hidden\n *\n * #### Notes\n * Debug messages are experimental messages that are not in the official\n * kernel message specification. As such, this is *NOT* considered\n * part of the public API, and may change without notice.\n */\nfunction isDebugReplyMsg(msg) {\n return msg.header.msg_type === 'debug_reply';\n}\nexports.isDebugReplyMsg = isDebugReplyMsg;\n/**\n * Test whether a kernel message is an `'input_request'` message.\n */\nfunction isInputRequestMsg(msg) {\n return msg.header.msg_type === 'input_request';\n}\nexports.isInputRequestMsg = isInputRequestMsg;\n/**\n * Test whether a kernel message is an `'input_reply'` message.\n */\nfunction isInputReplyMsg(msg) {\n return msg.header.msg_type === 'input_reply';\n}\nexports.isInputReplyMsg = isInputReplyMsg;\n// ///////////////////////////////////////////////\n// Message (de)serialization\n// ///////////////////////////////////////////////\n/**\n * The list of supported kernel wire protocols over websocket.\n */\nvar supportedKernelWebSocketProtocols;\n(function (supportedKernelWebSocketProtocols) {\n supportedKernelWebSocketProtocols[\"v1KernelWebsocketJupyterOrg\"] = \"v1.kernel.websocket.jupyter.org\";\n})(supportedKernelWebSocketProtocols || (exports.supportedKernelWebSocketProtocols = supportedKernelWebSocketProtocols = {}));\n//# sourceMappingURL=messages.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getKernelModel = exports.shutdownKernel = exports.interruptKernel = exports.restartKernel = exports.startNew = exports.listRunning = exports.KERNEL_SERVICE_URL = void 0;\nconst serverconnection_1 = require(\"../serverconnection\");\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\nconst validate_1 = require(\"./validate\");\n/**\n * The url for the kernel service.\n */\nexports.KERNEL_SERVICE_URL = 'api/kernels';\n/**\n * Fetch the running kernels.\n *\n * @param settings - The optional server settings.\n *\n * @returns A promise that resolves with the list of running kernels.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n */\nasync function listRunning(settings = serverconnection_1.ServerConnection.makeSettings()) {\n const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL);\n const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);\n if (response.status !== 200) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n (0, validate_1.validateModels)(data);\n return data;\n}\nexports.listRunning = listRunning;\n/**\n * Start a new kernel.\n *\n * @param options - The options used to create the kernel.\n *\n * @returns A promise that resolves with a kernel connection object.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n */\nasync function startNew(options = {}, settings = serverconnection_1.ServerConnection.makeSettings()) {\n const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL);\n const init = {\n method: 'POST',\n body: JSON.stringify(options)\n };\n const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n if (response.status !== 201) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n (0, validate_1.validateModel)(data);\n return data;\n}\nexports.startNew = startNew;\n/**\n * Restart a kernel.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.\n *\n * The promise is fulfilled on a valid response (and thus after a restart) and rejected otherwise.\n */\nasync function restartKernel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {\n const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL, encodeURIComponent(id), 'restart');\n const init = { method: 'POST' };\n const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n if (response.status !== 200) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n (0, validate_1.validateModel)(data);\n}\nexports.restartKernel = restartKernel;\n/**\n * Interrupt a kernel.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n */\nasync function interruptKernel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {\n const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL, encodeURIComponent(id), 'interrupt');\n const init = { method: 'POST' };\n const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n if (response.status !== 204) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n}\nexports.interruptKernel = interruptKernel;\n/**\n * Shut down a kernel.\n *\n * @param id - The id of the running kernel.\n *\n * @param settings - The server settings for the request.\n *\n * @returns A promise that resolves when the kernel is shut down.\n *\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n */\nasync function shutdownKernel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {\n const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL, encodeURIComponent(id));\n const init = { method: 'DELETE' };\n const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n if (response.status === 404) {\n const msg = `The kernel \"${id}\" does not exist on the server`;\n console.warn(msg);\n }\n else if (response.status !== 204) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n}\nexports.shutdownKernel = shutdownKernel;\n/**\n * Get a full kernel model from the server by kernel id string.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.\n *\n * The promise is fulfilled on a valid response and rejected otherwise.\n */\nasync function getKernelModel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {\n const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL, encodeURIComponent(id));\n const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);\n if (response.status === 404) {\n return undefined;\n }\n else if (response.status !== 200) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n (0, validate_1.validateModel)(data);\n return data;\n}\nexports.getKernelModel = getKernelModel;\n//# sourceMappingURL=restapi.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deserialize = exports.serialize = void 0;\nconst KernelMessage = __importStar(require(\"./messages\"));\n/**\n * Serialize a kernel message for transport.\n */\nfunction serialize(msg, protocol = '') {\n switch (protocol) {\n case KernelMessage.supportedKernelWebSocketProtocols\n .v1KernelWebsocketJupyterOrg:\n return Private.serializeV1KernelWebsocketJupyterOrg(msg);\n default:\n return Private.serializeDefault(msg);\n }\n}\nexports.serialize = serialize;\n/**\n * Deserialize and return the unpacked message.\n */\nfunction deserialize(data, protocol = '') {\n switch (protocol) {\n case KernelMessage.supportedKernelWebSocketProtocols\n .v1KernelWebsocketJupyterOrg:\n return Private.deserializeV1KernelWebsocketJupyterOrg(data);\n default:\n return Private.deserializeDefault(data);\n }\n}\nexports.deserialize = deserialize;\nvar Private;\n(function (Private) {\n /**\n * Deserialize and return the unpacked message.\n * Protocol `v1.kernel.websocket.jupyter.org`\n */\n function deserializeV1KernelWebsocketJupyterOrg(binMsg) {\n let msg;\n const data = new DataView(binMsg);\n const offsetNumber = Number(data.getBigUint64(0, true /* littleEndian */));\n let offsets = [];\n for (let i = 0; i < offsetNumber; i++) {\n // WARNING: we cast our 64-bit unsigned int to a number!\n // so offsets cannot index up to 2**64 bytes\n offsets.push(Number(data.getBigUint64(8 * (i + 1), true /* littleEndian */)));\n }\n const decoder = new TextDecoder('utf8');\n const channel = decoder.decode(binMsg.slice(offsets[0], offsets[1]));\n const header = JSON.parse(decoder.decode(binMsg.slice(offsets[1], offsets[2])));\n const parent_header = JSON.parse(decoder.decode(binMsg.slice(offsets[2], offsets[3])));\n const metadata = JSON.parse(decoder.decode(binMsg.slice(offsets[3], offsets[4])));\n const content = JSON.parse(decoder.decode(binMsg.slice(offsets[4], offsets[5])));\n let buffers = [];\n for (let i = 5; i < offsets.length - 1; i++) {\n buffers.push(new DataView(binMsg.slice(offsets[i], offsets[i + 1])));\n }\n msg = {\n channel,\n header,\n parent_header,\n metadata,\n content,\n buffers\n };\n return msg;\n }\n Private.deserializeV1KernelWebsocketJupyterOrg = deserializeV1KernelWebsocketJupyterOrg;\n /**\n * Serialize a kernel message for transport.\n * Protocol `v1.kernel.websocket.jupyter.org`\n */\n function serializeV1KernelWebsocketJupyterOrg(msg) {\n const header = JSON.stringify(msg.header);\n const parentHeader = msg.parent_header == null ? '{}' : JSON.stringify(msg.parent_header);\n const metadata = JSON.stringify(msg.metadata);\n const content = JSON.stringify(msg.content);\n const buffers = msg.buffers !== undefined ? msg.buffers : [];\n const offsetNumber = 1 + 4 + buffers.length + 1;\n let offsets = [];\n offsets.push(8 * (1 + offsetNumber));\n offsets.push(msg.channel.length + offsets[offsets.length - 1]);\n const encoder = new TextEncoder();\n const channelEncoded = encoder.encode(msg.channel);\n const headerEncoded = encoder.encode(header);\n const parentHeaderEncoded = encoder.encode(parentHeader);\n const metadataEncoded = encoder.encode(metadata);\n const contentEncoded = encoder.encode(content);\n const binMsgNoBuff = new Uint8Array(channelEncoded.length +\n headerEncoded.length +\n parentHeaderEncoded.length +\n metadataEncoded.length +\n contentEncoded.length);\n binMsgNoBuff.set(channelEncoded);\n binMsgNoBuff.set(headerEncoded, channelEncoded.length);\n binMsgNoBuff.set(parentHeaderEncoded, channelEncoded.length + headerEncoded.length);\n binMsgNoBuff.set(metadataEncoded, channelEncoded.length + headerEncoded.length + parentHeaderEncoded.length);\n binMsgNoBuff.set(contentEncoded, channelEncoded.length +\n headerEncoded.length +\n parentHeaderEncoded.length +\n metadataEncoded.length);\n for (let length of [\n headerEncoded.length,\n parentHeaderEncoded.length,\n metadataEncoded.length,\n contentEncoded.length\n ]) {\n offsets.push(length + offsets[offsets.length - 1]);\n }\n let buffersByteLength = 0;\n for (let buffer of buffers) {\n let length = buffer.byteLength;\n offsets.push(length + offsets[offsets.length - 1]);\n buffersByteLength += length;\n }\n const binMsg = new Uint8Array(8 * (1 + offsetNumber) + binMsgNoBuff.byteLength + buffersByteLength);\n const word = new ArrayBuffer(8);\n const data = new DataView(word);\n data.setBigUint64(0, BigInt(offsetNumber), true /* littleEndian */);\n binMsg.set(new Uint8Array(word), 0);\n for (let i = 0; i < offsets.length; i++) {\n data.setBigUint64(0, BigInt(offsets[i]), true /* littleEndian */);\n binMsg.set(new Uint8Array(word), 8 * (i + 1));\n }\n binMsg.set(binMsgNoBuff, offsets[0]);\n for (let i = 0; i < buffers.length; i++) {\n const buffer = buffers[i];\n binMsg.set(new Uint8Array(ArrayBuffer.isView(buffer) ? buffer.buffer : buffer), offsets[5 + i]);\n }\n return binMsg.buffer;\n }\n Private.serializeV1KernelWebsocketJupyterOrg = serializeV1KernelWebsocketJupyterOrg;\n /**\n * Deserialize and return the unpacked message.\n * Default protocol\n *\n * #### Notes\n * Handles JSON blob strings and binary messages.\n */\n function deserializeDefault(data) {\n let value;\n if (typeof data === 'string') {\n value = JSON.parse(data);\n }\n else {\n value = deserializeBinary(data);\n }\n return value;\n }\n Private.deserializeDefault = deserializeDefault;\n /**\n * Serialize a kernel message for transport.\n * Default protocol\n *\n * #### Notes\n * If there is binary content, an `ArrayBuffer` is returned,\n * otherwise the message is converted to a JSON string.\n */\n function serializeDefault(msg) {\n var _a;\n let value;\n if ((_a = msg.buffers) === null || _a === void 0 ? void 0 : _a.length) {\n value = serializeBinary(msg);\n }\n else {\n value = JSON.stringify(msg);\n }\n return value;\n }\n Private.serializeDefault = serializeDefault;\n /**\n * Deserialize a binary message to a Kernel Message.\n */\n function deserializeBinary(buf) {\n const data = new DataView(buf);\n // read the header: 1 + nbufs 32b integers\n const nbufs = data.getUint32(0);\n const offsets = [];\n if (nbufs < 2) {\n throw new Error('Invalid incoming Kernel Message');\n }\n for (let i = 1; i <= nbufs; i++) {\n offsets.push(data.getUint32(i * 4));\n }\n const jsonBytes = new Uint8Array(buf.slice(offsets[0], offsets[1]));\n const msg = JSON.parse(new TextDecoder('utf8').decode(jsonBytes));\n // the remaining chunks are stored as DataViews in msg.buffers\n msg.buffers = [];\n for (let i = 1; i < nbufs; i++) {\n const start = offsets[i];\n const stop = offsets[i + 1] || buf.byteLength;\n msg.buffers.push(new DataView(buf.slice(start, stop)));\n }\n return msg;\n }\n /**\n * Implement the binary serialization protocol.\n *\n * Serialize Kernel message to ArrayBuffer.\n */\n function serializeBinary(msg) {\n const offsets = [];\n const buffers = [];\n const encoder = new TextEncoder();\n let origBuffers = [];\n if (msg.buffers !== undefined) {\n origBuffers = msg.buffers;\n delete msg['buffers'];\n }\n const jsonUtf8 = encoder.encode(JSON.stringify(msg));\n buffers.push(jsonUtf8.buffer);\n for (let i = 0; i < origBuffers.length; i++) {\n // msg.buffers elements could be either views or ArrayBuffers\n // buffers elements are ArrayBuffers\n const b = origBuffers[i];\n buffers.push(ArrayBuffer.isView(b) ? b.buffer : b);\n }\n const nbufs = buffers.length;\n offsets.push(4 * (nbufs + 1));\n for (let i = 0; i + 1 < buffers.length; i++) {\n offsets.push(offsets[offsets.length - 1] + buffers[i].byteLength);\n }\n const msgBuf = new Uint8Array(offsets[offsets.length - 1] + buffers[buffers.length - 1].byteLength);\n // use DataView.setUint32 for network byte-order\n const view = new DataView(msgBuf.buffer);\n // write nbufs to first 4 bytes\n view.setUint32(0, nbufs);\n // write offsets to next 4 * nbufs bytes\n for (let i = 0; i < offsets.length; i++) {\n view.setUint32(4 * (i + 1), offsets[i]);\n }\n // write all the buffers at their respective offsets\n for (let i = 0; i < buffers.length; i++) {\n msgBuf.set(new Uint8Array(buffers[i]), offsets[i]);\n }\n return msgBuf.buffer;\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=serialize.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateModels = exports.validateModel = exports.validateMessage = void 0;\nconst validate_1 = require(\"../validate\");\n/**\n * Required fields for `IKernelHeader`.\n */\nconst HEADER_FIELDS = ['username', 'version', 'session', 'msg_id', 'msg_type'];\n/**\n * Required fields and types for contents of various types of `kernel.IMessage`\n * messages on the iopub channel.\n */\nconst IOPUB_CONTENT_FIELDS = {\n stream: { name: 'string', text: 'string' },\n display_data: { data: 'object', metadata: 'object' },\n execute_input: { code: 'string', execution_count: 'number' },\n execute_result: {\n execution_count: 'number',\n data: 'object',\n metadata: 'object'\n },\n error: { ename: 'string', evalue: 'string', traceback: 'object' },\n status: {\n execution_state: [\n 'string',\n ['starting', 'idle', 'busy', 'restarting', 'dead']\n ]\n },\n clear_output: { wait: 'boolean' },\n comm_open: { comm_id: 'string', target_name: 'string', data: 'object' },\n comm_msg: { comm_id: 'string', data: 'object' },\n comm_close: { comm_id: 'string' },\n shutdown_reply: { restart: 'boolean' } // Emitted by the IPython kernel.\n};\n/**\n * Validate the header of a kernel message.\n */\nfunction validateHeader(header) {\n for (let i = 0; i < HEADER_FIELDS.length; i++) {\n (0, validate_1.validateProperty)(header, HEADER_FIELDS[i], 'string');\n }\n}\n/**\n * Validate a kernel message object.\n */\nfunction validateMessage(msg) {\n (0, validate_1.validateProperty)(msg, 'metadata', 'object');\n (0, validate_1.validateProperty)(msg, 'content', 'object');\n (0, validate_1.validateProperty)(msg, 'channel', 'string');\n validateHeader(msg.header);\n if (msg.channel === 'iopub') {\n validateIOPubContent(msg);\n }\n}\nexports.validateMessage = validateMessage;\n/**\n * Validate content an kernel message on the iopub channel.\n */\nfunction validateIOPubContent(msg) {\n if (msg.channel === 'iopub') {\n const fields = IOPUB_CONTENT_FIELDS[msg.header.msg_type];\n // Check for unknown message type.\n if (fields === undefined) {\n return;\n }\n const names = Object.keys(fields);\n const content = msg.content;\n for (let i = 0; i < names.length; i++) {\n let args = fields[names[i]];\n if (!Array.isArray(args)) {\n args = [args];\n }\n (0, validate_1.validateProperty)(content, names[i], ...args);\n }\n }\n}\n/**\n * Validate a `Kernel.IModel` object.\n */\nfunction validateModel(model) {\n (0, validate_1.validateProperty)(model, 'name', 'string');\n (0, validate_1.validateProperty)(model, 'id', 'string');\n}\nexports.validateModel = validateModel;\n/**\n * Validate an array of `IModel` objects.\n */\nfunction validateModels(models) {\n if (!Array.isArray(models)) {\n throw new Error('Invalid kernel list');\n }\n models.forEach(d => validateModel(d));\n}\nexports.validateModels = validateModels;\n//# sourceMappingURL=validate.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.KernelSpecAPI = exports.KernelSpec = void 0;\nconst KernelSpec = __importStar(require(\"./kernelspec\"));\nexports.KernelSpec = KernelSpec;\nconst KernelSpecAPI = __importStar(require(\"./restapi\"));\nexports.KernelSpecAPI = KernelSpecAPI;\n__exportStar(require(\"./manager\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=kernelspec.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.KernelSpecManager = void 0;\nconst coreutils_1 = require(\"@lumino/coreutils\");\nconst polling_1 = require(\"@lumino/polling\");\nconst signaling_1 = require(\"@lumino/signaling\");\nconst restapi = __importStar(require(\"./restapi\"));\nconst basemanager_1 = require(\"../basemanager\");\n/**\n * An implementation of a kernel spec manager.\n */\nclass KernelSpecManager extends basemanager_1.BaseManager {\n /**\n * Construct a new kernel spec manager.\n *\n * @param options - The default options for kernel.\n */\n constructor(options = {}) {\n var _a;\n super(options);\n this._isReady = false;\n this._connectionFailure = new signaling_1.Signal(this);\n this._specs = null;\n this._specsChanged = new signaling_1.Signal(this);\n // Initialize internal data.\n this._ready = Promise.all([this.requestSpecs()])\n .then(_ => undefined)\n .catch(_ => undefined)\n .then(() => {\n if (this.isDisposed) {\n return;\n }\n this._isReady = true;\n });\n this._pollSpecs = new polling_1.Poll({\n auto: false,\n factory: () => this.requestSpecs(),\n frequency: {\n interval: 61 * 1000,\n backoff: true,\n max: 300 * 1000\n },\n name: `@jupyterlab/services:KernelSpecManager#specs`,\n standby: (_a = options.standby) !== null && _a !== void 0 ? _a : 'when-hidden'\n });\n void this.ready.then(() => {\n void this._pollSpecs.start();\n });\n }\n /**\n * Test whether the manager is ready.\n */\n get isReady() {\n return this._isReady;\n }\n /**\n * A promise that fulfills when the manager is ready.\n */\n get ready() {\n return this._ready;\n }\n /**\n * Get the most recently fetched kernel specs.\n */\n get specs() {\n return this._specs;\n }\n /**\n * A signal emitted when the specs change.\n */\n get specsChanged() {\n return this._specsChanged;\n }\n /**\n * A signal emitted when there is a connection failure.\n */\n get connectionFailure() {\n return this._connectionFailure;\n }\n /**\n * Dispose of the resources used by the manager.\n */\n dispose() {\n this._pollSpecs.dispose();\n super.dispose();\n }\n /**\n * Force a refresh of the specs from the server.\n *\n * @returns A promise that resolves when the specs are fetched.\n *\n * #### Notes\n * This is intended to be called only in response to a user action,\n * since the manager maintains its internal state.\n */\n async refreshSpecs() {\n await this._pollSpecs.refresh();\n await this._pollSpecs.tick;\n }\n /**\n * Execute a request to the server to poll specs and update state.\n */\n async requestSpecs() {\n const specs = await restapi.getSpecs(this.serverSettings);\n if (this.isDisposed) {\n return;\n }\n if (!coreutils_1.JSONExt.deepEqual(specs, this._specs)) {\n this._specs = specs;\n this._specsChanged.emit(specs);\n }\n }\n}\nexports.KernelSpecManager = KernelSpecManager;\n//# sourceMappingURL=manager.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getSpecs = void 0;\nconst serverconnection_1 = require(\"../serverconnection\");\nconst validate_1 = require(\"./validate\");\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\n/**\n * The url for the kernelspec service.\n */\nconst KERNELSPEC_SERVICE_URL = 'api/kernelspecs';\n/**\n * Fetch all of the kernel specs.\n *\n * @param settings - The optional server settings.\n * @param useCache - Whether to use the cache. If false, always request.\n *\n * @returns A promise that resolves with the kernel specs.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernelspecs).\n */\nasync function getSpecs(settings = serverconnection_1.ServerConnection.makeSettings()) {\n const url = coreutils_1.URLExt.join(settings.baseUrl, KERNELSPEC_SERVICE_URL);\n const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);\n if (response.status !== 200) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n return (0, validate_1.validateSpecModels)(data);\n}\nexports.getSpecs = getSpecs;\n//# sourceMappingURL=restapi.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateSpecModels = exports.validateSpecModel = void 0;\nconst validate_1 = require(\"../validate\");\n/**\n * Validate a server kernelspec model to a client side model.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nfunction validateSpecModel(data) {\n const spec = data.spec;\n if (!spec) {\n throw new Error('Invalid kernel spec');\n }\n (0, validate_1.validateProperty)(data, 'name', 'string');\n (0, validate_1.validateProperty)(data, 'resources', 'object');\n (0, validate_1.validateProperty)(spec, 'language', 'string');\n (0, validate_1.validateProperty)(spec, 'display_name', 'string');\n (0, validate_1.validateProperty)(spec, 'argv', 'array');\n let metadata = null;\n if (spec.hasOwnProperty('metadata')) {\n (0, validate_1.validateProperty)(spec, 'metadata', 'object');\n metadata = spec.metadata;\n }\n let env = null;\n if (spec.hasOwnProperty('env')) {\n (0, validate_1.validateProperty)(spec, 'env', 'object');\n env = spec.env;\n }\n return {\n name: data.name,\n resources: data.resources,\n language: spec.language,\n display_name: spec.display_name,\n argv: spec.argv,\n metadata,\n env\n };\n}\nexports.validateSpecModel = validateSpecModel;\n/**\n * Validate a `Kernel.ISpecModels` object.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nfunction validateSpecModels(data) {\n if (!data.hasOwnProperty('kernelspecs')) {\n throw new Error('No kernelspecs found');\n }\n let keys = Object.keys(data.kernelspecs);\n const kernelspecs = Object.create(null);\n let defaultSpec = data.default;\n for (let i = 0; i < keys.length; i++) {\n const ks = data.kernelspecs[keys[i]];\n try {\n kernelspecs[keys[i]] = validateSpecModel(ks);\n }\n catch (err) {\n // Remove the errant kernel spec.\n console.warn(`Removing errant kernel spec: ${keys[i]}`);\n }\n }\n keys = Object.keys(kernelspecs);\n if (!keys.length) {\n throw new Error('No valid kernelspecs found');\n }\n if (!defaultSpec ||\n typeof defaultSpec !== 'string' ||\n !(defaultSpec in kernelspecs)) {\n defaultSpec = keys[0];\n console.warn(`Default kernel not found, using '${keys[0]}'`);\n }\n return {\n default: defaultSpec,\n kernelspecs\n };\n}\nexports.validateSpecModels = validateSpecModels;\n//# sourceMappingURL=validate.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ServiceManager = void 0;\nconst signaling_1 = require(\"@lumino/signaling\");\nconst builder_1 = require(\"./builder\");\nconst contents_1 = require(\"./contents\");\nconst event_1 = require(\"./event\");\nconst kernel_1 = require(\"./kernel\");\nconst kernelspec_1 = require(\"./kernelspec\");\nconst nbconvert_1 = require(\"./nbconvert\");\nconst serverconnection_1 = require(\"./serverconnection\");\nconst session_1 = require(\"./session\");\nconst setting_1 = require(\"./setting\");\nconst terminal_1 = require(\"./terminal\");\nconst user_1 = require(\"./user\");\nconst workspace_1 = require(\"./workspace\");\n/**\n * A Jupyter services manager.\n */\nclass ServiceManager {\n /**\n * Construct a new services provider.\n */\n constructor(options = {}) {\n var _a, _b;\n this._isDisposed = false;\n this._connectionFailure = new signaling_1.Signal(this);\n this._isReady = false;\n const defaultDrive = options.defaultDrive;\n const serverSettings = (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();\n const standby = (_b = options.standby) !== null && _b !== void 0 ? _b : 'when-hidden';\n const normalized = { defaultDrive, serverSettings, standby };\n this.serverSettings = serverSettings;\n this.contents = options.contents || new contents_1.ContentsManager(normalized);\n this.events = options.events || new event_1.EventManager(normalized);\n this.kernels = options.kernels || new kernel_1.KernelManager(normalized);\n this.sessions =\n options.sessions ||\n new session_1.SessionManager({\n ...normalized,\n kernelManager: this.kernels\n });\n this.settings = options.settings || new setting_1.SettingManager(normalized);\n this.terminals = options.terminals || new terminal_1.TerminalManager(normalized);\n this.builder = options.builder || new builder_1.BuildManager(normalized);\n this.workspaces = options.workspaces || new workspace_1.WorkspaceManager(normalized);\n this.nbconvert = options.nbconvert || new nbconvert_1.NbConvertManager(normalized);\n this.kernelspecs = options.kernelspecs || new kernelspec_1.KernelSpecManager(normalized);\n this.user = options.user || new user_1.UserManager(normalized);\n // Proxy all connection failures from the individual service managers.\n this.kernelspecs.connectionFailure.connect(this._onConnectionFailure, this);\n this.sessions.connectionFailure.connect(this._onConnectionFailure, this);\n this.terminals.connectionFailure.connect(this._onConnectionFailure, this);\n // Define promises that need to be resolved before service manager is ready.\n const readyList = [this.sessions.ready, this.kernelspecs.ready];\n if (this.terminals.isAvailable()) {\n readyList.push(this.terminals.ready);\n }\n this._readyPromise = Promise.all(readyList).then(() => {\n this._isReady = true;\n });\n }\n /**\n * A signal emitted when there is a connection failure with the kernel.\n */\n get connectionFailure() {\n return this._connectionFailure;\n }\n /**\n * Test whether the service manager is disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * Dispose of the resources used by the manager.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n signaling_1.Signal.clearData(this);\n this.contents.dispose();\n this.events.dispose();\n this.sessions.dispose();\n this.terminals.dispose();\n }\n /**\n * Test whether the manager is ready.\n */\n get isReady() {\n return this._isReady;\n }\n /**\n * A promise that fulfills when the manager is ready.\n */\n get ready() {\n return this._readyPromise;\n }\n _onConnectionFailure(sender, err) {\n this._connectionFailure.emit(err);\n }\n}\nexports.ServiceManager = ServiceManager;\n//# sourceMappingURL=manager.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NbConvertManager = void 0;\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\nconst serverconnection_1 = require(\"../serverconnection\");\nconst coreutils_2 = require(\"@lumino/coreutils\");\n/**\n * The url for the lab nbconvert service.\n */\nconst NBCONVERT_SETTINGS_URL = 'api/nbconvert';\n/**\n * The nbconvert API service manager.\n */\nclass NbConvertManager {\n /**\n * Create a new nbconvert manager.\n */\n constructor(options = {}) {\n var _a;\n this._exportFormats = null;\n this.serverSettings =\n (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();\n }\n /**\n * Fetch and cache the export formats from the expensive nbconvert handler.\n */\n async fetchExportFormats() {\n this._requestingFormats = new coreutils_2.PromiseDelegate();\n this._exportFormats = null;\n const base = this.serverSettings.baseUrl;\n const url = coreutils_1.URLExt.join(base, NBCONVERT_SETTINGS_URL);\n const { serverSettings } = this;\n const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, serverSettings);\n if (response.status !== 200) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n const exportList = {};\n const keys = Object.keys(data);\n keys.forEach(function (key) {\n const mimeType = data[key].output_mimetype;\n exportList[key] = { output_mimetype: mimeType };\n });\n this._exportFormats = exportList;\n this._requestingFormats.resolve(exportList);\n return exportList;\n }\n /**\n * Get the list of export formats, preferring pre-cached ones.\n */\n async getExportFormats(force = true) {\n if (this._requestingFormats) {\n return this._requestingFormats.promise;\n }\n if (force || !this._exportFormats) {\n return await this.fetchExportFormats();\n }\n return this._exportFormats;\n }\n}\nexports.NbConvertManager = NbConvertManager;\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ServerConnection = void 0;\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\nconst serialize_1 = require(\"./kernel/serialize\");\nlet WEBSOCKET;\nif (typeof window === 'undefined') {\n // Mangle the require statements so it does not get picked up in the\n // browser assets.\n WEBSOCKET = require('ws');\n}\nelse {\n WEBSOCKET = WebSocket;\n}\n/**\n * The namespace for ServerConnection functions.\n *\n * #### Notes\n * This is only intended to manage communication with the Jupyter server.\n *\n * The default values can be used in a JupyterLab or Jupyter Notebook context.\n *\n * We use `token` authentication if available, falling back on an XSRF\n * cookie if one has been provided on the `document`.\n *\n * A content type of `'application/json'` is added when using authentication\n * and there is no body data to allow the server to prevent malicious forms.\n */\nvar ServerConnection;\n(function (ServerConnection) {\n /**\n * Create a settings object given a subset of options.\n *\n * @param options - An optional partial set of options.\n *\n * @returns The full settings object.\n */\n function makeSettings(options) {\n return Private.makeSettings(options);\n }\n ServerConnection.makeSettings = makeSettings;\n /**\n * Make an request to the notebook server.\n *\n * @param url - The url for the request.\n *\n * @param init - The initialization options for the request.\n *\n * @param settings - The server settings to apply to the request.\n *\n * @returns a Promise that resolves with the response.\n *\n * @throws If the url of the request is not a notebook server url.\n *\n * #### Notes\n * The `url` must start with `settings.baseUrl`. The `init` settings are\n * merged with `settings.init`, with `init` taking precedence.\n * The headers in the two objects are not merged.\n * If there is no body data, we set the content type to `application/json`\n * because it is required by the Notebook server.\n */\n function makeRequest(url, init, settings) {\n return Private.handleRequest(url, init, settings);\n }\n ServerConnection.makeRequest = makeRequest;\n /**\n * A wrapped error for a fetch response.\n */\n class ResponseError extends Error {\n /**\n * Create a ResponseError from a response, handling the traceback and message\n * as appropriate.\n *\n * @param response The response object.\n *\n * @returns A promise that resolves with a `ResponseError` object.\n */\n static async create(response) {\n try {\n const data = await response.json();\n const { message, traceback } = data;\n if (traceback) {\n console.error(traceback);\n }\n return new ResponseError(response, message !== null && message !== void 0 ? message : ResponseError._defaultMessage(response), traceback !== null && traceback !== void 0 ? traceback : '');\n }\n catch (e) {\n console.debug(e);\n return new ResponseError(response);\n }\n }\n /**\n * Create a new response error.\n */\n constructor(response, message = ResponseError._defaultMessage(response), traceback = '') {\n super(message);\n this.response = response;\n this.traceback = traceback;\n }\n static _defaultMessage(response) {\n return `Invalid response: ${response.status} ${response.statusText}`;\n }\n }\n ServerConnection.ResponseError = ResponseError;\n /**\n * A wrapped error for a network error.\n */\n class NetworkError extends TypeError {\n /**\n * Create a new network error.\n */\n constructor(original) {\n super(original.message);\n this.stack = original.stack;\n }\n }\n ServerConnection.NetworkError = NetworkError;\n})(ServerConnection || (exports.ServerConnection = ServerConnection = {}));\n/**\n * The namespace for module private data.\n */\nvar Private;\n(function (Private) {\n /**\n * Handle the server connection settings, returning a new value.\n */\n function makeSettings(options = {}) {\n var _a;\n const pageBaseUrl = coreutils_1.PageConfig.getBaseUrl();\n const pageWsUrl = coreutils_1.PageConfig.getWsUrl();\n const baseUrl = coreutils_1.URLExt.normalize(options.baseUrl) || pageBaseUrl;\n let wsUrl = options.wsUrl;\n // Prefer the default wsUrl if we are using the default baseUrl.\n if (!wsUrl && baseUrl === pageBaseUrl) {\n wsUrl = pageWsUrl;\n }\n // Otherwise convert the baseUrl to a wsUrl if possible.\n if (!wsUrl && baseUrl.indexOf('http') === 0) {\n wsUrl = 'ws' + baseUrl.slice(4);\n }\n // Otherwise fall back on the default wsUrl.\n wsUrl = wsUrl !== null && wsUrl !== void 0 ? wsUrl : pageWsUrl;\n const appendTokenConfig = coreutils_1.PageConfig.getOption('appendToken').toLowerCase();\n let appendToken;\n if (appendTokenConfig === '') {\n appendToken =\n typeof window === 'undefined' ||\n (typeof process !== 'undefined' &&\n ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.JEST_WORKER_ID) !== undefined) ||\n coreutils_1.URLExt.getHostName(pageBaseUrl) !== coreutils_1.URLExt.getHostName(wsUrl);\n }\n else {\n appendToken = appendTokenConfig === 'true';\n }\n return {\n init: { cache: 'no-store', credentials: 'same-origin' },\n fetch,\n Headers,\n Request,\n WebSocket: WEBSOCKET,\n token: coreutils_1.PageConfig.getToken(),\n appUrl: coreutils_1.PageConfig.getOption('appUrl'),\n appendToken,\n serializer: { serialize: serialize_1.serialize, deserialize: serialize_1.deserialize },\n ...options,\n baseUrl,\n wsUrl\n };\n }\n Private.makeSettings = makeSettings;\n /**\n * Handle a request.\n *\n * @param url - The url for the request.\n *\n * @param init - The overrides for the request init.\n *\n * @param settings - The settings object for the request.\n *\n * #### Notes\n * The `url` must start with `settings.baseUrl`. The `init` settings\n * take precedence over `settings.init`.\n */\n function handleRequest(url, init, settings) {\n var _a;\n // Handle notebook server requests.\n if (url.indexOf(settings.baseUrl) !== 0) {\n throw new Error('Can only be used for notebook server requests');\n }\n // Use explicit cache buster when `no-store` is set since\n // not all browsers use it properly.\n const cache = (_a = init.cache) !== null && _a !== void 0 ? _a : settings.init.cache;\n if (cache === 'no-store') {\n // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache\n url += (/\\?/.test(url) ? '&' : '?') + new Date().getTime();\n }\n const request = new settings.Request(url, { ...settings.init, ...init });\n // Handle authentication. Authentication can be overdetermined by\n // settings token and XSRF token.\n let authenticated = false;\n if (settings.token) {\n authenticated = true;\n request.headers.append('Authorization', `token ${settings.token}`);\n }\n if (typeof document !== 'undefined') {\n const xsrfToken = getCookie('_xsrf');\n if (xsrfToken !== undefined) {\n authenticated = true;\n request.headers.append('X-XSRFToken', xsrfToken);\n }\n }\n // Set the content type if there is no given data and we are\n // using an authenticated connection.\n if (!request.headers.has('Content-Type') && authenticated) {\n request.headers.set('Content-Type', 'application/json');\n }\n // Use `call` to avoid a `TypeError` in the browser.\n return settings.fetch.call(null, request).catch((e) => {\n // Convert the TypeError into a more specific error.\n throw new ServerConnection.NetworkError(e);\n });\n // TODO: *this* is probably where we need a system-wide connectionFailure\n // signal we can hook into.\n }\n Private.handleRequest = handleRequest;\n /**\n * Get a cookie from the document.\n */\n function getCookie(name) {\n // From http://www.tornadoweb.org/en/stable/guide/security.html\n let cookie = '';\n try {\n cookie = document.cookie;\n }\n catch (e) {\n // e.g. SecurityError in case of CSP Sandbox\n return;\n }\n const matches = cookie.match('\\\\b' + name + '=([^;]*)\\\\b');\n return matches === null || matches === void 0 ? void 0 : matches[1];\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=serverconnection.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SessionConnection = void 0;\nconst signaling_1 = require(\"@lumino/signaling\");\nconst __1 = require(\"..\");\nconst restapi_1 = require(\"./restapi\");\nconst coreutils_1 = require(\"@lumino/coreutils\");\n/**\n * Session object for accessing the session REST api. The session\n * should be used to start kernels and then shut them down -- for\n * all other kernel operations, the kernel object should be used.\n */\nclass SessionConnection {\n /**\n * Construct a new session.\n */\n constructor(options) {\n var _a, _b, _c, _d;\n this._id = '';\n this._path = '';\n this._name = '';\n this._type = '';\n this._kernel = null;\n this._isDisposed = false;\n this._disposed = new signaling_1.Signal(this);\n this._kernelChanged = new signaling_1.Signal(this);\n this._statusChanged = new signaling_1.Signal(this);\n this._connectionStatusChanged = new signaling_1.Signal(this);\n this._pendingInput = new signaling_1.Signal(this);\n this._iopubMessage = new signaling_1.Signal(this);\n this._unhandledMessage = new signaling_1.Signal(this);\n this._anyMessage = new signaling_1.Signal(this);\n this._propertyChanged = new signaling_1.Signal(this);\n this._id = options.model.id;\n this._name = options.model.name;\n this._path = options.model.path;\n this._type = options.model.type;\n this._username = (_a = options.username) !== null && _a !== void 0 ? _a : '';\n this._clientId = (_b = options.clientId) !== null && _b !== void 0 ? _b : coreutils_1.UUID.uuid4();\n this._connectToKernel = options.connectToKernel;\n this._kernelConnectionOptions = (_c = options.kernelConnectionOptions) !== null && _c !== void 0 ? _c : {};\n this.serverSettings =\n (_d = options.serverSettings) !== null && _d !== void 0 ? _d : __1.ServerConnection.makeSettings();\n this.setupKernel(options.model.kernel);\n }\n /**\n * A signal emitted when the session is disposed.\n */\n get disposed() {\n return this._disposed;\n }\n /**\n * A signal emitted when the kernel changes.\n */\n get kernelChanged() {\n return this._kernelChanged;\n }\n /**\n * A signal proxied from the connection about the kernel status.\n */\n get statusChanged() {\n return this._statusChanged;\n }\n /**\n * A signal proxied from the kernel about the connection status.\n */\n get connectionStatusChanged() {\n return this._connectionStatusChanged;\n }\n /**\n * A signal proxied from the kernel pending input.\n */\n get pendingInput() {\n return this._pendingInput;\n }\n /**\n * A signal proxied from the kernel about iopub kernel messages.\n */\n get iopubMessage() {\n return this._iopubMessage;\n }\n /**\n * A signal proxied from the kernel for an unhandled kernel message.\n */\n get unhandledMessage() {\n return this._unhandledMessage;\n }\n /**\n * A signal proxied from the kernel emitted for any kernel message.\n *\n * #### Notes\n * The behavior is undefined if the message is modified during message\n * handling. As such, it should be treated as read-only.\n */\n get anyMessage() {\n return this._anyMessage;\n }\n /**\n * A signal emitted when a session property changes.\n */\n get propertyChanged() {\n return this._propertyChanged;\n }\n /**\n * Get the session id.\n */\n get id() {\n return this._id;\n }\n /**\n * Get the session kernel connection object.\n *\n * #### Notes\n * This is a read-only property, and can be altered by [changeKernel].\n */\n get kernel() {\n return this._kernel;\n }\n /**\n * Get the session path.\n */\n get path() {\n return this._path;\n }\n /**\n * Get the session type.\n */\n get type() {\n return this._type;\n }\n /**\n * Get the session name.\n */\n get name() {\n return this._name;\n }\n /**\n * Get the model associated with the session.\n */\n get model() {\n return {\n id: this.id,\n kernel: this.kernel && { id: this.kernel.id, name: this.kernel.name },\n path: this._path,\n type: this._type,\n name: this._name\n };\n }\n /**\n * Test whether the session has been disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * Update the session based on a session model from the server.\n *\n * #### Notes\n * This only updates this session connection instance. Use `setPath`,\n * `setName`, `setType`, and `changeKernel` to change the session values on\n * the server.\n */\n update(model) {\n const oldModel = this.model;\n this._path = model.path;\n this._name = model.name;\n this._type = model.type;\n if ((this._kernel === null && model.kernel !== null) ||\n (this._kernel !== null && model.kernel === null) ||\n (this._kernel !== null &&\n model.kernel !== null &&\n this._kernel.id !== model.kernel.id)) {\n if (this._kernel !== null) {\n this._kernel.dispose();\n }\n const oldValue = this._kernel || null;\n this.setupKernel(model.kernel);\n const newValue = this._kernel || null;\n this._kernelChanged.emit({ name: 'kernel', oldValue, newValue });\n }\n this._handleModelChange(oldModel);\n }\n /**\n * Dispose of the resources held by the session.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n this._disposed.emit();\n if (this._kernel) {\n this._kernel.dispose();\n const oldValue = this._kernel;\n this._kernel = null;\n const newValue = this._kernel;\n this._kernelChanged.emit({ name: 'kernel', oldValue, newValue });\n }\n signaling_1.Signal.clearData(this);\n }\n /**\n * Change the session path.\n *\n * @param path - The new session path.\n *\n * @returns A promise that resolves when the session has renamed.\n *\n * #### Notes\n * This uses the Jupyter REST API, and the response is validated.\n * The promise is fulfilled on a valid response and rejected otherwise.\n */\n async setPath(path) {\n if (this.isDisposed) {\n throw new Error('Session is disposed');\n }\n await this._patch({ path });\n }\n /**\n * Change the session name.\n */\n async setName(name) {\n if (this.isDisposed) {\n throw new Error('Session is disposed');\n }\n await this._patch({ name });\n }\n /**\n * Change the session type.\n */\n async setType(type) {\n if (this.isDisposed) {\n throw new Error('Session is disposed');\n }\n await this._patch({ type });\n }\n /**\n * Change the kernel.\n *\n * @param options - The name or id of the new kernel.\n *\n * #### Notes\n * This shuts down the existing kernel and creates a new kernel,\n * keeping the existing session ID and session path.\n */\n async changeKernel(options) {\n if (this.isDisposed) {\n throw new Error('Session is disposed');\n }\n await this._patch({ kernel: options });\n return this.kernel;\n }\n /**\n * Kill the kernel and shutdown the session.\n *\n * @returns - The promise fulfilled on a valid response from the server.\n *\n * #### Notes\n * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/sessions), and validates the response.\n * Disposes of the session and emits a [sessionDied] signal on success.\n */\n async shutdown() {\n if (this.isDisposed) {\n throw new Error('Session is disposed');\n }\n await (0, restapi_1.shutdownSession)(this.id, this.serverSettings);\n this.dispose();\n }\n /**\n * Create a new kernel connection and connect to its signals.\n *\n * #### Notes\n * This method is not meant to be subclassed.\n */\n setupKernel(model) {\n if (model === null) {\n this._kernel = null;\n return;\n }\n const kc = this._connectToKernel({\n ...this._kernelConnectionOptions,\n model,\n username: this._username,\n clientId: this._clientId,\n serverSettings: this.serverSettings\n });\n this._kernel = kc;\n kc.statusChanged.connect(this.onKernelStatus, this);\n kc.connectionStatusChanged.connect(this.onKernelConnectionStatus, this);\n kc.pendingInput.connect(this.onPendingInput, this);\n kc.unhandledMessage.connect(this.onUnhandledMessage, this);\n kc.iopubMessage.connect(this.onIOPubMessage, this);\n kc.anyMessage.connect(this.onAnyMessage, this);\n }\n /**\n * Handle to changes in the Kernel status.\n */\n onKernelStatus(sender, state) {\n this._statusChanged.emit(state);\n }\n /**\n * Handle to changes in the Kernel status.\n */\n onKernelConnectionStatus(sender, state) {\n this._connectionStatusChanged.emit(state);\n }\n /**\n * Handle a change in the pendingInput.\n */\n onPendingInput(sender, state) {\n this._pendingInput.emit(state);\n }\n /**\n * Handle iopub kernel messages.\n */\n onIOPubMessage(sender, msg) {\n this._iopubMessage.emit(msg);\n }\n /**\n * Handle unhandled kernel messages.\n */\n onUnhandledMessage(sender, msg) {\n this._unhandledMessage.emit(msg);\n }\n /**\n * Handle any kernel messages.\n */\n onAnyMessage(sender, args) {\n this._anyMessage.emit(args);\n }\n /**\n * Send a PATCH to the server, updating the session path or the kernel.\n */\n async _patch(body) {\n const model = await (0, restapi_1.updateSession)({ ...body, id: this._id }, this.serverSettings);\n this.update(model);\n return model;\n }\n /**\n * Handle a change to the model.\n */\n _handleModelChange(oldModel) {\n if (oldModel.name !== this._name) {\n this._propertyChanged.emit('name');\n }\n if (oldModel.type !== this._type) {\n this._propertyChanged.emit('type');\n }\n if (oldModel.path !== this._path) {\n this._propertyChanged.emit('path');\n }\n }\n}\nexports.SessionConnection = SessionConnection;\n//# sourceMappingURL=default.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SessionAPI = exports.Session = void 0;\nconst Session = __importStar(require(\"./session\"));\nexports.Session = Session;\nconst SessionAPI = __importStar(require(\"./restapi\"));\nexports.SessionAPI = SessionAPI;\n__exportStar(require(\"./manager\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SessionManager = void 0;\nconst polling_1 = require(\"@lumino/polling\");\nconst signaling_1 = require(\"@lumino/signaling\");\nconst serverconnection_1 = require(\"../serverconnection\");\nconst basemanager_1 = require(\"../basemanager\");\nconst default_1 = require(\"./default\");\nconst restapi_1 = require(\"./restapi\");\n/**\n * An implementation of a session manager.\n */\nclass SessionManager extends basemanager_1.BaseManager {\n /**\n * Construct a new session manager.\n *\n * @param options - The default options for each session.\n */\n constructor(options) {\n var _a;\n super(options);\n this._isReady = false;\n this._sessionConnections = new Set();\n this._models = new Map();\n this._runningChanged = new signaling_1.Signal(this);\n this._connectionFailure = new signaling_1.Signal(this);\n // We define these here so they bind `this` correctly\n this._connectToKernel = (options) => {\n return this._kernelManager.connectTo(options);\n };\n this._kernelManager = options.kernelManager;\n // Start model polling with exponential backoff.\n this._pollModels = new polling_1.Poll({\n auto: false,\n factory: () => this.requestRunning(),\n frequency: {\n interval: 10 * 1000,\n backoff: true,\n max: 300 * 1000\n },\n name: `@jupyterlab/services:SessionManager#models`,\n standby: (_a = options.standby) !== null && _a !== void 0 ? _a : 'when-hidden'\n });\n // Initialize internal data.\n this._ready = (async () => {\n await this._pollModels.start();\n await this._pollModels.tick;\n if (this._kernelManager.isActive) {\n await this._kernelManager.ready;\n }\n this._isReady = true;\n })();\n }\n /**\n * Test whether the manager is ready.\n */\n get isReady() {\n return this._isReady;\n }\n /**\n * A promise that fulfills when the manager is ready.\n */\n get ready() {\n return this._ready;\n }\n /**\n * A signal emitted when the running sessions change.\n */\n get runningChanged() {\n return this._runningChanged;\n }\n /**\n * A signal emitted when there is a connection failure.\n */\n get connectionFailure() {\n return this._connectionFailure;\n }\n /**\n * Dispose of the resources used by the manager.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._models.clear();\n this._sessionConnections.forEach(x => x.dispose());\n this._pollModels.dispose();\n super.dispose();\n }\n /*\n * Connect to a running session. See also [[connectToSession]].\n */\n connectTo(options) {\n const sessionConnection = new default_1.SessionConnection({\n ...options,\n connectToKernel: this._connectToKernel,\n serverSettings: this.serverSettings\n });\n this._onStarted(sessionConnection);\n if (!this._models.has(options.model.id)) {\n // We trust the user to connect to an existing session, but we verify\n // asynchronously.\n void this.refreshRunning().catch(() => {\n /* no-op */\n });\n }\n return sessionConnection;\n }\n /**\n * Create an iterator over the most recent running sessions.\n *\n * @returns A new iterator over the running sessions.\n */\n running() {\n return this._models.values();\n }\n /**\n * Force a refresh of the running sessions.\n *\n * @returns A promise that with the list of running sessions.\n *\n * #### Notes\n * This is not typically meant to be called by the user, since the\n * manager maintains its own internal state.\n */\n async refreshRunning() {\n await this._pollModels.refresh();\n await this._pollModels.tick;\n }\n /**\n * Start a new session. See also [[startNewSession]].\n *\n * @param createOptions - Options for creating the session\n *\n * @param connectOptions - Options for connecting to the session\n */\n async startNew(createOptions, connectOptions = {}) {\n const model = await (0, restapi_1.startSession)(createOptions, this.serverSettings);\n await this.refreshRunning();\n return this.connectTo({ ...connectOptions, model });\n }\n /**\n * Shut down a session by id.\n */\n async shutdown(id) {\n await (0, restapi_1.shutdownSession)(id, this.serverSettings);\n await this.refreshRunning();\n }\n /**\n * Shut down all sessions.\n *\n * @returns A promise that resolves when all of the kernels are shut down.\n */\n async shutdownAll() {\n // Update the list of models to make sure our list is current.\n await this.refreshRunning();\n // Shut down all models.\n await Promise.all([...this._models.keys()].map(id => (0, restapi_1.shutdownSession)(id, this.serverSettings)));\n // Update the list of models to clear out our state.\n await this.refreshRunning();\n }\n /**\n * Find a session associated with a path and stop it if it is the only session\n * using that kernel.\n *\n * @param path - The path in question.\n *\n * @returns A promise that resolves when the relevant sessions are stopped.\n */\n async stopIfNeeded(path) {\n try {\n const sessions = await (0, restapi_1.listRunning)(this.serverSettings);\n const matches = sessions.filter(value => value.path === path);\n if (matches.length === 1) {\n const id = matches[0].id;\n await this.shutdown(id);\n }\n }\n catch (error) {\n /* Always succeed. */\n }\n }\n /**\n * Find a session by id.\n */\n async findById(id) {\n if (this._models.has(id)) {\n return this._models.get(id);\n }\n await this.refreshRunning();\n return this._models.get(id);\n }\n /**\n * Find a session by path.\n */\n async findByPath(path) {\n for (const m of this._models.values()) {\n if (m.path === path) {\n return m;\n }\n }\n await this.refreshRunning();\n for (const m of this._models.values()) {\n if (m.path === path) {\n return m;\n }\n }\n return undefined;\n }\n /**\n * Execute a request to the server to poll running kernels and update state.\n */\n async requestRunning() {\n var _a, _b;\n let models;\n try {\n models = await (0, restapi_1.listRunning)(this.serverSettings);\n }\n catch (err) {\n // Handle network errors, as well as cases where we are on a\n // JupyterHub and the server is not running. JupyterHub returns a\n // 503 (<2.0) or 424 (>2.0) in that case.\n if (err instanceof serverconnection_1.ServerConnection.NetworkError ||\n ((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 503 ||\n ((_b = err.response) === null || _b === void 0 ? void 0 : _b.status) === 424) {\n this._connectionFailure.emit(err);\n }\n throw err;\n }\n if (this.isDisposed) {\n return;\n }\n if (this._models.size === models.length &&\n models.every(model => {\n var _a, _b, _c, _d;\n const existing = this._models.get(model.id);\n if (!existing) {\n return false;\n }\n return (((_a = existing.kernel) === null || _a === void 0 ? void 0 : _a.id) === ((_b = model.kernel) === null || _b === void 0 ? void 0 : _b.id) &&\n ((_c = existing.kernel) === null || _c === void 0 ? void 0 : _c.name) === ((_d = model.kernel) === null || _d === void 0 ? void 0 : _d.name) &&\n existing.name === model.name &&\n existing.path === model.path &&\n existing.type === model.type);\n })) {\n // Identical models list (presuming models does not contain duplicate\n // ids), so just return\n return;\n }\n this._models = new Map(models.map(x => [x.id, x]));\n this._sessionConnections.forEach(sc => {\n if (this._models.has(sc.id)) {\n sc.update(this._models.get(sc.id));\n }\n else {\n sc.dispose();\n }\n });\n this._runningChanged.emit(models);\n }\n /**\n * Handle a session starting.\n */\n _onStarted(sessionConnection) {\n this._sessionConnections.add(sessionConnection);\n sessionConnection.disposed.connect(this._onDisposed, this);\n sessionConnection.propertyChanged.connect(this._onChanged, this);\n sessionConnection.kernelChanged.connect(this._onChanged, this);\n }\n _onDisposed(sessionConnection) {\n this._sessionConnections.delete(sessionConnection);\n // A session termination emission could mean the server session is deleted,\n // or that the session JS object is disposed and the session still exists on\n // the server, so we refresh from the server to make sure we reflect the\n // server state.\n void this.refreshRunning().catch(() => {\n /* no-op */\n });\n }\n _onChanged() {\n void this.refreshRunning().catch(() => {\n /* no-op */\n });\n }\n}\nexports.SessionManager = SessionManager;\n/**\n * The namespace for `SessionManager` class statics.\n */\n(function (SessionManager) {\n /**\n * A no-op session manager to be used when starting sessions is not supported.\n */\n class NoopManager extends SessionManager {\n constructor() {\n super(...arguments);\n this._readyPromise = new Promise(() => {\n /* no-op */\n });\n }\n /**\n * Whether the manager is active.\n */\n get isActive() {\n return false;\n }\n /**\n * Used for testing.\n */\n get parentReady() {\n return super.ready;\n }\n /**\n * Start a new session - throw an error since it is not supported.\n */\n async startNew(createOptions, connectOptions = {}) {\n return Promise.reject(new Error('Not implemented in no-op Session Manager'));\n }\n /*\n * Connect to a running session - throw an error since it is not supported.\n */\n connectTo(options) {\n throw Error('Not implemented in no-op Session Manager');\n }\n /**\n * A promise that fulfills when the manager is ready (never).\n */\n get ready() {\n return this.parentReady.then(() => this._readyPromise);\n }\n /**\n * Shut down a session by id - throw an error since it is not supported.\n */\n async shutdown(id) {\n return Promise.reject(new Error('Not implemented in no-op Session Manager'));\n }\n /**\n * Execute a request to the server to poll running sessions and update state.\n */\n async requestRunning() {\n return Promise.resolve();\n }\n }\n SessionManager.NoopManager = NoopManager;\n})(SessionManager || (exports.SessionManager = SessionManager = {}));\n//# sourceMappingURL=manager.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateSession = exports.startSession = exports.getSessionModel = exports.shutdownSession = exports.getSessionUrl = exports.listRunning = exports.SESSION_SERVICE_URL = void 0;\nconst serverconnection_1 = require(\"../serverconnection\");\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\nconst validate_1 = require(\"./validate\");\n/**\n * The url for the session service.\n */\nexports.SESSION_SERVICE_URL = 'api/sessions';\n/**\n * List the running sessions.\n */\nasync function listRunning(settings = serverconnection_1.ServerConnection.makeSettings()) {\n const url = coreutils_1.URLExt.join(settings.baseUrl, exports.SESSION_SERVICE_URL);\n const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);\n if (response.status !== 200) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n if (!Array.isArray(data)) {\n throw new Error('Invalid Session list');\n }\n data.forEach(m => {\n (0, validate_1.updateLegacySessionModel)(m);\n (0, validate_1.validateModel)(m);\n });\n return data;\n}\nexports.listRunning = listRunning;\n/**\n * Get a session url.\n */\nfunction getSessionUrl(baseUrl, id) {\n const servicesBase = coreutils_1.URLExt.join(baseUrl, exports.SESSION_SERVICE_URL);\n const result = coreutils_1.URLExt.join(servicesBase, id);\n if (!result.startsWith(servicesBase)) {\n throw new Error('Can only be used for services requests');\n }\n return result;\n}\nexports.getSessionUrl = getSessionUrl;\n/**\n * Shut down a session by id.\n */\nasync function shutdownSession(id, settings = serverconnection_1.ServerConnection.makeSettings()) {\n var _a;\n const url = getSessionUrl(settings.baseUrl, id);\n const init = { method: 'DELETE' };\n const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n if (response.status === 404) {\n const data = await response.json();\n const msg = (_a = data.message) !== null && _a !== void 0 ? _a : `The session \"${id}\"\" does not exist on the server`;\n console.warn(msg);\n }\n else if (response.status === 410) {\n throw new serverconnection_1.ServerConnection.ResponseError(response, 'The kernel was deleted but the session was not');\n }\n else if (response.status !== 204) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n}\nexports.shutdownSession = shutdownSession;\n/**\n * Get a full session model from the server by session id string.\n */\nasync function getSessionModel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {\n const url = getSessionUrl(settings.baseUrl, id);\n const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);\n if (response.status !== 200) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n (0, validate_1.updateLegacySessionModel)(data);\n (0, validate_1.validateModel)(data);\n return data;\n}\nexports.getSessionModel = getSessionModel;\n/**\n * Create a new session, or return an existing session if the session path\n * already exists.\n */\nasync function startSession(options, settings = serverconnection_1.ServerConnection.makeSettings()) {\n const url = coreutils_1.URLExt.join(settings.baseUrl, exports.SESSION_SERVICE_URL);\n const init = {\n method: 'POST',\n body: JSON.stringify(options)\n };\n const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n if (response.status !== 201) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n (0, validate_1.updateLegacySessionModel)(data);\n (0, validate_1.validateModel)(data);\n return data;\n}\nexports.startSession = startSession;\n/**\n * Send a PATCH to the server, updating the session path or the kernel.\n */\nasync function updateSession(model, settings = serverconnection_1.ServerConnection.makeSettings()) {\n const url = getSessionUrl(settings.baseUrl, model.id);\n const init = {\n method: 'PATCH',\n body: JSON.stringify(model)\n };\n const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n if (response.status !== 200) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n (0, validate_1.updateLegacySessionModel)(data);\n (0, validate_1.validateModel)(data);\n return data;\n}\nexports.updateSession = updateSession;\n//# sourceMappingURL=restapi.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=session.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateModels = exports.updateLegacySessionModel = exports.validateModel = void 0;\nconst validate_1 = require(\"../kernel/validate\");\nconst validate_2 = require(\"../validate\");\n/**\n * Validate an `Session.IModel` object.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nfunction validateModel(data) {\n (0, validate_2.validateProperty)(data, 'id', 'string');\n (0, validate_2.validateProperty)(data, 'type', 'string');\n (0, validate_2.validateProperty)(data, 'name', 'string');\n (0, validate_2.validateProperty)(data, 'path', 'string');\n (0, validate_2.validateProperty)(data, 'kernel', 'object');\n (0, validate_1.validateModel)(data.kernel);\n}\nexports.validateModel = validateModel;\n/**\n * Update model from legacy session data.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nfunction updateLegacySessionModel(data) {\n if (data.path === undefined && data.notebook !== undefined) {\n data.path = data.notebook.path;\n data.type = 'notebook';\n data.name = '';\n }\n}\nexports.updateLegacySessionModel = updateLegacySessionModel;\n/**\n * Validate an array of `Session.IModel` objects.\n */\nfunction validateModels(models) {\n if (!Array.isArray(models)) {\n throw new Error('Invalid session list');\n }\n models.forEach(d => validateModel(d));\n}\nexports.validateModels = validateModels;\n//# sourceMappingURL=validate.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SettingManager = void 0;\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\nconst statedb_1 = require(\"@jupyterlab/statedb\");\nconst serverconnection_1 = require(\"../serverconnection\");\n/**\n * The url for the lab settings service.\n */\nconst SERVICE_SETTINGS_URL = 'api/settings';\n/**\n * The settings API service manager.\n */\nclass SettingManager extends statedb_1.DataConnector {\n /**\n * Create a new setting manager.\n */\n constructor(options = {}) {\n var _a;\n super();\n this.serverSettings =\n (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();\n }\n /**\n * Fetch a plugin's settings.\n *\n * @param id - The plugin's ID.\n *\n * @returns A promise that resolves if successful.\n */\n async fetch(id) {\n if (!id) {\n throw new Error('Plugin `id` parameter is required for settings fetch.');\n }\n const { serverSettings } = this;\n const { baseUrl, appUrl } = serverSettings;\n const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n const base = baseUrl + appUrl;\n const url = Private.url(base, id);\n const response = await makeRequest(url, {}, serverSettings);\n if (response.status !== 200) {\n const err = await ResponseError.create(response);\n throw err;\n }\n // Assert what type the server response is returning.\n return response.json();\n }\n /**\n * Fetch the list of all plugin setting bundles.\n *\n * @returns A promise that resolves if successful.\n */\n async list(query) {\n var _a, _b, _c, _d;\n const { serverSettings } = this;\n const { baseUrl, appUrl } = serverSettings;\n const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n const base = baseUrl + appUrl;\n const url = Private.url(base, '', query === 'ids');\n const response = await makeRequest(url, {}, serverSettings);\n if (response.status !== 200) {\n throw new ResponseError(response);\n }\n const json = await response.json();\n const ids = (_b = (_a = json === null || json === void 0 ? void 0 : json['settings']) === null || _a === void 0 ? void 0 : _a.map((plugin) => plugin.id)) !== null && _b !== void 0 ? _b : [];\n let values = [];\n if (!query) {\n values =\n (_d = (_c = json === null || json === void 0 ? void 0 : json['settings']) === null || _c === void 0 ? void 0 : _c.map((plugin) => {\n plugin.data = { composite: {}, user: {} };\n return plugin;\n })) !== null && _d !== void 0 ? _d : [];\n }\n return { ids, values };\n }\n /**\n * Save a plugin's settings.\n *\n * @param id - The plugin's ID.\n *\n * @param raw - The user setting values as a raw string of JSON with comments.\n *\n * @returns A promise that resolves if successful.\n */\n async save(id, raw) {\n const { serverSettings } = this;\n const { baseUrl, appUrl } = serverSettings;\n const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n const base = baseUrl + appUrl;\n const url = Private.url(base, id);\n // NOTE: 'raw' is JSON5 (not valid JSON), so we encode it as a string in a valid JSON body\n const init = { body: JSON.stringify({ raw }), method: 'PUT' };\n const response = await makeRequest(url, init, serverSettings);\n if (response.status !== 204) {\n throw new ResponseError(response);\n }\n }\n}\nexports.SettingManager = SettingManager;\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n /**\n * Get the url for a plugin's settings.\n */\n function url(base, id, idsOnly) {\n const idsOnlyParam = idsOnly\n ? coreutils_1.URLExt.objectToQueryString({ ids_only: true })\n : '';\n const settingsBase = coreutils_1.URLExt.join(base, SERVICE_SETTINGS_URL);\n const result = coreutils_1.URLExt.join(settingsBase, id);\n if (!result.startsWith(settingsBase)) {\n throw new Error('Can only be used for workspaces requests');\n }\n return `${result}${idsOnlyParam}`;\n }\n Private.url = url;\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = WebSocket;\n//# sourceMappingURL=ws.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TerminalConnection = void 0;\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\nconst coreutils_2 = require(\"@lumino/coreutils\");\nconst signaling_1 = require(\"@lumino/signaling\");\nconst __1 = require(\"..\");\nconst restapi_1 = require(\"./restapi\");\n/**\n * An implementation of a terminal interface.\n */\nclass TerminalConnection {\n /**\n * Construct a new terminal session.\n */\n constructor(options) {\n var _a;\n /**\n * Create the terminal websocket connection and add socket status handlers.\n *\n * #### Notes\n * You are responsible for updating the connection status as appropriate.\n */\n this._createSocket = () => {\n this._errorIfDisposed();\n // Make sure the socket is clear\n this._clearSocket();\n // Update the connection status to reflect opening a new connection.\n this._updateConnectionStatus('connecting');\n const name = this._name;\n const settings = this.serverSettings;\n let url = coreutils_1.URLExt.join(settings.wsUrl, 'terminals', 'websocket', encodeURIComponent(name));\n // If token authentication is in use.\n const token = settings.token;\n if (settings.appendToken && token !== '') {\n url = url + `?token=${encodeURIComponent(token)}`;\n }\n this._ws = new settings.WebSocket(url);\n this._ws.onmessage = this._onWSMessage;\n this._ws.onclose = this._onWSClose;\n this._ws.onerror = this._onWSClose;\n };\n // Websocket messages events are defined as variables to bind `this`\n this._onWSMessage = (event) => {\n if (this._isDisposed) {\n return;\n }\n const data = JSON.parse(event.data);\n // Handle a disconnect message.\n if (data[0] === 'disconnect') {\n this.dispose();\n }\n if (this._connectionStatus === 'connecting') {\n // After reconnection, ignore all messages until a 'setup' message\n // before we are truly connected. Setting the connection status to\n // connected only then means that if we do not get a setup message\n // before our retry timeout, we will delete the websocket and try again.\n if (data[0] === 'setup') {\n this._updateConnectionStatus('connected');\n }\n return;\n }\n this._messageReceived.emit({\n type: data[0],\n content: data.slice(1)\n });\n };\n this._onWSClose = (event) => {\n console.warn(`Terminal websocket closed: ${event.code}`);\n if (!this.isDisposed) {\n this._reconnect();\n }\n };\n this._connectionStatus = 'connecting';\n this._connectionStatusChanged = new signaling_1.Signal(this);\n this._isDisposed = false;\n this._disposed = new signaling_1.Signal(this);\n this._messageReceived = new signaling_1.Signal(this);\n this._reconnectTimeout = null;\n this._ws = null;\n this._noOp = () => {\n /* no-op */\n };\n this._reconnectLimit = 7;\n this._reconnectAttempt = 0;\n this._pendingMessages = [];\n this._name = options.model.name;\n this.serverSettings =\n (_a = options.serverSettings) !== null && _a !== void 0 ? _a : __1.ServerConnection.makeSettings();\n this._createSocket();\n }\n /**\n * A signal emitted when the session is disposed.\n */\n get disposed() {\n return this._disposed;\n }\n /**\n * A signal emitted when a message is received from the server.\n */\n get messageReceived() {\n return this._messageReceived;\n }\n /**\n * Get the name of the terminal session.\n */\n get name() {\n return this._name;\n }\n /**\n * Get the model for the terminal session.\n */\n get model() {\n return { name: this._name };\n }\n /**\n * Test whether the session is disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * Dispose of the resources held by the session.\n */\n dispose() {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n this._disposed.emit();\n this._updateConnectionStatus('disconnected');\n this._clearSocket();\n signaling_1.Signal.clearData(this);\n }\n /**\n * Send a message to the terminal session.\n *\n * #### Notes\n * If the connection is down, the message will be queued for sending when\n * the connection comes back up.\n */\n send(message) {\n this._sendMessage(message);\n }\n /**\n * Send a message on the websocket, or possibly queue for later sending.\n *\n * @param queue - whether to queue the message if it cannot be sent\n */\n _sendMessage(message, queue = true) {\n if (this._isDisposed || !message.content) {\n return;\n }\n if (this.connectionStatus === 'connected' && this._ws) {\n const msg = [message.type, ...message.content];\n this._ws.send(JSON.stringify(msg));\n }\n else if (queue) {\n this._pendingMessages.push(message);\n }\n else {\n throw new Error(`Could not send message: ${JSON.stringify(message)}`);\n }\n }\n /**\n * Send pending messages to the kernel.\n */\n _sendPending() {\n // We check to make sure we are still connected each time. For\n // example, if a websocket buffer overflows, it may close, so we should\n // stop sending messages.\n while (this.connectionStatus === 'connected' &&\n this._pendingMessages.length > 0) {\n this._sendMessage(this._pendingMessages[0], false);\n // We shift the message off the queue after the message is sent so that\n // if there is an exception, the message is still pending.\n this._pendingMessages.shift();\n }\n }\n /**\n * Reconnect to a terminal.\n *\n * #### Notes\n * This may try multiple times to reconnect to a terminal, and will sever\n * any existing connection.\n */\n reconnect() {\n this._errorIfDisposed();\n const result = new coreutils_2.PromiseDelegate();\n // Set up a listener for the connection status changing, which accepts or\n // rejects after the retries are done.\n const fulfill = (sender, status) => {\n if (status === 'connected') {\n result.resolve();\n this.connectionStatusChanged.disconnect(fulfill, this);\n }\n else if (status === 'disconnected') {\n result.reject(new Error('Terminal connection disconnected'));\n this.connectionStatusChanged.disconnect(fulfill, this);\n }\n };\n this.connectionStatusChanged.connect(fulfill, this);\n // Reset the reconnect limit so we start the connection attempts fresh\n this._reconnectAttempt = 0;\n // Start the reconnection process, which will also clear any existing\n // connection.\n this._reconnect();\n // Return the promise that should resolve on connection or reject if the\n // retries don't work.\n return result.promise;\n }\n /**\n * Attempt a connection if we have not exhausted connection attempts.\n */\n _reconnect() {\n this._errorIfDisposed();\n // Clear any existing reconnection attempt\n clearTimeout(this._reconnectTimeout);\n // Update the connection status and schedule a possible reconnection.\n if (this._reconnectAttempt < this._reconnectLimit) {\n this._updateConnectionStatus('connecting');\n // The first reconnect attempt should happen immediately, and subsequent\n // attempts should pick a random number in a growing range so that we\n // don't overload the server with synchronized reconnection attempts\n // across multiple kernels.\n const timeout = Private.getRandomIntInclusive(0, 1e3 * (Math.pow(2, this._reconnectAttempt) - 1));\n console.error(`Connection lost, reconnecting in ${Math.floor(timeout / 1000)} seconds.`);\n this._reconnectTimeout = setTimeout(this._createSocket, timeout);\n this._reconnectAttempt += 1;\n }\n else {\n this._updateConnectionStatus('disconnected');\n }\n // Clear the websocket event handlers and the socket itself.\n this._clearSocket();\n }\n /**\n * Forcefully clear the socket state.\n *\n * #### Notes\n * This will clear all socket state without calling any handlers and will\n * not update the connection status. If you call this method, you are\n * responsible for updating the connection status as needed and recreating\n * the socket if you plan to reconnect.\n */\n _clearSocket() {\n if (this._ws !== null) {\n // Clear the websocket event handlers and the socket itself.\n this._ws.onopen = this._noOp;\n this._ws.onclose = this._noOp;\n this._ws.onerror = this._noOp;\n this._ws.onmessage = this._noOp;\n this._ws.close();\n this._ws = null;\n }\n }\n /**\n * Shut down the terminal session.\n */\n async shutdown() {\n await (0, restapi_1.shutdownTerminal)(this.name, this.serverSettings);\n this.dispose();\n }\n /**\n * Clone the current terminal connection.\n */\n clone() {\n return new TerminalConnection(this);\n }\n /**\n * Handle connection status changes.\n */\n _updateConnectionStatus(connectionStatus) {\n if (this._connectionStatus === connectionStatus) {\n return;\n }\n this._connectionStatus = connectionStatus;\n // If we are not 'connecting', stop any reconnection attempts.\n if (connectionStatus !== 'connecting') {\n this._reconnectAttempt = 0;\n clearTimeout(this._reconnectTimeout);\n }\n // Send the pending messages if we just connected.\n if (connectionStatus === 'connected') {\n this._sendPending();\n }\n // Notify others that the connection status changed.\n this._connectionStatusChanged.emit(connectionStatus);\n }\n /**\n * Utility function to throw an error if this instance is disposed.\n */\n _errorIfDisposed() {\n if (this.isDisposed) {\n throw new Error('Terminal connection is disposed');\n }\n }\n /**\n * A signal emitted when the terminal connection status changes.\n */\n get connectionStatusChanged() {\n return this._connectionStatusChanged;\n }\n /**\n * The current connection status of the terminal connection.\n */\n get connectionStatus() {\n return this._connectionStatus;\n }\n}\nexports.TerminalConnection = TerminalConnection;\nvar Private;\n(function (Private) {\n /**\n * Get the url for a terminal.\n */\n function getTermUrl(baseUrl, name) {\n return coreutils_1.URLExt.join(baseUrl, restapi_1.TERMINAL_SERVICE_URL, encodeURIComponent(name));\n }\n Private.getTermUrl = getTermUrl;\n /**\n * Get a random integer between min and max, inclusive of both.\n *\n * #### Notes\n * From\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#Getting_a_random_integer_between_two_values_inclusive\n *\n * From the MDN page: It might be tempting to use Math.round() to accomplish\n * that, but doing so would cause your random numbers to follow a non-uniform\n * distribution, which may not be acceptable for your needs.\n */\n function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }\n Private.getRandomIntInclusive = getRandomIntInclusive;\n})(Private || (Private = {}));\n//# sourceMappingURL=default.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TerminalAPI = exports.Terminal = void 0;\nconst Terminal = __importStar(require(\"./terminal\"));\nexports.Terminal = Terminal;\nconst TerminalAPI = __importStar(require(\"./restapi\"));\nexports.TerminalAPI = TerminalAPI;\n__exportStar(require(\"./manager\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TerminalManager = void 0;\nconst polling_1 = require(\"@lumino/polling\");\nconst signaling_1 = require(\"@lumino/signaling\");\nconst __1 = require(\"..\");\nconst basemanager_1 = require(\"../basemanager\");\nconst restapi_1 = require(\"./restapi\");\nconst default_1 = require(\"./default\");\n/**\n * A terminal session manager.\n */\nclass TerminalManager extends basemanager_1.BaseManager {\n /**\n * Construct a new terminal manager.\n */\n constructor(options = {}) {\n var _a;\n super(options);\n this._isReady = false;\n // As an optimization, we unwrap the models to just store the names.\n this._names = [];\n this._terminalConnections = new Set();\n this._runningChanged = new signaling_1.Signal(this);\n this._connectionFailure = new signaling_1.Signal(this);\n // Check if terminals are available\n if (!this.isAvailable()) {\n this._ready = Promise.reject('Terminals unavailable');\n this._ready.catch(_ => undefined);\n return;\n }\n // Start polling with exponential backoff.\n this._pollModels = new polling_1.Poll({\n auto: false,\n factory: () => this.requestRunning(),\n frequency: {\n interval: 10 * 1000,\n backoff: true,\n max: 300 * 1000\n },\n name: `@jupyterlab/services:TerminalManager#models`,\n standby: (_a = options.standby) !== null && _a !== void 0 ? _a : 'when-hidden'\n });\n // Initialize internal data.\n this._ready = (async () => {\n await this._pollModels.start();\n await this._pollModels.tick;\n this._isReady = true;\n })();\n }\n /**\n * Test whether the manager is ready.\n */\n get isReady() {\n return this._isReady;\n }\n /**\n * A promise that fulfills when the manager is ready.\n */\n get ready() {\n return this._ready;\n }\n /**\n * A signal emitted when the running terminals change.\n */\n get runningChanged() {\n return this._runningChanged;\n }\n /**\n * A signal emitted when there is a connection failure.\n */\n get connectionFailure() {\n return this._connectionFailure;\n }\n /**\n * Dispose of the resources used by the manager.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._names.length = 0;\n this._terminalConnections.forEach(x => x.dispose());\n this._pollModels.dispose();\n super.dispose();\n }\n /**\n * Whether the terminal service is available.\n */\n isAvailable() {\n return (0, restapi_1.isAvailable)();\n }\n /*\n * Connect to a running terminal.\n *\n * @param options - The options used to connect to the terminal.\n *\n * @returns The new terminal connection instance.\n *\n * #### Notes\n * The manager `serverSettings` will be used.\n */\n connectTo(options) {\n const terminalConnection = new default_1.TerminalConnection({\n ...options,\n serverSettings: this.serverSettings\n });\n this._onStarted(terminalConnection);\n if (!this._names.includes(options.model.name)) {\n // We trust the user to connect to an existing session, but we verify\n // asynchronously.\n void this.refreshRunning().catch(() => {\n /* no-op */\n });\n }\n return terminalConnection;\n }\n /**\n * Create an iterator over the most recent running terminals.\n *\n * @returns A new iterator over the running terminals.\n */\n running() {\n return this._models[Symbol.iterator]();\n }\n /**\n * Force a refresh of the running terminals.\n *\n * @returns A promise that with the list of running terminals.\n *\n * #### Notes\n * This is intended to be called only in response to a user action,\n * since the manager maintains its internal state.\n */\n async refreshRunning() {\n await this._pollModels.refresh();\n await this._pollModels.tick;\n }\n /**\n * Create a new terminal session.\n *\n * @param options - The options used to create the terminal.\n *\n * @returns A promise that resolves with the terminal connection instance.\n *\n * #### Notes\n * The manager `serverSettings` will be used unless overridden in the\n * options.\n */\n async startNew(options) {\n const model = await (0, restapi_1.startNew)(this.serverSettings, options === null || options === void 0 ? void 0 : options.name, options === null || options === void 0 ? void 0 : options.cwd);\n await this.refreshRunning();\n return this.connectTo({ model });\n }\n /**\n * Shut down a terminal session by name.\n */\n async shutdown(name) {\n await (0, restapi_1.shutdownTerminal)(name, this.serverSettings);\n await this.refreshRunning();\n }\n /**\n * Shut down all terminal sessions.\n *\n * @returns A promise that resolves when all of the sessions are shut down.\n */\n async shutdownAll() {\n // Update the list of models to make sure our list is current.\n await this.refreshRunning();\n // Shut down all models.\n await Promise.all(this._names.map(name => (0, restapi_1.shutdownTerminal)(name, this.serverSettings)));\n // Update the list of models to clear out our state.\n await this.refreshRunning();\n }\n /**\n * Execute a request to the server to poll running terminals and update state.\n */\n async requestRunning() {\n var _a, _b;\n let models;\n try {\n models = await (0, restapi_1.listRunning)(this.serverSettings);\n }\n catch (err) {\n // Handle network errors, as well as cases where we are on a\n // JupyterHub and the server is not running. JupyterHub returns a\n // 503 (<2.0) or 424 (>2.0) in that case.\n if (err instanceof __1.ServerConnection.NetworkError ||\n ((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 503 ||\n ((_b = err.response) === null || _b === void 0 ? void 0 : _b.status) === 424) {\n this._connectionFailure.emit(err);\n }\n throw err;\n }\n if (this.isDisposed) {\n return;\n }\n const names = models.map(({ name }) => name).sort();\n if (names === this._names) {\n // Identical models list, so just return\n return;\n }\n this._names = names;\n this._terminalConnections.forEach(tc => {\n if (!names.includes(tc.name)) {\n tc.dispose();\n }\n });\n this._runningChanged.emit(this._models);\n }\n /**\n * Handle a session starting.\n */\n _onStarted(terminalConnection) {\n this._terminalConnections.add(terminalConnection);\n terminalConnection.disposed.connect(this._onDisposed, this);\n }\n /**\n * Handle a session terminating.\n */\n _onDisposed(terminalConnection) {\n this._terminalConnections.delete(terminalConnection);\n // Update the running models to make sure we reflect the server state\n void this.refreshRunning().catch(() => {\n /* no-op */\n });\n }\n get _models() {\n return this._names.map(name => {\n return { name };\n });\n }\n}\nexports.TerminalManager = TerminalManager;\n/**\n * The namespace for TerminalManager statics.\n */\n(function (TerminalManager) {\n /**\n * A no-op terminal manager to be used when starting terminals is not supported.\n */\n class NoopManager extends TerminalManager {\n constructor() {\n super(...arguments);\n this._readyPromise = new Promise(() => {\n /* no-op */\n });\n }\n /**\n * Whether the manager is active.\n */\n get isActive() {\n return false;\n }\n /**\n * Used for testing.\n */\n get parentReady() {\n return super.ready;\n }\n /**\n * A promise that fulfills when the manager is ready (never).\n */\n get ready() {\n return this.parentReady.then(() => this._readyPromise);\n }\n /**\n * Create a new terminal session - throw an error since it is not supported.\n *\n */\n async startNew(options) {\n return Promise.reject(new Error('Not implemented in no-op Terminal Manager'));\n }\n /*\n * Connect to a running terminal - throw an error since it is not supported.\n */\n connectTo(options) {\n throw Error('Not implemented in no-op Terminal Manager');\n }\n /**\n * Shut down a session by id - throw an error since it is not supported.\n */\n async shutdown(id) {\n return Promise.reject(new Error('Not implemented in no-op Terminal Manager'));\n }\n /**\n * Execute a request to the server to poll running sessions and update state.\n */\n async requestRunning() {\n return Promise.resolve();\n }\n }\n TerminalManager.NoopManager = NoopManager;\n})(TerminalManager || (exports.TerminalManager = TerminalManager = {}));\n//# sourceMappingURL=manager.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.shutdownTerminal = exports.listRunning = exports.startNew = exports.isAvailable = exports.TERMINAL_SERVICE_URL = void 0;\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\nconst serverconnection_1 = require(\"../serverconnection\");\n/**\n * The url for the terminal service.\n */\nexports.TERMINAL_SERVICE_URL = 'api/terminals';\n/**\n * Whether the terminal service is available.\n */\nfunction isAvailable() {\n const available = String(coreutils_1.PageConfig.getOption('terminalsAvailable'));\n return available.toLowerCase() === 'true';\n}\nexports.isAvailable = isAvailable;\n/**\n * Start a new terminal session.\n *\n * @param settings - The server settings to use.\n *\n * @param name - The name of the target terminal.\n *\n * @param cwd - The path in which the terminal will start.\n *\n * @returns A promise that resolves with the session model.\n */\nasync function startNew(settings = serverconnection_1.ServerConnection.makeSettings(), name, cwd) {\n Private.errorIfNotAvailable();\n const url = coreutils_1.URLExt.join(settings.baseUrl, exports.TERMINAL_SERVICE_URL);\n const init = {\n method: 'POST',\n body: JSON.stringify({ name, cwd })\n };\n const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n if (response.status !== 200) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n // TODO: Validate model\n return data;\n}\nexports.startNew = startNew;\n/**\n * List the running terminal sessions.\n *\n * @param settings - The server settings to use.\n *\n * @returns A promise that resolves with the list of running session models.\n */\nasync function listRunning(settings = serverconnection_1.ServerConnection.makeSettings()) {\n Private.errorIfNotAvailable();\n const url = coreutils_1.URLExt.join(settings.baseUrl, exports.TERMINAL_SERVICE_URL);\n const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);\n if (response.status !== 200) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n const data = await response.json();\n if (!Array.isArray(data)) {\n throw new Error('Invalid terminal list');\n }\n // TODO: validate each model\n return data;\n}\nexports.listRunning = listRunning;\n/**\n * Shut down a terminal session by name.\n *\n * @param name - The name of the target session.\n *\n * @param settings - The server settings to use.\n *\n * @returns A promise that resolves when the session is shut down.\n */\nasync function shutdownTerminal(name, settings = serverconnection_1.ServerConnection.makeSettings()) {\n var _a;\n Private.errorIfNotAvailable();\n const workspacesBase = coreutils_1.URLExt.join(settings.baseUrl, exports.TERMINAL_SERVICE_URL);\n const url = coreutils_1.URLExt.join(workspacesBase, name);\n if (!url.startsWith(workspacesBase)) {\n throw new Error('Can only be used for terminal requests');\n }\n const init = { method: 'DELETE' };\n const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);\n if (response.status === 404) {\n const data = await response.json();\n const msg = (_a = data.message) !== null && _a !== void 0 ? _a : `The terminal session \"${name}\"\" does not exist on the server`;\n console.warn(msg);\n }\n else if (response.status !== 204) {\n const err = await serverconnection_1.ServerConnection.ResponseError.create(response);\n throw err;\n }\n}\nexports.shutdownTerminal = shutdownTerminal;\nvar Private;\n(function (Private) {\n /**\n * Throw an error if terminals are not available.\n */\n function errorIfNotAvailable() {\n if (!isAvailable()) {\n throw new Error('Terminals Unavailable');\n }\n }\n Private.errorIfNotAvailable = errorIfNotAvailable;\n})(Private || (Private = {}));\n//# sourceMappingURL=restapi.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isAvailable = void 0;\nconst restapi_1 = require(\"./restapi\");\nObject.defineProperty(exports, \"isAvailable\", { enumerable: true, get: function () { return restapi_1.isAvailable; } });\n//# sourceMappingURL=terminal.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UserManager = void 0;\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\nconst coreutils_2 = require(\"@lumino/coreutils\");\nconst polling_1 = require(\"@lumino/polling\");\nconst signaling_1 = require(\"@lumino/signaling\");\nconst serverconnection_1 = require(\"../serverconnection\");\nconst basemanager_1 = require(\"../basemanager\");\n/**\n * The url for the lab workspaces service.\n */\nconst SERVICE_USER_URL = 'api/me';\n/**\n * The service's ID.\n * Used to uniquely identify the poll, and\n * the item in local storage.\n */\nconst SERVICE_ID = '@jupyterlab/services:UserManager#user';\n/**\n * The user API service manager.\n */\nclass UserManager extends basemanager_1.BaseManager {\n /**\n * Create a new user manager.\n */\n constructor(options = {}) {\n var _a;\n super(options);\n this._isReady = false;\n this._userChanged = new signaling_1.Signal(this);\n this._connectionFailure = new signaling_1.Signal(this);\n // Initialize internal data.\n this._ready = this.requestUser()\n .then(() => {\n if (this.isDisposed) {\n return;\n }\n this._isReady = true;\n })\n .catch(_ => \n // Return a promise that will never resolve, so user service is never ready\n // This typically occurs when the backend has no user service\n new Promise(() => {\n // no-op\n }));\n this._pollSpecs = new polling_1.Poll({\n auto: false,\n factory: () => this.requestUser(),\n frequency: {\n interval: 61 * 1000,\n backoff: true,\n max: 300 * 1000\n },\n name: SERVICE_ID,\n standby: (_a = options.standby) !== null && _a !== void 0 ? _a : 'when-hidden'\n });\n void this.ready.then(() => {\n void this._pollSpecs.start();\n });\n }\n /**\n * Test whether the manager is ready.\n */\n get isReady() {\n return this._isReady;\n }\n /**\n * A promise that fulfills when the manager is ready.\n */\n get ready() {\n return this._ready;\n }\n /**\n * Get the most recently fetched identity.\n */\n get identity() {\n return this._identity;\n }\n /**\n * Get the most recently fetched permissions.\n */\n get permissions() {\n return this._permissions;\n }\n /**\n * A signal emitted when the user changes.\n */\n get userChanged() {\n return this._userChanged;\n }\n /**\n * A signal emitted when there is a connection failure.\n */\n get connectionFailure() {\n return this._connectionFailure;\n }\n /**\n * Dispose of the resources used by the manager.\n */\n dispose() {\n this._pollSpecs.dispose();\n super.dispose();\n }\n /**\n * Force a refresh of the specs from the server.\n *\n * @returns A promise that resolves when the specs are fetched.\n *\n * #### Notes\n * This is intended to be called only in response to a user action,\n * since the manager maintains its internal state.\n */\n async refreshUser() {\n await this._pollSpecs.refresh();\n await this._pollSpecs.tick;\n }\n /**\n * Execute a request to the server to poll the user and update state.\n */\n async requestUser() {\n if (this.isDisposed) {\n return;\n }\n const { baseUrl } = this.serverSettings;\n const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n const url = coreutils_1.URLExt.join(baseUrl, SERVICE_USER_URL);\n const response = await makeRequest(url, {}, this.serverSettings);\n if (response.status !== 200) {\n const err = await ResponseError.create(response);\n throw err;\n }\n const oldUser = {\n identity: this._identity,\n permissions: this._permissions\n };\n const newUser = await response.json();\n const identity = newUser.identity;\n // store the color and initials for the user\n // this info is not provided by the server\n const { localStorage } = window;\n const data = localStorage.getItem(SERVICE_ID);\n if (data && (!identity.initials || !identity.color)) {\n const localUser = JSON.parse(data);\n identity.initials =\n identity.initials ||\n localUser.initials ||\n identity.name.substring(0, 1);\n identity.color =\n identity.color || localUser.color || Private.getRandomColor();\n }\n if (!coreutils_2.JSONExt.deepEqual(newUser, oldUser)) {\n this._identity = identity;\n this._permissions = newUser.permissions;\n localStorage.setItem(SERVICE_ID, JSON.stringify(identity));\n this._userChanged.emit(newUser);\n }\n }\n}\nexports.UserManager = UserManager;\n/**\n * A namespace for module-private functionality.\n *\n * Note: We do not want to export this function\n * to move it to css variables in the Theme.\n */\nvar Private;\n(function (Private) {\n /**\n * Predefined colors for users\n */\n const userColors = [\n 'var(--jp-collaborator-color1)',\n 'var(--jp-collaborator-color2)',\n 'var(--jp-collaborator-color3)',\n 'var(--jp-collaborator-color4)',\n 'var(--jp-collaborator-color5)',\n 'var(--jp-collaborator-color6)',\n 'var(--jp-collaborator-color7)'\n ];\n /**\n * Get a random color from the list of colors.\n */\n Private.getRandomColor = () => userColors[Math.floor(Math.random() * userColors.length)];\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateProperty = void 0;\n/**\n * Validate a property as being on an object, and optionally\n * of a given type and among a given set of values.\n */\nfunction validateProperty(\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nobject, name, typeName, values = []) {\n if (!object.hasOwnProperty(name)) {\n throw Error(`Missing property '${name}'`);\n }\n const value = object[name];\n if (typeName !== void 0) {\n let valid = true;\n switch (typeName) {\n case 'array':\n valid = Array.isArray(value);\n break;\n case 'object':\n valid = typeof value !== 'undefined';\n break;\n default:\n valid = typeof value === typeName;\n }\n if (!valid) {\n throw new Error(`Property '${name}' is not of type '${typeName}'`);\n }\n if (values.length > 0) {\n let valid = true;\n switch (typeName) {\n case 'string':\n case 'number':\n case 'boolean':\n valid = values.includes(value);\n break;\n default:\n valid = values.findIndex(v => v === value) >= 0;\n break;\n }\n if (!valid) {\n throw new Error(`Property '${name}' is not one of the valid values ${JSON.stringify(values)}`);\n }\n }\n }\n}\nexports.validateProperty = validateProperty;\n//# sourceMappingURL=validate.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkspaceManager = void 0;\nconst coreutils_1 = require(\"@jupyterlab/coreutils\");\nconst statedb_1 = require(\"@jupyterlab/statedb\");\nconst serverconnection_1 = require(\"../serverconnection\");\n/**\n * The url for the lab workspaces service.\n */\nconst SERVICE_WORKSPACES_URL = 'api/workspaces';\n/**\n * The workspaces API service manager.\n */\nclass WorkspaceManager extends statedb_1.DataConnector {\n /**\n * Create a new workspace manager.\n */\n constructor(options = {}) {\n var _a;\n super();\n this.serverSettings =\n (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();\n }\n /**\n * Fetch a workspace.\n *\n * @param id - The workspace's ID.\n *\n * @returns A promise that resolves if successful.\n */\n async fetch(id) {\n const { serverSettings } = this;\n const { baseUrl, appUrl } = serverSettings;\n const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n const base = baseUrl + appUrl;\n const url = Private.url(base, id);\n const response = await makeRequest(url, {}, serverSettings);\n if (response.status !== 200) {\n const err = await ResponseError.create(response);\n throw err;\n }\n return response.json();\n }\n /**\n * Fetch the list of workspace IDs that exist on the server.\n *\n * @returns A promise that resolves if successful.\n */\n async list() {\n const { serverSettings } = this;\n const { baseUrl, appUrl } = serverSettings;\n const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n const base = baseUrl + appUrl;\n const url = Private.url(base, '');\n const response = await makeRequest(url, {}, serverSettings);\n if (response.status !== 200) {\n const err = await ResponseError.create(response);\n throw err;\n }\n const result = await response.json();\n return result.workspaces;\n }\n /**\n * Remove a workspace from the server.\n *\n * @param id - The workspaces's ID.\n *\n * @returns A promise that resolves if successful.\n */\n async remove(id) {\n const { serverSettings } = this;\n const { baseUrl, appUrl } = serverSettings;\n const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n const base = baseUrl + appUrl;\n const url = Private.url(base, id);\n const init = { method: 'DELETE' };\n const response = await makeRequest(url, init, serverSettings);\n if (response.status !== 204) {\n const err = await ResponseError.create(response);\n throw err;\n }\n }\n /**\n * Save a workspace.\n *\n * @param id - The workspace's ID.\n *\n * @param workspace - The workspace being saved.\n *\n * @returns A promise that resolves if successful.\n */\n async save(id, workspace) {\n const { serverSettings } = this;\n const { baseUrl, appUrl } = serverSettings;\n const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;\n const base = baseUrl + appUrl;\n const url = Private.url(base, id);\n const init = { body: JSON.stringify(workspace), method: 'PUT' };\n const response = await makeRequest(url, init, serverSettings);\n if (response.status !== 204) {\n const err = await ResponseError.create(response);\n throw err;\n }\n }\n}\nexports.WorkspaceManager = WorkspaceManager;\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n /**\n * Get the url for a workspace.\n */\n function url(base, id) {\n const workspacesBase = coreutils_1.URLExt.join(base, SERVICE_WORKSPACES_URL);\n const result = coreutils_1.URLExt.join(workspacesBase, id);\n if (!result.startsWith(workspacesBase)) {\n throw new Error('Can only be used for workspaces requests');\n }\n return result;\n }\n Private.url = url;\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DataConnector = void 0;\n/**\n * An abstract class that adheres to the data connector interface.\n *\n * @typeparam T - The basic entity response type a service's connector.\n *\n * @typeparam U - The basic entity request type, which is conventionally the\n * same as the response type but may be different if a service's implementation\n * requires input data to be different from output responses. Defaults to `T`.\n *\n * @typeparam V - The basic token applied to a request, conventionally a string\n * ID or filter, but may be set to a different type when an implementation\n * requires it. Defaults to `string`.\n *\n * @typeparam W - The type of the optional `query` parameter of the `list`\n * method. Defaults to `string`.\n *\n * #### Notes\n * The only abstract method in this class is the `fetch` method, which must be\n * reimplemented by all subclasses. The `remove` and `save` methods have a\n * default implementation that returns a promise that will always reject. This\n * class is a convenience superclass for connectors that only need to `fetch`.\n */\nclass DataConnector {\n /**\n * Retrieve the list of items available from the data connector.\n *\n * @param query - The optional query filter to apply to the connector request.\n *\n * @returns A promise that always rejects with an error.\n *\n * #### Notes\n * Subclasses should reimplement if they support a back-end that can list.\n */\n async list(query) {\n throw new Error('DataConnector#list method has not been implemented.');\n }\n /**\n * Remove a value using the data connector.\n *\n * @param id - The identifier for the data being removed.\n *\n * @returns A promise that always rejects with an error.\n *\n * #### Notes\n * Subclasses should reimplement if they support a back-end that can remove.\n */\n async remove(id) {\n throw new Error('DataConnector#remove method has not been implemented.');\n }\n /**\n * Save a value using the data connector.\n *\n * @param id - The identifier for the data being saved.\n *\n * @param value - The data being saved.\n *\n * @returns A promise that always rejects with an error.\n *\n * #### Notes\n * Subclasses should reimplement if they support a back-end that can save.\n */\n async save(id, value) {\n throw new Error('DataConnector#save method has not been implemented.');\n }\n}\nexports.DataConnector = DataConnector;\n//# sourceMappingURL=dataconnector.js.map","\"use strict\";\n/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module statedb\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./dataconnector\"), exports);\n__exportStar(require(\"./interfaces\"), exports);\n__exportStar(require(\"./restorablepool\"), exports);\n__exportStar(require(\"./statedb\"), exports);\n__exportStar(require(\"./tokens\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=interfaces.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RestorablePool = void 0;\nconst coreutils_1 = require(\"@lumino/coreutils\");\nconst properties_1 = require(\"@lumino/properties\");\nconst signaling_1 = require(\"@lumino/signaling\");\n/**\n * An object pool that supports restoration.\n *\n * @typeparam T - The type of object being tracked.\n */\nclass RestorablePool {\n /**\n * Create a new restorable pool.\n *\n * @param options - The instantiation options for a restorable pool.\n */\n constructor(options) {\n this._added = new signaling_1.Signal(this);\n this._current = null;\n this._currentChanged = new signaling_1.Signal(this);\n this._hasRestored = false;\n this._isDisposed = false;\n this._objects = new Set();\n this._restore = null;\n this._restored = new coreutils_1.PromiseDelegate();\n this._updated = new signaling_1.Signal(this);\n this.namespace = options.namespace;\n }\n /**\n * A signal emitted when an object object is added.\n *\n * #### Notes\n * This signal will only fire when an object is added to the pool.\n * It will not fire if an object injected into the pool.\n */\n get added() {\n return this._added;\n }\n /**\n * The current object.\n *\n * #### Notes\n * The restorable pool does not set `current`. It is intended for client use.\n *\n * If `current` is set to an object that does not exist in the pool, it is a\n * no-op.\n */\n get current() {\n return this._current;\n }\n set current(obj) {\n if (this._current === obj) {\n return;\n }\n if (obj !== null && this._objects.has(obj)) {\n this._current = obj;\n this._currentChanged.emit(this._current);\n }\n }\n /**\n * A signal emitted when the current widget changes.\n */\n get currentChanged() {\n return this._currentChanged;\n }\n /**\n * Test whether the pool is disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * A promise resolved when the restorable pool has been restored.\n */\n get restored() {\n return this._restored.promise;\n }\n /**\n * The number of objects held by the pool.\n */\n get size() {\n return this._objects.size;\n }\n /**\n * A signal emitted when an object is updated.\n */\n get updated() {\n return this._updated;\n }\n /**\n * Add a new object to the pool.\n *\n * @param obj - The object object being added.\n *\n * #### Notes\n * The object passed into the pool is added synchronously; its existence in\n * the pool can be checked with the `has()` method. The promise this method\n * returns resolves after the object has been added and saved to an underlying\n * restoration connector, if one is available.\n */\n async add(obj) {\n var _a, _b;\n if (obj.isDisposed) {\n const warning = 'A disposed object cannot be added.';\n console.warn(warning, obj);\n throw new Error(warning);\n }\n if (this._objects.has(obj)) {\n const warning = 'This object already exists in the pool.';\n console.warn(warning, obj);\n throw new Error(warning);\n }\n this._objects.add(obj);\n obj.disposed.connect(this._onInstanceDisposed, this);\n if (Private.injectedProperty.get(obj)) {\n return;\n }\n if (this._restore) {\n const { connector } = this._restore;\n const objName = this._restore.name(obj);\n if (objName) {\n const name = `${this.namespace}:${objName}`;\n const data = (_b = (_a = this._restore).args) === null || _b === void 0 ? void 0 : _b.call(_a, obj);\n Private.nameProperty.set(obj, name);\n await connector.save(name, { data });\n }\n }\n // Emit the added signal.\n this._added.emit(obj);\n }\n /**\n * Dispose of the resources held by the pool.\n *\n * #### Notes\n * Disposing a pool does not affect the underlying data in the data connector,\n * it simply disposes the client-side pool without making any connector calls.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._current = null;\n this._isDisposed = true;\n this._objects.clear();\n signaling_1.Signal.clearData(this);\n }\n /**\n * Find the first object in the pool that satisfies a filter function.\n *\n * @param fn The filter function to call on each object.\n */\n find(fn) {\n const values = this._objects.values();\n for (const value of values) {\n if (fn(value)) {\n return value;\n }\n }\n return undefined;\n }\n /**\n * Iterate through each object in the pool.\n *\n * @param fn - The function to call on each object.\n */\n forEach(fn) {\n this._objects.forEach(fn);\n }\n /**\n * Filter the objects in the pool based on a predicate.\n *\n * @param fn - The function by which to filter.\n */\n filter(fn) {\n const filtered = [];\n this.forEach(obj => {\n if (fn(obj)) {\n filtered.push(obj);\n }\n });\n return filtered;\n }\n /**\n * Inject an object into the restorable pool without the pool handling its\n * restoration lifecycle.\n *\n * @param obj - The object to inject into the pool.\n */\n inject(obj) {\n Private.injectedProperty.set(obj, true);\n return this.add(obj);\n }\n /**\n * Check if this pool has the specified object.\n *\n * @param obj - The object whose existence is being checked.\n */\n has(obj) {\n return this._objects.has(obj);\n }\n /**\n * Restore the objects in this pool's namespace.\n *\n * @param options - The configuration options that describe restoration.\n *\n * @returns A promise that resolves when restoration has completed.\n *\n * #### Notes\n * This function should almost never be invoked by client code. Its primary\n * use case is to be invoked by a layout restorer plugin that handles\n * multiple restorable pools and, when ready, asks them each to restore their\n * respective objects.\n */\n async restore(options) {\n if (this._hasRestored) {\n throw new Error('This pool has already been restored.');\n }\n this._hasRestored = true;\n const { command, connector, registry, when } = options;\n const namespace = this.namespace;\n const promises = when\n ? [connector.list(namespace)].concat(when)\n : [connector.list(namespace)];\n this._restore = options;\n const [saved] = await Promise.all(promises);\n const values = await Promise.all(saved.ids.map(async (id, index) => {\n const value = saved.values[index];\n const args = value && value.data;\n if (args === undefined) {\n return connector.remove(id);\n }\n // Execute the command and if it fails, delete the state restore data.\n return registry\n .execute(command, args)\n .catch(() => connector.remove(id));\n }));\n this._restored.resolve();\n return values;\n }\n /**\n * Save the restore data for a given object.\n *\n * @param obj - The object being saved.\n */\n async save(obj) {\n var _a, _b;\n const injected = Private.injectedProperty.get(obj);\n if (!this._restore || !this.has(obj) || injected) {\n return;\n }\n const { connector } = this._restore;\n const objName = this._restore.name(obj);\n const oldName = Private.nameProperty.get(obj);\n const newName = objName ? `${this.namespace}:${objName}` : '';\n if (oldName && oldName !== newName) {\n await connector.remove(oldName);\n }\n // Set the name property irrespective of whether the new name is null.\n Private.nameProperty.set(obj, newName);\n if (newName) {\n const data = (_b = (_a = this._restore).args) === null || _b === void 0 ? void 0 : _b.call(_a, obj);\n await connector.save(newName, { data });\n }\n if (oldName !== newName) {\n this._updated.emit(obj);\n }\n }\n /**\n * Clean up after disposed objects.\n */\n _onInstanceDisposed(obj) {\n this._objects.delete(obj);\n if (obj === this._current) {\n this._current = null;\n this._currentChanged.emit(this._current);\n }\n if (Private.injectedProperty.get(obj)) {\n return;\n }\n if (!this._restore) {\n return;\n }\n const { connector } = this._restore;\n const name = Private.nameProperty.get(obj);\n if (name) {\n void connector.remove(name);\n }\n }\n}\nexports.RestorablePool = RestorablePool;\n/*\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n /**\n * An attached property to indicate whether an object has been injected.\n */\n Private.injectedProperty = new properties_1.AttachedProperty({\n name: 'injected',\n create: () => false\n });\n /**\n * An attached property for an object's ID.\n */\n Private.nameProperty = new properties_1.AttachedProperty({\n name: 'name',\n create: () => ''\n });\n})(Private || (Private = {}));\n//# sourceMappingURL=restorablepool.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StateDB = void 0;\nconst signaling_1 = require(\"@lumino/signaling\");\n/**\n * The default concrete implementation of a state database.\n */\nclass StateDB {\n /**\n * Create a new state database.\n *\n * @param options - The instantiation options for a state database.\n */\n constructor(options = {}) {\n this._changed = new signaling_1.Signal(this);\n const { connector, transform } = options;\n this._connector = connector || new StateDB.Connector();\n if (!transform) {\n this._ready = Promise.resolve(undefined);\n }\n else {\n this._ready = transform.then(transformation => {\n const { contents, type } = transformation;\n switch (type) {\n case 'cancel':\n return;\n case 'clear':\n return this._clear();\n case 'merge':\n return this._merge(contents || {});\n case 'overwrite':\n return this._overwrite(contents || {});\n default:\n return;\n }\n });\n }\n }\n /**\n * A signal that emits the change type any time a value changes.\n */\n get changed() {\n return this._changed;\n }\n /**\n * Clear the entire database.\n */\n async clear() {\n await this._ready;\n await this._clear();\n }\n /**\n * Retrieve a saved bundle from the database.\n *\n * @param id - The identifier used to retrieve a data bundle.\n *\n * @returns A promise that bears a data payload if available.\n *\n * #### Notes\n * The `id` values of stored items in the state database are formatted:\n * `'namespace:identifier'`, which is the same convention that command\n * identifiers in JupyterLab use as well. While this is not a technical\n * requirement for `fetch()`, `remove()`, and `save()`, it *is* necessary for\n * using the `list(namespace: string)` method.\n *\n * The promise returned by this method may be rejected if an error occurs in\n * retrieving the data. Non-existence of an `id` will succeed with the `value`\n * `undefined`.\n */\n async fetch(id) {\n await this._ready;\n return this._fetch(id);\n }\n /**\n * Retrieve all the saved bundles for a namespace.\n *\n * @param namespace The namespace prefix to retrieve.\n *\n * @returns A promise that bears a collection of payloads for a namespace.\n *\n * #### Notes\n * Namespaces are entirely conventional entities. The `id` values of stored\n * items in the state database are formatted: `'namespace:identifier'`, which\n * is the same convention that command identifiers in JupyterLab use as well.\n *\n * If there are any errors in retrieving the data, they will be logged to the\n * console in order to optimistically return any extant data without failing.\n * This promise will always succeed.\n */\n async list(namespace) {\n await this._ready;\n return this._list(namespace);\n }\n /**\n * Remove a value from the database.\n *\n * @param id - The identifier for the data being removed.\n *\n * @returns A promise that is rejected if remove fails and succeeds otherwise.\n */\n async remove(id) {\n await this._ready;\n await this._remove(id);\n this._changed.emit({ id, type: 'remove' });\n }\n /**\n * Save a value in the database.\n *\n * @param id - The identifier for the data being saved.\n *\n * @param value - The data being saved.\n *\n * @returns A promise that is rejected if saving fails and succeeds otherwise.\n *\n * #### Notes\n * The `id` values of stored items in the state database are formatted:\n * `'namespace:identifier'`, which is the same convention that command\n * identifiers in JupyterLab use as well. While this is not a technical\n * requirement for `fetch()`, `remove()`, and `save()`, it *is* necessary for\n * using the `list(namespace: string)` method.\n */\n async save(id, value) {\n await this._ready;\n await this._save(id, value);\n this._changed.emit({ id, type: 'save' });\n }\n /**\n * Return a serialized copy of the state database's entire contents.\n *\n * @returns A promise that resolves with the database contents as JSON.\n */\n async toJSON() {\n await this._ready;\n const { ids, values } = await this._list();\n return values.reduce((acc, val, idx) => {\n acc[ids[idx]] = val;\n return acc;\n }, {});\n }\n /**\n * Clear the entire database.\n */\n async _clear() {\n await Promise.all((await this._list()).ids.map(id => this._remove(id)));\n }\n /**\n * Fetch a value from the database.\n */\n async _fetch(id) {\n const value = await this._connector.fetch(id);\n if (value) {\n return JSON.parse(value).v;\n }\n }\n /**\n * Fetch a list from the database.\n */\n async _list(namespace = '') {\n const { ids, values } = await this._connector.list(namespace);\n return {\n ids,\n values: values.map(val => JSON.parse(val).v)\n };\n }\n /**\n * Merge data into the state database.\n */\n async _merge(contents) {\n await Promise.all(Object.keys(contents).map(key => contents[key] && this._save(key, contents[key])));\n }\n /**\n * Overwrite the entire database with new contents.\n */\n async _overwrite(contents) {\n await this._clear();\n await this._merge(contents);\n }\n /**\n * Remove a key in the database.\n */\n async _remove(id) {\n return this._connector.remove(id);\n }\n /**\n * Save a key and its value in the database.\n */\n async _save(id, value) {\n return this._connector.save(id, JSON.stringify({ v: value }));\n }\n}\nexports.StateDB = StateDB;\n/**\n * A namespace for StateDB statics.\n */\n(function (StateDB) {\n /**\n * An in-memory string key/value data connector.\n */\n class Connector {\n constructor() {\n this._storage = {};\n }\n /**\n * Retrieve an item from the data connector.\n */\n async fetch(id) {\n return this._storage[id];\n }\n /**\n * Retrieve the list of items available from the data connector.\n *\n * @param namespace - If not empty, only keys whose first token before `:`\n * exactly match `namespace` will be returned, e.g. `foo` in `foo:bar`.\n */\n async list(namespace = '') {\n return Object.keys(this._storage).reduce((acc, val) => {\n if (namespace === '' ? true : namespace === val.split(':')[0]) {\n acc.ids.push(val);\n acc.values.push(this._storage[val]);\n }\n return acc;\n }, { ids: [], values: [] });\n }\n /**\n * Remove a value using the data connector.\n */\n async remove(id) {\n delete this._storage[id];\n }\n /**\n * Save a value using the data connector.\n */\n async save(id, value) {\n this._storage[id] = value;\n }\n }\n StateDB.Connector = Connector;\n})(StateDB || (exports.StateDB = StateDB = {}));\n//# sourceMappingURL=statedb.js.map","\"use strict\";\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IStateDB = void 0;\nconst coreutils_1 = require(\"@lumino/coreutils\");\n/**\n * The default state database token.\n */\nexports.IStateDB = new coreutils_1.Token('@jupyterlab/coreutils:IStateDB', `A service for the JupyterLab state database.\n Use this if you want to store data that will persist across page loads.\n See \"state database\" for more information.`);\n//# sourceMappingURL=tokens.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/// \nexport const DIR_MODE = 16895; // 040777\nexport const FILE_MODE = 33206; // 100666\nexport const SEEK_CUR = 1;\nexport const SEEK_END = 2;\nexport function instanceOfStream(nodeOrStream) {\n return 'node' in nodeOrStream;\n}\n//# sourceMappingURL=emscripten.js.map","import { PathExt } from '@jupyterlab/coreutils';\nimport { BLOCK_SIZE } from './drivefs';\nimport { DIR_MODE, FILE_MODE } from './emscripten';\n/**\n * Class for processing a drive request from the DriveFS.\n */\nexport class DriveContentsProcessor {\n constructor(options) {\n this.contentsManager = options.contentsManager;\n }\n async processDriveRequest(request) {\n switch (request.method) {\n case 'readdir':\n return this.readdir(request);\n case 'rmdir':\n return this.rmdir(request);\n case 'rename':\n return this.rename(request);\n case 'getmode':\n return this.getmode(request);\n case 'lookup':\n return this.lookup(request);\n case 'mknod':\n return this.mknod(request);\n case 'getattr':\n return this.getattr(request);\n case 'get':\n return this.get(request);\n case 'put':\n return this.put(request);\n }\n throw `Drive request ${request.method} does not exist.`;\n }\n async readdir(request) {\n const model = await this.contentsManager.get(request.path, { content: true });\n let response = [];\n if (model.type === 'directory' && model.content) {\n response = model.content.map((subcontent) => subcontent.name);\n }\n return response;\n }\n async rmdir(request) {\n await this.contentsManager.delete(request.path);\n return null;\n }\n async rename(request) {\n await this.contentsManager.rename(request.path, request.data.newPath);\n return null;\n }\n async getmode(request) {\n const model = await this.contentsManager.get(request.path);\n let response;\n if (model.type === 'directory') {\n response = DIR_MODE;\n }\n else {\n response = FILE_MODE;\n }\n return response;\n }\n async lookup(request) {\n let response;\n try {\n const model = await this.contentsManager.get(request.path);\n response = {\n ok: true,\n mode: model.type === 'directory' ? DIR_MODE : FILE_MODE,\n };\n }\n catch (e) {\n response = { ok: false };\n }\n return response;\n }\n async mknod(request) {\n const model = await this.contentsManager.newUntitled({\n path: PathExt.dirname(request.path),\n type: request.data.mode === DIR_MODE ? 'directory' : 'file',\n ext: PathExt.extname(request.path),\n });\n await this.contentsManager.rename(model.path, request.path);\n return null;\n }\n async getattr(request) {\n const model = await this.contentsManager.get(request.path);\n // create a default date for drives that send incomplete information\n // for nested foldes and files\n const defaultDate = new Date(0).toISOString();\n return {\n dev: 1,\n nlink: 1,\n uid: 0,\n gid: 0,\n rdev: 0,\n size: model.size || 0,\n blksize: BLOCK_SIZE,\n blocks: Math.ceil(model.size || 0 / BLOCK_SIZE),\n atime: model.last_modified || defaultDate,\n mtime: model.last_modified || defaultDate,\n ctime: model.created || defaultDate,\n timestamp: 0,\n };\n }\n async get(request) {\n const model = await this.contentsManager.get(request.path, { content: true });\n let response;\n if (model.type !== 'directory') {\n response = {\n content: model.format === 'json' ? JSON.stringify(model.content) : model.content,\n format: model.format,\n };\n }\n return response;\n }\n async put(request) {\n await this.contentsManager.save(request.path, {\n content: request.data.format === 'json'\n ? JSON.parse(request.data.data)\n : request.data.data,\n type: 'file',\n format: request.data.format,\n });\n return null;\n }\n}\n//# sourceMappingURL=drivecontents.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { DIR_MODE, SEEK_CUR, SEEK_END, instanceOfStream, } from './emscripten';\nexport const DRIVE_SEPARATOR = ':';\nexport const DRIVE_API_PATH = '/api/drive.v1';\nexport const BLOCK_SIZE = 4096;\nconst encoder = new TextEncoder();\nconst decoder = new TextDecoder('utf-8');\n// Mapping flag -> do we need to overwrite the file upon closing it\nconst flagNeedsWrite = {\n 0 /*O_RDONLY*/: false,\n 1 /*O_WRONLY*/: true,\n 2 /*O_RDWR*/: true,\n 64 /*O_CREAT*/: true,\n 65 /*O_WRONLY|O_CREAT*/: true,\n 66 /*O_RDWR|O_CREAT*/: true,\n 129 /*O_WRONLY|O_EXCL*/: true,\n 193 /*O_WRONLY|O_CREAT|O_EXCL*/: true,\n 514 /*O_RDWR|O_TRUNC*/: true,\n 577 /*O_WRONLY|O_CREAT|O_TRUNC*/: true,\n 578 /*O_CREAT|O_RDWR|O_TRUNC*/: true,\n 705 /*O_WRONLY|O_CREAT|O_EXCL|O_TRUNC*/: true,\n 706 /*O_RDWR|O_CREAT|O_EXCL|O_TRUNC*/: true,\n 1024 /*O_APPEND*/: true,\n 1025 /*O_WRONLY|O_APPEND*/: true,\n 1026 /*O_RDWR|O_APPEND*/: true,\n 1089 /*O_WRONLY|O_CREAT|O_APPEND*/: true,\n 1090 /*O_RDWR|O_CREAT|O_APPEND*/: true,\n 1153 /*O_WRONLY|O_EXCL|O_APPEND*/: true,\n 1154 /*O_RDWR|O_EXCL|O_APPEND*/: true,\n 1217 /*O_WRONLY|O_CREAT|O_EXCL|O_APPEND*/: true,\n 1218 /*O_RDWR|O_CREAT|O_EXCL|O_APPEND*/: true,\n 4096 /*O_RDONLY|O_DSYNC*/: true,\n 4098 /*O_RDWR|O_DSYNC*/: true,\n};\nexport class DriveFSEmscriptenStreamOps {\n constructor(fs) {\n this.fs = fs;\n }\n open(stream) {\n const path = this.fs.realPath(stream.node);\n if (this.fs.FS.isFile(stream.node.mode)) {\n stream.file = this.fs.API.get(path);\n }\n }\n close(stream) {\n if (!this.fs.FS.isFile(stream.node.mode) || !stream.file) {\n return;\n }\n const path = this.fs.realPath(stream.node);\n const flags = stream.flags;\n let parsedFlags = typeof flags === 'string' ? parseInt(flags, 10) : flags;\n parsedFlags &= 0x1fff;\n let needsWrite = true;\n if (parsedFlags in flagNeedsWrite) {\n needsWrite = flagNeedsWrite[parsedFlags];\n }\n if (needsWrite) {\n this.fs.API.put(path, stream.file);\n }\n stream.file = undefined;\n }\n read(stream, buffer, offset, length, position) {\n if (length <= 0 ||\n stream.file === undefined ||\n position >= (stream.file.data.length || 0)) {\n return 0;\n }\n const size = Math.min(stream.file.data.length - position, length);\n buffer.set(stream.file.data.subarray(position, position + size), offset);\n return size;\n }\n write(stream, buffer, offset, length, position) {\n var _a;\n if (length <= 0 || stream.file === undefined) {\n return 0;\n }\n stream.node.timestamp = Date.now();\n if (position + length > (((_a = stream.file) === null || _a === void 0 ? void 0 : _a.data.length) || 0)) {\n const oldData = stream.file.data ? stream.file.data : new Uint8Array();\n stream.file.data = new Uint8Array(position + length);\n stream.file.data.set(oldData);\n }\n stream.file.data.set(buffer.subarray(offset, offset + length), position);\n return length;\n }\n llseek(stream, offset, whence) {\n let position = offset;\n if (whence === SEEK_CUR) {\n position += stream.position;\n }\n else if (whence === SEEK_END) {\n if (this.fs.FS.isFile(stream.node.mode)) {\n if (stream.file !== undefined) {\n position += stream.file.data.length;\n }\n else {\n throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EPERM);\n }\n }\n }\n if (position < 0) {\n throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EINVAL);\n }\n return position;\n }\n}\nexport class DriveFSEmscriptenNodeOps {\n constructor(fs) {\n this.fs = fs;\n }\n node(nodeOrStream) {\n if (instanceOfStream(nodeOrStream)) {\n return nodeOrStream.node;\n }\n return nodeOrStream;\n }\n getattr(value) {\n const node = this.node(value);\n return {\n ...this.fs.API.getattr(this.fs.realPath(node)),\n mode: node.mode,\n ino: node.id,\n };\n }\n setattr(value, attr) {\n const node = this.node(value);\n for (const [key, value] of Object.entries(attr)) {\n switch (key) {\n case 'mode':\n node.mode = value;\n break;\n case 'timestamp':\n node.timestamp = value;\n break;\n default:\n console.warn('setattr', key, 'of', value, 'on', node, 'not yet implemented');\n break;\n }\n }\n }\n lookup(parent, name) {\n const node = this.node(parent);\n const path = this.fs.PATH.join2(this.fs.realPath(node), name);\n const result = this.fs.API.lookup(path);\n if (!result.ok) {\n throw this.fs.FS.genericErrors[this.fs.ERRNO_CODES['ENOENT']];\n }\n return this.fs.createNode(node, name, result.mode, 0);\n }\n mknod(parent, name, mode, dev) {\n const node = this.node(parent);\n const path = this.fs.PATH.join2(this.fs.realPath(node), name);\n this.fs.API.mknod(path, mode);\n return this.fs.createNode(node, name, mode, dev);\n }\n rename(value, newDir, newName) {\n const oldNode = this.node(value);\n const newDirNode = this.node(newDir);\n this.fs.API.rename(oldNode.parent\n ? this.fs.PATH.join2(this.fs.realPath(oldNode.parent), oldNode.name)\n : oldNode.name, this.fs.PATH.join2(this.fs.realPath(newDirNode), newName));\n // Updating the in-memory node\n oldNode.name = newName;\n oldNode.parent = newDirNode;\n }\n unlink(parent, name) {\n this.fs.API.rmdir(this.fs.PATH.join2(this.fs.realPath(this.node(parent)), name));\n }\n rmdir(parent, name) {\n this.fs.API.rmdir(this.fs.PATH.join2(this.fs.realPath(this.node(parent)), name));\n }\n readdir(value) {\n return this.fs.API.readdir(this.fs.realPath(this.node(value)));\n }\n symlink(parent, newName, oldPath) {\n throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES['EPERM']);\n }\n readlink(node) {\n throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES['EPERM']);\n }\n}\n/**\n * ContentsAPI base class\n */\nexport class ContentsAPI {\n constructor(driveName, mountpoint, FS, ERRNO_CODES) {\n this._driveName = driveName;\n this._mountpoint = mountpoint;\n this.FS = FS;\n this.ERRNO_CODES = ERRNO_CODES;\n }\n lookup(path) {\n return this.request({ method: 'lookup', path: this.normalizePath(path) });\n }\n getmode(path) {\n return this.request({ method: 'getmode', path: this.normalizePath(path) });\n }\n mknod(path, mode) {\n return this.request({\n method: 'mknod',\n path: this.normalizePath(path),\n data: { mode },\n });\n }\n rename(oldPath, newPath) {\n return this.request({\n method: 'rename',\n path: this.normalizePath(oldPath),\n data: { newPath: this.normalizePath(newPath) },\n });\n }\n readdir(path) {\n const dirlist = this.request({\n method: 'readdir',\n path: this.normalizePath(path),\n });\n dirlist.push('.');\n dirlist.push('..');\n return dirlist;\n }\n rmdir(path) {\n return this.request({ method: 'rmdir', path: this.normalizePath(path) });\n }\n get(path) {\n const response = this.request({\n method: 'get',\n path: this.normalizePath(path),\n });\n if (!response) {\n throw new this.FS.ErrnoError(this.ERRNO_CODES['ENOENT']);\n }\n const serializedContent = response.content;\n const format = response.format;\n switch (format) {\n case 'json':\n case 'text':\n return {\n data: encoder.encode(serializedContent),\n format,\n };\n case 'base64': {\n const binString = atob(serializedContent);\n const len = binString.length;\n const data = new Uint8Array(len);\n for (let i = 0; i < len; i++) {\n data[i] = binString.charCodeAt(i);\n }\n return {\n data,\n format,\n };\n }\n default:\n throw new this.FS.ErrnoError(this.ERRNO_CODES['ENOENT']);\n }\n }\n put(path, value) {\n switch (value.format) {\n case 'json':\n case 'text':\n return this.request({\n method: 'put',\n path: this.normalizePath(path),\n data: {\n format: value.format,\n data: decoder.decode(value.data),\n },\n });\n case 'base64': {\n let binary = '';\n for (let i = 0; i < value.data.byteLength; i++) {\n binary += String.fromCharCode(value.data[i]);\n }\n return this.request({\n method: 'put',\n path: this.normalizePath(path),\n data: {\n format: value.format,\n data: btoa(binary),\n },\n });\n }\n }\n }\n getattr(path) {\n const stats = this.request({\n method: 'getattr',\n path: this.normalizePath(path),\n });\n // Turn datetimes into proper objects\n if (stats.atime) {\n stats.atime = new Date(stats.atime);\n }\n if (stats.mtime) {\n stats.mtime = new Date(stats.mtime);\n }\n if (stats.ctime) {\n stats.ctime = new Date(stats.ctime);\n }\n // ensure a non-undefined size (0 isn't great, though)\n stats.size = stats.size || 0;\n return stats;\n }\n /**\n * Normalize a Path by making it compliant for the content manager\n *\n * @param path: the path relatively to the Emscripten drive\n */\n normalizePath(path) {\n // Remove mountpoint prefix\n if (path.startsWith(this._mountpoint)) {\n path = path.slice(this._mountpoint.length);\n }\n // Add JupyterLab drive name\n if (this._driveName) {\n path = `${this._driveName}${DRIVE_SEPARATOR}${path}`;\n }\n return path;\n }\n}\n/**\n * An Emscripten-compatible synchronous Contents API using the service worker.\n */\nexport class ServiceWorkerContentsAPI extends ContentsAPI {\n constructor(baseUrl, driveName, mountpoint, FS, ERRNO_CODES) {\n super(driveName, mountpoint, FS, ERRNO_CODES);\n this._baseUrl = baseUrl;\n }\n request(data) {\n const xhr = new XMLHttpRequest();\n xhr.open('POST', encodeURI(this.endpoint), false);\n try {\n xhr.send(JSON.stringify(data));\n }\n catch (e) {\n console.error(e);\n }\n if (xhr.status >= 400) {\n throw new this.FS.ErrnoError(this.ERRNO_CODES['EINVAL']);\n }\n return JSON.parse(xhr.responseText);\n }\n /**\n * Get the api/drive endpoint\n */\n get endpoint() {\n return `${this._baseUrl}api/drive`;\n }\n}\nexport class DriveFS {\n constructor(options) {\n this.FS = options.FS;\n this.PATH = options.PATH;\n this.ERRNO_CODES = options.ERRNO_CODES;\n this.API = this.createAPI(options);\n this.driveName = options.driveName;\n this.node_ops = new DriveFSEmscriptenNodeOps(this);\n this.stream_ops = new DriveFSEmscriptenStreamOps(this);\n }\n /**\n * Create the ContentsAPI.\n *\n * This is supposed to be overwritten if needed.\n */\n createAPI(options) {\n return new ServiceWorkerContentsAPI(options.baseUrl, options.driveName, options.mountpoint, options.FS, options.ERRNO_CODES);\n }\n mount(mount) {\n return this.createNode(null, mount.mountpoint, DIR_MODE | 511, 0);\n }\n createNode(parent, name, mode, dev) {\n const FS = this.FS;\n if (!FS.isDir(mode) && !FS.isFile(mode)) {\n throw new FS.ErrnoError(this.ERRNO_CODES['EINVAL']);\n }\n const node = FS.createNode(parent, name, mode, dev);\n node.node_ops = this.node_ops;\n node.stream_ops = this.stream_ops;\n return node;\n }\n getMode(path) {\n return this.API.getmode(path);\n }\n realPath(node) {\n const parts = [];\n let currentNode = node;\n parts.push(currentNode.name);\n while (currentNode.parent !== currentNode) {\n currentNode = currentNode.parent;\n parts.push(currentNode.name);\n }\n parts.reverse();\n return this.PATH.join.apply(null, parts);\n }\n}\n//# sourceMappingURL=drivefs.js.map","import { PageConfig } from '@jupyterlab/coreutils';\nimport mime from 'mime';\nimport { Token } from '@lumino/coreutils';\n/**\n * The token for the settings service.\n */\nexport const IContents = new Token('@jupyterlite/contents:IContents');\n/**\n * Commonly-used mimetypes\n */\nexport var MIME;\n(function (MIME) {\n MIME.JSON = 'application/json';\n MIME.PLAIN_TEXT = 'text/plain';\n MIME.OCTET_STREAM = 'octet/stream';\n})(MIME || (MIME = {}));\n/**\n * A namespace for file constructs.\n */\nexport var FILE;\n(function (FILE) {\n /**\n * Build-time configured file types.\n */\n const TYPES = JSON.parse(PageConfig.getOption('fileTypes') || '{}');\n /**\n * Get a mimetype (or fallback).\n */\n function getType(ext, defaultType = null) {\n ext = ext.toLowerCase();\n for (const fileType of Object.values(TYPES)) {\n for (const fileExt of fileType.extensions || []) {\n if (fileExt === ext && fileType.mimeTypes && fileType.mimeTypes.length) {\n return fileType.mimeTypes[0];\n }\n }\n }\n return mime.getType(ext) || defaultType || MIME.OCTET_STREAM;\n }\n FILE.getType = getType;\n /**\n * Determine whether the given extension matches a given fileFormat.\n */\n function hasFormat(ext, fileFormat) {\n ext = ext.toLowerCase();\n for (const fileType of Object.values(TYPES)) {\n if (fileType.fileFormat !== fileFormat) {\n continue;\n }\n for (const fileExt of fileType.extensions || []) {\n if (fileExt === ext) {\n return true;\n }\n }\n }\n return false;\n }\n FILE.hasFormat = hasFormat;\n})(FILE || (FILE = {}));\n/**\n * The token for the BroadcastChannel broadcaster.\n */\nexport const IBroadcastChannelWrapper = new Token('@jupyterlite/contents:IBroadcastChannelWrapper');\n//# sourceMappingURL=tokens.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { Token } from '@lumino/coreutils';\n/**\n * The token for the kernels service.\n */\nexport const IKernels = new Token('@jupyterlite/kernel:IKernels');\n/**\n * The kernel name of last resort.\n */\nexport const FALLBACK_KERNEL = 'javascript';\n/**\n * The token for the kernel spec service.\n */\nexport const IKernelSpecs = new Token('@jupyterlite/kernel:IKernelSpecs');\n//# sourceMappingURL=tokens.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { PageConfig, URLExt } from '@jupyterlab/coreutils';\nimport { IServiceWorkerManager, } from '@jupyterlite/server';\nimport { IKernelSpecs } from '@jupyterlite/kernel';\nimport { IBroadcastChannelWrapper } from '@jupyterlite/contents';\nexport * as KERNEL_SETTINGS_SCHEMA from '../schema/kernel.v0.schema.json';\nimport KERNEL_ICON_SVG_STR from '../style/img/pyodide.svg';\nconst KERNEL_ICON_URL = `data:image/svg+xml;base64,${btoa(KERNEL_ICON_SVG_STR)}`;\n/**\n * The default CDN fallback for Pyodide\n */\nconst PYODIDE_CDN_URL = 'https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js';\n/**\n * The id for the extension, and key in the litePlugins.\n */\nconst PLUGIN_ID = '@jupyterlite/pyodide-kernel-extension:kernel';\n/**\n * A plugin to register the Pyodide kernel.\n */\nconst kernel = {\n id: PLUGIN_ID,\n autoStart: true,\n requires: [IKernelSpecs],\n optional: [IServiceWorkerManager, IBroadcastChannelWrapper],\n activate: (app, kernelspecs, serviceWorker, broadcastChannel) => {\n const contentsManager = app.serviceManager.contents;\n const config = JSON.parse(PageConfig.getOption('litePluginSettings') || '{}')[PLUGIN_ID] || {};\n const baseUrl = PageConfig.getBaseUrl();\n const url = config.pyodideUrl || PYODIDE_CDN_URL;\n const pyodideUrl = URLExt.parse(url).href;\n const pipliteWheelUrl = config.pipliteWheelUrl\n ? URLExt.parse(config.pipliteWheelUrl).href\n : undefined;\n const rawPipUrls = config.pipliteUrls || [];\n const pipliteUrls = rawPipUrls.map((pipUrl) => URLExt.parse(pipUrl).href);\n const disablePyPIFallback = !!config.disablePyPIFallback;\n const loadPyodideOptions = config.loadPyodideOptions || {};\n for (const [key, value] of Object.entries(loadPyodideOptions)) {\n if (key.endsWith('URL') && typeof value === 'string') {\n loadPyodideOptions[key] = new URL(value, baseUrl).href;\n }\n }\n kernelspecs.register({\n spec: {\n name: 'python',\n display_name: 'Python (Pyodide)',\n language: 'python',\n argv: [],\n resources: {\n 'logo-32x32': KERNEL_ICON_URL,\n 'logo-64x64': KERNEL_ICON_URL,\n },\n },\n create: async (options) => {\n const { PyodideKernel } = await import('@jupyterlite/pyodide-kernel');\n const mountDrive = !!(((serviceWorker === null || serviceWorker === void 0 ? void 0 : serviceWorker.enabled) && (broadcastChannel === null || broadcastChannel === void 0 ? void 0 : broadcastChannel.enabled)) ||\n crossOriginIsolated);\n if (mountDrive) {\n console.info('Pyodide contents will be synced with Jupyter Contents');\n }\n else {\n console.warn('Pyodide contents will NOT be synced with Jupyter Contents');\n }\n return new PyodideKernel({\n ...options,\n pyodideUrl,\n pipliteWheelUrl,\n pipliteUrls,\n disablePyPIFallback,\n mountDrive,\n loadPyodideOptions,\n contentsManager,\n });\n },\n });\n },\n};\nconst plugins = [kernel];\nexport default plugins;\n","import { PageConfig, URLExt } from '@jupyterlab/coreutils';\nimport { PathExt } from '@jupyterlab/coreutils';\nimport { MIME, FILE } from './tokens';\nimport { PromiseDelegate } from '@lumino/coreutils';\n/**\n * The name of the local storage.\n */\nconst DEFAULT_STORAGE_NAME = 'JupyterLite Storage';\n/**\n * The number of checkpoints to save.\n */\nconst N_CHECKPOINTS = 5;\n/**\n * A class to handle requests to /api/contents\n */\nexport class Contents {\n /**\n * Construct a new localForage-powered contents provider\n */\n constructor(options) {\n /**\n * A reducer for turning arbitrary binary into a string\n */\n this.reduceBytesToString = (data, byte) => {\n return data + String.fromCharCode(byte);\n };\n this._serverContents = new Map();\n this._storageName = DEFAULT_STORAGE_NAME;\n this._storageDrivers = null;\n this._localforage = options.localforage;\n this._storageName = options.storageName || DEFAULT_STORAGE_NAME;\n this._storageDrivers = options.storageDrivers || null;\n this._ready = new PromiseDelegate();\n }\n /**\n * Finish any initialization after server has started and all extensions are applied.\n */\n async initialize() {\n await this.initStorage();\n this._ready.resolve(void 0);\n }\n /**\n * Initialize all storage instances\n */\n async initStorage() {\n this._storage = this.createDefaultStorage();\n this._counters = this.createDefaultCounters();\n this._checkpoints = this.createDefaultCheckpoints();\n }\n /**\n * A promise that resolves once all storage is fully initialized.\n */\n get ready() {\n return this._ready.promise;\n }\n /**\n * A lazy reference to the underlying storage.\n */\n get storage() {\n return this.ready.then(() => this._storage);\n }\n /**\n * A lazy reference to the underlying counters.\n */\n get counters() {\n return this.ready.then(() => this._counters);\n }\n /**\n * A lazy reference to the underlying checkpoints.\n */\n get checkpoints() {\n return this.ready.then(() => this._checkpoints);\n }\n /**\n * Get default options for localForage instances\n */\n get defaultStorageOptions() {\n const driver = this._storageDrivers && this._storageDrivers.length ? this._storageDrivers : null;\n return {\n version: 1,\n name: this._storageName,\n ...(driver ? { driver } : {}),\n };\n }\n /**\n * Initialize the default storage for contents.\n */\n createDefaultStorage() {\n return this._localforage.createInstance({\n description: 'Offline Storage for Notebooks and Files',\n storeName: 'files',\n ...this.defaultStorageOptions,\n });\n }\n /**\n * Initialize the default storage for counting file suffixes.\n */\n createDefaultCounters() {\n return this._localforage.createInstance({\n description: 'Store the current file suffix counters',\n storeName: 'counters',\n ...this.defaultStorageOptions,\n });\n }\n /**\n * Create the default checkpoint storage.\n */\n createDefaultCheckpoints() {\n return this._localforage.createInstance({\n description: 'Offline Storage for Checkpoints',\n storeName: 'checkpoints',\n ...this.defaultStorageOptions,\n });\n }\n /**\n * Create a new untitled file or directory in the specified directory path.\n *\n * @param options: The options used to create the file.\n *\n * @returns A promise which resolves with the created file content when the file is created.\n */\n async newUntitled(options) {\n var _a, _b, _c;\n const path = (_a = options === null || options === void 0 ? void 0 : options.path) !== null && _a !== void 0 ? _a : '';\n const type = (_b = options === null || options === void 0 ? void 0 : options.type) !== null && _b !== void 0 ? _b : 'notebook';\n const created = new Date().toISOString();\n let dirname = PathExt.dirname(path);\n const basename = PathExt.basename(path);\n const extname = PathExt.extname(path);\n const item = await this.get(dirname);\n // handle the case of \"Save As\", where the path points to the new file\n // to create, e.g. subfolder/example-copy.ipynb\n let name = '';\n if (path && !extname && item) {\n // directory\n dirname = `${path}/`;\n name = '';\n }\n else if (dirname && basename) {\n // file in a subfolder\n dirname = `${dirname}/`;\n name = basename;\n }\n else {\n // file at the top level\n dirname = '';\n name = path;\n }\n let file;\n switch (type) {\n case 'directory': {\n const counter = await this._incrementCounter('directory');\n name = `Untitled Folder${counter || ''}`;\n file = {\n name,\n path: `${dirname}${name}`,\n last_modified: created,\n created,\n format: 'json',\n mimetype: '',\n content: null,\n size: 0,\n writable: true,\n type: 'directory',\n };\n break;\n }\n case 'notebook': {\n const counter = await this._incrementCounter('notebook');\n name = name || `Untitled${counter || ''}.ipynb`;\n file = {\n name,\n path: `${dirname}${name}`,\n last_modified: created,\n created,\n format: 'json',\n mimetype: MIME.JSON,\n content: Private.EMPTY_NB,\n size: JSON.stringify(Private.EMPTY_NB).length,\n writable: true,\n type: 'notebook',\n };\n break;\n }\n default: {\n const ext = (_c = options === null || options === void 0 ? void 0 : options.ext) !== null && _c !== void 0 ? _c : '.txt';\n const counter = await this._incrementCounter('file');\n const mimetype = FILE.getType(ext) || MIME.OCTET_STREAM;\n let format;\n if (FILE.hasFormat(ext, 'text') || mimetype.indexOf('text') !== -1) {\n format = 'text';\n }\n else if (ext.indexOf('json') !== -1 || ext.indexOf('ipynb') !== -1) {\n format = 'json';\n }\n else {\n format = 'base64';\n }\n name = name || `untitled${counter || ''}${ext}`;\n file = {\n name,\n path: `${dirname}${name}`,\n last_modified: created,\n created,\n format,\n mimetype,\n content: '',\n size: 0,\n writable: true,\n type: 'file',\n };\n break;\n }\n }\n const key = file.path;\n await (await this.storage).setItem(key, file);\n return file;\n }\n /**\n * Copy a file into a given directory.\n *\n * @param path - The original file path.\n * @param toDir - The destination directory path.\n *\n * @returns A promise which resolves with the new contents model when the\n * file is copied.\n *\n * #### Notes\n * The server will select the name of the copied file.\n */\n async copy(path, toDir) {\n let name = PathExt.basename(path);\n toDir = toDir === '' ? '' : `${toDir.slice(1)}/`;\n // TODO: better handle naming collisions with existing files\n while (await this.get(`${toDir}${name}`, { content: true })) {\n const ext = PathExt.extname(name);\n const base = name.replace(ext, '');\n name = `${base} (copy)${ext}`;\n }\n const toPath = `${toDir}${name}`;\n let item = await this.get(path, { content: true });\n if (!item) {\n throw Error(`Could not find file with path ${path}`);\n }\n item = {\n ...item,\n name,\n path: toPath,\n };\n await (await this.storage).setItem(toPath, item);\n return item;\n }\n /**\n * Get a file or directory.\n *\n * @param path: The path to the file.\n * @param options: The options used to fetch the file.\n *\n * @returns A promise which resolves with the file content.\n */\n async get(path, options) {\n // remove leading slash\n path = decodeURIComponent(path.replace(/^\\//, ''));\n if (path === '') {\n return await this._getFolder(path);\n }\n const storage = await this.storage;\n const item = await storage.getItem(path);\n const serverItem = await this._getServerContents(path, options);\n const model = (item || serverItem);\n if (!model) {\n return null;\n }\n if (!(options === null || options === void 0 ? void 0 : options.content)) {\n return {\n size: 0,\n ...model,\n content: null,\n };\n }\n // for directories, find all files with the path as the prefix\n if (model.type === 'directory') {\n const contentMap = new Map();\n await storage.iterate((file, key) => {\n // use an additional slash to not include the directory itself\n if (key === `${path}/${file.name}`) {\n contentMap.set(file.name, file);\n }\n });\n const serverContents = serverItem\n ? serverItem.content\n : Array.from((await this._getServerDirectory(path)).values());\n for (const file of serverContents) {\n if (!contentMap.has(file.name)) {\n contentMap.set(file.name, file);\n }\n }\n const content = [...contentMap.values()];\n return {\n name: PathExt.basename(path),\n path,\n last_modified: model.last_modified,\n created: model.created,\n format: 'json',\n mimetype: MIME.JSON,\n content,\n size: 0,\n writable: true,\n type: 'directory',\n };\n }\n return model;\n }\n /**\n * Rename a file or directory.\n *\n * @param oldLocalPath - The original file path.\n * @param newLocalPath - The new file path.\n *\n * @returns A promise which resolves with the new file content model when the file is renamed.\n */\n async rename(oldLocalPath, newLocalPath) {\n const path = decodeURIComponent(oldLocalPath);\n const file = await this.get(path, { content: true });\n if (!file) {\n throw Error(`Could not find file with path ${path}`);\n }\n const modified = new Date().toISOString();\n const name = PathExt.basename(newLocalPath);\n const newFile = {\n ...file,\n name,\n path: newLocalPath,\n last_modified: modified,\n };\n const storage = await this.storage;\n await storage.setItem(newLocalPath, newFile);\n // remove the old file\n await storage.removeItem(path);\n // remove the corresponding checkpoint\n await (await this.checkpoints).removeItem(path);\n // if a directory, recurse through all children\n if (file.type === 'directory') {\n let child;\n for (child of file.content) {\n await this.rename(URLExt.join(oldLocalPath, child.name), URLExt.join(newLocalPath, child.name));\n }\n }\n return newFile;\n }\n /**\n * Save a file.\n *\n * @param path - The desired file path.\n * @param options - Optional overrides to the model.\n *\n * @returns A promise which resolves with the file content model when the file is saved.\n */\n async save(path, options = {}) {\n var _a;\n path = decodeURIComponent(path);\n // process the file if coming from an upload\n const ext = PathExt.extname((_a = options.name) !== null && _a !== void 0 ? _a : '');\n const chunk = options.chunk;\n // retrieve the content if it is a later chunk or the last one\n // the new content will then be appended to the existing one\n const chunked = chunk ? chunk > 1 || chunk === -1 : false;\n let item = await this.get(path, { content: chunked });\n if (!item) {\n item = await this.newUntitled({ path, ext, type: 'file' });\n }\n if (!item) {\n return null;\n }\n // keep a reference to the original content\n const originalContent = item.content;\n const modified = new Date().toISOString();\n // override with the new values\n item = {\n ...item,\n ...options,\n last_modified: modified,\n };\n if (options.content && options.format === 'base64') {\n const lastChunk = chunk ? chunk === -1 : true;\n if (ext === '.ipynb') {\n const content = this._handleChunk(options.content, originalContent, chunked);\n item = {\n ...item,\n content: lastChunk ? JSON.parse(content) : content,\n format: 'json',\n type: 'notebook',\n size: content.length,\n };\n }\n else if (FILE.hasFormat(ext, 'json')) {\n const content = this._handleChunk(options.content, originalContent, chunked);\n item = {\n ...item,\n content: lastChunk ? JSON.parse(content) : content,\n format: 'json',\n type: 'file',\n size: content.length,\n };\n }\n else if (FILE.hasFormat(ext, 'text')) {\n const content = this._handleChunk(options.content, originalContent, chunked);\n item = {\n ...item,\n content,\n format: 'text',\n type: 'file',\n size: content.length,\n };\n }\n else {\n const content = options.content;\n item = {\n ...item,\n content,\n size: atob(content).length,\n };\n }\n }\n await (await this.storage).setItem(path, item);\n return item;\n }\n /**\n * Delete a file from browser storage.\n *\n * Has no effect on server-backed files, which will re-appear with their\n * original timestamp.\n *\n * @param path - The path to the file.\n */\n async delete(path) {\n path = decodeURIComponent(path);\n const slashed = `${path}/`;\n const toDelete = (await (await this.storage).keys()).filter((key) => key === path || key.startsWith(slashed));\n await Promise.all(toDelete.map(this.forgetPath, this));\n }\n /**\n * Remove the localForage and checkpoints for a path.\n *\n * @param path - The path to the file\n */\n async forgetPath(path) {\n await Promise.all([\n (await this.storage).removeItem(path),\n (await this.checkpoints).removeItem(path),\n ]);\n }\n /**\n * Create a checkpoint for a file.\n *\n * @param path - The path of the file.\n *\n * @returns A promise which resolves with the new checkpoint model when the\n * checkpoint is created.\n */\n async createCheckpoint(path) {\n var _a;\n const checkpoints = await this.checkpoints;\n path = decodeURIComponent(path);\n const item = await this.get(path, { content: true });\n if (!item) {\n throw Error(`Could not find file with path ${path}`);\n }\n const copies = ((_a = (await checkpoints.getItem(path))) !== null && _a !== void 0 ? _a : []).filter(Boolean);\n copies.push(item);\n // keep only a certain amount of checkpoints per file\n if (copies.length > N_CHECKPOINTS) {\n copies.splice(0, copies.length - N_CHECKPOINTS);\n }\n await checkpoints.setItem(path, copies);\n const id = `${copies.length - 1}`;\n return { id, last_modified: item.last_modified };\n }\n /**\n * List available checkpoints for a file.\n *\n * @param path - The path of the file.\n *\n * @returns A promise which resolves with a list of checkpoint models for\n * the file.\n */\n async listCheckpoints(path) {\n const copies = (await (await this.checkpoints).getItem(path)) || [];\n return copies.filter(Boolean).map(this.normalizeCheckpoint, this);\n }\n normalizeCheckpoint(model, id) {\n return { id: id.toString(), last_modified: model.last_modified };\n }\n /**\n * Restore a file to a known checkpoint state.\n *\n * @param path - The path of the file.\n * @param checkpointID - The id of the checkpoint to restore.\n *\n * @returns A promise which resolves when the checkpoint is restored.\n */\n async restoreCheckpoint(path, checkpointID) {\n path = decodeURIComponent(path);\n const copies = ((await (await this.checkpoints).getItem(path)) || []);\n const id = parseInt(checkpointID);\n const item = copies[id];\n await (await this.storage).setItem(path, item);\n }\n /**\n * Delete a checkpoint for a file.\n *\n * @param path - The path of the file.\n * @param checkpointID - The id of the checkpoint to delete.\n *\n * @returns A promise which resolves when the checkpoint is deleted.\n */\n async deleteCheckpoint(path, checkpointID) {\n path = decodeURIComponent(path);\n const copies = ((await (await this.checkpoints).getItem(path)) || []);\n const id = parseInt(checkpointID);\n copies.splice(id, 1);\n await (await this.checkpoints).setItem(path, copies);\n }\n /**\n * Handle a chunk of a file.\n * Decode and unescape a base64-encoded string.\n * @param content the content to process\n *\n * @returns the decoded string, appended to the original content if chunked\n * /\n */\n _handleChunk(newContent, originalContent, chunked) {\n const escaped = decodeURIComponent(escape(atob(newContent)));\n const content = chunked ? originalContent + escaped : escaped;\n return content;\n }\n /**\n * retrieve the contents for this path from the union of local storage and\n * `api/contents/{path}/all.json`.\n *\n * @param path - The contents path to retrieve\n *\n * @returns A promise which resolves with a Map of contents, keyed by local file name\n */\n async _getFolder(path) {\n const content = new Map();\n const storage = await this.storage;\n await storage.iterate((file, key) => {\n if (key.includes('/')) {\n return;\n }\n content.set(file.path, file);\n });\n // layer in contents that don't have local overwrites\n for (const file of (await this._getServerDirectory(path)).values()) {\n if (!content.has(file.path)) {\n content.set(file.path, file);\n }\n }\n if (path && content.size === 0) {\n return null;\n }\n return {\n name: '',\n path,\n last_modified: new Date(0).toISOString(),\n created: new Date(0).toISOString(),\n format: 'json',\n mimetype: MIME.JSON,\n content: Array.from(content.values()),\n size: 0,\n writable: true,\n type: 'directory',\n };\n }\n /**\n * Attempt to recover the model from `{:path}/__all__.json` file, fall back to\n * deriving the model (including content) off the file in `/files/`. Otherwise\n * return `null`.\n */\n async _getServerContents(path, options) {\n const name = PathExt.basename(path);\n const parentContents = await this._getServerDirectory(URLExt.join(path, '..'));\n let model = parentContents.get(name);\n if (!model) {\n return null;\n }\n model = model || {\n name,\n path,\n last_modified: new Date(0).toISOString(),\n created: new Date(0).toISOString(),\n format: 'text',\n mimetype: MIME.PLAIN_TEXT,\n type: 'file',\n writable: true,\n size: 0,\n content: '',\n };\n if (options === null || options === void 0 ? void 0 : options.content) {\n if (model.type === 'directory') {\n const serverContents = await this._getServerDirectory(path);\n model = { ...model, content: Array.from(serverContents.values()) };\n }\n else {\n const fileUrl = URLExt.join(PageConfig.getBaseUrl(), 'files', path);\n const response = await fetch(fileUrl);\n if (!response.ok) {\n return null;\n }\n const mimetype = model.mimetype || response.headers.get('Content-Type');\n const ext = PathExt.extname(name);\n if (model.type === 'notebook' ||\n FILE.hasFormat(ext, 'json') ||\n (mimetype === null || mimetype === void 0 ? void 0 : mimetype.indexOf('json')) !== -1 ||\n path.match(/\\.(ipynb|[^/]*json[^/]*)$/)) {\n const contentText = await response.text();\n model = {\n ...model,\n content: JSON.parse(contentText),\n format: 'json',\n mimetype: model.mimetype || MIME.JSON,\n size: contentText.length,\n };\n }\n else if (FILE.hasFormat(ext, 'text') || mimetype.indexOf('text') !== -1) {\n const contentText = await response.text();\n model = {\n ...model,\n content: contentText,\n format: 'text',\n mimetype: mimetype || MIME.PLAIN_TEXT,\n size: contentText.length,\n };\n }\n else {\n const contentBytes = await response.arrayBuffer();\n const contentBuffer = new Uint8Array(contentBytes);\n model = {\n ...model,\n content: btoa(contentBuffer.reduce(this.reduceBytesToString, '')),\n format: 'base64',\n mimetype: mimetype || MIME.OCTET_STREAM,\n size: contentBuffer.length,\n };\n }\n }\n }\n return model;\n }\n /**\n * retrieve the contents for this path from `__index__.json` in the appropriate\n * folder.\n *\n * @param newLocalPath - The new file path.\n *\n * @returns A promise which resolves with a Map of contents, keyed by local file name\n */\n async _getServerDirectory(path) {\n const content = this._serverContents.get(path) || new Map();\n if (!this._serverContents.has(path)) {\n const apiURL = URLExt.join(PageConfig.getBaseUrl(), 'api/contents', path, 'all.json');\n try {\n const response = await fetch(apiURL);\n const json = JSON.parse(await response.text());\n for (const file of json['content']) {\n content.set(file.name, file);\n }\n }\n catch (err) {\n console.warn(`don't worry, about ${err}... nothing's broken. If there had been a\n file at ${apiURL}, you might see some more files.`);\n }\n this._serverContents.set(path, content);\n }\n return content;\n }\n /**\n * Increment the counter for a given file type.\n * Used to avoid collisions when creating new untitled files.\n *\n * @param type The file type to increment the counter for.\n */\n async _incrementCounter(type) {\n var _a;\n const counters = await this.counters;\n const current = (_a = (await counters.getItem(type))) !== null && _a !== void 0 ? _a : -1;\n const counter = current + 1;\n await counters.setItem(type, counter);\n return counter;\n }\n}\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n /**\n * The content for an empty notebook.\n */\n Private.EMPTY_NB = {\n metadata: {\n orig_nbformat: 4,\n },\n nbformat_minor: 4,\n nbformat: 4,\n cells: [],\n };\n})(Private || (Private = {}));\n//# sourceMappingURL=contents.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { DRIVE_API_PATH } from './drivefs';\nimport { DriveContentsProcessor } from './drivecontents';\n/** A broadcaster for the ServiceWorker */\nexport class BroadcastChannelWrapper {\n constructor(options) {\n this.isDisposed = false;\n /** Handle a message received on the BroadcastChannel */\n this._onMessage = async (event) => {\n if (!this._channel) {\n return;\n }\n const request = event.data;\n const receiver = request === null || request === void 0 ? void 0 : request.receiver;\n if (receiver !== 'broadcast.ts') {\n // Message is not meant for us\n return;\n }\n const response = await this._driveContentsProcessor.processDriveRequest(request);\n this._channel.postMessage(response);\n };\n this._channel = null;\n this._enabled = false;\n this._contents = options.contents;\n this._driveContentsProcessor = new DriveContentsProcessor({\n contentsManager: this._contents,\n });\n }\n get enabled() {\n return this._enabled;\n }\n enable() {\n if (this._channel) {\n console.warn('BroadcastChannel already created and enabled');\n return;\n }\n this._channel = new BroadcastChannel(DRIVE_API_PATH);\n this._channel.addEventListener('message', this._onMessage);\n this._enabled = true;\n }\n disable() {\n if (this._channel) {\n this._channel.removeEventListener('message', this._onMessage);\n this._channel = null;\n }\n this._enabled = false;\n }\n /** Clean up the broadcaster. */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this.disable();\n this.isDisposed = true;\n }\n}\n//# sourceMappingURL=broadcast.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { Signal } from '@lumino/signaling';\n/**\n * A concrete implementation of IObservableMap.\n */\nexport class ObservableMap {\n /**\n * Construct a new observable map.\n */\n constructor(options = {}) {\n this._map = new Map();\n this._changed = new Signal(this);\n this._isDisposed = false;\n this._itemCmp = options.itemCmp || Private.itemCmp;\n if (options.values) {\n for (const key in options.values) {\n this._map.set(key, options.values[key]);\n }\n }\n }\n /**\n * The type of the Observable.\n */\n get type() {\n return 'Map';\n }\n /**\n * A signal emitted when the map has changed.\n */\n get changed() {\n return this._changed;\n }\n /**\n * Whether this map has been disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * The number of key-value pairs in the map.\n */\n get size() {\n return this._map.size;\n }\n /**\n * Set a key-value pair in the map\n *\n * @param key - The key to set.\n *\n * @param value - The value for the key.\n *\n * @returns the old value for the key, or undefined\n * if that did not exist.\n *\n * @throws if the new value is undefined.\n *\n * #### Notes\n * This is a no-op if the value does not change.\n */\n set(key, value) {\n const oldVal = this._map.get(key);\n if (value === undefined) {\n throw Error('Cannot set an undefined value, use remove');\n }\n // Bail if the value does not change.\n const itemCmp = this._itemCmp;\n if (oldVal !== undefined && itemCmp(oldVal, value)) {\n return oldVal;\n }\n this._map.set(key, value);\n this._changed.emit({\n type: oldVal ? 'change' : 'add',\n key: key,\n oldValue: oldVal,\n newValue: value\n });\n return oldVal;\n }\n /**\n * Get a value for a given key.\n *\n * @param key - the key.\n *\n * @returns the value for that key.\n */\n get(key) {\n return this._map.get(key);\n }\n /**\n * Check whether the map has a key.\n *\n * @param key - the key to check.\n *\n * @returns `true` if the map has the key, `false` otherwise.\n */\n has(key) {\n return this._map.has(key);\n }\n /**\n * Get a list of the keys in the map.\n *\n * @returns - a list of keys.\n */\n keys() {\n const keyList = [];\n this._map.forEach((v, k) => {\n keyList.push(k);\n });\n return keyList;\n }\n /**\n * Get a list of the values in the map.\n *\n * @returns - a list of values.\n */\n values() {\n const valList = [];\n this._map.forEach((v, k) => {\n valList.push(v);\n });\n return valList;\n }\n /**\n * Remove a key from the map\n *\n * @param key - the key to remove.\n *\n * @returns the value of the given key,\n * or undefined if that does not exist.\n *\n * #### Notes\n * This is a no-op if the value does not change.\n */\n delete(key) {\n const oldVal = this._map.get(key);\n const removed = this._map.delete(key);\n if (removed) {\n this._changed.emit({\n type: 'remove',\n key: key,\n oldValue: oldVal,\n newValue: undefined\n });\n }\n return oldVal;\n }\n /**\n * Set the ObservableMap to an empty map.\n */\n clear() {\n // Delete one by one to emit the correct signals.\n const keyList = this.keys();\n for (let i = 0; i < keyList.length; i++) {\n this.delete(keyList[i]);\n }\n }\n /**\n * Dispose of the resources held by the map.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n Signal.clearData(this);\n this._map.clear();\n }\n}\n/**\n * The namespace for module private data.\n */\nvar Private;\n(function (Private) {\n /**\n * The default strict equality item comparator.\n */\n function itemCmp(first, second) {\n return first === second;\n }\n Private.itemCmp = itemCmp;\n})(Private || (Private = {}));\n//# sourceMappingURL=observablemap.js.map","const E_TIMEOUT = new Error('timeout while waiting for mutex to become available');\nconst E_ALREADY_LOCKED = new Error('mutex already locked');\nconst E_CANCELED = new Error('request for lock canceled');\n\nvar __awaiter$2 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nclass Semaphore {\n constructor(_maxConcurrency, _cancelError = E_CANCELED) {\n this._maxConcurrency = _maxConcurrency;\n this._cancelError = _cancelError;\n this._queue = [];\n this._waiters = [];\n if (_maxConcurrency <= 0) {\n throw new Error('semaphore must be initialized to a positive value');\n }\n this._value = _maxConcurrency;\n }\n acquire() {\n const locked = this.isLocked();\n const ticketPromise = new Promise((resolve, reject) => this._queue.push({ resolve, reject }));\n if (!locked)\n this._dispatch();\n return ticketPromise;\n }\n runExclusive(callback) {\n return __awaiter$2(this, void 0, void 0, function* () {\n const [value, release] = yield this.acquire();\n try {\n return yield callback(value);\n }\n finally {\n release();\n }\n });\n }\n waitForUnlock() {\n return __awaiter$2(this, void 0, void 0, function* () {\n if (!this.isLocked()) {\n return Promise.resolve();\n }\n const waitPromise = new Promise((resolve) => this._waiters.push({ resolve }));\n return waitPromise;\n });\n }\n isLocked() {\n return this._value <= 0;\n }\n /** @deprecated Deprecated in 0.3.0, will be removed in 0.4.0. Use runExclusive instead. */\n release() {\n if (this._maxConcurrency > 1) {\n throw new Error('this method is unavailable on semaphores with concurrency > 1; use the scoped release returned by acquire instead');\n }\n if (this._currentReleaser) {\n const releaser = this._currentReleaser;\n this._currentReleaser = undefined;\n releaser();\n }\n }\n cancel() {\n this._queue.forEach((ticket) => ticket.reject(this._cancelError));\n this._queue = [];\n }\n _dispatch() {\n const nextTicket = this._queue.shift();\n if (!nextTicket)\n return;\n let released = false;\n this._currentReleaser = () => {\n if (released)\n return;\n released = true;\n this._value++;\n this._resolveWaiters();\n this._dispatch();\n };\n nextTicket.resolve([this._value--, this._currentReleaser]);\n }\n _resolveWaiters() {\n this._waiters.forEach((waiter) => waiter.resolve());\n this._waiters = [];\n }\n}\n\nvar __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nclass Mutex {\n constructor(cancelError) {\n this._semaphore = new Semaphore(1, cancelError);\n }\n acquire() {\n return __awaiter$1(this, void 0, void 0, function* () {\n const [, releaser] = yield this._semaphore.acquire();\n return releaser;\n });\n }\n runExclusive(callback) {\n return this._semaphore.runExclusive(() => callback());\n }\n isLocked() {\n return this._semaphore.isLocked();\n }\n waitForUnlock() {\n return this._semaphore.waitForUnlock();\n }\n /** @deprecated Deprecated in 0.3.0, will be removed in 0.4.0. Use runExclusive instead. */\n release() {\n this._semaphore.release();\n }\n cancel() {\n return this._semaphore.cancel();\n }\n}\n\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nfunction withTimeout(sync, timeout, timeoutError = E_TIMEOUT) {\n return {\n acquire: () => new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n let isTimeout = false;\n const handle = setTimeout(() => {\n isTimeout = true;\n reject(timeoutError);\n }, timeout);\n try {\n const ticket = yield sync.acquire();\n if (isTimeout) {\n const release = Array.isArray(ticket) ? ticket[1] : ticket;\n release();\n }\n else {\n clearTimeout(handle);\n resolve(ticket);\n }\n }\n catch (e) {\n if (!isTimeout) {\n clearTimeout(handle);\n reject(e);\n }\n }\n })),\n runExclusive(callback) {\n return __awaiter(this, void 0, void 0, function* () {\n let release = () => undefined;\n try {\n const ticket = yield this.acquire();\n if (Array.isArray(ticket)) {\n release = ticket[1];\n return yield callback(ticket[0]);\n }\n else {\n release = ticket;\n return yield callback();\n }\n }\n finally {\n release();\n }\n });\n },\n /** @deprecated Deprecated in 0.3.0, will be removed in 0.4.0. Use runExclusive instead. */\n release() {\n sync.release();\n },\n cancel() {\n return sync.cancel();\n },\n waitForUnlock: () => sync.waitForUnlock(),\n isLocked: () => sync.isLocked(),\n };\n}\n\n// eslint-disable-next-lisne @typescript-eslint/explicit-module-boundary-types\nfunction tryAcquire(sync, alreadyAcquiredError = E_ALREADY_LOCKED) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return withTimeout(sync, 0, alreadyAcquiredError);\n}\n\nexport { E_ALREADY_LOCKED, E_CANCELED, E_TIMEOUT, Mutex, Semaphore, tryAcquire, withTimeout };\n","import { ObservableMap } from '@jupyterlab/observables';\nimport { deserialize, serialize } from '@jupyterlab/services/lib/kernel/serialize';\nimport { supportedKernelWebSocketProtocols } from '@jupyterlab/services/lib/kernel/messages';\nimport { UUID } from '@lumino/coreutils';\nimport { Server as WebSocketServer } from 'mock-socket';\nimport { Mutex } from 'async-mutex';\nimport { PageConfig } from '@jupyterlab/coreutils';\n/**\n * Use the default kernel wire protocol.\n */\nconst KERNEL_WEBSOCKET_PROTOCOL = supportedKernelWebSocketProtocols.v1KernelWebsocketJupyterOrg;\n/**\n * A class to handle requests to /api/kernels\n */\nexport class Kernels {\n /**\n * Construct a new Kernels\n *\n * @param options The instantiation options\n */\n constructor(options) {\n this._kernels = new ObservableMap();\n this._clients = new ObservableMap();\n this._kernelClients = new ObservableMap();\n const { kernelspecs } = options;\n this._kernelspecs = kernelspecs;\n }\n /**\n * Start a new kernel.\n *\n * @param options The kernel start options.\n */\n async startNew(options) {\n const { id, name, location } = options;\n const factory = this._kernelspecs.factories.get(name);\n // bail if there is no factory associated with the requested kernel\n if (!factory) {\n return { id, name };\n }\n // create a synchronization mechanism to allow only one message\n // to be processed at a time\n const mutex = new Mutex();\n // hook a new client to a kernel\n const hook = (kernelId, clientId, socket) => {\n var _a;\n const kernel = this._kernels.get(kernelId);\n if (!kernel) {\n throw Error(`No kernel ${kernelId}`);\n }\n this._clients.set(clientId, socket);\n (_a = this._kernelClients.get(kernelId)) === null || _a === void 0 ? void 0 : _a.add(clientId);\n const processMsg = async (msg) => {\n await mutex.runExclusive(async () => {\n await kernel.ready;\n await kernel.handleMessage(msg);\n });\n };\n socket.on('message', async (message) => {\n let msg;\n if (message instanceof ArrayBuffer) {\n message = new Uint8Array(message).buffer;\n msg = deserialize(message, KERNEL_WEBSOCKET_PROTOCOL);\n }\n else if (typeof message === 'string') {\n const encoder = new TextEncoder();\n const encodedData = encoder.encode(message);\n msg = deserialize(encodedData.buffer, KERNEL_WEBSOCKET_PROTOCOL);\n }\n else {\n return;\n }\n // TODO Find a better solution for this?\n // input-reply is asynchronous, must not be processed like other messages\n if (msg.header.msg_type === 'input_reply') {\n kernel.handleMessage(msg);\n }\n else {\n void processMsg(msg);\n }\n });\n const removeClient = () => {\n var _a;\n this._clients.delete(clientId);\n (_a = this._kernelClients.get(kernelId)) === null || _a === void 0 ? void 0 : _a.delete(clientId);\n };\n kernel.disposed.connect(removeClient);\n // TODO: check whether this is called\n // https://github.com/thoov/mock-socket/issues/298\n // https://github.com/jupyterlab/jupyterlab/blob/6bc884a7a8ed73c615ce72ba097bdb790482b5bf/packages/services/src/kernel/default.ts#L1245\n socket.onclose = removeClient;\n };\n // ensure kernel id\n const kernelId = id !== null && id !== void 0 ? id : UUID.uuid4();\n // There is one server per kernel which handles multiple clients\n const kernelUrl = `${Kernels.WS_BASE_URL}api/kernels/${kernelId}/channels`;\n const runningKernel = this._kernels.get(kernelId);\n if (runningKernel) {\n return {\n id: runningKernel.id,\n name: runningKernel.name,\n };\n }\n // start the kernel\n const sendMessage = (msg) => {\n const clientId = msg.header.session;\n const socket = this._clients.get(clientId);\n if (!socket) {\n console.warn(`Trying to send message on removed socket for kernel ${kernelId}`);\n return;\n }\n const message = serialize(msg, KERNEL_WEBSOCKET_PROTOCOL);\n // process iopub messages\n if (msg.channel === 'iopub') {\n const clients = this._kernelClients.get(kernelId);\n clients === null || clients === void 0 ? void 0 : clients.forEach((id) => {\n var _a;\n (_a = this._clients.get(id)) === null || _a === void 0 ? void 0 : _a.send(message);\n });\n return;\n }\n socket.send(message);\n };\n const kernel = await factory({\n id: kernelId,\n sendMessage,\n name,\n location,\n });\n this._kernels.set(kernelId, kernel);\n this._kernelClients.set(kernelId, new Set());\n // create the websocket server for the kernel\n const wsServer = new WebSocketServer(kernelUrl, {\n mock: false,\n selectProtocol: () => KERNEL_WEBSOCKET_PROTOCOL,\n });\n wsServer.on('connection', (socket) => {\n var _a;\n const url = new URL(socket.url);\n const clientId = (_a = url.searchParams.get('session_id')) !== null && _a !== void 0 ? _a : '';\n hook(kernelId, clientId, socket);\n });\n // clean up closed connection\n wsServer.on('close', () => {\n this._clients.keys().forEach((clientId) => {\n var _a;\n const socket = this._clients.get(clientId);\n if ((socket === null || socket === void 0 ? void 0 : socket.readyState) === WebSocket.CLOSED) {\n this._clients.delete(clientId);\n (_a = this._kernelClients.get(kernelId)) === null || _a === void 0 ? void 0 : _a.delete(clientId);\n }\n });\n });\n // cleanup on kernel shutdown\n kernel.disposed.connect(() => {\n wsServer.close();\n this._kernels.delete(kernelId);\n this._kernelClients.delete(kernelId);\n });\n return {\n id: kernel.id,\n name: kernel.name,\n };\n }\n /**\n * Restart a kernel.\n *\n * @param kernelId The kernel id.\n */\n async restart(kernelId) {\n const kernel = this._kernels.get(kernelId);\n if (!kernel) {\n throw Error(`Kernel ${kernelId} does not exist`);\n }\n const { id, name, location } = kernel;\n kernel.dispose();\n return this.startNew({ id, name, location });\n }\n /**\n * List the running kernels.\n */\n async list() {\n return [...this._kernels.values()].map((kernel) => ({\n id: kernel.id,\n name: kernel.name,\n }));\n }\n /**\n * Shut down a kernel.\n *\n * @param id The kernel id.\n */\n async shutdown(id) {\n var _a;\n (_a = this._kernels.delete(id)) === null || _a === void 0 ? void 0 : _a.dispose();\n }\n /**\n * Get a kernel by id\n */\n async get(id) {\n return this._kernels.get(id);\n }\n}\n/**\n * A namespace for Kernels statics.\n */\n(function (Kernels) {\n /**\n * The base url for the Kernels manager\n */\n Kernels.WS_BASE_URL = PageConfig.getBaseUrl().replace(/^http/, 'ws');\n})(Kernels || (Kernels = {}));\n//# sourceMappingURL=kernels.js.map","import { PageConfig } from '@jupyterlab/coreutils';\nimport { FALLBACK_KERNEL } from './tokens';\n/**\n * A class to handle requests to /api/kernelspecs\n */\nexport class KernelSpecs {\n constructor() {\n this._specs = new Map();\n this._factories = new Map();\n }\n /**\n * Get the kernel specs.\n */\n get specs() {\n if (this._specs.size === 0) {\n return null;\n }\n return {\n default: this.defaultKernelName,\n kernelspecs: Object.fromEntries(this._specs),\n };\n }\n /**\n * Get the default kernel name.\n */\n get defaultKernelName() {\n let defaultKernelName = PageConfig.getOption('defaultKernelName');\n if (!defaultKernelName && this._specs.size) {\n const keys = Array.from(this._specs.keys());\n keys.sort();\n defaultKernelName = keys[0];\n }\n return defaultKernelName || FALLBACK_KERNEL;\n }\n /**\n * Get the kernel factories for the current kernels.\n */\n get factories() {\n return this._factories;\n }\n /**\n * Register a new kernel.\n *\n * @param options The options to register a new kernel.\n */\n register(options) {\n const { spec, create } = options;\n this._specs.set(spec.name, spec);\n this._factories.set(spec.name, create);\n }\n}\n//# sourceMappingURL=kernelspecs.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { Token } from '@lumino/coreutils';\n/**\n * The well-known name of the file. Can actually be configured by alternate\n * implementations, but the default is probably good enough for \"best-effort.\"\n */\nexport const THIRD_PARTY_LICENSES = 'third-party-licenses.json';\n/**\n * The token for the licenses service.\n */\nexport const ILicenses = new Token('@jupyterlite/licenses:ILicenses');\n//# sourceMappingURL=tokens.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { URLExt, PageConfig } from '@jupyterlab/coreutils';\nimport { THIRD_PARTY_LICENSES, } from './tokens';\n/**\n * An empty bundle.\n */\nconst EMPTY_BUNDLE = Object.freeze({ packages: [] });\n/**\n * A JupyterLite implementation of the jupyterlab_server licenses route\n */\nexport class Licenses {\n /**\n * A GET handler for the licenses\n */\n async get() {\n return {\n bundles: {\n ...(await this._getFederated()),\n [this.appName]: await this._getAppLicenses(),\n },\n };\n }\n /**\n * Get the app name (or default).\n */\n get appName() {\n return PageConfig.getOption('appName') || 'JupyterLite';\n }\n /**\n * Get the well-known URL of the app licenses.\n */\n get appLicensesUrl() {\n return URLExt.join(PageConfig.getBaseUrl(), 'build', THIRD_PARTY_LICENSES);\n }\n /**\n * Get the lab extension base url.\n */\n get labExtensionsUrl() {\n return PageConfig.getOption('fullLabextensionsUrl');\n }\n /**\n * Resolve the licenses for the app distribution itself, or the empty bundle.\n */\n async _getAppLicenses() {\n let bundle = EMPTY_BUNDLE;\n try {\n const response = await fetch(this.appLicensesUrl);\n bundle = response.json();\n }\n catch (err) {\n console.warn('Could not resolve licenses for', this.appName);\n }\n return bundle;\n }\n /**\n * Resolve the licenses for all federated extensions.\n */\n async _getFederated() {\n const bundles = {};\n let federated;\n try {\n federated = JSON.parse(PageConfig.getOption('federated_extensions'));\n }\n catch {\n return bundles;\n }\n const promises = [];\n for (const ext of federated) {\n promises.push(this._getOneFederated(ext, bundles));\n }\n try {\n await Promise.all(promises);\n }\n catch (err) {\n console.warn('Error resolving licenses', err);\n }\n return bundles;\n }\n /**\n * Update the bundles with the extension's licenses, or the empty bundle.\n */\n async _getOneFederated(ext, bundles) {\n try {\n const url = URLExt.join(this.labExtensionsUrl, ext.name, 'static', THIRD_PARTY_LICENSES);\n const response = await fetch(url);\n bundles[ext.name] = await response.json();\n }\n catch {\n console.warn('Could not resolve licenses for', ext);\n bundles[ext.name] = EMPTY_BUNDLE;\n }\n }\n}\n//# sourceMappingURL=licenses.js.map","import { Token } from '@lumino/coreutils';\n/**\n * The token for the sessions service.\n */\nexport const ISessions = new Token('@jupyterlite/session:ISessions');\n//# sourceMappingURL=tokens.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for array-specific algorithms.\n */\nvar ArrayExt;\n(function (ArrayExt) {\n /**\n * Find the index of the first occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.firstIndexOf(data, 'red'); // -1\n * ArrayExt.firstIndexOf(data, 'one'); // 0\n * ArrayExt.firstIndexOf(data, 'one', 1); // 4\n * ArrayExt.firstIndexOf(data, 'two', 2); // -1\n * ArrayExt.firstIndexOf(data, 'two', 2, 1); // 1\n * ```\n */\n function firstIndexOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.firstIndexOf = firstIndexOf;\n /**\n * Find the index of the last occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.lastIndexOf(data, 'red'); // -1\n * ArrayExt.lastIndexOf(data, 'one'); // 4\n * ArrayExt.lastIndexOf(data, 'one', 1); // 0\n * ArrayExt.lastIndexOf(data, 'two', 0); // -1\n * ArrayExt.lastIndexOf(data, 'two', 0, 1); // 1\n * ```\n */\n function lastIndexOf(array, value, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (start < stop) {\n span = start + 1 + (n - stop);\n }\n else {\n span = start - stop + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start - i + n) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.lastIndexOf = lastIndexOf;\n /**\n * Find the index of the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstIndex(data, isEven); // 1\n * ArrayExt.findFirstIndex(data, isEven, 4); // 5\n * ArrayExt.findFirstIndex(data, isEven, 6); // -1\n * ArrayExt.findFirstIndex(data, isEven, 6, 5); // 1\n * ```\n */\n function findFirstIndex(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findFirstIndex = findFirstIndex;\n /**\n * Find the index of the last value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastIndex(data, isEven); // 5\n * ArrayExt.findLastIndex(data, isEven, 4); // 3\n * ArrayExt.findLastIndex(data, isEven, 0); // -1\n * ArrayExt.findLastIndex(data, isEven, 0, 1); // 5\n * ```\n */\n function findLastIndex(array, fn, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let d;\n if (start < stop) {\n d = start + 1 + (n - stop);\n }\n else {\n d = start - stop + 1;\n }\n for (let i = 0; i < d; ++i) {\n let j = (start - i + n) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findLastIndex = findLastIndex;\n /**\n * Find the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstValue(data, isEven); // 2\n * ArrayExt.findFirstValue(data, isEven, 2); // 4\n * ArrayExt.findFirstValue(data, isEven, 6); // undefined\n * ArrayExt.findFirstValue(data, isEven, 6, 5); // 2\n * ```\n */\n function findFirstValue(array, fn, start = 0, stop = -1) {\n let index = findFirstIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findFirstValue = findFirstValue;\n /**\n * Find the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The last matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastValue(data, isEven); // 2\n * ArrayExt.findLastValue(data, isEven, 4); // 4\n * ArrayExt.findLastValue(data, isEven, 0); // undefined\n * ArrayExt.findLastValue(data, isEven, 0, 1); // 2\n * ```\n */\n function findLastValue(array, fn, start = -1, stop = 0) {\n let index = findLastIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findLastValue = findLastValue;\n /**\n * Find the index of the first element which compares `>=` to a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>=` to the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.lowerBound(data, 0, numberCmp); // 0\n * ArrayExt.lowerBound(data, 6, numberCmp); // 3\n * ArrayExt.lowerBound(data, 7, numberCmp); // 3\n * ArrayExt.lowerBound(data, -1, numberCmp); // 0\n * ArrayExt.lowerBound(data, 10, numberCmp); // 6\n * ```\n */\n function lowerBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) < 0) {\n begin = middle + 1;\n span -= half + 1;\n }\n else {\n span = half;\n }\n }\n return begin;\n }\n ArrayExt.lowerBound = lowerBound;\n /**\n * Find the index of the first element which compares `>` than a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>` than the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.upperBound(data, 0, numberCmp); // 1\n * ArrayExt.upperBound(data, 6, numberCmp); // 3\n * ArrayExt.upperBound(data, 7, numberCmp); // 5\n * ArrayExt.upperBound(data, -1, numberCmp); // 0\n * ArrayExt.upperBound(data, 10, numberCmp); // 6\n * ```\n */\n function upperBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) > 0) {\n span = half;\n }\n else {\n begin = middle + 1;\n span -= half + 1;\n }\n }\n return begin;\n }\n ArrayExt.upperBound = upperBound;\n /**\n * Test whether two arrays are shallowly equal.\n *\n * @param a - The first array-like object to compare.\n *\n * @param b - The second array-like object to compare.\n *\n * @param fn - The comparison function to apply to the elements. It\n * should return `true` if the elements are \"equal\". The default\n * compares elements using strict `===` equality.\n *\n * @returns Whether the two arrays are shallowly equal.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * Modifying the length of the arrays while comparing.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let d1 = [0, 3, 4, 7, 7, 9];\n * let d2 = [0, 3, 4, 7, 7, 9];\n * let d3 = [42];\n * ArrayExt.shallowEqual(d1, d2); // true\n * ArrayExt.shallowEqual(d2, d3); // false\n * ```\n */\n function shallowEqual(a, b, fn) {\n // Check for object identity first.\n if (a === b) {\n return true;\n }\n // Bail early if the lengths are different.\n if (a.length !== b.length) {\n return false;\n }\n // Compare each element for equality.\n for (let i = 0, n = a.length; i < n; ++i) {\n if (fn ? !fn(a[i], b[i]) : a[i] !== b[i]) {\n return false;\n }\n }\n // The array are shallowly equal.\n return true;\n }\n ArrayExt.shallowEqual = shallowEqual;\n /**\n * Create a slice of an array subject to an optional step.\n *\n * @param array - The array-like object of interest.\n *\n * @param options - The options for configuring the slice.\n *\n * @returns A new array with the specified values.\n *\n * @throws An exception if the slice `step` is `0`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start`, `stop`, or `step` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.slice(data); // [0, 3, 4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 2 }); // [4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 0, stop: 4 }); // [0, 3, 4, 7]\n * ArrayExt.slice(data, { step: 2 }); // [0, 4, 7]\n * ArrayExt.slice(data, { step: -1 }); // [9, 7, 7, 4, 3, 0]\n * ```\n */\n function slice(array, options = {}) {\n // Extract the options.\n let { start, stop, step } = options;\n // Set up the `step` value.\n if (step === undefined) {\n step = 1;\n }\n // Validate the step size.\n if (step === 0) {\n throw new Error('Slice `step` cannot be zero.');\n }\n // Look up the length of the array.\n let n = array.length;\n // Set up the `start` value.\n if (start === undefined) {\n start = step < 0 ? n - 1 : 0;\n }\n else if (start < 0) {\n start = Math.max(start + n, step < 0 ? -1 : 0);\n }\n else if (start >= n) {\n start = step < 0 ? n - 1 : n;\n }\n // Set up the `stop` value.\n if (stop === undefined) {\n stop = step < 0 ? -1 : n;\n }\n else if (stop < 0) {\n stop = Math.max(stop + n, step < 0 ? -1 : 0);\n }\n else if (stop >= n) {\n stop = step < 0 ? n - 1 : n;\n }\n // Compute the slice length.\n let length;\n if ((step < 0 && stop >= start) || (step > 0 && start >= stop)) {\n length = 0;\n }\n else if (step < 0) {\n length = Math.floor((stop - start + 1) / step + 1);\n }\n else {\n length = Math.floor((stop - start - 1) / step + 1);\n }\n // Compute the sliced result.\n let result = [];\n for (let i = 0; i < length; ++i) {\n result[i] = array[start + i * step];\n }\n // Return the result.\n return result;\n }\n ArrayExt.slice = slice;\n /**\n * Move an element in an array from one index to another.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param fromIndex - The index of the element to move. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param toIndex - The target index of the element. Negative\n * values are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `fromIndex` or `toIndex` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.move(data, 1, 2); // [0, 2, 1, 3, 4]\n * ArrayExt.move(data, 4, 2); // [0, 2, 4, 1, 3]\n * ```\n */\n function move(array, fromIndex, toIndex) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (fromIndex < 0) {\n fromIndex = Math.max(0, fromIndex + n);\n }\n else {\n fromIndex = Math.min(fromIndex, n - 1);\n }\n if (toIndex < 0) {\n toIndex = Math.max(0, toIndex + n);\n }\n else {\n toIndex = Math.min(toIndex, n - 1);\n }\n if (fromIndex === toIndex) {\n return;\n }\n let value = array[fromIndex];\n let d = fromIndex < toIndex ? 1 : -1;\n for (let i = fromIndex; i !== toIndex; i += d) {\n array[i] = array[i + d];\n }\n array[toIndex] = value;\n }\n ArrayExt.move = move;\n /**\n * Reverse an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param start - The index of the first element in the range to be\n * reversed, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * reversed, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` index which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.reverse(data, 1, 3); // [0, 3, 2, 1, 4]\n * ArrayExt.reverse(data, 3); // [0, 3, 2, 4, 1]\n * ArrayExt.reverse(data); // [1, 4, 2, 3, 0]\n * ```\n */\n function reverse(array, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n while (start < stop) {\n let a = array[start];\n let b = array[stop];\n array[start++] = b;\n array[stop--] = a;\n }\n }\n ArrayExt.reverse = reverse;\n /**\n * Rotate the elements of an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param delta - The amount of rotation to apply to the elements. A\n * positive value will rotate the elements to the left. A negative\n * value will rotate the elements to the right.\n *\n * @param start - The index of the first element in the range to be\n * rotated, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * rotated, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `delta`, `start`, or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.rotate(data, 2); // [2, 3, 4, 0, 1]\n * ArrayExt.rotate(data, -2); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 10); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 9); // [4, 0, 1, 2, 3]\n * ArrayExt.rotate(data, 2, 1, 3); // [4, 2, 0, 1, 3]\n * ```\n */\n function rotate(array, delta, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n if (start >= stop) {\n return;\n }\n let length = stop - start + 1;\n if (delta > 0) {\n delta = delta % length;\n }\n else if (delta < 0) {\n delta = ((delta % length) + length) % length;\n }\n if (delta === 0) {\n return;\n }\n let pivot = start + delta;\n reverse(array, start, pivot - 1);\n reverse(array, pivot, stop);\n reverse(array, start, stop);\n }\n ArrayExt.rotate = rotate;\n /**\n * Fill an array with a static value.\n *\n * @param array - The mutable array-like object to fill.\n *\n * @param value - The static value to use to fill the array.\n *\n * @param start - The index of the first element in the range to be\n * filled, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * filled, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Notes\n * If `stop < start` the fill will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four'];\n * ArrayExt.fill(data, 'r'); // ['r', 'r', 'r', 'r']\n * ArrayExt.fill(data, 'g', 1); // ['r', 'g', 'g', 'g']\n * ArrayExt.fill(data, 'b', 2, 3); // ['r', 'g', 'b', 'b']\n * ArrayExt.fill(data, 'z', 3, 1); // ['z', 'z', 'b', 'z']\n * ```\n */\n function fill(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n array[(start + i) % n] = value;\n }\n }\n ArrayExt.fill = fill;\n /**\n * Insert a value into an array at a specific index.\n *\n * @param array - The array of interest.\n *\n * @param index - The index at which to insert the value. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param value - The value to set at the specified index.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2];\n * ArrayExt.insert(data, 0, -1); // [-1, 0, 1, 2]\n * ArrayExt.insert(data, 2, 12); // [-1, 0, 12, 1, 2]\n * ArrayExt.insert(data, -1, 7); // [-1, 0, 12, 1, 7, 2]\n * ArrayExt.insert(data, 6, 19); // [-1, 0, 12, 1, 7, 2, 19]\n * ```\n */\n function insert(array, index, value) {\n let n = array.length;\n if (index < 0) {\n index = Math.max(0, index + n);\n }\n else {\n index = Math.min(index, n);\n }\n for (let i = n; i > index; --i) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n }\n ArrayExt.insert = insert;\n /**\n * Remove and return a value at a specific index in an array.\n *\n * @param array - The array of interest.\n *\n * @param index - The index of the value to remove. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The value at the specified index, or `undefined` if the\n * index is out of range.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeAt(data, 2); // 23\n * ArrayExt.removeAt(data, -2); // 12\n * ArrayExt.removeAt(data, 10); // undefined;\n * ```\n */\n function removeAt(array, index) {\n let n = array.length;\n if (index < 0) {\n index += n;\n }\n if (index < 0 || index >= n) {\n return undefined;\n }\n let value = array[index];\n for (let i = index + 1; i < n; ++i) {\n array[i - 1] = array[i];\n }\n array.length = n - 1;\n return value;\n }\n ArrayExt.removeAt = removeAt;\n /**\n * Remove the first occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstOf(data, 12); // 1\n * ArrayExt.removeFirstOf(data, 17); // -1\n * ArrayExt.removeFirstOf(data, 39, 3); // -1\n * ArrayExt.removeFirstOf(data, 39, 3, 2); // 2\n * ```\n */\n function removeFirstOf(array, value, start = 0, stop = -1) {\n let index = firstIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeFirstOf = removeFirstOf;\n /**\n * Remove the last occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastOf(data, 12); // 5\n * ArrayExt.removeLastOf(data, 17); // -1\n * ArrayExt.removeLastOf(data, 39, 2); // -1\n * ArrayExt.removeLastOf(data, 39, 2, 3); // 3\n * ```\n */\n function removeLastOf(array, value, start = -1, stop = 0) {\n let index = lastIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeLastOf = removeLastOf;\n /**\n * Remove all occurrences of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [14, 12, 23, 39, 14, 12, 19, 14];\n * ArrayExt.removeAllOf(data, 12); // 2\n * ArrayExt.removeAllOf(data, 17); // 0\n * ArrayExt.removeAllOf(data, 14, 1, 4); // 1\n * ```\n */\n function removeAllOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && array[i] === value) {\n count++;\n }\n else if (stop < start &&\n (i <= stop || i >= start) &&\n array[i] === value) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllOf = removeAllOf;\n /**\n * Remove the first occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstWhere(data, isEven); // { index: 0, value: 0 }\n * ArrayExt.removeFirstWhere(data, isEven, 2); // { index: 3, value: 14 }\n * ArrayExt.removeFirstWhere(data, isEven, 4); // { index: -1, value: undefined }\n * ```\n */\n function removeFirstWhere(array, fn, start = 0, stop = -1) {\n let value;\n let index = findFirstIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeFirstWhere = removeFirstWhere;\n /**\n * Remove the last occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastWhere(data, isEven); // { index: 5, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2); // { index: 1, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2, 1); // { index: -1, value: undefined }\n * ```\n */\n function removeLastWhere(array, fn, start = -1, stop = 0) {\n let value;\n let index = findLastIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeLastWhere = removeLastWhere;\n /**\n * Remove all occurrences of values which match a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * function isNegative(value: number): boolean {\n * return value < 0;\n * }\n *\n * let data = [0, 12, -13, -9, 23, 39, 14, -15, 12, 75];\n * ArrayExt.removeAllWhere(data, isEven); // 4\n * ArrayExt.removeAllWhere(data, isNegative, 0, 3); // 2\n * ```\n */\n function removeAllWhere(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && fn(array[i], i)) {\n count++;\n }\n else if (stop < start && (i <= stop || i >= start) && fn(array[i], i)) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllWhere = removeAllWhere;\n})(ArrayExt || (ArrayExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Chain together several iterables.\n *\n * @deprecated\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields the values of the iterables\n * in the order in which they are supplied.\n *\n * #### Example\n * ```typescript\n * import { chain } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = chain(data1, data2);\n *\n * Array.from(stream); // [1, 2, 3, 4, 5, 6]\n * ```\n */\nfunction* chain(...objects) {\n for (const object of objects) {\n yield* object;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an empty iterator.\n *\n * @returns A new iterator which yields nothing.\n *\n * #### Example\n * ```typescript\n * import { empty } from '@lumino/algorithm';\n *\n * let stream = empty();\n *\n * Array.from(stream); // []\n * ```\n */\n// eslint-disable-next-line require-yield\nfunction* empty() {\n return;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Enumerate an iterable object.\n *\n * @param object - The iterable object of interest.\n *\n * @param start - The starting enum value. The default is `0`.\n *\n * @returns An iterator which yields the enumerated values.\n *\n * #### Example\n * ```typescript\n * import { enumerate } from '@lumino/algorithm';\n *\n * let data = ['foo', 'bar', 'baz'];\n *\n * let stream = enumerate(data, 1);\n *\n * Array.from(stream); // [[1, 'foo'], [2, 'bar'], [3, 'baz']]\n * ```\n */\nfunction* enumerate(object, start = 0) {\n for (const value of object) {\n yield [start++, value];\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Filter an iterable for values which pass a test.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns An iterator which yields the values which pass the test.\n *\n * #### Example\n * ```typescript\n * import { filter } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = filter(data, value => value % 2 === 0);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* filter(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Find the first value in an iterable which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { find } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * find(data, isCat).name; // 'fluffy'\n * ```\n */\nfunction find(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return value;\n }\n }\n return undefined;\n}\n/**\n * Find the index of the first value which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { findIndex } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * findIndex(data, isCat); // 1\n * ```\n */\nfunction findIndex(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return index - 1;\n }\n }\n return -1;\n}\n/**\n * Find the minimum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The minimum value in the iterable. If multiple values are\n * equivalent to the minimum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { min } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * min([7, 4, 0, 3, 9, 4], numberCmp); // 0\n * ```\n */\nfunction min(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) < 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the maximum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The maximum value in the iterable. If multiple values are\n * equivalent to the maximum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { max } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * max([7, 4, 0, 3, 9, 4], numberCmp); // 9\n * ```\n */\nfunction max(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) > 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the minimum and maximum values in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns A 2-tuple of the `[min, max]` values in the iterable. If\n * multiple values are equivalent, the left-most values are returned.\n * If the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { minmax } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * minmax([7, 4, 0, 3, 9, 4], numberCmp); // [0, 9]\n * ```\n */\nfunction minmax(object, fn) {\n let empty = true;\n let vmin;\n let vmax;\n for (const value of object) {\n if (empty) {\n vmin = value;\n vmax = value;\n empty = false;\n }\n else if (fn(value, vmin) < 0) {\n vmin = value;\n }\n else if (fn(value, vmax) > 0) {\n vmax = value;\n }\n }\n return empty ? undefined : [vmin, vmax];\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an array from an iterable of values.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new array of values from the given object.\n *\n * #### Example\n * ```typescript\n * import { toArray } from '@lumino/algorithm';\n *\n * let stream = [1, 2, 3, 4, 5, 6][Symbol.iterator]();\n *\n * toArray(stream); // [1, 2, 3, 4, 5, 6];\n * ```\n */\nfunction toArray(object) {\n return Array.from(object);\n}\n/**\n * Create an object from an iterable of key/value pairs.\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new object mapping keys to values.\n *\n * #### Example\n * ```typescript\n * import { toObject } from '@lumino/algorithm';\n *\n * let data: [string, number][] = [['one', 1], ['two', 2], ['three', 3]];\n *\n * toObject(data); // { one: 1, two: 2, three: 3 }\n * ```\n */\nfunction toObject(object) {\n const result = {};\n for (const [key, value] of object) {\n result[key] = value;\n }\n return result;\n}\n/**\n * Invoke a function for each value in an iterable.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The callback function to invoke for each value.\n *\n * #### Notes\n * Iteration can be terminated early by returning `false` from the\n * callback function.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each } from '@lumino/algorithm';\n *\n * let data = [5, 7, 0, -2, 9];\n *\n * each(data, value => { console.log(value); });\n * ```\n */\nfunction each(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return;\n }\n }\n}\n/**\n * Test whether all values in an iterable satisfy a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if all values pass the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `false` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { every } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * every(data, value => value % 2 === 0); // false\n * every(data, value => value % 2 === 1); // true\n * ```\n */\nfunction every(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Test whether any value in an iterable satisfies a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if any value passes the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `true` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { some } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * some(data, value => value === 7); // true\n * some(data, value => value === 3); // false\n * ```\n */\nfunction some(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return true;\n }\n }\n return false;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Transform the values of an iterable with a mapping function.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The mapping function to invoke for each value.\n *\n * @returns An iterator which yields the transformed values.\n *\n * #### Example\n * ```typescript\n * import { map } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3];\n *\n * let stream = map(data, value => value * 2);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* map(object, fn) {\n let index = 0;\n for (const value of object) {\n yield fn(value, index++);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator of evenly spaced values.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns An iterator which produces evenly spaced values.\n *\n * #### Notes\n * In the single argument form of `range(stop)`, `start` defaults to\n * `0` and `step` defaults to `1`.\n *\n * In the two argument form of `range(start, stop)`, `step` defaults\n * to `1`.\n *\n * #### Example\n * ```typescript\n * import { range } from '@lumino/algorithm';\n *\n * let stream = range(2, 4);\n *\n * Array.from(stream); // [2, 3]\n * ```\n */\nfunction* range(start, stop, step) {\n if (stop === undefined) {\n stop = start;\n start = 0;\n step = 1;\n }\n else if (step === undefined) {\n step = 1;\n }\n const length = Private.rangeLength(start, stop, step);\n for (let index = 0; index < length; index++) {\n yield start + step * index;\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Compute the effective length of a range.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns The number of steps need to traverse the range.\n */\n function rangeLength(start, stop, step) {\n if (step === 0) {\n return Infinity;\n }\n if (start > stop && step > 0) {\n return 0;\n }\n if (start < stop && step < 0) {\n return 0;\n }\n return Math.ceil((stop - start) / step);\n }\n Private.rangeLength = rangeLength;\n})(Private || (Private = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nfunction reduce(object, fn, initial) {\n // Setup the iterator and fetch the first value.\n const it = object[Symbol.iterator]();\n let index = 0;\n let first = it.next();\n // An empty iterator and no initial value is an error.\n if (first.done && initial === undefined) {\n throw new TypeError('Reduce of empty iterable with no initial value.');\n }\n // If the iterator is empty, return the initial value.\n if (first.done) {\n return initial;\n }\n // If the iterator has a single item and no initial value, the\n // reducer is not invoked and the first item is the return value.\n let second = it.next();\n if (second.done && initial === undefined) {\n return first.value;\n }\n // If iterator has a single item and an initial value is provided,\n // the reducer is invoked and that result is the return value.\n if (second.done) {\n return fn(initial, first.value, index++);\n }\n // Setup the initial accumlated value.\n let accumulator;\n if (initial === undefined) {\n accumulator = fn(first.value, second.value, index++);\n }\n else {\n accumulator = fn(fn(initial, first.value, index++), second.value, index++);\n }\n // Iterate the rest of the values, updating the accumulator.\n let next;\n while (!(next = it.next()).done) {\n accumulator = fn(accumulator, next.value, index++);\n }\n // Return the final accumulated value.\n return accumulator;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator which repeats a value a number of times.\n *\n * @deprecated\n *\n * @param value - The value to repeat.\n *\n * @param count - The number of times to repeat the value.\n *\n * @returns A new iterator which repeats the specified value.\n *\n * #### Example\n * ```typescript\n * import { repeat } from '@lumino/algorithm';\n *\n * let stream = repeat(7, 3);\n *\n * Array.from(stream); // [7, 7, 7]\n * ```\n */\nfunction* repeat(value, count) {\n while (0 < count--) {\n yield value;\n }\n}\n/**\n * Create an iterator which yields a value a single time.\n *\n * @deprecated\n *\n * @param value - The value to wrap in an iterator.\n *\n * @returns A new iterator which yields the value a single time.\n *\n * #### Example\n * ```typescript\n * import { once } from '@lumino/algorithm';\n *\n * let stream = once(7);\n *\n * Array.from(stream); // [7]\n * ```\n */\nfunction* once(value) {\n yield value;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator for a retroable object.\n *\n * @param object - The retroable or array-like object of interest.\n *\n * @returns An iterator which traverses the object's values in reverse.\n *\n * #### Example\n * ```typescript\n * import { retro } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = retro(data);\n *\n * Array.from(stream); // [6, 5, 4, 3, 2, 1]\n * ```\n */\nfunction* retro(object) {\n if (typeof object.retro === 'function') {\n yield* object.retro();\n }\n else {\n for (let index = object.length - 1; index > -1; index--) {\n yield object[index];\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Topologically sort an iterable of edges.\n *\n * @param edges - The iterable object of edges to sort.\n * An edge is represented as a 2-tuple of `[fromNode, toNode]`.\n *\n * @returns The topologically sorted array of nodes.\n *\n * #### Notes\n * If a cycle is present in the graph, the cycle will be ignored and\n * the return value will be only approximately sorted.\n *\n * #### Example\n * ```typescript\n * import { topologicSort } from '@lumino/algorithm';\n *\n * let data = [\n * ['d', 'e'],\n * ['c', 'd'],\n * ['a', 'b'],\n * ['b', 'c']\n * ];\n *\n * topologicSort(data); // ['a', 'b', 'c', 'd', 'e']\n * ```\n */\nfunction topologicSort(edges) {\n // Setup the shared sorting state.\n let sorted = [];\n let visited = new Set();\n let graph = new Map();\n // Add the edges to the graph.\n for (const edge of edges) {\n addEdge(edge);\n }\n // Visit each node in the graph.\n for (const [k] of graph) {\n visit(k);\n }\n // Return the sorted results.\n return sorted;\n // Add an edge to the graph.\n function addEdge(edge) {\n let [fromNode, toNode] = edge;\n let children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n }\n else {\n graph.set(toNode, [fromNode]);\n }\n }\n // Recursively visit the node.\n function visit(node) {\n if (visited.has(node)) {\n return;\n }\n visited.add(node);\n let children = graph.get(node);\n if (children) {\n for (const child of children) {\n visit(child);\n }\n }\n sorted.push(node);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate over an iterable using a stepped increment.\n *\n * @param object - The iterable object of interest.\n *\n * @param step - The distance to step on each iteration. A value\n * of less than `1` will behave the same as a value of `1`.\n *\n * @returns An iterator which traverses the iterable step-wise.\n *\n * #### Example\n * ```typescript\n * import { stride } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = stride(data, 2);\n *\n * Array.from(stream); // [1, 3, 5];\n * ```\n */\nfunction* stride(object, step) {\n let count = 0;\n for (const value of object) {\n if (0 === count++ % step) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for string-specific algorithms.\n */\nvar StringExt;\n(function (StringExt) {\n /**\n * Find the indices of characters in a source text.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The matched indices, or `null` if there is no match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * In order for there to be a match, all of the characters in `query`\n * **must** appear in `source` in the order given by `query`.\n *\n * Characters are matched using strict `===` equality.\n */\n function findIndices(source, query, start = 0) {\n let indices = new Array(query.length);\n for (let i = 0, j = start, n = query.length; i < n; ++i, ++j) {\n j = source.indexOf(query[i], j);\n if (j === -1) {\n return null;\n }\n indices[i] = j;\n }\n return indices;\n }\n StringExt.findIndices = findIndices;\n /**\n * A string matcher which uses a sum-of-squares algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-squares approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The index of each\n * matching character is squared and added to the score. This means\n * that early and consecutive character matches are preferred, while\n * late matches are heavily penalized.\n */\n function matchSumOfSquares(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i] - start;\n score += j * j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfSquares = matchSumOfSquares;\n /**\n * A string matcher which uses a sum-of-deltas algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-deltas approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The delta between\n * the indices are summed to create the score. This means that groups\n * of matched characters are preferred, while fragmented matches are\n * penalized.\n */\n function matchSumOfDeltas(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n let last = start - 1;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i];\n score += j - last - 1;\n last = j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfDeltas = matchSumOfDeltas;\n /**\n * Highlight the matched characters of a source text.\n *\n * @param source - The text which should be highlighted.\n *\n * @param indices - The indices of the matched characters. They must\n * appear in increasing order and must be in bounds of the source.\n *\n * @param fn - The function to apply to the matched chunks.\n *\n * @returns An array of unmatched and highlighted chunks.\n */\n function highlight(source, indices, fn) {\n // Set up the result array.\n let result = [];\n // Set up the counter variables.\n let k = 0;\n let last = 0;\n let n = indices.length;\n // Iterator over each index.\n while (k < n) {\n // Set up the chunk indices.\n let i = indices[k];\n let j = indices[k];\n // Advance the right chunk index until it's non-contiguous.\n while (++k < n && indices[k] === j + 1) {\n j++;\n }\n // Extract the unmatched text.\n if (last < i) {\n result.push(source.slice(last, i));\n }\n // Extract and highlight the matched text.\n if (i < j + 1) {\n result.push(fn(source.slice(i, j + 1)));\n }\n // Update the last visited index.\n last = j + 1;\n }\n // Extract any remaining unmatched text.\n if (last < source.length) {\n result.push(source.slice(last));\n }\n // Return the highlighted result.\n return result;\n }\n StringExt.highlight = highlight;\n /**\n * A 3-way string comparison function.\n *\n * @param a - The first string of interest.\n *\n * @param b - The second string of interest.\n *\n * @returns `-1` if `a < b`, else `1` if `a > b`, else `0`.\n */\n function cmp(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n }\n StringExt.cmp = cmp;\n})(StringExt || (StringExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Take a fixed number of items from an iterable.\n *\n * @param object - The iterable object of interest.\n *\n * @param count - The number of items to take from the iterable.\n *\n * @returns An iterator which yields the specified number of items\n * from the source iterable.\n *\n * #### Notes\n * The returned iterator will exhaust early if the source iterable\n * contains an insufficient number of items.\n *\n * #### Example\n * ```typescript\n * import { take } from '@lumino/algorithm';\n *\n * let stream = take([5, 4, 3, 2, 1, 0, -1], 3);\n *\n * Array.from(stream); // [5, 4, 3]\n * ```\n */\nfunction* take(object, count) {\n if (count < 1) {\n return;\n }\n const it = object[Symbol.iterator]();\n let item;\n while (0 < count-- && !(item = it.next()).done) {\n yield item.value;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate several iterables in lockstep.\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields successive tuples of values where\n * each value is taken in turn from the provided iterables. It will\n * be as long as the shortest provided iterable.\n *\n * #### Example\n * ```typescript\n * import { zip } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = zip(data1, data2);\n *\n * Array.from(stream); // [[1, 4], [2, 5], [3, 6]]\n * ```\n */\nfunction* zip(...objects) {\n const iters = objects.map(obj => obj[Symbol.iterator]());\n let tuple = iters.map(it => it.next());\n for (; every(tuple, item => !item.done); tuple = iters.map(it => it.next())) {\n yield tuple.map(item => item.value);\n }\n}\n\nexport { ArrayExt, StringExt, chain, each, empty, enumerate, every, filter, find, findIndex, map, max, min, minmax, once, range, reduce, repeat, retro, some, stride, take, toArray, toObject, topologicSort, zip };\n//# sourceMappingURL=index.es6.js.map\n","import { PathExt } from '@jupyterlab/coreutils';\nimport { ArrayExt } from '@lumino/algorithm';\nimport { UUID } from '@lumino/coreutils';\n/**\n * A class to handle requests to /api/sessions\n */\nexport class Sessions {\n /**\n * Construct a new Sessions.\n *\n * @param options The instantiation options for a Sessions.\n */\n constructor(options) {\n // TODO: offload to a database\n this._sessions = [];\n this._kernels = options.kernels;\n }\n /**\n * Get a session by id.\n *\n * @param id The id of the session.\n */\n async get(id) {\n const session = this._sessions.find((s) => s.id === id);\n if (!session) {\n throw Error(`Session ${id} not found`);\n }\n return session;\n }\n /**\n * List the running sessions\n */\n async list() {\n return this._sessions;\n }\n /**\n * Path an existing session.\n * This can be used to rename a session.\n *\n * - path updates session to track renamed paths\n * - kernel.name starts a new kernel with a given kernelspec\n *\n * @param options The options to patch the session.\n */\n async patch(options) {\n const { id, path, name, kernel } = options;\n const index = this._sessions.findIndex((s) => s.id === id);\n const session = this._sessions[index];\n if (!session) {\n throw Error(`Session ${id} not found`);\n }\n const patched = {\n ...session,\n path: path !== null && path !== void 0 ? path : session.path,\n name: name !== null && name !== void 0 ? name : session.name,\n };\n if (kernel) {\n // Kernel id takes precedence over name.\n if (kernel.id) {\n const session = this._sessions.find((session) => { var _a; return ((_a = session.kernel) === null || _a === void 0 ? void 0 : _a.id) === (kernel === null || kernel === void 0 ? void 0 : kernel.id); });\n if (session) {\n patched.kernel = session.kernel;\n }\n }\n else if (kernel.name) {\n const newKernel = await this._kernels.startNew({\n id: UUID.uuid4(),\n name: kernel.name,\n location: PathExt.dirname(patched.path),\n });\n if (newKernel) {\n patched.kernel = newKernel;\n }\n // clean up the session on kernel shutdown\n void this._handleKernelShutdown({\n kernelId: newKernel.id,\n sessionId: session.id,\n });\n }\n }\n this._sessions[index] = patched;\n return patched;\n }\n /**\n * Start a new session\n * TODO: read path and name\n *\n * @param options The options to start a new session.\n */\n async startNew(options) {\n var _a, _b, _c, _d;\n const { path, name } = options;\n const running = this._sessions.find((s) => s.name === name);\n if (running) {\n return running;\n }\n const kernelName = (_b = (_a = options.kernel) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : '';\n const id = (_c = options.id) !== null && _c !== void 0 ? _c : UUID.uuid4();\n const nameOrPath = (_d = options.name) !== null && _d !== void 0 ? _d : options.path;\n const dirname = PathExt.dirname(options.name) || PathExt.dirname(options.path);\n const hasDrive = nameOrPath.includes(':');\n const driveName = hasDrive ? nameOrPath.split(':')[0] : '';\n // add drive name if missing (top level directory)\n const location = dirname.includes(driveName) ? dirname : `${driveName}:${dirname}`;\n const kernel = await this._kernels.startNew({\n id,\n name: kernelName,\n location,\n });\n const session = {\n id,\n path,\n name: name !== null && name !== void 0 ? name : path,\n type: 'notebook',\n kernel: {\n id: kernel.id,\n name: kernel.name,\n },\n };\n this._sessions.push(session);\n // clean up the session on kernel shutdown\n void this._handleKernelShutdown({ kernelId: id, sessionId: session.id });\n return session;\n }\n /**\n * Shut down a session.\n *\n * @param id The id of the session to shut down.\n */\n async shutdown(id) {\n var _a;\n const session = this._sessions.find((s) => s.id === id);\n if (!session) {\n throw Error(`Session ${id} not found`);\n }\n const kernelId = (_a = session.kernel) === null || _a === void 0 ? void 0 : _a.id;\n if (kernelId) {\n await this._kernels.shutdown(kernelId);\n }\n ArrayExt.removeFirstOf(this._sessions, session);\n }\n /**\n * Handle kernel shutdown\n */\n async _handleKernelShutdown({ kernelId, sessionId, }) {\n const runningKernel = await this._kernels.get(kernelId);\n if (runningKernel) {\n runningKernel.disposed.connect(() => {\n this.shutdown(sessionId);\n });\n }\n }\n}\n//# sourceMappingURL=sessions.js.map","import { Token } from '@lumino/coreutils';\n/**\n * The token for the settings service.\n */\nexport const ISettings = new Token('@jupyterlite/settings:ISettings');\n//# sourceMappingURL=tokens.js.map","import { PageConfig, URLExt } from '@jupyterlab/coreutils';\nimport { PromiseDelegate } from '@lumino/coreutils';\nimport * as json5 from 'json5';\n/**\n * The name of the local storage.\n */\nconst DEFAULT_STORAGE_NAME = 'JupyterLite Storage';\n/**\n * A class to handle requests to /api/settings\n */\nexport class Settings {\n constructor(options) {\n this._storageName = DEFAULT_STORAGE_NAME;\n this._storageDrivers = null;\n this._localforage = options.localforage;\n this._storageName = options.storageName || DEFAULT_STORAGE_NAME;\n this._storageDrivers = options.storageDrivers || null;\n this._ready = new PromiseDelegate();\n }\n /**\n * A promise that resolves when the settings storage is fully initialized\n */\n get ready() {\n return this._ready.promise;\n }\n /**\n * A lazy reference to initialized storage\n */\n get storage() {\n return this.ready.then(() => this._storage);\n }\n /**\n * Finish any initialization after server has started and all extensions are applied.\n */\n async initialize() {\n await this.initStorage();\n this._ready.resolve(void 0);\n }\n /**\n * Prepare the storage\n */\n async initStorage() {\n this._storage = this.defaultSettingsStorage();\n }\n /**\n * Get default options for localForage instances\n */\n get defaultStorageOptions() {\n var _a;\n const driver = ((_a = this._storageDrivers) === null || _a === void 0 ? void 0 : _a.length) ? this._storageDrivers : null;\n return {\n version: 1,\n name: this._storageName,\n ...(driver ? { driver } : {}),\n };\n }\n /**\n * Create a settings store.\n */\n defaultSettingsStorage() {\n return this._localforage.createInstance({\n description: 'Offline Storage for Settings',\n storeName: 'settings',\n ...this.defaultStorageOptions,\n });\n }\n /**\n * Get settings by plugin id\n *\n * @param pluginId the id of the plugin\n *\n */\n async get(pluginId) {\n const all = await this.getAll();\n const settings = all.settings;\n const setting = settings.find((setting) => {\n return setting.id === pluginId;\n });\n return setting;\n }\n /**\n * Get all the settings\n */\n async getAll() {\n const allCore = await this._getAll('all.json');\n let allFederated = [];\n try {\n allFederated = await this._getAll('all_federated.json');\n }\n catch {\n // handle the case where there is no federated extension\n }\n // JupyterLab 4 expects all settings to be returned in one go\n // so append the settings from federated plugins to the core ones\n const all = allCore.concat(allFederated);\n // return existing user settings if they exist\n const storage = await this.storage;\n const settings = await Promise.all(all.map(async (plugin) => {\n var _a;\n const { id } = plugin;\n const raw = (_a = (await storage.getItem(id))) !== null && _a !== void 0 ? _a : plugin.raw;\n return {\n ...Private.override(plugin),\n raw,\n settings: json5.parse(raw),\n };\n }));\n return { settings };\n }\n /**\n * Save settings for a given plugin id\n *\n * @param pluginId The id of the plugin\n * @param raw The raw settings\n *\n */\n async save(pluginId, raw) {\n await (await this.storage).setItem(pluginId, raw);\n }\n /**\n * Get all the settings for core or federated plugins\n */\n async _getAll(file) {\n var _a;\n const settingsUrl = (_a = PageConfig.getOption('settingsUrl')) !== null && _a !== void 0 ? _a : '/';\n const all = (await (await fetch(URLExt.join(settingsUrl, file))).json());\n return all;\n }\n}\n/**\n * A namespace for private data\n */\nvar Private;\n(function (Private) {\n const _overrides = JSON.parse(PageConfig.getOption('settingsOverrides') || '{}');\n /**\n * Override the defaults of the schema with ones from PageConfig\n *\n * @see https://github.com/jupyterlab/jupyterlab_server/blob/v2.5.2/jupyterlab_server/settings_handler.py#L216-L227\n */\n function override(plugin) {\n if (_overrides[plugin.id]) {\n if (!plugin.schema.properties) {\n // probably malformed, or only provides keyboard shortcuts, etc.\n plugin.schema.properties = {};\n }\n for (const [prop, propDefault] of Object.entries(_overrides[plugin.id] || {})) {\n plugin.schema.properties[prop].default = propDefault;\n }\n }\n return plugin;\n }\n Private.override = override;\n})(Private || (Private = {}));\n//# sourceMappingURL=settings.js.map","import { Token } from '@lumino/coreutils';\n/**\n * The token for the settings service.\n */\nexport const ITranslation = new Token('@jupyterlite/translation:ITranslation');\n//# sourceMappingURL=tokens.js.map","import { PageConfig, URLExt } from '@jupyterlab/coreutils';\n/**\n * A fake locale to retrieve all the language packs.\n */\nconst ALL = 'all';\n/**\n * A class to handle requests to /api/translations\n */\nexport class Translation {\n constructor() {\n this._prevLocale = '';\n }\n /**\n * Get the translation data for the given locale\n * @param locale The locale\n * @returns\n */\n async get(locale) {\n const apiURL = URLExt.join(PageConfig.getBaseUrl(), `api/translations/${locale}.json`);\n try {\n const response = await fetch(apiURL);\n const json = JSON.parse(await response.text());\n if (this._prevLocale !== ALL && locale === ALL) {\n // TODO: fix this logic upstream?\n // the upstream translation plugin relies on the comparison between\n // the display name and the native name to enable or disable the commands:\n // https://github.com/jupyterlab/jupyterlab/blob/befa831ffef36321b87f352a48fbe2439df6c872/packages/translation-extension/src/index.ts#L117\n const prev = this._prevLocale;\n json.data[prev].displayName = json.data[prev].nativeName;\n if (prev !== 'en') {\n json.data['en'].displayName = `${json.data['en'].nativeName} (default)`;\n }\n }\n this._prevLocale = locale;\n return json;\n }\n catch (e) {\n if (locale) {\n return {\n data: {},\n message: `Language pack '${locale}' not installed!`,\n };\n }\n return {\n data: {\n en: { displayName: 'English', nativeName: 'English' },\n },\n message: '',\n };\n }\n }\n}\n//# sourceMappingURL=translation.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { Token } from '@lumino/coreutils';\n/**\n * The token for the localforage singleton.\n */\nexport const ILocalForage = new Token('@jupyterlite/localforge:ILocalForage');\n//# sourceMappingURL=tokens.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { PageConfig } from '@jupyterlab/coreutils';\nimport { BroadcastChannelWrapper, Contents, IContents, IBroadcastChannelWrapper, } from '@jupyterlite/contents';\nimport { IKernels, Kernels, IKernelSpecs, KernelSpecs } from '@jupyterlite/kernel';\nimport { ILicenses, Licenses } from '@jupyterlite/licenses';\nimport { IServiceWorkerManager, ServiceWorkerManager, } from '@jupyterlite/server';\nimport { ISessions, Sessions } from '@jupyterlite/session';\nimport { ISettings, Settings } from '@jupyterlite/settings';\nimport { ITranslation, Translation } from '@jupyterlite/translation';\nimport { ILocalForage, ensureMemoryStorage } from '@jupyterlite/localforage';\nimport localforage from 'localforage';\n/**\n * The localforage plugin\n */\nconst localforagePlugin = {\n id: '@jupyterlite/server-extension:localforage',\n autoStart: true,\n provides: ILocalForage,\n activate: (app) => {\n return { localforage };\n },\n};\n/**\n * The volatile localforage memory plugin\n */\nconst localforageMemoryPlugin = {\n id: '@jupyterlite/server-extension:localforage-memory-storage',\n autoStart: true,\n requires: [ILocalForage],\n activate: async (app, forage) => {\n if (JSON.parse(PageConfig.getOption('enableMemoryStorage') || 'false')) {\n console.warn('Memory storage fallback enabled: contents and settings may not be saved');\n await ensureMemoryStorage(forage.localforage);\n }\n },\n};\n/**\n * A plugin providing the routes for the config section.\n * TODO: implement logic to persist the config sections?\n */\nconst configSectionRoutesPlugin = {\n id: '@jupyterlite/server-extension:config-section-routes',\n autoStart: true,\n activate: (app) => {\n const sections = {};\n app.router.get('/api/config/(.*)', async (req, id) => {\n var _a;\n const section = (_a = sections[id]) !== null && _a !== void 0 ? _a : JSON.stringify({});\n return new Response(section);\n });\n app.router.patch('/api/config/(.*)', async (req, id) => {\n const payload = req.body;\n sections[id] = payload;\n return new Response(payload);\n });\n },\n};\n/**\n * The contents service plugin.\n */\nconst contentsPlugin = {\n id: '@jupyterlite/server-extension:contents',\n requires: [ILocalForage],\n autoStart: true,\n provides: IContents,\n activate: (app, forage) => {\n const storageName = PageConfig.getOption('contentsStorageName');\n const storageDrivers = JSON.parse(PageConfig.getOption('contentsStorageDrivers') || 'null');\n const { localforage } = forage;\n const contents = new Contents({\n storageName,\n storageDrivers,\n localforage,\n });\n app.started.then(() => contents.initialize().catch(console.warn));\n return contents;\n },\n};\n/**\n * A plugin providing the routes for the contents service.\n */\nconst contentsRoutesPlugin = {\n id: '@jupyterlite/server-extension:contents-routes',\n autoStart: true,\n requires: [IContents],\n activate: (app, contents) => {\n // GET /api/contents/{path}/checkpoints - Get a list of checkpoints for a file\n app.router.get('/api/contents/(.+)/checkpoints', async (req, filename) => {\n const res = await contents.listCheckpoints(filename);\n return new Response(JSON.stringify(res));\n });\n // POST /api/contents/{path}/checkpoints/{checkpoint_id} - Restore a file to a particular checkpointed state\n app.router.post('/api/contents/(.+)/checkpoints/(.*)', async (req, filename, checkpoint) => {\n const res = await contents.restoreCheckpoint(filename, checkpoint);\n return new Response(JSON.stringify(res), { status: 204 });\n });\n // POST /api/contents/{path}/checkpoints - Create a new checkpoint for a file\n app.router.post('/api/contents/(.+)/checkpoints', async (req, filename) => {\n const res = await contents.createCheckpoint(filename);\n return new Response(JSON.stringify(res), { status: 201 });\n });\n // DELETE /api/contents/{path}/checkpoints/{checkpoint_id} - Delete a checkpoint\n app.router.delete('/api/contents/(.+)/checkpoints/(.*)', async (req, filename, checkpoint) => {\n const res = await contents.deleteCheckpoint(filename, checkpoint);\n return new Response(JSON.stringify(res), { status: 204 });\n });\n // GET /api/contents/{path} - Get contents of file or directory\n app.router.get('/api/contents(.*)', async (req, filename) => {\n var _a;\n const options = {\n content: ((_a = req.query) === null || _a === void 0 ? void 0 : _a.content) === '1',\n };\n const nb = await contents.get(filename, options);\n if (!nb) {\n return new Response(null, { status: 404 });\n }\n return new Response(JSON.stringify(nb));\n });\n // POST /api/contents/{path} - Create a new file in the specified path\n app.router.post('/api/contents(.*)', async (req, path) => {\n const options = req.body;\n const copyFrom = options === null || options === void 0 ? void 0 : options.copy_from;\n let file;\n if (copyFrom) {\n file = await contents.copy(copyFrom, path);\n }\n else {\n file = await contents.newUntitled(options);\n }\n if (!file) {\n return new Response(null, { status: 400 });\n }\n return new Response(JSON.stringify(file), { status: 201 });\n });\n // PATCH /api/contents/{path} - Rename a file or directory without re-uploading content\n app.router.patch('/api/contents(.*)', async (req, filename) => {\n var _a, _b;\n const newPath = (_b = (_a = req.body) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : '';\n filename = filename[0] === '/' ? filename.slice(1) : filename;\n const nb = await contents.rename(filename, newPath);\n return new Response(JSON.stringify(nb));\n });\n // PUT /api/contents/{path} - Save or upload a file\n app.router.put('/api/contents/(.+)', async (req, filename) => {\n const body = req.body;\n const nb = await contents.save(filename, body);\n return new Response(JSON.stringify(nb));\n });\n // DELETE /api/contents/{path} - Delete a file in the given path\n app.router.delete('/api/contents/(.+)', async (req, filename) => {\n await contents.delete(filename);\n return new Response(null, { status: 204 });\n });\n },\n};\n/**\n * A plugin installing the service worker.\n */\nconst serviceWorkerPlugin = {\n id: '@jupyterlite/server-extension:service-worker',\n autoStart: true,\n provides: IServiceWorkerManager,\n activate: (app) => {\n return new ServiceWorkerManager();\n },\n};\n/**\n * A plugin for handling communication with the Emscpriten file system.\n */\nconst emscriptenFileSystemPlugin = {\n id: '@jupyterlite/server-extension:emscripten-filesystem',\n autoStart: true,\n optional: [IServiceWorkerManager],\n provides: IBroadcastChannelWrapper,\n activate: (app, serviceWorkerRegistrationWrapper) => {\n const { contents } = app.serviceManager;\n const broadcaster = new BroadcastChannelWrapper({ contents });\n const what = 'Kernel filesystem and JupyterLite contents';\n function logStatus(msg, err) {\n if (err) {\n console.warn(err);\n }\n if (msg) {\n console.warn(msg);\n }\n if (err || msg) {\n console.warn(`${what} will NOT be synced`);\n }\n else {\n // eslint-disable-next-line no-console\n console.info(`${what} will be synced`);\n }\n }\n if (!serviceWorkerRegistrationWrapper) {\n logStatus('JupyterLite ServiceWorker not available');\n }\n else {\n serviceWorkerRegistrationWrapper.ready\n .then(() => {\n broadcaster.enable();\n logStatus();\n })\n .catch((err) => {\n logStatus('JupyterLite ServiceWorker failed to become available', err);\n });\n }\n return broadcaster;\n },\n};\n/**\n * The kernels service plugin.\n */\nconst kernelsPlugin = {\n id: '@jupyterlite/server-extension:kernels',\n autoStart: true,\n provides: IKernels,\n requires: [IKernelSpecs],\n activate: (app, kernelspecs) => {\n return new Kernels({ kernelspecs });\n },\n};\n/**\n * A plugin providing the routes for the kernels service\n */\nconst kernelsRoutesPlugin = {\n id: '@jupyterlite/server-extension:kernels-routes',\n autoStart: true,\n requires: [IKernels],\n activate: (app, kernels) => {\n // GET /api/kernels - List the running kernels\n app.router.get('/api/kernels', async (req) => {\n const res = await kernels.list();\n return new Response(JSON.stringify(res));\n });\n // POST /api/kernels/{kernel_id} - Restart a kernel\n app.router.post('/api/kernels/(.*)/restart', async (req, kernelId) => {\n const res = await kernels.restart(kernelId);\n return new Response(JSON.stringify(res));\n });\n // DELETE /api/kernels/{kernel_id} - Kill a kernel and delete the kernel id\n app.router.delete('/api/kernels/(.*)', async (req, kernelId) => {\n const res = await kernels.shutdown(kernelId);\n return new Response(JSON.stringify(res), { status: 204 });\n });\n },\n};\n/**\n * The kernel spec service plugin.\n */\nconst kernelSpecPlugin = {\n id: '@jupyterlite/server-extension:kernelspec',\n autoStart: true,\n provides: IKernelSpecs,\n activate: (app) => {\n return new KernelSpecs();\n },\n};\n/**\n * A plugin providing the routes for the kernelspec service.\n */\nconst kernelSpecRoutesPlugin = {\n id: '@jupyterlite/server-extension:kernelspec-routes',\n autoStart: true,\n requires: [IKernelSpecs],\n activate: (app, kernelspecs) => {\n app.router.get('/api/kernelspecs', async (req) => {\n const { specs } = kernelspecs;\n if (!specs) {\n return new Response(null);\n }\n // follow the same format as in Jupyter Server\n const allKernelSpecs = {};\n const allSpecs = specs.kernelspecs;\n Object.keys(allSpecs).forEach((name) => {\n const spec = allSpecs[name];\n const { resources } = spec !== null && spec !== void 0 ? spec : {};\n allKernelSpecs[name] = {\n name,\n spec,\n resources,\n };\n });\n const res = {\n default: specs.default,\n kernelspecs: allKernelSpecs,\n };\n return new Response(JSON.stringify(res));\n });\n },\n};\n/**\n * The licenses service plugin\n */\nconst licensesPlugin = {\n id: '@jupyterlite/server-extension:licenses',\n autoStart: true,\n provides: ILicenses,\n activate: (app) => {\n return new Licenses();\n },\n};\n/**\n * A plugin providing the routes for the licenses service.\n */\nconst licensesRoutesPlugin = {\n id: '@jupyterlite/server-extension:licenses-routes',\n autoStart: true,\n requires: [ILicenses],\n activate(app, licenses) {\n app.router.get('/api/licenses', async (req) => {\n const res = await licenses.get();\n return new Response(JSON.stringify(res));\n });\n },\n};\n/**\n * A plugin providing the routes for the lsp service.\n * TODO: provide the service in a separate plugin?\n */\nconst lspRoutesPlugin = {\n id: '@jupyterlite/server-extension:lsp-routes',\n autoStart: true,\n activate: (app) => {\n app.router.get('/lsp/status', async (req) => {\n return new Response(JSON.stringify({ version: 2, sessions: {}, specs: {} }));\n });\n },\n};\n/**\n * A plugin providing the routes for the nbconvert service.\n * TODO: provide the service in a separate plugin?\n */\nconst nbconvertRoutesPlugin = {\n id: '@jupyterlite/server-extension:nbconvert-routes',\n autoStart: true,\n activate: (app) => {\n app.router.get('/api/nbconvert', async (req) => {\n return new Response(JSON.stringify({}));\n });\n },\n};\n/**\n * The sessions service plugin.\n */\nconst sessionsPlugin = {\n id: '@jupyterlite/server-extension:sessions',\n autoStart: true,\n provides: ISessions,\n requires: [IKernels],\n activate: (app, kernels) => {\n return new Sessions({ kernels });\n },\n};\n/**\n * A plugin providing the routes for the session service.\n */\nconst sessionsRoutesPlugin = {\n id: '@jupyterlite/server-extension:sessions-routes',\n autoStart: true,\n requires: [ISessions],\n activate: (app, sessions) => {\n // GET /api/sessions/{session} - Get session\n app.router.get('/api/sessions/(.+)', async (req, id) => {\n const session = await sessions.get(id);\n return new Response(JSON.stringify(session), { status: 200 });\n });\n // GET /api/sessions - List available sessions\n app.router.get('/api/sessions', async (req) => {\n const list = await sessions.list();\n return new Response(JSON.stringify(list), { status: 200 });\n });\n // PATCH /api/sessions/{session} - This can be used to rename a session\n app.router.patch('/api/sessions(.*)', async (req, id) => {\n const options = req.body;\n const session = await sessions.patch(options);\n return new Response(JSON.stringify(session), { status: 200 });\n });\n // DELETE /api/sessions/{session} - Delete a session\n app.router.delete('/api/sessions/(.+)', async (req, id) => {\n await sessions.shutdown(id);\n return new Response(null, { status: 204 });\n });\n // POST /api/sessions - Create a new session or return an existing session if a session of the same name already exists\n app.router.post('/api/sessions', async (req) => {\n const options = req.body;\n const session = await sessions.startNew(options);\n return new Response(JSON.stringify(session), { status: 201 });\n });\n },\n};\n/**\n * The settings service plugin.\n */\nconst settingsPlugin = {\n id: '@jupyterlite/server-extension:settings',\n autoStart: true,\n requires: [ILocalForage],\n provides: ISettings,\n activate: (app, forage) => {\n const storageName = PageConfig.getOption('settingsStorageName');\n const storageDrivers = JSON.parse(PageConfig.getOption('settingsStorageDrivers') || 'null');\n const { localforage } = forage;\n const settings = new Settings({ storageName, storageDrivers, localforage });\n app.started.then(() => settings.initialize().catch(console.warn));\n return settings;\n },\n};\n/**\n * A plugin providing the routes for the settings service.\n */\nconst settingsRoutesPlugin = {\n id: '@jupyterlite/server-extension:settings-routes',\n autoStart: true,\n requires: [ISettings],\n activate: (app, settings) => {\n // TODO: improve the regex\n // const pluginPattern = new RegExp(/(?:@([^/]+?)[/])?([^/]+?):(\\w+)/);\n const pluginPattern = '/api/settings/((?:@([^/]+?)[/])?([^/]+?):([^:]+))$';\n app.router.get(pluginPattern, async (req, pluginId) => {\n const setting = await settings.get(pluginId);\n return new Response(JSON.stringify(setting));\n });\n app.router.put(pluginPattern, async (req, pluginId) => {\n const body = req.body;\n const { raw } = body;\n await settings.save(pluginId, raw);\n return new Response(null, { status: 204 });\n });\n app.router.get('/api/settings', async (req) => {\n const plugins = await settings.getAll();\n return new Response(JSON.stringify(plugins));\n });\n },\n};\n/**\n * The translation service plugin.\n */\nconst translationPlugin = {\n id: '@jupyterlite/server-extension:translation',\n autoStart: true,\n provides: ITranslation,\n activate: (app) => {\n const translation = new Translation();\n app.router.get('/api/translations/?(.*)', async (req, locale) => {\n if (locale === 'default') {\n locale = 'en';\n }\n const data = await translation.get(locale || 'all');\n return new Response(JSON.stringify(data));\n });\n return translation;\n },\n};\n/**\n * A plugin providing the routes for the translation service.\n */\nconst translationRoutesPlugin = {\n id: '@jupyterlite/server-extension:translation-routes',\n autoStart: true,\n requires: [ITranslation],\n activate: (app, translation) => {\n app.router.get('/api/translations/?(.*)', async (req, locale) => {\n const data = await translation.get(locale || 'all');\n return new Response(JSON.stringify(data));\n });\n },\n};\nconst plugins = [\n configSectionRoutesPlugin,\n contentsPlugin,\n contentsRoutesPlugin,\n emscriptenFileSystemPlugin,\n kernelsPlugin,\n kernelsRoutesPlugin,\n kernelSpecPlugin,\n kernelSpecRoutesPlugin,\n licensesPlugin,\n licensesRoutesPlugin,\n localforageMemoryPlugin,\n localforagePlugin,\n lspRoutesPlugin,\n nbconvertRoutesPlugin,\n serviceWorkerPlugin,\n sessionsPlugin,\n sessionsRoutesPlugin,\n settingsPlugin,\n settingsRoutesPlugin,\n translationPlugin,\n translationRoutesPlugin,\n];\nexport default plugins;\n//# sourceMappingURL=index.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport memoryStorageDriver from 'localforage-memoryStorageDriver';\n/**\n * Ensure a localforage singleton has had the memory storage driver installed\n */\nexport async function ensureMemoryStorage(theLocalforage) {\n return await theLocalforage.defineDriver(memoryStorageDriver);\n}\n//# sourceMappingURL=memory.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for array-specific algorithms.\n */\nvar ArrayExt;\n(function (ArrayExt) {\n /**\n * Find the index of the first occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.firstIndexOf(data, 'red'); // -1\n * ArrayExt.firstIndexOf(data, 'one'); // 0\n * ArrayExt.firstIndexOf(data, 'one', 1); // 4\n * ArrayExt.firstIndexOf(data, 'two', 2); // -1\n * ArrayExt.firstIndexOf(data, 'two', 2, 1); // 1\n * ```\n */\n function firstIndexOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.firstIndexOf = firstIndexOf;\n /**\n * Find the index of the last occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.lastIndexOf(data, 'red'); // -1\n * ArrayExt.lastIndexOf(data, 'one'); // 4\n * ArrayExt.lastIndexOf(data, 'one', 1); // 0\n * ArrayExt.lastIndexOf(data, 'two', 0); // -1\n * ArrayExt.lastIndexOf(data, 'two', 0, 1); // 1\n * ```\n */\n function lastIndexOf(array, value, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (start < stop) {\n span = start + 1 + (n - stop);\n }\n else {\n span = start - stop + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start - i + n) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.lastIndexOf = lastIndexOf;\n /**\n * Find the index of the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstIndex(data, isEven); // 1\n * ArrayExt.findFirstIndex(data, isEven, 4); // 5\n * ArrayExt.findFirstIndex(data, isEven, 6); // -1\n * ArrayExt.findFirstIndex(data, isEven, 6, 5); // 1\n * ```\n */\n function findFirstIndex(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findFirstIndex = findFirstIndex;\n /**\n * Find the index of the last value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastIndex(data, isEven); // 5\n * ArrayExt.findLastIndex(data, isEven, 4); // 3\n * ArrayExt.findLastIndex(data, isEven, 0); // -1\n * ArrayExt.findLastIndex(data, isEven, 0, 1); // 5\n * ```\n */\n function findLastIndex(array, fn, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let d;\n if (start < stop) {\n d = start + 1 + (n - stop);\n }\n else {\n d = start - stop + 1;\n }\n for (let i = 0; i < d; ++i) {\n let j = (start - i + n) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findLastIndex = findLastIndex;\n /**\n * Find the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstValue(data, isEven); // 2\n * ArrayExt.findFirstValue(data, isEven, 2); // 4\n * ArrayExt.findFirstValue(data, isEven, 6); // undefined\n * ArrayExt.findFirstValue(data, isEven, 6, 5); // 2\n * ```\n */\n function findFirstValue(array, fn, start = 0, stop = -1) {\n let index = findFirstIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findFirstValue = findFirstValue;\n /**\n * Find the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The last matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastValue(data, isEven); // 2\n * ArrayExt.findLastValue(data, isEven, 4); // 4\n * ArrayExt.findLastValue(data, isEven, 0); // undefined\n * ArrayExt.findLastValue(data, isEven, 0, 1); // 2\n * ```\n */\n function findLastValue(array, fn, start = -1, stop = 0) {\n let index = findLastIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findLastValue = findLastValue;\n /**\n * Find the index of the first element which compares `>=` to a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>=` to the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.lowerBound(data, 0, numberCmp); // 0\n * ArrayExt.lowerBound(data, 6, numberCmp); // 3\n * ArrayExt.lowerBound(data, 7, numberCmp); // 3\n * ArrayExt.lowerBound(data, -1, numberCmp); // 0\n * ArrayExt.lowerBound(data, 10, numberCmp); // 6\n * ```\n */\n function lowerBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) < 0) {\n begin = middle + 1;\n span -= half + 1;\n }\n else {\n span = half;\n }\n }\n return begin;\n }\n ArrayExt.lowerBound = lowerBound;\n /**\n * Find the index of the first element which compares `>` than a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>` than the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.upperBound(data, 0, numberCmp); // 1\n * ArrayExt.upperBound(data, 6, numberCmp); // 3\n * ArrayExt.upperBound(data, 7, numberCmp); // 5\n * ArrayExt.upperBound(data, -1, numberCmp); // 0\n * ArrayExt.upperBound(data, 10, numberCmp); // 6\n * ```\n */\n function upperBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) > 0) {\n span = half;\n }\n else {\n begin = middle + 1;\n span -= half + 1;\n }\n }\n return begin;\n }\n ArrayExt.upperBound = upperBound;\n /**\n * Test whether two arrays are shallowly equal.\n *\n * @param a - The first array-like object to compare.\n *\n * @param b - The second array-like object to compare.\n *\n * @param fn - The comparison function to apply to the elements. It\n * should return `true` if the elements are \"equal\". The default\n * compares elements using strict `===` equality.\n *\n * @returns Whether the two arrays are shallowly equal.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * Modifying the length of the arrays while comparing.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let d1 = [0, 3, 4, 7, 7, 9];\n * let d2 = [0, 3, 4, 7, 7, 9];\n * let d3 = [42];\n * ArrayExt.shallowEqual(d1, d2); // true\n * ArrayExt.shallowEqual(d2, d3); // false\n * ```\n */\n function shallowEqual(a, b, fn) {\n // Check for object identity first.\n if (a === b) {\n return true;\n }\n // Bail early if the lengths are different.\n if (a.length !== b.length) {\n return false;\n }\n // Compare each element for equality.\n for (let i = 0, n = a.length; i < n; ++i) {\n if (fn ? !fn(a[i], b[i]) : a[i] !== b[i]) {\n return false;\n }\n }\n // The array are shallowly equal.\n return true;\n }\n ArrayExt.shallowEqual = shallowEqual;\n /**\n * Create a slice of an array subject to an optional step.\n *\n * @param array - The array-like object of interest.\n *\n * @param options - The options for configuring the slice.\n *\n * @returns A new array with the specified values.\n *\n * @throws An exception if the slice `step` is `0`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start`, `stop`, or `step` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.slice(data); // [0, 3, 4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 2 }); // [4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 0, stop: 4 }); // [0, 3, 4, 7]\n * ArrayExt.slice(data, { step: 2 }); // [0, 4, 7]\n * ArrayExt.slice(data, { step: -1 }); // [9, 7, 7, 4, 3, 0]\n * ```\n */\n function slice(array, options = {}) {\n // Extract the options.\n let { start, stop, step } = options;\n // Set up the `step` value.\n if (step === undefined) {\n step = 1;\n }\n // Validate the step size.\n if (step === 0) {\n throw new Error('Slice `step` cannot be zero.');\n }\n // Look up the length of the array.\n let n = array.length;\n // Set up the `start` value.\n if (start === undefined) {\n start = step < 0 ? n - 1 : 0;\n }\n else if (start < 0) {\n start = Math.max(start + n, step < 0 ? -1 : 0);\n }\n else if (start >= n) {\n start = step < 0 ? n - 1 : n;\n }\n // Set up the `stop` value.\n if (stop === undefined) {\n stop = step < 0 ? -1 : n;\n }\n else if (stop < 0) {\n stop = Math.max(stop + n, step < 0 ? -1 : 0);\n }\n else if (stop >= n) {\n stop = step < 0 ? n - 1 : n;\n }\n // Compute the slice length.\n let length;\n if ((step < 0 && stop >= start) || (step > 0 && start >= stop)) {\n length = 0;\n }\n else if (step < 0) {\n length = Math.floor((stop - start + 1) / step + 1);\n }\n else {\n length = Math.floor((stop - start - 1) / step + 1);\n }\n // Compute the sliced result.\n let result = [];\n for (let i = 0; i < length; ++i) {\n result[i] = array[start + i * step];\n }\n // Return the result.\n return result;\n }\n ArrayExt.slice = slice;\n /**\n * Move an element in an array from one index to another.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param fromIndex - The index of the element to move. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param toIndex - The target index of the element. Negative\n * values are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `fromIndex` or `toIndex` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.move(data, 1, 2); // [0, 2, 1, 3, 4]\n * ArrayExt.move(data, 4, 2); // [0, 2, 4, 1, 3]\n * ```\n */\n function move(array, fromIndex, toIndex) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (fromIndex < 0) {\n fromIndex = Math.max(0, fromIndex + n);\n }\n else {\n fromIndex = Math.min(fromIndex, n - 1);\n }\n if (toIndex < 0) {\n toIndex = Math.max(0, toIndex + n);\n }\n else {\n toIndex = Math.min(toIndex, n - 1);\n }\n if (fromIndex === toIndex) {\n return;\n }\n let value = array[fromIndex];\n let d = fromIndex < toIndex ? 1 : -1;\n for (let i = fromIndex; i !== toIndex; i += d) {\n array[i] = array[i + d];\n }\n array[toIndex] = value;\n }\n ArrayExt.move = move;\n /**\n * Reverse an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param start - The index of the first element in the range to be\n * reversed, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * reversed, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` index which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.reverse(data, 1, 3); // [0, 3, 2, 1, 4]\n * ArrayExt.reverse(data, 3); // [0, 3, 2, 4, 1]\n * ArrayExt.reverse(data); // [1, 4, 2, 3, 0]\n * ```\n */\n function reverse(array, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n while (start < stop) {\n let a = array[start];\n let b = array[stop];\n array[start++] = b;\n array[stop--] = a;\n }\n }\n ArrayExt.reverse = reverse;\n /**\n * Rotate the elements of an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param delta - The amount of rotation to apply to the elements. A\n * positive value will rotate the elements to the left. A negative\n * value will rotate the elements to the right.\n *\n * @param start - The index of the first element in the range to be\n * rotated, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * rotated, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `delta`, `start`, or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.rotate(data, 2); // [2, 3, 4, 0, 1]\n * ArrayExt.rotate(data, -2); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 10); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 9); // [4, 0, 1, 2, 3]\n * ArrayExt.rotate(data, 2, 1, 3); // [4, 2, 0, 1, 3]\n * ```\n */\n function rotate(array, delta, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n if (start >= stop) {\n return;\n }\n let length = stop - start + 1;\n if (delta > 0) {\n delta = delta % length;\n }\n else if (delta < 0) {\n delta = ((delta % length) + length) % length;\n }\n if (delta === 0) {\n return;\n }\n let pivot = start + delta;\n reverse(array, start, pivot - 1);\n reverse(array, pivot, stop);\n reverse(array, start, stop);\n }\n ArrayExt.rotate = rotate;\n /**\n * Fill an array with a static value.\n *\n * @param array - The mutable array-like object to fill.\n *\n * @param value - The static value to use to fill the array.\n *\n * @param start - The index of the first element in the range to be\n * filled, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * filled, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Notes\n * If `stop < start` the fill will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four'];\n * ArrayExt.fill(data, 'r'); // ['r', 'r', 'r', 'r']\n * ArrayExt.fill(data, 'g', 1); // ['r', 'g', 'g', 'g']\n * ArrayExt.fill(data, 'b', 2, 3); // ['r', 'g', 'b', 'b']\n * ArrayExt.fill(data, 'z', 3, 1); // ['z', 'z', 'b', 'z']\n * ```\n */\n function fill(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n array[(start + i) % n] = value;\n }\n }\n ArrayExt.fill = fill;\n /**\n * Insert a value into an array at a specific index.\n *\n * @param array - The array of interest.\n *\n * @param index - The index at which to insert the value. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param value - The value to set at the specified index.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2];\n * ArrayExt.insert(data, 0, -1); // [-1, 0, 1, 2]\n * ArrayExt.insert(data, 2, 12); // [-1, 0, 12, 1, 2]\n * ArrayExt.insert(data, -1, 7); // [-1, 0, 12, 1, 7, 2]\n * ArrayExt.insert(data, 6, 19); // [-1, 0, 12, 1, 7, 2, 19]\n * ```\n */\n function insert(array, index, value) {\n let n = array.length;\n if (index < 0) {\n index = Math.max(0, index + n);\n }\n else {\n index = Math.min(index, n);\n }\n for (let i = n; i > index; --i) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n }\n ArrayExt.insert = insert;\n /**\n * Remove and return a value at a specific index in an array.\n *\n * @param array - The array of interest.\n *\n * @param index - The index of the value to remove. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The value at the specified index, or `undefined` if the\n * index is out of range.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeAt(data, 2); // 23\n * ArrayExt.removeAt(data, -2); // 12\n * ArrayExt.removeAt(data, 10); // undefined;\n * ```\n */\n function removeAt(array, index) {\n let n = array.length;\n if (index < 0) {\n index += n;\n }\n if (index < 0 || index >= n) {\n return undefined;\n }\n let value = array[index];\n for (let i = index + 1; i < n; ++i) {\n array[i - 1] = array[i];\n }\n array.length = n - 1;\n return value;\n }\n ArrayExt.removeAt = removeAt;\n /**\n * Remove the first occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstOf(data, 12); // 1\n * ArrayExt.removeFirstOf(data, 17); // -1\n * ArrayExt.removeFirstOf(data, 39, 3); // -1\n * ArrayExt.removeFirstOf(data, 39, 3, 2); // 2\n * ```\n */\n function removeFirstOf(array, value, start = 0, stop = -1) {\n let index = firstIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeFirstOf = removeFirstOf;\n /**\n * Remove the last occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastOf(data, 12); // 5\n * ArrayExt.removeLastOf(data, 17); // -1\n * ArrayExt.removeLastOf(data, 39, 2); // -1\n * ArrayExt.removeLastOf(data, 39, 2, 3); // 3\n * ```\n */\n function removeLastOf(array, value, start = -1, stop = 0) {\n let index = lastIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeLastOf = removeLastOf;\n /**\n * Remove all occurrences of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [14, 12, 23, 39, 14, 12, 19, 14];\n * ArrayExt.removeAllOf(data, 12); // 2\n * ArrayExt.removeAllOf(data, 17); // 0\n * ArrayExt.removeAllOf(data, 14, 1, 4); // 1\n * ```\n */\n function removeAllOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && array[i] === value) {\n count++;\n }\n else if (stop < start &&\n (i <= stop || i >= start) &&\n array[i] === value) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllOf = removeAllOf;\n /**\n * Remove the first occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstWhere(data, isEven); // { index: 0, value: 0 }\n * ArrayExt.removeFirstWhere(data, isEven, 2); // { index: 3, value: 14 }\n * ArrayExt.removeFirstWhere(data, isEven, 4); // { index: -1, value: undefined }\n * ```\n */\n function removeFirstWhere(array, fn, start = 0, stop = -1) {\n let value;\n let index = findFirstIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeFirstWhere = removeFirstWhere;\n /**\n * Remove the last occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastWhere(data, isEven); // { index: 5, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2); // { index: 1, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2, 1); // { index: -1, value: undefined }\n * ```\n */\n function removeLastWhere(array, fn, start = -1, stop = 0) {\n let value;\n let index = findLastIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeLastWhere = removeLastWhere;\n /**\n * Remove all occurrences of values which match a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * function isNegative(value: number): boolean {\n * return value < 0;\n * }\n *\n * let data = [0, 12, -13, -9, 23, 39, 14, -15, 12, 75];\n * ArrayExt.removeAllWhere(data, isEven); // 4\n * ArrayExt.removeAllWhere(data, isNegative, 0, 3); // 2\n * ```\n */\n function removeAllWhere(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && fn(array[i], i)) {\n count++;\n }\n else if (stop < start && (i <= stop || i >= start) && fn(array[i], i)) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllWhere = removeAllWhere;\n})(ArrayExt || (ArrayExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Chain together several iterables.\n *\n * @deprecated\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields the values of the iterables\n * in the order in which they are supplied.\n *\n * #### Example\n * ```typescript\n * import { chain } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = chain(data1, data2);\n *\n * Array.from(stream); // [1, 2, 3, 4, 5, 6]\n * ```\n */\nfunction* chain(...objects) {\n for (const object of objects) {\n yield* object;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an empty iterator.\n *\n * @returns A new iterator which yields nothing.\n *\n * #### Example\n * ```typescript\n * import { empty } from '@lumino/algorithm';\n *\n * let stream = empty();\n *\n * Array.from(stream); // []\n * ```\n */\n// eslint-disable-next-line require-yield\nfunction* empty() {\n return;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Enumerate an iterable object.\n *\n * @param object - The iterable object of interest.\n *\n * @param start - The starting enum value. The default is `0`.\n *\n * @returns An iterator which yields the enumerated values.\n *\n * #### Example\n * ```typescript\n * import { enumerate } from '@lumino/algorithm';\n *\n * let data = ['foo', 'bar', 'baz'];\n *\n * let stream = enumerate(data, 1);\n *\n * Array.from(stream); // [[1, 'foo'], [2, 'bar'], [3, 'baz']]\n * ```\n */\nfunction* enumerate(object, start = 0) {\n for (const value of object) {\n yield [start++, value];\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Filter an iterable for values which pass a test.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns An iterator which yields the values which pass the test.\n *\n * #### Example\n * ```typescript\n * import { filter } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = filter(data, value => value % 2 === 0);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* filter(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Find the first value in an iterable which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { find } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * find(data, isCat).name; // 'fluffy'\n * ```\n */\nfunction find(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return value;\n }\n }\n return undefined;\n}\n/**\n * Find the index of the first value which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { findIndex } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * findIndex(data, isCat); // 1\n * ```\n */\nfunction findIndex(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return index - 1;\n }\n }\n return -1;\n}\n/**\n * Find the minimum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The minimum value in the iterable. If multiple values are\n * equivalent to the minimum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { min } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * min([7, 4, 0, 3, 9, 4], numberCmp); // 0\n * ```\n */\nfunction min(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) < 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the maximum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The maximum value in the iterable. If multiple values are\n * equivalent to the maximum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { max } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * max([7, 4, 0, 3, 9, 4], numberCmp); // 9\n * ```\n */\nfunction max(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) > 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the minimum and maximum values in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns A 2-tuple of the `[min, max]` values in the iterable. If\n * multiple values are equivalent, the left-most values are returned.\n * If the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { minmax } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * minmax([7, 4, 0, 3, 9, 4], numberCmp); // [0, 9]\n * ```\n */\nfunction minmax(object, fn) {\n let empty = true;\n let vmin;\n let vmax;\n for (const value of object) {\n if (empty) {\n vmin = value;\n vmax = value;\n empty = false;\n }\n else if (fn(value, vmin) < 0) {\n vmin = value;\n }\n else if (fn(value, vmax) > 0) {\n vmax = value;\n }\n }\n return empty ? undefined : [vmin, vmax];\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an array from an iterable of values.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new array of values from the given object.\n *\n * #### Example\n * ```typescript\n * import { toArray } from '@lumino/algorithm';\n *\n * let stream = [1, 2, 3, 4, 5, 6][Symbol.iterator]();\n *\n * toArray(stream); // [1, 2, 3, 4, 5, 6];\n * ```\n */\nfunction toArray(object) {\n return Array.from(object);\n}\n/**\n * Create an object from an iterable of key/value pairs.\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new object mapping keys to values.\n *\n * #### Example\n * ```typescript\n * import { toObject } from '@lumino/algorithm';\n *\n * let data: [string, number][] = [['one', 1], ['two', 2], ['three', 3]];\n *\n * toObject(data); // { one: 1, two: 2, three: 3 }\n * ```\n */\nfunction toObject(object) {\n const result = {};\n for (const [key, value] of object) {\n result[key] = value;\n }\n return result;\n}\n/**\n * Invoke a function for each value in an iterable.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The callback function to invoke for each value.\n *\n * #### Notes\n * Iteration can be terminated early by returning `false` from the\n * callback function.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each } from '@lumino/algorithm';\n *\n * let data = [5, 7, 0, -2, 9];\n *\n * each(data, value => { console.log(value); });\n * ```\n */\nfunction each(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return;\n }\n }\n}\n/**\n * Test whether all values in an iterable satisfy a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if all values pass the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `false` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { every } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * every(data, value => value % 2 === 0); // false\n * every(data, value => value % 2 === 1); // true\n * ```\n */\nfunction every(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Test whether any value in an iterable satisfies a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if any value passes the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `true` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { some } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * some(data, value => value === 7); // true\n * some(data, value => value === 3); // false\n * ```\n */\nfunction some(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return true;\n }\n }\n return false;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Transform the values of an iterable with a mapping function.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The mapping function to invoke for each value.\n *\n * @returns An iterator which yields the transformed values.\n *\n * #### Example\n * ```typescript\n * import { map } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3];\n *\n * let stream = map(data, value => value * 2);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* map(object, fn) {\n let index = 0;\n for (const value of object) {\n yield fn(value, index++);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator of evenly spaced values.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns An iterator which produces evenly spaced values.\n *\n * #### Notes\n * In the single argument form of `range(stop)`, `start` defaults to\n * `0` and `step` defaults to `1`.\n *\n * In the two argument form of `range(start, stop)`, `step` defaults\n * to `1`.\n *\n * #### Example\n * ```typescript\n * import { range } from '@lumino/algorithm';\n *\n * let stream = range(2, 4);\n *\n * Array.from(stream); // [2, 3]\n * ```\n */\nfunction* range(start, stop, step) {\n if (stop === undefined) {\n stop = start;\n start = 0;\n step = 1;\n }\n else if (step === undefined) {\n step = 1;\n }\n const length = Private.rangeLength(start, stop, step);\n for (let index = 0; index < length; index++) {\n yield start + step * index;\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Compute the effective length of a range.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns The number of steps need to traverse the range.\n */\n function rangeLength(start, stop, step) {\n if (step === 0) {\n return Infinity;\n }\n if (start > stop && step > 0) {\n return 0;\n }\n if (start < stop && step < 0) {\n return 0;\n }\n return Math.ceil((stop - start) / step);\n }\n Private.rangeLength = rangeLength;\n})(Private || (Private = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nfunction reduce(object, fn, initial) {\n // Setup the iterator and fetch the first value.\n const it = object[Symbol.iterator]();\n let index = 0;\n let first = it.next();\n // An empty iterator and no initial value is an error.\n if (first.done && initial === undefined) {\n throw new TypeError('Reduce of empty iterable with no initial value.');\n }\n // If the iterator is empty, return the initial value.\n if (first.done) {\n return initial;\n }\n // If the iterator has a single item and no initial value, the\n // reducer is not invoked and the first item is the return value.\n let second = it.next();\n if (second.done && initial === undefined) {\n return first.value;\n }\n // If iterator has a single item and an initial value is provided,\n // the reducer is invoked and that result is the return value.\n if (second.done) {\n return fn(initial, first.value, index++);\n }\n // Setup the initial accumlated value.\n let accumulator;\n if (initial === undefined) {\n accumulator = fn(first.value, second.value, index++);\n }\n else {\n accumulator = fn(fn(initial, first.value, index++), second.value, index++);\n }\n // Iterate the rest of the values, updating the accumulator.\n let next;\n while (!(next = it.next()).done) {\n accumulator = fn(accumulator, next.value, index++);\n }\n // Return the final accumulated value.\n return accumulator;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator which repeats a value a number of times.\n *\n * @deprecated\n *\n * @param value - The value to repeat.\n *\n * @param count - The number of times to repeat the value.\n *\n * @returns A new iterator which repeats the specified value.\n *\n * #### Example\n * ```typescript\n * import { repeat } from '@lumino/algorithm';\n *\n * let stream = repeat(7, 3);\n *\n * Array.from(stream); // [7, 7, 7]\n * ```\n */\nfunction* repeat(value, count) {\n while (0 < count--) {\n yield value;\n }\n}\n/**\n * Create an iterator which yields a value a single time.\n *\n * @deprecated\n *\n * @param value - The value to wrap in an iterator.\n *\n * @returns A new iterator which yields the value a single time.\n *\n * #### Example\n * ```typescript\n * import { once } from '@lumino/algorithm';\n *\n * let stream = once(7);\n *\n * Array.from(stream); // [7]\n * ```\n */\nfunction* once(value) {\n yield value;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator for a retroable object.\n *\n * @param object - The retroable or array-like object of interest.\n *\n * @returns An iterator which traverses the object's values in reverse.\n *\n * #### Example\n * ```typescript\n * import { retro } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = retro(data);\n *\n * Array.from(stream); // [6, 5, 4, 3, 2, 1]\n * ```\n */\nfunction* retro(object) {\n if (typeof object.retro === 'function') {\n yield* object.retro();\n }\n else {\n for (let index = object.length - 1; index > -1; index--) {\n yield object[index];\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Topologically sort an iterable of edges.\n *\n * @param edges - The iterable object of edges to sort.\n * An edge is represented as a 2-tuple of `[fromNode, toNode]`.\n *\n * @returns The topologically sorted array of nodes.\n *\n * #### Notes\n * If a cycle is present in the graph, the cycle will be ignored and\n * the return value will be only approximately sorted.\n *\n * #### Example\n * ```typescript\n * import { topologicSort } from '@lumino/algorithm';\n *\n * let data = [\n * ['d', 'e'],\n * ['c', 'd'],\n * ['a', 'b'],\n * ['b', 'c']\n * ];\n *\n * topologicSort(data); // ['a', 'b', 'c', 'd', 'e']\n * ```\n */\nfunction topologicSort(edges) {\n // Setup the shared sorting state.\n let sorted = [];\n let visited = new Set();\n let graph = new Map();\n // Add the edges to the graph.\n for (const edge of edges) {\n addEdge(edge);\n }\n // Visit each node in the graph.\n for (const [k] of graph) {\n visit(k);\n }\n // Return the sorted results.\n return sorted;\n // Add an edge to the graph.\n function addEdge(edge) {\n let [fromNode, toNode] = edge;\n let children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n }\n else {\n graph.set(toNode, [fromNode]);\n }\n }\n // Recursively visit the node.\n function visit(node) {\n if (visited.has(node)) {\n return;\n }\n visited.add(node);\n let children = graph.get(node);\n if (children) {\n for (const child of children) {\n visit(child);\n }\n }\n sorted.push(node);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate over an iterable using a stepped increment.\n *\n * @param object - The iterable object of interest.\n *\n * @param step - The distance to step on each iteration. A value\n * of less than `1` will behave the same as a value of `1`.\n *\n * @returns An iterator which traverses the iterable step-wise.\n *\n * #### Example\n * ```typescript\n * import { stride } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = stride(data, 2);\n *\n * Array.from(stream); // [1, 3, 5];\n * ```\n */\nfunction* stride(object, step) {\n let count = 0;\n for (const value of object) {\n if (0 === count++ % step) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for string-specific algorithms.\n */\nvar StringExt;\n(function (StringExt) {\n /**\n * Find the indices of characters in a source text.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The matched indices, or `null` if there is no match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * In order for there to be a match, all of the characters in `query`\n * **must** appear in `source` in the order given by `query`.\n *\n * Characters are matched using strict `===` equality.\n */\n function findIndices(source, query, start = 0) {\n let indices = new Array(query.length);\n for (let i = 0, j = start, n = query.length; i < n; ++i, ++j) {\n j = source.indexOf(query[i], j);\n if (j === -1) {\n return null;\n }\n indices[i] = j;\n }\n return indices;\n }\n StringExt.findIndices = findIndices;\n /**\n * A string matcher which uses a sum-of-squares algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-squares approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The index of each\n * matching character is squared and added to the score. This means\n * that early and consecutive character matches are preferred, while\n * late matches are heavily penalized.\n */\n function matchSumOfSquares(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i] - start;\n score += j * j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfSquares = matchSumOfSquares;\n /**\n * A string matcher which uses a sum-of-deltas algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-deltas approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The delta between\n * the indices are summed to create the score. This means that groups\n * of matched characters are preferred, while fragmented matches are\n * penalized.\n */\n function matchSumOfDeltas(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n let last = start - 1;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i];\n score += j - last - 1;\n last = j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfDeltas = matchSumOfDeltas;\n /**\n * Highlight the matched characters of a source text.\n *\n * @param source - The text which should be highlighted.\n *\n * @param indices - The indices of the matched characters. They must\n * appear in increasing order and must be in bounds of the source.\n *\n * @param fn - The function to apply to the matched chunks.\n *\n * @returns An array of unmatched and highlighted chunks.\n */\n function highlight(source, indices, fn) {\n // Set up the result array.\n let result = [];\n // Set up the counter variables.\n let k = 0;\n let last = 0;\n let n = indices.length;\n // Iterator over each index.\n while (k < n) {\n // Set up the chunk indices.\n let i = indices[k];\n let j = indices[k];\n // Advance the right chunk index until it's non-contiguous.\n while (++k < n && indices[k] === j + 1) {\n j++;\n }\n // Extract the unmatched text.\n if (last < i) {\n result.push(source.slice(last, i));\n }\n // Extract and highlight the matched text.\n if (i < j + 1) {\n result.push(fn(source.slice(i, j + 1)));\n }\n // Update the last visited index.\n last = j + 1;\n }\n // Extract any remaining unmatched text.\n if (last < source.length) {\n result.push(source.slice(last));\n }\n // Return the highlighted result.\n return result;\n }\n StringExt.highlight = highlight;\n /**\n * A 3-way string comparison function.\n *\n * @param a - The first string of interest.\n *\n * @param b - The second string of interest.\n *\n * @returns `-1` if `a < b`, else `1` if `a > b`, else `0`.\n */\n function cmp(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n }\n StringExt.cmp = cmp;\n})(StringExt || (StringExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Take a fixed number of items from an iterable.\n *\n * @param object - The iterable object of interest.\n *\n * @param count - The number of items to take from the iterable.\n *\n * @returns An iterator which yields the specified number of items\n * from the source iterable.\n *\n * #### Notes\n * The returned iterator will exhaust early if the source iterable\n * contains an insufficient number of items.\n *\n * #### Example\n * ```typescript\n * import { take } from '@lumino/algorithm';\n *\n * let stream = take([5, 4, 3, 2, 1, 0, -1], 3);\n *\n * Array.from(stream); // [5, 4, 3]\n * ```\n */\nfunction* take(object, count) {\n if (count < 1) {\n return;\n }\n const it = object[Symbol.iterator]();\n let item;\n while (0 < count-- && !(item = it.next()).done) {\n yield item.value;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate several iterables in lockstep.\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields successive tuples of values where\n * each value is taken in turn from the provided iterables. It will\n * be as long as the shortest provided iterable.\n *\n * #### Example\n * ```typescript\n * import { zip } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = zip(data1, data2);\n *\n * Array.from(stream); // [[1, 4], [2, 5], [3, 6]]\n * ```\n */\nfunction* zip(...objects) {\n const iters = objects.map(obj => obj[Symbol.iterator]());\n let tuple = iters.map(it => it.next());\n for (; every(tuple, item => !item.done); tuple = iters.map(it => it.next())) {\n yield tuple.map(item => item.value);\n }\n}\n\nexport { ArrayExt, StringExt, chain, each, empty, enumerate, every, filter, find, findIndex, map, max, min, minmax, once, range, reduce, repeat, retro, some, stride, take, toArray, toObject, topologicSort, zip };\n//# sourceMappingURL=index.es6.js.map\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2019, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for clipboard related functionality.\n */\nvar ClipboardExt;\n(function (ClipboardExt) {\n /**\n * Copy text to the system clipboard.\n *\n * @param text - The text to copy to the clipboard.\n */\n function copyText(text) {\n // Fetch the document body.\n const body = document.body;\n // Set up the clipboard event listener.\n const handler = (event) => {\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Set the clipboard data.\n event.clipboardData.setData('text', text);\n // Remove the event listener.\n body.removeEventListener('copy', handler, true);\n };\n // Add the event listener.\n body.addEventListener('copy', handler, true);\n // Trigger the event.\n document.execCommand('copy');\n }\n ClipboardExt.copyText = copyText;\n})(ClipboardExt || (ClipboardExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for element related utilities.\n */\nvar ElementExt;\n(function (ElementExt) {\n /**\n * Compute the box sizing for an element.\n *\n * @param element - The element of interest.\n *\n * @returns The box sizing data for the specified element.\n */\n function boxSizing(element) {\n let style = window.getComputedStyle(element);\n let bt = parseFloat(style.borderTopWidth) || 0;\n let bl = parseFloat(style.borderLeftWidth) || 0;\n let br = parseFloat(style.borderRightWidth) || 0;\n let bb = parseFloat(style.borderBottomWidth) || 0;\n let pt = parseFloat(style.paddingTop) || 0;\n let pl = parseFloat(style.paddingLeft) || 0;\n let pr = parseFloat(style.paddingRight) || 0;\n let pb = parseFloat(style.paddingBottom) || 0;\n let hs = bl + pl + pr + br;\n let vs = bt + pt + pb + bb;\n return {\n borderTop: bt,\n borderLeft: bl,\n borderRight: br,\n borderBottom: bb,\n paddingTop: pt,\n paddingLeft: pl,\n paddingRight: pr,\n paddingBottom: pb,\n horizontalSum: hs,\n verticalSum: vs\n };\n }\n ElementExt.boxSizing = boxSizing;\n /**\n * Compute the size limits for an element.\n *\n * @param element - The element of interest.\n *\n * @returns The size limit data for the specified element.\n */\n function sizeLimits(element) {\n let style = window.getComputedStyle(element);\n let minWidth = parseFloat(style.minWidth) || 0;\n let minHeight = parseFloat(style.minHeight) || 0;\n let maxWidth = parseFloat(style.maxWidth) || Infinity;\n let maxHeight = parseFloat(style.maxHeight) || Infinity;\n maxWidth = Math.max(minWidth, maxWidth);\n maxHeight = Math.max(minHeight, maxHeight);\n return { minWidth, minHeight, maxWidth, maxHeight };\n }\n ElementExt.sizeLimits = sizeLimits;\n /**\n * Test whether a client position lies within an element.\n *\n * @param element - The DOM element of interest.\n *\n * @param clientX - The client X coordinate of interest.\n *\n * @param clientY - The client Y coordinate of interest.\n *\n * @returns Whether the point is within the given element.\n */\n function hitTest(element, clientX, clientY) {\n let rect = element.getBoundingClientRect();\n return (clientX >= rect.left &&\n clientX < rect.right &&\n clientY >= rect.top &&\n clientY < rect.bottom);\n }\n ElementExt.hitTest = hitTest;\n /**\n * Vertically scroll an element into view if needed.\n *\n * @param area - The scroll area element.\n *\n * @param element - The element of interest.\n *\n * #### Notes\n * This follows the \"nearest\" behavior of the native `scrollIntoView`\n * method, which is not supported by all browsers.\n * https://drafts.csswg.org/cssom-view/#element-scrolling-members\n *\n * If the element fully covers the visible area or is fully contained\n * within the visible area, no scrolling will take place. Otherwise,\n * the nearest edges of the area and element are aligned.\n */\n function scrollIntoViewIfNeeded(area, element) {\n let ar = area.getBoundingClientRect();\n let er = element.getBoundingClientRect();\n if (er.top <= ar.top && er.bottom >= ar.bottom) {\n return;\n }\n if (er.top < ar.top && er.height <= ar.height) {\n area.scrollTop -= ar.top - er.top;\n return;\n }\n if (er.bottom > ar.bottom && er.height >= ar.height) {\n area.scrollTop -= ar.top - er.top;\n return;\n }\n if (er.top < ar.top && er.height > ar.height) {\n area.scrollTop -= ar.bottom - er.bottom;\n return;\n }\n if (er.bottom > ar.bottom && er.height < ar.height) {\n area.scrollTop -= ar.bottom - er.bottom;\n return;\n }\n }\n ElementExt.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded;\n})(ElementExt || (ElementExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for platform related utilities.\n */\nvar Platform;\n(function (Platform) {\n /**\n * A flag indicating whether the platform is Mac.\n */\n Platform.IS_MAC = !!navigator.platform.match(/Mac/i);\n /**\n * A flag indicating whether the platform is Windows.\n */\n Platform.IS_WIN = !!navigator.platform.match(/Win/i);\n /**\n * A flag indicating whether the browser is IE.\n */\n Platform.IS_IE = /Trident/.test(navigator.userAgent);\n /**\n * A flag indicating whether the browser is Edge.\n */\n Platform.IS_EDGE = /Edge/.test(navigator.userAgent);\n /**\n * Test whether the `accel` key is pressed.\n *\n * @param event - The keyboard or mouse event of interest.\n *\n * @returns Whether the `accel` key is pressed.\n *\n * #### Notes\n * On Mac the `accel` key is the command key. On all other\n * platforms the `accel` key is the control key.\n */\n function accelKey(event) {\n return Platform.IS_MAC ? event.metaKey : event.ctrlKey;\n }\n Platform.accelKey = accelKey;\n})(Platform || (Platform = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for selector related utilities.\n */\nvar Selector;\n(function (Selector) {\n /**\n * Calculate the specificity of a single CSS selector.\n *\n * @param selector - The CSS selector of interest.\n *\n * @returns The specificity of the selector.\n *\n * #### Undefined Behavior\n * The selector is invalid.\n *\n * #### Notes\n * This is based on https://www.w3.org/TR/css3-selectors/#specificity\n *\n * A larger number represents a more specific selector.\n *\n * The smallest possible specificity is `0`.\n *\n * The result is represented as a hex number `0x` where\n * each component is the count of the respective selector clause.\n *\n * If the selector contains commas, only the first clause is used.\n *\n * The computed result is cached, so subsequent calculations for the\n * same selector are extremely fast.\n */\n function calculateSpecificity(selector) {\n if (selector in Private.specificityCache) {\n return Private.specificityCache[selector];\n }\n let result = Private.calculateSingle(selector);\n return (Private.specificityCache[selector] = result);\n }\n Selector.calculateSpecificity = calculateSpecificity;\n /**\n * Test whether a selector is a valid CSS selector.\n *\n * @param selector - The CSS selector of interest.\n *\n * @returns `true` if the selector is valid, `false` otherwise.\n *\n * #### Notes\n * The computed result is cached, so subsequent tests for the same\n * selector are extremely fast.\n */\n function isValid(selector) {\n if (selector in Private.validityCache) {\n return Private.validityCache[selector];\n }\n let result = true;\n try {\n Private.testElem.querySelector(selector);\n }\n catch (err) {\n result = false;\n }\n return (Private.validityCache[selector] = result);\n }\n Selector.isValid = isValid;\n /**\n * Test whether an element matches a CSS selector.\n *\n * @param element - The element of interest.\n *\n * @param selector - The valid CSS selector of interest.\n *\n * @returns `true` if the element is a match, `false` otherwise.\n *\n * #### Notes\n * This function uses the builtin browser capabilities when possible,\n * falling back onto a document query otherwise.\n */\n function matches(element, selector) {\n return Private.protoMatchFunc.call(element, selector);\n }\n Selector.matches = matches;\n})(Selector || (Selector = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A cache of computed selector specificity values.\n */\n Private.specificityCache = Object.create(null);\n /**\n * A cache of computed selector validity.\n */\n Private.validityCache = Object.create(null);\n /**\n * An empty element for testing selector validity.\n */\n Private.testElem = document.createElement('div');\n /**\n * A cross-browser CSS selector matching prototype function.\n */\n Private.protoMatchFunc = (() => {\n let proto = Element.prototype;\n return (proto.matches ||\n proto.matchesSelector ||\n proto.mozMatchesSelector ||\n proto.msMatchesSelector ||\n proto.oMatchesSelector ||\n proto.webkitMatchesSelector ||\n function (selector) {\n let elem = this;\n let matches = elem.ownerDocument\n ? elem.ownerDocument.querySelectorAll(selector)\n : [];\n return Array.prototype.indexOf.call(matches, elem) !== -1;\n });\n })();\n /**\n * Calculate the specificity of a single selector.\n *\n * The behavior is undefined if the selector is invalid.\n */\n function calculateSingle(selector) {\n // Ignore anything after the first comma.\n selector = selector.split(',', 1)[0];\n // Setup the aggregate counters.\n let a = 0;\n let b = 0;\n let c = 0;\n // Apply a regex to the front of the selector. If it succeeds, that\n // portion of the selector is removed. Returns a success/fail flag.\n function match(re) {\n let match = selector.match(re);\n if (match === null) {\n return false;\n }\n selector = selector.slice(match[0].length);\n return true;\n }\n // Replace the negation pseudo-class (which is ignored),\n // but keep its inner content (which is not ignored).\n selector = selector.replace(NEGATION_RE, ' $1 ');\n // Continue matching until the selector is consumed.\n while (selector.length > 0) {\n // Match an ID selector.\n if (match(ID_RE)) {\n a++;\n continue;\n }\n // Match a class selector.\n if (match(CLASS_RE)) {\n b++;\n continue;\n }\n // Match an attribute selector.\n if (match(ATTR_RE)) {\n b++;\n continue;\n }\n // Match a pseudo-element selector. This is done before matching\n // a pseudo-class since this regex overlaps with that regex.\n if (match(PSEUDO_ELEM_RE)) {\n c++;\n continue;\n }\n // Match a pseudo-class selector.\n if (match(PSEDUO_CLASS_RE)) {\n b++;\n continue;\n }\n // Match a plain type selector.\n if (match(TYPE_RE)) {\n c++;\n continue;\n }\n // Finally, match any ignored characters.\n if (match(IGNORE_RE)) {\n continue;\n }\n // At this point, the selector is assumed to be invalid.\n return 0;\n }\n // Clamp each component to a reasonable base.\n a = Math.min(a, 0xff);\n b = Math.min(b, 0xff);\n c = Math.min(c, 0xff);\n // Combine the components into a single result.\n return (a << 16) | (b << 8) | c;\n }\n Private.calculateSingle = calculateSingle;\n /**\n * A regex which matches an ID selector at string start.\n */\n const ID_RE = /^#[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches a class selector at string start.\n */\n const CLASS_RE = /^\\.[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches an attribute selector at string start.\n */\n const ATTR_RE = /^\\[[^\\]]+\\]/;\n /**\n * A regex which matches a type selector at string start.\n */\n const TYPE_RE = /^[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches a pseudo-element selector at string start.\n */\n const PSEUDO_ELEM_RE = /^(::[^\\s\\+>~#\\.\\[:]+|:first-line|:first-letter|:before|:after)/;\n /**\n * A regex which matches a pseudo-class selector at string start.\n */\n const PSEDUO_CLASS_RE = /^:[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches ignored characters at string start.\n */\n const IGNORE_RE = /^[\\s\\+>~\\*]+/;\n /**\n * A regex which matches the negation pseudo-class globally.\n */\n const NEGATION_RE = /:not\\(([^\\)]+)\\)/g;\n})(Private || (Private = {}));\n\nexport { ClipboardExt, ElementExt, Platform, Selector };\n//# sourceMappingURL=index.es6.js.map\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module keyboard\n */\n/**\n * Get the global application keyboard layout instance.\n *\n * @returns The keyboard layout for use by the application.\n *\n * #### Notes\n * The default keyboard layout is US-English.\n */\nfunction getKeyboardLayout() {\n return Private.keyboardLayout;\n}\n/**\n * Set the global application keyboard layout instance.\n *\n * @param layout The keyboard layout for use by the application.\n *\n * #### Notes\n * The keyboard layout should typically be set on application startup\n * to a layout which is appropriate for the user's system.\n */\nfunction setKeyboardLayout(layout) {\n Private.keyboardLayout = layout;\n}\n/**\n * A concrete implementation of {@link IKeyboardLayout} based on keycodes.\n *\n * The `keyCode` property of a `'keydown'` event is a browser and OS\n * specific representation of the physical key (not character) which\n * was pressed on a keyboard. While not the most convenient API, it\n * is currently the only one which works reliably on all browsers.\n *\n * This class accepts a user-defined mapping of keycode to key, which\n * allows for reliable shortcuts tailored to the user's system.\n */\nclass KeycodeLayout {\n /**\n * Construct a new keycode layout.\n *\n * @param name - The human readable name for the layout.\n *\n * @param codes - A mapping of keycode to key value.\n *\n * @param modifierKeys - Array of modifier key names\n */\n constructor(name, codes, modifierKeys = []) {\n this.name = name;\n this._codes = codes;\n this._keys = KeycodeLayout.extractKeys(codes);\n this._modifierKeys = KeycodeLayout.convertToKeySet(modifierKeys);\n }\n /**\n * Get an array of the key values supported by the layout.\n *\n * @returns A new array of the supported key values.\n */\n keys() {\n return Object.keys(this._keys);\n }\n /**\n * Test whether the given key is a valid value for the layout.\n *\n * @param key - The user provided key to test for validity.\n *\n * @returns `true` if the key is valid, `false` otherwise.\n */\n isValidKey(key) {\n return key in this._keys;\n }\n /**\n * Test whether the given key is a modifier key.\n *\n * @param key - The user provided key.\n *\n * @returns `true` if the key is a modifier key, `false` otherwise.\n */\n isModifierKey(key) {\n return key in this._modifierKeys;\n }\n /**\n * Get the key for a `'keydown'` event.\n *\n * @param event - The event object for a `'keydown'` event.\n *\n * @returns The associated key value, or an empty string if\n * the event does not represent a valid primary key.\n */\n keyForKeydownEvent(event) {\n return this._codes[event.keyCode] || '';\n }\n}\n/**\n * The namespace for the `KeycodeLayout` class statics.\n */\n(function (KeycodeLayout) {\n /**\n * Extract the set of keys from a code map.\n *\n * @param codes - The code map of interest.\n *\n * @returns A set of the keys in the code map.\n */\n function extractKeys(codes) {\n let keys = Object.create(null);\n for (let c in codes) {\n keys[codes[c]] = true;\n }\n return keys;\n }\n KeycodeLayout.extractKeys = extractKeys;\n /**\n * Convert array of keys to a key set.\n *\n * @param keys - The array that needs to be converted\n *\n * @returns A set of the keys in the array.\n */\n function convertToKeySet(keys) {\n let keySet = Object(null);\n for (let i = 0, n = keys.length; i < n; ++i) {\n keySet[keys[i]] = true;\n }\n return keySet;\n }\n KeycodeLayout.convertToKeySet = convertToKeySet;\n})(KeycodeLayout || (KeycodeLayout = {}));\n/**\n * A keycode-based keyboard layout for US English keyboards.\n *\n * This layout is valid for the following OS/Browser combinations.\n *\n * - Windows\n * - Chrome\n * - Firefox\n * - IE\n *\n * - OSX\n * - Chrome\n * - Firefox\n * - Safari\n *\n * - Linux\n * - Chrome\n * - Firefox\n *\n * Other combinations may also work, but are untested.\n */\nconst EN_US = new KeycodeLayout('en-us', {\n 8: 'Backspace',\n 9: 'Tab',\n 13: 'Enter',\n 16: 'Shift',\n 17: 'Ctrl',\n 18: 'Alt',\n 19: 'Pause',\n 27: 'Escape',\n 32: 'Space',\n 33: 'PageUp',\n 34: 'PageDown',\n 35: 'End',\n 36: 'Home',\n 37: 'ArrowLeft',\n 38: 'ArrowUp',\n 39: 'ArrowRight',\n 40: 'ArrowDown',\n 45: 'Insert',\n 46: 'Delete',\n 48: '0',\n 49: '1',\n 50: '2',\n 51: '3',\n 52: '4',\n 53: '5',\n 54: '6',\n 55: '7',\n 56: '8',\n 57: '9',\n 59: ';',\n 61: '=',\n 65: 'A',\n 66: 'B',\n 67: 'C',\n 68: 'D',\n 69: 'E',\n 70: 'F',\n 71: 'G',\n 72: 'H',\n 73: 'I',\n 74: 'J',\n 75: 'K',\n 76: 'L',\n 77: 'M',\n 78: 'N',\n 79: 'O',\n 80: 'P',\n 81: 'Q',\n 82: 'R',\n 83: 'S',\n 84: 'T',\n 85: 'U',\n 86: 'V',\n 87: 'W',\n 88: 'X',\n 89: 'Y',\n 90: 'Z',\n 91: 'Meta',\n 93: 'ContextMenu',\n 96: '0',\n 97: '1',\n 98: '2',\n 99: '3',\n 100: '4',\n 101: '5',\n 102: '6',\n 103: '7',\n 104: '8',\n 105: '9',\n 106: '*',\n 107: '+',\n 109: '-',\n 110: '.',\n 111: '/',\n 112: 'F1',\n 113: 'F2',\n 114: 'F3',\n 115: 'F4',\n 116: 'F5',\n 117: 'F6',\n 118: 'F7',\n 119: 'F8',\n 120: 'F9',\n 121: 'F10',\n 122: 'F11',\n 123: 'F12',\n 173: '-',\n 186: ';',\n 187: '=',\n 188: ',',\n 189: '-',\n 190: '.',\n 191: '/',\n 192: '`',\n 219: '[',\n 220: '\\\\',\n 221: ']',\n 222: \"'\",\n 224: 'Meta' // firefox\n}, ['Shift', 'Ctrl', 'Alt', 'Meta'] // modifier keys\n);\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The global keyboard layout instance.\n */\n Private.keyboardLayout = EN_US;\n})(Private || (Private = {}));\n\nexport { EN_US, KeycodeLayout, getKeyboardLayout, setKeyboardLayout };\n//# sourceMappingURL=index.es6.js.map\n","import { ArrayExt } from '@lumino/algorithm';\nimport { JSONExt } from '@lumino/coreutils';\nimport { DisposableDelegate } from '@lumino/disposable';\nimport { Platform, Selector } from '@lumino/domutils';\nimport { getKeyboardLayout } from '@lumino/keyboard';\nimport { Signal } from '@lumino/signaling';\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module commands\n */\n/**\n * An object which manages a collection of commands.\n *\n * #### Notes\n * A command registry can be used to populate a variety of action-based\n * widgets, such as command palettes, menus, and toolbars.\n */\nclass CommandRegistry {\n constructor() {\n this._timerID = 0;\n this._timerModifierID = 0;\n this._replaying = false;\n this._keystrokes = [];\n this._keydownEvents = [];\n this._keyBindings = [];\n this._exactKeyMatch = null;\n this._commands = new Map();\n this._commandChanged = new Signal(this);\n this._commandExecuted = new Signal(this);\n this._keyBindingChanged = new Signal(this);\n this._holdKeyBindingPromises = new Map();\n }\n /**\n * A signal emitted when a command has changed.\n *\n * #### Notes\n * This signal is useful for visual representations of commands which\n * need to refresh when the state of a relevant command has changed.\n */\n get commandChanged() {\n return this._commandChanged;\n }\n /**\n * A signal emitted when a command has executed.\n *\n * #### Notes\n * Care should be taken when consuming this signal. The command system is used\n * by many components for many user actions. Handlers registered with this\n * signal must return quickly to ensure the overall application remains responsive.\n */\n get commandExecuted() {\n return this._commandExecuted;\n }\n /**\n * A signal emitted when a key binding is changed.\n */\n get keyBindingChanged() {\n return this._keyBindingChanged;\n }\n /**\n * A read-only array of the key bindings in the registry.\n */\n get keyBindings() {\n return this._keyBindings;\n }\n /**\n * List the ids of the registered commands.\n *\n * @returns A new array of the registered command ids.\n */\n listCommands() {\n return Array.from(this._commands.keys());\n }\n /**\n * Test whether a specific command is registered.\n *\n * @param id - The id of the command of interest.\n *\n * @returns `true` if the command is registered, `false` otherwise.\n */\n hasCommand(id) {\n return this._commands.has(id);\n }\n /**\n * Add a command to the registry.\n *\n * @param id - The unique id of the command.\n *\n * @param options - The options for the command.\n *\n * @returns A disposable which will remove the command.\n *\n * @throws An error if the given `id` is already registered.\n */\n addCommand(id, options) {\n // Throw an error if the id is already registered.\n if (this._commands.has(id)) {\n throw new Error(`Command '${id}' already registered.`);\n }\n // Add the command to the registry.\n this._commands.set(id, Private.createCommand(options));\n // Emit the `commandChanged` signal.\n this._commandChanged.emit({ id, type: 'added' });\n // Return a disposable which will remove the command.\n return new DisposableDelegate(() => {\n // Remove the command from the registry.\n this._commands.delete(id);\n // Emit the `commandChanged` signal.\n this._commandChanged.emit({ id, type: 'removed' });\n });\n }\n /**\n * Notify listeners that the state of a command has changed.\n *\n * @param id - The id of the command which has changed. If more than\n * one command has changed, this argument should be omitted.\n *\n * @throws An error if the given `id` is not registered.\n *\n * #### Notes\n * This method should be called by the command author whenever the\n * application state changes such that the results of the command\n * metadata functions may have changed.\n *\n * This will cause the `commandChanged` signal to be emitted.\n */\n notifyCommandChanged(id) {\n if (id !== undefined && !this._commands.has(id)) {\n throw new Error(`Command '${id}' is not registered.`);\n }\n this._commandChanged.emit({ id, type: id ? 'changed' : 'many-changed' });\n }\n /**\n * Get the description for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The description for the command.\n */\n describedBy(id, args = JSONExt.emptyObject) {\n var _a;\n let cmd = this._commands.get(id);\n return Promise.resolve((_a = cmd === null || cmd === void 0 ? void 0 : cmd.describedBy.call(undefined, args)) !== null && _a !== void 0 ? _a : { args: null });\n }\n /**\n * Get the display label for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The display label for the command, or an empty string\n * if the command is not registered.\n */\n label(id, args = JSONExt.emptyObject) {\n var _a;\n let cmd = this._commands.get(id);\n return (_a = cmd === null || cmd === void 0 ? void 0 : cmd.label.call(undefined, args)) !== null && _a !== void 0 ? _a : '';\n }\n /**\n * Get the mnemonic index for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The mnemonic index for the command, or `-1` if the\n * command is not registered.\n */\n mnemonic(id, args = JSONExt.emptyObject) {\n let cmd = this._commands.get(id);\n return cmd ? cmd.mnemonic.call(undefined, args) : -1;\n }\n /**\n * Get the icon renderer for a specific command.\n *\n * DEPRECATED: if set to a string value, the .icon field will\n * function as an alias for the .iconClass field, for backwards\n * compatibility. In the future when this is removed, the default\n * return type will become undefined.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The icon renderer for the command or `undefined`.\n */\n icon(id, args = JSONExt.emptyObject) {\n var _a;\n return (_a = this._commands.get(id)) === null || _a === void 0 ? void 0 : _a.icon.call(undefined, args);\n }\n /**\n * Get the icon class for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The icon class for the command, or an empty string if\n * the command is not registered.\n */\n iconClass(id, args = JSONExt.emptyObject) {\n let cmd = this._commands.get(id);\n return cmd ? cmd.iconClass.call(undefined, args) : '';\n }\n /**\n * Get the icon label for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The icon label for the command, or an empty string if\n * the command is not registered.\n */\n iconLabel(id, args = JSONExt.emptyObject) {\n let cmd = this._commands.get(id);\n return cmd ? cmd.iconLabel.call(undefined, args) : '';\n }\n /**\n * Get the short form caption for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The caption for the command, or an empty string if the\n * command is not registered.\n */\n caption(id, args = JSONExt.emptyObject) {\n let cmd = this._commands.get(id);\n return cmd ? cmd.caption.call(undefined, args) : '';\n }\n /**\n * Get the usage help text for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The usage text for the command, or an empty string if\n * the command is not registered.\n */\n usage(id, args = JSONExt.emptyObject) {\n let cmd = this._commands.get(id);\n return cmd ? cmd.usage.call(undefined, args) : '';\n }\n /**\n * Get the extra class name for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The class name for the command, or an empty string if\n * the command is not registered.\n */\n className(id, args = JSONExt.emptyObject) {\n let cmd = this._commands.get(id);\n return cmd ? cmd.className.call(undefined, args) : '';\n }\n /**\n * Get the dataset for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The dataset for the command, or an empty dataset if\n * the command is not registered.\n */\n dataset(id, args = JSONExt.emptyObject) {\n let cmd = this._commands.get(id);\n return cmd ? cmd.dataset.call(undefined, args) : {};\n }\n /**\n * Test whether a specific command is enabled.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns A boolean indicating whether the command is enabled,\n * or `false` if the command is not registered.\n */\n isEnabled(id, args = JSONExt.emptyObject) {\n let cmd = this._commands.get(id);\n return cmd ? cmd.isEnabled.call(undefined, args) : false;\n }\n /**\n * Test whether a specific command is toggled.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns A boolean indicating whether the command is toggled,\n * or `false` if the command is not registered.\n */\n isToggled(id, args = JSONExt.emptyObject) {\n let cmd = this._commands.get(id);\n return cmd ? cmd.isToggled.call(undefined, args) : false;\n }\n /**\n * Test whether a specific command is toggleable.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns A boolean indicating whether the command is toggleable,\n * or `false` if the command is not registered.\n */\n isToggleable(id, args = JSONExt.emptyObject) {\n let cmd = this._commands.get(id);\n return cmd ? cmd.isToggleable : false;\n }\n /**\n * Test whether a specific command is visible.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns A boolean indicating whether the command is visible,\n * or `false` if the command is not registered.\n */\n isVisible(id, args = JSONExt.emptyObject) {\n let cmd = this._commands.get(id);\n return cmd ? cmd.isVisible.call(undefined, args) : false;\n }\n /**\n * Execute a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns A promise which resolves with the result of the command.\n *\n * #### Notes\n * The promise will reject if the command throws an exception,\n * or if the command is not registered.\n */\n execute(id, args = JSONExt.emptyObject) {\n // Reject if the command is not registered.\n let cmd = this._commands.get(id);\n if (!cmd) {\n return Promise.reject(new Error(`Command '${id}' not registered.`));\n }\n // Execute the command and reject if an exception is thrown.\n let value;\n try {\n value = cmd.execute.call(undefined, args);\n }\n catch (err) {\n value = Promise.reject(err);\n }\n // Create the return promise which resolves the result.\n let result = Promise.resolve(value);\n // Emit the command executed signal.\n this._commandExecuted.emit({ id, args, result });\n // Return the result promise to the caller.\n return result;\n }\n /**\n * Add a key binding to the registry.\n *\n * @param options - The options for creating the key binding.\n *\n * @returns A disposable which removes the added key binding.\n *\n * #### Notes\n * If multiple key bindings are registered for the same sequence, the\n * binding with the highest selector specificity is executed first. A\n * tie is broken by using the most recently added key binding.\n *\n * Ambiguous key bindings are resolved with a timeout. As an example,\n * suppose two key bindings are registered: one with the key sequence\n * `['Ctrl D']`, and another with `['Ctrl D', 'Ctrl W']`. If the user\n * presses `Ctrl D`, the first binding cannot be immediately executed\n * since the user may intend to complete the chord with `Ctrl W`. For\n * such cases, a timer is used to allow the chord to be completed. If\n * the chord is not completed before the timeout, the first binding\n * is executed.\n */\n addKeyBinding(options) {\n // Create the binding for the given options.\n let binding = Private.createKeyBinding(options);\n // Add the key binding to the bindings array.\n this._keyBindings.push(binding);\n // Emit the `bindingChanged` signal.\n this._keyBindingChanged.emit({ binding, type: 'added' });\n // Return a disposable which will remove the binding.\n return new DisposableDelegate(() => {\n // Remove the binding from the array.\n ArrayExt.removeFirstOf(this._keyBindings, binding);\n // Emit the `bindingChanged` signal.\n this._keyBindingChanged.emit({ binding, type: 'removed' });\n });\n }\n /**\n * Process a `'keydown'` event and invoke a matching key binding.\n *\n * @param event - The event object for a `'keydown'` event.\n *\n * #### Notes\n * This should be called in response to a `'keydown'` event in order\n * to invoke the command for the best matching key binding.\n *\n * The registry **does not** install its own listener for `'keydown'`\n * events. This allows the application full control over the nodes\n * and phase for which the registry processes `'keydown'` events.\n *\n * When the keydown event is processed, if the event target or any of its\n * ancestor nodes has a `data-lm-suppress-shortcuts` attribute, its keydown\n * events will not invoke commands.\n */\n processKeydownEvent(event) {\n // Bail immediately if playing back keystrokes.\n if (event.defaultPrevented || this._replaying) {\n return;\n }\n // Get the normalized keystroke for the event.\n const keystroke = CommandRegistry.keystrokeForKeydownEvent(event);\n // If the keystroke is not valid for the keyboard layout, replay\n // any suppressed events and clear the pending state.\n if (!keystroke) {\n this._replayKeydownEvents();\n this._clearPendingState();\n return;\n }\n // Check that only mod key(s) have been pressed.\n if (CommandRegistry.isModifierKeyPressed(event)) {\n // Find the exact match for the modifier keys.\n let { exact } = Private.matchKeyBinding(this._keyBindings, [keystroke], event);\n if (exact) {\n // If the mod keys match an exact shortcut, start a dedicated timer.\n event.preventDefault();\n event.stopPropagation();\n this._startModifierTimer(exact);\n }\n else {\n // Otherwise stop potential existing timer.\n this._clearModifierTimer();\n }\n return;\n }\n // Add the keystroke to the current key sequence.\n this._keystrokes.push(keystroke);\n // Find the exact and partial matches for the key sequence.\n const { exact, partial } = Private.matchKeyBinding(this._keyBindings, this._keystrokes, event);\n // Whether there is any partial match.\n const hasPartial = partial.length !== 0;\n // If there is no exact match and no partial match, replay\n // any suppressed events and clear the pending state.\n if (!exact && !hasPartial) {\n this._replayKeydownEvents();\n this._clearPendingState();\n return;\n }\n // Stop propagation of the event. If there is only a partial match,\n // the event will be replayed if a final exact match never occurs.\n if ((exact === null || exact === void 0 ? void 0 : exact.preventDefault) || partial.some(match => match.preventDefault)) {\n event.preventDefault();\n event.stopPropagation();\n }\n // Store the event for possible playback in the future and for\n // the use in execution hold check.\n this._keydownEvents.push(event);\n // If there is an exact match but no partial match, the exact match\n // can be dispatched immediately. The pending state is cleared so\n // the next key press starts from the default state.\n if (exact && !hasPartial) {\n this._executeKeyBinding(exact);\n this._clearPendingState();\n return;\n }\n // If there is both an exact match and a partial match, the exact\n // match is stored for future dispatch in case the timer expires\n // before a more specific match is triggered.\n if (exact) {\n this._exactKeyMatch = exact;\n }\n // (Re)start the timer to dispatch the most recent exact match\n // in case the partial match fails to result in an exact match.\n this._startTimer();\n }\n /**\n * Delay the execution of any command matched against the given 'keydown' event\n * until the `permission` to execute is granted.\n *\n * @param event - The event object for a `'keydown'` event.\n * @param permission - The promise with value indicating whether to proceed with the execution.\n *\n * ### Note\n * This enables the caller of `processKeydownEvent` to asynchronously prevent the\n * execution of the command based on external events.\n */\n holdKeyBindingExecution(event, permission) {\n this._holdKeyBindingPromises.set(event, permission);\n }\n /**\n * Process a ``keyup`` event to clear the timer on the modifier, if it exists.\n *\n * @param event - The event object for a `'keydown'` event.\n */\n processKeyupEvent(event) {\n this._clearModifierTimer();\n }\n /**\n * Start or restart the timeout on the modifier keys.\n *\n * This timeout will end only if the keys are hold.\n */\n _startModifierTimer(exact) {\n this._clearModifierTimer();\n this._timerModifierID = window.setTimeout(() => {\n this._executeKeyBinding(exact);\n }, Private.modifierkeyTimeOut);\n }\n /**\n * Clear the timeout on modifier keys.\n */\n _clearModifierTimer() {\n if (this._timerModifierID !== 0) {\n clearTimeout(this._timerModifierID);\n this._timerModifierID = 0;\n }\n }\n /**\n * Start or restart the pending timeout.\n */\n _startTimer() {\n this._clearTimer();\n this._timerID = window.setTimeout(() => {\n this._onPendingTimeout();\n }, Private.CHORD_TIMEOUT);\n }\n /**\n * Clear the pending timeout.\n */\n _clearTimer() {\n if (this._timerID !== 0) {\n clearTimeout(this._timerID);\n this._timerID = 0;\n }\n }\n /**\n * Replay the keydown events which were suppressed.\n */\n _replayKeydownEvents() {\n if (this._keydownEvents.length === 0) {\n return;\n }\n this._replaying = true;\n this._keydownEvents.forEach(Private.replayKeyEvent);\n this._replaying = false;\n }\n /**\n * Execute the command for the given key binding.\n *\n * If the command is missing or disabled, a warning will be logged.\n *\n * The execution will not proceed if any of the events leading to\n * the keybinding matching were held with the permission resolving to false.\n */\n async _executeKeyBinding(binding) {\n if (this._holdKeyBindingPromises.size !== 0) {\n // Copy keydown events list to ensure it is available in async code.\n const keydownEvents = [...this._keydownEvents];\n // Wait until all hold requests on execution are lifted.\n const executionAllowed = (await Promise.race([\n Promise.all(keydownEvents.map(async (event) => { var _a; return (_a = this._holdKeyBindingPromises.get(event)) !== null && _a !== void 0 ? _a : Promise.resolve(true); })),\n new Promise(resolve => {\n setTimeout(() => resolve([false]), Private.KEYBINDING_HOLD_TIMEOUT);\n })\n ])).every(Boolean);\n // Clear the hold requests.\n this._holdKeyBindingPromises.clear();\n // Do not proceed with the execution if any of the hold requests did not get the permission to proceed.\n if (!executionAllowed) {\n return;\n }\n }\n let { command, args } = binding;\n let newArgs = {\n _luminoEvent: { type: 'keybinding', keys: binding.keys },\n ...args\n };\n if (!this.hasCommand(command) || !this.isEnabled(command, newArgs)) {\n let word = this.hasCommand(command) ? 'enabled' : 'registered';\n let keys = binding.keys.join(', ');\n let msg1 = `Cannot execute key binding '${keys}':`;\n let msg2 = `command '${command}' is not ${word}.`;\n console.warn(`${msg1} ${msg2}`);\n return;\n }\n await this.execute(command, newArgs);\n }\n /**\n * Clear the internal pending state.\n */\n _clearPendingState() {\n this._clearTimer();\n this._clearModifierTimer();\n this._exactKeyMatch = null;\n this._keystrokes.length = 0;\n this._keydownEvents.length = 0;\n }\n /**\n * Handle the partial match timeout.\n */\n _onPendingTimeout() {\n this._timerID = 0;\n if (this._exactKeyMatch) {\n this._executeKeyBinding(this._exactKeyMatch);\n }\n else {\n this._replayKeydownEvents();\n }\n this._clearPendingState();\n }\n}\n/**\n * The namespace for the `CommandRegistry` class statics.\n */\n(function (CommandRegistry) {\n /**\n * Parse a keystroke into its constituent components.\n *\n * @param keystroke - The keystroke of interest.\n *\n * @returns The parsed components of the keystroke.\n *\n * #### Notes\n * The keystroke should be of the form:\n * `[ [ [ ]]]`\n *\n * The supported modifiers are: `Accel`, `Alt`, `Cmd`, `Ctrl`, and\n * `Shift`. The `Accel` modifier is translated to `Cmd` on Mac and\n * `Ctrl` on all other platforms.\n *\n * The parsing is tolerant and will not throw exceptions. Notably:\n * - Duplicate modifiers are ignored.\n * - Extra primary keys are ignored.\n * - The order of modifiers and primary key is irrelevant.\n * - The keystroke parts should be separated by whitespace.\n * - The keystroke is case sensitive.\n */\n function parseKeystroke(keystroke) {\n let key = '';\n let alt = false;\n let cmd = false;\n let ctrl = false;\n let shift = false;\n for (let token of keystroke.split(/\\s+/)) {\n if (token === 'Accel') {\n if (Platform.IS_MAC) {\n cmd = true;\n }\n else {\n ctrl = true;\n }\n }\n else if (token === 'Alt') {\n alt = true;\n }\n else if (token === 'Cmd') {\n cmd = true;\n }\n else if (token === 'Ctrl') {\n ctrl = true;\n }\n else if (token === 'Shift') {\n shift = true;\n }\n else if (token.length > 0) {\n key = token;\n }\n }\n return { cmd, ctrl, alt, shift, key };\n }\n CommandRegistry.parseKeystroke = parseKeystroke;\n /**\n * Normalize a keystroke into a canonical representation.\n *\n * @param keystroke - The keystroke of interest.\n *\n * @returns The normalized representation of the keystroke.\n *\n * #### Notes\n * This normalizes the keystroke by removing duplicate modifiers and\n * extra primary keys, and assembling the parts in a canonical order.\n *\n * The `Cmd` modifier is ignored on non-Mac platforms.\n */\n function normalizeKeystroke(keystroke) {\n let mods = '';\n let parts = parseKeystroke(keystroke);\n if (parts.ctrl) {\n mods += 'Ctrl ';\n }\n if (parts.alt) {\n mods += 'Alt ';\n }\n if (parts.shift) {\n mods += 'Shift ';\n }\n if (parts.cmd && Platform.IS_MAC) {\n mods += 'Cmd ';\n }\n if (!parts.key) {\n return mods.trim();\n }\n return mods + parts.key;\n }\n CommandRegistry.normalizeKeystroke = normalizeKeystroke;\n /**\n * Get the platform-specific normalized keys for an options object.\n *\n * @param options - The options for the key binding.\n *\n * @returns Array of combined, normalized keys.\n */\n function normalizeKeys(options) {\n let keys;\n if (Platform.IS_WIN) {\n keys = options.winKeys || options.keys;\n }\n else if (Platform.IS_MAC) {\n keys = options.macKeys || options.keys;\n }\n else {\n keys = options.linuxKeys || options.keys;\n }\n return keys.map(normalizeKeystroke);\n }\n CommandRegistry.normalizeKeys = normalizeKeys;\n /**\n * Format keystrokes for display on the local system.\n *\n * If a list of keystrokes is provided, it will be displayed as\n * a comma-separated string\n *\n * @param keystroke The keystrokes to format\n * @returns The keystrokes representation\n */\n function formatKeystroke(keystroke) {\n return typeof keystroke === 'string'\n ? formatSingleKey(keystroke)\n : keystroke.map(formatSingleKey).join(', ');\n function formatSingleKey(key) {\n let mods = [];\n let separator = Platform.IS_MAC ? ' ' : '+';\n let parts = parseKeystroke(key);\n if (parts.ctrl) {\n mods.push('Ctrl');\n }\n if (parts.alt) {\n mods.push('Alt');\n }\n if (parts.shift) {\n mods.push('Shift');\n }\n if (Platform.IS_MAC && parts.cmd) {\n mods.push('Cmd');\n }\n mods.push(parts.key);\n return mods.map(Private.formatKey).join(separator);\n }\n }\n CommandRegistry.formatKeystroke = formatKeystroke;\n /**\n * Check if `'keydown'` event is caused by pressing a modifier key that should be ignored.\n *\n * @param event - The event object for a `'keydown'` event.\n *\n * @returns `true` if modifier key was pressed, `false` otherwise.\n */\n function isModifierKeyPressed(event) {\n let layout = getKeyboardLayout();\n let key = layout.keyForKeydownEvent(event);\n return layout.isModifierKey(key);\n }\n CommandRegistry.isModifierKeyPressed = isModifierKeyPressed;\n /**\n * Create a normalized keystroke for a `'keydown'` event.\n *\n * @param event - The event object for a `'keydown'` event.\n *\n * @returns A normalized keystroke, or an empty string if the event\n * does not represent a valid keystroke for the given layout.\n */\n function keystrokeForKeydownEvent(event) {\n let layout = getKeyboardLayout();\n let key = layout.keyForKeydownEvent(event);\n let mods = [];\n if (event.ctrlKey) {\n mods.push('Ctrl');\n }\n if (event.altKey) {\n mods.push('Alt');\n }\n if (event.shiftKey) {\n mods.push('Shift');\n }\n if (event.metaKey && Platform.IS_MAC) {\n mods.push('Cmd');\n }\n if (!layout.isModifierKey(key)) {\n mods.push(key);\n }\n // for purely modifier key strings\n return mods.join(' ');\n }\n CommandRegistry.keystrokeForKeydownEvent = keystrokeForKeydownEvent;\n})(CommandRegistry || (CommandRegistry = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The timeout in ms for triggering a key binding chord.\n */\n Private.CHORD_TIMEOUT = 1000;\n /**\n * The timeout in ms for stopping the hold on keybinding execution.\n */\n Private.KEYBINDING_HOLD_TIMEOUT = 1000;\n /**\n * The timeout in ms for triggering a modifer key binding.\n */\n Private.modifierkeyTimeOut = 500;\n /**\n * Create a normalized command from an options object.\n */\n function createCommand(options) {\n return {\n execute: options.execute,\n describedBy: asFunc(typeof options.describedBy === 'function'\n ? options.describedBy\n : { args: null, ...options.describedBy }, () => {\n return { args: null };\n }),\n label: asFunc(options.label, emptyStringFunc),\n mnemonic: asFunc(options.mnemonic, negativeOneFunc),\n icon: asFunc(options.icon, undefinedFunc),\n iconClass: asFunc(options.iconClass, emptyStringFunc),\n iconLabel: asFunc(options.iconLabel, emptyStringFunc),\n caption: asFunc(options.caption, emptyStringFunc),\n usage: asFunc(options.usage, emptyStringFunc),\n className: asFunc(options.className, emptyStringFunc),\n dataset: asFunc(options.dataset, emptyDatasetFunc),\n isEnabled: options.isEnabled || trueFunc,\n isToggled: options.isToggled || falseFunc,\n isToggleable: options.isToggleable || !!options.isToggled,\n isVisible: options.isVisible || trueFunc\n };\n }\n Private.createCommand = createCommand;\n /**\n * Create a key binding object from key binding options.\n */\n function createKeyBinding(options) {\n var _a;\n return {\n keys: CommandRegistry.normalizeKeys(options),\n selector: validateSelector(options),\n command: options.command,\n args: options.args || JSONExt.emptyObject,\n preventDefault: (_a = options.preventDefault) !== null && _a !== void 0 ? _a : true\n };\n }\n Private.createKeyBinding = createKeyBinding;\n /**\n * Find the key bindings which match a key sequence.\n *\n * This returns a match result which contains the best exact matching\n * binding, and a flag which indicates if there are partial matches.\n */\n function matchKeyBinding(bindings, keys, event) {\n // The current best exact match.\n let exact = null;\n // Partial matches.\n let partial = [];\n // The match distance for the exact match.\n let distance = Infinity;\n // The specificity for the exact match.\n let specificity = 0;\n // Iterate over the bindings and search for the best match.\n for (let i = 0, n = bindings.length; i < n; ++i) {\n // Lookup the current binding.\n let binding = bindings[i];\n // Check whether the key binding sequence is a match.\n let sqm = matchSequence(binding.keys, keys);\n // If there is no match, the binding is ignored.\n if (sqm === 0 /* SequenceMatch.None */) {\n continue;\n }\n // If it is a partial match and no other partial match has been\n // found, ensure the selector matches and set the partial flag.\n if (sqm === 2 /* SequenceMatch.Partial */) {\n if (targetDistance(binding.selector, event) !== -1) {\n partial.push(binding);\n }\n continue;\n }\n // Ignore the match if the selector doesn't match, or if the\n // matched node is farther away than the current best match.\n let td = targetDistance(binding.selector, event);\n if (td === -1 || td > distance) {\n continue;\n }\n // Get the specificity for the selector.\n let sp = Selector.calculateSpecificity(binding.selector);\n // Update the best match if this match is stronger.\n if (!exact || td < distance || sp >= specificity) {\n exact = binding;\n distance = td;\n specificity = sp;\n }\n }\n // Return the match result.\n return { exact, partial };\n }\n Private.matchKeyBinding = matchKeyBinding;\n /**\n * Replay a keyboard event.\n *\n * This synthetically dispatches a clone of the keyboard event.\n */\n function replayKeyEvent(event) {\n event.target.dispatchEvent(cloneKeyboardEvent(event));\n }\n Private.replayKeyEvent = replayKeyEvent;\n function formatKey(key) {\n if (Platform.IS_MAC) {\n return MAC_DISPLAY.hasOwnProperty(key) ? MAC_DISPLAY[key] : key;\n }\n else {\n return WIN_DISPLAY.hasOwnProperty(key) ? WIN_DISPLAY[key] : key;\n }\n }\n Private.formatKey = formatKey;\n const MAC_DISPLAY = {\n Backspace: '⌫',\n Tab: '⇥',\n Enter: '⏎',\n Shift: '⇧',\n Ctrl: '⌃',\n Alt: '⌥',\n Escape: '⎋',\n PageUp: '⇞',\n PageDown: '⇟',\n End: '↘',\n Home: '↖',\n ArrowLeft: '←',\n ArrowUp: '↑',\n ArrowRight: '→',\n ArrowDown: '↓',\n Delete: '⌦',\n Cmd: '⌘'\n };\n const WIN_DISPLAY = {\n Escape: 'Esc',\n PageUp: 'Page Up',\n PageDown: 'Page Down',\n ArrowLeft: 'Left',\n ArrowUp: 'Up',\n ArrowRight: 'Right',\n ArrowDown: 'Down',\n Delete: 'Del'\n };\n /**\n * A singleton empty string function.\n */\n const emptyStringFunc = () => '';\n /**\n * A singleton `-1` number function\n */\n const negativeOneFunc = () => -1;\n /**\n * A singleton true boolean function.\n */\n const trueFunc = () => true;\n /**\n * A singleton false boolean function.\n */\n const falseFunc = () => false;\n /**\n * A singleton empty dataset function.\n */\n const emptyDatasetFunc = () => ({});\n /**\n * A singleton undefined function\n */\n const undefinedFunc = () => undefined;\n /**\n * Cast a value or command func to a command func.\n */\n function asFunc(value, dfault) {\n if (value === undefined) {\n return dfault;\n }\n if (typeof value === 'function') {\n return value;\n }\n return () => value;\n }\n /**\n * Validate the selector for an options object.\n *\n * This returns the validated selector, or throws if the selector is\n * invalid or contains commas.\n */\n function validateSelector(options) {\n if (options.selector.indexOf(',') !== -1) {\n throw new Error(`Selector cannot contain commas: ${options.selector}`);\n }\n if (!Selector.isValid(options.selector)) {\n throw new Error(`Invalid selector: ${options.selector}`);\n }\n return options.selector;\n }\n /**\n * Test whether a key binding sequence matches a key sequence.\n *\n * Returns a `SequenceMatch` value indicating the type of match.\n */\n function matchSequence(bindKeys, userKeys) {\n if (bindKeys.length < userKeys.length) {\n return 0 /* SequenceMatch.None */;\n }\n for (let i = 0, n = userKeys.length; i < n; ++i) {\n if (bindKeys[i] !== userKeys[i]) {\n return 0 /* SequenceMatch.None */;\n }\n }\n if (bindKeys.length > userKeys.length) {\n return 2 /* SequenceMatch.Partial */;\n }\n return 1 /* SequenceMatch.Exact */;\n }\n /**\n * Find the distance from the target node to the first matching node.\n *\n * This traverses the event path from `target` to `currentTarget` and\n * computes the distance from `target` to the first node which matches\n * the CSS selector. If no match is found, `-1` is returned.\n */\n function targetDistance(selector, event) {\n let targ = event.target;\n let curr = event.currentTarget;\n for (let dist = 0; targ !== null; targ = targ.parentElement, ++dist) {\n if (targ.hasAttribute('data-lm-suppress-shortcuts')) {\n return -1;\n }\n if (Selector.matches(targ, selector)) {\n return dist;\n }\n if (targ === curr) {\n return -1;\n }\n }\n return -1;\n }\n /**\n * Clone a keyboard event.\n */\n function cloneKeyboardEvent(event) {\n // A custom event is required because Chrome nulls out the\n // `keyCode` field in user-generated `KeyboardEvent` types.\n let clone = document.createEvent('Event');\n let bubbles = event.bubbles || true;\n let cancelable = event.cancelable || true;\n clone.initEvent(event.type || 'keydown', bubbles, cancelable);\n clone.key = event.key || '';\n clone.keyCode = event.keyCode || 0;\n clone.which = event.keyCode || 0;\n clone.ctrlKey = event.ctrlKey || false;\n clone.altKey = event.altKey || false;\n clone.shiftKey = event.shiftKey || false;\n clone.metaKey = event.metaKey || false;\n clone.view = event.view || window;\n return clone;\n }\n})(Private || (Private = {}));\n\nexport { CommandRegistry };\n//# sourceMappingURL=index.es6.js.map\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for array-specific algorithms.\n */\nvar ArrayExt;\n(function (ArrayExt) {\n /**\n * Find the index of the first occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.firstIndexOf(data, 'red'); // -1\n * ArrayExt.firstIndexOf(data, 'one'); // 0\n * ArrayExt.firstIndexOf(data, 'one', 1); // 4\n * ArrayExt.firstIndexOf(data, 'two', 2); // -1\n * ArrayExt.firstIndexOf(data, 'two', 2, 1); // 1\n * ```\n */\n function firstIndexOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.firstIndexOf = firstIndexOf;\n /**\n * Find the index of the last occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.lastIndexOf(data, 'red'); // -1\n * ArrayExt.lastIndexOf(data, 'one'); // 4\n * ArrayExt.lastIndexOf(data, 'one', 1); // 0\n * ArrayExt.lastIndexOf(data, 'two', 0); // -1\n * ArrayExt.lastIndexOf(data, 'two', 0, 1); // 1\n * ```\n */\n function lastIndexOf(array, value, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (start < stop) {\n span = start + 1 + (n - stop);\n }\n else {\n span = start - stop + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start - i + n) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.lastIndexOf = lastIndexOf;\n /**\n * Find the index of the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstIndex(data, isEven); // 1\n * ArrayExt.findFirstIndex(data, isEven, 4); // 5\n * ArrayExt.findFirstIndex(data, isEven, 6); // -1\n * ArrayExt.findFirstIndex(data, isEven, 6, 5); // 1\n * ```\n */\n function findFirstIndex(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findFirstIndex = findFirstIndex;\n /**\n * Find the index of the last value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastIndex(data, isEven); // 5\n * ArrayExt.findLastIndex(data, isEven, 4); // 3\n * ArrayExt.findLastIndex(data, isEven, 0); // -1\n * ArrayExt.findLastIndex(data, isEven, 0, 1); // 5\n * ```\n */\n function findLastIndex(array, fn, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let d;\n if (start < stop) {\n d = start + 1 + (n - stop);\n }\n else {\n d = start - stop + 1;\n }\n for (let i = 0; i < d; ++i) {\n let j = (start - i + n) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findLastIndex = findLastIndex;\n /**\n * Find the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstValue(data, isEven); // 2\n * ArrayExt.findFirstValue(data, isEven, 2); // 4\n * ArrayExt.findFirstValue(data, isEven, 6); // undefined\n * ArrayExt.findFirstValue(data, isEven, 6, 5); // 2\n * ```\n */\n function findFirstValue(array, fn, start = 0, stop = -1) {\n let index = findFirstIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findFirstValue = findFirstValue;\n /**\n * Find the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The last matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastValue(data, isEven); // 2\n * ArrayExt.findLastValue(data, isEven, 4); // 4\n * ArrayExt.findLastValue(data, isEven, 0); // undefined\n * ArrayExt.findLastValue(data, isEven, 0, 1); // 2\n * ```\n */\n function findLastValue(array, fn, start = -1, stop = 0) {\n let index = findLastIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findLastValue = findLastValue;\n /**\n * Find the index of the first element which compares `>=` to a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>=` to the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.lowerBound(data, 0, numberCmp); // 0\n * ArrayExt.lowerBound(data, 6, numberCmp); // 3\n * ArrayExt.lowerBound(data, 7, numberCmp); // 3\n * ArrayExt.lowerBound(data, -1, numberCmp); // 0\n * ArrayExt.lowerBound(data, 10, numberCmp); // 6\n * ```\n */\n function lowerBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) < 0) {\n begin = middle + 1;\n span -= half + 1;\n }\n else {\n span = half;\n }\n }\n return begin;\n }\n ArrayExt.lowerBound = lowerBound;\n /**\n * Find the index of the first element which compares `>` than a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>` than the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.upperBound(data, 0, numberCmp); // 1\n * ArrayExt.upperBound(data, 6, numberCmp); // 3\n * ArrayExt.upperBound(data, 7, numberCmp); // 5\n * ArrayExt.upperBound(data, -1, numberCmp); // 0\n * ArrayExt.upperBound(data, 10, numberCmp); // 6\n * ```\n */\n function upperBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) > 0) {\n span = half;\n }\n else {\n begin = middle + 1;\n span -= half + 1;\n }\n }\n return begin;\n }\n ArrayExt.upperBound = upperBound;\n /**\n * Test whether two arrays are shallowly equal.\n *\n * @param a - The first array-like object to compare.\n *\n * @param b - The second array-like object to compare.\n *\n * @param fn - The comparison function to apply to the elements. It\n * should return `true` if the elements are \"equal\". The default\n * compares elements using strict `===` equality.\n *\n * @returns Whether the two arrays are shallowly equal.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * Modifying the length of the arrays while comparing.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let d1 = [0, 3, 4, 7, 7, 9];\n * let d2 = [0, 3, 4, 7, 7, 9];\n * let d3 = [42];\n * ArrayExt.shallowEqual(d1, d2); // true\n * ArrayExt.shallowEqual(d2, d3); // false\n * ```\n */\n function shallowEqual(a, b, fn) {\n // Check for object identity first.\n if (a === b) {\n return true;\n }\n // Bail early if the lengths are different.\n if (a.length !== b.length) {\n return false;\n }\n // Compare each element for equality.\n for (let i = 0, n = a.length; i < n; ++i) {\n if (fn ? !fn(a[i], b[i]) : a[i] !== b[i]) {\n return false;\n }\n }\n // The array are shallowly equal.\n return true;\n }\n ArrayExt.shallowEqual = shallowEqual;\n /**\n * Create a slice of an array subject to an optional step.\n *\n * @param array - The array-like object of interest.\n *\n * @param options - The options for configuring the slice.\n *\n * @returns A new array with the specified values.\n *\n * @throws An exception if the slice `step` is `0`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start`, `stop`, or `step` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.slice(data); // [0, 3, 4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 2 }); // [4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 0, stop: 4 }); // [0, 3, 4, 7]\n * ArrayExt.slice(data, { step: 2 }); // [0, 4, 7]\n * ArrayExt.slice(data, { step: -1 }); // [9, 7, 7, 4, 3, 0]\n * ```\n */\n function slice(array, options = {}) {\n // Extract the options.\n let { start, stop, step } = options;\n // Set up the `step` value.\n if (step === undefined) {\n step = 1;\n }\n // Validate the step size.\n if (step === 0) {\n throw new Error('Slice `step` cannot be zero.');\n }\n // Look up the length of the array.\n let n = array.length;\n // Set up the `start` value.\n if (start === undefined) {\n start = step < 0 ? n - 1 : 0;\n }\n else if (start < 0) {\n start = Math.max(start + n, step < 0 ? -1 : 0);\n }\n else if (start >= n) {\n start = step < 0 ? n - 1 : n;\n }\n // Set up the `stop` value.\n if (stop === undefined) {\n stop = step < 0 ? -1 : n;\n }\n else if (stop < 0) {\n stop = Math.max(stop + n, step < 0 ? -1 : 0);\n }\n else if (stop >= n) {\n stop = step < 0 ? n - 1 : n;\n }\n // Compute the slice length.\n let length;\n if ((step < 0 && stop >= start) || (step > 0 && start >= stop)) {\n length = 0;\n }\n else if (step < 0) {\n length = Math.floor((stop - start + 1) / step + 1);\n }\n else {\n length = Math.floor((stop - start - 1) / step + 1);\n }\n // Compute the sliced result.\n let result = [];\n for (let i = 0; i < length; ++i) {\n result[i] = array[start + i * step];\n }\n // Return the result.\n return result;\n }\n ArrayExt.slice = slice;\n /**\n * Move an element in an array from one index to another.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param fromIndex - The index of the element to move. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param toIndex - The target index of the element. Negative\n * values are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `fromIndex` or `toIndex` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.move(data, 1, 2); // [0, 2, 1, 3, 4]\n * ArrayExt.move(data, 4, 2); // [0, 2, 4, 1, 3]\n * ```\n */\n function move(array, fromIndex, toIndex) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (fromIndex < 0) {\n fromIndex = Math.max(0, fromIndex + n);\n }\n else {\n fromIndex = Math.min(fromIndex, n - 1);\n }\n if (toIndex < 0) {\n toIndex = Math.max(0, toIndex + n);\n }\n else {\n toIndex = Math.min(toIndex, n - 1);\n }\n if (fromIndex === toIndex) {\n return;\n }\n let value = array[fromIndex];\n let d = fromIndex < toIndex ? 1 : -1;\n for (let i = fromIndex; i !== toIndex; i += d) {\n array[i] = array[i + d];\n }\n array[toIndex] = value;\n }\n ArrayExt.move = move;\n /**\n * Reverse an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param start - The index of the first element in the range to be\n * reversed, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * reversed, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` index which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.reverse(data, 1, 3); // [0, 3, 2, 1, 4]\n * ArrayExt.reverse(data, 3); // [0, 3, 2, 4, 1]\n * ArrayExt.reverse(data); // [1, 4, 2, 3, 0]\n * ```\n */\n function reverse(array, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n while (start < stop) {\n let a = array[start];\n let b = array[stop];\n array[start++] = b;\n array[stop--] = a;\n }\n }\n ArrayExt.reverse = reverse;\n /**\n * Rotate the elements of an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param delta - The amount of rotation to apply to the elements. A\n * positive value will rotate the elements to the left. A negative\n * value will rotate the elements to the right.\n *\n * @param start - The index of the first element in the range to be\n * rotated, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * rotated, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `delta`, `start`, or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.rotate(data, 2); // [2, 3, 4, 0, 1]\n * ArrayExt.rotate(data, -2); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 10); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 9); // [4, 0, 1, 2, 3]\n * ArrayExt.rotate(data, 2, 1, 3); // [4, 2, 0, 1, 3]\n * ```\n */\n function rotate(array, delta, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n if (start >= stop) {\n return;\n }\n let length = stop - start + 1;\n if (delta > 0) {\n delta = delta % length;\n }\n else if (delta < 0) {\n delta = ((delta % length) + length) % length;\n }\n if (delta === 0) {\n return;\n }\n let pivot = start + delta;\n reverse(array, start, pivot - 1);\n reverse(array, pivot, stop);\n reverse(array, start, stop);\n }\n ArrayExt.rotate = rotate;\n /**\n * Fill an array with a static value.\n *\n * @param array - The mutable array-like object to fill.\n *\n * @param value - The static value to use to fill the array.\n *\n * @param start - The index of the first element in the range to be\n * filled, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * filled, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Notes\n * If `stop < start` the fill will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four'];\n * ArrayExt.fill(data, 'r'); // ['r', 'r', 'r', 'r']\n * ArrayExt.fill(data, 'g', 1); // ['r', 'g', 'g', 'g']\n * ArrayExt.fill(data, 'b', 2, 3); // ['r', 'g', 'b', 'b']\n * ArrayExt.fill(data, 'z', 3, 1); // ['z', 'z', 'b', 'z']\n * ```\n */\n function fill(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n array[(start + i) % n] = value;\n }\n }\n ArrayExt.fill = fill;\n /**\n * Insert a value into an array at a specific index.\n *\n * @param array - The array of interest.\n *\n * @param index - The index at which to insert the value. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param value - The value to set at the specified index.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2];\n * ArrayExt.insert(data, 0, -1); // [-1, 0, 1, 2]\n * ArrayExt.insert(data, 2, 12); // [-1, 0, 12, 1, 2]\n * ArrayExt.insert(data, -1, 7); // [-1, 0, 12, 1, 7, 2]\n * ArrayExt.insert(data, 6, 19); // [-1, 0, 12, 1, 7, 2, 19]\n * ```\n */\n function insert(array, index, value) {\n let n = array.length;\n if (index < 0) {\n index = Math.max(0, index + n);\n }\n else {\n index = Math.min(index, n);\n }\n for (let i = n; i > index; --i) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n }\n ArrayExt.insert = insert;\n /**\n * Remove and return a value at a specific index in an array.\n *\n * @param array - The array of interest.\n *\n * @param index - The index of the value to remove. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The value at the specified index, or `undefined` if the\n * index is out of range.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeAt(data, 2); // 23\n * ArrayExt.removeAt(data, -2); // 12\n * ArrayExt.removeAt(data, 10); // undefined;\n * ```\n */\n function removeAt(array, index) {\n let n = array.length;\n if (index < 0) {\n index += n;\n }\n if (index < 0 || index >= n) {\n return undefined;\n }\n let value = array[index];\n for (let i = index + 1; i < n; ++i) {\n array[i - 1] = array[i];\n }\n array.length = n - 1;\n return value;\n }\n ArrayExt.removeAt = removeAt;\n /**\n * Remove the first occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstOf(data, 12); // 1\n * ArrayExt.removeFirstOf(data, 17); // -1\n * ArrayExt.removeFirstOf(data, 39, 3); // -1\n * ArrayExt.removeFirstOf(data, 39, 3, 2); // 2\n * ```\n */\n function removeFirstOf(array, value, start = 0, stop = -1) {\n let index = firstIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeFirstOf = removeFirstOf;\n /**\n * Remove the last occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastOf(data, 12); // 5\n * ArrayExt.removeLastOf(data, 17); // -1\n * ArrayExt.removeLastOf(data, 39, 2); // -1\n * ArrayExt.removeLastOf(data, 39, 2, 3); // 3\n * ```\n */\n function removeLastOf(array, value, start = -1, stop = 0) {\n let index = lastIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeLastOf = removeLastOf;\n /**\n * Remove all occurrences of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [14, 12, 23, 39, 14, 12, 19, 14];\n * ArrayExt.removeAllOf(data, 12); // 2\n * ArrayExt.removeAllOf(data, 17); // 0\n * ArrayExt.removeAllOf(data, 14, 1, 4); // 1\n * ```\n */\n function removeAllOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && array[i] === value) {\n count++;\n }\n else if (stop < start &&\n (i <= stop || i >= start) &&\n array[i] === value) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllOf = removeAllOf;\n /**\n * Remove the first occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstWhere(data, isEven); // { index: 0, value: 0 }\n * ArrayExt.removeFirstWhere(data, isEven, 2); // { index: 3, value: 14 }\n * ArrayExt.removeFirstWhere(data, isEven, 4); // { index: -1, value: undefined }\n * ```\n */\n function removeFirstWhere(array, fn, start = 0, stop = -1) {\n let value;\n let index = findFirstIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeFirstWhere = removeFirstWhere;\n /**\n * Remove the last occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastWhere(data, isEven); // { index: 5, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2); // { index: 1, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2, 1); // { index: -1, value: undefined }\n * ```\n */\n function removeLastWhere(array, fn, start = -1, stop = 0) {\n let value;\n let index = findLastIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeLastWhere = removeLastWhere;\n /**\n * Remove all occurrences of values which match a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * function isNegative(value: number): boolean {\n * return value < 0;\n * }\n *\n * let data = [0, 12, -13, -9, 23, 39, 14, -15, 12, 75];\n * ArrayExt.removeAllWhere(data, isEven); // 4\n * ArrayExt.removeAllWhere(data, isNegative, 0, 3); // 2\n * ```\n */\n function removeAllWhere(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && fn(array[i], i)) {\n count++;\n }\n else if (stop < start && (i <= stop || i >= start) && fn(array[i], i)) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllWhere = removeAllWhere;\n})(ArrayExt || (ArrayExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Chain together several iterables.\n *\n * @deprecated\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields the values of the iterables\n * in the order in which they are supplied.\n *\n * #### Example\n * ```typescript\n * import { chain } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = chain(data1, data2);\n *\n * Array.from(stream); // [1, 2, 3, 4, 5, 6]\n * ```\n */\nfunction* chain(...objects) {\n for (const object of objects) {\n yield* object;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an empty iterator.\n *\n * @returns A new iterator which yields nothing.\n *\n * #### Example\n * ```typescript\n * import { empty } from '@lumino/algorithm';\n *\n * let stream = empty();\n *\n * Array.from(stream); // []\n * ```\n */\n// eslint-disable-next-line require-yield\nfunction* empty() {\n return;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Enumerate an iterable object.\n *\n * @param object - The iterable object of interest.\n *\n * @param start - The starting enum value. The default is `0`.\n *\n * @returns An iterator which yields the enumerated values.\n *\n * #### Example\n * ```typescript\n * import { enumerate } from '@lumino/algorithm';\n *\n * let data = ['foo', 'bar', 'baz'];\n *\n * let stream = enumerate(data, 1);\n *\n * Array.from(stream); // [[1, 'foo'], [2, 'bar'], [3, 'baz']]\n * ```\n */\nfunction* enumerate(object, start = 0) {\n for (const value of object) {\n yield [start++, value];\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Filter an iterable for values which pass a test.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns An iterator which yields the values which pass the test.\n *\n * #### Example\n * ```typescript\n * import { filter } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = filter(data, value => value % 2 === 0);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* filter(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Find the first value in an iterable which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { find } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * find(data, isCat).name; // 'fluffy'\n * ```\n */\nfunction find(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return value;\n }\n }\n return undefined;\n}\n/**\n * Find the index of the first value which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { findIndex } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * findIndex(data, isCat); // 1\n * ```\n */\nfunction findIndex(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return index - 1;\n }\n }\n return -1;\n}\n/**\n * Find the minimum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The minimum value in the iterable. If multiple values are\n * equivalent to the minimum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { min } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * min([7, 4, 0, 3, 9, 4], numberCmp); // 0\n * ```\n */\nfunction min(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) < 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the maximum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The maximum value in the iterable. If multiple values are\n * equivalent to the maximum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { max } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * max([7, 4, 0, 3, 9, 4], numberCmp); // 9\n * ```\n */\nfunction max(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) > 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the minimum and maximum values in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns A 2-tuple of the `[min, max]` values in the iterable. If\n * multiple values are equivalent, the left-most values are returned.\n * If the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { minmax } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * minmax([7, 4, 0, 3, 9, 4], numberCmp); // [0, 9]\n * ```\n */\nfunction minmax(object, fn) {\n let empty = true;\n let vmin;\n let vmax;\n for (const value of object) {\n if (empty) {\n vmin = value;\n vmax = value;\n empty = false;\n }\n else if (fn(value, vmin) < 0) {\n vmin = value;\n }\n else if (fn(value, vmax) > 0) {\n vmax = value;\n }\n }\n return empty ? undefined : [vmin, vmax];\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an array from an iterable of values.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new array of values from the given object.\n *\n * #### Example\n * ```typescript\n * import { toArray } from '@lumino/algorithm';\n *\n * let stream = [1, 2, 3, 4, 5, 6][Symbol.iterator]();\n *\n * toArray(stream); // [1, 2, 3, 4, 5, 6];\n * ```\n */\nfunction toArray(object) {\n return Array.from(object);\n}\n/**\n * Create an object from an iterable of key/value pairs.\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new object mapping keys to values.\n *\n * #### Example\n * ```typescript\n * import { toObject } from '@lumino/algorithm';\n *\n * let data: [string, number][] = [['one', 1], ['two', 2], ['three', 3]];\n *\n * toObject(data); // { one: 1, two: 2, three: 3 }\n * ```\n */\nfunction toObject(object) {\n const result = {};\n for (const [key, value] of object) {\n result[key] = value;\n }\n return result;\n}\n/**\n * Invoke a function for each value in an iterable.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The callback function to invoke for each value.\n *\n * #### Notes\n * Iteration can be terminated early by returning `false` from the\n * callback function.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each } from '@lumino/algorithm';\n *\n * let data = [5, 7, 0, -2, 9];\n *\n * each(data, value => { console.log(value); });\n * ```\n */\nfunction each(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return;\n }\n }\n}\n/**\n * Test whether all values in an iterable satisfy a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if all values pass the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `false` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { every } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * every(data, value => value % 2 === 0); // false\n * every(data, value => value % 2 === 1); // true\n * ```\n */\nfunction every(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Test whether any value in an iterable satisfies a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if any value passes the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `true` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { some } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * some(data, value => value === 7); // true\n * some(data, value => value === 3); // false\n * ```\n */\nfunction some(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return true;\n }\n }\n return false;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Transform the values of an iterable with a mapping function.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The mapping function to invoke for each value.\n *\n * @returns An iterator which yields the transformed values.\n *\n * #### Example\n * ```typescript\n * import { map } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3];\n *\n * let stream = map(data, value => value * 2);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* map(object, fn) {\n let index = 0;\n for (const value of object) {\n yield fn(value, index++);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator of evenly spaced values.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns An iterator which produces evenly spaced values.\n *\n * #### Notes\n * In the single argument form of `range(stop)`, `start` defaults to\n * `0` and `step` defaults to `1`.\n *\n * In the two argument form of `range(start, stop)`, `step` defaults\n * to `1`.\n *\n * #### Example\n * ```typescript\n * import { range } from '@lumino/algorithm';\n *\n * let stream = range(2, 4);\n *\n * Array.from(stream); // [2, 3]\n * ```\n */\nfunction* range(start, stop, step) {\n if (stop === undefined) {\n stop = start;\n start = 0;\n step = 1;\n }\n else if (step === undefined) {\n step = 1;\n }\n const length = Private.rangeLength(start, stop, step);\n for (let index = 0; index < length; index++) {\n yield start + step * index;\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Compute the effective length of a range.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns The number of steps need to traverse the range.\n */\n function rangeLength(start, stop, step) {\n if (step === 0) {\n return Infinity;\n }\n if (start > stop && step > 0) {\n return 0;\n }\n if (start < stop && step < 0) {\n return 0;\n }\n return Math.ceil((stop - start) / step);\n }\n Private.rangeLength = rangeLength;\n})(Private || (Private = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nfunction reduce(object, fn, initial) {\n // Setup the iterator and fetch the first value.\n const it = object[Symbol.iterator]();\n let index = 0;\n let first = it.next();\n // An empty iterator and no initial value is an error.\n if (first.done && initial === undefined) {\n throw new TypeError('Reduce of empty iterable with no initial value.');\n }\n // If the iterator is empty, return the initial value.\n if (first.done) {\n return initial;\n }\n // If the iterator has a single item and no initial value, the\n // reducer is not invoked and the first item is the return value.\n let second = it.next();\n if (second.done && initial === undefined) {\n return first.value;\n }\n // If iterator has a single item and an initial value is provided,\n // the reducer is invoked and that result is the return value.\n if (second.done) {\n return fn(initial, first.value, index++);\n }\n // Setup the initial accumlated value.\n let accumulator;\n if (initial === undefined) {\n accumulator = fn(first.value, second.value, index++);\n }\n else {\n accumulator = fn(fn(initial, first.value, index++), second.value, index++);\n }\n // Iterate the rest of the values, updating the accumulator.\n let next;\n while (!(next = it.next()).done) {\n accumulator = fn(accumulator, next.value, index++);\n }\n // Return the final accumulated value.\n return accumulator;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator which repeats a value a number of times.\n *\n * @deprecated\n *\n * @param value - The value to repeat.\n *\n * @param count - The number of times to repeat the value.\n *\n * @returns A new iterator which repeats the specified value.\n *\n * #### Example\n * ```typescript\n * import { repeat } from '@lumino/algorithm';\n *\n * let stream = repeat(7, 3);\n *\n * Array.from(stream); // [7, 7, 7]\n * ```\n */\nfunction* repeat(value, count) {\n while (0 < count--) {\n yield value;\n }\n}\n/**\n * Create an iterator which yields a value a single time.\n *\n * @deprecated\n *\n * @param value - The value to wrap in an iterator.\n *\n * @returns A new iterator which yields the value a single time.\n *\n * #### Example\n * ```typescript\n * import { once } from '@lumino/algorithm';\n *\n * let stream = once(7);\n *\n * Array.from(stream); // [7]\n * ```\n */\nfunction* once(value) {\n yield value;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator for a retroable object.\n *\n * @param object - The retroable or array-like object of interest.\n *\n * @returns An iterator which traverses the object's values in reverse.\n *\n * #### Example\n * ```typescript\n * import { retro } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = retro(data);\n *\n * Array.from(stream); // [6, 5, 4, 3, 2, 1]\n * ```\n */\nfunction* retro(object) {\n if (typeof object.retro === 'function') {\n yield* object.retro();\n }\n else {\n for (let index = object.length - 1; index > -1; index--) {\n yield object[index];\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Topologically sort an iterable of edges.\n *\n * @param edges - The iterable object of edges to sort.\n * An edge is represented as a 2-tuple of `[fromNode, toNode]`.\n *\n * @returns The topologically sorted array of nodes.\n *\n * #### Notes\n * If a cycle is present in the graph, the cycle will be ignored and\n * the return value will be only approximately sorted.\n *\n * #### Example\n * ```typescript\n * import { topologicSort } from '@lumino/algorithm';\n *\n * let data = [\n * ['d', 'e'],\n * ['c', 'd'],\n * ['a', 'b'],\n * ['b', 'c']\n * ];\n *\n * topologicSort(data); // ['a', 'b', 'c', 'd', 'e']\n * ```\n */\nfunction topologicSort(edges) {\n // Setup the shared sorting state.\n let sorted = [];\n let visited = new Set();\n let graph = new Map();\n // Add the edges to the graph.\n for (const edge of edges) {\n addEdge(edge);\n }\n // Visit each node in the graph.\n for (const [k] of graph) {\n visit(k);\n }\n // Return the sorted results.\n return sorted;\n // Add an edge to the graph.\n function addEdge(edge) {\n let [fromNode, toNode] = edge;\n let children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n }\n else {\n graph.set(toNode, [fromNode]);\n }\n }\n // Recursively visit the node.\n function visit(node) {\n if (visited.has(node)) {\n return;\n }\n visited.add(node);\n let children = graph.get(node);\n if (children) {\n for (const child of children) {\n visit(child);\n }\n }\n sorted.push(node);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate over an iterable using a stepped increment.\n *\n * @param object - The iterable object of interest.\n *\n * @param step - The distance to step on each iteration. A value\n * of less than `1` will behave the same as a value of `1`.\n *\n * @returns An iterator which traverses the iterable step-wise.\n *\n * #### Example\n * ```typescript\n * import { stride } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = stride(data, 2);\n *\n * Array.from(stream); // [1, 3, 5];\n * ```\n */\nfunction* stride(object, step) {\n let count = 0;\n for (const value of object) {\n if (0 === count++ % step) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for string-specific algorithms.\n */\nvar StringExt;\n(function (StringExt) {\n /**\n * Find the indices of characters in a source text.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The matched indices, or `null` if there is no match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * In order for there to be a match, all of the characters in `query`\n * **must** appear in `source` in the order given by `query`.\n *\n * Characters are matched using strict `===` equality.\n */\n function findIndices(source, query, start = 0) {\n let indices = new Array(query.length);\n for (let i = 0, j = start, n = query.length; i < n; ++i, ++j) {\n j = source.indexOf(query[i], j);\n if (j === -1) {\n return null;\n }\n indices[i] = j;\n }\n return indices;\n }\n StringExt.findIndices = findIndices;\n /**\n * A string matcher which uses a sum-of-squares algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-squares approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The index of each\n * matching character is squared and added to the score. This means\n * that early and consecutive character matches are preferred, while\n * late matches are heavily penalized.\n */\n function matchSumOfSquares(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i] - start;\n score += j * j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfSquares = matchSumOfSquares;\n /**\n * A string matcher which uses a sum-of-deltas algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-deltas approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The delta between\n * the indices are summed to create the score. This means that groups\n * of matched characters are preferred, while fragmented matches are\n * penalized.\n */\n function matchSumOfDeltas(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n let last = start - 1;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i];\n score += j - last - 1;\n last = j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfDeltas = matchSumOfDeltas;\n /**\n * Highlight the matched characters of a source text.\n *\n * @param source - The text which should be highlighted.\n *\n * @param indices - The indices of the matched characters. They must\n * appear in increasing order and must be in bounds of the source.\n *\n * @param fn - The function to apply to the matched chunks.\n *\n * @returns An array of unmatched and highlighted chunks.\n */\n function highlight(source, indices, fn) {\n // Set up the result array.\n let result = [];\n // Set up the counter variables.\n let k = 0;\n let last = 0;\n let n = indices.length;\n // Iterator over each index.\n while (k < n) {\n // Set up the chunk indices.\n let i = indices[k];\n let j = indices[k];\n // Advance the right chunk index until it's non-contiguous.\n while (++k < n && indices[k] === j + 1) {\n j++;\n }\n // Extract the unmatched text.\n if (last < i) {\n result.push(source.slice(last, i));\n }\n // Extract and highlight the matched text.\n if (i < j + 1) {\n result.push(fn(source.slice(i, j + 1)));\n }\n // Update the last visited index.\n last = j + 1;\n }\n // Extract any remaining unmatched text.\n if (last < source.length) {\n result.push(source.slice(last));\n }\n // Return the highlighted result.\n return result;\n }\n StringExt.highlight = highlight;\n /**\n * A 3-way string comparison function.\n *\n * @param a - The first string of interest.\n *\n * @param b - The second string of interest.\n *\n * @returns `-1` if `a < b`, else `1` if `a > b`, else `0`.\n */\n function cmp(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n }\n StringExt.cmp = cmp;\n})(StringExt || (StringExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Take a fixed number of items from an iterable.\n *\n * @param object - The iterable object of interest.\n *\n * @param count - The number of items to take from the iterable.\n *\n * @returns An iterator which yields the specified number of items\n * from the source iterable.\n *\n * #### Notes\n * The returned iterator will exhaust early if the source iterable\n * contains an insufficient number of items.\n *\n * #### Example\n * ```typescript\n * import { take } from '@lumino/algorithm';\n *\n * let stream = take([5, 4, 3, 2, 1, 0, -1], 3);\n *\n * Array.from(stream); // [5, 4, 3]\n * ```\n */\nfunction* take(object, count) {\n if (count < 1) {\n return;\n }\n const it = object[Symbol.iterator]();\n let item;\n while (0 < count-- && !(item = it.next()).done) {\n yield item.value;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate several iterables in lockstep.\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields successive tuples of values where\n * each value is taken in turn from the provided iterables. It will\n * be as long as the shortest provided iterable.\n *\n * #### Example\n * ```typescript\n * import { zip } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = zip(data1, data2);\n *\n * Array.from(stream); // [[1, 4], [2, 5], [3, 6]]\n * ```\n */\nfunction* zip(...objects) {\n const iters = objects.map(obj => obj[Symbol.iterator]());\n let tuple = iters.map(it => it.next());\n for (; every(tuple, item => !item.done); tuple = iters.map(it => it.next())) {\n yield tuple.map(item => item.value);\n }\n}\n\nexport { ArrayExt, StringExt, chain, each, empty, enumerate, every, filter, find, findIndex, map, max, min, minmax, once, range, reduce, repeat, retro, some, stride, take, toArray, toObject, topologicSort, zip };\n//# sourceMappingURL=index.es6.js.map\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2019, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for clipboard related functionality.\n */\nvar ClipboardExt;\n(function (ClipboardExt) {\n /**\n * Copy text to the system clipboard.\n *\n * @param text - The text to copy to the clipboard.\n */\n function copyText(text) {\n // Fetch the document body.\n const body = document.body;\n // Set up the clipboard event listener.\n const handler = (event) => {\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Set the clipboard data.\n event.clipboardData.setData('text', text);\n // Remove the event listener.\n body.removeEventListener('copy', handler, true);\n };\n // Add the event listener.\n body.addEventListener('copy', handler, true);\n // Trigger the event.\n document.execCommand('copy');\n }\n ClipboardExt.copyText = copyText;\n})(ClipboardExt || (ClipboardExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for element related utilities.\n */\nvar ElementExt;\n(function (ElementExt) {\n /**\n * Compute the box sizing for an element.\n *\n * @param element - The element of interest.\n *\n * @returns The box sizing data for the specified element.\n */\n function boxSizing(element) {\n let style = window.getComputedStyle(element);\n let bt = parseFloat(style.borderTopWidth) || 0;\n let bl = parseFloat(style.borderLeftWidth) || 0;\n let br = parseFloat(style.borderRightWidth) || 0;\n let bb = parseFloat(style.borderBottomWidth) || 0;\n let pt = parseFloat(style.paddingTop) || 0;\n let pl = parseFloat(style.paddingLeft) || 0;\n let pr = parseFloat(style.paddingRight) || 0;\n let pb = parseFloat(style.paddingBottom) || 0;\n let hs = bl + pl + pr + br;\n let vs = bt + pt + pb + bb;\n return {\n borderTop: bt,\n borderLeft: bl,\n borderRight: br,\n borderBottom: bb,\n paddingTop: pt,\n paddingLeft: pl,\n paddingRight: pr,\n paddingBottom: pb,\n horizontalSum: hs,\n verticalSum: vs\n };\n }\n ElementExt.boxSizing = boxSizing;\n /**\n * Compute the size limits for an element.\n *\n * @param element - The element of interest.\n *\n * @returns The size limit data for the specified element.\n */\n function sizeLimits(element) {\n let style = window.getComputedStyle(element);\n let minWidth = parseFloat(style.minWidth) || 0;\n let minHeight = parseFloat(style.minHeight) || 0;\n let maxWidth = parseFloat(style.maxWidth) || Infinity;\n let maxHeight = parseFloat(style.maxHeight) || Infinity;\n maxWidth = Math.max(minWidth, maxWidth);\n maxHeight = Math.max(minHeight, maxHeight);\n return { minWidth, minHeight, maxWidth, maxHeight };\n }\n ElementExt.sizeLimits = sizeLimits;\n /**\n * Test whether a client position lies within an element.\n *\n * @param element - The DOM element of interest.\n *\n * @param clientX - The client X coordinate of interest.\n *\n * @param clientY - The client Y coordinate of interest.\n *\n * @returns Whether the point is within the given element.\n */\n function hitTest(element, clientX, clientY) {\n let rect = element.getBoundingClientRect();\n return (clientX >= rect.left &&\n clientX < rect.right &&\n clientY >= rect.top &&\n clientY < rect.bottom);\n }\n ElementExt.hitTest = hitTest;\n /**\n * Vertically scroll an element into view if needed.\n *\n * @param area - The scroll area element.\n *\n * @param element - The element of interest.\n *\n * #### Notes\n * This follows the \"nearest\" behavior of the native `scrollIntoView`\n * method, which is not supported by all browsers.\n * https://drafts.csswg.org/cssom-view/#element-scrolling-members\n *\n * If the element fully covers the visible area or is fully contained\n * within the visible area, no scrolling will take place. Otherwise,\n * the nearest edges of the area and element are aligned.\n */\n function scrollIntoViewIfNeeded(area, element) {\n let ar = area.getBoundingClientRect();\n let er = element.getBoundingClientRect();\n if (er.top <= ar.top && er.bottom >= ar.bottom) {\n return;\n }\n if (er.top < ar.top && er.height <= ar.height) {\n area.scrollTop -= ar.top - er.top;\n return;\n }\n if (er.bottom > ar.bottom && er.height >= ar.height) {\n area.scrollTop -= ar.top - er.top;\n return;\n }\n if (er.top < ar.top && er.height > ar.height) {\n area.scrollTop -= ar.bottom - er.bottom;\n return;\n }\n if (er.bottom > ar.bottom && er.height < ar.height) {\n area.scrollTop -= ar.bottom - er.bottom;\n return;\n }\n }\n ElementExt.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded;\n})(ElementExt || (ElementExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for platform related utilities.\n */\nvar Platform;\n(function (Platform) {\n /**\n * A flag indicating whether the platform is Mac.\n */\n Platform.IS_MAC = !!navigator.platform.match(/Mac/i);\n /**\n * A flag indicating whether the platform is Windows.\n */\n Platform.IS_WIN = !!navigator.platform.match(/Win/i);\n /**\n * A flag indicating whether the browser is IE.\n */\n Platform.IS_IE = /Trident/.test(navigator.userAgent);\n /**\n * A flag indicating whether the browser is Edge.\n */\n Platform.IS_EDGE = /Edge/.test(navigator.userAgent);\n /**\n * Test whether the `accel` key is pressed.\n *\n * @param event - The keyboard or mouse event of interest.\n *\n * @returns Whether the `accel` key is pressed.\n *\n * #### Notes\n * On Mac the `accel` key is the command key. On all other\n * platforms the `accel` key is the control key.\n */\n function accelKey(event) {\n return Platform.IS_MAC ? event.metaKey : event.ctrlKey;\n }\n Platform.accelKey = accelKey;\n})(Platform || (Platform = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for selector related utilities.\n */\nvar Selector;\n(function (Selector) {\n /**\n * Calculate the specificity of a single CSS selector.\n *\n * @param selector - The CSS selector of interest.\n *\n * @returns The specificity of the selector.\n *\n * #### Undefined Behavior\n * The selector is invalid.\n *\n * #### Notes\n * This is based on https://www.w3.org/TR/css3-selectors/#specificity\n *\n * A larger number represents a more specific selector.\n *\n * The smallest possible specificity is `0`.\n *\n * The result is represented as a hex number `0x` where\n * each component is the count of the respective selector clause.\n *\n * If the selector contains commas, only the first clause is used.\n *\n * The computed result is cached, so subsequent calculations for the\n * same selector are extremely fast.\n */\n function calculateSpecificity(selector) {\n if (selector in Private.specificityCache) {\n return Private.specificityCache[selector];\n }\n let result = Private.calculateSingle(selector);\n return (Private.specificityCache[selector] = result);\n }\n Selector.calculateSpecificity = calculateSpecificity;\n /**\n * Test whether a selector is a valid CSS selector.\n *\n * @param selector - The CSS selector of interest.\n *\n * @returns `true` if the selector is valid, `false` otherwise.\n *\n * #### Notes\n * The computed result is cached, so subsequent tests for the same\n * selector are extremely fast.\n */\n function isValid(selector) {\n if (selector in Private.validityCache) {\n return Private.validityCache[selector];\n }\n let result = true;\n try {\n Private.testElem.querySelector(selector);\n }\n catch (err) {\n result = false;\n }\n return (Private.validityCache[selector] = result);\n }\n Selector.isValid = isValid;\n /**\n * Test whether an element matches a CSS selector.\n *\n * @param element - The element of interest.\n *\n * @param selector - The valid CSS selector of interest.\n *\n * @returns `true` if the element is a match, `false` otherwise.\n *\n * #### Notes\n * This function uses the builtin browser capabilities when possible,\n * falling back onto a document query otherwise.\n */\n function matches(element, selector) {\n return Private.protoMatchFunc.call(element, selector);\n }\n Selector.matches = matches;\n})(Selector || (Selector = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A cache of computed selector specificity values.\n */\n Private.specificityCache = Object.create(null);\n /**\n * A cache of computed selector validity.\n */\n Private.validityCache = Object.create(null);\n /**\n * An empty element for testing selector validity.\n */\n Private.testElem = document.createElement('div');\n /**\n * A cross-browser CSS selector matching prototype function.\n */\n Private.protoMatchFunc = (() => {\n let proto = Element.prototype;\n return (proto.matches ||\n proto.matchesSelector ||\n proto.mozMatchesSelector ||\n proto.msMatchesSelector ||\n proto.oMatchesSelector ||\n proto.webkitMatchesSelector ||\n function (selector) {\n let elem = this;\n let matches = elem.ownerDocument\n ? elem.ownerDocument.querySelectorAll(selector)\n : [];\n return Array.prototype.indexOf.call(matches, elem) !== -1;\n });\n })();\n /**\n * Calculate the specificity of a single selector.\n *\n * The behavior is undefined if the selector is invalid.\n */\n function calculateSingle(selector) {\n // Ignore anything after the first comma.\n selector = selector.split(',', 1)[0];\n // Setup the aggregate counters.\n let a = 0;\n let b = 0;\n let c = 0;\n // Apply a regex to the front of the selector. If it succeeds, that\n // portion of the selector is removed. Returns a success/fail flag.\n function match(re) {\n let match = selector.match(re);\n if (match === null) {\n return false;\n }\n selector = selector.slice(match[0].length);\n return true;\n }\n // Replace the negation pseudo-class (which is ignored),\n // but keep its inner content (which is not ignored).\n selector = selector.replace(NEGATION_RE, ' $1 ');\n // Continue matching until the selector is consumed.\n while (selector.length > 0) {\n // Match an ID selector.\n if (match(ID_RE)) {\n a++;\n continue;\n }\n // Match a class selector.\n if (match(CLASS_RE)) {\n b++;\n continue;\n }\n // Match an attribute selector.\n if (match(ATTR_RE)) {\n b++;\n continue;\n }\n // Match a pseudo-element selector. This is done before matching\n // a pseudo-class since this regex overlaps with that regex.\n if (match(PSEUDO_ELEM_RE)) {\n c++;\n continue;\n }\n // Match a pseudo-class selector.\n if (match(PSEDUO_CLASS_RE)) {\n b++;\n continue;\n }\n // Match a plain type selector.\n if (match(TYPE_RE)) {\n c++;\n continue;\n }\n // Finally, match any ignored characters.\n if (match(IGNORE_RE)) {\n continue;\n }\n // At this point, the selector is assumed to be invalid.\n return 0;\n }\n // Clamp each component to a reasonable base.\n a = Math.min(a, 0xff);\n b = Math.min(b, 0xff);\n c = Math.min(c, 0xff);\n // Combine the components into a single result.\n return (a << 16) | (b << 8) | c;\n }\n Private.calculateSingle = calculateSingle;\n /**\n * A regex which matches an ID selector at string start.\n */\n const ID_RE = /^#[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches a class selector at string start.\n */\n const CLASS_RE = /^\\.[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches an attribute selector at string start.\n */\n const ATTR_RE = /^\\[[^\\]]+\\]/;\n /**\n * A regex which matches a type selector at string start.\n */\n const TYPE_RE = /^[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches a pseudo-element selector at string start.\n */\n const PSEUDO_ELEM_RE = /^(::[^\\s\\+>~#\\.\\[:]+|:first-line|:first-letter|:before|:after)/;\n /**\n * A regex which matches a pseudo-class selector at string start.\n */\n const PSEDUO_CLASS_RE = /^:[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches ignored characters at string start.\n */\n const IGNORE_RE = /^[\\s\\+>~\\*]+/;\n /**\n * A regex which matches the negation pseudo-class globally.\n */\n const NEGATION_RE = /:not\\(([^\\)]+)\\)/g;\n})(Private || (Private = {}));\n\nexport { ClipboardExt, ElementExt, Platform, Selector };\n//# sourceMappingURL=index.es6.js.map\n","/**\n * A generic doubly-linked list.\n */\nclass LinkedList {\n constructor() {\n this._first = null;\n this._last = null;\n this._size = 0;\n }\n /**\n * Whether the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get isEmpty() {\n return this._size === 0;\n }\n /**\n * The size of the list.\n *\n * #### Complexity\n * `O(1)`\n *\n * #### Notes\n * This is equivalent to `length`.\n */\n get size() {\n return this._size;\n }\n /**\n * The length of the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `size`.\n *\n * This property is deprecated.\n */\n get length() {\n return this._size;\n }\n /**\n * The first value in the list.\n *\n * This is `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get first() {\n return this._first ? this._first.value : undefined;\n }\n /**\n * The last value in the list.\n *\n * This is `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get last() {\n return this._last ? this._last.value : undefined;\n }\n /**\n * The first node in the list.\n *\n * This is `null` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get firstNode() {\n return this._first;\n }\n /**\n * The last node in the list.\n *\n * This is `null` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get lastNode() {\n return this._last;\n }\n /**\n * Create an iterator over the values in the list.\n *\n * @returns A new iterator starting with the first value.\n *\n * #### Complexity\n * Constant.\n */\n *[Symbol.iterator]() {\n let node = this._first;\n while (node) {\n yield node.value;\n node = node.next;\n }\n }\n /**\n * Create a reverse iterator over the values in the list.\n *\n * @returns A new iterator starting with the last value.\n *\n * #### Complexity\n * Constant.\n */\n *retro() {\n let node = this._last;\n while (node) {\n yield node.value;\n node = node.prev;\n }\n }\n /**\n * Create an iterator over the nodes in the list.\n *\n * @returns A new iterator starting with the first node.\n *\n * #### Complexity\n * Constant.\n */\n *nodes() {\n let node = this._first;\n while (node) {\n yield node;\n node = node.next;\n }\n }\n /**\n * Create a reverse iterator over the nodes in the list.\n *\n * @returns A new iterator starting with the last node.\n *\n * #### Complexity\n * Constant.\n */\n *retroNodes() {\n let node = this._last;\n while (node) {\n yield node;\n node = node.prev;\n }\n }\n /**\n * Assign new values to the list, replacing all current values.\n *\n * @param values - The values to assign to the list.\n *\n * #### Complexity\n * Linear.\n */\n assign(values) {\n this.clear();\n for (const value of values) {\n this.addLast(value);\n }\n }\n /**\n * Add a value to the end of the list.\n *\n * @param value - The value to add to the end of the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `addLast`.\n */\n push(value) {\n this.addLast(value);\n }\n /**\n * Remove and return the value at the end of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `removeLast`.\n */\n pop() {\n return this.removeLast();\n }\n /**\n * Add a value to the beginning of the list.\n *\n * @param value - The value to add to the beginning of the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `addFirst`.\n */\n shift(value) {\n this.addFirst(value);\n }\n /**\n * Remove and return the value at the beginning of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `removeFirst`.\n */\n unshift() {\n return this.removeFirst();\n }\n /**\n * Add a value to the beginning of the list.\n *\n * @param value - The value to add to the beginning of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Complexity\n * Constant.\n */\n addFirst(value) {\n let node = new Private.LinkedListNode(this, value);\n if (!this._first) {\n this._first = node;\n this._last = node;\n }\n else {\n node.next = this._first;\n this._first.prev = node;\n this._first = node;\n }\n this._size++;\n return node;\n }\n /**\n * Add a value to the end of the list.\n *\n * @param value - The value to add to the end of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Complexity\n * Constant.\n */\n addLast(value) {\n let node = new Private.LinkedListNode(this, value);\n if (!this._last) {\n this._first = node;\n this._last = node;\n }\n else {\n node.prev = this._last;\n this._last.next = node;\n this._last = node;\n }\n this._size++;\n return node;\n }\n /**\n * Insert a value before a specific node in the list.\n *\n * @param value - The value to insert before the reference node.\n *\n * @param ref - The reference node of interest. If this is `null`,\n * the value will be added to the beginning of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Notes\n * The reference node must be owned by the list.\n *\n * #### Complexity\n * Constant.\n */\n insertBefore(value, ref) {\n if (!ref || ref === this._first) {\n return this.addFirst(value);\n }\n if (!(ref instanceof Private.LinkedListNode) || ref.list !== this) {\n throw new Error('Reference node is not owned by the list.');\n }\n let node = new Private.LinkedListNode(this, value);\n let _ref = ref;\n let prev = _ref.prev;\n node.next = _ref;\n node.prev = prev;\n _ref.prev = node;\n prev.next = node;\n this._size++;\n return node;\n }\n /**\n * Insert a value after a specific node in the list.\n *\n * @param value - The value to insert after the reference node.\n *\n * @param ref - The reference node of interest. If this is `null`,\n * the value will be added to the end of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Notes\n * The reference node must be owned by the list.\n *\n * #### Complexity\n * Constant.\n */\n insertAfter(value, ref) {\n if (!ref || ref === this._last) {\n return this.addLast(value);\n }\n if (!(ref instanceof Private.LinkedListNode) || ref.list !== this) {\n throw new Error('Reference node is not owned by the list.');\n }\n let node = new Private.LinkedListNode(this, value);\n let _ref = ref;\n let next = _ref.next;\n node.next = next;\n node.prev = _ref;\n _ref.next = node;\n next.prev = node;\n this._size++;\n return node;\n }\n /**\n * Remove and return the value at the beginning of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n removeFirst() {\n let node = this._first;\n if (!node) {\n return undefined;\n }\n if (node === this._last) {\n this._first = null;\n this._last = null;\n }\n else {\n this._first = node.next;\n this._first.prev = null;\n }\n node.list = null;\n node.next = null;\n node.prev = null;\n this._size--;\n return node.value;\n }\n /**\n * Remove and return the value at the end of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n removeLast() {\n let node = this._last;\n if (!node) {\n return undefined;\n }\n if (node === this._first) {\n this._first = null;\n this._last = null;\n }\n else {\n this._last = node.prev;\n this._last.next = null;\n }\n node.list = null;\n node.next = null;\n node.prev = null;\n this._size--;\n return node.value;\n }\n /**\n * Remove a specific node from the list.\n *\n * @param node - The node to remove from the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * The node must be owned by the list.\n */\n removeNode(node) {\n if (!(node instanceof Private.LinkedListNode) || node.list !== this) {\n throw new Error('Node is not owned by the list.');\n }\n let _node = node;\n if (_node === this._first && _node === this._last) {\n this._first = null;\n this._last = null;\n }\n else if (_node === this._first) {\n this._first = _node.next;\n this._first.prev = null;\n }\n else if (_node === this._last) {\n this._last = _node.prev;\n this._last.next = null;\n }\n else {\n _node.next.prev = _node.prev;\n _node.prev.next = _node.next;\n }\n _node.list = null;\n _node.next = null;\n _node.prev = null;\n this._size--;\n }\n /**\n * Remove all values from the list.\n *\n * #### Complexity\n * Linear.\n */\n clear() {\n let node = this._first;\n while (node) {\n let next = node.next;\n node.list = null;\n node.prev = null;\n node.next = null;\n node = next;\n }\n this._first = null;\n this._last = null;\n this._size = 0;\n }\n}\n/**\n * The namespace for the `LinkedList` class statics.\n */\n(function (LinkedList) {\n /**\n * Create a linked list from an iterable of values.\n *\n * @param values - The iterable object of interest.\n *\n * @returns A new linked list initialized with the given values.\n *\n * #### Complexity\n * Linear.\n */\n function from(values) {\n let list = new LinkedList();\n list.assign(values);\n return list;\n }\n LinkedList.from = from;\n})(LinkedList || (LinkedList = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The internal linked list node implementation.\n */\n class LinkedListNode {\n /**\n * Construct a new linked list node.\n *\n * @param list - The list which owns the node.\n *\n * @param value - The value for the link.\n */\n constructor(list, value) {\n /**\n * The linked list which created and owns the node.\n */\n this.list = null;\n /**\n * The next node in the list.\n */\n this.next = null;\n /**\n * The previous node in the list.\n */\n this.prev = null;\n this.list = list;\n this.value = value;\n }\n }\n Private.LinkedListNode = LinkedListNode;\n})(Private || (Private = {}));\n\nexport { LinkedList };\n//# sourceMappingURL=index.es6.js.map\n","import { every, retro, some, ArrayExt } from '@lumino/algorithm';\nimport { LinkedList } from '@lumino/collections';\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module messaging\n */\n/**\n * A message which can be delivered to a message handler.\n *\n * #### Notes\n * This class may be subclassed to create complex message types.\n */\nclass Message {\n /**\n * Construct a new message.\n *\n * @param type - The type of the message.\n */\n constructor(type) {\n this.type = type;\n }\n /**\n * Test whether the message is conflatable.\n *\n * #### Notes\n * Message conflation is an advanced topic. Most message types will\n * not make use of this feature.\n *\n * If a conflatable message is posted to a handler while another\n * conflatable message of the same `type` has already been posted\n * to the handler, the `conflate()` method of the existing message\n * will be invoked. If that method returns `true`, the new message\n * will not be enqueued. This allows messages to be compressed, so\n * that only a single instance of the message type is processed per\n * cycle, no matter how many times messages of that type are posted.\n *\n * Custom message types may reimplement this property.\n *\n * The default implementation is always `false`.\n */\n get isConflatable() {\n return false;\n }\n /**\n * Conflate this message with another message of the same `type`.\n *\n * @param other - A conflatable message of the same `type`.\n *\n * @returns `true` if the message was successfully conflated, or\n * `false` otherwise.\n *\n * #### Notes\n * Message conflation is an advanced topic. Most message types will\n * not make use of this feature.\n *\n * This method is called automatically by the message loop when the\n * given message is posted to the handler paired with this message.\n * This message will already be enqueued and conflatable, and the\n * given message will have the same `type` and also be conflatable.\n *\n * This method should merge the state of the other message into this\n * message as needed so that when this message is finally delivered\n * to the handler, it receives the most up-to-date information.\n *\n * If this method returns `true`, it signals that the other message\n * was successfully conflated and that message will not be enqueued.\n *\n * If this method returns `false`, the other message will be enqueued\n * for normal delivery.\n *\n * Custom message types may reimplement this method.\n *\n * The default implementation always returns `false`.\n */\n conflate(other) {\n return false;\n }\n}\n/**\n * A convenience message class which conflates automatically.\n *\n * #### Notes\n * Message conflation is an advanced topic. Most user code will not\n * make use of this class.\n *\n * This message class is useful for creating message instances which\n * should be conflated, but which have no state other than `type`.\n *\n * If conflation of stateful messages is required, a custom `Message`\n * subclass should be created.\n */\nclass ConflatableMessage extends Message {\n /**\n * Test whether the message is conflatable.\n *\n * #### Notes\n * This property is always `true`.\n */\n get isConflatable() {\n return true;\n }\n /**\n * Conflate this message with another message of the same `type`.\n *\n * #### Notes\n * This method always returns `true`.\n */\n conflate(other) {\n return true;\n }\n}\n/**\n * The namespace for the global singleton message loop.\n */\nvar MessageLoop;\n(function (MessageLoop) {\n /**\n * A function that cancels the pending loop task; `null` if unavailable.\n */\n let pending = null;\n /**\n * Schedules a function for invocation as soon as possible asynchronously.\n *\n * @param fn The function to invoke when called back.\n *\n * @returns An anonymous function that will unschedule invocation if possible.\n */\n const schedule = (resolved => (fn) => {\n let rejected = false;\n resolved.then(() => !rejected && fn());\n return () => {\n rejected = true;\n };\n })(Promise.resolve());\n /**\n * Send a message to a message handler to process immediately.\n *\n * @param handler - The handler which should process the message.\n *\n * @param msg - The message to deliver to the handler.\n *\n * #### Notes\n * The message will first be sent through any installed message hooks\n * for the handler. If the message passes all hooks, it will then be\n * delivered to the `processMessage` method of the handler.\n *\n * The message will not be conflated with pending posted messages.\n *\n * Exceptions in hooks and handlers will be caught and logged.\n */\n function sendMessage(handler, msg) {\n // Lookup the message hooks for the handler.\n let hooks = messageHooks.get(handler);\n // Handle the common case of no installed hooks.\n if (!hooks || hooks.length === 0) {\n invokeHandler(handler, msg);\n return;\n }\n // Invoke the message hooks starting with the newest first.\n let passed = every(retro(hooks), hook => {\n return hook ? invokeHook(hook, handler, msg) : true;\n });\n // Invoke the handler if the message passes all hooks.\n if (passed) {\n invokeHandler(handler, msg);\n }\n }\n MessageLoop.sendMessage = sendMessage;\n /**\n * Post a message to a message handler to process in the future.\n *\n * @param handler - The handler which should process the message.\n *\n * @param msg - The message to post to the handler.\n *\n * #### Notes\n * The message will be conflated with the pending posted messages for\n * the handler, if possible. If the message is not conflated, it will\n * be queued for normal delivery on the next cycle of the event loop.\n *\n * Exceptions in hooks and handlers will be caught and logged.\n */\n function postMessage(handler, msg) {\n // Handle the common case of a non-conflatable message.\n if (!msg.isConflatable) {\n enqueueMessage(handler, msg);\n return;\n }\n // Conflate the message with an existing message if possible.\n let conflated = some(messageQueue, posted => {\n if (posted.handler !== handler) {\n return false;\n }\n if (!posted.msg) {\n return false;\n }\n if (posted.msg.type !== msg.type) {\n return false;\n }\n if (!posted.msg.isConflatable) {\n return false;\n }\n return posted.msg.conflate(msg);\n });\n // Enqueue the message if it was not conflated.\n if (!conflated) {\n enqueueMessage(handler, msg);\n }\n }\n MessageLoop.postMessage = postMessage;\n /**\n * Install a message hook for a message handler.\n *\n * @param handler - The message handler of interest.\n *\n * @param hook - The message hook to install.\n *\n * #### Notes\n * A message hook is invoked before a message is delivered to the\n * handler. If the hook returns `false`, no other hooks will be\n * invoked and the message will not be delivered to the handler.\n *\n * The most recently installed message hook is executed first.\n *\n * If the hook is already installed, this is a no-op.\n */\n function installMessageHook(handler, hook) {\n // Look up the hooks for the handler.\n let hooks = messageHooks.get(handler);\n // Bail early if the hook is already installed.\n if (hooks && hooks.indexOf(hook) !== -1) {\n return;\n }\n // Add the hook to the end, so it will be the first to execute.\n if (!hooks) {\n messageHooks.set(handler, [hook]);\n }\n else {\n hooks.push(hook);\n }\n }\n MessageLoop.installMessageHook = installMessageHook;\n /**\n * Remove an installed message hook for a message handler.\n *\n * @param handler - The message handler of interest.\n *\n * @param hook - The message hook to remove.\n *\n * #### Notes\n * It is safe to call this function while the hook is executing.\n *\n * If the hook is not installed, this is a no-op.\n */\n function removeMessageHook(handler, hook) {\n // Lookup the hooks for the handler.\n let hooks = messageHooks.get(handler);\n // Bail early if the hooks do not exist.\n if (!hooks) {\n return;\n }\n // Lookup the index of the hook and bail if not found.\n let i = hooks.indexOf(hook);\n if (i === -1) {\n return;\n }\n // Clear the hook and schedule a cleanup of the array.\n hooks[i] = null;\n scheduleCleanup(hooks);\n }\n MessageLoop.removeMessageHook = removeMessageHook;\n /**\n * Clear all message data associated with a message handler.\n *\n * @param handler - The message handler of interest.\n *\n * #### Notes\n * This will clear all posted messages and hooks for the handler.\n */\n function clearData(handler) {\n // Lookup the hooks for the handler.\n let hooks = messageHooks.get(handler);\n // Clear all messsage hooks for the handler.\n if (hooks && hooks.length > 0) {\n ArrayExt.fill(hooks, null);\n scheduleCleanup(hooks);\n }\n // Clear all posted messages for the handler.\n for (const posted of messageQueue) {\n if (posted.handler === handler) {\n posted.handler = null;\n posted.msg = null;\n }\n }\n }\n MessageLoop.clearData = clearData;\n /**\n * Process the pending posted messages in the queue immediately.\n *\n * #### Notes\n * This function is useful when posted messages must be processed immediately.\n *\n * This function should normally not be needed, but it may be\n * required to work around certain browser idiosyncrasies.\n *\n * Recursing into this function is a no-op.\n */\n function flush() {\n // Bail if recursion is detected or if there is no pending task.\n if (flushGuard || pending === null) {\n return;\n }\n // Unschedule the pending loop task.\n pending();\n pending = null;\n // Run the message loop within the recursion guard.\n flushGuard = true;\n runMessageLoop();\n flushGuard = false;\n }\n MessageLoop.flush = flush;\n /**\n * Get the message loop exception handler.\n *\n * @returns The current exception handler.\n *\n * #### Notes\n * The default exception handler is `console.error`.\n */\n function getExceptionHandler() {\n return exceptionHandler;\n }\n MessageLoop.getExceptionHandler = getExceptionHandler;\n /**\n * Set the message loop exception handler.\n *\n * @param handler - The function to use as the exception handler.\n *\n * @returns The old exception handler.\n *\n * #### Notes\n * The exception handler is invoked when a message handler or a\n * message hook throws an exception.\n */\n function setExceptionHandler(handler) {\n let old = exceptionHandler;\n exceptionHandler = handler;\n return old;\n }\n MessageLoop.setExceptionHandler = setExceptionHandler;\n /**\n * The queue of posted message pairs.\n */\n const messageQueue = new LinkedList();\n /**\n * A mapping of handler to array of installed message hooks.\n */\n const messageHooks = new WeakMap();\n /**\n * A set of message hook arrays which are pending cleanup.\n */\n const dirtySet = new Set();\n /**\n * The message loop exception handler.\n */\n let exceptionHandler = (err) => {\n console.error(err);\n };\n /**\n * A guard flag to prevent flush recursion.\n */\n let flushGuard = false;\n /**\n * Invoke a message hook with the specified handler and message.\n *\n * Returns the result of the hook, or `true` if the hook throws.\n *\n * Exceptions in the hook will be caught and logged.\n */\n function invokeHook(hook, handler, msg) {\n let result = true;\n try {\n if (typeof hook === 'function') {\n result = hook(handler, msg);\n }\n else {\n result = hook.messageHook(handler, msg);\n }\n }\n catch (err) {\n exceptionHandler(err);\n }\n return result;\n }\n /**\n * Invoke a message handler with the specified message.\n *\n * Exceptions in the handler will be caught and logged.\n */\n function invokeHandler(handler, msg) {\n try {\n handler.processMessage(msg);\n }\n catch (err) {\n exceptionHandler(err);\n }\n }\n /**\n * Add a message to the end of the message queue.\n *\n * This will automatically schedule a run of the message loop.\n */\n function enqueueMessage(handler, msg) {\n // Add the posted message to the queue.\n messageQueue.addLast({ handler, msg });\n // Bail if a loop task is already pending.\n if (pending !== null) {\n return;\n }\n // Schedule a run of the message loop.\n pending = schedule(runMessageLoop);\n }\n /**\n * Run an iteration of the message loop.\n *\n * This will process all pending messages in the queue. If a message\n * is added to the queue while the message loop is running, it will\n * be processed on the next cycle of the loop.\n */\n function runMessageLoop() {\n // Clear the task so the next loop can be scheduled.\n pending = null;\n // If the message queue is empty, there is nothing else to do.\n if (messageQueue.isEmpty) {\n return;\n }\n // Add a sentinel value to the end of the queue. The queue will\n // only be processed up to the sentinel. Messages posted during\n // this cycle will execute on the next cycle.\n let sentinel = { handler: null, msg: null };\n messageQueue.addLast(sentinel);\n // Enter the message loop.\n // eslint-disable-next-line no-constant-condition\n while (true) {\n // Remove the first posted message in the queue.\n let posted = messageQueue.removeFirst();\n // If the value is the sentinel, exit the loop.\n if (posted === sentinel) {\n return;\n }\n // Dispatch the message if it has not been cleared.\n if (posted.handler && posted.msg) {\n sendMessage(posted.handler, posted.msg);\n }\n }\n }\n /**\n * Schedule a cleanup of a message hooks array.\n *\n * This will add the array to the dirty set and schedule a deferred\n * cleanup of the array contents. On cleanup, any `null` hook will\n * be removed from the array.\n */\n function scheduleCleanup(hooks) {\n if (dirtySet.size === 0) {\n schedule(cleanupDirtySet);\n }\n dirtySet.add(hooks);\n }\n /**\n * Cleanup the message hook arrays in the dirty set.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupDirtySet() {\n dirtySet.forEach(cleanupHooks);\n dirtySet.clear();\n }\n /**\n * Cleanup the dirty hooks in a message hooks array.\n *\n * This will remove any `null` hook from the array.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupHooks(hooks) {\n ArrayExt.removeAllWhere(hooks, isNull);\n }\n /**\n * Test whether a value is `null`.\n */\n function isNull(value) {\n return value === null;\n }\n})(MessageLoop || (MessageLoop = {}));\n\nexport { ConflatableMessage, Message, MessageLoop };\n//# sourceMappingURL=index.es6.js.map\n","import { DisposableDelegate } from '@lumino/disposable';\n\n/**\n * An object which manages a drag-drop operation.\n *\n * A drag object dispatches four different events to drop targets:\n *\n * - `'lm-dragenter'` - Dispatched when the mouse enters the target\n * element. This event must be canceled in order to receive any\n * of the other events.\n *\n * - `'lm-dragover'` - Dispatched when the mouse moves over the drop\n * target. It must cancel the event and set the `dropAction` to one\n * of the supported actions in order to receive drop events.\n *\n * - `'lm-dragleave'` - Dispatched when the mouse leaves the target\n * element. This includes moving the mouse into child elements.\n *\n * - `'lm-drop'`- Dispatched when the mouse is released over the target\n * element when the target indicates an appropriate drop action. If\n * the event is canceled, the indicated drop action is returned to\n * the initiator through the resolved promise.\n *\n * A drag operation can be terminated at any time by pressing `Escape`\n * or by disposing the drag object.\n *\n * A drag object has the ability to automatically scroll a scrollable\n * element when the mouse is hovered near one of its edges. To enable\n * this, add the `data-lm-dragscroll` attribute to any element which\n * the drag object should consider for scrolling.\n *\n * #### Notes\n * This class is designed to be used when dragging and dropping custom\n * data *within* a single application. It is *not* a replacement for\n * the native drag-drop API. Instead, it provides an API which allows\n * drag operations to be initiated programmatically and enables the\n * transfer of arbitrary non-string objects; features which are not\n * possible with the native drag-drop API.\n */\nclass Drag {\n /**\n * Construct a new drag object.\n *\n * @param options - The options for initializing the drag.\n */\n constructor(options) {\n /**\n * The scroll loop handler function.\n */\n this._onScrollFrame = () => {\n // Bail early if there is no scroll target.\n if (!this._scrollTarget) {\n return;\n }\n // Unpack the scroll target.\n let { element, edge, distance } = this._scrollTarget;\n // Calculate the scroll delta using nonlinear acceleration.\n let d = Private.SCROLL_EDGE_SIZE - distance;\n let f = Math.pow(d / Private.SCROLL_EDGE_SIZE, 2);\n let s = Math.max(1, Math.round(f * Private.SCROLL_EDGE_SIZE));\n // Scroll the element in the specified direction.\n switch (edge) {\n case 'top':\n element.scrollTop -= s;\n break;\n case 'left':\n element.scrollLeft -= s;\n break;\n case 'right':\n element.scrollLeft += s;\n break;\n case 'bottom':\n element.scrollTop += s;\n break;\n }\n // Request the next cycle of the scroll loop.\n requestAnimationFrame(this._onScrollFrame);\n };\n this._disposed = false;\n this._dropAction = 'none';\n this._override = null;\n this._currentTarget = null;\n this._currentElement = null;\n this._promise = null;\n this._scrollTarget = null;\n this._resolve = null;\n this.document = options.document || document;\n this.mimeData = options.mimeData;\n this.dragImage = options.dragImage || null;\n this.proposedAction = options.proposedAction || 'copy';\n this.supportedActions = options.supportedActions || 'all';\n this.source = options.source || null;\n }\n /**\n * Dispose of the resources held by the drag object.\n *\n * #### Notes\n * This will cancel the drag operation if it is active.\n */\n dispose() {\n // Do nothing if the drag object is already disposed.\n if (this._disposed) {\n return;\n }\n this._disposed = true;\n // If there is a current target, dispatch a drag leave event.\n if (this._currentTarget) {\n let event = new PointerEvent('pointerup', {\n bubbles: true,\n cancelable: true,\n clientX: -1,\n clientY: -1\n });\n Private.dispatchDragLeave(this, this._currentTarget, null, event);\n }\n // Finalize the drag object with `'none'`.\n this._finalize('none');\n }\n /**\n * Test whether the drag object is disposed.\n */\n get isDisposed() {\n return this._disposed;\n }\n /**\n * Start the drag operation at the specified client position.\n *\n * @param clientX - The client X position for the drag start.\n *\n * @param clientY - The client Y position for the drag start.\n *\n * @returns A promise which resolves to the result of the drag.\n *\n * #### Notes\n * If the drag has already been started, the promise created by the\n * first call to `start` is returned.\n *\n * If the drag operation has ended, or if the drag object has been\n * disposed, the returned promise will resolve to `'none'`.\n *\n * The drag object will be automatically disposed when drag operation\n * completes. This means `Drag` objects are for single-use only.\n *\n * This method assumes the left mouse button is already held down.\n */\n start(clientX, clientY) {\n // If the drag object is already disposed, resolve to `none`.\n if (this._disposed) {\n return Promise.resolve('none');\n }\n // If the drag has already been started, return the promise.\n if (this._promise) {\n return this._promise;\n }\n // Install the document listeners for the drag object.\n this._addListeners();\n // Attach the drag image at the specified client position.\n this._attachDragImage(clientX, clientY);\n // Create the promise which will be resolved on completion.\n this._promise = new Promise(resolve => {\n this._resolve = resolve;\n });\n // Trigger a fake move event to kick off the drag operation.\n let event = new PointerEvent('pointermove', {\n bubbles: true,\n cancelable: true,\n clientX,\n clientY\n });\n document.dispatchEvent(event);\n // Return the pending promise for the drag operation.\n return this._promise;\n }\n /**\n * Handle the DOM events for the drag operation.\n *\n * @param event - The DOM event sent to the drag object.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the document. It should not be\n * called directly by user code.\n */\n handleEvent(event) {\n switch (event.type) {\n case 'pointermove':\n this._evtPointerMove(event);\n break;\n case 'pointerup':\n this._evtPointerUp(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n default:\n // Stop all other events during drag-drop.\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n }\n /**\n * Move the drag image element to the specified location.\n *\n * This is a no-op if there is no drag image element.\n */\n moveDragImage(clientX, clientY) {\n if (!this.dragImage) {\n return;\n }\n let style = this.dragImage.style;\n style.transform = `translate(${clientX}px, ${clientY}px)`;\n }\n /**\n * Handle the `'pointermove'` event for the drag object.\n */\n _evtPointerMove(event) {\n // Stop all input events during drag-drop.\n event.preventDefault();\n event.stopPropagation();\n // Update the current target node and dispatch enter/leave events.\n this._updateCurrentTarget(event);\n // Update the drag scroll element.\n this._updateDragScroll(event);\n // Move the drag image to the specified client position. This is\n // performed *after* dispatching to prevent unnecessary reflows.\n this.moveDragImage(event.clientX, event.clientY);\n }\n /**\n * Handle the `'pointerup'` event for the drag object.\n */\n _evtPointerUp(event) {\n // Stop all input events during drag-drop.\n event.preventDefault();\n event.stopPropagation();\n // Do nothing if the left button is not released.\n if (event.button !== 0) {\n return;\n }\n // Update the current target node and dispatch enter/leave events.\n // This prevents a subtle issue where the DOM mutates under the\n // cursor after the last move event but before the drop event.\n this._updateCurrentTarget(event);\n // If there is no current target, finalize with `'none'`.\n if (!this._currentTarget) {\n this._finalize('none');\n return;\n }\n // If the last drop action was `'none'`, dispatch a leave event\n // to the current target and finalize the drag with `'none'`.\n if (this._dropAction === 'none') {\n Private.dispatchDragLeave(this, this._currentTarget, null, event);\n this._finalize('none');\n return;\n }\n // Dispatch the drop event at the current target and finalize\n // with the resulting drop action.\n let action = Private.dispatchDrop(this, this._currentTarget, event);\n this._finalize(action);\n }\n /**\n * Handle the `'keydown'` event for the drag object.\n */\n _evtKeyDown(event) {\n // Stop all input events during drag-drop.\n event.preventDefault();\n event.stopPropagation();\n // Cancel the drag if `Escape` is pressed.\n if (event.keyCode === 27) {\n this.dispose();\n }\n }\n /**\n * Add the document event listeners for the drag object.\n */\n _addListeners() {\n document.addEventListener('pointerdown', this, true);\n document.addEventListener('pointermove', this, true);\n document.addEventListener('pointerup', this, true);\n document.addEventListener('pointerenter', this, true);\n document.addEventListener('pointerleave', this, true);\n document.addEventListener('pointerover', this, true);\n document.addEventListener('pointerout', this, true);\n document.addEventListener('keydown', this, true);\n document.addEventListener('keyup', this, true);\n document.addEventListener('keypress', this, true);\n document.addEventListener('contextmenu', this, true);\n }\n /**\n * Remove the document event listeners for the drag object.\n */\n _removeListeners() {\n document.removeEventListener('pointerdown', this, true);\n document.removeEventListener('pointermove', this, true);\n document.removeEventListener('pointerup', this, true);\n document.removeEventListener('pointerenter', this, true);\n document.removeEventListener('pointerleave', this, true);\n document.removeEventListener('pointerover', this, true);\n document.removeEventListener('pointerout', this, true);\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('keyup', this, true);\n document.removeEventListener('keypress', this, true);\n document.removeEventListener('contextmenu', this, true);\n }\n /**\n * Update the drag scroll element under the mouse.\n */\n _updateDragScroll(event) {\n // Find the scroll target under the mouse.\n let target = Private.findScrollTarget(event);\n // Bail if there is nothing to scroll.\n if (!this._scrollTarget && !target) {\n return;\n }\n // Start the scroll loop if needed.\n if (!this._scrollTarget) {\n setTimeout(this._onScrollFrame, 500);\n }\n // Update the scroll target.\n this._scrollTarget = target;\n }\n /**\n * Update the current target node using the given mouse event.\n */\n _updateCurrentTarget(event) {\n // Fetch common local state.\n let prevTarget = this._currentTarget;\n let currTarget = this._currentTarget;\n let prevElem = this._currentElement;\n // Find the current indicated element at the given position.\n let currElem = Private.findElementBehindBackdrop(event, this.document);\n // Update the current element reference.\n this._currentElement = currElem;\n // If the indicated element changes from the previous iteration,\n // and is different from the current target, dispatch the exit\n // event to the target.\n if (currElem !== prevElem && currElem !== currTarget) {\n Private.dispatchDragExit(this, currTarget, currElem, event);\n }\n // If the indicated element changes from the previous iteration,\n // and is different from the current target, dispatch the enter\n // event and compute the new target element.\n if (currElem !== prevElem && currElem !== currTarget) {\n currTarget = Private.dispatchDragEnter(this, currElem, currTarget, event);\n }\n // If the current target element has changed, update the current\n // target reference and dispatch the leave event to the old target.\n if (currTarget !== prevTarget) {\n this._currentTarget = currTarget;\n Private.dispatchDragLeave(this, prevTarget, currTarget, event);\n }\n // Dispatch the drag over event and update the drop action.\n let action = Private.dispatchDragOver(this, currTarget, event);\n this._setDropAction(action);\n }\n /**\n * Attach the drag image element at the specified location.\n *\n * This is a no-op if there is no drag image element.\n */\n _attachDragImage(clientX, clientY) {\n if (!this.dragImage) {\n return;\n }\n this.dragImage.classList.add('lm-mod-drag-image');\n let style = this.dragImage.style;\n style.pointerEvents = 'none';\n style.position = 'fixed';\n style.transform = `translate(${clientX}px, ${clientY}px)`;\n const body = this.document instanceof Document\n ? this.document.body\n : this.document.firstElementChild;\n body.appendChild(this.dragImage);\n }\n /**\n * Detach the drag image element from the DOM.\n *\n * This is a no-op if there is no drag image element.\n */\n _detachDragImage() {\n if (!this.dragImage) {\n return;\n }\n let parent = this.dragImage.parentNode;\n if (!parent) {\n return;\n }\n parent.removeChild(this.dragImage);\n }\n /**\n * Set the internal drop action state and update the drag cursor.\n */\n _setDropAction(action) {\n action = Private.validateAction(action, this.supportedActions);\n if (this._override && this._dropAction === action) {\n return;\n }\n switch (action) {\n case 'none':\n this._dropAction = action;\n this._override = Drag.overrideCursor('no-drop', this.document);\n break;\n case 'copy':\n this._dropAction = action;\n this._override = Drag.overrideCursor('copy', this.document);\n break;\n case 'link':\n this._dropAction = action;\n this._override = Drag.overrideCursor('alias', this.document);\n break;\n case 'move':\n this._dropAction = action;\n this._override = Drag.overrideCursor('move', this.document);\n break;\n }\n }\n /**\n * Finalize the drag operation and resolve the drag promise.\n */\n _finalize(action) {\n // Store the resolve function as a temp variable.\n let resolve = this._resolve;\n // Remove the document event listeners.\n this._removeListeners();\n // Detach the drag image.\n this._detachDragImage();\n // Dispose of the cursor override.\n if (this._override) {\n this._override.dispose();\n this._override = null;\n }\n // Clear the mime data.\n this.mimeData.clear();\n // Clear the rest of the internal drag state.\n this._disposed = true;\n this._dropAction = 'none';\n this._currentTarget = null;\n this._currentElement = null;\n this._scrollTarget = null;\n this._promise = null;\n this._resolve = null;\n // Finally, resolve the promise to the given drop action.\n if (resolve) {\n resolve(action);\n }\n }\n}\n/**\n * The namespace for the `Drag` class statics.\n */\n(function (Drag) {\n /**\n * A custom event used for drag-drop operations.\n *\n * #### Notes\n * In order to receive `'lm-dragover'`, `'lm-dragleave'`, or `'lm-drop'`\n * events, a drop target must cancel the `'lm-dragenter'` event by\n * calling the event's `preventDefault()` method.\n */\n class Event extends DragEvent {\n constructor(event, options) {\n super(options.type, {\n bubbles: true,\n cancelable: true,\n altKey: event.altKey,\n button: event.button,\n clientX: event.clientX,\n clientY: event.clientY,\n ctrlKey: event.ctrlKey,\n detail: 0,\n metaKey: event.metaKey,\n relatedTarget: options.related,\n screenX: event.screenX,\n screenY: event.screenY,\n shiftKey: event.shiftKey,\n view: window\n });\n const { drag } = options;\n this.dropAction = 'none';\n this.mimeData = drag.mimeData;\n this.proposedAction = drag.proposedAction;\n this.supportedActions = drag.supportedActions;\n this.source = drag.source;\n }\n }\n Drag.Event = Event;\n /**\n * Override the cursor icon for the entire document.\n *\n * @param cursor - The string representing the cursor style.\n *\n * @returns A disposable which will clear the override when disposed.\n *\n * #### Notes\n * The most recent call to `overrideCursor` takes precedence.\n * Disposing an old override has no effect on the current override.\n *\n * This utility function is used by the `Drag` class to override the\n * mouse cursor during a drag-drop operation, but it can also be used\n * by other classes to fix the cursor icon during normal mouse drags.\n *\n * #### Example\n * ```typescript\n * import { Drag } from '@lumino/dragdrop';\n *\n * // Force the cursor to be 'wait' for the entire document.\n * let override = Drag.overrideCursor('wait');\n *\n * // Clear the override by disposing the return value.\n * override.dispose();\n * ```\n */\n function overrideCursor(cursor, doc = document) {\n return Private.overrideCursor(cursor, doc);\n }\n Drag.overrideCursor = overrideCursor;\n})(Drag || (Drag = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The size of a drag scroll edge, in pixels.\n */\n Private.SCROLL_EDGE_SIZE = 20;\n /**\n * Validate the given action is one of the supported actions.\n *\n * Returns the given action or `'none'` if the action is unsupported.\n */\n function validateAction(action, supported) {\n return actionTable[action] & supportedTable[supported] ? action : 'none';\n }\n Private.validateAction = validateAction;\n /**\n * Find the event target using pointer position if given, or otherwise\n * the central position of the backdrop.\n */\n function findElementBehindBackdrop(event, root = document) {\n if (event) {\n // Check if we already cached element for this event.\n if (lastElementEventSearch && event == lastElementEventSearch.event) {\n return lastElementEventSearch.element;\n }\n Private.cursorBackdrop.style.zIndex = '-1000';\n const element = root.elementFromPoint(event.clientX, event.clientY);\n Private.cursorBackdrop.style.zIndex = '';\n lastElementEventSearch = { event, element };\n return element;\n }\n else {\n const transform = Private.cursorBackdrop.style.transform;\n if (lastElementSearch && transform === lastElementSearch.transform) {\n return lastElementSearch.element;\n }\n const bbox = Private.cursorBackdrop.getBoundingClientRect();\n Private.cursorBackdrop.style.zIndex = '-1000';\n const element = root.elementFromPoint(bbox.left + bbox.width / 2, bbox.top + bbox.height / 2);\n Private.cursorBackdrop.style.zIndex = '';\n lastElementSearch = { transform, element };\n return element;\n }\n }\n Private.findElementBehindBackdrop = findElementBehindBackdrop;\n let lastElementEventSearch = null;\n let lastElementSearch = null;\n /**\n * Find the drag scroll target under the mouse, if any.\n */\n function findScrollTarget(event) {\n // Look up the client mouse position.\n let x = event.clientX;\n let y = event.clientY;\n // Get the element under the mouse.\n let element = findElementBehindBackdrop(event);\n // Search for a scrollable target based on the mouse position.\n // The null assert in third clause of for-loop is required due to:\n // https://github.com/Microsoft/TypeScript/issues/14143\n for (; element; element = element.parentElement) {\n // Ignore elements which are not marked as scrollable.\n if (!element.hasAttribute('data-lm-dragscroll')) {\n continue;\n }\n // Set up the coordinate offsets for the element.\n let offsetX = 0;\n let offsetY = 0;\n if (element === document.body) {\n offsetX = window.pageXOffset;\n offsetY = window.pageYOffset;\n }\n // Get the element bounds in viewport coordinates.\n let r = element.getBoundingClientRect();\n let top = r.top + offsetY;\n let left = r.left + offsetX;\n let right = left + r.width;\n let bottom = top + r.height;\n // Skip the element if it's not under the mouse.\n if (x < left || x >= right || y < top || y >= bottom) {\n continue;\n }\n // Compute the distance to each edge.\n let dl = x - left + 1;\n let dt = y - top + 1;\n let dr = right - x;\n let db = bottom - y;\n // Find the smallest of the edge distances.\n let distance = Math.min(dl, dt, dr, db);\n // Skip the element if the mouse is not within a scroll edge.\n if (distance > Private.SCROLL_EDGE_SIZE) {\n continue;\n }\n // Set up the edge result variable.\n let edge;\n // Find the edge for the computed distance.\n switch (distance) {\n case db:\n edge = 'bottom';\n break;\n case dt:\n edge = 'top';\n break;\n case dr:\n edge = 'right';\n break;\n case dl:\n edge = 'left';\n break;\n default:\n throw 'unreachable';\n }\n // Compute how much the element can scroll in width and height.\n let dsw = element.scrollWidth - element.clientWidth;\n let dsh = element.scrollHeight - element.clientHeight;\n // Determine if the element should be scrolled for the edge.\n let shouldScroll;\n switch (edge) {\n case 'top':\n shouldScroll = dsh > 0 && element.scrollTop > 0;\n break;\n case 'left':\n shouldScroll = dsw > 0 && element.scrollLeft > 0;\n break;\n case 'right':\n shouldScroll = dsw > 0 && element.scrollLeft < dsw;\n break;\n case 'bottom':\n shouldScroll = dsh > 0 && element.scrollTop < dsh;\n break;\n default:\n throw 'unreachable';\n }\n // Skip the element if it should not be scrolled.\n if (!shouldScroll) {\n continue;\n }\n // Return the drag scroll target.\n return { element, edge, distance };\n }\n // No drag scroll target was found.\n return null;\n }\n Private.findScrollTarget = findScrollTarget;\n /**\n * Dispatch a drag enter event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param currElem - The currently indicated element, or `null`. This\n * is the \"immediate user selection\" from the whatwg spec.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * @returns The element to use as the current drag target. This is the\n * \"current target element\" from the whatwg spec, and may be `null`.\n *\n * #### Notes\n * This largely implements the drag enter portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDragEnter(drag, currElem, currTarget, event) {\n // If the current element is null, return null as the new target.\n if (!currElem) {\n return null;\n }\n // Dispatch a drag enter event to the current element.\n let dragEvent = new Drag.Event(event, {\n drag,\n related: currTarget,\n type: 'lm-dragenter'\n });\n let canceled = !currElem.dispatchEvent(dragEvent);\n // If the event was canceled, use the current element as the new target.\n if (canceled) {\n return currElem;\n }\n // If the current element is the document body, keep the original target.\n const body = drag.document instanceof Document\n ? drag.document.body\n : drag.document.firstElementChild;\n if (currElem === body) {\n return currTarget;\n }\n // Dispatch a drag enter event on the document body.\n dragEvent = new Drag.Event(event, {\n drag,\n related: currTarget,\n type: 'lm-dragenter'\n });\n body.dispatchEvent(dragEvent);\n // Ignore the event cancellation, and use the body as the new target.\n return body;\n }\n Private.dispatchDragEnter = dispatchDragEnter;\n /**\n * Dispatch a drag exit event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param prevTarget - The previous target element, or `null`. This\n * is the previous \"current target element\" from the whatwg spec.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * #### Notes\n * This largely implements the drag exit portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDragExit(drag, prevTarget, currTarget, event) {\n // If the previous target is null, do nothing.\n if (!prevTarget) {\n return;\n }\n // Dispatch the drag exit event to the previous target.\n let dragEvent = new Drag.Event(event, {\n drag,\n related: currTarget,\n type: 'lm-dragexit'\n });\n prevTarget.dispatchEvent(dragEvent);\n }\n Private.dispatchDragExit = dispatchDragExit;\n /**\n * Dispatch a drag leave event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param prevTarget - The previous target element, or `null`. This\n * is the previous \"current target element\" from the whatwg spec.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * #### Notes\n * This largely implements the drag leave portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDragLeave(drag, prevTarget, currTarget, event) {\n // If the previous target is null, do nothing.\n if (!prevTarget) {\n return;\n }\n // Dispatch the drag leave event to the previous target.\n let dragEvent = new Drag.Event(event, {\n drag,\n related: currTarget,\n type: 'lm-dragleave'\n });\n prevTarget.dispatchEvent(dragEvent);\n }\n Private.dispatchDragLeave = dispatchDragLeave;\n /**\n * Dispatch a drag over event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * @returns The `DropAction` result of the drag over event.\n *\n * #### Notes\n * This largely implements the drag over portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDragOver(drag, currTarget, event) {\n // If there is no current target, the drop action is none.\n if (!currTarget) {\n return 'none';\n }\n // Dispatch the drag over event to the current target.\n let dragEvent = new Drag.Event(event, {\n drag,\n related: null,\n type: 'lm-dragover'\n });\n let canceled = !currTarget.dispatchEvent(dragEvent);\n // If the event was canceled, return the drop action result.\n if (canceled) {\n return dragEvent.dropAction;\n }\n // Otherwise, the effective drop action is none.\n return 'none';\n }\n Private.dispatchDragOver = dispatchDragOver;\n /**\n * Dispatch a drop event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * @returns The `DropAction` result of the drop event.\n *\n * #### Notes\n * This largely implements the drag over portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDrop(drag, currTarget, event) {\n // If there is no current target, the drop action is none.\n if (!currTarget) {\n return 'none';\n }\n // Dispatch the drop event to the current target.\n let dragEvent = new Drag.Event(event, {\n drag,\n related: null,\n type: 'lm-drop'\n });\n let canceled = !currTarget.dispatchEvent(dragEvent);\n // If the event was canceled, return the drop action result.\n if (canceled) {\n return dragEvent.dropAction;\n }\n // Otherwise, the effective drop action is none.\n return 'none';\n }\n Private.dispatchDrop = dispatchDrop;\n /**\n * A lookup table from drop action to bit value.\n */\n const actionTable = {\n none: 0x0,\n copy: 0x1,\n link: 0x2,\n move: 0x4\n };\n /**\n * A lookup table from supported action to drop action bit mask.\n */\n const supportedTable = {\n none: actionTable['none'],\n copy: actionTable['copy'],\n link: actionTable['link'],\n move: actionTable['move'],\n 'copy-link': actionTable['copy'] | actionTable['link'],\n 'copy-move': actionTable['copy'] | actionTable['move'],\n 'link-move': actionTable['link'] | actionTable['move'],\n all: actionTable['copy'] | actionTable['link'] | actionTable['move']\n };\n /**\n * Implementation of `Drag.overrideCursor`.\n */\n function overrideCursor(cursor, doc = document) {\n let id = ++overrideCursorID;\n const body = doc instanceof Document\n ? doc.body\n : doc.firstElementChild;\n if (!Private.cursorBackdrop.isConnected) {\n // Hide the backdrop until the pointer moves to avoid issues with\n // native double click detection, used in e.g. datagrid editing.\n Private.cursorBackdrop.style.transform = 'scale(0)';\n body.appendChild(Private.cursorBackdrop);\n resetBackdropScroll();\n document.addEventListener('pointermove', alignBackdrop, {\n capture: true,\n passive: true\n });\n Private.cursorBackdrop.addEventListener('scroll', propagateBackdropScroll, {\n capture: true,\n passive: true\n });\n }\n Private.cursorBackdrop.style.cursor = cursor;\n return new DisposableDelegate(() => {\n if (id === overrideCursorID && Private.cursorBackdrop.isConnected) {\n document.removeEventListener('pointermove', alignBackdrop, true);\n Private.cursorBackdrop.removeEventListener('scroll', propagateBackdropScroll, true);\n body.removeChild(Private.cursorBackdrop);\n }\n });\n }\n Private.overrideCursor = overrideCursor;\n /**\n * Move cursor backdrop to match cursor position.\n */\n function alignBackdrop(event) {\n if (!Private.cursorBackdrop) {\n return;\n }\n Private.cursorBackdrop.style.transform = `translate(${event.clientX}px, ${event.clientY}px)`;\n }\n /**\n * Propagate the scroll event from the backdrop element to the scroll target.\n * The scroll target is defined by presence of `data-lm-dragscroll` attribute.\n */\n function propagateBackdropScroll(_event) {\n if (!Private.cursorBackdrop) {\n return;\n }\n // Get the element under behind the centre of the cursor backdrop\n // (essentially behind the cursor, but possibly a few pixels off).\n let element = findElementBehindBackdrop();\n if (!element) {\n return;\n }\n // Find scroll target.\n const scrollTarget = element.closest('[data-lm-dragscroll]');\n if (!scrollTarget) {\n return;\n }\n // Apply the scroll delta to the correct target.\n scrollTarget.scrollTop += Private.cursorBackdrop.scrollTop - backdropScrollOrigin;\n scrollTarget.scrollLeft += Private.cursorBackdrop.scrollLeft - backdropScrollOrigin;\n // Center the scroll position.\n resetBackdropScroll();\n }\n /**\n * Reset the backdrop scroll to allow further scrolling.\n */\n function resetBackdropScroll() {\n Private.cursorBackdrop.scrollTop = backdropScrollOrigin;\n Private.cursorBackdrop.scrollLeft = backdropScrollOrigin;\n }\n /**\n * The center of the backdrop node scroll area.\n */\n const backdropScrollOrigin = 500;\n /**\n * Create cursor backdrop node.\n */\n function createCursorBackdrop() {\n const backdrop = document.createElement('div');\n backdrop.classList.add('lm-cursor-backdrop');\n return backdrop;\n }\n /**\n * The internal id for the active cursor override.\n */\n let overrideCursorID = 0;\n /**\n * A backdrop node overriding pointer cursor.\n *\n * #### Notes\n * We use a backdrop node rather than setting the cursor directly on the body\n * because setting it on body requires more extensive style recalculation for\n * reliable application of the cursor, this is the cursor not being overriden\n * when over child elements with another style like `cursor: other!important`.\n */\n Private.cursorBackdrop = createCursorBackdrop();\n})(Private || (Private = {}));\n\nexport { Drag };\n//# sourceMappingURL=index.es6.js.map\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for array-specific algorithms.\n */\nvar ArrayExt;\n(function (ArrayExt) {\n /**\n * Find the index of the first occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.firstIndexOf(data, 'red'); // -1\n * ArrayExt.firstIndexOf(data, 'one'); // 0\n * ArrayExt.firstIndexOf(data, 'one', 1); // 4\n * ArrayExt.firstIndexOf(data, 'two', 2); // -1\n * ArrayExt.firstIndexOf(data, 'two', 2, 1); // 1\n * ```\n */\n function firstIndexOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.firstIndexOf = firstIndexOf;\n /**\n * Find the index of the last occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.lastIndexOf(data, 'red'); // -1\n * ArrayExt.lastIndexOf(data, 'one'); // 4\n * ArrayExt.lastIndexOf(data, 'one', 1); // 0\n * ArrayExt.lastIndexOf(data, 'two', 0); // -1\n * ArrayExt.lastIndexOf(data, 'two', 0, 1); // 1\n * ```\n */\n function lastIndexOf(array, value, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (start < stop) {\n span = start + 1 + (n - stop);\n }\n else {\n span = start - stop + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start - i + n) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.lastIndexOf = lastIndexOf;\n /**\n * Find the index of the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstIndex(data, isEven); // 1\n * ArrayExt.findFirstIndex(data, isEven, 4); // 5\n * ArrayExt.findFirstIndex(data, isEven, 6); // -1\n * ArrayExt.findFirstIndex(data, isEven, 6, 5); // 1\n * ```\n */\n function findFirstIndex(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findFirstIndex = findFirstIndex;\n /**\n * Find the index of the last value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastIndex(data, isEven); // 5\n * ArrayExt.findLastIndex(data, isEven, 4); // 3\n * ArrayExt.findLastIndex(data, isEven, 0); // -1\n * ArrayExt.findLastIndex(data, isEven, 0, 1); // 5\n * ```\n */\n function findLastIndex(array, fn, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let d;\n if (start < stop) {\n d = start + 1 + (n - stop);\n }\n else {\n d = start - stop + 1;\n }\n for (let i = 0; i < d; ++i) {\n let j = (start - i + n) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findLastIndex = findLastIndex;\n /**\n * Find the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstValue(data, isEven); // 2\n * ArrayExt.findFirstValue(data, isEven, 2); // 4\n * ArrayExt.findFirstValue(data, isEven, 6); // undefined\n * ArrayExt.findFirstValue(data, isEven, 6, 5); // 2\n * ```\n */\n function findFirstValue(array, fn, start = 0, stop = -1) {\n let index = findFirstIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findFirstValue = findFirstValue;\n /**\n * Find the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The last matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastValue(data, isEven); // 2\n * ArrayExt.findLastValue(data, isEven, 4); // 4\n * ArrayExt.findLastValue(data, isEven, 0); // undefined\n * ArrayExt.findLastValue(data, isEven, 0, 1); // 2\n * ```\n */\n function findLastValue(array, fn, start = -1, stop = 0) {\n let index = findLastIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findLastValue = findLastValue;\n /**\n * Find the index of the first element which compares `>=` to a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>=` to the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.lowerBound(data, 0, numberCmp); // 0\n * ArrayExt.lowerBound(data, 6, numberCmp); // 3\n * ArrayExt.lowerBound(data, 7, numberCmp); // 3\n * ArrayExt.lowerBound(data, -1, numberCmp); // 0\n * ArrayExt.lowerBound(data, 10, numberCmp); // 6\n * ```\n */\n function lowerBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) < 0) {\n begin = middle + 1;\n span -= half + 1;\n }\n else {\n span = half;\n }\n }\n return begin;\n }\n ArrayExt.lowerBound = lowerBound;\n /**\n * Find the index of the first element which compares `>` than a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>` than the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.upperBound(data, 0, numberCmp); // 1\n * ArrayExt.upperBound(data, 6, numberCmp); // 3\n * ArrayExt.upperBound(data, 7, numberCmp); // 5\n * ArrayExt.upperBound(data, -1, numberCmp); // 0\n * ArrayExt.upperBound(data, 10, numberCmp); // 6\n * ```\n */\n function upperBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) > 0) {\n span = half;\n }\n else {\n begin = middle + 1;\n span -= half + 1;\n }\n }\n return begin;\n }\n ArrayExt.upperBound = upperBound;\n /**\n * Test whether two arrays are shallowly equal.\n *\n * @param a - The first array-like object to compare.\n *\n * @param b - The second array-like object to compare.\n *\n * @param fn - The comparison function to apply to the elements. It\n * should return `true` if the elements are \"equal\". The default\n * compares elements using strict `===` equality.\n *\n * @returns Whether the two arrays are shallowly equal.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * Modifying the length of the arrays while comparing.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let d1 = [0, 3, 4, 7, 7, 9];\n * let d2 = [0, 3, 4, 7, 7, 9];\n * let d3 = [42];\n * ArrayExt.shallowEqual(d1, d2); // true\n * ArrayExt.shallowEqual(d2, d3); // false\n * ```\n */\n function shallowEqual(a, b, fn) {\n // Check for object identity first.\n if (a === b) {\n return true;\n }\n // Bail early if the lengths are different.\n if (a.length !== b.length) {\n return false;\n }\n // Compare each element for equality.\n for (let i = 0, n = a.length; i < n; ++i) {\n if (fn ? !fn(a[i], b[i]) : a[i] !== b[i]) {\n return false;\n }\n }\n // The array are shallowly equal.\n return true;\n }\n ArrayExt.shallowEqual = shallowEqual;\n /**\n * Create a slice of an array subject to an optional step.\n *\n * @param array - The array-like object of interest.\n *\n * @param options - The options for configuring the slice.\n *\n * @returns A new array with the specified values.\n *\n * @throws An exception if the slice `step` is `0`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start`, `stop`, or `step` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.slice(data); // [0, 3, 4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 2 }); // [4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 0, stop: 4 }); // [0, 3, 4, 7]\n * ArrayExt.slice(data, { step: 2 }); // [0, 4, 7]\n * ArrayExt.slice(data, { step: -1 }); // [9, 7, 7, 4, 3, 0]\n * ```\n */\n function slice(array, options = {}) {\n // Extract the options.\n let { start, stop, step } = options;\n // Set up the `step` value.\n if (step === undefined) {\n step = 1;\n }\n // Validate the step size.\n if (step === 0) {\n throw new Error('Slice `step` cannot be zero.');\n }\n // Look up the length of the array.\n let n = array.length;\n // Set up the `start` value.\n if (start === undefined) {\n start = step < 0 ? n - 1 : 0;\n }\n else if (start < 0) {\n start = Math.max(start + n, step < 0 ? -1 : 0);\n }\n else if (start >= n) {\n start = step < 0 ? n - 1 : n;\n }\n // Set up the `stop` value.\n if (stop === undefined) {\n stop = step < 0 ? -1 : n;\n }\n else if (stop < 0) {\n stop = Math.max(stop + n, step < 0 ? -1 : 0);\n }\n else if (stop >= n) {\n stop = step < 0 ? n - 1 : n;\n }\n // Compute the slice length.\n let length;\n if ((step < 0 && stop >= start) || (step > 0 && start >= stop)) {\n length = 0;\n }\n else if (step < 0) {\n length = Math.floor((stop - start + 1) / step + 1);\n }\n else {\n length = Math.floor((stop - start - 1) / step + 1);\n }\n // Compute the sliced result.\n let result = [];\n for (let i = 0; i < length; ++i) {\n result[i] = array[start + i * step];\n }\n // Return the result.\n return result;\n }\n ArrayExt.slice = slice;\n /**\n * Move an element in an array from one index to another.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param fromIndex - The index of the element to move. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param toIndex - The target index of the element. Negative\n * values are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `fromIndex` or `toIndex` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.move(data, 1, 2); // [0, 2, 1, 3, 4]\n * ArrayExt.move(data, 4, 2); // [0, 2, 4, 1, 3]\n * ```\n */\n function move(array, fromIndex, toIndex) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (fromIndex < 0) {\n fromIndex = Math.max(0, fromIndex + n);\n }\n else {\n fromIndex = Math.min(fromIndex, n - 1);\n }\n if (toIndex < 0) {\n toIndex = Math.max(0, toIndex + n);\n }\n else {\n toIndex = Math.min(toIndex, n - 1);\n }\n if (fromIndex === toIndex) {\n return;\n }\n let value = array[fromIndex];\n let d = fromIndex < toIndex ? 1 : -1;\n for (let i = fromIndex; i !== toIndex; i += d) {\n array[i] = array[i + d];\n }\n array[toIndex] = value;\n }\n ArrayExt.move = move;\n /**\n * Reverse an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param start - The index of the first element in the range to be\n * reversed, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * reversed, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` index which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.reverse(data, 1, 3); // [0, 3, 2, 1, 4]\n * ArrayExt.reverse(data, 3); // [0, 3, 2, 4, 1]\n * ArrayExt.reverse(data); // [1, 4, 2, 3, 0]\n * ```\n */\n function reverse(array, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n while (start < stop) {\n let a = array[start];\n let b = array[stop];\n array[start++] = b;\n array[stop--] = a;\n }\n }\n ArrayExt.reverse = reverse;\n /**\n * Rotate the elements of an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param delta - The amount of rotation to apply to the elements. A\n * positive value will rotate the elements to the left. A negative\n * value will rotate the elements to the right.\n *\n * @param start - The index of the first element in the range to be\n * rotated, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * rotated, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `delta`, `start`, or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.rotate(data, 2); // [2, 3, 4, 0, 1]\n * ArrayExt.rotate(data, -2); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 10); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 9); // [4, 0, 1, 2, 3]\n * ArrayExt.rotate(data, 2, 1, 3); // [4, 2, 0, 1, 3]\n * ```\n */\n function rotate(array, delta, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n if (start >= stop) {\n return;\n }\n let length = stop - start + 1;\n if (delta > 0) {\n delta = delta % length;\n }\n else if (delta < 0) {\n delta = ((delta % length) + length) % length;\n }\n if (delta === 0) {\n return;\n }\n let pivot = start + delta;\n reverse(array, start, pivot - 1);\n reverse(array, pivot, stop);\n reverse(array, start, stop);\n }\n ArrayExt.rotate = rotate;\n /**\n * Fill an array with a static value.\n *\n * @param array - The mutable array-like object to fill.\n *\n * @param value - The static value to use to fill the array.\n *\n * @param start - The index of the first element in the range to be\n * filled, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * filled, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Notes\n * If `stop < start` the fill will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four'];\n * ArrayExt.fill(data, 'r'); // ['r', 'r', 'r', 'r']\n * ArrayExt.fill(data, 'g', 1); // ['r', 'g', 'g', 'g']\n * ArrayExt.fill(data, 'b', 2, 3); // ['r', 'g', 'b', 'b']\n * ArrayExt.fill(data, 'z', 3, 1); // ['z', 'z', 'b', 'z']\n * ```\n */\n function fill(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n array[(start + i) % n] = value;\n }\n }\n ArrayExt.fill = fill;\n /**\n * Insert a value into an array at a specific index.\n *\n * @param array - The array of interest.\n *\n * @param index - The index at which to insert the value. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param value - The value to set at the specified index.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2];\n * ArrayExt.insert(data, 0, -1); // [-1, 0, 1, 2]\n * ArrayExt.insert(data, 2, 12); // [-1, 0, 12, 1, 2]\n * ArrayExt.insert(data, -1, 7); // [-1, 0, 12, 1, 7, 2]\n * ArrayExt.insert(data, 6, 19); // [-1, 0, 12, 1, 7, 2, 19]\n * ```\n */\n function insert(array, index, value) {\n let n = array.length;\n if (index < 0) {\n index = Math.max(0, index + n);\n }\n else {\n index = Math.min(index, n);\n }\n for (let i = n; i > index; --i) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n }\n ArrayExt.insert = insert;\n /**\n * Remove and return a value at a specific index in an array.\n *\n * @param array - The array of interest.\n *\n * @param index - The index of the value to remove. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The value at the specified index, or `undefined` if the\n * index is out of range.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeAt(data, 2); // 23\n * ArrayExt.removeAt(data, -2); // 12\n * ArrayExt.removeAt(data, 10); // undefined;\n * ```\n */\n function removeAt(array, index) {\n let n = array.length;\n if (index < 0) {\n index += n;\n }\n if (index < 0 || index >= n) {\n return undefined;\n }\n let value = array[index];\n for (let i = index + 1; i < n; ++i) {\n array[i - 1] = array[i];\n }\n array.length = n - 1;\n return value;\n }\n ArrayExt.removeAt = removeAt;\n /**\n * Remove the first occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstOf(data, 12); // 1\n * ArrayExt.removeFirstOf(data, 17); // -1\n * ArrayExt.removeFirstOf(data, 39, 3); // -1\n * ArrayExt.removeFirstOf(data, 39, 3, 2); // 2\n * ```\n */\n function removeFirstOf(array, value, start = 0, stop = -1) {\n let index = firstIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeFirstOf = removeFirstOf;\n /**\n * Remove the last occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastOf(data, 12); // 5\n * ArrayExt.removeLastOf(data, 17); // -1\n * ArrayExt.removeLastOf(data, 39, 2); // -1\n * ArrayExt.removeLastOf(data, 39, 2, 3); // 3\n * ```\n */\n function removeLastOf(array, value, start = -1, stop = 0) {\n let index = lastIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeLastOf = removeLastOf;\n /**\n * Remove all occurrences of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [14, 12, 23, 39, 14, 12, 19, 14];\n * ArrayExt.removeAllOf(data, 12); // 2\n * ArrayExt.removeAllOf(data, 17); // 0\n * ArrayExt.removeAllOf(data, 14, 1, 4); // 1\n * ```\n */\n function removeAllOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && array[i] === value) {\n count++;\n }\n else if (stop < start &&\n (i <= stop || i >= start) &&\n array[i] === value) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllOf = removeAllOf;\n /**\n * Remove the first occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstWhere(data, isEven); // { index: 0, value: 0 }\n * ArrayExt.removeFirstWhere(data, isEven, 2); // { index: 3, value: 14 }\n * ArrayExt.removeFirstWhere(data, isEven, 4); // { index: -1, value: undefined }\n * ```\n */\n function removeFirstWhere(array, fn, start = 0, stop = -1) {\n let value;\n let index = findFirstIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeFirstWhere = removeFirstWhere;\n /**\n * Remove the last occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastWhere(data, isEven); // { index: 5, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2); // { index: 1, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2, 1); // { index: -1, value: undefined }\n * ```\n */\n function removeLastWhere(array, fn, start = -1, stop = 0) {\n let value;\n let index = findLastIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeLastWhere = removeLastWhere;\n /**\n * Remove all occurrences of values which match a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * function isNegative(value: number): boolean {\n * return value < 0;\n * }\n *\n * let data = [0, 12, -13, -9, 23, 39, 14, -15, 12, 75];\n * ArrayExt.removeAllWhere(data, isEven); // 4\n * ArrayExt.removeAllWhere(data, isNegative, 0, 3); // 2\n * ```\n */\n function removeAllWhere(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && fn(array[i], i)) {\n count++;\n }\n else if (stop < start && (i <= stop || i >= start) && fn(array[i], i)) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllWhere = removeAllWhere;\n})(ArrayExt || (ArrayExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Chain together several iterables.\n *\n * @deprecated\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields the values of the iterables\n * in the order in which they are supplied.\n *\n * #### Example\n * ```typescript\n * import { chain } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = chain(data1, data2);\n *\n * Array.from(stream); // [1, 2, 3, 4, 5, 6]\n * ```\n */\nfunction* chain(...objects) {\n for (const object of objects) {\n yield* object;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an empty iterator.\n *\n * @returns A new iterator which yields nothing.\n *\n * #### Example\n * ```typescript\n * import { empty } from '@lumino/algorithm';\n *\n * let stream = empty();\n *\n * Array.from(stream); // []\n * ```\n */\n// eslint-disable-next-line require-yield\nfunction* empty() {\n return;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Enumerate an iterable object.\n *\n * @param object - The iterable object of interest.\n *\n * @param start - The starting enum value. The default is `0`.\n *\n * @returns An iterator which yields the enumerated values.\n *\n * #### Example\n * ```typescript\n * import { enumerate } from '@lumino/algorithm';\n *\n * let data = ['foo', 'bar', 'baz'];\n *\n * let stream = enumerate(data, 1);\n *\n * Array.from(stream); // [[1, 'foo'], [2, 'bar'], [3, 'baz']]\n * ```\n */\nfunction* enumerate(object, start = 0) {\n for (const value of object) {\n yield [start++, value];\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Filter an iterable for values which pass a test.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns An iterator which yields the values which pass the test.\n *\n * #### Example\n * ```typescript\n * import { filter } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = filter(data, value => value % 2 === 0);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* filter(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Find the first value in an iterable which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { find } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * find(data, isCat).name; // 'fluffy'\n * ```\n */\nfunction find(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return value;\n }\n }\n return undefined;\n}\n/**\n * Find the index of the first value which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { findIndex } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * findIndex(data, isCat); // 1\n * ```\n */\nfunction findIndex(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return index - 1;\n }\n }\n return -1;\n}\n/**\n * Find the minimum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The minimum value in the iterable. If multiple values are\n * equivalent to the minimum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { min } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * min([7, 4, 0, 3, 9, 4], numberCmp); // 0\n * ```\n */\nfunction min(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) < 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the maximum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The maximum value in the iterable. If multiple values are\n * equivalent to the maximum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { max } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * max([7, 4, 0, 3, 9, 4], numberCmp); // 9\n * ```\n */\nfunction max(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) > 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the minimum and maximum values in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns A 2-tuple of the `[min, max]` values in the iterable. If\n * multiple values are equivalent, the left-most values are returned.\n * If the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { minmax } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * minmax([7, 4, 0, 3, 9, 4], numberCmp); // [0, 9]\n * ```\n */\nfunction minmax(object, fn) {\n let empty = true;\n let vmin;\n let vmax;\n for (const value of object) {\n if (empty) {\n vmin = value;\n vmax = value;\n empty = false;\n }\n else if (fn(value, vmin) < 0) {\n vmin = value;\n }\n else if (fn(value, vmax) > 0) {\n vmax = value;\n }\n }\n return empty ? undefined : [vmin, vmax];\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an array from an iterable of values.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new array of values from the given object.\n *\n * #### Example\n * ```typescript\n * import { toArray } from '@lumino/algorithm';\n *\n * let stream = [1, 2, 3, 4, 5, 6][Symbol.iterator]();\n *\n * toArray(stream); // [1, 2, 3, 4, 5, 6];\n * ```\n */\nfunction toArray(object) {\n return Array.from(object);\n}\n/**\n * Create an object from an iterable of key/value pairs.\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new object mapping keys to values.\n *\n * #### Example\n * ```typescript\n * import { toObject } from '@lumino/algorithm';\n *\n * let data: [string, number][] = [['one', 1], ['two', 2], ['three', 3]];\n *\n * toObject(data); // { one: 1, two: 2, three: 3 }\n * ```\n */\nfunction toObject(object) {\n const result = {};\n for (const [key, value] of object) {\n result[key] = value;\n }\n return result;\n}\n/**\n * Invoke a function for each value in an iterable.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The callback function to invoke for each value.\n *\n * #### Notes\n * Iteration can be terminated early by returning `false` from the\n * callback function.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each } from '@lumino/algorithm';\n *\n * let data = [5, 7, 0, -2, 9];\n *\n * each(data, value => { console.log(value); });\n * ```\n */\nfunction each(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return;\n }\n }\n}\n/**\n * Test whether all values in an iterable satisfy a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if all values pass the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `false` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { every } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * every(data, value => value % 2 === 0); // false\n * every(data, value => value % 2 === 1); // true\n * ```\n */\nfunction every(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Test whether any value in an iterable satisfies a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if any value passes the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `true` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { some } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * some(data, value => value === 7); // true\n * some(data, value => value === 3); // false\n * ```\n */\nfunction some(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return true;\n }\n }\n return false;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Transform the values of an iterable with a mapping function.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The mapping function to invoke for each value.\n *\n * @returns An iterator which yields the transformed values.\n *\n * #### Example\n * ```typescript\n * import { map } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3];\n *\n * let stream = map(data, value => value * 2);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* map(object, fn) {\n let index = 0;\n for (const value of object) {\n yield fn(value, index++);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator of evenly spaced values.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns An iterator which produces evenly spaced values.\n *\n * #### Notes\n * In the single argument form of `range(stop)`, `start` defaults to\n * `0` and `step` defaults to `1`.\n *\n * In the two argument form of `range(start, stop)`, `step` defaults\n * to `1`.\n *\n * #### Example\n * ```typescript\n * import { range } from '@lumino/algorithm';\n *\n * let stream = range(2, 4);\n *\n * Array.from(stream); // [2, 3]\n * ```\n */\nfunction* range(start, stop, step) {\n if (stop === undefined) {\n stop = start;\n start = 0;\n step = 1;\n }\n else if (step === undefined) {\n step = 1;\n }\n const length = Private.rangeLength(start, stop, step);\n for (let index = 0; index < length; index++) {\n yield start + step * index;\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Compute the effective length of a range.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns The number of steps need to traverse the range.\n */\n function rangeLength(start, stop, step) {\n if (step === 0) {\n return Infinity;\n }\n if (start > stop && step > 0) {\n return 0;\n }\n if (start < stop && step < 0) {\n return 0;\n }\n return Math.ceil((stop - start) / step);\n }\n Private.rangeLength = rangeLength;\n})(Private || (Private = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nfunction reduce(object, fn, initial) {\n // Setup the iterator and fetch the first value.\n const it = object[Symbol.iterator]();\n let index = 0;\n let first = it.next();\n // An empty iterator and no initial value is an error.\n if (first.done && initial === undefined) {\n throw new TypeError('Reduce of empty iterable with no initial value.');\n }\n // If the iterator is empty, return the initial value.\n if (first.done) {\n return initial;\n }\n // If the iterator has a single item and no initial value, the\n // reducer is not invoked and the first item is the return value.\n let second = it.next();\n if (second.done && initial === undefined) {\n return first.value;\n }\n // If iterator has a single item and an initial value is provided,\n // the reducer is invoked and that result is the return value.\n if (second.done) {\n return fn(initial, first.value, index++);\n }\n // Setup the initial accumlated value.\n let accumulator;\n if (initial === undefined) {\n accumulator = fn(first.value, second.value, index++);\n }\n else {\n accumulator = fn(fn(initial, first.value, index++), second.value, index++);\n }\n // Iterate the rest of the values, updating the accumulator.\n let next;\n while (!(next = it.next()).done) {\n accumulator = fn(accumulator, next.value, index++);\n }\n // Return the final accumulated value.\n return accumulator;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator which repeats a value a number of times.\n *\n * @deprecated\n *\n * @param value - The value to repeat.\n *\n * @param count - The number of times to repeat the value.\n *\n * @returns A new iterator which repeats the specified value.\n *\n * #### Example\n * ```typescript\n * import { repeat } from '@lumino/algorithm';\n *\n * let stream = repeat(7, 3);\n *\n * Array.from(stream); // [7, 7, 7]\n * ```\n */\nfunction* repeat(value, count) {\n while (0 < count--) {\n yield value;\n }\n}\n/**\n * Create an iterator which yields a value a single time.\n *\n * @deprecated\n *\n * @param value - The value to wrap in an iterator.\n *\n * @returns A new iterator which yields the value a single time.\n *\n * #### Example\n * ```typescript\n * import { once } from '@lumino/algorithm';\n *\n * let stream = once(7);\n *\n * Array.from(stream); // [7]\n * ```\n */\nfunction* once(value) {\n yield value;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator for a retroable object.\n *\n * @param object - The retroable or array-like object of interest.\n *\n * @returns An iterator which traverses the object's values in reverse.\n *\n * #### Example\n * ```typescript\n * import { retro } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = retro(data);\n *\n * Array.from(stream); // [6, 5, 4, 3, 2, 1]\n * ```\n */\nfunction* retro(object) {\n if (typeof object.retro === 'function') {\n yield* object.retro();\n }\n else {\n for (let index = object.length - 1; index > -1; index--) {\n yield object[index];\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Topologically sort an iterable of edges.\n *\n * @param edges - The iterable object of edges to sort.\n * An edge is represented as a 2-tuple of `[fromNode, toNode]`.\n *\n * @returns The topologically sorted array of nodes.\n *\n * #### Notes\n * If a cycle is present in the graph, the cycle will be ignored and\n * the return value will be only approximately sorted.\n *\n * #### Example\n * ```typescript\n * import { topologicSort } from '@lumino/algorithm';\n *\n * let data = [\n * ['d', 'e'],\n * ['c', 'd'],\n * ['a', 'b'],\n * ['b', 'c']\n * ];\n *\n * topologicSort(data); // ['a', 'b', 'c', 'd', 'e']\n * ```\n */\nfunction topologicSort(edges) {\n // Setup the shared sorting state.\n let sorted = [];\n let visited = new Set();\n let graph = new Map();\n // Add the edges to the graph.\n for (const edge of edges) {\n addEdge(edge);\n }\n // Visit each node in the graph.\n for (const [k] of graph) {\n visit(k);\n }\n // Return the sorted results.\n return sorted;\n // Add an edge to the graph.\n function addEdge(edge) {\n let [fromNode, toNode] = edge;\n let children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n }\n else {\n graph.set(toNode, [fromNode]);\n }\n }\n // Recursively visit the node.\n function visit(node) {\n if (visited.has(node)) {\n return;\n }\n visited.add(node);\n let children = graph.get(node);\n if (children) {\n for (const child of children) {\n visit(child);\n }\n }\n sorted.push(node);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate over an iterable using a stepped increment.\n *\n * @param object - The iterable object of interest.\n *\n * @param step - The distance to step on each iteration. A value\n * of less than `1` will behave the same as a value of `1`.\n *\n * @returns An iterator which traverses the iterable step-wise.\n *\n * #### Example\n * ```typescript\n * import { stride } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = stride(data, 2);\n *\n * Array.from(stream); // [1, 3, 5];\n * ```\n */\nfunction* stride(object, step) {\n let count = 0;\n for (const value of object) {\n if (0 === count++ % step) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for string-specific algorithms.\n */\nvar StringExt;\n(function (StringExt) {\n /**\n * Find the indices of characters in a source text.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The matched indices, or `null` if there is no match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * In order for there to be a match, all of the characters in `query`\n * **must** appear in `source` in the order given by `query`.\n *\n * Characters are matched using strict `===` equality.\n */\n function findIndices(source, query, start = 0) {\n let indices = new Array(query.length);\n for (let i = 0, j = start, n = query.length; i < n; ++i, ++j) {\n j = source.indexOf(query[i], j);\n if (j === -1) {\n return null;\n }\n indices[i] = j;\n }\n return indices;\n }\n StringExt.findIndices = findIndices;\n /**\n * A string matcher which uses a sum-of-squares algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-squares approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The index of each\n * matching character is squared and added to the score. This means\n * that early and consecutive character matches are preferred, while\n * late matches are heavily penalized.\n */\n function matchSumOfSquares(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i] - start;\n score += j * j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfSquares = matchSumOfSquares;\n /**\n * A string matcher which uses a sum-of-deltas algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-deltas approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The delta between\n * the indices are summed to create the score. This means that groups\n * of matched characters are preferred, while fragmented matches are\n * penalized.\n */\n function matchSumOfDeltas(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n let last = start - 1;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i];\n score += j - last - 1;\n last = j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfDeltas = matchSumOfDeltas;\n /**\n * Highlight the matched characters of a source text.\n *\n * @param source - The text which should be highlighted.\n *\n * @param indices - The indices of the matched characters. They must\n * appear in increasing order and must be in bounds of the source.\n *\n * @param fn - The function to apply to the matched chunks.\n *\n * @returns An array of unmatched and highlighted chunks.\n */\n function highlight(source, indices, fn) {\n // Set up the result array.\n let result = [];\n // Set up the counter variables.\n let k = 0;\n let last = 0;\n let n = indices.length;\n // Iterator over each index.\n while (k < n) {\n // Set up the chunk indices.\n let i = indices[k];\n let j = indices[k];\n // Advance the right chunk index until it's non-contiguous.\n while (++k < n && indices[k] === j + 1) {\n j++;\n }\n // Extract the unmatched text.\n if (last < i) {\n result.push(source.slice(last, i));\n }\n // Extract and highlight the matched text.\n if (i < j + 1) {\n result.push(fn(source.slice(i, j + 1)));\n }\n // Update the last visited index.\n last = j + 1;\n }\n // Extract any remaining unmatched text.\n if (last < source.length) {\n result.push(source.slice(last));\n }\n // Return the highlighted result.\n return result;\n }\n StringExt.highlight = highlight;\n /**\n * A 3-way string comparison function.\n *\n * @param a - The first string of interest.\n *\n * @param b - The second string of interest.\n *\n * @returns `-1` if `a < b`, else `1` if `a > b`, else `0`.\n */\n function cmp(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n }\n StringExt.cmp = cmp;\n})(StringExt || (StringExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Take a fixed number of items from an iterable.\n *\n * @param object - The iterable object of interest.\n *\n * @param count - The number of items to take from the iterable.\n *\n * @returns An iterator which yields the specified number of items\n * from the source iterable.\n *\n * #### Notes\n * The returned iterator will exhaust early if the source iterable\n * contains an insufficient number of items.\n *\n * #### Example\n * ```typescript\n * import { take } from '@lumino/algorithm';\n *\n * let stream = take([5, 4, 3, 2, 1, 0, -1], 3);\n *\n * Array.from(stream); // [5, 4, 3]\n * ```\n */\nfunction* take(object, count) {\n if (count < 1) {\n return;\n }\n const it = object[Symbol.iterator]();\n let item;\n while (0 < count-- && !(item = it.next()).done) {\n yield item.value;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate several iterables in lockstep.\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields successive tuples of values where\n * each value is taken in turn from the provided iterables. It will\n * be as long as the shortest provided iterable.\n *\n * #### Example\n * ```typescript\n * import { zip } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = zip(data1, data2);\n *\n * Array.from(stream); // [[1, 4], [2, 5], [3, 6]]\n * ```\n */\nfunction* zip(...objects) {\n const iters = objects.map(obj => obj[Symbol.iterator]());\n let tuple = iters.map(it => it.next());\n for (; every(tuple, item => !item.done); tuple = iters.map(it => it.next())) {\n yield tuple.map(item => item.value);\n }\n}\n\nexport { ArrayExt, StringExt, chain, each, empty, enumerate, every, filter, find, findIndex, map, max, min, minmax, once, range, reduce, repeat, retro, some, stride, take, toArray, toObject, topologicSort, zip };\n//# sourceMappingURL=index.es6.js.map\n","import { ArrayExt } from '@lumino/algorithm';\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module virtualdom\n */\n/**\n * A virtual node which represents plain text content.\n *\n * #### Notes\n * User code will not typically create a `VirtualText` node directly.\n * Instead, the `h()` function will be used to create an element tree.\n */\nclass VirtualText {\n /**\n * Construct a new virtual text node.\n *\n * @param content - The text content for the node.\n */\n constructor(content) {\n /**\n * The type of the node.\n *\n * This value can be used as a type guard for discriminating the\n * `VirtualNode` union type.\n */\n this.type = 'text';\n this.content = content;\n }\n}\n/**\n * A virtual node which represents an HTML element.\n *\n * #### Notes\n * User code will not typically create a `VirtualElement` node directly.\n * Instead, the `h()` function will be used to create an element tree.\n */\nclass VirtualElement {\n /**\n * Construct a new virtual element node.\n *\n * @param tag - The element tag name.\n *\n * @param attrs - The element attributes.\n *\n * @param children - The element children.\n *\n * @param renderer - An optional custom renderer for the element.\n */\n constructor(tag, attrs, children, renderer) {\n /**\n * The type of the node.\n *\n * This value can be used as a type guard for discriminating the\n * `VirtualNode` union type.\n */\n this.type = 'element';\n this.tag = tag;\n this.attrs = attrs;\n this.children = children;\n this.renderer = renderer;\n }\n}\n/**\n * DEPRECATED - use VirtualElement with a defined renderer param instead.\n * This class is provided as a backwards compatibility shim\n *\n * A \"pass thru\" virtual node whose children are managed by a render and an\n * unrender callback. The intent of this flavor of virtual node is to make\n * it easy to blend other kinds of virtualdom (eg React) into Phosphor's\n * virtualdom.\n *\n * #### Notes\n * User code will not typically create a `VirtualElementPass` node directly.\n * Instead, the `hpass()` function will be used to create an element tree.\n */\nclass VirtualElementPass extends VirtualElement {\n /**\n * DEPRECATED - use VirtualElement with a defined renderer param instead\n *\n * Construct a new virtual element pass thru node.\n *\n * @param tag - the tag of the parent element of this node. Once the parent\n * element is rendered, it will be passed as an argument to\n * renderer.render\n *\n * @param attrs - attributes that will assigned to the\n * parent element\n *\n * @param renderer - an object with render and unrender\n * functions, each of which should take a single argument of type\n * HTMLElement and return nothing. If null, the parent element\n * will be rendered barren without any children.\n */\n constructor(tag, attrs, renderer) {\n super(tag, attrs, [], renderer || undefined);\n }\n}\nfunction h(tag) {\n let attrs = {};\n let renderer;\n let children = [];\n for (let i = 1, n = arguments.length; i < n; ++i) {\n // eslint-disable-next-line prefer-rest-params\n let arg = arguments[i];\n if (typeof arg === 'string') {\n children.push(new VirtualText(arg));\n }\n else if (arg instanceof VirtualText) {\n children.push(arg);\n }\n else if (arg instanceof VirtualElement) {\n children.push(arg);\n }\n else if (arg instanceof Array) {\n extend(children, arg);\n }\n else if ((i === 1 || i === 2) && arg && typeof arg === 'object') {\n if ('render' in arg) {\n renderer = arg;\n }\n else {\n attrs = arg;\n }\n }\n }\n return new VirtualElement(tag, attrs, children, renderer);\n function extend(array, values) {\n for (let child of values) {\n if (typeof child === 'string') {\n array.push(new VirtualText(child));\n }\n else if (child instanceof VirtualText) {\n array.push(child);\n }\n else if (child instanceof VirtualElement) {\n array.push(child);\n }\n }\n }\n}\n/**\n * The namespace for the `h` function statics.\n */\n(function (h) {\n h.a = h.bind(undefined, 'a');\n h.abbr = h.bind(undefined, 'abbr');\n h.address = h.bind(undefined, 'address');\n h.area = h.bind(undefined, 'area');\n h.article = h.bind(undefined, 'article');\n h.aside = h.bind(undefined, 'aside');\n h.audio = h.bind(undefined, 'audio');\n h.b = h.bind(undefined, 'b');\n h.bdi = h.bind(undefined, 'bdi');\n h.bdo = h.bind(undefined, 'bdo');\n h.blockquote = h.bind(undefined, 'blockquote');\n h.br = h.bind(undefined, 'br');\n h.button = h.bind(undefined, 'button');\n h.canvas = h.bind(undefined, 'canvas');\n h.caption = h.bind(undefined, 'caption');\n h.cite = h.bind(undefined, 'cite');\n h.code = h.bind(undefined, 'code');\n h.col = h.bind(undefined, 'col');\n h.colgroup = h.bind(undefined, 'colgroup');\n h.data = h.bind(undefined, 'data');\n h.datalist = h.bind(undefined, 'datalist');\n h.dd = h.bind(undefined, 'dd');\n h.del = h.bind(undefined, 'del');\n h.dfn = h.bind(undefined, 'dfn');\n h.div = h.bind(undefined, 'div');\n h.dl = h.bind(undefined, 'dl');\n h.dt = h.bind(undefined, 'dt');\n h.em = h.bind(undefined, 'em');\n h.embed = h.bind(undefined, 'embed');\n h.fieldset = h.bind(undefined, 'fieldset');\n h.figcaption = h.bind(undefined, 'figcaption');\n h.figure = h.bind(undefined, 'figure');\n h.footer = h.bind(undefined, 'footer');\n h.form = h.bind(undefined, 'form');\n h.h1 = h.bind(undefined, 'h1');\n h.h2 = h.bind(undefined, 'h2');\n h.h3 = h.bind(undefined, 'h3');\n h.h4 = h.bind(undefined, 'h4');\n h.h5 = h.bind(undefined, 'h5');\n h.h6 = h.bind(undefined, 'h6');\n h.header = h.bind(undefined, 'header');\n h.hr = h.bind(undefined, 'hr');\n h.i = h.bind(undefined, 'i');\n h.iframe = h.bind(undefined, 'iframe');\n h.img = h.bind(undefined, 'img');\n h.input = h.bind(undefined, 'input');\n h.ins = h.bind(undefined, 'ins');\n h.kbd = h.bind(undefined, 'kbd');\n h.label = h.bind(undefined, 'label');\n h.legend = h.bind(undefined, 'legend');\n h.li = h.bind(undefined, 'li');\n h.main = h.bind(undefined, 'main');\n h.map = h.bind(undefined, 'map');\n h.mark = h.bind(undefined, 'mark');\n h.meter = h.bind(undefined, 'meter');\n h.nav = h.bind(undefined, 'nav');\n h.noscript = h.bind(undefined, 'noscript');\n h.object = h.bind(undefined, 'object');\n h.ol = h.bind(undefined, 'ol');\n h.optgroup = h.bind(undefined, 'optgroup');\n h.option = h.bind(undefined, 'option');\n h.output = h.bind(undefined, 'output');\n h.p = h.bind(undefined, 'p');\n h.param = h.bind(undefined, 'param');\n h.pre = h.bind(undefined, 'pre');\n h.progress = h.bind(undefined, 'progress');\n h.q = h.bind(undefined, 'q');\n h.rp = h.bind(undefined, 'rp');\n h.rt = h.bind(undefined, 'rt');\n h.ruby = h.bind(undefined, 'ruby');\n h.s = h.bind(undefined, 's');\n h.samp = h.bind(undefined, 'samp');\n h.section = h.bind(undefined, 'section');\n h.select = h.bind(undefined, 'select');\n h.small = h.bind(undefined, 'small');\n h.source = h.bind(undefined, 'source');\n h.span = h.bind(undefined, 'span');\n h.strong = h.bind(undefined, 'strong');\n h.sub = h.bind(undefined, 'sub');\n h.summary = h.bind(undefined, 'summary');\n h.sup = h.bind(undefined, 'sup');\n h.table = h.bind(undefined, 'table');\n h.tbody = h.bind(undefined, 'tbody');\n h.td = h.bind(undefined, 'td');\n h.textarea = h.bind(undefined, 'textarea');\n h.tfoot = h.bind(undefined, 'tfoot');\n h.th = h.bind(undefined, 'th');\n h.thead = h.bind(undefined, 'thead');\n h.time = h.bind(undefined, 'time');\n h.title = h.bind(undefined, 'title');\n h.tr = h.bind(undefined, 'tr');\n h.track = h.bind(undefined, 'track');\n h.u = h.bind(undefined, 'u');\n h.ul = h.bind(undefined, 'ul');\n h.var_ = h.bind(undefined, 'var');\n h.video = h.bind(undefined, 'video');\n h.wbr = h.bind(undefined, 'wbr');\n})(h || (h = {}));\nfunction hpass(tag) {\n let attrs = {};\n let renderer = null;\n if (arguments.length === 2) {\n // eslint-disable-next-line prefer-rest-params\n const arg = arguments[1];\n if ('render' in arg) {\n renderer = arg;\n }\n else {\n attrs = arg;\n }\n }\n else if (arguments.length === 3) {\n // eslint-disable-next-line prefer-rest-params\n attrs = arguments[1];\n // eslint-disable-next-line prefer-rest-params\n renderer = arguments[2];\n }\n else if (arguments.length > 3) {\n throw new Error('hpass() should be called with 1, 2, or 3 arguments');\n }\n return new VirtualElementPass(tag, attrs, renderer);\n}\n/**\n * The namespace for the virtual DOM rendering functions.\n */\nvar VirtualDOM;\n(function (VirtualDOM) {\n function realize(node) {\n return Private.createDOMNode(node);\n }\n VirtualDOM.realize = realize;\n /**\n * Render virtual DOM content into a host element.\n *\n * @param content - The virtual DOM content to render.\n *\n * @param host - The host element for the rendered content.\n *\n * #### Notes\n * This renders the delta from the previous rendering. It assumes that\n * the content of the host element is not manipulated by external code.\n *\n * Providing `null` content will clear the rendering.\n *\n * Externally modifying the provided content or the host element will\n * result in undefined rendering behavior.\n */\n function render(content, host) {\n let oldContent = Private.hostMap.get(host) || [];\n let newContent = Private.asContentArray(content);\n Private.hostMap.set(host, newContent);\n Private.updateContent(host, oldContent, newContent);\n }\n VirtualDOM.render = render;\n})(VirtualDOM || (VirtualDOM = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A weak mapping of host element to virtual DOM content.\n */\n Private.hostMap = new WeakMap();\n /**\n * Cast a content value to a content array.\n */\n function asContentArray(value) {\n if (!value) {\n return [];\n }\n if (value instanceof Array) {\n return value;\n }\n return [value];\n }\n Private.asContentArray = asContentArray;\n function createDOMNode(node) {\n // eslint-disable-next-line prefer-rest-params\n let host = arguments[1] || null;\n // eslint-disable-next-line prefer-rest-params\n const before = arguments[2] || null;\n if (host) {\n host.insertBefore(createDOMNode(node), before);\n }\n else {\n // Create a text node for a virtual text node.\n if (node.type === 'text') {\n return document.createTextNode(node.content);\n }\n // Create the HTML element with the specified tag.\n host = document.createElement(node.tag);\n // Add the attributes for the new element.\n addAttrs(host, node.attrs);\n if (node.renderer) {\n node.renderer.render(host, {\n attrs: node.attrs,\n children: node.children\n });\n return host;\n }\n // Recursively populate the element with child content.\n for (let i = 0, n = node.children.length; i < n; ++i) {\n createDOMNode(node.children[i], host);\n }\n }\n return host;\n }\n Private.createDOMNode = createDOMNode;\n /**\n * Update a host element with the delta of the virtual content.\n *\n * This is the core \"diff\" algorithm. There is no explicit \"patch\"\n * phase. The host is patched at each step as the diff progresses.\n */\n function updateContent(host, oldContent, newContent) {\n // Bail early if the content is identical.\n if (oldContent === newContent) {\n return;\n }\n // Collect the old keyed elems into a mapping.\n let oldKeyed = collectKeys(host, oldContent);\n // Create a copy of the old content which can be modified in-place.\n let oldCopy = oldContent.slice();\n // Update the host with the new content. The diff always proceeds\n // forward and never modifies a previously visited index. The old\n // copy array is modified in-place to reflect the changes made to\n // the host children. This causes the stale nodes to be pushed to\n // the end of the host node and removed at the end of the loop.\n let currElem = host.firstChild;\n let newCount = newContent.length;\n for (let i = 0; i < newCount; ++i) {\n // If the old content is exhausted, create a new node.\n if (i >= oldCopy.length) {\n createDOMNode(newContent[i], host);\n continue;\n }\n // Lookup the old and new virtual nodes.\n let oldVNode = oldCopy[i];\n let newVNode = newContent[i];\n // If both elements are identical, there is nothing to do.\n if (oldVNode === newVNode) {\n currElem = currElem.nextSibling;\n continue;\n }\n // Handle the simplest case of in-place text update first.\n if (oldVNode.type === 'text' && newVNode.type === 'text') {\n // Avoid spurious updates for performance.\n if (currElem.textContent !== newVNode.content) {\n currElem.textContent = newVNode.content;\n }\n currElem = currElem.nextSibling;\n continue;\n }\n // If the old or new node is a text node, the other node is now\n // known to be an element node, so create and insert a new node.\n if (oldVNode.type === 'text' || newVNode.type === 'text') {\n ArrayExt.insert(oldCopy, i, newVNode);\n createDOMNode(newVNode, host, currElem);\n continue;\n }\n // If the old XOR new node has a custom renderer,\n // create and insert a new node.\n if (!oldVNode.renderer != !newVNode.renderer) {\n ArrayExt.insert(oldCopy, i, newVNode);\n createDOMNode(newVNode, host, currElem);\n continue;\n }\n // At this point, both nodes are known to be element nodes.\n // If the new elem is keyed, move an old keyed elem to the proper\n // location before proceeding with the diff. The search can start\n // at the current index, since the unmatched old keyed elems are\n // pushed forward in the old copy array.\n let newKey = newVNode.attrs.key;\n if (newKey && newKey in oldKeyed) {\n let pair = oldKeyed[newKey];\n if (pair.vNode !== oldVNode) {\n ArrayExt.move(oldCopy, oldCopy.indexOf(pair.vNode, i + 1), i);\n host.insertBefore(pair.element, currElem);\n oldVNode = pair.vNode;\n currElem = pair.element;\n }\n }\n // If both elements are identical, there is nothing to do.\n if (oldVNode === newVNode) {\n currElem = currElem.nextSibling;\n continue;\n }\n // If the old elem is keyed and does not match the new elem key,\n // create a new node. This is necessary since the old keyed elem\n // may be matched at a later point in the diff.\n let oldKey = oldVNode.attrs.key;\n if (oldKey && oldKey !== newKey) {\n ArrayExt.insert(oldCopy, i, newVNode);\n createDOMNode(newVNode, host, currElem);\n continue;\n }\n // If the tags are different, create a new node.\n if (oldVNode.tag !== newVNode.tag) {\n ArrayExt.insert(oldCopy, i, newVNode);\n createDOMNode(newVNode, host, currElem);\n continue;\n }\n // At this point, the element can be updated in-place.\n // Update the element attributes.\n updateAttrs(currElem, oldVNode.attrs, newVNode.attrs);\n // Update the element content.\n if (newVNode.renderer) {\n newVNode.renderer.render(currElem, {\n attrs: newVNode.attrs,\n children: newVNode.children\n });\n }\n else {\n updateContent(currElem, oldVNode.children, newVNode.children);\n }\n // Step to the next sibling element.\n currElem = currElem.nextSibling;\n }\n // Cleanup stale DOM\n removeContent(host, oldCopy, newCount, true);\n }\n Private.updateContent = updateContent;\n /**\n * Handle cleanup of stale vdom and its associated DOM. The host node is\n * traversed recursively (in depth-first order), and any explicit cleanup\n * required by a child node is carried out when it is visited (eg if a node\n * has a custom renderer, the renderer.unrender function will be called).\n * Once the subtree beneath each child of host has been completely visited,\n * that child will be removed via a call to host.removeChild.\n */\n function removeContent(host, oldContent, newCount, _sentinel) {\n // Dispose of the old nodes pushed to the end of the host.\n for (let i = oldContent.length - 1; i >= newCount; --i) {\n const oldNode = oldContent[i];\n const child = (_sentinel ? host.lastChild : host.childNodes[i]);\n // recursively clean up host children\n if (oldNode.type === 'text') ;\n else if (oldNode.renderer && oldNode.renderer.unrender) {\n oldNode.renderer.unrender(child, {\n attrs: oldNode.attrs,\n children: oldNode.children\n });\n }\n else {\n removeContent(child, oldNode.children, 0, false);\n }\n if (_sentinel) {\n host.removeChild(child);\n }\n }\n }\n /**\n * A set of special-cased attribute names.\n */\n const specialAttrs = {\n key: true,\n className: true,\n htmlFor: true,\n dataset: true,\n style: true\n };\n /**\n * Add element attributes to a newly created HTML element.\n */\n function addAttrs(element, attrs) {\n // Add the inline event listeners and node attributes.\n for (let name in attrs) {\n if (name in specialAttrs) {\n continue;\n }\n if (name.substr(0, 2) === 'on') {\n element[name] = attrs[name];\n }\n else {\n element.setAttribute(name, attrs[name]);\n }\n }\n // Add the element `class` attribute.\n if (attrs.className !== undefined) {\n element.setAttribute('class', attrs.className);\n }\n // Add the element `for` attribute.\n if (attrs.htmlFor !== undefined) {\n element.setAttribute('for', attrs.htmlFor);\n }\n // Add the dataset values.\n if (attrs.dataset) {\n addDataset(element, attrs.dataset);\n }\n // Add the inline styles.\n if (attrs.style) {\n addStyle(element, attrs.style);\n }\n }\n /**\n * Update the element attributes of an HTML element.\n */\n function updateAttrs(element, oldAttrs, newAttrs) {\n // Do nothing if the attrs are the same object.\n if (oldAttrs === newAttrs) {\n return;\n }\n // Setup the strongly typed loop variable.\n let name;\n // Remove attributes and listeners which no longer exist.\n for (name in oldAttrs) {\n if (name in specialAttrs || name in newAttrs) {\n continue;\n }\n if (name.substr(0, 2) === 'on') {\n element[name] = null;\n }\n else {\n element.removeAttribute(name);\n }\n }\n // Add and update new and existing attributes and listeners.\n for (name in newAttrs) {\n if (name in specialAttrs || oldAttrs[name] === newAttrs[name]) {\n continue;\n }\n if (name.substr(0, 2) === 'on') {\n element[name] = newAttrs[name];\n }\n else {\n element.setAttribute(name, newAttrs[name]);\n }\n }\n // Update the element `class` attribute.\n if (oldAttrs.className !== newAttrs.className) {\n if (newAttrs.className !== undefined) {\n element.setAttribute('class', newAttrs.className);\n }\n else {\n element.removeAttribute('class');\n }\n }\n // Add the element `for` attribute.\n if (oldAttrs.htmlFor !== newAttrs.htmlFor) {\n if (newAttrs.htmlFor !== undefined) {\n element.setAttribute('for', newAttrs.htmlFor);\n }\n else {\n element.removeAttribute('for');\n }\n }\n // Update the dataset values.\n if (oldAttrs.dataset !== newAttrs.dataset) {\n updateDataset(element, oldAttrs.dataset || {}, newAttrs.dataset || {});\n }\n // Update the inline styles.\n if (oldAttrs.style !== newAttrs.style) {\n updateStyle(element, oldAttrs.style || {}, newAttrs.style || {});\n }\n }\n /**\n * Add dataset values to a newly created HTML element.\n */\n function addDataset(element, dataset) {\n for (let name in dataset) {\n element.setAttribute(`data-${name}`, dataset[name]);\n }\n }\n /**\n * Update the dataset values of an HTML element.\n */\n function updateDataset(element, oldDataset, newDataset) {\n for (let name in oldDataset) {\n if (!(name in newDataset)) {\n element.removeAttribute(`data-${name}`);\n }\n }\n for (let name in newDataset) {\n if (oldDataset[name] !== newDataset[name]) {\n element.setAttribute(`data-${name}`, newDataset[name]);\n }\n }\n }\n /**\n * Add inline style values to a newly created HTML element.\n */\n function addStyle(element, style) {\n let elemStyle = element.style;\n let name;\n for (name in style) {\n elemStyle[name] = style[name];\n }\n }\n /**\n * Update the inline style values of an HTML element.\n */\n function updateStyle(element, oldStyle, newStyle) {\n let elemStyle = element.style;\n let name;\n for (name in oldStyle) {\n if (!(name in newStyle)) {\n elemStyle[name] = '';\n }\n }\n for (name in newStyle) {\n if (oldStyle[name] !== newStyle[name]) {\n elemStyle[name] = newStyle[name];\n }\n }\n }\n /**\n * Collect a mapping of keyed elements for the host content.\n */\n function collectKeys(host, content) {\n let node = host.firstChild;\n let keyMap = Object.create(null);\n for (let vNode of content) {\n if (vNode.type === 'element' && vNode.attrs.key) {\n keyMap[vNode.attrs.key] = { vNode, element: node };\n }\n node = node.nextSibling;\n }\n return keyMap;\n }\n})(Private || (Private = {}));\n\nexport { VirtualDOM, VirtualElement, VirtualElementPass, VirtualText, h, hpass };\n//# sourceMappingURL=index.es6.js.map\n","import { ArrayExt, StringExt, empty, find, max } from '@lumino/algorithm';\nimport { UUID, JSONExt, MimeData } from '@lumino/coreutils';\nimport { ElementExt, Selector, Platform } from '@lumino/domutils';\nimport { Message, ConflatableMessage, MessageLoop } from '@lumino/messaging';\nimport { AttachedProperty } from '@lumino/properties';\nimport { Signal } from '@lumino/signaling';\nimport { Drag } from '@lumino/dragdrop';\nimport { CommandRegistry } from '@lumino/commands';\nimport { VirtualDOM, h } from '@lumino/virtualdom';\nimport { DisposableDelegate } from '@lumino/disposable';\nimport { getKeyboardLayout } from '@lumino/keyboard';\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A sizer object for use with the box engine layout functions.\n *\n * #### Notes\n * A box sizer holds the geometry information for an object along an\n * arbitrary layout orientation.\n *\n * For best performance, this class should be treated as a raw data\n * struct. It should not typically be subclassed.\n */\nclass BoxSizer {\n constructor() {\n /**\n * The preferred size for the sizer.\n *\n * #### Notes\n * The sizer will be given this initial size subject to its size\n * bounds. The sizer will not deviate from this size unless such\n * deviation is required to fit into the available layout space.\n *\n * There is no limit to this value, but it will be clamped to the\n * bounds defined by {@link minSize} and {@link maxSize}.\n *\n * The default value is `0`.\n */\n this.sizeHint = 0;\n /**\n * The minimum size of the sizer.\n *\n * #### Notes\n * The sizer will never be sized less than this value, even if\n * it means the sizer will overflow the available layout space.\n *\n * It is assumed that this value lies in the range `[0, Infinity)`\n * and that it is `<=` to {@link maxSize}. Failure to adhere to this\n * constraint will yield undefined results.\n *\n * The default value is `0`.\n */\n this.minSize = 0;\n /**\n * The maximum size of the sizer.\n *\n * #### Notes\n * The sizer will never be sized greater than this value, even if\n * it means the sizer will underflow the available layout space.\n *\n * It is assumed that this value lies in the range `[0, Infinity]`\n * and that it is `>=` to {@link minSize}. Failure to adhere to this\n * constraint will yield undefined results.\n *\n * The default value is `Infinity`.\n */\n this.maxSize = Infinity;\n /**\n * The stretch factor for the sizer.\n *\n * #### Notes\n * This controls how much the sizer stretches relative to its sibling\n * sizers when layout space is distributed. A stretch factor of zero\n * is special and will cause the sizer to only be resized after all\n * other sizers with a stretch factor greater than zero have been\n * resized to their limits.\n *\n * It is assumed that this value is an integer that lies in the range\n * `[0, Infinity)`. Failure to adhere to this constraint will yield\n * undefined results.\n *\n * The default value is `1`.\n */\n this.stretch = 1;\n /**\n * The computed size of the sizer.\n *\n * #### Notes\n * This value is the output of a call to {@link BoxEngine.calc}. It represents\n * the computed size for the object along the layout orientation,\n * and will always lie in the range `[minSize, maxSize]`.\n *\n * This value is output only.\n *\n * Changing this value will have no effect.\n */\n this.size = 0;\n /**\n * An internal storage property for the layout algorithm.\n *\n * #### Notes\n * This value is used as temporary storage by the layout algorithm.\n *\n * Changing this value will have no effect.\n */\n this.done = false;\n }\n}\n/**\n * The namespace for the box engine layout functions.\n */\nvar BoxEngine;\n(function (BoxEngine) {\n /**\n * Calculate the optimal layout sizes for a sequence of box sizers.\n *\n * This distributes the available layout space among the box sizers\n * according to the following algorithm:\n *\n * 1. Initialize the sizers's size to its size hint and compute the\n * sums for each of size hint, min size, and max size.\n *\n * 2. If the total size hint equals the available space, return.\n *\n * 3. If the available space is less than the total min size, set all\n * sizers to their min size and return.\n *\n * 4. If the available space is greater than the total max size, set\n * all sizers to their max size and return.\n *\n * 5. If the layout space is less than the total size hint, distribute\n * the negative delta as follows:\n *\n * a. Shrink each sizer with a stretch factor greater than zero by\n * an amount proportional to the negative space and the sum of\n * stretch factors. If the sizer reaches its min size, remove\n * it and its stretch factor from the computation.\n *\n * b. If after adjusting all stretch sizers there remains negative\n * space, distribute the space equally among the sizers with a\n * stretch factor of zero. If a sizer reaches its min size,\n * remove it from the computation.\n *\n * 6. If the layout space is greater than the total size hint,\n * distribute the positive delta as follows:\n *\n * a. Expand each sizer with a stretch factor greater than zero by\n * an amount proportional to the postive space and the sum of\n * stretch factors. If the sizer reaches its max size, remove\n * it and its stretch factor from the computation.\n *\n * b. If after adjusting all stretch sizers there remains positive\n * space, distribute the space equally among the sizers with a\n * stretch factor of zero. If a sizer reaches its max size,\n * remove it from the computation.\n *\n * 7. return\n *\n * @param sizers - The sizers for a particular layout line.\n *\n * @param space - The available layout space for the sizers.\n *\n * @returns The delta between the provided available space and the\n * actual consumed space. This value will be zero if the sizers\n * can be adjusted to fit, negative if the available space is too\n * small, and positive if the available space is too large.\n *\n * #### Notes\n * The {@link BoxSizer.size} of each sizer is updated with the computed size.\n *\n * This function can be called at any time to recompute the layout for\n * an existing sequence of sizers. The previously computed results will\n * have no effect on the new output. It is therefore not necessary to\n * create new sizer objects on each resize event.\n */\n function calc(sizers, space) {\n // Bail early if there is nothing to do.\n let count = sizers.length;\n if (count === 0) {\n return space;\n }\n // Setup the size and stretch counters.\n let totalMin = 0;\n let totalMax = 0;\n let totalSize = 0;\n let totalStretch = 0;\n let stretchCount = 0;\n // Setup the sizers and compute the totals.\n for (let i = 0; i < count; ++i) {\n let sizer = sizers[i];\n let min = sizer.minSize;\n let max = sizer.maxSize;\n let hint = sizer.sizeHint;\n sizer.done = false;\n sizer.size = Math.max(min, Math.min(hint, max));\n totalSize += sizer.size;\n totalMin += min;\n totalMax += max;\n if (sizer.stretch > 0) {\n totalStretch += sizer.stretch;\n stretchCount++;\n }\n }\n // If the space is equal to the total size, return early.\n if (space === totalSize) {\n return 0;\n }\n // If the space is less than the total min, minimize each sizer.\n if (space <= totalMin) {\n for (let i = 0; i < count; ++i) {\n let sizer = sizers[i];\n sizer.size = sizer.minSize;\n }\n return space - totalMin;\n }\n // If the space is greater than the total max, maximize each sizer.\n if (space >= totalMax) {\n for (let i = 0; i < count; ++i) {\n let sizer = sizers[i];\n sizer.size = sizer.maxSize;\n }\n return space - totalMax;\n }\n // The loops below perform sub-pixel precision sizing. A near zero\n // value is used for compares instead of zero to ensure that the\n // loop terminates when the subdivided space is reasonably small.\n let nearZero = 0.01;\n // A counter which is decremented each time a sizer is resized to\n // its limit. This ensures the loops terminate even if there is\n // space remaining to distribute.\n let notDoneCount = count;\n // Distribute negative delta space.\n if (space < totalSize) {\n // Shrink each stretchable sizer by an amount proportional to its\n // stretch factor. If a sizer reaches its min size it's marked as\n // done. The loop progresses in phases where each sizer is given\n // a chance to consume its fair share for the pass, regardless of\n // whether a sizer before it reached its limit. This continues\n // until the stretchable sizers or the free space is exhausted.\n let freeSpace = totalSize - space;\n while (stretchCount > 0 && freeSpace > nearZero) {\n let distSpace = freeSpace;\n let distStretch = totalStretch;\n for (let i = 0; i < count; ++i) {\n let sizer = sizers[i];\n if (sizer.done || sizer.stretch === 0) {\n continue;\n }\n let amt = (sizer.stretch * distSpace) / distStretch;\n if (sizer.size - amt <= sizer.minSize) {\n freeSpace -= sizer.size - sizer.minSize;\n totalStretch -= sizer.stretch;\n sizer.size = sizer.minSize;\n sizer.done = true;\n notDoneCount--;\n stretchCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size -= amt;\n }\n }\n }\n // Distribute any remaining space evenly among the non-stretchable\n // sizers. This progresses in phases in the same manner as above.\n while (notDoneCount > 0 && freeSpace > nearZero) {\n let amt = freeSpace / notDoneCount;\n for (let i = 0; i < count; ++i) {\n let sizer = sizers[i];\n if (sizer.done) {\n continue;\n }\n if (sizer.size - amt <= sizer.minSize) {\n freeSpace -= sizer.size - sizer.minSize;\n sizer.size = sizer.minSize;\n sizer.done = true;\n notDoneCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size -= amt;\n }\n }\n }\n }\n // Distribute positive delta space.\n else {\n // Expand each stretchable sizer by an amount proportional to its\n // stretch factor. If a sizer reaches its max size it's marked as\n // done. The loop progresses in phases where each sizer is given\n // a chance to consume its fair share for the pass, regardless of\n // whether a sizer before it reached its limit. This continues\n // until the stretchable sizers or the free space is exhausted.\n let freeSpace = space - totalSize;\n while (stretchCount > 0 && freeSpace > nearZero) {\n let distSpace = freeSpace;\n let distStretch = totalStretch;\n for (let i = 0; i < count; ++i) {\n let sizer = sizers[i];\n if (sizer.done || sizer.stretch === 0) {\n continue;\n }\n let amt = (sizer.stretch * distSpace) / distStretch;\n if (sizer.size + amt >= sizer.maxSize) {\n freeSpace -= sizer.maxSize - sizer.size;\n totalStretch -= sizer.stretch;\n sizer.size = sizer.maxSize;\n sizer.done = true;\n notDoneCount--;\n stretchCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size += amt;\n }\n }\n }\n // Distribute any remaining space evenly among the non-stretchable\n // sizers. This progresses in phases in the same manner as above.\n while (notDoneCount > 0 && freeSpace > nearZero) {\n let amt = freeSpace / notDoneCount;\n for (let i = 0; i < count; ++i) {\n let sizer = sizers[i];\n if (sizer.done) {\n continue;\n }\n if (sizer.size + amt >= sizer.maxSize) {\n freeSpace -= sizer.maxSize - sizer.size;\n sizer.size = sizer.maxSize;\n sizer.done = true;\n notDoneCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size += amt;\n }\n }\n }\n }\n // Indicate that the consumed space equals the available space.\n return 0;\n }\n BoxEngine.calc = calc;\n /**\n * Adjust a sizer by a delta and update its neighbors accordingly.\n *\n * @param sizers - The sizers which should be adjusted.\n *\n * @param index - The index of the sizer to grow.\n *\n * @param delta - The amount to adjust the sizer, positive or negative.\n *\n * #### Notes\n * This will adjust the indicated sizer by the specified amount, along\n * with the sizes of the appropriate neighbors, subject to the limits\n * specified by each of the sizers.\n *\n * This is useful when implementing box layouts where the boundaries\n * between the sizers are interactively adjustable by the user.\n */\n function adjust(sizers, index, delta) {\n // Bail early when there is nothing to do.\n if (sizers.length === 0 || delta === 0) {\n return;\n }\n // Dispatch to the proper implementation.\n if (delta > 0) {\n growSizer(sizers, index, delta);\n }\n else {\n shrinkSizer(sizers, index, -delta);\n }\n }\n BoxEngine.adjust = adjust;\n /**\n * Grow a sizer by a positive delta and adjust neighbors.\n */\n function growSizer(sizers, index, delta) {\n // Compute how much the items to the left can expand.\n let growLimit = 0;\n for (let i = 0; i <= index; ++i) {\n let sizer = sizers[i];\n growLimit += sizer.maxSize - sizer.size;\n }\n // Compute how much the items to the right can shrink.\n let shrinkLimit = 0;\n for (let i = index + 1, n = sizers.length; i < n; ++i) {\n let sizer = sizers[i];\n shrinkLimit += sizer.size - sizer.minSize;\n }\n // Clamp the delta adjustment to the limits.\n delta = Math.min(delta, growLimit, shrinkLimit);\n // Grow the sizers to the left by the delta.\n let grow = delta;\n for (let i = index; i >= 0 && grow > 0; --i) {\n let sizer = sizers[i];\n let limit = sizer.maxSize - sizer.size;\n if (limit >= grow) {\n sizer.sizeHint = sizer.size + grow;\n grow = 0;\n }\n else {\n sizer.sizeHint = sizer.size + limit;\n grow -= limit;\n }\n }\n // Shrink the sizers to the right by the delta.\n let shrink = delta;\n for (let i = index + 1, n = sizers.length; i < n && shrink > 0; ++i) {\n let sizer = sizers[i];\n let limit = sizer.size - sizer.minSize;\n if (limit >= shrink) {\n sizer.sizeHint = sizer.size - shrink;\n shrink = 0;\n }\n else {\n sizer.sizeHint = sizer.size - limit;\n shrink -= limit;\n }\n }\n }\n /**\n * Shrink a sizer by a positive delta and adjust neighbors.\n */\n function shrinkSizer(sizers, index, delta) {\n // Compute how much the items to the right can expand.\n let growLimit = 0;\n for (let i = index + 1, n = sizers.length; i < n; ++i) {\n let sizer = sizers[i];\n growLimit += sizer.maxSize - sizer.size;\n }\n // Compute how much the items to the left can shrink.\n let shrinkLimit = 0;\n for (let i = 0; i <= index; ++i) {\n let sizer = sizers[i];\n shrinkLimit += sizer.size - sizer.minSize;\n }\n // Clamp the delta adjustment to the limits.\n delta = Math.min(delta, growLimit, shrinkLimit);\n // Grow the sizers to the right by the delta.\n let grow = delta;\n for (let i = index + 1, n = sizers.length; i < n && grow > 0; ++i) {\n let sizer = sizers[i];\n let limit = sizer.maxSize - sizer.size;\n if (limit >= grow) {\n sizer.sizeHint = sizer.size + grow;\n grow = 0;\n }\n else {\n sizer.sizeHint = sizer.size + limit;\n grow -= limit;\n }\n }\n // Shrink the sizers to the left by the delta.\n let shrink = delta;\n for (let i = index; i >= 0 && shrink > 0; --i) {\n let sizer = sizers[i];\n let limit = sizer.size - sizer.minSize;\n if (limit >= shrink) {\n sizer.sizeHint = sizer.size - shrink;\n shrink = 0;\n }\n else {\n sizer.sizeHint = sizer.size - limit;\n shrink -= limit;\n }\n }\n }\n})(BoxEngine || (BoxEngine = {}));\n\n/**\n * An object which holds data related to an object's title.\n *\n * #### Notes\n * A title object is intended to hold the data necessary to display a\n * header for a particular object. A common example is the `TabPanel`,\n * which uses the widget title to populate the tab for a child widget.\n *\n * It is the responsibility of the owner to call the title disposal.\n */\nclass Title {\n /**\n * Construct a new title.\n *\n * @param options - The options for initializing the title.\n */\n constructor(options) {\n this._label = '';\n this._caption = '';\n this._mnemonic = -1;\n this._icon = undefined;\n this._iconClass = '';\n this._iconLabel = '';\n this._className = '';\n this._closable = false;\n this._changed = new Signal(this);\n this._isDisposed = false;\n this.owner = options.owner;\n if (options.label !== undefined) {\n this._label = options.label;\n }\n if (options.mnemonic !== undefined) {\n this._mnemonic = options.mnemonic;\n }\n if (options.icon !== undefined) {\n this._icon = options.icon;\n }\n if (options.iconClass !== undefined) {\n this._iconClass = options.iconClass;\n }\n if (options.iconLabel !== undefined) {\n this._iconLabel = options.iconLabel;\n }\n if (options.caption !== undefined) {\n this._caption = options.caption;\n }\n if (options.className !== undefined) {\n this._className = options.className;\n }\n if (options.closable !== undefined) {\n this._closable = options.closable;\n }\n this._dataset = options.dataset || {};\n }\n /**\n * A signal emitted when the state of the title changes.\n */\n get changed() {\n return this._changed;\n }\n /**\n * Get the label for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get label() {\n return this._label;\n }\n /**\n * Set the label for the title.\n */\n set label(value) {\n if (this._label === value) {\n return;\n }\n this._label = value;\n this._changed.emit(undefined);\n }\n /**\n * Get the mnemonic index for the title.\n *\n * #### Notes\n * The default value is `-1`.\n */\n get mnemonic() {\n return this._mnemonic;\n }\n /**\n * Set the mnemonic index for the title.\n */\n set mnemonic(value) {\n if (this._mnemonic === value) {\n return;\n }\n this._mnemonic = value;\n this._changed.emit(undefined);\n }\n /**\n * Get the icon renderer for the title.\n *\n * #### Notes\n * The default value is undefined.\n */\n get icon() {\n return this._icon;\n }\n /**\n * Set the icon renderer for the title.\n *\n * #### Notes\n * A renderer is an object that supplies a render and unrender function.\n */\n set icon(value) {\n if (this._icon === value) {\n return;\n }\n this._icon = value;\n this._changed.emit(undefined);\n }\n /**\n * Get the icon class name for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get iconClass() {\n return this._iconClass;\n }\n /**\n * Set the icon class name for the title.\n *\n * #### Notes\n * Multiple class names can be separated with whitespace.\n */\n set iconClass(value) {\n if (this._iconClass === value) {\n return;\n }\n this._iconClass = value;\n this._changed.emit(undefined);\n }\n /**\n * Get the icon label for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get iconLabel() {\n return this._iconLabel;\n }\n /**\n * Set the icon label for the title.\n *\n * #### Notes\n * Multiple class names can be separated with whitespace.\n */\n set iconLabel(value) {\n if (this._iconLabel === value) {\n return;\n }\n this._iconLabel = value;\n this._changed.emit(undefined);\n }\n /**\n * Get the caption for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get caption() {\n return this._caption;\n }\n /**\n * Set the caption for the title.\n */\n set caption(value) {\n if (this._caption === value) {\n return;\n }\n this._caption = value;\n this._changed.emit(undefined);\n }\n /**\n * Get the extra class name for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get className() {\n return this._className;\n }\n /**\n * Set the extra class name for the title.\n *\n * #### Notes\n * Multiple class names can be separated with whitespace.\n */\n set className(value) {\n if (this._className === value) {\n return;\n }\n this._className = value;\n this._changed.emit(undefined);\n }\n /**\n * Get the closable state for the title.\n *\n * #### Notes\n * The default value is `false`.\n */\n get closable() {\n return this._closable;\n }\n /**\n * Set the closable state for the title.\n *\n * #### Notes\n * This controls the presence of a close icon when applicable.\n */\n set closable(value) {\n if (this._closable === value) {\n return;\n }\n this._closable = value;\n this._changed.emit(undefined);\n }\n /**\n * Get the dataset for the title.\n *\n * #### Notes\n * The default value is an empty dataset.\n */\n get dataset() {\n return this._dataset;\n }\n /**\n * Set the dataset for the title.\n *\n * #### Notes\n * This controls the data attributes when applicable.\n */\n set dataset(value) {\n if (this._dataset === value) {\n return;\n }\n this._dataset = value;\n this._changed.emit(undefined);\n }\n /**\n * Test whether the title has been disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * Dispose of the resources held by the title.\n *\n * #### Notes\n * It is the responsibility of the owner to call the title disposal.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n Signal.clearData(this);\n }\n}\n\n/**\n * The base class of the lumino widget hierarchy.\n *\n * #### Notes\n * This class will typically be subclassed in order to create a useful\n * widget. However, it can be used directly to host externally created\n * content.\n */\nclass Widget {\n /**\n * Construct a new widget.\n *\n * @param options - The options for initializing the widget.\n */\n constructor(options = {}) {\n this._flags = 0;\n this._layout = null;\n this._parent = null;\n this._disposed = new Signal(this);\n this._hiddenMode = Widget.HiddenMode.Display;\n this.node = Private$j.createNode(options);\n this.addClass('lm-Widget');\n }\n /**\n * Dispose of the widget and its descendant widgets.\n *\n * #### Notes\n * It is unsafe to use the widget after it has been disposed.\n *\n * All calls made to this method after the first are a no-op.\n */\n dispose() {\n // Do nothing if the widget is already disposed.\n if (this.isDisposed) {\n return;\n }\n // Set the disposed flag and emit the disposed signal.\n this.setFlag(Widget.Flag.IsDisposed);\n this._disposed.emit(undefined);\n // Remove or detach the widget if necessary.\n if (this.parent) {\n this.parent = null;\n }\n else if (this.isAttached) {\n Widget.detach(this);\n }\n // Dispose of the widget layout.\n if (this._layout) {\n this._layout.dispose();\n this._layout = null;\n }\n // Dispose the title\n this.title.dispose();\n // Clear the extra data associated with the widget.\n Signal.clearData(this);\n MessageLoop.clearData(this);\n AttachedProperty.clearData(this);\n }\n /**\n * A signal emitted when the widget is disposed.\n */\n get disposed() {\n return this._disposed;\n }\n /**\n * Test whether the widget has been disposed.\n */\n get isDisposed() {\n return this.testFlag(Widget.Flag.IsDisposed);\n }\n /**\n * Test whether the widget's node is attached to the DOM.\n */\n get isAttached() {\n return this.testFlag(Widget.Flag.IsAttached);\n }\n /**\n * Test whether the widget is explicitly hidden.\n */\n get isHidden() {\n return this.testFlag(Widget.Flag.IsHidden);\n }\n /**\n * Test whether the widget is visible.\n *\n * #### Notes\n * A widget is visible when it is attached to the DOM, is not\n * explicitly hidden, and has no explicitly hidden ancestors.\n */\n get isVisible() {\n return this.testFlag(Widget.Flag.IsVisible);\n }\n /**\n * The title object for the widget.\n *\n * #### Notes\n * The title object is used by some container widgets when displaying\n * the widget alongside some title, such as a tab panel or side bar.\n *\n * Since not all widgets will use the title, it is created on demand.\n *\n * The `owner` property of the title is set to this widget.\n */\n get title() {\n return Private$j.titleProperty.get(this);\n }\n /**\n * Get the id of the widget's DOM node.\n */\n get id() {\n return this.node.id;\n }\n /**\n * Set the id of the widget's DOM node.\n */\n set id(value) {\n this.node.id = value;\n }\n /**\n * The dataset for the widget's DOM node.\n */\n get dataset() {\n return this.node.dataset;\n }\n /**\n * Get the method for hiding the widget.\n */\n get hiddenMode() {\n return this._hiddenMode;\n }\n /**\n * Set the method for hiding the widget.\n */\n set hiddenMode(value) {\n if (this._hiddenMode === value) {\n return;\n }\n if (this.isHidden) {\n // Reset styles set by previous mode.\n this._toggleHidden(false);\n }\n if (value == Widget.HiddenMode.Scale) {\n this.node.style.willChange = 'transform';\n }\n else {\n this.node.style.willChange = 'auto';\n }\n this._hiddenMode = value;\n if (this.isHidden) {\n // Set styles for new mode.\n this._toggleHidden(true);\n }\n }\n /**\n * Get the parent of the widget.\n */\n get parent() {\n return this._parent;\n }\n /**\n * Set the parent of the widget.\n *\n * #### Notes\n * Children are typically added to a widget by using a layout, which\n * means user code will not normally set the parent widget directly.\n *\n * The widget will be automatically removed from its old parent.\n *\n * This is a no-op if there is no effective parent change.\n */\n set parent(value) {\n if (this._parent === value) {\n return;\n }\n if (value && this.contains(value)) {\n throw new Error('Invalid parent widget.');\n }\n if (this._parent && !this._parent.isDisposed) {\n let msg = new Widget.ChildMessage('child-removed', this);\n MessageLoop.sendMessage(this._parent, msg);\n }\n this._parent = value;\n if (this._parent && !this._parent.isDisposed) {\n let msg = new Widget.ChildMessage('child-added', this);\n MessageLoop.sendMessage(this._parent, msg);\n }\n if (!this.isDisposed) {\n MessageLoop.sendMessage(this, Widget.Msg.ParentChanged);\n }\n }\n /**\n * Get the layout for the widget.\n */\n get layout() {\n return this._layout;\n }\n /**\n * Set the layout for the widget.\n *\n * #### Notes\n * The layout is single-use only. It cannot be changed after the\n * first assignment.\n *\n * The layout is disposed automatically when the widget is disposed.\n */\n set layout(value) {\n if (this._layout === value) {\n return;\n }\n if (this.testFlag(Widget.Flag.DisallowLayout)) {\n throw new Error('Cannot set widget layout.');\n }\n if (this._layout) {\n throw new Error('Cannot change widget layout.');\n }\n if (value.parent) {\n throw new Error('Cannot change layout parent.');\n }\n this._layout = value;\n value.parent = this;\n }\n /**\n * Create an iterator over the widget's children.\n *\n * @returns A new iterator over the children of the widget.\n *\n * #### Notes\n * The widget must have a populated layout in order to have children.\n *\n * If a layout is not installed, the returned iterator will be empty.\n */\n *children() {\n if (this._layout) {\n yield* this._layout;\n }\n }\n /**\n * Test whether a widget is a descendant of this widget.\n *\n * @param widget - The descendant widget of interest.\n *\n * @returns `true` if the widget is a descendant, `false` otherwise.\n */\n contains(widget) {\n for (let value = widget; value; value = value._parent) {\n if (value === this) {\n return true;\n }\n }\n return false;\n }\n /**\n * Test whether the widget's DOM node has the given class name.\n *\n * @param name - The class name of interest.\n *\n * @returns `true` if the node has the class, `false` otherwise.\n */\n hasClass(name) {\n return this.node.classList.contains(name);\n }\n /**\n * Add a class name to the widget's DOM node.\n *\n * @param name - The class name to add to the node.\n *\n * #### Notes\n * If the class name is already added to the node, this is a no-op.\n *\n * The class name must not contain whitespace.\n */\n addClass(name) {\n this.node.classList.add(name);\n }\n /**\n * Remove a class name from the widget's DOM node.\n *\n * @param name - The class name to remove from the node.\n *\n * #### Notes\n * If the class name is not yet added to the node, this is a no-op.\n *\n * The class name must not contain whitespace.\n */\n removeClass(name) {\n this.node.classList.remove(name);\n }\n /**\n * Toggle a class name on the widget's DOM node.\n *\n * @param name - The class name to toggle on the node.\n *\n * @param force - Whether to force add the class (`true`) or force\n * remove the class (`false`). If not provided, the presence of\n * the class will be toggled from its current state.\n *\n * @returns `true` if the class is now present, `false` otherwise.\n *\n * #### Notes\n * The class name must not contain whitespace.\n */\n toggleClass(name, force) {\n if (force === true) {\n this.node.classList.add(name);\n return true;\n }\n if (force === false) {\n this.node.classList.remove(name);\n return false;\n }\n return this.node.classList.toggle(name);\n }\n /**\n * Post an `'update-request'` message to the widget.\n *\n * #### Notes\n * This is a simple convenience method for posting the message.\n */\n update() {\n MessageLoop.postMessage(this, Widget.Msg.UpdateRequest);\n }\n /**\n * Post a `'fit-request'` message to the widget.\n *\n * #### Notes\n * This is a simple convenience method for posting the message.\n */\n fit() {\n MessageLoop.postMessage(this, Widget.Msg.FitRequest);\n }\n /**\n * Post an `'activate-request'` message to the widget.\n *\n * #### Notes\n * This is a simple convenience method for posting the message.\n */\n activate() {\n MessageLoop.postMessage(this, Widget.Msg.ActivateRequest);\n }\n /**\n * Send a `'close-request'` message to the widget.\n *\n * #### Notes\n * This is a simple convenience method for sending the message.\n */\n close() {\n MessageLoop.sendMessage(this, Widget.Msg.CloseRequest);\n }\n /**\n * Show the widget and make it visible to its parent widget.\n *\n * #### Notes\n * This causes the {@link isHidden} property to be `false`.\n *\n * If the widget is not explicitly hidden, this is a no-op.\n */\n show() {\n if (!this.testFlag(Widget.Flag.IsHidden)) {\n return;\n }\n if (this.isAttached && (!this.parent || this.parent.isVisible)) {\n MessageLoop.sendMessage(this, Widget.Msg.BeforeShow);\n }\n this.clearFlag(Widget.Flag.IsHidden);\n this._toggleHidden(false);\n if (this.isAttached && (!this.parent || this.parent.isVisible)) {\n MessageLoop.sendMessage(this, Widget.Msg.AfterShow);\n }\n if (this.parent) {\n let msg = new Widget.ChildMessage('child-shown', this);\n MessageLoop.sendMessage(this.parent, msg);\n }\n }\n /**\n * Hide the widget and make it hidden to its parent widget.\n *\n * #### Notes\n * This causes the {@link isHidden} property to be `true`.\n *\n * If the widget is explicitly hidden, this is a no-op.\n */\n hide() {\n if (this.testFlag(Widget.Flag.IsHidden)) {\n return;\n }\n if (this.isAttached && (!this.parent || this.parent.isVisible)) {\n MessageLoop.sendMessage(this, Widget.Msg.BeforeHide);\n }\n this.setFlag(Widget.Flag.IsHidden);\n this._toggleHidden(true);\n if (this.isAttached && (!this.parent || this.parent.isVisible)) {\n MessageLoop.sendMessage(this, Widget.Msg.AfterHide);\n }\n if (this.parent) {\n let msg = new Widget.ChildMessage('child-hidden', this);\n MessageLoop.sendMessage(this.parent, msg);\n }\n }\n /**\n * Show or hide the widget according to a boolean value.\n *\n * @param hidden - `true` to hide the widget, or `false` to show it.\n *\n * #### Notes\n * This is a convenience method for `hide()` and `show()`.\n */\n setHidden(hidden) {\n if (hidden) {\n this.hide();\n }\n else {\n this.show();\n }\n }\n /**\n * Test whether the given widget flag is set.\n *\n * #### Notes\n * This will not typically be called directly by user code.\n */\n testFlag(flag) {\n return (this._flags & flag) !== 0;\n }\n /**\n * Set the given widget flag.\n *\n * #### Notes\n * This will not typically be called directly by user code.\n */\n setFlag(flag) {\n this._flags |= flag;\n }\n /**\n * Clear the given widget flag.\n *\n * #### Notes\n * This will not typically be called directly by user code.\n */\n clearFlag(flag) {\n this._flags &= ~flag;\n }\n /**\n * Process a message sent to the widget.\n *\n * @param msg - The message sent to the widget.\n *\n * #### Notes\n * Subclasses may reimplement this method as needed.\n */\n processMessage(msg) {\n switch (msg.type) {\n case 'resize':\n this.notifyLayout(msg);\n this.onResize(msg);\n break;\n case 'update-request':\n this.notifyLayout(msg);\n this.onUpdateRequest(msg);\n break;\n case 'fit-request':\n this.notifyLayout(msg);\n this.onFitRequest(msg);\n break;\n case 'before-show':\n this.notifyLayout(msg);\n this.onBeforeShow(msg);\n break;\n case 'after-show':\n this.setFlag(Widget.Flag.IsVisible);\n this.notifyLayout(msg);\n this.onAfterShow(msg);\n break;\n case 'before-hide':\n this.notifyLayout(msg);\n this.onBeforeHide(msg);\n break;\n case 'after-hide':\n this.clearFlag(Widget.Flag.IsVisible);\n this.notifyLayout(msg);\n this.onAfterHide(msg);\n break;\n case 'before-attach':\n this.notifyLayout(msg);\n this.onBeforeAttach(msg);\n break;\n case 'after-attach':\n if (!this.isHidden && (!this.parent || this.parent.isVisible)) {\n this.setFlag(Widget.Flag.IsVisible);\n }\n this.setFlag(Widget.Flag.IsAttached);\n this.notifyLayout(msg);\n this.onAfterAttach(msg);\n break;\n case 'before-detach':\n this.notifyLayout(msg);\n this.onBeforeDetach(msg);\n break;\n case 'after-detach':\n this.clearFlag(Widget.Flag.IsVisible);\n this.clearFlag(Widget.Flag.IsAttached);\n this.notifyLayout(msg);\n this.onAfterDetach(msg);\n break;\n case 'activate-request':\n this.notifyLayout(msg);\n this.onActivateRequest(msg);\n break;\n case 'close-request':\n this.notifyLayout(msg);\n this.onCloseRequest(msg);\n break;\n case 'child-added':\n this.notifyLayout(msg);\n this.onChildAdded(msg);\n break;\n case 'child-removed':\n this.notifyLayout(msg);\n this.onChildRemoved(msg);\n break;\n default:\n this.notifyLayout(msg);\n break;\n }\n }\n /**\n * Invoke the message processing routine of the widget's layout.\n *\n * @param msg - The message to dispatch to the layout.\n *\n * #### Notes\n * This is a no-op if the widget does not have a layout.\n *\n * This will not typically be called directly by user code.\n */\n notifyLayout(msg) {\n if (this._layout) {\n this._layout.processParentMessage(msg);\n }\n }\n /**\n * A message handler invoked on a `'close-request'` message.\n *\n * #### Notes\n * The default implementation unparents or detaches the widget.\n */\n onCloseRequest(msg) {\n if (this.parent) {\n this.parent = null;\n }\n else if (this.isAttached) {\n Widget.detach(this);\n }\n }\n /**\n * A message handler invoked on a `'resize'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onResize(msg) { }\n /**\n * A message handler invoked on an `'update-request'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onUpdateRequest(msg) { }\n /**\n * A message handler invoked on a `'fit-request'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onFitRequest(msg) { }\n /**\n * A message handler invoked on an `'activate-request'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onActivateRequest(msg) { }\n /**\n * A message handler invoked on a `'before-show'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onBeforeShow(msg) { }\n /**\n * A message handler invoked on an `'after-show'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onAfterShow(msg) { }\n /**\n * A message handler invoked on a `'before-hide'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onBeforeHide(msg) { }\n /**\n * A message handler invoked on an `'after-hide'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onAfterHide(msg) { }\n /**\n * A message handler invoked on a `'before-attach'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onBeforeAttach(msg) { }\n /**\n * A message handler invoked on an `'after-attach'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onAfterAttach(msg) { }\n /**\n * A message handler invoked on a `'before-detach'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onBeforeDetach(msg) { }\n /**\n * A message handler invoked on an `'after-detach'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onAfterDetach(msg) { }\n /**\n * A message handler invoked on a `'child-added'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onChildAdded(msg) { }\n /**\n * A message handler invoked on a `'child-removed'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onChildRemoved(msg) { }\n _toggleHidden(hidden) {\n if (hidden) {\n switch (this._hiddenMode) {\n case Widget.HiddenMode.Display:\n this.addClass('lm-mod-hidden');\n break;\n case Widget.HiddenMode.Scale:\n this.node.style.transform = 'scale(0)';\n this.node.setAttribute('aria-hidden', 'true');\n break;\n case Widget.HiddenMode.ContentVisibility:\n // @ts-expect-error content-visibility unknown by DOM lib types\n this.node.style.contentVisibility = 'hidden';\n this.node.style.zIndex = '-1';\n break;\n }\n }\n else {\n switch (this._hiddenMode) {\n case Widget.HiddenMode.Display:\n this.removeClass('lm-mod-hidden');\n break;\n case Widget.HiddenMode.Scale:\n this.node.style.transform = '';\n this.node.removeAttribute('aria-hidden');\n break;\n case Widget.HiddenMode.ContentVisibility:\n // @ts-expect-error content-visibility unknown by DOM lib types\n this.node.style.contentVisibility = '';\n this.node.style.zIndex = '';\n break;\n }\n }\n }\n}\n/**\n * The namespace for the `Widget` class statics.\n */\n(function (Widget) {\n (function (HiddenMode) {\n /**\n * Set a `lm-mod-hidden` CSS class to hide the widget using `display:none`\n * CSS from the standard Lumino CSS.\n */\n HiddenMode[HiddenMode[\"Display\"] = 0] = \"Display\";\n /**\n * Hide the widget by setting the `transform` to `'scale(0)'`.\n */\n HiddenMode[HiddenMode[\"Scale\"] = 1] = \"Scale\";\n /**\n *Hide the widget by setting the `content-visibility` to `'hidden'`.\n */\n HiddenMode[HiddenMode[\"ContentVisibility\"] = 2] = \"ContentVisibility\";\n })(Widget.HiddenMode || (Widget.HiddenMode = {}));\n (function (Flag) {\n /**\n * The widget has been disposed.\n */\n Flag[Flag[\"IsDisposed\"] = 1] = \"IsDisposed\";\n /**\n * The widget is attached to the DOM.\n */\n Flag[Flag[\"IsAttached\"] = 2] = \"IsAttached\";\n /**\n * The widget is hidden.\n */\n Flag[Flag[\"IsHidden\"] = 4] = \"IsHidden\";\n /**\n * The widget is visible.\n */\n Flag[Flag[\"IsVisible\"] = 8] = \"IsVisible\";\n /**\n * A layout cannot be set on the widget.\n */\n Flag[Flag[\"DisallowLayout\"] = 16] = \"DisallowLayout\";\n })(Widget.Flag || (Widget.Flag = {}));\n (function (Msg) {\n /**\n * A singleton `'before-show'` message.\n *\n * #### Notes\n * This message is sent to a widget before it becomes visible.\n *\n * This message is **not** sent when the widget is being attached.\n */\n Msg.BeforeShow = new Message('before-show');\n /**\n * A singleton `'after-show'` message.\n *\n * #### Notes\n * This message is sent to a widget after it becomes visible.\n *\n * This message is **not** sent when the widget is being attached.\n */\n Msg.AfterShow = new Message('after-show');\n /**\n * A singleton `'before-hide'` message.\n *\n * #### Notes\n * This message is sent to a widget before it becomes not-visible.\n *\n * This message is **not** sent when the widget is being detached.\n */\n Msg.BeforeHide = new Message('before-hide');\n /**\n * A singleton `'after-hide'` message.\n *\n * #### Notes\n * This message is sent to a widget after it becomes not-visible.\n *\n * This message is **not** sent when the widget is being detached.\n */\n Msg.AfterHide = new Message('after-hide');\n /**\n * A singleton `'before-attach'` message.\n *\n * #### Notes\n * This message is sent to a widget before it is attached.\n */\n Msg.BeforeAttach = new Message('before-attach');\n /**\n * A singleton `'after-attach'` message.\n *\n * #### Notes\n * This message is sent to a widget after it is attached.\n */\n Msg.AfterAttach = new Message('after-attach');\n /**\n * A singleton `'before-detach'` message.\n *\n * #### Notes\n * This message is sent to a widget before it is detached.\n */\n Msg.BeforeDetach = new Message('before-detach');\n /**\n * A singleton `'after-detach'` message.\n *\n * #### Notes\n * This message is sent to a widget after it is detached.\n */\n Msg.AfterDetach = new Message('after-detach');\n /**\n * A singleton `'parent-changed'` message.\n *\n * #### Notes\n * This message is sent to a widget when its parent has changed.\n */\n Msg.ParentChanged = new Message('parent-changed');\n /**\n * A singleton conflatable `'update-request'` message.\n *\n * #### Notes\n * This message can be dispatched to supporting widgets in order to\n * update their content based on the current widget state. Not all\n * widgets will respond to messages of this type.\n *\n * For widgets with a layout, this message will inform the layout to\n * update the position and size of its child widgets.\n */\n Msg.UpdateRequest = new ConflatableMessage('update-request');\n /**\n * A singleton conflatable `'fit-request'` message.\n *\n * #### Notes\n * For widgets with a layout, this message will inform the layout to\n * recalculate its size constraints to fit the space requirements of\n * its child widgets, and to update their position and size. Not all\n * layouts will respond to messages of this type.\n */\n Msg.FitRequest = new ConflatableMessage('fit-request');\n /**\n * A singleton conflatable `'activate-request'` message.\n *\n * #### Notes\n * This message should be dispatched to a widget when it should\n * perform the actions necessary to activate the widget, which\n * may include focusing its node or descendant node.\n */\n Msg.ActivateRequest = new ConflatableMessage('activate-request');\n /**\n * A singleton conflatable `'close-request'` message.\n *\n * #### Notes\n * This message should be dispatched to a widget when it should close\n * and remove itself from the widget hierarchy.\n */\n Msg.CloseRequest = new ConflatableMessage('close-request');\n })(Widget.Msg || (Widget.Msg = {}));\n /**\n * A message class for child related messages.\n */\n class ChildMessage extends Message {\n /**\n * Construct a new child message.\n *\n * @param type - The message type.\n *\n * @param child - The child widget for the message.\n */\n constructor(type, child) {\n super(type);\n this.child = child;\n }\n }\n Widget.ChildMessage = ChildMessage;\n /**\n * A message class for `'resize'` messages.\n */\n class ResizeMessage extends Message {\n /**\n * Construct a new resize message.\n *\n * @param width - The **offset width** of the widget, or `-1` if\n * the width is not known.\n *\n * @param height - The **offset height** of the widget, or `-1` if\n * the height is not known.\n */\n constructor(width, height) {\n super('resize');\n this.width = width;\n this.height = height;\n }\n }\n Widget.ResizeMessage = ResizeMessage;\n /**\n * The namespace for the `ResizeMessage` class statics.\n */\n (function (ResizeMessage) {\n /**\n * A singleton `'resize'` message with an unknown size.\n */\n ResizeMessage.UnknownSize = new ResizeMessage(-1, -1);\n })(ResizeMessage = Widget.ResizeMessage || (Widget.ResizeMessage = {}));\n /**\n * Attach a widget to a host DOM node.\n *\n * @param widget - The widget of interest.\n *\n * @param host - The DOM node to use as the widget's host.\n *\n * @param ref - The child of `host` to use as the reference element.\n * If this is provided, the widget will be inserted before this\n * node in the host. The default is `null`, which will cause the\n * widget to be added as the last child of the host.\n *\n * #### Notes\n * This will throw an error if the widget is not a root widget, if\n * the widget is already attached, or if the host is not attached\n * to the DOM.\n */\n function attach(widget, host, ref = null) {\n if (widget.parent) {\n throw new Error('Cannot attach a child widget.');\n }\n if (widget.isAttached || widget.node.isConnected) {\n throw new Error('Widget is already attached.');\n }\n if (!host.isConnected) {\n throw new Error('Host is not attached.');\n }\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);\n host.insertBefore(widget.node, ref);\n MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);\n }\n Widget.attach = attach;\n /**\n * Detach the widget from its host DOM node.\n *\n * @param widget - The widget of interest.\n *\n * #### Notes\n * This will throw an error if the widget is not a root widget,\n * or if the widget is not attached to the DOM.\n */\n function detach(widget) {\n if (widget.parent) {\n throw new Error('Cannot detach a child widget.');\n }\n if (!widget.isAttached || !widget.node.isConnected) {\n throw new Error('Widget is not attached.');\n }\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);\n widget.node.parentNode.removeChild(widget.node);\n MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);\n }\n Widget.detach = detach;\n})(Widget || (Widget = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private$j;\n(function (Private) {\n /**\n * An attached property for the widget title object.\n */\n Private.titleProperty = new AttachedProperty({\n name: 'title',\n create: owner => new Title({ owner })\n });\n /**\n * Create a DOM node for the given widget options.\n */\n function createNode(options) {\n return options.node || document.createElement(options.tag || 'div');\n }\n Private.createNode = createNode;\n})(Private$j || (Private$j = {}));\n\n/**\n * An abstract base class for creating lumino layouts.\n *\n * #### Notes\n * A layout is used to add widgets to a parent and to arrange those\n * widgets within the parent's DOM node.\n *\n * This class implements the base functionality which is required of\n * nearly all layouts. It must be subclassed in order to be useful.\n *\n * Notably, this class does not define a uniform interface for adding\n * widgets to the layout. A subclass should define that API in a way\n * which is meaningful for its intended use.\n */\nclass Layout {\n /**\n * Construct a new layout.\n *\n * @param options - The options for initializing the layout.\n */\n constructor(options = {}) {\n this._disposed = false;\n this._parent = null;\n this._fitPolicy = options.fitPolicy || 'set-min-size';\n }\n /**\n * Dispose of the resources held by the layout.\n *\n * #### Notes\n * This should be reimplemented to clear and dispose of the widgets.\n *\n * All reimplementations should call the superclass method.\n *\n * This method is called automatically when the parent is disposed.\n */\n dispose() {\n this._parent = null;\n this._disposed = true;\n Signal.clearData(this);\n AttachedProperty.clearData(this);\n }\n /**\n * Test whether the layout is disposed.\n */\n get isDisposed() {\n return this._disposed;\n }\n /**\n * Get the parent widget of the layout.\n */\n get parent() {\n return this._parent;\n }\n /**\n * Set the parent widget of the layout.\n *\n * #### Notes\n * This is set automatically when installing the layout on the parent\n * widget. The parent widget should not be set directly by user code.\n */\n set parent(value) {\n if (this._parent === value) {\n return;\n }\n if (this._parent) {\n throw new Error('Cannot change parent widget.');\n }\n if (value.layout !== this) {\n throw new Error('Invalid parent widget.');\n }\n this._parent = value;\n this.init();\n }\n /**\n * Get the fit policy for the layout.\n *\n * #### Notes\n * The fit policy controls the computed size constraints which are\n * applied to the parent widget by the layout.\n *\n * Some layout implementations may ignore the fit policy.\n */\n get fitPolicy() {\n return this._fitPolicy;\n }\n /**\n * Set the fit policy for the layout.\n *\n * #### Notes\n * The fit policy controls the computed size constraints which are\n * applied to the parent widget by the layout.\n *\n * Some layout implementations may ignore the fit policy.\n *\n * Changing the fit policy will clear the current size constraint\n * for the parent widget and then re-fit the parent.\n */\n set fitPolicy(value) {\n // Bail if the policy does not change\n if (this._fitPolicy === value) {\n return;\n }\n // Update the internal policy.\n this._fitPolicy = value;\n // Clear the size constraints and schedule a fit of the parent.\n if (this._parent) {\n let style = this._parent.node.style;\n style.minWidth = '';\n style.minHeight = '';\n style.maxWidth = '';\n style.maxHeight = '';\n this._parent.fit();\n }\n }\n /**\n * Process a message sent to the parent widget.\n *\n * @param msg - The message sent to the parent widget.\n *\n * #### Notes\n * This method is called by the parent widget to process a message.\n *\n * Subclasses may reimplement this method as needed.\n */\n processParentMessage(msg) {\n switch (msg.type) {\n case 'resize':\n this.onResize(msg);\n break;\n case 'update-request':\n this.onUpdateRequest(msg);\n break;\n case 'fit-request':\n this.onFitRequest(msg);\n break;\n case 'before-show':\n this.onBeforeShow(msg);\n break;\n case 'after-show':\n this.onAfterShow(msg);\n break;\n case 'before-hide':\n this.onBeforeHide(msg);\n break;\n case 'after-hide':\n this.onAfterHide(msg);\n break;\n case 'before-attach':\n this.onBeforeAttach(msg);\n break;\n case 'after-attach':\n this.onAfterAttach(msg);\n break;\n case 'before-detach':\n this.onBeforeDetach(msg);\n break;\n case 'after-detach':\n this.onAfterDetach(msg);\n break;\n case 'child-removed':\n this.onChildRemoved(msg);\n break;\n case 'child-shown':\n this.onChildShown(msg);\n break;\n case 'child-hidden':\n this.onChildHidden(msg);\n break;\n }\n }\n /**\n * Perform layout initialization which requires the parent widget.\n *\n * #### Notes\n * This method is invoked immediately after the layout is installed\n * on the parent widget.\n *\n * The default implementation reparents all of the widgets to the\n * layout parent widget.\n *\n * Subclasses should reimplement this method and attach the child\n * widget nodes to the parent widget's node.\n */\n init() {\n for (const widget of this) {\n widget.parent = this.parent;\n }\n }\n /**\n * A message handler invoked on a `'resize'` message.\n *\n * #### Notes\n * The layout should ensure that its widgets are resized according\n * to the specified layout space, and that they are sent a `'resize'`\n * message if appropriate.\n *\n * The default implementation of this method sends an `UnknownSize`\n * resize message to all widgets.\n *\n * This may be reimplemented by subclasses as needed.\n */\n onResize(msg) {\n for (const widget of this) {\n MessageLoop.sendMessage(widget, Widget.ResizeMessage.UnknownSize);\n }\n }\n /**\n * A message handler invoked on an `'update-request'` message.\n *\n * #### Notes\n * The layout should ensure that its widgets are resized according\n * to the available layout space, and that they are sent a `'resize'`\n * message if appropriate.\n *\n * The default implementation of this method sends an `UnknownSize`\n * resize message to all widgets.\n *\n * This may be reimplemented by subclasses as needed.\n */\n onUpdateRequest(msg) {\n for (const widget of this) {\n MessageLoop.sendMessage(widget, Widget.ResizeMessage.UnknownSize);\n }\n }\n /**\n * A message handler invoked on a `'before-attach'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message\n * to all widgets. It assumes all widget nodes are attached to the\n * parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n onBeforeAttach(msg) {\n for (const widget of this) {\n MessageLoop.sendMessage(widget, msg);\n }\n }\n /**\n * A message handler invoked on an `'after-attach'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message\n * to all widgets. It assumes all widget nodes are attached to the\n * parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n onAfterAttach(msg) {\n for (const widget of this) {\n MessageLoop.sendMessage(widget, msg);\n }\n }\n /**\n * A message handler invoked on a `'before-detach'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message\n * to all widgets. It assumes all widget nodes are attached to the\n * parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n onBeforeDetach(msg) {\n for (const widget of this) {\n MessageLoop.sendMessage(widget, msg);\n }\n }\n /**\n * A message handler invoked on an `'after-detach'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message\n * to all widgets. It assumes all widget nodes are attached to the\n * parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n onAfterDetach(msg) {\n for (const widget of this) {\n MessageLoop.sendMessage(widget, msg);\n }\n }\n /**\n * A message handler invoked on a `'before-show'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message to\n * all non-hidden widgets. It assumes all widget nodes are attached\n * to the parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n onBeforeShow(msg) {\n for (const widget of this) {\n if (!widget.isHidden) {\n MessageLoop.sendMessage(widget, msg);\n }\n }\n }\n /**\n * A message handler invoked on an `'after-show'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message to\n * all non-hidden widgets. It assumes all widget nodes are attached\n * to the parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n onAfterShow(msg) {\n for (const widget of this) {\n if (!widget.isHidden) {\n MessageLoop.sendMessage(widget, msg);\n }\n }\n }\n /**\n * A message handler invoked on a `'before-hide'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message to\n * all non-hidden widgets. It assumes all widget nodes are attached\n * to the parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n onBeforeHide(msg) {\n for (const widget of this) {\n if (!widget.isHidden) {\n MessageLoop.sendMessage(widget, msg);\n }\n }\n }\n /**\n * A message handler invoked on an `'after-hide'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message to\n * all non-hidden widgets. It assumes all widget nodes are attached\n * to the parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n onAfterHide(msg) {\n for (const widget of this) {\n if (!widget.isHidden) {\n MessageLoop.sendMessage(widget, msg);\n }\n }\n }\n /**\n * A message handler invoked on a `'child-removed'` message.\n *\n * #### Notes\n * This will remove the child widget from the layout.\n *\n * Subclasses should **not** typically reimplement this method.\n */\n onChildRemoved(msg) {\n this.removeWidget(msg.child);\n }\n /**\n * A message handler invoked on a `'fit-request'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onFitRequest(msg) { }\n /**\n * A message handler invoked on a `'child-shown'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onChildShown(msg) { }\n /**\n * A message handler invoked on a `'child-hidden'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n onChildHidden(msg) { }\n}\n/**\n * The namespace for the `Layout` class statics.\n */\n(function (Layout) {\n /**\n * Get the horizontal alignment for a widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The horizontal alignment for the widget.\n *\n * #### Notes\n * If the layout width allocated to a widget is larger than its max\n * width, the horizontal alignment controls how the widget is placed\n * within the extra horizontal space.\n *\n * If the allocated width is less than the widget's max width, the\n * horizontal alignment has no effect.\n *\n * Some layout implementations may ignore horizontal alignment.\n */\n function getHorizontalAlignment(widget) {\n return Private$i.horizontalAlignmentProperty.get(widget);\n }\n Layout.getHorizontalAlignment = getHorizontalAlignment;\n /**\n * Set the horizontal alignment for a widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the horizontal alignment.\n *\n * #### Notes\n * If the layout width allocated to a widget is larger than its max\n * width, the horizontal alignment controls how the widget is placed\n * within the extra horizontal space.\n *\n * If the allocated width is less than the widget's max width, the\n * horizontal alignment has no effect.\n *\n * Some layout implementations may ignore horizontal alignment.\n *\n * Changing the horizontal alignment will post an `update-request`\n * message to widget's parent, provided the parent has a layout\n * installed.\n */\n function setHorizontalAlignment(widget, value) {\n Private$i.horizontalAlignmentProperty.set(widget, value);\n }\n Layout.setHorizontalAlignment = setHorizontalAlignment;\n /**\n * Get the vertical alignment for a widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The vertical alignment for the widget.\n *\n * #### Notes\n * If the layout height allocated to a widget is larger than its max\n * height, the vertical alignment controls how the widget is placed\n * within the extra vertical space.\n *\n * If the allocated height is less than the widget's max height, the\n * vertical alignment has no effect.\n *\n * Some layout implementations may ignore vertical alignment.\n */\n function getVerticalAlignment(widget) {\n return Private$i.verticalAlignmentProperty.get(widget);\n }\n Layout.getVerticalAlignment = getVerticalAlignment;\n /**\n * Set the vertical alignment for a widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the vertical alignment.\n *\n * #### Notes\n * If the layout height allocated to a widget is larger than its max\n * height, the vertical alignment controls how the widget is placed\n * within the extra vertical space.\n *\n * If the allocated height is less than the widget's max height, the\n * vertical alignment has no effect.\n *\n * Some layout implementations may ignore vertical alignment.\n *\n * Changing the horizontal alignment will post an `update-request`\n * message to widget's parent, provided the parent has a layout\n * installed.\n */\n function setVerticalAlignment(widget, value) {\n Private$i.verticalAlignmentProperty.set(widget, value);\n }\n Layout.setVerticalAlignment = setVerticalAlignment;\n})(Layout || (Layout = {}));\n/**\n * An object which assists in the absolute layout of widgets.\n *\n * #### Notes\n * This class is useful when implementing a layout which arranges its\n * widgets using absolute positioning.\n *\n * This class is used by nearly all of the built-in lumino layouts.\n */\nclass LayoutItem {\n /**\n * Construct a new layout item.\n *\n * @param widget - The widget to be managed by the item.\n *\n * #### Notes\n * The widget will be set to absolute positioning.\n * The widget will use strict CSS containment.\n */\n constructor(widget) {\n this._top = NaN;\n this._left = NaN;\n this._width = NaN;\n this._height = NaN;\n this._minWidth = 0;\n this._minHeight = 0;\n this._maxWidth = Infinity;\n this._maxHeight = Infinity;\n this._disposed = false;\n this.widget = widget;\n this.widget.node.style.position = 'absolute';\n this.widget.node.style.contain = 'strict';\n }\n /**\n * Dispose of the the layout item.\n *\n * #### Notes\n * This will reset the positioning of the widget.\n */\n dispose() {\n // Do nothing if the item is already disposed.\n if (this._disposed) {\n return;\n }\n // Mark the item as disposed.\n this._disposed = true;\n // Reset the widget style.\n let style = this.widget.node.style;\n style.position = '';\n style.top = '';\n style.left = '';\n style.width = '';\n style.height = '';\n style.contain = '';\n }\n /**\n * The computed minimum width of the widget.\n *\n * #### Notes\n * This value can be updated by calling the `fit` method.\n */\n get minWidth() {\n return this._minWidth;\n }\n /**\n * The computed minimum height of the widget.\n *\n * #### Notes\n * This value can be updated by calling the `fit` method.\n */\n get minHeight() {\n return this._minHeight;\n }\n /**\n * The computed maximum width of the widget.\n *\n * #### Notes\n * This value can be updated by calling the `fit` method.\n */\n get maxWidth() {\n return this._maxWidth;\n }\n /**\n * The computed maximum height of the widget.\n *\n * #### Notes\n * This value can be updated by calling the `fit` method.\n */\n get maxHeight() {\n return this._maxHeight;\n }\n /**\n * Whether the layout item is disposed.\n */\n get isDisposed() {\n return this._disposed;\n }\n /**\n * Whether the managed widget is hidden.\n */\n get isHidden() {\n return this.widget.isHidden;\n }\n /**\n * Whether the managed widget is visible.\n */\n get isVisible() {\n return this.widget.isVisible;\n }\n /**\n * Whether the managed widget is attached.\n */\n get isAttached() {\n return this.widget.isAttached;\n }\n /**\n * Update the computed size limits of the managed widget.\n */\n fit() {\n let limits = ElementExt.sizeLimits(this.widget.node);\n this._minWidth = limits.minWidth;\n this._minHeight = limits.minHeight;\n this._maxWidth = limits.maxWidth;\n this._maxHeight = limits.maxHeight;\n }\n /**\n * Update the position and size of the managed widget.\n *\n * @param left - The left edge position of the layout box.\n *\n * @param top - The top edge position of the layout box.\n *\n * @param width - The width of the layout box.\n *\n * @param height - The height of the layout box.\n */\n update(left, top, width, height) {\n // Clamp the size to the computed size limits.\n let clampW = Math.max(this._minWidth, Math.min(width, this._maxWidth));\n let clampH = Math.max(this._minHeight, Math.min(height, this._maxHeight));\n // Adjust the left edge for the horizontal alignment, if needed.\n if (clampW < width) {\n switch (Layout.getHorizontalAlignment(this.widget)) {\n case 'left':\n break;\n case 'center':\n left += (width - clampW) / 2;\n break;\n case 'right':\n left += width - clampW;\n break;\n default:\n throw 'unreachable';\n }\n }\n // Adjust the top edge for the vertical alignment, if needed.\n if (clampH < height) {\n switch (Layout.getVerticalAlignment(this.widget)) {\n case 'top':\n break;\n case 'center':\n top += (height - clampH) / 2;\n break;\n case 'bottom':\n top += height - clampH;\n break;\n default:\n throw 'unreachable';\n }\n }\n // Set up the resize variables.\n let resized = false;\n let style = this.widget.node.style;\n // Update the top edge of the widget if needed.\n if (this._top !== top) {\n this._top = top;\n style.top = `${top}px`;\n }\n // Update the left edge of the widget if needed.\n if (this._left !== left) {\n this._left = left;\n style.left = `${left}px`;\n }\n // Update the width of the widget if needed.\n if (this._width !== clampW) {\n resized = true;\n this._width = clampW;\n style.width = `${clampW}px`;\n }\n // Update the height of the widget if needed.\n if (this._height !== clampH) {\n resized = true;\n this._height = clampH;\n style.height = `${clampH}px`;\n }\n // Send a resize message to the widget if needed.\n if (resized) {\n let msg = new Widget.ResizeMessage(clampW, clampH);\n MessageLoop.sendMessage(this.widget, msg);\n }\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private$i;\n(function (Private) {\n /**\n * The attached property for a widget horizontal alignment.\n */\n Private.horizontalAlignmentProperty = new AttachedProperty({\n name: 'horizontalAlignment',\n create: () => 'center',\n changed: onAlignmentChanged\n });\n /**\n * The attached property for a widget vertical alignment.\n */\n Private.verticalAlignmentProperty = new AttachedProperty({\n name: 'verticalAlignment',\n create: () => 'top',\n changed: onAlignmentChanged\n });\n /**\n * The change handler for the attached alignment properties.\n */\n function onAlignmentChanged(child) {\n if (child.parent && child.parent.layout) {\n child.parent.update();\n }\n }\n})(Private$i || (Private$i = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A concrete layout implementation suitable for many use cases.\n *\n * #### Notes\n * This class is suitable as a base class for implementing a variety of\n * layouts, but can also be used directly with standard CSS to layout a\n * collection of widgets.\n */\nclass PanelLayout extends Layout {\n constructor() {\n super(...arguments);\n this._widgets = [];\n }\n /**\n * Dispose of the resources held by the layout.\n *\n * #### Notes\n * This will clear and dispose all widgets in the layout.\n *\n * All reimplementations should call the superclass method.\n *\n * This method is called automatically when the parent is disposed.\n */\n dispose() {\n while (this._widgets.length > 0) {\n this._widgets.pop().dispose();\n }\n super.dispose();\n }\n /**\n * A read-only array of the widgets in the layout.\n */\n get widgets() {\n return this._widgets;\n }\n /**\n * Create an iterator over the widgets in the layout.\n *\n * @returns A new iterator over the widgets in the layout.\n */\n *[Symbol.iterator]() {\n yield* this._widgets;\n }\n /**\n * Add a widget to the end of the layout.\n *\n * @param widget - The widget to add to the layout.\n *\n * #### Notes\n * If the widget is already contained in the layout, it will be moved.\n */\n addWidget(widget) {\n this.insertWidget(this._widgets.length, widget);\n }\n /**\n * Insert a widget into the layout at the specified index.\n *\n * @param index - The index at which to insert the widget.\n *\n * @param widget - The widget to insert into the layout.\n *\n * #### Notes\n * The index will be clamped to the bounds of the widgets.\n *\n * If the widget is already added to the layout, it will be moved.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n */\n insertWidget(index, widget) {\n // Remove the widget from its current parent. This is a no-op\n // if the widget's parent is already the layout parent widget.\n widget.parent = this.parent;\n // Look up the current index of the widget.\n let i = this._widgets.indexOf(widget);\n // Clamp the insert index to the array bounds.\n let j = Math.max(0, Math.min(index, this._widgets.length));\n // If the widget is not in the array, insert it.\n if (i === -1) {\n // Insert the widget into the array.\n ArrayExt.insert(this._widgets, j, widget);\n // If the layout is parented, attach the widget to the DOM.\n if (this.parent) {\n this.attachWidget(j, widget);\n }\n // There is nothing more to do.\n return;\n }\n // Otherwise, the widget exists in the array and should be moved.\n // Adjust the index if the location is at the end of the array.\n if (j === this._widgets.length) {\n j--;\n }\n // Bail if there is no effective move.\n if (i === j) {\n return;\n }\n // Move the widget to the new location.\n ArrayExt.move(this._widgets, i, j);\n // If the layout is parented, move the widget in the DOM.\n if (this.parent) {\n this.moveWidget(i, j, widget);\n }\n }\n /**\n * Remove a widget from the layout.\n *\n * @param widget - The widget to remove from the layout.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n */\n removeWidget(widget) {\n this.removeWidgetAt(this._widgets.indexOf(widget));\n }\n /**\n * Remove the widget at a given index from the layout.\n *\n * @param index - The index of the widget to remove.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n */\n removeWidgetAt(index) {\n // Remove the widget from the array.\n let widget = ArrayExt.removeAt(this._widgets, index);\n // If the layout is parented, detach the widget from the DOM.\n if (widget && this.parent) {\n this.detachWidget(index, widget);\n }\n }\n /**\n * Perform layout initialization which requires the parent widget.\n */\n init() {\n super.init();\n let index = 0;\n for (const widget of this) {\n this.attachWidget(index++, widget);\n }\n }\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This method is called automatically by the panel layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation adds the widgets's node to the parent's\n * node at the proper location, and sends the appropriate attach\n * messages to the widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is added to the parent's node.\n */\n attachWidget(index, widget) {\n // Look up the next sibling reference node.\n let ref = this.parent.node.children[index];\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);\n }\n // Insert the widget's node before the sibling.\n this.parent.node.insertBefore(widget.node, ref);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);\n }\n }\n /**\n * Move a widget in the parent's DOM node.\n *\n * @param fromIndex - The previous index of the widget in the layout.\n *\n * @param toIndex - The current index of the widget in the layout.\n *\n * @param widget - The widget to move in the parent.\n *\n * #### Notes\n * This method is called automatically by the panel layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation moves the widget's node to the proper\n * location in the parent's node and sends the appropriate attach and\n * detach messages to the widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is moved in the parent's node.\n */\n moveWidget(fromIndex, toIndex, widget) {\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget.node);\n // Send an `'after-detach'` and message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);\n }\n // Look up the next sibling reference node.\n let ref = this.parent.node.children[toIndex];\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);\n }\n // Insert the widget's node before the sibling.\n this.parent.node.insertBefore(widget.node, ref);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);\n }\n }\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param index - The previous index of the widget in the layout.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This method is called automatically by the panel layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation removes the widget's node from the\n * parent's node, and sends the appropriate detach messages to the\n * widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is removed from the parent's node.\n */\n detachWidget(index, widget) {\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);\n }\n }\n}\n\n/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\nvar Utils;\n(function (Utils) {\n /**\n * Clamp a dimension value to an integer >= 0.\n */\n function clampDimension(value) {\n return Math.max(0, Math.floor(value));\n }\n Utils.clampDimension = clampDimension;\n})(Utils || (Utils = {}));\nvar Utils$1 = Utils;\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A layout which arranges its widgets into resizable sections.\n */\nclass SplitLayout extends PanelLayout {\n /**\n * Construct a new split layout.\n *\n * @param options - The options for initializing the layout.\n */\n constructor(options) {\n super();\n this.widgetOffset = 0;\n this._fixed = 0;\n this._spacing = 4;\n this._dirty = false;\n this._hasNormedSizes = false;\n this._sizers = [];\n this._items = [];\n this._handles = [];\n this._box = null;\n this._alignment = 'start';\n this._orientation = 'horizontal';\n this.renderer = options.renderer;\n if (options.orientation !== undefined) {\n this._orientation = options.orientation;\n }\n if (options.alignment !== undefined) {\n this._alignment = options.alignment;\n }\n if (options.spacing !== undefined) {\n this._spacing = Utils.clampDimension(options.spacing);\n }\n }\n /**\n * Dispose of the resources held by the layout.\n */\n dispose() {\n // Dispose of the layout items.\n for (const item of this._items) {\n item.dispose();\n }\n // Clear the layout state.\n this._box = null;\n this._items.length = 0;\n this._sizers.length = 0;\n this._handles.length = 0;\n // Dispose of the rest of the layout.\n super.dispose();\n }\n /**\n * Get the layout orientation for the split layout.\n */\n get orientation() {\n return this._orientation;\n }\n /**\n * Set the layout orientation for the split layout.\n */\n set orientation(value) {\n if (this._orientation === value) {\n return;\n }\n this._orientation = value;\n if (!this.parent) {\n return;\n }\n this.parent.dataset['orientation'] = value;\n this.parent.fit();\n }\n /**\n * Get the content alignment for the split layout.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire split layout.\n */\n get alignment() {\n return this._alignment;\n }\n /**\n * Set the content alignment for the split layout.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire split layout.\n */\n set alignment(value) {\n if (this._alignment === value) {\n return;\n }\n this._alignment = value;\n if (!this.parent) {\n return;\n }\n this.parent.dataset['alignment'] = value;\n this.parent.update();\n }\n /**\n * Get the inter-element spacing for the split layout.\n */\n get spacing() {\n return this._spacing;\n }\n /**\n * Set the inter-element spacing for the split layout.\n */\n set spacing(value) {\n value = Utils.clampDimension(value);\n if (this._spacing === value) {\n return;\n }\n this._spacing = value;\n if (!this.parent) {\n return;\n }\n this.parent.fit();\n }\n /**\n * A read-only array of the split handles in the layout.\n */\n get handles() {\n return this._handles;\n }\n /**\n * Get the absolute sizes of the widgets in the layout.\n *\n * @returns A new array of the absolute sizes of the widgets.\n *\n * This method **does not** measure the DOM nodes.\n */\n absoluteSizes() {\n return this._sizers.map(sizer => sizer.size);\n }\n /**\n * Get the relative sizes of the widgets in the layout.\n *\n * @returns A new array of the relative sizes of the widgets.\n *\n * #### Notes\n * The returned sizes reflect the sizes of the widgets normalized\n * relative to their siblings.\n *\n * This method **does not** measure the DOM nodes.\n */\n relativeSizes() {\n return Private$h.normalize(this._sizers.map(sizer => sizer.size));\n }\n /**\n * Set the relative sizes for the widgets in the layout.\n *\n * @param sizes - The relative sizes for the widgets in the panel.\n * @param update - Update the layout after setting relative sizes.\n * Default is True.\n *\n * #### Notes\n * Extra values are ignored, too few will yield an undefined layout.\n *\n * The actual geometry of the DOM nodes is updated asynchronously.\n */\n setRelativeSizes(sizes, update = true) {\n // Copy the sizes and pad with zeros as needed.\n let n = this._sizers.length;\n let temp = sizes.slice(0, n);\n while (temp.length < n) {\n temp.push(0);\n }\n // Normalize the padded sizes.\n let normed = Private$h.normalize(temp);\n // Apply the normalized sizes to the sizers.\n for (let i = 0; i < n; ++i) {\n let sizer = this._sizers[i];\n sizer.sizeHint = normed[i];\n sizer.size = normed[i];\n }\n // Set the flag indicating the sizes are normalized.\n this._hasNormedSizes = true;\n // Trigger an update of the parent widget.\n if (update && this.parent) {\n this.parent.update();\n }\n }\n /**\n * Move the offset position of a split handle.\n *\n * @param index - The index of the handle of the interest.\n *\n * @param position - The desired offset position of the handle.\n *\n * #### Notes\n * The position is relative to the offset parent.\n *\n * This will move the handle as close as possible to the desired\n * position. The sibling widgets will be adjusted as necessary.\n */\n moveHandle(index, position) {\n // Bail if the index is invalid or the handle is hidden.\n let handle = this._handles[index];\n if (!handle || handle.classList.contains('lm-mod-hidden')) {\n return;\n }\n // Compute the desired delta movement for the handle.\n let delta;\n if (this._orientation === 'horizontal') {\n delta = position - handle.offsetLeft;\n }\n else {\n delta = position - handle.offsetTop;\n }\n // Bail if there is no handle movement.\n if (delta === 0) {\n return;\n }\n // Prevent widget resizing unless needed.\n for (let sizer of this._sizers) {\n if (sizer.size > 0) {\n sizer.sizeHint = sizer.size;\n }\n }\n // Adjust the sizers to reflect the handle movement.\n BoxEngine.adjust(this._sizers, index, delta);\n // Update the layout of the widgets.\n if (this.parent) {\n this.parent.update();\n }\n }\n /**\n * Perform layout initialization which requires the parent widget.\n */\n init() {\n this.parent.dataset['orientation'] = this.orientation;\n this.parent.dataset['alignment'] = this.alignment;\n super.init();\n }\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n attachWidget(index, widget) {\n // Create the item, handle, and sizer for the new widget.\n let item = new LayoutItem(widget);\n let handle = Private$h.createHandle(this.renderer);\n let average = Private$h.averageSize(this._sizers);\n let sizer = Private$h.createSizer(average);\n // Insert the item, handle, and sizer into the internal arrays.\n ArrayExt.insert(this._items, index, item);\n ArrayExt.insert(this._sizers, index, sizer);\n ArrayExt.insert(this._handles, index, handle);\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);\n }\n // Add the widget and handle nodes to the parent.\n this.parent.node.appendChild(widget.node);\n this.parent.node.appendChild(handle);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n }\n /**\n * Move a widget in the parent's DOM node.\n *\n * @param fromIndex - The previous index of the widget in the layout.\n *\n * @param toIndex - The current index of the widget in the layout.\n *\n * @param widget - The widget to move in the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n moveWidget(fromIndex, toIndex, widget) {\n // Move the item, sizer, and handle for the widget.\n ArrayExt.move(this._items, fromIndex, toIndex);\n ArrayExt.move(this._sizers, fromIndex, toIndex);\n ArrayExt.move(this._handles, fromIndex, toIndex);\n // Post a fit request to the parent to show/hide last handle.\n this.parent.fit();\n }\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param index - The previous index of the widget in the layout.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n detachWidget(index, widget) {\n // Remove the item, handle, and sizer for the widget.\n let item = ArrayExt.removeAt(this._items, index);\n let handle = ArrayExt.removeAt(this._handles, index);\n ArrayExt.removeAt(this._sizers, index);\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);\n }\n // Remove the widget and handle nodes from the parent.\n this.parent.node.removeChild(widget.node);\n this.parent.node.removeChild(handle);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);\n }\n // Dispose of the layout item.\n item.dispose();\n // Post a fit request for the parent widget.\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n onBeforeShow(msg) {\n super.onBeforeShow(msg);\n this.parent.update();\n }\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n onBeforeAttach(msg) {\n super.onBeforeAttach(msg);\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n onChildShown(msg) {\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n onChildHidden(msg) {\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'resize'` message.\n */\n onResize(msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n }\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n onUpdateRequest(msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n }\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n onFitRequest(msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n }\n /**\n * Update the item position.\n *\n * @param i Item index\n * @param isHorizontal Whether the layout is horizontal or not\n * @param left Left position in pixels\n * @param top Top position in pixels\n * @param height Item height\n * @param width Item width\n * @param size Item size\n */\n updateItemPosition(i, isHorizontal, left, top, height, width, size) {\n const item = this._items[i];\n if (item.isHidden) {\n return;\n }\n // Fetch the style for the handle.\n let handleStyle = this._handles[i].style;\n // Update the widget and handle, and advance the relevant edge.\n if (isHorizontal) {\n left += this.widgetOffset;\n item.update(left, top, size, height);\n left += size;\n handleStyle.top = `${top}px`;\n handleStyle.left = `${left}px`;\n handleStyle.width = `${this._spacing}px`;\n handleStyle.height = `${height}px`;\n }\n else {\n top += this.widgetOffset;\n item.update(left, top, width, size);\n top += size;\n handleStyle.top = `${top}px`;\n handleStyle.left = `${left}px`;\n handleStyle.width = `${width}px`;\n handleStyle.height = `${this._spacing}px`;\n }\n }\n /**\n * Fit the layout to the total size required by the widgets.\n */\n _fit() {\n // Update the handles and track the visible widget count.\n let nVisible = 0;\n let lastHandleIndex = -1;\n for (let i = 0, n = this._items.length; i < n; ++i) {\n if (this._items[i].isHidden) {\n this._handles[i].classList.add('lm-mod-hidden');\n }\n else {\n this._handles[i].classList.remove('lm-mod-hidden');\n lastHandleIndex = i;\n nVisible++;\n }\n }\n // Hide the handle for the last visible widget.\n if (lastHandleIndex !== -1) {\n this._handles[lastHandleIndex].classList.add('lm-mod-hidden');\n }\n // Update the fixed space for the visible items.\n this._fixed =\n this._spacing * Math.max(0, nVisible - 1) +\n this.widgetOffset * this._items.length;\n // Setup the computed minimum size.\n let horz = this._orientation === 'horizontal';\n let minW = horz ? this._fixed : 0;\n let minH = horz ? 0 : this._fixed;\n // Update the sizers and computed size limits.\n for (let i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item and corresponding box sizer.\n let item = this._items[i];\n let sizer = this._sizers[i];\n // Prevent resizing unless necessary.\n if (sizer.size > 0) {\n sizer.sizeHint = sizer.size;\n }\n // If the item is hidden, it should consume zero size.\n if (item.isHidden) {\n sizer.minSize = 0;\n sizer.maxSize = 0;\n continue;\n }\n // Update the size limits for the item.\n item.fit();\n // Update the stretch factor.\n sizer.stretch = SplitLayout.getStretch(item.widget);\n // Update the sizer limits and computed min size.\n if (horz) {\n sizer.minSize = item.minWidth;\n sizer.maxSize = item.maxWidth;\n minW += item.minWidth;\n minH = Math.max(minH, item.minHeight);\n }\n else {\n sizer.minSize = item.minHeight;\n sizer.maxSize = item.maxHeight;\n minH += item.minHeight;\n minW = Math.max(minW, item.minWidth);\n }\n }\n // Update the box sizing and add it to the computed min size.\n let box = (this._box = ElementExt.boxSizing(this.parent.node));\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n let style = this.parent.node.style;\n style.minWidth = `${minW}px`;\n style.minHeight = `${minH}px`;\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n MessageLoop.sendMessage(this.parent.parent, Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n MessageLoop.sendMessage(this.parent, Widget.Msg.UpdateRequest);\n }\n }\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n _update(offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Compute the visible item count.\n let nVisible = 0;\n for (let i = 0, n = this._items.length; i < n; ++i) {\n nVisible += +!this._items[i].isHidden;\n }\n // Bail early if there are no visible items to layout.\n if (nVisible === 0 && this.widgetOffset === 0) {\n return;\n }\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = ElementExt.boxSizing(this.parent.node);\n }\n // Compute the actual layout bounds adjusted for border and padding.\n let top = this._box.paddingTop;\n let left = this._box.paddingLeft;\n let width = offsetWidth - this._box.horizontalSum;\n let height = offsetHeight - this._box.verticalSum;\n // Set up the variables for justification and alignment offset.\n let extra = 0;\n let offset = 0;\n let horz = this._orientation === 'horizontal';\n if (nVisible > 0) {\n // Compute the adjusted layout space.\n let space;\n if (horz) {\n // left += this.widgetOffset;\n space = Math.max(0, width - this._fixed);\n }\n else {\n // top += this.widgetOffset;\n space = Math.max(0, height - this._fixed);\n }\n // Scale the size hints if they are normalized.\n if (this._hasNormedSizes) {\n for (let sizer of this._sizers) {\n sizer.sizeHint *= space;\n }\n this._hasNormedSizes = false;\n }\n // Distribute the layout space to the box sizers.\n let delta = BoxEngine.calc(this._sizers, space);\n // Account for alignment if there is extra layout space.\n if (delta > 0) {\n switch (this._alignment) {\n case 'start':\n break;\n case 'center':\n extra = 0;\n offset = delta / 2;\n break;\n case 'end':\n extra = 0;\n offset = delta;\n break;\n case 'justify':\n extra = delta / nVisible;\n offset = 0;\n break;\n default:\n throw 'unreachable';\n }\n }\n }\n // Layout the items using the computed box sizes.\n for (let i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n const item = this._items[i];\n // Fetch the computed size for the widget.\n const size = item.isHidden ? 0 : this._sizers[i].size + extra;\n this.updateItemPosition(i, horz, horz ? left + offset : left, horz ? top : top + offset, height, width, size);\n const fullOffset = this.widgetOffset +\n (this._handles[i].classList.contains('lm-mod-hidden')\n ? 0\n : this._spacing);\n if (horz) {\n left += size + fullOffset;\n }\n else {\n top += size + fullOffset;\n }\n }\n }\n}\n/**\n * The namespace for the `SplitLayout` class statics.\n */\n(function (SplitLayout) {\n /**\n * Get the split layout stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The split layout stretch factor for the widget.\n */\n function getStretch(widget) {\n return Private$h.stretchProperty.get(widget);\n }\n SplitLayout.getStretch = getStretch;\n /**\n * Set the split layout stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the stretch factor.\n */\n function setStretch(widget, value) {\n Private$h.stretchProperty.set(widget, value);\n }\n SplitLayout.setStretch = setStretch;\n})(SplitLayout || (SplitLayout = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private$h;\n(function (Private) {\n /**\n * The property descriptor for a widget stretch factor.\n */\n Private.stretchProperty = new AttachedProperty({\n name: 'stretch',\n create: () => 0,\n coerce: (owner, value) => Math.max(0, Math.floor(value)),\n changed: onChildSizingChanged\n });\n /**\n * Create a new box sizer with the given size hint.\n */\n function createSizer(size) {\n let sizer = new BoxSizer();\n sizer.sizeHint = Math.floor(size);\n return sizer;\n }\n Private.createSizer = createSizer;\n /**\n * Create a new split handle node using the given renderer.\n */\n function createHandle(renderer) {\n let handle = renderer.createHandle();\n handle.style.position = 'absolute';\n // Do not use size containment to allow the handle to fill the available space\n handle.style.contain = 'style';\n return handle;\n }\n Private.createHandle = createHandle;\n /**\n * Compute the average size of an array of box sizers.\n */\n function averageSize(sizers) {\n return sizers.reduce((v, s) => v + s.size, 0) / sizers.length || 0;\n }\n Private.averageSize = averageSize;\n /**\n * Normalize an array of values.\n */\n function normalize(values) {\n let n = values.length;\n if (n === 0) {\n return [];\n }\n let sum = values.reduce((a, b) => a + Math.abs(b), 0);\n return sum === 0 ? values.map(v => 1 / n) : values.map(v => v / sum);\n }\n Private.normalize = normalize;\n /**\n * The change handler for the attached sizing properties.\n */\n function onChildSizingChanged(child) {\n if (child.parent && child.parent.layout instanceof SplitLayout) {\n child.parent.fit();\n }\n }\n})(Private$h || (Private$h = {}));\n\n/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n/**\n * A layout which arranges its widgets into collapsible resizable sections.\n */\nclass AccordionLayout extends SplitLayout {\n /**\n * Construct a new accordion layout.\n *\n * @param options - The options for initializing the layout.\n *\n * #### Notes\n * The default orientation will be vertical.\n *\n * Titles must be rotated for horizontal accordion panel using CSS: see accordionpanel.css\n */\n constructor(options) {\n super({ ...options, orientation: options.orientation || 'vertical' });\n this._titles = [];\n this.titleSpace = options.titleSpace || 22;\n }\n /**\n * The section title height or width depending on the orientation.\n */\n get titleSpace() {\n return this.widgetOffset;\n }\n set titleSpace(value) {\n value = Utils$1.clampDimension(value);\n if (this.widgetOffset === value) {\n return;\n }\n this.widgetOffset = value;\n if (!this.parent) {\n return;\n }\n this.parent.fit();\n }\n /**\n * A read-only array of the section titles in the panel.\n */\n get titles() {\n return this._titles;\n }\n /**\n * Dispose of the resources held by the layout.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n // Clear the layout state.\n this._titles.length = 0;\n // Dispose of the rest of the layout.\n super.dispose();\n }\n updateTitle(index, widget) {\n const oldTitle = this._titles[index];\n const expanded = oldTitle.classList.contains('lm-mod-expanded');\n const newTitle = Private$g.createTitle(this.renderer, widget.title, expanded);\n this._titles[index] = newTitle;\n // Add the title node to the parent before the widget.\n this.parent.node.replaceChild(newTitle, oldTitle);\n }\n /**\n * Insert a widget into the layout at the specified index.\n *\n * @param index - The index at which to insert the widget.\n *\n * @param widget - The widget to insert into the layout.\n *\n * #### Notes\n * The index will be clamped to the bounds of the widgets.\n *\n * If the widget is already added to the layout, it will be moved.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n */\n insertWidget(index, widget) {\n if (!widget.id) {\n widget.id = `id-${UUID.uuid4()}`;\n }\n super.insertWidget(index, widget);\n }\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n */\n attachWidget(index, widget) {\n const title = Private$g.createTitle(this.renderer, widget.title);\n ArrayExt.insert(this._titles, index, title);\n // Add the title node to the parent before the widget.\n this.parent.node.appendChild(title);\n widget.node.setAttribute('role', 'region');\n widget.node.setAttribute('aria-labelledby', title.id);\n super.attachWidget(index, widget);\n }\n /**\n * Move a widget in the parent's DOM node.\n *\n * @param fromIndex - The previous index of the widget in the layout.\n *\n * @param toIndex - The current index of the widget in the layout.\n *\n * @param widget - The widget to move in the parent.\n */\n moveWidget(fromIndex, toIndex, widget) {\n ArrayExt.move(this._titles, fromIndex, toIndex);\n super.moveWidget(fromIndex, toIndex, widget);\n }\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param index - The previous index of the widget in the layout.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n detachWidget(index, widget) {\n const title = ArrayExt.removeAt(this._titles, index);\n this.parent.node.removeChild(title);\n super.detachWidget(index, widget);\n }\n /**\n * Update the item position.\n *\n * @param i Item index\n * @param isHorizontal Whether the layout is horizontal or not\n * @param left Left position in pixels\n * @param top Top position in pixels\n * @param height Item height\n * @param width Item width\n * @param size Item size\n */\n updateItemPosition(i, isHorizontal, left, top, height, width, size) {\n const titleStyle = this._titles[i].style;\n // Titles must be rotated for horizontal accordion panel using CSS: see accordionpanel.css\n titleStyle.top = `${top}px`;\n titleStyle.left = `${left}px`;\n titleStyle.height = `${this.widgetOffset}px`;\n if (isHorizontal) {\n titleStyle.width = `${height}px`;\n }\n else {\n titleStyle.width = `${width}px`;\n }\n super.updateItemPosition(i, isHorizontal, left, top, height, width, size);\n }\n}\nvar Private$g;\n(function (Private) {\n /**\n * Create the title HTML element.\n *\n * @param renderer Accordion renderer\n * @param data Widget title\n * @returns Title HTML element\n */\n function createTitle(renderer, data, expanded = true) {\n const title = renderer.createSectionTitle(data);\n title.style.position = 'absolute';\n title.style.contain = 'strict';\n title.setAttribute('aria-label', `${data.label} Section`);\n title.setAttribute('aria-expanded', expanded ? 'true' : 'false');\n title.setAttribute('aria-controls', data.owner.id);\n if (expanded) {\n title.classList.add('lm-mod-expanded');\n }\n return title;\n }\n Private.createTitle = createTitle;\n})(Private$g || (Private$g = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A simple and convenient panel widget class.\n *\n * #### Notes\n * This class is suitable as a base class for implementing a variety of\n * convenience panel widgets, but can also be used directly with CSS to\n * arrange a collection of widgets.\n *\n * This class provides a convenience wrapper around a {@link PanelLayout}.\n */\nclass Panel extends Widget {\n /**\n * Construct a new panel.\n *\n * @param options - The options for initializing the panel.\n */\n constructor(options = {}) {\n super();\n this.addClass('lm-Panel');\n this.layout = Private$f.createLayout(options);\n }\n /**\n * A read-only array of the widgets in the panel.\n */\n get widgets() {\n return this.layout.widgets;\n }\n /**\n * Add a widget to the end of the panel.\n *\n * @param widget - The widget to add to the panel.\n *\n * #### Notes\n * If the widget is already contained in the panel, it will be moved.\n */\n addWidget(widget) {\n this.layout.addWidget(widget);\n }\n /**\n * Insert a widget at the specified index.\n *\n * @param index - The index at which to insert the widget.\n *\n * @param widget - The widget to insert into to the panel.\n *\n * #### Notes\n * If the widget is already contained in the panel, it will be moved.\n */\n insertWidget(index, widget) {\n this.layout.insertWidget(index, widget);\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private$f;\n(function (Private) {\n /**\n * Create a panel layout for the given panel options.\n */\n function createLayout(options) {\n return options.layout || new PanelLayout();\n }\n Private.createLayout = createLayout;\n})(Private$f || (Private$f = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A panel which arranges its widgets into resizable sections.\n *\n * #### Notes\n * This class provides a convenience wrapper around a {@link SplitLayout}.\n */\nclass SplitPanel extends Panel {\n /**\n * Construct a new split panel.\n *\n * @param options - The options for initializing the split panel.\n */\n constructor(options = {}) {\n super({ layout: Private$e.createLayout(options) });\n this._handleMoved = new Signal(this);\n this._pressData = null;\n this.addClass('lm-SplitPanel');\n }\n /**\n * Dispose of the resources held by the panel.\n */\n dispose() {\n this._releaseMouse();\n super.dispose();\n }\n /**\n * Get the layout orientation for the split panel.\n */\n get orientation() {\n return this.layout.orientation;\n }\n /**\n * Set the layout orientation for the split panel.\n */\n set orientation(value) {\n this.layout.orientation = value;\n }\n /**\n * Get the content alignment for the split panel.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire split panel.\n */\n get alignment() {\n return this.layout.alignment;\n }\n /**\n * Set the content alignment for the split panel.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire split panel.\n */\n set alignment(value) {\n this.layout.alignment = value;\n }\n /**\n * Get the inter-element spacing for the split panel.\n */\n get spacing() {\n return this.layout.spacing;\n }\n /**\n * Set the inter-element spacing for the split panel.\n */\n set spacing(value) {\n this.layout.spacing = value;\n }\n /**\n * The renderer used by the split panel.\n */\n get renderer() {\n return this.layout.renderer;\n }\n /**\n * A signal emitted when a split handle has moved.\n */\n get handleMoved() {\n return this._handleMoved;\n }\n /**\n * A read-only array of the split handles in the panel.\n */\n get handles() {\n return this.layout.handles;\n }\n /**\n * Get the relative sizes of the widgets in the panel.\n *\n * @returns A new array of the relative sizes of the widgets.\n *\n * #### Notes\n * The returned sizes reflect the sizes of the widgets normalized\n * relative to their siblings.\n *\n * This method **does not** measure the DOM nodes.\n */\n relativeSizes() {\n return this.layout.relativeSizes();\n }\n /**\n * Set the relative sizes for the widgets in the panel.\n *\n * @param sizes - The relative sizes for the widgets in the panel.\n * @param update - Update the layout after setting relative sizes.\n * Default is True.\n *\n * #### Notes\n * Extra values are ignored, too few will yield an undefined layout.\n *\n * The actual geometry of the DOM nodes is updated asynchronously.\n */\n setRelativeSizes(sizes, update = true) {\n this.layout.setRelativeSizes(sizes, update);\n }\n /**\n * Handle the DOM events for the split panel.\n *\n * @param event - The DOM event sent to the panel.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the panel's DOM node. It should\n * not be called directly by user code.\n */\n handleEvent(event) {\n switch (event.type) {\n case 'pointerdown':\n this._evtPointerDown(event);\n break;\n case 'pointermove':\n this._evtPointerMove(event);\n break;\n case 'pointerup':\n this._evtPointerUp(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n }\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n onBeforeAttach(msg) {\n this.node.addEventListener('pointerdown', this);\n }\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n onAfterDetach(msg) {\n this.node.removeEventListener('pointerdown', this);\n this._releaseMouse();\n }\n /**\n * A message handler invoked on a `'child-added'` message.\n */\n onChildAdded(msg) {\n msg.child.addClass('lm-SplitPanel-child');\n this._releaseMouse();\n }\n /**\n * A message handler invoked on a `'child-removed'` message.\n */\n onChildRemoved(msg) {\n msg.child.removeClass('lm-SplitPanel-child');\n this._releaseMouse();\n }\n /**\n * Handle the `'keydown'` event for the split panel.\n */\n _evtKeyDown(event) {\n // Stop input events during drag.\n if (this._pressData) {\n event.preventDefault();\n event.stopPropagation();\n }\n // Release the mouse if `Escape` is pressed.\n if (event.keyCode === 27) {\n this._releaseMouse();\n }\n }\n /**\n * Handle the `'pointerdown'` event for the split panel.\n */\n _evtPointerDown(event) {\n // Do nothing if the primary button is not pressed.\n if (event.button !== 0) {\n return;\n }\n // Find the handle which contains the target, if any.\n let layout = this.layout;\n let index = ArrayExt.findFirstIndex(layout.handles, handle => {\n return handle.contains(event.target);\n });\n // Bail early if the mouse press was not on a handle.\n if (index === -1) {\n return;\n }\n // Stop the event when a split handle is pressed.\n event.preventDefault();\n event.stopPropagation();\n // Add the extra document listeners.\n document.addEventListener('pointerup', this, true);\n document.addEventListener('pointermove', this, true);\n document.addEventListener('keydown', this, true);\n document.addEventListener('contextmenu', this, true);\n // Compute the offset delta for the handle press.\n let delta;\n let handle = layout.handles[index];\n let rect = handle.getBoundingClientRect();\n if (layout.orientation === 'horizontal') {\n delta = event.clientX - rect.left;\n }\n else {\n delta = event.clientY - rect.top;\n }\n // Override the cursor and store the press data.\n let style = window.getComputedStyle(handle);\n let override = Drag.overrideCursor(style.cursor);\n this._pressData = { index, delta, override };\n }\n /**\n * Handle the `'pointermove'` event for the split panel.\n */\n _evtPointerMove(event) {\n // Stop the event when dragging a split handle.\n event.preventDefault();\n event.stopPropagation();\n // Compute the desired offset position for the handle.\n let pos;\n let layout = this.layout;\n let rect = this.node.getBoundingClientRect();\n if (layout.orientation === 'horizontal') {\n pos = event.clientX - rect.left - this._pressData.delta;\n }\n else {\n pos = event.clientY - rect.top - this._pressData.delta;\n }\n // Move the handle as close to the desired position as possible.\n layout.moveHandle(this._pressData.index, pos);\n }\n /**\n * Handle the `'pointerup'` event for the split panel.\n */\n _evtPointerUp(event) {\n // Do nothing if the primary button is not released.\n if (event.button !== 0) {\n return;\n }\n // Stop the event when releasing a handle.\n event.preventDefault();\n event.stopPropagation();\n // Finalize the mouse release.\n this._releaseMouse();\n }\n /**\n * Release the mouse grab for the split panel.\n */\n _releaseMouse() {\n // Bail early if no drag is in progress.\n if (!this._pressData) {\n return;\n }\n // Clear the override cursor.\n this._pressData.override.dispose();\n this._pressData = null;\n // Emit the handle moved signal.\n this._handleMoved.emit();\n // Remove the extra document listeners.\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('pointerup', this, true);\n document.removeEventListener('pointermove', this, true);\n document.removeEventListener('contextmenu', this, true);\n }\n}\n/**\n * The namespace for the `SplitPanel` class statics.\n */\n(function (SplitPanel) {\n /**\n * The default implementation of `IRenderer`.\n */\n class Renderer {\n /**\n * Create a new handle for use with a split panel.\n *\n * @returns A new handle element for a split panel.\n */\n createHandle() {\n let handle = document.createElement('div');\n handle.className = 'lm-SplitPanel-handle';\n return handle;\n }\n }\n SplitPanel.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n SplitPanel.defaultRenderer = new Renderer();\n /**\n * Get the split panel stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The split panel stretch factor for the widget.\n */\n function getStretch(widget) {\n return SplitLayout.getStretch(widget);\n }\n SplitPanel.getStretch = getStretch;\n /**\n * Set the split panel stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the stretch factor.\n */\n function setStretch(widget, value) {\n SplitLayout.setStretch(widget, value);\n }\n SplitPanel.setStretch = setStretch;\n})(SplitPanel || (SplitPanel = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private$e;\n(function (Private) {\n /**\n * Create a split layout for the given panel options.\n */\n function createLayout(options) {\n return (options.layout ||\n new SplitLayout({\n renderer: options.renderer || SplitPanel.defaultRenderer,\n orientation: options.orientation,\n alignment: options.alignment,\n spacing: options.spacing\n }));\n }\n Private.createLayout = createLayout;\n})(Private$e || (Private$e = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * A panel which arranges its widgets into resizable sections separated by a title widget.\n *\n * #### Notes\n * This class provides a convenience wrapper around {@link AccordionLayout}.\n */\nclass AccordionPanel extends SplitPanel {\n /**\n * Construct a new accordion panel.\n *\n * @param options - The options for initializing the accordion panel.\n */\n constructor(options = {}) {\n super({ ...options, layout: Private$d.createLayout(options) });\n this._widgetSizesCache = new WeakMap();\n this._expansionToggled = new Signal(this);\n this.addClass('lm-AccordionPanel');\n }\n /**\n * The renderer used by the accordion panel.\n */\n get renderer() {\n return this.layout.renderer;\n }\n /**\n * The section title space.\n *\n * This is the height if the panel is vertical and the width if it is\n * horizontal.\n */\n get titleSpace() {\n return this.layout.titleSpace;\n }\n set titleSpace(value) {\n this.layout.titleSpace = value;\n }\n /**\n * A read-only array of the section titles in the panel.\n */\n get titles() {\n return this.layout.titles;\n }\n /**\n * A signal emitted when a widget of the AccordionPanel is collapsed or expanded.\n */\n get expansionToggled() {\n return this._expansionToggled;\n }\n /**\n * Add a widget to the end of the panel.\n *\n * @param widget - The widget to add to the panel.\n *\n * #### Notes\n * If the widget is already contained in the panel, it will be moved.\n */\n addWidget(widget) {\n super.addWidget(widget);\n widget.title.changed.connect(this._onTitleChanged, this);\n }\n /**\n * Collapse the widget at position `index`.\n *\n * #### Notes\n * If no widget is found for `index`, this will bail.\n *\n * @param index Widget index\n */\n collapse(index) {\n const widget = this.layout.widgets[index];\n if (widget && !widget.isHidden) {\n this._toggleExpansion(index);\n }\n }\n /**\n * Expand the widget at position `index`.\n *\n * #### Notes\n * If no widget is found for `index`, this will bail.\n *\n * @param index Widget index\n */\n expand(index) {\n const widget = this.layout.widgets[index];\n if (widget && widget.isHidden) {\n this._toggleExpansion(index);\n }\n }\n /**\n * Insert a widget at the specified index.\n *\n * @param index - The index at which to insert the widget.\n *\n * @param widget - The widget to insert into to the panel.\n *\n * #### Notes\n * If the widget is already contained in the panel, it will be moved.\n */\n insertWidget(index, widget) {\n super.insertWidget(index, widget);\n widget.title.changed.connect(this._onTitleChanged, this);\n }\n /**\n * Handle the DOM events for the accordion panel.\n *\n * @param event - The DOM event sent to the panel.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the panel's DOM node. It should\n * not be called directly by user code.\n */\n handleEvent(event) {\n super.handleEvent(event);\n switch (event.type) {\n case 'click':\n this._evtClick(event);\n break;\n case 'keydown':\n this._eventKeyDown(event);\n break;\n }\n }\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n onBeforeAttach(msg) {\n this.node.addEventListener('click', this);\n this.node.addEventListener('keydown', this);\n super.onBeforeAttach(msg);\n }\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n onAfterDetach(msg) {\n super.onAfterDetach(msg);\n this.node.removeEventListener('click', this);\n this.node.removeEventListener('keydown', this);\n }\n /**\n * Handle the `changed` signal of a title object.\n */\n _onTitleChanged(sender) {\n const index = ArrayExt.findFirstIndex(this.widgets, widget => {\n return widget.contains(sender.owner);\n });\n if (index >= 0) {\n this.layout.updateTitle(index, sender.owner);\n this.update();\n }\n }\n /**\n * Compute the size of widgets in this panel on the title click event.\n * On closing, the size of the widget is cached and we will try to expand\n * the last opened widget.\n * On opening, we will use the cached size if it is available to restore the\n * widget.\n * In both cases, if we can not compute the size of widgets, we will let\n * `SplitLayout` decide.\n *\n * @param index - The index of widget to be opened of closed\n *\n * @returns Relative size of widgets in this panel, if this size can\n * not be computed, return `undefined`\n */\n _computeWidgetSize(index) {\n const layout = this.layout;\n const widget = layout.widgets[index];\n if (!widget) {\n return undefined;\n }\n const isHidden = widget.isHidden;\n const widgetSizes = layout.absoluteSizes();\n const delta = (isHidden ? -1 : 1) * this.spacing;\n const totalSize = widgetSizes.reduce((prev, curr) => prev + curr);\n let newSize = [...widgetSizes];\n if (!isHidden) {\n // Hide the widget\n const currentSize = widgetSizes[index];\n this._widgetSizesCache.set(widget, currentSize);\n newSize[index] = 0;\n const widgetToCollapse = newSize.map(sz => sz > 0).lastIndexOf(true);\n if (widgetToCollapse === -1) {\n // All widget are closed, let the `SplitLayout` compute widget sizes.\n return undefined;\n }\n newSize[widgetToCollapse] =\n widgetSizes[widgetToCollapse] + currentSize + delta;\n }\n else {\n // Show the widget\n const previousSize = this._widgetSizesCache.get(widget);\n if (!previousSize) {\n // Previous size is unavailable, let the `SplitLayout` compute widget sizes.\n return undefined;\n }\n newSize[index] += previousSize;\n const widgetToCollapse = newSize\n .map(sz => sz - previousSize > 0)\n .lastIndexOf(true);\n if (widgetToCollapse === -1) {\n // Can not reduce the size of one widget, reduce all opened widgets\n // proportionally with its size.\n newSize.forEach((_, idx) => {\n if (idx !== index) {\n newSize[idx] -=\n (widgetSizes[idx] / totalSize) * (previousSize - delta);\n }\n });\n }\n else {\n newSize[widgetToCollapse] -= previousSize - delta;\n }\n }\n return newSize.map(sz => sz / (totalSize + delta));\n }\n /**\n * Handle the `'click'` event for the accordion panel\n */\n _evtClick(event) {\n const target = event.target;\n if (target) {\n const index = ArrayExt.findFirstIndex(this.titles, title => {\n return title.contains(target);\n });\n if (index >= 0) {\n event.preventDefault();\n event.stopPropagation();\n this._toggleExpansion(index);\n }\n }\n }\n /**\n * Handle the `'keydown'` event for the accordion panel.\n */\n _eventKeyDown(event) {\n if (event.defaultPrevented) {\n return;\n }\n const target = event.target;\n let handled = false;\n if (target) {\n const index = ArrayExt.findFirstIndex(this.titles, title => {\n return title.contains(target);\n });\n if (index >= 0) {\n const keyCode = event.keyCode.toString();\n // If Space or Enter is pressed on title, emulate click event\n if (event.key.match(/Space|Enter/) || keyCode.match(/13|32/)) {\n target.click();\n handled = true;\n }\n else if (this.orientation === 'horizontal'\n ? event.key.match(/ArrowLeft|ArrowRight/) || keyCode.match(/37|39/)\n : event.key.match(/ArrowUp|ArrowDown/) || keyCode.match(/38|40/)) {\n // If Up or Down (for vertical) / Left or Right (for horizontal) is pressed on title, loop on titles\n const direction = event.key.match(/ArrowLeft|ArrowUp/) || keyCode.match(/37|38/)\n ? -1\n : 1;\n const length = this.titles.length;\n const newIndex = (index + length + direction) % length;\n this.titles[newIndex].focus();\n handled = true;\n }\n else if (event.key === 'End' || keyCode === '35') {\n // If End is pressed on title, focus on the last title\n this.titles[this.titles.length - 1].focus();\n handled = true;\n }\n else if (event.key === 'Home' || keyCode === '36') {\n // If Home is pressed on title, focus on the first title\n this.titles[0].focus();\n handled = true;\n }\n }\n if (handled) {\n event.preventDefault();\n }\n }\n }\n _toggleExpansion(index) {\n const title = this.titles[index];\n const widget = this.layout.widgets[index];\n const newSize = this._computeWidgetSize(index);\n if (newSize) {\n this.setRelativeSizes(newSize, false);\n }\n if (widget.isHidden) {\n title.classList.add('lm-mod-expanded');\n title.setAttribute('aria-expanded', 'true');\n widget.show();\n }\n else {\n title.classList.remove('lm-mod-expanded');\n title.setAttribute('aria-expanded', 'false');\n widget.hide();\n }\n // Emit the expansion state signal.\n this._expansionToggled.emit(index);\n }\n}\n/**\n * The namespace for the `AccordionPanel` class statics.\n */\n(function (AccordionPanel) {\n /**\n * The default implementation of `IRenderer`.\n */\n class Renderer extends SplitPanel.Renderer {\n constructor() {\n super();\n /**\n * A selector which matches any title node in the accordion.\n */\n this.titleClassName = 'lm-AccordionPanel-title';\n this._titleID = 0;\n this._titleKeys = new WeakMap();\n this._uuid = ++Renderer._nInstance;\n }\n /**\n * Render the collapse indicator for a section title.\n *\n * @param data - The data to use for rendering the section title.\n *\n * @returns A element representing the collapse indicator.\n */\n createCollapseIcon(data) {\n return document.createElement('span');\n }\n /**\n * Render the element for a section title.\n *\n * @param data - The data to use for rendering the section title.\n *\n * @returns A element representing the section title.\n */\n createSectionTitle(data) {\n const handle = document.createElement('h3');\n handle.setAttribute('tabindex', '0');\n handle.id = this.createTitleKey(data);\n handle.className = this.titleClassName;\n for (const aData in data.dataset) {\n handle.dataset[aData] = data.dataset[aData];\n }\n const collapser = handle.appendChild(this.createCollapseIcon(data));\n collapser.className = 'lm-AccordionPanel-titleCollapser';\n const label = handle.appendChild(document.createElement('span'));\n label.className = 'lm-AccordionPanel-titleLabel';\n label.textContent = data.label;\n label.title = data.caption || data.label;\n return handle;\n }\n /**\n * Create a unique render key for the title.\n *\n * @param data - The data to use for the title.\n *\n * @returns The unique render key for the title.\n *\n * #### Notes\n * This method caches the key against the section title the first time\n * the key is generated.\n */\n createTitleKey(data) {\n let key = this._titleKeys.get(data);\n if (key === undefined) {\n key = `title-key-${this._uuid}-${this._titleID++}`;\n this._titleKeys.set(data, key);\n }\n return key;\n }\n }\n Renderer._nInstance = 0;\n AccordionPanel.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n AccordionPanel.defaultRenderer = new Renderer();\n})(AccordionPanel || (AccordionPanel = {}));\nvar Private$d;\n(function (Private) {\n /**\n * Create an accordion layout for the given panel options.\n *\n * @param options Panel options\n * @returns Panel layout\n */\n function createLayout(options) {\n return (options.layout ||\n new AccordionLayout({\n renderer: options.renderer || AccordionPanel.defaultRenderer,\n orientation: options.orientation,\n alignment: options.alignment,\n spacing: options.spacing,\n titleSpace: options.titleSpace\n }));\n }\n Private.createLayout = createLayout;\n})(Private$d || (Private$d = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A layout which arranges its widgets in a single row or column.\n */\nclass BoxLayout extends PanelLayout {\n /**\n * Construct a new box layout.\n *\n * @param options - The options for initializing the layout.\n */\n constructor(options = {}) {\n super();\n this._fixed = 0;\n this._spacing = 4;\n this._dirty = false;\n this._sizers = [];\n this._items = [];\n this._box = null;\n this._alignment = 'start';\n this._direction = 'top-to-bottom';\n if (options.direction !== undefined) {\n this._direction = options.direction;\n }\n if (options.alignment !== undefined) {\n this._alignment = options.alignment;\n }\n if (options.spacing !== undefined) {\n this._spacing = Utils$1.clampDimension(options.spacing);\n }\n }\n /**\n * Dispose of the resources held by the layout.\n */\n dispose() {\n // Dispose of the layout items.\n for (const item of this._items) {\n item.dispose();\n }\n // Clear the layout state.\n this._box = null;\n this._items.length = 0;\n this._sizers.length = 0;\n // Dispose of the rest of the layout.\n super.dispose();\n }\n /**\n * Get the layout direction for the box layout.\n */\n get direction() {\n return this._direction;\n }\n /**\n * Set the layout direction for the box layout.\n */\n set direction(value) {\n if (this._direction === value) {\n return;\n }\n this._direction = value;\n if (!this.parent) {\n return;\n }\n this.parent.dataset['direction'] = value;\n this.parent.fit();\n }\n /**\n * Get the content alignment for the box layout.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire box layout.\n */\n get alignment() {\n return this._alignment;\n }\n /**\n * Set the content alignment for the box layout.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire box layout.\n */\n set alignment(value) {\n if (this._alignment === value) {\n return;\n }\n this._alignment = value;\n if (!this.parent) {\n return;\n }\n this.parent.dataset['alignment'] = value;\n this.parent.update();\n }\n /**\n * Get the inter-element spacing for the box layout.\n */\n get spacing() {\n return this._spacing;\n }\n /**\n * Set the inter-element spacing for the box layout.\n */\n set spacing(value) {\n value = Utils$1.clampDimension(value);\n if (this._spacing === value) {\n return;\n }\n this._spacing = value;\n if (!this.parent) {\n return;\n }\n this.parent.fit();\n }\n /**\n * Perform layout initialization which requires the parent widget.\n */\n init() {\n this.parent.dataset['direction'] = this.direction;\n this.parent.dataset['alignment'] = this.alignment;\n super.init();\n }\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n attachWidget(index, widget) {\n // Create and add a new layout item for the widget.\n ArrayExt.insert(this._items, index, new LayoutItem(widget));\n // Create and add a new sizer for the widget.\n ArrayExt.insert(this._sizers, index, new BoxSizer());\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n }\n /**\n * Move a widget in the parent's DOM node.\n *\n * @param fromIndex - The previous index of the widget in the layout.\n *\n * @param toIndex - The current index of the widget in the layout.\n *\n * @param widget - The widget to move in the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n moveWidget(fromIndex, toIndex, widget) {\n // Move the layout item for the widget.\n ArrayExt.move(this._items, fromIndex, toIndex);\n // Move the sizer for the widget.\n ArrayExt.move(this._sizers, fromIndex, toIndex);\n // Post an update request for the parent widget.\n this.parent.update();\n }\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param index - The previous index of the widget in the layout.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n detachWidget(index, widget) {\n // Remove the layout item for the widget.\n let item = ArrayExt.removeAt(this._items, index);\n // Remove the sizer for the widget.\n ArrayExt.removeAt(this._sizers, index);\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);\n }\n // Dispose of the layout item.\n item.dispose();\n // Post a fit request for the parent widget.\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n onBeforeShow(msg) {\n super.onBeforeShow(msg);\n this.parent.update();\n }\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n onBeforeAttach(msg) {\n super.onBeforeAttach(msg);\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n onChildShown(msg) {\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n onChildHidden(msg) {\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'resize'` message.\n */\n onResize(msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n }\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n onUpdateRequest(msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n }\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n onFitRequest(msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n }\n /**\n * Fit the layout to the total size required by the widgets.\n */\n _fit() {\n // Compute the visible item count.\n let nVisible = 0;\n for (let i = 0, n = this._items.length; i < n; ++i) {\n nVisible += +!this._items[i].isHidden;\n }\n // Update the fixed space for the visible items.\n this._fixed = this._spacing * Math.max(0, nVisible - 1);\n // Setup the computed minimum size.\n let horz = Private$c.isHorizontal(this._direction);\n let minW = horz ? this._fixed : 0;\n let minH = horz ? 0 : this._fixed;\n // Update the sizers and computed minimum size.\n for (let i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item and corresponding box sizer.\n let item = this._items[i];\n let sizer = this._sizers[i];\n // If the item is hidden, it should consume zero size.\n if (item.isHidden) {\n sizer.minSize = 0;\n sizer.maxSize = 0;\n continue;\n }\n // Update the size limits for the item.\n item.fit();\n // Update the size basis and stretch factor.\n sizer.sizeHint = BoxLayout.getSizeBasis(item.widget);\n sizer.stretch = BoxLayout.getStretch(item.widget);\n // Update the sizer limits and computed min size.\n if (horz) {\n sizer.minSize = item.minWidth;\n sizer.maxSize = item.maxWidth;\n minW += item.minWidth;\n minH = Math.max(minH, item.minHeight);\n }\n else {\n sizer.minSize = item.minHeight;\n sizer.maxSize = item.maxHeight;\n minH += item.minHeight;\n minW = Math.max(minW, item.minWidth);\n }\n }\n // Update the box sizing and add it to the computed min size.\n let box = (this._box = ElementExt.boxSizing(this.parent.node));\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n let style = this.parent.node.style;\n style.minWidth = `${minW}px`;\n style.minHeight = `${minH}px`;\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n MessageLoop.sendMessage(this.parent.parent, Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n MessageLoop.sendMessage(this.parent, Widget.Msg.UpdateRequest);\n }\n }\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n _update(offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Compute the visible item count.\n let nVisible = 0;\n for (let i = 0, n = this._items.length; i < n; ++i) {\n nVisible += +!this._items[i].isHidden;\n }\n // Bail early if there are no visible items to layout.\n if (nVisible === 0) {\n return;\n }\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = ElementExt.boxSizing(this.parent.node);\n }\n // Compute the layout area adjusted for border and padding.\n let top = this._box.paddingTop;\n let left = this._box.paddingLeft;\n let width = offsetWidth - this._box.horizontalSum;\n let height = offsetHeight - this._box.verticalSum;\n // Distribute the layout space and adjust the start position.\n let delta;\n switch (this._direction) {\n case 'left-to-right':\n delta = BoxEngine.calc(this._sizers, Math.max(0, width - this._fixed));\n break;\n case 'top-to-bottom':\n delta = BoxEngine.calc(this._sizers, Math.max(0, height - this._fixed));\n break;\n case 'right-to-left':\n delta = BoxEngine.calc(this._sizers, Math.max(0, width - this._fixed));\n left += width;\n break;\n case 'bottom-to-top':\n delta = BoxEngine.calc(this._sizers, Math.max(0, height - this._fixed));\n top += height;\n break;\n default:\n throw 'unreachable';\n }\n // Setup the variables for justification and alignment offset.\n let extra = 0;\n let offset = 0;\n // Account for alignment if there is extra layout space.\n if (delta > 0) {\n switch (this._alignment) {\n case 'start':\n break;\n case 'center':\n extra = 0;\n offset = delta / 2;\n break;\n case 'end':\n extra = 0;\n offset = delta;\n break;\n case 'justify':\n extra = delta / nVisible;\n offset = 0;\n break;\n default:\n throw 'unreachable';\n }\n }\n // Layout the items using the computed box sizes.\n for (let i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n let item = this._items[i];\n // Ignore hidden items.\n if (item.isHidden) {\n continue;\n }\n // Fetch the computed size for the widget.\n let size = this._sizers[i].size;\n // Update the widget geometry and advance the relevant edge.\n switch (this._direction) {\n case 'left-to-right':\n item.update(left + offset, top, size + extra, height);\n left += size + extra + this._spacing;\n break;\n case 'top-to-bottom':\n item.update(left, top + offset, width, size + extra);\n top += size + extra + this._spacing;\n break;\n case 'right-to-left':\n item.update(left - offset - size - extra, top, size + extra, height);\n left -= size + extra + this._spacing;\n break;\n case 'bottom-to-top':\n item.update(left, top - offset - size - extra, width, size + extra);\n top -= size + extra + this._spacing;\n break;\n default:\n throw 'unreachable';\n }\n }\n }\n}\n/**\n * The namespace for the `BoxLayout` class statics.\n */\n(function (BoxLayout) {\n /**\n * Get the box layout stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The box layout stretch factor for the widget.\n */\n function getStretch(widget) {\n return Private$c.stretchProperty.get(widget);\n }\n BoxLayout.getStretch = getStretch;\n /**\n * Set the box layout stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the stretch factor.\n */\n function setStretch(widget, value) {\n Private$c.stretchProperty.set(widget, value);\n }\n BoxLayout.setStretch = setStretch;\n /**\n * Get the box layout size basis for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The box layout size basis for the widget.\n */\n function getSizeBasis(widget) {\n return Private$c.sizeBasisProperty.get(widget);\n }\n BoxLayout.getSizeBasis = getSizeBasis;\n /**\n * Set the box layout size basis for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the size basis.\n */\n function setSizeBasis(widget, value) {\n Private$c.sizeBasisProperty.set(widget, value);\n }\n BoxLayout.setSizeBasis = setSizeBasis;\n})(BoxLayout || (BoxLayout = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private$c;\n(function (Private) {\n /**\n * The property descriptor for a widget stretch factor.\n */\n Private.stretchProperty = new AttachedProperty({\n name: 'stretch',\n create: () => 0,\n coerce: (owner, value) => Math.max(0, Math.floor(value)),\n changed: onChildSizingChanged\n });\n /**\n * The property descriptor for a widget size basis.\n */\n Private.sizeBasisProperty = new AttachedProperty({\n name: 'sizeBasis',\n create: () => 0,\n coerce: (owner, value) => Math.max(0, Math.floor(value)),\n changed: onChildSizingChanged\n });\n /**\n * Test whether a direction has horizontal orientation.\n */\n function isHorizontal(dir) {\n return dir === 'left-to-right' || dir === 'right-to-left';\n }\n Private.isHorizontal = isHorizontal;\n /**\n * Clamp a spacing value to an integer >= 0.\n */\n function clampSpacing(value) {\n return Math.max(0, Math.floor(value));\n }\n Private.clampSpacing = clampSpacing;\n /**\n * The change handler for the attached sizing properties.\n */\n function onChildSizingChanged(child) {\n if (child.parent && child.parent.layout instanceof BoxLayout) {\n child.parent.fit();\n }\n }\n})(Private$c || (Private$c = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A panel which arranges its widgets in a single row or column.\n *\n * #### Notes\n * This class provides a convenience wrapper around a {@link BoxLayout}.\n */\nclass BoxPanel extends Panel {\n /**\n * Construct a new box panel.\n *\n * @param options - The options for initializing the box panel.\n */\n constructor(options = {}) {\n super({ layout: Private$b.createLayout(options) });\n this.addClass('lm-BoxPanel');\n }\n /**\n * Get the layout direction for the box panel.\n */\n get direction() {\n return this.layout.direction;\n }\n /**\n * Set the layout direction for the box panel.\n */\n set direction(value) {\n this.layout.direction = value;\n }\n /**\n * Get the content alignment for the box panel.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire box layout.\n */\n get alignment() {\n return this.layout.alignment;\n }\n /**\n * Set the content alignment for the box panel.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire box layout.\n */\n set alignment(value) {\n this.layout.alignment = value;\n }\n /**\n * Get the inter-element spacing for the box panel.\n */\n get spacing() {\n return this.layout.spacing;\n }\n /**\n * Set the inter-element spacing for the box panel.\n */\n set spacing(value) {\n this.layout.spacing = value;\n }\n /**\n * A message handler invoked on a `'child-added'` message.\n */\n onChildAdded(msg) {\n msg.child.addClass('lm-BoxPanel-child');\n }\n /**\n * A message handler invoked on a `'child-removed'` message.\n */\n onChildRemoved(msg) {\n msg.child.removeClass('lm-BoxPanel-child');\n }\n}\n/**\n * The namespace for the `BoxPanel` class statics.\n */\n(function (BoxPanel) {\n /**\n * Get the box panel stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The box panel stretch factor for the widget.\n */\n function getStretch(widget) {\n return BoxLayout.getStretch(widget);\n }\n BoxPanel.getStretch = getStretch;\n /**\n * Set the box panel stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the stretch factor.\n */\n function setStretch(widget, value) {\n BoxLayout.setStretch(widget, value);\n }\n BoxPanel.setStretch = setStretch;\n /**\n * Get the box panel size basis for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The box panel size basis for the widget.\n */\n function getSizeBasis(widget) {\n return BoxLayout.getSizeBasis(widget);\n }\n BoxPanel.getSizeBasis = getSizeBasis;\n /**\n * Set the box panel size basis for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the size basis.\n */\n function setSizeBasis(widget, value) {\n BoxLayout.setSizeBasis(widget, value);\n }\n BoxPanel.setSizeBasis = setSizeBasis;\n})(BoxPanel || (BoxPanel = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private$b;\n(function (Private) {\n /**\n * Create a box layout for the given panel options.\n */\n function createLayout(options) {\n return options.layout || new BoxLayout(options);\n }\n Private.createLayout = createLayout;\n})(Private$b || (Private$b = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A widget which displays command items as a searchable palette.\n */\nclass CommandPalette extends Widget {\n /**\n * Construct a new command palette.\n *\n * @param options - The options for initializing the palette.\n */\n constructor(options) {\n super({ node: Private$a.createNode() });\n this._activeIndex = -1;\n this._items = [];\n this._results = null;\n this.addClass('lm-CommandPalette');\n this.setFlag(Widget.Flag.DisallowLayout);\n this.commands = options.commands;\n this.renderer = options.renderer || CommandPalette.defaultRenderer;\n this.commands.commandChanged.connect(this._onGenericChange, this);\n this.commands.keyBindingChanged.connect(this._onGenericChange, this);\n }\n /**\n * Dispose of the resources held by the widget.\n */\n dispose() {\n this._items.length = 0;\n this._results = null;\n super.dispose();\n }\n /**\n * The command palette search node.\n *\n * #### Notes\n * This is the node which contains the search-related elements.\n */\n get searchNode() {\n return this.node.getElementsByClassName('lm-CommandPalette-search')[0];\n }\n /**\n * The command palette input node.\n *\n * #### Notes\n * This is the actual input node for the search area.\n */\n get inputNode() {\n return this.node.getElementsByClassName('lm-CommandPalette-input')[0];\n }\n /**\n * The command palette content node.\n *\n * #### Notes\n * This is the node which holds the command item nodes.\n *\n * Modifying this node directly can lead to undefined behavior.\n */\n get contentNode() {\n return this.node.getElementsByClassName('lm-CommandPalette-content')[0];\n }\n /**\n * A read-only array of the command items in the palette.\n */\n get items() {\n return this._items;\n }\n /**\n * Add a command item to the command palette.\n *\n * @param options - The options for creating the command item.\n *\n * @returns The command item added to the palette.\n */\n addItem(options) {\n // Create a new command item for the options.\n let item = Private$a.createItem(this.commands, options);\n // Add the item to the array.\n this._items.push(item);\n // Refresh the search results.\n this.refresh();\n // Return the item added to the palette.\n return item;\n }\n /**\n * Adds command items to the command palette.\n *\n * @param items - An array of options for creating each command item.\n *\n * @returns The command items added to the palette.\n */\n addItems(items) {\n const newItems = items.map(item => Private$a.createItem(this.commands, item));\n newItems.forEach(item => this._items.push(item));\n this.refresh();\n return newItems;\n }\n /**\n * Remove an item from the command palette.\n *\n * @param item - The item to remove from the palette.\n *\n * #### Notes\n * This is a no-op if the item is not in the palette.\n */\n removeItem(item) {\n this.removeItemAt(this._items.indexOf(item));\n }\n /**\n * Remove the item at a given index from the command palette.\n *\n * @param index - The index of the item to remove.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n removeItemAt(index) {\n // Remove the item from the array.\n let item = ArrayExt.removeAt(this._items, index);\n // Bail if the index is out of range.\n if (!item) {\n return;\n }\n // Refresh the search results.\n this.refresh();\n }\n /**\n * Remove all items from the command palette.\n */\n clearItems() {\n // Bail if there is nothing to remove.\n if (this._items.length === 0) {\n return;\n }\n // Clear the array of items.\n this._items.length = 0;\n // Refresh the search results.\n this.refresh();\n }\n /**\n * Clear the search results and schedule an update.\n *\n * #### Notes\n * This should be called whenever the search results of the palette\n * should be updated.\n *\n * This is typically called automatically by the palette as needed,\n * but can be called manually if the input text is programatically\n * changed.\n *\n * The rendered results are updated asynchronously.\n */\n refresh() {\n this._results = null;\n if (this.inputNode.value !== '') {\n let clear = this.node.getElementsByClassName('lm-close-icon')[0];\n clear.style.display = 'inherit';\n }\n else {\n let clear = this.node.getElementsByClassName('lm-close-icon')[0];\n clear.style.display = 'none';\n }\n this.update();\n }\n /**\n * Handle the DOM events for the command palette.\n *\n * @param event - The DOM event sent to the command palette.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the command palette's DOM node.\n * It should not be called directly by user code.\n */\n handleEvent(event) {\n switch (event.type) {\n case 'click':\n this._evtClick(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'input':\n this.refresh();\n break;\n case 'focus':\n case 'blur':\n this._toggleFocused();\n break;\n }\n }\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n onBeforeAttach(msg) {\n this.node.addEventListener('click', this);\n this.node.addEventListener('keydown', this);\n this.node.addEventListener('input', this);\n this.node.addEventListener('focus', this, true);\n this.node.addEventListener('blur', this, true);\n }\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n onAfterDetach(msg) {\n this.node.removeEventListener('click', this);\n this.node.removeEventListener('keydown', this);\n this.node.removeEventListener('input', this);\n this.node.removeEventListener('focus', this, true);\n this.node.removeEventListener('blur', this, true);\n }\n /**\n * A message handler invoked on an `'after-show'` message.\n */\n onAfterShow(msg) {\n this.update();\n super.onAfterShow(msg);\n }\n /**\n * A message handler invoked on an `'activate-request'` message.\n */\n onActivateRequest(msg) {\n if (this.isAttached) {\n let input = this.inputNode;\n input.focus();\n input.select();\n }\n }\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n onUpdateRequest(msg) {\n if (this.isHidden) {\n return;\n }\n // Fetch the current query text and content node.\n let query = this.inputNode.value;\n let contentNode = this.contentNode;\n // Ensure the search results are generated.\n let results = this._results;\n if (!results) {\n // Generate and store the new search results.\n results = this._results = Private$a.search(this._items, query);\n // Reset the active index.\n this._activeIndex = query\n ? ArrayExt.findFirstIndex(results, Private$a.canActivate)\n : -1;\n }\n // If there is no query and no results, clear the content.\n if (!query && results.length === 0) {\n VirtualDOM.render(null, contentNode);\n return;\n }\n // If the is a query but no results, render the empty message.\n if (query && results.length === 0) {\n let content = this.renderer.renderEmptyMessage({ query });\n VirtualDOM.render(content, contentNode);\n return;\n }\n // Create the render content for the search results.\n let renderer = this.renderer;\n let activeIndex = this._activeIndex;\n let content = new Array(results.length);\n for (let i = 0, n = results.length; i < n; ++i) {\n let result = results[i];\n if (result.type === 'header') {\n let indices = result.indices;\n let category = result.category;\n content[i] = renderer.renderHeader({ category, indices });\n }\n else {\n let item = result.item;\n let indices = result.indices;\n let active = i === activeIndex;\n content[i] = renderer.renderItem({ item, indices, active });\n }\n }\n // Render the search result content.\n VirtualDOM.render(content, contentNode);\n // Adjust the scroll position as needed.\n if (activeIndex < 0 || activeIndex >= results.length) {\n contentNode.scrollTop = 0;\n }\n else {\n let element = contentNode.children[activeIndex];\n ElementExt.scrollIntoViewIfNeeded(contentNode, element);\n }\n }\n /**\n * Handle the `'click'` event for the command palette.\n */\n _evtClick(event) {\n // Bail if the click is not the left button.\n if (event.button !== 0) {\n return;\n }\n // Clear input if the target is clear button\n if (event.target.classList.contains('lm-close-icon')) {\n this.inputNode.value = '';\n this.refresh();\n return;\n }\n // Find the index of the item which was clicked.\n let index = ArrayExt.findFirstIndex(this.contentNode.children, node => {\n return node.contains(event.target);\n });\n // Bail if the click was not on an item.\n if (index === -1) {\n return;\n }\n // Kill the event when a content item is clicked.\n event.preventDefault();\n event.stopPropagation();\n // Execute the item if possible.\n this._execute(index);\n }\n /**\n * Handle the `'keydown'` event for the command palette.\n */\n _evtKeyDown(event) {\n if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {\n return;\n }\n switch (event.keyCode) {\n case 13: // Enter\n event.preventDefault();\n event.stopPropagation();\n this._execute(this._activeIndex);\n break;\n case 38: // Up Arrow\n event.preventDefault();\n event.stopPropagation();\n this._activatePreviousItem();\n break;\n case 40: // Down Arrow\n event.preventDefault();\n event.stopPropagation();\n this._activateNextItem();\n break;\n }\n }\n /**\n * Activate the next enabled command item.\n */\n _activateNextItem() {\n // Bail if there are no search results.\n if (!this._results || this._results.length === 0) {\n return;\n }\n // Find the next enabled item index.\n let ai = this._activeIndex;\n let n = this._results.length;\n let start = ai < n - 1 ? ai + 1 : 0;\n let stop = start === 0 ? n - 1 : start - 1;\n this._activeIndex = ArrayExt.findFirstIndex(this._results, Private$a.canActivate, start, stop);\n // Schedule an update of the items.\n this.update();\n }\n /**\n * Activate the previous enabled command item.\n */\n _activatePreviousItem() {\n // Bail if there are no search results.\n if (!this._results || this._results.length === 0) {\n return;\n }\n // Find the previous enabled item index.\n let ai = this._activeIndex;\n let n = this._results.length;\n let start = ai <= 0 ? n - 1 : ai - 1;\n let stop = start === n - 1 ? 0 : start + 1;\n this._activeIndex = ArrayExt.findLastIndex(this._results, Private$a.canActivate, start, stop);\n // Schedule an update of the items.\n this.update();\n }\n /**\n * Execute the command item at the given index, if possible.\n */\n _execute(index) {\n // Bail if there are no search results.\n if (!this._results) {\n return;\n }\n // Bail if the index is out of range.\n let part = this._results[index];\n if (!part) {\n return;\n }\n // Update the search text if the item is a header.\n if (part.type === 'header') {\n let input = this.inputNode;\n input.value = `${part.category.toLowerCase()} `;\n input.focus();\n this.refresh();\n return;\n }\n // Bail if item is not enabled.\n if (!part.item.isEnabled) {\n return;\n }\n // Execute the item.\n this.commands.execute(part.item.command, part.item.args);\n // Clear the query text.\n this.inputNode.value = '';\n // Refresh the search results.\n this.refresh();\n }\n /**\n * Toggle the focused modifier based on the input node focus state.\n */\n _toggleFocused() {\n let focused = document.activeElement === this.inputNode;\n this.toggleClass('lm-mod-focused', focused);\n }\n /**\n * A signal handler for generic command changes.\n */\n _onGenericChange() {\n this.refresh();\n }\n}\n/**\n * The namespace for the `CommandPalette` class statics.\n */\n(function (CommandPalette) {\n /**\n * The default implementation of `IRenderer`.\n */\n class Renderer {\n /**\n * Render the virtual element for a command palette header.\n *\n * @param data - The data to use for rendering the header.\n *\n * @returns A virtual element representing the header.\n */\n renderHeader(data) {\n let content = this.formatHeader(data);\n return h.li({ className: 'lm-CommandPalette-header' }, content);\n }\n /**\n * Render the virtual element for a command palette item.\n *\n * @param data - The data to use for rendering the item.\n *\n * @returns A virtual element representing the item.\n */\n renderItem(data) {\n let className = this.createItemClass(data);\n let dataset = this.createItemDataset(data);\n if (data.item.isToggleable) {\n return h.li({\n className,\n dataset,\n role: 'menuitemcheckbox',\n 'aria-checked': `${data.item.isToggled}`\n }, this.renderItemIcon(data), this.renderItemContent(data), this.renderItemShortcut(data));\n }\n return h.li({\n className,\n dataset,\n role: 'menuitem'\n }, this.renderItemIcon(data), this.renderItemContent(data), this.renderItemShortcut(data));\n }\n /**\n * Render the empty results message for a command palette.\n *\n * @param data - The data to use for rendering the message.\n *\n * @returns A virtual element representing the message.\n */\n renderEmptyMessage(data) {\n let content = this.formatEmptyMessage(data);\n return h.li({ className: 'lm-CommandPalette-emptyMessage' }, content);\n }\n /**\n * Render the icon for a command palette item.\n *\n * @param data - The data to use for rendering the icon.\n *\n * @returns A virtual element representing the icon.\n */\n renderItemIcon(data) {\n let className = this.createIconClass(data);\n // If data.item.icon is undefined, it will be ignored.\n return h.div({ className }, data.item.icon, data.item.iconLabel);\n }\n /**\n * Render the content for a command palette item.\n *\n * @param data - The data to use for rendering the content.\n *\n * @returns A virtual element representing the content.\n */\n renderItemContent(data) {\n return h.div({ className: 'lm-CommandPalette-itemContent' }, this.renderItemLabel(data), this.renderItemCaption(data));\n }\n /**\n * Render the label for a command palette item.\n *\n * @param data - The data to use for rendering the label.\n *\n * @returns A virtual element representing the label.\n */\n renderItemLabel(data) {\n let content = this.formatItemLabel(data);\n return h.div({ className: 'lm-CommandPalette-itemLabel' }, content);\n }\n /**\n * Render the caption for a command palette item.\n *\n * @param data - The data to use for rendering the caption.\n *\n * @returns A virtual element representing the caption.\n */\n renderItemCaption(data) {\n let content = this.formatItemCaption(data);\n return h.div({ className: 'lm-CommandPalette-itemCaption' }, content);\n }\n /**\n * Render the shortcut for a command palette item.\n *\n * @param data - The data to use for rendering the shortcut.\n *\n * @returns A virtual element representing the shortcut.\n */\n renderItemShortcut(data) {\n let content = this.formatItemShortcut(data);\n return h.div({ className: 'lm-CommandPalette-itemShortcut' }, content);\n }\n /**\n * Create the class name for the command palette item.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the command palette item.\n */\n createItemClass(data) {\n // Set up the initial class name.\n let name = 'lm-CommandPalette-item';\n // Add the boolean state classes.\n if (!data.item.isEnabled) {\n name += ' lm-mod-disabled';\n }\n if (data.item.isToggled) {\n name += ' lm-mod-toggled';\n }\n if (data.active) {\n name += ' lm-mod-active';\n }\n // Add the extra class.\n let extra = data.item.className;\n if (extra) {\n name += ` ${extra}`;\n }\n // Return the complete class name.\n return name;\n }\n /**\n * Create the dataset for the command palette item.\n *\n * @param data - The data to use for creating the dataset.\n *\n * @returns The dataset for the command palette item.\n */\n createItemDataset(data) {\n return { ...data.item.dataset, command: data.item.command };\n }\n /**\n * Create the class name for the command item icon.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the item icon.\n */\n createIconClass(data) {\n let name = 'lm-CommandPalette-itemIcon';\n let extra = data.item.iconClass;\n return extra ? `${name} ${extra}` : name;\n }\n /**\n * Create the render content for the header node.\n *\n * @param data - The data to use for the header content.\n *\n * @returns The content to add to the header node.\n */\n formatHeader(data) {\n if (!data.indices || data.indices.length === 0) {\n return data.category;\n }\n return StringExt.highlight(data.category, data.indices, h.mark);\n }\n /**\n * Create the render content for the empty message node.\n *\n * @param data - The data to use for the empty message content.\n *\n * @returns The content to add to the empty message node.\n */\n formatEmptyMessage(data) {\n return `No commands found that match '${data.query}'`;\n }\n /**\n * Create the render content for the item shortcut node.\n *\n * @param data - The data to use for the shortcut content.\n *\n * @returns The content to add to the shortcut node.\n */\n formatItemShortcut(data) {\n let kb = data.item.keyBinding;\n return kb ? CommandRegistry.formatKeystroke(kb.keys) : null;\n }\n /**\n * Create the render content for the item label node.\n *\n * @param data - The data to use for the label content.\n *\n * @returns The content to add to the label node.\n */\n formatItemLabel(data) {\n if (!data.indices || data.indices.length === 0) {\n return data.item.label;\n }\n return StringExt.highlight(data.item.label, data.indices, h.mark);\n }\n /**\n * Create the render content for the item caption node.\n *\n * @param data - The data to use for the caption content.\n *\n * @returns The content to add to the caption node.\n */\n formatItemCaption(data) {\n return data.item.caption;\n }\n }\n CommandPalette.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n CommandPalette.defaultRenderer = new Renderer();\n})(CommandPalette || (CommandPalette = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private$a;\n(function (Private) {\n /**\n * Create the DOM node for a command palette.\n */\n function createNode() {\n let node = document.createElement('div');\n let search = document.createElement('div');\n let wrapper = document.createElement('div');\n let input = document.createElement('input');\n let content = document.createElement('ul');\n let clear = document.createElement('button');\n search.className = 'lm-CommandPalette-search';\n wrapper.className = 'lm-CommandPalette-wrapper';\n input.className = 'lm-CommandPalette-input';\n clear.className = 'lm-close-icon';\n content.className = 'lm-CommandPalette-content';\n content.setAttribute('role', 'menu');\n input.spellcheck = false;\n wrapper.appendChild(input);\n wrapper.appendChild(clear);\n search.appendChild(wrapper);\n node.appendChild(search);\n node.appendChild(content);\n return node;\n }\n Private.createNode = createNode;\n /**\n * Create a new command item from a command registry and options.\n */\n function createItem(commands, options) {\n return new CommandItem(commands, options);\n }\n Private.createItem = createItem;\n /**\n * Search an array of command items for fuzzy matches.\n */\n function search(items, query) {\n // Fuzzy match the items for the query.\n let scores = matchItems(items, query);\n // Sort the items based on their score.\n scores.sort(scoreCmp);\n // Create the results for the search.\n return createResults(scores);\n }\n Private.search = search;\n /**\n * Test whether a result item can be activated.\n */\n function canActivate(result) {\n return result.type === 'item' && result.item.isEnabled;\n }\n Private.canActivate = canActivate;\n /**\n * Normalize a category for a command item.\n */\n function normalizeCategory(category) {\n return category.trim().replace(/\\s+/g, ' ');\n }\n /**\n * Normalize the query text for a fuzzy search.\n */\n function normalizeQuery(text) {\n return text.replace(/\\s+/g, '').toLowerCase();\n }\n /**\n * Perform a fuzzy match on an array of command items.\n */\n function matchItems(items, query) {\n // Normalize the query text to lower case with no whitespace.\n query = normalizeQuery(query);\n // Create the array to hold the scores.\n let scores = [];\n // Iterate over the items and match against the query.\n for (let i = 0, n = items.length; i < n; ++i) {\n // Ignore items which are not visible.\n let item = items[i];\n if (!item.isVisible) {\n continue;\n }\n // If the query is empty, all items are matched by default.\n if (!query) {\n scores.push({\n matchType: 3 /* MatchType.Default */,\n categoryIndices: null,\n labelIndices: null,\n score: 0,\n item\n });\n continue;\n }\n // Run the fuzzy search for the item and query.\n let score = fuzzySearch(item, query);\n // Ignore the item if it is not a match.\n if (!score) {\n continue;\n }\n // Penalize disabled items.\n // TODO - push disabled items all the way down in sort cmp?\n if (!item.isEnabled) {\n score.score += 1000;\n }\n // Add the score to the results.\n scores.push(score);\n }\n // Return the final array of scores.\n return scores;\n }\n /**\n * Perform a fuzzy search on a single command item.\n */\n function fuzzySearch(item, query) {\n // Create the source text to be searched.\n let category = item.category.toLowerCase();\n let label = item.label.toLowerCase();\n let source = `${category} ${label}`;\n // Set up the match score and indices array.\n let score = Infinity;\n let indices = null;\n // The regex for search word boundaries\n let rgx = /\\b\\w/g;\n // Search the source by word boundary.\n // eslint-disable-next-line no-constant-condition\n while (true) {\n // Find the next word boundary in the source.\n let rgxMatch = rgx.exec(source);\n // Break if there is no more source context.\n if (!rgxMatch) {\n break;\n }\n // Run the string match on the relevant substring.\n let match = StringExt.matchSumOfDeltas(source, query, rgxMatch.index);\n // Break if there is no match.\n if (!match) {\n break;\n }\n // Update the match if the score is better.\n if (match.score <= score) {\n score = match.score;\n indices = match.indices;\n }\n }\n // Bail if there was no match.\n if (!indices || score === Infinity) {\n return null;\n }\n // Compute the pivot index between category and label text.\n let pivot = category.length + 1;\n // Find the slice index to separate matched indices.\n let j = ArrayExt.lowerBound(indices, pivot, (a, b) => a - b);\n // Extract the matched category and label indices.\n let categoryIndices = indices.slice(0, j);\n let labelIndices = indices.slice(j);\n // Adjust the label indices for the pivot offset.\n for (let i = 0, n = labelIndices.length; i < n; ++i) {\n labelIndices[i] -= pivot;\n }\n // Handle a pure label match.\n if (categoryIndices.length === 0) {\n return {\n matchType: 0 /* MatchType.Label */,\n categoryIndices: null,\n labelIndices,\n score,\n item\n };\n }\n // Handle a pure category match.\n if (labelIndices.length === 0) {\n return {\n matchType: 1 /* MatchType.Category */,\n categoryIndices,\n labelIndices: null,\n score,\n item\n };\n }\n // Handle a split match.\n return {\n matchType: 2 /* MatchType.Split */,\n categoryIndices,\n labelIndices,\n score,\n item\n };\n }\n /**\n * A sort comparison function for a match score.\n */\n function scoreCmp(a, b) {\n // First compare based on the match type\n let m1 = a.matchType - b.matchType;\n if (m1 !== 0) {\n return m1;\n }\n // Otherwise, compare based on the match score.\n let d1 = a.score - b.score;\n if (d1 !== 0) {\n return d1;\n }\n // Find the match index based on the match type.\n let i1 = 0;\n let i2 = 0;\n switch (a.matchType) {\n case 0 /* MatchType.Label */:\n i1 = a.labelIndices[0];\n i2 = b.labelIndices[0];\n break;\n case 1 /* MatchType.Category */:\n case 2 /* MatchType.Split */:\n i1 = a.categoryIndices[0];\n i2 = b.categoryIndices[0];\n break;\n }\n // Compare based on the match index.\n if (i1 !== i2) {\n return i1 - i2;\n }\n // Otherwise, compare by category.\n let d2 = a.item.category.localeCompare(b.item.category);\n if (d2 !== 0) {\n return d2;\n }\n // Otherwise, compare by rank.\n let r1 = a.item.rank;\n let r2 = b.item.rank;\n if (r1 !== r2) {\n return r1 < r2 ? -1 : 1; // Infinity safe\n }\n // Finally, compare by label.\n return a.item.label.localeCompare(b.item.label);\n }\n /**\n * Create the results from an array of sorted scores.\n */\n function createResults(scores) {\n // Set up the search results array.\n let results = [];\n // Iterate over each score in the array.\n for (let i = 0, n = scores.length; i < n; ++i) {\n // Extract the current item and indices.\n let { item, categoryIndices, labelIndices } = scores[i];\n // Extract the category for the current item.\n let category = item.category;\n // Is this the same category as the preceding result?\n if (i === 0 || category !== scores[i - 1].item.category) {\n // Add the header result for the category.\n results.push({ type: 'header', category, indices: categoryIndices });\n }\n // Create the item result for the score.\n results.push({ type: 'item', item, indices: labelIndices });\n }\n // Return the final results.\n return results;\n }\n /**\n * A concrete implementation of `CommandPalette.IItem`.\n */\n class CommandItem {\n /**\n * Construct a new command item.\n */\n constructor(commands, options) {\n this._commands = commands;\n this.category = normalizeCategory(options.category);\n this.command = options.command;\n this.args = options.args || JSONExt.emptyObject;\n this.rank = options.rank !== undefined ? options.rank : Infinity;\n }\n /**\n * The display label for the command item.\n */\n get label() {\n return this._commands.label(this.command, this.args);\n }\n /**\n * The icon renderer for the command item.\n */\n get icon() {\n return this._commands.icon(this.command, this.args);\n }\n /**\n * The icon class for the command item.\n */\n get iconClass() {\n return this._commands.iconClass(this.command, this.args);\n }\n /**\n * The icon label for the command item.\n */\n get iconLabel() {\n return this._commands.iconLabel(this.command, this.args);\n }\n /**\n * The display caption for the command item.\n */\n get caption() {\n return this._commands.caption(this.command, this.args);\n }\n /**\n * The extra class name for the command item.\n */\n get className() {\n return this._commands.className(this.command, this.args);\n }\n /**\n * The dataset for the command item.\n */\n get dataset() {\n return this._commands.dataset(this.command, this.args);\n }\n /**\n * Whether the command item is enabled.\n */\n get isEnabled() {\n return this._commands.isEnabled(this.command, this.args);\n }\n /**\n * Whether the command item is toggled.\n */\n get isToggled() {\n return this._commands.isToggled(this.command, this.args);\n }\n /**\n * Whether the command item is toggleable.\n */\n get isToggleable() {\n return this._commands.isToggleable(this.command, this.args);\n }\n /**\n * Whether the command item is visible.\n */\n get isVisible() {\n return this._commands.isVisible(this.command, this.args);\n }\n /**\n * The key binding for the command item.\n */\n get keyBinding() {\n let { command, args } = this;\n return (ArrayExt.findLastValue(this._commands.keyBindings, kb => {\n return kb.command === command && JSONExt.deepEqual(kb.args, args);\n }) || null);\n }\n }\n})(Private$a || (Private$a = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A widget which displays items as a canonical menu.\n */\nclass Menu extends Widget {\n /**\n * Construct a new menu.\n *\n * @param options - The options for initializing the menu.\n */\n constructor(options) {\n super({ node: Private$9.createNode() });\n this._childIndex = -1;\n this._activeIndex = -1;\n this._openTimerID = 0;\n this._closeTimerID = 0;\n this._items = [];\n this._childMenu = null;\n this._parentMenu = null;\n this._aboutToClose = new Signal(this);\n this._menuRequested = new Signal(this);\n this.addClass('lm-Menu');\n this.setFlag(Widget.Flag.DisallowLayout);\n this.commands = options.commands;\n this.renderer = options.renderer || Menu.defaultRenderer;\n }\n /**\n * Dispose of the resources held by the menu.\n */\n dispose() {\n this.close();\n this._items.length = 0;\n super.dispose();\n }\n /**\n * A signal emitted just before the menu is closed.\n *\n * #### Notes\n * This signal is emitted when the menu receives a `'close-request'`\n * message, just before it removes itself from the DOM.\n *\n * This signal is not emitted if the menu is already detached from\n * the DOM when it receives the `'close-request'` message.\n */\n get aboutToClose() {\n return this._aboutToClose;\n }\n /**\n * A signal emitted when a new menu is requested by the user.\n *\n * #### Notes\n * This signal is emitted whenever the user presses the right or left\n * arrow keys, and a submenu cannot be opened or closed in response.\n *\n * This signal is useful when implementing menu bars in order to open\n * the next or previous menu in response to a user key press.\n *\n * This signal is only emitted for the root menu in a hierarchy.\n */\n get menuRequested() {\n return this._menuRequested;\n }\n /**\n * The parent menu of the menu.\n *\n * #### Notes\n * This is `null` unless the menu is an open submenu.\n */\n get parentMenu() {\n return this._parentMenu;\n }\n /**\n * The child menu of the menu.\n *\n * #### Notes\n * This is `null` unless the menu has an open submenu.\n */\n get childMenu() {\n return this._childMenu;\n }\n /**\n * The root menu of the menu hierarchy.\n */\n get rootMenu() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let menu = this;\n while (menu._parentMenu) {\n menu = menu._parentMenu;\n }\n return menu;\n }\n /**\n * The leaf menu of the menu hierarchy.\n */\n get leafMenu() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let menu = this;\n while (menu._childMenu) {\n menu = menu._childMenu;\n }\n return menu;\n }\n /**\n * The menu content node.\n *\n * #### Notes\n * This is the node which holds the menu item nodes.\n *\n * Modifying this node directly can lead to undefined behavior.\n */\n get contentNode() {\n return this.node.getElementsByClassName('lm-Menu-content')[0];\n }\n /**\n * Get the currently active menu item.\n */\n get activeItem() {\n return this._items[this._activeIndex] || null;\n }\n /**\n * Set the currently active menu item.\n *\n * #### Notes\n * If the item cannot be activated, the item will be set to `null`.\n */\n set activeItem(value) {\n this.activeIndex = value ? this._items.indexOf(value) : -1;\n }\n /**\n * Get the index of the currently active menu item.\n *\n * #### Notes\n * This will be `-1` if no menu item is active.\n */\n get activeIndex() {\n return this._activeIndex;\n }\n /**\n * Set the index of the currently active menu item.\n *\n * #### Notes\n * If the item cannot be activated, the index will be set to `-1`.\n */\n set activeIndex(value) {\n // Adjust the value for an out of range index.\n if (value < 0 || value >= this._items.length) {\n value = -1;\n }\n // Ensure the item can be activated.\n if (value !== -1 && !Private$9.canActivate(this._items[value])) {\n value = -1;\n }\n // Bail if the index will not change.\n if (this._activeIndex === value) {\n return;\n }\n // Update the active index.\n this._activeIndex = value;\n // Make active element in focus\n if (this._activeIndex >= 0 &&\n this.contentNode.childNodes[this._activeIndex]) {\n this.contentNode.childNodes[this._activeIndex].focus();\n }\n // schedule an update of the items.\n this.update();\n }\n /**\n * A read-only array of the menu items in the menu.\n */\n get items() {\n return this._items;\n }\n /**\n * Activate the next selectable item in the menu.\n *\n * #### Notes\n * If no item is selectable, the index will be set to `-1`.\n */\n activateNextItem() {\n let n = this._items.length;\n let ai = this._activeIndex;\n let start = ai < n - 1 ? ai + 1 : 0;\n let stop = start === 0 ? n - 1 : start - 1;\n this.activeIndex = ArrayExt.findFirstIndex(this._items, Private$9.canActivate, start, stop);\n }\n /**\n * Activate the previous selectable item in the menu.\n *\n * #### Notes\n * If no item is selectable, the index will be set to `-1`.\n */\n activatePreviousItem() {\n let n = this._items.length;\n let ai = this._activeIndex;\n let start = ai <= 0 ? n - 1 : ai - 1;\n let stop = start === n - 1 ? 0 : start + 1;\n this.activeIndex = ArrayExt.findLastIndex(this._items, Private$9.canActivate, start, stop);\n }\n /**\n * Trigger the active menu item.\n *\n * #### Notes\n * If the active item is a submenu, it will be opened and the first\n * item will be activated.\n *\n * If the active item is a command, the command will be executed.\n *\n * If the menu is not attached, this is a no-op.\n *\n * If there is no active item, this is a no-op.\n */\n triggerActiveItem() {\n // Bail if the menu is not attached.\n if (!this.isAttached) {\n return;\n }\n // Bail if there is no active item.\n let item = this.activeItem;\n if (!item) {\n return;\n }\n // Cancel the pending timers.\n this._cancelOpenTimer();\n this._cancelCloseTimer();\n // If the item is a submenu, open it.\n if (item.type === 'submenu') {\n this._openChildMenu(true);\n return;\n }\n // Close the root menu before executing the command.\n this.rootMenu.close();\n // Execute the command for the item.\n let { command, args } = item;\n if (this.commands.isEnabled(command, args)) {\n this.commands.execute(command, args);\n }\n else {\n console.log(`Command '${command}' is disabled.`);\n }\n }\n /**\n * Add a menu item to the end of the menu.\n *\n * @param options - The options for creating the menu item.\n *\n * @returns The menu item added to the menu.\n */\n addItem(options) {\n return this.insertItem(this._items.length, options);\n }\n /**\n * Insert a menu item into the menu at the specified index.\n *\n * @param index - The index at which to insert the item.\n *\n * @param options - The options for creating the menu item.\n *\n * @returns The menu item added to the menu.\n *\n * #### Notes\n * The index will be clamped to the bounds of the items.\n */\n insertItem(index, options) {\n // Close the menu if it's attached.\n if (this.isAttached) {\n this.close();\n }\n // Reset the active index.\n this.activeIndex = -1;\n // Clamp the insert index to the array bounds.\n let i = Math.max(0, Math.min(index, this._items.length));\n // Create the item for the options.\n let item = Private$9.createItem(this, options);\n // Insert the item into the array.\n ArrayExt.insert(this._items, i, item);\n // Schedule an update of the items.\n this.update();\n // Return the item added to the menu.\n return item;\n }\n /**\n * Remove an item from the menu.\n *\n * @param item - The item to remove from the menu.\n *\n * #### Notes\n * This is a no-op if the item is not in the menu.\n */\n removeItem(item) {\n this.removeItemAt(this._items.indexOf(item));\n }\n /**\n * Remove the item at a given index from the menu.\n *\n * @param index - The index of the item to remove.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n removeItemAt(index) {\n // Close the menu if it's attached.\n if (this.isAttached) {\n this.close();\n }\n // Reset the active index.\n this.activeIndex = -1;\n // Remove the item from the array.\n let item = ArrayExt.removeAt(this._items, index);\n // Bail if the index is out of range.\n if (!item) {\n return;\n }\n // Schedule an update of the items.\n this.update();\n }\n /**\n * Remove all menu items from the menu.\n */\n clearItems() {\n // Close the menu if it's attached.\n if (this.isAttached) {\n this.close();\n }\n // Reset the active index.\n this.activeIndex = -1;\n // Bail if there is nothing to remove.\n if (this._items.length === 0) {\n return;\n }\n // Clear the items.\n this._items.length = 0;\n // Schedule an update of the items.\n this.update();\n }\n /**\n * Open the menu at the specified location.\n *\n * @param x - The client X coordinate of the menu location.\n *\n * @param y - The client Y coordinate of the menu location.\n *\n * @param options - The additional options for opening the menu.\n *\n * #### Notes\n * The menu will be opened at the given location unless it will not\n * fully fit on the screen. If it will not fit, it will be adjusted\n * to fit naturally on the screen.\n *\n * The menu will be attached under the `host` element in the DOM\n * (or `document.body` if `host` is `null`) and before the `ref`\n * element (or as the last child of `host` if `ref` is `null`).\n * The menu may be displayed outside of the `host` element\n * following the rules of CSS absolute positioning.\n *\n * This is a no-op if the menu is already attached to the DOM.\n */\n open(x, y, options = {}) {\n var _a, _b;\n // Bail early if the menu is already attached.\n if (this.isAttached) {\n return;\n }\n // Extract the menu options.\n let forceX = options.forceX || false;\n let forceY = options.forceY || false;\n const host = (_a = options.host) !== null && _a !== void 0 ? _a : null;\n const ref = (_b = options.ref) !== null && _b !== void 0 ? _b : null;\n // Open the menu as a root menu.\n Private$9.openRootMenu(this, x, y, forceX, forceY, host, ref);\n // Activate the menu to accept keyboard input.\n this.activate();\n }\n /**\n * Handle the DOM events for the menu.\n *\n * @param event - The DOM event sent to the menu.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the menu's DOM nodes. It should\n * not be called directly by user code.\n */\n handleEvent(event) {\n switch (event.type) {\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseenter':\n this._evtMouseEnter(event);\n break;\n case 'mouseleave':\n this._evtMouseLeave(event);\n break;\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n }\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n onBeforeAttach(msg) {\n this.node.addEventListener('keydown', this);\n this.node.addEventListener('mouseup', this);\n this.node.addEventListener('mousemove', this);\n this.node.addEventListener('mouseenter', this);\n this.node.addEventListener('mouseleave', this);\n this.node.addEventListener('contextmenu', this);\n document.addEventListener('mousedown', this, true);\n }\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n onAfterDetach(msg) {\n this.node.removeEventListener('keydown', this);\n this.node.removeEventListener('mouseup', this);\n this.node.removeEventListener('mousemove', this);\n this.node.removeEventListener('mouseenter', this);\n this.node.removeEventListener('mouseleave', this);\n this.node.removeEventListener('contextmenu', this);\n document.removeEventListener('mousedown', this, true);\n }\n /**\n * A message handler invoked on an `'activate-request'` message.\n */\n onActivateRequest(msg) {\n if (this.isAttached) {\n this.node.focus();\n }\n }\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n onUpdateRequest(msg) {\n let items = this._items;\n let renderer = this.renderer;\n let activeIndex = this._activeIndex;\n let collapsedFlags = Private$9.computeCollapsed(items);\n let content = new Array(items.length);\n for (let i = 0, n = items.length; i < n; ++i) {\n let item = items[i];\n let active = i === activeIndex;\n let collapsed = collapsedFlags[i];\n content[i] = renderer.renderItem({\n item,\n active,\n collapsed,\n onfocus: () => {\n this.activeIndex = i;\n }\n });\n }\n VirtualDOM.render(content, this.contentNode);\n }\n /**\n * A message handler invoked on a `'close-request'` message.\n */\n onCloseRequest(msg) {\n // Cancel the pending timers.\n this._cancelOpenTimer();\n this._cancelCloseTimer();\n // Reset the active index.\n this.activeIndex = -1;\n // Close any open child menu.\n let childMenu = this._childMenu;\n if (childMenu) {\n this._childIndex = -1;\n this._childMenu = null;\n childMenu._parentMenu = null;\n childMenu.close();\n }\n // Remove this menu from its parent and activate the parent.\n let parentMenu = this._parentMenu;\n if (parentMenu) {\n this._parentMenu = null;\n parentMenu._childIndex = -1;\n parentMenu._childMenu = null;\n parentMenu.activate();\n }\n // Emit the `aboutToClose` signal if the menu is attached.\n if (this.isAttached) {\n this._aboutToClose.emit(undefined);\n }\n // Finish closing the menu.\n super.onCloseRequest(msg);\n }\n /**\n * Handle the `'keydown'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n _evtKeyDown(event) {\n // A menu handles all keydown events.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the key code for the event.\n let kc = event.keyCode;\n // Enter\n if (kc === 13) {\n this.triggerActiveItem();\n return;\n }\n // Escape\n if (kc === 27) {\n this.close();\n return;\n }\n // Left Arrow\n if (kc === 37) {\n if (this._parentMenu) {\n this.close();\n }\n else {\n this._menuRequested.emit('previous');\n }\n return;\n }\n // Up Arrow\n if (kc === 38) {\n this.activatePreviousItem();\n return;\n }\n // Right Arrow\n if (kc === 39) {\n let item = this.activeItem;\n if (item && item.type === 'submenu') {\n this.triggerActiveItem();\n }\n else {\n this.rootMenu._menuRequested.emit('next');\n }\n return;\n }\n // Down Arrow\n if (kc === 40) {\n this.activateNextItem();\n return;\n }\n // Get the pressed key character.\n let key = getKeyboardLayout().keyForKeydownEvent(event);\n // Bail if the key is not valid.\n if (!key) {\n return;\n }\n // Search for the next best matching mnemonic item.\n let start = this._activeIndex + 1;\n let result = Private$9.findMnemonic(this._items, key, start);\n // Handle the requested mnemonic based on the search results.\n // If exactly one mnemonic is matched, that item is triggered.\n // Otherwise, the next mnemonic is activated if available,\n // followed by the auto mnemonic if available.\n if (result.index !== -1 && !result.multiple) {\n this.activeIndex = result.index;\n this.triggerActiveItem();\n }\n else if (result.index !== -1) {\n this.activeIndex = result.index;\n }\n else if (result.auto !== -1) {\n this.activeIndex = result.auto;\n }\n }\n /**\n * Handle the `'mouseup'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n _evtMouseUp(event) {\n if (event.button !== 0) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n this.triggerActiveItem();\n }\n /**\n * Handle the `'mousemove'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n _evtMouseMove(event) {\n // Hit test the item nodes for the item under the mouse.\n let index = ArrayExt.findFirstIndex(this.contentNode.children, node => {\n return ElementExt.hitTest(node, event.clientX, event.clientY);\n });\n // Bail early if the mouse is already over the active index.\n if (index === this._activeIndex) {\n return;\n }\n // Update and coerce the active index.\n this.activeIndex = index;\n index = this.activeIndex;\n // If the index is the current child index, cancel the timers.\n if (index === this._childIndex) {\n this._cancelOpenTimer();\n this._cancelCloseTimer();\n return;\n }\n // If a child menu is currently open, start the close timer.\n if (this._childIndex !== -1) {\n this._startCloseTimer();\n }\n // Cancel the open timer to give a full delay for opening.\n this._cancelOpenTimer();\n // Bail if the active item is not a valid submenu item.\n let item = this.activeItem;\n if (!item || item.type !== 'submenu' || !item.submenu) {\n return;\n }\n // Start the open timer to open the active item submenu.\n this._startOpenTimer();\n }\n /**\n * Handle the `'mouseenter'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n _evtMouseEnter(event) {\n // Synchronize the active ancestor items.\n for (let menu = this._parentMenu; menu; menu = menu._parentMenu) {\n menu._cancelOpenTimer();\n menu._cancelCloseTimer();\n menu.activeIndex = menu._childIndex;\n }\n }\n /**\n * Handle the `'mouseleave'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n _evtMouseLeave(event) {\n // Cancel any pending submenu opening.\n this._cancelOpenTimer();\n // If there is no open child menu, just reset the active index.\n if (!this._childMenu) {\n this.activeIndex = -1;\n return;\n }\n // If the mouse is over the child menu, cancel the close timer.\n let { clientX, clientY } = event;\n if (ElementExt.hitTest(this._childMenu.node, clientX, clientY)) {\n this._cancelCloseTimer();\n return;\n }\n // Otherwise, reset the active index and start the close timer.\n this.activeIndex = -1;\n this._startCloseTimer();\n }\n /**\n * Handle the `'mousedown'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the document node.\n */\n _evtMouseDown(event) {\n // Bail if the menu is not a root menu.\n if (this._parentMenu) {\n return;\n }\n // The mouse button which is pressed is irrelevant. If the press\n // is not on a menu, the entire hierarchy is closed and the event\n // is allowed to propagate. This allows other code to act on the\n // event, such as focusing the clicked element.\n if (Private$9.hitTestMenus(this, event.clientX, event.clientY)) {\n event.preventDefault();\n event.stopPropagation();\n }\n else {\n this.close();\n }\n }\n /**\n * Open the child menu at the active index immediately.\n *\n * If a different child menu is already open, it will be closed,\n * even if the active item is not a valid submenu.\n */\n _openChildMenu(activateFirst = false) {\n // If the item is not a valid submenu, close the child menu.\n let item = this.activeItem;\n if (!item || item.type !== 'submenu' || !item.submenu) {\n this._closeChildMenu();\n return;\n }\n // Do nothing if the child menu will not change.\n let submenu = item.submenu;\n if (submenu === this._childMenu) {\n return;\n }\n // Prior to any DOM modifications save window data\n Menu.saveWindowData();\n // Ensure the current child menu is closed.\n this._closeChildMenu();\n // Update the private child state.\n this._childMenu = submenu;\n this._childIndex = this._activeIndex;\n // Set the parent menu reference for the child.\n submenu._parentMenu = this;\n // Ensure the menu is updated and lookup the item node.\n MessageLoop.sendMessage(this, Widget.Msg.UpdateRequest);\n let itemNode = this.contentNode.children[this._activeIndex];\n // Open the submenu at the active node.\n Private$9.openSubmenu(submenu, itemNode);\n // Activate the first item if desired.\n if (activateFirst) {\n submenu.activeIndex = -1;\n submenu.activateNextItem();\n }\n // Activate the child menu.\n submenu.activate();\n }\n /**\n * Close the child menu immediately.\n *\n * This is a no-op if a child menu is not open.\n */\n _closeChildMenu() {\n if (this._childMenu) {\n this._childMenu.close();\n }\n }\n /**\n * Start the open timer, unless it is already pending.\n */\n _startOpenTimer() {\n if (this._openTimerID === 0) {\n this._openTimerID = window.setTimeout(() => {\n this._openTimerID = 0;\n this._openChildMenu();\n }, Private$9.TIMER_DELAY);\n }\n }\n /**\n * Start the close timer, unless it is already pending.\n */\n _startCloseTimer() {\n if (this._closeTimerID === 0) {\n this._closeTimerID = window.setTimeout(() => {\n this._closeTimerID = 0;\n this._closeChildMenu();\n }, Private$9.TIMER_DELAY);\n }\n }\n /**\n * Cancel the open timer, if the timer is pending.\n */\n _cancelOpenTimer() {\n if (this._openTimerID !== 0) {\n clearTimeout(this._openTimerID);\n this._openTimerID = 0;\n }\n }\n /**\n * Cancel the close timer, if the timer is pending.\n */\n _cancelCloseTimer() {\n if (this._closeTimerID !== 0) {\n clearTimeout(this._closeTimerID);\n this._closeTimerID = 0;\n }\n }\n /**\n * Save window data used for menu positioning in transient cache.\n *\n * In order to avoid layout trashing it is recommended to invoke this\n * method immediately prior to opening the menu and any DOM modifications\n * (like closing previously visible menu, or adding a class to menu widget).\n *\n * The transient cache will be released upon `open()` call.\n */\n static saveWindowData() {\n Private$9.saveWindowData();\n }\n}\n/**\n * The namespace for the `Menu` class statics.\n */\n(function (Menu) {\n /**\n * The default implementation of `IRenderer`.\n *\n * #### Notes\n * Subclasses are free to reimplement rendering methods as needed.\n */\n class Renderer {\n /**\n * Render the virtual element for a menu item.\n *\n * @param data - The data to use for rendering the item.\n *\n * @returns A virtual element representing the item.\n */\n renderItem(data) {\n let className = this.createItemClass(data);\n let dataset = this.createItemDataset(data);\n let aria = this.createItemARIA(data);\n return h.li({\n className,\n dataset,\n tabindex: '0',\n onfocus: data.onfocus,\n ...aria\n }, this.renderIcon(data), this.renderLabel(data), this.renderShortcut(data), this.renderSubmenu(data));\n }\n /**\n * Render the icon element for a menu item.\n *\n * @param data - The data to use for rendering the icon.\n *\n * @returns A virtual element representing the item icon.\n */\n renderIcon(data) {\n let className = this.createIconClass(data);\n // If data.item.icon is undefined, it will be ignored.\n return h.div({ className }, data.item.icon, data.item.iconLabel);\n }\n /**\n * Render the label element for a menu item.\n *\n * @param data - The data to use for rendering the label.\n *\n * @returns A virtual element representing the item label.\n */\n renderLabel(data) {\n let content = this.formatLabel(data);\n return h.div({ className: 'lm-Menu-itemLabel' }, content);\n }\n /**\n * Render the shortcut element for a menu item.\n *\n * @param data - The data to use for rendering the shortcut.\n *\n * @returns A virtual element representing the item shortcut.\n */\n renderShortcut(data) {\n let content = this.formatShortcut(data);\n return h.div({ className: 'lm-Menu-itemShortcut' }, content);\n }\n /**\n * Render the submenu icon element for a menu item.\n *\n * @param data - The data to use for rendering the submenu icon.\n *\n * @returns A virtual element representing the submenu icon.\n */\n renderSubmenu(data) {\n return h.div({ className: 'lm-Menu-itemSubmenuIcon' });\n }\n /**\n * Create the class name for the menu item.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the menu item.\n */\n createItemClass(data) {\n // Setup the initial class name.\n let name = 'lm-Menu-item';\n // Add the boolean state classes.\n if (!data.item.isEnabled) {\n name += ' lm-mod-disabled';\n }\n if (data.item.isToggled) {\n name += ' lm-mod-toggled';\n }\n if (!data.item.isVisible) {\n name += ' lm-mod-hidden';\n }\n if (data.active) {\n name += ' lm-mod-active';\n }\n if (data.collapsed) {\n name += ' lm-mod-collapsed';\n }\n // Add the extra class.\n let extra = data.item.className;\n if (extra) {\n name += ` ${extra}`;\n }\n // Return the complete class name.\n return name;\n }\n /**\n * Create the dataset for the menu item.\n *\n * @param data - The data to use for creating the dataset.\n *\n * @returns The dataset for the menu item.\n */\n createItemDataset(data) {\n let result;\n let { type, command, dataset } = data.item;\n if (type === 'command') {\n result = { ...dataset, type, command };\n }\n else {\n result = { ...dataset, type };\n }\n return result;\n }\n /**\n * Create the class name for the menu item icon.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the item icon.\n */\n createIconClass(data) {\n let name = 'lm-Menu-itemIcon';\n let extra = data.item.iconClass;\n return extra ? `${name} ${extra}` : name;\n }\n /**\n * Create the aria attributes for menu item.\n *\n * @param data - The data to use for the aria attributes.\n *\n * @returns The aria attributes object for the item.\n */\n createItemARIA(data) {\n let aria = {};\n switch (data.item.type) {\n case 'separator':\n aria.role = 'presentation';\n break;\n case 'submenu':\n aria['aria-haspopup'] = 'true';\n if (!data.item.isEnabled) {\n aria['aria-disabled'] = 'true';\n }\n break;\n default:\n if (!data.item.isEnabled) {\n aria['aria-disabled'] = 'true';\n }\n aria.role = 'menuitem';\n }\n return aria;\n }\n /**\n * Create the render content for the label node.\n *\n * @param data - The data to use for the label content.\n *\n * @returns The content to add to the label node.\n */\n formatLabel(data) {\n // Fetch the label text and mnemonic index.\n let { label, mnemonic } = data.item;\n // If the index is out of range, do not modify the label.\n if (mnemonic < 0 || mnemonic >= label.length) {\n return label;\n }\n // Split the label into parts.\n let prefix = label.slice(0, mnemonic);\n let suffix = label.slice(mnemonic + 1);\n let char = label[mnemonic];\n // Wrap the mnemonic character in a span.\n let span = h.span({ className: 'lm-Menu-itemMnemonic' }, char);\n // Return the content parts.\n return [prefix, span, suffix];\n }\n /**\n * Create the render content for the shortcut node.\n *\n * @param data - The data to use for the shortcut content.\n *\n * @returns The content to add to the shortcut node.\n */\n formatShortcut(data) {\n let kb = data.item.keyBinding;\n return kb ? CommandRegistry.formatKeystroke(kb.keys) : null;\n }\n }\n Menu.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n Menu.defaultRenderer = new Renderer();\n})(Menu || (Menu = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private$9;\n(function (Private) {\n /**\n * The ms delay for opening and closing a submenu.\n */\n Private.TIMER_DELAY = 300;\n /**\n * The horizontal pixel overlap for an open submenu.\n */\n Private.SUBMENU_OVERLAP = 3;\n let transientWindowDataCache = null;\n let transientCacheCounter = 0;\n function getWindowData() {\n // if transient cache is in use, take one from it\n if (transientCacheCounter > 0) {\n transientCacheCounter--;\n return transientWindowDataCache;\n }\n return _getWindowData();\n }\n /**\n * Store window data in transient cache.\n *\n * The transient cache will be released upon `getWindowData()` call.\n * If this function is called multiple times, the cache will be\n * retained until as many calls to `getWindowData()` were made.\n *\n * Note: should be called before any DOM modifications.\n */\n function saveWindowData() {\n transientWindowDataCache = _getWindowData();\n transientCacheCounter++;\n }\n Private.saveWindowData = saveWindowData;\n /**\n * Create the DOM node for a menu.\n */\n function createNode() {\n let node = document.createElement('div');\n let content = document.createElement('ul');\n content.className = 'lm-Menu-content';\n node.appendChild(content);\n content.setAttribute('role', 'menu');\n node.tabIndex = 0;\n return node;\n }\n Private.createNode = createNode;\n /**\n * Test whether a menu item can be activated.\n */\n function canActivate(item) {\n return item.type !== 'separator' && item.isEnabled && item.isVisible;\n }\n Private.canActivate = canActivate;\n /**\n * Create a new menu item for an owner menu.\n */\n function createItem(owner, options) {\n return new MenuItem(owner.commands, options);\n }\n Private.createItem = createItem;\n /**\n * Hit test a menu hierarchy starting at the given root.\n */\n function hitTestMenus(menu, x, y) {\n for (let temp = menu; temp; temp = temp.childMenu) {\n if (ElementExt.hitTest(temp.node, x, y)) {\n return true;\n }\n }\n return false;\n }\n Private.hitTestMenus = hitTestMenus;\n /**\n * Compute which extra separator items should be collapsed.\n */\n function computeCollapsed(items) {\n // Allocate the return array and fill it with `false`.\n let result = new Array(items.length);\n ArrayExt.fill(result, false);\n // Collapse the leading separators.\n let k1 = 0;\n let n = items.length;\n for (; k1 < n; ++k1) {\n let item = items[k1];\n if (!item.isVisible) {\n continue;\n }\n if (item.type !== 'separator') {\n break;\n }\n result[k1] = true;\n }\n // Hide the trailing separators.\n let k2 = n - 1;\n for (; k2 >= 0; --k2) {\n let item = items[k2];\n if (!item.isVisible) {\n continue;\n }\n if (item.type !== 'separator') {\n break;\n }\n result[k2] = true;\n }\n // Hide the remaining consecutive separators.\n let hide = false;\n while (++k1 < k2) {\n let item = items[k1];\n if (!item.isVisible) {\n continue;\n }\n if (item.type !== 'separator') {\n hide = false;\n }\n else if (hide) {\n result[k1] = true;\n }\n else {\n hide = true;\n }\n }\n // Return the resulting flags.\n return result;\n }\n Private.computeCollapsed = computeCollapsed;\n function _getWindowData() {\n return {\n pageXOffset: window.pageXOffset,\n pageYOffset: window.pageYOffset,\n clientWidth: document.documentElement.clientWidth,\n clientHeight: document.documentElement.clientHeight\n };\n }\n /**\n * Open a menu as a root menu at the target location.\n */\n function openRootMenu(menu, x, y, forceX, forceY, host, ref) {\n // Get the current position and size of the main viewport.\n const windowData = getWindowData();\n let px = windowData.pageXOffset;\n let py = windowData.pageYOffset;\n let cw = windowData.clientWidth;\n let ch = windowData.clientHeight;\n // Ensure the menu is updated before attaching and measuring.\n MessageLoop.sendMessage(menu, Widget.Msg.UpdateRequest);\n // Compute the maximum allowed height for the menu.\n let maxHeight = ch - (forceY ? y : 0);\n // Fetch common variables.\n let node = menu.node;\n let style = node.style;\n // Clear the menu geometry and prepare it for measuring.\n style.opacity = '0';\n style.maxHeight = `${maxHeight}px`;\n // Attach the menu to the document.\n Widget.attach(menu, host || document.body, ref);\n // Measure the size of the menu.\n let { width, height } = node.getBoundingClientRect();\n // Adjust the X position of the menu to fit on-screen.\n if (!forceX && x + width > px + cw) {\n x = px + cw - width;\n }\n // Adjust the Y position of the menu to fit on-screen.\n if (!forceY && y + height > py + ch) {\n if (y > py + ch) {\n y = py + ch - height;\n }\n else {\n y = y - height;\n }\n }\n // Update the position of the menu to the computed position.\n style.transform = `translate(${Math.max(0, x)}px, ${Math.max(0, y)}px`;\n // Finally, make the menu visible on the screen.\n style.opacity = '1';\n }\n Private.openRootMenu = openRootMenu;\n /**\n * Open a menu as a submenu using an item node for positioning.\n */\n function openSubmenu(submenu, itemNode) {\n // Get the current position and size of the main viewport.\n const windowData = getWindowData();\n let px = windowData.pageXOffset;\n let py = windowData.pageYOffset;\n let cw = windowData.clientWidth;\n let ch = windowData.clientHeight;\n // Ensure the menu is updated before opening.\n MessageLoop.sendMessage(submenu, Widget.Msg.UpdateRequest);\n // Compute the maximum allowed height for the menu.\n let maxHeight = ch;\n // Fetch common variables.\n let node = submenu.node;\n let style = node.style;\n // Clear the menu geometry and prepare it for measuring.\n style.opacity = '0';\n style.maxHeight = `${maxHeight}px`;\n // Attach the menu to the document.\n Widget.attach(submenu, document.body);\n // Measure the size of the menu.\n let { width, height } = node.getBoundingClientRect();\n // Compute the box sizing for the menu.\n let box = ElementExt.boxSizing(submenu.node);\n // Get the bounding rect for the target item node.\n let itemRect = itemNode.getBoundingClientRect();\n // Compute the target X position.\n let x = itemRect.right - Private.SUBMENU_OVERLAP;\n // Adjust the X position to fit on the screen.\n if (x + width > px + cw) {\n x = itemRect.left + Private.SUBMENU_OVERLAP - width;\n }\n // Compute the target Y position.\n let y = itemRect.top - box.borderTop - box.paddingTop;\n // Adjust the Y position to fit on the screen.\n if (y + height > py + ch) {\n y = itemRect.bottom + box.borderBottom + box.paddingBottom - height;\n }\n // Update the position of the menu to the computed position.\n style.transform = `translate(${Math.max(0, x)}px, ${Math.max(0, y)}px`;\n // Finally, make the menu visible on the screen.\n style.opacity = '1';\n }\n Private.openSubmenu = openSubmenu;\n /**\n * Find the best matching mnemonic item.\n *\n * The search starts at the given index and wraps around.\n */\n function findMnemonic(items, key, start) {\n // Setup the result variables.\n let index = -1;\n let auto = -1;\n let multiple = false;\n // Normalize the key to upper case.\n let upperKey = key.toUpperCase();\n // Search the items from the given start index.\n for (let i = 0, n = items.length; i < n; ++i) {\n // Compute the wrapped index.\n let k = (i + start) % n;\n // Lookup the item\n let item = items[k];\n // Ignore items which cannot be activated.\n if (!canActivate(item)) {\n continue;\n }\n // Ignore items with an empty label.\n let label = item.label;\n if (label.length === 0) {\n continue;\n }\n // Lookup the mnemonic index for the label.\n let mn = item.mnemonic;\n // Handle a valid mnemonic index.\n if (mn >= 0 && mn < label.length) {\n if (label[mn].toUpperCase() === upperKey) {\n if (index === -1) {\n index = k;\n }\n else {\n multiple = true;\n }\n }\n continue;\n }\n // Finally, handle the auto index if possible.\n if (auto === -1 && label[0].toUpperCase() === upperKey) {\n auto = k;\n }\n }\n // Return the search results.\n return { index, multiple, auto };\n }\n Private.findMnemonic = findMnemonic;\n /**\n * A concrete implementation of `Menu.IItem`.\n */\n class MenuItem {\n /**\n * Construct a new menu item.\n */\n constructor(commands, options) {\n this._commands = commands;\n this.type = options.type || 'command';\n this.command = options.command || '';\n this.args = options.args || JSONExt.emptyObject;\n this.submenu = options.submenu || null;\n }\n /**\n * The display label for the menu item.\n */\n get label() {\n if (this.type === 'command') {\n return this._commands.label(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.label;\n }\n return '';\n }\n /**\n * The mnemonic index for the menu item.\n */\n get mnemonic() {\n if (this.type === 'command') {\n return this._commands.mnemonic(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.mnemonic;\n }\n return -1;\n }\n /**\n * The icon renderer for the menu item.\n */\n get icon() {\n if (this.type === 'command') {\n return this._commands.icon(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.icon;\n }\n return undefined;\n }\n /**\n * The icon class for the menu item.\n */\n get iconClass() {\n if (this.type === 'command') {\n return this._commands.iconClass(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.iconClass;\n }\n return '';\n }\n /**\n * The icon label for the menu item.\n */\n get iconLabel() {\n if (this.type === 'command') {\n return this._commands.iconLabel(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.iconLabel;\n }\n return '';\n }\n /**\n * The display caption for the menu item.\n */\n get caption() {\n if (this.type === 'command') {\n return this._commands.caption(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.caption;\n }\n return '';\n }\n /**\n * The extra class name for the menu item.\n */\n get className() {\n if (this.type === 'command') {\n return this._commands.className(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.className;\n }\n return '';\n }\n /**\n * The dataset for the menu item.\n */\n get dataset() {\n if (this.type === 'command') {\n return this._commands.dataset(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.dataset;\n }\n return {};\n }\n /**\n * Whether the menu item is enabled.\n */\n get isEnabled() {\n if (this.type === 'command') {\n return this._commands.isEnabled(this.command, this.args);\n }\n if (this.type === 'submenu') {\n return this.submenu !== null;\n }\n return true;\n }\n /**\n * Whether the menu item is toggled.\n */\n get isToggled() {\n if (this.type === 'command') {\n return this._commands.isToggled(this.command, this.args);\n }\n return false;\n }\n /**\n * Whether the menu item is visible.\n */\n get isVisible() {\n if (this.type === 'command') {\n return this._commands.isVisible(this.command, this.args);\n }\n if (this.type === 'submenu') {\n return this.submenu !== null;\n }\n return true;\n }\n /**\n * The key binding for the menu item.\n */\n get keyBinding() {\n if (this.type === 'command') {\n let { command, args } = this;\n return (ArrayExt.findLastValue(this._commands.keyBindings, kb => {\n return kb.command === command && JSONExt.deepEqual(kb.args, args);\n }) || null);\n }\n return null;\n }\n }\n})(Private$9 || (Private$9 = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * An object which implements a universal context menu.\n *\n * #### Notes\n * The items shown in the context menu are determined by CSS selector\n * matching against the DOM hierarchy at the site of the mouse click.\n * This is similar in concept to how keyboard shortcuts are matched\n * in the command registry.\n */\nclass ContextMenu {\n /**\n * Construct a new context menu.\n *\n * @param options - The options for initializing the menu.\n */\n constructor(options) {\n this._groupByTarget = true;\n this._idTick = 0;\n this._items = [];\n this._sortBySelector = true;\n const { groupByTarget, sortBySelector, ...others } = options;\n this.menu = new Menu(others);\n this._groupByTarget = groupByTarget !== false;\n this._sortBySelector = sortBySelector !== false;\n }\n /**\n * Add an item to the context menu.\n *\n * @param options - The options for creating the item.\n *\n * @returns A disposable which will remove the item from the menu.\n */\n addItem(options) {\n // Create an item from the given options.\n let item = Private$8.createItem(options, this._idTick++);\n // Add the item to the internal array.\n this._items.push(item);\n // Return a disposable which will remove the item.\n return new DisposableDelegate(() => {\n ArrayExt.removeFirstOf(this._items, item);\n });\n }\n /**\n * Open the context menu in response to a `'contextmenu'` event.\n *\n * @param event - The `'contextmenu'` event of interest.\n *\n * @returns `true` if the menu was opened, or `false` if no items\n * matched the event and the menu was not opened.\n *\n * #### Notes\n * This method will populate the context menu with items which match\n * the propagation path of the event, then open the menu at the mouse\n * position indicated by the event.\n */\n open(event) {\n // Prior to any DOM modifications update the window data.\n Menu.saveWindowData();\n // Clear the current contents of the context menu.\n this.menu.clearItems();\n // Bail early if there are no items to match.\n if (this._items.length === 0) {\n return false;\n }\n // Find the matching items for the event.\n let items = Private$8.matchItems(this._items, event, this._groupByTarget, this._sortBySelector);\n // Bail if there are no matching items.\n if (!items || items.length === 0) {\n return false;\n }\n // Add the filtered items to the menu.\n for (const item of items) {\n this.menu.addItem(item);\n }\n // Open the context menu at the current mouse position.\n this.menu.open(event.clientX, event.clientY);\n // Indicate success.\n return true;\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private$8;\n(function (Private) {\n /**\n * Create a normalized context menu item from an options object.\n */\n function createItem(options, id) {\n let selector = validateSelector(options.selector);\n let rank = options.rank !== undefined ? options.rank : Infinity;\n return { ...options, selector, rank, id };\n }\n Private.createItem = createItem;\n /**\n * Find the items which match a context menu event.\n *\n * The results are sorted by DOM level, specificity, and rank.\n */\n function matchItems(items, event, groupByTarget, sortBySelector) {\n // Look up the target of the event.\n let target = event.target;\n // Bail if there is no target.\n if (!target) {\n return null;\n }\n // Look up the current target of the event.\n let currentTarget = event.currentTarget;\n // Bail if there is no current target.\n if (!currentTarget) {\n return null;\n }\n // There are some third party libraries that cause the `target` to\n // be detached from the DOM before lumino can process the event.\n // If that happens, search for a new target node by point. If that\n // node is still dangling, bail.\n if (!currentTarget.contains(target)) {\n target = document.elementFromPoint(event.clientX, event.clientY);\n if (!target || !currentTarget.contains(target)) {\n return null;\n }\n }\n // Set up the result array.\n let result = [];\n // Copy the items array to allow in-place modification.\n let availableItems = items.slice();\n // Walk up the DOM hierarchy searching for matches.\n while (target !== null) {\n // Set up the match array for this DOM level.\n let matches = [];\n // Search the remaining items for matches.\n for (let i = 0, n = availableItems.length; i < n; ++i) {\n // Fetch the item.\n let item = availableItems[i];\n // Skip items which are already consumed.\n if (!item) {\n continue;\n }\n // Skip items which do not match the element.\n if (!Selector.matches(target, item.selector)) {\n continue;\n }\n // Add the matched item to the result for this DOM level.\n matches.push(item);\n // Mark the item as consumed.\n availableItems[i] = null;\n }\n // Sort the matches for this level and add them to the results.\n if (matches.length !== 0) {\n if (groupByTarget) {\n matches.sort(sortBySelector ? itemCmp : itemCmpRank);\n }\n result.push(...matches);\n }\n // Stop searching at the limits of the DOM range.\n if (target === currentTarget) {\n break;\n }\n // Step to the parent DOM level.\n target = target.parentElement;\n }\n if (!groupByTarget) {\n result.sort(sortBySelector ? itemCmp : itemCmpRank);\n }\n // Return the matched and sorted results.\n return result;\n }\n Private.matchItems = matchItems;\n /**\n * Validate the selector for a menu item.\n *\n * This returns the validated selector, or throws if the selector is\n * invalid or contains commas.\n */\n function validateSelector(selector) {\n if (selector.indexOf(',') !== -1) {\n throw new Error(`Selector cannot contain commas: ${selector}`);\n }\n if (!Selector.isValid(selector)) {\n throw new Error(`Invalid selector: ${selector}`);\n }\n return selector;\n }\n /**\n * A sort comparison function for a context menu item by ranks.\n */\n function itemCmpRank(a, b) {\n // Sort based on rank.\n let r1 = a.rank;\n let r2 = b.rank;\n if (r1 !== r2) {\n return r1 < r2 ? -1 : 1; // Infinity-safe\n }\n // When all else fails, sort by item id.\n return a.id - b.id;\n }\n /**\n * A sort comparison function for a context menu item by selectors and ranks.\n */\n function itemCmp(a, b) {\n // Sort first based on selector specificity.\n let s1 = Selector.calculateSpecificity(a.selector);\n let s2 = Selector.calculateSpecificity(b.selector);\n if (s1 !== s2) {\n return s2 - s1;\n }\n // If specificities are equal\n return itemCmpRank(a, b);\n }\n})(Private$8 || (Private$8 = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nconst ARROW_KEYS = [\n 'ArrowLeft',\n 'ArrowUp',\n 'ArrowRight',\n 'ArrowDown',\n 'Home',\n 'End'\n];\n/**\n * A widget which displays titles as a single row or column of tabs.\n *\n * #### Notes\n * If CSS transforms are used to rotate nodes for vertically oriented\n * text, then tab dragging will not work correctly. The `tabsMovable`\n * property should be set to `false` when rotating nodes from CSS.\n */\nclass TabBar extends Widget {\n /**\n * Construct a new tab bar.\n *\n * @param options - The options for initializing the tab bar.\n */\n constructor(options = {}) {\n super({ node: Private$7.createNode() });\n this._currentIndex = -1;\n this._titles = [];\n this._titlesEditable = false;\n this._previousTitle = null;\n this._dragData = null;\n this._addButtonEnabled = false;\n this._tabMoved = new Signal(this);\n this._currentChanged = new Signal(this);\n this._addRequested = new Signal(this);\n this._tabCloseRequested = new Signal(this);\n this._tabDetachRequested = new Signal(this);\n this._tabActivateRequested = new Signal(this);\n this.addClass('lm-TabBar');\n this.contentNode.setAttribute('role', 'tablist');\n this.setFlag(Widget.Flag.DisallowLayout);\n this._document = options.document || document;\n this.tabsMovable = options.tabsMovable || false;\n this.titlesEditable = options.titlesEditable || false;\n this.allowDeselect = options.allowDeselect || false;\n this.addButtonEnabled = options.addButtonEnabled || false;\n this.insertBehavior = options.insertBehavior || 'select-tab-if-needed';\n this.name = options.name || '';\n this.orientation = options.orientation || 'horizontal';\n this.removeBehavior = options.removeBehavior || 'select-tab-after';\n this.renderer = options.renderer || TabBar.defaultRenderer;\n }\n /**\n * Dispose of the resources held by the widget.\n */\n dispose() {\n this._releaseMouse();\n this._titles.length = 0;\n this._previousTitle = null;\n super.dispose();\n }\n /**\n * A signal emitted when the current tab is changed.\n *\n * #### Notes\n * This signal is emitted when the currently selected tab is changed\n * either through user or programmatic interaction.\n *\n * Notably, this signal is not emitted when the index of the current\n * tab changes due to tabs being inserted, removed, or moved. It is\n * only emitted when the actual current tab node is changed.\n */\n get currentChanged() {\n return this._currentChanged;\n }\n /**\n * A signal emitted when a tab is moved by the user.\n *\n * #### Notes\n * This signal is emitted when a tab is moved by user interaction.\n *\n * This signal is not emitted when a tab is moved programmatically.\n */\n get tabMoved() {\n return this._tabMoved;\n }\n /**\n * A signal emitted when a tab is clicked by the user.\n *\n * #### Notes\n * If the clicked tab is not the current tab, the clicked tab will be\n * made current and the `currentChanged` signal will be emitted first.\n *\n * This signal is emitted even if the clicked tab is the current tab.\n */\n get tabActivateRequested() {\n return this._tabActivateRequested;\n }\n /**\n * A signal emitted when the tab bar add button is clicked.\n */\n get addRequested() {\n return this._addRequested;\n }\n /**\n * A signal emitted when a tab close icon is clicked.\n *\n * #### Notes\n * This signal is not emitted unless the tab title is `closable`.\n */\n get tabCloseRequested() {\n return this._tabCloseRequested;\n }\n /**\n * A signal emitted when a tab is dragged beyond the detach threshold.\n *\n * #### Notes\n * This signal is emitted when the user drags a tab with the mouse,\n * and mouse is dragged beyond the detach threshold.\n *\n * The consumer of the signal should call `releaseMouse` and remove\n * the tab in order to complete the detach.\n *\n * This signal is only emitted once per drag cycle.\n */\n get tabDetachRequested() {\n return this._tabDetachRequested;\n }\n /**\n * The document to use with the tab bar.\n *\n * The default is the global `document` instance.\n */\n get document() {\n return this._document;\n }\n /**\n * Whether the titles can be user-edited.\n *\n */\n get titlesEditable() {\n return this._titlesEditable;\n }\n /**\n * Set whether titles can be user edited.\n *\n */\n set titlesEditable(value) {\n this._titlesEditable = value;\n }\n /**\n * Get the currently selected title.\n *\n * #### Notes\n * This will be `null` if no tab is selected.\n */\n get currentTitle() {\n return this._titles[this._currentIndex] || null;\n }\n /**\n * Set the currently selected title.\n *\n * #### Notes\n * If the title does not exist, the title will be set to `null`.\n */\n set currentTitle(value) {\n this.currentIndex = value ? this._titles.indexOf(value) : -1;\n }\n /**\n * Get the index of the currently selected tab.\n *\n * #### Notes\n * This will be `-1` if no tab is selected.\n */\n get currentIndex() {\n return this._currentIndex;\n }\n /**\n * Set the index of the currently selected tab.\n *\n * #### Notes\n * If the value is out of range, the index will be set to `-1`.\n */\n set currentIndex(value) {\n // Adjust for an out of range index.\n if (value < 0 || value >= this._titles.length) {\n value = -1;\n }\n // Bail early if the index will not change.\n if (this._currentIndex === value) {\n return;\n }\n // Look up the previous index and title.\n let pi = this._currentIndex;\n let pt = this._titles[pi] || null;\n // Look up the current index and title.\n let ci = value;\n let ct = this._titles[ci] || null;\n // Update the current index and previous title.\n this._currentIndex = ci;\n this._previousTitle = pt;\n // Schedule an update of the tabs.\n this.update();\n // Emit the current changed signal.\n this._currentChanged.emit({\n previousIndex: pi,\n previousTitle: pt,\n currentIndex: ci,\n currentTitle: ct\n });\n }\n /**\n * Get the name of the tab bar.\n */\n get name() {\n return this._name;\n }\n /**\n * Set the name of the tab bar.\n */\n set name(value) {\n this._name = value;\n if (value) {\n this.contentNode.setAttribute('aria-label', value);\n }\n else {\n this.contentNode.removeAttribute('aria-label');\n }\n }\n /**\n * Get the orientation of the tab bar.\n *\n * #### Notes\n * This controls whether the tabs are arranged in a row or column.\n */\n get orientation() {\n return this._orientation;\n }\n /**\n * Set the orientation of the tab bar.\n *\n * #### Notes\n * This controls whether the tabs are arranged in a row or column.\n */\n set orientation(value) {\n // Do nothing if the orientation does not change.\n if (this._orientation === value) {\n return;\n }\n // Release the mouse before making any changes.\n this._releaseMouse();\n // Toggle the orientation values.\n this._orientation = value;\n this.dataset['orientation'] = value;\n this.contentNode.setAttribute('aria-orientation', value);\n }\n /**\n * Whether the add button is enabled.\n */\n get addButtonEnabled() {\n return this._addButtonEnabled;\n }\n /**\n * Set whether the add button is enabled.\n */\n set addButtonEnabled(value) {\n // Do nothing if the value does not change.\n if (this._addButtonEnabled === value) {\n return;\n }\n this._addButtonEnabled = value;\n if (value) {\n this.addButtonNode.classList.remove('lm-mod-hidden');\n }\n else {\n this.addButtonNode.classList.add('lm-mod-hidden');\n }\n }\n /**\n * A read-only array of the titles in the tab bar.\n */\n get titles() {\n return this._titles;\n }\n /**\n * The tab bar content node.\n *\n * #### Notes\n * This is the node which holds the tab nodes.\n *\n * Modifying this node directly can lead to undefined behavior.\n */\n get contentNode() {\n return this.node.getElementsByClassName('lm-TabBar-content')[0];\n }\n /**\n * The tab bar add button node.\n *\n * #### Notes\n * This is the node which holds the add button.\n *\n * Modifying this node directly can lead to undefined behavior.\n */\n get addButtonNode() {\n return this.node.getElementsByClassName('lm-TabBar-addButton')[0];\n }\n /**\n * Add a tab to the end of the tab bar.\n *\n * @param value - The title which holds the data for the tab,\n * or an options object to convert to a title.\n *\n * @returns The title object added to the tab bar.\n *\n * #### Notes\n * If the title is already added to the tab bar, it will be moved.\n */\n addTab(value) {\n return this.insertTab(this._titles.length, value);\n }\n /**\n * Insert a tab into the tab bar at the specified index.\n *\n * @param index - The index at which to insert the tab.\n *\n * @param value - The title which holds the data for the tab,\n * or an options object to convert to a title.\n *\n * @returns The title object added to the tab bar.\n *\n * #### Notes\n * The index will be clamped to the bounds of the tabs.\n *\n * If the title is already added to the tab bar, it will be moved.\n */\n insertTab(index, value) {\n // Release the mouse before making any changes.\n this._releaseMouse();\n // Coerce the value to a title.\n let title = Private$7.asTitle(value);\n // Look up the index of the title.\n let i = this._titles.indexOf(title);\n // Clamp the insert index to the array bounds.\n let j = Math.max(0, Math.min(index, this._titles.length));\n // If the title is not in the array, insert it.\n if (i === -1) {\n // Insert the title into the array.\n ArrayExt.insert(this._titles, j, title);\n // Connect to the title changed signal.\n title.changed.connect(this._onTitleChanged, this);\n // Schedule an update of the tabs.\n this.update();\n // Adjust the current index for the insert.\n this._adjustCurrentForInsert(j, title);\n // Return the title added to the tab bar.\n return title;\n }\n // Otherwise, the title exists in the array and should be moved.\n // Adjust the index if the location is at the end of the array.\n if (j === this._titles.length) {\n j--;\n }\n // Bail if there is no effective move.\n if (i === j) {\n return title;\n }\n // Move the title to the new location.\n ArrayExt.move(this._titles, i, j);\n // Schedule an update of the tabs.\n this.update();\n // Adjust the current index for the move.\n this._adjustCurrentForMove(i, j);\n // Return the title added to the tab bar.\n return title;\n }\n /**\n * Remove a tab from the tab bar.\n *\n * @param title - The title for the tab to remove.\n *\n * #### Notes\n * This is a no-op if the title is not in the tab bar.\n */\n removeTab(title) {\n this.removeTabAt(this._titles.indexOf(title));\n }\n /**\n * Remove the tab at a given index from the tab bar.\n *\n * @param index - The index of the tab to remove.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n removeTabAt(index) {\n // Release the mouse before making any changes.\n this._releaseMouse();\n // Remove the title from the array.\n let title = ArrayExt.removeAt(this._titles, index);\n // Bail if the index is out of range.\n if (!title) {\n return;\n }\n // Disconnect from the title changed signal.\n title.changed.disconnect(this._onTitleChanged, this);\n // Clear the previous title if it's being removed.\n if (title === this._previousTitle) {\n this._previousTitle = null;\n }\n // Schedule an update of the tabs.\n this.update();\n // Adjust the current index for the remove.\n this._adjustCurrentForRemove(index, title);\n }\n /**\n * Remove all tabs from the tab bar.\n */\n clearTabs() {\n // Bail if there is nothing to remove.\n if (this._titles.length === 0) {\n return;\n }\n // Release the mouse before making any changes.\n this._releaseMouse();\n // Disconnect from the title changed signals.\n for (let title of this._titles) {\n title.changed.disconnect(this._onTitleChanged, this);\n }\n // Get the current index and title.\n let pi = this.currentIndex;\n let pt = this.currentTitle;\n // Reset the current index and previous title.\n this._currentIndex = -1;\n this._previousTitle = null;\n // Clear the title array.\n this._titles.length = 0;\n // Schedule an update of the tabs.\n this.update();\n // If no tab was selected, there's nothing else to do.\n if (pi === -1) {\n return;\n }\n // Emit the current changed signal.\n this._currentChanged.emit({\n previousIndex: pi,\n previousTitle: pt,\n currentIndex: -1,\n currentTitle: null\n });\n }\n /**\n * Release the mouse and restore the non-dragged tab positions.\n *\n * #### Notes\n * This will cause the tab bar to stop handling mouse events and to\n * restore the tabs to their non-dragged positions.\n */\n releaseMouse() {\n this._releaseMouse();\n }\n /**\n * Handle the DOM events for the tab bar.\n *\n * @param event - The DOM event sent to the tab bar.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the tab bar's DOM node.\n *\n * This should not be called directly by user code.\n */\n handleEvent(event) {\n switch (event.type) {\n case 'pointerdown':\n this._evtPointerDown(event);\n break;\n case 'pointermove':\n this._evtPointerMove(event);\n break;\n case 'pointerup':\n this._evtPointerUp(event);\n break;\n case 'dblclick':\n this._evtDblClick(event);\n break;\n case 'keydown':\n event.eventPhase === Event.CAPTURING_PHASE\n ? this._evtKeyDownCapturing(event)\n : this._evtKeyDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n }\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n onBeforeAttach(msg) {\n this.node.addEventListener('pointerdown', this);\n this.node.addEventListener('dblclick', this);\n this.node.addEventListener('keydown', this);\n }\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n onAfterDetach(msg) {\n this.node.removeEventListener('pointerdown', this);\n this.node.removeEventListener('dblclick', this);\n this.node.removeEventListener('keydown', this);\n this._releaseMouse();\n }\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n onUpdateRequest(msg) {\n var _a;\n let titles = this._titles;\n let renderer = this.renderer;\n let currentTitle = this.currentTitle;\n let content = new Array(titles.length);\n // Keep the tabindex=\"0\" attribute to the tab which handled it before the update.\n // If the add button handles it, no need to do anything. If no element of the tab\n // bar handles it, set it on the current or the first tab to ensure one element\n // handles it after update.\n const tabHandlingTabindex = (_a = this._getCurrentTabindex()) !== null && _a !== void 0 ? _a : (this._currentIndex > -1 ? this._currentIndex : 0);\n for (let i = 0, n = titles.length; i < n; ++i) {\n let title = titles[i];\n let current = title === currentTitle;\n let zIndex = current ? n : n - i - 1;\n let tabIndex = tabHandlingTabindex === i ? 0 : -1;\n content[i] = renderer.renderTab({ title, current, zIndex, tabIndex });\n }\n VirtualDOM.render(content, this.contentNode);\n }\n /**\n * Get the index of the tab which handles tabindex=\"0\".\n * If the add button handles tabindex=\"0\", -1 is returned.\n * If none of the previous handles tabindex=\"0\", null is returned.\n */\n _getCurrentTabindex() {\n let index = null;\n const elemTabindex = this.contentNode.querySelector('li[tabindex=\"0\"]');\n if (elemTabindex) {\n index = [...this.contentNode.children].indexOf(elemTabindex);\n }\n else if (this._addButtonEnabled &&\n this.addButtonNode.getAttribute('tabindex') === '0') {\n index = -1;\n }\n return index;\n }\n /**\n * Handle the `'dblclick'` event for the tab bar.\n */\n _evtDblClick(event) {\n // Do nothing if titles are not editable\n if (!this.titlesEditable) {\n return;\n }\n let tabs = this.contentNode.children;\n // Find the index of the targeted tab.\n let index = ArrayExt.findFirstIndex(tabs, tab => {\n return ElementExt.hitTest(tab, event.clientX, event.clientY);\n });\n // Do nothing if the press is not on a tab.\n if (index === -1) {\n return;\n }\n let title = this.titles[index];\n let label = tabs[index].querySelector('.lm-TabBar-tabLabel');\n if (label && label.contains(event.target)) {\n let value = title.label || '';\n // Clear the label element\n let oldValue = label.innerHTML;\n label.innerHTML = '';\n let input = document.createElement('input');\n input.classList.add('lm-TabBar-tabInput');\n input.value = value;\n label.appendChild(input);\n let onblur = () => {\n input.removeEventListener('blur', onblur);\n label.innerHTML = oldValue;\n this.node.addEventListener('keydown', this);\n };\n input.addEventListener('dblclick', (event) => event.stopPropagation());\n input.addEventListener('blur', onblur);\n input.addEventListener('keydown', (event) => {\n if (event.key === 'Enter') {\n if (input.value !== '') {\n title.label = title.caption = input.value;\n }\n onblur();\n }\n else if (event.key === 'Escape') {\n onblur();\n }\n });\n this.node.removeEventListener('keydown', this);\n input.select();\n input.focus();\n if (label.children.length > 0) {\n label.children[0].focus();\n }\n }\n }\n /**\n * Handle the `'keydown'` event for the tab bar at capturing phase.\n */\n _evtKeyDownCapturing(event) {\n if (event.eventPhase !== Event.CAPTURING_PHASE) {\n return;\n }\n // Stop all input events during drag.\n event.preventDefault();\n event.stopPropagation();\n // Release the mouse if `Escape` is pressed.\n if (event.key === 'Escape') {\n this._releaseMouse();\n }\n }\n /**\n * Handle the `'keydown'` event for the tab bar at target phase.\n */\n _evtKeyDown(event) {\n var _a, _b, _c;\n // Allow for navigation using tab key\n if (event.key === 'Tab' || event.eventPhase === Event.CAPTURING_PHASE) {\n return;\n }\n // Check if Enter or Spacebar key has been pressed and open that tab\n if (event.key === 'Enter' ||\n event.key === 'Spacebar' ||\n event.key === ' ') {\n // Get focus element that is in focus by the tab key\n const focusedElement = document.activeElement;\n // Test first if the focus is on the add button node\n if (this.addButtonEnabled &&\n this.addButtonNode.contains(focusedElement)) {\n event.preventDefault();\n event.stopPropagation();\n this._addRequested.emit();\n }\n else {\n const index = ArrayExt.findFirstIndex(this.contentNode.children, tab => tab.contains(focusedElement));\n if (index >= 0) {\n event.preventDefault();\n event.stopPropagation();\n this.currentIndex = index;\n }\n }\n // Handle the arrow keys to switch tabs.\n }\n else if (ARROW_KEYS.includes(event.key)) {\n // Create a list of all focusable elements in the tab bar.\n const focusable = [...this.contentNode.children];\n if (this.addButtonEnabled) {\n focusable.push(this.addButtonNode);\n }\n // If the tab bar contains only one element, nothing to do.\n if (focusable.length <= 1) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n // Get the current focused element.\n let focusedIndex = focusable.indexOf(document.activeElement);\n if (focusedIndex === -1) {\n focusedIndex = this._currentIndex;\n }\n // Find the next element to focus on.\n let nextFocused;\n if ((event.key === 'ArrowRight' && this._orientation === 'horizontal') ||\n (event.key === 'ArrowDown' && this._orientation === 'vertical')) {\n nextFocused = (_a = focusable[focusedIndex + 1]) !== null && _a !== void 0 ? _a : focusable[0];\n }\n else if ((event.key === 'ArrowLeft' && this._orientation === 'horizontal') ||\n (event.key === 'ArrowUp' && this._orientation === 'vertical')) {\n nextFocused =\n (_b = focusable[focusedIndex - 1]) !== null && _b !== void 0 ? _b : focusable[focusable.length - 1];\n }\n else if (event.key === 'Home') {\n nextFocused = focusable[0];\n }\n else if (event.key === 'End') {\n nextFocused = focusable[focusable.length - 1];\n }\n // Change the focused element and the tabindex value.\n if (nextFocused) {\n (_c = focusable[focusedIndex]) === null || _c === void 0 ? void 0 : _c.setAttribute('tabindex', '-1');\n nextFocused === null || nextFocused === void 0 ? void 0 : nextFocused.setAttribute('tabindex', '0');\n nextFocused.focus();\n }\n }\n }\n /**\n * Handle the `'pointerdown'` event for the tab bar.\n */\n _evtPointerDown(event) {\n // Do nothing if it's not a left or middle mouse press.\n if (event.button !== 0 && event.button !== 1) {\n return;\n }\n // Do nothing if a drag is in progress.\n if (this._dragData) {\n return;\n }\n // Do nothing if a title editable input was clicked.\n if (event.target.classList.contains('lm-TabBar-tabInput')) {\n return;\n }\n // Check if the add button was clicked.\n let addButtonClicked = this.addButtonEnabled &&\n this.addButtonNode.contains(event.target);\n // Lookup the tab nodes.\n let tabs = this.contentNode.children;\n // Find the index of the pressed tab.\n let index = ArrayExt.findFirstIndex(tabs, tab => {\n return ElementExt.hitTest(tab, event.clientX, event.clientY);\n });\n // Do nothing if the press is not on a tab or the add button.\n if (index === -1 && !addButtonClicked) {\n return;\n }\n // Pressing on a tab stops the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Initialize the non-measured parts of the drag data.\n this._dragData = {\n tab: tabs[index],\n index: index,\n pressX: event.clientX,\n pressY: event.clientY,\n tabPos: -1,\n tabSize: -1,\n tabPressPos: -1,\n targetIndex: -1,\n tabLayout: null,\n contentRect: null,\n override: null,\n dragActive: false,\n dragAborted: false,\n detachRequested: false\n };\n // Add the document pointer up listener.\n this.document.addEventListener('pointerup', this, true);\n // Do nothing else if the middle button or add button is clicked.\n if (event.button === 1 || addButtonClicked) {\n return;\n }\n // Do nothing else if the close icon is clicked.\n let icon = tabs[index].querySelector(this.renderer.closeIconSelector);\n if (icon && icon.contains(event.target)) {\n return;\n }\n // Add the extra listeners if the tabs are movable.\n if (this.tabsMovable) {\n this.document.addEventListener('pointermove', this, true);\n this.document.addEventListener('keydown', this, true);\n this.document.addEventListener('contextmenu', this, true);\n }\n // Update the current index as appropriate.\n if (this.allowDeselect && this.currentIndex === index) {\n this.currentIndex = -1;\n }\n else {\n this.currentIndex = index;\n }\n // Do nothing else if there is no current tab.\n if (this.currentIndex === -1) {\n return;\n }\n // Emit the tab activate request signal.\n this._tabActivateRequested.emit({\n index: this.currentIndex,\n title: this.currentTitle\n });\n }\n /**\n * Handle the `'pointermove'` event for the tab bar.\n */\n _evtPointerMove(event) {\n // Do nothing if no drag is in progress.\n let data = this._dragData;\n if (!data) {\n return;\n }\n // Suppress the event during a drag.\n event.preventDefault();\n event.stopPropagation();\n // Lookup the tab nodes.\n let tabs = this.contentNode.children;\n // Bail early if the drag threshold has not been met.\n if (!data.dragActive && !Private$7.dragExceeded(data, event)) {\n return;\n }\n // Activate the drag if necessary.\n if (!data.dragActive) {\n // Fill in the rest of the drag data measurements.\n let tabRect = data.tab.getBoundingClientRect();\n if (this._orientation === 'horizontal') {\n data.tabPos = data.tab.offsetLeft;\n data.tabSize = tabRect.width;\n data.tabPressPos = data.pressX - tabRect.left;\n }\n else {\n data.tabPos = data.tab.offsetTop;\n data.tabSize = tabRect.height;\n data.tabPressPos = data.pressY - tabRect.top;\n }\n data.tabPressOffset = {\n x: data.pressX - tabRect.left,\n y: data.pressY - tabRect.top\n };\n data.tabLayout = Private$7.snapTabLayout(tabs, this._orientation);\n data.contentRect = this.contentNode.getBoundingClientRect();\n data.override = Drag.overrideCursor('default');\n // Add the dragging style classes.\n data.tab.classList.add('lm-mod-dragging');\n this.addClass('lm-mod-dragging');\n // Mark the drag as active.\n data.dragActive = true;\n }\n // Emit the detach requested signal if the threshold is exceeded.\n if (!data.detachRequested && Private$7.detachExceeded(data, event)) {\n // Only emit the signal once per drag cycle.\n data.detachRequested = true;\n // Setup the arguments for the signal.\n let index = data.index;\n let clientX = event.clientX;\n let clientY = event.clientY;\n let tab = tabs[index];\n let title = this._titles[index];\n // Emit the tab detach requested signal.\n this._tabDetachRequested.emit({\n index,\n title,\n tab,\n clientX,\n clientY,\n offset: data.tabPressOffset\n });\n // Bail if the signal handler aborted the drag.\n if (data.dragAborted) {\n return;\n }\n }\n // Update the positions of the tabs.\n Private$7.layoutTabs(tabs, data, event, this._orientation);\n }\n /**\n * Handle the `'pointerup'` event for the document.\n */\n _evtPointerUp(event) {\n // Do nothing if it's not a left or middle mouse release.\n if (event.button !== 0 && event.button !== 1) {\n return;\n }\n // Do nothing if no drag is in progress.\n const data = this._dragData;\n if (!data) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Remove the extra mouse event listeners.\n this.document.removeEventListener('pointermove', this, true);\n this.document.removeEventListener('pointerup', this, true);\n this.document.removeEventListener('keydown', this, true);\n this.document.removeEventListener('contextmenu', this, true);\n // Handle a release when the drag is not active.\n if (!data.dragActive) {\n // Clear the drag data.\n this._dragData = null;\n // Handle clicking the add button.\n let addButtonClicked = this.addButtonEnabled &&\n this.addButtonNode.contains(event.target);\n if (addButtonClicked) {\n this._addRequested.emit(undefined);\n return;\n }\n // Lookup the tab nodes.\n let tabs = this.contentNode.children;\n // Find the index of the released tab.\n let index = ArrayExt.findFirstIndex(tabs, tab => {\n return ElementExt.hitTest(tab, event.clientX, event.clientY);\n });\n // Do nothing if the release is not on the original pressed tab.\n if (index !== data.index) {\n return;\n }\n // Ignore the release if the title is not closable.\n let title = this._titles[index];\n if (!title.closable) {\n return;\n }\n // Emit the close requested signal if the middle button is released.\n if (event.button === 1) {\n this._tabCloseRequested.emit({ index, title });\n return;\n }\n // Emit the close requested signal if the close icon was released.\n let icon = tabs[index].querySelector(this.renderer.closeIconSelector);\n if (icon && icon.contains(event.target)) {\n this._tabCloseRequested.emit({ index, title });\n return;\n }\n // Otherwise, there is nothing left to do.\n return;\n }\n // Do nothing if the left button is not released.\n if (event.button !== 0) {\n return;\n }\n // Position the tab at its final resting position.\n Private$7.finalizeTabPosition(data, this._orientation);\n // Remove the dragging class from the tab so it can be transitioned.\n data.tab.classList.remove('lm-mod-dragging');\n // Parse the transition duration for releasing the tab.\n let duration = Private$7.parseTransitionDuration(data.tab);\n // Complete the release on a timer to allow the tab to transition.\n setTimeout(() => {\n // Do nothing if the drag has been aborted.\n if (data.dragAborted) {\n return;\n }\n // Clear the drag data reference.\n this._dragData = null;\n // Reset the positions of the tabs.\n Private$7.resetTabPositions(this.contentNode.children, this._orientation);\n // Clear the cursor grab.\n data.override.dispose();\n // Remove the remaining dragging style.\n this.removeClass('lm-mod-dragging');\n // If the tab was not moved, there is nothing else to do.\n let i = data.index;\n let j = data.targetIndex;\n if (j === -1 || i === j) {\n return;\n }\n // Move the title to the new locations.\n ArrayExt.move(this._titles, i, j);\n // Adjust the current index for the move.\n this._adjustCurrentForMove(i, j);\n // Emit the tab moved signal.\n this._tabMoved.emit({\n fromIndex: i,\n toIndex: j,\n title: this._titles[j]\n });\n // Update the tabs immediately to prevent flicker.\n MessageLoop.sendMessage(this, Widget.Msg.UpdateRequest);\n }, duration);\n }\n /**\n * Release the mouse and restore the non-dragged tab positions.\n */\n _releaseMouse() {\n // Do nothing if no drag is in progress.\n let data = this._dragData;\n if (!data) {\n return;\n }\n // Clear the drag data reference.\n this._dragData = null;\n // Remove the extra document event listeners.\n this.document.removeEventListener('pointermove', this, true);\n this.document.removeEventListener('pointerup', this, true);\n this.document.removeEventListener('keydown', this, true);\n this.document.removeEventListener('contextmenu', this, true);\n // Indicate the drag has been aborted. This allows the mouse\n // event handlers to return early when the drag is canceled.\n data.dragAborted = true;\n // If the drag is not active, there's nothing more to do.\n if (!data.dragActive) {\n return;\n }\n // Reset the tabs to their non-dragged positions.\n Private$7.resetTabPositions(this.contentNode.children, this._orientation);\n // Clear the cursor override.\n data.override.dispose();\n // Clear the dragging style classes.\n data.tab.classList.remove('lm-mod-dragging');\n this.removeClass('lm-mod-dragging');\n }\n /**\n * Adjust the current index for a tab insert operation.\n *\n * This method accounts for the tab bar's insertion behavior when\n * adjusting the current index and emitting the changed signal.\n */\n _adjustCurrentForInsert(i, title) {\n // Lookup commonly used variables.\n let ct = this.currentTitle;\n let ci = this._currentIndex;\n let bh = this.insertBehavior;\n // TODO: do we need to do an update to update the aria-selected attribute?\n // Handle the behavior where the new tab is always selected,\n // or the behavior where the new tab is selected if needed.\n if (bh === 'select-tab' || (bh === 'select-tab-if-needed' && ci === -1)) {\n this._currentIndex = i;\n this._previousTitle = ct;\n this._currentChanged.emit({\n previousIndex: ci,\n previousTitle: ct,\n currentIndex: i,\n currentTitle: title\n });\n return;\n }\n // Otherwise, silently adjust the current index if needed.\n if (ci >= i) {\n this._currentIndex++;\n }\n }\n /**\n * Adjust the current index for a tab move operation.\n *\n * This method will not cause the actual current tab to change.\n * It silently adjusts the index to account for the given move.\n */\n _adjustCurrentForMove(i, j) {\n if (this._currentIndex === i) {\n this._currentIndex = j;\n }\n else if (this._currentIndex < i && this._currentIndex >= j) {\n this._currentIndex++;\n }\n else if (this._currentIndex > i && this._currentIndex <= j) {\n this._currentIndex--;\n }\n }\n /**\n * Adjust the current index for a tab remove operation.\n *\n * This method accounts for the tab bar's remove behavior when\n * adjusting the current index and emitting the changed signal.\n */\n _adjustCurrentForRemove(i, title) {\n // Lookup commonly used variables.\n let ci = this._currentIndex;\n let bh = this.removeBehavior;\n // Silently adjust the index if the current tab is not removed.\n if (ci !== i) {\n if (ci > i) {\n this._currentIndex--;\n }\n return;\n }\n // TODO: do we need to do an update to adjust the aria-selected value?\n // No tab gets selected if the tab bar is empty.\n if (this._titles.length === 0) {\n this._currentIndex = -1;\n this._currentChanged.emit({\n previousIndex: i,\n previousTitle: title,\n currentIndex: -1,\n currentTitle: null\n });\n return;\n }\n // Handle behavior where the next sibling tab is selected.\n if (bh === 'select-tab-after') {\n this._currentIndex = Math.min(i, this._titles.length - 1);\n this._currentChanged.emit({\n previousIndex: i,\n previousTitle: title,\n currentIndex: this._currentIndex,\n currentTitle: this.currentTitle\n });\n return;\n }\n // Handle behavior where the previous sibling tab is selected.\n if (bh === 'select-tab-before') {\n this._currentIndex = Math.max(0, i - 1);\n this._currentChanged.emit({\n previousIndex: i,\n previousTitle: title,\n currentIndex: this._currentIndex,\n currentTitle: this.currentTitle\n });\n return;\n }\n // Handle behavior where the previous history tab is selected.\n if (bh === 'select-previous-tab') {\n if (this._previousTitle) {\n this._currentIndex = this._titles.indexOf(this._previousTitle);\n this._previousTitle = null;\n }\n else {\n this._currentIndex = Math.min(i, this._titles.length - 1);\n }\n this._currentChanged.emit({\n previousIndex: i,\n previousTitle: title,\n currentIndex: this._currentIndex,\n currentTitle: this.currentTitle\n });\n return;\n }\n // Otherwise, no tab gets selected.\n this._currentIndex = -1;\n this._currentChanged.emit({\n previousIndex: i,\n previousTitle: title,\n currentIndex: -1,\n currentTitle: null\n });\n }\n /**\n * Handle the `changed` signal of a title object.\n */\n _onTitleChanged(sender) {\n this.update();\n }\n}\n/**\n * The namespace for the `TabBar` class statics.\n */\n(function (TabBar) {\n /**\n * The default implementation of `IRenderer`.\n *\n * #### Notes\n * Subclasses are free to reimplement rendering methods as needed.\n */\n class Renderer {\n constructor() {\n /**\n * A selector which matches the close icon node in a tab.\n */\n this.closeIconSelector = '.lm-TabBar-tabCloseIcon';\n this._tabID = 0;\n this._tabKeys = new WeakMap();\n this._uuid = ++Renderer._nInstance;\n }\n /**\n * Render the virtual element for a tab.\n *\n * @param data - The data to use for rendering the tab.\n *\n * @returns A virtual element representing the tab.\n */\n renderTab(data) {\n let title = data.title.caption;\n let key = this.createTabKey(data);\n let id = key;\n let style = this.createTabStyle(data);\n let className = this.createTabClass(data);\n let dataset = this.createTabDataset(data);\n let aria = this.createTabARIA(data);\n if (data.title.closable) {\n return h.li({ id, key, className, title, style, dataset, ...aria }, this.renderIcon(data), this.renderLabel(data), this.renderCloseIcon(data));\n }\n else {\n return h.li({ id, key, className, title, style, dataset, ...aria }, this.renderIcon(data), this.renderLabel(data));\n }\n }\n /**\n * Render the icon element for a tab.\n *\n * @param data - The data to use for rendering the tab.\n *\n * @returns A virtual element representing the tab icon.\n */\n renderIcon(data) {\n const { title } = data;\n let className = this.createIconClass(data);\n // If title.icon is undefined, it will be ignored.\n return h.div({ className }, title.icon, title.iconLabel);\n }\n /**\n * Render the label element for a tab.\n *\n * @param data - The data to use for rendering the tab.\n *\n * @returns A virtual element representing the tab label.\n */\n renderLabel(data) {\n return h.div({ className: 'lm-TabBar-tabLabel' }, data.title.label);\n }\n /**\n * Render the close icon element for a tab.\n *\n * @param data - The data to use for rendering the tab.\n *\n * @returns A virtual element representing the tab close icon.\n */\n renderCloseIcon(data) {\n return h.div({ className: 'lm-TabBar-tabCloseIcon' });\n }\n /**\n * Create a unique render key for the tab.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The unique render key for the tab.\n *\n * #### Notes\n * This method caches the key against the tab title the first time\n * the key is generated. This enables efficient rendering of moved\n * tabs and avoids subtle hover style artifacts.\n */\n createTabKey(data) {\n let key = this._tabKeys.get(data.title);\n if (key === undefined) {\n key = `tab-key-${this._uuid}-${this._tabID++}`;\n this._tabKeys.set(data.title, key);\n }\n return key;\n }\n /**\n * Create the inline style object for a tab.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The inline style data for the tab.\n */\n createTabStyle(data) {\n return { zIndex: `${data.zIndex}` };\n }\n /**\n * Create the class name for the tab.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The full class name for the tab.\n */\n createTabClass(data) {\n let name = 'lm-TabBar-tab';\n if (data.title.className) {\n name += ` ${data.title.className}`;\n }\n if (data.title.closable) {\n name += ' lm-mod-closable';\n }\n if (data.current) {\n name += ' lm-mod-current';\n }\n return name;\n }\n /**\n * Create the dataset for a tab.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The dataset for the tab.\n */\n createTabDataset(data) {\n return data.title.dataset;\n }\n /**\n * Create the ARIA attributes for a tab.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The ARIA attributes for the tab.\n */\n createTabARIA(data) {\n var _a;\n return {\n role: 'tab',\n 'aria-selected': data.current.toString(),\n tabindex: `${(_a = data.tabIndex) !== null && _a !== void 0 ? _a : '-1'}`\n };\n }\n /**\n * Create the class name for the tab icon.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The full class name for the tab icon.\n */\n createIconClass(data) {\n let name = 'lm-TabBar-tabIcon';\n let extra = data.title.iconClass;\n return extra ? `${name} ${extra}` : name;\n }\n }\n Renderer._nInstance = 0;\n TabBar.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n TabBar.defaultRenderer = new Renderer();\n /**\n * A selector which matches the add button node in the tab bar.\n */\n TabBar.addButtonSelector = '.lm-TabBar-addButton';\n})(TabBar || (TabBar = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private$7;\n(function (Private) {\n /**\n * The start drag distance threshold.\n */\n Private.DRAG_THRESHOLD = 5;\n /**\n * The detach distance threshold.\n */\n Private.DETACH_THRESHOLD = 20;\n /**\n * Create the DOM node for a tab bar.\n */\n function createNode() {\n let node = document.createElement('div');\n let content = document.createElement('ul');\n content.setAttribute('role', 'tablist');\n content.className = 'lm-TabBar-content';\n node.appendChild(content);\n let add = document.createElement('div');\n add.className = 'lm-TabBar-addButton lm-mod-hidden';\n add.setAttribute('tabindex', '-1');\n add.setAttribute('role', 'button');\n node.appendChild(add);\n return node;\n }\n Private.createNode = createNode;\n /**\n * Coerce a title or options into a real title.\n */\n function asTitle(value) {\n return value instanceof Title ? value : new Title(value);\n }\n Private.asTitle = asTitle;\n /**\n * Parse the transition duration for a tab node.\n */\n function parseTransitionDuration(tab) {\n let style = window.getComputedStyle(tab);\n return 1000 * (parseFloat(style.transitionDuration) || 0);\n }\n Private.parseTransitionDuration = parseTransitionDuration;\n /**\n * Get a snapshot of the current tab layout values.\n */\n function snapTabLayout(tabs, orientation) {\n let layout = new Array(tabs.length);\n for (let i = 0, n = tabs.length; i < n; ++i) {\n let node = tabs[i];\n let style = window.getComputedStyle(node);\n if (orientation === 'horizontal') {\n layout[i] = {\n pos: node.offsetLeft,\n size: node.offsetWidth,\n margin: parseFloat(style.marginLeft) || 0\n };\n }\n else {\n layout[i] = {\n pos: node.offsetTop,\n size: node.offsetHeight,\n margin: parseFloat(style.marginTop) || 0\n };\n }\n }\n return layout;\n }\n Private.snapTabLayout = snapTabLayout;\n /**\n * Test if the event exceeds the drag threshold.\n */\n function dragExceeded(data, event) {\n let dx = Math.abs(event.clientX - data.pressX);\n let dy = Math.abs(event.clientY - data.pressY);\n return dx >= Private.DRAG_THRESHOLD || dy >= Private.DRAG_THRESHOLD;\n }\n Private.dragExceeded = dragExceeded;\n /**\n * Test if the event exceeds the drag detach threshold.\n */\n function detachExceeded(data, event) {\n let rect = data.contentRect;\n return (event.clientX < rect.left - Private.DETACH_THRESHOLD ||\n event.clientX >= rect.right + Private.DETACH_THRESHOLD ||\n event.clientY < rect.top - Private.DETACH_THRESHOLD ||\n event.clientY >= rect.bottom + Private.DETACH_THRESHOLD);\n }\n Private.detachExceeded = detachExceeded;\n /**\n * Update the relative tab positions and computed target index.\n */\n function layoutTabs(tabs, data, event, orientation) {\n // Compute the orientation-sensitive values.\n let pressPos;\n let localPos;\n let clientPos;\n let clientSize;\n if (orientation === 'horizontal') {\n pressPos = data.pressX;\n localPos = event.clientX - data.contentRect.left;\n clientPos = event.clientX;\n clientSize = data.contentRect.width;\n }\n else {\n pressPos = data.pressY;\n localPos = event.clientY - data.contentRect.top;\n clientPos = event.clientY;\n clientSize = data.contentRect.height;\n }\n // Compute the target data.\n let targetIndex = data.index;\n let targetPos = localPos - data.tabPressPos;\n let targetEnd = targetPos + data.tabSize;\n // Update the relative tab positions.\n for (let i = 0, n = tabs.length; i < n; ++i) {\n let pxPos;\n let layout = data.tabLayout[i];\n let threshold = layout.pos + (layout.size >> 1);\n if (i < data.index && targetPos < threshold) {\n pxPos = `${data.tabSize + data.tabLayout[i + 1].margin}px`;\n targetIndex = Math.min(targetIndex, i);\n }\n else if (i > data.index && targetEnd > threshold) {\n pxPos = `${-data.tabSize - layout.margin}px`;\n targetIndex = Math.max(targetIndex, i);\n }\n else if (i === data.index) {\n let ideal = clientPos - pressPos;\n let limit = clientSize - (data.tabPos + data.tabSize);\n pxPos = `${Math.max(-data.tabPos, Math.min(ideal, limit))}px`;\n }\n else {\n pxPos = '';\n }\n if (orientation === 'horizontal') {\n tabs[i].style.left = pxPos;\n }\n else {\n tabs[i].style.top = pxPos;\n }\n }\n // Update the computed target index.\n data.targetIndex = targetIndex;\n }\n Private.layoutTabs = layoutTabs;\n /**\n * Position the drag tab at its final resting relative position.\n */\n function finalizeTabPosition(data, orientation) {\n // Compute the orientation-sensitive client size.\n let clientSize;\n if (orientation === 'horizontal') {\n clientSize = data.contentRect.width;\n }\n else {\n clientSize = data.contentRect.height;\n }\n // Compute the ideal final tab position.\n let ideal;\n if (data.targetIndex === data.index) {\n ideal = 0;\n }\n else if (data.targetIndex > data.index) {\n let tgt = data.tabLayout[data.targetIndex];\n ideal = tgt.pos + tgt.size - data.tabSize - data.tabPos;\n }\n else {\n let tgt = data.tabLayout[data.targetIndex];\n ideal = tgt.pos - data.tabPos;\n }\n // Compute the tab position limit.\n let limit = clientSize - (data.tabPos + data.tabSize);\n let final = Math.max(-data.tabPos, Math.min(ideal, limit));\n // Set the final orientation-sensitive position.\n if (orientation === 'horizontal') {\n data.tab.style.left = `${final}px`;\n }\n else {\n data.tab.style.top = `${final}px`;\n }\n }\n Private.finalizeTabPosition = finalizeTabPosition;\n /**\n * Reset the relative positions of the given tabs.\n */\n function resetTabPositions(tabs, orientation) {\n for (const tab of tabs) {\n if (orientation === 'horizontal') {\n tab.style.left = '';\n }\n else {\n tab.style.top = '';\n }\n }\n }\n Private.resetTabPositions = resetTabPositions;\n})(Private$7 || (Private$7 = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A layout which provides a flexible docking arrangement.\n *\n * #### Notes\n * The consumer of this layout is responsible for handling all signals\n * from the generated tab bars and managing the visibility of widgets\n * and tab bars as needed.\n */\nclass DockLayout extends Layout {\n /**\n * Construct a new dock layout.\n *\n * @param options - The options for initializing the layout.\n */\n constructor(options) {\n super();\n this._spacing = 4;\n this._dirty = false;\n this._root = null;\n this._box = null;\n this._items = new Map();\n this.renderer = options.renderer;\n if (options.spacing !== undefined) {\n this._spacing = Utils$1.clampDimension(options.spacing);\n }\n this._document = options.document || document;\n this._hiddenMode =\n options.hiddenMode !== undefined\n ? options.hiddenMode\n : Widget.HiddenMode.Display;\n }\n /**\n * Dispose of the resources held by the layout.\n *\n * #### Notes\n * This will clear and dispose all widgets in the layout.\n */\n dispose() {\n // Get an iterator over the widgets in the layout.\n let widgets = this[Symbol.iterator]();\n // Dispose of the layout items.\n this._items.forEach(item => {\n item.dispose();\n });\n // Clear the layout state before disposing the widgets.\n this._box = null;\n this._root = null;\n this._items.clear();\n // Dispose of the widgets contained in the old layout root.\n for (const widget of widgets) {\n widget.dispose();\n }\n // Dispose of the base class.\n super.dispose();\n }\n /**\n * The method for hiding child widgets.\n *\n * #### Notes\n * If there is only one child widget, `Display` hiding mode will be used\n * regardless of this setting.\n */\n get hiddenMode() {\n return this._hiddenMode;\n }\n set hiddenMode(v) {\n if (this._hiddenMode === v) {\n return;\n }\n this._hiddenMode = v;\n for (const bar of this.tabBars()) {\n if (bar.titles.length > 1) {\n for (const title of bar.titles) {\n title.owner.hiddenMode = this._hiddenMode;\n }\n }\n }\n }\n /**\n * Get the inter-element spacing for the dock layout.\n */\n get spacing() {\n return this._spacing;\n }\n /**\n * Set the inter-element spacing for the dock layout.\n */\n set spacing(value) {\n value = Utils$1.clampDimension(value);\n if (this._spacing === value) {\n return;\n }\n this._spacing = value;\n if (!this.parent) {\n return;\n }\n this.parent.fit();\n }\n /**\n * Whether the dock layout is empty.\n */\n get isEmpty() {\n return this._root === null;\n }\n /**\n * Create an iterator over all widgets in the layout.\n *\n * @returns A new iterator over the widgets in the layout.\n *\n * #### Notes\n * This iterator includes the generated tab bars.\n */\n [Symbol.iterator]() {\n return this._root ? this._root.iterAllWidgets() : empty();\n }\n /**\n * Create an iterator over the user widgets in the layout.\n *\n * @returns A new iterator over the user widgets in the layout.\n *\n * #### Notes\n * This iterator does not include the generated tab bars.\n */\n widgets() {\n return this._root ? this._root.iterUserWidgets() : empty();\n }\n /**\n * Create an iterator over the selected widgets in the layout.\n *\n * @returns A new iterator over the selected user widgets.\n *\n * #### Notes\n * This iterator yields the widgets corresponding to the current tab\n * of each tab bar in the layout.\n */\n selectedWidgets() {\n return this._root ? this._root.iterSelectedWidgets() : empty();\n }\n /**\n * Create an iterator over the tab bars in the layout.\n *\n * @returns A new iterator over the tab bars in the layout.\n *\n * #### Notes\n * This iterator does not include the user widgets.\n */\n tabBars() {\n return this._root ? this._root.iterTabBars() : empty();\n }\n /**\n * Create an iterator over the handles in the layout.\n *\n * @returns A new iterator over the handles in the layout.\n */\n handles() {\n return this._root ? this._root.iterHandles() : empty();\n }\n /**\n * Move a handle to the given offset position.\n *\n * @param handle - The handle to move.\n *\n * @param offsetX - The desired offset X position of the handle.\n *\n * @param offsetY - The desired offset Y position of the handle.\n *\n * #### Notes\n * If the given handle is not contained in the layout, this is no-op.\n *\n * The handle will be moved as close as possible to the desired\n * position without violating any of the layout constraints.\n *\n * Only one of the coordinates is used depending on the orientation\n * of the handle. This method accepts both coordinates to make it\n * easy to invoke from a mouse move event without needing to know\n * the handle orientation.\n */\n moveHandle(handle, offsetX, offsetY) {\n // Bail early if there is no root or if the handle is hidden.\n let hidden = handle.classList.contains('lm-mod-hidden');\n if (!this._root || hidden) {\n return;\n }\n // Lookup the split node for the handle.\n let data = this._root.findSplitNode(handle);\n if (!data) {\n return;\n }\n // Compute the desired delta movement for the handle.\n let delta;\n if (data.node.orientation === 'horizontal') {\n delta = offsetX - handle.offsetLeft;\n }\n else {\n delta = offsetY - handle.offsetTop;\n }\n // Bail if there is no handle movement.\n if (delta === 0) {\n return;\n }\n // Prevent sibling resizing unless needed.\n data.node.holdSizes();\n // Adjust the sizers to reflect the handle movement.\n BoxEngine.adjust(data.node.sizers, data.index, delta);\n // Update the layout of the widgets.\n if (this.parent) {\n this.parent.update();\n }\n }\n /**\n * Save the current configuration of the dock layout.\n *\n * @returns A new config object for the current layout state.\n *\n * #### Notes\n * The return value can be provided to the `restoreLayout` method\n * in order to restore the layout to its current configuration.\n */\n saveLayout() {\n // Bail early if there is no root.\n if (!this._root) {\n return { main: null };\n }\n // Hold the current sizes in the layout tree.\n this._root.holdAllSizes();\n // Return the layout config.\n return { main: this._root.createConfig() };\n }\n /**\n * Restore the layout to a previously saved configuration.\n *\n * @param config - The layout configuration to restore.\n *\n * #### Notes\n * Widgets which currently belong to the layout but which are not\n * contained in the config will be unparented.\n */\n restoreLayout(config) {\n // Create the widget set for validating the config.\n let widgetSet = new Set();\n // Normalize the main area config and collect the widgets.\n let mainConfig;\n if (config.main) {\n mainConfig = Private$6.normalizeAreaConfig(config.main, widgetSet);\n }\n else {\n mainConfig = null;\n }\n // Create iterators over the old content.\n let oldWidgets = this.widgets();\n let oldTabBars = this.tabBars();\n let oldHandles = this.handles();\n // Clear the root before removing the old content.\n this._root = null;\n // Unparent the old widgets which are not in the new config.\n for (const widget of oldWidgets) {\n if (!widgetSet.has(widget)) {\n widget.parent = null;\n }\n }\n // Dispose of the old tab bars.\n for (const tabBar of oldTabBars) {\n tabBar.dispose();\n }\n // Remove the old handles.\n for (const handle of oldHandles) {\n if (handle.parentNode) {\n handle.parentNode.removeChild(handle);\n }\n }\n // Reparent the new widgets to the current parent.\n for (const widget of widgetSet) {\n widget.parent = this.parent;\n }\n // Create the root node for the new config.\n if (mainConfig) {\n this._root = Private$6.realizeAreaConfig(mainConfig, {\n // Ignoring optional `document` argument as we must reuse `this._document`\n createTabBar: (document) => this._createTabBar(),\n createHandle: () => this._createHandle()\n }, this._document);\n }\n else {\n this._root = null;\n }\n // If there is no parent, there is nothing more to do.\n if (!this.parent) {\n return;\n }\n // Attach the new widgets to the parent.\n widgetSet.forEach(widget => {\n this.attachWidget(widget);\n });\n // Post a fit request to the parent.\n this.parent.fit();\n }\n /**\n * Add a widget to the dock layout.\n *\n * @param widget - The widget to add to the dock layout.\n *\n * @param options - The additional options for adding the widget.\n *\n * #### Notes\n * The widget will be moved if it is already contained in the layout.\n *\n * An error will be thrown if the reference widget is invalid.\n */\n addWidget(widget, options = {}) {\n // Parse the options.\n let ref = options.ref || null;\n let mode = options.mode || 'tab-after';\n // Find the tab node which holds the reference widget.\n let refNode = null;\n if (this._root && ref) {\n refNode = this._root.findTabNode(ref);\n }\n // Throw an error if the reference widget is invalid.\n if (ref && !refNode) {\n throw new Error('Reference widget is not in the layout.');\n }\n // Reparent the widget to the current layout parent.\n widget.parent = this.parent;\n // Insert the widget according to the insert mode.\n switch (mode) {\n case 'tab-after':\n this._insertTab(widget, ref, refNode, true);\n break;\n case 'tab-before':\n this._insertTab(widget, ref, refNode, false);\n break;\n case 'split-top':\n this._insertSplit(widget, ref, refNode, 'vertical', false);\n break;\n case 'split-left':\n this._insertSplit(widget, ref, refNode, 'horizontal', false);\n break;\n case 'split-right':\n this._insertSplit(widget, ref, refNode, 'horizontal', true);\n break;\n case 'split-bottom':\n this._insertSplit(widget, ref, refNode, 'vertical', true);\n break;\n case 'merge-top':\n this._insertSplit(widget, ref, refNode, 'vertical', false, true);\n break;\n case 'merge-left':\n this._insertSplit(widget, ref, refNode, 'horizontal', false, true);\n break;\n case 'merge-right':\n this._insertSplit(widget, ref, refNode, 'horizontal', true, true);\n break;\n case 'merge-bottom':\n this._insertSplit(widget, ref, refNode, 'vertical', true, true);\n break;\n }\n // Do nothing else if there is no parent widget.\n if (!this.parent) {\n return;\n }\n // Ensure the widget is attached to the parent widget.\n this.attachWidget(widget);\n // Post a fit request for the parent widget.\n this.parent.fit();\n }\n /**\n * Remove a widget from the layout.\n *\n * @param widget - The widget to remove from the layout.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n */\n removeWidget(widget) {\n // Remove the widget from its current layout location.\n this._removeWidget(widget);\n // Do nothing else if there is no parent widget.\n if (!this.parent) {\n return;\n }\n // Detach the widget from the parent widget.\n this.detachWidget(widget);\n // Post a fit request for the parent widget.\n this.parent.fit();\n }\n /**\n * Find the tab area which contains the given client position.\n *\n * @param clientX - The client X position of interest.\n *\n * @param clientY - The client Y position of interest.\n *\n * @returns The geometry of the tab area at the given position, or\n * `null` if there is no tab area at the given position.\n */\n hitTestTabAreas(clientX, clientY) {\n // Bail early if hit testing cannot produce valid results.\n if (!this._root || !this.parent || !this.parent.isVisible) {\n return null;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = ElementExt.boxSizing(this.parent.node);\n }\n // Convert from client to local coordinates.\n let rect = this.parent.node.getBoundingClientRect();\n let x = clientX - rect.left - this._box.borderLeft;\n let y = clientY - rect.top - this._box.borderTop;\n // Find the tab layout node at the local position.\n let tabNode = this._root.hitTestTabNodes(x, y);\n // Bail if a tab layout node was not found.\n if (!tabNode) {\n return null;\n }\n // Extract the data from the tab node.\n let { tabBar, top, left, width, height } = tabNode;\n // Compute the right and bottom edges of the tab area.\n let borderWidth = this._box.borderLeft + this._box.borderRight;\n let borderHeight = this._box.borderTop + this._box.borderBottom;\n let right = rect.width - borderWidth - (left + width);\n let bottom = rect.height - borderHeight - (top + height);\n // Return the hit test results.\n return { tabBar, x, y, top, left, right, bottom, width, height };\n }\n /**\n * Perform layout initialization which requires the parent widget.\n */\n init() {\n // Perform superclass initialization.\n super.init();\n // Attach each widget to the parent.\n for (const widget of this) {\n this.attachWidget(widget);\n }\n // Attach each handle to the parent.\n for (const handle of this.handles()) {\n this.parent.node.appendChild(handle);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n }\n /**\n * Attach the widget to the layout parent widget.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This is a no-op if the widget is already attached.\n */\n attachWidget(widget) {\n // Do nothing if the widget is already attached.\n if (this.parent.node === widget.node.parentNode) {\n return;\n }\n // Create the layout item for the widget.\n this._items.set(widget, new LayoutItem(widget));\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);\n }\n }\n /**\n * Detach the widget from the layout parent widget.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This is a no-op if the widget is not attached.\n */\n detachWidget(widget) {\n // Do nothing if the widget is not attached.\n if (this.parent.node !== widget.node.parentNode) {\n return;\n }\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);\n }\n // Delete the layout item for the widget.\n let item = this._items.get(widget);\n if (item) {\n this._items.delete(widget);\n item.dispose();\n }\n }\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n onBeforeShow(msg) {\n super.onBeforeShow(msg);\n this.parent.update();\n }\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n onBeforeAttach(msg) {\n super.onBeforeAttach(msg);\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n onChildShown(msg) {\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n onChildHidden(msg) {\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'resize'` message.\n */\n onResize(msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n }\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n onUpdateRequest(msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n }\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n onFitRequest(msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n }\n /**\n * Remove the specified widget from the layout structure.\n *\n * #### Notes\n * This is a no-op if the widget is not in the layout tree.\n *\n * This does not detach the widget from the parent node.\n */\n _removeWidget(widget) {\n // Bail early if there is no layout root.\n if (!this._root) {\n return;\n }\n // Find the tab node which contains the given widget.\n let tabNode = this._root.findTabNode(widget);\n // Bail early if the tab node is not found.\n if (!tabNode) {\n return;\n }\n Private$6.removeAria(widget);\n // If there are multiple tabs, just remove the widget's tab.\n if (tabNode.tabBar.titles.length > 1) {\n tabNode.tabBar.removeTab(widget.title);\n if (this._hiddenMode === Widget.HiddenMode.Scale &&\n tabNode.tabBar.titles.length == 1) {\n const existingWidget = tabNode.tabBar.titles[0].owner;\n existingWidget.hiddenMode = Widget.HiddenMode.Display;\n }\n return;\n }\n // Otherwise, the tab node needs to be removed...\n // Dispose the tab bar.\n tabNode.tabBar.dispose();\n // Handle the case where the tab node is the root.\n if (this._root === tabNode) {\n this._root = null;\n return;\n }\n // Otherwise, remove the tab node from its parent...\n // Prevent widget resizing unless needed.\n this._root.holdAllSizes();\n // Clear the parent reference on the tab node.\n let splitNode = tabNode.parent;\n tabNode.parent = null;\n // Remove the tab node from its parent split node.\n let i = ArrayExt.removeFirstOf(splitNode.children, tabNode);\n let handle = ArrayExt.removeAt(splitNode.handles, i);\n ArrayExt.removeAt(splitNode.sizers, i);\n // Remove the handle from its parent DOM node.\n if (handle.parentNode) {\n handle.parentNode.removeChild(handle);\n }\n // If there are multiple children, just update the handles.\n if (splitNode.children.length > 1) {\n splitNode.syncHandles();\n return;\n }\n // Otherwise, the split node also needs to be removed...\n // Clear the parent reference on the split node.\n let maybeParent = splitNode.parent;\n splitNode.parent = null;\n // Lookup the remaining child node and handle.\n let childNode = splitNode.children[0];\n let childHandle = splitNode.handles[0];\n // Clear the split node data.\n splitNode.children.length = 0;\n splitNode.handles.length = 0;\n splitNode.sizers.length = 0;\n // Remove the child handle from its parent node.\n if (childHandle.parentNode) {\n childHandle.parentNode.removeChild(childHandle);\n }\n // Handle the case where the split node is the root.\n if (this._root === splitNode) {\n childNode.parent = null;\n this._root = childNode;\n return;\n }\n // Otherwise, move the child node to the parent node...\n let parentNode = maybeParent;\n // Lookup the index of the split node.\n let j = parentNode.children.indexOf(splitNode);\n // Handle the case where the child node is a tab node.\n if (childNode instanceof Private$6.TabLayoutNode) {\n childNode.parent = parentNode;\n parentNode.children[j] = childNode;\n return;\n }\n // Remove the split data from the parent.\n let splitHandle = ArrayExt.removeAt(parentNode.handles, j);\n ArrayExt.removeAt(parentNode.children, j);\n ArrayExt.removeAt(parentNode.sizers, j);\n // Remove the handle from its parent node.\n if (splitHandle.parentNode) {\n splitHandle.parentNode.removeChild(splitHandle);\n }\n // The child node and the split parent node will have the same\n // orientation. Merge the grand-children with the parent node.\n for (let i = 0, n = childNode.children.length; i < n; ++i) {\n let gChild = childNode.children[i];\n let gHandle = childNode.handles[i];\n let gSizer = childNode.sizers[i];\n ArrayExt.insert(parentNode.children, j + i, gChild);\n ArrayExt.insert(parentNode.handles, j + i, gHandle);\n ArrayExt.insert(parentNode.sizers, j + i, gSizer);\n gChild.parent = parentNode;\n }\n // Clear the child node.\n childNode.children.length = 0;\n childNode.handles.length = 0;\n childNode.sizers.length = 0;\n childNode.parent = null;\n // Sync the handles on the parent node.\n parentNode.syncHandles();\n }\n /**\n * Create the tab layout node to hold the widget.\n */\n _createTabNode(widget) {\n let tabNode = new Private$6.TabLayoutNode(this._createTabBar());\n tabNode.tabBar.addTab(widget.title);\n Private$6.addAria(widget, tabNode.tabBar);\n return tabNode;\n }\n /**\n * Insert a widget next to an existing tab.\n *\n * #### Notes\n * This does not attach the widget to the parent widget.\n */\n _insertTab(widget, ref, refNode, after) {\n // Do nothing if the tab is inserted next to itself.\n if (widget === ref) {\n return;\n }\n // Create the root if it does not exist.\n if (!this._root) {\n let tabNode = new Private$6.TabLayoutNode(this._createTabBar());\n tabNode.tabBar.addTab(widget.title);\n this._root = tabNode;\n Private$6.addAria(widget, tabNode.tabBar);\n return;\n }\n // Use the first tab node as the ref node if needed.\n if (!refNode) {\n refNode = this._root.findFirstTabNode();\n }\n // If the widget is not contained in the ref node, ensure it is\n // removed from the layout and hidden before being added again.\n if (refNode.tabBar.titles.indexOf(widget.title) === -1) {\n this._removeWidget(widget);\n widget.hide();\n }\n // Lookup the target index for inserting the tab.\n let index;\n if (ref) {\n index = refNode.tabBar.titles.indexOf(ref.title);\n }\n else {\n index = refNode.tabBar.currentIndex;\n }\n // Using transform create an additional layer in the pixel pipeline\n // to limit the number of layer, it is set only if there is more than one widget.\n if (this._hiddenMode === Widget.HiddenMode.Scale) {\n if (refNode.tabBar.titles.length === 0) {\n // Singular tab should use display mode to limit number of layers.\n widget.hiddenMode = Widget.HiddenMode.Display;\n }\n else if (refNode.tabBar.titles.length == 1) {\n // If we are adding a second tab, switch the existing tab back to scale.\n const existingWidget = refNode.tabBar.titles[0].owner;\n existingWidget.hiddenMode = Widget.HiddenMode.Scale;\n }\n else {\n // For the third and subsequent tabs no special action is needed.\n widget.hiddenMode = Widget.HiddenMode.Scale;\n }\n }\n else {\n // For all other modes just propagate the current mode.\n widget.hiddenMode = this._hiddenMode;\n }\n // Insert the widget's tab relative to the target index.\n refNode.tabBar.insertTab(index + (after ? 1 : 0), widget.title);\n Private$6.addAria(widget, refNode.tabBar);\n }\n /**\n * Insert a widget as a new split area.\n *\n * #### Notes\n * This does not attach the widget to the parent widget.\n */\n _insertSplit(widget, ref, refNode, orientation, after, merge = false) {\n // Do nothing if there is no effective split.\n if (widget === ref && refNode && refNode.tabBar.titles.length === 1) {\n return;\n }\n // Ensure the widget is removed from the current layout.\n this._removeWidget(widget);\n // Set the root if it does not exist.\n if (!this._root) {\n this._root = this._createTabNode(widget);\n return;\n }\n // If the ref node parent is null, split the root.\n if (!refNode || !refNode.parent) {\n // Ensure the root is split with the correct orientation.\n let root = this._splitRoot(orientation);\n // Determine the insert index for the new tab node.\n let i = after ? root.children.length : 0;\n // Normalize the split node.\n root.normalizeSizes();\n // Create the sizer for new tab node.\n let sizer = Private$6.createSizer(refNode ? 1 : Private$6.GOLDEN_RATIO);\n // Insert the tab node sized to the golden ratio.\n let tabNode = this._createTabNode(widget);\n ArrayExt.insert(root.children, i, tabNode);\n ArrayExt.insert(root.sizers, i, sizer);\n ArrayExt.insert(root.handles, i, this._createHandle());\n tabNode.parent = root;\n // Re-normalize the split node to maintain the ratios.\n root.normalizeSizes();\n // Finally, synchronize the visibility of the handles.\n root.syncHandles();\n return;\n }\n // Lookup the split node for the ref widget.\n let splitNode = refNode.parent;\n // If the split node already had the correct orientation,\n // the widget can be inserted into the split node directly.\n if (splitNode.orientation === orientation) {\n // Find the index of the ref node.\n let i = splitNode.children.indexOf(refNode);\n // Conditionally reuse a tab layout found in the wanted position.\n if (merge) {\n let j = i + (after ? 1 : -1);\n let sibling = splitNode.children[j];\n if (sibling instanceof Private$6.TabLayoutNode) {\n this._insertTab(widget, null, sibling, true);\n ++sibling.tabBar.currentIndex;\n return;\n }\n }\n // Normalize the split node.\n splitNode.normalizeSizes();\n // Consume half the space for the insert location.\n let s = (splitNode.sizers[i].sizeHint /= 2);\n // Insert the tab node sized to the other half.\n let j = i + (after ? 1 : 0);\n let tabNode = this._createTabNode(widget);\n ArrayExt.insert(splitNode.children, j, tabNode);\n ArrayExt.insert(splitNode.sizers, j, Private$6.createSizer(s));\n ArrayExt.insert(splitNode.handles, j, this._createHandle());\n tabNode.parent = splitNode;\n // Finally, synchronize the visibility of the handles.\n splitNode.syncHandles();\n return;\n }\n // Remove the ref node from the split node.\n let i = ArrayExt.removeFirstOf(splitNode.children, refNode);\n // Create a new normalized split node for the children.\n let childNode = new Private$6.SplitLayoutNode(orientation);\n childNode.normalized = true;\n // Add the ref node sized to half the space.\n childNode.children.push(refNode);\n childNode.sizers.push(Private$6.createSizer(0.5));\n childNode.handles.push(this._createHandle());\n refNode.parent = childNode;\n // Add the tab node sized to the other half.\n let j = after ? 1 : 0;\n let tabNode = this._createTabNode(widget);\n ArrayExt.insert(childNode.children, j, tabNode);\n ArrayExt.insert(childNode.sizers, j, Private$6.createSizer(0.5));\n ArrayExt.insert(childNode.handles, j, this._createHandle());\n tabNode.parent = childNode;\n // Synchronize the visibility of the handles.\n childNode.syncHandles();\n // Finally, add the new child node to the original split node.\n ArrayExt.insert(splitNode.children, i, childNode);\n childNode.parent = splitNode;\n }\n /**\n * Ensure the root is a split node with the given orientation.\n */\n _splitRoot(orientation) {\n // Bail early if the root already meets the requirements.\n let oldRoot = this._root;\n if (oldRoot instanceof Private$6.SplitLayoutNode) {\n if (oldRoot.orientation === orientation) {\n return oldRoot;\n }\n }\n // Create a new root node with the specified orientation.\n let newRoot = (this._root = new Private$6.SplitLayoutNode(orientation));\n // Add the old root to the new root.\n if (oldRoot) {\n newRoot.children.push(oldRoot);\n newRoot.sizers.push(Private$6.createSizer(0));\n newRoot.handles.push(this._createHandle());\n oldRoot.parent = newRoot;\n }\n // Return the new root as a convenience.\n return newRoot;\n }\n /**\n * Fit the layout to the total size required by the widgets.\n */\n _fit() {\n // Set up the computed minimum size.\n let minW = 0;\n let minH = 0;\n // Update the size limits for the layout tree.\n if (this._root) {\n let limits = this._root.fit(this._spacing, this._items);\n minW = limits.minWidth;\n minH = limits.minHeight;\n }\n // Update the box sizing and add it to the computed min size.\n let box = (this._box = ElementExt.boxSizing(this.parent.node));\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n let style = this.parent.node.style;\n style.minWidth = `${minW}px`;\n style.minHeight = `${minH}px`;\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n MessageLoop.sendMessage(this.parent.parent, Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n MessageLoop.sendMessage(this.parent, Widget.Msg.UpdateRequest);\n }\n }\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n _update(offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Bail early if there is no root layout node.\n if (!this._root) {\n return;\n }\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = ElementExt.boxSizing(this.parent.node);\n }\n // Compute the actual layout bounds adjusted for border and padding.\n let x = this._box.paddingTop;\n let y = this._box.paddingLeft;\n let width = offsetWidth - this._box.horizontalSum;\n let height = offsetHeight - this._box.verticalSum;\n // Update the geometry of the layout tree.\n this._root.update(x, y, width, height, this._spacing, this._items);\n }\n /**\n * Create a new tab bar for use by the dock layout.\n *\n * #### Notes\n * The tab bar will be attached to the parent if it exists.\n */\n _createTabBar() {\n // Create the tab bar using the renderer.\n let tabBar = this.renderer.createTabBar(this._document);\n // Enforce necessary tab bar behavior.\n tabBar.orientation = 'horizontal';\n // Attach the tab bar to the parent if possible.\n if (this.parent) {\n this.attachWidget(tabBar);\n }\n // Return the initialized tab bar.\n return tabBar;\n }\n /**\n * Create a new handle for the dock layout.\n *\n * #### Notes\n * The handle will be attached to the parent if it exists.\n */\n _createHandle() {\n // Create the handle using the renderer.\n let handle = this.renderer.createHandle();\n // Initialize the handle layout behavior.\n let style = handle.style;\n style.position = 'absolute';\n style.contain = 'strict';\n style.top = '0';\n style.left = '0';\n style.width = '0';\n style.height = '0';\n // Attach the handle to the parent if it exists.\n if (this.parent) {\n this.parent.node.appendChild(handle);\n }\n // Return the initialized handle.\n return handle;\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private$6;\n(function (Private) {\n /**\n * A fraction used for sizing root panels; ~= `1 / golden_ratio`.\n */\n Private.GOLDEN_RATIO = 0.618;\n /**\n * Create a box sizer with an initial size hint.\n */\n function createSizer(hint) {\n let sizer = new BoxSizer();\n sizer.sizeHint = hint;\n sizer.size = hint;\n return sizer;\n }\n Private.createSizer = createSizer;\n /**\n * Normalize an area config object and collect the visited widgets.\n */\n function normalizeAreaConfig(config, widgetSet) {\n let result;\n if (config.type === 'tab-area') {\n result = normalizeTabAreaConfig(config, widgetSet);\n }\n else {\n result = normalizeSplitAreaConfig(config, widgetSet);\n }\n return result;\n }\n Private.normalizeAreaConfig = normalizeAreaConfig;\n /**\n * Convert a normalized area config into a layout tree.\n */\n function realizeAreaConfig(config, renderer, document) {\n let node;\n if (config.type === 'tab-area') {\n node = realizeTabAreaConfig(config, renderer, document);\n }\n else {\n node = realizeSplitAreaConfig(config, renderer, document);\n }\n return node;\n }\n Private.realizeAreaConfig = realizeAreaConfig;\n /**\n * A layout node which holds the data for a tabbed area.\n */\n class TabLayoutNode {\n /**\n * Construct a new tab layout node.\n *\n * @param tabBar - The tab bar to use for the layout node.\n */\n constructor(tabBar) {\n /**\n * The parent of the layout node.\n */\n this.parent = null;\n this._top = 0;\n this._left = 0;\n this._width = 0;\n this._height = 0;\n let tabSizer = new BoxSizer();\n let widgetSizer = new BoxSizer();\n tabSizer.stretch = 0;\n widgetSizer.stretch = 1;\n this.tabBar = tabBar;\n this.sizers = [tabSizer, widgetSizer];\n }\n /**\n * The most recent value for the `top` edge of the layout box.\n */\n get top() {\n return this._top;\n }\n /**\n * The most recent value for the `left` edge of the layout box.\n */\n get left() {\n return this._left;\n }\n /**\n * The most recent value for the `width` of the layout box.\n */\n get width() {\n return this._width;\n }\n /**\n * The most recent value for the `height` of the layout box.\n */\n get height() {\n return this._height;\n }\n /**\n * Create an iterator for all widgets in the layout tree.\n */\n *iterAllWidgets() {\n yield this.tabBar;\n yield* this.iterUserWidgets();\n }\n /**\n * Create an iterator for the user widgets in the layout tree.\n */\n *iterUserWidgets() {\n for (const title of this.tabBar.titles) {\n yield title.owner;\n }\n }\n /**\n * Create an iterator for the selected widgets in the layout tree.\n */\n *iterSelectedWidgets() {\n let title = this.tabBar.currentTitle;\n if (title) {\n yield title.owner;\n }\n }\n /**\n * Create an iterator for the tab bars in the layout tree.\n */\n *iterTabBars() {\n yield this.tabBar;\n }\n /**\n * Create an iterator for the handles in the layout tree.\n */\n // eslint-disable-next-line require-yield\n *iterHandles() {\n return;\n }\n /**\n * Find the tab layout node which contains the given widget.\n */\n findTabNode(widget) {\n return this.tabBar.titles.indexOf(widget.title) !== -1 ? this : null;\n }\n /**\n * Find the split layout node which contains the given handle.\n */\n findSplitNode(handle) {\n return null;\n }\n /**\n * Find the first tab layout node in a layout tree.\n */\n findFirstTabNode() {\n return this;\n }\n /**\n * Find the tab layout node which contains the local point.\n */\n hitTestTabNodes(x, y) {\n if (x < this._left || x >= this._left + this._width) {\n return null;\n }\n if (y < this._top || y >= this._top + this._height) {\n return null;\n }\n return this;\n }\n /**\n * Create a configuration object for the layout tree.\n */\n createConfig() {\n let widgets = this.tabBar.titles.map(title => title.owner);\n let currentIndex = this.tabBar.currentIndex;\n return { type: 'tab-area', widgets, currentIndex };\n }\n /**\n * Recursively hold all of the sizes in the layout tree.\n *\n * This ignores the sizers of tab layout nodes.\n */\n holdAllSizes() {\n return;\n }\n /**\n * Fit the layout tree.\n */\n fit(spacing, items) {\n // Set up the limit variables.\n let minWidth = 0;\n let minHeight = 0;\n let maxWidth = Infinity;\n let maxHeight = Infinity;\n // Lookup the tab bar layout item.\n let tabBarItem = items.get(this.tabBar);\n // Lookup the widget layout item.\n let current = this.tabBar.currentTitle;\n let widgetItem = current ? items.get(current.owner) : undefined;\n // Lookup the tab bar and widget sizers.\n let [tabBarSizer, widgetSizer] = this.sizers;\n // Update the tab bar limits.\n if (tabBarItem) {\n tabBarItem.fit();\n }\n // Update the widget limits.\n if (widgetItem) {\n widgetItem.fit();\n }\n // Update the results and sizer for the tab bar.\n if (tabBarItem && !tabBarItem.isHidden) {\n minWidth = Math.max(minWidth, tabBarItem.minWidth);\n minHeight += tabBarItem.minHeight;\n tabBarSizer.minSize = tabBarItem.minHeight;\n tabBarSizer.maxSize = tabBarItem.maxHeight;\n }\n else {\n tabBarSizer.minSize = 0;\n tabBarSizer.maxSize = 0;\n }\n // Update the results and sizer for the current widget.\n if (widgetItem && !widgetItem.isHidden) {\n minWidth = Math.max(minWidth, widgetItem.minWidth);\n minHeight += widgetItem.minHeight;\n widgetSizer.minSize = widgetItem.minHeight;\n widgetSizer.maxSize = Infinity;\n }\n else {\n widgetSizer.minSize = 0;\n widgetSizer.maxSize = Infinity;\n }\n // Return the computed size limits for the layout node.\n return { minWidth, minHeight, maxWidth, maxHeight };\n }\n /**\n * Update the layout tree.\n */\n update(left, top, width, height, spacing, items) {\n // Update the layout box values.\n this._top = top;\n this._left = left;\n this._width = width;\n this._height = height;\n // Lookup the tab bar layout item.\n let tabBarItem = items.get(this.tabBar);\n // Lookup the widget layout item.\n let current = this.tabBar.currentTitle;\n let widgetItem = current ? items.get(current.owner) : undefined;\n // Distribute the layout space to the sizers.\n BoxEngine.calc(this.sizers, height);\n // Update the tab bar item using the computed size.\n if (tabBarItem && !tabBarItem.isHidden) {\n let size = this.sizers[0].size;\n tabBarItem.update(left, top, width, size);\n top += size;\n }\n // Layout the widget using the computed size.\n if (widgetItem && !widgetItem.isHidden) {\n let size = this.sizers[1].size;\n widgetItem.update(left, top, width, size);\n }\n }\n }\n Private.TabLayoutNode = TabLayoutNode;\n /**\n * A layout node which holds the data for a split area.\n */\n class SplitLayoutNode {\n /**\n * Construct a new split layout node.\n *\n * @param orientation - The orientation of the node.\n */\n constructor(orientation) {\n /**\n * The parent of the layout node.\n */\n this.parent = null;\n /**\n * Whether the sizers have been normalized.\n */\n this.normalized = false;\n /**\n * The child nodes for the split node.\n */\n this.children = [];\n /**\n * The box sizers for the layout children.\n */\n this.sizers = [];\n /**\n * The handles for the layout children.\n */\n this.handles = [];\n this.orientation = orientation;\n }\n /**\n * Create an iterator for all widgets in the layout tree.\n */\n *iterAllWidgets() {\n for (const child of this.children) {\n yield* child.iterAllWidgets();\n }\n }\n /**\n * Create an iterator for the user widgets in the layout tree.\n */\n *iterUserWidgets() {\n for (const child of this.children) {\n yield* child.iterUserWidgets();\n }\n }\n /**\n * Create an iterator for the selected widgets in the layout tree.\n */\n *iterSelectedWidgets() {\n for (const child of this.children) {\n yield* child.iterSelectedWidgets();\n }\n }\n /**\n * Create an iterator for the tab bars in the layout tree.\n */\n *iterTabBars() {\n for (const child of this.children) {\n yield* child.iterTabBars();\n }\n }\n /**\n * Create an iterator for the handles in the layout tree.\n */\n *iterHandles() {\n yield* this.handles;\n for (const child of this.children) {\n yield* child.iterHandles();\n }\n }\n /**\n * Find the tab layout node which contains the given widget.\n */\n findTabNode(widget) {\n for (let i = 0, n = this.children.length; i < n; ++i) {\n let result = this.children[i].findTabNode(widget);\n if (result) {\n return result;\n }\n }\n return null;\n }\n /**\n * Find the split layout node which contains the given handle.\n */\n findSplitNode(handle) {\n let index = this.handles.indexOf(handle);\n if (index !== -1) {\n return { index, node: this };\n }\n for (let i = 0, n = this.children.length; i < n; ++i) {\n let result = this.children[i].findSplitNode(handle);\n if (result) {\n return result;\n }\n }\n return null;\n }\n /**\n * Find the first tab layout node in a layout tree.\n */\n findFirstTabNode() {\n if (this.children.length === 0) {\n return null;\n }\n return this.children[0].findFirstTabNode();\n }\n /**\n * Find the tab layout node which contains the local point.\n */\n hitTestTabNodes(x, y) {\n for (let i = 0, n = this.children.length; i < n; ++i) {\n let result = this.children[i].hitTestTabNodes(x, y);\n if (result) {\n return result;\n }\n }\n return null;\n }\n /**\n * Create a configuration object for the layout tree.\n */\n createConfig() {\n let orientation = this.orientation;\n let sizes = this.createNormalizedSizes();\n let children = this.children.map(child => child.createConfig());\n return { type: 'split-area', orientation, children, sizes };\n }\n /**\n * Sync the visibility and orientation of the handles.\n */\n syncHandles() {\n this.handles.forEach((handle, i) => {\n handle.setAttribute('data-orientation', this.orientation);\n if (i === this.handles.length - 1) {\n handle.classList.add('lm-mod-hidden');\n }\n else {\n handle.classList.remove('lm-mod-hidden');\n }\n });\n }\n /**\n * Hold the current sizes of the box sizers.\n *\n * This sets the size hint of each sizer to its current size.\n */\n holdSizes() {\n for (const sizer of this.sizers) {\n sizer.sizeHint = sizer.size;\n }\n }\n /**\n * Recursively hold all of the sizes in the layout tree.\n *\n * This ignores the sizers of tab layout nodes.\n */\n holdAllSizes() {\n for (const child of this.children) {\n child.holdAllSizes();\n }\n this.holdSizes();\n }\n /**\n * Normalize the sizes of the split layout node.\n */\n normalizeSizes() {\n // Bail early if the sizers are empty.\n let n = this.sizers.length;\n if (n === 0) {\n return;\n }\n // Hold the current sizes of the sizers.\n this.holdSizes();\n // Compute the sum of the sizes.\n let sum = this.sizers.reduce((v, sizer) => v + sizer.sizeHint, 0);\n // Normalize the sizes based on the sum.\n if (sum === 0) {\n for (const sizer of this.sizers) {\n sizer.size = sizer.sizeHint = 1 / n;\n }\n }\n else {\n for (const sizer of this.sizers) {\n sizer.size = sizer.sizeHint /= sum;\n }\n }\n // Mark the sizes as normalized.\n this.normalized = true;\n }\n /**\n * Snap the normalized sizes of the split layout node.\n */\n createNormalizedSizes() {\n // Bail early if the sizers are empty.\n let n = this.sizers.length;\n if (n === 0) {\n return [];\n }\n // Grab the current sizes of the sizers.\n let sizes = this.sizers.map(sizer => sizer.size);\n // Compute the sum of the sizes.\n let sum = sizes.reduce((v, size) => v + size, 0);\n // Normalize the sizes based on the sum.\n if (sum === 0) {\n for (let i = sizes.length - 1; i > -1; i--) {\n sizes[i] = 1 / n;\n }\n }\n else {\n for (let i = sizes.length - 1; i > -1; i--) {\n sizes[i] /= sum;\n }\n }\n // Return the normalized sizes.\n return sizes;\n }\n /**\n * Fit the layout tree.\n */\n fit(spacing, items) {\n // Compute the required fixed space.\n let horizontal = this.orientation === 'horizontal';\n let fixed = Math.max(0, this.children.length - 1) * spacing;\n // Set up the limit variables.\n let minWidth = horizontal ? fixed : 0;\n let minHeight = horizontal ? 0 : fixed;\n let maxWidth = Infinity;\n let maxHeight = Infinity;\n // Fit the children and update the limits.\n for (let i = 0, n = this.children.length; i < n; ++i) {\n let limits = this.children[i].fit(spacing, items);\n if (horizontal) {\n minHeight = Math.max(minHeight, limits.minHeight);\n minWidth += limits.minWidth;\n this.sizers[i].minSize = limits.minWidth;\n }\n else {\n minWidth = Math.max(minWidth, limits.minWidth);\n minHeight += limits.minHeight;\n this.sizers[i].minSize = limits.minHeight;\n }\n }\n // Return the computed limits for the layout node.\n return { minWidth, minHeight, maxWidth, maxHeight };\n }\n /**\n * Update the layout tree.\n */\n update(left, top, width, height, spacing, items) {\n // Compute the available layout space.\n let horizontal = this.orientation === 'horizontal';\n let fixed = Math.max(0, this.children.length - 1) * spacing;\n let space = Math.max(0, (horizontal ? width : height) - fixed);\n // De-normalize the sizes if needed.\n if (this.normalized) {\n for (const sizer of this.sizers) {\n sizer.sizeHint *= space;\n }\n this.normalized = false;\n }\n // Distribute the layout space to the sizers.\n BoxEngine.calc(this.sizers, space);\n // Update the geometry of the child nodes and handles.\n for (let i = 0, n = this.children.length; i < n; ++i) {\n let child = this.children[i];\n let size = this.sizers[i].size;\n let handleStyle = this.handles[i].style;\n if (horizontal) {\n child.update(left, top, size, height, spacing, items);\n left += size;\n handleStyle.top = `${top}px`;\n handleStyle.left = `${left}px`;\n handleStyle.width = `${spacing}px`;\n handleStyle.height = `${height}px`;\n left += spacing;\n }\n else {\n child.update(left, top, width, size, spacing, items);\n top += size;\n handleStyle.top = `${top}px`;\n handleStyle.left = `${left}px`;\n handleStyle.width = `${width}px`;\n handleStyle.height = `${spacing}px`;\n top += spacing;\n }\n }\n }\n }\n Private.SplitLayoutNode = SplitLayoutNode;\n function addAria(widget, tabBar) {\n widget.node.setAttribute('role', 'tabpanel');\n let renderer = tabBar.renderer;\n if (renderer instanceof TabBar.Renderer) {\n let tabId = renderer.createTabKey({\n title: widget.title,\n current: false,\n zIndex: 0\n });\n widget.node.setAttribute('aria-labelledby', tabId);\n }\n }\n Private.addAria = addAria;\n function removeAria(widget) {\n widget.node.removeAttribute('role');\n widget.node.removeAttribute('aria-labelledby');\n }\n Private.removeAria = removeAria;\n /**\n * Normalize a tab area config and collect the visited widgets.\n */\n function normalizeTabAreaConfig(config, widgetSet) {\n // Bail early if there is no content.\n if (config.widgets.length === 0) {\n return null;\n }\n // Setup the filtered widgets array.\n let widgets = [];\n // Filter the config for unique widgets.\n for (const widget of config.widgets) {\n if (!widgetSet.has(widget)) {\n widgetSet.add(widget);\n widgets.push(widget);\n }\n }\n // Bail if there are no effective widgets.\n if (widgets.length === 0) {\n return null;\n }\n // Normalize the current index.\n let index = config.currentIndex;\n if (index !== -1 && (index < 0 || index >= widgets.length)) {\n index = 0;\n }\n // Return a normalized config object.\n return { type: 'tab-area', widgets, currentIndex: index };\n }\n /**\n * Normalize a split area config and collect the visited widgets.\n */\n function normalizeSplitAreaConfig(config, widgetSet) {\n // Set up the result variables.\n let orientation = config.orientation;\n let children = [];\n let sizes = [];\n // Normalize the config children.\n for (let i = 0, n = config.children.length; i < n; ++i) {\n // Normalize the child config.\n let child = normalizeAreaConfig(config.children[i], widgetSet);\n // Ignore an empty child.\n if (!child) {\n continue;\n }\n // Add the child or hoist its content as appropriate.\n if (child.type === 'tab-area' || child.orientation !== orientation) {\n children.push(child);\n sizes.push(Math.abs(config.sizes[i] || 0));\n }\n else {\n children.push(...child.children);\n sizes.push(...child.sizes);\n }\n }\n // Bail if there are no effective children.\n if (children.length === 0) {\n return null;\n }\n // If there is only one effective child, return that child.\n if (children.length === 1) {\n return children[0];\n }\n // Return a normalized config object.\n return { type: 'split-area', orientation, children, sizes };\n }\n /**\n * Convert a normalized tab area config into a layout tree.\n */\n function realizeTabAreaConfig(config, renderer, document) {\n // Create the tab bar for the layout node.\n let tabBar = renderer.createTabBar(document);\n // Hide each widget and add it to the tab bar.\n for (const widget of config.widgets) {\n widget.hide();\n tabBar.addTab(widget.title);\n Private.addAria(widget, tabBar);\n }\n // Set the current index of the tab bar.\n tabBar.currentIndex = config.currentIndex;\n // Return the new tab layout node.\n return new TabLayoutNode(tabBar);\n }\n /**\n * Convert a normalized split area config into a layout tree.\n */\n function realizeSplitAreaConfig(config, renderer, document) {\n // Create the split layout node.\n let node = new SplitLayoutNode(config.orientation);\n // Add each child to the layout node.\n config.children.forEach((child, i) => {\n // Create the child data for the layout node.\n let childNode = realizeAreaConfig(child, renderer, document);\n let sizer = createSizer(config.sizes[i]);\n let handle = renderer.createHandle();\n // Add the child data to the layout node.\n node.children.push(childNode);\n node.handles.push(handle);\n node.sizers.push(sizer);\n // Update the parent for the child node.\n childNode.parent = node;\n });\n // Synchronize the handle state for the layout node.\n node.syncHandles();\n // Normalize the sizes for the layout node.\n node.normalizeSizes();\n // Return the new layout node.\n return node;\n }\n})(Private$6 || (Private$6 = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A widget which provides a flexible docking area for widgets.\n */\nclass DockPanel extends Widget {\n /**\n * Construct a new dock panel.\n *\n * @param options - The options for initializing the panel.\n */\n constructor(options = {}) {\n super();\n this._drag = null;\n this._tabsMovable = true;\n this._tabsConstrained = false;\n this._addButtonEnabled = false;\n this._pressData = null;\n this._layoutModified = new Signal(this);\n this._addRequested = new Signal(this);\n this.addClass('lm-DockPanel');\n this._document = options.document || document;\n this._mode = options.mode || 'multiple-document';\n this._renderer = options.renderer || DockPanel.defaultRenderer;\n this._edges = options.edges || Private$5.DEFAULT_EDGES;\n if (options.tabsMovable !== undefined) {\n this._tabsMovable = options.tabsMovable;\n }\n if (options.tabsConstrained !== undefined) {\n this._tabsConstrained = options.tabsConstrained;\n }\n if (options.addButtonEnabled !== undefined) {\n this._addButtonEnabled = options.addButtonEnabled;\n }\n // Toggle the CSS mode attribute.\n this.dataset['mode'] = this._mode;\n // Create the delegate renderer for the layout.\n let renderer = {\n createTabBar: () => this._createTabBar(),\n createHandle: () => this._createHandle()\n };\n // Set up the dock layout for the panel.\n this.layout = new DockLayout({\n document: this._document,\n renderer,\n spacing: options.spacing,\n hiddenMode: options.hiddenMode\n });\n // Set up the overlay drop indicator.\n this.overlay = options.overlay || new DockPanel.Overlay();\n this.node.appendChild(this.overlay.node);\n }\n /**\n * Dispose of the resources held by the panel.\n */\n dispose() {\n // Ensure the mouse is released.\n this._releaseMouse();\n // Hide the overlay.\n this.overlay.hide(0);\n // Cancel a drag if one is in progress.\n if (this._drag) {\n this._drag.dispose();\n }\n // Dispose of the base class.\n super.dispose();\n }\n /**\n * The method for hiding widgets.\n */\n get hiddenMode() {\n return this.layout.hiddenMode;\n }\n /**\n * Set the method for hiding widgets.\n */\n set hiddenMode(v) {\n this.layout.hiddenMode = v;\n }\n /**\n * A signal emitted when the layout configuration is modified.\n *\n * #### Notes\n * This signal is emitted whenever the current layout configuration\n * may have changed.\n *\n * This signal is emitted asynchronously in a collapsed fashion, so\n * that multiple synchronous modifications results in only a single\n * emit of the signal.\n */\n get layoutModified() {\n return this._layoutModified;\n }\n /**\n * A signal emitted when the add button on a tab bar is clicked.\n *\n */\n get addRequested() {\n return this._addRequested;\n }\n /**\n * The renderer used by the dock panel.\n */\n get renderer() {\n return this.layout.renderer;\n }\n /**\n * Get the spacing between the widgets.\n */\n get spacing() {\n return this.layout.spacing;\n }\n /**\n * Set the spacing between the widgets.\n */\n set spacing(value) {\n this.layout.spacing = value;\n }\n /**\n * Get the mode for the dock panel.\n */\n get mode() {\n return this._mode;\n }\n /**\n * Set the mode for the dock panel.\n *\n * #### Notes\n * Changing the mode is a destructive operation with respect to the\n * panel's layout configuration. If layout state must be preserved,\n * save the current layout config before changing the mode.\n */\n set mode(value) {\n // Bail early if the mode does not change.\n if (this._mode === value) {\n return;\n }\n // Update the internal mode.\n this._mode = value;\n // Toggle the CSS mode attribute.\n this.dataset['mode'] = value;\n // Get the layout for the panel.\n let layout = this.layout;\n // Configure the layout for the specified mode.\n switch (value) {\n case 'multiple-document':\n for (const tabBar of layout.tabBars()) {\n tabBar.show();\n }\n break;\n case 'single-document':\n layout.restoreLayout(Private$5.createSingleDocumentConfig(this));\n break;\n default:\n throw 'unreachable';\n }\n // Schedule an emit of the layout modified signal.\n MessageLoop.postMessage(this, Private$5.LayoutModified);\n }\n /**\n * Whether the tabs can be dragged / moved at runtime.\n */\n get tabsMovable() {\n return this._tabsMovable;\n }\n /**\n * Enable / Disable draggable / movable tabs.\n */\n set tabsMovable(value) {\n this._tabsMovable = value;\n for (const tabBar of this.tabBars()) {\n tabBar.tabsMovable = value;\n }\n }\n /**\n * Whether the tabs are constrained to their source dock panel\n */\n get tabsConstrained() {\n return this._tabsConstrained;\n }\n /**\n * Constrain/Allow tabs to be dragged outside of this dock panel\n */\n set tabsConstrained(value) {\n this._tabsConstrained = value;\n }\n /**\n * Whether the add buttons for each tab bar are enabled.\n */\n get addButtonEnabled() {\n return this._addButtonEnabled;\n }\n /**\n * Set whether the add buttons for each tab bar are enabled.\n */\n set addButtonEnabled(value) {\n this._addButtonEnabled = value;\n for (const tabBar of this.tabBars()) {\n tabBar.addButtonEnabled = value;\n }\n }\n /**\n * Whether the dock panel is empty.\n */\n get isEmpty() {\n return this.layout.isEmpty;\n }\n /**\n * Create an iterator over the user widgets in the panel.\n *\n * @returns A new iterator over the user widgets in the panel.\n *\n * #### Notes\n * This iterator does not include the generated tab bars.\n */\n *widgets() {\n yield* this.layout.widgets();\n }\n /**\n * Create an iterator over the selected widgets in the panel.\n *\n * @returns A new iterator over the selected user widgets.\n *\n * #### Notes\n * This iterator yields the widgets corresponding to the current tab\n * of each tab bar in the panel.\n */\n *selectedWidgets() {\n yield* this.layout.selectedWidgets();\n }\n /**\n * Create an iterator over the tab bars in the panel.\n *\n * @returns A new iterator over the tab bars in the panel.\n *\n * #### Notes\n * This iterator does not include the user widgets.\n */\n *tabBars() {\n yield* this.layout.tabBars();\n }\n /**\n * Create an iterator over the handles in the panel.\n *\n * @returns A new iterator over the handles in the panel.\n */\n *handles() {\n yield* this.layout.handles();\n }\n /**\n * Select a specific widget in the dock panel.\n *\n * @param widget - The widget of interest.\n *\n * #### Notes\n * This will make the widget the current widget in its tab area.\n */\n selectWidget(widget) {\n // Find the tab bar which contains the widget.\n let tabBar = find(this.tabBars(), bar => {\n return bar.titles.indexOf(widget.title) !== -1;\n });\n // Throw an error if no tab bar is found.\n if (!tabBar) {\n throw new Error('Widget is not contained in the dock panel.');\n }\n // Ensure the widget is the current widget.\n tabBar.currentTitle = widget.title;\n }\n /**\n * Activate a specified widget in the dock panel.\n *\n * @param widget - The widget of interest.\n *\n * #### Notes\n * This will select and activate the given widget.\n */\n activateWidget(widget) {\n this.selectWidget(widget);\n widget.activate();\n }\n /**\n * Save the current layout configuration of the dock panel.\n *\n * @returns A new config object for the current layout state.\n *\n * #### Notes\n * The return value can be provided to the `restoreLayout` method\n * in order to restore the layout to its current configuration.\n */\n saveLayout() {\n return this.layout.saveLayout();\n }\n /**\n * Restore the layout to a previously saved configuration.\n *\n * @param config - The layout configuration to restore.\n *\n * #### Notes\n * Widgets which currently belong to the layout but which are not\n * contained in the config will be unparented.\n *\n * The dock panel automatically reverts to `'multiple-document'`\n * mode when a layout config is restored.\n */\n restoreLayout(config) {\n // Reset the mode.\n this._mode = 'multiple-document';\n // Restore the layout.\n this.layout.restoreLayout(config);\n // Flush the message loop on IE and Edge to prevent flicker.\n if (Platform.IS_EDGE || Platform.IS_IE) {\n MessageLoop.flush();\n }\n // Schedule an emit of the layout modified signal.\n MessageLoop.postMessage(this, Private$5.LayoutModified);\n }\n /**\n * Add a widget to the dock panel.\n *\n * @param widget - The widget to add to the dock panel.\n *\n * @param options - The additional options for adding the widget.\n *\n * #### Notes\n * If the panel is in single document mode, the options are ignored\n * and the widget is always added as tab in the hidden tab bar.\n */\n addWidget(widget, options = {}) {\n // Add the widget to the layout.\n if (this._mode === 'single-document') {\n this.layout.addWidget(widget);\n }\n else {\n this.layout.addWidget(widget, options);\n }\n // Schedule an emit of the layout modified signal.\n MessageLoop.postMessage(this, Private$5.LayoutModified);\n }\n /**\n * Process a message sent to the widget.\n *\n * @param msg - The message sent to the widget.\n */\n processMessage(msg) {\n if (msg.type === 'layout-modified') {\n this._layoutModified.emit(undefined);\n }\n else {\n super.processMessage(msg);\n }\n }\n /**\n * Handle the DOM events for the dock panel.\n *\n * @param event - The DOM event sent to the panel.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the panel's DOM node. It should\n * not be called directly by user code.\n */\n handleEvent(event) {\n switch (event.type) {\n case 'lm-dragenter':\n this._evtDragEnter(event);\n break;\n case 'lm-dragleave':\n this._evtDragLeave(event);\n break;\n case 'lm-dragover':\n this._evtDragOver(event);\n break;\n case 'lm-drop':\n this._evtDrop(event);\n break;\n case 'pointerdown':\n this._evtPointerDown(event);\n break;\n case 'pointermove':\n this._evtPointerMove(event);\n break;\n case 'pointerup':\n this._evtPointerUp(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n }\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n onBeforeAttach(msg) {\n this.node.addEventListener('lm-dragenter', this);\n this.node.addEventListener('lm-dragleave', this);\n this.node.addEventListener('lm-dragover', this);\n this.node.addEventListener('lm-drop', this);\n this.node.addEventListener('pointerdown', this);\n }\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n onAfterDetach(msg) {\n this.node.removeEventListener('lm-dragenter', this);\n this.node.removeEventListener('lm-dragleave', this);\n this.node.removeEventListener('lm-dragover', this);\n this.node.removeEventListener('lm-drop', this);\n this.node.removeEventListener('pointerdown', this);\n this._releaseMouse();\n }\n /**\n * A message handler invoked on a `'child-added'` message.\n */\n onChildAdded(msg) {\n // Ignore the generated tab bars.\n if (Private$5.isGeneratedTabBarProperty.get(msg.child)) {\n return;\n }\n // Add the widget class to the child.\n msg.child.addClass('lm-DockPanel-widget');\n }\n /**\n * A message handler invoked on a `'child-removed'` message.\n */\n onChildRemoved(msg) {\n // Ignore the generated tab bars.\n if (Private$5.isGeneratedTabBarProperty.get(msg.child)) {\n return;\n }\n // Remove the widget class from the child.\n msg.child.removeClass('lm-DockPanel-widget');\n // Schedule an emit of the layout modified signal.\n MessageLoop.postMessage(this, Private$5.LayoutModified);\n }\n /**\n * Handle the `'lm-dragenter'` event for the dock panel.\n */\n _evtDragEnter(event) {\n // If the factory mime type is present, mark the event as\n // handled in order to get the rest of the drag events.\n if (event.mimeData.hasData('application/vnd.lumino.widget-factory')) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n /**\n * Handle the `'lm-dragleave'` event for the dock panel.\n */\n _evtDragLeave(event) {\n // Mark the event as handled.\n event.preventDefault();\n if (this._tabsConstrained && event.source !== this)\n return;\n event.stopPropagation();\n // The new target might be a descendant, so we might still handle the drop.\n // Hide asynchronously so that if a lm-dragover event bubbles up to us, the\n // hide is cancelled by the lm-dragover handler's show overlay logic.\n this.overlay.hide(1);\n }\n /**\n * Handle the `'lm-dragover'` event for the dock panel.\n */\n _evtDragOver(event) {\n // Mark the event as handled.\n event.preventDefault();\n // Show the drop indicator overlay and update the drop\n // action based on the drop target zone under the mouse.\n if ((this._tabsConstrained && event.source !== this) ||\n this._showOverlay(event.clientX, event.clientY) === 'invalid') {\n event.dropAction = 'none';\n }\n else {\n event.stopPropagation();\n event.dropAction = event.proposedAction;\n }\n }\n /**\n * Handle the `'lm-drop'` event for the dock panel.\n */\n _evtDrop(event) {\n // Mark the event as handled.\n event.preventDefault();\n // Hide the drop indicator overlay.\n this.overlay.hide(0);\n // Bail if the proposed action is to do nothing.\n if (event.proposedAction === 'none') {\n event.dropAction = 'none';\n return;\n }\n // Find the drop target under the mouse.\n let { clientX, clientY } = event;\n let { zone, target } = Private$5.findDropTarget(this, clientX, clientY, this._edges);\n // Bail if the drop zone is invalid.\n if ((this._tabsConstrained && event.source !== this) ||\n zone === 'invalid') {\n event.dropAction = 'none';\n return;\n }\n // Bail if the factory mime type has invalid data.\n let mimeData = event.mimeData;\n let factory = mimeData.getData('application/vnd.lumino.widget-factory');\n if (typeof factory !== 'function') {\n event.dropAction = 'none';\n return;\n }\n // Bail if the factory does not produce a widget.\n let widget = factory();\n if (!(widget instanceof Widget)) {\n event.dropAction = 'none';\n return;\n }\n // Bail if the widget is an ancestor of the dock panel.\n if (widget.contains(this)) {\n event.dropAction = 'none';\n return;\n }\n // Find the reference widget for the drop target.\n let ref = target ? Private$5.getDropRef(target.tabBar) : null;\n // Add the widget according to the indicated drop zone.\n switch (zone) {\n case 'root-all':\n this.addWidget(widget);\n break;\n case 'root-top':\n this.addWidget(widget, { mode: 'split-top' });\n break;\n case 'root-left':\n this.addWidget(widget, { mode: 'split-left' });\n break;\n case 'root-right':\n this.addWidget(widget, { mode: 'split-right' });\n break;\n case 'root-bottom':\n this.addWidget(widget, { mode: 'split-bottom' });\n break;\n case 'widget-all':\n this.addWidget(widget, { mode: 'tab-after', ref });\n break;\n case 'widget-top':\n this.addWidget(widget, { mode: 'split-top', ref });\n break;\n case 'widget-left':\n this.addWidget(widget, { mode: 'split-left', ref });\n break;\n case 'widget-right':\n this.addWidget(widget, { mode: 'split-right', ref });\n break;\n case 'widget-bottom':\n this.addWidget(widget, { mode: 'split-bottom', ref });\n break;\n case 'widget-tab':\n this.addWidget(widget, { mode: 'tab-after', ref });\n break;\n default:\n throw 'unreachable';\n }\n // Accept the proposed drop action.\n event.dropAction = event.proposedAction;\n // Stop propagation if we have not bailed so far.\n event.stopPropagation();\n // Activate the dropped widget.\n this.activateWidget(widget);\n }\n /**\n * Handle the `'keydown'` event for the dock panel.\n */\n _evtKeyDown(event) {\n // Stop input events during drag.\n event.preventDefault();\n event.stopPropagation();\n // Release the mouse if `Escape` is pressed.\n if (event.keyCode === 27) {\n // Finalize the mouse release.\n this._releaseMouse();\n // Schedule an emit of the layout modified signal.\n MessageLoop.postMessage(this, Private$5.LayoutModified);\n }\n }\n /**\n * Handle the `'pointerdown'` event for the dock panel.\n */\n _evtPointerDown(event) {\n // Do nothing if the left mouse button is not pressed.\n if (event.button !== 0) {\n return;\n }\n // Find the handle which contains the mouse target, if any.\n let layout = this.layout;\n let target = event.target;\n let handle = find(layout.handles(), handle => handle.contains(target));\n if (!handle) {\n return;\n }\n // Stop the event when a handle is pressed.\n event.preventDefault();\n event.stopPropagation();\n // Add the extra document listeners.\n this._document.addEventListener('keydown', this, true);\n this._document.addEventListener('pointerup', this, true);\n this._document.addEventListener('pointermove', this, true);\n this._document.addEventListener('contextmenu', this, true);\n // Compute the offset deltas for the handle press.\n let rect = handle.getBoundingClientRect();\n let deltaX = event.clientX - rect.left;\n let deltaY = event.clientY - rect.top;\n // Override the cursor and store the press data.\n let style = window.getComputedStyle(handle);\n let override = Drag.overrideCursor(style.cursor, this._document);\n this._pressData = { handle, deltaX, deltaY, override };\n }\n /**\n * Handle the `'pointermove'` event for the dock panel.\n */\n _evtPointerMove(event) {\n // Bail early if no drag is in progress.\n if (!this._pressData) {\n return;\n }\n // Stop the event when dragging a handle.\n event.preventDefault();\n event.stopPropagation();\n // Compute the desired offset position for the handle.\n let rect = this.node.getBoundingClientRect();\n let xPos = event.clientX - rect.left - this._pressData.deltaX;\n let yPos = event.clientY - rect.top - this._pressData.deltaY;\n // Set the handle as close to the desired position as possible.\n let layout = this.layout;\n layout.moveHandle(this._pressData.handle, xPos, yPos);\n }\n /**\n * Handle the `'pointerup'` event for the dock panel.\n */\n _evtPointerUp(event) {\n // Do nothing if the left mouse button is not released.\n if (event.button !== 0) {\n return;\n }\n // Stop the event when releasing a handle.\n event.preventDefault();\n event.stopPropagation();\n // Finalize the mouse release.\n this._releaseMouse();\n // Schedule an emit of the layout modified signal.\n MessageLoop.postMessage(this, Private$5.LayoutModified);\n }\n /**\n * Release the mouse grab for the dock panel.\n */\n _releaseMouse() {\n // Bail early if no drag is in progress.\n if (!this._pressData) {\n return;\n }\n // Clear the override cursor.\n this._pressData.override.dispose();\n this._pressData = null;\n // Remove the extra document listeners.\n this._document.removeEventListener('keydown', this, true);\n this._document.removeEventListener('pointerup', this, true);\n this._document.removeEventListener('pointermove', this, true);\n this._document.removeEventListener('contextmenu', this, true);\n }\n /**\n * Show the overlay indicator at the given client position.\n *\n * Returns the drop zone at the specified client position.\n *\n * #### Notes\n * If the position is not over a valid zone, the overlay is hidden.\n */\n _showOverlay(clientX, clientY) {\n // Find the dock target for the given client position.\n let { zone, target } = Private$5.findDropTarget(this, clientX, clientY, this._edges);\n // If the drop zone is invalid, hide the overlay and bail.\n if (zone === 'invalid') {\n this.overlay.hide(100);\n return zone;\n }\n // Setup the variables needed to compute the overlay geometry.\n let top;\n let left;\n let right;\n let bottom;\n let box = ElementExt.boxSizing(this.node); // TODO cache this?\n let rect = this.node.getBoundingClientRect();\n // Compute the overlay geometry based on the dock zone.\n switch (zone) {\n case 'root-all':\n top = box.paddingTop;\n left = box.paddingLeft;\n right = box.paddingRight;\n bottom = box.paddingBottom;\n break;\n case 'root-top':\n top = box.paddingTop;\n left = box.paddingLeft;\n right = box.paddingRight;\n bottom = rect.height * Private$5.GOLDEN_RATIO;\n break;\n case 'root-left':\n top = box.paddingTop;\n left = box.paddingLeft;\n right = rect.width * Private$5.GOLDEN_RATIO;\n bottom = box.paddingBottom;\n break;\n case 'root-right':\n top = box.paddingTop;\n left = rect.width * Private$5.GOLDEN_RATIO;\n right = box.paddingRight;\n bottom = box.paddingBottom;\n break;\n case 'root-bottom':\n top = rect.height * Private$5.GOLDEN_RATIO;\n left = box.paddingLeft;\n right = box.paddingRight;\n bottom = box.paddingBottom;\n break;\n case 'widget-all':\n top = target.top;\n left = target.left;\n right = target.right;\n bottom = target.bottom;\n break;\n case 'widget-top':\n top = target.top;\n left = target.left;\n right = target.right;\n bottom = target.bottom + target.height / 2;\n break;\n case 'widget-left':\n top = target.top;\n left = target.left;\n right = target.right + target.width / 2;\n bottom = target.bottom;\n break;\n case 'widget-right':\n top = target.top;\n left = target.left + target.width / 2;\n right = target.right;\n bottom = target.bottom;\n break;\n case 'widget-bottom':\n top = target.top + target.height / 2;\n left = target.left;\n right = target.right;\n bottom = target.bottom;\n break;\n case 'widget-tab': {\n const tabHeight = target.tabBar.node.getBoundingClientRect().height;\n top = target.top;\n left = target.left;\n right = target.right;\n bottom = target.bottom + target.height - tabHeight;\n break;\n }\n default:\n throw 'unreachable';\n }\n // Show the overlay with the computed geometry.\n this.overlay.show({ top, left, right, bottom });\n // Finally, return the computed drop zone.\n return zone;\n }\n /**\n * Create a new tab bar for use by the panel.\n */\n _createTabBar() {\n // Create the tab bar.\n let tabBar = this._renderer.createTabBar(this._document);\n // Set the generated tab bar property for the tab bar.\n Private$5.isGeneratedTabBarProperty.set(tabBar, true);\n // Hide the tab bar when in single document mode.\n if (this._mode === 'single-document') {\n tabBar.hide();\n }\n // Enforce necessary tab bar behavior.\n // TODO do we really want to enforce *all* of these?\n tabBar.tabsMovable = this._tabsMovable;\n tabBar.allowDeselect = false;\n tabBar.addButtonEnabled = this._addButtonEnabled;\n tabBar.removeBehavior = 'select-previous-tab';\n tabBar.insertBehavior = 'select-tab-if-needed';\n // Connect the signal handlers for the tab bar.\n tabBar.tabMoved.connect(this._onTabMoved, this);\n tabBar.currentChanged.connect(this._onCurrentChanged, this);\n tabBar.tabCloseRequested.connect(this._onTabCloseRequested, this);\n tabBar.tabDetachRequested.connect(this._onTabDetachRequested, this);\n tabBar.tabActivateRequested.connect(this._onTabActivateRequested, this);\n tabBar.addRequested.connect(this._onTabAddRequested, this);\n // Return the initialized tab bar.\n return tabBar;\n }\n /**\n * Create a new handle for use by the panel.\n */\n _createHandle() {\n return this._renderer.createHandle();\n }\n /**\n * Handle the `tabMoved` signal from a tab bar.\n */\n _onTabMoved() {\n MessageLoop.postMessage(this, Private$5.LayoutModified);\n }\n /**\n * Handle the `currentChanged` signal from a tab bar.\n */\n _onCurrentChanged(sender, args) {\n // Extract the previous and current title from the args.\n let { previousTitle, currentTitle } = args;\n // Hide the previous widget.\n if (previousTitle) {\n previousTitle.owner.hide();\n }\n // Show the current widget.\n if (currentTitle) {\n currentTitle.owner.show();\n }\n // Flush the message loop on IE and Edge to prevent flicker.\n if (Platform.IS_EDGE || Platform.IS_IE) {\n MessageLoop.flush();\n }\n // Schedule an emit of the layout modified signal.\n MessageLoop.postMessage(this, Private$5.LayoutModified);\n }\n /**\n * Handle the `addRequested` signal from a tab bar.\n */\n _onTabAddRequested(sender) {\n this._addRequested.emit(sender);\n }\n /**\n * Handle the `tabActivateRequested` signal from a tab bar.\n */\n _onTabActivateRequested(sender, args) {\n args.title.owner.activate();\n }\n /**\n * Handle the `tabCloseRequested` signal from a tab bar.\n */\n _onTabCloseRequested(sender, args) {\n args.title.owner.close();\n }\n /**\n * Handle the `tabDetachRequested` signal from a tab bar.\n */\n _onTabDetachRequested(sender, args) {\n // Do nothing if a drag is already in progress.\n if (this._drag) {\n return;\n }\n // Release the tab bar's hold on the mouse.\n sender.releaseMouse();\n // Extract the data from the args.\n let { title, tab, clientX, clientY, offset } = args;\n // Setup the mime data for the drag operation.\n let mimeData = new MimeData();\n let factory = () => title.owner;\n mimeData.setData('application/vnd.lumino.widget-factory', factory);\n // Create the drag image for the drag operation.\n let dragImage = tab.cloneNode(true);\n if (offset) {\n dragImage.style.top = `-${offset.y}px`;\n dragImage.style.left = `-${offset.x}px`;\n }\n // Create the drag object to manage the drag-drop operation.\n this._drag = new Drag({\n document: this._document,\n mimeData,\n dragImage,\n proposedAction: 'move',\n supportedActions: 'move',\n source: this\n });\n // Hide the tab node in the original tab.\n tab.classList.add('lm-mod-hidden');\n let cleanup = () => {\n this._drag = null;\n tab.classList.remove('lm-mod-hidden');\n };\n // Start the drag operation and cleanup when done.\n this._drag.start(clientX, clientY).then(cleanup);\n }\n}\n/**\n * The namespace for the `DockPanel` class statics.\n */\n(function (DockPanel) {\n /**\n * A concrete implementation of `IOverlay`.\n *\n * This is the default overlay implementation for a dock panel.\n */\n class Overlay {\n /**\n * Construct a new overlay.\n */\n constructor() {\n this._timer = -1;\n this._hidden = true;\n this.node = document.createElement('div');\n this.node.classList.add('lm-DockPanel-overlay');\n this.node.classList.add('lm-mod-hidden');\n this.node.style.position = 'absolute';\n this.node.style.contain = 'strict';\n }\n /**\n * Show the overlay using the given overlay geometry.\n *\n * @param geo - The desired geometry for the overlay.\n */\n show(geo) {\n // Update the position of the overlay.\n let style = this.node.style;\n style.top = `${geo.top}px`;\n style.left = `${geo.left}px`;\n style.right = `${geo.right}px`;\n style.bottom = `${geo.bottom}px`;\n // Clear any pending hide timer.\n clearTimeout(this._timer);\n this._timer = -1;\n // If the overlay is already visible, we're done.\n if (!this._hidden) {\n return;\n }\n // Clear the hidden flag.\n this._hidden = false;\n // Finally, show the overlay.\n this.node.classList.remove('lm-mod-hidden');\n }\n /**\n * Hide the overlay node.\n *\n * @param delay - The delay (in ms) before hiding the overlay.\n * A delay value <= 0 will hide the overlay immediately.\n */\n hide(delay) {\n // Do nothing if the overlay is already hidden.\n if (this._hidden) {\n return;\n }\n // Hide immediately if the delay is <= 0.\n if (delay <= 0) {\n clearTimeout(this._timer);\n this._timer = -1;\n this._hidden = true;\n this.node.classList.add('lm-mod-hidden');\n return;\n }\n // Do nothing if a hide is already pending.\n if (this._timer !== -1) {\n return;\n }\n // Otherwise setup the hide timer.\n this._timer = window.setTimeout(() => {\n this._timer = -1;\n this._hidden = true;\n this.node.classList.add('lm-mod-hidden');\n }, delay);\n }\n }\n DockPanel.Overlay = Overlay;\n /**\n * The default implementation of `IRenderer`.\n */\n class Renderer {\n /**\n * Create a new tab bar for use with a dock panel.\n *\n * @returns A new tab bar for a dock panel.\n */\n createTabBar(document) {\n let bar = new TabBar({ document });\n bar.addClass('lm-DockPanel-tabBar');\n return bar;\n }\n /**\n * Create a new handle node for use with a dock panel.\n *\n * @returns A new handle node for a dock panel.\n */\n createHandle() {\n let handle = document.createElement('div');\n handle.className = 'lm-DockPanel-handle';\n return handle;\n }\n }\n DockPanel.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n DockPanel.defaultRenderer = new Renderer();\n})(DockPanel || (DockPanel = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private$5;\n(function (Private) {\n /**\n * A fraction used for sizing root panels; ~= `1 / golden_ratio`.\n */\n Private.GOLDEN_RATIO = 0.618;\n /**\n * The default sizes for the edge drop zones, in pixels.\n */\n Private.DEFAULT_EDGES = {\n /**\n * The size of the top edge dock zone for the root panel, in pixels.\n * This is different from the others to distinguish between the top\n * tab bar and the top root zone.\n */\n top: 12,\n /**\n * The size of the edge dock zone for the root panel, in pixels.\n */\n right: 40,\n /**\n * The size of the edge dock zone for the root panel, in pixels.\n */\n bottom: 40,\n /**\n * The size of the edge dock zone for the root panel, in pixels.\n */\n left: 40\n };\n /**\n * A singleton `'layout-modified'` conflatable message.\n */\n Private.LayoutModified = new ConflatableMessage('layout-modified');\n /**\n * An attached property used to track generated tab bars.\n */\n Private.isGeneratedTabBarProperty = new AttachedProperty({\n name: 'isGeneratedTabBar',\n create: () => false\n });\n /**\n * Create a single document config for the widgets in a dock panel.\n */\n function createSingleDocumentConfig(panel) {\n // Return an empty config if the panel is empty.\n if (panel.isEmpty) {\n return { main: null };\n }\n // Get a flat array of the widgets in the panel.\n let widgets = Array.from(panel.widgets());\n // Get the first selected widget in the panel.\n let selected = panel.selectedWidgets().next().value;\n // Compute the current index for the new config.\n let currentIndex = selected ? widgets.indexOf(selected) : -1;\n // Return the single document config.\n return { main: { type: 'tab-area', widgets, currentIndex } };\n }\n Private.createSingleDocumentConfig = createSingleDocumentConfig;\n /**\n * Find the drop target at the given client position.\n */\n function findDropTarget(panel, clientX, clientY, edges) {\n // Bail if the mouse is not over the dock panel.\n if (!ElementExt.hitTest(panel.node, clientX, clientY)) {\n return { zone: 'invalid', target: null };\n }\n // Look up the layout for the panel.\n let layout = panel.layout;\n // If the layout is empty, indicate the entire root drop zone.\n if (layout.isEmpty) {\n return { zone: 'root-all', target: null };\n }\n // Test the edge zones when in multiple document mode.\n if (panel.mode === 'multiple-document') {\n // Get the client rect for the dock panel.\n let panelRect = panel.node.getBoundingClientRect();\n // Compute the distance to each edge of the panel.\n let pl = clientX - panelRect.left + 1;\n let pt = clientY - panelRect.top + 1;\n let pr = panelRect.right - clientX;\n let pb = panelRect.bottom - clientY;\n // Find the minimum distance to an edge.\n let pd = Math.min(pt, pr, pb, pl);\n // Return a root zone if the mouse is within an edge.\n switch (pd) {\n case pt:\n if (pt < edges.top) {\n return { zone: 'root-top', target: null };\n }\n break;\n case pr:\n if (pr < edges.right) {\n return { zone: 'root-right', target: null };\n }\n break;\n case pb:\n if (pb < edges.bottom) {\n return { zone: 'root-bottom', target: null };\n }\n break;\n case pl:\n if (pl < edges.left) {\n return { zone: 'root-left', target: null };\n }\n break;\n default:\n throw 'unreachable';\n }\n }\n // Hit test the dock layout at the given client position.\n let target = layout.hitTestTabAreas(clientX, clientY);\n // Bail if no target area was found.\n if (!target) {\n return { zone: 'invalid', target: null };\n }\n // Return the whole tab area when in single document mode.\n if (panel.mode === 'single-document') {\n return { zone: 'widget-all', target };\n }\n // Compute the distance to each edge of the tab area.\n let al = target.x - target.left + 1;\n let at = target.y - target.top + 1;\n let ar = target.left + target.width - target.x;\n let ab = target.top + target.height - target.y;\n const tabHeight = target.tabBar.node.getBoundingClientRect().height;\n if (at < tabHeight) {\n return { zone: 'widget-tab', target };\n }\n // Get the X and Y edge sizes for the area.\n let rx = Math.round(target.width / 3);\n let ry = Math.round(target.height / 3);\n // If the mouse is not within an edge, indicate the entire area.\n if (al > rx && ar > rx && at > ry && ab > ry) {\n return { zone: 'widget-all', target };\n }\n // Scale the distances by the slenderness ratio.\n al /= rx;\n at /= ry;\n ar /= rx;\n ab /= ry;\n // Find the minimum distance to the area edge.\n let ad = Math.min(al, at, ar, ab);\n // Find the widget zone for the area edge.\n let zone;\n switch (ad) {\n case al:\n zone = 'widget-left';\n break;\n case at:\n zone = 'widget-top';\n break;\n case ar:\n zone = 'widget-right';\n break;\n case ab:\n zone = 'widget-bottom';\n break;\n default:\n throw 'unreachable';\n }\n // Return the final drop target.\n return { zone, target };\n }\n Private.findDropTarget = findDropTarget;\n /**\n * Get the drop reference widget for a tab bar.\n */\n function getDropRef(tabBar) {\n if (tabBar.titles.length === 0) {\n return null;\n }\n if (tabBar.currentTitle) {\n return tabBar.currentTitle.owner;\n }\n return tabBar.titles[tabBar.titles.length - 1].owner;\n }\n Private.getDropRef = getDropRef;\n})(Private$5 || (Private$5 = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A class which tracks focus among a set of widgets.\n *\n * This class is useful when code needs to keep track of the most\n * recently focused widget(s) among a set of related widgets.\n */\nclass FocusTracker {\n constructor() {\n this._counter = 0;\n this._widgets = [];\n this._activeWidget = null;\n this._currentWidget = null;\n this._numbers = new Map();\n this._nodes = new Map();\n this._activeChanged = new Signal(this);\n this._currentChanged = new Signal(this);\n }\n /**\n * Dispose of the resources held by the tracker.\n */\n dispose() {\n // Do nothing if the tracker is already disposed.\n if (this._counter < 0) {\n return;\n }\n // Mark the tracker as disposed.\n this._counter = -1;\n // Clear the connections for the tracker.\n Signal.clearData(this);\n // Remove all event listeners.\n for (const widget of this._widgets) {\n widget.node.removeEventListener('focus', this, true);\n widget.node.removeEventListener('blur', this, true);\n }\n // Clear the internal data structures.\n this._activeWidget = null;\n this._currentWidget = null;\n this._nodes.clear();\n this._numbers.clear();\n this._widgets.length = 0;\n }\n /**\n * A signal emitted when the current widget has changed.\n */\n get currentChanged() {\n return this._currentChanged;\n }\n /**\n * A signal emitted when the active widget has changed.\n */\n get activeChanged() {\n return this._activeChanged;\n }\n /**\n * A flag indicating whether the tracker is disposed.\n */\n get isDisposed() {\n return this._counter < 0;\n }\n /**\n * The current widget in the tracker.\n *\n * #### Notes\n * The current widget is the widget among the tracked widgets which\n * has the *descendant node* which has most recently been focused.\n *\n * The current widget will not be updated if the node loses focus. It\n * will only be updated when a different tracked widget gains focus.\n *\n * If the current widget is removed from the tracker, the previous\n * current widget will be restored.\n *\n * This behavior is intended to follow a user's conceptual model of\n * a semantically \"current\" widget, where the \"last thing of type X\"\n * to be interacted with is the \"current instance of X\", regardless\n * of whether that instance still has focus.\n */\n get currentWidget() {\n return this._currentWidget;\n }\n /**\n * The active widget in the tracker.\n *\n * #### Notes\n * The active widget is the widget among the tracked widgets which\n * has the *descendant node* which is currently focused.\n */\n get activeWidget() {\n return this._activeWidget;\n }\n /**\n * A read only array of the widgets being tracked.\n */\n get widgets() {\n return this._widgets;\n }\n /**\n * Get the focus number for a particular widget in the tracker.\n *\n * @param widget - The widget of interest.\n *\n * @returns The focus number for the given widget, or `-1` if the\n * widget has not had focus since being added to the tracker, or\n * is not contained by the tracker.\n *\n * #### Notes\n * The focus number indicates the relative order in which the widgets\n * have gained focus. A widget with a larger number has gained focus\n * more recently than a widget with a smaller number.\n *\n * The `currentWidget` will always have the largest focus number.\n *\n * All widgets start with a focus number of `-1`, which indicates that\n * the widget has not been focused since being added to the tracker.\n */\n focusNumber(widget) {\n let n = this._numbers.get(widget);\n return n === undefined ? -1 : n;\n }\n /**\n * Test whether the focus tracker contains a given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns `true` if the widget is tracked, `false` otherwise.\n */\n has(widget) {\n return this._numbers.has(widget);\n }\n /**\n * Add a widget to the focus tracker.\n *\n * @param widget - The widget of interest.\n *\n * #### Notes\n * A widget will be automatically removed from the tracker if it\n * is disposed after being added.\n *\n * If the widget is already tracked, this is a no-op.\n */\n add(widget) {\n // Do nothing if the widget is already tracked.\n if (this._numbers.has(widget)) {\n return;\n }\n // Test whether the widget has focus.\n let focused = widget.node.contains(document.activeElement);\n // Set up the initial focus number.\n let n = focused ? this._counter++ : -1;\n // Add the widget to the internal data structures.\n this._widgets.push(widget);\n this._numbers.set(widget, n);\n this._nodes.set(widget.node, widget);\n // Set up the event listeners. The capturing phase must be used\n // since the 'focus' and 'blur' events don't bubble and Firefox\n // doesn't support the 'focusin' or 'focusout' events.\n widget.node.addEventListener('focus', this, true);\n widget.node.addEventListener('blur', this, true);\n // Connect the disposed signal handler.\n widget.disposed.connect(this._onWidgetDisposed, this);\n // Set the current and active widgets if needed.\n if (focused) {\n this._setWidgets(widget, widget);\n }\n }\n /**\n * Remove a widget from the focus tracker.\n *\n * #### Notes\n * If the widget is the `currentWidget`, the previous current widget\n * will become the new `currentWidget`.\n *\n * A widget will be automatically removed from the tracker if it\n * is disposed after being added.\n *\n * If the widget is not tracked, this is a no-op.\n */\n remove(widget) {\n // Bail early if the widget is not tracked.\n if (!this._numbers.has(widget)) {\n return;\n }\n // Disconnect the disposed signal handler.\n widget.disposed.disconnect(this._onWidgetDisposed, this);\n // Remove the event listeners.\n widget.node.removeEventListener('focus', this, true);\n widget.node.removeEventListener('blur', this, true);\n // Remove the widget from the internal data structures.\n ArrayExt.removeFirstOf(this._widgets, widget);\n this._nodes.delete(widget.node);\n this._numbers.delete(widget);\n // Bail early if the widget is not the current widget.\n if (this._currentWidget !== widget) {\n return;\n }\n // Filter the widgets for those which have had focus.\n let valid = this._widgets.filter(w => this._numbers.get(w) !== -1);\n // Get the valid widget with the max focus number.\n let previous = max(valid, (first, second) => {\n let a = this._numbers.get(first);\n let b = this._numbers.get(second);\n return a - b;\n }) || null;\n // Set the current and active widgets.\n this._setWidgets(previous, null);\n }\n /**\n * Handle the DOM events for the focus tracker.\n *\n * @param event - The DOM event sent to the panel.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the tracked nodes. It should\n * not be called directly by user code.\n */\n handleEvent(event) {\n switch (event.type) {\n case 'focus':\n this._evtFocus(event);\n break;\n case 'blur':\n this._evtBlur(event);\n break;\n }\n }\n /**\n * Set the current and active widgets for the tracker.\n */\n _setWidgets(current, active) {\n // Swap the current widget.\n let oldCurrent = this._currentWidget;\n this._currentWidget = current;\n // Swap the active widget.\n let oldActive = this._activeWidget;\n this._activeWidget = active;\n // Emit the `currentChanged` signal if needed.\n if (oldCurrent !== current) {\n this._currentChanged.emit({ oldValue: oldCurrent, newValue: current });\n }\n // Emit the `activeChanged` signal if needed.\n if (oldActive !== active) {\n this._activeChanged.emit({ oldValue: oldActive, newValue: active });\n }\n }\n /**\n * Handle the `'focus'` event for a tracked widget.\n */\n _evtFocus(event) {\n // Find the widget which gained focus, which is known to exist.\n let widget = this._nodes.get(event.currentTarget);\n // Update the focus number if necessary.\n if (widget !== this._currentWidget) {\n this._numbers.set(widget, this._counter++);\n }\n // Set the current and active widgets.\n this._setWidgets(widget, widget);\n }\n /**\n * Handle the `'blur'` event for a tracked widget.\n */\n _evtBlur(event) {\n // Find the widget which lost focus, which is known to exist.\n let widget = this._nodes.get(event.currentTarget);\n // Get the node which being focused after this blur.\n let focusTarget = event.relatedTarget;\n // If no other node is being focused, clear the active widget.\n if (!focusTarget) {\n this._setWidgets(this._currentWidget, null);\n return;\n }\n // Bail if the focus widget is not changing.\n if (widget.node.contains(focusTarget)) {\n return;\n }\n // If no tracked widget is being focused, clear the active widget.\n if (!find(this._widgets, w => w.node.contains(focusTarget))) {\n this._setWidgets(this._currentWidget, null);\n return;\n }\n }\n /**\n * Handle the `disposed` signal for a tracked widget.\n */\n _onWidgetDisposed(sender) {\n this.remove(sender);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A layout which arranges its widgets in a grid.\n */\nclass GridLayout extends Layout {\n /**\n * Construct a new grid layout.\n *\n * @param options - The options for initializing the layout.\n */\n constructor(options = {}) {\n super(options);\n this._dirty = false;\n this._rowSpacing = 4;\n this._columnSpacing = 4;\n this._items = [];\n this._rowStarts = [];\n this._columnStarts = [];\n this._rowSizers = [new BoxSizer()];\n this._columnSizers = [new BoxSizer()];\n this._box = null;\n if (options.rowCount !== undefined) {\n Private$4.reallocSizers(this._rowSizers, options.rowCount);\n }\n if (options.columnCount !== undefined) {\n Private$4.reallocSizers(this._columnSizers, options.columnCount);\n }\n if (options.rowSpacing !== undefined) {\n this._rowSpacing = Private$4.clampValue(options.rowSpacing);\n }\n if (options.columnSpacing !== undefined) {\n this._columnSpacing = Private$4.clampValue(options.columnSpacing);\n }\n }\n /**\n * Dispose of the resources held by the layout.\n */\n dispose() {\n // Dispose of the widgets and layout items.\n for (const item of this._items) {\n let widget = item.widget;\n item.dispose();\n widget.dispose();\n }\n // Clear the layout state.\n this._box = null;\n this._items.length = 0;\n this._rowStarts.length = 0;\n this._rowSizers.length = 0;\n this._columnStarts.length = 0;\n this._columnSizers.length = 0;\n // Dispose of the rest of the layout.\n super.dispose();\n }\n /**\n * Get the number of rows in the layout.\n */\n get rowCount() {\n return this._rowSizers.length;\n }\n /**\n * Set the number of rows in the layout.\n *\n * #### Notes\n * The minimum row count is `1`.\n */\n set rowCount(value) {\n // Do nothing if the row count does not change.\n if (value === this.rowCount) {\n return;\n }\n // Reallocate the row sizers.\n Private$4.reallocSizers(this._rowSizers, value);\n // Schedule a fit of the parent.\n if (this.parent) {\n this.parent.fit();\n }\n }\n /**\n * Get the number of columns in the layout.\n */\n get columnCount() {\n return this._columnSizers.length;\n }\n /**\n * Set the number of columns in the layout.\n *\n * #### Notes\n * The minimum column count is `1`.\n */\n set columnCount(value) {\n // Do nothing if the column count does not change.\n if (value === this.columnCount) {\n return;\n }\n // Reallocate the column sizers.\n Private$4.reallocSizers(this._columnSizers, value);\n // Schedule a fit of the parent.\n if (this.parent) {\n this.parent.fit();\n }\n }\n /**\n * Get the row spacing for the layout.\n */\n get rowSpacing() {\n return this._rowSpacing;\n }\n /**\n * Set the row spacing for the layout.\n */\n set rowSpacing(value) {\n // Clamp the spacing to the allowed range.\n value = Private$4.clampValue(value);\n // Bail if the spacing does not change\n if (this._rowSpacing === value) {\n return;\n }\n // Update the internal spacing.\n this._rowSpacing = value;\n // Schedule a fit of the parent.\n if (this.parent) {\n this.parent.fit();\n }\n }\n /**\n * Get the column spacing for the layout.\n */\n get columnSpacing() {\n return this._columnSpacing;\n }\n /**\n * Set the col spacing for the layout.\n */\n set columnSpacing(value) {\n // Clamp the spacing to the allowed range.\n value = Private$4.clampValue(value);\n // Bail if the spacing does not change\n if (this._columnSpacing === value) {\n return;\n }\n // Update the internal spacing.\n this._columnSpacing = value;\n // Schedule a fit of the parent.\n if (this.parent) {\n this.parent.fit();\n }\n }\n /**\n * Get the stretch factor for a specific row.\n *\n * @param index - The row index of interest.\n *\n * @returns The stretch factor for the row.\n *\n * #### Notes\n * This returns `-1` if the index is out of range.\n */\n rowStretch(index) {\n let sizer = this._rowSizers[index];\n return sizer ? sizer.stretch : -1;\n }\n /**\n * Set the stretch factor for a specific row.\n *\n * @param index - The row index of interest.\n *\n * @param value - The stretch factor for the row.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n setRowStretch(index, value) {\n // Look up the row sizer.\n let sizer = this._rowSizers[index];\n // Bail if the index is out of range.\n if (!sizer) {\n return;\n }\n // Clamp the value to the allowed range.\n value = Private$4.clampValue(value);\n // Bail if the stretch does not change.\n if (sizer.stretch === value) {\n return;\n }\n // Update the sizer stretch.\n sizer.stretch = value;\n // Schedule an update of the parent.\n if (this.parent) {\n this.parent.update();\n }\n }\n /**\n * Get the stretch factor for a specific column.\n *\n * @param index - The column index of interest.\n *\n * @returns The stretch factor for the column.\n *\n * #### Notes\n * This returns `-1` if the index is out of range.\n */\n columnStretch(index) {\n let sizer = this._columnSizers[index];\n return sizer ? sizer.stretch : -1;\n }\n /**\n * Set the stretch factor for a specific column.\n *\n * @param index - The column index of interest.\n *\n * @param value - The stretch factor for the column.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n setColumnStretch(index, value) {\n // Look up the column sizer.\n let sizer = this._columnSizers[index];\n // Bail if the index is out of range.\n if (!sizer) {\n return;\n }\n // Clamp the value to the allowed range.\n value = Private$4.clampValue(value);\n // Bail if the stretch does not change.\n if (sizer.stretch === value) {\n return;\n }\n // Update the sizer stretch.\n sizer.stretch = value;\n // Schedule an update of the parent.\n if (this.parent) {\n this.parent.update();\n }\n }\n /**\n * Create an iterator over the widgets in the layout.\n *\n * @returns A new iterator over the widgets in the layout.\n */\n *[Symbol.iterator]() {\n for (const item of this._items) {\n yield item.widget;\n }\n }\n /**\n * Add a widget to the grid layout.\n *\n * @param widget - The widget to add to the layout.\n *\n * #### Notes\n * If the widget is already contained in the layout, this is no-op.\n */\n addWidget(widget) {\n // Look up the index for the widget.\n let i = ArrayExt.findFirstIndex(this._items, it => it.widget === widget);\n // Bail if the widget is already in the layout.\n if (i !== -1) {\n return;\n }\n // Add the widget to the layout.\n this._items.push(new LayoutItem(widget));\n // Attach the widget to the parent.\n if (this.parent) {\n this.attachWidget(widget);\n }\n }\n /**\n * Remove a widget from the grid layout.\n *\n * @param widget - The widget to remove from the layout.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n */\n removeWidget(widget) {\n // Look up the index for the widget.\n let i = ArrayExt.findFirstIndex(this._items, it => it.widget === widget);\n // Bail if the widget is not in the layout.\n if (i === -1) {\n return;\n }\n // Remove the widget from the layout.\n let item = ArrayExt.removeAt(this._items, i);\n // Detach the widget from the parent.\n if (this.parent) {\n this.detachWidget(widget);\n }\n // Dispose the layout item.\n item.dispose();\n }\n /**\n * Perform layout initialization which requires the parent widget.\n */\n init() {\n super.init();\n for (const widget of this) {\n this.attachWidget(widget);\n }\n }\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param widget - The widget to attach to the parent.\n */\n attachWidget(widget) {\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n }\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param widget - The widget to detach from the parent.\n */\n detachWidget(widget) {\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n onBeforeShow(msg) {\n super.onBeforeShow(msg);\n this.parent.update();\n }\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n onBeforeAttach(msg) {\n super.onBeforeAttach(msg);\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n onChildShown(msg) {\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n onChildHidden(msg) {\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'resize'` message.\n */\n onResize(msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n }\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n onUpdateRequest(msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n }\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n onFitRequest(msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n }\n /**\n * Fit the layout to the total size required by the widgets.\n */\n _fit() {\n // Reset the min sizes of the sizers.\n for (let i = 0, n = this.rowCount; i < n; ++i) {\n this._rowSizers[i].minSize = 0;\n }\n for (let i = 0, n = this.columnCount; i < n; ++i) {\n this._columnSizers[i].minSize = 0;\n }\n // Filter for the visible layout items.\n let items = this._items.filter(it => !it.isHidden);\n // Fit the layout items.\n for (let i = 0, n = items.length; i < n; ++i) {\n items[i].fit();\n }\n // Get the max row and column index.\n let maxRow = this.rowCount - 1;\n let maxCol = this.columnCount - 1;\n // Sort the items by row span.\n items.sort(Private$4.rowSpanCmp);\n // Update the min sizes of the row sizers.\n for (let i = 0, n = items.length; i < n; ++i) {\n // Fetch the item.\n let item = items[i];\n // Get the row bounds for the item.\n let config = GridLayout.getCellConfig(item.widget);\n let r1 = Math.min(config.row, maxRow);\n let r2 = Math.min(config.row + config.rowSpan - 1, maxRow);\n // Distribute the minimum height to the sizers as needed.\n Private$4.distributeMin(this._rowSizers, r1, r2, item.minHeight);\n }\n // Sort the items by column span.\n items.sort(Private$4.columnSpanCmp);\n // Update the min sizes of the column sizers.\n for (let i = 0, n = items.length; i < n; ++i) {\n // Fetch the item.\n let item = items[i];\n // Get the column bounds for the item.\n let config = GridLayout.getCellConfig(item.widget);\n let c1 = Math.min(config.column, maxCol);\n let c2 = Math.min(config.column + config.columnSpan - 1, maxCol);\n // Distribute the minimum width to the sizers as needed.\n Private$4.distributeMin(this._columnSizers, c1, c2, item.minWidth);\n }\n // If no size constraint is needed, just update the parent.\n if (this.fitPolicy === 'set-no-constraint') {\n MessageLoop.sendMessage(this.parent, Widget.Msg.UpdateRequest);\n return;\n }\n // Set up the computed min size.\n let minH = maxRow * this._rowSpacing;\n let minW = maxCol * this._columnSpacing;\n // Add the sizer minimums to the computed min size.\n for (let i = 0, n = this.rowCount; i < n; ++i) {\n minH += this._rowSizers[i].minSize;\n }\n for (let i = 0, n = this.columnCount; i < n; ++i) {\n minW += this._columnSizers[i].minSize;\n }\n // Update the box sizing and add it to the computed min size.\n let box = (this._box = ElementExt.boxSizing(this.parent.node));\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n let style = this.parent.node.style;\n style.minWidth = `${minW}px`;\n style.minHeight = `${minH}px`;\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n MessageLoop.sendMessage(this.parent.parent, Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n MessageLoop.sendMessage(this.parent, Widget.Msg.UpdateRequest);\n }\n }\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n _update(offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = ElementExt.boxSizing(this.parent.node);\n }\n // Compute the layout area adjusted for border and padding.\n let top = this._box.paddingTop;\n let left = this._box.paddingLeft;\n let width = offsetWidth - this._box.horizontalSum;\n let height = offsetHeight - this._box.verticalSum;\n // Get the max row and column index.\n let maxRow = this.rowCount - 1;\n let maxCol = this.columnCount - 1;\n // Compute the total fixed row and column space.\n let fixedRowSpace = maxRow * this._rowSpacing;\n let fixedColSpace = maxCol * this._columnSpacing;\n // Distribute the available space to the box sizers.\n BoxEngine.calc(this._rowSizers, Math.max(0, height - fixedRowSpace));\n BoxEngine.calc(this._columnSizers, Math.max(0, width - fixedColSpace));\n // Update the row start positions.\n for (let i = 0, pos = top, n = this.rowCount; i < n; ++i) {\n this._rowStarts[i] = pos;\n pos += this._rowSizers[i].size + this._rowSpacing;\n }\n // Update the column start positions.\n for (let i = 0, pos = left, n = this.columnCount; i < n; ++i) {\n this._columnStarts[i] = pos;\n pos += this._columnSizers[i].size + this._columnSpacing;\n }\n // Update the geometry of the layout items.\n for (let i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n let item = this._items[i];\n // Ignore hidden items.\n if (item.isHidden) {\n continue;\n }\n // Fetch the cell bounds for the widget.\n let config = GridLayout.getCellConfig(item.widget);\n let r1 = Math.min(config.row, maxRow);\n let c1 = Math.min(config.column, maxCol);\n let r2 = Math.min(config.row + config.rowSpan - 1, maxRow);\n let c2 = Math.min(config.column + config.columnSpan - 1, maxCol);\n // Compute the cell geometry.\n let x = this._columnStarts[c1];\n let y = this._rowStarts[r1];\n let w = this._columnStarts[c2] + this._columnSizers[c2].size - x;\n let h = this._rowStarts[r2] + this._rowSizers[r2].size - y;\n // Update the geometry of the layout item.\n item.update(x, y, w, h);\n }\n }\n}\n/**\n * The namespace for the `GridLayout` class statics.\n */\n(function (GridLayout) {\n /**\n * Get the cell config for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The cell config for the widget.\n */\n function getCellConfig(widget) {\n return Private$4.cellConfigProperty.get(widget);\n }\n GridLayout.getCellConfig = getCellConfig;\n /**\n * Set the cell config for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the cell config.\n */\n function setCellConfig(widget, value) {\n Private$4.cellConfigProperty.set(widget, Private$4.normalizeConfig(value));\n }\n GridLayout.setCellConfig = setCellConfig;\n})(GridLayout || (GridLayout = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private$4;\n(function (Private) {\n /**\n * The property descriptor for the widget cell config.\n */\n Private.cellConfigProperty = new AttachedProperty({\n name: 'cellConfig',\n create: () => ({ row: 0, column: 0, rowSpan: 1, columnSpan: 1 }),\n changed: onChildCellConfigChanged\n });\n /**\n * Normalize a partial cell config object.\n */\n function normalizeConfig(config) {\n let row = Math.max(0, Math.floor(config.row || 0));\n let column = Math.max(0, Math.floor(config.column || 0));\n let rowSpan = Math.max(1, Math.floor(config.rowSpan || 0));\n let columnSpan = Math.max(1, Math.floor(config.columnSpan || 0));\n return { row, column, rowSpan, columnSpan };\n }\n Private.normalizeConfig = normalizeConfig;\n /**\n * Clamp a value to an integer >= 0.\n */\n function clampValue(value) {\n return Math.max(0, Math.floor(value));\n }\n Private.clampValue = clampValue;\n /**\n * A sort comparison function for row spans.\n */\n function rowSpanCmp(a, b) {\n let c1 = Private.cellConfigProperty.get(a.widget);\n let c2 = Private.cellConfigProperty.get(b.widget);\n return c1.rowSpan - c2.rowSpan;\n }\n Private.rowSpanCmp = rowSpanCmp;\n /**\n * A sort comparison function for column spans.\n */\n function columnSpanCmp(a, b) {\n let c1 = Private.cellConfigProperty.get(a.widget);\n let c2 = Private.cellConfigProperty.get(b.widget);\n return c1.columnSpan - c2.columnSpan;\n }\n Private.columnSpanCmp = columnSpanCmp;\n /**\n * Reallocate the box sizers for the given grid dimensions.\n */\n function reallocSizers(sizers, count) {\n // Coerce the count to the valid range.\n count = Math.max(1, Math.floor(count));\n // Add the missing sizers.\n while (sizers.length < count) {\n sizers.push(new BoxSizer());\n }\n // Remove the extra sizers.\n if (sizers.length > count) {\n sizers.length = count;\n }\n }\n Private.reallocSizers = reallocSizers;\n /**\n * Distribute a min size constraint across a range of sizers.\n */\n function distributeMin(sizers, i1, i2, minSize) {\n // Sanity check the indices.\n if (i2 < i1) {\n return;\n }\n // Handle the simple case of no cell span.\n if (i1 === i2) {\n let sizer = sizers[i1];\n sizer.minSize = Math.max(sizer.minSize, minSize);\n return;\n }\n // Compute the total current min size of the span.\n let totalMin = 0;\n for (let i = i1; i <= i2; ++i) {\n totalMin += sizers[i].minSize;\n }\n // Do nothing if the total is greater than the required.\n if (totalMin >= minSize) {\n return;\n }\n // Compute the portion of the space to allocate to each sizer.\n let portion = (minSize - totalMin) / (i2 - i1 + 1);\n // Add the portion to each sizer.\n for (let i = i1; i <= i2; ++i) {\n sizers[i].minSize += portion;\n }\n }\n Private.distributeMin = distributeMin;\n /**\n * The change handler for the child cell config property.\n */\n function onChildCellConfigChanged(child) {\n if (child.parent && child.parent.layout instanceof GridLayout) {\n child.parent.fit();\n }\n }\n})(Private$4 || (Private$4 = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A widget which displays menus as a canonical menu bar.\n */\nclass MenuBar extends Widget {\n /**\n * Construct a new menu bar.\n *\n * @param options - The options for initializing the menu bar.\n */\n constructor(options = {}) {\n super({ node: Private$3.createNode() });\n // Track the index of the item that is currently focused or hovered. -1 means nothing focused or hovered.\n this._activeIndex = -1;\n // Track which item can be focused using the TAB key. Unlike _activeIndex will\n // always point to a menuitem. Whenever you update this value, it's important\n // to follow it with an \"update-request\" message so that the `tabindex`\n // attribute on each menubar item gets properly updated.\n this._tabFocusIndex = 0;\n this._menus = [];\n this._childMenu = null;\n this._overflowMenu = null;\n this._menuItemSizes = [];\n this._overflowIndex = -1;\n this.addClass('lm-MenuBar');\n this.setFlag(Widget.Flag.DisallowLayout);\n this.renderer = options.renderer || MenuBar.defaultRenderer;\n this._forceItemsPosition = options.forceItemsPosition || {\n forceX: true,\n forceY: true\n };\n this._overflowMenuOptions = options.overflowMenuOptions || {\n isVisible: true\n };\n }\n /**\n * Dispose of the resources held by the widget.\n */\n dispose() {\n this._closeChildMenu();\n this._menus.length = 0;\n super.dispose();\n }\n /**\n * The child menu of the menu bar.\n *\n * #### Notes\n * This will be `null` if the menu bar does not have an open menu.\n */\n get childMenu() {\n return this._childMenu;\n }\n /**\n * The overflow index of the menu bar.\n */\n get overflowIndex() {\n return this._overflowIndex;\n }\n /**\n * The overflow menu of the menu bar.\n */\n get overflowMenu() {\n return this._overflowMenu;\n }\n /**\n * Get the menu bar content node.\n *\n * #### Notes\n * This is the node which holds the menu title nodes.\n *\n * Modifying this node directly can lead to undefined behavior.\n */\n get contentNode() {\n return this.node.getElementsByClassName('lm-MenuBar-content')[0];\n }\n /**\n * Get the currently active menu.\n */\n get activeMenu() {\n return this._menus[this._activeIndex] || null;\n }\n /**\n * Set the currently active menu.\n *\n * #### Notes\n * If the menu does not exist, the menu will be set to `null`.\n */\n set activeMenu(value) {\n this.activeIndex = value ? this._menus.indexOf(value) : -1;\n }\n /**\n * Get the index of the currently active menu.\n *\n * #### Notes\n * This will be `-1` if no menu is active.\n */\n get activeIndex() {\n return this._activeIndex;\n }\n /**\n * Set the index of the currently active menu.\n *\n * #### Notes\n * If the menu cannot be activated, the index will be set to `-1`.\n */\n set activeIndex(value) {\n // Adjust the value for an out of range index.\n if (value < 0 || value >= this._menus.length) {\n value = -1;\n }\n // An empty menu cannot be active\n if (value > -1 && this._menus[value].items.length === 0) {\n value = -1;\n }\n // Bail early if the index will not change.\n if (this._activeIndex === value) {\n return;\n }\n // Update the active index.\n this._activeIndex = value;\n // Schedule an update of the items.\n this.update();\n }\n /**\n * A read-only array of the menus in the menu bar.\n */\n get menus() {\n return this._menus;\n }\n /**\n * Open the active menu and activate its first menu item.\n *\n * #### Notes\n * If there is no active menu, this is a no-op.\n */\n openActiveMenu() {\n // Bail early if there is no active item.\n if (this._activeIndex === -1) {\n return;\n }\n // Open the child menu.\n this._openChildMenu();\n // Activate the first item in the child menu.\n if (this._childMenu) {\n this._childMenu.activeIndex = -1;\n this._childMenu.activateNextItem();\n }\n }\n /**\n * Add a menu to the end of the menu bar.\n *\n * @param menu - The menu to add to the menu bar.\n *\n * #### Notes\n * If the menu is already added to the menu bar, it will be moved.\n */\n addMenu(menu, update = true) {\n this.insertMenu(this._menus.length, menu, update);\n }\n /**\n * Insert a menu into the menu bar at the specified index.\n *\n * @param index - The index at which to insert the menu.\n *\n * @param menu - The menu to insert into the menu bar.\n *\n * #### Notes\n * The index will be clamped to the bounds of the menus.\n *\n * If the menu is already added to the menu bar, it will be moved.\n */\n insertMenu(index, menu, update = true) {\n // Close the child menu before making changes.\n this._closeChildMenu();\n // Look up the index of the menu.\n let i = this._menus.indexOf(menu);\n // Clamp the insert index to the array bounds.\n let j = Math.max(0, Math.min(index, this._menus.length));\n // If the menu is not in the array, insert it.\n if (i === -1) {\n // Insert the menu into the array.\n ArrayExt.insert(this._menus, j, menu);\n // Add the styling class to the menu.\n menu.addClass('lm-MenuBar-menu');\n // Connect to the menu signals.\n menu.aboutToClose.connect(this._onMenuAboutToClose, this);\n menu.menuRequested.connect(this._onMenuMenuRequested, this);\n menu.title.changed.connect(this._onTitleChanged, this);\n // Schedule an update of the items.\n if (update) {\n this.update();\n }\n // There is nothing more to do.\n return;\n }\n // Otherwise, the menu exists in the array and should be moved.\n // Adjust the index if the location is at the end of the array.\n if (j === this._menus.length) {\n j--;\n }\n // Bail if there is no effective move.\n if (i === j) {\n return;\n }\n // Move the menu to the new locations.\n ArrayExt.move(this._menus, i, j);\n // Schedule an update of the items.\n if (update) {\n this.update();\n }\n }\n /**\n * Remove a menu from the menu bar.\n *\n * @param menu - The menu to remove from the menu bar.\n *\n * #### Notes\n * This is a no-op if the menu is not in the menu bar.\n */\n removeMenu(menu, update = true) {\n this.removeMenuAt(this._menus.indexOf(menu), update);\n }\n /**\n * Remove the menu at a given index from the menu bar.\n *\n * @param index - The index of the menu to remove.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n removeMenuAt(index, update = true) {\n // Close the child menu before making changes.\n this._closeChildMenu();\n // Remove the menu from the array.\n let menu = ArrayExt.removeAt(this._menus, index);\n // Bail if the index is out of range.\n if (!menu) {\n return;\n }\n // Disconnect from the menu signals.\n menu.aboutToClose.disconnect(this._onMenuAboutToClose, this);\n menu.menuRequested.disconnect(this._onMenuMenuRequested, this);\n menu.title.changed.disconnect(this._onTitleChanged, this);\n // Remove the styling class from the menu.\n menu.removeClass('lm-MenuBar-menu');\n // Schedule an update of the items.\n if (update) {\n this.update();\n }\n }\n /**\n * Remove all menus from the menu bar.\n */\n clearMenus() {\n // Bail if there is nothing to remove.\n if (this._menus.length === 0) {\n return;\n }\n // Close the child menu before making changes.\n this._closeChildMenu();\n // Disconnect from the menu signals and remove the styling class.\n for (let menu of this._menus) {\n menu.aboutToClose.disconnect(this._onMenuAboutToClose, this);\n menu.menuRequested.disconnect(this._onMenuMenuRequested, this);\n menu.title.changed.disconnect(this._onTitleChanged, this);\n menu.removeClass('lm-MenuBar-menu');\n }\n // Clear the menus array.\n this._menus.length = 0;\n // Schedule an update of the items.\n this.update();\n }\n /**\n * Handle the DOM events for the menu bar.\n *\n * @param event - The DOM event sent to the menu bar.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the menu bar's DOM nodes. It\n * should not be called directly by user code.\n */\n handleEvent(event) {\n switch (event.type) {\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'focusout':\n this._evtFocusOut(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n }\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n onBeforeAttach(msg) {\n this.node.addEventListener('keydown', this);\n this.node.addEventListener('mousedown', this);\n this.node.addEventListener('mousemove', this);\n this.node.addEventListener('focusout', this);\n this.node.addEventListener('contextmenu', this);\n }\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n onAfterDetach(msg) {\n this.node.removeEventListener('keydown', this);\n this.node.removeEventListener('mousedown', this);\n this.node.removeEventListener('mousemove', this);\n this.node.removeEventListener('focusout', this);\n this.node.removeEventListener('contextmenu', this);\n this._closeChildMenu();\n }\n /**\n * A message handler invoked on an `'activate-request'` message.\n */\n onActivateRequest(msg) {\n if (this.isAttached) {\n this._focusItemAt(0);\n }\n }\n /**\n * A message handler invoked on a `'resize'` message.\n */\n onResize(msg) {\n this.update();\n super.onResize(msg);\n }\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n onUpdateRequest(msg) {\n var _a;\n let menus = this._menus;\n let renderer = this.renderer;\n let activeIndex = this._activeIndex;\n let tabFocusIndex = this._tabFocusIndex >= 0 && this._tabFocusIndex < menus.length\n ? this._tabFocusIndex\n : 0;\n let length = this._overflowIndex > -1 ? this._overflowIndex : menus.length;\n let totalMenuSize = 0;\n let isVisible = false;\n // Check that the overflow menu doesn't count\n length = this._overflowMenu !== null ? length - 1 : length;\n let content = new Array(length);\n // Render visible menus\n for (let i = 0; i < length; ++i) {\n content[i] = renderer.renderItem({\n title: menus[i].title,\n active: i === activeIndex,\n tabbable: i === tabFocusIndex,\n disabled: menus[i].items.length === 0,\n onfocus: () => {\n this._tabFocusIndex = i;\n this.activeIndex = i;\n }\n });\n // Calculate size of current menu\n totalMenuSize += this._menuItemSizes[i];\n // Check if overflow menu is already rendered\n if (menus[i].title.label === this._overflowMenuOptions.title) {\n isVisible = true;\n length--;\n }\n }\n // Render overflow menu if needed and active\n if (this._overflowMenuOptions.isVisible) {\n if (this._overflowIndex > -1 && !isVisible) {\n // Create overflow menu\n if (this._overflowMenu === null) {\n const overflowMenuTitle = (_a = this._overflowMenuOptions.title) !== null && _a !== void 0 ? _a : '...';\n this._overflowMenu = new Menu({ commands: new CommandRegistry() });\n this._overflowMenu.title.label = overflowMenuTitle;\n this._overflowMenu.title.mnemonic = 0;\n this.addMenu(this._overflowMenu, false);\n }\n // Move menus to overflow menu\n for (let i = menus.length - 2; i >= length; i--) {\n const submenu = this.menus[i];\n submenu.title.mnemonic = 0;\n this._overflowMenu.insertItem(0, {\n type: 'submenu',\n submenu: submenu\n });\n this.removeMenu(submenu, false);\n }\n content[length] = renderer.renderItem({\n title: this._overflowMenu.title,\n active: length === activeIndex && menus[length].items.length !== 0,\n tabbable: length === tabFocusIndex,\n disabled: menus[length].items.length === 0,\n onfocus: () => {\n this._tabFocusIndex = length;\n this.activeIndex = length;\n }\n });\n length++;\n }\n else if (this._overflowMenu !== null) {\n // Remove submenus from overflow menu\n let overflowMenuItems = this._overflowMenu.items;\n let screenSize = this.node.offsetWidth;\n let n = this._overflowMenu.items.length;\n for (let i = 0; i < n; ++i) {\n let index = menus.length - 1 - i;\n if (screenSize - totalMenuSize > this._menuItemSizes[index]) {\n let menu = overflowMenuItems[0].submenu;\n this._overflowMenu.removeItemAt(0);\n this.insertMenu(length, menu, false);\n content[length] = renderer.renderItem({\n title: menu.title,\n active: false,\n tabbable: length === tabFocusIndex,\n disabled: menus[length].items.length === 0,\n onfocus: () => {\n this._tabFocusIndex = length;\n this.activeIndex = length;\n }\n });\n length++;\n }\n }\n if (this._overflowMenu.items.length === 0) {\n this.removeMenu(this._overflowMenu, false);\n content.pop();\n this._overflowMenu = null;\n this._overflowIndex = -1;\n }\n }\n }\n VirtualDOM.render(content, this.contentNode);\n this._updateOverflowIndex();\n }\n /**\n * Calculate and update the current overflow index.\n */\n _updateOverflowIndex() {\n if (!this._overflowMenuOptions.isVisible) {\n return;\n }\n // Get elements visible in the main menu bar\n const itemMenus = this.contentNode.childNodes;\n let screenSize = this.node.offsetWidth;\n let totalMenuSize = 0;\n let index = -1;\n let n = itemMenus.length;\n if (this._menuItemSizes.length == 0) {\n // Check if it is the first resize and get info about menu items sizes\n for (let i = 0; i < n; i++) {\n let item = itemMenus[i];\n // Add sizes to array\n totalMenuSize += item.offsetWidth;\n this._menuItemSizes.push(item.offsetWidth);\n if (totalMenuSize > screenSize && index === -1) {\n index = i;\n }\n }\n }\n else {\n // Calculate current menu size\n for (let i = 0; i < this._menuItemSizes.length; i++) {\n totalMenuSize += this._menuItemSizes[i];\n if (totalMenuSize > screenSize) {\n index = i;\n break;\n }\n }\n }\n this._overflowIndex = index;\n }\n /**\n * Handle the `'keydown'` event for the menu bar.\n *\n * #### Notes\n * All keys are trapped except the tab key that is ignored.\n */\n _evtKeyDown(event) {\n // Fetch the key code for the event.\n let kc = event.keyCode;\n // Reset the active index on tab, but do not trap the tab key.\n if (kc === 9) {\n this.activeIndex = -1;\n return;\n }\n // A menu bar handles all other keydown events.\n event.preventDefault();\n event.stopPropagation();\n // Enter, Space, Up Arrow, Down Arrow\n if (kc === 13 || kc === 32 || kc === 38 || kc === 40) {\n // The active index may have changed (for example, user hovers over an\n // item with the mouse), so be sure to use the focus index.\n this.activeIndex = this._tabFocusIndex;\n if (this.activeIndex !== this._tabFocusIndex) {\n // Bail if the setter refused to set activeIndex to tabFocusIndex\n // because it means that the item at tabFocusIndex cannot be opened (for\n // example, it has an empty menu)\n return;\n }\n this.openActiveMenu();\n return;\n }\n // Escape\n if (kc === 27) {\n this._closeChildMenu();\n this._focusItemAt(this.activeIndex);\n return;\n }\n // Left or Right Arrow\n if (kc === 37 || kc === 39) {\n let direction = kc === 37 ? -1 : 1;\n let start = this._tabFocusIndex + direction;\n let n = this._menus.length;\n for (let i = 0; i < n; i++) {\n let index = (n + start + direction * i) % n;\n if (this._menus[index].items.length) {\n this._focusItemAt(index);\n return;\n }\n }\n return;\n }\n // Get the pressed key character.\n let key = getKeyboardLayout().keyForKeydownEvent(event);\n // Bail if the key is not valid.\n if (!key) {\n return;\n }\n // Search for the next best matching mnemonic item.\n let start = this._activeIndex + 1;\n let result = Private$3.findMnemonic(this._menus, key, start);\n // Handle the requested mnemonic based on the search results.\n // If exactly one mnemonic is matched, that menu is opened.\n // Otherwise, the next mnemonic is activated if available,\n // followed by the auto mnemonic if available.\n if (result.index !== -1 && !result.multiple) {\n this.activeIndex = result.index;\n this.openActiveMenu();\n }\n else if (result.index !== -1) {\n this.activeIndex = result.index;\n this._focusItemAt(this.activeIndex);\n }\n else if (result.auto !== -1) {\n this.activeIndex = result.auto;\n this._focusItemAt(this.activeIndex);\n }\n }\n /**\n * Handle the `'mousedown'` event for the menu bar.\n */\n _evtMouseDown(event) {\n // Bail if the mouse press was not on the menu bar. This can occur\n // when the document listener is installed for an active menu bar.\n if (!ElementExt.hitTest(this.node, event.clientX, event.clientY)) {\n return;\n }\n // Stop the propagation of the event. Immediate propagation is\n // also stopped so that an open menu does not handle the event.\n event.stopPropagation();\n event.stopImmediatePropagation();\n // Check if the mouse is over one of the menu items.\n let index = ArrayExt.findFirstIndex(this.contentNode.children, node => {\n return ElementExt.hitTest(node, event.clientX, event.clientY);\n });\n // If the press was not on an item, close the child menu.\n if (index === -1) {\n this._closeChildMenu();\n return;\n }\n // If the press was not the left mouse button, do nothing further.\n if (event.button !== 0) {\n return;\n }\n // Otherwise, toggle the open state of the child menu.\n if (this._childMenu) {\n this._closeChildMenu();\n this.activeIndex = index;\n }\n else {\n // If we don't call preventDefault() here, then the item in the menu\n // bar will take focus over the menu that is being opened.\n event.preventDefault();\n const position = this._positionForMenu(index);\n Menu.saveWindowData();\n // Begin DOM modifications.\n this.activeIndex = index;\n this._openChildMenu(position);\n }\n }\n /**\n * Handle the `'mousemove'` event for the menu bar.\n */\n _evtMouseMove(event) {\n // Check if the mouse is over one of the menu items.\n let index = ArrayExt.findFirstIndex(this.contentNode.children, node => {\n return ElementExt.hitTest(node, event.clientX, event.clientY);\n });\n // Bail early if the active index will not change.\n if (index === this._activeIndex) {\n return;\n }\n // Bail early if a child menu is open and the mouse is not over\n // an item. This allows the child menu to be kept open when the\n // mouse is over the empty part of the menu bar.\n if (index === -1 && this._childMenu) {\n return;\n }\n // Get position for the new menu >before< updating active index.\n const position = index >= 0 && this._childMenu ? this._positionForMenu(index) : null;\n // Before any modification, update window data.\n Menu.saveWindowData();\n // Begin DOM modifications.\n // Update the active index to the hovered item.\n this.activeIndex = index;\n // Open the new menu if a menu is already open.\n if (position) {\n this._openChildMenu(position);\n }\n }\n /**\n * Find initial position for the menu based on menubar item position.\n *\n * NOTE: this should be called before updating active index to avoid\n * an additional layout and style invalidation as changing active\n * index modifies DOM.\n */\n _positionForMenu(index) {\n let itemNode = this.contentNode.children[index];\n let { left, bottom } = itemNode.getBoundingClientRect();\n return {\n top: bottom,\n left\n };\n }\n /**\n * Handle the `'focusout'` event for the menu bar.\n */\n _evtFocusOut(event) {\n // Reset the active index if there is no open menu and the menubar is losing focus.\n if (!this._childMenu && !this.node.contains(event.relatedTarget)) {\n this.activeIndex = -1;\n }\n }\n /**\n * Focus an item in the menu bar.\n *\n * #### Notes\n * Does not open the associated menu.\n */\n _focusItemAt(index) {\n const itemNode = this.contentNode.childNodes[index];\n if (itemNode) {\n itemNode.focus();\n }\n }\n /**\n * Open the child menu at the active index immediately.\n *\n * If a different child menu is already open, it will be closed,\n * even if there is no active menu.\n */\n _openChildMenu(options = {}) {\n // If there is no active menu, close the current menu.\n let newMenu = this.activeMenu;\n if (!newMenu) {\n this._closeChildMenu();\n return;\n }\n // Bail if there is no effective menu change.\n let oldMenu = this._childMenu;\n if (oldMenu === newMenu) {\n return;\n }\n // Swap the internal menu reference.\n this._childMenu = newMenu;\n // Close the current menu, or setup for the new menu.\n if (oldMenu) {\n oldMenu.close();\n }\n else {\n document.addEventListener('mousedown', this, true);\n }\n // Update the tab focus index and ensure the menu bar is updated.\n this._tabFocusIndex = this.activeIndex;\n MessageLoop.sendMessage(this, Widget.Msg.UpdateRequest);\n // Get the positioning data for the new menu.\n let { left, top } = options;\n if (typeof left === 'undefined' || typeof top === 'undefined') {\n ({ left, top } = this._positionForMenu(this._activeIndex));\n }\n // Begin DOM modifications\n if (!oldMenu) {\n // Continue setup for new menu\n this.addClass('lm-mod-active');\n }\n // Open the new menu at the computed location.\n if (newMenu.items.length > 0) {\n newMenu.open(left, top, this._forceItemsPosition);\n }\n }\n /**\n * Close the child menu immediately.\n *\n * This is a no-op if a child menu is not open.\n */\n _closeChildMenu() {\n // Bail if no child menu is open.\n if (!this._childMenu) {\n return;\n }\n // Remove the active class from the menu bar.\n this.removeClass('lm-mod-active');\n // Remove the document listeners.\n document.removeEventListener('mousedown', this, true);\n // Clear the internal menu reference.\n let menu = this._childMenu;\n this._childMenu = null;\n // Close the menu.\n menu.close();\n // Reset the active index.\n this.activeIndex = -1;\n }\n /**\n * Handle the `aboutToClose` signal of a menu.\n */\n _onMenuAboutToClose(sender) {\n // Bail if the sender is not the child menu.\n if (sender !== this._childMenu) {\n return;\n }\n // Remove the active class from the menu bar.\n this.removeClass('lm-mod-active');\n // Remove the document listeners.\n document.removeEventListener('mousedown', this, true);\n // Clear the internal menu reference.\n this._childMenu = null;\n // Reset the active index.\n this.activeIndex = -1;\n }\n /**\n * Handle the `menuRequested` signal of a child menu.\n */\n _onMenuMenuRequested(sender, args) {\n // Bail if the sender is not the child menu.\n if (sender !== this._childMenu) {\n return;\n }\n // Look up the active index and menu count.\n let i = this._activeIndex;\n let n = this._menus.length;\n // Active the next requested index.\n switch (args) {\n case 'next':\n this.activeIndex = i === n - 1 ? 0 : i + 1;\n break;\n case 'previous':\n this.activeIndex = i === 0 ? n - 1 : i - 1;\n break;\n }\n // Open the active menu.\n this.openActiveMenu();\n }\n /**\n * Handle the `changed` signal of a title object.\n */\n _onTitleChanged() {\n this.update();\n }\n}\n/**\n * The namespace for the `MenuBar` class statics.\n */\n(function (MenuBar) {\n /**\n * The default implementation of `IRenderer`.\n *\n * #### Notes\n * Subclasses are free to reimplement rendering methods as needed.\n */\n class Renderer {\n /**\n * Render the virtual element for a menu bar item.\n *\n * @param data - The data to use for rendering the item.\n *\n * @returns A virtual element representing the item.\n */\n renderItem(data) {\n let className = this.createItemClass(data);\n let dataset = this.createItemDataset(data);\n let aria = this.createItemARIA(data);\n return h.li({\n className,\n dataset,\n ...(data.disabled ? {} : { tabindex: data.tabbable ? '0' : '-1' }),\n onfocus: data.onfocus,\n ...aria\n }, this.renderIcon(data), this.renderLabel(data));\n }\n /**\n * Render the icon element for a menu bar item.\n *\n * @param data - The data to use for rendering the icon.\n *\n * @returns A virtual element representing the item icon.\n */\n renderIcon(data) {\n let className = this.createIconClass(data);\n // If data.title.icon is undefined, it will be ignored.\n return h.div({ className }, data.title.icon, data.title.iconLabel);\n }\n /**\n * Render the label element for a menu item.\n *\n * @param data - The data to use for rendering the label.\n *\n * @returns A virtual element representing the item label.\n */\n renderLabel(data) {\n let content = this.formatLabel(data);\n return h.div({ className: 'lm-MenuBar-itemLabel' }, content);\n }\n /**\n * Create the class name for the menu bar item.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the menu item.\n */\n createItemClass(data) {\n let name = 'lm-MenuBar-item';\n if (data.title.className) {\n name += ` ${data.title.className}`;\n }\n if (data.active && !data.disabled) {\n name += ' lm-mod-active';\n }\n return name;\n }\n /**\n * Create the dataset for a menu bar item.\n *\n * @param data - The data to use for the item.\n *\n * @returns The dataset for the menu bar item.\n */\n createItemDataset(data) {\n return data.title.dataset;\n }\n /**\n * Create the aria attributes for menu bar item.\n *\n * @param data - The data to use for the aria attributes.\n *\n * @returns The aria attributes object for the item.\n */\n createItemARIA(data) {\n return {\n role: 'menuitem',\n 'aria-haspopup': 'true',\n 'aria-disabled': data.disabled ? 'true' : 'false'\n };\n }\n /**\n * Create the class name for the menu bar item icon.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the item icon.\n */\n createIconClass(data) {\n let name = 'lm-MenuBar-itemIcon';\n let extra = data.title.iconClass;\n return extra ? `${name} ${extra}` : name;\n }\n /**\n * Create the render content for the label node.\n *\n * @param data - The data to use for the label content.\n *\n * @returns The content to add to the label node.\n */\n formatLabel(data) {\n // Fetch the label text and mnemonic index.\n let { label, mnemonic } = data.title;\n // If the index is out of range, do not modify the label.\n if (mnemonic < 0 || mnemonic >= label.length) {\n return label;\n }\n // Split the label into parts.\n let prefix = label.slice(0, mnemonic);\n let suffix = label.slice(mnemonic + 1);\n let char = label[mnemonic];\n // Wrap the mnemonic character in a span.\n let span = h.span({ className: 'lm-MenuBar-itemMnemonic' }, char);\n // Return the content parts.\n return [prefix, span, suffix];\n }\n }\n MenuBar.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n MenuBar.defaultRenderer = new Renderer();\n})(MenuBar || (MenuBar = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private$3;\n(function (Private) {\n /**\n * Create the DOM node for a menu bar.\n */\n function createNode() {\n let node = document.createElement('div');\n let content = document.createElement('ul');\n content.className = 'lm-MenuBar-content';\n node.appendChild(content);\n content.setAttribute('role', 'menubar');\n return node;\n }\n Private.createNode = createNode;\n /**\n * Find the best matching mnemonic item.\n *\n * The search starts at the given index and wraps around.\n */\n function findMnemonic(menus, key, start) {\n // Setup the result variables.\n let index = -1;\n let auto = -1;\n let multiple = false;\n // Normalize the key to upper case.\n let upperKey = key.toUpperCase();\n // Search the items from the given start index.\n for (let i = 0, n = menus.length; i < n; ++i) {\n // Compute the wrapped index.\n let k = (i + start) % n;\n // Look up the menu title.\n let title = menus[k].title;\n // Ignore titles with an empty label.\n if (title.label.length === 0) {\n continue;\n }\n // Look up the mnemonic index for the label.\n let mn = title.mnemonic;\n // Handle a valid mnemonic index.\n if (mn >= 0 && mn < title.label.length) {\n if (title.label[mn].toUpperCase() === upperKey) {\n if (index === -1) {\n index = k;\n }\n else {\n multiple = true;\n }\n }\n continue;\n }\n // Finally, handle the auto index if possible.\n if (auto === -1 && title.label[0].toUpperCase() === upperKey) {\n auto = k;\n }\n }\n // Return the search results.\n return { index, multiple, auto };\n }\n Private.findMnemonic = findMnemonic;\n})(Private$3 || (Private$3 = {}));\n\n/**\n * A widget which implements a canonical scroll bar.\n */\nclass ScrollBar extends Widget {\n /**\n * Construct a new scroll bar.\n *\n * @param options - The options for initializing the scroll bar.\n */\n constructor(options = {}) {\n super({ node: Private$2.createNode() });\n /**\n * A timeout callback for repeating the mouse press.\n */\n this._onRepeat = () => {\n // Clear the repeat timer id.\n this._repeatTimer = -1;\n // Bail if the mouse has been released.\n if (!this._pressData) {\n return;\n }\n // Look up the part that was pressed.\n let part = this._pressData.part;\n // Bail if the thumb was pressed.\n if (part === 'thumb') {\n return;\n }\n // Schedule the timer for another repeat.\n this._repeatTimer = window.setTimeout(this._onRepeat, 20);\n // Get the current mouse position.\n let mouseX = this._pressData.mouseX;\n let mouseY = this._pressData.mouseY;\n // Handle a decrement button repeat.\n if (part === 'decrement') {\n // Bail if the mouse is not over the button.\n if (!ElementExt.hitTest(this.decrementNode, mouseX, mouseY)) {\n return;\n }\n // Emit the step requested signal.\n this._stepRequested.emit('decrement');\n // Finished.\n return;\n }\n // Handle an increment button repeat.\n if (part === 'increment') {\n // Bail if the mouse is not over the button.\n if (!ElementExt.hitTest(this.incrementNode, mouseX, mouseY)) {\n return;\n }\n // Emit the step requested signal.\n this._stepRequested.emit('increment');\n // Finished.\n return;\n }\n // Handle a track repeat.\n if (part === 'track') {\n // Bail if the mouse is not over the track.\n if (!ElementExt.hitTest(this.trackNode, mouseX, mouseY)) {\n return;\n }\n // Fetch the thumb node.\n let thumbNode = this.thumbNode;\n // Bail if the mouse is over the thumb.\n if (ElementExt.hitTest(thumbNode, mouseX, mouseY)) {\n return;\n }\n // Fetch the client rect for the thumb.\n let thumbRect = thumbNode.getBoundingClientRect();\n // Determine the direction for the page request.\n let dir;\n if (this._orientation === 'horizontal') {\n dir = mouseX < thumbRect.left ? 'decrement' : 'increment';\n }\n else {\n dir = mouseY < thumbRect.top ? 'decrement' : 'increment';\n }\n // Emit the page requested signal.\n this._pageRequested.emit(dir);\n // Finished.\n return;\n }\n };\n this._value = 0;\n this._page = 10;\n this._maximum = 100;\n this._repeatTimer = -1;\n this._pressData = null;\n this._thumbMoved = new Signal(this);\n this._stepRequested = new Signal(this);\n this._pageRequested = new Signal(this);\n this.addClass('lm-ScrollBar');\n this.setFlag(Widget.Flag.DisallowLayout);\n // Set the orientation.\n this._orientation = options.orientation || 'vertical';\n this.dataset['orientation'] = this._orientation;\n // Parse the rest of the options.\n if (options.maximum !== undefined) {\n this._maximum = Math.max(0, options.maximum);\n }\n if (options.page !== undefined) {\n this._page = Math.max(0, options.page);\n }\n if (options.value !== undefined) {\n this._value = Math.max(0, Math.min(options.value, this._maximum));\n }\n }\n /**\n * A signal emitted when the user moves the scroll thumb.\n *\n * #### Notes\n * The payload is the current value of the scroll bar.\n */\n get thumbMoved() {\n return this._thumbMoved;\n }\n /**\n * A signal emitted when the user clicks a step button.\n *\n * #### Notes\n * The payload is whether a decrease or increase is requested.\n */\n get stepRequested() {\n return this._stepRequested;\n }\n /**\n * A signal emitted when the user clicks the scroll track.\n *\n * #### Notes\n * The payload is whether a decrease or increase is requested.\n */\n get pageRequested() {\n return this._pageRequested;\n }\n /**\n * Get the orientation of the scroll bar.\n */\n get orientation() {\n return this._orientation;\n }\n /**\n * Set the orientation of the scroll bar.\n */\n set orientation(value) {\n // Do nothing if the orientation does not change.\n if (this._orientation === value) {\n return;\n }\n // Release the mouse before making changes.\n this._releaseMouse();\n // Update the internal orientation.\n this._orientation = value;\n this.dataset['orientation'] = value;\n // Schedule an update the scroll bar.\n this.update();\n }\n /**\n * Get the current value of the scroll bar.\n */\n get value() {\n return this._value;\n }\n /**\n * Set the current value of the scroll bar.\n *\n * #### Notes\n * The value will be clamped to the range `[0, maximum]`.\n */\n set value(value) {\n // Clamp the value to the allowable range.\n value = Math.max(0, Math.min(value, this._maximum));\n // Do nothing if the value does not change.\n if (this._value === value) {\n return;\n }\n // Update the internal value.\n this._value = value;\n // Schedule an update the scroll bar.\n this.update();\n }\n /**\n * Get the page size of the scroll bar.\n *\n * #### Notes\n * The page size is the amount of visible content in the scrolled\n * region, expressed in data units. It determines the size of the\n * scroll bar thumb.\n */\n get page() {\n return this._page;\n }\n /**\n * Set the page size of the scroll bar.\n *\n * #### Notes\n * The page size will be clamped to the range `[0, Infinity]`.\n */\n set page(value) {\n // Clamp the page size to the allowable range.\n value = Math.max(0, value);\n // Do nothing if the value does not change.\n if (this._page === value) {\n return;\n }\n // Update the internal page size.\n this._page = value;\n // Schedule an update the scroll bar.\n this.update();\n }\n /**\n * Get the maximum value of the scroll bar.\n */\n get maximum() {\n return this._maximum;\n }\n /**\n * Set the maximum value of the scroll bar.\n *\n * #### Notes\n * The max size will be clamped to the range `[0, Infinity]`.\n */\n set maximum(value) {\n // Clamp the value to the allowable range.\n value = Math.max(0, value);\n // Do nothing if the value does not change.\n if (this._maximum === value) {\n return;\n }\n // Update the internal values.\n this._maximum = value;\n // Clamp the current value to the new range.\n this._value = Math.min(this._value, value);\n // Schedule an update the scroll bar.\n this.update();\n }\n /**\n * The scroll bar decrement button node.\n *\n * #### Notes\n * Modifying this node directly can lead to undefined behavior.\n */\n get decrementNode() {\n return this.node.getElementsByClassName('lm-ScrollBar-button')[0];\n }\n /**\n * The scroll bar increment button node.\n *\n * #### Notes\n * Modifying this node directly can lead to undefined behavior.\n */\n get incrementNode() {\n return this.node.getElementsByClassName('lm-ScrollBar-button')[1];\n }\n /**\n * The scroll bar track node.\n *\n * #### Notes\n * Modifying this node directly can lead to undefined behavior.\n */\n get trackNode() {\n return this.node.getElementsByClassName('lm-ScrollBar-track')[0];\n }\n /**\n * The scroll bar thumb node.\n *\n * #### Notes\n * Modifying this node directly can lead to undefined behavior.\n */\n get thumbNode() {\n return this.node.getElementsByClassName('lm-ScrollBar-thumb')[0];\n }\n /**\n * Handle the DOM events for the scroll bar.\n *\n * @param event - The DOM event sent to the scroll bar.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the scroll bar's DOM node.\n *\n * This should not be called directly by user code.\n */\n handleEvent(event) {\n switch (event.type) {\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n }\n /**\n * A method invoked on a 'before-attach' message.\n */\n onBeforeAttach(msg) {\n this.node.addEventListener('mousedown', this);\n this.update();\n }\n /**\n * A method invoked on an 'after-detach' message.\n */\n onAfterDetach(msg) {\n this.node.removeEventListener('mousedown', this);\n this._releaseMouse();\n }\n /**\n * A method invoked on an 'update-request' message.\n */\n onUpdateRequest(msg) {\n // Convert the value and page into percentages.\n let value = (this._value * 100) / this._maximum;\n let page = (this._page * 100) / (this._page + this._maximum);\n // Clamp the value and page to the relevant range.\n value = Math.max(0, Math.min(value, 100));\n page = Math.max(0, Math.min(page, 100));\n // Fetch the thumb style.\n let thumbStyle = this.thumbNode.style;\n // Update the thumb style for the current orientation.\n if (this._orientation === 'horizontal') {\n thumbStyle.top = '';\n thumbStyle.height = '';\n thumbStyle.left = `${value}%`;\n thumbStyle.width = `${page}%`;\n thumbStyle.transform = `translate(${-value}%, 0%)`;\n }\n else {\n thumbStyle.left = '';\n thumbStyle.width = '';\n thumbStyle.top = `${value}%`;\n thumbStyle.height = `${page}%`;\n thumbStyle.transform = `translate(0%, ${-value}%)`;\n }\n }\n /**\n * Handle the `'keydown'` event for the scroll bar.\n */\n _evtKeyDown(event) {\n // Stop all input events during drag.\n event.preventDefault();\n event.stopPropagation();\n // Ignore anything except the `Escape` key.\n if (event.keyCode !== 27) {\n return;\n }\n // Fetch the previous scroll value.\n let value = this._pressData ? this._pressData.value : -1;\n // Release the mouse.\n this._releaseMouse();\n // Restore the old scroll value if possible.\n if (value !== -1) {\n this._moveThumb(value);\n }\n }\n /**\n * Handle the `'mousedown'` event for the scroll bar.\n */\n _evtMouseDown(event) {\n // Do nothing if it's not a left mouse press.\n if (event.button !== 0) {\n return;\n }\n // Send an activate request to the scroll bar. This can be\n // used by message hooks to activate something relevant.\n this.activate();\n // Do nothing if the mouse is already captured.\n if (this._pressData) {\n return;\n }\n // Find the pressed scroll bar part.\n let part = Private$2.findPart(this, event.target);\n // Do nothing if the part is not of interest.\n if (!part) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Override the mouse cursor.\n let override = Drag.overrideCursor('default');\n // Set up the press data.\n this._pressData = {\n part,\n override,\n delta: -1,\n value: -1,\n mouseX: event.clientX,\n mouseY: event.clientY\n };\n // Add the extra event listeners.\n document.addEventListener('mousemove', this, true);\n document.addEventListener('mouseup', this, true);\n document.addEventListener('keydown', this, true);\n document.addEventListener('contextmenu', this, true);\n // Handle a thumb press.\n if (part === 'thumb') {\n // Fetch the thumb node.\n let thumbNode = this.thumbNode;\n // Fetch the client rect for the thumb.\n let thumbRect = thumbNode.getBoundingClientRect();\n // Update the press data delta for the current orientation.\n if (this._orientation === 'horizontal') {\n this._pressData.delta = event.clientX - thumbRect.left;\n }\n else {\n this._pressData.delta = event.clientY - thumbRect.top;\n }\n // Add the active class to the thumb node.\n thumbNode.classList.add('lm-mod-active');\n // Store the current value in the press data.\n this._pressData.value = this._value;\n // Finished.\n return;\n }\n // Handle a track press.\n if (part === 'track') {\n // Fetch the client rect for the thumb.\n let thumbRect = this.thumbNode.getBoundingClientRect();\n // Determine the direction for the page request.\n let dir;\n if (this._orientation === 'horizontal') {\n dir = event.clientX < thumbRect.left ? 'decrement' : 'increment';\n }\n else {\n dir = event.clientY < thumbRect.top ? 'decrement' : 'increment';\n }\n // Start the repeat timer.\n this._repeatTimer = window.setTimeout(this._onRepeat, 350);\n // Emit the page requested signal.\n this._pageRequested.emit(dir);\n // Finished.\n return;\n }\n // Handle a decrement button press.\n if (part === 'decrement') {\n // Add the active class to the decrement node.\n this.decrementNode.classList.add('lm-mod-active');\n // Start the repeat timer.\n this._repeatTimer = window.setTimeout(this._onRepeat, 350);\n // Emit the step requested signal.\n this._stepRequested.emit('decrement');\n // Finished.\n return;\n }\n // Handle an increment button press.\n if (part === 'increment') {\n // Add the active class to the increment node.\n this.incrementNode.classList.add('lm-mod-active');\n // Start the repeat timer.\n this._repeatTimer = window.setTimeout(this._onRepeat, 350);\n // Emit the step requested signal.\n this._stepRequested.emit('increment');\n // Finished.\n return;\n }\n }\n /**\n * Handle the `'mousemove'` event for the scroll bar.\n */\n _evtMouseMove(event) {\n // Do nothing if no drag is in progress.\n if (!this._pressData) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Update the mouse position.\n this._pressData.mouseX = event.clientX;\n this._pressData.mouseY = event.clientY;\n // Bail if the thumb is not being dragged.\n if (this._pressData.part !== 'thumb') {\n return;\n }\n // Get the client rect for the thumb and track.\n let thumbRect = this.thumbNode.getBoundingClientRect();\n let trackRect = this.trackNode.getBoundingClientRect();\n // Fetch the scroll geometry based on the orientation.\n let trackPos;\n let trackSpan;\n if (this._orientation === 'horizontal') {\n trackPos = event.clientX - trackRect.left - this._pressData.delta;\n trackSpan = trackRect.width - thumbRect.width;\n }\n else {\n trackPos = event.clientY - trackRect.top - this._pressData.delta;\n trackSpan = trackRect.height - thumbRect.height;\n }\n // Compute the desired value from the scroll geometry.\n let value = trackSpan === 0 ? 0 : (trackPos * this._maximum) / trackSpan;\n // Move the thumb to the computed value.\n this._moveThumb(value);\n }\n /**\n * Handle the `'mouseup'` event for the scroll bar.\n */\n _evtMouseUp(event) {\n // Do nothing if it's not a left mouse release.\n if (event.button !== 0) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Release the mouse.\n this._releaseMouse();\n }\n /**\n * Release the mouse and restore the node states.\n */\n _releaseMouse() {\n // Bail if there is no press data.\n if (!this._pressData) {\n return;\n }\n // Clear the repeat timer.\n clearTimeout(this._repeatTimer);\n this._repeatTimer = -1;\n // Clear the press data.\n this._pressData.override.dispose();\n this._pressData = null;\n // Remove the extra event listeners.\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('contextmenu', this, true);\n // Remove the active classes from the nodes.\n this.thumbNode.classList.remove('lm-mod-active');\n this.decrementNode.classList.remove('lm-mod-active');\n this.incrementNode.classList.remove('lm-mod-active');\n }\n /**\n * Move the thumb to the specified position.\n */\n _moveThumb(value) {\n // Clamp the value to the allowed range.\n value = Math.max(0, Math.min(value, this._maximum));\n // Bail if the value does not change.\n if (this._value === value) {\n return;\n }\n // Update the internal value.\n this._value = value;\n // Schedule an update of the scroll bar.\n this.update();\n // Emit the thumb moved signal.\n this._thumbMoved.emit(value);\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private$2;\n(function (Private) {\n /**\n * Create the DOM node for a scroll bar.\n */\n function createNode() {\n let node = document.createElement('div');\n let decrement = document.createElement('div');\n let increment = document.createElement('div');\n let track = document.createElement('div');\n let thumb = document.createElement('div');\n decrement.className = 'lm-ScrollBar-button';\n increment.className = 'lm-ScrollBar-button';\n decrement.dataset['action'] = 'decrement';\n increment.dataset['action'] = 'increment';\n track.className = 'lm-ScrollBar-track';\n thumb.className = 'lm-ScrollBar-thumb';\n track.appendChild(thumb);\n node.appendChild(decrement);\n node.appendChild(track);\n node.appendChild(increment);\n return node;\n }\n Private.createNode = createNode;\n /**\n * Find the scroll bar part which contains the given target.\n */\n function findPart(scrollBar, target) {\n // Test the thumb.\n if (scrollBar.thumbNode.contains(target)) {\n return 'thumb';\n }\n // Test the track.\n if (scrollBar.trackNode.contains(target)) {\n return 'track';\n }\n // Test the decrement button.\n if (scrollBar.decrementNode.contains(target)) {\n return 'decrement';\n }\n // Test the increment button.\n if (scrollBar.incrementNode.contains(target)) {\n return 'increment';\n }\n // Indicate no match.\n return null;\n }\n Private.findPart = findPart;\n})(Private$2 || (Private$2 = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A concrete layout implementation which holds a single widget.\n *\n * #### Notes\n * This class is useful for creating simple container widgets which\n * hold a single child. The child should be positioned with CSS.\n */\nclass SingletonLayout extends Layout {\n constructor() {\n super(...arguments);\n this._widget = null;\n }\n /**\n * Dispose of the resources held by the layout.\n */\n dispose() {\n if (this._widget) {\n let widget = this._widget;\n this._widget = null;\n widget.dispose();\n }\n super.dispose();\n }\n /**\n * Get the child widget for the layout.\n */\n get widget() {\n return this._widget;\n }\n /**\n * Set the child widget for the layout.\n *\n * #### Notes\n * Setting the child widget will cause the old child widget to be\n * automatically disposed. If that is not desired, set the parent\n * of the old child to `null` before assigning a new child.\n */\n set widget(widget) {\n // Remove the widget from its current parent. This is a no-op\n // if the widget's parent is already the layout parent widget.\n if (widget) {\n widget.parent = this.parent;\n }\n // Bail early if the widget does not change.\n if (this._widget === widget) {\n return;\n }\n // Dispose of the old child widget.\n if (this._widget) {\n this._widget.dispose();\n }\n // Update the internal widget.\n this._widget = widget;\n // Attach the new child widget if needed.\n if (this.parent && widget) {\n this.attachWidget(widget);\n }\n }\n /**\n * Create an iterator over the widgets in the layout.\n *\n * @returns A new iterator over the widgets in the layout.\n */\n *[Symbol.iterator]() {\n if (this._widget) {\n yield this._widget;\n }\n }\n /**\n * Remove a widget from the layout.\n *\n * @param widget - The widget to remove from the layout.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n */\n removeWidget(widget) {\n // Bail early if the widget does not exist in the layout.\n if (this._widget !== widget) {\n return;\n }\n // Clear the internal widget.\n this._widget = null;\n // If the layout is parented, detach the widget from the DOM.\n if (this.parent) {\n this.detachWidget(widget);\n }\n }\n /**\n * Perform layout initialization which requires the parent widget.\n */\n init() {\n super.init();\n for (const widget of this) {\n this.attachWidget(widget);\n }\n }\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This method is called automatically by the single layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation adds the widgets's node to the parent's\n * node at the proper location, and sends the appropriate attach\n * messages to the widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is added to the parent's node.\n */\n attachWidget(widget) {\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);\n }\n }\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This method is called automatically by the single layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation removes the widget's node from the\n * parent's node, and sends the appropriate detach messages to the\n * widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is removed from the parent's node.\n */\n detachWidget(widget) {\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A layout where visible widgets are stacked atop one another.\n *\n * #### Notes\n * The Z-order of the visible widgets follows their layout order.\n */\nclass StackedLayout extends PanelLayout {\n constructor(options = {}) {\n super(options);\n this._dirty = false;\n this._items = [];\n this._box = null;\n this._hiddenMode =\n options.hiddenMode !== undefined\n ? options.hiddenMode\n : Widget.HiddenMode.Display;\n }\n /**\n * The method for hiding widgets.\n *\n * #### Notes\n * If there is only one child widget, `Display` hiding mode will be used\n * regardless of this setting.\n */\n get hiddenMode() {\n return this._hiddenMode;\n }\n /**\n * Set the method for hiding widgets.\n *\n * #### Notes\n * If there is only one child widget, `Display` hiding mode will be used\n * regardless of this setting.\n */\n set hiddenMode(v) {\n if (this._hiddenMode === v) {\n return;\n }\n this._hiddenMode = v;\n if (this.widgets.length > 1) {\n this.widgets.forEach(w => {\n w.hiddenMode = this._hiddenMode;\n });\n }\n }\n /**\n * Dispose of the resources held by the layout.\n */\n dispose() {\n // Dispose of the layout items.\n for (const item of this._items) {\n item.dispose();\n }\n // Clear the layout state.\n this._box = null;\n this._items.length = 0;\n // Dispose of the rest of the layout.\n super.dispose();\n }\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n attachWidget(index, widget) {\n // Using transform create an additional layer in the pixel pipeline\n // to limit the number of layer, it is set only if there is more than one widget.\n if (this._hiddenMode === Widget.HiddenMode.Scale &&\n this._items.length > 0) {\n if (this._items.length === 1) {\n this.widgets[0].hiddenMode = Widget.HiddenMode.Scale;\n }\n widget.hiddenMode = Widget.HiddenMode.Scale;\n }\n else {\n widget.hiddenMode = Widget.HiddenMode.Display;\n }\n // Create and add a new layout item for the widget.\n ArrayExt.insert(this._items, index, new LayoutItem(widget));\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n }\n /**\n * Move a widget in the parent's DOM node.\n *\n * @param fromIndex - The previous index of the widget in the layout.\n *\n * @param toIndex - The current index of the widget in the layout.\n *\n * @param widget - The widget to move in the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n moveWidget(fromIndex, toIndex, widget) {\n // Move the layout item for the widget.\n ArrayExt.move(this._items, fromIndex, toIndex);\n // Post an update request for the parent widget.\n this.parent.update();\n }\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param index - The previous index of the widget in the layout.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n detachWidget(index, widget) {\n // Remove the layout item for the widget.\n let item = ArrayExt.removeAt(this._items, index);\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);\n }\n // Reset the z-index for the widget.\n item.widget.node.style.zIndex = '';\n // Reset the hidden mode for the widget.\n if (this._hiddenMode === Widget.HiddenMode.Scale) {\n widget.hiddenMode = Widget.HiddenMode.Display;\n // Reset the hidden mode for the first widget if necessary.\n if (this._items.length === 1) {\n this._items[0].widget.hiddenMode = Widget.HiddenMode.Display;\n }\n }\n // Dispose of the layout item.\n item.dispose();\n // Post a fit request for the parent widget.\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n onBeforeShow(msg) {\n super.onBeforeShow(msg);\n this.parent.update();\n }\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n onBeforeAttach(msg) {\n super.onBeforeAttach(msg);\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n onChildShown(msg) {\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n onChildHidden(msg) {\n this.parent.fit();\n }\n /**\n * A message handler invoked on a `'resize'` message.\n */\n onResize(msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n }\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n onUpdateRequest(msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n }\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n onFitRequest(msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n }\n /**\n * Fit the layout to the total size required by the widgets.\n */\n _fit() {\n // Set up the computed minimum size.\n let minW = 0;\n let minH = 0;\n // Update the computed minimum size.\n for (let i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n let item = this._items[i];\n // Ignore hidden items.\n if (item.isHidden) {\n continue;\n }\n // Update the size limits for the item.\n item.fit();\n // Update the computed minimum size.\n minW = Math.max(minW, item.minWidth);\n minH = Math.max(minH, item.minHeight);\n }\n // Update the box sizing and add it to the computed min size.\n let box = (this._box = ElementExt.boxSizing(this.parent.node));\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n let style = this.parent.node.style;\n style.minWidth = `${minW}px`;\n style.minHeight = `${minH}px`;\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n MessageLoop.sendMessage(this.parent.parent, Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n MessageLoop.sendMessage(this.parent, Widget.Msg.UpdateRequest);\n }\n }\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n _update(offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Compute the visible item count.\n let nVisible = 0;\n for (let i = 0, n = this._items.length; i < n; ++i) {\n nVisible += +!this._items[i].isHidden;\n }\n // Bail early if there are no visible items to layout.\n if (nVisible === 0) {\n return;\n }\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = ElementExt.boxSizing(this.parent.node);\n }\n // Compute the actual layout bounds adjusted for border and padding.\n let top = this._box.paddingTop;\n let left = this._box.paddingLeft;\n let width = offsetWidth - this._box.horizontalSum;\n let height = offsetHeight - this._box.verticalSum;\n // Update the widget stacking order and layout geometry.\n for (let i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n let item = this._items[i];\n // Ignore hidden items.\n if (item.isHidden) {\n continue;\n }\n // Set the z-index for the widget.\n item.widget.node.style.zIndex = `${i}`;\n // Update the item geometry.\n item.update(left, top, width, height);\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A panel where visible widgets are stacked atop one another.\n *\n * #### Notes\n * This class provides a convenience wrapper around a {@link StackedLayout}.\n */\nclass StackedPanel extends Panel {\n /**\n * Construct a new stacked panel.\n *\n * @param options - The options for initializing the panel.\n */\n constructor(options = {}) {\n super({ layout: Private$1.createLayout(options) });\n this._widgetRemoved = new Signal(this);\n this.addClass('lm-StackedPanel');\n }\n /**\n * The method for hiding widgets.\n *\n * #### Notes\n * If there is only one child widget, `Display` hiding mode will be used\n * regardless of this setting.\n */\n get hiddenMode() {\n return this.layout.hiddenMode;\n }\n /**\n * Set the method for hiding widgets.\n *\n * #### Notes\n * If there is only one child widget, `Display` hiding mode will be used\n * regardless of this setting.\n */\n set hiddenMode(v) {\n this.layout.hiddenMode = v;\n }\n /**\n * A signal emitted when a widget is removed from a stacked panel.\n */\n get widgetRemoved() {\n return this._widgetRemoved;\n }\n /**\n * A message handler invoked on a `'child-added'` message.\n */\n onChildAdded(msg) {\n msg.child.addClass('lm-StackedPanel-child');\n }\n /**\n * A message handler invoked on a `'child-removed'` message.\n */\n onChildRemoved(msg) {\n msg.child.removeClass('lm-StackedPanel-child');\n this._widgetRemoved.emit(msg.child);\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private$1;\n(function (Private) {\n /**\n * Create a stacked layout for the given panel options.\n */\n function createLayout(options) {\n return options.layout || new StackedLayout();\n }\n Private.createLayout = createLayout;\n})(Private$1 || (Private$1 = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A widget which combines a `TabBar` and a `StackedPanel`.\n *\n * #### Notes\n * This is a simple panel which handles the common case of a tab bar\n * placed next to a content area. The selected tab controls the widget\n * which is shown in the content area.\n *\n * For use cases which require more control than is provided by this\n * panel, the `TabBar` widget may be used independently.\n */\nclass TabPanel extends Widget {\n /**\n * Construct a new tab panel.\n *\n * @param options - The options for initializing the tab panel.\n */\n constructor(options = {}) {\n super();\n this._currentChanged = new Signal(this);\n this._addRequested = new Signal(this);\n this.addClass('lm-TabPanel');\n // Create the tab bar and stacked panel.\n this.tabBar = new TabBar(options);\n this.tabBar.addClass('lm-TabPanel-tabBar');\n this.stackedPanel = new StackedPanel();\n this.stackedPanel.addClass('lm-TabPanel-stackedPanel');\n // Connect the tab bar signal handlers.\n this.tabBar.tabMoved.connect(this._onTabMoved, this);\n this.tabBar.currentChanged.connect(this._onCurrentChanged, this);\n this.tabBar.tabCloseRequested.connect(this._onTabCloseRequested, this);\n this.tabBar.tabActivateRequested.connect(this._onTabActivateRequested, this);\n this.tabBar.addRequested.connect(this._onTabAddRequested, this);\n // Connect the stacked panel signal handlers.\n this.stackedPanel.widgetRemoved.connect(this._onWidgetRemoved, this);\n // Get the data related to the placement.\n this._tabPlacement = options.tabPlacement || 'top';\n let direction = Private.directionFromPlacement(this._tabPlacement);\n let orientation = Private.orientationFromPlacement(this._tabPlacement);\n // Configure the tab bar for the placement.\n this.tabBar.orientation = orientation;\n this.tabBar.dataset['placement'] = this._tabPlacement;\n // Create the box layout.\n let layout = new BoxLayout({ direction, spacing: 0 });\n // Set the stretch factors for the child widgets.\n BoxLayout.setStretch(this.tabBar, 0);\n BoxLayout.setStretch(this.stackedPanel, 1);\n // Add the child widgets to the layout.\n layout.addWidget(this.tabBar);\n layout.addWidget(this.stackedPanel);\n // Install the layout on the tab panel.\n this.layout = layout;\n }\n /**\n * A signal emitted when the current tab is changed.\n *\n * #### Notes\n * This signal is emitted when the currently selected tab is changed\n * either through user or programmatic interaction.\n *\n * Notably, this signal is not emitted when the index of the current\n * tab changes due to tabs being inserted, removed, or moved. It is\n * only emitted when the actual current tab node is changed.\n */\n get currentChanged() {\n return this._currentChanged;\n }\n /**\n * Get the index of the currently selected tab.\n *\n * #### Notes\n * This will be `-1` if no tab is selected.\n */\n get currentIndex() {\n return this.tabBar.currentIndex;\n }\n /**\n * Set the index of the currently selected tab.\n *\n * #### Notes\n * If the index is out of range, it will be set to `-1`.\n */\n set currentIndex(value) {\n this.tabBar.currentIndex = value;\n }\n /**\n * Get the currently selected widget.\n *\n * #### Notes\n * This will be `null` if there is no selected tab.\n */\n get currentWidget() {\n let title = this.tabBar.currentTitle;\n return title ? title.owner : null;\n }\n /**\n * Set the currently selected widget.\n *\n * #### Notes\n * If the widget is not in the panel, it will be set to `null`.\n */\n set currentWidget(value) {\n this.tabBar.currentTitle = value ? value.title : null;\n }\n /**\n * Get the whether the tabs are movable by the user.\n *\n * #### Notes\n * Tabs can always be moved programmatically.\n */\n get tabsMovable() {\n return this.tabBar.tabsMovable;\n }\n /**\n * Set the whether the tabs are movable by the user.\n *\n * #### Notes\n * Tabs can always be moved programmatically.\n */\n set tabsMovable(value) {\n this.tabBar.tabsMovable = value;\n }\n /**\n * Get the whether the add button is enabled.\n *\n */\n get addButtonEnabled() {\n return this.tabBar.addButtonEnabled;\n }\n /**\n * Set the whether the add button is enabled.\n *\n */\n set addButtonEnabled(value) {\n this.tabBar.addButtonEnabled = value;\n }\n /**\n * Get the tab placement for the tab panel.\n *\n * #### Notes\n * This controls the position of the tab bar relative to the content.\n */\n get tabPlacement() {\n return this._tabPlacement;\n }\n /**\n * Set the tab placement for the tab panel.\n *\n * #### Notes\n * This controls the position of the tab bar relative to the content.\n */\n set tabPlacement(value) {\n // Bail if the placement does not change.\n if (this._tabPlacement === value) {\n return;\n }\n // Update the internal value.\n this._tabPlacement = value;\n // Get the values related to the placement.\n let direction = Private.directionFromPlacement(value);\n let orientation = Private.orientationFromPlacement(value);\n // Configure the tab bar for the placement.\n this.tabBar.orientation = orientation;\n this.tabBar.dataset['placement'] = value;\n // Update the layout direction.\n this.layout.direction = direction;\n }\n /**\n * A signal emitted when the add button on a tab bar is clicked.\n *\n */\n get addRequested() {\n return this._addRequested;\n }\n /**\n * A read-only array of the widgets in the panel.\n */\n get widgets() {\n return this.stackedPanel.widgets;\n }\n /**\n * Add a widget to the end of the tab panel.\n *\n * @param widget - The widget to add to the tab panel.\n *\n * #### Notes\n * If the widget is already contained in the panel, it will be moved.\n *\n * The widget's `title` is used to populate the tab.\n */\n addWidget(widget) {\n this.insertWidget(this.widgets.length, widget);\n }\n /**\n * Insert a widget into the tab panel at a specified index.\n *\n * @param index - The index at which to insert the widget.\n *\n * @param widget - The widget to insert into to the tab panel.\n *\n * #### Notes\n * If the widget is already contained in the panel, it will be moved.\n *\n * The widget's `title` is used to populate the tab.\n */\n insertWidget(index, widget) {\n if (widget !== this.currentWidget) {\n widget.hide();\n }\n this.stackedPanel.insertWidget(index, widget);\n this.tabBar.insertTab(index, widget.title);\n widget.node.setAttribute('role', 'tabpanel');\n let renderer = this.tabBar.renderer;\n if (renderer instanceof TabBar.Renderer) {\n let tabId = renderer.createTabKey({\n title: widget.title,\n current: false,\n zIndex: 0\n });\n widget.node.setAttribute('aria-labelledby', tabId);\n }\n }\n /**\n * Handle the `currentChanged` signal from the tab bar.\n */\n _onCurrentChanged(sender, args) {\n // Extract the previous and current title from the args.\n let { previousIndex, previousTitle, currentIndex, currentTitle } = args;\n // Extract the widgets from the titles.\n let previousWidget = previousTitle ? previousTitle.owner : null;\n let currentWidget = currentTitle ? currentTitle.owner : null;\n // Hide the previous widget.\n if (previousWidget) {\n previousWidget.hide();\n }\n // Show the current widget.\n if (currentWidget) {\n currentWidget.show();\n }\n // Emit the `currentChanged` signal for the tab panel.\n this._currentChanged.emit({\n previousIndex,\n previousWidget,\n currentIndex,\n currentWidget\n });\n // Flush the message loop on IE and Edge to prevent flicker.\n if (Platform.IS_EDGE || Platform.IS_IE) {\n MessageLoop.flush();\n }\n }\n /**\n * Handle the `tabAddRequested` signal from the tab bar.\n */\n _onTabAddRequested(sender, args) {\n this._addRequested.emit(sender);\n }\n /**\n * Handle the `tabActivateRequested` signal from the tab bar.\n */\n _onTabActivateRequested(sender, args) {\n args.title.owner.activate();\n }\n /**\n * Handle the `tabCloseRequested` signal from the tab bar.\n */\n _onTabCloseRequested(sender, args) {\n args.title.owner.close();\n }\n /**\n * Handle the `tabMoved` signal from the tab bar.\n */\n _onTabMoved(sender, args) {\n this.stackedPanel.insertWidget(args.toIndex, args.title.owner);\n }\n /**\n * Handle the `widgetRemoved` signal from the stacked panel.\n */\n _onWidgetRemoved(sender, widget) {\n widget.node.removeAttribute('role');\n widget.node.removeAttribute('aria-labelledby');\n this.tabBar.removeTab(widget.title);\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Convert a tab placement to tab bar orientation.\n */\n function orientationFromPlacement(plc) {\n return placementToOrientationMap[plc];\n }\n Private.orientationFromPlacement = orientationFromPlacement;\n /**\n * Convert a tab placement to a box layout direction.\n */\n function directionFromPlacement(plc) {\n return placementToDirectionMap[plc];\n }\n Private.directionFromPlacement = directionFromPlacement;\n /**\n * A mapping of tab placement to tab bar orientation.\n */\n const placementToOrientationMap = {\n top: 'horizontal',\n left: 'vertical',\n right: 'vertical',\n bottom: 'horizontal'\n };\n /**\n * A mapping of tab placement to box layout direction.\n */\n const placementToDirectionMap = {\n top: 'top-to-bottom',\n left: 'left-to-right',\n right: 'right-to-left',\n bottom: 'bottom-to-top'\n };\n})(Private || (Private = {}));\n\nexport { AccordionLayout, AccordionPanel, BoxEngine, BoxLayout, BoxPanel, BoxSizer, CommandPalette, ContextMenu, DockLayout, DockPanel, FocusTracker, GridLayout, Layout, LayoutItem, Menu, MenuBar, Panel, PanelLayout, ScrollBar, SingletonLayout, SplitLayout, SplitPanel, StackedLayout, StackedPanel, TabBar, TabPanel, Title, Widget };\n//# sourceMappingURL=index.es6.js.map\n","import { CommandRegistry } from '@lumino/commands';\nimport { PromiseDelegate, PluginRegistry } from '@lumino/coreutils';\nimport { ContextMenu, Widget } from '@lumino/widgets';\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module application\n */\n/**\n * A class for creating pluggable applications.\n *\n * @typeParam T - The type of the application shell.\n *\n * #### Notes\n * The `Application` class is useful when creating large, complex\n * UI applications with the ability to be safely extended by third\n * party code via plugins.\n */\nclass Application {\n /**\n * Construct a new application.\n *\n * @param options - The options for creating the application.\n */\n constructor(options) {\n var _a;\n this._delegate = new PromiseDelegate();\n this._started = false;\n this._bubblingKeydown = false;\n this.pluginRegistry =\n (_a = options.pluginRegistry) !== null && _a !== void 0 ? _a : new PluginRegistry(options);\n this.pluginRegistry.application = this;\n // Initialize the application state.\n this.commands = new CommandRegistry();\n this.contextMenu = new ContextMenu({\n commands: this.commands,\n renderer: options.contextMenuRenderer\n });\n this.shell = options.shell;\n }\n /**\n * The list of all the deferred plugins.\n */\n get deferredPlugins() {\n return this.pluginRegistry.deferredPlugins;\n }\n /**\n * A promise which resolves after the application has started.\n *\n * #### Notes\n * This promise will resolve after the `start()` method is called,\n * when all the bootstrapping and shell mounting work is complete.\n */\n get started() {\n return this._delegate.promise;\n }\n /**\n * Activate all the deferred plugins.\n *\n * @returns A promise which will resolve when each plugin is activated\n * or rejects with an error if one cannot be activated.\n */\n async activateDeferredPlugins() {\n await this.pluginRegistry.activatePlugins('defer');\n }\n /**\n * Activate the plugin with the given ID.\n *\n * @param id - The ID of the plugin of interest.\n *\n * @returns A promise which resolves when the plugin is activated\n * or rejects with an error if it cannot be activated.\n */\n async activatePlugin(id) {\n return this.pluginRegistry.activatePlugin(id);\n }\n /**\n * Deactivate the plugin and its downstream dependents if and only if the\n * plugin and its dependents all support `deactivate`.\n *\n * @param id - The ID of the plugin of interest.\n *\n * @returns A list of IDs of downstream plugins deactivated with this one.\n */\n async deactivatePlugin(id) {\n return this.pluginRegistry.deactivatePlugin(id);\n }\n /**\n * Deregister a plugin with the application.\n *\n * @param id - The ID of the plugin of interest.\n *\n * @param force - Whether to deregister the plugin even if it is active.\n */\n deregisterPlugin(id, force) {\n this.pluginRegistry.deregisterPlugin(id, force);\n }\n /**\n * Get a plugin description.\n *\n * @param id - The ID of the plugin of interest.\n *\n * @returns The plugin description.\n */\n getPluginDescription(id) {\n return this.pluginRegistry.getPluginDescription(id);\n }\n /**\n * Test whether a plugin is registered with the application.\n *\n * @param id - The ID of the plugin of interest.\n *\n * @returns `true` if the plugin is registered, `false` otherwise.\n */\n hasPlugin(id) {\n return this.pluginRegistry.hasPlugin(id);\n }\n /**\n * Test whether a plugin is activated with the application.\n *\n * @param id - The ID of the plugin of interest.\n *\n * @returns `true` if the plugin is activated, `false` otherwise.\n */\n isPluginActivated(id) {\n return this.pluginRegistry.isPluginActivated(id);\n }\n /**\n * List the IDs of the plugins registered with the application.\n *\n * @returns A new array of the registered plugin IDs.\n */\n listPlugins() {\n return this.pluginRegistry.listPlugins();\n }\n /**\n * Register a plugin with the application.\n *\n * @param plugin - The plugin to register.\n *\n * #### Notes\n * An error will be thrown if a plugin with the same ID is already\n * registered, or if the plugin has a circular dependency.\n *\n * If the plugin provides a service which has already been provided\n * by another plugin, the new service will override the old service.\n */\n registerPlugin(plugin) {\n this.pluginRegistry.registerPlugin(plugin);\n }\n /**\n * Register multiple plugins with the application.\n *\n * @param plugins - The plugins to register.\n *\n * #### Notes\n * This calls `registerPlugin()` for each of the given plugins.\n */\n registerPlugins(plugins) {\n this.pluginRegistry.registerPlugins(plugins);\n }\n /**\n * Resolve an optional service of a given type.\n *\n * @param token - The token for the service type of interest.\n *\n * @returns A promise which resolves to an instance of the requested\n * service, or `null` if it cannot be resolved.\n *\n * #### Notes\n * Services are singletons. The same instance will be returned each\n * time a given service token is resolved.\n *\n * If the plugin which provides the service has not been activated,\n * resolving the service will automatically activate the plugin.\n *\n * User code will not typically call this method directly. Instead,\n * the optional services for the user's plugins will be resolved\n * automatically when the plugin is activated.\n */\n async resolveOptionalService(token) {\n return this.pluginRegistry.resolveOptionalService(token);\n }\n /**\n * Resolve a required service of a given type.\n *\n * @param token - The token for the service type of interest.\n *\n * @returns A promise which resolves to an instance of the requested\n * service, or rejects with an error if it cannot be resolved.\n *\n * #### Notes\n * Services are singletons. The same instance will be returned each\n * time a given service token is resolved.\n *\n * If the plugin which provides the service has not been activated,\n * resolving the service will automatically activate the plugin.\n *\n * User code will not typically call this method directly. Instead,\n * the required services for the user's plugins will be resolved\n * automatically when the plugin is activated.\n */\n async resolveRequiredService(token) {\n return this.pluginRegistry.resolveRequiredService(token);\n }\n /**\n * Start the application.\n *\n * @param options - The options for starting the application.\n *\n * @returns A promise which resolves when all bootstrapping work\n * is complete and the shell is mounted to the DOM.\n *\n * #### Notes\n * This should be called once by the application creator after all\n * initial plugins have been registered.\n *\n * If a plugin fails to the load, the error will be logged and the\n * other valid plugins will continue to be loaded.\n *\n * Bootstrapping the application consists of the following steps:\n * 1. Activate the startup plugins\n * 2. Wait for those plugins to activate\n * 3. Attach the shell widget to the DOM\n * 4. Add the application event listeners\n */\n async start(options = {}) {\n var _a, _b;\n // Return immediately if the application is already started.\n if (this._started) {\n return this._delegate.promise;\n }\n // Mark the application as started;\n this._started = true;\n this._bubblingKeydown = (_a = options.bubblingKeydown) !== null && _a !== void 0 ? _a : false;\n // Parse the host ID for attaching the shell.\n const hostID = (_b = options.hostID) !== null && _b !== void 0 ? _b : '';\n // Wait for the plugins to activate, then finalize startup.\n await this.pluginRegistry.activatePlugins('startUp', options);\n this.attachShell(hostID);\n this.addEventListeners();\n this._delegate.resolve();\n }\n /**\n * Handle the DOM events for the application.\n *\n * @param event - The DOM event sent to the application.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events registered for the application. It\n * should not be called directly by user code.\n */\n handleEvent(event) {\n switch (event.type) {\n case 'resize':\n this.evtResize(event);\n break;\n case 'keydown':\n this.evtKeydown(event);\n break;\n case 'keyup':\n this.evtKeyup(event);\n break;\n case 'contextmenu':\n this.evtContextMenu(event);\n break;\n }\n }\n /**\n * Attach the application shell to the DOM.\n *\n * @param id - The ID of the host node for the shell, or `''`.\n *\n * #### Notes\n * If the ID is not provided, the document body will be the host.\n *\n * A subclass may reimplement this method as needed.\n */\n attachShell(id) {\n Widget.attach(this.shell, (id && document.getElementById(id)) || document.body);\n }\n /**\n * Add the application event listeners.\n *\n * #### Notes\n * The default implementation of this method adds listeners for\n * `'keydown'` and `'resize'` events.\n *\n * A subclass may reimplement this method as needed.\n */\n addEventListeners() {\n document.addEventListener('contextmenu', this);\n document.addEventListener('keydown', this, !this._bubblingKeydown);\n document.addEventListener('keyup', this, !this._bubblingKeydown);\n window.addEventListener('resize', this);\n }\n /**\n * A method invoked on a document `'keydown'` event.\n *\n * #### Notes\n * The default implementation of this method invokes the key down\n * processing method of the application command registry.\n *\n * A subclass may reimplement this method as needed.\n */\n evtKeydown(event) {\n this.commands.processKeydownEvent(event);\n }\n /**\n * A method invoked on a document `'keyup'` event.\n *\n * #### Notes\n * The default implementation of this method invokes the key up\n * processing method of the application command registry.\n *\n * A subclass may reimplement this method as needed.\n */\n evtKeyup(event) {\n this.commands.processKeyupEvent(event);\n }\n /**\n * A method invoked on a document `'contextmenu'` event.\n *\n * #### Notes\n * The default implementation of this method opens the application\n * `contextMenu` at the current mouse position.\n *\n * If the application context menu has no matching content *or* if\n * the shift key is pressed, the default browser context menu will\n * be opened instead.\n *\n * A subclass may reimplement this method as needed.\n */\n evtContextMenu(event) {\n if (event.shiftKey) {\n return;\n }\n if (this.contextMenu.open(event)) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n /**\n * A method invoked on a window `'resize'` event.\n *\n * #### Notes\n * The default implementation of this method updates the shell.\n *\n * A subclass may reimplement this method as needed.\n */\n evtResize(event) {\n this.shell.update();\n }\n}\n\nexport { Application };\n//# sourceMappingURL=index.es6.js.map\n","/**\n * A simple router.\n */\nexport class Router {\n constructor() {\n this._routes = [];\n }\n /**\n * Add a new GET route\n *\n * @param pattern The pattern to match\n * @param callback The function to call on pattern match\n *\n */\n get(pattern, callback) {\n this._add('GET', pattern, callback);\n }\n /**\n * Add a new PUT route\n *\n * @param pattern The pattern to match\n * @param callback The function to call on pattern match\n *\n */\n put(pattern, callback) {\n this._add('PUT', pattern, callback);\n }\n /**\n * Add a new POST route\n *\n * @param pattern The pattern to match\n * @param callback The function to call on pattern match\n *\n */\n post(pattern, callback) {\n this._add('POST', pattern, callback);\n }\n /**\n * Add a new PATCH route\n *\n * @param pattern The pattern to match\n * @param callback The function to call on pattern match\n *\n */\n patch(pattern, callback) {\n this._add('PATCH', pattern, callback);\n }\n /**\n * Add a new DELETE route\n *\n * @param pattern The pattern to match\n * @param callback The function to call on pattern match\n *\n */\n delete(pattern, callback) {\n this._add('DELETE', pattern, callback);\n }\n /**\n * Route a request.\n *\n * @param req The request to route.\n */\n async route(req) {\n const url = new URL(req.url);\n const { method } = req;\n const { pathname } = url;\n for (const r of this._routes) {\n if (r.method !== method) {\n continue;\n }\n const match = pathname.match(r.pattern);\n if (!match) {\n continue;\n }\n const matches = match.slice(1);\n let body;\n if (r.method === 'PATCH' || r.method === 'PUT' || r.method === 'POST') {\n try {\n body = JSON.parse(await req.text());\n }\n catch {\n body = undefined;\n }\n }\n return r.callback.call(null, {\n pathname,\n body,\n query: Object.fromEntries(url.searchParams),\n }, ...matches);\n }\n throw new Error('Cannot route ' + req.method + ' ' + req.url);\n }\n /**\n * Add a new route.\n *\n * @param method The method\n * @param pattern The pattern\n * @param callback The callback\n */\n _add(method, pattern, callback) {\n if (typeof pattern === 'string') {\n pattern = new RegExp(pattern);\n }\n this._routes.push({\n method,\n pattern,\n callback,\n });\n }\n}\n//# sourceMappingURL=router.js.map","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\nimport { ServerConnection, ServiceManager } from '@jupyterlab/services';\nimport { Application } from '@lumino/application';\nimport { Stream } from '@lumino/signaling';\nimport { WebSocket } from 'mock-socket';\nimport { Router } from './router';\n/**\n * Mock the Event Manager for now\n */\nclass MockEventManager {\n constructor(options) {\n this._stream = new Stream(this);\n this._serverSettings = options.serverSettings;\n }\n async emit(event) {\n // no-op\n }\n dispose() {\n // no-op\n }\n get isDisposed() {\n return true;\n }\n get stream() {\n return this._stream;\n }\n get serverSettings() {\n return this._serverSettings;\n }\n}\n/**\n * Server is the main application class. It is instantiated once and shared.\n */\nexport class JupyterLiteServer extends Application {\n /**\n * Construct a new JupyterLite object.\n *\n * @param options The instantiation options for a JupyterLiteServer application.\n */\n constructor(options) {\n var _a;\n super(options);\n /**\n * The name of the application.\n */\n this.name = 'JupyterLite Server';\n /**\n * A namespace/prefix plugins may use to denote their provenance.\n */\n this.namespace = this.name;\n /**\n * The version of the application.\n */\n this.version = 'unknown';\n this._router = new Router();\n const serverSettings = {\n ...ServerConnection.makeSettings(),\n WebSocket,\n fetch: (_a = this.fetch.bind(this)) !== null && _a !== void 0 ? _a : undefined,\n };\n this._serviceManager = new ServiceManager({\n standby: 'never',\n serverSettings,\n events: new MockEventManager({ serverSettings }),\n });\n }\n /**\n * Get the underlying `Router` instance.\n */\n get router() {\n return this._router;\n }\n /**\n * Get the underlying lite service manager for this app.\n */\n get serviceManager() {\n return this._serviceManager;\n }\n /**\n * Handle an incoming request from the client.\n *\n * @param req The incoming request\n * @param init The optional init request\n */\n async fetch(req, init) {\n if (!(req instanceof Request)) {\n throw Error('Request info is not a Request');\n }\n return this._router.route(req);\n }\n /**\n * Attach the application shell to the DOM.\n *\n * @param id - The id of the host node for the shell, or `''`.\n *\n * #### Notes\n * For this server application there is no shell to attach\n */\n attachShell(id) {\n // no-op\n }\n /**\n * A method invoked on a window `'resize'` event.\n *\n * #### Notes\n * For this server application there is no shell to update\n */\n evtResize(event) {\n // no-op\n }\n /**\n * Register plugins from a plugin module.\n *\n * @param mod - The plugin module to register.\n */\n registerPluginModule(mod) {\n let data = mod.default;\n // Handle commonjs exports.\n if (!Object.prototype.hasOwnProperty.call(mod, '__esModule')) {\n data = mod;\n }\n if (!Array.isArray(data)) {\n data = [data];\n }\n data.forEach((item) => {\n try {\n this.registerPlugin(item);\n }\n catch (error) {\n console.error(error);\n }\n });\n }\n /**\n * Register the plugins from multiple plugin modules.\n *\n * @param mods - The plugin modules to register.\n */\n registerPluginModules(mods) {\n mods.forEach((mod) => {\n this.registerPluginModule(mod);\n });\n }\n}\n//# sourceMappingURL=app.js.map","import { PromiseDelegate } from '@lumino/coreutils';\nimport { Signal } from '@lumino/signaling';\nimport { PageConfig, URLExt } from '@jupyterlab/coreutils';\nimport { WORKER_NAME } from './tokens';\nconst VERSION = PageConfig.getOption('appVersion');\nexport class ServiceWorkerManager {\n constructor(options) {\n var _a;\n this.unregisterOldServiceWorkers = (scriptURL) => {\n const versionKey = `${scriptURL}-version`;\n // Check if we have an installed version. If we do, compare it to the current version\n // and unregister all service workers if they are different.\n const installedVersion = localStorage.getItem(versionKey);\n if ((installedVersion && installedVersion !== VERSION) || !installedVersion) {\n // eslint-disable-next-line no-console\n console.info('New version, unregistering existing service workers.');\n navigator.serviceWorker\n .getRegistrations()\n .then((registrations) => {\n for (const registration of registrations) {\n registration.unregister();\n }\n })\n .then(() => {\n // eslint-disable-next-line no-console\n console.info('All existing service workers have been unregistered.');\n });\n }\n localStorage.setItem(versionKey, VERSION);\n };\n this._registration = null;\n this._registrationChanged = new Signal(this);\n this._ready = new PromiseDelegate();\n const workerUrl = (_a = options === null || options === void 0 ? void 0 : options.workerUrl) !== null && _a !== void 0 ? _a : URLExt.join(PageConfig.getBaseUrl(), WORKER_NAME);\n const fullWorkerUrl = new URL(workerUrl, window.location.href);\n const enableCache = PageConfig.getOption('enableServiceWorkerCache') || 'false';\n fullWorkerUrl.searchParams.set('enableCache', enableCache);\n void this.initialize(fullWorkerUrl.href).catch(console.warn);\n }\n /**\n * A signal emitted when the registration changes.\n */\n get registrationChanged() {\n return this._registrationChanged;\n }\n /**\n * Whether the ServiceWorker is enabled or not.\n */\n get enabled() {\n return this._registration !== null;\n }\n get ready() {\n return this._ready.promise;\n }\n async initialize(workerUrl) {\n const { serviceWorker } = navigator;\n let registration = null;\n if (!serviceWorker) {\n console.warn('ServiceWorkers not supported in this browser');\n }\n else if (serviceWorker.controller) {\n const scriptURL = serviceWorker.controller.scriptURL;\n this.unregisterOldServiceWorkers(scriptURL);\n registration = (await serviceWorker.getRegistration(scriptURL)) || null;\n // eslint-disable-next-line no-console\n console.info('JupyterLite ServiceWorker was already registered');\n }\n if (!registration && serviceWorker) {\n try {\n // eslint-disable-next-line no-console\n console.info('Registering new JupyterLite ServiceWorker', workerUrl);\n registration = await serviceWorker.register(workerUrl);\n // eslint-disable-next-line no-console\n console.info('JupyterLite ServiceWorker was sucessfully registered');\n }\n catch (err) {\n console.warn(err);\n console.warn(`JupyterLite ServiceWorker registration unexpectedly failed: ${err}`);\n }\n }\n this._setRegistration(registration);\n if (!registration) {\n this._ready.reject(void 0);\n }\n else {\n this._ready.resolve(void 0);\n }\n }\n _setRegistration(registration) {\n this._registration = registration;\n this._registrationChanged.emit(this._registration);\n }\n}\n//# sourceMappingURL=service-manager.js.map","import { Token } from '@lumino/coreutils';\nimport SW_URL from './service-worker?text';\n/**\n * The token for the ServiceWorker.\n */\nexport const IServiceWorkerManager = new Token('@jupyterlite/server-extension:IServiceWorkerManager');\nexport const WORKER_NAME = `${SW_URL}`.split('/').slice(-1)[0];\n//# sourceMappingURL=tokens.js.map","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@lumino/algorithm')) :\n typeof define === 'function' && define.amd ? define(['exports', '@lumino/algorithm'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.lumino_coreutils = {}, global.lumino_algorithm));\n})(this, (function (exports, algorithm) { 'use strict';\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /*-----------------------------------------------------------------------------\n | Copyright (c) 2014-2017, PhosphorJS Contributors\n |\n | Distributed under the terms of the BSD 3-Clause License.\n |\n | The full license is in the file LICENSE, distributed with this software.\n |----------------------------------------------------------------------------*/\n /**\n * The namespace for JSON-specific functions.\n */\n exports.JSONExt = void 0;\n (function (JSONExt) {\n /**\n * A shared frozen empty JSONObject\n */\n JSONExt.emptyObject = Object.freeze({});\n /**\n * A shared frozen empty JSONArray\n */\n JSONExt.emptyArray = Object.freeze([]);\n /**\n * Test whether a JSON value is a primitive.\n *\n * @param value - The JSON value of interest.\n *\n * @returns `true` if the value is a primitive,`false` otherwise.\n */\n function isPrimitive(value) {\n return (value === null ||\n typeof value === 'boolean' ||\n typeof value === 'number' ||\n typeof value === 'string');\n }\n JSONExt.isPrimitive = isPrimitive;\n function isArray(value) {\n return Array.isArray(value);\n }\n JSONExt.isArray = isArray;\n function isObject(value) {\n return !isPrimitive(value) && !isArray(value);\n }\n JSONExt.isObject = isObject;\n /**\n * Compare two JSON values for deep equality.\n *\n * @param first - The first JSON value of interest.\n *\n * @param second - The second JSON value of interest.\n *\n * @returns `true` if the values are equivalent, `false` otherwise.\n */\n function deepEqual(first, second) {\n // Check referential and primitive equality first.\n if (first === second) {\n return true;\n }\n // If one is a primitive, the `===` check ruled out the other.\n if (isPrimitive(first) || isPrimitive(second)) {\n return false;\n }\n // Test whether they are arrays.\n let a1 = isArray(first);\n let a2 = isArray(second);\n // Bail if the types are different.\n if (a1 !== a2) {\n return false;\n }\n // If they are both arrays, compare them.\n if (a1 && a2) {\n return deepArrayEqual(first, second);\n }\n // At this point, they must both be objects.\n return deepObjectEqual(first, second);\n }\n JSONExt.deepEqual = deepEqual;\n /**\n * Create a deep copy of a JSON value.\n *\n * @param value - The JSON value to copy.\n *\n * @returns A deep copy of the given JSON value.\n */\n function deepCopy(value) {\n // Do nothing for primitive values.\n if (isPrimitive(value)) {\n return value;\n }\n // Deep copy an array.\n if (isArray(value)) {\n return deepArrayCopy(value);\n }\n // Deep copy an object.\n return deepObjectCopy(value);\n }\n JSONExt.deepCopy = deepCopy;\n /**\n * Compare two JSON arrays for deep equality.\n */\n function deepArrayEqual(first, second) {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n // Test the arrays for equal length.\n if (first.length !== second.length) {\n return false;\n }\n // Compare the values for equality.\n for (let i = 0, n = first.length; i < n; ++i) {\n if (!deepEqual(first[i], second[i])) {\n return false;\n }\n }\n // At this point, the arrays are equal.\n return true;\n }\n /**\n * Compare two JSON objects for deep equality.\n */\n function deepObjectEqual(first, second) {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n // Check for the first object's keys in the second object.\n for (let key in first) {\n if (first[key] !== undefined && !(key in second)) {\n return false;\n }\n }\n // Check for the second object's keys in the first object.\n for (let key in second) {\n if (second[key] !== undefined && !(key in first)) {\n return false;\n }\n }\n // Compare the values for equality.\n for (let key in first) {\n // Get the values.\n let firstValue = first[key];\n let secondValue = second[key];\n // If both are undefined, ignore the key.\n if (firstValue === undefined && secondValue === undefined) {\n continue;\n }\n // If only one value is undefined, the objects are not equal.\n if (firstValue === undefined || secondValue === undefined) {\n return false;\n }\n // Compare the values.\n if (!deepEqual(firstValue, secondValue)) {\n return false;\n }\n }\n // At this point, the objects are equal.\n return true;\n }\n /**\n * Create a deep copy of a JSON array.\n */\n function deepArrayCopy(value) {\n let result = new Array(value.length);\n for (let i = 0, n = value.length; i < n; ++i) {\n result[i] = deepCopy(value[i]);\n }\n return result;\n }\n /**\n * Create a deep copy of a JSON object.\n */\n function deepObjectCopy(value) {\n let result = {};\n for (let key in value) {\n // Ignore undefined values.\n let subvalue = value[key];\n if (subvalue === undefined) {\n continue;\n }\n result[key] = deepCopy(subvalue);\n }\n return result;\n }\n })(exports.JSONExt || (exports.JSONExt = {}));\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /*-----------------------------------------------------------------------------\n | Copyright (c) 2014-2017, PhosphorJS Contributors\n |\n | Distributed under the terms of the BSD 3-Clause License.\n |\n | The full license is in the file LICENSE, distributed with this software.\n |----------------------------------------------------------------------------*/\n /**\n * An object which stores MIME data for general application use.\n *\n * #### Notes\n * This class does not attempt to enforce \"correctness\" of MIME types\n * and their associated data. Since this class is designed to transfer\n * arbitrary data and objects within the same application, it assumes\n * that the user provides correct and accurate data.\n */\n class MimeData {\n constructor() {\n this._types = [];\n this._values = [];\n }\n /**\n * Get an array of the MIME types contained within the dataset.\n *\n * @returns A new array of the MIME types, in order of insertion.\n */\n types() {\n return this._types.slice();\n }\n /**\n * Test whether the dataset has an entry for the given type.\n *\n * @param mime - The MIME type of interest.\n *\n * @returns `true` if the dataset contains a value for the given\n * MIME type, `false` otherwise.\n */\n hasData(mime) {\n return this._types.indexOf(mime) !== -1;\n }\n /**\n * Get the data value for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * @returns The value for the given MIME type, or `undefined` if\n * the dataset does not contain a value for the type.\n */\n getData(mime) {\n let i = this._types.indexOf(mime);\n return i !== -1 ? this._values[i] : undefined;\n }\n /**\n * Set the data value for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * @param data - The data value for the given MIME type.\n *\n * #### Notes\n * This will overwrite any previous entry for the MIME type.\n */\n setData(mime, data) {\n this.clearData(mime);\n this._types.push(mime);\n this._values.push(data);\n }\n /**\n * Remove the data entry for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * #### Notes\n * This is a no-op if there is no entry for the given MIME type.\n */\n clearData(mime) {\n let i = this._types.indexOf(mime);\n if (i !== -1) {\n this._types.splice(i, 1);\n this._values.splice(i, 1);\n }\n }\n /**\n * Remove all data entries from the dataset.\n */\n clear() {\n this._types.length = 0;\n this._values.length = 0;\n }\n }\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /**\n * Plugin registry.\n */\n class PluginRegistry {\n constructor(options = {}) {\n this._application = null;\n this._validatePlugin = () => true;\n this._plugins = new Map();\n this._services = new Map();\n if (options.validatePlugin) {\n console.info('Plugins may be rejected by the custom validation plugin method.');\n this._validatePlugin = options.validatePlugin;\n }\n }\n /**\n * The application object.\n *\n * It will be provided as first argument to the\n * plugins activation and deactivation functions.\n *\n * It can only be set once.\n *\n * By default, it is `null`.\n */\n get application() {\n return this._application;\n }\n set application(v) {\n if (this._application !== null) {\n throw Error('PluginRegistry.application is already set. It cannot be overridden.');\n }\n this._application = v;\n }\n /**\n * The list of all the deferred plugins.\n */\n get deferredPlugins() {\n return Array.from(this._plugins)\n .filter(([id, plugin]) => plugin.autoStart === 'defer')\n .map(([id, plugin]) => id);\n }\n /**\n * Get a plugin description.\n *\n * @param id - The ID of the plugin of interest.\n *\n * @returns The plugin description.\n */\n getPluginDescription(id) {\n var _a, _b;\n return (_b = (_a = this._plugins.get(id)) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b : '';\n }\n /**\n * Test whether a plugin is registered with the application.\n *\n * @param id - The ID of the plugin of interest.\n *\n * @returns `true` if the plugin is registered, `false` otherwise.\n */\n hasPlugin(id) {\n return this._plugins.has(id);\n }\n /**\n * Test whether a plugin is activated with the application.\n *\n * @param id - The ID of the plugin of interest.\n *\n * @returns `true` if the plugin is activated, `false` otherwise.\n */\n isPluginActivated(id) {\n var _a, _b;\n return (_b = (_a = this._plugins.get(id)) === null || _a === void 0 ? void 0 : _a.activated) !== null && _b !== void 0 ? _b : false;\n }\n /**\n * List the IDs of the plugins registered with the application.\n *\n * @returns A new array of the registered plugin IDs.\n */\n listPlugins() {\n return Array.from(this._plugins.keys());\n }\n /**\n * Register a plugin with the application.\n *\n * @param plugin - The plugin to register.\n *\n * #### Notes\n * An error will be thrown if a plugin with the same ID is already\n * registered, or if the plugin has a circular dependency.\n *\n * If the plugin provides a service which has already been provided\n * by another plugin, the new service will override the old service.\n */\n registerPlugin(plugin) {\n // Throw an error if the plugin ID is already registered.\n if (this._plugins.has(plugin.id)) {\n throw new TypeError(`Plugin '${plugin.id}' is already registered.`);\n }\n if (!this._validatePlugin(plugin)) {\n throw new Error(`Plugin '${plugin.id}' is not valid.`);\n }\n // Create the normalized plugin data.\n const data = Private.createPluginData(plugin);\n // Ensure the plugin does not cause a cyclic dependency.\n Private.ensureNoCycle(data, this._plugins, this._services);\n // Add the service token to the service map.\n if (data.provides) {\n this._services.set(data.provides, data.id);\n }\n // Add the plugin to the plugin map.\n this._plugins.set(data.id, data);\n }\n /**\n * Register multiple plugins with the application.\n *\n * @param plugins - The plugins to register.\n *\n * #### Notes\n * This calls `registerPlugin()` for each of the given plugins.\n */\n registerPlugins(plugins) {\n for (const plugin of plugins) {\n this.registerPlugin(plugin);\n }\n }\n /**\n * Deregister a plugin with the application.\n *\n * @param id - The ID of the plugin of interest.\n *\n * @param force - Whether to deregister the plugin even if it is active.\n */\n deregisterPlugin(id, force) {\n const plugin = this._plugins.get(id);\n if (!plugin) {\n return;\n }\n if (plugin.activated && !force) {\n throw new Error(`Plugin '${id}' is still active.`);\n }\n this._plugins.delete(id);\n }\n /**\n * Activate the plugin with the given ID.\n *\n * @param id - The ID of the plugin of interest.\n *\n * @returns A promise which resolves when the plugin is activated\n * or rejects with an error if it cannot be activated.\n */\n async activatePlugin(id) {\n // Reject the promise if the plugin is not registered.\n const plugin = this._plugins.get(id);\n if (!plugin) {\n throw new ReferenceError(`Plugin '${id}' is not registered.`);\n }\n // Resolve immediately if the plugin is already activated.\n if (plugin.activated) {\n return;\n }\n // Return the pending resolver promise if it exists.\n if (plugin.promise) {\n return plugin.promise;\n }\n // Resolve the required services for the plugin.\n const required = plugin.requires.map(t => this.resolveRequiredService(t));\n // Resolve the optional services for the plugin.\n const optional = plugin.optional.map(t => this.resolveOptionalService(t));\n // Setup the resolver promise for the plugin.\n plugin.promise = Promise.all([...required, ...optional])\n .then(services => plugin.activate.apply(undefined, [this.application, ...services]))\n .then(service => {\n plugin.service = service;\n plugin.activated = true;\n plugin.promise = null;\n })\n .catch(error => {\n plugin.promise = null;\n throw error;\n });\n // Return the pending resolver promise.\n return plugin.promise;\n }\n /**\n * Activate all the deferred plugins.\n *\n * @returns A promise which will resolve when each plugin is activated\n * or rejects with an error if one cannot be activated.\n */\n async activatePlugins(kind, options = {}) {\n switch (kind) {\n case 'defer': {\n const promises = this.deferredPlugins\n .filter(pluginId => this._plugins.get(pluginId).autoStart)\n .map(pluginId => {\n return this.activatePlugin(pluginId);\n });\n await Promise.all(promises);\n break;\n }\n case 'startUp': {\n // Collect the ids of the startup plugins.\n const startups = Private.collectStartupPlugins(this._plugins, options);\n // Generate the activation promises.\n const promises = startups.map(async (id) => {\n try {\n return await this.activatePlugin(id);\n }\n catch (error) {\n console.error(`Plugin '${id}' failed to activate.`, error);\n }\n });\n await Promise.all(promises);\n break;\n }\n }\n }\n /**\n * Deactivate the plugin and its downstream dependents if and only if the\n * plugin and its dependents all support `deactivate`.\n *\n * @param id - The ID of the plugin of interest.\n *\n * @returns A list of IDs of downstream plugins deactivated with this one.\n */\n async deactivatePlugin(id) {\n // Reject the promise if the plugin is not registered.\n const plugin = this._plugins.get(id);\n if (!plugin) {\n throw new ReferenceError(`Plugin '${id}' is not registered.`);\n }\n // Bail early if the plugin is not activated.\n if (!plugin.activated) {\n return [];\n }\n // Check that this plugin can deactivate.\n if (!plugin.deactivate) {\n throw new TypeError(`Plugin '${id}'#deactivate() method missing`);\n }\n // Find the optimal deactivation order for plugins downstream of this one.\n const manifest = Private.findDependents(id, this._plugins, this._services);\n const downstream = manifest.map(id => this._plugins.get(id));\n // Check that all downstream plugins can deactivate.\n for (const plugin of downstream) {\n if (!plugin.deactivate) {\n throw new TypeError(`Plugin ${plugin.id}#deactivate() method missing (depends on ${id})`);\n }\n }\n // Deactivate all downstream plugins.\n for (const plugin of downstream) {\n const services = [...plugin.requires, ...plugin.optional].map(service => {\n const id = this._services.get(service);\n return id ? this._plugins.get(id).service : null;\n });\n // Await deactivation so the next plugins only receive active services.\n await plugin.deactivate(this.application, ...services);\n plugin.service = null;\n plugin.activated = false;\n }\n // Remove plugin ID and return manifest of deactivated plugins.\n manifest.pop();\n return manifest;\n }\n /**\n * Resolve a required service of a given type.\n *\n * @param token - The token for the service type of interest.\n *\n * @returns A promise which resolves to an instance of the requested\n * service, or rejects with an error if it cannot be resolved.\n *\n * #### Notes\n * Services are singletons. The same instance will be returned each\n * time a given service token is resolved.\n *\n * If the plugin which provides the service has not been activated,\n * resolving the service will automatically activate the plugin.\n *\n * User code will not typically call this method directly. Instead,\n * the required services for the user's plugins will be resolved\n * automatically when the plugin is activated.\n */\n async resolveRequiredService(token) {\n // Reject the promise if there is no provider for the type.\n const id = this._services.get(token);\n if (!id) {\n throw new TypeError(`No provider for: ${token.name}.`);\n }\n // Activate the plugin if necessary.\n const plugin = this._plugins.get(id);\n if (!plugin.activated) {\n await this.activatePlugin(id);\n }\n return plugin.service;\n }\n /**\n * Resolve an optional service of a given type.\n *\n * @param token - The token for the service type of interest.\n *\n * @returns A promise which resolves to an instance of the requested\n * service, or `null` if it cannot be resolved.\n *\n * #### Notes\n * Services are singletons. The same instance will be returned each\n * time a given service token is resolved.\n *\n * If the plugin which provides the service has not been activated,\n * resolving the service will automatically activate the plugin.\n *\n * User code will not typically call this method directly. Instead,\n * the optional services for the user's plugins will be resolved\n * automatically when the plugin is activated.\n */\n async resolveOptionalService(token) {\n // Resolve with `null` if there is no provider for the type.\n const id = this._services.get(token);\n if (!id) {\n return null;\n }\n // Activate the plugin if necessary.\n const plugin = this._plugins.get(id);\n if (!plugin.activated) {\n try {\n await this.activatePlugin(id);\n }\n catch (reason) {\n console.error(reason);\n return null;\n }\n }\n return plugin.service;\n }\n }\n /**\n * The namespace for the module implementation details.\n */\n var Private;\n (function (Private) {\n class PluginData {\n constructor(plugin) {\n var _a, _b, _c, _d;\n this._activated = false;\n this._promise = null;\n this._service = null;\n this.id = plugin.id;\n this.description = (_a = plugin.description) !== null && _a !== void 0 ? _a : '';\n this.activate = plugin.activate;\n this.deactivate = (_b = plugin.deactivate) !== null && _b !== void 0 ? _b : null;\n this.provides = (_c = plugin.provides) !== null && _c !== void 0 ? _c : null;\n this.autoStart = (_d = plugin.autoStart) !== null && _d !== void 0 ? _d : false;\n this.requires = plugin.requires ? plugin.requires.slice() : [];\n this.optional = plugin.optional ? plugin.optional.slice() : [];\n }\n /**\n * Whether the plugin has been activated.\n */\n get activated() {\n return this._activated;\n }\n set activated(a) {\n this._activated = a;\n }\n /**\n * The resolved service for the plugin, or `null`.\n */\n get service() {\n return this._service;\n }\n set service(s) {\n this._service = s;\n }\n /**\n * The pending resolver promise, or `null`.\n */\n get promise() {\n return this._promise;\n }\n set promise(p) {\n this._promise = p;\n }\n }\n /**\n * Create a normalized plugin data object for the given plugin.\n */\n function createPluginData(plugin) {\n return new PluginData(plugin);\n }\n Private.createPluginData = createPluginData;\n /**\n * Ensure no cycle is present in the plugin resolution graph.\n *\n * If a cycle is detected, an error will be thrown.\n */\n function ensureNoCycle(plugin, plugins, services) {\n const dependencies = [...plugin.requires, ...plugin.optional];\n const visit = (token) => {\n if (token === plugin.provides) {\n return true;\n }\n const id = services.get(token);\n if (!id) {\n return false;\n }\n const visited = plugins.get(id);\n const dependencies = [...visited.requires, ...visited.optional];\n if (dependencies.length === 0) {\n return false;\n }\n trace.push(id);\n if (dependencies.some(visit)) {\n return true;\n }\n trace.pop();\n return false;\n };\n // Bail early if there cannot be a cycle.\n if (!plugin.provides || dependencies.length === 0) {\n return;\n }\n // Setup a stack to trace service resolution.\n const trace = [plugin.id];\n // Throw an exception if a cycle is present.\n if (dependencies.some(visit)) {\n throw new ReferenceError(`Cycle detected: ${trace.join(' -> ')}.`);\n }\n }\n Private.ensureNoCycle = ensureNoCycle;\n /**\n * Find dependents in deactivation order.\n *\n * @param id - The ID of the plugin of interest.\n *\n * @param plugins - The map containing all plugins.\n *\n * @param services - The map containing all services.\n *\n * @returns A list of dependent plugin IDs in order of deactivation\n *\n * #### Notes\n * The final item of the returned list is always the plugin of interest.\n */\n function findDependents(id, plugins, services) {\n const edges = new Array();\n const add = (id) => {\n const plugin = plugins.get(id);\n // FIXME In the case of missing optional dependencies, we may consider\n // deactivating and reactivating the plugin without the missing service.\n const dependencies = [...plugin.requires, ...plugin.optional];\n edges.push(...dependencies.reduce((acc, dep) => {\n const service = services.get(dep);\n if (service) {\n // An edge is oriented from dependent to provider.\n acc.push([id, service]);\n }\n return acc;\n }, []));\n };\n for (const id of plugins.keys()) {\n add(id);\n }\n // Filter edges\n // - Get all packages that dependent on the package to be deactivated\n const newEdges = edges.filter(edge => edge[1] === id);\n let oldSize = 0;\n while (newEdges.length > oldSize) {\n const previousSize = newEdges.length;\n // Get all packages that dependent on packages that will be deactivated\n const packagesOfInterest = new Set(newEdges.map(edge => edge[0]));\n for (const poi of packagesOfInterest) {\n edges\n .filter(edge => edge[1] === poi)\n .forEach(edge => {\n // We check it is not already included to deal with circular dependencies\n if (!newEdges.includes(edge)) {\n newEdges.push(edge);\n }\n });\n }\n oldSize = previousSize;\n }\n const sorted = algorithm.topologicSort(newEdges);\n const index = sorted.findIndex(candidate => candidate === id);\n if (index === -1) {\n return [id];\n }\n return sorted.slice(0, index + 1);\n }\n Private.findDependents = findDependents;\n /**\n * Collect the IDs of the plugins to activate on startup.\n */\n function collectStartupPlugins(plugins, options) {\n // Create a set to hold the plugin IDs.\n const collection = new Set();\n // Collect the auto-start (non deferred) plugins.\n for (const id of plugins.keys()) {\n if (plugins.get(id).autoStart === true) {\n collection.add(id);\n }\n }\n // Add the startup plugins.\n if (options.startPlugins) {\n for (const id of options.startPlugins) {\n collection.add(id);\n }\n }\n // Remove the ignored plugins.\n if (options.ignorePlugins) {\n for (const id of options.ignorePlugins) {\n collection.delete(id);\n }\n }\n // Return the collected startup plugins.\n return Array.from(collection);\n }\n Private.collectStartupPlugins = collectStartupPlugins;\n })(Private || (Private = {}));\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /*-----------------------------------------------------------------------------\n | Copyright (c) 2014-2017, PhosphorJS Contributors\n |\n | Distributed under the terms of the BSD 3-Clause License.\n |\n | The full license is in the file LICENSE, distributed with this software.\n |----------------------------------------------------------------------------*/\n /**\n * A class which wraps a promise into a delegate object.\n *\n * #### Notes\n * This class is useful when the logic to resolve or reject a promise\n * cannot be defined at the point where the promise is created.\n */\n class PromiseDelegate {\n /**\n * Construct a new promise delegate.\n */\n constructor() {\n this.promise = new Promise((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n /**\n * Resolve the wrapped promise with the given value.\n *\n * @param value - The value to use for resolving the promise.\n */\n resolve(value) {\n let resolve = this._resolve;\n resolve(value);\n }\n /**\n * Reject the wrapped promise with the given value.\n *\n * @reason - The reason for rejecting the promise.\n */\n reject(reason) {\n let reject = this._reject;\n reject(reason);\n }\n }\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /*-----------------------------------------------------------------------------\n | Copyright (c) 2014-2017, PhosphorJS Contributors\n |\n | Distributed under the terms of the BSD 3-Clause License.\n |\n | The full license is in the file LICENSE, distributed with this software.\n |----------------------------------------------------------------------------*/\n /**\n * A runtime object which captures compile-time type information.\n *\n * #### Notes\n * A token captures the compile-time type of an interface or class in\n * an object which can be used at runtime in a type-safe fashion.\n */\n class Token {\n /**\n * Construct a new token.\n *\n * @param name - A human readable name for the token.\n * @param description - Token purpose description for documentation.\n */\n constructor(name, description) {\n this.name = name;\n this.description = description !== null && description !== void 0 ? description : '';\n this._tokenStructuralPropertyT = null;\n }\n }\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /*-----------------------------------------------------------------------------\n | Copyright (c) 2014-2017, PhosphorJS Contributors\n |\n | Distributed under the terms of the BSD 3-Clause License.\n |\n | The full license is in the file LICENSE, distributed with this software.\n |----------------------------------------------------------------------------*/\n // Fallback\n function fallbackRandomValues(buffer) {\n let value = 0;\n for (let i = 0, n = buffer.length; i < n; ++i) {\n if (i % 4 === 0) {\n value = (Math.random() * 0xffffffff) >>> 0;\n }\n buffer[i] = value & 0xff;\n value >>>= 8;\n }\n }\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /*-----------------------------------------------------------------------------\n | Copyright (c) 2014-2017, PhosphorJS Contributors\n |\n | Distributed under the terms of the BSD 3-Clause License.\n |\n | The full license is in the file LICENSE, distributed with this software.\n |----------------------------------------------------------------------------*/\n /**\n * The namespace for random number related functionality.\n */\n exports.Random = void 0;\n (function (Random) {\n /**\n * A function which generates random bytes.\n *\n * @param buffer - The `Uint8Array` to fill with random bytes.\n *\n * #### Notes\n * A cryptographically strong random number generator will be used if\n * available. Otherwise, `Math.random` will be used as a fallback for\n * randomness.\n *\n * The following RNGs are supported, listed in order of precedence:\n * - `window.crypto.getRandomValues`\n * - `window.msCrypto.getRandomValues`\n * - `require('crypto').randomFillSync\n * - `require('crypto').randomBytes\n * - `Math.random`\n */\n Random.getRandomValues = (() => {\n // Look up the crypto module if available.\n const crypto = (typeof window !== 'undefined' && (window.crypto || window.msCrypto)) ||\n null;\n // Modern browsers and IE 11\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return function getRandomValues(buffer) {\n return crypto.getRandomValues(buffer);\n };\n }\n // Fallback\n return fallbackRandomValues;\n })();\n })(exports.Random || (exports.Random = {}));\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /*-----------------------------------------------------------------------------\n | Copyright (c) 2014-2017, PhosphorJS Contributors\n |\n | Distributed under the terms of the BSD 3-Clause License.\n |\n | The full license is in the file LICENSE, distributed with this software.\n |----------------------------------------------------------------------------*/\n /**\n * A function which creates a function that generates UUID v4 identifiers.\n *\n * @returns A new function that creates a UUID v4 string.\n *\n * #### Notes\n * This implementation complies with RFC 4122.\n *\n * This uses `Random.getRandomValues()` for random bytes, which in\n * turn will use the underlying `crypto` module of the platform if\n * it is available. The fallback for randomness is `Math.random`.\n */\n function uuid4Factory(getRandomValues) {\n // Create a 16 byte array to hold the random values.\n const bytes = new Uint8Array(16);\n // Create a look up table from bytes to hex strings.\n const lut = new Array(256);\n // Pad the single character hex digits with a leading zero.\n for (let i = 0; i < 16; ++i) {\n lut[i] = '0' + i.toString(16);\n }\n // Populate the rest of the hex digits.\n for (let i = 16; i < 256; ++i) {\n lut[i] = i.toString(16);\n }\n // Return a function which generates the UUID.\n return function uuid4() {\n // Get a new batch of random values.\n getRandomValues(bytes);\n // Set the UUID version number to 4.\n bytes[6] = 0x40 | (bytes[6] & 0x0f);\n // Set the clock sequence bit to the RFC spec.\n bytes[8] = 0x80 | (bytes[8] & 0x3f);\n // Assemble the UUID string.\n return (lut[bytes[0]] +\n lut[bytes[1]] +\n lut[bytes[2]] +\n lut[bytes[3]] +\n '-' +\n lut[bytes[4]] +\n lut[bytes[5]] +\n '-' +\n lut[bytes[6]] +\n lut[bytes[7]] +\n '-' +\n lut[bytes[8]] +\n lut[bytes[9]] +\n '-' +\n lut[bytes[10]] +\n lut[bytes[11]] +\n lut[bytes[12]] +\n lut[bytes[13]] +\n lut[bytes[14]] +\n lut[bytes[15]]);\n };\n }\n\n // Copyright (c) Jupyter Development Team.\n // Distributed under the terms of the Modified BSD License.\n /*-----------------------------------------------------------------------------\n | Copyright (c) 2014-2017, PhosphorJS Contributors\n |\n | Distributed under the terms of the BSD 3-Clause License.\n |\n | The full license is in the file LICENSE, distributed with this software.\n |----------------------------------------------------------------------------*/\n /**\n * The namespace for UUID related functionality.\n */\n exports.UUID = void 0;\n (function (UUID) {\n /**\n * A function which generates UUID v4 identifiers.\n *\n * @returns A new UUID v4 string.\n *\n * #### Notes\n * This implementation complies with RFC 4122.\n *\n * This uses `Random.getRandomValues()` for random bytes, which in\n * turn will use the underlying `crypto` module of the platform if\n * it is available. The fallback for randomness is `Math.random`.\n */\n UUID.uuid4 = uuid4Factory(exports.Random.getRandomValues);\n })(exports.UUID || (exports.UUID = {}));\n\n exports.MimeData = MimeData;\n exports.PluginRegistry = PluginRegistry;\n exports.PromiseDelegate = PromiseDelegate;\n exports.Token = Token;\n\n}));\n//# sourceMappingURL=index.js.map\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for array-specific algorithms.\n */\nvar ArrayExt;\n(function (ArrayExt) {\n /**\n * Find the index of the first occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.firstIndexOf(data, 'red'); // -1\n * ArrayExt.firstIndexOf(data, 'one'); // 0\n * ArrayExt.firstIndexOf(data, 'one', 1); // 4\n * ArrayExt.firstIndexOf(data, 'two', 2); // -1\n * ArrayExt.firstIndexOf(data, 'two', 2, 1); // 1\n * ```\n */\n function firstIndexOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.firstIndexOf = firstIndexOf;\n /**\n * Find the index of the last occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.lastIndexOf(data, 'red'); // -1\n * ArrayExt.lastIndexOf(data, 'one'); // 4\n * ArrayExt.lastIndexOf(data, 'one', 1); // 0\n * ArrayExt.lastIndexOf(data, 'two', 0); // -1\n * ArrayExt.lastIndexOf(data, 'two', 0, 1); // 1\n * ```\n */\n function lastIndexOf(array, value, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (start < stop) {\n span = start + 1 + (n - stop);\n }\n else {\n span = start - stop + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start - i + n) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.lastIndexOf = lastIndexOf;\n /**\n * Find the index of the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstIndex(data, isEven); // 1\n * ArrayExt.findFirstIndex(data, isEven, 4); // 5\n * ArrayExt.findFirstIndex(data, isEven, 6); // -1\n * ArrayExt.findFirstIndex(data, isEven, 6, 5); // 1\n * ```\n */\n function findFirstIndex(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findFirstIndex = findFirstIndex;\n /**\n * Find the index of the last value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastIndex(data, isEven); // 5\n * ArrayExt.findLastIndex(data, isEven, 4); // 3\n * ArrayExt.findLastIndex(data, isEven, 0); // -1\n * ArrayExt.findLastIndex(data, isEven, 0, 1); // 5\n * ```\n */\n function findLastIndex(array, fn, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let d;\n if (start < stop) {\n d = start + 1 + (n - stop);\n }\n else {\n d = start - stop + 1;\n }\n for (let i = 0; i < d; ++i) {\n let j = (start - i + n) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findLastIndex = findLastIndex;\n /**\n * Find the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstValue(data, isEven); // 2\n * ArrayExt.findFirstValue(data, isEven, 2); // 4\n * ArrayExt.findFirstValue(data, isEven, 6); // undefined\n * ArrayExt.findFirstValue(data, isEven, 6, 5); // 2\n * ```\n */\n function findFirstValue(array, fn, start = 0, stop = -1) {\n let index = findFirstIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findFirstValue = findFirstValue;\n /**\n * Find the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The last matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastValue(data, isEven); // 2\n * ArrayExt.findLastValue(data, isEven, 4); // 4\n * ArrayExt.findLastValue(data, isEven, 0); // undefined\n * ArrayExt.findLastValue(data, isEven, 0, 1); // 2\n * ```\n */\n function findLastValue(array, fn, start = -1, stop = 0) {\n let index = findLastIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findLastValue = findLastValue;\n /**\n * Find the index of the first element which compares `>=` to a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>=` to the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.lowerBound(data, 0, numberCmp); // 0\n * ArrayExt.lowerBound(data, 6, numberCmp); // 3\n * ArrayExt.lowerBound(data, 7, numberCmp); // 3\n * ArrayExt.lowerBound(data, -1, numberCmp); // 0\n * ArrayExt.lowerBound(data, 10, numberCmp); // 6\n * ```\n */\n function lowerBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) < 0) {\n begin = middle + 1;\n span -= half + 1;\n }\n else {\n span = half;\n }\n }\n return begin;\n }\n ArrayExt.lowerBound = lowerBound;\n /**\n * Find the index of the first element which compares `>` than a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>` than the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.upperBound(data, 0, numberCmp); // 1\n * ArrayExt.upperBound(data, 6, numberCmp); // 3\n * ArrayExt.upperBound(data, 7, numberCmp); // 5\n * ArrayExt.upperBound(data, -1, numberCmp); // 0\n * ArrayExt.upperBound(data, 10, numberCmp); // 6\n * ```\n */\n function upperBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) > 0) {\n span = half;\n }\n else {\n begin = middle + 1;\n span -= half + 1;\n }\n }\n return begin;\n }\n ArrayExt.upperBound = upperBound;\n /**\n * Test whether two arrays are shallowly equal.\n *\n * @param a - The first array-like object to compare.\n *\n * @param b - The second array-like object to compare.\n *\n * @param fn - The comparison function to apply to the elements. It\n * should return `true` if the elements are \"equal\". The default\n * compares elements using strict `===` equality.\n *\n * @returns Whether the two arrays are shallowly equal.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * Modifying the length of the arrays while comparing.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let d1 = [0, 3, 4, 7, 7, 9];\n * let d2 = [0, 3, 4, 7, 7, 9];\n * let d3 = [42];\n * ArrayExt.shallowEqual(d1, d2); // true\n * ArrayExt.shallowEqual(d2, d3); // false\n * ```\n */\n function shallowEqual(a, b, fn) {\n // Check for object identity first.\n if (a === b) {\n return true;\n }\n // Bail early if the lengths are different.\n if (a.length !== b.length) {\n return false;\n }\n // Compare each element for equality.\n for (let i = 0, n = a.length; i < n; ++i) {\n if (fn ? !fn(a[i], b[i]) : a[i] !== b[i]) {\n return false;\n }\n }\n // The array are shallowly equal.\n return true;\n }\n ArrayExt.shallowEqual = shallowEqual;\n /**\n * Create a slice of an array subject to an optional step.\n *\n * @param array - The array-like object of interest.\n *\n * @param options - The options for configuring the slice.\n *\n * @returns A new array with the specified values.\n *\n * @throws An exception if the slice `step` is `0`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start`, `stop`, or `step` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.slice(data); // [0, 3, 4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 2 }); // [4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 0, stop: 4 }); // [0, 3, 4, 7]\n * ArrayExt.slice(data, { step: 2 }); // [0, 4, 7]\n * ArrayExt.slice(data, { step: -1 }); // [9, 7, 7, 4, 3, 0]\n * ```\n */\n function slice(array, options = {}) {\n // Extract the options.\n let { start, stop, step } = options;\n // Set up the `step` value.\n if (step === undefined) {\n step = 1;\n }\n // Validate the step size.\n if (step === 0) {\n throw new Error('Slice `step` cannot be zero.');\n }\n // Look up the length of the array.\n let n = array.length;\n // Set up the `start` value.\n if (start === undefined) {\n start = step < 0 ? n - 1 : 0;\n }\n else if (start < 0) {\n start = Math.max(start + n, step < 0 ? -1 : 0);\n }\n else if (start >= n) {\n start = step < 0 ? n - 1 : n;\n }\n // Set up the `stop` value.\n if (stop === undefined) {\n stop = step < 0 ? -1 : n;\n }\n else if (stop < 0) {\n stop = Math.max(stop + n, step < 0 ? -1 : 0);\n }\n else if (stop >= n) {\n stop = step < 0 ? n - 1 : n;\n }\n // Compute the slice length.\n let length;\n if ((step < 0 && stop >= start) || (step > 0 && start >= stop)) {\n length = 0;\n }\n else if (step < 0) {\n length = Math.floor((stop - start + 1) / step + 1);\n }\n else {\n length = Math.floor((stop - start - 1) / step + 1);\n }\n // Compute the sliced result.\n let result = [];\n for (let i = 0; i < length; ++i) {\n result[i] = array[start + i * step];\n }\n // Return the result.\n return result;\n }\n ArrayExt.slice = slice;\n /**\n * Move an element in an array from one index to another.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param fromIndex - The index of the element to move. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param toIndex - The target index of the element. Negative\n * values are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `fromIndex` or `toIndex` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.move(data, 1, 2); // [0, 2, 1, 3, 4]\n * ArrayExt.move(data, 4, 2); // [0, 2, 4, 1, 3]\n * ```\n */\n function move(array, fromIndex, toIndex) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (fromIndex < 0) {\n fromIndex = Math.max(0, fromIndex + n);\n }\n else {\n fromIndex = Math.min(fromIndex, n - 1);\n }\n if (toIndex < 0) {\n toIndex = Math.max(0, toIndex + n);\n }\n else {\n toIndex = Math.min(toIndex, n - 1);\n }\n if (fromIndex === toIndex) {\n return;\n }\n let value = array[fromIndex];\n let d = fromIndex < toIndex ? 1 : -1;\n for (let i = fromIndex; i !== toIndex; i += d) {\n array[i] = array[i + d];\n }\n array[toIndex] = value;\n }\n ArrayExt.move = move;\n /**\n * Reverse an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param start - The index of the first element in the range to be\n * reversed, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * reversed, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` index which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.reverse(data, 1, 3); // [0, 3, 2, 1, 4]\n * ArrayExt.reverse(data, 3); // [0, 3, 2, 4, 1]\n * ArrayExt.reverse(data); // [1, 4, 2, 3, 0]\n * ```\n */\n function reverse(array, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n while (start < stop) {\n let a = array[start];\n let b = array[stop];\n array[start++] = b;\n array[stop--] = a;\n }\n }\n ArrayExt.reverse = reverse;\n /**\n * Rotate the elements of an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param delta - The amount of rotation to apply to the elements. A\n * positive value will rotate the elements to the left. A negative\n * value will rotate the elements to the right.\n *\n * @param start - The index of the first element in the range to be\n * rotated, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * rotated, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `delta`, `start`, or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.rotate(data, 2); // [2, 3, 4, 0, 1]\n * ArrayExt.rotate(data, -2); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 10); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 9); // [4, 0, 1, 2, 3]\n * ArrayExt.rotate(data, 2, 1, 3); // [4, 2, 0, 1, 3]\n * ```\n */\n function rotate(array, delta, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n if (start >= stop) {\n return;\n }\n let length = stop - start + 1;\n if (delta > 0) {\n delta = delta % length;\n }\n else if (delta < 0) {\n delta = ((delta % length) + length) % length;\n }\n if (delta === 0) {\n return;\n }\n let pivot = start + delta;\n reverse(array, start, pivot - 1);\n reverse(array, pivot, stop);\n reverse(array, start, stop);\n }\n ArrayExt.rotate = rotate;\n /**\n * Fill an array with a static value.\n *\n * @param array - The mutable array-like object to fill.\n *\n * @param value - The static value to use to fill the array.\n *\n * @param start - The index of the first element in the range to be\n * filled, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * filled, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Notes\n * If `stop < start` the fill will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four'];\n * ArrayExt.fill(data, 'r'); // ['r', 'r', 'r', 'r']\n * ArrayExt.fill(data, 'g', 1); // ['r', 'g', 'g', 'g']\n * ArrayExt.fill(data, 'b', 2, 3); // ['r', 'g', 'b', 'b']\n * ArrayExt.fill(data, 'z', 3, 1); // ['z', 'z', 'b', 'z']\n * ```\n */\n function fill(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n array[(start + i) % n] = value;\n }\n }\n ArrayExt.fill = fill;\n /**\n * Insert a value into an array at a specific index.\n *\n * @param array - The array of interest.\n *\n * @param index - The index at which to insert the value. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param value - The value to set at the specified index.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2];\n * ArrayExt.insert(data, 0, -1); // [-1, 0, 1, 2]\n * ArrayExt.insert(data, 2, 12); // [-1, 0, 12, 1, 2]\n * ArrayExt.insert(data, -1, 7); // [-1, 0, 12, 1, 7, 2]\n * ArrayExt.insert(data, 6, 19); // [-1, 0, 12, 1, 7, 2, 19]\n * ```\n */\n function insert(array, index, value) {\n let n = array.length;\n if (index < 0) {\n index = Math.max(0, index + n);\n }\n else {\n index = Math.min(index, n);\n }\n for (let i = n; i > index; --i) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n }\n ArrayExt.insert = insert;\n /**\n * Remove and return a value at a specific index in an array.\n *\n * @param array - The array of interest.\n *\n * @param index - The index of the value to remove. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The value at the specified index, or `undefined` if the\n * index is out of range.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeAt(data, 2); // 23\n * ArrayExt.removeAt(data, -2); // 12\n * ArrayExt.removeAt(data, 10); // undefined;\n * ```\n */\n function removeAt(array, index) {\n let n = array.length;\n if (index < 0) {\n index += n;\n }\n if (index < 0 || index >= n) {\n return undefined;\n }\n let value = array[index];\n for (let i = index + 1; i < n; ++i) {\n array[i - 1] = array[i];\n }\n array.length = n - 1;\n return value;\n }\n ArrayExt.removeAt = removeAt;\n /**\n * Remove the first occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstOf(data, 12); // 1\n * ArrayExt.removeFirstOf(data, 17); // -1\n * ArrayExt.removeFirstOf(data, 39, 3); // -1\n * ArrayExt.removeFirstOf(data, 39, 3, 2); // 2\n * ```\n */\n function removeFirstOf(array, value, start = 0, stop = -1) {\n let index = firstIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeFirstOf = removeFirstOf;\n /**\n * Remove the last occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastOf(data, 12); // 5\n * ArrayExt.removeLastOf(data, 17); // -1\n * ArrayExt.removeLastOf(data, 39, 2); // -1\n * ArrayExt.removeLastOf(data, 39, 2, 3); // 3\n * ```\n */\n function removeLastOf(array, value, start = -1, stop = 0) {\n let index = lastIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeLastOf = removeLastOf;\n /**\n * Remove all occurrences of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [14, 12, 23, 39, 14, 12, 19, 14];\n * ArrayExt.removeAllOf(data, 12); // 2\n * ArrayExt.removeAllOf(data, 17); // 0\n * ArrayExt.removeAllOf(data, 14, 1, 4); // 1\n * ```\n */\n function removeAllOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && array[i] === value) {\n count++;\n }\n else if (stop < start &&\n (i <= stop || i >= start) &&\n array[i] === value) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllOf = removeAllOf;\n /**\n * Remove the first occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstWhere(data, isEven); // { index: 0, value: 0 }\n * ArrayExt.removeFirstWhere(data, isEven, 2); // { index: 3, value: 14 }\n * ArrayExt.removeFirstWhere(data, isEven, 4); // { index: -1, value: undefined }\n * ```\n */\n function removeFirstWhere(array, fn, start = 0, stop = -1) {\n let value;\n let index = findFirstIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeFirstWhere = removeFirstWhere;\n /**\n * Remove the last occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastWhere(data, isEven); // { index: 5, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2); // { index: 1, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2, 1); // { index: -1, value: undefined }\n * ```\n */\n function removeLastWhere(array, fn, start = -1, stop = 0) {\n let value;\n let index = findLastIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeLastWhere = removeLastWhere;\n /**\n * Remove all occurrences of values which match a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * function isNegative(value: number): boolean {\n * return value < 0;\n * }\n *\n * let data = [0, 12, -13, -9, 23, 39, 14, -15, 12, 75];\n * ArrayExt.removeAllWhere(data, isEven); // 4\n * ArrayExt.removeAllWhere(data, isNegative, 0, 3); // 2\n * ```\n */\n function removeAllWhere(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && fn(array[i], i)) {\n count++;\n }\n else if (stop < start && (i <= stop || i >= start) && fn(array[i], i)) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllWhere = removeAllWhere;\n})(ArrayExt || (ArrayExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Chain together several iterables.\n *\n * @deprecated\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields the values of the iterables\n * in the order in which they are supplied.\n *\n * #### Example\n * ```typescript\n * import { chain } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = chain(data1, data2);\n *\n * Array.from(stream); // [1, 2, 3, 4, 5, 6]\n * ```\n */\nfunction* chain(...objects) {\n for (const object of objects) {\n yield* object;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an empty iterator.\n *\n * @returns A new iterator which yields nothing.\n *\n * #### Example\n * ```typescript\n * import { empty } from '@lumino/algorithm';\n *\n * let stream = empty();\n *\n * Array.from(stream); // []\n * ```\n */\n// eslint-disable-next-line require-yield\nfunction* empty() {\n return;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Enumerate an iterable object.\n *\n * @param object - The iterable object of interest.\n *\n * @param start - The starting enum value. The default is `0`.\n *\n * @returns An iterator which yields the enumerated values.\n *\n * #### Example\n * ```typescript\n * import { enumerate } from '@lumino/algorithm';\n *\n * let data = ['foo', 'bar', 'baz'];\n *\n * let stream = enumerate(data, 1);\n *\n * Array.from(stream); // [[1, 'foo'], [2, 'bar'], [3, 'baz']]\n * ```\n */\nfunction* enumerate(object, start = 0) {\n for (const value of object) {\n yield [start++, value];\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Filter an iterable for values which pass a test.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns An iterator which yields the values which pass the test.\n *\n * #### Example\n * ```typescript\n * import { filter } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = filter(data, value => value % 2 === 0);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* filter(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Find the first value in an iterable which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { find } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * find(data, isCat).name; // 'fluffy'\n * ```\n */\nfunction find(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return value;\n }\n }\n return undefined;\n}\n/**\n * Find the index of the first value which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { findIndex } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * findIndex(data, isCat); // 1\n * ```\n */\nfunction findIndex(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return index - 1;\n }\n }\n return -1;\n}\n/**\n * Find the minimum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The minimum value in the iterable. If multiple values are\n * equivalent to the minimum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { min } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * min([7, 4, 0, 3, 9, 4], numberCmp); // 0\n * ```\n */\nfunction min(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) < 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the maximum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The maximum value in the iterable. If multiple values are\n * equivalent to the maximum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { max } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * max([7, 4, 0, 3, 9, 4], numberCmp); // 9\n * ```\n */\nfunction max(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) > 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the minimum and maximum values in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns A 2-tuple of the `[min, max]` values in the iterable. If\n * multiple values are equivalent, the left-most values are returned.\n * If the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { minmax } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * minmax([7, 4, 0, 3, 9, 4], numberCmp); // [0, 9]\n * ```\n */\nfunction minmax(object, fn) {\n let empty = true;\n let vmin;\n let vmax;\n for (const value of object) {\n if (empty) {\n vmin = value;\n vmax = value;\n empty = false;\n }\n else if (fn(value, vmin) < 0) {\n vmin = value;\n }\n else if (fn(value, vmax) > 0) {\n vmax = value;\n }\n }\n return empty ? undefined : [vmin, vmax];\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an array from an iterable of values.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new array of values from the given object.\n *\n * #### Example\n * ```typescript\n * import { toArray } from '@lumino/algorithm';\n *\n * let stream = [1, 2, 3, 4, 5, 6][Symbol.iterator]();\n *\n * toArray(stream); // [1, 2, 3, 4, 5, 6];\n * ```\n */\nfunction toArray(object) {\n return Array.from(object);\n}\n/**\n * Create an object from an iterable of key/value pairs.\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new object mapping keys to values.\n *\n * #### Example\n * ```typescript\n * import { toObject } from '@lumino/algorithm';\n *\n * let data: [string, number][] = [['one', 1], ['two', 2], ['three', 3]];\n *\n * toObject(data); // { one: 1, two: 2, three: 3 }\n * ```\n */\nfunction toObject(object) {\n const result = {};\n for (const [key, value] of object) {\n result[key] = value;\n }\n return result;\n}\n/**\n * Invoke a function for each value in an iterable.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The callback function to invoke for each value.\n *\n * #### Notes\n * Iteration can be terminated early by returning `false` from the\n * callback function.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each } from '@lumino/algorithm';\n *\n * let data = [5, 7, 0, -2, 9];\n *\n * each(data, value => { console.log(value); });\n * ```\n */\nfunction each(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return;\n }\n }\n}\n/**\n * Test whether all values in an iterable satisfy a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if all values pass the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `false` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { every } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * every(data, value => value % 2 === 0); // false\n * every(data, value => value % 2 === 1); // true\n * ```\n */\nfunction every(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Test whether any value in an iterable satisfies a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if any value passes the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `true` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { some } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * some(data, value => value === 7); // true\n * some(data, value => value === 3); // false\n * ```\n */\nfunction some(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return true;\n }\n }\n return false;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Transform the values of an iterable with a mapping function.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The mapping function to invoke for each value.\n *\n * @returns An iterator which yields the transformed values.\n *\n * #### Example\n * ```typescript\n * import { map } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3];\n *\n * let stream = map(data, value => value * 2);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* map(object, fn) {\n let index = 0;\n for (const value of object) {\n yield fn(value, index++);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator of evenly spaced values.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns An iterator which produces evenly spaced values.\n *\n * #### Notes\n * In the single argument form of `range(stop)`, `start` defaults to\n * `0` and `step` defaults to `1`.\n *\n * In the two argument form of `range(start, stop)`, `step` defaults\n * to `1`.\n *\n * #### Example\n * ```typescript\n * import { range } from '@lumino/algorithm';\n *\n * let stream = range(2, 4);\n *\n * Array.from(stream); // [2, 3]\n * ```\n */\nfunction* range(start, stop, step) {\n if (stop === undefined) {\n stop = start;\n start = 0;\n step = 1;\n }\n else if (step === undefined) {\n step = 1;\n }\n const length = Private.rangeLength(start, stop, step);\n for (let index = 0; index < length; index++) {\n yield start + step * index;\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Compute the effective length of a range.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns The number of steps need to traverse the range.\n */\n function rangeLength(start, stop, step) {\n if (step === 0) {\n return Infinity;\n }\n if (start > stop && step > 0) {\n return 0;\n }\n if (start < stop && step < 0) {\n return 0;\n }\n return Math.ceil((stop - start) / step);\n }\n Private.rangeLength = rangeLength;\n})(Private || (Private = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nfunction reduce(object, fn, initial) {\n // Setup the iterator and fetch the first value.\n const it = object[Symbol.iterator]();\n let index = 0;\n let first = it.next();\n // An empty iterator and no initial value is an error.\n if (first.done && initial === undefined) {\n throw new TypeError('Reduce of empty iterable with no initial value.');\n }\n // If the iterator is empty, return the initial value.\n if (first.done) {\n return initial;\n }\n // If the iterator has a single item and no initial value, the\n // reducer is not invoked and the first item is the return value.\n let second = it.next();\n if (second.done && initial === undefined) {\n return first.value;\n }\n // If iterator has a single item and an initial value is provided,\n // the reducer is invoked and that result is the return value.\n if (second.done) {\n return fn(initial, first.value, index++);\n }\n // Setup the initial accumlated value.\n let accumulator;\n if (initial === undefined) {\n accumulator = fn(first.value, second.value, index++);\n }\n else {\n accumulator = fn(fn(initial, first.value, index++), second.value, index++);\n }\n // Iterate the rest of the values, updating the accumulator.\n let next;\n while (!(next = it.next()).done) {\n accumulator = fn(accumulator, next.value, index++);\n }\n // Return the final accumulated value.\n return accumulator;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator which repeats a value a number of times.\n *\n * @deprecated\n *\n * @param value - The value to repeat.\n *\n * @param count - The number of times to repeat the value.\n *\n * @returns A new iterator which repeats the specified value.\n *\n * #### Example\n * ```typescript\n * import { repeat } from '@lumino/algorithm';\n *\n * let stream = repeat(7, 3);\n *\n * Array.from(stream); // [7, 7, 7]\n * ```\n */\nfunction* repeat(value, count) {\n while (0 < count--) {\n yield value;\n }\n}\n/**\n * Create an iterator which yields a value a single time.\n *\n * @deprecated\n *\n * @param value - The value to wrap in an iterator.\n *\n * @returns A new iterator which yields the value a single time.\n *\n * #### Example\n * ```typescript\n * import { once } from '@lumino/algorithm';\n *\n * let stream = once(7);\n *\n * Array.from(stream); // [7]\n * ```\n */\nfunction* once(value) {\n yield value;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator for a retroable object.\n *\n * @param object - The retroable or array-like object of interest.\n *\n * @returns An iterator which traverses the object's values in reverse.\n *\n * #### Example\n * ```typescript\n * import { retro } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = retro(data);\n *\n * Array.from(stream); // [6, 5, 4, 3, 2, 1]\n * ```\n */\nfunction* retro(object) {\n if (typeof object.retro === 'function') {\n yield* object.retro();\n }\n else {\n for (let index = object.length - 1; index > -1; index--) {\n yield object[index];\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Topologically sort an iterable of edges.\n *\n * @param edges - The iterable object of edges to sort.\n * An edge is represented as a 2-tuple of `[fromNode, toNode]`.\n *\n * @returns The topologically sorted array of nodes.\n *\n * #### Notes\n * If a cycle is present in the graph, the cycle will be ignored and\n * the return value will be only approximately sorted.\n *\n * #### Example\n * ```typescript\n * import { topologicSort } from '@lumino/algorithm';\n *\n * let data = [\n * ['d', 'e'],\n * ['c', 'd'],\n * ['a', 'b'],\n * ['b', 'c']\n * ];\n *\n * topologicSort(data); // ['a', 'b', 'c', 'd', 'e']\n * ```\n */\nfunction topologicSort(edges) {\n // Setup the shared sorting state.\n let sorted = [];\n let visited = new Set();\n let graph = new Map();\n // Add the edges to the graph.\n for (const edge of edges) {\n addEdge(edge);\n }\n // Visit each node in the graph.\n for (const [k] of graph) {\n visit(k);\n }\n // Return the sorted results.\n return sorted;\n // Add an edge to the graph.\n function addEdge(edge) {\n let [fromNode, toNode] = edge;\n let children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n }\n else {\n graph.set(toNode, [fromNode]);\n }\n }\n // Recursively visit the node.\n function visit(node) {\n if (visited.has(node)) {\n return;\n }\n visited.add(node);\n let children = graph.get(node);\n if (children) {\n for (const child of children) {\n visit(child);\n }\n }\n sorted.push(node);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate over an iterable using a stepped increment.\n *\n * @param object - The iterable object of interest.\n *\n * @param step - The distance to step on each iteration. A value\n * of less than `1` will behave the same as a value of `1`.\n *\n * @returns An iterator which traverses the iterable step-wise.\n *\n * #### Example\n * ```typescript\n * import { stride } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = stride(data, 2);\n *\n * Array.from(stream); // [1, 3, 5];\n * ```\n */\nfunction* stride(object, step) {\n let count = 0;\n for (const value of object) {\n if (0 === count++ % step) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for string-specific algorithms.\n */\nvar StringExt;\n(function (StringExt) {\n /**\n * Find the indices of characters in a source text.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The matched indices, or `null` if there is no match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * In order for there to be a match, all of the characters in `query`\n * **must** appear in `source` in the order given by `query`.\n *\n * Characters are matched using strict `===` equality.\n */\n function findIndices(source, query, start = 0) {\n let indices = new Array(query.length);\n for (let i = 0, j = start, n = query.length; i < n; ++i, ++j) {\n j = source.indexOf(query[i], j);\n if (j === -1) {\n return null;\n }\n indices[i] = j;\n }\n return indices;\n }\n StringExt.findIndices = findIndices;\n /**\n * A string matcher which uses a sum-of-squares algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-squares approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The index of each\n * matching character is squared and added to the score. This means\n * that early and consecutive character matches are preferred, while\n * late matches are heavily penalized.\n */\n function matchSumOfSquares(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i] - start;\n score += j * j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfSquares = matchSumOfSquares;\n /**\n * A string matcher which uses a sum-of-deltas algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-deltas approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The delta between\n * the indices are summed to create the score. This means that groups\n * of matched characters are preferred, while fragmented matches are\n * penalized.\n */\n function matchSumOfDeltas(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n let last = start - 1;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i];\n score += j - last - 1;\n last = j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfDeltas = matchSumOfDeltas;\n /**\n * Highlight the matched characters of a source text.\n *\n * @param source - The text which should be highlighted.\n *\n * @param indices - The indices of the matched characters. They must\n * appear in increasing order and must be in bounds of the source.\n *\n * @param fn - The function to apply to the matched chunks.\n *\n * @returns An array of unmatched and highlighted chunks.\n */\n function highlight(source, indices, fn) {\n // Set up the result array.\n let result = [];\n // Set up the counter variables.\n let k = 0;\n let last = 0;\n let n = indices.length;\n // Iterator over each index.\n while (k < n) {\n // Set up the chunk indices.\n let i = indices[k];\n let j = indices[k];\n // Advance the right chunk index until it's non-contiguous.\n while (++k < n && indices[k] === j + 1) {\n j++;\n }\n // Extract the unmatched text.\n if (last < i) {\n result.push(source.slice(last, i));\n }\n // Extract and highlight the matched text.\n if (i < j + 1) {\n result.push(fn(source.slice(i, j + 1)));\n }\n // Update the last visited index.\n last = j + 1;\n }\n // Extract any remaining unmatched text.\n if (last < source.length) {\n result.push(source.slice(last));\n }\n // Return the highlighted result.\n return result;\n }\n StringExt.highlight = highlight;\n /**\n * A 3-way string comparison function.\n *\n * @param a - The first string of interest.\n *\n * @param b - The second string of interest.\n *\n * @returns `-1` if `a < b`, else `1` if `a > b`, else `0`.\n */\n function cmp(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n }\n StringExt.cmp = cmp;\n})(StringExt || (StringExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Take a fixed number of items from an iterable.\n *\n * @param object - The iterable object of interest.\n *\n * @param count - The number of items to take from the iterable.\n *\n * @returns An iterator which yields the specified number of items\n * from the source iterable.\n *\n * #### Notes\n * The returned iterator will exhaust early if the source iterable\n * contains an insufficient number of items.\n *\n * #### Example\n * ```typescript\n * import { take } from '@lumino/algorithm';\n *\n * let stream = take([5, 4, 3, 2, 1, 0, -1], 3);\n *\n * Array.from(stream); // [5, 4, 3]\n * ```\n */\nfunction* take(object, count) {\n if (count < 1) {\n return;\n }\n const it = object[Symbol.iterator]();\n let item;\n while (0 < count-- && !(item = it.next()).done) {\n yield item.value;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate several iterables in lockstep.\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields successive tuples of values where\n * each value is taken in turn from the provided iterables. It will\n * be as long as the shortest provided iterable.\n *\n * #### Example\n * ```typescript\n * import { zip } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = zip(data1, data2);\n *\n * Array.from(stream); // [[1, 4], [2, 5], [3, 6]]\n * ```\n */\nfunction* zip(...objects) {\n const iters = objects.map(obj => obj[Symbol.iterator]());\n let tuple = iters.map(it => it.next());\n for (; every(tuple, item => !item.done); tuple = iters.map(it => it.next())) {\n yield tuple.map(item => item.value);\n }\n}\n\nexport { ArrayExt, StringExt, chain, each, empty, enumerate, every, filter, find, findIndex, map, max, min, minmax, once, range, reduce, repeat, retro, some, stride, take, toArray, toObject, topologicSort, zip };\n//# sourceMappingURL=index.es6.js.map\n","import { Signal } from '@lumino/signaling';\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module disposable\n */\n/**\n * A disposable object which delegates to a callback function.\n */\nclass DisposableDelegate {\n /**\n * Construct a new disposable delegate.\n *\n * @param fn - The callback function to invoke on dispose.\n */\n constructor(fn) {\n this._fn = fn;\n }\n /**\n * Test whether the delegate has been disposed.\n */\n get isDisposed() {\n return !this._fn;\n }\n /**\n * Dispose of the delegate and invoke the callback function.\n */\n dispose() {\n if (!this._fn) {\n return;\n }\n let fn = this._fn;\n this._fn = null;\n fn();\n }\n}\n/**\n * An observable disposable object which delegates to a callback function.\n */\nclass ObservableDisposableDelegate extends DisposableDelegate {\n constructor() {\n super(...arguments);\n this._disposed = new Signal(this);\n }\n /**\n * A signal emitted when the delegate is disposed.\n */\n get disposed() {\n return this._disposed;\n }\n /**\n * Dispose of the delegate and invoke the callback function.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n super.dispose();\n this._disposed.emit(undefined);\n Signal.clearData(this);\n }\n}\n/**\n * An object which manages a collection of disposable items.\n */\nclass DisposableSet {\n constructor() {\n this._isDisposed = false;\n this._items = new Set();\n }\n /**\n * Test whether the set has been disposed.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * Dispose of the set and the items it contains.\n *\n * #### Notes\n * Items are disposed in the order they are added to the set.\n */\n dispose() {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n this._items.forEach(item => {\n item.dispose();\n });\n this._items.clear();\n }\n /**\n * Test whether the set contains a specific item.\n *\n * @param item - The item of interest.\n *\n * @returns `true` if the set contains the item, `false` otherwise.\n */\n contains(item) {\n return this._items.has(item);\n }\n /**\n * Add a disposable item to the set.\n *\n * @param item - The item to add to the set.\n *\n * #### Notes\n * If the item is already contained in the set, this is a no-op.\n */\n add(item) {\n this._items.add(item);\n }\n /**\n * Remove a disposable item from the set.\n *\n * @param item - The item to remove from the set.\n *\n * #### Notes\n * If the item is not contained in the set, this is a no-op.\n */\n remove(item) {\n this._items.delete(item);\n }\n /**\n * Remove all items from the set.\n */\n clear() {\n this._items.clear();\n }\n}\n/**\n * The namespace for the `DisposableSet` class statics.\n */\n(function (DisposableSet) {\n /**\n * Create a disposable set from an iterable of items.\n *\n * @param items - The iterable object of interest.\n *\n * @returns A new disposable initialized with the given items.\n */\n function from(items) {\n let set = new DisposableSet();\n for (const item of items) {\n set.add(item);\n }\n return set;\n }\n DisposableSet.from = from;\n})(DisposableSet || (DisposableSet = {}));\n/**\n * An observable object which manages a collection of disposable items.\n */\nclass ObservableDisposableSet extends DisposableSet {\n constructor() {\n super(...arguments);\n this._disposed = new Signal(this);\n }\n /**\n * A signal emitted when the set is disposed.\n */\n get disposed() {\n return this._disposed;\n }\n /**\n * Dispose of the set and the items it contains.\n *\n * #### Notes\n * Items are disposed in the order they are added to the set.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n super.dispose();\n this._disposed.emit(undefined);\n Signal.clearData(this);\n }\n}\n/**\n * The namespace for the `ObservableDisposableSet` class statics.\n */\n(function (ObservableDisposableSet) {\n /**\n * Create an observable disposable set from an iterable of items.\n *\n * @param items - The iterable object of interest.\n *\n * @returns A new disposable initialized with the given items.\n */\n function from(items) {\n let set = new ObservableDisposableSet();\n for (const item of items) {\n set.add(item);\n }\n return set;\n }\n ObservableDisposableSet.from = from;\n})(ObservableDisposableSet || (ObservableDisposableSet = {}));\n\nexport { DisposableDelegate, DisposableSet, ObservableDisposableDelegate, ObservableDisposableSet };\n//# sourceMappingURL=index.es6.js.map\n","import { PromiseDelegate, JSONExt } from '@lumino/coreutils';\nimport { Signal } from '@lumino/signaling';\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * A class that wraps an asynchronous function to poll at a regular interval\n * with exponential increases to the interval length if the poll fails.\n *\n * @typeparam T - The resolved type of the factory's promises.\n * Defaults to `any`.\n *\n * @typeparam U - The rejected type of the factory's promises.\n * Defaults to `any`.\n *\n * @typeparam V - An optional type to extend the phases supported by a poll.\n * Defaults to `standby`, which already exists in the `Phase` type.\n */\nclass Poll {\n /**\n * Instantiate a new poll with exponential backoff in case of failure.\n *\n * @param options - The poll instantiation options.\n */\n constructor(options) {\n var _a;\n this._disposed = new Signal(this);\n this._lingered = 0;\n this._tick = new PromiseDelegate();\n this._ticked = new Signal(this);\n this._factory = options.factory;\n this._linger = (_a = options.linger) !== null && _a !== void 0 ? _a : Private.DEFAULT_LINGER;\n this._standby = options.standby || Private.DEFAULT_STANDBY;\n this._state = { ...Private.DEFAULT_STATE, timestamp: new Date().getTime() };\n // Normalize poll frequency `max` to be the greater of\n // default `max`, `options.frequency.max`, or `options.frequency.interval`.\n const frequency = options.frequency || {};\n const max = Math.max(frequency.interval || 0, frequency.max || 0, Private.DEFAULT_FREQUENCY.max);\n this.frequency = { ...Private.DEFAULT_FREQUENCY, ...frequency, ...{ max } };\n this.name = options.name || Private.DEFAULT_NAME;\n if ('auto' in options ? options.auto : true) {\n setTimeout(() => this.start());\n }\n }\n /**\n * A signal emitted when the poll is disposed.\n */\n get disposed() {\n return this._disposed;\n }\n /**\n * The polling frequency parameters.\n */\n get frequency() {\n return this._frequency;\n }\n set frequency(frequency) {\n if (this.isDisposed || JSONExt.deepEqual(frequency, this.frequency || {})) {\n return;\n }\n let { backoff, interval, max } = frequency;\n interval = Math.round(interval);\n max = Math.round(max);\n if (typeof backoff === 'number' && backoff < 1) {\n throw new Error('Poll backoff growth factor must be at least 1');\n }\n if ((interval < 0 || interval > max) && interval !== Poll.NEVER) {\n throw new Error('Poll interval must be between 0 and max');\n }\n if (max > Poll.MAX_INTERVAL && max !== Poll.NEVER) {\n throw new Error(`Max interval must be less than ${Poll.MAX_INTERVAL}`);\n }\n this._frequency = { backoff, interval, max };\n }\n /**\n * Whether the poll is disposed.\n */\n get isDisposed() {\n return this.state.phase === 'disposed';\n }\n /**\n * Indicates when the poll switches to standby.\n */\n get standby() {\n return this._standby;\n }\n set standby(standby) {\n if (this.isDisposed || this.standby === standby) {\n return;\n }\n this._standby = standby;\n }\n /**\n * The poll state, which is the content of the current poll tick.\n */\n get state() {\n return this._state;\n }\n /**\n * A promise that resolves when the poll next ticks.\n */\n get tick() {\n return this._tick.promise;\n }\n /**\n * A signal emitted when the poll ticks and fires off a new request.\n */\n get ticked() {\n return this._ticked;\n }\n /**\n * Return an async iterator that yields every tick.\n */\n async *[Symbol.asyncIterator]() {\n while (!this.isDisposed) {\n yield this.state;\n await this.tick.catch(() => undefined);\n }\n }\n /**\n * Dispose the poll.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this._state = {\n ...Private.DISPOSED_STATE,\n timestamp: new Date().getTime()\n };\n this._tick.promise.catch(_ => undefined);\n this._tick.reject(new Error(`Poll (${this.name}) is disposed.`));\n this._disposed.emit(undefined);\n Signal.clearData(this);\n }\n /**\n * Refreshes the poll. Schedules `refreshed` tick if necessary.\n *\n * @returns A promise that resolves after tick is scheduled and never rejects.\n *\n * #### Notes\n * The returned promise resolves after the tick is scheduled, but before\n * the polling action is run. To wait until after the poll action executes,\n * await the `poll.tick` promise: `await poll.refresh(); await poll.tick;`\n */\n refresh() {\n return this.schedule({\n cancel: ({ phase }) => phase === 'refreshed',\n interval: Poll.IMMEDIATE,\n phase: 'refreshed'\n });\n }\n /**\n * Schedule the next poll tick.\n *\n * @param next - The next poll state data to schedule. Defaults to standby.\n *\n * @param next.cancel - Cancels state transition if function returns `true`.\n *\n * @returns A promise that resolves when the next poll state is active.\n *\n * #### Notes\n * This method is not meant to be invoked by user code typically. It is public\n * to allow poll instances to be composed into classes that schedule ticks.\n */\n async schedule(next = {}) {\n if (this.isDisposed) {\n return;\n }\n // Check if the phase transition should be canceled.\n if (next.cancel && next.cancel(this.state)) {\n return;\n }\n // Update poll state.\n const pending = this._tick;\n const scheduled = new PromiseDelegate();\n const state = {\n interval: this.frequency.interval,\n payload: null,\n phase: 'standby',\n timestamp: new Date().getTime(),\n ...next\n };\n this._state = state;\n this._tick = scheduled;\n // Clear the schedule if possible.\n clearTimeout(this._timeout);\n // Emit ticked signal, resolve pending promise, and await its settlement.\n this._ticked.emit(this.state);\n pending.resolve(this);\n await pending.promise;\n if (state.interval === Poll.NEVER) {\n this._timeout = undefined;\n return;\n }\n // Schedule next execution and cache its timeout handle.\n const execute = () => {\n if (this.isDisposed || this.tick !== scheduled.promise) {\n return;\n }\n this._execute();\n };\n // Cache the handle in case it needs to be unscheduled.\n this._timeout = setTimeout(execute, state.interval);\n }\n /**\n * Starts the poll. Schedules `started` tick if necessary.\n *\n * @returns A promise that resolves after tick is scheduled and never rejects.\n */\n start() {\n return this.schedule({\n cancel: ({ phase }) => phase !== 'constructed' && phase !== 'standby' && phase !== 'stopped',\n interval: Poll.IMMEDIATE,\n phase: 'started'\n });\n }\n /**\n * Stops the poll. Schedules `stopped` tick if necessary.\n *\n * @returns A promise that resolves after tick is scheduled and never rejects.\n */\n stop() {\n return this.schedule({\n cancel: ({ phase }) => phase === 'stopped',\n interval: Poll.NEVER,\n phase: 'stopped'\n });\n }\n /**\n * Whether the poll is hidden.\n *\n * #### Notes\n * This property is only relevant in a browser context.\n */\n get hidden() {\n return Private.hidden;\n }\n /**\n * Execute a new poll factory promise or stand by if necessary.\n */\n _execute() {\n let standby = typeof this.standby === 'function' ? this.standby() : this.standby;\n // Check if execution should proceed, linger, or stand by.\n if (standby === 'never') {\n standby = false;\n }\n else if (standby === 'when-hidden') {\n if (this.hidden) {\n standby = ++this._lingered > this._linger;\n }\n else {\n this._lingered = 0;\n standby = false;\n }\n }\n // If in standby mode schedule next tick without calling the factory.\n if (standby) {\n void this.schedule();\n return;\n }\n const pending = this.tick;\n this._factory(this.state)\n .then((resolved) => {\n if (this.isDisposed || this.tick !== pending) {\n return;\n }\n void this.schedule({\n payload: resolved,\n phase: this.state.phase === 'rejected' ? 'reconnected' : 'resolved'\n });\n })\n .catch((rejected) => {\n if (this.isDisposed || this.tick !== pending) {\n return;\n }\n void this.schedule({\n interval: Private.sleep(this.frequency, this.state),\n payload: rejected,\n phase: 'rejected'\n });\n });\n }\n}\n/**\n * A namespace for `Poll` types, interfaces, and statics.\n */\n(function (Poll) {\n /**\n * An interval value in ms that indicates the poll should tick immediately.\n */\n Poll.IMMEDIATE = 0;\n /**\n * Delays are 32-bit integers in many browsers so intervals need to be capped.\n *\n * #### Notes\n * https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout#Maximum_delay_value\n */\n Poll.MAX_INTERVAL = 2147483647;\n /**\n * An interval value that indicates the poll should never tick.\n */\n Poll.NEVER = Infinity;\n})(Poll || (Poll = {}));\n/**\n * A namespace for private module data.\n */\nvar Private;\n(function (Private) {\n /**\n * The default backoff growth rate if `backoff` is `true`.\n */\n Private.DEFAULT_BACKOFF = 3;\n /**\n * The default polling frequency.\n */\n Private.DEFAULT_FREQUENCY = {\n backoff: true,\n interval: 1000,\n max: 30 * 1000\n };\n /**\n * The default number of times to `linger` when a poll is hidden.\n */\n Private.DEFAULT_LINGER = 1;\n /**\n * The default poll name.\n */\n Private.DEFAULT_NAME = 'unknown';\n /**\n * The default poll standby behavior.\n */\n Private.DEFAULT_STANDBY = 'when-hidden';\n /**\n * The first poll tick state's default values superseded in constructor.\n */\n Private.DEFAULT_STATE = {\n interval: Poll.NEVER,\n payload: null,\n phase: 'constructed',\n timestamp: new Date(0).getTime()\n };\n /**\n * The disposed tick state values.\n */\n Private.DISPOSED_STATE = {\n interval: Poll.NEVER,\n payload: null,\n phase: 'disposed',\n timestamp: new Date(0).getTime()\n };\n /**\n * Returns the number of milliseconds to sleep before the next tick.\n *\n * @param frequency - The poll's base frequency.\n * @param last - The poll's last tick.\n */\n function sleep(frequency, last) {\n const { backoff, interval, max } = frequency;\n if (interval === Poll.NEVER) {\n return interval;\n }\n const growth = backoff === true ? Private.DEFAULT_BACKOFF : backoff === false ? 1 : backoff;\n const random = getRandomIntInclusive(interval, last.interval * growth);\n return Math.min(max, random);\n }\n Private.sleep = sleep;\n /**\n * Keep track of whether the document is hidden. This flag is only relevant in\n * a browser context.\n *\n * Listen to `visibilitychange` event to set the `hidden` flag.\n *\n * Listening to `pagehide` is also necessary because Safari support for\n * `visibilitychange` events is partial, cf.\n * https://developer.mozilla.org/docs/Web/API/Document/visibilitychange_event\n */\n Private.hidden = (() => {\n if (typeof document === 'undefined') {\n return false;\n }\n document.addEventListener('visibilitychange', () => {\n Private.hidden = document.visibilityState === 'hidden';\n });\n document.addEventListener('pagehide', () => {\n Private.hidden = document.visibilityState === 'hidden';\n });\n return document.visibilityState === 'hidden';\n })();\n /**\n * Get a random integer between min and max, inclusive of both.\n *\n * #### Notes\n * From\n * https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Math/random#Getting_a_random_integer_between_two_values_inclusive\n *\n * From the MDN page: It might be tempting to use Math.round() to accomplish\n * that, but doing so would cause your random numbers to follow a non-uniform\n * distribution, which may not be acceptable for your needs.\n */\n function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }\n})(Private || (Private = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * A base class to implement rate limiters with different invocation strategies.\n *\n * @typeparam T - The resolved type of the underlying function.\n *\n * @typeparam U - The rejected type of the underlying function.\n *\n * @typeparam V - Arguments for the underlying function.\n */\nclass RateLimiter {\n /**\n * Instantiate a rate limiter.\n *\n * @param fn - The function to rate limit.\n *\n * @param limit - The rate limit; defaults to 500ms.\n */\n constructor(fn, limit = 500) {\n /**\n * Arguments for the underlying function.\n */\n this.args = undefined;\n /**\n * A promise that resolves on each successful invocation.\n */\n this.payload = null;\n this.limit = limit;\n this.poll = new Poll({\n auto: false,\n factory: async () => {\n const { args } = this;\n this.args = undefined;\n return fn(...args);\n },\n frequency: { backoff: false, interval: Poll.NEVER, max: Poll.NEVER },\n standby: 'never'\n });\n this.payload = new PromiseDelegate();\n this.poll.ticked.connect((_, state) => {\n const { payload } = this;\n if (state.phase === 'resolved') {\n this.payload = new PromiseDelegate();\n payload.resolve(state.payload);\n return;\n }\n if (state.phase === 'rejected' || state.phase === 'stopped') {\n this.payload = new PromiseDelegate();\n payload.promise.catch(_ => undefined);\n payload.reject(state.payload);\n return;\n }\n }, this);\n }\n /**\n * Whether the rate limiter is disposed.\n */\n get isDisposed() {\n return this.payload === null;\n }\n /**\n * Disposes the rate limiter.\n */\n dispose() {\n if (this.isDisposed) {\n return;\n }\n this.args = undefined;\n this.payload = null;\n this.poll.dispose();\n }\n /**\n * Stop the function if it is mid-flight.\n */\n async stop() {\n return this.poll.stop();\n }\n}\n/**\n * Wraps and debounces a function that can be called multiple times and only\n * executes the underlying function one `interval` after the last invocation.\n *\n * @typeparam T - The resolved type of the underlying function. Defaults to any.\n *\n * @typeparam U - The rejected type of the underlying function. Defaults to any.\n *\n * @typeparam V - Arguments for the underlying function. Defaults to any[].\n */\nclass Debouncer extends RateLimiter {\n /**\n * Invokes the function and only executes after rate limit has elapsed.\n * Each invocation resets the timer.\n */\n invoke(...args) {\n this.args = args;\n void this.poll.schedule({ interval: this.limit, phase: 'invoked' });\n return this.payload.promise;\n }\n}\n/**\n * Wraps and throttles a function that can be called multiple times and only\n * executes the underlying function once per `interval`.\n *\n * @typeparam T - The resolved type of the underlying function. Defaults to any.\n *\n * @typeparam U - The rejected type of the underlying function. Defaults to any.\n *\n * @typeparam V - Arguments for the underlying function. Defaults to any[].\n */\nclass Throttler extends RateLimiter {\n /**\n * Instantiate a throttler.\n *\n * @param fn - The function being throttled.\n *\n * @param options - Throttling configuration or throttling limit in ms.\n *\n * #### Notes\n * The `edge` defaults to `leading`; the `limit` defaults to `500`.\n */\n constructor(fn, options) {\n super(fn, typeof options === 'number' ? options : options && options.limit);\n this._trailing = false;\n if (typeof options !== 'number' && options && options.edge === 'trailing') {\n this._trailing = true;\n }\n this._interval = this._trailing ? this.limit : Poll.IMMEDIATE;\n }\n /**\n * Throttles function invocations if one is currently in flight.\n */\n invoke(...args) {\n const idle = this.poll.state.phase !== 'invoked';\n if (idle || this._trailing) {\n this.args = args;\n }\n if (idle) {\n void this.poll.schedule({ interval: this._interval, phase: 'invoked' });\n }\n return this.payload.promise;\n }\n}\n\nexport { Debouncer, Poll, RateLimiter, Throttler };\n//# sourceMappingURL=index.es6.js.map\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module properties\n */\n/**\n * A class which attaches a value to an external object.\n *\n * #### Notes\n * Attached properties are used to extend the state of an object with\n * semantic data from an unrelated class. They also encapsulate value\n * creation, coercion, and notification.\n *\n * Because attached property values are stored in a hash table, which\n * in turn is stored in a WeakMap keyed on the owner object, there is\n * non-trivial storage overhead involved in their use. The pattern is\n * therefore best used for the storage of rare data.\n */\nclass AttachedProperty {\n /**\n * Construct a new attached property.\n *\n * @param options - The options for initializing the property.\n */\n constructor(options) {\n this._pid = Private.nextPID();\n this.name = options.name;\n this._create = options.create;\n this._coerce = options.coerce || null;\n this._compare = options.compare || null;\n this._changed = options.changed || null;\n }\n /**\n * Get the current value of the property for a given owner.\n *\n * @param owner - The property owner of interest.\n *\n * @returns The current value of the property.\n *\n * #### Notes\n * If the value has not yet been set, the default value will be\n * computed and assigned as the current value of the property.\n */\n get(owner) {\n let value;\n let map = Private.ensureMap(owner);\n if (this._pid in map) {\n value = map[this._pid];\n }\n else {\n value = map[this._pid] = this._createValue(owner);\n }\n return value;\n }\n /**\n * Set the current value of the property for a given owner.\n *\n * @param owner - The property owner of interest.\n *\n * @param value - The value for the property.\n *\n * #### Notes\n * If the value has not yet been set, the default value will be\n * computed and used as the previous value for the comparison.\n */\n set(owner, value) {\n let oldValue;\n let map = Private.ensureMap(owner);\n if (this._pid in map) {\n oldValue = map[this._pid];\n }\n else {\n oldValue = map[this._pid] = this._createValue(owner);\n }\n let newValue = this._coerceValue(owner, value);\n this._maybeNotify(owner, oldValue, (map[this._pid] = newValue));\n }\n /**\n * Explicitly coerce the current property value for a given owner.\n *\n * @param owner - The property owner of interest.\n *\n * #### Notes\n * If the value has not yet been set, the default value will be\n * computed and used as the previous value for the comparison.\n */\n coerce(owner) {\n let oldValue;\n let map = Private.ensureMap(owner);\n if (this._pid in map) {\n oldValue = map[this._pid];\n }\n else {\n oldValue = map[this._pid] = this._createValue(owner);\n }\n let newValue = this._coerceValue(owner, oldValue);\n this._maybeNotify(owner, oldValue, (map[this._pid] = newValue));\n }\n /**\n * Get or create the default value for the given owner.\n */\n _createValue(owner) {\n let create = this._create;\n return create(owner);\n }\n /**\n * Coerce the value for the given owner.\n */\n _coerceValue(owner, value) {\n let coerce = this._coerce;\n return coerce ? coerce(owner, value) : value;\n }\n /**\n * Compare the old value and new value for equality.\n */\n _compareValue(oldValue, newValue) {\n let compare = this._compare;\n return compare ? compare(oldValue, newValue) : oldValue === newValue;\n }\n /**\n * Run the change notification if the given values are different.\n */\n _maybeNotify(owner, oldValue, newValue) {\n let changed = this._changed;\n if (changed && !this._compareValue(oldValue, newValue)) {\n changed(owner, oldValue, newValue);\n }\n }\n}\n/**\n * The namespace for the `AttachedProperty` class statics.\n */\n(function (AttachedProperty) {\n /**\n * Clear the stored property data for the given owner.\n *\n * @param owner - The property owner of interest.\n *\n * #### Notes\n * This will clear all property values for the owner, but it will\n * **not** run the change notification for any of the properties.\n */\n function clearData(owner) {\n Private.ownerData.delete(owner);\n }\n AttachedProperty.clearData = clearData;\n})(AttachedProperty || (AttachedProperty = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A weak mapping of property owner to property map.\n */\n Private.ownerData = new WeakMap();\n /**\n * A function which computes successive unique property ids.\n */\n Private.nextPID = (() => {\n let id = 0;\n return () => {\n let rand = Math.random();\n let stem = `${rand}`.slice(2);\n return `pid-${stem}-${id++}`;\n };\n })();\n /**\n * Lookup the data map for the property owner.\n *\n * This will create the map if one does not already exist.\n */\n function ensureMap(owner) {\n let map = Private.ownerData.get(owner);\n if (map) {\n return map;\n }\n map = Object.create(null);\n Private.ownerData.set(owner, map);\n return map;\n }\n Private.ensureMap = ensureMap;\n})(Private || (Private = {}));\n\nexport { AttachedProperty };\n//# sourceMappingURL=index.es6.js.map\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for array-specific algorithms.\n */\nvar ArrayExt;\n(function (ArrayExt) {\n /**\n * Find the index of the first occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.firstIndexOf(data, 'red'); // -1\n * ArrayExt.firstIndexOf(data, 'one'); // 0\n * ArrayExt.firstIndexOf(data, 'one', 1); // 4\n * ArrayExt.firstIndexOf(data, 'two', 2); // -1\n * ArrayExt.firstIndexOf(data, 'two', 2, 1); // 1\n * ```\n */\n function firstIndexOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.firstIndexOf = firstIndexOf;\n /**\n * Find the index of the last occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.lastIndexOf(data, 'red'); // -1\n * ArrayExt.lastIndexOf(data, 'one'); // 4\n * ArrayExt.lastIndexOf(data, 'one', 1); // 0\n * ArrayExt.lastIndexOf(data, 'two', 0); // -1\n * ArrayExt.lastIndexOf(data, 'two', 0, 1); // 1\n * ```\n */\n function lastIndexOf(array, value, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (start < stop) {\n span = start + 1 + (n - stop);\n }\n else {\n span = start - stop + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start - i + n) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.lastIndexOf = lastIndexOf;\n /**\n * Find the index of the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstIndex(data, isEven); // 1\n * ArrayExt.findFirstIndex(data, isEven, 4); // 5\n * ArrayExt.findFirstIndex(data, isEven, 6); // -1\n * ArrayExt.findFirstIndex(data, isEven, 6, 5); // 1\n * ```\n */\n function findFirstIndex(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n let j = (start + i) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findFirstIndex = findFirstIndex;\n /**\n * Find the index of the last value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastIndex(data, isEven); // 5\n * ArrayExt.findLastIndex(data, isEven, 4); // 3\n * ArrayExt.findLastIndex(data, isEven, 0); // -1\n * ArrayExt.findLastIndex(data, isEven, 0, 1); // 5\n * ```\n */\n function findLastIndex(array, fn, start = -1, stop = 0) {\n let n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let d;\n if (start < stop) {\n d = start + 1 + (n - stop);\n }\n else {\n d = start - stop + 1;\n }\n for (let i = 0; i < d; ++i) {\n let j = (start - i + n) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findLastIndex = findLastIndex;\n /**\n * Find the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstValue(data, isEven); // 2\n * ArrayExt.findFirstValue(data, isEven, 2); // 4\n * ArrayExt.findFirstValue(data, isEven, 6); // undefined\n * ArrayExt.findFirstValue(data, isEven, 6, 5); // 2\n * ```\n */\n function findFirstValue(array, fn, start = 0, stop = -1) {\n let index = findFirstIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findFirstValue = findFirstValue;\n /**\n * Find the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The last matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastValue(data, isEven); // 2\n * ArrayExt.findLastValue(data, isEven, 4); // 4\n * ArrayExt.findLastValue(data, isEven, 0); // undefined\n * ArrayExt.findLastValue(data, isEven, 0, 1); // 2\n * ```\n */\n function findLastValue(array, fn, start = -1, stop = 0) {\n let index = findLastIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findLastValue = findLastValue;\n /**\n * Find the index of the first element which compares `>=` to a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>=` to the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.lowerBound(data, 0, numberCmp); // 0\n * ArrayExt.lowerBound(data, 6, numberCmp); // 3\n * ArrayExt.lowerBound(data, 7, numberCmp); // 3\n * ArrayExt.lowerBound(data, -1, numberCmp); // 0\n * ArrayExt.lowerBound(data, 10, numberCmp); // 6\n * ```\n */\n function lowerBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) < 0) {\n begin = middle + 1;\n span -= half + 1;\n }\n else {\n span = half;\n }\n }\n return begin;\n }\n ArrayExt.lowerBound = lowerBound;\n /**\n * Find the index of the first element which compares `>` than a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>` than the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.upperBound(data, 0, numberCmp); // 1\n * ArrayExt.upperBound(data, 6, numberCmp); // 3\n * ArrayExt.upperBound(data, 7, numberCmp); // 5\n * ArrayExt.upperBound(data, -1, numberCmp); // 0\n * ArrayExt.upperBound(data, 10, numberCmp); // 6\n * ```\n */\n function upperBound(array, value, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let begin = start;\n let span = stop - start + 1;\n while (span > 0) {\n let half = span >> 1;\n let middle = begin + half;\n if (fn(array[middle], value) > 0) {\n span = half;\n }\n else {\n begin = middle + 1;\n span -= half + 1;\n }\n }\n return begin;\n }\n ArrayExt.upperBound = upperBound;\n /**\n * Test whether two arrays are shallowly equal.\n *\n * @param a - The first array-like object to compare.\n *\n * @param b - The second array-like object to compare.\n *\n * @param fn - The comparison function to apply to the elements. It\n * should return `true` if the elements are \"equal\". The default\n * compares elements using strict `===` equality.\n *\n * @returns Whether the two arrays are shallowly equal.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * Modifying the length of the arrays while comparing.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let d1 = [0, 3, 4, 7, 7, 9];\n * let d2 = [0, 3, 4, 7, 7, 9];\n * let d3 = [42];\n * ArrayExt.shallowEqual(d1, d2); // true\n * ArrayExt.shallowEqual(d2, d3); // false\n * ```\n */\n function shallowEqual(a, b, fn) {\n // Check for object identity first.\n if (a === b) {\n return true;\n }\n // Bail early if the lengths are different.\n if (a.length !== b.length) {\n return false;\n }\n // Compare each element for equality.\n for (let i = 0, n = a.length; i < n; ++i) {\n if (fn ? !fn(a[i], b[i]) : a[i] !== b[i]) {\n return false;\n }\n }\n // The array are shallowly equal.\n return true;\n }\n ArrayExt.shallowEqual = shallowEqual;\n /**\n * Create a slice of an array subject to an optional step.\n *\n * @param array - The array-like object of interest.\n *\n * @param options - The options for configuring the slice.\n *\n * @returns A new array with the specified values.\n *\n * @throws An exception if the slice `step` is `0`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start`, `stop`, or `step` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.slice(data); // [0, 3, 4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 2 }); // [4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 0, stop: 4 }); // [0, 3, 4, 7]\n * ArrayExt.slice(data, { step: 2 }); // [0, 4, 7]\n * ArrayExt.slice(data, { step: -1 }); // [9, 7, 7, 4, 3, 0]\n * ```\n */\n function slice(array, options = {}) {\n // Extract the options.\n let { start, stop, step } = options;\n // Set up the `step` value.\n if (step === undefined) {\n step = 1;\n }\n // Validate the step size.\n if (step === 0) {\n throw new Error('Slice `step` cannot be zero.');\n }\n // Look up the length of the array.\n let n = array.length;\n // Set up the `start` value.\n if (start === undefined) {\n start = step < 0 ? n - 1 : 0;\n }\n else if (start < 0) {\n start = Math.max(start + n, step < 0 ? -1 : 0);\n }\n else if (start >= n) {\n start = step < 0 ? n - 1 : n;\n }\n // Set up the `stop` value.\n if (stop === undefined) {\n stop = step < 0 ? -1 : n;\n }\n else if (stop < 0) {\n stop = Math.max(stop + n, step < 0 ? -1 : 0);\n }\n else if (stop >= n) {\n stop = step < 0 ? n - 1 : n;\n }\n // Compute the slice length.\n let length;\n if ((step < 0 && stop >= start) || (step > 0 && start >= stop)) {\n length = 0;\n }\n else if (step < 0) {\n length = Math.floor((stop - start + 1) / step + 1);\n }\n else {\n length = Math.floor((stop - start - 1) / step + 1);\n }\n // Compute the sliced result.\n let result = [];\n for (let i = 0; i < length; ++i) {\n result[i] = array[start + i * step];\n }\n // Return the result.\n return result;\n }\n ArrayExt.slice = slice;\n /**\n * Move an element in an array from one index to another.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param fromIndex - The index of the element to move. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param toIndex - The target index of the element. Negative\n * values are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `fromIndex` or `toIndex` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.move(data, 1, 2); // [0, 2, 1, 3, 4]\n * ArrayExt.move(data, 4, 2); // [0, 2, 4, 1, 3]\n * ```\n */\n function move(array, fromIndex, toIndex) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (fromIndex < 0) {\n fromIndex = Math.max(0, fromIndex + n);\n }\n else {\n fromIndex = Math.min(fromIndex, n - 1);\n }\n if (toIndex < 0) {\n toIndex = Math.max(0, toIndex + n);\n }\n else {\n toIndex = Math.min(toIndex, n - 1);\n }\n if (fromIndex === toIndex) {\n return;\n }\n let value = array[fromIndex];\n let d = fromIndex < toIndex ? 1 : -1;\n for (let i = fromIndex; i !== toIndex; i += d) {\n array[i] = array[i + d];\n }\n array[toIndex] = value;\n }\n ArrayExt.move = move;\n /**\n * Reverse an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param start - The index of the first element in the range to be\n * reversed, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * reversed, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` index which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.reverse(data, 1, 3); // [0, 3, 2, 1, 4]\n * ArrayExt.reverse(data, 3); // [0, 3, 2, 4, 1]\n * ArrayExt.reverse(data); // [1, 4, 2, 3, 0]\n * ```\n */\n function reverse(array, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n while (start < stop) {\n let a = array[start];\n let b = array[stop];\n array[start++] = b;\n array[stop--] = a;\n }\n }\n ArrayExt.reverse = reverse;\n /**\n * Rotate the elements of an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param delta - The amount of rotation to apply to the elements. A\n * positive value will rotate the elements to the left. A negative\n * value will rotate the elements to the right.\n *\n * @param start - The index of the first element in the range to be\n * rotated, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * rotated, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `delta`, `start`, or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.rotate(data, 2); // [2, 3, 4, 0, 1]\n * ArrayExt.rotate(data, -2); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 10); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 9); // [4, 0, 1, 2, 3]\n * ArrayExt.rotate(data, 2, 1, 3); // [4, 2, 0, 1, 3]\n * ```\n */\n function rotate(array, delta, start = 0, stop = -1) {\n let n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n if (start >= stop) {\n return;\n }\n let length = stop - start + 1;\n if (delta > 0) {\n delta = delta % length;\n }\n else if (delta < 0) {\n delta = ((delta % length) + length) % length;\n }\n if (delta === 0) {\n return;\n }\n let pivot = start + delta;\n reverse(array, start, pivot - 1);\n reverse(array, pivot, stop);\n reverse(array, start, stop);\n }\n ArrayExt.rotate = rotate;\n /**\n * Fill an array with a static value.\n *\n * @param array - The mutable array-like object to fill.\n *\n * @param value - The static value to use to fill the array.\n *\n * @param start - The index of the first element in the range to be\n * filled, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * filled, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Notes\n * If `stop < start` the fill will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four'];\n * ArrayExt.fill(data, 'r'); // ['r', 'r', 'r', 'r']\n * ArrayExt.fill(data, 'g', 1); // ['r', 'g', 'g', 'g']\n * ArrayExt.fill(data, 'b', 2, 3); // ['r', 'g', 'b', 'b']\n * ArrayExt.fill(data, 'z', 3, 1); // ['z', 'z', 'b', 'z']\n * ```\n */\n function fill(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let span;\n if (stop < start) {\n span = stop + 1 + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (let i = 0; i < span; ++i) {\n array[(start + i) % n] = value;\n }\n }\n ArrayExt.fill = fill;\n /**\n * Insert a value into an array at a specific index.\n *\n * @param array - The array of interest.\n *\n * @param index - The index at which to insert the value. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param value - The value to set at the specified index.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2];\n * ArrayExt.insert(data, 0, -1); // [-1, 0, 1, 2]\n * ArrayExt.insert(data, 2, 12); // [-1, 0, 12, 1, 2]\n * ArrayExt.insert(data, -1, 7); // [-1, 0, 12, 1, 7, 2]\n * ArrayExt.insert(data, 6, 19); // [-1, 0, 12, 1, 7, 2, 19]\n * ```\n */\n function insert(array, index, value) {\n let n = array.length;\n if (index < 0) {\n index = Math.max(0, index + n);\n }\n else {\n index = Math.min(index, n);\n }\n for (let i = n; i > index; --i) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n }\n ArrayExt.insert = insert;\n /**\n * Remove and return a value at a specific index in an array.\n *\n * @param array - The array of interest.\n *\n * @param index - The index of the value to remove. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The value at the specified index, or `undefined` if the\n * index is out of range.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeAt(data, 2); // 23\n * ArrayExt.removeAt(data, -2); // 12\n * ArrayExt.removeAt(data, 10); // undefined;\n * ```\n */\n function removeAt(array, index) {\n let n = array.length;\n if (index < 0) {\n index += n;\n }\n if (index < 0 || index >= n) {\n return undefined;\n }\n let value = array[index];\n for (let i = index + 1; i < n; ++i) {\n array[i - 1] = array[i];\n }\n array.length = n - 1;\n return value;\n }\n ArrayExt.removeAt = removeAt;\n /**\n * Remove the first occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstOf(data, 12); // 1\n * ArrayExt.removeFirstOf(data, 17); // -1\n * ArrayExt.removeFirstOf(data, 39, 3); // -1\n * ArrayExt.removeFirstOf(data, 39, 3, 2); // 2\n * ```\n */\n function removeFirstOf(array, value, start = 0, stop = -1) {\n let index = firstIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeFirstOf = removeFirstOf;\n /**\n * Remove the last occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastOf(data, 12); // 5\n * ArrayExt.removeLastOf(data, 17); // -1\n * ArrayExt.removeLastOf(data, 39, 2); // -1\n * ArrayExt.removeLastOf(data, 39, 2, 3); // 3\n * ```\n */\n function removeLastOf(array, value, start = -1, stop = 0) {\n let index = lastIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeLastOf = removeLastOf;\n /**\n * Remove all occurrences of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [14, 12, 23, 39, 14, 12, 19, 14];\n * ArrayExt.removeAllOf(data, 12); // 2\n * ArrayExt.removeAllOf(data, 17); // 0\n * ArrayExt.removeAllOf(data, 14, 1, 4); // 1\n * ```\n */\n function removeAllOf(array, value, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && array[i] === value) {\n count++;\n }\n else if (stop < start &&\n (i <= stop || i >= start) &&\n array[i] === value) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllOf = removeAllOf;\n /**\n * Remove the first occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstWhere(data, isEven); // { index: 0, value: 0 }\n * ArrayExt.removeFirstWhere(data, isEven, 2); // { index: 3, value: 14 }\n * ArrayExt.removeFirstWhere(data, isEven, 4); // { index: -1, value: undefined }\n * ```\n */\n function removeFirstWhere(array, fn, start = 0, stop = -1) {\n let value;\n let index = findFirstIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeFirstWhere = removeFirstWhere;\n /**\n * Remove the last occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastWhere(data, isEven); // { index: 5, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2); // { index: 1, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2, 1); // { index: -1, value: undefined }\n * ```\n */\n function removeLastWhere(array, fn, start = -1, stop = 0) {\n let value;\n let index = findLastIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index, value };\n }\n ArrayExt.removeLastWhere = removeLastWhere;\n /**\n * Remove all occurrences of values which match a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * function isNegative(value: number): boolean {\n * return value < 0;\n * }\n *\n * let data = [0, 12, -13, -9, 23, 39, 14, -15, 12, 75];\n * ArrayExt.removeAllWhere(data, isEven); // 4\n * ArrayExt.removeAllWhere(data, isNegative, 0, 3); // 2\n * ```\n */\n function removeAllWhere(array, fn, start = 0, stop = -1) {\n let n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n let count = 0;\n for (let i = 0; i < n; ++i) {\n if (start <= stop && i >= start && i <= stop && fn(array[i], i)) {\n count++;\n }\n else if (stop < start && (i <= stop || i >= start) && fn(array[i], i)) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllWhere = removeAllWhere;\n})(ArrayExt || (ArrayExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Chain together several iterables.\n *\n * @deprecated\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields the values of the iterables\n * in the order in which they are supplied.\n *\n * #### Example\n * ```typescript\n * import { chain } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = chain(data1, data2);\n *\n * Array.from(stream); // [1, 2, 3, 4, 5, 6]\n * ```\n */\nfunction* chain(...objects) {\n for (const object of objects) {\n yield* object;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an empty iterator.\n *\n * @returns A new iterator which yields nothing.\n *\n * #### Example\n * ```typescript\n * import { empty } from '@lumino/algorithm';\n *\n * let stream = empty();\n *\n * Array.from(stream); // []\n * ```\n */\n// eslint-disable-next-line require-yield\nfunction* empty() {\n return;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Enumerate an iterable object.\n *\n * @param object - The iterable object of interest.\n *\n * @param start - The starting enum value. The default is `0`.\n *\n * @returns An iterator which yields the enumerated values.\n *\n * #### Example\n * ```typescript\n * import { enumerate } from '@lumino/algorithm';\n *\n * let data = ['foo', 'bar', 'baz'];\n *\n * let stream = enumerate(data, 1);\n *\n * Array.from(stream); // [[1, 'foo'], [2, 'bar'], [3, 'baz']]\n * ```\n */\nfunction* enumerate(object, start = 0) {\n for (const value of object) {\n yield [start++, value];\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Filter an iterable for values which pass a test.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns An iterator which yields the values which pass the test.\n *\n * #### Example\n * ```typescript\n * import { filter } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = filter(data, value => value % 2 === 0);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* filter(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Find the first value in an iterable which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { find } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * find(data, isCat).name; // 'fluffy'\n * ```\n */\nfunction find(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return value;\n }\n }\n return undefined;\n}\n/**\n * Find the index of the first value which matches a predicate.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { findIndex } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * findIndex(data, isCat); // 1\n * ```\n */\nfunction findIndex(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return index - 1;\n }\n }\n return -1;\n}\n/**\n * Find the minimum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The minimum value in the iterable. If multiple values are\n * equivalent to the minimum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { min } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * min([7, 4, 0, 3, 9, 4], numberCmp); // 0\n * ```\n */\nfunction min(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) < 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the maximum value in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The maximum value in the iterable. If multiple values are\n * equivalent to the maximum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { max } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * max([7, 4, 0, 3, 9, 4], numberCmp); // 9\n * ```\n */\nfunction max(object, fn) {\n let result = undefined;\n for (const value of object) {\n if (result === undefined) {\n result = value;\n continue;\n }\n if (fn(value, result) > 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the minimum and maximum values in an iterable.\n *\n * @param object - The iterable object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns A 2-tuple of the `[min, max]` values in the iterable. If\n * multiple values are equivalent, the left-most values are returned.\n * If the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { minmax } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * minmax([7, 4, 0, 3, 9, 4], numberCmp); // [0, 9]\n * ```\n */\nfunction minmax(object, fn) {\n let empty = true;\n let vmin;\n let vmax;\n for (const value of object) {\n if (empty) {\n vmin = value;\n vmax = value;\n empty = false;\n }\n else if (fn(value, vmin) < 0) {\n vmin = value;\n }\n else if (fn(value, vmax) > 0) {\n vmax = value;\n }\n }\n return empty ? undefined : [vmin, vmax];\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an array from an iterable of values.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new array of values from the given object.\n *\n * #### Example\n * ```typescript\n * import { toArray } from '@lumino/algorithm';\n *\n * let stream = [1, 2, 3, 4, 5, 6][Symbol.iterator]();\n *\n * toArray(stream); // [1, 2, 3, 4, 5, 6];\n * ```\n */\nfunction toArray(object) {\n return Array.from(object);\n}\n/**\n * Create an object from an iterable of key/value pairs.\n *\n * @param object - The iterable object of interest.\n *\n * @returns A new object mapping keys to values.\n *\n * #### Example\n * ```typescript\n * import { toObject } from '@lumino/algorithm';\n *\n * let data: [string, number][] = [['one', 1], ['two', 2], ['three', 3]];\n *\n * toObject(data); // { one: 1, two: 2, three: 3 }\n * ```\n */\nfunction toObject(object) {\n const result = {};\n for (const [key, value] of object) {\n result[key] = value;\n }\n return result;\n}\n/**\n * Invoke a function for each value in an iterable.\n *\n * @deprecated\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The callback function to invoke for each value.\n *\n * #### Notes\n * Iteration can be terminated early by returning `false` from the\n * callback function.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each } from '@lumino/algorithm';\n *\n * let data = [5, 7, 0, -2, 9];\n *\n * each(data, value => { console.log(value); });\n * ```\n */\nfunction each(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return;\n }\n }\n}\n/**\n * Test whether all values in an iterable satisfy a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if all values pass the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `false` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { every } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * every(data, value => value % 2 === 0); // false\n * every(data, value => value % 2 === 1); // true\n * ```\n */\nfunction every(object, fn) {\n let index = 0;\n for (const value of object) {\n if (false === fn(value, index++)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Test whether any value in an iterable satisfies a predicate.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if any value passes the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `true` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { some } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * some(data, value => value === 7); // true\n * some(data, value => value === 3); // false\n * ```\n */\nfunction some(object, fn) {\n let index = 0;\n for (const value of object) {\n if (fn(value, index++)) {\n return true;\n }\n }\n return false;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Transform the values of an iterable with a mapping function.\n *\n * @param object - The iterable object of interest.\n *\n * @param fn - The mapping function to invoke for each value.\n *\n * @returns An iterator which yields the transformed values.\n *\n * #### Example\n * ```typescript\n * import { map } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3];\n *\n * let stream = map(data, value => value * 2);\n *\n * Array.from(stream); // [2, 4, 6]\n * ```\n */\nfunction* map(object, fn) {\n let index = 0;\n for (const value of object) {\n yield fn(value, index++);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator of evenly spaced values.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns An iterator which produces evenly spaced values.\n *\n * #### Notes\n * In the single argument form of `range(stop)`, `start` defaults to\n * `0` and `step` defaults to `1`.\n *\n * In the two argument form of `range(start, stop)`, `step` defaults\n * to `1`.\n *\n * #### Example\n * ```typescript\n * import { range } from '@lumino/algorithm';\n *\n * let stream = range(2, 4);\n *\n * Array.from(stream); // [2, 3]\n * ```\n */\nfunction* range(start, stop, step) {\n if (stop === undefined) {\n stop = start;\n start = 0;\n step = 1;\n }\n else if (step === undefined) {\n step = 1;\n }\n const length = Private.rangeLength(start, stop, step);\n for (let index = 0; index < length; index++) {\n yield start + step * index;\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Compute the effective length of a range.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns The number of steps need to traverse the range.\n */\n function rangeLength(start, stop, step) {\n if (step === 0) {\n return Infinity;\n }\n if (start > stop && step > 0) {\n return 0;\n }\n if (start < stop && step < 0) {\n return 0;\n }\n return Math.ceil((stop - start) / step);\n }\n Private.rangeLength = rangeLength;\n})(Private || (Private = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nfunction reduce(object, fn, initial) {\n // Setup the iterator and fetch the first value.\n const it = object[Symbol.iterator]();\n let index = 0;\n let first = it.next();\n // An empty iterator and no initial value is an error.\n if (first.done && initial === undefined) {\n throw new TypeError('Reduce of empty iterable with no initial value.');\n }\n // If the iterator is empty, return the initial value.\n if (first.done) {\n return initial;\n }\n // If the iterator has a single item and no initial value, the\n // reducer is not invoked and the first item is the return value.\n let second = it.next();\n if (second.done && initial === undefined) {\n return first.value;\n }\n // If iterator has a single item and an initial value is provided,\n // the reducer is invoked and that result is the return value.\n if (second.done) {\n return fn(initial, first.value, index++);\n }\n // Setup the initial accumlated value.\n let accumulator;\n if (initial === undefined) {\n accumulator = fn(first.value, second.value, index++);\n }\n else {\n accumulator = fn(fn(initial, first.value, index++), second.value, index++);\n }\n // Iterate the rest of the values, updating the accumulator.\n let next;\n while (!(next = it.next()).done) {\n accumulator = fn(accumulator, next.value, index++);\n }\n // Return the final accumulated value.\n return accumulator;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator which repeats a value a number of times.\n *\n * @deprecated\n *\n * @param value - The value to repeat.\n *\n * @param count - The number of times to repeat the value.\n *\n * @returns A new iterator which repeats the specified value.\n *\n * #### Example\n * ```typescript\n * import { repeat } from '@lumino/algorithm';\n *\n * let stream = repeat(7, 3);\n *\n * Array.from(stream); // [7, 7, 7]\n * ```\n */\nfunction* repeat(value, count) {\n while (0 < count--) {\n yield value;\n }\n}\n/**\n * Create an iterator which yields a value a single time.\n *\n * @deprecated\n *\n * @param value - The value to wrap in an iterator.\n *\n * @returns A new iterator which yields the value a single time.\n *\n * #### Example\n * ```typescript\n * import { once } from '@lumino/algorithm';\n *\n * let stream = once(7);\n *\n * Array.from(stream); // [7]\n * ```\n */\nfunction* once(value) {\n yield value;\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator for a retroable object.\n *\n * @param object - The retroable or array-like object of interest.\n *\n * @returns An iterator which traverses the object's values in reverse.\n *\n * #### Example\n * ```typescript\n * import { retro } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = retro(data);\n *\n * Array.from(stream); // [6, 5, 4, 3, 2, 1]\n * ```\n */\nfunction* retro(object) {\n if (typeof object.retro === 'function') {\n yield* object.retro();\n }\n else {\n for (let index = object.length - 1; index > -1; index--) {\n yield object[index];\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Topologically sort an iterable of edges.\n *\n * @param edges - The iterable object of edges to sort.\n * An edge is represented as a 2-tuple of `[fromNode, toNode]`.\n *\n * @returns The topologically sorted array of nodes.\n *\n * #### Notes\n * If a cycle is present in the graph, the cycle will be ignored and\n * the return value will be only approximately sorted.\n *\n * #### Example\n * ```typescript\n * import { topologicSort } from '@lumino/algorithm';\n *\n * let data = [\n * ['d', 'e'],\n * ['c', 'd'],\n * ['a', 'b'],\n * ['b', 'c']\n * ];\n *\n * topologicSort(data); // ['a', 'b', 'c', 'd', 'e']\n * ```\n */\nfunction topologicSort(edges) {\n // Setup the shared sorting state.\n let sorted = [];\n let visited = new Set();\n let graph = new Map();\n // Add the edges to the graph.\n for (const edge of edges) {\n addEdge(edge);\n }\n // Visit each node in the graph.\n for (const [k] of graph) {\n visit(k);\n }\n // Return the sorted results.\n return sorted;\n // Add an edge to the graph.\n function addEdge(edge) {\n let [fromNode, toNode] = edge;\n let children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n }\n else {\n graph.set(toNode, [fromNode]);\n }\n }\n // Recursively visit the node.\n function visit(node) {\n if (visited.has(node)) {\n return;\n }\n visited.add(node);\n let children = graph.get(node);\n if (children) {\n for (const child of children) {\n visit(child);\n }\n }\n sorted.push(node);\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate over an iterable using a stepped increment.\n *\n * @param object - The iterable object of interest.\n *\n * @param step - The distance to step on each iteration. A value\n * of less than `1` will behave the same as a value of `1`.\n *\n * @returns An iterator which traverses the iterable step-wise.\n *\n * #### Example\n * ```typescript\n * import { stride } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = stride(data, 2);\n *\n * Array.from(stream); // [1, 3, 5];\n * ```\n */\nfunction* stride(object, step) {\n let count = 0;\n for (const value of object) {\n if (0 === count++ % step) {\n yield value;\n }\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * The namespace for string-specific algorithms.\n */\nvar StringExt;\n(function (StringExt) {\n /**\n * Find the indices of characters in a source text.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The matched indices, or `null` if there is no match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * In order for there to be a match, all of the characters in `query`\n * **must** appear in `source` in the order given by `query`.\n *\n * Characters are matched using strict `===` equality.\n */\n function findIndices(source, query, start = 0) {\n let indices = new Array(query.length);\n for (let i = 0, j = start, n = query.length; i < n; ++i, ++j) {\n j = source.indexOf(query[i], j);\n if (j === -1) {\n return null;\n }\n indices[i] = j;\n }\n return indices;\n }\n StringExt.findIndices = findIndices;\n /**\n * A string matcher which uses a sum-of-squares algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-squares approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The index of each\n * matching character is squared and added to the score. This means\n * that early and consecutive character matches are preferred, while\n * late matches are heavily penalized.\n */\n function matchSumOfSquares(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i] - start;\n score += j * j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfSquares = matchSumOfSquares;\n /**\n * A string matcher which uses a sum-of-deltas algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-deltas approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The delta between\n * the indices are summed to create the score. This means that groups\n * of matched characters are preferred, while fragmented matches are\n * penalized.\n */\n function matchSumOfDeltas(source, query, start = 0) {\n let indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n let score = 0;\n let last = start - 1;\n for (let i = 0, n = indices.length; i < n; ++i) {\n let j = indices[i];\n score += j - last - 1;\n last = j;\n }\n return { score, indices };\n }\n StringExt.matchSumOfDeltas = matchSumOfDeltas;\n /**\n * Highlight the matched characters of a source text.\n *\n * @param source - The text which should be highlighted.\n *\n * @param indices - The indices of the matched characters. They must\n * appear in increasing order and must be in bounds of the source.\n *\n * @param fn - The function to apply to the matched chunks.\n *\n * @returns An array of unmatched and highlighted chunks.\n */\n function highlight(source, indices, fn) {\n // Set up the result array.\n let result = [];\n // Set up the counter variables.\n let k = 0;\n let last = 0;\n let n = indices.length;\n // Iterator over each index.\n while (k < n) {\n // Set up the chunk indices.\n let i = indices[k];\n let j = indices[k];\n // Advance the right chunk index until it's non-contiguous.\n while (++k < n && indices[k] === j + 1) {\n j++;\n }\n // Extract the unmatched text.\n if (last < i) {\n result.push(source.slice(last, i));\n }\n // Extract and highlight the matched text.\n if (i < j + 1) {\n result.push(fn(source.slice(i, j + 1)));\n }\n // Update the last visited index.\n last = j + 1;\n }\n // Extract any remaining unmatched text.\n if (last < source.length) {\n result.push(source.slice(last));\n }\n // Return the highlighted result.\n return result;\n }\n StringExt.highlight = highlight;\n /**\n * A 3-way string comparison function.\n *\n * @param a - The first string of interest.\n *\n * @param b - The second string of interest.\n *\n * @returns `-1` if `a < b`, else `1` if `a > b`, else `0`.\n */\n function cmp(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n }\n StringExt.cmp = cmp;\n})(StringExt || (StringExt = {}));\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Take a fixed number of items from an iterable.\n *\n * @param object - The iterable object of interest.\n *\n * @param count - The number of items to take from the iterable.\n *\n * @returns An iterator which yields the specified number of items\n * from the source iterable.\n *\n * #### Notes\n * The returned iterator will exhaust early if the source iterable\n * contains an insufficient number of items.\n *\n * #### Example\n * ```typescript\n * import { take } from '@lumino/algorithm';\n *\n * let stream = take([5, 4, 3, 2, 1, 0, -1], 3);\n *\n * Array.from(stream); // [5, 4, 3]\n * ```\n */\nfunction* take(object, count) {\n if (count < 1) {\n return;\n }\n const it = object[Symbol.iterator]();\n let item;\n while (0 < count-- && !(item = it.next()).done) {\n yield item.value;\n }\n}\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Iterate several iterables in lockstep.\n *\n * @param objects - The iterable objects of interest.\n *\n * @returns An iterator which yields successive tuples of values where\n * each value is taken in turn from the provided iterables. It will\n * be as long as the shortest provided iterable.\n *\n * #### Example\n * ```typescript\n * import { zip } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = zip(data1, data2);\n *\n * Array.from(stream); // [[1, 4], [2, 5], [3, 6]]\n * ```\n */\nfunction* zip(...objects) {\n const iters = objects.map(obj => obj[Symbol.iterator]());\n let tuple = iters.map(it => it.next());\n for (; every(tuple, item => !item.done); tuple = iters.map(it => it.next())) {\n yield tuple.map(item => item.value);\n }\n}\n\nexport { ArrayExt, StringExt, chain, each, empty, enumerate, every, filter, find, findIndex, map, max, min, minmax, once, range, reduce, repeat, retro, some, stride, take, toArray, toObject, topologicSort, zip };\n//# sourceMappingURL=index.es6.js.map\n","import { find, ArrayExt } from '@lumino/algorithm';\nimport { PromiseDelegate } from '@lumino/coreutils';\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module signaling\n */\n/**\n * A concrete implementation of `ISignal`.\n *\n * #### Example\n * ```typescript\n * import { ISignal, Signal } from '@lumino/signaling';\n *\n * class SomeClass {\n *\n * constructor(name: string) {\n * this.name = name;\n * }\n *\n * readonly name: string;\n *\n * get valueChanged: ISignal {\n * return this._valueChanged;\n * }\n *\n * get value(): number {\n * return this._value;\n * }\n *\n * set value(value: number) {\n * if (value === this._value) {\n * return;\n * }\n * this._value = value;\n * this._valueChanged.emit(value);\n * }\n *\n * private _value = 0;\n * private _valueChanged = new Signal(this);\n * }\n *\n * function logger(sender: SomeClass, value: number): void {\n * console.log(sender.name, value);\n * }\n *\n * let m1 = new SomeClass('foo');\n * let m2 = new SomeClass('bar');\n *\n * m1.valueChanged.connect(logger);\n * m2.valueChanged.connect(logger);\n *\n * m1.value = 42; // logs: foo 42\n * m2.value = 17; // logs: bar 17\n * ```\n */\nclass Signal {\n /**\n * Construct a new signal.\n *\n * @param sender - The sender which owns the signal.\n */\n constructor(sender) {\n this.sender = sender;\n }\n /**\n * Connect a slot to the signal.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n */\n connect(slot, thisArg) {\n return Private.connect(this, slot, thisArg);\n }\n /**\n * Disconnect a slot from the signal.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n */\n disconnect(slot, thisArg) {\n return Private.disconnect(this, slot, thisArg);\n }\n /**\n * Emit the signal and invoke the connected slots.\n *\n * @param args - The args to pass to the connected slots.\n *\n * #### Notes\n * Slots are invoked synchronously in connection order.\n *\n * Exceptions thrown by connected slots will be caught and logged.\n */\n emit(args) {\n Private.emit(this, args);\n }\n}\n/**\n * The namespace for the `Signal` class statics.\n */\n(function (Signal) {\n /**\n * Remove all connections between a sender and receiver.\n *\n * @param sender - The sender object of interest.\n *\n * @param receiver - The receiver object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n function disconnectBetween(sender, receiver) {\n Private.disconnectBetween(sender, receiver);\n }\n Signal.disconnectBetween = disconnectBetween;\n /**\n * Remove all connections where the given object is the sender.\n *\n * @param sender - The sender object of interest.\n */\n function disconnectSender(sender) {\n Private.disconnectSender(sender);\n }\n Signal.disconnectSender = disconnectSender;\n /**\n * Remove all connections where the given object is the receiver.\n *\n * @param receiver - The receiver object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n function disconnectReceiver(receiver) {\n Private.disconnectReceiver(receiver);\n }\n Signal.disconnectReceiver = disconnectReceiver;\n /**\n * Remove all connections where an object is the sender or receiver.\n *\n * @param object - The object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n function disconnectAll(object) {\n Private.disconnectAll(object);\n }\n Signal.disconnectAll = disconnectAll;\n /**\n * Clear all signal data associated with the given object.\n *\n * @param object - The object for which the data should be cleared.\n *\n * #### Notes\n * This removes all signal connections and any other signal data\n * associated with the object.\n */\n function clearData(object) {\n Private.disconnectAll(object);\n }\n Signal.clearData = clearData;\n /**\n * Get the signal exception handler.\n *\n * @returns The current exception handler.\n *\n * #### Notes\n * The default exception handler is `console.error`.\n */\n function getExceptionHandler() {\n return Private.exceptionHandler;\n }\n Signal.getExceptionHandler = getExceptionHandler;\n /**\n * Set the signal exception handler.\n *\n * @param handler - The function to use as the exception handler.\n *\n * @returns The old exception handler.\n *\n * #### Notes\n * The exception handler is invoked when a slot throws an exception.\n */\n function setExceptionHandler(handler) {\n let old = Private.exceptionHandler;\n Private.exceptionHandler = handler;\n return old;\n }\n Signal.setExceptionHandler = setExceptionHandler;\n})(Signal || (Signal = {}));\n/**\n * A concrete implementation of `IStream`.\n *\n * #### Example\n * ```typescript\n * import { IStream, Stream } from '@lumino/signaling';\n *\n * class SomeClass {\n *\n * constructor(name: string) {\n * this.name = name;\n * }\n *\n * readonly name: string;\n *\n * get pings(): IStream {\n * return this._pings;\n * }\n *\n * ping(value: string) {\n * this._pings.emit(value);\n * }\n *\n * private _pings = new Stream(this);\n * }\n *\n * let m1 = new SomeClass('foo');\n *\n * m1.pings.connect((_, value: string) => {\n * console.log('connect', value);\n * });\n *\n * void (async () => {\n * for await (const ping of m1.pings) {\n * console.log('iterator', ping);\n * }\n * })();\n *\n * m1.ping('alpha'); // logs: connect alpha\n * // logs: iterator alpha\n * m1.ping('beta'); // logs: connect beta\n * // logs: iterator beta\n * ```\n */\nclass Stream extends Signal {\n constructor() {\n super(...arguments);\n this._pending = new PromiseDelegate();\n }\n /**\n * Return an async iterator that yields every emission.\n */\n async *[Symbol.asyncIterator]() {\n let pending = this._pending;\n while (true) {\n try {\n const { args, next } = await pending.promise;\n pending = next;\n yield args;\n }\n catch (_) {\n return; // Any promise rejection stops the iterator.\n }\n }\n }\n /**\n * Emit the signal, invoke the connected slots, and yield the emission.\n *\n * @param args - The args to pass to the connected slots.\n */\n emit(args) {\n const pending = this._pending;\n const next = (this._pending = new PromiseDelegate());\n pending.resolve({ args, next });\n super.emit(args);\n }\n /**\n * Stop the stream's async iteration.\n */\n stop() {\n this._pending.promise.catch(() => undefined);\n this._pending.reject('stop');\n this._pending = new PromiseDelegate();\n }\n}\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The signal exception handler function.\n */\n Private.exceptionHandler = (err) => {\n console.error(err);\n };\n /**\n * Connect a slot to a signal.\n *\n * @param signal - The signal of interest.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n */\n function connect(signal, slot, thisArg) {\n // Coerce a `null` `thisArg` to `undefined`.\n thisArg = thisArg || undefined;\n // Ensure the sender's array of receivers is created.\n let receivers = receiversForSender.get(signal.sender);\n if (!receivers) {\n receivers = [];\n receiversForSender.set(signal.sender, receivers);\n }\n // Bail if a matching connection already exists.\n if (findConnection(receivers, signal, slot, thisArg)) {\n return false;\n }\n // Choose the best object for the receiver.\n let receiver = thisArg || slot;\n // Ensure the receiver's array of senders is created.\n let senders = sendersForReceiver.get(receiver);\n if (!senders) {\n senders = [];\n sendersForReceiver.set(receiver, senders);\n }\n // Create a new connection and add it to the end of each array.\n let connection = { signal, slot, thisArg };\n receivers.push(connection);\n senders.push(connection);\n // Indicate a successful connection.\n return true;\n }\n Private.connect = connect;\n /**\n * Disconnect a slot from a signal.\n *\n * @param signal - The signal of interest.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n */\n function disconnect(signal, slot, thisArg) {\n // Coerce a `null` `thisArg` to `undefined`.\n thisArg = thisArg || undefined;\n // Lookup the list of receivers, and bail if none exist.\n let receivers = receiversForSender.get(signal.sender);\n if (!receivers || receivers.length === 0) {\n return false;\n }\n // Bail if no matching connection exits.\n let connection = findConnection(receivers, signal, slot, thisArg);\n if (!connection) {\n return false;\n }\n // Choose the best object for the receiver.\n let receiver = thisArg || slot;\n // Lookup the array of senders, which is now known to exist.\n let senders = sendersForReceiver.get(receiver);\n // Clear the connection and schedule cleanup of the arrays.\n connection.signal = null;\n scheduleCleanup(receivers);\n scheduleCleanup(senders);\n // Indicate a successful disconnection.\n return true;\n }\n Private.disconnect = disconnect;\n /**\n * Remove all connections between a sender and receiver.\n *\n * @param sender - The sender object of interest.\n *\n * @param receiver - The receiver object of interest.\n */\n function disconnectBetween(sender, receiver) {\n // If there are no receivers, there is nothing to do.\n let receivers = receiversForSender.get(sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n // If there are no senders, there is nothing to do.\n let senders = sendersForReceiver.get(receiver);\n if (!senders || senders.length === 0) {\n return;\n }\n // Clear each connection between the sender and receiver.\n for (const connection of senders) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n continue;\n }\n // Clear the connection if it matches the sender.\n if (connection.signal.sender === sender) {\n connection.signal = null;\n }\n }\n // Schedule a cleanup of the senders and receivers.\n scheduleCleanup(receivers);\n scheduleCleanup(senders);\n }\n Private.disconnectBetween = disconnectBetween;\n /**\n * Remove all connections where the given object is the sender.\n *\n * @param sender - The sender object of interest.\n */\n function disconnectSender(sender) {\n // If there are no receivers, there is nothing to do.\n let receivers = receiversForSender.get(sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n // Clear each receiver connection.\n for (const connection of receivers) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n continue;\n }\n // Choose the best object for the receiver.\n let receiver = connection.thisArg || connection.slot;\n // Clear the connection.\n connection.signal = null;\n // Cleanup the array of senders, which is now known to exist.\n scheduleCleanup(sendersForReceiver.get(receiver));\n }\n // Schedule a cleanup of the receivers.\n scheduleCleanup(receivers);\n }\n Private.disconnectSender = disconnectSender;\n /**\n * Remove all connections where the given object is the receiver.\n *\n * @param receiver - The receiver object of interest.\n */\n function disconnectReceiver(receiver) {\n // If there are no senders, there is nothing to do.\n let senders = sendersForReceiver.get(receiver);\n if (!senders || senders.length === 0) {\n return;\n }\n // Clear each sender connection.\n for (const connection of senders) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n continue;\n }\n // Lookup the sender for the connection.\n let sender = connection.signal.sender;\n // Clear the connection.\n connection.signal = null;\n // Cleanup the array of receivers, which is now known to exist.\n scheduleCleanup(receiversForSender.get(sender));\n }\n // Schedule a cleanup of the list of senders.\n scheduleCleanup(senders);\n }\n Private.disconnectReceiver = disconnectReceiver;\n /**\n * Remove all connections where an object is the sender or receiver.\n *\n * @param object - The object of interest.\n */\n function disconnectAll(object) {\n // Remove all connections where the given object is the sender.\n disconnectSender(object);\n // Remove all connections where the given object is the receiver.\n disconnectReceiver(object);\n }\n Private.disconnectAll = disconnectAll;\n /**\n * Emit a signal and invoke its connected slots.\n *\n * @param signal - The signal of interest.\n *\n * @param args - The args to pass to the connected slots.\n *\n * #### Notes\n * Slots are invoked synchronously in connection order.\n *\n * Exceptions thrown by connected slots will be caught and logged.\n */\n function emit(signal, args) {\n // If there are no receivers, there is nothing to do.\n let receivers = receiversForSender.get(signal.sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n // Invoke the slots for connections with a matching signal.\n // Any connections added during emission are not invoked.\n for (let i = 0, n = receivers.length; i < n; ++i) {\n let connection = receivers[i];\n if (connection.signal === signal) {\n invokeSlot(connection, args);\n }\n }\n }\n Private.emit = emit;\n /**\n * A weak mapping of sender to array of receiver connections.\n */\n const receiversForSender = new WeakMap();\n /**\n * A weak mapping of receiver to array of sender connections.\n */\n const sendersForReceiver = new WeakMap();\n /**\n * A set of connection arrays which are pending cleanup.\n */\n const dirtySet = new Set();\n /**\n * A function to schedule an event loop callback.\n */\n const schedule = (() => {\n let ok = typeof requestAnimationFrame === 'function';\n return ok ? requestAnimationFrame : setImmediate;\n })();\n /**\n * Find a connection which matches the given parameters.\n */\n function findConnection(connections, signal, slot, thisArg) {\n return find(connections, connection => connection.signal === signal &&\n connection.slot === slot &&\n connection.thisArg === thisArg);\n }\n /**\n * Invoke a slot with the given parameters.\n *\n * The connection is assumed to be valid.\n *\n * Exceptions in the slot will be caught and logged.\n */\n function invokeSlot(connection, args) {\n let { signal, slot, thisArg } = connection;\n try {\n slot.call(thisArg, signal.sender, args);\n }\n catch (err) {\n Private.exceptionHandler(err);\n }\n }\n /**\n * Schedule a cleanup of a connection array.\n *\n * This will add the array to the dirty set and schedule a deferred\n * cleanup of the array contents. On cleanup, any connection with a\n * `null` signal will be removed from the array.\n */\n function scheduleCleanup(array) {\n if (dirtySet.size === 0) {\n schedule(cleanupDirtySet);\n }\n dirtySet.add(array);\n }\n /**\n * Cleanup the connection lists in the dirty set.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupDirtySet() {\n dirtySet.forEach(cleanupConnections);\n dirtySet.clear();\n }\n /**\n * Cleanup the dirty connections in a connections array.\n *\n * This will remove any connection with a `null` signal.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupConnections(connections) {\n ArrayExt.removeAllWhere(connections, isDeadConnection);\n }\n /**\n * Test whether a connection is dead.\n *\n * A dead connection has a `null` signal.\n */\n function isDeadConnection(connection) {\n return connection.signal === null;\n }\n})(Private || (Private = {}));\n\nexport { Signal, Stream };\n//# sourceMappingURL=index.es6.js.map\n","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.JSON5 = factory());\n}(this, (function () { 'use strict';\n\n\tfunction createCommonjsModule(fn, module) {\n\t\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n\t}\n\n\tvar _global = createCommonjsModule(function (module) {\n\t// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\n\tvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n\t ? window : typeof self != 'undefined' && self.Math == Math ? self\n\t // eslint-disable-next-line no-new-func\n\t : Function('return this')();\n\tif (typeof __g == 'number') { __g = global; } // eslint-disable-line no-undef\n\t});\n\n\tvar _core = createCommonjsModule(function (module) {\n\tvar core = module.exports = { version: '2.6.5' };\n\tif (typeof __e == 'number') { __e = core; } // eslint-disable-line no-undef\n\t});\n\tvar _core_1 = _core.version;\n\n\tvar _isObject = function (it) {\n\t return typeof it === 'object' ? it !== null : typeof it === 'function';\n\t};\n\n\tvar _anObject = function (it) {\n\t if (!_isObject(it)) { throw TypeError(it + ' is not an object!'); }\n\t return it;\n\t};\n\n\tvar _fails = function (exec) {\n\t try {\n\t return !!exec();\n\t } catch (e) {\n\t return true;\n\t }\n\t};\n\n\t// Thank's IE8 for his funny defineProperty\n\tvar _descriptors = !_fails(function () {\n\t return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n\t});\n\n\tvar document = _global.document;\n\t// typeof document.createElement is 'object' in old IE\n\tvar is = _isObject(document) && _isObject(document.createElement);\n\tvar _domCreate = function (it) {\n\t return is ? document.createElement(it) : {};\n\t};\n\n\tvar _ie8DomDefine = !_descriptors && !_fails(function () {\n\t return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;\n\t});\n\n\t// 7.1.1 ToPrimitive(input [, PreferredType])\n\n\t// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n\t// and the second argument - flag - preferred type is a string\n\tvar _toPrimitive = function (it, S) {\n\t if (!_isObject(it)) { return it; }\n\t var fn, val;\n\t if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; }\n\t if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) { return val; }\n\t if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; }\n\t throw TypeError(\"Can't convert object to primitive value\");\n\t};\n\n\tvar dP = Object.defineProperty;\n\n\tvar f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n\t _anObject(O);\n\t P = _toPrimitive(P, true);\n\t _anObject(Attributes);\n\t if (_ie8DomDefine) { try {\n\t return dP(O, P, Attributes);\n\t } catch (e) { /* empty */ } }\n\t if ('get' in Attributes || 'set' in Attributes) { throw TypeError('Accessors not supported!'); }\n\t if ('value' in Attributes) { O[P] = Attributes.value; }\n\t return O;\n\t};\n\n\tvar _objectDp = {\n\t\tf: f\n\t};\n\n\tvar _propertyDesc = function (bitmap, value) {\n\t return {\n\t enumerable: !(bitmap & 1),\n\t configurable: !(bitmap & 2),\n\t writable: !(bitmap & 4),\n\t value: value\n\t };\n\t};\n\n\tvar _hide = _descriptors ? function (object, key, value) {\n\t return _objectDp.f(object, key, _propertyDesc(1, value));\n\t} : function (object, key, value) {\n\t object[key] = value;\n\t return object;\n\t};\n\n\tvar hasOwnProperty = {}.hasOwnProperty;\n\tvar _has = function (it, key) {\n\t return hasOwnProperty.call(it, key);\n\t};\n\n\tvar id = 0;\n\tvar px = Math.random();\n\tvar _uid = function (key) {\n\t return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n\t};\n\n\tvar _library = false;\n\n\tvar _shared = createCommonjsModule(function (module) {\n\tvar SHARED = '__core-js_shared__';\n\tvar store = _global[SHARED] || (_global[SHARED] = {});\n\n\t(module.exports = function (key, value) {\n\t return store[key] || (store[key] = value !== undefined ? value : {});\n\t})('versions', []).push({\n\t version: _core.version,\n\t mode: _library ? 'pure' : 'global',\n\t copyright: '© 2019 Denis Pushkarev (zloirock.ru)'\n\t});\n\t});\n\n\tvar _functionToString = _shared('native-function-to-string', Function.toString);\n\n\tvar _redefine = createCommonjsModule(function (module) {\n\tvar SRC = _uid('src');\n\n\tvar TO_STRING = 'toString';\n\tvar TPL = ('' + _functionToString).split(TO_STRING);\n\n\t_core.inspectSource = function (it) {\n\t return _functionToString.call(it);\n\t};\n\n\t(module.exports = function (O, key, val, safe) {\n\t var isFunction = typeof val == 'function';\n\t if (isFunction) { _has(val, 'name') || _hide(val, 'name', key); }\n\t if (O[key] === val) { return; }\n\t if (isFunction) { _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); }\n\t if (O === _global) {\n\t O[key] = val;\n\t } else if (!safe) {\n\t delete O[key];\n\t _hide(O, key, val);\n\t } else if (O[key]) {\n\t O[key] = val;\n\t } else {\n\t _hide(O, key, val);\n\t }\n\t// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n\t})(Function.prototype, TO_STRING, function toString() {\n\t return typeof this == 'function' && this[SRC] || _functionToString.call(this);\n\t});\n\t});\n\n\tvar _aFunction = function (it) {\n\t if (typeof it != 'function') { throw TypeError(it + ' is not a function!'); }\n\t return it;\n\t};\n\n\t// optional / simple context binding\n\n\tvar _ctx = function (fn, that, length) {\n\t _aFunction(fn);\n\t if (that === undefined) { return fn; }\n\t switch (length) {\n\t case 1: return function (a) {\n\t return fn.call(that, a);\n\t };\n\t case 2: return function (a, b) {\n\t return fn.call(that, a, b);\n\t };\n\t case 3: return function (a, b, c) {\n\t return fn.call(that, a, b, c);\n\t };\n\t }\n\t return function (/* ...args */) {\n\t return fn.apply(that, arguments);\n\t };\n\t};\n\n\tvar PROTOTYPE = 'prototype';\n\n\tvar $export = function (type, name, source) {\n\t var IS_FORCED = type & $export.F;\n\t var IS_GLOBAL = type & $export.G;\n\t var IS_STATIC = type & $export.S;\n\t var IS_PROTO = type & $export.P;\n\t var IS_BIND = type & $export.B;\n\t var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE];\n\t var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});\n\t var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n\t var key, own, out, exp;\n\t if (IS_GLOBAL) { source = name; }\n\t for (key in source) {\n\t // contains in native\n\t own = !IS_FORCED && target && target[key] !== undefined;\n\t // export native or passed\n\t out = (own ? target : source)[key];\n\t // bind timers to global for call from export context\n\t exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;\n\t // extend global\n\t if (target) { _redefine(target, key, out, type & $export.U); }\n\t // export\n\t if (exports[key] != out) { _hide(exports, key, exp); }\n\t if (IS_PROTO && expProto[key] != out) { expProto[key] = out; }\n\t }\n\t};\n\t_global.core = _core;\n\t// type bitmap\n\t$export.F = 1; // forced\n\t$export.G = 2; // global\n\t$export.S = 4; // static\n\t$export.P = 8; // proto\n\t$export.B = 16; // bind\n\t$export.W = 32; // wrap\n\t$export.U = 64; // safe\n\t$export.R = 128; // real proto method for `library`\n\tvar _export = $export;\n\n\t// 7.1.4 ToInteger\n\tvar ceil = Math.ceil;\n\tvar floor = Math.floor;\n\tvar _toInteger = function (it) {\n\t return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n\t};\n\n\t// 7.2.1 RequireObjectCoercible(argument)\n\tvar _defined = function (it) {\n\t if (it == undefined) { throw TypeError(\"Can't call method on \" + it); }\n\t return it;\n\t};\n\n\t// true -> String#at\n\t// false -> String#codePointAt\n\tvar _stringAt = function (TO_STRING) {\n\t return function (that, pos) {\n\t var s = String(_defined(that));\n\t var i = _toInteger(pos);\n\t var l = s.length;\n\t var a, b;\n\t if (i < 0 || i >= l) { return TO_STRING ? '' : undefined; }\n\t a = s.charCodeAt(i);\n\t return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n\t ? TO_STRING ? s.charAt(i) : a\n\t : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n\t };\n\t};\n\n\tvar $at = _stringAt(false);\n\t_export(_export.P, 'String', {\n\t // 21.1.3.3 String.prototype.codePointAt(pos)\n\t codePointAt: function codePointAt(pos) {\n\t return $at(this, pos);\n\t }\n\t});\n\n\tvar codePointAt = _core.String.codePointAt;\n\n\tvar max = Math.max;\n\tvar min = Math.min;\n\tvar _toAbsoluteIndex = function (index, length) {\n\t index = _toInteger(index);\n\t return index < 0 ? max(index + length, 0) : min(index, length);\n\t};\n\n\tvar fromCharCode = String.fromCharCode;\n\tvar $fromCodePoint = String.fromCodePoint;\n\n\t// length should be 1, old FF problem\n\t_export(_export.S + _export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n\t // 21.1.2.2 String.fromCodePoint(...codePoints)\n\t fromCodePoint: function fromCodePoint(x) {\n\t var arguments$1 = arguments;\n\t // eslint-disable-line no-unused-vars\n\t var res = [];\n\t var aLen = arguments.length;\n\t var i = 0;\n\t var code;\n\t while (aLen > i) {\n\t code = +arguments$1[i++];\n\t if (_toAbsoluteIndex(code, 0x10ffff) !== code) { throw RangeError(code + ' is not a valid code point'); }\n\t res.push(code < 0x10000\n\t ? fromCharCode(code)\n\t : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n\t );\n\t } return res.join('');\n\t }\n\t});\n\n\tvar fromCodePoint = _core.String.fromCodePoint;\n\n\t// This is a generated file. Do not edit.\n\tvar Space_Separator = /[\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\n\tvar ID_Start = /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0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1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\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DE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]/;\n\tvar ID_Continue = /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u08D4-\\u08E1\\u08E3-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09D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\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1C80-\\u1C88\\u1CD0-\\u1CD2\\u1CD4-\\u1CF9\\u1D00-\\u1DF9\\u1DFB-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA8FD\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\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\uDE99\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC36\\uDC38-\\uDC40\\uDC50-\\uDC59\\uDC72-\\uDC8F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD50-\\uDD59]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE60-\\uDE69\\uDED0-\\uDEED\\uDEF0-\\uDEF4\\uDF00-\\uDF36\\uDF40-\\uDF43\\uDF50-\\uDF59\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50-\\uDF7E\\uDF8F-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\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uDDEF]/;\n\n\tvar unicode = {\n\t\tSpace_Separator: Space_Separator,\n\t\tID_Start: ID_Start,\n\t\tID_Continue: ID_Continue\n\t};\n\n\tvar util = {\n\t isSpaceSeparator: function isSpaceSeparator (c) {\n\t return typeof c === 'string' && unicode.Space_Separator.test(c)\n\t },\n\n\t isIdStartChar: function isIdStartChar (c) {\n\t return typeof c === 'string' && (\n\t (c >= 'a' && c <= 'z') ||\n\t (c >= 'A' && c <= 'Z') ||\n\t (c === '$') || (c === '_') ||\n\t unicode.ID_Start.test(c)\n\t )\n\t },\n\n\t isIdContinueChar: function isIdContinueChar (c) {\n\t return typeof c === 'string' && (\n\t (c >= 'a' && c <= 'z') ||\n\t (c >= 'A' && c <= 'Z') ||\n\t (c >= '0' && c <= '9') ||\n\t (c === '$') || (c === '_') ||\n\t (c === '\\u200C') || (c === '\\u200D') ||\n\t unicode.ID_Continue.test(c)\n\t )\n\t },\n\n\t isDigit: function isDigit (c) {\n\t return typeof c === 'string' && /[0-9]/.test(c)\n\t },\n\n\t isHexDigit: function isHexDigit (c) {\n\t return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)\n\t },\n\t};\n\n\tvar source;\n\tvar parseState;\n\tvar stack;\n\tvar pos;\n\tvar line;\n\tvar column;\n\tvar token;\n\tvar key;\n\tvar root;\n\n\tvar parse = function parse (text, reviver) {\n\t source = String(text);\n\t parseState = 'start';\n\t stack = [];\n\t pos = 0;\n\t line = 1;\n\t column = 0;\n\t token = undefined;\n\t key = undefined;\n\t root = undefined;\n\n\t do {\n\t token = lex();\n\n\t // This code is unreachable.\n\t // if (!parseStates[parseState]) {\n\t // throw invalidParseState()\n\t // }\n\n\t parseStates[parseState]();\n\t } while (token.type !== 'eof')\n\n\t if (typeof reviver === 'function') {\n\t return internalize({'': root}, '', reviver)\n\t }\n\n\t return root\n\t};\n\n\tfunction internalize (holder, name, reviver) {\n\t var value = holder[name];\n\t if (value != null && typeof value === 'object') {\n\t if (Array.isArray(value)) {\n\t for (var i = 0; i < value.length; i++) {\n\t var key = String(i);\n\t var replacement = internalize(value, key, reviver);\n\t if (replacement === undefined) {\n\t delete value[key];\n\t } else {\n\t Object.defineProperty(value, key, {\n\t value: replacement,\n\t writable: true,\n\t enumerable: true,\n\t configurable: true,\n\t });\n\t }\n\t }\n\t } else {\n\t for (var key$1 in value) {\n\t var replacement$1 = internalize(value, key$1, reviver);\n\t if (replacement$1 === undefined) {\n\t delete value[key$1];\n\t } else {\n\t Object.defineProperty(value, key$1, {\n\t value: replacement$1,\n\t writable: true,\n\t enumerable: true,\n\t configurable: true,\n\t });\n\t }\n\t }\n\t }\n\t }\n\n\t return reviver.call(holder, name, value)\n\t}\n\n\tvar lexState;\n\tvar buffer;\n\tvar doubleQuote;\n\tvar sign;\n\tvar c;\n\n\tfunction lex () {\n\t lexState = 'default';\n\t buffer = '';\n\t doubleQuote = false;\n\t sign = 1;\n\n\t for (;;) {\n\t c = peek();\n\n\t // This code is unreachable.\n\t // if (!lexStates[lexState]) {\n\t // throw invalidLexState(lexState)\n\t // }\n\n\t var token = lexStates[lexState]();\n\t if (token) {\n\t return token\n\t }\n\t }\n\t}\n\n\tfunction peek () {\n\t if (source[pos]) {\n\t return String.fromCodePoint(source.codePointAt(pos))\n\t }\n\t}\n\n\tfunction read () {\n\t var c = peek();\n\n\t if (c === '\\n') {\n\t line++;\n\t column = 0;\n\t } else if (c) {\n\t column += c.length;\n\t } else {\n\t column++;\n\t }\n\n\t if (c) {\n\t pos += c.length;\n\t }\n\n\t return c\n\t}\n\n\tvar lexStates = {\n\t default: function default$1 () {\n\t switch (c) {\n\t case '\\t':\n\t case '\\v':\n\t case '\\f':\n\t case ' ':\n\t case '\\u00A0':\n\t case '\\uFEFF':\n\t case '\\n':\n\t case '\\r':\n\t case '\\u2028':\n\t case '\\u2029':\n\t read();\n\t return\n\n\t case '/':\n\t read();\n\t lexState = 'comment';\n\t return\n\n\t case undefined:\n\t read();\n\t return newToken('eof')\n\t }\n\n\t if (util.isSpaceSeparator(c)) {\n\t read();\n\t return\n\t }\n\n\t // This code is unreachable.\n\t // if (!lexStates[parseState]) {\n\t // throw invalidLexState(parseState)\n\t // }\n\n\t return lexStates[parseState]()\n\t },\n\n\t comment: function comment () {\n\t switch (c) {\n\t case '*':\n\t read();\n\t lexState = 'multiLineComment';\n\t return\n\n\t case '/':\n\t read();\n\t lexState = 'singleLineComment';\n\t return\n\t }\n\n\t throw invalidChar(read())\n\t },\n\n\t multiLineComment: function multiLineComment () {\n\t switch (c) {\n\t case '*':\n\t read();\n\t lexState = 'multiLineCommentAsterisk';\n\t return\n\n\t case undefined:\n\t throw invalidChar(read())\n\t }\n\n\t read();\n\t },\n\n\t multiLineCommentAsterisk: function multiLineCommentAsterisk () {\n\t switch (c) {\n\t case '*':\n\t read();\n\t return\n\n\t case '/':\n\t read();\n\t lexState = 'default';\n\t return\n\n\t case undefined:\n\t throw invalidChar(read())\n\t }\n\n\t read();\n\t lexState = 'multiLineComment';\n\t },\n\n\t singleLineComment: function singleLineComment () {\n\t switch (c) {\n\t case '\\n':\n\t case '\\r':\n\t case '\\u2028':\n\t case '\\u2029':\n\t read();\n\t lexState = 'default';\n\t return\n\n\t case undefined:\n\t read();\n\t return newToken('eof')\n\t }\n\n\t read();\n\t },\n\n\t value: function value () {\n\t switch (c) {\n\t case '{':\n\t case '[':\n\t return newToken('punctuator', read())\n\n\t case 'n':\n\t read();\n\t literal('ull');\n\t return newToken('null', null)\n\n\t case 't':\n\t read();\n\t literal('rue');\n\t return newToken('boolean', true)\n\n\t case 'f':\n\t read();\n\t literal('alse');\n\t return newToken('boolean', false)\n\n\t case '-':\n\t case '+':\n\t if (read() === '-') {\n\t sign = -1;\n\t }\n\n\t lexState = 'sign';\n\t return\n\n\t case '.':\n\t buffer = read();\n\t lexState = 'decimalPointLeading';\n\t return\n\n\t case '0':\n\t buffer = read();\n\t lexState = 'zero';\n\t return\n\n\t case '1':\n\t case '2':\n\t case '3':\n\t case '4':\n\t case '5':\n\t case '6':\n\t case '7':\n\t case '8':\n\t case '9':\n\t buffer = read();\n\t lexState = 'decimalInteger';\n\t return\n\n\t case 'I':\n\t read();\n\t literal('nfinity');\n\t return newToken('numeric', Infinity)\n\n\t case 'N':\n\t read();\n\t literal('aN');\n\t return newToken('numeric', NaN)\n\n\t case '\"':\n\t case \"'\":\n\t doubleQuote = (read() === '\"');\n\t buffer = '';\n\t lexState = 'string';\n\t return\n\t }\n\n\t throw invalidChar(read())\n\t },\n\n\t identifierNameStartEscape: function identifierNameStartEscape () {\n\t if (c !== 'u') {\n\t throw invalidChar(read())\n\t }\n\n\t read();\n\t var u = unicodeEscape();\n\t switch (u) {\n\t case '$':\n\t case '_':\n\t break\n\n\t default:\n\t if (!util.isIdStartChar(u)) {\n\t throw invalidIdentifier()\n\t }\n\n\t break\n\t }\n\n\t buffer += u;\n\t lexState = 'identifierName';\n\t },\n\n\t identifierName: function identifierName () {\n\t switch (c) {\n\t case '$':\n\t case '_':\n\t case '\\u200C':\n\t case '\\u200D':\n\t buffer += read();\n\t return\n\n\t case '\\\\':\n\t read();\n\t lexState = 'identifierNameEscape';\n\t return\n\t }\n\n\t if (util.isIdContinueChar(c)) {\n\t buffer += read();\n\t return\n\t }\n\n\t return newToken('identifier', buffer)\n\t },\n\n\t identifierNameEscape: function identifierNameEscape () {\n\t if (c !== 'u') {\n\t throw invalidChar(read())\n\t }\n\n\t read();\n\t var u = unicodeEscape();\n\t switch (u) {\n\t case '$':\n\t case '_':\n\t case '\\u200C':\n\t case '\\u200D':\n\t break\n\n\t default:\n\t if (!util.isIdContinueChar(u)) {\n\t throw invalidIdentifier()\n\t }\n\n\t break\n\t }\n\n\t buffer += u;\n\t lexState = 'identifierName';\n\t },\n\n\t sign: function sign$1 () {\n\t switch (c) {\n\t case '.':\n\t buffer = read();\n\t lexState = 'decimalPointLeading';\n\t return\n\n\t case '0':\n\t buffer = read();\n\t lexState = 'zero';\n\t return\n\n\t case '1':\n\t case '2':\n\t case '3':\n\t case '4':\n\t case '5':\n\t case '6':\n\t case '7':\n\t case '8':\n\t case '9':\n\t buffer = read();\n\t lexState = 'decimalInteger';\n\t return\n\n\t case 'I':\n\t read();\n\t literal('nfinity');\n\t return newToken('numeric', sign * Infinity)\n\n\t case 'N':\n\t read();\n\t literal('aN');\n\t return newToken('numeric', NaN)\n\t }\n\n\t throw invalidChar(read())\n\t },\n\n\t zero: function zero () {\n\t switch (c) {\n\t case '.':\n\t buffer += read();\n\t lexState = 'decimalPoint';\n\t return\n\n\t case 'e':\n\t case 'E':\n\t buffer += read();\n\t lexState = 'decimalExponent';\n\t return\n\n\t case 'x':\n\t case 'X':\n\t buffer += read();\n\t lexState = 'hexadecimal';\n\t return\n\t }\n\n\t return newToken('numeric', sign * 0)\n\t },\n\n\t decimalInteger: function decimalInteger () {\n\t switch (c) {\n\t case '.':\n\t buffer += read();\n\t lexState = 'decimalPoint';\n\t return\n\n\t case 'e':\n\t case 'E':\n\t buffer += read();\n\t lexState = 'decimalExponent';\n\t return\n\t }\n\n\t if (util.isDigit(c)) {\n\t buffer += read();\n\t return\n\t }\n\n\t return newToken('numeric', sign * Number(buffer))\n\t },\n\n\t decimalPointLeading: function decimalPointLeading () {\n\t if (util.isDigit(c)) {\n\t buffer += read();\n\t lexState = 'decimalFraction';\n\t return\n\t }\n\n\t throw invalidChar(read())\n\t },\n\n\t decimalPoint: function decimalPoint () {\n\t switch (c) {\n\t case 'e':\n\t case 'E':\n\t buffer += read();\n\t lexState = 'decimalExponent';\n\t return\n\t }\n\n\t if (util.isDigit(c)) {\n\t buffer += read();\n\t lexState = 'decimalFraction';\n\t return\n\t }\n\n\t return newToken('numeric', sign * Number(buffer))\n\t },\n\n\t decimalFraction: function decimalFraction () {\n\t switch (c) {\n\t case 'e':\n\t case 'E':\n\t buffer += read();\n\t lexState = 'decimalExponent';\n\t return\n\t }\n\n\t if (util.isDigit(c)) {\n\t buffer += read();\n\t return\n\t }\n\n\t return newToken('numeric', sign * Number(buffer))\n\t },\n\n\t decimalExponent: function decimalExponent () {\n\t switch (c) {\n\t case '+':\n\t case '-':\n\t buffer += read();\n\t lexState = 'decimalExponentSign';\n\t return\n\t }\n\n\t if (util.isDigit(c)) {\n\t buffer += read();\n\t lexState = 'decimalExponentInteger';\n\t return\n\t }\n\n\t throw invalidChar(read())\n\t },\n\n\t decimalExponentSign: function decimalExponentSign () {\n\t if (util.isDigit(c)) {\n\t buffer += read();\n\t lexState = 'decimalExponentInteger';\n\t return\n\t }\n\n\t throw invalidChar(read())\n\t },\n\n\t decimalExponentInteger: function decimalExponentInteger () {\n\t if (util.isDigit(c)) {\n\t buffer += read();\n\t return\n\t }\n\n\t return newToken('numeric', sign * Number(buffer))\n\t },\n\n\t hexadecimal: function hexadecimal () {\n\t if (util.isHexDigit(c)) {\n\t buffer += read();\n\t lexState = 'hexadecimalInteger';\n\t return\n\t }\n\n\t throw invalidChar(read())\n\t },\n\n\t hexadecimalInteger: function hexadecimalInteger () {\n\t if (util.isHexDigit(c)) {\n\t buffer += read();\n\t return\n\t }\n\n\t return newToken('numeric', sign * Number(buffer))\n\t },\n\n\t string: function string () {\n\t switch (c) {\n\t case '\\\\':\n\t read();\n\t buffer += escape();\n\t return\n\n\t case '\"':\n\t if (doubleQuote) {\n\t read();\n\t return newToken('string', buffer)\n\t }\n\n\t buffer += read();\n\t return\n\n\t case \"'\":\n\t if (!doubleQuote) {\n\t read();\n\t return newToken('string', buffer)\n\t }\n\n\t buffer += read();\n\t return\n\n\t case '\\n':\n\t case '\\r':\n\t throw invalidChar(read())\n\n\t case '\\u2028':\n\t case '\\u2029':\n\t separatorChar(c);\n\t break\n\n\t case undefined:\n\t throw invalidChar(read())\n\t }\n\n\t buffer += read();\n\t },\n\n\t start: function start () {\n\t switch (c) {\n\t case '{':\n\t case '[':\n\t return newToken('punctuator', read())\n\n\t // This code is unreachable since the default lexState handles eof.\n\t // case undefined:\n\t // return newToken('eof')\n\t }\n\n\t lexState = 'value';\n\t },\n\n\t beforePropertyName: function beforePropertyName () {\n\t switch (c) {\n\t case '$':\n\t case '_':\n\t buffer = read();\n\t lexState = 'identifierName';\n\t return\n\n\t case '\\\\':\n\t read();\n\t lexState = 'identifierNameStartEscape';\n\t return\n\n\t case '}':\n\t return newToken('punctuator', read())\n\n\t case '\"':\n\t case \"'\":\n\t doubleQuote = (read() === '\"');\n\t lexState = 'string';\n\t return\n\t }\n\n\t if (util.isIdStartChar(c)) {\n\t buffer += read();\n\t lexState = 'identifierName';\n\t return\n\t }\n\n\t throw invalidChar(read())\n\t },\n\n\t afterPropertyName: function afterPropertyName () {\n\t if (c === ':') {\n\t return newToken('punctuator', read())\n\t }\n\n\t throw invalidChar(read())\n\t },\n\n\t beforePropertyValue: function beforePropertyValue () {\n\t lexState = 'value';\n\t },\n\n\t afterPropertyValue: function afterPropertyValue () {\n\t switch (c) {\n\t case ',':\n\t case '}':\n\t return newToken('punctuator', read())\n\t }\n\n\t throw invalidChar(read())\n\t },\n\n\t beforeArrayValue: function beforeArrayValue () {\n\t if (c === ']') {\n\t return newToken('punctuator', read())\n\t }\n\n\t lexState = 'value';\n\t },\n\n\t afterArrayValue: function afterArrayValue () {\n\t switch (c) {\n\t case ',':\n\t case ']':\n\t return newToken('punctuator', read())\n\t }\n\n\t throw invalidChar(read())\n\t },\n\n\t end: function end () {\n\t // This code is unreachable since it's handled by the default lexState.\n\t // if (c === undefined) {\n\t // read()\n\t // return newToken('eof')\n\t // }\n\n\t throw invalidChar(read())\n\t },\n\t};\n\n\tfunction newToken (type, value) {\n\t return {\n\t type: type,\n\t value: value,\n\t line: line,\n\t column: column,\n\t }\n\t}\n\n\tfunction literal (s) {\n\t for (var i = 0, list = s; i < list.length; i += 1) {\n\t var c = list[i];\n\n\t var p = peek();\n\n\t if (p !== c) {\n\t throw invalidChar(read())\n\t }\n\n\t read();\n\t }\n\t}\n\n\tfunction escape () {\n\t var c = peek();\n\t switch (c) {\n\t case 'b':\n\t read();\n\t return '\\b'\n\n\t case 'f':\n\t read();\n\t return '\\f'\n\n\t case 'n':\n\t read();\n\t return '\\n'\n\n\t case 'r':\n\t read();\n\t return '\\r'\n\n\t case 't':\n\t read();\n\t return '\\t'\n\n\t case 'v':\n\t read();\n\t return '\\v'\n\n\t case '0':\n\t read();\n\t if (util.isDigit(peek())) {\n\t throw invalidChar(read())\n\t }\n\n\t return '\\0'\n\n\t case 'x':\n\t read();\n\t return hexEscape()\n\n\t case 'u':\n\t read();\n\t return unicodeEscape()\n\n\t case '\\n':\n\t case '\\u2028':\n\t case '\\u2029':\n\t read();\n\t return ''\n\n\t case '\\r':\n\t read();\n\t if (peek() === '\\n') {\n\t read();\n\t }\n\n\t return ''\n\n\t case '1':\n\t case '2':\n\t case '3':\n\t case '4':\n\t case '5':\n\t case '6':\n\t case '7':\n\t case '8':\n\t case '9':\n\t throw invalidChar(read())\n\n\t case undefined:\n\t throw invalidChar(read())\n\t }\n\n\t return read()\n\t}\n\n\tfunction hexEscape () {\n\t var buffer = '';\n\t var c = peek();\n\n\t if (!util.isHexDigit(c)) {\n\t throw invalidChar(read())\n\t }\n\n\t buffer += read();\n\n\t c = peek();\n\t if (!util.isHexDigit(c)) {\n\t throw invalidChar(read())\n\t }\n\n\t buffer += read();\n\n\t return String.fromCodePoint(parseInt(buffer, 16))\n\t}\n\n\tfunction unicodeEscape () {\n\t var buffer = '';\n\t var count = 4;\n\n\t while (count-- > 0) {\n\t var c = peek();\n\t if (!util.isHexDigit(c)) {\n\t throw invalidChar(read())\n\t }\n\n\t buffer += read();\n\t }\n\n\t return String.fromCodePoint(parseInt(buffer, 16))\n\t}\n\n\tvar parseStates = {\n\t start: function start () {\n\t if (token.type === 'eof') {\n\t throw invalidEOF()\n\t }\n\n\t push();\n\t },\n\n\t beforePropertyName: function beforePropertyName () {\n\t switch (token.type) {\n\t case 'identifier':\n\t case 'string':\n\t key = token.value;\n\t parseState = 'afterPropertyName';\n\t return\n\n\t case 'punctuator':\n\t // This code is unreachable since it's handled by the lexState.\n\t // if (token.value !== '}') {\n\t // throw invalidToken()\n\t // }\n\n\t pop();\n\t return\n\n\t case 'eof':\n\t throw invalidEOF()\n\t }\n\n\t // This code is unreachable since it's handled by the lexState.\n\t // throw invalidToken()\n\t },\n\n\t afterPropertyName: function afterPropertyName () {\n\t // This code is unreachable since it's handled by the lexState.\n\t // if (token.type !== 'punctuator' || token.value !== ':') {\n\t // throw invalidToken()\n\t // }\n\n\t if (token.type === 'eof') {\n\t throw invalidEOF()\n\t }\n\n\t parseState = 'beforePropertyValue';\n\t },\n\n\t beforePropertyValue: function beforePropertyValue () {\n\t if (token.type === 'eof') {\n\t throw invalidEOF()\n\t }\n\n\t push();\n\t },\n\n\t beforeArrayValue: function beforeArrayValue () {\n\t if (token.type === 'eof') {\n\t throw invalidEOF()\n\t }\n\n\t if (token.type === 'punctuator' && token.value === ']') {\n\t pop();\n\t return\n\t }\n\n\t push();\n\t },\n\n\t afterPropertyValue: function afterPropertyValue () {\n\t // This code is unreachable since it's handled by the lexState.\n\t // if (token.type !== 'punctuator') {\n\t // throw invalidToken()\n\t // }\n\n\t if (token.type === 'eof') {\n\t throw invalidEOF()\n\t }\n\n\t switch (token.value) {\n\t case ',':\n\t parseState = 'beforePropertyName';\n\t return\n\n\t case '}':\n\t pop();\n\t }\n\n\t // This code is unreachable since it's handled by the lexState.\n\t // throw invalidToken()\n\t },\n\n\t afterArrayValue: function afterArrayValue () {\n\t // This code is unreachable since it's handled by the lexState.\n\t // if (token.type !== 'punctuator') {\n\t // throw invalidToken()\n\t // }\n\n\t if (token.type === 'eof') {\n\t throw invalidEOF()\n\t }\n\n\t switch (token.value) {\n\t case ',':\n\t parseState = 'beforeArrayValue';\n\t return\n\n\t case ']':\n\t pop();\n\t }\n\n\t // This code is unreachable since it's handled by the lexState.\n\t // throw invalidToken()\n\t },\n\n\t end: function end () {\n\t // This code is unreachable since it's handled by the lexState.\n\t // if (token.type !== 'eof') {\n\t // throw invalidToken()\n\t // }\n\t },\n\t};\n\n\tfunction push () {\n\t var value;\n\n\t switch (token.type) {\n\t case 'punctuator':\n\t switch (token.value) {\n\t case '{':\n\t value = {};\n\t break\n\n\t case '[':\n\t value = [];\n\t break\n\t }\n\n\t break\n\n\t case 'null':\n\t case 'boolean':\n\t case 'numeric':\n\t case 'string':\n\t value = token.value;\n\t break\n\n\t // This code is unreachable.\n\t // default:\n\t // throw invalidToken()\n\t }\n\n\t if (root === undefined) {\n\t root = value;\n\t } else {\n\t var parent = stack[stack.length - 1];\n\t if (Array.isArray(parent)) {\n\t parent.push(value);\n\t } else {\n\t Object.defineProperty(parent, key, {\n\t value: value,\n\t writable: true,\n\t enumerable: true,\n\t configurable: true,\n\t });\n\t }\n\t }\n\n\t if (value !== null && typeof value === 'object') {\n\t stack.push(value);\n\n\t if (Array.isArray(value)) {\n\t parseState = 'beforeArrayValue';\n\t } else {\n\t parseState = 'beforePropertyName';\n\t }\n\t } else {\n\t var current = stack[stack.length - 1];\n\t if (current == null) {\n\t parseState = 'end';\n\t } else if (Array.isArray(current)) {\n\t parseState = 'afterArrayValue';\n\t } else {\n\t parseState = 'afterPropertyValue';\n\t }\n\t }\n\t}\n\n\tfunction pop () {\n\t stack.pop();\n\n\t var current = stack[stack.length - 1];\n\t if (current == null) {\n\t parseState = 'end';\n\t } else if (Array.isArray(current)) {\n\t parseState = 'afterArrayValue';\n\t } else {\n\t parseState = 'afterPropertyValue';\n\t }\n\t}\n\n\t// This code is unreachable.\n\t// function invalidParseState () {\n\t// return new Error(`JSON5: invalid parse state '${parseState}'`)\n\t// }\n\n\t// This code is unreachable.\n\t// function invalidLexState (state) {\n\t// return new Error(`JSON5: invalid lex state '${state}'`)\n\t// }\n\n\tfunction invalidChar (c) {\n\t if (c === undefined) {\n\t return syntaxError((\"JSON5: invalid end of input at \" + line + \":\" + column))\n\t }\n\n\t return syntaxError((\"JSON5: invalid character '\" + (formatChar(c)) + \"' at \" + line + \":\" + column))\n\t}\n\n\tfunction invalidEOF () {\n\t return syntaxError((\"JSON5: invalid end of input at \" + line + \":\" + column))\n\t}\n\n\t// This code is unreachable.\n\t// function invalidToken () {\n\t// if (token.type === 'eof') {\n\t// return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n\t// }\n\n\t// const c = String.fromCodePoint(token.value.codePointAt(0))\n\t// return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`)\n\t// }\n\n\tfunction invalidIdentifier () {\n\t column -= 5;\n\t return syntaxError((\"JSON5: invalid identifier character at \" + line + \":\" + column))\n\t}\n\n\tfunction separatorChar (c) {\n\t console.warn((\"JSON5: '\" + (formatChar(c)) + \"' in strings is not valid ECMAScript; consider escaping\"));\n\t}\n\n\tfunction formatChar (c) {\n\t var replacements = {\n\t \"'\": \"\\\\'\",\n\t '\"': '\\\\\"',\n\t '\\\\': '\\\\\\\\',\n\t '\\b': '\\\\b',\n\t '\\f': '\\\\f',\n\t '\\n': '\\\\n',\n\t '\\r': '\\\\r',\n\t '\\t': '\\\\t',\n\t '\\v': '\\\\v',\n\t '\\0': '\\\\0',\n\t '\\u2028': '\\\\u2028',\n\t '\\u2029': '\\\\u2029',\n\t };\n\n\t if (replacements[c]) {\n\t return replacements[c]\n\t }\n\n\t if (c < ' ') {\n\t var hexString = c.charCodeAt(0).toString(16);\n\t return '\\\\x' + ('00' + hexString).substring(hexString.length)\n\t }\n\n\t return c\n\t}\n\n\tfunction syntaxError (message) {\n\t var err = new SyntaxError(message);\n\t err.lineNumber = line;\n\t err.columnNumber = column;\n\t return err\n\t}\n\n\tvar stringify = function stringify (value, replacer, space) {\n\t var stack = [];\n\t var indent = '';\n\t var propertyList;\n\t var replacerFunc;\n\t var gap = '';\n\t var quote;\n\n\t if (\n\t replacer != null &&\n\t typeof replacer === 'object' &&\n\t !Array.isArray(replacer)\n\t ) {\n\t space = replacer.space;\n\t quote = replacer.quote;\n\t replacer = replacer.replacer;\n\t }\n\n\t if (typeof replacer === 'function') {\n\t replacerFunc = replacer;\n\t } else if (Array.isArray(replacer)) {\n\t propertyList = [];\n\t for (var i = 0, list = replacer; i < list.length; i += 1) {\n\t var v = list[i];\n\n\t var item = (void 0);\n\n\t if (typeof v === 'string') {\n\t item = v;\n\t } else if (\n\t typeof v === 'number' ||\n\t v instanceof String ||\n\t v instanceof Number\n\t ) {\n\t item = String(v);\n\t }\n\n\t if (item !== undefined && propertyList.indexOf(item) < 0) {\n\t propertyList.push(item);\n\t }\n\t }\n\t }\n\n\t if (space instanceof Number) {\n\t space = Number(space);\n\t } else if (space instanceof String) {\n\t space = String(space);\n\t }\n\n\t if (typeof space === 'number') {\n\t if (space > 0) {\n\t space = Math.min(10, Math.floor(space));\n\t gap = ' '.substr(0, space);\n\t }\n\t } else if (typeof space === 'string') {\n\t gap = space.substr(0, 10);\n\t }\n\n\t return serializeProperty('', {'': value})\n\n\t function serializeProperty (key, holder) {\n\t var value = holder[key];\n\t if (value != null) {\n\t if (typeof value.toJSON5 === 'function') {\n\t value = value.toJSON5(key);\n\t } else if (typeof value.toJSON === 'function') {\n\t value = value.toJSON(key);\n\t }\n\t }\n\n\t if (replacerFunc) {\n\t value = replacerFunc.call(holder, key, value);\n\t }\n\n\t if (value instanceof Number) {\n\t value = Number(value);\n\t } else if (value instanceof String) {\n\t value = String(value);\n\t } else if (value instanceof Boolean) {\n\t value = value.valueOf();\n\t }\n\n\t switch (value) {\n\t case null: return 'null'\n\t case true: return 'true'\n\t case false: return 'false'\n\t }\n\n\t if (typeof value === 'string') {\n\t return quoteString(value, false)\n\t }\n\n\t if (typeof value === 'number') {\n\t return String(value)\n\t }\n\n\t if (typeof value === 'object') {\n\t return Array.isArray(value) ? serializeArray(value) : serializeObject(value)\n\t }\n\n\t return undefined\n\t }\n\n\t function quoteString (value) {\n\t var quotes = {\n\t \"'\": 0.1,\n\t '\"': 0.2,\n\t };\n\n\t var replacements = {\n\t \"'\": \"\\\\'\",\n\t '\"': '\\\\\"',\n\t '\\\\': '\\\\\\\\',\n\t '\\b': '\\\\b',\n\t '\\f': '\\\\f',\n\t '\\n': '\\\\n',\n\t '\\r': '\\\\r',\n\t '\\t': '\\\\t',\n\t '\\v': '\\\\v',\n\t '\\0': '\\\\0',\n\t '\\u2028': '\\\\u2028',\n\t '\\u2029': '\\\\u2029',\n\t };\n\n\t var product = '';\n\n\t for (var i = 0; i < value.length; i++) {\n\t var c = value[i];\n\t switch (c) {\n\t case \"'\":\n\t case '\"':\n\t quotes[c]++;\n\t product += c;\n\t continue\n\n\t case '\\0':\n\t if (util.isDigit(value[i + 1])) {\n\t product += '\\\\x00';\n\t continue\n\t }\n\t }\n\n\t if (replacements[c]) {\n\t product += replacements[c];\n\t continue\n\t }\n\n\t if (c < ' ') {\n\t var hexString = c.charCodeAt(0).toString(16);\n\t product += '\\\\x' + ('00' + hexString).substring(hexString.length);\n\t continue\n\t }\n\n\t product += c;\n\t }\n\n\t var quoteChar = quote || Object.keys(quotes).reduce(function (a, b) { return (quotes[a] < quotes[b]) ? a : b; });\n\n\t product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]);\n\n\t return quoteChar + product + quoteChar\n\t }\n\n\t function serializeObject (value) {\n\t if (stack.indexOf(value) >= 0) {\n\t throw TypeError('Converting circular structure to JSON5')\n\t }\n\n\t stack.push(value);\n\n\t var stepback = indent;\n\t indent = indent + gap;\n\n\t var keys = propertyList || Object.keys(value);\n\t var partial = [];\n\t for (var i = 0, list = keys; i < list.length; i += 1) {\n\t var key = list[i];\n\n\t var propertyString = serializeProperty(key, value);\n\t if (propertyString !== undefined) {\n\t var member = serializeKey(key) + ':';\n\t if (gap !== '') {\n\t member += ' ';\n\t }\n\t member += propertyString;\n\t partial.push(member);\n\t }\n\t }\n\n\t var final;\n\t if (partial.length === 0) {\n\t final = '{}';\n\t } else {\n\t var properties;\n\t if (gap === '') {\n\t properties = partial.join(',');\n\t final = '{' + properties + '}';\n\t } else {\n\t var separator = ',\\n' + indent;\n\t properties = partial.join(separator);\n\t final = '{\\n' + indent + properties + ',\\n' + stepback + '}';\n\t }\n\t }\n\n\t stack.pop();\n\t indent = stepback;\n\t return final\n\t }\n\n\t function serializeKey (key) {\n\t if (key.length === 0) {\n\t return quoteString(key, true)\n\t }\n\n\t var firstChar = String.fromCodePoint(key.codePointAt(0));\n\t if (!util.isIdStartChar(firstChar)) {\n\t return quoteString(key, true)\n\t }\n\n\t for (var i = firstChar.length; i < key.length; i++) {\n\t if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {\n\t return quoteString(key, true)\n\t }\n\t }\n\n\t return key\n\t }\n\n\t function serializeArray (value) {\n\t if (stack.indexOf(value) >= 0) {\n\t throw TypeError('Converting circular structure to JSON5')\n\t }\n\n\t stack.push(value);\n\n\t var stepback = indent;\n\t indent = indent + gap;\n\n\t var partial = [];\n\t for (var i = 0; i < value.length; i++) {\n\t var propertyString = serializeProperty(String(i), value);\n\t partial.push((propertyString !== undefined) ? propertyString : 'null');\n\t }\n\n\t var final;\n\t if (partial.length === 0) {\n\t final = '[]';\n\t } else {\n\t if (gap === '') {\n\t var properties = partial.join(',');\n\t final = '[' + properties + ']';\n\t } else {\n\t var separator = ',\\n' + indent;\n\t var properties$1 = partial.join(separator);\n\t final = '[\\n' + indent + properties$1 + ',\\n' + stepback + ']';\n\t }\n\t }\n\n\t stack.pop();\n\t indent = stepback;\n\t return final\n\t }\n\t};\n\n\tvar JSON5 = {\n\t parse: parse,\n\t stringify: stringify,\n\t};\n\n\tvar lib = JSON5;\n\n\tvar es5 = lib;\n\n\treturn es5;\n\n})));\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.memoryStorageDriver = factory());\n}(this, function () { 'use strict';\n\n function getSerializerPromise(localForageInstance) {\n if (getSerializerPromise.result) {\n return getSerializerPromise.result;\n }\n if (!localForageInstance || typeof localForageInstance.getSerializer !== 'function') {\n Promise.reject(new Error('localforage.getSerializer() was not available! ' + 'localforage v1.4+ is required!'));\n }\n getSerializerPromise.result = localForageInstance.getSerializer();\n return getSerializerPromise.result;\n }\n\n function executeCallback(promise, callback) {\n if (callback) {\n promise.then(function (result) {\n callback(null, result);\n }, function (error) {\n callback(error);\n });\n }\n }\n\n var storageRepository = {};\n\n // Config the localStorage backend, using options set in the config.\n function _initStorage(options) {\n var self = this;\n\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n var database = storageRepository[dbInfo.name] = storageRepository[dbInfo.name] || {};\n var table = database[dbInfo.storeName] = database[dbInfo.storeName] || {};\n dbInfo.db = table;\n\n self._dbInfo = dbInfo;\n\n return getSerializerPromise(self).then(function (serializer) {\n dbInfo.serializer = serializer;\n });\n }\n\n function clear(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var db = self._dbInfo.db;\n\n for (var key in db) {\n if (db.hasOwnProperty(key)) {\n delete db[key];\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n }\n\n function getItem(key, callback) {\n var self = this;\n\n // Cast the key to a string, as that's all we can set as a key.\n if (typeof key !== 'string') {\n console.warn(key + ' used as a key, but it is not a string.');\n key = String(key);\n }\n\n var promise = self.ready().then(function () {\n var db = self._dbInfo.db;\n var result = db[key];\n\n if (result) {\n result = self._dbInfo.serializer.deserialize(result);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n }\n\n function iterate(iterator, callback) {\n var self = this;\n\n var promise = self.ready().then(function () {\n var db = self._dbInfo.db;\n\n var iterationNumber = 1;\n for (var key in db) {\n if (db.hasOwnProperty(key)) {\n var value = db[key];\n\n if (value) {\n value = self._dbInfo.serializer.deserialize(value);\n }\n\n value = iterator(value, key, iterationNumber++);\n\n if (value !== void 0) {\n return value;\n }\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n }\n\n function key(n, callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var db = self._dbInfo.db;\n var result = null;\n var index = 0;\n\n for (var key in db) {\n if (db.hasOwnProperty(key)) {\n if (n === index) {\n result = key;\n break;\n }\n index++;\n }\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n }\n\n function keys(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var db = self._dbInfo.db;\n var keys = [];\n\n for (var key in db) {\n if (db.hasOwnProperty(key)) {\n keys.push(key);\n }\n }\n\n return keys;\n });\n\n executeCallback(promise, callback);\n return promise;\n }\n\n function length(callback) {\n var self = this;\n var promise = self.keys().then(function (keys) {\n return keys.length;\n });\n\n executeCallback(promise, callback);\n return promise;\n }\n\n function removeItem(key, callback) {\n var self = this;\n\n // Cast the key to a string, as that's all we can set as a key.\n if (typeof key !== 'string') {\n console.warn(key + ' used as a key, but it is not a string.');\n key = String(key);\n }\n\n var promise = self.ready().then(function () {\n var db = self._dbInfo.db;\n if (db.hasOwnProperty(key)) {\n delete db[key];\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n }\n\n function setItem(key, value, callback) {\n var self = this;\n\n // Cast the key to a string, as that's all we can set as a key.\n if (typeof key !== 'string') {\n console.warn(key + ' used as a key, but it is not a string.');\n key = String(key);\n }\n\n var promise = self.ready().then(function () {\n // Convert undefined values to null.\n // https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n function serializeAsync(value) {\n return new Promise(function (resolve, reject) {\n self._dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n resolve(value);\n }\n });\n });\n }\n\n return serializeAsync(value).then(function (value) {\n var db = self._dbInfo.db;\n db[key] = value;\n return originalValue;\n });\n });\n\n executeCallback(promise, callback);\n return promise;\n }\n\n var memoryStorageDriver = {\n _driver: 'memoryStorageDriver',\n _initStorage: _initStorage,\n // _supports: function() { return true; }\n iterate: iterate,\n getItem: getItem,\n setItem: setItem,\n removeItem: removeItem,\n clear: clear,\n length: length,\n key: key,\n keys: keys\n };\n\n return memoryStorageDriver;\n\n}));","/*!\n localForage -- Offline Storage, Improved\n Version 1.10.0\n https://localforage.github.io/localForage\n (c) 2013-2017 Mozilla, Apache License 2.0\n*/\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.localforage = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw (f.code=\"MODULE_NOT_FOUND\", f)}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var scriptEl = global.document.createElement('script');\n scriptEl.onreadystatechange = function () {\n nextTick();\n\n scriptEl.onreadystatechange = null;\n scriptEl.parentNode.removeChild(scriptEl);\n scriptEl = null;\n };\n global.document.documentElement.appendChild(scriptEl);\n };\n } else {\n scheduleDrain = function () {\n setTimeout(nextTick, 0);\n };\n }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n if (queue.push(task) === 1 && !draining) {\n scheduleDrain();\n }\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],2:[function(_dereq_,module,exports){\n'use strict';\nvar immediate = _dereq_(1);\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('resolver must be a function');\n }\n this.state = PENDING;\n this.queue = [];\n this.outcome = void 0;\n if (resolver !== INTERNAL) {\n safelyResolveThenable(this, resolver);\n }\n}\n\nPromise.prototype[\"catch\"] = function (onRejected) {\n return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n typeof onRejected !== 'function' && this.state === REJECTED) {\n return this;\n }\n var promise = new this.constructor(INTERNAL);\n if (this.state !== PENDING) {\n var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n unwrap(promise, resolver, this.outcome);\n } else {\n this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n }\n\n return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n this.promise = promise;\n if (typeof onFulfilled === 'function') {\n this.onFulfilled = onFulfilled;\n this.callFulfilled = this.otherCallFulfilled;\n }\n if (typeof onRejected === 'function') {\n this.onRejected = onRejected;\n this.callRejected = this.otherCallRejected;\n }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callRejected = function (value) {\n handlers.reject(this.promise, value);\n};\nQueueItem.prototype.otherCallRejected = function (value) {\n unwrap(this.promise, this.onRejected, value);\n};\n\nfunction unwrap(promise, func, value) {\n immediate(function () {\n var returnValue;\n try {\n returnValue = func(value);\n } catch (e) {\n return handlers.reject(promise, e);\n }\n if (returnValue === promise) {\n handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));\n } else {\n handlers.resolve(promise, returnValue);\n }\n });\n}\n\nhandlers.resolve = function (self, value) {\n var result = tryCatch(getThen, value);\n if (result.status === 'error') {\n return handlers.reject(self, result.value);\n }\n var thenable = result.value;\n\n if (thenable) {\n safelyResolveThenable(self, thenable);\n } else {\n self.state = FULFILLED;\n self.outcome = value;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callFulfilled(value);\n }\n }\n return self;\n};\nhandlers.reject = function (self, error) {\n self.state = REJECTED;\n self.outcome = error;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callRejected(error);\n }\n return self;\n};\n\nfunction getThen(obj) {\n // Make sure we only access the accessor once as required by the spec\n var then = obj && obj.then;\n if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {\n return function appyThen() {\n then.apply(obj, arguments);\n };\n }\n}\n\nfunction safelyResolveThenable(self, thenable) {\n // Either fulfill, reject or reject with error\n var called = false;\n function onError(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.reject(self, value);\n }\n\n function onSuccess(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.resolve(self, value);\n }\n\n function tryToUnwrap() {\n thenable(onSuccess, onError);\n }\n\n var result = tryCatch(tryToUnwrap);\n if (result.status === 'error') {\n onError(result.value);\n }\n}\n\nfunction tryCatch(func, value) {\n var out = {};\n try {\n out.value = func(value);\n out.status = 'success';\n } catch (e) {\n out.status = 'error';\n out.value = e;\n }\n return out;\n}\n\nPromise.resolve = resolve;\nfunction resolve(value) {\n if (value instanceof this) {\n return value;\n }\n return handlers.resolve(new this(INTERNAL), value);\n}\n\nPromise.reject = reject;\nfunction reject(reason) {\n var promise = new this(INTERNAL);\n return handlers.reject(promise, reason);\n}\n\nPromise.all = all;\nfunction all(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var values = new Array(len);\n var resolved = 0;\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n allResolver(iterable[i], i);\n }\n return promise;\n function allResolver(value, i) {\n self.resolve(value).then(resolveFromAll, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n function resolveFromAll(outValue) {\n values[i] = outValue;\n if (++resolved === len && !called) {\n called = true;\n handlers.resolve(promise, values);\n }\n }\n }\n}\n\nPromise.race = race;\nfunction race(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n resolver(iterable[i]);\n }\n return promise;\n function resolver(value) {\n self.resolve(value).then(function (response) {\n if (!called) {\n called = true;\n handlers.resolve(promise, response);\n }\n }, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n }\n}\n\n},{\"1\":1}],3:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nif (typeof global.Promise !== 'function') {\n global.Promise = _dereq_(2);\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"2\":2}],4:[function(_dereq_,module,exports){\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction getIDB() {\n /* global indexedDB,webkitIndexedDB,mozIndexedDB,OIndexedDB,msIndexedDB */\n try {\n if (typeof indexedDB !== 'undefined') {\n return indexedDB;\n }\n if (typeof webkitIndexedDB !== 'undefined') {\n return webkitIndexedDB;\n }\n if (typeof mozIndexedDB !== 'undefined') {\n return mozIndexedDB;\n }\n if (typeof OIndexedDB !== 'undefined') {\n return OIndexedDB;\n }\n if (typeof msIndexedDB !== 'undefined') {\n return msIndexedDB;\n }\n } catch (e) {\n return;\n }\n}\n\nvar idb = getIDB();\n\nfunction isIndexedDBValid() {\n try {\n // Initialize IndexedDB; fall back to vendor-prefixed versions\n // if needed.\n if (!idb || !idb.open) {\n return false;\n }\n // We mimic PouchDB here;\n //\n // We test for openDatabase because IE Mobile identifies itself\n // as Safari. Oh the lulz...\n var isSafari = typeof openDatabase !== 'undefined' && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform);\n\n var hasFetch = typeof fetch === 'function' && fetch.toString().indexOf('[native code') !== -1;\n\n // Safari <10.1 does not meet our requirements for IDB support\n // (see: https://github.com/pouchdb/pouchdb/issues/5572).\n // Safari 10.1 shipped with fetch, we can use that to detect it.\n // Note: this creates issues with `window.fetch` polyfills and\n // overrides; see:\n // https://github.com/localForage/localForage/issues/856\n return (!isSafari || hasFetch) && typeof indexedDB !== 'undefined' &&\n // some outdated implementations of IDB that appear on Samsung\n // and HTC Android devices <4.4 are missing IDBKeyRange\n // See: https://github.com/mozilla/localForage/issues/128\n // See: https://github.com/mozilla/localForage/issues/272\n typeof IDBKeyRange !== 'undefined';\n } catch (e) {\n return false;\n }\n}\n\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\nfunction createBlob(parts, properties) {\n /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */\n parts = parts || [];\n properties = properties || {};\n try {\n return new Blob(parts, properties);\n } catch (e) {\n if (e.name !== 'TypeError') {\n throw e;\n }\n var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder;\n var builder = new Builder();\n for (var i = 0; i < parts.length; i += 1) {\n builder.append(parts[i]);\n }\n return builder.getBlob(properties.type);\n }\n}\n\n// This is CommonJS because lie is an external dependency, so Rollup\n// can just ignore it.\nif (typeof Promise === 'undefined') {\n // In the \"nopromises\" build this will just throw if you don't have\n // a global promise object, but it would throw anyway later.\n _dereq_(3);\n}\nvar Promise$1 = Promise;\n\nfunction executeCallback(promise, callback) {\n if (callback) {\n promise.then(function (result) {\n callback(null, result);\n }, function (error) {\n callback(error);\n });\n }\n}\n\nfunction executeTwoCallbacks(promise, callback, errorCallback) {\n if (typeof callback === 'function') {\n promise.then(callback);\n }\n\n if (typeof errorCallback === 'function') {\n promise[\"catch\"](errorCallback);\n }\n}\n\nfunction normalizeKey(key) {\n // Cast the key to a string, as that's all we can set as a key.\n if (typeof key !== 'string') {\n console.warn(key + ' used as a key, but it is not a string.');\n key = String(key);\n }\n\n return key;\n}\n\nfunction getCallback() {\n if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {\n return arguments[arguments.length - 1];\n }\n}\n\n// Some code originally from async_storage.js in\n// [Gaia](https://github.com/mozilla-b2g/gaia).\n\nvar DETECT_BLOB_SUPPORT_STORE = 'local-forage-detect-blob-support';\nvar supportsBlobs = void 0;\nvar dbContexts = {};\nvar toString = Object.prototype.toString;\n\n// Transaction Modes\nvar READ_ONLY = 'readonly';\nvar READ_WRITE = 'readwrite';\n\n// Transform a binary string to an array buffer, because otherwise\n// weird stuff happens when you try to work with the binary string directly.\n// It is known.\n// From http://stackoverflow.com/questions/14967647/ (continues on next line)\n// encode-decode-image-with-base64-breaks-image (2013-04-21)\nfunction _binStringToArrayBuffer(bin) {\n var length = bin.length;\n var buf = new ArrayBuffer(length);\n var arr = new Uint8Array(buf);\n for (var i = 0; i < length; i++) {\n arr[i] = bin.charCodeAt(i);\n }\n return buf;\n}\n\n//\n// Blobs are not supported in all versions of IndexedDB, notably\n// Chrome <37 and Android <5. In those versions, storing a blob will throw.\n//\n// Various other blob bugs exist in Chrome v37-42 (inclusive).\n// Detecting them is expensive and confusing to users, and Chrome 37-42\n// is at very low usage worldwide, so we do a hacky userAgent check instead.\n//\n// content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120\n// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916\n// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836\n//\n// Code borrowed from PouchDB. See:\n// https://github.com/pouchdb/pouchdb/blob/master/packages/node_modules/pouchdb-adapter-idb/src/blobSupport.js\n//\nfunction _checkBlobSupportWithoutCaching(idb) {\n return new Promise$1(function (resolve) {\n var txn = idb.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE);\n var blob = createBlob(['']);\n txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key');\n\n txn.onabort = function (e) {\n // If the transaction aborts now its due to not being able to\n // write to the database, likely due to the disk being full\n e.preventDefault();\n e.stopPropagation();\n resolve(false);\n };\n\n txn.oncomplete = function () {\n var matchedChrome = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n var matchedEdge = navigator.userAgent.match(/Edge\\//);\n // MS Edge pretends to be Chrome 42:\n // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx\n resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43);\n };\n })[\"catch\"](function () {\n return false; // error, so assume unsupported\n });\n}\n\nfunction _checkBlobSupport(idb) {\n if (typeof supportsBlobs === 'boolean') {\n return Promise$1.resolve(supportsBlobs);\n }\n return _checkBlobSupportWithoutCaching(idb).then(function (value) {\n supportsBlobs = value;\n return supportsBlobs;\n });\n}\n\nfunction _deferReadiness(dbInfo) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Create a deferred object representing the current database operation.\n var deferredOperation = {};\n\n deferredOperation.promise = new Promise$1(function (resolve, reject) {\n deferredOperation.resolve = resolve;\n deferredOperation.reject = reject;\n });\n\n // Enqueue the deferred operation.\n dbContext.deferredOperations.push(deferredOperation);\n\n // Chain its promise to the database readiness.\n if (!dbContext.dbReady) {\n dbContext.dbReady = deferredOperation.promise;\n } else {\n dbContext.dbReady = dbContext.dbReady.then(function () {\n return deferredOperation.promise;\n });\n }\n}\n\nfunction _advanceReadiness(dbInfo) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Dequeue a deferred operation.\n var deferredOperation = dbContext.deferredOperations.pop();\n\n // Resolve its promise (which is part of the database readiness\n // chain of promises).\n if (deferredOperation) {\n deferredOperation.resolve();\n return deferredOperation.promise;\n }\n}\n\nfunction _rejectReadiness(dbInfo, err) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Dequeue a deferred operation.\n var deferredOperation = dbContext.deferredOperations.pop();\n\n // Reject its promise (which is part of the database readiness\n // chain of promises).\n if (deferredOperation) {\n deferredOperation.reject(err);\n return deferredOperation.promise;\n }\n}\n\nfunction _getConnection(dbInfo, upgradeNeeded) {\n return new Promise$1(function (resolve, reject) {\n dbContexts[dbInfo.name] = dbContexts[dbInfo.name] || createDbContext();\n\n if (dbInfo.db) {\n if (upgradeNeeded) {\n _deferReadiness(dbInfo);\n dbInfo.db.close();\n } else {\n return resolve(dbInfo.db);\n }\n }\n\n var dbArgs = [dbInfo.name];\n\n if (upgradeNeeded) {\n dbArgs.push(dbInfo.version);\n }\n\n var openreq = idb.open.apply(idb, dbArgs);\n\n if (upgradeNeeded) {\n openreq.onupgradeneeded = function (e) {\n var db = openreq.result;\n try {\n db.createObjectStore(dbInfo.storeName);\n if (e.oldVersion <= 1) {\n // Added when support for blob shims was added\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n }\n } catch (ex) {\n if (ex.name === 'ConstraintError') {\n console.warn('The database \"' + dbInfo.name + '\"' + ' has been upgraded from version ' + e.oldVersion + ' to version ' + e.newVersion + ', but the storage \"' + dbInfo.storeName + '\" already exists.');\n } else {\n throw ex;\n }\n }\n };\n }\n\n openreq.onerror = function (e) {\n e.preventDefault();\n reject(openreq.error);\n };\n\n openreq.onsuccess = function () {\n var db = openreq.result;\n db.onversionchange = function (e) {\n // Triggered when the database is modified (e.g. adding an objectStore) or\n // deleted (even when initiated by other sessions in different tabs).\n // Closing the connection here prevents those operations from being blocked.\n // If the database is accessed again later by this instance, the connection\n // will be reopened or the database recreated as needed.\n e.target.close();\n };\n resolve(db);\n _advanceReadiness(dbInfo);\n };\n });\n}\n\nfunction _getOriginalConnection(dbInfo) {\n return _getConnection(dbInfo, false);\n}\n\nfunction _getUpgradedConnection(dbInfo) {\n return _getConnection(dbInfo, true);\n}\n\nfunction _isUpgradeNeeded(dbInfo, defaultVersion) {\n if (!dbInfo.db) {\n return true;\n }\n\n var isNewStore = !dbInfo.db.objectStoreNames.contains(dbInfo.storeName);\n var isDowngrade = dbInfo.version < dbInfo.db.version;\n var isUpgrade = dbInfo.version > dbInfo.db.version;\n\n if (isDowngrade) {\n // If the version is not the default one\n // then warn for impossible downgrade.\n if (dbInfo.version !== defaultVersion) {\n console.warn('The database \"' + dbInfo.name + '\"' + \" can't be downgraded from version \" + dbInfo.db.version + ' to version ' + dbInfo.version + '.');\n }\n // Align the versions to prevent errors.\n dbInfo.version = dbInfo.db.version;\n }\n\n if (isUpgrade || isNewStore) {\n // If the store is new then increment the version (if needed).\n // This will trigger an \"upgradeneeded\" event which is required\n // for creating a store.\n if (isNewStore) {\n var incVersion = dbInfo.db.version + 1;\n if (incVersion > dbInfo.version) {\n dbInfo.version = incVersion;\n }\n }\n\n return true;\n }\n\n return false;\n}\n\n// encode a blob for indexeddb engines that don't support blobs\nfunction _encodeBlob(blob) {\n return new Promise$1(function (resolve, reject) {\n var reader = new FileReader();\n reader.onerror = reject;\n reader.onloadend = function (e) {\n var base64 = btoa(e.target.result || '');\n resolve({\n __local_forage_encoded_blob: true,\n data: base64,\n type: blob.type\n });\n };\n reader.readAsBinaryString(blob);\n });\n}\n\n// decode an encoded blob\nfunction _decodeBlob(encodedBlob) {\n var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data));\n return createBlob([arrayBuff], { type: encodedBlob.type });\n}\n\n// is this one of our fancy encoded blobs?\nfunction _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}\n\n// Specialize the default `ready()` function by making it dependent\n// on the current database operations. Thus, the driver will be actually\n// ready when it's been initialized (default) *and* there are no pending\n// operations on the database (initiated by some other instances).\nfunction _fullyReady(callback) {\n var self = this;\n\n var promise = self._initReady().then(function () {\n var dbContext = dbContexts[self._dbInfo.name];\n\n if (dbContext && dbContext.dbReady) {\n return dbContext.dbReady;\n }\n });\n\n executeTwoCallbacks(promise, callback, callback);\n return promise;\n}\n\n// Try to establish a new db connection to replace the\n// current one which is broken (i.e. experiencing\n// InvalidStateError while creating a transaction).\nfunction _tryReconnect(dbInfo) {\n _deferReadiness(dbInfo);\n\n var dbContext = dbContexts[dbInfo.name];\n var forages = dbContext.forages;\n\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n if (forage._dbInfo.db) {\n forage._dbInfo.db.close();\n forage._dbInfo.db = null;\n }\n }\n dbInfo.db = null;\n\n return _getOriginalConnection(dbInfo).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n // store the latest db reference\n // in case the db was upgraded\n dbInfo.db = dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n forages[i]._dbInfo.db = db;\n }\n })[\"catch\"](function (err) {\n _rejectReadiness(dbInfo, err);\n throw err;\n });\n}\n\n// FF doesn't like Promises (micro-tasks) and IDDB store operations,\n// so we have to do it with callbacks\nfunction createTransaction(dbInfo, mode, callback, retries) {\n if (retries === undefined) {\n retries = 1;\n }\n\n try {\n var tx = dbInfo.db.transaction(dbInfo.storeName, mode);\n callback(null, tx);\n } catch (err) {\n if (retries > 0 && (!dbInfo.db || err.name === 'InvalidStateError' || err.name === 'NotFoundError')) {\n return Promise$1.resolve().then(function () {\n if (!dbInfo.db || err.name === 'NotFoundError' && !dbInfo.db.objectStoreNames.contains(dbInfo.storeName) && dbInfo.version <= dbInfo.db.version) {\n // increase the db version, to create the new ObjectStore\n if (dbInfo.db) {\n dbInfo.version = dbInfo.db.version + 1;\n }\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n }).then(function () {\n return _tryReconnect(dbInfo).then(function () {\n createTransaction(dbInfo, mode, callback, retries - 1);\n });\n })[\"catch\"](callback);\n }\n\n callback(err);\n }\n}\n\nfunction createDbContext() {\n return {\n // Running localForages sharing a database.\n forages: [],\n // Shared database.\n db: null,\n // Database readiness (promise).\n dbReady: null,\n // Deferred operations on the database.\n deferredOperations: []\n };\n}\n\n// Open the IndexedDB database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n // Get the current context of the database;\n var dbContext = dbContexts[dbInfo.name];\n\n // ...or create a new context.\n if (!dbContext) {\n dbContext = createDbContext();\n // Register the new context in the global container.\n dbContexts[dbInfo.name] = dbContext;\n }\n\n // Register itself as a running localForage in the current context.\n dbContext.forages.push(self);\n\n // Replace the default `ready()` function with the specialized one.\n if (!self._initReady) {\n self._initReady = self.ready;\n self.ready = _fullyReady;\n }\n\n // Create an array of initialization states of the related localForages.\n var initPromises = [];\n\n function ignoreErrors() {\n // Don't handle errors here,\n // just makes sure related localForages aren't pending.\n return Promise$1.resolve();\n }\n\n for (var j = 0; j < dbContext.forages.length; j++) {\n var forage = dbContext.forages[j];\n if (forage !== self) {\n // Don't wait for itself...\n initPromises.push(forage._initReady()[\"catch\"](ignoreErrors));\n }\n }\n\n // Take a snapshot of the related localForages.\n var forages = dbContext.forages.slice(0);\n\n // Initialize the connection process only when\n // all the related localForages aren't pending.\n return Promise$1.all(initPromises).then(function () {\n dbInfo.db = dbContext.db;\n // Get the connection or open a new one without upgrade.\n return _getOriginalConnection(dbInfo);\n }).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo, self._defaultConfig.version)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n dbInfo.db = dbContext.db = db;\n self._dbInfo = dbInfo;\n // Share the final connection amongst related localForages.\n for (var k = 0; k < forages.length; k++) {\n var forage = forages[k];\n if (forage !== self) {\n // Self is already up-to-date.\n forage._dbInfo.db = dbInfo.db;\n forage._dbInfo.version = dbInfo.version;\n }\n }\n });\n}\n\nfunction getItem(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.get(key);\n\n req.onsuccess = function () {\n var value = req.result;\n if (value === undefined) {\n value = null;\n }\n if (_isEncodedBlob(value)) {\n value = _decodeBlob(value);\n }\n resolve(value);\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Iterate over all items stored in database.\nfunction iterate(iterator, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.openCursor();\n var iterationNumber = 1;\n\n req.onsuccess = function () {\n var cursor = req.result;\n\n if (cursor) {\n var value = cursor.value;\n if (_isEncodedBlob(value)) {\n value = _decodeBlob(value);\n }\n var result = iterator(value, cursor.key, iterationNumber++);\n\n // when the iterator callback returns any\n // (non-`undefined`) value, then we stop\n // the iteration immediately\n if (result !== void 0) {\n resolve(result);\n } else {\n cursor[\"continue\"]();\n }\n } else {\n resolve();\n }\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n\n return promise;\n}\n\nfunction setItem(key, value, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n var dbInfo;\n self.ready().then(function () {\n dbInfo = self._dbInfo;\n if (toString.call(value) === '[object Blob]') {\n return _checkBlobSupport(dbInfo.db).then(function (blobSupport) {\n if (blobSupport) {\n return value;\n }\n return _encodeBlob(value);\n });\n }\n return value;\n }).then(function (value) {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n\n // The reason we don't _save_ null is because IE 10 does\n // not support saving the `null` type in IndexedDB. How\n // ironic, given the bug below!\n // See: https://github.com/mozilla/localForage/issues/161\n if (value === null) {\n value = undefined;\n }\n\n var req = store.put(value, key);\n\n transaction.oncomplete = function () {\n // Cast to undefined so the value passed to\n // callback/promise is the same as what one would get out\n // of `getItem()` later. This leads to some weirdness\n // (setItem('foo', undefined) will return `null`), but\n // it's not my fault localStorage is our baseline and that\n // it's weird.\n if (value === undefined) {\n value = null;\n }\n\n resolve(value);\n };\n transaction.onabort = transaction.onerror = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction removeItem(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n // We use a Grunt task to make this safe for IE and some\n // versions of Android (including those used by Cordova).\n // Normally IE won't like `.delete()` and will insist on\n // using `['delete']()`, but we have a build step that\n // fixes this for us now.\n var req = store[\"delete\"](key);\n transaction.oncomplete = function () {\n resolve();\n };\n\n transaction.onerror = function () {\n reject(req.error);\n };\n\n // The request will be also be aborted if we've exceeded our storage\n // space.\n transaction.onabort = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction clear(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.clear();\n\n transaction.oncomplete = function () {\n resolve();\n };\n\n transaction.onabort = transaction.onerror = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction length(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.count();\n\n req.onsuccess = function () {\n resolve(req.result);\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction key(n, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n if (n < 0) {\n resolve(null);\n\n return;\n }\n\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var advanced = false;\n var req = store.openKeyCursor();\n\n req.onsuccess = function () {\n var cursor = req.result;\n if (!cursor) {\n // this means there weren't enough keys\n resolve(null);\n\n return;\n }\n\n if (n === 0) {\n // We have the first key, return it if that's what they\n // wanted.\n resolve(cursor.key);\n } else {\n if (!advanced) {\n // Otherwise, ask the cursor to skip ahead n\n // records.\n advanced = true;\n cursor.advance(n);\n } else {\n // When we get here, we've got the nth key.\n resolve(cursor.key);\n }\n }\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.openKeyCursor();\n var keys = [];\n\n req.onsuccess = function () {\n var cursor = req.result;\n\n if (!cursor) {\n resolve(keys);\n return;\n }\n\n keys.push(cursor.key);\n cursor[\"continue\"]();\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction dropInstance(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n var currentConfig = this.config();\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n var isCurrentDb = options.name === currentConfig.name && self._dbInfo.db;\n\n var dbPromise = isCurrentDb ? Promise$1.resolve(self._dbInfo.db) : _getOriginalConnection(options).then(function (db) {\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n forages[i]._dbInfo.db = db;\n }\n return db;\n });\n\n if (!options.storeName) {\n promise = dbPromise.then(function (db) {\n _deferReadiness(options);\n\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n\n db.close();\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n forage._dbInfo.db = null;\n }\n\n var dropDBPromise = new Promise$1(function (resolve, reject) {\n var req = idb.deleteDatabase(options.name);\n\n req.onerror = function () {\n var db = req.result;\n if (db) {\n db.close();\n }\n reject(req.error);\n };\n\n req.onblocked = function () {\n // Closing all open connections in onversionchange handler should prevent this situation, but if\n // we do get here, it just means the request remains pending - eventually it will succeed or error\n console.warn('dropInstance blocked for database \"' + options.name + '\" until all open connections are closed');\n };\n\n req.onsuccess = function () {\n var db = req.result;\n if (db) {\n db.close();\n }\n resolve(db);\n };\n });\n\n return dropDBPromise.then(function (db) {\n dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n var _forage = forages[i];\n _advanceReadiness(_forage._dbInfo);\n }\n })[\"catch\"](function (err) {\n (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n throw err;\n });\n });\n } else {\n promise = dbPromise.then(function (db) {\n if (!db.objectStoreNames.contains(options.storeName)) {\n return;\n }\n\n var newVersion = db.version + 1;\n\n _deferReadiness(options);\n\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n\n db.close();\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n forage._dbInfo.db = null;\n forage._dbInfo.version = newVersion;\n }\n\n var dropObjectPromise = new Promise$1(function (resolve, reject) {\n var req = idb.open(options.name, newVersion);\n\n req.onerror = function (err) {\n var db = req.result;\n db.close();\n reject(err);\n };\n\n req.onupgradeneeded = function () {\n var db = req.result;\n db.deleteObjectStore(options.storeName);\n };\n\n req.onsuccess = function () {\n var db = req.result;\n db.close();\n resolve(db);\n };\n });\n\n return dropObjectPromise.then(function (db) {\n dbContext.db = db;\n for (var j = 0; j < forages.length; j++) {\n var _forage2 = forages[j];\n _forage2._dbInfo.db = db;\n _advanceReadiness(_forage2._dbInfo);\n }\n })[\"catch\"](function (err) {\n (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n throw err;\n });\n });\n }\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar asyncStorage = {\n _driver: 'asyncStorage',\n _initStorage: _initStorage,\n _support: isIndexedDBValid(),\n iterate: iterate,\n getItem: getItem,\n setItem: setItem,\n removeItem: removeItem,\n clear: clear,\n length: length,\n key: key,\n keys: keys,\n dropInstance: dropInstance\n};\n\nfunction isWebSQLValid() {\n return typeof openDatabase === 'function';\n}\n\n// Sadly, the best way to save binary data in WebSQL/localStorage is serializing\n// it to Base64, so this is how we store it to prevent very strange errors with less\n// verbose ways of binary <-> string data storage.\nvar BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\nvar BLOB_TYPE_PREFIX = '~~local_forage_type~';\nvar BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;\n\nvar SERIALIZED_MARKER = '__lfsc__:';\nvar SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;\n\n// OMG the serializations!\nvar TYPE_ARRAYBUFFER = 'arbf';\nvar TYPE_BLOB = 'blob';\nvar TYPE_INT8ARRAY = 'si08';\nvar TYPE_UINT8ARRAY = 'ui08';\nvar TYPE_UINT8CLAMPEDARRAY = 'uic8';\nvar TYPE_INT16ARRAY = 'si16';\nvar TYPE_INT32ARRAY = 'si32';\nvar TYPE_UINT16ARRAY = 'ur16';\nvar TYPE_UINT32ARRAY = 'ui32';\nvar TYPE_FLOAT32ARRAY = 'fl32';\nvar TYPE_FLOAT64ARRAY = 'fl64';\nvar TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length;\n\nvar toString$1 = Object.prototype.toString;\n\nfunction stringToBuffer(serializedString) {\n // Fill the string into a ArrayBuffer.\n var bufferLength = serializedString.length * 0.75;\n var len = serializedString.length;\n var i;\n var p = 0;\n var encoded1, encoded2, encoded3, encoded4;\n\n if (serializedString[serializedString.length - 1] === '=') {\n bufferLength--;\n if (serializedString[serializedString.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n var buffer = new ArrayBuffer(bufferLength);\n var bytes = new Uint8Array(buffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = BASE_CHARS.indexOf(serializedString[i]);\n encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]);\n encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]);\n encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]);\n\n /*jslint bitwise: true */\n bytes[p++] = encoded1 << 2 | encoded2 >> 4;\n bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;\n bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;\n }\n return buffer;\n}\n\n// Converts a buffer to a string to store, serialized, in the backend\n// storage library.\nfunction bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}\n\n// Serialize a value, afterwards executing a callback (which usually\n// instructs the `setItem()` callback/promise to be executed). This is how\n// we store binary data with localStorage.\nfunction serialize(value, callback) {\n var valueType = '';\n if (value) {\n valueType = toString$1.call(value);\n }\n\n // Cannot use `value instanceof ArrayBuffer` or such here, as these\n // checks fail when running the tests using casper.js...\n //\n // TODO: See why those tests fail and use a better solution.\n if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString$1.call(value.buffer) === '[object ArrayBuffer]')) {\n // Convert binary arrays to a string and prefix the string with\n // a special marker.\n var buffer;\n var marker = SERIALIZED_MARKER;\n\n if (value instanceof ArrayBuffer) {\n buffer = value;\n marker += TYPE_ARRAYBUFFER;\n } else {\n buffer = value.buffer;\n\n if (valueType === '[object Int8Array]') {\n marker += TYPE_INT8ARRAY;\n } else if (valueType === '[object Uint8Array]') {\n marker += TYPE_UINT8ARRAY;\n } else if (valueType === '[object Uint8ClampedArray]') {\n marker += TYPE_UINT8CLAMPEDARRAY;\n } else if (valueType === '[object Int16Array]') {\n marker += TYPE_INT16ARRAY;\n } else if (valueType === '[object Uint16Array]') {\n marker += TYPE_UINT16ARRAY;\n } else if (valueType === '[object Int32Array]') {\n marker += TYPE_INT32ARRAY;\n } else if (valueType === '[object Uint32Array]') {\n marker += TYPE_UINT32ARRAY;\n } else if (valueType === '[object Float32Array]') {\n marker += TYPE_FLOAT32ARRAY;\n } else if (valueType === '[object Float64Array]') {\n marker += TYPE_FLOAT64ARRAY;\n } else {\n callback(new Error('Failed to get type for BinaryArray'));\n }\n }\n\n callback(marker + bufferToString(buffer));\n } else if (valueType === '[object Blob]') {\n // Conver the blob to a binaryArray and then to a string.\n var fileReader = new FileReader();\n\n fileReader.onload = function () {\n // Backwards-compatible prefix for the blob type.\n var str = BLOB_TYPE_PREFIX + value.type + '~' + bufferToString(this.result);\n\n callback(SERIALIZED_MARKER + TYPE_BLOB + str);\n };\n\n fileReader.readAsArrayBuffer(value);\n } else {\n try {\n callback(JSON.stringify(value));\n } catch (e) {\n console.error(\"Couldn't convert value into a JSON string: \", value);\n\n callback(null, e);\n }\n }\n}\n\n// Deserialize data we've inserted into a value column/field. We place\n// special markers into our strings to mark them as encoded; this isn't\n// as nice as a meta field, but it's the only sane thing we can do whilst\n// keeping localStorage support intact.\n//\n// Oftentimes this will just deserialize JSON content, but if we have a\n// special marker (SERIALIZED_MARKER, defined above), we will extract\n// some kind of arraybuffer/binary data/typed array out of the string.\nfunction deserialize(value) {\n // If we haven't marked this string as being specially serialized (i.e.\n // something other than serialized JSON), we can just return it and be\n // done with it.\n if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {\n return JSON.parse(value);\n }\n\n // The following code deals with deserializing some kind of Blob or\n // TypedArray. First we separate out the type of data we're dealing\n // with from the data itself.\n var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);\n var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);\n\n var blobType;\n // Backwards-compatible blob type serialization strategy.\n // DBs created with older versions of localForage will simply not have the blob type.\n if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {\n var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);\n blobType = matcher[1];\n serializedString = serializedString.substring(matcher[0].length);\n }\n var buffer = stringToBuffer(serializedString);\n\n // Return the right type based on the code/type set during\n // serialization.\n switch (type) {\n case TYPE_ARRAYBUFFER:\n return buffer;\n case TYPE_BLOB:\n return createBlob([buffer], { type: blobType });\n case TYPE_INT8ARRAY:\n return new Int8Array(buffer);\n case TYPE_UINT8ARRAY:\n return new Uint8Array(buffer);\n case TYPE_UINT8CLAMPEDARRAY:\n return new Uint8ClampedArray(buffer);\n case TYPE_INT16ARRAY:\n return new Int16Array(buffer);\n case TYPE_UINT16ARRAY:\n return new Uint16Array(buffer);\n case TYPE_INT32ARRAY:\n return new Int32Array(buffer);\n case TYPE_UINT32ARRAY:\n return new Uint32Array(buffer);\n case TYPE_FLOAT32ARRAY:\n return new Float32Array(buffer);\n case TYPE_FLOAT64ARRAY:\n return new Float64Array(buffer);\n default:\n throw new Error('Unkown type: ' + type);\n }\n}\n\nvar localforageSerializer = {\n serialize: serialize,\n deserialize: deserialize,\n stringToBuffer: stringToBuffer,\n bufferToString: bufferToString\n};\n\n/*\n * Includes code from:\n *\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n\nfunction createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}\n\n// Open the WebSQL database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function (t) {\n createDbTable(t, dbInfo, function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n }, reject);\n });\n\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n}\n\nfunction tryExecuteSql(t, dbInfo, sqlStatement, args, callback, errorCallback) {\n t.executeSql(sqlStatement, args, callback, function (t, error) {\n if (error.code === error.SYNTAX_ERR) {\n t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name = ?\", [dbInfo.storeName], function (t, results) {\n if (!results.rows.length) {\n // if the table is missing (was deleted)\n // re-create it table and retry\n createDbTable(t, dbInfo, function () {\n t.executeSql(sqlStatement, args, callback, errorCallback);\n }, errorCallback);\n } else {\n errorCallback(t, error);\n }\n }, errorCallback);\n } else {\n errorCallback(t, error);\n }\n }, errorCallback);\n}\n\nfunction getItem$1(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName + ' WHERE key = ? LIMIT 1', [key], function (t, results) {\n var result = results.rows.length ? results.rows.item(0).value : null;\n\n // Check to see if this is serialized content we need to\n // unpack.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction iterate$1(iterator, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName, [], function (t, results) {\n var rows = results.rows;\n var length = rows.length;\n\n for (var i = 0; i < length; i++) {\n var item = rows.item(i);\n var result = item.value;\n\n // Check to see if this is serialized content\n // we need to unpack.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n result = iterator(result, item.key, i + 1);\n\n // void(0) prevents problems with redefinition\n // of `undefined`.\n if (result !== void 0) {\n resolve(result);\n return;\n }\n }\n\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction _setItem(key, value, callback, retriesLeft) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n // The localStorage API doesn't return undefined values in an\n // \"expected\" way, so undefined is always cast to null in all\n // drivers. See: https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n var dbInfo = self._dbInfo;\n dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'INSERT OR REPLACE INTO ' + dbInfo.storeName + ' ' + '(key, value) VALUES (?, ?)', [key, value], function () {\n resolve(originalValue);\n }, function (t, error) {\n reject(error);\n });\n }, function (sqlError) {\n // The transaction failed; check\n // to see if it's a quota error.\n if (sqlError.code === sqlError.QUOTA_ERR) {\n // We reject the callback outright for now, but\n // it's worth trying to re-run the transaction.\n // Even if the user accepts the prompt to use\n // more storage on Safari, this error will\n // be called.\n //\n // Try to re-run the transaction.\n if (retriesLeft > 0) {\n resolve(_setItem.apply(self, [key, originalValue, callback, retriesLeft - 1]));\n return;\n }\n reject(sqlError);\n }\n });\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction setItem$1(key, value, callback) {\n return _setItem.apply(this, [key, value, callback, 1]);\n}\n\nfunction removeItem$1(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName + ' WHERE key = ?', [key], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Deletes every item in the table.\n// TODO: Find out if this resets the AUTO_INCREMENT number.\nfunction clear$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName, [], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Does a simple `COUNT(key)` to get the number of items stored in\n// localForage.\nfunction length$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n // Ahhh, SQL makes this one soooooo easy.\n tryExecuteSql(t, dbInfo, 'SELECT COUNT(key) as c FROM ' + dbInfo.storeName, [], function (t, results) {\n var result = results.rows.item(0).c;\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Return the key located at key index X; essentially gets the key from a\n// `WHERE id = ?`. This is the most efficient way I can think to implement\n// this rarely-used (in my experience) part of the API, but it can seem\n// inconsistent, because we do `INSERT OR REPLACE INTO` on `setItem()`, so\n// the ID of each key will change every time it's updated. Perhaps a stored\n// procedure for the `setItem()` SQL would solve this problem?\n// TODO: Don't change ID on `setItem()`.\nfunction key$1(n, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName + ' WHERE id = ? LIMIT 1', [n + 1], function (t, results) {\n var result = results.rows.length ? results.rows.item(0).key : null;\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName, [], function (t, results) {\n var keys = [];\n\n for (var i = 0; i < results.rows.length; i++) {\n keys.push(results.rows.item(i).key);\n }\n\n resolve(keys);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// https://www.w3.org/TR/webdatabase/#databases\n// > There is no way to enumerate or delete the databases available for an origin from this API.\nfunction getAllStoreNames(db) {\n return new Promise$1(function (resolve, reject) {\n db.transaction(function (t) {\n t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'\", [], function (t, results) {\n var storeNames = [];\n\n for (var i = 0; i < results.rows.length; i++) {\n storeNames.push(results.rows.item(i).name);\n }\n\n resolve({\n db: db,\n storeNames: storeNames\n });\n }, function (t, error) {\n reject(error);\n });\n }, function (sqlError) {\n reject(sqlError);\n });\n });\n}\n\nfunction dropInstance$1(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n var currentConfig = this.config();\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n promise = new Promise$1(function (resolve) {\n var db;\n if (options.name === currentConfig.name) {\n // use the db reference of the current instance\n db = self._dbInfo.db;\n } else {\n db = openDatabase(options.name, '', '', 0);\n }\n\n if (!options.storeName) {\n // drop all database tables\n resolve(getAllStoreNames(db));\n } else {\n resolve({\n db: db,\n storeNames: [options.storeName]\n });\n }\n }).then(function (operationInfo) {\n return new Promise$1(function (resolve, reject) {\n operationInfo.db.transaction(function (t) {\n function dropTable(storeName) {\n return new Promise$1(function (resolve, reject) {\n t.executeSql('DROP TABLE IF EXISTS ' + storeName, [], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n }\n\n var operations = [];\n for (var i = 0, len = operationInfo.storeNames.length; i < len; i++) {\n operations.push(dropTable(operationInfo.storeNames[i]));\n }\n\n Promise$1.all(operations).then(function () {\n resolve();\n })[\"catch\"](function (e) {\n reject(e);\n });\n }, function (sqlError) {\n reject(sqlError);\n });\n });\n });\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar webSQLStorage = {\n _driver: 'webSQLStorage',\n _initStorage: _initStorage$1,\n _support: isWebSQLValid(),\n iterate: iterate$1,\n getItem: getItem$1,\n setItem: setItem$1,\n removeItem: removeItem$1,\n clear: clear$1,\n length: length$1,\n key: key$1,\n keys: keys$1,\n dropInstance: dropInstance$1\n};\n\nfunction isLocalStorageValid() {\n try {\n return typeof localStorage !== 'undefined' && 'setItem' in localStorage &&\n // in IE8 typeof localStorage.setItem === 'object'\n !!localStorage.setItem;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getKeyPrefix(options, defaultConfig) {\n var keyPrefix = options.name + '/';\n\n if (options.storeName !== defaultConfig.storeName) {\n keyPrefix += options.storeName + '/';\n }\n return keyPrefix;\n}\n\n// Check if localStorage throws when saving an item\nfunction checkIfLocalStorageThrows() {\n var localStorageTestKey = '_localforage_support_test';\n\n try {\n localStorage.setItem(localStorageTestKey, true);\n localStorage.removeItem(localStorageTestKey);\n\n return false;\n } catch (e) {\n return true;\n }\n}\n\n// Check if localStorage is usable and allows to save an item\n// This method checks if localStorage is usable in Safari Private Browsing\n// mode, or in any other case where the available quota for localStorage\n// is 0 and there wasn't any saved items yet.\nfunction _isLocalStorageUsable() {\n return !checkIfLocalStorageThrows() || localStorage.length > 0;\n}\n\n// Config the localStorage backend, using options set in the config.\nfunction _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}\n\n// Remove all keys from the datastore, effectively destroying all data in\n// the app's key/value store!\nfunction clear$2(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var keyPrefix = self._dbInfo.keyPrefix;\n\n for (var i = localStorage.length - 1; i >= 0; i--) {\n var key = localStorage.key(i);\n\n if (key.indexOf(keyPrefix) === 0) {\n localStorage.removeItem(key);\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Retrieve an item from the store. Unlike the original async_storage\n// library in Gaia, we don't modify return values at all. If a key's value\n// is `undefined`, we pass that value to the callback function.\nfunction getItem$2(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result = localStorage.getItem(dbInfo.keyPrefix + key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the key\n // is likely undefined and we'll pass it straight to the\n // callback.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Iterate over all items in the store.\nfunction iterate$2(iterator, callback) {\n var self = this;\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var keyPrefix = dbInfo.keyPrefix;\n var keyPrefixLength = keyPrefix.length;\n var length = localStorage.length;\n\n // We use a dedicated iterator instead of the `i` variable below\n // so other keys we fetch in localStorage aren't counted in\n // the `iterationNumber` argument passed to the `iterate()`\n // callback.\n //\n // See: github.com/mozilla/localForage/pull/435#discussion_r38061530\n var iterationNumber = 1;\n\n for (var i = 0; i < length; i++) {\n var key = localStorage.key(i);\n if (key.indexOf(keyPrefix) !== 0) {\n continue;\n }\n var value = localStorage.getItem(key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the\n // key is likely undefined and we'll pass it straight\n // to the iterator.\n if (value) {\n value = dbInfo.serializer.deserialize(value);\n }\n\n value = iterator(value, key.substring(keyPrefixLength), iterationNumber++);\n\n if (value !== void 0) {\n return value;\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Same as localStorage's key() method, except takes a callback.\nfunction key$2(n, callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result;\n try {\n result = localStorage.key(n);\n } catch (error) {\n result = null;\n }\n\n // Remove the prefix from the key, if a key is found.\n if (result) {\n result = result.substring(dbInfo.keyPrefix.length);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys$2(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var length = localStorage.length;\n var keys = [];\n\n for (var i = 0; i < length; i++) {\n var itemKey = localStorage.key(i);\n if (itemKey.indexOf(dbInfo.keyPrefix) === 0) {\n keys.push(itemKey.substring(dbInfo.keyPrefix.length));\n }\n }\n\n return keys;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Supply the number of keys in the datastore to the callback function.\nfunction length$2(callback) {\n var self = this;\n var promise = self.keys().then(function (keys) {\n return keys.length;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Remove an item from the store, nice and simple.\nfunction removeItem$2(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n localStorage.removeItem(dbInfo.keyPrefix + key);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Set a key's value and run an optional callback once the value is set.\n// Unlike Gaia's implementation, the callback function is passed the value,\n// in case you want to operate on that value only after you're sure it\n// saved, or something like that.\nfunction setItem$2(key, value, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n // Convert undefined values to null.\n // https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n return new Promise$1(function (resolve, reject) {\n var dbInfo = self._dbInfo;\n dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n try {\n localStorage.setItem(dbInfo.keyPrefix + key, value);\n resolve(originalValue);\n } catch (e) {\n // localStorage capacity exceeded.\n // TODO: Make this a specific error/event.\n if (e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {\n reject(e);\n }\n reject(e);\n }\n }\n });\n });\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction dropInstance$2(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n var currentConfig = this.config();\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n promise = new Promise$1(function (resolve) {\n if (!options.storeName) {\n resolve(options.name + '/');\n } else {\n resolve(_getKeyPrefix(options, self._defaultConfig));\n }\n }).then(function (keyPrefix) {\n for (var i = localStorage.length - 1; i >= 0; i--) {\n var key = localStorage.key(i);\n\n if (key.indexOf(keyPrefix) === 0) {\n localStorage.removeItem(key);\n }\n }\n });\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar localStorageWrapper = {\n _driver: 'localStorageWrapper',\n _initStorage: _initStorage$2,\n _support: isLocalStorageValid(),\n iterate: iterate$2,\n getItem: getItem$2,\n setItem: setItem$2,\n removeItem: removeItem$2,\n clear: clear$2,\n length: length$2,\n key: key$2,\n keys: keys$2,\n dropInstance: dropInstance$2\n};\n\nvar sameValue = function sameValue(x, y) {\n return x === y || typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y);\n};\n\nvar includes = function includes(array, searchElement) {\n var len = array.length;\n var i = 0;\n while (i < len) {\n if (sameValue(array[i], searchElement)) {\n return true;\n }\n i++;\n }\n\n return false;\n};\n\nvar isArray = Array.isArray || function (arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n};\n\n// Drivers are stored here when `defineDriver()` is called.\n// They are shared across all instances of localForage.\nvar DefinedDrivers = {};\n\nvar DriverSupport = {};\n\nvar DefaultDrivers = {\n INDEXEDDB: asyncStorage,\n WEBSQL: webSQLStorage,\n LOCALSTORAGE: localStorageWrapper\n};\n\nvar DefaultDriverOrder = [DefaultDrivers.INDEXEDDB._driver, DefaultDrivers.WEBSQL._driver, DefaultDrivers.LOCALSTORAGE._driver];\n\nvar OptionalDriverMethods = ['dropInstance'];\n\nvar LibraryMethods = ['clear', 'getItem', 'iterate', 'key', 'keys', 'length', 'removeItem', 'setItem'].concat(OptionalDriverMethods);\n\nvar DefaultConfig = {\n description: '',\n driver: DefaultDriverOrder.slice(),\n name: 'localforage',\n // Default DB size is _JUST UNDER_ 5MB, as it's the highest size\n // we can use without a prompt.\n size: 4980736,\n storeName: 'keyvaluepairs',\n version: 1.0\n};\n\nfunction callWhenReady(localForageInstance, libraryMethod) {\n localForageInstance[libraryMethod] = function () {\n var _args = arguments;\n return localForageInstance.ready().then(function () {\n return localForageInstance[libraryMethod].apply(localForageInstance, _args);\n });\n };\n}\n\nfunction extend() {\n for (var i = 1; i < arguments.length; i++) {\n var arg = arguments[i];\n\n if (arg) {\n for (var _key in arg) {\n if (arg.hasOwnProperty(_key)) {\n if (isArray(arg[_key])) {\n arguments[0][_key] = arg[_key].slice();\n } else {\n arguments[0][_key] = arg[_key];\n }\n }\n }\n }\n }\n\n return arguments[0];\n}\n\nvar LocalForage = function () {\n function LocalForage(options) {\n _classCallCheck(this, LocalForage);\n\n for (var driverTypeKey in DefaultDrivers) {\n if (DefaultDrivers.hasOwnProperty(driverTypeKey)) {\n var driver = DefaultDrivers[driverTypeKey];\n var driverName = driver._driver;\n this[driverTypeKey] = driverName;\n\n if (!DefinedDrivers[driverName]) {\n // we don't need to wait for the promise,\n // since the default drivers can be defined\n // in a blocking manner\n this.defineDriver(driver);\n }\n }\n }\n\n this._defaultConfig = extend({}, DefaultConfig);\n this._config = extend({}, this._defaultConfig, options);\n this._driverSet = null;\n this._initDriver = null;\n this._ready = false;\n this._dbInfo = null;\n\n this._wrapLibraryMethodsWithReady();\n this.setDriver(this._config.driver)[\"catch\"](function () {});\n }\n\n // Set any config values for localForage; can be called anytime before\n // the first API call (e.g. `getItem`, `setItem`).\n // We loop through options so we don't overwrite existing config\n // values.\n\n\n LocalForage.prototype.config = function config(options) {\n // If the options argument is an object, we use it to set values.\n // Otherwise, we return either a specified config value or all\n // config values.\n if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {\n // If localforage is ready and fully initialized, we can't set\n // any new configuration values. Instead, we return an error.\n if (this._ready) {\n return new Error(\"Can't call config() after localforage \" + 'has been used.');\n }\n\n for (var i in options) {\n if (i === 'storeName') {\n options[i] = options[i].replace(/\\W/g, '_');\n }\n\n if (i === 'version' && typeof options[i] !== 'number') {\n return new Error('Database version must be a number.');\n }\n\n this._config[i] = options[i];\n }\n\n // after all config options are set and\n // the driver option is used, try setting it\n if ('driver' in options && options.driver) {\n return this.setDriver(this._config.driver);\n }\n\n return true;\n } else if (typeof options === 'string') {\n return this._config[options];\n } else {\n return this._config;\n }\n };\n\n // Used to define a custom driver, shared across all instances of\n // localForage.\n\n\n LocalForage.prototype.defineDriver = function defineDriver(driverObject, callback, errorCallback) {\n var promise = new Promise$1(function (resolve, reject) {\n try {\n var driverName = driverObject._driver;\n var complianceError = new Error('Custom driver not compliant; see ' + 'https://mozilla.github.io/localForage/#definedriver');\n\n // A driver name should be defined and not overlap with the\n // library-defined, default drivers.\n if (!driverObject._driver) {\n reject(complianceError);\n return;\n }\n\n var driverMethods = LibraryMethods.concat('_initStorage');\n for (var i = 0, len = driverMethods.length; i < len; i++) {\n var driverMethodName = driverMethods[i];\n\n // when the property is there,\n // it should be a method even when optional\n var isRequired = !includes(OptionalDriverMethods, driverMethodName);\n if ((isRequired || driverObject[driverMethodName]) && typeof driverObject[driverMethodName] !== 'function') {\n reject(complianceError);\n return;\n }\n }\n\n var configureMissingMethods = function configureMissingMethods() {\n var methodNotImplementedFactory = function methodNotImplementedFactory(methodName) {\n return function () {\n var error = new Error('Method ' + methodName + ' is not implemented by the current driver');\n var promise = Promise$1.reject(error);\n executeCallback(promise, arguments[arguments.length - 1]);\n return promise;\n };\n };\n\n for (var _i = 0, _len = OptionalDriverMethods.length; _i < _len; _i++) {\n var optionalDriverMethod = OptionalDriverMethods[_i];\n if (!driverObject[optionalDriverMethod]) {\n driverObject[optionalDriverMethod] = methodNotImplementedFactory(optionalDriverMethod);\n }\n }\n };\n\n configureMissingMethods();\n\n var setDriverSupport = function setDriverSupport(support) {\n if (DefinedDrivers[driverName]) {\n console.info('Redefining LocalForage driver: ' + driverName);\n }\n DefinedDrivers[driverName] = driverObject;\n DriverSupport[driverName] = support;\n // don't use a then, so that we can define\n // drivers that have simple _support methods\n // in a blocking manner\n resolve();\n };\n\n if ('_support' in driverObject) {\n if (driverObject._support && typeof driverObject._support === 'function') {\n driverObject._support().then(setDriverSupport, reject);\n } else {\n setDriverSupport(!!driverObject._support);\n }\n } else {\n setDriverSupport(true);\n }\n } catch (e) {\n reject(e);\n }\n });\n\n executeTwoCallbacks(promise, callback, errorCallback);\n return promise;\n };\n\n LocalForage.prototype.driver = function driver() {\n return this._driver || null;\n };\n\n LocalForage.prototype.getDriver = function getDriver(driverName, callback, errorCallback) {\n var getDriverPromise = DefinedDrivers[driverName] ? Promise$1.resolve(DefinedDrivers[driverName]) : Promise$1.reject(new Error('Driver not found.'));\n\n executeTwoCallbacks(getDriverPromise, callback, errorCallback);\n return getDriverPromise;\n };\n\n LocalForage.prototype.getSerializer = function getSerializer(callback) {\n var serializerPromise = Promise$1.resolve(localforageSerializer);\n executeTwoCallbacks(serializerPromise, callback);\n return serializerPromise;\n };\n\n LocalForage.prototype.ready = function ready(callback) {\n var self = this;\n\n var promise = self._driverSet.then(function () {\n if (self._ready === null) {\n self._ready = self._initDriver();\n }\n\n return self._ready;\n });\n\n executeTwoCallbacks(promise, callback, callback);\n return promise;\n };\n\n LocalForage.prototype.setDriver = function setDriver(drivers, callback, errorCallback) {\n var self = this;\n\n if (!isArray(drivers)) {\n drivers = [drivers];\n }\n\n var supportedDrivers = this._getSupportedDrivers(drivers);\n\n function setDriverToConfig() {\n self._config.driver = self.driver();\n }\n\n function extendSelfWithDriver(driver) {\n self._extend(driver);\n setDriverToConfig();\n\n self._ready = self._initStorage(self._config);\n return self._ready;\n }\n\n function initDriver(supportedDrivers) {\n return function () {\n var currentDriverIndex = 0;\n\n function driverPromiseLoop() {\n while (currentDriverIndex < supportedDrivers.length) {\n var driverName = supportedDrivers[currentDriverIndex];\n currentDriverIndex++;\n\n self._dbInfo = null;\n self._ready = null;\n\n return self.getDriver(driverName).then(extendSelfWithDriver)[\"catch\"](driverPromiseLoop);\n }\n\n setDriverToConfig();\n var error = new Error('No available storage method found.');\n self._driverSet = Promise$1.reject(error);\n return self._driverSet;\n }\n\n return driverPromiseLoop();\n };\n }\n\n // There might be a driver initialization in progress\n // so wait for it to finish in order to avoid a possible\n // race condition to set _dbInfo\n var oldDriverSetDone = this._driverSet !== null ? this._driverSet[\"catch\"](function () {\n return Promise$1.resolve();\n }) : Promise$1.resolve();\n\n this._driverSet = oldDriverSetDone.then(function () {\n var driverName = supportedDrivers[0];\n self._dbInfo = null;\n self._ready = null;\n\n return self.getDriver(driverName).then(function (driver) {\n self._driver = driver._driver;\n setDriverToConfig();\n self._wrapLibraryMethodsWithReady();\n self._initDriver = initDriver(supportedDrivers);\n });\n })[\"catch\"](function () {\n setDriverToConfig();\n var error = new Error('No available storage method found.');\n self._driverSet = Promise$1.reject(error);\n return self._driverSet;\n });\n\n executeTwoCallbacks(this._driverSet, callback, errorCallback);\n return this._driverSet;\n };\n\n LocalForage.prototype.supports = function supports(driverName) {\n return !!DriverSupport[driverName];\n };\n\n LocalForage.prototype._extend = function _extend(libraryMethodsAndProperties) {\n extend(this, libraryMethodsAndProperties);\n };\n\n LocalForage.prototype._getSupportedDrivers = function _getSupportedDrivers(drivers) {\n var supportedDrivers = [];\n for (var i = 0, len = drivers.length; i < len; i++) {\n var driverName = drivers[i];\n if (this.supports(driverName)) {\n supportedDrivers.push(driverName);\n }\n }\n return supportedDrivers;\n };\n\n LocalForage.prototype._wrapLibraryMethodsWithReady = function _wrapLibraryMethodsWithReady() {\n // Add a stub for each driver API method that delays the call to the\n // corresponding driver method until localForage is ready. These stubs\n // will be replaced by the driver methods as soon as the driver is\n // loaded, so there is no performance impact.\n for (var i = 0, len = LibraryMethods.length; i < len; i++) {\n callWhenReady(this, LibraryMethods[i]);\n }\n };\n\n LocalForage.prototype.createInstance = function createInstance(options) {\n return new LocalForage(options);\n };\n\n return LocalForage;\n}();\n\n// The actual localForage object that we expose as a module or via a\n// global. It's extended by pulling in one of our other libraries.\n\n\nvar localforage_js = new LocalForage();\n\nmodule.exports = localforage_js;\n\n},{\"3\":3}]},{},[4])(4)\n});\n","'use strict';\n\n/**\n * @param typeMap [Object] Map of MIME type -> Array[extensions]\n * @param ...\n */\nfunction Mime() {\n this._types = Object.create(null);\n this._extensions = Object.create(null);\n\n for (let i = 0; i < arguments.length; i++) {\n this.define(arguments[i]);\n }\n\n this.define = this.define.bind(this);\n this.getType = this.getType.bind(this);\n this.getExtension = this.getExtension.bind(this);\n}\n\n/**\n * Define mimetype -> extension mappings. Each key is a mime-type that maps\n * to an array of extensions associated with the type. The first extension is\n * used as the default extension for the type.\n *\n * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});\n *\n * If a type declares an extension that has already been defined, an error will\n * be thrown. To suppress this error and force the extension to be associated\n * with the new type, pass `force`=true. Alternatively, you may prefix the\n * extension with \"*\" to map the type to extension, without mapping the\n * extension to the type.\n *\n * e.g. mime.define({'audio/wav', ['wav']}, {'audio/x-wav', ['*wav']});\n *\n *\n * @param map (Object) type definitions\n * @param force (Boolean) if true, force overriding of existing definitions\n */\nMime.prototype.define = function(typeMap, force) {\n for (let type in typeMap) {\n let extensions = typeMap[type].map(function(t) {\n return t.toLowerCase();\n });\n type = type.toLowerCase();\n\n for (let i = 0; i < extensions.length; i++) {\n const ext = extensions[i];\n\n // '*' prefix = not the preferred type for this extension. So fixup the\n // extension, and skip it.\n if (ext[0] === '*') {\n continue;\n }\n\n if (!force && (ext in this._types)) {\n throw new Error(\n 'Attempt to change mapping for \"' + ext +\n '\" extension from \"' + this._types[ext] + '\" to \"' + type +\n '\". Pass `force=true` to allow this, otherwise remove \"' + ext +\n '\" from the list of extensions for \"' + type + '\".'\n );\n }\n\n this._types[ext] = type;\n }\n\n // Use first extension as default\n if (force || !this._extensions[type]) {\n const ext = extensions[0];\n this._extensions[type] = (ext[0] !== '*') ? ext : ext.substr(1);\n }\n }\n};\n\n/**\n * Lookup a mime type based on extension\n */\nMime.prototype.getType = function(path) {\n path = String(path);\n let last = path.replace(/^.*[/\\\\]/, '').toLowerCase();\n let ext = last.replace(/^.*\\./, '').toLowerCase();\n\n let hasPath = last.length < path.length;\n let hasDot = ext.length < last.length - 1;\n\n return (hasDot || !hasPath) && this._types[ext] || null;\n};\n\n/**\n * Return file extension associated with a mime type\n */\nMime.prototype.getExtension = function(type) {\n type = /^\\s*([^;\\s]*)/.test(type) && RegExp.$1;\n return type && this._extensions[type.toLowerCase()] || null;\n};\n\nmodule.exports = Mime;\n","'use strict';\n\nlet Mime = require('./Mime');\nmodule.exports = new Mime(require('./types/standard'), require('./types/other'));\n","module.exports = {\"application/prs.cww\":[\"cww\"],\"application/vnd.1000minds.decision-model+xml\":[\"1km\"],\"application/vnd.3gpp.pic-bw-large\":[\"plb\"],\"application/vnd.3gpp.pic-bw-small\":[\"psb\"],\"application/vnd.3gpp.pic-bw-var\":[\"pvb\"],\"application/vnd.3gpp2.tcap\":[\"tcap\"],\"application/vnd.3m.post-it-notes\":[\"pwn\"],\"application/vnd.accpac.simply.aso\":[\"aso\"],\"application/vnd.accpac.simply.imp\":[\"imp\"],\"application/vnd.acucobol\":[\"acu\"],\"application/vnd.acucorp\":[\"atc\",\"acutc\"],\"application/vnd.adobe.air-application-installer-package+zip\":[\"air\"],\"application/vnd.adobe.formscentral.fcdt\":[\"fcdt\"],\"application/vnd.adobe.fxp\":[\"fxp\",\"fxpl\"],\"application/vnd.adobe.xdp+xml\":[\"xdp\"],\"application/vnd.adobe.xfdf\":[\"xfdf\"],\"application/vnd.ahead.space\":[\"ahead\"],\"application/vnd.airzip.filesecure.azf\":[\"azf\"],\"application/vnd.airzip.filesecure.azs\":[\"azs\"],\"application/vnd.amazon.ebook\":[\"azw\"],\"application/vnd.americandynamics.acc\":[\"acc\"],\"application/vnd.amiga.ami\":[\"ami\"],\"application/vnd.android.package-archive\":[\"apk\"],\"application/vnd.anser-web-certificate-issue-initiation\":[\"cii\"],\"application/vnd.anser-web-funds-transfer-initiation\":[\"fti\"],\"application/vnd.antix.game-component\":[\"atx\"],\"application/vnd.apple.installer+xml\":[\"mpkg\"],\"application/vnd.apple.keynote\":[\"key\"],\"application/vnd.apple.mpegurl\":[\"m3u8\"],\"application/vnd.apple.numbers\":[\"numbers\"],\"application/vnd.apple.pages\":[\"pages\"],\"application/vnd.apple.pkpass\":[\"pkpass\"],\"application/vnd.aristanetworks.swi\":[\"swi\"],\"application/vnd.astraea-software.iota\":[\"iota\"],\"application/vnd.audiograph\":[\"aep\"],\"application/vnd.balsamiq.bmml+xml\":[\"bmml\"],\"application/vnd.blueice.multipass\":[\"mpm\"],\"application/vnd.bmi\":[\"bmi\"],\"application/vnd.businessobjects\":[\"rep\"],\"application/vnd.chemdraw+xml\":[\"cdxml\"],\"application/vnd.chipnuts.karaoke-mmd\":[\"mmd\"],\"application/vnd.cinderella\":[\"cdy\"],\"application/vnd.citationstyles.style+xml\":[\"csl\"],\"application/vnd.claymore\":[\"cla\"],\"application/vnd.cloanto.rp9\":[\"rp9\"],\"application/vnd.clonk.c4group\":[\"c4g\",\"c4d\",\"c4f\",\"c4p\",\"c4u\"],\"application/vnd.cluetrust.cartomobile-config\":[\"c11amc\"],\"application/vnd.cluetrust.cartomobile-config-pkg\":[\"c11amz\"],\"application/vnd.commonspace\":[\"csp\"],\"application/vnd.contact.cmsg\":[\"cdbcmsg\"],\"application/vnd.cosmocaller\":[\"cmc\"],\"application/vnd.crick.clicker\":[\"clkx\"],\"application/vnd.crick.clicker.keyboard\":[\"clkk\"],\"application/vnd.crick.clicker.palette\":[\"clkp\"],\"application/vnd.crick.clicker.template\":[\"clkt\"],\"application/vnd.crick.clicker.wordbank\":[\"clkw\"],\"application/vnd.criticaltools.wbs+xml\":[\"wbs\"],\"application/vnd.ctc-posml\":[\"pml\"],\"application/vnd.cups-ppd\":[\"ppd\"],\"application/vnd.curl.car\":[\"car\"],\"application/vnd.curl.pcurl\":[\"pcurl\"],\"application/vnd.dart\":[\"dart\"],\"application/vnd.data-vision.rdz\":[\"rdz\"],\"application/vnd.dbf\":[\"dbf\"],\"application/vnd.dece.data\":[\"uvf\",\"uvvf\",\"uvd\",\"uvvd\"],\"application/vnd.dece.ttml+xml\":[\"uvt\",\"uvvt\"],\"application/vnd.dece.unspecified\":[\"uvx\",\"uvvx\"],\"application/vnd.dece.zip\":[\"uvz\",\"uvvz\"],\"application/vnd.denovo.fcselayout-link\":[\"fe_launch\"],\"application/vnd.dna\":[\"dna\"],\"application/vnd.dolby.mlp\":[\"mlp\"],\"application/vnd.dpgraph\":[\"dpg\"],\"application/vnd.dreamfactory\":[\"dfac\"],\"application/vnd.ds-keypoint\":[\"kpxx\"],\"application/vnd.dvb.ait\":[\"ait\"],\"application/vnd.dvb.service\":[\"svc\"],\"application/vnd.dynageo\":[\"geo\"],\"application/vnd.ecowin.chart\":[\"mag\"],\"application/vnd.enliven\":[\"nml\"],\"application/vnd.epson.esf\":[\"esf\"],\"application/vnd.epson.msf\":[\"msf\"],\"application/vnd.epson.quickanime\":[\"qam\"],\"application/vnd.epson.salt\":[\"slt\"],\"application/vnd.epson.ssf\":[\"ssf\"],\"application/vnd.eszigno3+xml\":[\"es3\",\"et3\"],\"application/vnd.ezpix-album\":[\"ez2\"],\"application/vnd.ezpix-package\":[\"ez3\"],\"application/vnd.fdf\":[\"fdf\"],\"application/vnd.fdsn.mseed\":[\"mseed\"],\"application/vnd.fdsn.seed\":[\"seed\",\"dataless\"],\"application/vnd.flographit\":[\"gph\"],\"application/vnd.fluxtime.clip\":[\"ftc\"],\"application/vnd.framemaker\":[\"fm\",\"frame\",\"maker\",\"book\"],\"application/vnd.frogans.fnc\":[\"fnc\"],\"application/vnd.frogans.ltf\":[\"ltf\"],\"application/vnd.fsc.weblaunch\":[\"fsc\"],\"application/vnd.fujitsu.oasys\":[\"oas\"],\"application/vnd.fujitsu.oasys2\":[\"oa2\"],\"application/vnd.fujitsu.oasys3\":[\"oa3\"],\"application/vnd.fujitsu.oasysgp\":[\"fg5\"],\"application/vnd.fujitsu.oasysprs\":[\"bh2\"],\"application/vnd.fujixerox.ddd\":[\"ddd\"],\"application/vnd.fujixerox.docuworks\":[\"xdw\"],\"application/vnd.fujixerox.docuworks.binder\":[\"xbd\"],\"application/vnd.fuzzysheet\":[\"fzs\"],\"application/vnd.genomatix.tuxedo\":[\"txd\"],\"application/vnd.geogebra.file\":[\"ggb\"],\"application/vnd.geogebra.tool\":[\"ggt\"],\"application/vnd.geometry-explorer\":[\"gex\",\"gre\"],\"application/vnd.geonext\":[\"gxt\"],\"application/vnd.geoplan\":[\"g2w\"],\"application/vnd.geospace\":[\"g3w\"],\"application/vnd.gmx\":[\"gmx\"],\"application/vnd.google-apps.document\":[\"gdoc\"],\"application/vnd.google-apps.presentation\":[\"gslides\"],\"application/vnd.google-apps.spreadsheet\":[\"gsheet\"],\"application/vnd.google-earth.kml+xml\":[\"kml\"],\"application/vnd.google-earth.kmz\":[\"kmz\"],\"application/vnd.grafeq\":[\"gqf\",\"gqs\"],\"application/vnd.groove-account\":[\"gac\"],\"application/vnd.groove-help\":[\"ghf\"],\"application/vnd.groove-identity-message\":[\"gim\"],\"application/vnd.groove-injector\":[\"grv\"],\"application/vnd.groove-tool-message\":[\"gtm\"],\"application/vnd.groove-tool-template\":[\"tpl\"],\"application/vnd.groove-vcard\":[\"vcg\"],\"application/vnd.hal+xml\":[\"hal\"],\"application/vnd.handheld-entertainment+xml\":[\"zmm\"],\"application/vnd.hbci\":[\"hbci\"],\"application/vnd.hhe.lesson-player\":[\"les\"],\"application/vnd.hp-hpgl\":[\"hpgl\"],\"application/vnd.hp-hpid\":[\"hpid\"],\"application/vnd.hp-hps\":[\"hps\"],\"application/vnd.hp-jlyt\":[\"jlt\"],\"application/vnd.hp-pcl\":[\"pcl\"],\"application/vnd.hp-pclxl\":[\"pclxl\"],\"application/vnd.hydrostatix.sof-data\":[\"sfd-hdstx\"],\"application/vnd.ibm.minipay\":[\"mpy\"],\"application/vnd.ibm.modcap\":[\"afp\",\"listafp\",\"list3820\"],\"application/vnd.ibm.rights-management\":[\"irm\"],\"application/vnd.ibm.secure-container\":[\"sc\"],\"application/vnd.iccprofile\":[\"icc\",\"icm\"],\"application/vnd.igloader\":[\"igl\"],\"application/vnd.immervision-ivp\":[\"ivp\"],\"application/vnd.immervision-ivu\":[\"ivu\"],\"application/vnd.insors.igm\":[\"igm\"],\"application/vnd.intercon.formnet\":[\"xpw\",\"xpx\"],\"application/vnd.intergeo\":[\"i2g\"],\"application/vnd.intu.qbo\":[\"qbo\"],\"application/vnd.intu.qfx\":[\"qfx\"],\"application/vnd.ipunplugged.rcprofile\":[\"rcprofile\"],\"application/vnd.irepository.package+xml\":[\"irp\"],\"application/vnd.is-xpr\":[\"xpr\"],\"application/vnd.isac.fcs\":[\"fcs\"],\"application/vnd.jam\":[\"jam\"],\"application/vnd.jcp.javame.midlet-rms\":[\"rms\"],\"application/vnd.jisp\":[\"jisp\"],\"application/vnd.joost.joda-archive\":[\"joda\"],\"application/vnd.kahootz\":[\"ktz\",\"ktr\"],\"application/vnd.kde.karbon\":[\"karbon\"],\"application/vnd.kde.kchart\":[\"chrt\"],\"application/vnd.kde.kformula\":[\"kfo\"],\"application/vnd.kde.kivio\":[\"flw\"],\"application/vnd.kde.kontour\":[\"kon\"],\"application/vnd.kde.kpresenter\":[\"kpr\",\"kpt\"],\"application/vnd.kde.kspread\":[\"ksp\"],\"application/vnd.kde.kword\":[\"kwd\",\"kwt\"],\"application/vnd.kenameaapp\":[\"htke\"],\"application/vnd.kidspiration\":[\"kia\"],\"application/vnd.kinar\":[\"kne\",\"knp\"],\"application/vnd.koan\":[\"skp\",\"skd\",\"skt\",\"skm\"],\"application/vnd.kodak-descriptor\":[\"sse\"],\"application/vnd.las.las+xml\":[\"lasxml\"],\"application/vnd.llamagraphics.life-balance.desktop\":[\"lbd\"],\"application/vnd.llamagraphics.life-balance.exchange+xml\":[\"lbe\"],\"application/vnd.lotus-1-2-3\":[\"123\"],\"application/vnd.lotus-approach\":[\"apr\"],\"application/vnd.lotus-freelance\":[\"pre\"],\"application/vnd.lotus-notes\":[\"nsf\"],\"application/vnd.lotus-organizer\":[\"org\"],\"application/vnd.lotus-screencam\":[\"scm\"],\"application/vnd.lotus-wordpro\":[\"lwp\"],\"application/vnd.macports.portpkg\":[\"portpkg\"],\"application/vnd.mapbox-vector-tile\":[\"mvt\"],\"application/vnd.mcd\":[\"mcd\"],\"application/vnd.medcalcdata\":[\"mc1\"],\"application/vnd.mediastation.cdkey\":[\"cdkey\"],\"application/vnd.mfer\":[\"mwf\"],\"application/vnd.mfmp\":[\"mfm\"],\"application/vnd.micrografx.flo\":[\"flo\"],\"application/vnd.micrografx.igx\":[\"igx\"],\"application/vnd.mif\":[\"mif\"],\"application/vnd.mobius.daf\":[\"daf\"],\"application/vnd.mobius.dis\":[\"dis\"],\"application/vnd.mobius.mbk\":[\"mbk\"],\"application/vnd.mobius.mqy\":[\"mqy\"],\"application/vnd.mobius.msl\":[\"msl\"],\"application/vnd.mobius.plc\":[\"plc\"],\"application/vnd.mobius.txf\":[\"txf\"],\"application/vnd.mophun.application\":[\"mpn\"],\"application/vnd.mophun.certificate\":[\"mpc\"],\"application/vnd.mozilla.xul+xml\":[\"xul\"],\"application/vnd.ms-artgalry\":[\"cil\"],\"application/vnd.ms-cab-compressed\":[\"cab\"],\"application/vnd.ms-excel\":[\"xls\",\"xlm\",\"xla\",\"xlc\",\"xlt\",\"xlw\"],\"application/vnd.ms-excel.addin.macroenabled.12\":[\"xlam\"],\"application/vnd.ms-excel.sheet.binary.macroenabled.12\":[\"xlsb\"],\"application/vnd.ms-excel.sheet.macroenabled.12\":[\"xlsm\"],\"application/vnd.ms-excel.template.macroenabled.12\":[\"xltm\"],\"application/vnd.ms-fontobject\":[\"eot\"],\"application/vnd.ms-htmlhelp\":[\"chm\"],\"application/vnd.ms-ims\":[\"ims\"],\"application/vnd.ms-lrm\":[\"lrm\"],\"application/vnd.ms-officetheme\":[\"thmx\"],\"application/vnd.ms-outlook\":[\"msg\"],\"application/vnd.ms-pki.seccat\":[\"cat\"],\"application/vnd.ms-pki.stl\":[\"*stl\"],\"application/vnd.ms-powerpoint\":[\"ppt\",\"pps\",\"pot\"],\"application/vnd.ms-powerpoint.addin.macroenabled.12\":[\"ppam\"],\"application/vnd.ms-powerpoint.presentation.macroenabled.12\":[\"pptm\"],\"application/vnd.ms-powerpoint.slide.macroenabled.12\":[\"sldm\"],\"application/vnd.ms-powerpoint.slideshow.macroenabled.12\":[\"ppsm\"],\"application/vnd.ms-powerpoint.template.macroenabled.12\":[\"potm\"],\"application/vnd.ms-project\":[\"mpp\",\"mpt\"],\"application/vnd.ms-word.document.macroenabled.12\":[\"docm\"],\"application/vnd.ms-word.template.macroenabled.12\":[\"dotm\"],\"application/vnd.ms-works\":[\"wps\",\"wks\",\"wcm\",\"wdb\"],\"application/vnd.ms-wpl\":[\"wpl\"],\"application/vnd.ms-xpsdocument\":[\"xps\"],\"application/vnd.mseq\":[\"mseq\"],\"application/vnd.musician\":[\"mus\"],\"application/vnd.muvee.style\":[\"msty\"],\"application/vnd.mynfc\":[\"taglet\"],\"application/vnd.neurolanguage.nlu\":[\"nlu\"],\"application/vnd.nitf\":[\"ntf\",\"nitf\"],\"application/vnd.noblenet-directory\":[\"nnd\"],\"application/vnd.noblenet-sealer\":[\"nns\"],\"application/vnd.noblenet-web\":[\"nnw\"],\"application/vnd.nokia.n-gage.ac+xml\":[\"*ac\"],\"application/vnd.nokia.n-gage.data\":[\"ngdat\"],\"application/vnd.nokia.n-gage.symbian.install\":[\"n-gage\"],\"application/vnd.nokia.radio-preset\":[\"rpst\"],\"application/vnd.nokia.radio-presets\":[\"rpss\"],\"application/vnd.novadigm.edm\":[\"edm\"],\"application/vnd.novadigm.edx\":[\"edx\"],\"application/vnd.novadigm.ext\":[\"ext\"],\"application/vnd.oasis.opendocument.chart\":[\"odc\"],\"application/vnd.oasis.opendocument.chart-template\":[\"otc\"],\"application/vnd.oasis.opendocument.database\":[\"odb\"],\"application/vnd.oasis.opendocument.formula\":[\"odf\"],\"application/vnd.oasis.opendocument.formula-template\":[\"odft\"],\"application/vnd.oasis.opendocument.graphics\":[\"odg\"],\"application/vnd.oasis.opendocument.graphics-template\":[\"otg\"],\"application/vnd.oasis.opendocument.image\":[\"odi\"],\"application/vnd.oasis.opendocument.image-template\":[\"oti\"],\"application/vnd.oasis.opendocument.presentation\":[\"odp\"],\"application/vnd.oasis.opendocument.presentation-template\":[\"otp\"],\"application/vnd.oasis.opendocument.spreadsheet\":[\"ods\"],\"application/vnd.oasis.opendocument.spreadsheet-template\":[\"ots\"],\"application/vnd.oasis.opendocument.text\":[\"odt\"],\"application/vnd.oasis.opendocument.text-master\":[\"odm\"],\"application/vnd.oasis.opendocument.text-template\":[\"ott\"],\"application/vnd.oasis.opendocument.text-web\":[\"oth\"],\"application/vnd.olpc-sugar\":[\"xo\"],\"application/vnd.oma.dd2+xml\":[\"dd2\"],\"application/vnd.openblox.game+xml\":[\"obgx\"],\"application/vnd.openofficeorg.extension\":[\"oxt\"],\"application/vnd.openstreetmap.data+xml\":[\"osm\"],\"application/vnd.openxmlformats-officedocument.presentationml.presentation\":[\"pptx\"],\"application/vnd.openxmlformats-officedocument.presentationml.slide\":[\"sldx\"],\"application/vnd.openxmlformats-officedocument.presentationml.slideshow\":[\"ppsx\"],\"application/vnd.openxmlformats-officedocument.presentationml.template\":[\"potx\"],\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\":[\"xlsx\"],\"application/vnd.openxmlformats-officedocument.spreadsheetml.template\":[\"xltx\"],\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":[\"docx\"],\"application/vnd.openxmlformats-officedocument.wordprocessingml.template\":[\"dotx\"],\"application/vnd.osgeo.mapguide.package\":[\"mgp\"],\"application/vnd.osgi.dp\":[\"dp\"],\"application/vnd.osgi.subsystem\":[\"esa\"],\"application/vnd.palm\":[\"pdb\",\"pqa\",\"oprc\"],\"application/vnd.pawaafile\":[\"paw\"],\"application/vnd.pg.format\":[\"str\"],\"application/vnd.pg.osasli\":[\"ei6\"],\"application/vnd.picsel\":[\"efif\"],\"application/vnd.pmi.widget\":[\"wg\"],\"application/vnd.pocketlearn\":[\"plf\"],\"application/vnd.powerbuilder6\":[\"pbd\"],\"application/vnd.previewsystems.box\":[\"box\"],\"application/vnd.proteus.magazine\":[\"mgz\"],\"application/vnd.publishare-delta-tree\":[\"qps\"],\"application/vnd.pvi.ptid1\":[\"ptid\"],\"application/vnd.quark.quarkxpress\":[\"qxd\",\"qxt\",\"qwd\",\"qwt\",\"qxl\",\"qxb\"],\"application/vnd.rar\":[\"rar\"],\"application/vnd.realvnc.bed\":[\"bed\"],\"application/vnd.recordare.musicxml\":[\"mxl\"],\"application/vnd.recordare.musicxml+xml\":[\"musicxml\"],\"application/vnd.rig.cryptonote\":[\"cryptonote\"],\"application/vnd.rim.cod\":[\"cod\"],\"application/vnd.rn-realmedia\":[\"rm\"],\"application/vnd.rn-realmedia-vbr\":[\"rmvb\"],\"application/vnd.route66.link66+xml\":[\"link66\"],\"application/vnd.sailingtracker.track\":[\"st\"],\"application/vnd.seemail\":[\"see\"],\"application/vnd.sema\":[\"sema\"],\"application/vnd.semd\":[\"semd\"],\"application/vnd.semf\":[\"semf\"],\"application/vnd.shana.informed.formdata\":[\"ifm\"],\"application/vnd.shana.informed.formtemplate\":[\"itp\"],\"application/vnd.shana.informed.interchange\":[\"iif\"],\"application/vnd.shana.informed.package\":[\"ipk\"],\"application/vnd.simtech-mindmapper\":[\"twd\",\"twds\"],\"application/vnd.smaf\":[\"mmf\"],\"application/vnd.smart.teacher\":[\"teacher\"],\"application/vnd.software602.filler.form+xml\":[\"fo\"],\"application/vnd.solent.sdkm+xml\":[\"sdkm\",\"sdkd\"],\"application/vnd.spotfire.dxp\":[\"dxp\"],\"application/vnd.spotfire.sfs\":[\"sfs\"],\"application/vnd.stardivision.calc\":[\"sdc\"],\"application/vnd.stardivision.draw\":[\"sda\"],\"application/vnd.stardivision.impress\":[\"sdd\"],\"application/vnd.stardivision.math\":[\"smf\"],\"application/vnd.stardivision.writer\":[\"sdw\",\"vor\"],\"application/vnd.stardivision.writer-global\":[\"sgl\"],\"application/vnd.stepmania.package\":[\"smzip\"],\"application/vnd.stepmania.stepchart\":[\"sm\"],\"application/vnd.sun.wadl+xml\":[\"wadl\"],\"application/vnd.sun.xml.calc\":[\"sxc\"],\"application/vnd.sun.xml.calc.template\":[\"stc\"],\"application/vnd.sun.xml.draw\":[\"sxd\"],\"application/vnd.sun.xml.draw.template\":[\"std\"],\"application/vnd.sun.xml.impress\":[\"sxi\"],\"application/vnd.sun.xml.impress.template\":[\"sti\"],\"application/vnd.sun.xml.math\":[\"sxm\"],\"application/vnd.sun.xml.writer\":[\"sxw\"],\"application/vnd.sun.xml.writer.global\":[\"sxg\"],\"application/vnd.sun.xml.writer.template\":[\"stw\"],\"application/vnd.sus-calendar\":[\"sus\",\"susp\"],\"application/vnd.svd\":[\"svd\"],\"application/vnd.symbian.install\":[\"sis\",\"sisx\"],\"application/vnd.syncml+xml\":[\"xsm\"],\"application/vnd.syncml.dm+wbxml\":[\"bdm\"],\"application/vnd.syncml.dm+xml\":[\"xdm\"],\"application/vnd.syncml.dmddf+xml\":[\"ddf\"],\"application/vnd.tao.intent-module-archive\":[\"tao\"],\"application/vnd.tcpdump.pcap\":[\"pcap\",\"cap\",\"dmp\"],\"application/vnd.tmobile-livetv\":[\"tmo\"],\"application/vnd.trid.tpt\":[\"tpt\"],\"application/vnd.triscape.mxs\":[\"mxs\"],\"application/vnd.trueapp\":[\"tra\"],\"application/vnd.ufdl\":[\"ufd\",\"ufdl\"],\"application/vnd.uiq.theme\":[\"utz\"],\"application/vnd.umajin\":[\"umj\"],\"application/vnd.unity\":[\"unityweb\"],\"application/vnd.uoml+xml\":[\"uoml\"],\"application/vnd.vcx\":[\"vcx\"],\"application/vnd.visio\":[\"vsd\",\"vst\",\"vss\",\"vsw\"],\"application/vnd.visionary\":[\"vis\"],\"application/vnd.vsf\":[\"vsf\"],\"application/vnd.wap.wbxml\":[\"wbxml\"],\"application/vnd.wap.wmlc\":[\"wmlc\"],\"application/vnd.wap.wmlscriptc\":[\"wmlsc\"],\"application/vnd.webturbo\":[\"wtb\"],\"application/vnd.wolfram.player\":[\"nbp\"],\"application/vnd.wordperfect\":[\"wpd\"],\"application/vnd.wqd\":[\"wqd\"],\"application/vnd.wt.stf\":[\"stf\"],\"application/vnd.xara\":[\"xar\"],\"application/vnd.xfdl\":[\"xfdl\"],\"application/vnd.yamaha.hv-dic\":[\"hvd\"],\"application/vnd.yamaha.hv-script\":[\"hvs\"],\"application/vnd.yamaha.hv-voice\":[\"hvp\"],\"application/vnd.yamaha.openscoreformat\":[\"osf\"],\"application/vnd.yamaha.openscoreformat.osfpvg+xml\":[\"osfpvg\"],\"application/vnd.yamaha.smaf-audio\":[\"saf\"],\"application/vnd.yamaha.smaf-phrase\":[\"spf\"],\"application/vnd.yellowriver-custom-menu\":[\"cmp\"],\"application/vnd.zul\":[\"zir\",\"zirz\"],\"application/vnd.zzazz.deck+xml\":[\"zaz\"],\"application/x-7z-compressed\":[\"7z\"],\"application/x-abiword\":[\"abw\"],\"application/x-ace-compressed\":[\"ace\"],\"application/x-apple-diskimage\":[\"*dmg\"],\"application/x-arj\":[\"arj\"],\"application/x-authorware-bin\":[\"aab\",\"x32\",\"u32\",\"vox\"],\"application/x-authorware-map\":[\"aam\"],\"application/x-authorware-seg\":[\"aas\"],\"application/x-bcpio\":[\"bcpio\"],\"application/x-bdoc\":[\"*bdoc\"],\"application/x-bittorrent\":[\"torrent\"],\"application/x-blorb\":[\"blb\",\"blorb\"],\"application/x-bzip\":[\"bz\"],\"application/x-bzip2\":[\"bz2\",\"boz\"],\"application/x-cbr\":[\"cbr\",\"cba\",\"cbt\",\"cbz\",\"cb7\"],\"application/x-cdlink\":[\"vcd\"],\"application/x-cfs-compressed\":[\"cfs\"],\"application/x-chat\":[\"chat\"],\"application/x-chess-pgn\":[\"pgn\"],\"application/x-chrome-extension\":[\"crx\"],\"application/x-cocoa\":[\"cco\"],\"application/x-conference\":[\"nsc\"],\"application/x-cpio\":[\"cpio\"],\"application/x-csh\":[\"csh\"],\"application/x-debian-package\":[\"*deb\",\"udeb\"],\"application/x-dgc-compressed\":[\"dgc\"],\"application/x-director\":[\"dir\",\"dcr\",\"dxr\",\"cst\",\"cct\",\"cxt\",\"w3d\",\"fgd\",\"swa\"],\"application/x-doom\":[\"wad\"],\"application/x-dtbncx+xml\":[\"ncx\"],\"application/x-dtbook+xml\":[\"dtb\"],\"application/x-dtbresource+xml\":[\"res\"],\"application/x-dvi\":[\"dvi\"],\"application/x-envoy\":[\"evy\"],\"application/x-eva\":[\"eva\"],\"application/x-font-bdf\":[\"bdf\"],\"application/x-font-ghostscript\":[\"gsf\"],\"application/x-font-linux-psf\":[\"psf\"],\"application/x-font-pcf\":[\"pcf\"],\"application/x-font-snf\":[\"snf\"],\"application/x-font-type1\":[\"pfa\",\"pfb\",\"pfm\",\"afm\"],\"application/x-freearc\":[\"arc\"],\"application/x-futuresplash\":[\"spl\"],\"application/x-gca-compressed\":[\"gca\"],\"application/x-glulx\":[\"ulx\"],\"application/x-gnumeric\":[\"gnumeric\"],\"application/x-gramps-xml\":[\"gramps\"],\"application/x-gtar\":[\"gtar\"],\"application/x-hdf\":[\"hdf\"],\"application/x-httpd-php\":[\"php\"],\"application/x-install-instructions\":[\"install\"],\"application/x-iso9660-image\":[\"*iso\"],\"application/x-iwork-keynote-sffkey\":[\"*key\"],\"application/x-iwork-numbers-sffnumbers\":[\"*numbers\"],\"application/x-iwork-pages-sffpages\":[\"*pages\"],\"application/x-java-archive-diff\":[\"jardiff\"],\"application/x-java-jnlp-file\":[\"jnlp\"],\"application/x-keepass2\":[\"kdbx\"],\"application/x-latex\":[\"latex\"],\"application/x-lua-bytecode\":[\"luac\"],\"application/x-lzh-compressed\":[\"lzh\",\"lha\"],\"application/x-makeself\":[\"run\"],\"application/x-mie\":[\"mie\"],\"application/x-mobipocket-ebook\":[\"prc\",\"mobi\"],\"application/x-ms-application\":[\"application\"],\"application/x-ms-shortcut\":[\"lnk\"],\"application/x-ms-wmd\":[\"wmd\"],\"application/x-ms-wmz\":[\"wmz\"],\"application/x-ms-xbap\":[\"xbap\"],\"application/x-msaccess\":[\"mdb\"],\"application/x-msbinder\":[\"obd\"],\"application/x-mscardfile\":[\"crd\"],\"application/x-msclip\":[\"clp\"],\"application/x-msdos-program\":[\"*exe\"],\"application/x-msdownload\":[\"*exe\",\"*dll\",\"com\",\"bat\",\"*msi\"],\"application/x-msmediaview\":[\"mvb\",\"m13\",\"m14\"],\"application/x-msmetafile\":[\"*wmf\",\"*wmz\",\"*emf\",\"emz\"],\"application/x-msmoney\":[\"mny\"],\"application/x-mspublisher\":[\"pub\"],\"application/x-msschedule\":[\"scd\"],\"application/x-msterminal\":[\"trm\"],\"application/x-mswrite\":[\"wri\"],\"application/x-netcdf\":[\"nc\",\"cdf\"],\"application/x-ns-proxy-autoconfig\":[\"pac\"],\"application/x-nzb\":[\"nzb\"],\"application/x-perl\":[\"pl\",\"pm\"],\"application/x-pilot\":[\"*prc\",\"*pdb\"],\"application/x-pkcs12\":[\"p12\",\"pfx\"],\"application/x-pkcs7-certificates\":[\"p7b\",\"spc\"],\"application/x-pkcs7-certreqresp\":[\"p7r\"],\"application/x-rar-compressed\":[\"*rar\"],\"application/x-redhat-package-manager\":[\"rpm\"],\"application/x-research-info-systems\":[\"ris\"],\"application/x-sea\":[\"sea\"],\"application/x-sh\":[\"sh\"],\"application/x-shar\":[\"shar\"],\"application/x-shockwave-flash\":[\"swf\"],\"application/x-silverlight-app\":[\"xap\"],\"application/x-sql\":[\"sql\"],\"application/x-stuffit\":[\"sit\"],\"application/x-stuffitx\":[\"sitx\"],\"application/x-subrip\":[\"srt\"],\"application/x-sv4cpio\":[\"sv4cpio\"],\"application/x-sv4crc\":[\"sv4crc\"],\"application/x-t3vm-image\":[\"t3\"],\"application/x-tads\":[\"gam\"],\"application/x-tar\":[\"tar\"],\"application/x-tcl\":[\"tcl\",\"tk\"],\"application/x-tex\":[\"tex\"],\"application/x-tex-tfm\":[\"tfm\"],\"application/x-texinfo\":[\"texinfo\",\"texi\"],\"application/x-tgif\":[\"*obj\"],\"application/x-ustar\":[\"ustar\"],\"application/x-virtualbox-hdd\":[\"hdd\"],\"application/x-virtualbox-ova\":[\"ova\"],\"application/x-virtualbox-ovf\":[\"ovf\"],\"application/x-virtualbox-vbox\":[\"vbox\"],\"application/x-virtualbox-vbox-extpack\":[\"vbox-extpack\"],\"application/x-virtualbox-vdi\":[\"vdi\"],\"application/x-virtualbox-vhd\":[\"vhd\"],\"application/x-virtualbox-vmdk\":[\"vmdk\"],\"application/x-wais-source\":[\"src\"],\"application/x-web-app-manifest+json\":[\"webapp\"],\"application/x-x509-ca-cert\":[\"der\",\"crt\",\"pem\"],\"application/x-xfig\":[\"fig\"],\"application/x-xliff+xml\":[\"*xlf\"],\"application/x-xpinstall\":[\"xpi\"],\"application/x-xz\":[\"xz\"],\"application/x-zmachine\":[\"z1\",\"z2\",\"z3\",\"z4\",\"z5\",\"z6\",\"z7\",\"z8\"],\"audio/vnd.dece.audio\":[\"uva\",\"uvva\"],\"audio/vnd.digital-winds\":[\"eol\"],\"audio/vnd.dra\":[\"dra\"],\"audio/vnd.dts\":[\"dts\"],\"audio/vnd.dts.hd\":[\"dtshd\"],\"audio/vnd.lucent.voice\":[\"lvp\"],\"audio/vnd.ms-playready.media.pya\":[\"pya\"],\"audio/vnd.nuera.ecelp4800\":[\"ecelp4800\"],\"audio/vnd.nuera.ecelp7470\":[\"ecelp7470\"],\"audio/vnd.nuera.ecelp9600\":[\"ecelp9600\"],\"audio/vnd.rip\":[\"rip\"],\"audio/x-aac\":[\"aac\"],\"audio/x-aiff\":[\"aif\",\"aiff\",\"aifc\"],\"audio/x-caf\":[\"caf\"],\"audio/x-flac\":[\"flac\"],\"audio/x-m4a\":[\"*m4a\"],\"audio/x-matroska\":[\"mka\"],\"audio/x-mpegurl\":[\"m3u\"],\"audio/x-ms-wax\":[\"wax\"],\"audio/x-ms-wma\":[\"wma\"],\"audio/x-pn-realaudio\":[\"ram\",\"ra\"],\"audio/x-pn-realaudio-plugin\":[\"rmp\"],\"audio/x-realaudio\":[\"*ra\"],\"audio/x-wav\":[\"*wav\"],\"chemical/x-cdx\":[\"cdx\"],\"chemical/x-cif\":[\"cif\"],\"chemical/x-cmdf\":[\"cmdf\"],\"chemical/x-cml\":[\"cml\"],\"chemical/x-csml\":[\"csml\"],\"chemical/x-xyz\":[\"xyz\"],\"image/prs.btif\":[\"btif\"],\"image/prs.pti\":[\"pti\"],\"image/vnd.adobe.photoshop\":[\"psd\"],\"image/vnd.airzip.accelerator.azv\":[\"azv\"],\"image/vnd.dece.graphic\":[\"uvi\",\"uvvi\",\"uvg\",\"uvvg\"],\"image/vnd.djvu\":[\"djvu\",\"djv\"],\"image/vnd.dvb.subtitle\":[\"*sub\"],\"image/vnd.dwg\":[\"dwg\"],\"image/vnd.dxf\":[\"dxf\"],\"image/vnd.fastbidsheet\":[\"fbs\"],\"image/vnd.fpx\":[\"fpx\"],\"image/vnd.fst\":[\"fst\"],\"image/vnd.fujixerox.edmics-mmr\":[\"mmr\"],\"image/vnd.fujixerox.edmics-rlc\":[\"rlc\"],\"image/vnd.microsoft.icon\":[\"ico\"],\"image/vnd.ms-dds\":[\"dds\"],\"image/vnd.ms-modi\":[\"mdi\"],\"image/vnd.ms-photo\":[\"wdp\"],\"image/vnd.net-fpx\":[\"npx\"],\"image/vnd.pco.b16\":[\"b16\"],\"image/vnd.tencent.tap\":[\"tap\"],\"image/vnd.valve.source.texture\":[\"vtf\"],\"image/vnd.wap.wbmp\":[\"wbmp\"],\"image/vnd.xiff\":[\"xif\"],\"image/vnd.zbrush.pcx\":[\"pcx\"],\"image/x-3ds\":[\"3ds\"],\"image/x-cmu-raster\":[\"ras\"],\"image/x-cmx\":[\"cmx\"],\"image/x-freehand\":[\"fh\",\"fhc\",\"fh4\",\"fh5\",\"fh7\"],\"image/x-icon\":[\"*ico\"],\"image/x-jng\":[\"jng\"],\"image/x-mrsid-image\":[\"sid\"],\"image/x-ms-bmp\":[\"*bmp\"],\"image/x-pcx\":[\"*pcx\"],\"image/x-pict\":[\"pic\",\"pct\"],\"image/x-portable-anymap\":[\"pnm\"],\"image/x-portable-bitmap\":[\"pbm\"],\"image/x-portable-graymap\":[\"pgm\"],\"image/x-portable-pixmap\":[\"ppm\"],\"image/x-rgb\":[\"rgb\"],\"image/x-tga\":[\"tga\"],\"image/x-xbitmap\":[\"xbm\"],\"image/x-xpixmap\":[\"xpm\"],\"image/x-xwindowdump\":[\"xwd\"],\"message/vnd.wfa.wsc\":[\"wsc\"],\"model/vnd.collada+xml\":[\"dae\"],\"model/vnd.dwf\":[\"dwf\"],\"model/vnd.gdl\":[\"gdl\"],\"model/vnd.gtw\":[\"gtw\"],\"model/vnd.mts\":[\"mts\"],\"model/vnd.opengex\":[\"ogex\"],\"model/vnd.parasolid.transmit.binary\":[\"x_b\"],\"model/vnd.parasolid.transmit.text\":[\"x_t\"],\"model/vnd.sap.vds\":[\"vds\"],\"model/vnd.usdz+zip\":[\"usdz\"],\"model/vnd.valve.source.compiled-map\":[\"bsp\"],\"model/vnd.vtu\":[\"vtu\"],\"text/prs.lines.tag\":[\"dsc\"],\"text/vnd.curl\":[\"curl\"],\"text/vnd.curl.dcurl\":[\"dcurl\"],\"text/vnd.curl.mcurl\":[\"mcurl\"],\"text/vnd.curl.scurl\":[\"scurl\"],\"text/vnd.dvb.subtitle\":[\"sub\"],\"text/vnd.fly\":[\"fly\"],\"text/vnd.fmi.flexstor\":[\"flx\"],\"text/vnd.graphviz\":[\"gv\"],\"text/vnd.in3d.3dml\":[\"3dml\"],\"text/vnd.in3d.spot\":[\"spot\"],\"text/vnd.sun.j2me.app-descriptor\":[\"jad\"],\"text/vnd.wap.wml\":[\"wml\"],\"text/vnd.wap.wmlscript\":[\"wmls\"],\"text/x-asm\":[\"s\",\"asm\"],\"text/x-c\":[\"c\",\"cc\",\"cxx\",\"cpp\",\"h\",\"hh\",\"dic\"],\"text/x-component\":[\"htc\"],\"text/x-fortran\":[\"f\",\"for\",\"f77\",\"f90\"],\"text/x-handlebars-template\":[\"hbs\"],\"text/x-java-source\":[\"java\"],\"text/x-lua\":[\"lua\"],\"text/x-markdown\":[\"mkd\"],\"text/x-nfo\":[\"nfo\"],\"text/x-opml\":[\"opml\"],\"text/x-org\":[\"*org\"],\"text/x-pascal\":[\"p\",\"pas\"],\"text/x-processing\":[\"pde\"],\"text/x-sass\":[\"sass\"],\"text/x-scss\":[\"scss\"],\"text/x-setext\":[\"etx\"],\"text/x-sfv\":[\"sfv\"],\"text/x-suse-ymp\":[\"ymp\"],\"text/x-uuencode\":[\"uu\"],\"text/x-vcalendar\":[\"vcs\"],\"text/x-vcard\":[\"vcf\"],\"video/vnd.dece.hd\":[\"uvh\",\"uvvh\"],\"video/vnd.dece.mobile\":[\"uvm\",\"uvvm\"],\"video/vnd.dece.pd\":[\"uvp\",\"uvvp\"],\"video/vnd.dece.sd\":[\"uvs\",\"uvvs\"],\"video/vnd.dece.video\":[\"uvv\",\"uvvv\"],\"video/vnd.dvb.file\":[\"dvb\"],\"video/vnd.fvt\":[\"fvt\"],\"video/vnd.mpegurl\":[\"mxu\",\"m4u\"],\"video/vnd.ms-playready.media.pyv\":[\"pyv\"],\"video/vnd.uvvu.mp4\":[\"uvu\",\"uvvu\"],\"video/vnd.vivo\":[\"viv\"],\"video/x-f4v\":[\"f4v\"],\"video/x-fli\":[\"fli\"],\"video/x-flv\":[\"flv\"],\"video/x-m4v\":[\"m4v\"],\"video/x-matroska\":[\"mkv\",\"mk3d\",\"mks\"],\"video/x-mng\":[\"mng\"],\"video/x-ms-asf\":[\"asf\",\"asx\"],\"video/x-ms-vob\":[\"vob\"],\"video/x-ms-wm\":[\"wm\"],\"video/x-ms-wmv\":[\"wmv\"],\"video/x-ms-wmx\":[\"wmx\"],\"video/x-ms-wvx\":[\"wvx\"],\"video/x-msvideo\":[\"avi\"],\"video/x-sgi-movie\":[\"movie\"],\"video/x-smv\":[\"smv\"],\"x-conference/x-cooltalk\":[\"ice\"]};","module.exports = {\"application/andrew-inset\":[\"ez\"],\"application/applixware\":[\"aw\"],\"application/atom+xml\":[\"atom\"],\"application/atomcat+xml\":[\"atomcat\"],\"application/atomdeleted+xml\":[\"atomdeleted\"],\"application/atomsvc+xml\":[\"atomsvc\"],\"application/atsc-dwd+xml\":[\"dwd\"],\"application/atsc-held+xml\":[\"held\"],\"application/atsc-rsat+xml\":[\"rsat\"],\"application/bdoc\":[\"bdoc\"],\"application/calendar+xml\":[\"xcs\"],\"application/ccxml+xml\":[\"ccxml\"],\"application/cdfx+xml\":[\"cdfx\"],\"application/cdmi-capability\":[\"cdmia\"],\"application/cdmi-container\":[\"cdmic\"],\"application/cdmi-domain\":[\"cdmid\"],\"application/cdmi-object\":[\"cdmio\"],\"application/cdmi-queue\":[\"cdmiq\"],\"application/cu-seeme\":[\"cu\"],\"application/dash+xml\":[\"mpd\"],\"application/davmount+xml\":[\"davmount\"],\"application/docbook+xml\":[\"dbk\"],\"application/dssc+der\":[\"dssc\"],\"application/dssc+xml\":[\"xdssc\"],\"application/ecmascript\":[\"es\",\"ecma\"],\"application/emma+xml\":[\"emma\"],\"application/emotionml+xml\":[\"emotionml\"],\"application/epub+zip\":[\"epub\"],\"application/exi\":[\"exi\"],\"application/express\":[\"exp\"],\"application/fdt+xml\":[\"fdt\"],\"application/font-tdpfr\":[\"pfr\"],\"application/geo+json\":[\"geojson\"],\"application/gml+xml\":[\"gml\"],\"application/gpx+xml\":[\"gpx\"],\"application/gxf\":[\"gxf\"],\"application/gzip\":[\"gz\"],\"application/hjson\":[\"hjson\"],\"application/hyperstudio\":[\"stk\"],\"application/inkml+xml\":[\"ink\",\"inkml\"],\"application/ipfix\":[\"ipfix\"],\"application/its+xml\":[\"its\"],\"application/java-archive\":[\"jar\",\"war\",\"ear\"],\"application/java-serialized-object\":[\"ser\"],\"application/java-vm\":[\"class\"],\"application/javascript\":[\"js\",\"mjs\"],\"application/json\":[\"json\",\"map\"],\"application/json5\":[\"json5\"],\"application/jsonml+json\":[\"jsonml\"],\"application/ld+json\":[\"jsonld\"],\"application/lgr+xml\":[\"lgr\"],\"application/lost+xml\":[\"lostxml\"],\"application/mac-binhex40\":[\"hqx\"],\"application/mac-compactpro\":[\"cpt\"],\"application/mads+xml\":[\"mads\"],\"application/manifest+json\":[\"webmanifest\"],\"application/marc\":[\"mrc\"],\"application/marcxml+xml\":[\"mrcx\"],\"application/mathematica\":[\"ma\",\"nb\",\"mb\"],\"application/mathml+xml\":[\"mathml\"],\"application/mbox\":[\"mbox\"],\"application/mediaservercontrol+xml\":[\"mscml\"],\"application/metalink+xml\":[\"metalink\"],\"application/metalink4+xml\":[\"meta4\"],\"application/mets+xml\":[\"mets\"],\"application/mmt-aei+xml\":[\"maei\"],\"application/mmt-usd+xml\":[\"musd\"],\"application/mods+xml\":[\"mods\"],\"application/mp21\":[\"m21\",\"mp21\"],\"application/mp4\":[\"mp4s\",\"m4p\"],\"application/msword\":[\"doc\",\"dot\"],\"application/mxf\":[\"mxf\"],\"application/n-quads\":[\"nq\"],\"application/n-triples\":[\"nt\"],\"application/node\":[\"cjs\"],\"application/octet-stream\":[\"bin\",\"dms\",\"lrf\",\"mar\",\"so\",\"dist\",\"distz\",\"pkg\",\"bpk\",\"dump\",\"elc\",\"deploy\",\"exe\",\"dll\",\"deb\",\"dmg\",\"iso\",\"img\",\"msi\",\"msp\",\"msm\",\"buffer\"],\"application/oda\":[\"oda\"],\"application/oebps-package+xml\":[\"opf\"],\"application/ogg\":[\"ogx\"],\"application/omdoc+xml\":[\"omdoc\"],\"application/onenote\":[\"onetoc\",\"onetoc2\",\"onetmp\",\"onepkg\"],\"application/oxps\":[\"oxps\"],\"application/p2p-overlay+xml\":[\"relo\"],\"application/patch-ops-error+xml\":[\"xer\"],\"application/pdf\":[\"pdf\"],\"application/pgp-encrypted\":[\"pgp\"],\"application/pgp-signature\":[\"asc\",\"sig\"],\"application/pics-rules\":[\"prf\"],\"application/pkcs10\":[\"p10\"],\"application/pkcs7-mime\":[\"p7m\",\"p7c\"],\"application/pkcs7-signature\":[\"p7s\"],\"application/pkcs8\":[\"p8\"],\"application/pkix-attr-cert\":[\"ac\"],\"application/pkix-cert\":[\"cer\"],\"application/pkix-crl\":[\"crl\"],\"application/pkix-pkipath\":[\"pkipath\"],\"application/pkixcmp\":[\"pki\"],\"application/pls+xml\":[\"pls\"],\"application/postscript\":[\"ai\",\"eps\",\"ps\"],\"application/provenance+xml\":[\"provx\"],\"application/pskc+xml\":[\"pskcxml\"],\"application/raml+yaml\":[\"raml\"],\"application/rdf+xml\":[\"rdf\",\"owl\"],\"application/reginfo+xml\":[\"rif\"],\"application/relax-ng-compact-syntax\":[\"rnc\"],\"application/resource-lists+xml\":[\"rl\"],\"application/resource-lists-diff+xml\":[\"rld\"],\"application/rls-services+xml\":[\"rs\"],\"application/route-apd+xml\":[\"rapd\"],\"application/route-s-tsid+xml\":[\"sls\"],\"application/route-usd+xml\":[\"rusd\"],\"application/rpki-ghostbusters\":[\"gbr\"],\"application/rpki-manifest\":[\"mft\"],\"application/rpki-roa\":[\"roa\"],\"application/rsd+xml\":[\"rsd\"],\"application/rss+xml\":[\"rss\"],\"application/rtf\":[\"rtf\"],\"application/sbml+xml\":[\"sbml\"],\"application/scvp-cv-request\":[\"scq\"],\"application/scvp-cv-response\":[\"scs\"],\"application/scvp-vp-request\":[\"spq\"],\"application/scvp-vp-response\":[\"spp\"],\"application/sdp\":[\"sdp\"],\"application/senml+xml\":[\"senmlx\"],\"application/sensml+xml\":[\"sensmlx\"],\"application/set-payment-initiation\":[\"setpay\"],\"application/set-registration-initiation\":[\"setreg\"],\"application/shf+xml\":[\"shf\"],\"application/sieve\":[\"siv\",\"sieve\"],\"application/smil+xml\":[\"smi\",\"smil\"],\"application/sparql-query\":[\"rq\"],\"application/sparql-results+xml\":[\"srx\"],\"application/srgs\":[\"gram\"],\"application/srgs+xml\":[\"grxml\"],\"application/sru+xml\":[\"sru\"],\"application/ssdl+xml\":[\"ssdl\"],\"application/ssml+xml\":[\"ssml\"],\"application/swid+xml\":[\"swidtag\"],\"application/tei+xml\":[\"tei\",\"teicorpus\"],\"application/thraud+xml\":[\"tfi\"],\"application/timestamped-data\":[\"tsd\"],\"application/toml\":[\"toml\"],\"application/trig\":[\"trig\"],\"application/ttml+xml\":[\"ttml\"],\"application/ubjson\":[\"ubj\"],\"application/urc-ressheet+xml\":[\"rsheet\"],\"application/urc-targetdesc+xml\":[\"td\"],\"application/voicexml+xml\":[\"vxml\"],\"application/wasm\":[\"wasm\"],\"application/widget\":[\"wgt\"],\"application/winhlp\":[\"hlp\"],\"application/wsdl+xml\":[\"wsdl\"],\"application/wspolicy+xml\":[\"wspolicy\"],\"application/xaml+xml\":[\"xaml\"],\"application/xcap-att+xml\":[\"xav\"],\"application/xcap-caps+xml\":[\"xca\"],\"application/xcap-diff+xml\":[\"xdf\"],\"application/xcap-el+xml\":[\"xel\"],\"application/xcap-ns+xml\":[\"xns\"],\"application/xenc+xml\":[\"xenc\"],\"application/xhtml+xml\":[\"xhtml\",\"xht\"],\"application/xliff+xml\":[\"xlf\"],\"application/xml\":[\"xml\",\"xsl\",\"xsd\",\"rng\"],\"application/xml-dtd\":[\"dtd\"],\"application/xop+xml\":[\"xop\"],\"application/xproc+xml\":[\"xpl\"],\"application/xslt+xml\":[\"*xsl\",\"xslt\"],\"application/xspf+xml\":[\"xspf\"],\"application/xv+xml\":[\"mxml\",\"xhvml\",\"xvml\",\"xvm\"],\"application/yang\":[\"yang\"],\"application/yin+xml\":[\"yin\"],\"application/zip\":[\"zip\"],\"audio/3gpp\":[\"*3gpp\"],\"audio/adpcm\":[\"adp\"],\"audio/amr\":[\"amr\"],\"audio/basic\":[\"au\",\"snd\"],\"audio/midi\":[\"mid\",\"midi\",\"kar\",\"rmi\"],\"audio/mobile-xmf\":[\"mxmf\"],\"audio/mp3\":[\"*mp3\"],\"audio/mp4\":[\"m4a\",\"mp4a\"],\"audio/mpeg\":[\"mpga\",\"mp2\",\"mp2a\",\"mp3\",\"m2a\",\"m3a\"],\"audio/ogg\":[\"oga\",\"ogg\",\"spx\",\"opus\"],\"audio/s3m\":[\"s3m\"],\"audio/silk\":[\"sil\"],\"audio/wav\":[\"wav\"],\"audio/wave\":[\"*wav\"],\"audio/webm\":[\"weba\"],\"audio/xm\":[\"xm\"],\"font/collection\":[\"ttc\"],\"font/otf\":[\"otf\"],\"font/ttf\":[\"ttf\"],\"font/woff\":[\"woff\"],\"font/woff2\":[\"woff2\"],\"image/aces\":[\"exr\"],\"image/apng\":[\"apng\"],\"image/avif\":[\"avif\"],\"image/bmp\":[\"bmp\"],\"image/cgm\":[\"cgm\"],\"image/dicom-rle\":[\"drle\"],\"image/emf\":[\"emf\"],\"image/fits\":[\"fits\"],\"image/g3fax\":[\"g3\"],\"image/gif\":[\"gif\"],\"image/heic\":[\"heic\"],\"image/heic-sequence\":[\"heics\"],\"image/heif\":[\"heif\"],\"image/heif-sequence\":[\"heifs\"],\"image/hej2k\":[\"hej2\"],\"image/hsj2\":[\"hsj2\"],\"image/ief\":[\"ief\"],\"image/jls\":[\"jls\"],\"image/jp2\":[\"jp2\",\"jpg2\"],\"image/jpeg\":[\"jpeg\",\"jpg\",\"jpe\"],\"image/jph\":[\"jph\"],\"image/jphc\":[\"jhc\"],\"image/jpm\":[\"jpm\"],\"image/jpx\":[\"jpx\",\"jpf\"],\"image/jxr\":[\"jxr\"],\"image/jxra\":[\"jxra\"],\"image/jxrs\":[\"jxrs\"],\"image/jxs\":[\"jxs\"],\"image/jxsc\":[\"jxsc\"],\"image/jxsi\":[\"jxsi\"],\"image/jxss\":[\"jxss\"],\"image/ktx\":[\"ktx\"],\"image/ktx2\":[\"ktx2\"],\"image/png\":[\"png\"],\"image/sgi\":[\"sgi\"],\"image/svg+xml\":[\"svg\",\"svgz\"],\"image/t38\":[\"t38\"],\"image/tiff\":[\"tif\",\"tiff\"],\"image/tiff-fx\":[\"tfx\"],\"image/webp\":[\"webp\"],\"image/wmf\":[\"wmf\"],\"message/disposition-notification\":[\"disposition-notification\"],\"message/global\":[\"u8msg\"],\"message/global-delivery-status\":[\"u8dsn\"],\"message/global-disposition-notification\":[\"u8mdn\"],\"message/global-headers\":[\"u8hdr\"],\"message/rfc822\":[\"eml\",\"mime\"],\"model/3mf\":[\"3mf\"],\"model/gltf+json\":[\"gltf\"],\"model/gltf-binary\":[\"glb\"],\"model/iges\":[\"igs\",\"iges\"],\"model/mesh\":[\"msh\",\"mesh\",\"silo\"],\"model/mtl\":[\"mtl\"],\"model/obj\":[\"obj\"],\"model/step+xml\":[\"stpx\"],\"model/step+zip\":[\"stpz\"],\"model/step-xml+zip\":[\"stpxz\"],\"model/stl\":[\"stl\"],\"model/vrml\":[\"wrl\",\"vrml\"],\"model/x3d+binary\":[\"*x3db\",\"x3dbz\"],\"model/x3d+fastinfoset\":[\"x3db\"],\"model/x3d+vrml\":[\"*x3dv\",\"x3dvz\"],\"model/x3d+xml\":[\"x3d\",\"x3dz\"],\"model/x3d-vrml\":[\"x3dv\"],\"text/cache-manifest\":[\"appcache\",\"manifest\"],\"text/calendar\":[\"ics\",\"ifb\"],\"text/coffeescript\":[\"coffee\",\"litcoffee\"],\"text/css\":[\"css\"],\"text/csv\":[\"csv\"],\"text/html\":[\"html\",\"htm\",\"shtml\"],\"text/jade\":[\"jade\"],\"text/jsx\":[\"jsx\"],\"text/less\":[\"less\"],\"text/markdown\":[\"markdown\",\"md\"],\"text/mathml\":[\"mml\"],\"text/mdx\":[\"mdx\"],\"text/n3\":[\"n3\"],\"text/plain\":[\"txt\",\"text\",\"conf\",\"def\",\"list\",\"log\",\"in\",\"ini\"],\"text/richtext\":[\"rtx\"],\"text/rtf\":[\"*rtf\"],\"text/sgml\":[\"sgml\",\"sgm\"],\"text/shex\":[\"shex\"],\"text/slim\":[\"slim\",\"slm\"],\"text/spdx\":[\"spdx\"],\"text/stylus\":[\"stylus\",\"styl\"],\"text/tab-separated-values\":[\"tsv\"],\"text/troff\":[\"t\",\"tr\",\"roff\",\"man\",\"me\",\"ms\"],\"text/turtle\":[\"ttl\"],\"text/uri-list\":[\"uri\",\"uris\",\"urls\"],\"text/vcard\":[\"vcard\"],\"text/vtt\":[\"vtt\"],\"text/xml\":[\"*xml\"],\"text/yaml\":[\"yaml\",\"yml\"],\"video/3gpp\":[\"3gp\",\"3gpp\"],\"video/3gpp2\":[\"3g2\"],\"video/h261\":[\"h261\"],\"video/h263\":[\"h263\"],\"video/h264\":[\"h264\"],\"video/iso.segment\":[\"m4s\"],\"video/jpeg\":[\"jpgv\"],\"video/jpm\":[\"*jpm\",\"jpgm\"],\"video/mj2\":[\"mj2\",\"mjp2\"],\"video/mp2t\":[\"ts\"],\"video/mp4\":[\"mp4\",\"mp4v\",\"mpg4\"],\"video/mpeg\":[\"mpeg\",\"mpg\",\"mpe\",\"m1v\",\"m2v\"],\"video/ogg\":[\"ogv\"],\"video/quicktime\":[\"qt\",\"mov\"],\"video/webm\":[\"webm\"]};","'use strict';\n\nfunction hasKey(obj, keys) {\n\tvar o = obj;\n\tkeys.slice(0, -1).forEach(function (key) {\n\t\to = o[key] || {};\n\t});\n\n\tvar key = keys[keys.length - 1];\n\treturn key in o;\n}\n\nfunction isNumber(x) {\n\tif (typeof x === 'number') { return true; }\n\tif ((/^0x[0-9a-f]+$/i).test(x)) { return true; }\n\treturn (/^[-+]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(e[-+]?\\d+)?$/).test(x);\n}\n\nfunction isConstructorOrProto(obj, key) {\n\treturn (key === 'constructor' && typeof obj[key] === 'function') || key === '__proto__';\n}\n\nmodule.exports = function (args, opts) {\n\tif (!opts) { opts = {}; }\n\n\tvar flags = {\n\t\tbools: {},\n\t\tstrings: {},\n\t\tunknownFn: null,\n\t};\n\n\tif (typeof opts.unknown === 'function') {\n\t\tflags.unknownFn = opts.unknown;\n\t}\n\n\tif (typeof opts.boolean === 'boolean' && opts.boolean) {\n\t\tflags.allBools = true;\n\t} else {\n\t\t[].concat(opts.boolean).filter(Boolean).forEach(function (key) {\n\t\t\tflags.bools[key] = true;\n\t\t});\n\t}\n\n\tvar aliases = {};\n\n\tfunction aliasIsBoolean(key) {\n\t\treturn aliases[key].some(function (x) {\n\t\t\treturn flags.bools[x];\n\t\t});\n\t}\n\n\tObject.keys(opts.alias || {}).forEach(function (key) {\n\t\taliases[key] = [].concat(opts.alias[key]);\n\t\taliases[key].forEach(function (x) {\n\t\t\taliases[x] = [key].concat(aliases[key].filter(function (y) {\n\t\t\t\treturn x !== y;\n\t\t\t}));\n\t\t});\n\t});\n\n\t[].concat(opts.string).filter(Boolean).forEach(function (key) {\n\t\tflags.strings[key] = true;\n\t\tif (aliases[key]) {\n\t\t\t[].concat(aliases[key]).forEach(function (k) {\n\t\t\t\tflags.strings[k] = true;\n\t\t\t});\n\t\t}\n\t});\n\n\tvar defaults = opts.default || {};\n\n\tvar argv = { _: [] };\n\n\tfunction argDefined(key, arg) {\n\t\treturn (flags.allBools && (/^--[^=]+$/).test(arg))\n\t\t\t|| flags.strings[key]\n\t\t\t|| flags.bools[key]\n\t\t\t|| aliases[key];\n\t}\n\n\tfunction setKey(obj, keys, value) {\n\t\tvar o = obj;\n\t\tfor (var i = 0; i < keys.length - 1; i++) {\n\t\t\tvar key = keys[i];\n\t\t\tif (isConstructorOrProto(o, key)) { return; }\n\t\t\tif (o[key] === undefined) { o[key] = {}; }\n\t\t\tif (\n\t\t\t\to[key] === Object.prototype\n\t\t\t\t|| o[key] === Number.prototype\n\t\t\t\t|| o[key] === String.prototype\n\t\t\t) {\n\t\t\t\to[key] = {};\n\t\t\t}\n\t\t\tif (o[key] === Array.prototype) { o[key] = []; }\n\t\t\to = o[key];\n\t\t}\n\n\t\tvar lastKey = keys[keys.length - 1];\n\t\tif (isConstructorOrProto(o, lastKey)) { return; }\n\t\tif (\n\t\t\to === Object.prototype\n\t\t\t|| o === Number.prototype\n\t\t\t|| o === String.prototype\n\t\t) {\n\t\t\to = {};\n\t\t}\n\t\tif (o === Array.prototype) { o = []; }\n\t\tif (o[lastKey] === undefined || flags.bools[lastKey] || typeof o[lastKey] === 'boolean') {\n\t\t\to[lastKey] = value;\n\t\t} else if (Array.isArray(o[lastKey])) {\n\t\t\to[lastKey].push(value);\n\t\t} else {\n\t\t\to[lastKey] = [o[lastKey], value];\n\t\t}\n\t}\n\n\tfunction setArg(key, val, arg) {\n\t\tif (arg && flags.unknownFn && !argDefined(key, arg)) {\n\t\t\tif (flags.unknownFn(arg) === false) { return; }\n\t\t}\n\n\t\tvar value = !flags.strings[key] && isNumber(val)\n\t\t\t? Number(val)\n\t\t\t: val;\n\t\tsetKey(argv, key.split('.'), value);\n\n\t\t(aliases[key] || []).forEach(function (x) {\n\t\t\tsetKey(argv, x.split('.'), value);\n\t\t});\n\t}\n\n\tObject.keys(flags.bools).forEach(function (key) {\n\t\tsetArg(key, defaults[key] === undefined ? false : defaults[key]);\n\t});\n\n\tvar notFlags = [];\n\n\tif (args.indexOf('--') !== -1) {\n\t\tnotFlags = args.slice(args.indexOf('--') + 1);\n\t\targs = args.slice(0, args.indexOf('--'));\n\t}\n\n\tfor (var i = 0; i < args.length; i++) {\n\t\tvar arg = args[i];\n\t\tvar key;\n\t\tvar next;\n\n\t\tif ((/^--.+=/).test(arg)) {\n\t\t\t// Using [\\s\\S] instead of . because js doesn't support the\n\t\t\t// 'dotall' regex modifier. See:\n\t\t\t// http://stackoverflow.com/a/1068308/13216\n\t\t\tvar m = arg.match(/^--([^=]+)=([\\s\\S]*)$/);\n\t\t\tkey = m[1];\n\t\t\tvar value = m[2];\n\t\t\tif (flags.bools[key]) {\n\t\t\t\tvalue = value !== 'false';\n\t\t\t}\n\t\t\tsetArg(key, value, arg);\n\t\t} else if ((/^--no-.+/).test(arg)) {\n\t\t\tkey = arg.match(/^--no-(.+)/)[1];\n\t\t\tsetArg(key, false, arg);\n\t\t} else if ((/^--.+/).test(arg)) {\n\t\t\tkey = arg.match(/^--(.+)/)[1];\n\t\t\tnext = args[i + 1];\n\t\t\tif (\n\t\t\t\tnext !== undefined\n\t\t\t\t&& !(/^(-|--)[^-]/).test(next)\n\t\t\t\t&& !flags.bools[key]\n\t\t\t\t&& !flags.allBools\n\t\t\t\t&& (aliases[key] ? !aliasIsBoolean(key) : true)\n\t\t\t) {\n\t\t\t\tsetArg(key, next, arg);\n\t\t\t\ti += 1;\n\t\t\t} else if ((/^(true|false)$/).test(next)) {\n\t\t\t\tsetArg(key, next === 'true', arg);\n\t\t\t\ti += 1;\n\t\t\t} else {\n\t\t\t\tsetArg(key, flags.strings[key] ? '' : true, arg);\n\t\t\t}\n\t\t} else if ((/^-[^-]+/).test(arg)) {\n\t\t\tvar letters = arg.slice(1, -1).split('');\n\n\t\t\tvar broken = false;\n\t\t\tfor (var j = 0; j < letters.length; j++) {\n\t\t\t\tnext = arg.slice(j + 2);\n\n\t\t\t\tif (next === '-') {\n\t\t\t\t\tsetArg(letters[j], next, arg);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ((/[A-Za-z]/).test(letters[j]) && next[0] === '=') {\n\t\t\t\t\tsetArg(letters[j], next.slice(1), arg);\n\t\t\t\t\tbroken = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(/[A-Za-z]/).test(letters[j])\n\t\t\t\t\t&& (/-?\\d+(\\.\\d*)?(e-?\\d+)?$/).test(next)\n\t\t\t\t) {\n\t\t\t\t\tsetArg(letters[j], next, arg);\n\t\t\t\t\tbroken = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (letters[j + 1] && letters[j + 1].match(/\\W/)) {\n\t\t\t\t\tsetArg(letters[j], arg.slice(j + 2), arg);\n\t\t\t\t\tbroken = true;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tsetArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tkey = arg.slice(-1)[0];\n\t\t\tif (!broken && key !== '-') {\n\t\t\t\tif (\n\t\t\t\t\targs[i + 1]\n\t\t\t\t\t&& !(/^(-|--)[^-]/).test(args[i + 1])\n\t\t\t\t\t&& !flags.bools[key]\n\t\t\t\t\t&& (aliases[key] ? !aliasIsBoolean(key) : true)\n\t\t\t\t) {\n\t\t\t\t\tsetArg(key, args[i + 1], arg);\n\t\t\t\t\ti += 1;\n\t\t\t\t} else if (args[i + 1] && (/^(true|false)$/).test(args[i + 1])) {\n\t\t\t\t\tsetArg(key, args[i + 1] === 'true', arg);\n\t\t\t\t\ti += 1;\n\t\t\t\t} else {\n\t\t\t\t\tsetArg(key, flags.strings[key] ? '' : true, arg);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!flags.unknownFn || flags.unknownFn(arg) !== false) {\n\t\t\t\targv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg));\n\t\t\t}\n\t\t\tif (opts.stopEarly) {\n\t\t\t\targv._.push.apply(argv._, args.slice(i + 1));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tObject.keys(defaults).forEach(function (k) {\n\t\tif (!hasKey(argv, k.split('.'))) {\n\t\t\tsetKey(argv, k.split('.'), defaults[k]);\n\n\t\t\t(aliases[k] || []).forEach(function (x) {\n\t\t\t\tsetKey(argv, x.split('.'), defaults[k]);\n\t\t\t});\n\t\t}\n\t});\n\n\tif (opts['--']) {\n\t\targv['--'] = notFlags.slice();\n\t} else {\n\t\tnotFlags.forEach(function (k) {\n\t\t\targv._.push(k);\n\t\t});\n\t}\n\n\treturn argv;\n};\n","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n\ttypeof define === 'function' && define.amd ? define(['exports'], factory) :\n\t(factory((global.Mock = global.Mock || {})));\n}(this, (function (exports) { 'use strict';\n\nvar commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\n/**\n * Check if we're required to add a port number.\n *\n * @see https://url.spec.whatwg.org/#default-port\n * @param {Number|String} port Port number we need to check\n * @param {String} protocol Protocol we need to check against.\n * @returns {Boolean} Is it a default port for the given protocol\n * @api private\n */\nvar requiresPort = function required(port, protocol) {\n protocol = protocol.split(':')[0];\n port = +port;\n\n if (!port) { return false; }\n\n switch (protocol) {\n case 'http':\n case 'ws':\n return port !== 80;\n\n case 'https':\n case 'wss':\n return port !== 443;\n\n case 'ftp':\n return port !== 21;\n\n case 'gopher':\n return port !== 70;\n\n case 'file':\n return false;\n }\n\n return port !== 0;\n};\n\nvar has = Object.prototype.hasOwnProperty;\nvar undef;\n\n/**\n * Decode a URI encoded string.\n *\n * @param {String} input The URI encoded string.\n * @returns {String|Null} The decoded string.\n * @api private\n */\nfunction decode(input) {\n try {\n return decodeURIComponent(input.replace(/\\+/g, ' '));\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Attempts to encode a given input.\n *\n * @param {String} input The string that needs to be encoded.\n * @returns {String|Null} The encoded string.\n * @api private\n */\nfunction encode(input) {\n try {\n return encodeURIComponent(input);\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Simple query string parser.\n *\n * @param {String} query The query string that needs to be parsed.\n * @returns {Object}\n * @api public\n */\nfunction querystring(query) {\n var parser = /([^=?#&]+)=?([^&]*)/g\n , result = {}\n , part;\n\n while (part = parser.exec(query)) {\n var key = decode(part[1])\n , value = decode(part[2]);\n\n //\n // Prevent overriding of existing properties. This ensures that build-in\n // methods like `toString` or __proto__ are not overriden by malicious\n // querystrings.\n //\n // In the case if failed decoding, we want to omit the key/value pairs\n // from the result.\n //\n if (key === null || value === null || key in result) { continue; }\n result[key] = value;\n }\n\n return result;\n}\n\n/**\n * Transform a query string to an object.\n *\n * @param {Object} obj Object that should be transformed.\n * @param {String} prefix Optional prefix.\n * @returns {String}\n * @api public\n */\nfunction querystringify(obj, prefix) {\n prefix = prefix || '';\n\n var pairs = []\n , value\n , key;\n\n //\n // Optionally prefix with a '?' if needed\n //\n if ('string' !== typeof prefix) { prefix = '?'; }\n\n for (key in obj) {\n if (has.call(obj, key)) {\n value = obj[key];\n\n //\n // Edge cases where we actually want to encode the value to an empty\n // string instead of the stringified value.\n //\n if (!value && (value === null || value === undef || isNaN(value))) {\n value = '';\n }\n\n key = encode(key);\n value = encode(value);\n\n //\n // If we failed to encode the strings, we should bail out as we don't\n // want to add invalid strings to the query.\n //\n if (key === null || value === null) { continue; }\n pairs.push(key +'='+ value);\n }\n }\n\n return pairs.length ? prefix + pairs.join('&') : '';\n}\n\n//\n// Expose the module.\n//\nvar stringify = querystringify;\nvar parse = querystring;\n\nvar querystringify_1 = {\n\tstringify: stringify,\n\tparse: parse\n};\n\nvar CRHTLF = /[\\n\\r\\t]/g;\nvar slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//;\nvar protocolre = /^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i;\nvar windowsDriveLetter = /^[a-zA-Z]:/;\nvar whitespace = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/;\n\n/**\n * Trim a given string.\n *\n * @param {String} str String to trim.\n * @public\n */\nfunction trimLeft(str) {\n return (str ? str : '').toString().replace(whitespace, '');\n}\n\n/**\n * These are the parse rules for the URL parser, it informs the parser\n * about:\n *\n * 0. The char it Needs to parse, if it's a string it should be done using\n * indexOf, RegExp using exec and NaN means set as current value.\n * 1. The property we should set when parsing this value.\n * 2. Indication if it's backwards or forward parsing, when set as number it's\n * the value of extra chars that should be split off.\n * 3. Inherit from location if non existing in the parser.\n * 4. `toLowerCase` the resulting value.\n */\nvar rules = [\n ['#', 'hash'], // Extract from the back.\n ['?', 'query'], // Extract from the back.\n function sanitize(address, url) { // Sanitize what is left of the address\n return isSpecial(url.protocol) ? address.replace(/\\\\/g, '/') : address;\n },\n ['/', 'pathname'], // Extract from the back.\n ['@', 'auth', 1], // Extract from the front.\n [NaN, 'host', undefined, 1, 1], // Set left over value.\n [/:(\\d*)$/, 'port', undefined, 1], // RegExp the back.\n [NaN, 'hostname', undefined, 1, 1] // Set left over.\n];\n\n/**\n * These properties should not be copied or inherited from. This is only needed\n * for all non blob URL's as a blob URL does not include a hash, only the\n * origin.\n *\n * @type {Object}\n * @private\n */\nvar ignore = { hash: 1, query: 1 };\n\n/**\n * The location object differs when your code is loaded through a normal page,\n * Worker or through a worker using a blob. And with the blobble begins the\n * trouble as the location object will contain the URL of the blob, not the\n * location of the page where our code is loaded in. The actual origin is\n * encoded in the `pathname` so we can thankfully generate a good \"default\"\n * location from it so we can generate proper relative URL's again.\n *\n * @param {Object|String} loc Optional default location object.\n * @returns {Object} lolcation object.\n * @public\n */\nfunction lolcation(loc) {\n var globalVar;\n\n if (typeof window !== 'undefined') { globalVar = window; }\n else if (typeof commonjsGlobal !== 'undefined') { globalVar = commonjsGlobal; }\n else if (typeof self !== 'undefined') { globalVar = self; }\n else { globalVar = {}; }\n\n var location = globalVar.location || {};\n loc = loc || location;\n\n var finaldestination = {}\n , type = typeof loc\n , key;\n\n if ('blob:' === loc.protocol) {\n finaldestination = new Url(unescape(loc.pathname), {});\n } else if ('string' === type) {\n finaldestination = new Url(loc, {});\n for (key in ignore) { delete finaldestination[key]; }\n } else if ('object' === type) {\n for (key in loc) {\n if (key in ignore) { continue; }\n finaldestination[key] = loc[key];\n }\n\n if (finaldestination.slashes === undefined) {\n finaldestination.slashes = slashes.test(loc.href);\n }\n }\n\n return finaldestination;\n}\n\n/**\n * Check whether a protocol scheme is special.\n *\n * @param {String} The protocol scheme of the URL\n * @return {Boolean} `true` if the protocol scheme is special, else `false`\n * @private\n */\nfunction isSpecial(scheme) {\n return (\n scheme === 'file:' ||\n scheme === 'ftp:' ||\n scheme === 'http:' ||\n scheme === 'https:' ||\n scheme === 'ws:' ||\n scheme === 'wss:'\n );\n}\n\n/**\n * @typedef ProtocolExtract\n * @type Object\n * @property {String} protocol Protocol matched in the URL, in lowercase.\n * @property {Boolean} slashes `true` if protocol is followed by \"//\", else `false`.\n * @property {String} rest Rest of the URL that is not part of the protocol.\n */\n\n/**\n * Extract protocol information from a URL with/without double slash (\"//\").\n *\n * @param {String} address URL we want to extract from.\n * @param {Object} location\n * @return {ProtocolExtract} Extracted information.\n * @private\n */\nfunction extractProtocol(address, location) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n location = location || {};\n\n var match = protocolre.exec(address);\n var protocol = match[1] ? match[1].toLowerCase() : '';\n var forwardSlashes = !!match[2];\n var otherSlashes = !!match[3];\n var slashesCount = 0;\n var rest;\n\n if (forwardSlashes) {\n if (otherSlashes) {\n rest = match[2] + match[3] + match[4];\n slashesCount = match[2].length + match[3].length;\n } else {\n rest = match[2] + match[4];\n slashesCount = match[2].length;\n }\n } else {\n if (otherSlashes) {\n rest = match[3] + match[4];\n slashesCount = match[3].length;\n } else {\n rest = match[4];\n }\n }\n\n if (protocol === 'file:') {\n if (slashesCount >= 2) {\n rest = rest.slice(2);\n }\n } else if (isSpecial(protocol)) {\n rest = match[4];\n } else if (protocol) {\n if (forwardSlashes) {\n rest = rest.slice(2);\n }\n } else if (slashesCount >= 2 && isSpecial(location.protocol)) {\n rest = match[4];\n }\n\n return {\n protocol: protocol,\n slashes: forwardSlashes || isSpecial(protocol),\n slashesCount: slashesCount,\n rest: rest\n };\n}\n\n/**\n * Resolve a relative URL pathname against a base URL pathname.\n *\n * @param {String} relative Pathname of the relative URL.\n * @param {String} base Pathname of the base URL.\n * @return {String} Resolved pathname.\n * @private\n */\nfunction resolve(relative, base) {\n if (relative === '') { return base; }\n\n var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))\n , i = path.length\n , last = path[i - 1]\n , unshift = false\n , up = 0;\n\n while (i--) {\n if (path[i] === '.') {\n path.splice(i, 1);\n } else if (path[i] === '..') {\n path.splice(i, 1);\n up++;\n } else if (up) {\n if (i === 0) { unshift = true; }\n path.splice(i, 1);\n up--;\n }\n }\n\n if (unshift) { path.unshift(''); }\n if (last === '.' || last === '..') { path.push(''); }\n\n return path.join('/');\n}\n\n/**\n * The actual URL instance. Instead of returning an object we've opted-in to\n * create an actual constructor as it's much more memory efficient and\n * faster and it pleases my OCD.\n *\n * It is worth noting that we should not use `URL` as class name to prevent\n * clashes with the global URL instance that got introduced in browsers.\n *\n * @constructor\n * @param {String} address URL we want to parse.\n * @param {Object|String} [location] Location defaults for relative paths.\n * @param {Boolean|Function} [parser] Parser for the query string.\n * @private\n */\nfunction Url(address, location, parser) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n\n if (!(this instanceof Url)) {\n return new Url(address, location, parser);\n }\n\n var relative, extracted, parse, instruction, index, key\n , instructions = rules.slice()\n , type = typeof location\n , url = this\n , i = 0;\n\n //\n // The following if statements allows this module two have compatibility with\n // 2 different API:\n //\n // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments\n // where the boolean indicates that the query string should also be parsed.\n //\n // 2. The `URL` interface of the browser which accepts a URL, object as\n // arguments. The supplied object will be used as default values / fall-back\n // for relative paths.\n //\n if ('object' !== type && 'string' !== type) {\n parser = location;\n location = null;\n }\n\n if (parser && 'function' !== typeof parser) { parser = querystringify_1.parse; }\n\n location = lolcation(location);\n\n //\n // Extract protocol information before running the instructions.\n //\n extracted = extractProtocol(address || '', location);\n relative = !extracted.protocol && !extracted.slashes;\n url.slashes = extracted.slashes || relative && location.slashes;\n url.protocol = extracted.protocol || location.protocol || '';\n address = extracted.rest;\n\n //\n // When the authority component is absent the URL starts with a path\n // component.\n //\n if (\n extracted.protocol === 'file:' && (\n extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||\n (!extracted.slashes &&\n (extracted.protocol ||\n extracted.slashesCount < 2 ||\n !isSpecial(url.protocol)))\n ) {\n instructions[3] = [/(.*)/, 'pathname'];\n }\n\n for (; i < instructions.length; i++) {\n instruction = instructions[i];\n\n if (typeof instruction === 'function') {\n address = instruction(address, url);\n continue;\n }\n\n parse = instruction[0];\n key = instruction[1];\n\n if (parse !== parse) {\n url[key] = address;\n } else if ('string' === typeof parse) {\n index = parse === '@'\n ? address.lastIndexOf(parse)\n : address.indexOf(parse);\n\n if (~index) {\n if ('number' === typeof instruction[2]) {\n url[key] = address.slice(0, index);\n address = address.slice(index + instruction[2]);\n } else {\n url[key] = address.slice(index);\n address = address.slice(0, index);\n }\n }\n } else if ((index = parse.exec(address))) {\n url[key] = index[1];\n address = address.slice(0, index.index);\n }\n\n url[key] = url[key] || (\n relative && instruction[3] ? location[key] || '' : ''\n );\n\n //\n // Hostname, host and protocol should be lowercased so they can be used to\n // create a proper `origin`.\n //\n if (instruction[4]) { url[key] = url[key].toLowerCase(); }\n }\n\n //\n // Also parse the supplied query string in to an object. If we're supplied\n // with a custom parser as function use that instead of the default build-in\n // parser.\n //\n if (parser) { url.query = parser(url.query); }\n\n //\n // If the URL is relative, resolve the pathname against the base URL.\n //\n if (\n relative\n && location.slashes\n && url.pathname.charAt(0) !== '/'\n && (url.pathname !== '' || location.pathname !== '')\n ) {\n url.pathname = resolve(url.pathname, location.pathname);\n }\n\n //\n // Default to a / for pathname if none exists. This normalizes the URL\n // to always have a /\n //\n if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {\n url.pathname = '/' + url.pathname;\n }\n\n //\n // We should not add port numbers if they are already the default port number\n // for a given protocol. As the host also contains the port number we're going\n // override it with the hostname which contains no port number.\n //\n if (!requiresPort(url.port, url.protocol)) {\n url.host = url.hostname;\n url.port = '';\n }\n\n //\n // Parse down the `auth` for the username and password.\n //\n url.username = url.password = '';\n\n if (url.auth) {\n index = url.auth.indexOf(':');\n\n if (~index) {\n url.username = url.auth.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = url.auth.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password));\n } else {\n url.username = encodeURIComponent(decodeURIComponent(url.auth));\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n }\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n //\n // The href is just the compiled result.\n //\n url.href = url.toString();\n}\n\n/**\n * This is convenience method for changing properties in the URL instance to\n * insure that they all propagate correctly.\n *\n * @param {String} part Property we need to adjust.\n * @param {Mixed} value The newly assigned value.\n * @param {Boolean|Function} fn When setting the query, it will be the function\n * used to parse the query.\n * When setting the protocol, double slash will be\n * removed from the final url if it is true.\n * @returns {URL} URL instance for chaining.\n * @public\n */\nfunction set(part, value, fn) {\n var url = this;\n\n switch (part) {\n case 'query':\n if ('string' === typeof value && value.length) {\n value = (fn || querystringify_1.parse)(value);\n }\n\n url[part] = value;\n break;\n\n case 'port':\n url[part] = value;\n\n if (!requiresPort(value, url.protocol)) {\n url.host = url.hostname;\n url[part] = '';\n } else if (value) {\n url.host = url.hostname +':'+ value;\n }\n\n break;\n\n case 'hostname':\n url[part] = value;\n\n if (url.port) { value += ':'+ url.port; }\n url.host = value;\n break;\n\n case 'host':\n url[part] = value;\n\n if (/:\\d+$/.test(value)) {\n value = value.split(':');\n url.port = value.pop();\n url.hostname = value.join(':');\n } else {\n url.hostname = value;\n url.port = '';\n }\n\n break;\n\n case 'protocol':\n url.protocol = value.toLowerCase();\n url.slashes = !fn;\n break;\n\n case 'pathname':\n case 'hash':\n if (value) {\n var char = part === 'pathname' ? '/' : '#';\n url[part] = value.charAt(0) !== char ? char + value : value;\n } else {\n url[part] = value;\n }\n break;\n\n case 'username':\n case 'password':\n url[part] = encodeURIComponent(value);\n break;\n\n case 'auth':\n var index = value.indexOf(':');\n\n if (~index) {\n url.username = value.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = value.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password));\n } else {\n url.username = encodeURIComponent(decodeURIComponent(value));\n }\n }\n\n for (var i = 0; i < rules.length; i++) {\n var ins = rules[i];\n\n if (ins[4]) { url[ins[1]] = url[ins[1]].toLowerCase(); }\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n url.href = url.toString();\n\n return url;\n}\n\n/**\n * Transform the properties back in to a valid and full URL string.\n *\n * @param {Function} stringify Optional query stringify function.\n * @returns {String} Compiled version of the URL.\n * @public\n */\nfunction toString(stringify) {\n if (!stringify || 'function' !== typeof stringify) { stringify = querystringify_1.stringify; }\n\n var query\n , url = this\n , host = url.host\n , protocol = url.protocol;\n\n if (protocol && protocol.charAt(protocol.length - 1) !== ':') { protocol += ':'; }\n\n var result =\n protocol +\n ((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : '');\n\n if (url.username) {\n result += url.username;\n if (url.password) { result += ':'+ url.password; }\n result += '@';\n } else if (url.password) {\n result += ':'+ url.password;\n result += '@';\n } else if (\n url.protocol !== 'file:' &&\n isSpecial(url.protocol) &&\n !host &&\n url.pathname !== '/'\n ) {\n //\n // Add back the empty userinfo, otherwise the original invalid URL\n // might be transformed into a valid one with `url.pathname` as host.\n //\n result += '@';\n }\n\n //\n // Trailing colon is removed from `url.host` when it is parsed. If it still\n // ends with a colon, then add back the trailing colon that was removed. This\n // prevents an invalid URL from being transformed into a valid one.\n //\n if (host[host.length - 1] === ':') { host += ':'; }\n result += host + url.pathname;\n\n query = 'object' === typeof url.query ? stringify(url.query) : url.query;\n if (query) { result += '?' !== query.charAt(0) ? '?'+ query : query; }\n\n if (url.hash) { result += url.hash; }\n\n return result;\n}\n\nUrl.prototype = { set: set, toString: toString };\n\n//\n// Expose the URL parser and some additional properties that might be useful for\n// others or testing.\n//\nUrl.extractProtocol = extractProtocol;\nUrl.location = lolcation;\nUrl.trimLeft = trimLeft;\nUrl.qs = querystringify_1;\n\nvar urlParse = Url;\n\n/*\n * This delay allows the thread to finish assigning its on* methods\n * before invoking the delay callback. This is purely a timing hack.\n * http://geekabyte.blogspot.com/2014/01/javascript-effect-of-setting-settimeout.html\n *\n * @param {callback: function} the callback which will be invoked after the timeout\n * @parma {context: object} the context in which to invoke the function\n */\nfunction delay(callback, context) {\n setTimeout(function (timeoutContext) { return callback.call(timeoutContext); }, 4, context);\n}\n\nfunction log(method, message) {\n /* eslint-disable no-console */\n if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'test') {\n console[method].call(null, message);\n }\n /* eslint-enable no-console */\n}\n\nfunction reject(array, callback) {\n if ( array === void 0 ) array = [];\n\n var results = [];\n array.forEach(function (itemInArray) {\n if (!callback(itemInArray)) {\n results.push(itemInArray);\n }\n });\n\n return results;\n}\n\nfunction filter(array, callback) {\n if ( array === void 0 ) array = [];\n\n var results = [];\n array.forEach(function (itemInArray) {\n if (callback(itemInArray)) {\n results.push(itemInArray);\n }\n });\n\n return results;\n}\n\n/*\n * EventTarget is an interface implemented by objects that can\n * receive events and may have listeners for them.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget\n */\nvar EventTarget = function EventTarget() {\n this.listeners = {};\n};\n\n/*\n * Ties a listener function to an event type which can later be invoked via the\n * dispatchEvent method.\n *\n * @param {string} type - the type of event (ie: 'open', 'message', etc.)\n * @param {function} listener - callback function to invoke when an event is dispatched matching the type\n * @param {boolean} useCapture - N/A TODO: implement useCapture functionality\n */\nEventTarget.prototype.addEventListener = function addEventListener (type, listener /* , useCapture */) {\n if (typeof listener === 'function') {\n if (!Array.isArray(this.listeners[type])) {\n this.listeners[type] = [];\n }\n\n // Only add the same function once\n if (filter(this.listeners[type], function (item) { return item === listener; }).length === 0) {\n this.listeners[type].push(listener);\n }\n }\n};\n\n/*\n * Removes the listener so it will no longer be invoked via the dispatchEvent method.\n *\n * @param {string} type - the type of event (ie: 'open', 'message', etc.)\n * @param {function} listener - callback function to invoke when an event is dispatched matching the type\n * @param {boolean} useCapture - N/A TODO: implement useCapture functionality\n */\nEventTarget.prototype.removeEventListener = function removeEventListener (type, removingListener /* , useCapture */) {\n var arrayOfListeners = this.listeners[type];\n this.listeners[type] = reject(arrayOfListeners, function (listener) { return listener === removingListener; });\n};\n\n/*\n * Invokes all listener functions that are listening to the given event.type property. Each\n * listener will be passed the event as the first argument.\n *\n * @param {object} event - event object which will be passed to all listeners of the event.type property\n */\nEventTarget.prototype.dispatchEvent = function dispatchEvent (event) {\n var this$1 = this;\n var customArguments = [], len = arguments.length - 1;\n while ( len-- > 0 ) customArguments[ len ] = arguments[ len + 1 ];\n\n var eventName = event.type;\n var listeners = this.listeners[eventName];\n\n if (!Array.isArray(listeners)) {\n return false;\n }\n\n listeners.forEach(function (listener) {\n if (customArguments.length > 0) {\n listener.apply(this$1, customArguments);\n } else {\n listener.call(this$1, event);\n }\n });\n\n return true;\n};\n\nfunction trimQueryPartFromURL(url) {\n var queryIndex = url.indexOf('?');\n return queryIndex >= 0 ? url.slice(0, queryIndex) : url;\n}\n\n/*\n * The network bridge is a way for the mock websocket object to 'communicate' with\n * all available servers. This is a singleton object so it is important that you\n * clean up urlMap whenever you are finished.\n */\nvar NetworkBridge = function NetworkBridge() {\n this.urlMap = {};\n};\n\n/*\n * Attaches a websocket object to the urlMap hash so that it can find the server\n * it is connected to and the server in turn can find it.\n *\n * @param {object} websocket - websocket object to add to the urlMap hash\n * @param {string} url\n */\nNetworkBridge.prototype.attachWebSocket = function attachWebSocket (websocket, url) {\n var serverURL = trimQueryPartFromURL(url);\n var connectionLookup = this.urlMap[serverURL];\n\n if (connectionLookup && connectionLookup.server && connectionLookup.websockets.indexOf(websocket) === -1) {\n connectionLookup.websockets.push(websocket);\n return connectionLookup.server;\n }\n};\n\n/*\n * Attaches a websocket to a room\n */\nNetworkBridge.prototype.addMembershipToRoom = function addMembershipToRoom (websocket, room) {\n var connectionLookup = this.urlMap[trimQueryPartFromURL(websocket.url)];\n\n if (connectionLookup && connectionLookup.server && connectionLookup.websockets.indexOf(websocket) !== -1) {\n if (!connectionLookup.roomMemberships[room]) {\n connectionLookup.roomMemberships[room] = [];\n }\n\n connectionLookup.roomMemberships[room].push(websocket);\n }\n};\n\n/*\n * Attaches a server object to the urlMap hash so that it can find a websockets\n * which are connected to it and so that websockets can in turn can find it.\n *\n * @param {object} server - server object to add to the urlMap hash\n * @param {string} url\n */\nNetworkBridge.prototype.attachServer = function attachServer (server, url) {\n var serverUrl = trimQueryPartFromURL(url);\n var connectionLookup = this.urlMap[serverUrl];\n\n if (!connectionLookup) {\n this.urlMap[serverUrl] = {\n server: server,\n websockets: [],\n roomMemberships: {}\n };\n\n return server;\n }\n};\n\n/*\n * Finds the server which is 'running' on the given url.\n *\n * @param {string} url - the url to use to find which server is running on it\n */\nNetworkBridge.prototype.serverLookup = function serverLookup (url) {\n var serverURL = trimQueryPartFromURL(url);\n var connectionLookup = this.urlMap[serverURL];\n\n if (connectionLookup) {\n return connectionLookup.server;\n }\n};\n\n/*\n * Finds all websockets which is 'listening' on the given url.\n *\n * @param {string} url - the url to use to find all websockets which are associated with it\n * @param {string} room - if a room is provided, will only return sockets in this room\n * @param {class} broadcaster - socket that is broadcasting and is to be excluded from the lookup\n */\nNetworkBridge.prototype.websocketsLookup = function websocketsLookup (url, room, broadcaster) {\n var serverURL = trimQueryPartFromURL(url);\n var websockets;\n var connectionLookup = this.urlMap[serverURL];\n\n websockets = connectionLookup ? connectionLookup.websockets : [];\n\n if (room) {\n var members = connectionLookup.roomMemberships[room];\n websockets = members || [];\n }\n\n return broadcaster ? websockets.filter(function (websocket) { return websocket !== broadcaster; }) : websockets;\n};\n\n/*\n * Removes the entry associated with the url.\n *\n * @param {string} url\n */\nNetworkBridge.prototype.removeServer = function removeServer (url) {\n delete this.urlMap[trimQueryPartFromURL(url)];\n};\n\n/*\n * Removes the individual websocket from the map of associated websockets.\n *\n * @param {object} websocket - websocket object to remove from the url map\n * @param {string} url\n */\nNetworkBridge.prototype.removeWebSocket = function removeWebSocket (websocket, url) {\n var serverURL = trimQueryPartFromURL(url);\n var connectionLookup = this.urlMap[serverURL];\n\n if (connectionLookup) {\n connectionLookup.websockets = reject(connectionLookup.websockets, function (socket) { return socket === websocket; });\n }\n};\n\n/*\n * Removes a websocket from a room\n */\nNetworkBridge.prototype.removeMembershipFromRoom = function removeMembershipFromRoom (websocket, room) {\n var connectionLookup = this.urlMap[trimQueryPartFromURL(websocket.url)];\n var memberships = connectionLookup.roomMemberships[room];\n\n if (connectionLookup && memberships !== null) {\n connectionLookup.roomMemberships[room] = reject(memberships, function (socket) { return socket === websocket; });\n }\n};\n\nvar networkBridge = new NetworkBridge(); // Note: this is a singleton\n\n/*\n * https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent\n */\nvar CLOSE_CODES = {\n CLOSE_NORMAL: 1000,\n CLOSE_GOING_AWAY: 1001,\n CLOSE_PROTOCOL_ERROR: 1002,\n CLOSE_UNSUPPORTED: 1003,\n CLOSE_NO_STATUS: 1005,\n CLOSE_ABNORMAL: 1006,\n UNSUPPORTED_DATA: 1007,\n POLICY_VIOLATION: 1008,\n CLOSE_TOO_LARGE: 1009,\n MISSING_EXTENSION: 1010,\n INTERNAL_ERROR: 1011,\n SERVICE_RESTART: 1012,\n TRY_AGAIN_LATER: 1013,\n TLS_HANDSHAKE: 1015\n};\n\nvar ERROR_PREFIX = {\n CONSTRUCTOR_ERROR: \"Failed to construct 'WebSocket':\",\n CLOSE_ERROR: \"Failed to execute 'close' on 'WebSocket':\",\n EVENT: {\n CONSTRUCT: \"Failed to construct 'Event':\",\n MESSAGE: \"Failed to construct 'MessageEvent':\",\n CLOSE: \"Failed to construct 'CloseEvent':\"\n }\n};\n\nvar EventPrototype = function EventPrototype () {};\n\nEventPrototype.prototype.stopPropagation = function stopPropagation () {};\nEventPrototype.prototype.stopImmediatePropagation = function stopImmediatePropagation () {};\n\n// if no arguments are passed then the type is set to \"undefined\" on\n// chrome and safari.\nEventPrototype.prototype.initEvent = function initEvent (type, bubbles, cancelable) {\n if ( type === void 0 ) type = 'undefined';\n if ( bubbles === void 0 ) bubbles = false;\n if ( cancelable === void 0 ) cancelable = false;\n\n this.type = \"\" + type;\n this.bubbles = Boolean(bubbles);\n this.cancelable = Boolean(cancelable);\n};\n\nvar Event = (function (EventPrototype$$1) {\n function Event(type, eventInitConfig) {\n if ( eventInitConfig === void 0 ) eventInitConfig = {};\n\n EventPrototype$$1.call(this);\n\n if (!type) {\n throw new TypeError(((ERROR_PREFIX.EVENT_ERROR) + \" 1 argument required, but only 0 present.\"));\n }\n\n if (typeof eventInitConfig !== 'object') {\n throw new TypeError(((ERROR_PREFIX.EVENT_ERROR) + \" parameter 2 ('eventInitDict') is not an object.\"));\n }\n\n var bubbles = eventInitConfig.bubbles;\n var cancelable = eventInitConfig.cancelable;\n\n this.type = \"\" + type;\n this.timeStamp = Date.now();\n this.target = null;\n this.srcElement = null;\n this.returnValue = true;\n this.isTrusted = false;\n this.eventPhase = 0;\n this.defaultPrevented = false;\n this.currentTarget = null;\n this.cancelable = cancelable ? Boolean(cancelable) : false;\n this.cancelBubble = false;\n this.bubbles = bubbles ? Boolean(bubbles) : false;\n }\n\n if ( EventPrototype$$1 ) Event.__proto__ = EventPrototype$$1;\n Event.prototype = Object.create( EventPrototype$$1 && EventPrototype$$1.prototype );\n Event.prototype.constructor = Event;\n\n return Event;\n}(EventPrototype));\n\nvar MessageEvent = (function (EventPrototype$$1) {\n function MessageEvent(type, eventInitConfig) {\n if ( eventInitConfig === void 0 ) eventInitConfig = {};\n\n EventPrototype$$1.call(this);\n\n if (!type) {\n throw new TypeError(((ERROR_PREFIX.EVENT.MESSAGE) + \" 1 argument required, but only 0 present.\"));\n }\n\n if (typeof eventInitConfig !== 'object') {\n throw new TypeError(((ERROR_PREFIX.EVENT.MESSAGE) + \" parameter 2 ('eventInitDict') is not an object\"));\n }\n\n var bubbles = eventInitConfig.bubbles;\n var cancelable = eventInitConfig.cancelable;\n var data = eventInitConfig.data;\n var origin = eventInitConfig.origin;\n var lastEventId = eventInitConfig.lastEventId;\n var ports = eventInitConfig.ports;\n\n this.type = \"\" + type;\n this.timeStamp = Date.now();\n this.target = null;\n this.srcElement = null;\n this.returnValue = true;\n this.isTrusted = false;\n this.eventPhase = 0;\n this.defaultPrevented = false;\n this.currentTarget = null;\n this.cancelable = cancelable ? Boolean(cancelable) : false;\n this.canncelBubble = false;\n this.bubbles = bubbles ? Boolean(bubbles) : false;\n this.origin = \"\" + origin;\n this.ports = typeof ports === 'undefined' ? null : ports;\n this.data = typeof data === 'undefined' ? null : data;\n this.lastEventId = \"\" + (lastEventId || '');\n }\n\n if ( EventPrototype$$1 ) MessageEvent.__proto__ = EventPrototype$$1;\n MessageEvent.prototype = Object.create( EventPrototype$$1 && EventPrototype$$1.prototype );\n MessageEvent.prototype.constructor = MessageEvent;\n\n return MessageEvent;\n}(EventPrototype));\n\nvar CloseEvent = (function (EventPrototype$$1) {\n function CloseEvent(type, eventInitConfig) {\n if ( eventInitConfig === void 0 ) eventInitConfig = {};\n\n EventPrototype$$1.call(this);\n\n if (!type) {\n throw new TypeError(((ERROR_PREFIX.EVENT.CLOSE) + \" 1 argument required, but only 0 present.\"));\n }\n\n if (typeof eventInitConfig !== 'object') {\n throw new TypeError(((ERROR_PREFIX.EVENT.CLOSE) + \" parameter 2 ('eventInitDict') is not an object\"));\n }\n\n var bubbles = eventInitConfig.bubbles;\n var cancelable = eventInitConfig.cancelable;\n var code = eventInitConfig.code;\n var reason = eventInitConfig.reason;\n var wasClean = eventInitConfig.wasClean;\n\n this.type = \"\" + type;\n this.timeStamp = Date.now();\n this.target = null;\n this.srcElement = null;\n this.returnValue = true;\n this.isTrusted = false;\n this.eventPhase = 0;\n this.defaultPrevented = false;\n this.currentTarget = null;\n this.cancelable = cancelable ? Boolean(cancelable) : false;\n this.cancelBubble = false;\n this.bubbles = bubbles ? Boolean(bubbles) : false;\n this.code = typeof code === 'number' ? parseInt(code, 10) : 0;\n this.reason = \"\" + (reason || '');\n this.wasClean = wasClean ? Boolean(wasClean) : false;\n }\n\n if ( EventPrototype$$1 ) CloseEvent.__proto__ = EventPrototype$$1;\n CloseEvent.prototype = Object.create( EventPrototype$$1 && EventPrototype$$1.prototype );\n CloseEvent.prototype.constructor = CloseEvent;\n\n return CloseEvent;\n}(EventPrototype));\n\n/*\n * Creates an Event object and extends it to allow full modification of\n * its properties.\n *\n * @param {object} config - within config you will need to pass type and optionally target\n */\nfunction createEvent(config) {\n var type = config.type;\n var target = config.target;\n var eventObject = new Event(type);\n\n if (target) {\n eventObject.target = target;\n eventObject.srcElement = target;\n eventObject.currentTarget = target;\n }\n\n return eventObject;\n}\n\n/*\n * Creates a MessageEvent object and extends it to allow full modification of\n * its properties.\n *\n * @param {object} config - within config: type, origin, data and optionally target\n */\nfunction createMessageEvent(config) {\n var type = config.type;\n var origin = config.origin;\n var data = config.data;\n var target = config.target;\n var messageEvent = new MessageEvent(type, {\n data: data,\n origin: origin\n });\n\n if (target) {\n messageEvent.target = target;\n messageEvent.srcElement = target;\n messageEvent.currentTarget = target;\n }\n\n return messageEvent;\n}\n\n/*\n * Creates a CloseEvent object and extends it to allow full modification of\n * its properties.\n *\n * @param {object} config - within config: type and optionally target, code, and reason\n */\nfunction createCloseEvent(config) {\n var code = config.code;\n var reason = config.reason;\n var type = config.type;\n var target = config.target;\n var wasClean = config.wasClean;\n\n if (!wasClean) {\n wasClean = code === CLOSE_CODES.CLOSE_NORMAL || code === CLOSE_CODES.CLOSE_NO_STATUS;\n }\n\n var closeEvent = new CloseEvent(type, {\n code: code,\n reason: reason,\n wasClean: wasClean\n });\n\n if (target) {\n closeEvent.target = target;\n closeEvent.srcElement = target;\n closeEvent.currentTarget = target;\n }\n\n return closeEvent;\n}\n\nfunction closeWebSocketConnection(context, code, reason) {\n context.readyState = WebSocket$1.CLOSING;\n\n var server = networkBridge.serverLookup(context.url);\n var closeEvent = createCloseEvent({\n type: 'close',\n target: context.target,\n code: code,\n reason: reason\n });\n\n delay(function () {\n networkBridge.removeWebSocket(context, context.url);\n\n context.readyState = WebSocket$1.CLOSED;\n context.dispatchEvent(closeEvent);\n\n if (server) {\n server.dispatchEvent(closeEvent, server);\n }\n }, context);\n}\n\nfunction failWebSocketConnection(context, code, reason) {\n context.readyState = WebSocket$1.CLOSING;\n\n var server = networkBridge.serverLookup(context.url);\n var closeEvent = createCloseEvent({\n type: 'close',\n target: context.target,\n code: code,\n reason: reason,\n wasClean: false\n });\n\n var errorEvent = createEvent({\n type: 'error',\n target: context.target\n });\n\n delay(function () {\n networkBridge.removeWebSocket(context, context.url);\n\n context.readyState = WebSocket$1.CLOSED;\n context.dispatchEvent(errorEvent);\n context.dispatchEvent(closeEvent);\n\n if (server) {\n server.dispatchEvent(closeEvent, server);\n }\n }, context);\n}\n\nfunction normalizeSendData(data) {\n if (Object.prototype.toString.call(data) !== '[object Blob]' && !(data instanceof ArrayBuffer)) {\n data = String(data);\n }\n\n return data;\n}\n\nvar proxies = new WeakMap();\n\nfunction proxyFactory(target) {\n if (proxies.has(target)) {\n return proxies.get(target);\n }\n\n var proxy = new Proxy(target, {\n get: function get(obj, prop) {\n if (prop === 'close') {\n return function close(options) {\n if ( options === void 0 ) options = {};\n\n var code = options.code || CLOSE_CODES.CLOSE_NORMAL;\n var reason = options.reason || '';\n\n closeWebSocketConnection(proxy, code, reason);\n };\n }\n\n if (prop === 'send') {\n return function send(data) {\n data = normalizeSendData(data);\n\n target.dispatchEvent(\n createMessageEvent({\n type: 'message',\n data: data,\n origin: this.url,\n target: target\n })\n );\n };\n }\n\n var toSocketName = function (type) { return (type === 'message' ? (\"server::\" + type) : type); };\n if (prop === 'on') {\n return function onWrapper(type, cb) {\n target.addEventListener(toSocketName(type), cb);\n };\n }\n if (prop === 'off') {\n return function offWrapper(type, cb) {\n target.removeEventListener(toSocketName(type), cb);\n };\n }\n\n if (prop === 'target') {\n return target;\n }\n\n return obj[prop];\n }\n });\n proxies.set(target, proxy);\n\n return proxy;\n}\n\nfunction lengthInUtf8Bytes(str) {\n // Matches only the 10.. bytes that are non-initial characters in a multi-byte sequence.\n var m = encodeURIComponent(str).match(/%[89ABab]/g);\n return str.length + (m ? m.length : 0);\n}\n\nfunction urlVerification(url) {\n var urlRecord = new urlParse(url);\n var pathname = urlRecord.pathname;\n var protocol = urlRecord.protocol;\n var hash = urlRecord.hash;\n\n if (!url) {\n throw new TypeError(((ERROR_PREFIX.CONSTRUCTOR_ERROR) + \" 1 argument required, but only 0 present.\"));\n }\n\n if (!pathname) {\n urlRecord.pathname = '/';\n }\n\n if (protocol === '') {\n throw new SyntaxError(((ERROR_PREFIX.CONSTRUCTOR_ERROR) + \" The URL '\" + (urlRecord.toString()) + \"' is invalid.\"));\n }\n\n if (protocol !== 'ws:' && protocol !== 'wss:') {\n throw new SyntaxError(\n ((ERROR_PREFIX.CONSTRUCTOR_ERROR) + \" The URL's scheme must be either 'ws' or 'wss'. '\" + protocol + \"' is not allowed.\")\n );\n }\n\n if (hash !== '') {\n /* eslint-disable max-len */\n throw new SyntaxError(\n ((ERROR_PREFIX.CONSTRUCTOR_ERROR) + \" The URL contains a fragment identifier ('\" + hash + \"'). Fragment identifiers are not allowed in WebSocket URLs.\")\n );\n /* eslint-enable max-len */\n }\n\n return urlRecord.toString();\n}\n\nfunction protocolVerification(protocols) {\n if ( protocols === void 0 ) protocols = [];\n\n if (!Array.isArray(protocols) && typeof protocols !== 'string') {\n throw new SyntaxError(((ERROR_PREFIX.CONSTRUCTOR_ERROR) + \" The subprotocol '\" + (protocols.toString()) + \"' is invalid.\"));\n }\n\n if (typeof protocols === 'string') {\n protocols = [protocols];\n }\n\n var uniq = protocols\n .map(function (p) { return ({ count: 1, protocol: p }); })\n .reduce(function (a, b) {\n a[b.protocol] = (a[b.protocol] || 0) + b.count;\n return a;\n }, {});\n\n var duplicates = Object.keys(uniq).filter(function (a) { return uniq[a] > 1; });\n\n if (duplicates.length > 0) {\n throw new SyntaxError(((ERROR_PREFIX.CONSTRUCTOR_ERROR) + \" The subprotocol '\" + (duplicates[0]) + \"' is duplicated.\"));\n }\n\n return protocols;\n}\n\n/*\n * The main websocket class which is designed to mimick the native WebSocket class as close\n * as possible.\n *\n * https://html.spec.whatwg.org/multipage/web-sockets.html\n */\nvar WebSocket$1 = (function (EventTarget$$1) {\n function WebSocket(url, protocols) {\n EventTarget$$1.call(this);\n\n this._onopen = null;\n this._onmessage = null;\n this._onerror = null;\n this._onclose = null;\n\n this.url = urlVerification(url);\n protocols = protocolVerification(protocols);\n this.protocol = protocols[0] || '';\n\n this.binaryType = 'blob';\n this.readyState = WebSocket.CONNECTING;\n\n var client = proxyFactory(this);\n var server = networkBridge.attachWebSocket(client, this.url);\n\n /*\n * This delay is needed so that we dont trigger an event before the callbacks have been\n * setup. For example:\n *\n * var socket = new WebSocket('ws://localhost');\n *\n * If we dont have the delay then the event would be triggered right here and this is\n * before the onopen had a chance to register itself.\n *\n * socket.onopen = () => { // this would never be called };\n *\n * and with the delay the event gets triggered here after all of the callbacks have been\n * registered :-)\n */\n delay(function delayCallback() {\n if (this.readyState !== WebSocket.CONNECTING) {\n return;\n }\n if (server) {\n if (\n server.options.verifyClient &&\n typeof server.options.verifyClient === 'function' &&\n !server.options.verifyClient()\n ) {\n this.readyState = WebSocket.CLOSED;\n\n log(\n 'error',\n (\"WebSocket connection to '\" + (this.url) + \"' failed: HTTP Authentication failed; no valid credentials available\")\n );\n\n networkBridge.removeWebSocket(client, this.url);\n this.dispatchEvent(createEvent({ type: 'error', target: this }));\n this.dispatchEvent(createCloseEvent({ type: 'close', target: this, code: CLOSE_CODES.CLOSE_NORMAL }));\n } else {\n if (server.options.selectProtocol && typeof server.options.selectProtocol === 'function') {\n var selectedProtocol = server.options.selectProtocol(protocols);\n var isFilled = selectedProtocol !== '';\n var isRequested = protocols.indexOf(selectedProtocol) !== -1;\n if (isFilled && !isRequested) {\n this.readyState = WebSocket.CLOSED;\n\n log('error', (\"WebSocket connection to '\" + (this.url) + \"' failed: Invalid Sub-Protocol\"));\n\n networkBridge.removeWebSocket(client, this.url);\n this.dispatchEvent(createEvent({ type: 'error', target: this }));\n this.dispatchEvent(createCloseEvent({ type: 'close', target: this, code: CLOSE_CODES.CLOSE_NORMAL }));\n return;\n }\n this.protocol = selectedProtocol;\n }\n this.readyState = WebSocket.OPEN;\n this.dispatchEvent(createEvent({ type: 'open', target: this }));\n server.dispatchEvent(createEvent({ type: 'connection' }), client);\n }\n } else {\n this.readyState = WebSocket.CLOSED;\n this.dispatchEvent(createEvent({ type: 'error', target: this }));\n this.dispatchEvent(createCloseEvent({ type: 'close', target: this, code: CLOSE_CODES.CLOSE_NORMAL }));\n\n log('error', (\"WebSocket connection to '\" + (this.url) + \"' failed\"));\n }\n }, this);\n }\n\n if ( EventTarget$$1 ) WebSocket.__proto__ = EventTarget$$1;\n WebSocket.prototype = Object.create( EventTarget$$1 && EventTarget$$1.prototype );\n WebSocket.prototype.constructor = WebSocket;\n\n var prototypeAccessors = { onopen: {},onmessage: {},onclose: {},onerror: {} };\n\n prototypeAccessors.onopen.get = function () {\n return this._onopen;\n };\n\n prototypeAccessors.onmessage.get = function () {\n return this._onmessage;\n };\n\n prototypeAccessors.onclose.get = function () {\n return this._onclose;\n };\n\n prototypeAccessors.onerror.get = function () {\n return this._onerror;\n };\n\n prototypeAccessors.onopen.set = function (listener) {\n this.removeEventListener('open', this._onopen);\n this._onopen = listener;\n this.addEventListener('open', listener);\n };\n\n prototypeAccessors.onmessage.set = function (listener) {\n this.removeEventListener('message', this._onmessage);\n this._onmessage = listener;\n this.addEventListener('message', listener);\n };\n\n prototypeAccessors.onclose.set = function (listener) {\n this.removeEventListener('close', this._onclose);\n this._onclose = listener;\n this.addEventListener('close', listener);\n };\n\n prototypeAccessors.onerror.set = function (listener) {\n this.removeEventListener('error', this._onerror);\n this._onerror = listener;\n this.addEventListener('error', listener);\n };\n\n WebSocket.prototype.send = function send (data) {\n var this$1 = this;\n\n if (this.readyState === WebSocket.CONNECTING) {\n // TODO: node>=17 replace with DOMException\n throw new Error(\"Failed to execute 'send' on 'WebSocket': Still in CONNECTING state\");\n }\n\n // TODO: handle bufferedAmount\n\n var messageEvent = createMessageEvent({\n type: 'server::message',\n origin: this.url,\n data: normalizeSendData(data)\n });\n\n var server = networkBridge.serverLookup(this.url);\n\n if (server) {\n delay(function () {\n this$1.dispatchEvent(messageEvent, data);\n }, server);\n }\n };\n\n WebSocket.prototype.close = function close (code, reason) {\n if (code !== undefined) {\n if (typeof code !== 'number' || (code !== 1000 && (code < 3000 || code > 4999))) {\n throw new TypeError(\n ((ERROR_PREFIX.CLOSE_ERROR) + \" The code must be either 1000, or between 3000 and 4999. \" + code + \" is neither.\")\n );\n }\n }\n\n if (reason !== undefined) {\n var length = lengthInUtf8Bytes(reason);\n\n if (length > 123) {\n throw new SyntaxError(((ERROR_PREFIX.CLOSE_ERROR) + \" The message must not be greater than 123 bytes.\"));\n }\n }\n\n if (this.readyState === WebSocket.CLOSING || this.readyState === WebSocket.CLOSED) {\n return;\n }\n\n var client = proxyFactory(this);\n if (this.readyState === WebSocket.CONNECTING) {\n failWebSocketConnection(client, code || CLOSE_CODES.CLOSE_ABNORMAL, reason);\n } else {\n closeWebSocketConnection(client, code || CLOSE_CODES.CLOSE_NO_STATUS, reason);\n }\n };\n\n Object.defineProperties( WebSocket.prototype, prototypeAccessors );\n\n return WebSocket;\n}(EventTarget));\n\nWebSocket$1.CONNECTING = 0;\nWebSocket$1.prototype.CONNECTING = WebSocket$1.CONNECTING;\nWebSocket$1.OPEN = 1;\nWebSocket$1.prototype.OPEN = WebSocket$1.OPEN;\nWebSocket$1.CLOSING = 2;\nWebSocket$1.prototype.CLOSING = WebSocket$1.CLOSING;\nWebSocket$1.CLOSED = 3;\nWebSocket$1.prototype.CLOSED = WebSocket$1.CLOSED;\n\n/*\n * The socket-io class is designed to mimick the real API as closely as possible.\n *\n * http://socket.io/docs/\n */\nvar SocketIO$1 = (function (EventTarget$$1) {\n function SocketIO(url, protocol) {\n var this$1 = this;\n if ( url === void 0 ) url = 'socket.io';\n if ( protocol === void 0 ) protocol = '';\n\n EventTarget$$1.call(this);\n\n this.binaryType = 'blob';\n var urlRecord = new urlParse(url);\n\n if (!urlRecord.pathname) {\n urlRecord.pathname = '/';\n }\n\n this.url = urlRecord.toString();\n this.readyState = SocketIO.CONNECTING;\n this.protocol = '';\n this.target = this;\n\n if (typeof protocol === 'string' || (typeof protocol === 'object' && protocol !== null)) {\n this.protocol = protocol;\n } else if (Array.isArray(protocol) && protocol.length > 0) {\n this.protocol = protocol[0];\n }\n\n var server = networkBridge.attachWebSocket(this, this.url);\n\n /*\n * Delay triggering the connection events so they can be defined in time.\n */\n delay(function delayCallback() {\n if (server) {\n this.readyState = SocketIO.OPEN;\n server.dispatchEvent(createEvent({ type: 'connection' }), server, this);\n server.dispatchEvent(createEvent({ type: 'connect' }), server, this); // alias\n this.dispatchEvent(createEvent({ type: 'connect', target: this }));\n } else {\n this.readyState = SocketIO.CLOSED;\n this.dispatchEvent(createEvent({ type: 'error', target: this }));\n this.dispatchEvent(\n createCloseEvent({\n type: 'close',\n target: this,\n code: CLOSE_CODES.CLOSE_NORMAL\n })\n );\n\n log('error', (\"Socket.io connection to '\" + (this.url) + \"' failed\"));\n }\n }, this);\n\n /**\n Add an aliased event listener for close / disconnect\n */\n this.addEventListener('close', function (event) {\n this$1.dispatchEvent(\n createCloseEvent({\n type: 'disconnect',\n target: event.target,\n code: event.code\n })\n );\n });\n }\n\n if ( EventTarget$$1 ) SocketIO.__proto__ = EventTarget$$1;\n SocketIO.prototype = Object.create( EventTarget$$1 && EventTarget$$1.prototype );\n SocketIO.prototype.constructor = SocketIO;\n\n var prototypeAccessors = { broadcast: {} };\n\n /*\n * Closes the SocketIO connection or connection attempt, if any.\n * If the connection is already CLOSED, this method does nothing.\n */\n SocketIO.prototype.close = function close () {\n if (this.readyState !== SocketIO.OPEN) {\n return undefined;\n }\n\n var server = networkBridge.serverLookup(this.url);\n networkBridge.removeWebSocket(this, this.url);\n\n this.readyState = SocketIO.CLOSED;\n this.dispatchEvent(\n createCloseEvent({\n type: 'close',\n target: this,\n code: CLOSE_CODES.CLOSE_NORMAL\n })\n );\n\n if (server) {\n server.dispatchEvent(\n createCloseEvent({\n type: 'disconnect',\n target: this,\n code: CLOSE_CODES.CLOSE_NORMAL\n }),\n server\n );\n }\n\n return this;\n };\n\n /*\n * Alias for Socket#close\n *\n * https://github.com/socketio/socket.io-client/blob/master/lib/socket.js#L383\n */\n SocketIO.prototype.disconnect = function disconnect () {\n return this.close();\n };\n\n /*\n * Submits an event to the server with a payload\n */\n SocketIO.prototype.emit = function emit (event) {\n var data = [], len = arguments.length - 1;\n while ( len-- > 0 ) data[ len ] = arguments[ len + 1 ];\n\n if (this.readyState !== SocketIO.OPEN) {\n throw new Error('SocketIO is already in CLOSING or CLOSED state');\n }\n\n var messageEvent = createMessageEvent({\n type: event,\n origin: this.url,\n data: data\n });\n\n var server = networkBridge.serverLookup(this.url);\n\n if (server) {\n server.dispatchEvent.apply(server, [ messageEvent ].concat( data ));\n }\n\n return this;\n };\n\n /*\n * Submits a 'message' event to the server.\n *\n * Should behave exactly like WebSocket#send\n *\n * https://github.com/socketio/socket.io-client/blob/master/lib/socket.js#L113\n */\n SocketIO.prototype.send = function send (data) {\n this.emit('message', data);\n return this;\n };\n\n /*\n * For broadcasting events to other connected sockets.\n *\n * e.g. socket.broadcast.emit('hi!');\n * e.g. socket.broadcast.to('my-room').emit('hi!');\n */\n prototypeAccessors.broadcast.get = function () {\n if (this.readyState !== SocketIO.OPEN) {\n throw new Error('SocketIO is already in CLOSING or CLOSED state');\n }\n\n var self = this;\n var server = networkBridge.serverLookup(this.url);\n if (!server) {\n throw new Error((\"SocketIO can not find a server at the specified URL (\" + (this.url) + \")\"));\n }\n\n return {\n emit: function emit(event, data) {\n server.emit(event, data, { websockets: networkBridge.websocketsLookup(self.url, null, self) });\n return self;\n },\n to: function to(room) {\n return server.to(room, self);\n },\n in: function in$1(room) {\n return server.in(room, self);\n }\n };\n };\n\n /*\n * For registering events to be received from the server\n */\n SocketIO.prototype.on = function on (type, callback) {\n this.addEventListener(type, callback);\n return this;\n };\n\n /*\n * Remove event listener\n *\n * https://github.com/component/emitter#emitteroffevent-fn\n */\n SocketIO.prototype.off = function off (type, callback) {\n this.removeEventListener(type, callback);\n };\n\n /*\n * Check if listeners have already been added for an event\n *\n * https://github.com/component/emitter#emitterhaslistenersevent\n */\n SocketIO.prototype.hasListeners = function hasListeners (type) {\n var listeners = this.listeners[type];\n if (!Array.isArray(listeners)) {\n return false;\n }\n return !!listeners.length;\n };\n\n /*\n * Join a room on a server\n *\n * http://socket.io/docs/rooms-and-namespaces/#joining-and-leaving\n */\n SocketIO.prototype.join = function join (room) {\n networkBridge.addMembershipToRoom(this, room);\n };\n\n /*\n * Get the websocket to leave the room\n *\n * http://socket.io/docs/rooms-and-namespaces/#joining-and-leaving\n */\n SocketIO.prototype.leave = function leave (room) {\n networkBridge.removeMembershipFromRoom(this, room);\n };\n\n SocketIO.prototype.to = function to (room) {\n return this.broadcast.to(room);\n };\n\n SocketIO.prototype.in = function in$1 () {\n return this.to.apply(null, arguments);\n };\n\n /*\n * Invokes all listener functions that are listening to the given event.type property. Each\n * listener will be passed the event as the first argument.\n *\n * @param {object} event - event object which will be passed to all listeners of the event.type property\n */\n SocketIO.prototype.dispatchEvent = function dispatchEvent (event) {\n var this$1 = this;\n var customArguments = [], len = arguments.length - 1;\n while ( len-- > 0 ) customArguments[ len ] = arguments[ len + 1 ];\n\n var eventName = event.type;\n var listeners = this.listeners[eventName];\n\n if (!Array.isArray(listeners)) {\n return false;\n }\n\n listeners.forEach(function (listener) {\n if (customArguments.length > 0) {\n listener.apply(this$1, customArguments);\n } else {\n // Regular WebSockets expect a MessageEvent but Socketio.io just wants raw data\n // payload instanceof MessageEvent works, but you can't isntance of NodeEvent\n // for now we detect if the output has data defined on it\n listener.call(this$1, event.data ? event.data : event);\n }\n });\n };\n\n Object.defineProperties( SocketIO.prototype, prototypeAccessors );\n\n return SocketIO;\n}(EventTarget));\n\nSocketIO$1.CONNECTING = 0;\nSocketIO$1.OPEN = 1;\nSocketIO$1.CLOSING = 2;\nSocketIO$1.CLOSED = 3;\n\n/*\n * Static constructor methods for the IO Socket\n */\nvar IO = function ioConstructor(url, protocol) {\n return new SocketIO$1(url, protocol);\n};\n\n/*\n * Alias the raw IO() constructor\n */\nIO.connect = function ioConnect(url, protocol) {\n /* eslint-disable new-cap */\n return IO(url, protocol);\n /* eslint-enable new-cap */\n};\n\nvar dedupe = function (arr) { return arr.reduce(function (deduped, b) {\n if (deduped.indexOf(b) > -1) { return deduped; }\n return deduped.concat(b);\n }, []); };\n\nfunction retrieveGlobalObject() {\n if (typeof window !== 'undefined') {\n return window;\n }\n\n return typeof process === 'object' && typeof require === 'function' && typeof global === 'object' ? global : this;\n}\n\nvar defaultOptions = {\n mock: true,\n verifyClient: null,\n selectProtocol: null\n};\n\nvar Server$1 = (function (EventTarget$$1) {\n function Server(url, options) {\n if ( options === void 0 ) options = defaultOptions;\n\n EventTarget$$1.call(this);\n var urlRecord = new urlParse(url);\n\n if (!urlRecord.pathname) {\n urlRecord.pathname = '/';\n }\n\n this.url = urlRecord.toString();\n\n this.originalWebSocket = null;\n var server = networkBridge.attachServer(this, this.url);\n\n if (!server) {\n this.dispatchEvent(createEvent({ type: 'error' }));\n throw new Error('A mock server is already listening on this url');\n }\n\n this.options = Object.assign({}, defaultOptions, options);\n\n if (this.options.mock) {\n this.mockWebsocket();\n }\n }\n\n if ( EventTarget$$1 ) Server.__proto__ = EventTarget$$1;\n Server.prototype = Object.create( EventTarget$$1 && EventTarget$$1.prototype );\n Server.prototype.constructor = Server;\n\n /*\n * Attaches the mock websocket object to the global object\n */\n Server.prototype.mockWebsocket = function mockWebsocket () {\n var globalObj = retrieveGlobalObject();\n\n this.originalWebSocket = globalObj.WebSocket;\n globalObj.WebSocket = WebSocket$1;\n };\n\n /*\n * Removes the mock websocket object from the global object\n */\n Server.prototype.restoreWebsocket = function restoreWebsocket () {\n var globalObj = retrieveGlobalObject();\n\n if (this.originalWebSocket !== null) {\n globalObj.WebSocket = this.originalWebSocket;\n }\n\n this.originalWebSocket = null;\n };\n\n /**\n * Removes itself from the urlMap so another server could add itself to the url.\n * @param {function} callback - The callback is called when the server is stopped\n */\n Server.prototype.stop = function stop (callback) {\n if ( callback === void 0 ) callback = function () {};\n\n if (this.options.mock) {\n this.restoreWebsocket();\n }\n\n networkBridge.removeServer(this.url);\n\n if (typeof callback === 'function') {\n callback();\n }\n };\n\n /*\n * This is the main function for the mock server to subscribe to the on events.\n *\n * ie: mockServer.on('connection', function() { console.log('a mock client connected'); });\n *\n * @param {string} type - The event key to subscribe to. Valid keys are: connection, message, and close.\n * @param {function} callback - The callback which should be called when a certain event is fired.\n */\n Server.prototype.on = function on (type, callback) {\n this.addEventListener(type, callback);\n };\n\n /*\n * Remove event listener\n */\n Server.prototype.off = function off (type, callback) {\n this.removeEventListener(type, callback);\n };\n\n /*\n * Closes the connection and triggers the onclose method of all listening\n * websockets. After that it removes itself from the urlMap so another server\n * could add itself to the url.\n *\n * @param {object} options\n */\n Server.prototype.close = function close (options) {\n if ( options === void 0 ) options = {};\n\n var code = options.code;\n var reason = options.reason;\n var wasClean = options.wasClean;\n var listeners = networkBridge.websocketsLookup(this.url);\n\n // Remove server before notifications to prevent immediate reconnects from\n // socket onclose handlers\n networkBridge.removeServer(this.url);\n\n listeners.forEach(function (socket) {\n socket.readyState = WebSocket$1.CLOSED;\n socket.dispatchEvent(\n createCloseEvent({\n type: 'close',\n target: socket.target,\n code: code || CLOSE_CODES.CLOSE_NORMAL,\n reason: reason || '',\n wasClean: wasClean\n })\n );\n });\n\n this.dispatchEvent(createCloseEvent({ type: 'close' }), this);\n };\n\n /*\n * Sends a generic message event to all mock clients.\n */\n Server.prototype.emit = function emit (event, data, options) {\n var this$1 = this;\n if ( options === void 0 ) options = {};\n\n var websockets = options.websockets;\n\n if (!websockets) {\n websockets = networkBridge.websocketsLookup(this.url);\n }\n\n var normalizedData;\n if (typeof options !== 'object' || arguments.length > 3) {\n data = Array.prototype.slice.call(arguments, 1, arguments.length);\n normalizedData = data.map(function (item) { return normalizeSendData(item); });\n } else {\n normalizedData = normalizeSendData(data);\n }\n\n websockets.forEach(function (socket) {\n var messageData = socket instanceof SocketIO$1 ? data : normalizedData;\n if (Array.isArray(messageData)) {\n socket.dispatchEvent.apply(\n socket, [ createMessageEvent({\n type: event,\n data: messageData,\n origin: this$1.url,\n target: socket.target\n }) ].concat( messageData )\n );\n } else {\n socket.dispatchEvent(\n createMessageEvent({\n type: event,\n data: messageData,\n origin: this$1.url,\n target: socket.target\n })\n );\n }\n });\n };\n\n /*\n * Returns an array of websockets which are listening to this server\n * TOOD: this should return a set and not be a method\n */\n Server.prototype.clients = function clients () {\n return networkBridge.websocketsLookup(this.url);\n };\n\n /*\n * Prepares a method to submit an event to members of the room\n *\n * e.g. server.to('my-room').emit('hi!');\n */\n Server.prototype.to = function to (room, broadcaster, broadcastList) {\n var this$1 = this;\n if ( broadcastList === void 0 ) broadcastList = [];\n\n var self = this;\n var websockets = dedupe(broadcastList.concat(networkBridge.websocketsLookup(this.url, room, broadcaster)));\n\n return {\n to: function (chainedRoom, chainedBroadcaster) { return this$1.to.call(this$1, chainedRoom, chainedBroadcaster, websockets); },\n emit: function emit(event, data) {\n self.emit(event, data, { websockets: websockets });\n }\n };\n };\n\n /*\n * Alias for Server.to\n */\n Server.prototype.in = function in$1 () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return this.to.apply(null, args);\n };\n\n /*\n * Simulate an event from the server to the clients. Useful for\n * simulating errors.\n */\n Server.prototype.simulate = function simulate (event) {\n var listeners = networkBridge.websocketsLookup(this.url);\n\n if (event === 'error') {\n listeners.forEach(function (socket) {\n socket.readyState = WebSocket$1.CLOSED;\n socket.dispatchEvent(createEvent({ type: 'error', target: socket.target }));\n });\n }\n };\n\n return Server;\n}(EventTarget));\n\n/*\n * Alternative constructor to support namespaces in socket.io\n *\n * http://socket.io/docs/rooms-and-namespaces/#custom-namespaces\n */\nServer$1.of = function of(url) {\n return new Server$1(url);\n};\n\nvar Server = Server$1;\nvar WebSocket = WebSocket$1;\nvar SocketIO$$1 = IO;\n\nexports.Server = Server;\nexports.WebSocket = WebSocket;\nexports.SocketIO = SocketIO$$1;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","// 'path' module extracted from Node.js v8.11.1 (only the posix part)\n// transplited with Babel\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nfunction assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));\n }\n}\n\n// Resolves . and .. elements in a path with directory names\nfunction normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n\nfunction _format(sep, pathObject) {\n var dir = pathObject.dir || pathObject.root;\n var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');\n if (!dir) {\n return base;\n }\n if (dir === pathObject.root) {\n return dir + base;\n }\n return dir + sep + base;\n}\n\nvar posix = {\n // path.resolve([from ...], to)\n resolve: function resolve() {\n var resolvedPath = '';\n var resolvedAbsolute = false;\n var cwd;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path;\n if (i >= 0)\n path = arguments[i];\n else {\n if (cwd === undefined)\n cwd = process.cwd();\n path = cwd;\n }\n\n assertPath(path);\n\n // Skip empty entries\n if (path.length === 0) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);\n\n if (resolvedAbsolute) {\n if (resolvedPath.length > 0)\n return '/' + resolvedPath;\n else\n return '/';\n } else if (resolvedPath.length > 0) {\n return resolvedPath;\n } else {\n return '.';\n }\n },\n\n normalize: function normalize(path) {\n assertPath(path);\n\n if (path.length === 0) return '.';\n\n var isAbsolute = path.charCodeAt(0) === 47 /*/*/;\n var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;\n\n // Normalize the path\n path = normalizeStringPosix(path, !isAbsolute);\n\n if (path.length === 0 && !isAbsolute) path = '.';\n if (path.length > 0 && trailingSeparator) path += '/';\n\n if (isAbsolute) return '/' + path;\n return path;\n },\n\n isAbsolute: function isAbsolute(path) {\n assertPath(path);\n return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;\n },\n\n join: function join() {\n if (arguments.length === 0)\n return '.';\n var joined;\n for (var i = 0; i < arguments.length; ++i) {\n var arg = arguments[i];\n assertPath(arg);\n if (arg.length > 0) {\n if (joined === undefined)\n joined = arg;\n else\n joined += '/' + arg;\n }\n }\n if (joined === undefined)\n return '.';\n return posix.normalize(joined);\n },\n\n relative: function relative(from, to) {\n assertPath(from);\n assertPath(to);\n\n if (from === to) return '';\n\n from = posix.resolve(from);\n to = posix.resolve(to);\n\n if (from === to) return '';\n\n // Trim any leading backslashes\n var fromStart = 1;\n for (; fromStart < from.length; ++fromStart) {\n if (from.charCodeAt(fromStart) !== 47 /*/*/)\n break;\n }\n var fromEnd = from.length;\n var fromLen = fromEnd - fromStart;\n\n // Trim any leading backslashes\n var toStart = 1;\n for (; toStart < to.length; ++toStart) {\n if (to.charCodeAt(toStart) !== 47 /*/*/)\n break;\n }\n var toEnd = to.length;\n var toLen = toEnd - toStart;\n\n // Compare paths to find the longest common path from root\n var length = fromLen < toLen ? fromLen : toLen;\n var lastCommonSep = -1;\n var i = 0;\n for (; i <= length; ++i) {\n if (i === length) {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === 47 /*/*/) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='/foo/bar'; to='/foo/bar/baz'\n return to.slice(toStart + i + 1);\n } else if (i === 0) {\n // We get here if `from` is the root\n // For example: from='/'; to='/foo'\n return to.slice(toStart + i);\n }\n } else if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === 47 /*/*/) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='/foo/bar/baz'; to='/foo/bar'\n lastCommonSep = i;\n } else if (i === 0) {\n // We get here if `to` is the root.\n // For example: from='/foo'; to='/'\n lastCommonSep = 0;\n }\n }\n break;\n }\n var fromCode = from.charCodeAt(fromStart + i);\n var toCode = to.charCodeAt(toStart + i);\n if (fromCode !== toCode)\n break;\n else if (fromCode === 47 /*/*/)\n lastCommonSep = i;\n }\n\n var out = '';\n // Generate the relative path based on the path difference between `to`\n // and `from`\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {\n if (out.length === 0)\n out += '..';\n else\n out += '/..';\n }\n }\n\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts\n if (out.length > 0)\n return out + to.slice(toStart + lastCommonSep);\n else {\n toStart += lastCommonSep;\n if (to.charCodeAt(toStart) === 47 /*/*/)\n ++toStart;\n return to.slice(toStart);\n }\n },\n\n _makeLong: function _makeLong(path) {\n return path;\n },\n\n dirname: function dirname(path) {\n assertPath(path);\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) return '//';\n return path.slice(0, end);\n },\n\n basename: function basename(path, ext) {\n if (ext !== undefined && typeof ext !== 'string') throw new TypeError('\"ext\" argument must be a string');\n assertPath(path);\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n if (ext.length === path.length && ext === path) return '';\n var extIdx = ext.length - 1;\n var firstNonSlashEnd = -1;\n for (i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else {\n if (firstNonSlashEnd === -1) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching\n matchedSlash = false;\n firstNonSlashEnd = i + 1;\n }\n if (extIdx >= 0) {\n // Try to match the explicit extension\n if (code === ext.charCodeAt(extIdx)) {\n if (--extIdx === -1) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = i;\n }\n } else {\n // Extension does not match, so our result is the entire path\n // component\n extIdx = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n\n if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;\n return path.slice(start, end);\n } else {\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n }\n },\n\n extname: function extname(path) {\n assertPath(path);\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n },\n\n format: function format(pathObject) {\n if (pathObject === null || typeof pathObject !== 'object') {\n throw new TypeError('The \"pathObject\" argument must be of type Object. Received type ' + typeof pathObject);\n }\n return _format('/', pathObject);\n },\n\n parse: function parse(path) {\n assertPath(path);\n\n var ret = { root: '', dir: '', base: '', ext: '', name: '' };\n if (path.length === 0) return ret;\n var code = path.charCodeAt(0);\n var isAbsolute = code === 47 /*/*/;\n var start;\n if (isAbsolute) {\n ret.root = '/';\n start = 1;\n } else {\n start = 0;\n }\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n var i = path.length - 1;\n\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n\n // Get non-dir info\n for (; i >= start; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n if (end !== -1) {\n if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);\n }\n } else {\n if (startPart === 0 && isAbsolute) {\n ret.name = path.slice(1, startDot);\n ret.base = path.slice(1, end);\n } else {\n ret.name = path.slice(startPart, startDot);\n ret.base = path.slice(startPart, end);\n }\n ret.ext = path.slice(startDot, end);\n }\n\n if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';\n\n return ret;\n },\n\n sep: '/',\n delimiter: ':',\n win32: null,\n posix: null\n};\n\nposix.posix = posix;\n\nmodule.exports = posix;\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , undef;\n\n/**\n * Decode a URI encoded string.\n *\n * @param {String} input The URI encoded string.\n * @returns {String|Null} The decoded string.\n * @api private\n */\nfunction decode(input) {\n try {\n return decodeURIComponent(input.replace(/\\+/g, ' '));\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Attempts to encode a given input.\n *\n * @param {String} input The string that needs to be encoded.\n * @returns {String|Null} The encoded string.\n * @api private\n */\nfunction encode(input) {\n try {\n return encodeURIComponent(input);\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Simple query string parser.\n *\n * @param {String} query The query string that needs to be parsed.\n * @returns {Object}\n * @api public\n */\nfunction querystring(query) {\n var parser = /([^=?#&]+)=?([^&]*)/g\n , result = {}\n , part;\n\n while (part = parser.exec(query)) {\n var key = decode(part[1])\n , value = decode(part[2]);\n\n //\n // Prevent overriding of existing properties. This ensures that build-in\n // methods like `toString` or __proto__ are not overriden by malicious\n // querystrings.\n //\n // In the case if failed decoding, we want to omit the key/value pairs\n // from the result.\n //\n if (key === null || value === null || key in result) continue;\n result[key] = value;\n }\n\n return result;\n}\n\n/**\n * Transform a query string to an object.\n *\n * @param {Object} obj Object that should be transformed.\n * @param {String} prefix Optional prefix.\n * @returns {String}\n * @api public\n */\nfunction querystringify(obj, prefix) {\n prefix = prefix || '';\n\n var pairs = []\n , value\n , key;\n\n //\n // Optionally prefix with a '?' if needed\n //\n if ('string' !== typeof prefix) prefix = '?';\n\n for (key in obj) {\n if (has.call(obj, key)) {\n value = obj[key];\n\n //\n // Edge cases where we actually want to encode the value to an empty\n // string instead of the stringified value.\n //\n if (!value && (value === null || value === undef || isNaN(value))) {\n value = '';\n }\n\n key = encode(key);\n value = encode(value);\n\n //\n // If we failed to encode the strings, we should bail out as we don't\n // want to add invalid strings to the query.\n //\n if (key === null || value === null) continue;\n pairs.push(key +'='+ value);\n }\n }\n\n return pairs.length ? prefix + pairs.join('&') : '';\n}\n\n//\n// Expose the module.\n//\nexports.stringify = querystringify;\nexports.parse = querystring;\n","'use strict';\n\n/**\n * Check if we're required to add a port number.\n *\n * @see https://url.spec.whatwg.org/#default-port\n * @param {Number|String} port Port number we need to check\n * @param {String} protocol Protocol we need to check against.\n * @returns {Boolean} Is it a default port for the given protocol\n * @api private\n */\nmodule.exports = function required(port, protocol) {\n protocol = protocol.split(':')[0];\n port = +port;\n\n if (!port) return false;\n\n switch (protocol) {\n case 'http':\n case 'ws':\n return port !== 80;\n\n case 'https':\n case 'wss':\n return port !== 443;\n\n case 'ftp':\n return port !== 21;\n\n case 'gopher':\n return port !== 70;\n\n case 'file':\n return false;\n }\n\n return port !== 0;\n};\n","import { startJupyterLiteServer } from './jlite';\nimport type { ThebeLiteGlobal } from './types';\n\ndeclare global {\n interface Window {\n thebeLite?: ThebeLiteGlobal;\n }\n}\n\nfunction setupThebeLite() {\n window.thebeLite = Object.assign(window.thebeLite ?? {}, { startJupyterLiteServer });\n}\n\nif (typeof window !== 'undefined') {\n console.debug('window is defined, setting up thebe-lite');\n setupThebeLite();\n console.debug('window.thebeLite', window.thebeLite);\n}\n\nexport * from './types';\nexport { startJupyterLiteServer, setupThebeLite };\n","import type { ServiceManager } from '@jupyterlab/services';\nimport type { LiteServerConfig } from './types';\nimport { PageConfig } from '@jupyterlab/coreutils';\nimport { JupyterLiteServer } from '@jupyterlite/server';\n\nconst serverExtensions = [import('@jupyterlite/server-extension')];\n\nasync function createModule(scope: string, module: string) {\n try {\n const factory = await (window as any)._JUPYTERLAB[scope].get(module);\n return factory();\n } catch (e) {\n console.warn(`Failed to create module: package: ${scope}; module: ${module}`);\n throw e;\n }\n}\n\n/**\n * Iterate over active plugins in an extension.\n */\nfunction* activePlugins(extension: any) {\n // Handle commonjs or es2015 modules\n let exports;\n if (Object.prototype.hasOwnProperty.call(extension, '__esModule')) {\n exports = extension.default;\n } else {\n // CommonJS exports.\n exports = extension;\n }\n\n const plugins = Array.isArray(exports) ? exports : [exports];\n for (const plugin of plugins) {\n yield plugin;\n }\n}\n\nexport async function startJupyterLiteServer(config?: LiteServerConfig): Promise {\n /**\n * This is sufficent to initialise the global object?\n */\n PageConfig.getOption('');\n\n /**\n * Do not rely on a configuration being on the document body, accept configuration via arguments\n * and set options on the page config directly\n */\n if (config?.litePluginSettings) {\n PageConfig.setOption('litePluginSettings', JSON.stringify(config.litePluginSettings));\n }\n\n /**\n * Seems like there are 4 different extensions we may want to handle\n *\n * liteExtension - essential, as these are how kernels are added\n * federatedExtension - general jupyterlab extensions\n * federatedMimeExtension - render extensions? e.g. @jupyterlab/javascript-extension, @jupyterlab/json-extension\n * federatedStyles - ?\n *\n * TODO we're not suppporting all of these yet\n */\n\n const litePluginsToRegister: JupyterLiteServer.IPluginModule[] = [];\n\n // Add the base serverlite extensions\n const baseServerExtensions = await Promise.all(serverExtensions);\n baseServerExtensions.forEach((p) => {\n for (const plugin of activePlugins(p)) {\n litePluginsToRegister.push(plugin);\n }\n });\n\n // TODO get federated extensions in from config argument?\n const extensions: any[] = [];\n\n const liteExtensionPromises: any[] = [import('@jupyterlite/pyodide-kernel-extension')];\n\n extensions.forEach((data) => {\n if (data.liteExtension) {\n liteExtensionPromises.push(createModule(data.name, data.extension));\n return;\n }\n });\n\n // Add the serverlite federated extensions.\n const federatedLiteExtensions = await Promise.allSettled(liteExtensionPromises);\n federatedLiteExtensions.forEach((p) => {\n if (p.status === 'fulfilled') {\n for (const plugin of activePlugins(p.value)) {\n litePluginsToRegister.push(plugin);\n }\n } else {\n console.error(p.reason);\n }\n });\n\n // create the in-browser JupyterLite Server\n const jupyterLiteServer = new JupyterLiteServer({} as any);\n jupyterLiteServer.registerPluginModules(litePluginsToRegister);\n // start the server\n await jupyterLiteServer.start();\n\n const { serviceManager } = jupyterLiteServer;\n await serviceManager.ready;\n\n // TODO\n return serviceManager as unknown as ServiceManager;\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","'use strict';\n\nvar required = require('requires-port')\n , qs = require('querystringify')\n , controlOrWhitespace = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/\n , CRHTLF = /[\\n\\r\\t]/g\n , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//\n , port = /:\\d+$/\n , protocolre = /^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i\n , windowsDriveLetter = /^[a-zA-Z]:/;\n\n/**\n * Remove control characters and whitespace from the beginning of a string.\n *\n * @param {Object|String} str String to trim.\n * @returns {String} A new string representing `str` stripped of control\n * characters and whitespace from its beginning.\n * @public\n */\nfunction trimLeft(str) {\n return (str ? str : '').toString().replace(controlOrWhitespace, '');\n}\n\n/**\n * These are the parse rules for the URL parser, it informs the parser\n * about:\n *\n * 0. The char it Needs to parse, if it's a string it should be done using\n * indexOf, RegExp using exec and NaN means set as current value.\n * 1. The property we should set when parsing this value.\n * 2. Indication if it's backwards or forward parsing, when set as number it's\n * the value of extra chars that should be split off.\n * 3. Inherit from location if non existing in the parser.\n * 4. `toLowerCase` the resulting value.\n */\nvar rules = [\n ['#', 'hash'], // Extract from the back.\n ['?', 'query'], // Extract from the back.\n function sanitize(address, url) { // Sanitize what is left of the address\n return isSpecial(url.protocol) ? address.replace(/\\\\/g, '/') : address;\n },\n ['/', 'pathname'], // Extract from the back.\n ['@', 'auth', 1], // Extract from the front.\n [NaN, 'host', undefined, 1, 1], // Set left over value.\n [/:(\\d*)$/, 'port', undefined, 1], // RegExp the back.\n [NaN, 'hostname', undefined, 1, 1] // Set left over.\n];\n\n/**\n * These properties should not be copied or inherited from. This is only needed\n * for all non blob URL's as a blob URL does not include a hash, only the\n * origin.\n *\n * @type {Object}\n * @private\n */\nvar ignore = { hash: 1, query: 1 };\n\n/**\n * The location object differs when your code is loaded through a normal page,\n * Worker or through a worker using a blob. And with the blobble begins the\n * trouble as the location object will contain the URL of the blob, not the\n * location of the page where our code is loaded in. The actual origin is\n * encoded in the `pathname` so we can thankfully generate a good \"default\"\n * location from it so we can generate proper relative URL's again.\n *\n * @param {Object|String} loc Optional default location object.\n * @returns {Object} lolcation object.\n * @public\n */\nfunction lolcation(loc) {\n var globalVar;\n\n if (typeof window !== 'undefined') globalVar = window;\n else if (typeof global !== 'undefined') globalVar = global;\n else if (typeof self !== 'undefined') globalVar = self;\n else globalVar = {};\n\n var location = globalVar.location || {};\n loc = loc || location;\n\n var finaldestination = {}\n , type = typeof loc\n , key;\n\n if ('blob:' === loc.protocol) {\n finaldestination = new Url(unescape(loc.pathname), {});\n } else if ('string' === type) {\n finaldestination = new Url(loc, {});\n for (key in ignore) delete finaldestination[key];\n } else if ('object' === type) {\n for (key in loc) {\n if (key in ignore) continue;\n finaldestination[key] = loc[key];\n }\n\n if (finaldestination.slashes === undefined) {\n finaldestination.slashes = slashes.test(loc.href);\n }\n }\n\n return finaldestination;\n}\n\n/**\n * Check whether a protocol scheme is special.\n *\n * @param {String} The protocol scheme of the URL\n * @return {Boolean} `true` if the protocol scheme is special, else `false`\n * @private\n */\nfunction isSpecial(scheme) {\n return (\n scheme === 'file:' ||\n scheme === 'ftp:' ||\n scheme === 'http:' ||\n scheme === 'https:' ||\n scheme === 'ws:' ||\n scheme === 'wss:'\n );\n}\n\n/**\n * @typedef ProtocolExtract\n * @type Object\n * @property {String} protocol Protocol matched in the URL, in lowercase.\n * @property {Boolean} slashes `true` if protocol is followed by \"//\", else `false`.\n * @property {String} rest Rest of the URL that is not part of the protocol.\n */\n\n/**\n * Extract protocol information from a URL with/without double slash (\"//\").\n *\n * @param {String} address URL we want to extract from.\n * @param {Object} location\n * @return {ProtocolExtract} Extracted information.\n * @private\n */\nfunction extractProtocol(address, location) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n location = location || {};\n\n var match = protocolre.exec(address);\n var protocol = match[1] ? match[1].toLowerCase() : '';\n var forwardSlashes = !!match[2];\n var otherSlashes = !!match[3];\n var slashesCount = 0;\n var rest;\n\n if (forwardSlashes) {\n if (otherSlashes) {\n rest = match[2] + match[3] + match[4];\n slashesCount = match[2].length + match[3].length;\n } else {\n rest = match[2] + match[4];\n slashesCount = match[2].length;\n }\n } else {\n if (otherSlashes) {\n rest = match[3] + match[4];\n slashesCount = match[3].length;\n } else {\n rest = match[4]\n }\n }\n\n if (protocol === 'file:') {\n if (slashesCount >= 2) {\n rest = rest.slice(2);\n }\n } else if (isSpecial(protocol)) {\n rest = match[4];\n } else if (protocol) {\n if (forwardSlashes) {\n rest = rest.slice(2);\n }\n } else if (slashesCount >= 2 && isSpecial(location.protocol)) {\n rest = match[4];\n }\n\n return {\n protocol: protocol,\n slashes: forwardSlashes || isSpecial(protocol),\n slashesCount: slashesCount,\n rest: rest\n };\n}\n\n/**\n * Resolve a relative URL pathname against a base URL pathname.\n *\n * @param {String} relative Pathname of the relative URL.\n * @param {String} base Pathname of the base URL.\n * @return {String} Resolved pathname.\n * @private\n */\nfunction resolve(relative, base) {\n if (relative === '') return base;\n\n var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))\n , i = path.length\n , last = path[i - 1]\n , unshift = false\n , up = 0;\n\n while (i--) {\n if (path[i] === '.') {\n path.splice(i, 1);\n } else if (path[i] === '..') {\n path.splice(i, 1);\n up++;\n } else if (up) {\n if (i === 0) unshift = true;\n path.splice(i, 1);\n up--;\n }\n }\n\n if (unshift) path.unshift('');\n if (last === '.' || last === '..') path.push('');\n\n return path.join('/');\n}\n\n/**\n * The actual URL instance. Instead of returning an object we've opted-in to\n * create an actual constructor as it's much more memory efficient and\n * faster and it pleases my OCD.\n *\n * It is worth noting that we should not use `URL` as class name to prevent\n * clashes with the global URL instance that got introduced in browsers.\n *\n * @constructor\n * @param {String} address URL we want to parse.\n * @param {Object|String} [location] Location defaults for relative paths.\n * @param {Boolean|Function} [parser] Parser for the query string.\n * @private\n */\nfunction Url(address, location, parser) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n\n if (!(this instanceof Url)) {\n return new Url(address, location, parser);\n }\n\n var relative, extracted, parse, instruction, index, key\n , instructions = rules.slice()\n , type = typeof location\n , url = this\n , i = 0;\n\n //\n // The following if statements allows this module two have compatibility with\n // 2 different API:\n //\n // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments\n // where the boolean indicates that the query string should also be parsed.\n //\n // 2. The `URL` interface of the browser which accepts a URL, object as\n // arguments. The supplied object will be used as default values / fall-back\n // for relative paths.\n //\n if ('object' !== type && 'string' !== type) {\n parser = location;\n location = null;\n }\n\n if (parser && 'function' !== typeof parser) parser = qs.parse;\n\n location = lolcation(location);\n\n //\n // Extract protocol information before running the instructions.\n //\n extracted = extractProtocol(address || '', location);\n relative = !extracted.protocol && !extracted.slashes;\n url.slashes = extracted.slashes || relative && location.slashes;\n url.protocol = extracted.protocol || location.protocol || '';\n address = extracted.rest;\n\n //\n // When the authority component is absent the URL starts with a path\n // component.\n //\n if (\n extracted.protocol === 'file:' && (\n extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||\n (!extracted.slashes &&\n (extracted.protocol ||\n extracted.slashesCount < 2 ||\n !isSpecial(url.protocol)))\n ) {\n instructions[3] = [/(.*)/, 'pathname'];\n }\n\n for (; i < instructions.length; i++) {\n instruction = instructions[i];\n\n if (typeof instruction === 'function') {\n address = instruction(address, url);\n continue;\n }\n\n parse = instruction[0];\n key = instruction[1];\n\n if (parse !== parse) {\n url[key] = address;\n } else if ('string' === typeof parse) {\n index = parse === '@'\n ? address.lastIndexOf(parse)\n : address.indexOf(parse);\n\n if (~index) {\n if ('number' === typeof instruction[2]) {\n url[key] = address.slice(0, index);\n address = address.slice(index + instruction[2]);\n } else {\n url[key] = address.slice(index);\n address = address.slice(0, index);\n }\n }\n } else if ((index = parse.exec(address))) {\n url[key] = index[1];\n address = address.slice(0, index.index);\n }\n\n url[key] = url[key] || (\n relative && instruction[3] ? location[key] || '' : ''\n );\n\n //\n // Hostname, host and protocol should be lowercased so they can be used to\n // create a proper `origin`.\n //\n if (instruction[4]) url[key] = url[key].toLowerCase();\n }\n\n //\n // Also parse the supplied query string in to an object. If we're supplied\n // with a custom parser as function use that instead of the default build-in\n // parser.\n //\n if (parser) url.query = parser(url.query);\n\n //\n // If the URL is relative, resolve the pathname against the base URL.\n //\n if (\n relative\n && location.slashes\n && url.pathname.charAt(0) !== '/'\n && (url.pathname !== '' || location.pathname !== '')\n ) {\n url.pathname = resolve(url.pathname, location.pathname);\n }\n\n //\n // Default to a / for pathname if none exists. This normalizes the URL\n // to always have a /\n //\n if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {\n url.pathname = '/' + url.pathname;\n }\n\n //\n // We should not add port numbers if they are already the default port number\n // for a given protocol. As the host also contains the port number we're going\n // override it with the hostname which contains no port number.\n //\n if (!required(url.port, url.protocol)) {\n url.host = url.hostname;\n url.port = '';\n }\n\n //\n // Parse down the `auth` for the username and password.\n //\n url.username = url.password = '';\n\n if (url.auth) {\n index = url.auth.indexOf(':');\n\n if (~index) {\n url.username = url.auth.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = url.auth.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password))\n } else {\n url.username = encodeURIComponent(decodeURIComponent(url.auth));\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n }\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n //\n // The href is just the compiled result.\n //\n url.href = url.toString();\n}\n\n/**\n * This is convenience method for changing properties in the URL instance to\n * insure that they all propagate correctly.\n *\n * @param {String} part Property we need to adjust.\n * @param {Mixed} value The newly assigned value.\n * @param {Boolean|Function} fn When setting the query, it will be the function\n * used to parse the query.\n * When setting the protocol, double slash will be\n * removed from the final url if it is true.\n * @returns {URL} URL instance for chaining.\n * @public\n */\nfunction set(part, value, fn) {\n var url = this;\n\n switch (part) {\n case 'query':\n if ('string' === typeof value && value.length) {\n value = (fn || qs.parse)(value);\n }\n\n url[part] = value;\n break;\n\n case 'port':\n url[part] = value;\n\n if (!required(value, url.protocol)) {\n url.host = url.hostname;\n url[part] = '';\n } else if (value) {\n url.host = url.hostname +':'+ value;\n }\n\n break;\n\n case 'hostname':\n url[part] = value;\n\n if (url.port) value += ':'+ url.port;\n url.host = value;\n break;\n\n case 'host':\n url[part] = value;\n\n if (port.test(value)) {\n value = value.split(':');\n url.port = value.pop();\n url.hostname = value.join(':');\n } else {\n url.hostname = value;\n url.port = '';\n }\n\n break;\n\n case 'protocol':\n url.protocol = value.toLowerCase();\n url.slashes = !fn;\n break;\n\n case 'pathname':\n case 'hash':\n if (value) {\n var char = part === 'pathname' ? '/' : '#';\n url[part] = value.charAt(0) !== char ? char + value : value;\n } else {\n url[part] = value;\n }\n break;\n\n case 'username':\n case 'password':\n url[part] = encodeURIComponent(value);\n break;\n\n case 'auth':\n var index = value.indexOf(':');\n\n if (~index) {\n url.username = value.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = value.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password));\n } else {\n url.username = encodeURIComponent(decodeURIComponent(value));\n }\n }\n\n for (var i = 0; i < rules.length; i++) {\n var ins = rules[i];\n\n if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n url.href = url.toString();\n\n return url;\n}\n\n/**\n * Transform the properties back in to a valid and full URL string.\n *\n * @param {Function} stringify Optional query stringify function.\n * @returns {String} Compiled version of the URL.\n * @public\n */\nfunction toString(stringify) {\n if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;\n\n var query\n , url = this\n , host = url.host\n , protocol = url.protocol;\n\n if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';\n\n var result =\n protocol +\n ((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : '');\n\n if (url.username) {\n result += url.username;\n if (url.password) result += ':'+ url.password;\n result += '@';\n } else if (url.password) {\n result += ':'+ url.password;\n result += '@';\n } else if (\n url.protocol !== 'file:' &&\n isSpecial(url.protocol) &&\n !host &&\n url.pathname !== '/'\n ) {\n //\n // Add back the empty userinfo, otherwise the original invalid URL\n // might be transformed into a valid one with `url.pathname` as host.\n //\n result += '@';\n }\n\n //\n // Trailing colon is removed from `url.host` when it is parsed. If it still\n // ends with a colon, then add back the trailing colon that was removed. This\n // prevents an invalid URL from being transformed into a valid one.\n //\n if (host[host.length - 1] === ':' || (port.test(url.hostname) && !url.port)) {\n host += ':';\n }\n\n result += host + url.pathname;\n\n query = 'object' === typeof url.query ? stringify(url.query) : url.query;\n if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;\n\n if (url.hash) result += url.hash;\n\n return result;\n}\n\nUrl.prototype = { set: set, toString: toString };\n\n//\n// Expose the URL parser and some additional properties that might be useful for\n// others or testing.\n//\nUrl.extractProtocol = extractProtocol;\nUrl.location = lolcation;\nUrl.trimLeft = trimLeft;\nUrl.qs = qs;\n\nmodule.exports = Url;\n","// empty module for shims\nmodule.exports = {};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"thebe-lite:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".thebe-lite.min.js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t524: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkthebe_lite\"] = self[\"webpackChunkthebe_lite\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(7783);\n"],"names":["Object","defineProperty","exports","value","ActivityMonitor","signaling_1","constructor","options","this","_timer","_timeout","_isDisposed","_activityStopped","Signal","signal","connect","_onSignalFired","timeout","activityStopped","isDisposed","dispose","clearData","sender","args","clearTimeout","_sender","_args","setTimeout","emit","__createBinding","create","o","m","k","k2","undefined","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","__exportStar","p","prototype","hasOwnProperty","call","LruCache","_map","Map","_maxSize","maxSize","size","clear","key","item","delete","set","keys","next","MarkdownCodeBlocks","CODE_BLOCK_MARKER","markdownExtensions","MarkdownCodeBlock","startLine","code","endLine","isMarkdown","extension","indexOf","findMarkdownCodeBlocks","text","lines","split","codeBlocks","currentBlock","lineIndex","length","line","lineContainsMarker","constructingBlock","push","firstIndex","lastIndex","lastIndexOf","substring","__importDefault","mod","PageConfig","coreutils_1","minimist_1","url_1","getOption","name","configData","getBodyData","found","document","el","getElementById","JSON","parse","textContent","process","argv","cli","default","slice","path","fullPath","resolve","eval","e","console","error","JSONExt","isObject","stringify","setOption","last","getBaseUrl","URLExt","normalize","getTreeUrl","join","getShareUrl","getTreeShareUrl","getUrl","_a","_b","_c","_d","toShare","mode","workspace","labOrDoc","defaultWorkspace","encodeURIComponent","treePath","encodeParts","getWsUrl","baseUrl","wsUrl","getNBConvertURL","format","download","notebookPath","url","getToken","getNotebookVersion","notebookVersion","Extension","body","val","dataset","decodeURIComponent","populate","raw","warn","deferred","disabled","isDeferred","id","separatorIndex","extName","some","isDisabled","PathExt","path_1","removeSlash","paths","posix","joinWithLeadingSlash","basename","ext","dirname","dir","extname","parts","relative","from","to","normalizeExtension","signalToPromise","waitForSignal","PromiseDelegate","cleanup","disconnect","slot","reject","promise","Text","jsIndexToCharIndex","jsIdx","charIndexToJsIndex","charIdx","camelCase","str","upper","replace","match","p1","p2","toUpperCase","toLowerCase","titleCase","map","word","charAt","Time","UNITS","milliseconds","formatHuman","lang","documentElement","formatter","Intl","RelativeTimeFormat","numeric","style","delta","Date","getTime","now","unit","amount","Math","ceil","DateTimeFormat","dateStyle","timeStyle","url_parse_1","a","createElement","href","u","isSchemaLess","protocol","slashes","prefix","auth","host","pathname","getHostName","hostname","toString","objectToQueryString","filter","content","String","queryStringToObject","reduce","acc","isLocal","allowRoot","BaseManager","serverconnection_1","_disposed","serverSettings","ServerConnection","makeSettings","disposed","isActive","BuildManager","_url","appUrl","isAvailable","shouldCheck","getStatus","makeRequest","then","response","status","ResponseError","json","data","Error","message","build","method","cancel","ConfigWithDefaults","ConfigSection","__1","section","DefaultConfigSection","load","settings","_data","update","newdata","init","_className","_section","_defaults","defaults","className","_classData","d","d2","__setModuleDefault","v","__importStar","result","Drive","ContentsManager","Contents","validate","Private","validateContentsModel","contents","validateCheckpointModel","checkpoint","_additionalDrives","_fileChanged","_defaultDrive","defaultDrive","fileChanged","_onFileChanged","addDrive","drive","getSharedModelFactory","_driveForPath","sharedModelFactory","localPath","firstParts","has","resolvePath","root","driveName","resolved","contentsModel","listing","type","_toGlobalPath","serverPath","getDownloadUrl","newUntitled","globalPath","rename","newPath","drive1","path1","drive2","path2","save","copy","fromFile","toDir","createCheckpoint","listCheckpoints","restoreCheckpoint","checkpointID","deleteCheckpoint","newValue","oldValue","_apiEndpoint","apiEndpoint","_getUrl","hash","params","cookie","xsrfTokenMatch","fullUrl","URL","searchParams","append","Promise","oldLocalPath","newLocalPath","copy_from","Array","isArray","i","validate_1","model","validateProperty","EventManager","polling_1","SERVICE_EVENTS_URL","_socket","_poll","Poll","factory","_subscribe","_stream","Stream","start","stream","socket","onopen","onerror","onmessage","onclose","close","stop","event","_","appendToken","token","WebSocket","msg","CommHandler","disposable_1","KernelMessage","DisposableDelegate","target","kernel","disposeCb","super","_target","_id","_kernel","commId","targetName","onClose","_onClose","cb","onMsg","_onMsg","open","metadata","buffers","createMessage","msgType","channel","username","session","clientId","comm_id","target_name","sendShellMessage","send","disposeOnDone","future","KernelConnection","coreutils_2","comm_1","future_1","kernelspec_1","restapi","RESTARTING_KERNEL_SESSION","_createSocket","useProtocols","_errorIfDisposed","_clearSocket","_updateConnectionStatus","partialUrl","KERNEL_SERVICE_URL","display","debug","_clientId","supportedProtocols","_supportedProtocols","_ws","binaryType","alreadyCalledOnclose","getKernelModel","async","evt","_reason","_model","execution_state","_updateStatus","_onWSClose","err","NetworkError","getRandomIntInclusive","earlyClose","_onWSMessage","_onWSOpen","includes","log","_selectedProtocol","serializer","deserialize","validateMessage","_kernelSession","header","_msgChain","_handleMessage","catch","startsWith","_anyMessage","direction","_reconnect","_name","_status","_connectionStatus","_username","_reconnectLimit","_reconnectAttempt","_reconnectTimeout","values","supportedKernelWebSocketProtocols","_futures","_comms","_targetRegistry","_info","_pendingMessages","_statusChanged","_connectionStatusChanged","_iopubMessage","_pendingInput","_unhandledMessage","_displayIdToParentIds","_msgIdToDisplayIds","_hasPendingInput","_noOp","UUID","uuid4","handleComms","statusChanged","connectionStatusChanged","iopubMessage","unhandledMessage","reason","anyMessage","pendingInput","connectionStatus","info","spec","_specPromise","KernelSpecAPI","getSpecs","specs","kernelspecs","clone","_clearKernelState","expectReply","_sendKernelShellControl","KernelShellFutureHandler","sendControlMessage","KernelControlFutureHandler","ctor","_sendMessage","msgId","msg_id","displayIds","forEach","displayId","msgIds","idx","splice","queue","isInfoRequestMsg","serialize","interrupt","hasPendingInput","interruptKernel","restart","restartKernel","reconnect","fulfill","shutdown","shutdownKernel","handleShutdown","requestKernelInfo","reply","handleShellMessage","requestComplete","requestInspect","requestHistory","requestExecute","silent","store_history","user_expressions","allow_stdin","stop_on_error","requestDebug","requestIsComplete","requestCommInfo","sendInputReply","parent_header","createComm","comm","_unregisterComm","hasComm","registerCommTarget","callback","removeCommTarget","registerMessageHook","hook","removeMessageHook","removeInputGuard","_handleDisplayId","parentIds","updateMsg","deepCopy","msg_type","all","parentId","handleMsg","logKernelStatus","_sendPending","shift","_assertCurrentMessage","_handleCommOpen","loadObject","target_module","_handleCommClose","_handleCommMsg","restarting","sendPendingCalled","sendPendingOnce","timeoutHandle","handled","isDisplayDataMsg","isUpdateDisplayDataMsg","isExecuteResultMsg","transient","parentHeader","owned","executionState","pow","floor","done","moduleName","registry","requirejs","min","max","random","KernelFutureHandler","_stdin","noOp","_iopub","_reply","_done","_hooks","HookList","_disposeOnDone","_msg","_setFlag","KernelFutureFlag","GotReply","onReply","onIOPub","onStdin","add","remove","_testFlag","IsDone","_handleReply","_handleStdin","_handleIOPub","_replyMsg","GotIdle","_handleDone","stdin","iopub","isStatusMsg","flag","defer","requestAnimationFrame","setImmediate","index","_scheduleCompact","_processing","processing","continueHandling","_compactScheduled","_compact","numNulls","len","KernelAPI","Kernel","default_1","KernelManager","basemanager_1","restapi_1","_isReady","_kernelConnections","Set","_models","_runningChanged","_connectionFailure","_pollModels","auto","requestRunning","frequency","interval","backoff","standby","_ready","tick","isReady","ready","runningChanged","connectionFailure","x","connectTo","kc","kernelConnection","_onStarted","refreshRunning","running","refresh","startNew","createOptions","connectOptions","shutdownAll","findById","models","listRunning","every","existing","connections","last_activity","traceback","_onStatusChanged","_onDisposed","NoopManager","arguments","_readyPromise","parentReady","isInputReplyMsg","isInputRequestMsg","isDebugReplyMsg","isDebugRequestMsg","isExecuteReplyMsg","isCommMsgMsg","isCommCloseMsg","isCommOpenMsg","isDebugEventMsg","isClearOutputMsg","isErrorMsg","isExecuteInputMsg","isStreamMsg","_e","date","toISOString","version","validateModels","validateModel","v1KernelWebsocketJupyterOrg","serializeV1KernelWebsocketJupyterOrg","serializeDefault","deserializeV1KernelWebsocketJupyterOrg","deserializeDefault","binMsg","DataView","offsetNumber","Number","getBigUint64","offsets","decoder","TextDecoder","decode","encoder","TextEncoder","channelEncoded","encode","headerEncoded","parentHeaderEncoded","metadataEncoded","contentEncoded","binMsgNoBuff","Uint8Array","buffersByteLength","buffer","byteLength","ArrayBuffer","setBigUint64","BigInt","isView","buf","nbufs","getUint32","jsonBytes","deserializeBinary","origBuffers","jsonUtf8","b","msgBuf","view","setUint32","serializeBinary","HEADER_FIELDS","IOPUB_CONTENT_FIELDS","display_data","execute_input","execution_count","execute_result","ename","evalue","clear_output","wait","comm_open","comm_msg","comm_close","shutdown_reply","validateHeader","fields","names","validateIOPubContent","KernelSpec","KernelSpecManager","_specs","_specsChanged","requestSpecs","_pollSpecs","specsChanged","refreshSpecs","deepEqual","validateSpecModels","validateSpecModel","env","resources","language","display_name","defaultSpec","ks","ServiceManager","builder_1","contents_1","event_1","kernel_1","nbconvert_1","session_1","setting_1","terminal_1","user_1","workspace_1","normalized","events","kernels","sessions","SessionManager","kernelManager","SettingManager","terminals","TerminalManager","builder","workspaces","WorkspaceManager","nbconvert","NbConvertManager","user","UserManager","_onConnectionFailure","readyList","_exportFormats","fetchExportFormats","_requestingFormats","base","exportList","mimeType","output_mimetype","getExportFormats","force","serialize_1","WEBSOCKET","window","handleRequest","_defaultMessage","statusText","TypeError","original","stack","pageBaseUrl","pageWsUrl","appendTokenConfig","JEST_WORKER_ID","cache","credentials","fetch","Headers","Request","test","request","authenticated","headers","xsrfToken","matches","getCookie","SessionConnection","_path","_type","_kernelChanged","_propertyChanged","_connectToKernel","connectToKernel","_kernelConnectionOptions","kernelConnectionOptions","setupKernel","kernelChanged","propertyChanged","oldModel","_handleModelChange","setPath","_patch","setName","setType","changeKernel","shutdownSession","onKernelStatus","onKernelConnectionStatus","onPendingInput","onUnhandledMessage","onIOPubMessage","onAnyMessage","state","updateSession","SessionAPI","Session","_sessionConnections","_kernelManager","sessionConnection","startSession","stopIfNeeded","findByPath","sc","_onChanged","getSessionModel","getSessionUrl","SESSION_SERVICE_URL","servicesBase","updateLegacySessionModel","validate_2","notebook","statedb_1","DataConnector","list","query","ids","plugin","composite","idsOnly","idsOnlyParam","ids_only","settingsBase","TerminalConnection","_messageReceived","messageReceived","shutdownTerminal","getTermUrl","TERMINAL_SERVICE_URL","TerminalAPI","Terminal","_names","_terminalConnections","terminalConnection","Symbol","iterator","cwd","sort","tc","errorIfNotAvailable","workspacesBase","SERVICE_ID","_userChanged","requestUser","identity","_identity","permissions","_permissions","userChanged","refreshUser","oldUser","newUser","localStorage","getItem","initials","color","localUser","getRandomColor","setItem","userColors","object","typeName","valid","findIndex","RestorablePool","properties_1","_added","_current","_currentChanged","_hasRestored","_objects","_restore","_restored","_updated","namespace","added","current","obj","currentChanged","restored","updated","warning","_onInstanceDisposed","injectedProperty","connector","objName","nameProperty","find","fn","filtered","inject","restore","command","when","promises","concat","saved","execute","injected","oldName","newName","AttachedProperty","StateDB","_changed","transform","_connector","Connector","transformation","_clear","_merge","_overwrite","changed","_fetch","_list","_remove","_save","toJSON","_storage","IStateDB","Token","DIR_MODE","DriveContentsProcessor","contentsManager","processDriveRequest","readdir","rmdir","getmode","lookup","mknod","getattr","put","subcontent","ok","defaultDate","dev","nlink","uid","gid","rdev","blksize","blocks","atime","last_modified","mtime","ctime","created","timestamp","DRIVE_API_PATH","BLOCK_SIZE","IContents","MIME","FILE","PLAIN_TEXT","OCTET_STREAM","TYPES","getType","defaultType","fileType","fileExt","extensions","mimeTypes","hasFormat","fileFormat","IBroadcastChannelWrapper","IKernels","FALLBACK_KERNEL","IKernelSpecs","KERNEL_ICON_URL","btoa","PLUGIN_ID","autoStart","requires","optional","activate","app","serviceWorker","broadcastChannel","serviceManager","config","pyodideUrl","pipliteWheelUrl","pipliteUrls","pipUrl","disablePyPIFallback","loadPyodideOptions","entries","endsWith","register","PyodideKernel","mountDrive","enabled","crossOriginIsolated","DEFAULT_STORAGE_NAME","reduceBytesToString","byte","fromCharCode","_serverContents","_storageName","_storageDrivers","_localforage","localforage","storageName","storageDrivers","initialize","initStorage","createDefaultStorage","_counters","createDefaultCounters","_checkpoints","createDefaultCheckpoints","storage","counters","checkpoints","defaultStorageOptions","driver","createInstance","description","storeName","file","_incrementCounter","mimetype","counter","EMPTY_NB","toPath","_getFolder","serverItem","_getServerContents","contentMap","iterate","serverContents","_getServerDirectory","modified","newFile","removeItem","child","chunk","chunked","originalContent","lastChunk","_handleChunk","atob","slashed","toDelete","forgetPath","copies","Boolean","normalizeCheckpoint","parseInt","newContent","escaped","escape","fileUrl","contentText","contentBytes","arrayBuffer","contentBuffer","apiURL","orig_nbformat","nbformat_minor","nbformat","cells","BroadcastChannelWrapper","_onMessage","_channel","receiver","_driveContentsProcessor","postMessage","_enabled","_contents","enable","BroadcastChannel","addEventListener","disable","removeEventListener","ObservableMap","_itemCmp","itemCmp","oldVal","keyList","valList","first","second","E_CANCELED","__awaiter$2","thisArg","_arguments","P","generator","fulfilled","step","rejected","apply","Semaphore","_maxConcurrency","_cancelError","_queue","_waiters","_value","acquire","locked","isLocked","ticketPromise","_dispatch","runExclusive","release","waitForUnlock","_currentReleaser","releaser","ticket","nextTicket","released","_resolveWaiters","waiter","Mutex","cancelError","_semaphore","KERNEL_WEBSOCKET_PROTOCOL","Kernels","_kernels","_clients","_kernelClients","_kernelspecs","location","factories","mutex","kernelId","on","encodedData","handleMessage","processMsg","removeClient","kernelUrl","WS_BASE_URL","runningKernel","sendMessage","clients","wsServer","mock","selectProtocol","readyState","CLOSED","KernelSpecs","_factories","defaultKernelName","fromEntries","THIRD_PARTY_LICENSES","ILicenses","EMPTY_BUNDLE","freeze","packages","Licenses","bundles","_getFederated","appName","_getAppLicenses","appLicensesUrl","labExtensionsUrl","bundle","federated","_getOneFederated","ISessions","ArrayExt","StringExt","firstIndexOf","array","span","n","j","findFirstIndex","findLastIndex","reverse","removeAt","findFirstValue","findLastValue","lowerBound","begin","half","middle","upperBound","shallowEqual","move","fromIndex","toIndex","rotate","pivot","fill","insert","removeFirstOf","removeLastOf","removeAllOf","count","removeFirstWhere","removeLastWhere","removeAllWhere","rangeLength","Infinity","findIndices","source","indices","matchSumOfSquares","score","matchSumOfDeltas","highlight","cmp","Sessions","_sessions","s","patch","patched","newKernel","_handleKernelShutdown","sessionId","kernelName","nameOrPath","ISettings","Settings","defaultSettingsStorage","pluginId","getAll","setting","allCore","_getAll","allFederated","override","settingsUrl","_overrides","schema","properties","prop","propDefault","ITranslation","Translation","_prevLocale","locale","prev","displayName","nativeName","en","ILocalForage","localforagePlugin","provides","localforageMemoryPlugin","forage","theLocalforage","defineDriver","ensureMemoryStorage","configSectionRoutesPlugin","sections","router","req","Response","payload","contentsPlugin","started","contentsRoutesPlugin","filename","res","post","nb","copyFrom","serviceWorkerPlugin","settingsPlugin","settingsRoutesPlugin","pluginPattern","plugins","serviceWorkerRegistrationWrapper","broadcaster","what","logStatus","allKernelSpecs","allSpecs","licenses","translation","ClipboardExt","ElementExt","Platform","Selector","getKeyboardLayout","keyboardLayout","copyText","handler","preventDefault","stopPropagation","clipboardData","setData","execCommand","boxSizing","element","getComputedStyle","bt","parseFloat","borderTopWidth","bl","borderLeftWidth","br","borderRightWidth","bb","borderBottomWidth","pt","paddingTop","pl","paddingLeft","pr","paddingRight","pb","paddingBottom","borderTop","borderLeft","borderRight","borderBottom","horizontalSum","verticalSum","sizeLimits","minWidth","minHeight","maxWidth","maxHeight","hitTest","clientX","clientY","rect","getBoundingClientRect","left","right","top","bottom","scrollIntoViewIfNeeded","area","ar","er","height","scrollTop","IS_MAC","navigator","platform","IS_WIN","IS_IE","userAgent","IS_EDGE","accelKey","metaKey","ctrlKey","calculateSpecificity","selector","specificityCache","calculateSingle","isValid","validityCache","testElem","querySelector","protoMatchFunc","proto","Element","matchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","elem","ownerDocument","querySelectorAll","c","re","NEGATION_RE","ID_RE","CLASS_RE","ATTR_RE","PSEUDO_ELEM_RE","PSEDUO_CLASS_RE","TYPE_RE","IGNORE_RE","KeycodeLayout","codes","modifierKeys","_codes","_keys","extractKeys","_modifierKeys","convertToKeySet","isValidKey","isModifierKey","keyForKeydownEvent","keyCode","keySet","EN_US","MessageLoop","CommandRegistry","_timerID","_timerModifierID","_replaying","_keystrokes","_keydownEvents","_keyBindings","_exactKeyMatch","_commands","_commandChanged","_commandExecuted","_keyBindingChanged","_holdKeyBindingPromises","commandChanged","commandExecuted","keyBindingChanged","keyBindings","listCommands","hasCommand","addCommand","createCommand","notifyCommandChanged","describedBy","emptyObject","cmd","label","mnemonic","icon","iconClass","iconLabel","caption","usage","isEnabled","isToggled","isToggleable","isVisible","addKeyBinding","binding","createKeyBinding","processKeydownEvent","defaultPrevented","keystroke","keystrokeForKeydownEvent","_replayKeydownEvents","_clearPendingState","isModifierKeyPressed","exact","matchKeyBinding","_startModifierTimer","_clearModifierTimer","partial","hasPartial","_executeKeyBinding","_startTimer","holdKeyBindingExecution","permission","processKeyupEvent","modifierkeyTimeOut","_clearTimer","_onPendingTimeout","CHORD_TIMEOUT","replayKeyEvent","keydownEvents","executionAllowed","race","KEYBINDING_HOLD_TIMEOUT","newArgs","_luminoEvent","msg1","msg2","parseKeystroke","alt","ctrl","normalizeKeystroke","mods","trim","normalizeKeys","winKeys","macKeys","linuxKeys","formatKeystroke","formatSingleKey","separator","formatKey","layout","altKey","shiftKey","asFunc","emptyStringFunc","negativeOneFunc","undefinedFunc","emptyDatasetFunc","trueFunc","falseFunc","validateSelector","bindings","distance","specificity","sqm","matchSequence","targetDistance","td","sp","dispatchEvent","createEvent","bubbles","cancelable","initEvent","which","cloneKeyboardEvent","MAC_DISPLAY","WIN_DISPLAY","Backspace","Tab","Enter","Shift","Ctrl","Alt","Escape","PageUp","PageDown","End","Home","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Delete","Cmd","dfault","bindKeys","userKeys","targ","curr","currentTarget","dist","parentElement","hasAttribute","LinkedList","_first","_last","_size","isEmpty","firstNode","lastNode","node","retro","nodes","retroNodes","assign","addLast","pop","removeLast","addFirst","unshift","removeFirst","LinkedListNode","insertBefore","ref","_ref","insertAfter","removeNode","_node","Message","isConflatable","conflate","other","ConflatableMessage","pending","schedule","hooks","messageHooks","invokeHandler","passed","messageHook","exceptionHandler","invokeHook","posted","messageQueue","enqueueMessage","installMessageHook","scheduleCleanup","flush","flushGuard","runMessageLoop","getExceptionHandler","setExceptionHandler","old","WeakMap","dirtySet","processMessage","sentinel","cleanupDirtySet","cleanupHooks","isNull","VirtualDOM","BoxEngine","Private$j","Private$i","Utils","Drag","_onScrollFrame","_scrollTarget","edge","SCROLL_EDGE_SIZE","f","round","scrollLeft","_dropAction","_override","_currentTarget","_currentElement","_promise","_resolve","mimeData","dragImage","proposedAction","supportedActions","PointerEvent","dispatchDragLeave","_finalize","_addListeners","_attachDragImage","handleEvent","_evtPointerMove","_evtPointerUp","_evtKeyDown","moveDragImage","_updateCurrentTarget","_updateDragScroll","button","action","dispatchDrop","_removeListeners","findScrollTarget","prevTarget","currTarget","prevElem","currElem","findElementBehindBackdrop","dispatchDragExit","dispatchDragEnter","dispatchDragOver","_setDropAction","classList","pointerEvents","position","Document","firstElementChild","appendChild","_detachDragImage","parent","parentNode","removeChild","validateAction","overrideCursor","Event","DragEvent","detail","relatedTarget","related","screenX","screenY","drag","dropAction","cursor","doc","lastElementEventSearch","cursorBackdrop","zIndex","elementFromPoint","lastElementSearch","bbox","width","supported","actionTable","supportedTable","y","offsetX","offsetY","pageXOffset","pageYOffset","r","dl","dt","dr","db","shouldScroll","dsw","scrollWidth","clientWidth","dsh","scrollHeight","clientHeight","dragEvent","none","link","alignBackdrop","propagateBackdropScroll","_event","scrollTarget","closest","backdropScrollOrigin","resetBackdropScroll","overrideCursorID","isConnected","capture","passive","backdrop","createCursorBackdrop","VirtualText","VirtualElement","tag","attrs","children","renderer","h","arg","extend","bind","abbr","address","article","aside","audio","bdi","bdo","blockquote","canvas","cite","col","colgroup","datalist","dd","del","dfn","div","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","hr","iframe","img","input","ins","kbd","legend","li","main","mark","meter","nav","noscript","ol","optgroup","option","output","param","pre","progress","q","rp","rt","ruby","samp","select","small","strong","sub","summary","sup","table","tbody","textarea","tfoot","th","thead","time","title","tr","track","ul","var_","video","wbr","realize","createDOMNode","render","oldContent","hostMap","asContentArray","updateContent","before","createTextNode","specialAttrs","substr","setAttribute","htmlFor","addDataset","elemStyle","addStyle","addAttrs","removeContent","newCount","_sentinel","oldNode","lastChild","childNodes","unrender","oldKeyed","firstChild","keyMap","vNode","nextSibling","collectKeys","oldCopy","oldVNode","newVNode","newKey","pair","oldKey","updateAttrs","oldAttrs","newAttrs","removeAttribute","oldDataset","newDataset","updateDataset","oldStyle","newStyle","updateStyle","BoxSizer","sizeHint","minSize","stretch","calc","sizers","space","totalMin","totalMax","totalSize","totalStretch","stretchCount","sizer","hint","nearZero","notDoneCount","freeSpace","distSpace","distStretch","amt","adjust","growLimit","shrinkLimit","grow","limit","shrink","growSizer","shrinkSizer","Title","_label","_caption","_mnemonic","_icon","_iconClass","_iconLabel","_closable","owner","closable","_dataset","Widget","_flags","_layout","_parent","_hiddenMode","HiddenMode","Display","createNode","addClass","setFlag","Flag","IsDisposed","isAttached","detach","testFlag","IsAttached","isHidden","IsHidden","IsVisible","titleProperty","hiddenMode","_toggleHidden","Scale","willChange","contains","ChildMessage","Msg","ParentChanged","DisallowLayout","widget","hasClass","removeClass","toggleClass","toggle","UpdateRequest","fit","FitRequest","ActivateRequest","CloseRequest","show","BeforeShow","clearFlag","AfterShow","hide","BeforeHide","AfterHide","setHidden","hidden","notifyLayout","onResize","onUpdateRequest","onFitRequest","onBeforeShow","onAfterShow","onBeforeHide","onAfterHide","onBeforeAttach","onAfterAttach","onBeforeDetach","onAfterDetach","onActivateRequest","onCloseRequest","onChildAdded","onChildRemoved","processParentMessage","ContentVisibility","contentVisibility","BeforeAttach","AfterAttach","BeforeDetach","AfterDetach","ResizeMessage","UnknownSize","attach","Layout","_fitPolicy","fitPolicy","onChildShown","onChildHidden","removeWidget","getHorizontalAlignment","horizontalAlignmentProperty","setHorizontalAlignment","getVerticalAlignment","verticalAlignmentProperty","setVerticalAlignment","LayoutItem","_top","NaN","_left","_width","_height","_minWidth","_minHeight","_maxWidth","_maxHeight","contain","limits","clampW","clampH","resized","onAlignmentChanged","PanelLayout","_widgets","widgets","addWidget","insertWidget","attachWidget","moveWidget","removeWidgetAt","detachWidget","clampDimension","Private$h","Private$g","Private$f","Private$e","Private$d","Private$c","Private$b","Private$a","Private$9","Private$8","Utils$1","SplitLayout","widgetOffset","_fixed","_spacing","_dirty","_hasNormedSizes","_sizers","_items","_handles","_box","_alignment","_orientation","orientation","alignment","spacing","handles","absoluteSizes","relativeSizes","setRelativeSizes","sizes","temp","normed","moveHandle","handle","offsetLeft","offsetTop","createHandle","average","averageSize","createSizer","_update","_fit","updateItemPosition","isHorizontal","handleStyle","nVisible","lastHandleIndex","horz","minW","minH","getStretch","box","offsetWidth","offsetHeight","extra","offset","fullOffset","stretchProperty","setStretch","coerce","sum","abs","AccordionLayout","_titles","titleSpace","titles","updateTitle","oldTitle","expanded","newTitle","createTitle","replaceChild","titleStyle","createSectionTitle","Panel","createLayout","SplitPanel","_handleMoved","_pressData","_releaseMouse","handleMoved","_evtPointerDown","pos","Renderer","defaultRenderer","AccordionPanel","_widgetSizesCache","_expansionToggled","expansionToggled","_onTitleChanged","collapse","_toggleExpansion","expand","_evtClick","_eventKeyDown","_computeWidgetSize","widgetSizes","newSize","previousSize","widgetToCollapse","sz","currentSize","click","newIndex","focus","titleClassName","_titleID","_titleKeys","_uuid","_nInstance","createCollapseIcon","createTitleKey","aData","BoxLayout","_direction","getSizeBasis","sizeBasisProperty","setSizeBasis","onChildSizingChanged","clampSpacing","BoxPanel","CommandPalette","_activeIndex","_results","commands","_onGenericChange","searchNode","getElementsByClassName","inputNode","contentNode","items","addItem","createItem","addItems","newItems","removeItemAt","clearItems","_toggleFocused","results","search","canActivate","renderEmptyMessage","activeIndex","category","renderHeader","active","renderItem","_execute","_activatePreviousItem","_activateNextItem","ai","part","focused","activeElement","formatHeader","createItemClass","createItemDataset","role","renderItemIcon","renderItemContent","renderItemShortcut","formatEmptyMessage","createIconClass","renderItemLabel","renderItemCaption","formatItemLabel","formatItemCaption","formatItemShortcut","kb","keyBinding","fuzzySearch","rgx","rgxMatch","exec","categoryIndices","labelIndices","matchType","scoreCmp","m1","d1","i1","i2","localeCompare","r1","rank","r2","wrapper","spellcheck","CommandItem","scores","matchItems","createResults","Menu","_childIndex","_openTimerID","_closeTimerID","_childMenu","_parentMenu","_aboutToClose","_menuRequested","aboutToClose","menuRequested","parentMenu","childMenu","rootMenu","menu","leafMenu","activeItem","activateNextItem","activatePreviousItem","triggerActiveItem","_cancelOpenTimer","_cancelCloseTimer","_openChildMenu","insertItem","forceX","forceY","openRootMenu","_evtMouseUp","_evtMouseMove","_evtMouseEnter","_evtMouseLeave","_evtMouseDown","collapsedFlags","computeCollapsed","collapsed","onfocus","findMnemonic","multiple","_startCloseTimer","submenu","_startOpenTimer","hitTestMenus","activateFirst","_closeChildMenu","saveWindowData","itemNode","openSubmenu","TIMER_DELAY","aria","createItemARIA","tabindex","renderIcon","renderLabel","renderShortcut","renderSubmenu","formatLabel","formatShortcut","suffix","char","SUBMENU_OVERLAP","transientWindowDataCache","transientCacheCounter","getWindowData","_getWindowData","tabIndex","MenuItem","k1","windowData","px","py","cw","ch","opacity","itemRect","upperKey","mn","ContextMenu","_groupByTarget","_idTick","_sortBySelector","groupByTarget","sortBySelector","others","itemCmpRank","s1","s2","availableItems","ARROW_KEYS","TabBar","Private$7","_currentIndex","_titlesEditable","_previousTitle","_dragData","_addButtonEnabled","_tabMoved","_addRequested","_tabCloseRequested","_tabDetachRequested","_tabActivateRequested","_document","tabsMovable","titlesEditable","allowDeselect","addButtonEnabled","insertBehavior","removeBehavior","tabMoved","tabActivateRequested","addRequested","tabCloseRequested","tabDetachRequested","currentTitle","currentIndex","pi","ci","ct","previousIndex","previousTitle","addButtonNode","addTab","insertTab","asTitle","_adjustCurrentForInsert","_adjustCurrentForMove","removeTab","removeTabAt","_adjustCurrentForRemove","clearTabs","releaseMouse","_evtDblClick","eventPhase","CAPTURING_PHASE","_evtKeyDownCapturing","tabHandlingTabindex","_getCurrentTabindex","renderTab","elemTabindex","getAttribute","tabs","tab","innerHTML","onblur","focusedElement","focusable","nextFocused","focusedIndex","addButtonClicked","pressX","pressY","tabPos","tabSize","tabPressPos","targetIndex","tabLayout","contentRect","dragActive","dragAborted","detachRequested","closeIconSelector","dragExceeded","tabRect","tabPressOffset","snapTabLayout","detachExceeded","layoutTabs","finalizeTabPosition","duration","parseTransitionDuration","resetTabPositions","bh","Private$6","Private$5","Private$4","Private$3","Private$2","Private$1","_tabID","_tabKeys","createTabKey","createTabStyle","createTabClass","createTabDataset","createTabARIA","renderCloseIcon","addButtonSelector","DRAG_THRESHOLD","DETACH_THRESHOLD","transitionDuration","margin","marginLeft","marginTop","dx","dy","pressPos","localPos","clientPos","clientSize","targetPos","targetEnd","pxPos","threshold","ideal","tgt","final","DockLayout","_root","bar","tabBars","iterAllWidgets","iterUserWidgets","selectedWidgets","iterSelectedWidgets","iterTabBars","iterHandles","findSplitNode","holdSizes","saveLayout","holdAllSizes","createConfig","restoreLayout","mainConfig","widgetSet","normalizeAreaConfig","oldWidgets","oldTabBars","oldHandles","tabBar","realizeAreaConfig","createTabBar","_createTabBar","_createHandle","refNode","findTabNode","_insertTab","_insertSplit","_removeWidget","hitTestTabAreas","tabNode","hitTestTabNodes","borderWidth","borderHeight","removeAria","splitNode","syncHandles","maybeParent","childNode","childHandle","TabLayoutNode","splitHandle","gChild","gHandle","gSizer","_createTabNode","addAria","after","findFirstTabNode","merge","_splitRoot","normalizeSizes","GOLDEN_RATIO","sibling","SplitLayoutNode","oldRoot","newRoot","normalizeTabAreaConfig","normalizeSplitAreaConfig","realizeTabAreaConfig","realizeSplitAreaConfig","tabSizer","widgetSizer","tabBarItem","widgetItem","tabBarSizer","createNormalizedSizes","horizontal","fixed","tabId","DockPanel","_drag","_tabsMovable","_tabsConstrained","_layoutModified","_mode","_renderer","_edges","edges","DEFAULT_EDGES","tabsConstrained","overlay","Overlay","layoutModified","createSingleDocumentConfig","LayoutModified","selectWidget","activateWidget","_evtDragEnter","_evtDragLeave","_evtDragOver","_evtDrop","isGeneratedTabBarProperty","hasData","_showOverlay","zone","findDropTarget","getData","getDropRef","deltaX","deltaY","xPos","yPos","tabHeight","_onTabMoved","_onCurrentChanged","_onTabCloseRequested","_onTabDetachRequested","_onTabActivateRequested","_onTabAddRequested","MimeData","cloneNode","_hidden","geo","delay","panel","selected","panelRect","al","at","ab","rx","ry","GridLayout","_rowSpacing","_columnSpacing","_rowStarts","_columnStarts","_rowSizers","_columnSizers","rowCount","reallocSizers","columnCount","rowSpacing","clampValue","columnSpacing","rowStretch","setRowStretch","columnStretch","setColumnStretch","it","maxRow","maxCol","rowSpanCmp","getCellConfig","row","rowSpan","distributeMin","columnSpanCmp","c1","column","c2","columnSpan","fixedRowSpace","fixedColSpace","w","cellConfigProperty","setCellConfig","normalizeConfig","portion","MenuBar","_tabFocusIndex","_menus","_overflowMenu","_menuItemSizes","_overflowIndex","_forceItemsPosition","forceItemsPosition","_overflowMenuOptions","overflowMenuOptions","overflowIndex","overflowMenu","activeMenu","menus","openActiveMenu","addMenu","insertMenu","_onMenuAboutToClose","_onMenuMenuRequested","removeMenu","removeMenuAt","clearMenus","_evtFocusOut","_focusItemAt","tabFocusIndex","totalMenuSize","tabbable","overflowMenuTitle","overflowMenuItems","screenSize","_updateOverflowIndex","itemMenus","stopImmediatePropagation","_positionForMenu","newMenu","oldMenu","decrement","increment","thumb","findPart","scrollBar","thumbNode","trackNode","decrementNode","incrementNode","StackedLayout","orientationFromPlacement","plc","placementToOrientationMap","directionFromPlacement","placementToDirectionMap","Application","_delegate","_started","_bubblingKeydown","pluginRegistry","PluginRegistry","application","contextMenu","contextMenuRenderer","shell","deferredPlugins","activateDeferredPlugins","activatePlugins","activatePlugin","deactivatePlugin","deregisterPlugin","getPluginDescription","hasPlugin","isPluginActivated","listPlugins","registerPlugin","registerPlugins","resolveOptionalService","resolveRequiredService","bubblingKeydown","hostID","attachShell","addEventListeners","evtResize","evtKeydown","evtKeyup","evtContextMenu","Router","_routes","pattern","_add","route","RegExp","MockEventManager","_serverSettings","JupyterLiteServer","_router","_serviceManager","registerPluginModule","registerPluginModules","VERSION","ServiceWorkerManager","unregisterOldServiceWorkers","scriptURL","versionKey","installedVersion","getRegistrations","registrations","registration","unregister","_registration","_registrationChanged","workerUrl","fullWorkerUrl","enableCache","registrationChanged","controller","getRegistration","_setRegistration","IServiceWorkerManager","WORKER_NAME","algorithm","isPrimitive","a1","a2","deepArrayEqual","firstValue","secondValue","deepObjectEqual","deepArrayCopy","subvalue","deepObjectCopy","emptyArray","PluginData","_activated","_service","deactivate","activated","service","createPluginData","ensureNoCycle","services","dependencies","visit","visited","trace","ReferenceError","findDependents","dep","newEdges","oldSize","packagesOfInterest","poi","sorted","topologicSort","candidate","collectStartupPlugins","collection","startPlugins","ignorePlugins","fallbackRandomValues","Random","getRandomValues","crypto","msCrypto","bytes","lut","uuid4Factory","_types","_values","types","mime","_application","_validatePlugin","_plugins","_services","validatePlugin","required","t","kind","manifest","downstream","_reject","_tokenStructuralPropertyT","chain","objects","empty","enumerate","minmax","vmin","vmax","toArray","toObject","each","range","initial","accumulator","repeat","once","graph","addEdge","fromNode","toNode","stride","take","zip","iters","tuple","_fn","ObservableDisposableDelegate","DisposableSet","ObservableDisposableSet","_lingered","_tick","_ticked","_factory","_linger","linger","DEFAULT_LINGER","_standby","DEFAULT_STANDBY","_state","DEFAULT_STATE","DEFAULT_FREQUENCY","DEFAULT_NAME","_frequency","NEVER","MAX_INTERVAL","phase","ticked","asyncIterator","DISPOSED_STATE","IMMEDIATE","scheduled","sleep","DEFAULT_BACKOFF","growth","visibilityState","RateLimiter","poll","Debouncer","invoke","Throttler","_trailing","_interval","idle","_pid","nextPID","_create","_coerce","_compare","compare","ensureMap","_createValue","_coerceValue","_maybeNotify","_compareValue","ownerData","disconnectBetween","disconnectSender","disconnectReceiver","disconnectAll","_pending","receivers","receiversForSender","connection","sendersForReceiver","senders","findConnection","invokeSlot","cleanupConnections","isDeadConnection","module","createCommonjsModule","_global","global","self","Function","__g","_core","core","__e","_isObject","_anObject","_fails","_descriptors","is","_ie8DomDefine","dP","_objectDp","O","Attributes","S","valueOf","_toPrimitive","_hide","bitmap","_propertyDesc","_has","_shared","SHARED","store","copyright","_functionToString","_redefine","SRC","_uid","TO_STRING","TPL","inspectSource","safe","isFunction","_ctx","that","_aFunction","PROTOTYPE","$export","own","out","exp","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","expProto","U","W","R","_export","_toInteger","isNaN","$at","_defined","l","charCodeAt","codePointAt","$fromCodePoint","fromCodePoint","arguments$1","aLen","RangeError","parseState","lexState","doubleQuote","sign","unicode","Space_Separator","ID_Start","ID_Continue","util","isSpaceSeparator","isIdStartChar","isIdContinueChar","isDigit","isHexDigit","internalize","holder","reviver","replacement","key$1","replacement$1","lex","peek","lexStates","read","newToken","comment","invalidChar","multiLineComment","multiLineCommentAsterisk","singleLineComment","literal","identifierNameStartEscape","unicodeEscape","invalidIdentifier","identifierName","identifierNameEscape","zero","decimalInteger","decimalPointLeading","decimalPoint","decimalFraction","decimalExponent","decimalExponentSign","decimalExponentInteger","hexadecimal","hexadecimalInteger","string","hexEscape","formatChar","separatorChar","beforePropertyName","afterPropertyName","beforePropertyValue","afterPropertyValue","beforeArrayValue","afterArrayValue","end","parseStates","invalidEOF","syntaxError","replacements","hexString","SyntaxError","lineNumber","columnNumber","replacer","propertyList","replacerFunc","quote","indent","gap","serializeProperty","toJSON5","quoteString","stepback","propertyString","properties$1","serializeArray","member","serializeKey","serializeObject","quotes","product","quoteChar","firstChar","getSerializerPromise","localForageInstance","getSerializer","executeCallback","storageRepository","_driver","_initStorage","dbInfo","database","_dbInfo","iterationNumber","originalValue","serializeAsync","_dereq_","scheduleDrain","draining","Mutation","MutationObserver","WebKitMutationObserver","called","observer","nextTick","observe","characterData","MessageChannel","scriptEl","onreadystatechange","port1","port2","oldQueue","task","g","immediate","INTERNAL","handlers","REJECTED","FULFILLED","PENDING","resolver","outcome","safelyResolveThenable","QueueItem","onFulfilled","onRejected","callFulfilled","otherCallFulfilled","callRejected","otherCallRejected","unwrap","func","returnValue","getThen","thenable","onError","onSuccess","tryCatch","iterable","allResolver","outValue","_typeof","idb","indexedDB","webkitIndexedDB","mozIndexedDB","OIndexedDB","msIndexedDB","getIDB","createBlob","Blob","BlobBuilder","MSBlobBuilder","MozBlobBuilder","WebKitBlobBuilder","getBlob","Promise$1","executeTwoCallbacks","errorCallback","normalizeKey","getCallback","DETECT_BLOB_SUPPORT_STORE","supportsBlobs","dbContexts","READ_ONLY","READ_WRITE","_binStringToArrayBuffer","bin","arr","_checkBlobSupport","txn","transaction","blob","objectStore","onabort","oncomplete","matchedChrome","matchedEdge","_checkBlobSupportWithoutCaching","_deferReadiness","dbContext","deferredOperation","deferredOperations","dbReady","_advanceReadiness","_rejectReadiness","_getConnection","upgradeNeeded","forages","dbArgs","openreq","onupgradeneeded","createObjectStore","oldVersion","ex","newVersion","onsuccess","onversionchange","_getOriginalConnection","_getUpgradedConnection","_isUpgradeNeeded","defaultVersion","isNewStore","objectStoreNames","isDowngrade","isUpgrade","incVersion","_decodeBlob","encodedBlob","_isEncodedBlob","__local_forage_encoded_blob","_fullyReady","_initReady","createTransaction","retries","tx","_tryReconnect","asyncStorage","initPromises","ignoreErrors","_defaultConfig","_support","isSafari","openDatabase","hasFetch","IDBKeyRange","isIndexedDBValid","openCursor","blobSupport","reader","FileReader","onloadend","base64","readAsBinaryString","advanced","openKeyCursor","advance","dropInstance","currentConfig","dbPromise","dropObjectPromise","deleteObjectStore","_forage2","dropDBPromise","deleteDatabase","onblocked","BASE_CHARS","BLOB_TYPE_PREFIX_REGEX","SERIALIZED_MARKER","TYPE_ARRAYBUFFER","TYPE_BLOB","TYPE_INT8ARRAY","TYPE_UINT8ARRAY","TYPE_UINT8CLAMPEDARRAY","TYPE_INT16ARRAY","TYPE_INT32ARRAY","TYPE_UINT16ARRAY","TYPE_UINT32ARRAY","TYPE_FLOAT32ARRAY","TYPE_FLOAT64ARRAY","toString$1","stringToBuffer","serializedString","encoded1","encoded2","encoded3","encoded4","bufferLength","bufferToString","base64String","localforageSerializer","valueType","marker","fileReader","onload","readAsArrayBuffer","blobType","SERIALIZED_MARKER_LENGTH","matcher","Int8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","createDbTable","executeSql","tryExecuteSql","sqlStatement","SYNTAX_ERR","rows","_setItem","retriesLeft","sqlError","QUOTA_ERR","webSQLStorage","dbInfoPromise","storeNames","getAllStoreNames","operationInfo","dropTable","operations","_getKeyPrefix","defaultConfig","keyPrefix","_isLocalStorageUsable","localStorageTestKey","checkIfLocalStorageThrows","localStorageWrapper","isLocalStorageValid","keyPrefixLength","itemKey","searchElement","DefinedDrivers","DriverSupport","DefaultDrivers","INDEXEDDB","WEBSQL","LOCALSTORAGE","DefaultDriverOrder","OptionalDriverMethods","LibraryMethods","DefaultConfig","callWhenReady","libraryMethod","_key","LocalForage","driverTypeKey","instance","Constructor","_classCallCheck","driverName","_config","_driverSet","_initDriver","_wrapLibraryMethodsWithReady","setDriver","driverObject","complianceError","driverMethods","driverMethodName","methodNotImplementedFactory","methodName","_i","_len","optionalDriverMethod","configureMissingMethods","setDriverSupport","support","getDriver","getDriverPromise","serializerPromise","drivers","supportedDrivers","_getSupportedDrivers","setDriverToConfig","extendSelfWithDriver","_extend","oldDriverSetDone","currentDriverIndex","driverPromiseLoop","initDriver","supports","libraryMethodsAndProperties","localforage_js","Mime","_extensions","define","getExtension","typeMap","hasPath","$1","isNumber","isConstructorOrProto","opts","flags","bools","strings","unknownFn","unknown","boolean","allBools","aliases","aliasIsBoolean","alias","setKey","lastKey","setArg","argDefined","notFlags","letters","broken","stopEarly","commonjsGlobal","requiresPort","port","querystringify_1","pairs","parser","CRHTLF","protocolre","windowsDriveLetter","whitespace","trimLeft","rules","isSpecial","ignore","lolcation","loc","finaldestination","Url","unescape","scheme","extractProtocol","rest","forwardSlashes","otherSlashes","slashesCount","extracted","instruction","instructions","up","password","origin","qs","urlParse","context","timeoutContext","itemInArray","EventTarget","listeners","trimQueryPartFromURL","queryIndex","listener","removingListener","arrayOfListeners","this$1","customArguments","eventName","NetworkBridge","urlMap","attachWebSocket","websocket","serverURL","connectionLookup","server","websockets","addMembershipToRoom","room","roomMemberships","attachServer","serverUrl","serverLookup","websocketsLookup","removeServer","removeWebSocket","removeMembershipFromRoom","memberships","networkBridge","CLOSE_CODES","CLOSE_NORMAL","CLOSE_GOING_AWAY","CLOSE_PROTOCOL_ERROR","CLOSE_UNSUPPORTED","CLOSE_NO_STATUS","CLOSE_ABNORMAL","UNSUPPORTED_DATA","POLICY_VIOLATION","CLOSE_TOO_LARGE","MISSING_EXTENSION","INTERNAL_ERROR","SERVICE_RESTART","TRY_AGAIN_LATER","TLS_HANDSHAKE","ERROR_PREFIX","CONSTRUCTOR_ERROR","CLOSE_ERROR","EVENT","CONSTRUCT","MESSAGE","CLOSE","EventPrototype","EventPrototype$$1","eventInitConfig","timeStamp","srcElement","isTrusted","cancelBubble","__proto__","MessageEvent","lastEventId","ports","canncelBubble","CloseEvent","wasClean","eventObject","createMessageEvent","messageEvent","createCloseEvent","closeEvent","closeWebSocketConnection","WebSocket$1","CLOSING","normalizeSendData","proxies","proxyFactory","proxy","Proxy","toSocketName","EventTarget$$1","protocols","_onopen","_onmessage","_onerror","_onclose","urlRecord","urlVerification","uniq","duplicates","protocolVerification","CONNECTING","client","verifyClient","selectedProtocol","isFilled","isRequested","OPEN","prototypeAccessors","errorEvent","failWebSocketConnection","defineProperties","SocketIO$1","SocketIO","broadcast","in","off","hasListeners","leave","IO","retrieveGlobalObject","defaultOptions","Server$1","Server","originalWebSocket","mockWebsocket","globalObj","restoreWebsocket","normalizedData","messageData","broadcastList","deduped","chainedRoom","chainedBroadcaster","simulate","of","SocketIO$$1","assertPath","normalizeStringPosix","allowAboveRoot","lastSegmentLength","lastSlash","dots","lastSlashIndex","resolvedPath","resolvedAbsolute","isAbsolute","trailingSeparator","joined","fromStart","fromEnd","fromLen","toStart","toLen","lastCommonSep","fromCode","_makeLong","hasRoot","matchedSlash","extIdx","firstNonSlashEnd","startDot","startPart","preDotState","pathObject","sep","_format","ret","delimiter","win32","setupThebeLite","thebeLite","startJupyterLiteServer","serverExtensions","activePlugins","litePluginSettings","litePluginsToRegister","liteExtensionPromises","liteExtension","scope","_JUPYTERLAB","createModule","allSettled","jupyterLiteServer","extendStatics","setPrototypeOf","__extends","__","__assign","__rest","getOwnPropertySymbols","propertyIsEnumerable","__decorate","decorators","Reflect","decorate","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","__awaiter","__generator","sent","trys","ops","verb","op","__values","__read","__spread","__spreadArrays","il","jl","__await","__asyncGenerator","resume","settle","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","__classPrivateFieldGet","privateMap","__classPrivateFieldSet","controlOrWhitespace","__webpack_module_cache__","leafPrototypes","getProto","inProgress","dataWebpackPrefix","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","getPrototypeOf","ns","def","getOwnPropertyNames","definition","chunkId","globalThis","script","needAttach","scripts","getElementsByTagName","charset","nc","src","onScriptComplete","doneFns","head","toStringTag","scriptUrl","importScripts","currentScript","tagName","baseURI","installedChunks","installedChunkData","errorType","realSrc","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/pr-preview/pr-770/thebe.css b/pr-preview/pr-770/thebe.css new file mode 100644 index 00000000..9543982c --- /dev/null +++ b/pr-preview/pr-770/thebe.css @@ -0,0 +1,3356 @@ +/* ../core/dist/lib/thebe-core.css */ +:root { + --jp-shadow-base-lightness: 0; + --jp-shadow-umbra-color: rgba( var(--jp-shadow-base-lightness), var(--jp-shadow-base-lightness), var(--jp-shadow-base-lightness), 0.2 ); + --jp-shadow-penumbra-color: rgba( var(--jp-shadow-base-lightness), var(--jp-shadow-base-lightness), var(--jp-shadow-base-lightness), 0.14 ); + --jp-shadow-ambient-color: rgba( var(--jp-shadow-base-lightness), var(--jp-shadow-base-lightness), var(--jp-shadow-base-lightness), 0.12 ); + --jp-elevation-z0: none; + --jp-elevation-z1: + 0 2px 1px -1px var(--jp-shadow-umbra-color), + 0 1px 1px 0 var(--jp-shadow-penumbra-color), + 0 1px 3px 0 var(--jp-shadow-ambient-color); + --jp-elevation-z2: + 0 3px 1px -2px var(--jp-shadow-umbra-color), + 0 2px 2px 0 var(--jp-shadow-penumbra-color), + 0 1px 5px 0 var(--jp-shadow-ambient-color); + --jp-elevation-z4: + 0 2px 4px -1px var(--jp-shadow-umbra-color), + 0 4px 5px 0 var(--jp-shadow-penumbra-color), + 0 1px 10px 0 var(--jp-shadow-ambient-color); + --jp-elevation-z6: + 0 3px 5px -1px var(--jp-shadow-umbra-color), + 0 6px 10px 0 var(--jp-shadow-penumbra-color), + 0 1px 18px 0 var(--jp-shadow-ambient-color); + --jp-elevation-z8: + 0 5px 5px -3px var(--jp-shadow-umbra-color), + 0 8px 10px 1px var(--jp-shadow-penumbra-color), + 0 3px 14px 2px var(--jp-shadow-ambient-color); + --jp-elevation-z12: + 0 7px 8px -4px var(--jp-shadow-umbra-color), + 0 12px 17px 2px var(--jp-shadow-penumbra-color), + 0 5px 22px 4px var(--jp-shadow-ambient-color); + --jp-elevation-z16: + 0 8px 10px -5px var(--jp-shadow-umbra-color), + 0 16px 24px 2px var(--jp-shadow-penumbra-color), + 0 6px 30px 5px var(--jp-shadow-ambient-color); + --jp-elevation-z20: + 0 10px 13px -6px var(--jp-shadow-umbra-color), + 0 20px 31px 3px var(--jp-shadow-penumbra-color), + 0 8px 38px 7px var(--jp-shadow-ambient-color); + --jp-elevation-z24: + 0 11px 15px -7px var(--jp-shadow-umbra-color), + 0 24px 38px 3px var(--jp-shadow-penumbra-color), + 0 9px 46px 8px var(--jp-shadow-ambient-color); + --jp-border-width: 1px; + --jp-border-color0: var(--md-grey-400, #bdbdbd); + --jp-border-color1: var(--md-grey-400, #bdbdbd); + --jp-border-color2: var(--md-grey-300, #e0e0e0); + --jp-border-color3: var(--md-grey-200, #eee); + --jp-inverse-border-color: var(--md-grey-600, #757575); + --jp-border-radius: 2px; + --jp-ui-font-scale-factor: 1.2; + --jp-ui-font-size0: 0.83333em; + --jp-ui-font-size1: 13px; + --jp-ui-font-size2: 1.2em; + --jp-ui-font-size3: 1.44em; + --jp-ui-font-family: + system-ui, + -apple-system, + blinkmacsystemfont, + "Segoe UI", + helvetica, + arial, + sans-serif, + "Apple Color Emoji", + "Segoe UI Emoji", + "Segoe UI Symbol"; + --jp-ui-font-color0: rgba(0, 0, 0, 1); + --jp-ui-font-color1: rgba(0, 0, 0, 0.87); + --jp-ui-font-color2: rgba(0, 0, 0, 0.54); + --jp-ui-font-color3: rgba(0, 0, 0, 0.38); + --jp-ui-inverse-font-color0: rgba(255, 255, 255, 1); + --jp-ui-inverse-font-color1: rgba(255, 255, 255, 1); + --jp-ui-inverse-font-color2: rgba(255, 255, 255, 0.7); + --jp-ui-inverse-font-color3: rgba(255, 255, 255, 0.5); + --jp-content-line-height: 1.6; + --jp-content-font-scale-factor: 1.2; + --jp-content-font-size0: 0.83333em; + --jp-content-font-size1: 14px; + --jp-content-font-size2: 1.2em; + --jp-content-font-size3: 1.44em; + --jp-content-font-size4: 1.728em; + --jp-content-font-size5: 2.0736em; + --jp-content-presentation-font-size1: 17px; + --jp-content-heading-line-height: 1; + --jp-content-heading-margin-top: 1.2em; + --jp-content-heading-margin-bottom: 0.8em; + --jp-content-heading-font-weight: 500; + --jp-content-font-color0: rgba(0, 0, 0, 1); + --jp-content-font-color1: rgba(0, 0, 0, 0.87); + --jp-content-font-color2: rgba(0, 0, 0, 0.54); + --jp-content-font-color3: rgba(0, 0, 0, 0.38); + --jp-content-link-color: var(--md-blue-900, #0d47a1); + --jp-content-link-visited-color: var(--md-purple-700, #7b1fa2); + --jp-content-font-family: + system-ui, + -apple-system, + blinkmacsystemfont, + "Segoe UI", + helvetica, + arial, + sans-serif, + "Apple Color Emoji", + "Segoe UI Emoji", + "Segoe UI Symbol"; + --jp-code-font-size: 13px; + --jp-code-line-height: 1.3077; + --jp-code-padding: 5px; + --jp-code-font-family-default: + menlo, + consolas, + "DejaVu Sans Mono", + monospace; + --jp-code-font-family: var(--jp-code-font-family-default); + --jp-code-presentation-font-size: 16px; + --jp-code-cursor-width0: 1.4px; + --jp-code-cursor-width1: 2px; + --jp-code-cursor-width2: 4px; + --jp-layout-color0: white; + --jp-layout-color1: white; + --jp-layout-color2: var(--md-grey-200, #eee); + --jp-layout-color3: var(--md-grey-400, #bdbdbd); + --jp-layout-color4: var(--md-grey-600, #757575); + --jp-inverse-layout-color0: #111; + --jp-inverse-layout-color1: var(--md-grey-900, #212121); + --jp-inverse-layout-color2: var(--md-grey-800, #424242); + --jp-inverse-layout-color3: var(--md-grey-700, #616161); + --jp-inverse-layout-color4: var(--md-grey-600, #757575); + --jp-brand-color0: var(--md-blue-900, #0d47a1); + --jp-brand-color1: var(--md-blue-700, #1976d2); + --jp-brand-color2: var(--md-blue-300, #64b5f6); + --jp-brand-color3: var(--md-blue-100, #bbdefb); + --jp-brand-color4: var(--md-blue-50, #e3f2fd); + --jp-accent-color0: var(--md-green-900, #1b5e20); + --jp-accent-color1: var(--md-green-700, #388e3c); + --jp-accent-color2: var(--md-green-300, #81c784); + --jp-accent-color3: var(--md-green-100, #c8e6c9); + --jp-warn-color0: var(--md-orange-900, #e65100); + --jp-warn-color1: var(--md-orange-700, #f57c00); + --jp-warn-color2: var(--md-orange-300, #ffb74d); + --jp-warn-color3: var(--md-orange-100, #ffe0b2); + --jp-error-color0: var(--md-red-900, #b71c1c); + --jp-error-color1: var(--md-red-700, #d32f2f); + --jp-error-color2: var(--md-red-300, #e57373); + --jp-error-color3: var(--md-red-100, #ffcdd2); + --jp-success-color0: var(--md-green-900, #1b5e20); + --jp-success-color1: var(--md-green-700, #388e3c); + --jp-success-color2: var(--md-green-300, #81c784); + --jp-success-color3: var(--md-green-100, #c8e6c9); + --jp-info-color0: var(--md-cyan-900, #006064); + --jp-info-color1: var(--md-cyan-700, #0097a7); + --jp-info-color2: var(--md-cyan-300, #4dd0e1); + --jp-info-color3: var(--md-cyan-100, #b2ebf2); + --jp-cell-padding: 5px; + --jp-cell-collapser-width: 8px; + --jp-cell-collapser-min-height: 20px; + --jp-cell-collapser-not-active-hover-opacity: 0.6; + --jp-cell-editor-background: var(--md-grey-100, #f5f5f5); + --jp-cell-editor-border-color: var(--md-grey-300, #e0e0e0); + --jp-cell-editor-box-shadow: inset 0 0 2px var(--md-blue-300, #64b5f6); + --jp-cell-editor-active-background: var(--jp-layout-color0); + --jp-cell-editor-active-border-color: var(--jp-brand-color1); + --jp-cell-prompt-width: 64px; + --jp-cell-prompt-font-family: var(--jp-code-font-family-default); + --jp-cell-prompt-letter-spacing: 0; + --jp-cell-prompt-opacity: 1; + --jp-cell-prompt-not-active-opacity: 0.5; + --jp-cell-prompt-not-active-font-color: var(--md-grey-700, #616161); + --jp-cell-inprompt-font-color: #307fc1; + --jp-cell-outprompt-font-color: #bf5b3d; + --jp-notebook-padding: 10px; + --jp-notebook-select-background: var(--jp-layout-color1); + --jp-notebook-multiselected-color: var(--md-blue-50, #e3f2fd); + --jp-notebook-scroll-padding: calc( 100% - var(--jp-code-font-size) * var(--jp-code-line-height) - var(--jp-code-padding) - var(--jp-cell-padding) - 1px ); + --jp-rendermime-error-background: #fdd; + --jp-rendermime-table-row-background: var(--md-grey-100, #cfd8dc); + --jp-rendermime-table-row-hover-background: var(--md-light-blue-50, #e1f5fe); + --jp-dialog-background: rgba(0, 0, 0, 0.25); + --jp-console-padding: 10px; + --jp-toolbar-border-color: var(--jp-border-color1); + --jp-toolbar-micro-height: 8px; + --jp-toolbar-background: var(--jp-layout-color1); + --jp-toolbar-box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.24); + --jp-toolbar-header-margin: 4px 4px 0 4px; + --jp-toolbar-active-background: var(--md-grey-300, #90a4ae); + --jp-statusbar-height: 24px; + --jp-input-box-shadow: inset 0 0 2px var(--md-blue-300, #64b5f6); + --jp-input-active-background: var(--jp-layout-color1); + --jp-input-hover-background: var(--jp-layout-color1); + --jp-input-background: var(--md-grey-100, #f5f5f5); + --jp-input-border-color: var(--jp-inverse-border-color); + --jp-input-active-border-color: var(--jp-brand-color1); + --jp-input-active-box-shadow-color: rgba(19, 124, 189, 0.3); + --jp-editor-selected-background: #d9d9d9; + --jp-editor-selected-focused-background: #d7d4f0; + --jp-editor-cursor-color: var(--jp-ui-font-color0); + --jp-mirror-editor-keyword-color: #008000; + --jp-mirror-editor-atom-color: #88f; + --jp-mirror-editor-number-color: #080; + --jp-mirror-editor-def-color: #00f; + --jp-mirror-editor-variable-color: var(--md-grey-900, #212121); + --jp-mirror-editor-variable-2-color: rgb(0, 54, 109); + --jp-mirror-editor-variable-3-color: #085; + --jp-mirror-editor-punctuation-color: #05a; + --jp-mirror-editor-property-color: #05a; + --jp-mirror-editor-operator-color: #a2f; + --jp-mirror-editor-comment-color: #408080; + --jp-mirror-editor-string-color: #ba2121; + --jp-mirror-editor-string-2-color: #708; + --jp-mirror-editor-meta-color: #a2f; + --jp-mirror-editor-qualifier-color: #555; + --jp-mirror-editor-builtin-color: #008000; + --jp-mirror-editor-bracket-color: #997; + --jp-mirror-editor-tag-color: #170; + --jp-mirror-editor-attribute-color: #00c; + --jp-mirror-editor-header-color: blue; + --jp-mirror-editor-quote-color: #090; + --jp-mirror-editor-link-color: #00c; + --jp-mirror-editor-error-color: #f00; + --jp-mirror-editor-hr-color: #999; + --jp-collaborator-color1: #ffad8e; + --jp-collaborator-color2: #dac83d; + --jp-collaborator-color3: #72dd76; + --jp-collaborator-color4: #00e4d0; + --jp-collaborator-color5: #45d4ff; + --jp-collaborator-color6: #e2b1ff; + --jp-collaborator-color7: #ff9de6; + --jp-vega-background: white; + --jp-sidebar-min-width: 250px; + --jp-search-toggle-off-opacity: 0.5; + --jp-search-toggle-hover-opacity: 0.8; + --jp-search-toggle-on-opacity: 1; + --jp-search-selected-match-background-color: rgb(245, 200, 0); + --jp-search-selected-match-color: black; + --jp-search-unselected-match-background-color: var( --jp-inverse-layout-color0 ); + --jp-search-unselected-match-color: var(--jp-ui-inverse-font-color0); + --jp-icon-contrast-color0: var(--md-purple-600, #8e24aa); + --jp-icon-contrast-color1: var(--md-green-600, #43a047); + --jp-icon-contrast-color2: var(--md-pink-600, #d81b60); + --jp-icon-contrast-color3: var(--md-blue-600, #1e88e5); + --jp-accept-color-normal: var(--md-blue-700, #1976d2); + --jp-accept-color-hover: var(--md-blue-800, #1565c0); + --jp-accept-color-active: var(--md-blue-900, #0d47a1); + --jp-warn-color-normal: var(--md-red-700, #d32f2f); + --jp-warn-color-hover: var(--md-red-800, #c62828); + --jp-warn-color-active: var(--md-red-900, #b71c1c); + --jp-reject-color-normal: var(--md-grey-600, #757575); + --jp-reject-color-hover: var(--md-grey-700, #616161); + --jp-reject-color-active: var(--md-grey-800, #424242); + --jp-jupyter-icon-color: #f37626; + --jp-notebook-icon-color: #f37626; + --jp-json-icon-color: var(--md-orange-700, #f57c00); + --jp-console-icon-background-color: var(--md-blue-700, #1976d2); + --jp-console-icon-color: white; + --jp-terminal-icon-background-color: var(--md-grey-800, #424242); + --jp-terminal-icon-color: var(--md-grey-200, #eee); + --jp-text-editor-icon-color: var(--md-grey-700, #616161); + --jp-inspector-icon-color: var(--md-grey-700, #616161); + --jp-switch-color: var(--md-grey-400, #bdbdbd); + --jp-switch-true-position-color: var(--md-orange-900, #e65100); +} +tt, +code, +kbd, +samp, +pre { + font-family: var(--jp-code-font-family); + font-size: var(--jp-code-font-size); + line-height: var(--jp-code-line-height); +} +.jupyter-widgets.widget-tab > .p-TabBar, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar { + display: flex; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.jupyter-widgets.widget-tab > .p-TabBar[data-orientation=horizontal], +.jupyter-widgets.jupyter-widget-tab > .p-TabBar[data-orientation=horizontal], +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar[data-orientation=horizontal] { + flex-direction: row; +} +.jupyter-widgets.widget-tab > .p-TabBar[data-orientation=vertical], +.jupyter-widgets.jupyter-widget-tab > .p-TabBar[data-orientation=vertical], +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar[data-orientation=vertical] { + flex-direction: column; +} +.jupyter-widgets.widget-tab > .p-TabBar > .p-TabBar-content, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar > .p-TabBar-content, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar > .lm-TabBar-content { + margin: 0; + padding: 0; + display: flex; + flex: 1 1 auto; + list-style-type: none; +} +.jupyter-widgets.widget-tab > .p-TabBar[data-orientation=horizontal] > .p-TabBar-content, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar[data-orientation=horizontal] > .p-TabBar-content, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar[data-orientation=horizontal] > .lm-TabBar-content { + flex-direction: row; +} +.jupyter-widgets.widget-tab > .p-TabBar[data-orientation=vertical] > .p-TabBar-content, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar[data-orientation=vertical] > .p-TabBar-content, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar[data-orientation=vertical] > .lm-TabBar-content { + flex-direction: column; +} +.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab { + display: flex; + flex-direction: row; + box-sizing: border-box; + overflow: hidden; +} +.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabIcon, +.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabCloseIcon, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabIcon, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabCloseIcon, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabIcon, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabCloseIcon { + flex: 0 0 auto; +} +.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabLabel, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabLabel, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabLabel { + flex: 1 1 auto; + overflow: hidden; + white-space: nowrap; +} +.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab.p-mod-hidden, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab.p-mod-hidden, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab.lm-mod-hidden { + display: none !important; +} +.jupyter-widgets.widget-tab > .p-TabBar.p-mod-dragging .p-TabBar-tab, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar.p-mod-dragging .p-TabBar-tab, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar.lm-mod-dragging .lm-TabBar-tab { + position: relative; +} +.jupyter-widgets.widget-tab > .p-TabBar.p-mod-dragging[data-orientation=horizontal] .p-TabBar-tab, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar.p-mod-dragging[data-orientation=horizontal] .p-TabBar-tab, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar.lm-mod-dragging[data-orientation=horizontal] .lm-TabBar-tab { + left: 0; + transition: left 150ms ease; +} +.jupyter-widgets.widget-tab > .p-TabBar.p-mod-dragging[data-orientation=vertical] .p-TabBar-tab, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar.p-mod-dragging[data-orientation=vertical] .p-TabBar-tab, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar.lm-mod-dragging[data-orientation=vertical] .lm-TabBar-tab { + top: 0; + transition: top 150ms ease; +} +.jupyter-widgets.widget-tab > .p-TabBar.p-mod-dragging .p-TabBar-tab.p-mod-dragging, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar.p-mod-dragging .p-TabBar-tab.p-mod-dragging, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging { + transition: none; +} +.widget-slider, +.jupyter-widget-slider { +} +.widget-slider .noUi-target, +.jupyter-widget-slider .noUi-target, +.widget-slider .noUi-target *, +.jupyter-widget-slider .noUi-target * { + -webkit-touch-callout: none; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + -webkit-user-select: none; + -ms-touch-action: none; + touch-action: none; + -ms-user-select: none; + -moz-user-select: none; + user-select: none; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.widget-slider .noUi-target, +.jupyter-widget-slider .noUi-target { + position: relative; +} +.widget-slider .noUi-base, +.jupyter-widget-slider .noUi-base, +.widget-slider .noUi-connects, +.jupyter-widget-slider .noUi-connects { + width: 100%; + height: 100%; + position: relative; + z-index: 1; +} +.widget-slider .noUi-connects, +.jupyter-widget-slider .noUi-connects { + overflow: hidden; + z-index: 0; +} +.widget-slider .noUi-connect, +.jupyter-widget-slider .noUi-connect, +.widget-slider .noUi-origin, +.jupyter-widget-slider .noUi-origin { + will-change: transform; + position: absolute; + z-index: 1; + top: 0; + right: 0; + -ms-transform-origin: 0 0; + -webkit-transform-origin: 0 0; + -webkit-transform-style: preserve-3d; + transform-origin: 0 0; + transform-style: flat; +} +.widget-slider .noUi-connect, +.jupyter-widget-slider .noUi-connect { + height: 100%; + width: 100%; +} +.widget-slider .noUi-origin, +.jupyter-widget-slider .noUi-origin { + height: 10%; + width: 10%; +} +.widget-slider .noUi-txt-dir-rtl.noUi-horizontal .noUi-origin, +.jupyter-widget-slider .noUi-txt-dir-rtl.noUi-horizontal .noUi-origin { + left: 0; + right: auto; +} +.widget-slider .noUi-vertical .noUi-origin, +.jupyter-widget-slider .noUi-vertical .noUi-origin { + width: 0; +} +.widget-slider .noUi-horizontal .noUi-origin, +.jupyter-widget-slider .noUi-horizontal .noUi-origin { + height: 0; +} +.widget-slider .noUi-handle, +.jupyter-widget-slider .noUi-handle { + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + position: absolute; +} +.widget-slider .noUi-touch-area, +.jupyter-widget-slider .noUi-touch-area { + height: 100%; + width: 100%; +} +.widget-slider .noUi-state-tap .noUi-connect, +.jupyter-widget-slider .noUi-state-tap .noUi-connect, +.widget-slider .noUi-state-tap .noUi-origin, +.jupyter-widget-slider .noUi-state-tap .noUi-origin { + -webkit-transition: transform 0.3s; + transition: transform 0.3s; +} +.widget-slider .noUi-state-drag *, +.jupyter-widget-slider .noUi-state-drag * { + cursor: inherit !important; +} +.widget-slider .noUi-horizontal, +.jupyter-widget-slider .noUi-horizontal { + height: 18px; +} +.widget-slider .noUi-horizontal .noUi-handle, +.jupyter-widget-slider .noUi-horizontal .noUi-handle { + width: 34px; + height: 28px; + right: -17px; + top: -6px; +} +.widget-slider .noUi-vertical, +.jupyter-widget-slider .noUi-vertical { + width: 18px; +} +.widget-slider .noUi-vertical .noUi-handle, +.jupyter-widget-slider .noUi-vertical .noUi-handle { + width: 28px; + height: 34px; + right: -6px; + top: -17px; +} +.widget-slider .noUi-txt-dir-rtl.noUi-horizontal .noUi-handle, +.jupyter-widget-slider .noUi-txt-dir-rtl.noUi-horizontal .noUi-handle { + left: -17px; + right: auto; +} +.widget-slider .noUi-target, +.jupyter-widget-slider .noUi-target { + background: #FAFAFA; + border-radius: 4px; + border: 1px solid #D3D3D3; + box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB; +} +.widget-slider .noUi-connects, +.jupyter-widget-slider .noUi-connects { + border-radius: 3px; +} +.widget-slider .noUi-connect, +.jupyter-widget-slider .noUi-connect { + background: #3FB8AF; +} +.widget-slider .noUi-draggable, +.jupyter-widget-slider .noUi-draggable { + cursor: ew-resize; +} +.widget-slider .noUi-vertical .noUi-draggable, +.jupyter-widget-slider .noUi-vertical .noUi-draggable { + cursor: ns-resize; +} +.widget-slider .noUi-handle, +.jupyter-widget-slider .noUi-handle { + border: 1px solid #D9D9D9; + border-radius: 3px; + background: #FFF; + cursor: default; + box-shadow: + inset 0 0 1px #FFF, + inset 0 1px 7px #EBEBEB, + 0 3px 6px -3px #BBB; +} +.widget-slider .noUi-active, +.jupyter-widget-slider .noUi-active { + box-shadow: + inset 0 0 1px #FFF, + inset 0 1px 7px #DDD, + 0 3px 6px -3px #BBB; +} +.widget-slider .noUi-handle:before, +.jupyter-widget-slider .noUi-handle:before, +.widget-slider .noUi-handle:after, +.jupyter-widget-slider .noUi-handle:after { + content: ""; + display: block; + position: absolute; + height: 14px; + width: 1px; + background: #E8E7E6; + left: 14px; + top: 6px; +} +.widget-slider .noUi-handle:after, +.jupyter-widget-slider .noUi-handle:after { + left: 17px; +} +.widget-slider .noUi-vertical .noUi-handle:before, +.jupyter-widget-slider .noUi-vertical .noUi-handle:before, +.widget-slider .noUi-vertical .noUi-handle:after, +.jupyter-widget-slider .noUi-vertical .noUi-handle:after { + width: 14px; + height: 1px; + left: 6px; + top: 14px; +} +.widget-slider .noUi-vertical .noUi-handle:after, +.jupyter-widget-slider .noUi-vertical .noUi-handle:after { + top: 17px; +} +.widget-slider [disabled] .noUi-connect, +.jupyter-widget-slider [disabled] .noUi-connect { + background: #B8B8B8; +} +.widget-slider [disabled].noUi-target, +.jupyter-widget-slider [disabled].noUi-target, +.widget-slider [disabled].noUi-handle, +.jupyter-widget-slider [disabled].noUi-handle, +.widget-slider [disabled] .noUi-handle, +.jupyter-widget-slider [disabled] .noUi-handle { + cursor: not-allowed; +} +.widget-slider .noUi-pips, +.jupyter-widget-slider .noUi-pips, +.widget-slider .noUi-pips *, +.jupyter-widget-slider .noUi-pips * { + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.widget-slider .noUi-pips, +.jupyter-widget-slider .noUi-pips { + position: absolute; + color: #999; +} +.widget-slider .noUi-value, +.jupyter-widget-slider .noUi-value { + position: absolute; + white-space: nowrap; + text-align: center; +} +.widget-slider .noUi-value-sub, +.jupyter-widget-slider .noUi-value-sub { + color: #ccc; + font-size: 10px; +} +.widget-slider .noUi-marker, +.jupyter-widget-slider .noUi-marker { + position: absolute; + background: #CCC; +} +.widget-slider .noUi-marker-sub, +.jupyter-widget-slider .noUi-marker-sub { + background: #AAA; +} +.widget-slider .noUi-marker-large, +.jupyter-widget-slider .noUi-marker-large { + background: #AAA; +} +.widget-slider .noUi-pips-horizontal, +.jupyter-widget-slider .noUi-pips-horizontal { + padding: 10px 0; + height: 80px; + top: 100%; + left: 0; + width: 100%; +} +.widget-slider .noUi-value-horizontal, +.jupyter-widget-slider .noUi-value-horizontal { + -webkit-transform: translate(-50%, 50%); + transform: translate(-50%, 50%); +} +.noUi-rtl .widget-slider .noUi-value-horizontal, +.noUi-rtl .jupyter-widget-slider .noUi-value-horizontal { + -webkit-transform: translate(50%, 50%); + transform: translate(50%, 50%); +} +.widget-slider .noUi-marker-horizontal.noUi-marker, +.jupyter-widget-slider .noUi-marker-horizontal.noUi-marker { + margin-left: -1px; + width: 2px; + height: 5px; +} +.widget-slider .noUi-marker-horizontal.noUi-marker-sub, +.jupyter-widget-slider .noUi-marker-horizontal.noUi-marker-sub { + height: 10px; +} +.widget-slider .noUi-marker-horizontal.noUi-marker-large, +.jupyter-widget-slider .noUi-marker-horizontal.noUi-marker-large { + height: 15px; +} +.widget-slider .noUi-pips-vertical, +.jupyter-widget-slider .noUi-pips-vertical { + padding: 0 10px; + height: 100%; + top: 0; + left: 100%; +} +.widget-slider .noUi-value-vertical, +.jupyter-widget-slider .noUi-value-vertical { + -webkit-transform: translate(0, -50%); + transform: translate(0, -50%); + padding-left: 25px; +} +.noUi-rtl .widget-slider .noUi-value-vertical, +.noUi-rtl .jupyter-widget-slider .noUi-value-vertical { + -webkit-transform: translate(0, 50%); + transform: translate(0, 50%); +} +.widget-slider .noUi-marker-vertical.noUi-marker, +.jupyter-widget-slider .noUi-marker-vertical.noUi-marker { + width: 5px; + height: 2px; + margin-top: -1px; +} +.widget-slider .noUi-marker-vertical.noUi-marker-sub, +.jupyter-widget-slider .noUi-marker-vertical.noUi-marker-sub { + width: 10px; +} +.widget-slider .noUi-marker-vertical.noUi-marker-large, +.jupyter-widget-slider .noUi-marker-vertical.noUi-marker-large { + width: 15px; +} +.widget-slider .noUi-tooltip, +.jupyter-widget-slider .noUi-tooltip { + display: block; + position: absolute; + border: 1px solid #D9D9D9; + border-radius: 3px; + background: #fff; + color: #000; + padding: 5px; + text-align: center; + white-space: nowrap; +} +.widget-slider .noUi-horizontal .noUi-tooltip, +.jupyter-widget-slider .noUi-horizontal .noUi-tooltip { + -webkit-transform: translate(-50%, 0); + transform: translate(-50%, 0); + left: 50%; + bottom: 120%; +} +.widget-slider .noUi-vertical .noUi-tooltip, +.jupyter-widget-slider .noUi-vertical .noUi-tooltip { + -webkit-transform: translate(0, -50%); + transform: translate(0, -50%); + top: 50%; + right: 120%; +} +.widget-slider .noUi-horizontal .noUi-origin > .noUi-tooltip, +.jupyter-widget-slider .noUi-horizontal .noUi-origin > .noUi-tooltip { + -webkit-transform: translate(50%, 0); + transform: translate(50%, 0); + left: auto; + bottom: 10px; +} +.widget-slider .noUi-vertical .noUi-origin > .noUi-tooltip, +.jupyter-widget-slider .noUi-vertical .noUi-origin > .noUi-tooltip { + -webkit-transform: translate(0, -18px); + transform: translate(0, -18px); + top: auto; + right: 28px; +} +.widget-slider .noUi-connect, +.jupyter-widget-slider .noUi-connect { + background: #2196f3; +} +.widget-slider .noUi-horizontal, +.jupyter-widget-slider .noUi-horizontal { + height: var(--jp-widgets-slider-track-thickness); +} +.widget-slider .noUi-vertical, +.jupyter-widget-slider .noUi-vertical { + width: var(--jp-widgets-slider-track-thickness); + height: 100%; +} +.widget-slider .noUi-horizontal .noUi-handle, +.jupyter-widget-slider .noUi-horizontal .noUi-handle { + width: var(--jp-widgets-slider-handle-size); + height: var(--jp-widgets-slider-handle-size); + border-radius: 50%; + top: calc((var(--jp-widgets-slider-track-thickness) - var(--jp-widgets-slider-handle-size)) / 2); + right: calc(var(--jp-widgets-slider-handle-size) / -2); +} +.widget-slider .noUi-vertical .noUi-handle, +.jupyter-widget-slider .noUi-vertical .noUi-handle { + height: var(--jp-widgets-slider-handle-size); + width: var(--jp-widgets-slider-handle-size); + border-radius: 50%; + right: calc((var(--jp-widgets-slider-handle-size) - var(--jp-widgets-slider-track-thickness)) / -2); + top: calc(var(--jp-widgets-slider-handle-size) / -2); +} +.widget-slider .noUi-handle:after, +.jupyter-widget-slider .noUi-handle:after { + content: none; +} +.widget-slider .noUi-handle:before, +.jupyter-widget-slider .noUi-handle:before { + content: none; +} +.widget-slider .noUi-target, +.jupyter-widget-slider .noUi-target { + background: #fafafa; + border-radius: 4px; + border: 1px; +} +.widget-slider .ui-slider, +.jupyter-widget-slider .ui-slider { + border: var(--jp-widgets-slider-border-width) solid var(--jp-layout-color3); + background: var(--jp-layout-color3); + box-sizing: border-box; + position: relative; + border-radius: 0px; +} +.widget-slider .noUi-handle, +.jupyter-widget-slider .noUi-handle { + width: var(--jp-widgets-slider-handle-size); + border: 1px solid #d9d9d9; + border-radius: 3px; + background: #fff; + cursor: default; + box-shadow: none; + outline: none; +} +.widget-slider .noUi-target:not([disabled]) .noUi-handle:hover, +.jupyter-widget-slider .noUi-target:not([disabled]) .noUi-handle:hover, +.widget-slider .noUi-target:not([disabled]) .noUi-handle:focus, +.jupyter-widget-slider .noUi-target:not([disabled]) .noUi-handle:focus { + background-color: var(--jp-widgets-slider-active-handle-color); + border: var(--jp-widgets-slider-border-width) solid var(--jp-widgets-slider-active-handle-color); +} +.widget-slider [disabled].noUi-target, +.jupyter-widget-slider [disabled].noUi-target { + opacity: 0.35; +} +.widget-slider .noUi-connects, +.jupyter-widget-slider .noUi-connects { + overflow: visible; + z-index: 0; + background: var(--jp-layout-color3); +} +.widget-slider .noUi-vertical .noUi-connect, +.jupyter-widget-slider .noUi-vertical .noUi-connect { + width: calc(100% + 2px); + right: -1px; +} +.widget-slider .noUi-horizontal .noUi-connect, +.jupyter-widget-slider .noUi-horizontal .noUi-connect { + height: calc(100% + 2px); + top: -1px; +} +:root { + --jp-widgets-color: var(--jp-content-font-color1); + --jp-widgets-label-color: var(--jp-widgets-color); + --jp-widgets-readout-color: var(--jp-widgets-color); + --jp-widgets-font-size: var(--jp-ui-font-size1); + --jp-widgets-margin: 2px; + --jp-widgets-inline-height: 28px; + --jp-widgets-inline-width: 300px; + --jp-widgets-inline-width-short: calc( var(--jp-widgets-inline-width) / 2 - var(--jp-widgets-margin) ); + --jp-widgets-inline-width-tiny: calc( var(--jp-widgets-inline-width-short) / 2 - var(--jp-widgets-margin) ); + --jp-widgets-inline-margin: 4px; + --jp-widgets-inline-label-width: 80px; + --jp-widgets-border-width: var(--jp-border-width); + --jp-widgets-vertical-height: 200px; + --jp-widgets-horizontal-tab-height: 24px; + --jp-widgets-horizontal-tab-width: 144px; + --jp-widgets-horizontal-tab-top-border: 2px; + --jp-widgets-progress-thickness: 20px; + --jp-widgets-container-padding: 15px; + --jp-widgets-input-padding: 4px; + --jp-widgets-radio-item-height-adjustment: 8px; + --jp-widgets-radio-item-height: calc( var(--jp-widgets-inline-height) - var(--jp-widgets-radio-item-height-adjustment) ); + --jp-widgets-slider-track-thickness: 4px; + --jp-widgets-slider-border-width: var(--jp-widgets-border-width); + --jp-widgets-slider-handle-size: 16px; + --jp-widgets-slider-handle-border-color: var(--jp-border-color1); + --jp-widgets-slider-handle-background-color: var(--jp-layout-color1); + --jp-widgets-slider-active-handle-color: var(--jp-brand-color1); + --jp-widgets-menu-item-height: 24px; + --jp-widgets-dropdown-arrow: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxOCAxOCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTggMTg7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDpub25lO30KPC9zdHlsZT4KPHBhdGggZD0iTTUuMiw1LjlMOSw5LjdsMy44LTMuOGwxLjIsMS4ybC00LjksNWwtNC45LTVMNS4yLDUuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTAtMC42aDE4djE4SDBWLTAuNnoiLz4KPC9zdmc+Cg); + --jp-widgets-input-color: var(--jp-ui-font-color1); + --jp-widgets-input-background-color: var(--jp-layout-color1); + --jp-widgets-input-border-color: var(--jp-border-color1); + --jp-widgets-input-focus-border-color: var(--jp-brand-color2); + --jp-widgets-input-border-width: var(--jp-widgets-border-width); + --jp-widgets-disabled-opacity: 0.6; + --md-shadow-key-umbra-opacity: 0.2; + --md-shadow-key-penumbra-opacity: 0.14; + --md-shadow-ambient-shadow-opacity: 0.12; +} +.jupyter-widgets { + margin: var(--jp-widgets-margin); + box-sizing: border-box; + color: var(--jp-widgets-color); + overflow: visible; +} +.jp-Output-result > .jupyter-widgets { + margin-left: 0; + margin-right: 0; +} +.widget-inline-hbox, +.jupyter-widget-inline-hbox { + box-sizing: border-box; + display: flex; + flex-direction: row; + align-items: baseline; +} +.widget-inline-vbox, +.jupyter-widget-inline-vbox { + box-sizing: border-box; + display: flex; + flex-direction: column; + align-items: center; +} +.widget-box, +.jupyter-widget-box { + box-sizing: border-box; + display: flex; + margin: 0; + overflow: auto; +} +.widget-gridbox, +.jupyter-widget-gridbox { + box-sizing: border-box; + display: grid; + margin: 0; + overflow: auto; +} +.widget-hbox, +.jupyter-widget-hbox { + flex-direction: row; +} +.widget-vbox, +.jupyter-widget-vbox { + flex-direction: column; +} +.jupyter-widget-tagsinput { + display: flex; + flex-direction: row; + flex-wrap: wrap; + align-items: center; + overflow: auto; + cursor: text; +} +.jupyter-widget-tag { + padding-left: 10px; + padding-right: 10px; + padding-top: 0px; + padding-bottom: 0px; + display: inline-block; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: center; + font-size: var(--jp-widgets-font-size); + height: calc(var(--jp-widgets-inline-height) - 2px); + border: 0px solid; + line-height: calc(var(--jp-widgets-inline-height) - 2px); + box-shadow: none; + color: var(--jp-ui-font-color1); + background-color: var(--jp-layout-color2); + border-color: var(--jp-border-color2); + border: none; + user-select: none; + cursor: grab; + transition: margin-left 200ms; + margin: 1px 1px 1px 1px; +} +.jupyter-widget-tag.mod-active { + box-shadow: + 0 4px 5px 0 rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)), + 0 1px 10px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity)), + 0 2px 4px -1px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity)); + color: var(--jp-ui-font-color1); + background-color: var(--jp-layout-color3); +} +.jupyter-widget-colortag { + color: var(--jp-inverse-ui-font-color1); +} +.jupyter-widget-colortag.mod-active { + color: var(--jp-inverse-ui-font-color0); +} +.jupyter-widget-taginput { + color: var(--jp-ui-font-color0); + background-color: var(--jp-layout-color0); + cursor: text; + text-align: left; +} +.jupyter-widget-taginput:focus { + outline: none; +} +.jupyter-widget-tag-close { + margin-left: var(--jp-widgets-inline-margin); + padding: 2px 0px 2px 2px; +} +.jupyter-widget-tag-close:hover { + cursor: pointer; +} +.jupyter-widget-tag.mod-primary { + color: var(--jp-inverse-ui-font-color1); + background-color: var(--jp-brand-color1); +} +.jupyter-widget-tag.mod-primary.mod-active { + color: var(--jp-inverse-ui-font-color0); + background-color: var(--jp-brand-color0); +} +.jupyter-widget-tag.mod-success { + color: var(--jp-inverse-ui-font-color1); + background-color: var(--jp-success-color1); +} +.jupyter-widget-tag.mod-success.mod-active { + color: var(--jp-inverse-ui-font-color0); + background-color: var(--jp-success-color0); +} +.jupyter-widget-tag.mod-info { + color: var(--jp-inverse-ui-font-color1); + background-color: var(--jp-info-color1); +} +.jupyter-widget-tag.mod-info.mod-active { + color: var(--jp-inverse-ui-font-color0); + background-color: var(--jp-info-color0); +} +.jupyter-widget-tag.mod-warning { + color: var(--jp-inverse-ui-font-color1); + background-color: var(--jp-warn-color1); +} +.jupyter-widget-tag.mod-warning.mod-active { + color: var(--jp-inverse-ui-font-color0); + background-color: var(--jp-warn-color0); +} +.jupyter-widget-tag.mod-danger { + color: var(--jp-inverse-ui-font-color1); + background-color: var(--jp-error-color1); +} +.jupyter-widget-tag.mod-danger.mod-active { + color: var(--jp-inverse-ui-font-color0); + background-color: var(--jp-error-color0); +} +.jupyter-button { + padding-left: 10px; + padding-right: 10px; + padding-top: 0px; + padding-bottom: 0px; + display: inline-block; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: center; + font-size: var(--jp-widgets-font-size); + cursor: pointer; + height: var(--jp-widgets-inline-height); + border: 0px solid; + line-height: var(--jp-widgets-inline-height); + box-shadow: none; + color: var(--jp-ui-font-color1); + background-color: var(--jp-layout-color2); + border-color: var(--jp-border-color2); + border: none; + user-select: none; +} +.jupyter-button i.fa { + margin-right: var(--jp-widgets-inline-margin); + pointer-events: none; +} +.jupyter-button:empty:before { + content: "\200b"; +} +.jupyter-widgets.jupyter-button:disabled { + opacity: var(--jp-widgets-disabled-opacity); +} +.jupyter-button i.fa.center { + margin-right: 0; +} +.jupyter-button:hover:enabled, +.jupyter-button:focus:enabled { + box-shadow: + 0 2px 2px 0 rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)), + 0 3px 1px -2px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity)), + 0 1px 5px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity)); +} +.jupyter-button:active, +.jupyter-button.mod-active { + box-shadow: + 0 4px 5px 0 rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)), + 0 1px 10px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity)), + 0 2px 4px -1px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity)); + color: var(--jp-ui-font-color1); + background-color: var(--jp-layout-color3); +} +.jupyter-button:focus:enabled { + outline: 1px solid var(--jp-widgets-input-focus-border-color); +} +.jupyter-button.mod-primary { + color: var(--jp-ui-inverse-font-color1); + background-color: var(--jp-brand-color1); +} +.jupyter-button.mod-primary.mod-active { + color: var(--jp-ui-inverse-font-color0); + background-color: var(--jp-brand-color0); +} +.jupyter-button.mod-primary:active { + color: var(--jp-ui-inverse-font-color0); + background-color: var(--jp-brand-color0); +} +.jupyter-button.mod-success { + color: var(--jp-ui-inverse-font-color1); + background-color: var(--jp-success-color1); +} +.jupyter-button.mod-success.mod-active { + color: var(--jp-ui-inverse-font-color0); + background-color: var(--jp-success-color0); +} +.jupyter-button.mod-success:active { + color: var(--jp-ui-inverse-font-color0); + background-color: var(--jp-success-color0); +} +.jupyter-button.mod-info { + color: var(--jp-ui-inverse-font-color1); + background-color: var(--jp-info-color1); +} +.jupyter-button.mod-info.mod-active { + color: var(--jp-ui-inverse-font-color0); + background-color: var(--jp-info-color0); +} +.jupyter-button.mod-info:active { + color: var(--jp-ui-inverse-font-color0); + background-color: var(--jp-info-color0); +} +.jupyter-button.mod-warning { + color: var(--jp-ui-inverse-font-color1); + background-color: var(--jp-warn-color1); +} +.jupyter-button.mod-warning.mod-active { + color: var(--jp-ui-inverse-font-color0); + background-color: var(--jp-warn-color0); +} +.jupyter-button.mod-warning:active { + color: var(--jp-ui-inverse-font-color0); + background-color: var(--jp-warn-color0); +} +.jupyter-button.mod-danger { + color: var(--jp-ui-inverse-font-color1); + background-color: var(--jp-error-color1); +} +.jupyter-button.mod-danger.mod-active { + color: var(--jp-ui-inverse-font-color0); + background-color: var(--jp-error-color0); +} +.jupyter-button.mod-danger:active { + color: var(--jp-ui-inverse-font-color0); + background-color: var(--jp-error-color0); +} +.widget-button, +.widget-toggle-button, +.widget-upload, +.jupyter-widget-button, +.jupyter-widget-toggle-button, +.jupyter-widget-upload { + width: var(--jp-widgets-inline-width-short); +} +.jupyter-widgets label { + margin-bottom: initial; +} +.widget-label-basic, +.jupyter-widget-label-basic { + color: var(--jp-widgets-label-color); + font-size: var(--jp-widgets-font-size); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + line-height: var(--jp-widgets-inline-height); +} +.widget-label, +.jupyter-widget-label { + color: var(--jp-widgets-label-color); + font-size: var(--jp-widgets-font-size); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + line-height: var(--jp-widgets-inline-height); +} +.widget-inline-hbox .widget-label, +.jupyter-widget-inline-hbox .jupyter-widget-label { + color: var(--jp-widgets-label-color); + text-align: right; + margin-right: calc(var(--jp-widgets-inline-margin) * 2); + width: var(--jp-widgets-inline-label-width); + flex-shrink: 0; +} +.widget-inline-vbox .widget-label, +.jupyter-widget-inline-vbox .jupyter-widget-label { + color: var(--jp-widgets-label-color); + text-align: center; + line-height: var(--jp-widgets-inline-height); +} +.widget-readout, +.jupyter-widget-readout { + color: var(--jp-widgets-readout-color); + font-size: var(--jp-widgets-font-size); + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); + overflow: hidden; + white-space: nowrap; + text-align: center; +} +.widget-readout.overflow, +.jupyter-widget-readout.overflow { + -webkit-box-shadow: + 0 2px 2px 0 rgba(0, 0, 0, 0.2), + 0 3px 1px -2px rgba(0, 0, 0, 0.14), + 0 1px 5px 0 rgba(0, 0, 0, 0.12); + -moz-box-shadow: + 0 2px 2px 0 rgba(0, 0, 0, 0.2), + 0 3px 1px -2px rgba(0, 0, 0, 0.14), + 0 1px 5px 0 rgba(0, 0, 0, 0.12); + box-shadow: + 0 2px 2px 0 rgba(0, 0, 0, 0.2), + 0 3px 1px -2px rgba(0, 0, 0, 0.14), + 0 1px 5px 0 rgba(0, 0, 0, 0.12); +} +.widget-inline-hbox .widget-readout, +.jupyter-widget-inline-hbox .jupyter-widget-readout { + text-align: center; + max-width: var(--jp-widgets-inline-width-short); + min-width: var(--jp-widgets-inline-width-tiny); + margin-left: var(--jp-widgets-inline-margin); +} +.widget-inline-vbox .widget-readout, +.jupyter-widget-inline-vbox .jupyter-widget-readout { + margin-top: var(--jp-widgets-inline-margin); + width: inherit; +} +.widget-checkbox, +.jupyter-widget-checkbox { + width: var(--jp-widgets-inline-width); + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); +} +.widget-checkbox input[type=checkbox], +.jupyter-widget-checkbox input[type=checkbox] { + margin: 0px calc(var(--jp-widgets-inline-margin) * 2) 0px 0px; + line-height: var(--jp-widgets-inline-height); + font-size: large; + flex-grow: 1; + flex-shrink: 0; + align-self: center; +} +.widget-valid, +.jupyter-widget-valid { + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); + width: var(--jp-widgets-inline-width-short); + font-size: var(--jp-widgets-font-size); +} +.widget-valid i, +.jupyter-widget-valid i { + line-height: var(--jp-widgets-inline-height); + margin-right: var(--jp-widgets-inline-margin); + margin-left: var(--jp-widgets-inline-margin); +} +.widget-valid.mod-valid i, +.jupyter-widget-valid.mod-valid i { + color: green; +} +.widget-valid.mod-invalid i, +.jupyter-widget-valid.mod-invalid i { + color: red; +} +.widget-valid.mod-valid .widget-valid-readout, +.jupyter-widget-valid.mod-valid .jupyter-widget-valid-readout { + display: none; +} +.widget-textarea, +.widget-text, +.jupyter-widget-textarea, +.jupyter-widget-text { + width: var(--jp-widgets-inline-width); +} +.widget-text input[type=text], +.widget-text input[type=number], +.widget-text input[type=password], +.jupyter-widget-text input[type=text], +.jupyter-widget-text input[type=number], +.jupyter-widget-text input[type=password] { + height: var(--jp-widgets-inline-height); +} +.widget-text input[type=text]:disabled, +.widget-text input[type=number]:disabled, +.widget-text input[type=password]:disabled, +.widget-textarea textarea:disabled, +.jupyter-widget-text input[type=text]:disabled, +.jupyter-widget-text input[type=number]:disabled, +.jupyter-widget-text input[type=password]:disabled, +.jupyter-widget-textarea textarea:disabled { + opacity: var(--jp-widgets-disabled-opacity); +} +.widget-text input[type=text], +.widget-text input[type=number], +.widget-text input[type=password], +.widget-textarea textarea, +.jupyter-widget-text input[type=text], +.jupyter-widget-text input[type=number], +.jupyter-widget-text input[type=password], +.jupyter-widget-textarea textarea { + box-sizing: border-box; + border: var(--jp-widgets-input-border-width) solid var(--jp-widgets-input-border-color); + background-color: var(--jp-widgets-input-background-color); + color: var(--jp-widgets-input-color); + font-size: var(--jp-widgets-font-size); + flex-grow: 1; + min-width: 0; + flex-shrink: 1; + outline: none !important; +} +.widget-text input[type=text], +.widget-text input[type=password], +.widget-textarea textarea, +.jupyter-widget-text input[type=text], +.jupyter-widget-text input[type=password], +.jupyter-widget-textarea textarea { + padding: var(--jp-widgets-input-padding) calc(var(--jp-widgets-input-padding) * 2); +} +.widget-text input[type=number], +.jupyter-widget-text input[type=number] { + padding: var(--jp-widgets-input-padding) 0 var(--jp-widgets-input-padding) calc(var(--jp-widgets-input-padding) * 2); +} +.widget-textarea textarea, +.jupyter-widget-textarea textarea { + height: inherit; + width: inherit; +} +.widget-text input:focus, +.widget-textarea textarea:focus, +.jupyter-widget-text input:focus, +.jupyter-widget-textarea textarea:focus { + border-color: var(--jp-widgets-input-focus-border-color); +} +.widget-hslider, +.jupyter-widget-hslider { + width: var(--jp-widgets-inline-width); + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); + align-items: center; +} +.widgets-slider .slider-container, +.jupyter-widgets-slider .slider-container { + overflow: visible; +} +.widget-hslider .slider-container, +.jupyter-widget-hslider .slider-container { + margin-left: calc(var(--jp-widgets-slider-handle-size) / 2 - 2 * var(--jp-widgets-slider-border-width)); + margin-right: calc(var(--jp-widgets-slider-handle-size) / 2 - 2 * var(--jp-widgets-slider-border-width)); + flex: 1 1 var(--jp-widgets-inline-width-short); +} +.widget-vbox .widget-label, +.jupyter-widget-vbox .jupyter-widget-label { + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); +} +.widget-vslider, +.jupyter-widget-vslider { + height: var(--jp-widgets-vertical-height); + width: var(--jp-widgets-inline-width-tiny); +} +.widget-vslider .slider-container, +.jupyter-widget-vslider .slider-container { + flex: 1 1 var(--jp-widgets-inline-width-short); + margin-left: auto; + margin-right: auto; + margin-bottom: calc(var(--jp-widgets-slider-handle-size) / 2 - 2 * var(--jp-widgets-slider-border-width)); + margin-top: calc(var(--jp-widgets-slider-handle-size) / 2 - 2 * var(--jp-widgets-slider-border-width)); + display: flex; + flex-direction: column; +} +.progress-bar { + -webkit-transition: none; + -moz-transition: none; + -ms-transition: none; + -o-transition: none; + transition: none; +} +.progress-bar { + height: var(--jp-widgets-inline-height); +} +.progress-bar { + background-color: var(--jp-brand-color1); +} +.progress-bar-success { + background-color: var(--jp-success-color1); +} +.progress-bar-info { + background-color: var(--jp-info-color1); +} +.progress-bar-warning { + background-color: var(--jp-warn-color1); +} +.progress-bar-danger { + background-color: var(--jp-error-color1); +} +.progress { + background-color: var(--jp-layout-color2); + border: none; + box-shadow: none; +} +.widget-hprogress, +.jupyter-widget-hprogress { + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); + width: var(--jp-widgets-inline-width); + align-items: center; +} +.widget-hprogress .progress, +.jupyter-widget-hprogress .progress { + flex-grow: 1; + margin-top: var(--jp-widgets-input-padding); + margin-bottom: var(--jp-widgets-input-padding); + align-self: stretch; + height: initial; +} +.widget-vprogress, +.jupyter-widget-vprogress { + height: var(--jp-widgets-vertical-height); + width: var(--jp-widgets-inline-width-tiny); +} +.widget-vprogress .progress, +.jupyter-widget-vprogress .progress { + flex-grow: 1; + width: var(--jp-widgets-progress-thickness); + margin-left: auto; + margin-right: auto; + margin-bottom: 0; +} +.widget-dropdown, +.jupyter-widget-dropdown { + height: var(--jp-widgets-inline-height); + width: var(--jp-widgets-inline-width); + line-height: var(--jp-widgets-inline-height); +} +.widget-dropdown > select, +.jupyter-widget-dropdown > select { + padding-right: 20px; + border: var(--jp-widgets-input-border-width) solid var(--jp-widgets-input-border-color); + border-radius: 0; + height: inherit; + flex: 1 1 var(--jp-widgets-inline-width-short); + min-width: 0; + box-sizing: border-box; + outline: none !important; + box-shadow: none; + background-color: var(--jp-widgets-input-background-color); + color: var(--jp-widgets-input-color); + font-size: var(--jp-widgets-font-size); + vertical-align: top; + padding-left: calc(var(--jp-widgets-input-padding) * 2); + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + background-repeat: no-repeat; + background-size: 20px; + background-position: right center; + background-image: var(--jp-widgets-dropdown-arrow); +} +.widget-dropdown > select:focus, +.jupyter-widget-dropdown > select:focus { + border-color: var(--jp-widgets-input-focus-border-color); +} +.widget-dropdown > select:disabled, +.jupyter-widget-dropdown > select:disabled { + opacity: var(--jp-widgets-disabled-opacity); +} +.widget-dropdown > select:-moz-focusring, +.jupyter-widget-dropdown > select:-moz-focusring { + color: transparent; + text-shadow: 0 0 0 #000; +} +.widget-select, +.jupyter-widget-select { + width: var(--jp-widgets-inline-width); + line-height: var(--jp-widgets-inline-height); + align-items: flex-start; +} +.widget-select > select, +.jupyter-widget-select > select { + border: var(--jp-widgets-input-border-width) solid var(--jp-widgets-input-border-color); + background-color: var(--jp-widgets-input-background-color); + color: var(--jp-widgets-input-color); + font-size: var(--jp-widgets-font-size); + flex: 1 1 var(--jp-widgets-inline-width-short); + outline: none !important; + overflow: auto; + height: inherit; + padding-top: 5px; +} +.widget-select > select:focus, +.jupyter-widget-select > select:focus { + border-color: var(--jp-widgets-input-focus-border-color); +} +.wiget-select > select > option, +.jupyter-wiget-select > select > option { + padding-left: var(--jp-widgets-input-padding); + line-height: var(--jp-widgets-inline-height); + padding-top: calc(var(--jp-widgets-inline-height) - var(--jp-widgets-font-size) / 2); + padding-bottom: calc(var(--jp-widgets-inline-height) - var(--jp-widgets-font-size) / 2); +} +.widget-toggle-buttons, +.jupyter-widget-toggle-buttons { + line-height: var(--jp-widgets-inline-height); +} +.widget-toggle-buttons .widget-toggle-button, +.jupyter-widget-toggle-buttons .jupyter-widget-toggle-button { + margin-left: var(--jp-widgets-margin); + margin-right: var(--jp-widgets-margin); +} +.widget-toggle-buttons .jupyter-button:disabled, +.jupyter-widget-toggle-buttons .jupyter-button:disabled { + opacity: var(--jp-widgets-disabled-opacity); +} +.widget-radio, +.jupyter-widget-radio { + width: var(--jp-widgets-inline-width); + line-height: var(--jp-widgets-inline-height); +} +.widget-radio-box, +.jupyter-widget-radio-box { + display: flex; + flex-direction: column; + align-items: stretch; + box-sizing: border-box; + flex-grow: 1; + margin-bottom: var(--jp-widgets-radio-item-height-adjustment); +} +.widget-radio-box-vertical, +.jupyter-widget-radio-box-vertical { + flex-direction: column; +} +.widget-radio-box-horizontal, +.jupyter-widget-radio-box-horizontal { + flex-direction: row; +} +.widget-radio-box label, +.jupyter-widget-radio-box label { + height: var(--jp-widgets-radio-item-height); + line-height: var(--jp-widgets-radio-item-height); + font-size: var(--jp-widgets-font-size); +} +.widget-radio-box-horizontal label, +.jupyter-widget-radio-box-horizontal label { + margin: 0 calc(var(--jp-widgets-input-padding) * 2) 0 0; +} +.widget-radio-box input, +.jupyter-widget-radio-box input { + height: var(--jp-widgets-radio-item-height); + line-height: var(--jp-widgets-radio-item-height); + margin: 0 calc(var(--jp-widgets-input-padding) * 2) 0 1px; + float: left; +} +.widget-colorpicker, +.jupyter-widget-colorpicker { + width: var(--jp-widgets-inline-width); + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); +} +.widget-colorpicker > .widget-colorpicker-input, +.jupyter-widget-colorpicker > .jupyter-widget-colorpicker-input { + flex-grow: 1; + flex-shrink: 1; + min-width: var(--jp-widgets-inline-width-tiny); +} +.widget-colorpicker input[type=color], +.jupyter-widget-colorpicker input[type=color] { + width: var(--jp-widgets-inline-height); + height: var(--jp-widgets-inline-height); + padding: 0 2px; + background: var(--jp-widgets-input-background-color); + color: var(--jp-widgets-input-color); + border: var(--jp-widgets-input-border-width) solid var(--jp-widgets-input-border-color); + border-left: none; + flex-grow: 0; + flex-shrink: 0; + box-sizing: border-box; + align-self: stretch; + outline: none !important; +} +.widget-colorpicker.concise input[type=color], +.jupyter-widget-colorpicker.concise input[type=color] { + border-left: var(--jp-widgets-input-border-width) solid var(--jp-widgets-input-border-color); +} +.widget-colorpicker input[type=color]:focus, +.widget-colorpicker input[type=text]:focus, +.jupyter-widget-colorpicker input[type=color]:focus, +.jupyter-widget-colorpicker input[type=text]:focus { + border-color: var(--jp-widgets-input-focus-border-color); +} +.widget-colorpicker input[type=text], +.jupyter-widget-colorpicker input[type=text] { + flex-grow: 1; + outline: none !important; + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); + background: var(--jp-widgets-input-background-color); + color: var(--jp-widgets-input-color); + border: var(--jp-widgets-input-border-width) solid var(--jp-widgets-input-border-color); + font-size: var(--jp-widgets-font-size); + padding: var(--jp-widgets-input-padding) calc(var(--jp-widgets-input-padding) * 2); + min-width: 0; + flex-shrink: 1; + box-sizing: border-box; +} +.widget-colorpicker input[type=text]:disabled, +.jupyter-widget-colorpicker input[type=text]:disabled { + opacity: var(--jp-widgets-disabled-opacity); +} +.widget-datepicker, +.jupyter-widget-datepicker { + width: var(--jp-widgets-inline-width); + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); +} +.widget-datepicker input[type=date], +.jupyter-widget-datepicker input[type=date] { + flex-grow: 1; + flex-shrink: 1; + min-width: 0; + outline: none !important; + height: var(--jp-widgets-inline-height); + border: var(--jp-widgets-input-border-width) solid var(--jp-widgets-input-border-color); + background-color: var(--jp-widgets-input-background-color); + color: var(--jp-widgets-input-color); + font-size: var(--jp-widgets-font-size); + padding: var(--jp-widgets-input-padding) calc(var(--jp-widgets-input-padding) * 2); + box-sizing: border-box; +} +.widget-datepicker input[type=date]:focus, +.jupyter-widget-datepicker input[type=date]:focus { + border-color: var(--jp-widgets-input-focus-border-color); +} +.widget-datepicker input[type=date]:invalid, +.jupyter-widget-datepicker input[type=date]:invalid { + border-color: var(--jp-warn-color1); +} +.widget-datepicker input[type=date]:disabled, +.jupyter-widget-datepicker input[type=date]:disabled { + opacity: var(--jp-widgets-disabled-opacity); +} +.widget-play, +.jupyter-widget-play { + width: var(--jp-widgets-inline-width-short); + display: flex; + align-items: stretch; +} +.widget-play .jupyter-button, +.jupyter-widget-play .jupyter-button { + flex-grow: 1; + height: auto; +} +.widget-play .jupyter-button:disabled, +.jupyter-widget-play .jupyter-button:disabled { + opacity: var(--jp-widgets-disabled-opacity); +} +.jupyter-widgets.widget-tab, +.jupyter-widgets.jupyter-widget-tab { + display: flex; + flex-direction: column; +} +.jupyter-widgets.widget-tab > .p-TabBar, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar { + overflow-x: visible; + overflow-y: visible; +} +.jupyter-widgets.widget-tab > .p-TabBar > .p-TabBar-content, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar > .p-TabBar-content, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar > .lm-TabBar-content { + align-items: flex-end; + min-width: 0; + min-height: 0; +} +.jupyter-widgets.widget-tab > .widget-tab-contents, +.jupyter-widgets.jupyter-widget-tab > .widget-tab-contents { + width: 100%; + box-sizing: border-box; + margin: 0; + background: var(--jp-layout-color1); + color: var(--jp-ui-font-color1); + border: var(--jp-border-width) solid var(--jp-border-color1); + padding: var(--jp-widgets-container-padding); + flex-grow: 1; + overflow: auto; +} +.jupyter-widgets.widget-tab > .p-TabBar, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar { + font: + var(--jp-widgets-font-size) Helvetica, + Arial, + sans-serif; + min-height: calc(var(--jp-widgets-horizontal-tab-height) + var(--jp-border-width)); +} +.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab { + flex: 0 1 var(--jp-widgets-horizontal-tab-width); + min-width: 35px; + min-height: calc(var(--jp-widgets-horizontal-tab-height) + var(--jp-border-width)); + line-height: var(--jp-widgets-horizontal-tab-height); + margin-left: calc(-1 * var(--jp-border-width)); + padding: 0px 10px; + background: var(--jp-layout-color2); + color: var(--jp-ui-font-color2); + border: var(--jp-border-width) solid var(--jp-border-color1); + border-bottom: none; + position: relative; +} +.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab.p-mod-current, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab.p-mod-current, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab.lm-mod-current { + color: var(--jp-ui-font-color0); + background: var(--jp-layout-color1); + min-height: calc(var(--jp-widgets-horizontal-tab-height) + 2 * var(--jp-border-width)); + transform: translateY(var(--jp-border-width)); + overflow: visible; +} +.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab.p-mod-current:before, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab.p-mod-current:before, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab.lm-mod-current:before { + position: absolute; + top: calc(-1 * var(--jp-border-width)); + left: calc(-1 * var(--jp-border-width)); + content: ""; + height: var(--jp-widgets-horizontal-tab-top-border); + width: calc(100% + 2 * var(--jp-border-width)); + background: var(--jp-brand-color1); +} +.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab:first-child, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab:first-child, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab:first-child { + margin-left: 0; +} +.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tab:hover:not(.p-mod-current), +.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tab:hover:not(.p-mod-current), +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tab:hover:not(.lm-mod-current) { + background: var(--jp-layout-color1); + color: var(--jp-ui-font-color1); +} +.jupyter-widgets.widget-tab > .p-TabBar .p-mod-closable > .p-TabBar-tabCloseIcon, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-mod-closable > .p-TabBar-tabCloseIcon, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-mod-closable > .lm-TabBar-tabCloseIcon { + margin-left: 4px; +} +.jupyter-widgets.widget-tab > .p-TabBar .p-mod-closable > .p-TabBar-tabCloseIcon:before, +.jupyter-widgets.jupyter-widget-widget-tab > .p-TabBar .p-mod-closable > .p-TabBar-tabCloseIcon:before, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-mod-closable > .lm-TabBar-tabCloseIcon:before { + font-family: FontAwesome; + content: "\f00d"; +} +.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabIcon, +.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabLabel, +.jupyter-widgets.widget-tab > .p-TabBar .p-TabBar-tabCloseIcon, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabIcon, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabLabel, +.jupyter-widgets.jupyter-widget-tab > .p-TabBar .p-TabBar-tabCloseIcon, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabIcon, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabLabel, +.jupyter-widgets.jupyter-widget-tab > .lm-TabBar .lm-TabBar-tabCloseIcon { + line-height: var(--jp-widgets-horizontal-tab-height); +} +.jupyter-widget-Collapse { + display: flex; + flex-direction: column; + align-items: stretch; +} +.jupyter-widget-Collapse-header { + padding: var(--jp-widgets-input-padding); + cursor: pointer; + color: var(--jp-ui-font-color2); + background-color: var(--jp-layout-color2); + border: var(--jp-widgets-border-width) solid var(--jp-border-color1); + padding: calc(var(--jp-widgets-container-padding) * 2 / 3) var(--jp-widgets-container-padding); + font-weight: bold; +} +.jupyter-widget-Collapse-header:hover { + background-color: var(--jp-layout-color1); + color: var(--jp-ui-font-color1); +} +.jupyter-widget-Collapse-open > .jupyter-widget-Collapse-header { + background-color: var(--jp-layout-color1); + color: var(--jp-ui-font-color0); + cursor: default; + border-bottom: none; +} +.jupyter-widget-Collapse-contents { + padding: var(--jp-widgets-container-padding); + background-color: var(--jp-layout-color1); + color: var(--jp-ui-font-color1); + border-left: var(--jp-widgets-border-width) solid var(--jp-border-color1); + border-right: var(--jp-widgets-border-width) solid var(--jp-border-color1); + border-bottom: var(--jp-widgets-border-width) solid var(--jp-border-color1); + overflow: auto; +} +.jupyter-widget-Accordion { + display: flex; + flex-direction: column; + align-items: stretch; +} +.jupyter-widget-Accordion .jupyter-widget-Collapse { + margin-bottom: 0; +} +.jupyter-widget-Accordion .jupyter-widget-Collapse + .jupyter-widget-Collapse { + margin-top: 4px; +} +.widget-html, +.widget-htmlmath, +.jupyter-widget-html, +.jupyter-widget-htmlmath { + font-size: var(--jp-widgets-font-size); +} +.widget-html > .widget-html-content, +.widget-htmlmath > .widget-html-content, +.jupyter-widget-html > .jupyter-widget-html-content, +.jupyter-widget-htmlmath > .jupyter-widget-html-content { + align-self: stretch; + flex-grow: 1; + flex-shrink: 1; + line-height: var(--jp-widgets-inline-height); + position: relative; +} +.widget-image, +.jupyter-widget-image { + max-width: 100%; + height: auto; +} +.lm-Widget { + box-sizing: border-box; + position: relative; +} +.lm-Widget.lm-mod-hidden { + display: none !important; +} +.lm-AccordionPanel[data-orientation=horizontal] > .lm-AccordionPanel-title { + display: block; + transform-origin: top left; + transform: rotate(-90deg) translate(-100%); +} +.lm-CommandPalette { + display: flex; + flex-direction: column; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.lm-CommandPalette-search { + flex: 0 0 auto; +} +.lm-CommandPalette-content { + flex: 1 1 auto; + margin: 0; + padding: 0; + min-height: 0; + overflow: auto; + list-style-type: none; +} +.lm-CommandPalette-header { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.lm-CommandPalette-item { + display: flex; + flex-direction: row; +} +.lm-CommandPalette-itemIcon { + flex: 0 0 auto; +} +.lm-CommandPalette-itemContent { + flex: 1 1 auto; + overflow: hidden; +} +.lm-CommandPalette-itemShortcut { + flex: 0 0 auto; +} +.lm-CommandPalette-itemLabel { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.lm-close-icon { + border: 1px solid transparent; + background-color: transparent; + position: absolute; + z-index: 1; + right: 3%; + top: 0; + bottom: 0; + margin: auto; + padding: 7px 0; + display: none; + vertical-align: middle; + outline: 0; + cursor: pointer; +} +.lm-close-icon:after { + content: "X"; + display: block; + width: 15px; + height: 15px; + text-align: center; + color: #000; + font-weight: normal; + font-size: 12px; + cursor: pointer; +} +.lm-DockPanel { + z-index: 0; +} +.lm-DockPanel-widget { + z-index: 0; +} +.lm-DockPanel-tabBar { + z-index: 1; +} +.lm-DockPanel-handle { + z-index: 2; +} +.lm-DockPanel-handle.lm-mod-hidden { + display: none !important; +} +.lm-DockPanel-handle:after { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + content: ""; +} +.lm-DockPanel-handle[data-orientation=horizontal] { + cursor: ew-resize; +} +.lm-DockPanel-handle[data-orientation=vertical] { + cursor: ns-resize; +} +.lm-DockPanel-handle[data-orientation=horizontal]:after { + left: 50%; + min-width: 8px; + transform: translateX(-50%); +} +.lm-DockPanel-handle[data-orientation=vertical]:after { + top: 50%; + min-height: 8px; + transform: translateY(-50%); +} +.lm-DockPanel-overlay { + z-index: 3; + box-sizing: border-box; + pointer-events: none; +} +.lm-DockPanel-overlay.lm-mod-hidden { + display: none !important; +} +.lm-Menu { + z-index: 10000; + position: absolute; + white-space: nowrap; + overflow-x: hidden; + overflow-y: auto; + outline: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.lm-Menu-content { + margin: 0; + padding: 0; + display: table; + list-style-type: none; +} +.lm-Menu-item { + display: table-row; +} +.lm-Menu-item.lm-mod-hidden, +.lm-Menu-item.lm-mod-collapsed { + display: none !important; +} +.lm-Menu-itemIcon, +.lm-Menu-itemSubmenuIcon { + display: table-cell; + text-align: center; +} +.lm-Menu-itemLabel { + display: table-cell; + text-align: left; +} +.lm-Menu-itemShortcut { + display: table-cell; + text-align: right; +} +.lm-MenuBar { + outline: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.lm-MenuBar-content { + margin: 0; + padding: 0; + display: flex; + flex-direction: row; + list-style-type: none; +} +.lm-MenuBar-item { + box-sizing: border-box; +} +.lm-MenuBar-itemIcon, +.lm-MenuBar-itemLabel { + display: inline-block; +} +.lm-ScrollBar { + display: flex; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.lm-ScrollBar[data-orientation=horizontal] { + flex-direction: row; +} +.lm-ScrollBar[data-orientation=vertical] { + flex-direction: column; +} +.lm-ScrollBar-button { + box-sizing: border-box; + flex: 0 0 auto; +} +.lm-ScrollBar-track { + box-sizing: border-box; + position: relative; + overflow: hidden; + flex: 1 1 auto; +} +.lm-ScrollBar-thumb { + box-sizing: border-box; + position: absolute; +} +.lm-SplitPanel-child { + z-index: 0; +} +.lm-SplitPanel-handle { + z-index: 1; +} +.lm-SplitPanel-handle.lm-mod-hidden { + display: none !important; +} +.lm-SplitPanel-handle:after { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + content: ""; +} +.lm-SplitPanel[data-orientation=horizontal] > .lm-SplitPanel-handle { + cursor: ew-resize; +} +.lm-SplitPanel[data-orientation=vertical] > .lm-SplitPanel-handle { + cursor: ns-resize; +} +.lm-SplitPanel[data-orientation=horizontal] > .lm-SplitPanel-handle:after { + left: 50%; + min-width: 8px; + transform: translateX(-50%); +} +.lm-SplitPanel[data-orientation=vertical] > .lm-SplitPanel-handle:after { + top: 50%; + min-height: 8px; + transform: translateY(-50%); +} +.lm-TabBar { + display: flex; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.lm-TabBar[data-orientation=horizontal] { + flex-direction: row; + align-items: flex-end; +} +.lm-TabBar[data-orientation=vertical] { + flex-direction: column; + align-items: flex-end; +} +.lm-TabBar-content { + margin: 0; + padding: 0; + display: flex; + flex: 1 1 auto; + list-style-type: none; +} +.lm-TabBar[data-orientation=horizontal] > .lm-TabBar-content { + flex-direction: row; +} +.lm-TabBar[data-orientation=vertical] > .lm-TabBar-content { + flex-direction: column; +} +.lm-TabBar-tab { + display: flex; + flex-direction: row; + box-sizing: border-box; + overflow: hidden; + touch-action: none; +} +.lm-TabBar-tabIcon, +.lm-TabBar-tabCloseIcon { + flex: 0 0 auto; +} +.lm-TabBar-tabLabel { + flex: 1 1 auto; + overflow: hidden; + white-space: nowrap; +} +.lm-TabBar-tabInput { + user-select: all; + width: 100%; + box-sizing: border-box; +} +.lm-TabBar-tab.lm-mod-hidden { + display: none !important; +} +.lm-TabBar-addButton.lm-mod-hidden { + display: none !important; +} +.lm-TabBar.lm-mod-dragging .lm-TabBar-tab { + position: relative; +} +.lm-TabBar.lm-mod-dragging[data-orientation=horizontal] .lm-TabBar-tab { + left: 0; + transition: left 150ms ease; +} +.lm-TabBar.lm-mod-dragging[data-orientation=vertical] .lm-TabBar-tab { + top: 0; + transition: top 150ms ease; +} +.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging { + transition: none; +} +.lm-TabBar-tabLabel .lm-TabBar-tabInput { + user-select: all; + width: 100%; + box-sizing: border-box; + background: inherit; +} +.lm-TabPanel-tabBar { + z-index: 1; +} +.lm-TabPanel-stackedPanel { + z-index: 0; +} +:root { + --jp-private-commandpalette-search-height: 28px; +} +.lm-CommandPalette { + padding-bottom: 0; + color: var(--jp-ui-font-color1); + background: var(--jp-layout-color1); + font-size: var(--jp-ui-font-size1); +} +.jp-ModalCommandPalette { + position: absolute; + z-index: 10000; + top: 38px; + left: 30%; + margin: 0; + padding: 4px; + width: 40%; + box-shadow: var(--jp-elevation-z4); + border-radius: 4px; + background: var(--jp-layout-color0); +} +.jp-ModalCommandPalette .lm-CommandPalette { + max-height: 40vh; +} +.jp-ModalCommandPalette .lm-CommandPalette .lm-close-icon::after { + display: none; +} +.jp-ModalCommandPalette .lm-CommandPalette .lm-CommandPalette-header { + display: none; +} +.jp-ModalCommandPalette .lm-CommandPalette .lm-CommandPalette-item { + margin-left: 4px; + margin-right: 4px; +} +.jp-ModalCommandPalette .lm-CommandPalette .lm-CommandPalette-item.lm-mod-disabled { + display: none; +} +.lm-CommandPalette-search { + padding: 4px; + background-color: var(--jp-layout-color1); + z-index: 2; +} +.lm-CommandPalette-wrapper { + overflow: overlay; + padding: 0 9px; + background-color: var(--jp-input-active-background); + height: 30px; + box-shadow: inset 0 0 0 var(--jp-border-width) var(--jp-input-border-color); +} +.lm-CommandPalette.lm-mod-focused .lm-CommandPalette-wrapper { + box-shadow: inset 0 0 0 1px var(--jp-input-active-box-shadow-color), inset 0 0 0 3px var(--jp-input-active-box-shadow-color); +} +.jp-SearchIconGroup { + color: white; + background-color: var(--jp-brand-color1); + position: absolute; + top: 4px; + right: 4px; + padding: 5px 5px 1px; +} +.jp-SearchIconGroup svg { + height: 20px; + width: 20px; +} +.jp-SearchIconGroup .jp-icon3[fill] { + fill: var(--jp-layout-color0); +} +.lm-CommandPalette-input { + background: transparent; + width: calc(100% - 18px); + float: left; + border: none; + outline: none; + font-size: var(--jp-ui-font-size1); + color: var(--jp-ui-font-color0); + line-height: var(--jp-private-commandpalette-search-height); +} +.lm-CommandPalette-input::-webkit-input-placeholder, +.lm-CommandPalette-input::-moz-placeholder, +.lm-CommandPalette-input:-ms-input-placeholder { + color: var(--jp-ui-font-color2); + font-size: var(--jp-ui-font-size1); +} +.lm-CommandPalette-header:first-child { + margin-top: 0; +} +.lm-CommandPalette-header { + border-bottom: solid var(--jp-border-width) var(--jp-border-color2); + color: var(--jp-ui-font-color1); + cursor: pointer; + display: flex; + font-size: var(--jp-ui-font-size0); + font-weight: 600; + letter-spacing: 1px; + margin-top: 8px; + padding: 8px 0 8px 12px; + text-transform: uppercase; +} +.lm-CommandPalette-header.lm-mod-active { + background: var(--jp-layout-color2); +} +.lm-CommandPalette-header > mark { + background-color: transparent; + font-weight: bold; + color: var(--jp-ui-font-color1); +} +.lm-CommandPalette-item { + padding: 4px 12px 4px 4px; + color: var(--jp-ui-font-color1); + font-size: var(--jp-ui-font-size1); + font-weight: 400; + display: flex; +} +.lm-CommandPalette-item.lm-mod-disabled { + color: var(--jp-ui-font-color2); +} +.lm-CommandPalette-item.lm-mod-active { + color: var(--jp-ui-inverse-font-color1); + background: var(--jp-brand-color1); +} +.lm-CommandPalette-item.lm-mod-active .lm-CommandPalette-itemLabel > mark { + color: var(--jp-ui-inverse-font-color0); +} +.lm-CommandPalette-item.lm-mod-active .jp-icon-selectable[fill] { + fill: var(--jp-layout-color0); +} +.lm-CommandPalette-item.lm-mod-active:hover:not(.lm-mod-disabled) { + color: var(--jp-ui-inverse-font-color1); + background: var(--jp-brand-color1); +} +.lm-CommandPalette-item:hover:not(.lm-mod-active):not(.lm-mod-disabled) { + background: var(--jp-layout-color2); +} +.lm-CommandPalette-itemContent { + overflow: hidden; +} +.lm-CommandPalette-itemLabel > mark { + color: var(--jp-ui-font-color0); + background-color: transparent; + font-weight: bold; +} +.lm-CommandPalette-item.lm-mod-disabled mark { + color: var(--jp-ui-font-color2); +} +.lm-CommandPalette-item .lm-CommandPalette-itemIcon { + margin: 0 4px 0 0; + position: relative; + width: 16px; + top: 2px; + flex: 0 0 auto; +} +.lm-CommandPalette-item.lm-mod-disabled .lm-CommandPalette-itemIcon { + opacity: 0.6; +} +.lm-CommandPalette-item .lm-CommandPalette-itemShortcut { + flex: 0 0 auto; +} +.lm-CommandPalette-itemCaption { + display: none; +} +.lm-CommandPalette-content { + background-color: var(--jp-layout-color1); +} +.lm-CommandPalette-content:empty::after { + content: "No results"; + margin: auto; + margin-top: 20px; + width: 100px; + display: block; + font-size: var(--jp-ui-font-size2); + font-family: var(--jp-ui-font-family); + font-weight: lighter; +} +.lm-CommandPalette-emptyMessage { + text-align: center; + margin-top: 24px; + line-height: 1.32; + padding: 0 8px; + color: var(--jp-content-font-color3); +} +.jp-Dialog { + position: absolute; + z-index: 10000; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + top: 0; + left: 0; + margin: 0; + padding: 0; + width: 100%; + height: 100%; + background: var(--jp-dialog-background); +} +.jp-Dialog-content { + display: flex; + flex-direction: column; + margin-left: auto; + margin-right: auto; + background: var(--jp-layout-color1); + padding: 24px 24px 12px; + min-width: 300px; + min-height: 150px; + max-width: 1000px; + max-height: 500px; + box-sizing: border-box; + box-shadow: var(--jp-elevation-z20); + word-wrap: break-word; + border-radius: var(--jp-border-radius); + font-size: var(--jp-ui-font-size1); + color: var(--jp-ui-font-color1); + resize: both; +} +.jp-Dialog-content.jp-Dialog-content-small { + max-width: 500px; +} +.jp-Dialog-button { + overflow: visible; +} +button.jp-Dialog-button:disabled { + opacity: 0.6; +} +button.jp-Dialog-button:focus { + outline: 1px solid var(--jp-brand-color1); + outline-offset: 4px; + -moz-outline-radius: 0; +} +button.jp-Dialog-button:focus::-moz-focus-inner { + border: 0; +} +button.jp-Dialog-button.jp-mod-styled.jp-mod-accept:focus, +button.jp-Dialog-button.jp-mod-styled.jp-mod-warn:focus, +button.jp-Dialog-button.jp-mod-styled.jp-mod-reject:focus { + outline-offset: 4px; + -moz-outline-radius: 0; +} +button.jp-Dialog-button.jp-mod-styled.jp-mod-accept:focus { + outline: 1px solid var(--jp-accept-color-normal, var(--jp-brand-color1)); +} +button.jp-Dialog-button.jp-mod-styled.jp-mod-warn:focus { + outline: 1px solid var(--jp-warn-color-normal, var(--jp-error-color1)); +} +button.jp-Dialog-button.jp-mod-styled.jp-mod-reject:focus { + outline: 1px solid var(--jp-reject-color-normal, var(--md-grey-600, #757575)); +} +button.jp-Dialog-close-button { + padding: 0; + height: 100%; + min-width: unset; + min-height: unset; +} +.jp-Dialog-header { + display: flex; + justify-content: space-between; + flex: 0 0 auto; + padding-bottom: 12px; + font-size: var(--jp-ui-font-size3); + font-weight: 400; + color: var(--jp-ui-font-color1); +} +.jp-Dialog-body { + display: flex; + flex-direction: column; + flex: 1 1 auto; + font-size: var(--jp-ui-font-size1); + background: var(--jp-layout-color1); + color: var(--jp-ui-font-color1); + overflow: auto; +} +.jp-Dialog-footer { + display: flex; + flex-direction: row; + justify-content: flex-end; + align-items: center; + flex: 0 0 auto; + margin-left: -12px; + margin-right: -12px; + padding: 12px; +} +.jp-Dialog-checkbox { + padding-right: 5px; +} +.jp-Dialog-spacer { + flex: 1 1 auto; +} +.jp-Dialog-title { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.jp-Dialog-body > .jp-select-wrapper { + width: 100%; +} +.jp-Dialog-body > button { + padding: 0 16px; +} +.jp-Dialog-body > label { + line-height: 1.4; + color: var(--jp-ui-font-color0); +} +.jp-Dialog-button.jp-mod-styled:not(:last-child) { + margin-right: 12px; +} +.jp-Input-Boolean-Dialog { + flex-direction: row-reverse; + align-items: end; + width: 100%; +} +.jp-Input-Boolean-Dialog > label { + flex: 1 1 auto; +} +.jp-InputDialog-inputWrapper { + display: flex; + align-items: baseline; +} +.jp-InputDialog-inputWrapper > input.jp-mod-styled:invalid { + border-color: var(--jp-error-color0); + background: var(--jp-error-color3); +} +.jp-InputDialog-inputWrapper > input[required].jp-mod-styled:invalid:placeholder-shown { + border-color: unset; + background: unset; +} +.jp-MainAreaWidget > :focus { + outline: none; +} +.jp-MainAreaWidget .jp-MainAreaWidget-error { + padding: 6px; +} +.jp-MainAreaWidget .jp-MainAreaWidget-error > pre { + width: auto; + padding: 10px; + background: var(--jp-error-color3); + border: var(--jp-border-width) solid var(--jp-error-color1); + border-radius: var(--jp-border-radius); + color: var(--jp-ui-font-color1); + font-size: var(--jp-ui-font-size1); + white-space: pre-wrap; + word-wrap: break-word; +} +:root { + --md-red-50: #ffebee; + --md-red-100: #ffcdd2; + --md-red-200: #ef9a9a; + --md-red-300: #e57373; + --md-red-400: #ef5350; + --md-red-500: #f44336; + --md-red-600: #e53935; + --md-red-700: #d32f2f; + --md-red-800: #c62828; + --md-red-900: #b71c1c; + --md-red-A100: #ff8a80; + --md-red-A200: #ff5252; + --md-red-A400: #ff1744; + --md-red-A700: #d50000; + --md-pink-50: #fce4ec; + --md-pink-100: #f8bbd0; + --md-pink-200: #f48fb1; + --md-pink-300: #f06292; + --md-pink-400: #ec407a; + --md-pink-500: #e91e63; + --md-pink-600: #d81b60; + --md-pink-700: #c2185b; + --md-pink-800: #ad1457; + --md-pink-900: #880e4f; + --md-pink-A100: #ff80ab; + --md-pink-A200: #ff4081; + --md-pink-A400: #f50057; + --md-pink-A700: #c51162; + --md-purple-50: #f3e5f5; + --md-purple-100: #e1bee7; + --md-purple-200: #ce93d8; + --md-purple-300: #ba68c8; + --md-purple-400: #ab47bc; + --md-purple-500: #9c27b0; + --md-purple-600: #8e24aa; + --md-purple-700: #7b1fa2; + --md-purple-800: #6a1b9a; + --md-purple-900: #4a148c; + --md-purple-A100: #ea80fc; + --md-purple-A200: #e040fb; + --md-purple-A400: #d500f9; + --md-purple-A700: #a0f; + --md-deep-purple-50: #ede7f6; + --md-deep-purple-100: #d1c4e9; + --md-deep-purple-200: #b39ddb; + --md-deep-purple-300: #9575cd; + --md-deep-purple-400: #7e57c2; + --md-deep-purple-500: #673ab7; + --md-deep-purple-600: #5e35b1; + --md-deep-purple-700: #512da8; + --md-deep-purple-800: #4527a0; + --md-deep-purple-900: #311b92; + --md-deep-purple-A100: #b388ff; + --md-deep-purple-A200: #7c4dff; + --md-deep-purple-A400: #651fff; + --md-deep-purple-A700: #6200ea; + --md-indigo-50: #e8eaf6; + --md-indigo-100: #c5cae9; + --md-indigo-200: #9fa8da; + --md-indigo-300: #7986cb; + --md-indigo-400: #5c6bc0; + --md-indigo-500: #3f51b5; + --md-indigo-600: #3949ab; + --md-indigo-700: #303f9f; + --md-indigo-800: #283593; + --md-indigo-900: #1a237e; + --md-indigo-A100: #8c9eff; + --md-indigo-A200: #536dfe; + --md-indigo-A400: #3d5afe; + --md-indigo-A700: #304ffe; + --md-blue-50: #e3f2fd; + --md-blue-100: #bbdefb; + --md-blue-200: #90caf9; + --md-blue-300: #64b5f6; + --md-blue-400: #42a5f5; + --md-blue-500: #2196f3; + --md-blue-600: #1e88e5; + --md-blue-700: #1976d2; + --md-blue-800: #1565c0; + --md-blue-900: #0d47a1; + --md-blue-A100: #82b1ff; + --md-blue-A200: #448aff; + --md-blue-A400: #2979ff; + --md-blue-A700: #2962ff; + --md-light-blue-50: #e1f5fe; + --md-light-blue-100: #b3e5fc; + --md-light-blue-200: #81d4fa; + --md-light-blue-300: #4fc3f7; + --md-light-blue-400: #29b6f6; + --md-light-blue-500: #03a9f4; + --md-light-blue-600: #039be5; + --md-light-blue-700: #0288d1; + --md-light-blue-800: #0277bd; + --md-light-blue-900: #01579b; + --md-light-blue-A100: #80d8ff; + --md-light-blue-A200: #40c4ff; + --md-light-blue-A400: #00b0ff; + --md-light-blue-A700: #0091ea; + --md-cyan-50: #e0f7fa; + --md-cyan-100: #b2ebf2; + --md-cyan-200: #80deea; + --md-cyan-300: #4dd0e1; + --md-cyan-400: #26c6da; + --md-cyan-500: #00bcd4; + --md-cyan-600: #00acc1; + --md-cyan-700: #0097a7; + --md-cyan-800: #00838f; + --md-cyan-900: #006064; + --md-cyan-A100: #84ffff; + --md-cyan-A200: #18ffff; + --md-cyan-A400: #00e5ff; + --md-cyan-A700: #00b8d4; + --md-teal-50: #e0f2f1; + --md-teal-100: #b2dfdb; + --md-teal-200: #80cbc4; + --md-teal-300: #4db6ac; + --md-teal-400: #26a69a; + --md-teal-500: #009688; + --md-teal-600: #00897b; + --md-teal-700: #00796b; + --md-teal-800: #00695c; + --md-teal-900: #004d40; + --md-teal-A100: #a7ffeb; + --md-teal-A200: #64ffda; + --md-teal-A400: #1de9b6; + --md-teal-A700: #00bfa5; + --md-green-50: #e8f5e9; + --md-green-100: #c8e6c9; + --md-green-200: #a5d6a7; + --md-green-300: #81c784; + --md-green-400: #66bb6a; + --md-green-500: #4caf50; + --md-green-600: #43a047; + --md-green-700: #388e3c; + --md-green-800: #2e7d32; + --md-green-900: #1b5e20; + --md-green-A100: #b9f6ca; + --md-green-A200: #69f0ae; + --md-green-A400: #00e676; + --md-green-A700: #00c853; + --md-light-green-50: #f1f8e9; + --md-light-green-100: #dcedc8; + --md-light-green-200: #c5e1a5; + --md-light-green-300: #aed581; + --md-light-green-400: #9ccc65; + --md-light-green-500: #8bc34a; + --md-light-green-600: #7cb342; + --md-light-green-700: #689f38; + --md-light-green-800: #558b2f; + --md-light-green-900: #33691e; + --md-light-green-A100: #ccff90; + --md-light-green-A200: #b2ff59; + --md-light-green-A400: #76ff03; + --md-light-green-A700: #64dd17; + --md-lime-50: #f9fbe7; + --md-lime-100: #f0f4c3; + --md-lime-200: #e6ee9c; + --md-lime-300: #dce775; + --md-lime-400: #d4e157; + --md-lime-500: #cddc39; + --md-lime-600: #c0ca33; + --md-lime-700: #afb42b; + --md-lime-800: #9e9d24; + --md-lime-900: #827717; + --md-lime-A100: #f4ff81; + --md-lime-A200: #eeff41; + --md-lime-A400: #c6ff00; + --md-lime-A700: #aeea00; + --md-yellow-50: #fffde7; + --md-yellow-100: #fff9c4; + --md-yellow-200: #fff59d; + --md-yellow-300: #fff176; + --md-yellow-400: #ffee58; + --md-yellow-500: #ffeb3b; + --md-yellow-600: #fdd835; + --md-yellow-700: #fbc02d; + --md-yellow-800: #f9a825; + --md-yellow-900: #f57f17; + --md-yellow-A100: #ffff8d; + --md-yellow-A200: #ff0; + --md-yellow-A400: #ffea00; + --md-yellow-A700: #ffd600; + --md-amber-50: #fff8e1; + --md-amber-100: #ffecb3; + --md-amber-200: #ffe082; + --md-amber-300: #ffd54f; + --md-amber-400: #ffca28; + --md-amber-500: #ffc107; + --md-amber-600: #ffb300; + --md-amber-700: #ffa000; + --md-amber-800: #ff8f00; + --md-amber-900: #ff6f00; + --md-amber-A100: #ffe57f; + --md-amber-A200: #ffd740; + --md-amber-A400: #ffc400; + --md-amber-A700: #ffab00; + --md-orange-50: #fff3e0; + --md-orange-100: #ffe0b2; + --md-orange-200: #ffcc80; + --md-orange-300: #ffb74d; + --md-orange-400: #ffa726; + --md-orange-500: #ff9800; + --md-orange-600: #fb8c00; + --md-orange-700: #f57c00; + --md-orange-800: #ef6c00; + --md-orange-900: #e65100; + --md-orange-A100: #ffd180; + --md-orange-A200: #ffab40; + --md-orange-A400: #ff9100; + --md-orange-A700: #ff6d00; + --md-deep-orange-50: #fbe9e7; + --md-deep-orange-100: #ffccbc; + --md-deep-orange-200: #ffab91; + --md-deep-orange-300: #ff8a65; + --md-deep-orange-400: #ff7043; + --md-deep-orange-500: #ff5722; + --md-deep-orange-600: #f4511e; + --md-deep-orange-700: #e64a19; + --md-deep-orange-800: #d84315; + --md-deep-orange-900: #bf360c; + --md-deep-orange-A100: #ff9e80; + --md-deep-orange-A200: #ff6e40; + --md-deep-orange-A400: #ff3d00; + --md-deep-orange-A700: #dd2c00; + --md-brown-50: #efebe9; + --md-brown-100: #d7ccc8; + --md-brown-200: #bcaaa4; + --md-brown-300: #a1887f; + --md-brown-400: #8d6e63; + --md-brown-500: #795548; + --md-brown-600: #6d4c41; + --md-brown-700: #5d4037; + --md-brown-800: #4e342e; + --md-brown-900: #3e2723; + --md-grey-50: #fafafa; + --md-grey-100: #f5f5f5; + --md-grey-200: #eee; + --md-grey-300: #e0e0e0; + --md-grey-400: #bdbdbd; + --md-grey-500: #9e9e9e; + --md-grey-600: #757575; + --md-grey-700: #616161; + --md-grey-800: #424242; + --md-grey-900: #212121; + --md-blue-grey-50: #eceff1; + --md-blue-grey-100: #cfd8dc; + --md-blue-grey-200: #b0bec5; + --md-blue-grey-300: #90a4ae; + --md-blue-grey-400: #78909c; + --md-blue-grey-500: #607d8b; + --md-blue-grey-600: #546e7a; + --md-blue-grey-700: #455a64; + --md-blue-grey-800: #37474f; + --md-blue-grey-900: #263238; +} +.jp-Toolbar-item.jp-Toolbar-kernelStatus { + display: inline-block; + width: 32px; + background-repeat: no-repeat; + background-position: center; + background-size: 16px; +} +:root { + --jp-private-code-span-padding: calc( (var(--jp-code-line-height) - 1) * var(--jp-code-font-size) / 2 ); +} +.jp-RenderedText { + text-align: left; + padding-left: var(--jp-code-padding); + line-height: var(--jp-code-line-height); + font-family: var(--jp-code-font-family); +} +.jp-RenderedText pre, +.jp-RenderedJavaScript pre, +.jp-RenderedHTMLCommon pre { + color: var(--jp-content-font-color1); + font-size: var(--jp-code-font-size); + border: none; + margin: 0; + padding: 0; +} +.jp-RenderedText pre a[href]:link { + text-decoration: none; + color: var(--jp-content-link-color); +} +.jp-RenderedText pre a[href]:hover { + text-decoration: underline; + color: var(--jp-content-link-hover-color, var(--jp-content-link-color)); +} +.jp-RenderedText pre a[href]:visited { + text-decoration: none; + color: var(--jp-content-link-visited-color, var(--jp-content-link-color)); +} +.jp-RenderedText pre .ansi-black-fg { + color: #3e424d; +} +.jp-RenderedText pre .ansi-red-fg { + color: #e75c58; +} +.jp-RenderedText pre .ansi-green-fg { + color: #00a250; +} +.jp-RenderedText pre .ansi-yellow-fg { + color: #ddb62b; +} +.jp-RenderedText pre .ansi-blue-fg { + color: #208ffb; +} +.jp-RenderedText pre .ansi-magenta-fg { + color: #d160c4; +} +.jp-RenderedText pre .ansi-cyan-fg { + color: #60c6c8; +} +.jp-RenderedText pre .ansi-white-fg { + color: #c5c1b4; +} +.jp-RenderedText pre .ansi-black-bg { + background-color: #3e424d; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-red-bg { + background-color: #e75c58; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-green-bg { + background-color: #00a250; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-yellow-bg { + background-color: #ddb62b; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-blue-bg { + background-color: #208ffb; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-magenta-bg { + background-color: #d160c4; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-cyan-bg { + background-color: #60c6c8; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-white-bg { + background-color: #c5c1b4; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-black-intense-fg { + color: #282c36; +} +.jp-RenderedText pre .ansi-red-intense-fg { + color: #b22b31; +} +.jp-RenderedText pre .ansi-green-intense-fg { + color: #007427; +} +.jp-RenderedText pre .ansi-yellow-intense-fg { + color: #b27d12; +} +.jp-RenderedText pre .ansi-blue-intense-fg { + color: #0065ca; +} +.jp-RenderedText pre .ansi-magenta-intense-fg { + color: #a03196; +} +.jp-RenderedText pre .ansi-cyan-intense-fg { + color: #258f8f; +} +.jp-RenderedText pre .ansi-white-intense-fg { + color: #a1a6b2; +} +.jp-RenderedText pre .ansi-black-intense-bg { + background-color: #282c36; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-red-intense-bg { + background-color: #b22b31; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-green-intense-bg { + background-color: #007427; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-yellow-intense-bg { + background-color: #b27d12; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-blue-intense-bg { + background-color: #0065ca; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-magenta-intense-bg { + background-color: #a03196; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-cyan-intense-bg { + background-color: #258f8f; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-white-intense-bg { + background-color: #a1a6b2; + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-default-inverse-fg { + color: var(--jp-ui-inverse-font-color0); +} +.jp-RenderedText pre .ansi-default-inverse-bg { + background-color: var(--jp-inverse-layout-color0); + padding: var(--jp-private-code-span-padding) 0; +} +.jp-RenderedText pre .ansi-bold { + font-weight: bold; +} +.jp-RenderedText pre .ansi-underline { + text-decoration: underline; +} +.jp-RenderedText[data-mime-type="application/vnd.jupyter.stderr"] { + background: var(--jp-rendermime-error-background); + padding-top: var(--jp-code-padding); +} +.jp-RenderedLatex { + color: var(--jp-content-font-color1); + font-size: var(--jp-content-font-size1); + line-height: var(--jp-content-line-height); +} +.jp-OutputArea-output.jp-RenderedLatex { + padding: var(--jp-code-padding); + text-align: left; +} +.jp-RenderedHTMLCommon { + color: var(--jp-content-font-color1); + font-family: var(--jp-content-font-family); + font-size: var(--jp-content-font-size1); + line-height: var(--jp-content-line-height); + padding-right: 20px; +} +.jp-RenderedHTMLCommon em { + font-style: italic; +} +.jp-RenderedHTMLCommon strong { + font-weight: bold; +} +.jp-RenderedHTMLCommon u { + text-decoration: underline; +} +.jp-RenderedHTMLCommon a:link { + text-decoration: none; + color: var(--jp-content-link-color); +} +.jp-RenderedHTMLCommon a:hover { + text-decoration: underline; + color: var(--jp-content-link-hover-color, var(--jp-content-link-color)); +} +.jp-RenderedHTMLCommon a:visited { + text-decoration: none; + color: var(--jp-content-link-visited-color, var(--jp-content-link-color)); +} +.jp-RenderedHTMLCommon h1, +.jp-RenderedHTMLCommon h2, +.jp-RenderedHTMLCommon h3, +.jp-RenderedHTMLCommon h4, +.jp-RenderedHTMLCommon h5, +.jp-RenderedHTMLCommon h6 { + line-height: var(--jp-content-heading-line-height); + font-weight: var(--jp-content-heading-font-weight); + font-style: normal; + margin: var(--jp-content-heading-margin-top) 0 var(--jp-content-heading-margin-bottom) 0; + scroll-margin-top: var(--jp-content-heading-margin-top); +} +.jp-RenderedHTMLCommon h1:first-child, +.jp-RenderedHTMLCommon h2:first-child, +.jp-RenderedHTMLCommon h3:first-child, +.jp-RenderedHTMLCommon h4:first-child, +.jp-RenderedHTMLCommon h5:first-child, +.jp-RenderedHTMLCommon h6:first-child { + margin-top: calc(0.5 * var(--jp-content-heading-margin-top)); + scroll-margin-top: calc(0.5 * var(--jp-content-heading-margin-top)); +} +.jp-RenderedHTMLCommon h1:last-child, +.jp-RenderedHTMLCommon h2:last-child, +.jp-RenderedHTMLCommon h3:last-child, +.jp-RenderedHTMLCommon h4:last-child, +.jp-RenderedHTMLCommon h5:last-child, +.jp-RenderedHTMLCommon h6:last-child { + margin-bottom: calc(0.5 * var(--jp-content-heading-margin-bottom)); +} +.jp-RenderedHTMLCommon h1 { + font-size: var(--jp-content-font-size5); +} +.jp-RenderedHTMLCommon h2 { + font-size: var(--jp-content-font-size4); +} +.jp-RenderedHTMLCommon h3 { + font-size: var(--jp-content-font-size3); +} +.jp-RenderedHTMLCommon h4 { + font-size: var(--jp-content-font-size2); +} +.jp-RenderedHTMLCommon h5 { + font-size: var(--jp-content-font-size1); +} +.jp-RenderedHTMLCommon h6 { + font-size: var(--jp-content-font-size0); +} +.jp-RenderedHTMLCommon ul:not(.list-inline), +.jp-RenderedHTMLCommon ol:not(.list-inline) { + padding-left: 2em; +} +.jp-RenderedHTMLCommon ul { + list-style: disc; +} +.jp-RenderedHTMLCommon ul ul { + list-style: square; +} +.jp-RenderedHTMLCommon ul ul ul { + list-style: circle; +} +.jp-RenderedHTMLCommon ol { + list-style: decimal; +} +.jp-RenderedHTMLCommon ol ol { + list-style: upper-alpha; +} +.jp-RenderedHTMLCommon ol ol ol { + list-style: lower-alpha; +} +.jp-RenderedHTMLCommon ol ol ol ol { + list-style: lower-roman; +} +.jp-RenderedHTMLCommon ol ol ol ol ol { + list-style: decimal; +} +.jp-RenderedHTMLCommon ol, +.jp-RenderedHTMLCommon ul { + margin-bottom: 1em; +} +.jp-RenderedHTMLCommon ul ul, +.jp-RenderedHTMLCommon ul ol, +.jp-RenderedHTMLCommon ol ul, +.jp-RenderedHTMLCommon ol ol { + margin-bottom: 0; +} +.jp-RenderedHTMLCommon hr { + color: var(--jp-border-color2); + background-color: var(--jp-border-color1); + margin-top: 1em; + margin-bottom: 1em; +} +.jp-RenderedHTMLCommon > pre { + margin: 1.5em 2em; +} +.jp-RenderedHTMLCommon pre, +.jp-RenderedHTMLCommon code { + border: 0; + background-color: var(--jp-layout-color0); + color: var(--jp-content-font-color1); + font-family: var(--jp-code-font-family); + font-size: inherit; + line-height: var(--jp-code-line-height); + padding: 0; + white-space: pre-wrap; +} +.jp-RenderedHTMLCommon :not(pre) > code { + background-color: var(--jp-layout-color2); + padding: 1px 5px; +} +.jp-RenderedHTMLCommon table { + border-collapse: collapse; + border-spacing: 0; + border: none; + color: var(--jp-ui-font-color1); + font-size: var(--jp-ui-font-size1); + table-layout: fixed; + margin-left: auto; + margin-bottom: 1em; + margin-right: auto; +} +.jp-RenderedHTMLCommon thead { + border-bottom: var(--jp-border-width) solid var(--jp-border-color1); + vertical-align: bottom; +} +.jp-RenderedHTMLCommon td, +.jp-RenderedHTMLCommon th, +.jp-RenderedHTMLCommon tr { + vertical-align: middle; + padding: 0.5em; + line-height: normal; + white-space: normal; + max-width: none; + border: none; +} +.jp-RenderedMarkdown.jp-RenderedHTMLCommon td, +.jp-RenderedMarkdown.jp-RenderedHTMLCommon th { + max-width: none; +} +:not(.jp-RenderedMarkdown).jp-RenderedHTMLCommon td, +:not(.jp-RenderedMarkdown).jp-RenderedHTMLCommon th, +:not(.jp-RenderedMarkdown).jp-RenderedHTMLCommon tr { + text-align: right; +} +.jp-RenderedHTMLCommon th { + font-weight: bold; +} +.jp-RenderedHTMLCommon tbody tr:nth-child(odd) { + background: var(--jp-layout-color0); +} +.jp-RenderedHTMLCommon tbody tr:nth-child(even) { + background: var(--jp-rendermime-table-row-background); +} +.jp-RenderedHTMLCommon tbody tr:hover { + background: var(--jp-rendermime-table-row-hover-background); +} +.jp-RenderedHTMLCommon p { + text-align: left; + margin: 0; + margin-bottom: 1em; +} +.jp-RenderedHTMLCommon img { + -moz-force-broken-image-icon: 1; +} +.jp-RenderedHTMLCommon > img { + display: block; + margin-left: 0; + margin-right: 0; + margin-bottom: 1em; +} +[data-jp-theme-light=false] .jp-RenderedImage img.jp-needs-light-background { + background-color: var(--jp-inverse-layout-color1); +} +[data-jp-theme-light=true] .jp-RenderedImage img.jp-needs-dark-background { + background-color: var(--jp-inverse-layout-color1); +} +.jp-RenderedHTMLCommon img, +.jp-RenderedImage img, +.jp-RenderedHTMLCommon svg, +.jp-RenderedSVG svg { + max-width: 100%; + height: auto; +} +.jp-RenderedHTMLCommon img.jp-mod-unconfined, +.jp-RenderedImage img.jp-mod-unconfined, +.jp-RenderedHTMLCommon svg.jp-mod-unconfined, +.jp-RenderedSVG svg.jp-mod-unconfined { + max-width: none; +} +.jp-RenderedHTMLCommon .alert { + padding: var(--jp-notebook-padding); + border: var(--jp-border-width) solid transparent; + border-radius: var(--jp-border-radius); + margin-bottom: 1em; +} +.jp-RenderedHTMLCommon .alert-info { + color: var(--jp-info-color0); + background-color: var(--jp-info-color3); + border-color: var(--jp-info-color2); +} +.jp-RenderedHTMLCommon .alert-info hr { + border-color: var(--jp-info-color3); +} +.jp-RenderedHTMLCommon .alert-info > p:last-child, +.jp-RenderedHTMLCommon .alert-info > ul:last-child { + margin-bottom: 0; +} +.jp-RenderedHTMLCommon .alert-warning { + color: var(--jp-warn-color0); + background-color: var(--jp-warn-color3); + border-color: var(--jp-warn-color2); +} +.jp-RenderedHTMLCommon .alert-warning hr { + border-color: var(--jp-warn-color3); +} +.jp-RenderedHTMLCommon .alert-warning > p:last-child, +.jp-RenderedHTMLCommon .alert-warning > ul:last-child { + margin-bottom: 0; +} +.jp-RenderedHTMLCommon .alert-success { + color: var(--jp-success-color0); + background-color: var(--jp-success-color3); + border-color: var(--jp-success-color2); +} +.jp-RenderedHTMLCommon .alert-success hr { + border-color: var(--jp-success-color3); +} +.jp-RenderedHTMLCommon .alert-success > p:last-child, +.jp-RenderedHTMLCommon .alert-success > ul:last-child { + margin-bottom: 0; +} +.jp-RenderedHTMLCommon .alert-danger { + color: var(--jp-error-color0); + background-color: var(--jp-error-color3); + border-color: var(--jp-error-color2); +} +.jp-RenderedHTMLCommon .alert-danger hr { + border-color: var(--jp-error-color3); +} +.jp-RenderedHTMLCommon .alert-danger > p:last-child, +.jp-RenderedHTMLCommon .alert-danger > ul:last-child { + margin-bottom: 0; +} +.jp-RenderedHTMLCommon blockquote { + margin: 1em 2em; + padding: 0 1em; + border-left: 5px solid var(--jp-border-color2); +} +a.jp-InternalAnchorLink { + visibility: hidden; + margin-left: 8px; + color: var(--md-blue-800, #1565c0); +} +h1:hover .jp-InternalAnchorLink, +h2:hover .jp-InternalAnchorLink, +h3:hover .jp-InternalAnchorLink, +h4:hover .jp-InternalAnchorLink, +h5:hover .jp-InternalAnchorLink, +h6:hover .jp-InternalAnchorLink { + visibility: visible; +} +.jp-RenderedHTMLCommon kbd { + background-color: var(--jp-rendermime-table-row-background); + border: 1px solid var(--jp-border-color0); + border-bottom-color: var(--jp-border-color2); + border-radius: 3px; + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); + display: inline-block; + font-size: var(--jp-ui-font-size0); + line-height: 1em; + padding: 0.2em 0.5em; +} +.jp-RenderedHTMLCommon > *:last-child { + margin-bottom: 0.5em; +} +.thebe-output-busy-spinner-alt { + border: 2px solid #f3f3f3; + border-top: 2px solid #3498db; + border-radius: 50%; + width: 30px; + height: 30px; + -webkit-animation: thebeoutputspin 2s linear infinite; + animation: thebeoutputspin 1s linear infinite; +} +.thebe-output-busy-spinner { + height: 28px; + width: 28px; + border-radius: 50%; + background-color: rgba(250, 250, 250, 0.9); + z-index: 9999; + display: block; +} +.thebe-output-busy-spinner::after { + content: ""; + display: block; + position: relative; + top: 2px; + left: 2px; + width: 20px; + height: 20px; + border-style: solid; + border-color: #3498db; + border-top-color: transparent; + border-width: 2px; + border-radius: 50%; + -webkit-animation: thebeoutputspin 0.8s linear infinite; + animation: thebeoutputspin 0.8s linear infinite; +} +@-webkit-keyframes thebeoutputspin { + from { + -webkit-transform: rotate(0deg); + } + to { + -webkit-transform: rotate(360deg); + } +} +@keyframes thebeoutputspin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} +.thebe-ipywidgets-placeholder { + display: flex; + flex-direction: column; + align-items: center; + font-size: 95%; +} +.thebe-ipywidgets-placeholder > pre { + font-size: 80%; + font-family: monospace; + margin: 8px 16px; +} +.thebe-output .jp-OutputArea-child > .lm-Widget { + overflow: auto; +} + +/* src/activate.css */ +.thebe-activate-button { + display: inline-block; + width: 120px; + height: 45px; + font-size: 1.25em; + cursor: pointer; +} + +/* src/status.css */ +.thebe-status { + display: inline-block; +} +.thebe-status-mounted { + display: inline-block; + text-align: left; + border: 1px black solid; + padding: 10px; +} +.thebe-status-stub { + display: inline-block; + vertical-align: middle; + text-transform: uppercase; + line-height: 1rem; +} +.thebe-status-field { + display: inline-block; + background-color: #ccc; + text-transform: uppercase; + font-family: monospace; + margin-left: 4px; + padding: 4px 8px; + border-radius: 1em; + line-height: 1rem; +} +.thebe-status-message { + text-transform: lowercase; + font-family: monospace; + margin-top: 4px; +} +.thebe-status-field.thebe-status-building { + background-color: yellow; +} +.thebe-status-field.thebe-status-launching { + background-color: yellow; +} +.thebe-status-field.thebe-status-starting { + background-color: yellow; +} +.thebe-status-field.thebe-status-server-ready { + background-color: cyan; +} +.thebe-status-field.thebe-status-session-ready { + background-color: lightgreen; +} +.thebe-status-field.thebe-status-failed { + background-color: red; +} +.thebe-status-field.thebe-status-closed { + background-color: grey; +} +.thebe-status-field.thebe-status-dead { + background-color: grey; +} +.thebe-status-field.thebe-status-busy { + background-color: yellow; +} + +/* src/index.css */ +.CodeMirror { + height: auto; + border: 1px solid grey; +} +.thebelab-cell, +.thebe-cell, +.thebe-cell > div { + margin-top: 8px; + margin-bottom: 8px; +} +.thebe-cell:focus-within, +.thebe:focus-within { + border-color: green; +} +.jp-OutputPrompt { + display: none; +} +.thebelab-busy, +.thebe-busy { + display: none; + vertical-align: middle; + padding-left: 2px; +} +.thebelab-busy-spinner, +.thebe-busy-spinner { + border: 2px solid #f3f3f3; + border-top: 2px solid #3498db; + border-radius: 50%; + width: 13px; + height: 13px; + -webkit-animation: spin 2s linear infinite; + animation: spin 1s linear infinite; +} +@keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + } +} diff --git a/pr-preview/pr-770/thebe_128x128.svg b/pr-preview/pr-770/thebe_128x128.svg new file mode 100644 index 00000000..4e406469 --- /dev/null +++ b/pr-preview/pr-770/thebe_128x128.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/pr-preview/pr-770/thebe_wide_logo.png b/pr-preview/pr-770/thebe_wide_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a593a1be2a2007e3944bc1a9c3c187146338f0b9 GIT binary patch literal 5510 zcmaJ_Ra6v!(q6i|mqv0~Qea8xPL~b|DMe~&kX#THMLMK&WkFa0Dd|q>?gas90qMHj zbNF z12@|J**}?*U$IAd+t8bYn_)QNuq5HkJ=@k^`_(n%&vrG^;mXE>Y9Ap4n}nZw>9djX z^4n52h|tAP*J~Myx|zGwie)nVGHCPe-AJ@pzMhDdL3L9gD$$_-1a4IJQ2N{X+A{Qc7wb;Kb@Dz*6i@U>z~p0+JY5hiTv}O zwIY|D0iWMq>?WI%DUc(G=eGu7tobBVK&qE=Eb1AcMGaadG0&9K%iVaCp8`3sy-6Js zG>60RPL;3WVKW{@md}}rJ>byJMO;*}$S;4lhmT#LczgE8Y4-VeCHnvXuh(RV^pi34 zAX@8-9`<*h1xj|x%>H!!&^`OM)1`#ske$nq&IU;nauZDtEj!Bm(!--;1eMQ1xQ;$W zsh!@V;~-*V3H4zEFw-I8kLibrp41ML&8vaL@G(!0KJl5!0%`G?Q?U~453W!8-Yub3 zfDDc2zv}_m1?cS1O9d=KT$z6Ju*K71l#iGe!NdUHCF1T9zDGwMC1vZ#!?cEYupp_t81@r6tdxFP+q}qy}q{T+u5i*g1 z`M5L&2Us^1a7FoyGk8o0)iz_LNprXsqdXw?UHr3`pltZKFpF$}g7Rf9UmO(l=i-Lw zX)SW`;QI5%K5a?Y-b&}*J$TBetUj=7tt>zEj~NlARqGNi4Fjd*=?r6_L2yy*`RJ2e zRp8z@$S$gdEe@kDs&~Z|XiLNhXVZC)#HXxwDuU`zQg0c*$S??*??TB0Sc`REHU4O4 zw}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@PB;Hho$Xx_AELEpc`m8Od*NuR_+7`o7f=`r7Lc%u|u$SaQ7meH;Ip ziUqk@>Fpg759G@n>H|`~t5^Bhab7+%iVSM6u@;!#=R{LVEZ1G^^UM*qr zs)O4zY#_dQhvrOs$5o@EhsVCJ*y6}JT?CrAIy+1`D`>eZ?r}YScBS@%SfS#QnJe>n z5D!J1QcUkwmQSEF<~o@X>=v-ptbc)NLGDLawhHyokxtr9jkv-Se!PELg*zqBOuDwI z1BEwOAYL?zPt*>Q=z{xSxLHCIeUw(Lfv)Hyn8K>T;!@uz?z@a_KwrE-HQ`m$Bnn-^ zXKI`078UBks(Q1Me-v9}Jk{jBrhtE@$Kp_4k+Q|m)+DW^#w9*oozoo4i$%baCX+ud z{o}0?uX_6`GZ9Gvg;=5b#J?-unGYfK^Tc>apMMI-3k&TD*c;O8R}>u;`@o~3*ah81 zu+?kcEtgT-QDU=Sv1g&Qx#9c`ql+>|=HhR=yHFA=vw}d!m#IlnoaLQkS2&{P(uEiD+$#buWnYX)2)2030>$cll#)0yt3y05(N|x*WCWH|qGEw>$ zl7Z0!RV-o&YWUEwe|5JaWG$`ef-!(#nU>7A*!`N3=A2Ug+Z*Dgd;ZNB8Y@_+5uZ>g zj>YDHC}QJ|Gb)AbUI)=ThEL7#D<(TkmYTGP4#|>7RQvl_SnBr}b4ylXbU0}I-8`|T zzV5l1zY3XgYlz#TAcVVd^Y!kM^-5r=zB>T!kcC(&!NaT`VL#0@96b{#>9E%n#toJ& zDYB0L99F&<`E90WH1p_~F*I&W11SDF)w0B_Zw#J*~0$==Cgl5 literal 0 HcmV?d00001 diff --git a/pr-preview/pr-770/types/activate.d.ts b/pr-preview/pr-770/types/activate.d.ts new file mode 100644 index 00000000..e21d85cb --- /dev/null +++ b/pr-preview/pr-770/types/activate.d.ts @@ -0,0 +1,6 @@ +import type { Options } from './options'; +export declare class ActivateWidget { + options: Partial; + constructor(options?: Options); + mount(): void; +} diff --git a/pr-preview/pr-770/types/codemirror.d.ts b/pr-preview/pr-770/types/codemirror.d.ts new file mode 100644 index 00000000..86af156a --- /dev/null +++ b/pr-preview/pr-770/types/codemirror.d.ts @@ -0,0 +1,11 @@ +import 'codemirror/lib/codemirror.css'; +import 'codemirror/mode/python/python.js'; +import 'codemirror/addon/hint/show-hint'; +import 'codemirror/addon/display/autorefresh'; +import 'codemirror/theme/abcdef.css'; +import 'codemirror/theme/darcula.css'; +import 'codemirror/theme/idea.css'; +import type { Options } from './options'; +import type { IThebeCell } from 'thebe-core'; +import type { CellDOMPlaceholder } from './types'; +export declare function setupCodemirror(options: Options, item: CellDOMPlaceholder, cell: IThebeCell, cellEl: HTMLElement, editorEl: HTMLElement, setBusy: (id: string) => void, clearBusy: (id: string) => void): any; diff --git a/pr-preview/pr-770/types/index.d.ts b/pr-preview/pr-770/types/index.d.ts new file mode 100644 index 00000000..04086da4 --- /dev/null +++ b/pr-preview/pr-770/types/index.d.ts @@ -0,0 +1,3 @@ +export * from './types'; +export * from './thebe'; +export declare function setupGlobals(): void; diff --git a/pr-preview/pr-770/types/options.d.ts b/pr-preview/pr-770/types/options.d.ts new file mode 100644 index 00000000..d131e546 --- /dev/null +++ b/pr-preview/pr-770/types/options.d.ts @@ -0,0 +1,55 @@ +import type { CoreOptions } from 'thebe-core'; +export interface ThebeOptions { + bootstrap?: boolean; + useBinder?: boolean; + useJupyterLite?: boolean; + requestKernel?: boolean; + selector?: string; + outputSelector?: string; + predefinedOutput?: boolean; + mountStatusWidget?: boolean; + mountActivateWidget?: boolean; + mountRunButton?: boolean; + mountRunAllButton?: boolean; + mountRestartButton?: boolean; + mountRestartAllButton?: boolean; + preRenderHook?: (() => void) | null; + stripPrompts?: { + inPrompt?: string; + continuationPrompt?: string; + }; + stripOutputPrompts?: { + outPrompt?: string; + }; + codeMirrorConfig?: { + theme?: string; + readOnly?: boolean; + mode?: string; + autoRefresh?: boolean; + lineNumbers?: boolean; + styleActiveLine?: boolean; + matchBrackets?: boolean; + }; +} +export type Options = ThebeOptions & CoreOptions; +export declare const defaultSelector = "[data-executable]"; +export declare const defaultOutputSelector = "[data-output]"; +export declare const defaultOptions: ThebeOptions; +export declare function mergeOptions(options: Partial): Options; +export declare function resetPageConfig(): void; +export declare function getPageConfig(): Options; +export declare function getPageConfigValue(key: keyof Options): string | boolean | (() => void) | { + inPrompt?: string | undefined; + continuationPrompt?: string | undefined; +} | { + outPrompt?: string | undefined; +} | { + theme?: string | undefined; + readOnly?: boolean | undefined; + mode?: string | undefined; + autoRefresh?: boolean | undefined; + lineNumbers?: boolean | undefined; + styleActiveLine?: boolean | undefined; + matchBrackets?: boolean | undefined; +} | import("thebe-core").BinderOptions | import("thebe-core").SavedSessionOptions | import("thebe-core").KernelOptions | import("thebe-core").ServerSettings | null | undefined; +export declare function ensurePageConfigLoaded(): Options; diff --git a/pr-preview/pr-770/types/render.d.ts b/pr-preview/pr-770/types/render.d.ts new file mode 100644 index 00000000..f3ed8f64 --- /dev/null +++ b/pr-preview/pr-770/types/render.d.ts @@ -0,0 +1,17 @@ +import type { ThebeNotebook } from 'thebe-core'; +import type { Options } from './options'; +import type { CellDOMPlaceholder } from './types'; +/** + * findCells will find cells and outputs, associating outputs with cells + * in fifo priority + * + * Note: this mirrors the original thebe behaviour + * + * @param selector + * @param outputSelector + * @returns + */ +export declare function findCells(selector: string, outputSelector: string): CellDOMPlaceholder[]; +export declare function setButtonsBusy(id: string): void; +export declare function clearButtonsBusy(id: string): void; +export declare function renderAllCells(options: Options, notebook: ThebeNotebook, placeholders: CellDOMPlaceholder[]): CellDOMPlaceholder[]; diff --git a/pr-preview/pr-770/types/status.d.ts b/pr-preview/pr-770/types/status.d.ts new file mode 100644 index 00000000..0b1757f7 --- /dev/null +++ b/pr-preview/pr-770/types/status.d.ts @@ -0,0 +1,16 @@ +export declare class KernelStatus { + stub: string; + constructor(); + _registerHandlers(): void; + _messageElement(): Element | null | undefined; + _fieldElement(): Element | null | undefined; + /** + * Mount the status field widget. + * + * Contents of the element with class `thebe-status-field` will be replaced with a status widget + * + * @returns true if an element with the expected class was found + */ + mount(): boolean | undefined; + unmount(): Element | undefined; +} diff --git a/pr-preview/pr-770/types/thebe.d.ts b/pr-preview/pr-770/types/thebe.d.ts new file mode 100644 index 00000000..6a9d454c --- /dev/null +++ b/pr-preview/pr-770/types/thebe.d.ts @@ -0,0 +1,26 @@ +import type { Options } from './options'; +import { ThebeServer } from 'thebe-core'; +export * from './render'; +export { Options, mergeOptions, getPageConfig, getPageConfigValue, ensurePageConfigLoaded, } from './options'; +export * from './utils'; +export declare function mountStatusWidget(): void; +export declare function mountActivateWidget(options?: Options): void; +/** + * Bootstrap the library based on the configuration given. + * + * If bootstrap === true in the configuration and the library is loaded statically + * then this function will be called automatically on the document load event. + * + * @param {Object} options Object containing thebe options. + * Same structure as x-thebe-options. + * @returns {Promise} Promise for connected Kernel object + */ +export declare function bootstrap(opts?: Partial): Promise<{ + server: ThebeServer; + notebook: import("thebe-core/dist/types/notebook").default; + session?: undefined; +} | { + server: ThebeServer; + session: import("thebe-core/dist/types/session").default | null; + notebook: import("thebe-core/dist/types/notebook").default; +}>; diff --git a/pr-preview/pr-770/types/types.d.ts b/pr-preview/pr-770/types/types.d.ts new file mode 100644 index 00000000..18abfbd8 --- /dev/null +++ b/pr-preview/pr-770/types/types.d.ts @@ -0,0 +1,52 @@ +import type { CodeMirrorEditor } from '@jupyterlab/codemirror'; +import type { ThebeEventCb, ThebeEvents, ThebeNotebook, ThebeServer, ThebeSession, ThebeCoreGlobal } from 'thebe-core'; +import type { ActivateWidget } from './activate'; +import type { Options } from './options'; +import type { KernelStatus } from './status'; +import type { ThebeLiteGlobal } from 'thebe-lite'; +export interface CellDOMPlaceholder { + id: string; + placeholders: { + source: Element; + output?: Element; + }; +} +export type CellDOMItem = CellDOMPlaceholder & { + ui: { + cell: Element; + editor: Element; + output?: Element; + buttons: { + run?: Element; + runAll?: Element; + restart?: Element; + restartAll?: Element; + }; + }; +}; +export interface ThebeGlobal { + mountStatusWidget: () => void; + mountActivateWidget: () => void; + bootstrap: (options: Partial) => Promise; + notebook?: ThebeNotebook; + server?: ThebeServer; + session?: ThebeSession; + kernelStatus?: KernelStatus; + activateButton?: ActivateWidget; + events: ThebeEvents; + trigger: ThebeEventCb; + on: (event: string, cb: ThebeEventCb) => void; + one: (event: string, cb: ThebeEventCb) => void; + off: (event: string, cb: ThebeEventCb) => void; +} +declare global { + interface Window { + define: any; + requirejs: any; + thebeLite?: ThebeLiteGlobal; + thebeCore?: ThebeCoreGlobal; + thebe: ThebeGlobal; + thebelab: ThebeGlobal; + CodeMirror: CodeMirrorEditor; + } +} diff --git a/pr-preview/pr-770/types/utils.d.ts b/pr-preview/pr-770/types/utils.d.ts new file mode 100644 index 00000000..059d8f10 --- /dev/null +++ b/pr-preview/pr-770/types/utils.d.ts @@ -0,0 +1,4 @@ +import type { Options } from './options'; +export declare function stripPrompts({ selector, stripPrompts: prompts }: Options): void; +export declare function stripOutputPrompts({ selector, stripOutputPrompts: prompts }: Options): void; +export declare function randomId(): string;
+

ipywidgets using JupyterLite + pyodide-kernel

+

+ In this example, we connect to a pyodide kernel using wrapper classes and + in-browser Jupyter server the from the + jupyterlite project. +

+

+ Thebe code that uses jupyterlite has been bindles separately in the + thebe-lite library, which should be side-loaded on the page prior to + thebe being loaded. thebe-lite is not a standalone library but + when thebe is bootstrapped with the useJupyterLite option set, it + will detect and use thebe-lite or throw an error. +

+
+
+

some additional setup

+
+%pip install ipywidgets  
+      
+

ipywidgets

+

A simple widgets example.

+ +
+# borrowed from https://jupyterlite.readthedocs.io/en/latest/_static/lab/index.html
+from ipywidgets import interact, IntSlider
+from IPython.display import Markdown, display
+
+slider = IntSlider()
+
+@interact(cookies=slider)
+def cookies(cookies=slider.value, calories=(0, 150)):
+    total_calories = calories * cookies
+    if cookies:
+        display(
+          Markdown(
+            f"If each cookie contains _{calories} calories_, \
+            _{cookies} cookies_ contain **{total_calories} calories**!"
+          )
+        )
+    else:
+        display(Markdown(f"No cookies!"))
+    if total_calories > 2000:
+        display(Markdown(f"> Maybe that's too many cookies..."))
+    
+ +

ipywidgets + matplotlib

+
+import numpy as np
+import matplotlib.pyplot as plt
+%matplotlib inline
+
+from ipywidgets import interact, interactive
+from IPython.display import clear_output, display, HTML
+
+import numpy as np
+from scipy import integrate
+
+from matplotlib import pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+from matplotlib.colors import cnames
+from matplotlib import animation
+
+def solve_lorenz(
+  N=10, angle=0.0, max_time=4.0, 
+  sigma=10.0, beta=8./3, rho=28.0):
+
+    fig = plt.figure()
+    ax = fig.add_axes([0, 0, 1, 1], projection='3d')
+    ax.axis('off')
+
+    # prepare the axes limits
+    ax.set_xlim((-25, 25))
+    ax.set_ylim((-35, 35))
+    ax.set_zlim((5, 55))
+    
+    def lorenz_deriv(x_y_z, t0, sigma=sigma, beta=beta, rho=rho):
+        """Compute the time-derivative of a Lorenz system."""
+        x, y, z = x_y_z
+        return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]
+
+    # Choose random starting points, uniformly distributed from -15 to 15
+    np.random.seed(1)
+    x0 = -15 + 30 * np.random.random((N, 3))
+
+    # Solve for the trajectories
+    t = np.linspace(0, max_time, int(250*max_time))
+    x_t = np.asarray([integrate.odeint(lorenz_deriv, x0i, t)
+                      for x0i in x0])
+    
+    # choose a different color for each trajectory
+    colors = plt.cm.viridis(np.linspace(0, 1, N))
+
+    for i in range(N):
+        x, y, z = x_t[i,:,:].T
+        lines = ax.plot(x, y, z, '-', c=colors[i])
+        plt.setp(lines, linewidth=2)
+
+    ax.view_init(30, angle)
+    plt.show()
+
+    return t, x_t
+
+w = interactive(solve_lorenz, angle=(0.,360.), max_time=(0.1, 4.0), 
+                N=(0,50), sigma=(0.0,50.0), rho=(0.0,50.0))
+display(w)
+    
+