Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist/vendor
File: wp-polyfill-importmap.js
}).observe(document, {childList: true, subtree: true});
[500] Fix | Delete
processScriptsAndPreloads();
[501] Fix | Delete
if (document.readyState === 'complete') {
[502] Fix | Delete
readyStateCompleteCheck();
[503] Fix | Delete
}
[504] Fix | Delete
else {
[505] Fix | Delete
async function readyListener() {
[506] Fix | Delete
await initPromise;
[507] Fix | Delete
processScriptsAndPreloads();
[508] Fix | Delete
if (document.readyState === 'complete') {
[509] Fix | Delete
readyStateCompleteCheck();
[510] Fix | Delete
document.removeEventListener('readystatechange', readyListener);
[511] Fix | Delete
}
[512] Fix | Delete
}
[513] Fix | Delete
document.addEventListener('readystatechange', readyListener);
[514] Fix | Delete
}
[515] Fix | Delete
}
[516] Fix | Delete
}
[517] Fix | Delete
return init;
[518] Fix | Delete
});
[519] Fix | Delete
let importMapPromise = initPromise;
[520] Fix | Delete
let firstPolyfillLoad = true;
[521] Fix | Delete
let acceptingImportMaps = true;
[522] Fix | Delete
[523] Fix | Delete
async function topLevelLoad (url, fetchOpts, source, nativelyLoaded, lastStaticLoadPromise) {
[524] Fix | Delete
if (!shimMode)
[525] Fix | Delete
acceptingImportMaps = false;
[526] Fix | Delete
await initPromise;
[527] Fix | Delete
await importMapPromise;
[528] Fix | Delete
if (importHook) await importHook(url, typeof fetchOpts !== 'string' ? fetchOpts : {}, '');
[529] Fix | Delete
// early analysis opt-out - no need to even fetch if we have feature support
[530] Fix | Delete
if (!shimMode && baselinePassthrough) {
[531] Fix | Delete
// for polyfill case, only dynamic import needs a return value here, and dynamic import will never pass nativelyLoaded
[532] Fix | Delete
if (nativelyLoaded)
[533] Fix | Delete
return null;
[534] Fix | Delete
await lastStaticLoadPromise;
[535] Fix | Delete
return dynamicImport(source ? createBlob(source) : url, { errUrl: url || source });
[536] Fix | Delete
}
[537] Fix | Delete
const load = getOrCreateLoad(url, fetchOpts, null, source);
[538] Fix | Delete
const seen = {};
[539] Fix | Delete
await loadAll(load, seen);
[540] Fix | Delete
lastLoad = undefined;
[541] Fix | Delete
resolveDeps(load, seen);
[542] Fix | Delete
await lastStaticLoadPromise;
[543] Fix | Delete
if (source && !shimMode && !load.n) {
[544] Fix | Delete
if (nativelyLoaded) return;
[545] Fix | Delete
if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen));
[546] Fix | Delete
return await dynamicImport(createBlob(source), { errUrl: source });
[547] Fix | Delete
}
[548] Fix | Delete
if (firstPolyfillLoad && !shimMode && load.n && nativelyLoaded) {
[549] Fix | Delete
onpolyfill();
[550] Fix | Delete
firstPolyfillLoad = false;
[551] Fix | Delete
}
[552] Fix | Delete
const module = await dynamicImport(!shimMode && !load.n && nativelyLoaded ? load.u : load.b, { errUrl: load.u });
[553] Fix | Delete
// if the top-level load is a shell, run its update function
[554] Fix | Delete
if (load.s)
[555] Fix | Delete
(await dynamicImport(load.s)).u$_(module);
[556] Fix | Delete
if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen));
[557] Fix | Delete
// when tla is supported, this should return the tla promise as an actual handle
[558] Fix | Delete
// so readystate can still correspond to the sync subgraph exec completions
[559] Fix | Delete
return module;
[560] Fix | Delete
}
[561] Fix | Delete
[562] Fix | Delete
function revokeObjectURLs(registryKeys) {
[563] Fix | Delete
let batch = 0;
[564] Fix | Delete
const keysLength = registryKeys.length;
[565] Fix | Delete
const schedule = self.requestIdleCallback ? self.requestIdleCallback : self.requestAnimationFrame;
[566] Fix | Delete
schedule(cleanup);
[567] Fix | Delete
function cleanup() {
[568] Fix | Delete
const batchStartIndex = batch * 100;
[569] Fix | Delete
if (batchStartIndex > keysLength) return
[570] Fix | Delete
for (const key of registryKeys.slice(batchStartIndex, batchStartIndex + 100)) {
[571] Fix | Delete
const load = registry[key];
[572] Fix | Delete
if (load) URL.revokeObjectURL(load.b);
[573] Fix | Delete
}
[574] Fix | Delete
batch++;
[575] Fix | Delete
schedule(cleanup);
[576] Fix | Delete
}
[577] Fix | Delete
}
[578] Fix | Delete
[579] Fix | Delete
function urlJsString (url) {
[580] Fix | Delete
return `'${url.replace(/'/g, "\\'")}'`;
[581] Fix | Delete
}
[582] Fix | Delete
[583] Fix | Delete
let lastLoad;
[584] Fix | Delete
function resolveDeps (load, seen) {
[585] Fix | Delete
if (load.b || !seen[load.u])
[586] Fix | Delete
return;
[587] Fix | Delete
seen[load.u] = 0;
[588] Fix | Delete
[589] Fix | Delete
for (const dep of load.d)
[590] Fix | Delete
resolveDeps(dep, seen);
[591] Fix | Delete
[592] Fix | Delete
const [imports, exports] = load.a;
[593] Fix | Delete
[594] Fix | Delete
// "execution"
[595] Fix | Delete
const source = load.S;
[596] Fix | Delete
[597] Fix | Delete
// edge doesnt execute sibling in order, so we fix this up by ensuring all previous executions are explicit dependencies
[598] Fix | Delete
let resolvedSource = edge && lastLoad ? `import '${lastLoad}';` : '';
[599] Fix | Delete
[600] Fix | Delete
// once all deps have loaded we can inline the dependency resolution blobs
[601] Fix | Delete
// and define this blob
[602] Fix | Delete
let lastIndex = 0, depIndex = 0, dynamicImportEndStack = [];
[603] Fix | Delete
function pushStringTo (originalIndex) {
[604] Fix | Delete
while (dynamicImportEndStack[dynamicImportEndStack.length - 1] < originalIndex) {
[605] Fix | Delete
const dynamicImportEnd = dynamicImportEndStack.pop();
[606] Fix | Delete
resolvedSource += `${source.slice(lastIndex, dynamicImportEnd)}, ${urlJsString(load.r)}`;
[607] Fix | Delete
lastIndex = dynamicImportEnd;
[608] Fix | Delete
}
[609] Fix | Delete
resolvedSource += source.slice(lastIndex, originalIndex);
[610] Fix | Delete
lastIndex = originalIndex;
[611] Fix | Delete
}
[612] Fix | Delete
[613] Fix | Delete
for (const { s: start, ss: statementStart, se: statementEnd, d: dynamicImportIndex } of imports) {
[614] Fix | Delete
// dependency source replacements
[615] Fix | Delete
if (dynamicImportIndex === -1) {
[616] Fix | Delete
let depLoad = load.d[depIndex++], blobUrl = depLoad.b, cycleShell = !blobUrl;
[617] Fix | Delete
if (cycleShell) {
[618] Fix | Delete
// circular shell creation
[619] Fix | Delete
if (!(blobUrl = depLoad.s)) {
[620] Fix | Delete
blobUrl = depLoad.s = createBlob(`export function u$_(m){${
[621] Fix | Delete
depLoad.a[1].map(({ s, e }, i) => {
[622] Fix | Delete
const q = depLoad.S[s] === '"' || depLoad.S[s] === "'";
[623] Fix | Delete
return `e$_${i}=m${q ? `[` : '.'}${depLoad.S.slice(s, e)}${q ? `]` : ''}`;
[624] Fix | Delete
}).join(',')
[625] Fix | Delete
}}${
[626] Fix | Delete
depLoad.a[1].length ? `let ${depLoad.a[1].map((_, i) => `e$_${i}`).join(',')};` : ''
[627] Fix | Delete
}export {${
[628] Fix | Delete
depLoad.a[1].map(({ s, e }, i) => `e$_${i} as ${depLoad.S.slice(s, e)}`).join(',')
[629] Fix | Delete
}}\n//# sourceURL=${depLoad.r}?cycle`);
[630] Fix | Delete
}
[631] Fix | Delete
}
[632] Fix | Delete
[633] Fix | Delete
pushStringTo(start - 1);
[634] Fix | Delete
resolvedSource += `/*${source.slice(start - 1, statementEnd)}*/${urlJsString(blobUrl)}`;
[635] Fix | Delete
[636] Fix | Delete
// circular shell execution
[637] Fix | Delete
if (!cycleShell && depLoad.s) {
[638] Fix | Delete
resolvedSource += `;import*as m$_${depIndex} from'${depLoad.b}';import{u$_ as u$_${depIndex}}from'${depLoad.s}';u$_${depIndex}(m$_${depIndex})`;
[639] Fix | Delete
depLoad.s = undefined;
[640] Fix | Delete
}
[641] Fix | Delete
lastIndex = statementEnd;
[642] Fix | Delete
}
[643] Fix | Delete
// import.meta
[644] Fix | Delete
else if (dynamicImportIndex === -2) {
[645] Fix | Delete
load.m = { url: load.r, resolve: metaResolve };
[646] Fix | Delete
metaHook(load.m, load.u);
[647] Fix | Delete
pushStringTo(start);
[648] Fix | Delete
resolvedSource += `importShim._r[${urlJsString(load.u)}].m`;
[649] Fix | Delete
lastIndex = statementEnd;
[650] Fix | Delete
}
[651] Fix | Delete
// dynamic import
[652] Fix | Delete
else {
[653] Fix | Delete
pushStringTo(statementStart + 6);
[654] Fix | Delete
resolvedSource += `Shim(`;
[655] Fix | Delete
dynamicImportEndStack.push(statementEnd - 1);
[656] Fix | Delete
lastIndex = start;
[657] Fix | Delete
}
[658] Fix | Delete
}
[659] Fix | Delete
[660] Fix | Delete
// support progressive cycle binding updates (try statement avoids tdz errors)
[661] Fix | Delete
if (load.s)
[662] Fix | Delete
resolvedSource += `\n;import{u$_}from'${load.s}';try{u$_({${exports.filter(e => e.ln).map(({ s, e, ln }) => `${source.slice(s, e)}:${ln}`).join(',')}})}catch(_){};\n`;
[663] Fix | Delete
[664] Fix | Delete
function pushSourceURL (commentPrefix, commentStart) {
[665] Fix | Delete
const urlStart = commentStart + commentPrefix.length;
[666] Fix | Delete
const commentEnd = source.indexOf('\n', urlStart);
[667] Fix | Delete
const urlEnd = commentEnd !== -1 ? commentEnd : source.length;
[668] Fix | Delete
pushStringTo(urlStart);
[669] Fix | Delete
resolvedSource += new URL(source.slice(urlStart, urlEnd), load.r).href;
[670] Fix | Delete
lastIndex = urlEnd;
[671] Fix | Delete
}
[672] Fix | Delete
[673] Fix | Delete
let sourceURLCommentStart = source.lastIndexOf(sourceURLCommentPrefix);
[674] Fix | Delete
let sourceMapURLCommentStart = source.lastIndexOf(sourceMapURLCommentPrefix);
[675] Fix | Delete
[676] Fix | Delete
// ignore sourceMap comments before already spliced code
[677] Fix | Delete
if (sourceURLCommentStart < lastIndex) sourceURLCommentStart = -1;
[678] Fix | Delete
if (sourceMapURLCommentStart < lastIndex) sourceMapURLCommentStart = -1;
[679] Fix | Delete
[680] Fix | Delete
// sourceURL first / only
[681] Fix | Delete
if (sourceURLCommentStart !== -1 && (sourceMapURLCommentStart === -1 || sourceMapURLCommentStart > sourceURLCommentStart)) {
[682] Fix | Delete
pushSourceURL(sourceURLCommentPrefix, sourceURLCommentStart);
[683] Fix | Delete
}
[684] Fix | Delete
// sourceMappingURL
[685] Fix | Delete
if (sourceMapURLCommentStart !== -1) {
[686] Fix | Delete
pushSourceURL(sourceMapURLCommentPrefix, sourceMapURLCommentStart);
[687] Fix | Delete
// sourceURL last
[688] Fix | Delete
if (sourceURLCommentStart !== -1 && (sourceURLCommentStart > sourceMapURLCommentStart))
[689] Fix | Delete
pushSourceURL(sourceURLCommentPrefix, sourceURLCommentStart);
[690] Fix | Delete
}
[691] Fix | Delete
[692] Fix | Delete
pushStringTo(source.length);
[693] Fix | Delete
[694] Fix | Delete
if (sourceURLCommentStart === -1)
[695] Fix | Delete
resolvedSource += sourceURLCommentPrefix + load.r;
[696] Fix | Delete
[697] Fix | Delete
load.b = lastLoad = createBlob(resolvedSource);
[698] Fix | Delete
load.S = undefined;
[699] Fix | Delete
}
[700] Fix | Delete
[701] Fix | Delete
const sourceURLCommentPrefix = '\n//# sourceURL=';
[702] Fix | Delete
const sourceMapURLCommentPrefix = '\n//# sourceMappingURL=';
[703] Fix | Delete
[704] Fix | Delete
const jsContentType = /^(text|application)\/(x-)?javascript(;|$)/;
[705] Fix | Delete
const wasmContentType = /^(application)\/wasm(;|$)/;
[706] Fix | Delete
const jsonContentType = /^(text|application)\/json(;|$)/;
[707] Fix | Delete
const cssContentType = /^(text|application)\/css(;|$)/;
[708] Fix | Delete
[709] Fix | Delete
const cssUrlRegEx = /url\(\s*(?:(["'])((?:\\.|[^\n\\"'])+)\1|((?:\\.|[^\s,"'()\\])+))\s*\)/g;
[710] Fix | Delete
[711] Fix | Delete
// restrict in-flight fetches to a pool of 100
[712] Fix | Delete
let p = [];
[713] Fix | Delete
let c = 0;
[714] Fix | Delete
function pushFetchPool () {
[715] Fix | Delete
if (++c > 100)
[716] Fix | Delete
return new Promise(r => p.push(r));
[717] Fix | Delete
}
[718] Fix | Delete
function popFetchPool () {
[719] Fix | Delete
c--;
[720] Fix | Delete
if (p.length)
[721] Fix | Delete
p.shift()();
[722] Fix | Delete
}
[723] Fix | Delete
[724] Fix | Delete
async function doFetch (url, fetchOpts, parent) {
[725] Fix | Delete
if (enforceIntegrity && !fetchOpts.integrity)
[726] Fix | Delete
throw Error(`No integrity for ${url}${fromParent(parent)}.`);
[727] Fix | Delete
const poolQueue = pushFetchPool();
[728] Fix | Delete
if (poolQueue) await poolQueue;
[729] Fix | Delete
try {
[730] Fix | Delete
var res = await fetchHook(url, fetchOpts);
[731] Fix | Delete
}
[732] Fix | Delete
catch (e) {
[733] Fix | Delete
e.message = `Unable to fetch ${url}${fromParent(parent)} - see network log for details.\n` + e.message;
[734] Fix | Delete
throw e;
[735] Fix | Delete
}
[736] Fix | Delete
finally {
[737] Fix | Delete
popFetchPool();
[738] Fix | Delete
}
[739] Fix | Delete
[740] Fix | Delete
if (!res.ok) {
[741] Fix | Delete
const error = new TypeError(`${res.status} ${res.statusText} ${res.url}${fromParent(parent)}`);
[742] Fix | Delete
error.response = res;
[743] Fix | Delete
throw error;
[744] Fix | Delete
}
[745] Fix | Delete
return res;
[746] Fix | Delete
}
[747] Fix | Delete
[748] Fix | Delete
async function fetchModule (url, fetchOpts, parent) {
[749] Fix | Delete
const res = await doFetch(url, fetchOpts, parent);
[750] Fix | Delete
const contentType = res.headers.get('content-type');
[751] Fix | Delete
if (jsContentType.test(contentType))
[752] Fix | Delete
return { r: res.url, s: await res.text(), t: 'js' };
[753] Fix | Delete
else if (wasmContentType.test(contentType)) {
[754] Fix | Delete
const module = importShim._w[url] = await WebAssembly.compileStreaming(res);
[755] Fix | Delete
let s = '', i = 0, importObj = '';
[756] Fix | Delete
for (const impt of WebAssembly.Module.imports(module)) {
[757] Fix | Delete
s += `import * as impt${i} from '${impt.module}';\n`;
[758] Fix | Delete
importObj += `'${impt.module}':impt${i++},`;
[759] Fix | Delete
}
[760] Fix | Delete
i = 0;
[761] Fix | Delete
s += `const instance = await WebAssembly.instantiate(importShim._w['${url}'], {${importObj}});\n`;
[762] Fix | Delete
for (const expt of WebAssembly.Module.exports(module)) {
[763] Fix | Delete
s += `const expt${i} = instance['${expt.name}'];\n`;
[764] Fix | Delete
s += `export { expt${i++} as "${expt.name}" };\n`;
[765] Fix | Delete
}
[766] Fix | Delete
return { r: res.url, s, t: 'wasm' };
[767] Fix | Delete
}
[768] Fix | Delete
else if (jsonContentType.test(contentType))
[769] Fix | Delete
return { r: res.url, s: `export default ${await res.text()}`, t: 'json' };
[770] Fix | Delete
else if (cssContentType.test(contentType)) {
[771] Fix | Delete
return { r: res.url, s: `var s=new CSSStyleSheet();s.replaceSync(${
[772] Fix | Delete
JSON.stringify((await res.text()).replace(cssUrlRegEx, (_match, quotes = '', relUrl1, relUrl2) => `url(${quotes}${resolveUrl(relUrl1 || relUrl2, url)}${quotes})`))
[773] Fix | Delete
});export default s;`, t: 'css' };
[774] Fix | Delete
}
[775] Fix | Delete
else
[776] Fix | Delete
throw Error(`Unsupported Content-Type "${contentType}" loading ${url}${fromParent(parent)}. Modules must be served with a valid MIME type like application/javascript.`);
[777] Fix | Delete
}
[778] Fix | Delete
[779] Fix | Delete
function getOrCreateLoad (url, fetchOpts, parent, source) {
[780] Fix | Delete
let load = registry[url];
[781] Fix | Delete
if (load && !source)
[782] Fix | Delete
return load;
[783] Fix | Delete
[784] Fix | Delete
load = {
[785] Fix | Delete
// url
[786] Fix | Delete
u: url,
[787] Fix | Delete
// response url
[788] Fix | Delete
r: source ? url : undefined,
[789] Fix | Delete
// fetchPromise
[790] Fix | Delete
f: undefined,
[791] Fix | Delete
// source
[792] Fix | Delete
S: undefined,
[793] Fix | Delete
// linkPromise
[794] Fix | Delete
L: undefined,
[795] Fix | Delete
// analysis
[796] Fix | Delete
a: undefined,
[797] Fix | Delete
// deps
[798] Fix | Delete
d: undefined,
[799] Fix | Delete
// blobUrl
[800] Fix | Delete
b: undefined,
[801] Fix | Delete
// shellUrl
[802] Fix | Delete
s: undefined,
[803] Fix | Delete
// needsShim
[804] Fix | Delete
n: false,
[805] Fix | Delete
// type
[806] Fix | Delete
t: null,
[807] Fix | Delete
// meta
[808] Fix | Delete
m: null
[809] Fix | Delete
};
[810] Fix | Delete
if (registry[url]) {
[811] Fix | Delete
let i = 0;
[812] Fix | Delete
while (registry[load.u + ++i]);
[813] Fix | Delete
load.u += i;
[814] Fix | Delete
}
[815] Fix | Delete
registry[load.u] = load;
[816] Fix | Delete
[817] Fix | Delete
load.f = (async () => {
[818] Fix | Delete
if (!source) {
[819] Fix | Delete
// preload fetch options override fetch options (race)
[820] Fix | Delete
let t;
[821] Fix | Delete
({ r: load.r, s: source, t } = await (fetchCache[url] || fetchModule(url, fetchOpts, parent)));
[822] Fix | Delete
if (t && !shimMode) {
[823] Fix | Delete
if (t === 'css' && !cssModulesEnabled || t === 'json' && !jsonModulesEnabled)
[824] Fix | Delete
throw Error(`${t}-modules require <script type="esms-options">{ "polyfillEnable": ["${t}-modules"] }<${''}/script>`);
[825] Fix | Delete
if (t === 'css' && !supportsCssAssertions || t === 'json' && !supportsJsonAssertions)
[826] Fix | Delete
load.n = true;
[827] Fix | Delete
}
[828] Fix | Delete
}
[829] Fix | Delete
try {
[830] Fix | Delete
load.a = parse(source, load.u);
[831] Fix | Delete
}
[832] Fix | Delete
catch (e) {
[833] Fix | Delete
throwError(e);
[834] Fix | Delete
load.a = [[], [], false];
[835] Fix | Delete
}
[836] Fix | Delete
load.S = source;
[837] Fix | Delete
return load;
[838] Fix | Delete
})();
[839] Fix | Delete
[840] Fix | Delete
load.L = load.f.then(async () => {
[841] Fix | Delete
let childFetchOpts = fetchOpts;
[842] Fix | Delete
load.d = (await Promise.all(load.a[0].map(async ({ n, d }) => {
[843] Fix | Delete
if (d >= 0 && !supportsDynamicImport || d === -2 && !supportsImportMeta)
[844] Fix | Delete
load.n = true;
[845] Fix | Delete
if (d !== -1 || !n) return;
[846] Fix | Delete
const { r, b } = await resolve(n, load.r || load.u);
[847] Fix | Delete
if (b && (!supportsImportMaps || importMapSrcOrLazy))
[848] Fix | Delete
load.n = true;
[849] Fix | Delete
if (d !== -1) return;
[850] Fix | Delete
if (skip && skip(r)) return { b: r };
[851] Fix | Delete
if (childFetchOpts.integrity)
[852] Fix | Delete
childFetchOpts = Object.assign({}, childFetchOpts, { integrity: undefined });
[853] Fix | Delete
return getOrCreateLoad(r, childFetchOpts, load.r).f;
[854] Fix | Delete
}))).filter(l => l);
[855] Fix | Delete
});
[856] Fix | Delete
[857] Fix | Delete
return load;
[858] Fix | Delete
}
[859] Fix | Delete
[860] Fix | Delete
function processScriptsAndPreloads (mapsOnly = false) {
[861] Fix | Delete
if (!mapsOnly)
[862] Fix | Delete
for (const link of document.querySelectorAll(shimMode ? 'link[rel=modulepreload-shim]' : 'link[rel=modulepreload]'))
[863] Fix | Delete
processPreload(link);
[864] Fix | Delete
for (const script of document.querySelectorAll(shimMode ? 'script[type=importmap-shim]' : 'script[type=importmap]'))
[865] Fix | Delete
processImportMap(script);
[866] Fix | Delete
if (!mapsOnly)
[867] Fix | Delete
for (const script of document.querySelectorAll(shimMode ? 'script[type=module-shim]' : 'script[type=module]'))
[868] Fix | Delete
processScript(script);
[869] Fix | Delete
}
[870] Fix | Delete
[871] Fix | Delete
function getFetchOpts (script) {
[872] Fix | Delete
const fetchOpts = {};
[873] Fix | Delete
if (script.integrity)
[874] Fix | Delete
fetchOpts.integrity = script.integrity;
[875] Fix | Delete
if (script.referrerPolicy)
[876] Fix | Delete
fetchOpts.referrerPolicy = script.referrerPolicy;
[877] Fix | Delete
if (script.crossOrigin === 'use-credentials')
[878] Fix | Delete
fetchOpts.credentials = 'include';
[879] Fix | Delete
else if (script.crossOrigin === 'anonymous')
[880] Fix | Delete
fetchOpts.credentials = 'omit';
[881] Fix | Delete
else
[882] Fix | Delete
fetchOpts.credentials = 'same-origin';
[883] Fix | Delete
return fetchOpts;
[884] Fix | Delete
}
[885] Fix | Delete
[886] Fix | Delete
let lastStaticLoadPromise = Promise.resolve();
[887] Fix | Delete
[888] Fix | Delete
let domContentLoadedCnt = 1;
[889] Fix | Delete
function domContentLoadedCheck () {
[890] Fix | Delete
if (--domContentLoadedCnt === 0 && !noLoadEventRetriggers && (shimMode || !baselinePassthrough)) {
[891] Fix | Delete
document.dispatchEvent(new Event('DOMContentLoaded'));
[892] Fix | Delete
}
[893] Fix | Delete
}
[894] Fix | Delete
// this should always trigger because we assume es-module-shims is itself a domcontentloaded requirement
[895] Fix | Delete
if (hasDocument) {
[896] Fix | Delete
document.addEventListener('DOMContentLoaded', async () => {
[897] Fix | Delete
await initPromise;
[898] Fix | Delete
domContentLoadedCheck();
[899] Fix | Delete
});
[900] Fix | Delete
}
[901] Fix | Delete
[902] Fix | Delete
let readyStateCompleteCnt = 1;
[903] Fix | Delete
function readyStateCompleteCheck () {
[904] Fix | Delete
if (--readyStateCompleteCnt === 0 && !noLoadEventRetriggers && (shimMode || !baselinePassthrough)) {
[905] Fix | Delete
document.dispatchEvent(new Event('readystatechange'));
[906] Fix | Delete
}
[907] Fix | Delete
}
[908] Fix | Delete
[909] Fix | Delete
const hasNext = script => script.nextSibling || script.parentNode && hasNext(script.parentNode);
[910] Fix | Delete
const epCheck = (script, ready) => script.ep || !ready && (!script.src && !script.innerHTML || !hasNext(script)) || script.getAttribute('noshim') !== null || !(script.ep = true);
[911] Fix | Delete
[912] Fix | Delete
function processImportMap (script, ready = readyStateCompleteCnt > 0) {
[913] Fix | Delete
if (epCheck(script, ready)) return;
[914] Fix | Delete
// we dont currently support multiple, external or dynamic imports maps in polyfill mode to match native
[915] Fix | Delete
if (script.src) {
[916] Fix | Delete
if (!shimMode)
[917] Fix | Delete
return;
[918] Fix | Delete
setImportMapSrcOrLazy();
[919] Fix | Delete
}
[920] Fix | Delete
if (acceptingImportMaps) {
[921] Fix | Delete
importMapPromise = importMapPromise
[922] Fix | Delete
.then(async () => {
[923] Fix | Delete
importMap = resolveAndComposeImportMap(script.src ? await (await doFetch(script.src, getFetchOpts(script))).json() : JSON.parse(script.innerHTML), script.src || baseUrl, importMap);
[924] Fix | Delete
})
[925] Fix | Delete
.catch(e => {
[926] Fix | Delete
console.log(e);
[927] Fix | Delete
if (e instanceof SyntaxError)
[928] Fix | Delete
e = new Error(`Unable to parse import map ${e.message} in: ${script.src || script.innerHTML}`);
[929] Fix | Delete
throwError(e);
[930] Fix | Delete
});
[931] Fix | Delete
if (!shimMode)
[932] Fix | Delete
acceptingImportMaps = false;
[933] Fix | Delete
}
[934] Fix | Delete
}
[935] Fix | Delete
[936] Fix | Delete
function processScript (script, ready = readyStateCompleteCnt > 0) {
[937] Fix | Delete
if (epCheck(script, ready)) return;
[938] Fix | Delete
// does this load block readystate complete
[939] Fix | Delete
const isBlockingReadyScript = script.getAttribute('async') === null && readyStateCompleteCnt > 0;
[940] Fix | Delete
// does this load block DOMContentLoaded
[941] Fix | Delete
const isDomContentLoadedScript = domContentLoadedCnt > 0;
[942] Fix | Delete
if (isBlockingReadyScript) readyStateCompleteCnt++;
[943] Fix | Delete
if (isDomContentLoadedScript) domContentLoadedCnt++;
[944] Fix | Delete
const loadPromise = topLevelLoad(script.src || baseUrl, getFetchOpts(script), !script.src && script.innerHTML, !shimMode, isBlockingReadyScript && lastStaticLoadPromise)
[945] Fix | Delete
.then(() => {
[946] Fix | Delete
// if the type of the script tag "module-shim", browser does not dispatch a "load" event
[947] Fix | Delete
// see https://github.com/guybedford/es-module-shims/issues/346
[948] Fix | Delete
if (shimMode) {
[949] Fix | Delete
script.dispatchEvent(new Event('load'));
[950] Fix | Delete
}
[951] Fix | Delete
})
[952] Fix | Delete
.catch(throwError);
[953] Fix | Delete
if (isBlockingReadyScript)
[954] Fix | Delete
lastStaticLoadPromise = loadPromise.then(readyStateCompleteCheck);
[955] Fix | Delete
if (isDomContentLoadedScript)
[956] Fix | Delete
loadPromise.then(domContentLoadedCheck);
[957] Fix | Delete
}
[958] Fix | Delete
[959] Fix | Delete
const fetchCache = {};
[960] Fix | Delete
function processPreload (link) {
[961] Fix | Delete
if (link.ep) return;
[962] Fix | Delete
link.ep = true;
[963] Fix | Delete
if (fetchCache[link.href])
[964] Fix | Delete
return;
[965] Fix | Delete
fetchCache[link.href] = fetchModule(link.href, getFetchOpts(link));
[966] Fix | Delete
}
[967] Fix | Delete
[968] Fix | Delete
})();
[969] Fix | Delete
[970] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function