@vertexvis/doc-viewer 1.0.2-testing.4 → 1.0.2-testing.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/cjs/vertex-document-viewer.cjs.entry.js +81 -268
  2. package/dist/components/vertex-document-viewer.js +2 -2
  3. package/dist/doc-viewer/doc-viewer.esm.js +1 -1
  4. package/dist/doc-viewer/p-49c08e34.entry.js +25 -0
  5. package/dist/esm/vertex-document-viewer.entry.js +81 -268
  6. package/dist/types/__mocks__/pdfjs-mock.d.ts +1 -0
  7. package/dist/types/__setup__/polyfills.d.ts +1 -0
  8. package/dist/types/__setup__/resize-observer.d.ts +1 -0
  9. package/dist/types/components/document-viewer/document-viewer.d.ts +1 -0
  10. package/dist/types/index.d.ts +1 -0
  11. package/dist/types/lib/config.d.ts +1 -0
  12. package/dist/types/lib/document/api.d.ts +1 -0
  13. package/dist/types/lib/document/layers/controller.d.ts +1 -0
  14. package/dist/types/lib/document/layers/index.d.ts +1 -0
  15. package/dist/types/lib/document/layers/types.d.ts +1 -0
  16. package/dist/types/lib/document/provider.d.ts +1 -0
  17. package/dist/types/lib/document/renderer.d.ts +1 -0
  18. package/dist/types/lib/dom.d.ts +1 -0
  19. package/dist/types/lib/index.d.ts +1 -0
  20. package/dist/types/lib/interactions/pan-interaction-handler.d.ts +1 -0
  21. package/dist/types/lib/pdf/pdfjs-api.d.ts +1 -0
  22. package/dist/types/lib/pdf/pdfjs-provider.d.ts +1 -0
  23. package/dist/types/lib/pdf/pdfjs-renderer.d.ts +1 -0
  24. package/dist/types/lib/types/loadableResource.d.ts +1 -0
  25. package/dist/types/polyfill/index.d.ts +1 -0
  26. package/dist/types/polyfill/resize-observer.d.ts +1 -0
  27. package/dist/types/testing/mock-document-api.d.ts +1 -0
  28. package/package.json +6 -6
  29. package/dist/doc-viewer/p-d55c9d5e.entry.js +0 -25
@@ -7,91 +7,6 @@ function getDefaultExportFromCjs (x) {
7
7
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
8
8
  }
9
9
 
10
- /******************************************************************************
11
- Copyright (c) Microsoft Corporation.
12
-
13
- Permission to use, copy, modify, and/or distribute this software for any
14
- purpose with or without fee is hereby granted.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
17
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
19
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
20
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
21
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
- PERFORMANCE OF THIS SOFTWARE.
23
- ***************************************************************************** */
24
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
25
-
26
- var extendStatics = function(d, b) {
27
- extendStatics = Object.setPrototypeOf ||
28
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
29
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
30
- return extendStatics(d, b);
31
- };
32
-
33
- function __extends(d, b) {
34
- if (typeof b !== "function" && b !== null)
35
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
36
- extendStatics(d, b);
37
- function __() { this.constructor = d; }
38
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
39
- }
40
-
41
- var __assign = function() {
42
- __assign = Object.assign || function __assign(t) {
43
- for (var s, i = 1, n = arguments.length; i < n; i++) {
44
- s = arguments[i];
45
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
46
- }
47
- return t;
48
- };
49
- return __assign.apply(this, arguments);
50
- };
51
-
52
- function __awaiter(thisArg, _arguments, P, generator) {
53
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
54
- return new (P || (P = Promise))(function (resolve, reject) {
55
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
56
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
57
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
58
- step((generator = generator.apply(thisArg, _arguments || [])).next());
59
- });
60
- }
61
-
62
- function __generator(thisArg, body) {
63
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
64
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
65
- function verb(n) { return function (v) { return step([n, v]); }; }
66
- function step(op) {
67
- if (f) throw new TypeError("Generator is already executing.");
68
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
69
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
70
- if (y = 0, t) op = [op[0] & 2, t.value];
71
- switch (op[0]) {
72
- case 0: case 1: t = op; break;
73
- case 4: _.label++; return { value: op[1], done: false };
74
- case 5: _.label++; y = op[1]; op = [0]; continue;
75
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
76
- default:
77
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
78
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
79
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
80
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
81
- if (t[2]) _.ops.pop();
82
- _.trys.pop(); continue;
83
- }
84
- op = body.call(thisArg, _);
85
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
86
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
87
- }
88
- }
89
-
90
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
91
- var e = new Error(message);
92
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
93
- };
94
-
95
10
  /**
96
11
  * Clamps the given value between `min` and `max`.
97
12
  *
@@ -121,24 +36,22 @@ function lerp$2(a, b, t) {
121
36
  /**
122
37
  * Returns a new `Point` with the given horizontal and vertical position.
123
38
  */
124
- function create$d(x, y) {
125
- if (x === void 0) { x = 0; }
126
- if (y === void 0) { y = 0; }
127
- return { x: x, y: y };
39
+ function create$d(x = 0, y = 0) {
40
+ return { x, y };
128
41
  }
129
42
  /**
130
43
  * Converts a polar coordinate (length and angle) into a Cartesian coordinate.
131
44
  */
132
45
  function polar(length, radians) {
133
- var x = Math.cos(radians) * length;
134
- var y = Math.sin(radians) * length;
46
+ const x = Math.cos(radians) * length;
47
+ const y = Math.sin(radians) * length;
135
48
  return create$d(x, y);
136
49
  }
137
50
  /**
138
51
  * Returns the distance between two points.
139
52
  */
140
53
  function distance$2(a, b) {
141
- var delta = subtract$1(a, b);
54
+ const delta = subtract$1(a, b);
142
55
  return Math.sqrt(delta.x * delta.x + delta.y * delta.y);
143
56
  }
144
57
  /**
@@ -210,7 +123,7 @@ function magnitude$2(pt) {
210
123
  * Transforms a vector into the corresponding normal (unit) vector.
211
124
  */
212
125
  function normalizeVector(pt) {
213
- var magnitudeOfPoint = magnitude$2(pt);
126
+ const magnitudeOfPoint = magnitude$2(pt);
214
127
  if (magnitudeOfPoint === 0) {
215
128
  return create$d(0, 0);
216
129
  }
@@ -228,19 +141,19 @@ function normalDirectionVector(ptA, ptB) {
228
141
  * Returns a vector orthogonal to the vector between the two given points.
229
142
  */
230
143
  function orthogonalVector(ptA, ptB) {
231
- var unitVectorBetweenPoints = normalDirectionVector(ptA, ptB);
144
+ const unitVectorBetweenPoints = normalDirectionVector(ptA, ptB);
232
145
  // Handle vectors that are parallel to the x or y axis
233
146
  if (unitVectorBetweenPoints.x === 0 || unitVectorBetweenPoints.y === 0) {
234
147
  return create$d(-1 * unitVectorBetweenPoints.y, unitVectorBetweenPoints.x);
235
148
  }
236
149
  if (Math.abs(unitVectorBetweenPoints.x) > Math.abs(unitVectorBetweenPoints.y)) {
237
- var vectorXValue = 1 - Math.pow(unitVectorBetweenPoints.x, 2);
238
- var vectorYValue = -1 * unitVectorBetweenPoints.x * unitVectorBetweenPoints.y;
150
+ const vectorXValue = 1 - Math.pow(unitVectorBetweenPoints.x, 2);
151
+ const vectorYValue = -1 * unitVectorBetweenPoints.x * unitVectorBetweenPoints.y;
239
152
  return normalizeVector(create$d(vectorXValue, vectorYValue));
240
153
  }
241
154
  else {
242
- var vectorXValue = -1 * unitVectorBetweenPoints.x * unitVectorBetweenPoints.y;
243
- var vectorYValue = 1 - Math.pow(unitVectorBetweenPoints.y, 2);
155
+ const vectorXValue = -1 * unitVectorBetweenPoints.x * unitVectorBetweenPoints.y;
156
+ const vectorYValue = 1 - Math.pow(unitVectorBetweenPoints.y, 2);
244
157
  return normalizeVector(create$d(vectorXValue, vectorYValue));
245
158
  }
246
159
  }
@@ -251,13 +164,13 @@ function orthogonalVector(ptA, ptB) {
251
164
  * @returns A parsed Point.
252
165
  */
253
166
  function fromJson$5(json) {
254
- var obj = JSON.parse(json);
167
+ const obj = JSON.parse(json);
255
168
  if (Array.isArray(obj)) {
256
- var x = obj[0], y = obj[1];
169
+ const [x, y] = obj;
257
170
  return create$d(x, y);
258
171
  }
259
172
  else {
260
- var x = obj.x, y = obj.y;
173
+ const { x, y } = obj;
261
174
  return create$d(x, y);
262
175
  }
263
176
  }
@@ -285,7 +198,7 @@ var point = /*#__PURE__*/Object.freeze({
285
198
  * Returns a new `Rectangle` with the given position and size.
286
199
  */
287
200
  function create$7(x, y, width, height) {
288
- return { x: x, y: y, width: width, height: height };
201
+ return { x, y, width, height };
289
202
  }
290
203
  /**
291
204
  * Returns a new `Rectangle` with the given position and size.
@@ -302,9 +215,9 @@ function fromPointAndDimensions(point, dimensions) {
302
215
  * @see {@link cropFit}
303
216
  */
304
217
  function containFit$1(to, rect) {
305
- var scale = Math.min(to.width / rect.width, to.height / rect.height);
306
- var dimensions$1 = proportionalScale(scale, rect);
307
- var position = subtract$1(center$2(to), center$1(dimensions$1));
218
+ const scale = Math.min(to.width / rect.width, to.height / rect.height);
219
+ const dimensions$1 = proportionalScale(scale, rect);
220
+ const position = subtract$1(center$2(to), center$1(dimensions$1));
308
221
  return fromPointAndDimensions(position, dimensions$1);
309
222
  }
310
223
  /**
@@ -316,9 +229,9 @@ function containFit$1(to, rect) {
316
229
  * @see {@link containFit}
317
230
  */
318
231
  function cropFit$1(to, rect) {
319
- var scale = Math.max(to.width / rect.width, to.height / rect.height);
320
- var dimensions$1 = proportionalScale(scale, rect);
321
- var position = subtract$1(center$2(to), center$1(dimensions$1));
232
+ const scale = Math.max(to.width / rect.width, to.height / rect.height);
233
+ const dimensions$1 = proportionalScale(scale, rect);
234
+ const position = subtract$1(center$2(to), center$1(dimensions$1));
322
235
  return fromPointAndDimensions(position, dimensions$1);
323
236
  }
324
237
  /**
@@ -330,9 +243,9 @@ function cropFit$1(to, rect) {
330
243
  * @param rect - the rectangle to scale to fit the specified area
331
244
  */
332
245
  function scaleFit$1(to, rect) {
333
- var scale = Math.min(Math.sqrt(to / area$1(rect)), 1);
334
- var dimensions$1 = floor$1(proportionalScale(scale, rect));
335
- var position = subtract$1(center$2(rect), center$1(dimensions$1));
246
+ const scale = Math.min(Math.sqrt(to / area$1(rect)), 1);
247
+ const dimensions$1 = floor$1(proportionalScale(scale, rect));
248
+ const position = subtract$1(center$2(rect), center$1(dimensions$1));
336
249
  return fromPointAndDimensions(position, dimensions$1);
337
250
  }
338
251
  /**
@@ -352,27 +265,27 @@ function center$2(rect) {
352
265
  * Returns a `Dimensions` with the given width and height.
353
266
  *
354
267
  */
355
- var create$6 = function (width, height) {
356
- return { width: width, height: height };
268
+ const create$6 = (width, height) => {
269
+ return { width, height };
357
270
  };
358
271
  /**
359
272
  * Returns a `Dimensions` with the same width and height.
360
273
  */
361
- var square = function (size) {
274
+ const square = (size) => {
362
275
  return create$6(size, size);
363
276
  };
364
277
  /**
365
278
  * Returns `true` if two dimensions have the same width and height. Otherwise
366
279
  * `false`.
367
280
  */
368
- var isEqual = function (a, b) {
281
+ const isEqual = (a, b) => {
369
282
  return a.width === b.width && a.height === b.height;
370
283
  };
371
284
  /**
372
285
  * Returns a scaled dimensions, where the width is scaled by `scaleX` and height
373
286
  * is scaled by `scaleY`.
374
287
  */
375
- var scale = function (scaleX, scaleY, dimensions) {
288
+ const scale = (scaleX, scaleY, dimensions) => {
376
289
  return {
377
290
  width: dimensions.width * scaleX,
378
291
  height: dimensions.height * scaleY,
@@ -381,14 +294,14 @@ var scale = function (scaleX, scaleY, dimensions) {
381
294
  /**
382
295
  * Returns a dimension where each length is scaled by `scaleFactor`.
383
296
  */
384
- var proportionalScale = function (scaleFactor, dimensions) {
297
+ const proportionalScale = (scaleFactor, dimensions) => {
385
298
  return scale(scaleFactor, scaleFactor, dimensions);
386
299
  };
387
300
  /**
388
301
  * Returns a `Dimensions` where the lengths of `dimensions` are trimmed to fit
389
302
  * into `to`.
390
303
  */
391
- var trim = function (to, dimensions) {
304
+ const trim = (to, dimensions) => {
392
305
  return {
393
306
  width: Math.min(to.width, dimensions.width),
394
307
  height: Math.min(to.height, dimensions.height),
@@ -401,9 +314,9 @@ var trim = function (to, dimensions) {
401
314
  *
402
315
  * @see #cropFit()
403
316
  */
404
- var containFit = function (to, dimensions) {
405
- var _a = containFit$1(toRectangle(to), toRectangle(dimensions)), width = _a.width, height = _a.height;
406
- return { width: width, height: height };
317
+ const containFit = (to, dimensions) => {
318
+ const { width, height } = containFit$1(toRectangle(to), toRectangle(dimensions));
319
+ return { width, height };
407
320
  };
408
321
  /**
409
322
  * Returns a `Dimensions` where the shortest length of `dimensions` will be
@@ -412,9 +325,9 @@ var containFit = function (to, dimensions) {
412
325
  *
413
326
  * @see #containFit()
414
327
  */
415
- var cropFit = function (to, dimensions) {
416
- var _a = cropFit$1(toRectangle(to), toRectangle(dimensions)), width = _a.width, height = _a.height;
417
- return { width: width, height: height };
328
+ const cropFit = (to, dimensions) => {
329
+ const { width, height } = cropFit$1(toRectangle(to), toRectangle(dimensions));
330
+ return { width, height };
418
331
  };
419
332
  /**
420
333
  * Returns a `Dimensions` where each side of `dimensions` will be reduced proportionally
@@ -424,14 +337,14 @@ var cropFit = function (to, dimensions) {
424
337
  * @param to - the maximum area this dimensions can have
425
338
  * @param dimensions - the dimensions to scale to fit the specified area
426
339
  */
427
- var scaleFit = function (to, dimensions) {
428
- var _a = scaleFit$1(to, toRectangle(dimensions)), width = _a.width, height = _a.height;
429
- return { width: width, height: height };
340
+ const scaleFit = (to, dimensions) => {
341
+ const { width, height } = scaleFit$1(to, toRectangle(dimensions));
342
+ return { width, height };
430
343
  };
431
344
  /**
432
345
  * Returns a `Dimensions` with each length rounded.
433
346
  */
434
- var round = function (dimensions) {
347
+ const round = (dimensions) => {
435
348
  return {
436
349
  width: Math.round(dimensions.width),
437
350
  height: Math.round(dimensions.height),
@@ -440,7 +353,7 @@ var round = function (dimensions) {
440
353
  /**
441
354
  * Returns a `Dimensions` with each length rounded down.
442
355
  */
443
- var floor$1 = function (dimensions) {
356
+ const floor$1 = (dimensions) => {
444
357
  return {
445
358
  width: Math.floor(dimensions.width),
446
359
  height: Math.floor(dimensions.height),
@@ -449,22 +362,20 @@ var floor$1 = function (dimensions) {
449
362
  /**
450
363
  * Returns the center point of the given `dimensions`.
451
364
  */
452
- var center$1 = function (dimensions) {
365
+ const center$1 = (dimensions) => {
453
366
  return { x: dimensions.width / 2, y: dimensions.height / 2 };
454
367
  };
455
368
  /**
456
369
  * Returns the aspect ratio of the given `dimensions`, as defined by width over
457
370
  * height.
458
371
  */
459
- var aspectRatio = function (_a) {
460
- var width = _a.width, height = _a.height;
372
+ const aspectRatio = ({ width, height }) => {
461
373
  return width / height;
462
374
  };
463
375
  /**
464
376
  * Returns the area of the given `dimensions`.
465
377
  */
466
- var area = function (_a) {
467
- var width = _a.width, height = _a.height;
378
+ const area = ({ width, height }) => {
468
379
  return width * height;
469
380
  };
470
381
  /**
@@ -473,7 +384,7 @@ var area = function (_a) {
473
384
  * @param ratio - Aspect ratio to fit the provided Dimensions to
474
385
  * @param dimensions - Dimensions to fit to the specified ratio
475
386
  */
476
- var fitToRatio = function (ratio, dimensions) {
387
+ const fitToRatio = (ratio, dimensions) => {
477
388
  if (dimensions.width >= dimensions.height * ratio) {
478
389
  return create$6(dimensions.height * ratio, dimensions.height);
479
390
  }
@@ -482,8 +393,7 @@ var fitToRatio = function (ratio, dimensions) {
482
393
  /**
483
394
  * Converts a dimension to a rectangle, with an optional position.
484
395
  */
485
- function toRectangle(dimensions, position) {
486
- if (position === void 0) { position = create$d(); }
396
+ function toRectangle(dimensions, position = create$d()) {
487
397
  return fromPointAndDimensions(position, dimensions);
488
398
  }
489
399
 
@@ -34196,153 +34106,56 @@ globalThis.pdfjsLib = {
34196
34106
  XfaLayer: XfaLayer
34197
34107
  };
34198
34108
 
34199
- /**
34200
- * A module for defining functional schemas to map between different types. This
34201
- * module is useful for parsing to or from JSON/protobufs to domain types.
34202
- *
34203
- * Mappers support greedy validation, so all validation errors are aggregated
34204
- * and reported vs failing on the first invalid input.
34205
- *
34206
- * @example
34207
- *
34208
- * ```ts
34209
- * import { Mapper as M } from '@vertexvis/utils';
34210
- *
34211
- * interface Address {
34212
- * address: string;
34213
- * city: string;
34214
- * state: string;
34215
- * zip: string;
34216
- * }
34217
- *
34218
- * interface Person {
34219
- * name: string;
34220
- * addresses: Address[];
34221
- * }
34222
- *
34223
- * type AddressJson = Partial<Address>;
34224
- * type PersonJson = {
34225
- * name?: string;
34226
- * addresses?: AddressJson[];
34227
- * }
34228
- *
34229
- * const mapAddress: M.Func<AddressJson, Address> = M.defineMapper(
34230
- * M.read(
34231
- * M.requireProp('address'),
34232
- * M.requireProp('city'),
34233
- * M.requireProp('state'),
34234
- * M.requireProp('zip')
34235
- * ),
34236
- * ([address, city, state, zip]) => ({
34237
- * address, city, state, zip
34238
- * })
34239
- * );
34240
- *
34241
- * const mapPerson: M.Func<PersonJson, Person> = M.defineMapper(
34242
- * M.read(
34243
- * M.requireProp('name'),
34244
- * M.mapProp(
34245
- * 'addresses',
34246
- * M.compose(M.required('addresses'), M.mapArray(mapAddress))
34247
- * )
34248
- * ),
34249
- * ([name, addresses]) => ({ name, addresses })
34250
- * );
34251
- *
34252
- * const person = mapPerson({
34253
- * name: 'John',
34254
- * addresses: [{ address: '123', city: 'Ames', state: 'IA', zip: '50010' }]
34255
- * });
34256
- *
34257
- * const invalidPerson = mapPerson({
34258
- * addresses: [{ city: 'Ames', state: 'IA', zip: '50010' }]
34259
- * });
34260
- * ```
34261
- * // {
34262
- * // errors: ["Name is required.", "Address is required."]
34263
- * // }
34264
- *
34265
- * @module
34266
- */
34267
- /**
34268
- * An error that is thrown when validation of a schema fails.
34269
- *
34270
- * @see {@link ifInvalidThrow} - for throwing errors on invalid input.
34271
- */
34272
- /** @class */ ((function (_super) {
34273
- __extends(MapperValidationError, _super);
34274
- function MapperValidationError(errors) {
34275
- var _this = _super.call(this, 'Validation error mapping object.') || this;
34276
- _this.errors = errors;
34277
- Object.setPrototypeOf(_this, MapperValidationError.prototype);
34278
- return _this;
34279
- }
34280
- return MapperValidationError;
34281
- })(Error));
34282
-
34283
- var EventDispatcher = /** @class */ (function () {
34284
- function EventDispatcher() {
34109
+ class EventDispatcher {
34110
+ constructor() {
34285
34111
  this.listeners = [];
34286
34112
  }
34287
- EventDispatcher.prototype.on = function (listener, opts) {
34288
- var _this = this;
34113
+ on(listener, opts = {}) {
34289
34114
  var _a;
34290
- if (opts === void 0) { opts = {}; }
34291
34115
  this.listeners.push(listener);
34292
- var controller = new AbortController();
34293
- controller.signal.addEventListener('abort', function () { return _this.off(listener); });
34294
- (_a = opts.abort) === null || _a === void 0 ? void 0 : _a.addEventListener('abort', function () { return controller.abort(); });
34295
- return { dispose: function () { return controller.abort(); } };
34296
- };
34297
- EventDispatcher.prototype.once = function (opts) {
34298
- var _this = this;
34299
- if (opts === void 0) { opts = {}; }
34300
- return new Promise(function (resolve) {
34301
- var subscription = _this.on(function (event) {
34116
+ const controller = new AbortController();
34117
+ controller.signal.addEventListener('abort', () => this.off(listener));
34118
+ (_a = opts.abort) === null || _a === void 0 ? void 0 : _a.addEventListener('abort', () => controller.abort());
34119
+ return { dispose: () => controller.abort() };
34120
+ }
34121
+ once(opts = {}) {
34122
+ return new Promise((resolve) => {
34123
+ const subscription = this.on((event) => {
34302
34124
  subscription.dispose();
34303
34125
  resolve(event);
34304
34126
  }, opts);
34305
34127
  });
34306
- };
34307
- EventDispatcher.prototype.onceWhen = function (predicate_1) {
34308
- return __awaiter(this, arguments, Promise, function (predicate, opts) {
34309
- var controller;
34310
- var _this = this;
34311
- var _a;
34312
- if (opts === void 0) { opts = {}; }
34313
- return __generator(this, function (_b) {
34314
- controller = new AbortController();
34315
- (_a = opts.abort) === null || _a === void 0 ? void 0 : _a.addEventListener('abort', function () { return controller.abort(); });
34316
- return [2 /*return*/, new Promise(function (resolve) {
34317
- _this.when(predicate, function (event) {
34318
- if (predicate(event)) {
34319
- controller.abort();
34320
- resolve(event);
34321
- }
34322
- }, __assign(__assign({}, opts), { abort: controller.signal }));
34323
- })];
34324
- });
34128
+ }
34129
+ async onceWhen(predicate, opts = {}) {
34130
+ var _a;
34131
+ const controller = new AbortController();
34132
+ (_a = opts.abort) === null || _a === void 0 ? void 0 : _a.addEventListener('abort', () => controller.abort());
34133
+ return new Promise((resolve) => {
34134
+ this.when(predicate, (event) => {
34135
+ if (predicate(event)) {
34136
+ controller.abort();
34137
+ resolve(event);
34138
+ }
34139
+ }, { ...opts, abort: controller.signal });
34325
34140
  });
34326
- };
34327
- EventDispatcher.prototype.when = function (predicate, listener, opts) {
34328
- if (opts === void 0) { opts = {}; }
34329
- return this.on(function (event) {
34141
+ }
34142
+ when(predicate, listener, opts = {}) {
34143
+ return this.on((event) => {
34330
34144
  if (predicate(event)) {
34331
34145
  listener(event);
34332
34146
  }
34333
34147
  }, opts);
34334
- };
34335
- EventDispatcher.prototype.off = function (listener) {
34336
- var index = this.listeners.indexOf(listener);
34148
+ }
34149
+ off(listener) {
34150
+ const index = this.listeners.indexOf(listener);
34337
34151
  if (index !== -1) {
34338
34152
  this.listeners.splice(index, 1);
34339
34153
  }
34340
- };
34341
- EventDispatcher.prototype.emit = function (event) {
34342
- this.listeners.forEach(function (listener) { return listener(event); });
34343
- };
34344
- return EventDispatcher;
34345
- }());
34154
+ }
34155
+ emit(event) {
34156
+ this.listeners.forEach((listener) => listener(event));
34157
+ }
34158
+ }
34346
34159
 
34347
34160
  const MAX_ZOOM_PERCENTAGE = 600;
34348
34161
  const MIN_ZOOM_PERCENTAGE = 10;
@@ -28,3 +28,4 @@ export declare const GlobalWorkerOptions: {
28
28
  workerSrc: string;
29
29
  };
30
30
  export declare const getDocument: jest.Mock<any, [], any>;
31
+ //# sourceMappingURL=pdfjs-mock.d.ts.map
@@ -1 +1,2 @@
1
1
  import 'abortcontroller-polyfill/dist/polyfill-patch-fetch';
2
+ //# sourceMappingURL=polyfills.d.ts.map
@@ -1 +1,2 @@
1
1
  export declare const triggerResizeObserver: jest.Mock<any, any, any>;
2
+ //# sourceMappingURL=resize-observer.d.ts.map
@@ -148,3 +148,4 @@ export declare class VertexDocumentViewer implements BasicViewer {
148
148
  private registerSlotChangeListeners;
149
149
  private injectViewerApi;
150
150
  }
151
+ //# sourceMappingURL=document-viewer.d.ts.map
@@ -1,2 +1,3 @@
1
1
  export * from './components';
2
2
  export * from './lib';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -6,3 +6,4 @@ export interface Config {
6
6
  pdfJs: PdfJsConfig;
7
7
  }
8
8
  export type PartialConfig = DeepPartial<Config>;
9
+ //# sourceMappingURL=config.d.ts.map
@@ -49,3 +49,4 @@ export declare abstract class DocumentApi<T extends DocumentApiState = DocumentA
49
49
  abstract load(uri: string): Promise<void>;
50
50
  abstract loadPage(pageNumber: number): Promise<void>;
51
51
  }
52
+ //# sourceMappingURL=api.d.ts.map
@@ -24,3 +24,4 @@ export declare class DocumentLayersController {
24
24
  setLayerVisibility(id: string, visible: boolean): Promise<void>;
25
25
  private getApi;
26
26
  }
27
+ //# sourceMappingURL=controller.d.ts.map
@@ -1,2 +1,3 @@
1
1
  export * from './controller';
2
2
  export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -13,3 +13,4 @@ export type LayerSupportedApi = DocumentApi & LayerSupport;
13
13
  * Returns a boolean indicating whether the provided document API supports layers.
14
14
  */
15
15
  export declare function apiSupportsLayers(api: DocumentApi): api is LayerSupportedApi;
16
+ //# sourceMappingURL=types.d.ts.map
@@ -14,3 +14,4 @@ export interface DocumentInterface {
14
14
  export interface DocumentProvider {
15
15
  create(canvas: HTMLCanvasElement, config?: Config): DocumentInterface;
16
16
  }
17
+ //# sourceMappingURL=provider.d.ts.map
@@ -14,3 +14,4 @@ export declare abstract class DocumentRenderer implements Disposable {
14
14
  onPageDrawn(listener: Listener<DocumentApiState>): Disposable;
15
15
  abstract dispose(): void | Promise<void>;
16
16
  }
17
+ //# sourceMappingURL=renderer.d.ts.map
@@ -1,3 +1,4 @@
1
1
  export declare function getElementBoundingClientRect(element: HTMLElement): ClientRect;
2
2
  export declare function createElement<T extends HTMLElement>(tagName: string): T;
3
3
  export declare function getAllVertexElementChildren(element: Element): Element[];
4
+ //# sourceMappingURL=dom.d.ts.map
@@ -1 +1,2 @@
1
1
  export * from './config';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -15,3 +15,4 @@ export declare class PanInteractionHandler implements Disposable {
15
15
  private handlePointerUp;
16
16
  private removeWindowListeners;
17
17
  }
18
+ //# sourceMappingURL=pan-interaction-handler.d.ts.map
@@ -17,3 +17,4 @@ export declare class PdfJsApi extends DocumentApi<PdfJsApiState> implements Laye
17
17
  getLayers(): DocumentLayer[];
18
18
  setLayerVisibility(id: string, visible: boolean): void;
19
19
  }
20
+ //# sourceMappingURL=pdfjs-api.d.ts.map
@@ -8,3 +8,4 @@ export declare class PdfJsProvider implements DocumentProvider {
8
8
  renderer: DocumentRenderer;
9
9
  };
10
10
  }
11
+ //# sourceMappingURL=pdfjs-provider.d.ts.map
@@ -9,3 +9,4 @@ export declare class PdfJsRenderer extends DocumentRenderer {
9
9
  private handleStateChanged;
10
10
  private renderPage;
11
11
  }
12
+ //# sourceMappingURL=pdfjs-renderer.d.ts.map
@@ -9,3 +9,4 @@ export interface Resource {
9
9
  export declare function fromUri(uri: string): Resource;
10
10
  export declare function fromUrl(url: string): Resource;
11
11
  export {};
12
+ //# sourceMappingURL=loadableResource.d.ts.map
@@ -1 +1,2 @@
1
1
  export default function (): void;
2
+ //# sourceMappingURL=index.d.ts.map