@fedify/fedify 0.11.0-dev.242 → 0.11.0-dev.244

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.
@@ -3034,8 +3034,9 @@ export class Object {
3034
3034
  : await v.toJsonLd(options);
3035
3035
  array.push({ "@graph": element });
3036
3036
  }
3037
- if (array.length > 0)
3037
+ if (array.length > 0) {
3038
3038
  values["https://w3id.org/security#proof"] = array;
3039
+ }
3039
3040
  values["@type"] = ["https://www.w3.org/ns/activitystreams#Object"];
3040
3041
  if (this.id)
3041
3042
  values["@id"] = this.id.href;
@@ -3255,8 +3256,13 @@ export class Object {
3255
3256
  }
3256
3257
  const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, options);
3257
3258
  const _49BipA5dq9eoH8LX8xdsVumveTca = [];
3258
- for (const v of values["https://www.w3.org/ns/activitystreams#attachment"] ??
3259
- []) {
3259
+ const _49BipA5dq9eoH8LX8xdsVumveTca__array = values["https://www.w3.org/ns/activitystreams#attachment"];
3260
+ for (const v of _49BipA5dq9eoH8LX8xdsVumveTca__array == null
3261
+ ? []
3262
+ : _49BipA5dq9eoH8LX8xdsVumveTca__array.length === 1 &&
3263
+ "@list" in _49BipA5dq9eoH8LX8xdsVumveTca__array[0]
3264
+ ? _49BipA5dq9eoH8LX8xdsVumveTca__array[0]["@list"]
3265
+ : _49BipA5dq9eoH8LX8xdsVumveTca__array) {
3260
3266
  if (v == null)
3261
3267
  continue;
3262
3268
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3331,8 +3337,13 @@ export class Object {
3331
3337
  }
3332
3338
  instance.#_49BipA5dq9eoH8LX8xdsVumveTca = _49BipA5dq9eoH8LX8xdsVumveTca;
3333
3339
  const _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py = [];
3334
- for (const v of values["https://www.w3.org/ns/activitystreams#attributedTo"] ??
3335
- []) {
3340
+ const _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py__array = values["https://www.w3.org/ns/activitystreams#attributedTo"];
3341
+ for (const v of _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py__array == null
3342
+ ? []
3343
+ : _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py__array.length === 1 &&
3344
+ "@list" in _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py__array[0]
3345
+ ? _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py__array[0]["@list"]
3346
+ : _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py__array) {
3336
3347
  if (v == null)
3337
3348
  continue;
3338
3349
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3367,7 +3378,13 @@ export class Object {
3367
3378
  }
3368
3379
  instance.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py = _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py;
3369
3380
  const _3ocC3VVi88cEd5sPWL8djkZsvTN6 = [];
3370
- for (const v of values["https://www.w3.org/ns/activitystreams#audience"] ?? []) {
3381
+ const _3ocC3VVi88cEd5sPWL8djkZsvTN6__array = values["https://www.w3.org/ns/activitystreams#audience"];
3382
+ for (const v of _3ocC3VVi88cEd5sPWL8djkZsvTN6__array == null
3383
+ ? []
3384
+ : _3ocC3VVi88cEd5sPWL8djkZsvTN6__array.length === 1 &&
3385
+ "@list" in _3ocC3VVi88cEd5sPWL8djkZsvTN6__array[0]
3386
+ ? _3ocC3VVi88cEd5sPWL8djkZsvTN6__array[0]["@list"]
3387
+ : _3ocC3VVi88cEd5sPWL8djkZsvTN6__array) {
3371
3388
  if (v == null)
3372
3389
  continue;
3373
3390
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3379,7 +3396,13 @@ export class Object {
3379
3396
  }
3380
3397
  instance.#_3ocC3VVi88cEd5sPWL8djkZsvTN6 = _3ocC3VVi88cEd5sPWL8djkZsvTN6;
3381
3398
  const _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz = [];
3382
- for (const v of values["https://www.w3.org/ns/activitystreams#content"] ?? []) {
3399
+ const _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz__array = values["https://www.w3.org/ns/activitystreams#content"];
3400
+ for (const v of _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz__array == null
3401
+ ? []
3402
+ : _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz__array.length === 1 &&
3403
+ "@list" in _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz__array[0]
3404
+ ? _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz__array[0]["@list"]
3405
+ : _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz__array) {
3383
3406
  if (v == null)
3384
3407
  continue;
3385
3408
  const decoded = typeof v === "object" && "@value" in v &&
@@ -3396,7 +3419,13 @@ export class Object {
3396
3419
  }
3397
3420
  instance.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz = _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz;
3398
3421
  const _3mhZzGXSpQ431mBSz2kvych22v4e = [];
3399
- for (const v of values["https://www.w3.org/ns/activitystreams#context"] ?? []) {
3422
+ const _3mhZzGXSpQ431mBSz2kvych22v4e__array = values["https://www.w3.org/ns/activitystreams#context"];
3423
+ for (const v of _3mhZzGXSpQ431mBSz2kvych22v4e__array == null
3424
+ ? []
3425
+ : _3mhZzGXSpQ431mBSz2kvych22v4e__array.length === 1 &&
3426
+ "@list" in _3mhZzGXSpQ431mBSz2kvych22v4e__array[0]
3427
+ ? _3mhZzGXSpQ431mBSz2kvych22v4e__array[0]["@list"]
3428
+ : _3mhZzGXSpQ431mBSz2kvych22v4e__array) {
3400
3429
  if (v == null)
3401
3430
  continue;
3402
3431
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3467,7 +3496,13 @@ export class Object {
3467
3496
  }
3468
3497
  instance.#_3mhZzGXSpQ431mBSz2kvych22v4e = _3mhZzGXSpQ431mBSz2kvych22v4e;
3469
3498
  const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav = [];
3470
- for (const v of values["https://www.w3.org/ns/activitystreams#name"] ?? []) {
3499
+ const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array = values["https://www.w3.org/ns/activitystreams#name"];
3500
+ for (const v of _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array == null
3501
+ ? []
3502
+ : _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array.length === 1 &&
3503
+ "@list" in _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array[0]
3504
+ ? _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array[0]["@list"]
3505
+ : _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array) {
3471
3506
  if (v == null)
3472
3507
  continue;
3473
3508
  const decoded = typeof v === "object" && "@value" in v &&
@@ -3484,14 +3519,26 @@ export class Object {
3484
3519
  }
3485
3520
  instance.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = _4ZHbBuK7PrsvGgrjM8wgc6KMWjav;
3486
3521
  const _219RwDanjScTv5tYCjwGZVCM7KZ9 = [];
3487
- for (const v of values["https://www.w3.org/ns/activitystreams#endTime"] ?? []) {
3522
+ const _219RwDanjScTv5tYCjwGZVCM7KZ9__array = values["https://www.w3.org/ns/activitystreams#endTime"];
3523
+ for (const v of _219RwDanjScTv5tYCjwGZVCM7KZ9__array == null
3524
+ ? []
3525
+ : _219RwDanjScTv5tYCjwGZVCM7KZ9__array.length === 1 &&
3526
+ "@list" in _219RwDanjScTv5tYCjwGZVCM7KZ9__array[0]
3527
+ ? _219RwDanjScTv5tYCjwGZVCM7KZ9__array[0]["@list"]
3528
+ : _219RwDanjScTv5tYCjwGZVCM7KZ9__array) {
3488
3529
  if (v == null)
3489
3530
  continue;
3490
3531
  _219RwDanjScTv5tYCjwGZVCM7KZ9.push(dntShim.Temporal.Instant.from(v["@value"]));
3491
3532
  }
3492
3533
  instance.#_219RwDanjScTv5tYCjwGZVCM7KZ9 = _219RwDanjScTv5tYCjwGZVCM7KZ9;
3493
3534
  const _86xFhmgBapoMvYqjbjRuDPayTrS = [];
3494
- for (const v of values["https://www.w3.org/ns/activitystreams#generator"] ?? []) {
3535
+ const _86xFhmgBapoMvYqjbjRuDPayTrS__array = values["https://www.w3.org/ns/activitystreams#generator"];
3536
+ for (const v of _86xFhmgBapoMvYqjbjRuDPayTrS__array == null
3537
+ ? []
3538
+ : _86xFhmgBapoMvYqjbjRuDPayTrS__array.length === 1 &&
3539
+ "@list" in _86xFhmgBapoMvYqjbjRuDPayTrS__array[0]
3540
+ ? _86xFhmgBapoMvYqjbjRuDPayTrS__array[0]["@list"]
3541
+ : _86xFhmgBapoMvYqjbjRuDPayTrS__array) {
3495
3542
  if (v == null)
3496
3543
  continue;
3497
3544
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3562,7 +3609,13 @@ export class Object {
3562
3609
  }
3563
3610
  instance.#_86xFhmgBapoMvYqjbjRuDPayTrS = _86xFhmgBapoMvYqjbjRuDPayTrS;
3564
3611
  const _33CjRLy5ujtsUrwRSCrsggvGdKuR = [];
3565
- for (const v of values["https://www.w3.org/ns/activitystreams#icon"] ?? []) {
3612
+ const _33CjRLy5ujtsUrwRSCrsggvGdKuR__array = values["https://www.w3.org/ns/activitystreams#icon"];
3613
+ for (const v of _33CjRLy5ujtsUrwRSCrsggvGdKuR__array == null
3614
+ ? []
3615
+ : _33CjRLy5ujtsUrwRSCrsggvGdKuR__array.length === 1 &&
3616
+ "@list" in _33CjRLy5ujtsUrwRSCrsggvGdKuR__array[0]
3617
+ ? _33CjRLy5ujtsUrwRSCrsggvGdKuR__array[0]["@list"]
3618
+ : _33CjRLy5ujtsUrwRSCrsggvGdKuR__array) {
3566
3619
  if (v == null)
3567
3620
  continue;
3568
3621
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3574,7 +3627,13 @@ export class Object {
3574
3627
  }
3575
3628
  instance.#_33CjRLy5ujtsUrwRSCrsggvGdKuR = _33CjRLy5ujtsUrwRSCrsggvGdKuR;
3576
3629
  const _3dXrUdkARxwyJLtJcYi1AJ92H41U = [];
3577
- for (const v of values["https://www.w3.org/ns/activitystreams#image"] ?? []) {
3630
+ const _3dXrUdkARxwyJLtJcYi1AJ92H41U__array = values["https://www.w3.org/ns/activitystreams#image"];
3631
+ for (const v of _3dXrUdkARxwyJLtJcYi1AJ92H41U__array == null
3632
+ ? []
3633
+ : _3dXrUdkARxwyJLtJcYi1AJ92H41U__array.length === 1 &&
3634
+ "@list" in _3dXrUdkARxwyJLtJcYi1AJ92H41U__array[0]
3635
+ ? _3dXrUdkARxwyJLtJcYi1AJ92H41U__array[0]["@list"]
3636
+ : _3dXrUdkARxwyJLtJcYi1AJ92H41U__array) {
3578
3637
  if (v == null)
3579
3638
  continue;
3580
3639
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3586,7 +3645,13 @@ export class Object {
3586
3645
  }
3587
3646
  instance.#_3dXrUdkARxwyJLtJcYi1AJ92H41U = _3dXrUdkARxwyJLtJcYi1AJ92H41U;
3588
3647
  const _3fpbDrvZgf3Kq1a5V9aByFn8kx3s = [];
3589
- for (const v of values["https://www.w3.org/ns/activitystreams#inReplyTo"] ?? []) {
3648
+ const _3fpbDrvZgf3Kq1a5V9aByFn8kx3s__array = values["https://www.w3.org/ns/activitystreams#inReplyTo"];
3649
+ for (const v of _3fpbDrvZgf3Kq1a5V9aByFn8kx3s__array == null
3650
+ ? []
3651
+ : _3fpbDrvZgf3Kq1a5V9aByFn8kx3s__array.length === 1 &&
3652
+ "@list" in _3fpbDrvZgf3Kq1a5V9aByFn8kx3s__array[0]
3653
+ ? _3fpbDrvZgf3Kq1a5V9aByFn8kx3s__array[0]["@list"]
3654
+ : _3fpbDrvZgf3Kq1a5V9aByFn8kx3s__array) {
3590
3655
  if (v == null)
3591
3656
  continue;
3592
3657
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3657,7 +3722,13 @@ export class Object {
3657
3722
  }
3658
3723
  instance.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s = _3fpbDrvZgf3Kq1a5V9aByFn8kx3s;
3659
3724
  const _31k5MUZJsnsPNg8dQQJieWaXTFnR = [];
3660
- for (const v of values["https://www.w3.org/ns/activitystreams#location"] ?? []) {
3725
+ const _31k5MUZJsnsPNg8dQQJieWaXTFnR__array = values["https://www.w3.org/ns/activitystreams#location"];
3726
+ for (const v of _31k5MUZJsnsPNg8dQQJieWaXTFnR__array == null
3727
+ ? []
3728
+ : _31k5MUZJsnsPNg8dQQJieWaXTFnR__array.length === 1 &&
3729
+ "@list" in _31k5MUZJsnsPNg8dQQJieWaXTFnR__array[0]
3730
+ ? _31k5MUZJsnsPNg8dQQJieWaXTFnR__array[0]["@list"]
3731
+ : _31k5MUZJsnsPNg8dQQJieWaXTFnR__array) {
3661
3732
  if (v == null)
3662
3733
  continue;
3663
3734
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3728,7 +3799,13 @@ export class Object {
3728
3799
  }
3729
3800
  instance.#_31k5MUZJsnsPNg8dQQJieWaXTFnR = _31k5MUZJsnsPNg8dQQJieWaXTFnR;
3730
3801
  const _gCVTegXxWWCw6wWRxa1QF65zusg = [];
3731
- for (const v of values["https://www.w3.org/ns/activitystreams#preview"] ?? []) {
3802
+ const _gCVTegXxWWCw6wWRxa1QF65zusg__array = values["https://www.w3.org/ns/activitystreams#preview"];
3803
+ for (const v of _gCVTegXxWWCw6wWRxa1QF65zusg__array == null
3804
+ ? []
3805
+ : _gCVTegXxWWCw6wWRxa1QF65zusg__array.length === 1 &&
3806
+ "@list" in _gCVTegXxWWCw6wWRxa1QF65zusg__array[0]
3807
+ ? _gCVTegXxWWCw6wWRxa1QF65zusg__array[0]["@list"]
3808
+ : _gCVTegXxWWCw6wWRxa1QF65zusg__array) {
3732
3809
  if (v == null)
3733
3810
  continue;
3734
3811
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3799,14 +3876,26 @@ export class Object {
3799
3876
  }
3800
3877
  instance.#_gCVTegXxWWCw6wWRxa1QF65zusg = _gCVTegXxWWCw6wWRxa1QF65zusg;
3801
3878
  const _5e258TDXtuhaFRPZiGoDfEpjdMr = [];
3802
- for (const v of values["https://www.w3.org/ns/activitystreams#published"] ?? []) {
3879
+ const _5e258TDXtuhaFRPZiGoDfEpjdMr__array = values["https://www.w3.org/ns/activitystreams#published"];
3880
+ for (const v of _5e258TDXtuhaFRPZiGoDfEpjdMr__array == null
3881
+ ? []
3882
+ : _5e258TDXtuhaFRPZiGoDfEpjdMr__array.length === 1 &&
3883
+ "@list" in _5e258TDXtuhaFRPZiGoDfEpjdMr__array[0]
3884
+ ? _5e258TDXtuhaFRPZiGoDfEpjdMr__array[0]["@list"]
3885
+ : _5e258TDXtuhaFRPZiGoDfEpjdMr__array) {
3803
3886
  if (v == null)
3804
3887
  continue;
3805
3888
  _5e258TDXtuhaFRPZiGoDfEpjdMr.push(dntShim.Temporal.Instant.from(v["@value"]));
3806
3889
  }
3807
3890
  instance.#_5e258TDXtuhaFRPZiGoDfEpjdMr = _5e258TDXtuhaFRPZiGoDfEpjdMr;
3808
3891
  const _7UpwM3JWcXhADcscukEehBorf6k = [];
3809
- for (const v of values["https://www.w3.org/ns/activitystreams#replies"] ?? []) {
3892
+ const _7UpwM3JWcXhADcscukEehBorf6k__array = values["https://www.w3.org/ns/activitystreams#replies"];
3893
+ for (const v of _7UpwM3JWcXhADcscukEehBorf6k__array == null
3894
+ ? []
3895
+ : _7UpwM3JWcXhADcscukEehBorf6k__array.length === 1 &&
3896
+ "@list" in _7UpwM3JWcXhADcscukEehBorf6k__array[0]
3897
+ ? _7UpwM3JWcXhADcscukEehBorf6k__array[0]["@list"]
3898
+ : _7UpwM3JWcXhADcscukEehBorf6k__array) {
3810
3899
  if (v == null)
3811
3900
  continue;
3812
3901
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3818,14 +3907,26 @@ export class Object {
3818
3907
  }
3819
3908
  instance.#_7UpwM3JWcXhADcscukEehBorf6k = _7UpwM3JWcXhADcscukEehBorf6k;
3820
3909
  const _2w3Jmue4up8iVDUA51WZqomEF438 = [];
3821
- for (const v of values["https://www.w3.org/ns/activitystreams#startTime"] ?? []) {
3910
+ const _2w3Jmue4up8iVDUA51WZqomEF438__array = values["https://www.w3.org/ns/activitystreams#startTime"];
3911
+ for (const v of _2w3Jmue4up8iVDUA51WZqomEF438__array == null
3912
+ ? []
3913
+ : _2w3Jmue4up8iVDUA51WZqomEF438__array.length === 1 &&
3914
+ "@list" in _2w3Jmue4up8iVDUA51WZqomEF438__array[0]
3915
+ ? _2w3Jmue4up8iVDUA51WZqomEF438__array[0]["@list"]
3916
+ : _2w3Jmue4up8iVDUA51WZqomEF438__array) {
3822
3917
  if (v == null)
3823
3918
  continue;
3824
3919
  _2w3Jmue4up8iVDUA51WZqomEF438.push(dntShim.Temporal.Instant.from(v["@value"]));
3825
3920
  }
3826
3921
  instance.#_2w3Jmue4up8iVDUA51WZqomEF438 = _2w3Jmue4up8iVDUA51WZqomEF438;
3827
3922
  const _4LqirZspQbFWWQEbFcXAxm7tTDN1 = [];
3828
- for (const v of values["https://www.w3.org/ns/activitystreams#summary"] ?? []) {
3923
+ const _4LqirZspQbFWWQEbFcXAxm7tTDN1__array = values["https://www.w3.org/ns/activitystreams#summary"];
3924
+ for (const v of _4LqirZspQbFWWQEbFcXAxm7tTDN1__array == null
3925
+ ? []
3926
+ : _4LqirZspQbFWWQEbFcXAxm7tTDN1__array.length === 1 &&
3927
+ "@list" in _4LqirZspQbFWWQEbFcXAxm7tTDN1__array[0]
3928
+ ? _4LqirZspQbFWWQEbFcXAxm7tTDN1__array[0]["@list"]
3929
+ : _4LqirZspQbFWWQEbFcXAxm7tTDN1__array) {
3829
3930
  if (v == null)
3830
3931
  continue;
3831
3932
  const decoded = typeof v === "object" && "@value" in v &&
@@ -3842,7 +3943,13 @@ export class Object {
3842
3943
  }
3843
3944
  instance.#_4LqirZspQbFWWQEbFcXAxm7tTDN1 = _4LqirZspQbFWWQEbFcXAxm7tTDN1;
3844
3945
  const _5chuqj6s95p5gg2sk1HntGfarRf = [];
3845
- for (const v of values["https://www.w3.org/ns/activitystreams#tag"] ?? []) {
3946
+ const _5chuqj6s95p5gg2sk1HntGfarRf__array = values["https://www.w3.org/ns/activitystreams#tag"];
3947
+ for (const v of _5chuqj6s95p5gg2sk1HntGfarRf__array == null
3948
+ ? []
3949
+ : _5chuqj6s95p5gg2sk1HntGfarRf__array.length === 1 &&
3950
+ "@list" in _5chuqj6s95p5gg2sk1HntGfarRf__array[0]
3951
+ ? _5chuqj6s95p5gg2sk1HntGfarRf__array[0]["@list"]
3952
+ : _5chuqj6s95p5gg2sk1HntGfarRf__array) {
3846
3953
  if (v == null)
3847
3954
  continue;
3848
3955
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3913,14 +4020,26 @@ export class Object {
3913
4020
  }
3914
4021
  instance.#_5chuqj6s95p5gg2sk1HntGfarRf = _5chuqj6s95p5gg2sk1HntGfarRf;
3915
4022
  const _385aB7ySixcf5Un6z3VsWmThgCzQ = [];
3916
- for (const v of values["https://www.w3.org/ns/activitystreams#updated"] ?? []) {
4023
+ const _385aB7ySixcf5Un6z3VsWmThgCzQ__array = values["https://www.w3.org/ns/activitystreams#updated"];
4024
+ for (const v of _385aB7ySixcf5Un6z3VsWmThgCzQ__array == null
4025
+ ? []
4026
+ : _385aB7ySixcf5Un6z3VsWmThgCzQ__array.length === 1 &&
4027
+ "@list" in _385aB7ySixcf5Un6z3VsWmThgCzQ__array[0]
4028
+ ? _385aB7ySixcf5Un6z3VsWmThgCzQ__array[0]["@list"]
4029
+ : _385aB7ySixcf5Un6z3VsWmThgCzQ__array) {
3917
4030
  if (v == null)
3918
4031
  continue;
3919
4032
  _385aB7ySixcf5Un6z3VsWmThgCzQ.push(dntShim.Temporal.Instant.from(v["@value"]));
3920
4033
  }
3921
4034
  instance.#_385aB7ySixcf5Un6z3VsWmThgCzQ = _385aB7ySixcf5Un6z3VsWmThgCzQ;
3922
4035
  const _2oPEH9MQ3aj8JVwyYuWkqoVwV865 = [];
3923
- for (const v of values["https://www.w3.org/ns/activitystreams#url"] ?? []) {
4036
+ const _2oPEH9MQ3aj8JVwyYuWkqoVwV865__array = values["https://www.w3.org/ns/activitystreams#url"];
4037
+ for (const v of _2oPEH9MQ3aj8JVwyYuWkqoVwV865__array == null
4038
+ ? []
4039
+ : _2oPEH9MQ3aj8JVwyYuWkqoVwV865__array.length === 1 &&
4040
+ "@list" in _2oPEH9MQ3aj8JVwyYuWkqoVwV865__array[0]
4041
+ ? _2oPEH9MQ3aj8JVwyYuWkqoVwV865__array[0]["@list"]
4042
+ : _2oPEH9MQ3aj8JVwyYuWkqoVwV865__array) {
3924
4043
  if (v == null)
3925
4044
  continue;
3926
4045
  const decoded = typeof v === "object" && "@id" in v &&
@@ -3941,7 +4060,13 @@ export class Object {
3941
4060
  }
3942
4061
  instance.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865 = _2oPEH9MQ3aj8JVwyYuWkqoVwV865;
3943
4062
  const _3hFbw7DTpHhq3cvVhkY8njhcsXbd = [];
3944
- for (const v of values["https://www.w3.org/ns/activitystreams#to"] ?? []) {
4063
+ const _3hFbw7DTpHhq3cvVhkY8njhcsXbd__array = values["https://www.w3.org/ns/activitystreams#to"];
4064
+ for (const v of _3hFbw7DTpHhq3cvVhkY8njhcsXbd__array == null
4065
+ ? []
4066
+ : _3hFbw7DTpHhq3cvVhkY8njhcsXbd__array.length === 1 &&
4067
+ "@list" in _3hFbw7DTpHhq3cvVhkY8njhcsXbd__array[0]
4068
+ ? _3hFbw7DTpHhq3cvVhkY8njhcsXbd__array[0]["@list"]
4069
+ : _3hFbw7DTpHhq3cvVhkY8njhcsXbd__array) {
3945
4070
  if (v == null)
3946
4071
  continue;
3947
4072
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3953,7 +4078,13 @@ export class Object {
3953
4078
  }
3954
4079
  instance.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd = _3hFbw7DTpHhq3cvVhkY8njhcsXbd;
3955
4080
  const _aLZupjwL8XB7tzdLgCMXdjZ6qej = [];
3956
- for (const v of values["https://www.w3.org/ns/activitystreams#bto"] ?? []) {
4081
+ const _aLZupjwL8XB7tzdLgCMXdjZ6qej__array = values["https://www.w3.org/ns/activitystreams#bto"];
4082
+ for (const v of _aLZupjwL8XB7tzdLgCMXdjZ6qej__array == null
4083
+ ? []
4084
+ : _aLZupjwL8XB7tzdLgCMXdjZ6qej__array.length === 1 &&
4085
+ "@list" in _aLZupjwL8XB7tzdLgCMXdjZ6qej__array[0]
4086
+ ? _aLZupjwL8XB7tzdLgCMXdjZ6qej__array[0]["@list"]
4087
+ : _aLZupjwL8XB7tzdLgCMXdjZ6qej__array) {
3957
4088
  if (v == null)
3958
4089
  continue;
3959
4090
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3965,7 +4096,13 @@ export class Object {
3965
4096
  }
3966
4097
  instance.#_aLZupjwL8XB7tzdLgCMXdjZ6qej = _aLZupjwL8XB7tzdLgCMXdjZ6qej;
3967
4098
  const _42a1SvBs24QSLzKcfjCyNTjW5a1g = [];
3968
- for (const v of values["https://www.w3.org/ns/activitystreams#cc"] ?? []) {
4099
+ const _42a1SvBs24QSLzKcfjCyNTjW5a1g__array = values["https://www.w3.org/ns/activitystreams#cc"];
4100
+ for (const v of _42a1SvBs24QSLzKcfjCyNTjW5a1g__array == null
4101
+ ? []
4102
+ : _42a1SvBs24QSLzKcfjCyNTjW5a1g__array.length === 1 &&
4103
+ "@list" in _42a1SvBs24QSLzKcfjCyNTjW5a1g__array[0]
4104
+ ? _42a1SvBs24QSLzKcfjCyNTjW5a1g__array[0]["@list"]
4105
+ : _42a1SvBs24QSLzKcfjCyNTjW5a1g__array) {
3969
4106
  if (v == null)
3970
4107
  continue;
3971
4108
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3977,7 +4114,13 @@ export class Object {
3977
4114
  }
3978
4115
  instance.#_42a1SvBs24QSLzKcfjCyNTjW5a1g = _42a1SvBs24QSLzKcfjCyNTjW5a1g;
3979
4116
  const _3qvegKUB8YLgTXRpEf8E6JZSkz2H = [];
3980
- for (const v of values["https://www.w3.org/ns/activitystreams#bcc"] ?? []) {
4117
+ const _3qvegKUB8YLgTXRpEf8E6JZSkz2H__array = values["https://www.w3.org/ns/activitystreams#bcc"];
4118
+ for (const v of _3qvegKUB8YLgTXRpEf8E6JZSkz2H__array == null
4119
+ ? []
4120
+ : _3qvegKUB8YLgTXRpEf8E6JZSkz2H__array.length === 1 &&
4121
+ "@list" in _3qvegKUB8YLgTXRpEf8E6JZSkz2H__array[0]
4122
+ ? _3qvegKUB8YLgTXRpEf8E6JZSkz2H__array[0]["@list"]
4123
+ : _3qvegKUB8YLgTXRpEf8E6JZSkz2H__array) {
3981
4124
  if (v == null)
3982
4125
  continue;
3983
4126
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -3989,28 +4132,52 @@ export class Object {
3989
4132
  }
3990
4133
  instance.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H = _3qvegKUB8YLgTXRpEf8E6JZSkz2H;
3991
4134
  const _3BLrzmscsjHCw8TF5BHRW9WkPnX8 = [];
3992
- for (const v of values["https://www.w3.org/ns/activitystreams#mediaType"] ?? []) {
4135
+ const _3BLrzmscsjHCw8TF5BHRW9WkPnX8__array = values["https://www.w3.org/ns/activitystreams#mediaType"];
4136
+ for (const v of _3BLrzmscsjHCw8TF5BHRW9WkPnX8__array == null
4137
+ ? []
4138
+ : _3BLrzmscsjHCw8TF5BHRW9WkPnX8__array.length === 1 &&
4139
+ "@list" in _3BLrzmscsjHCw8TF5BHRW9WkPnX8__array[0]
4140
+ ? _3BLrzmscsjHCw8TF5BHRW9WkPnX8__array[0]["@list"]
4141
+ : _3BLrzmscsjHCw8TF5BHRW9WkPnX8__array) {
3993
4142
  if (v == null)
3994
4143
  continue;
3995
4144
  _3BLrzmscsjHCw8TF5BHRW9WkPnX8.push(v["@value"]);
3996
4145
  }
3997
4146
  instance.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8 = _3BLrzmscsjHCw8TF5BHRW9WkPnX8;
3998
4147
  const _3bNvLMBN1bCJETiTihM3wvi1B2JX = [];
3999
- for (const v of values["https://www.w3.org/ns/activitystreams#duration"] ?? []) {
4148
+ const _3bNvLMBN1bCJETiTihM3wvi1B2JX__array = values["https://www.w3.org/ns/activitystreams#duration"];
4149
+ for (const v of _3bNvLMBN1bCJETiTihM3wvi1B2JX__array == null
4150
+ ? []
4151
+ : _3bNvLMBN1bCJETiTihM3wvi1B2JX__array.length === 1 &&
4152
+ "@list" in _3bNvLMBN1bCJETiTihM3wvi1B2JX__array[0]
4153
+ ? _3bNvLMBN1bCJETiTihM3wvi1B2JX__array[0]["@list"]
4154
+ : _3bNvLMBN1bCJETiTihM3wvi1B2JX__array) {
4000
4155
  if (v == null)
4001
4156
  continue;
4002
4157
  _3bNvLMBN1bCJETiTihM3wvi1B2JX.push(dntShim.Temporal.Duration.from(v["@value"]));
4003
4158
  }
4004
4159
  instance.#_3bNvLMBN1bCJETiTihM3wvi1B2JX = _3bNvLMBN1bCJETiTihM3wvi1B2JX;
4005
4160
  const _u8gdcDTtChQ4tbSQMXc4cYWyum7 = [];
4006
- for (const v of values["https://www.w3.org/ns/activitystreams#sensitive"] ?? []) {
4161
+ const _u8gdcDTtChQ4tbSQMXc4cYWyum7__array = values["https://www.w3.org/ns/activitystreams#sensitive"];
4162
+ for (const v of _u8gdcDTtChQ4tbSQMXc4cYWyum7__array == null
4163
+ ? []
4164
+ : _u8gdcDTtChQ4tbSQMXc4cYWyum7__array.length === 1 &&
4165
+ "@list" in _u8gdcDTtChQ4tbSQMXc4cYWyum7__array[0]
4166
+ ? _u8gdcDTtChQ4tbSQMXc4cYWyum7__array[0]["@list"]
4167
+ : _u8gdcDTtChQ4tbSQMXc4cYWyum7__array) {
4007
4168
  if (v == null)
4008
4169
  continue;
4009
4170
  _u8gdcDTtChQ4tbSQMXc4cYWyum7.push(v["@value"]);
4010
4171
  }
4011
4172
  instance.#_u8gdcDTtChQ4tbSQMXc4cYWyum7 = _u8gdcDTtChQ4tbSQMXc4cYWyum7;
4012
4173
  const _42rPnotok1ivQ2RNCKNbeFJgx8b8 = [];
4013
- for (const v of values["https://w3id.org/security#proof"] ?? []) {
4174
+ const _42rPnotok1ivQ2RNCKNbeFJgx8b8__array = values["https://w3id.org/security#proof"];
4175
+ for (const v of _42rPnotok1ivQ2RNCKNbeFJgx8b8__array == null
4176
+ ? []
4177
+ : _42rPnotok1ivQ2RNCKNbeFJgx8b8__array.length === 1 &&
4178
+ "@list" in _42rPnotok1ivQ2RNCKNbeFJgx8b8__array[0]
4179
+ ? _42rPnotok1ivQ2RNCKNbeFJgx8b8__array[0]["@list"]
4180
+ : _42rPnotok1ivQ2RNCKNbeFJgx8b8__array) {
4014
4181
  if (v == null)
4015
4182
  continue;
4016
4183
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -4684,8 +4851,9 @@ export class PropertyValue {
4684
4851
  };
4685
4852
  array.push(element);
4686
4853
  }
4687
- if (array.length > 0)
4854
+ if (array.length > 0) {
4688
4855
  values["http://schema.org#value"] = array;
4856
+ }
4689
4857
  values["@type"] = ["http://schema.org#PropertyValue"];
4690
4858
  if (this.id)
4691
4859
  values["@id"] = this.id.href;
@@ -4737,7 +4905,13 @@ export class PropertyValue {
4737
4905
  }
4738
4906
  const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, options);
4739
4907
  const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav = [];
4740
- for (const v of values["https://www.w3.org/ns/activitystreams#name"] ?? []) {
4908
+ const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array = values["https://www.w3.org/ns/activitystreams#name"];
4909
+ for (const v of _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array == null
4910
+ ? []
4911
+ : _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array.length === 1 &&
4912
+ "@list" in _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array[0]
4913
+ ? _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array[0]["@list"]
4914
+ : _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array) {
4741
4915
  if (v == null)
4742
4916
  continue;
4743
4917
  const decoded = typeof v === "object" && "@value" in v &&
@@ -4754,7 +4928,13 @@ export class PropertyValue {
4754
4928
  }
4755
4929
  instance.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = _4ZHbBuK7PrsvGgrjM8wgc6KMWjav;
4756
4930
  const _2cSy2magg4iZ7zLaG8U7DiJMoCkx = [];
4757
- for (const v of values["http://schema.org#value"] ?? []) {
4931
+ const _2cSy2magg4iZ7zLaG8U7DiJMoCkx__array = values["http://schema.org#value"];
4932
+ for (const v of _2cSy2magg4iZ7zLaG8U7DiJMoCkx__array == null
4933
+ ? []
4934
+ : _2cSy2magg4iZ7zLaG8U7DiJMoCkx__array.length === 1 &&
4935
+ "@list" in _2cSy2magg4iZ7zLaG8U7DiJMoCkx__array[0]
4936
+ ? _2cSy2magg4iZ7zLaG8U7DiJMoCkx__array[0]["@list"]
4937
+ : _2cSy2magg4iZ7zLaG8U7DiJMoCkx__array) {
4758
4938
  if (v == null)
4759
4939
  continue;
4760
4940
  const decoded = typeof v === "object" && "@value" in v &&
@@ -5131,8 +5311,9 @@ export class DataIntegrityProof {
5131
5311
  };
5132
5312
  array.push(element);
5133
5313
  }
5134
- if (array.length > 0)
5314
+ if (array.length > 0) {
5135
5315
  values["http://purl.org/dc/terms/created"] = array;
5316
+ }
5136
5317
  values["@type"] = ["https://w3id.org/security#DataIntegrityProof"];
5137
5318
  if (this.id)
5138
5319
  values["@id"] = this.id.href;
@@ -5179,14 +5360,26 @@ export class DataIntegrityProof {
5179
5360
  }
5180
5361
  const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, options);
5181
5362
  const _3RurJsa7tnptyqMFR5hDGcP9pMs5 = [];
5182
- for (const v of values["https://w3id.org/security#cryptosuite"] ?? []) {
5363
+ const _3RurJsa7tnptyqMFR5hDGcP9pMs5__array = values["https://w3id.org/security#cryptosuite"];
5364
+ for (const v of _3RurJsa7tnptyqMFR5hDGcP9pMs5__array == null
5365
+ ? []
5366
+ : _3RurJsa7tnptyqMFR5hDGcP9pMs5__array.length === 1 &&
5367
+ "@list" in _3RurJsa7tnptyqMFR5hDGcP9pMs5__array[0]
5368
+ ? _3RurJsa7tnptyqMFR5hDGcP9pMs5__array[0]["@list"]
5369
+ : _3RurJsa7tnptyqMFR5hDGcP9pMs5__array) {
5183
5370
  if (v == null)
5184
5371
  continue;
5185
5372
  _3RurJsa7tnptyqMFR5hDGcP9pMs5.push(v["@value"]);
5186
5373
  }
5187
5374
  instance.#_3RurJsa7tnptyqMFR5hDGcP9pMs5 = _3RurJsa7tnptyqMFR5hDGcP9pMs5;
5188
5375
  const _2mHVKxqA7zncjveJrDEo3pWpMZqg = [];
5189
- for (const v of values["https://w3id.org/security#verificationMethod"] ?? []) {
5376
+ const _2mHVKxqA7zncjveJrDEo3pWpMZqg__array = values["https://w3id.org/security#verificationMethod"];
5377
+ for (const v of _2mHVKxqA7zncjveJrDEo3pWpMZqg__array == null
5378
+ ? []
5379
+ : _2mHVKxqA7zncjveJrDEo3pWpMZqg__array.length === 1 &&
5380
+ "@list" in _2mHVKxqA7zncjveJrDEo3pWpMZqg__array[0]
5381
+ ? _2mHVKxqA7zncjveJrDEo3pWpMZqg__array[0]["@list"]
5382
+ : _2mHVKxqA7zncjveJrDEo3pWpMZqg__array) {
5190
5383
  if (v == null)
5191
5384
  continue;
5192
5385
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -5198,21 +5391,39 @@ export class DataIntegrityProof {
5198
5391
  }
5199
5392
  instance.#_2mHVKxqA7zncjveJrDEo3pWpMZqg = _2mHVKxqA7zncjveJrDEo3pWpMZqg;
5200
5393
  const _2AeEnPcAvVrPEuKbpmn9ZKNmWHKb = [];
5201
- for (const v of values["https://w3id.org/security#proofPurpose"] ?? []) {
5394
+ const _2AeEnPcAvVrPEuKbpmn9ZKNmWHKb__array = values["https://w3id.org/security#proofPurpose"];
5395
+ for (const v of _2AeEnPcAvVrPEuKbpmn9ZKNmWHKb__array == null
5396
+ ? []
5397
+ : _2AeEnPcAvVrPEuKbpmn9ZKNmWHKb__array.length === 1 &&
5398
+ "@list" in _2AeEnPcAvVrPEuKbpmn9ZKNmWHKb__array[0]
5399
+ ? _2AeEnPcAvVrPEuKbpmn9ZKNmWHKb__array[0]["@list"]
5400
+ : _2AeEnPcAvVrPEuKbpmn9ZKNmWHKb__array) {
5202
5401
  if (v == null)
5203
5402
  continue;
5204
5403
  _2AeEnPcAvVrPEuKbpmn9ZKNmWHKb.push(v["@id"].substring(26));
5205
5404
  }
5206
5405
  instance.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb = _2AeEnPcAvVrPEuKbpmn9ZKNmWHKb;
5207
5406
  const _3CjFK5vfKpX4HQuNh2b18TykoVLq = [];
5208
- for (const v of values["https://w3id.org/security#proofValue"] ?? []) {
5407
+ const _3CjFK5vfKpX4HQuNh2b18TykoVLq__array = values["https://w3id.org/security#proofValue"];
5408
+ for (const v of _3CjFK5vfKpX4HQuNh2b18TykoVLq__array == null
5409
+ ? []
5410
+ : _3CjFK5vfKpX4HQuNh2b18TykoVLq__array.length === 1 &&
5411
+ "@list" in _3CjFK5vfKpX4HQuNh2b18TykoVLq__array[0]
5412
+ ? _3CjFK5vfKpX4HQuNh2b18TykoVLq__array[0]["@list"]
5413
+ : _3CjFK5vfKpX4HQuNh2b18TykoVLq__array) {
5209
5414
  if (v == null)
5210
5415
  continue;
5211
5416
  _3CjFK5vfKpX4HQuNh2b18TykoVLq.push(decodeMultibase(v["@value"]));
5212
5417
  }
5213
5418
  instance.#_3CjFK5vfKpX4HQuNh2b18TykoVLq = _3CjFK5vfKpX4HQuNh2b18TykoVLq;
5214
5419
  const _3qzP3ukEZoUziK5FEiA1RhU4aqac = [];
5215
- for (const v of values["http://purl.org/dc/terms/created"] ?? []) {
5420
+ const _3qzP3ukEZoUziK5FEiA1RhU4aqac__array = values["http://purl.org/dc/terms/created"];
5421
+ for (const v of _3qzP3ukEZoUziK5FEiA1RhU4aqac__array == null
5422
+ ? []
5423
+ : _3qzP3ukEZoUziK5FEiA1RhU4aqac__array.length === 1 &&
5424
+ "@list" in _3qzP3ukEZoUziK5FEiA1RhU4aqac__array[0]
5425
+ ? _3qzP3ukEZoUziK5FEiA1RhU4aqac__array[0]["@list"]
5426
+ : _3qzP3ukEZoUziK5FEiA1RhU4aqac__array) {
5216
5427
  if (v == null)
5217
5428
  continue;
5218
5429
  _3qzP3ukEZoUziK5FEiA1RhU4aqac.push(dntShim.Temporal.Instant.from(v["@value"]));
@@ -5517,8 +5728,9 @@ export class CryptographicKey {
5517
5728
  : await v.toJsonLd(options);
5518
5729
  array.push(element);
5519
5730
  }
5520
- if (array.length > 0)
5731
+ if (array.length > 0) {
5521
5732
  values["https://w3id.org/security#owner"] = array;
5733
+ }
5522
5734
  array = [];
5523
5735
  for (const v of this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD) {
5524
5736
  const element = { "@value": await exportSpki(v) };
@@ -5573,7 +5785,13 @@ export class CryptographicKey {
5573
5785
  }
5574
5786
  const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, options);
5575
5787
  const _5UJq9NDh3ZHgswFwwdVxQvJxdx2 = [];
5576
- for (const v of values["https://w3id.org/security#owner"] ?? []) {
5788
+ const _5UJq9NDh3ZHgswFwwdVxQvJxdx2__array = values["https://w3id.org/security#owner"];
5789
+ for (const v of _5UJq9NDh3ZHgswFwwdVxQvJxdx2__array == null
5790
+ ? []
5791
+ : _5UJq9NDh3ZHgswFwwdVxQvJxdx2__array.length === 1 &&
5792
+ "@list" in _5UJq9NDh3ZHgswFwwdVxQvJxdx2__array[0]
5793
+ ? _5UJq9NDh3ZHgswFwwdVxQvJxdx2__array[0]["@list"]
5794
+ : _5UJq9NDh3ZHgswFwwdVxQvJxdx2__array) {
5577
5795
  if (v == null)
5578
5796
  continue;
5579
5797
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -5608,7 +5826,13 @@ export class CryptographicKey {
5608
5826
  }
5609
5827
  instance.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2 = _5UJq9NDh3ZHgswFwwdVxQvJxdx2;
5610
5828
  const _2fE2QMDdg6KFGqa4NEC3TmjApSAD = [];
5611
- for (const v of values["https://w3id.org/security#publicKeyPem"] ?? []) {
5829
+ const _2fE2QMDdg6KFGqa4NEC3TmjApSAD__array = values["https://w3id.org/security#publicKeyPem"];
5830
+ for (const v of _2fE2QMDdg6KFGqa4NEC3TmjApSAD__array == null
5831
+ ? []
5832
+ : _2fE2QMDdg6KFGqa4NEC3TmjApSAD__array.length === 1 &&
5833
+ "@list" in _2fE2QMDdg6KFGqa4NEC3TmjApSAD__array[0]
5834
+ ? _2fE2QMDdg6KFGqa4NEC3TmjApSAD__array[0]["@list"]
5835
+ : _2fE2QMDdg6KFGqa4NEC3TmjApSAD__array) {
5612
5836
  if (v == null)
5613
5837
  continue;
5614
5838
  _2fE2QMDdg6KFGqa4NEC3TmjApSAD.push(await importSpki(v["@value"]));
@@ -5948,7 +6172,13 @@ export class Multikey {
5948
6172
  }
5949
6173
  const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, options);
5950
6174
  const _2yr3eUBTP6cNcyaxKzAXWjFsnGzN = [];
5951
- for (const v of values["https://w3id.org/security#controller"] ?? []) {
6175
+ const _2yr3eUBTP6cNcyaxKzAXWjFsnGzN__array = values["https://w3id.org/security#controller"];
6176
+ for (const v of _2yr3eUBTP6cNcyaxKzAXWjFsnGzN__array == null
6177
+ ? []
6178
+ : _2yr3eUBTP6cNcyaxKzAXWjFsnGzN__array.length === 1 &&
6179
+ "@list" in _2yr3eUBTP6cNcyaxKzAXWjFsnGzN__array[0]
6180
+ ? _2yr3eUBTP6cNcyaxKzAXWjFsnGzN__array[0]["@list"]
6181
+ : _2yr3eUBTP6cNcyaxKzAXWjFsnGzN__array) {
5952
6182
  if (v == null)
5953
6183
  continue;
5954
6184
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -5983,7 +6213,13 @@ export class Multikey {
5983
6213
  }
5984
6214
  instance.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN = _2yr3eUBTP6cNcyaxKzAXWjFsnGzN;
5985
6215
  const _4XLHbsR2gLVWU3NpEqKt9wANzn4F = [];
5986
- for (const v of values["https://w3id.org/security#publicKeyMultibase"] ?? []) {
6216
+ const _4XLHbsR2gLVWU3NpEqKt9wANzn4F__array = values["https://w3id.org/security#publicKeyMultibase"];
6217
+ for (const v of _4XLHbsR2gLVWU3NpEqKt9wANzn4F__array == null
6218
+ ? []
6219
+ : _4XLHbsR2gLVWU3NpEqKt9wANzn4F__array.length === 1 &&
6220
+ "@list" in _4XLHbsR2gLVWU3NpEqKt9wANzn4F__array[0]
6221
+ ? _4XLHbsR2gLVWU3NpEqKt9wANzn4F__array[0]["@list"]
6222
+ : _4XLHbsR2gLVWU3NpEqKt9wANzn4F__array) {
5987
6223
  if (v == null)
5988
6224
  continue;
5989
6225
  _4XLHbsR2gLVWU3NpEqKt9wANzn4F.push(await importMultibaseKey(v["@value"]));
@@ -7155,7 +7391,13 @@ export class Activity extends Object {
7155
7391
  throw new TypeError("Unexpected type: " + instance.constructor.name);
7156
7392
  }
7157
7393
  const _2DjTTboo3CNHU2a2JQqUSE2dbv9D = [];
7158
- for (const v of values["https://www.w3.org/ns/activitystreams#actor"] ?? []) {
7394
+ const _2DjTTboo3CNHU2a2JQqUSE2dbv9D__array = values["https://www.w3.org/ns/activitystreams#actor"];
7395
+ for (const v of _2DjTTboo3CNHU2a2JQqUSE2dbv9D__array == null
7396
+ ? []
7397
+ : _2DjTTboo3CNHU2a2JQqUSE2dbv9D__array.length === 1 &&
7398
+ "@list" in _2DjTTboo3CNHU2a2JQqUSE2dbv9D__array[0]
7399
+ ? _2DjTTboo3CNHU2a2JQqUSE2dbv9D__array[0]["@list"]
7400
+ : _2DjTTboo3CNHU2a2JQqUSE2dbv9D__array) {
7159
7401
  if (v == null)
7160
7402
  continue;
7161
7403
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -7190,7 +7432,13 @@ export class Activity extends Object {
7190
7432
  }
7191
7433
  instance.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D = _2DjTTboo3CNHU2a2JQqUSE2dbv9D;
7192
7434
  const _2MH19yxjn1wnHsNfa5n4JBhJzxyc = [];
7193
- for (const v of values["https://www.w3.org/ns/activitystreams#object"] ?? []) {
7435
+ const _2MH19yxjn1wnHsNfa5n4JBhJzxyc__array = values["https://www.w3.org/ns/activitystreams#object"];
7436
+ for (const v of _2MH19yxjn1wnHsNfa5n4JBhJzxyc__array == null
7437
+ ? []
7438
+ : _2MH19yxjn1wnHsNfa5n4JBhJzxyc__array.length === 1 &&
7439
+ "@list" in _2MH19yxjn1wnHsNfa5n4JBhJzxyc__array[0]
7440
+ ? _2MH19yxjn1wnHsNfa5n4JBhJzxyc__array[0]["@list"]
7441
+ : _2MH19yxjn1wnHsNfa5n4JBhJzxyc__array) {
7194
7442
  if (v == null)
7195
7443
  continue;
7196
7444
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -7202,7 +7450,13 @@ export class Activity extends Object {
7202
7450
  }
7203
7451
  instance.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc = _2MH19yxjn1wnHsNfa5n4JBhJzxyc;
7204
7452
  const _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF = [];
7205
- for (const v of values["https://www.w3.org/ns/activitystreams#target"] ?? []) {
7453
+ const _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF__array = values["https://www.w3.org/ns/activitystreams#target"];
7454
+ for (const v of _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF__array == null
7455
+ ? []
7456
+ : _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF__array.length === 1 &&
7457
+ "@list" in _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF__array[0]
7458
+ ? _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF__array[0]["@list"]
7459
+ : _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF__array) {
7206
7460
  if (v == null)
7207
7461
  continue;
7208
7462
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -7214,7 +7468,13 @@ export class Activity extends Object {
7214
7468
  }
7215
7469
  instance.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF = _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF;
7216
7470
  const _u4QGFbRFcYmPEKGbPv1hpBR9r5G = [];
7217
- for (const v of values["https://www.w3.org/ns/activitystreams#result"] ?? []) {
7471
+ const _u4QGFbRFcYmPEKGbPv1hpBR9r5G__array = values["https://www.w3.org/ns/activitystreams#result"];
7472
+ for (const v of _u4QGFbRFcYmPEKGbPv1hpBR9r5G__array == null
7473
+ ? []
7474
+ : _u4QGFbRFcYmPEKGbPv1hpBR9r5G__array.length === 1 &&
7475
+ "@list" in _u4QGFbRFcYmPEKGbPv1hpBR9r5G__array[0]
7476
+ ? _u4QGFbRFcYmPEKGbPv1hpBR9r5G__array[0]["@list"]
7477
+ : _u4QGFbRFcYmPEKGbPv1hpBR9r5G__array) {
7218
7478
  if (v == null)
7219
7479
  continue;
7220
7480
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -7226,7 +7486,13 @@ export class Activity extends Object {
7226
7486
  }
7227
7487
  instance.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G = _u4QGFbRFcYmPEKGbPv1hpBR9r5G;
7228
7488
  const _25zu2s3VxVujgEKqrDycjE284XQR = [];
7229
- for (const v of values["https://www.w3.org/ns/activitystreams#origin"] ?? []) {
7489
+ const _25zu2s3VxVujgEKqrDycjE284XQR__array = values["https://www.w3.org/ns/activitystreams#origin"];
7490
+ for (const v of _25zu2s3VxVujgEKqrDycjE284XQR__array == null
7491
+ ? []
7492
+ : _25zu2s3VxVujgEKqrDycjE284XQR__array.length === 1 &&
7493
+ "@list" in _25zu2s3VxVujgEKqrDycjE284XQR__array[0]
7494
+ ? _25zu2s3VxVujgEKqrDycjE284XQR__array[0]["@list"]
7495
+ : _25zu2s3VxVujgEKqrDycjE284XQR__array) {
7230
7496
  if (v == null)
7231
7497
  continue;
7232
7498
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -7238,8 +7504,13 @@ export class Activity extends Object {
7238
7504
  }
7239
7505
  instance.#_25zu2s3VxVujgEKqrDycjE284XQR = _25zu2s3VxVujgEKqrDycjE284XQR;
7240
7506
  const _3c5t2x7DYRo2shwTxpkd4kYSS5WQ = [];
7241
- for (const v of values["https://www.w3.org/ns/activitystreams#instrument"] ??
7242
- []) {
7507
+ const _3c5t2x7DYRo2shwTxpkd4kYSS5WQ__array = values["https://www.w3.org/ns/activitystreams#instrument"];
7508
+ for (const v of _3c5t2x7DYRo2shwTxpkd4kYSS5WQ__array == null
7509
+ ? []
7510
+ : _3c5t2x7DYRo2shwTxpkd4kYSS5WQ__array.length === 1 &&
7511
+ "@list" in _3c5t2x7DYRo2shwTxpkd4kYSS5WQ__array[0]
7512
+ ? _3c5t2x7DYRo2shwTxpkd4kYSS5WQ__array[0]["@list"]
7513
+ : _3c5t2x7DYRo2shwTxpkd4kYSS5WQ__array) {
7243
7514
  if (v == null)
7244
7515
  continue;
7245
7516
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -7723,6 +7994,7 @@ export class Application extends Object {
7723
7994
  #_BBCTgfphhsFzpVfKTykGSpBNwoA = [];
7724
7995
  #_3bgkPwJanyTCoVFM9ovRcus8tKkU = [];
7725
7996
  #_4N1vBJzXDf8NbBumeECQMFvKetja = [];
7997
+ #_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [];
7726
7998
  #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = [];
7727
7999
  #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [];
7728
8000
  #_gAJzg1QDc4rcefFsUzGSYmyXvNH = [];
@@ -7891,6 +8163,17 @@ export class Application extends Object {
7891
8163
  "Collection | URL" + ".");
7892
8164
  }
7893
8165
  }
8166
+ if ("featuredTags" in values && values.featuredTags != null) {
8167
+ if (values.featuredTags instanceof Collection ||
8168
+ values.featuredTags instanceof URL) {
8169
+ // @ts-ignore: type is checked above.
8170
+ this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [values.featuredTags];
8171
+ }
8172
+ else {
8173
+ throw new TypeError("The featuredTags must be of type " +
8174
+ "Collection | URL" + ".");
8175
+ }
8176
+ }
7894
8177
  if ("streams" in values && values.streams != null) {
7895
8178
  if (Array.isArray(values.streams) &&
7896
8179
  values.streams.every((v) => v instanceof Collection || v instanceof URL)) {
@@ -8128,6 +8411,18 @@ export class Application extends Object {
8128
8411
  "Collection | URL" + ".");
8129
8412
  }
8130
8413
  }
8414
+ clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac;
8415
+ if ("featuredTags" in values && values.featuredTags != null) {
8416
+ if (values.featuredTags instanceof Collection ||
8417
+ values.featuredTags instanceof URL) {
8418
+ // @ts-ignore: type is checked above.
8419
+ clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [values.featuredTags];
8420
+ }
8421
+ else {
8422
+ throw new TypeError("The featuredTags must be of type " +
8423
+ "Collection | URL" + ".");
8424
+ }
8425
+ }
8131
8426
  clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9;
8132
8427
  if ("streams" in values && values.streams != null) {
8133
8428
  if (Array.isArray(values.streams) &&
@@ -8759,6 +9054,64 @@ export class Application extends Object {
8759
9054
  }
8760
9055
  return v;
8761
9056
  }
9057
+ async #fetchFeaturedTags(url, options = {}) {
9058
+ const documentLoader = options.documentLoader ?? this._documentLoader ??
9059
+ fetchDocumentLoader;
9060
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
9061
+ fetchDocumentLoader;
9062
+ let fetchResult;
9063
+ try {
9064
+ fetchResult = await documentLoader(url.href);
9065
+ }
9066
+ catch (error) {
9067
+ if (options.suppressError) {
9068
+ getLogger(["fedify", "vocab"]).error("Failed to fetch {url}: {error}", { error, url: url.href });
9069
+ return null;
9070
+ }
9071
+ throw error;
9072
+ }
9073
+ const { document } = fetchResult;
9074
+ try {
9075
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
9076
+ }
9077
+ catch (e) {
9078
+ if (!(e instanceof TypeError))
9079
+ throw e;
9080
+ }
9081
+ throw new TypeError("Expected an object of any type of: " +
9082
+ ["https://www.w3.org/ns/activitystreams#Collection"].join(", "));
9083
+ }
9084
+ /**
9085
+ * Similar to
9086
+ * {@link Application.getFeaturedTags},
9087
+ * but returns its `@id` URL instead of the object itself.
9088
+ */
9089
+ get featuredTagsId() {
9090
+ if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length < 1)
9091
+ return null;
9092
+ const v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
9093
+ if (v instanceof URL)
9094
+ return v;
9095
+ return v.id;
9096
+ }
9097
+ /** What is known in Mastodon as "featured hashtags", hashtags that are featured
9098
+ * at people's profiles, is implemented using an extra property `featuredTags`
9099
+ * on the actor object that points to a {@link Collection} of {@link Hashtag}
9100
+ * objects specifically.
9101
+ */
9102
+ async getFeaturedTags(options = {}) {
9103
+ if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length < 1)
9104
+ return null;
9105
+ const v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
9106
+ if (v instanceof URL) {
9107
+ const fetched = await this.#fetchFeaturedTags(v, options);
9108
+ if (fetched == null)
9109
+ return null;
9110
+ this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0] = fetched;
9111
+ return fetched;
9112
+ }
9113
+ return v;
9114
+ }
8762
9115
  async #fetchStream(url, options = {}) {
8763
9116
  const documentLoader = options.documentLoader ?? this._documentLoader ??
8764
9117
  fetchDocumentLoader;
@@ -8887,8 +9240,9 @@ export class Application extends Object {
8887
9240
  : await v.toJsonLd(options);
8888
9241
  array.push(element);
8889
9242
  }
8890
- if (array.length > 0)
9243
+ if (array.length > 0) {
8891
9244
  values["https://w3id.org/security#publicKey"] = array;
9245
+ }
8892
9246
  array = [];
8893
9247
  for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3) {
8894
9248
  const element = v instanceof URL
@@ -8914,8 +9268,9 @@ export class Application extends Object {
8914
9268
  : await v.toJsonLd(options);
8915
9269
  array.push(element);
8916
9270
  }
8917
- if (array.length > 0)
9271
+ if (array.length > 0) {
8918
9272
  values["http://www.w3.org/ns/ldp#inbox"] = array;
9273
+ }
8919
9274
  array = [];
8920
9275
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC) {
8921
9276
  const element = v instanceof URL
@@ -8963,8 +9318,19 @@ export class Application extends Object {
8963
9318
  : await v.toJsonLd(options);
8964
9319
  array.push(element);
8965
9320
  }
8966
- if (array.length > 0)
9321
+ if (array.length > 0) {
8967
9322
  values["http://joinmastodon.org/ns#featured"] = array;
9323
+ }
9324
+ array = [];
9325
+ for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac) {
9326
+ const element = v instanceof URL
9327
+ ? { "@id": v.href }
9328
+ : await v.toJsonLd(options);
9329
+ array.push(element);
9330
+ }
9331
+ if (array.length > 0) {
9332
+ values["http://joinmastodon.org/ns#featuredTags"] = array;
9333
+ }
8968
9334
  array = [];
8969
9335
  for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9) {
8970
9336
  const element = v instanceof URL
@@ -9004,8 +9370,9 @@ export class Application extends Object {
9004
9370
  const element = { "@value": v };
9005
9371
  array.push(element);
9006
9372
  }
9007
- if (array.length > 0)
9373
+ if (array.length > 0) {
9008
9374
  values["http://joinmastodon.org/ns#memorial"] = array;
9375
+ }
9009
9376
  array = [];
9010
9377
  for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk) {
9011
9378
  const element = { "@value": v };
@@ -9031,6 +9398,7 @@ export class Application extends Object {
9031
9398
  "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
9032
9399
  "toot": "http://joinmastodon.org/ns#",
9033
9400
  "featured": { "@id": "toot:featured", "@type": "@id" },
9401
+ "featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
9034
9402
  "discoverable": "toot:discoverable",
9035
9403
  "suspended": "toot:suspended",
9036
9404
  "memorial": "toot:memorial",
@@ -9082,8 +9450,13 @@ export class Application extends Object {
9082
9450
  throw new TypeError("Unexpected type: " + instance.constructor.name);
9083
9451
  }
9084
9452
  const _3isuDgRAKSntq9XdbjiNxjwyPZAf = [];
9085
- for (const v of values["https://www.w3.org/ns/activitystreams#preferredUsername"] ??
9086
- []) {
9453
+ const _3isuDgRAKSntq9XdbjiNxjwyPZAf__array = values["https://www.w3.org/ns/activitystreams#preferredUsername"];
9454
+ for (const v of _3isuDgRAKSntq9XdbjiNxjwyPZAf__array == null
9455
+ ? []
9456
+ : _3isuDgRAKSntq9XdbjiNxjwyPZAf__array.length === 1 &&
9457
+ "@list" in _3isuDgRAKSntq9XdbjiNxjwyPZAf__array[0]
9458
+ ? _3isuDgRAKSntq9XdbjiNxjwyPZAf__array[0]["@list"]
9459
+ : _3isuDgRAKSntq9XdbjiNxjwyPZAf__array) {
9087
9460
  if (v == null)
9088
9461
  continue;
9089
9462
  const decoded = typeof v === "object" && "@value" in v &&
@@ -9100,7 +9473,13 @@ export class Application extends Object {
9100
9473
  }
9101
9474
  instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = _3isuDgRAKSntq9XdbjiNxjwyPZAf;
9102
9475
  const _axq166E2eZADq34V4MYUc8KMZdC = [];
9103
- for (const v of values["https://w3id.org/security#publicKey"] ?? []) {
9476
+ const _axq166E2eZADq34V4MYUc8KMZdC__array = values["https://w3id.org/security#publicKey"];
9477
+ for (const v of _axq166E2eZADq34V4MYUc8KMZdC__array == null
9478
+ ? []
9479
+ : _axq166E2eZADq34V4MYUc8KMZdC__array.length === 1 &&
9480
+ "@list" in _axq166E2eZADq34V4MYUc8KMZdC__array[0]
9481
+ ? _axq166E2eZADq34V4MYUc8KMZdC__array[0]["@list"]
9482
+ : _axq166E2eZADq34V4MYUc8KMZdC__array) {
9104
9483
  if (v == null)
9105
9484
  continue;
9106
9485
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -9112,7 +9491,13 @@ export class Application extends Object {
9112
9491
  }
9113
9492
  instance.#_axq166E2eZADq34V4MYUc8KMZdC = _axq166E2eZADq34V4MYUc8KMZdC;
9114
9493
  const _4EHQFWZSz1k1d4LmPrQiMba2GbP3 = [];
9115
- for (const v of values["https://w3id.org/security#assertionMethod"] ?? []) {
9494
+ const _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array = values["https://w3id.org/security#assertionMethod"];
9495
+ for (const v of _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array == null
9496
+ ? []
9497
+ : _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array.length === 1 &&
9498
+ "@list" in _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array[0]
9499
+ ? _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array[0]["@list"]
9500
+ : _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array) {
9116
9501
  if (v == null)
9117
9502
  continue;
9118
9503
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -9124,14 +9509,26 @@ export class Application extends Object {
9124
9509
  }
9125
9510
  instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3 = _4EHQFWZSz1k1d4LmPrQiMba2GbP3;
9126
9511
  const _36QNc9MxfkKf6h8sEUQSHnV9NZA = [];
9127
- for (const v of values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"] ?? []) {
9512
+ const _36QNc9MxfkKf6h8sEUQSHnV9NZA__array = values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"];
9513
+ for (const v of _36QNc9MxfkKf6h8sEUQSHnV9NZA__array == null
9514
+ ? []
9515
+ : _36QNc9MxfkKf6h8sEUQSHnV9NZA__array.length === 1 &&
9516
+ "@list" in _36QNc9MxfkKf6h8sEUQSHnV9NZA__array[0]
9517
+ ? _36QNc9MxfkKf6h8sEUQSHnV9NZA__array[0]["@list"]
9518
+ : _36QNc9MxfkKf6h8sEUQSHnV9NZA__array) {
9128
9519
  if (v == null)
9129
9520
  continue;
9130
9521
  _36QNc9MxfkKf6h8sEUQSHnV9NZA.push(v["@value"]);
9131
9522
  }
9132
9523
  instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA = _36QNc9MxfkKf6h8sEUQSHnV9NZA;
9133
9524
  const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB = [];
9134
- for (const v of values["http://www.w3.org/ns/ldp#inbox"] ?? []) {
9525
+ const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array = values["http://www.w3.org/ns/ldp#inbox"];
9526
+ for (const v of _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array == null
9527
+ ? []
9528
+ : _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array.length === 1 &&
9529
+ "@list" in _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array[0]
9530
+ ? _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array[0]["@list"]
9531
+ : _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array) {
9135
9532
  if (v == null)
9136
9533
  continue;
9137
9534
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -9143,7 +9540,13 @@ export class Application extends Object {
9143
9540
  }
9144
9541
  instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB;
9145
9542
  const _41QwhqJouoLg3h8dRPKat21brynC = [];
9146
- for (const v of values["https://www.w3.org/ns/activitystreams#outbox"] ?? []) {
9543
+ const _41QwhqJouoLg3h8dRPKat21brynC__array = values["https://www.w3.org/ns/activitystreams#outbox"];
9544
+ for (const v of _41QwhqJouoLg3h8dRPKat21brynC__array == null
9545
+ ? []
9546
+ : _41QwhqJouoLg3h8dRPKat21brynC__array.length === 1 &&
9547
+ "@list" in _41QwhqJouoLg3h8dRPKat21brynC__array[0]
9548
+ ? _41QwhqJouoLg3h8dRPKat21brynC__array[0]["@list"]
9549
+ : _41QwhqJouoLg3h8dRPKat21brynC__array) {
9147
9550
  if (v == null)
9148
9551
  continue;
9149
9552
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -9155,7 +9558,13 @@ export class Application extends Object {
9155
9558
  }
9156
9559
  instance.#_41QwhqJouoLg3h8dRPKat21brynC = _41QwhqJouoLg3h8dRPKat21brynC;
9157
9560
  const _3yAv8jymNfNuJUDuBzJ1NQhdbAee = [];
9158
- for (const v of values["https://www.w3.org/ns/activitystreams#following"] ?? []) {
9561
+ const _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array = values["https://www.w3.org/ns/activitystreams#following"];
9562
+ for (const v of _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array == null
9563
+ ? []
9564
+ : _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array.length === 1 &&
9565
+ "@list" in _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array[0]
9566
+ ? _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array[0]["@list"]
9567
+ : _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array) {
9159
9568
  if (v == null)
9160
9569
  continue;
9161
9570
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -9167,7 +9576,13 @@ export class Application extends Object {
9167
9576
  }
9168
9577
  instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee = _3yAv8jymNfNuJUDuBzJ1NQhdbAee;
9169
9578
  const _BBCTgfphhsFzpVfKTykGSpBNwoA = [];
9170
- for (const v of values["https://www.w3.org/ns/activitystreams#followers"] ?? []) {
9579
+ const _BBCTgfphhsFzpVfKTykGSpBNwoA__array = values["https://www.w3.org/ns/activitystreams#followers"];
9580
+ for (const v of _BBCTgfphhsFzpVfKTykGSpBNwoA__array == null
9581
+ ? []
9582
+ : _BBCTgfphhsFzpVfKTykGSpBNwoA__array.length === 1 &&
9583
+ "@list" in _BBCTgfphhsFzpVfKTykGSpBNwoA__array[0]
9584
+ ? _BBCTgfphhsFzpVfKTykGSpBNwoA__array[0]["@list"]
9585
+ : _BBCTgfphhsFzpVfKTykGSpBNwoA__array) {
9171
9586
  if (v == null)
9172
9587
  continue;
9173
9588
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -9179,7 +9594,13 @@ export class Application extends Object {
9179
9594
  }
9180
9595
  instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA = _BBCTgfphhsFzpVfKTykGSpBNwoA;
9181
9596
  const _3bgkPwJanyTCoVFM9ovRcus8tKkU = [];
9182
- for (const v of values["https://www.w3.org/ns/activitystreams#liked"] ?? []) {
9597
+ const _3bgkPwJanyTCoVFM9ovRcus8tKkU__array = values["https://www.w3.org/ns/activitystreams#liked"];
9598
+ for (const v of _3bgkPwJanyTCoVFM9ovRcus8tKkU__array == null
9599
+ ? []
9600
+ : _3bgkPwJanyTCoVFM9ovRcus8tKkU__array.length === 1 &&
9601
+ "@list" in _3bgkPwJanyTCoVFM9ovRcus8tKkU__array[0]
9602
+ ? _3bgkPwJanyTCoVFM9ovRcus8tKkU__array[0]["@list"]
9603
+ : _3bgkPwJanyTCoVFM9ovRcus8tKkU__array) {
9183
9604
  if (v == null)
9184
9605
  continue;
9185
9606
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -9191,7 +9612,13 @@ export class Application extends Object {
9191
9612
  }
9192
9613
  instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU = _3bgkPwJanyTCoVFM9ovRcus8tKkU;
9193
9614
  const _4N1vBJzXDf8NbBumeECQMFvKetja = [];
9194
- for (const v of values["http://joinmastodon.org/ns#featured"] ?? []) {
9615
+ const _4N1vBJzXDf8NbBumeECQMFvKetja__array = values["http://joinmastodon.org/ns#featured"];
9616
+ for (const v of _4N1vBJzXDf8NbBumeECQMFvKetja__array == null
9617
+ ? []
9618
+ : _4N1vBJzXDf8NbBumeECQMFvKetja__array.length === 1 &&
9619
+ "@list" in _4N1vBJzXDf8NbBumeECQMFvKetja__array[0]
9620
+ ? _4N1vBJzXDf8NbBumeECQMFvKetja__array[0]["@list"]
9621
+ : _4N1vBJzXDf8NbBumeECQMFvKetja__array) {
9195
9622
  if (v == null)
9196
9623
  continue;
9197
9624
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -9202,8 +9629,32 @@ export class Application extends Object {
9202
9629
  _4N1vBJzXDf8NbBumeECQMFvKetja.push(await Collection.fromJsonLd(v, options));
9203
9630
  }
9204
9631
  instance.#_4N1vBJzXDf8NbBumeECQMFvKetja = _4N1vBJzXDf8NbBumeECQMFvKetja;
9632
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac = [];
9633
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array = values["http://joinmastodon.org/ns#featuredTags"];
9634
+ for (const v of _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array == null
9635
+ ? []
9636
+ : _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array.length === 1 &&
9637
+ "@list" in _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array[0]
9638
+ ? _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array[0]["@list"]
9639
+ : _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array) {
9640
+ if (v == null)
9641
+ continue;
9642
+ if (typeof v === "object" && "@id" in v && !("@type" in v) &&
9643
+ globalThis.Object.keys(v).length === 1) {
9644
+ _2MxnRRLq9iPzx5CFq2NPrXdUDCac.push(new URL(v["@id"]));
9645
+ continue;
9646
+ }
9647
+ _2MxnRRLq9iPzx5CFq2NPrXdUDCac.push(await Collection.fromJsonLd(v, options));
9648
+ }
9649
+ instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = _2MxnRRLq9iPzx5CFq2NPrXdUDCac;
9205
9650
  const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = [];
9206
- for (const v of values["https://www.w3.org/ns/activitystreams#streams"] ?? []) {
9651
+ const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array = values["https://www.w3.org/ns/activitystreams#streams"];
9652
+ for (const v of _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array == null
9653
+ ? []
9654
+ : _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array.length === 1 &&
9655
+ "@list" in _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array[0]
9656
+ ? _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array[0]["@list"]
9657
+ : _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array) {
9207
9658
  if (v == null)
9208
9659
  continue;
9209
9660
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -9215,35 +9666,65 @@ export class Application extends Object {
9215
9666
  }
9216
9667
  instance.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = _3sG2Hdwn9qzKGu9mpYkqakAMUkH9;
9217
9668
  const _sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [];
9218
- for (const v of values["https://www.w3.org/ns/activitystreams#endpoints"] ?? []) {
9669
+ const _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array = values["https://www.w3.org/ns/activitystreams#endpoints"];
9670
+ for (const v of _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array == null
9671
+ ? []
9672
+ : _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array.length === 1 &&
9673
+ "@list" in _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array[0]
9674
+ ? _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array[0]["@list"]
9675
+ : _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array) {
9219
9676
  if (v == null)
9220
9677
  continue;
9221
9678
  _sEoQwUbfk4hEfugzNQ2ZiDcLMkG.push(await Endpoints.fromJsonLd(v, options));
9222
9679
  }
9223
9680
  instance.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG;
9224
9681
  const _gAJzg1QDc4rcefFsUzGSYmyXvNH = [];
9225
- for (const v of values["http://joinmastodon.org/ns#discoverable"] ?? []) {
9682
+ const _gAJzg1QDc4rcefFsUzGSYmyXvNH__array = values["http://joinmastodon.org/ns#discoverable"];
9683
+ for (const v of _gAJzg1QDc4rcefFsUzGSYmyXvNH__array == null
9684
+ ? []
9685
+ : _gAJzg1QDc4rcefFsUzGSYmyXvNH__array.length === 1 &&
9686
+ "@list" in _gAJzg1QDc4rcefFsUzGSYmyXvNH__array[0]
9687
+ ? _gAJzg1QDc4rcefFsUzGSYmyXvNH__array[0]["@list"]
9688
+ : _gAJzg1QDc4rcefFsUzGSYmyXvNH__array) {
9226
9689
  if (v == null)
9227
9690
  continue;
9228
9691
  _gAJzg1QDc4rcefFsUzGSYmyXvNH.push(v["@value"]);
9229
9692
  }
9230
9693
  instance.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = _gAJzg1QDc4rcefFsUzGSYmyXvNH;
9231
9694
  const _2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [];
9232
- for (const v of values["http://joinmastodon.org/ns#suspended"] ?? []) {
9695
+ const _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array = values["http://joinmastodon.org/ns#suspended"];
9696
+ for (const v of _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array == null
9697
+ ? []
9698
+ : _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array.length === 1 &&
9699
+ "@list" in _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array[0]
9700
+ ? _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array[0]["@list"]
9701
+ : _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array) {
9233
9702
  if (v == null)
9234
9703
  continue;
9235
9704
  _2kGKkJtoFWg8c18PaVSqj9NKP4t7.push(v["@value"]);
9236
9705
  }
9237
9706
  instance.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = _2kGKkJtoFWg8c18PaVSqj9NKP4t7;
9238
9707
  const _79S8K4f5J9MWUgCxziRyUe6PTHZ = [];
9239
- for (const v of values["http://joinmastodon.org/ns#memorial"] ?? []) {
9708
+ const _79S8K4f5J9MWUgCxziRyUe6PTHZ__array = values["http://joinmastodon.org/ns#memorial"];
9709
+ for (const v of _79S8K4f5J9MWUgCxziRyUe6PTHZ__array == null
9710
+ ? []
9711
+ : _79S8K4f5J9MWUgCxziRyUe6PTHZ__array.length === 1 &&
9712
+ "@list" in _79S8K4f5J9MWUgCxziRyUe6PTHZ__array[0]
9713
+ ? _79S8K4f5J9MWUgCxziRyUe6PTHZ__array[0]["@list"]
9714
+ : _79S8K4f5J9MWUgCxziRyUe6PTHZ__array) {
9240
9715
  if (v == null)
9241
9716
  continue;
9242
9717
  _79S8K4f5J9MWUgCxziRyUe6PTHZ.push(v["@value"]);
9243
9718
  }
9244
9719
  instance.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = _79S8K4f5J9MWUgCxziRyUe6PTHZ;
9245
9720
  const _2diCorzqPGQQqftp6e4SrCEwEnyk = [];
9246
- for (const v of values["http://joinmastodon.org/ns#indexable"] ?? []) {
9721
+ const _2diCorzqPGQQqftp6e4SrCEwEnyk__array = values["http://joinmastodon.org/ns#indexable"];
9722
+ for (const v of _2diCorzqPGQQqftp6e4SrCEwEnyk__array == null
9723
+ ? []
9724
+ : _2diCorzqPGQQqftp6e4SrCEwEnyk__array.length === 1 &&
9725
+ "@list" in _2diCorzqPGQQqftp6e4SrCEwEnyk__array[0]
9726
+ ? _2diCorzqPGQQqftp6e4SrCEwEnyk__array[0]["@list"]
9727
+ : _2diCorzqPGQQqftp6e4SrCEwEnyk__array) {
9247
9728
  if (v == null)
9248
9729
  continue;
9249
9730
  _2diCorzqPGQQqftp6e4SrCEwEnyk.push(v["@value"]);
@@ -9378,6 +9859,17 @@ export class Application extends Object {
9378
9859
  if (_4N1vBJzXDf8NbBumeECQMFvKetja.length == 1) {
9379
9860
  proxy.featured = _4N1vBJzXDf8NbBumeECQMFvKetja[0];
9380
9861
  }
9862
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac
9863
+ // deno-lint-ignore no-explicit-any
9864
+ .map((v) => v instanceof URL
9865
+ ? {
9866
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
9867
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
9868
+ }
9869
+ : v);
9870
+ if (_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length == 1) {
9871
+ proxy.featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
9872
+ }
9381
9873
  const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9
9382
9874
  // deno-lint-ignore no-explicit-any
9383
9875
  .map((v) => v instanceof URL
@@ -10005,14 +10497,26 @@ export class Document extends Object {
10005
10497
  throw new TypeError("Unexpected type: " + instance.constructor.name);
10006
10498
  }
10007
10499
  const _2e9AP7WdHBJYAgXG6GEyq7nSkNMe = [];
10008
- for (const v of values["https://www.w3.org/ns/activitystreams#width"] ?? []) {
10500
+ const _2e9AP7WdHBJYAgXG6GEyq7nSkNMe__array = values["https://www.w3.org/ns/activitystreams#width"];
10501
+ for (const v of _2e9AP7WdHBJYAgXG6GEyq7nSkNMe__array == null
10502
+ ? []
10503
+ : _2e9AP7WdHBJYAgXG6GEyq7nSkNMe__array.length === 1 &&
10504
+ "@list" in _2e9AP7WdHBJYAgXG6GEyq7nSkNMe__array[0]
10505
+ ? _2e9AP7WdHBJYAgXG6GEyq7nSkNMe__array[0]["@list"]
10506
+ : _2e9AP7WdHBJYAgXG6GEyq7nSkNMe__array) {
10009
10507
  if (v == null)
10010
10508
  continue;
10011
10509
  _2e9AP7WdHBJYAgXG6GEyq7nSkNMe.push(v["@value"]);
10012
10510
  }
10013
10511
  instance.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe = _2e9AP7WdHBJYAgXG6GEyq7nSkNMe;
10014
10512
  const _2cGKFeFJMmiNpGZFEF75mCwFQsKb = [];
10015
- for (const v of values["https://www.w3.org/ns/activitystreams#height"] ?? []) {
10513
+ const _2cGKFeFJMmiNpGZFEF75mCwFQsKb__array = values["https://www.w3.org/ns/activitystreams#height"];
10514
+ for (const v of _2cGKFeFJMmiNpGZFEF75mCwFQsKb__array == null
10515
+ ? []
10516
+ : _2cGKFeFJMmiNpGZFEF75mCwFQsKb__array.length === 1 &&
10517
+ "@list" in _2cGKFeFJMmiNpGZFEF75mCwFQsKb__array[0]
10518
+ ? _2cGKFeFJMmiNpGZFEF75mCwFQsKb__array[0]["@list"]
10519
+ : _2cGKFeFJMmiNpGZFEF75mCwFQsKb__array) {
10016
10520
  if (v == null)
10017
10521
  continue;
10018
10522
  _2cGKFeFJMmiNpGZFEF75mCwFQsKb.push(v["@value"]);
@@ -10462,13 +10966,13 @@ export class Collection extends Object {
10462
10966
  }
10463
10967
  if ("items" in values && values.items != null) {
10464
10968
  if (Array.isArray(values.items) &&
10465
- values.items.every((v) => v instanceof Object || v instanceof URL)) {
10969
+ values.items.every((v) => v instanceof Object || v instanceof Link || v instanceof URL)) {
10466
10970
  // @ts-ignore: type is checked above.
10467
10971
  this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg = values.items;
10468
10972
  }
10469
10973
  else {
10470
10974
  throw new TypeError("The items must be an array of type " +
10471
- "Object | URL" + ".");
10975
+ "Object | Link | URL" + ".");
10472
10976
  }
10473
10977
  }
10474
10978
  }
@@ -10529,13 +11033,13 @@ export class Collection extends Object {
10529
11033
  clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg;
10530
11034
  if ("items" in values && values.items != null) {
10531
11035
  if (Array.isArray(values.items) &&
10532
- values.items.every((v) => v instanceof Object || v instanceof URL)) {
11036
+ values.items.every((v) => v instanceof Object || v instanceof Link || v instanceof URL)) {
10533
11037
  // @ts-ignore: type is checked above.
10534
11038
  clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg = values.items;
10535
11039
  }
10536
11040
  else {
10537
11041
  throw new TypeError("The items must be an array of type " +
10538
- "Object | URL" + ".");
11042
+ "Object | Link | URL" + ".");
10539
11043
  }
10540
11044
  }
10541
11045
  return clone;
@@ -10741,8 +11245,18 @@ export class Collection extends Object {
10741
11245
  if (!(e instanceof TypeError))
10742
11246
  throw e;
10743
11247
  }
11248
+ try {
11249
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
11250
+ }
11251
+ catch (e) {
11252
+ if (!(e instanceof TypeError))
11253
+ throw e;
11254
+ }
10744
11255
  throw new TypeError("Expected an object of any type of: " +
10745
- ["https://www.w3.org/ns/activitystreams#Object"].join(", "));
11256
+ [
11257
+ "https://www.w3.org/ns/activitystreams#Object",
11258
+ "https://www.w3.org/ns/activitystreams#Link",
11259
+ ].join(", "));
10746
11260
  }
10747
11261
  /**
10748
11262
  * Similar to
@@ -10831,7 +11345,9 @@ export class Collection extends Object {
10831
11345
  for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg) {
10832
11346
  const element = v instanceof URL
10833
11347
  ? { "@id": v.href }
10834
- : await v.toJsonLd(options);
11348
+ : v instanceof Object
11349
+ ? await v.toJsonLd(options)
11350
+ : await v.toJsonLd(options);
10835
11351
  array.push(element);
10836
11352
  }
10837
11353
  if (array.length > 0) {
@@ -10843,7 +11359,17 @@ export class Collection extends Object {
10843
11359
  if (options.expand) {
10844
11360
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
10845
11361
  }
10846
- return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
11362
+ return await jsonld.compact(values, options.context ??
11363
+ [
11364
+ "https://www.w3.org/ns/activitystreams",
11365
+ "https://w3id.org/security/data-integrity/v1",
11366
+ {
11367
+ "toot": "http://joinmastodon.org/ns#",
11368
+ "sensitive": "as:sensitive",
11369
+ "Emoji": "toot:Emoji",
11370
+ "Hashtag": "as:Hashtag",
11371
+ },
11372
+ ], { documentLoader: options.contextLoader });
10847
11373
  }
10848
11374
  /**
10849
11375
  * Converts a JSON-LD structure to an object of this type.
@@ -10898,15 +11424,26 @@ export class Collection extends Object {
10898
11424
  throw new TypeError("Unexpected type: " + instance.constructor.name);
10899
11425
  }
10900
11426
  const _XDbmNDuWHmrhqH712zqtecdbv1V = [];
10901
- for (const v of values["https://www.w3.org/ns/activitystreams#totalItems"] ??
10902
- []) {
11427
+ const _XDbmNDuWHmrhqH712zqtecdbv1V__array = values["https://www.w3.org/ns/activitystreams#totalItems"];
11428
+ for (const v of _XDbmNDuWHmrhqH712zqtecdbv1V__array == null
11429
+ ? []
11430
+ : _XDbmNDuWHmrhqH712zqtecdbv1V__array.length === 1 &&
11431
+ "@list" in _XDbmNDuWHmrhqH712zqtecdbv1V__array[0]
11432
+ ? _XDbmNDuWHmrhqH712zqtecdbv1V__array[0]["@list"]
11433
+ : _XDbmNDuWHmrhqH712zqtecdbv1V__array) {
10903
11434
  if (v == null)
10904
11435
  continue;
10905
11436
  _XDbmNDuWHmrhqH712zqtecdbv1V.push(v["@value"]);
10906
11437
  }
10907
11438
  instance.#_XDbmNDuWHmrhqH712zqtecdbv1V = _XDbmNDuWHmrhqH712zqtecdbv1V;
10908
11439
  const _3UyUdxnyn6cDn53QKrh4MBiearma = [];
10909
- for (const v of values["https://www.w3.org/ns/activitystreams#current"] ?? []) {
11440
+ const _3UyUdxnyn6cDn53QKrh4MBiearma__array = values["https://www.w3.org/ns/activitystreams#current"];
11441
+ for (const v of _3UyUdxnyn6cDn53QKrh4MBiearma__array == null
11442
+ ? []
11443
+ : _3UyUdxnyn6cDn53QKrh4MBiearma__array.length === 1 &&
11444
+ "@list" in _3UyUdxnyn6cDn53QKrh4MBiearma__array[0]
11445
+ ? _3UyUdxnyn6cDn53QKrh4MBiearma__array[0]["@list"]
11446
+ : _3UyUdxnyn6cDn53QKrh4MBiearma__array) {
10910
11447
  if (v == null)
10911
11448
  continue;
10912
11449
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -10918,7 +11455,13 @@ export class Collection extends Object {
10918
11455
  }
10919
11456
  instance.#_3UyUdxnyn6cDn53QKrh4MBiearma = _3UyUdxnyn6cDn53QKrh4MBiearma;
10920
11457
  const _J52RqweMe6hhv7RnLJMC8BExTE5 = [];
10921
- for (const v of values["https://www.w3.org/ns/activitystreams#first"] ?? []) {
11458
+ const _J52RqweMe6hhv7RnLJMC8BExTE5__array = values["https://www.w3.org/ns/activitystreams#first"];
11459
+ for (const v of _J52RqweMe6hhv7RnLJMC8BExTE5__array == null
11460
+ ? []
11461
+ : _J52RqweMe6hhv7RnLJMC8BExTE5__array.length === 1 &&
11462
+ "@list" in _J52RqweMe6hhv7RnLJMC8BExTE5__array[0]
11463
+ ? _J52RqweMe6hhv7RnLJMC8BExTE5__array[0]["@list"]
11464
+ : _J52RqweMe6hhv7RnLJMC8BExTE5__array) {
10922
11465
  if (v == null)
10923
11466
  continue;
10924
11467
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -10930,7 +11473,13 @@ export class Collection extends Object {
10930
11473
  }
10931
11474
  instance.#_J52RqweMe6hhv7RnLJMC8BExTE5 = _J52RqweMe6hhv7RnLJMC8BExTE5;
10932
11475
  const _gyJJnyEFnuNVi1HFZKfAn3Hfn26 = [];
10933
- for (const v of values["https://www.w3.org/ns/activitystreams#last"] ?? []) {
11476
+ const _gyJJnyEFnuNVi1HFZKfAn3Hfn26__array = values["https://www.w3.org/ns/activitystreams#last"];
11477
+ for (const v of _gyJJnyEFnuNVi1HFZKfAn3Hfn26__array == null
11478
+ ? []
11479
+ : _gyJJnyEFnuNVi1HFZKfAn3Hfn26__array.length === 1 &&
11480
+ "@list" in _gyJJnyEFnuNVi1HFZKfAn3Hfn26__array[0]
11481
+ ? _gyJJnyEFnuNVi1HFZKfAn3Hfn26__array[0]["@list"]
11482
+ : _gyJJnyEFnuNVi1HFZKfAn3Hfn26__array) {
10934
11483
  if (v == null)
10935
11484
  continue;
10936
11485
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -10942,7 +11491,13 @@ export class Collection extends Object {
10942
11491
  }
10943
11492
  instance.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26 = _gyJJnyEFnuNVi1HFZKfAn3Hfn26;
10944
11493
  const _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg = [];
10945
- for (const v of values["https://www.w3.org/ns/activitystreams#items"] ?? []) {
11494
+ const _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg__array = values["https://www.w3.org/ns/activitystreams#items"];
11495
+ for (const v of _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg__array == null
11496
+ ? []
11497
+ : _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg__array.length === 1 &&
11498
+ "@list" in _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg__array[0]
11499
+ ? _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg__array[0]["@list"]
11500
+ : _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg__array) {
10946
11501
  if (v == null)
10947
11502
  continue;
10948
11503
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -10950,7 +11505,66 @@ export class Collection extends Object {
10950
11505
  _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg.push(new URL(v["@id"]));
10951
11506
  continue;
10952
11507
  }
10953
- _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg.push(await Object.fromJsonLd(v, options));
11508
+ const decoded = typeof v === "object" && "@type" in v &&
11509
+ Array.isArray(v["@type"]) &&
11510
+ [
11511
+ "https://www.w3.org/ns/activitystreams#Object",
11512
+ "http://joinmastodon.org/ns#Emoji",
11513
+ "https://www.w3.org/ns/activitystreams#Activity",
11514
+ "https://www.w3.org/ns/activitystreams#Accept",
11515
+ "https://www.w3.org/ns/activitystreams#Add",
11516
+ "https://www.w3.org/ns/activitystreams#Announce",
11517
+ "https://www.w3.org/ns/activitystreams#Create",
11518
+ "https://www.w3.org/ns/activitystreams#Delete",
11519
+ "https://www.w3.org/ns/activitystreams#Dislike",
11520
+ "https://www.w3.org/ns/activitystreams#Flag",
11521
+ "https://www.w3.org/ns/activitystreams#Follow",
11522
+ "https://www.w3.org/ns/activitystreams#Ignore",
11523
+ "https://www.w3.org/ns/activitystreams#Block",
11524
+ "https://www.w3.org/ns/activitystreams#IntransitiveActivity",
11525
+ "https://www.w3.org/ns/activitystreams#Arrive",
11526
+ "https://www.w3.org/ns/activitystreams#Question",
11527
+ "https://www.w3.org/ns/activitystreams#Like",
11528
+ "https://www.w3.org/ns/activitystreams#Offer",
11529
+ "https://www.w3.org/ns/activitystreams#Reject",
11530
+ "https://www.w3.org/ns/activitystreams#Remove",
11531
+ "https://www.w3.org/ns/activitystreams#Undo",
11532
+ "https://www.w3.org/ns/activitystreams#Update",
11533
+ "https://www.w3.org/ns/activitystreams#Application",
11534
+ "https://www.w3.org/ns/activitystreams#Article",
11535
+ "https://www.w3.org/ns/activitystreams#Collection",
11536
+ "https://www.w3.org/ns/activitystreams#CollectionPage",
11537
+ "https://www.w3.org/ns/activitystreams#OrderedCollectionPage",
11538
+ "https://www.w3.org/ns/activitystreams#OrderedCollection",
11539
+ "https://www.w3.org/ns/activitystreams#Document",
11540
+ "https://www.w3.org/ns/activitystreams#Audio",
11541
+ "https://www.w3.org/ns/activitystreams#Image",
11542
+ "https://www.w3.org/ns/activitystreams#Page",
11543
+ "https://www.w3.org/ns/activitystreams#Video",
11544
+ "https://www.w3.org/ns/activitystreams#Event",
11545
+ "https://www.w3.org/ns/activitystreams#Group",
11546
+ "https://www.w3.org/ns/activitystreams#Note",
11547
+ "https://www.w3.org/ns/activitystreams#Organization",
11548
+ "https://www.w3.org/ns/activitystreams#Person",
11549
+ "https://www.w3.org/ns/activitystreams#Place",
11550
+ "https://www.w3.org/ns/activitystreams#Profile",
11551
+ "https://www.w3.org/ns/activitystreams#Relationship",
11552
+ "https://www.w3.org/ns/activitystreams#Service",
11553
+ "https://www.w3.org/ns/activitystreams#Tombstone",
11554
+ ].some((t) => v["@type"].includes(t))
11555
+ ? await Object.fromJsonLd(v, options)
11556
+ : typeof v === "object" && "@type" in v &&
11557
+ Array.isArray(v["@type"]) &&
11558
+ [
11559
+ "https://www.w3.org/ns/activitystreams#Link",
11560
+ "https://www.w3.org/ns/activitystreams#Hashtag",
11561
+ "https://www.w3.org/ns/activitystreams#Mention",
11562
+ ].some((t) => v["@type"].includes(t))
11563
+ ? await Link.fromJsonLd(v, options)
11564
+ : undefined;
11565
+ if (typeof decoded === "undefined")
11566
+ continue;
11567
+ _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg.push(decoded);
10954
11568
  }
10955
11569
  instance.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg = _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg;
10956
11570
  return instance;
@@ -11338,7 +11952,17 @@ export class CollectionPage extends Collection {
11338
11952
  if (options.expand) {
11339
11953
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
11340
11954
  }
11341
- return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
11955
+ return await jsonld.compact(values, options.context ??
11956
+ [
11957
+ "https://www.w3.org/ns/activitystreams",
11958
+ "https://w3id.org/security/data-integrity/v1",
11959
+ {
11960
+ "toot": "http://joinmastodon.org/ns#",
11961
+ "sensitive": "as:sensitive",
11962
+ "Emoji": "toot:Emoji",
11963
+ "Hashtag": "as:Hashtag",
11964
+ },
11965
+ ], { documentLoader: options.contextLoader });
11342
11966
  }
11343
11967
  /**
11344
11968
  * Converts a JSON-LD structure to an object of this type.
@@ -11385,7 +12009,13 @@ export class CollectionPage extends Collection {
11385
12009
  throw new TypeError("Unexpected type: " + instance.constructor.name);
11386
12010
  }
11387
12011
  const _2kWgBhQKjEauxx8C6qF3ZQamK4Le = [];
11388
- for (const v of values["https://www.w3.org/ns/activitystreams#partOf"] ?? []) {
12012
+ const _2kWgBhQKjEauxx8C6qF3ZQamK4Le__array = values["https://www.w3.org/ns/activitystreams#partOf"];
12013
+ for (const v of _2kWgBhQKjEauxx8C6qF3ZQamK4Le__array == null
12014
+ ? []
12015
+ : _2kWgBhQKjEauxx8C6qF3ZQamK4Le__array.length === 1 &&
12016
+ "@list" in _2kWgBhQKjEauxx8C6qF3ZQamK4Le__array[0]
12017
+ ? _2kWgBhQKjEauxx8C6qF3ZQamK4Le__array[0]["@list"]
12018
+ : _2kWgBhQKjEauxx8C6qF3ZQamK4Le__array) {
11389
12019
  if (v == null)
11390
12020
  continue;
11391
12021
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -11397,7 +12027,13 @@ export class CollectionPage extends Collection {
11397
12027
  }
11398
12028
  instance.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le = _2kWgBhQKjEauxx8C6qF3ZQamK4Le;
11399
12029
  const _3BT4kQLcXhHx7TAWaNDKh8nFn9eY = [];
11400
- for (const v of values["https://www.w3.org/ns/activitystreams#next"] ?? []) {
12030
+ const _3BT4kQLcXhHx7TAWaNDKh8nFn9eY__array = values["https://www.w3.org/ns/activitystreams#next"];
12031
+ for (const v of _3BT4kQLcXhHx7TAWaNDKh8nFn9eY__array == null
12032
+ ? []
12033
+ : _3BT4kQLcXhHx7TAWaNDKh8nFn9eY__array.length === 1 &&
12034
+ "@list" in _3BT4kQLcXhHx7TAWaNDKh8nFn9eY__array[0]
12035
+ ? _3BT4kQLcXhHx7TAWaNDKh8nFn9eY__array[0]["@list"]
12036
+ : _3BT4kQLcXhHx7TAWaNDKh8nFn9eY__array) {
11401
12037
  if (v == null)
11402
12038
  continue;
11403
12039
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -11409,7 +12045,13 @@ export class CollectionPage extends Collection {
11409
12045
  }
11410
12046
  instance.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY = _3BT4kQLcXhHx7TAWaNDKh8nFn9eY;
11411
12047
  const _3b8yG8tDNzQFFEnWhCc13G8eHooA = [];
11412
- for (const v of values["https://www.w3.org/ns/activitystreams#prev"] ?? []) {
12048
+ const _3b8yG8tDNzQFFEnWhCc13G8eHooA__array = values["https://www.w3.org/ns/activitystreams#prev"];
12049
+ for (const v of _3b8yG8tDNzQFFEnWhCc13G8eHooA__array == null
12050
+ ? []
12051
+ : _3b8yG8tDNzQFFEnWhCc13G8eHooA__array.length === 1 &&
12052
+ "@list" in _3b8yG8tDNzQFFEnWhCc13G8eHooA__array[0]
12053
+ ? _3b8yG8tDNzQFFEnWhCc13G8eHooA__array[0]["@list"]
12054
+ : _3b8yG8tDNzQFFEnWhCc13G8eHooA__array) {
11413
12055
  if (v == null)
11414
12056
  continue;
11415
12057
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -12160,45 +12802,78 @@ export class Endpoints {
12160
12802
  }
12161
12803
  const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, options);
12162
12804
  const _2JCYDbSxEHCCLdBYed33cCETfGyR = [];
12163
- for (const v of values["https://www.w3.org/ns/activitystreams#proxyUrl"] ?? []) {
12805
+ const _2JCYDbSxEHCCLdBYed33cCETfGyR__array = values["https://www.w3.org/ns/activitystreams#proxyUrl"];
12806
+ for (const v of _2JCYDbSxEHCCLdBYed33cCETfGyR__array == null
12807
+ ? []
12808
+ : _2JCYDbSxEHCCLdBYed33cCETfGyR__array.length === 1 &&
12809
+ "@list" in _2JCYDbSxEHCCLdBYed33cCETfGyR__array[0]
12810
+ ? _2JCYDbSxEHCCLdBYed33cCETfGyR__array[0]["@list"]
12811
+ : _2JCYDbSxEHCCLdBYed33cCETfGyR__array) {
12164
12812
  if (v == null)
12165
12813
  continue;
12166
12814
  _2JCYDbSxEHCCLdBYed33cCETfGyR.push(new URL(v["@id"]));
12167
12815
  }
12168
12816
  instance.#_2JCYDbSxEHCCLdBYed33cCETfGyR = _2JCYDbSxEHCCLdBYed33cCETfGyR;
12169
12817
  const _25S6UmgzDead8hxL5sQFezZTAusd = [];
12170
- for (const v of values["https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint"] ?? []) {
12818
+ const _25S6UmgzDead8hxL5sQFezZTAusd__array = values["https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint"];
12819
+ for (const v of _25S6UmgzDead8hxL5sQFezZTAusd__array == null
12820
+ ? []
12821
+ : _25S6UmgzDead8hxL5sQFezZTAusd__array.length === 1 &&
12822
+ "@list" in _25S6UmgzDead8hxL5sQFezZTAusd__array[0]
12823
+ ? _25S6UmgzDead8hxL5sQFezZTAusd__array[0]["@list"]
12824
+ : _25S6UmgzDead8hxL5sQFezZTAusd__array) {
12171
12825
  if (v == null)
12172
12826
  continue;
12173
12827
  _25S6UmgzDead8hxL5sQFezZTAusd.push(new URL(v["@id"]));
12174
12828
  }
12175
12829
  instance.#_25S6UmgzDead8hxL5sQFezZTAusd = _25S6UmgzDead8hxL5sQFezZTAusd;
12176
12830
  const _iAMxqrSba7yBCRB1FZ5kEVdKEZ3 = [];
12177
- for (const v of values["https://www.w3.org/ns/activitystreams#oauthTokenEndpoint"] ??
12178
- []) {
12831
+ const _iAMxqrSba7yBCRB1FZ5kEVdKEZ3__array = values["https://www.w3.org/ns/activitystreams#oauthTokenEndpoint"];
12832
+ for (const v of _iAMxqrSba7yBCRB1FZ5kEVdKEZ3__array == null
12833
+ ? []
12834
+ : _iAMxqrSba7yBCRB1FZ5kEVdKEZ3__array.length === 1 &&
12835
+ "@list" in _iAMxqrSba7yBCRB1FZ5kEVdKEZ3__array[0]
12836
+ ? _iAMxqrSba7yBCRB1FZ5kEVdKEZ3__array[0]["@list"]
12837
+ : _iAMxqrSba7yBCRB1FZ5kEVdKEZ3__array) {
12179
12838
  if (v == null)
12180
12839
  continue;
12181
12840
  _iAMxqrSba7yBCRB1FZ5kEVdKEZ3.push(new URL(v["@id"]));
12182
12841
  }
12183
12842
  instance.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3 = _iAMxqrSba7yBCRB1FZ5kEVdKEZ3;
12184
12843
  const _8Bx9qN8oU7Bpt2xi6khaxWp1gMr = [];
12185
- for (const v of values["https://www.w3.org/ns/activitystreams#provideClientKey"] ??
12186
- []) {
12844
+ const _8Bx9qN8oU7Bpt2xi6khaxWp1gMr__array = values["https://www.w3.org/ns/activitystreams#provideClientKey"];
12845
+ for (const v of _8Bx9qN8oU7Bpt2xi6khaxWp1gMr__array == null
12846
+ ? []
12847
+ : _8Bx9qN8oU7Bpt2xi6khaxWp1gMr__array.length === 1 &&
12848
+ "@list" in _8Bx9qN8oU7Bpt2xi6khaxWp1gMr__array[0]
12849
+ ? _8Bx9qN8oU7Bpt2xi6khaxWp1gMr__array[0]["@list"]
12850
+ : _8Bx9qN8oU7Bpt2xi6khaxWp1gMr__array) {
12187
12851
  if (v == null)
12188
12852
  continue;
12189
12853
  _8Bx9qN8oU7Bpt2xi6khaxWp1gMr.push(new URL(v["@id"]));
12190
12854
  }
12191
12855
  instance.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr = _8Bx9qN8oU7Bpt2xi6khaxWp1gMr;
12192
12856
  const _3dU7PMVQZJpsCpo2F4RQXxBXdPmS = [];
12193
- for (const v of values["https://www.w3.org/ns/activitystreams#signClientKey"] ?? []) {
12857
+ const _3dU7PMVQZJpsCpo2F4RQXxBXdPmS__array = values["https://www.w3.org/ns/activitystreams#signClientKey"];
12858
+ for (const v of _3dU7PMVQZJpsCpo2F4RQXxBXdPmS__array == null
12859
+ ? []
12860
+ : _3dU7PMVQZJpsCpo2F4RQXxBXdPmS__array.length === 1 &&
12861
+ "@list" in _3dU7PMVQZJpsCpo2F4RQXxBXdPmS__array[0]
12862
+ ? _3dU7PMVQZJpsCpo2F4RQXxBXdPmS__array[0]["@list"]
12863
+ : _3dU7PMVQZJpsCpo2F4RQXxBXdPmS__array) {
12194
12864
  if (v == null)
12195
12865
  continue;
12196
12866
  _3dU7PMVQZJpsCpo2F4RQXxBXdPmS.push(new URL(v["@id"]));
12197
12867
  }
12198
12868
  instance.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS = _3dU7PMVQZJpsCpo2F4RQXxBXdPmS;
12199
12869
  const _3JprUSDLVqqX4dwHRi37qGZZCRCc = [];
12200
- for (const v of values["https://www.w3.org/ns/activitystreams#sharedInbox"] ??
12201
- []) {
12870
+ const _3JprUSDLVqqX4dwHRi37qGZZCRCc__array = values["https://www.w3.org/ns/activitystreams#sharedInbox"];
12871
+ for (const v of _3JprUSDLVqqX4dwHRi37qGZZCRCc__array == null
12872
+ ? []
12873
+ : _3JprUSDLVqqX4dwHRi37qGZZCRCc__array.length === 1 &&
12874
+ "@list" in _3JprUSDLVqqX4dwHRi37qGZZCRCc__array[0]
12875
+ ? _3JprUSDLVqqX4dwHRi37qGZZCRCc__array[0]["@list"]
12876
+ : _3JprUSDLVqqX4dwHRi37qGZZCRCc__array) {
12202
12877
  if (v == null)
12203
12878
  continue;
12204
12879
  _3JprUSDLVqqX4dwHRi37qGZZCRCc.push(new URL(v["@id"]));
@@ -12645,6 +13320,7 @@ export class Group extends Object {
12645
13320
  #_BBCTgfphhsFzpVfKTykGSpBNwoA = [];
12646
13321
  #_3bgkPwJanyTCoVFM9ovRcus8tKkU = [];
12647
13322
  #_4N1vBJzXDf8NbBumeECQMFvKetja = [];
13323
+ #_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [];
12648
13324
  #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = [];
12649
13325
  #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [];
12650
13326
  #_gAJzg1QDc4rcefFsUzGSYmyXvNH = [];
@@ -12813,6 +13489,17 @@ export class Group extends Object {
12813
13489
  "Collection | URL" + ".");
12814
13490
  }
12815
13491
  }
13492
+ if ("featuredTags" in values && values.featuredTags != null) {
13493
+ if (values.featuredTags instanceof Collection ||
13494
+ values.featuredTags instanceof URL) {
13495
+ // @ts-ignore: type is checked above.
13496
+ this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [values.featuredTags];
13497
+ }
13498
+ else {
13499
+ throw new TypeError("The featuredTags must be of type " +
13500
+ "Collection | URL" + ".");
13501
+ }
13502
+ }
12816
13503
  if ("streams" in values && values.streams != null) {
12817
13504
  if (Array.isArray(values.streams) &&
12818
13505
  values.streams.every((v) => v instanceof Collection || v instanceof URL)) {
@@ -13050,6 +13737,18 @@ export class Group extends Object {
13050
13737
  "Collection | URL" + ".");
13051
13738
  }
13052
13739
  }
13740
+ clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac;
13741
+ if ("featuredTags" in values && values.featuredTags != null) {
13742
+ if (values.featuredTags instanceof Collection ||
13743
+ values.featuredTags instanceof URL) {
13744
+ // @ts-ignore: type is checked above.
13745
+ clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [values.featuredTags];
13746
+ }
13747
+ else {
13748
+ throw new TypeError("The featuredTags must be of type " +
13749
+ "Collection | URL" + ".");
13750
+ }
13751
+ }
13053
13752
  clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9;
13054
13753
  if ("streams" in values && values.streams != null) {
13055
13754
  if (Array.isArray(values.streams) &&
@@ -13681,6 +14380,64 @@ export class Group extends Object {
13681
14380
  }
13682
14381
  return v;
13683
14382
  }
14383
+ async #fetchFeaturedTags(url, options = {}) {
14384
+ const documentLoader = options.documentLoader ?? this._documentLoader ??
14385
+ fetchDocumentLoader;
14386
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
14387
+ fetchDocumentLoader;
14388
+ let fetchResult;
14389
+ try {
14390
+ fetchResult = await documentLoader(url.href);
14391
+ }
14392
+ catch (error) {
14393
+ if (options.suppressError) {
14394
+ getLogger(["fedify", "vocab"]).error("Failed to fetch {url}: {error}", { error, url: url.href });
14395
+ return null;
14396
+ }
14397
+ throw error;
14398
+ }
14399
+ const { document } = fetchResult;
14400
+ try {
14401
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
14402
+ }
14403
+ catch (e) {
14404
+ if (!(e instanceof TypeError))
14405
+ throw e;
14406
+ }
14407
+ throw new TypeError("Expected an object of any type of: " +
14408
+ ["https://www.w3.org/ns/activitystreams#Collection"].join(", "));
14409
+ }
14410
+ /**
14411
+ * Similar to
14412
+ * {@link Group.getFeaturedTags},
14413
+ * but returns its `@id` URL instead of the object itself.
14414
+ */
14415
+ get featuredTagsId() {
14416
+ if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length < 1)
14417
+ return null;
14418
+ const v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
14419
+ if (v instanceof URL)
14420
+ return v;
14421
+ return v.id;
14422
+ }
14423
+ /** What is known in Mastodon as "featured hashtags", hashtags that are featured
14424
+ * at people's profiles, is implemented using an extra property `featuredTags`
14425
+ * on the actor object that points to a {@link Collection} of {@link Hashtag}
14426
+ * objects specifically.
14427
+ */
14428
+ async getFeaturedTags(options = {}) {
14429
+ if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length < 1)
14430
+ return null;
14431
+ const v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
14432
+ if (v instanceof URL) {
14433
+ const fetched = await this.#fetchFeaturedTags(v, options);
14434
+ if (fetched == null)
14435
+ return null;
14436
+ this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0] = fetched;
14437
+ return fetched;
14438
+ }
14439
+ return v;
14440
+ }
13684
14441
  async #fetchStream(url, options = {}) {
13685
14442
  const documentLoader = options.documentLoader ?? this._documentLoader ??
13686
14443
  fetchDocumentLoader;
@@ -13809,8 +14566,9 @@ export class Group extends Object {
13809
14566
  : await v.toJsonLd(options);
13810
14567
  array.push(element);
13811
14568
  }
13812
- if (array.length > 0)
14569
+ if (array.length > 0) {
13813
14570
  values["https://w3id.org/security#publicKey"] = array;
14571
+ }
13814
14572
  array = [];
13815
14573
  for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3) {
13816
14574
  const element = v instanceof URL
@@ -13836,8 +14594,9 @@ export class Group extends Object {
13836
14594
  : await v.toJsonLd(options);
13837
14595
  array.push(element);
13838
14596
  }
13839
- if (array.length > 0)
14597
+ if (array.length > 0) {
13840
14598
  values["http://www.w3.org/ns/ldp#inbox"] = array;
14599
+ }
13841
14600
  array = [];
13842
14601
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC) {
13843
14602
  const element = v instanceof URL
@@ -13885,8 +14644,19 @@ export class Group extends Object {
13885
14644
  : await v.toJsonLd(options);
13886
14645
  array.push(element);
13887
14646
  }
13888
- if (array.length > 0)
14647
+ if (array.length > 0) {
13889
14648
  values["http://joinmastodon.org/ns#featured"] = array;
14649
+ }
14650
+ array = [];
14651
+ for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac) {
14652
+ const element = v instanceof URL
14653
+ ? { "@id": v.href }
14654
+ : await v.toJsonLd(options);
14655
+ array.push(element);
14656
+ }
14657
+ if (array.length > 0) {
14658
+ values["http://joinmastodon.org/ns#featuredTags"] = array;
14659
+ }
13890
14660
  array = [];
13891
14661
  for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9) {
13892
14662
  const element = v instanceof URL
@@ -13926,8 +14696,9 @@ export class Group extends Object {
13926
14696
  const element = { "@value": v };
13927
14697
  array.push(element);
13928
14698
  }
13929
- if (array.length > 0)
14699
+ if (array.length > 0) {
13930
14700
  values["http://joinmastodon.org/ns#memorial"] = array;
14701
+ }
13931
14702
  array = [];
13932
14703
  for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk) {
13933
14704
  const element = { "@value": v };
@@ -13953,6 +14724,7 @@ export class Group extends Object {
13953
14724
  "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
13954
14725
  "toot": "http://joinmastodon.org/ns#",
13955
14726
  "featured": { "@id": "toot:featured", "@type": "@id" },
14727
+ "featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
13956
14728
  "discoverable": "toot:discoverable",
13957
14729
  "suspended": "toot:suspended",
13958
14730
  "memorial": "toot:memorial",
@@ -14004,8 +14776,13 @@ export class Group extends Object {
14004
14776
  throw new TypeError("Unexpected type: " + instance.constructor.name);
14005
14777
  }
14006
14778
  const _3isuDgRAKSntq9XdbjiNxjwyPZAf = [];
14007
- for (const v of values["https://www.w3.org/ns/activitystreams#preferredUsername"] ??
14008
- []) {
14779
+ const _3isuDgRAKSntq9XdbjiNxjwyPZAf__array = values["https://www.w3.org/ns/activitystreams#preferredUsername"];
14780
+ for (const v of _3isuDgRAKSntq9XdbjiNxjwyPZAf__array == null
14781
+ ? []
14782
+ : _3isuDgRAKSntq9XdbjiNxjwyPZAf__array.length === 1 &&
14783
+ "@list" in _3isuDgRAKSntq9XdbjiNxjwyPZAf__array[0]
14784
+ ? _3isuDgRAKSntq9XdbjiNxjwyPZAf__array[0]["@list"]
14785
+ : _3isuDgRAKSntq9XdbjiNxjwyPZAf__array) {
14009
14786
  if (v == null)
14010
14787
  continue;
14011
14788
  const decoded = typeof v === "object" && "@value" in v &&
@@ -14022,7 +14799,13 @@ export class Group extends Object {
14022
14799
  }
14023
14800
  instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = _3isuDgRAKSntq9XdbjiNxjwyPZAf;
14024
14801
  const _axq166E2eZADq34V4MYUc8KMZdC = [];
14025
- for (const v of values["https://w3id.org/security#publicKey"] ?? []) {
14802
+ const _axq166E2eZADq34V4MYUc8KMZdC__array = values["https://w3id.org/security#publicKey"];
14803
+ for (const v of _axq166E2eZADq34V4MYUc8KMZdC__array == null
14804
+ ? []
14805
+ : _axq166E2eZADq34V4MYUc8KMZdC__array.length === 1 &&
14806
+ "@list" in _axq166E2eZADq34V4MYUc8KMZdC__array[0]
14807
+ ? _axq166E2eZADq34V4MYUc8KMZdC__array[0]["@list"]
14808
+ : _axq166E2eZADq34V4MYUc8KMZdC__array) {
14026
14809
  if (v == null)
14027
14810
  continue;
14028
14811
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -14034,7 +14817,13 @@ export class Group extends Object {
14034
14817
  }
14035
14818
  instance.#_axq166E2eZADq34V4MYUc8KMZdC = _axq166E2eZADq34V4MYUc8KMZdC;
14036
14819
  const _4EHQFWZSz1k1d4LmPrQiMba2GbP3 = [];
14037
- for (const v of values["https://w3id.org/security#assertionMethod"] ?? []) {
14820
+ const _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array = values["https://w3id.org/security#assertionMethod"];
14821
+ for (const v of _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array == null
14822
+ ? []
14823
+ : _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array.length === 1 &&
14824
+ "@list" in _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array[0]
14825
+ ? _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array[0]["@list"]
14826
+ : _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array) {
14038
14827
  if (v == null)
14039
14828
  continue;
14040
14829
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -14046,14 +14835,26 @@ export class Group extends Object {
14046
14835
  }
14047
14836
  instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3 = _4EHQFWZSz1k1d4LmPrQiMba2GbP3;
14048
14837
  const _36QNc9MxfkKf6h8sEUQSHnV9NZA = [];
14049
- for (const v of values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"] ?? []) {
14838
+ const _36QNc9MxfkKf6h8sEUQSHnV9NZA__array = values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"];
14839
+ for (const v of _36QNc9MxfkKf6h8sEUQSHnV9NZA__array == null
14840
+ ? []
14841
+ : _36QNc9MxfkKf6h8sEUQSHnV9NZA__array.length === 1 &&
14842
+ "@list" in _36QNc9MxfkKf6h8sEUQSHnV9NZA__array[0]
14843
+ ? _36QNc9MxfkKf6h8sEUQSHnV9NZA__array[0]["@list"]
14844
+ : _36QNc9MxfkKf6h8sEUQSHnV9NZA__array) {
14050
14845
  if (v == null)
14051
14846
  continue;
14052
14847
  _36QNc9MxfkKf6h8sEUQSHnV9NZA.push(v["@value"]);
14053
14848
  }
14054
14849
  instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA = _36QNc9MxfkKf6h8sEUQSHnV9NZA;
14055
14850
  const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB = [];
14056
- for (const v of values["http://www.w3.org/ns/ldp#inbox"] ?? []) {
14851
+ const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array = values["http://www.w3.org/ns/ldp#inbox"];
14852
+ for (const v of _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array == null
14853
+ ? []
14854
+ : _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array.length === 1 &&
14855
+ "@list" in _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array[0]
14856
+ ? _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array[0]["@list"]
14857
+ : _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array) {
14057
14858
  if (v == null)
14058
14859
  continue;
14059
14860
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -14065,7 +14866,13 @@ export class Group extends Object {
14065
14866
  }
14066
14867
  instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB;
14067
14868
  const _41QwhqJouoLg3h8dRPKat21brynC = [];
14068
- for (const v of values["https://www.w3.org/ns/activitystreams#outbox"] ?? []) {
14869
+ const _41QwhqJouoLg3h8dRPKat21brynC__array = values["https://www.w3.org/ns/activitystreams#outbox"];
14870
+ for (const v of _41QwhqJouoLg3h8dRPKat21brynC__array == null
14871
+ ? []
14872
+ : _41QwhqJouoLg3h8dRPKat21brynC__array.length === 1 &&
14873
+ "@list" in _41QwhqJouoLg3h8dRPKat21brynC__array[0]
14874
+ ? _41QwhqJouoLg3h8dRPKat21brynC__array[0]["@list"]
14875
+ : _41QwhqJouoLg3h8dRPKat21brynC__array) {
14069
14876
  if (v == null)
14070
14877
  continue;
14071
14878
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -14077,7 +14884,13 @@ export class Group extends Object {
14077
14884
  }
14078
14885
  instance.#_41QwhqJouoLg3h8dRPKat21brynC = _41QwhqJouoLg3h8dRPKat21brynC;
14079
14886
  const _3yAv8jymNfNuJUDuBzJ1NQhdbAee = [];
14080
- for (const v of values["https://www.w3.org/ns/activitystreams#following"] ?? []) {
14887
+ const _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array = values["https://www.w3.org/ns/activitystreams#following"];
14888
+ for (const v of _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array == null
14889
+ ? []
14890
+ : _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array.length === 1 &&
14891
+ "@list" in _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array[0]
14892
+ ? _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array[0]["@list"]
14893
+ : _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array) {
14081
14894
  if (v == null)
14082
14895
  continue;
14083
14896
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -14089,7 +14902,13 @@ export class Group extends Object {
14089
14902
  }
14090
14903
  instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee = _3yAv8jymNfNuJUDuBzJ1NQhdbAee;
14091
14904
  const _BBCTgfphhsFzpVfKTykGSpBNwoA = [];
14092
- for (const v of values["https://www.w3.org/ns/activitystreams#followers"] ?? []) {
14905
+ const _BBCTgfphhsFzpVfKTykGSpBNwoA__array = values["https://www.w3.org/ns/activitystreams#followers"];
14906
+ for (const v of _BBCTgfphhsFzpVfKTykGSpBNwoA__array == null
14907
+ ? []
14908
+ : _BBCTgfphhsFzpVfKTykGSpBNwoA__array.length === 1 &&
14909
+ "@list" in _BBCTgfphhsFzpVfKTykGSpBNwoA__array[0]
14910
+ ? _BBCTgfphhsFzpVfKTykGSpBNwoA__array[0]["@list"]
14911
+ : _BBCTgfphhsFzpVfKTykGSpBNwoA__array) {
14093
14912
  if (v == null)
14094
14913
  continue;
14095
14914
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -14101,7 +14920,13 @@ export class Group extends Object {
14101
14920
  }
14102
14921
  instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA = _BBCTgfphhsFzpVfKTykGSpBNwoA;
14103
14922
  const _3bgkPwJanyTCoVFM9ovRcus8tKkU = [];
14104
- for (const v of values["https://www.w3.org/ns/activitystreams#liked"] ?? []) {
14923
+ const _3bgkPwJanyTCoVFM9ovRcus8tKkU__array = values["https://www.w3.org/ns/activitystreams#liked"];
14924
+ for (const v of _3bgkPwJanyTCoVFM9ovRcus8tKkU__array == null
14925
+ ? []
14926
+ : _3bgkPwJanyTCoVFM9ovRcus8tKkU__array.length === 1 &&
14927
+ "@list" in _3bgkPwJanyTCoVFM9ovRcus8tKkU__array[0]
14928
+ ? _3bgkPwJanyTCoVFM9ovRcus8tKkU__array[0]["@list"]
14929
+ : _3bgkPwJanyTCoVFM9ovRcus8tKkU__array) {
14105
14930
  if (v == null)
14106
14931
  continue;
14107
14932
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -14113,7 +14938,13 @@ export class Group extends Object {
14113
14938
  }
14114
14939
  instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU = _3bgkPwJanyTCoVFM9ovRcus8tKkU;
14115
14940
  const _4N1vBJzXDf8NbBumeECQMFvKetja = [];
14116
- for (const v of values["http://joinmastodon.org/ns#featured"] ?? []) {
14941
+ const _4N1vBJzXDf8NbBumeECQMFvKetja__array = values["http://joinmastodon.org/ns#featured"];
14942
+ for (const v of _4N1vBJzXDf8NbBumeECQMFvKetja__array == null
14943
+ ? []
14944
+ : _4N1vBJzXDf8NbBumeECQMFvKetja__array.length === 1 &&
14945
+ "@list" in _4N1vBJzXDf8NbBumeECQMFvKetja__array[0]
14946
+ ? _4N1vBJzXDf8NbBumeECQMFvKetja__array[0]["@list"]
14947
+ : _4N1vBJzXDf8NbBumeECQMFvKetja__array) {
14117
14948
  if (v == null)
14118
14949
  continue;
14119
14950
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -14124,8 +14955,32 @@ export class Group extends Object {
14124
14955
  _4N1vBJzXDf8NbBumeECQMFvKetja.push(await Collection.fromJsonLd(v, options));
14125
14956
  }
14126
14957
  instance.#_4N1vBJzXDf8NbBumeECQMFvKetja = _4N1vBJzXDf8NbBumeECQMFvKetja;
14958
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac = [];
14959
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array = values["http://joinmastodon.org/ns#featuredTags"];
14960
+ for (const v of _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array == null
14961
+ ? []
14962
+ : _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array.length === 1 &&
14963
+ "@list" in _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array[0]
14964
+ ? _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array[0]["@list"]
14965
+ : _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array) {
14966
+ if (v == null)
14967
+ continue;
14968
+ if (typeof v === "object" && "@id" in v && !("@type" in v) &&
14969
+ globalThis.Object.keys(v).length === 1) {
14970
+ _2MxnRRLq9iPzx5CFq2NPrXdUDCac.push(new URL(v["@id"]));
14971
+ continue;
14972
+ }
14973
+ _2MxnRRLq9iPzx5CFq2NPrXdUDCac.push(await Collection.fromJsonLd(v, options));
14974
+ }
14975
+ instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = _2MxnRRLq9iPzx5CFq2NPrXdUDCac;
14127
14976
  const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = [];
14128
- for (const v of values["https://www.w3.org/ns/activitystreams#streams"] ?? []) {
14977
+ const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array = values["https://www.w3.org/ns/activitystreams#streams"];
14978
+ for (const v of _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array == null
14979
+ ? []
14980
+ : _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array.length === 1 &&
14981
+ "@list" in _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array[0]
14982
+ ? _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array[0]["@list"]
14983
+ : _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array) {
14129
14984
  if (v == null)
14130
14985
  continue;
14131
14986
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -14137,35 +14992,65 @@ export class Group extends Object {
14137
14992
  }
14138
14993
  instance.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = _3sG2Hdwn9qzKGu9mpYkqakAMUkH9;
14139
14994
  const _sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [];
14140
- for (const v of values["https://www.w3.org/ns/activitystreams#endpoints"] ?? []) {
14995
+ const _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array = values["https://www.w3.org/ns/activitystreams#endpoints"];
14996
+ for (const v of _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array == null
14997
+ ? []
14998
+ : _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array.length === 1 &&
14999
+ "@list" in _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array[0]
15000
+ ? _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array[0]["@list"]
15001
+ : _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array) {
14141
15002
  if (v == null)
14142
15003
  continue;
14143
15004
  _sEoQwUbfk4hEfugzNQ2ZiDcLMkG.push(await Endpoints.fromJsonLd(v, options));
14144
15005
  }
14145
15006
  instance.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG;
14146
15007
  const _gAJzg1QDc4rcefFsUzGSYmyXvNH = [];
14147
- for (const v of values["http://joinmastodon.org/ns#discoverable"] ?? []) {
15008
+ const _gAJzg1QDc4rcefFsUzGSYmyXvNH__array = values["http://joinmastodon.org/ns#discoverable"];
15009
+ for (const v of _gAJzg1QDc4rcefFsUzGSYmyXvNH__array == null
15010
+ ? []
15011
+ : _gAJzg1QDc4rcefFsUzGSYmyXvNH__array.length === 1 &&
15012
+ "@list" in _gAJzg1QDc4rcefFsUzGSYmyXvNH__array[0]
15013
+ ? _gAJzg1QDc4rcefFsUzGSYmyXvNH__array[0]["@list"]
15014
+ : _gAJzg1QDc4rcefFsUzGSYmyXvNH__array) {
14148
15015
  if (v == null)
14149
15016
  continue;
14150
15017
  _gAJzg1QDc4rcefFsUzGSYmyXvNH.push(v["@value"]);
14151
15018
  }
14152
15019
  instance.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = _gAJzg1QDc4rcefFsUzGSYmyXvNH;
14153
15020
  const _2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [];
14154
- for (const v of values["http://joinmastodon.org/ns#suspended"] ?? []) {
15021
+ const _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array = values["http://joinmastodon.org/ns#suspended"];
15022
+ for (const v of _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array == null
15023
+ ? []
15024
+ : _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array.length === 1 &&
15025
+ "@list" in _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array[0]
15026
+ ? _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array[0]["@list"]
15027
+ : _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array) {
14155
15028
  if (v == null)
14156
15029
  continue;
14157
15030
  _2kGKkJtoFWg8c18PaVSqj9NKP4t7.push(v["@value"]);
14158
15031
  }
14159
15032
  instance.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = _2kGKkJtoFWg8c18PaVSqj9NKP4t7;
14160
15033
  const _79S8K4f5J9MWUgCxziRyUe6PTHZ = [];
14161
- for (const v of values["http://joinmastodon.org/ns#memorial"] ?? []) {
15034
+ const _79S8K4f5J9MWUgCxziRyUe6PTHZ__array = values["http://joinmastodon.org/ns#memorial"];
15035
+ for (const v of _79S8K4f5J9MWUgCxziRyUe6PTHZ__array == null
15036
+ ? []
15037
+ : _79S8K4f5J9MWUgCxziRyUe6PTHZ__array.length === 1 &&
15038
+ "@list" in _79S8K4f5J9MWUgCxziRyUe6PTHZ__array[0]
15039
+ ? _79S8K4f5J9MWUgCxziRyUe6PTHZ__array[0]["@list"]
15040
+ : _79S8K4f5J9MWUgCxziRyUe6PTHZ__array) {
14162
15041
  if (v == null)
14163
15042
  continue;
14164
15043
  _79S8K4f5J9MWUgCxziRyUe6PTHZ.push(v["@value"]);
14165
15044
  }
14166
15045
  instance.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = _79S8K4f5J9MWUgCxziRyUe6PTHZ;
14167
15046
  const _2diCorzqPGQQqftp6e4SrCEwEnyk = [];
14168
- for (const v of values["http://joinmastodon.org/ns#indexable"] ?? []) {
15047
+ const _2diCorzqPGQQqftp6e4SrCEwEnyk__array = values["http://joinmastodon.org/ns#indexable"];
15048
+ for (const v of _2diCorzqPGQQqftp6e4SrCEwEnyk__array == null
15049
+ ? []
15050
+ : _2diCorzqPGQQqftp6e4SrCEwEnyk__array.length === 1 &&
15051
+ "@list" in _2diCorzqPGQQqftp6e4SrCEwEnyk__array[0]
15052
+ ? _2diCorzqPGQQqftp6e4SrCEwEnyk__array[0]["@list"]
15053
+ : _2diCorzqPGQQqftp6e4SrCEwEnyk__array) {
14169
15054
  if (v == null)
14170
15055
  continue;
14171
15056
  _2diCorzqPGQQqftp6e4SrCEwEnyk.push(v["@value"]);
@@ -14300,6 +15185,17 @@ export class Group extends Object {
14300
15185
  if (_4N1vBJzXDf8NbBumeECQMFvKetja.length == 1) {
14301
15186
  proxy.featured = _4N1vBJzXDf8NbBumeECQMFvKetja[0];
14302
15187
  }
15188
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac
15189
+ // deno-lint-ignore no-explicit-any
15190
+ .map((v) => v instanceof URL
15191
+ ? {
15192
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
15193
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
15194
+ }
15195
+ : v);
15196
+ if (_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length == 1) {
15197
+ proxy.featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
15198
+ }
14303
15199
  const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9
14304
15200
  // deno-lint-ignore no-explicit-any
14305
15201
  .map((v) => v instanceof URL
@@ -14958,28 +15854,52 @@ export class Link {
14958
15854
  }
14959
15855
  const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, options);
14960
15856
  const _pVjLsybKQdmkjuU7MHjiVmNnuj7 = [];
14961
- for (const v of values["https://www.w3.org/ns/activitystreams#href"] ?? []) {
15857
+ const _pVjLsybKQdmkjuU7MHjiVmNnuj7__array = values["https://www.w3.org/ns/activitystreams#href"];
15858
+ for (const v of _pVjLsybKQdmkjuU7MHjiVmNnuj7__array == null
15859
+ ? []
15860
+ : _pVjLsybKQdmkjuU7MHjiVmNnuj7__array.length === 1 &&
15861
+ "@list" in _pVjLsybKQdmkjuU7MHjiVmNnuj7__array[0]
15862
+ ? _pVjLsybKQdmkjuU7MHjiVmNnuj7__array[0]["@list"]
15863
+ : _pVjLsybKQdmkjuU7MHjiVmNnuj7__array) {
14962
15864
  if (v == null)
14963
15865
  continue;
14964
15866
  _pVjLsybKQdmkjuU7MHjiVmNnuj7.push(new URL(v["@id"]));
14965
15867
  }
14966
15868
  instance.#_pVjLsybKQdmkjuU7MHjiVmNnuj7 = _pVjLsybKQdmkjuU7MHjiVmNnuj7;
14967
15869
  const _2a1c5GkfkQsnyyLybF8UXBQfFuHZ = [];
14968
- for (const v of values["https://www.w3.org/ns/activitystreams#rel"] ?? []) {
15870
+ const _2a1c5GkfkQsnyyLybF8UXBQfFuHZ__array = values["https://www.w3.org/ns/activitystreams#rel"];
15871
+ for (const v of _2a1c5GkfkQsnyyLybF8UXBQfFuHZ__array == null
15872
+ ? []
15873
+ : _2a1c5GkfkQsnyyLybF8UXBQfFuHZ__array.length === 1 &&
15874
+ "@list" in _2a1c5GkfkQsnyyLybF8UXBQfFuHZ__array[0]
15875
+ ? _2a1c5GkfkQsnyyLybF8UXBQfFuHZ__array[0]["@list"]
15876
+ : _2a1c5GkfkQsnyyLybF8UXBQfFuHZ__array) {
14969
15877
  if (v == null)
14970
15878
  continue;
14971
15879
  _2a1c5GkfkQsnyyLybF8UXBQfFuHZ.push(v["@value"]);
14972
15880
  }
14973
15881
  instance.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ = _2a1c5GkfkQsnyyLybF8UXBQfFuHZ;
14974
15882
  const _3BLrzmscsjHCw8TF5BHRW9WkPnX8 = [];
14975
- for (const v of values["https://www.w3.org/ns/activitystreams#mediaType"] ?? []) {
15883
+ const _3BLrzmscsjHCw8TF5BHRW9WkPnX8__array = values["https://www.w3.org/ns/activitystreams#mediaType"];
15884
+ for (const v of _3BLrzmscsjHCw8TF5BHRW9WkPnX8__array == null
15885
+ ? []
15886
+ : _3BLrzmscsjHCw8TF5BHRW9WkPnX8__array.length === 1 &&
15887
+ "@list" in _3BLrzmscsjHCw8TF5BHRW9WkPnX8__array[0]
15888
+ ? _3BLrzmscsjHCw8TF5BHRW9WkPnX8__array[0]["@list"]
15889
+ : _3BLrzmscsjHCw8TF5BHRW9WkPnX8__array) {
14976
15890
  if (v == null)
14977
15891
  continue;
14978
15892
  _3BLrzmscsjHCw8TF5BHRW9WkPnX8.push(v["@value"]);
14979
15893
  }
14980
15894
  instance.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8 = _3BLrzmscsjHCw8TF5BHRW9WkPnX8;
14981
15895
  const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav = [];
14982
- for (const v of values["https://www.w3.org/ns/activitystreams#name"] ?? []) {
15896
+ const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array = values["https://www.w3.org/ns/activitystreams#name"];
15897
+ for (const v of _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array == null
15898
+ ? []
15899
+ : _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array.length === 1 &&
15900
+ "@list" in _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array[0]
15901
+ ? _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array[0]["@list"]
15902
+ : _4ZHbBuK7PrsvGgrjM8wgc6KMWjav__array) {
14983
15903
  if (v == null)
14984
15904
  continue;
14985
15905
  const decoded = typeof v === "object" && "@value" in v &&
@@ -14996,28 +15916,52 @@ export class Link {
14996
15916
  }
14997
15917
  instance.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = _4ZHbBuK7PrsvGgrjM8wgc6KMWjav;
14998
15918
  const _f57HKWCp1YRBbTJE8PF12RbDJGf = [];
14999
- for (const v of values["https://www.w3.org/ns/activitystreams#hreflang"] ?? []) {
15919
+ const _f57HKWCp1YRBbTJE8PF12RbDJGf__array = values["https://www.w3.org/ns/activitystreams#hreflang"];
15920
+ for (const v of _f57HKWCp1YRBbTJE8PF12RbDJGf__array == null
15921
+ ? []
15922
+ : _f57HKWCp1YRBbTJE8PF12RbDJGf__array.length === 1 &&
15923
+ "@list" in _f57HKWCp1YRBbTJE8PF12RbDJGf__array[0]
15924
+ ? _f57HKWCp1YRBbTJE8PF12RbDJGf__array[0]["@list"]
15925
+ : _f57HKWCp1YRBbTJE8PF12RbDJGf__array) {
15000
15926
  if (v == null)
15001
15927
  continue;
15002
15928
  _f57HKWCp1YRBbTJE8PF12RbDJGf.push(parseLanguageTag(v["@value"]));
15003
15929
  }
15004
15930
  instance.#_f57HKWCp1YRBbTJE8PF12RbDJGf = _f57HKWCp1YRBbTJE8PF12RbDJGf;
15005
15931
  const _2cGKFeFJMmiNpGZFEF75mCwFQsKb = [];
15006
- for (const v of values["https://www.w3.org/ns/activitystreams#height"] ?? []) {
15932
+ const _2cGKFeFJMmiNpGZFEF75mCwFQsKb__array = values["https://www.w3.org/ns/activitystreams#height"];
15933
+ for (const v of _2cGKFeFJMmiNpGZFEF75mCwFQsKb__array == null
15934
+ ? []
15935
+ : _2cGKFeFJMmiNpGZFEF75mCwFQsKb__array.length === 1 &&
15936
+ "@list" in _2cGKFeFJMmiNpGZFEF75mCwFQsKb__array[0]
15937
+ ? _2cGKFeFJMmiNpGZFEF75mCwFQsKb__array[0]["@list"]
15938
+ : _2cGKFeFJMmiNpGZFEF75mCwFQsKb__array) {
15007
15939
  if (v == null)
15008
15940
  continue;
15009
15941
  _2cGKFeFJMmiNpGZFEF75mCwFQsKb.push(v["@value"]);
15010
15942
  }
15011
15943
  instance.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb = _2cGKFeFJMmiNpGZFEF75mCwFQsKb;
15012
15944
  const _2e9AP7WdHBJYAgXG6GEyq7nSkNMe = [];
15013
- for (const v of values["https://www.w3.org/ns/activitystreams#width"] ?? []) {
15945
+ const _2e9AP7WdHBJYAgXG6GEyq7nSkNMe__array = values["https://www.w3.org/ns/activitystreams#width"];
15946
+ for (const v of _2e9AP7WdHBJYAgXG6GEyq7nSkNMe__array == null
15947
+ ? []
15948
+ : _2e9AP7WdHBJYAgXG6GEyq7nSkNMe__array.length === 1 &&
15949
+ "@list" in _2e9AP7WdHBJYAgXG6GEyq7nSkNMe__array[0]
15950
+ ? _2e9AP7WdHBJYAgXG6GEyq7nSkNMe__array[0]["@list"]
15951
+ : _2e9AP7WdHBJYAgXG6GEyq7nSkNMe__array) {
15014
15952
  if (v == null)
15015
15953
  continue;
15016
15954
  _2e9AP7WdHBJYAgXG6GEyq7nSkNMe.push(v["@value"]);
15017
15955
  }
15018
15956
  instance.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe = _2e9AP7WdHBJYAgXG6GEyq7nSkNMe;
15019
15957
  const _gCVTegXxWWCw6wWRxa1QF65zusg = [];
15020
- for (const v of values["https://www.w3.org/ns/activitystreams#preview"] ?? []) {
15958
+ const _gCVTegXxWWCw6wWRxa1QF65zusg__array = values["https://www.w3.org/ns/activitystreams#preview"];
15959
+ for (const v of _gCVTegXxWWCw6wWRxa1QF65zusg__array == null
15960
+ ? []
15961
+ : _gCVTegXxWWCw6wWRxa1QF65zusg__array.length === 1 &&
15962
+ "@list" in _gCVTegXxWWCw6wWRxa1QF65zusg__array[0]
15963
+ ? _gCVTegXxWWCw6wWRxa1QF65zusg__array[0]["@list"]
15964
+ : _gCVTegXxWWCw6wWRxa1QF65zusg__array) {
15021
15965
  if (v == null)
15022
15966
  continue;
15023
15967
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -15880,6 +16824,7 @@ export class OrderedCollection extends Collection {
15880
16824
  static get typeId() {
15881
16825
  return new URL("https://www.w3.org/ns/activitystreams#OrderedCollection");
15882
16826
  }
16827
+ #_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg = [];
15883
16828
  /**
15884
16829
  * Constructs a new instance of OrderedCollection with the given values.
15885
16830
  * @param values The values to initialize the instance with.
@@ -15887,6 +16832,17 @@ export class OrderedCollection extends Collection {
15887
16832
  */
15888
16833
  constructor(values, { documentLoader, contextLoader, } = {}) {
15889
16834
  super(values, { documentLoader, contextLoader });
16835
+ if ("items" in values && values.items != null) {
16836
+ if (Array.isArray(values.items) &&
16837
+ values.items.every((v) => v instanceof Object || v instanceof Link || v instanceof URL)) {
16838
+ // @ts-ignore: type is checked above.
16839
+ this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg = values.items;
16840
+ }
16841
+ else {
16842
+ throw new TypeError("The items must be an array of type " +
16843
+ "Object | Link | URL" + ".");
16844
+ }
16845
+ }
15890
16846
  }
15891
16847
  /**
15892
16848
  * Clones this instance, optionally updating it with the given values.
@@ -15896,8 +16852,83 @@ export class OrderedCollection extends Collection {
15896
16852
  */
15897
16853
  clone(values = {}, options = {}) {
15898
16854
  const clone = super.clone(values, options);
16855
+ clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg;
16856
+ if ("items" in values && values.items != null) {
16857
+ if (Array.isArray(values.items) &&
16858
+ values.items.every((v) => v instanceof Object || v instanceof Link || v instanceof URL)) {
16859
+ // @ts-ignore: type is checked above.
16860
+ clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg = values.items;
16861
+ }
16862
+ else {
16863
+ throw new TypeError("The items must be an array of type " +
16864
+ "Object | Link | URL" + ".");
16865
+ }
16866
+ }
15899
16867
  return clone;
15900
16868
  }
16869
+ async #fetchItem(url, options = {}) {
16870
+ const documentLoader = options.documentLoader ?? this._documentLoader ??
16871
+ fetchDocumentLoader;
16872
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
16873
+ fetchDocumentLoader;
16874
+ let fetchResult;
16875
+ try {
16876
+ fetchResult = await documentLoader(url.href);
16877
+ }
16878
+ catch (error) {
16879
+ if (options.suppressError) {
16880
+ getLogger(["fedify", "vocab"]).error("Failed to fetch {url}: {error}", { error, url: url.href });
16881
+ return null;
16882
+ }
16883
+ throw error;
16884
+ }
16885
+ const { document } = fetchResult;
16886
+ try {
16887
+ return await Object.fromJsonLd(document, { documentLoader, contextLoader });
16888
+ }
16889
+ catch (e) {
16890
+ if (!(e instanceof TypeError))
16891
+ throw e;
16892
+ }
16893
+ try {
16894
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
16895
+ }
16896
+ catch (e) {
16897
+ if (!(e instanceof TypeError))
16898
+ throw e;
16899
+ }
16900
+ throw new TypeError("Expected an object of any type of: " +
16901
+ [
16902
+ "https://www.w3.org/ns/activitystreams#Object",
16903
+ "https://www.w3.org/ns/activitystreams#Link",
16904
+ ].join(", "));
16905
+ }
16906
+ /**
16907
+ * Similar to
16908
+ * {@link OrderedCollection.getItems},
16909
+ * but returns their `@id`s instead of the objects themselves.
16910
+ */
16911
+ get itemIds() {
16912
+ return this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg.map((v) => v instanceof URL ? v : v.id).filter((id) => id !== null);
16913
+ }
16914
+ /** Identifies the items contained in a collection. The items might be ordered
16915
+ * or unordered.
16916
+ */
16917
+ async *getItems(options = {}) {
16918
+ const vs = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg;
16919
+ for (let i = 0; i < vs.length; i++) {
16920
+ const v = vs[i];
16921
+ if (v instanceof URL) {
16922
+ const fetched = await this.#fetchItem(v, options);
16923
+ if (fetched == null)
16924
+ continue;
16925
+ vs[i] = fetched;
16926
+ yield fetched;
16927
+ continue;
16928
+ }
16929
+ yield v;
16930
+ }
16931
+ }
15901
16932
  /**
15902
16933
  * Converts this object to a JSON-LD structure.
15903
16934
  * @returns The JSON-LD representation of this object.
@@ -15914,6 +16945,20 @@ export class OrderedCollection extends Collection {
15914
16945
  expand: true,
15915
16946
  });
15916
16947
  const values = baseValues[0];
16948
+ array = [];
16949
+ for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg) {
16950
+ const element = v instanceof URL
16951
+ ? { "@id": v.href }
16952
+ : v instanceof Object
16953
+ ? await v.toJsonLd(options)
16954
+ : await v.toJsonLd(options);
16955
+ array.push(element);
16956
+ }
16957
+ if (array.length > 0) {
16958
+ values["https://www.w3.org/ns/activitystreams#items"] = {
16959
+ "@list": array,
16960
+ };
16961
+ }
15917
16962
  values["@type"] = [
15918
16963
  "https://www.w3.org/ns/activitystreams#OrderedCollection",
15919
16964
  ];
@@ -15922,7 +16967,17 @@ export class OrderedCollection extends Collection {
15922
16967
  if (options.expand) {
15923
16968
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
15924
16969
  }
15925
- return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
16970
+ return await jsonld.compact(values, options.context ??
16971
+ [
16972
+ "https://www.w3.org/ns/activitystreams",
16973
+ "https://w3id.org/security/data-integrity/v1",
16974
+ {
16975
+ "toot": "http://joinmastodon.org/ns#",
16976
+ "sensitive": "as:sensitive",
16977
+ "Emoji": "toot:Emoji",
16978
+ "Hashtag": "as:Hashtag",
16979
+ },
16980
+ ], { documentLoader: options.contextLoader });
15926
16981
  }
15927
16982
  /**
15928
16983
  * Converts a JSON-LD structure to an object of this type.
@@ -15964,10 +17019,100 @@ export class OrderedCollection extends Collection {
15964
17019
  if (!(instance instanceof OrderedCollection)) {
15965
17020
  throw new TypeError("Unexpected type: " + instance.constructor.name);
15966
17021
  }
17022
+ const _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg = [];
17023
+ const _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg__array = values["https://www.w3.org/ns/activitystreams#items"];
17024
+ for (const v of _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg__array == null
17025
+ ? []
17026
+ : _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg__array.length === 1 &&
17027
+ "@list" in _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg__array[0]
17028
+ ? _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg__array[0]["@list"]
17029
+ : _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg__array) {
17030
+ if (v == null)
17031
+ continue;
17032
+ if (typeof v === "object" && "@id" in v && !("@type" in v) &&
17033
+ globalThis.Object.keys(v).length === 1) {
17034
+ _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg.push(new URL(v["@id"]));
17035
+ continue;
17036
+ }
17037
+ const decoded = typeof v === "object" && "@type" in v &&
17038
+ Array.isArray(v["@type"]) &&
17039
+ [
17040
+ "https://www.w3.org/ns/activitystreams#Object",
17041
+ "http://joinmastodon.org/ns#Emoji",
17042
+ "https://www.w3.org/ns/activitystreams#Activity",
17043
+ "https://www.w3.org/ns/activitystreams#Accept",
17044
+ "https://www.w3.org/ns/activitystreams#Add",
17045
+ "https://www.w3.org/ns/activitystreams#Announce",
17046
+ "https://www.w3.org/ns/activitystreams#Create",
17047
+ "https://www.w3.org/ns/activitystreams#Delete",
17048
+ "https://www.w3.org/ns/activitystreams#Dislike",
17049
+ "https://www.w3.org/ns/activitystreams#Flag",
17050
+ "https://www.w3.org/ns/activitystreams#Follow",
17051
+ "https://www.w3.org/ns/activitystreams#Ignore",
17052
+ "https://www.w3.org/ns/activitystreams#Block",
17053
+ "https://www.w3.org/ns/activitystreams#IntransitiveActivity",
17054
+ "https://www.w3.org/ns/activitystreams#Arrive",
17055
+ "https://www.w3.org/ns/activitystreams#Question",
17056
+ "https://www.w3.org/ns/activitystreams#Like",
17057
+ "https://www.w3.org/ns/activitystreams#Offer",
17058
+ "https://www.w3.org/ns/activitystreams#Reject",
17059
+ "https://www.w3.org/ns/activitystreams#Remove",
17060
+ "https://www.w3.org/ns/activitystreams#Undo",
17061
+ "https://www.w3.org/ns/activitystreams#Update",
17062
+ "https://www.w3.org/ns/activitystreams#Application",
17063
+ "https://www.w3.org/ns/activitystreams#Article",
17064
+ "https://www.w3.org/ns/activitystreams#Collection",
17065
+ "https://www.w3.org/ns/activitystreams#CollectionPage",
17066
+ "https://www.w3.org/ns/activitystreams#OrderedCollectionPage",
17067
+ "https://www.w3.org/ns/activitystreams#OrderedCollection",
17068
+ "https://www.w3.org/ns/activitystreams#Document",
17069
+ "https://www.w3.org/ns/activitystreams#Audio",
17070
+ "https://www.w3.org/ns/activitystreams#Image",
17071
+ "https://www.w3.org/ns/activitystreams#Page",
17072
+ "https://www.w3.org/ns/activitystreams#Video",
17073
+ "https://www.w3.org/ns/activitystreams#Event",
17074
+ "https://www.w3.org/ns/activitystreams#Group",
17075
+ "https://www.w3.org/ns/activitystreams#Note",
17076
+ "https://www.w3.org/ns/activitystreams#Organization",
17077
+ "https://www.w3.org/ns/activitystreams#Person",
17078
+ "https://www.w3.org/ns/activitystreams#Place",
17079
+ "https://www.w3.org/ns/activitystreams#Profile",
17080
+ "https://www.w3.org/ns/activitystreams#Relationship",
17081
+ "https://www.w3.org/ns/activitystreams#Service",
17082
+ "https://www.w3.org/ns/activitystreams#Tombstone",
17083
+ ].some((t) => v["@type"].includes(t))
17084
+ ? await Object.fromJsonLd(v, options)
17085
+ : typeof v === "object" && "@type" in v &&
17086
+ Array.isArray(v["@type"]) &&
17087
+ [
17088
+ "https://www.w3.org/ns/activitystreams#Link",
17089
+ "https://www.w3.org/ns/activitystreams#Hashtag",
17090
+ "https://www.w3.org/ns/activitystreams#Mention",
17091
+ ].some((t) => v["@type"].includes(t))
17092
+ ? await Link.fromJsonLd(v, options)
17093
+ : undefined;
17094
+ if (typeof decoded === "undefined")
17095
+ continue;
17096
+ _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg.push(decoded);
17097
+ }
17098
+ instance.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg = _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg;
15967
17099
  return instance;
15968
17100
  }
15969
17101
  _getCustomInspectProxy() {
15970
17102
  const proxy = super._getCustomInspectProxy();
17103
+ const _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg
17104
+ // deno-lint-ignore no-explicit-any
17105
+ .map((v) => v instanceof URL
17106
+ ? {
17107
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
17108
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
17109
+ }
17110
+ : v);
17111
+ if (_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg.length > 1 ||
17112
+ !("item" in proxy) &&
17113
+ _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg.length > 0) {
17114
+ proxy.items = _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg;
17115
+ }
15971
17116
  return proxy;
15972
17117
  }
15973
17118
  [Symbol.for("Deno.customInspect")](inspect, options) {
@@ -16075,7 +17220,17 @@ export class OrderedCollectionPage extends CollectionPage {
16075
17220
  if (options.expand) {
16076
17221
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
16077
17222
  }
16078
- return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
17223
+ return await jsonld.compact(values, options.context ??
17224
+ [
17225
+ "https://www.w3.org/ns/activitystreams",
17226
+ "https://w3id.org/security/data-integrity/v1",
17227
+ {
17228
+ "toot": "http://joinmastodon.org/ns#",
17229
+ "sensitive": "as:sensitive",
17230
+ "Emoji": "toot:Emoji",
17231
+ "Hashtag": "as:Hashtag",
17232
+ },
17233
+ ], { documentLoader: options.contextLoader });
16079
17234
  }
16080
17235
  /**
16081
17236
  * Converts a JSON-LD structure to an object of this type.
@@ -16118,8 +17273,13 @@ export class OrderedCollectionPage extends CollectionPage {
16118
17273
  throw new TypeError("Unexpected type: " + instance.constructor.name);
16119
17274
  }
16120
17275
  const _2W4yinFwqmpneu2h4m1mZ3pcLADd = [];
16121
- for (const v of values["https://www.w3.org/ns/activitystreams#startIndex"] ??
16122
- []) {
17276
+ const _2W4yinFwqmpneu2h4m1mZ3pcLADd__array = values["https://www.w3.org/ns/activitystreams#startIndex"];
17277
+ for (const v of _2W4yinFwqmpneu2h4m1mZ3pcLADd__array == null
17278
+ ? []
17279
+ : _2W4yinFwqmpneu2h4m1mZ3pcLADd__array.length === 1 &&
17280
+ "@list" in _2W4yinFwqmpneu2h4m1mZ3pcLADd__array[0]
17281
+ ? _2W4yinFwqmpneu2h4m1mZ3pcLADd__array[0]["@list"]
17282
+ : _2W4yinFwqmpneu2h4m1mZ3pcLADd__array) {
16123
17283
  if (v == null)
16124
17284
  continue;
16125
17285
  _2W4yinFwqmpneu2h4m1mZ3pcLADd.push(v["@value"]);
@@ -16170,6 +17330,7 @@ export class Organization extends Object {
16170
17330
  #_BBCTgfphhsFzpVfKTykGSpBNwoA = [];
16171
17331
  #_3bgkPwJanyTCoVFM9ovRcus8tKkU = [];
16172
17332
  #_4N1vBJzXDf8NbBumeECQMFvKetja = [];
17333
+ #_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [];
16173
17334
  #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = [];
16174
17335
  #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [];
16175
17336
  #_gAJzg1QDc4rcefFsUzGSYmyXvNH = [];
@@ -16338,6 +17499,17 @@ export class Organization extends Object {
16338
17499
  "Collection | URL" + ".");
16339
17500
  }
16340
17501
  }
17502
+ if ("featuredTags" in values && values.featuredTags != null) {
17503
+ if (values.featuredTags instanceof Collection ||
17504
+ values.featuredTags instanceof URL) {
17505
+ // @ts-ignore: type is checked above.
17506
+ this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [values.featuredTags];
17507
+ }
17508
+ else {
17509
+ throw new TypeError("The featuredTags must be of type " +
17510
+ "Collection | URL" + ".");
17511
+ }
17512
+ }
16341
17513
  if ("streams" in values && values.streams != null) {
16342
17514
  if (Array.isArray(values.streams) &&
16343
17515
  values.streams.every((v) => v instanceof Collection || v instanceof URL)) {
@@ -16575,6 +17747,18 @@ export class Organization extends Object {
16575
17747
  "Collection | URL" + ".");
16576
17748
  }
16577
17749
  }
17750
+ clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac;
17751
+ if ("featuredTags" in values && values.featuredTags != null) {
17752
+ if (values.featuredTags instanceof Collection ||
17753
+ values.featuredTags instanceof URL) {
17754
+ // @ts-ignore: type is checked above.
17755
+ clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [values.featuredTags];
17756
+ }
17757
+ else {
17758
+ throw new TypeError("The featuredTags must be of type " +
17759
+ "Collection | URL" + ".");
17760
+ }
17761
+ }
16578
17762
  clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9;
16579
17763
  if ("streams" in values && values.streams != null) {
16580
17764
  if (Array.isArray(values.streams) &&
@@ -17206,6 +18390,64 @@ export class Organization extends Object {
17206
18390
  }
17207
18391
  return v;
17208
18392
  }
18393
+ async #fetchFeaturedTags(url, options = {}) {
18394
+ const documentLoader = options.documentLoader ?? this._documentLoader ??
18395
+ fetchDocumentLoader;
18396
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
18397
+ fetchDocumentLoader;
18398
+ let fetchResult;
18399
+ try {
18400
+ fetchResult = await documentLoader(url.href);
18401
+ }
18402
+ catch (error) {
18403
+ if (options.suppressError) {
18404
+ getLogger(["fedify", "vocab"]).error("Failed to fetch {url}: {error}", { error, url: url.href });
18405
+ return null;
18406
+ }
18407
+ throw error;
18408
+ }
18409
+ const { document } = fetchResult;
18410
+ try {
18411
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
18412
+ }
18413
+ catch (e) {
18414
+ if (!(e instanceof TypeError))
18415
+ throw e;
18416
+ }
18417
+ throw new TypeError("Expected an object of any type of: " +
18418
+ ["https://www.w3.org/ns/activitystreams#Collection"].join(", "));
18419
+ }
18420
+ /**
18421
+ * Similar to
18422
+ * {@link Organization.getFeaturedTags},
18423
+ * but returns its `@id` URL instead of the object itself.
18424
+ */
18425
+ get featuredTagsId() {
18426
+ if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length < 1)
18427
+ return null;
18428
+ const v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
18429
+ if (v instanceof URL)
18430
+ return v;
18431
+ return v.id;
18432
+ }
18433
+ /** What is known in Mastodon as "featured hashtags", hashtags that are featured
18434
+ * at people's profiles, is implemented using an extra property `featuredTags`
18435
+ * on the actor object that points to a {@link Collection} of {@link Hashtag}
18436
+ * objects specifically.
18437
+ */
18438
+ async getFeaturedTags(options = {}) {
18439
+ if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length < 1)
18440
+ return null;
18441
+ const v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
18442
+ if (v instanceof URL) {
18443
+ const fetched = await this.#fetchFeaturedTags(v, options);
18444
+ if (fetched == null)
18445
+ return null;
18446
+ this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0] = fetched;
18447
+ return fetched;
18448
+ }
18449
+ return v;
18450
+ }
17209
18451
  async #fetchStream(url, options = {}) {
17210
18452
  const documentLoader = options.documentLoader ?? this._documentLoader ??
17211
18453
  fetchDocumentLoader;
@@ -17334,8 +18576,9 @@ export class Organization extends Object {
17334
18576
  : await v.toJsonLd(options);
17335
18577
  array.push(element);
17336
18578
  }
17337
- if (array.length > 0)
18579
+ if (array.length > 0) {
17338
18580
  values["https://w3id.org/security#publicKey"] = array;
18581
+ }
17339
18582
  array = [];
17340
18583
  for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3) {
17341
18584
  const element = v instanceof URL
@@ -17361,8 +18604,9 @@ export class Organization extends Object {
17361
18604
  : await v.toJsonLd(options);
17362
18605
  array.push(element);
17363
18606
  }
17364
- if (array.length > 0)
18607
+ if (array.length > 0) {
17365
18608
  values["http://www.w3.org/ns/ldp#inbox"] = array;
18609
+ }
17366
18610
  array = [];
17367
18611
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC) {
17368
18612
  const element = v instanceof URL
@@ -17410,8 +18654,19 @@ export class Organization extends Object {
17410
18654
  : await v.toJsonLd(options);
17411
18655
  array.push(element);
17412
18656
  }
17413
- if (array.length > 0)
18657
+ if (array.length > 0) {
17414
18658
  values["http://joinmastodon.org/ns#featured"] = array;
18659
+ }
18660
+ array = [];
18661
+ for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac) {
18662
+ const element = v instanceof URL
18663
+ ? { "@id": v.href }
18664
+ : await v.toJsonLd(options);
18665
+ array.push(element);
18666
+ }
18667
+ if (array.length > 0) {
18668
+ values["http://joinmastodon.org/ns#featuredTags"] = array;
18669
+ }
17415
18670
  array = [];
17416
18671
  for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9) {
17417
18672
  const element = v instanceof URL
@@ -17451,8 +18706,9 @@ export class Organization extends Object {
17451
18706
  const element = { "@value": v };
17452
18707
  array.push(element);
17453
18708
  }
17454
- if (array.length > 0)
18709
+ if (array.length > 0) {
17455
18710
  values["http://joinmastodon.org/ns#memorial"] = array;
18711
+ }
17456
18712
  array = [];
17457
18713
  for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk) {
17458
18714
  const element = { "@value": v };
@@ -17478,6 +18734,7 @@ export class Organization extends Object {
17478
18734
  "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
17479
18735
  "toot": "http://joinmastodon.org/ns#",
17480
18736
  "featured": { "@id": "toot:featured", "@type": "@id" },
18737
+ "featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
17481
18738
  "discoverable": "toot:discoverable",
17482
18739
  "suspended": "toot:suspended",
17483
18740
  "memorial": "toot:memorial",
@@ -17529,8 +18786,13 @@ export class Organization extends Object {
17529
18786
  throw new TypeError("Unexpected type: " + instance.constructor.name);
17530
18787
  }
17531
18788
  const _3isuDgRAKSntq9XdbjiNxjwyPZAf = [];
17532
- for (const v of values["https://www.w3.org/ns/activitystreams#preferredUsername"] ??
17533
- []) {
18789
+ const _3isuDgRAKSntq9XdbjiNxjwyPZAf__array = values["https://www.w3.org/ns/activitystreams#preferredUsername"];
18790
+ for (const v of _3isuDgRAKSntq9XdbjiNxjwyPZAf__array == null
18791
+ ? []
18792
+ : _3isuDgRAKSntq9XdbjiNxjwyPZAf__array.length === 1 &&
18793
+ "@list" in _3isuDgRAKSntq9XdbjiNxjwyPZAf__array[0]
18794
+ ? _3isuDgRAKSntq9XdbjiNxjwyPZAf__array[0]["@list"]
18795
+ : _3isuDgRAKSntq9XdbjiNxjwyPZAf__array) {
17534
18796
  if (v == null)
17535
18797
  continue;
17536
18798
  const decoded = typeof v === "object" && "@value" in v &&
@@ -17547,7 +18809,13 @@ export class Organization extends Object {
17547
18809
  }
17548
18810
  instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = _3isuDgRAKSntq9XdbjiNxjwyPZAf;
17549
18811
  const _axq166E2eZADq34V4MYUc8KMZdC = [];
17550
- for (const v of values["https://w3id.org/security#publicKey"] ?? []) {
18812
+ const _axq166E2eZADq34V4MYUc8KMZdC__array = values["https://w3id.org/security#publicKey"];
18813
+ for (const v of _axq166E2eZADq34V4MYUc8KMZdC__array == null
18814
+ ? []
18815
+ : _axq166E2eZADq34V4MYUc8KMZdC__array.length === 1 &&
18816
+ "@list" in _axq166E2eZADq34V4MYUc8KMZdC__array[0]
18817
+ ? _axq166E2eZADq34V4MYUc8KMZdC__array[0]["@list"]
18818
+ : _axq166E2eZADq34V4MYUc8KMZdC__array) {
17551
18819
  if (v == null)
17552
18820
  continue;
17553
18821
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -17559,7 +18827,13 @@ export class Organization extends Object {
17559
18827
  }
17560
18828
  instance.#_axq166E2eZADq34V4MYUc8KMZdC = _axq166E2eZADq34V4MYUc8KMZdC;
17561
18829
  const _4EHQFWZSz1k1d4LmPrQiMba2GbP3 = [];
17562
- for (const v of values["https://w3id.org/security#assertionMethod"] ?? []) {
18830
+ const _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array = values["https://w3id.org/security#assertionMethod"];
18831
+ for (const v of _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array == null
18832
+ ? []
18833
+ : _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array.length === 1 &&
18834
+ "@list" in _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array[0]
18835
+ ? _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array[0]["@list"]
18836
+ : _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array) {
17563
18837
  if (v == null)
17564
18838
  continue;
17565
18839
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -17571,14 +18845,26 @@ export class Organization extends Object {
17571
18845
  }
17572
18846
  instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3 = _4EHQFWZSz1k1d4LmPrQiMba2GbP3;
17573
18847
  const _36QNc9MxfkKf6h8sEUQSHnV9NZA = [];
17574
- for (const v of values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"] ?? []) {
18848
+ const _36QNc9MxfkKf6h8sEUQSHnV9NZA__array = values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"];
18849
+ for (const v of _36QNc9MxfkKf6h8sEUQSHnV9NZA__array == null
18850
+ ? []
18851
+ : _36QNc9MxfkKf6h8sEUQSHnV9NZA__array.length === 1 &&
18852
+ "@list" in _36QNc9MxfkKf6h8sEUQSHnV9NZA__array[0]
18853
+ ? _36QNc9MxfkKf6h8sEUQSHnV9NZA__array[0]["@list"]
18854
+ : _36QNc9MxfkKf6h8sEUQSHnV9NZA__array) {
17575
18855
  if (v == null)
17576
18856
  continue;
17577
18857
  _36QNc9MxfkKf6h8sEUQSHnV9NZA.push(v["@value"]);
17578
18858
  }
17579
18859
  instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA = _36QNc9MxfkKf6h8sEUQSHnV9NZA;
17580
18860
  const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB = [];
17581
- for (const v of values["http://www.w3.org/ns/ldp#inbox"] ?? []) {
18861
+ const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array = values["http://www.w3.org/ns/ldp#inbox"];
18862
+ for (const v of _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array == null
18863
+ ? []
18864
+ : _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array.length === 1 &&
18865
+ "@list" in _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array[0]
18866
+ ? _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array[0]["@list"]
18867
+ : _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array) {
17582
18868
  if (v == null)
17583
18869
  continue;
17584
18870
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -17590,7 +18876,13 @@ export class Organization extends Object {
17590
18876
  }
17591
18877
  instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB;
17592
18878
  const _41QwhqJouoLg3h8dRPKat21brynC = [];
17593
- for (const v of values["https://www.w3.org/ns/activitystreams#outbox"] ?? []) {
18879
+ const _41QwhqJouoLg3h8dRPKat21brynC__array = values["https://www.w3.org/ns/activitystreams#outbox"];
18880
+ for (const v of _41QwhqJouoLg3h8dRPKat21brynC__array == null
18881
+ ? []
18882
+ : _41QwhqJouoLg3h8dRPKat21brynC__array.length === 1 &&
18883
+ "@list" in _41QwhqJouoLg3h8dRPKat21brynC__array[0]
18884
+ ? _41QwhqJouoLg3h8dRPKat21brynC__array[0]["@list"]
18885
+ : _41QwhqJouoLg3h8dRPKat21brynC__array) {
17594
18886
  if (v == null)
17595
18887
  continue;
17596
18888
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -17602,7 +18894,13 @@ export class Organization extends Object {
17602
18894
  }
17603
18895
  instance.#_41QwhqJouoLg3h8dRPKat21brynC = _41QwhqJouoLg3h8dRPKat21brynC;
17604
18896
  const _3yAv8jymNfNuJUDuBzJ1NQhdbAee = [];
17605
- for (const v of values["https://www.w3.org/ns/activitystreams#following"] ?? []) {
18897
+ const _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array = values["https://www.w3.org/ns/activitystreams#following"];
18898
+ for (const v of _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array == null
18899
+ ? []
18900
+ : _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array.length === 1 &&
18901
+ "@list" in _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array[0]
18902
+ ? _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array[0]["@list"]
18903
+ : _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array) {
17606
18904
  if (v == null)
17607
18905
  continue;
17608
18906
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -17614,7 +18912,13 @@ export class Organization extends Object {
17614
18912
  }
17615
18913
  instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee = _3yAv8jymNfNuJUDuBzJ1NQhdbAee;
17616
18914
  const _BBCTgfphhsFzpVfKTykGSpBNwoA = [];
17617
- for (const v of values["https://www.w3.org/ns/activitystreams#followers"] ?? []) {
18915
+ const _BBCTgfphhsFzpVfKTykGSpBNwoA__array = values["https://www.w3.org/ns/activitystreams#followers"];
18916
+ for (const v of _BBCTgfphhsFzpVfKTykGSpBNwoA__array == null
18917
+ ? []
18918
+ : _BBCTgfphhsFzpVfKTykGSpBNwoA__array.length === 1 &&
18919
+ "@list" in _BBCTgfphhsFzpVfKTykGSpBNwoA__array[0]
18920
+ ? _BBCTgfphhsFzpVfKTykGSpBNwoA__array[0]["@list"]
18921
+ : _BBCTgfphhsFzpVfKTykGSpBNwoA__array) {
17618
18922
  if (v == null)
17619
18923
  continue;
17620
18924
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -17626,7 +18930,13 @@ export class Organization extends Object {
17626
18930
  }
17627
18931
  instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA = _BBCTgfphhsFzpVfKTykGSpBNwoA;
17628
18932
  const _3bgkPwJanyTCoVFM9ovRcus8tKkU = [];
17629
- for (const v of values["https://www.w3.org/ns/activitystreams#liked"] ?? []) {
18933
+ const _3bgkPwJanyTCoVFM9ovRcus8tKkU__array = values["https://www.w3.org/ns/activitystreams#liked"];
18934
+ for (const v of _3bgkPwJanyTCoVFM9ovRcus8tKkU__array == null
18935
+ ? []
18936
+ : _3bgkPwJanyTCoVFM9ovRcus8tKkU__array.length === 1 &&
18937
+ "@list" in _3bgkPwJanyTCoVFM9ovRcus8tKkU__array[0]
18938
+ ? _3bgkPwJanyTCoVFM9ovRcus8tKkU__array[0]["@list"]
18939
+ : _3bgkPwJanyTCoVFM9ovRcus8tKkU__array) {
17630
18940
  if (v == null)
17631
18941
  continue;
17632
18942
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -17638,7 +18948,13 @@ export class Organization extends Object {
17638
18948
  }
17639
18949
  instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU = _3bgkPwJanyTCoVFM9ovRcus8tKkU;
17640
18950
  const _4N1vBJzXDf8NbBumeECQMFvKetja = [];
17641
- for (const v of values["http://joinmastodon.org/ns#featured"] ?? []) {
18951
+ const _4N1vBJzXDf8NbBumeECQMFvKetja__array = values["http://joinmastodon.org/ns#featured"];
18952
+ for (const v of _4N1vBJzXDf8NbBumeECQMFvKetja__array == null
18953
+ ? []
18954
+ : _4N1vBJzXDf8NbBumeECQMFvKetja__array.length === 1 &&
18955
+ "@list" in _4N1vBJzXDf8NbBumeECQMFvKetja__array[0]
18956
+ ? _4N1vBJzXDf8NbBumeECQMFvKetja__array[0]["@list"]
18957
+ : _4N1vBJzXDf8NbBumeECQMFvKetja__array) {
17642
18958
  if (v == null)
17643
18959
  continue;
17644
18960
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -17649,8 +18965,32 @@ export class Organization extends Object {
17649
18965
  _4N1vBJzXDf8NbBumeECQMFvKetja.push(await Collection.fromJsonLd(v, options));
17650
18966
  }
17651
18967
  instance.#_4N1vBJzXDf8NbBumeECQMFvKetja = _4N1vBJzXDf8NbBumeECQMFvKetja;
18968
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac = [];
18969
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array = values["http://joinmastodon.org/ns#featuredTags"];
18970
+ for (const v of _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array == null
18971
+ ? []
18972
+ : _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array.length === 1 &&
18973
+ "@list" in _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array[0]
18974
+ ? _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array[0]["@list"]
18975
+ : _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array) {
18976
+ if (v == null)
18977
+ continue;
18978
+ if (typeof v === "object" && "@id" in v && !("@type" in v) &&
18979
+ globalThis.Object.keys(v).length === 1) {
18980
+ _2MxnRRLq9iPzx5CFq2NPrXdUDCac.push(new URL(v["@id"]));
18981
+ continue;
18982
+ }
18983
+ _2MxnRRLq9iPzx5CFq2NPrXdUDCac.push(await Collection.fromJsonLd(v, options));
18984
+ }
18985
+ instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = _2MxnRRLq9iPzx5CFq2NPrXdUDCac;
17652
18986
  const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = [];
17653
- for (const v of values["https://www.w3.org/ns/activitystreams#streams"] ?? []) {
18987
+ const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array = values["https://www.w3.org/ns/activitystreams#streams"];
18988
+ for (const v of _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array == null
18989
+ ? []
18990
+ : _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array.length === 1 &&
18991
+ "@list" in _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array[0]
18992
+ ? _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array[0]["@list"]
18993
+ : _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array) {
17654
18994
  if (v == null)
17655
18995
  continue;
17656
18996
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -17662,35 +19002,65 @@ export class Organization extends Object {
17662
19002
  }
17663
19003
  instance.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = _3sG2Hdwn9qzKGu9mpYkqakAMUkH9;
17664
19004
  const _sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [];
17665
- for (const v of values["https://www.w3.org/ns/activitystreams#endpoints"] ?? []) {
19005
+ const _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array = values["https://www.w3.org/ns/activitystreams#endpoints"];
19006
+ for (const v of _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array == null
19007
+ ? []
19008
+ : _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array.length === 1 &&
19009
+ "@list" in _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array[0]
19010
+ ? _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array[0]["@list"]
19011
+ : _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array) {
17666
19012
  if (v == null)
17667
19013
  continue;
17668
19014
  _sEoQwUbfk4hEfugzNQ2ZiDcLMkG.push(await Endpoints.fromJsonLd(v, options));
17669
19015
  }
17670
19016
  instance.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG;
17671
19017
  const _gAJzg1QDc4rcefFsUzGSYmyXvNH = [];
17672
- for (const v of values["http://joinmastodon.org/ns#discoverable"] ?? []) {
19018
+ const _gAJzg1QDc4rcefFsUzGSYmyXvNH__array = values["http://joinmastodon.org/ns#discoverable"];
19019
+ for (const v of _gAJzg1QDc4rcefFsUzGSYmyXvNH__array == null
19020
+ ? []
19021
+ : _gAJzg1QDc4rcefFsUzGSYmyXvNH__array.length === 1 &&
19022
+ "@list" in _gAJzg1QDc4rcefFsUzGSYmyXvNH__array[0]
19023
+ ? _gAJzg1QDc4rcefFsUzGSYmyXvNH__array[0]["@list"]
19024
+ : _gAJzg1QDc4rcefFsUzGSYmyXvNH__array) {
17673
19025
  if (v == null)
17674
19026
  continue;
17675
19027
  _gAJzg1QDc4rcefFsUzGSYmyXvNH.push(v["@value"]);
17676
19028
  }
17677
19029
  instance.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = _gAJzg1QDc4rcefFsUzGSYmyXvNH;
17678
19030
  const _2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [];
17679
- for (const v of values["http://joinmastodon.org/ns#suspended"] ?? []) {
19031
+ const _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array = values["http://joinmastodon.org/ns#suspended"];
19032
+ for (const v of _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array == null
19033
+ ? []
19034
+ : _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array.length === 1 &&
19035
+ "@list" in _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array[0]
19036
+ ? _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array[0]["@list"]
19037
+ : _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array) {
17680
19038
  if (v == null)
17681
19039
  continue;
17682
19040
  _2kGKkJtoFWg8c18PaVSqj9NKP4t7.push(v["@value"]);
17683
19041
  }
17684
19042
  instance.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = _2kGKkJtoFWg8c18PaVSqj9NKP4t7;
17685
19043
  const _79S8K4f5J9MWUgCxziRyUe6PTHZ = [];
17686
- for (const v of values["http://joinmastodon.org/ns#memorial"] ?? []) {
19044
+ const _79S8K4f5J9MWUgCxziRyUe6PTHZ__array = values["http://joinmastodon.org/ns#memorial"];
19045
+ for (const v of _79S8K4f5J9MWUgCxziRyUe6PTHZ__array == null
19046
+ ? []
19047
+ : _79S8K4f5J9MWUgCxziRyUe6PTHZ__array.length === 1 &&
19048
+ "@list" in _79S8K4f5J9MWUgCxziRyUe6PTHZ__array[0]
19049
+ ? _79S8K4f5J9MWUgCxziRyUe6PTHZ__array[0]["@list"]
19050
+ : _79S8K4f5J9MWUgCxziRyUe6PTHZ__array) {
17687
19051
  if (v == null)
17688
19052
  continue;
17689
19053
  _79S8K4f5J9MWUgCxziRyUe6PTHZ.push(v["@value"]);
17690
19054
  }
17691
19055
  instance.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = _79S8K4f5J9MWUgCxziRyUe6PTHZ;
17692
19056
  const _2diCorzqPGQQqftp6e4SrCEwEnyk = [];
17693
- for (const v of values["http://joinmastodon.org/ns#indexable"] ?? []) {
19057
+ const _2diCorzqPGQQqftp6e4SrCEwEnyk__array = values["http://joinmastodon.org/ns#indexable"];
19058
+ for (const v of _2diCorzqPGQQqftp6e4SrCEwEnyk__array == null
19059
+ ? []
19060
+ : _2diCorzqPGQQqftp6e4SrCEwEnyk__array.length === 1 &&
19061
+ "@list" in _2diCorzqPGQQqftp6e4SrCEwEnyk__array[0]
19062
+ ? _2diCorzqPGQQqftp6e4SrCEwEnyk__array[0]["@list"]
19063
+ : _2diCorzqPGQQqftp6e4SrCEwEnyk__array) {
17694
19064
  if (v == null)
17695
19065
  continue;
17696
19066
  _2diCorzqPGQQqftp6e4SrCEwEnyk.push(v["@value"]);
@@ -17825,6 +19195,17 @@ export class Organization extends Object {
17825
19195
  if (_4N1vBJzXDf8NbBumeECQMFvKetja.length == 1) {
17826
19196
  proxy.featured = _4N1vBJzXDf8NbBumeECQMFvKetja[0];
17827
19197
  }
19198
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac
19199
+ // deno-lint-ignore no-explicit-any
19200
+ .map((v) => v instanceof URL
19201
+ ? {
19202
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
19203
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
19204
+ }
19205
+ : v);
19206
+ if (_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length == 1) {
19207
+ proxy.featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
19208
+ }
17828
19209
  const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9
17829
19210
  // deno-lint-ignore no-explicit-any
17830
19211
  .map((v) => v instanceof URL
@@ -18033,6 +19414,7 @@ export class Person extends Object {
18033
19414
  #_BBCTgfphhsFzpVfKTykGSpBNwoA = [];
18034
19415
  #_3bgkPwJanyTCoVFM9ovRcus8tKkU = [];
18035
19416
  #_4N1vBJzXDf8NbBumeECQMFvKetja = [];
19417
+ #_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [];
18036
19418
  #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = [];
18037
19419
  #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [];
18038
19420
  #_gAJzg1QDc4rcefFsUzGSYmyXvNH = [];
@@ -18201,6 +19583,17 @@ export class Person extends Object {
18201
19583
  "Collection | URL" + ".");
18202
19584
  }
18203
19585
  }
19586
+ if ("featuredTags" in values && values.featuredTags != null) {
19587
+ if (values.featuredTags instanceof Collection ||
19588
+ values.featuredTags instanceof URL) {
19589
+ // @ts-ignore: type is checked above.
19590
+ this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [values.featuredTags];
19591
+ }
19592
+ else {
19593
+ throw new TypeError("The featuredTags must be of type " +
19594
+ "Collection | URL" + ".");
19595
+ }
19596
+ }
18204
19597
  if ("streams" in values && values.streams != null) {
18205
19598
  if (Array.isArray(values.streams) &&
18206
19599
  values.streams.every((v) => v instanceof Collection || v instanceof URL)) {
@@ -18438,6 +19831,18 @@ export class Person extends Object {
18438
19831
  "Collection | URL" + ".");
18439
19832
  }
18440
19833
  }
19834
+ clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac;
19835
+ if ("featuredTags" in values && values.featuredTags != null) {
19836
+ if (values.featuredTags instanceof Collection ||
19837
+ values.featuredTags instanceof URL) {
19838
+ // @ts-ignore: type is checked above.
19839
+ clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [values.featuredTags];
19840
+ }
19841
+ else {
19842
+ throw new TypeError("The featuredTags must be of type " +
19843
+ "Collection | URL" + ".");
19844
+ }
19845
+ }
18441
19846
  clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9;
18442
19847
  if ("streams" in values && values.streams != null) {
18443
19848
  if (Array.isArray(values.streams) &&
@@ -19069,6 +20474,64 @@ export class Person extends Object {
19069
20474
  }
19070
20475
  return v;
19071
20476
  }
20477
+ async #fetchFeaturedTags(url, options = {}) {
20478
+ const documentLoader = options.documentLoader ?? this._documentLoader ??
20479
+ fetchDocumentLoader;
20480
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
20481
+ fetchDocumentLoader;
20482
+ let fetchResult;
20483
+ try {
20484
+ fetchResult = await documentLoader(url.href);
20485
+ }
20486
+ catch (error) {
20487
+ if (options.suppressError) {
20488
+ getLogger(["fedify", "vocab"]).error("Failed to fetch {url}: {error}", { error, url: url.href });
20489
+ return null;
20490
+ }
20491
+ throw error;
20492
+ }
20493
+ const { document } = fetchResult;
20494
+ try {
20495
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
20496
+ }
20497
+ catch (e) {
20498
+ if (!(e instanceof TypeError))
20499
+ throw e;
20500
+ }
20501
+ throw new TypeError("Expected an object of any type of: " +
20502
+ ["https://www.w3.org/ns/activitystreams#Collection"].join(", "));
20503
+ }
20504
+ /**
20505
+ * Similar to
20506
+ * {@link Person.getFeaturedTags},
20507
+ * but returns its `@id` URL instead of the object itself.
20508
+ */
20509
+ get featuredTagsId() {
20510
+ if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length < 1)
20511
+ return null;
20512
+ const v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
20513
+ if (v instanceof URL)
20514
+ return v;
20515
+ return v.id;
20516
+ }
20517
+ /** What is known in Mastodon as "featured hashtags", hashtags that are featured
20518
+ * at people's profiles, is implemented using an extra property `featuredTags`
20519
+ * on the actor object that points to a {@link Collection} of {@link Hashtag}
20520
+ * objects specifically.
20521
+ */
20522
+ async getFeaturedTags(options = {}) {
20523
+ if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length < 1)
20524
+ return null;
20525
+ const v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
20526
+ if (v instanceof URL) {
20527
+ const fetched = await this.#fetchFeaturedTags(v, options);
20528
+ if (fetched == null)
20529
+ return null;
20530
+ this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0] = fetched;
20531
+ return fetched;
20532
+ }
20533
+ return v;
20534
+ }
19072
20535
  async #fetchStream(url, options = {}) {
19073
20536
  const documentLoader = options.documentLoader ?? this._documentLoader ??
19074
20537
  fetchDocumentLoader;
@@ -19197,8 +20660,9 @@ export class Person extends Object {
19197
20660
  : await v.toJsonLd(options);
19198
20661
  array.push(element);
19199
20662
  }
19200
- if (array.length > 0)
20663
+ if (array.length > 0) {
19201
20664
  values["https://w3id.org/security#publicKey"] = array;
20665
+ }
19202
20666
  array = [];
19203
20667
  for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3) {
19204
20668
  const element = v instanceof URL
@@ -19224,8 +20688,9 @@ export class Person extends Object {
19224
20688
  : await v.toJsonLd(options);
19225
20689
  array.push(element);
19226
20690
  }
19227
- if (array.length > 0)
20691
+ if (array.length > 0) {
19228
20692
  values["http://www.w3.org/ns/ldp#inbox"] = array;
20693
+ }
19229
20694
  array = [];
19230
20695
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC) {
19231
20696
  const element = v instanceof URL
@@ -19273,8 +20738,19 @@ export class Person extends Object {
19273
20738
  : await v.toJsonLd(options);
19274
20739
  array.push(element);
19275
20740
  }
19276
- if (array.length > 0)
20741
+ if (array.length > 0) {
19277
20742
  values["http://joinmastodon.org/ns#featured"] = array;
20743
+ }
20744
+ array = [];
20745
+ for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac) {
20746
+ const element = v instanceof URL
20747
+ ? { "@id": v.href }
20748
+ : await v.toJsonLd(options);
20749
+ array.push(element);
20750
+ }
20751
+ if (array.length > 0) {
20752
+ values["http://joinmastodon.org/ns#featuredTags"] = array;
20753
+ }
19278
20754
  array = [];
19279
20755
  for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9) {
19280
20756
  const element = v instanceof URL
@@ -19314,8 +20790,9 @@ export class Person extends Object {
19314
20790
  const element = { "@value": v };
19315
20791
  array.push(element);
19316
20792
  }
19317
- if (array.length > 0)
20793
+ if (array.length > 0) {
19318
20794
  values["http://joinmastodon.org/ns#memorial"] = array;
20795
+ }
19319
20796
  array = [];
19320
20797
  for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk) {
19321
20798
  const element = { "@value": v };
@@ -19341,6 +20818,7 @@ export class Person extends Object {
19341
20818
  "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
19342
20819
  "toot": "http://joinmastodon.org/ns#",
19343
20820
  "featured": { "@id": "toot:featured", "@type": "@id" },
20821
+ "featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
19344
20822
  "discoverable": "toot:discoverable",
19345
20823
  "suspended": "toot:suspended",
19346
20824
  "memorial": "toot:memorial",
@@ -19392,8 +20870,13 @@ export class Person extends Object {
19392
20870
  throw new TypeError("Unexpected type: " + instance.constructor.name);
19393
20871
  }
19394
20872
  const _3isuDgRAKSntq9XdbjiNxjwyPZAf = [];
19395
- for (const v of values["https://www.w3.org/ns/activitystreams#preferredUsername"] ??
19396
- []) {
20873
+ const _3isuDgRAKSntq9XdbjiNxjwyPZAf__array = values["https://www.w3.org/ns/activitystreams#preferredUsername"];
20874
+ for (const v of _3isuDgRAKSntq9XdbjiNxjwyPZAf__array == null
20875
+ ? []
20876
+ : _3isuDgRAKSntq9XdbjiNxjwyPZAf__array.length === 1 &&
20877
+ "@list" in _3isuDgRAKSntq9XdbjiNxjwyPZAf__array[0]
20878
+ ? _3isuDgRAKSntq9XdbjiNxjwyPZAf__array[0]["@list"]
20879
+ : _3isuDgRAKSntq9XdbjiNxjwyPZAf__array) {
19397
20880
  if (v == null)
19398
20881
  continue;
19399
20882
  const decoded = typeof v === "object" && "@value" in v &&
@@ -19410,7 +20893,13 @@ export class Person extends Object {
19410
20893
  }
19411
20894
  instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = _3isuDgRAKSntq9XdbjiNxjwyPZAf;
19412
20895
  const _axq166E2eZADq34V4MYUc8KMZdC = [];
19413
- for (const v of values["https://w3id.org/security#publicKey"] ?? []) {
20896
+ const _axq166E2eZADq34V4MYUc8KMZdC__array = values["https://w3id.org/security#publicKey"];
20897
+ for (const v of _axq166E2eZADq34V4MYUc8KMZdC__array == null
20898
+ ? []
20899
+ : _axq166E2eZADq34V4MYUc8KMZdC__array.length === 1 &&
20900
+ "@list" in _axq166E2eZADq34V4MYUc8KMZdC__array[0]
20901
+ ? _axq166E2eZADq34V4MYUc8KMZdC__array[0]["@list"]
20902
+ : _axq166E2eZADq34V4MYUc8KMZdC__array) {
19414
20903
  if (v == null)
19415
20904
  continue;
19416
20905
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -19422,7 +20911,13 @@ export class Person extends Object {
19422
20911
  }
19423
20912
  instance.#_axq166E2eZADq34V4MYUc8KMZdC = _axq166E2eZADq34V4MYUc8KMZdC;
19424
20913
  const _4EHQFWZSz1k1d4LmPrQiMba2GbP3 = [];
19425
- for (const v of values["https://w3id.org/security#assertionMethod"] ?? []) {
20914
+ const _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array = values["https://w3id.org/security#assertionMethod"];
20915
+ for (const v of _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array == null
20916
+ ? []
20917
+ : _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array.length === 1 &&
20918
+ "@list" in _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array[0]
20919
+ ? _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array[0]["@list"]
20920
+ : _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array) {
19426
20921
  if (v == null)
19427
20922
  continue;
19428
20923
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -19434,14 +20929,26 @@ export class Person extends Object {
19434
20929
  }
19435
20930
  instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3 = _4EHQFWZSz1k1d4LmPrQiMba2GbP3;
19436
20931
  const _36QNc9MxfkKf6h8sEUQSHnV9NZA = [];
19437
- for (const v of values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"] ?? []) {
20932
+ const _36QNc9MxfkKf6h8sEUQSHnV9NZA__array = values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"];
20933
+ for (const v of _36QNc9MxfkKf6h8sEUQSHnV9NZA__array == null
20934
+ ? []
20935
+ : _36QNc9MxfkKf6h8sEUQSHnV9NZA__array.length === 1 &&
20936
+ "@list" in _36QNc9MxfkKf6h8sEUQSHnV9NZA__array[0]
20937
+ ? _36QNc9MxfkKf6h8sEUQSHnV9NZA__array[0]["@list"]
20938
+ : _36QNc9MxfkKf6h8sEUQSHnV9NZA__array) {
19438
20939
  if (v == null)
19439
20940
  continue;
19440
20941
  _36QNc9MxfkKf6h8sEUQSHnV9NZA.push(v["@value"]);
19441
20942
  }
19442
20943
  instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA = _36QNc9MxfkKf6h8sEUQSHnV9NZA;
19443
20944
  const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB = [];
19444
- for (const v of values["http://www.w3.org/ns/ldp#inbox"] ?? []) {
20945
+ const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array = values["http://www.w3.org/ns/ldp#inbox"];
20946
+ for (const v of _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array == null
20947
+ ? []
20948
+ : _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array.length === 1 &&
20949
+ "@list" in _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array[0]
20950
+ ? _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array[0]["@list"]
20951
+ : _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array) {
19445
20952
  if (v == null)
19446
20953
  continue;
19447
20954
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -19453,7 +20960,13 @@ export class Person extends Object {
19453
20960
  }
19454
20961
  instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB;
19455
20962
  const _41QwhqJouoLg3h8dRPKat21brynC = [];
19456
- for (const v of values["https://www.w3.org/ns/activitystreams#outbox"] ?? []) {
20963
+ const _41QwhqJouoLg3h8dRPKat21brynC__array = values["https://www.w3.org/ns/activitystreams#outbox"];
20964
+ for (const v of _41QwhqJouoLg3h8dRPKat21brynC__array == null
20965
+ ? []
20966
+ : _41QwhqJouoLg3h8dRPKat21brynC__array.length === 1 &&
20967
+ "@list" in _41QwhqJouoLg3h8dRPKat21brynC__array[0]
20968
+ ? _41QwhqJouoLg3h8dRPKat21brynC__array[0]["@list"]
20969
+ : _41QwhqJouoLg3h8dRPKat21brynC__array) {
19457
20970
  if (v == null)
19458
20971
  continue;
19459
20972
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -19465,7 +20978,13 @@ export class Person extends Object {
19465
20978
  }
19466
20979
  instance.#_41QwhqJouoLg3h8dRPKat21brynC = _41QwhqJouoLg3h8dRPKat21brynC;
19467
20980
  const _3yAv8jymNfNuJUDuBzJ1NQhdbAee = [];
19468
- for (const v of values["https://www.w3.org/ns/activitystreams#following"] ?? []) {
20981
+ const _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array = values["https://www.w3.org/ns/activitystreams#following"];
20982
+ for (const v of _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array == null
20983
+ ? []
20984
+ : _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array.length === 1 &&
20985
+ "@list" in _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array[0]
20986
+ ? _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array[0]["@list"]
20987
+ : _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array) {
19469
20988
  if (v == null)
19470
20989
  continue;
19471
20990
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -19477,7 +20996,13 @@ export class Person extends Object {
19477
20996
  }
19478
20997
  instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee = _3yAv8jymNfNuJUDuBzJ1NQhdbAee;
19479
20998
  const _BBCTgfphhsFzpVfKTykGSpBNwoA = [];
19480
- for (const v of values["https://www.w3.org/ns/activitystreams#followers"] ?? []) {
20999
+ const _BBCTgfphhsFzpVfKTykGSpBNwoA__array = values["https://www.w3.org/ns/activitystreams#followers"];
21000
+ for (const v of _BBCTgfphhsFzpVfKTykGSpBNwoA__array == null
21001
+ ? []
21002
+ : _BBCTgfphhsFzpVfKTykGSpBNwoA__array.length === 1 &&
21003
+ "@list" in _BBCTgfphhsFzpVfKTykGSpBNwoA__array[0]
21004
+ ? _BBCTgfphhsFzpVfKTykGSpBNwoA__array[0]["@list"]
21005
+ : _BBCTgfphhsFzpVfKTykGSpBNwoA__array) {
19481
21006
  if (v == null)
19482
21007
  continue;
19483
21008
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -19489,7 +21014,13 @@ export class Person extends Object {
19489
21014
  }
19490
21015
  instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA = _BBCTgfphhsFzpVfKTykGSpBNwoA;
19491
21016
  const _3bgkPwJanyTCoVFM9ovRcus8tKkU = [];
19492
- for (const v of values["https://www.w3.org/ns/activitystreams#liked"] ?? []) {
21017
+ const _3bgkPwJanyTCoVFM9ovRcus8tKkU__array = values["https://www.w3.org/ns/activitystreams#liked"];
21018
+ for (const v of _3bgkPwJanyTCoVFM9ovRcus8tKkU__array == null
21019
+ ? []
21020
+ : _3bgkPwJanyTCoVFM9ovRcus8tKkU__array.length === 1 &&
21021
+ "@list" in _3bgkPwJanyTCoVFM9ovRcus8tKkU__array[0]
21022
+ ? _3bgkPwJanyTCoVFM9ovRcus8tKkU__array[0]["@list"]
21023
+ : _3bgkPwJanyTCoVFM9ovRcus8tKkU__array) {
19493
21024
  if (v == null)
19494
21025
  continue;
19495
21026
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -19501,7 +21032,13 @@ export class Person extends Object {
19501
21032
  }
19502
21033
  instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU = _3bgkPwJanyTCoVFM9ovRcus8tKkU;
19503
21034
  const _4N1vBJzXDf8NbBumeECQMFvKetja = [];
19504
- for (const v of values["http://joinmastodon.org/ns#featured"] ?? []) {
21035
+ const _4N1vBJzXDf8NbBumeECQMFvKetja__array = values["http://joinmastodon.org/ns#featured"];
21036
+ for (const v of _4N1vBJzXDf8NbBumeECQMFvKetja__array == null
21037
+ ? []
21038
+ : _4N1vBJzXDf8NbBumeECQMFvKetja__array.length === 1 &&
21039
+ "@list" in _4N1vBJzXDf8NbBumeECQMFvKetja__array[0]
21040
+ ? _4N1vBJzXDf8NbBumeECQMFvKetja__array[0]["@list"]
21041
+ : _4N1vBJzXDf8NbBumeECQMFvKetja__array) {
19505
21042
  if (v == null)
19506
21043
  continue;
19507
21044
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -19512,8 +21049,32 @@ export class Person extends Object {
19512
21049
  _4N1vBJzXDf8NbBumeECQMFvKetja.push(await Collection.fromJsonLd(v, options));
19513
21050
  }
19514
21051
  instance.#_4N1vBJzXDf8NbBumeECQMFvKetja = _4N1vBJzXDf8NbBumeECQMFvKetja;
21052
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac = [];
21053
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array = values["http://joinmastodon.org/ns#featuredTags"];
21054
+ for (const v of _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array == null
21055
+ ? []
21056
+ : _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array.length === 1 &&
21057
+ "@list" in _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array[0]
21058
+ ? _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array[0]["@list"]
21059
+ : _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array) {
21060
+ if (v == null)
21061
+ continue;
21062
+ if (typeof v === "object" && "@id" in v && !("@type" in v) &&
21063
+ globalThis.Object.keys(v).length === 1) {
21064
+ _2MxnRRLq9iPzx5CFq2NPrXdUDCac.push(new URL(v["@id"]));
21065
+ continue;
21066
+ }
21067
+ _2MxnRRLq9iPzx5CFq2NPrXdUDCac.push(await Collection.fromJsonLd(v, options));
21068
+ }
21069
+ instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = _2MxnRRLq9iPzx5CFq2NPrXdUDCac;
19515
21070
  const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = [];
19516
- for (const v of values["https://www.w3.org/ns/activitystreams#streams"] ?? []) {
21071
+ const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array = values["https://www.w3.org/ns/activitystreams#streams"];
21072
+ for (const v of _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array == null
21073
+ ? []
21074
+ : _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array.length === 1 &&
21075
+ "@list" in _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array[0]
21076
+ ? _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array[0]["@list"]
21077
+ : _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array) {
19517
21078
  if (v == null)
19518
21079
  continue;
19519
21080
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -19525,35 +21086,65 @@ export class Person extends Object {
19525
21086
  }
19526
21087
  instance.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = _3sG2Hdwn9qzKGu9mpYkqakAMUkH9;
19527
21088
  const _sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [];
19528
- for (const v of values["https://www.w3.org/ns/activitystreams#endpoints"] ?? []) {
21089
+ const _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array = values["https://www.w3.org/ns/activitystreams#endpoints"];
21090
+ for (const v of _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array == null
21091
+ ? []
21092
+ : _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array.length === 1 &&
21093
+ "@list" in _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array[0]
21094
+ ? _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array[0]["@list"]
21095
+ : _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array) {
19529
21096
  if (v == null)
19530
21097
  continue;
19531
21098
  _sEoQwUbfk4hEfugzNQ2ZiDcLMkG.push(await Endpoints.fromJsonLd(v, options));
19532
21099
  }
19533
21100
  instance.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG;
19534
21101
  const _gAJzg1QDc4rcefFsUzGSYmyXvNH = [];
19535
- for (const v of values["http://joinmastodon.org/ns#discoverable"] ?? []) {
21102
+ const _gAJzg1QDc4rcefFsUzGSYmyXvNH__array = values["http://joinmastodon.org/ns#discoverable"];
21103
+ for (const v of _gAJzg1QDc4rcefFsUzGSYmyXvNH__array == null
21104
+ ? []
21105
+ : _gAJzg1QDc4rcefFsUzGSYmyXvNH__array.length === 1 &&
21106
+ "@list" in _gAJzg1QDc4rcefFsUzGSYmyXvNH__array[0]
21107
+ ? _gAJzg1QDc4rcefFsUzGSYmyXvNH__array[0]["@list"]
21108
+ : _gAJzg1QDc4rcefFsUzGSYmyXvNH__array) {
19536
21109
  if (v == null)
19537
21110
  continue;
19538
21111
  _gAJzg1QDc4rcefFsUzGSYmyXvNH.push(v["@value"]);
19539
21112
  }
19540
21113
  instance.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = _gAJzg1QDc4rcefFsUzGSYmyXvNH;
19541
21114
  const _2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [];
19542
- for (const v of values["http://joinmastodon.org/ns#suspended"] ?? []) {
21115
+ const _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array = values["http://joinmastodon.org/ns#suspended"];
21116
+ for (const v of _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array == null
21117
+ ? []
21118
+ : _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array.length === 1 &&
21119
+ "@list" in _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array[0]
21120
+ ? _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array[0]["@list"]
21121
+ : _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array) {
19543
21122
  if (v == null)
19544
21123
  continue;
19545
21124
  _2kGKkJtoFWg8c18PaVSqj9NKP4t7.push(v["@value"]);
19546
21125
  }
19547
21126
  instance.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = _2kGKkJtoFWg8c18PaVSqj9NKP4t7;
19548
21127
  const _79S8K4f5J9MWUgCxziRyUe6PTHZ = [];
19549
- for (const v of values["http://joinmastodon.org/ns#memorial"] ?? []) {
21128
+ const _79S8K4f5J9MWUgCxziRyUe6PTHZ__array = values["http://joinmastodon.org/ns#memorial"];
21129
+ for (const v of _79S8K4f5J9MWUgCxziRyUe6PTHZ__array == null
21130
+ ? []
21131
+ : _79S8K4f5J9MWUgCxziRyUe6PTHZ__array.length === 1 &&
21132
+ "@list" in _79S8K4f5J9MWUgCxziRyUe6PTHZ__array[0]
21133
+ ? _79S8K4f5J9MWUgCxziRyUe6PTHZ__array[0]["@list"]
21134
+ : _79S8K4f5J9MWUgCxziRyUe6PTHZ__array) {
19550
21135
  if (v == null)
19551
21136
  continue;
19552
21137
  _79S8K4f5J9MWUgCxziRyUe6PTHZ.push(v["@value"]);
19553
21138
  }
19554
21139
  instance.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = _79S8K4f5J9MWUgCxziRyUe6PTHZ;
19555
21140
  const _2diCorzqPGQQqftp6e4SrCEwEnyk = [];
19556
- for (const v of values["http://joinmastodon.org/ns#indexable"] ?? []) {
21141
+ const _2diCorzqPGQQqftp6e4SrCEwEnyk__array = values["http://joinmastodon.org/ns#indexable"];
21142
+ for (const v of _2diCorzqPGQQqftp6e4SrCEwEnyk__array == null
21143
+ ? []
21144
+ : _2diCorzqPGQQqftp6e4SrCEwEnyk__array.length === 1 &&
21145
+ "@list" in _2diCorzqPGQQqftp6e4SrCEwEnyk__array[0]
21146
+ ? _2diCorzqPGQQqftp6e4SrCEwEnyk__array[0]["@list"]
21147
+ : _2diCorzqPGQQqftp6e4SrCEwEnyk__array) {
19557
21148
  if (v == null)
19558
21149
  continue;
19559
21150
  _2diCorzqPGQQqftp6e4SrCEwEnyk.push(v["@value"]);
@@ -19688,6 +21279,17 @@ export class Person extends Object {
19688
21279
  if (_4N1vBJzXDf8NbBumeECQMFvKetja.length == 1) {
19689
21280
  proxy.featured = _4N1vBJzXDf8NbBumeECQMFvKetja[0];
19690
21281
  }
21282
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac
21283
+ // deno-lint-ignore no-explicit-any
21284
+ .map((v) => v instanceof URL
21285
+ ? {
21286
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
21287
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
21288
+ }
21289
+ : v);
21290
+ if (_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length == 1) {
21291
+ proxy.featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
21292
+ }
19691
21293
  const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9
19692
21294
  // deno-lint-ignore no-explicit-any
19693
21295
  .map((v) => v instanceof URL
@@ -20119,42 +21721,78 @@ export class Place extends Object {
20119
21721
  throw new TypeError("Unexpected type: " + instance.constructor.name);
20120
21722
  }
20121
21723
  const _3UCsHnBHvDAXJnBuzw3zw1VVs3Ne = [];
20122
- for (const v of values["https://www.w3.org/ns/activitystreams#accuracy"] ?? []) {
21724
+ const _3UCsHnBHvDAXJnBuzw3zw1VVs3Ne__array = values["https://www.w3.org/ns/activitystreams#accuracy"];
21725
+ for (const v of _3UCsHnBHvDAXJnBuzw3zw1VVs3Ne__array == null
21726
+ ? []
21727
+ : _3UCsHnBHvDAXJnBuzw3zw1VVs3Ne__array.length === 1 &&
21728
+ "@list" in _3UCsHnBHvDAXJnBuzw3zw1VVs3Ne__array[0]
21729
+ ? _3UCsHnBHvDAXJnBuzw3zw1VVs3Ne__array[0]["@list"]
21730
+ : _3UCsHnBHvDAXJnBuzw3zw1VVs3Ne__array) {
20123
21731
  if (v == null)
20124
21732
  continue;
20125
21733
  _3UCsHnBHvDAXJnBuzw3zw1VVs3Ne.push(v["@value"]);
20126
21734
  }
20127
21735
  instance.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne = _3UCsHnBHvDAXJnBuzw3zw1VVs3Ne;
20128
21736
  const _3Q6KDcFQUJRRaBux1BL2yp5QWiBi = [];
20129
- for (const v of values["https://www.w3.org/ns/activitystreams#altitude"] ?? []) {
21737
+ const _3Q6KDcFQUJRRaBux1BL2yp5QWiBi__array = values["https://www.w3.org/ns/activitystreams#altitude"];
21738
+ for (const v of _3Q6KDcFQUJRRaBux1BL2yp5QWiBi__array == null
21739
+ ? []
21740
+ : _3Q6KDcFQUJRRaBux1BL2yp5QWiBi__array.length === 1 &&
21741
+ "@list" in _3Q6KDcFQUJRRaBux1BL2yp5QWiBi__array[0]
21742
+ ? _3Q6KDcFQUJRRaBux1BL2yp5QWiBi__array[0]["@list"]
21743
+ : _3Q6KDcFQUJRRaBux1BL2yp5QWiBi__array) {
20130
21744
  if (v == null)
20131
21745
  continue;
20132
21746
  _3Q6KDcFQUJRRaBux1BL2yp5QWiBi.push(v["@value"]);
20133
21747
  }
20134
21748
  instance.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi = _3Q6KDcFQUJRRaBux1BL2yp5QWiBi;
20135
21749
  const _3g85RoKRnaNjP7DFyLSvsWDg7HGM = [];
20136
- for (const v of values["https://www.w3.org/ns/activitystreams#latitude"] ?? []) {
21750
+ const _3g85RoKRnaNjP7DFyLSvsWDg7HGM__array = values["https://www.w3.org/ns/activitystreams#latitude"];
21751
+ for (const v of _3g85RoKRnaNjP7DFyLSvsWDg7HGM__array == null
21752
+ ? []
21753
+ : _3g85RoKRnaNjP7DFyLSvsWDg7HGM__array.length === 1 &&
21754
+ "@list" in _3g85RoKRnaNjP7DFyLSvsWDg7HGM__array[0]
21755
+ ? _3g85RoKRnaNjP7DFyLSvsWDg7HGM__array[0]["@list"]
21756
+ : _3g85RoKRnaNjP7DFyLSvsWDg7HGM__array) {
20137
21757
  if (v == null)
20138
21758
  continue;
20139
21759
  _3g85RoKRnaNjP7DFyLSvsWDg7HGM.push(v["@value"]);
20140
21760
  }
20141
21761
  instance.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM = _3g85RoKRnaNjP7DFyLSvsWDg7HGM;
20142
21762
  const _B2GEYdS9yBAF3ho1pm1rcRg7cSf = [];
20143
- for (const v of values["https://www.w3.org/ns/activitystreams#longitude"] ?? []) {
21763
+ const _B2GEYdS9yBAF3ho1pm1rcRg7cSf__array = values["https://www.w3.org/ns/activitystreams#longitude"];
21764
+ for (const v of _B2GEYdS9yBAF3ho1pm1rcRg7cSf__array == null
21765
+ ? []
21766
+ : _B2GEYdS9yBAF3ho1pm1rcRg7cSf__array.length === 1 &&
21767
+ "@list" in _B2GEYdS9yBAF3ho1pm1rcRg7cSf__array[0]
21768
+ ? _B2GEYdS9yBAF3ho1pm1rcRg7cSf__array[0]["@list"]
21769
+ : _B2GEYdS9yBAF3ho1pm1rcRg7cSf__array) {
20144
21770
  if (v == null)
20145
21771
  continue;
20146
21772
  _B2GEYdS9yBAF3ho1pm1rcRg7cSf.push(v["@value"]);
20147
21773
  }
20148
21774
  instance.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf = _B2GEYdS9yBAF3ho1pm1rcRg7cSf;
20149
21775
  const _3ga86BKHUtRkGx5PHBjRiUXXzwnw = [];
20150
- for (const v of values["https://www.w3.org/ns/activitystreams#radius"] ?? []) {
21776
+ const _3ga86BKHUtRkGx5PHBjRiUXXzwnw__array = values["https://www.w3.org/ns/activitystreams#radius"];
21777
+ for (const v of _3ga86BKHUtRkGx5PHBjRiUXXzwnw__array == null
21778
+ ? []
21779
+ : _3ga86BKHUtRkGx5PHBjRiUXXzwnw__array.length === 1 &&
21780
+ "@list" in _3ga86BKHUtRkGx5PHBjRiUXXzwnw__array[0]
21781
+ ? _3ga86BKHUtRkGx5PHBjRiUXXzwnw__array[0]["@list"]
21782
+ : _3ga86BKHUtRkGx5PHBjRiUXXzwnw__array) {
20151
21783
  if (v == null)
20152
21784
  continue;
20153
21785
  _3ga86BKHUtRkGx5PHBjRiUXXzwnw.push(v["@value"]);
20154
21786
  }
20155
21787
  instance.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw = _3ga86BKHUtRkGx5PHBjRiUXXzwnw;
20156
21788
  const _oKrwxU4V8wiKhMW1QEYQibcJh8c = [];
20157
- for (const v of values["https://www.w3.org/ns/activitystreams#units"] ?? []) {
21789
+ const _oKrwxU4V8wiKhMW1QEYQibcJh8c__array = values["https://www.w3.org/ns/activitystreams#units"];
21790
+ for (const v of _oKrwxU4V8wiKhMW1QEYQibcJh8c__array == null
21791
+ ? []
21792
+ : _oKrwxU4V8wiKhMW1QEYQibcJh8c__array.length === 1 &&
21793
+ "@list" in _oKrwxU4V8wiKhMW1QEYQibcJh8c__array[0]
21794
+ ? _oKrwxU4V8wiKhMW1QEYQibcJh8c__array[0]["@list"]
21795
+ : _oKrwxU4V8wiKhMW1QEYQibcJh8c__array) {
20158
21796
  if (v == null)
20159
21797
  continue;
20160
21798
  const decoded = typeof v === "object" && "@value" in v &&
@@ -20440,7 +22078,13 @@ export class Profile extends Object {
20440
22078
  throw new TypeError("Unexpected type: " + instance.constructor.name);
20441
22079
  }
20442
22080
  const _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1 = [];
20443
- for (const v of values["https://www.w3.org/ns/activitystreams#describes"] ?? []) {
22081
+ const _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1__array = values["https://www.w3.org/ns/activitystreams#describes"];
22082
+ for (const v of _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1__array == null
22083
+ ? []
22084
+ : _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1__array.length === 1 &&
22085
+ "@list" in _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1__array[0]
22086
+ ? _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1__array[0]["@list"]
22087
+ : _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1__array) {
20444
22088
  if (v == null)
20445
22089
  continue;
20446
22090
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -20761,7 +22405,13 @@ export class Question extends IntransitiveActivity {
20761
22405
  throw new TypeError("Unexpected type: " + instance.constructor.name);
20762
22406
  }
20763
22407
  const _2N5scKaVEcdYHFmfKYYacAwUhUgQ = [];
20764
- for (const v of values["https://www.w3.org/ns/activitystreams#oneOf"] ?? []) {
22408
+ const _2N5scKaVEcdYHFmfKYYacAwUhUgQ__array = values["https://www.w3.org/ns/activitystreams#oneOf"];
22409
+ for (const v of _2N5scKaVEcdYHFmfKYYacAwUhUgQ__array == null
22410
+ ? []
22411
+ : _2N5scKaVEcdYHFmfKYYacAwUhUgQ__array.length === 1 &&
22412
+ "@list" in _2N5scKaVEcdYHFmfKYYacAwUhUgQ__array[0]
22413
+ ? _2N5scKaVEcdYHFmfKYYacAwUhUgQ__array[0]["@list"]
22414
+ : _2N5scKaVEcdYHFmfKYYacAwUhUgQ__array) {
20765
22415
  if (v == null)
20766
22416
  continue;
20767
22417
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -20773,7 +22423,13 @@ export class Question extends IntransitiveActivity {
20773
22423
  }
20774
22424
  instance.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ = _2N5scKaVEcdYHFmfKYYacAwUhUgQ;
20775
22425
  const _2mV6isMTPRKbWdLCjcpiEysq5dAY = [];
20776
- for (const v of values["https://www.w3.org/ns/activitystreams#anyOf"] ?? []) {
22426
+ const _2mV6isMTPRKbWdLCjcpiEysq5dAY__array = values["https://www.w3.org/ns/activitystreams#anyOf"];
22427
+ for (const v of _2mV6isMTPRKbWdLCjcpiEysq5dAY__array == null
22428
+ ? []
22429
+ : _2mV6isMTPRKbWdLCjcpiEysq5dAY__array.length === 1 &&
22430
+ "@list" in _2mV6isMTPRKbWdLCjcpiEysq5dAY__array[0]
22431
+ ? _2mV6isMTPRKbWdLCjcpiEysq5dAY__array[0]["@list"]
22432
+ : _2mV6isMTPRKbWdLCjcpiEysq5dAY__array) {
20777
22433
  if (v == null)
20778
22434
  continue;
20779
22435
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -21422,7 +23078,13 @@ export class Relationship extends Object {
21422
23078
  throw new TypeError("Unexpected type: " + instance.constructor.name);
21423
23079
  }
21424
23080
  const _2Zqdmi46ZnDQsECS6mzwhrv3rUKq = [];
21425
- for (const v of values["https://www.w3.org/ns/activitystreams#subject"] ?? []) {
23081
+ const _2Zqdmi46ZnDQsECS6mzwhrv3rUKq__array = values["https://www.w3.org/ns/activitystreams#subject"];
23082
+ for (const v of _2Zqdmi46ZnDQsECS6mzwhrv3rUKq__array == null
23083
+ ? []
23084
+ : _2Zqdmi46ZnDQsECS6mzwhrv3rUKq__array.length === 1 &&
23085
+ "@list" in _2Zqdmi46ZnDQsECS6mzwhrv3rUKq__array[0]
23086
+ ? _2Zqdmi46ZnDQsECS6mzwhrv3rUKq__array[0]["@list"]
23087
+ : _2Zqdmi46ZnDQsECS6mzwhrv3rUKq__array) {
21426
23088
  if (v == null)
21427
23089
  continue;
21428
23090
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -21434,7 +23096,13 @@ export class Relationship extends Object {
21434
23096
  }
21435
23097
  instance.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq = _2Zqdmi46ZnDQsECS6mzwhrv3rUKq;
21436
23098
  const _2MH19yxjn1wnHsNfa5n4JBhJzxyc = [];
21437
- for (const v of values["https://www.w3.org/ns/activitystreams#object"] ?? []) {
23099
+ const _2MH19yxjn1wnHsNfa5n4JBhJzxyc__array = values["https://www.w3.org/ns/activitystreams#object"];
23100
+ for (const v of _2MH19yxjn1wnHsNfa5n4JBhJzxyc__array == null
23101
+ ? []
23102
+ : _2MH19yxjn1wnHsNfa5n4JBhJzxyc__array.length === 1 &&
23103
+ "@list" in _2MH19yxjn1wnHsNfa5n4JBhJzxyc__array[0]
23104
+ ? _2MH19yxjn1wnHsNfa5n4JBhJzxyc__array[0]["@list"]
23105
+ : _2MH19yxjn1wnHsNfa5n4JBhJzxyc__array) {
21438
23106
  if (v == null)
21439
23107
  continue;
21440
23108
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -21446,8 +23114,13 @@ export class Relationship extends Object {
21446
23114
  }
21447
23115
  instance.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc = _2MH19yxjn1wnHsNfa5n4JBhJzxyc;
21448
23116
  const _4Lzz89F9qipAQSGkWyX9DGWiUojG = [];
21449
- for (const v of values["https://www.w3.org/ns/activitystreams#relationship"] ??
21450
- []) {
23117
+ const _4Lzz89F9qipAQSGkWyX9DGWiUojG__array = values["https://www.w3.org/ns/activitystreams#relationship"];
23118
+ for (const v of _4Lzz89F9qipAQSGkWyX9DGWiUojG__array == null
23119
+ ? []
23120
+ : _4Lzz89F9qipAQSGkWyX9DGWiUojG__array.length === 1 &&
23121
+ "@list" in _4Lzz89F9qipAQSGkWyX9DGWiUojG__array[0]
23122
+ ? _4Lzz89F9qipAQSGkWyX9DGWiUojG__array[0]["@list"]
23123
+ : _4Lzz89F9qipAQSGkWyX9DGWiUojG__array) {
21451
23124
  if (v == null)
21452
23125
  continue;
21453
23126
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -21646,6 +23319,7 @@ export class Service extends Object {
21646
23319
  #_BBCTgfphhsFzpVfKTykGSpBNwoA = [];
21647
23320
  #_3bgkPwJanyTCoVFM9ovRcus8tKkU = [];
21648
23321
  #_4N1vBJzXDf8NbBumeECQMFvKetja = [];
23322
+ #_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [];
21649
23323
  #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = [];
21650
23324
  #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [];
21651
23325
  #_gAJzg1QDc4rcefFsUzGSYmyXvNH = [];
@@ -21814,6 +23488,17 @@ export class Service extends Object {
21814
23488
  "Collection | URL" + ".");
21815
23489
  }
21816
23490
  }
23491
+ if ("featuredTags" in values && values.featuredTags != null) {
23492
+ if (values.featuredTags instanceof Collection ||
23493
+ values.featuredTags instanceof URL) {
23494
+ // @ts-ignore: type is checked above.
23495
+ this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [values.featuredTags];
23496
+ }
23497
+ else {
23498
+ throw new TypeError("The featuredTags must be of type " +
23499
+ "Collection | URL" + ".");
23500
+ }
23501
+ }
21817
23502
  if ("streams" in values && values.streams != null) {
21818
23503
  if (Array.isArray(values.streams) &&
21819
23504
  values.streams.every((v) => v instanceof Collection || v instanceof URL)) {
@@ -22051,6 +23736,18 @@ export class Service extends Object {
22051
23736
  "Collection | URL" + ".");
22052
23737
  }
22053
23738
  }
23739
+ clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac;
23740
+ if ("featuredTags" in values && values.featuredTags != null) {
23741
+ if (values.featuredTags instanceof Collection ||
23742
+ values.featuredTags instanceof URL) {
23743
+ // @ts-ignore: type is checked above.
23744
+ clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = [values.featuredTags];
23745
+ }
23746
+ else {
23747
+ throw new TypeError("The featuredTags must be of type " +
23748
+ "Collection | URL" + ".");
23749
+ }
23750
+ }
22054
23751
  clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9;
22055
23752
  if ("streams" in values && values.streams != null) {
22056
23753
  if (Array.isArray(values.streams) &&
@@ -22682,6 +24379,64 @@ export class Service extends Object {
22682
24379
  }
22683
24380
  return v;
22684
24381
  }
24382
+ async #fetchFeaturedTags(url, options = {}) {
24383
+ const documentLoader = options.documentLoader ?? this._documentLoader ??
24384
+ fetchDocumentLoader;
24385
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
24386
+ fetchDocumentLoader;
24387
+ let fetchResult;
24388
+ try {
24389
+ fetchResult = await documentLoader(url.href);
24390
+ }
24391
+ catch (error) {
24392
+ if (options.suppressError) {
24393
+ getLogger(["fedify", "vocab"]).error("Failed to fetch {url}: {error}", { error, url: url.href });
24394
+ return null;
24395
+ }
24396
+ throw error;
24397
+ }
24398
+ const { document } = fetchResult;
24399
+ try {
24400
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
24401
+ }
24402
+ catch (e) {
24403
+ if (!(e instanceof TypeError))
24404
+ throw e;
24405
+ }
24406
+ throw new TypeError("Expected an object of any type of: " +
24407
+ ["https://www.w3.org/ns/activitystreams#Collection"].join(", "));
24408
+ }
24409
+ /**
24410
+ * Similar to
24411
+ * {@link Service.getFeaturedTags},
24412
+ * but returns its `@id` URL instead of the object itself.
24413
+ */
24414
+ get featuredTagsId() {
24415
+ if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length < 1)
24416
+ return null;
24417
+ const v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
24418
+ if (v instanceof URL)
24419
+ return v;
24420
+ return v.id;
24421
+ }
24422
+ /** What is known in Mastodon as "featured hashtags", hashtags that are featured
24423
+ * at people's profiles, is implemented using an extra property `featuredTags`
24424
+ * on the actor object that points to a {@link Collection} of {@link Hashtag}
24425
+ * objects specifically.
24426
+ */
24427
+ async getFeaturedTags(options = {}) {
24428
+ if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length < 1)
24429
+ return null;
24430
+ const v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
24431
+ if (v instanceof URL) {
24432
+ const fetched = await this.#fetchFeaturedTags(v, options);
24433
+ if (fetched == null)
24434
+ return null;
24435
+ this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac[0] = fetched;
24436
+ return fetched;
24437
+ }
24438
+ return v;
24439
+ }
22685
24440
  async #fetchStream(url, options = {}) {
22686
24441
  const documentLoader = options.documentLoader ?? this._documentLoader ??
22687
24442
  fetchDocumentLoader;
@@ -22810,8 +24565,9 @@ export class Service extends Object {
22810
24565
  : await v.toJsonLd(options);
22811
24566
  array.push(element);
22812
24567
  }
22813
- if (array.length > 0)
24568
+ if (array.length > 0) {
22814
24569
  values["https://w3id.org/security#publicKey"] = array;
24570
+ }
22815
24571
  array = [];
22816
24572
  for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3) {
22817
24573
  const element = v instanceof URL
@@ -22837,8 +24593,9 @@ export class Service extends Object {
22837
24593
  : await v.toJsonLd(options);
22838
24594
  array.push(element);
22839
24595
  }
22840
- if (array.length > 0)
24596
+ if (array.length > 0) {
22841
24597
  values["http://www.w3.org/ns/ldp#inbox"] = array;
24598
+ }
22842
24599
  array = [];
22843
24600
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC) {
22844
24601
  const element = v instanceof URL
@@ -22886,8 +24643,19 @@ export class Service extends Object {
22886
24643
  : await v.toJsonLd(options);
22887
24644
  array.push(element);
22888
24645
  }
22889
- if (array.length > 0)
24646
+ if (array.length > 0) {
22890
24647
  values["http://joinmastodon.org/ns#featured"] = array;
24648
+ }
24649
+ array = [];
24650
+ for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac) {
24651
+ const element = v instanceof URL
24652
+ ? { "@id": v.href }
24653
+ : await v.toJsonLd(options);
24654
+ array.push(element);
24655
+ }
24656
+ if (array.length > 0) {
24657
+ values["http://joinmastodon.org/ns#featuredTags"] = array;
24658
+ }
22891
24659
  array = [];
22892
24660
  for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9) {
22893
24661
  const element = v instanceof URL
@@ -22927,8 +24695,9 @@ export class Service extends Object {
22927
24695
  const element = { "@value": v };
22928
24696
  array.push(element);
22929
24697
  }
22930
- if (array.length > 0)
24698
+ if (array.length > 0) {
22931
24699
  values["http://joinmastodon.org/ns#memorial"] = array;
24700
+ }
22932
24701
  array = [];
22933
24702
  for (const v of this.#_2diCorzqPGQQqftp6e4SrCEwEnyk) {
22934
24703
  const element = { "@value": v };
@@ -22954,6 +24723,7 @@ export class Service extends Object {
22954
24723
  "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
22955
24724
  "toot": "http://joinmastodon.org/ns#",
22956
24725
  "featured": { "@id": "toot:featured", "@type": "@id" },
24726
+ "featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
22957
24727
  "discoverable": "toot:discoverable",
22958
24728
  "suspended": "toot:suspended",
22959
24729
  "memorial": "toot:memorial",
@@ -23005,8 +24775,13 @@ export class Service extends Object {
23005
24775
  throw new TypeError("Unexpected type: " + instance.constructor.name);
23006
24776
  }
23007
24777
  const _3isuDgRAKSntq9XdbjiNxjwyPZAf = [];
23008
- for (const v of values["https://www.w3.org/ns/activitystreams#preferredUsername"] ??
23009
- []) {
24778
+ const _3isuDgRAKSntq9XdbjiNxjwyPZAf__array = values["https://www.w3.org/ns/activitystreams#preferredUsername"];
24779
+ for (const v of _3isuDgRAKSntq9XdbjiNxjwyPZAf__array == null
24780
+ ? []
24781
+ : _3isuDgRAKSntq9XdbjiNxjwyPZAf__array.length === 1 &&
24782
+ "@list" in _3isuDgRAKSntq9XdbjiNxjwyPZAf__array[0]
24783
+ ? _3isuDgRAKSntq9XdbjiNxjwyPZAf__array[0]["@list"]
24784
+ : _3isuDgRAKSntq9XdbjiNxjwyPZAf__array) {
23010
24785
  if (v == null)
23011
24786
  continue;
23012
24787
  const decoded = typeof v === "object" && "@value" in v &&
@@ -23023,7 +24798,13 @@ export class Service extends Object {
23023
24798
  }
23024
24799
  instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = _3isuDgRAKSntq9XdbjiNxjwyPZAf;
23025
24800
  const _axq166E2eZADq34V4MYUc8KMZdC = [];
23026
- for (const v of values["https://w3id.org/security#publicKey"] ?? []) {
24801
+ const _axq166E2eZADq34V4MYUc8KMZdC__array = values["https://w3id.org/security#publicKey"];
24802
+ for (const v of _axq166E2eZADq34V4MYUc8KMZdC__array == null
24803
+ ? []
24804
+ : _axq166E2eZADq34V4MYUc8KMZdC__array.length === 1 &&
24805
+ "@list" in _axq166E2eZADq34V4MYUc8KMZdC__array[0]
24806
+ ? _axq166E2eZADq34V4MYUc8KMZdC__array[0]["@list"]
24807
+ : _axq166E2eZADq34V4MYUc8KMZdC__array) {
23027
24808
  if (v == null)
23028
24809
  continue;
23029
24810
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -23035,7 +24816,13 @@ export class Service extends Object {
23035
24816
  }
23036
24817
  instance.#_axq166E2eZADq34V4MYUc8KMZdC = _axq166E2eZADq34V4MYUc8KMZdC;
23037
24818
  const _4EHQFWZSz1k1d4LmPrQiMba2GbP3 = [];
23038
- for (const v of values["https://w3id.org/security#assertionMethod"] ?? []) {
24819
+ const _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array = values["https://w3id.org/security#assertionMethod"];
24820
+ for (const v of _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array == null
24821
+ ? []
24822
+ : _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array.length === 1 &&
24823
+ "@list" in _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array[0]
24824
+ ? _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array[0]["@list"]
24825
+ : _4EHQFWZSz1k1d4LmPrQiMba2GbP3__array) {
23039
24826
  if (v == null)
23040
24827
  continue;
23041
24828
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -23047,14 +24834,26 @@ export class Service extends Object {
23047
24834
  }
23048
24835
  instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3 = _4EHQFWZSz1k1d4LmPrQiMba2GbP3;
23049
24836
  const _36QNc9MxfkKf6h8sEUQSHnV9NZA = [];
23050
- for (const v of values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"] ?? []) {
24837
+ const _36QNc9MxfkKf6h8sEUQSHnV9NZA__array = values["https://www.w3.org/ns/activitystreams#manuallyApprovesFollowers"];
24838
+ for (const v of _36QNc9MxfkKf6h8sEUQSHnV9NZA__array == null
24839
+ ? []
24840
+ : _36QNc9MxfkKf6h8sEUQSHnV9NZA__array.length === 1 &&
24841
+ "@list" in _36QNc9MxfkKf6h8sEUQSHnV9NZA__array[0]
24842
+ ? _36QNc9MxfkKf6h8sEUQSHnV9NZA__array[0]["@list"]
24843
+ : _36QNc9MxfkKf6h8sEUQSHnV9NZA__array) {
23051
24844
  if (v == null)
23052
24845
  continue;
23053
24846
  _36QNc9MxfkKf6h8sEUQSHnV9NZA.push(v["@value"]);
23054
24847
  }
23055
24848
  instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA = _36QNc9MxfkKf6h8sEUQSHnV9NZA;
23056
24849
  const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB = [];
23057
- for (const v of values["http://www.w3.org/ns/ldp#inbox"] ?? []) {
24850
+ const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array = values["http://www.w3.org/ns/ldp#inbox"];
24851
+ for (const v of _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array == null
24852
+ ? []
24853
+ : _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array.length === 1 &&
24854
+ "@list" in _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array[0]
24855
+ ? _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array[0]["@list"]
24856
+ : _3ghX3VfZXXbLvhCRH7QJqpzLrXjB__array) {
23058
24857
  if (v == null)
23059
24858
  continue;
23060
24859
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -23066,7 +24865,13 @@ export class Service extends Object {
23066
24865
  }
23067
24866
  instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB;
23068
24867
  const _41QwhqJouoLg3h8dRPKat21brynC = [];
23069
- for (const v of values["https://www.w3.org/ns/activitystreams#outbox"] ?? []) {
24868
+ const _41QwhqJouoLg3h8dRPKat21brynC__array = values["https://www.w3.org/ns/activitystreams#outbox"];
24869
+ for (const v of _41QwhqJouoLg3h8dRPKat21brynC__array == null
24870
+ ? []
24871
+ : _41QwhqJouoLg3h8dRPKat21brynC__array.length === 1 &&
24872
+ "@list" in _41QwhqJouoLg3h8dRPKat21brynC__array[0]
24873
+ ? _41QwhqJouoLg3h8dRPKat21brynC__array[0]["@list"]
24874
+ : _41QwhqJouoLg3h8dRPKat21brynC__array) {
23070
24875
  if (v == null)
23071
24876
  continue;
23072
24877
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -23078,7 +24883,13 @@ export class Service extends Object {
23078
24883
  }
23079
24884
  instance.#_41QwhqJouoLg3h8dRPKat21brynC = _41QwhqJouoLg3h8dRPKat21brynC;
23080
24885
  const _3yAv8jymNfNuJUDuBzJ1NQhdbAee = [];
23081
- for (const v of values["https://www.w3.org/ns/activitystreams#following"] ?? []) {
24886
+ const _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array = values["https://www.w3.org/ns/activitystreams#following"];
24887
+ for (const v of _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array == null
24888
+ ? []
24889
+ : _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array.length === 1 &&
24890
+ "@list" in _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array[0]
24891
+ ? _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array[0]["@list"]
24892
+ : _3yAv8jymNfNuJUDuBzJ1NQhdbAee__array) {
23082
24893
  if (v == null)
23083
24894
  continue;
23084
24895
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -23090,7 +24901,13 @@ export class Service extends Object {
23090
24901
  }
23091
24902
  instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee = _3yAv8jymNfNuJUDuBzJ1NQhdbAee;
23092
24903
  const _BBCTgfphhsFzpVfKTykGSpBNwoA = [];
23093
- for (const v of values["https://www.w3.org/ns/activitystreams#followers"] ?? []) {
24904
+ const _BBCTgfphhsFzpVfKTykGSpBNwoA__array = values["https://www.w3.org/ns/activitystreams#followers"];
24905
+ for (const v of _BBCTgfphhsFzpVfKTykGSpBNwoA__array == null
24906
+ ? []
24907
+ : _BBCTgfphhsFzpVfKTykGSpBNwoA__array.length === 1 &&
24908
+ "@list" in _BBCTgfphhsFzpVfKTykGSpBNwoA__array[0]
24909
+ ? _BBCTgfphhsFzpVfKTykGSpBNwoA__array[0]["@list"]
24910
+ : _BBCTgfphhsFzpVfKTykGSpBNwoA__array) {
23094
24911
  if (v == null)
23095
24912
  continue;
23096
24913
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -23102,7 +24919,13 @@ export class Service extends Object {
23102
24919
  }
23103
24920
  instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA = _BBCTgfphhsFzpVfKTykGSpBNwoA;
23104
24921
  const _3bgkPwJanyTCoVFM9ovRcus8tKkU = [];
23105
- for (const v of values["https://www.w3.org/ns/activitystreams#liked"] ?? []) {
24922
+ const _3bgkPwJanyTCoVFM9ovRcus8tKkU__array = values["https://www.w3.org/ns/activitystreams#liked"];
24923
+ for (const v of _3bgkPwJanyTCoVFM9ovRcus8tKkU__array == null
24924
+ ? []
24925
+ : _3bgkPwJanyTCoVFM9ovRcus8tKkU__array.length === 1 &&
24926
+ "@list" in _3bgkPwJanyTCoVFM9ovRcus8tKkU__array[0]
24927
+ ? _3bgkPwJanyTCoVFM9ovRcus8tKkU__array[0]["@list"]
24928
+ : _3bgkPwJanyTCoVFM9ovRcus8tKkU__array) {
23106
24929
  if (v == null)
23107
24930
  continue;
23108
24931
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -23114,7 +24937,13 @@ export class Service extends Object {
23114
24937
  }
23115
24938
  instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU = _3bgkPwJanyTCoVFM9ovRcus8tKkU;
23116
24939
  const _4N1vBJzXDf8NbBumeECQMFvKetja = [];
23117
- for (const v of values["http://joinmastodon.org/ns#featured"] ?? []) {
24940
+ const _4N1vBJzXDf8NbBumeECQMFvKetja__array = values["http://joinmastodon.org/ns#featured"];
24941
+ for (const v of _4N1vBJzXDf8NbBumeECQMFvKetja__array == null
24942
+ ? []
24943
+ : _4N1vBJzXDf8NbBumeECQMFvKetja__array.length === 1 &&
24944
+ "@list" in _4N1vBJzXDf8NbBumeECQMFvKetja__array[0]
24945
+ ? _4N1vBJzXDf8NbBumeECQMFvKetja__array[0]["@list"]
24946
+ : _4N1vBJzXDf8NbBumeECQMFvKetja__array) {
23118
24947
  if (v == null)
23119
24948
  continue;
23120
24949
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -23125,8 +24954,32 @@ export class Service extends Object {
23125
24954
  _4N1vBJzXDf8NbBumeECQMFvKetja.push(await Collection.fromJsonLd(v, options));
23126
24955
  }
23127
24956
  instance.#_4N1vBJzXDf8NbBumeECQMFvKetja = _4N1vBJzXDf8NbBumeECQMFvKetja;
24957
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac = [];
24958
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array = values["http://joinmastodon.org/ns#featuredTags"];
24959
+ for (const v of _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array == null
24960
+ ? []
24961
+ : _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array.length === 1 &&
24962
+ "@list" in _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array[0]
24963
+ ? _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array[0]["@list"]
24964
+ : _2MxnRRLq9iPzx5CFq2NPrXdUDCac__array) {
24965
+ if (v == null)
24966
+ continue;
24967
+ if (typeof v === "object" && "@id" in v && !("@type" in v) &&
24968
+ globalThis.Object.keys(v).length === 1) {
24969
+ _2MxnRRLq9iPzx5CFq2NPrXdUDCac.push(new URL(v["@id"]));
24970
+ continue;
24971
+ }
24972
+ _2MxnRRLq9iPzx5CFq2NPrXdUDCac.push(await Collection.fromJsonLd(v, options));
24973
+ }
24974
+ instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac = _2MxnRRLq9iPzx5CFq2NPrXdUDCac;
23128
24975
  const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = [];
23129
- for (const v of values["https://www.w3.org/ns/activitystreams#streams"] ?? []) {
24976
+ const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array = values["https://www.w3.org/ns/activitystreams#streams"];
24977
+ for (const v of _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array == null
24978
+ ? []
24979
+ : _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array.length === 1 &&
24980
+ "@list" in _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array[0]
24981
+ ? _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array[0]["@list"]
24982
+ : _3sG2Hdwn9qzKGu9mpYkqakAMUkH9__array) {
23130
24983
  if (v == null)
23131
24984
  continue;
23132
24985
  if (typeof v === "object" && "@id" in v && !("@type" in v) &&
@@ -23138,35 +24991,65 @@ export class Service extends Object {
23138
24991
  }
23139
24992
  instance.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = _3sG2Hdwn9qzKGu9mpYkqakAMUkH9;
23140
24993
  const _sEoQwUbfk4hEfugzNQ2ZiDcLMkG = [];
23141
- for (const v of values["https://www.w3.org/ns/activitystreams#endpoints"] ?? []) {
24994
+ const _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array = values["https://www.w3.org/ns/activitystreams#endpoints"];
24995
+ for (const v of _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array == null
24996
+ ? []
24997
+ : _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array.length === 1 &&
24998
+ "@list" in _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array[0]
24999
+ ? _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array[0]["@list"]
25000
+ : _sEoQwUbfk4hEfugzNQ2ZiDcLMkG__array) {
23142
25001
  if (v == null)
23143
25002
  continue;
23144
25003
  _sEoQwUbfk4hEfugzNQ2ZiDcLMkG.push(await Endpoints.fromJsonLd(v, options));
23145
25004
  }
23146
25005
  instance.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG = _sEoQwUbfk4hEfugzNQ2ZiDcLMkG;
23147
25006
  const _gAJzg1QDc4rcefFsUzGSYmyXvNH = [];
23148
- for (const v of values["http://joinmastodon.org/ns#discoverable"] ?? []) {
25007
+ const _gAJzg1QDc4rcefFsUzGSYmyXvNH__array = values["http://joinmastodon.org/ns#discoverable"];
25008
+ for (const v of _gAJzg1QDc4rcefFsUzGSYmyXvNH__array == null
25009
+ ? []
25010
+ : _gAJzg1QDc4rcefFsUzGSYmyXvNH__array.length === 1 &&
25011
+ "@list" in _gAJzg1QDc4rcefFsUzGSYmyXvNH__array[0]
25012
+ ? _gAJzg1QDc4rcefFsUzGSYmyXvNH__array[0]["@list"]
25013
+ : _gAJzg1QDc4rcefFsUzGSYmyXvNH__array) {
23149
25014
  if (v == null)
23150
25015
  continue;
23151
25016
  _gAJzg1QDc4rcefFsUzGSYmyXvNH.push(v["@value"]);
23152
25017
  }
23153
25018
  instance.#_gAJzg1QDc4rcefFsUzGSYmyXvNH = _gAJzg1QDc4rcefFsUzGSYmyXvNH;
23154
25019
  const _2kGKkJtoFWg8c18PaVSqj9NKP4t7 = [];
23155
- for (const v of values["http://joinmastodon.org/ns#suspended"] ?? []) {
25020
+ const _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array = values["http://joinmastodon.org/ns#suspended"];
25021
+ for (const v of _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array == null
25022
+ ? []
25023
+ : _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array.length === 1 &&
25024
+ "@list" in _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array[0]
25025
+ ? _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array[0]["@list"]
25026
+ : _2kGKkJtoFWg8c18PaVSqj9NKP4t7__array) {
23156
25027
  if (v == null)
23157
25028
  continue;
23158
25029
  _2kGKkJtoFWg8c18PaVSqj9NKP4t7.push(v["@value"]);
23159
25030
  }
23160
25031
  instance.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7 = _2kGKkJtoFWg8c18PaVSqj9NKP4t7;
23161
25032
  const _79S8K4f5J9MWUgCxziRyUe6PTHZ = [];
23162
- for (const v of values["http://joinmastodon.org/ns#memorial"] ?? []) {
25033
+ const _79S8K4f5J9MWUgCxziRyUe6PTHZ__array = values["http://joinmastodon.org/ns#memorial"];
25034
+ for (const v of _79S8K4f5J9MWUgCxziRyUe6PTHZ__array == null
25035
+ ? []
25036
+ : _79S8K4f5J9MWUgCxziRyUe6PTHZ__array.length === 1 &&
25037
+ "@list" in _79S8K4f5J9MWUgCxziRyUe6PTHZ__array[0]
25038
+ ? _79S8K4f5J9MWUgCxziRyUe6PTHZ__array[0]["@list"]
25039
+ : _79S8K4f5J9MWUgCxziRyUe6PTHZ__array) {
23163
25040
  if (v == null)
23164
25041
  continue;
23165
25042
  _79S8K4f5J9MWUgCxziRyUe6PTHZ.push(v["@value"]);
23166
25043
  }
23167
25044
  instance.#_79S8K4f5J9MWUgCxziRyUe6PTHZ = _79S8K4f5J9MWUgCxziRyUe6PTHZ;
23168
25045
  const _2diCorzqPGQQqftp6e4SrCEwEnyk = [];
23169
- for (const v of values["http://joinmastodon.org/ns#indexable"] ?? []) {
25046
+ const _2diCorzqPGQQqftp6e4SrCEwEnyk__array = values["http://joinmastodon.org/ns#indexable"];
25047
+ for (const v of _2diCorzqPGQQqftp6e4SrCEwEnyk__array == null
25048
+ ? []
25049
+ : _2diCorzqPGQQqftp6e4SrCEwEnyk__array.length === 1 &&
25050
+ "@list" in _2diCorzqPGQQqftp6e4SrCEwEnyk__array[0]
25051
+ ? _2diCorzqPGQQqftp6e4SrCEwEnyk__array[0]["@list"]
25052
+ : _2diCorzqPGQQqftp6e4SrCEwEnyk__array) {
23170
25053
  if (v == null)
23171
25054
  continue;
23172
25055
  _2diCorzqPGQQqftp6e4SrCEwEnyk.push(v["@value"]);
@@ -23301,6 +25184,17 @@ export class Service extends Object {
23301
25184
  if (_4N1vBJzXDf8NbBumeECQMFvKetja.length == 1) {
23302
25185
  proxy.featured = _4N1vBJzXDf8NbBumeECQMFvKetja[0];
23303
25186
  }
25187
+ const _2MxnRRLq9iPzx5CFq2NPrXdUDCac = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac
25188
+ // deno-lint-ignore no-explicit-any
25189
+ .map((v) => v instanceof URL
25190
+ ? {
25191
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
25192
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
25193
+ }
25194
+ : v);
25195
+ if (_2MxnRRLq9iPzx5CFq2NPrXdUDCac.length == 1) {
25196
+ proxy.featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac[0];
25197
+ }
23304
25198
  const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9 = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9
23305
25199
  // deno-lint-ignore no-explicit-any
23306
25200
  .map((v) => v instanceof URL
@@ -23519,7 +25413,13 @@ export class Tombstone extends Object {
23519
25413
  throw new TypeError("Unexpected type: " + instance.constructor.name);
23520
25414
  }
23521
25415
  const _8g8g4LiVMhFTXskuDEqx4ascxUr = [];
23522
- for (const v of values["https://www.w3.org/ns/activitystreams#deleted"] ?? []) {
25416
+ const _8g8g4LiVMhFTXskuDEqx4ascxUr__array = values["https://www.w3.org/ns/activitystreams#deleted"];
25417
+ for (const v of _8g8g4LiVMhFTXskuDEqx4ascxUr__array == null
25418
+ ? []
25419
+ : _8g8g4LiVMhFTXskuDEqx4ascxUr__array.length === 1 &&
25420
+ "@list" in _8g8g4LiVMhFTXskuDEqx4ascxUr__array[0]
25421
+ ? _8g8g4LiVMhFTXskuDEqx4ascxUr__array[0]["@list"]
25422
+ : _8g8g4LiVMhFTXskuDEqx4ascxUr__array) {
23523
25423
  if (v == null)
23524
25424
  continue;
23525
25425
  _8g8g4LiVMhFTXskuDEqx4ascxUr.push(dntShim.Temporal.Instant.from(v["@value"]));