import { g, l } from "./chunk-5UVJ64RB.js"; import { A } from "./chunk-V6P2MAQQ.js"; import { s3 as s } from "./chunk-E5O6P5I2.js"; // node_modules/@arcgis/core/intl/messages.js var r = /^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/; var o = { ar: true, bg: true, bs: true, ca: true, cs: true, da: true, de: true, el: true, en: true, es: true, et: true, fi: true, fr: true, he: true, hr: true, hu: true, id: true, it: true, ja: true, ko: true, lt: true, lv: true, nb: true, nl: true, pl: true, "pt-BR": true, "pt-PT": true, ro: true, ru: true, sk: true, sl: true, sr: true, sv: true, th: true, tr: true, uk: true, vi: true, "zh-CN": true, "zh-HK": true, "zh-TW": true }; function i(t) { var _a; return (_a = o[t]) != null ? _a : false; } var a = []; var c = /* @__PURE__ */ new Map(); function d(t) { for (const e of c.keys()) _(t.pattern, e) && c.delete(e); } function l2(t) { return a.includes(t) || (d(t), a.unshift(t)), { remove() { const e = a.indexOf(t); e > -1 && (a.splice(e, 1), d(t)); } }; } async function u(t) { const e = l(); c.has(t) || c.set(t, f(t, e)); const n = c.get(t); return n && await m.add(n), n; } function h(t) { if (!r.test(t)) return null; const e = r.exec(t); if (null === e) return null; const [, n, s2] = e, o2 = n + (s2 ? "-" + s2.toUpperCase() : ""); return i(o2) ? o2 : i(n) ? n : null; } async function f(e, n) { const s2 = []; for (const t of a) if (_(t.pattern, e)) try { return await t.fetchMessageBundle(e, n); } catch (r2) { s2.push(r2); } if (s2.length) throw new s("intl:message-bundle-error", `Errors occurred while loading "${e}"`, { errors: s2 }); throw new s("intl:no-message-bundle-loader", `No loader found for message bundle "${e}"`); } function _(t, e) { return "string" == typeof t ? e.startsWith(t) : t.test(e); } g(() => { c.clear(); }); var m = new class { constructor() { this._numLoading = 0, this._dfd = null; } async waitForAll() { this._dfd && await this._dfd.promise; } add(t) { return this._increase(), t.then(() => this._decrease(), () => this._decrease()), this.waitForAll(); } _increase() { this._numLoading++, this._dfd || (this._dfd = A()); } _decrease() { this._numLoading = Math.max(this._numLoading - 1, 0), this._dfd && 0 === this._numLoading && (this._dfd.resolve(), this._dfd = null); } }(); export { l2 as l, u, h }; //# sourceMappingURL=chunk-HWSWTWZD.js.map