pyrepl-web 0.1.13 → 0.2.0
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 +75 -121
- package/dist/{chunk-7hjm8rrn.js → chunk-1qs0a4h5.js} +1 -1
- package/dist/{chunk-t9eg0wr0.js → chunk-az66snk4.js} +1 -1
- package/dist/{chunk-n46k5haq.js → chunk-b4v3wyq6.js} +2 -2
- package/dist/{chunk-3vjhr6cq.js → chunk-p8z2rk6s.js} +1 -1
- package/dist/chunk-q8xkh3ym.js +2 -0
- package/dist/{chunk-agmzdfvt.js → chunk-zvesc6aa.js} +1 -1
- package/dist/pyrepl.esm.js +96 -32
- package/package.json +2 -1
- package/dist/chunk-cmrefyz7.js +0 -2
package/README.md
CHANGED
|
@@ -6,167 +6,121 @@ An embeddable Python REPL, powered by Pyodide.
|
|
|
6
6
|
|
|
7
7
|
## Getting started
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Include the script and use the `<py-repl>` web component:
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<script src="https://cdn.jsdelivr.net/npm/pyrepl-web/dist/pyrepl.js"></script>
|
|
13
13
|
|
|
14
|
-
<
|
|
14
|
+
<py-repl></py-repl>
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
That's it! No install needed.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Features
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
- **Python 3.13** in the browser via WebAssembly (Pyodide)
|
|
22
|
+
- **Syntax highlighting** powered by Pygments
|
|
23
|
+
- **Tab completion** for modules, functions, and variables
|
|
24
|
+
- **Command history** with up/down arrows
|
|
25
|
+
- **Smart indentation** for multi-line code
|
|
26
|
+
- **Keyboard shortcuts**: Ctrl+L (clear), Ctrl+C (cancel)
|
|
27
|
+
- **PyPI packages**: preload popular libraries
|
|
28
|
+
- **Startup scripts**: run Python on load to set up the environment
|
|
29
|
+
- **Theming**: built-in dark/light themes or fully custom
|
|
22
30
|
|
|
23
|
-
|
|
24
|
-
<!-- Dark theme (default) -->
|
|
25
|
-
<div class="pyrepl" data-theme="catppuccin-mocha"></div>
|
|
26
|
-
|
|
27
|
-
<!-- Light theme -->
|
|
28
|
-
<div class="pyrepl" data-theme="catppuccin-latte"></div>
|
|
29
|
-
|
|
30
|
-
<!-- Preload packages -->
|
|
31
|
-
<div class="pyrepl" data-packages="numpy, pandas"></div>
|
|
32
|
-
|
|
33
|
-
<!-- Combined -->
|
|
34
|
-
<div class="pyrepl"
|
|
35
|
-
data-theme="catppuccin-latte"
|
|
36
|
-
data-packages="pydantic, requests">
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<!-- Load and run a Python script on startup -->
|
|
40
|
-
<div class="pyrepl" data-src="/scripts/demo.py"></div>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Supports...
|
|
44
|
-
|
|
45
|
-
- Python 3.13 running in the browser via WebAssembly
|
|
46
|
-
- Syntax highlighting with Pygments
|
|
47
|
-
- Tab completion
|
|
48
|
-
- Command history (up/down arrows)
|
|
49
|
-
- Smart indentation
|
|
50
|
-
- Keyboard shortcuts (Ctrl+L clear, Ctrl+C cancel)
|
|
51
|
-
- Preload PyPI packages
|
|
52
|
-
- Preload and run a Python script on startup
|
|
53
|
-
- Copy and clear buttons in the header
|
|
54
|
-
- Custom header title
|
|
55
|
-
- Multiple color themes (Catppuccin Mocha/Latte)
|
|
56
|
-
|
|
57
|
-
### Attributes
|
|
31
|
+
## Attributes
|
|
58
32
|
|
|
59
33
|
| Attribute | Description | Default |
|
|
60
34
|
|-----------|-------------|---------|
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
68
|
-
| `data-readonly` | Disable input, display only (`true` or `false`) | `false` |
|
|
35
|
+
| `theme` | Color theme name (builtin or registered via `window.pyreplThemes`) | `catppuccin-mocha` |
|
|
36
|
+
| `packages` | Comma-separated list of PyPI packages to preload | none |
|
|
37
|
+
| `repl-title` | Custom title in the header bar | `Python REPL` |
|
|
38
|
+
| `src` | Path to a Python script to preload (runs silently, populates namespace) | none |
|
|
39
|
+
| `no-header` | Hide the header bar (boolean attribute) | not set |
|
|
40
|
+
| `no-buttons` | Hide copy/clear buttons in header (boolean attribute) | not set |
|
|
41
|
+
| `readonly` | Disable input, display only (boolean attribute) | not set |
|
|
69
42
|
|
|
70
|
-
###
|
|
43
|
+
### Theming
|
|
71
44
|
|
|
72
|
-
|
|
45
|
+
Built-in themes: `catppuccin-mocha` (dark, default) and `catppuccin-latte` (light).
|
|
73
46
|
|
|
74
|
-
####
|
|
47
|
+
#### Custom Themes
|
|
48
|
+
|
|
49
|
+
Register custom themes via `window.pyreplThemes` before loading the script. Only `background` and `foreground` are required - everything else is automatically derived:
|
|
75
50
|
|
|
76
51
|
```html
|
|
77
52
|
<script>
|
|
78
53
|
window.pyreplThemes = {
|
|
79
54
|
'my-theme': {
|
|
80
|
-
background: '#
|
|
81
|
-
foreground: '#
|
|
82
|
-
cursor: '#528bff',
|
|
83
|
-
cursorAccent: '#282c34',
|
|
84
|
-
selectionBackground: '#3e4451',
|
|
85
|
-
black: '#1e2127',
|
|
86
|
-
red: '#e06c75',
|
|
87
|
-
green: '#98c379',
|
|
88
|
-
yellow: '#d19a66',
|
|
89
|
-
blue: '#61afef',
|
|
90
|
-
magenta: '#c678dd',
|
|
91
|
-
cyan: '#56b6c2',
|
|
92
|
-
white: '#abb2bf',
|
|
93
|
-
brightBlack: '#5c6370',
|
|
94
|
-
brightRed: '#e06c75',
|
|
95
|
-
brightGreen: '#98c379',
|
|
96
|
-
brightYellow: '#d19a66',
|
|
97
|
-
brightBlue: '#61afef',
|
|
98
|
-
brightMagenta: '#c678dd',
|
|
99
|
-
brightCyan: '#56b6c2',
|
|
100
|
-
brightWhite: '#ffffff',
|
|
101
|
-
// Optional header customization
|
|
102
|
-
headerBackground: '#21252b',
|
|
103
|
-
headerTitle: '#5c6370',
|
|
55
|
+
background: '#1a1b26',
|
|
56
|
+
foreground: '#a9b1d6',
|
|
104
57
|
}
|
|
105
58
|
};
|
|
106
59
|
</script>
|
|
107
60
|
<script src="https://cdn.jsdelivr.net/npm/pyrepl-web/dist/pyrepl.js"></script>
|
|
108
61
|
|
|
109
|
-
<
|
|
62
|
+
<py-repl theme="my-theme"></py-repl>
|
|
110
63
|
```
|
|
111
64
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
"background": "#1a1b26",
|
|
117
|
-
"foreground": "#a9b1d6",
|
|
118
|
-
"cursor": "#c0caf5",
|
|
119
|
-
"cursorAccent": "#1a1b26",
|
|
120
|
-
"selectionBackground": "#33467c",
|
|
121
|
-
"black": "#15161e",
|
|
122
|
-
"red": "#f7768e",
|
|
123
|
-
"green": "#9ece6a",
|
|
124
|
-
"yellow": "#e0af68",
|
|
125
|
-
"blue": "#7aa2f7",
|
|
126
|
-
"magenta": "#bb9af7",
|
|
127
|
-
"cyan": "#7dcfff",
|
|
128
|
-
"white": "#a9b1d6",
|
|
129
|
-
"brightBlack": "#414868",
|
|
130
|
-
"brightRed": "#f7768e",
|
|
131
|
-
"brightGreen": "#9ece6a",
|
|
132
|
-
"brightYellow": "#e0af68",
|
|
133
|
-
"brightBlue": "#7aa2f7",
|
|
134
|
-
"brightMagenta": "#bb9af7",
|
|
135
|
-
"brightCyan": "#7dcfff",
|
|
136
|
-
"brightWhite": "#c0caf5"
|
|
137
|
-
}'></div>
|
|
138
|
-
```
|
|
65
|
+
**What gets auto-derived from your background color:**
|
|
66
|
+
- Terminal colors (red for errors, green for success, etc.) - from catppuccin-mocha (dark) or catppuccin-latte (light)
|
|
67
|
+
- Syntax highlighting - uses the matching catppuccin Pygments style
|
|
68
|
+
- Header colors - derived from the base theme
|
|
139
69
|
|
|
140
70
|
#### Theme Properties
|
|
141
71
|
|
|
142
72
|
| Property | Description |
|
|
143
73
|
|----------|-------------|
|
|
144
|
-
| `background` | Terminal background color |
|
|
145
|
-
| `foreground` | Default text color |
|
|
146
|
-
| `
|
|
147
|
-
| `
|
|
148
|
-
| `
|
|
149
|
-
| `
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
| `headerTitle` | (Optional) Header title text color, defaults to `brightBlack` |
|
|
153
|
-
| `shadow` | (Optional) Box shadow CSS value |
|
|
74
|
+
| `background` | Terminal background color (required) |
|
|
75
|
+
| `foreground` | Default text color (required) |
|
|
76
|
+
| `headerBackground` | Header bar background (optional) |
|
|
77
|
+
| `headerForeground` | Header title color (optional) |
|
|
78
|
+
| `promptColor` | Prompt `>>>` color - hex (`#7aa2f7`) or name (`green`, `cyan`) (optional) |
|
|
79
|
+
| `pygmentsStyle` | Custom syntax highlighting (optional, see below) |
|
|
80
|
+
|
|
81
|
+
#### Syntax Highlighting
|
|
154
82
|
|
|
155
|
-
|
|
83
|
+
Syntax highlighting uses [Pygments](https://pygments.org/). The style is chosen automatically:
|
|
156
84
|
|
|
157
|
-
|
|
85
|
+
1. If your theme name matches a [Pygments style](https://pygments.org/styles/) (e.g., `monokai`, `dracula`), that style is used
|
|
86
|
+
2. Otherwise, uses `catppuccin-mocha` for dark backgrounds or `catppuccin-latte` for light backgrounds
|
|
87
|
+
|
|
88
|
+
For full control, provide a `pygmentsStyle` mapping [Pygments tokens](https://pygments.org/docs/tokens/) to colors:
|
|
158
89
|
|
|
159
90
|
```html
|
|
160
|
-
<script
|
|
161
|
-
|
|
91
|
+
<script>
|
|
92
|
+
window.pyreplThemes = {
|
|
93
|
+
'tokyo-night': {
|
|
94
|
+
background: '#1a1b26',
|
|
95
|
+
foreground: '#a9b1d6',
|
|
96
|
+
promptColor: '#bb9af7',
|
|
97
|
+
pygmentsStyle: {
|
|
98
|
+
'Keyword': '#bb9af7',
|
|
99
|
+
'String': '#9ece6a',
|
|
100
|
+
'Number': '#ff9e64',
|
|
101
|
+
'Comment': '#565f89',
|
|
102
|
+
'Name.Function': '#7aa2f7',
|
|
103
|
+
'Name.Builtin': '#7dcfff',
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
</script>
|
|
162
108
|
```
|
|
163
109
|
|
|
164
|
-
|
|
110
|
+
### Legacy API
|
|
111
|
+
|
|
112
|
+
The legacy `<div class="pyrepl">` API is still supported for backwards compatibility:
|
|
165
113
|
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
114
|
+
```html
|
|
115
|
+
<div class="pyrepl"
|
|
116
|
+
data-theme="catppuccin-mocha"
|
|
117
|
+
data-packages="numpy"
|
|
118
|
+
data-title="My REPL"
|
|
119
|
+
data-src="/demo.py"
|
|
120
|
+
data-header="true"
|
|
121
|
+
data-buttons="true"
|
|
122
|
+
data-readonly="false">
|
|
123
|
+
</div>
|
|
170
124
|
```
|
|
171
125
|
|
|
172
126
|
## Development
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-q8xkh3ym.js";var{defineProperty:j4,getOwnPropertyDescriptor:t4}=Object,e4=(q,G)=>{for(var Y in G)j4(q,Y,{get:G[Y],enumerable:!0})},a=(q,G,Y,H)=>{for(var F=H>1?void 0:H?t4(G,Y):G,Z=q.length-1,$;Z>=0;Z--)($=q[Z])&&(F=(H?$(G,Y,F):$(F))||F);return H&&F&&j4(G,Y,F),F},D=(q,G)=>(Y,H)=>G(Y,H,q),C3="Terminal input",L2={get:()=>C3,set:(q)=>C3=q},M3="Too much output to announce, navigate to rows manually to read",Q2={get:()=>M3,set:(q)=>M3=q};function q5(q){return q.replace(/\r?\n/g,"\r")}function G5(q,G){return G?"\x1B[200~"+q+"\x1B[201~":q}function Y5(q,G){q.clipboardData&&q.clipboardData.setData("text/plain",G.selectionText),q.preventDefault()}function H5(q,G,Y,H){if(q.stopPropagation(),q.clipboardData){let F=q.clipboardData.getData("text/plain");K4(F,G,Y,H)}}function K4(q,G,Y,H){q=q5(q),q=G5(q,Y.decPrivateModes.bracketedPasteMode&&H.rawOptions.ignoreBracketedPasteMode!==!0),Y.triggerDataEvent(q,!0),G.value=""}function W4(q,G,Y){let H=Y.getBoundingClientRect(),F=q.clientX-H.left-10,Z=q.clientY-H.top-10;G.style.width="20px",G.style.height="20px",G.style.left=`${F}px`,G.style.top=`${Z}px`,G.style.zIndex="1000",G.focus()}function z3(q,G,Y,H,F){W4(q,G,Y),F&&H.rightClickSelect(q),G.value=H.selectionText,G.select()}function h0(q){return q>65535?(q-=65536,String.fromCharCode((q>>10)+55296)+String.fromCharCode(q%1024+56320)):String.fromCharCode(q)}function q2(q,G=0,Y=q.length){let H="";for(let F=G;F<Y;++F){let Z=q[F];Z>65535?(Z-=65536,H+=String.fromCharCode((Z>>10)+55296)+String.fromCharCode(Z%1024+56320)):H+=String.fromCharCode(Z)}return H}var F5=class{constructor(){this._interim=0}clear(){this._interim=0}decode(q,G){let Y=q.length;if(!Y)return 0;let H=0,F=0;if(this._interim){let Z=q.charCodeAt(F++);56320<=Z&&Z<=57343?G[H++]=(this._interim-55296)*1024+Z-56320+65536:(G[H++]=this._interim,G[H++]=Z),this._interim=0}for(let Z=F;Z<Y;++Z){let $=q.charCodeAt(Z);if(55296<=$&&$<=56319){if(++Z>=Y)return this._interim=$,H;let V=q.charCodeAt(Z);56320<=V&&V<=57343?G[H++]=($-55296)*1024+V-56320+65536:(G[H++]=$,G[H++]=V);continue}$!==65279&&(G[H++]=$)}return H}},Z5=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(q,G){let Y=q.length;if(!Y)return 0;let H=0,F,Z,$,V,X=0,J=0;if(this.interim[0]){let j=!1,K=this.interim[0];K&=(K&224)===192?31:(K&240)===224?15:7;let z=0,W;for(;(W=this.interim[++z]&63)&&z<4;)K<<=6,K|=W;let P=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,x=P-z;for(;J<x;){if(J>=Y)return 0;if(W=q[J++],(W&192)!==128){J--,j=!0;break}else this.interim[z++]=W,K<<=6,K|=W&63}j||(P===2?K<128?J--:G[H++]=K:P===3?K<2048||K>=55296&&K<=57343||K===65279||(G[H++]=K):K<65536||K>1114111||(G[H++]=K)),this.interim.fill(0)}let M=Y-4,C=J;for(;C<Y;){for(;C<M&&!((F=q[C])&128)&&!((Z=q[C+1])&128)&&!(($=q[C+2])&128)&&!((V=q[C+3])&128);)G[H++]=F,G[H++]=Z,G[H++]=$,G[H++]=V,C+=4;if(F=q[C++],F<128)G[H++]=F;else if((F&224)===192){if(C>=Y)return this.interim[0]=F,H;if(Z=q[C++],(Z&192)!==128){C--;continue}if(X=(F&31)<<6|Z&63,X<128){C--;continue}G[H++]=X}else if((F&240)===224){if(C>=Y)return this.interim[0]=F,H;if(Z=q[C++],(Z&192)!==128){C--;continue}if(C>=Y)return this.interim[0]=F,this.interim[1]=Z,H;if($=q[C++],($&192)!==128){C--;continue}if(X=(F&15)<<12|(Z&63)<<6|$&63,X<2048||X>=55296&&X<=57343||X===65279)continue;G[H++]=X}else if((F&248)===240){if(C>=Y)return this.interim[0]=F,H;if(Z=q[C++],(Z&192)!==128){C--;continue}if(C>=Y)return this.interim[0]=F,this.interim[1]=Z,H;if($=q[C++],($&192)!==128){C--;continue}if(C>=Y)return this.interim[0]=F,this.interim[1]=Z,this.interim[2]=$,H;if(V=q[C++],(V&192)!==128){C--;continue}if(X=(F&7)<<18|(Z&63)<<12|($&63)<<6|V&63,X<65536||X>1114111)continue;G[H++]=X}}return H}},U4="",u0=" ",x1=class q{constructor(){this.fg=0,this.bg=0,this.extended=new a1}static toColorRGB(G){return[G>>>16&255,G>>>8&255,G&255]}static fromColorRGB(G){return(G[0]&255)<<16|(G[1]&255)<<8|G[2]&255}clone(){let G=new q;return G.fg=this.fg,G.bg=this.bg,G.extended=this.extended.clone(),G}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},a1=class q{constructor(G=0,Y=0){this._ext=0,this._urlId=0,this._ext=G,this._urlId=Y}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(G){this._ext=G}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(G){this._ext&=-469762049,this._ext|=G<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(G){this._ext&=-67108864,this._ext|=G&67108863}get urlId(){return this._urlId}set urlId(G){this._urlId=G}get underlineVariantOffset(){let G=(this._ext&3758096384)>>29;return G<0?G^4294967288:G}set underlineVariantOffset(G){this._ext&=536870911,this._ext|=G<<29&3758096384}clone(){return new q(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},B0=class q extends x1{constructor(){super(...arguments);this.content=0,this.fg=0,this.bg=0,this.extended=new a1,this.combinedData=""}static fromCharData(G){let Y=new q;return Y.setFromCharData(G),Y}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?h0(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(G){this.fg=G[0],this.bg=0;let Y=!1;if(G[1].length>2)Y=!0;else if(G[1].length===2){let H=G[1].charCodeAt(0);if(55296<=H&&H<=56319){let F=G[1].charCodeAt(1);56320<=F&&F<=57343?this.content=(H-55296)*1024+F-56320+65536|G[2]<<22:Y=!0}else Y=!0}else this.content=G[1].charCodeAt(0)|G[2]<<22;Y&&(this.combinedData=G[1],this.content=2097152|G[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},j3="di$target",O2="di$dependencies",V2=new Map;function $5(q){return q[O2]||[]}function H0(q){if(V2.has(q))return V2.get(q);let G=function(Y,H,F){if(arguments.length!==3)throw Error("@IServiceName-decorator can only be used to decorate a parameter");J5(G,Y,F)};return G._id=q,V2.set(q,G),G}function J5(q,G,Y){G[j3]===G?G[O2].push({id:q,index:Y}):(G[O2]=[{id:q,index:Y}],G[j3]=G)}var X0=H0("BufferService"),N4=H0("CoreMouseService"),e0=H0("CoreService"),V5=H0("CharsetService"),q3=H0("InstantiationService"),B4=H0("LogService"),C0=H0("OptionsService"),A4=H0("OscLinkService"),X5=H0("UnicodeService"),w1=H0("DecorationService"),x2=class{constructor(q,G,Y){this._bufferService=q,this._optionsService=G,this._oscLinkService=Y}provideLinks(q,G){let Y=this._bufferService.buffer.lines.get(q-1);if(!Y){G(void 0);return}let H=[],F=this._optionsService.rawOptions.linkHandler,Z=new B0,$=Y.getTrimmedLength(),V=-1,X=-1,J=!1;for(let M=0;M<$;M++)if(!(X===-1&&!Y.hasContent(M))){if(Y.loadCell(M,Z),Z.hasExtendedAttrs()&&Z.extended.urlId)if(X===-1){X=M,V=Z.extended.urlId;continue}else J=Z.extended.urlId!==V;else X!==-1&&(J=!0);if(J||X!==-1&&M===$-1){let C=this._oscLinkService.getLinkData(V)?.uri;if(C){let j={start:{x:X+1,y:q},end:{x:M+(!J&&M===$-1?1:0),y:q}},K=!1;if(!F?.allowNonHttpProtocols)try{let z=new URL(C);["http:","https:"].includes(z.protocol)||(K=!0)}catch{K=!0}K||H.push({text:C,range:j,activate:(z,W)=>F?F.activate(z,W,j):C5(z,W),hover:(z,W)=>F?.hover?.(z,W,j),leave:(z,W)=>F?.leave?.(z,W,j)})}J=!1,Z.hasExtendedAttrs()&&Z.extended.urlId?(X=M,V=Z.extended.urlId):(X=-1,V=-1)}}G(H)}};x2=a([D(0,X0),D(1,C0),D(2,A4)],x2);function C5(q,G){if(confirm(`Do you want to navigate to ${G}?
|
|
2
2
|
|
|
3
3
|
WARNING: This link could potentially be dangerous`)){let Y=window.open();if(Y){try{Y.opener=null}catch{}Y.location.href=G}else console.warn("Opening link blocked as opener could not be cleared")}}var G2=H0("CharSizeService"),v0=H0("CoreBrowserService"),G3=H0("MouseService"),_0=H0("RenderService"),M5=H0("SelectionService"),R4=H0("CharacterJoinerService"),H1=H0("ThemeService"),D4=H0("LinkProviderService"),z5=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(q){setTimeout(()=>{throw q.stack?K3.isErrorNoTelemetry(q)?new K3(q.message+`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-q8xkh3ym.js";function a(e){if(typeof e!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function A(e,r){var n="",l=0,f=-1,i=0,s;for(var t=0;t<=e.length;++t){if(t<e.length)s=e.charCodeAt(t);else if(s===47)break;else s=47;if(s===47){if(f===t-1||i===1);else if(f!==t-1&&i===2){if(n.length<2||l!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var u=n.lastIndexOf("/");if(u!==n.length-1){if(u===-1)n="",l=0;else n=n.slice(0,u),l=n.length-1-n.lastIndexOf("/");f=t,i=0;continue}}else if(n.length===2||n.length===1){n="",l=0,f=t,i=0;continue}}if(r){if(n.length>0)n+="/..";else n="..";l=2}}else{if(n.length>0)n+="/"+e.slice(f+1,t);else n=e.slice(f+1,t);l=t-f-1}f=t,i=0}else if(s===46&&i!==-1)++i;else i=-1}return n}function h(e,r){var n=r.dir||r.root,l=r.base||(r.name||"")+(r.ext||"");if(!n)return l;if(n===r.root)return n+l;return n+e+l}function d(){var e="",r=!1,n;for(var l=arguments.length-1;l>=-1&&!r;l--){var f;if(l>=0)f=arguments[l];else{if(n===void 0)n=process.cwd();f=n}if(a(f),f.length===0)continue;e=f+"/"+e,r=f.charCodeAt(0)===47}if(e=A(e,!r),r)if(e.length>0)return"/"+e;else return"/";else if(e.length>0)return e;else return"."}function m(e){if(a(e),e.length===0)return".";var r=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;if(e=A(e,!r),e.length===0&&!r)e=".";if(e.length>0&&n)e+="/";if(r)return"/"+e;return e}function b(e){return a(e),e.length>0&&e.charCodeAt(0)===47}function k(){if(arguments.length===0)return".";var e;for(var r=0;r<arguments.length;++r){var n=arguments[r];if(a(n),n.length>0)if(e===void 0)e=n;else e+="/"+n}if(e===void 0)return".";return m(e)}function y(e,r){if(a(e),a(r),e===r)return"";if(e=d(e),r=d(r),e===r)return"";var n=1;for(;n<e.length;++n)if(e.charCodeAt(n)!==47)break;var l=e.length,f=l-n,i=1;for(;i<r.length;++i)if(r.charCodeAt(i)!==47)break;var s=r.length,t=s-i,u=f<t?f:t,c=-1,o=0;for(;o<=u;++o){if(o===u){if(t>u){if(r.charCodeAt(i+o)===47)return r.slice(i+o+1);else if(o===0)return r.slice(i+o)}else if(f>u){if(e.charCodeAt(n+o)===47)c=o;else if(o===0)c=0}break}var v=e.charCodeAt(n+o),C=r.charCodeAt(i+o);if(v!==C)break;else if(v===47)c=o}var g="";for(o=n+c+1;o<=l;++o)if(o===l||e.charCodeAt(o)===47)if(g.length===0)g+="..";else g+="/..";if(g.length>0)return g+r.slice(i+c);else{if(i+=c,r.charCodeAt(i)===47)++i;return r.slice(i)}}function S(e){return e}function w(e){if(a(e),e.length===0)return".";var r=e.charCodeAt(0),n=r===47,l=-1,f=!0;for(var i=e.length-1;i>=1;--i)if(r=e.charCodeAt(i),r===47){if(!f){l=i;break}}else f=!1;if(l===-1)return n?"/":".";if(n&&l===1)return"//";return e.slice(0,l)}function P(e,r){if(r!==void 0&&typeof r!=="string")throw TypeError('"ext" argument must be a string');a(e);var n=0,l=-1,f=!0,i;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var s=r.length-1,t=-1;for(i=e.length-1;i>=0;--i){var u=e.charCodeAt(i);if(u===47){if(!f){n=i+1;break}}else{if(t===-1)f=!1,t=i+1;if(s>=0)if(u===r.charCodeAt(s)){if(--s===-1)l=i}else s=-1,l=t}}if(n===l)l=t;else if(l===-1)l=e.length;return e.slice(n,l)}else{for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===47){if(!f){n=i+1;break}}else if(l===-1)f=!1,l=i+1;if(l===-1)return"";return e.slice(n,l)}}function D(e){a(e);var r=-1,n=0,l=-1,f=!0,i=0;for(var s=e.length-1;s>=0;--s){var t=e.charCodeAt(s);if(t===47){if(!f){n=s+1;break}continue}if(l===-1)f=!1,l=s+1;if(t===46){if(r===-1)r=s;else if(i!==1)i=1}else if(r!==-1)i=-1}if(r===-1||l===-1||i===0||i===1&&r===l-1&&r===n+1)return"";return e.slice(r,l)}function L(e){if(e===null||typeof e!=="object")throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return h("/",e)}function T(e){a(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var n=e.charCodeAt(0),l=n===47,f;if(l)r.root="/",f=1;else f=0;var i=-1,s=0,t=-1,u=!0,c=e.length-1,o=0;for(;c>=f;--c){if(n=e.charCodeAt(c),n===47){if(!u){s=c+1;break}continue}if(t===-1)u=!1,t=c+1;if(n===46){if(i===-1)i=c;else if(o!==1)o=1}else if(i!==-1)o=-1}if(i===-1||t===-1||o===0||o===1&&i===t-1&&i===s+1){if(t!==-1)if(s===0&&l)r.base=r.name=e.slice(1,t);else r.base=r.name=e.slice(s,t)}else{if(s===0&&l)r.name=e.slice(1,i),r.base=e.slice(1,t);else r.name=e.slice(s,i),r.base=e.slice(s,t);r.ext=e.slice(i,t)}if(s>0)r.dir=e.slice(0,s-1);else if(l)r.dir="/";return r}var R="/",_=":",z=((e)=>(e.posix=e,e))({resolve:d,normalize:m,isAbsolute:b,join:k,relative:y,_makeLong:S,dirname:w,basename:P,extname:D,format:L,parse:T,sep:R,delimiter:_,win32:null,posix:null}),E=z;export{R as sep,d as resolve,y as relative,z as posix,T as parse,m as normalize,k as join,b as isAbsolute,L as format,D as extname,w as dirname,_ as delimiter,E as default,P as basename,S as _makeLong};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as O,
|
|
1
|
+
import{a as O,g as j}from"./chunk-q8xkh3ym.js";var __dirname="/home/runner/work/pyrepl-web/pyrepl-web/node_modules/pyodide";var U0=Object.defineProperty,B=(G,Q)=>U0(G,"name",{value:Q,configurable:!0}),f=((G)=>j)(function(G){return j.apply(this,arguments)}),F0=(()=>{for(var G=new Uint8Array(128),Q=0;Q<64;Q++)G[Q<26?Q+65:Q<52?Q+71:Q<62?Q-4:Q*4-205]=Q;return(W)=>{for(var z=W.length,X=new Uint8Array((z-(W[z-1]=="=")-(W[z-2]=="="))*3/4|0),Z=0,H=0;Z<z;){var J=G[W.charCodeAt(Z++)],K=G[W.charCodeAt(Z++)],M=G[W.charCodeAt(Z++)],V=G[W.charCodeAt(Z++)];X[H++]=J<<2|K>>4,X[H++]=K<<4|M>>2,X[H++]=M<<6|V}return X}})();function u(G){return!isNaN(parseFloat(G))&&isFinite(G)}B(u,"_isNumber");function T(G){return G.charAt(0).toUpperCase()+G.substring(1)}B(T,"_capitalize");function b(G){return function(){return this[G]}}B(b,"_getter");var F=["isConstructor","isEval","isNative","isToplevel"],k=["columnNumber","lineNumber"],I=["fileName","functionName","source"],k0=["args"],I0=["evalOrigin"],E=F.concat(k,I,k0,I0);function C(G){if(G)for(var Q=0;Q<E.length;Q++)G[E[Q]]!==void 0&&this["set"+T(E[Q])](G[E[Q]])}B(C,"StackFrame");C.prototype={getArgs:B(function(){return this.args},"getArgs"),setArgs:B(function(G){if(Object.prototype.toString.call(G)!=="[object Array]")throw TypeError("Args must be an Array");this.args=G},"setArgs"),getEvalOrigin:B(function(){return this.evalOrigin},"getEvalOrigin"),setEvalOrigin:B(function(G){if(G instanceof C)this.evalOrigin=G;else if(G instanceof Object)this.evalOrigin=new C(G);else throw TypeError("Eval Origin must be an Object or StackFrame")},"setEvalOrigin"),toString:B(function(){var G=this.getFileName()||"",Q=this.getLineNumber()||"",W=this.getColumnNumber()||"",z=this.getFunctionName()||"";return this.getIsEval()?G?"[eval] ("+G+":"+Q+":"+W+")":"[eval]:"+Q+":"+W:z?z+" ("+G+":"+Q+":"+W+")":G+":"+Q+":"+W},"toString")};C.fromString=B(function(G){var Q=G.indexOf("("),W=G.lastIndexOf(")"),z=G.substring(0,Q),X=G.substring(Q+1,W).split(","),Z=G.substring(W+1);if(Z.indexOf("@")===0)var H=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(Z,""),J=H[1],K=H[2],M=H[3];return new C({functionName:z,args:X||void 0,fileName:J,lineNumber:K||void 0,columnNumber:M||void 0})},"StackFrame$$fromString");for(x=0;x<F.length;x++)C.prototype["get"+T(F[x])]=b(F[x]),C.prototype["set"+T(F[x])]=function(G){return function(Q){this[G]=!!Q}}(F[x]);var x;for(A=0;A<k.length;A++)C.prototype["get"+T(k[A])]=b(k[A]),C.prototype["set"+T(k[A])]=function(G){return function(Q){if(!u(Q))throw TypeError(G+" must be a Number");this[G]=Number(Q)}}(k[A]);var A;for(L=0;L<I.length;L++)C.prototype["get"+T(I[L])]=b(I[L]),C.prototype["set"+T(I[L])]=function(G){return function(Q){this[G]=String(Q)}}(I[L]);var L,g=C;function c(){var G=/^\s*at .*(\S+:\d+|\(native\))/m,Q=/^(eval@)?(\[native code])?$/;return{parse:B(function(W){if(W.stack&&W.stack.match(G))return this.parseV8OrIE(W);if(W.stack)return this.parseFFOrSafari(W);throw Error("Cannot parse given Error object")},"ErrorStackParser$$parse"),extractLocation:B(function(W){if(W.indexOf(":")===-1)return[W];var z=/(.+?)(?::(\d+))?(?::(\d+))?$/,X=z.exec(W.replace(/[()]/g,""));return[X[1],X[2]||void 0,X[3]||void 0]},"ErrorStackParser$$extractLocation"),parseV8OrIE:B(function(W){var z=W.stack.split(`
|
|
2
2
|
`).filter(function(X){return!!X.match(G)},this);return z.map(function(X){X.indexOf("(eval ")>-1&&(X=X.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var Z=X.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),H=Z.match(/ (\(.+\)$)/);Z=H?Z.replace(H[0],""):Z;var J=this.extractLocation(H?H[1]:Z),K=H&&Z||void 0,M=["eval","<anonymous>"].indexOf(J[0])>-1?void 0:J[0];return new g({functionName:K,fileName:M,lineNumber:J[1],columnNumber:J[2],source:X})},this)},"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:B(function(W){var z=W.stack.split(`
|
|
3
|
-
`).filter(function(X){return!X.match(Q)},this);return z.map(function(X){if(X.indexOf(" > eval")>-1&&(X=X.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),X.indexOf("@")===-1&&X.indexOf(":")===-1)return new g({functionName:X});var Z=/((.*".+"[^@]*)?[^@]*)(?:@)/,H=X.match(Z),J=H&&H[1]?H[1]:void 0,K=this.extractLocation(X.replace(Z,""));return new g({functionName:J,fileName:K[0],lineNumber:K[1],columnNumber:K[2],source:X})},this)},"ErrorStackParser$$parseFFOrSafari")}}B(c,"ErrorStackParser");var N0=new c,R0=N0;function d(){if(typeof API<"u"&&API!==globalThis.API)return API.runtimeEnv;let G=typeof Bun<"u",Q=typeof Deno<"u",W=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&!1,z=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Chrome")===-1&&navigator.userAgent.indexOf("Safari")>-1;return l({IN_BUN:G,IN_DENO:Q,IN_NODE:W,IN_SAFARI:z,IN_SHELL:typeof read=="function"&&typeof load=="function"})}B(d,"getGlobalRuntimeEnv");var Y=d();function l(G){let Q=G.IN_NODE&&typeof p<"u"&&P0&&typeof f=="function"&&typeof __dirname=="string",W=G.IN_NODE&&!Q,z=!G.IN_NODE&&!G.IN_DENO&&!G.IN_BUN,X=z&&typeof window<"u"&&typeof window.document<"u"&&typeof document.createElement=="function"&&"sessionStorage"in window&&typeof globalThis.importScripts!="function",Z=z&&typeof globalThis.WorkerGlobalScope<"u"&&typeof globalThis.self<"u"&&globalThis.self instanceof globalThis.WorkerGlobalScope;return{...G,IN_BROWSER:z,IN_BROWSER_MAIN_THREAD:X,IN_BROWSER_WEB_WORKER:Z,IN_NODE_COMMONJS:Q,IN_NODE_ESM:W}}B(l,"calculateDerivedFlags");var s,P,a,m,v;async function y(){if(!Y.IN_NODE||(s=(await import("./chunk-agmzdfvt.js")).default,m=await import("node:fs"),v=await import("node:fs/promises"),a=(await import("node:vm")).default,P=await import("./chunk-t9eg0wr0.js"),_=P.sep,typeof f<"u"))return;let G=m,Q=await import("./chunk-3vjhr6cq.js"),W=await import("ws"),z=await import("node:child_process"),X={fs:G,crypto:Q,ws:W,child_process:z};globalThis.require=function(Z){return X[Z]}}B(y,"initNodeModules");function i(G,Q){return P.resolve(Q||".",G)}B(i,"node_resolvePath");function o(G,Q){return Q===void 0&&(Q=location),new URL(G,Q).toString()}B(o,"browser_resolvePath");var S;Y.IN_NODE?S=i:Y.IN_SHELL?S=B((G)=>G,"resolvePath"):S=o;var _;Y.IN_NODE||(_="/");function n(G,Q){return G.startsWith("file://")&&(G=G.slice(7)),G.includes("://")?{response:fetch(G)}:{binary:v.readFile(G).then((W)=>new Uint8Array(W.buffer,W.byteOffset,W.byteLength))}}B(n,"node_getBinaryResponse");function r(G,Q){if(G.startsWith("file://")&&(G=G.slice(7)),G.includes("://"))throw Error("Shell cannot fetch urls");return{binary:Promise.resolve(new Uint8Array(readbuffer(G)))}}B(r,"shell_getBinaryResponse");function t(G,Q){let W=new URL(G,location);return{response:fetch(W,Q?{integrity:Q}:{})}}B(t,"browser_getBinaryResponse");var w;Y.IN_NODE?w=n:Y.IN_SHELL?w=r:w=t;async function e(G,Q){let{response:W,binary:z}=w(G,Q);if(z)return z;let X=await W;if(!X.ok)throw Error(`Failed to load '${G}': request failed.`);return new Uint8Array(await X.arrayBuffer())}B(e,"loadBinaryFile");var N;if(Y.IN_BROWSER_MAIN_THREAD)N=B(async(G)=>await import(G),"loadScript");else if(Y.IN_BROWSER_WEB_WORKER)N=B(async(G)=>{try{globalThis.importScripts(G)}catch(Q){if(Q instanceof TypeError)await import(G);else throw Q}},"loadScript");else if(Y.IN_NODE)N=G0;else if(Y.IN_SHELL)N=load;else throw Error("Cannot determine runtime environment");async function G0(G){G.startsWith("file://")&&(G=G.slice(7)),G.includes("://")?a.runInThisContext(await(await fetch(G)).text()):await import(s.pathToFileURL(G).href)}B(G0,"nodeLoadScript");async function Q0(G){if(Y.IN_NODE){await y();let Q=await v.readFile(G,{encoding:"utf8"});return JSON.parse(Q)}else if(Y.IN_SHELL){let Q=read(G);return JSON.parse(Q)}else return await(await fetch(G)).json()}B(Q0,"loadLockFile");async function W0(){if(Y.IN_NODE_COMMONJS)return __dirname;let G;try{throw Error()}catch(z){G=z}let Q=R0.parse(G)[0].fileName;if(Y.IN_NODE&&!Q.startsWith("file://")&&(Q=`file://${Q}`),Y.IN_NODE_ESM){let z=await import("./chunk-t9eg0wr0.js");return(await import("./chunk-agmzdfvt.js")).fileURLToPath(z.dirname(Q))}let W=Q.lastIndexOf(_);if(W===-1)throw Error("Could not extract indexURL path from pyodide module location. Please pass the indexURL explicitly to loadPyodide.");return Q.slice(0,W)}B(W0,"calculateDirname");function X0(G){return G.substring(0,G.lastIndexOf("/")+1)||globalThis.location?.toString()||"."}B(X0,"calculateInstallBaseUrl");function Z0(G){let Q=G.FS,W=G.FS.filesystems.MEMFS,z=G.PATH,X={DIR_MODE:16895,FILE_MODE:33279,mount:B(function(Z){if(!Z.opts.fileSystemHandle)throw Error("opts.fileSystemHandle is required");return W.mount.apply(null,arguments)},"mount"),syncfs:B(async(Z,H,J)=>{try{let K=X.getLocalSet(Z),M=await X.getRemoteSet(Z),V=H?M:K,D=H?K:M;await X.reconcile(Z,V,D),J(null)}catch(K){J(K)}},"syncfs"),getLocalSet:B((Z)=>{let H=Object.create(null);function J(V){return V!=="."&&V!==".."}B(J,"isRealDir");function K(V){return(D)=>z.join2(V,D)}B(K,"toAbsolute");let M=Q.readdir(Z.mountpoint).filter(J).map(K(Z.mountpoint));for(;M.length;){let V=M.pop(),D=Q.stat(V);Q.isDir(D.mode)&&M.push.apply(M,Q.readdir(V).filter(J).map(K(V))),H[V]={timestamp:D.mtime,mode:D.mode}}return{type:"local",entries:H}},"getLocalSet"),getRemoteSet:B(async(Z)=>{let H=Object.create(null),J=await S0(Z.opts.fileSystemHandle);for(let[K,M]of J)K!=="."&&(H[z.join2(Z.mountpoint,K)]={timestamp:M.kind==="file"?new Date((await M.getFile()).lastModified):new Date,mode:M.kind==="file"?X.FILE_MODE:X.DIR_MODE});return{type:"remote",entries:H,handles:J}},"getRemoteSet"),loadLocalEntry:B((Z)=>{let H=Q.lookupPath(Z,{}).node,J=Q.stat(Z);if(Q.isDir(J.mode))return{timestamp:J.mtime,mode:J.mode};if(Q.isFile(J.mode))return H.contents=W.getFileDataAsTypedArray(H),{timestamp:J.mtime,mode:J.mode,contents:H.contents};throw Error("node type not supported")},"loadLocalEntry"),storeLocalEntry:B((Z,H)=>{if(Q.isDir(H.mode))Q.mkdirTree(Z,H.mode);else if(Q.isFile(H.mode))Q.writeFile(Z,H.contents,{canOwn:!0});else throw Error("node type not supported");Q.chmod(Z,H.mode),Q.utime(Z,H.timestamp,H.timestamp)},"storeLocalEntry"),removeLocalEntry:B((Z)=>{var H=Q.stat(Z);Q.isDir(H.mode)?Q.rmdir(Z):Q.isFile(H.mode)&&Q.unlink(Z)},"removeLocalEntry"),loadRemoteEntry:B(async(Z)=>{if(Z.kind==="file"){let H=await Z.getFile();return{contents:new Uint8Array(await H.arrayBuffer()),mode:X.FILE_MODE,timestamp:new Date(H.lastModified)}}else{if(Z.kind==="directory")return{mode:X.DIR_MODE,timestamp:new Date};throw Error("unknown kind: "+Z.kind)}},"loadRemoteEntry"),storeRemoteEntry:B(async(Z,H,J)=>{let K=Z.get(z.dirname(H)),M=Q.isFile(J.mode)?await K.getFileHandle(z.basename(H),{create:!0}):await K.getDirectoryHandle(z.basename(H),{create:!0});if(M.kind==="file"){let V=await M.createWritable();await V.write(J.contents),await V.close()}Z.set(H,M)},"storeRemoteEntry"),removeRemoteEntry:B(async(Z,H)=>{await Z.get(z.dirname(H)).removeEntry(z.basename(H)),Z.delete(H)},"removeRemoteEntry"),reconcile:B(async(Z,H,J)=>{let K=0,M=[];Object.keys(H.entries).forEach(function($){let q=H.entries[$],U=J.entries[$];(!U||Q.isFile(q.mode)&&q.timestamp.getTime()>U.timestamp.getTime())&&(M.push($),K++)}),M.sort();let V=[];if(Object.keys(J.entries).forEach(function($){H.entries[$]||(V.push($),K++)}),V.sort().reverse(),!K)return;let D=H.type==="remote"?H.handles:J.handles;for(let $ of M){let q=z.normalize($.replace(Z.mountpoint,"/")).substring(1);if(J.type==="local"){let U=D.get(q),L0=await X.loadRemoteEntry(U);X.storeLocalEntry($,L0)}else{let U=X.loadLocalEntry($);await X.storeRemoteEntry(D,q,U)}}for(let $ of V)if(J.type==="local")X.removeLocalEntry($);else{let q=z.normalize($.replace(Z.mountpoint,"/")).substring(1);await X.removeRemoteEntry(D,q)}},"reconcile")};G.FS.filesystems.NATIVEFS_ASYNC=X}B(Z0,"initializeNativeFS");var S0=B(async(G)=>{let Q=[];async function W(X){for await(let Z of X.values())Q.push(Z),Z.kind==="directory"&&await W(Z)}B(W,"collect"),await W(G);let z=new Map;z.set(".",G);for(let X of Q){let Z=(await G.resolve(X)).join("/");z.set(Z,X)}return z},"getFsHandles"),w0=F0("AGFzbQEAAAABDANfAGAAAW9gAW8BfwMDAgECByECD2NyZWF0ZV9zZW50aW5lbAAAC2lzX3NlbnRpbmVsAAEKEwIHAPsBAPsbCwkAIAD7GvsUAAs="),E0=async function(){if(!(globalThis.navigator&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&typeof navigator.maxTouchPoints<"u"&&navigator.maxTouchPoints>1)))try{let G=await WebAssembly.compile(w0);return await WebAssembly.instantiate(G)}catch(G){if(G instanceof WebAssembly.CompileError)return;throw G}}();async function z0(){let G=await E0;if(G)return G.exports;let Q=Symbol("error marker");return{create_sentinel:B(()=>Q,"create_sentinel"),is_sentinel:B((W)=>W===Q,"is_sentinel")}}B(z0,"getSentinelImport");function B0(G){let Q={config:G,runtimeEnv:Y},W={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Y0(G),print:G.stdout,printErr:G.stderr,onExit(z){W.exitCode=z},thisProgram:G._sysExecutable,arguments:G.args,API:Q,locateFile:B((z)=>G.indexURL+z,"locateFile"),instantiateWasm:$0(G.indexURL)};return W}B(B0,"createSettings");function H0(G){return function(Q){let W="/";try{Q.FS.mkdirTree(G)}catch(z){console.error(`Error occurred while making a home directory '${G}':`),console.error(z),console.error(`Using '${W}' for a home directory instead`),G=W}Q.FS.chdir(G)}}B(H0,"createHomeDirectory");function J0(G){return function(Q){Object.assign(Q.ENV,G)}}B(J0,"setEnvironment");function K0(G){return G?[async(Q)=>{Q.addRunDependency("fsInitHook");try{await G(Q.FS,{sitePackages:Q.API.sitePackages})}finally{Q.removeRunDependency("fsInitHook")}}]:[]}B(K0,"callFsInitHook");function M0(G){let Q=G.HEAPU32[G._Py_Version>>>2],W=Q>>>24&255,z=Q>>>16&255,X=Q>>>8&255;return[W,z,X]}B(M0,"computeVersionTuple");function V0(G){let Q=e(G);return async(W)=>{W.API.pyVersionTuple=M0(W);let[z,X]=W.API.pyVersionTuple;W.FS.mkdirTree("/lib"),W.API.sitePackages=`/lib/python${z}.${X}/site-packages`,W.FS.mkdirTree(W.API.sitePackages),W.addRunDependency("install-stdlib");try{let Z=await Q;W.FS.writeFile(`/lib/python${z}${X}.zip`,Z)}catch(Z){console.error("Error occurred while installing the standard library:"),console.error(Z)}finally{W.removeRunDependency("install-stdlib")}}}B(V0,"installStdlib");function Y0(G){let Q;return G.stdLibURL!=null?Q=G.stdLibURL:Q=G.indexURL+"python_stdlib.zip",[V0(Q),H0(G.env.HOME),J0(G.env),Z0,...K0(G.fsInit)]}B(Y0,"getFileSystemInitializationFuncs");function $0(G){if(typeof WasmOffsetConverter<"u")return;let{binary:Q,response:W}=w(G+"pyodide.asm.wasm"),z=z0();return function(X,Z){return async function(){X.sentinel=await z;try{let H;W?H=await WebAssembly.instantiateStreaming(W,X):H=await WebAssembly.instantiate(await Q,X);let{instance:J,module:K}=H;Z(J,K)}catch(H){console.warn("wasm instantiation failed!"),console.warn(H)}}(),{}}}B($0,"getInstantiateWasmFunc");var b0="0.29.2";function R(G){return G===void 0||G.endsWith("/")?G:G+"/"}B(R,"withTrailingSlash");var h=b0;async function j0(G={}){if(await y(),G.lockFileContents&&G.lockFileURL)throw Error("Can't pass both lockFileContents and lockFileURL");let Q=G.indexURL||await W0();if(Q=R(S(Q)),G.packageBaseUrl=R(G.packageBaseUrl),G.cdnUrl=R(G.packageBaseUrl??`https://cdn.jsdelivr.net/pyodide/v${h}/full/`),!G.lockFileContents){let X=G.lockFileURL??Q+"pyodide-lock.json";G.lockFileContents=Q0(X),G.packageBaseUrl??=X0(X)}G.indexURL=Q,G.packageCacheDir&&(G.packageCacheDir=R(S(G.packageCacheDir)));let W={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?()=>globalThis.prompt():void 0,args:[],env:{},packages:[],packageCacheDir:G.packageBaseUrl,enableRunUntilComplete:!0,checkAPIVersion:!0,BUILD_ID:"02af97d1069c4309880e46f2948861ea1faae5dbb49c20d5d5970aa9ae912fd4"},z=Object.assign(W,G);return z.env.HOME??="/home/pyodide",z.env.PYTHONINSPECT??="1",z}B(j0,"initializeConfiguration");function C0(G){let Q=B0(G),W=Q.API;return W.lockFilePromise=Promise.resolve(G.lockFileContents),Q}B(C0,"createEmscriptenSettings");async function D0(G){if(typeof _createPyodideModule!="function"){let Q=`${G.indexURL}pyodide.asm.js`;await N(Q)}}B(D0,"loadWasmScript");async function O0(G,Q){if(!G._loadSnapshot)return;let W=await G._loadSnapshot,z=ArrayBuffer.isView(W)?W:new Uint8Array(W);return Q.noInitialRun=!0,Q.INITIAL_MEMORY=z.length,z}B(O0,"prepareSnapshot");async function T0(G){let Q=await _createPyodideModule(G);if(G.exitCode!==void 0)throw new Q.ExitStatus(G.exitCode);return Q}B(T0,"createPyodideModule");function q0(G,Q){let W=G.API;if(Q.pyproxyToStringRepr&&W.setPyProxyToStringMethod(!0),Q.convertNullToNone&&W.setCompatNullToNone(!0),Q.toJsLiteralMap&&W.setCompatToJsLiteralMap(!0),W.version!==h&&Q.checkAPIVersion)throw Error(`Pyodide version does not match: '${h}' <==> '${W.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);G.locateFile=(z)=>{throw z.endsWith(".so")?Error(`Failed to find dynamic library "${z}"`):Error(`Unexpected call to locateFile("${z}")`)}}B(q0,"configureAPI");function x0(G,Q,W){let z=G.API,X;return Q&&(X=z.restoreSnapshot(Q)),z.finalizeBootstrap(X,W._snapshotDeserializer)}B(x0,"bootstrapPyodide");async function A0(G,Q){let W=G._api;return W.sys.path.insert(0,""),W._pyodide.set_excepthook(),await W.packageIndexReady,W.initializeStreams(Q.stdin,Q.stdout,Q.stderr),G}B(A0,"finalizeSetup");async function g0(G={}){let Q=await j0(G),W=C0(Q);await D0(Q);let z=await O0(Q,W),X=await T0(W);q0(X,Q);let Z=x0(X,z,Q);return await A0(Z,Q)}B(g0,"loadPyodide");export{h as version,g0 as loadPyodide};
|
|
3
|
+
`).filter(function(X){return!X.match(Q)},this);return z.map(function(X){if(X.indexOf(" > eval")>-1&&(X=X.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),X.indexOf("@")===-1&&X.indexOf(":")===-1)return new g({functionName:X});var Z=/((.*".+"[^@]*)?[^@]*)(?:@)/,H=X.match(Z),J=H&&H[1]?H[1]:void 0,K=this.extractLocation(X.replace(Z,""));return new g({functionName:J,fileName:K[0],lineNumber:K[1],columnNumber:K[2],source:X})},this)},"ErrorStackParser$$parseFFOrSafari")}}B(c,"ErrorStackParser");var N0=new c,R0=N0;function d(){if(typeof API<"u"&&API!==globalThis.API)return API.runtimeEnv;let G=typeof Bun<"u",Q=typeof Deno<"u",W=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&!1,z=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Chrome")===-1&&navigator.userAgent.indexOf("Safari")>-1;return l({IN_BUN:G,IN_DENO:Q,IN_NODE:W,IN_SAFARI:z,IN_SHELL:typeof read=="function"&&typeof load=="function"})}B(d,"getGlobalRuntimeEnv");var Y=d();function l(G){let Q=G.IN_NODE&&typeof p<"u"&&P0&&typeof f=="function"&&typeof __dirname=="string",W=G.IN_NODE&&!Q,z=!G.IN_NODE&&!G.IN_DENO&&!G.IN_BUN,X=z&&typeof window<"u"&&typeof window.document<"u"&&typeof document.createElement=="function"&&"sessionStorage"in window&&typeof globalThis.importScripts!="function",Z=z&&typeof globalThis.WorkerGlobalScope<"u"&&typeof globalThis.self<"u"&&globalThis.self instanceof globalThis.WorkerGlobalScope;return{...G,IN_BROWSER:z,IN_BROWSER_MAIN_THREAD:X,IN_BROWSER_WEB_WORKER:Z,IN_NODE_COMMONJS:Q,IN_NODE_ESM:W}}B(l,"calculateDerivedFlags");var s,P,a,m,v;async function y(){if(!Y.IN_NODE||(s=(await import("./chunk-zvesc6aa.js")).default,m=await import("node:fs"),v=await import("node:fs/promises"),a=(await import("node:vm")).default,P=await import("./chunk-az66snk4.js"),_=P.sep,typeof f<"u"))return;let G=m,Q=await import("./chunk-p8z2rk6s.js"),W=await import("ws"),z=await import("node:child_process"),X={fs:G,crypto:Q,ws:W,child_process:z};globalThis.require=function(Z){return X[Z]}}B(y,"initNodeModules");function i(G,Q){return P.resolve(Q||".",G)}B(i,"node_resolvePath");function o(G,Q){return Q===void 0&&(Q=location),new URL(G,Q).toString()}B(o,"browser_resolvePath");var S;Y.IN_NODE?S=i:Y.IN_SHELL?S=B((G)=>G,"resolvePath"):S=o;var _;Y.IN_NODE||(_="/");function n(G,Q){return G.startsWith("file://")&&(G=G.slice(7)),G.includes("://")?{response:fetch(G)}:{binary:v.readFile(G).then((W)=>new Uint8Array(W.buffer,W.byteOffset,W.byteLength))}}B(n,"node_getBinaryResponse");function r(G,Q){if(G.startsWith("file://")&&(G=G.slice(7)),G.includes("://"))throw Error("Shell cannot fetch urls");return{binary:Promise.resolve(new Uint8Array(readbuffer(G)))}}B(r,"shell_getBinaryResponse");function t(G,Q){let W=new URL(G,location);return{response:fetch(W,Q?{integrity:Q}:{})}}B(t,"browser_getBinaryResponse");var w;Y.IN_NODE?w=n:Y.IN_SHELL?w=r:w=t;async function e(G,Q){let{response:W,binary:z}=w(G,Q);if(z)return z;let X=await W;if(!X.ok)throw Error(`Failed to load '${G}': request failed.`);return new Uint8Array(await X.arrayBuffer())}B(e,"loadBinaryFile");var N;if(Y.IN_BROWSER_MAIN_THREAD)N=B(async(G)=>await import(G),"loadScript");else if(Y.IN_BROWSER_WEB_WORKER)N=B(async(G)=>{try{globalThis.importScripts(G)}catch(Q){if(Q instanceof TypeError)await import(G);else throw Q}},"loadScript");else if(Y.IN_NODE)N=G0;else if(Y.IN_SHELL)N=load;else throw Error("Cannot determine runtime environment");async function G0(G){G.startsWith("file://")&&(G=G.slice(7)),G.includes("://")?a.runInThisContext(await(await fetch(G)).text()):await import(s.pathToFileURL(G).href)}B(G0,"nodeLoadScript");async function Q0(G){if(Y.IN_NODE){await y();let Q=await v.readFile(G,{encoding:"utf8"});return JSON.parse(Q)}else if(Y.IN_SHELL){let Q=read(G);return JSON.parse(Q)}else return await(await fetch(G)).json()}B(Q0,"loadLockFile");async function W0(){if(Y.IN_NODE_COMMONJS)return __dirname;let G;try{throw Error()}catch(z){G=z}let Q=R0.parse(G)[0].fileName;if(Y.IN_NODE&&!Q.startsWith("file://")&&(Q=`file://${Q}`),Y.IN_NODE_ESM){let z=await import("./chunk-az66snk4.js");return(await import("./chunk-zvesc6aa.js")).fileURLToPath(z.dirname(Q))}let W=Q.lastIndexOf(_);if(W===-1)throw Error("Could not extract indexURL path from pyodide module location. Please pass the indexURL explicitly to loadPyodide.");return Q.slice(0,W)}B(W0,"calculateDirname");function X0(G){return G.substring(0,G.lastIndexOf("/")+1)||globalThis.location?.toString()||"."}B(X0,"calculateInstallBaseUrl");function Z0(G){let Q=G.FS,W=G.FS.filesystems.MEMFS,z=G.PATH,X={DIR_MODE:16895,FILE_MODE:33279,mount:B(function(Z){if(!Z.opts.fileSystemHandle)throw Error("opts.fileSystemHandle is required");return W.mount.apply(null,arguments)},"mount"),syncfs:B(async(Z,H,J)=>{try{let K=X.getLocalSet(Z),M=await X.getRemoteSet(Z),V=H?M:K,D=H?K:M;await X.reconcile(Z,V,D),J(null)}catch(K){J(K)}},"syncfs"),getLocalSet:B((Z)=>{let H=Object.create(null);function J(V){return V!=="."&&V!==".."}B(J,"isRealDir");function K(V){return(D)=>z.join2(V,D)}B(K,"toAbsolute");let M=Q.readdir(Z.mountpoint).filter(J).map(K(Z.mountpoint));for(;M.length;){let V=M.pop(),D=Q.stat(V);Q.isDir(D.mode)&&M.push.apply(M,Q.readdir(V).filter(J).map(K(V))),H[V]={timestamp:D.mtime,mode:D.mode}}return{type:"local",entries:H}},"getLocalSet"),getRemoteSet:B(async(Z)=>{let H=Object.create(null),J=await S0(Z.opts.fileSystemHandle);for(let[K,M]of J)K!=="."&&(H[z.join2(Z.mountpoint,K)]={timestamp:M.kind==="file"?new Date((await M.getFile()).lastModified):new Date,mode:M.kind==="file"?X.FILE_MODE:X.DIR_MODE});return{type:"remote",entries:H,handles:J}},"getRemoteSet"),loadLocalEntry:B((Z)=>{let H=Q.lookupPath(Z,{}).node,J=Q.stat(Z);if(Q.isDir(J.mode))return{timestamp:J.mtime,mode:J.mode};if(Q.isFile(J.mode))return H.contents=W.getFileDataAsTypedArray(H),{timestamp:J.mtime,mode:J.mode,contents:H.contents};throw Error("node type not supported")},"loadLocalEntry"),storeLocalEntry:B((Z,H)=>{if(Q.isDir(H.mode))Q.mkdirTree(Z,H.mode);else if(Q.isFile(H.mode))Q.writeFile(Z,H.contents,{canOwn:!0});else throw Error("node type not supported");Q.chmod(Z,H.mode),Q.utime(Z,H.timestamp,H.timestamp)},"storeLocalEntry"),removeLocalEntry:B((Z)=>{var H=Q.stat(Z);Q.isDir(H.mode)?Q.rmdir(Z):Q.isFile(H.mode)&&Q.unlink(Z)},"removeLocalEntry"),loadRemoteEntry:B(async(Z)=>{if(Z.kind==="file"){let H=await Z.getFile();return{contents:new Uint8Array(await H.arrayBuffer()),mode:X.FILE_MODE,timestamp:new Date(H.lastModified)}}else{if(Z.kind==="directory")return{mode:X.DIR_MODE,timestamp:new Date};throw Error("unknown kind: "+Z.kind)}},"loadRemoteEntry"),storeRemoteEntry:B(async(Z,H,J)=>{let K=Z.get(z.dirname(H)),M=Q.isFile(J.mode)?await K.getFileHandle(z.basename(H),{create:!0}):await K.getDirectoryHandle(z.basename(H),{create:!0});if(M.kind==="file"){let V=await M.createWritable();await V.write(J.contents),await V.close()}Z.set(H,M)},"storeRemoteEntry"),removeRemoteEntry:B(async(Z,H)=>{await Z.get(z.dirname(H)).removeEntry(z.basename(H)),Z.delete(H)},"removeRemoteEntry"),reconcile:B(async(Z,H,J)=>{let K=0,M=[];Object.keys(H.entries).forEach(function($){let q=H.entries[$],U=J.entries[$];(!U||Q.isFile(q.mode)&&q.timestamp.getTime()>U.timestamp.getTime())&&(M.push($),K++)}),M.sort();let V=[];if(Object.keys(J.entries).forEach(function($){H.entries[$]||(V.push($),K++)}),V.sort().reverse(),!K)return;let D=H.type==="remote"?H.handles:J.handles;for(let $ of M){let q=z.normalize($.replace(Z.mountpoint,"/")).substring(1);if(J.type==="local"){let U=D.get(q),L0=await X.loadRemoteEntry(U);X.storeLocalEntry($,L0)}else{let U=X.loadLocalEntry($);await X.storeRemoteEntry(D,q,U)}}for(let $ of V)if(J.type==="local")X.removeLocalEntry($);else{let q=z.normalize($.replace(Z.mountpoint,"/")).substring(1);await X.removeRemoteEntry(D,q)}},"reconcile")};G.FS.filesystems.NATIVEFS_ASYNC=X}B(Z0,"initializeNativeFS");var S0=B(async(G)=>{let Q=[];async function W(X){for await(let Z of X.values())Q.push(Z),Z.kind==="directory"&&await W(Z)}B(W,"collect"),await W(G);let z=new Map;z.set(".",G);for(let X of Q){let Z=(await G.resolve(X)).join("/");z.set(Z,X)}return z},"getFsHandles"),w0=F0("AGFzbQEAAAABDANfAGAAAW9gAW8BfwMDAgECByECD2NyZWF0ZV9zZW50aW5lbAAAC2lzX3NlbnRpbmVsAAEKEwIHAPsBAPsbCwkAIAD7GvsUAAs="),E0=async function(){if(!(globalThis.navigator&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&typeof navigator.maxTouchPoints<"u"&&navigator.maxTouchPoints>1)))try{let G=await WebAssembly.compile(w0);return await WebAssembly.instantiate(G)}catch(G){if(G instanceof WebAssembly.CompileError)return;throw G}}();async function z0(){let G=await E0;if(G)return G.exports;let Q=Symbol("error marker");return{create_sentinel:B(()=>Q,"create_sentinel"),is_sentinel:B((W)=>W===Q,"is_sentinel")}}B(z0,"getSentinelImport");function B0(G){let Q={config:G,runtimeEnv:Y},W={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Y0(G),print:G.stdout,printErr:G.stderr,onExit(z){W.exitCode=z},thisProgram:G._sysExecutable,arguments:G.args,API:Q,locateFile:B((z)=>G.indexURL+z,"locateFile"),instantiateWasm:$0(G.indexURL)};return W}B(B0,"createSettings");function H0(G){return function(Q){let W="/";try{Q.FS.mkdirTree(G)}catch(z){console.error(`Error occurred while making a home directory '${G}':`),console.error(z),console.error(`Using '${W}' for a home directory instead`),G=W}Q.FS.chdir(G)}}B(H0,"createHomeDirectory");function J0(G){return function(Q){Object.assign(Q.ENV,G)}}B(J0,"setEnvironment");function K0(G){return G?[async(Q)=>{Q.addRunDependency("fsInitHook");try{await G(Q.FS,{sitePackages:Q.API.sitePackages})}finally{Q.removeRunDependency("fsInitHook")}}]:[]}B(K0,"callFsInitHook");function M0(G){let Q=G.HEAPU32[G._Py_Version>>>2],W=Q>>>24&255,z=Q>>>16&255,X=Q>>>8&255;return[W,z,X]}B(M0,"computeVersionTuple");function V0(G){let Q=e(G);return async(W)=>{W.API.pyVersionTuple=M0(W);let[z,X]=W.API.pyVersionTuple;W.FS.mkdirTree("/lib"),W.API.sitePackages=`/lib/python${z}.${X}/site-packages`,W.FS.mkdirTree(W.API.sitePackages),W.addRunDependency("install-stdlib");try{let Z=await Q;W.FS.writeFile(`/lib/python${z}${X}.zip`,Z)}catch(Z){console.error("Error occurred while installing the standard library:"),console.error(Z)}finally{W.removeRunDependency("install-stdlib")}}}B(V0,"installStdlib");function Y0(G){let Q;return G.stdLibURL!=null?Q=G.stdLibURL:Q=G.indexURL+"python_stdlib.zip",[V0(Q),H0(G.env.HOME),J0(G.env),Z0,...K0(G.fsInit)]}B(Y0,"getFileSystemInitializationFuncs");function $0(G){if(typeof WasmOffsetConverter<"u")return;let{binary:Q,response:W}=w(G+"pyodide.asm.wasm"),z=z0();return function(X,Z){return async function(){X.sentinel=await z;try{let H;W?H=await WebAssembly.instantiateStreaming(W,X):H=await WebAssembly.instantiate(await Q,X);let{instance:J,module:K}=H;Z(J,K)}catch(H){console.warn("wasm instantiation failed!"),console.warn(H)}}(),{}}}B($0,"getInstantiateWasmFunc");var b0="0.29.2";function R(G){return G===void 0||G.endsWith("/")?G:G+"/"}B(R,"withTrailingSlash");var h=b0;async function j0(G={}){if(await y(),G.lockFileContents&&G.lockFileURL)throw Error("Can't pass both lockFileContents and lockFileURL");let Q=G.indexURL||await W0();if(Q=R(S(Q)),G.packageBaseUrl=R(G.packageBaseUrl),G.cdnUrl=R(G.packageBaseUrl??`https://cdn.jsdelivr.net/pyodide/v${h}/full/`),!G.lockFileContents){let X=G.lockFileURL??Q+"pyodide-lock.json";G.lockFileContents=Q0(X),G.packageBaseUrl??=X0(X)}G.indexURL=Q,G.packageCacheDir&&(G.packageCacheDir=R(S(G.packageCacheDir)));let W={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?()=>globalThis.prompt():void 0,args:[],env:{},packages:[],packageCacheDir:G.packageBaseUrl,enableRunUntilComplete:!0,checkAPIVersion:!0,BUILD_ID:"02af97d1069c4309880e46f2948861ea1faae5dbb49c20d5d5970aa9ae912fd4"},z=Object.assign(W,G);return z.env.HOME??="/home/pyodide",z.env.PYTHONINSPECT??="1",z}B(j0,"initializeConfiguration");function C0(G){let Q=B0(G),W=Q.API;return W.lockFilePromise=Promise.resolve(G.lockFileContents),Q}B(C0,"createEmscriptenSettings");async function D0(G){if(typeof _createPyodideModule!="function"){let Q=`${G.indexURL}pyodide.asm.js`;await N(Q)}}B(D0,"loadWasmScript");async function O0(G,Q){if(!G._loadSnapshot)return;let W=await G._loadSnapshot,z=ArrayBuffer.isView(W)?W:new Uint8Array(W);return Q.noInitialRun=!0,Q.INITIAL_MEMORY=z.length,z}B(O0,"prepareSnapshot");async function T0(G){let Q=await _createPyodideModule(G);if(G.exitCode!==void 0)throw new Q.ExitStatus(G.exitCode);return Q}B(T0,"createPyodideModule");function q0(G,Q){let W=G.API;if(Q.pyproxyToStringRepr&&W.setPyProxyToStringMethod(!0),Q.convertNullToNone&&W.setCompatNullToNone(!0),Q.toJsLiteralMap&&W.setCompatToJsLiteralMap(!0),W.version!==h&&Q.checkAPIVersion)throw Error(`Pyodide version does not match: '${h}' <==> '${W.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);G.locateFile=(z)=>{throw z.endsWith(".so")?Error(`Failed to find dynamic library "${z}"`):Error(`Unexpected call to locateFile("${z}")`)}}B(q0,"configureAPI");function x0(G,Q,W){let z=G.API,X;return Q&&(X=z.restoreSnapshot(Q)),z.finalizeBootstrap(X,W._snapshotDeserializer)}B(x0,"bootstrapPyodide");async function A0(G,Q){let W=G._api;return W.sys.path.insert(0,""),W._pyodide.set_excepthook(),await W.packageIndexReady,W.initializeStreams(Q.stdin,Q.stdout,Q.stderr),G}B(A0,"finalizeSetup");async function g0(G={}){let Q=await j0(G),W=C0(Q);await D0(Q);let z=await O0(Q,W),X=await T0(W);q0(X,Q);let Z=x0(X,z,Q);return await A0(Z,Q)}B(g0,"loadPyodide");export{h as version,g0 as loadPyodide};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as h0,c as iY,d as $X,e as KX,f as GJ}from"./chunk-cmrefyz7.js";var FU={};$X(FU,{transcode:()=>qY,resolveObjectURL:()=>MY,kStringMaxLength:()=>zZ,kMaxLength:()=>rU,isUtf8:()=>SY,isAscii:()=>RY,default:()=>PY,constants:()=>rQ,btoa:()=>nQ,atob:()=>mQ,INSPECT_MAX_BYTES:()=>DZ,File:()=>sQ,Buffer:()=>$0,Blob:()=>tQ});function uQ(I){var O=I.length;if(O%4>0)throw Error("Invalid string. Length must be a multiple of 4");var F=I.indexOf("=");if(F===-1)F=O;var T=F===O?0:4-F%4;return[F,T]}function bQ(I,O){return(I+O)*3/4-O}function lQ(I){var O,F=uQ(I),T=F[0],H=F[1],E=new Uint8Array(bQ(T,H)),V=0,P=H>0?T-4:T,q;for(q=0;q<P;q+=4)O=PU[I.charCodeAt(q)]<<18|PU[I.charCodeAt(q+1)]<<12|PU[I.charCodeAt(q+2)]<<6|PU[I.charCodeAt(q+3)],E[V++]=O>>16&255,E[V++]=O>>8&255,E[V++]=O&255;if(H===2)O=PU[I.charCodeAt(q)]<<2|PU[I.charCodeAt(q+1)]>>4,E[V++]=O&255;if(H===1)O=PU[I.charCodeAt(q)]<<10|PU[I.charCodeAt(q+1)]<<4|PU[I.charCodeAt(q+2)]>>2,E[V++]=O>>8&255,E[V++]=O&255;return E}function dQ(I){return jU[I>>18&63]+jU[I>>12&63]+jU[I>>6&63]+jU[I&63]}function oQ(I,O,F){var T,H=[];for(var E=O;E<F;E+=3)T=(I[E]<<16&16711680)+(I[E+1]<<8&65280)+(I[E+2]&255),H.push(dQ(T));return H.join("")}function WZ(I){var O,F=I.length,T=F%3,H=[],E=16383;for(var V=0,P=F-T;V<P;V+=E)H.push(oQ(I,V,V+E>P?P:V+E));if(T===1)O=I[F-1],H.push(jU[O>>2]+jU[O<<4&63]+"==");else if(T===2)O=(I[F-2]<<8)+I[F-1],H.push(jU[O>>10]+jU[O>>4&63]+jU[O<<2&63]+"=");return H.join("")}function OX(I,O,F,T,H){var E,V,P=H*8-T-1,q=(1<<P)-1,L=q>>1,z=-7,C=F?H-1:0,D=F?-1:1,S=I[O+C];C+=D,E=S&(1<<-z)-1,S>>=-z,z+=P;for(;z>0;E=E*256+I[O+C],C+=D,z-=8);V=E&(1<<-z)-1,E>>=-z,z+=T;for(;z>0;V=V*256+I[O+C],C+=D,z-=8);if(E===0)E=1-L;else if(E===q)return V?NaN:(S?-1:1)*(1/0);else V=V+Math.pow(2,T),E=E-L;return(S?-1:1)*V*Math.pow(2,E-T)}function TZ(I,O,F,T,H,E){var V,P,q,L=E*8-H-1,z=(1<<L)-1,C=z>>1,D=H===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=T?0:E-1,R=T?1:-1,v=O<0||O===0&&1/O<0?1:0;if(O=Math.abs(O),isNaN(O)||O===1/0)P=isNaN(O)?1:0,V=z;else{if(V=Math.floor(Math.log(O)/Math.LN2),O*(q=Math.pow(2,-V))<1)V--,q*=2;if(V+C>=1)O+=D/q;else O+=D*Math.pow(2,1-C);if(O*q>=2)V++,q/=2;if(V+C>=z)P=0,V=z;else if(V+C>=1)P=(O*q-1)*Math.pow(2,H),V=V+C;else P=O*Math.pow(2,C-1)*Math.pow(2,H),V=0}for(;H>=8;I[F+S]=P&255,S+=R,P/=256,H-=8);V=V<<H|P,L+=H;for(;L>0;I[F+S]=V&255,S+=R,V/=256,L-=8);I[F+S-R]|=v*128}function BU(I){if(I>rU)throw RangeError('The value "'+I+'" is invalid for option "size"');let O=new Uint8Array(I);return Object.setPrototypeOf(O,$0.prototype),O}function wX(I,O,F){return class extends F{constructor(){super();Object.defineProperty(this,"message",{value:O.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${I}]`,this.stack,delete this.name}get code(){return I}set code(T){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:T,writable:!0})}toString(){return`${this.name} [${I}]: ${this.message}`}}}function $0(I,O,F){if(typeof I==="number"){if(typeof O==="string")throw TypeError('The "string" argument must be of type string. Received type number');return yX(I)}return LZ(I,O,F)}function LZ(I,O,F){if(typeof I==="string")return UY(I,O);if(ArrayBuffer.isView(I))return XY(I);if(I==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I);if(vU(I,ArrayBuffer)||I&&vU(I.buffer,ArrayBuffer))return NX(I,O,F);if(typeof SharedArrayBuffer<"u"&&(vU(I,SharedArrayBuffer)||I&&vU(I.buffer,SharedArrayBuffer)))return NX(I,O,F);if(typeof I==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let T=I.valueOf&&I.valueOf();if(T!=null&&T!==I)return $0.from(T,O,F);let H=ZY(I);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof I[Symbol.toPrimitive]==="function")return $0.from(I[Symbol.toPrimitive]("string"),O,F);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I)}function EZ(I){if(typeof I!=="number")throw TypeError('"size" argument must be of type number');else if(I<0)throw RangeError('The value "'+I+'" is invalid for option "size"')}function iQ(I,O,F){if(EZ(I),I<=0)return BU(I);if(O!==void 0)return typeof F==="string"?BU(I).fill(O,F):BU(I).fill(O);return BU(I)}function yX(I){return EZ(I),BU(I<0?0:fX(I)|0)}function UY(I,O){if(typeof O!=="string"||O==="")O="utf8";if(!$0.isEncoding(O))throw TypeError("Unknown encoding: "+O);let F=MZ(I,O)|0,T=BU(F),H=T.write(I,O);if(H!==F)T=T.slice(0,H);return T}function xX(I){let O=I.length<0?0:fX(I.length)|0,F=BU(O);for(let T=0;T<O;T+=1)F[T]=I[T]&255;return F}function XY(I){if(vU(I,Uint8Array)){let O=new Uint8Array(I);return NX(O.buffer,O.byteOffset,O.byteLength)}return xX(I)}function NX(I,O,F){if(O<0||I.byteLength<O)throw RangeError('"offset" is outside of buffer bounds');if(I.byteLength<O+(F||0))throw RangeError('"length" is outside of buffer bounds');let T;if(O===void 0&&F===void 0)T=new Uint8Array(I);else if(F===void 0)T=new Uint8Array(I,O);else T=new Uint8Array(I,O,F);return Object.setPrototypeOf(T,$0.prototype),T}function ZY(I){if($0.isBuffer(I)){let O=fX(I.length)|0,F=BU(O);if(F.length===0)return F;return I.copy(F,0,0,O),F}if(I.length!==void 0){if(typeof I.length!=="number"||Number.isNaN(I.length))return BU(0);return xX(I)}if(I.type==="Buffer"&&Array.isArray(I.data))return xX(I.data)}function fX(I){if(I>=rU)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+rU.toString(16)+" bytes");return I|0}function MZ(I,O){if($0.isBuffer(I))return I.length;if(ArrayBuffer.isView(I)||vU(I,ArrayBuffer))return I.byteLength;if(typeof I!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof I);let F=I.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&F===0)return 0;let H=!1;for(;;)switch(O){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return gX(I).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F*2;case"hex":return F>>>1;case"base64":return BZ(I).length;default:if(H)return T?-1:gX(I).length;O=(""+O).toLowerCase(),H=!0}}function QY(I,O,F){let T=!1;if(O===void 0||O<0)O=0;if(O>this.length)return"";if(F===void 0||F>this.length)F=this.length;if(F<=0)return"";if(F>>>=0,O>>>=0,F<=O)return"";if(!I)I="utf8";while(!0)switch(I){case"hex":return FY(this,O,F);case"utf8":case"utf-8":return RZ(this,O,F);case"ascii":return OY(this,O,F);case"latin1":case"binary":return WY(this,O,F);case"base64":return $Y(this,O,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return HY(this,O,F);default:if(T)throw TypeError("Unknown encoding: "+I);I=(I+"").toLowerCase(),T=!0}}function hU(I,O,F){let T=I[O];I[O]=I[F],I[F]=T}function SZ(I,O,F,T,H){if(I.length===0)return-1;if(typeof F==="string")T=F,F=0;else if(F>2147483647)F=2147483647;else if(F<-2147483648)F=-2147483648;if(F=+F,Number.isNaN(F))F=H?0:I.length-1;if(F<0)F=I.length+F;if(F>=I.length)if(H)return-1;else F=I.length-1;else if(F<0)if(H)F=0;else return-1;if(typeof O==="string")O=$0.from(O,T);if($0.isBuffer(O)){if(O.length===0)return-1;return HZ(I,O,F,T,H)}else if(typeof O==="number"){if(O=O&255,typeof Uint8Array.prototype.indexOf==="function")if(H)return Uint8Array.prototype.indexOf.call(I,O,F);else return Uint8Array.prototype.lastIndexOf.call(I,O,F);return HZ(I,[O],F,T,H)}throw TypeError("val must be string, number or Buffer")}function HZ(I,O,F,T,H){let E=1,V=I.length,P=O.length;if(T!==void 0){if(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le"){if(I.length<2||O.length<2)return-1;E=2,V/=2,P/=2,F/=2}}function q(z,C){if(E===1)return z[C];else return z.readUInt16BE(C*E)}let L;if(H){let z=-1;for(L=F;L<V;L++)if(q(I,L)===q(O,z===-1?0:L-z)){if(z===-1)z=L;if(L-z+1===P)return z*E}else{if(z!==-1)L-=L-z;z=-1}}else{if(F+P>V)F=V-P;for(L=F;L>=0;L--){let z=!0;for(let C=0;C<P;C++)if(q(I,L+C)!==q(O,C)){z=!1;break}if(z)return L}}return-1}function YY(I,O,F,T){F=Number(F)||0;let H=I.length-F;if(!T)T=H;else if(T=Number(T),T>H)T=H;let E=O.length;if(T>E/2)T=E/2;let V;for(V=0;V<T;++V){let P=parseInt(O.substr(V*2,2),16);if(Number.isNaN(P))return V;I[F+V]=P}return V}function JY(I,O,F,T){return WX(gX(O,I.length-F),I,F,T)}function VY(I,O,F,T){return WX(DY(O),I,F,T)}function GY(I,O,F,T){return WX(BZ(O),I,F,T)}function IY(I,O,F,T){return WX(zY(O,I.length-F),I,F,T)}function $Y(I,O,F){if(O===0&&F===I.length)return WZ(I);else return WZ(I.slice(O,F))}function RZ(I,O,F){F=Math.min(I.length,F);let T=[],H=O;while(H<F){let E=I[H],V=null,P=E>239?4:E>223?3:E>191?2:1;if(H+P<=F){let q,L,z,C;switch(P){case 1:if(E<128)V=E;break;case 2:if(q=I[H+1],(q&192)===128){if(C=(E&31)<<6|q&63,C>127)V=C}break;case 3:if(q=I[H+1],L=I[H+2],(q&192)===128&&(L&192)===128){if(C=(E&15)<<12|(q&63)<<6|L&63,C>2047&&(C<55296||C>57343))V=C}break;case 4:if(q=I[H+1],L=I[H+2],z=I[H+3],(q&192)===128&&(L&192)===128&&(z&192)===128){if(C=(E&15)<<18|(q&63)<<12|(L&63)<<6|z&63,C>65535&&C<1114112)V=C}}}if(V===null)V=65533,P=1;else if(V>65535)V-=65536,T.push(V>>>10&1023|55296),V=56320|V&1023;T.push(V),H+=P}return KY(T)}function KY(I){let O=I.length;if(O<=CZ)return String.fromCharCode.apply(String,I);let F="",T=0;while(T<O)F+=String.fromCharCode.apply(String,I.slice(T,T+=CZ));return F}function OY(I,O,F){let T="";F=Math.min(I.length,F);for(let H=O;H<F;++H)T+=String.fromCharCode(I[H]&127);return T}function WY(I,O,F){let T="";F=Math.min(I.length,F);for(let H=O;H<F;++H)T+=String.fromCharCode(I[H]);return T}function FY(I,O,F){let T=I.length;if(!O||O<0)O=0;if(!F||F<0||F>T)F=T;let H="";for(let E=O;E<F;++E)H+=LY[I[E]];return H}function HY(I,O,F){let T=I.slice(O,F),H="";for(let E=0;E<T.length-1;E+=2)H+=String.fromCharCode(T[E]+T[E+1]*256);return H}function WU(I,O,F){if(I%1!==0||I<0)throw RangeError("offset is not uint");if(I+O>F)throw RangeError("Trying to access beyond buffer length")}function EU(I,O,F,T,H,E){if(!$0.isBuffer(I))throw TypeError('"buffer" argument must be a Buffer instance');if(O>H||O<E)throw RangeError('"value" argument is out of bounds');if(F+T>I.length)throw RangeError("Index out of range")}function qZ(I,O,F,T,H){_Z(O,T,H,I,F,7);let E=Number(O&BigInt(4294967295));I[F++]=E,E=E>>8,I[F++]=E,E=E>>8,I[F++]=E,E=E>>8,I[F++]=E;let V=Number(O>>BigInt(32)&BigInt(4294967295));return I[F++]=V,V=V>>8,I[F++]=V,V=V>>8,I[F++]=V,V=V>>8,I[F++]=V,F}function PZ(I,O,F,T,H){_Z(O,T,H,I,F,7);let E=Number(O&BigInt(4294967295));I[F+7]=E,E=E>>8,I[F+6]=E,E=E>>8,I[F+5]=E,E=E>>8,I[F+4]=E;let V=Number(O>>BigInt(32)&BigInt(4294967295));return I[F+3]=V,V=V>>8,I[F+2]=V,V=V>>8,I[F+1]=V,V=V>>8,I[F]=V,F+8}function kZ(I,O,F,T,H,E){if(F+T>I.length)throw RangeError("Index out of range");if(F<0)throw RangeError("Index out of range")}function jZ(I,O,F,T,H){if(O=+O,F=F>>>0,!H)kZ(I,O,F,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return TZ(I,O,F,T,23,4),F+4}function vZ(I,O,F,T,H){if(O=+O,F=F>>>0,!H)kZ(I,O,F,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return TZ(I,O,F,T,52,8),F+8}function AZ(I){let O="",F=I.length,T=I[0]==="-"?1:0;for(;F>=T+4;F-=3)O=`_${I.slice(F-3,F)}${O}`;return`${I.slice(0,F)}${O}`}function CY(I,O,F){if(oU(O,"offset"),I[O]===void 0||I[O+F]===void 0)aU(O,I.length-(F+1))}function _Z(I,O,F,T,H,E){if(I>F||I<O){let V=typeof O==="bigint"?"n":"",P;if(E>3)if(O===0||O===BigInt(0))P=`>= 0${V} and < 2${V} ** ${(E+1)*8}${V}`;else P=`>= -(2${V} ** ${(E+1)*8-1}${V}) and < 2 ** ${(E+1)*8-1}${V}`;else P=`>= ${O}${V} and <= ${F}${V}`;throw new BX("value",P,I)}CY(T,H,E)}function oU(I,O){if(typeof I!=="number")throw new eQ(O,"number",I)}function aU(I,O,F){if(Math.floor(I)!==I)throw oU(I,F),new BX(F||"offset","an integer",I);if(O<0)throw new aQ;throw new BX(F||"offset",`>= ${F?1:0} and <= ${O}`,I)}function TY(I){if(I=I.split("=")[0],I=I.trim().replace(AY,""),I.length<2)return"";while(I.length%4!==0)I=I+"=";return I}function gX(I,O){O=O||1/0;let F,T=I.length,H=null,E=[];for(let V=0;V<T;++V){if(F=I.charCodeAt(V),F>55295&&F<57344){if(!H){if(F>56319){if((O-=3)>-1)E.push(239,191,189);continue}else if(V+1===T){if((O-=3)>-1)E.push(239,191,189);continue}H=F;continue}if(F<56320){if((O-=3)>-1)E.push(239,191,189);H=F;continue}F=(H-55296<<10|F-56320)+65536}else if(H){if((O-=3)>-1)E.push(239,191,189)}if(H=null,F<128){if((O-=1)<0)break;E.push(F)}else if(F<2048){if((O-=2)<0)break;E.push(F>>6|192,F&63|128)}else if(F<65536){if((O-=3)<0)break;E.push(F>>12|224,F>>6&63|128,F&63|128)}else if(F<1114112){if((O-=4)<0)break;E.push(F>>18|240,F>>12&63|128,F>>6&63|128,F&63|128)}else throw Error("Invalid code point")}return E}function DY(I){let O=[];for(let F=0;F<I.length;++F)O.push(I.charCodeAt(F)&255);return O}function zY(I,O){let F,T,H,E=[];for(let V=0;V<I.length;++V){if((O-=2)<0)break;F=I.charCodeAt(V),T=F>>8,H=F%256,E.push(H),E.push(T)}return E}function BZ(I){return lQ(TY(I))}function WX(I,O,F,T){let H;for(H=0;H<T;++H){if(H+F>=O.length||H>=I.length)break;O[H+F]=I[H]}return H}function vU(I,O){return I instanceof O||I!=null&&I.constructor!=null&&I.constructor.name!=null&&I.constructor.name===O.name}function wU(I){return typeof BigInt>"u"?EY:I}function EY(){throw Error("BigInt not supported")}function cX(I){return()=>{throw Error(I+" is not implemented for node:buffer browser polyfill")}}var jU,PU,_X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pU,OZ,FZ,DZ=50,rU=2147483647,zZ=536870888,nQ,mQ,sQ,tQ,rQ,aQ,eQ,BX,CZ=4096,AY,LY,MY,SY,RY=(I)=>{for(let O of I)if(O.charCodeAt(0)>127)return!1;return!0},qY,PY;var HU=KX(()=>{jU=[],PU=[];for(pU=0,OZ=_X.length;pU<OZ;++pU)jU[pU]=_X[pU],PU[_X.charCodeAt(pU)]=pU;PU[45]=62;PU[95]=63;FZ=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,nQ=globalThis.btoa,mQ=globalThis.atob,sQ=globalThis.File,tQ=globalThis.Blob,rQ={MAX_LENGTH:rU,MAX_STRING_LENGTH:zZ};aQ=wX("ERR_BUFFER_OUT_OF_BOUNDS",function(I){if(I)return`${I} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),eQ=wX("ERR_INVALID_ARG_TYPE",function(I,O){return`The "${I}" argument must be of type number. Received type ${typeof O}`},TypeError),BX=wX("ERR_OUT_OF_RANGE",function(I,O,F){let T=`The value of "${I}" is out of range.`,H=F;if(Number.isInteger(F)&&Math.abs(F)>4294967296)H=AZ(String(F));else if(typeof F==="bigint"){if(H=String(F),F>BigInt(2)**BigInt(32)||F<-(BigInt(2)**BigInt(32)))H=AZ(H);H+="n"}return T+=` It must be ${O}. Received ${H}`,T},RangeError);Object.defineProperty($0.prototype,"parent",{enumerable:!0,get:function(){if(!$0.isBuffer(this))return;return this.buffer}});Object.defineProperty($0.prototype,"offset",{enumerable:!0,get:function(){if(!$0.isBuffer(this))return;return this.byteOffset}});$0.poolSize=8192;$0.from=function(I,O,F){return LZ(I,O,F)};Object.setPrototypeOf($0.prototype,Uint8Array.prototype);Object.setPrototypeOf($0,Uint8Array);$0.alloc=function(I,O,F){return iQ(I,O,F)};$0.allocUnsafe=function(I){return yX(I)};$0.allocUnsafeSlow=function(I){return yX(I)};$0.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==$0.prototype};$0.compare=function(I,O){if(vU(I,Uint8Array))I=$0.from(I,I.offset,I.byteLength);if(vU(O,Uint8Array))O=$0.from(O,O.offset,O.byteLength);if(!$0.isBuffer(I)||!$0.isBuffer(O))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===O)return 0;let F=I.length,T=O.length;for(let H=0,E=Math.min(F,T);H<E;++H)if(I[H]!==O[H]){F=I[H],T=O[H];break}if(F<T)return-1;if(T<F)return 1;return 0};$0.isEncoding=function(I){switch(String(I).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};$0.concat=function(I,O){if(!Array.isArray(I))throw TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return $0.alloc(0);let F;if(O===void 0){O=0;for(F=0;F<I.length;++F)O+=I[F].length}let T=$0.allocUnsafe(O),H=0;for(F=0;F<I.length;++F){let E=I[F];if(vU(E,Uint8Array))if(H+E.length>T.length){if(!$0.isBuffer(E))E=$0.from(E);E.copy(T,H)}else Uint8Array.prototype.set.call(T,E,H);else if(!$0.isBuffer(E))throw TypeError('"list" argument must be an Array of Buffers');else E.copy(T,H);H+=E.length}return T};$0.byteLength=MZ;$0.prototype._isBuffer=!0;$0.prototype.swap16=function(){let I=this.length;if(I%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<I;O+=2)hU(this,O,O+1);return this};$0.prototype.swap32=function(){let I=this.length;if(I%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<I;O+=4)hU(this,O,O+3),hU(this,O+1,O+2);return this};$0.prototype.swap64=function(){let I=this.length;if(I%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<I;O+=8)hU(this,O,O+7),hU(this,O+1,O+6),hU(this,O+2,O+5),hU(this,O+3,O+4);return this};$0.prototype.toString=function(){let I=this.length;if(I===0)return"";if(arguments.length===0)return RZ(this,0,I);return QY.apply(this,arguments)};$0.prototype.toLocaleString=$0.prototype.toString;$0.prototype.equals=function(I){if(!$0.isBuffer(I))throw TypeError("Argument must be a Buffer");if(this===I)return!0;return $0.compare(this,I)===0};$0.prototype.inspect=function(){let I="",O=DZ;if(I=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O)I+=" ... ";return"<Buffer "+I+">"};if(FZ)$0.prototype[FZ]=$0.prototype.inspect;$0.prototype.compare=function(I,O,F,T,H){if(vU(I,Uint8Array))I=$0.from(I,I.offset,I.byteLength);if(!$0.isBuffer(I))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(O===void 0)O=0;if(F===void 0)F=I?I.length:0;if(T===void 0)T=0;if(H===void 0)H=this.length;if(O<0||F>I.length||T<0||H>this.length)throw RangeError("out of range index");if(T>=H&&O>=F)return 0;if(T>=H)return-1;if(O>=F)return 1;if(O>>>=0,F>>>=0,T>>>=0,H>>>=0,this===I)return 0;let E=H-T,V=F-O,P=Math.min(E,V),q=this.slice(T,H),L=I.slice(O,F);for(let z=0;z<P;++z)if(q[z]!==L[z]){E=q[z],V=L[z];break}if(E<V)return-1;if(V<E)return 1;return 0};$0.prototype.includes=function(I,O,F){return this.indexOf(I,O,F)!==-1};$0.prototype.indexOf=function(I,O,F){return SZ(this,I,O,F,!0)};$0.prototype.lastIndexOf=function(I,O,F){return SZ(this,I,O,F,!1)};$0.prototype.write=function(I,O,F,T){if(O===void 0)T="utf8",F=this.length,O=0;else if(F===void 0&&typeof O==="string")T=O,F=this.length,O=0;else if(isFinite(O))if(O=O>>>0,isFinite(F)){if(F=F>>>0,T===void 0)T="utf8"}else T=F,F=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-O;if(F===void 0||F>H)F=H;if(I.length>0&&(F<0||O<0)||O>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!T)T="utf8";let E=!1;for(;;)switch(T){case"hex":return YY(this,I,O,F);case"utf8":case"utf-8":return JY(this,I,O,F);case"ascii":case"latin1":case"binary":return VY(this,I,O,F);case"base64":return GY(this,I,O,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return IY(this,I,O,F);default:if(E)throw TypeError("Unknown encoding: "+T);T=(""+T).toLowerCase(),E=!0}};$0.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};$0.prototype.slice=function(I,O){let F=this.length;if(I=~~I,O=O===void 0?F:~~O,I<0){if(I+=F,I<0)I=0}else if(I>F)I=F;if(O<0){if(O+=F,O<0)O=0}else if(O>F)O=F;if(O<I)O=I;let T=this.subarray(I,O);return Object.setPrototypeOf(T,$0.prototype),T};$0.prototype.readUintLE=$0.prototype.readUIntLE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=this[I],H=1,E=0;while(++E<O&&(H*=256))T+=this[I+E]*H;return T};$0.prototype.readUintBE=$0.prototype.readUIntBE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=this[I+--O],H=1;while(O>0&&(H*=256))T+=this[I+--O]*H;return T};$0.prototype.readUint8=$0.prototype.readUInt8=function(I,O){if(I=I>>>0,!O)WU(I,1,this.length);return this[I]};$0.prototype.readUint16LE=$0.prototype.readUInt16LE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);return this[I]|this[I+1]<<8};$0.prototype.readUint16BE=$0.prototype.readUInt16BE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);return this[I]<<8|this[I+1]};$0.prototype.readUint32LE=$0.prototype.readUInt32LE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216};$0.prototype.readUint32BE=$0.prototype.readUInt32BE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])};$0.prototype.readBigUInt64LE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=O+this[++I]*256+this[++I]*65536+this[++I]*16777216,H=this[++I]+this[++I]*256+this[++I]*65536+F*16777216;return BigInt(T)+(BigInt(H)<<BigInt(32))});$0.prototype.readBigUInt64BE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=O*16777216+this[++I]*65536+this[++I]*256+this[++I],H=this[++I]*16777216+this[++I]*65536+this[++I]*256+F;return(BigInt(T)<<BigInt(32))+BigInt(H)});$0.prototype.readIntLE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=this[I],H=1,E=0;while(++E<O&&(H*=256))T+=this[I+E]*H;if(H*=128,T>=H)T-=Math.pow(2,8*O);return T};$0.prototype.readIntBE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=O,H=1,E=this[I+--T];while(T>0&&(H*=256))E+=this[I+--T]*H;if(H*=128,E>=H)E-=Math.pow(2,8*O);return E};$0.prototype.readInt8=function(I,O){if(I=I>>>0,!O)WU(I,1,this.length);if(!(this[I]&128))return this[I];return(255-this[I]+1)*-1};$0.prototype.readInt16LE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);let F=this[I]|this[I+1]<<8;return F&32768?F|4294901760:F};$0.prototype.readInt16BE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);let F=this[I+1]|this[I]<<8;return F&32768?F|4294901760:F};$0.prototype.readInt32LE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24};$0.prototype.readInt32BE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]};$0.prototype.readBigInt64LE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=this[I+4]+this[I+5]*256+this[I+6]*65536+(F<<24);return(BigInt(T)<<BigInt(32))+BigInt(O+this[++I]*256+this[++I]*65536+this[++I]*16777216)});$0.prototype.readBigInt64BE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=(O<<24)+this[++I]*65536+this[++I]*256+this[++I];return(BigInt(T)<<BigInt(32))+BigInt(this[++I]*16777216+this[++I]*65536+this[++I]*256+F)});$0.prototype.readFloatLE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return OX(this,I,!0,23,4)};$0.prototype.readFloatBE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return OX(this,I,!1,23,4)};$0.prototype.readDoubleLE=function(I,O){if(I=I>>>0,!O)WU(I,8,this.length);return OX(this,I,!0,52,8)};$0.prototype.readDoubleBE=function(I,O){if(I=I>>>0,!O)WU(I,8,this.length);return OX(this,I,!1,52,8)};$0.prototype.writeUintLE=$0.prototype.writeUIntLE=function(I,O,F,T){if(I=+I,O=O>>>0,F=F>>>0,!T){let V=Math.pow(2,8*F)-1;EU(this,I,O,F,V,0)}let H=1,E=0;this[O]=I&255;while(++E<F&&(H*=256))this[O+E]=I/H&255;return O+F};$0.prototype.writeUintBE=$0.prototype.writeUIntBE=function(I,O,F,T){if(I=+I,O=O>>>0,F=F>>>0,!T){let V=Math.pow(2,8*F)-1;EU(this,I,O,F,V,0)}let H=F-1,E=1;this[O+H]=I&255;while(--H>=0&&(E*=256))this[O+H]=I/E&255;return O+F};$0.prototype.writeUint8=$0.prototype.writeUInt8=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,1,255,0);return this[O]=I&255,O+1};$0.prototype.writeUint16LE=$0.prototype.writeUInt16LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,65535,0);return this[O]=I&255,this[O+1]=I>>>8,O+2};$0.prototype.writeUint16BE=$0.prototype.writeUInt16BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,65535,0);return this[O]=I>>>8,this[O+1]=I&255,O+2};$0.prototype.writeUint32LE=$0.prototype.writeUInt32LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,4294967295,0);return this[O+3]=I>>>24,this[O+2]=I>>>16,this[O+1]=I>>>8,this[O]=I&255,O+4};$0.prototype.writeUint32BE=$0.prototype.writeUInt32BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,4294967295,0);return this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4};$0.prototype.writeBigUInt64LE=wU(function(I,O=0){return qZ(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))});$0.prototype.writeBigUInt64BE=wU(function(I,O=0){return PZ(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))});$0.prototype.writeIntLE=function(I,O,F,T){if(I=+I,O=O>>>0,!T){let P=Math.pow(2,8*F-1);EU(this,I,O,F,P-1,-P)}let H=0,E=1,V=0;this[O]=I&255;while(++H<F&&(E*=256)){if(I<0&&V===0&&this[O+H-1]!==0)V=1;this[O+H]=(I/E>>0)-V&255}return O+F};$0.prototype.writeIntBE=function(I,O,F,T){if(I=+I,O=O>>>0,!T){let P=Math.pow(2,8*F-1);EU(this,I,O,F,P-1,-P)}let H=F-1,E=1,V=0;this[O+H]=I&255;while(--H>=0&&(E*=256)){if(I<0&&V===0&&this[O+H+1]!==0)V=1;this[O+H]=(I/E>>0)-V&255}return O+F};$0.prototype.writeInt8=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,1,127,-128);if(I<0)I=255+I+1;return this[O]=I&255,O+1};$0.prototype.writeInt16LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,32767,-32768);return this[O]=I&255,this[O+1]=I>>>8,O+2};$0.prototype.writeInt16BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,32767,-32768);return this[O]=I>>>8,this[O+1]=I&255,O+2};$0.prototype.writeInt32LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,2147483647,-2147483648);return this[O]=I&255,this[O+1]=I>>>8,this[O+2]=I>>>16,this[O+3]=I>>>24,O+4};$0.prototype.writeInt32BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,2147483647,-2147483648);if(I<0)I=4294967295+I+1;return this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4};$0.prototype.writeBigInt64LE=wU(function(I,O=0){return qZ(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});$0.prototype.writeBigInt64BE=wU(function(I,O=0){return PZ(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});$0.prototype.writeFloatLE=function(I,O,F){return jZ(this,I,O,!0,F)};$0.prototype.writeFloatBE=function(I,O,F){return jZ(this,I,O,!1,F)};$0.prototype.writeDoubleLE=function(I,O,F){return vZ(this,I,O,!0,F)};$0.prototype.writeDoubleBE=function(I,O,F){return vZ(this,I,O,!1,F)};$0.prototype.copy=function(I,O,F,T){if(!$0.isBuffer(I))throw TypeError("argument should be a Buffer");if(!F)F=0;if(!T&&T!==0)T=this.length;if(O>=I.length)O=I.length;if(!O)O=0;if(T>0&&T<F)T=F;if(T===F)return 0;if(I.length===0||this.length===0)return 0;if(O<0)throw RangeError("targetStart out of bounds");if(F<0||F>=this.length)throw RangeError("Index out of range");if(T<0)throw RangeError("sourceEnd out of bounds");if(T>this.length)T=this.length;if(I.length-O<T-F)T=I.length-O+F;let H=T-F;if(this===I&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(O,F,T);else Uint8Array.prototype.set.call(I,this.subarray(F,T),O);return H};$0.prototype.fill=function(I,O,F,T){if(typeof I==="string"){if(typeof O==="string")T=O,O=0,F=this.length;else if(typeof F==="string")T=F,F=this.length;if(T!==void 0&&typeof T!=="string")throw TypeError("encoding must be a string");if(typeof T==="string"&&!$0.isEncoding(T))throw TypeError("Unknown encoding: "+T);if(I.length===1){let E=I.charCodeAt(0);if(T==="utf8"&&E<128||T==="latin1")I=E}}else if(typeof I==="number")I=I&255;else if(typeof I==="boolean")I=Number(I);if(O<0||this.length<O||this.length<F)throw RangeError("Out of range index");if(F<=O)return this;if(O=O>>>0,F=F===void 0?this.length:F>>>0,!I)I=0;let H;if(typeof I==="number")for(H=O;H<F;++H)this[H]=I;else{let E=$0.isBuffer(I)?I:$0.from(I,T),V=E.length;if(V===0)throw TypeError('The value "'+I+'" is invalid for argument "value"');for(H=0;H<F-O;++H)this[H+O]=E[H%V]}return this};AY=/[^+/0-9A-Za-z-_]/g;LY=function(){let I=Array(256);for(let O=0;O<16;++O){let F=O*16;for(let T=0;T<16;++T)I[F+T]="0123456789abcdef"[O]+"0123456789abcdef"[T]}return I}();MY=cX("resolveObjectURL"),SY=cX("isUtf8"),qY=cX("transcode"),PY=$0});var uZ={};$X(uZ,{types:()=>yY,promisify:()=>fZ,log:()=>gZ,isUndefined:()=>nU,isSymbol:()=>cY,isString:()=>DX,isRegExp:()=>FX,isPrimitive:()=>pY,isObject:()=>mU,isNumber:()=>NZ,isNullOrUndefined:()=>fY,isNull:()=>TX,isFunction:()=>CX,isError:()=>HX,isDate:()=>bX,isBuffer:()=>hY,isBoolean:()=>dX,isArray:()=>xZ,inspect:()=>uU,inherits:()=>wZ,format:()=>lX,deprecate:()=>jY,default:()=>lY,debuglog:()=>vY,callbackifyOnRejected:()=>mX,callbackify:()=>cZ,_extend:()=>nX,TextEncoder:()=>pZ,TextDecoder:()=>hZ});function lX(I,...O){if(!DX(I)){var F=[I];for(var T=0;T<O.length;T++)F.push(uU(O[T]));return F.join(" ")}var T=0,H=O.length,E=String(I).replace(kY,function(P){if(P==="%%")return"%";if(T>=H)return P;switch(P){case"%s":return String(O[T++]);case"%d":return Number(O[T++]);case"%j":try{return JSON.stringify(O[T++])}catch(q){return"[Circular]"}default:return P}});for(var V=O[T];T<H;V=O[++T])if(TX(V)||!mU(V))E+=" "+V;else E+=" "+uU(V);return E}function jY(I,O){if(typeof process>"u"||process?.noDeprecation===!0)return I;var F=!1;function T(...H){if(!F){if(process.throwDeprecation)throw Error(O);else if(process.traceDeprecation)console.trace(O);else console.error(O);F=!0}return I.apply(this,...H)}return T}function _Y(I,O){var F=uU.styles[O];if(F)return"\x1B["+uU.colors[F][0]+"m"+I+"\x1B["+uU.colors[F][1]+"m";else return I}function BY(I,O){return I}function xY(I){var O={};return I.forEach(function(F,T){O[F]=!0}),O}function AX(I,O,F){if(I.customInspect&&O&&CX(O.inspect)&&O.inspect!==uU&&!(O.constructor&&O.constructor.prototype===O)){var T=O.inspect(F,I);if(!DX(T))T=AX(I,T,F);return T}var H=NY(I,O);if(H)return H;var E=Object.keys(O),V=xY(E);if(I.showHidden)E=Object.getOwnPropertyNames(O);if(HX(O)&&(E.indexOf("message")>=0||E.indexOf("description")>=0))return pX(O);if(E.length===0){if(CX(O)){var P=O.name?": "+O.name:"";return I.stylize("[Function"+P+"]","special")}if(FX(O))return I.stylize(RegExp.prototype.toString.call(O),"regexp");if(bX(O))return I.stylize(Date.prototype.toString.call(O),"date");if(HX(O))return pX(O)}var q="",L=!1,z=["{","}"];if(xZ(O))L=!0,z=["[","]"];if(CX(O)){var C=O.name?": "+O.name:"";q=" [Function"+C+"]"}if(FX(O))q=" "+RegExp.prototype.toString.call(O);if(bX(O))q=" "+Date.prototype.toUTCString.call(O);if(HX(O))q=" "+pX(O);if(E.length===0&&(!L||O.length==0))return z[0]+q+z[1];if(F<0)if(FX(O))return I.stylize(RegExp.prototype.toString.call(O),"regexp");else return I.stylize("[Object]","special");I.seen.push(O);var D;if(L)D=gY(I,O,F,V,E);else D=E.map(function(S){return uX(I,O,F,V,S,L)});return I.seen.pop(),wY(D,q,z)}function NY(I,O){if(nU(O))return I.stylize("undefined","undefined");if(DX(O)){var F="'"+JSON.stringify(O).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return I.stylize(F,"string")}if(NZ(O))return I.stylize(""+O,"number");if(dX(O))return I.stylize(""+O,"boolean");if(TX(O))return I.stylize("null","null")}function pX(I){return"["+Error.prototype.toString.call(I)+"]"}function gY(I,O,F,T,H){var E=[];for(var V=0,P=O.length;V<P;++V)if(yZ(O,String(V)))E.push(uX(I,O,F,T,String(V),!0));else E.push("");return H.forEach(function(q){if(!q.match(/^\d+$/))E.push(uX(I,O,F,T,q,!0))}),E}function uX(I,O,F,T,H,E){var V,P,q;if(q=Object.getOwnPropertyDescriptor(O,H)||{value:O[H]},q.get)if(q.set)P=I.stylize("[Getter/Setter]","special");else P=I.stylize("[Getter]","special");else if(q.set)P=I.stylize("[Setter]","special");if(!yZ(T,H))V="["+H+"]";if(!P)if(I.seen.indexOf(q.value)<0){if(TX(F))P=AX(I,q.value,null);else P=AX(I,q.value,F-1);if(P.indexOf(`
|
|
1
|
+
import{b as h0,c as iY,d as $X,f as KX,g as GJ}from"./chunk-q8xkh3ym.js";var FU={};$X(FU,{transcode:()=>qY,resolveObjectURL:()=>MY,kStringMaxLength:()=>zZ,kMaxLength:()=>rU,isUtf8:()=>SY,isAscii:()=>RY,default:()=>PY,constants:()=>rQ,btoa:()=>nQ,atob:()=>mQ,INSPECT_MAX_BYTES:()=>DZ,File:()=>sQ,Buffer:()=>$0,Blob:()=>tQ});function uQ(I){var O=I.length;if(O%4>0)throw Error("Invalid string. Length must be a multiple of 4");var F=I.indexOf("=");if(F===-1)F=O;var T=F===O?0:4-F%4;return[F,T]}function bQ(I,O){return(I+O)*3/4-O}function lQ(I){var O,F=uQ(I),T=F[0],H=F[1],E=new Uint8Array(bQ(T,H)),V=0,P=H>0?T-4:T,q;for(q=0;q<P;q+=4)O=PU[I.charCodeAt(q)]<<18|PU[I.charCodeAt(q+1)]<<12|PU[I.charCodeAt(q+2)]<<6|PU[I.charCodeAt(q+3)],E[V++]=O>>16&255,E[V++]=O>>8&255,E[V++]=O&255;if(H===2)O=PU[I.charCodeAt(q)]<<2|PU[I.charCodeAt(q+1)]>>4,E[V++]=O&255;if(H===1)O=PU[I.charCodeAt(q)]<<10|PU[I.charCodeAt(q+1)]<<4|PU[I.charCodeAt(q+2)]>>2,E[V++]=O>>8&255,E[V++]=O&255;return E}function dQ(I){return jU[I>>18&63]+jU[I>>12&63]+jU[I>>6&63]+jU[I&63]}function oQ(I,O,F){var T,H=[];for(var E=O;E<F;E+=3)T=(I[E]<<16&16711680)+(I[E+1]<<8&65280)+(I[E+2]&255),H.push(dQ(T));return H.join("")}function WZ(I){var O,F=I.length,T=F%3,H=[],E=16383;for(var V=0,P=F-T;V<P;V+=E)H.push(oQ(I,V,V+E>P?P:V+E));if(T===1)O=I[F-1],H.push(jU[O>>2]+jU[O<<4&63]+"==");else if(T===2)O=(I[F-2]<<8)+I[F-1],H.push(jU[O>>10]+jU[O>>4&63]+jU[O<<2&63]+"=");return H.join("")}function OX(I,O,F,T,H){var E,V,P=H*8-T-1,q=(1<<P)-1,L=q>>1,z=-7,C=F?H-1:0,D=F?-1:1,S=I[O+C];C+=D,E=S&(1<<-z)-1,S>>=-z,z+=P;for(;z>0;E=E*256+I[O+C],C+=D,z-=8);V=E&(1<<-z)-1,E>>=-z,z+=T;for(;z>0;V=V*256+I[O+C],C+=D,z-=8);if(E===0)E=1-L;else if(E===q)return V?NaN:(S?-1:1)*(1/0);else V=V+Math.pow(2,T),E=E-L;return(S?-1:1)*V*Math.pow(2,E-T)}function TZ(I,O,F,T,H,E){var V,P,q,L=E*8-H-1,z=(1<<L)-1,C=z>>1,D=H===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=T?0:E-1,R=T?1:-1,v=O<0||O===0&&1/O<0?1:0;if(O=Math.abs(O),isNaN(O)||O===1/0)P=isNaN(O)?1:0,V=z;else{if(V=Math.floor(Math.log(O)/Math.LN2),O*(q=Math.pow(2,-V))<1)V--,q*=2;if(V+C>=1)O+=D/q;else O+=D*Math.pow(2,1-C);if(O*q>=2)V++,q/=2;if(V+C>=z)P=0,V=z;else if(V+C>=1)P=(O*q-1)*Math.pow(2,H),V=V+C;else P=O*Math.pow(2,C-1)*Math.pow(2,H),V=0}for(;H>=8;I[F+S]=P&255,S+=R,P/=256,H-=8);V=V<<H|P,L+=H;for(;L>0;I[F+S]=V&255,S+=R,V/=256,L-=8);I[F+S-R]|=v*128}function BU(I){if(I>rU)throw RangeError('The value "'+I+'" is invalid for option "size"');let O=new Uint8Array(I);return Object.setPrototypeOf(O,$0.prototype),O}function wX(I,O,F){return class extends F{constructor(){super();Object.defineProperty(this,"message",{value:O.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${I}]`,this.stack,delete this.name}get code(){return I}set code(T){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:T,writable:!0})}toString(){return`${this.name} [${I}]: ${this.message}`}}}function $0(I,O,F){if(typeof I==="number"){if(typeof O==="string")throw TypeError('The "string" argument must be of type string. Received type number');return yX(I)}return LZ(I,O,F)}function LZ(I,O,F){if(typeof I==="string")return UY(I,O);if(ArrayBuffer.isView(I))return XY(I);if(I==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I);if(vU(I,ArrayBuffer)||I&&vU(I.buffer,ArrayBuffer))return NX(I,O,F);if(typeof SharedArrayBuffer<"u"&&(vU(I,SharedArrayBuffer)||I&&vU(I.buffer,SharedArrayBuffer)))return NX(I,O,F);if(typeof I==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let T=I.valueOf&&I.valueOf();if(T!=null&&T!==I)return $0.from(T,O,F);let H=ZY(I);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof I[Symbol.toPrimitive]==="function")return $0.from(I[Symbol.toPrimitive]("string"),O,F);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I)}function EZ(I){if(typeof I!=="number")throw TypeError('"size" argument must be of type number');else if(I<0)throw RangeError('The value "'+I+'" is invalid for option "size"')}function iQ(I,O,F){if(EZ(I),I<=0)return BU(I);if(O!==void 0)return typeof F==="string"?BU(I).fill(O,F):BU(I).fill(O);return BU(I)}function yX(I){return EZ(I),BU(I<0?0:fX(I)|0)}function UY(I,O){if(typeof O!=="string"||O==="")O="utf8";if(!$0.isEncoding(O))throw TypeError("Unknown encoding: "+O);let F=MZ(I,O)|0,T=BU(F),H=T.write(I,O);if(H!==F)T=T.slice(0,H);return T}function xX(I){let O=I.length<0?0:fX(I.length)|0,F=BU(O);for(let T=0;T<O;T+=1)F[T]=I[T]&255;return F}function XY(I){if(vU(I,Uint8Array)){let O=new Uint8Array(I);return NX(O.buffer,O.byteOffset,O.byteLength)}return xX(I)}function NX(I,O,F){if(O<0||I.byteLength<O)throw RangeError('"offset" is outside of buffer bounds');if(I.byteLength<O+(F||0))throw RangeError('"length" is outside of buffer bounds');let T;if(O===void 0&&F===void 0)T=new Uint8Array(I);else if(F===void 0)T=new Uint8Array(I,O);else T=new Uint8Array(I,O,F);return Object.setPrototypeOf(T,$0.prototype),T}function ZY(I){if($0.isBuffer(I)){let O=fX(I.length)|0,F=BU(O);if(F.length===0)return F;return I.copy(F,0,0,O),F}if(I.length!==void 0){if(typeof I.length!=="number"||Number.isNaN(I.length))return BU(0);return xX(I)}if(I.type==="Buffer"&&Array.isArray(I.data))return xX(I.data)}function fX(I){if(I>=rU)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+rU.toString(16)+" bytes");return I|0}function MZ(I,O){if($0.isBuffer(I))return I.length;if(ArrayBuffer.isView(I)||vU(I,ArrayBuffer))return I.byteLength;if(typeof I!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof I);let F=I.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&F===0)return 0;let H=!1;for(;;)switch(O){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return gX(I).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F*2;case"hex":return F>>>1;case"base64":return BZ(I).length;default:if(H)return T?-1:gX(I).length;O=(""+O).toLowerCase(),H=!0}}function QY(I,O,F){let T=!1;if(O===void 0||O<0)O=0;if(O>this.length)return"";if(F===void 0||F>this.length)F=this.length;if(F<=0)return"";if(F>>>=0,O>>>=0,F<=O)return"";if(!I)I="utf8";while(!0)switch(I){case"hex":return FY(this,O,F);case"utf8":case"utf-8":return RZ(this,O,F);case"ascii":return OY(this,O,F);case"latin1":case"binary":return WY(this,O,F);case"base64":return $Y(this,O,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return HY(this,O,F);default:if(T)throw TypeError("Unknown encoding: "+I);I=(I+"").toLowerCase(),T=!0}}function hU(I,O,F){let T=I[O];I[O]=I[F],I[F]=T}function SZ(I,O,F,T,H){if(I.length===0)return-1;if(typeof F==="string")T=F,F=0;else if(F>2147483647)F=2147483647;else if(F<-2147483648)F=-2147483648;if(F=+F,Number.isNaN(F))F=H?0:I.length-1;if(F<0)F=I.length+F;if(F>=I.length)if(H)return-1;else F=I.length-1;else if(F<0)if(H)F=0;else return-1;if(typeof O==="string")O=$0.from(O,T);if($0.isBuffer(O)){if(O.length===0)return-1;return HZ(I,O,F,T,H)}else if(typeof O==="number"){if(O=O&255,typeof Uint8Array.prototype.indexOf==="function")if(H)return Uint8Array.prototype.indexOf.call(I,O,F);else return Uint8Array.prototype.lastIndexOf.call(I,O,F);return HZ(I,[O],F,T,H)}throw TypeError("val must be string, number or Buffer")}function HZ(I,O,F,T,H){let E=1,V=I.length,P=O.length;if(T!==void 0){if(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le"){if(I.length<2||O.length<2)return-1;E=2,V/=2,P/=2,F/=2}}function q(z,C){if(E===1)return z[C];else return z.readUInt16BE(C*E)}let L;if(H){let z=-1;for(L=F;L<V;L++)if(q(I,L)===q(O,z===-1?0:L-z)){if(z===-1)z=L;if(L-z+1===P)return z*E}else{if(z!==-1)L-=L-z;z=-1}}else{if(F+P>V)F=V-P;for(L=F;L>=0;L--){let z=!0;for(let C=0;C<P;C++)if(q(I,L+C)!==q(O,C)){z=!1;break}if(z)return L}}return-1}function YY(I,O,F,T){F=Number(F)||0;let H=I.length-F;if(!T)T=H;else if(T=Number(T),T>H)T=H;let E=O.length;if(T>E/2)T=E/2;let V;for(V=0;V<T;++V){let P=parseInt(O.substr(V*2,2),16);if(Number.isNaN(P))return V;I[F+V]=P}return V}function JY(I,O,F,T){return WX(gX(O,I.length-F),I,F,T)}function VY(I,O,F,T){return WX(DY(O),I,F,T)}function GY(I,O,F,T){return WX(BZ(O),I,F,T)}function IY(I,O,F,T){return WX(zY(O,I.length-F),I,F,T)}function $Y(I,O,F){if(O===0&&F===I.length)return WZ(I);else return WZ(I.slice(O,F))}function RZ(I,O,F){F=Math.min(I.length,F);let T=[],H=O;while(H<F){let E=I[H],V=null,P=E>239?4:E>223?3:E>191?2:1;if(H+P<=F){let q,L,z,C;switch(P){case 1:if(E<128)V=E;break;case 2:if(q=I[H+1],(q&192)===128){if(C=(E&31)<<6|q&63,C>127)V=C}break;case 3:if(q=I[H+1],L=I[H+2],(q&192)===128&&(L&192)===128){if(C=(E&15)<<12|(q&63)<<6|L&63,C>2047&&(C<55296||C>57343))V=C}break;case 4:if(q=I[H+1],L=I[H+2],z=I[H+3],(q&192)===128&&(L&192)===128&&(z&192)===128){if(C=(E&15)<<18|(q&63)<<12|(L&63)<<6|z&63,C>65535&&C<1114112)V=C}}}if(V===null)V=65533,P=1;else if(V>65535)V-=65536,T.push(V>>>10&1023|55296),V=56320|V&1023;T.push(V),H+=P}return KY(T)}function KY(I){let O=I.length;if(O<=CZ)return String.fromCharCode.apply(String,I);let F="",T=0;while(T<O)F+=String.fromCharCode.apply(String,I.slice(T,T+=CZ));return F}function OY(I,O,F){let T="";F=Math.min(I.length,F);for(let H=O;H<F;++H)T+=String.fromCharCode(I[H]&127);return T}function WY(I,O,F){let T="";F=Math.min(I.length,F);for(let H=O;H<F;++H)T+=String.fromCharCode(I[H]);return T}function FY(I,O,F){let T=I.length;if(!O||O<0)O=0;if(!F||F<0||F>T)F=T;let H="";for(let E=O;E<F;++E)H+=LY[I[E]];return H}function HY(I,O,F){let T=I.slice(O,F),H="";for(let E=0;E<T.length-1;E+=2)H+=String.fromCharCode(T[E]+T[E+1]*256);return H}function WU(I,O,F){if(I%1!==0||I<0)throw RangeError("offset is not uint");if(I+O>F)throw RangeError("Trying to access beyond buffer length")}function EU(I,O,F,T,H,E){if(!$0.isBuffer(I))throw TypeError('"buffer" argument must be a Buffer instance');if(O>H||O<E)throw RangeError('"value" argument is out of bounds');if(F+T>I.length)throw RangeError("Index out of range")}function qZ(I,O,F,T,H){_Z(O,T,H,I,F,7);let E=Number(O&BigInt(4294967295));I[F++]=E,E=E>>8,I[F++]=E,E=E>>8,I[F++]=E,E=E>>8,I[F++]=E;let V=Number(O>>BigInt(32)&BigInt(4294967295));return I[F++]=V,V=V>>8,I[F++]=V,V=V>>8,I[F++]=V,V=V>>8,I[F++]=V,F}function PZ(I,O,F,T,H){_Z(O,T,H,I,F,7);let E=Number(O&BigInt(4294967295));I[F+7]=E,E=E>>8,I[F+6]=E,E=E>>8,I[F+5]=E,E=E>>8,I[F+4]=E;let V=Number(O>>BigInt(32)&BigInt(4294967295));return I[F+3]=V,V=V>>8,I[F+2]=V,V=V>>8,I[F+1]=V,V=V>>8,I[F]=V,F+8}function kZ(I,O,F,T,H,E){if(F+T>I.length)throw RangeError("Index out of range");if(F<0)throw RangeError("Index out of range")}function jZ(I,O,F,T,H){if(O=+O,F=F>>>0,!H)kZ(I,O,F,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return TZ(I,O,F,T,23,4),F+4}function vZ(I,O,F,T,H){if(O=+O,F=F>>>0,!H)kZ(I,O,F,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return TZ(I,O,F,T,52,8),F+8}function AZ(I){let O="",F=I.length,T=I[0]==="-"?1:0;for(;F>=T+4;F-=3)O=`_${I.slice(F-3,F)}${O}`;return`${I.slice(0,F)}${O}`}function CY(I,O,F){if(oU(O,"offset"),I[O]===void 0||I[O+F]===void 0)aU(O,I.length-(F+1))}function _Z(I,O,F,T,H,E){if(I>F||I<O){let V=typeof O==="bigint"?"n":"",P;if(E>3)if(O===0||O===BigInt(0))P=`>= 0${V} and < 2${V} ** ${(E+1)*8}${V}`;else P=`>= -(2${V} ** ${(E+1)*8-1}${V}) and < 2 ** ${(E+1)*8-1}${V}`;else P=`>= ${O}${V} and <= ${F}${V}`;throw new BX("value",P,I)}CY(T,H,E)}function oU(I,O){if(typeof I!=="number")throw new eQ(O,"number",I)}function aU(I,O,F){if(Math.floor(I)!==I)throw oU(I,F),new BX(F||"offset","an integer",I);if(O<0)throw new aQ;throw new BX(F||"offset",`>= ${F?1:0} and <= ${O}`,I)}function TY(I){if(I=I.split("=")[0],I=I.trim().replace(AY,""),I.length<2)return"";while(I.length%4!==0)I=I+"=";return I}function gX(I,O){O=O||1/0;let F,T=I.length,H=null,E=[];for(let V=0;V<T;++V){if(F=I.charCodeAt(V),F>55295&&F<57344){if(!H){if(F>56319){if((O-=3)>-1)E.push(239,191,189);continue}else if(V+1===T){if((O-=3)>-1)E.push(239,191,189);continue}H=F;continue}if(F<56320){if((O-=3)>-1)E.push(239,191,189);H=F;continue}F=(H-55296<<10|F-56320)+65536}else if(H){if((O-=3)>-1)E.push(239,191,189)}if(H=null,F<128){if((O-=1)<0)break;E.push(F)}else if(F<2048){if((O-=2)<0)break;E.push(F>>6|192,F&63|128)}else if(F<65536){if((O-=3)<0)break;E.push(F>>12|224,F>>6&63|128,F&63|128)}else if(F<1114112){if((O-=4)<0)break;E.push(F>>18|240,F>>12&63|128,F>>6&63|128,F&63|128)}else throw Error("Invalid code point")}return E}function DY(I){let O=[];for(let F=0;F<I.length;++F)O.push(I.charCodeAt(F)&255);return O}function zY(I,O){let F,T,H,E=[];for(let V=0;V<I.length;++V){if((O-=2)<0)break;F=I.charCodeAt(V),T=F>>8,H=F%256,E.push(H),E.push(T)}return E}function BZ(I){return lQ(TY(I))}function WX(I,O,F,T){let H;for(H=0;H<T;++H){if(H+F>=O.length||H>=I.length)break;O[H+F]=I[H]}return H}function vU(I,O){return I instanceof O||I!=null&&I.constructor!=null&&I.constructor.name!=null&&I.constructor.name===O.name}function wU(I){return typeof BigInt>"u"?EY:I}function EY(){throw Error("BigInt not supported")}function cX(I){return()=>{throw Error(I+" is not implemented for node:buffer browser polyfill")}}var jU,PU,_X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pU,OZ,FZ,DZ=50,rU=2147483647,zZ=536870888,nQ,mQ,sQ,tQ,rQ,aQ,eQ,BX,CZ=4096,AY,LY,MY,SY,RY=(I)=>{for(let O of I)if(O.charCodeAt(0)>127)return!1;return!0},qY,PY;var HU=KX(()=>{jU=[],PU=[];for(pU=0,OZ=_X.length;pU<OZ;++pU)jU[pU]=_X[pU],PU[_X.charCodeAt(pU)]=pU;PU[45]=62;PU[95]=63;FZ=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,nQ=globalThis.btoa,mQ=globalThis.atob,sQ=globalThis.File,tQ=globalThis.Blob,rQ={MAX_LENGTH:rU,MAX_STRING_LENGTH:zZ};aQ=wX("ERR_BUFFER_OUT_OF_BOUNDS",function(I){if(I)return`${I} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),eQ=wX("ERR_INVALID_ARG_TYPE",function(I,O){return`The "${I}" argument must be of type number. Received type ${typeof O}`},TypeError),BX=wX("ERR_OUT_OF_RANGE",function(I,O,F){let T=`The value of "${I}" is out of range.`,H=F;if(Number.isInteger(F)&&Math.abs(F)>4294967296)H=AZ(String(F));else if(typeof F==="bigint"){if(H=String(F),F>BigInt(2)**BigInt(32)||F<-(BigInt(2)**BigInt(32)))H=AZ(H);H+="n"}return T+=` It must be ${O}. Received ${H}`,T},RangeError);Object.defineProperty($0.prototype,"parent",{enumerable:!0,get:function(){if(!$0.isBuffer(this))return;return this.buffer}});Object.defineProperty($0.prototype,"offset",{enumerable:!0,get:function(){if(!$0.isBuffer(this))return;return this.byteOffset}});$0.poolSize=8192;$0.from=function(I,O,F){return LZ(I,O,F)};Object.setPrototypeOf($0.prototype,Uint8Array.prototype);Object.setPrototypeOf($0,Uint8Array);$0.alloc=function(I,O,F){return iQ(I,O,F)};$0.allocUnsafe=function(I){return yX(I)};$0.allocUnsafeSlow=function(I){return yX(I)};$0.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==$0.prototype};$0.compare=function(I,O){if(vU(I,Uint8Array))I=$0.from(I,I.offset,I.byteLength);if(vU(O,Uint8Array))O=$0.from(O,O.offset,O.byteLength);if(!$0.isBuffer(I)||!$0.isBuffer(O))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===O)return 0;let F=I.length,T=O.length;for(let H=0,E=Math.min(F,T);H<E;++H)if(I[H]!==O[H]){F=I[H],T=O[H];break}if(F<T)return-1;if(T<F)return 1;return 0};$0.isEncoding=function(I){switch(String(I).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};$0.concat=function(I,O){if(!Array.isArray(I))throw TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return $0.alloc(0);let F;if(O===void 0){O=0;for(F=0;F<I.length;++F)O+=I[F].length}let T=$0.allocUnsafe(O),H=0;for(F=0;F<I.length;++F){let E=I[F];if(vU(E,Uint8Array))if(H+E.length>T.length){if(!$0.isBuffer(E))E=$0.from(E);E.copy(T,H)}else Uint8Array.prototype.set.call(T,E,H);else if(!$0.isBuffer(E))throw TypeError('"list" argument must be an Array of Buffers');else E.copy(T,H);H+=E.length}return T};$0.byteLength=MZ;$0.prototype._isBuffer=!0;$0.prototype.swap16=function(){let I=this.length;if(I%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<I;O+=2)hU(this,O,O+1);return this};$0.prototype.swap32=function(){let I=this.length;if(I%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<I;O+=4)hU(this,O,O+3),hU(this,O+1,O+2);return this};$0.prototype.swap64=function(){let I=this.length;if(I%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<I;O+=8)hU(this,O,O+7),hU(this,O+1,O+6),hU(this,O+2,O+5),hU(this,O+3,O+4);return this};$0.prototype.toString=function(){let I=this.length;if(I===0)return"";if(arguments.length===0)return RZ(this,0,I);return QY.apply(this,arguments)};$0.prototype.toLocaleString=$0.prototype.toString;$0.prototype.equals=function(I){if(!$0.isBuffer(I))throw TypeError("Argument must be a Buffer");if(this===I)return!0;return $0.compare(this,I)===0};$0.prototype.inspect=function(){let I="",O=DZ;if(I=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O)I+=" ... ";return"<Buffer "+I+">"};if(FZ)$0.prototype[FZ]=$0.prototype.inspect;$0.prototype.compare=function(I,O,F,T,H){if(vU(I,Uint8Array))I=$0.from(I,I.offset,I.byteLength);if(!$0.isBuffer(I))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(O===void 0)O=0;if(F===void 0)F=I?I.length:0;if(T===void 0)T=0;if(H===void 0)H=this.length;if(O<0||F>I.length||T<0||H>this.length)throw RangeError("out of range index");if(T>=H&&O>=F)return 0;if(T>=H)return-1;if(O>=F)return 1;if(O>>>=0,F>>>=0,T>>>=0,H>>>=0,this===I)return 0;let E=H-T,V=F-O,P=Math.min(E,V),q=this.slice(T,H),L=I.slice(O,F);for(let z=0;z<P;++z)if(q[z]!==L[z]){E=q[z],V=L[z];break}if(E<V)return-1;if(V<E)return 1;return 0};$0.prototype.includes=function(I,O,F){return this.indexOf(I,O,F)!==-1};$0.prototype.indexOf=function(I,O,F){return SZ(this,I,O,F,!0)};$0.prototype.lastIndexOf=function(I,O,F){return SZ(this,I,O,F,!1)};$0.prototype.write=function(I,O,F,T){if(O===void 0)T="utf8",F=this.length,O=0;else if(F===void 0&&typeof O==="string")T=O,F=this.length,O=0;else if(isFinite(O))if(O=O>>>0,isFinite(F)){if(F=F>>>0,T===void 0)T="utf8"}else T=F,F=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-O;if(F===void 0||F>H)F=H;if(I.length>0&&(F<0||O<0)||O>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!T)T="utf8";let E=!1;for(;;)switch(T){case"hex":return YY(this,I,O,F);case"utf8":case"utf-8":return JY(this,I,O,F);case"ascii":case"latin1":case"binary":return VY(this,I,O,F);case"base64":return GY(this,I,O,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return IY(this,I,O,F);default:if(E)throw TypeError("Unknown encoding: "+T);T=(""+T).toLowerCase(),E=!0}};$0.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};$0.prototype.slice=function(I,O){let F=this.length;if(I=~~I,O=O===void 0?F:~~O,I<0){if(I+=F,I<0)I=0}else if(I>F)I=F;if(O<0){if(O+=F,O<0)O=0}else if(O>F)O=F;if(O<I)O=I;let T=this.subarray(I,O);return Object.setPrototypeOf(T,$0.prototype),T};$0.prototype.readUintLE=$0.prototype.readUIntLE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=this[I],H=1,E=0;while(++E<O&&(H*=256))T+=this[I+E]*H;return T};$0.prototype.readUintBE=$0.prototype.readUIntBE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=this[I+--O],H=1;while(O>0&&(H*=256))T+=this[I+--O]*H;return T};$0.prototype.readUint8=$0.prototype.readUInt8=function(I,O){if(I=I>>>0,!O)WU(I,1,this.length);return this[I]};$0.prototype.readUint16LE=$0.prototype.readUInt16LE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);return this[I]|this[I+1]<<8};$0.prototype.readUint16BE=$0.prototype.readUInt16BE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);return this[I]<<8|this[I+1]};$0.prototype.readUint32LE=$0.prototype.readUInt32LE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216};$0.prototype.readUint32BE=$0.prototype.readUInt32BE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])};$0.prototype.readBigUInt64LE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=O+this[++I]*256+this[++I]*65536+this[++I]*16777216,H=this[++I]+this[++I]*256+this[++I]*65536+F*16777216;return BigInt(T)+(BigInt(H)<<BigInt(32))});$0.prototype.readBigUInt64BE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=O*16777216+this[++I]*65536+this[++I]*256+this[++I],H=this[++I]*16777216+this[++I]*65536+this[++I]*256+F;return(BigInt(T)<<BigInt(32))+BigInt(H)});$0.prototype.readIntLE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=this[I],H=1,E=0;while(++E<O&&(H*=256))T+=this[I+E]*H;if(H*=128,T>=H)T-=Math.pow(2,8*O);return T};$0.prototype.readIntBE=function(I,O,F){if(I=I>>>0,O=O>>>0,!F)WU(I,O,this.length);let T=O,H=1,E=this[I+--T];while(T>0&&(H*=256))E+=this[I+--T]*H;if(H*=128,E>=H)E-=Math.pow(2,8*O);return E};$0.prototype.readInt8=function(I,O){if(I=I>>>0,!O)WU(I,1,this.length);if(!(this[I]&128))return this[I];return(255-this[I]+1)*-1};$0.prototype.readInt16LE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);let F=this[I]|this[I+1]<<8;return F&32768?F|4294901760:F};$0.prototype.readInt16BE=function(I,O){if(I=I>>>0,!O)WU(I,2,this.length);let F=this[I+1]|this[I]<<8;return F&32768?F|4294901760:F};$0.prototype.readInt32LE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24};$0.prototype.readInt32BE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]};$0.prototype.readBigInt64LE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=this[I+4]+this[I+5]*256+this[I+6]*65536+(F<<24);return(BigInt(T)<<BigInt(32))+BigInt(O+this[++I]*256+this[++I]*65536+this[++I]*16777216)});$0.prototype.readBigInt64BE=wU(function(I){I=I>>>0,oU(I,"offset");let O=this[I],F=this[I+7];if(O===void 0||F===void 0)aU(I,this.length-8);let T=(O<<24)+this[++I]*65536+this[++I]*256+this[++I];return(BigInt(T)<<BigInt(32))+BigInt(this[++I]*16777216+this[++I]*65536+this[++I]*256+F)});$0.prototype.readFloatLE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return OX(this,I,!0,23,4)};$0.prototype.readFloatBE=function(I,O){if(I=I>>>0,!O)WU(I,4,this.length);return OX(this,I,!1,23,4)};$0.prototype.readDoubleLE=function(I,O){if(I=I>>>0,!O)WU(I,8,this.length);return OX(this,I,!0,52,8)};$0.prototype.readDoubleBE=function(I,O){if(I=I>>>0,!O)WU(I,8,this.length);return OX(this,I,!1,52,8)};$0.prototype.writeUintLE=$0.prototype.writeUIntLE=function(I,O,F,T){if(I=+I,O=O>>>0,F=F>>>0,!T){let V=Math.pow(2,8*F)-1;EU(this,I,O,F,V,0)}let H=1,E=0;this[O]=I&255;while(++E<F&&(H*=256))this[O+E]=I/H&255;return O+F};$0.prototype.writeUintBE=$0.prototype.writeUIntBE=function(I,O,F,T){if(I=+I,O=O>>>0,F=F>>>0,!T){let V=Math.pow(2,8*F)-1;EU(this,I,O,F,V,0)}let H=F-1,E=1;this[O+H]=I&255;while(--H>=0&&(E*=256))this[O+H]=I/E&255;return O+F};$0.prototype.writeUint8=$0.prototype.writeUInt8=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,1,255,0);return this[O]=I&255,O+1};$0.prototype.writeUint16LE=$0.prototype.writeUInt16LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,65535,0);return this[O]=I&255,this[O+1]=I>>>8,O+2};$0.prototype.writeUint16BE=$0.prototype.writeUInt16BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,65535,0);return this[O]=I>>>8,this[O+1]=I&255,O+2};$0.prototype.writeUint32LE=$0.prototype.writeUInt32LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,4294967295,0);return this[O+3]=I>>>24,this[O+2]=I>>>16,this[O+1]=I>>>8,this[O]=I&255,O+4};$0.prototype.writeUint32BE=$0.prototype.writeUInt32BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,4294967295,0);return this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4};$0.prototype.writeBigUInt64LE=wU(function(I,O=0){return qZ(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))});$0.prototype.writeBigUInt64BE=wU(function(I,O=0){return PZ(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))});$0.prototype.writeIntLE=function(I,O,F,T){if(I=+I,O=O>>>0,!T){let P=Math.pow(2,8*F-1);EU(this,I,O,F,P-1,-P)}let H=0,E=1,V=0;this[O]=I&255;while(++H<F&&(E*=256)){if(I<0&&V===0&&this[O+H-1]!==0)V=1;this[O+H]=(I/E>>0)-V&255}return O+F};$0.prototype.writeIntBE=function(I,O,F,T){if(I=+I,O=O>>>0,!T){let P=Math.pow(2,8*F-1);EU(this,I,O,F,P-1,-P)}let H=F-1,E=1,V=0;this[O+H]=I&255;while(--H>=0&&(E*=256)){if(I<0&&V===0&&this[O+H+1]!==0)V=1;this[O+H]=(I/E>>0)-V&255}return O+F};$0.prototype.writeInt8=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,1,127,-128);if(I<0)I=255+I+1;return this[O]=I&255,O+1};$0.prototype.writeInt16LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,32767,-32768);return this[O]=I&255,this[O+1]=I>>>8,O+2};$0.prototype.writeInt16BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,2,32767,-32768);return this[O]=I>>>8,this[O+1]=I&255,O+2};$0.prototype.writeInt32LE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,2147483647,-2147483648);return this[O]=I&255,this[O+1]=I>>>8,this[O+2]=I>>>16,this[O+3]=I>>>24,O+4};$0.prototype.writeInt32BE=function(I,O,F){if(I=+I,O=O>>>0,!F)EU(this,I,O,4,2147483647,-2147483648);if(I<0)I=4294967295+I+1;return this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4};$0.prototype.writeBigInt64LE=wU(function(I,O=0){return qZ(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});$0.prototype.writeBigInt64BE=wU(function(I,O=0){return PZ(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});$0.prototype.writeFloatLE=function(I,O,F){return jZ(this,I,O,!0,F)};$0.prototype.writeFloatBE=function(I,O,F){return jZ(this,I,O,!1,F)};$0.prototype.writeDoubleLE=function(I,O,F){return vZ(this,I,O,!0,F)};$0.prototype.writeDoubleBE=function(I,O,F){return vZ(this,I,O,!1,F)};$0.prototype.copy=function(I,O,F,T){if(!$0.isBuffer(I))throw TypeError("argument should be a Buffer");if(!F)F=0;if(!T&&T!==0)T=this.length;if(O>=I.length)O=I.length;if(!O)O=0;if(T>0&&T<F)T=F;if(T===F)return 0;if(I.length===0||this.length===0)return 0;if(O<0)throw RangeError("targetStart out of bounds");if(F<0||F>=this.length)throw RangeError("Index out of range");if(T<0)throw RangeError("sourceEnd out of bounds");if(T>this.length)T=this.length;if(I.length-O<T-F)T=I.length-O+F;let H=T-F;if(this===I&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(O,F,T);else Uint8Array.prototype.set.call(I,this.subarray(F,T),O);return H};$0.prototype.fill=function(I,O,F,T){if(typeof I==="string"){if(typeof O==="string")T=O,O=0,F=this.length;else if(typeof F==="string")T=F,F=this.length;if(T!==void 0&&typeof T!=="string")throw TypeError("encoding must be a string");if(typeof T==="string"&&!$0.isEncoding(T))throw TypeError("Unknown encoding: "+T);if(I.length===1){let E=I.charCodeAt(0);if(T==="utf8"&&E<128||T==="latin1")I=E}}else if(typeof I==="number")I=I&255;else if(typeof I==="boolean")I=Number(I);if(O<0||this.length<O||this.length<F)throw RangeError("Out of range index");if(F<=O)return this;if(O=O>>>0,F=F===void 0?this.length:F>>>0,!I)I=0;let H;if(typeof I==="number")for(H=O;H<F;++H)this[H]=I;else{let E=$0.isBuffer(I)?I:$0.from(I,T),V=E.length;if(V===0)throw TypeError('The value "'+I+'" is invalid for argument "value"');for(H=0;H<F-O;++H)this[H+O]=E[H%V]}return this};AY=/[^+/0-9A-Za-z-_]/g;LY=function(){let I=Array(256);for(let O=0;O<16;++O){let F=O*16;for(let T=0;T<16;++T)I[F+T]="0123456789abcdef"[O]+"0123456789abcdef"[T]}return I}();MY=cX("resolveObjectURL"),SY=cX("isUtf8"),qY=cX("transcode"),PY=$0});var uZ={};$X(uZ,{types:()=>yY,promisify:()=>fZ,log:()=>gZ,isUndefined:()=>nU,isSymbol:()=>cY,isString:()=>DX,isRegExp:()=>FX,isPrimitive:()=>pY,isObject:()=>mU,isNumber:()=>NZ,isNullOrUndefined:()=>fY,isNull:()=>TX,isFunction:()=>CX,isError:()=>HX,isDate:()=>bX,isBuffer:()=>hY,isBoolean:()=>dX,isArray:()=>xZ,inspect:()=>uU,inherits:()=>wZ,format:()=>lX,deprecate:()=>jY,default:()=>lY,debuglog:()=>vY,callbackifyOnRejected:()=>mX,callbackify:()=>cZ,_extend:()=>nX,TextEncoder:()=>pZ,TextDecoder:()=>hZ});function lX(I,...O){if(!DX(I)){var F=[I];for(var T=0;T<O.length;T++)F.push(uU(O[T]));return F.join(" ")}var T=0,H=O.length,E=String(I).replace(kY,function(P){if(P==="%%")return"%";if(T>=H)return P;switch(P){case"%s":return String(O[T++]);case"%d":return Number(O[T++]);case"%j":try{return JSON.stringify(O[T++])}catch(q){return"[Circular]"}default:return P}});for(var V=O[T];T<H;V=O[++T])if(TX(V)||!mU(V))E+=" "+V;else E+=" "+uU(V);return E}function jY(I,O){if(typeof process>"u"||process?.noDeprecation===!0)return I;var F=!1;function T(...H){if(!F){if(process.throwDeprecation)throw Error(O);else if(process.traceDeprecation)console.trace(O);else console.error(O);F=!0}return I.apply(this,...H)}return T}function _Y(I,O){var F=uU.styles[O];if(F)return"\x1B["+uU.colors[F][0]+"m"+I+"\x1B["+uU.colors[F][1]+"m";else return I}function BY(I,O){return I}function xY(I){var O={};return I.forEach(function(F,T){O[F]=!0}),O}function AX(I,O,F){if(I.customInspect&&O&&CX(O.inspect)&&O.inspect!==uU&&!(O.constructor&&O.constructor.prototype===O)){var T=O.inspect(F,I);if(!DX(T))T=AX(I,T,F);return T}var H=NY(I,O);if(H)return H;var E=Object.keys(O),V=xY(E);if(I.showHidden)E=Object.getOwnPropertyNames(O);if(HX(O)&&(E.indexOf("message")>=0||E.indexOf("description")>=0))return pX(O);if(E.length===0){if(CX(O)){var P=O.name?": "+O.name:"";return I.stylize("[Function"+P+"]","special")}if(FX(O))return I.stylize(RegExp.prototype.toString.call(O),"regexp");if(bX(O))return I.stylize(Date.prototype.toString.call(O),"date");if(HX(O))return pX(O)}var q="",L=!1,z=["{","}"];if(xZ(O))L=!0,z=["[","]"];if(CX(O)){var C=O.name?": "+O.name:"";q=" [Function"+C+"]"}if(FX(O))q=" "+RegExp.prototype.toString.call(O);if(bX(O))q=" "+Date.prototype.toUTCString.call(O);if(HX(O))q=" "+pX(O);if(E.length===0&&(!L||O.length==0))return z[0]+q+z[1];if(F<0)if(FX(O))return I.stylize(RegExp.prototype.toString.call(O),"regexp");else return I.stylize("[Object]","special");I.seen.push(O);var D;if(L)D=gY(I,O,F,V,E);else D=E.map(function(S){return uX(I,O,F,V,S,L)});return I.seen.pop(),wY(D,q,z)}function NY(I,O){if(nU(O))return I.stylize("undefined","undefined");if(DX(O)){var F="'"+JSON.stringify(O).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return I.stylize(F,"string")}if(NZ(O))return I.stylize(""+O,"number");if(dX(O))return I.stylize(""+O,"boolean");if(TX(O))return I.stylize("null","null")}function pX(I){return"["+Error.prototype.toString.call(I)+"]"}function gY(I,O,F,T,H){var E=[];for(var V=0,P=O.length;V<P;++V)if(yZ(O,String(V)))E.push(uX(I,O,F,T,String(V),!0));else E.push("");return H.forEach(function(q){if(!q.match(/^\d+$/))E.push(uX(I,O,F,T,q,!0))}),E}function uX(I,O,F,T,H,E){var V,P,q;if(q=Object.getOwnPropertyDescriptor(O,H)||{value:O[H]},q.get)if(q.set)P=I.stylize("[Getter/Setter]","special");else P=I.stylize("[Getter]","special");else if(q.set)P=I.stylize("[Setter]","special");if(!yZ(T,H))V="["+H+"]";if(!P)if(I.seen.indexOf(q.value)<0){if(TX(F))P=AX(I,q.value,null);else P=AX(I,q.value,F-1);if(P.indexOf(`
|
|
2
2
|
`)>-1)if(E)P=P.split(`
|
|
3
3
|
`).map(function(L){return" "+L}).join(`
|
|
4
4
|
`).slice(2);else P=`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var m=Object.create;var{getPrototypeOf:n,defineProperty:g,getOwnPropertyNames:k,getOwnPropertyDescriptor:o}=Object,l=Object.prototype.hasOwnProperty;var p=(a,b,c)=>{c=a!=null?m(n(a)):{};let d=b||!a||!a.__esModule?g(c,"default",{value:a,enumerable:!0}):c;for(let e of k(a))if(!l.call(d,e))g(d,e,{get:()=>a[e],enumerable:!0});return d},j=new WeakMap,q=(a)=>{var b=j.get(a),c;if(b)return b;if(b=g({},"__esModule",{value:!0}),a&&typeof a==="object"||typeof a==="function")k(a).map((d)=>!l.call(b,d)&&g(b,d,{get:()=>a[d],enumerable:!(c=o(a,d))||c.enumerable}));return j.set(a,b),b},r=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var s=(a,b)=>{for(var c in b)g(a,c,{get:b[c],enumerable:!0,configurable:!0,set:(d)=>b[c]=()=>d})};var t=function(a,b,c,d){var e=arguments.length,f=e<3?b:d===null?d=Object.getOwnPropertyDescriptor(b,c):d,h;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")f=Reflect.decorate(a,b,c,d);else for(var i=a.length-1;i>=0;i--)if(h=a[i])f=(e<3?h(f):e>3?h(b,c,f):h(b,c))||f;return e>3&&f&&Object.defineProperty(b,c,f),f};var u=(a,b)=>()=>(a&&(b=a(a=0)),b);var v=((a)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});
|
|
2
|
+
export{p as a,q as b,r as c,s as d,t as e,u as f,v as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-q8xkh3ym.js";var{URL:J,URLSearchParams:X}=globalThis;function F(s){return typeof s==="string"}function K(s){return typeof s==="object"&&s!==null}function w(s){return s===null}function Y(s){return s==null}function m(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var S=/^([a-z0-9.+-]+:)/i,k=/:[0-9]*$/,H=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Q=["<",">",'"',"`"," ","\r",`
|
|
2
2
|
`,"\t"],E=["{","}","|","\\","^","`"].concat(Q),N=["'"].concat(E),M=["%","/","?",";","#"].concat(N),D=["/","?","#"],tt=255,G=/^[+a-z0-9A-Z_-]{0,63}$/,st=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ht={javascript:!0,"javascript:":!0},Z={javascript:!0,"javascript:":!0},R={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},B={parse(s){var o=decodeURIComponent;return(s+"").replace(/\+/g," ").split("&").filter(Boolean).reduce(function(t,n,a){var l=n.split("="),f=o(l[0]||""),h=o(l[1]||""),g=t[f];return t[f]=g===void 0?h:[].concat(g,h),t},{})},stringify(s){var o=encodeURIComponent;return Object.keys(s||{}).reduce(function(t,n){return[].concat(s[n]).forEach(function(a){t.push(o(n)+"="+o(a))}),t},[]).join("&").replace(/\s/g,"+")}};function I(s,o,t){if(s&&K(s)&&s instanceof m)return s;var n=new m;return n.parse(s,o,t),n}m.prototype.parse=function(s,o,t){if(!F(s))throw TypeError("Parameter 'url' must be a string, not "+typeof s);var n=s.indexOf("?"),a=n!==-1&&n<s.indexOf("#")?"?":"#",l=s.split(a),f=/\\/g;l[0]=l[0].replace(f,"/"),s=l.join(a);var h=s;if(h=h.trim(),!t&&s.split("#").length===1){var g=H.exec(h);if(g){if(this.path=h,this.href=h,this.pathname=g[1],g[2])if(this.search=g[2],o)this.query=B.parse(this.search.substr(1));else this.query=this.search.substr(1);else if(o)this.search="",this.query={};return this}}var p=S.exec(h);if(p){p=p[0];var A=p.toLowerCase();this.protocol=A,h=h.substr(p.length)}if(t||p||h.match(/^\/\/[^@\/]+@[^@\/]+/)){var C=h.substr(0,2)==="//";if(C&&!(p&&Z[p]))h=h.substr(2),this.slashes=!0}if(!Z[p]&&(C||p&&!R[p])){var c=-1;for(var r=0;r<D.length;r++){var b=h.indexOf(D[r]);if(b!==-1&&(c===-1||b<c))c=b}var P,u;if(c===-1)u=h.lastIndexOf("@");else u=h.lastIndexOf("@",c);if(u!==-1)P=h.slice(0,u),h=h.slice(u+1),this.auth=decodeURIComponent(P);c=-1;for(var r=0;r<M.length;r++){var b=h.indexOf(M[r]);if(b!==-1&&(c===-1||b<c))c=b}if(c===-1)c=h.length;this.host=h.slice(0,c),h=h.slice(c),this.parseHost(),this.hostname=this.hostname||"";var U=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!U){var e=this.hostname.split(/\./);for(var r=0,i=e.length;r<i;r++){var d=e[r];if(!d)continue;if(!d.match(G)){var y="";for(var O=0,L=d.length;O<L;O++)if(d.charCodeAt(O)>127)y+="x";else y+=d[O];if(!y.match(G)){var x=e.slice(0,r),q=e.slice(r+1),j=d.match(st);if(j)x.push(j[1]),q.unshift(j[2]);if(q.length)h="/"+q.join(".")+h;this.hostname=x.join(".");break}}}}if(this.hostname.length>tt)this.hostname="";else this.hostname=this.hostname.toLowerCase();if(!U)this.hostname=new J(`https://${this.hostname}`).hostname;var $=this.port?":"+this.port:"",V=this.hostname||"";if(this.host=V+$,this.href+=this.host,U){if(this.hostname=this.hostname.substr(1,this.hostname.length-2),h[0]!=="/")h="/"+h}}if(!ht[A])for(var r=0,i=N.length;r<i;r++){var v=N[r];if(h.indexOf(v)===-1)continue;var z=encodeURIComponent(v);if(z===v)z=escape(v);h=h.split(v).join(z)}var T=h.indexOf("#");if(T!==-1)this.hash=h.substr(T),h=h.slice(0,T);var _=h.indexOf("?");if(_!==-1){if(this.search=h.substr(_),this.query=h.substr(_+1),o)this.query=B.parse(this.query);h=h.slice(0,_)}else if(o)this.search="",this.query={};if(h)this.pathname=h;if(R[A]&&this.hostname&&!this.pathname)this.pathname="/";if(this.pathname||this.search){var $=this.pathname||"",W=this.search||"";this.path=$+W}return this.href=this.format(),this};function et(s){if(F(s))s=I(s);if(!(s instanceof m))return m.prototype.format.call(s);return s.format()}m.prototype.format=function(){var s=this.auth||"";if(s)s=encodeURIComponent(s),s=s.replace(/%3A/i,":"),s+="@";var o=this.protocol||"",t=this.pathname||"",n=this.hash||"",a=!1,l="";if(this.host)a=s+this.host;else if(this.hostname){if(a=s+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port)a+=":"+this.port}if(this.query&&K(this.query)&&Object.keys(this.query).length)l=B.stringify(this.query);var f=this.search||l&&"?"+l||"";if(o&&o.substr(-1)!==":")o+=":";if(this.slashes||(!o||R[o])&&a!==!1){if(a="//"+(a||""),t&&t.charAt(0)!=="/")t="/"+t}else if(!a)a="";if(n&&n.charAt(0)!=="#")n="#"+n;if(f&&f.charAt(0)!=="?")f="?"+f;return t=t.replace(/[?#]/g,function(h){return encodeURIComponent(h)}),f=f.replace("#","%23"),o+a+t+f+n};function ot(s,o){return I(s,!1,!0).resolve(o)}m.prototype.resolve=function(s){return this.resolveObject(I(s,!1,!0)).format()};function nt(s,o){if(!s)return o;return I(s,!1,!0).resolveObject(o)}m.prototype.resolveObject=function(s){if(F(s)){var o=new m;o.parse(s,!1,!0),s=o}var t=new m,n=Object.keys(this);for(var a=0;a<n.length;a++){var l=n[a];t[l]=this[l]}if(t.hash=s.hash,s.href==="")return t.href=t.format(),t;if(s.slashes&&!s.protocol){var f=Object.keys(s);for(var h=0;h<f.length;h++){var g=f[h];if(g!=="protocol")t[g]=s[g]}if(R[t.protocol]&&t.hostname&&!t.pathname)t.path=t.pathname="/";return t.href=t.format(),t}if(s.protocol&&s.protocol!==t.protocol){if(!R[s.protocol]){var p=Object.keys(s);for(var A=0;A<p.length;A++){var C=p[A];t[C]=s[C]}return t.href=t.format(),t}if(t.protocol=s.protocol,!s.host&&!Z[s.protocol]){var i=(s.pathname||"").split("/");while(i.length&&!(s.host=i.shift()));if(!s.host)s.host="";if(!s.hostname)s.hostname="";if(i[0]!=="")i.unshift("");if(i.length<2)i.unshift("");t.pathname=i.join("/")}else t.pathname=s.pathname;if(t.search=s.search,t.query=s.query,t.host=s.host||"",t.auth=s.auth,t.hostname=s.hostname||s.host,t.port=s.port,t.pathname||t.search){var c=t.pathname||"",r=t.search||"";t.path=c+r}return t.slashes=t.slashes||s.slashes,t.href=t.format(),t}var b=t.pathname&&t.pathname.charAt(0)==="/",P=s.host||s.pathname&&s.pathname.charAt(0)==="/",u=P||b||t.host&&s.pathname,U=u,e=t.pathname&&t.pathname.split("/")||[],i=s.pathname&&s.pathname.split("/")||[],d=t.protocol&&!R[t.protocol];if(d){if(t.hostname="",t.port=null,t.host)if(e[0]==="")e[0]=t.host;else e.unshift(t.host);if(t.host="",s.protocol){if(s.hostname=null,s.port=null,s.host)if(i[0]==="")i[0]=s.host;else i.unshift(s.host);s.host=null}u=u&&(i[0]===""||e[0]==="")}if(P)t.host=s.host||s.host===""?s.host:t.host,t.hostname=s.hostname||s.hostname===""?s.hostname:t.hostname,t.search=s.search,t.query=s.query,e=i;else if(i.length){if(!e)e=[];e.pop(),e=e.concat(i),t.search=s.search,t.query=s.query}else if(!Y(s.search)){if(d){t.hostname=t.host=e.shift();var y=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;if(y)t.auth=y.shift(),t.host=t.hostname=y.shift()}if(t.search=s.search,t.query=s.query,!w(t.pathname)||!w(t.search))t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"");return t.href=t.format(),t}if(!e.length){if(t.pathname=null,t.search)t.path="/"+t.search;else t.path=null;return t.href=t.format(),t}var O=e.slice(-1)[0],L=(t.host||s.host||e.length>1)&&(O==="."||O==="..")||O==="",x=0;for(var q=e.length;q>=0;q--)if(O=e[q],O===".")e.splice(q,1);else if(O==="..")e.splice(q,1),x++;else if(x)e.splice(q,1),x--;if(!u&&!U)for(;x--;x)e.unshift("..");if(u&&e[0]!==""&&(!e[0]||e[0].charAt(0)!=="/"))e.unshift("");if(L&&e.join("/").substr(-1)!=="/")e.push("");var j=e[0]===""||e[0]&&e[0].charAt(0)==="/";if(d){t.hostname=t.host=j?"":e.length?e.shift():"";var y=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;if(y)t.auth=y.shift(),t.host=t.hostname=y.shift()}if(u=u||t.host&&e.length,u&&!j)e.unshift("");if(!e.length)t.pathname=null,t.path=null;else t.pathname=e.join("/");if(!w(t.pathname)||!w(t.search))t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"");return t.auth=s.auth||t.auth,t.slashes=t.slashes||s.slashes,t.href=t.format(),t};m.prototype.parseHost=function(){var s=this.host,o=k.exec(s);if(o){if(o=o[0],o!==":")this.port=o.substr(1);s=s.substr(0,s.length-o.length)}if(s)this.hostname=s};var at={parse:I,resolve:ot,resolveObject:nt,format:et,Url:m,URL:J,URLSearchParams:X};export{nt as resolveObject,ot as resolve,I as parse,et as format,at as default,m as Url,X as URLSearchParams,J as URL};
|
package/dist/pyrepl.esm.js
CHANGED
|
@@ -1,13 +1,46 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as kn,e as Bn,g as Fn}from"./chunk-q8xkh3ym.js";var C=globalThis,I=C.ShadowRoot&&(C.ShadyCSS===void 0||C.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),U=new WeakMap;class X{constructor(n,e,r){if(this._$cssResult$=!0,r!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=e}get styleSheet(){let n=this.o,e=this.t;if(I&&n===void 0){let r=e!==void 0&&e.length===1;r&&(n=U.get(e)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),r&&U.set(e,n))}return n}toString(){return this.cssText}}var A=(n)=>new X(typeof n=="string"?n:n+"",void 0,L);var M=(n,e)=>{if(I)n.adoptedStyleSheets=e.map((r)=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let l=document.createElement("style"),o=C.litNonce;o!==void 0&&l.setAttribute("nonce",o),l.textContent=r.cssText,n.appendChild(l)}},$=I?(n)=>n:(n)=>n instanceof CSSStyleSheet?((e)=>{let r="";for(let l of e.cssRules)r+=l.cssText;return A(r)})(n):n;var{is:Gn,defineProperty:Jn,getOwnPropertyDescriptor:Cn,getOwnPropertyNames:In,getOwnPropertySymbols:Kn,getPrototypeOf:On}=Object,O=globalThis,nn=O.trustedTypes,Wn=nn?nn.emptyScript:"",Yn=O.reactiveElementPolyfillSupport,k=(n,e)=>n,K={toAttribute(n,e){switch(e){case Boolean:n=n?Wn:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let r=n;switch(e){case Boolean:r=n!==null;break;case Number:r=n===null?null:Number(n);break;case Object:case Array:try{r=JSON.parse(n)}catch(l){r=null}}return r}},D=(n,e)=>!Gn(n,e),en={attribute:!0,type:String,converter:K,reflect:!1,useDefault:!1,hasChanged:D};Symbol.metadata??=Symbol("metadata"),O.litPropertyMetadata??=new WeakMap;class a extends HTMLElement{static addInitializer(n){this._$Ei(),(this.l??=[]).push(n)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(n,e=en){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(n)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(n,e),!e.noAccessor){let r=Symbol(),l=this.getPropertyDescriptor(n,r,e);l!==void 0&&Jn(this.prototype,n,l)}}static getPropertyDescriptor(n,e,r){let{get:l,set:o}=Cn(this.prototype,n)??{get(){return this[e]},set(_){this[e]=_}};return{get:l,set(_){let s=l?.call(this);o?.call(this,_),this.requestUpdate(n,s,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)??en}static _$Ei(){if(this.hasOwnProperty(k("elementProperties")))return;let n=On(this);n.finalize(),n.l!==void 0&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(k("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k("properties"))){let e=this.properties,r=[...In(e),...Kn(e)];for(let l of r)this.createProperty(l,e[l])}let n=this[Symbol.metadata];if(n!==null){let e=litPropertyMetadata.get(n);if(e!==void 0)for(let[r,l]of e)this.elementProperties.set(r,l)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let l=this._$Eu(e,r);l!==void 0&&this._$Eh.set(l,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(n){let e=[];if(Array.isArray(n)){let r=new Set(n.flat(1/0).reverse());for(let l of r)e.unshift($(l))}else n!==void 0&&e.push($(n));return e}static _$Eu(n,e){let r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof n=="string"?n.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((n)=>this.enableUpdating=n),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((n)=>n(this))}addController(n){(this._$EO??=new Set).add(n),this.renderRoot!==void 0&&this.isConnected&&n.hostConnected?.()}removeController(n){this._$EO?.delete(n)}_$E_(){let n=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(n.set(r,this[r]),delete this[r]);n.size>0&&(this._$Ep=n)}createRenderRoot(){let n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return M(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((n)=>n.hostConnected?.())}enableUpdating(n){}disconnectedCallback(){this._$EO?.forEach((n)=>n.hostDisconnected?.())}attributeChangedCallback(n,e,r){this._$AK(n,r)}_$ET(n,e){let r=this.constructor.elementProperties.get(n),l=this.constructor._$Eu(n,r);if(l!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:K).toAttribute(e,r.type);this._$Em=n,o==null?this.removeAttribute(l):this.setAttribute(l,o),this._$Em=null}}_$AK(n,e){let r=this.constructor,l=r._$Eh.get(n);if(l!==void 0&&this._$Em!==l){let o=r.getPropertyOptions(l),_=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:K;this._$Em=l;let s=_.fromAttribute(e,o.type);this[l]=s??this._$Ej?.get(l)??s,this._$Em=null}}requestUpdate(n,e,r,l=!1,o){if(n!==void 0){let _=this.constructor;if(l===!1&&(o=this[n]),r??=_.getPropertyOptions(n),!((r.hasChanged??D)(o,e)||r.useDefault&&r.reflect&&o===this._$Ej?.get(n)&&!this.hasAttribute(_._$Eu(n,r))))return;this.C(n,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(n,e,{useDefault:r,reflect:l,wrapped:o},_){r&&!(this._$Ej??=new Map).has(n)&&(this._$Ej.set(n,_??e??this[n]),o!==!0||_!==void 0)||(this._$AL.has(n)||(this.hasUpdated||r||(e=void 0),this._$AL.set(n,e)),l===!0&&this._$Em!==n&&(this._$Eq??=new Set).add(n))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let n=this.scheduleUpdate();return n!=null&&await n,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[l,o]of this._$Ep)this[l]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[l,o]of r){let{wrapped:_}=o,s=this[l];_!==!0||this._$AL.has(l)||s===void 0||this.C(l,void 0,o,s)}}let n=!1,e=this._$AL;try{n=this.shouldUpdate(e),n?(this.willUpdate(e),this._$EO?.forEach((r)=>r.hostUpdate?.()),this.update(e)):this._$EM()}catch(r){throw n=!1,this._$EM(),r}n&&this._$AE(e)}willUpdate(n){}_$AE(n){this._$EO?.forEach((e)=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(n)),this.updated(n)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(n){return!0}update(n){this._$Eq&&=this._$Eq.forEach((e)=>this._$ET(e,this[e])),this._$EM()}updated(n){}firstUpdated(n){}}a.elementStyles=[],a.shadowRootOptions={mode:"open"},a[k("elementProperties")]=new Map,a[k("finalized")]=new Map,Yn?.({ReactiveElement:a}),(O.reactiveElementVersions??=[]).push("2.1.2");var T=globalThis,rn=(n)=>n,W=T.trustedTypes,ln=W?W.createPolicy("lit-html",{createHTML:(n)=>n}):void 0;var f=`lit$${Math.random().toFixed(9).slice(2)}$`,cn="?"+f,Xn=`<${cn}>`,t=document,N=()=>t.createComment(""),q=(n)=>n===null||typeof n!="object"&&typeof n!="function",V=Array.isArray,$n=(n)=>V(n)||typeof n?.[Symbol.iterator]=="function";var F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,on=/-->/g,_n=/>/g,u=RegExp(`>|[
|
|
2
|
+
\f\r](?:([^\\s"'>=/]+)([
|
|
3
|
+
\f\r]*=[
|
|
4
|
+
\f\r]*(?:[^
|
|
5
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),sn=/'/g,pn=/"/g,yn=/^(?:script|style|textarea|title)$/i,Z=(n)=>(e,...r)=>({_$litType$:n,strings:e,values:r}),dn=Z(1),re=Z(2),le=Z(3),v=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),wn=new WeakMap,b=t.createTreeWalker(t,129);function xn(n,e){if(!V(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ln!==void 0?ln.createHTML(e):e}var Dn=(n,e)=>{let r=n.length-1,l=[],o,_=e===2?"<svg>":e===3?"<math>":"",s=F;for(let p=0;p<r;p++){let w=n[p],m,c,d=-1,x=0;for(;x<w.length&&(s.lastIndex=x,c=s.exec(w),c!==null);)x=s.lastIndex,s===F?c[1]==="!--"?s=on:c[1]!==void 0?s=_n:c[2]!==void 0?(yn.test(c[2])&&(o=RegExp("</"+c[2],"g")),s=u):c[3]!==void 0&&(s=u):s===u?c[0]===">"?(s=o??F,d=-1):c[1]===void 0?d=-2:(d=s.lastIndex-c[2].length,m=c[1],s=c[3]===void 0?u:c[3]==='"'?pn:sn):s===pn||s===sn?s=u:s===on||s===_n?s=F:(s=u,o=void 0);let i=s===u&&n[p+1].startsWith("/>")?" ":"";_+=s===F?w+Xn:d>=0?(l.push(m),w.slice(0,d)+"$lit$"+w.slice(d)+f+i):w+f+(d===-2?p:i)}return[xn(n,_+(n[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),l]};class g{constructor({strings:n,_$litType$:e},r){let l;this.parts=[];let o=0,_=0,s=n.length-1,p=this.parts,[w,m]=Dn(n,e);if(this.el=g.createElement(w,r),b.currentNode=this.el.content,e===2||e===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(l=b.nextNode())!==null&&p.length<s;){if(l.nodeType===1){if(l.hasAttributes())for(let c of l.getAttributeNames())if(c.endsWith("$lit$")){let d=m[_++],x=l.getAttribute(c).split(f),i=/([.?@])?(.*)/.exec(d);p.push({type:1,index:o,name:i[2],strings:x,ctor:i[1]==="."?an:i[1]==="?"?fn:i[1]==="@"?un:G}),l.removeAttribute(c)}else c.startsWith(f)&&(p.push({type:6,index:o}),l.removeAttribute(c));if(yn.test(l.tagName)){let c=l.textContent.split(f),d=c.length-1;if(d>0){l.textContent=W?W.emptyScript:"";for(let x=0;x<d;x++)l.append(c[x],N()),b.nextNode(),p.push({type:2,index:++o});l.append(c[d],N())}}}else if(l.nodeType===8)if(l.data===cn)p.push({type:2,index:o});else{let c=-1;for(;(c=l.data.indexOf(f,c+1))!==-1;)p.push({type:7,index:o}),c+=f.length-1}o++}}static createElement(n,e){let r=t.createElement("template");return r.innerHTML=n,r}}function S(n,e,r=n,l){if(e===v)return e;let o=l!==void 0?r._$Co?.[l]:r._$Cl,_=q(e)?void 0:e._$litDirective$;return o?.constructor!==_&&(o?._$AO?.(!1),_===void 0?o=void 0:(o=new _(n),o._$AT(n,r,l)),l!==void 0?(r._$Co??=[])[l]=o:r._$Cl=o),o!==void 0&&(e=S(n,o._$AS(n,e.values),o,l)),e}class mn{constructor(n,e){this._$AV=[],this._$AN=void 0,this._$AD=n,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(n){let{el:{content:e},parts:r}=this._$AD,l=(n?.creationScope??t).importNode(e,!0);b.currentNode=l;let o=b.nextNode(),_=0,s=0,p=r[0];for(;p!==void 0;){if(_===p.index){let w;p.type===2?w=new B(o,o.nextSibling,this,n):p.type===1?w=new p.ctor(o,p.name,p.strings,this,n):p.type===6&&(w=new bn(o,this,n)),this._$AV.push(w),p=r[++s]}_!==p?.index&&(o=b.nextNode(),_++)}return b.currentNode=t,l}p(n){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(n,r,e),e+=r.strings.length-2):r._$AI(n[e])),e++}}class B{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(n,e,r,l){this.type=2,this._$AH=y,this._$AN=void 0,this._$AA=n,this._$AB=e,this._$AM=r,this.options=l,this._$Cv=l?.isConnected??!0}get parentNode(){let n=this._$AA.parentNode,e=this._$AM;return e!==void 0&&n?.nodeType===11&&(n=e.parentNode),n}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(n,e=this){n=S(this,n,e),q(n)?n===y||n==null||n===""?(this._$AH!==y&&this._$AR(),this._$AH=y):n!==this._$AH&&n!==v&&this._(n):n._$litType$!==void 0?this.$(n):n.nodeType!==void 0?this.T(n):$n(n)?this.k(n):this._(n)}O(n){return this._$AA.parentNode.insertBefore(n,this._$AB)}T(n){this._$AH!==n&&(this._$AR(),this._$AH=this.O(n))}_(n){this._$AH!==y&&q(this._$AH)?this._$AA.nextSibling.data=n:this.T(t.createTextNode(n)),this._$AH=n}$(n){let{values:e,_$litType$:r}=n,l=typeof r=="number"?this._$AC(n):(r.el===void 0&&(r.el=g.createElement(xn(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===l)this._$AH.p(e);else{let o=new mn(l,this),_=o.u(this.options);o.p(e),this.T(_),this._$AH=o}}_$AC(n){let e=wn.get(n.strings);return e===void 0&&wn.set(n.strings,e=new g(n)),e}k(n){V(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,l=0;for(let o of n)l===e.length?e.push(r=new B(this.O(N()),this.O(N()),this,this.options)):r=e[l],r._$AI(o),l++;l<e.length&&(this._$AR(r&&r._$AB.nextSibling,l),e.length=l)}_$AR(n=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);n!==this._$AB;){let r=rn(n).nextSibling;rn(n).remove(),n=r}}setConnected(n){this._$AM===void 0&&(this._$Cv=n,this._$AP?.(n))}}class G{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(n,e,r,l,o){this.type=1,this._$AH=y,this._$AN=void 0,this.element=n,this.name=e,this._$AM=l,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=y}_$AI(n,e=this,r,l){let o=this.strings,_=!1;if(o===void 0)n=S(this,n,e,0),_=!q(n)||n!==this._$AH&&n!==v,_&&(this._$AH=n);else{let s=n,p,w;for(n=o[0],p=0;p<o.length-1;p++)w=S(this,s[r+p],e,p),w===v&&(w=this._$AH[p]),_||=!q(w)||w!==this._$AH[p],w===y?n=y:n!==y&&(n+=(w??"")+o[p+1]),this._$AH[p]=w}_&&!l&&this.j(n)}j(n){n===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,n??"")}}class an extends G{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===y?void 0:n}}class fn extends G{constructor(){super(...arguments),this.type=4}j(n){this.element.toggleAttribute(this.name,!!n&&n!==y)}}class un extends G{constructor(n,e,r,l,o){super(n,e,r,l,o),this.type=5}_$AI(n,e=this){if((n=S(this,n,e,0)??y)===v)return;let r=this._$AH,l=n===y&&r!==y||n.capture!==r.capture||n.once!==r.once||n.passive!==r.passive,o=n!==y&&(r===y||l);l&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,n),this._$AH=n}handleEvent(n){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,n):this._$AH.handleEvent(n)}}class bn{constructor(n,e,r){this.element=n,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(n){S(this,n)}}var Tn=T.litHtmlPolyfillSupport;Tn?.(g,B),(T.litHtmlVersions??=[]).push("3.3.2");var tn=(n,e,r)=>{let l=r?.renderBefore??e,o=l._$litPart$;if(o===void 0){let _=r?.renderBefore??null;l._$litPart$=o=new B(e.insertBefore(N(),_),_,void 0,r??{})}return o._$AI(n),o};var z=globalThis;class h extends a{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let n=super.createRenderRoot();return this.renderOptions.renderBefore??=n.firstChild,n}update(n){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(n),this._$Do=tn(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return v}}h._$litElement$=!0,h.finalized=!0,z.litElementHydrateSupport?.({LitElement:h});var Vn=z.litElementPolyfillSupport;Vn?.({LitElement:h});(z.litElementVersions??=[]).push("4.2.2");var vn=(n)=>(e,r)=>{r!==void 0?r.addInitializer(()=>{customElements.define(n,e)}):customElements.define(n,e)};var hn=`from codeop import compile_command
|
|
2
6
|
import sys
|
|
3
7
|
from _pyrepl.console import Console, Event
|
|
4
8
|
from collections import deque
|
|
5
9
|
import js
|
|
6
10
|
from pyodide.ffi import create_proxy
|
|
7
11
|
|
|
8
|
-
# ANSI
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
# ANSI color codes
|
|
13
|
+
ANSI_COLORS = {
|
|
14
|
+
"black": "30",
|
|
15
|
+
"red": "31",
|
|
16
|
+
"green": "32",
|
|
17
|
+
"yellow": "33",
|
|
18
|
+
"blue": "34",
|
|
19
|
+
"magenta": "35",
|
|
20
|
+
"cyan": "36",
|
|
21
|
+
"white": "37",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def color_to_ansi(color):
|
|
26
|
+
"""Convert a color name or hex value to ANSI escape sequence."""
|
|
27
|
+
if color.startswith("#"):
|
|
28
|
+
# Parse hex color (supports #RGB and #RRGGBB)
|
|
29
|
+
hex_val = color[1:]
|
|
30
|
+
if len(hex_val) == 3:
|
|
31
|
+
r = int(hex_val[0] * 2, 16)
|
|
32
|
+
g = int(hex_val[1] * 2, 16)
|
|
33
|
+
b = int(hex_val[2] * 2, 16)
|
|
34
|
+
elif len(hex_val) == 6:
|
|
35
|
+
r = int(hex_val[0:2], 16)
|
|
36
|
+
g = int(hex_val[2:4], 16)
|
|
37
|
+
b = int(hex_val[4:6], 16)
|
|
38
|
+
else:
|
|
39
|
+
return "32" # Fall back to green
|
|
40
|
+
# Use 24-bit true color: \\x1b[38;2;R;G;Bm
|
|
41
|
+
return f"38;2;{r};{g};{b}"
|
|
42
|
+
else:
|
|
43
|
+
return ANSI_COLORS.get(color, "32")
|
|
11
44
|
|
|
12
45
|
|
|
13
46
|
class BrowserConsole(Console):
|
|
@@ -25,15 +58,12 @@ class BrowserConsole(Console):
|
|
|
25
58
|
return self.term.rows, self.term.cols
|
|
26
59
|
|
|
27
60
|
def refresh(self, screen, xy):
|
|
28
|
-
# TODO: redraw screen
|
|
29
61
|
pass
|
|
30
62
|
|
|
31
63
|
def prepare(self):
|
|
32
|
-
# TODO: setup
|
|
33
64
|
pass
|
|
34
65
|
|
|
35
66
|
def restore(self):
|
|
36
|
-
# TODO: teardown
|
|
37
67
|
pass
|
|
38
68
|
|
|
39
69
|
def move_cursor(self, x, y):
|
|
@@ -117,8 +147,16 @@ async def start_repl():
|
|
|
117
147
|
# Capture startup script before JS moves to next REPL and overwrites it
|
|
118
148
|
startup_script = getattr(js, "pyreplStartupScript", None)
|
|
119
149
|
theme_name = getattr(js, "pyreplTheme", "catppuccin-mocha")
|
|
150
|
+
pygments_fallback = getattr(js, "pyreplPygmentsFallback", "catppuccin-mocha")
|
|
120
151
|
info_line = getattr(js, "pyreplInfo", "Python 3.13 (Pyodide)")
|
|
121
152
|
readonly = getattr(js, "pyreplReadonly", False)
|
|
153
|
+
prompt_color = getattr(js, "pyreplPromptColor", None) or "green"
|
|
154
|
+
pygments_style_js = getattr(js, "pyreplPygmentsStyle", None)
|
|
155
|
+
|
|
156
|
+
# Build prompt strings with configured color
|
|
157
|
+
color_code = color_to_ansi(prompt_color)
|
|
158
|
+
PS1 = f"\\x1b[{color_code}m>>> \\x1b[0m"
|
|
159
|
+
PS2 = f"\\x1b[{color_code}m... \\x1b[0m"
|
|
122
160
|
|
|
123
161
|
# Expose to JS so it can send input (signals JS can proceed to next REPL)
|
|
124
162
|
js.currentBrowserConsole = browser_console
|
|
@@ -136,16 +174,40 @@ async def start_repl():
|
|
|
136
174
|
async def load_pygments():
|
|
137
175
|
nonlocal pygments_loaded, lexer, formatter
|
|
138
176
|
try:
|
|
139
|
-
await micropip.install("catppuccin[pygments]")
|
|
177
|
+
await micropip.install(["pygments", "catppuccin[pygments]"])
|
|
140
178
|
from pygments.lexers import Python3Lexer
|
|
141
179
|
from pygments.formatters import Terminal256Formatter
|
|
180
|
+
from pygments.styles import get_style_by_name
|
|
181
|
+
from pygments.style import Style
|
|
182
|
+
from pygments.token import string_to_tokentype
|
|
142
183
|
|
|
143
184
|
lexer = Python3Lexer()
|
|
144
|
-
|
|
185
|
+
|
|
186
|
+
# Use custom pygmentsStyle if provided
|
|
187
|
+
if pygments_style_js:
|
|
188
|
+
# Convert JS object to Python dict
|
|
189
|
+
custom_styles = dict(pygments_style_js.to_py())
|
|
190
|
+
|
|
191
|
+
# Build style class dynamically
|
|
192
|
+
style_dict = {}
|
|
193
|
+
for token_str, color in custom_styles.items():
|
|
194
|
+
token = string_to_tokentype(token_str)
|
|
195
|
+
style_dict[token] = color
|
|
196
|
+
|
|
197
|
+
CustomStyle = type("CustomStyle", (Style,), {"styles": style_dict})
|
|
198
|
+
formatter = Terminal256Formatter(style=CustomStyle)
|
|
199
|
+
else:
|
|
200
|
+
# Try theme name as Pygments style, fall back based on background
|
|
201
|
+
try:
|
|
202
|
+
get_style_by_name(theme_name)
|
|
203
|
+
style = theme_name
|
|
204
|
+
except Exception:
|
|
205
|
+
style = pygments_fallback
|
|
206
|
+
formatter = Terminal256Formatter(style=style)
|
|
207
|
+
|
|
145
208
|
pygments_loaded = True
|
|
146
|
-
except Exception:
|
|
147
|
-
|
|
148
|
-
pass
|
|
209
|
+
except Exception as e:
|
|
210
|
+
browser_console.term.write(f"[ERROR] Pygments load failed: {e}\\r\\n")
|
|
149
211
|
|
|
150
212
|
# Start loading Pygments in background (non-blocking)
|
|
151
213
|
asyncio.create_task(load_pygments())
|
|
@@ -223,12 +285,22 @@ async def start_repl():
|
|
|
223
285
|
)()
|
|
224
286
|
exec(startup_script, repl_globals)
|
|
225
287
|
sys.stdout, sys.stderr = old_stdout, old_stderr
|
|
288
|
+
|
|
226
289
|
except Exception as e:
|
|
227
290
|
sys.stdout, sys.stderr = old_stdout, old_stderr
|
|
228
291
|
browser_console.term.write(
|
|
229
292
|
f"\\x1b[31mStartup script error - {type(e).__name__}: {e}\\x1b[0m\\r\\n"
|
|
230
293
|
)
|
|
231
294
|
|
|
295
|
+
# If startup script defined a setup() function, call it with output visible
|
|
296
|
+
if "setup" in repl_globals and callable(repl_globals["setup"]):
|
|
297
|
+
try:
|
|
298
|
+
exec_with_redirect(compile("setup()", "<setup>", "exec"), repl_globals)
|
|
299
|
+
except Exception as e:
|
|
300
|
+
browser_console.term.write(
|
|
301
|
+
f"\\x1b[31msetup() error - {type(e).__name__}: {e}\\x1b[0m\\r\\n"
|
|
302
|
+
)
|
|
303
|
+
|
|
232
304
|
def get_completions(text):
|
|
233
305
|
"""Get all completions for the given text."""
|
|
234
306
|
completions = []
|
|
@@ -429,9 +501,7 @@ async def start_repl():
|
|
|
429
501
|
browser_console.term.write("\\r\\x1b[K") # Go to start, clear line
|
|
430
502
|
prompt = PS1 if len(lines) == 0 else PS2
|
|
431
503
|
browser_console.term.write(prompt + syntax_highlight(current_line))
|
|
432
|
-
`;var
|
|
433
|
-
`)},stderr:(e)=>{if(p)p.write(e+`\r
|
|
434
|
-
`)}})}return await w}function k(){if(!m)m=Promise.resolve(x);return m}function j(){if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",b);else b()}function q(){if(document.getElementById("pyrepl-styles"))return;let n=document.createElement("link");n.rel="stylesheet",n.href="https://cdn.jsdelivr.net/npm/@xterm/xterm/css/xterm.css",document.head.appendChild(n);let e=document.createElement("style");e.id="pyrepl-styles",e.textContent=`
|
|
504
|
+
`;var Q=null,H=null,P=Promise.resolve(),J={"catppuccin-mocha":{background:"#1e1e2e",foreground:"#cdd6f4",cursor:"#f5e0dc",cursorAccent:"#1e1e2e",selectionBackground:"#585b70",black:"#45475a",red:"#f38ba8",green:"#a6e3a1",yellow:"#f9e2af",blue:"#89b4fa",magenta:"#f5c2e7",cyan:"#94e2d5",white:"#bac2de",brightBlack:"#585b70",brightRed:"#f38ba8",brightGreen:"#a6e3a1",brightYellow:"#f9e2af",brightBlue:"#89b4fa",brightMagenta:"#f5c2e7",brightCyan:"#94e2d5",brightWhite:"#a6adc8",headerBackground:"#181825",headerForeground:"#6c7086"},"catppuccin-latte":{background:"#eff1f5",foreground:"#4c4f69",cursor:"#dc8a78",cursorAccent:"#eff1f5",selectionBackground:"#acb0be",black:"#5c5f77",red:"#d20f39",green:"#40a02b",yellow:"#df8e1d",blue:"#1e66f5",magenta:"#ea76cb",cyan:"#179299",white:"#acb0be",brightBlack:"#6c6f85",brightRed:"#d20f39",brightGreen:"#40a02b",brightYellow:"#df8e1d",brightBlue:"#1e66f5",brightMagenta:"#ea76cb",brightCyan:"#179299",brightWhite:"#bcc0cc",headerBackground:"#dce0e8",headerForeground:"#8c8fa1"}},E="catppuccin-mocha";function Nn(n){if(!n.startsWith("#"))return!0;let e=n.slice(1),r=parseInt(e.slice(0,2),16),l=parseInt(e.slice(2,4),16),o=parseInt(e.slice(4,6),16);return(0.299*r+0.587*l+0.114*o)/255<0.5}function Sn(n){if("black"in n&&"red"in n)return n;let e=Nn(n.background)?"catppuccin-mocha":"catppuccin-latte",r=J[e];return{cursor:r.cursor,cursorAccent:r.cursorAccent,selectionBackground:r.selectionBackground,black:r.black,red:r.red,green:r.green,yellow:r.yellow,blue:r.blue,magenta:r.magenta,cyan:r.cyan,white:r.white,brightBlack:r.brightBlack,brightRed:r.brightRed,brightGreen:r.brightGreen,brightYellow:r.brightYellow,brightBlue:r.brightBlue,brightMagenta:r.brightMagenta,brightCyan:r.brightCyan,brightWhite:r.brightWhite,background:n.background,foreground:n.foreground,headerBackground:n.headerBackground??r.headerBackground,headerForeground:n.headerForeground??r.headerForeground,promptColor:n.promptColor,pygmentsStyle:n.pygmentsStyle}}var En={copy:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>',clear:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path></svg>'};function Zn(n){let e,r,l=n.dataset.themeConfig;if(l)try{let s=JSON.parse(l);e=Sn(s),r="custom"}catch{console.warn("pyrepl-web: invalid data-theme-config JSON, falling back to default"),e=J[E],r=E}else{r=n.dataset.theme||E;let s=window.pyreplThemes?.[r]||J[r]||J[E];if(e=Sn(s),!window.pyreplThemes?.[r]&&!J[r])console.warn(`pyrepl-web: unknown theme "${r}", falling back to default`),r=E}let o=n.dataset.packages,_=o?o.split(",").map((s)=>s.trim()).filter(Boolean):[];return{theme:e,themeName:r,showHeader:n.dataset.header!=="false",showButtons:n.dataset.buttons!=="false",title:n.dataset.title||"python",packages:_,src:n.dataset.src||null,readonly:n.dataset.readonly==="true"}}async function zn(){if(!Q){let{loadPyodide:n}=await import("./chunk-b4v3wyq6.js");Q=n({indexURL:"https://cdn.jsdelivr.net/pyodide/v0.29.2/full/",stdout:()=>{},stderr:()=>{}})}return await Q}function Qn(){if(!H)H=Promise.resolve(hn);return H}class j{container;theme;packages;readonly;src;showHeader;showButtons;title;constructor(n){this.container=n.container,this.theme=n.theme||E,this.packages=n.packages||[],this.readonly=n.readonly||!1,this.src=n.src,this.showHeader=n.showHeader!==void 0?n.showHeader:!0,this.showButtons=n.showButtons!==void 0?n.showButtons:!0,this.title=n.title||"python"}async init(){if(this.container.dataset.theme=this.theme,this.container.dataset.packages=this.packages.join(","),this.container.dataset.readonly=this.readonly?"true":"false",this.src)this.container.dataset.src=this.src;this.container.dataset.header=this.showHeader?"true":"false",this.container.dataset.buttons=this.showButtons?"true":"false",this.container.dataset.title=this.title;let{term:n,config:e}=await qn(this.container);P=P.then(()=>gn(this.container,n,e)),await P}}function Hn(){if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",Pn);else Pn()}function jn(){if(document.getElementById("pyrepl-styles"))return;let n=document.createElement("link");n.rel="stylesheet",n.href="https://cdn.jsdelivr.net/npm/@xterm/xterm/css/xterm.css",document.head.appendChild(n);let e=document.createElement("style");e.id="pyrepl-styles",e.textContent=`
|
|
435
505
|
.pyrepl {
|
|
436
506
|
display: inline-block;
|
|
437
507
|
border-radius: 8px;
|
|
@@ -510,20 +580,14 @@ async def start_repl():
|
|
|
510
580
|
scrollbar-width: none;
|
|
511
581
|
background-color: var(--pyrepl-bg) !important;
|
|
512
582
|
}
|
|
513
|
-
`,document.head.appendChild(e)}function
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
</div>
|
|
525
|
-
`:'<div style="width: 48px"></div>'}
|
|
526
|
-
`,e}async function N(n){q();let e=P(n);if(R(n,e.theme),e.showHeader)n.appendChild(F(e));let r=await import("./chunk-7hjm8rrn.js"),t=document.createElement("div");n.appendChild(t);let l=new r.Terminal({cursorBlink:!e.readonly,cursorStyle:e.readonly?"bar":"block",fontSize:14,fontFamily:"monospace",theme:e.theme,disableStdin:e.readonly});return l.open(t),{term:l,config:e}}async function I(n,e,r){let t=await E();if(await t.loadPackage("micropip"),r.packages.length>0)await t.pyimport("micropip").install(r.packages);let o=`Python 3.13${r.packages.length>0?` (installed packages: ${r.packages.join(", ")})`:""}`;if(e.write(`\x1B[90m${o}\x1B[0m\r
|
|
527
|
-
`),globalThis.term=e,globalThis.pyreplTheme=r.themeName,globalThis.pyreplInfo=o,globalThis.pyreplReadonly=r.readonly,r.src)try{let s=await fetch(r.src);if(s.ok)globalThis.pyreplStartupScript=await s.text();else console.warn(`pyrepl-web: failed to fetch script from ${r.src}`)}catch(s){console.warn(`pyrepl-web: error fetching script from ${r.src}`,s)}let _=await k();t.runPython(_),t.runPythonAsync("await start_repl()");while(!globalThis.currentBrowserConsole)await new Promise((s)=>setTimeout(s,10));let S=globalThis.currentBrowserConsole;if(globalThis.currentBrowserConsole=null,!r.readonly)e.onData((s)=>{for(let a of s)S.push_char(a.charCodeAt(0))});if(r.showHeader&&r.showButtons){let s=n.querySelector('[data-action="copy"]'),a=n.querySelector('[data-action="clear"]');s?.addEventListener("click",()=>{let u=e.buffer.active,f="";for(let d=0;d<u.length;d++){let y=u.getLine(d);if(y)f+=y.translateToString(!0)+`
|
|
528
|
-
`}navigator.clipboard.writeText(f.trimEnd())}),a?.addEventListener("click",()=>{e.reset(),e.write(`\x1B[90m${o}\x1B[0m\r
|
|
529
|
-
`),e.write("\x1B[32m>>> \x1B[0m")})}}async function b(){let n=document.querySelectorAll(".pyrepl");if(n.length===0){console.warn("pyrepl-web: no .pyrepl elements found");return}let e=await Promise.all(Array.from(n).map(async(r)=>({container:r,...await N(r)})));for(let{container:r,term:t,config:l}of e)await I(r,t,l)}j();
|
|
583
|
+
`,document.head.appendChild(e)}function Rn(n,e){let r=e.headerBackground||e.black,l=e.headerForeground||e.brightBlack;n.style.setProperty("--pyrepl-bg",e.background),n.style.setProperty("--pyrepl-header-bg",r),n.style.setProperty("--pyrepl-header-title",l),n.style.setProperty("--pyrepl-red",e.red),n.style.setProperty("--pyrepl-yellow",e.yellow),n.style.setProperty("--pyrepl-green",e.green),n.style.setProperty("--pyrepl-shadow","0 4px 24px rgba(0, 0, 0, 0.3)")}function Un(n){let e=document.createElement("div");e.className="pyrepl-header";let r=document.createElement("div");r.className="pyrepl-header-dots",r.innerHTML=`
|
|
584
|
+
<div class="pyrepl-header-dot red"></div>
|
|
585
|
+
<div class="pyrepl-header-dot yellow"></div>
|
|
586
|
+
<div class="pyrepl-header-dot green"></div>
|
|
587
|
+
`;let l=document.createElement("div");if(l.className="pyrepl-header-title",l.textContent=n.title,e.appendChild(r),e.appendChild(l),n.showButtons){let o=document.createElement("div");o.className="pyrepl-header-buttons",o.innerHTML=`
|
|
588
|
+
<button class="pyrepl-header-btn" data-action="copy" title="Copy output">${En.copy}</button>
|
|
589
|
+
<button class="pyrepl-header-btn" data-action="clear" title="Clear terminal">${En.clear}</button>
|
|
590
|
+
`,e.appendChild(o)}else{let o=document.createElement("div");o.style.width="48px",e.appendChild(o)}return e}async function qn(n){jn();let e=Zn(n);if(Rn(n,e.theme),e.showHeader)n.appendChild(Un(e));let r=await import("./chunk-1qs0a4h5.js"),l=document.createElement("div");n.appendChild(l);let o=new r.Terminal({cursorBlink:!e.readonly,cursorStyle:e.readonly?"bar":"block",fontSize:14,fontFamily:"monospace",theme:e.theme,disableStdin:e.readonly});return o.open(l),{term:o,config:e}}async function gn(n,e,r){let l=await zn();if(await l.loadPackage("micropip"),r.packages.length>0)await l.pyimport("micropip").install(r.packages);let _=`Python 3.13${r.packages.length>0?` (installed packages: ${r.packages.join(", ")})`:""}`;if(e.write(`\x1B[90m${_}\x1B[0m\r
|
|
591
|
+
`),globalThis.term=e,globalThis.pyreplTheme=r.themeName,globalThis.pyreplPygmentsFallback=Nn(r.theme.background)?"catppuccin-mocha":"catppuccin-latte",globalThis.pyreplInfo=_,globalThis.pyreplReadonly=r.readonly,globalThis.pyreplPromptColor=r.theme.promptColor||"green",globalThis.pyreplPygmentsStyle=r.theme.pygmentsStyle,r.src)try{let w=await fetch(r.src);if(w.ok)globalThis.pyreplStartupScript=await w.text();else console.warn(`pyrepl-web: failed to fetch script from ${r.src}`)}catch(w){console.warn(`pyrepl-web: error fetching script from ${r.src}`,w)}let s=await Qn();l.runPython(s),l.runPythonAsync("await start_repl()");while(!globalThis.currentBrowserConsole)await new Promise((w)=>setTimeout(w,10));let p=globalThis.currentBrowserConsole;if(globalThis.currentBrowserConsole=null,globalThis.term=null,globalThis.pyreplStartupScript=void 0,globalThis.pyreplTheme="",globalThis.pyreplPygmentsFallback="",globalThis.pyreplInfo="",globalThis.pyreplReadonly=!1,globalThis.pyreplPromptColor="",globalThis.pyreplPygmentsStyle=void 0,!r.readonly)e.onData((w)=>{for(let m of w)p.push_char(m.charCodeAt(0))});if(r.showHeader&&r.showButtons){let w=n.querySelector('[data-action="copy"]'),m=n.querySelector('[data-action="clear"]');w?.addEventListener("click",()=>{let c=e.buffer.active,d="";for(let x=0;x<c.length;x++){let i=c.getLine(x);if(i)d+=`${i.translateToString(!0)}
|
|
592
|
+
`}navigator.clipboard.writeText(d.trimEnd())}),m?.addEventListener("click",()=>{e.reset(),e.write(`\x1B[90m${_}\x1B[0m\r
|
|
593
|
+
`),e.write("\x1B[32m>>> \x1B[0m")})}}async function Pn(){let n=document.querySelectorAll(".pyrepl"),e=Array.from(n).filter((l)=>!l.closest("py-repl")&&!l.dataset.pyreplInitialized);if(e.length===0)return;for(let l of e)l.dataset.pyreplInitialized="true";let r=await Promise.all(Array.from(e).map(async(l)=>({container:l,...await qn(l)})));for(let{container:l,term:o,config:_}of r)P=P.then(()=>gn(l,o,_));await P}Hn();class R extends h{static properties={theme:{type:String},packages:{type:String},replTitle:{type:String,attribute:"repl-title"},isReadonly:{type:Boolean,attribute:"readonly"},noButtons:{type:Boolean,attribute:"no-buttons"},noHeader:{type:Boolean,attribute:"no-header"},src:{type:String}};constructor(){super();this.theme="catppuccin-mocha",this.packages="",this.replTitle="Python REPL",this.isReadonly=!1,this.noButtons=!1,this.noHeader=!1,this.src=""}createRenderRoot(){return this}firstUpdated(n){super.firstUpdated(n);let e=this.querySelector(".pyrepl");if(!e){console.error("pyrepl-web: .pyrepl container not found in <py-repl>");return}e.dataset.pyreplInitialized="true",new j({container:e,theme:this.theme,packages:this.packages.split(",").map((l)=>l.trim()).filter((l)=>l.length>0),readonly:this.isReadonly,src:this.src||void 0,showHeader:!this.noHeader,showButtons:!this.noButtons,title:this.replTitle}).init()}render(){return dn`<div class="pyrepl"></div>`}}R=Bn([vn("py-repl")],R);export{R as PyRepl};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pyrepl-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "An embeddable Python REPL powered by Pyodide",
|
|
5
5
|
"main": "dist/pyrepl.js",
|
|
6
6
|
"files": [
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@xterm/xterm": "^6.0.0",
|
|
47
|
+
"lit": "^3.3.2",
|
|
47
48
|
"pyodide": "^0.29.2"
|
|
48
49
|
}
|
|
49
50
|
}
|
package/dist/chunk-cmrefyz7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var j=Object.create;var{getPrototypeOf:k,defineProperty:e,getOwnPropertyNames:h,getOwnPropertyDescriptor:l}=Object,i=Object.prototype.hasOwnProperty;var m=(a,b,c)=>{c=a!=null?j(k(a)):{};let d=b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c;for(let f of h(a))if(!i.call(d,f))e(d,f,{get:()=>a[f],enumerable:!0});return d},g=new WeakMap,n=(a)=>{var b=g.get(a),c;if(b)return b;if(b=e({},"__esModule",{value:!0}),a&&typeof a==="object"||typeof a==="function")h(a).map((d)=>!i.call(b,d)&&e(b,d,{get:()=>a[d],enumerable:!(c=l(a,d))||c.enumerable}));return g.set(a,b),b},o=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var p=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0,configurable:!0,set:(d)=>b[c]=()=>d})};var q=(a,b)=>()=>(a&&(b=a(a=0)),b);var r=((a)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});
|
|
2
|
-
export{m as a,n as b,o as c,p as d,q as e,r as f};
|