require("./font-faces.css");
require("./font-faces.cjs");
var $b5vhw$reactjsxruntime = require("react/jsx-runtime");
var $b5vhw$reactdom = require("react-dom");
var $b5vhw$react = require("react");
var $b5vhw$reactaria = require("react-aria");


function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}

function $parcel$export(e, n, v, s) {
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}

$parcel$export(module.exports, "Fonts", () => $55e0379377484943$export$20f257fc407da7a3);





// Typekit ids for each CJK locale. These use dynamic subsetting, so cannot be loaded as CSS.
// Because of the large size of the JS, we only download the script for the locale that is used.
// Each of these kits includes regular, bold, extra bold, and black weights. Spectrum 2 does not use any lighter weights.
let $55e0379377484943$var$scripts = {
    ja: 'pyb4hbv',
    ko: 'pux4zom',
    'zh-Hans': 'qwy0qqd',
    'zh-CN': 'qwy0qqd',
    'zh-SG': 'qwy0qqd',
    'zh-HK': 'wrf0dsa',
    'zh-Hant': 'twr1oiz',
    zh: 'twr1oiz'
};
// Font URLs from fonts.css to preload for each locale.
let $55e0379377484943$var$preloads = {
    // Currently no preloads for arabic and hebrew, because we don't know which weights will be used ahead of time.
    // Browsers will emit warnings for unused preloads.
    // ar: [
    // 'https://use.typekit.net/af/dfb464/00000000000000007735a2f9/31/l?primer=f592e0a4b9356877842506ce344308576437e4f677d7c9b78ca2162e6cad991a&fvd=n7&v=3',
    // 'https://use.typekit.net/af/560a53/00000000000000007735a300/31/l?primer=f592e0a4b9356877842506ce344308576437e4f677d7c9b78ca2162e6cad991a&fvd=n4&v=3',
    // 'https://use.typekit.net/af/0f9162/00000000000000007735a307/31/l?primer=f592e0a4b9356877842506ce344308576437e4f677d7c9b78ca2162e6cad991a&fvd=n6&v=3',
    // 'https://use.typekit.net/af/ab2792/00000000000000007735a309/31/l?primer=f592e0a4b9356877842506ce344308576437e4f677d7c9b78ca2162e6cad991a&fvd=n9&v=3'
    // 'https://use.typekit.net/af/560a53/00000000000000007735a300/31/l?primer=f592e0a4b9356877842506ce344308576437e4f677d7c9b78ca2162e6cad991a&fvd=n4&v=3'
    // ],
    // he: [
    // 'https://use.typekit.net/af/ffca46/00000000000000007735a30a/31/l?primer=f592e0a4b9356877842506ce344308576437e4f677d7c9b78ca2162e6cad991a&fvd=n7&v=3',
    // 'https://use.typekit.net/af/e90860/00000000000000007735a313/31/l?primer=f592e0a4b9356877842506ce344308576437e4f677d7c9b78ca2162e6cad991a&fvd=n4&v=3',
    // 'https://use.typekit.net/af/619974/00000000000000007735a31f/31/l?primer=f592e0a4b9356877842506ce344308576437e4f677d7c9b78ca2162e6cad991a&fvd=n6&v=3'
    // 'https://use.typekit.net/af/e90860/00000000000000007735a313/31/l?primer=f592e0a4b9356877842506ce344308576437e4f677d7c9b78ca2162e6cad991a&fvd=n4&v=3'
    // ],
    en: [
        // Preload Adobe Clean Spectrum VF.
        'https://use.typekit.net/af/ca4cba/0000000000000000775c55a1/31/l?primer=f592e0a4b9356877842506ce344308576437e4f677d7c9b78ca2162e6cad991a&fvd=n1&v=3'
    ]
};
function $55e0379377484943$export$20f257fc407da7a3() {
    let { locale: localeString } = (0, $b5vhw$reactaria.useLocale)();
    let locale = (0, $b5vhw$react.useMemo)(()=>new Intl.Locale(localeString), [
        localeString
    ]);
    let languageAndRegion = locale.language + (locale.region ? '-' + locale.region : '');
    let languageAndScript = locale.language + (locale.script ? '-' + locale.script : '');
    // Load script tag for CJK font
    let typekitId = $55e0379377484943$var$scripts[locale.baseName] || $55e0379377484943$var$scripts[languageAndRegion] || $55e0379377484943$var$scripts[languageAndScript] || $55e0379377484943$var$scripts[locale.language];
    let script = typekitId ? `https://use.typekit.net/${typekitId}.js` : null;
    let scriptRef = (0, $b5vhw$react.useRef)(null);
    (0, $b5vhw$react.useEffect)(()=>{
        let scriptEl = scriptRef.current;
        // In older React versions, we must manually insert scripts into the <head>.
        // Scripts rendered by React are never executed.
        if (script && parseInt((0, $b5vhw$react.version), 10) < 19) {
            scriptEl = Array.from(document.scripts).find((s)=>s.src === script) || null;
            if (!scriptEl) {
                scriptEl = document.createElement('script');
                scriptEl.async = true;
                scriptEl.src = script;
                document.head.appendChild(scriptEl);
            }
        }
        if (scriptEl) scriptEl.onload = ()=>{
            if (typeof window['Typekit'] !== 'undefined' && typeof window['Typekit'].load === 'function') window['Typekit'].load();
        };
    }, [
        scriptRef,
        script
    ]);
    // When using React 19, async scripts are automatically deduped and hoisted into the <head>.
    // This also works during SSR.
    if (script && parseInt((0, $b5vhw$react.version), 10) >= 19) return /*#__PURE__*/ (0, $b5vhw$reactjsxruntime.jsx)("script", {
        async: true,
        src: script,
        ref: scriptRef
    }, script);
    // Preload fonts referenced by CSS file using React 19's preloading mechanism (when available).
    // This will insert a <link rel="preload"> tag in the <head>, which is useful during SSR to start
    // font loading before the CSS downloads.
    let preloadUrls = $55e0379377484943$var$preloads[locale.language] || $55e0379377484943$var$preloads.en;
    if (preloadUrls && typeof (0, ($parcel$interopDefault($b5vhw$reactdom)))['preload'] === 'function') for (let url of preloadUrls)(0, ($parcel$interopDefault($b5vhw$reactdom))).preload(url, {
        as: 'font',
        type: 'font/woff2',
        crossOrigin: ''
    });
    return null;
}


//# sourceMappingURL=Fonts.cjs.map
