pdfjs-dist 2.6.347 → 2.7.570
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.
Potentially problematic release.
This version of pdfjs-dist might be problematic. Click here for more details.
- package/README.md +3 -3
- package/bower.json +1 -1
- package/build/pdf.js +2050 -1087
- package/build/pdf.js.map +1 -1
- package/build/pdf.min.js +1 -1
- package/build/pdf.worker.js +18219 -10436
- package/build/pdf.worker.js.map +1 -1
- package/build/pdf.worker.min.js +1 -1
- package/es5/build/pdf.d.ts +1 -0
- package/es5/build/pdf.js +6623 -6654
- package/es5/build/pdf.js.map +1 -1
- package/es5/build/pdf.min.js +1 -1
- package/es5/build/pdf.worker.js +20815 -13888
- package/es5/build/pdf.worker.js.map +1 -1
- package/es5/build/pdf.worker.min.js +1 -1
- package/es5/image_decoders/pdf.image_decoders.js +3817 -4946
- package/es5/image_decoders/pdf.image_decoders.js.map +1 -1
- package/es5/image_decoders/pdf.image_decoders.min.js +1 -1
- package/es5/web/pdf_viewer.css +18 -15
- package/es5/web/pdf_viewer.js +1094 -514
- package/es5/web/pdf_viewer.js.map +1 -1
- package/image_decoders/pdf.image_decoders.js +774 -168
- package/image_decoders/pdf.image_decoders.js.map +1 -1
- package/image_decoders/pdf.image_decoders.min.js +1 -1
- package/lib/core/annotation.js +556 -108
- package/lib/core/cff_parser.js +7 -1
- package/lib/core/charsets.js +1 -1
- package/lib/core/cmap.js +20 -1
- package/lib/core/core_utils.js +162 -3
- package/lib/core/crypto.js +1 -1
- package/lib/core/default_appearance.js +132 -0
- package/lib/core/document.js +115 -9
- package/lib/core/encodings.js +1 -1
- package/lib/core/evaluator.js +168 -74
- package/lib/core/fonts.js +97 -11
- package/lib/core/function.js +5 -10
- package/lib/core/glyphlist.js +11 -4529
- package/lib/core/image_utils.js +30 -1
- package/lib/core/jpg.js +1 -1
- package/lib/core/jpx.js +5 -5
- package/lib/core/murmurhash3.js +1 -1
- package/lib/core/obj.js +123 -39
- package/lib/core/pattern.js +4 -4
- package/lib/core/primitives.js +24 -5
- package/lib/core/standard_fonts.js +1 -1
- package/lib/core/stream.js +5 -1
- package/lib/core/unicode.js +15 -1387
- package/lib/core/worker.js +58 -17
- package/lib/core/writer.js +68 -4
- package/lib/display/annotation_layer.js +712 -119
- package/lib/display/annotation_storage.js +21 -4
- package/lib/display/api.js +88 -18
- package/lib/display/canvas.js +414 -375
- package/lib/display/display_utils.js +11 -4
- package/lib/display/fetch_stream.js +3 -3
- package/lib/display/font_loader.js +2 -3
- package/lib/display/metadata.js +54 -20
- package/lib/display/node_stream.js +1 -1
- package/lib/display/optional_content_config.js +1 -1
- package/lib/display/pattern_helper.js +109 -113
- package/lib/display/svg.js +5 -5
- package/lib/display/text_layer.js +54 -54
- package/lib/display/transport_stream.js +4 -4
- package/lib/display/webgl.js +65 -68
- package/lib/examples/node/domstubs.js +9 -4
- package/lib/pdf.js +2 -2
- package/lib/pdf.sandbox.js +311 -0
- package/lib/pdf.worker.js +2 -2
- package/lib/shared/scripting_utils.js +84 -0
- package/lib/shared/util.js +129 -14
- package/lib/{display → shared}/xml_parser.js +112 -4
- package/lib/test/unit/annotation_spec.js +831 -109
- package/lib/test/unit/annotation_storage_spec.js +28 -10
- package/lib/test/unit/api_spec.js +190 -160
- package/lib/test/unit/bidi_spec.js +6 -6
- package/lib/test/unit/cff_parser_spec.js +73 -73
- package/lib/test/unit/clitests_helper.js +2 -0
- package/lib/test/unit/cmap_spec.js +48 -74
- package/lib/test/unit/core_utils_spec.js +34 -0
- package/lib/test/unit/crypto_spec.js +162 -199
- package/lib/test/unit/custom_spec.js +7 -18
- package/lib/test/unit/default_appearance_spec.js +54 -0
- package/lib/test/unit/display_svg_spec.js +24 -19
- package/lib/test/unit/display_utils_spec.js +1 -1
- package/lib/test/unit/document_spec.js +187 -20
- package/lib/test/unit/evaluator_spec.js +30 -30
- package/lib/test/unit/function_spec.js +165 -165
- package/lib/test/unit/jasmine-boot.js +52 -53
- package/lib/test/unit/metadata_spec.js +2 -2
- package/lib/test/unit/murmurhash3_spec.js +29 -16
- package/lib/test/unit/network_spec.js +21 -21
- package/lib/test/unit/pdf_find_controller_spec.js +131 -69
- package/lib/test/unit/pdf_find_utils_spec.js +10 -10
- package/lib/test/unit/scripting_spec.js +1104 -0
- package/lib/test/unit/stream_spec.js +8 -8
- package/lib/test/unit/test_utils.js +16 -19
- package/lib/test/unit/testreporter.js +11 -4
- package/lib/test/unit/type1_parser_spec.js +23 -23
- package/lib/test/unit/ui_utils_spec.js +78 -35
- package/lib/test/unit/unicode_spec.js +7 -7
- package/lib/test/unit/util_spec.js +26 -3
- package/lib/test/unit/writer_spec.js +16 -1
- package/lib/test/unit/xml_spec.js +117 -0
- package/lib/web/annotation_layer_builder.js +18 -6
- package/lib/web/app.js +579 -161
- package/lib/web/app_options.js +14 -0
- package/lib/web/base_tree_viewer.js +50 -0
- package/lib/web/base_viewer.js +350 -14
- package/lib/web/chromecom.js +9 -1
- package/lib/web/debugger.js +1 -2
- package/lib/web/download_manager.js +0 -15
- package/lib/web/firefox_print_service.js +6 -4
- package/lib/web/firefoxcom.js +84 -69
- package/lib/web/generic_scripting.js +55 -0
- package/lib/web/genericcom.js +9 -1
- package/lib/web/grab_to_pan.js +1 -1
- package/lib/web/interfaces.js +9 -3
- package/lib/web/pdf_attachment_viewer.js +1 -3
- package/lib/web/pdf_cursor_tools.js +20 -13
- package/lib/web/pdf_document_properties.js +48 -61
- package/lib/web/pdf_find_bar.js +1 -3
- package/lib/web/pdf_find_controller.js +58 -12
- package/lib/web/pdf_history.js +43 -21
- package/lib/web/pdf_layer_viewer.js +1 -9
- package/lib/web/pdf_link_service.js +108 -78
- package/lib/web/pdf_outline_viewer.js +166 -10
- package/lib/web/pdf_page_view.js +14 -14
- package/lib/web/pdf_presentation_mode.js +21 -31
- package/lib/web/pdf_rendering_queue.js +8 -1
- package/lib/web/pdf_sidebar.js +62 -107
- package/lib/web/pdf_sidebar_resizer.js +11 -21
- package/lib/web/pdf_single_page_viewer.js +8 -0
- package/lib/web/pdf_thumbnail_view.js +26 -26
- package/lib/web/pdf_thumbnail_viewer.js +13 -2
- package/lib/web/pdf_viewer.component.js +2 -2
- package/lib/web/pdf_viewer.js +3 -1
- package/lib/web/preferences.js +33 -44
- package/lib/web/text_layer_builder.js +2 -9
- package/lib/web/ui_utils.js +78 -46
- package/lib/web/viewer_compatibility.js +1 -2
- package/package.json +4 -1
- package/types/display/annotation_layer.d.ts +18 -3
- package/types/display/api.d.ts +110 -54
- package/types/display/canvas.d.ts +1 -1
- package/types/display/display_utils.d.ts +96 -95
- package/types/display/fetch_stream.d.ts +2 -2
- package/types/display/metadata.d.ts +4 -0
- package/types/display/pattern_helper.d.ts +1 -1
- package/types/display/text_layer.d.ts +7 -7
- package/types/display/transport_stream.d.ts +1 -1
- package/types/shared/scripting_utils.d.ts +12 -0
- package/types/shared/util.d.ts +281 -250
- package/types/shared/xml_parser.d.ts +64 -0
- package/web/pdf_viewer.css +18 -15
- package/web/pdf_viewer.js +809 -408
- package/web/pdf_viewer.js.map +1 -1
- package/webpack.js +1 -1
- package/types/display/xml_parser.d.ts +0 -35
package/es5/web/pdf_viewer.js
CHANGED
@@ -30,241 +30,167 @@
|
|
30
30
|
else
|
31
31
|
root["pdfjs-dist/web/pdf_viewer"] = root.pdfjsViewer = factory();
|
32
32
|
})(this, function() {
|
33
|
-
return /******/ (
|
34
|
-
/******/
|
35
|
-
/******/ var
|
36
|
-
/******/
|
37
|
-
/******/ // The require function
|
38
|
-
/******/ function __w_pdfjs_require__(moduleId) {
|
39
|
-
/******/
|
40
|
-
/******/ // Check if module is in cache
|
41
|
-
/******/ if(installedModules[moduleId]) {
|
42
|
-
/******/ return installedModules[moduleId].exports;
|
43
|
-
/******/ }
|
44
|
-
/******/ // Create a new module (and put it into the cache)
|
45
|
-
/******/ var module = installedModules[moduleId] = {
|
46
|
-
/******/ i: moduleId,
|
47
|
-
/******/ l: false,
|
48
|
-
/******/ exports: {}
|
49
|
-
/******/ };
|
50
|
-
/******/
|
51
|
-
/******/ // Execute the module function
|
52
|
-
/******/ modules[moduleId].call(module.exports, module, module.exports, __w_pdfjs_require__);
|
53
|
-
/******/
|
54
|
-
/******/ // Flag the module as loaded
|
55
|
-
/******/ module.l = true;
|
56
|
-
/******/
|
57
|
-
/******/ // Return the exports of the module
|
58
|
-
/******/ return module.exports;
|
59
|
-
/******/ }
|
60
|
-
/******/
|
61
|
-
/******/
|
62
|
-
/******/ // expose the modules object (__webpack_modules__)
|
63
|
-
/******/ __w_pdfjs_require__.m = modules;
|
64
|
-
/******/
|
65
|
-
/******/ // expose the module cache
|
66
|
-
/******/ __w_pdfjs_require__.c = installedModules;
|
67
|
-
/******/
|
68
|
-
/******/ // define getter function for harmony exports
|
69
|
-
/******/ __w_pdfjs_require__.d = function(exports, name, getter) {
|
70
|
-
/******/ if(!__w_pdfjs_require__.o(exports, name)) {
|
71
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
72
|
-
/******/ }
|
73
|
-
/******/ };
|
74
|
-
/******/
|
75
|
-
/******/ // define __esModule on exports
|
76
|
-
/******/ __w_pdfjs_require__.r = function(exports) {
|
77
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
78
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
79
|
-
/******/ }
|
80
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
81
|
-
/******/ };
|
82
|
-
/******/
|
83
|
-
/******/ // create a fake namespace object
|
84
|
-
/******/ // mode & 1: value is a module id, require it
|
85
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
86
|
-
/******/ // mode & 4: return value when already ns object
|
87
|
-
/******/ // mode & 8|1: behave like require
|
88
|
-
/******/ __w_pdfjs_require__.t = function(value, mode) {
|
89
|
-
/******/ if(mode & 1) value = __w_pdfjs_require__(value);
|
90
|
-
/******/ if(mode & 8) return value;
|
91
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
92
|
-
/******/ var ns = Object.create(null);
|
93
|
-
/******/ __w_pdfjs_require__.r(ns);
|
94
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
95
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __w_pdfjs_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
96
|
-
/******/ return ns;
|
97
|
-
/******/ };
|
98
|
-
/******/
|
99
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
100
|
-
/******/ __w_pdfjs_require__.n = function(module) {
|
101
|
-
/******/ var getter = module && module.__esModule ?
|
102
|
-
/******/ function getDefault() { return module['default']; } :
|
103
|
-
/******/ function getModuleExports() { return module; };
|
104
|
-
/******/ __w_pdfjs_require__.d(getter, 'a', getter);
|
105
|
-
/******/ return getter;
|
106
|
-
/******/ };
|
107
|
-
/******/
|
108
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
109
|
-
/******/ __w_pdfjs_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
110
|
-
/******/
|
111
|
-
/******/ // __webpack_public_path__
|
112
|
-
/******/ __w_pdfjs_require__.p = "";
|
113
|
-
/******/
|
114
|
-
/******/
|
115
|
-
/******/ // Load entry module and return exports
|
116
|
-
/******/ return __w_pdfjs_require__(__w_pdfjs_require__.s = 0);
|
117
|
-
/******/ })
|
118
|
-
/************************************************************************/
|
119
|
-
/******/ ([
|
33
|
+
return /******/ (() => { // webpackBootstrap
|
34
|
+
/******/ "use strict";
|
35
|
+
/******/ var __webpack_modules__ = ([
|
120
36
|
/* 0 */
|
121
|
-
/***/ (
|
37
|
+
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
|
122
38
|
|
123
|
-
"use strict";
|
124
39
|
|
125
40
|
|
126
|
-
Object.defineProperty(exports, "__esModule", {
|
41
|
+
Object.defineProperty(exports, "__esModule", ({
|
127
42
|
value: true
|
128
|
-
});
|
129
|
-
Object.defineProperty(exports, "AnnotationLayerBuilder", {
|
43
|
+
}));
|
44
|
+
Object.defineProperty(exports, "AnnotationLayerBuilder", ({
|
130
45
|
enumerable: true,
|
131
46
|
get: function get() {
|
132
47
|
return _annotation_layer_builder.AnnotationLayerBuilder;
|
133
48
|
}
|
134
|
-
});
|
135
|
-
Object.defineProperty(exports, "DefaultAnnotationLayerFactory", {
|
49
|
+
}));
|
50
|
+
Object.defineProperty(exports, "DefaultAnnotationLayerFactory", ({
|
136
51
|
enumerable: true,
|
137
52
|
get: function get() {
|
138
53
|
return _annotation_layer_builder.DefaultAnnotationLayerFactory;
|
139
54
|
}
|
140
|
-
});
|
141
|
-
Object.defineProperty(exports, "DefaultTextLayerFactory", {
|
55
|
+
}));
|
56
|
+
Object.defineProperty(exports, "DefaultTextLayerFactory", ({
|
142
57
|
enumerable: true,
|
143
58
|
get: function get() {
|
144
59
|
return _text_layer_builder.DefaultTextLayerFactory;
|
145
60
|
}
|
146
|
-
});
|
147
|
-
Object.defineProperty(exports, "TextLayerBuilder", {
|
61
|
+
}));
|
62
|
+
Object.defineProperty(exports, "TextLayerBuilder", ({
|
148
63
|
enumerable: true,
|
149
64
|
get: function get() {
|
150
65
|
return _text_layer_builder.TextLayerBuilder;
|
151
66
|
}
|
152
|
-
});
|
153
|
-
Object.defineProperty(exports, "EventBus", {
|
67
|
+
}));
|
68
|
+
Object.defineProperty(exports, "EventBus", ({
|
154
69
|
enumerable: true,
|
155
70
|
get: function get() {
|
156
71
|
return _ui_utils.EventBus;
|
157
72
|
}
|
158
|
-
});
|
159
|
-
Object.defineProperty(exports, "NullL10n", {
|
73
|
+
}));
|
74
|
+
Object.defineProperty(exports, "NullL10n", ({
|
160
75
|
enumerable: true,
|
161
76
|
get: function get() {
|
162
77
|
return _ui_utils.NullL10n;
|
163
78
|
}
|
164
|
-
});
|
165
|
-
Object.defineProperty(exports, "ProgressBar", {
|
79
|
+
}));
|
80
|
+
Object.defineProperty(exports, "ProgressBar", ({
|
166
81
|
enumerable: true,
|
167
82
|
get: function get() {
|
168
83
|
return _ui_utils.ProgressBar;
|
169
84
|
}
|
170
|
-
});
|
171
|
-
Object.defineProperty(exports, "PDFLinkService", {
|
85
|
+
}));
|
86
|
+
Object.defineProperty(exports, "PDFLinkService", ({
|
172
87
|
enumerable: true,
|
173
88
|
get: function get() {
|
174
89
|
return _pdf_link_service.PDFLinkService;
|
175
90
|
}
|
176
|
-
});
|
177
|
-
Object.defineProperty(exports, "SimpleLinkService", {
|
91
|
+
}));
|
92
|
+
Object.defineProperty(exports, "SimpleLinkService", ({
|
178
93
|
enumerable: true,
|
179
94
|
get: function get() {
|
180
95
|
return _pdf_link_service.SimpleLinkService;
|
181
96
|
}
|
182
|
-
});
|
183
|
-
Object.defineProperty(exports, "DownloadManager", {
|
97
|
+
}));
|
98
|
+
Object.defineProperty(exports, "DownloadManager", ({
|
184
99
|
enumerable: true,
|
185
100
|
get: function get() {
|
186
101
|
return _download_manager.DownloadManager;
|
187
102
|
}
|
188
|
-
});
|
189
|
-
Object.defineProperty(exports, "GenericL10n", {
|
103
|
+
}));
|
104
|
+
Object.defineProperty(exports, "GenericL10n", ({
|
190
105
|
enumerable: true,
|
191
106
|
get: function get() {
|
192
107
|
return _genericl10n.GenericL10n;
|
193
108
|
}
|
194
|
-
});
|
195
|
-
Object.defineProperty(exports, "PDFFindController", {
|
109
|
+
}));
|
110
|
+
Object.defineProperty(exports, "PDFFindController", ({
|
196
111
|
enumerable: true,
|
197
112
|
get: function get() {
|
198
113
|
return _pdf_find_controller.PDFFindController;
|
199
114
|
}
|
200
|
-
});
|
201
|
-
Object.defineProperty(exports, "PDFHistory", {
|
115
|
+
}));
|
116
|
+
Object.defineProperty(exports, "PDFHistory", ({
|
202
117
|
enumerable: true,
|
203
118
|
get: function get() {
|
204
119
|
return _pdf_history.PDFHistory;
|
205
120
|
}
|
206
|
-
});
|
207
|
-
Object.defineProperty(exports, "PDFPageView", {
|
121
|
+
}));
|
122
|
+
Object.defineProperty(exports, "PDFPageView", ({
|
208
123
|
enumerable: true,
|
209
124
|
get: function get() {
|
210
125
|
return _pdf_page_view.PDFPageView;
|
211
126
|
}
|
212
|
-
});
|
213
|
-
Object.defineProperty(exports, "PDFSinglePageViewer", {
|
127
|
+
}));
|
128
|
+
Object.defineProperty(exports, "PDFSinglePageViewer", ({
|
214
129
|
enumerable: true,
|
215
130
|
get: function get() {
|
216
131
|
return _pdf_single_page_viewer.PDFSinglePageViewer;
|
217
132
|
}
|
218
|
-
});
|
219
|
-
Object.defineProperty(exports, "PDFViewer", {
|
133
|
+
}));
|
134
|
+
Object.defineProperty(exports, "PDFViewer", ({
|
220
135
|
enumerable: true,
|
221
136
|
get: function get() {
|
222
137
|
return _pdf_viewer.PDFViewer;
|
223
138
|
}
|
224
|
-
});
|
139
|
+
}));
|
225
140
|
|
226
141
|
var _annotation_layer_builder = __w_pdfjs_require__(1);
|
227
142
|
|
228
|
-
var _text_layer_builder = __w_pdfjs_require__(
|
143
|
+
var _text_layer_builder = __w_pdfjs_require__(7);
|
229
144
|
|
230
145
|
var _ui_utils = __w_pdfjs_require__(3);
|
231
146
|
|
232
|
-
var _pdf_link_service = __w_pdfjs_require__(
|
147
|
+
var _pdf_link_service = __w_pdfjs_require__(6);
|
233
148
|
|
234
|
-
var _download_manager = __w_pdfjs_require__(
|
149
|
+
var _download_manager = __w_pdfjs_require__(8);
|
235
150
|
|
236
|
-
var _genericl10n = __w_pdfjs_require__(
|
151
|
+
var _genericl10n = __w_pdfjs_require__(10);
|
237
152
|
|
238
|
-
var _pdf_find_controller = __w_pdfjs_require__(
|
153
|
+
var _pdf_find_controller = __w_pdfjs_require__(12);
|
239
154
|
|
240
|
-
var _pdf_history = __w_pdfjs_require__(
|
155
|
+
var _pdf_history = __w_pdfjs_require__(14);
|
241
156
|
|
242
|
-
var _pdf_page_view = __w_pdfjs_require__(
|
157
|
+
var _pdf_page_view = __w_pdfjs_require__(15);
|
243
158
|
|
244
|
-
var _pdf_single_page_viewer = __w_pdfjs_require__(
|
159
|
+
var _pdf_single_page_viewer = __w_pdfjs_require__(17);
|
245
160
|
|
246
|
-
var _pdf_viewer = __w_pdfjs_require__(
|
161
|
+
var _pdf_viewer = __w_pdfjs_require__(19);
|
247
162
|
|
248
|
-
var pdfjsVersion = '2.
|
249
|
-
var pdfjsBuild = '
|
163
|
+
var pdfjsVersion = '2.7.570';
|
164
|
+
var pdfjsBuild = 'f2c7338b0';
|
250
165
|
|
251
166
|
/***/ }),
|
252
167
|
/* 1 */
|
253
|
-
/***/ (
|
168
|
+
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
|
254
169
|
|
255
|
-
"use strict";
|
256
170
|
|
257
171
|
|
258
|
-
Object.defineProperty(exports, "__esModule", {
|
172
|
+
Object.defineProperty(exports, "__esModule", ({
|
259
173
|
value: true
|
260
|
-
});
|
174
|
+
}));
|
261
175
|
exports.DefaultAnnotationLayerFactory = exports.AnnotationLayerBuilder = void 0;
|
262
176
|
|
263
177
|
var _pdfjsLib = __w_pdfjs_require__(2);
|
264
178
|
|
265
179
|
var _ui_utils = __w_pdfjs_require__(3);
|
266
180
|
|
267
|
-
var _pdf_link_service = __w_pdfjs_require__(
|
181
|
+
var _pdf_link_service = __w_pdfjs_require__(6);
|
182
|
+
|
183
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
184
|
+
|
185
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
186
|
+
|
187
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
188
|
+
|
189
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
190
|
+
|
191
|
+
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
192
|
+
|
193
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
268
194
|
|
269
195
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
270
196
|
|
@@ -285,7 +211,13 @@ var AnnotationLayerBuilder = /*#__PURE__*/function () {
|
|
285
211
|
_ref$renderInteractiv = _ref.renderInteractiveForms,
|
286
212
|
renderInteractiveForms = _ref$renderInteractiv === void 0 ? true : _ref$renderInteractiv,
|
287
213
|
_ref$l10n = _ref.l10n,
|
288
|
-
l10n = _ref$l10n === void 0 ? _ui_utils.NullL10n : _ref$l10n
|
214
|
+
l10n = _ref$l10n === void 0 ? _ui_utils.NullL10n : _ref$l10n,
|
215
|
+
_ref$enableScripting = _ref.enableScripting,
|
216
|
+
enableScripting = _ref$enableScripting === void 0 ? false : _ref$enableScripting,
|
217
|
+
_ref$hasJSActionsProm = _ref.hasJSActionsPromise,
|
218
|
+
hasJSActionsPromise = _ref$hasJSActionsProm === void 0 ? null : _ref$hasJSActionsProm,
|
219
|
+
_ref$mouseState = _ref.mouseState,
|
220
|
+
mouseState = _ref$mouseState === void 0 ? null : _ref$mouseState;
|
289
221
|
|
290
222
|
_classCallCheck(this, AnnotationLayerBuilder);
|
291
223
|
|
@@ -297,6 +229,9 @@ var AnnotationLayerBuilder = /*#__PURE__*/function () {
|
|
297
229
|
this.renderInteractiveForms = renderInteractiveForms;
|
298
230
|
this.l10n = l10n;
|
299
231
|
this.annotationStorage = annotationStorage;
|
232
|
+
this.enableScripting = enableScripting;
|
233
|
+
this._hasJSActionsPromise = hasJSActionsPromise;
|
234
|
+
this._mouseState = mouseState;
|
300
235
|
this.div = null;
|
301
236
|
this._cancelled = false;
|
302
237
|
}
|
@@ -307,9 +242,14 @@ var AnnotationLayerBuilder = /*#__PURE__*/function () {
|
|
307
242
|
var _this = this;
|
308
243
|
|
309
244
|
var intent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "display";
|
310
|
-
return this.pdfPage.getAnnotations({
|
245
|
+
return Promise.all([this.pdfPage.getAnnotations({
|
311
246
|
intent: intent
|
312
|
-
}).then(function (
|
247
|
+
}), this._hasJSActionsPromise]).then(function (_ref2) {
|
248
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
249
|
+
annotations = _ref3[0],
|
250
|
+
_ref3$ = _ref3[1],
|
251
|
+
hasJSActions = _ref3$ === void 0 ? false : _ref3$;
|
252
|
+
|
313
253
|
if (_this._cancelled) {
|
314
254
|
return;
|
315
255
|
}
|
@@ -329,7 +269,10 @@ var AnnotationLayerBuilder = /*#__PURE__*/function () {
|
|
329
269
|
renderInteractiveForms: _this.renderInteractiveForms,
|
330
270
|
linkService: _this.linkService,
|
331
271
|
downloadManager: _this.downloadManager,
|
332
|
-
annotationStorage: _this.annotationStorage
|
272
|
+
annotationStorage: _this.annotationStorage,
|
273
|
+
enableScripting: _this.enableScripting,
|
274
|
+
hasJSActions: hasJSActions,
|
275
|
+
mouseState: _this._mouseState
|
333
276
|
};
|
334
277
|
|
335
278
|
if (_this.div) {
|
@@ -381,6 +324,9 @@ var DefaultAnnotationLayerFactory = /*#__PURE__*/function () {
|
|
381
324
|
var imageResourcesPath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";
|
382
325
|
var renderInteractiveForms = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
383
326
|
var l10n = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : _ui_utils.NullL10n;
|
327
|
+
var enableScripting = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
328
|
+
var hasJSActionsPromise = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
|
329
|
+
var mouseState = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
|
384
330
|
return new AnnotationLayerBuilder({
|
385
331
|
pageDiv: pageDiv,
|
386
332
|
pdfPage: pdfPage,
|
@@ -388,7 +334,10 @@ var DefaultAnnotationLayerFactory = /*#__PURE__*/function () {
|
|
388
334
|
renderInteractiveForms: renderInteractiveForms,
|
389
335
|
linkService: new _pdf_link_service.SimpleLinkService(),
|
390
336
|
l10n: l10n,
|
391
|
-
annotationStorage: annotationStorage
|
337
|
+
annotationStorage: annotationStorage,
|
338
|
+
enableScripting: enableScripting,
|
339
|
+
hasJSActionsPromise: hasJSActionsPromise,
|
340
|
+
mouseState: mouseState
|
392
341
|
});
|
393
342
|
}
|
394
343
|
}]);
|
@@ -400,9 +349,8 @@ exports.DefaultAnnotationLayerFactory = DefaultAnnotationLayerFactory;
|
|
400
349
|
|
401
350
|
/***/ }),
|
402
351
|
/* 2 */
|
403
|
-
/***/ (
|
352
|
+
/***/ ((module) => {
|
404
353
|
|
405
|
-
"use strict";
|
406
354
|
|
407
355
|
|
408
356
|
var pdfjsLib;
|
@@ -417,36 +365,35 @@ module.exports = pdfjsLib;
|
|
417
365
|
|
418
366
|
/***/ }),
|
419
367
|
/* 3 */
|
420
|
-
/***/ (
|
368
|
+
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
|
421
369
|
|
422
|
-
"use strict";
|
423
370
|
|
424
371
|
|
425
|
-
Object.defineProperty(exports, "__esModule", {
|
372
|
+
Object.defineProperty(exports, "__esModule", ({
|
426
373
|
value: true
|
427
|
-
});
|
374
|
+
}));
|
375
|
+
exports.approximateFraction = approximateFraction;
|
376
|
+
exports.backtrackBeforeAllVisibleElements = backtrackBeforeAllVisibleElements;
|
377
|
+
exports.binarySearchFirstItem = binarySearchFirstItem;
|
378
|
+
exports.getActiveOrFocusedElement = getActiveOrFocusedElement;
|
379
|
+
exports.getOutputScale = getOutputScale;
|
380
|
+
exports.getPageSizeInches = getPageSizeInches;
|
381
|
+
exports.getPDFFileNameFromURL = getPDFFileNameFromURL;
|
382
|
+
exports.getVisibleElements = getVisibleElements;
|
383
|
+
exports.isPortraitOrientation = isPortraitOrientation;
|
428
384
|
exports.isValidRotation = isValidRotation;
|
429
385
|
exports.isValidScrollMode = isValidScrollMode;
|
430
386
|
exports.isValidSpreadMode = isValidSpreadMode;
|
431
|
-
exports.
|
432
|
-
exports.clamp = clamp;
|
433
|
-
exports.getPDFFileNameFromURL = getPDFFileNameFromURL;
|
387
|
+
exports.moveToEndOfArray = moveToEndOfArray;
|
434
388
|
exports.noContextMenuHandler = noContextMenuHandler;
|
389
|
+
exports.normalizeWheelEventDelta = normalizeWheelEventDelta;
|
390
|
+
exports.normalizeWheelEventDirection = normalizeWheelEventDirection;
|
435
391
|
exports.parseQueryString = parseQueryString;
|
436
|
-
exports.backtrackBeforeAllVisibleElements = backtrackBeforeAllVisibleElements;
|
437
|
-
exports.getVisibleElements = getVisibleElements;
|
438
392
|
exports.roundToDivide = roundToDivide;
|
439
|
-
exports.getPageSizeInches = getPageSizeInches;
|
440
|
-
exports.approximateFraction = approximateFraction;
|
441
|
-
exports.getOutputScale = getOutputScale;
|
442
393
|
exports.scrollIntoView = scrollIntoView;
|
443
|
-
exports.watchScroll = watchScroll;
|
444
|
-
exports.binarySearchFirstItem = binarySearchFirstItem;
|
445
|
-
exports.normalizeWheelEventDirection = normalizeWheelEventDirection;
|
446
|
-
exports.normalizeWheelEventDelta = normalizeWheelEventDelta;
|
447
394
|
exports.waitOnEventOrTimeout = waitOnEventOrTimeout;
|
448
|
-
exports.
|
449
|
-
exports.WaitOnType = exports.
|
395
|
+
exports.watchScroll = watchScroll;
|
396
|
+
exports.WaitOnType = exports.VERTICAL_PADDING = exports.UNKNOWN_SCALE = exports.TextLayerMode = exports.SpreadMode = exports.SidebarView = exports.ScrollMode = exports.SCROLLBAR_PADDING = exports.RendererType = exports.ProgressBar = exports.PresentationModeState = exports.NullL10n = exports.MIN_SCALE = exports.MAX_SCALE = exports.MAX_AUTO_SCALE = exports.EventBus = exports.DEFAULT_SCALE_VALUE = exports.DEFAULT_SCALE = exports.CSS_UNITS = exports.AutoPrintRegExp = exports.animationStarted = void 0;
|
450
397
|
|
451
398
|
var _regenerator = _interopRequireDefault(__w_pdfjs_require__(4));
|
452
399
|
|
@@ -494,6 +441,7 @@ var SCROLLBAR_PADDING = 40;
|
|
494
441
|
exports.SCROLLBAR_PADDING = SCROLLBAR_PADDING;
|
495
442
|
var VERTICAL_PADDING = 5;
|
496
443
|
exports.VERTICAL_PADDING = VERTICAL_PADDING;
|
444
|
+
var LOADINGBAR_END_OFFSET_VAR = "--loadingBar-end-offset";
|
497
445
|
var PresentationModeState = {
|
498
446
|
UNKNOWN: 0,
|
499
447
|
NORMAL: 1,
|
@@ -501,6 +449,15 @@ var PresentationModeState = {
|
|
501
449
|
FULLSCREEN: 3
|
502
450
|
};
|
503
451
|
exports.PresentationModeState = PresentationModeState;
|
452
|
+
var SidebarView = {
|
453
|
+
UNKNOWN: -1,
|
454
|
+
NONE: 0,
|
455
|
+
THUMBS: 1,
|
456
|
+
OUTLINE: 2,
|
457
|
+
ATTACHMENTS: 3,
|
458
|
+
LAYERS: 4
|
459
|
+
};
|
460
|
+
exports.SidebarView = SidebarView;
|
504
461
|
var RendererType = {
|
505
462
|
CANVAS: "canvas",
|
506
463
|
SVG: "svg"
|
@@ -606,7 +563,7 @@ exports.NullL10n = NullL10n;
|
|
606
563
|
|
607
564
|
function getOutputScale(ctx) {
|
608
565
|
var devicePixelRatio = window.devicePixelRatio || 1;
|
609
|
-
var backingStoreRatio = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.
|
566
|
+
var backingStoreRatio = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.backingStorePixelRatio || 1;
|
610
567
|
var pixelRatio = devicePixelRatio / backingStoreRatio;
|
611
568
|
return {
|
612
569
|
sx: pixelRatio,
|
@@ -835,9 +792,15 @@ function backtrackBeforeAllVisibleElements(index, views, top) {
|
|
835
792
|
return index;
|
836
793
|
}
|
837
794
|
|
838
|
-
function getVisibleElements(
|
839
|
-
var
|
840
|
-
|
795
|
+
function getVisibleElements(_ref2) {
|
796
|
+
var scrollEl = _ref2.scrollEl,
|
797
|
+
views = _ref2.views,
|
798
|
+
_ref2$sortByVisibilit = _ref2.sortByVisibility,
|
799
|
+
sortByVisibility = _ref2$sortByVisibilit === void 0 ? false : _ref2$sortByVisibilit,
|
800
|
+
_ref2$horizontal = _ref2.horizontal,
|
801
|
+
horizontal = _ref2$horizontal === void 0 ? false : _ref2$horizontal,
|
802
|
+
_ref2$rtl = _ref2.rtl,
|
803
|
+
rtl = _ref2$rtl === void 0 ? false : _ref2$rtl;
|
841
804
|
var top = scrollEl.scrollTop,
|
842
805
|
bottom = top + scrollEl.clientHeight;
|
843
806
|
var left = scrollEl.scrollLeft,
|
@@ -849,15 +812,16 @@ function getVisibleElements(scrollEl, views) {
|
|
849
812
|
return elementBottom > top;
|
850
813
|
}
|
851
814
|
|
852
|
-
function
|
815
|
+
function isElementNextAfterViewHorizontally(view) {
|
853
816
|
var element = view.div;
|
854
|
-
var
|
855
|
-
|
817
|
+
var elementLeft = element.offsetLeft + element.clientLeft;
|
818
|
+
var elementRight = elementLeft + element.clientWidth;
|
819
|
+
return rtl ? elementLeft < right : elementRight > left;
|
856
820
|
}
|
857
821
|
|
858
822
|
var visible = [],
|
859
823
|
numViews = views.length;
|
860
|
-
var firstVisibleElementInd =
|
824
|
+
var firstVisibleElementInd = binarySearchFirstItem(views, horizontal ? isElementNextAfterViewHorizontally : isElementBottomAfterViewTop);
|
861
825
|
|
862
826
|
if (firstVisibleElementInd > 0 && firstVisibleElementInd < numViews && !horizontal) {
|
863
827
|
firstVisibleElementInd = backtrackBeforeAllVisibleElements(firstVisibleElementInd, views, top);
|
@@ -889,13 +853,16 @@ function getVisibleElements(scrollEl, views) {
|
|
889
853
|
|
890
854
|
var hiddenHeight = Math.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom);
|
891
855
|
var hiddenWidth = Math.max(0, left - currentWidth) + Math.max(0, viewRight - right);
|
892
|
-
var
|
856
|
+
var fractionHeight = (viewHeight - hiddenHeight) / viewHeight,
|
857
|
+
fractionWidth = (viewWidth - hiddenWidth) / viewWidth;
|
858
|
+
var percent = fractionHeight * fractionWidth * 100 | 0;
|
893
859
|
visible.push({
|
894
860
|
id: view.id,
|
895
861
|
x: currentWidth,
|
896
862
|
y: currentHeight,
|
897
863
|
view: view,
|
898
|
-
percent: percent
|
864
|
+
percent: percent,
|
865
|
+
widthPercent: fractionWidth * 100 | 0
|
899
866
|
});
|
900
867
|
}
|
901
868
|
|
@@ -948,8 +915,8 @@ function getPDFFileNameFromURL(url) {
|
|
948
915
|
return defaultFilename;
|
949
916
|
}
|
950
917
|
|
951
|
-
var reURI = /^(?:(?:[^:]+:)?\/\/[
|
952
|
-
var reFilename = /[
|
918
|
+
var reURI = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/;
|
919
|
+
var reFilename = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i;
|
953
920
|
var splitURI = reURI.exec(url);
|
954
921
|
var suggestedFilename = reFilename.exec(splitURI[1]) || reFilename.exec(splitURI[2]) || reFilename.exec(splitURI[3]);
|
955
922
|
|
@@ -1015,11 +982,11 @@ var WaitOnType = {
|
|
1015
982
|
};
|
1016
983
|
exports.WaitOnType = WaitOnType;
|
1017
984
|
|
1018
|
-
function waitOnEventOrTimeout(
|
1019
|
-
var target =
|
1020
|
-
name =
|
1021
|
-
|
1022
|
-
delay =
|
985
|
+
function waitOnEventOrTimeout(_ref3) {
|
986
|
+
var target = _ref3.target,
|
987
|
+
name = _ref3.name,
|
988
|
+
_ref3$delay = _ref3.delay,
|
989
|
+
delay = _ref3$delay === void 0 ? 0 : _ref3$delay;
|
1023
990
|
return new Promise(function (resolve, reject) {
|
1024
991
|
if (_typeof(target) !== "object" || !(name && typeof name === "string") || !(Number.isInteger(delay) && delay >= 0)) {
|
1025
992
|
throw new Error("waitOnEventOrTimeout - invalid parameters.");
|
@@ -1072,20 +1039,28 @@ var EventBus = /*#__PURE__*/function () {
|
|
1072
1039
|
_createClass(EventBus, [{
|
1073
1040
|
key: "on",
|
1074
1041
|
value: function on(eventName, listener) {
|
1042
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
1043
|
+
|
1075
1044
|
this._on(eventName, listener, {
|
1076
|
-
external: true
|
1045
|
+
external: true,
|
1046
|
+
once: options === null || options === void 0 ? void 0 : options.once
|
1077
1047
|
});
|
1078
1048
|
}
|
1079
1049
|
}, {
|
1080
1050
|
key: "off",
|
1081
1051
|
value: function off(eventName, listener) {
|
1052
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
1053
|
+
|
1082
1054
|
this._off(eventName, listener, {
|
1083
|
-
external: true
|
1055
|
+
external: true,
|
1056
|
+
once: options === null || options === void 0 ? void 0 : options.once
|
1084
1057
|
});
|
1085
1058
|
}
|
1086
1059
|
}, {
|
1087
1060
|
key: "dispatch",
|
1088
1061
|
value: function dispatch(eventName) {
|
1062
|
+
var _this = this;
|
1063
|
+
|
1089
1064
|
var eventListeners = this._listeners[eventName];
|
1090
1065
|
|
1091
1066
|
if (!eventListeners || eventListeners.length === 0) {
|
@@ -1094,16 +1069,17 @@ var EventBus = /*#__PURE__*/function () {
|
|
1094
1069
|
|
1095
1070
|
var args = Array.prototype.slice.call(arguments, 1);
|
1096
1071
|
var externalListeners;
|
1097
|
-
eventListeners.slice(0).forEach(function (
|
1098
|
-
var listener =
|
1099
|
-
external =
|
1072
|
+
eventListeners.slice(0).forEach(function (_ref4) {
|
1073
|
+
var listener = _ref4.listener,
|
1074
|
+
external = _ref4.external,
|
1075
|
+
once = _ref4.once;
|
1100
1076
|
|
1101
|
-
if (
|
1102
|
-
|
1103
|
-
|
1104
|
-
}
|
1077
|
+
if (once) {
|
1078
|
+
_this._off(eventName, listener);
|
1079
|
+
}
|
1105
1080
|
|
1106
|
-
|
1081
|
+
if (external) {
|
1082
|
+
(externalListeners || (externalListeners = [])).push(listener);
|
1107
1083
|
return;
|
1108
1084
|
}
|
1109
1085
|
|
@@ -1120,16 +1096,14 @@ var EventBus = /*#__PURE__*/function () {
|
|
1120
1096
|
}, {
|
1121
1097
|
key: "_on",
|
1122
1098
|
value: function _on(eventName, listener) {
|
1123
|
-
var
|
1124
|
-
var eventListeners = this._listeners[eventName];
|
1125
|
-
|
1126
|
-
if (!eventListeners) {
|
1127
|
-
this._listeners[eventName] = eventListeners = [];
|
1128
|
-
}
|
1099
|
+
var _this$_listeners;
|
1129
1100
|
|
1101
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
1102
|
+
var eventListeners = (_this$_listeners = this._listeners)[eventName] || (_this$_listeners[eventName] = []);
|
1130
1103
|
eventListeners.push({
|
1131
1104
|
listener: listener,
|
1132
|
-
external: (options
|
1105
|
+
external: (options === null || options === void 0 ? void 0 : options.external) === true,
|
1106
|
+
once: (options === null || options === void 0 ? void 0 : options.once) === true
|
1133
1107
|
});
|
1134
1108
|
}
|
1135
1109
|
}, {
|
@@ -1162,10 +1136,10 @@ function clamp(v, min, max) {
|
|
1162
1136
|
|
1163
1137
|
var ProgressBar = /*#__PURE__*/function () {
|
1164
1138
|
function ProgressBar(id) {
|
1165
|
-
var
|
1166
|
-
height =
|
1167
|
-
width =
|
1168
|
-
units =
|
1139
|
+
var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
1140
|
+
height = _ref5.height,
|
1141
|
+
width = _ref5.width,
|
1142
|
+
units = _ref5.units;
|
1169
1143
|
|
1170
1144
|
_classCallCheck(this, ProgressBar);
|
1171
1145
|
|
@@ -1203,7 +1177,8 @@ var ProgressBar = /*#__PURE__*/function () {
|
|
1203
1177
|
var scrollbarWidth = container.offsetWidth - viewer.offsetWidth;
|
1204
1178
|
|
1205
1179
|
if (scrollbarWidth > 0) {
|
1206
|
-
|
1180
|
+
var doc = document.documentElement;
|
1181
|
+
doc.style.setProperty(LOADINGBAR_END_OFFSET_VAR, "".concat(scrollbarWidth, "px"));
|
1207
1182
|
}
|
1208
1183
|
}
|
1209
1184
|
}, {
|
@@ -1215,7 +1190,6 @@ var ProgressBar = /*#__PURE__*/function () {
|
|
1215
1190
|
|
1216
1191
|
this.visible = false;
|
1217
1192
|
this.bar.classList.add("hidden");
|
1218
|
-
document.body.classList.remove("loadingInProgress");
|
1219
1193
|
}
|
1220
1194
|
}, {
|
1221
1195
|
key: "show",
|
@@ -1225,7 +1199,6 @@ var ProgressBar = /*#__PURE__*/function () {
|
|
1225
1199
|
}
|
1226
1200
|
|
1227
1201
|
this.visible = true;
|
1228
|
-
document.body.classList.add("loadingInProgress");
|
1229
1202
|
this.bar.classList.remove("hidden");
|
1230
1203
|
}
|
1231
1204
|
}, {
|
@@ -1265,21 +1238,32 @@ function moveToEndOfArray(arr, condition) {
|
|
1265
1238
|
}
|
1266
1239
|
}
|
1267
1240
|
|
1241
|
+
function getActiveOrFocusedElement() {
|
1242
|
+
var curRoot = document;
|
1243
|
+
var curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");
|
1244
|
+
|
1245
|
+
while (curActiveOrFocused && curActiveOrFocused.shadowRoot) {
|
1246
|
+
curRoot = curActiveOrFocused.shadowRoot;
|
1247
|
+
curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");
|
1248
|
+
}
|
1249
|
+
|
1250
|
+
return curActiveOrFocused;
|
1251
|
+
}
|
1252
|
+
|
1268
1253
|
/***/ }),
|
1269
1254
|
/* 4 */
|
1270
|
-
/***/ (
|
1255
|
+
/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {
|
1271
1256
|
|
1272
|
-
"use strict";
|
1273
1257
|
|
1274
1258
|
|
1275
1259
|
module.exports = __w_pdfjs_require__(5);
|
1276
1260
|
|
1277
1261
|
/***/ }),
|
1278
1262
|
/* 5 */
|
1279
|
-
/***/ (
|
1263
|
+
/***/ ((module, __unused_webpack_exports, __w_pdfjs_require__) => {
|
1264
|
+
|
1265
|
+
/* module decorator */ module = __w_pdfjs_require__.nmd(module);
|
1280
1266
|
|
1281
|
-
"use strict";
|
1282
|
-
/* WEBPACK VAR INJECTION */(function(module) {
|
1283
1267
|
|
1284
1268
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
1285
1269
|
|
@@ -1862,62 +1846,37 @@ var runtime = function (exports) {
|
|
1862
1846
|
}
|
1863
1847
|
};
|
1864
1848
|
return exports;
|
1865
|
-
}(( false ?
|
1849
|
+
}(( false ? 0 : _typeof(module)) === "object" ? module.exports : {});
|
1866
1850
|
|
1867
1851
|
try {
|
1868
1852
|
regeneratorRuntime = runtime;
|
1869
1853
|
} catch (accidentalStrictMode) {
|
1870
1854
|
Function("r", "regeneratorRuntime = r")(runtime);
|
1871
1855
|
}
|
1872
|
-
/* WEBPACK VAR INJECTION */}.call(this, __w_pdfjs_require__(6)(module)))
|
1873
1856
|
|
1874
1857
|
/***/ }),
|
1875
1858
|
/* 6 */
|
1876
|
-
/***/ (
|
1877
|
-
|
1878
|
-
"use strict";
|
1879
|
-
|
1880
|
-
|
1881
|
-
module.exports = function (module) {
|
1882
|
-
if (!module.webpackPolyfill) {
|
1883
|
-
module.deprecate = function () {};
|
1884
|
-
|
1885
|
-
module.paths = [];
|
1886
|
-
if (!module.children) module.children = [];
|
1887
|
-
Object.defineProperty(module, "loaded", {
|
1888
|
-
enumerable: true,
|
1889
|
-
get: function get() {
|
1890
|
-
return module.l;
|
1891
|
-
}
|
1892
|
-
});
|
1893
|
-
Object.defineProperty(module, "id", {
|
1894
|
-
enumerable: true,
|
1895
|
-
get: function get() {
|
1896
|
-
return module.i;
|
1897
|
-
}
|
1898
|
-
});
|
1899
|
-
module.webpackPolyfill = 1;
|
1900
|
-
}
|
1901
|
-
|
1902
|
-
return module;
|
1903
|
-
};
|
1859
|
+
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
|
1904
1860
|
|
1905
|
-
/***/ }),
|
1906
|
-
/* 7 */
|
1907
|
-
/***/ (function(module, exports, __w_pdfjs_require__) {
|
1908
1861
|
|
1909
|
-
"use strict";
|
1910
1862
|
|
1911
|
-
|
1912
|
-
Object.defineProperty(exports, "__esModule", {
|
1863
|
+
Object.defineProperty(exports, "__esModule", ({
|
1913
1864
|
value: true
|
1914
|
-
});
|
1865
|
+
}));
|
1915
1866
|
exports.SimpleLinkService = exports.PDFLinkService = void 0;
|
1916
1867
|
|
1868
|
+
var _regenerator = _interopRequireDefault(__w_pdfjs_require__(4));
|
1869
|
+
|
1917
1870
|
var _ui_utils = __w_pdfjs_require__(3);
|
1918
1871
|
|
1872
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
1873
|
+
|
1919
1874
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
1920
1875
|
|
1876
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
1877
|
+
|
1878
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
1879
|
+
|
1921
1880
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1922
1881
|
|
1923
1882
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
@@ -1972,95 +1931,160 @@ var PDFLinkService = /*#__PURE__*/function () {
|
|
1972
1931
|
}, {
|
1973
1932
|
key: "navigateTo",
|
1974
1933
|
value: function navigateTo(dest) {
|
1934
|
+
console.error("Deprecated method: `navigateTo`, use `goToDestination` instead.");
|
1935
|
+
this.goToDestination(dest);
|
1936
|
+
}
|
1937
|
+
}, {
|
1938
|
+
key: "_goToDestinationHelper",
|
1939
|
+
value: function _goToDestinationHelper(rawDest) {
|
1975
1940
|
var _this = this;
|
1976
1941
|
|
1977
|
-
var
|
1978
|
-
|
1979
|
-
|
1980
|
-
|
1981
|
-
var pageNumber;
|
1982
|
-
|
1983
|
-
if (destRef instanceof Object) {
|
1984
|
-
pageNumber = _this._cachedPageNumber(destRef);
|
1985
|
-
|
1986
|
-
if (pageNumber === null) {
|
1987
|
-
_this.pdfDocument.getPageIndex(destRef).then(function (pageIndex) {
|
1988
|
-
_this.cachePageRef(pageIndex + 1, destRef);
|
1989
|
-
|
1990
|
-
goToDestination({
|
1991
|
-
namedDest: namedDest,
|
1992
|
-
explicitDest: explicitDest
|
1993
|
-
});
|
1994
|
-
})["catch"](function () {
|
1995
|
-
console.error("PDFLinkService.navigateTo: \"".concat(destRef, "\" is not ") + "a valid page reference, for dest=\"".concat(dest, "\"."));
|
1996
|
-
});
|
1997
|
-
|
1998
|
-
return;
|
1999
|
-
}
|
2000
|
-
} else if (Number.isInteger(destRef)) {
|
2001
|
-
pageNumber = destRef + 1;
|
2002
|
-
} else {
|
2003
|
-
console.error("PDFLinkService.navigateTo: \"".concat(destRef, "\" is not ") + "a valid destination reference, for dest=\"".concat(dest, "\"."));
|
2004
|
-
return;
|
2005
|
-
}
|
1942
|
+
var namedDest = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
1943
|
+
var explicitDest = arguments.length > 2 ? arguments[2] : undefined;
|
1944
|
+
var destRef = explicitDest[0];
|
1945
|
+
var pageNumber;
|
2006
1946
|
|
2007
|
-
|
2008
|
-
|
2009
|
-
return;
|
2010
|
-
}
|
1947
|
+
if (destRef instanceof Object) {
|
1948
|
+
pageNumber = this._cachedPageNumber(destRef);
|
2011
1949
|
|
2012
|
-
if (
|
2013
|
-
|
1950
|
+
if (pageNumber === null) {
|
1951
|
+
this.pdfDocument.getPageIndex(destRef).then(function (pageIndex) {
|
1952
|
+
_this.cachePageRef(pageIndex + 1, destRef);
|
2014
1953
|
|
2015
|
-
|
2016
|
-
|
2017
|
-
|
2018
|
-
pageNumber: pageNumber
|
1954
|
+
_this._goToDestinationHelper(rawDest, namedDest, explicitDest);
|
1955
|
+
})["catch"](function () {
|
1956
|
+
console.error("PDFLinkService._goToDestinationHelper: \"".concat(destRef, "\" is not ") + "a valid page reference, for dest=\"".concat(rawDest, "\"."));
|
2019
1957
|
});
|
1958
|
+
return;
|
2020
1959
|
}
|
1960
|
+
} else if (Number.isInteger(destRef)) {
|
1961
|
+
pageNumber = destRef + 1;
|
1962
|
+
} else {
|
1963
|
+
console.error("PDFLinkService._goToDestinationHelper: \"".concat(destRef, "\" is not ") + "a valid destination reference, for dest=\"".concat(rawDest, "\"."));
|
1964
|
+
return;
|
1965
|
+
}
|
1966
|
+
|
1967
|
+
if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) {
|
1968
|
+
console.error("PDFLinkService._goToDestinationHelper: \"".concat(pageNumber, "\" is not ") + "a valid page number, for dest=\"".concat(rawDest, "\"."));
|
1969
|
+
return;
|
1970
|
+
}
|
2021
1971
|
|
2022
|
-
|
2023
|
-
|
2024
|
-
|
2025
|
-
|
1972
|
+
if (this.pdfHistory) {
|
1973
|
+
this.pdfHistory.pushCurrentPosition();
|
1974
|
+
this.pdfHistory.push({
|
1975
|
+
namedDest: namedDest,
|
1976
|
+
explicitDest: explicitDest,
|
1977
|
+
pageNumber: pageNumber
|
2026
1978
|
});
|
2027
|
-
}
|
1979
|
+
}
|
2028
1980
|
|
2029
|
-
|
2030
|
-
|
2031
|
-
|
2032
|
-
|
2033
|
-
|
2034
|
-
|
2035
|
-
|
2036
|
-
|
1981
|
+
this.pdfViewer.scrollPageIntoView({
|
1982
|
+
pageNumber: pageNumber,
|
1983
|
+
destArray: explicitDest,
|
1984
|
+
ignoreDestinationZoom: this._ignoreDestinationZoom
|
1985
|
+
});
|
1986
|
+
}
|
1987
|
+
}, {
|
1988
|
+
key: "goToDestination",
|
1989
|
+
value: function () {
|
1990
|
+
var _goToDestination = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(dest) {
|
1991
|
+
var namedDest, explicitDest;
|
1992
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
1993
|
+
while (1) {
|
1994
|
+
switch (_context.prev = _context.next) {
|
1995
|
+
case 0:
|
1996
|
+
if (this.pdfDocument) {
|
1997
|
+
_context.next = 2;
|
1998
|
+
break;
|
1999
|
+
}
|
2037
2000
|
|
2038
|
-
|
2039
|
-
}
|
2001
|
+
return _context.abrupt("return");
|
2040
2002
|
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
2049
|
-
|
2003
|
+
case 2:
|
2004
|
+
if (!(typeof dest === "string")) {
|
2005
|
+
_context.next = 9;
|
2006
|
+
break;
|
2007
|
+
}
|
2008
|
+
|
2009
|
+
namedDest = dest;
|
2010
|
+
_context.next = 6;
|
2011
|
+
return this.pdfDocument.getDestination(dest);
|
2012
|
+
|
2013
|
+
case 6:
|
2014
|
+
explicitDest = _context.sent;
|
2015
|
+
_context.next = 13;
|
2016
|
+
break;
|
2017
|
+
|
2018
|
+
case 9:
|
2019
|
+
namedDest = null;
|
2020
|
+
_context.next = 12;
|
2021
|
+
return dest;
|
2022
|
+
|
2023
|
+
case 12:
|
2024
|
+
explicitDest = _context.sent;
|
2025
|
+
|
2026
|
+
case 13:
|
2027
|
+
if (Array.isArray(explicitDest)) {
|
2028
|
+
_context.next = 16;
|
2029
|
+
break;
|
2030
|
+
}
|
2031
|
+
|
2032
|
+
console.error("PDFLinkService.goToDestination: \"".concat(explicitDest, "\" is not ") + "a valid destination array, for dest=\"".concat(dest, "\"."));
|
2033
|
+
return _context.abrupt("return");
|
2034
|
+
|
2035
|
+
case 16:
|
2036
|
+
this._goToDestinationHelper(dest, namedDest, explicitDest);
|
2037
|
+
|
2038
|
+
case 17:
|
2039
|
+
case "end":
|
2040
|
+
return _context.stop();
|
2041
|
+
}
|
2042
|
+
}
|
2043
|
+
}, _callee, this);
|
2044
|
+
}));
|
2045
|
+
|
2046
|
+
function goToDestination(_x) {
|
2047
|
+
return _goToDestination.apply(this, arguments);
|
2048
|
+
}
|
2049
|
+
|
2050
|
+
return goToDestination;
|
2051
|
+
}()
|
2052
|
+
}, {
|
2053
|
+
key: "goToPage",
|
2054
|
+
value: function goToPage(val) {
|
2055
|
+
if (!this.pdfDocument) {
|
2056
|
+
return;
|
2057
|
+
}
|
2058
|
+
|
2059
|
+
var pageNumber = typeof val === "string" && this.pdfViewer.pageLabelToPageNumber(val) || val | 0;
|
2060
|
+
|
2061
|
+
if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {
|
2062
|
+
console.error("PDFLinkService.goToPage: \"".concat(val, "\" is not a valid page."));
|
2063
|
+
return;
|
2064
|
+
}
|
2050
2065
|
|
2051
|
-
|
2066
|
+
if (this.pdfHistory) {
|
2067
|
+
this.pdfHistory.pushCurrentPosition();
|
2068
|
+
this.pdfHistory.pushPage(pageNumber);
|
2069
|
+
}
|
2070
|
+
|
2071
|
+
this.pdfViewer.scrollPageIntoView({
|
2072
|
+
pageNumber: pageNumber
|
2052
2073
|
});
|
2053
2074
|
}
|
2054
2075
|
}, {
|
2055
2076
|
key: "getDestinationHash",
|
2056
2077
|
value: function getDestinationHash(dest) {
|
2057
2078
|
if (typeof dest === "string") {
|
2058
|
-
|
2059
|
-
|
2060
|
-
|
2061
|
-
if (Array.isArray(dest)) {
|
2079
|
+
if (dest.length > 0) {
|
2080
|
+
return this.getAnchorUrl("#" + escape(dest));
|
2081
|
+
}
|
2082
|
+
} else if (Array.isArray(dest)) {
|
2062
2083
|
var str = JSON.stringify(dest);
|
2063
|
-
|
2084
|
+
|
2085
|
+
if (str.length > 0) {
|
2086
|
+
return this.getAnchorUrl("#" + escape(str));
|
2087
|
+
}
|
2064
2088
|
}
|
2065
2089
|
|
2066
2090
|
return this.getAnchorUrl("");
|
@@ -2073,6 +2097,10 @@ var PDFLinkService = /*#__PURE__*/function () {
|
|
2073
2097
|
}, {
|
2074
2098
|
key: "setHash",
|
2075
2099
|
value: function setHash(hash) {
|
2100
|
+
if (!this.pdfDocument) {
|
2101
|
+
return;
|
2102
|
+
}
|
2103
|
+
|
2076
2104
|
var pageNumber, dest;
|
2077
2105
|
|
2078
2106
|
if (hash.includes("=")) {
|
@@ -2140,7 +2168,7 @@ var PDFLinkService = /*#__PURE__*/function () {
|
|
2140
2168
|
}
|
2141
2169
|
|
2142
2170
|
if ("nameddest" in params) {
|
2143
|
-
this.
|
2171
|
+
this.goToDestination(params.nameddest);
|
2144
2172
|
}
|
2145
2173
|
} else {
|
2146
2174
|
dest = unescape(hash);
|
@@ -2154,7 +2182,7 @@ var PDFLinkService = /*#__PURE__*/function () {
|
|
2154
2182
|
} catch (ex) {}
|
2155
2183
|
|
2156
2184
|
if (typeof dest === "string" || isValidExplicitDestination(dest)) {
|
2157
|
-
this.
|
2185
|
+
this.goToDestination(dest);
|
2158
2186
|
return;
|
2159
2187
|
}
|
2160
2188
|
|
@@ -2180,17 +2208,11 @@ var PDFLinkService = /*#__PURE__*/function () {
|
|
2180
2208
|
break;
|
2181
2209
|
|
2182
2210
|
case "NextPage":
|
2183
|
-
|
2184
|
-
this.page++;
|
2185
|
-
}
|
2186
|
-
|
2211
|
+
this.pdfViewer.nextPage();
|
2187
2212
|
break;
|
2188
2213
|
|
2189
2214
|
case "PrevPage":
|
2190
|
-
|
2191
|
-
this.page--;
|
2192
|
-
}
|
2193
|
-
|
2215
|
+
this.pdfViewer.previousPage();
|
2194
2216
|
break;
|
2195
2217
|
|
2196
2218
|
case "LastPage":
|
@@ -2231,6 +2253,11 @@ var PDFLinkService = /*#__PURE__*/function () {
|
|
2231
2253
|
value: function isPageVisible(pageNumber) {
|
2232
2254
|
return this.pdfViewer.isPageVisible(pageNumber);
|
2233
2255
|
}
|
2256
|
+
}, {
|
2257
|
+
key: "isPageCached",
|
2258
|
+
value: function isPageCached(pageNumber) {
|
2259
|
+
return this.pdfViewer.isPageCached(pageNumber);
|
2260
|
+
}
|
2234
2261
|
}, {
|
2235
2262
|
key: "pagesCount",
|
2236
2263
|
get: function get() {
|
@@ -2340,8 +2367,29 @@ var SimpleLinkService = /*#__PURE__*/function () {
|
|
2340
2367
|
}
|
2341
2368
|
|
2342
2369
|
_createClass(SimpleLinkService, [{
|
2343
|
-
key: "
|
2344
|
-
value: function
|
2370
|
+
key: "goToDestination",
|
2371
|
+
value: function () {
|
2372
|
+
var _goToDestination2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2(dest) {
|
2373
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
2374
|
+
while (1) {
|
2375
|
+
switch (_context2.prev = _context2.next) {
|
2376
|
+
case 0:
|
2377
|
+
case "end":
|
2378
|
+
return _context2.stop();
|
2379
|
+
}
|
2380
|
+
}
|
2381
|
+
}, _callee2);
|
2382
|
+
}));
|
2383
|
+
|
2384
|
+
function goToDestination(_x2) {
|
2385
|
+
return _goToDestination2.apply(this, arguments);
|
2386
|
+
}
|
2387
|
+
|
2388
|
+
return goToDestination;
|
2389
|
+
}()
|
2390
|
+
}, {
|
2391
|
+
key: "goToPage",
|
2392
|
+
value: function goToPage(val) {}
|
2345
2393
|
}, {
|
2346
2394
|
key: "getDestinationHash",
|
2347
2395
|
value: function getDestinationHash(dest) {
|
@@ -2366,6 +2414,11 @@ var SimpleLinkService = /*#__PURE__*/function () {
|
|
2366
2414
|
value: function isPageVisible(pageNumber) {
|
2367
2415
|
return true;
|
2368
2416
|
}
|
2417
|
+
}, {
|
2418
|
+
key: "isPageCached",
|
2419
|
+
value: function isPageCached(pageNumber) {
|
2420
|
+
return true;
|
2421
|
+
}
|
2369
2422
|
}, {
|
2370
2423
|
key: "pagesCount",
|
2371
2424
|
get: function get() {
|
@@ -2391,16 +2444,15 @@ var SimpleLinkService = /*#__PURE__*/function () {
|
|
2391
2444
|
exports.SimpleLinkService = SimpleLinkService;
|
2392
2445
|
|
2393
2446
|
/***/ }),
|
2394
|
-
/*
|
2395
|
-
/***/ (
|
2447
|
+
/* 7 */
|
2448
|
+
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
|
2396
2449
|
|
2397
|
-
"use strict";
|
2398
2450
|
|
2399
2451
|
|
2400
|
-
Object.defineProperty(exports, "__esModule", {
|
2452
|
+
Object.defineProperty(exports, "__esModule", ({
|
2401
2453
|
value: true
|
2402
|
-
});
|
2403
|
-
exports.
|
2454
|
+
}));
|
2455
|
+
exports.TextLayerBuilder = exports.DefaultTextLayerFactory = void 0;
|
2404
2456
|
|
2405
2457
|
var _pdfjsLib = __w_pdfjs_require__(2);
|
2406
2458
|
|
@@ -2536,12 +2588,10 @@ var TextLayerBuilder = /*#__PURE__*/function () {
|
|
2536
2588
|
return [];
|
2537
2589
|
}
|
2538
2590
|
|
2539
|
-
var
|
2540
|
-
textContentItemsStr = this.textContentItemsStr;
|
2591
|
+
var textContentItemsStr = this.textContentItemsStr;
|
2541
2592
|
var i = 0,
|
2542
2593
|
iIndex = 0;
|
2543
2594
|
var end = textContentItemsStr.length - 1;
|
2544
|
-
var queryLen = findController.state.query.length;
|
2545
2595
|
var result = [];
|
2546
2596
|
|
2547
2597
|
for (var m = 0, mm = matches.length; m < mm; m++) {
|
@@ -2562,12 +2612,7 @@ var TextLayerBuilder = /*#__PURE__*/function () {
|
|
2562
2612
|
offset: matchIdx - iIndex
|
2563
2613
|
}
|
2564
2614
|
};
|
2565
|
-
|
2566
|
-
if (matchesLength) {
|
2567
|
-
matchIdx += matchesLength[m];
|
2568
|
-
} else {
|
2569
|
-
matchIdx += queryLen;
|
2570
|
-
}
|
2615
|
+
matchIdx += matchesLength[m];
|
2571
2616
|
|
2572
2617
|
while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) {
|
2573
2618
|
iIndex += textContentItemsStr[i].length;
|
@@ -2807,20 +2852,19 @@ var DefaultTextLayerFactory = /*#__PURE__*/function () {
|
|
2807
2852
|
exports.DefaultTextLayerFactory = DefaultTextLayerFactory;
|
2808
2853
|
|
2809
2854
|
/***/ }),
|
2810
|
-
/*
|
2811
|
-
/***/ (
|
2855
|
+
/* 8 */
|
2856
|
+
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
|
2812
2857
|
|
2813
|
-
"use strict";
|
2814
2858
|
|
2815
2859
|
|
2816
|
-
Object.defineProperty(exports, "__esModule", {
|
2860
|
+
Object.defineProperty(exports, "__esModule", ({
|
2817
2861
|
value: true
|
2818
|
-
});
|
2862
|
+
}));
|
2819
2863
|
exports.DownloadManager = void 0;
|
2820
2864
|
|
2821
2865
|
var _pdfjsLib = __w_pdfjs_require__(2);
|
2822
2866
|
|
2823
|
-
var _viewer_compatibility = __w_pdfjs_require__(
|
2867
|
+
var _viewer_compatibility = __w_pdfjs_require__(9);
|
2824
2868
|
|
2825
2869
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
2826
2870
|
|
@@ -2866,13 +2910,6 @@ var DownloadManager = /*#__PURE__*/function () {
|
|
2866
2910
|
}, {
|
2867
2911
|
key: "downloadData",
|
2868
2912
|
value: function downloadData(data, filename, contentType) {
|
2869
|
-
if (navigator.msSaveBlob) {
|
2870
|
-
navigator.msSaveBlob(new Blob([data], {
|
2871
|
-
type: contentType
|
2872
|
-
}), filename);
|
2873
|
-
return;
|
2874
|
-
}
|
2875
|
-
|
2876
2913
|
var blobUrl = (0, _pdfjsLib.createObjectURL)(data, contentType, _viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL);
|
2877
2914
|
|
2878
2915
|
_download(blobUrl, filename);
|
@@ -2882,14 +2919,6 @@ var DownloadManager = /*#__PURE__*/function () {
|
|
2882
2919
|
value: function download(blob, url, filename) {
|
2883
2920
|
var sourceEventType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "download";
|
2884
2921
|
|
2885
|
-
if (navigator.msSaveBlob) {
|
2886
|
-
if (!navigator.msSaveBlob(blob, filename)) {
|
2887
|
-
this.downloadUrl(url, filename);
|
2888
|
-
}
|
2889
|
-
|
2890
|
-
return;
|
2891
|
-
}
|
2892
|
-
|
2893
2922
|
if (_viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL) {
|
2894
2923
|
this.downloadUrl(url, filename);
|
2895
2924
|
return;
|
@@ -2907,15 +2936,14 @@ var DownloadManager = /*#__PURE__*/function () {
|
|
2907
2936
|
exports.DownloadManager = DownloadManager;
|
2908
2937
|
|
2909
2938
|
/***/ }),
|
2910
|
-
/*
|
2911
|
-
/***/ (
|
2939
|
+
/* 9 */
|
2940
|
+
/***/ ((__unused_webpack_module, exports) => {
|
2912
2941
|
|
2913
|
-
"use strict";
|
2914
2942
|
|
2915
2943
|
|
2916
|
-
Object.defineProperty(exports, "__esModule", {
|
2944
|
+
Object.defineProperty(exports, "__esModule", ({
|
2917
2945
|
value: true
|
2918
|
-
});
|
2946
|
+
}));
|
2919
2947
|
exports.viewerCompatibilityParams = void 0;
|
2920
2948
|
var compatibilityParams = Object.create(null);
|
2921
2949
|
{
|
@@ -2923,12 +2951,11 @@ var compatibilityParams = Object.create(null);
|
|
2923
2951
|
var platform = typeof navigator !== "undefined" && navigator.platform || "";
|
2924
2952
|
var maxTouchPoints = typeof navigator !== "undefined" && navigator.maxTouchPoints || 1;
|
2925
2953
|
var isAndroid = /Android/.test(userAgent);
|
2926
|
-
var isIE = /Trident/.test(userAgent);
|
2927
2954
|
var isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1;
|
2928
2955
|
var isIOSChrome = /CriOS/.test(userAgent);
|
2929
2956
|
|
2930
2957
|
(function checkOnBlobSupport() {
|
2931
|
-
if (
|
2958
|
+
if (isIOSChrome) {
|
2932
2959
|
compatibilityParams.disableCreateObjectURL = true;
|
2933
2960
|
}
|
2934
2961
|
})();
|
@@ -2943,20 +2970,19 @@ var viewerCompatibilityParams = Object.freeze(compatibilityParams);
|
|
2943
2970
|
exports.viewerCompatibilityParams = viewerCompatibilityParams;
|
2944
2971
|
|
2945
2972
|
/***/ }),
|
2946
|
-
/*
|
2947
|
-
/***/ (
|
2973
|
+
/* 10 */
|
2974
|
+
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
|
2948
2975
|
|
2949
|
-
"use strict";
|
2950
2976
|
|
2951
2977
|
|
2952
|
-
Object.defineProperty(exports, "__esModule", {
|
2978
|
+
Object.defineProperty(exports, "__esModule", ({
|
2953
2979
|
value: true
|
2954
|
-
});
|
2980
|
+
}));
|
2955
2981
|
exports.GenericL10n = void 0;
|
2956
2982
|
|
2957
2983
|
var _regenerator = _interopRequireDefault(__w_pdfjs_require__(4));
|
2958
2984
|
|
2959
|
-
__w_pdfjs_require__(
|
2985
|
+
__w_pdfjs_require__(11);
|
2960
2986
|
|
2961
2987
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
2962
2988
|
|
@@ -3112,10 +3138,9 @@ var GenericL10n = /*#__PURE__*/function () {
|
|
3112
3138
|
exports.GenericL10n = GenericL10n;
|
3113
3139
|
|
3114
3140
|
/***/ }),
|
3115
|
-
/*
|
3116
|
-
/***/ (
|
3141
|
+
/* 11 */
|
3142
|
+
/***/ (() => {
|
3117
3143
|
|
3118
|
-
"use strict";
|
3119
3144
|
|
3120
3145
|
|
3121
3146
|
document.webL10n = function (window, document, undefined) {
|
@@ -3935,20 +3960,19 @@ document.webL10n = function (window, document, undefined) {
|
|
3935
3960
|
}(window, document);
|
3936
3961
|
|
3937
3962
|
/***/ }),
|
3938
|
-
/*
|
3939
|
-
/***/ (
|
3963
|
+
/* 12 */
|
3964
|
+
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
|
3940
3965
|
|
3941
|
-
"use strict";
|
3942
3966
|
|
3943
3967
|
|
3944
|
-
Object.defineProperty(exports, "__esModule", {
|
3968
|
+
Object.defineProperty(exports, "__esModule", ({
|
3945
3969
|
value: true
|
3946
|
-
});
|
3970
|
+
}));
|
3947
3971
|
exports.PDFFindController = exports.FindState = void 0;
|
3948
3972
|
|
3949
3973
|
var _pdfjsLib = __w_pdfjs_require__(2);
|
3950
3974
|
|
3951
|
-
var _pdf_find_utils = __w_pdfjs_require__(
|
3975
|
+
var _pdf_find_utils = __w_pdfjs_require__(13);
|
3952
3976
|
|
3953
3977
|
var _ui_utils = __w_pdfjs_require__(3);
|
3954
3978
|
|
@@ -3958,6 +3982,20 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
3958
3982
|
|
3959
3983
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
3960
3984
|
|
3985
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
3986
|
+
|
3987
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
3988
|
+
|
3989
|
+
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
3990
|
+
|
3991
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
3992
|
+
|
3993
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
3994
|
+
|
3995
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
3996
|
+
|
3997
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
3998
|
+
|
3961
3999
|
var FindState = {
|
3962
4000
|
FOUND: 0,
|
3963
4001
|
NOT_FOUND: 1,
|
@@ -3989,9 +4027,58 @@ function normalize(text) {
|
|
3989
4027
|
normalizationRegex = new RegExp("[".concat(replace, "]"), "g");
|
3990
4028
|
}
|
3991
4029
|
|
3992
|
-
|
3993
|
-
|
4030
|
+
var diffs = null;
|
4031
|
+
var normalizedText = text.replace(normalizationRegex, function (ch, index) {
|
4032
|
+
var normalizedCh = CHARACTERS_TO_NORMALIZE[ch],
|
4033
|
+
diff = normalizedCh.length - ch.length;
|
4034
|
+
|
4035
|
+
if (diff !== 0) {
|
4036
|
+
(diffs || (diffs = [])).push([index, diff]);
|
4037
|
+
}
|
4038
|
+
|
4039
|
+
return normalizedCh;
|
3994
4040
|
});
|
4041
|
+
return [normalizedText, diffs];
|
4042
|
+
}
|
4043
|
+
|
4044
|
+
function getOriginalIndex(matchIndex) {
|
4045
|
+
var diffs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
4046
|
+
|
4047
|
+
if (!diffs) {
|
4048
|
+
return matchIndex;
|
4049
|
+
}
|
4050
|
+
|
4051
|
+
var totalDiff = 0;
|
4052
|
+
|
4053
|
+
var _iterator = _createForOfIteratorHelper(diffs),
|
4054
|
+
_step;
|
4055
|
+
|
4056
|
+
try {
|
4057
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
4058
|
+
var _step$value = _slicedToArray(_step.value, 2),
|
4059
|
+
index = _step$value[0],
|
4060
|
+
diff = _step$value[1];
|
4061
|
+
|
4062
|
+
var currentIndex = index + totalDiff;
|
4063
|
+
|
4064
|
+
if (currentIndex >= matchIndex) {
|
4065
|
+
break;
|
4066
|
+
}
|
4067
|
+
|
4068
|
+
if (currentIndex + diff > matchIndex) {
|
4069
|
+
totalDiff += matchIndex - currentIndex;
|
4070
|
+
break;
|
4071
|
+
}
|
4072
|
+
|
4073
|
+
totalDiff += diff;
|
4074
|
+
}
|
4075
|
+
} catch (err) {
|
4076
|
+
_iterator.e(err);
|
4077
|
+
} finally {
|
4078
|
+
_iterator.f();
|
4079
|
+
}
|
4080
|
+
|
4081
|
+
return matchIndex - totalDiff;
|
3995
4082
|
}
|
3996
4083
|
|
3997
4084
|
var PDFFindController = /*#__PURE__*/function () {
|
@@ -4132,6 +4219,7 @@ var PDFFindController = /*#__PURE__*/function () {
|
|
4132
4219
|
};
|
4133
4220
|
this._extractTextPromises = [];
|
4134
4221
|
this._pageContents = [];
|
4222
|
+
this._pageDiffs = [];
|
4135
4223
|
this._matchesCountTotal = 0;
|
4136
4224
|
this._pagesToSearch = null;
|
4137
4225
|
this._pendingFindMatches = Object.create(null);
|
@@ -4238,8 +4326,9 @@ var PDFFindController = /*#__PURE__*/function () {
|
|
4238
4326
|
}
|
4239
4327
|
}, {
|
4240
4328
|
key: "_calculatePhraseMatch",
|
4241
|
-
value: function _calculatePhraseMatch(query, pageIndex, pageContent, entireWord) {
|
4242
|
-
var matches = []
|
4329
|
+
value: function _calculatePhraseMatch(query, pageIndex, pageContent, pageDiffs, entireWord) {
|
4330
|
+
var matches = [],
|
4331
|
+
matchesLength = [];
|
4243
4332
|
var queryLen = query.length;
|
4244
4333
|
var matchIdx = -queryLen;
|
4245
4334
|
|
@@ -4254,14 +4343,19 @@ var PDFFindController = /*#__PURE__*/function () {
|
|
4254
4343
|
continue;
|
4255
4344
|
}
|
4256
4345
|
|
4257
|
-
|
4346
|
+
var originalMatchIdx = getOriginalIndex(matchIdx, pageDiffs),
|
4347
|
+
matchEnd = matchIdx + queryLen - 1,
|
4348
|
+
originalQueryLen = getOriginalIndex(matchEnd, pageDiffs) - originalMatchIdx + 1;
|
4349
|
+
matches.push(originalMatchIdx);
|
4350
|
+
matchesLength.push(originalQueryLen);
|
4258
4351
|
}
|
4259
4352
|
|
4260
4353
|
this._pageMatches[pageIndex] = matches;
|
4354
|
+
this._pageMatchesLength[pageIndex] = matchesLength;
|
4261
4355
|
}
|
4262
4356
|
}, {
|
4263
4357
|
key: "_calculateWordMatch",
|
4264
|
-
value: function _calculateWordMatch(query, pageIndex, pageContent, entireWord) {
|
4358
|
+
value: function _calculateWordMatch(query, pageIndex, pageContent, pageDiffs, entireWord) {
|
4265
4359
|
var matchesWithLength = [];
|
4266
4360
|
var queryArray = query.match(/\S+/g);
|
4267
4361
|
|
@@ -4281,9 +4375,12 @@ var PDFFindController = /*#__PURE__*/function () {
|
|
4281
4375
|
continue;
|
4282
4376
|
}
|
4283
4377
|
|
4378
|
+
var originalMatchIdx = getOriginalIndex(matchIdx, pageDiffs),
|
4379
|
+
matchEnd = matchIdx + subqueryLen - 1,
|
4380
|
+
originalQueryLen = getOriginalIndex(matchEnd, pageDiffs) - originalMatchIdx + 1;
|
4284
4381
|
matchesWithLength.push({
|
4285
|
-
match:
|
4286
|
-
matchLength:
|
4382
|
+
match: originalMatchIdx,
|
4383
|
+
matchLength: originalQueryLen,
|
4287
4384
|
skipped: false
|
4288
4385
|
});
|
4289
4386
|
}
|
@@ -4298,6 +4395,7 @@ var PDFFindController = /*#__PURE__*/function () {
|
|
4298
4395
|
key: "_calculateMatch",
|
4299
4396
|
value: function _calculateMatch(pageIndex) {
|
4300
4397
|
var pageContent = this._pageContents[pageIndex];
|
4398
|
+
var pageDiffs = this._pageDiffs[pageIndex];
|
4301
4399
|
var query = this._query;
|
4302
4400
|
var _this$_state = this._state,
|
4303
4401
|
caseSensitive = _this$_state.caseSensitive,
|
@@ -4314,9 +4412,9 @@ var PDFFindController = /*#__PURE__*/function () {
|
|
4314
4412
|
}
|
4315
4413
|
|
4316
4414
|
if (phraseSearch) {
|
4317
|
-
this._calculatePhraseMatch(query, pageIndex, pageContent, entireWord);
|
4415
|
+
this._calculatePhraseMatch(query, pageIndex, pageContent, pageDiffs, entireWord);
|
4318
4416
|
} else {
|
4319
|
-
this._calculateWordMatch(query, pageIndex, pageContent, entireWord);
|
4417
|
+
this._calculateWordMatch(query, pageIndex, pageContent, pageDiffs, entireWord);
|
4320
4418
|
}
|
4321
4419
|
|
4322
4420
|
if (this._state.highlightAll) {
|
@@ -4364,11 +4462,17 @@ var PDFFindController = /*#__PURE__*/function () {
|
|
4364
4462
|
strBuf.push(textItems[j].str);
|
4365
4463
|
}
|
4366
4464
|
|
4367
|
-
|
4465
|
+
var _normalize = normalize(strBuf.join(""));
|
4466
|
+
|
4467
|
+
var _normalize2 = _slicedToArray(_normalize, 2);
|
4468
|
+
|
4469
|
+
_this2._pageContents[i] = _normalize2[0];
|
4470
|
+
_this2._pageDiffs[i] = _normalize2[1];
|
4368
4471
|
extractTextCapability.resolve(i);
|
4369
4472
|
}, function (reason) {
|
4370
4473
|
console.error("Unable to get text content for page ".concat(i + 1), reason);
|
4371
4474
|
_this2._pageContents[i] = "";
|
4475
|
+
_this2._pageDiffs[i] = null;
|
4372
4476
|
extractTextCapability.resolve(i);
|
4373
4477
|
});
|
4374
4478
|
});
|
@@ -4658,7 +4762,12 @@ var PDFFindController = /*#__PURE__*/function () {
|
|
4658
4762
|
get: function get() {
|
4659
4763
|
if (this._state.query !== this._rawQuery) {
|
4660
4764
|
this._rawQuery = this._state.query;
|
4661
|
-
|
4765
|
+
|
4766
|
+
var _normalize3 = normalize(this._state.query);
|
4767
|
+
|
4768
|
+
var _normalize4 = _slicedToArray(_normalize3, 1);
|
4769
|
+
|
4770
|
+
this._normalizedQuery = _normalize4[0];
|
4662
4771
|
}
|
4663
4772
|
|
4664
4773
|
return this._normalizedQuery;
|
@@ -4671,15 +4780,14 @@ var PDFFindController = /*#__PURE__*/function () {
|
|
4671
4780
|
exports.PDFFindController = PDFFindController;
|
4672
4781
|
|
4673
4782
|
/***/ }),
|
4674
|
-
/*
|
4675
|
-
/***/ (
|
4783
|
+
/* 13 */
|
4784
|
+
/***/ ((__unused_webpack_module, exports) => {
|
4676
4785
|
|
4677
|
-
"use strict";
|
4678
4786
|
|
4679
4787
|
|
4680
|
-
Object.defineProperty(exports, "__esModule", {
|
4788
|
+
Object.defineProperty(exports, "__esModule", ({
|
4681
4789
|
value: true
|
4682
|
-
});
|
4790
|
+
}));
|
4683
4791
|
exports.getCharacterType = getCharacterType;
|
4684
4792
|
exports.CharacterType = void 0;
|
4685
4793
|
var CharacterType = {
|
@@ -4767,17 +4875,16 @@ function getCharacterType(charCode) {
|
|
4767
4875
|
}
|
4768
4876
|
|
4769
4877
|
/***/ }),
|
4770
|
-
/*
|
4771
|
-
/***/ (
|
4878
|
+
/* 14 */
|
4879
|
+
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
|
4772
4880
|
|
4773
|
-
"use strict";
|
4774
4881
|
|
4775
4882
|
|
4776
|
-
Object.defineProperty(exports, "__esModule", {
|
4883
|
+
Object.defineProperty(exports, "__esModule", ({
|
4777
4884
|
value: true
|
4778
|
-
});
|
4779
|
-
exports.isDestHashesEqual = isDestHashesEqual;
|
4885
|
+
}));
|
4780
4886
|
exports.isDestArraysEqual = isDestArraysEqual;
|
4887
|
+
exports.isDestHashesEqual = isDestHashesEqual;
|
4781
4888
|
exports.PDFHistory = void 0;
|
4782
4889
|
|
4783
4890
|
var _ui_utils = __w_pdfjs_require__(3);
|
@@ -4828,19 +4935,17 @@ var PDFHistory = /*#__PURE__*/function () {
|
|
4828
4935
|
this._isViewerInPresentationMode = false;
|
4829
4936
|
|
4830
4937
|
this.eventBus._on("presentationmodechanged", function (evt) {
|
4831
|
-
_this._isViewerInPresentationMode = evt.
|
4938
|
+
_this._isViewerInPresentationMode = evt.state !== _ui_utils.PresentationModeState.NORMAL;
|
4832
4939
|
});
|
4833
4940
|
|
4834
4941
|
this.eventBus._on("pagesinit", function () {
|
4835
4942
|
_this._isPagesLoaded = false;
|
4836
4943
|
|
4837
|
-
|
4838
|
-
_this.eventBus._off("pagesloaded", onPagesLoaded);
|
4839
|
-
|
4944
|
+
_this.eventBus._on("pagesloaded", function (evt) {
|
4840
4945
|
_this._isPagesLoaded = !!evt.pagesCount;
|
4841
|
-
}
|
4842
|
-
|
4843
|
-
|
4946
|
+
}, {
|
4947
|
+
once: true
|
4948
|
+
});
|
4844
4949
|
});
|
4845
4950
|
}
|
4846
4951
|
|
@@ -4903,10 +5008,6 @@ var PDFHistory = /*#__PURE__*/function () {
|
|
4903
5008
|
|
4904
5009
|
this._updateInternalState(destination, state.uid, true);
|
4905
5010
|
|
4906
|
-
if (this._uid > this._maxUid) {
|
4907
|
-
this._maxUid = this._uid;
|
4908
|
-
}
|
4909
|
-
|
4910
5011
|
if (destination.rotation !== undefined) {
|
4911
5012
|
this._initialRotation = destination.rotation;
|
4912
5013
|
}
|
@@ -5000,6 +5101,42 @@ var PDFHistory = /*#__PURE__*/function () {
|
|
5000
5101
|
});
|
5001
5102
|
}
|
5002
5103
|
}
|
5104
|
+
}, {
|
5105
|
+
key: "pushPage",
|
5106
|
+
value: function pushPage(pageNumber) {
|
5107
|
+
var _this$_destination,
|
5108
|
+
_this3 = this;
|
5109
|
+
|
5110
|
+
if (!this._initialized) {
|
5111
|
+
return;
|
5112
|
+
}
|
5113
|
+
|
5114
|
+
if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.linkService.pagesCount)) {
|
5115
|
+
console.error("PDFHistory.pushPage: \"".concat(pageNumber, "\" is not a valid page number."));
|
5116
|
+
return;
|
5117
|
+
}
|
5118
|
+
|
5119
|
+
if (((_this$_destination = this._destination) === null || _this$_destination === void 0 ? void 0 : _this$_destination.page) === pageNumber) {
|
5120
|
+
return;
|
5121
|
+
}
|
5122
|
+
|
5123
|
+
if (this._popStateInProgress) {
|
5124
|
+
return;
|
5125
|
+
}
|
5126
|
+
|
5127
|
+
this._pushOrReplaceState({
|
5128
|
+
hash: "page=".concat(pageNumber),
|
5129
|
+
page: pageNumber,
|
5130
|
+
rotation: this.linkService.rotation
|
5131
|
+
});
|
5132
|
+
|
5133
|
+
if (!this._popStateInProgress) {
|
5134
|
+
this._popStateInProgress = true;
|
5135
|
+
Promise.resolve().then(function () {
|
5136
|
+
_this3._popStateInProgress = false;
|
5137
|
+
});
|
5138
|
+
}
|
5139
|
+
}
|
5003
5140
|
}, {
|
5004
5141
|
key: "pushCurrentPosition",
|
5005
5142
|
value: function pushCurrentPosition() {
|
@@ -5050,7 +5187,7 @@ var PDFHistory = /*#__PURE__*/function () {
|
|
5050
5187
|
|
5051
5188
|
var newUrl;
|
5052
5189
|
|
5053
|
-
if (this._updateUrl && destination && destination.hash) {
|
5190
|
+
if (this._updateUrl && destination !== null && destination !== void 0 && destination.hash) {
|
5054
5191
|
var baseUrl = document.location.href.split("#")[0];
|
5055
5192
|
|
5056
5193
|
if (!baseUrl.startsWith("file://")) {
|
@@ -5061,7 +5198,6 @@ var PDFHistory = /*#__PURE__*/function () {
|
|
5061
5198
|
if (shouldReplace) {
|
5062
5199
|
window.history.replaceState(newState, "", newUrl);
|
5063
5200
|
} else {
|
5064
|
-
this._maxUid = this._uid;
|
5065
5201
|
window.history.pushState(newState, "", newUrl);
|
5066
5202
|
}
|
5067
5203
|
}
|
@@ -5132,7 +5268,7 @@ var PDFHistory = /*#__PURE__*/function () {
|
|
5132
5268
|
_performance$getEntri2 = _slicedToArray(_performance$getEntri, 1),
|
5133
5269
|
perfEntry = _performance$getEntri2[0];
|
5134
5270
|
|
5135
|
-
if (
|
5271
|
+
if ((perfEntry === null || perfEntry === void 0 ? void 0 : perfEntry.type) !== "reload") {
|
5136
5272
|
return false;
|
5137
5273
|
}
|
5138
5274
|
} else {
|
@@ -5160,12 +5296,13 @@ var PDFHistory = /*#__PURE__*/function () {
|
|
5160
5296
|
this._updateViewareaTimeout = null;
|
5161
5297
|
}
|
5162
5298
|
|
5163
|
-
if (removeTemporary && destination && destination.temporary) {
|
5299
|
+
if (removeTemporary && destination !== null && destination !== void 0 && destination.temporary) {
|
5164
5300
|
delete destination.temporary;
|
5165
5301
|
}
|
5166
5302
|
|
5167
5303
|
this._destination = destination;
|
5168
5304
|
this._uid = uid;
|
5305
|
+
this._maxUid = Math.max(this._maxUid, uid);
|
5169
5306
|
this._numPositionUpdates = 0;
|
5170
5307
|
}
|
5171
5308
|
}, {
|
@@ -5190,7 +5327,7 @@ var PDFHistory = /*#__PURE__*/function () {
|
|
5190
5327
|
}, {
|
5191
5328
|
key: "_updateViewarea",
|
5192
5329
|
value: function _updateViewarea(_ref4) {
|
5193
|
-
var
|
5330
|
+
var _this4 = this;
|
5194
5331
|
|
5195
5332
|
var location = _ref4.location;
|
5196
5333
|
|
@@ -5216,18 +5353,18 @@ var PDFHistory = /*#__PURE__*/function () {
|
|
5216
5353
|
|
5217
5354
|
if (UPDATE_VIEWAREA_TIMEOUT > 0) {
|
5218
5355
|
this._updateViewareaTimeout = setTimeout(function () {
|
5219
|
-
if (!
|
5220
|
-
|
5356
|
+
if (!_this4._popStateInProgress) {
|
5357
|
+
_this4._tryPushCurrentPosition(true);
|
5221
5358
|
}
|
5222
5359
|
|
5223
|
-
|
5360
|
+
_this4._updateViewareaTimeout = null;
|
5224
5361
|
}, UPDATE_VIEWAREA_TIMEOUT);
|
5225
5362
|
}
|
5226
5363
|
}
|
5227
5364
|
}, {
|
5228
5365
|
key: "_popState",
|
5229
5366
|
value: function _popState(_ref5) {
|
5230
|
-
var
|
5367
|
+
var _this5 = this;
|
5231
5368
|
|
5232
5369
|
var state = _ref5.state;
|
5233
5370
|
var newHash = getCurrentHash(),
|
@@ -5264,7 +5401,7 @@ var PDFHistory = /*#__PURE__*/function () {
|
|
5264
5401
|
name: "hashchange",
|
5265
5402
|
delay: HASH_CHANGE_TIMEOUT
|
5266
5403
|
}).then(function () {
|
5267
|
-
|
5404
|
+
_this5._blockHashChange--;
|
5268
5405
|
});
|
5269
5406
|
}
|
5270
5407
|
|
@@ -5272,16 +5409,12 @@ var PDFHistory = /*#__PURE__*/function () {
|
|
5272
5409
|
|
5273
5410
|
this._updateInternalState(destination, state.uid, true);
|
5274
5411
|
|
5275
|
-
if (this._uid > this._maxUid) {
|
5276
|
-
this._maxUid = this._uid;
|
5277
|
-
}
|
5278
|
-
|
5279
5412
|
if ((0, _ui_utils.isValidRotation)(destination.rotation)) {
|
5280
5413
|
this.linkService.rotation = destination.rotation;
|
5281
5414
|
}
|
5282
5415
|
|
5283
5416
|
if (destination.dest) {
|
5284
|
-
this.linkService.
|
5417
|
+
this.linkService.goToDestination(destination.dest);
|
5285
5418
|
} else if (destination.hash) {
|
5286
5419
|
this.linkService.setHash(destination.hash);
|
5287
5420
|
} else if (destination.page) {
|
@@ -5289,7 +5422,7 @@ var PDFHistory = /*#__PURE__*/function () {
|
|
5289
5422
|
}
|
5290
5423
|
|
5291
5424
|
Promise.resolve().then(function () {
|
5292
|
-
|
5425
|
+
_this5._popStateInProgress = false;
|
5293
5426
|
});
|
5294
5427
|
}
|
5295
5428
|
}, {
|
@@ -5416,15 +5549,14 @@ function isDestArraysEqual(firstDest, secondDest) {
|
|
5416
5549
|
}
|
5417
5550
|
|
5418
5551
|
/***/ }),
|
5419
|
-
/*
|
5420
|
-
/***/ (
|
5552
|
+
/* 15 */
|
5553
|
+
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
|
5421
5554
|
|
5422
|
-
"use strict";
|
5423
5555
|
|
5424
5556
|
|
5425
|
-
Object.defineProperty(exports, "__esModule", {
|
5557
|
+
Object.defineProperty(exports, "__esModule", ({
|
5426
5558
|
value: true
|
5427
|
-
});
|
5559
|
+
}));
|
5428
5560
|
exports.PDFPageView = void 0;
|
5429
5561
|
|
5430
5562
|
var _regenerator = _interopRequireDefault(__w_pdfjs_require__(4));
|
@@ -5433,9 +5565,9 @@ var _ui_utils = __w_pdfjs_require__(3);
|
|
5433
5565
|
|
5434
5566
|
var _pdfjsLib = __w_pdfjs_require__(2);
|
5435
5567
|
|
5436
|
-
var _pdf_rendering_queue = __w_pdfjs_require__(
|
5568
|
+
var _pdf_rendering_queue = __w_pdfjs_require__(16);
|
5437
5569
|
|
5438
|
-
var _viewer_compatibility = __w_pdfjs_require__(
|
5570
|
+
var _viewer_compatibility = __w_pdfjs_require__(9);
|
5439
5571
|
|
5440
5572
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
5441
5573
|
|
@@ -5465,7 +5597,6 @@ var PDFPageView = /*#__PURE__*/function () {
|
|
5465
5597
|
this.scale = options.scale || _ui_utils.DEFAULT_SCALE;
|
5466
5598
|
this.viewport = defaultViewport;
|
5467
5599
|
this.pdfPageRotate = defaultViewport.rotation;
|
5468
|
-
this._annotationStorage = options.annotationStorage || null;
|
5469
5600
|
this._optionalContentConfigPromise = options.optionalContentConfigPromise || null;
|
5470
5601
|
this.hasRestrictedScaling = false;
|
5471
5602
|
this.textLayerMode = Number.isInteger(options.textLayerMode) ? options.textLayerMode : _ui_utils.TextLayerMode.ENABLE;
|
@@ -5480,11 +5611,12 @@ var PDFPageView = /*#__PURE__*/function () {
|
|
5480
5611
|
this.renderer = options.renderer || _ui_utils.RendererType.CANVAS;
|
5481
5612
|
this.enableWebGL = options.enableWebGL || false;
|
5482
5613
|
this.l10n = options.l10n || _ui_utils.NullL10n;
|
5614
|
+
this.enableScripting = options.enableScripting || false;
|
5483
5615
|
this.paintTask = null;
|
5484
5616
|
this.paintedViewportMap = new WeakMap();
|
5485
5617
|
this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;
|
5486
5618
|
this.resume = null;
|
5487
|
-
this.
|
5619
|
+
this._renderError = null;
|
5488
5620
|
this.annotationLayer = null;
|
5489
5621
|
this.textLayer = null;
|
5490
5622
|
this.zoomLayer = null;
|
@@ -5507,7 +5639,6 @@ var PDFPageView = /*#__PURE__*/function () {
|
|
5507
5639
|
scale: this.scale * _ui_utils.CSS_UNITS,
|
5508
5640
|
rotation: totalRotation
|
5509
5641
|
});
|
5510
|
-
this.stats = pdfPage.stats;
|
5511
5642
|
this.reset();
|
5512
5643
|
}
|
5513
5644
|
}, {
|
@@ -5664,7 +5795,8 @@ var PDFPageView = /*#__PURE__*/function () {
|
|
5664
5795
|
source: this,
|
5665
5796
|
pageNumber: this.id,
|
5666
5797
|
cssTransform: true,
|
5667
|
-
timestamp: performance.now()
|
5798
|
+
timestamp: performance.now(),
|
5799
|
+
error: this._renderError
|
5668
5800
|
});
|
5669
5801
|
return;
|
5670
5802
|
}
|
@@ -5686,7 +5818,8 @@ var PDFPageView = /*#__PURE__*/function () {
|
|
5686
5818
|
source: this,
|
5687
5819
|
pageNumber: this.id,
|
5688
5820
|
cssTransform: true,
|
5689
|
-
timestamp: performance.now()
|
5821
|
+
timestamp: performance.now(),
|
5822
|
+
error: this._renderError
|
5690
5823
|
});
|
5691
5824
|
return;
|
5692
5825
|
}
|
@@ -5744,8 +5877,7 @@ var PDFPageView = /*#__PURE__*/function () {
|
|
5744
5877
|
scaleY = width / height;
|
5745
5878
|
}
|
5746
5879
|
|
5747
|
-
|
5748
|
-
target.style.transform = cssTransform;
|
5880
|
+
target.style.transform = "rotate(".concat(relativeRotation, "deg) scale(").concat(scaleX, ", ").concat(scaleY, ")");
|
5749
5881
|
|
5750
5882
|
if (this.textLayer) {
|
5751
5883
|
var textLayerViewport = this.textLayer.viewport;
|
@@ -5785,7 +5917,7 @@ var PDFPageView = /*#__PURE__*/function () {
|
|
5785
5917
|
break;
|
5786
5918
|
}
|
5787
5919
|
|
5788
|
-
textLayerDiv.style.transform = "rotate("
|
5920
|
+
textLayerDiv.style.transform = "rotate(".concat(textAbsRotation, "deg) ") + "scale(".concat(scale, ") ") + "translate(".concat(transX, ", ").concat(transY, ")");
|
5789
5921
|
textLayerDiv.style.transformOrigin = "0% 0%";
|
5790
5922
|
}
|
5791
5923
|
|
@@ -5872,24 +6004,29 @@ var PDFPageView = /*#__PURE__*/function () {
|
|
5872
6004
|
}
|
5873
6005
|
|
5874
6006
|
var finishPaintTask = /*#__PURE__*/function () {
|
5875
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2(
|
6007
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
6008
|
+
var error,
|
6009
|
+
_args2 = arguments;
|
5876
6010
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
5877
6011
|
while (1) {
|
5878
6012
|
switch (_context2.prev = _context2.next) {
|
5879
6013
|
case 0:
|
6014
|
+
error = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : null;
|
6015
|
+
|
5880
6016
|
if (paintTask === _this.paintTask) {
|
5881
6017
|
_this.paintTask = null;
|
5882
6018
|
}
|
5883
6019
|
|
5884
6020
|
if (!(error instanceof _pdfjsLib.RenderingCancelledException)) {
|
5885
|
-
_context2.next =
|
6021
|
+
_context2.next = 5;
|
5886
6022
|
break;
|
5887
6023
|
}
|
5888
6024
|
|
5889
|
-
_this.
|
6025
|
+
_this._renderError = null;
|
5890
6026
|
return _context2.abrupt("return");
|
5891
6027
|
|
5892
|
-
case
|
6028
|
+
case 5:
|
6029
|
+
_this._renderError = error;
|
5893
6030
|
_this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;
|
5894
6031
|
|
5895
6032
|
if (_this.loadingIconDiv) {
|
@@ -5899,14 +6036,12 @@ var PDFPageView = /*#__PURE__*/function () {
|
|
5899
6036
|
|
5900
6037
|
_this._resetZoomLayer(true);
|
5901
6038
|
|
5902
|
-
_this.error = error;
|
5903
|
-
_this.stats = pdfPage.stats;
|
5904
|
-
|
5905
6039
|
_this.eventBus.dispatch("pagerendered", {
|
5906
6040
|
source: _this,
|
5907
6041
|
pageNumber: _this.id,
|
5908
6042
|
cssTransform: false,
|
5909
|
-
timestamp: performance.now()
|
6043
|
+
timestamp: performance.now(),
|
6044
|
+
error: _this._renderError
|
5910
6045
|
});
|
5911
6046
|
|
5912
6047
|
if (!error) {
|
@@ -5924,7 +6059,7 @@ var PDFPageView = /*#__PURE__*/function () {
|
|
5924
6059
|
}, _callee2);
|
5925
6060
|
}));
|
5926
6061
|
|
5927
|
-
return function finishPaintTask(
|
6062
|
+
return function finishPaintTask() {
|
5928
6063
|
return _ref.apply(this, arguments);
|
5929
6064
|
};
|
5930
6065
|
}();
|
@@ -5948,7 +6083,7 @@ var PDFPageView = /*#__PURE__*/function () {
|
|
5948
6083
|
|
5949
6084
|
if (this.annotationLayerFactory) {
|
5950
6085
|
if (!this.annotationLayer) {
|
5951
|
-
this.annotationLayer = this.annotationLayerFactory.createAnnotationLayerBuilder(div, pdfPage,
|
6086
|
+
this.annotationLayer = this.annotationLayerFactory.createAnnotationLayerBuilder(div, pdfPage, null, this.imageResourcesPath, this.renderInteractiveForms, this.l10n, this.enableScripting, null, null);
|
5952
6087
|
}
|
5953
6088
|
|
5954
6089
|
this._renderAnnotationLayer();
|
@@ -6131,16 +6266,17 @@ var PDFPageView = /*#__PURE__*/function () {
|
|
6131
6266
|
exports.PDFPageView = PDFPageView;
|
6132
6267
|
|
6133
6268
|
/***/ }),
|
6134
|
-
/*
|
6135
|
-
/***/ (
|
6269
|
+
/* 16 */
|
6270
|
+
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
|
6136
6271
|
|
6137
|
-
"use strict";
|
6138
6272
|
|
6139
6273
|
|
6140
|
-
Object.defineProperty(exports, "__esModule", {
|
6274
|
+
Object.defineProperty(exports, "__esModule", ({
|
6141
6275
|
value: true
|
6142
|
-
});
|
6143
|
-
exports.
|
6276
|
+
}));
|
6277
|
+
exports.RenderingStates = exports.PDFRenderingQueue = void 0;
|
6278
|
+
|
6279
|
+
var _pdfjsLib = __w_pdfjs_require__(2);
|
6144
6280
|
|
6145
6281
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6146
6282
|
|
@@ -6273,6 +6409,10 @@ var PDFRenderingQueue = /*#__PURE__*/function () {
|
|
6273
6409
|
view.draw()["finally"](function () {
|
6274
6410
|
_this.renderHighestPriority();
|
6275
6411
|
})["catch"](function (reason) {
|
6412
|
+
if (reason instanceof _pdfjsLib.RenderingCancelledException) {
|
6413
|
+
return;
|
6414
|
+
}
|
6415
|
+
|
6276
6416
|
console.error("renderView: \"".concat(reason, "\""));
|
6277
6417
|
});
|
6278
6418
|
break;
|
@@ -6288,23 +6428,22 @@ var PDFRenderingQueue = /*#__PURE__*/function () {
|
|
6288
6428
|
exports.PDFRenderingQueue = PDFRenderingQueue;
|
6289
6429
|
|
6290
6430
|
/***/ }),
|
6291
|
-
/*
|
6292
|
-
/***/ (
|
6431
|
+
/* 17 */
|
6432
|
+
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
|
6293
6433
|
|
6294
|
-
"use strict";
|
6295
6434
|
|
6296
6435
|
|
6297
|
-
|
6436
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
6437
|
+
|
6438
|
+
Object.defineProperty(exports, "__esModule", ({
|
6298
6439
|
value: true
|
6299
|
-
});
|
6440
|
+
}));
|
6300
6441
|
exports.PDFSinglePageViewer = void 0;
|
6301
6442
|
|
6302
|
-
var _base_viewer = __w_pdfjs_require__(
|
6443
|
+
var _base_viewer = __w_pdfjs_require__(18);
|
6303
6444
|
|
6304
6445
|
var _pdfjsLib = __w_pdfjs_require__(2);
|
6305
6446
|
|
6306
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
6307
|
-
|
6308
6447
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6309
6448
|
|
6310
6449
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
@@ -6445,11 +6584,21 @@ var PDFSinglePageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
6445
6584
|
}, {
|
6446
6585
|
key: "_updateSpreadMode",
|
6447
6586
|
value: function _updateSpreadMode() {}
|
6587
|
+
}, {
|
6588
|
+
key: "_getPageAdvance",
|
6589
|
+
value: function _getPageAdvance() {
|
6590
|
+
return 1;
|
6591
|
+
}
|
6448
6592
|
}, {
|
6449
6593
|
key: "_viewerElement",
|
6450
6594
|
get: function get() {
|
6451
6595
|
return (0, _pdfjsLib.shadow)(this, "_viewerElement", this._shadowViewer);
|
6452
6596
|
}
|
6597
|
+
}, {
|
6598
|
+
key: "_pageWidthScaleFactor",
|
6599
|
+
get: function get() {
|
6600
|
+
return 1;
|
6601
|
+
}
|
6453
6602
|
}, {
|
6454
6603
|
key: "_isScrollModeHorizontal",
|
6455
6604
|
get: function get() {
|
@@ -6463,30 +6612,29 @@ var PDFSinglePageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
6463
6612
|
exports.PDFSinglePageViewer = PDFSinglePageViewer;
|
6464
6613
|
|
6465
6614
|
/***/ }),
|
6466
|
-
/*
|
6467
|
-
/***/ (
|
6615
|
+
/* 18 */
|
6616
|
+
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
|
6468
6617
|
|
6469
|
-
"use strict";
|
6470
6618
|
|
6471
6619
|
|
6472
|
-
Object.defineProperty(exports, "__esModule", {
|
6620
|
+
Object.defineProperty(exports, "__esModule", ({
|
6473
6621
|
value: true
|
6474
|
-
});
|
6622
|
+
}));
|
6475
6623
|
exports.BaseViewer = void 0;
|
6476
6624
|
|
6625
|
+
var _pdfjsLib = __w_pdfjs_require__(2);
|
6626
|
+
|
6477
6627
|
var _ui_utils = __w_pdfjs_require__(3);
|
6478
6628
|
|
6479
|
-
var _pdf_rendering_queue = __w_pdfjs_require__(
|
6629
|
+
var _pdf_rendering_queue = __w_pdfjs_require__(16);
|
6480
6630
|
|
6481
6631
|
var _annotation_layer_builder = __w_pdfjs_require__(1);
|
6482
6632
|
|
6483
|
-
var
|
6484
|
-
|
6485
|
-
var _pdf_page_view = __w_pdfjs_require__(16);
|
6633
|
+
var _pdf_page_view = __w_pdfjs_require__(15);
|
6486
6634
|
|
6487
|
-
var _pdf_link_service = __w_pdfjs_require__(
|
6635
|
+
var _pdf_link_service = __w_pdfjs_require__(6);
|
6488
6636
|
|
6489
|
-
var _text_layer_builder = __w_pdfjs_require__(
|
6637
|
+
var _text_layer_builder = __w_pdfjs_require__(7);
|
6490
6638
|
|
6491
6639
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
6492
6640
|
|
@@ -6538,6 +6686,10 @@ function PDFPageViewBuffer(size) {
|
|
6538
6686
|
data.shift().destroy();
|
6539
6687
|
}
|
6540
6688
|
};
|
6689
|
+
|
6690
|
+
this.has = function (view) {
|
6691
|
+
return data.includes(view);
|
6692
|
+
};
|
6541
6693
|
}
|
6542
6694
|
|
6543
6695
|
function isSameScale(oldScale, newScale) {
|
@@ -6554,7 +6706,9 @@ function isSameScale(oldScale, newScale) {
|
|
6554
6706
|
|
6555
6707
|
var BaseViewer = /*#__PURE__*/function () {
|
6556
6708
|
function BaseViewer(options) {
|
6557
|
-
var _this
|
6709
|
+
var _this$container,
|
6710
|
+
_this$viewer,
|
6711
|
+
_this = this;
|
6558
6712
|
|
6559
6713
|
_classCallCheck(this, BaseViewer);
|
6560
6714
|
|
@@ -6562,14 +6716,24 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
6562
6716
|
throw new Error("Cannot initialize BaseViewer.");
|
6563
6717
|
}
|
6564
6718
|
|
6719
|
+
var viewerVersion = '2.7.570';
|
6720
|
+
|
6721
|
+
if (_pdfjsLib.version !== viewerVersion) {
|
6722
|
+
throw new Error("The API version \"".concat(_pdfjsLib.version, "\" does not match the Viewer version \"").concat(viewerVersion, "\"."));
|
6723
|
+
}
|
6724
|
+
|
6565
6725
|
this._name = this.constructor.name;
|
6566
6726
|
this.container = options.container;
|
6567
6727
|
this.viewer = options.viewer || options.container.firstElementChild;
|
6568
6728
|
|
6569
|
-
if (!(this.container
|
6729
|
+
if (!(((_this$container = this.container) === null || _this$container === void 0 ? void 0 : _this$container.tagName.toUpperCase()) === "DIV" && ((_this$viewer = this.viewer) === null || _this$viewer === void 0 ? void 0 : _this$viewer.tagName.toUpperCase()) === "DIV")) {
|
6570
6730
|
throw new Error("Invalid `container` and/or `viewer` option.");
|
6571
6731
|
}
|
6572
6732
|
|
6733
|
+
if (getComputedStyle(this.container).position !== "absolute") {
|
6734
|
+
throw new Error("The `container` must be absolutely positioned.");
|
6735
|
+
}
|
6736
|
+
|
6573
6737
|
this.eventBus = options.eventBus;
|
6574
6738
|
this.linkService = options.linkService || new _pdf_link_service.SimpleLinkService();
|
6575
6739
|
this.downloadManager = options.downloadManager || null;
|
@@ -6584,6 +6748,8 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
6584
6748
|
this.useOnlyCssZoom = options.useOnlyCssZoom || false;
|
6585
6749
|
this.maxCanvasPixels = options.maxCanvasPixels;
|
6586
6750
|
this.l10n = options.l10n || _ui_utils.NullL10n;
|
6751
|
+
this.enableScripting = options.enableScripting || false;
|
6752
|
+
this._mouseState = options.mouseState || null;
|
6587
6753
|
this.defaultRenderingQueue = !options.renderingQueue;
|
6588
6754
|
|
6589
6755
|
if (this.defaultRenderingQueue) {
|
@@ -6632,11 +6798,13 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
6632
6798
|
return false;
|
6633
6799
|
}
|
6634
6800
|
|
6801
|
+
var previous = this._currentPageNumber;
|
6635
6802
|
this._currentPageNumber = val;
|
6636
6803
|
this.eventBus.dispatch("pagechanging", {
|
6637
6804
|
source: this,
|
6638
6805
|
pageNumber: val,
|
6639
|
-
pageLabel: this._pageLabels && this._pageLabels[val - 1]
|
6806
|
+
pageLabel: this._pageLabels && this._pageLabels[val - 1],
|
6807
|
+
previous: previous
|
6640
6808
|
});
|
6641
6809
|
|
6642
6810
|
if (resetCurrentPageView) {
|
@@ -6660,6 +6828,10 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
6660
6828
|
var _this2 = this;
|
6661
6829
|
|
6662
6830
|
if (this.pdfDocument) {
|
6831
|
+
this.eventBus.dispatch("pagesdestroy", {
|
6832
|
+
source: this
|
6833
|
+
});
|
6834
|
+
|
6663
6835
|
this._cancelRendering();
|
6664
6836
|
|
6665
6837
|
this._resetView();
|
@@ -6677,7 +6849,6 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
6677
6849
|
|
6678
6850
|
var pagesCount = pdfDocument.numPages;
|
6679
6851
|
var firstPagePromise = pdfDocument.getPage(1);
|
6680
|
-
var annotationStorage = pdfDocument.annotationStorage;
|
6681
6852
|
var optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();
|
6682
6853
|
|
6683
6854
|
this._pagesCapability.promise.then(function () {
|
@@ -6730,7 +6901,6 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
6730
6901
|
id: pageNum,
|
6731
6902
|
scale: scale,
|
6732
6903
|
defaultViewport: viewport.clone(),
|
6733
|
-
annotationStorage: annotationStorage,
|
6734
6904
|
optionalContentConfigPromise: optionalContentConfigPromise,
|
6735
6905
|
renderingQueue: _this2.renderingQueue,
|
6736
6906
|
textLayerFactory: textLayerFactory,
|
@@ -6742,7 +6912,8 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
6742
6912
|
enableWebGL: _this2.enableWebGL,
|
6743
6913
|
useOnlyCssZoom: _this2.useOnlyCssZoom,
|
6744
6914
|
maxCanvasPixels: _this2.maxCanvasPixels,
|
6745
|
-
l10n: _this2.l10n
|
6915
|
+
l10n: _this2.l10n,
|
6916
|
+
enableScripting: _this2.enableScripting
|
6746
6917
|
});
|
6747
6918
|
|
6748
6919
|
_this2._pages.push(pageView);
|
@@ -6870,6 +7041,8 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
6870
7041
|
this._onAfterDraw = null;
|
6871
7042
|
}
|
6872
7043
|
|
7044
|
+
this._resetScriptingEvents();
|
7045
|
+
|
6873
7046
|
this.viewer.textContent = "";
|
6874
7047
|
|
6875
7048
|
this._updateScrollMode();
|
@@ -6971,7 +7144,7 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
6971
7144
|
vPadding = _ref2[1];
|
6972
7145
|
}
|
6973
7146
|
|
6974
|
-
var pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale;
|
7147
|
+
var pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale / this._pageWidthScaleFactor;
|
6975
7148
|
var pageHeightScale = (this.container.clientHeight - vPadding) / currentPage.height * currentPage.scale;
|
6976
7149
|
|
6977
7150
|
switch (value) {
|
@@ -7017,6 +7190,21 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
7017
7190
|
pageDiv: pageView.div
|
7018
7191
|
});
|
7019
7192
|
}
|
7193
|
+
}, {
|
7194
|
+
key: "pageLabelToPageNumber",
|
7195
|
+
value: function pageLabelToPageNumber(label) {
|
7196
|
+
if (!this._pageLabels) {
|
7197
|
+
return null;
|
7198
|
+
}
|
7199
|
+
|
7200
|
+
var i = this._pageLabels.indexOf(label);
|
7201
|
+
|
7202
|
+
if (i < 0) {
|
7203
|
+
return null;
|
7204
|
+
}
|
7205
|
+
|
7206
|
+
return i + 1;
|
7207
|
+
}
|
7020
7208
|
}, {
|
7021
7209
|
key: "scrollPageIntoView",
|
7022
7210
|
value: function scrollPageIntoView(_ref3) {
|
@@ -7078,6 +7266,8 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
7078
7266
|
if (y === null && this._location) {
|
7079
7267
|
x = this._location.left;
|
7080
7268
|
y = this._location.top;
|
7269
|
+
} else if (typeof y !== "number") {
|
7270
|
+
y = pageHeight;
|
7081
7271
|
}
|
7082
7272
|
|
7083
7273
|
break;
|
@@ -7234,7 +7424,13 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
7234
7424
|
}, {
|
7235
7425
|
key: "_getVisiblePages",
|
7236
7426
|
value: function _getVisiblePages() {
|
7237
|
-
return (0, _ui_utils.getVisibleElements)(
|
7427
|
+
return (0, _ui_utils.getVisibleElements)({
|
7428
|
+
scrollEl: this.container,
|
7429
|
+
views: this._pages,
|
7430
|
+
sortByVisibility: true,
|
7431
|
+
horizontal: this._isScrollModeHorizontal,
|
7432
|
+
rtl: this._isScrollModeHorizontal && this._isContainerRtl
|
7433
|
+
});
|
7238
7434
|
}
|
7239
7435
|
}, {
|
7240
7436
|
key: "isPageVisible",
|
@@ -7243,8 +7439,8 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
7243
7439
|
return false;
|
7244
7440
|
}
|
7245
7441
|
|
7246
|
-
if (pageNumber
|
7247
|
-
console.error("".concat(this._name, ".isPageVisible: \"").concat(pageNumber, "\" is
|
7442
|
+
if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {
|
7443
|
+
console.error("".concat(this._name, ".isPageVisible: \"").concat(pageNumber, "\" is not a valid page."));
|
7248
7444
|
return false;
|
7249
7445
|
}
|
7250
7446
|
|
@@ -7252,6 +7448,26 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
7252
7448
|
return view.id === pageNumber;
|
7253
7449
|
});
|
7254
7450
|
}
|
7451
|
+
}, {
|
7452
|
+
key: "isPageCached",
|
7453
|
+
value: function isPageCached(pageNumber) {
|
7454
|
+
if (!this.pdfDocument || !this._buffer) {
|
7455
|
+
return false;
|
7456
|
+
}
|
7457
|
+
|
7458
|
+
if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {
|
7459
|
+
console.error("".concat(this._name, ".isPageCached: \"").concat(pageNumber, "\" is not a valid page."));
|
7460
|
+
return false;
|
7461
|
+
}
|
7462
|
+
|
7463
|
+
var pageView = this._pages[pageNumber - 1];
|
7464
|
+
|
7465
|
+
if (!pageView) {
|
7466
|
+
return false;
|
7467
|
+
}
|
7468
|
+
|
7469
|
+
return this._buffer.has(pageView);
|
7470
|
+
}
|
7255
7471
|
}, {
|
7256
7472
|
key: "cleanup",
|
7257
7473
|
value: function cleanup() {
|
@@ -7338,19 +7554,27 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
7338
7554
|
}, {
|
7339
7555
|
key: "createAnnotationLayerBuilder",
|
7340
7556
|
value: function createAnnotationLayerBuilder(pageDiv, pdfPage) {
|
7557
|
+
var _this$pdfDocument, _this$pdfDocument2;
|
7558
|
+
|
7341
7559
|
var annotationStorage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
7342
7560
|
var imageResourcesPath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";
|
7343
7561
|
var renderInteractiveForms = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
7344
7562
|
var l10n = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : _ui_utils.NullL10n;
|
7563
|
+
var enableScripting = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
7564
|
+
var hasJSActionsPromise = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
|
7565
|
+
var mouseState = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
|
7345
7566
|
return new _annotation_layer_builder.AnnotationLayerBuilder({
|
7346
7567
|
pageDiv: pageDiv,
|
7347
7568
|
pdfPage: pdfPage,
|
7348
|
-
annotationStorage: annotationStorage,
|
7569
|
+
annotationStorage: annotationStorage || ((_this$pdfDocument = this.pdfDocument) === null || _this$pdfDocument === void 0 ? void 0 : _this$pdfDocument.annotationStorage),
|
7349
7570
|
imageResourcesPath: imageResourcesPath,
|
7350
7571
|
renderInteractiveForms: renderInteractiveForms,
|
7351
7572
|
linkService: this.linkService,
|
7352
7573
|
downloadManager: this.downloadManager,
|
7353
|
-
l10n: l10n
|
7574
|
+
l10n: l10n,
|
7575
|
+
enableScripting: enableScripting,
|
7576
|
+
hasJSActionsPromise: hasJSActionsPromise || ((_this$pdfDocument2 = this.pdfDocument) === null || _this$pdfDocument2 === void 0 ? void 0 : _this$pdfDocument2.hasJSActions()),
|
7577
|
+
mouseState: mouseState || this._mouseState
|
7354
7578
|
});
|
7355
7579
|
}
|
7356
7580
|
}, {
|
@@ -7443,10 +7667,307 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
7443
7667
|
return;
|
7444
7668
|
}
|
7445
7669
|
|
7670
|
+
if (this._currentScaleValue && isNaN(this._currentScaleValue)) {
|
7671
|
+
this._setScale(this._currentScaleValue, true);
|
7672
|
+
}
|
7673
|
+
|
7446
7674
|
this._setCurrentPageNumber(pageNumber, true);
|
7447
7675
|
|
7448
7676
|
this.update();
|
7449
7677
|
}
|
7678
|
+
}, {
|
7679
|
+
key: "_getPageAdvance",
|
7680
|
+
value: function _getPageAdvance(currentPageNumber) {
|
7681
|
+
var previous = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
7682
|
+
|
7683
|
+
if (this.isInPresentationMode) {
|
7684
|
+
return 1;
|
7685
|
+
}
|
7686
|
+
|
7687
|
+
switch (this._scrollMode) {
|
7688
|
+
case _ui_utils.ScrollMode.WRAPPED:
|
7689
|
+
{
|
7690
|
+
var _this$_getVisiblePage = this._getVisiblePages(),
|
7691
|
+
views = _this$_getVisiblePage.views,
|
7692
|
+
pageLayout = new Map();
|
7693
|
+
|
7694
|
+
var _iterator = _createForOfIteratorHelper(views),
|
7695
|
+
_step;
|
7696
|
+
|
7697
|
+
try {
|
7698
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
7699
|
+
var _step$value = _step.value,
|
7700
|
+
id = _step$value.id,
|
7701
|
+
y = _step$value.y,
|
7702
|
+
percent = _step$value.percent,
|
7703
|
+
widthPercent = _step$value.widthPercent;
|
7704
|
+
|
7705
|
+
if (percent === 0 || widthPercent < 100) {
|
7706
|
+
continue;
|
7707
|
+
}
|
7708
|
+
|
7709
|
+
var yArray = pageLayout.get(y);
|
7710
|
+
|
7711
|
+
if (!yArray) {
|
7712
|
+
pageLayout.set(y, yArray || (yArray = []));
|
7713
|
+
}
|
7714
|
+
|
7715
|
+
yArray.push(id);
|
7716
|
+
}
|
7717
|
+
} catch (err) {
|
7718
|
+
_iterator.e(err);
|
7719
|
+
} finally {
|
7720
|
+
_iterator.f();
|
7721
|
+
}
|
7722
|
+
|
7723
|
+
var _iterator2 = _createForOfIteratorHelper(pageLayout.values()),
|
7724
|
+
_step2;
|
7725
|
+
|
7726
|
+
try {
|
7727
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
7728
|
+
var _yArray = _step2.value;
|
7729
|
+
|
7730
|
+
var currentIndex = _yArray.indexOf(currentPageNumber);
|
7731
|
+
|
7732
|
+
if (currentIndex === -1) {
|
7733
|
+
continue;
|
7734
|
+
}
|
7735
|
+
|
7736
|
+
var numPages = _yArray.length;
|
7737
|
+
|
7738
|
+
if (numPages === 1) {
|
7739
|
+
break;
|
7740
|
+
}
|
7741
|
+
|
7742
|
+
if (previous) {
|
7743
|
+
for (var i = currentIndex - 1, ii = 0; i >= ii; i--) {
|
7744
|
+
var currentId = _yArray[i],
|
7745
|
+
expectedId = _yArray[i + 1] - 1;
|
7746
|
+
|
7747
|
+
if (currentId < expectedId) {
|
7748
|
+
return currentPageNumber - expectedId;
|
7749
|
+
}
|
7750
|
+
}
|
7751
|
+
} else {
|
7752
|
+
for (var _i2 = currentIndex + 1, _ii = numPages; _i2 < _ii; _i2++) {
|
7753
|
+
var _currentId = _yArray[_i2],
|
7754
|
+
_expectedId = _yArray[_i2 - 1] + 1;
|
7755
|
+
|
7756
|
+
if (_currentId > _expectedId) {
|
7757
|
+
return _expectedId - currentPageNumber;
|
7758
|
+
}
|
7759
|
+
}
|
7760
|
+
}
|
7761
|
+
|
7762
|
+
if (previous) {
|
7763
|
+
var firstId = _yArray[0];
|
7764
|
+
|
7765
|
+
if (firstId < currentPageNumber) {
|
7766
|
+
return currentPageNumber - firstId + 1;
|
7767
|
+
}
|
7768
|
+
} else {
|
7769
|
+
var lastId = _yArray[numPages - 1];
|
7770
|
+
|
7771
|
+
if (lastId > currentPageNumber) {
|
7772
|
+
return lastId - currentPageNumber + 1;
|
7773
|
+
}
|
7774
|
+
}
|
7775
|
+
|
7776
|
+
break;
|
7777
|
+
}
|
7778
|
+
} catch (err) {
|
7779
|
+
_iterator2.e(err);
|
7780
|
+
} finally {
|
7781
|
+
_iterator2.f();
|
7782
|
+
}
|
7783
|
+
|
7784
|
+
break;
|
7785
|
+
}
|
7786
|
+
|
7787
|
+
case _ui_utils.ScrollMode.HORIZONTAL:
|
7788
|
+
{
|
7789
|
+
break;
|
7790
|
+
}
|
7791
|
+
|
7792
|
+
case _ui_utils.ScrollMode.VERTICAL:
|
7793
|
+
{
|
7794
|
+
if (this._spreadMode === _ui_utils.SpreadMode.NONE) {
|
7795
|
+
break;
|
7796
|
+
}
|
7797
|
+
|
7798
|
+
var parity = this._spreadMode - 1;
|
7799
|
+
|
7800
|
+
if (previous && currentPageNumber % 2 !== parity) {
|
7801
|
+
break;
|
7802
|
+
} else if (!previous && currentPageNumber % 2 === parity) {
|
7803
|
+
break;
|
7804
|
+
}
|
7805
|
+
|
7806
|
+
var _this$_getVisiblePage2 = this._getVisiblePages(),
|
7807
|
+
_views = _this$_getVisiblePage2.views,
|
7808
|
+
_expectedId2 = previous ? currentPageNumber - 1 : currentPageNumber + 1;
|
7809
|
+
|
7810
|
+
var _iterator3 = _createForOfIteratorHelper(_views),
|
7811
|
+
_step3;
|
7812
|
+
|
7813
|
+
try {
|
7814
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
7815
|
+
var _step3$value = _step3.value,
|
7816
|
+
_id = _step3$value.id,
|
7817
|
+
_percent = _step3$value.percent,
|
7818
|
+
_widthPercent = _step3$value.widthPercent;
|
7819
|
+
|
7820
|
+
if (_id !== _expectedId2) {
|
7821
|
+
continue;
|
7822
|
+
}
|
7823
|
+
|
7824
|
+
if (_percent > 0 && _widthPercent === 100) {
|
7825
|
+
return 2;
|
7826
|
+
}
|
7827
|
+
|
7828
|
+
break;
|
7829
|
+
}
|
7830
|
+
} catch (err) {
|
7831
|
+
_iterator3.e(err);
|
7832
|
+
} finally {
|
7833
|
+
_iterator3.f();
|
7834
|
+
}
|
7835
|
+
|
7836
|
+
break;
|
7837
|
+
}
|
7838
|
+
}
|
7839
|
+
|
7840
|
+
return 1;
|
7841
|
+
}
|
7842
|
+
}, {
|
7843
|
+
key: "nextPage",
|
7844
|
+
value: function nextPage() {
|
7845
|
+
var currentPageNumber = this._currentPageNumber,
|
7846
|
+
pagesCount = this.pagesCount;
|
7847
|
+
|
7848
|
+
if (currentPageNumber >= pagesCount) {
|
7849
|
+
return false;
|
7850
|
+
}
|
7851
|
+
|
7852
|
+
var advance = this._getPageAdvance(currentPageNumber, false) || 1;
|
7853
|
+
this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount);
|
7854
|
+
return true;
|
7855
|
+
}
|
7856
|
+
}, {
|
7857
|
+
key: "previousPage",
|
7858
|
+
value: function previousPage() {
|
7859
|
+
var currentPageNumber = this._currentPageNumber;
|
7860
|
+
|
7861
|
+
if (currentPageNumber <= 1) {
|
7862
|
+
return false;
|
7863
|
+
}
|
7864
|
+
|
7865
|
+
var advance = this._getPageAdvance(currentPageNumber, true) || 1;
|
7866
|
+
this.currentPageNumber = Math.max(currentPageNumber - advance, 1);
|
7867
|
+
return true;
|
7868
|
+
}
|
7869
|
+
}, {
|
7870
|
+
key: "initializeScriptingEvents",
|
7871
|
+
value: function initializeScriptingEvents() {
|
7872
|
+
var _this5 = this;
|
7873
|
+
|
7874
|
+
if (!this.enableScripting || this._pageOpenPendingSet) {
|
7875
|
+
return;
|
7876
|
+
}
|
7877
|
+
|
7878
|
+
var eventBus = this.eventBus,
|
7879
|
+
pageOpenPendingSet = this._pageOpenPendingSet = new Set(),
|
7880
|
+
scriptingEvents = this._scriptingEvents || (this._scriptingEvents = Object.create(null));
|
7881
|
+
|
7882
|
+
var dispatchPageClose = function dispatchPageClose(pageNumber) {
|
7883
|
+
if (pageOpenPendingSet.has(pageNumber)) {
|
7884
|
+
return;
|
7885
|
+
}
|
7886
|
+
|
7887
|
+
eventBus.dispatch("pageclose", {
|
7888
|
+
source: _this5,
|
7889
|
+
pageNumber: pageNumber
|
7890
|
+
});
|
7891
|
+
};
|
7892
|
+
|
7893
|
+
var dispatchPageOpen = function dispatchPageOpen(pageNumber) {
|
7894
|
+
var pageView = _this5._pages[pageNumber - 1];
|
7895
|
+
|
7896
|
+
if ((pageView === null || pageView === void 0 ? void 0 : pageView.renderingState) === _pdf_rendering_queue.RenderingStates.FINISHED) {
|
7897
|
+
var _pageView$pdfPage;
|
7898
|
+
|
7899
|
+
pageOpenPendingSet["delete"](pageNumber);
|
7900
|
+
eventBus.dispatch("pageopen", {
|
7901
|
+
source: _this5,
|
7902
|
+
pageNumber: pageNumber,
|
7903
|
+
actionsPromise: (_pageView$pdfPage = pageView.pdfPage) === null || _pageView$pdfPage === void 0 ? void 0 : _pageView$pdfPage.getJSActions()
|
7904
|
+
});
|
7905
|
+
} else {
|
7906
|
+
pageOpenPendingSet.add(pageNumber);
|
7907
|
+
}
|
7908
|
+
};
|
7909
|
+
|
7910
|
+
scriptingEvents.onPageChanging = function (_ref4) {
|
7911
|
+
var pageNumber = _ref4.pageNumber,
|
7912
|
+
previous = _ref4.previous;
|
7913
|
+
|
7914
|
+
if (pageNumber === previous) {
|
7915
|
+
return;
|
7916
|
+
}
|
7917
|
+
|
7918
|
+
dispatchPageClose(previous);
|
7919
|
+
dispatchPageOpen(pageNumber);
|
7920
|
+
};
|
7921
|
+
|
7922
|
+
eventBus._on("pagechanging", scriptingEvents.onPageChanging);
|
7923
|
+
|
7924
|
+
scriptingEvents.onPageRendered = function (_ref5) {
|
7925
|
+
var pageNumber = _ref5.pageNumber;
|
7926
|
+
|
7927
|
+
if (!pageOpenPendingSet.has(pageNumber)) {
|
7928
|
+
return;
|
7929
|
+
}
|
7930
|
+
|
7931
|
+
if (pageNumber !== _this5._currentPageNumber) {
|
7932
|
+
return;
|
7933
|
+
}
|
7934
|
+
|
7935
|
+
dispatchPageOpen(pageNumber);
|
7936
|
+
};
|
7937
|
+
|
7938
|
+
eventBus._on("pagerendered", scriptingEvents.onPageRendered);
|
7939
|
+
|
7940
|
+
scriptingEvents.onPagesDestroy = function () {
|
7941
|
+
dispatchPageClose(_this5._currentPageNumber);
|
7942
|
+
};
|
7943
|
+
|
7944
|
+
eventBus._on("pagesdestroy", scriptingEvents.onPagesDestroy);
|
7945
|
+
|
7946
|
+
dispatchPageOpen(this._currentPageNumber);
|
7947
|
+
}
|
7948
|
+
}, {
|
7949
|
+
key: "_resetScriptingEvents",
|
7950
|
+
value: function _resetScriptingEvents() {
|
7951
|
+
if (!this.enableScripting || !this._pageOpenPendingSet) {
|
7952
|
+
return;
|
7953
|
+
}
|
7954
|
+
|
7955
|
+
var eventBus = this.eventBus,
|
7956
|
+
scriptingEvents = this._scriptingEvents;
|
7957
|
+
|
7958
|
+
eventBus._off("pagechanging", scriptingEvents.onPageChanging);
|
7959
|
+
|
7960
|
+
scriptingEvents.onPageChanging = null;
|
7961
|
+
|
7962
|
+
eventBus._off("pagerendered", scriptingEvents.onPageRendered);
|
7963
|
+
|
7964
|
+
scriptingEvents.onPageRendered = null;
|
7965
|
+
|
7966
|
+
eventBus._off("pagesdestroy", scriptingEvents.onPagesDestroy);
|
7967
|
+
|
7968
|
+
scriptingEvents.onPagesDestroy = null;
|
7969
|
+
this._pageOpenPendingSet = null;
|
7970
|
+
}
|
7450
7971
|
}, {
|
7451
7972
|
key: "pagesCount",
|
7452
7973
|
get: function get() {
|
@@ -7593,11 +8114,25 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
7593
8114
|
get: function get() {
|
7594
8115
|
throw new Error("Not implemented: _viewerElement");
|
7595
8116
|
}
|
8117
|
+
}, {
|
8118
|
+
key: "_pageWidthScaleFactor",
|
8119
|
+
get: function get() {
|
8120
|
+
if (this.spreadMode !== _ui_utils.SpreadMode.NONE && this.scrollMode !== _ui_utils.ScrollMode.HORIZONTAL && !this.isInPresentationMode) {
|
8121
|
+
return 2;
|
8122
|
+
}
|
8123
|
+
|
8124
|
+
return 1;
|
8125
|
+
}
|
7596
8126
|
}, {
|
7597
8127
|
key: "_isScrollModeHorizontal",
|
7598
8128
|
get: function get() {
|
7599
8129
|
return this.isInPresentationMode ? false : this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL;
|
7600
8130
|
}
|
8131
|
+
}, {
|
8132
|
+
key: "_isContainerRtl",
|
8133
|
+
get: function get() {
|
8134
|
+
return getComputedStyle(this.container).direction === "rtl";
|
8135
|
+
}
|
7601
8136
|
}, {
|
7602
8137
|
key: "isInPresentationMode",
|
7603
8138
|
get: function get() {
|
@@ -7661,18 +8196,18 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
7661
8196
|
|
7662
8197
|
this._optionalContentConfigPromise = promise;
|
7663
8198
|
|
7664
|
-
var
|
7665
|
-
|
8199
|
+
var _iterator4 = _createForOfIteratorHelper(this._pages),
|
8200
|
+
_step4;
|
7666
8201
|
|
7667
8202
|
try {
|
7668
|
-
for (
|
7669
|
-
var pageView =
|
8203
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
8204
|
+
var pageView = _step4.value;
|
7670
8205
|
pageView.update(pageView.scale, pageView.rotation, promise);
|
7671
8206
|
}
|
7672
8207
|
} catch (err) {
|
7673
|
-
|
8208
|
+
_iterator4.e(err);
|
7674
8209
|
} finally {
|
7675
|
-
|
8210
|
+
_iterator4.f();
|
7676
8211
|
}
|
7677
8212
|
|
7678
8213
|
this.update();
|
@@ -7733,22 +8268,23 @@ var BaseViewer = /*#__PURE__*/function () {
|
|
7733
8268
|
exports.BaseViewer = BaseViewer;
|
7734
8269
|
|
7735
8270
|
/***/ }),
|
7736
|
-
/*
|
7737
|
-
/***/ (
|
8271
|
+
/* 19 */
|
8272
|
+
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
|
8273
|
+
|
7738
8274
|
|
7739
|
-
"use strict";
|
7740
8275
|
|
8276
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
7741
8277
|
|
7742
|
-
Object.defineProperty(exports, "__esModule", {
|
8278
|
+
Object.defineProperty(exports, "__esModule", ({
|
7743
8279
|
value: true
|
7744
|
-
});
|
8280
|
+
}));
|
7745
8281
|
exports.PDFViewer = void 0;
|
7746
8282
|
|
7747
|
-
var
|
8283
|
+
var _ui_utils = __w_pdfjs_require__(3);
|
7748
8284
|
|
7749
|
-
var
|
8285
|
+
var _base_viewer = __w_pdfjs_require__(18);
|
7750
8286
|
|
7751
|
-
|
8287
|
+
var _pdfjsLib = __w_pdfjs_require__(2);
|
7752
8288
|
|
7753
8289
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
7754
8290
|
|
@@ -7851,7 +8387,7 @@ var PDFViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
7851
8387
|
break;
|
7852
8388
|
}
|
7853
8389
|
|
7854
|
-
if (page.id === currentId) {
|
8390
|
+
if (page.id === currentId && this._scrollMode === _ui_utils.ScrollMode.VERTICAL && this._spreadMode === _ui_utils.SpreadMode.NONE) {
|
7855
8391
|
stillFullyVisible = true;
|
7856
8392
|
break;
|
7857
8393
|
}
|
@@ -7881,6 +8417,50 @@ var PDFViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
7881
8417
|
exports.PDFViewer = PDFViewer;
|
7882
8418
|
|
7883
8419
|
/***/ })
|
7884
|
-
/******/
|
8420
|
+
/******/ ]);
|
8421
|
+
/************************************************************************/
|
8422
|
+
/******/ // The module cache
|
8423
|
+
/******/ var __webpack_module_cache__ = {};
|
8424
|
+
/******/
|
8425
|
+
/******/ // The require function
|
8426
|
+
/******/ function __w_pdfjs_require__(moduleId) {
|
8427
|
+
/******/ // Check if module is in cache
|
8428
|
+
/******/ if(__webpack_module_cache__[moduleId]) {
|
8429
|
+
/******/ return __webpack_module_cache__[moduleId].exports;
|
8430
|
+
/******/ }
|
8431
|
+
/******/ // Create a new module (and put it into the cache)
|
8432
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
8433
|
+
/******/ id: moduleId,
|
8434
|
+
/******/ loaded: false,
|
8435
|
+
/******/ exports: {}
|
8436
|
+
/******/ };
|
8437
|
+
/******/
|
8438
|
+
/******/ // Execute the module function
|
8439
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __w_pdfjs_require__);
|
8440
|
+
/******/
|
8441
|
+
/******/ // Flag the module as loaded
|
8442
|
+
/******/ module.loaded = true;
|
8443
|
+
/******/
|
8444
|
+
/******/ // Return the exports of the module
|
8445
|
+
/******/ return module.exports;
|
8446
|
+
/******/ }
|
8447
|
+
/******/
|
8448
|
+
/************************************************************************/
|
8449
|
+
/******/ /* webpack/runtime/node module decorator */
|
8450
|
+
/******/ (() => {
|
8451
|
+
/******/ __w_pdfjs_require__.nmd = (module) => {
|
8452
|
+
/******/ module.paths = [];
|
8453
|
+
/******/ if (!module.children) module.children = [];
|
8454
|
+
/******/ return module;
|
8455
|
+
/******/ };
|
8456
|
+
/******/ })();
|
8457
|
+
/******/
|
8458
|
+
/************************************************************************/
|
8459
|
+
/******/ // module exports must be returned from runtime so entry inlining is disabled
|
8460
|
+
/******/ // startup
|
8461
|
+
/******/ // Load entry module and return exports
|
8462
|
+
/******/ return __w_pdfjs_require__(0);
|
8463
|
+
/******/ })()
|
8464
|
+
;
|
7885
8465
|
});
|
7886
8466
|
//# sourceMappingURL=pdf_viewer.js.map
|