@zinejs/core 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +73 -0
- package/dist/controls/icons.d.ts +4 -0
- package/dist/{controls-CcOu_19g.js → controls-DzVdwPJB.js} +13 -4
- package/dist/controls-DzVdwPJB.js.map +1 -0
- package/dist/flipSound-BFXSkWBo.js +78 -0
- package/dist/flipSound-BFXSkWBo.js.map +1 -0
- package/dist/index.js +566 -516
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/{share-BrQa6aYm.js → share-Cq3RsjPr.js} +2 -2
- package/dist/{share-BrQa6aYm.js.map → share-Cq3RsjPr.js.map} +1 -1
- package/dist/sound/clip.d.ts +9 -0
- package/dist/sound/flipSound.d.ts +30 -0
- package/dist/{styles-D_zOGk2q.js → styles-C1Qp5pby.js} +4 -2
- package/dist/styles-C1Qp5pby.js.map +1 -0
- package/dist/zine.d.ts +23 -0
- package/options.schema.json +17 -0
- package/package.json +12 -10
- package/dist/controls-CcOu_19g.js.map +0 -1
- package/dist/styles-D_zOGk2q.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -238,39 +238,39 @@ var _ = class {
|
|
|
238
238
|
}
|
|
239
239
|
#a() {
|
|
240
240
|
let e = [...this.#t.values()], t = e[0], n = e[1];
|
|
241
|
-
if (!t || !n) throw Error("pinch requires two active pointers");
|
|
241
|
+
if (!t || !n) throw Error("Zine: pinch requires two active pointers.");
|
|
242
242
|
return {
|
|
243
243
|
a: t,
|
|
244
244
|
b: n
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
247
|
}, v = "page", y = !1;
|
|
248
|
-
function
|
|
248
|
+
function b() {
|
|
249
249
|
return y ? !1 : (y = !0, !0);
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function x() {
|
|
252
252
|
y = !1;
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function S(e) {
|
|
255
255
|
let t = new URLSearchParams(e.replace(/^#/, "")).get(v);
|
|
256
256
|
if (t === null) return null;
|
|
257
257
|
let n = Number(t);
|
|
258
258
|
return Number.isInteger(n) && n >= 1 ? n - 1 : null;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function C(e, t) {
|
|
261
261
|
let n = new URLSearchParams(e.replace(/^#/, ""));
|
|
262
262
|
return n.set(v, String(t + 1)), `#${n.toString()}`;
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function ee(e, t) {
|
|
265
265
|
let n = null, r = () => {
|
|
266
|
-
let r =
|
|
266
|
+
let r = S(e.location.hash);
|
|
267
267
|
r === null || r === n || (n = r, t(r));
|
|
268
268
|
};
|
|
269
269
|
return e.addEventListener("hashchange", r), {
|
|
270
270
|
push(t) {
|
|
271
271
|
if (t === n) return;
|
|
272
272
|
n = t;
|
|
273
|
-
let r =
|
|
273
|
+
let r = C(e.location.hash, t);
|
|
274
274
|
r !== e.location.hash && e.history?.replaceState?.(e.history.state, "", r);
|
|
275
275
|
},
|
|
276
276
|
stop() {
|
|
@@ -280,49 +280,49 @@ function C(e, t) {
|
|
|
280
280
|
}
|
|
281
281
|
//#endregion
|
|
282
282
|
//#region src/renderer/select.ts
|
|
283
|
-
var
|
|
283
|
+
var te = {
|
|
284
284
|
css: async () => new (await (import("./cssRenderer-Deskm2ND.js"))).CssRenderer(),
|
|
285
285
|
webgl2: async () => new (await (import("./webglRenderer-CmQ_mUrX.js"))).WebglRenderer()
|
|
286
|
-
},
|
|
287
|
-
function
|
|
286
|
+
}, ne = !0;
|
|
287
|
+
function w(e) {
|
|
288
288
|
return typeof e == "object" && !!e && !Array.isArray(e) && typeof e.mount == "function";
|
|
289
289
|
}
|
|
290
|
-
function
|
|
291
|
-
return e.gpu &&
|
|
290
|
+
function T(e) {
|
|
291
|
+
return e.gpu && ne ? ["webgl2", "css"] : ["css"];
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
return { gpu:
|
|
293
|
+
function E() {
|
|
294
|
+
return { gpu: D() };
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function D() {
|
|
297
297
|
try {
|
|
298
298
|
return !!document.createElement("canvas").getContext("webgl2");
|
|
299
299
|
} catch {
|
|
300
300
|
return !1;
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
async function
|
|
304
|
-
if (
|
|
305
|
-
let n = Array.isArray(e) ? e : e === "auto" ?
|
|
303
|
+
async function O(e = "auto", t = E()) {
|
|
304
|
+
if (w(e)) return e;
|
|
305
|
+
let n = Array.isArray(e) ? e : e === "auto" ? T(t) : [e];
|
|
306
306
|
for (let e of n) {
|
|
307
307
|
if (e === "webgl2" && !t.gpu) continue;
|
|
308
|
-
let n =
|
|
308
|
+
let n = te[e];
|
|
309
309
|
if (n) return n();
|
|
310
310
|
}
|
|
311
311
|
throw n.length === 1 && n[0] === "webgl2" && !t.gpu ? Error("renderer: 'webgl2' was forced but this device has no WebGL2. Use 'css' or 'auto'.") : Error(`renderer: none of [${n.join(", ")}] could be loaded — use 'css' or 'auto'.`);
|
|
312
312
|
}
|
|
313
313
|
//#endregion
|
|
314
314
|
//#region src/source/compose.ts
|
|
315
|
-
function
|
|
315
|
+
function re(e, t) {
|
|
316
316
|
let n = typeof t.frontCover == "string", r = typeof t.backCover == "string", i = t.pages != null && Object.keys(t.pages).length > 0;
|
|
317
|
-
return !n && !r && !i ? e : new
|
|
317
|
+
return !n && !r && !i ? e : new ae(e, t);
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function ie(e) {
|
|
320
320
|
return fetch(e).then((t) => {
|
|
321
321
|
if (!t.ok) throw Error(`zine: could not load image "${e}" (HTTP ${t.status}).`);
|
|
322
322
|
return t.blob();
|
|
323
323
|
}).then((e) => createImageBitmap(e));
|
|
324
324
|
}
|
|
325
|
-
var
|
|
325
|
+
var ae = class {
|
|
326
326
|
#e;
|
|
327
327
|
#t;
|
|
328
328
|
#n;
|
|
@@ -391,11 +391,11 @@ var O = class {
|
|
|
391
391
|
}
|
|
392
392
|
#s(e) {
|
|
393
393
|
let t = this.#a.get(e);
|
|
394
|
-
return t === void 0 && (t =
|
|
394
|
+
return t === void 0 && (t = ie(e).catch((t) => {
|
|
395
395
|
throw this.#a.delete(e), t;
|
|
396
396
|
}), this.#a.set(e, t)), t;
|
|
397
397
|
}
|
|
398
|
-
}, k = .25, A = .0015, j = 6, M = 250, N = 24, P = 2 * M, F = 1.2, I = 32, L = 60, R = 2.5, z = 1.5, B = 120, V = .85, H = .82,
|
|
398
|
+
}, k = .25, A = .0015, j = 6, M = 250, N = 24, P = 2 * M, F = 1.2, I = 32, L = 60, R = 2.5, z = 1.5, B = 120, V = .85, H = .82, U = .12, oe = 360, W = 28, G = 260, K = 7e3, q = 2200, J = "zine:hints-learned", Y = "zine:sound-muted";
|
|
399
399
|
function se(e, t, n) {
|
|
400
400
|
let r = Math.max(0, t - I), i = Math.min(e.length, t + n + I), a = e.slice(r, i).replace(/\s+/g, " ").trim();
|
|
401
401
|
return `${r > 0 ? "…" : ""}${a}${i < e.length ? "…" : ""}`;
|
|
@@ -418,129 +418,137 @@ var ce = class {
|
|
|
418
418
|
#m = null;
|
|
419
419
|
#h;
|
|
420
420
|
#g;
|
|
421
|
-
#_
|
|
421
|
+
#_;
|
|
422
|
+
#v;
|
|
423
|
+
#y = null;
|
|
424
|
+
#b = !1;
|
|
425
|
+
#x = !1;
|
|
426
|
+
#S = !1;
|
|
427
|
+
#C = {
|
|
422
428
|
turn: !1,
|
|
423
429
|
zoom: !1,
|
|
424
430
|
pan: !1
|
|
425
431
|
};
|
|
426
|
-
#
|
|
427
|
-
#
|
|
428
|
-
#
|
|
429
|
-
#
|
|
430
|
-
#
|
|
431
|
-
#
|
|
432
|
-
#
|
|
433
|
-
#
|
|
434
|
-
#E;
|
|
435
|
-
#D;
|
|
436
|
-
#O;
|
|
437
|
-
#k = !1;
|
|
438
|
-
#A = null;
|
|
439
|
-
#j = !1;
|
|
432
|
+
#w = null;
|
|
433
|
+
#T = null;
|
|
434
|
+
#E = null;
|
|
435
|
+
#D = null;
|
|
436
|
+
#O = null;
|
|
437
|
+
#k = null;
|
|
438
|
+
#A = !1;
|
|
439
|
+
#j = "";
|
|
440
440
|
#M;
|
|
441
|
-
#N
|
|
441
|
+
#N;
|
|
442
442
|
#P;
|
|
443
|
-
#F;
|
|
444
|
-
#I;
|
|
445
|
-
#L =
|
|
446
|
-
#R
|
|
447
|
-
#z =
|
|
448
|
-
#B
|
|
449
|
-
#V
|
|
450
|
-
#H
|
|
443
|
+
#F = !1;
|
|
444
|
+
#I = null;
|
|
445
|
+
#L = !1;
|
|
446
|
+
#R;
|
|
447
|
+
#z = null;
|
|
448
|
+
#B;
|
|
449
|
+
#V;
|
|
450
|
+
#H;
|
|
451
|
+
#U = null;
|
|
452
|
+
#W = null;
|
|
453
|
+
#G = [];
|
|
454
|
+
#K = 0;
|
|
455
|
+
#q = 0;
|
|
456
|
+
#J = {
|
|
451
457
|
left: null,
|
|
452
458
|
right: null
|
|
453
459
|
};
|
|
454
|
-
#
|
|
455
|
-
#
|
|
456
|
-
#
|
|
457
|
-
#
|
|
458
|
-
|
|
459
|
-
#
|
|
460
|
-
#Y = !1;
|
|
461
|
-
#X = 1;
|
|
462
|
-
#Z = 0;
|
|
463
|
-
#Q = 0;
|
|
464
|
-
#$ = null;
|
|
465
|
-
#ee = !1;
|
|
460
|
+
#Y;
|
|
461
|
+
#X;
|
|
462
|
+
#Z;
|
|
463
|
+
#Q;
|
|
464
|
+
#$;
|
|
465
|
+
#ee = null;
|
|
466
466
|
#te = !1;
|
|
467
|
-
#ne =
|
|
468
|
-
#re =
|
|
469
|
-
#ie =
|
|
467
|
+
#ne = 1;
|
|
468
|
+
#re = 0;
|
|
469
|
+
#ie = 0;
|
|
470
470
|
#ae = null;
|
|
471
|
-
#oe =
|
|
472
|
-
#se =
|
|
471
|
+
#oe = !1;
|
|
472
|
+
#se = !1;
|
|
473
473
|
#ce = null;
|
|
474
|
-
#le =
|
|
474
|
+
#le = null;
|
|
475
475
|
#ue = null;
|
|
476
|
-
#de =
|
|
477
|
-
#fe =
|
|
478
|
-
#pe =
|
|
476
|
+
#de = null;
|
|
477
|
+
#fe = null;
|
|
478
|
+
#pe = null;
|
|
479
479
|
#me = null;
|
|
480
|
-
#he =
|
|
480
|
+
#he = 0;
|
|
481
481
|
#ge = null;
|
|
482
|
-
#_e =
|
|
483
|
-
#ve =
|
|
484
|
-
#ye =
|
|
485
|
-
#be =
|
|
482
|
+
#_e = !1;
|
|
483
|
+
#ve = 1;
|
|
484
|
+
#ye = !1;
|
|
485
|
+
#be = null;
|
|
486
486
|
#xe = null;
|
|
487
487
|
#Se = null;
|
|
488
|
-
#Ce =
|
|
489
|
-
#we;
|
|
488
|
+
#Ce = null;
|
|
489
|
+
#we = null;
|
|
490
490
|
#Te = null;
|
|
491
|
-
#Ee;
|
|
491
|
+
#Ee = -Infinity;
|
|
492
492
|
#De = null;
|
|
493
|
-
#Oe;
|
|
494
|
-
#ke;
|
|
495
|
-
#Ae
|
|
493
|
+
#Oe = null;
|
|
494
|
+
#ke = /* @__PURE__ */ new Set();
|
|
495
|
+
#Ae;
|
|
496
496
|
#je = null;
|
|
497
|
-
#Me
|
|
498
|
-
#Ne =
|
|
499
|
-
#Pe
|
|
500
|
-
#Fe
|
|
501
|
-
#Ie;
|
|
497
|
+
#Me;
|
|
498
|
+
#Ne = null;
|
|
499
|
+
#Pe;
|
|
500
|
+
#Fe;
|
|
501
|
+
#Ie = null;
|
|
502
|
+
#Le = null;
|
|
503
|
+
#Re = "download";
|
|
504
|
+
#ze = 1;
|
|
505
|
+
#Be = 0;
|
|
506
|
+
#Ve = null;
|
|
507
|
+
#He;
|
|
502
508
|
debug = { setFlipProgress: (e, t) => {
|
|
503
|
-
this
|
|
509
|
+
this.#ae?.setFlipProgress(e, t);
|
|
504
510
|
} };
|
|
505
511
|
constructor(e, t) {
|
|
506
|
-
|
|
512
|
+
ue(e, t), this.#e = e, t.width !== void 0 && (e.style.width = `${t.width}px`), t.height !== void 0 && (e.style.height = `${t.height}px`), this.#t = re(t.source, {
|
|
507
513
|
frontCover: t.frontCover,
|
|
508
514
|
backCover: t.backCover,
|
|
509
515
|
pages: t.pages
|
|
510
516
|
});
|
|
511
517
|
let n = t.direction ?? "ltr";
|
|
512
|
-
this.#a = n, this.#
|
|
518
|
+
this.#a = n, this.#V = (t.deepLink ?? !0) && b(), this.#H = t.disableContextMenu ?? !1, this.#o = t.spreadMode ?? "cover", this.#s = this.#o, this.#c = t.curl ?? "cone", this.#u = t.clickToFlip ?? "edge", this.#d = t.clickZoneSize ?? 64, this.#f = t.cursorHints ?? !0;
|
|
513
519
|
let r = t.hints ?? !0;
|
|
514
|
-
this.#h = r === !0 || r !== !1 && (r.enabled ?? !0), this.#g = r !== !0 && r !== !1 && (r.persist ?? !1), this.#g && this.#
|
|
515
|
-
let i = t.
|
|
520
|
+
this.#h = r === !0 || r !== !1 && (r.enabled ?? !0), this.#g = r !== !0 && r !== !1 && (r.persist ?? !1), this.#g && this.#yt();
|
|
521
|
+
let i = t.sound ?? !1;
|
|
522
|
+
this.#_ = i !== !1, this.#v = i === !0 || i === !1 ? {} : i, this.#b = typeof i == "object" && i ? i.muted ?? !1 : !1, this.#x = typeof i == "object" && i ? i.persist ?? !1 : !1, this.#_ && this.#x && this.#Ye(), this.#P = t.singlePageThreshold ?? 640, this.#R = t.responsiveSpread ?? !0, this.#Ae = t.controls ?? !0, this.#Me = t.contextMenu ?? !t.disableContextMenu, this.#Pe = new Set(t.hideControls ?? []), this.#Fe = t.loading ?? !0, this.#B = t.startPage, typeof this.#t.open != "function" && this.#wn(), this.#Y = t.flipDuration ?? 800, this.#X = t.zoom?.enabled ?? !0, this.#Z = t.zoom?.wheel ?? !0;
|
|
523
|
+
let a = t.zoom?.doubleClick, o = a === !1 ? [] : [...a ?? [
|
|
516
524
|
1,
|
|
517
525
|
2,
|
|
518
526
|
4
|
|
519
527
|
]].sort((e, t) => e - t);
|
|
520
|
-
this.#
|
|
521
|
-
let
|
|
522
|
-
this.#
|
|
528
|
+
this.#Q = o.length > 0 ? o : null, this.#$ = t.zoom?.max ?? 4;
|
|
529
|
+
let s = this.#X && this.#Q !== null, c = t.zoom?.doubleClickInFlipZone ?? this.#u === "half";
|
|
530
|
+
this.#M = this.#u !== "off" && s && c && t.clickFlipDelay !== 0, this.#N = this.#M ? t.clickFlipDelay ?? M : 0, this.#He = this.#Ut(t.renderer ?? "auto");
|
|
523
531
|
}
|
|
524
532
|
get ready() {
|
|
525
|
-
return this.#
|
|
533
|
+
return this.#He;
|
|
526
534
|
}
|
|
527
535
|
getPageCount() {
|
|
528
536
|
return this.#t.pageCount;
|
|
529
537
|
}
|
|
530
538
|
getPage() {
|
|
531
|
-
return this.#
|
|
539
|
+
return this.#q;
|
|
532
540
|
}
|
|
533
541
|
get container() {
|
|
534
542
|
return this.#e;
|
|
535
543
|
}
|
|
536
544
|
getPageBox() {
|
|
537
|
-
return this
|
|
545
|
+
return this.#ae?.measure().book ?? null;
|
|
538
546
|
}
|
|
539
547
|
getSpreads() {
|
|
540
|
-
return this.#
|
|
548
|
+
return this.#G;
|
|
541
549
|
}
|
|
542
550
|
getSpreadIndex() {
|
|
543
|
-
return this.#
|
|
551
|
+
return this.#K;
|
|
544
552
|
}
|
|
545
553
|
getDirection() {
|
|
546
554
|
return this.#a;
|
|
@@ -549,44 +557,44 @@ var ce = class {
|
|
|
549
557
|
return this.#o;
|
|
550
558
|
}
|
|
551
559
|
isSinglePage() {
|
|
552
|
-
return this.#
|
|
560
|
+
return this.#F;
|
|
553
561
|
}
|
|
554
562
|
setSpreadMode(e) {
|
|
555
|
-
e !== this.#o && (this.#o = e, this.#
|
|
563
|
+
e !== this.#o && (this.#o = e, this.#L = !1, this.#cn(), this.#ln());
|
|
556
564
|
}
|
|
557
565
|
toggleSpreadMode() {
|
|
558
566
|
this.setSpreadMode(this.#o === "single" ? this.#s === "single" ? "double" : this.#s : "single");
|
|
559
567
|
}
|
|
560
568
|
getResponsiveSpread() {
|
|
561
|
-
return this.#
|
|
569
|
+
return this.#R;
|
|
562
570
|
}
|
|
563
571
|
isResponsiveSingle() {
|
|
564
|
-
return this.#
|
|
572
|
+
return this.#L && this.#o !== "single";
|
|
565
573
|
}
|
|
566
574
|
setResponsiveSpread(e) {
|
|
567
|
-
if (e !== this.#
|
|
568
|
-
if (this.#
|
|
569
|
-
let e = this
|
|
575
|
+
if (e !== this.#R) {
|
|
576
|
+
if (this.#R = e, e) {
|
|
577
|
+
let e = this.#ae?.measure().containerWidth;
|
|
570
578
|
if (e === void 0) return;
|
|
571
|
-
this.#
|
|
579
|
+
this.#L = !1, this.#sn(e);
|
|
572
580
|
} else {
|
|
573
|
-
if (!this.#
|
|
574
|
-
this.#
|
|
581
|
+
if (!this.#L) return;
|
|
582
|
+
this.#L = !1, this.#cn();
|
|
575
583
|
}
|
|
576
|
-
this
|
|
584
|
+
this.#ln();
|
|
577
585
|
}
|
|
578
586
|
}
|
|
579
587
|
getPageImage(e) {
|
|
580
|
-
return this.#
|
|
588
|
+
return this.#xn(e);
|
|
581
589
|
}
|
|
582
590
|
canFlipNext() {
|
|
583
|
-
return this.#
|
|
591
|
+
return this.#K + 1 < this.#G.length;
|
|
584
592
|
}
|
|
585
593
|
canFlipPrev() {
|
|
586
|
-
return this.#
|
|
594
|
+
return this.#K > 0;
|
|
587
595
|
}
|
|
588
596
|
getMaxZoom() {
|
|
589
|
-
return this
|
|
597
|
+
return this.#$;
|
|
590
598
|
}
|
|
591
599
|
canSearch() {
|
|
592
600
|
return typeof this.#t.getText == "function";
|
|
@@ -603,7 +611,7 @@ var ce = class {
|
|
|
603
611
|
async print() {
|
|
604
612
|
let e = await this.getSourceFile(), t = this.#e.ownerDocument;
|
|
605
613
|
if (!e || !t) return !1;
|
|
606
|
-
let { url: n, revoke: r } = await this.#
|
|
614
|
+
let { url: n, revoke: r } = await this.#Ue(e, t), i = t.createElement("iframe");
|
|
607
615
|
return i.style.cssText = "position:fixed;right:0;bottom:0;width:1px;height:1px;opacity:0;border:0;", i.setAttribute("aria-hidden", "true"), i.src = n, new Promise((e) => {
|
|
608
616
|
let a = !1, o = (t) => {
|
|
609
617
|
a || (a = !0, setTimeout(() => {
|
|
@@ -625,11 +633,11 @@ var ce = class {
|
|
|
625
633
|
return typeof this.#t.getOutline == "function";
|
|
626
634
|
}
|
|
627
635
|
getOutline() {
|
|
628
|
-
if (!this.#
|
|
636
|
+
if (!this.#Oe) {
|
|
629
637
|
let e = this.#t.getOutline;
|
|
630
|
-
this.#
|
|
638
|
+
this.#Oe = typeof e == "function" ? Promise.resolve(e.call(this.#t)).catch(() => []) : Promise.resolve([]);
|
|
631
639
|
}
|
|
632
|
-
return this.#
|
|
640
|
+
return this.#Oe;
|
|
633
641
|
}
|
|
634
642
|
async getSourceFile() {
|
|
635
643
|
let e = this.#t.getDownload;
|
|
@@ -640,11 +648,11 @@ var ce = class {
|
|
|
640
648
|
if (!e) return !1;
|
|
641
649
|
let t = this.#e.ownerDocument;
|
|
642
650
|
if (!t) return !1;
|
|
643
|
-
let { url: n, revoke: r } = await this.#
|
|
651
|
+
let { url: n, revoke: r } = await this.#Ue(e, t), i = t.createElement("a");
|
|
644
652
|
return i.href = n, i.download = e.filename, i.rel = "noopener", t.body.appendChild(i), i.click(), i.remove(), r && setTimeout(() => URL.revokeObjectURL(n), 1e4), !0;
|
|
645
653
|
}
|
|
646
|
-
async #
|
|
647
|
-
if (e.revoke || !this.#
|
|
654
|
+
async #Ue(e, t) {
|
|
655
|
+
if (e.revoke || !this.#We(e.url, t)) return {
|
|
648
656
|
url: e.url,
|
|
649
657
|
revoke: e.revoke ?? !1
|
|
650
658
|
};
|
|
@@ -661,7 +669,7 @@ var ce = class {
|
|
|
661
669
|
};
|
|
662
670
|
}
|
|
663
671
|
}
|
|
664
|
-
#
|
|
672
|
+
#We(e, t) {
|
|
665
673
|
let n = t.defaultView?.location?.href;
|
|
666
674
|
if (!n) return !1;
|
|
667
675
|
try {
|
|
@@ -694,92 +702,112 @@ var ce = class {
|
|
|
694
702
|
return a;
|
|
695
703
|
}
|
|
696
704
|
flipNext() {
|
|
697
|
-
this.#
|
|
705
|
+
this.#Ge(1);
|
|
698
706
|
}
|
|
699
707
|
flipPrev() {
|
|
700
|
-
this.#
|
|
708
|
+
this.#Ge(-1);
|
|
701
709
|
}
|
|
702
|
-
#
|
|
703
|
-
this.#
|
|
710
|
+
#Ge(e) {
|
|
711
|
+
this.#Ke(() => this.#$e(this.#K + e));
|
|
704
712
|
}
|
|
705
713
|
flipTo(e) {
|
|
706
|
-
let t =
|
|
707
|
-
this.#
|
|
714
|
+
let t = X(e, 0, Math.max(0, this.#t.pageCount - 1));
|
|
715
|
+
this.#Ke(() => this.#$e(this.#Cn(t)));
|
|
708
716
|
}
|
|
709
|
-
#
|
|
710
|
-
this.#i.state === "idle" ? e() : this.#
|
|
717
|
+
#Ke(e) {
|
|
718
|
+
this.#i.state === "idle" ? e() : this.#me ? (this.#pe = null, this.#qe(), e()) : this.#pe = e;
|
|
711
719
|
}
|
|
712
|
-
#
|
|
713
|
-
let e = this.#
|
|
714
|
-
e && (this.#
|
|
720
|
+
#qe() {
|
|
721
|
+
let e = this.#me;
|
|
722
|
+
e && (this.#me = null, this.#ce !== null && (cancelAnimationFrame(this.#ce), this.#ce = null), this.#ae?.setFlipProgress(e.toT, e.direction), e.onDone());
|
|
715
723
|
}
|
|
716
|
-
#
|
|
717
|
-
let e = this.#
|
|
724
|
+
#Je() {
|
|
725
|
+
let e = this.#pe;
|
|
718
726
|
if (!e) {
|
|
719
|
-
this.#
|
|
727
|
+
this.#_n();
|
|
720
728
|
return;
|
|
721
729
|
}
|
|
722
|
-
this.#
|
|
730
|
+
this.#pe = null, e();
|
|
723
731
|
}
|
|
724
732
|
getZoom() {
|
|
725
|
-
return this.#
|
|
733
|
+
return this.#ne;
|
|
726
734
|
}
|
|
727
735
|
setZoom(e, t) {
|
|
728
|
-
if (!this
|
|
729
|
-
this.#
|
|
730
|
-
let n =
|
|
731
|
-
x: i.x + this.#
|
|
732
|
-
y: i.y + this.#
|
|
736
|
+
if (!this.#ae || !this.#X) return;
|
|
737
|
+
this.#wt(), this.#Dt();
|
|
738
|
+
let n = X(e, 1, this.#$), r = this.#ae.measure(), i = r.screenAt?.(this.#ne), a = t ?? (i ? {
|
|
739
|
+
x: i.x + this.#re + i.width / 2,
|
|
740
|
+
y: i.y + this.#ie + i.height / 2
|
|
733
741
|
} : null) ?? {
|
|
734
742
|
x: r.containerWidth / 2,
|
|
735
743
|
y: r.containerHeight / 2
|
|
736
|
-
}, o = this.#
|
|
737
|
-
[s, c] = this.#
|
|
744
|
+
}, o = this.#ne, s = n === 1 ? 0 : a.x - n / o * (a.x - this.#re), c = n === 1 ? 0 : a.y - n / o * (a.y - this.#ie);
|
|
745
|
+
[s, c] = this.#Qe(s, c, n, r.containerWidth, r.containerHeight), this.#ne = n, this.#re = s, this.#ie = c, this.#ae.setViewTransform(n, s, c), o > 1 != n > 1 && this.#Ze(), this.#pn(), this.#_t(), o <= 1 && n > 1 && (this.#bt("zoom"), this.#Ot()), this.#n.emit("zoomChanged", { scale: n });
|
|
738
746
|
}
|
|
739
747
|
resetZoom() {
|
|
740
748
|
this.setZoom(1);
|
|
741
749
|
}
|
|
742
|
-
|
|
743
|
-
|
|
750
|
+
isSoundEnabled() {
|
|
751
|
+
return this.#_;
|
|
752
|
+
}
|
|
753
|
+
isSoundMuted() {
|
|
754
|
+
return this.#_ && this.#b;
|
|
755
|
+
}
|
|
756
|
+
setSoundMuted(e) {
|
|
757
|
+
this.#_ && (this.#b = e, this.#y?.setMuted(e), this.#x && this.#Xe(e), e || this.#Wt());
|
|
744
758
|
}
|
|
745
|
-
#
|
|
746
|
-
|
|
759
|
+
#Ye() {
|
|
760
|
+
try {
|
|
761
|
+
let e = localStorage.getItem(Y);
|
|
762
|
+
(e === "true" || e === "false") && (this.#b = e === "true");
|
|
763
|
+
} catch {}
|
|
764
|
+
}
|
|
765
|
+
#Xe(e) {
|
|
766
|
+
try {
|
|
767
|
+
localStorage.setItem(Y, String(e));
|
|
768
|
+
} catch {}
|
|
769
|
+
}
|
|
770
|
+
#Ze() {
|
|
771
|
+
this.#e.style.touchAction = this.#ne > 1 ? "none" : "pan-y";
|
|
772
|
+
}
|
|
773
|
+
#Qe(e, t, n, r, i) {
|
|
774
|
+
let a = typeof devicePixelRatio == "number" && devicePixelRatio > 0 ? devicePixelRatio : 1, o = (e) => Math.round(e * a) / a || 0, s = this.#ae?.measure().screenAt?.(n) ?? {
|
|
747
775
|
x: 0,
|
|
748
776
|
y: 0,
|
|
749
777
|
width: r * n,
|
|
750
778
|
height: i * n
|
|
751
|
-
}, [c, l] =
|
|
752
|
-
return [o(
|
|
779
|
+
}, [c, l] = Z(s.x, s.width, r), [u, d] = Z(s.y, s.height, i);
|
|
780
|
+
return [o(X(e, c, l)), o(X(t, u, d))];
|
|
753
781
|
}
|
|
754
782
|
on(e, t) {
|
|
755
783
|
return this.#n.on(e, t);
|
|
756
784
|
}
|
|
757
785
|
destroy() {
|
|
758
|
-
this.#
|
|
786
|
+
this.#se = !0, this.#ce !== null && cancelAnimationFrame(this.#ce), this.#me = null, this.#pe = null, this.#Pt(), this.#St(), this.#wt(), this.#Dt(), this.#Nt(), this.#At(), this.#y?.destroy(), this.#y = null, this.#ee?.disconnect(), this.#U?.stop(), this.#U = null, this.#W?.(), this.#V && x(), this.#je?.(), this.#Ne?.(), this.#Yt(), this.#De?.(), this.#Se?.(), this.#we?.(), this.#Ce?.(), this.#m?.(), this.#xe?.(), this.#Ve !== null && clearTimeout(this.#Ve), this.#Be++, this.#ae?.destroy(), this.#ae = null, this.#t.destroy(), this.#n.clear();
|
|
759
787
|
}
|
|
760
|
-
|
|
761
|
-
if (e < 0 || e >= this.#
|
|
762
|
-
let t = e > this.#
|
|
788
|
+
#$e(e) {
|
|
789
|
+
if (e < 0 || e >= this.#G.length || e === this.#K || (this.#wt(), this.#Dt(), this.#i.send("flip") === null)) return;
|
|
790
|
+
let t = e > this.#K ? "forward" : "backward", n = this.#it(e);
|
|
763
791
|
this.#n.emit("flipStart", {
|
|
764
|
-
from: this.#
|
|
792
|
+
from: this.#q,
|
|
765
793
|
to: n
|
|
766
|
-
}), this.#
|
|
794
|
+
}), this.#Gt(), this.#et(e, t, n, ++this.#he);
|
|
767
795
|
}
|
|
768
|
-
async #
|
|
769
|
-
let i = this.#
|
|
796
|
+
async #et(e, t, n, r) {
|
|
797
|
+
let i = this.#G[e], a = i ? await this.#bn(i) : {
|
|
770
798
|
left: null,
|
|
771
799
|
right: null
|
|
772
800
|
};
|
|
773
|
-
r === this.#
|
|
774
|
-
fill: this.#
|
|
775
|
-
curl: this.#
|
|
801
|
+
r === this.#he && (this.#ae?.beginFlip(this.#J, a, t, {
|
|
802
|
+
fill: this.#F,
|
|
803
|
+
curl: this.#an(),
|
|
776
804
|
anchor: { y: this.#l }
|
|
777
|
-
}), this.#
|
|
805
|
+
}), this.#tt(0, 1, t, () => this.#rt(e, n, a), () => this.#nt(n)));
|
|
778
806
|
}
|
|
779
|
-
#
|
|
780
|
-
let a = this.#
|
|
807
|
+
#tt(e, t, n, r, i) {
|
|
808
|
+
let a = this.#in() * Math.abs(t - e);
|
|
781
809
|
if (a <= 0) {
|
|
782
|
-
this
|
|
810
|
+
this.#ae?.setFlipProgress(t, n), r();
|
|
783
811
|
return;
|
|
784
812
|
}
|
|
785
813
|
let o = {
|
|
@@ -787,60 +815,60 @@ var ce = class {
|
|
|
787
815
|
direction: n,
|
|
788
816
|
onDone: r
|
|
789
817
|
};
|
|
790
|
-
this.#
|
|
818
|
+
this.#me = o;
|
|
791
819
|
let s = performance.now(), c = !1, l = (u) => {
|
|
792
|
-
if (this.#
|
|
793
|
-
let d = Math.min(1, (u - s) / a), f =
|
|
794
|
-
i && !c && f >= (this.#
|
|
820
|
+
if (this.#me !== o) return;
|
|
821
|
+
let d = Math.min(1, (u - s) / a), f = le(d);
|
|
822
|
+
i && !c && f >= (this.#F ? H : V) && (c = !0, i()), d < 1 ? (this.#ae?.setFlipProgress(e + (t - e) * f, n), this.#ce = requestAnimationFrame(l)) : (this.#ae?.setFlipProgress(t, n), this.#ce = null, this.#me = null, r());
|
|
795
823
|
};
|
|
796
|
-
this.#
|
|
824
|
+
this.#ce = requestAnimationFrame(l);
|
|
797
825
|
}
|
|
798
|
-
#
|
|
799
|
-
this.#
|
|
826
|
+
#nt(e) {
|
|
827
|
+
this.#q !== e && (this.#q = e, this.#rn(), this.#n.emit("pageChanged", { page: e }));
|
|
800
828
|
}
|
|
801
|
-
#
|
|
802
|
-
let r = this.#
|
|
803
|
-
this.#
|
|
829
|
+
#rt(e, t, n) {
|
|
830
|
+
let r = this.#G[e];
|
|
831
|
+
this.#K = e, this.#J = n, r && this.#un(r, n), this.#Sn(), this.#i.send("settle"), this.#Ee = performance.now(), this.#nt(t), this.#bt("turn"), this.#_t(), this.#n.emit("flipEnd", { page: t }), this.#Je();
|
|
804
832
|
}
|
|
805
|
-
#
|
|
806
|
-
let t = this.#
|
|
807
|
-
if (!t) return this.#
|
|
833
|
+
#it(e) {
|
|
834
|
+
let t = this.#G[e];
|
|
835
|
+
if (!t) return this.#q;
|
|
808
836
|
let n = [t.left, t.right].filter((e) => e !== null);
|
|
809
|
-
return n.length > 0 ? Math.min(...n) : this.#
|
|
837
|
+
return n.length > 0 ? Math.min(...n) : this.#q;
|
|
810
838
|
}
|
|
811
|
-
#
|
|
812
|
-
if (this.#
|
|
813
|
-
if (this.#
|
|
839
|
+
#at(e, t) {
|
|
840
|
+
if (this.#_e || !this.#ae) return;
|
|
841
|
+
if (this.#Dt(), this.#Pt(), this.#ne > 1) {
|
|
814
842
|
if (this.#i.send("panStart") === null) return;
|
|
815
|
-
this.#
|
|
816
|
-
baseTx: this.#
|
|
817
|
-
baseTy: this.#
|
|
843
|
+
this.#ge = {
|
|
844
|
+
baseTx: this.#re,
|
|
845
|
+
baseTy: this.#ie
|
|
818
846
|
};
|
|
819
847
|
return;
|
|
820
848
|
}
|
|
821
|
-
let n = this.#
|
|
822
|
-
this.#
|
|
849
|
+
let n = this.#ft(), r = this.#pt(e, t);
|
|
850
|
+
this.#de = r;
|
|
823
851
|
let i = Math.min(n.width, n.height) * k, a = r.x >= 0 && r.x <= n.width && r.y >= 0 && r.y <= n.height, o = r.x <= i || r.x >= n.width - i, s = a && o;
|
|
824
852
|
if (this.#i.state !== "idle") {
|
|
825
|
-
if (!this.#
|
|
826
|
-
this.#
|
|
853
|
+
if (!this.#me || !s) {
|
|
854
|
+
this.#ue = null;
|
|
827
855
|
return;
|
|
828
856
|
}
|
|
829
|
-
this.#
|
|
857
|
+
this.#qe();
|
|
830
858
|
}
|
|
831
859
|
if (!s) return;
|
|
832
|
-
this.#l =
|
|
833
|
-
let c = r.x > n.width / 2, l = this.#a === "rtl" ? !c : c, u = this.#
|
|
834
|
-
u < 0 || u >= this.#
|
|
860
|
+
this.#l = X(r.y / n.height, 0, 1);
|
|
861
|
+
let c = r.x > n.width / 2, l = this.#a === "rtl" ? !c : c, u = this.#K + (l ? 1 : -1);
|
|
862
|
+
u < 0 || u >= this.#G.length || (this.#ue = {
|
|
835
863
|
direction: l ? "forward" : "backward",
|
|
836
864
|
targetIndex: u,
|
|
837
|
-
toPage: this.#
|
|
865
|
+
toPage: this.#it(u),
|
|
838
866
|
width: n.width
|
|
839
867
|
});
|
|
840
868
|
}
|
|
841
|
-
#
|
|
842
|
-
let e = this.#
|
|
843
|
-
e && (this.#
|
|
869
|
+
#ot() {
|
|
870
|
+
let e = this.#ue;
|
|
871
|
+
e && (this.#ue = null, this.#i.send("grab") !== null && (this.#le = {
|
|
844
872
|
direction: e.direction,
|
|
845
873
|
targetIndex: e.targetIndex,
|
|
846
874
|
toPage: e.toPage,
|
|
@@ -851,75 +879,75 @@ var ce = class {
|
|
|
851
879
|
width: e.width,
|
|
852
880
|
t: 0
|
|
853
881
|
}, this.#n.emit("flipStart", {
|
|
854
|
-
from: this.#
|
|
882
|
+
from: this.#q,
|
|
855
883
|
to: e.toPage
|
|
856
|
-
}), this
|
|
884
|
+
}), this.#st(e.targetIndex, e.direction)));
|
|
857
885
|
}
|
|
858
|
-
async
|
|
859
|
-
let n = this.#
|
|
886
|
+
async #st(e, t) {
|
|
887
|
+
let n = this.#G[e], r = n ? await this.#bn(n) : {
|
|
860
888
|
left: null,
|
|
861
889
|
right: null
|
|
862
890
|
};
|
|
863
|
-
this.#
|
|
864
|
-
fill: this.#
|
|
865
|
-
curl: this.#
|
|
891
|
+
this.#le?.targetIndex === e && (this.#le.toContent = r, this.#ae?.beginFlip(this.#J, r, t, {
|
|
892
|
+
fill: this.#F,
|
|
893
|
+
curl: this.#an(),
|
|
866
894
|
anchor: { y: this.#l }
|
|
867
|
-
}), this
|
|
868
|
-
}
|
|
869
|
-
#
|
|
870
|
-
if (this.#
|
|
871
|
-
if (this.#
|
|
872
|
-
if (!this
|
|
873
|
-
let n = this
|
|
874
|
-
this.#
|
|
895
|
+
}), this.#ae?.setFlipProgress(this.#le.t, t));
|
|
896
|
+
}
|
|
897
|
+
#ct(e, t) {
|
|
898
|
+
if (this.#_e) return;
|
|
899
|
+
if (this.#ge) {
|
|
900
|
+
if (!this.#ae) return;
|
|
901
|
+
let n = this.#ae.measure(), [r, i] = this.#Qe(this.#ge.baseTx + e, this.#ge.baseTy + t, this.#ne, n.containerWidth, n.containerHeight);
|
|
902
|
+
this.#re = r, this.#ie = i, this.#ae.setViewTransform(this.#ne, r, i), this.#pn(), this.#bt("pan"), this.#At();
|
|
875
903
|
return;
|
|
876
904
|
}
|
|
877
|
-
this.#
|
|
878
|
-
let n = this.#
|
|
879
|
-
n && (n.t =
|
|
880
|
-
}
|
|
881
|
-
#
|
|
882
|
-
if (this.#
|
|
883
|
-
if (this.#
|
|
884
|
-
this.#
|
|
905
|
+
this.#ue && Math.hypot(e, t) > j && this.#ot();
|
|
906
|
+
let n = this.#le;
|
|
907
|
+
n && (n.t = X((n.direction === "forward" ? -e : e) / n.width, 0, 1), this.#ae?.setFlipProgress(n.t, n.direction));
|
|
908
|
+
}
|
|
909
|
+
#lt(e) {
|
|
910
|
+
if (this.#_e) return;
|
|
911
|
+
if (this.#ge) {
|
|
912
|
+
this.#ge = null, this.#i.send("panEnd"), this.#_t();
|
|
885
913
|
return;
|
|
886
914
|
}
|
|
887
|
-
let t = this.#
|
|
915
|
+
let t = this.#le;
|
|
888
916
|
if (!t) {
|
|
889
|
-
this.#
|
|
917
|
+
this.#ue = null, this.#ut(e) || this.#dt(e);
|
|
890
918
|
return;
|
|
891
919
|
}
|
|
892
|
-
this.#
|
|
920
|
+
this.#le = null, this.#i.send("release");
|
|
893
921
|
let n = e.swipe && Math.abs(e.vx) > Math.abs(e.vy), r = t.direction === "forward" ? e.vx < 0 : e.vx > 0, i = n && r, a = n && !r;
|
|
894
|
-
i || t.t >= .5 && !a ? this.#
|
|
922
|
+
i || t.t >= .5 && !a ? (this.#Gt(), this.#tt(t.t, 1, t.direction, () => this.#rt(t.targetIndex, t.toPage, t.toContent), () => this.#nt(t.toPage))) : this.#tt(t.t, 0, t.direction, () => this.#Ft());
|
|
895
923
|
}
|
|
896
|
-
#
|
|
897
|
-
if (this.#
|
|
924
|
+
#ut(e) {
|
|
925
|
+
if (this.#ne > 1 || !e.swipe || Math.abs(e.dx) <= Math.abs(e.dy)) return !1;
|
|
898
926
|
let t = this.#a === "rtl" ? e.dx > 0 : e.dx < 0, n = t ? "forward" : "backward";
|
|
899
|
-
if (!this.#
|
|
927
|
+
if (!this.#ht(n)) return this.#Et(n), !1;
|
|
900
928
|
let r = t ? 1 : -1;
|
|
901
|
-
return this.#
|
|
929
|
+
return this.#Ke(() => this.#$e(this.#K + r)), !0;
|
|
902
930
|
}
|
|
903
|
-
#
|
|
904
|
-
if (this.#u === "off" || this.#
|
|
905
|
-
let t = this.#
|
|
931
|
+
#dt(e) {
|
|
932
|
+
if (this.#u === "off" || this.#ne > 1 || !this.#de || Math.abs(e.dx) > j || Math.abs(e.dy) > j) return;
|
|
933
|
+
let t = this.#mt(this.#de);
|
|
906
934
|
if (!t) return;
|
|
907
|
-
if (!this.#
|
|
908
|
-
this.#
|
|
935
|
+
if (!this.#ht(t)) {
|
|
936
|
+
this.#Et(t);
|
|
909
937
|
return;
|
|
910
938
|
}
|
|
911
|
-
this.#l =
|
|
912
|
-
let n = t === "forward" ? 1 : -1, r = () => this
|
|
913
|
-
if (this.#
|
|
914
|
-
this.#
|
|
939
|
+
this.#l = X(this.#de.y / this.#ft().height, 0, 1);
|
|
940
|
+
let n = t === "forward" ? 1 : -1, r = () => this.#$e(this.#K + n);
|
|
941
|
+
if (this.#Pt(), this.#N <= 0) {
|
|
942
|
+
this.#Ke(r);
|
|
915
943
|
return;
|
|
916
944
|
}
|
|
917
|
-
this.#
|
|
918
|
-
this.#
|
|
919
|
-
}, this.#
|
|
945
|
+
this.#fe = setTimeout(() => {
|
|
946
|
+
this.#fe = null, this.#Ke(r);
|
|
947
|
+
}, this.#N);
|
|
920
948
|
}
|
|
921
|
-
#
|
|
922
|
-
let e = this
|
|
949
|
+
#ft() {
|
|
950
|
+
let e = this.#ae.measure();
|
|
923
951
|
return e.content ?? e.book ?? {
|
|
924
952
|
x: 0,
|
|
925
953
|
y: 0,
|
|
@@ -927,351 +955,364 @@ var ce = class {
|
|
|
927
955
|
height: e.containerHeight
|
|
928
956
|
};
|
|
929
957
|
}
|
|
930
|
-
#
|
|
931
|
-
let n = this.#e.getBoundingClientRect(), r = this.#
|
|
958
|
+
#pt(e, t) {
|
|
959
|
+
let n = this.#e.getBoundingClientRect(), r = this.#ft();
|
|
932
960
|
return {
|
|
933
961
|
x: e - n.left - r.x,
|
|
934
962
|
y: t - n.top - r.y
|
|
935
963
|
};
|
|
936
964
|
}
|
|
937
|
-
#
|
|
938
|
-
if (!this
|
|
939
|
-
let t = this.#
|
|
965
|
+
#mt(e) {
|
|
966
|
+
if (!this.#ae) return null;
|
|
967
|
+
let t = this.#ft().width, n;
|
|
940
968
|
if (n = this.#u === "half" ? e.x > t / 2 ? "right" : "left" : e.x <= this.#d ? "left" : e.x >= t - this.#d ? "right" : null, !n) return null;
|
|
941
969
|
let r = this.#a === "rtl" ? "left" : "right";
|
|
942
970
|
return n === r ? "forward" : "backward";
|
|
943
971
|
}
|
|
944
|
-
#
|
|
945
|
-
let t = this.#
|
|
946
|
-
return t >= 0 && t < this.#
|
|
972
|
+
#ht(e) {
|
|
973
|
+
let t = this.#K + (e === "forward" ? 1 : -1);
|
|
974
|
+
return t >= 0 && t < this.#G.length;
|
|
947
975
|
}
|
|
948
|
-
#
|
|
976
|
+
#gt() {
|
|
949
977
|
let e = (e) => {
|
|
950
978
|
let t = e;
|
|
951
979
|
this.#p = {
|
|
952
980
|
x: t.clientX,
|
|
953
981
|
y: t.clientY
|
|
954
|
-
}, this.#
|
|
982
|
+
}, this.#_t();
|
|
955
983
|
}, t = () => {
|
|
956
|
-
this.#p = null, this.#
|
|
984
|
+
this.#p = null, this.#_t();
|
|
957
985
|
};
|
|
958
986
|
this.#e.addEventListener("pointermove", e), this.#e.addEventListener("pointerleave", t), this.#m = () => {
|
|
959
987
|
this.#e.removeEventListener("pointermove", e), this.#e.removeEventListener("pointerleave", t);
|
|
960
988
|
};
|
|
961
989
|
}
|
|
962
|
-
#
|
|
963
|
-
if (!this.#f || !this
|
|
990
|
+
#_t() {
|
|
991
|
+
if (!this.#f || !this.#ae) return;
|
|
964
992
|
let e = "";
|
|
965
|
-
this.#
|
|
993
|
+
this.#le || this.#ge ? e = "grabbing" : this.#p && (e = this.#vt(this.#p.x, this.#p.y)), this.#e.style.cursor = e;
|
|
966
994
|
}
|
|
967
|
-
#
|
|
968
|
-
if (!this
|
|
969
|
-
let n = this.#
|
|
995
|
+
#vt(e, t) {
|
|
996
|
+
if (!this.#ae) return "";
|
|
997
|
+
let n = this.#ft(), r = this.#pt(e, t);
|
|
970
998
|
if (r.x < 0 || r.y < 0 || r.x > n.width || r.y > n.height) return "";
|
|
971
|
-
if (this.#
|
|
972
|
-
let i = this.#
|
|
973
|
-
return i && this.#
|
|
999
|
+
if (this.#ne > 1) return "grab";
|
|
1000
|
+
let i = this.#mt(r);
|
|
1001
|
+
return i && this.#ht(i) ? "pointer" : this.#X && this.#Q !== null ? "zoom-in" : "";
|
|
974
1002
|
}
|
|
975
|
-
#
|
|
1003
|
+
#yt() {
|
|
976
1004
|
try {
|
|
977
1005
|
let e = localStorage.getItem(J);
|
|
978
1006
|
if (!e) return;
|
|
979
1007
|
let t = JSON.parse(e);
|
|
980
|
-
this.#
|
|
1008
|
+
this.#C = {
|
|
981
1009
|
turn: t.turn === !0,
|
|
982
1010
|
zoom: t.zoom === !0,
|
|
983
1011
|
pan: t.pan === !0
|
|
984
1012
|
};
|
|
985
1013
|
} catch {}
|
|
986
1014
|
}
|
|
987
|
-
#
|
|
988
|
-
if (!this.#
|
|
989
|
-
localStorage.setItem(J, JSON.stringify(this.#
|
|
1015
|
+
#bt(e) {
|
|
1016
|
+
if (!this.#C[e] && (this.#C[e] = !0, e === "turn" && this.#St(), e === "zoom" && this.#Nt(), this.#g)) try {
|
|
1017
|
+
localStorage.setItem(J, JSON.stringify(this.#C));
|
|
990
1018
|
} catch {}
|
|
991
1019
|
}
|
|
992
|
-
#
|
|
993
|
-
!this.#h || this.#
|
|
994
|
-
this.#
|
|
1020
|
+
#xt() {
|
|
1021
|
+
!this.#h || this.#ye || this.#C.turn || (this.#St(), this.#w = setTimeout(() => {
|
|
1022
|
+
this.#w = null, this.#Ct();
|
|
995
1023
|
}, K));
|
|
996
1024
|
}
|
|
997
|
-
#
|
|
998
|
-
this.#
|
|
1025
|
+
#St() {
|
|
1026
|
+
this.#w !== null && (clearTimeout(this.#w), this.#w = null);
|
|
999
1027
|
}
|
|
1000
|
-
async #
|
|
1001
|
-
if (!this.#h || this.#
|
|
1002
|
-
let e = this.#
|
|
1028
|
+
async #Ct() {
|
|
1029
|
+
if (!this.#h || this.#ye || this.#C.turn || !this.#ae || typeof requestAnimationFrame != "function" || this.#i.state !== "idle") return;
|
|
1030
|
+
let e = this.#K + 1, t = this.#G[e];
|
|
1003
1031
|
if (!t) return;
|
|
1004
|
-
let n = await this.#
|
|
1005
|
-
if (this.#
|
|
1006
|
-
this.#l = 1, this
|
|
1007
|
-
fill: this.#
|
|
1008
|
-
curl: this.#
|
|
1032
|
+
let n = await this.#bn(t);
|
|
1033
|
+
if (this.#se || this.#C.turn || this.#i.state !== "idle" || this.#T) return;
|
|
1034
|
+
this.#l = 1, this.#ae.beginFlip(this.#J, n, "forward", {
|
|
1035
|
+
fill: this.#F,
|
|
1036
|
+
curl: this.#an(),
|
|
1009
1037
|
anchor: { y: this.#l }
|
|
1010
1038
|
});
|
|
1011
1039
|
let r = {};
|
|
1012
|
-
this.#
|
|
1013
|
-
let i = performance.now(), a =
|
|
1014
|
-
if (this.#
|
|
1015
|
-
let e = Math.min(1, (performance.now() - i) / a), t =
|
|
1016
|
-
this
|
|
1040
|
+
this.#T = r;
|
|
1041
|
+
let i = performance.now(), a = oe * 2, o = () => {
|
|
1042
|
+
if (this.#T !== r) return;
|
|
1043
|
+
let e = Math.min(1, (performance.now() - i) / a), t = U * Math.sin(e * Math.PI);
|
|
1044
|
+
this.#ae?.setFlipProgress(Math.max(0, t), "forward"), e < 1 ? this.#ce = requestAnimationFrame(o) : (this.#ce = null, this.#T = null, this.#Tt());
|
|
1017
1045
|
};
|
|
1018
|
-
this.#
|
|
1046
|
+
this.#ce = requestAnimationFrame(o);
|
|
1019
1047
|
}
|
|
1020
|
-
#
|
|
1021
|
-
this.#
|
|
1048
|
+
#wt() {
|
|
1049
|
+
this.#T && (this.#T = null, this.#ce !== null && (cancelAnimationFrame(this.#ce), this.#ce = null), this.#Tt());
|
|
1022
1050
|
}
|
|
1023
|
-
#
|
|
1024
|
-
let e = this.#
|
|
1025
|
-
e && this.#i.state === "idle" && this.#
|
|
1051
|
+
#Tt() {
|
|
1052
|
+
let e = this.#G[this.#K];
|
|
1053
|
+
e && this.#i.state === "idle" && this.#un(e, this.#J);
|
|
1026
1054
|
}
|
|
1027
|
-
#
|
|
1028
|
-
if (!this
|
|
1055
|
+
#Et(e) {
|
|
1056
|
+
if (!this.#ae || typeof requestAnimationFrame != "function" || this.#ye || this.#i.state !== "idle" || this.#ne > 1 || this.#E) return;
|
|
1029
1057
|
let t = e === "forward", n = (this.#a === "rtl" ? !t : t) ? -1 : 1, r = {};
|
|
1030
|
-
this.#
|
|
1058
|
+
this.#E = r;
|
|
1031
1059
|
let i = performance.now(), a = () => {
|
|
1032
|
-
if (this.#
|
|
1060
|
+
if (this.#E !== r) return;
|
|
1033
1061
|
let e = Math.min(1, (performance.now() - i) / G), t = W * Math.sin(e * Math.PI);
|
|
1034
|
-
this
|
|
1062
|
+
this.#ae?.setViewTransform(1, n * t, 0), e < 1 ? this.#ce = requestAnimationFrame(a) : (this.#ce = null, this.#E = null, this.#ae?.setViewTransform(1, 0, 0));
|
|
1035
1063
|
};
|
|
1036
|
-
this.#
|
|
1064
|
+
this.#ce = requestAnimationFrame(a);
|
|
1037
1065
|
}
|
|
1038
|
-
#
|
|
1039
|
-
this.#
|
|
1066
|
+
#Dt() {
|
|
1067
|
+
this.#E && (this.#E = null, this.#ce !== null && (cancelAnimationFrame(this.#ce), this.#ce = null), this.#ae?.setViewTransform(1, 0, 0));
|
|
1040
1068
|
}
|
|
1041
|
-
#
|
|
1042
|
-
this.#
|
|
1069
|
+
#Ot() {
|
|
1070
|
+
this.#C.pan || this.#kt("Drag to move");
|
|
1043
1071
|
}
|
|
1044
|
-
#
|
|
1072
|
+
#kt(e) {
|
|
1045
1073
|
if (!this.#h) return;
|
|
1046
1074
|
let t = this.#e.ownerDocument;
|
|
1047
1075
|
if (!t || typeof this.#e.appendChild != "function") return;
|
|
1048
|
-
this.#
|
|
1076
|
+
this.#At();
|
|
1049
1077
|
let n = t.createElement("div");
|
|
1050
1078
|
n.className = "zine-hint-caption", n.setAttribute("aria-hidden", "true"), n.textContent = e, n.style.cssText = "position:absolute;left:50%;bottom:16px;transform:translateX(-50%);z-index:3;pointer-events:none;padding:6px 12px;border-radius:999px;font:500 13px/1.2 system-ui,sans-serif;color:#fff;background:rgba(24,24,27,0.82);box-shadow:0 1px 4px rgba(0,0,0,0.35);white-space:nowrap;opacity:0;";
|
|
1051
|
-
let r = !this.#
|
|
1052
|
-
r && (n.style.transition = "opacity 200ms ease"), this.#e.appendChild(n), this.#
|
|
1053
|
-
this.#
|
|
1054
|
-
}) : n.style.opacity = "1", this.#
|
|
1079
|
+
let r = !this.#ye && typeof requestAnimationFrame == "function";
|
|
1080
|
+
r && (n.style.transition = "opacity 200ms ease"), this.#e.appendChild(n), this.#D = n, r ? requestAnimationFrame(() => {
|
|
1081
|
+
this.#D === n && (n.style.opacity = "1");
|
|
1082
|
+
}) : n.style.opacity = "1", this.#O = setTimeout(() => this.#At(), q);
|
|
1055
1083
|
}
|
|
1056
|
-
#
|
|
1057
|
-
this.#
|
|
1084
|
+
#At() {
|
|
1085
|
+
this.#O !== null && (clearTimeout(this.#O), this.#O = null), this.#D?.remove(), this.#D = null;
|
|
1058
1086
|
}
|
|
1059
|
-
#
|
|
1060
|
-
!this.#h || this.#
|
|
1061
|
-
this.#
|
|
1087
|
+
#jt(e, t) {
|
|
1088
|
+
!this.#h || this.#C.zoom || this.#A || this.#j === "mouse" && this.#vt(e, t) === "zoom-in" && (this.#i.state === "animating" || performance.now() - this.#Ee <= P || (this.#Nt(), this.#k = setTimeout(() => {
|
|
1089
|
+
this.#k = null, !(this.#C.zoom || this.#A) && (this.#A = !0, this.#kt(this.#Mt()));
|
|
1062
1090
|
}, M)));
|
|
1063
1091
|
}
|
|
1064
|
-
#
|
|
1092
|
+
#Mt() {
|
|
1065
1093
|
let e = [];
|
|
1066
|
-
if (this.#
|
|
1094
|
+
if (this.#Q !== null && e.push("Double-click"), this.#Z) {
|
|
1067
1095
|
let t = this.#e.ownerDocument?.defaultView?.navigator, n = /Mac|iPhone|iPad/.test(t?.platform ?? "");
|
|
1068
1096
|
e.push(`${n ? "⌘" : "Ctrl"}-scroll`);
|
|
1069
1097
|
}
|
|
1070
1098
|
return `${e.join(" or ")} to zoom`;
|
|
1071
1099
|
}
|
|
1072
|
-
#
|
|
1073
|
-
this.#
|
|
1100
|
+
#Nt() {
|
|
1101
|
+
this.#k !== null && (clearTimeout(this.#k), this.#k = null);
|
|
1074
1102
|
}
|
|
1075
|
-
#
|
|
1076
|
-
this.#
|
|
1103
|
+
#Pt() {
|
|
1104
|
+
this.#fe !== null && (clearTimeout(this.#fe), this.#fe = null);
|
|
1077
1105
|
}
|
|
1078
|
-
#
|
|
1079
|
-
let e = this.#
|
|
1080
|
-
e && this.#
|
|
1106
|
+
#Ft() {
|
|
1107
|
+
let e = this.#G[this.#K];
|
|
1108
|
+
e && this.#un(e, this.#J), this.#i.send("settle"), this.#_t(), this.#n.emit("flipEnd", { page: this.#q }), this.#Je();
|
|
1081
1109
|
}
|
|
1082
|
-
#
|
|
1083
|
-
if (this.#
|
|
1084
|
-
this.#
|
|
1085
|
-
let e = this.#
|
|
1086
|
-
e && this.#
|
|
1087
|
-
} else this.#
|
|
1088
|
-
this.#
|
|
1089
|
-
}
|
|
1090
|
-
#
|
|
1091
|
-
if (!this.#
|
|
1110
|
+
#It() {
|
|
1111
|
+
if (this.#ue = null, this.#Pt(), this.#le) {
|
|
1112
|
+
this.#le = null, this.#i.send("release"), this.#i.send("settle");
|
|
1113
|
+
let e = this.#G[this.#K];
|
|
1114
|
+
e && this.#un(e, this.#J);
|
|
1115
|
+
} else this.#ge && (this.#ge = null, this.#i.send("panEnd"));
|
|
1116
|
+
this.#_e = !0, this.#ve = this.#ne;
|
|
1117
|
+
}
|
|
1118
|
+
#Lt(e, t, n) {
|
|
1119
|
+
if (!this.#_e) return;
|
|
1092
1120
|
let r = this.#e.getBoundingClientRect();
|
|
1093
|
-
this.setZoom(this.#
|
|
1121
|
+
this.setZoom(this.#ve * n, {
|
|
1094
1122
|
x: e - r.left,
|
|
1095
1123
|
y: t - r.top
|
|
1096
1124
|
});
|
|
1097
1125
|
}
|
|
1098
|
-
#
|
|
1099
|
-
this.#
|
|
1126
|
+
#Rt() {
|
|
1127
|
+
this.#_e = !1;
|
|
1100
1128
|
}
|
|
1101
|
-
#
|
|
1102
|
-
if (!this.#
|
|
1129
|
+
#zt() {
|
|
1130
|
+
if (!this.#H) return;
|
|
1103
1131
|
let e = (e) => e.preventDefault();
|
|
1104
|
-
this.#e.addEventListener("contextmenu", e), this.#
|
|
1132
|
+
this.#e.addEventListener("contextmenu", e), this.#Ce = () => this.#e.removeEventListener("contextmenu", e);
|
|
1105
1133
|
}
|
|
1106
|
-
#
|
|
1134
|
+
#Bt() {
|
|
1107
1135
|
let e = (e) => {
|
|
1108
|
-
if (!this.#
|
|
1136
|
+
if (!this.#Z || !this.#X || !(e.ctrlKey || e.metaKey)) return;
|
|
1109
1137
|
e.preventDefault();
|
|
1110
1138
|
let t = this.#e.getBoundingClientRect(), n = Math.exp(-e.deltaY * A);
|
|
1111
|
-
this.setZoom(this.#
|
|
1139
|
+
this.setZoom(this.#ne * n, {
|
|
1112
1140
|
x: e.clientX - t.left,
|
|
1113
1141
|
y: e.clientY - t.top
|
|
1114
1142
|
});
|
|
1115
1143
|
};
|
|
1116
|
-
this.#e.addEventListener("wheel", e, { passive: !1 }), this.#
|
|
1144
|
+
this.#e.addEventListener("wheel", e, { passive: !1 }), this.#Se = () => this.#e.removeEventListener("wheel", e);
|
|
1117
1145
|
}
|
|
1118
|
-
#
|
|
1146
|
+
#Vt() {
|
|
1119
1147
|
let e = (e) => {
|
|
1120
|
-
this.#
|
|
1148
|
+
this.#j = e.pointerType;
|
|
1121
1149
|
}, t = (e) => {
|
|
1122
|
-
let t = this.#
|
|
1123
|
-
if (!this.#
|
|
1124
|
-
let n = performance.now(), r = this.#
|
|
1150
|
+
let t = this.#Q;
|
|
1151
|
+
if (!this.#X || t === null || !this.#ae) return;
|
|
1152
|
+
let n = performance.now(), r = this.#Te;
|
|
1125
1153
|
if (!(r !== null && n - r.t <= M && Math.hypot(e.clientX - r.x, e.clientY - r.y) <= N)) {
|
|
1126
|
-
this.#
|
|
1154
|
+
this.#Te = {
|
|
1127
1155
|
t: n,
|
|
1128
1156
|
x: e.clientX,
|
|
1129
1157
|
y: e.clientY
|
|
1130
|
-
}, this.#
|
|
1158
|
+
}, this.#jt(e.clientX, e.clientY);
|
|
1131
1159
|
return;
|
|
1132
1160
|
}
|
|
1133
|
-
this.#
|
|
1161
|
+
this.#Te = null, this.#Nt(), this.#Ht(e.clientX, e.clientY, t);
|
|
1134
1162
|
};
|
|
1135
|
-
this.#e.addEventListener("pointerdown", e), this.#e.addEventListener("click", t), this.#
|
|
1163
|
+
this.#e.addEventListener("pointerdown", e), this.#e.addEventListener("click", t), this.#we = () => {
|
|
1136
1164
|
this.#e.removeEventListener("pointerdown", e), this.#e.removeEventListener("click", t);
|
|
1137
1165
|
};
|
|
1138
1166
|
}
|
|
1139
|
-
#
|
|
1140
|
-
if (this.#
|
|
1141
|
-
let n = this.#
|
|
1142
|
-
if (r !== null && this.#
|
|
1167
|
+
#Ht(e, t, n) {
|
|
1168
|
+
if (this.#ne <= 1 && this.#u !== "off" && !this.#M) {
|
|
1169
|
+
let n = this.#pt(e, t), r = this.#mt(n);
|
|
1170
|
+
if (r !== null && this.#ht(r) || this.#i.state === "animating" || performance.now() - this.#Ee <= P) return;
|
|
1143
1171
|
}
|
|
1144
|
-
this.#
|
|
1145
|
-
let r = n.find((e) => e > this.#
|
|
1172
|
+
this.#Pt();
|
|
1173
|
+
let r = n.find((e) => e > this.#ne + 1e-6) ?? n[0] ?? this.#ne, i = this.#e.getBoundingClientRect();
|
|
1146
1174
|
this.setZoom(r, {
|
|
1147
1175
|
x: e - i.left,
|
|
1148
1176
|
y: t - i.top
|
|
1149
1177
|
});
|
|
1150
1178
|
}
|
|
1151
|
-
async #
|
|
1152
|
-
let t =
|
|
1153
|
-
if (this.#t.onProgress?.((e) => this.#
|
|
1154
|
-
this.#
|
|
1179
|
+
async #Ut(e) {
|
|
1180
|
+
let t = O(e);
|
|
1181
|
+
if (this.#t.onProgress?.((e) => this.#Kt(e)), typeof this.#t.open == "function") {
|
|
1182
|
+
this.#qt();
|
|
1155
1183
|
try {
|
|
1156
|
-
await this.#t.open(), this.#
|
|
1184
|
+
await this.#t.open(), this.#wn();
|
|
1157
1185
|
} catch (e) {
|
|
1158
|
-
throw this.#
|
|
1186
|
+
throw this.#Yt(), e;
|
|
1159
1187
|
}
|
|
1160
|
-
this.#
|
|
1188
|
+
this.#Jt("preparing");
|
|
1161
1189
|
}
|
|
1162
|
-
this.#t.prefetch([this.#
|
|
1163
|
-
let n = await t, r = await this.#
|
|
1164
|
-
this
|
|
1190
|
+
this.#t.prefetch([this.#q]);
|
|
1191
|
+
let n = await t, r = await this.#Xt(n);
|
|
1192
|
+
this.#ae = r, this.#t.onPageUpdate?.((e) => this.#fn(e)), this.#sn(r.measure().containerWidth);
|
|
1165
1193
|
let i = new m({
|
|
1166
|
-
onStart: (e) => this.#
|
|
1167
|
-
onMove: (e) => this.#
|
|
1168
|
-
onEnd: (e) => this.#
|
|
1194
|
+
onStart: (e) => this.#at(e.x, e.y),
|
|
1195
|
+
onMove: (e) => this.#ct(e.dx, e.dy),
|
|
1196
|
+
onEnd: (e) => this.#lt(e)
|
|
1169
1197
|
}), a = new _({
|
|
1170
|
-
onPinchStart: () => this.#
|
|
1171
|
-
onPinchMove: (e) => this.#
|
|
1172
|
-
onPinchEnd: () => this.#
|
|
1198
|
+
onPinchStart: () => this.#It(),
|
|
1199
|
+
onPinchMove: (e) => this.#Lt(e.centerX, e.centerY, e.scale),
|
|
1200
|
+
onPinchEnd: () => this.#Rt()
|
|
1173
1201
|
});
|
|
1174
|
-
this.#
|
|
1202
|
+
this.#xe = h(this.#e, {
|
|
1175
1203
|
pointer: i,
|
|
1176
1204
|
pinch: a
|
|
1177
|
-
}), this.#
|
|
1205
|
+
}), this.#Ze(), this.#Bt(), this.#Vt(), this.#zt(), this.#gt(), this.#Qt(), this.#De = this.#tn(), await this.#ln(), this.#Yt(), this.#vn(), this.#Sn(), this.#rn(), this.#en(), await this.#$t(), this.#Wt(), this.#n.emit("ready"), this.#Ct(), this.#xt();
|
|
1178
1206
|
}
|
|
1179
|
-
#
|
|
1180
|
-
this.#
|
|
1207
|
+
async #Wt() {
|
|
1208
|
+
if (!(!this.#_ || this.#b || this.#S || this.#se)) {
|
|
1209
|
+
this.#S = !0;
|
|
1210
|
+
try {
|
|
1211
|
+
let { FlipSound: e } = await import("./flipSound-BFXSkWBo.js");
|
|
1212
|
+
if (this.#se) return;
|
|
1213
|
+
this.#y = new e(this.#v), this.#y.setMuted(this.#b);
|
|
1214
|
+
} catch {}
|
|
1215
|
+
}
|
|
1181
1216
|
}
|
|
1182
|
-
|
|
1183
|
-
|
|
1217
|
+
#Gt() {
|
|
1218
|
+
this.#y?.play();
|
|
1219
|
+
}
|
|
1220
|
+
#Kt(e) {
|
|
1221
|
+
this.#Le = e, this.#n.emit("progress", e), this.#Ie?.update(e);
|
|
1222
|
+
}
|
|
1223
|
+
async #qt() {
|
|
1224
|
+
if (this.#Fe === !1 || this.#se) return;
|
|
1184
1225
|
let e = this.#e;
|
|
1185
1226
|
if (!(!e.ownerDocument || typeof e.appendChild != "function")) try {
|
|
1186
1227
|
let { mountLoading: t } = await import("./loading-DF88K9yJ.js");
|
|
1187
|
-
if (this.#
|
|
1188
|
-
this.#
|
|
1228
|
+
if (this.#Re === "done" || this.#se) return;
|
|
1229
|
+
this.#Ie = t(e), this.#Le && this.#Ie.update(this.#Le), this.#Re === "preparing" && this.#Ie.preparing();
|
|
1189
1230
|
} catch {}
|
|
1190
1231
|
}
|
|
1191
|
-
#
|
|
1192
|
-
this.#
|
|
1232
|
+
#Jt(e) {
|
|
1233
|
+
this.#Re !== "done" && (this.#Re = e, this.#Ie?.preparing());
|
|
1193
1234
|
}
|
|
1194
|
-
#
|
|
1195
|
-
this.#
|
|
1235
|
+
#Yt() {
|
|
1236
|
+
this.#Re = "done", this.#Ie?.destroy(), this.#Ie = null;
|
|
1196
1237
|
}
|
|
1197
|
-
async #
|
|
1238
|
+
async #Xt(e) {
|
|
1198
1239
|
try {
|
|
1199
1240
|
return await e.mount(this.#e), e.onFatal?.(() => {
|
|
1200
|
-
this.#
|
|
1241
|
+
this.#Zt();
|
|
1201
1242
|
}), e;
|
|
1202
1243
|
} catch {
|
|
1203
1244
|
e.destroy();
|
|
1204
|
-
let t = await
|
|
1205
|
-
return await t.mount(this.#e), this.#
|
|
1245
|
+
let t = await O("css");
|
|
1246
|
+
return await t.mount(this.#e), this.#oe = !0, this.#n.emit("rendererFallback", {
|
|
1206
1247
|
from: "webgl2",
|
|
1207
1248
|
to: "css"
|
|
1208
1249
|
}), t;
|
|
1209
1250
|
}
|
|
1210
1251
|
}
|
|
1211
|
-
async #
|
|
1212
|
-
if (this.#
|
|
1213
|
-
this.#
|
|
1214
|
-
let e = await
|
|
1215
|
-
if (this.#
|
|
1252
|
+
async #Zt() {
|
|
1253
|
+
if (this.#oe || this.#se) return;
|
|
1254
|
+
this.#oe = !0, this.#ae?.destroy(), this.#ae = null;
|
|
1255
|
+
let e = await O("css");
|
|
1256
|
+
if (this.#se) {
|
|
1216
1257
|
e.destroy();
|
|
1217
1258
|
return;
|
|
1218
1259
|
}
|
|
1219
|
-
await e.mount(this.#e), this
|
|
1260
|
+
await e.mount(this.#e), this.#ae = e, this.#sn(e.measure().containerWidth), await this.#ln(), this.#n.emit("rendererFallback", {
|
|
1220
1261
|
from: "webgl2",
|
|
1221
1262
|
to: "css"
|
|
1222
1263
|
});
|
|
1223
1264
|
}
|
|
1224
|
-
#
|
|
1265
|
+
#Qt() {
|
|
1225
1266
|
if (typeof matchMedia != "function") return;
|
|
1226
1267
|
let e = matchMedia("(prefers-reduced-motion: reduce)");
|
|
1227
|
-
this.#
|
|
1228
|
-
this.#
|
|
1268
|
+
this.#ye = e.matches, e.addEventListener?.("change", (e) => {
|
|
1269
|
+
this.#ye = e.matches;
|
|
1229
1270
|
});
|
|
1230
1271
|
}
|
|
1231
|
-
async
|
|
1232
|
-
let e = this.#
|
|
1233
|
-
if (!e && !t || this.#
|
|
1272
|
+
async #$t() {
|
|
1273
|
+
let e = this.#Ae !== !1, t = this.#Me !== !1;
|
|
1274
|
+
if (!e && !t || this.#se) return;
|
|
1234
1275
|
let n = this.#e;
|
|
1235
1276
|
if (!(!n.ownerDocument || typeof n.appendChild != "function")) try {
|
|
1236
|
-
let { mountControls: e, mountContextMenu: t } = await import("./controls-
|
|
1237
|
-
if (this.#
|
|
1238
|
-
if (this.#
|
|
1239
|
-
let t = this.#
|
|
1240
|
-
this.#
|
|
1277
|
+
let { mountControls: e, mountContextMenu: t } = await import("./controls-DzVdwPJB.js");
|
|
1278
|
+
if (this.#se) return;
|
|
1279
|
+
if (this.#Ae !== !1) {
|
|
1280
|
+
let t = this.#Ae === !0 ? {} : this.#Ae;
|
|
1281
|
+
this.#je = e(this, n, t, this.#Pe);
|
|
1241
1282
|
}
|
|
1242
|
-
if (this.#
|
|
1243
|
-
let e = this.#
|
|
1244
|
-
this.#
|
|
1283
|
+
if (this.#Me !== !1) {
|
|
1284
|
+
let e = this.#Me === !0 ? {} : this.#Me;
|
|
1285
|
+
this.#Ne = t(this, n, e, this.#Pe);
|
|
1245
1286
|
}
|
|
1246
1287
|
} catch {}
|
|
1247
1288
|
}
|
|
1248
|
-
#
|
|
1249
|
-
if (!this.#
|
|
1289
|
+
#en() {
|
|
1290
|
+
if (!this.#V || globalThis.location === void 0) return;
|
|
1250
1291
|
let e = globalThis;
|
|
1251
|
-
this.#
|
|
1252
|
-
e !== this.#
|
|
1253
|
-
}), this.#
|
|
1254
|
-
this.#
|
|
1292
|
+
this.#U = ee(e, (e) => {
|
|
1293
|
+
e !== this.#q && this.flipTo(e);
|
|
1294
|
+
}), this.#U.push(this.#q), this.#W = this.#n.on("pageChanged", ({ page: e }) => {
|
|
1295
|
+
this.#U?.push(e);
|
|
1255
1296
|
});
|
|
1256
1297
|
}
|
|
1257
|
-
pageLink(e = this.#
|
|
1298
|
+
pageLink(e = this.#q) {
|
|
1258
1299
|
let t = globalThis.location?.href ?? "";
|
|
1259
1300
|
if (!t) return "";
|
|
1260
1301
|
let n = new URL(t);
|
|
1261
|
-
return n.hash =
|
|
1302
|
+
return n.hash = C(n.hash, X(e, 0, Math.max(0, this.#t.pageCount - 1))), n.toString();
|
|
1262
1303
|
}
|
|
1263
|
-
#
|
|
1304
|
+
#tn() {
|
|
1264
1305
|
let e = this.#e, t = e.ownerDocument;
|
|
1265
1306
|
if (!t || typeof e.setAttribute != "function") return null;
|
|
1266
1307
|
e.hasAttribute("tabindex") || (e.tabIndex = 0), e.setAttribute("aria-roledescription", "flipbook");
|
|
1267
|
-
let n = (e) => this.#
|
|
1308
|
+
let n = (e) => this.#nn(e);
|
|
1268
1309
|
e.addEventListener("keydown", n);
|
|
1269
1310
|
let r = t.createElement("div");
|
|
1270
|
-
return r.setAttribute("aria-live", "polite"), r.setAttribute("aria-atomic", "true"), r.style.cssText = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;", e.appendChild(r), this.#
|
|
1271
|
-
e.removeEventListener("keydown", n), r.remove(), this.#
|
|
1311
|
+
return r.setAttribute("aria-live", "polite"), r.setAttribute("aria-atomic", "true"), r.style.cssText = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;", e.appendChild(r), this.#be = r, () => {
|
|
1312
|
+
e.removeEventListener("keydown", n), r.remove(), this.#be = null;
|
|
1272
1313
|
};
|
|
1273
1314
|
}
|
|
1274
|
-
#
|
|
1315
|
+
#nn(e) {
|
|
1275
1316
|
let t = this.#a === "rtl" ? "ArrowLeft" : "ArrowRight";
|
|
1276
1317
|
switch (e.key) {
|
|
1277
1318
|
case "ArrowRight":
|
|
@@ -1287,98 +1328,98 @@ var ce = class {
|
|
|
1287
1328
|
default: break;
|
|
1288
1329
|
}
|
|
1289
1330
|
}
|
|
1290
|
-
#
|
|
1291
|
-
this.#
|
|
1331
|
+
#rn() {
|
|
1332
|
+
this.#be && (this.#be.textContent = `Page ${this.#q + 1} of ${this.#t.pageCount}`);
|
|
1292
1333
|
}
|
|
1293
|
-
#
|
|
1294
|
-
return this.#
|
|
1334
|
+
#in() {
|
|
1335
|
+
return this.#ye ? B : this.#Y * (this.#F ? F : 1);
|
|
1295
1336
|
}
|
|
1296
|
-
#
|
|
1297
|
-
return this.#
|
|
1337
|
+
#an() {
|
|
1338
|
+
return this.#ye ? "simple" : this.#c;
|
|
1298
1339
|
}
|
|
1299
1340
|
update() {
|
|
1300
|
-
!this
|
|
1341
|
+
!this.#ae || this.#i.state !== "idle" || (this.#sn(this.#ae.measure().containerWidth), this.#ln(), this.#_t());
|
|
1301
1342
|
}
|
|
1302
|
-
#
|
|
1303
|
-
return this.#
|
|
1343
|
+
#on() {
|
|
1344
|
+
return this.#L || this.#o === "single" ? "single" : this.#o;
|
|
1304
1345
|
}
|
|
1305
|
-
#
|
|
1306
|
-
let t = this.#
|
|
1307
|
-
t !== this.#
|
|
1346
|
+
#sn(e) {
|
|
1347
|
+
let t = this.#R && o(e, this.#P);
|
|
1348
|
+
t !== this.#L && (this.#L = t, this.#cn());
|
|
1308
1349
|
}
|
|
1309
|
-
#
|
|
1310
|
-
let e = this.#
|
|
1311
|
-
this.#
|
|
1350
|
+
#cn() {
|
|
1351
|
+
let e = this.#on(), t = e !== this.#I;
|
|
1352
|
+
this.#I = e, this.#F = e === "single", this.#G = a(this.#t.pageCount, {
|
|
1312
1353
|
direction: this.#a,
|
|
1313
1354
|
mode: e
|
|
1314
|
-
}), this.#
|
|
1355
|
+
}), this.#K = this.#Cn(this.#q), t && this.#n.emit("spreadChanged", {
|
|
1315
1356
|
mode: e,
|
|
1316
|
-
singlePage: this.#
|
|
1357
|
+
singlePage: this.#F
|
|
1317
1358
|
});
|
|
1318
1359
|
}
|
|
1319
|
-
async
|
|
1320
|
-
let e = this.#
|
|
1321
|
-
!e || !this
|
|
1360
|
+
async #ln() {
|
|
1361
|
+
let e = this.#G[this.#K];
|
|
1362
|
+
!e || !this.#ae || (this.#J = await this.#bn(e), this.#un(e, this.#J));
|
|
1322
1363
|
}
|
|
1323
|
-
#
|
|
1324
|
-
this
|
|
1364
|
+
#un(e, t) {
|
|
1365
|
+
this.#ae?.renderSpread(e, t, { fill: this.#F }), this.#dn(), this.#ze = 1, this.#pn();
|
|
1325
1366
|
}
|
|
1326
|
-
#
|
|
1327
|
-
let e = this
|
|
1367
|
+
#dn() {
|
|
1368
|
+
let e = this.#ae?.measure().book;
|
|
1328
1369
|
if (!e || e.width <= 0 || e.height <= 0) return;
|
|
1329
|
-
let t =
|
|
1330
|
-
|
|
1370
|
+
let t = e.width / e.height;
|
|
1371
|
+
this.#z !== null && Math.abs(t - this.#z) < .005 || (this.#z = t, this.#e.style.aspectRatio = t.toFixed(4));
|
|
1331
1372
|
}
|
|
1332
|
-
#
|
|
1373
|
+
#fn(e) {
|
|
1333
1374
|
if (this.#i.state !== "idle") {
|
|
1334
|
-
this.#
|
|
1375
|
+
this.#ke.add(e);
|
|
1335
1376
|
return;
|
|
1336
1377
|
}
|
|
1337
|
-
let t = this.#
|
|
1378
|
+
let t = this.#G[this.#K];
|
|
1338
1379
|
if (!(!t || !(t.left === e || t.right === e))) {
|
|
1339
|
-
if (this.#
|
|
1340
|
-
this.#
|
|
1380
|
+
if (this.#ne > 1) {
|
|
1381
|
+
this.#pn();
|
|
1341
1382
|
return;
|
|
1342
1383
|
}
|
|
1343
|
-
this
|
|
1384
|
+
this.#ln();
|
|
1344
1385
|
}
|
|
1345
1386
|
}
|
|
1346
|
-
#
|
|
1347
|
-
this.#
|
|
1348
|
-
let e = this.#
|
|
1349
|
-
if (e !== this.#
|
|
1387
|
+
#pn() {
|
|
1388
|
+
this.#Ve !== null && clearTimeout(this.#Ve);
|
|
1389
|
+
let e = this.#hn();
|
|
1390
|
+
if (e !== this.#ze) {
|
|
1350
1391
|
if (e === 1) {
|
|
1351
|
-
this.#
|
|
1392
|
+
this.#Be++, this.#ze = 1, this.#ln();
|
|
1352
1393
|
return;
|
|
1353
1394
|
}
|
|
1354
|
-
this.#
|
|
1355
|
-
this.#
|
|
1395
|
+
this.#Ve = setTimeout(() => {
|
|
1396
|
+
this.#Ve = null, this.#gn();
|
|
1356
1397
|
}, L);
|
|
1357
1398
|
}
|
|
1358
1399
|
}
|
|
1359
|
-
#
|
|
1360
|
-
let e = this
|
|
1400
|
+
#mn() {
|
|
1401
|
+
let e = this.#ae?.measure(), t = e?.content ?? e?.book;
|
|
1361
1402
|
if (!t || t.width <= 0) return 1;
|
|
1362
|
-
let n = this.#
|
|
1403
|
+
let n = this.#J, r = +!!n.left + +!!n.right;
|
|
1363
1404
|
if (r === 0) return 1;
|
|
1364
1405
|
let i = t.width / r, a = typeof devicePixelRatio == "number" && devicePixelRatio > 0 ? devicePixelRatio : 1, o = 0;
|
|
1365
1406
|
for (let e of [n.left, n.right]) {
|
|
1366
1407
|
if (!e || e.width <= 0) continue;
|
|
1367
|
-
let t = e.width / this.#
|
|
1408
|
+
let t = e.width / this.#ze;
|
|
1368
1409
|
o = Math.max(o, i * a / t);
|
|
1369
1410
|
}
|
|
1370
1411
|
return o === 0 ? 1 : o;
|
|
1371
1412
|
}
|
|
1372
|
-
#
|
|
1373
|
-
let e = Math.max(1, z / (typeof devicePixelRatio == "number" && devicePixelRatio > 0 ? devicePixelRatio : 1)), t = this.#
|
|
1413
|
+
#hn() {
|
|
1414
|
+
let e = Math.max(1, z / (typeof devicePixelRatio == "number" && devicePixelRatio > 0 ? devicePixelRatio : 1)), t = this.#ne <= 1 ? 1 : this.#ne, n = this.#mn() * Math.max(t, e);
|
|
1374
1415
|
return n <= 1.001 ? 1 : Math.min(Math.ceil(n * 2) / 2, R);
|
|
1375
1416
|
}
|
|
1376
|
-
async #
|
|
1377
|
-
let e = this.#
|
|
1378
|
-
if (!this
|
|
1379
|
-
let t = this.#
|
|
1380
|
-
if (t === 1 || t === this.#
|
|
1381
|
-
let n = ++this.#
|
|
1417
|
+
async #gn() {
|
|
1418
|
+
let e = this.#G[this.#K];
|
|
1419
|
+
if (!this.#ae || !e) return;
|
|
1420
|
+
let t = this.#hn();
|
|
1421
|
+
if (t === 1 || t === this.#ze || this.#i.state !== "idle") return;
|
|
1422
|
+
let n = ++this.#Be, r = {
|
|
1382
1423
|
x: 0,
|
|
1383
1424
|
y: 0,
|
|
1384
1425
|
width: 1,
|
|
@@ -1389,7 +1430,7 @@ var ce = class {
|
|
|
1389
1430
|
return await this.#t.get(e, {
|
|
1390
1431
|
scale: t,
|
|
1391
1432
|
region: r,
|
|
1392
|
-
maxSize: this
|
|
1433
|
+
maxSize: this.#ae?.maxTextureSize
|
|
1393
1434
|
});
|
|
1394
1435
|
} catch (t) {
|
|
1395
1436
|
return this.#n.emit("sourceError", {
|
|
@@ -1398,34 +1439,34 @@ var ce = class {
|
|
|
1398
1439
|
}), null;
|
|
1399
1440
|
}
|
|
1400
1441
|
}));
|
|
1401
|
-
if (n !== this.#
|
|
1402
|
-
let a = i[0] ?? this.#
|
|
1403
|
-
a === this.#
|
|
1442
|
+
if (n !== this.#Be || this.#hn() !== t || this.#i.state !== "idle") return;
|
|
1443
|
+
let a = i[0] ?? this.#J.left, o = i[1] ?? this.#J.right;
|
|
1444
|
+
a === this.#J.left && o === this.#J.right || (this.#ze = t, this.#J = {
|
|
1404
1445
|
left: a,
|
|
1405
1446
|
right: o
|
|
1406
|
-
}, this
|
|
1447
|
+
}, this.#ae.renderSpread(e, this.#J, { fill: this.#F }));
|
|
1407
1448
|
}
|
|
1408
|
-
#
|
|
1409
|
-
if (this.#
|
|
1410
|
-
let e = this.#
|
|
1411
|
-
this.#
|
|
1449
|
+
#_n() {
|
|
1450
|
+
if (this.#ke.size === 0) return;
|
|
1451
|
+
let e = this.#G[this.#K], t = e !== void 0 && [e.left, e.right].some((e) => e !== null && this.#ke.has(e));
|
|
1452
|
+
this.#ke.clear(), t && (this.#ne > 1 ? this.#pn() : this.#ln());
|
|
1412
1453
|
}
|
|
1413
|
-
#
|
|
1414
|
-
typeof ResizeObserver > "u" || (this.#
|
|
1454
|
+
#vn() {
|
|
1455
|
+
typeof ResizeObserver > "u" || (this.#ee = new ResizeObserver(() => this.#yn()), this.#ee.observe(this.#e));
|
|
1415
1456
|
}
|
|
1416
|
-
#
|
|
1417
|
-
this.#
|
|
1418
|
-
this.#
|
|
1457
|
+
#yn() {
|
|
1458
|
+
this.#te || (this.#te = !0, requestAnimationFrame(() => {
|
|
1459
|
+
this.#te = !1, this.update();
|
|
1419
1460
|
}));
|
|
1420
1461
|
}
|
|
1421
|
-
async #
|
|
1422
|
-
let [t, n] = await Promise.all([this.#
|
|
1462
|
+
async #bn(e) {
|
|
1463
|
+
let [t, n] = await Promise.all([this.#xn(e.left), this.#xn(e.right)]);
|
|
1423
1464
|
return {
|
|
1424
1465
|
left: t,
|
|
1425
1466
|
right: n
|
|
1426
1467
|
};
|
|
1427
1468
|
}
|
|
1428
|
-
async #
|
|
1469
|
+
async #xn(e) {
|
|
1429
1470
|
if (e === null) return null;
|
|
1430
1471
|
try {
|
|
1431
1472
|
return await this.#t.get(e);
|
|
@@ -1436,49 +1477,49 @@ var ce = class {
|
|
|
1436
1477
|
}), null;
|
|
1437
1478
|
}
|
|
1438
1479
|
}
|
|
1439
|
-
#
|
|
1440
|
-
let { toMount: e } = this.#r.update(this.#
|
|
1480
|
+
#Sn() {
|
|
1481
|
+
let { toMount: e } = this.#r.update(this.#K, this.#G.length), t = [];
|
|
1441
1482
|
for (let n of e) {
|
|
1442
|
-
let e = this.#
|
|
1483
|
+
let e = this.#G[n];
|
|
1443
1484
|
e?.left != null && t.push(e.left), e?.right != null && t.push(e.right);
|
|
1444
1485
|
}
|
|
1445
1486
|
this.#t.prefetch(t);
|
|
1446
1487
|
}
|
|
1447
|
-
#
|
|
1448
|
-
let t = this.#
|
|
1488
|
+
#Cn(e) {
|
|
1489
|
+
let t = this.#G.findIndex((t) => t.left === e || t.right === e);
|
|
1449
1490
|
return t === -1 ? 0 : t;
|
|
1450
1491
|
}
|
|
1451
|
-
#
|
|
1492
|
+
#wn() {
|
|
1452
1493
|
let e = this.#t.pageCount;
|
|
1453
1494
|
if (!Number.isInteger(e) || e < 1) throw Error(`Zine: source has ${e} pages; a Source must have at least 1 page.`);
|
|
1454
|
-
let t = this.#
|
|
1495
|
+
let t = this.#B;
|
|
1455
1496
|
if (t !== void 0 && (!Number.isInteger(t) || t < 0 || t >= e)) throw Error(`Zine: startPage ${JSON.stringify(t)} is out of range for a ${e}-page book (valid 0..${e - 1}).`);
|
|
1456
|
-
let n = this.#
|
|
1457
|
-
this.#
|
|
1497
|
+
let n = this.#on();
|
|
1498
|
+
this.#F = n === "single", this.#G = a(e, {
|
|
1458
1499
|
direction: this.#a,
|
|
1459
1500
|
mode: n
|
|
1460
1501
|
});
|
|
1461
|
-
let r = this.#
|
|
1462
|
-
this.#
|
|
1502
|
+
let r = this.#V ? S(globalThis.location?.hash ?? "") : null;
|
|
1503
|
+
this.#q = X(r ?? t ?? 0, 0, e - 1), this.#K = this.#Cn(this.#q);
|
|
1463
1504
|
}
|
|
1464
1505
|
};
|
|
1465
|
-
function
|
|
1506
|
+
function X(e, t, n) {
|
|
1466
1507
|
return e < t ? t : e > n ? n : e;
|
|
1467
1508
|
}
|
|
1468
|
-
function
|
|
1509
|
+
function Z(e, t, n) {
|
|
1469
1510
|
if (t <= n) {
|
|
1470
1511
|
let r = (n - t) / 2 - e;
|
|
1471
1512
|
return [r, r];
|
|
1472
1513
|
}
|
|
1473
1514
|
return [n - (e + t), -e];
|
|
1474
1515
|
}
|
|
1475
|
-
function
|
|
1516
|
+
function le(e) {
|
|
1476
1517
|
return e < .5 ? 2 * e * e : 1 - (-2 * e + 2) ** 2 / 2;
|
|
1477
1518
|
}
|
|
1478
1519
|
function Q(e) {
|
|
1479
1520
|
return e === null ? "null" : Array.isArray(e) ? "array" : typeof e;
|
|
1480
1521
|
}
|
|
1481
|
-
function
|
|
1522
|
+
function ue(n, r) {
|
|
1482
1523
|
if (typeof n != "object" || !n || typeof n.appendChild != "function" || typeof n.addEventListener != "function") throw Error(`Zine: container must be a DOM element; received ${Q(n)}.`);
|
|
1483
1524
|
if (typeof r != "object" || !r) throw Error("Zine: an options object with a `source` is required.");
|
|
1484
1525
|
let i = r, a = i.source;
|
|
@@ -1534,25 +1575,34 @@ function le(n, r) {
|
|
|
1534
1575
|
if (i.disableContextMenu === !0 && m !== void 0 && m !== !1) throw Error("Zine: disableContextMenu and contextMenu are mutually exclusive — one removes the browser's right-click menu, the other replaces it. Enable only one.");
|
|
1535
1576
|
let g = i.hideControls;
|
|
1536
1577
|
if (g !== void 0 && (!Array.isArray(g) || g.some((e) => typeof e != "string"))) throw Error(`Zine: hideControls must be an array of control-id strings; got ${Q(g)}.`);
|
|
1537
|
-
let _ = i.
|
|
1538
|
-
if (_ !== void 0 && !
|
|
1578
|
+
let _ = i.sound;
|
|
1579
|
+
if (_ !== void 0 && typeof _ != "boolean" && (typeof _ != "object" || !_)) throw Error(`Zine: sound must be a boolean or an options object; got ${Q(_)}.`);
|
|
1580
|
+
if (typeof _ == "object" && _) {
|
|
1581
|
+
let e = _;
|
|
1582
|
+
if (e.url !== void 0 && typeof e.url != "string") throw Error(`Zine: sound.url must be a string URL; got ${Q(e.url)}.`);
|
|
1583
|
+
if (e.volume !== void 0 && (typeof e.volume != "number" || e.volume < 0 || e.volume > 1)) throw Error(`Zine: sound.volume must be a number between 0 and 1; got ${JSON.stringify(e.volume)}.`);
|
|
1584
|
+
if (e.muted !== void 0 && typeof e.muted != "boolean") throw Error(`Zine: sound.muted must be a boolean; got ${Q(e.muted)}.`);
|
|
1585
|
+
if (e.persist !== void 0 && typeof e.persist != "boolean") throw Error(`Zine: sound.persist must be a boolean; got ${Q(e.persist)}.`);
|
|
1586
|
+
}
|
|
1587
|
+
let v = i.spreadMode;
|
|
1588
|
+
if (v !== void 0 && ![
|
|
1539
1589
|
"double",
|
|
1540
1590
|
"single",
|
|
1541
1591
|
"cover",
|
|
1542
1592
|
"book"
|
|
1543
|
-
].includes(
|
|
1593
|
+
].includes(v)) throw Error(`Zine: spreadMode must be 'double', 'single', 'cover', or 'book'; got ${JSON.stringify(v)}.`);
|
|
1544
1594
|
for (let e of ["frontCover", "backCover"]) {
|
|
1545
1595
|
let t = i[e];
|
|
1546
1596
|
if (t !== void 0 && typeof t != "string") throw Error(`Zine: ${e} must be an image URL string; got ${JSON.stringify(t)}.`);
|
|
1547
1597
|
}
|
|
1548
|
-
let
|
|
1549
|
-
if (
|
|
1550
|
-
$(i.width, "width", 1), $(i.height, "height", 1), $(i.flipDuration, "flipDuration", 0), $(i.clickZoneSize, "clickZoneSize", 0), $(i.clickFlipDelay, "clickFlipDelay", 0), $(i.singlePageThreshold, "singlePageThreshold", 0),
|
|
1598
|
+
let y = i.pages;
|
|
1599
|
+
if (y !== void 0 && (typeof y != "object" || !y || Array.isArray(y))) throw Error("Zine: pages must be an object mapping page indices to image URLs.");
|
|
1600
|
+
$(i.width, "width", 1), $(i.height, "height", 1), $(i.flipDuration, "flipDuration", 0), $(i.clickZoneSize, "clickZoneSize", 0), $(i.clickFlipDelay, "clickFlipDelay", 0), $(i.singlePageThreshold, "singlePageThreshold", 0), de(i.zoom), fe(i.renderer);
|
|
1551
1601
|
}
|
|
1552
1602
|
function $(e, t, n) {
|
|
1553
1603
|
if (e !== void 0 && (typeof e != "number" || !Number.isFinite(e) || e < n)) throw Error(`Zine: ${t} must be a number >= ${n}; got ${JSON.stringify(e)}.`);
|
|
1554
1604
|
}
|
|
1555
|
-
function
|
|
1605
|
+
function de(e) {
|
|
1556
1606
|
if (e === void 0) return;
|
|
1557
1607
|
if (typeof e != "object" || !e || Array.isArray(e)) throw Error("Zine: zoom must be an object, e.g. { max: 4 }.");
|
|
1558
1608
|
let t = e;
|
|
@@ -1565,7 +1615,7 @@ function ue(e) {
|
|
|
1565
1615
|
}
|
|
1566
1616
|
$(t.max, "zoom.max", 1);
|
|
1567
1617
|
}
|
|
1568
|
-
function
|
|
1618
|
+
function fe(e) {
|
|
1569
1619
|
if (e !== void 0) {
|
|
1570
1620
|
if (typeof e == "string") {
|
|
1571
1621
|
if (e !== "auto" && e !== "css" && e !== "webgl2") throw Error(`Zine: renderer '${e}' is not recognized; use 'auto', 'css', 'webgl2', an array of those, or a custom Renderer.`);
|
|
@@ -1580,7 +1630,7 @@ function de(e) {
|
|
|
1580
1630
|
}
|
|
1581
1631
|
//#endregion
|
|
1582
1632
|
//#region src/source/imageSource.ts
|
|
1583
|
-
var
|
|
1633
|
+
var pe = class {
|
|
1584
1634
|
pageCount;
|
|
1585
1635
|
fit;
|
|
1586
1636
|
#e;
|
|
@@ -1617,6 +1667,6 @@ var fe = class {
|
|
|
1617
1667
|
}
|
|
1618
1668
|
};
|
|
1619
1669
|
//#endregion
|
|
1620
|
-
export { t as CURL_TYPES, i as DEFAULT_ITEMS, e as IMPORTABLE_CURLS,
|
|
1670
|
+
export { t as CURL_TYPES, i as DEFAULT_ITEMS, e as IMPORTABLE_CURLS, pe as ImageSource, ce as Zine, n as defineControl, r as getControl };
|
|
1621
1671
|
|
|
1622
1672
|
//# sourceMappingURL=index.js.map
|