importmap-rails 0.9.5 → 1.0.3

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