swh.web 0.14.2__py3-none-any.whl → 0.15.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. swh/web/alter/forms.py +16 -16
  2. swh/web/alter/templates/admin_alteration.html +5 -5
  3. swh/web/alter/templates/alteration_details.html +2 -2
  4. swh/web/alter/templates/assistant_category.html +21 -19
  5. swh/web/alter/templates/assistant_email.html +3 -4
  6. swh/web/alter/templates/assistant_origins.html +1 -2
  7. swh/web/alter/templates/assistant_reasons.html +1 -2
  8. swh/web/alter/templates/assistant_summary.html +3 -4
  9. swh/web/alter/templates/content_policies.html +8 -15
  10. swh/web/alter/templates/includes/swh_legal.html +1 -1
  11. swh/web/alter/tests/test_views.py +2 -2
  12. swh/web/alter/urls.py +1 -1
  13. swh/web/alter/views.py +2 -2
  14. swh/web/browse/assets/browse/browse.css +10 -0
  15. swh/web/browse/assets/browse/sidetabs.js +22 -2
  16. swh/web/browse/templates/includes/sidetabs.html +20 -16
  17. swh/web/browse/templates/includes/snapshot-context.html +3 -1
  18. swh/web/save_code_now/templates/includes/take-new-snapshot.html +1 -1
  19. swh/web/static/css/browse.0a250d3b07ce628588a5.css +2 -0
  20. swh/web/static/css/browse.0a250d3b07ce628588a5.css.map +1 -0
  21. swh/web/static/js/add_forge_now.f8fa8235350a7875b4b2.js.map +1 -1
  22. swh/web/static/js/archive_coverage.71f6961fbdc0d76c313b.js +3 -0
  23. swh/web/static/js/{archive_coverage.b37e2158e800bc69180b.js.LICENSE.txt → archive_coverage.71f6961fbdc0d76c313b.js.LICENSE.txt} +1 -1
  24. swh/web/static/js/archive_coverage.71f6961fbdc0d76c313b.js.map +1 -0
  25. swh/web/static/js/auth.971392ebe3f22c222189.js.map +1 -1
  26. swh/web/static/js/{browse.b150f8992236375f2e9b.js → browse.d5014e5cae44a2cd3e6e.js} +3 -3
  27. swh/web/static/js/browse.d5014e5cae44a2cd3e6e.js.map +1 -0
  28. swh/web/static/js/deposit.060ba94288f399dfe89e.js.map +1 -1
  29. swh/web/static/js/guided_tour.3a7a41181c43663f866b.js.map +1 -1
  30. swh/web/static/js/highlightjs.19cb5fa8879fdc8357d7.js.map +1 -1
  31. swh/web/static/js/mailmap.5dc62b52b8eb18e2e8b0.js.map +1 -1
  32. swh/web/static/js/origin_visits.679992a2a951f67a08bc.js.map +1 -1
  33. swh/web/static/js/pdf.worker.min.js +1 -1
  34. swh/web/static/js/pdfjs.97ecbde9d93314dba75a.js +3 -0
  35. swh/web/static/js/pdfjs.97ecbde9d93314dba75a.js.map +1 -0
  36. swh/web/static/js/revision.c5f4750ef7caee355fd9.js.map +1 -1
  37. swh/web/static/js/save_code_now.3db9c75765eb44fe774a.js.map +1 -1
  38. swh/web/static/js/showdown.8be01722fe56f5a7c2db.js.map +1 -1
  39. swh/web/static/js/vault.8c6e8e445d128eb30488.js.map +1 -1
  40. swh/web/static/js/{vendors.076b42bbe0326fc632ae.js → vendors.532425b092b95d43a1d6.js} +3 -3
  41. swh/web/static/js/vendors.532425b092b95d43a1d6.js.map +1 -0
  42. swh/web/static/js/webapp.5427bd8b32cec7de0951.js +3 -0
  43. swh/web/static/js/{webapp.ec7025df24c9f358f1cc.js.LICENSE.txt → webapp.5427bd8b32cec7de0951.js.LICENSE.txt} +1 -1
  44. swh/web/static/js/webapp.5427bd8b32cec7de0951.js.map +1 -0
  45. swh/web/static/jssources/@iframe-resizer/child/index.umd.js +2 -2
  46. swh/web/static/jssources/@iframe-resizer/parent/index.umd.js +2 -2
  47. swh/web/static/jssources/core-js/internals/array-to-reversed.js +2 -2
  48. swh/web/static/jssources/core-js/internals/array-with.js +2 -2
  49. swh/web/static/jssources/core-js/internals/async-iterator-iteration.js +6 -1
  50. swh/web/static/jssources/core-js/internals/flatten-into-array.js +1 -1
  51. swh/web/static/jssources/core-js/internals/get-iterator-direct.js +1 -1
  52. swh/web/static/jssources/core-js/internals/install-error-cause.js +1 -1
  53. swh/web/static/jssources/core-js/internals/iterator-create-proxy.js +1 -1
  54. swh/web/static/jssources/core-js/internals/set-difference.js +1 -1
  55. swh/web/static/jssources/core-js/internals/set-intersection.js +1 -1
  56. swh/web/static/jssources/core-js/internals/set-is-disjoint-from.js +1 -1
  57. swh/web/static/jssources/core-js/internals/set-is-subset-of.js +1 -1
  58. swh/web/static/jssources/core-js/internals/set-is-superset-of.js +1 -1
  59. swh/web/static/jssources/core-js/internals/set-method-get-keys-before-cloning-detection.js +1 -1
  60. swh/web/static/jssources/core-js/internals/set-symmetric-difference.js +1 -1
  61. swh/web/static/jssources/core-js/internals/set-union.js +1 -1
  62. swh/web/static/jssources/core-js/internals/shared-store.js +2 -2
  63. swh/web/static/jssources/core-js/internals/string-pad.js +0 -1
  64. swh/web/static/jssources/core-js/modules/es.array-buffer.transfer-to-fixed-length.js +1 -1
  65. swh/web/static/jssources/core-js/modules/es.array-buffer.transfer.js +1 -1
  66. swh/web/static/jssources/core-js/modules/es.error.is-error.js +1 -1
  67. swh/web/static/jssources/core-js/modules/es.symbol.constructor.js +1 -1
  68. swh/web/static/jssources/jslicenses.json +1 -1
  69. swh/web/static/jssources/pdfjs-dist/build/pdf.worker.mjs +299 -13
  70. swh/web/static/jssources/pdfjs-dist/legacy/build/pdf.mjs +492 -113
  71. swh/web/static/jssources/swh/web/browse/assets/browse/sidetabs.js +22 -2
  72. swh/web/static/jssources/swh/web/webapp/assets/webapp/webapp-utils.js +10 -0
  73. swh/web/static/webpack-stats.json +73 -73
  74. swh/web/utils/archive.py +12 -0
  75. swh/web/utils/tests/test_archive.py +32 -15
  76. swh/web/vault/templates/includes/vault-common.html +1 -1
  77. swh/web/vault/templates/includes/vault-create-tasks.html +5 -5
  78. swh/web/webapp/assets/webapp/webapp-utils.js +10 -0
  79. swh/web/webapp/templates/includes/footer.html +1 -1
  80. swh/web/webapp/templates/includes/global-modals.html +3 -3
  81. {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/METADATA +1 -1
  82. {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/RECORD +89 -89
  83. swh/web/static/css/browse.5775e0a313f4ccb8aef5.css +0 -2
  84. swh/web/static/css/browse.5775e0a313f4ccb8aef5.css.map +0 -1
  85. swh/web/static/js/archive_coverage.b37e2158e800bc69180b.js +0 -3
  86. swh/web/static/js/archive_coverage.b37e2158e800bc69180b.js.map +0 -1
  87. swh/web/static/js/browse.b150f8992236375f2e9b.js.map +0 -1
  88. swh/web/static/js/pdfjs.ca88359f90430972e38c.js +0 -3
  89. swh/web/static/js/pdfjs.ca88359f90430972e38c.js.map +0 -1
  90. swh/web/static/js/vendors.076b42bbe0326fc632ae.js.map +0 -1
  91. swh/web/static/js/webapp.ec7025df24c9f358f1cc.js +0 -3
  92. swh/web/static/js/webapp.ec7025df24c9f358f1cc.js.map +0 -1
  93. /swh/web/static/js/{browse.b150f8992236375f2e9b.js.LICENSE.txt → browse.d5014e5cae44a2cd3e6e.js.LICENSE.txt} +0 -0
  94. /swh/web/static/js/{pdfjs.ca88359f90430972e38c.js.LICENSE.txt → pdfjs.97ecbde9d93314dba75a.js.LICENSE.txt} +0 -0
  95. /swh/web/static/js/{vendors.076b42bbe0326fc632ae.js.LICENSE.txt → vendors.532425b092b95d43a1d6.js.LICENSE.txt} +0 -0
  96. {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/WHEEL +0 -0
  97. {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/licenses/AUTHORS +0 -0
  98. {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/licenses/LICENSE +0 -0
  99. {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/top_level.txt +0 -0
@@ -21,8 +21,8 @@
21
21
  */
22
22
 
23
23
  /**
24
- * pdfjsVersion = 5.3.31
25
- * pdfjsBuild = 47ad820d9
24
+ * pdfjsVersion = 5.3.93
25
+ * pdfjsBuild = cbeef3233
26
26
  */
27
27
  /******/ var __webpack_modules__ = ({
28
28
 
@@ -199,9 +199,15 @@ var getIteratorFlattenable = __webpack_require__(8646);
199
199
  var createIteratorProxy = __webpack_require__(9462);
200
200
  var iteratorClose = __webpack_require__(9539);
201
201
  var IS_PURE = __webpack_require__(6395);
202
+ var iteratorHelperThrowsOnInvalidIterator = __webpack_require__(684);
202
203
  var iteratorHelperWithoutClosingOnEarlyError = __webpack_require__(4549);
203
204
 
204
- var flatMapWithoutClosingOnEarlyError = !IS_PURE && iteratorHelperWithoutClosingOnEarlyError('flatMap', TypeError);
205
+ var FLAT_MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR = !IS_PURE
206
+ && !iteratorHelperThrowsOnInvalidIterator('flatMap', function () { /* empty */ });
207
+ var flatMapWithoutClosingOnEarlyError = !IS_PURE && !FLAT_MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR
208
+ && iteratorHelperWithoutClosingOnEarlyError('flatMap', TypeError);
209
+
210
+ var FORCED = IS_PURE || FLAT_MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR || flatMapWithoutClosingOnEarlyError;
205
211
 
206
212
  var IteratorProxy = createIteratorProxy(function () {
207
213
  var iterator = this.iterator;
@@ -227,7 +233,7 @@ var IteratorProxy = createIteratorProxy(function () {
227
233
 
228
234
  // `Iterator.prototype.flatMap` method
229
235
  // https://tc39.es/ecma262/#sec-iterator.prototype.flatmap
230
- $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE || flatMapWithoutClosingOnEarlyError }, {
236
+ $({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {
231
237
  flatMap: function flatMap(mapper) {
232
238
  anObject(this);
233
239
  try {
@@ -294,6 +300,25 @@ module.exports = function (it, Prototype) {
294
300
  };
295
301
 
296
302
 
303
+ /***/ }),
304
+
305
+ /***/ 684:
306
+ /***/ ((module) => {
307
+
308
+
309
+ // Should throw an error on invalid iterator
310
+ // https://issues.chromium.org/issues/336839115
311
+ module.exports = function (methodName, argument) {
312
+ // eslint-disable-next-line es/no-iterator -- required for testing
313
+ var method = typeof Iterator == 'function' && Iterator.prototype[methodName];
314
+ if (method) try {
315
+ method.call({ next: null }, argument).next();
316
+ } catch (error) {
317
+ return true;
318
+ }
319
+ };
320
+
321
+
297
322
  /***/ }),
298
323
 
299
324
  /***/ 741:
@@ -535,6 +560,29 @@ module.exports = function (argument) {
535
560
  };
536
561
 
537
562
 
563
+ /***/ }),
564
+
565
+ /***/ 1385:
566
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
567
+
568
+
569
+ var iteratorClose = __webpack_require__(9539);
570
+
571
+ module.exports = function (iters, kind, value) {
572
+ for (var i = iters.length - 1; i >= 0; i--) {
573
+ if (iters[i] === undefined) continue;
574
+ try {
575
+ value = iteratorClose(iters[i].iterator, kind, value);
576
+ } catch (error) {
577
+ kind = 'throw';
578
+ value = error;
579
+ }
580
+ }
581
+ if (kind === 'throw') throw value;
582
+ return value;
583
+ };
584
+
585
+
538
586
  /***/ }),
539
587
 
540
588
  /***/ 1548:
@@ -652,11 +700,14 @@ $({ target: 'Promise', stat: true, forced: FORCED }, {
652
700
 
653
701
  var $ = __webpack_require__(6518);
654
702
  var union = __webpack_require__(4204);
703
+ var setMethodGetKeysBeforeCloning = __webpack_require__(9835);
655
704
  var setMethodAcceptSetLike = __webpack_require__(4916);
656
705
 
706
+ var FORCED = !setMethodAcceptSetLike('union') || !setMethodGetKeysBeforeCloning('union');
707
+
657
708
  // `Set.prototype.union` method
658
709
  // https://tc39.es/ecma262/#sec-set.prototype.union
659
- $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, {
710
+ $({ target: 'Set', proto: true, real: true, forced: FORCED }, {
660
711
  union: union
661
712
  });
662
713
 
@@ -675,10 +726,15 @@ var getIteratorDirect = __webpack_require__(1767);
675
726
  var createIteratorProxy = __webpack_require__(9462);
676
727
  var callWithSafeIterationClosing = __webpack_require__(6319);
677
728
  var iteratorClose = __webpack_require__(9539);
729
+ var iteratorHelperThrowsOnInvalidIterator = __webpack_require__(684);
678
730
  var iteratorHelperWithoutClosingOnEarlyError = __webpack_require__(4549);
679
731
  var IS_PURE = __webpack_require__(6395);
680
732
 
681
- var mapWithoutClosingOnEarlyError = !IS_PURE && iteratorHelperWithoutClosingOnEarlyError('map', TypeError);
733
+ var MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR = !IS_PURE && !iteratorHelperThrowsOnInvalidIterator('map', function () { /* empty */ });
734
+ var mapWithoutClosingOnEarlyError = !IS_PURE && !MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR
735
+ && iteratorHelperWithoutClosingOnEarlyError('map', TypeError);
736
+
737
+ var FORCED = IS_PURE || MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR || mapWithoutClosingOnEarlyError;
682
738
 
683
739
  var IteratorProxy = createIteratorProxy(function () {
684
740
  var iterator = this.iterator;
@@ -689,7 +745,7 @@ var IteratorProxy = createIteratorProxy(function () {
689
745
 
690
746
  // `Iterator.prototype.map` method
691
747
  // https://tc39.es/ecma262/#sec-iterator.prototype.map
692
- $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE || mapWithoutClosingOnEarlyError }, {
748
+ $({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {
693
749
  map: function map(mapper) {
694
750
  anObject(this);
695
751
  try {
@@ -977,9 +1033,14 @@ var createIteratorProxy = __webpack_require__(9462);
977
1033
  var callWithSafeIterationClosing = __webpack_require__(6319);
978
1034
  var IS_PURE = __webpack_require__(6395);
979
1035
  var iteratorClose = __webpack_require__(9539);
1036
+ var iteratorHelperThrowsOnInvalidIterator = __webpack_require__(684);
980
1037
  var iteratorHelperWithoutClosingOnEarlyError = __webpack_require__(4549);
981
1038
 
982
- var filterWithoutClosingOnEarlyError = !IS_PURE && iteratorHelperWithoutClosingOnEarlyError('filter', TypeError);
1039
+ var FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR = !IS_PURE && !iteratorHelperThrowsOnInvalidIterator('filter', function () { /* empty */ });
1040
+ var filterWithoutClosingOnEarlyError = !IS_PURE && !FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR
1041
+ && iteratorHelperWithoutClosingOnEarlyError('filter', TypeError);
1042
+
1043
+ var FORCED = IS_PURE || FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR || filterWithoutClosingOnEarlyError;
983
1044
 
984
1045
  var IteratorProxy = createIteratorProxy(function () {
985
1046
  var iterator = this.iterator;
@@ -997,7 +1058,7 @@ var IteratorProxy = createIteratorProxy(function () {
997
1058
 
998
1059
  // `Iterator.prototype.filter` method
999
1060
  // https://tc39.es/ecma262/#sec-iterator.prototype.filter
1000
- $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE || filterWithoutClosingOnEarlyError }, {
1061
+ $({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {
1001
1062
  filter: function filter(predicate) {
1002
1063
  anObject(this);
1003
1064
  try {
@@ -1077,7 +1138,7 @@ module.exports = function (iterable, unboundFunction, options) {
1077
1138
  var iterator, iterFn, index, length, result, next, step;
1078
1139
 
1079
1140
  var stop = function (condition) {
1080
- if (iterator) iteratorClose(iterator, 'normal', condition);
1141
+ if (iterator) iteratorClose(iterator, 'normal');
1081
1142
  return new Result(true, condition);
1082
1143
  };
1083
1144
 
@@ -1359,7 +1420,7 @@ var uncurryThis = __webpack_require__(9504);
1359
1420
 
1360
1421
  var id = 0;
1361
1422
  var postfix = Math.random();
1362
- var toString = uncurryThis(1.0.toString);
1423
+ var toString = uncurryThis(1.1.toString);
1363
1424
 
1364
1425
  module.exports = function (key) {
1365
1426
  return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
@@ -1393,7 +1454,7 @@ module.exports = function difference(other) {
1393
1454
  if (otherRec.includes(e)) remove(result, e);
1394
1455
  });
1395
1456
  else iterateSimple(otherRec.getIterator(), function (e) {
1396
- if (has(O, e)) remove(result, e);
1457
+ if (has(result, e)) remove(result, e);
1397
1458
  });
1398
1459
  return result;
1399
1460
  };
@@ -2447,11 +2508,14 @@ module.exports = {
2447
2508
 
2448
2509
  var $ = __webpack_require__(6518);
2449
2510
  var symmetricDifference = __webpack_require__(3650);
2511
+ var setMethodGetKeysBeforeCloning = __webpack_require__(9835);
2450
2512
  var setMethodAcceptSetLike = __webpack_require__(4916);
2451
2513
 
2514
+ var FORCED = !setMethodAcceptSetLike('symmetricDifference') || !setMethodGetKeysBeforeCloning('symmetricDifference');
2515
+
2452
2516
  // `Set.prototype.symmetricDifference` method
2453
2517
  // https://tc39.es/ecma262/#sec-set.prototype.symmetricdifference
2454
- $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('symmetricDifference') }, {
2518
+ $({ target: 'Set', proto: true, real: true, forced: FORCED }, {
2455
2519
  symmetricDifference: symmetricDifference
2456
2520
  });
2457
2521
 
@@ -2572,7 +2636,7 @@ var uncurryThis = __webpack_require__(9504);
2572
2636
  var anUint8Array = __webpack_require__(4154);
2573
2637
  var notDetached = __webpack_require__(5169);
2574
2638
 
2575
- var numberToString = uncurryThis(1.0.toString);
2639
+ var numberToString = uncurryThis(1.1.toString);
2576
2640
 
2577
2641
  // `Uint8Array.prototype.toHex` method
2578
2642
  // https://github.com/tc39/proposal-arraybuffer-base64
@@ -3389,10 +3453,10 @@ var SHARED = '__core-js_shared__';
3389
3453
  var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
3390
3454
 
3391
3455
  (store.versions || (store.versions = [])).push({
3392
- version: '3.42.0',
3456
+ version: '3.43.0',
3393
3457
  mode: IS_PURE ? 'pure' : 'global',
3394
3458
  copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
3395
- license: 'https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE',
3459
+ license: 'https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE',
3396
3460
  source: 'https://github.com/zloirock/core-js'
3397
3461
  });
3398
3462
 
@@ -3405,15 +3469,38 @@ var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED,
3405
3469
 
3406
3470
  var $ = __webpack_require__(6518);
3407
3471
  var difference = __webpack_require__(3440);
3472
+ var fails = __webpack_require__(9039);
3408
3473
  var setMethodAcceptSetLike = __webpack_require__(4916);
3409
3474
 
3410
- var INCORRECT = !setMethodAcceptSetLike('difference', function (result) {
3475
+ var SET_LIKE_INCORRECT_BEHAVIOR = !setMethodAcceptSetLike('difference', function (result) {
3411
3476
  return result.size === 0;
3412
3477
  });
3413
3478
 
3479
+ var FORCED = SET_LIKE_INCORRECT_BEHAVIOR || fails(function () {
3480
+ // https://bugs.webkit.org/show_bug.cgi?id=288595
3481
+ var setLike = {
3482
+ size: 1,
3483
+ has: function () { return true; },
3484
+ keys: function () {
3485
+ var index = 0;
3486
+ return {
3487
+ next: function () {
3488
+ var done = index++ > 1;
3489
+ if (baseSet.has(1)) baseSet.clear();
3490
+ return { done: done, value: 2 };
3491
+ }
3492
+ };
3493
+ }
3494
+ };
3495
+ // eslint-disable-next-line es/no-set -- testing
3496
+ var baseSet = new Set([1, 2, 3, 4]);
3497
+ // eslint-disable-next-line es/no-set-prototype-difference -- testing
3498
+ return baseSet.difference(setLike).size !== 3;
3499
+ });
3500
+
3414
3501
  // `Set.prototype.difference` method
3415
3502
  // https://tc39.es/ecma262/#sec-set.prototype.difference
3416
- $({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
3503
+ $({ target: 'Set', proto: true, real: true, forced: FORCED }, {
3417
3504
  difference: difference
3418
3505
  });
3419
3506
 
@@ -4683,10 +4770,15 @@ var notANaN = __webpack_require__(4149);
4683
4770
  var toPositiveInteger = __webpack_require__(9590);
4684
4771
  var iteratorClose = __webpack_require__(9539);
4685
4772
  var createIteratorProxy = __webpack_require__(9462);
4773
+ var iteratorHelperThrowsOnInvalidIterator = __webpack_require__(684);
4686
4774
  var iteratorHelperWithoutClosingOnEarlyError = __webpack_require__(4549);
4687
4775
  var IS_PURE = __webpack_require__(6395);
4688
4776
 
4689
- var dropWithoutClosingOnEarlyError = !IS_PURE && iteratorHelperWithoutClosingOnEarlyError('drop', RangeError);
4777
+ var DROP_WITHOUT_THROWING_ON_INVALID_ITERATOR = !IS_PURE && !iteratorHelperThrowsOnInvalidIterator('drop', 0);
4778
+ var dropWithoutClosingOnEarlyError = !IS_PURE && !DROP_WITHOUT_THROWING_ON_INVALID_ITERATOR
4779
+ && iteratorHelperWithoutClosingOnEarlyError('drop', RangeError);
4780
+
4781
+ var FORCED = IS_PURE || DROP_WITHOUT_THROWING_ON_INVALID_ITERATOR || dropWithoutClosingOnEarlyError;
4690
4782
 
4691
4783
  var IteratorProxy = createIteratorProxy(function () {
4692
4784
  var iterator = this.iterator;
@@ -4705,7 +4797,7 @@ var IteratorProxy = createIteratorProxy(function () {
4705
4797
 
4706
4798
  // `Iterator.prototype.drop` method
4707
4799
  // https://tc39.es/ecma262/#sec-iterator.prototype.drop
4708
- $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE || dropWithoutClosingOnEarlyError }, {
4800
+ $({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {
4709
4801
  drop: function drop(limit) {
4710
4802
  anObject(this);
4711
4803
  var remaining;
@@ -4805,10 +4897,13 @@ var getMethod = __webpack_require__(5966);
4805
4897
  var IteratorPrototype = (__webpack_require__(7657).IteratorPrototype);
4806
4898
  var createIterResultObject = __webpack_require__(2529);
4807
4899
  var iteratorClose = __webpack_require__(9539);
4900
+ var iteratorCloseAll = __webpack_require__(1385);
4808
4901
 
4809
4902
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
4810
4903
  var ITERATOR_HELPER = 'IteratorHelper';
4811
4904
  var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
4905
+ var NORMAL = 'normal';
4906
+ var THROW = 'throw';
4812
4907
  var setInternalState = InternalStateModule.set;
4813
4908
 
4814
4909
  var createIteratorProxyPrototype = function (IS_ITERATOR) {
@@ -4839,11 +4934,16 @@ var createIteratorProxyPrototype = function (IS_ITERATOR) {
4839
4934
  return returnMethod ? call(returnMethod, iterator) : createIterResultObject(undefined, true);
4840
4935
  }
4841
4936
  if (state.inner) try {
4842
- iteratorClose(state.inner.iterator, 'normal');
4937
+ iteratorClose(state.inner.iterator, NORMAL);
4938
+ } catch (error) {
4939
+ return iteratorClose(iterator, THROW, error);
4940
+ }
4941
+ if (state.openIters) try {
4942
+ iteratorCloseAll(state.openIters, NORMAL);
4843
4943
  } catch (error) {
4844
- return iteratorClose(iterator, 'throw', error);
4944
+ return iteratorClose(iterator, THROW, error);
4845
4945
  }
4846
- if (iterator) iteratorClose(iterator, 'normal');
4946
+ if (iterator) iteratorClose(iterator, NORMAL);
4847
4947
  return createIterResultObject(undefined, true);
4848
4948
  }
4849
4949
  });
@@ -5115,6 +5215,43 @@ if (globalThis.Uint8Array) $({ target: 'Uint8Array', proto: true }, {
5115
5215
  });
5116
5216
 
5117
5217
 
5218
+ /***/ }),
5219
+
5220
+ /***/ 9835:
5221
+ /***/ ((module) => {
5222
+
5223
+
5224
+ // Should get iterator record of a set-like object before cloning this
5225
+ // https://bugs.webkit.org/show_bug.cgi?id=289430
5226
+ module.exports = function (METHOD_NAME) {
5227
+ try {
5228
+ // eslint-disable-next-line es/no-set -- needed for test
5229
+ var baseSet = new Set();
5230
+ var setLike = {
5231
+ size: 0,
5232
+ has: function () { return true; },
5233
+ keys: function () {
5234
+ // eslint-disable-next-line es/no-object-defineproperty -- needed for test
5235
+ return Object.defineProperty({}, 'next', {
5236
+ get: function () {
5237
+ baseSet.clear();
5238
+ baseSet.add(4);
5239
+ return function () {
5240
+ return { done: true };
5241
+ };
5242
+ }
5243
+ });
5244
+ }
5245
+ };
5246
+ var result = baseSet[METHOD_NAME](setLike);
5247
+
5248
+ return result.size !== 1 || result.values().next().value !== 4;
5249
+ } catch (error) {
5250
+ return false;
5251
+ }
5252
+ };
5253
+
5254
+
5118
5255
  /***/ })
5119
5256
 
5120
5257
  /******/ });
@@ -6099,6 +6236,9 @@ var esnext_json_parse = __webpack_require__(8335);
6099
6236
 
6100
6237
 
6101
6238
 
6239
+
6240
+
6241
+
6102
6242
  const SVG_NS = "http://www.w3.org/2000/svg";
6103
6243
  class PixelsPerInch {
6104
6244
  static CSS = 96.0;
@@ -6291,19 +6431,71 @@ function getPdfFilenameFromUrl(url, defaultFilename = "document.pdf") {
6291
6431
  warn('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');
6292
6432
  return defaultFilename;
6293
6433
  }
6294
- const reURI = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/;
6295
- const reFilename = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i;
6296
- const splitURI = reURI.exec(url);
6297
- let suggestedFilename = reFilename.exec(splitURI[1]) || reFilename.exec(splitURI[2]) || reFilename.exec(splitURI[3]);
6298
- if (suggestedFilename) {
6299
- suggestedFilename = suggestedFilename[0];
6300
- if (suggestedFilename.includes("%")) {
6434
+ const getURL = urlString => {
6435
+ try {
6436
+ return new URL(urlString);
6437
+ } catch {
6301
6438
  try {
6302
- suggestedFilename = reFilename.exec(decodeURIComponent(suggestedFilename))[0];
6303
- } catch {}
6439
+ return new URL(decodeURIComponent(urlString));
6440
+ } catch {
6441
+ try {
6442
+ return new URL(urlString, "https://foo.bar");
6443
+ } catch {
6444
+ try {
6445
+ return new URL(decodeURIComponent(urlString), "https://foo.bar");
6446
+ } catch {
6447
+ return null;
6448
+ }
6449
+ }
6450
+ }
6451
+ }
6452
+ };
6453
+ const newURL = getURL(url);
6454
+ if (!newURL) {
6455
+ return defaultFilename;
6456
+ }
6457
+ const decode = name => {
6458
+ try {
6459
+ let decoded = decodeURIComponent(name);
6460
+ if (decoded.includes("/")) {
6461
+ decoded = decoded.split("/").at(-1);
6462
+ if (decoded.test(/^\.pdf$/i)) {
6463
+ return decoded;
6464
+ }
6465
+ return name;
6466
+ }
6467
+ return decoded;
6468
+ } catch {
6469
+ return name;
6470
+ }
6471
+ };
6472
+ const pdfRegex = /\.pdf$/i;
6473
+ const filename = newURL.pathname.split("/").at(-1);
6474
+ if (pdfRegex.test(filename)) {
6475
+ return decode(filename);
6476
+ }
6477
+ if (newURL.searchParams.size > 0) {
6478
+ const values = Array.from(newURL.searchParams.values()).reverse();
6479
+ for (const value of values) {
6480
+ if (pdfRegex.test(value)) {
6481
+ return decode(value);
6482
+ }
6483
+ }
6484
+ const keys = Array.from(newURL.searchParams.keys()).reverse();
6485
+ for (const key of keys) {
6486
+ if (pdfRegex.test(key)) {
6487
+ return decode(key);
6488
+ }
6304
6489
  }
6305
6490
  }
6306
- return suggestedFilename || defaultFilename;
6491
+ if (newURL.hash) {
6492
+ const reFilename = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i;
6493
+ const hashFilename = reFilename.exec(newURL.hash);
6494
+ if (hashFilename) {
6495
+ return decode(hashFilename[0]);
6496
+ }
6497
+ }
6498
+ return defaultFilename;
6307
6499
  }
6308
6500
  class StatTimer {
6309
6501
  started = Object.create(null);
@@ -6574,7 +6766,6 @@ class EditorToolbar {
6574
6766
  style.insetInlineEnd = `${100 * x}%`;
6575
6767
  style.top = `calc(${100 * position[1]}% + var(--editor-toolbar-vert-offset))`;
6576
6768
  }
6577
- this.#addDeleteButton();
6578
6769
  return editToolbar;
6579
6770
  }
6580
6771
  get div() {
@@ -6613,7 +6804,7 @@ class EditorToolbar {
6613
6804
  this.#toolbar.classList.remove("hidden");
6614
6805
  this.#altText?.shown();
6615
6806
  }
6616
- #addDeleteButton() {
6807
+ addDeleteButton() {
6617
6808
  const {
6618
6809
  editorType,
6619
6810
  _uiManager
@@ -6638,19 +6829,35 @@ class EditorToolbar {
6638
6829
  async addAltText(altText) {
6639
6830
  const button = await altText.render();
6640
6831
  this.#addListenersToElement(button);
6641
- this.#buttons.prepend(button, this.#divider);
6832
+ this.#buttons.append(button, this.#divider);
6642
6833
  this.#altText = altText;
6643
6834
  }
6644
6835
  addColorPicker(colorPicker) {
6645
6836
  this.#colorPicker = colorPicker;
6646
6837
  const button = colorPicker.renderButton();
6647
6838
  this.#addListenersToElement(button);
6648
- this.#buttons.prepend(button, this.#divider);
6839
+ this.#buttons.append(button, this.#divider);
6649
6840
  }
6650
6841
  async addEditSignatureButton(signatureManager) {
6651
6842
  const button = this.#signatureDescriptionButton = await signatureManager.renderEditButton(this.#editor);
6652
6843
  this.#addListenersToElement(button);
6653
- this.#buttons.prepend(button, this.#divider);
6844
+ this.#buttons.append(button, this.#divider);
6845
+ }
6846
+ async addButton(name, tool) {
6847
+ switch (name) {
6848
+ case "colorPicker":
6849
+ this.addColorPicker(tool);
6850
+ break;
6851
+ case "altText":
6852
+ await this.addAltText(tool);
6853
+ break;
6854
+ case "editSignature":
6855
+ await this.addEditSignatureButton(tool);
6856
+ break;
6857
+ case "delete":
6858
+ this.addDeleteButton();
6859
+ break;
6860
+ }
6654
6861
  }
6655
6862
  updateEditSignatureButton(description) {
6656
6863
  if (this.#signatureDescriptionButton) {
@@ -7196,6 +7403,7 @@ class AnnotationEditorUIManager {
7196
7403
  #translationTimeoutId = null;
7197
7404
  #container = null;
7198
7405
  #viewer = null;
7406
+ #viewerAlert = null;
7199
7407
  #updateModeCapability = null;
7200
7408
  static TRANSLATE_SMALL = 1;
7201
7409
  static TRANSLATE_BIG = 10;
@@ -7257,10 +7465,11 @@ class AnnotationEditorUIManager {
7257
7465
  checker: arrowChecker
7258
7466
  }]]));
7259
7467
  }
7260
- constructor(container, viewer, altTextManager, signatureManager, eventBus, pdfDocument, pageColors, highlightColors, enableHighlightFloatingButton, enableUpdatedAddImage, enableNewAltTextWhenAddingImage, mlManager, editorUndoBar, supportsPinchToZoom) {
7468
+ constructor(container, viewer, viewerAlert, altTextManager, signatureManager, eventBus, pdfDocument, pageColors, highlightColors, enableHighlightFloatingButton, enableUpdatedAddImage, enableNewAltTextWhenAddingImage, mlManager, editorUndoBar, supportsPinchToZoom) {
7261
7469
  const signal = this._signal = this.#abortController.signal;
7262
7470
  this.#container = container;
7263
7471
  this.#viewer = viewer;
7472
+ this.#viewerAlert = viewerAlert;
7264
7473
  this.#altTextManager = altTextManager;
7265
7474
  this.#signatureManager = signatureManager;
7266
7475
  this._eventBus = eventBus;
@@ -7352,7 +7561,11 @@ class AnnotationEditorUIManager {
7352
7561
  return shadow(this, "direction", getComputedStyle(this.#container).direction);
7353
7562
  }
7354
7563
  get highlightColors() {
7355
- return shadow(this, "highlightColors", this.#highlightColors ? new Map(this.#highlightColors.split(",").map(pair => pair.split("=").map(x => x.trim()))) : null);
7564
+ return shadow(this, "highlightColors", this.#highlightColors ? new Map(this.#highlightColors.split(",").map(pair => {
7565
+ pair = pair.split("=").map(x => x.trim());
7566
+ pair[1] = pair[1].toUpperCase();
7567
+ return pair;
7568
+ })) : null);
7356
7569
  }
7357
7570
  get highlightColorNames() {
7358
7571
  return shadow(this, "highlightColorNames", this.highlightColors ? new Map(Array.from(this.highlightColors, e => e.reverse())) : null);
@@ -7537,6 +7750,18 @@ class AnnotationEditorUIManager {
7537
7750
  this.#annotationStorage.setValue(editor.id, editor);
7538
7751
  }
7539
7752
  }
7753
+ a11yAlert(messageId, args = null) {
7754
+ const viewerAlert = this.#viewerAlert;
7755
+ if (!viewerAlert) {
7756
+ return;
7757
+ }
7758
+ viewerAlert.setAttribute("data-l10n-id", messageId);
7759
+ if (args) {
7760
+ viewerAlert.setAttribute("data-l10n-args", JSON.stringify(args));
7761
+ } else {
7762
+ viewerAlert.removeAttribute("data-l10n-args");
7763
+ }
7764
+ }
7540
7765
  #selectionChange() {
7541
7766
  const selection = document.getSelection();
7542
7767
  if (!selection || selection.isCollapsed) {
@@ -7924,7 +8149,7 @@ class AnnotationEditorUIManager {
7924
8149
  removeLayer(layer) {
7925
8150
  this.#allLayers.delete(layer.pageIndex);
7926
8151
  }
7927
- async updateMode(mode, editId = null, isFromKeyboard = false) {
8152
+ async updateMode(mode, editId = null, isFromKeyboard = false, mustEnterInEditMode = false) {
7928
8153
  if (this.#mode === mode) {
7929
8154
  return;
7930
8155
  }
@@ -7963,7 +8188,9 @@ class AnnotationEditorUIManager {
7963
8188
  for (const editor of this.#allEditors.values()) {
7964
8189
  if (editor.annotationElementId === editId || editor.id === editId) {
7965
8190
  this.setSelected(editor);
7966
- editor.enterInEditMode();
8191
+ if (mustEnterInEditMode) {
8192
+ editor.enterInEditMode();
8193
+ }
7967
8194
  } else {
7968
8195
  editor.unselect();
7969
8196
  }
@@ -8162,6 +8389,10 @@ class AnnotationEditorUIManager {
8162
8389
  });
8163
8390
  }
8164
8391
  setSelected(editor) {
8392
+ this.updateToolbar({
8393
+ mode: editor.mode,
8394
+ editId: editor.id
8395
+ });
8165
8396
  this.#currentDrawingSession?.commitOrRemove();
8166
8397
  for (const ed of this.#selectedEditors) {
8167
8398
  if (ed !== editor) {
@@ -9091,6 +9322,7 @@ class AnnotationEditor {
9091
9322
  this._willKeepAspectRatio = false;
9092
9323
  this._initialOptions.isCentered = parameters.isCentered;
9093
9324
  this._structTreeParentId = null;
9325
+ this.annotationElementId = parameters.annotationElementId || null;
9094
9326
  const {
9095
9327
  rotation,
9096
9328
  rawDims: {
@@ -9113,6 +9345,9 @@ class AnnotationEditor {
9113
9345
  get editorType() {
9114
9346
  return Object.getPrototypeOf(this).constructor._type;
9115
9347
  }
9348
+ get mode() {
9349
+ return Object.getPrototypeOf(this).constructor._editorType;
9350
+ }
9116
9351
  static get isDrawer() {
9117
9352
  return false;
9118
9353
  }
@@ -9247,6 +9482,9 @@ class AnnotationEditor {
9247
9482
  }
9248
9483
  }
9249
9484
  commit() {
9485
+ if (!this.isInEditMode()) {
9486
+ return;
9487
+ }
9250
9488
  this.addToAnnotationStorage();
9251
9489
  }
9252
9490
  addToAnnotationStorage() {
@@ -9696,15 +9934,24 @@ class AnnotationEditor {
9696
9934
  altTextFinish() {
9697
9935
  this.#altText?.finish();
9698
9936
  }
9937
+ get toolbarButtons() {
9938
+ return null;
9939
+ }
9699
9940
  async addEditToolbar() {
9700
9941
  if (this._editToolbar || this.#isInEditMode) {
9701
9942
  return this._editToolbar;
9702
9943
  }
9703
9944
  this._editToolbar = new EditorToolbar(this);
9704
9945
  this.div.append(this._editToolbar.render());
9705
- if (this.#altText) {
9706
- await this._editToolbar.addAltText(this.#altText);
9946
+ const {
9947
+ toolbarButtons
9948
+ } = this;
9949
+ if (toolbarButtons) {
9950
+ for (const [name, tool] of toolbarButtons) {
9951
+ await this._editToolbar.addButton(name, tool);
9952
+ }
9707
9953
  }
9954
+ this._editToolbar.addButton("delete");
9708
9955
  return this._editToolbar;
9709
9956
  }
9710
9957
  removeEditToolbar() {
@@ -9726,17 +9973,16 @@ class AnnotationEditor {
9726
9973
  getClientDimensions() {
9727
9974
  return this.div.getBoundingClientRect();
9728
9975
  }
9729
- async addAltTextButton() {
9730
- if (this.#altText) {
9731
- return;
9732
- }
9733
- AltText.initialize(AnnotationEditor._l10n);
9734
- this.#altText = new AltText(this);
9735
- if (this.#accessibilityData) {
9736
- this.#altText.data = this.#accessibilityData;
9737
- this.#accessibilityData = null;
9976
+ createAltText() {
9977
+ if (!this.#altText) {
9978
+ AltText.initialize(AnnotationEditor._l10n);
9979
+ this.#altText = new AltText(this);
9980
+ if (this.#accessibilityData) {
9981
+ this.#altText.data = this.#accessibilityData;
9982
+ this.#accessibilityData = null;
9983
+ }
9738
9984
  }
9739
- await this.addEditToolbar();
9985
+ return this.#altText;
9740
9986
  }
9741
9987
  get altTextData() {
9742
9988
  return this.#altText?.data;
@@ -10077,7 +10323,8 @@ class AnnotationEditor {
10077
10323
  const editor = new this.prototype.constructor({
10078
10324
  parent,
10079
10325
  id: parent.getNextId(),
10080
- uiManager
10326
+ uiManager,
10327
+ annotationElementId: data.annotationElementId
10081
10328
  });
10082
10329
  editor.rotation = data.rotation;
10083
10330
  editor.#accessibilityData = data.accessibilityData;
@@ -17016,7 +17263,7 @@ function getDocument(src = {}) {
17016
17263
  }
17017
17264
  const docParams = {
17018
17265
  docId,
17019
- apiVersion: "5.3.31",
17266
+ apiVersion: "5.3.93",
17020
17267
  data,
17021
17268
  password,
17022
17269
  disableAutoFetch,
@@ -18626,8 +18873,8 @@ class InternalRenderTask {
18626
18873
  }
18627
18874
  }
18628
18875
  }
18629
- const version = "5.3.31";
18630
- const build = "47ad820d9";
18876
+ const version = "5.3.93";
18877
+ const build = "cbeef3233";
18631
18878
 
18632
18879
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.flat-map.js
18633
18880
  var es_iterator_flat_map = __webpack_require__(531);
@@ -18691,6 +18938,8 @@ class ColorConverters {
18691
18938
  return ["CMYK", c, m, y, k];
18692
18939
  }
18693
18940
  }
18941
+ const DateFormats = (/* unused pure expression or super */ null && (["m/d", "m/d/yy", "mm/dd/yy", "mm/yy", "d-mmm", "d-mmm-yy", "dd-mmm-yy", "yy-mm-dd", "mmm-yy", "mmmm-yy", "mmm d, yyyy", "mmmm d, yyyy", "m/d/yy h:MM tt", "m/d/yy HH:MM"]));
18942
+ const TimeFormats = (/* unused pure expression or super */ null && (["HH:MM", "h:MM tt", "HH:MM:ss", "h:MM:ss tt"]));
18694
18943
 
18695
18944
  ;// ./src/display/svg_factory.js
18696
18945
 
@@ -18956,7 +19205,6 @@ class XfaLayer {
18956
19205
 
18957
19206
 
18958
19207
 
18959
- const DEFAULT_TAB_INDEX = 1000;
18960
19208
  const annotation_layer_DEFAULT_FONT_SIZE = 9;
18961
19209
  const GetElementsByNameSet = new WeakSet();
18962
19210
  class AnnotationElementFactory {
@@ -19050,11 +19298,10 @@ class AnnotationElement {
19050
19298
  }
19051
19299
  }
19052
19300
  static _hasPopupData({
19053
- titleObj,
19054
19301
  contentsObj,
19055
19302
  richText
19056
19303
  }) {
19057
- return !!(titleObj?.str || contentsObj?.str || richText?.str);
19304
+ return !!(contentsObj?.str || richText?.str);
19058
19305
  }
19059
19306
  get _isEditable() {
19060
19307
  return this.data.isEditable;
@@ -19126,7 +19373,7 @@ class AnnotationElement {
19126
19373
  const container = document.createElement("section");
19127
19374
  container.setAttribute("data-annotation-id", data.id);
19128
19375
  if (!(this instanceof WidgetAnnotationElement)) {
19129
- container.tabIndex = DEFAULT_TAB_INDEX;
19376
+ container.tabIndex = 0;
19130
19377
  }
19131
19378
  const {
19132
19379
  style
@@ -19375,6 +19622,7 @@ class AnnotationElement {
19375
19622
  svg.classList.add("quadrilateralsContainer");
19376
19623
  svg.setAttribute("width", 0);
19377
19624
  svg.setAttribute("height", 0);
19625
+ svg.role = "none";
19378
19626
  const defs = svgFactory.createElement("defs");
19379
19627
  svg.append(defs);
19380
19628
  const clipPath = svgFactory.createElement("clipPath");
@@ -19420,7 +19668,8 @@ class AnnotationElement {
19420
19668
  parentRect: data.rect,
19421
19669
  borderStyle: 0,
19422
19670
  id: `popup_${data.id}`,
19423
- rotation: data.rotation
19671
+ rotation: data.rotation,
19672
+ noRotate: true
19424
19673
  },
19425
19674
  parent: this.parent,
19426
19675
  elements: [this]
@@ -19519,7 +19768,8 @@ class AnnotationElement {
19519
19768
  this.linkService.eventBus?.dispatch("switchannotationeditormode", {
19520
19769
  source: this,
19521
19770
  mode,
19522
- editId
19771
+ editId,
19772
+ mustEnterInEditMode: true
19523
19773
  });
19524
19774
  });
19525
19775
  }
@@ -19948,7 +20198,11 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement {
19948
20198
  element.setAttribute("data-element-id", id);
19949
20199
  element.disabled = this.data.readOnly;
19950
20200
  element.name = this.data.fieldName;
19951
- element.tabIndex = DEFAULT_TAB_INDEX;
20201
+ element.tabIndex = 0;
20202
+ const format = this.data.dateFormat || this.data.timeFormat;
20203
+ if (format) {
20204
+ element.title = format;
20205
+ }
19952
20206
  this._setRequired(element, this.data.required);
19953
20207
  if (maxLen) {
19954
20208
  element.maxLength = maxLen;
@@ -20238,7 +20492,7 @@ class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement {
20238
20492
  element.setAttribute("checked", true);
20239
20493
  }
20240
20494
  element.setAttribute("exportValue", data.exportValue);
20241
- element.tabIndex = DEFAULT_TAB_INDEX;
20495
+ element.tabIndex = 0;
20242
20496
  element.addEventListener("change", event => {
20243
20497
  const {
20244
20498
  name,
@@ -20318,7 +20572,7 @@ class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement {
20318
20572
  if (value) {
20319
20573
  element.setAttribute("checked", true);
20320
20574
  }
20321
- element.tabIndex = DEFAULT_TAB_INDEX;
20575
+ element.tabIndex = 0;
20322
20576
  element.addEventListener("change", event => {
20323
20577
  const {
20324
20578
  name,
@@ -20402,7 +20656,7 @@ class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement {
20402
20656
  selectElement.disabled = this.data.readOnly;
20403
20657
  this._setRequired(selectElement, this.data.required);
20404
20658
  selectElement.name = this.data.fieldName;
20405
- selectElement.tabIndex = DEFAULT_TAB_INDEX;
20659
+ selectElement.tabIndex = 0;
20406
20660
  let addAnEmptyEntry = this.data.combo && this.data.options.length > 0;
20407
20661
  if (!this.data.combo) {
20408
20662
  selectElement.size = this.data.options.length;
@@ -20618,7 +20872,11 @@ class PopupAnnotationElement extends AnnotationElement {
20618
20872
  this.popup = null;
20619
20873
  }
20620
20874
  render() {
20621
- this.container.classList.add("popupAnnotation");
20875
+ const {
20876
+ container
20877
+ } = this;
20878
+ container.classList.add("popupAnnotation");
20879
+ container.role = "comment";
20622
20880
  const popup = this.popup = new PopupElement({
20623
20881
  container: this.container,
20624
20882
  color: this.data.color,
@@ -20721,12 +20979,13 @@ class PopupElement {
20721
20979
  } = this.#titleObj);
20722
20980
  popup.append(header);
20723
20981
  if (this.#dateObj) {
20724
- const modificationDate = document.createElement("span");
20982
+ const modificationDate = document.createElement("time");
20725
20983
  modificationDate.classList.add("popupDate");
20726
20984
  modificationDate.setAttribute("data-l10n-id", "pdfjs-annotation-date-time-string");
20727
20985
  modificationDate.setAttribute("data-l10n-args", JSON.stringify({
20728
20986
  dateObj: this.#dateObj.valueOf()
20729
20987
  }));
20988
+ modificationDate.dateTime = this.#dateObj.toISOString();
20730
20989
  header.append(modificationDate);
20731
20990
  }
20732
20991
  const html = this.#html;
@@ -21277,11 +21536,23 @@ class HighlightAnnotationElement extends AnnotationElement {
21277
21536
  this.annotationEditorType = AnnotationEditorType.HIGHLIGHT;
21278
21537
  }
21279
21538
  render() {
21280
- if (!this.data.popupRef && this.hasPopupData) {
21539
+ const {
21540
+ data: {
21541
+ overlaidText,
21542
+ popupRef
21543
+ }
21544
+ } = this;
21545
+ if (!popupRef && this.hasPopupData) {
21281
21546
  this._createPopup();
21282
21547
  }
21283
21548
  this.container.classList.add("highlightAnnotation");
21284
21549
  this._editOnDoubleClick();
21550
+ if (overlaidText) {
21551
+ const mark = document.createElement("mark");
21552
+ mark.classList.add("overlaidText");
21553
+ mark.textContent = overlaidText;
21554
+ this.container.append(mark);
21555
+ }
21285
21556
  return this.container;
21286
21557
  }
21287
21558
  }
@@ -21294,10 +21565,22 @@ class UnderlineAnnotationElement extends AnnotationElement {
21294
21565
  });
21295
21566
  }
21296
21567
  render() {
21297
- if (!this.data.popupRef && this.hasPopupData) {
21568
+ const {
21569
+ data: {
21570
+ overlaidText,
21571
+ popupRef
21572
+ }
21573
+ } = this;
21574
+ if (!popupRef && this.hasPopupData) {
21298
21575
  this._createPopup();
21299
21576
  }
21300
21577
  this.container.classList.add("underlineAnnotation");
21578
+ if (overlaidText) {
21579
+ const underline = document.createElement("u");
21580
+ underline.classList.add("overlaidText");
21581
+ underline.textContent = overlaidText;
21582
+ this.container.append(underline);
21583
+ }
21301
21584
  return this.container;
21302
21585
  }
21303
21586
  }
@@ -21310,10 +21593,22 @@ class SquigglyAnnotationElement extends AnnotationElement {
21310
21593
  });
21311
21594
  }
21312
21595
  render() {
21313
- if (!this.data.popupRef && this.hasPopupData) {
21596
+ const {
21597
+ data: {
21598
+ overlaidText,
21599
+ popupRef
21600
+ }
21601
+ } = this;
21602
+ if (!popupRef && this.hasPopupData) {
21314
21603
  this._createPopup();
21315
21604
  }
21316
21605
  this.container.classList.add("squigglyAnnotation");
21606
+ if (overlaidText) {
21607
+ const underline = document.createElement("u");
21608
+ underline.classList.add("overlaidText");
21609
+ underline.textContent = overlaidText;
21610
+ this.container.append(underline);
21611
+ }
21317
21612
  return this.container;
21318
21613
  }
21319
21614
  }
@@ -21326,10 +21621,22 @@ class StrikeOutAnnotationElement extends AnnotationElement {
21326
21621
  });
21327
21622
  }
21328
21623
  render() {
21329
- if (!this.data.popupRef && this.hasPopupData) {
21624
+ const {
21625
+ data: {
21626
+ overlaidText,
21627
+ popupRef
21628
+ }
21629
+ } = this;
21630
+ if (!popupRef && this.hasPopupData) {
21330
21631
  this._createPopup();
21331
21632
  }
21332
21633
  this.container.classList.add("strikeoutAnnotation");
21634
+ if (overlaidText) {
21635
+ const strikeout = document.createElement("s");
21636
+ strikeout.classList.add("overlaidText");
21637
+ strikeout.textContent = overlaidText;
21638
+ this.container.append(strikeout);
21639
+ }
21333
21640
  return this.container;
21334
21641
  }
21335
21642
  }
@@ -21437,7 +21744,7 @@ class AnnotationLayer {
21437
21744
  hasEditableAnnotations() {
21438
21745
  return this.#editableAnnotations.size > 0;
21439
21746
  }
21440
- async #appendElement(element, id) {
21747
+ async #appendElement(element, id, popupElements) {
21441
21748
  const contentElement = element.firstChild || element;
21442
21749
  const annotationId = contentElement.id = `${AnnotationPrefix}${id}`;
21443
21750
  const ariaAttributes = await this.#structTreeLayer?.getAriaAttributes(annotationId);
@@ -21446,8 +21753,12 @@ class AnnotationLayer {
21446
21753
  contentElement.setAttribute(key, value);
21447
21754
  }
21448
21755
  }
21449
- this.div.append(element);
21450
- this.#accessibilityManager?.moveElementInDOM(this.div, element, contentElement, false);
21756
+ if (popupElements) {
21757
+ popupElements.at(-1).container.after(element);
21758
+ } else {
21759
+ this.div.append(element);
21760
+ this.#accessibilityManager?.moveElementInDOM(this.div, element, contentElement, false);
21761
+ }
21451
21762
  }
21452
21763
  async render(params) {
21453
21764
  const {
@@ -21504,7 +21815,7 @@ class AnnotationLayer {
21504
21815
  if (data.hidden) {
21505
21816
  rendered.style.visibility = "hidden";
21506
21817
  }
21507
- await this.#appendElement(rendered, data.id);
21818
+ await this.#appendElement(rendered, data.id, elementParams.elements);
21508
21819
  if (element._isEditable) {
21509
21820
  this.#editableAnnotations.set(element.data.id, element);
21510
21821
  this._annotationEditorUIManager?.renderAnnotationElement(element);
@@ -21528,7 +21839,7 @@ class AnnotationLayer {
21528
21839
  continue;
21529
21840
  }
21530
21841
  const rendered = element.render();
21531
- await this.#appendElement(rendered, data.id);
21842
+ await this.#appendElement(rendered, data.id, null);
21532
21843
  }
21533
21844
  }
21534
21845
  update({
@@ -21658,6 +21969,9 @@ class FreeTextEditor extends AnnotationEditor {
21658
21969
  });
21659
21970
  this.#color = params.color || FreeTextEditor._defaultColor || AnnotationEditor._defaultLineColor;
21660
21971
  this.#fontSize = params.fontSize || FreeTextEditor._defaultFontSize;
21972
+ if (!this.annotationElementId) {
21973
+ this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert");
21974
+ }
21661
21975
  }
21662
21976
  static initialize(l10n, uiManager) {
21663
21977
  AnnotationEditor.initialize(l10n, uiManager);
@@ -22133,6 +22447,7 @@ class FreeTextEditor extends AnnotationEditor {
22133
22447
  pageIndex: pageNumber - 1,
22134
22448
  rect: rect.slice(0),
22135
22449
  rotation,
22450
+ annotationElementId: id,
22136
22451
  id,
22137
22452
  deleted: false,
22138
22453
  popupRef
@@ -22142,7 +22457,6 @@ class FreeTextEditor extends AnnotationEditor {
22142
22457
  editor.#fontSize = data.fontSize;
22143
22458
  editor.#color = Util.makeHexColor(...data.color);
22144
22459
  editor.#content = FreeTextEditor.#deserializeContent(data.value);
22145
- editor.annotationElementId = data.id || null;
22146
22460
  editor._initialData = initialData;
22147
22461
  return editor;
22148
22462
  }
@@ -22925,7 +23239,7 @@ class ColorPicker {
22925
23239
  }
22926
23240
  this.#uiManager = editor?._uiManager || uiManager;
22927
23241
  this.#eventBus = this.#uiManager._eventBus;
22928
- this.#defaultColor = editor?.color || this.#uiManager?.highlightColors.values().next().value || "#FFFF98";
23242
+ this.#defaultColor = editor?.color?.toUpperCase() || this.#uiManager?.highlightColors.values().next().value || "#FFFF98";
22929
23243
  ColorPicker.#l10nColor ||= Object.freeze({
22930
23244
  blue: "pdfjs-editor-colorpicker-blue",
22931
23245
  green: "pdfjs-editor-colorpicker-green",
@@ -22939,7 +23253,10 @@ class ColorPicker {
22939
23253
  button.className = "colorPicker";
22940
23254
  button.tabIndex = "0";
22941
23255
  button.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-button");
22942
- button.setAttribute("aria-haspopup", true);
23256
+ button.ariaHasPopup = "true";
23257
+ if (this.#editor) {
23258
+ button.ariaControls = `${this.#editor.id}_colorpicker_dropdown`;
23259
+ }
22943
23260
  const signal = this.#uiManager._signal;
22944
23261
  button.addEventListener("click", this.#openDropdown.bind(this), {
22945
23262
  signal
@@ -22949,15 +23266,15 @@ class ColorPicker {
22949
23266
  });
22950
23267
  const swatch = this.#buttonSwatch = document.createElement("span");
22951
23268
  swatch.className = "swatch";
22952
- swatch.setAttribute("aria-hidden", true);
23269
+ swatch.ariaHidden = "true";
22953
23270
  swatch.style.backgroundColor = this.#defaultColor;
22954
23271
  button.append(swatch);
22955
23272
  return button;
22956
23273
  }
22957
23274
  renderMainDropdown() {
22958
23275
  const dropdown = this.#dropdown = this.#getDropdownRoot();
22959
- dropdown.setAttribute("aria-orientation", "horizontal");
22960
- dropdown.setAttribute("aria-labelledby", "highlightColorPickerLabel");
23276
+ dropdown.ariaOrientation = "horizontal";
23277
+ dropdown.ariaLabelledBy = "highlightColorPickerLabel";
22961
23278
  return dropdown;
22962
23279
  }
22963
23280
  #getDropdownRoot() {
@@ -22968,9 +23285,12 @@ class ColorPicker {
22968
23285
  });
22969
23286
  div.className = "dropdown";
22970
23287
  div.role = "listbox";
22971
- div.setAttribute("aria-multiselectable", false);
22972
- div.setAttribute("aria-orientation", "vertical");
23288
+ div.ariaMultiSelectable = "false";
23289
+ div.ariaOrientation = "vertical";
22973
23290
  div.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-dropdown");
23291
+ if (this.#editor) {
23292
+ div.id = `${this.#editor.id}_colorpicker_dropdown`;
23293
+ }
22974
23294
  for (const [name, color] of this.#uiManager.highlightColors) {
22975
23295
  const button = document.createElement("button");
22976
23296
  button.tabIndex = "0";
@@ -22982,7 +23302,7 @@ class ColorPicker {
22982
23302
  button.append(swatch);
22983
23303
  swatch.className = "swatch";
22984
23304
  swatch.style.backgroundColor = color;
22985
- button.setAttribute("aria-selected", color === this.#defaultColor);
23305
+ button.ariaSelected = color === this.#defaultColor;
22986
23306
  button.addEventListener("click", this.#colorSelect.bind(this, color), {
22987
23307
  signal
22988
23308
  });
@@ -23064,6 +23384,7 @@ class ColorPicker {
23064
23384
  signal: this.#uiManager.combinedSignal(this.#openDropdownAC)
23065
23385
  });
23066
23386
  }
23387
+ this.#button.ariaExpanded = "true";
23067
23388
  if (this.#dropdown) {
23068
23389
  this.#dropdown.classList.remove("hidden");
23069
23390
  return;
@@ -23079,6 +23400,7 @@ class ColorPicker {
23079
23400
  }
23080
23401
  hideDropdown() {
23081
23402
  this.#dropdown?.classList.add("hidden");
23403
+ this.#button.ariaExpanded = "false";
23082
23404
  this.#openDropdownAC?.abort();
23083
23405
  this.#openDropdownAC = null;
23084
23406
  }
@@ -23108,7 +23430,7 @@ class ColorPicker {
23108
23430
  }
23109
23431
  const i = this.#uiManager.highlightColors.values();
23110
23432
  for (const child of this.#dropdown.children) {
23111
- child.setAttribute("aria-selected", i.next().value === color);
23433
+ child.ariaSelected = i.next().value === color.toUpperCase();
23112
23434
  }
23113
23435
  }
23114
23436
  destroy() {
@@ -23199,6 +23521,9 @@ class HighlightEditor extends AnnotationEditor {
23199
23521
  this.#addToDrawLayer();
23200
23522
  this.rotate(this.rotation);
23201
23523
  }
23524
+ if (!this.annotationElementId) {
23525
+ this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert");
23526
+ }
23202
23527
  }
23203
23528
  get telemetryInitialData() {
23204
23529
  return {
@@ -23393,18 +23718,14 @@ class HighlightEditor extends AnnotationEditor {
23393
23718
  thickness
23394
23719
  }, true);
23395
23720
  }
23396
- async addEditToolbar() {
23397
- const toolbar = await super.addEditToolbar();
23398
- if (!toolbar) {
23399
- return null;
23400
- }
23721
+ get toolbarButtons() {
23401
23722
  if (this._uiManager.highlightColors) {
23402
- this.#colorPicker = new ColorPicker({
23723
+ const colorPicker = this.#colorPicker = new ColorPicker({
23403
23724
  editor: this
23404
23725
  });
23405
- toolbar.addColorPicker(this.#colorPicker);
23726
+ return [["colorPicker", colorPicker]];
23406
23727
  }
23407
- return toolbar;
23728
+ return super.toolbarButtons;
23408
23729
  }
23409
23730
  disableEditing() {
23410
23731
  super.disableEditing();
@@ -23812,6 +24133,7 @@ class HighlightEditor extends AnnotationEditor {
23812
24133
  pageIndex: pageNumber - 1,
23813
24134
  rect: rect.slice(0),
23814
24135
  rotation,
24136
+ annotationElementId: id,
23815
24137
  id,
23816
24138
  deleted: false,
23817
24139
  popupRef
@@ -23844,6 +24166,7 @@ class HighlightEditor extends AnnotationEditor {
23844
24166
  pageIndex: pageNumber - 1,
23845
24167
  rect: rect.slice(0),
23846
24168
  rotation,
24169
+ annotationElementId: id,
23847
24170
  id,
23848
24171
  deleted: false,
23849
24172
  popupRef
@@ -23861,7 +24184,6 @@ class HighlightEditor extends AnnotationEditor {
23861
24184
  if (inkLists) {
23862
24185
  editor.#thickness = data.thickness;
23863
24186
  }
23864
- editor.annotationElementId = data.id || null;
23865
24187
  editor._initialData = initialData;
23866
24188
  const [pageWidth, pageHeight] = editor.pageDimensions;
23867
24189
  const [pageX, pageY] = editor.pageTranslation;
@@ -24043,6 +24365,9 @@ class DrawingEditor extends AnnotationEditor {
24043
24365
  }) {
24044
24366
  this.#drawOutlines = drawOutlines;
24045
24367
  this._drawingOptions ||= drawingOptions;
24368
+ if (!this.annotationElementId) {
24369
+ this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`);
24370
+ }
24046
24371
  if (drawId >= 0) {
24047
24372
  this._drawId = drawId;
24048
24373
  this.parent.drawLayer.finalizeDraw(drawId, drawOutlines.defaultProperties);
@@ -25375,13 +25700,13 @@ class InkEditor extends DrawingEditor {
25375
25700
  pageIndex: pageNumber - 1,
25376
25701
  rect: rect.slice(0),
25377
25702
  rotation,
25703
+ annotationElementId: id,
25378
25704
  id,
25379
25705
  deleted: false,
25380
25706
  popupRef
25381
25707
  };
25382
25708
  }
25383
25709
  const editor = await super.deserialize(data, parent, uiManager);
25384
- editor.annotationElementId = data.id || null;
25385
25710
  editor._initialData = initialData;
25386
25711
  return editor;
25387
25712
  }
@@ -26330,16 +26655,11 @@ class SignatureEditor extends DrawingEditor {
26330
26655
  outline: outlineData.outline
26331
26656
  };
26332
26657
  }
26333
- async addEditToolbar() {
26334
- const toolbar = await super.addEditToolbar();
26335
- if (!toolbar) {
26336
- return null;
26658
+ get toolbarButtons() {
26659
+ if (this._uiManager.signatureManager) {
26660
+ return [["editSignature", this._uiManager.signatureManager]];
26337
26661
  }
26338
- if (this._uiManager.signatureManager && this.#description !== null) {
26339
- await toolbar.addEditSignatureButton(this._uiManager.signatureManager, this.#signatureUUID, this.#description);
26340
- toolbar.show();
26341
- }
26342
- return toolbar;
26662
+ return super.toolbarButtons;
26343
26663
  }
26344
26664
  addSignature(data, heightInPage, description, uuid) {
26345
26665
  const {
@@ -26350,7 +26670,7 @@ class SignatureEditor extends DrawingEditor {
26350
26670
  outline
26351
26671
  } = this.#signatureData = data;
26352
26672
  this.#isExtracted = outline instanceof ContourDrawOutline;
26353
- this.#description = description;
26673
+ this.description = description;
26354
26674
  this.div.setAttribute("data-l10n-args", JSON.stringify({
26355
26675
  description
26356
26676
  }));
@@ -26589,8 +26909,10 @@ class StampEditor extends AnnotationEditor {
26589
26909
  return;
26590
26910
  }
26591
26911
  if (this._uiManager.useNewAltTextWhenAddingImage && this._uiManager.useNewAltTextFlow && this.#bitmap) {
26592
- this._editToolbar.hide();
26593
- this._uiManager.editAltText(this, true);
26912
+ this.addEditToolbar().then(() => {
26913
+ this._editToolbar.hide();
26914
+ this._uiManager.editAltText(this, true);
26915
+ });
26594
26916
  return;
26595
26917
  }
26596
26918
  if (!this._uiManager.useNewAltTextWhenAddingImage && this._uiManager.useNewAltTextFlow && this.#bitmap) {
@@ -26748,6 +27070,9 @@ class StampEditor extends AnnotationEditor {
26748
27070
  isEmpty() {
26749
27071
  return !(this.#bitmapPromise || this.#bitmap || this.#bitmapUrl || this.#bitmapFile || this.#bitmapId || this.#missingCanvas);
26750
27072
  }
27073
+ get toolbarButtons() {
27074
+ return [["altText", this.createAltText()]];
27075
+ }
26751
27076
  get isResizable() {
26752
27077
  return true;
26753
27078
  }
@@ -26762,7 +27087,7 @@ class StampEditor extends AnnotationEditor {
26762
27087
  }
26763
27088
  super.render();
26764
27089
  this.div.hidden = true;
26765
- this.addAltTextButton();
27090
+ this.createAltText();
26766
27091
  if (!this.#missingCanvas) {
26767
27092
  if (this.#bitmap) {
26768
27093
  this.#createCanvas();
@@ -26853,6 +27178,9 @@ class StampEditor extends AnnotationEditor {
26853
27178
  if (this.#bitmapFileName) {
26854
27179
  this.div.setAttribute("aria-description", this.#bitmapFileName);
26855
27180
  }
27181
+ if (!this.annotationElementId) {
27182
+ this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert");
27183
+ }
26856
27184
  }
26857
27185
  copyCanvas(maxDataDimension, maxPreviewDimension, createImageData = false) {
26858
27186
  if (!maxDataDimension) {
@@ -27050,6 +27378,7 @@ class StampEditor extends AnnotationEditor {
27050
27378
  pageIndex: pageNumber - 1,
27051
27379
  rect: rect.slice(0),
27052
27380
  rotation,
27381
+ annotationElementId: id,
27053
27382
  id,
27054
27383
  deleted: false,
27055
27384
  accessibilityData: {
@@ -27085,7 +27414,6 @@ class StampEditor extends AnnotationEditor {
27085
27414
  const [parentWidth, parentHeight] = editor.pageDimensions;
27086
27415
  editor.width = (rect[2] - rect[0]) / parentWidth;
27087
27416
  editor.height = (rect[3] - rect[1]) / parentHeight;
27088
- editor.annotationElementId = data.id || null;
27089
27417
  if (accessibilityData) {
27090
27418
  editor.altTextData = accessibilityData;
27091
27419
  }
@@ -27212,6 +27540,8 @@ class AnnotationEditorLayer {
27212
27540
  #focusedElement = null;
27213
27541
  #textLayer = null;
27214
27542
  #textSelectionAC = null;
27543
+ #textLayerDblClickAC = null;
27544
+ #lastPointerDownTimestamp = -1;
27215
27545
  #uiManager;
27216
27546
  static _initialized = false;
27217
27547
  static #editorTypes = new Map([FreeTextEditor, InkEditor, StampEditor, HighlightEditor, SignatureEditor].map(type => [type._editorType, type]));
@@ -27313,6 +27643,8 @@ class AnnotationEditorLayer {
27313
27643
  this.#isEnabling = true;
27314
27644
  this.div.tabIndex = 0;
27315
27645
  this.togglePointerEvents(true);
27646
+ this.#textLayerDblClickAC?.abort();
27647
+ this.#textLayerDblClickAC = null;
27316
27648
  const annotationElementIds = new Set();
27317
27649
  for (const editor of this.#editors.values()) {
27318
27650
  editor.enableEditing();
@@ -27348,6 +27680,53 @@ class AnnotationEditorLayer {
27348
27680
  this.#isDisabling = true;
27349
27681
  this.div.tabIndex = -1;
27350
27682
  this.togglePointerEvents(false);
27683
+ if (this.#textLayer && !this.#textLayerDblClickAC) {
27684
+ this.#textLayerDblClickAC = new AbortController();
27685
+ const signal = this.#uiManager.combinedSignal(this.#textLayerDblClickAC);
27686
+ this.#textLayer.div.addEventListener("pointerdown", e => {
27687
+ const DBL_CLICK_THRESHOLD = 500;
27688
+ const {
27689
+ clientX,
27690
+ clientY,
27691
+ timeStamp
27692
+ } = e;
27693
+ const lastPointerDownTimestamp = this.#lastPointerDownTimestamp;
27694
+ if (timeStamp - lastPointerDownTimestamp > DBL_CLICK_THRESHOLD) {
27695
+ this.#lastPointerDownTimestamp = timeStamp;
27696
+ return;
27697
+ }
27698
+ this.#lastPointerDownTimestamp = -1;
27699
+ const {
27700
+ classList
27701
+ } = this.div;
27702
+ classList.toggle("getElements", true);
27703
+ const elements = document.elementsFromPoint(clientX, clientY);
27704
+ classList.toggle("getElements", false);
27705
+ if (!this.div.contains(elements[0])) {
27706
+ return;
27707
+ }
27708
+ let id;
27709
+ const regex = new RegExp(`^${AnnotationEditorPrefix}[0-9]+$`);
27710
+ for (const element of elements) {
27711
+ if (regex.test(element.id)) {
27712
+ id = element.id;
27713
+ break;
27714
+ }
27715
+ }
27716
+ if (!id) {
27717
+ return;
27718
+ }
27719
+ const editor = this.#editors.get(id);
27720
+ if (editor?.annotationElementId === null) {
27721
+ e.stopPropagation();
27722
+ e.preventDefault();
27723
+ editor.dblclick();
27724
+ }
27725
+ }, {
27726
+ signal,
27727
+ capture: true
27728
+ });
27729
+ }
27351
27730
  const changedAnnotations = new Map();
27352
27731
  const resetAnnotations = new Map();
27353
27732
  for (const editor of this.#editors.values()) {