@doenet/v06-to-v07 0.7.21-dev.408 → 0.7.21-dev.409

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.
@@ -38855,6 +38855,10 @@ const BUNDLED_TRANSLATIONS = {
38855
38855
  editor: esEditor
38856
38856
  }
38857
38857
  };
38858
+ [
38859
+ DEFAULT_LOCALE,
38860
+ ...Object.keys(BUNDLED_TRANSLATIONS)
38861
+ ];
38858
38862
  function bundledResources(namespaces, { includeEnglish = false } = {}) {
38859
38863
  const resources = {};
38860
38864
  if (includeEnglish) {
@@ -38876,6 +38880,54 @@ bundledResources(
38876
38880
  CHROME_NAMESPACES,
38877
38881
  { includeEnglish: true }
38878
38882
  );
38883
+ const SUPPORTED_LOCALES = [
38884
+ {
38885
+ locale: "en",
38886
+ englishName: "English",
38887
+ endonym: "English",
38888
+ label: "English"
38889
+ },
38890
+ {
38891
+ locale: "es",
38892
+ englishName: "Spanish",
38893
+ endonym: "español",
38894
+ label: "Spanish (español)"
38895
+ }
38896
+ ];
38897
+ const CODE_SPLIT_CATALOGS = typeof __DOENET_CODE_SPLIT_CATALOGS__ === "undefined" || __DOENET_CODE_SPLIT_CATALOGS__;
38898
+ const LAZY_CATALOG_MODULES = CODE_SPLIT_CATALOGS ? /* @__PURE__ */ Object.assign({}) : {};
38899
+ const CATALOG_PATH_PATTERN = /\/locales\/([^/]+)\/([^/]+)\.ftl$/;
38900
+ function isCatalogNamespace(name2) {
38901
+ return CATALOG_NAMESPACES.includes(name2);
38902
+ }
38903
+ function loadersFromModules(modules) {
38904
+ const byLocale = {};
38905
+ for (const [modulePath, importModule] of Object.entries(modules)) {
38906
+ const match2 = CATALOG_PATH_PATTERN.exec(modulePath);
38907
+ if (!match2 || !isCatalogNamespace(match2[2])) {
38908
+ continue;
38909
+ }
38910
+ (byLocale[match2[1]] ??= {})[match2[2]] = importModule;
38911
+ }
38912
+ const loaders = {};
38913
+ for (const [locale, importers] of Object.entries(byLocale)) {
38914
+ loaders[locale] = async (namespaces) => {
38915
+ const wanted = namespaces.filter(
38916
+ (namespace) => Boolean(importers[namespace])
38917
+ );
38918
+ const sources = await Promise.all(
38919
+ wanted.map((namespace) => importers[namespace]())
38920
+ );
38921
+ const catalogs = {};
38922
+ wanted.forEach((namespace, index2) => {
38923
+ catalogs[namespace] = sources[index2];
38924
+ });
38925
+ return catalogs;
38926
+ };
38927
+ }
38928
+ return loaders;
38929
+ }
38930
+ loadersFromModules(LAZY_CATALOG_MODULES);
38879
38931
  const DEFAULT_LOCALE_DATA = {
38880
38932
  locale: DEFAULT_LOCALE,
38881
38933
  resources: {}
@@ -39149,20 +39201,6 @@ function formatEnglishDiagnostic(code, args) {
39149
39201
  enTranslator ??= createTranslator([], {});
39150
39202
  return enTranslator(key, lowerArgs(args, DEFAULT_LOCALE), code);
39151
39203
  }
39152
- const SUPPORTED_LOCALES = [
39153
- {
39154
- locale: "en",
39155
- englishName: "English",
39156
- endonym: "English",
39157
- label: "English"
39158
- },
39159
- {
39160
- locale: "es",
39161
- englishName: "Spanish",
39162
- endonym: "español",
39163
- label: "Spanish (español)"
39164
- }
39165
- ];
39166
39204
  function codedDiagnostic({
39167
39205
  type,
39168
39206
  code,
@@ -43406,7 +43444,7 @@ async function cidFromArrayBuffer(data) {
43406
43444
  await crypto.subtle.digest("SHA-256", new Uint8Array());
43407
43445
  digest = (data2) => crypto.subtle.digest("SHA-256", data2);
43408
43446
  } catch (e22) {
43409
- const sha256 = (await import("./sha256-AuWkkb03-IDscGuDZ-CFuB_0pW.js").then((n2) => n2.s)).default;
43447
+ const sha256 = (await import("./sha256-AuWkkb03-DlofeRR5-B5JL9W6q.js").then((n2) => n2.s)).default;
43410
43448
  digest = (data2) => sha256(data2, {
43411
43449
  asBytes: true
43412
43450
  });
@@ -234384,4 +234422,4 @@ export {
234384
234422
  getDefaultExportFromCjs$1 as g,
234385
234423
  updateSyntaxFromV06toV07 as u
234386
234424
  };
234387
- //# sourceMappingURL=index-DylrtcOy.js.map
234425
+ //# sourceMappingURL=index-BLpWEF8r.js.map