'use strict';

const index = require('./index-2883b35b.js');

/*
 Stencil Client Patch Browser v2.13.0 | MIT Licensed | https://stenciljs.com
 */
const getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`;
const patchBrowser = () => {
    {
        // shim css vars
        index.plt.$cssShim$ = index.win.__cssshim;
    }
    // @ts-ignore
    const scriptElm = Array.from(index.doc.querySelectorAll('script')).find((s) => new RegExp(`\/${index.NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) ||
            s.getAttribute('data-stencil-namespace') === index.NAMESPACE)
        ;
    const opts = scriptElm['data-opts'] || {} ;
    if ('onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {
        // Safari < v11 support: This IF is true if it's Safari below v11.
        // This fn cannot use async/await since Safari didn't support it until v11,
        // however, Safari 10 did support modules. Safari 10 also didn't support "nomodule",
        // so both the ESM file and nomodule file would get downloaded. Only Safari
        // has 'onbeforeload' in the script, and "history.scrollRestoration" was added
        // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.
        // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.
        return {
            then() {
                /* promise noop */
            },
        };
    }
    {
        opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, index.win.location.href)).href;
        {
            patchDynamicImport(opts.resourcesUrl, scriptElm);
        }
        if (!index.win.customElements) {
            // module support, but no custom elements support (Old Edge)
            // @ts-ignore
            return Promise.resolve().then(function () { return require(/* webpackChunkName: "polyfills-dom" */ './dom-8ac1ad03.js'); }).then(() => opts);
        }
    }
    return index.promiseResolve(opts);
};
const patchDynamicImport = (base, orgScriptElm) => {
    const importFunctionName = getDynamicImportFunction(index.NAMESPACE);
    try {
        // test if this browser supports dynamic imports
        // There is a caching issue in V8, that breaks using import() in Function
        // By generating a random string, we can workaround it
        // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info
        index.win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);
    }
    catch (e) {
        // this shim is specifically for browsers that do support "esm" imports
        // however, they do NOT support "dynamic" imports
        // basically this code is for old Edge, v18 and below
        const moduleMap = new Map();
        index.win[importFunctionName] = (src) => {
            const url = new URL(src, base).href;
            let mod = moduleMap.get(url);
            if (!mod) {
                const script = index.doc.createElement('script');
                script.type = 'module';
                script.crossOrigin = orgScriptElm.crossOrigin;
                script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {
                    type: 'application/javascript',
                }));
                mod = new Promise((resolve) => {
                    script.onload = () => {
                        resolve(index.win[importFunctionName].m);
                        script.remove();
                    };
                });
                moduleMap.set(url, mod);
                index.doc.head.appendChild(script);
            }
            return mod;
        };
    }
};

patchBrowser().then(options => {
  return index.bootstrapLazy([["world-map.cjs",[[0,"world-map",{"highestHeadingLevel":[1032,"highest-heading-level"],"height":[1026],"width":[1026],"mainTitle":[1025,"main-title"],"subTitle":[1025,"sub-title"],"margin":[1040],"padding":[1040],"mapProjection":[1025,"map-projection"],"mapScaleZoom":[1026,"map-scale-zoom"],"quality":[1025],"data":[16],"uniqueID":[1,"unique-i-d"],"sortOrder":[1025,"sort-order"],"groupAccessor":[1025,"group-accessor"],"markerAccessor":[1025,"marker-accessor"],"markerNameAccessor":[1025,"marker-name-accessor"],"joinAccessor":[1025,"join-accessor"],"joinNameAccessor":[1025,"join-name-accessor"],"valueAccessor":[1025,"value-accessor"],"latitudeAccessor":[1025,"latitude-accessor"],"longitudeAccessor":[1025,"longitude-accessor"],"colorPalette":[1025,"color-palette"],"colors":[1040],"colorSteps":[1026,"color-steps"],"markerStyle":[1040],"countryStyle":[1040],"hoverStyle":[1040],"clickStyle":[1040],"cursor":[1025],"hoverOpacity":[1026,"hover-opacity"],"animationConfig":[1040],"showTooltip":[1028,"show-tooltip"],"accessibility":[1040],"legend":[1040],"showGridlines":[1028,"show-gridlines"],"tooltipLabel":[1040],"dataLabel":[1040],"annotations":[1040],"maxValueOverride":[1026,"max-value-override"],"minValueOverride":[1026,"min-value-override"],"hoverHighlight":[1040],"clickHighlight":[1040],"interactionKeys":[1040],"suppressEvents":[1028,"suppress-events"],"unitTest":[4,"unit-test"]}]]]], options);
});
