@harbour-enterprises/superdoc 0.12.31 → 0.12.34-next.1
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.
- package/dist/chunks/{super-editor.es-BxaiA9ut.cjs → super-editor.es-C2uZFYse.cjs} +599 -269
- package/dist/chunks/{super-editor.es-CYH3KblY.es.js → super-editor.es-mtzaNl_I.es.js} +613 -283
- package/dist/composables/use-high-contrast-mode.d.ts +5 -0
- package/dist/composables/use-high-contrast-mode.d.ts.map +1 -0
- package/dist/core/SuperDoc.d.ts +7 -0
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/core/create-app.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/style.css +299 -245
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-Dm2_Htrh.js → converter-CenRPnts.js} +2 -2
- package/dist/super-editor/chunks/{docx-zipper-CU11jH41.js → docx-zipper-DdgXH9QX.js} +7 -3
- package/dist/super-editor/chunks/{editor-CISWiQkg.js → editor-B44D-Ttm.js} +190 -67
- package/dist/super-editor/chunks/{toolbar-Dgo3wQvN.js → toolbar-DmkQTZha.js} +80 -36
- package/dist/super-editor/components/toolbar/defaultItems.d.ts.map +1 -1
- package/dist/super-editor/composables/use-high-contrast-mode.d.ts +5 -0
- package/dist/super-editor/composables/use-high-contrast-mode.d.ts.map +1 -0
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/DocxZipper.d.ts +1 -1
- package/dist/super-editor/core/DocxZipper.d.ts.map +1 -1
- package/dist/super-editor/core/Editor.d.ts +2 -1
- package/dist/super-editor/core/Editor.d.ts.map +1 -1
- package/dist/super-editor/core/InputRule.d.ts.map +1 -1
- package/dist/super-editor/core/helpers/annotator.d.ts +17 -3
- package/dist/super-editor/core/helpers/annotator.d.ts.map +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/extensions/ai/ai-nodes.d.ts.map +1 -1
- package/dist/super-editor/extensions/bookmarks/bookmarks.d.ts.map +1 -1
- package/dist/super-editor/extensions/bullet-list/bullet-list.d.ts.map +1 -1
- package/dist/super-editor/extensions/collaboration/collaboration-helpers.d.ts.map +1 -1
- package/dist/super-editor/extensions/comment/comment.d.ts.map +1 -1
- package/dist/super-editor/extensions/document/document.d.ts.map +1 -1
- package/dist/super-editor/extensions/field-annotation/field-annotation.d.ts.map +1 -1
- package/dist/super-editor/extensions/field-annotation/fieldAnnotationHelpers/getHeaderFooterAnnotations.d.ts +2 -0
- package/dist/super-editor/extensions/field-annotation/fieldAnnotationHelpers/getHeaderFooterAnnotations.d.ts.map +1 -0
- package/dist/super-editor/extensions/field-annotation/fieldAnnotationHelpers/index.d.ts +1 -0
- package/dist/super-editor/extensions/heading/heading.d.ts.map +1 -1
- package/dist/super-editor/extensions/image/image.d.ts.map +1 -1
- package/dist/super-editor/extensions/line-break/line-break.d.ts.map +1 -1
- package/dist/super-editor/extensions/list-item/list-item.d.ts.map +1 -1
- package/dist/super-editor/extensions/mention/mention.d.ts.map +1 -1
- package/dist/super-editor/extensions/ordered-list/ordered-list.d.ts.map +1 -1
- package/dist/super-editor/extensions/page-number/page-number.d.ts.map +1 -1
- package/dist/super-editor/extensions/pagination/pagination-helpers.d.ts.map +1 -1
- package/dist/super-editor/extensions/run-item/run-item.d.ts.map +1 -1
- package/dist/super-editor/extensions/shape-container/shape-container.d.ts.map +1 -1
- package/dist/super-editor/extensions/shape-textbox/shape-textbox.d.ts.map +1 -1
- package/dist/super-editor/extensions/structured-content/structured-content.d.ts.map +1 -1
- package/dist/super-editor/extensions/table/table.d.ts.map +1 -1
- package/dist/super-editor/extensions/table-cell/table-cell.d.ts.map +1 -1
- package/dist/super-editor/extensions/table-header/table-header.d.ts.map +1 -1
- package/dist/super-editor/extensions/table-row/table-row.d.ts.map +1 -1
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/index.d.ts +1 -1
- package/dist/super-editor/style.css +243 -196
- package/dist/super-editor/super-editor.es.js +335 -174
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +2 -1
- package/dist/super-editor.es.js +15 -14
- package/dist/superdoc.cjs +35 -9
- package/dist/superdoc.es.js +233 -207
- package/dist/superdoc.umd.js +636 -281
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/superdoc.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S, i,
|
|
1
|
+
import { o as index$1, C as CommentsPluginKey, f as TrackChangesBasePluginKey, E as Editor, l as getRichTextExtensions, d as SuperInput, A as AIWriter, c as SuperEditor, e as SuperToolbar, g as createZip } from "./chunks/super-editor.es-mtzaNl_I.es.js";
|
|
2
|
+
import { a, S, i, n } from "./chunks/super-editor.es-mtzaNl_I.es.js";
|
|
3
3
|
import { Y as effectScope, r as ref, Z as markRaw, p as process$1, _ as toRaw, a as computed, $ as isRef, a0 as isReactive, D as toRef, i as inject, q as getCurrentInstance, l as watch, y as unref, a1 as hasInjectionContext, N as reactive, u as nextTick, a2 as getCurrentScope, a3 as onScopeDispose, a4 as toRefs, g as global$1, K as shallowRef, O as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, U as onActivated, s as onDeactivated, A as createTextVNode, F as Fragment, R as Comment, m as defineComponent, E as provide, I as withDirectives, C as h, V as Teleport, S as renderSlot, W as isVNode, J as watchEffect, P as Transition, G as mergeProps, Q as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, x as createVNode, z as withCtx, f as createBaseVNode, B as normalizeStyle, e as createCommentVNode, v as createBlock, w as withModifiers, n as normalizeClass, a5 as resolveDirective, d as renderList, c as createApp, X as onUnmounted, a6 as resolveDynamicComponent } from "./chunks/vue-IIIZMHTg.es.js";
|
|
4
4
|
import { B as Buffer$2 } from "./chunks/jszip-BmWWPxfF.es.js";
|
|
5
5
|
import { B as BlankDOCX } from "./chunks/blank-docx-iwdyG9RH.es.js";
|
|
@@ -344,8 +344,8 @@ function _crc32(buf, previous) {
|
|
|
344
344
|
previous = previous.readUInt32BE(0);
|
|
345
345
|
}
|
|
346
346
|
let crc = ~~previous ^ -1;
|
|
347
|
-
for (var
|
|
348
|
-
crc = CRC_TABLE[(crc ^ buf[
|
|
347
|
+
for (var n2 = 0; n2 < buf.length; n2++) {
|
|
348
|
+
crc = CRC_TABLE[(crc ^ buf[n2]) & 255] ^ crc >>> 8;
|
|
349
349
|
}
|
|
350
350
|
return crc ^ -1;
|
|
351
351
|
}
|
|
@@ -874,28 +874,28 @@ const saveAs = !IS_CLIENT ? () => {
|
|
|
874
874
|
)
|
|
875
875
|
);
|
|
876
876
|
function downloadSaveAs(blob, name = "download", opts) {
|
|
877
|
-
const
|
|
878
|
-
|
|
879
|
-
|
|
877
|
+
const a2 = document.createElement("a");
|
|
878
|
+
a2.download = name;
|
|
879
|
+
a2.rel = "noopener";
|
|
880
880
|
if (typeof blob === "string") {
|
|
881
|
-
|
|
882
|
-
if (
|
|
883
|
-
if (corsEnabled(
|
|
881
|
+
a2.href = blob;
|
|
882
|
+
if (a2.origin !== location.origin) {
|
|
883
|
+
if (corsEnabled(a2.href)) {
|
|
884
884
|
download$1(blob, name, opts);
|
|
885
885
|
} else {
|
|
886
|
-
|
|
887
|
-
click(
|
|
886
|
+
a2.target = "_blank";
|
|
887
|
+
click(a2);
|
|
888
888
|
}
|
|
889
889
|
} else {
|
|
890
|
-
click(
|
|
890
|
+
click(a2);
|
|
891
891
|
}
|
|
892
892
|
} else {
|
|
893
|
-
|
|
893
|
+
a2.href = URL.createObjectURL(blob);
|
|
894
894
|
setTimeout(function() {
|
|
895
|
-
URL.revokeObjectURL(
|
|
895
|
+
URL.revokeObjectURL(a2.href);
|
|
896
896
|
}, 4e4);
|
|
897
897
|
setTimeout(function() {
|
|
898
|
-
click(
|
|
898
|
+
click(a2);
|
|
899
899
|
}, 0);
|
|
900
900
|
}
|
|
901
901
|
}
|
|
@@ -904,11 +904,11 @@ function msSaveAs(blob, name = "download", opts) {
|
|
|
904
904
|
if (corsEnabled(blob)) {
|
|
905
905
|
download$1(blob, name, opts);
|
|
906
906
|
} else {
|
|
907
|
-
const
|
|
908
|
-
|
|
909
|
-
|
|
907
|
+
const a2 = document.createElement("a");
|
|
908
|
+
a2.href = blob;
|
|
909
|
+
a2.target = "_blank";
|
|
910
910
|
setTimeout(function() {
|
|
911
|
-
click(
|
|
911
|
+
click(a2);
|
|
912
912
|
});
|
|
913
913
|
}
|
|
914
914
|
} else {
|
|
@@ -2518,9 +2518,9 @@ function useComment(params) {
|
|
|
2518
2518
|
const mentionElements = [...doc.querySelectorAll('span[data-type="mention"]')];
|
|
2519
2519
|
const uniqueMentions = [];
|
|
2520
2520
|
mentionElements.forEach((span) => {
|
|
2521
|
-
const alreadyExists = uniqueMentions.some((
|
|
2522
|
-
const hasEmail =
|
|
2523
|
-
const hasName =
|
|
2521
|
+
const alreadyExists = uniqueMentions.some((m) => {
|
|
2522
|
+
const hasEmail = m.email === span.getAttribute("email");
|
|
2523
|
+
const hasName = m.name === span.getAttribute("name");
|
|
2524
2524
|
return hasEmail && hasName;
|
|
2525
2525
|
});
|
|
2526
2526
|
if (!alreadyExists) {
|
|
@@ -2975,8 +2975,8 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
|
|
|
2975
2975
|
childCommentMap.get(comment.parentCommentId).push(comment);
|
|
2976
2976
|
}
|
|
2977
2977
|
});
|
|
2978
|
-
const sortedParentComments = parentComments.sort((
|
|
2979
|
-
const sortedResolvedComments = resolvedComments.sort((
|
|
2978
|
+
const sortedParentComments = parentComments.sort((a2, b) => a2.createdTime - b.createdTime);
|
|
2979
|
+
const sortedResolvedComments = resolvedComments.sort((a2, b) => a2.createdTime - b.createdTime);
|
|
2980
2980
|
return {
|
|
2981
2981
|
parentComments: sortedParentComments,
|
|
2982
2982
|
resolvedComments: sortedResolvedComments
|
|
@@ -3321,7 +3321,7 @@ function plugin$1(options) {
|
|
|
3321
3321
|
}
|
|
3322
3322
|
};
|
|
3323
3323
|
}
|
|
3324
|
-
function
|
|
3324
|
+
function m(arg) {
|
|
3325
3325
|
return {
|
|
3326
3326
|
$({ context, props }) {
|
|
3327
3327
|
arg = typeof arg === "string" ? arg : arg({ context, props });
|
|
@@ -3355,7 +3355,7 @@ function plugin$1(options) {
|
|
|
3355
3355
|
}
|
|
3356
3356
|
const cB2 = (...args) => c2(b(args[0]), args[1], args[2]);
|
|
3357
3357
|
const cE2 = (...args) => c2(e(args[0]), args[1], args[2]);
|
|
3358
|
-
const cM2 = (...args) => c2(
|
|
3358
|
+
const cM2 = (...args) => c2(m(args[0]), args[1], args[2]);
|
|
3359
3359
|
const cNotM2 = (...args) => c2(notM(args[0]), args[1], args[2]);
|
|
3360
3360
|
Object.assign(_plugin, {
|
|
3361
3361
|
cB: cB2,
|
|
@@ -4013,14 +4013,14 @@ const colors = {
|
|
|
4013
4013
|
function hsv2rgb(h2, s, v) {
|
|
4014
4014
|
s /= 100;
|
|
4015
4015
|
v /= 100;
|
|
4016
|
-
let f = (
|
|
4016
|
+
let f = (n2, k = (n2 + h2 / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);
|
|
4017
4017
|
return [f(5) * 255, f(3) * 255, f(1) * 255];
|
|
4018
4018
|
}
|
|
4019
4019
|
function hsl2rgb(h2, s, l) {
|
|
4020
4020
|
s /= 100;
|
|
4021
4021
|
l /= 100;
|
|
4022
|
-
let
|
|
4023
|
-
let f = (
|
|
4022
|
+
let a2 = s * Math.min(l, 1 - l);
|
|
4023
|
+
let f = (n2, k = (n2 + h2 / 30) % 12) => l - a2 * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
|
4024
4024
|
return [f(0) * 255, f(8) * 255, f(4) * 255];
|
|
4025
4025
|
}
|
|
4026
4026
|
const prefix = "^\\s*";
|
|
@@ -4116,11 +4116,11 @@ function rgba(color) {
|
|
|
4116
4116
|
} else if (color in colors) {
|
|
4117
4117
|
return rgba(colors[color]);
|
|
4118
4118
|
} else if (hslRegex.test(color) || hslaRegex.test(color)) {
|
|
4119
|
-
const [h2, s, l,
|
|
4120
|
-
return [...hsl2rgb(h2, s, l),
|
|
4119
|
+
const [h2, s, l, a2] = hsla(color);
|
|
4120
|
+
return [...hsl2rgb(h2, s, l), a2];
|
|
4121
4121
|
} else if (hsvRegex.test(color) || hsvaRegex.test(color)) {
|
|
4122
|
-
const [h2, s, v,
|
|
4123
|
-
return [...hsv2rgb(h2, s, v),
|
|
4122
|
+
const [h2, s, v, a2] = hsva(color);
|
|
4123
|
+
return [...hsv2rgb(h2, s, v), a2];
|
|
4124
4124
|
}
|
|
4125
4125
|
throw new Error(`[seemly/rgba]: Invalid color value ${color}.`);
|
|
4126
4126
|
} catch (e) {
|
|
@@ -4130,11 +4130,11 @@ function rgba(color) {
|
|
|
4130
4130
|
function normalizeAlpha(alphaValue) {
|
|
4131
4131
|
return alphaValue > 1 ? 1 : alphaValue < 0 ? 0 : alphaValue;
|
|
4132
4132
|
}
|
|
4133
|
-
function stringifyRgba(r, g, b,
|
|
4134
|
-
return `rgba(${roundChannel(r)}, ${roundChannel(g)}, ${roundChannel(b)}, ${normalizeAlpha(
|
|
4133
|
+
function stringifyRgba(r, g, b, a2) {
|
|
4134
|
+
return `rgba(${roundChannel(r)}, ${roundChannel(g)}, ${roundChannel(b)}, ${normalizeAlpha(a2)})`;
|
|
4135
4135
|
}
|
|
4136
|
-
function compositeChannel(v1, a1, v2, a2,
|
|
4137
|
-
return roundChannel((v1 * a1 * (1 - a2) + v2 * a2) /
|
|
4136
|
+
function compositeChannel(v1, a1, v2, a2, a3) {
|
|
4137
|
+
return roundChannel((v1 * a1 * (1 - a2) + v2 * a2) / a3);
|
|
4138
4138
|
}
|
|
4139
4139
|
function composite(background, overlay2) {
|
|
4140
4140
|
if (!Array.isArray(background))
|
|
@@ -4147,16 +4147,16 @@ function composite(background, overlay2) {
|
|
|
4147
4147
|
return stringifyRgba(compositeChannel(background[0], a1, overlay2[0], a2, alpha), compositeChannel(background[1], a1, overlay2[1], a2, alpha), compositeChannel(background[2], a1, overlay2[2], a2, alpha), alpha);
|
|
4148
4148
|
}
|
|
4149
4149
|
function changeColor(base2, options) {
|
|
4150
|
-
const [r, g, b,
|
|
4150
|
+
const [r, g, b, a2 = 1] = Array.isArray(base2) ? base2 : rgba(base2);
|
|
4151
4151
|
if (typeof options.alpha === "number") {
|
|
4152
4152
|
return stringifyRgba(r, g, b, options.alpha);
|
|
4153
4153
|
}
|
|
4154
|
-
return stringifyRgba(r, g, b,
|
|
4154
|
+
return stringifyRgba(r, g, b, a2);
|
|
4155
4155
|
}
|
|
4156
4156
|
function scaleColor(base2, options) {
|
|
4157
|
-
const [r, g, b,
|
|
4157
|
+
const [r, g, b, a2 = 1] = Array.isArray(base2) ? base2 : rgba(base2);
|
|
4158
4158
|
const { lightness = 1, alpha = 1 } = options;
|
|
4159
|
-
return toRgbaString([r * lightness, g * lightness, b * lightness,
|
|
4159
|
+
return toRgbaString([r * lightness, g * lightness, b * lightness, a2 * alpha]);
|
|
4160
4160
|
}
|
|
4161
4161
|
function roundAlpha(value) {
|
|
4162
4162
|
const v = Math.round(Number(value) * 100) / 100;
|
|
@@ -6241,9 +6241,9 @@ var Scheduler = function() {
|
|
|
6241
6241
|
return Scheduler2;
|
|
6242
6242
|
}();
|
|
6243
6243
|
var scheduler = new Scheduler();
|
|
6244
|
-
var updateCount = function(
|
|
6245
|
-
!watching &&
|
|
6246
|
-
watching +=
|
|
6244
|
+
var updateCount = function(n2) {
|
|
6245
|
+
!watching && n2 > 0 && scheduler.start();
|
|
6246
|
+
watching += n2;
|
|
6247
6247
|
!watching && scheduler.stop();
|
|
6248
6248
|
};
|
|
6249
6249
|
var skipNotifyOnElement = function(target) {
|
|
@@ -7300,9 +7300,9 @@ function isPrototype(value) {
|
|
|
7300
7300
|
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$a;
|
|
7301
7301
|
return value === proto;
|
|
7302
7302
|
}
|
|
7303
|
-
function baseTimes(
|
|
7304
|
-
var index2 = -1, result = Array(
|
|
7305
|
-
while (++index2 <
|
|
7303
|
+
function baseTimes(n2, iteratee) {
|
|
7304
|
+
var index2 = -1, result = Array(n2);
|
|
7305
|
+
while (++index2 < n2) {
|
|
7306
7306
|
result[index2] = iteratee(index2);
|
|
7307
7307
|
}
|
|
7308
7308
|
return result;
|
|
@@ -13929,7 +13929,7 @@ const _sfc_main$d = {
|
|
|
13929
13929
|
const isThreadedComment = c2.parentCommentId === parentComment.commentId;
|
|
13930
13930
|
const isThisComment = c2.commentId === props.comment.commentId;
|
|
13931
13931
|
return isThreadedComment || isThisComment;
|
|
13932
|
-
}).sort((
|
|
13932
|
+
}).sort((a2, b) => a2.commentId === props.comment.commentId && a2.createdTime - b.createdTime);
|
|
13933
13933
|
});
|
|
13934
13934
|
const isInternalDropdownDisabled = computed(() => {
|
|
13935
13935
|
if (props.comment.resolvedTime) return true;
|
|
@@ -14070,7 +14070,8 @@ const _sfc_main$d = {
|
|
|
14070
14070
|
onClick: withModifiers(setFocus, ["stop", "prevent"]),
|
|
14071
14071
|
style: normalizeStyle(getSidebarCommentStyle.value),
|
|
14072
14072
|
ref_key: "commentDialogElement",
|
|
14073
|
-
ref: commentDialogElement
|
|
14073
|
+
ref: commentDialogElement,
|
|
14074
|
+
role: "dialog"
|
|
14074
14075
|
}, [
|
|
14075
14076
|
shouldShowInternalExternal.value ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
14076
14077
|
createVNode(InternalDropdown, {
|
|
@@ -14166,7 +14167,7 @@ const _sfc_main$d = {
|
|
|
14166
14167
|
};
|
|
14167
14168
|
}
|
|
14168
14169
|
};
|
|
14169
|
-
const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-
|
|
14170
|
+
const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-ff48cd67"]]);
|
|
14170
14171
|
const _hoisted_1$b = { class: "comments-list" };
|
|
14171
14172
|
const _hoisted_2$6 = { key: 0 };
|
|
14172
14173
|
const _hoisted_3$3 = { class: "comment-item" };
|
|
@@ -14400,10 +14401,10 @@ var __webpack_modules__ = {
|
|
|
14400
14401
|
} else {
|
|
14401
14402
|
var options = preserveResizability && !fixedLength && maxByteLength ? { maxByteLength: maxByteLength(arrayBuffer) } : void 0;
|
|
14402
14403
|
newBuffer = new ArrayBuffer2(newByteLength, options);
|
|
14403
|
-
var
|
|
14404
|
+
var a2 = new DataView2(arrayBuffer);
|
|
14404
14405
|
var b = new DataView2(newBuffer);
|
|
14405
14406
|
var copyLength = min(newByteLength, byteLength);
|
|
14406
|
-
for (var i2 = 0; i2 < copyLength; i2++) setInt8(b, i2, getInt8(
|
|
14407
|
+
for (var i2 = 0; i2 < copyLength; i2++) setInt8(b, i2, getInt8(a2, i2));
|
|
14407
14408
|
}
|
|
14408
14409
|
if (!PROPER_STRUCTURED_CLONE_TRANSFER) detachTransferable(arrayBuffer);
|
|
14409
14410
|
return newBuffer;
|
|
@@ -15998,8 +15999,8 @@ var __webpack_modules__ = {
|
|
|
15998
15999
|
var ceil = Math.ceil;
|
|
15999
16000
|
var floor = Math.floor;
|
|
16000
16001
|
module2.exports = Math.trunc || function trunc(x) {
|
|
16001
|
-
var
|
|
16002
|
-
return (
|
|
16002
|
+
var n2 = +x;
|
|
16003
|
+
return (n2 > 0 ? floor : ceil)(n2);
|
|
16003
16004
|
};
|
|
16004
16005
|
}
|
|
16005
16006
|
),
|
|
@@ -18527,7 +18528,7 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
18527
18528
|
return shadow2(this, "isCSSRoundSupported", globalThis.CSS?.supports?.("width: round(1.5px, 1px)"));
|
|
18528
18529
|
}
|
|
18529
18530
|
}
|
|
18530
|
-
const hexNumbers = Array.from(Array(256).keys(), (
|
|
18531
|
+
const hexNumbers = Array.from(Array(256).keys(), (n2) => n2.toString(16).padStart(2, "0"));
|
|
18531
18532
|
class Util2 {
|
|
18532
18533
|
static makeHexColor(r, g, b) {
|
|
18533
18534
|
return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;
|
|
@@ -18579,36 +18580,36 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
18579
18580
|
static transform(m1, m2) {
|
|
18580
18581
|
return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]];
|
|
18581
18582
|
}
|
|
18582
|
-
static applyTransform(p,
|
|
18583
|
-
const xt = p[0] *
|
|
18584
|
-
const yt = p[0] *
|
|
18583
|
+
static applyTransform(p, m) {
|
|
18584
|
+
const xt = p[0] * m[0] + p[1] * m[2] + m[4];
|
|
18585
|
+
const yt = p[0] * m[1] + p[1] * m[3] + m[5];
|
|
18585
18586
|
return [xt, yt];
|
|
18586
18587
|
}
|
|
18587
|
-
static applyInverseTransform(p,
|
|
18588
|
-
const d =
|
|
18589
|
-
const xt = (p[0] *
|
|
18590
|
-
const yt = (-p[0] *
|
|
18588
|
+
static applyInverseTransform(p, m) {
|
|
18589
|
+
const d = m[0] * m[3] - m[1] * m[2];
|
|
18590
|
+
const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;
|
|
18591
|
+
const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;
|
|
18591
18592
|
return [xt, yt];
|
|
18592
18593
|
}
|
|
18593
|
-
static getAxialAlignedBoundingBox(r,
|
|
18594
|
-
const p1 = this.applyTransform(r,
|
|
18595
|
-
const p2 = this.applyTransform(r.slice(2, 4),
|
|
18596
|
-
const p3 = this.applyTransform([r[0], r[3]],
|
|
18597
|
-
const p4 = this.applyTransform([r[2], r[1]],
|
|
18594
|
+
static getAxialAlignedBoundingBox(r, m) {
|
|
18595
|
+
const p1 = this.applyTransform(r, m);
|
|
18596
|
+
const p2 = this.applyTransform(r.slice(2, 4), m);
|
|
18597
|
+
const p3 = this.applyTransform([r[0], r[3]], m);
|
|
18598
|
+
const p4 = this.applyTransform([r[2], r[1]], m);
|
|
18598
18599
|
return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])];
|
|
18599
18600
|
}
|
|
18600
|
-
static inverseTransform(
|
|
18601
|
-
const d =
|
|
18602
|
-
return [
|
|
18603
|
-
}
|
|
18604
|
-
static singularValueDecompose2dScale(
|
|
18605
|
-
const transpose = [
|
|
18606
|
-
const
|
|
18607
|
-
const b =
|
|
18608
|
-
const c2 =
|
|
18609
|
-
const d =
|
|
18610
|
-
const first = (
|
|
18611
|
-
const second = Math.sqrt((
|
|
18601
|
+
static inverseTransform(m) {
|
|
18602
|
+
const d = m[0] * m[3] - m[1] * m[2];
|
|
18603
|
+
return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d];
|
|
18604
|
+
}
|
|
18605
|
+
static singularValueDecompose2dScale(m) {
|
|
18606
|
+
const transpose = [m[0], m[2], m[1], m[3]];
|
|
18607
|
+
const a2 = m[0] * transpose[0] + m[1] * transpose[2];
|
|
18608
|
+
const b = m[0] * transpose[1] + m[1] * transpose[3];
|
|
18609
|
+
const c2 = m[2] * transpose[0] + m[3] * transpose[2];
|
|
18610
|
+
const d = m[2] * transpose[1] + m[3] * transpose[3];
|
|
18611
|
+
const first = (a2 + d) / 2;
|
|
18612
|
+
const second = Math.sqrt((a2 + d) ** 2 - 4 * (a2 * d - c2 * b)) / 2;
|
|
18612
18613
|
const sx = first + second || 1;
|
|
18613
18614
|
const sy = first - second || 1;
|
|
18614
18615
|
return [Math.sqrt(sx), Math.sqrt(sy)];
|
|
@@ -18652,21 +18653,21 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
18652
18653
|
minMax[2] = Math.max(minMax[2], x);
|
|
18653
18654
|
minMax[3] = Math.max(minMax[3], y);
|
|
18654
18655
|
}
|
|
18655
|
-
static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3,
|
|
18656
|
-
if (Math.abs(
|
|
18656
|
+
static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a2, b, c2, minMax) {
|
|
18657
|
+
if (Math.abs(a2) < 1e-12) {
|
|
18657
18658
|
if (Math.abs(b) >= 1e-12) {
|
|
18658
18659
|
this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, -c2 / b, minMax);
|
|
18659
18660
|
}
|
|
18660
18661
|
return;
|
|
18661
18662
|
}
|
|
18662
|
-
const delta = b ** 2 - 4 * c2 *
|
|
18663
|
+
const delta = b ** 2 - 4 * c2 * a2;
|
|
18663
18664
|
if (delta < 0) {
|
|
18664
18665
|
return;
|
|
18665
18666
|
}
|
|
18666
18667
|
const sqrtDelta = Math.sqrt(delta);
|
|
18667
|
-
const
|
|
18668
|
-
this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b + sqrtDelta) /
|
|
18669
|
-
this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b - sqrtDelta) /
|
|
18668
|
+
const a22 = 2 * a2;
|
|
18669
|
+
this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b + sqrtDelta) / a22, minMax);
|
|
18670
|
+
this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b - sqrtDelta) / a22, minMax);
|
|
18670
18671
|
}
|
|
18671
18672
|
static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) {
|
|
18672
18673
|
if (minMax) {
|
|
@@ -19019,12 +19020,12 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
19019
19020
|
const filter = info2.filter = this.#createFilter(id);
|
|
19020
19021
|
this.#addTransferMapConversion(table, table, table, filter);
|
|
19021
19022
|
this.#addGrayConversion(filter);
|
|
19022
|
-
const getSteps = (c2,
|
|
19023
|
+
const getSteps = (c2, n2) => {
|
|
19023
19024
|
const start = fgRGB[c2] / 255;
|
|
19024
19025
|
const end = bgRGB[c2] / 255;
|
|
19025
|
-
const arr = new Array(
|
|
19026
|
-
for (let i2 = 0; i2 <=
|
|
19027
|
-
arr[i2] = start + i2 /
|
|
19026
|
+
const arr = new Array(n2 + 1);
|
|
19027
|
+
for (let i2 = 0; i2 <= n2; i2++) {
|
|
19028
|
+
arr[i2] = start + i2 / n2 * (end - start);
|
|
19028
19029
|
}
|
|
19029
19030
|
return arr.join(",");
|
|
19030
19031
|
};
|
|
@@ -19110,13 +19111,13 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
19110
19111
|
[fgGray, bgGray, newFgRGB, newBgRGB] = [bgGray, fgGray, newBgRGB, newFgRGB];
|
|
19111
19112
|
}
|
|
19112
19113
|
this.#defs.style.color = "";
|
|
19113
|
-
const getSteps = (fg, bg,
|
|
19114
|
+
const getSteps = (fg, bg, n2) => {
|
|
19114
19115
|
const arr = new Array(256);
|
|
19115
|
-
const step = (bgGray - fgGray) /
|
|
19116
|
+
const step = (bgGray - fgGray) / n2;
|
|
19116
19117
|
const newStart = fg / 255;
|
|
19117
|
-
const newStep = (bg - fg) / (255 *
|
|
19118
|
+
const newStep = (bg - fg) / (255 * n2);
|
|
19118
19119
|
let prev = 0;
|
|
19119
|
-
for (let i2 = 0; i2 <=
|
|
19120
|
+
for (let i2 = 0; i2 <= n2; i2++) {
|
|
19120
19121
|
const k = Math.round(fgGray + i2 * step);
|
|
19121
19122
|
const value = newStart + i2 * newStep;
|
|
19122
19123
|
for (let j = prev; j <= k; j++) {
|
|
@@ -19551,25 +19552,25 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
19551
19552
|
}
|
|
19552
19553
|
function getCurrentTransform(ctx2) {
|
|
19553
19554
|
const {
|
|
19554
|
-
a,
|
|
19555
|
+
a: a2,
|
|
19555
19556
|
b,
|
|
19556
19557
|
c: c2,
|
|
19557
19558
|
d,
|
|
19558
19559
|
e,
|
|
19559
19560
|
f
|
|
19560
19561
|
} = ctx2.getTransform();
|
|
19561
|
-
return [
|
|
19562
|
+
return [a2, b, c2, d, e, f];
|
|
19562
19563
|
}
|
|
19563
19564
|
function getCurrentTransformInverse(ctx2) {
|
|
19564
19565
|
const {
|
|
19565
|
-
a,
|
|
19566
|
+
a: a2,
|
|
19566
19567
|
b,
|
|
19567
19568
|
c: c2,
|
|
19568
19569
|
d,
|
|
19569
19570
|
e,
|
|
19570
19571
|
f
|
|
19571
19572
|
} = ctx2.getTransform().invertSelf();
|
|
19572
|
-
return [
|
|
19573
|
+
return [a2, b, c2, d, e, f];
|
|
19573
19574
|
}
|
|
19574
19575
|
function setLayerDimensions2(div, viewport, mustFlip = false, mustRotate = true) {
|
|
19575
19576
|
if (viewport instanceof PageViewport) {
|
|
@@ -23103,29 +23104,29 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
23103
23104
|
switch (cmds[i2++]) {
|
|
23104
23105
|
case FontRenderOps.BEZIER_CURVE_TO:
|
|
23105
23106
|
{
|
|
23106
|
-
const [
|
|
23107
|
-
commands.push((ctx2) => ctx2.bezierCurveTo(
|
|
23107
|
+
const [a2, b, c2, d, e, f] = cmds.slice(i2, i2 + 6);
|
|
23108
|
+
commands.push((ctx2) => ctx2.bezierCurveTo(a2, b, c2, d, e, f));
|
|
23108
23109
|
i2 += 6;
|
|
23109
23110
|
}
|
|
23110
23111
|
break;
|
|
23111
23112
|
case FontRenderOps.MOVE_TO:
|
|
23112
23113
|
{
|
|
23113
|
-
const [
|
|
23114
|
-
commands.push((ctx2) => ctx2.moveTo(
|
|
23114
|
+
const [a2, b] = cmds.slice(i2, i2 + 2);
|
|
23115
|
+
commands.push((ctx2) => ctx2.moveTo(a2, b));
|
|
23115
23116
|
i2 += 2;
|
|
23116
23117
|
}
|
|
23117
23118
|
break;
|
|
23118
23119
|
case FontRenderOps.LINE_TO:
|
|
23119
23120
|
{
|
|
23120
|
-
const [
|
|
23121
|
-
commands.push((ctx2) => ctx2.lineTo(
|
|
23121
|
+
const [a2, b] = cmds.slice(i2, i2 + 2);
|
|
23122
|
+
commands.push((ctx2) => ctx2.lineTo(a2, b));
|
|
23122
23123
|
i2 += 2;
|
|
23123
23124
|
}
|
|
23124
23125
|
break;
|
|
23125
23126
|
case FontRenderOps.QUADRATIC_CURVE_TO:
|
|
23126
23127
|
{
|
|
23127
|
-
const [
|
|
23128
|
-
commands.push((ctx2) => ctx2.quadraticCurveTo(
|
|
23128
|
+
const [a2, b, c2, d] = cmds.slice(i2, i2 + 4);
|
|
23129
|
+
commands.push((ctx2) => ctx2.quadraticCurveTo(a2, b, c2, d));
|
|
23129
23130
|
i2 += 4;
|
|
23130
23131
|
}
|
|
23131
23132
|
break;
|
|
@@ -23140,15 +23141,15 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
23140
23141
|
break;
|
|
23141
23142
|
case FontRenderOps.TRANSFORM:
|
|
23142
23143
|
{
|
|
23143
|
-
const [
|
|
23144
|
-
commands.push((ctx2) => ctx2.transform(
|
|
23144
|
+
const [a2, b, c2, d, e, f] = cmds.slice(i2, i2 + 6);
|
|
23145
|
+
commands.push((ctx2) => ctx2.transform(a2, b, c2, d, e, f));
|
|
23145
23146
|
i2 += 6;
|
|
23146
23147
|
}
|
|
23147
23148
|
break;
|
|
23148
23149
|
case FontRenderOps.TRANSLATE:
|
|
23149
23150
|
{
|
|
23150
|
-
const [
|
|
23151
|
-
commands.push((ctx2) => ctx2.translate(
|
|
23151
|
+
const [a2, b] = cmds.slice(i2, i2 + 2);
|
|
23152
|
+
commands.push((ctx2) => ctx2.translate(a2, b));
|
|
23152
23153
|
i2 += 2;
|
|
23153
23154
|
}
|
|
23154
23155
|
break;
|
|
@@ -23174,19 +23175,19 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
23174
23175
|
), http = await import(
|
|
23175
23176
|
/*webpackIgnore: true*/
|
|
23176
23177
|
"./chunks/index-SKpROzLW.es.js"
|
|
23177
|
-
).then((
|
|
23178
|
+
).then((n2) => n2.i), https = await import(
|
|
23178
23179
|
/*webpackIgnore: true*/
|
|
23179
23180
|
"./chunks/index-BrSjd1Id.es.js"
|
|
23180
|
-
).then((
|
|
23181
|
+
).then((n2) => n2.i), url = await import(
|
|
23181
23182
|
/*webpackIgnore: true*/
|
|
23182
23183
|
"./chunks/url-CAZQTNP3.es.js"
|
|
23183
|
-
).then((
|
|
23184
|
+
).then((n2) => n2.u);
|
|
23184
23185
|
let canvas, path2d;
|
|
23185
23186
|
try {
|
|
23186
23187
|
canvas = await import(
|
|
23187
23188
|
/*webpackIgnore: true*/
|
|
23188
23189
|
"./chunks/__vite-browser-external-CURh0WXD.es.js"
|
|
23189
|
-
).then((
|
|
23190
|
+
).then((n2) => n2._);
|
|
23190
23191
|
} catch {
|
|
23191
23192
|
}
|
|
23192
23193
|
try {
|
|
@@ -23789,13 +23790,13 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
23789
23790
|
destCtx.scale(x, y);
|
|
23790
23791
|
this.__originalScale(x, y);
|
|
23791
23792
|
};
|
|
23792
|
-
ctx2.transform = function ctxTransform(
|
|
23793
|
-
destCtx.transform(
|
|
23794
|
-
this.__originalTransform(
|
|
23793
|
+
ctx2.transform = function ctxTransform(a2, b, c2, d, e, f) {
|
|
23794
|
+
destCtx.transform(a2, b, c2, d, e, f);
|
|
23795
|
+
this.__originalTransform(a2, b, c2, d, e, f);
|
|
23795
23796
|
};
|
|
23796
|
-
ctx2.setTransform = function ctxSetTransform(
|
|
23797
|
-
destCtx.setTransform(
|
|
23798
|
-
this.__originalSetTransform(
|
|
23797
|
+
ctx2.setTransform = function ctxSetTransform(a2, b, c2, d, e, f) {
|
|
23798
|
+
destCtx.setTransform(a2, b, c2, d, e, f);
|
|
23799
|
+
this.__originalSetTransform(a2, b, c2, d, e, f);
|
|
23799
23800
|
};
|
|
23800
23801
|
ctx2.resetTransform = function ctxResetTransform() {
|
|
23801
23802
|
destCtx.resetTransform();
|
|
@@ -23862,22 +23863,22 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
23862
23863
|
}
|
|
23863
23864
|
}
|
|
23864
23865
|
function drawImageAtIntegerCoords(ctx2, srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH) {
|
|
23865
|
-
const [
|
|
23866
|
+
const [a2, b, c2, d, tx, ty] = getCurrentTransform(ctx2);
|
|
23866
23867
|
if (b === 0 && c2 === 0) {
|
|
23867
|
-
const tlX = destX *
|
|
23868
|
+
const tlX = destX * a2 + tx;
|
|
23868
23869
|
const rTlX = Math.round(tlX);
|
|
23869
23870
|
const tlY = destY * d + ty;
|
|
23870
23871
|
const rTlY = Math.round(tlY);
|
|
23871
|
-
const brX = (destX + destW) *
|
|
23872
|
+
const brX = (destX + destW) * a2 + tx;
|
|
23872
23873
|
const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;
|
|
23873
23874
|
const brY = (destY + destH) * d + ty;
|
|
23874
23875
|
const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;
|
|
23875
|
-
ctx2.setTransform(Math.sign(
|
|
23876
|
+
ctx2.setTransform(Math.sign(a2), 0, 0, Math.sign(d), rTlX, rTlY);
|
|
23876
23877
|
ctx2.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight);
|
|
23877
|
-
ctx2.setTransform(
|
|
23878
|
+
ctx2.setTransform(a2, b, c2, d, tx, ty);
|
|
23878
23879
|
return [rWidth, rHeight];
|
|
23879
23880
|
}
|
|
23880
|
-
if (
|
|
23881
|
+
if (a2 === 0 && d === 0) {
|
|
23881
23882
|
const tlX = destY * c2 + tx;
|
|
23882
23883
|
const rTlX = Math.round(tlX);
|
|
23883
23884
|
const tlY = destX * b + ty;
|
|
@@ -23888,11 +23889,11 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
23888
23889
|
const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;
|
|
23889
23890
|
ctx2.setTransform(0, Math.sign(b), Math.sign(c2), 0, rTlX, rTlY);
|
|
23890
23891
|
ctx2.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth);
|
|
23891
|
-
ctx2.setTransform(
|
|
23892
|
+
ctx2.setTransform(a2, b, c2, d, tx, ty);
|
|
23892
23893
|
return [rHeight, rWidth];
|
|
23893
23894
|
}
|
|
23894
23895
|
ctx2.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH);
|
|
23895
|
-
const scaleX = Math.hypot(
|
|
23896
|
+
const scaleX = Math.hypot(a2, b);
|
|
23896
23897
|
const scaleY = Math.hypot(c2, d);
|
|
23897
23898
|
return [scaleX * destW, scaleY * destH];
|
|
23898
23899
|
}
|
|
@@ -24777,8 +24778,8 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
24777
24778
|
this._cachedGetSinglePixelWidth = null;
|
|
24778
24779
|
}
|
|
24779
24780
|
}
|
|
24780
|
-
transform(
|
|
24781
|
-
this.ctx.transform(
|
|
24781
|
+
transform(a2, b, c2, d, e, f) {
|
|
24782
|
+
this.ctx.transform(a2, b, c2, d, e, f);
|
|
24782
24783
|
this._cachedScaleForStroking[0] = -1;
|
|
24783
24784
|
this._cachedGetSinglePixelWidth = null;
|
|
24784
24785
|
}
|
|
@@ -25038,9 +25039,9 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
25038
25039
|
this.setLeading(-y);
|
|
25039
25040
|
this.moveText(x, y);
|
|
25040
25041
|
}
|
|
25041
|
-
setTextMatrix(
|
|
25042
|
-
this.current.textMatrix = [
|
|
25043
|
-
this.current.textMatrixScale = Math.hypot(
|
|
25042
|
+
setTextMatrix(a2, b, c2, d, e, f) {
|
|
25043
|
+
this.current.textMatrix = [a2, b, c2, d, e, f];
|
|
25044
|
+
this.current.textMatrixScale = Math.hypot(a2, b);
|
|
25044
25045
|
this.current.x = this.current.lineX = 0;
|
|
25045
25046
|
this.current.y = this.current.lineY = 0;
|
|
25046
25047
|
}
|
|
@@ -25795,13 +25796,13 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
25795
25796
|
}
|
|
25796
25797
|
getSinglePixelWidth() {
|
|
25797
25798
|
if (!this._cachedGetSinglePixelWidth) {
|
|
25798
|
-
const
|
|
25799
|
-
if (
|
|
25800
|
-
this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(
|
|
25799
|
+
const m = getCurrentTransform(this.ctx);
|
|
25800
|
+
if (m[1] === 0 && m[2] === 0) {
|
|
25801
|
+
this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(m[0]), Math.abs(m[3]));
|
|
25801
25802
|
} else {
|
|
25802
|
-
const absDet = Math.abs(
|
|
25803
|
-
const normX = Math.hypot(
|
|
25804
|
-
const normY = Math.hypot(
|
|
25803
|
+
const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]);
|
|
25804
|
+
const normX = Math.hypot(m[0], m[2]);
|
|
25805
|
+
const normY = Math.hypot(m[1], m[3]);
|
|
25805
25806
|
this._cachedGetSinglePixelWidth = Math.max(normX, normY) / absDet;
|
|
25806
25807
|
}
|
|
25807
25808
|
}
|
|
@@ -25813,14 +25814,14 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
25813
25814
|
lineWidth
|
|
25814
25815
|
} = this.current;
|
|
25815
25816
|
const {
|
|
25816
|
-
a,
|
|
25817
|
+
a: a2,
|
|
25817
25818
|
b,
|
|
25818
25819
|
c: c2,
|
|
25819
25820
|
d
|
|
25820
25821
|
} = this.ctx.getTransform();
|
|
25821
25822
|
let scaleX, scaleY;
|
|
25822
25823
|
if (b === 0 && c2 === 0) {
|
|
25823
|
-
const normX = Math.abs(
|
|
25824
|
+
const normX = Math.abs(a2);
|
|
25824
25825
|
const normY = Math.abs(d);
|
|
25825
25826
|
if (normX === normY) {
|
|
25826
25827
|
if (lineWidth === 0) {
|
|
@@ -25839,8 +25840,8 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
25839
25840
|
scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1;
|
|
25840
25841
|
}
|
|
25841
25842
|
} else {
|
|
25842
|
-
const absDet = Math.abs(
|
|
25843
|
-
const normX = Math.hypot(
|
|
25843
|
+
const absDet = Math.abs(a2 * d - b * c2);
|
|
25844
|
+
const normX = Math.hypot(a2, b);
|
|
25844
25845
|
const normY = Math.hypot(c2, d);
|
|
25845
25846
|
if (lineWidth === 0) {
|
|
25846
25847
|
scaleX = normY / absDet;
|
|
@@ -26899,26 +26900,26 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
26899
26900
|
let match2;
|
|
26900
26901
|
const iter = toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)", "ig");
|
|
26901
26902
|
while ((match2 = iter.exec(contentDispositionStr)) !== null) {
|
|
26902
|
-
let [,
|
|
26903
|
-
|
|
26904
|
-
if (
|
|
26905
|
-
if (
|
|
26903
|
+
let [, n2, quot, part] = match2;
|
|
26904
|
+
n2 = parseInt(n2, 10);
|
|
26905
|
+
if (n2 in matches) {
|
|
26906
|
+
if (n2 === 0) {
|
|
26906
26907
|
break;
|
|
26907
26908
|
}
|
|
26908
26909
|
continue;
|
|
26909
26910
|
}
|
|
26910
|
-
matches[
|
|
26911
|
+
matches[n2] = [quot, part];
|
|
26911
26912
|
}
|
|
26912
26913
|
const parts = [];
|
|
26913
|
-
for (let
|
|
26914
|
-
if (!(
|
|
26914
|
+
for (let n2 = 0; n2 < matches.length; ++n2) {
|
|
26915
|
+
if (!(n2 in matches)) {
|
|
26915
26916
|
break;
|
|
26916
26917
|
}
|
|
26917
|
-
let [quot, part] = matches[
|
|
26918
|
+
let [quot, part] = matches[n2];
|
|
26918
26919
|
part = rfc2616unquote(part);
|
|
26919
26920
|
if (quot) {
|
|
26920
26921
|
part = unescape(part);
|
|
26921
|
-
if (
|
|
26922
|
+
if (n2 === 0) {
|
|
26922
26923
|
part = rfc5987decode(part);
|
|
26923
26924
|
}
|
|
26924
26925
|
}
|
|
@@ -30249,15 +30250,15 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
30249
30250
|
const version2 = "4.3.136";
|
|
30250
30251
|
const build2 = "0cec64437";
|
|
30251
30252
|
__webpack_require__$1(670);
|
|
30252
|
-
function makeColorComp(
|
|
30253
|
-
return Math.floor(Math.max(0, Math.min(1,
|
|
30253
|
+
function makeColorComp(n2) {
|
|
30254
|
+
return Math.floor(Math.max(0, Math.min(1, n2)) * 255).toString(16).padStart(2, "0");
|
|
30254
30255
|
}
|
|
30255
30256
|
function scaleAndClamp(x) {
|
|
30256
30257
|
return Math.max(0, Math.min(255, 255 * x));
|
|
30257
30258
|
}
|
|
30258
30259
|
class ColorConverters {
|
|
30259
|
-
static CMYK_G([c2, y,
|
|
30260
|
-
return ["G", 1 - Math.min(1, 0.3 * c2 + 0.59 *
|
|
30260
|
+
static CMYK_G([c2, y, m, k]) {
|
|
30261
|
+
return ["G", 1 - Math.min(1, 0.3 * c2 + 0.59 * m + 0.11 * y + k)];
|
|
30261
30262
|
}
|
|
30262
30263
|
static G_CMYK([g]) {
|
|
30263
30264
|
return ["CMYK", 0, 0, 0, 1 - g];
|
|
@@ -30288,11 +30289,11 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
30288
30289
|
static T_rgb() {
|
|
30289
30290
|
return [null];
|
|
30290
30291
|
}
|
|
30291
|
-
static CMYK_RGB([c2, y,
|
|
30292
|
-
return ["RGB", 1 - Math.min(1, c2 + k), 1 - Math.min(1,
|
|
30292
|
+
static CMYK_RGB([c2, y, m, k]) {
|
|
30293
|
+
return ["RGB", 1 - Math.min(1, c2 + k), 1 - Math.min(1, m + k), 1 - Math.min(1, y + k)];
|
|
30293
30294
|
}
|
|
30294
|
-
static CMYK_rgb([c2, y,
|
|
30295
|
-
return [scaleAndClamp(1 - Math.min(1, c2 + k)), scaleAndClamp(1 - Math.min(1,
|
|
30295
|
+
static CMYK_rgb([c2, y, m, k]) {
|
|
30296
|
+
return [scaleAndClamp(1 - Math.min(1, c2 + k)), scaleAndClamp(1 - Math.min(1, m + k)), scaleAndClamp(1 - Math.min(1, y + k))];
|
|
30296
30297
|
}
|
|
30297
30298
|
static CMYK_HTML(components) {
|
|
30298
30299
|
const rgb = this.CMYK_RGB(components).slice(1);
|
|
@@ -30300,10 +30301,10 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
30300
30301
|
}
|
|
30301
30302
|
static RGB_CMYK([r, g, b]) {
|
|
30302
30303
|
const c2 = 1 - r;
|
|
30303
|
-
const
|
|
30304
|
+
const m = 1 - g;
|
|
30304
30305
|
const y = 1 - b;
|
|
30305
|
-
const k = Math.min(c2,
|
|
30306
|
-
return ["CMYK", c2,
|
|
30306
|
+
const k = Math.min(c2, m, y);
|
|
30307
|
+
return ["CMYK", c2, m, y, k];
|
|
30307
30308
|
}
|
|
30308
30309
|
}
|
|
30309
30310
|
class XfaLayer2 {
|
|
@@ -33703,7 +33704,7 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
33703
33704
|
};
|
|
33704
33705
|
}
|
|
33705
33706
|
getOutlines() {
|
|
33706
|
-
this.#verticalEdges.sort((
|
|
33707
|
+
this.#verticalEdges.sort((a2, b) => a2[0] - b[0] || a2[1] - b[1] || a2[2] - b[2]);
|
|
33707
33708
|
const outlineVerticalEdges = [];
|
|
33708
33709
|
for (const edge of this.#verticalEdges) {
|
|
33709
33710
|
if (edge[3]) {
|
|
@@ -33723,7 +33724,7 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
33723
33724
|
const [x, y1, y2] = edge;
|
|
33724
33725
|
edges.push([x, y1, edge], [x, y2, edge]);
|
|
33725
33726
|
}
|
|
33726
|
-
edges.sort((
|
|
33727
|
+
edges.sort((a2, b) => a2[1] - b[1] || a2[0] - b[0]);
|
|
33727
33728
|
for (let i2 = 0, ii = edges.length; i2 < ii; i2 += 2) {
|
|
33728
33729
|
const edge1 = edges[i2][2];
|
|
33729
33730
|
const edge2 = edges[i2 + 1][2];
|
|
@@ -37309,7 +37310,7 @@ function removeNullCharacters(str, replaceInvisible = false) {
|
|
|
37309
37310
|
return str;
|
|
37310
37311
|
}
|
|
37311
37312
|
if (replaceInvisible) {
|
|
37312
|
-
return str.replaceAll(InvisibleCharsRegExp, (
|
|
37313
|
+
return str.replaceAll(InvisibleCharsRegExp, (m) => m === "\0" ? "" : " ");
|
|
37313
37314
|
}
|
|
37314
37315
|
return str.replaceAll("\0", "");
|
|
37315
37316
|
}
|
|
@@ -37345,9 +37346,9 @@ function approximateFraction(x) {
|
|
|
37345
37346
|
return [1, xinv];
|
|
37346
37347
|
}
|
|
37347
37348
|
const x_ = x > 1 ? xinv : x;
|
|
37348
|
-
let
|
|
37349
|
+
let a2 = 0, b = 1, c2 = 1, d = 1;
|
|
37349
37350
|
while (true) {
|
|
37350
|
-
const p =
|
|
37351
|
+
const p = a2 + c2, q = b + d;
|
|
37351
37352
|
if (q > limit) {
|
|
37352
37353
|
break;
|
|
37353
37354
|
}
|
|
@@ -37355,13 +37356,13 @@ function approximateFraction(x) {
|
|
|
37355
37356
|
c2 = p;
|
|
37356
37357
|
d = q;
|
|
37357
37358
|
} else {
|
|
37358
|
-
|
|
37359
|
+
a2 = p;
|
|
37359
37360
|
b = q;
|
|
37360
37361
|
}
|
|
37361
37362
|
}
|
|
37362
37363
|
let result;
|
|
37363
|
-
if (x_ -
|
|
37364
|
-
result = x_ === x ? [
|
|
37364
|
+
if (x_ - a2 / b < c2 / d - x_) {
|
|
37365
|
+
result = x_ === x ? [a2, b] : [b, a2];
|
|
37365
37366
|
} else {
|
|
37366
37367
|
result = x_ === x ? [c2, d] : [d, c2];
|
|
37367
37368
|
}
|
|
@@ -37449,12 +37450,12 @@ function getVisibleElements({
|
|
|
37449
37450
|
}
|
|
37450
37451
|
const first = visible[0], last = visible.at(-1);
|
|
37451
37452
|
if (sortByVisibility) {
|
|
37452
|
-
visible.sort(function(
|
|
37453
|
-
const pc =
|
|
37453
|
+
visible.sort(function(a2, b) {
|
|
37454
|
+
const pc = a2.percent - b.percent;
|
|
37454
37455
|
if (Math.abs(pc) > 1e-3) {
|
|
37455
37456
|
return -pc;
|
|
37456
37457
|
}
|
|
37457
|
-
return
|
|
37458
|
+
return a2.id - b.id;
|
|
37458
37459
|
});
|
|
37459
37460
|
}
|
|
37460
37461
|
return {
|
|
@@ -37676,12 +37677,12 @@ let noSyllablesRegExp = null;
|
|
|
37676
37677
|
let withSyllablesRegExp = null;
|
|
37677
37678
|
function normalize(text) {
|
|
37678
37679
|
const syllablePositions = [];
|
|
37679
|
-
let
|
|
37680
|
-
while ((
|
|
37680
|
+
let m;
|
|
37681
|
+
while ((m = SYLLABLES_REG_EXP.exec(text)) !== null) {
|
|
37681
37682
|
let {
|
|
37682
37683
|
index: index2
|
|
37683
|
-
} =
|
|
37684
|
-
for (const char of
|
|
37684
|
+
} = m;
|
|
37685
|
+
for (const char of m[0]) {
|
|
37685
37686
|
let len = SYLLABLES_LENGTHS.get(char);
|
|
37686
37687
|
if (!len) {
|
|
37687
37688
|
len = char.normalize("NFD").length;
|
|
@@ -37708,8 +37709,8 @@ function normalize(text) {
|
|
|
37708
37709
|
}
|
|
37709
37710
|
}
|
|
37710
37711
|
const rawDiacriticsPositions = [];
|
|
37711
|
-
while ((
|
|
37712
|
-
rawDiacriticsPositions.push([
|
|
37712
|
+
while ((m = DIACRITICS_REG_EXP.exec(text)) !== null) {
|
|
37713
|
+
rawDiacriticsPositions.push([m[0].length, m.index]);
|
|
37713
37714
|
}
|
|
37714
37715
|
let normalized = text.normalize("NFD");
|
|
37715
37716
|
const positions = [[0, 0]];
|
|
@@ -38868,18 +38869,18 @@ class AnnotationLayerBuilder {
|
|
|
38868
38869
|
}
|
|
38869
38870
|
}
|
|
38870
38871
|
function download(blobUrl, filename) {
|
|
38871
|
-
const
|
|
38872
|
-
if (!
|
|
38872
|
+
const a2 = document.createElement("a");
|
|
38873
|
+
if (!a2.click) {
|
|
38873
38874
|
throw new Error('DownloadManager: "a.click()" is not supported.');
|
|
38874
38875
|
}
|
|
38875
|
-
|
|
38876
|
-
|
|
38877
|
-
if ("download" in
|
|
38878
|
-
|
|
38876
|
+
a2.href = blobUrl;
|
|
38877
|
+
a2.target = "_parent";
|
|
38878
|
+
if ("download" in a2) {
|
|
38879
|
+
a2.download = filename;
|
|
38879
38880
|
}
|
|
38880
|
-
(document.body || document.documentElement).append(
|
|
38881
|
-
|
|
38882
|
-
|
|
38881
|
+
(document.body || document.documentElement).append(a2);
|
|
38882
|
+
a2.click();
|
|
38883
|
+
a2.remove();
|
|
38883
38884
|
}
|
|
38884
38885
|
class DownloadManager {
|
|
38885
38886
|
#openBlobUrls = /* @__PURE__ */ new WeakMap();
|
|
@@ -41629,8 +41630,8 @@ class TextHighlighter {
|
|
|
41629
41630
|
let i2 = 0, iIndex = 0;
|
|
41630
41631
|
const end = textContentItemsStr.length - 1;
|
|
41631
41632
|
const result = [];
|
|
41632
|
-
for (let
|
|
41633
|
-
let matchIdx = matches[
|
|
41633
|
+
for (let m = 0, mm = matches.length; m < mm; m++) {
|
|
41634
|
+
let matchIdx = matches[m];
|
|
41634
41635
|
while (i2 !== end && matchIdx >= iIndex + textContentItemsStr[i2].length) {
|
|
41635
41636
|
iIndex += textContentItemsStr[i2].length;
|
|
41636
41637
|
i2++;
|
|
@@ -41644,7 +41645,7 @@ class TextHighlighter {
|
|
|
41644
41645
|
offset: matchIdx - iIndex
|
|
41645
41646
|
}
|
|
41646
41647
|
};
|
|
41647
|
-
matchIdx += matchesLength[
|
|
41648
|
+
matchIdx += matchesLength[m];
|
|
41648
41649
|
while (i2 !== end && matchIdx > iIndex + textContentItemsStr[i2].length) {
|
|
41649
41650
|
iIndex += textContentItemsStr[i2].length;
|
|
41650
41651
|
i2++;
|
|
@@ -41770,9 +41771,9 @@ class TextHighlighter {
|
|
|
41770
41771
|
let clearedUntilDivIdx = -1;
|
|
41771
41772
|
for (const match2 of matches) {
|
|
41772
41773
|
const begin = Math.max(clearedUntilDivIdx, match2.begin.divIdx);
|
|
41773
|
-
for (let
|
|
41774
|
-
const div = textDivs[
|
|
41775
|
-
div.textContent = textContentItemsStr[
|
|
41774
|
+
for (let n2 = begin, end = match2.end.divIdx; n2 <= end; n2++) {
|
|
41775
|
+
const div = textDivs[n2];
|
|
41776
|
+
div.textContent = textContentItemsStr[n2];
|
|
41776
41777
|
div.className = "";
|
|
41777
41778
|
}
|
|
41778
41779
|
clearedUntilDivIdx = match2.end.divIdx + 1;
|
|
@@ -45239,7 +45240,7 @@ const _sfc_main$9 = {
|
|
|
45239
45240
|
};
|
|
45240
45241
|
const processLocations = async () => {
|
|
45241
45242
|
let currentBottom = 0;
|
|
45242
|
-
renderedSizes.value.sort((
|
|
45243
|
+
renderedSizes.value.sort((a2, b) => a2.top - b.top).forEach((comment) => {
|
|
45243
45244
|
if (comment.top <= currentBottom + 15) {
|
|
45244
45245
|
comment.top = currentBottom + 15;
|
|
45245
45246
|
}
|
|
@@ -45925,6 +45926,16 @@ function useAi({ emitAiHighlight, activeEditorRef }) {
|
|
|
45925
45926
|
handleAiToolClick
|
|
45926
45927
|
};
|
|
45927
45928
|
}
|
|
45929
|
+
const isHighContrastMode = ref(false);
|
|
45930
|
+
function useHighContrastMode() {
|
|
45931
|
+
const setHighContrastMode = (value) => {
|
|
45932
|
+
isHighContrastMode.value = value;
|
|
45933
|
+
};
|
|
45934
|
+
return {
|
|
45935
|
+
isHighContrastMode,
|
|
45936
|
+
setHighContrastMode
|
|
45937
|
+
};
|
|
45938
|
+
}
|
|
45928
45939
|
const _hoisted_1 = ["innerHTML"];
|
|
45929
45940
|
const _hoisted_2 = { class: "superdoc__document document" };
|
|
45930
45941
|
const _hoisted_3 = {
|
|
@@ -45966,6 +45977,7 @@ const _sfc_main = {
|
|
|
45966
45977
|
const { showAddComment, handleEditorLocationsUpdate, handleTrackedChangeUpdate } = commentsStore;
|
|
45967
45978
|
const { proxy } = getCurrentInstance();
|
|
45968
45979
|
commentsStore.proxy = proxy;
|
|
45980
|
+
const { isHighContrastMode: isHighContrastMode2 } = useHighContrastMode();
|
|
45969
45981
|
const layers = ref(null);
|
|
45970
45982
|
const commentsLayer = ref(null);
|
|
45971
45983
|
const toolsMenuPosition = reactive({ top: null, right: "-25px", zIndex: 101 });
|
|
@@ -46321,12 +46333,13 @@ const _sfc_main = {
|
|
|
46321
46333
|
return (_ctx, _cache) => {
|
|
46322
46334
|
const _directive_click_outside = resolveDirective("click-outside");
|
|
46323
46335
|
return openBlock(), createElementBlock("div", {
|
|
46324
|
-
class: normalizeClass(["superdoc", { "superdoc--with-sidebar": showCommentsSidebar.value }])
|
|
46336
|
+
class: normalizeClass(["superdoc", { "superdoc--with-sidebar": showCommentsSidebar.value, "high-contrast": unref(isHighContrastMode2) }])
|
|
46325
46337
|
}, [
|
|
46326
46338
|
createBaseVNode("div", {
|
|
46327
46339
|
class: "superdoc__layers layers",
|
|
46328
46340
|
ref_key: "layers",
|
|
46329
|
-
ref: layers
|
|
46341
|
+
ref: layers,
|
|
46342
|
+
role: "group"
|
|
46330
46343
|
}, [
|
|
46331
46344
|
showToolsFloatingMenu.value ? (openBlock(), createElementBlock("div", {
|
|
46332
46345
|
key: 0,
|
|
@@ -46461,7 +46474,7 @@ const _sfc_main = {
|
|
|
46461
46474
|
};
|
|
46462
46475
|
}
|
|
46463
46476
|
};
|
|
46464
|
-
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
46477
|
+
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fc218ba5"]]);
|
|
46465
46478
|
const createSuperdocVueApp = () => {
|
|
46466
46479
|
const app = createApp(App);
|
|
46467
46480
|
const pinia = createPinia();
|
|
@@ -46469,14 +46482,15 @@ const createSuperdocVueApp = () => {
|
|
|
46469
46482
|
app.directive("click-outside", vClickOutside);
|
|
46470
46483
|
const superdocStore = useSuperdocStore();
|
|
46471
46484
|
const commentsStore = useCommentsStore();
|
|
46472
|
-
|
|
46485
|
+
const highContrastModeStore = useHighContrastMode();
|
|
46486
|
+
return { app, pinia, superdocStore, commentsStore, highContrastModeStore };
|
|
46473
46487
|
};
|
|
46474
46488
|
const createDownload = (blob, name, extension) => {
|
|
46475
46489
|
const url = URL.createObjectURL(blob);
|
|
46476
|
-
const
|
|
46477
|
-
|
|
46478
|
-
|
|
46479
|
-
|
|
46490
|
+
const a2 = document.createElement("a");
|
|
46491
|
+
a2.href = url;
|
|
46492
|
+
a2.download = `${name}.${extension}`;
|
|
46493
|
+
a2.click();
|
|
46480
46494
|
};
|
|
46481
46495
|
const cleanName = (currentName) => {
|
|
46482
46496
|
if (currentName.toLowerCase().endsWith(".docx") || currentName.toLowerCase().endsWith(".pdf")) {
|
|
@@ -46559,7 +46573,7 @@ class SuperDoc extends EventEmitter {
|
|
|
46559
46573
|
this.config.colors = shuffleArray(this.config.colors);
|
|
46560
46574
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
46561
46575
|
this.colorIndex = 0;
|
|
46562
|
-
this.version = "0.12.
|
|
46576
|
+
this.version = "0.12.34-next.1";
|
|
46563
46577
|
console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
46564
46578
|
this.superdocId = config.superdocId || v4();
|
|
46565
46579
|
this.colors = this.config.colors;
|
|
@@ -46636,7 +46650,7 @@ class SuperDoc extends EventEmitter {
|
|
|
46636
46650
|
}
|
|
46637
46651
|
}
|
|
46638
46652
|
#initVueApp() {
|
|
46639
|
-
const { app, pinia, superdocStore, commentsStore } = createSuperdocVueApp();
|
|
46653
|
+
const { app, pinia, superdocStore, commentsStore, highContrastModeStore } = createSuperdocVueApp();
|
|
46640
46654
|
this.app = app;
|
|
46641
46655
|
this.pinia = pinia;
|
|
46642
46656
|
this.app.config.globalProperties.$config = this.config;
|
|
@@ -46644,6 +46658,7 @@ class SuperDoc extends EventEmitter {
|
|
|
46644
46658
|
this.app.config.globalProperties.$superdoc = this;
|
|
46645
46659
|
this.superdocStore = superdocStore;
|
|
46646
46660
|
this.commentsStore = commentsStore;
|
|
46661
|
+
this.highContrastModeStore = highContrastModeStore;
|
|
46647
46662
|
this.superdocStore.init(this.config);
|
|
46648
46663
|
this.commentsStore.init(this.config.modules.comments);
|
|
46649
46664
|
}
|
|
@@ -47115,8 +47130,19 @@ class SuperDoc extends EventEmitter {
|
|
|
47115
47130
|
});
|
|
47116
47131
|
}
|
|
47117
47132
|
}
|
|
47133
|
+
/**
|
|
47134
|
+
* Set the high contrast mode
|
|
47135
|
+
* @param {boolean} isHighContrast
|
|
47136
|
+
* @returns {void}
|
|
47137
|
+
*/
|
|
47138
|
+
setHighContrastMode(isHighContrast) {
|
|
47139
|
+
if (!this.activeEditor) return;
|
|
47140
|
+
this.activeEditor.setHighContrastMode(isHighContrast);
|
|
47141
|
+
this.highContrastModeStore.setHighContrastMode(isHighContrast);
|
|
47142
|
+
}
|
|
47118
47143
|
}
|
|
47119
47144
|
export {
|
|
47145
|
+
a as AnnotatorHelpers,
|
|
47120
47146
|
BlankDOCX,
|
|
47121
47147
|
DOCX,
|
|
47122
47148
|
Editor,
|
|
@@ -47129,6 +47155,6 @@ export {
|
|
|
47129
47155
|
i as fieldAnnotationHelpers,
|
|
47130
47156
|
getFileObject,
|
|
47131
47157
|
getRichTextExtensions,
|
|
47132
|
-
|
|
47158
|
+
n as superEditorHelpers,
|
|
47133
47159
|
index$1 as trackChangesHelpers
|
|
47134
47160
|
};
|