lean4monaco 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -16
- package/dist/infowebview.d.ts +8 -0
- package/dist/infowebview.js +85 -23
- package/dist/leanmonaco.d.ts +15 -2
- package/dist/leanmonaco.js +40 -35
- package/dist/vscode-lean4/vscode-lean4/src/infoview.js +1 -0
- package/dist/webview/webview.js +1 -0
- package/package.json +43 -25
- package/dist/monaco-lean4/lean4-infoview/package.json +0 -59
- package/dist/monaco-lean4/lean4-infoview/src/infoview/index.css +0 -272
- package/dist/monaco-lean4/lean4-infoview/test/tsconfig.json +0 -7
- package/dist/monaco-lean4/lean4-infoview/tsconfig.json +0 -34
- package/dist/monaco-lean4/lean4-infoview-api/package.json +0 -20
- package/dist/monaco-lean4/lean4-infoview-api/tsconfig.json +0 -29
- package/dist/monaco-lean4/lean4-unicode-input/package.json +0 -19
- package/dist/monaco-lean4/lean4-unicode-input/src/abbreviations.json +0 -1836
- package/dist/monaco-lean4/lean4-unicode-input/tsconfig.json +0 -18
- package/dist/monaco-lean4/lean4-unicode-input-component/package.json +0 -22
- package/dist/monaco-lean4/lean4-unicode-input-component/tsconfig.json +0 -18
- package/dist/monaco-lean4/lerna.json +0 -4
- package/dist/monaco-lean4/package-lock.json +0 -14153
- package/dist/monaco-lean4/package.json +0 -39
- package/dist/monaco-lean4/vscode-lean4/abbreviationview/tsconfig.json +0 -10
- package/dist/monaco-lean4/vscode-lean4/language-configuration.json +0 -157
- package/dist/monaco-lean4/vscode-lean4/loogleview/static/index.css +0 -94
- package/dist/monaco-lean4/vscode-lean4/loogleview/tsconfig.json +0 -10
- package/dist/monaco-lean4/vscode-lean4/package.json +0 -944
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationFeature.d.ts +0 -9
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationFeature.js +0 -20
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationHoverProvider.d.ts +0 -12
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationHoverProvider.js +0 -40
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationRewriterFeature.d.ts +0 -20
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationRewriterFeature.js +0 -79
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationConfig.d.ts +0 -13
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationConfig.js +0 -29
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationRewriter.d.ts +0 -28
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationRewriter.js +0 -124
- package/dist/monaco-lean4/vscode-lean4/src/config.d.ts +0 -33
- package/dist/monaco-lean4/vscode-lean4/src/config.js +0 -119
- package/dist/monaco-lean4/vscode-lean4/src/diagnostics/setupNotifs.d.ts +0 -27
- package/dist/monaco-lean4/vscode-lean4/src/diagnostics/setupNotifs.js +0 -133
- package/dist/monaco-lean4/vscode-lean4/src/infoview.d.ts +0 -69
- package/dist/monaco-lean4/vscode-lean4/src/infoview.js +0 -711
- package/dist/monaco-lean4/vscode-lean4/src/leanclient.d.ts +0 -67
- package/dist/monaco-lean4/vscode-lean4/src/leanclient.js +0 -443
- package/dist/monaco-lean4/vscode-lean4/src/rpc.d.ts +0 -16
- package/dist/monaco-lean4/vscode-lean4/src/rpc.js +0 -102
- package/dist/monaco-lean4/vscode-lean4/src/taskgutter.d.ts +0 -11
- package/dist/monaco-lean4/vscode-lean4/src/taskgutter.js +0 -130
- package/dist/monaco-lean4/vscode-lean4/src/utils/batch.d.ts +0 -37
- package/dist/monaco-lean4/vscode-lean4/src/utils/batch.js +0 -203
- package/dist/monaco-lean4/vscode-lean4/src/utils/clientProvider.d.ts +0 -41
- package/dist/monaco-lean4/vscode-lean4/src/utils/clientProvider.js +0 -205
- package/dist/monaco-lean4/vscode-lean4/src/utils/converters.d.ts +0 -16
- package/dist/monaco-lean4/vscode-lean4/src/utils/converters.js +0 -129
- package/dist/monaco-lean4/vscode-lean4/src/utils/elan.d.ts +0 -3
- package/dist/monaco-lean4/vscode-lean4/src/utils/elan.js +0 -4
- package/dist/monaco-lean4/vscode-lean4/src/utils/envPath.d.ts +0 -21
- package/dist/monaco-lean4/vscode-lean4/src/utils/envPath.js +0 -53
- package/dist/monaco-lean4/vscode-lean4/src/utils/exturi.d.ts +0 -35
- package/dist/monaco-lean4/vscode-lean4/src/utils/exturi.js +0 -136
- package/dist/monaco-lean4/vscode-lean4/src/utils/fsHelper.d.ts +0 -17
- package/dist/monaco-lean4/vscode-lean4/src/utils/fsHelper.js +0 -36
- package/dist/monaco-lean4/vscode-lean4/src/utils/leanInstaller.d.ts +0 -37
- package/dist/monaco-lean4/vscode-lean4/src/utils/leanInstaller.js +0 -210
- package/dist/monaco-lean4/vscode-lean4/src/utils/logger.d.ts +0 -7
- package/dist/monaco-lean4/vscode-lean4/src/utils/logger.js +0 -20
- package/dist/monaco-lean4/vscode-lean4/src/utils/notifs.d.ts +0 -24
- package/dist/monaco-lean4/vscode-lean4/src/utils/notifs.js +0 -110
- package/dist/monaco-lean4/vscode-lean4/src/utils/projectInfo.d.ts +0 -9
- package/dist/monaco-lean4/vscode-lean4/src/utils/projectInfo.js +0 -125
- package/dist/monaco-lean4/vscode-lean4/syntaxes/codeblock.json +0 -45
- package/dist/monaco-lean4/vscode-lean4/syntaxes/lean4-markdown.json +0 -2637
- package/dist/monaco-lean4/vscode-lean4/syntaxes/lean4.json +0 -127
- package/dist/monaco-lean4/vscode-lean4/tsconfig.json +0 -18
- package/dist/monaco-lean4/vscode-lean4/webview/tsconfig.json +0 -11
- package/dist/vscode.css +0 -408
- package/dist/webview.d.ts +0 -1
- package/dist/webview.js +0 -17
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Provides browser support for running Lean in a Monaco editor.
|
|
4
4
|
|
|
5
|
-
This package
|
|
6
|
-
|
|
5
|
+
This package uses the [VSCode extension
|
|
6
|
+
"Lean 4"](https://marketplace.visualstudio.com/items?itemName=leanprover.lean4) and the
|
|
7
7
|
[Lean Infoview](https://www.npmjs.com/package/@leanprover/infoview).
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
@@ -47,8 +47,10 @@ For some reason, the file (here `test.lean`) cannot be at the root of the file s
|
|
|
47
47
|
The package uses the Lean 4 VSCode extension, which is intended to run in a nodejs runtime. Therefore, we need to install node polyfills.
|
|
48
48
|
Here is how this can be done if your project uses Vite:
|
|
49
49
|
```
|
|
50
|
-
npm install vite-plugin-node-polyfills
|
|
50
|
+
npm install vite-plugin-node-polyfills@0.17.0 --save-exact
|
|
51
|
+
npm install memfs
|
|
51
52
|
```
|
|
53
|
+
(We use version 0.17.0 due to this bug: https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/81)
|
|
52
54
|
|
|
53
55
|
```ts
|
|
54
56
|
// vite.config.ts
|
|
@@ -67,7 +69,7 @@ export default {
|
|
|
67
69
|
|
|
68
70
|
For Vite dev mode to work properly, the following plugin is necessary:
|
|
69
71
|
```
|
|
70
|
-
npm install 'https://gitpkg.vercel.app/
|
|
72
|
+
npm install 'https://gitpkg.vercel.app/hhu-adam/lean4monaco/esbuild-import-meta-url-plugin?ec9666e' --save-dev
|
|
71
73
|
```
|
|
72
74
|
This could be replaced by `@codingame/esbuild-import-meta-url-plugin` when this PR is accepted: https://github.com/CodinGame/esbuild-import-meta-url-plugin/pull/5
|
|
73
75
|
|
|
@@ -83,21 +85,29 @@ export default {
|
|
|
83
85
|
},
|
|
84
86
|
[...]
|
|
85
87
|
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
88
|
+
``` "devDependencies": {
|
|
89
|
+
"@chialab/esbuild-plugin-meta-url": "^0.18.2",
|
|
90
|
+
"@codingame/esbuild-import-meta-url-plugin": "https://gitpkg.vercel.app/abentkamp/monacotest2/esbuild-import-meta-url-plugin?ec9666e",
|
|
91
|
+
"@types/node": "^20.14.2",
|
|
92
|
+
"@types/semver": "^7.5.8",
|
|
93
|
+
"@types/vscode": "^1.89.0",
|
|
94
|
+
"copyfiles": "^2.4.1",
|
|
95
|
+
"cypress": "^13.13.0",
|
|
96
|
+
"cypress-iframe": "^1.0.1",
|
|
97
|
+
"ts-loader": "^9.5.1",
|
|
98
|
+
"typescript": "^5.4.5",
|
|
99
|
+
"wait-on": "^7.2.0",
|
|
100
|
+
"webpack": "^5.93.0",
|
|
101
|
+
"webpack-cli": "^5.1.4"
|
|
102
|
+
},
|
|
96
103
|
plugins: [
|
|
97
104
|
viteStaticCopy({
|
|
98
105
|
targets: [
|
|
99
106
|
{
|
|
100
|
-
src:
|
|
107
|
+
src: [
|
|
108
|
+
normalizePath(path.resolve(__dirname, './node_modules/@leanprover/infoview/dist/*')),
|
|
109
|
+
normalizePath(path.resolve(__dirname, './node_modules/lean4monaco/dist/webview/webview.js')),
|
|
110
|
+
],
|
|
101
111
|
dest: 'infoview'
|
|
102
112
|
}
|
|
103
113
|
]
|
|
@@ -106,10 +116,23 @@ export default {
|
|
|
106
116
|
}
|
|
107
117
|
```
|
|
108
118
|
|
|
119
|
+
## Demo
|
|
120
|
+
|
|
121
|
+
You can clone `lean4monaco`, then run the demo located in `lean4monaco/demo/` with
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
cd lean4monaco
|
|
125
|
+
npm install
|
|
126
|
+
npm start
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
and open [http://localhost:5173](http://localhost:5173). This should open a rudimentary webpage
|
|
130
|
+
with 1 (or more) monaco editors and an infoview, showing the Lean infos at the cursor.
|
|
131
|
+
|
|
109
132
|
## Troubleshooting
|
|
110
133
|
|
|
111
134
|
* Make sure that only one version of the npm package `monaco-vscode-api` is installed.
|
|
112
135
|
The error I typically got is:
|
|
113
136
|
```
|
|
114
137
|
this._configurationService.onDidChangeConfiguration is not a function
|
|
115
|
-
```
|
|
138
|
+
```
|
package/dist/infowebview.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { EditorApi, InfoviewApi } from "@leanprover/infoview-api";
|
|
|
2
2
|
import { InfoWebviewFactory, InfoWebview } from "./vscode-lean4/vscode-lean4/src/infoview";
|
|
3
3
|
import { Rpc } from "./vscode-lean4/vscode-lean4/src/rpc";
|
|
4
4
|
import { ViewColumn } from "vscode";
|
|
5
|
+
import { IConfigurationService, IThemeService } from "vscode/services";
|
|
5
6
|
export declare class IFrameInfoWebview implements InfoWebview {
|
|
6
7
|
private iframe;
|
|
7
8
|
rpc: Rpc;
|
|
@@ -14,8 +15,15 @@ export declare class IFrameInfoWebview implements InfoWebview {
|
|
|
14
15
|
reveal(viewColumn?: ViewColumn, preserveFocus?: boolean): void;
|
|
15
16
|
}
|
|
16
17
|
export declare class IFrameInfoWebviewFactory implements InfoWebviewFactory {
|
|
18
|
+
private themeService;
|
|
19
|
+
private configurationService;
|
|
20
|
+
private fontFile;
|
|
17
21
|
private infoviewElement;
|
|
22
|
+
private iframe;
|
|
23
|
+
constructor(themeService: IThemeService, configurationService: IConfigurationService, fontFile: FontFace);
|
|
18
24
|
setInfoviewElement(infoviewElement: HTMLElement): void;
|
|
19
25
|
make(editorApi: EditorApi, stylesheet: string, column: number): IFrameInfoWebview;
|
|
26
|
+
private updateCssVars;
|
|
27
|
+
private apiThemeClassName;
|
|
20
28
|
private initialHtml;
|
|
21
29
|
}
|
package/dist/infowebview.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Rpc } from "./vscode-lean4/vscode-lean4/src/rpc";
|
|
2
2
|
import { EventEmitter } from "vscode";
|
|
3
|
+
import * as colorUtils from 'vscode/vscode/vs/platform/theme/common/colorUtils';
|
|
4
|
+
import { ColorScheme } from 'vscode/vscode/vs/platform/theme/common/theme';
|
|
5
|
+
import * as editorOptions from 'vscode/vscode/vs/editor/common/config/editorOptions';
|
|
3
6
|
export class IFrameInfoWebview {
|
|
4
7
|
iframe;
|
|
5
8
|
rpc;
|
|
@@ -20,16 +23,27 @@ export class IFrameInfoWebview {
|
|
|
20
23
|
}
|
|
21
24
|
}
|
|
22
25
|
export class IFrameInfoWebviewFactory {
|
|
26
|
+
themeService;
|
|
27
|
+
configurationService;
|
|
28
|
+
fontFile;
|
|
23
29
|
infoviewElement;
|
|
30
|
+
iframe;
|
|
31
|
+
constructor(themeService, configurationService, fontFile) {
|
|
32
|
+
this.themeService = themeService;
|
|
33
|
+
this.configurationService = configurationService;
|
|
34
|
+
this.fontFile = fontFile;
|
|
35
|
+
}
|
|
24
36
|
setInfoviewElement(infoviewElement) {
|
|
25
37
|
this.infoviewElement = infoviewElement;
|
|
26
38
|
}
|
|
27
39
|
make(editorApi, stylesheet, column) {
|
|
28
|
-
|
|
29
|
-
this.infoviewElement.append(iframe);
|
|
30
|
-
iframe.contentWindow.document.open();
|
|
31
|
-
iframe.contentWindow.document.write(this.initialHtml(stylesheet));
|
|
32
|
-
iframe.contentWindow.document.close();
|
|
40
|
+
this.iframe = document.createElement("iframe");
|
|
41
|
+
this.infoviewElement.append(this.iframe);
|
|
42
|
+
this.iframe.contentWindow.document.open();
|
|
43
|
+
this.iframe.contentWindow.document.write(this.initialHtml(stylesheet));
|
|
44
|
+
this.iframe.contentWindow.document.close();
|
|
45
|
+
this.updateCssVars();
|
|
46
|
+
this.themeService.onDidColorThemeChange(() => { this.updateCssVars(); });
|
|
33
47
|
// Note that an extension can send data to its webviews using webview.postMessage().
|
|
34
48
|
// This method sends any JSON serializable data to the webview. The message is received
|
|
35
49
|
// inside the webview through the standard message event.
|
|
@@ -38,7 +52,7 @@ export class IFrameInfoWebviewFactory {
|
|
|
38
52
|
const rpc = new Rpc(m => {
|
|
39
53
|
try {
|
|
40
54
|
// JSON.stringify is needed here to serialize getters such as `Position.line` and `Position.character`
|
|
41
|
-
void iframe.contentWindow.postMessage(JSON.stringify(m));
|
|
55
|
+
void this.iframe.contentWindow.postMessage(JSON.stringify(m));
|
|
42
56
|
}
|
|
43
57
|
catch (e) {
|
|
44
58
|
// ignore any disposed object exceptions
|
|
@@ -47,7 +61,7 @@ export class IFrameInfoWebviewFactory {
|
|
|
47
61
|
rpc.register(editorApi);
|
|
48
62
|
// Similarly, we can received data from the webview by listening to onDidReceiveMessage.
|
|
49
63
|
document.defaultView.addEventListener('message', m => {
|
|
50
|
-
if (m.source != iframe.contentWindow) {
|
|
64
|
+
if (m.source != this.iframe.contentWindow) {
|
|
51
65
|
return;
|
|
52
66
|
}
|
|
53
67
|
try {
|
|
@@ -57,24 +71,72 @@ export class IFrameInfoWebviewFactory {
|
|
|
57
71
|
// ignore any disposed object exceptions
|
|
58
72
|
}
|
|
59
73
|
});
|
|
60
|
-
return new IFrameInfoWebview(iframe, rpc);
|
|
74
|
+
return new IFrameInfoWebview(this.iframe, rpc);
|
|
75
|
+
}
|
|
76
|
+
updateCssVars() {
|
|
77
|
+
const theme = this.themeService.getColorTheme();
|
|
78
|
+
const documentStyle = this.iframe.contentDocument?.documentElement.style;
|
|
79
|
+
const colors = colorUtils.getColorRegistry().getColors();
|
|
80
|
+
const exportedColors = colors.reduce((colors, entry) => {
|
|
81
|
+
const color = theme.getColor(entry.id);
|
|
82
|
+
if (color) {
|
|
83
|
+
colors['vscode-' + entry.id.replace('.', '-')] = color.toString();
|
|
84
|
+
}
|
|
85
|
+
return colors;
|
|
86
|
+
}, {});
|
|
87
|
+
const EDITOR_FONT_DEFAULTS = editorOptions.EDITOR_FONT_DEFAULTS;
|
|
88
|
+
const configuration = this.configurationService.getValue('editor');
|
|
89
|
+
const editorFontFamily = configuration.fontFamily || EDITOR_FONT_DEFAULTS.fontFamily;
|
|
90
|
+
const editorFontWeight = configuration.fontWeight || EDITOR_FONT_DEFAULTS.fontWeight;
|
|
91
|
+
const editorFontSize = configuration.fontSize || EDITOR_FONT_DEFAULTS.fontSize;
|
|
92
|
+
const linkUnderlines = this.configurationService.getValue('accessibility.underlineLinks');
|
|
93
|
+
const styles = {
|
|
94
|
+
'vscode-font-family': '\'Droid Sans Mono\', Consolas, Menlo, Monaco, \'Courier New\', monospace',
|
|
95
|
+
'vscode-font-weight': 'normal',
|
|
96
|
+
'vscode-font-size': '13px',
|
|
97
|
+
'vscode-editor-font-family': editorFontFamily,
|
|
98
|
+
'vscode-editor-font-weight': editorFontWeight,
|
|
99
|
+
'vscode-editor-font-size': editorFontSize + 'px',
|
|
100
|
+
'text-link-decoration': linkUnderlines ? 'underline' : 'none',
|
|
101
|
+
...exportedColors
|
|
102
|
+
};
|
|
103
|
+
console.log(styles);
|
|
104
|
+
for (const id in styles) {
|
|
105
|
+
documentStyle?.setProperty(`--${id}`, styles[id]);
|
|
106
|
+
}
|
|
107
|
+
documentStyle?.setProperty('font-family', '-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif');
|
|
108
|
+
this.iframe.contentDocument?.documentElement.setAttribute('class', `${this.apiThemeClassName(theme)}`);
|
|
109
|
+
this.iframe.contentDocument?.fonts.add(this.fontFile);
|
|
110
|
+
}
|
|
111
|
+
apiThemeClassName(theme) {
|
|
112
|
+
switch (theme.type) {
|
|
113
|
+
case ColorScheme.LIGHT: return 'vscode-light';
|
|
114
|
+
case ColorScheme.DARK: return 'vscode-dark';
|
|
115
|
+
case ColorScheme.HIGH_CONTRAST_DARK: return 'vscode-high-contrast';
|
|
116
|
+
case ColorScheme.HIGH_CONTRAST_LIGHT: return 'vscode-high-contrast-light';
|
|
117
|
+
}
|
|
61
118
|
}
|
|
62
119
|
initialHtml(stylesheet) {
|
|
63
120
|
return `
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
121
|
+
<!DOCTYPE html>
|
|
122
|
+
<html>
|
|
123
|
+
<head>
|
|
124
|
+
<meta charset="UTF-8" />
|
|
125
|
+
<meta http-equiv="Content-type" content="text/html;charset=utf-8">
|
|
126
|
+
<title>Infoview</title>
|
|
127
|
+
<style>${stylesheet}</style>
|
|
128
|
+
<style>
|
|
129
|
+
body {
|
|
130
|
+
background-color: var(--vscode-editor-background);
|
|
131
|
+
color: var(--vscode-editor-foreground);
|
|
132
|
+
}
|
|
133
|
+
</style>
|
|
134
|
+
<link rel="stylesheet" href="${new URL('../node_modules/@leanprover/infoview/dist/index.css', import.meta.url)}">
|
|
135
|
+
</head>
|
|
136
|
+
<body>
|
|
137
|
+
<div id="react_root"></div>
|
|
138
|
+
<script type="module" src="/infoview/webview.js"></script>
|
|
139
|
+
</body>
|
|
140
|
+
</html>`;
|
|
79
141
|
}
|
|
80
142
|
}
|
package/dist/leanmonaco.d.ts
CHANGED
|
@@ -7,6 +7,15 @@ import { LeanTaskGutter } from './vscode-lean4/vscode-lean4/src/taskgutter';
|
|
|
7
7
|
import { IFrameInfoWebviewFactory } from './infowebview';
|
|
8
8
|
import { IExtensionManifest } from 'vscode/extensions';
|
|
9
9
|
import { DisposableStore } from 'vscode/monaco';
|
|
10
|
+
/** Options for LeanMonaco.
|
|
11
|
+
*
|
|
12
|
+
* The URL is where the server listens. You might want to use something like
|
|
13
|
+
* `"ws://" + window.location.host`
|
|
14
|
+
*
|
|
15
|
+
* To add settings in `vscode`, you can open your settings in VSCode (Ctrl+,), search
|
|
16
|
+
* for the desired setting, select "Copy Setting as JSON" from the "More Actions"
|
|
17
|
+
* menu next to the selected setting, and paste the copied string here.
|
|
18
|
+
*/
|
|
10
19
|
export type LeanMonacoOptions = {
|
|
11
20
|
websocket: {
|
|
12
21
|
url: string;
|
|
@@ -16,7 +25,7 @@ export type LeanMonacoOptions = {
|
|
|
16
25
|
};
|
|
17
26
|
};
|
|
18
27
|
export declare class LeanMonaco {
|
|
19
|
-
ready
|
|
28
|
+
private ready;
|
|
20
29
|
whenReady: Promise<void>;
|
|
21
30
|
static activeInstance: LeanMonaco | null;
|
|
22
31
|
registerFileUrlResults: DisposableStore;
|
|
@@ -26,11 +35,15 @@ export declare class LeanMonaco {
|
|
|
26
35
|
iframeWebviewFactory: IFrameInfoWebviewFactory | undefined;
|
|
27
36
|
abbreviationFeature: AbbreviationFeature | undefined;
|
|
28
37
|
taskGutter: LeanTaskGutter | undefined;
|
|
38
|
+
infoviewEl: HTMLElement | undefined;
|
|
29
39
|
disposed: boolean;
|
|
30
40
|
start(options: LeanMonacoOptions): Promise<void>;
|
|
41
|
+
updateVSCodeOptions(vsCodeOptions: {
|
|
42
|
+
[id: string]: any;
|
|
43
|
+
}): void;
|
|
31
44
|
setInfoviewElement(infoviewEl: HTMLElement): void;
|
|
32
45
|
protected getExtensionFiles(): Map<string, URL>;
|
|
33
|
-
protected getExtensionManifest(
|
|
46
|
+
protected getExtensionManifest(): IExtensionManifest;
|
|
34
47
|
protected getWebSocketOptions(options: LeanMonacoOptions): WebSocketConfigOptionsUrl;
|
|
35
48
|
dispose(): void;
|
|
36
49
|
}
|
package/dist/leanmonaco.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import 'vscode/localExtensionHost';
|
|
2
2
|
import { LeanClientProvider } from './vscode-lean4/vscode-lean4/src/utils/clientProvider';
|
|
3
|
-
import { Uri } from 'vscode';
|
|
3
|
+
import { Uri, workspace } from 'vscode';
|
|
4
4
|
import { InfoProvider } from './vscode-lean4/vscode-lean4/src/infoview';
|
|
5
5
|
import { AbbreviationFeature } from './vscode-lean4/vscode-lean4/src/abbreviation/AbbreviationFeature';
|
|
6
6
|
import { LeanTaskGutter } from './vscode-lean4/vscode-lean4/src/taskgutter';
|
|
7
7
|
import { IFrameInfoWebviewFactory } from './infowebview';
|
|
8
8
|
import { setupMonacoClient } from './monacoleanclient';
|
|
9
9
|
import { checkLean4ProjectPreconditions } from './preconditions';
|
|
10
|
-
import { initialize } from 'vscode/services';
|
|
10
|
+
import { initialize, getService, IThemeService, IConfigurationService } from 'vscode/services';
|
|
11
11
|
import getConfigurationServiceOverride from '@codingame/monaco-vscode-configuration-service-override';
|
|
12
12
|
import getTextmateServiceOverride from '@codingame/monaco-vscode-textmate-service-override';
|
|
13
13
|
import getThemeServiceOverride from '@codingame/monaco-vscode-theme-service-override';
|
|
@@ -29,6 +29,7 @@ export class LeanMonaco {
|
|
|
29
29
|
iframeWebviewFactory;
|
|
30
30
|
abbreviationFeature;
|
|
31
31
|
taskGutter;
|
|
32
|
+
infoviewEl;
|
|
32
33
|
disposed = false;
|
|
33
34
|
async start(options) {
|
|
34
35
|
if (LeanMonaco.activeInstance == this) {
|
|
@@ -75,7 +76,7 @@ export class LeanMonaco {
|
|
|
75
76
|
await (await import('@codingame/monaco-vscode-theme-defaults-default-extension')).whenReady;
|
|
76
77
|
if (this.disposed)
|
|
77
78
|
return;
|
|
78
|
-
this.extensionRegisterResult = registerExtension(this.getExtensionManifest(
|
|
79
|
+
this.extensionRegisterResult = registerExtension(this.getExtensionManifest(), 1 /* ExtensionHostKind.LocalProcess */);
|
|
79
80
|
for (const entry of this.getExtensionFiles()) {
|
|
80
81
|
const registerFileUrlResult = this.extensionRegisterResult.registerFileUrl(entry[0], entry[1].href);
|
|
81
82
|
this.registerFileUrlResults.add(registerFileUrlResult);
|
|
@@ -83,6 +84,11 @@ export class LeanMonaco {
|
|
|
83
84
|
await this.extensionRegisterResult.whenReady();
|
|
84
85
|
if (this.disposed)
|
|
85
86
|
return;
|
|
87
|
+
const themeService = await getService(IThemeService);
|
|
88
|
+
const configurationService = await getService(IConfigurationService);
|
|
89
|
+
if (this.disposed)
|
|
90
|
+
return;
|
|
91
|
+
this.updateVSCodeOptions(options.vscode ?? {});
|
|
86
92
|
this.abbreviationFeature = new AbbreviationFeature({}, { kind: 'MoveAllSelections' });
|
|
87
93
|
this.clientProvider = new LeanClientProvider({
|
|
88
94
|
installChanged: () => { return { dispose: () => { } }; },
|
|
@@ -91,20 +97,27 @@ export class LeanMonaco {
|
|
|
91
97
|
}, { appendLine: () => { }
|
|
92
98
|
}, setupMonacoClient(this.getWebSocketOptions(options)), checkLean4ProjectPreconditions);
|
|
93
99
|
this.taskGutter = new LeanTaskGutter(this.clientProvider, { asAbsolutePath: (path) => Uri.parse(`${new URL('vscode-lean4/vscode-lean4/' + path, import.meta.url)}`), });
|
|
94
|
-
if (!this.iframeWebviewFactory)
|
|
95
|
-
this.iframeWebviewFactory = new IFrameInfoWebviewFactory();
|
|
96
|
-
this.infoProvider = new InfoProvider(this.clientProvider, { language: 'lean4' }, {}, this.iframeWebviewFactory);
|
|
97
100
|
const fontFile = new FontFace("JuliaMono", `url(${new URL("./JuliaMono-Regular.ttf", import.meta.url)})`);
|
|
98
101
|
document.fonts.add(fontFile);
|
|
102
|
+
this.iframeWebviewFactory = new IFrameInfoWebviewFactory(themeService, configurationService, fontFile);
|
|
103
|
+
if (this.infoviewEl)
|
|
104
|
+
this.iframeWebviewFactory.setInfoviewElement(this.infoviewEl);
|
|
105
|
+
this.infoProvider = new InfoProvider(this.clientProvider, { language: 'lean4' }, {}, this.iframeWebviewFactory);
|
|
99
106
|
await fontFile.load();
|
|
107
|
+
this.updateVSCodeOptions(options.vscode ?? {});
|
|
100
108
|
if (this.disposed)
|
|
101
109
|
return;
|
|
102
110
|
this.ready();
|
|
103
111
|
}
|
|
112
|
+
updateVSCodeOptions(vsCodeOptions) {
|
|
113
|
+
for (const key in vsCodeOptions) {
|
|
114
|
+
workspace.getConfiguration().update(key, vsCodeOptions[key]);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
104
117
|
setInfoviewElement(infoviewEl) {
|
|
105
|
-
if (
|
|
106
|
-
this.iframeWebviewFactory
|
|
107
|
-
this.
|
|
118
|
+
if (this.iframeWebviewFactory)
|
|
119
|
+
this.iframeWebviewFactory.setInfoviewElement(infoviewEl);
|
|
120
|
+
this.infoviewEl = infoviewEl;
|
|
108
121
|
}
|
|
109
122
|
getExtensionFiles() {
|
|
110
123
|
const extensionFiles = new Map();
|
|
@@ -115,12 +128,7 @@ export class LeanMonaco {
|
|
|
115
128
|
extensionFiles.set('/themes/cobalt2.json', new URL('./themes/cobalt2.json', import.meta.url));
|
|
116
129
|
return extensionFiles;
|
|
117
130
|
}
|
|
118
|
-
getExtensionManifest(
|
|
119
|
-
for (let o in options.vscode) {
|
|
120
|
-
if (packageJson.contributes.configuration.properties[o]) {
|
|
121
|
-
packageJson.contributes.configuration.properties[o].default = options.vscode[o];
|
|
122
|
-
}
|
|
123
|
-
}
|
|
131
|
+
getExtensionManifest() {
|
|
124
132
|
return {
|
|
125
133
|
name: 'lean4web',
|
|
126
134
|
publisher: 'leanprover-community',
|
|
@@ -147,6 +155,7 @@ export class LeanMonaco {
|
|
|
147
155
|
"configuration": "./language-configuration.json"
|
|
148
156
|
}
|
|
149
157
|
],
|
|
158
|
+
colors: packageJson.contributes.colors,
|
|
150
159
|
"grammars": [
|
|
151
160
|
{
|
|
152
161
|
"language": "lean4",
|
|
@@ -171,26 +180,22 @@ export class LeanMonaco {
|
|
|
171
180
|
}
|
|
172
181
|
],
|
|
173
182
|
"configurationDefaults": {
|
|
174
|
-
"
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
"editor.wrappingStrategy": "advanced",
|
|
191
|
-
"editor.theme": "Visual Studio Light", //"Cobalt" // "Visual Studio Light" //"Visual Studio Dark" //"Default Light Modern" //"Default Light+" //"Default Dark+" //"Default High Contrast"
|
|
192
|
-
...options.vscode
|
|
193
|
-
}
|
|
183
|
+
"editor.folding": false,
|
|
184
|
+
"editor.wordSeparators": "`~@$%^&*()-=+[{]}⟨⟩⦃⦄⟦⟧⟮⟯‹›\\|;:\",.<>/",
|
|
185
|
+
"editor.lineNumbers": 'on',
|
|
186
|
+
"editor.lineNumbersMinChars": 1,
|
|
187
|
+
"editor.glyphMargin": true,
|
|
188
|
+
"editor.lineDecorationsWidth": 5,
|
|
189
|
+
"editor.tabSize": 2,
|
|
190
|
+
"editor.detectIndentation": false,
|
|
191
|
+
"editor.lightbulb.enabled": "on",
|
|
192
|
+
"editor.unicodeHighlight.ambiguousCharacters": false,
|
|
193
|
+
"editor.minimap.enabled": false,
|
|
194
|
+
"editor.semanticHighlighting.enabled": true,
|
|
195
|
+
"editor.wordWrap": "off",
|
|
196
|
+
"editor.acceptSuggestionOnEnter": "off",
|
|
197
|
+
"editor.fontFamily": "JuliaMono",
|
|
198
|
+
"editor.wrappingStrategy": "advanced",
|
|
194
199
|
},
|
|
195
200
|
"themes": [
|
|
196
201
|
{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";window.esmsInitOptions={shimMode:!0};var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){if(void 0===e)return"error";if("object"!=typeof e||e instanceof Array)return e;{const t={};for(const r of Object.getOwnPropertyNames(e))t[r]=e[r];return t}}!function(){const t="undefined"!=typeof window,r="undefined"!=typeof document,i=()=>{},n=r?document.querySelector("script[type=esms-options]"):void 0,s=n?JSON.parse(n.innerHTML):{};Object.assign(s,self.esmsInitOptions||{});let a=!r||!!s.shimMode;const o=w(a&&s.onimport),c=w(a&&s.resolve);let l=s.fetch?w(s.fetch):fetch;const f=s.meta?w(a&&s.meta):i,u=s.mapOverrides;let d=s.nonce;if(!d&&r){const e=document.querySelector("script[nonce]");e&&(d=e.nonce||e.getAttribute("nonce"))}const p=w(s.onerror||i),h=s.onpolyfill?w(s.onpolyfill):()=>{console.log("%c^^ Module TypeError above is polyfilled and can be ignored ^^","font-weight:900;color:#391")},{revokeBlobURLs:m,noLoadEventRetriggers:b,enforceIntegrity:k}=s;function w(e){return"string"==typeof e?self[e]:e}const g=Array.isArray(s.polyfillEnable)?s.polyfillEnable:[],y=g.includes("css-modules"),v=g.includes("json-modules"),$=g.includes("wasm-modules"),x=!navigator.userAgentData&&!!navigator.userAgent.match(/Edge\/\d+\.\d+/),E=r?document.baseURI:`${location.protocol}//${location.host}${location.pathname.includes("/")?location.pathname.slice(0,location.pathname.lastIndexOf("/")+1):location.pathname}`,A=(e,t="text/javascript")=>URL.createObjectURL(new Blob([e],{type:t}));let{skip:S}=s;if(Array.isArray(S)){const e=S.map((e=>new URL(e,E).href));S=t=>e.some((e=>"/"===e[e.length-1]&&t.startsWith(e)||t===e))}else if("string"==typeof S){const e=new RegExp(S);S=t=>e.test(t)}else S instanceof RegExp&&(S=e=>S.test(e));const O=e=>setTimeout((()=>{throw e})),j=e=>{(self.reportError||t&&window.safari&&console.error||O)(e),p(e)};function L(e){return e?` imported from ${e}`:""}let C=!1;if(!a)if(document.querySelectorAll("script[type=module-shim],script[type=importmap-shim],link[rel=modulepreload-shim]").length)a=!0;else{let e=!1;for(const t of document.querySelectorAll("script[type=module],script[type=importmap]"))if(e){if("importmap"===t.type&&e){C=!0;break}}else"module"!==t.type||t.ep||(e=!0)}const I=/\\/g;function M(e){try{if(-1!==e.indexOf(":"))return new URL(e).href}catch(e){}}function U(e,t){return P(e,t)||M(e)||P("./"+e,t)}function P(e,t){const r=t.indexOf("#"),i=t.indexOf("?");if(r+i>-2&&(t=t.slice(0,-1===r?i:-1===i||i>r?r:i)),-1!==e.indexOf("\\")&&(e=e.replace(I,"/")),"/"===e[0]&&"/"===e[1])return t.slice(0,t.indexOf(":")+1)+e;if("."===e[0]&&("/"===e[1]||"."===e[1]&&("/"===e[2]||2===e.length&&(e+="/"))||1===e.length&&(e+="/"))||"/"===e[0]){const r=t.slice(0,t.indexOf(":")+1);if("blob:"===r)throw new TypeError(`Failed to resolve module specifier "${e}". Invalid relative url or base scheme isn't hierarchical.`);let i;if("/"===t[r.length+1]?"file:"!==r?(i=t.slice(r.length+2),i=i.slice(i.indexOf("/")+1)):i=t.slice(8):i=t.slice(r.length+("/"===t[r.length])),"/"===e[0])return t.slice(0,t.length-i.length-1)+e;const n=i.slice(0,i.lastIndexOf("/")+1)+e,s=[];let a=-1;for(let e=0;e<n.length;e++)if(-1===a){if("."===n[e]){if("."===n[e+1]&&("/"===n[e+2]||e+2===n.length)){s.pop(),e+=2;continue}if("/"===n[e+1]||e+1===n.length){e+=1;continue}}for(;"/"===n[e];)e++;a=e}else"/"===n[e]&&(s.push(n.slice(a,e+1)),a=-1);return-1!==a&&s.push(n.slice(a)),t.slice(0,t.length-i.length)+s.join("")}}function _(e,t,r){const i={imports:Object.assign({},r.imports),scopes:Object.assign({},r.scopes)};if(e.imports&&T(e.imports,i.imports,t,r),e.scopes)for(let n in e.scopes){const s=U(n,t);T(e.scopes[n],i.scopes[s]||(i.scopes[s]={}),t,r)}return i}function N(e,t){if(t[e])return e;let r=e.length;do{const i=e.slice(0,r+1);if(i in t)return i}while(-1!==(r=e.lastIndexOf("/",r-1)))}function R(e,t){const r=N(e,t);if(r){const i=t[r];if(null===i)return;return i+e.slice(r.length)}}function q(e,t,r){let i=r&&N(r,e.scopes);for(;i;){const r=R(t,e.scopes[i]);if(r)return r;i=N(i.slice(0,i.lastIndexOf("/")),e.scopes)}return R(t,e.imports)||-1!==t.indexOf(":")&&t}function T(e,t,r,i){for(let n in e){const s=P(n,r)||n;if((!a||!u)&&t[s]&&t[s]!==e[s])throw Error(`Rejected map override "${s}" from ${t[s]} to ${e[s]}.`);let o=e[n];if("string"!=typeof o)continue;const c=q(i,P(o,r)||o,r);c?t[s]=c:console.warn(`Mapping "${n}" -> "${e[n]}" does not resolve`)}}let H,z=!r&&(0,eval)("u=>import(u)");const J=r&&new Promise((e=>{const t=Object.assign(document.createElement("script"),{src:A("self._d=u=>import(u)"),ep:!0});t.setAttribute("nonce",d),t.addEventListener("load",(()=>{if(!(H=!!(z=self._d))){let e;window.addEventListener("error",(t=>e=t)),z=(t,r)=>new Promise(((i,n)=>{const s=Object.assign(document.createElement("script"),{type:"module",src:A(`import*as m from'${t}';self._esmsi=m`)});function a(a){document.head.removeChild(s),self._esmsi?(i(self._esmsi,E),self._esmsi=void 0):(n(!(a instanceof Event)&&a||e&&e.error||new Error(`Error loading ${r&&r.errUrl||t} (${s.src}).`)),e=void 0)}e=void 0,s.ep=!0,d&&s.setAttribute("nonce",d),s.addEventListener("error",a),s.addEventListener("load",a),document.head.appendChild(s)}))}document.head.removeChild(t),delete self._d,e()})),document.head.appendChild(t)}));let D=!1,W=!1;const B=r&&HTMLScriptElement.supports;let F=B&&"supports"===B.name&&B("importmap"),K=H,G=!1;const Q="import.meta",V='import"x"',X='assert{type:"css"}',Y='assert{type:"json"}';let Z,ee,te,re=Promise.resolve(J).then((()=>{if(H)return r?new Promise((e=>{const t=document.createElement("iframe");t.style.display="none",t.setAttribute("nonce",d),window.addEventListener("message",(function r({data:i}){Array.isArray(i)&&"esms"===i[0]&&(F=i[1],K=i[2],W=i[3],D=i[4],e(),document.head.removeChild(t),window.removeEventListener("message",r,!1))}),!1);const r=`<script nonce=${d||""}>b=(s,type='text/javascript')=>URL.createObjectURL(new Blob([s],{type}));document.head.appendChild(Object.assign(document.createElement('script'),{type:'importmap',nonce:"${d}",innerText:\`{"imports":{"x":"\${b('')}"}}\`}));Promise.all([${F?"true,true":`'x',b('${Q}')`}, ${y?`b('${X}'.replace('x',b('','text/css')))`:"false"}, ${v?`b('${Y}'.replace('x',b('{}','text/json')))`:"false"}].map(x =>typeof x==='string'?import(x).then(x =>!!x,()=>false):x)).then(a=>parent.postMessage(['esms'].concat(a),'*'))<\/script>`;let i=!1,n=!1;function s(){if(!i)return void(n=!0);const e=t.contentDocument;if(e&&0===e.head.childNodes.length){const t=e.createElement("script");d&&t.setAttribute("nonce",d),t.innerHTML=r.slice(15+(d?d.length:0),-9),e.head.appendChild(t)}}t.onload=s,document.head.appendChild(t),i=!0,"srcdoc"in t?t.srcdoc=r:t.contentDocument.write(r),n&&s()})):Promise.all([F||z(A(Q)).then((()=>K=!0),i),y&&z(A(V.replace("x",A("","text/css"))+X)).then((()=>W=!0),i),v&&z(A(V.replace("x",A("{}","text/json"))+Y)).then((()=>D=!0),i),$&&z(A(V.replace("x",A(new Uint8Array([0,97,115,109,1,0,0,0]),"application/wasm")))).then((()=>G=!0),i)])})),ie=2<<19;const ne=1===new Uint8Array(new Uint16Array([1]).buffer)[0]?function(e,t){const r=e.length;let i=0;for(;i<r;)t[i]=e.charCodeAt(i++)}:function(e,t){const r=e.length;let i=0;for(;i<r;){const r=e.charCodeAt(i);t[i++]=(255&r)<<8|r>>>8}},se="xportmportlassetaromsyncunctionssertvoyiedelecontininstantybreareturdebuggeawaithrwhileforifcatcfinallels";let ae,oe,ce;function le(e,t){ce=e;let r="",i=ce;for(;;){ce>=ae.length&&pe();const e=ae.charCodeAt(ce);if(e===t)break;92===e?(r+=ae.slice(i,ce),r+=fe(),i=ce):(8232===e||8233===e||de(e)&&pe(),++ce)}return r+=ae.slice(i,ce++),r}function fe(){let e=ae.charCodeAt(++ce);switch(++ce,e){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(ue(2));case 117:return function(){let e;return 123===ae.charCodeAt(ce)?(++ce,e=ue(ae.indexOf("}",ce)-ce),++ce,e>1114111&&pe()):e=ue(4),e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}();case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===ae.charCodeAt(ce)&&++ce;case 10:return"";case 56:case 57:pe();default:if(e>=48&&e<=55){let t=ae.substr(ce-1,3).match(/^[0-7]+/)[0],r=parseInt(t,8);return r>255&&(t=t.slice(0,-1),r=parseInt(t,8)),ce+=t.length-1,e=ae.charCodeAt(ce),"0"===t&&56!==e&&57!==e||pe(),String.fromCharCode(r)}return de(e)?"":String.fromCharCode(e)}}function ue(e){const t=ce;let r=0,i=0;for(let t=0;t<e;++t,++ce){let e,n=ae.charCodeAt(ce);if(95!==n){if(n>=97)e=n-97+10;else if(n>=65)e=n-65+10;else{if(!(n>=48&&n<=57))break;e=n-48}if(e>=16)break;i=n,r=16*r+e}else 95!==i&&0!==t||pe(),i=n}return 95!==i&&ce-t===e||pe(),r}function de(e){return 13===e||10===e}function pe(){throw Object.assign(Error(`Parse error ${oe}:${ae.slice(0,ce).split("\n").length}:${ce-ae.lastIndexOf("\n",ce-1)}`),{idx:ce})}async function he(e,t){const r=P(e,t)||M(e);return{r:q(Ee,r||e,t)||we(e,t),b:!r&&!M(e)}}const me=c?async(e,t)=>{let r=c(e,t,ke);return r&&r.then&&(r=await r),r?{r,b:!P(e,t)&&!M(e)}:he(e,t)}:he;async function be(e,...t){let i=t[t.length-1];return"string"!=typeof i&&(i=E),await Ae,o&&await o(e,"string"!=typeof t[1]?t[1]:{},i),(Le||a||!xe)&&(r&&Fe(!0),a||(Le=!1)),await Oe,Ce((await me(e,i)).r,{credentials:"same-origin"})}function ke(e,t){return q(Ee,P(e,t)||e,t)||we(e,t)}function we(e,t){throw Error(`Unable to resolve specifier '${e}'${L(t)}`)}self.importShim=be;const ge=(e,t=E)=>{t=`${t}`;const r=c&&c(e,t,ke);return r&&!r.then?r:ke(e,t)};function ye(e,t=this.url){return ge(e,t)}be.resolve=ge,be.getImportMap=()=>JSON.parse(JSON.stringify(Ee)),be.addImportMap=e=>{if(!a)throw new Error("Unsupported in polyfill mode.");Ee=_(e,E,Ee)};const ve=be._r={};async function $e(e,t){e.b||t[e.u]||(t[e.u]=1,await e.L,await Promise.all(e.d.map((e=>$e(e,t)))),e.n||(e.n=e.d.some((e=>e.n))))}be._w={};let xe,Ee={imports:{},scopes:{}};const Ae=re.then((()=>{if(xe=!0!==s.polyfillEnable&&H&&K&&F&&(!v||D)&&(!y||W)&&(!$||G)&&!C,r){if(!F){const e=HTMLScriptElement.supports||(e=>"classic"===e||"module"===e);HTMLScriptElement.supports=t=>"importmap"===t||e(t)}if(a||!xe)if(new MutationObserver((e=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)"SCRIPT"===e.tagName?(e.type===(a?"module-shim":"module")&&rt(e,!0),e.type===(a?"importmap-shim":"importmap")&&tt(e,!0)):"LINK"===e.tagName&&e.rel===(a?"modulepreload-shim":"modulepreload")&&nt(e)})).observe(document,{childList:!0,subtree:!0}),Fe(),"complete"===document.readyState)Ye();else{async function t(){await Ae,Fe(),"complete"===document.readyState&&(Ye(),document.removeEventListener("readystatechange",t))}document.addEventListener("readystatechange",t)}}}));let Se,Oe=Ae,je=!0,Le=!0;async function Ce(e,t,r,i,n){if(a||(Le=!1),await Ae,await Oe,o&&await o(e,"string"!=typeof t?t:{},""),!a&&xe)return i?null:(await n,z(r?A(r):e,{errUrl:e||r}));const s=Be(e,t,null,r),c={};if(await $e(s,c),Se=void 0,Ue(s,c),await n,r&&!a&&!s.n){if(i)return;return m&&Ie(Object.keys(c)),await z(A(r),{errUrl:r})}je&&!a&&s.n&&i&&(h(),je=!1);const l=await z(a||s.n||!i?s.b:s.u,{errUrl:s.u});return s.s&&(await z(s.s)).u$_(l),m&&Ie(Object.keys(c)),l}function Ie(e){let t=0;const r=e.length,i=self.requestIdleCallback?self.requestIdleCallback:self.requestAnimationFrame;i((function n(){const s=100*t;if(!(s>r)){for(const t of e.slice(s,s+100)){const e=ve[t];e&&URL.revokeObjectURL(e.b)}t++,i(n)}}))}function Me(e){return`'${e.replace(/'/g,"\\'")}'`}function Ue(e,t){if(e.b||!t[e.u])return;t[e.u]=0;for(const r of e.d)Ue(r,t);const[r,i]=e.a,n=e.S;let s=x&&Se?`import '${Se}';`:"",a=0,o=0,c=[];function l(t){for(;c[c.length-1]<t;){const t=c.pop();s+=`${n.slice(a,t)}, ${Me(e.r)}`,a=t}s+=n.slice(a,t),a=t}for(const{s:t,ss:i,se:u,d}of r)if(-1===d){let r=e.d[o++],i=r.b,c=!i;c&&((i=r.s)||(i=r.s=A(`export function u$_(m){${r.a[1].map((({s:e,e:t},i)=>{const n='"'===r.S[e]||"'"===r.S[e];return`e$_${i}=m${n?"[":"."}${r.S.slice(e,t)}${n?"]":""}`})).join(",")}}${r.a[1].length?`let ${r.a[1].map(((e,t)=>`e$_${t}`)).join(",")};`:""}export {${r.a[1].map((({s:e,e:t},i)=>`e$_${i} as ${r.S.slice(e,t)}`)).join(",")}}\n//# sourceURL=${r.r}?cycle`))),l(t-1),s+=`/*${n.slice(t-1,u)}*/${Me(i)}`,!c&&r.s&&(s+=`;import*as m$_${o} from'${r.b}';import{u$_ as u$_${o}}from'${r.s}';u$_${o}(m$_${o})`,r.s=void 0),a=u}else-2===d?(e.m={url:e.r,resolve:ye},f(e.m,e.u),l(t),s+=`importShim._r[${Me(e.u)}].m`,a=u):(l(i+6),s+="Shim(",c.push(u-1),a=t);function u(t,r){const i=r+t.length,o=n.indexOf("\n",i),c=-1!==o?o:n.length;l(i),s+=new URL(n.slice(i,c),e.r).href,a=c}e.s&&(s+=`\n;import{u$_}from'${e.s}';try{u$_({${i.filter((e=>e.ln)).map((({s:e,e:t,ln:r})=>`${n.slice(e,t)}:${r}`)).join(",")}})}catch(_){};\n`);let d=n.lastIndexOf(Pe),p=n.lastIndexOf(_e);d<a&&(d=-1),p<a&&(p=-1),-1!==d&&(-1===p||p>d)&&u(Pe,d),-1!==p&&(u(_e,p),-1!==d&&d>p&&u(Pe,d)),l(n.length),-1===d&&(s+=Pe+e.r),e.b=Se=A(s),e.S=void 0}const Pe="\n//# sourceURL=",_e="\n//# sourceMappingURL=",Ne=/^(text|application)\/(x-)?javascript(;|$)/,Re=/^(application)\/wasm(;|$)/,qe=/^(text|application)\/json(;|$)/,Te=/^(text|application)\/css(;|$)/,He=/url\(\s*(?:(["'])((?:\\.|[^\n\\"'])+)\1|((?:\\.|[^\s,"'()\\])+))\s*\)/g;let ze=[],Je=0;async function De(e,t,r){if(k&&!t.integrity)throw Error(`No integrity for ${e}${L(r)}.`);const i=function(){if(++Je>100)return new Promise((e=>ze.push(e)))}();i&&await i;try{var n=await l(e,t)}catch(t){throw t.message=`Unable to fetch ${e}${L(r)} - see network log for details.\n`+t.message,t}finally{Je--,ze.length&&ze.shift()()}if(!n.ok){const e=new TypeError(`${n.status} ${n.statusText} ${n.url}${L(r)}`);throw e.response=n,e}return n}async function We(e,t,r){const i=await De(e,t,r),n=i.headers.get("content-type");if(Ne.test(n))return{r:i.url,s:await i.text(),t:"js"};if(Re.test(n)){const t=be._w[e]=await WebAssembly.compileStreaming(i);let r="",n=0,s="";for(const e of WebAssembly.Module.imports(t))r+=`import * as impt${n} from '${e.module}';\n`,s+=`'${e.module}':impt${n++},`;n=0,r+=`const instance = await WebAssembly.instantiate(importShim._w['${e}'], {${s}});\n`;for(const e of WebAssembly.Module.exports(t))r+=`export const ${e.name} = instance.exports['${e.name}'];\n`;return{r:i.url,s:r,t:"wasm"}}if(qe.test(n))return{r:i.url,s:`export default ${await i.text()}`,t:"json"};if(Te.test(n))return{r:i.url,s:`var s=new CSSStyleSheet();s.replaceSync(${JSON.stringify((await i.text()).replace(He,((t,r="",i,n)=>`url(${r}${U(i||n,e)}${r})`)))});export default s;`,t:"css"};throw Error(`Unsupported Content-Type "${n}" loading ${e}${L(r)}. Modules must be served with a valid MIME type like application/javascript.`)}function Be(t,r,i,n){let s=ve[t];if(s&&!n)return s;if(s={u:t,r:n?t:void 0,f:void 0,S:void 0,L:void 0,a:void 0,d:void 0,b:void 0,s:void 0,n:!1,t:null,m:null},ve[t]){let e=0;for(;ve[s.u+ ++e];);s.u+=e}return ve[s.u]=s,s.f=(async()=>{if(!n){let e;if(({r:s.r,s:n,t:e}=await(it[t]||We(t,r,i))),e&&!a){if("css"===e&&!y||"json"===e&&!v||"wasm"===e&&!$)throw Error(`${e}-modules require <script type="esms-options">{ "polyfillEnable": ["${e}-modules"] }<\/script>`);("css"===e&&!W||"json"===e&&!D||"wasm"===e&&!G)&&(s.n=!0)}}try{s.a=function(t,r="@"){ae=t,oe=r;const i=2*ae.length+(2<<18);if(i>ie||!Z){for(;i>ie;)ie*=2;ee=new ArrayBuffer(ie),ne(se,new Uint16Array(ee,16,105)),Z=function(e,t,r){"use asm";var i=new e.Int8Array(r),n=new e.Int16Array(r),s=new e.Int32Array(r),a=new e.Uint8Array(r),o=new e.Uint16Array(r),c=1024;function l(){var e=0,t=0,r=0,a=0,l=0,d=0;d=c;c=c+10240|0;i[796]=1;i[795]=0;n[395]=0;n[396]=0;s[67]=s[2];i[797]=0;s[66]=0;i[794]=0;s[68]=d+2048;s[69]=d;i[798]=0;e=(s[3]|0)+-2|0;s[70]=e;t=e+(s[64]<<1)|0;s[71]=t;e:while(1){r=e+2|0;s[70]=r;if(e>>>0>=t>>>0){l=18;break}t:do{switch(n[r>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if((((n[396]|0)==0?T(r)|0:0)?(x(e+4|0,16,10)|0)==0:0)?(f(),(i[796]|0)==0):0){l=9;break e}else l=17;break}case 105:{if(T(r)|0?(x(e+4|0,26,10)|0)==0:0){u();l=17}else l=17;break}case 59:{l=17;break}case 47:switch(n[e+4>>1]|0){case 47:{U();break t}case 42:{$(1);break t}default:{l=16;break e}}default:{l=16;break e}}}while(0);if((l|0)==17){l=0;s[67]=s[70]}e=s[70]|0;t=s[71]|0}if((l|0)==9){e=s[70]|0;s[67]=e;l=19}else if((l|0)==16){i[796]=0;s[70]=e;l=19}else if((l|0)==18)if(!(i[794]|0)){e=r;l=19}else e=0;do{if((l|0)==19){e:while(1){t=e+2|0;s[70]=t;if(e>>>0>=(s[71]|0)>>>0){l=82;break}t:do{switch(n[t>>1]|0){case 9:case 10:case 11:case 12:case 13:case 32:break;case 101:{if(((n[396]|0)==0?T(t)|0:0)?(x(e+4|0,16,10)|0)==0:0){f();l=81}else l=81;break}case 105:{if(T(t)|0?(x(e+4|0,26,10)|0)==0:0){u();l=81}else l=81;break}case 99:{if((T(t)|0?(x(e+4|0,36,8)|0)==0:0)?G(n[e+12>>1]|0)|0:0){i[798]=1;l=81}else l=81;break}case 40:{a=s[68]|0;t=n[396]|0;l=t&65535;s[a+(l<<3)>>2]=1;r=s[67]|0;n[396]=t+1<<16>>16;s[a+(l<<3)+4>>2]=r;l=81;break}case 41:{t=n[396]|0;if(!(t<<16>>16)){l=36;break e}l=t+-1<<16>>16;n[396]=l;a=n[395]|0;t=a&65535;if(a<<16>>16!=0?(s[(s[68]|0)+((l&65535)<<3)>>2]|0)==5:0){t=s[(s[69]|0)+(t+-1<<2)>>2]|0;r=t+4|0;if(!(s[r>>2]|0))s[r>>2]=(s[67]|0)+2;s[t+12>>2]=e+4;n[395]=a+-1<<16>>16;l=81}else l=81;break}case 123:{l=s[67]|0;a=s[61]|0;e=l;do{if((n[l>>1]|0)==41&(a|0)!=0?(s[a+4>>2]|0)==(l|0):0){t=s[62]|0;s[61]=t;if(!t){s[57]=0;break}else{s[t+28>>2]=0;break}}}while(0);a=s[68]|0;r=n[396]|0;l=r&65535;s[a+(l<<3)>>2]=(i[798]|0)==0?2:6;n[396]=r+1<<16>>16;s[a+(l<<3)+4>>2]=e;i[798]=0;l=81;break}case 125:{e=n[396]|0;if(!(e<<16>>16)){l=49;break e}a=s[68]|0;l=e+-1<<16>>16;n[396]=l;if((s[a+((l&65535)<<3)>>2]|0)==4){h();l=81}else l=81;break}case 39:{b(39);l=81;break}case 34:{b(34);l=81;break}case 47:switch(n[e+4>>1]|0){case 47:{U();break t}case 42:{$(1);break t}default:{e=s[67]|0;a=n[e>>1]|0;r:do{if(!(A(a)|0)){switch(a<<16>>16){case 41:if(N(s[(s[68]|0)+(o[396]<<3)+4>>2]|0)|0){l=69;break r}else{l=66;break r}case 125:break;default:{l=66;break r}}t=s[68]|0;r=o[396]|0;if(!(v(s[t+(r<<3)+4>>2]|0)|0)?(s[t+(r<<3)>>2]|0)!=6:0)l=66;else l=69}else switch(a<<16>>16){case 46:if(((n[e+-2>>1]|0)+-48&65535)<10){l=66;break r}else{l=69;break r}case 43:if((n[e+-2>>1]|0)==43){l=66;break r}else{l=69;break r}case 45:if((n[e+-2>>1]|0)==45){l=66;break r}else{l=69;break r}default:{l=69;break r}}}while(0);r:do{if((l|0)==66){l=0;if(!(p(e)|0)){switch(a<<16>>16){case 0:{l=69;break r}case 47:{if(i[797]|0){l=69;break r}break}default:{}}r=s[3]|0;t=a;do{if(e>>>0<=r>>>0)break;e=e+-2|0;s[67]=e;t=n[e>>1]|0}while(!(M(t)|0));if(R(t)|0){do{if(e>>>0<=r>>>0)break;e=e+-2|0;s[67]=e}while(R(n[e>>1]|0)|0);if(C(e)|0){y();i[797]=0;l=81;break t}else e=1}else e=1}else l=69}}while(0);if((l|0)==69){y();e=0}i[797]=e;l=81;break t}}case 96:{a=s[68]|0;r=n[396]|0;l=r&65535;s[a+(l<<3)+4>>2]=s[67];n[396]=r+1<<16>>16;s[a+(l<<3)>>2]=3;h();l=81;break}default:l=81}}while(0);if((l|0)==81){l=0;s[67]=s[70]}e=s[70]|0}if((l|0)==36){K();e=0;break}else if((l|0)==49){K();e=0;break}else if((l|0)==82){e=(i[794]|0)==0?(n[395]|n[396])<<16>>16==0:0;break}}}while(0);c=d;return e|0}function f(){var e=0,t=0,r=0,a=0,o=0,c=0,l=0,f=0,u=0,p=0,h=0,k=0,g=0,y=0;f=s[70]|0;u=s[63]|0;y=f+12|0;s[70]=y;r=m(1)|0;e=s[70]|0;if(!((e|0)==(y|0)?!(E(r)|0):0))g=3;e:do{if((g|0)==3){t:do{switch(r<<16>>16){case 123:{s[70]=e+2;e=m(1)|0;t=s[70]|0;while(1){if(Q(e)|0){b(e);e=(s[70]|0)+2|0;s[70]=e}else{P(e)|0;e=s[70]|0}m(1)|0;e=w(t,e)|0;if(e<<16>>16==44){s[70]=(s[70]|0)+2;e=m(1)|0}if(e<<16>>16==125){g=15;break}y=t;t=s[70]|0;if((t|0)==(y|0)){g=12;break}if(t>>>0>(s[71]|0)>>>0){g=14;break}}if((g|0)==12){K();break e}else if((g|0)==14){K();break e}else if((g|0)==15){i[795]=1;s[70]=(s[70]|0)+2;break t}break}case 42:{s[70]=e+2;m(1)|0;y=s[70]|0;w(y,y)|0;break}default:{i[796]=0;switch(r<<16>>16){case 100:{f=e+14|0;s[70]=f;switch((m(1)|0)<<16>>16){case 97:{t=s[70]|0;if((x(t+2|0,56,8)|0)==0?(o=t+10|0,R(n[o>>1]|0)|0):0){s[70]=o;m(0)|0;g=22}break}case 102:{g=22;break}case 99:{t=s[70]|0;if(((x(t+2|0,36,8)|0)==0?(a=t+10|0,y=n[a>>1]|0,G(y)|0|y<<16>>16==123):0)?(s[70]=a,c=m(1)|0,c<<16>>16!=123):0){k=c;g=31}break}default:{}}r:do{if((g|0)==22?(l=s[70]|0,(x(l+2|0,64,14)|0)==0):0){r=l+16|0;t=n[r>>1]|0;if(!(G(t)|0))switch(t<<16>>16){case 40:case 42:break;default:break r}s[70]=r;t=m(1)|0;if(t<<16>>16==42){s[70]=(s[70]|0)+2;t=m(1)|0}if(t<<16>>16!=40){k=t;g=31}}}while(0);if((g|0)==31?(p=s[70]|0,P(k)|0,h=s[70]|0,h>>>0>p>>>0):0){j(e,f,p,h);s[70]=(s[70]|0)+-2;break e}j(e,f,0,0);s[70]=e+12;break e}case 97:{s[70]=e+10;m(0)|0;e=s[70]|0;g=35;break}case 102:{g=35;break}case 99:{if((x(e+2|0,36,8)|0)==0?(t=e+10|0,M(n[t>>1]|0)|0):0){s[70]=t;y=m(1)|0;g=s[70]|0;P(y)|0;y=s[70]|0;j(g,y,g,y);s[70]=(s[70]|0)+-2;break e}e=e+4|0;s[70]=e;break}case 108:case 118:break;default:break e}if((g|0)==35){s[70]=e+16;e=m(1)|0;if(e<<16>>16==42){s[70]=(s[70]|0)+2;e=m(1)|0}g=s[70]|0;P(e)|0;y=s[70]|0;j(g,y,g,y);s[70]=(s[70]|0)+-2;break e}s[70]=e+6;i[796]=0;r=m(1)|0;e=s[70]|0;r=(P(r)|0|32)<<16>>16==123;a=s[70]|0;if(r){s[70]=a+2;y=m(1)|0;e=s[70]|0;P(y)|0}r:while(1){t=s[70]|0;if((t|0)==(e|0))break;j(e,t,e,t);t=m(1)|0;if(r)switch(t<<16>>16){case 93:case 125:break e;default:{}}e=s[70]|0;if(t<<16>>16!=44){g=51;break}s[70]=e+2;t=m(1)|0;e=s[70]|0;switch(t<<16>>16){case 91:case 123:{g=51;break r}default:{}}P(t)|0}if((g|0)==51)s[70]=e+-2;if(!r)break e;s[70]=a+-2;break e}}}while(0);y=(m(1)|0)<<16>>16==102;e=s[70]|0;if(y?(x(e+2|0,50,6)|0)==0:0){s[70]=e+8;d(f,m(1)|0);e=(u|0)==0?232:u+16|0;while(1){e=s[e>>2]|0;if(!e)break e;s[e+12>>2]=0;s[e+8>>2]=0;e=e+16|0}}s[70]=e+-2}}while(0);return}function u(){var e=0,t=0,r=0,a=0,o=0,c=0;o=s[70]|0;e=o+12|0;s[70]=e;e:do{switch((m(1)|0)<<16>>16){case 40:{t=s[68]|0;c=n[396]|0;r=c&65535;s[t+(r<<3)>>2]=5;e=s[70]|0;n[396]=c+1<<16>>16;s[t+(r<<3)+4>>2]=e;if((n[s[67]>>1]|0)!=46){s[70]=e+2;c=m(1)|0;k(o,s[70]|0,0,e);t=s[61]|0;r=s[69]|0;o=n[395]|0;n[395]=o+1<<16>>16;s[r+((o&65535)<<2)>>2]=t;switch(c<<16>>16){case 39:{b(39);break}case 34:{b(34);break}default:{s[70]=(s[70]|0)+-2;break e}}e=(s[70]|0)+2|0;s[70]=e;switch((m(1)|0)<<16>>16){case 44:{s[70]=(s[70]|0)+2;m(1)|0;o=s[61]|0;s[o+4>>2]=e;c=s[70]|0;s[o+16>>2]=c;i[o+24>>0]=1;s[70]=c+-2;break e}case 41:{n[396]=(n[396]|0)+-1<<16>>16;c=s[61]|0;s[c+4>>2]=e;s[c+12>>2]=(s[70]|0)+2;i[c+24>>0]=1;n[395]=(n[395]|0)+-1<<16>>16;break e}default:{s[70]=(s[70]|0)+-2;break e}}}break}case 46:{s[70]=(s[70]|0)+2;if((m(1)|0)<<16>>16==109?(t=s[70]|0,(x(t+2|0,44,6)|0)==0):0){e=s[67]|0;if(!(q(e)|0)?(n[e>>1]|0)==46:0)break e;k(o,o,t+8|0,2)}break}case 42:case 39:case 34:{a=18;break}case 123:{e=s[70]|0;if(n[396]|0){s[70]=e+-2;break e}while(1){if(e>>>0>=(s[71]|0)>>>0)break;e=m(1)|0;if(!(Q(e)|0)){if(e<<16>>16==125){a=33;break}}else b(e);e=(s[70]|0)+2|0;s[70]=e}if((a|0)==33)s[70]=(s[70]|0)+2;c=(m(1)|0)<<16>>16==102;e=s[70]|0;if(c?x(e+2|0,50,6)|0:0){K();break e}s[70]=e+8;e=m(1)|0;if(Q(e)|0){d(o,e);break e}else{K();break e}}default:if((s[70]|0)==(e|0))s[70]=o+10;else a=18}}while(0);do{if((a|0)==18){if(n[396]|0){s[70]=(s[70]|0)+-2;break}e=s[71]|0;t=s[70]|0;while(1){if(t>>>0>=e>>>0){a=25;break}r=n[t>>1]|0;if(Q(r)|0){a=23;break}c=t+2|0;s[70]=c;t=c}if((a|0)==23){d(o,r);break}else if((a|0)==25){K();break}}}while(0);return}function d(e,t){e=e|0;t=t|0;var r=0,i=0;r=(s[70]|0)+2|0;switch(t<<16>>16){case 39:{b(39);i=5;break}case 34:{b(34);i=5;break}default:K()}do{if((i|0)==5){k(e,r,s[70]|0,1);s[70]=(s[70]|0)+2;t=m(0)|0;e=t<<16>>16==97;if(e){r=s[70]|0;if(x(r+2|0,78,10)|0)i=11}else{r=s[70]|0;if(!(((t<<16>>16==119?(n[r+2>>1]|0)==105:0)?(n[r+4>>1]|0)==116:0)?(n[r+6>>1]|0)==104:0))i=11}if((i|0)==11){s[70]=r+-2;break}s[70]=r+((e?6:4)<<1);if((m(1)|0)<<16>>16!=123){s[70]=r;break}e=s[70]|0;t=e;e:while(1){s[70]=t+2;t=m(1)|0;switch(t<<16>>16){case 39:{b(39);s[70]=(s[70]|0)+2;t=m(1)|0;break}case 34:{b(34);s[70]=(s[70]|0)+2;t=m(1)|0;break}default:t=P(t)|0}if(t<<16>>16!=58){i=20;break}s[70]=(s[70]|0)+2;switch((m(1)|0)<<16>>16){case 39:{b(39);break}case 34:{b(34);break}default:{i=24;break e}}s[70]=(s[70]|0)+2;switch((m(1)|0)<<16>>16){case 125:{i=29;break e}case 44:break;default:{i=28;break e}}s[70]=(s[70]|0)+2;if((m(1)|0)<<16>>16==125){i=29;break}t=s[70]|0}if((i|0)==20){s[70]=r;break}else if((i|0)==24){s[70]=r;break}else if((i|0)==28){s[70]=r;break}else if((i|0)==29){i=s[61]|0;s[i+16>>2]=e;s[i+12>>2]=(s[70]|0)+2;break}}}while(0);return}function p(e){e=e|0;e:do{switch(n[e>>1]|0){case 100:switch(n[e+-2>>1]|0){case 105:{e=L(e+-4|0,88,2)|0;break e}case 108:{e=L(e+-4|0,92,3)|0;break e}default:{e=0;break e}}case 101:switch(n[e+-2>>1]|0){case 115:switch(n[e+-4>>1]|0){case 108:{e=I(e+-6|0,101)|0;break e}case 97:{e=I(e+-6|0,99)|0;break e}default:{e=0;break e}}case 116:{e=L(e+-4|0,98,4)|0;break e}case 117:{e=L(e+-4|0,106,6)|0;break e}default:{e=0;break e}}case 102:{if((n[e+-2>>1]|0)==111?(n[e+-4>>1]|0)==101:0)switch(n[e+-6>>1]|0){case 99:{e=L(e+-8|0,118,6)|0;break e}case 112:{e=L(e+-8|0,130,2)|0;break e}default:{e=0;break e}}else e=0;break}case 107:{e=L(e+-2|0,134,4)|0;break}case 110:{e=e+-2|0;if(I(e,105)|0)e=1;else e=L(e,142,5)|0;break}case 111:{e=I(e+-2|0,100)|0;break}case 114:{e=L(e+-2|0,152,7)|0;break}case 116:{e=L(e+-2|0,166,4)|0;break}case 119:switch(n[e+-2>>1]|0){case 101:{e=I(e+-4|0,110)|0;break e}case 111:{e=L(e+-4|0,174,3)|0;break e}default:{e=0;break e}}default:e=0}}while(0);return e|0}function h(){var e=0,t=0,r=0,i=0;t=s[71]|0;r=s[70]|0;e:while(1){e=r+2|0;if(r>>>0>=t>>>0){t=10;break}switch(n[e>>1]|0){case 96:{t=7;break e}case 36:{if((n[r+4>>1]|0)==123){t=6;break e}break}case 92:{e=r+4|0;break}default:{}}r=e}if((t|0)==6){e=r+4|0;s[70]=e;t=s[68]|0;i=n[396]|0;r=i&65535;s[t+(r<<3)>>2]=4;n[396]=i+1<<16>>16;s[t+(r<<3)+4>>2]=e}else if((t|0)==7){s[70]=e;r=s[68]|0;i=(n[396]|0)+-1<<16>>16;n[396]=i;if((s[r+((i&65535)<<3)>>2]|0)!=3)K()}else if((t|0)==10){s[70]=e;K()}return}function m(e){e=e|0;var t=0,r=0,i=0;r=s[70]|0;e:do{t=n[r>>1]|0;t:do{if(t<<16>>16!=47)if(e)if(G(t)|0)break;else break e;else if(R(t)|0)break;else break e;else switch(n[r+2>>1]|0){case 47:{U();break t}case 42:{$(e);break t}default:{t=47;break e}}}while(0);i=s[70]|0;r=i+2|0;s[70]=r}while(i>>>0<(s[71]|0)>>>0);return t|0}function b(e){e=e|0;var t=0,r=0,i=0,a=0;a=s[71]|0;t=s[70]|0;while(1){i=t+2|0;if(t>>>0>=a>>>0){t=9;break}r=n[i>>1]|0;if(r<<16>>16==e<<16>>16){t=10;break}if(r<<16>>16==92){r=t+4|0;if((n[r>>1]|0)==13){t=t+6|0;t=(n[t>>1]|0)==10?t:r}else t=r}else if(Y(r)|0){t=9;break}else t=i}if((t|0)==9){s[70]=i;K()}else if((t|0)==10)s[70]=i;return}function k(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var a=0,o=0;a=s[65]|0;s[65]=a+32;o=s[61]|0;s[((o|0)==0?228:o+28|0)>>2]=a;s[62]=o;s[61]=a;s[a+8>>2]=e;if(2==(n|0))e=r;else e=1==(n|0)?r+2|0:0;s[a+12>>2]=e;s[a>>2]=t;s[a+4>>2]=r;s[a+16>>2]=0;s[a+20>>2]=n;o=1==(n|0);i[a+24>>0]=o&1;s[a+28>>2]=0;if(o|2==(n|0))i[795]=1;return}function w(e,t){e=e|0;t=t|0;var r=0,i=0,a=0,o=0;r=s[70]|0;i=n[r>>1]|0;o=(e|0)==(t|0);a=o?0:e;o=o?0:t;if(i<<16>>16==97){s[70]=r+4;r=m(1)|0;e=s[70]|0;if(Q(r)|0){b(r);t=(s[70]|0)+2|0;s[70]=t}else{P(r)|0;t=s[70]|0}i=m(1)|0;r=s[70]|0}if((r|0)!=(e|0))j(e,t,a,o);return i|0}function g(){var e=0,t=0,r=0;r=s[71]|0;t=s[70]|0;e:while(1){e=t+2|0;if(t>>>0>=r>>>0){t=6;break}switch(n[e>>1]|0){case 13:case 10:{t=6;break e}case 93:{t=7;break e}case 92:{e=t+4|0;break}default:{}}t=e}if((t|0)==6){s[70]=e;K();e=0}else if((t|0)==7){s[70]=e;e=93}return e|0}function y(){var e=0,t=0,r=0;e:while(1){e=s[70]|0;t=e+2|0;s[70]=t;if(e>>>0>=(s[71]|0)>>>0){r=7;break}switch(n[t>>1]|0){case 13:case 10:{r=7;break e}case 47:break e;case 91:{g()|0;break}case 92:{s[70]=e+4;break}default:{}}}if((r|0)==7)K();return}function v(e){e=e|0;switch(n[e>>1]|0){case 62:{e=(n[e+-2>>1]|0)==61;break}case 41:case 59:{e=1;break}case 104:{e=L(e+-2|0,200,4)|0;break}case 121:{e=L(e+-2|0,208,6)|0;break}case 101:{e=L(e+-2|0,220,3)|0;break}default:e=0}return e|0}function $(e){e=e|0;var t=0,r=0,i=0,a=0,o=0;a=(s[70]|0)+2|0;s[70]=a;r=s[71]|0;while(1){t=a+2|0;if(a>>>0>=r>>>0)break;i=n[t>>1]|0;if(!e?Y(i)|0:0)break;if(i<<16>>16==42?(n[a+4>>1]|0)==47:0){o=8;break}a=t}if((o|0)==8){s[70]=t;t=a+4|0}s[70]=t;return}function x(e,t,r){e=e|0;t=t|0;r=r|0;var n=0,s=0;e:do{if(!r)e=0;else{while(1){n=i[e>>0]|0;s=i[t>>0]|0;if(n<<24>>24!=s<<24>>24)break;r=r+-1|0;if(!r){e=0;break e}else{e=e+1|0;t=t+1|0}}e=(n&255)-(s&255)|0}}while(0);return e|0}function E(e){e=e|0;e:do{switch(e<<16>>16){case 38:case 37:case 33:{e=1;break}default:if((e&-8)<<16>>16==40|(e+-58&65535)<6)e=1;else{switch(e<<16>>16){case 91:case 93:case 94:{e=1;break e}default:{}}e=(e+-123&65535)<4}}}while(0);return e|0}function A(e){e=e|0;e:do{switch(e<<16>>16){case 38:case 37:case 33:break;default:if(!((e+-58&65535)<6|(e+-40&65535)<7&e<<16>>16!=41)){switch(e<<16>>16){case 91:case 94:break e;default:{}}return e<<16>>16!=125&(e+-123&65535)<4|0}}}while(0);return 1}function S(e){e=e|0;var t=0;t=n[e>>1]|0;e:do{if((t+-9&65535)>=5){switch(t<<16>>16){case 160:case 32:{t=1;break e}default:{}}if(E(t)|0)return t<<16>>16!=46|(q(e)|0)|0;else t=0}else t=1}while(0);return t|0}function O(e){e=e|0;var t=0,r=0,i=0,a=0;r=c;c=c+16|0;i=r;s[i>>2]=0;s[64]=e;t=s[3]|0;a=t+(e<<1)|0;e=a+2|0;n[a>>1]=0;s[i>>2]=e;s[65]=e;s[57]=0;s[61]=0;s[59]=0;s[58]=0;s[63]=0;s[60]=0;c=r;return t|0}function j(e,t,r,n){e=e|0;t=t|0;r=r|0;n=n|0;var a=0,o=0;a=s[65]|0;s[65]=a+20;o=s[63]|0;s[((o|0)==0?232:o+16|0)>>2]=a;s[63]=a;s[a>>2]=e;s[a+4>>2]=t;s[a+8>>2]=r;s[a+12>>2]=n;s[a+16>>2]=0;i[795]=1;return}function L(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+(0-r<<1)|0;n=i+2|0;e=s[3]|0;if(n>>>0>=e>>>0?(x(n,t,r<<1)|0)==0:0)if((n|0)==(e|0))e=1;else e=S(i)|0;else e=0;return e|0}function C(e){e=e|0;switch(n[e>>1]|0){case 107:{e=L(e+-2|0,134,4)|0;break}case 101:{if((n[e+-2>>1]|0)==117)e=L(e+-4|0,106,6)|0;else e=0;break}default:e=0}return e|0}function I(e,t){e=e|0;t=t|0;var r=0;r=s[3]|0;if(r>>>0<=e>>>0?(n[e>>1]|0)==t<<16>>16:0)if((r|0)==(e|0))r=1;else r=M(n[e+-2>>1]|0)|0;else r=0;return r|0}function M(e){e=e|0;e:do{if((e+-9&65535)<5)e=1;else{switch(e<<16>>16){case 32:case 160:{e=1;break e}default:{}}e=e<<16>>16!=46&(E(e)|0)}}while(0);return e|0}function U(){var e=0,t=0,r=0;e=s[71]|0;r=s[70]|0;e:while(1){t=r+2|0;if(r>>>0>=e>>>0)break;switch(n[t>>1]|0){case 13:case 10:break e;default:r=t}}s[70]=t;return}function P(e){e=e|0;while(1){if(G(e)|0)break;if(E(e)|0)break;e=(s[70]|0)+2|0;s[70]=e;e=n[e>>1]|0;if(!(e<<16>>16)){e=0;break}}return e|0}function _(){var e=0;e=s[(s[59]|0)+20>>2]|0;switch(e|0){case 1:{e=-1;break}case 2:{e=-2;break}default:e=e-(s[3]|0)>>1}return e|0}function N(e){e=e|0;if(!(L(e,180,5)|0)?!(L(e,190,3)|0):0)e=L(e,196,2)|0;else e=1;return e|0}function R(e){e=e|0;switch(e<<16>>16){case 160:case 32:case 12:case 11:case 9:{e=1;break}default:e=0}return e|0}function q(e){e=e|0;if((n[e>>1]|0)==46?(n[e+-2>>1]|0)==46:0)e=(n[e+-4>>1]|0)==46;else e=0;return e|0}function T(e){e=e|0;if((s[3]|0)==(e|0))e=1;else e=S(e+-2|0)|0;return e|0}function H(){var e=0;e=s[(s[60]|0)+12>>2]|0;if(!e)e=-1;else e=e-(s[3]|0)>>1;return e|0}function z(){var e=0;e=s[(s[59]|0)+12>>2]|0;if(!e)e=-1;else e=e-(s[3]|0)>>1;return e|0}function J(){var e=0;e=s[(s[60]|0)+8>>2]|0;if(!e)e=-1;else e=e-(s[3]|0)>>1;return e|0}function D(){var e=0;e=s[(s[59]|0)+16>>2]|0;if(!e)e=-1;else e=e-(s[3]|0)>>1;return e|0}function W(){var e=0;e=s[(s[59]|0)+4>>2]|0;if(!e)e=-1;else e=e-(s[3]|0)>>1;return e|0}function B(){var e=0;e=s[59]|0;e=s[((e|0)==0?228:e+28|0)>>2]|0;s[59]=e;return(e|0)!=0|0}function F(){var e=0;e=s[60]|0;e=s[((e|0)==0?232:e+16|0)>>2]|0;s[60]=e;return(e|0)!=0|0}function K(){i[794]=1;s[66]=(s[70]|0)-(s[3]|0)>>1;s[70]=(s[71]|0)+2;return}function G(e){e=e|0;return(e|128)<<16>>16==160|(e+-9&65535)<5|0}function Q(e){e=e|0;return e<<16>>16==39|e<<16>>16==34|0}function V(){return(s[(s[59]|0)+8>>2]|0)-(s[3]|0)>>1|0}function X(){return(s[(s[60]|0)+4>>2]|0)-(s[3]|0)>>1|0}function Y(e){e=e|0;return e<<16>>16==13|e<<16>>16==10|0}function Z(){return(s[s[59]>>2]|0)-(s[3]|0)>>1|0}function ee(){return(s[s[60]>>2]|0)-(s[3]|0)>>1|0}function te(){return a[(s[59]|0)+24>>0]|0|0}function re(e){e=e|0;s[3]=e;return}function ie(){return(i[795]|0)!=0|0}function ne(){return(i[796]|0)!=0|0}function se(){return s[66]|0}function ae(e){e=e|0;c=e+992+15&-16;return 992}return{su:ae,ai:D,e:se,ee:X,ele:H,els:J,es:ee,f:ne,id:_,ie:W,ip:te,is:Z,ms:ie,p:l,re:F,ri:B,sa:O,se:z,ses:re,ss:V}}("undefined"!=typeof self?self:e,0,ee),te=Z.su(ie-(2<<17))}const n=ae.length+1;Z.ses(te),Z.sa(n-1),ne(ae,new Uint16Array(ee,te,n)),Z.p()||(ce=Z.e(),pe());const s=[],a=[];for(;Z.ri();){const e=Z.is(),t=Z.ie(),r=Z.ai(),i=Z.id(),n=Z.ss(),a=Z.se();let o;Z.ip()&&(o=le(-1===i?e:e+1,ae.charCodeAt(-1===i?e-1:e))),s.push({n:o,s:e,e:t,ss:n,se:a,d:i,a:r})}for(;Z.re();){const e=Z.es(),t=Z.ee(),r=Z.els(),i=Z.ele(),n=ae.charCodeAt(e),s=r>=0?ae.charCodeAt(r):-1;a.push({s:e,e:t,ls:r,le:i,n:34===n||39===n?le(e+1,n):ae.slice(e,t),ln:r<0?void 0:34===s||39===s?le(r+1,s):ae.slice(r,i)})}return[s,a,!!Z.f(),!!Z.ms()]}(n,s.u)}catch(e){j(e),s.a=[[],[],!1]}return s.S=n,s})(),s.L=s.f.then((async()=>{let e=r;s.d=(await Promise.all(s.a[0].map((async({n:t,d:r})=>{if((r>=0&&!H||-2===r&&!K)&&(s.n=!0),-1!==r||!t)return;const{r:i,b:n}=await me(t,s.r||s.u);return!n||F&&!C||(s.n=!0),-1===r?S&&S(i)?{b:i}:(e.integrity&&(e=Object.assign({},e,{integrity:void 0})),Be(i,e,s.r).f):void 0})))).filter((e=>e))})),s}function Fe(e=!1){if(!e)for(const e of document.querySelectorAll(a?"link[rel=modulepreload-shim]":"link[rel=modulepreload]"))nt(e);for(const e of document.querySelectorAll(a?"script[type=importmap-shim]":"script[type=importmap]"))tt(e);if(!e)for(const e of document.querySelectorAll(a?"script[type=module-shim]":"script[type=module]"))rt(e)}function Ke(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.fetchPriority&&(t.priority=e.fetchPriority),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}let Ge=Promise.resolve(),Qe=1;function Ve(){0!=--Qe||b||!a&&xe||document.dispatchEvent(new Event("DOMContentLoaded"))}r&&document.addEventListener("DOMContentLoaded",(async()=>{await Ae,Ve()}));let Xe=1;function Ye(){0!=--Xe||b||!a&&xe||document.dispatchEvent(new Event("readystatechange"))}const Ze=e=>e.nextSibling||e.parentNode&&Ze(e.parentNode),et=(e,t)=>e.ep||!t&&(!e.src&&!e.innerHTML||!Ze(e))||null!==e.getAttribute("noshim")||!(e.ep=!0);function tt(e,t=Xe>0){if(!et(e,t)){if(e.src){if(!a)return;C=!0}Le&&(Oe=Oe.then((async()=>{Ee=_(e.src?await(await De(e.src,Ke(e))).json():JSON.parse(e.innerHTML),e.src||E,Ee)})).catch((t=>{console.log(t),t instanceof SyntaxError&&(t=new Error(`Unable to parse import map ${t.message} in: ${e.src||e.innerHTML}`)),j(t)})),a||(Le=!1))}}function rt(e,t=Xe>0){if(et(e,t))return;const r=null===e.getAttribute("async")&&Xe>0,i=Qe>0;r&&Xe++,i&&Qe++;const n=Ce(e.src||E,Ke(e),!e.src&&e.innerHTML,!a,r&&Ge).then((()=>{a&&e.dispatchEvent(new Event("load"))})).catch(j);r&&(Ge=n.then(Ye)),i&&n.then(Ve)}const it={};function nt(e){e.ep||(e.ep=!0,it[e.href]||(it[e.href]=We(e.href,Ke(e))))}}();const r=window.parent,i=new class{sendMessage;seqNum=0;methods={};pending={};initPromise;resolveInit;initialized=!1;constructor(e){this.sendMessage=e,this.resolveInit=()=>{},this.initPromise=new Promise((e=>{this.resolveInit=e}))}register(e){if(this.initialized)throw new Error("RPC methods already registered");this.methods={...e};const t=setInterval((()=>{this.sendMessage({kind:"initialize"})}),50),r=this.resolveInit;this.resolveInit=()=>{clearInterval(t),r()},this.initialized=!0}messageReceived(e){if(e.kind)return void("initialize"===e.kind?this.sendMessage({kind:"initialized"}):"initialized"===e.kind&&this.initialized&&this.resolveInit());const{seqNum:r,name:i,args:n,result:s,exception:a}=e;void 0!==r&&(void 0===i?(void 0!==a?this.pending[r].reject(a):this.pending[r].resolve(s),delete this.pending[r]):this.initPromise.then((async()=>{try{const e=this.methods[i];if(void 0===e)throw new Error(`unknown RPC method ${i}`);this.sendMessage({seqNum:r,result:await e(...n)})}catch(e){this.sendMessage({seqNum:r,exception:t(e)})}})))}async invoke(e,t){await this.initPromise,this.seqNum+=1;const r=this.seqNum;return new Promise(((i,n)=>{this.pending[r]={resolve:i,reject:n},this.sendMessage({seqNum:r,name:e,args:t})}))}getApi(){return new Proxy({},{get:(e,t)=>(...e)=>this.invoke(t,e)})}}((e=>r.postMessage(JSON.stringify(e))));window.addEventListener("message",(e=>{i.messageReceived(JSON.parse(e.data))}));const n=i.getApi(),s=document.querySelector("#react_root");if(s){const e={"@leanprover/infoview":"/infoview/index.production.min.js",react:"/infoview/react.production.min.js","react/jsx-runtime":"/infoview/react-jsx-runtime.production.min.js","react-dom":"/infoview/react-dom.production.min.js"};console.log(e),function(e,t){importShim.addImportMap({imports:e}),importShim("@leanprover/infoview").then((e=>{return r=e.renderInfoview(...t),i.register(r);var r})).catch((e=>console.error(`Error importing '@leanprover/infoview': ${JSON.stringify(e)}`)))}(e,[n,s])}})();
|