@embedpdf/plugin-annotation 2.7.0 → 2.8.0

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 (128) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +335 -82
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/annotation-plugin.d.ts +2 -0
  6. package/dist/lib/handlers/index.d.ts +4 -0
  7. package/dist/lib/handlers/insert-text.handler.d.ts +8 -0
  8. package/dist/lib/handlers/replace-text.handler.d.ts +9 -0
  9. package/dist/lib/handlers/selection-utils.d.ts +7 -0
  10. package/dist/lib/handlers/text-markup.handler.d.ts +7 -0
  11. package/dist/lib/handlers/text.handler.d.ts +3 -0
  12. package/dist/lib/handlers/types.d.ts +12 -0
  13. package/dist/lib/helpers.d.ts +2 -1
  14. package/dist/lib/selectors.d.ts +6 -1
  15. package/dist/lib/tools/default-tools.d.ts +151 -6
  16. package/dist/lib/tools/tools-utils.d.ts +2 -0
  17. package/dist/lib/tools/types.d.ts +2 -0
  18. package/dist/lib/types.d.ts +1 -0
  19. package/dist/preact/index.cjs +1 -1
  20. package/dist/preact/index.cjs.map +1 -1
  21. package/dist/preact/index.js +277 -43
  22. package/dist/preact/index.js.map +1 -1
  23. package/dist/react/index.cjs +1 -1
  24. package/dist/react/index.cjs.map +1 -1
  25. package/dist/react/index.js +277 -43
  26. package/dist/react/index.js.map +1 -1
  27. package/dist/shared/annotation-bounds.d.ts +14 -0
  28. package/dist/shared/components/annotations/caret.d.ts +24 -0
  29. package/dist/shared/components/annotations/circle.d.ts +2 -2
  30. package/dist/shared/components/annotations/free-text.d.ts +2 -2
  31. package/dist/shared/components/annotations/ink.d.ts +2 -2
  32. package/dist/shared/components/annotations/line.d.ts +2 -2
  33. package/dist/shared/components/annotations/link.d.ts +2 -2
  34. package/dist/shared/components/annotations/polygon.d.ts +2 -2
  35. package/dist/shared/components/annotations/polyline.d.ts +8 -4
  36. package/dist/shared/components/annotations/square.d.ts +2 -2
  37. package/dist/shared/components/annotations/stamp.d.ts +2 -2
  38. package/dist/shared/components/annotations/text.d.ts +14 -0
  39. package/dist/shared/components/text-markup/highlight.d.ts +2 -2
  40. package/dist/shared/components/text-markup/squiggly.d.ts +2 -2
  41. package/dist/shared/components/text-markup/strikeout.d.ts +2 -2
  42. package/dist/shared/components/text-markup/underline.d.ts +2 -2
  43. package/dist/shared/components/types.d.ts +2 -2
  44. package/dist/shared-preact/annotation-bounds.d.ts +14 -0
  45. package/dist/shared-preact/components/annotations/caret.d.ts +24 -0
  46. package/dist/shared-preact/components/annotations/circle.d.ts +2 -2
  47. package/dist/shared-preact/components/annotations/free-text.d.ts +2 -2
  48. package/dist/shared-preact/components/annotations/ink.d.ts +2 -2
  49. package/dist/shared-preact/components/annotations/line.d.ts +2 -2
  50. package/dist/shared-preact/components/annotations/link.d.ts +2 -2
  51. package/dist/shared-preact/components/annotations/polygon.d.ts +2 -2
  52. package/dist/shared-preact/components/annotations/polyline.d.ts +8 -4
  53. package/dist/shared-preact/components/annotations/square.d.ts +2 -2
  54. package/dist/shared-preact/components/annotations/stamp.d.ts +2 -2
  55. package/dist/shared-preact/components/annotations/text.d.ts +14 -0
  56. package/dist/shared-preact/components/text-markup/highlight.d.ts +2 -2
  57. package/dist/shared-preact/components/text-markup/squiggly.d.ts +2 -2
  58. package/dist/shared-preact/components/text-markup/strikeout.d.ts +2 -2
  59. package/dist/shared-preact/components/text-markup/underline.d.ts +2 -2
  60. package/dist/shared-preact/components/types.d.ts +2 -2
  61. package/dist/shared-react/annotation-bounds.d.ts +14 -0
  62. package/dist/shared-react/components/annotations/caret.d.ts +24 -0
  63. package/dist/shared-react/components/annotations/circle.d.ts +2 -2
  64. package/dist/shared-react/components/annotations/free-text.d.ts +2 -2
  65. package/dist/shared-react/components/annotations/ink.d.ts +2 -2
  66. package/dist/shared-react/components/annotations/line.d.ts +2 -2
  67. package/dist/shared-react/components/annotations/link.d.ts +2 -2
  68. package/dist/shared-react/components/annotations/polygon.d.ts +2 -2
  69. package/dist/shared-react/components/annotations/polyline.d.ts +8 -4
  70. package/dist/shared-react/components/annotations/square.d.ts +2 -2
  71. package/dist/shared-react/components/annotations/stamp.d.ts +2 -2
  72. package/dist/shared-react/components/annotations/text.d.ts +14 -0
  73. package/dist/shared-react/components/text-markup/highlight.d.ts +2 -2
  74. package/dist/shared-react/components/text-markup/squiggly.d.ts +2 -2
  75. package/dist/shared-react/components/text-markup/strikeout.d.ts +2 -2
  76. package/dist/shared-react/components/text-markup/underline.d.ts +2 -2
  77. package/dist/shared-react/components/types.d.ts +2 -2
  78. package/dist/shared-vue/annotation-bounds.d.ts +14 -0
  79. package/dist/svelte/components/annotations/Caret.svelte.d.ts +13 -0
  80. package/dist/svelte/components/annotations/Circle.svelte.d.ts +1 -1
  81. package/dist/svelte/components/annotations/FreeText.svelte.d.ts +1 -1
  82. package/dist/svelte/components/annotations/Ink.svelte.d.ts +1 -1
  83. package/dist/svelte/components/annotations/Line.svelte.d.ts +1 -1
  84. package/dist/svelte/components/annotations/Link.svelte.d.ts +1 -1
  85. package/dist/svelte/components/annotations/Polygon.svelte.d.ts +1 -1
  86. package/dist/svelte/components/annotations/Polyline.svelte.d.ts +4 -2
  87. package/dist/svelte/components/annotations/Square.svelte.d.ts +1 -1
  88. package/dist/svelte/components/annotations/Stamp.svelte.d.ts +1 -1
  89. package/dist/svelte/components/annotations/Text.svelte.d.ts +10 -0
  90. package/dist/svelte/components/annotations/index.d.ts +1 -0
  91. package/dist/svelte/components/renderers/CaretRenderer.svelte.d.ts +5 -0
  92. package/dist/svelte/components/renderers/TextRenderer.svelte.d.ts +5 -0
  93. package/dist/svelte/components/text-markup/Highlight.svelte.d.ts +1 -1
  94. package/dist/svelte/components/text-markup/Squiggly.svelte.d.ts +1 -1
  95. package/dist/svelte/components/text-markup/Strikeout.svelte.d.ts +1 -1
  96. package/dist/svelte/components/text-markup/Underline.svelte.d.ts +1 -1
  97. package/dist/svelte/context/types.d.ts +1 -1
  98. package/dist/svelte/index.cjs +1 -1
  99. package/dist/svelte/index.cjs.map +1 -1
  100. package/dist/svelte/index.js +350 -147
  101. package/dist/svelte/index.js.map +1 -1
  102. package/dist/vue/components/annotation-container.vue.d.ts +2 -2
  103. package/dist/vue/components/annotation-layer.vue.d.ts +1 -1
  104. package/dist/vue/components/annotations/caret.vue.d.ts +24 -0
  105. package/dist/vue/components/annotations/circle.vue.d.ts +2 -2
  106. package/dist/vue/components/annotations/free-text.vue.d.ts +2 -2
  107. package/dist/vue/components/annotations/index.d.ts +1 -0
  108. package/dist/vue/components/annotations/ink.vue.d.ts +2 -2
  109. package/dist/vue/components/annotations/line.vue.d.ts +2 -2
  110. package/dist/vue/components/annotations/link.vue.d.ts +2 -2
  111. package/dist/vue/components/annotations/polygon.vue.d.ts +2 -2
  112. package/dist/vue/components/annotations/polyline.vue.d.ts +8 -3
  113. package/dist/vue/components/annotations/square.vue.d.ts +2 -2
  114. package/dist/vue/components/annotations/stamp.vue.d.ts +2 -2
  115. package/dist/vue/components/annotations/text.vue.d.ts +14 -0
  116. package/dist/vue/components/annotations.vue.d.ts +1 -1
  117. package/dist/vue/components/renderers/caret-renderer.vue.d.ts +6 -0
  118. package/dist/vue/components/renderers/text-renderer.vue.d.ts +6 -0
  119. package/dist/vue/components/text-markup/highlight.vue.d.ts +2 -2
  120. package/dist/vue/components/text-markup/squiggly.vue.d.ts +2 -2
  121. package/dist/vue/components/text-markup/strikeout.vue.d.ts +2 -2
  122. package/dist/vue/components/text-markup/underline.vue.d.ts +2 -2
  123. package/dist/vue/context/types.d.ts +1 -1
  124. package/dist/vue/index.cjs +1 -1
  125. package/dist/vue/index.cjs.map +1 -1
  126. package/dist/vue/index.js +535 -249
  127. package/dist/vue/index.js.map +1 -1
  128. package/package.json +10 -10
@@ -5,8 +5,9 @@ import "svelte/internal/disclose-version";
5
5
  import * as $ from "svelte/internal/client";
6
6
  import { setContext, getContext, untrack } from "svelte";
7
7
  import { useCapability, usePlugin, useDocumentPermissions, useDocumentState } from "@embedpdf/core/svelte";
8
+ import { getCounterRotation } from "@embedpdf/utils";
8
9
  import { useInteractionHandles, deepToRaw, doublePress, CounterRotate } from "@embedpdf/utils/svelte";
9
- import { inferRotationCenterFromRects, boundingRectOrEmpty, PdfAnnotationBorderStyle, PdfVerticalAlignment, standardFontCssProperties, textAlignmentToCss, ignore, PdfErrorCode, PdfAnnotationSubtype, blendModeToCss, PdfBlendMode } from "@embedpdf/models";
10
+ import { inferRotationCenterFromRects, boundingRectOrEmpty, PdfAnnotationBorderStyle, PdfVerticalAlignment, standardFontCssProperties, textAlignmentToCss, ignore, PdfErrorCode, getContrastStrokeColor, PdfAnnotationSubtype, blendModeToCss, PdfBlendMode } from "@embedpdf/models";
10
11
  import { usePointerHandlers } from "@embedpdf/plugin-interaction-manager/svelte";
11
12
  import { useSelectionCapability } from "@embedpdf/plugin-selection/svelte";
12
13
  const REGISTRY_KEY = Symbol("AnnotationRendererRegistry");
@@ -94,7 +95,7 @@ const useAnnotation = (getDocumentId) => {
94
95
  }
95
96
  };
96
97
  };
97
- var root_1$f = $.from_html(`<img alt="" draggable="false"/>`);
98
+ var root_1$h = $.from_html(`<img alt="" draggable="false"/>`);
98
99
  function AppearanceImage($$anchor, $$props) {
99
100
  $.push($$props, true);
100
101
  let imageUrl = $.state(null);
@@ -120,7 +121,7 @@ function AppearanceImage($$anchor, $$props) {
120
121
  var node = $.first_child(fragment);
121
122
  {
122
123
  var consequent = ($$anchor2) => {
123
- var img = root_1$f();
124
+ var img = root_1$h();
124
125
  $.template_effect(() => {
125
126
  $.set_attribute(img, "src", $.get(imageUrl));
126
127
  $.set_style(img, `position: absolute; width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; ${$$props.style ?? "" ?? ""}`);
@@ -136,14 +137,14 @@ function AppearanceImage($$anchor, $$props) {
136
137
  $.append($$anchor, fragment);
137
138
  $.pop();
138
139
  }
139
- var root_1$e = $.from_html(`<div></div> <div></div> <div></div>`, 1);
140
+ var root_1$g = $.from_html(`<div></div> <div></div> <div></div>`, 1);
140
141
  var root_3$5 = $.from_html(`<div style="display: contents;"><!></div>`);
141
142
  var root_5$4 = $.from_html(`<div></div>`);
142
143
  var root_4$4 = $.from_html(`<div style="display: contents;"><!> <div><svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></div></div>`);
143
144
  var root_12 = $.from_html(`<div></div>`);
144
145
  var root_16 = $.from_html(`<div></div>`);
145
146
  var root_23 = $.from_html(`<div><div> </div></div>`);
146
- var root$c = $.from_html(`<div data-no-interaction=""><div><!> <!> <div><!> <!> <!> <!></div></div> <!> <!></div>`);
147
+ var root$e = $.from_html(`<div data-no-interaction=""><div><!> <!> <div><!> <!> <!> <!></div></div> <!> <!></div>`);
147
148
  function AnnotationContainer($$anchor, $$props) {
148
149
  $.push($$props, true);
149
150
  let isEditing = $.prop($$props, "isEditing", 3, false), isMultiSelected = $.prop($$props, "isMultiSelected", 3, false), isRotatable = $.prop($$props, "isRotatable", 3, true), lockAspectRatio = $.prop($$props, "lockAspectRatio", 3, false), propsClass = $.prop($$props, "class", 3, ""), outlineOffset = $.prop($$props, "outlineOffset", 3, 1), zIndex = $.prop($$props, "zIndex", 3, 1), restProps = $.rest_props($$props, [
@@ -201,6 +202,11 @@ function AnnotationContainer($$anchor, $$props) {
201
202
  const guardedOnDoubleClick = $.derived(() => permissions.canModifyAnnotations && $$props.onDoubleClick ? $$props.onDoubleClick : void 0);
202
203
  const annotationProvides = $.derived(() => annotationCapability.provides ? annotationCapability.provides.forDocument($$props.documentId) : null);
203
204
  let currentObject = $.derived(() => $.get(preview) ? { ...$$props.trackedAnnotation.object, ...$.get(preview) } : $$props.trackedAnnotation.object);
205
+ const annoFlags = $.derived(() => $$props.trackedAnnotation.object.flags ?? []);
206
+ const hasNoZoom = $.derived(() => $.get(annoFlags).includes("noZoom"));
207
+ const hasNoRotate = $.derived(() => $.get(annoFlags).includes("noRotate"));
208
+ const visualScale = $.derived(() => $.get(hasNoZoom) ? 1 : $$props.scale);
209
+ const effectivePageRotation = $.derived(() => $.get(hasNoRotate) ? 0 : $$props.rotation);
204
210
  const HANDLE_COLOR = $.derived(() => {
205
211
  var _a;
206
212
  return ((_a = $$props.resizeUI) == null ? void 0 : _a.color) ?? "#007ACC";
@@ -278,17 +284,24 @@ function AnnotationContainer($$anchor, $$props) {
278
284
  const effectiveUnrotatedRect = $.derived(() => $.get(explicitUnrotatedRect) ?? $.get(currentObject).rect);
279
285
  const rotationPivot = $.derived(() => $.get(explicitUnrotatedRect) && $.get(annotationRotation) !== 0 ? inferRotationCenterFromRects($.get(effectiveUnrotatedRect), $.get(currentObject).rect, $.get(annotationRotation)) : void 0);
280
286
  const controllerElement = $.derived(() => $.get(effectiveUnrotatedRect));
281
- const aabbWidth = $.derived(() => $.get(currentObject).rect.size.width * $$props.scale);
282
- const aabbHeight = $.derived(() => $.get(currentObject).rect.size.height * $$props.scale);
283
- const innerWidth = $.derived(() => $.get(effectiveUnrotatedRect).size.width * $$props.scale);
284
- const innerHeight = $.derived(() => $.get(effectiveUnrotatedRect).size.height * $$props.scale);
287
+ const aabbWidth = $.derived(() => $.get(currentObject).rect.size.width * $.get(visualScale));
288
+ const aabbHeight = $.derived(() => $.get(currentObject).rect.size.height * $.get(visualScale));
289
+ const innerWidth = $.derived(() => $.get(effectiveUnrotatedRect).size.width * $.get(visualScale));
290
+ const innerHeight = $.derived(() => $.get(effectiveUnrotatedRect).size.height * $.get(visualScale));
285
291
  const usesCustomPivot = $.derived(() => Boolean($.get(explicitUnrotatedRect)) && $.get(annotationRotation) !== 0);
286
- const innerLeft = $.derived(() => $.get(usesCustomPivot) ? ($.get(effectiveUnrotatedRect).origin.x - $.get(currentObject).rect.origin.x) * $$props.scale : ($.get(aabbWidth) - $.get(innerWidth)) / 2);
287
- const innerTop = $.derived(() => $.get(usesCustomPivot) ? ($.get(effectiveUnrotatedRect).origin.y - $.get(currentObject).rect.origin.y) * $$props.scale : ($.get(aabbHeight) - $.get(innerHeight)) / 2);
288
- const innerTransformOrigin = $.derived(() => $.get(usesCustomPivot) && $.get(rotationPivot) ? `${($.get(rotationPivot).x - $.get(effectiveUnrotatedRect).origin.x) * $$props.scale}px ${($.get(rotationPivot).y - $.get(effectiveUnrotatedRect).origin.y) * $$props.scale}px` : "center center");
289
- const centerX = $.derived(() => $.get(rotationPivot) ? ($.get(rotationPivot).x - $.get(currentObject).rect.origin.x) * $$props.scale : $.get(aabbWidth) / 2);
290
- const centerY = $.derived(() => $.get(rotationPivot) ? ($.get(rotationPivot).y - $.get(currentObject).rect.origin.y) * $$props.scale : $.get(aabbHeight) / 2);
292
+ const innerLeft = $.derived(() => $.get(usesCustomPivot) ? ($.get(effectiveUnrotatedRect).origin.x - $.get(currentObject).rect.origin.x) * $.get(visualScale) : ($.get(aabbWidth) - $.get(innerWidth)) / 2);
293
+ const innerTop = $.derived(() => $.get(usesCustomPivot) ? ($.get(effectiveUnrotatedRect).origin.y - $.get(currentObject).rect.origin.y) * $.get(visualScale) : ($.get(aabbHeight) - $.get(innerHeight)) / 2);
294
+ const innerTransformOrigin = $.derived(() => $.get(usesCustomPivot) && $.get(rotationPivot) ? `${($.get(rotationPivot).x - $.get(effectiveUnrotatedRect).origin.x) * $.get(visualScale)}px ${($.get(rotationPivot).y - $.get(effectiveUnrotatedRect).origin.y) * $.get(visualScale)}px` : "center center");
295
+ const centerX = $.derived(() => $.get(rotationPivot) ? ($.get(rotationPivot).x - $.get(currentObject).rect.origin.x) * $.get(visualScale) : $.get(aabbWidth) / 2);
296
+ const centerY = $.derived(() => $.get(rotationPivot) ? ($.get(rotationPivot).y - $.get(currentObject).rect.origin.y) * $.get(visualScale) : $.get(aabbHeight) / 2);
291
297
  const guideLength = $.derived(() => Math.max(300, Math.max($.get(aabbWidth), $.get(aabbHeight)) + 80));
298
+ const counterRot = $.derived(() => $.get(hasNoRotate) ? getCounterRotation(
299
+ {
300
+ origin: { x: 0, y: 0 },
301
+ size: { width: $.get(aabbWidth), height: $.get(aabbHeight) }
302
+ },
303
+ $$props.rotation
304
+ ) : null);
292
305
  const apActive = $.derived(() => {
293
306
  var _a;
294
307
  return !!((_a = $$props.appearance) == null ? void 0 : _a.normal) && !$.get(gestureActive) && !isEditing() && !$$props.trackedAnnotation.dictMode;
@@ -469,7 +482,7 @@ function AnnotationContainer($$anchor, $$props) {
469
482
  };
470
483
  }
471
484
  function buildMenuProps(rect, menuWrapperProps) {
472
- const effectiveAngle = (($.get(annotationRotation) + $$props.rotation * 90) % 360 + 360) % 360;
485
+ const effectiveAngle = (($.get(annotationRotation) + $.get(effectivePageRotation) * 90) % 360 + 360) % 360;
473
486
  const handleNearMenuSide = $.get(effectiveIsRotatable) && effectiveAngle > 90 && effectiveAngle < 270;
474
487
  return {
475
488
  context: buildContext(),
@@ -489,7 +502,7 @@ function AnnotationContainer($$anchor, $$props) {
489
502
  }
490
503
  };
491
504
  }
492
- var div = root$c();
505
+ var div = root$e();
493
506
  var div_1 = $.child(div);
494
507
  $.attribute_effect(div_1, () => ({
495
508
  style: $$props.style || "",
@@ -499,16 +512,18 @@ function AnnotationContainer($$anchor, $$props) {
499
512
  position: "absolute",
500
513
  left: `${$.get(currentObject).rect.origin.x * $$props.scale}px`,
501
514
  top: `${$.get(currentObject).rect.origin.y * $$props.scale}px`,
502
- width: `${$.get(aabbWidth) ?? ""}px`,
503
- height: `${$.get(aabbHeight) ?? ""}px`,
515
+ width: `${($.get(counterRot) ? $.get(counterRot).width : $.get(aabbWidth)) ?? ""}px`,
516
+ height: `${($.get(counterRot) ? $.get(counterRot).height : $.get(aabbHeight)) ?? ""}px`,
504
517
  "pointer-events": "none",
505
- "z-index": zIndex()
518
+ "z-index": zIndex(),
519
+ transform: $.get(counterRot) ? $.get(counterRot).matrix : void 0,
520
+ "transform-origin": $.get(counterRot) ? "0 0" : void 0
506
521
  }
507
522
  }));
508
523
  var node_1 = $.child(div_1);
509
524
  {
510
525
  var consequent = ($$anchor2) => {
511
- var fragment = root_1$e();
526
+ var fragment = root_1$g();
512
527
  var div_2 = $.first_child(fragment);
513
528
  let styles;
514
529
  var div_3 = $.sibling(div_2, 2);
@@ -878,8 +893,8 @@ function AnnotationContainer($$anchor, $$props) {
878
893
  y: $.get(currentObject).rect.origin.y * $$props.scale
879
894
  },
880
895
  size: {
881
- width: $.get(currentObject).rect.size.width * $$props.scale,
882
- height: $.get(currentObject).rect.size.height * $$props.scale
896
+ width: $.get(currentObject).rect.size.width * $.get(visualScale),
897
+ height: $.get(currentObject).rect.size.height * $.get(visualScale)
883
898
  }
884
899
  }));
885
900
  CounterRotate($$anchor2, {
@@ -939,13 +954,64 @@ function AnnotationContainer($$anchor, $$props) {
939
954
  $.pop();
940
955
  }
941
956
  $.delegate(["pointermove"]);
957
+ function mapCounterRotatePoint(x, y, width, height, rotation) {
958
+ switch (rotation) {
959
+ case 1:
960
+ return { x: y, y: height - x };
961
+ case 2:
962
+ return { x: width - x, y: height - y };
963
+ case 3:
964
+ return { x: width - y, y: x };
965
+ default:
966
+ return { x, y };
967
+ }
968
+ }
969
+ function getAnnotationScreenBounds(annotation, scale, rotation) {
970
+ const flags = annotation.object.flags ?? [];
971
+ const hasNoZoom = flags.includes("noZoom");
972
+ const hasNoRotate = flags.includes("noRotate");
973
+ const left = annotation.object.rect.origin.x * scale;
974
+ const top = annotation.object.rect.origin.y * scale;
975
+ const width = annotation.object.rect.size.width * (hasNoZoom ? 1 : scale);
976
+ const height = annotation.object.rect.size.height * (hasNoZoom ? 1 : scale);
977
+ if (!hasNoRotate || rotation === 0) {
978
+ return {
979
+ left,
980
+ top,
981
+ right: left + width,
982
+ bottom: top + height
983
+ };
984
+ }
985
+ const corners = [
986
+ mapCounterRotatePoint(0, 0, width, height, rotation),
987
+ mapCounterRotatePoint(width, 0, width, height, rotation),
988
+ mapCounterRotatePoint(0, height, width, height, rotation),
989
+ mapCounterRotatePoint(width, height, width, height, rotation)
990
+ ];
991
+ let minX = Infinity;
992
+ let minY = Infinity;
993
+ let maxX = -Infinity;
994
+ let maxY = -Infinity;
995
+ for (const corner of corners) {
996
+ if (corner.x < minX) minX = corner.x;
997
+ if (corner.y < minY) minY = corner.y;
998
+ if (corner.x > maxX) maxX = corner.x;
999
+ if (corner.y > maxY) maxY = corner.y;
1000
+ }
1001
+ return {
1002
+ left: left + minX,
1003
+ top: top + minY,
1004
+ right: left + maxX,
1005
+ bottom: top + maxY
1006
+ };
1007
+ }
942
1008
  var root_2$8 = $.from_html(`<div></div> <div></div> <div></div>`, 1);
943
1009
  var root_4$3 = $.from_html(`<div style="display: contents;"><!></div>`);
944
1010
  var root_6$1 = $.from_html(`<div></div>`);
945
1011
  var root_5$3 = $.from_html(`<div style="display: contents;"><!> <div><svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></div></div>`);
946
1012
  var root_10 = $.from_html(`<div></div>`);
947
1013
  var root_11$1 = $.from_html(`<div><div> </div></div>`);
948
- var root_1$d = $.from_html(`<div data-group-selection-box="" data-no-interaction=""><div><!> <!> <div><!></div></div> <!> <!></div>`);
1014
+ var root_1$f = $.from_html(`<div data-group-selection-box="" data-no-interaction=""><div><!> <!> <div><!></div></div> <!> <!></div>`);
949
1015
  function GroupSelectionBox($$anchor, $$props) {
950
1016
  $.push($$props, true);
951
1017
  let isRotatable = $.prop($$props, "isRotatable", 3, true), lockAspectRatio = $.prop($$props, "lockAspectRatio", 3, false), zIndex = $.prop($$props, "zIndex", 3, 2);
@@ -1048,8 +1114,33 @@ function GroupSelectionBox($$anchor, $$props) {
1048
1114
  const groupRotationDisplay = $.derived(() => $.get(liveRotation) ?? 0);
1049
1115
  const rotationActive = $.derived(() => $.get(liveRotation) !== null);
1050
1116
  const normalizedRotationDisplay = $.derived(() => Number.isFinite($.get(groupRotationDisplay)) ? Math.round($.get(groupRotationDisplay) * 10) / 10 : 0);
1051
- const groupBoxWidth = $.derived(() => $.get(previewGroupBox).size.width * $$props.scale);
1052
- const groupBoxHeight = $.derived(() => $.get(previewGroupBox).size.height * $$props.scale);
1117
+ const visualBoundsCorrection = $.derived(() => {
1118
+ let visualLeft = Infinity;
1119
+ let visualTop = Infinity;
1120
+ let visualRight = -Infinity;
1121
+ let visualBottom = -Infinity;
1122
+ for (const ta of $$props.selectedAnnotations) {
1123
+ const bounds = getAnnotationScreenBounds(ta, $$props.scale, $$props.rotation);
1124
+ if (bounds.left < visualLeft) visualLeft = bounds.left;
1125
+ if (bounds.top < visualTop) visualTop = bounds.top;
1126
+ if (bounds.right > visualRight) visualRight = bounds.right;
1127
+ if (bounds.bottom > visualBottom) visualBottom = bounds.bottom;
1128
+ }
1129
+ const logicalLeft = $.get(groupBox).origin.x * $$props.scale;
1130
+ const logicalTop = $.get(groupBox).origin.y * $$props.scale;
1131
+ const logicalRight = ($.get(groupBox).origin.x + $.get(groupBox).size.width) * $$props.scale;
1132
+ const logicalBottom = ($.get(groupBox).origin.y + $.get(groupBox).size.height) * $$props.scale;
1133
+ return {
1134
+ left: visualLeft - logicalLeft,
1135
+ top: visualTop - logicalTop,
1136
+ right: visualRight - logicalRight,
1137
+ bottom: visualBottom - logicalBottom
1138
+ };
1139
+ });
1140
+ const groupBoxLeft = $.derived(() => $.get(previewGroupBox).origin.x * $$props.scale + $.get(visualBoundsCorrection).left);
1141
+ const groupBoxTop = $.derived(() => $.get(previewGroupBox).origin.y * $$props.scale + $.get(visualBoundsCorrection).top);
1142
+ const groupBoxWidth = $.derived(() => $.get(previewGroupBox).size.width * $$props.scale + ($.get(visualBoundsCorrection).right - $.get(visualBoundsCorrection).left));
1143
+ const groupBoxHeight = $.derived(() => $.get(previewGroupBox).size.height * $$props.scale + ($.get(visualBoundsCorrection).bottom - $.get(visualBoundsCorrection).top));
1053
1144
  const groupCenterX = $.derived(() => $.get(groupBoxWidth) / 2);
1054
1145
  const groupCenterY = $.derived(() => $.get(groupBoxHeight) / 2);
1055
1146
  const groupGuideLength = $.derived(() => Math.max(300, Math.max($.get(groupBoxWidth), $.get(groupBoxHeight)) + 80));
@@ -1203,7 +1294,7 @@ function GroupSelectionBox($$anchor, $$props) {
1203
1294
  var node_1 = $.first_child(fragment);
1204
1295
  {
1205
1296
  var consequent_11 = ($$anchor2) => {
1206
- var div = root_1$d();
1297
+ var div = root_1$f();
1207
1298
  var div_1 = $.child(div);
1208
1299
  let styles;
1209
1300
  var node_2 = $.child(div_1);
@@ -1509,14 +1600,8 @@ function GroupSelectionBox($$anchor, $$props) {
1509
1600
  $.append($$anchor4, fragment_7);
1510
1601
  };
1511
1602
  let $0 = $.derived(() => ({
1512
- origin: {
1513
- x: $.get(previewGroupBox).origin.x * $$props.scale,
1514
- y: $.get(previewGroupBox).origin.y * $$props.scale
1515
- },
1516
- size: {
1517
- width: $.get(previewGroupBox).size.width * $$props.scale,
1518
- height: $.get(previewGroupBox).size.height * $$props.scale
1519
- }
1603
+ origin: { x: $.get(groupBoxLeft), y: $.get(groupBoxTop) },
1604
+ size: { width: $.get(groupBoxWidth), height: $.get(groupBoxHeight) }
1520
1605
  }));
1521
1606
  CounterRotate($$anchor3, {
1522
1607
  get rect() {
@@ -1537,8 +1622,8 @@ function GroupSelectionBox($$anchor, $$props) {
1537
1622
  $.reset(div);
1538
1623
  $.template_effect(() => styles = $.set_style(div_1, "", styles, {
1539
1624
  position: "absolute",
1540
- left: `${$.get(previewGroupBox).origin.x * $$props.scale}px`,
1541
- top: `${$.get(previewGroupBox).origin.y * $$props.scale}px`,
1625
+ left: `${$.get(groupBoxLeft) ?? ""}px`,
1626
+ top: `${$.get(groupBoxTop) ?? ""}px`,
1542
1627
  width: `${$.get(groupBoxWidth) ?? ""}px`,
1543
1628
  height: `${$.get(groupBoxHeight) ?? ""}px`,
1544
1629
  "pointer-events": "none",
@@ -1554,9 +1639,9 @@ function GroupSelectionBox($$anchor, $$props) {
1554
1639
  $.pop();
1555
1640
  }
1556
1641
  $.delegate(["pointermove"]);
1557
- var root_1$c = $.from_svg(`<path fill="none" stroke="transparent"></path>`);
1642
+ var root_1$e = $.from_svg(`<path fill="none" stroke="transparent"></path>`);
1558
1643
  var root_3$4 = $.from_svg(`<path fill="none"></path>`);
1559
- var root$b = $.from_svg(`<svg><!><!></svg>`);
1644
+ var root$d = $.from_svg(`<svg><!><!></svg>`);
1560
1645
  function Ink($$anchor, $$props) {
1561
1646
  $.push($$props, true);
1562
1647
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -1575,19 +1660,15 @@ function Ink($$anchor, $$props) {
1575
1660
  const width = $.derived(() => $$props.rect.size.width * $$props.scale);
1576
1661
  const height = $.derived(() => $$props.rect.size.height * $$props.scale);
1577
1662
  const hitStrokeWidth = $.derived(() => Math.max($$props.strokeWidth, MIN_HIT_AREA_SCREEN_PX / $$props.scale));
1578
- var svg = root$b();
1663
+ var svg = root$d();
1579
1664
  let styles;
1580
1665
  var node = $.child(svg);
1581
1666
  $.each(node, 19, () => $.get(paths), (d, i) => `hit-${i}`, ($$anchor2, d) => {
1582
- var path = root_1$c();
1667
+ var path = root_1$e();
1583
1668
  path.__pointerdown = function(...$$args) {
1584
1669
  var _a;
1585
1670
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
1586
1671
  };
1587
- path.__touchstart = function(...$$args) {
1588
- var _a;
1589
- (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
1590
- };
1591
1672
  let styles_1;
1592
1673
  $.template_effect(() => {
1593
1674
  $.set_attribute(path, "d", $.get(d));
@@ -1638,7 +1719,7 @@ function Ink($$anchor, $$props) {
1638
1719
  $.append($$anchor, svg);
1639
1720
  $.pop();
1640
1721
  }
1641
- $.delegate(["pointerdown", "touchstart"]);
1722
+ $.delegate(["pointerdown"]);
1642
1723
  function InkRenderer($$anchor, $$props) {
1643
1724
  Ink($$anchor, $.spread_props(() => $$props.currentObject, {
1644
1725
  get isSelected() {
@@ -1655,8 +1736,8 @@ function InkRenderer($$anchor, $$props) {
1655
1736
  }
1656
1737
  }));
1657
1738
  }
1658
- var root_1$b = $.from_svg(`<rect></rect>`);
1659
- var root$a = $.from_svg(`<svg overflow="visible"><rect fill="transparent" stroke="transparent"></rect><!></svg>`);
1739
+ var root_1$d = $.from_svg(`<rect></rect>`);
1740
+ var root$c = $.from_svg(`<svg overflow="visible"><rect fill="transparent" stroke="transparent"></rect><!></svg>`);
1660
1741
  function Square($$anchor, $$props) {
1661
1742
  $.push($$props, true);
1662
1743
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -1680,22 +1761,18 @@ function Square($$anchor, $$props) {
1680
1761
  var _a;
1681
1762
  return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
1682
1763
  });
1683
- var svg = root$a();
1764
+ var svg = root$c();
1684
1765
  let styles;
1685
1766
  var rect_1 = $.child(svg);
1686
1767
  rect_1.__pointerdown = function(...$$args) {
1687
1768
  var _a;
1688
1769
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
1689
1770
  };
1690
- rect_1.__touchstart = function(...$$args) {
1691
- var _a;
1692
- (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
1693
- };
1694
1771
  let styles_1;
1695
1772
  var node = $.sibling(rect_1);
1696
1773
  {
1697
1774
  var consequent = ($$anchor2) => {
1698
- var rect_2 = root_1$b();
1775
+ var rect_2 = root_1$d();
1699
1776
  let styles_2;
1700
1777
  $.template_effect(() => {
1701
1778
  $.set_attribute(rect_2, "x", $.get(x));
@@ -1739,7 +1816,7 @@ function Square($$anchor, $$props) {
1739
1816
  $.append($$anchor, svg);
1740
1817
  $.pop();
1741
1818
  }
1742
- $.delegate(["pointerdown", "touchstart"]);
1819
+ $.delegate(["pointerdown"]);
1743
1820
  function SquareRenderer($$anchor, $$props) {
1744
1821
  Square($$anchor, $.spread_props(() => $$props.currentObject, {
1745
1822
  get isSelected() {
@@ -1756,8 +1833,8 @@ function SquareRenderer($$anchor, $$props) {
1756
1833
  }
1757
1834
  }));
1758
1835
  }
1759
- var root_1$a = $.from_svg(`<ellipse></ellipse>`);
1760
- var root$9 = $.from_svg(`<svg overflow="visible"><ellipse fill="transparent" stroke="transparent"></ellipse><!></svg>`);
1836
+ var root_1$c = $.from_svg(`<ellipse></ellipse>`);
1837
+ var root$b = $.from_svg(`<svg overflow="visible"><ellipse fill="transparent" stroke="transparent"></ellipse><!></svg>`);
1761
1838
  function Circle($$anchor, $$props) {
1762
1839
  $.push($$props, true);
1763
1840
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -1780,22 +1857,18 @@ function Circle($$anchor, $$props) {
1780
1857
  let svgHeight = $.derived(() => $.get(height) * $$props.scale);
1781
1858
  let hitStrokeWidth = $.derived(() => Math.max($$props.strokeWidth, MIN_HIT_AREA_SCREEN_PX / $$props.scale));
1782
1859
  let peValue = $.derived(() => $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible");
1783
- var svg = root$9();
1860
+ var svg = root$b();
1784
1861
  let styles;
1785
1862
  var ellipse = $.child(svg);
1786
1863
  ellipse.__pointerdown = (e) => {
1787
1864
  var _a;
1788
1865
  return (_a = $$props.onClick) == null ? void 0 : _a.call($$props, e);
1789
1866
  };
1790
- ellipse.__touchstart = (e) => {
1791
- var _a;
1792
- return (_a = $$props.onClick) == null ? void 0 : _a.call($$props, e);
1793
- };
1794
1867
  let styles_1;
1795
1868
  var node = $.sibling(ellipse);
1796
1869
  {
1797
1870
  var consequent = ($$anchor2) => {
1798
- var ellipse_1 = root_1$a();
1871
+ var ellipse_1 = root_1$c();
1799
1872
  $.set_style(ellipse_1, "", {}, { "pointer-events": "none" });
1800
1873
  $.template_effect(
1801
1874
  ($0) => {
@@ -1845,7 +1918,7 @@ function Circle($$anchor, $$props) {
1845
1918
  $.append($$anchor, svg);
1846
1919
  $.pop();
1847
1920
  }
1848
- $.delegate(["pointerdown", "touchstart"]);
1921
+ $.delegate(["pointerdown"]);
1849
1922
  function CircleRenderer($$anchor, $$props) {
1850
1923
  Circle($$anchor, $.spread_props(() => $$props.currentObject, {
1851
1924
  get isSelected() {
@@ -1862,12 +1935,12 @@ function CircleRenderer($$anchor, $$props) {
1862
1935
  }
1863
1936
  }));
1864
1937
  }
1865
- var root_1$9 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
1938
+ var root_1$b = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
1866
1939
  var root_2$7 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
1867
1940
  var root_4$2 = $.from_svg(`<path></path>`);
1868
1941
  var root_5$2 = $.from_svg(`<path></path>`);
1869
1942
  var root_3$3 = $.from_svg(`<line></line><!><!>`, 1);
1870
- var root$8 = $.from_svg(`<svg><line stroke="transparent"></line><!><!><!></svg>`);
1943
+ var root$a = $.from_svg(`<svg><line stroke="transparent"></line><!><!><!></svg>`);
1871
1944
  function Line($$anchor, $$props) {
1872
1945
  $.push($$props, true);
1873
1946
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -1891,30 +1964,22 @@ function Line($$anchor, $$props) {
1891
1964
  var _a;
1892
1965
  return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
1893
1966
  });
1894
- var svg = root$8();
1967
+ var svg = root$a();
1895
1968
  let styles;
1896
1969
  var line = $.child(svg);
1897
1970
  line.__pointerdown = function(...$$args) {
1898
1971
  var _a;
1899
1972
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
1900
1973
  };
1901
- line.__touchstart = function(...$$args) {
1902
- var _a;
1903
- (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
1904
- };
1905
1974
  let styles_1;
1906
1975
  var node = $.sibling(line);
1907
1976
  {
1908
1977
  var consequent = ($$anchor2) => {
1909
- var path = root_1$9();
1978
+ var path = root_1$b();
1910
1979
  path.__pointerdown = function(...$$args) {
1911
1980
  var _a;
1912
1981
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
1913
1982
  };
1914
- path.__touchstart = function(...$$args) {
1915
- var _a;
1916
- (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
1917
- };
1918
1983
  let styles_2;
1919
1984
  $.template_effect(() => {
1920
1985
  $.set_attribute(path, "d", $.get(endings).start.d);
@@ -1940,10 +2005,6 @@ function Line($$anchor, $$props) {
1940
2005
  var _a;
1941
2006
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
1942
2007
  };
1943
- path_1.__touchstart = function(...$$args) {
1944
- var _a;
1945
- (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
1946
- };
1947
2008
  let styles_3;
1948
2009
  $.template_effect(() => {
1949
2010
  $.set_attribute(path_1, "d", $.get(endings).end.d);
@@ -2053,7 +2114,7 @@ function Line($$anchor, $$props) {
2053
2114
  $.append($$anchor, svg);
2054
2115
  $.pop();
2055
2116
  }
2056
- $.delegate(["pointerdown", "touchstart"]);
2117
+ $.delegate(["pointerdown"]);
2057
2118
  function LineRenderer($$anchor, $$props) {
2058
2119
  Line($$anchor, $.spread_props(() => $$props.currentObject, {
2059
2120
  get isSelected() {
@@ -2070,16 +2131,16 @@ function LineRenderer($$anchor, $$props) {
2070
2131
  }
2071
2132
  }));
2072
2133
  }
2073
- var root_1$8 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2134
+ var root_1$a = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2074
2135
  var root_2$6 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2075
2136
  var root_4$1 = $.from_svg(`<path></path>`);
2076
2137
  var root_5$1 = $.from_svg(`<path></path>`);
2077
2138
  var root_3$2 = $.from_svg(`<path></path><!><!>`, 1);
2078
- var root$7 = $.from_svg(`<svg><path fill="none" stroke="transparent"></path><!><!><!></svg>`);
2139
+ var root$9 = $.from_svg(`<svg><path fill="none" stroke="transparent"></path><!><!><!></svg>`);
2079
2140
  function Polyline($$anchor, $$props) {
2080
2141
  $.push($$props, true);
2081
2142
  const MIN_HIT_AREA_SCREEN_PX = 20;
2082
- let color = $.prop($$props, "color", 3, "transparent"), strokeColor = $.prop($$props, "strokeColor", 3, "#000000"), opacity = $.prop($$props, "opacity", 3, 1), appearanceActive = $.prop($$props, "appearanceActive", 3, false);
2143
+ let color = $.prop($$props, "color", 3, "transparent"), strokeColor = $.prop($$props, "strokeColor", 3, "#000000"), opacity = $.prop($$props, "opacity", 3, 1), strokeStyle = $.prop($$props, "strokeStyle", 19, () => PdfAnnotationBorderStyle.SOLID), appearanceActive = $.prop($$props, "appearanceActive", 3, false);
2083
2144
  const localPts = $.derived(() => $$props.vertices.map(({ x, y }) => ({ x: x - $$props.rect.origin.x, y: y - $$props.rect.origin.y })));
2084
2145
  const pathData = $.derived(() => {
2085
2146
  if (!$.get(localPts).length) return "";
@@ -2099,30 +2160,26 @@ function Polyline($$anchor, $$props) {
2099
2160
  const width = $.derived(() => $$props.rect.size.width * $$props.scale);
2100
2161
  const height = $.derived(() => $$props.rect.size.height * $$props.scale);
2101
2162
  const hitStrokeWidth = $.derived(() => Math.max($$props.strokeWidth, MIN_HIT_AREA_SCREEN_PX / $$props.scale));
2102
- var svg = root$7();
2163
+ const dash = $.derived(() => {
2164
+ var _a;
2165
+ return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
2166
+ });
2167
+ var svg = root$9();
2103
2168
  let styles;
2104
2169
  var path = $.child(svg);
2105
2170
  path.__pointerdown = function(...$$args) {
2106
2171
  var _a;
2107
2172
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
2108
2173
  };
2109
- path.__touchstart = function(...$$args) {
2110
- var _a;
2111
- (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
2112
- };
2113
2174
  let styles_1;
2114
2175
  var node = $.sibling(path);
2115
2176
  {
2116
2177
  var consequent = ($$anchor2) => {
2117
- var path_1 = root_1$8();
2178
+ var path_1 = root_1$a();
2118
2179
  path_1.__pointerdown = function(...$$args) {
2119
2180
  var _a;
2120
2181
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
2121
2182
  };
2122
- path_1.__touchstart = function(...$$args) {
2123
- var _a;
2124
- (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
2125
- };
2126
2183
  let styles_2;
2127
2184
  $.template_effect(() => {
2128
2185
  $.set_attribute(path_1, "d", $.get(endings).start.d);
@@ -2148,10 +2205,6 @@ function Polyline($$anchor, $$props) {
2148
2205
  var _a;
2149
2206
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
2150
2207
  };
2151
- path_2.__touchstart = function(...$$args) {
2152
- var _a;
2153
- (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
2154
- };
2155
2208
  let styles_3;
2156
2209
  $.template_effect(() => {
2157
2210
  $.set_attribute(path_2, "d", $.get(endings).end.d);
@@ -2188,7 +2241,8 @@ function Polyline($$anchor, $$props) {
2188
2241
  styles_5 = $.set_style(path_4, "", styles_5, {
2189
2242
  "pointer-events": "none",
2190
2243
  "stroke-width": $$props.strokeWidth,
2191
- "stroke-linecap": "butt"
2244
+ "stroke-linecap": "butt",
2245
+ "stroke-dasharray": $.get(dash)
2192
2246
  });
2193
2247
  });
2194
2248
  $.append($$anchor3, path_4);
@@ -2210,7 +2264,8 @@ function Polyline($$anchor, $$props) {
2210
2264
  styles_6 = $.set_style(path_5, "", styles_6, {
2211
2265
  "pointer-events": "none",
2212
2266
  "stroke-width": $$props.strokeWidth,
2213
- "stroke-linecap": "butt"
2267
+ "stroke-linecap": "butt",
2268
+ "stroke-dasharray": $.get(dash)
2214
2269
  });
2215
2270
  });
2216
2271
  $.append($$anchor3, path_5);
@@ -2228,7 +2283,8 @@ function Polyline($$anchor, $$props) {
2228
2283
  "stroke-width": $$props.strokeWidth,
2229
2284
  "pointer-events": "none",
2230
2285
  "stroke-linecap": "butt",
2231
- "stroke-linejoin": "miter"
2286
+ "stroke-linejoin": "miter",
2287
+ "stroke-dasharray": $.get(dash)
2232
2288
  });
2233
2289
  });
2234
2290
  $.append($$anchor2, fragment);
@@ -2255,7 +2311,7 @@ function Polyline($$anchor, $$props) {
2255
2311
  $.append($$anchor, svg);
2256
2312
  $.pop();
2257
2313
  }
2258
- $.delegate(["pointerdown", "touchstart"]);
2314
+ $.delegate(["pointerdown"]);
2259
2315
  function PolylineRenderer($$anchor, $$props) {
2260
2316
  Polyline($$anchor, $.spread_props(() => $$props.currentObject, {
2261
2317
  get isSelected() {
@@ -2274,8 +2330,8 @@ function PolylineRenderer($$anchor, $$props) {
2274
2330
  }
2275
2331
  var root_2$5 = $.from_svg(`<path fill="none"></path>`);
2276
2332
  var root_3$1 = $.from_svg(`<rect></rect>`);
2277
- var root_1$7 = $.from_svg(`<path></path><!><!>`, 1);
2278
- var root$6 = $.from_svg(`<svg><path fill="transparent" stroke="transparent"></path><!></svg>`);
2333
+ var root_1$9 = $.from_svg(`<path></path><!><!>`, 1);
2334
+ var root$8 = $.from_svg(`<svg><path fill="transparent" stroke="transparent"></path><!></svg>`);
2279
2335
  function Polygon($$anchor, $$props) {
2280
2336
  $.push($$props, true);
2281
2337
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -2296,22 +2352,18 @@ function Polygon($$anchor, $$props) {
2296
2352
  var _a;
2297
2353
  return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
2298
2354
  });
2299
- var svg = root$6();
2355
+ var svg = root$8();
2300
2356
  let styles;
2301
2357
  var path = $.child(svg);
2302
2358
  path.__pointerdown = function(...$$args) {
2303
2359
  var _a;
2304
2360
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
2305
2361
  };
2306
- path.__touchstart = function(...$$args) {
2307
- var _a;
2308
- (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
2309
- };
2310
2362
  let styles_1;
2311
2363
  var node = $.sibling(path);
2312
2364
  {
2313
2365
  var consequent_2 = ($$anchor2) => {
2314
- var fragment = root_1$7();
2366
+ var fragment = root_1$9();
2315
2367
  var path_1 = $.first_child(fragment);
2316
2368
  let styles_2;
2317
2369
  var node_1 = $.sibling(path_1);
@@ -2393,7 +2445,7 @@ function Polygon($$anchor, $$props) {
2393
2445
  $.append($$anchor, svg);
2394
2446
  $.pop();
2395
2447
  }
2396
- $.delegate(["pointerdown", "touchstart"]);
2448
+ $.delegate(["pointerdown"]);
2397
2449
  function PolygonRenderer($$anchor, $$props) {
2398
2450
  Polygon($$anchor, $.spread_props(() => $$props.currentObject, {
2399
2451
  get isSelected() {
@@ -2410,7 +2462,7 @@ function PolygonRenderer($$anchor, $$props) {
2410
2462
  }
2411
2463
  }));
2412
2464
  }
2413
- var root$5 = $.from_html(`<div role="button"><span role="textbox" tabindex="0"> </span></div>`);
2465
+ var root$7 = $.from_html(`<div role="button"><span role="textbox" tabindex="0"> </span></div>`);
2414
2466
  function FreeText($$anchor, $$props) {
2415
2467
  $.push($$props, true);
2416
2468
  let appearanceActive = $.prop($$props, "appearanceActive", 3, false);
@@ -2457,16 +2509,12 @@ function FreeText($$anchor, $$props) {
2457
2509
  const outerH = $.derived(() => $$props.annotation.object.rect.size.height * $$props.scale);
2458
2510
  const justify = $.derived(() => $$props.annotation.object.verticalAlign === PdfVerticalAlignment.Top ? "flex-start" : $$props.annotation.object.verticalAlign === PdfVerticalAlignment.Middle ? "center" : "flex-end");
2459
2511
  const fontCss = $.derived(() => standardFontCssProperties($$props.annotation.object.fontFamily));
2460
- var div = root$5();
2512
+ var div = root$7();
2461
2513
  $.set_attribute(div, "tabindex", -1);
2462
2514
  div.__pointerdown = function(...$$args) {
2463
2515
  var _a;
2464
2516
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
2465
2517
  };
2466
- div.__touchstart = function(...$$args) {
2467
- var _a;
2468
- (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
2469
- };
2470
2518
  let styles;
2471
2519
  var span = $.child(div);
2472
2520
  let styles_1;
@@ -2517,7 +2565,7 @@ function FreeText($$anchor, $$props) {
2517
2565
  $.append($$anchor, div);
2518
2566
  $.pop();
2519
2567
  }
2520
- $.delegate(["pointerdown", "touchstart"]);
2568
+ $.delegate(["pointerdown"]);
2521
2569
  function FreeTextRenderer($$anchor, $$props) {
2522
2570
  {
2523
2571
  let $0 = $.derived(() => ({ ...$$props.annotation, object: $$props.currentObject }));
@@ -2549,7 +2597,7 @@ function FreeTextRenderer($$anchor, $$props) {
2549
2597
  });
2550
2598
  }
2551
2599
  }
2552
- var root_1$6 = $.from_html(`<img/>`);
2600
+ var root_1$8 = $.from_html(`<img/>`);
2553
2601
  function RenderAnnotation($$anchor, $$props) {
2554
2602
  $.push($$props, true);
2555
2603
  let scaleFactor = $.prop($$props, "scaleFactor", 3, 1), unrotated = $.prop($$props, "unrotated", 3, false), restProps = $.rest_props($$props, [
@@ -2612,7 +2660,7 @@ function RenderAnnotation($$anchor, $$props) {
2612
2660
  var node = $.first_child(fragment);
2613
2661
  {
2614
2662
  var consequent = ($$anchor2) => {
2615
- var img = root_1$6();
2663
+ var img = root_1$8();
2616
2664
  $.attribute_effect(img, () => ({
2617
2665
  alt: "",
2618
2666
  src: $.get(imageUrl),
@@ -2631,7 +2679,7 @@ function RenderAnnotation($$anchor, $$props) {
2631
2679
  $.append($$anchor, fragment);
2632
2680
  $.pop();
2633
2681
  }
2634
- var root$4 = $.from_html(`<div role="button"><!></div>`);
2682
+ var root$6 = $.from_html(`<div role="button"><!></div>`);
2635
2683
  function Stamp($$anchor, $$props) {
2636
2684
  $.push($$props, true);
2637
2685
  let annotationProp = $.derived(() => ({
@@ -2639,17 +2687,13 @@ function Stamp($$anchor, $$props) {
2639
2687
  id: $$props.annotation.object.id
2640
2688
  }));
2641
2689
  const unrotated = $.derived(() => !!$$props.annotation.object.rotation && !!$$props.annotation.object.unrotatedRect);
2642
- var div = root$4();
2690
+ var div = root$6();
2643
2691
  $.set_attribute(div, "tabindex", -1);
2644
2692
  let styles;
2645
2693
  div.__pointerdown = function(...$$args) {
2646
2694
  var _a;
2647
2695
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
2648
2696
  };
2649
- div.__touchstart = function(...$$args) {
2650
- var _a;
2651
- (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
2652
- };
2653
2697
  var node = $.child(div);
2654
2698
  RenderAnnotation(node, {
2655
2699
  get documentId() {
@@ -2676,7 +2720,7 @@ function Stamp($$anchor, $$props) {
2676
2720
  $.append($$anchor, div);
2677
2721
  $.pop();
2678
2722
  }
2679
- $.delegate(["pointerdown", "touchstart"]);
2723
+ $.delegate(["pointerdown"]);
2680
2724
  function StampRenderer($$anchor, $$props) {
2681
2725
  Stamp($$anchor, {
2682
2726
  get documentId() {
@@ -2699,9 +2743,9 @@ function StampRenderer($$anchor, $$props) {
2699
2743
  }
2700
2744
  });
2701
2745
  }
2702
- var root_1$5 = $.from_svg(`<line></line>`);
2746
+ var root_1$7 = $.from_svg(`<line></line>`);
2703
2747
  var root_2$4 = $.from_svg(`<rect fill="transparent"></rect>`);
2704
- var root$3 = $.from_svg(`<svg><rect fill="transparent"></rect><!></svg>`);
2748
+ var root$5 = $.from_svg(`<svg><rect fill="transparent"></rect><!></svg>`);
2705
2749
  function Link($$anchor, $$props) {
2706
2750
  $.push($$props, true);
2707
2751
  let strokeColor = $.prop($$props, "strokeColor", 3, "#0000FF"), strokeWidth = $.prop($$props, "strokeWidth", 3, 2), strokeStyle = $.prop($$props, "strokeStyle", 19, () => PdfAnnotationBorderStyle.UNDERLINE), hasIRT = $.prop($$props, "hasIRT", 3, false);
@@ -2719,7 +2763,7 @@ function Link($$anchor, $$props) {
2719
2763
  const isUnderline = $.derived(() => strokeStyle() === PdfAnnotationBorderStyle.UNDERLINE);
2720
2764
  const hitAreaCursor = $.derived(() => hasIRT() ? "default" : $$props.isSelected ? "move" : "pointer");
2721
2765
  const hitAreaPointerEvents = $.derived(() => hasIRT() ? "none" : $$props.isSelected ? "none" : "visible");
2722
- var svg = root$3();
2766
+ var svg = root$5();
2723
2767
  let styles;
2724
2768
  var rect_1 = $.child(svg);
2725
2769
  $.set_attribute(rect_1, "x", 0);
@@ -2728,15 +2772,11 @@ function Link($$anchor, $$props) {
2728
2772
  var _a;
2729
2773
  (_a = hasIRT() ? void 0 : $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
2730
2774
  };
2731
- rect_1.__touchstart = function(...$$args) {
2732
- var _a;
2733
- (_a = hasIRT() ? void 0 : $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
2734
- };
2735
2775
  let styles_1;
2736
2776
  var node = $.sibling(rect_1);
2737
2777
  {
2738
2778
  var consequent = ($$anchor2) => {
2739
- var line = root_1$5();
2779
+ var line = root_1$7();
2740
2780
  $.set_attribute(line, "x1", 1);
2741
2781
  $.set_style(line, "", {}, { "pointer-events": "none" });
2742
2782
  $.template_effect(() => {
@@ -2793,7 +2833,7 @@ function Link($$anchor, $$props) {
2793
2833
  $.append($$anchor, svg);
2794
2834
  $.pop();
2795
2835
  }
2796
- $.delegate(["pointerdown", "touchstart"]);
2836
+ $.delegate(["pointerdown"]);
2797
2837
  function LinkRenderer($$anchor, $$props) {
2798
2838
  $.push($$props, true);
2799
2839
  {
@@ -2815,7 +2855,7 @@ function LinkRenderer($$anchor, $$props) {
2815
2855
  }
2816
2856
  $.pop();
2817
2857
  }
2818
- var root_1$4 = $.from_html(`<div></div>`);
2858
+ var root_1$6 = $.from_html(`<div></div>`);
2819
2859
  function Highlight($$anchor, $$props) {
2820
2860
  $.push($$props, true);
2821
2861
  let opacity = $.prop($$props, "opacity", 3, 0.5), appearanceActive = $.prop($$props, "appearanceActive", 3, false);
@@ -2823,14 +2863,13 @@ function Highlight($$anchor, $$props) {
2823
2863
  var fragment = $.comment();
2824
2864
  var node = $.first_child(fragment);
2825
2865
  $.each(node, 17, () => $$props.segmentRects, $.index, ($$anchor2, b) => {
2826
- var div = root_1$4();
2866
+ var div = root_1$6();
2827
2867
  $.attribute_effect(
2828
2868
  div,
2829
2869
  ($0) => ({
2830
2870
  role: "button",
2831
2871
  tabindex: $$props.onClick ? 0 : -1,
2832
2872
  onpointerdown: $$props.onClick,
2833
- ontouchstart: $$props.onClick,
2834
2873
  ...$0,
2835
2874
  [$.STYLE]: {
2836
2875
  position: "absolute",
@@ -2868,7 +2907,7 @@ function HighlightRenderer($$anchor, $$props) {
2868
2907
  }));
2869
2908
  }
2870
2909
  var root_2$3 = $.from_html(`<div></div>`);
2871
- var root_1$3 = $.from_html(`<div><!></div>`);
2910
+ var root_1$5 = $.from_html(`<div><!></div>`);
2872
2911
  function Underline($$anchor, $$props) {
2873
2912
  $.push($$props, true);
2874
2913
  let opacity = $.prop($$props, "opacity", 3, 0.5), appearanceActive = $.prop($$props, "appearanceActive", 3, false);
@@ -2877,14 +2916,13 @@ function Underline($$anchor, $$props) {
2877
2916
  var fragment = $.comment();
2878
2917
  var node = $.first_child(fragment);
2879
2918
  $.each(node, 17, () => $$props.segmentRects, $.index, ($$anchor2, r) => {
2880
- var div = root_1$3();
2919
+ var div = root_1$5();
2881
2920
  $.attribute_effect(
2882
2921
  div,
2883
2922
  ($0) => ({
2884
2923
  role: "button",
2885
2924
  tabindex: $$props.onClick ? 0 : -1,
2886
2925
  onpointerdown: $$props.onClick,
2887
- ontouchstart: $$props.onClick,
2888
2926
  ...$0,
2889
2927
  [$.STYLE]: {
2890
2928
  position: "absolute",
@@ -2943,7 +2981,7 @@ function UnderlineRenderer($$anchor, $$props) {
2943
2981
  }));
2944
2982
  }
2945
2983
  var root_2$2 = $.from_html(`<div></div>`);
2946
- var root_1$2 = $.from_html(`<div><!></div>`);
2984
+ var root_1$4 = $.from_html(`<div><!></div>`);
2947
2985
  function Strikeout($$anchor, $$props) {
2948
2986
  $.push($$props, true);
2949
2987
  let opacity = $.prop($$props, "opacity", 3, 0.5), appearanceActive = $.prop($$props, "appearanceActive", 3, false);
@@ -2952,14 +2990,13 @@ function Strikeout($$anchor, $$props) {
2952
2990
  var fragment = $.comment();
2953
2991
  var node = $.first_child(fragment);
2954
2992
  $.each(node, 17, () => $$props.segmentRects, $.index, ($$anchor2, r) => {
2955
- var div = root_1$2();
2993
+ var div = root_1$4();
2956
2994
  $.attribute_effect(
2957
2995
  div,
2958
2996
  ($0) => ({
2959
2997
  role: "button",
2960
2998
  tabindex: $$props.onClick ? 0 : -1,
2961
2999
  onpointerdown: $$props.onClick,
2962
- ontouchstart: $$props.onClick,
2963
3000
  ...$0,
2964
3001
  [$.STYLE]: {
2965
3002
  position: "absolute",
@@ -3019,7 +3056,7 @@ function StrikeoutRenderer($$anchor, $$props) {
3019
3056
  }));
3020
3057
  }
3021
3058
  var root_2$1 = $.from_html(`<div></div>`);
3022
- var root_1$1 = $.from_html(`<div><!></div>`);
3059
+ var root_1$3 = $.from_html(`<div><!></div>`);
3023
3060
  function Squiggly($$anchor, $$props) {
3024
3061
  $.push($$props, true);
3025
3062
  let opacity = $.prop($$props, "opacity", 3, 0.5), appearanceActive = $.prop($$props, "appearanceActive", 3, false);
@@ -3034,14 +3071,13 @@ function Squiggly($$anchor, $$props) {
3034
3071
  var fragment = $.comment();
3035
3072
  var node = $.first_child(fragment);
3036
3073
  $.each(node, 17, () => $$props.segmentRects, $.index, ($$anchor2, r) => {
3037
- var div = root_1$1();
3074
+ var div = root_1$3();
3038
3075
  $.attribute_effect(
3039
3076
  div,
3040
3077
  ($0) => ({
3041
3078
  role: "button",
3042
3079
  tabindex: $$props.onClick ? 0 : -1,
3043
3080
  onpointerdown: $$props.onClick,
3044
- ontouchstart: $$props.onClick,
3045
3081
  ...$0,
3046
3082
  [$.STYLE]: {
3047
3083
  position: "absolute",
@@ -3101,6 +3137,160 @@ function SquigglyRenderer($$anchor, $$props) {
3101
3137
  }
3102
3138
  }));
3103
3139
  }
3140
+ var root_1$2 = $.from_svg(`<path fill-rule="evenodd"></path>`);
3141
+ var root$4 = $.from_svg(`<svg overflow="visible"><path fill="transparent" stroke="transparent"></path><!></svg>`);
3142
+ function Caret($$anchor, $$props) {
3143
+ $.push($$props, true);
3144
+ let strokeColor = $.prop($$props, "strokeColor", 3, "#000000"), opacity = $.prop($$props, "opacity", 3, 1), appearanceActive = $.prop($$props, "appearanceActive", 3, false);
3145
+ const $$d = $.derived(() => {
3146
+ const w = $$props.rect.size.width;
3147
+ const h = $$props.rect.size.height;
3148
+ const midX = w / 2;
3149
+ const d = [
3150
+ `M 0 ${h}`,
3151
+ `C ${w * 0.27} ${h} ${midX} ${h - h * 0.44} ${midX} 0`,
3152
+ `C ${midX} ${h - h * 0.44} ${w - w * 0.27} ${h} ${w} ${h}`,
3153
+ "Z"
3154
+ ].join(" ");
3155
+ return { width: w, height: h, path: d };
3156
+ }), width = $.derived(() => $.get($$d).width), height = $.derived(() => $.get($$d).height), path = $.derived(() => $.get($$d).path);
3157
+ let svgWidth = $.derived(() => $.get(width) * $$props.scale);
3158
+ let svgHeight = $.derived(() => $.get(height) * $$props.scale);
3159
+ var svg = root$4();
3160
+ let styles;
3161
+ var path_1 = $.child(svg);
3162
+ $.set_attribute(path_1, "stroke-width", 4);
3163
+ path_1.__pointerdown = (e) => {
3164
+ var _a;
3165
+ return (_a = $$props.onClick) == null ? void 0 : _a.call($$props, e);
3166
+ };
3167
+ let styles_1;
3168
+ var node = $.sibling(path_1);
3169
+ {
3170
+ var consequent = ($$anchor2) => {
3171
+ var path_2 = root_1$2();
3172
+ $.set_attribute(path_2, "stroke-width", 0.5);
3173
+ $.set_style(path_2, "", {}, { "pointer-events": "none" });
3174
+ $.template_effect(() => {
3175
+ $.set_attribute(path_2, "d", $.get(path));
3176
+ $.set_attribute(path_2, "fill", strokeColor());
3177
+ $.set_attribute(path_2, "stroke", strokeColor());
3178
+ $.set_attribute(path_2, "opacity", opacity());
3179
+ });
3180
+ $.append($$anchor2, path_2);
3181
+ };
3182
+ $.if(node, ($$render) => {
3183
+ if (!appearanceActive()) $$render(consequent);
3184
+ });
3185
+ }
3186
+ $.reset(svg);
3187
+ $.template_effect(() => {
3188
+ $.set_attribute(svg, "width", $.get(svgWidth));
3189
+ $.set_attribute(svg, "height", $.get(svgHeight));
3190
+ $.set_attribute(svg, "viewBox", `0 0 ${$.get(width)} ${$.get(height)}`);
3191
+ styles = $.set_style(svg, "", styles, {
3192
+ position: "absolute",
3193
+ width: `${$.get(svgWidth)}px`,
3194
+ height: `${$.get(svgHeight)}px`,
3195
+ "pointer-events": "none",
3196
+ "z-index": "2"
3197
+ });
3198
+ $.set_attribute(path_1, "d", $.get(path));
3199
+ $.set_attribute(path_1, "pointer-events", $$props.isSelected ? "none" : "visible");
3200
+ styles_1 = $.set_style(path_1, "", styles_1, { cursor: $$props.isSelected ? "move" : "pointer" });
3201
+ });
3202
+ $.append($$anchor, svg);
3203
+ $.pop();
3204
+ }
3205
+ $.delegate(["pointerdown"]);
3206
+ function CaretRenderer($$anchor, $$props) {
3207
+ Caret($$anchor, $.spread_props(() => $$props.currentObject, {
3208
+ get isSelected() {
3209
+ return $$props.isSelected;
3210
+ },
3211
+ get scale() {
3212
+ return $$props.scale;
3213
+ },
3214
+ get onClick() {
3215
+ return $$props.onClick;
3216
+ },
3217
+ get appearanceActive() {
3218
+ return $$props.appearanceActive;
3219
+ }
3220
+ }));
3221
+ }
3222
+ var root_1$1 = $.from_svg(`<svg viewBox="0 0 20 20" width="100%" height="100%"><path d="M 0.5 15.5 L 0.5 0.5 L 19.5 0.5 L 19.5 15.5 L 8.5 15.5 L 6.5 19.5 L 4.5 15.5 Z" stroke-width="1" stroke-linejoin="miter"></path><line x1="2.5" y1="4.25" x2="17.5" y2="4.25" stroke-width="1"></line><line x1="2.5" y1="8" x2="17.5" y2="8" stroke-width="1"></line><line x1="2.5" y1="11.75" x2="17.5" y2="11.75" stroke-width="1"></line></svg>`);
3223
+ var root$3 = $.from_html(`<div><!></div>`);
3224
+ function Text($$anchor, $$props) {
3225
+ $.push($$props, true);
3226
+ let color = $.prop($$props, "color", 3, "#facc15"), opacity = $.prop($$props, "opacity", 3, 1), appearanceActive = $.prop($$props, "appearanceActive", 3, false);
3227
+ const lineColor = $.derived(() => getContrastStrokeColor(color()));
3228
+ var div = root$3();
3229
+ div.__pointerdown = function(...$$args) {
3230
+ var _a;
3231
+ (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
3232
+ };
3233
+ let styles;
3234
+ var node = $.child(div);
3235
+ {
3236
+ var consequent = ($$anchor2) => {
3237
+ var svg = root_1$1();
3238
+ $.set_style(svg, "", {}, { position: "absolute", inset: "0", "pointer-events": "none" });
3239
+ var path = $.child(svg);
3240
+ var line = $.sibling(path);
3241
+ var line_1 = $.sibling(line);
3242
+ var line_2 = $.sibling(line_1);
3243
+ $.reset(svg);
3244
+ $.template_effect(() => {
3245
+ $.set_attribute(path, "fill", color());
3246
+ $.set_attribute(path, "opacity", opacity());
3247
+ $.set_attribute(path, "stroke", $.get(lineColor));
3248
+ $.set_attribute(line, "stroke", $.get(lineColor));
3249
+ $.set_attribute(line_1, "stroke", $.get(lineColor));
3250
+ $.set_attribute(line_2, "stroke", $.get(lineColor));
3251
+ });
3252
+ $.append($$anchor2, svg);
3253
+ };
3254
+ $.if(node, ($$render) => {
3255
+ if (!appearanceActive()) $$render(consequent);
3256
+ });
3257
+ }
3258
+ $.reset(div);
3259
+ $.template_effect(() => styles = $.set_style(div, "", styles, {
3260
+ position: "absolute",
3261
+ inset: "0",
3262
+ "z-index": "2",
3263
+ "pointer-events": $$props.isSelected ? "none" : "auto",
3264
+ cursor: $$props.isSelected ? "move" : "pointer"
3265
+ }));
3266
+ $.append($$anchor, div);
3267
+ $.pop();
3268
+ }
3269
+ $.delegate(["pointerdown"]);
3270
+ function TextRenderer($$anchor, $$props) {
3271
+ $.push($$props, true);
3272
+ {
3273
+ let $0 = $.derived(() => $$props.currentObject.strokeColor ?? $$props.currentObject.color);
3274
+ Text($$anchor, {
3275
+ get isSelected() {
3276
+ return $$props.isSelected;
3277
+ },
3278
+ get color() {
3279
+ return $.get($0);
3280
+ },
3281
+ get opacity() {
3282
+ return $$props.currentObject.opacity;
3283
+ },
3284
+ get onClick() {
3285
+ return $$props.onClick;
3286
+ },
3287
+ get appearanceActive() {
3288
+ return $$props.appearanceActive;
3289
+ }
3290
+ });
3291
+ }
3292
+ $.pop();
3293
+ }
3104
3294
  const builtInRenderers = [
3105
3295
  createRenderer({
3106
3296
  id: "ink",
@@ -3182,6 +3372,18 @@ const builtInRenderers = [
3182
3372
  zIndex: 0,
3183
3373
  interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false }
3184
3374
  }),
3375
+ createRenderer({
3376
+ id: "text",
3377
+ matches: (a) => a.type === PdfAnnotationSubtype.TEXT && !a.inReplyToId,
3378
+ component: TextRenderer,
3379
+ interactionDefaults: { isDraggable: true, isResizable: false, isRotatable: false }
3380
+ }),
3381
+ createRenderer({
3382
+ id: "caret",
3383
+ matches: (a) => a.type === PdfAnnotationSubtype.CARET,
3384
+ component: CaretRenderer,
3385
+ interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false }
3386
+ }),
3185
3387
  createRenderer({
3186
3388
  id: "freeText",
3187
3389
  matches: (a) => a.type === PdfAnnotationSubtype.FREETEXT,
@@ -4379,6 +4581,7 @@ export {
4379
4581
  Squiggly,
4380
4582
  Stamp,
4381
4583
  Strikeout,
4584
+ Text,
4382
4585
  TextMarkup,
4383
4586
  Underline,
4384
4587
  createRenderer,