es-module-shims 1.4.5 → 1.4.6
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/CHANGELOG.md +287 -277
- package/README.md +741 -741
- package/dist/es-module-shims.js +793 -789
- package/dist/es-module-shims.wasm.js +792 -788
- package/index.d.ts +157 -157
- package/package.json +67 -67
- package/dist/es-module-shims.min.js +0 -2
- package/dist/es-module-shims.min.js.map +0 -1
|
@@ -1,798 +1,802 @@
|
|
|
1
|
-
/* ES Module Shims Wasm 1.4.
|
|
1
|
+
/* ES Module Shims Wasm 1.4.6 */
|
|
2
2
|
(function () {
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (relUrl
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
pathname =
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if (json.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
let
|
|
259
|
-
let
|
|
260
|
-
|
|
261
|
-
let
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
iframe
|
|
283
|
-
|
|
284
|
-
|
|
4
|
+
const noop = () => {};
|
|
5
|
+
|
|
6
|
+
const optionsScript = document.querySelector('script[type=esms-options]');
|
|
7
|
+
|
|
8
|
+
const esmsInitOptions = optionsScript ? JSON.parse(optionsScript.innerHTML) : self.esmsInitOptions ? self.esmsInitOptions : {};
|
|
9
|
+
|
|
10
|
+
let shimMode = !!esmsInitOptions.shimMode;
|
|
11
|
+
const resolveHook = globalHook(shimMode && esmsInitOptions.resolve);
|
|
12
|
+
|
|
13
|
+
const skip = esmsInitOptions.skip ? new RegExp(esmsInitOptions.skip) : null;
|
|
14
|
+
|
|
15
|
+
let nonce = esmsInitOptions.nonce;
|
|
16
|
+
|
|
17
|
+
const mapOverrides = esmsInitOptions.mapOverrides;
|
|
18
|
+
|
|
19
|
+
if (!nonce) {
|
|
20
|
+
const nonceElement = document.querySelector('script[nonce]');
|
|
21
|
+
if (nonceElement)
|
|
22
|
+
nonce = nonceElement.nonce || nonceElement.getAttribute('nonce');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const onerror = globalHook(esmsInitOptions.onerror || noop);
|
|
26
|
+
const onpolyfill = esmsInitOptions.onpolyfill ? globalHook(esmsInitOptions.onpolyfill) : () => console.info(`OK: ^ TypeError module failure has been polyfilled`);
|
|
27
|
+
|
|
28
|
+
const { revokeBlobURLs, noLoadEventRetriggers, enforceIntegrity } = esmsInitOptions;
|
|
29
|
+
|
|
30
|
+
const fetchHook = esmsInitOptions.fetch ? globalHook(esmsInitOptions.fetch) : fetch;
|
|
31
|
+
|
|
32
|
+
function globalHook (name) {
|
|
33
|
+
return typeof name === 'string' ? self[name] : name;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const enable = Array.isArray(esmsInitOptions.polyfillEnable) ? esmsInitOptions.polyfillEnable : [];
|
|
37
|
+
const cssModulesEnabled = enable.includes('css-modules');
|
|
38
|
+
const jsonModulesEnabled = enable.includes('json-modules');
|
|
39
|
+
|
|
40
|
+
function setShimMode () {
|
|
41
|
+
shimMode = true;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const edge = !!navigator.userAgent.match(/Edge\/\d+\.\d+/);
|
|
45
|
+
|
|
46
|
+
const baseUrl = document.baseURI;
|
|
47
|
+
|
|
48
|
+
function createBlob (source, type = 'text/javascript') {
|
|
49
|
+
return URL.createObjectURL(new Blob([source], { type }));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const eoop = err => setTimeout(() => { throw err });
|
|
53
|
+
|
|
54
|
+
const throwError = err => { (window.reportError || window.safari && console.error || eoop)(err), void onerror(err); };
|
|
55
|
+
|
|
56
|
+
function isURL (url) {
|
|
57
|
+
try {
|
|
58
|
+
new URL(url);
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
catch (_) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const backslashRegEx = /\\/g;
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
* Import maps implementation
|
|
70
|
+
*
|
|
71
|
+
* To make lookups fast we pre-resolve the entire import map
|
|
72
|
+
* and then match based on backtracked hash lookups
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
function resolveUrl (relUrl, parentUrl) {
|
|
76
|
+
return resolveIfNotPlainOrUrl(relUrl, parentUrl) || (relUrl.indexOf(':') !== -1 ? relUrl : resolveIfNotPlainOrUrl('./' + relUrl, parentUrl));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function resolveIfNotPlainOrUrl (relUrl, parentUrl) {
|
|
80
|
+
// strip off any trailing query params or hashes
|
|
81
|
+
parentUrl = parentUrl && parentUrl.split('#')[0].split('?')[0];
|
|
82
|
+
if (relUrl.indexOf('\\') !== -1)
|
|
83
|
+
relUrl = relUrl.replace(backslashRegEx, '/');
|
|
84
|
+
// protocol-relative
|
|
85
|
+
if (relUrl[0] === '/' && relUrl[1] === '/') {
|
|
86
|
+
return parentUrl.slice(0, parentUrl.indexOf(':') + 1) + relUrl;
|
|
87
|
+
}
|
|
88
|
+
// relative-url
|
|
89
|
+
else if (relUrl[0] === '.' && (relUrl[1] === '/' || relUrl[1] === '.' && (relUrl[2] === '/' || relUrl.length === 2 && (relUrl += '/')) ||
|
|
90
|
+
relUrl.length === 1 && (relUrl += '/')) ||
|
|
91
|
+
relUrl[0] === '/') {
|
|
92
|
+
const parentProtocol = parentUrl.slice(0, parentUrl.indexOf(':') + 1);
|
|
93
|
+
// Disabled, but these cases will give inconsistent results for deep backtracking
|
|
94
|
+
//if (parentUrl[parentProtocol.length] !== '/')
|
|
95
|
+
// throw new Error('Cannot resolve');
|
|
96
|
+
// read pathname from parent URL
|
|
97
|
+
// pathname taken to be part after leading "/"
|
|
98
|
+
let pathname;
|
|
99
|
+
if (parentUrl[parentProtocol.length + 1] === '/') {
|
|
100
|
+
// resolving to a :// so we need to read out the auth and host
|
|
101
|
+
if (parentProtocol !== 'file:') {
|
|
102
|
+
pathname = parentUrl.slice(parentProtocol.length + 2);
|
|
103
|
+
pathname = pathname.slice(pathname.indexOf('/') + 1);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
pathname = parentUrl.slice(8);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
// resolving to :/ so pathname is the /... part
|
|
111
|
+
pathname = parentUrl.slice(parentProtocol.length + (parentUrl[parentProtocol.length] === '/'));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (relUrl[0] === '/')
|
|
115
|
+
return parentUrl.slice(0, parentUrl.length - pathname.length - 1) + relUrl;
|
|
116
|
+
|
|
117
|
+
// join together and split for removal of .. and . segments
|
|
118
|
+
// looping the string instead of anything fancy for perf reasons
|
|
119
|
+
// '../../../../../z' resolved to 'x/y' is just 'z'
|
|
120
|
+
const segmented = pathname.slice(0, pathname.lastIndexOf('/') + 1) + relUrl;
|
|
121
|
+
|
|
122
|
+
const output = [];
|
|
123
|
+
let segmentIndex = -1;
|
|
124
|
+
for (let i = 0; i < segmented.length; i++) {
|
|
125
|
+
// busy reading a segment - only terminate on '/'
|
|
126
|
+
if (segmentIndex !== -1) {
|
|
127
|
+
if (segmented[i] === '/') {
|
|
128
|
+
output.push(segmented.slice(segmentIndex, i + 1));
|
|
129
|
+
segmentIndex = -1;
|
|
130
|
+
}
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
// new segment - check if it is relative
|
|
134
|
+
else if (segmented[i] === '.') {
|
|
135
|
+
// ../ segment
|
|
136
|
+
if (segmented[i + 1] === '.' && (segmented[i + 2] === '/' || i + 2 === segmented.length)) {
|
|
137
|
+
output.pop();
|
|
138
|
+
i += 2;
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
// ./ segment
|
|
142
|
+
else if (segmented[i + 1] === '/' || i + 1 === segmented.length) {
|
|
143
|
+
i += 1;
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// it is the start of a new segment
|
|
148
|
+
while (segmented[i] === '/') i++;
|
|
149
|
+
segmentIndex = i;
|
|
150
|
+
}
|
|
151
|
+
// finish reading out the last segment
|
|
152
|
+
if (segmentIndex !== -1)
|
|
153
|
+
output.push(segmented.slice(segmentIndex));
|
|
154
|
+
return parentUrl.slice(0, parentUrl.length - pathname.length) + output.join('');
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function resolveAndComposeImportMap (json, baseUrl, parentMap) {
|
|
159
|
+
const outMap = { imports: Object.assign({}, parentMap.imports), scopes: Object.assign({}, parentMap.scopes) };
|
|
160
|
+
|
|
161
|
+
if (json.imports)
|
|
162
|
+
resolveAndComposePackages(json.imports, outMap.imports, baseUrl, parentMap);
|
|
163
|
+
|
|
164
|
+
if (json.scopes)
|
|
165
|
+
for (let s in json.scopes) {
|
|
166
|
+
const resolvedScope = resolveUrl(s, baseUrl);
|
|
167
|
+
resolveAndComposePackages(json.scopes[s], outMap.scopes[resolvedScope] || (outMap.scopes[resolvedScope] = {}), baseUrl, parentMap);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return outMap;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function getMatch (path, matchObj) {
|
|
174
|
+
if (matchObj[path])
|
|
175
|
+
return path;
|
|
176
|
+
let sepIndex = path.length;
|
|
177
|
+
do {
|
|
178
|
+
const segment = path.slice(0, sepIndex + 1);
|
|
179
|
+
if (segment in matchObj)
|
|
180
|
+
return segment;
|
|
181
|
+
} while ((sepIndex = path.lastIndexOf('/', sepIndex - 1)) !== -1)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function applyPackages (id, packages) {
|
|
185
|
+
const pkgName = getMatch(id, packages);
|
|
186
|
+
if (pkgName) {
|
|
187
|
+
const pkg = packages[pkgName];
|
|
188
|
+
if (pkg === null) return;
|
|
189
|
+
return pkg + id.slice(pkgName.length);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
function resolveImportMap (importMap, resolvedOrPlain, parentUrl) {
|
|
195
|
+
let scopeUrl = parentUrl && getMatch(parentUrl, importMap.scopes);
|
|
196
|
+
while (scopeUrl) {
|
|
197
|
+
const packageResolution = applyPackages(resolvedOrPlain, importMap.scopes[scopeUrl]);
|
|
198
|
+
if (packageResolution)
|
|
199
|
+
return packageResolution;
|
|
200
|
+
scopeUrl = getMatch(scopeUrl.slice(0, scopeUrl.lastIndexOf('/')), importMap.scopes);
|
|
201
|
+
}
|
|
202
|
+
return applyPackages(resolvedOrPlain, importMap.imports) || resolvedOrPlain.indexOf(':') !== -1 && resolvedOrPlain;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function resolveAndComposePackages (packages, outPackages, baseUrl, parentMap) {
|
|
206
|
+
for (let p in packages) {
|
|
207
|
+
const resolvedLhs = resolveIfNotPlainOrUrl(p, baseUrl) || p;
|
|
208
|
+
if ((!shimMode || !mapOverrides) && outPackages[resolvedLhs] && (outPackages[resolvedLhs] !== packages[resolvedLhs])) {
|
|
209
|
+
throw Error(`Rejected map override "${resolvedLhs}" from ${outPackages[resolvedLhs]} to ${packages[resolvedLhs]}.`);
|
|
210
|
+
}
|
|
211
|
+
let target = packages[p];
|
|
212
|
+
if (typeof target !== 'string')
|
|
213
|
+
continue;
|
|
214
|
+
const mapped = resolveImportMap(parentMap, resolveIfNotPlainOrUrl(target, baseUrl) || target, baseUrl);
|
|
215
|
+
if (mapped) {
|
|
216
|
+
outPackages[resolvedLhs] = mapped;
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
console.warn(`Mapping "${p}" -> "${packages[p]}" does not resolve`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
let supportsDynamicImportCheck = false;
|
|
224
|
+
|
|
225
|
+
let dynamicImport;
|
|
226
|
+
try {
|
|
227
|
+
dynamicImport = (0, eval)('u=>import(u)');
|
|
228
|
+
supportsDynamicImportCheck = true;
|
|
229
|
+
}
|
|
230
|
+
catch (e) {}
|
|
231
|
+
|
|
232
|
+
if (!supportsDynamicImportCheck) {
|
|
233
|
+
let err;
|
|
234
|
+
window.addEventListener('error', _err => err = _err);
|
|
235
|
+
dynamicImport = (url, { errUrl = url }) => {
|
|
236
|
+
err = undefined;
|
|
237
|
+
const src = createBlob(`import*as m from'${url}';self._esmsi=m;`);
|
|
238
|
+
const s = Object.assign(document.createElement('script'), { type: 'module', src });
|
|
239
|
+
s.setAttribute('noshim', '');
|
|
240
|
+
document.head.appendChild(s);
|
|
241
|
+
return new Promise((resolve, reject) => {
|
|
242
|
+
s.addEventListener('load', () => {
|
|
243
|
+
document.head.removeChild(s);
|
|
244
|
+
if (self._esmsi) {
|
|
245
|
+
resolve(self._esmsi, baseUrl);
|
|
246
|
+
self._esmsi = null;
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
reject(err.error || new Error(`Error loading or executing the graph of ${errUrl} (check the console for ${src}).`));
|
|
250
|
+
err = undefined;
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// support browsers without dynamic import support (eg Firefox 6x)
|
|
258
|
+
let supportsJsonAssertions = false;
|
|
259
|
+
let supportsCssAssertions = false;
|
|
260
|
+
|
|
261
|
+
let supportsImportMeta = false;
|
|
262
|
+
let supportsImportMaps = false;
|
|
263
|
+
|
|
264
|
+
let supportsDynamicImport = false;
|
|
265
|
+
|
|
266
|
+
const featureDetectionPromise = Promise.resolve(supportsDynamicImportCheck).then(_supportsDynamicImport => {
|
|
267
|
+
if (!_supportsDynamicImport)
|
|
268
|
+
return;
|
|
269
|
+
supportsDynamicImport = true;
|
|
270
|
+
|
|
271
|
+
return Promise.all([
|
|
272
|
+
dynamicImport(createBlob('import.meta')).then(() => supportsImportMeta = true, noop),
|
|
273
|
+
cssModulesEnabled && dynamicImport(createBlob('import"data:text/css,{}"assert{type:"css"}')).then(() => supportsCssAssertions = true, noop),
|
|
274
|
+
jsonModulesEnabled && dynamicImport(createBlob('import"data:text/json,{}"assert{type:"json"}')).then(() => supportsJsonAssertions = true, noop),
|
|
275
|
+
new Promise(resolve => {
|
|
276
|
+
self._$s = v => {
|
|
277
|
+
document.head.removeChild(iframe);
|
|
278
|
+
if (v) supportsImportMaps = true;
|
|
279
|
+
delete self._$s;
|
|
280
|
+
resolve();
|
|
281
|
+
};
|
|
282
|
+
const iframe = document.createElement('iframe');
|
|
283
|
+
iframe.style.display = 'none';
|
|
284
|
+
document.head.appendChild(iframe);
|
|
285
|
+
iframe.src = createBlob(`<script type=importmap nonce="${nonce}">{"imports":{"x":"data:text/javascript,"}}<${''}/script><script nonce="${nonce}">import('x').then(()=>1,()=>0).then(v=>parent._$s(v))<${''}/script>`, 'text/html');
|
|
286
|
+
})
|
|
287
|
+
]);
|
|
285
288
|
});
|
|
286
289
|
|
|
287
290
|
/* es-module-lexer 0.9.3 */
|
|
288
291
|
const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse(E,I="@"){if(!B)return init.then(()=>parse(E));const g=E.length+1,D=(B.__heap_base.value||B.__heap_base)+4*g-B.memory.buffer.byteLength;D>0&&B.memory.grow(Math.ceil(D/65536));const w=B.sa(g-1);if((A?C:Q)(E,new Uint16Array(B.memory.buffer,w,g)),!B.parse())throw Object.assign(new Error(`Parse error ${I}:${E.slice(0,B.e()).split("\n").length}:${B.e()-E.lastIndexOf("\n",B.e()-1)}`),{idx:B.e()});const L=[],k=[];for(;B.ri();){const A=B.is(),Q=B.ie(),C=B.ai(),I=B.id(),g=B.ss(),D=B.se();let w;B.ip()&&(w=J(E.slice(-1===I?A-1:A,-1===I?Q+1:Q))),L.push({n:w,s:A,e:Q,ss:g,se:D,d:I,a:C});}for(;B.re();){const A=E.slice(B.es(),B.ee()),Q=A[0];k.push('"'===Q||"'"===Q?J(A):A);}function J(A){try{return (0,eval)(A)}catch(A){}}return [L,k,!!B.f()]}function Q(A,Q){const C=A.length;let B=0;for(;B<C;){const C=A.charCodeAt(B);Q[B++]=(255&C)<<8|C>>>8;}}function C(A,Q){const C=A.length;let B=0;for(;B<C;)Q[B]=A.charCodeAt(B++);}let B;const init=WebAssembly.compile((E="AGFzbQEAAAABXA1gAX8Bf2AEf39/fwBgAn9/AGAAAX9gBn9/f39/fwF/YAAAYAF/AGAEf39/fwF/YAN/f38Bf2AHf39/f39/fwF/YAV/f39/fwF/YAJ/fwF/YAh/f39/f39/fwF/AzEwAAECAwMDAwMDAwMDAwMDAwAABAUFBQYFBgAAAAAFBQAEBwgJCgsMAAIAAAALAwkMBAUBcAEBAQUDAQABBg8CfwFB8PAAC38AQfDwAAsHZBEGbWVtb3J5AgACc2EAAAFlAAMCaXMABAJpZQAFAnNzAAYCc2UABw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AALwEEIANHDQAgAC8BAiACRw0AIAAvAQAgAUYhCAsgCAsLHwIAQYAICwIAAABBhAgLEAEAAAACAAAAAAQAAHA4AAA=","undefined"!=typeof Buffer?Buffer.from(E,"base64"):Uint8Array.from(atob(E),A=>A.charCodeAt(0)))).then(WebAssembly.instantiate).then(({exports:A})=>{B=A;});var E;
|
|
289
292
|
|
|
290
|
-
async function defaultResolve (id, parentUrl) {
|
|
291
|
-
return resolveImportMap(importMap, resolveIfNotPlainOrUrl(id, parentUrl) || id, parentUrl);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
async function _resolve (id, parentUrl) {
|
|
295
|
-
const urlResolved = resolveIfNotPlainOrUrl(id, parentUrl);
|
|
296
|
-
return {
|
|
297
|
-
r: resolveImportMap(importMap, urlResolved || id, parentUrl),
|
|
298
|
-
// b = bare specifier
|
|
299
|
-
b: !urlResolved && !isURL(id)
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
const resolve = resolveHook ? async (id, parentUrl) => ({ r: await resolveHook(id, parentUrl, defaultResolve), b: false }) : _resolve;
|
|
304
|
-
|
|
305
|
-
const registry = {};
|
|
306
|
-
|
|
307
|
-
async function loadAll (load, seen) {
|
|
308
|
-
if (load.b || seen[load.u])
|
|
309
|
-
return;
|
|
310
|
-
seen[load.u] = 1;
|
|
311
|
-
await load.L;
|
|
312
|
-
await Promise.all(load.d.map(dep => loadAll(dep, seen)));
|
|
313
|
-
if (!load.n)
|
|
314
|
-
load.n = load.d.some(dep => dep.n);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
let importMap = { imports: {}, scopes: {} };
|
|
318
|
-
let importMapSrcOrLazy = false;
|
|
319
|
-
let baselinePassthrough;
|
|
320
|
-
|
|
321
|
-
const initPromise = featureDetectionPromise.then(() => {
|
|
322
|
-
// shim mode is determined on initialization, no late shim mode
|
|
323
|
-
if (!shimMode) {
|
|
324
|
-
if (document.querySelectorAll('script[type=module-shim],script[type=importmap-shim],link[rel=modulepreload-shim]').length) {
|
|
325
|
-
setShimMode();
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
let seenScript = false;
|
|
329
|
-
for (const script of document.querySelectorAll('script[type=module],script[type=importmap]')) {
|
|
330
|
-
if (!seenScript) {
|
|
331
|
-
if (script.type === 'module')
|
|
332
|
-
seenScript = true;
|
|
333
|
-
}
|
|
334
|
-
else if (script.type === 'importmap') {
|
|
335
|
-
importMapSrcOrLazy = true;
|
|
336
|
-
break;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
baselinePassthrough = supportsDynamicImport && supportsImportMeta && supportsImportMaps && (!jsonModulesEnabled || supportsJsonAssertions) && (!cssModulesEnabled || supportsCssAssertions) && !importMapSrcOrLazy && !false;
|
|
342
|
-
if (shimMode || !baselinePassthrough) {
|
|
343
|
-
new MutationObserver(mutations => {
|
|
344
|
-
for (const mutation of mutations) {
|
|
345
|
-
if (mutation.type !== 'childList') continue;
|
|
346
|
-
for (const node of mutation.addedNodes) {
|
|
347
|
-
if (node.tagName === 'SCRIPT') {
|
|
348
|
-
if (node.type === (shimMode ? 'module-shim' : 'module'))
|
|
349
|
-
processScript(node);
|
|
350
|
-
if (node.type === (shimMode ? 'importmap-shim' : 'importmap'))
|
|
351
|
-
processImportMap(node);
|
|
352
|
-
}
|
|
353
|
-
else if (node.tagName === 'LINK' && node.rel === (shimMode ? 'modulepreload-shim' : 'modulepreload'))
|
|
354
|
-
processPreload(node);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}).observe(document, { childList: true, subtree: true });
|
|
358
|
-
processImportMaps();
|
|
359
|
-
processScriptsAndPreloads();
|
|
360
|
-
return init;
|
|
361
|
-
}
|
|
362
|
-
});
|
|
363
|
-
let importMapPromise = initPromise;
|
|
364
|
-
let firstPolyfillLoad = true;
|
|
365
|
-
let acceptingImportMaps = true;
|
|
366
|
-
|
|
367
|
-
async function topLevelLoad (url, fetchOpts, source, nativelyLoaded, lastStaticLoadPromise) {
|
|
368
|
-
if (!shimMode)
|
|
369
|
-
acceptingImportMaps = false;
|
|
370
|
-
await importMapPromise;
|
|
371
|
-
// early analysis opt-out - no need to even fetch if we have feature support
|
|
372
|
-
if (!shimMode && baselinePassthrough) {
|
|
373
|
-
// for polyfill case, only dynamic import needs a return value here, and dynamic import will never pass nativelyLoaded
|
|
374
|
-
if (nativelyLoaded)
|
|
375
|
-
return null;
|
|
376
|
-
await lastStaticLoadPromise;
|
|
377
|
-
return dynamicImport(source ? createBlob(source) : url, { errUrl: url || source });
|
|
378
|
-
}
|
|
379
|
-
const load = getOrCreateLoad(url, fetchOpts, null, source);
|
|
380
|
-
const seen = {};
|
|
381
|
-
await loadAll(load, seen);
|
|
382
|
-
lastLoad = undefined;
|
|
383
|
-
resolveDeps(load, seen);
|
|
384
|
-
await lastStaticLoadPromise;
|
|
385
|
-
if (source && !shimMode && !load.n && !false) {
|
|
386
|
-
const module = await dynamicImport(createBlob(source), { errUrl: source });
|
|
387
|
-
if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen));
|
|
388
|
-
return module;
|
|
389
|
-
}
|
|
390
|
-
if (firstPolyfillLoad && !shimMode && load.n && nativelyLoaded) {
|
|
391
|
-
onpolyfill();
|
|
392
|
-
firstPolyfillLoad = false;
|
|
393
|
-
}
|
|
394
|
-
const module = await dynamicImport(!shimMode && !load.n && nativelyLoaded ? load.u : load.b, { errUrl: load.u });
|
|
395
|
-
// if the top-level load is a shell, run its update function
|
|
396
|
-
if (load.s)
|
|
397
|
-
(await dynamicImport(load.s)).u$_(module);
|
|
398
|
-
if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen));
|
|
399
|
-
// when tla is supported, this should return the tla promise as an actual handle
|
|
400
|
-
// so readystate can still correspond to the sync subgraph exec completions
|
|
401
|
-
return module;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
function revokeObjectURLs(registryKeys) {
|
|
405
|
-
let batch = 0;
|
|
406
|
-
const keysLength = registryKeys.length;
|
|
407
|
-
const schedule = self.requestIdleCallback ? self.requestIdleCallback : self.requestAnimationFrame;
|
|
408
|
-
schedule(cleanup);
|
|
409
|
-
function cleanup() {
|
|
410
|
-
const batchStartIndex = batch * 100;
|
|
411
|
-
if (batchStartIndex > keysLength) return
|
|
412
|
-
for (const key of registryKeys.slice(batchStartIndex, batchStartIndex + 100)) {
|
|
413
|
-
const load = registry[key];
|
|
414
|
-
if (load) URL.revokeObjectURL(load.b);
|
|
415
|
-
}
|
|
416
|
-
batch++;
|
|
417
|
-
schedule(cleanup);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
async function importShim (id, ...args) {
|
|
422
|
-
// parentUrl if present will be the last argument
|
|
423
|
-
let parentUrl = args[args.length - 1];
|
|
424
|
-
if (typeof parentUrl !== 'string') {
|
|
425
|
-
parentUrl = baseUrl;
|
|
426
|
-
}
|
|
427
|
-
// needed for shim check
|
|
428
|
-
await initPromise;
|
|
429
|
-
if (acceptingImportMaps || shimMode || !baselinePassthrough) {
|
|
430
|
-
processImportMaps();
|
|
431
|
-
if (!shimMode)
|
|
432
|
-
acceptingImportMaps = false;
|
|
433
|
-
}
|
|
434
|
-
await importMapPromise;
|
|
435
|
-
return topLevelLoad((await resolve(id, parentUrl)).r || throwUnresolved(id, parentUrl), { credentials: 'same-origin' });
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
self.importShim = importShim;
|
|
439
|
-
|
|
440
|
-
if (shimMode) {
|
|
441
|
-
importShim.getImportMap = () => JSON.parse(JSON.stringify(importMap));
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
const meta = {};
|
|
445
|
-
|
|
446
|
-
async function importMetaResolve (id, parentUrl = this.url) {
|
|
447
|
-
return (await resolve(id, `${parentUrl}`)).r || throwUnresolved(id, parentUrl);
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
self._esmsm = meta;
|
|
451
|
-
|
|
452
|
-
function urlJsString (url) {
|
|
453
|
-
return `'${url.replace(/'/g, "\\'")}'`;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
let lastLoad;
|
|
457
|
-
function resolveDeps (load, seen) {
|
|
458
|
-
if (load.b || !seen[load.u])
|
|
459
|
-
return;
|
|
460
|
-
seen[load.u] = 0;
|
|
461
|
-
|
|
462
|
-
for (const dep of load.d)
|
|
463
|
-
resolveDeps(dep, seen);
|
|
464
|
-
|
|
465
|
-
const [imports] = load.a;
|
|
466
|
-
|
|
467
|
-
// "execution"
|
|
468
|
-
const source = load.S;
|
|
469
|
-
|
|
470
|
-
// edge doesnt execute sibling in order, so we fix this up by ensuring all previous executions are explicit dependencies
|
|
471
|
-
let resolvedSource = edge && lastLoad ? `import '${lastLoad}';` : '';
|
|
472
|
-
|
|
473
|
-
if (!imports.length) {
|
|
474
|
-
resolvedSource += source;
|
|
475
|
-
}
|
|
476
|
-
else {
|
|
477
|
-
// once all deps have loaded we can inline the dependency resolution blobs
|
|
478
|
-
// and define this blob
|
|
479
|
-
let lastIndex = 0, depIndex = 0;
|
|
480
|
-
for (const { s: start, e: end, se: statementEnd, d: dynamicImportIndex } of imports) {
|
|
481
|
-
// dependency source replacements
|
|
482
|
-
if (dynamicImportIndex === -1) {
|
|
483
|
-
const depLoad = load.d[depIndex++];
|
|
484
|
-
let blobUrl = depLoad.b;
|
|
485
|
-
if (!blobUrl) {
|
|
486
|
-
// circular shell creation
|
|
487
|
-
if (!(blobUrl = depLoad.s)) {
|
|
488
|
-
blobUrl = depLoad.s = createBlob(`export function u$_(m){${
|
|
489
|
-
depLoad.a[1].map(
|
|
490
|
-
name => name === 'default' ? `$_default=m.default` : `${name}=m.${name}`
|
|
491
|
-
).join(',')
|
|
492
|
-
}}${
|
|
493
|
-
depLoad.a[1].map(name =>
|
|
494
|
-
name === 'default' ? `let $_default;export{$_default as default}` : `export let ${name}`
|
|
495
|
-
).join(';')
|
|
496
|
-
}\n//# sourceURL=${depLoad.r}?cycle`);
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
// circular shell execution
|
|
500
|
-
else if (depLoad.s) {
|
|
501
|
-
resolvedSource += `${source.slice(lastIndex, start - 1)}/*${source.slice(start - 1, statementEnd)}*/${urlJsString(blobUrl)};import*as m$_${depIndex} from'${depLoad.b}';import{u$_ as u$_${depIndex}}from'${depLoad.s}';u$_${depIndex}(m$_${depIndex})`;
|
|
502
|
-
lastIndex = statementEnd;
|
|
503
|
-
depLoad.s = undefined;
|
|
504
|
-
continue;
|
|
505
|
-
}
|
|
506
|
-
resolvedSource += `${source.slice(lastIndex, start - 1)}/*${source.slice(start - 1, statementEnd)}*/${urlJsString(blobUrl)}`;
|
|
507
|
-
lastIndex = statementEnd;
|
|
508
|
-
}
|
|
509
|
-
// import.meta
|
|
510
|
-
else if (dynamicImportIndex === -2) {
|
|
511
|
-
meta[load.r] = { url: load.r, resolve: importMetaResolve };
|
|
512
|
-
resolvedSource += `${source.slice(lastIndex, start)}self._esmsm[${urlJsString(load.r)}]`;
|
|
513
|
-
lastIndex = statementEnd;
|
|
514
|
-
}
|
|
515
|
-
// dynamic import
|
|
516
|
-
else {
|
|
517
|
-
resolvedSource += `${source.slice(lastIndex, dynamicImportIndex + 6)}Shim(${source.slice(start, statementEnd)}, ${
|
|
518
|
-
lastIndex = statementEnd;
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
resolvedSource += source.slice(lastIndex);
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
let hasSourceURL = false;
|
|
526
|
-
resolvedSource = resolvedSource.replace(sourceMapURLRegEx, (match, isMapping, url) => (hasSourceURL = !isMapping, match.replace(url, () => new URL(url, load.r))));
|
|
527
|
-
if (!hasSourceURL)
|
|
528
|
-
resolvedSource += '\n//# sourceURL=' + load.r;
|
|
529
|
-
|
|
530
|
-
load.b = lastLoad = createBlob(resolvedSource);
|
|
531
|
-
load.S = undefined;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
// ; and // trailer support added for Ruby on Rails 7 source maps compatibility
|
|
535
|
-
// https://github.com/guybedford/es-module-shims/issues/228
|
|
536
|
-
const sourceMapURLRegEx = /\n\/\/# source(Mapping)?URL=([^\n]+)\s*((;|\/\/[^#][^\n]*)\s*)*$/;
|
|
537
|
-
|
|
538
|
-
const jsContentType = /^(text|application)\/(x-)?javascript(;|$)/;
|
|
539
|
-
const jsonContentType = /^(text|application)\/json(;|$)/;
|
|
540
|
-
const cssContentType = /^(text|application)\/css(;|$)/;
|
|
541
|
-
|
|
542
|
-
const cssUrlRegEx = /url\(\s*(?:(["'])((?:\\.|[^\n\\"'])+)\1|((?:\\.|[^\s,"'()\\])+))\s*\)/g;
|
|
543
|
-
|
|
544
|
-
// restrict in-flight fetches to a pool of 100
|
|
545
|
-
let p = [];
|
|
546
|
-
let c = 0;
|
|
547
|
-
function pushFetchPool () {
|
|
548
|
-
if (++c > 100)
|
|
549
|
-
return new Promise(r => p.push(r));
|
|
550
|
-
}
|
|
551
|
-
function popFetchPool () {
|
|
552
|
-
c--;
|
|
553
|
-
if (p.length)
|
|
554
|
-
p.shift()();
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
load.
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
if (
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
if (
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
293
|
+
async function defaultResolve (id, parentUrl) {
|
|
294
|
+
return resolveImportMap(importMap, resolveIfNotPlainOrUrl(id, parentUrl) || id, parentUrl);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
async function _resolve (id, parentUrl) {
|
|
298
|
+
const urlResolved = resolveIfNotPlainOrUrl(id, parentUrl);
|
|
299
|
+
return {
|
|
300
|
+
r: resolveImportMap(importMap, urlResolved || id, parentUrl),
|
|
301
|
+
// b = bare specifier
|
|
302
|
+
b: !urlResolved && !isURL(id)
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
const resolve = resolveHook ? async (id, parentUrl) => ({ r: await resolveHook(id, parentUrl, defaultResolve), b: false }) : _resolve;
|
|
307
|
+
|
|
308
|
+
const registry = {};
|
|
309
|
+
|
|
310
|
+
async function loadAll (load, seen) {
|
|
311
|
+
if (load.b || seen[load.u])
|
|
312
|
+
return;
|
|
313
|
+
seen[load.u] = 1;
|
|
314
|
+
await load.L;
|
|
315
|
+
await Promise.all(load.d.map(dep => loadAll(dep, seen)));
|
|
316
|
+
if (!load.n)
|
|
317
|
+
load.n = load.d.some(dep => dep.n);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
let importMap = { imports: {}, scopes: {} };
|
|
321
|
+
let importMapSrcOrLazy = false;
|
|
322
|
+
let baselinePassthrough;
|
|
323
|
+
|
|
324
|
+
const initPromise = featureDetectionPromise.then(() => {
|
|
325
|
+
// shim mode is determined on initialization, no late shim mode
|
|
326
|
+
if (!shimMode) {
|
|
327
|
+
if (document.querySelectorAll('script[type=module-shim],script[type=importmap-shim],link[rel=modulepreload-shim]').length) {
|
|
328
|
+
setShimMode();
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
let seenScript = false;
|
|
332
|
+
for (const script of document.querySelectorAll('script[type=module],script[type=importmap]')) {
|
|
333
|
+
if (!seenScript) {
|
|
334
|
+
if (script.type === 'module')
|
|
335
|
+
seenScript = true;
|
|
336
|
+
}
|
|
337
|
+
else if (script.type === 'importmap') {
|
|
338
|
+
importMapSrcOrLazy = true;
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
baselinePassthrough = supportsDynamicImport && supportsImportMeta && supportsImportMaps && (!jsonModulesEnabled || supportsJsonAssertions) && (!cssModulesEnabled || supportsCssAssertions) && !importMapSrcOrLazy && !false;
|
|
345
|
+
if (shimMode || !baselinePassthrough) {
|
|
346
|
+
new MutationObserver(mutations => {
|
|
347
|
+
for (const mutation of mutations) {
|
|
348
|
+
if (mutation.type !== 'childList') continue;
|
|
349
|
+
for (const node of mutation.addedNodes) {
|
|
350
|
+
if (node.tagName === 'SCRIPT') {
|
|
351
|
+
if (node.type === (shimMode ? 'module-shim' : 'module'))
|
|
352
|
+
processScript(node);
|
|
353
|
+
if (node.type === (shimMode ? 'importmap-shim' : 'importmap'))
|
|
354
|
+
processImportMap(node);
|
|
355
|
+
}
|
|
356
|
+
else if (node.tagName === 'LINK' && node.rel === (shimMode ? 'modulepreload-shim' : 'modulepreload'))
|
|
357
|
+
processPreload(node);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}).observe(document, { childList: true, subtree: true });
|
|
361
|
+
processImportMaps();
|
|
362
|
+
processScriptsAndPreloads();
|
|
363
|
+
return init;
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
let importMapPromise = initPromise;
|
|
367
|
+
let firstPolyfillLoad = true;
|
|
368
|
+
let acceptingImportMaps = true;
|
|
369
|
+
|
|
370
|
+
async function topLevelLoad (url, fetchOpts, source, nativelyLoaded, lastStaticLoadPromise) {
|
|
371
|
+
if (!shimMode)
|
|
372
|
+
acceptingImportMaps = false;
|
|
373
|
+
await importMapPromise;
|
|
374
|
+
// early analysis opt-out - no need to even fetch if we have feature support
|
|
375
|
+
if (!shimMode && baselinePassthrough) {
|
|
376
|
+
// for polyfill case, only dynamic import needs a return value here, and dynamic import will never pass nativelyLoaded
|
|
377
|
+
if (nativelyLoaded)
|
|
378
|
+
return null;
|
|
379
|
+
await lastStaticLoadPromise;
|
|
380
|
+
return dynamicImport(source ? createBlob(source) : url, { errUrl: url || source });
|
|
381
|
+
}
|
|
382
|
+
const load = getOrCreateLoad(url, fetchOpts, null, source);
|
|
383
|
+
const seen = {};
|
|
384
|
+
await loadAll(load, seen);
|
|
385
|
+
lastLoad = undefined;
|
|
386
|
+
resolveDeps(load, seen);
|
|
387
|
+
await lastStaticLoadPromise;
|
|
388
|
+
if (source && !shimMode && !load.n && !false) {
|
|
389
|
+
const module = await dynamicImport(createBlob(source), { errUrl: source });
|
|
390
|
+
if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen));
|
|
391
|
+
return module;
|
|
392
|
+
}
|
|
393
|
+
if (firstPolyfillLoad && !shimMode && load.n && nativelyLoaded) {
|
|
394
|
+
onpolyfill();
|
|
395
|
+
firstPolyfillLoad = false;
|
|
396
|
+
}
|
|
397
|
+
const module = await dynamicImport(!shimMode && !load.n && nativelyLoaded ? load.u : load.b, { errUrl: load.u });
|
|
398
|
+
// if the top-level load is a shell, run its update function
|
|
399
|
+
if (load.s)
|
|
400
|
+
(await dynamicImport(load.s)).u$_(module);
|
|
401
|
+
if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen));
|
|
402
|
+
// when tla is supported, this should return the tla promise as an actual handle
|
|
403
|
+
// so readystate can still correspond to the sync subgraph exec completions
|
|
404
|
+
return module;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
function revokeObjectURLs(registryKeys) {
|
|
408
|
+
let batch = 0;
|
|
409
|
+
const keysLength = registryKeys.length;
|
|
410
|
+
const schedule = self.requestIdleCallback ? self.requestIdleCallback : self.requestAnimationFrame;
|
|
411
|
+
schedule(cleanup);
|
|
412
|
+
function cleanup() {
|
|
413
|
+
const batchStartIndex = batch * 100;
|
|
414
|
+
if (batchStartIndex > keysLength) return
|
|
415
|
+
for (const key of registryKeys.slice(batchStartIndex, batchStartIndex + 100)) {
|
|
416
|
+
const load = registry[key];
|
|
417
|
+
if (load) URL.revokeObjectURL(load.b);
|
|
418
|
+
}
|
|
419
|
+
batch++;
|
|
420
|
+
schedule(cleanup);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
async function importShim (id, ...args) {
|
|
425
|
+
// parentUrl if present will be the last argument
|
|
426
|
+
let parentUrl = args[args.length - 1];
|
|
427
|
+
if (typeof parentUrl !== 'string') {
|
|
428
|
+
parentUrl = baseUrl;
|
|
429
|
+
}
|
|
430
|
+
// needed for shim check
|
|
431
|
+
await initPromise;
|
|
432
|
+
if (acceptingImportMaps || shimMode || !baselinePassthrough) {
|
|
433
|
+
processImportMaps();
|
|
434
|
+
if (!shimMode)
|
|
435
|
+
acceptingImportMaps = false;
|
|
436
|
+
}
|
|
437
|
+
await importMapPromise;
|
|
438
|
+
return topLevelLoad((await resolve(id, parentUrl)).r || throwUnresolved(id, parentUrl), { credentials: 'same-origin' });
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
self.importShim = importShim;
|
|
442
|
+
|
|
443
|
+
if (shimMode) {
|
|
444
|
+
importShim.getImportMap = () => JSON.parse(JSON.stringify(importMap));
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
const meta = {};
|
|
448
|
+
|
|
449
|
+
async function importMetaResolve (id, parentUrl = this.url) {
|
|
450
|
+
return (await resolve(id, `${parentUrl}`)).r || throwUnresolved(id, parentUrl);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
self._esmsm = meta;
|
|
454
|
+
|
|
455
|
+
function urlJsString (url) {
|
|
456
|
+
return `'${url.replace(/'/g, "\\'")}'`;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
let lastLoad;
|
|
460
|
+
function resolveDeps (load, seen) {
|
|
461
|
+
if (load.b || !seen[load.u])
|
|
462
|
+
return;
|
|
463
|
+
seen[load.u] = 0;
|
|
464
|
+
|
|
465
|
+
for (const dep of load.d)
|
|
466
|
+
resolveDeps(dep, seen);
|
|
467
|
+
|
|
468
|
+
const [imports] = load.a;
|
|
469
|
+
|
|
470
|
+
// "execution"
|
|
471
|
+
const source = load.S;
|
|
472
|
+
|
|
473
|
+
// edge doesnt execute sibling in order, so we fix this up by ensuring all previous executions are explicit dependencies
|
|
474
|
+
let resolvedSource = edge && lastLoad ? `import '${lastLoad}';` : '';
|
|
475
|
+
|
|
476
|
+
if (!imports.length) {
|
|
477
|
+
resolvedSource += source;
|
|
478
|
+
}
|
|
479
|
+
else {
|
|
480
|
+
// once all deps have loaded we can inline the dependency resolution blobs
|
|
481
|
+
// and define this blob
|
|
482
|
+
let lastIndex = 0, depIndex = 0;
|
|
483
|
+
for (const { s: start, e: end, se: statementEnd, d: dynamicImportIndex } of imports) {
|
|
484
|
+
// dependency source replacements
|
|
485
|
+
if (dynamicImportIndex === -1) {
|
|
486
|
+
const depLoad = load.d[depIndex++];
|
|
487
|
+
let blobUrl = depLoad.b;
|
|
488
|
+
if (!blobUrl) {
|
|
489
|
+
// circular shell creation
|
|
490
|
+
if (!(blobUrl = depLoad.s)) {
|
|
491
|
+
blobUrl = depLoad.s = createBlob(`export function u$_(m){${
|
|
492
|
+
depLoad.a[1].map(
|
|
493
|
+
name => name === 'default' ? `$_default=m.default` : `${name}=m.${name}`
|
|
494
|
+
).join(',')
|
|
495
|
+
}}${
|
|
496
|
+
depLoad.a[1].map(name =>
|
|
497
|
+
name === 'default' ? `let $_default;export{$_default as default}` : `export let ${name}`
|
|
498
|
+
).join(';')
|
|
499
|
+
}\n//# sourceURL=${depLoad.r}?cycle`);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
// circular shell execution
|
|
503
|
+
else if (depLoad.s) {
|
|
504
|
+
resolvedSource += `${source.slice(lastIndex, start - 1)}/*${source.slice(start - 1, statementEnd)}*/${urlJsString(blobUrl)};import*as m$_${depIndex} from'${depLoad.b}';import{u$_ as u$_${depIndex}}from'${depLoad.s}';u$_${depIndex}(m$_${depIndex})`;
|
|
505
|
+
lastIndex = statementEnd;
|
|
506
|
+
depLoad.s = undefined;
|
|
507
|
+
continue;
|
|
508
|
+
}
|
|
509
|
+
resolvedSource += `${source.slice(lastIndex, start - 1)}/*${source.slice(start - 1, statementEnd)}*/${urlJsString(blobUrl)}`;
|
|
510
|
+
lastIndex = statementEnd;
|
|
511
|
+
}
|
|
512
|
+
// import.meta
|
|
513
|
+
else if (dynamicImportIndex === -2) {
|
|
514
|
+
meta[load.r] = { url: load.r, resolve: importMetaResolve };
|
|
515
|
+
resolvedSource += `${source.slice(lastIndex, start)}self._esmsm[${urlJsString(load.r)}]`;
|
|
516
|
+
lastIndex = statementEnd;
|
|
517
|
+
}
|
|
518
|
+
// dynamic import
|
|
519
|
+
else {
|
|
520
|
+
resolvedSource += `${source.slice(lastIndex, dynamicImportIndex + 6)}Shim(${source.slice(start, statementEnd)}, ${urlJsString(load.r)}`;
|
|
521
|
+
lastIndex = statementEnd;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
resolvedSource += source.slice(lastIndex);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
let hasSourceURL = false;
|
|
529
|
+
resolvedSource = resolvedSource.replace(sourceMapURLRegEx, (match, isMapping, url) => (hasSourceURL = !isMapping, match.replace(url, () => new URL(url, load.r))));
|
|
530
|
+
if (!hasSourceURL)
|
|
531
|
+
resolvedSource += '\n//# sourceURL=' + load.r;
|
|
532
|
+
|
|
533
|
+
load.b = lastLoad = createBlob(resolvedSource);
|
|
534
|
+
load.S = undefined;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
// ; and // trailer support added for Ruby on Rails 7 source maps compatibility
|
|
538
|
+
// https://github.com/guybedford/es-module-shims/issues/228
|
|
539
|
+
const sourceMapURLRegEx = /\n\/\/# source(Mapping)?URL=([^\n]+)\s*((;|\/\/[^#][^\n]*)\s*)*$/;
|
|
540
|
+
|
|
541
|
+
const jsContentType = /^(text|application)\/(x-)?javascript(;|$)/;
|
|
542
|
+
const jsonContentType = /^(text|application)\/json(;|$)/;
|
|
543
|
+
const cssContentType = /^(text|application)\/css(;|$)/;
|
|
544
|
+
|
|
545
|
+
const cssUrlRegEx = /url\(\s*(?:(["'])((?:\\.|[^\n\\"'])+)\1|((?:\\.|[^\s,"'()\\])+))\s*\)/g;
|
|
546
|
+
|
|
547
|
+
// restrict in-flight fetches to a pool of 100
|
|
548
|
+
let p = [];
|
|
549
|
+
let c = 0;
|
|
550
|
+
function pushFetchPool () {
|
|
551
|
+
if (++c > 100)
|
|
552
|
+
return new Promise(r => p.push(r));
|
|
553
|
+
}
|
|
554
|
+
function popFetchPool () {
|
|
555
|
+
c--;
|
|
556
|
+
if (p.length)
|
|
557
|
+
p.shift()();
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
function fromParent (parent) {
|
|
561
|
+
return parent ? ` imported from ${parent}` : '';
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
async function doFetch (url, fetchOpts, parent) {
|
|
565
|
+
if (enforceIntegrity && !fetchOpts.integrity)
|
|
566
|
+
throw Error(`No integrity for ${url}${fromParent(parent)}.`);
|
|
567
|
+
const poolQueue = pushFetchPool();
|
|
568
|
+
if (poolQueue) await poolQueue;
|
|
569
|
+
try {
|
|
570
|
+
var res = await fetchHook(url, fetchOpts);
|
|
571
|
+
}
|
|
572
|
+
catch (e) {
|
|
573
|
+
e.message = `Unable to fetch ${url}${fromParent(parent)} - see network log for details.\n` + e.message;
|
|
574
|
+
throw e;
|
|
575
|
+
}
|
|
576
|
+
finally {
|
|
577
|
+
popFetchPool();
|
|
578
|
+
}
|
|
579
|
+
if (!res.ok)
|
|
580
|
+
throw Error(`${res.status} ${res.statusText} ${res.url}${fromParent(parent)}`);
|
|
581
|
+
return res;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
async function fetchModule (url, fetchOpts, parent) {
|
|
585
|
+
const res = await doFetch(url, fetchOpts, parent);
|
|
586
|
+
const contentType = res.headers.get('content-type');
|
|
587
|
+
if (jsContentType.test(contentType))
|
|
588
|
+
return { r: res.url, s: await res.text(), t: 'js' };
|
|
589
|
+
else if (jsonContentType.test(contentType))
|
|
590
|
+
return { r: res.url, s: `export default ${await res.text()}`, t: 'json' };
|
|
591
|
+
else if (cssContentType.test(contentType)) {
|
|
592
|
+
return { r: res.url, s: `var s=new CSSStyleSheet();s.replaceSync(${
|
|
593
|
+
JSON.stringify((await res.text()).replace(cssUrlRegEx, (_match, quotes = '', relUrl1, relUrl2) => `url(${quotes}${resolveUrl(relUrl1 || relUrl2, url)}${quotes})`))
|
|
594
|
+
});export default s;`, t: 'css' };
|
|
595
|
+
}
|
|
596
|
+
else
|
|
597
|
+
throw Error(`Unsupported Content-Type "${contentType}" loading ${url}${fromParent(parent)}. Modules must be served with a valid MIME type like application/javascript.`);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
function getOrCreateLoad (url, fetchOpts, parent, source) {
|
|
601
|
+
let load = registry[url];
|
|
602
|
+
if (load && !source)
|
|
603
|
+
return load;
|
|
604
|
+
|
|
605
|
+
load = {
|
|
606
|
+
// url
|
|
607
|
+
u: url,
|
|
608
|
+
// response url
|
|
609
|
+
r: source ? url : undefined,
|
|
610
|
+
// fetchPromise
|
|
611
|
+
f: undefined,
|
|
612
|
+
// source
|
|
613
|
+
S: undefined,
|
|
614
|
+
// linkPromise
|
|
615
|
+
L: undefined,
|
|
616
|
+
// analysis
|
|
617
|
+
a: undefined,
|
|
618
|
+
// deps
|
|
619
|
+
d: undefined,
|
|
620
|
+
// blobUrl
|
|
621
|
+
b: undefined,
|
|
622
|
+
// shellUrl
|
|
623
|
+
s: undefined,
|
|
624
|
+
// needsShim
|
|
625
|
+
n: false,
|
|
626
|
+
// type
|
|
627
|
+
t: null
|
|
628
|
+
};
|
|
629
|
+
if (registry[url]) {
|
|
630
|
+
let i = 0;
|
|
631
|
+
while (registry[load.u + ++i]);
|
|
632
|
+
load.u += i;
|
|
633
|
+
}
|
|
634
|
+
registry[load.u] = load;
|
|
635
|
+
|
|
636
|
+
load.f = (async () => {
|
|
637
|
+
if (!source) {
|
|
638
|
+
// preload fetch options override fetch options (race)
|
|
639
|
+
let t;
|
|
640
|
+
({ r: load.r, s: source, t } = await (fetchCache[url] || fetchModule(url, fetchOpts, parent)));
|
|
641
|
+
if (t && !shimMode) {
|
|
642
|
+
if (t === 'css' && !cssModulesEnabled || t === 'json' && !jsonModulesEnabled)
|
|
643
|
+
throw Error(`${t}-modules require <script type="esms-options">{ "polyfillEnable": ["${t}-modules"] }<${''}/script>`);
|
|
644
|
+
if (t === 'css' && !supportsCssAssertions || t === 'json' && !supportsJsonAssertions)
|
|
645
|
+
load.n = true;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
try {
|
|
649
|
+
load.a = parse(source, load.u);
|
|
650
|
+
}
|
|
651
|
+
catch (e) {
|
|
652
|
+
console.warn(e);
|
|
653
|
+
load.a = [[], []];
|
|
654
|
+
}
|
|
655
|
+
load.S = source;
|
|
656
|
+
return load;
|
|
657
|
+
})();
|
|
658
|
+
|
|
659
|
+
load.L = load.f.then(async () => {
|
|
660
|
+
let childFetchOpts = fetchOpts;
|
|
661
|
+
load.d = (await Promise.all(load.a[0].map(async ({ n, d }) => {
|
|
662
|
+
if (d >= 0 && !supportsDynamicImport || d === 2 && !supportsImportMeta)
|
|
663
|
+
load.n = true;
|
|
664
|
+
if (!n) return;
|
|
665
|
+
const { r, b } = await resolve(n, load.r || load.u);
|
|
666
|
+
if (b && (!supportsImportMaps || importMapSrcOrLazy))
|
|
667
|
+
load.n = true;
|
|
668
|
+
if (d !== -1) return;
|
|
669
|
+
if (!r)
|
|
670
|
+
throwUnresolved(n, load.r || load.u);
|
|
671
|
+
if (skip && skip.test(r)) return { b: r };
|
|
672
|
+
if (childFetchOpts.integrity)
|
|
673
|
+
childFetchOpts = Object.assign({}, childFetchOpts, { integrity: undefined });
|
|
674
|
+
return getOrCreateLoad(r, childFetchOpts, load.r).f;
|
|
675
|
+
}))).filter(l => l);
|
|
676
|
+
});
|
|
677
|
+
|
|
678
|
+
return load;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
function processScriptsAndPreloads () {
|
|
682
|
+
for (const script of document.querySelectorAll(shimMode ? 'script[type=module-shim]' : 'script[type=module]'))
|
|
683
|
+
processScript(script);
|
|
684
|
+
for (const link of document.querySelectorAll(shimMode ? 'link[rel=modulepreload-shim]' : 'link[rel=modulepreload]'))
|
|
685
|
+
processPreload(link);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
function processImportMaps () {
|
|
689
|
+
for (const script of document.querySelectorAll(shimMode ? 'script[type="importmap-shim"]' : 'script[type="importmap"]'))
|
|
690
|
+
processImportMap(script);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
function getFetchOpts (script) {
|
|
694
|
+
const fetchOpts = {};
|
|
695
|
+
if (script.integrity)
|
|
696
|
+
fetchOpts.integrity = script.integrity;
|
|
697
|
+
if (script.referrerpolicy)
|
|
698
|
+
fetchOpts.referrerPolicy = script.referrerpolicy;
|
|
699
|
+
if (script.crossorigin === 'use-credentials')
|
|
700
|
+
fetchOpts.credentials = 'include';
|
|
701
|
+
else if (script.crossorigin === 'anonymous')
|
|
702
|
+
fetchOpts.credentials = 'omit';
|
|
703
|
+
else
|
|
704
|
+
fetchOpts.credentials = 'same-origin';
|
|
705
|
+
return fetchOpts;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
let lastStaticLoadPromise = Promise.resolve();
|
|
709
|
+
|
|
710
|
+
let domContentLoadedCnt = 1;
|
|
711
|
+
function domContentLoadedCheck () {
|
|
712
|
+
if (--domContentLoadedCnt === 0 && !noLoadEventRetriggers)
|
|
713
|
+
document.dispatchEvent(new Event('DOMContentLoaded'));
|
|
714
|
+
}
|
|
715
|
+
// this should always trigger because we assume es-module-shims is itself a domcontentloaded requirement
|
|
716
|
+
document.addEventListener('DOMContentLoaded', async () => {
|
|
717
|
+
await initPromise;
|
|
718
|
+
domContentLoadedCheck();
|
|
719
|
+
if (shimMode || !baselinePassthrough) {
|
|
720
|
+
processImportMaps();
|
|
721
|
+
processScriptsAndPreloads();
|
|
722
|
+
}
|
|
723
|
+
});
|
|
724
|
+
|
|
725
|
+
let readyStateCompleteCnt = 1;
|
|
726
|
+
if (document.readyState === 'complete') {
|
|
727
|
+
readyStateCompleteCheck();
|
|
728
|
+
}
|
|
729
|
+
else {
|
|
730
|
+
document.addEventListener('readystatechange', async () => {
|
|
731
|
+
processImportMaps();
|
|
732
|
+
await initPromise;
|
|
733
|
+
readyStateCompleteCheck();
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
function readyStateCompleteCheck () {
|
|
737
|
+
if (--readyStateCompleteCnt === 0 && !noLoadEventRetriggers)
|
|
738
|
+
document.dispatchEvent(new Event('readystatechange'));
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
function processImportMap (script) {
|
|
742
|
+
if (script.ep) // ep marker = script processed
|
|
743
|
+
return;
|
|
744
|
+
// empty inline scripts sometimes show before domready
|
|
745
|
+
if (!script.src && !script.innerHTML)
|
|
746
|
+
return;
|
|
747
|
+
script.ep = true;
|
|
748
|
+
// we dont currently support multiple, external or dynamic imports maps in polyfill mode to match native
|
|
749
|
+
if (script.src) {
|
|
750
|
+
if (!shimMode)
|
|
751
|
+
return;
|
|
752
|
+
importMapSrcOrLazy = true;
|
|
753
|
+
}
|
|
754
|
+
if (acceptingImportMaps) {
|
|
755
|
+
importMapPromise = importMapPromise
|
|
756
|
+
.then(async () => {
|
|
757
|
+
importMap = resolveAndComposeImportMap(script.src ? await (await doFetch(script.src, getFetchOpts(script))).json() : JSON.parse(script.innerHTML), script.src || baseUrl, importMap);
|
|
758
|
+
})
|
|
759
|
+
.catch(throwError);
|
|
760
|
+
if (!shimMode)
|
|
761
|
+
acceptingImportMaps = false;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
function processScript (script) {
|
|
766
|
+
if (script.ep) // ep marker = script processed
|
|
767
|
+
return;
|
|
768
|
+
if (script.getAttribute('noshim') !== null)
|
|
769
|
+
return;
|
|
770
|
+
// empty inline scripts sometimes show before domready
|
|
771
|
+
if (!script.src && !script.innerHTML)
|
|
772
|
+
return;
|
|
773
|
+
script.ep = true;
|
|
774
|
+
// does this load block readystate complete
|
|
775
|
+
const isReadyScript = readyStateCompleteCnt > 0;
|
|
776
|
+
// does this load block DOMContentLoaded
|
|
777
|
+
const isDomContentLoadedScript = domContentLoadedCnt > 0;
|
|
778
|
+
if (isReadyScript) readyStateCompleteCnt++;
|
|
779
|
+
if (isDomContentLoadedScript) domContentLoadedCnt++;
|
|
780
|
+
const blocks = script.getAttribute('async') === null && isReadyScript;
|
|
781
|
+
const loadPromise = topLevelLoad(script.src || baseUrl, getFetchOpts(script), !script.src && script.innerHTML, !shimMode, blocks && lastStaticLoadPromise).catch(throwError);
|
|
782
|
+
if (blocks)
|
|
783
|
+
lastStaticLoadPromise = loadPromise.then(readyStateCompleteCheck);
|
|
784
|
+
if (isDomContentLoadedScript)
|
|
785
|
+
loadPromise.then(domContentLoadedCheck);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
const fetchCache = {};
|
|
789
|
+
function processPreload (link) {
|
|
790
|
+
if (link.ep) // ep marker = processed
|
|
791
|
+
return;
|
|
792
|
+
link.ep = true;
|
|
793
|
+
if (fetchCache[link.href])
|
|
794
|
+
return;
|
|
795
|
+
fetchCache[link.href] = fetchModule(link.href, getFetchOpts(link));
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
function throwUnresolved (id, parentUrl) {
|
|
799
|
+
throw Error(`Unable to resolve specifier '${id}'${fromParent(parentUrl)}`);
|
|
796
800
|
}
|
|
797
801
|
|
|
798
802
|
})();
|