@fedify/vocab-runtime 2.1.26 → 2.1.28

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.
Files changed (45) hide show
  1. package/deno.json +2 -2
  2. package/dist/mod.cjs +97 -4
  3. package/dist/mod.d.cts +30 -2
  4. package/dist/mod.d.ts +30 -2
  5. package/dist/mod.js +97 -5
  6. package/dist/tests/{body-BnzEiyNX.mjs → body-BultFAjs.mjs} +1 -1
  7. package/dist/tests/{body-DZVjD47E.cjs → body-DaC7-w5j.cjs} +1 -1
  8. package/dist/tests/body.test.cjs +1 -1
  9. package/dist/tests/body.test.mjs +1 -1
  10. package/dist/tests/decimal.test.cjs +3 -2
  11. package/dist/tests/decimal.test.mjs +3 -2
  12. package/dist/tests/{docloader-B6t23peg.mjs → docloader-C0qWHnfQ.mjs} +49 -3
  13. package/dist/tests/{docloader-CXABd-sp.cjs → docloader-TXp0Q0s5.cjs} +49 -3
  14. package/dist/tests/docloader.test.cjs +167 -42
  15. package/dist/tests/docloader.test.mjs +157 -33
  16. package/dist/tests/{langstr-DDLc4833.mjs → langstr-ABdAOKlF.mjs} +5 -2
  17. package/dist/tests/{langstr-BOQHfJDr.cjs → langstr-BsqFJupv.cjs} +5 -2
  18. package/dist/tests/langstr.test.cjs +8 -1
  19. package/dist/tests/langstr.test.mjs +9 -2
  20. package/dist/tests/langtag-DgySESmk.cjs +50 -0
  21. package/dist/tests/langtag-LDBqlxHv.mjs +45 -0
  22. package/dist/tests/langtag.test.cjs +46 -0
  23. package/dist/tests/langtag.test.d.cts +1 -0
  24. package/dist/tests/langtag.test.d.mts +1 -0
  25. package/dist/tests/langtag.test.mjs +46 -0
  26. package/dist/tests/multibase/multibase.test.cjs +7 -7
  27. package/dist/tests/multibase/multibase.test.mjs +5 -5
  28. package/dist/tests/{request-BY5xuo0B.cjs → request-B3mTJPu9.cjs} +1 -1
  29. package/dist/tests/{request-DNWAyq5z.mjs → request-C7KTCpp-.mjs} +1 -1
  30. package/dist/tests/request.test.cjs +1 -1
  31. package/dist/tests/request.test.mjs +1 -1
  32. package/package.json +6 -3
  33. package/scripts/test-bun.mjs +18 -0
  34. package/src/contexts/fep-22cd.json +14 -0
  35. package/src/contexts/fep-6757.json +12 -0
  36. package/src/contexts/joinmastodon.json +1 -1
  37. package/src/contexts.ts +16 -0
  38. package/src/docloader.test.ts +221 -66
  39. package/src/docloader.ts +2 -0
  40. package/src/langstr.test.ts +18 -1
  41. package/src/langstr.ts +6 -2
  42. package/src/langtag.test.ts +53 -0
  43. package/src/langtag.ts +76 -0
  44. package/src/mod.ts +1 -0
  45. package/src/multibase/multibase.test.ts +5 -5
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/vocab-runtime",
3
- "version": "2.1.26",
3
+ "version": "2.1.28",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./src/mod.ts",
@@ -34,6 +34,6 @@
34
34
  },
35
35
  "tasks": {
36
36
  "check": "deno fmt --check && deno lint && deno check src/*.ts",
37
- "test": "deno test"
37
+ "test": "deno test --allow-net --allow-env=LOG"
38
38
  }
39
39
  }
package/dist/mod.cjs CHANGED
@@ -564,6 +564,36 @@ var did_v1_default = { "@context": {
564
564
  }
565
565
  } };
566
566
  //#endregion
567
+ //#region src/contexts/fep-22cd.json
568
+ var fep_22cd_default = { "@context": {
569
+ "fep-22cd": "https://w3id.org/fep/22cd#",
570
+ "schema": "https://schema.org/",
571
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
572
+ "translations": {
573
+ "@id": "fep-22cd:translations",
574
+ "@container": "@set"
575
+ },
576
+ "Translation": "fep-22cd:Translation",
577
+ "sourceUpdated": {
578
+ "@id": "fep-22cd:sourceUpdated",
579
+ "@type": "xsd:dateTime"
580
+ },
581
+ "translator": {
582
+ "@id": "schema:translator",
583
+ "@type": "@id",
584
+ "@container": "@set"
585
+ },
586
+ "inLanguage": "schema:inLanguage",
587
+ "translationOfWork": {
588
+ "@id": "schema:translationOfWork",
589
+ "@type": "@id"
590
+ },
591
+ "isBasedOn": {
592
+ "@id": "schema:isBasedOn",
593
+ "@type": "@id"
594
+ }
595
+ } };
596
+ //#endregion
567
597
  //#region src/contexts/fep-5711.json
568
598
  var fep_5711_default = { "@context": {
569
599
  "likesOf": {
@@ -600,6 +630,18 @@ var fep_5711_default = { "@context": {
600
630
  }
601
631
  } };
602
632
  //#endregion
633
+ //#region src/contexts/fep-6757.json
634
+ var fep_6757_default = { "@context": {
635
+ "license": {
636
+ "@id": "http://purl.org/dc/terms/license",
637
+ "@type": "@id"
638
+ },
639
+ "preferredLicense": {
640
+ "@id": "https://w3id.org/fep/6757#preferredLicense",
641
+ "@type": "@id"
642
+ }
643
+ } };
644
+ //#endregion
603
645
  //#region src/contexts/fep-7aa9.json
604
646
  var fep_7aa9_default = { "@context": {
605
647
  "FeaturedCollection": "https://w3id.org/fep/7aa9#FeaturedCollection",
@@ -926,7 +968,7 @@ var joinmastodon_default = { "@context": {
926
968
  "suspended": "toot:suspended",
927
969
  "attributionDomains": {
928
970
  "@id": "toot:attributionDomains",
929
- "@type": "@id"
971
+ "@container": "@set"
930
972
  }
931
973
  } };
932
974
  //#endregion
@@ -4542,6 +4584,8 @@ const preloadedContexts = {
4542
4584
  "https://www.w3.org/ns/cid/v1": cid_v1_default,
4543
4585
  "https://w3id.org/fep/ef61": fep_ef61_default,
4544
4586
  "https://w3id.org/fep/7aa9": fep_7aa9_default,
4587
+ "https://w3id.org/fep/6757": fep_6757_default,
4588
+ "https://w3id.org/fep/22cd": fep_22cd_default,
4545
4589
  "https://join-lemmy.org/context.json": join_lemmy_default,
4546
4590
  "http://joinmastodon.org/ns": joinmastodon_default,
4547
4591
  "https://purl.archive.org/miscellany": miscellany_default
@@ -4549,7 +4593,7 @@ const preloadedContexts = {
4549
4593
  //#endregion
4550
4594
  //#region deno.json
4551
4595
  var name = "@fedify/vocab-runtime";
4552
- var version = "2.1.26";
4596
+ var version = "2.1.28";
4553
4597
  //#endregion
4554
4598
  //#region src/request.ts
4555
4599
  /**
@@ -5197,6 +5241,8 @@ async function getRemoteDocument(url, response, fetch) {
5197
5241
  * - <https://w3id.org/security/multikey/v1>
5198
5242
  * - <https://w3id.org/fep/ef61>
5199
5243
  * - <https://w3id.org/fep/7aa9>
5244
+ * - <https://w3id.org/fep/6757>
5245
+ * - <https://w3id.org/fep/22cd>
5200
5246
  * - <https://purl.archive.org/socialweb/webfinger>
5201
5247
  * - <http://schema.org/>
5202
5248
  * @param options Options for the document loader.
@@ -5854,6 +5900,50 @@ function parseDecimal(value) {
5854
5900
  return normalized;
5855
5901
  }
5856
5902
  //#endregion
5903
+ //#region src/langtag.ts
5904
+ const EXTLANG_PAIRS = new Set(Object.entries({
5905
+ ar: "aao abh abv acm acq acw acx acy adf aeb aec afb ajp apc apd arb arq ars ary arz auz avl ayh ayl ayn ayp bbz pga shu ssh",
5906
+ kok: "gom knn",
5907
+ lv: "ltg lvs",
5908
+ ms: "bjn btj bve bvu coa dup hji jak jax kvb kvr kxd lce lcf liw max meo mfa mfb min mqg msi mui orn ors pel pse tmw urk vkk vkt xmm zlm zmi zsm",
5909
+ sgn: "ads aed aen afg ajs ase asf asp asq asw bfi bfk bog bqn bqy bvl bzs cds csc csd cse csf csg csl csn csq csr csx doq dse dsl dsz dyl ecs ehs esl esn eso eth fcs fse fsl fss gds gse gsg gsm gss gus hab haf hds hks hos hps hsh hsl icl iks ils inl ins ise isg isr jcs jhs jks jls jos jsl jus kgi kvk lbs lgs lls lsb lsc lsg lsl lsn lso lsp lst lsv lsw lsy lws mdl mfs mre msd msr mzc mzg mzy nbs ncs nsi nsl nsp nsr nzs okl pgz pks prl prz psc psd psg psl pso psp psr pys rib rms rnb rsi rsl rsm rsn sdl sfb sfs sgg sgx slf sls sqk sqs sqx ssp ssr svk swl syy szs tse tsm tsq tss tsy tza ugn ugy ukl uks vgt vsi vsl vsv wbs xki xml xms yds ygs yhs ysl ysm zhk zib zsl",
5910
+ sw: "swc swh",
5911
+ uz: "uzn uzs",
5912
+ zh: "cdo cjy cmn cnp cpx csp czh czo gan hak hnm hsn luh lzh mnp nan sjc wuu yue"
5913
+ }).flatMap(([prefix, extlangs]) => extlangs.split(" ").map((extlang) => `${prefix}-${extlang}`)));
5914
+ const PREFIX_PATTERN = /^[A-Za-z]{2,3}$/;
5915
+ const EXTLANG_PATTERN = /^[A-Za-z]{3}$/;
5916
+ /**
5917
+ * Normalizes a BCP 47 language tag that has an extended language subtag
5918
+ * (extlang), such as `zh-yue`, into its canonical form, such as `yue`, as
5919
+ * described in [RFC 5646, Section 4.5][1]. `Intl.Locale` rejects extlang
5920
+ * tags, so tags should be normalized before being passed to it.
5921
+ *
5922
+ * Only registered extlangs that follow their registered prefix are removed;
5923
+ * any other tag is returned unchanged, so the result still needs to be
5924
+ * validated, e.g., by `Intl.Locale`.
5925
+ *
5926
+ * NOTE: This function is marked as internal in the 2.0.x–2.4.x patch
5927
+ * releases. When merging it into the *main* branch, remove the `@internal`
5928
+ * tag, formalize it as a public API (`@since 2.5.0`), and add it to
5929
+ * the changelog fragment.
5930
+ *
5931
+ * [1]: https://www.rfc-editor.org/rfc/rfc5646.html#section-4.5
5932
+ *
5933
+ * @param tag The BCP 47 language tag to normalize.
5934
+ * @returns The normalized language tag.
5935
+ * @internal
5936
+ */
5937
+ function normalizeLanguageTag(tag) {
5938
+ const subtags = tag.split("-");
5939
+ if (subtags.length < 2) return tag;
5940
+ const [prefix, extlang, ...rest] = subtags;
5941
+ if (!PREFIX_PATTERN.test(prefix) || !EXTLANG_PATTERN.test(extlang)) return tag;
5942
+ const language = extlang.toLowerCase();
5943
+ if (!EXTLANG_PAIRS.has(`${prefix.toLowerCase()}-${language}`)) return tag;
5944
+ return [language, ...rest].join("-");
5945
+ }
5946
+ //#endregion
5857
5947
  //#region src/langstr.ts
5858
5948
  /**
5859
5949
  * A language-tagged string which corresponds to the `rdf:langString` type.
@@ -5868,11 +5958,13 @@ var LanguageString = class extends String {
5868
5958
  * Constructs a new `LanguageString`.
5869
5959
  * @param value A string value written in the given language.
5870
5960
  * @param language The language of the string. If a string is given, it will
5871
- * be parsed as a `Intl.Locale` object.
5961
+ * be parsed as a `Intl.Locale` object. Extended language
5962
+ * subtags are normalized first, e.g., `zh-yue` is parsed as
5963
+ * `yue`.
5872
5964
  */
5873
5965
  constructor(value, language) {
5874
5966
  super(value);
5875
- this.locale = typeof language === "string" ? new Intl.Locale(language) : language;
5967
+ this.locale = typeof language === "string" ? new Intl.Locale(normalizeLanguageTag(language)) : language;
5876
5968
  }
5877
5969
  };
5878
5970
  LanguageString.prototype[Symbol.for("Deno.customInspect")] = function(inspect, options) {
@@ -5904,6 +5996,7 @@ exports.isDecimal = isDecimal;
5904
5996
  exports.isValidPublicIPv4Address = isValidPublicIPv4Address;
5905
5997
  exports.isValidPublicIPv6Address = isValidPublicIPv6Address;
5906
5998
  exports.logRequest = logRequest;
5999
+ exports.normalizeLanguageTag = normalizeLanguageTag;
5907
6000
  exports.parseDecimal = parseDecimal;
5908
6001
  exports.preloadedContexts = preloadedContexts;
5909
6002
  exports.validatePublicUrl = validatePublicUrl;
package/dist/mod.d.cts CHANGED
@@ -188,6 +188,8 @@ interface GetDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
188
188
  * - <https://w3id.org/security/multikey/v1>
189
189
  * - <https://w3id.org/fep/ef61>
190
190
  * - <https://w3id.org/fep/7aa9>
191
+ * - <https://w3id.org/fep/6757>
192
+ * - <https://w3id.org/fep/22cd>
191
193
  * - <https://purl.archive.org/socialweb/webfinger>
192
194
  * - <http://schema.org/>
193
195
  * @param options Options for the document loader.
@@ -362,11 +364,37 @@ declare class LanguageString extends String {
362
364
  * Constructs a new `LanguageString`.
363
365
  * @param value A string value written in the given language.
364
366
  * @param language The language of the string. If a string is given, it will
365
- * be parsed as a `Intl.Locale` object.
367
+ * be parsed as a `Intl.Locale` object. Extended language
368
+ * subtags are normalized first, e.g., `zh-yue` is parsed as
369
+ * `yue`.
366
370
  */
367
371
  constructor(value: string, language: Intl.Locale | string);
368
372
  }
369
373
  //#endregion
374
+ //#region src/langtag.d.ts
375
+ /**
376
+ * Normalizes a BCP 47 language tag that has an extended language subtag
377
+ * (extlang), such as `zh-yue`, into its canonical form, such as `yue`, as
378
+ * described in [RFC 5646, Section 4.5][1]. `Intl.Locale` rejects extlang
379
+ * tags, so tags should be normalized before being passed to it.
380
+ *
381
+ * Only registered extlangs that follow their registered prefix are removed;
382
+ * any other tag is returned unchanged, so the result still needs to be
383
+ * validated, e.g., by `Intl.Locale`.
384
+ *
385
+ * NOTE: This function is marked as internal in the 2.0.x–2.4.x patch
386
+ * releases. When merging it into the *main* branch, remove the `@internal`
387
+ * tag, formalize it as a public API (`@since 2.5.0`), and add it to
388
+ * the changelog fragment.
389
+ *
390
+ * [1]: https://www.rfc-editor.org/rfc/rfc5646.html#section-4.5
391
+ *
392
+ * @param tag The BCP 47 language tag to normalize.
393
+ * @returns The normalized language tag.
394
+ * @internal
395
+ */
396
+ declare function normalizeLanguageTag(tag: string): string;
397
+ //#endregion
370
398
  //#region src/multibase/types.d.ts
371
399
  type BaseCode = "\x00" | "0" | "7" | "9" | "f" | "F" | "v" | "V" | "t" | "T" | "b" | "B" | "c" | "C" | "h" | "k" | "K" | "z" | "Z" | "m" | "M" | "u" | "U";
372
400
  /**
@@ -441,4 +469,4 @@ declare function isValidPublicIPv4Address(address: string): boolean;
441
469
  declare function isValidPublicIPv6Address(address: string): boolean;
442
470
  declare function expandIPv6Address(address: string): string;
443
471
  //#endregion
444
- export { type AuthenticatedDocumentLoaderFactory, type CreateRequestOptions, type Decimal, type DocumentLoader, type DocumentLoaderFactory, type DocumentLoaderFactoryOptions, type DocumentLoaderOptions, FetchError, type GetDocumentLoaderOptions, type GetUserAgentOptions, LanguageString, type RemoteDocument, UrlError, canParseDecimal, createActivityPubRequest, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportMultibaseKey, exportSpki, getDocumentLoader, getRemoteDocument, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, parseDecimal, preloadedContexts, validatePublicUrl };
472
+ export { type AuthenticatedDocumentLoaderFactory, type CreateRequestOptions, type Decimal, type DocumentLoader, type DocumentLoaderFactory, type DocumentLoaderFactoryOptions, type DocumentLoaderOptions, FetchError, type GetDocumentLoaderOptions, type GetUserAgentOptions, LanguageString, type RemoteDocument, UrlError, canParseDecimal, createActivityPubRequest, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportMultibaseKey, exportSpki, getDocumentLoader, getRemoteDocument, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, normalizeLanguageTag, parseDecimal, preloadedContexts, validatePublicUrl };
package/dist/mod.d.ts CHANGED
@@ -187,6 +187,8 @@ interface GetDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
187
187
  * - <https://w3id.org/security/multikey/v1>
188
188
  * - <https://w3id.org/fep/ef61>
189
189
  * - <https://w3id.org/fep/7aa9>
190
+ * - <https://w3id.org/fep/6757>
191
+ * - <https://w3id.org/fep/22cd>
190
192
  * - <https://purl.archive.org/socialweb/webfinger>
191
193
  * - <http://schema.org/>
192
194
  * @param options Options for the document loader.
@@ -361,11 +363,37 @@ declare class LanguageString extends String {
361
363
  * Constructs a new `LanguageString`.
362
364
  * @param value A string value written in the given language.
363
365
  * @param language The language of the string. If a string is given, it will
364
- * be parsed as a `Intl.Locale` object.
366
+ * be parsed as a `Intl.Locale` object. Extended language
367
+ * subtags are normalized first, e.g., `zh-yue` is parsed as
368
+ * `yue`.
365
369
  */
366
370
  constructor(value: string, language: Intl.Locale | string);
367
371
  }
368
372
  //#endregion
373
+ //#region src/langtag.d.ts
374
+ /**
375
+ * Normalizes a BCP 47 language tag that has an extended language subtag
376
+ * (extlang), such as `zh-yue`, into its canonical form, such as `yue`, as
377
+ * described in [RFC 5646, Section 4.5][1]. `Intl.Locale` rejects extlang
378
+ * tags, so tags should be normalized before being passed to it.
379
+ *
380
+ * Only registered extlangs that follow their registered prefix are removed;
381
+ * any other tag is returned unchanged, so the result still needs to be
382
+ * validated, e.g., by `Intl.Locale`.
383
+ *
384
+ * NOTE: This function is marked as internal in the 2.0.x–2.4.x patch
385
+ * releases. When merging it into the *main* branch, remove the `@internal`
386
+ * tag, formalize it as a public API (`@since 2.5.0`), and add it to
387
+ * the changelog fragment.
388
+ *
389
+ * [1]: https://www.rfc-editor.org/rfc/rfc5646.html#section-4.5
390
+ *
391
+ * @param tag The BCP 47 language tag to normalize.
392
+ * @returns The normalized language tag.
393
+ * @internal
394
+ */
395
+ declare function normalizeLanguageTag(tag: string): string;
396
+ //#endregion
369
397
  //#region src/multibase/types.d.ts
370
398
  type BaseCode = "\x00" | "0" | "7" | "9" | "f" | "F" | "v" | "V" | "t" | "T" | "b" | "B" | "c" | "C" | "h" | "k" | "K" | "z" | "Z" | "m" | "M" | "u" | "U";
371
399
  /**
@@ -440,4 +468,4 @@ declare function isValidPublicIPv4Address(address: string): boolean;
440
468
  declare function isValidPublicIPv6Address(address: string): boolean;
441
469
  declare function expandIPv6Address(address: string): string;
442
470
  //#endregion
443
- export { type AuthenticatedDocumentLoaderFactory, type CreateRequestOptions, type Decimal, type DocumentLoader, type DocumentLoaderFactory, type DocumentLoaderFactoryOptions, type DocumentLoaderOptions, FetchError, type GetDocumentLoaderOptions, type GetUserAgentOptions, LanguageString, type RemoteDocument, UrlError, canParseDecimal, createActivityPubRequest, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportMultibaseKey, exportSpki, getDocumentLoader, getRemoteDocument, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, parseDecimal, preloadedContexts, validatePublicUrl };
471
+ export { type AuthenticatedDocumentLoaderFactory, type CreateRequestOptions, type Decimal, type DocumentLoader, type DocumentLoaderFactory, type DocumentLoaderFactoryOptions, type DocumentLoaderOptions, FetchError, type GetDocumentLoaderOptions, type GetUserAgentOptions, LanguageString, type RemoteDocument, UrlError, canParseDecimal, createActivityPubRequest, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportMultibaseKey, exportSpki, getDocumentLoader, getRemoteDocument, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, normalizeLanguageTag, parseDecimal, preloadedContexts, validatePublicUrl };
package/dist/mod.js CHANGED
@@ -559,6 +559,36 @@ var did_v1_default = { "@context": {
559
559
  }
560
560
  } };
561
561
  //#endregion
562
+ //#region src/contexts/fep-22cd.json
563
+ var fep_22cd_default = { "@context": {
564
+ "fep-22cd": "https://w3id.org/fep/22cd#",
565
+ "schema": "https://schema.org/",
566
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
567
+ "translations": {
568
+ "@id": "fep-22cd:translations",
569
+ "@container": "@set"
570
+ },
571
+ "Translation": "fep-22cd:Translation",
572
+ "sourceUpdated": {
573
+ "@id": "fep-22cd:sourceUpdated",
574
+ "@type": "xsd:dateTime"
575
+ },
576
+ "translator": {
577
+ "@id": "schema:translator",
578
+ "@type": "@id",
579
+ "@container": "@set"
580
+ },
581
+ "inLanguage": "schema:inLanguage",
582
+ "translationOfWork": {
583
+ "@id": "schema:translationOfWork",
584
+ "@type": "@id"
585
+ },
586
+ "isBasedOn": {
587
+ "@id": "schema:isBasedOn",
588
+ "@type": "@id"
589
+ }
590
+ } };
591
+ //#endregion
562
592
  //#region src/contexts/fep-5711.json
563
593
  var fep_5711_default = { "@context": {
564
594
  "likesOf": {
@@ -595,6 +625,18 @@ var fep_5711_default = { "@context": {
595
625
  }
596
626
  } };
597
627
  //#endregion
628
+ //#region src/contexts/fep-6757.json
629
+ var fep_6757_default = { "@context": {
630
+ "license": {
631
+ "@id": "http://purl.org/dc/terms/license",
632
+ "@type": "@id"
633
+ },
634
+ "preferredLicense": {
635
+ "@id": "https://w3id.org/fep/6757#preferredLicense",
636
+ "@type": "@id"
637
+ }
638
+ } };
639
+ //#endregion
598
640
  //#region src/contexts/fep-7aa9.json
599
641
  var fep_7aa9_default = { "@context": {
600
642
  "FeaturedCollection": "https://w3id.org/fep/7aa9#FeaturedCollection",
@@ -921,7 +963,7 @@ var joinmastodon_default = { "@context": {
921
963
  "suspended": "toot:suspended",
922
964
  "attributionDomains": {
923
965
  "@id": "toot:attributionDomains",
924
- "@type": "@id"
966
+ "@container": "@set"
925
967
  }
926
968
  } };
927
969
  //#endregion
@@ -4537,6 +4579,8 @@ const preloadedContexts = {
4537
4579
  "https://www.w3.org/ns/cid/v1": cid_v1_default,
4538
4580
  "https://w3id.org/fep/ef61": fep_ef61_default,
4539
4581
  "https://w3id.org/fep/7aa9": fep_7aa9_default,
4582
+ "https://w3id.org/fep/6757": fep_6757_default,
4583
+ "https://w3id.org/fep/22cd": fep_22cd_default,
4540
4584
  "https://join-lemmy.org/context.json": join_lemmy_default,
4541
4585
  "http://joinmastodon.org/ns": joinmastodon_default,
4542
4586
  "https://purl.archive.org/miscellany": miscellany_default
@@ -4544,7 +4588,7 @@ const preloadedContexts = {
4544
4588
  //#endregion
4545
4589
  //#region deno.json
4546
4590
  var name = "@fedify/vocab-runtime";
4547
- var version = "2.1.26";
4591
+ var version = "2.1.28";
4548
4592
  //#endregion
4549
4593
  //#region src/request.ts
4550
4594
  /**
@@ -5192,6 +5236,8 @@ async function getRemoteDocument(url, response, fetch) {
5192
5236
  * - <https://w3id.org/security/multikey/v1>
5193
5237
  * - <https://w3id.org/fep/ef61>
5194
5238
  * - <https://w3id.org/fep/7aa9>
5239
+ * - <https://w3id.org/fep/6757>
5240
+ * - <https://w3id.org/fep/22cd>
5195
5241
  * - <https://purl.archive.org/socialweb/webfinger>
5196
5242
  * - <http://schema.org/>
5197
5243
  * @param options Options for the document loader.
@@ -5849,6 +5895,50 @@ function parseDecimal(value) {
5849
5895
  return normalized;
5850
5896
  }
5851
5897
  //#endregion
5898
+ //#region src/langtag.ts
5899
+ const EXTLANG_PAIRS = new Set(Object.entries({
5900
+ ar: "aao abh abv acm acq acw acx acy adf aeb aec afb ajp apc apd arb arq ars ary arz auz avl ayh ayl ayn ayp bbz pga shu ssh",
5901
+ kok: "gom knn",
5902
+ lv: "ltg lvs",
5903
+ ms: "bjn btj bve bvu coa dup hji jak jax kvb kvr kxd lce lcf liw max meo mfa mfb min mqg msi mui orn ors pel pse tmw urk vkk vkt xmm zlm zmi zsm",
5904
+ sgn: "ads aed aen afg ajs ase asf asp asq asw bfi bfk bog bqn bqy bvl bzs cds csc csd cse csf csg csl csn csq csr csx doq dse dsl dsz dyl ecs ehs esl esn eso eth fcs fse fsl fss gds gse gsg gsm gss gus hab haf hds hks hos hps hsh hsl icl iks ils inl ins ise isg isr jcs jhs jks jls jos jsl jus kgi kvk lbs lgs lls lsb lsc lsg lsl lsn lso lsp lst lsv lsw lsy lws mdl mfs mre msd msr mzc mzg mzy nbs ncs nsi nsl nsp nsr nzs okl pgz pks prl prz psc psd psg psl pso psp psr pys rib rms rnb rsi rsl rsm rsn sdl sfb sfs sgg sgx slf sls sqk sqs sqx ssp ssr svk swl syy szs tse tsm tsq tss tsy tza ugn ugy ukl uks vgt vsi vsl vsv wbs xki xml xms yds ygs yhs ysl ysm zhk zib zsl",
5905
+ sw: "swc swh",
5906
+ uz: "uzn uzs",
5907
+ zh: "cdo cjy cmn cnp cpx csp czh czo gan hak hnm hsn luh lzh mnp nan sjc wuu yue"
5908
+ }).flatMap(([prefix, extlangs]) => extlangs.split(" ").map((extlang) => `${prefix}-${extlang}`)));
5909
+ const PREFIX_PATTERN = /^[A-Za-z]{2,3}$/;
5910
+ const EXTLANG_PATTERN = /^[A-Za-z]{3}$/;
5911
+ /**
5912
+ * Normalizes a BCP 47 language tag that has an extended language subtag
5913
+ * (extlang), such as `zh-yue`, into its canonical form, such as `yue`, as
5914
+ * described in [RFC 5646, Section 4.5][1]. `Intl.Locale` rejects extlang
5915
+ * tags, so tags should be normalized before being passed to it.
5916
+ *
5917
+ * Only registered extlangs that follow their registered prefix are removed;
5918
+ * any other tag is returned unchanged, so the result still needs to be
5919
+ * validated, e.g., by `Intl.Locale`.
5920
+ *
5921
+ * NOTE: This function is marked as internal in the 2.0.x–2.4.x patch
5922
+ * releases. When merging it into the *main* branch, remove the `@internal`
5923
+ * tag, formalize it as a public API (`@since 2.5.0`), and add it to
5924
+ * the changelog fragment.
5925
+ *
5926
+ * [1]: https://www.rfc-editor.org/rfc/rfc5646.html#section-4.5
5927
+ *
5928
+ * @param tag The BCP 47 language tag to normalize.
5929
+ * @returns The normalized language tag.
5930
+ * @internal
5931
+ */
5932
+ function normalizeLanguageTag(tag) {
5933
+ const subtags = tag.split("-");
5934
+ if (subtags.length < 2) return tag;
5935
+ const [prefix, extlang, ...rest] = subtags;
5936
+ if (!PREFIX_PATTERN.test(prefix) || !EXTLANG_PATTERN.test(extlang)) return tag;
5937
+ const language = extlang.toLowerCase();
5938
+ if (!EXTLANG_PAIRS.has(`${prefix.toLowerCase()}-${language}`)) return tag;
5939
+ return [language, ...rest].join("-");
5940
+ }
5941
+ //#endregion
5852
5942
  //#region src/langstr.ts
5853
5943
  /**
5854
5944
  * A language-tagged string which corresponds to the `rdf:langString` type.
@@ -5863,11 +5953,13 @@ var LanguageString = class extends String {
5863
5953
  * Constructs a new `LanguageString`.
5864
5954
  * @param value A string value written in the given language.
5865
5955
  * @param language The language of the string. If a string is given, it will
5866
- * be parsed as a `Intl.Locale` object.
5956
+ * be parsed as a `Intl.Locale` object. Extended language
5957
+ * subtags are normalized first, e.g., `zh-yue` is parsed as
5958
+ * `yue`.
5867
5959
  */
5868
5960
  constructor(value, language) {
5869
5961
  super(value);
5870
- this.locale = typeof language === "string" ? new Intl.Locale(language) : language;
5962
+ this.locale = typeof language === "string" ? new Intl.Locale(normalizeLanguageTag(language)) : language;
5871
5963
  }
5872
5964
  };
5873
5965
  LanguageString.prototype[Symbol.for("Deno.customInspect")] = function(inspect, options) {
@@ -5877,4 +5969,4 @@ LanguageString.prototype[Symbol.for("nodejs.util.inspect.custom")] = function(_d
5877
5969
  return `<${this.locale.baseName}> ${inspect(this.toString(), options)}`;
5878
5970
  };
5879
5971
  //#endregion
5880
- export { FetchError, LanguageString, UrlError, canParseDecimal, createActivityPubRequest, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportMultibaseKey, exportSpki, getDocumentLoader, getRemoteDocument, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, parseDecimal, preloadedContexts, validatePublicUrl };
5972
+ export { FetchError, LanguageString, UrlError, canParseDecimal, createActivityPubRequest, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportMultibaseKey, exportSpki, getDocumentLoader, getRemoteDocument, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, normalizeLanguageTag, parseDecimal, preloadedContexts, validatePublicUrl };
@@ -1,4 +1,4 @@
1
- import { t as FetchError } from "./request-DNWAyq5z.mjs";
1
+ import { t as FetchError } from "./request-C7KTCpp-.mjs";
2
2
  import { getLogger } from "@logtape/logtape";
3
3
  //#region src/body.ts
4
4
  /** Decoded JSON body limit: 16 MiB. @internal */
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Do9eywBl.cjs");
2
- const require_request = require("./request-BY5xuo0B.cjs");
2
+ const require_request = require("./request-B3mTJPu9.cjs");
3
3
  let _logtape_logtape = require("@logtape/logtape");
4
4
  //#region src/body.ts
5
5
  /** Decoded JSON body limit: 16 MiB. @internal */
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Do9eywBl.cjs");
2
- const require_body = require("./body-DZVjD47E.cjs");
2
+ const require_body = require("./body-DaC7-w5j.cjs");
3
3
  let node_assert_strict = require("node:assert/strict");
4
4
  let node_test = require("node:test");
5
5
  let node_zlib = require("node:zlib");
@@ -1,4 +1,4 @@
1
- import { r as readBoundedText, t as BodyTooLargeError } from "./body-BnzEiyNX.mjs";
1
+ import { r as readBoundedText, t as BodyTooLargeError } from "./body-BultFAjs.mjs";
2
2
  import { deepStrictEqual, ok, rejects } from "node:assert/strict";
3
3
  import { test } from "node:test";
4
4
  import { gunzipSync, gzipSync } from "node:zlib";
@@ -1,9 +1,10 @@
1
1
  require("./chunk-Do9eywBl.cjs");
2
- require("./docloader-CXABd-sp.cjs");
2
+ require("./docloader-TXp0Q0s5.cjs");
3
3
  require("./url-vZTgkIZg.cjs");
4
4
  require("./key-BarKGLQz.cjs");
5
5
  require("./multibase-8zhYPa7o.cjs");
6
- require("./langstr-BOQHfJDr.cjs");
6
+ require("./langtag-DgySESmk.cjs");
7
+ require("./langstr-BsqFJupv.cjs");
7
8
  let node_test = require("node:test");
8
9
  let node_assert = require("node:assert");
9
10
  //#region src/decimal.ts
@@ -1,8 +1,9 @@
1
- import "./docloader-B6t23peg.mjs";
1
+ import "./docloader-C0qWHnfQ.mjs";
2
2
  import "./url-3fyJuqC0.mjs";
3
3
  import "./key-BDIsC6hV.mjs";
4
4
  import "./multibase-Ds75BvXs.mjs";
5
- import "./langstr-DDLc4833.mjs";
5
+ import "./langtag-LDBqlxHv.mjs";
6
+ import "./langstr-ABdAOKlF.mjs";
6
7
  import { test } from "node:test";
7
8
  import { deepStrictEqual, throws } from "node:assert";
8
9
  //#region src/decimal.ts
@@ -1,5 +1,5 @@
1
- import { a as name, i as logRequest, n as createActivityPubRequest, o as version, t as FetchError } from "./request-DNWAyq5z.mjs";
2
- import { n as MAX_BODY_SIZE, r as readBoundedText } from "./body-BnzEiyNX.mjs";
1
+ import { a as name, i as logRequest, n as createActivityPubRequest, o as version, t as FetchError } from "./request-C7KTCpp-.mjs";
2
+ import { n as MAX_BODY_SIZE, r as readBoundedText } from "./body-BultFAjs.mjs";
3
3
  import { t as HttpHeaderLink } from "./link-CYszIegt.mjs";
4
4
  import { o as validatePublicUrl, t as UrlError } from "./url-3fyJuqC0.mjs";
5
5
  import { getLogger } from "@logtape/logtape";
@@ -553,6 +553,36 @@ var did_v1_default = { "@context": {
553
553
  }
554
554
  } };
555
555
  //#endregion
556
+ //#region src/contexts/fep-22cd.json
557
+ var fep_22cd_default = { "@context": {
558
+ "fep-22cd": "https://w3id.org/fep/22cd#",
559
+ "schema": "https://schema.org/",
560
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
561
+ "translations": {
562
+ "@id": "fep-22cd:translations",
563
+ "@container": "@set"
564
+ },
565
+ "Translation": "fep-22cd:Translation",
566
+ "sourceUpdated": {
567
+ "@id": "fep-22cd:sourceUpdated",
568
+ "@type": "xsd:dateTime"
569
+ },
570
+ "translator": {
571
+ "@id": "schema:translator",
572
+ "@type": "@id",
573
+ "@container": "@set"
574
+ },
575
+ "inLanguage": "schema:inLanguage",
576
+ "translationOfWork": {
577
+ "@id": "schema:translationOfWork",
578
+ "@type": "@id"
579
+ },
580
+ "isBasedOn": {
581
+ "@id": "schema:isBasedOn",
582
+ "@type": "@id"
583
+ }
584
+ } };
585
+ //#endregion
556
586
  //#region src/contexts/fep-5711.json
557
587
  var fep_5711_default = { "@context": {
558
588
  "likesOf": {
@@ -589,6 +619,18 @@ var fep_5711_default = { "@context": {
589
619
  }
590
620
  } };
591
621
  //#endregion
622
+ //#region src/contexts/fep-6757.json
623
+ var fep_6757_default = { "@context": {
624
+ "license": {
625
+ "@id": "http://purl.org/dc/terms/license",
626
+ "@type": "@id"
627
+ },
628
+ "preferredLicense": {
629
+ "@id": "https://w3id.org/fep/6757#preferredLicense",
630
+ "@type": "@id"
631
+ }
632
+ } };
633
+ //#endregion
592
634
  //#region src/contexts/fep-7aa9.json
593
635
  var fep_7aa9_default = { "@context": {
594
636
  "FeaturedCollection": "https://w3id.org/fep/7aa9#FeaturedCollection",
@@ -915,7 +957,7 @@ var joinmastodon_default = { "@context": {
915
957
  "suspended": "toot:suspended",
916
958
  "attributionDomains": {
917
959
  "@id": "toot:attributionDomains",
918
- "@type": "@id"
960
+ "@container": "@set"
919
961
  }
920
962
  } };
921
963
  //#endregion
@@ -4531,6 +4573,8 @@ const preloadedContexts = {
4531
4573
  "https://www.w3.org/ns/cid/v1": cid_v1_default,
4532
4574
  "https://w3id.org/fep/ef61": fep_ef61_default,
4533
4575
  "https://w3id.org/fep/7aa9": fep_7aa9_default,
4576
+ "https://w3id.org/fep/6757": fep_6757_default,
4577
+ "https://w3id.org/fep/22cd": fep_22cd_default,
4534
4578
  "https://join-lemmy.org/context.json": join_lemmy_default,
4535
4579
  "http://joinmastodon.org/ns": joinmastodon_default,
4536
4580
  "https://purl.archive.org/miscellany": miscellany_default
@@ -4647,6 +4691,8 @@ async function getRemoteDocument(url, response, fetch) {
4647
4691
  * - <https://w3id.org/security/multikey/v1>
4648
4692
  * - <https://w3id.org/fep/ef61>
4649
4693
  * - <https://w3id.org/fep/7aa9>
4694
+ * - <https://w3id.org/fep/6757>
4695
+ * - <https://w3id.org/fep/22cd>
4650
4696
  * - <https://purl.archive.org/socialweb/webfinger>
4651
4697
  * - <http://schema.org/>
4652
4698
  * @param options Options for the document loader.