vue-book-reader 1.2.2 → 1.2.4

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.
@@ -1,1357 +0,0 @@
1
- "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- require('./index.css');const vue = require("vue");
4
- function keyListener(el, fn) {
5
- el.addEventListener(
6
- "keyup",
7
- (e) => {
8
- if (e.key === "ArrowUp" || e.key === "ArrowRight") {
9
- fn("next");
10
- } else if (e.key === "ArrowDown" || e.key === "ArrowLeft") {
11
- fn("prev");
12
- }
13
- },
14
- false
15
- );
16
- }
17
- function wheelListener(el, fn) {
18
- const threshold = 750;
19
- const allowedTime = 50;
20
- let dist = 0;
21
- let isScrolling;
22
- el.addEventListener("wheel", (e) => {
23
- if (e.ignore) return;
24
- e.ignore = true;
25
- clearTimeout(isScrolling);
26
- dist += e.deltaY;
27
- isScrolling = setTimeout(() => {
28
- if (Math.abs(dist) >= threshold) {
29
- let direction = Math.sign(dist) > 0 ? "next" : "prev";
30
- fn(direction);
31
- dist = 0;
32
- }
33
- dist = 0;
34
- }, allowedTime);
35
- });
36
- }
37
- function swipListener(document2, fn) {
38
- const threshold = 50;
39
- const allowedTime = 500;
40
- const restraint = 200;
41
- let startX;
42
- let startY;
43
- let startTime;
44
- document2.addEventListener(
45
- "touchstart",
46
- (e) => {
47
- if (e.ignore) return;
48
- e.ignore = true;
49
- startX = e.changedTouches[0].pageX;
50
- startY = e.changedTouches[0].pageY;
51
- startTime = Date.now();
52
- },
53
- false
54
- );
55
- document2.addEventListener(
56
- "touchend",
57
- (e) => {
58
- var _a, _b;
59
- if (e.ignore) return;
60
- e.ignore = true;
61
- const distX = e.changedTouches[0].pageX - startX;
62
- const distY = e.changedTouches[0].pageY - startY;
63
- const elapsedTime = Date.now() - startTime;
64
- if (elapsedTime <= allowedTime) {
65
- if (Math.abs(distX) >= threshold && Math.abs(distY) <= restraint)
66
- fn(distX < 0 ? "next" : "prev");
67
- else if (Math.abs(distY) >= threshold && Math.abs(distX) <= restraint)
68
- fn(distY < 0 ? "up" : "down");
69
- else {
70
- (_b = (_a = document2 == null ? void 0 : document2.defaultView) == null ? void 0 : _a.getSelection()) == null ? void 0 : _b.removeAllRanges();
71
- document2.dispatchEvent(
72
- new MouseEvent("click", {
73
- clientX: startX,
74
- clientY: startY
75
- })
76
- );
77
- e.preventDefault();
78
- }
79
- }
80
- },
81
- false
82
- );
83
- }
84
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
85
- var check = function(it) {
86
- return it && it.Math === Math && it;
87
- };
88
- var globalThis_1 = (
89
- // eslint-disable-next-line es/no-global-this -- safe
90
- check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || // eslint-disable-next-line no-restricted-globals -- safe
91
- check(typeof self == "object" && self) || check(typeof commonjsGlobal == "object" && commonjsGlobal) || check(typeof commonjsGlobal == "object" && commonjsGlobal) || // eslint-disable-next-line no-new-func -- fallback
92
- /* @__PURE__ */ function() {
93
- return this;
94
- }() || Function("return this")()
95
- );
96
- var objectGetOwnPropertyDescriptor = {};
97
- var fails$a = function(exec) {
98
- try {
99
- return !!exec();
100
- } catch (error) {
101
- return true;
102
- }
103
- };
104
- var fails$9 = fails$a;
105
- var descriptors = !fails$9(function() {
106
- return Object.defineProperty({}, 1, { get: function() {
107
- return 7;
108
- } })[1] !== 7;
109
- });
110
- var fails$8 = fails$a;
111
- var functionBindNative = !fails$8(function() {
112
- var test2 = (function() {
113
- }).bind();
114
- return typeof test2 != "function" || test2.hasOwnProperty("prototype");
115
- });
116
- var NATIVE_BIND$2 = functionBindNative;
117
- var call$7 = Function.prototype.call;
118
- var functionCall = NATIVE_BIND$2 ? call$7.bind(call$7) : function() {
119
- return call$7.apply(call$7, arguments);
120
- };
121
- var objectPropertyIsEnumerable = {};
122
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
123
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
124
- var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
125
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
126
- var descriptor = getOwnPropertyDescriptor$1(this, V);
127
- return !!descriptor && descriptor.enumerable;
128
- } : $propertyIsEnumerable;
129
- var createPropertyDescriptor$3 = function(bitmap, value) {
130
- return {
131
- enumerable: !(bitmap & 1),
132
- configurable: !(bitmap & 2),
133
- writable: !(bitmap & 4),
134
- value
135
- };
136
- };
137
- var NATIVE_BIND$1 = functionBindNative;
138
- var FunctionPrototype$1 = Function.prototype;
139
- var call$6 = FunctionPrototype$1.call;
140
- var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$6, call$6);
141
- var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function(fn) {
142
- return function() {
143
- return call$6.apply(fn, arguments);
144
- };
145
- };
146
- var uncurryThis$d = functionUncurryThis;
147
- var toString$2 = uncurryThis$d({}.toString);
148
- var stringSlice$1 = uncurryThis$d("".slice);
149
- var classofRaw$2 = function(it) {
150
- return stringSlice$1(toString$2(it), 8, -1);
151
- };
152
- var uncurryThis$c = functionUncurryThis;
153
- var fails$7 = fails$a;
154
- var classof$2 = classofRaw$2;
155
- var $Object$3 = Object;
156
- var split = uncurryThis$c("".split);
157
- var indexedObject = fails$7(function() {
158
- return !$Object$3("z").propertyIsEnumerable(0);
159
- }) ? function(it) {
160
- return classof$2(it) === "String" ? split(it, "") : $Object$3(it);
161
- } : $Object$3;
162
- var isNullOrUndefined$3 = function(it) {
163
- return it === null || it === void 0;
164
- };
165
- var isNullOrUndefined$2 = isNullOrUndefined$3;
166
- var $TypeError$7 = TypeError;
167
- var requireObjectCoercible$4 = function(it) {
168
- if (isNullOrUndefined$2(it)) throw new $TypeError$7("Can't call method on " + it);
169
- return it;
170
- };
171
- var IndexedObject = indexedObject;
172
- var requireObjectCoercible$3 = requireObjectCoercible$4;
173
- var toIndexedObject$3 = function(it) {
174
- return IndexedObject(requireObjectCoercible$3(it));
175
- };
176
- var documentAll = typeof document == "object" && document.all;
177
- var isCallable$b = typeof documentAll == "undefined" && documentAll !== void 0 ? function(argument) {
178
- return typeof argument == "function" || argument === documentAll;
179
- } : function(argument) {
180
- return typeof argument == "function";
181
- };
182
- var isCallable$a = isCallable$b;
183
- var isObject$4 = function(it) {
184
- return typeof it == "object" ? it !== null : isCallable$a(it);
185
- };
186
- var globalThis$b = globalThis_1;
187
- var isCallable$9 = isCallable$b;
188
- var aFunction = function(argument) {
189
- return isCallable$9(argument) ? argument : void 0;
190
- };
191
- var getBuiltIn$3 = function(namespace, method) {
192
- return arguments.length < 2 ? aFunction(globalThis$b[namespace]) : globalThis$b[namespace] && globalThis$b[namespace][method];
193
- };
194
- var uncurryThis$b = functionUncurryThis;
195
- var objectIsPrototypeOf = uncurryThis$b({}.isPrototypeOf);
196
- var globalThis$a = globalThis_1;
197
- var navigator$1 = globalThis$a.navigator;
198
- var userAgent$1 = navigator$1 && navigator$1.userAgent;
199
- var environmentUserAgent = userAgent$1 ? String(userAgent$1) : "";
200
- var globalThis$9 = globalThis_1;
201
- var userAgent = environmentUserAgent;
202
- var process = globalThis$9.process;
203
- var Deno = globalThis$9.Deno;
204
- var versions = process && process.versions || Deno && Deno.version;
205
- var v8 = versions && versions.v8;
206
- var match, version;
207
- if (v8) {
208
- match = v8.split(".");
209
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
210
- }
211
- if (!version && userAgent) {
212
- match = userAgent.match(/Edge\/(\d+)/);
213
- if (!match || match[1] >= 74) {
214
- match = userAgent.match(/Chrome\/(\d+)/);
215
- if (match) version = +match[1];
216
- }
217
- }
218
- var environmentV8Version = version;
219
- var V8_VERSION = environmentV8Version;
220
- var fails$6 = fails$a;
221
- var globalThis$8 = globalThis_1;
222
- var $String$3 = globalThis$8.String;
223
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$6(function() {
224
- var symbol = Symbol("symbol detection");
225
- return !$String$3(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
226
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
227
- });
228
- var NATIVE_SYMBOL$1 = symbolConstructorDetection;
229
- var useSymbolAsUid = NATIVE_SYMBOL$1 && !Symbol.sham && typeof Symbol.iterator == "symbol";
230
- var getBuiltIn$2 = getBuiltIn$3;
231
- var isCallable$8 = isCallable$b;
232
- var isPrototypeOf$1 = objectIsPrototypeOf;
233
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
234
- var $Object$2 = Object;
235
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function(it) {
236
- return typeof it == "symbol";
237
- } : function(it) {
238
- var $Symbol = getBuiltIn$2("Symbol");
239
- return isCallable$8($Symbol) && isPrototypeOf$1($Symbol.prototype, $Object$2(it));
240
- };
241
- var $String$2 = String;
242
- var tryToString$3 = function(argument) {
243
- try {
244
- return $String$2(argument);
245
- } catch (error) {
246
- return "Object";
247
- }
248
- };
249
- var isCallable$7 = isCallable$b;
250
- var tryToString$2 = tryToString$3;
251
- var $TypeError$6 = TypeError;
252
- var aCallable$5 = function(argument) {
253
- if (isCallable$7(argument)) return argument;
254
- throw new $TypeError$6(tryToString$2(argument) + " is not a function");
255
- };
256
- var aCallable$4 = aCallable$5;
257
- var isNullOrUndefined$1 = isNullOrUndefined$3;
258
- var getMethod$3 = function(V, P) {
259
- var func = V[P];
260
- return isNullOrUndefined$1(func) ? void 0 : aCallable$4(func);
261
- };
262
- var call$5 = functionCall;
263
- var isCallable$6 = isCallable$b;
264
- var isObject$3 = isObject$4;
265
- var $TypeError$5 = TypeError;
266
- var ordinaryToPrimitive$1 = function(input, pref) {
267
- var fn, val;
268
- if (pref === "string" && isCallable$6(fn = input.toString) && !isObject$3(val = call$5(fn, input))) return val;
269
- if (isCallable$6(fn = input.valueOf) && !isObject$3(val = call$5(fn, input))) return val;
270
- if (pref !== "string" && isCallable$6(fn = input.toString) && !isObject$3(val = call$5(fn, input))) return val;
271
- throw new $TypeError$5("Can't convert object to primitive value");
272
- };
273
- var sharedStore = { exports: {} };
274
- var globalThis$7 = globalThis_1;
275
- var defineProperty$1 = Object.defineProperty;
276
- var defineGlobalProperty$3 = function(key, value) {
277
- try {
278
- defineProperty$1(globalThis$7, key, { value, configurable: true, writable: true });
279
- } catch (error) {
280
- globalThis$7[key] = value;
281
- }
282
- return value;
283
- };
284
- var globalThis$6 = globalThis_1;
285
- var defineGlobalProperty$2 = defineGlobalProperty$3;
286
- var SHARED = "__core-js_shared__";
287
- var store$3 = sharedStore.exports = globalThis$6[SHARED] || defineGlobalProperty$2(SHARED, {});
288
- (store$3.versions || (store$3.versions = [])).push({
289
- version: "3.47.0",
290
- mode: "global",
291
- copyright: "© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",
292
- license: "https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",
293
- source: "https://github.com/zloirock/core-js"
294
- });
295
- var sharedStoreExports = sharedStore.exports;
296
- var store$2 = sharedStoreExports;
297
- var shared$3 = function(key, value) {
298
- return store$2[key] || (store$2[key] = value || {});
299
- };
300
- var requireObjectCoercible$2 = requireObjectCoercible$4;
301
- var $Object$1 = Object;
302
- var toObject$1 = function(argument) {
303
- return $Object$1(requireObjectCoercible$2(argument));
304
- };
305
- var uncurryThis$a = functionUncurryThis;
306
- var toObject = toObject$1;
307
- var hasOwnProperty = uncurryThis$a({}.hasOwnProperty);
308
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
309
- return hasOwnProperty(toObject(it), key);
310
- };
311
- var uncurryThis$9 = functionUncurryThis;
312
- var id = 0;
313
- var postfix = Math.random();
314
- var toString$1 = uncurryThis$9(1.1.toString);
315
- var uid$2 = function(key) {
316
- return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString$1(++id + postfix, 36);
317
- };
318
- var globalThis$5 = globalThis_1;
319
- var shared$2 = shared$3;
320
- var hasOwn$6 = hasOwnProperty_1;
321
- var uid$1 = uid$2;
322
- var NATIVE_SYMBOL = symbolConstructorDetection;
323
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
324
- var Symbol$1 = globalThis$5.Symbol;
325
- var WellKnownSymbolsStore = shared$2("wks");
326
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1["for"] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
327
- var wellKnownSymbol$5 = function(name) {
328
- if (!hasOwn$6(WellKnownSymbolsStore, name)) {
329
- WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$6(Symbol$1, name) ? Symbol$1[name] : createWellKnownSymbol("Symbol." + name);
330
- }
331
- return WellKnownSymbolsStore[name];
332
- };
333
- var call$4 = functionCall;
334
- var isObject$2 = isObject$4;
335
- var isSymbol$1 = isSymbol$2;
336
- var getMethod$2 = getMethod$3;
337
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
338
- var wellKnownSymbol$4 = wellKnownSymbol$5;
339
- var $TypeError$4 = TypeError;
340
- var TO_PRIMITIVE = wellKnownSymbol$4("toPrimitive");
341
- var toPrimitive$1 = function(input, pref) {
342
- if (!isObject$2(input) || isSymbol$1(input)) return input;
343
- var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
344
- var result;
345
- if (exoticToPrim) {
346
- if (pref === void 0) pref = "default";
347
- result = call$4(exoticToPrim, input, pref);
348
- if (!isObject$2(result) || isSymbol$1(result)) return result;
349
- throw new $TypeError$4("Can't convert object to primitive value");
350
- }
351
- if (pref === void 0) pref = "number";
352
- return ordinaryToPrimitive(input, pref);
353
- };
354
- var toPrimitive = toPrimitive$1;
355
- var isSymbol = isSymbol$2;
356
- var toPropertyKey$3 = function(argument) {
357
- var key = toPrimitive(argument, "string");
358
- return isSymbol(key) ? key : key + "";
359
- };
360
- var globalThis$4 = globalThis_1;
361
- var isObject$1 = isObject$4;
362
- var document$1 = globalThis$4.document;
363
- var EXISTS$1 = isObject$1(document$1) && isObject$1(document$1.createElement);
364
- var documentCreateElement = function(it) {
365
- return EXISTS$1 ? document$1.createElement(it) : {};
366
- };
367
- var DESCRIPTORS$7 = descriptors;
368
- var fails$5 = fails$a;
369
- var createElement = documentCreateElement;
370
- var ie8DomDefine = !DESCRIPTORS$7 && !fails$5(function() {
371
- return Object.defineProperty(createElement("div"), "a", {
372
- get: function() {
373
- return 7;
374
- }
375
- }).a !== 7;
376
- });
377
- var DESCRIPTORS$6 = descriptors;
378
- var call$3 = functionCall;
379
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
380
- var createPropertyDescriptor$2 = createPropertyDescriptor$3;
381
- var toIndexedObject$2 = toIndexedObject$3;
382
- var toPropertyKey$2 = toPropertyKey$3;
383
- var hasOwn$5 = hasOwnProperty_1;
384
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
385
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
386
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$6 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
387
- O = toIndexedObject$2(O);
388
- P = toPropertyKey$2(P);
389
- if (IE8_DOM_DEFINE$1) try {
390
- return $getOwnPropertyDescriptor$1(O, P);
391
- } catch (error) {
392
- }
393
- if (hasOwn$5(O, P)) return createPropertyDescriptor$2(!call$3(propertyIsEnumerableModule.f, O, P), O[P]);
394
- };
395
- var objectDefineProperty = {};
396
- var DESCRIPTORS$5 = descriptors;
397
- var fails$4 = fails$a;
398
- var v8PrototypeDefineBug = DESCRIPTORS$5 && fails$4(function() {
399
- return Object.defineProperty(function() {
400
- }, "prototype", {
401
- value: 42,
402
- writable: false
403
- }).prototype !== 42;
404
- });
405
- var isObject = isObject$4;
406
- var $String$1 = String;
407
- var $TypeError$3 = TypeError;
408
- var anObject$5 = function(argument) {
409
- if (isObject(argument)) return argument;
410
- throw new $TypeError$3($String$1(argument) + " is not an object");
411
- };
412
- var DESCRIPTORS$4 = descriptors;
413
- var IE8_DOM_DEFINE = ie8DomDefine;
414
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
415
- var anObject$4 = anObject$5;
416
- var toPropertyKey$1 = toPropertyKey$3;
417
- var $TypeError$2 = TypeError;
418
- var $defineProperty = Object.defineProperty;
419
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
420
- var ENUMERABLE = "enumerable";
421
- var CONFIGURABLE$1 = "configurable";
422
- var WRITABLE = "writable";
423
- objectDefineProperty.f = DESCRIPTORS$4 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
424
- anObject$4(O);
425
- P = toPropertyKey$1(P);
426
- anObject$4(Attributes);
427
- if (typeof O === "function" && P === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
428
- var current = $getOwnPropertyDescriptor(O, P);
429
- if (current && current[WRITABLE]) {
430
- O[P] = Attributes.value;
431
- Attributes = {
432
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
433
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
434
- writable: false
435
- };
436
- }
437
- }
438
- return $defineProperty(O, P, Attributes);
439
- } : $defineProperty : function defineProperty2(O, P, Attributes) {
440
- anObject$4(O);
441
- P = toPropertyKey$1(P);
442
- anObject$4(Attributes);
443
- if (IE8_DOM_DEFINE) try {
444
- return $defineProperty(O, P, Attributes);
445
- } catch (error) {
446
- }
447
- if ("get" in Attributes || "set" in Attributes) throw new $TypeError$2("Accessors not supported");
448
- if ("value" in Attributes) O[P] = Attributes.value;
449
- return O;
450
- };
451
- var DESCRIPTORS$3 = descriptors;
452
- var definePropertyModule$3 = objectDefineProperty;
453
- var createPropertyDescriptor$1 = createPropertyDescriptor$3;
454
- var createNonEnumerableProperty$2 = DESCRIPTORS$3 ? function(object, key, value) {
455
- return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
456
- } : function(object, key, value) {
457
- object[key] = value;
458
- return object;
459
- };
460
- var makeBuiltIn$2 = { exports: {} };
461
- var DESCRIPTORS$2 = descriptors;
462
- var hasOwn$4 = hasOwnProperty_1;
463
- var FunctionPrototype = Function.prototype;
464
- var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
465
- var EXISTS = hasOwn$4(FunctionPrototype, "name");
466
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || DESCRIPTORS$2 && getDescriptor(FunctionPrototype, "name").configurable);
467
- var functionName = {
468
- CONFIGURABLE
469
- };
470
- var uncurryThis$8 = functionUncurryThis;
471
- var isCallable$5 = isCallable$b;
472
- var store$1 = sharedStoreExports;
473
- var functionToString = uncurryThis$8(Function.toString);
474
- if (!isCallable$5(store$1.inspectSource)) {
475
- store$1.inspectSource = function(it) {
476
- return functionToString(it);
477
- };
478
- }
479
- var inspectSource$1 = store$1.inspectSource;
480
- var globalThis$3 = globalThis_1;
481
- var isCallable$4 = isCallable$b;
482
- var WeakMap$2 = globalThis$3.WeakMap;
483
- var weakMapBasicDetection = isCallable$4(WeakMap$2) && /native code/.test(String(WeakMap$2));
484
- var shared$1 = shared$3;
485
- var uid = uid$2;
486
- var keys = shared$1("keys");
487
- var sharedKey$1 = function(key) {
488
- return keys[key] || (keys[key] = uid(key));
489
- };
490
- var hiddenKeys$3 = {};
491
- var NATIVE_WEAK_MAP = weakMapBasicDetection;
492
- var globalThis$2 = globalThis_1;
493
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
494
- var hasOwn$3 = hasOwnProperty_1;
495
- var shared = sharedStoreExports;
496
- var sharedKey = sharedKey$1;
497
- var hiddenKeys$2 = hiddenKeys$3;
498
- var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
499
- var TypeError$1 = globalThis$2.TypeError;
500
- var WeakMap$1 = globalThis$2.WeakMap;
501
- var set$1, get$1, has$1;
502
- var enforce = function(it) {
503
- return has$1(it) ? get$1(it) : set$1(it, {});
504
- };
505
- if (NATIVE_WEAK_MAP || shared.state) {
506
- var store = shared.state || (shared.state = new WeakMap$1());
507
- store.get = store.get;
508
- store.has = store.has;
509
- store.set = store.set;
510
- set$1 = function(it, metadata) {
511
- if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
512
- metadata.facade = it;
513
- store.set(it, metadata);
514
- return metadata;
515
- };
516
- get$1 = function(it) {
517
- return store.get(it) || {};
518
- };
519
- has$1 = function(it) {
520
- return store.has(it);
521
- };
522
- } else {
523
- var STATE = sharedKey("state");
524
- hiddenKeys$2[STATE] = true;
525
- set$1 = function(it, metadata) {
526
- if (hasOwn$3(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
527
- metadata.facade = it;
528
- createNonEnumerableProperty$1(it, STATE, metadata);
529
- return metadata;
530
- };
531
- get$1 = function(it) {
532
- return hasOwn$3(it, STATE) ? it[STATE] : {};
533
- };
534
- has$1 = function(it) {
535
- return hasOwn$3(it, STATE);
536
- };
537
- }
538
- var internalState = {
539
- get: get$1,
540
- enforce
541
- };
542
- var uncurryThis$7 = functionUncurryThis;
543
- var fails$3 = fails$a;
544
- var isCallable$3 = isCallable$b;
545
- var hasOwn$2 = hasOwnProperty_1;
546
- var DESCRIPTORS$1 = descriptors;
547
- var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
548
- var inspectSource = inspectSource$1;
549
- var InternalStateModule = internalState;
550
- var enforceInternalState = InternalStateModule.enforce;
551
- var getInternalState = InternalStateModule.get;
552
- var $String = String;
553
- var defineProperty3 = Object.defineProperty;
554
- var stringSlice = uncurryThis$7("".slice);
555
- var replace = uncurryThis$7("".replace);
556
- var join = uncurryThis$7([].join);
557
- var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$3(function() {
558
- return defineProperty3(function() {
559
- }, "length", { value: 8 }).length !== 8;
560
- });
561
- var TEMPLATE = String(String).split("String");
562
- var makeBuiltIn$1 = makeBuiltIn$2.exports = function(value, name, options) {
563
- if (stringSlice($String(name), 0, 7) === "Symbol(") {
564
- name = "[" + replace($String(name), /^Symbol\(([^)]*)\).*$/, "$1") + "]";
565
- }
566
- if (options && options.getter) name = "get " + name;
567
- if (options && options.setter) name = "set " + name;
568
- if (!hasOwn$2(value, "name") || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
569
- if (DESCRIPTORS$1) defineProperty3(value, "name", { value: name, configurable: true });
570
- else value.name = name;
571
- }
572
- if (CONFIGURABLE_LENGTH && options && hasOwn$2(options, "arity") && value.length !== options.arity) {
573
- defineProperty3(value, "length", { value: options.arity });
574
- }
575
- try {
576
- if (options && hasOwn$2(options, "constructor") && options.constructor) {
577
- if (DESCRIPTORS$1) defineProperty3(value, "prototype", { writable: false });
578
- } else if (value.prototype) value.prototype = void 0;
579
- } catch (error) {
580
- }
581
- var state = enforceInternalState(value);
582
- if (!hasOwn$2(state, "source")) {
583
- state.source = join(TEMPLATE, typeof name == "string" ? name : "");
584
- }
585
- return value;
586
- };
587
- Function.prototype.toString = makeBuiltIn$1(function toString() {
588
- return isCallable$3(this) && getInternalState(this).source || inspectSource(this);
589
- }, "toString");
590
- var makeBuiltInExports = makeBuiltIn$2.exports;
591
- var isCallable$2 = isCallable$b;
592
- var definePropertyModule$2 = objectDefineProperty;
593
- var makeBuiltIn = makeBuiltInExports;
594
- var defineGlobalProperty$1 = defineGlobalProperty$3;
595
- var defineBuiltIn$1 = function(O, key, value, options) {
596
- if (!options) options = {};
597
- var simple = options.enumerable;
598
- var name = options.name !== void 0 ? options.name : key;
599
- if (isCallable$2(value)) makeBuiltIn(value, name, options);
600
- if (options.global) {
601
- if (simple) O[key] = value;
602
- else defineGlobalProperty$1(key, value);
603
- } else {
604
- try {
605
- if (!options.unsafe) delete O[key];
606
- else if (O[key]) simple = true;
607
- } catch (error) {
608
- }
609
- if (simple) O[key] = value;
610
- else definePropertyModule$2.f(O, key, {
611
- value,
612
- enumerable: false,
613
- configurable: !options.nonConfigurable,
614
- writable: !options.nonWritable
615
- });
616
- }
617
- return O;
618
- };
619
- var objectGetOwnPropertyNames = {};
620
- var ceil = Math.ceil;
621
- var floor = Math.floor;
622
- var mathTrunc = Math.trunc || function trunc(x) {
623
- var n = +x;
624
- return (n > 0 ? floor : ceil)(n);
625
- };
626
- var trunc2 = mathTrunc;
627
- var toIntegerOrInfinity$2 = function(argument) {
628
- var number = +argument;
629
- return number !== number || number === 0 ? 0 : trunc2(number);
630
- };
631
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
632
- var max = Math.max;
633
- var min$1 = Math.min;
634
- var toAbsoluteIndex$1 = function(index, length) {
635
- var integer = toIntegerOrInfinity$1(index);
636
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
637
- };
638
- var toIntegerOrInfinity = toIntegerOrInfinity$2;
639
- var min = Math.min;
640
- var toLength$1 = function(argument) {
641
- var len = toIntegerOrInfinity(argument);
642
- return len > 0 ? min(len, 9007199254740991) : 0;
643
- };
644
- var toLength = toLength$1;
645
- var lengthOfArrayLike$2 = function(obj) {
646
- return toLength(obj.length);
647
- };
648
- var toIndexedObject$1 = toIndexedObject$3;
649
- var toAbsoluteIndex = toAbsoluteIndex$1;
650
- var lengthOfArrayLike$1 = lengthOfArrayLike$2;
651
- var createMethod = function(IS_INCLUDES) {
652
- return function($this, el, fromIndex) {
653
- var O = toIndexedObject$1($this);
654
- var length = lengthOfArrayLike$1(O);
655
- if (length === 0) return !IS_INCLUDES && -1;
656
- var index = toAbsoluteIndex(fromIndex, length);
657
- var value;
658
- if (IS_INCLUDES && el !== el) while (length > index) {
659
- value = O[index++];
660
- if (value !== value) return true;
661
- }
662
- else for (; length > index; index++) {
663
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
664
- }
665
- return !IS_INCLUDES && -1;
666
- };
667
- };
668
- var arrayIncludes = {
669
- // `Array.prototype.indexOf` method
670
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
671
- indexOf: createMethod(false)
672
- };
673
- var uncurryThis$6 = functionUncurryThis;
674
- var hasOwn$1 = hasOwnProperty_1;
675
- var toIndexedObject = toIndexedObject$3;
676
- var indexOf = arrayIncludes.indexOf;
677
- var hiddenKeys$1 = hiddenKeys$3;
678
- var push$2 = uncurryThis$6([].push);
679
- var objectKeysInternal = function(object, names) {
680
- var O = toIndexedObject(object);
681
- var i = 0;
682
- var result = [];
683
- var key;
684
- for (key in O) !hasOwn$1(hiddenKeys$1, key) && hasOwn$1(O, key) && push$2(result, key);
685
- while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
686
- ~indexOf(result, key) || push$2(result, key);
687
- }
688
- return result;
689
- };
690
- var enumBugKeys$1 = [
691
- "constructor",
692
- "hasOwnProperty",
693
- "isPrototypeOf",
694
- "propertyIsEnumerable",
695
- "toLocaleString",
696
- "toString",
697
- "valueOf"
698
- ];
699
- var internalObjectKeys = objectKeysInternal;
700
- var enumBugKeys = enumBugKeys$1;
701
- var hiddenKeys = enumBugKeys.concat("length", "prototype");
702
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
703
- return internalObjectKeys(O, hiddenKeys);
704
- };
705
- var objectGetOwnPropertySymbols = {};
706
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
707
- var getBuiltIn$1 = getBuiltIn$3;
708
- var uncurryThis$5 = functionUncurryThis;
709
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
710
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
711
- var anObject$3 = anObject$5;
712
- var concat = uncurryThis$5([].concat);
713
- var ownKeys$1 = getBuiltIn$1("Reflect", "ownKeys") || function ownKeys(it) {
714
- var keys2 = getOwnPropertyNamesModule.f(anObject$3(it));
715
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
716
- return getOwnPropertySymbols ? concat(keys2, getOwnPropertySymbols(it)) : keys2;
717
- };
718
- var hasOwn2 = hasOwnProperty_1;
719
- var ownKeys2 = ownKeys$1;
720
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
721
- var definePropertyModule$1 = objectDefineProperty;
722
- var copyConstructorProperties$1 = function(target, source, exceptions) {
723
- var keys2 = ownKeys2(source);
724
- var defineProperty4 = definePropertyModule$1.f;
725
- var getOwnPropertyDescriptor3 = getOwnPropertyDescriptorModule.f;
726
- for (var i = 0; i < keys2.length; i++) {
727
- var key = keys2[i];
728
- if (!hasOwn2(target, key) && !(exceptions && hasOwn2(exceptions, key))) {
729
- defineProperty4(target, key, getOwnPropertyDescriptor3(source, key));
730
- }
731
- }
732
- };
733
- var fails$2 = fails$a;
734
- var isCallable$1 = isCallable$b;
735
- var replacement = /#|\.prototype\./;
736
- var isForced$1 = function(feature, detection) {
737
- var value = data[normalize(feature)];
738
- return value === POLYFILL ? true : value === NATIVE ? false : isCallable$1(detection) ? fails$2(detection) : !!detection;
739
- };
740
- var normalize = isForced$1.normalize = function(string) {
741
- return String(string).replace(replacement, ".").toLowerCase();
742
- };
743
- var data = isForced$1.data = {};
744
- var NATIVE = isForced$1.NATIVE = "N";
745
- var POLYFILL = isForced$1.POLYFILL = "P";
746
- var isForced_1 = isForced$1;
747
- var globalThis$1 = globalThis_1;
748
- var getOwnPropertyDescriptor2 = objectGetOwnPropertyDescriptor.f;
749
- var createNonEnumerableProperty = createNonEnumerableProperty$2;
750
- var defineBuiltIn = defineBuiltIn$1;
751
- var defineGlobalProperty = defineGlobalProperty$3;
752
- var copyConstructorProperties = copyConstructorProperties$1;
753
- var isForced = isForced_1;
754
- var _export = function(options, source) {
755
- var TARGET = options.target;
756
- var GLOBAL = options.global;
757
- var STATIC = options.stat;
758
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
759
- if (GLOBAL) {
760
- target = globalThis$1;
761
- } else if (STATIC) {
762
- target = globalThis$1[TARGET] || defineGlobalProperty(TARGET, {});
763
- } else {
764
- target = globalThis$1[TARGET] && globalThis$1[TARGET].prototype;
765
- }
766
- if (target) for (key in source) {
767
- sourceProperty = source[key];
768
- if (options.dontCallGetSet) {
769
- descriptor = getOwnPropertyDescriptor2(target, key);
770
- targetProperty = descriptor && descriptor.value;
771
- } else targetProperty = target[key];
772
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
773
- if (!FORCED && targetProperty !== void 0) {
774
- if (typeof sourceProperty == typeof targetProperty) continue;
775
- copyConstructorProperties(sourceProperty, targetProperty);
776
- }
777
- if (options.sham || targetProperty && targetProperty.sham) {
778
- createNonEnumerableProperty(sourceProperty, "sham", true);
779
- }
780
- defineBuiltIn(target, key, sourceProperty, options);
781
- }
782
- };
783
- var classofRaw$1 = classofRaw$2;
784
- var uncurryThis$4 = functionUncurryThis;
785
- var functionUncurryThisClause = function(fn) {
786
- if (classofRaw$1(fn) === "Function") return uncurryThis$4(fn);
787
- };
788
- var uncurryThis$3 = functionUncurryThisClause;
789
- var aCallable$3 = aCallable$5;
790
- var NATIVE_BIND = functionBindNative;
791
- var bind$1 = uncurryThis$3(uncurryThis$3.bind);
792
- var functionBindContext = function(fn, that) {
793
- aCallable$3(fn);
794
- return that === void 0 ? fn : NATIVE_BIND ? bind$1(fn, that) : function() {
795
- return fn.apply(that, arguments);
796
- };
797
- };
798
- var iterators = {};
799
- var wellKnownSymbol$3 = wellKnownSymbol$5;
800
- var Iterators$1 = iterators;
801
- var ITERATOR$1 = wellKnownSymbol$3("iterator");
802
- var ArrayPrototype = Array.prototype;
803
- var isArrayIteratorMethod$1 = function(it) {
804
- return it !== void 0 && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$1] === it);
805
- };
806
- var wellKnownSymbol$2 = wellKnownSymbol$5;
807
- var TO_STRING_TAG$1 = wellKnownSymbol$2("toStringTag");
808
- var test = {};
809
- test[TO_STRING_TAG$1] = "z";
810
- var toStringTagSupport = String(test) === "[object z]";
811
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
812
- var isCallable = isCallable$b;
813
- var classofRaw = classofRaw$2;
814
- var wellKnownSymbol$1 = wellKnownSymbol$5;
815
- var TO_STRING_TAG = wellKnownSymbol$1("toStringTag");
816
- var $Object = Object;
817
- var CORRECT_ARGUMENTS = classofRaw(/* @__PURE__ */ function() {
818
- return arguments;
819
- }()) === "Arguments";
820
- var tryGet = function(it, key) {
821
- try {
822
- return it[key];
823
- } catch (error) {
824
- }
825
- };
826
- var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) {
827
- var O, tag, result;
828
- return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) === "Object" && isCallable(O.callee) ? "Arguments" : result;
829
- };
830
- var classof = classof$1;
831
- var getMethod$1 = getMethod$3;
832
- var isNullOrUndefined = isNullOrUndefined$3;
833
- var Iterators = iterators;
834
- var wellKnownSymbol = wellKnownSymbol$5;
835
- var ITERATOR = wellKnownSymbol("iterator");
836
- var getIteratorMethod$2 = function(it) {
837
- if (!isNullOrUndefined(it)) return getMethod$1(it, ITERATOR) || getMethod$1(it, "@@iterator") || Iterators[classof(it)];
838
- };
839
- var call$2 = functionCall;
840
- var aCallable$2 = aCallable$5;
841
- var anObject$2 = anObject$5;
842
- var tryToString$1 = tryToString$3;
843
- var getIteratorMethod$1 = getIteratorMethod$2;
844
- var $TypeError$1 = TypeError;
845
- var getIterator$1 = function(argument, usingIterator) {
846
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
847
- if (aCallable$2(iteratorMethod)) return anObject$2(call$2(iteratorMethod, argument));
848
- throw new $TypeError$1(tryToString$1(argument) + " is not iterable");
849
- };
850
- var call$1 = functionCall;
851
- var anObject$1 = anObject$5;
852
- var getMethod = getMethod$3;
853
- var iteratorClose$1 = function(iterator, kind, value) {
854
- var innerResult, innerError;
855
- anObject$1(iterator);
856
- try {
857
- innerResult = getMethod(iterator, "return");
858
- if (!innerResult) {
859
- if (kind === "throw") throw value;
860
- return value;
861
- }
862
- innerResult = call$1(innerResult, iterator);
863
- } catch (error) {
864
- innerError = true;
865
- innerResult = error;
866
- }
867
- if (kind === "throw") throw value;
868
- if (innerError) throw innerResult;
869
- anObject$1(innerResult);
870
- return value;
871
- };
872
- var bind = functionBindContext;
873
- var call = functionCall;
874
- var anObject = anObject$5;
875
- var tryToString = tryToString$3;
876
- var isArrayIteratorMethod = isArrayIteratorMethod$1;
877
- var lengthOfArrayLike = lengthOfArrayLike$2;
878
- var isPrototypeOf = objectIsPrototypeOf;
879
- var getIterator = getIterator$1;
880
- var getIteratorMethod = getIteratorMethod$2;
881
- var iteratorClose = iteratorClose$1;
882
- var $TypeError = TypeError;
883
- var Result = function(stopped, result) {
884
- this.stopped = stopped;
885
- this.result = result;
886
- };
887
- var ResultPrototype = Result.prototype;
888
- var iterate$2 = function(iterable, unboundFunction, options) {
889
- var that = options && options.that;
890
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
891
- var IS_RECORD = !!(options && options.IS_RECORD);
892
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
893
- var INTERRUPTED = !!(options && options.INTERRUPTED);
894
- var fn = bind(unboundFunction, that);
895
- var iterator, iterFn, index, length, result, next, step;
896
- var stop = function(condition) {
897
- if (iterator) iteratorClose(iterator, "normal");
898
- return new Result(true, condition);
899
- };
900
- var callFn = function(value) {
901
- if (AS_ENTRIES) {
902
- anObject(value);
903
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
904
- }
905
- return INTERRUPTED ? fn(value, stop) : fn(value);
906
- };
907
- if (IS_RECORD) {
908
- iterator = iterable.iterator;
909
- } else if (IS_ITERATOR) {
910
- iterator = iterable;
911
- } else {
912
- iterFn = getIteratorMethod(iterable);
913
- if (!iterFn) throw new $TypeError(tryToString(iterable) + " is not iterable");
914
- if (isArrayIteratorMethod(iterFn)) {
915
- for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
916
- result = callFn(iterable[index]);
917
- if (result && isPrototypeOf(ResultPrototype, result)) return result;
918
- }
919
- return new Result(false);
920
- }
921
- iterator = getIterator(iterable, iterFn);
922
- }
923
- next = IS_RECORD ? iterable.next : iterator.next;
924
- while (!(step = call(next, iterator)).done) {
925
- try {
926
- result = callFn(step.value);
927
- } catch (error) {
928
- iteratorClose(iterator, "throw", error);
929
- }
930
- if (typeof result == "object" && result && isPrototypeOf(ResultPrototype, result)) return result;
931
- }
932
- return new Result(false);
933
- };
934
- var uncurryThis$2 = functionUncurryThis;
935
- var MapPrototype = Map.prototype;
936
- var mapHelpers = {
937
- // eslint-disable-next-line es/no-map -- safe
938
- Map,
939
- set: uncurryThis$2(MapPrototype.set),
940
- get: uncurryThis$2(MapPrototype.get),
941
- has: uncurryThis$2(MapPrototype.has),
942
- remove: uncurryThis$2(MapPrototype["delete"])
943
- };
944
- var $$2 = _export;
945
- var uncurryThis$1 = functionUncurryThis;
946
- var aCallable$1 = aCallable$5;
947
- var requireObjectCoercible$1 = requireObjectCoercible$4;
948
- var iterate$1 = iterate$2;
949
- var MapHelpers = mapHelpers;
950
- var fails$1 = fails$a;
951
- var Map$1 = MapHelpers.Map;
952
- var has = MapHelpers.has;
953
- var get = MapHelpers.get;
954
- var set = MapHelpers.set;
955
- var push$1 = uncurryThis$1([].push);
956
- var DOES_NOT_WORK_WITH_PRIMITIVES$1 = fails$1(function() {
957
- return Map$1.groupBy("ab", function(it) {
958
- return it;
959
- }).get("a").length !== 1;
960
- });
961
- $$2({ target: "Map", stat: true, forced: DOES_NOT_WORK_WITH_PRIMITIVES$1 }, {
962
- groupBy: function groupBy(items, callbackfn) {
963
- requireObjectCoercible$1(items);
964
- aCallable$1(callbackfn);
965
- var map = new Map$1();
966
- var k = 0;
967
- iterate$1(items, function(value) {
968
- var key = callbackfn(value, k++);
969
- if (!has(map, key)) set(map, key, [value]);
970
- else push$1(get(map, key), value);
971
- });
972
- return map;
973
- }
974
- });
975
- var DESCRIPTORS = descriptors;
976
- var definePropertyModule = objectDefineProperty;
977
- var createPropertyDescriptor = createPropertyDescriptor$3;
978
- var createProperty$1 = function(object, key, value) {
979
- if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
980
- else object[key] = value;
981
- };
982
- var $$1 = _export;
983
- var createProperty = createProperty$1;
984
- var getBuiltIn = getBuiltIn$3;
985
- var uncurryThis = functionUncurryThis;
986
- var aCallable = aCallable$5;
987
- var requireObjectCoercible = requireObjectCoercible$4;
988
- var toPropertyKey = toPropertyKey$3;
989
- var iterate = iterate$2;
990
- var fails = fails$a;
991
- var nativeGroupBy = Object.groupBy;
992
- var create = getBuiltIn("Object", "create");
993
- var push = uncurryThis([].push);
994
- var DOES_NOT_WORK_WITH_PRIMITIVES = !nativeGroupBy || fails(function() {
995
- return nativeGroupBy("ab", function(it) {
996
- return it;
997
- }).a.length !== 1;
998
- });
999
- $$1({ target: "Object", stat: true, forced: DOES_NOT_WORK_WITH_PRIMITIVES }, {
1000
- groupBy: function groupBy2(items, callbackfn) {
1001
- requireObjectCoercible(items);
1002
- aCallable(callbackfn);
1003
- var obj = create(null);
1004
- var k = 0;
1005
- iterate(items, function(value) {
1006
- var key = toPropertyKey(callbackfn(value, k++));
1007
- if (key in obj) push(obj[key], value);
1008
- else createProperty(obj, key, [value]);
1009
- });
1010
- return obj;
1011
- }
1012
- });
1013
- const _export_sfc = (sfc, props) => {
1014
- const target = sfc.__vccOpts || sfc;
1015
- for (const [key, val] of props) {
1016
- target[key] = val;
1017
- }
1018
- return target;
1019
- };
1020
- const _hoisted_1$2 = { class: "reader" };
1021
- const _hoisted_2$2 = { class: "viewHolder" };
1022
- const _hoisted_3$1 = { key: 0 };
1023
- const _sfc_main$2 = {
1024
- __name: "BookView",
1025
- props: {
1026
- url: {
1027
- type: [String, File]
1028
- },
1029
- location: {
1030
- type: [String, Number]
1031
- },
1032
- tocChanged: Function,
1033
- getRendition: Function
1034
- },
1035
- emits: ["update:location"],
1036
- setup(__props, { expose: __expose, emit: __emit }) {
1037
- if (typeof Promise.withResolvers === "undefined") {
1038
- if (window)
1039
- window.Promise.withResolvers = function() {
1040
- let resolve, reject;
1041
- const promise = new Promise((res, rej) => {
1042
- resolve = res;
1043
- reject = rej;
1044
- });
1045
- return { promise, resolve, reject };
1046
- };
1047
- }
1048
- const props = __props;
1049
- const { tocChanged, getRendition } = props;
1050
- const { url, location } = vue.toRefs(props);
1051
- const emit = __emit;
1052
- let view = null;
1053
- const viewer = vue.ref(null);
1054
- const isLoaded = vue.ref(false);
1055
- const isError = vue.ref(false);
1056
- const initBook = async () => {
1057
- try {
1058
- if (url.value) {
1059
- if (view) {
1060
- view.close();
1061
- } else {
1062
- view = document.createElement("foliate-view");
1063
- viewer.value.append(view);
1064
- }
1065
- await view.open(url.value);
1066
- getRendition(view);
1067
- initReader();
1068
- }
1069
- } catch (error) {
1070
- console.error("Error opening book:", error);
1071
- isError.value = true;
1072
- }
1073
- };
1074
- const initReader = () => {
1075
- isLoaded.value = true;
1076
- const { book } = view;
1077
- registerEvents();
1078
- tocChanged && tocChanged(book.toc);
1079
- if (location.value) {
1080
- view == null ? void 0 : view.goTo(location.value);
1081
- } else {
1082
- view.renderer.next();
1083
- }
1084
- };
1085
- const flipPage = (direction) => {
1086
- if (direction === "next") nextPage();
1087
- else if (direction === "prev") prevPage();
1088
- };
1089
- const registerEvents = () => {
1090
- view.addEventListener("load", onLoad);
1091
- view.addEventListener("relocate", onRelocate);
1092
- };
1093
- const onLoad = ({ detail: { doc } }) => {
1094
- wheelListener(doc, flipPage);
1095
- swipListener(doc, flipPage);
1096
- keyListener(doc, flipPage);
1097
- };
1098
- vue.onUnmounted(() => {
1099
- view == null ? void 0 : view.removeEventListener("load", onLoad);
1100
- view == null ? void 0 : view.removeEventListener("relocate", onRelocate);
1101
- });
1102
- const onRelocate = ({ detail }) => {
1103
- emit("update:location", detail);
1104
- };
1105
- const nextPage = () => view == null ? void 0 : view.next();
1106
- const prevPage = () => view == null ? void 0 : view.prev();
1107
- const setLocation = (href) => view == null ? void 0 : view.goTo(href);
1108
- vue.watch(url, () => {
1109
- initBook();
1110
- });
1111
- vue.onMounted(async () => {
1112
- if (!customElements.get("foliate-view")) {
1113
- await Promise.resolve().then(() => require("./view--95lChht.cjs")).then((n) => n.view);
1114
- }
1115
- initBook();
1116
- });
1117
- __expose({
1118
- nextPage,
1119
- prevPage,
1120
- setLocation
1121
- });
1122
- return (_ctx, _cache) => {
1123
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
1124
- vue.createElementVNode("div", _hoisted_2$2, [
1125
- vue.withDirectives(vue.createElementVNode("div", {
1126
- ref_key: "viewer",
1127
- ref: viewer,
1128
- id: "viewer"
1129
- }, null, 512), [
1130
- [vue.vShow, isLoaded.value]
1131
- ]),
1132
- !isLoaded.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
1133
- !isError.value ? vue.renderSlot(_ctx.$slots, "loadingView", { key: 0 }, void 0, true) : vue.renderSlot(_ctx.$slots, "errorView", { key: 1 }, void 0, true)
1134
- ])) : vue.createCommentVNode("", true)
1135
- ])
1136
- ]);
1137
- };
1138
- }
1139
- };
1140
- const BookView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-1350176b"]]);
1141
- const _hoisted_1$1 = ["onClick"];
1142
- const _hoisted_2$1 = { key: 0 };
1143
- const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
1144
- __name: "Toc",
1145
- props: {
1146
- toc: {},
1147
- current: {},
1148
- setLocation: {},
1149
- isSubmenu: { type: Boolean, default: false }
1150
- },
1151
- setup(__props) {
1152
- const bookToc = vue.ref([]);
1153
- const props = __props;
1154
- const { setLocation } = props;
1155
- const { toc, current, isSubmenu } = vue.toRefs(props);
1156
- const handleClick = (item) => {
1157
- var _a;
1158
- if (item.subitems && ((_a = item == null ? void 0 : item.subitems) == null ? void 0 : _a.length) > 0) {
1159
- item.expansion = !item.expansion;
1160
- console.log("item.href", item.href);
1161
- setLocation(item.href, false);
1162
- } else {
1163
- setLocation(item.href);
1164
- }
1165
- };
1166
- vue.watchEffect(() => {
1167
- bookToc.value = toc.value.map((item) => ({
1168
- ...item,
1169
- expansion: false
1170
- }));
1171
- });
1172
- return (_ctx, _cache) => {
1173
- const _component_Toc = vue.resolveComponent("Toc", true);
1174
- return vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(bookToc.value, (item, index) => {
1175
- return vue.openBlock(), vue.createElementBlock("div", { key: index }, [
1176
- vue.createElementVNode("button", {
1177
- class: vue.normalizeClass(["tocAreaButton", { active: item.href === vue.unref(current) }]),
1178
- onClick: ($event) => handleClick(item)
1179
- }, [
1180
- vue.createTextVNode(vue.toDisplayString(vue.unref(isSubmenu) ? " ".repeat(4) + item.label : item.label) + " ", 1),
1181
- item.subitems && item.subitems.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", {
1182
- key: 0,
1183
- class: vue.normalizeClass(["expansion", { open: item.expansion }])
1184
- }, null, 2)) : vue.createCommentVNode("", true)
1185
- ], 10, _hoisted_1$1),
1186
- item.subitems && item.subitems.length > 0 ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
1187
- vue.createVNode(_component_Toc, {
1188
- toc: item.subitems,
1189
- current: vue.unref(current),
1190
- setLocation: vue.unref(setLocation),
1191
- isSubmenu: true
1192
- }, null, 8, ["toc", "current", "setLocation"])
1193
- ], 512)), [
1194
- [vue.vShow, item.expansion]
1195
- ]) : vue.createCommentVNode("", true)
1196
- ]);
1197
- }), 128);
1198
- };
1199
- }
1200
- });
1201
- const Toc = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-faba9f3e"]]);
1202
- const _withScopeId = (n) => (vue.pushScopeId("data-v-e3dfdabb"), n = n(), vue.popScopeId(), n);
1203
- const _hoisted_1 = { class: "container" };
1204
- const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", {
1205
- class: "tocButtonBar",
1206
- style: { "top": "35%" }
1207
- }, null, -1));
1208
- const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", {
1209
- class: "tocButtonBar",
1210
- style: { "top": "66%" }
1211
- }, null, -1));
1212
- const _hoisted_4 = [
1213
- _hoisted_2,
1214
- _hoisted_3
1215
- ];
1216
- const _hoisted_5 = ["title"];
1217
- const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "loadingView" }, "Loading…", -1));
1218
- const _hoisted_7 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "errorView" }, "Error loading book", -1));
1219
- const _hoisted_8 = { key: 0 };
1220
- const _hoisted_9 = { class: "tocArea" };
1221
- const _sfc_main = {
1222
- __name: "VueReader",
1223
- props: {
1224
- title: {
1225
- type: String
1226
- },
1227
- showToc: {
1228
- type: Boolean,
1229
- default: true
1230
- },
1231
- title: {
1232
- type: String,
1233
- default: ""
1234
- },
1235
- getRendition: {
1236
- type: Function
1237
- }
1238
- },
1239
- setup(__props, { expose: __expose }) {
1240
- const props = __props;
1241
- const book = vue.reactive({
1242
- toc: [],
1243
- //目录
1244
- expandedToc: false
1245
- //目录展开
1246
- });
1247
- const { getRendition } = props;
1248
- const { toc, expandedToc } = vue.toRefs(book);
1249
- const bookRef = vue.ref(null);
1250
- const currentHref = vue.ref(null);
1251
- const bookName = vue.ref("");
1252
- let rendition = null;
1253
- const onRelocate = ({ detail }) => {
1254
- var _a;
1255
- currentHref.value = (_a = detail.tocItem) == null ? void 0 : _a.href;
1256
- };
1257
- const onGetRendition = (val) => {
1258
- rendition = val;
1259
- getRendition && getRendition(rendition);
1260
- rendition.addEventListener("load", () => {
1261
- var _a;
1262
- const { book: book2 } = rendition;
1263
- const title = (_a = book2.metadata) == null ? void 0 : _a.title;
1264
- bookName.value = title || "";
1265
- });
1266
- rendition.addEventListener("relocate", onRelocate);
1267
- };
1268
- const onTocChange = (_toc) => {
1269
- toc.value = _toc;
1270
- };
1271
- const toggleToc = () => {
1272
- expandedToc.value = !expandedToc.value;
1273
- };
1274
- const next = () => {
1275
- var _a;
1276
- (_a = bookRef.value) == null ? void 0 : _a.nextPage();
1277
- };
1278
- const pre = () => {
1279
- var _a;
1280
- (_a = bookRef.value) == null ? void 0 : _a.prevPage();
1281
- };
1282
- const setLocation = (href, close = true) => {
1283
- bookRef.value.setLocation(href);
1284
- expandedToc.value = !close;
1285
- };
1286
- __expose({
1287
- nextPage: next,
1288
- prevPage: pre,
1289
- setLocation
1290
- });
1291
- return (_ctx, _cache) => {
1292
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
1293
- vue.createElementVNode("div", {
1294
- class: vue.normalizeClass(["readerArea", { containerExpanded: vue.unref(expandedToc) }])
1295
- }, [
1296
- __props.showToc ? (vue.openBlock(), vue.createElementBlock("button", {
1297
- key: 0,
1298
- class: vue.normalizeClass(["tocButton", { tocButtonExpanded: vue.unref(expandedToc) }]),
1299
- type: "button",
1300
- onClick: toggleToc
1301
- }, _hoisted_4, 2)) : vue.createCommentVNode("", true),
1302
- vue.renderSlot(_ctx.$slots, "title", {}, () => [
1303
- vue.createElementVNode("div", {
1304
- class: "titleArea",
1305
- title: __props.title || bookName.value
1306
- }, vue.toDisplayString(__props.title || bookName.value), 9, _hoisted_5)
1307
- ], true),
1308
- vue.createVNode(BookView, vue.mergeProps({
1309
- ref_key: "bookRef",
1310
- ref: bookRef
1311
- }, _ctx.$attrs, {
1312
- tocChanged: onTocChange,
1313
- getRendition: onGetRendition
1314
- }), {
1315
- loadingView: vue.withCtx(() => [
1316
- vue.renderSlot(_ctx.$slots, "loadingView", {}, () => [
1317
- _hoisted_6
1318
- ], true)
1319
- ]),
1320
- errorView: vue.withCtx(() => [
1321
- vue.renderSlot(_ctx.$slots, "errorView", {}, () => [
1322
- _hoisted_7
1323
- ], true)
1324
- ]),
1325
- _: 3
1326
- }, 16),
1327
- vue.createElementVNode("button", {
1328
- class: "arrow pre",
1329
- onClick: pre
1330
- }, "‹"),
1331
- vue.createElementVNode("button", {
1332
- class: "arrow next",
1333
- onClick: next
1334
- }, "›")
1335
- ], 2),
1336
- __props.showToc ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
1337
- vue.createElementVNode("div", _hoisted_9, [
1338
- vue.createVNode(Toc, {
1339
- toc: vue.unref(toc),
1340
- current: currentHref.value,
1341
- setLocation
1342
- }, null, 8, ["toc", "current"])
1343
- ]),
1344
- vue.unref(expandedToc) ? (vue.openBlock(), vue.createElementBlock("div", {
1345
- key: 0,
1346
- class: "tocBackground",
1347
- onClick: toggleToc
1348
- })) : vue.createCommentVNode("", true)
1349
- ])) : vue.createCommentVNode("", true)
1350
- ]);
1351
- };
1352
- }
1353
- };
1354
- const VueReader = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e3dfdabb"]]);
1355
- exports.BookView = BookView;
1356
- exports.VueReader = VueReader;
1357
- exports.default = VueReader;