flipbookengine 0.5.2 → 0.5.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.
- package/CHANGELOG.md +33 -20
- package/COMMERCIAL_LICENSE.md +45 -45
- package/LICENSE +661 -661
- package/README.md +34 -32
- package/THIRD-PARTY-NOTICES.md +117 -117
- package/TRADEMARK_POLICY.md +50 -50
- package/dist/adapters/PageFlipAdapter.d.ts +1 -0
- package/dist/core/LayoutManager.d.ts +3 -1
- package/dist/{engine-BuVkDIh-.js → engine-7jWE07Zq.js} +652 -637
- package/dist/engine-7jWE07Zq.js.map +1 -0
- package/dist/engine.d.ts +4 -1
- package/dist/flipbook-engine.iife.js +30 -30
- package/dist/flipbook-engine.iife.js.map +1 -1
- package/dist/flipbook-engine.js +1 -1
- package/dist/flipbook-engine.react.js +1 -1
- package/dist/flipbook-engine.react.js.map +1 -1
- package/dist/flipbook-engine.vue.js +1 -1
- package/dist/flipbook-engine.vue.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/state/store.d.ts +1 -0
- package/package.json +2 -2
- package/react/package.json +5 -5
- package/vue/package.json +5 -5
- package/dist/engine-BuVkDIh-.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ye = Object.defineProperty;
|
|
2
2
|
var Nt = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var m = (e, t, s) =>
|
|
7
|
-
var
|
|
5
|
+
var be = (e, t, s) => t in e ? ye(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
6
|
+
var m = (e, t, s) => be(e, typeof t != "symbol" ? t + "" : t, s), yt = (e, t, s) => t.has(e) || Nt("Cannot " + s);
|
|
7
|
+
var _ = (e, t, s) => (yt(e, t, "read from private field"), s ? s.call(e) : t.get(e)), rt = (e, t, s) => t.has(e) ? Nt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), at = (e, t, s, o) => (yt(e, t, "write to private field"), o ? o.call(e, s) : t.set(e, s), s), J = (e, t, s) => (yt(e, t, "access private method"), s);
|
|
8
8
|
import * as Bt from "pdfjs-dist";
|
|
9
|
-
var
|
|
9
|
+
var xe = Symbol.for("preact-signals");
|
|
10
10
|
function It() {
|
|
11
11
|
if (j > 1)
|
|
12
12
|
j--;
|
|
@@ -20,7 +20,7 @@ function It() {
|
|
|
20
20
|
var s = tt;
|
|
21
21
|
for (tt = void 0, lt++; s !== void 0; ) {
|
|
22
22
|
var o = s.u;
|
|
23
|
-
if (s.u = void 0, s.f &= -3, !(8 & s.f) &&
|
|
23
|
+
if (s.u = void 0, s.f &= -3, !(8 & s.f) && ie(s)) try {
|
|
24
24
|
s.c();
|
|
25
25
|
} catch (r) {
|
|
26
26
|
t || (e = r, t = !0);
|
|
@@ -31,30 +31,30 @@ function It() {
|
|
|
31
31
|
if (lt = 0, j--, t) throw e;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var k = void 0;
|
|
35
35
|
function wt(e) {
|
|
36
|
-
var t =
|
|
37
|
-
|
|
36
|
+
var t = k;
|
|
37
|
+
k = void 0;
|
|
38
38
|
try {
|
|
39
39
|
return e();
|
|
40
40
|
} finally {
|
|
41
|
-
|
|
41
|
+
k = t;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
var tt = void 0, j = 0, lt = 0, _t = 0, ct = void 0, dt = 0;
|
|
45
|
-
function
|
|
46
|
-
if (
|
|
45
|
+
function ee(e) {
|
|
46
|
+
if (k !== void 0) {
|
|
47
47
|
var t = e.n;
|
|
48
|
-
if (t === void 0 || t.t !==
|
|
49
|
-
return t = { i: 0, S: e, p:
|
|
48
|
+
if (t === void 0 || t.t !== k)
|
|
49
|
+
return t = { i: 0, S: e, p: k.s, n: void 0, t: k, e: void 0, x: void 0, r: t }, k.s !== void 0 && (k.s.n = t), k.s = t, e.n = t, 32 & k.f && e.S(t), t;
|
|
50
50
|
if (t.i === -1)
|
|
51
|
-
return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p =
|
|
51
|
+
return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = k.s, t.n = void 0, k.s.n = t, k.s = t), t;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
function I(e, t) {
|
|
55
55
|
this.v = e, this.i = 0, this.n = void 0, this.t = void 0, this.l = 0, this.W = t == null ? void 0 : t.watched, this.Z = t == null ? void 0 : t.unwatched, this.name = t == null ? void 0 : t.name;
|
|
56
56
|
}
|
|
57
|
-
I.prototype.brand =
|
|
57
|
+
I.prototype.brand = xe;
|
|
58
58
|
I.prototype.h = function() {
|
|
59
59
|
return !0;
|
|
60
60
|
};
|
|
@@ -77,7 +77,7 @@ I.prototype.U = function(e) {
|
|
|
77
77
|
};
|
|
78
78
|
I.prototype.subscribe = function(e) {
|
|
79
79
|
var t = this;
|
|
80
|
-
return
|
|
80
|
+
return G(function() {
|
|
81
81
|
var s = t.value;
|
|
82
82
|
wt(function() {
|
|
83
83
|
return e(s);
|
|
@@ -100,7 +100,7 @@ I.prototype.peek = function() {
|
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
102
|
Object.defineProperty(I.prototype, "value", { get: function() {
|
|
103
|
-
var e =
|
|
103
|
+
var e = ee(this);
|
|
104
104
|
return e !== void 0 && (e.i = this.i), this.v;
|
|
105
105
|
}, set: function(e) {
|
|
106
106
|
if (e !== this.v) {
|
|
@@ -118,11 +118,11 @@ Object.defineProperty(I.prototype, "value", { get: function() {
|
|
|
118
118
|
function M(e, t) {
|
|
119
119
|
return new I(e, t);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function ie(e) {
|
|
122
122
|
for (var t = e.s; t !== void 0; t = t.n) if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) return !0;
|
|
123
123
|
return !1;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function se(e) {
|
|
126
126
|
for (var t = e.s; t !== void 0; t = t.n) {
|
|
127
127
|
var s = t.S.n;
|
|
128
128
|
if (s !== void 0 && (t.r = s), t.S.n = t, t.i = -1, t.n === void 0) {
|
|
@@ -131,7 +131,7 @@ function ie(e) {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function ne(e) {
|
|
135
135
|
for (var t = e.s, s = void 0; t !== void 0; ) {
|
|
136
136
|
var o = t.p;
|
|
137
137
|
t.i === -1 ? (t.S.U(t), o !== void 0 && (o.n = t.n), t.n !== void 0 && (t.n.p = o)) : s = t, t.S.n = t.r, t.r !== void 0 && (t.r = void 0), t = o;
|
|
@@ -145,17 +145,17 @@ q.prototype = new I();
|
|
|
145
145
|
q.prototype.h = function() {
|
|
146
146
|
if (this.f &= -3, 1 & this.f) return !1;
|
|
147
147
|
if ((36 & this.f) == 32 || (this.f &= -5, this.g === dt)) return !0;
|
|
148
|
-
if (this.g = dt, this.f |= 1, this.i > 0 && !
|
|
148
|
+
if (this.g = dt, this.f |= 1, this.i > 0 && !ie(this))
|
|
149
149
|
return this.f &= -2, !0;
|
|
150
|
-
var e =
|
|
150
|
+
var e = k;
|
|
151
151
|
try {
|
|
152
|
-
|
|
152
|
+
se(this), k = this;
|
|
153
153
|
var t = this.x();
|
|
154
154
|
(16 & this.f || this.v !== t || this.i === 0) && (this.v = t, this.f &= -17, this.i++);
|
|
155
155
|
} catch (s) {
|
|
156
156
|
this.v = s, this.f |= 16, this.i++;
|
|
157
157
|
}
|
|
158
|
-
return
|
|
158
|
+
return k = e, ne(this), this.f &= -2, !0;
|
|
159
159
|
};
|
|
160
160
|
q.prototype.S = function(e) {
|
|
161
161
|
if (this.t === void 0) {
|
|
@@ -178,35 +178,35 @@ q.prototype.N = function() {
|
|
|
178
178
|
};
|
|
179
179
|
Object.defineProperty(q.prototype, "value", { get: function() {
|
|
180
180
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
181
|
-
var e =
|
|
181
|
+
var e = ee(this);
|
|
182
182
|
if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;
|
|
183
183
|
return this.v;
|
|
184
184
|
} });
|
|
185
185
|
function w(e, t) {
|
|
186
186
|
return new q(e, t);
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function oe(e) {
|
|
189
189
|
var t = e.m;
|
|
190
190
|
if (e.m = void 0, typeof t == "function") {
|
|
191
191
|
j++;
|
|
192
|
-
var s =
|
|
193
|
-
|
|
192
|
+
var s = k;
|
|
193
|
+
k = void 0;
|
|
194
194
|
try {
|
|
195
195
|
t();
|
|
196
196
|
} catch (o) {
|
|
197
197
|
throw e.f &= -2, e.f |= 8, Lt(e), o;
|
|
198
198
|
} finally {
|
|
199
|
-
|
|
199
|
+
k = s, It();
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
function Lt(e) {
|
|
204
204
|
for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);
|
|
205
|
-
e.x = void 0, e.s = void 0,
|
|
205
|
+
e.x = void 0, e.s = void 0, oe(e);
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
if (
|
|
209
|
-
|
|
207
|
+
function Pe(e) {
|
|
208
|
+
if (k !== this) throw new Error("Out-of-order effect");
|
|
209
|
+
ne(this), k = e, this.f &= -2, 8 & this.f && Lt(this), It();
|
|
210
210
|
}
|
|
211
211
|
function X(e, t) {
|
|
212
212
|
this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t == null ? void 0 : t.name;
|
|
@@ -223,9 +223,9 @@ X.prototype.c = function() {
|
|
|
223
223
|
};
|
|
224
224
|
X.prototype.S = function() {
|
|
225
225
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
226
|
-
this.f |= 1, this.f &= -9,
|
|
227
|
-
var e =
|
|
228
|
-
return
|
|
226
|
+
this.f |= 1, this.f &= -9, oe(this), se(this), j++;
|
|
227
|
+
var e = k;
|
|
228
|
+
return k = this, Pe.bind(this, e);
|
|
229
229
|
};
|
|
230
230
|
X.prototype.N = function() {
|
|
231
231
|
2 & this.f || (this.f |= 2, this.u = tt, tt = this);
|
|
@@ -236,7 +236,7 @@ X.prototype.d = function() {
|
|
|
236
236
|
X.prototype.dispose = function() {
|
|
237
237
|
this.d();
|
|
238
238
|
};
|
|
239
|
-
function
|
|
239
|
+
function G(e, t) {
|
|
240
240
|
var s = new X(e, t);
|
|
241
241
|
try {
|
|
242
242
|
s.c();
|
|
@@ -246,27 +246,27 @@ function _(e, t) {
|
|
|
246
246
|
var o = s.d.bind(s);
|
|
247
247
|
return o[Symbol.dispose] = o, o;
|
|
248
248
|
}
|
|
249
|
-
var
|
|
250
|
-
function
|
|
249
|
+
var re = /* @__PURE__ */ Symbol.for("Serenity.initPropHook");
|
|
250
|
+
function Se(e) {
|
|
251
251
|
return !!(e && typeof e.nodeType == "number");
|
|
252
252
|
}
|
|
253
253
|
function vt(e) {
|
|
254
254
|
return typeof e == "string";
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function ae(e) {
|
|
257
257
|
return typeof e == "number";
|
|
258
258
|
}
|
|
259
259
|
function z(e) {
|
|
260
260
|
return typeof e == "object" && e !== null;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function Ce(e) {
|
|
263
263
|
return !!(e && e.isComponent);
|
|
264
264
|
}
|
|
265
265
|
function zt(e) {
|
|
266
266
|
return z(e) && typeof e.length == "number" && typeof e.nodeType != "number";
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
return typeof e == "function" && typeof e[
|
|
268
|
+
function ke(e) {
|
|
269
|
+
return typeof e == "function" && typeof e[re] == "function";
|
|
270
270
|
}
|
|
271
271
|
function it(e) {
|
|
272
272
|
return e != null && typeof e != "boolean";
|
|
@@ -274,18 +274,18 @@ function it(e) {
|
|
|
274
274
|
function st(e) {
|
|
275
275
|
return Array.isArray(e) ? e.map(st).filter(Boolean).join(" ") : z(e) ? Symbol.iterator in e ? st(Array.from(e)) : Object.keys(e).filter((t) => e[t]).join(" ") : it(e) ? "" + e : "";
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function Te(e) {
|
|
278
278
|
return e != null && typeof e == "object" && "current" in e;
|
|
279
279
|
}
|
|
280
280
|
function Ft(e, t) {
|
|
281
|
-
|
|
281
|
+
Te(e) ? e.current = t : typeof e == "function" && e(t);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function Ae(e, t, s) {
|
|
284
284
|
t = { ...t, children: s };
|
|
285
285
|
const o = new e(t), r = o.render();
|
|
286
286
|
return "ref" in t && Ft(t.ref, o), r;
|
|
287
287
|
}
|
|
288
|
-
var
|
|
288
|
+
var Ee = "http://www.w3.org/1998/Math/MathML", Me = /* @__PURE__ */ new Set(["math", "annotation", "annotation-xml", "maction", "merror", "mfrac", "mi", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mprescripts", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msubsup", "msup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "semantics", "menclose", "mfenced"]), De = /* @__PURE__ */ new Set([
|
|
289
289
|
// "a",
|
|
290
290
|
"animate",
|
|
291
291
|
"animateMotion",
|
|
@@ -350,33 +350,33 @@ var Ae = "http://www.w3.org/1998/Math/MathML", Ee = /* @__PURE__ */ new Set(["ma
|
|
|
350
350
|
"tspan",
|
|
351
351
|
"use",
|
|
352
352
|
"view"
|
|
353
|
-
]), Gt = /^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/,
|
|
354
|
-
function
|
|
353
|
+
]), Gt = /^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/, Re = "http://www.w3.org/2000/svg", Ut = /* @__PURE__ */ Symbol.for("Serenity.jsxNamespaceURI");
|
|
354
|
+
function Ie(e) {
|
|
355
355
|
const t = globalThis[Ut];
|
|
356
356
|
return arguments.length && (globalThis[Ut] = e), t;
|
|
357
357
|
}
|
|
358
|
-
var
|
|
359
|
-
function
|
|
360
|
-
return e != null && e[
|
|
358
|
+
var Le = /* @__PURE__ */ Symbol.for("Serenity.jsxTypeKey"), ze = "ShadowRoot";
|
|
359
|
+
function Fe(e) {
|
|
360
|
+
return e != null && e[Le] === ze;
|
|
361
361
|
}
|
|
362
362
|
var bt = /* @__PURE__ */ Symbol.for("Serenity.disposingListeners"), xt = /* @__PURE__ */ Symbol.for("Serenity.lifecycleRoot");
|
|
363
363
|
function Ot() {
|
|
364
364
|
return globalThis[bt] || (globalThis[bt] = /* @__PURE__ */ new WeakMap());
|
|
365
365
|
}
|
|
366
366
|
function Wt(e) {
|
|
367
|
-
e && e.target && (!e.currentTarget || e.currentTarget === e.target) &&
|
|
367
|
+
e && e.target && (!e.currentTarget || e.currentTarget === e.target) && Oe(e == null ? void 0 : e.target);
|
|
368
368
|
}
|
|
369
|
-
function
|
|
369
|
+
function Oe(e, t) {
|
|
370
370
|
if (!e)
|
|
371
371
|
return;
|
|
372
372
|
const s = Ot();
|
|
373
373
|
function o(r) {
|
|
374
|
-
const
|
|
375
|
-
if (
|
|
374
|
+
const h = s.get(r);
|
|
375
|
+
if (h) {
|
|
376
376
|
s.delete(r), r.removeEventListener("disposing", Wt);
|
|
377
|
-
for (const
|
|
377
|
+
for (const u of h)
|
|
378
378
|
try {
|
|
379
|
-
|
|
379
|
+
u.callback(r);
|
|
380
380
|
} catch {
|
|
381
381
|
}
|
|
382
382
|
}
|
|
@@ -393,23 +393,23 @@ function kt(e, t, s) {
|
|
|
393
393
|
callback: t,
|
|
394
394
|
regKey: s
|
|
395
395
|
}]), e.addEventListener("disposing", Wt, { once: !0 })), e;
|
|
396
|
-
const
|
|
397
|
-
return
|
|
396
|
+
const h = r.find((u) => u.callback === t);
|
|
397
|
+
return h ? (h.regKey, e) : (r.push({ callback: t, regKey: s }), e);
|
|
398
398
|
}
|
|
399
399
|
function jt(e, t, s) {
|
|
400
400
|
if (!e || !t)
|
|
401
401
|
return e;
|
|
402
402
|
const o = Ot(), r = o.get(e);
|
|
403
403
|
if (r) {
|
|
404
|
-
for (let
|
|
405
|
-
const
|
|
406
|
-
t && t ===
|
|
404
|
+
for (let h = r.length - 1; h >= 0; h--) {
|
|
405
|
+
const u = r[h];
|
|
406
|
+
t && t === u.callback && r.splice(h, 1);
|
|
407
407
|
}
|
|
408
408
|
r.length === 0 && (o.delete(e), typeof e.removeEventListener == "function" && e.removeEventListener("disposing", Wt));
|
|
409
409
|
}
|
|
410
410
|
return e;
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function We(...e) {
|
|
413
413
|
if (e.length > 0) {
|
|
414
414
|
const t = globalThis[xt] || null;
|
|
415
415
|
return globalThis[xt] = e[0] || null, t;
|
|
@@ -419,80 +419,80 @@ function Oe(...e) {
|
|
|
419
419
|
function Z(e) {
|
|
420
420
|
return e != null && typeof e == "object" && typeof e.subscribe == "function" && typeof e.peek == "function" && "value" in e;
|
|
421
421
|
}
|
|
422
|
-
var ot,
|
|
422
|
+
var ot, O, U, Tt, At, te, $e = (te = class {
|
|
423
423
|
constructor(e, t, s) {
|
|
424
|
-
rt(this,
|
|
424
|
+
rt(this, U);
|
|
425
425
|
rt(this, ot);
|
|
426
|
-
rt(this,
|
|
427
|
-
this.signal = e, this.isInitial = !0, this.hasChanged = !1, this.lifecycleRoot = t, at(this,
|
|
426
|
+
rt(this, O);
|
|
427
|
+
this.signal = e, this.isInitial = !0, this.hasChanged = !1, this.lifecycleRoot = t, at(this, O, s);
|
|
428
428
|
}
|
|
429
429
|
get lifecycleNode() {
|
|
430
|
-
return
|
|
430
|
+
return _(this, O);
|
|
431
431
|
}
|
|
432
432
|
get effectDisposer() {
|
|
433
|
-
return
|
|
433
|
+
return _(this, ot);
|
|
434
434
|
}
|
|
435
435
|
set effectDisposer(e) {
|
|
436
|
-
J(this,
|
|
436
|
+
J(this, U, Tt).call(this), at(this, ot, e), J(this, U, At).call(this);
|
|
437
437
|
}
|
|
438
438
|
set lifecycleNode(e) {
|
|
439
|
-
e !==
|
|
439
|
+
e !== _(this, O) && (J(this, U, Tt).call(this), at(this, O, e), J(this, U, At).call(this));
|
|
440
440
|
}
|
|
441
|
-
}, ot = new WeakMap(),
|
|
441
|
+
}, ot = new WeakMap(), O = new WeakMap(), U = new WeakSet(), Tt = function() {
|
|
442
442
|
var e;
|
|
443
|
-
jt(
|
|
443
|
+
jt(_(this, O), this.effectDisposer), jt(_(this, O), (e = this.signal) == null ? void 0 : e.derivedDisposer);
|
|
444
444
|
}, At = function() {
|
|
445
445
|
var e;
|
|
446
|
-
kt(
|
|
447
|
-
},
|
|
446
|
+
kt(_(this, O), this.effectDisposer), kt(_(this, O), (e = this.signal) == null ? void 0 : e.derivedDisposer);
|
|
447
|
+
}, te);
|
|
448
448
|
function nt(e, t, s) {
|
|
449
|
-
const o = s != null && s.useLifecycleRoot ?
|
|
450
|
-
r.newValue =
|
|
449
|
+
const o = s != null && s.useLifecycleRoot ? We() : void 0, r = new $e(e, o, s == null ? void 0 : s.lifecycleNode), h = r.signal.subscribe(function(u) {
|
|
450
|
+
r.newValue = u, r.isInitial && (this != null && this.dispose) && (r.effectDisposer = this.dispose.bind(this)), r.hasChanged = !r.isInitial && r.prevValue !== r.newValue;
|
|
451
451
|
try {
|
|
452
452
|
t(r);
|
|
453
453
|
} finally {
|
|
454
454
|
r.prevValue = r.newValue, r.isInitial = !1;
|
|
455
455
|
}
|
|
456
456
|
});
|
|
457
|
-
return
|
|
457
|
+
return h && !r.effectDisposer && (r.effectDisposer = h), r.effectDisposer;
|
|
458
458
|
}
|
|
459
459
|
function Vt(e, t) {
|
|
460
460
|
e instanceof window.HTMLTemplateElement ? e.content.appendChild(t) : e.appendChild(t);
|
|
461
461
|
}
|
|
462
462
|
var Pt = 0, Et = "__domwisefrag_";
|
|
463
|
-
function
|
|
463
|
+
function he(e) {
|
|
464
464
|
return e instanceof Comment && e.data.startsWith(Et);
|
|
465
465
|
}
|
|
466
466
|
function Zt(e) {
|
|
467
|
-
return e instanceof DocumentFragment &&
|
|
467
|
+
return e instanceof DocumentFragment && he(e.firstChild);
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function He(e, t) {
|
|
470
470
|
var s;
|
|
471
471
|
typeof e.replaceWith == "function" ? e.replaceWith(t) : (s = e.parentNode) == null || s.replaceChild(t, e);
|
|
472
472
|
}
|
|
473
473
|
function qt(e) {
|
|
474
474
|
return e instanceof DocumentFragment ? (++Pt, e.prepend(document.createComment(Et + Pt)), e.append(document.createComment(Et + Pt)), e) : e instanceof Node ? e : it(e) ? document.createTextNode(e) : document.createComment("");
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function Ne(e, t) {
|
|
477
477
|
let s;
|
|
478
478
|
nt(t, (o) => {
|
|
479
|
-
var
|
|
479
|
+
var u;
|
|
480
480
|
if (o.isInitial) {
|
|
481
481
|
s = qt(o.newValue);
|
|
482
|
-
let
|
|
483
|
-
ut(e, s), o.lifecycleNode = (s =
|
|
482
|
+
let g = Zt(s) ? s.firstChild : s;
|
|
483
|
+
ut(e, s), o.lifecycleNode = (s = g) ?? e;
|
|
484
484
|
return;
|
|
485
485
|
}
|
|
486
486
|
if (!o.hasChanged)
|
|
487
487
|
return;
|
|
488
488
|
const r = qt(o.newValue);
|
|
489
|
-
if (
|
|
490
|
-
let
|
|
491
|
-
for (; (
|
|
489
|
+
if (he(s)) {
|
|
490
|
+
let g;
|
|
491
|
+
for (; (g = s.nextSibling) && ((u = g.parentNode) == null || u.removeChild(g), !(g instanceof Comment && g.data === s.data)); )
|
|
492
492
|
;
|
|
493
493
|
}
|
|
494
|
-
let
|
|
495
|
-
|
|
494
|
+
let h = Zt(r) ? r.firstChild : r;
|
|
495
|
+
He(s, r), o.lifecycleNode = (s = h) ?? e;
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
498
|
function ut(e, t) {
|
|
@@ -500,51 +500,51 @@ function ut(e, t) {
|
|
|
500
500
|
if (zt(t))
|
|
501
501
|
for (const s of [...t])
|
|
502
502
|
ut(e, s);
|
|
503
|
-
else if (vt(t) ||
|
|
503
|
+
else if (vt(t) || ae(t))
|
|
504
504
|
Vt(e, document.createTextNode(t));
|
|
505
|
-
else if (
|
|
505
|
+
else if (Se(t))
|
|
506
506
|
Vt(e, t);
|
|
507
|
-
else if (
|
|
507
|
+
else if (Fe(t)) {
|
|
508
508
|
const s = e.attachShadow(t.attr);
|
|
509
509
|
ut(s, t.children), Ft(t.ref, s);
|
|
510
|
-
} else Z(t) &&
|
|
510
|
+
} else Z(t) && Ne(e, t);
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function le(e) {
|
|
513
513
|
return e == null || (zt(e) ? e = Array.from(e).map((t) => Z(t) ? t.peek() : t) : z(e) && (e = { ...e }, Object.entries(e).forEach(([t, s]) => {
|
|
514
514
|
Z(s) && (e[t] = s.peek());
|
|
515
515
|
}))), e;
|
|
516
516
|
}
|
|
517
|
-
function
|
|
517
|
+
function Be(e, t) {
|
|
518
518
|
if (t == null || t === !1 || t === !0)
|
|
519
519
|
return;
|
|
520
|
-
t =
|
|
520
|
+
t = le(t);
|
|
521
521
|
const s = (st(t) ?? "").split(" ");
|
|
522
522
|
for (let o of s)
|
|
523
523
|
o && e.classList.remove(o);
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function _e(e, t, s) {
|
|
526
526
|
if (t == null || t === !1) {
|
|
527
|
-
|
|
527
|
+
Be(e, s);
|
|
528
528
|
return;
|
|
529
529
|
}
|
|
530
|
-
s =
|
|
530
|
+
s = le(s), zt(t) ? t = Array.from(t).map((o) => {
|
|
531
531
|
let r = o;
|
|
532
|
-
return Z(o) && nt(o, (
|
|
533
|
-
if (
|
|
534
|
-
r =
|
|
532
|
+
return Z(o) && nt(o, (h) => {
|
|
533
|
+
if (h.isInitial) {
|
|
534
|
+
r = h.newValue;
|
|
535
535
|
return;
|
|
536
536
|
}
|
|
537
|
-
St(e,
|
|
537
|
+
St(e, h.newValue, h.prevValue);
|
|
538
538
|
}, {
|
|
539
539
|
lifecycleNode: e
|
|
540
540
|
}), r;
|
|
541
541
|
}) : z(t) && (t = { ...t }, Object.entries(t).forEach(([o, r]) => {
|
|
542
|
-
Z(r) && nt(r, (
|
|
543
|
-
if (
|
|
544
|
-
t[o] =
|
|
542
|
+
Z(r) && nt(r, (h) => {
|
|
543
|
+
if (h.isInitial) {
|
|
544
|
+
t[o] = h.newValue;
|
|
545
545
|
return;
|
|
546
546
|
}
|
|
547
|
-
St(e, !!
|
|
547
|
+
St(e, !!h.newValue && o, !!h.prevValue && o);
|
|
548
548
|
}, {
|
|
549
549
|
lifecycleNode: e
|
|
550
550
|
});
|
|
@@ -554,16 +554,16 @@ function St(e, t, s) {
|
|
|
554
554
|
const o = (st(t) ?? "").split(" ");
|
|
555
555
|
if (s) {
|
|
556
556
|
const r = (st(s) ?? "").split(" ");
|
|
557
|
-
for (let
|
|
558
|
-
|
|
557
|
+
for (let h of r)
|
|
558
|
+
h && !o.includes(h) && e.classList.remove(h);
|
|
559
559
|
}
|
|
560
560
|
for (let r of o)
|
|
561
561
|
r && e.classList.add(r);
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function Ge(e, t) {
|
|
564
564
|
return e + t.charAt(0).toUpperCase() + t.substring(1);
|
|
565
565
|
}
|
|
566
|
-
var
|
|
566
|
+
var Ue = /* @__PURE__ */ (() => {
|
|
567
567
|
let e = {
|
|
568
568
|
animationIterationCount: 0,
|
|
569
569
|
borderImageOutset: 0,
|
|
@@ -612,12 +612,12 @@ var Ge = /* @__PURE__ */ (() => {
|
|
|
612
612
|
const t = ["Webkit", "ms", "Moz", "O"];
|
|
613
613
|
return Object.keys(e).forEach((s) => {
|
|
614
614
|
t.forEach((o) => {
|
|
615
|
-
e[
|
|
615
|
+
e[Ge(o, s)] = 0;
|
|
616
616
|
});
|
|
617
617
|
}), e;
|
|
618
618
|
})();
|
|
619
619
|
function Mt(e, t, s) {
|
|
620
|
-
t.indexOf("-") === 0 ? e.style.setProperty(t, s) :
|
|
620
|
+
t.indexOf("-") === 0 ? e.style.setProperty(t, s) : ae(s) && Ue[t] !== 0 ? e.style[t] = s + "px" : e.style[t] = s;
|
|
621
621
|
}
|
|
622
622
|
function Xt(e, t) {
|
|
623
623
|
if (!(t == null || t === !1 || t === !0)) {
|
|
@@ -630,7 +630,7 @@ function Xt(e, t) {
|
|
|
630
630
|
});
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
|
-
function
|
|
633
|
+
function je(e, t, s) {
|
|
634
634
|
if (t == null || t === !1 || t === !0) {
|
|
635
635
|
Xt(e, s);
|
|
636
636
|
return;
|
|
@@ -643,18 +643,18 @@ function Ue(e, t, s) {
|
|
|
643
643
|
z(s) ? (t = { ...t }, Object.keys(s).forEach((o) => {
|
|
644
644
|
o in t || (t[o] = "");
|
|
645
645
|
})) : Xt(e, s), Object.entries(t).forEach(([o, r]) => {
|
|
646
|
-
Z(r) ? nt(r, (
|
|
646
|
+
Z(r) ? nt(r, (h) => Mt(e, o, h.newValue), {
|
|
647
647
|
lifecycleNode: e
|
|
648
648
|
}) : Mt(e, o, r);
|
|
649
649
|
});
|
|
650
650
|
return;
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
var
|
|
653
|
+
var Ve = "http://www.w3.org/1999/xlink", Ze = "http://www.w3.org/XML/1998/namespace";
|
|
654
654
|
function ht(e, t) {
|
|
655
655
|
return e.replace(/[A-Z]/g, (s) => t + s.toLowerCase());
|
|
656
656
|
}
|
|
657
|
-
var
|
|
657
|
+
var qe = /* @__PURE__ */ new Map([
|
|
658
658
|
["autoComplete", "autocomplete"],
|
|
659
659
|
["autoFocus", "autofocus"],
|
|
660
660
|
["className", "class"],
|
|
@@ -676,10 +676,10 @@ var Ze = /* @__PURE__ */ new Map([
|
|
|
676
676
|
function Yt(e, t, s, o) {
|
|
677
677
|
switch (t) {
|
|
678
678
|
case "dataset":
|
|
679
|
-
o != null && Object.entries(o).forEach(([
|
|
680
|
-
|
|
681
|
-
}), Object.entries(s).forEach(([
|
|
682
|
-
|
|
679
|
+
o != null && Object.entries(o).forEach(([h, u]) => {
|
|
680
|
+
u != null && delete e.dataset[h];
|
|
681
|
+
}), Object.entries(s).forEach(([h, u]) => {
|
|
682
|
+
u != null && (e.dataset[h] = u);
|
|
683
683
|
});
|
|
684
684
|
return;
|
|
685
685
|
case "textContent":
|
|
@@ -702,7 +702,7 @@ function Yt(e, t, s, o) {
|
|
|
702
702
|
}
|
|
703
703
|
break;
|
|
704
704
|
case "class":
|
|
705
|
-
|
|
705
|
+
_e(e, s, o);
|
|
706
706
|
return;
|
|
707
707
|
case "spellcheck":
|
|
708
708
|
e.spellcheck = s === "" || s === !0 || s === "true" ? !0 : s === !1 || s === "false" ? !1 : s;
|
|
@@ -717,15 +717,15 @@ function Yt(e, t, s, o) {
|
|
|
717
717
|
case "namespaceURI":
|
|
718
718
|
return;
|
|
719
719
|
case "style":
|
|
720
|
-
|
|
720
|
+
je(e, s, o);
|
|
721
721
|
return;
|
|
722
722
|
case "on":
|
|
723
723
|
case "onCapture":
|
|
724
724
|
const r = t === "onCapture";
|
|
725
|
-
o != null && Object.entries(o).forEach(([
|
|
726
|
-
(s == null || s[
|
|
727
|
-
}), Object.entries(s).forEach(([
|
|
728
|
-
(o == null || o[
|
|
725
|
+
o != null && Object.entries(o).forEach(([h, u]) => {
|
|
726
|
+
(s == null || s[h] !== u) && e.removeEventListener(h, u, r);
|
|
727
|
+
}), Object.entries(s).forEach(([h, u]) => {
|
|
728
|
+
(o == null || o[h] !== u) && e.addEventListener(h, u, r);
|
|
729
729
|
});
|
|
730
730
|
return;
|
|
731
731
|
case "xlinkActuate":
|
|
@@ -735,7 +735,7 @@ function Yt(e, t, s, o) {
|
|
|
735
735
|
case "xlinkShow":
|
|
736
736
|
case "xlinkTitle":
|
|
737
737
|
case "xlinkType":
|
|
738
|
-
e.setAttributeNS(
|
|
738
|
+
e.setAttributeNS(Ve, ht(t, ":"), s);
|
|
739
739
|
return;
|
|
740
740
|
case "xmlnsXlink":
|
|
741
741
|
e.setAttribute("xmlns:xlink", s);
|
|
@@ -743,7 +743,7 @@ function Yt(e, t, s, o) {
|
|
|
743
743
|
case "xmlBase":
|
|
744
744
|
case "xmlLang":
|
|
745
745
|
case "xmlSpace":
|
|
746
|
-
e.setAttributeNS(
|
|
746
|
+
e.setAttributeNS(Ze, ht(t, ":"), s);
|
|
747
747
|
return;
|
|
748
748
|
}
|
|
749
749
|
if (typeof s == "function") {
|
|
@@ -751,9 +751,9 @@ function Yt(e, t, s, o) {
|
|
|
751
751
|
if (o != null && o === s)
|
|
752
752
|
return;
|
|
753
753
|
let r = t.toLowerCase();
|
|
754
|
-
const
|
|
755
|
-
let
|
|
756
|
-
!
|
|
754
|
+
const h = r.endsWith("capture");
|
|
755
|
+
let u;
|
|
756
|
+
!h && (e[r] === null || o != null && e[r] === o) ? (e[r] = s, kt(e, Ye.bind(e, r))) : h ? (u = r.substring(2, r.length - 7), o != null && e.removeEventListener(u, o, !0), e.addEventListener(u, s, !0)) : (r in window ? u = r.substring(2) : u = r[2] + t.slice(3), o != null && e.removeEventListener(u, o), e.addEventListener(u, s));
|
|
757
757
|
} else
|
|
758
758
|
console.warn(`A function was provided for JSX ${e.tagName} element ${t} which does not start with "on":`, s, e.tagName);
|
|
759
759
|
return;
|
|
@@ -783,35 +783,35 @@ function Yt(e, t, s, o) {
|
|
|
783
783
|
}
|
|
784
784
|
s !== !1 && s != null && (e instanceof SVGElement && !Gt.test(t) ? e.setAttribute(ht(t, "-"), s) : e.setAttribute(t, s));
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function Xe(e, t) {
|
|
787
787
|
for (let [s, o] of Object.entries(t))
|
|
788
|
-
s =
|
|
788
|
+
s = qe.get(s) ?? s, Z(o) ? nt(o, (r) => Yt(e, s, r.newValue, r.prevValue), {
|
|
789
789
|
lifecycleNode: e
|
|
790
|
-
}) :
|
|
790
|
+
}) : ke(o) ? o[re](e, s) : Yt(e, s, o);
|
|
791
791
|
return e;
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function Ye(e) {
|
|
794
794
|
this[e] = null;
|
|
795
795
|
}
|
|
796
|
-
function
|
|
796
|
+
function p(e, t) {
|
|
797
797
|
let { children: s, ...o } = t || {}, r = o.namespaceURI;
|
|
798
|
-
r || (
|
|
799
|
-
let
|
|
798
|
+
r || (De.has(e) ? r = Re : Me.has(e) ? r = Ee : r = Ie());
|
|
799
|
+
let h;
|
|
800
800
|
if (vt(e)) {
|
|
801
|
-
if (
|
|
801
|
+
if (h = r ? document.createElementNS(r, e) : document.createElement(e), Xe(h, o), ut(h, s), h instanceof window.HTMLSelectElement && o.value != null)
|
|
802
802
|
if (o.multiple === !0 && Array.isArray(o.value)) {
|
|
803
|
-
const
|
|
804
|
-
|
|
803
|
+
const u = o.value.map((g) => String(g));
|
|
804
|
+
h.querySelectorAll("option").forEach((g) => g.selected = u.includes(g.value));
|
|
805
805
|
} else
|
|
806
|
-
|
|
807
|
-
Ft(o.ref,
|
|
806
|
+
h.value = o.value;
|
|
807
|
+
Ft(o.ref, h);
|
|
808
808
|
} else if (typeof e == "function")
|
|
809
|
-
z(e.defaultProps) && (o = { ...e.defaultProps, ...o }),
|
|
809
|
+
z(e.defaultProps) && (o = { ...e.defaultProps, ...o }), h = Ce(e) ? Ae(e, o, s) : e({ ...o, children: s });
|
|
810
810
|
else
|
|
811
811
|
throw new TypeError(`Invalid JSX element type: ${e}`);
|
|
812
|
-
return
|
|
812
|
+
return h;
|
|
813
813
|
}
|
|
814
|
-
var
|
|
814
|
+
var Qe = /* @__PURE__ */ Symbol.for("preact-signals");
|
|
815
815
|
function $t() {
|
|
816
816
|
if (V > 1)
|
|
817
817
|
V--;
|
|
@@ -825,7 +825,7 @@ function $t() {
|
|
|
825
825
|
var s = et;
|
|
826
826
|
for (et = void 0, gt++; s !== void 0; ) {
|
|
827
827
|
var o = s.u;
|
|
828
|
-
if (s.u = void 0, s.f &= -3, !(8 & s.f) &&
|
|
828
|
+
if (s.u = void 0, s.f &= -3, !(8 & s.f) && ue(s)) try {
|
|
829
829
|
s.c();
|
|
830
830
|
} catch (r) {
|
|
831
831
|
t || (e = r, t = !0);
|
|
@@ -836,36 +836,36 @@ function $t() {
|
|
|
836
836
|
if (gt = 0, V--, t) throw e;
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
|
-
var
|
|
840
|
-
function
|
|
841
|
-
var t =
|
|
842
|
-
|
|
839
|
+
var S = void 0;
|
|
840
|
+
function ce(e) {
|
|
841
|
+
var t = S;
|
|
842
|
+
S = void 0;
|
|
843
843
|
try {
|
|
844
844
|
return e();
|
|
845
845
|
} finally {
|
|
846
|
-
|
|
846
|
+
S = t;
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
849
|
var et = void 0, V = 0, gt = 0, Qt = 0, pt = void 0, ft = 0;
|
|
850
|
-
function
|
|
851
|
-
if (
|
|
850
|
+
function de(e) {
|
|
851
|
+
if (S !== void 0) {
|
|
852
852
|
var t = e.n;
|
|
853
|
-
if (t === void 0 || t.t !==
|
|
854
|
-
return t = { i: 0, S: e, p:
|
|
853
|
+
if (t === void 0 || t.t !== S)
|
|
854
|
+
return t = { i: 0, S: e, p: S.s, n: void 0, t: S, e: void 0, x: void 0, r: t }, S.s !== void 0 && (S.s.n = t), S.s = t, e.n = t, 32 & S.f && e.S(t), t;
|
|
855
855
|
if (t.i === -1)
|
|
856
|
-
return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p =
|
|
856
|
+
return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = S.s, t.n = void 0, S.s.n = t, S.s = t), t;
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
859
|
function L(e, t) {
|
|
860
860
|
this.v = e, this.i = 0, this.n = void 0, this.t = void 0, this.l = 0, this.W = t == null ? void 0 : t.watched, this.Z = t == null ? void 0 : t.unwatched, this.name = t == null ? void 0 : t.name;
|
|
861
861
|
}
|
|
862
|
-
L.prototype.brand =
|
|
862
|
+
L.prototype.brand = Qe;
|
|
863
863
|
L.prototype.h = function() {
|
|
864
864
|
return !0;
|
|
865
865
|
};
|
|
866
866
|
L.prototype.S = function(e) {
|
|
867
867
|
var t = this, s = this.t;
|
|
868
|
-
s !== e && e.e === void 0 && (e.x = s, this.t = e, s !== void 0 ? s.e = e :
|
|
868
|
+
s !== e && e.e === void 0 && (e.x = s, this.t = e, s !== void 0 ? s.e = e : ce(function() {
|
|
869
869
|
var o;
|
|
870
870
|
(o = t.W) == null || o.call(t);
|
|
871
871
|
}));
|
|
@@ -874,7 +874,7 @@ L.prototype.U = function(e) {
|
|
|
874
874
|
var t = this;
|
|
875
875
|
if (this.t !== void 0) {
|
|
876
876
|
var s = e.e, o = e.x;
|
|
877
|
-
s !== void 0 && (s.x = o, e.e = void 0), o !== void 0 && (o.e = s, e.x = void 0), e === this.t && (this.t = o, o === void 0 &&
|
|
877
|
+
s !== void 0 && (s.x = o, e.e = void 0), o !== void 0 && (o.e = s, e.x = void 0), e === this.t && (this.t = o, o === void 0 && ce(function() {
|
|
878
878
|
var r;
|
|
879
879
|
(r = t.Z) == null || r.call(t);
|
|
880
880
|
}));
|
|
@@ -882,13 +882,13 @@ L.prototype.U = function(e) {
|
|
|
882
882
|
};
|
|
883
883
|
L.prototype.subscribe = function(e) {
|
|
884
884
|
var t = this;
|
|
885
|
-
return
|
|
886
|
-
var s = t.value, o =
|
|
887
|
-
|
|
885
|
+
return Je(function() {
|
|
886
|
+
var s = t.value, o = S;
|
|
887
|
+
S = void 0;
|
|
888
888
|
try {
|
|
889
889
|
e(s);
|
|
890
890
|
} finally {
|
|
891
|
-
|
|
891
|
+
S = o;
|
|
892
892
|
}
|
|
893
893
|
}, { name: "sub" });
|
|
894
894
|
};
|
|
@@ -902,16 +902,16 @@ L.prototype.toJSON = function() {
|
|
|
902
902
|
return this.value;
|
|
903
903
|
};
|
|
904
904
|
L.prototype.peek = function() {
|
|
905
|
-
var e =
|
|
906
|
-
|
|
905
|
+
var e = S;
|
|
906
|
+
S = void 0;
|
|
907
907
|
try {
|
|
908
908
|
return this.value;
|
|
909
909
|
} finally {
|
|
910
|
-
|
|
910
|
+
S = e;
|
|
911
911
|
}
|
|
912
912
|
};
|
|
913
913
|
Object.defineProperty(L.prototype, "value", { get: function() {
|
|
914
|
-
var e =
|
|
914
|
+
var e = de(this);
|
|
915
915
|
return e !== void 0 && (e.i = this.i), this.v;
|
|
916
916
|
}, set: function(e) {
|
|
917
917
|
if (e !== this.v) {
|
|
@@ -926,11 +926,11 @@ Object.defineProperty(L.prototype, "value", { get: function() {
|
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
} });
|
|
929
|
-
function
|
|
929
|
+
function ue(e) {
|
|
930
930
|
for (var t = e.s; t !== void 0; t = t.n) if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) return !0;
|
|
931
931
|
return !1;
|
|
932
932
|
}
|
|
933
|
-
function
|
|
933
|
+
function ge(e) {
|
|
934
934
|
for (var t = e.s; t !== void 0; t = t.n) {
|
|
935
935
|
var s = t.S.n;
|
|
936
936
|
if (s !== void 0 && (t.r = s), t.S.n = t, t.i = -1, t.n === void 0) {
|
|
@@ -939,7 +939,7 @@ function ue(e) {
|
|
|
939
939
|
}
|
|
940
940
|
}
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function pe(e) {
|
|
943
943
|
for (var t = e.s, s = void 0; t !== void 0; ) {
|
|
944
944
|
var o = t.p;
|
|
945
945
|
t.i === -1 ? (t.S.U(t), o !== void 0 && (o.n = t.n), t.n !== void 0 && (t.n.p = o)) : s = t, t.S.n = t.r, t.r !== void 0 && (t.r = void 0), t = o;
|
|
@@ -953,17 +953,17 @@ Y.prototype = new L();
|
|
|
953
953
|
Y.prototype.h = function() {
|
|
954
954
|
if (this.f &= -3, 1 & this.f) return !1;
|
|
955
955
|
if ((36 & this.f) == 32 || (this.f &= -5, this.g === ft)) return !0;
|
|
956
|
-
if (this.g = ft, this.f |= 1, this.i > 0 && !
|
|
956
|
+
if (this.g = ft, this.f |= 1, this.i > 0 && !ue(this))
|
|
957
957
|
return this.f &= -2, !0;
|
|
958
|
-
var e =
|
|
958
|
+
var e = S;
|
|
959
959
|
try {
|
|
960
|
-
|
|
960
|
+
ge(this), S = this;
|
|
961
961
|
var t = this.x();
|
|
962
962
|
(16 & this.f || this.v !== t || this.i === 0) && (this.v = t, this.f &= -17, this.i++);
|
|
963
963
|
} catch (s) {
|
|
964
964
|
this.v = s, this.f |= 16, this.i++;
|
|
965
965
|
}
|
|
966
|
-
return
|
|
966
|
+
return S = e, pe(this), this.f &= -2, !0;
|
|
967
967
|
};
|
|
968
968
|
Y.prototype.S = function(e) {
|
|
969
969
|
if (this.t === void 0) {
|
|
@@ -986,32 +986,32 @@ Y.prototype.N = function() {
|
|
|
986
986
|
};
|
|
987
987
|
Object.defineProperty(Y.prototype, "value", { get: function() {
|
|
988
988
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
989
|
-
var e =
|
|
989
|
+
var e = de(this);
|
|
990
990
|
if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;
|
|
991
991
|
return this.v;
|
|
992
992
|
} });
|
|
993
|
-
function
|
|
993
|
+
function fe(e) {
|
|
994
994
|
var t = e.m;
|
|
995
995
|
if (e.m = void 0, typeof t == "function") {
|
|
996
996
|
V++;
|
|
997
|
-
var s =
|
|
998
|
-
|
|
997
|
+
var s = S;
|
|
998
|
+
S = void 0;
|
|
999
999
|
try {
|
|
1000
1000
|
t();
|
|
1001
1001
|
} catch (o) {
|
|
1002
1002
|
throw e.f &= -2, e.f |= 8, Ht(e), o;
|
|
1003
1003
|
} finally {
|
|
1004
|
-
|
|
1004
|
+
S = s, $t();
|
|
1005
1005
|
}
|
|
1006
1006
|
}
|
|
1007
1007
|
}
|
|
1008
1008
|
function Ht(e) {
|
|
1009
1009
|
for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);
|
|
1010
|
-
e.x = void 0, e.s = void 0,
|
|
1010
|
+
e.x = void 0, e.s = void 0, fe(e);
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1013
|
-
if (
|
|
1014
|
-
|
|
1012
|
+
function Ke(e) {
|
|
1013
|
+
if (S !== this) throw new Error("Out-of-order effect");
|
|
1014
|
+
pe(this), S = e, this.f &= -2, 8 & this.f && Ht(this), $t();
|
|
1015
1015
|
}
|
|
1016
1016
|
function Q(e, t) {
|
|
1017
1017
|
this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t == null ? void 0 : t.name;
|
|
@@ -1028,9 +1028,9 @@ Q.prototype.c = function() {
|
|
|
1028
1028
|
};
|
|
1029
1029
|
Q.prototype.S = function() {
|
|
1030
1030
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
1031
|
-
this.f |= 1, this.f &= -9,
|
|
1032
|
-
var e =
|
|
1033
|
-
return
|
|
1031
|
+
this.f |= 1, this.f &= -9, fe(this), ge(this), V++;
|
|
1032
|
+
var e = S;
|
|
1033
|
+
return S = this, Ke.bind(this, e);
|
|
1034
1034
|
};
|
|
1035
1035
|
Q.prototype.N = function() {
|
|
1036
1036
|
2 & this.f || (this.f |= 2, this.u = et, et = this);
|
|
@@ -1041,7 +1041,7 @@ Q.prototype.d = function() {
|
|
|
1041
1041
|
Q.prototype.dispose = function() {
|
|
1042
1042
|
this.d();
|
|
1043
1043
|
};
|
|
1044
|
-
function
|
|
1044
|
+
function Je(e, t) {
|
|
1045
1045
|
var s = new Q(e, t);
|
|
1046
1046
|
try {
|
|
1047
1047
|
s.c();
|
|
@@ -1051,7 +1051,7 @@ function Ke(e, t) {
|
|
|
1051
1051
|
var o = s.d.bind(s);
|
|
1052
1052
|
return o[Symbol.dispose] = o, o;
|
|
1053
1053
|
}
|
|
1054
|
-
const
|
|
1054
|
+
const ti = {
|
|
1055
1055
|
emptyStateTitle: "No data available.",
|
|
1056
1056
|
thumbnails: "Thumbnails",
|
|
1057
1057
|
singlePageMode: "Single Page Mode",
|
|
@@ -1065,7 +1065,7 @@ const Je = {
|
|
|
1065
1065
|
downloadCatalog: "Download Catalog",
|
|
1066
1066
|
play: "Play",
|
|
1067
1067
|
pause: "Pause"
|
|
1068
|
-
},
|
|
1068
|
+
}, ei = {
|
|
1069
1069
|
emptyStateTitle: "Veri bulunamadi.",
|
|
1070
1070
|
thumbnails: "Küçük Resimler",
|
|
1071
1071
|
singlePageMode: "Tek Sayfa Modu",
|
|
@@ -1080,10 +1080,10 @@ const Je = {
|
|
|
1080
1080
|
play: "Otomatik Oynat",
|
|
1081
1081
|
pause: "Duraklat"
|
|
1082
1082
|
}, Ct = {
|
|
1083
|
-
en:
|
|
1084
|
-
tr:
|
|
1083
|
+
en: ti,
|
|
1084
|
+
tr: ei
|
|
1085
1085
|
};
|
|
1086
|
-
function
|
|
1086
|
+
function ii(e = {}) {
|
|
1087
1087
|
var r;
|
|
1088
1088
|
const t = e.locale ?? "en", s = Ct[t] ?? Ct.en, o = ((r = e.messages) == null ? void 0 : r[t]) ?? {};
|
|
1089
1089
|
return {
|
|
@@ -1092,11 +1092,11 @@ function ei(e = {}) {
|
|
|
1092
1092
|
...o
|
|
1093
1093
|
};
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1096
|
-
const t = w(() =>
|
|
1097
|
-
return /* @__PURE__ */
|
|
1098
|
-
/* @__PURE__ */
|
|
1099
|
-
/* @__PURE__ */
|
|
1095
|
+
function si(e) {
|
|
1096
|
+
const t = w(() => ii({ locale: e.store.locale.value, messages: e.store.messages.value }));
|
|
1097
|
+
return /* @__PURE__ */ p("div", { class: "bk-toolbar", role: "toolbar", "aria-label": "Flipbook controls", children: [
|
|
1098
|
+
/* @__PURE__ */ p("div", { class: "bk-btn-group", children: [
|
|
1099
|
+
/* @__PURE__ */ p(
|
|
1100
1100
|
"button",
|
|
1101
1101
|
{
|
|
1102
1102
|
type: "button",
|
|
@@ -1105,15 +1105,15 @@ function ii(e) {
|
|
|
1105
1105
|
"aria-label": w(() => t.value.thumbnails || "Thumbnails"),
|
|
1106
1106
|
"aria-pressed": w(() => e.store.showThumbs.value ? "true" : "false"),
|
|
1107
1107
|
title: w(() => t.value.thumbnails || "Thumbnails"),
|
|
1108
|
-
children: /* @__PURE__ */
|
|
1109
|
-
/* @__PURE__ */
|
|
1110
|
-
/* @__PURE__ */
|
|
1111
|
-
/* @__PURE__ */
|
|
1112
|
-
/* @__PURE__ */
|
|
1108
|
+
children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
1109
|
+
/* @__PURE__ */ p("rect", { x: "3", y: "3", width: "7", height: "7" }),
|
|
1110
|
+
/* @__PURE__ */ p("rect", { x: "14", y: "3", width: "7", height: "7" }),
|
|
1111
|
+
/* @__PURE__ */ p("rect", { x: "14", y: "14", width: "7", height: "7" }),
|
|
1112
|
+
/* @__PURE__ */ p("rect", { x: "3", y: "14", width: "7", height: "7" })
|
|
1113
1113
|
] })
|
|
1114
1114
|
}
|
|
1115
1115
|
),
|
|
1116
|
-
/* @__PURE__ */
|
|
1116
|
+
/* @__PURE__ */ p(
|
|
1117
1117
|
"button",
|
|
1118
1118
|
{
|
|
1119
1119
|
type: "button",
|
|
@@ -1122,16 +1122,16 @@ function ii(e) {
|
|
|
1122
1122
|
"aria-label": w(() => t.value.singlePageMode || "Single Page"),
|
|
1123
1123
|
"aria-pressed": w(() => e.store.isSingleMode.value ? "true" : "false"),
|
|
1124
1124
|
title: w(() => t.value.singlePageMode || "Single Page"),
|
|
1125
|
-
children: /* @__PURE__ */
|
|
1126
|
-
/* @__PURE__ */
|
|
1127
|
-
/* @__PURE__ */
|
|
1128
|
-
/* @__PURE__ */
|
|
1129
|
-
/* @__PURE__ */
|
|
1130
|
-
/* @__PURE__ */
|
|
1125
|
+
children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
1126
|
+
/* @__PURE__ */ p("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
1127
|
+
/* @__PURE__ */ p("polyline", { points: "14 2 14 8 20 8" }),
|
|
1128
|
+
/* @__PURE__ */ p("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
1129
|
+
/* @__PURE__ */ p("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
|
|
1130
|
+
/* @__PURE__ */ p("polyline", { points: "10 9 9 9 8 9" })
|
|
1131
1131
|
] })
|
|
1132
1132
|
}
|
|
1133
1133
|
),
|
|
1134
|
-
/* @__PURE__ */
|
|
1134
|
+
/* @__PURE__ */ p(
|
|
1135
1135
|
"button",
|
|
1136
1136
|
{
|
|
1137
1137
|
type: "button",
|
|
@@ -1141,34 +1141,34 @@ function ii(e) {
|
|
|
1141
1141
|
"aria-pressed": w(() => e.store.isAutoPlaying.value ? "true" : "false"),
|
|
1142
1142
|
title: w(() => e.store.isAutoPlaying.value ? t.value.pause || "Pause" : t.value.play || "Play"),
|
|
1143
1143
|
children: [
|
|
1144
|
-
/* @__PURE__ */
|
|
1145
|
-
/* @__PURE__ */
|
|
1146
|
-
/* @__PURE__ */
|
|
1144
|
+
/* @__PURE__ */ p("svg", { style: { display: w(() => e.store.isAutoPlaying.value ? "block" : "none") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
1145
|
+
/* @__PURE__ */ p("rect", { x: "6", y: "4", width: "4", height: "16" }),
|
|
1146
|
+
/* @__PURE__ */ p("rect", { x: "14", y: "4", width: "4", height: "16" })
|
|
1147
1147
|
] }),
|
|
1148
|
-
/* @__PURE__ */
|
|
1148
|
+
/* @__PURE__ */ p("svg", { style: { display: w(() => e.store.isAutoPlaying.value ? "none" : "block") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ p("polygon", { points: "5 3 19 12 5 21 5 3" }) })
|
|
1149
1149
|
]
|
|
1150
1150
|
}
|
|
1151
1151
|
)
|
|
1152
1152
|
] }),
|
|
1153
|
-
/* @__PURE__ */
|
|
1154
|
-
/* @__PURE__ */
|
|
1155
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ p("div", { class: "bk-btn-group bk-btn-group--center", children: [
|
|
1154
|
+
/* @__PURE__ */ p("button", { type: "button", class: "bk-btn", onClick: e.onPrevPage, "aria-label": w(() => t.value.previous || "Previous"), title: w(() => t.value.previous || "Previous"), children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ p("polyline", { points: "15 18 9 12 15 6" }) }) }),
|
|
1155
|
+
/* @__PURE__ */ p("span", { class: "bz-page-info", "aria-live": "polite", "aria-atomic": "true", children: w(() => {
|
|
1156
1156
|
const s = e.store.currentPage.value, o = e.store.totalPages.value;
|
|
1157
1157
|
if (e.store.isSingleMode.value || s === 0 || s >= o - 1)
|
|
1158
1158
|
return `${s + 1} / ${o}`;
|
|
1159
1159
|
const r = s % 2 === 1 ? s : s - 1;
|
|
1160
1160
|
return `${r + 1}-${r + 2} / ${o}`;
|
|
1161
1161
|
}) }),
|
|
1162
|
-
/* @__PURE__ */
|
|
1162
|
+
/* @__PURE__ */ p("button", { type: "button", class: "bk-btn", onClick: e.onNextPage, "aria-label": w(() => t.value.next || "Next"), title: w(() => t.value.next || "Next"), children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ p("polyline", { points: "9 18 15 12 9 6" }) }) })
|
|
1163
1163
|
] }),
|
|
1164
|
-
/* @__PURE__ */
|
|
1165
|
-
/* @__PURE__ */
|
|
1166
|
-
/* @__PURE__ */
|
|
1167
|
-
/* @__PURE__ */
|
|
1168
|
-
/* @__PURE__ */
|
|
1169
|
-
/* @__PURE__ */
|
|
1164
|
+
/* @__PURE__ */ p("div", { class: "bk-btn-group", children: [
|
|
1165
|
+
/* @__PURE__ */ p("button", { type: "button", class: "bk-btn", onClick: e.onZoomIn, "aria-label": w(() => t.value.zoomIn || "Zoom In"), title: w(() => t.value.zoomIn || "Zoom In"), children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
1166
|
+
/* @__PURE__ */ p("circle", { cx: "11", cy: "11", r: "8" }),
|
|
1167
|
+
/* @__PURE__ */ p("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }),
|
|
1168
|
+
/* @__PURE__ */ p("line", { x1: "11", y1: "8", x2: "11", y2: "14" }),
|
|
1169
|
+
/* @__PURE__ */ p("line", { x1: "8", y1: "11", x2: "14", y2: "11" })
|
|
1170
1170
|
] }) }),
|
|
1171
|
-
/* @__PURE__ */
|
|
1171
|
+
/* @__PURE__ */ p(
|
|
1172
1172
|
"button",
|
|
1173
1173
|
{
|
|
1174
1174
|
type: "button",
|
|
@@ -1176,20 +1176,20 @@ function ii(e) {
|
|
|
1176
1176
|
onClick: e.onZoomOut,
|
|
1177
1177
|
"aria-label": w(() => t.value.zoomOut || "Zoom Out"),
|
|
1178
1178
|
title: w(() => t.value.zoomOut || "Zoom Out"),
|
|
1179
|
-
children: /* @__PURE__ */
|
|
1180
|
-
/* @__PURE__ */
|
|
1181
|
-
/* @__PURE__ */
|
|
1182
|
-
/* @__PURE__ */
|
|
1179
|
+
children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
1180
|
+
/* @__PURE__ */ p("circle", { cx: "11", cy: "11", r: "8" }),
|
|
1181
|
+
/* @__PURE__ */ p("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }),
|
|
1182
|
+
/* @__PURE__ */ p("line", { x1: "8", y1: "11", x2: "14", y2: "11" })
|
|
1183
1183
|
] })
|
|
1184
1184
|
}
|
|
1185
1185
|
),
|
|
1186
|
-
/* @__PURE__ */
|
|
1187
|
-
w(() => e.store.allowDownload.value && e.store.hasDownloadUrl.value && e.onDownload ? /* @__PURE__ */
|
|
1188
|
-
/* @__PURE__ */
|
|
1189
|
-
/* @__PURE__ */
|
|
1190
|
-
/* @__PURE__ */
|
|
1186
|
+
/* @__PURE__ */ p("button", { type: "button", class: "bk-btn bk-btn--fullscreen", onClick: e.onToggleFullscreen, "aria-label": w(() => t.value.fullscreen || "Fullscreen"), title: w(() => t.value.fullscreen || "Fullscreen"), children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ p("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }) }) }),
|
|
1187
|
+
w(() => e.store.allowDownload.value && e.store.hasDownloadUrl.value && e.onDownload ? /* @__PURE__ */ p("button", { type: "button", class: "bk-btn bk-btn--download", onClick: e.onDownload, "aria-label": w(() => t.value.downloadCatalog || "Download"), title: w(() => t.value.downloadCatalog || "Download"), children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
1188
|
+
/* @__PURE__ */ p("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
1189
|
+
/* @__PURE__ */ p("polyline", { points: "7 10 12 15 17 10" }),
|
|
1190
|
+
/* @__PURE__ */ p("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
|
|
1191
1191
|
] }) }) : null),
|
|
1192
|
-
/* @__PURE__ */
|
|
1192
|
+
/* @__PURE__ */ p(
|
|
1193
1193
|
"button",
|
|
1194
1194
|
{
|
|
1195
1195
|
type: "button",
|
|
@@ -1199,15 +1199,15 @@ function ii(e) {
|
|
|
1199
1199
|
"aria-pressed": w(() => e.store.soundEnabled.value ? "true" : "false"),
|
|
1200
1200
|
title: "Sound",
|
|
1201
1201
|
children: [
|
|
1202
|
-
/* @__PURE__ */
|
|
1203
|
-
/* @__PURE__ */
|
|
1204
|
-
/* @__PURE__ */
|
|
1205
|
-
/* @__PURE__ */
|
|
1202
|
+
/* @__PURE__ */ p("svg", { style: { display: w(() => e.store.soundEnabled.value ? "block" : "none") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
1203
|
+
/* @__PURE__ */ p("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
1204
|
+
/* @__PURE__ */ p("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" }),
|
|
1205
|
+
/* @__PURE__ */ p("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" })
|
|
1206
1206
|
] }),
|
|
1207
|
-
/* @__PURE__ */
|
|
1208
|
-
/* @__PURE__ */
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */
|
|
1207
|
+
/* @__PURE__ */ p("svg", { style: { display: w(() => e.store.soundEnabled.value ? "none" : "block") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
|
|
1208
|
+
/* @__PURE__ */ p("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
1209
|
+
/* @__PURE__ */ p("line", { x1: "23", y1: "9", x2: "17", y2: "15" }),
|
|
1210
|
+
/* @__PURE__ */ p("line", { x1: "17", y1: "9", x2: "23", y2: "15" })
|
|
1211
1211
|
] })
|
|
1212
1212
|
]
|
|
1213
1213
|
}
|
|
@@ -1215,16 +1215,16 @@ function ii(e) {
|
|
|
1215
1215
|
] })
|
|
1216
1216
|
] });
|
|
1217
1217
|
}
|
|
1218
|
-
function
|
|
1219
|
-
return /* @__PURE__ */
|
|
1218
|
+
function ni(e) {
|
|
1219
|
+
return /* @__PURE__ */ p("div", { class: "bk-thumbs", style: w(() => e.store.showThumbs.value ? "display:flex;" : "display:none;"), children: e.store.pages.value.map((t, s) => {
|
|
1220
1220
|
const o = () => {
|
|
1221
1221
|
const r = e.store.currentPage.value;
|
|
1222
1222
|
if (e.store.isSingleMode.value || r === 0 || r >= e.store.pages.value.length - 1)
|
|
1223
1223
|
return r === s;
|
|
1224
|
-
const
|
|
1225
|
-
return s ===
|
|
1224
|
+
const h = r % 2 === 1 ? r : r - 1;
|
|
1225
|
+
return s === h || s === h + 1;
|
|
1226
1226
|
};
|
|
1227
|
-
return /* @__PURE__ */
|
|
1227
|
+
return /* @__PURE__ */ p(
|
|
1228
1228
|
"div",
|
|
1229
1229
|
{
|
|
1230
1230
|
class: w(() => `thumb-item ${o() ? "active" : ""}`),
|
|
@@ -1237,7 +1237,7 @@ function si(e) {
|
|
|
1237
1237
|
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), e.onThumbClick(s));
|
|
1238
1238
|
},
|
|
1239
1239
|
children: [
|
|
1240
|
-
/* @__PURE__ */
|
|
1240
|
+
/* @__PURE__ */ p("div", { class: "thumb-img-wrapper", children: /* @__PURE__ */ p(
|
|
1241
1241
|
"img",
|
|
1242
1242
|
{
|
|
1243
1243
|
"data-pdf-page": t.assetId.startsWith("pdf-page-") ? t.pageNumber : void 0,
|
|
@@ -1250,14 +1250,14 @@ function si(e) {
|
|
|
1250
1250
|
}
|
|
1251
1251
|
}
|
|
1252
1252
|
) }),
|
|
1253
|
-
/* @__PURE__ */
|
|
1253
|
+
/* @__PURE__ */ p("span", { children: s + 1 })
|
|
1254
1254
|
]
|
|
1255
1255
|
}
|
|
1256
1256
|
);
|
|
1257
1257
|
}) });
|
|
1258
1258
|
}
|
|
1259
|
-
function
|
|
1260
|
-
return /* @__PURE__ */
|
|
1259
|
+
function oi(e) {
|
|
1260
|
+
return /* @__PURE__ */ p(
|
|
1261
1261
|
"div",
|
|
1262
1262
|
{
|
|
1263
1263
|
role: "region",
|
|
@@ -1267,13 +1267,13 @@ function ni(e) {
|
|
|
1267
1267
|
return e.store.isDoublePageLayout.value && (t += "double-mode "), e.store.isFrontCover.value && (t += "bk-is-cover "), e.store.isBackCover.value && (t += "bk-is-back-cover "), e.store.zoomState.value.isActive && (t += "zoomed "), t.trim();
|
|
1268
1268
|
}),
|
|
1269
1269
|
ref: e.bookWrapperRef,
|
|
1270
|
-
children: /* @__PURE__ */
|
|
1270
|
+
children: /* @__PURE__ */ p(
|
|
1271
1271
|
"div",
|
|
1272
1272
|
{
|
|
1273
1273
|
class: "bk-book-sizer",
|
|
1274
1274
|
ref: e.bookSizerRef,
|
|
1275
1275
|
children: [
|
|
1276
|
-
/* @__PURE__ */
|
|
1276
|
+
/* @__PURE__ */ p(
|
|
1277
1277
|
"div",
|
|
1278
1278
|
{
|
|
1279
1279
|
ref: e.bookContainerRef,
|
|
@@ -1281,14 +1281,14 @@ function ni(e) {
|
|
|
1281
1281
|
style: w(() => `display: ${e.store.isSingleMode.value ? "none" : "block"};`),
|
|
1282
1282
|
children: e.store.pages.value.map((t, s) => {
|
|
1283
1283
|
const o = s === 0 || s === e.store.pages.value.length - 1;
|
|
1284
|
-
return /* @__PURE__ */
|
|
1284
|
+
return /* @__PURE__ */ p(
|
|
1285
1285
|
"div",
|
|
1286
1286
|
{
|
|
1287
1287
|
class: `bz-page ${s === 0 ? "bz-page--cover" : ""} ${s === e.store.pages.value.length - 1 ? "bz-page--back" : ""}`,
|
|
1288
1288
|
"data-density": o ? "hard" : "soft",
|
|
1289
1289
|
"data-idx": s,
|
|
1290
|
-
children: /* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1290
|
+
children: /* @__PURE__ */ p("div", { class: "bz-page-content", style: "position:relative; width:100%; height:100%; overflow:hidden;", children: [
|
|
1291
|
+
/* @__PURE__ */ p(
|
|
1292
1292
|
"img",
|
|
1293
1293
|
{
|
|
1294
1294
|
"data-pdf-page": t.assetId.startsWith("pdf-page-") ? t.pageNumber : void 0,
|
|
@@ -1299,21 +1299,21 @@ function ni(e) {
|
|
|
1299
1299
|
loading: "lazy"
|
|
1300
1300
|
}
|
|
1301
1301
|
),
|
|
1302
|
-
/* @__PURE__ */
|
|
1302
|
+
/* @__PURE__ */ p("div", { class: "page-shadow" })
|
|
1303
1303
|
] })
|
|
1304
1304
|
}
|
|
1305
1305
|
);
|
|
1306
1306
|
})
|
|
1307
1307
|
}
|
|
1308
1308
|
),
|
|
1309
|
-
/* @__PURE__ */
|
|
1309
|
+
/* @__PURE__ */ p(
|
|
1310
1310
|
"div",
|
|
1311
1311
|
{
|
|
1312
1312
|
class: "bk-single-view",
|
|
1313
1313
|
style: w(() => `display: ${e.store.isSingleMode.value ? "flex" : "none"}; width: 100%; height: 100%; justify-content: center; align-items: center; position: absolute; top: 0; left: 0; z-index: 10;`),
|
|
1314
1314
|
children: w(() => {
|
|
1315
1315
|
const t = e.store.pages.value[e.store.currentPage.value];
|
|
1316
|
-
return t ? /* @__PURE__ */
|
|
1316
|
+
return t ? /* @__PURE__ */ p(
|
|
1317
1317
|
"img",
|
|
1318
1318
|
{
|
|
1319
1319
|
"data-pdf-page": t.assetId.startsWith("pdf-page-") ? t.pageNumber : void 0,
|
|
@@ -1332,10 +1332,10 @@ function ni(e) {
|
|
|
1332
1332
|
}
|
|
1333
1333
|
);
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1335
|
+
function ri(e) {
|
|
1336
1336
|
const t = w(() => e.store.showArrows.value && e.store.currentPage.value > 0), s = w(() => !e.store.showArrows.value || e.store.totalPages.value <= 1 ? !1 : e.store.currentPage.value < e.store.totalPages.value - 1);
|
|
1337
|
-
return /* @__PURE__ */
|
|
1338
|
-
/* @__PURE__ */
|
|
1337
|
+
return /* @__PURE__ */ p("div", { class: "bk-nav-arrows", style: w(() => e.store.showArrows.value ? "display: flex;" : "display: none;"), children: [
|
|
1338
|
+
/* @__PURE__ */ p(
|
|
1339
1339
|
"button",
|
|
1340
1340
|
{
|
|
1341
1341
|
type: "button",
|
|
@@ -1345,10 +1345,10 @@ function oi(e) {
|
|
|
1345
1345
|
o.preventDefault(), e.onPrevPage();
|
|
1346
1346
|
},
|
|
1347
1347
|
"aria-label": "Previous Page",
|
|
1348
|
-
children: /* @__PURE__ */
|
|
1348
|
+
children: /* @__PURE__ */ p("div", { class: "bk-arrow-icon bk-arrow-left" })
|
|
1349
1349
|
}
|
|
1350
1350
|
),
|
|
1351
|
-
/* @__PURE__ */
|
|
1351
|
+
/* @__PURE__ */ p(
|
|
1352
1352
|
"button",
|
|
1353
1353
|
{
|
|
1354
1354
|
type: "button",
|
|
@@ -1358,12 +1358,12 @@ function oi(e) {
|
|
|
1358
1358
|
o.preventDefault(), e.onNextPage();
|
|
1359
1359
|
},
|
|
1360
1360
|
"aria-label": "Next Page",
|
|
1361
|
-
children: /* @__PURE__ */
|
|
1361
|
+
children: /* @__PURE__ */ p("div", { class: "bk-arrow-icon bk-arrow-right" })
|
|
1362
1362
|
}
|
|
1363
1363
|
)
|
|
1364
1364
|
] });
|
|
1365
1365
|
}
|
|
1366
|
-
function
|
|
1366
|
+
function ai(e) {
|
|
1367
1367
|
const t = () => {
|
|
1368
1368
|
e.store.showThumbs.value = !e.store.showThumbs.value;
|
|
1369
1369
|
}, s = () => {
|
|
@@ -1373,27 +1373,27 @@ function ri(e) {
|
|
|
1373
1373
|
}, r = () => {
|
|
1374
1374
|
var b;
|
|
1375
1375
|
(b = e.interactionManagerRef.current) == null || b.zoomIn();
|
|
1376
|
-
},
|
|
1376
|
+
}, h = () => {
|
|
1377
1377
|
var b;
|
|
1378
1378
|
(b = e.interactionManagerRef.current) == null || b.zoomOut();
|
|
1379
|
-
},
|
|
1379
|
+
}, u = () => e.onToggleFullscreen(), g = (b) => {
|
|
1380
1380
|
var D;
|
|
1381
1381
|
e.store.currentPage.value !== b && (e.store.currentPage.value = b, (D = e.pageFlipAdapterRef.current) == null || D.playSound());
|
|
1382
1382
|
}, x = () => {
|
|
1383
1383
|
var b;
|
|
1384
1384
|
(b = e.pageFlipAdapterRef.current) == null || b.turnToNextPage();
|
|
1385
|
-
},
|
|
1385
|
+
}, P = () => {
|
|
1386
1386
|
var b;
|
|
1387
1387
|
(b = e.pageFlipAdapterRef.current) == null || b.turnToPrevPage();
|
|
1388
1388
|
};
|
|
1389
|
-
return /* @__PURE__ */
|
|
1389
|
+
return /* @__PURE__ */ p(
|
|
1390
1390
|
"div",
|
|
1391
1391
|
{
|
|
1392
1392
|
class: w(() => `bk-wrapper bk-theme-${e.store.themeMode.value} ${e.className || ""}`),
|
|
1393
1393
|
children: [
|
|
1394
|
-
/* @__PURE__ */
|
|
1395
|
-
/* @__PURE__ */
|
|
1396
|
-
|
|
1394
|
+
/* @__PURE__ */ p("div", { class: "bk-main-area", children: [
|
|
1395
|
+
/* @__PURE__ */ p(
|
|
1396
|
+
oi,
|
|
1397
1397
|
{
|
|
1398
1398
|
store: e.store,
|
|
1399
1399
|
bookWrapperRef: e.bookWrapperRef,
|
|
@@ -1401,51 +1401,51 @@ function ri(e) {
|
|
|
1401
1401
|
bookContainerRef: e.bookContainerRef
|
|
1402
1402
|
}
|
|
1403
1403
|
),
|
|
1404
|
-
/* @__PURE__ */
|
|
1405
|
-
|
|
1404
|
+
/* @__PURE__ */ p(
|
|
1405
|
+
ri,
|
|
1406
1406
|
{
|
|
1407
1407
|
store: e.store,
|
|
1408
|
-
onPrevPage:
|
|
1408
|
+
onPrevPage: P,
|
|
1409
1409
|
onNextPage: x
|
|
1410
1410
|
}
|
|
1411
1411
|
),
|
|
1412
|
-
e.store.whiteLabel.value ? null : /* @__PURE__ */
|
|
1412
|
+
e.store.whiteLabel.value ? null : /* @__PURE__ */ p("div", { class: "bk-watermark", children: [
|
|
1413
1413
|
"Powered by ",
|
|
1414
|
-
/* @__PURE__ */
|
|
1414
|
+
/* @__PURE__ */ p("a", { href: "https://flipbookengine.com", target: "_blank", rel: "noopener", style: "text-decoration: underline;", children: "FlipbookEngine" })
|
|
1415
1415
|
] })
|
|
1416
1416
|
] }),
|
|
1417
|
-
/* @__PURE__ */
|
|
1418
|
-
|
|
1417
|
+
/* @__PURE__ */ p(
|
|
1418
|
+
si,
|
|
1419
1419
|
{
|
|
1420
1420
|
store: e.store,
|
|
1421
1421
|
onToggleThumbs: t,
|
|
1422
1422
|
onToggleSingleMode: s,
|
|
1423
1423
|
onZoomIn: r,
|
|
1424
|
-
onZoomOut:
|
|
1424
|
+
onZoomOut: h,
|
|
1425
1425
|
onDownload: e.onDownload,
|
|
1426
1426
|
onNextPage: x,
|
|
1427
|
-
onPrevPage:
|
|
1427
|
+
onPrevPage: P,
|
|
1428
1428
|
onSoundToggle: () => e.store.soundEnabled.value = !e.store.soundEnabled.value,
|
|
1429
1429
|
onToggleAutoPlay: o,
|
|
1430
|
-
onToggleFullscreen:
|
|
1430
|
+
onToggleFullscreen: u
|
|
1431
1431
|
}
|
|
1432
1432
|
),
|
|
1433
|
-
/* @__PURE__ */
|
|
1434
|
-
|
|
1433
|
+
/* @__PURE__ */ p(
|
|
1434
|
+
ni,
|
|
1435
1435
|
{
|
|
1436
1436
|
store: e.store,
|
|
1437
|
-
onThumbClick:
|
|
1437
|
+
onThumbClick: g
|
|
1438
1438
|
}
|
|
1439
1439
|
)
|
|
1440
1440
|
]
|
|
1441
1441
|
}
|
|
1442
1442
|
);
|
|
1443
1443
|
}
|
|
1444
|
-
var
|
|
1444
|
+
var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Dt = { exports: {} };
|
|
1445
1445
|
(function(e, t) {
|
|
1446
1446
|
(function(s, o) {
|
|
1447
1447
|
o(t);
|
|
1448
|
-
})(
|
|
1448
|
+
})(hi, function(s) {
|
|
1449
1449
|
class o {
|
|
1450
1450
|
constructor(i, n) {
|
|
1451
1451
|
this.state = { angle: 0, area: [], position: { x: 0, y: 0 }, hardAngle: 0, hardDrawingAngle: 0 }, this.createdDensity = n, this.nowDrawingDensity = this.createdDensity, this.render = i;
|
|
@@ -1489,19 +1489,19 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1489
1489
|
super(i, a), this.image = null, this.isLoad = !1, this.loadingAngle = 0, this.image = new Image(), this.image.src = n;
|
|
1490
1490
|
}
|
|
1491
1491
|
draw(i) {
|
|
1492
|
-
const n = this.render.getContext(), a = this.render.convertToGlobal(this.state.position),
|
|
1492
|
+
const n = this.render.getContext(), a = this.render.convertToGlobal(this.state.position), l = this.render.getRect().pageWidth, d = this.render.getRect().height;
|
|
1493
1493
|
n.save(), n.translate(a.x, a.y), n.beginPath();
|
|
1494
|
-
for (let
|
|
1495
|
-
n.rotate(this.state.angle), n.clip(), this.isLoad ? n.drawImage(this.image, 0, 0,
|
|
1494
|
+
for (let c of this.state.area) c !== null && (c = this.render.convertToGlobal(c), n.lineTo(c.x - a.x, c.y - a.y));
|
|
1495
|
+
n.rotate(this.state.angle), n.clip(), this.isLoad ? n.drawImage(this.image, 0, 0, l, d) : this.drawLoader(n, { x: 0, y: 0 }, l, d), n.restore();
|
|
1496
1496
|
}
|
|
1497
1497
|
simpleDraw(i) {
|
|
1498
|
-
const n = this.render.getRect(), a = this.render.getContext(),
|
|
1499
|
-
this.isLoad ? a.drawImage(this.image,
|
|
1498
|
+
const n = this.render.getRect(), a = this.render.getContext(), l = n.pageWidth, d = n.height, c = i === 1 ? n.left + n.pageWidth : n.left, v = n.top;
|
|
1499
|
+
this.isLoad ? a.drawImage(this.image, c, v, l, d) : this.drawLoader(a, { x: c, y: v }, l, d);
|
|
1500
1500
|
}
|
|
1501
|
-
drawLoader(i, n, a,
|
|
1502
|
-
i.beginPath(), i.strokeStyle = "rgb(200, 200, 200)", i.fillStyle = "rgb(255, 255, 255)", i.lineWidth = 1, i.rect(n.x + 1, n.y + 1, a - 1,
|
|
1503
|
-
const
|
|
1504
|
-
i.beginPath(), i.lineWidth = 10, i.arc(
|
|
1501
|
+
drawLoader(i, n, a, l) {
|
|
1502
|
+
i.beginPath(), i.strokeStyle = "rgb(200, 200, 200)", i.fillStyle = "rgb(255, 255, 255)", i.lineWidth = 1, i.rect(n.x + 1, n.y + 1, a - 1, l - 1), i.stroke(), i.fill();
|
|
1503
|
+
const d = { x: n.x + a / 2, y: n.y + l / 2 };
|
|
1504
|
+
i.beginPath(), i.lineWidth = 10, i.arc(d.x, d.y, 20, this.loadingAngle, 3 * Math.PI / 2 + this.loadingAngle), i.stroke(), i.closePath(), this.loadingAngle += 0.07, this.loadingAngle >= 2 * Math.PI && (this.loadingAngle = 0);
|
|
1505
1505
|
}
|
|
1506
1506
|
load() {
|
|
1507
1507
|
this.isLoad || (this.image.onload = () => {
|
|
@@ -1517,7 +1517,7 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1517
1517
|
hideTemporaryCopy() {
|
|
1518
1518
|
}
|
|
1519
1519
|
}
|
|
1520
|
-
class
|
|
1520
|
+
class h {
|
|
1521
1521
|
constructor(i, n) {
|
|
1522
1522
|
this.pages = [], this.currentPageIndex = 0, this.currentSpreadIndex = 0, this.landscapeSpread = [], this.portraitSpread = [], this.render = n, this.app = i, this.currentPageIndex = 0, this.isShowCover = this.app.getSettings().showCover;
|
|
1523
1523
|
}
|
|
@@ -1599,7 +1599,7 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1599
1599
|
i.length === 2 ? (this.render.setLeftPage(this.pages[i[0]]), this.render.setRightPage(this.pages[i[1]])) : this.render.getOrientation() === "landscape" && i[0] === this.pages.length - 1 ? (this.render.setLeftPage(this.pages[i[0]]), this.render.setRightPage(null)) : (this.render.setLeftPage(null), this.render.setRightPage(this.pages[i[0]])), this.currentPageIndex = i[0], this.app.updatePageIndex(this.currentPageIndex);
|
|
1600
1600
|
}
|
|
1601
1601
|
}
|
|
1602
|
-
class
|
|
1602
|
+
class u extends h {
|
|
1603
1603
|
constructor(i, n, a) {
|
|
1604
1604
|
super(i, n), this.imagesHref = a;
|
|
1605
1605
|
}
|
|
@@ -1611,16 +1611,16 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1611
1611
|
this.createSpread();
|
|
1612
1612
|
}
|
|
1613
1613
|
}
|
|
1614
|
-
class
|
|
1614
|
+
class g {
|
|
1615
1615
|
static GetDistanceBetweenTwoPoint(i, n) {
|
|
1616
1616
|
return i === null || n === null ? 1 / 0 : Math.sqrt(Math.pow(n.x - i.x, 2) + Math.pow(n.y - i.y, 2));
|
|
1617
1617
|
}
|
|
1618
1618
|
static GetSegmentLength(i) {
|
|
1619
|
-
return
|
|
1619
|
+
return g.GetDistanceBetweenTwoPoint(i[0], i[1]);
|
|
1620
1620
|
}
|
|
1621
1621
|
static GetAngleBetweenTwoLine(i, n) {
|
|
1622
|
-
const a = i[0].y - i[1].y,
|
|
1623
|
-
return Math.acos((a *
|
|
1622
|
+
const a = i[0].y - i[1].y, l = n[0].y - n[1].y, d = i[1].x - i[0].x, c = n[1].x - n[0].x;
|
|
1623
|
+
return Math.acos((a * l + d * c) / (Math.sqrt(a * a + d * d) * Math.sqrt(l * l + c * c)));
|
|
1624
1624
|
}
|
|
1625
1625
|
static PointInRect(i, n) {
|
|
1626
1626
|
return n === null ? null : n.x >= i.left && n.x <= i.width + i.left && n.y >= i.top && n.y <= i.top + i.height ? n : null;
|
|
@@ -1629,29 +1629,29 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1629
1629
|
return { x: i.x * Math.cos(a) + i.y * Math.sin(a) + n.x, y: i.y * Math.cos(a) - i.x * Math.sin(a) + n.y };
|
|
1630
1630
|
}
|
|
1631
1631
|
static LimitPointToCircle(i, n, a) {
|
|
1632
|
-
if (
|
|
1633
|
-
const
|
|
1634
|
-
let y = Math.sqrt(Math.pow(n, 2) * Math.pow(
|
|
1632
|
+
if (g.GetDistanceBetweenTwoPoint(i, a) <= n) return a;
|
|
1633
|
+
const l = i.x, d = i.y, c = a.x, v = a.y;
|
|
1634
|
+
let y = Math.sqrt(Math.pow(n, 2) * Math.pow(l - c, 2) / (Math.pow(l - c, 2) + Math.pow(d - v, 2))) + l;
|
|
1635
1635
|
a.x < 0 && (y *= -1);
|
|
1636
|
-
let
|
|
1637
|
-
return
|
|
1636
|
+
let A = (y - l) * (d - v) / (l - c) + d;
|
|
1637
|
+
return l - c + d === 0 && (A = n), { x: y, y: A };
|
|
1638
1638
|
}
|
|
1639
1639
|
static GetIntersectBetweenTwoSegment(i, n, a) {
|
|
1640
|
-
return
|
|
1640
|
+
return g.PointInRect(i, g.GetIntersectBeetwenTwoLine(n, a));
|
|
1641
1641
|
}
|
|
1642
1642
|
static GetIntersectBeetwenTwoLine(i, n) {
|
|
1643
|
-
const a = i[0].y - i[1].y,
|
|
1643
|
+
const a = i[0].y - i[1].y, l = n[0].y - n[1].y, d = i[1].x - i[0].x, c = n[1].x - n[0].x, v = i[0].x * i[1].y - i[1].x * i[0].y, y = n[0].x * n[1].y - n[1].x * n[0].y, A = a * y - l * v, R = d * y - c * v, W = -(v * c - y * d) / (a * c - l * d), K = -(a * y - l * v) / (a * c - l * d);
|
|
1644
1644
|
if (isFinite(W) && isFinite(K)) return { x: W, y: K };
|
|
1645
|
-
if (Math.abs(
|
|
1645
|
+
if (Math.abs(A - R) < 0.1) throw new Error("Segment included");
|
|
1646
1646
|
return null;
|
|
1647
1647
|
}
|
|
1648
1648
|
static GetCordsFromTwoPoint(i, n) {
|
|
1649
|
-
const a = Math.abs(i.x - n.x),
|
|
1650
|
-
function v(y,
|
|
1651
|
-
return
|
|
1649
|
+
const a = Math.abs(i.x - n.x), l = Math.abs(i.y - n.y), d = Math.max(a, l), c = [i];
|
|
1650
|
+
function v(y, A, R, W, K) {
|
|
1651
|
+
return A > y ? y + K * (R / W) : A < y ? y - K * (R / W) : y;
|
|
1652
1652
|
}
|
|
1653
|
-
for (let y = 1; y <=
|
|
1654
|
-
return
|
|
1653
|
+
for (let y = 1; y <= d; y += 1) c.push({ x: v(i.x, n.x, a, d, y), y: v(i.y, n.y, l, d, y) });
|
|
1654
|
+
return c;
|
|
1655
1655
|
}
|
|
1656
1656
|
}
|
|
1657
1657
|
class x extends o {
|
|
@@ -1668,20 +1668,20 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1668
1668
|
this.temporaryCopy !== null && (this.copiedElement.remove(), this.copiedElement = null, this.temporaryCopy = null);
|
|
1669
1669
|
}
|
|
1670
1670
|
draw(i) {
|
|
1671
|
-
const n = i || this.nowDrawingDensity, a = this.render.convertToGlobal(this.state.position),
|
|
1671
|
+
const n = i || this.nowDrawingDensity, a = this.render.convertToGlobal(this.state.position), l = this.render.getRect().pageWidth, d = this.render.getRect().height;
|
|
1672
1672
|
this.element.classList.remove("--simple");
|
|
1673
|
-
const
|
|
1673
|
+
const c = `
|
|
1674
1674
|
display: block;
|
|
1675
1675
|
z-index: ${this.element.style.zIndex};
|
|
1676
1676
|
left: 0;
|
|
1677
1677
|
top: 0;
|
|
1678
|
-
width: ${
|
|
1679
|
-
height: ${
|
|
1678
|
+
width: ${l}px;
|
|
1679
|
+
height: ${d}px;
|
|
1680
1680
|
`;
|
|
1681
|
-
n === "hard" ? this.drawHard(
|
|
1681
|
+
n === "hard" ? this.drawHard(c) : this.drawSoft(a, c);
|
|
1682
1682
|
}
|
|
1683
1683
|
drawHard(i = "") {
|
|
1684
|
-
const n = this.render.getRect().left + this.render.getRect().width / 2, a = this.state.hardDrawingAngle,
|
|
1684
|
+
const n = this.render.getRect().left + this.render.getRect().width / 2, a = this.state.hardDrawingAngle, l = i + `
|
|
1685
1685
|
backface-visibility: hidden;
|
|
1686
1686
|
-webkit-backface-visibility: hidden;
|
|
1687
1687
|
clip-path: none;
|
|
@@ -1689,26 +1689,26 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1689
1689
|
` + (this.orientation === 0 ? `transform-origin: ${this.render.getRect().pageWidth}px 0;
|
|
1690
1690
|
transform: translate3d(0, 0, 0) rotateY(${a}deg);` : `transform-origin: 0 0;
|
|
1691
1691
|
transform: translate3d(${n}px, 0, 0) rotateY(${a}deg);`);
|
|
1692
|
-
this.element.style.cssText =
|
|
1692
|
+
this.element.style.cssText = l;
|
|
1693
1693
|
}
|
|
1694
1694
|
drawSoft(i, n = "") {
|
|
1695
1695
|
let a = "polygon( ";
|
|
1696
|
-
for (const
|
|
1697
|
-
let
|
|
1698
|
-
|
|
1696
|
+
for (const d of this.state.area) if (d !== null) {
|
|
1697
|
+
let c = this.render.getDirection() === 1 ? { x: -d.x + this.state.position.x, y: d.y - this.state.position.y } : { x: d.x - this.state.position.x, y: d.y - this.state.position.y };
|
|
1698
|
+
c = g.GetRotatedPoint(c, { x: 0, y: 0 }, this.state.angle), a += c.x + "px " + c.y + "px, ";
|
|
1699
1699
|
}
|
|
1700
1700
|
a = a.slice(0, -2), a += ")";
|
|
1701
|
-
const
|
|
1702
|
-
this.element.style.cssText =
|
|
1701
|
+
const l = n + `transform-origin: 0 0; clip-path: ${a}; -webkit-clip-path: ${a};` + (this.render.isSafari() && this.state.angle === 0 ? `transform: translate(${i.x}px, ${i.y}px);` : `transform: translate3d(${i.x}px, ${i.y}px, 0) rotate(${this.state.angle}rad);`);
|
|
1702
|
+
this.element.style.cssText = l;
|
|
1703
1703
|
}
|
|
1704
1704
|
simpleDraw(i) {
|
|
1705
|
-
const n = this.render.getRect(), a = n.pageWidth,
|
|
1705
|
+
const n = this.render.getRect(), a = n.pageWidth, l = n.height, d = i === 1 ? n.left + n.pageWidth : n.left, c = n.top;
|
|
1706
1706
|
this.element.classList.add("--simple"), this.element.style.cssText = `
|
|
1707
1707
|
position: absolute;
|
|
1708
1708
|
display: block;
|
|
1709
|
-
height: ${
|
|
1710
|
-
left: ${
|
|
1711
|
-
top: ${
|
|
1709
|
+
height: ${l}px;
|
|
1710
|
+
left: ${d}px;
|
|
1711
|
+
top: ${c}px;
|
|
1712
1712
|
width: ${a}px;
|
|
1713
1713
|
z-index: ${this.render.getSettings().startZIndex + 1};`;
|
|
1714
1714
|
}
|
|
@@ -1725,9 +1725,9 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1725
1725
|
this.element.classList.remove("--soft", "--hard"), this.element.classList.add("--" + i), super.setDrawingDensity(i);
|
|
1726
1726
|
}
|
|
1727
1727
|
}
|
|
1728
|
-
class
|
|
1729
|
-
constructor(i, n, a,
|
|
1730
|
-
super(i, n), this.element = a, this.pagesElement =
|
|
1728
|
+
class P extends h {
|
|
1729
|
+
constructor(i, n, a, l) {
|
|
1730
|
+
super(i, n), this.element = a, this.pagesElement = l;
|
|
1731
1731
|
}
|
|
1732
1732
|
load() {
|
|
1733
1733
|
for (const i of this.pagesElement) {
|
|
@@ -1738,8 +1738,8 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1738
1738
|
}
|
|
1739
1739
|
}
|
|
1740
1740
|
class b {
|
|
1741
|
-
constructor(i, n, a,
|
|
1742
|
-
this.direction = i, this.corner = n, this.topIntersectPoint = null, this.sideIntersectPoint = null, this.bottomIntersectPoint = null, this.pageWidth = parseInt(a, 10), this.pageHeight = parseInt(
|
|
1741
|
+
constructor(i, n, a, l) {
|
|
1742
|
+
this.direction = i, this.corner = n, this.topIntersectPoint = null, this.sideIntersectPoint = null, this.bottomIntersectPoint = null, this.pageWidth = parseInt(a, 10), this.pageHeight = parseInt(l, 10);
|
|
1743
1743
|
}
|
|
1744
1744
|
calc(i) {
|
|
1745
1745
|
try {
|
|
@@ -1755,7 +1755,7 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1755
1755
|
}
|
|
1756
1756
|
getBottomClipArea() {
|
|
1757
1757
|
const i = [];
|
|
1758
|
-
return i.push(this.topIntersectPoint), this.corner === "top" ? i.push({ x: this.pageWidth, y: 0 }) : (this.topIntersectPoint !== null && i.push({ x: this.pageWidth, y: 0 }), i.push({ x: this.pageWidth, y: this.pageHeight })), this.sideIntersectPoint !== null ?
|
|
1758
|
+
return i.push(this.topIntersectPoint), this.corner === "top" ? i.push({ x: this.pageWidth, y: 0 }) : (this.topIntersectPoint !== null && i.push({ x: this.pageWidth, y: 0 }), i.push({ x: this.pageWidth, y: this.pageHeight })), this.sideIntersectPoint !== null ? g.GetDistanceBetweenTwoPoint(this.sideIntersectPoint, this.topIntersectPoint) >= 10 && i.push(this.sideIntersectPoint) : this.corner === "top" && i.push({ x: this.pageWidth, y: this.pageHeight }), i.push(this.bottomIntersectPoint), i.push(this.topIntersectPoint), i;
|
|
1759
1759
|
}
|
|
1760
1760
|
getAngle() {
|
|
1761
1761
|
return this.direction === 0 ? -this.angle : this.angle;
|
|
@@ -1785,7 +1785,7 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1785
1785
|
return this.corner === "top" ? this.topIntersectPoint : this.sideIntersectPoint !== null ? this.sideIntersectPoint : this.topIntersectPoint;
|
|
1786
1786
|
}
|
|
1787
1787
|
getShadowAngle() {
|
|
1788
|
-
const i =
|
|
1788
|
+
const i = g.GetAngleBetweenTwoLine(this.getSegmentToShadowLine(), [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]);
|
|
1789
1789
|
return this.direction === 0 ? i : Math.PI - i;
|
|
1790
1790
|
}
|
|
1791
1791
|
calcAngleAndPosition(i) {
|
|
@@ -1798,11 +1798,11 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1798
1798
|
}
|
|
1799
1799
|
calculateAngle(i) {
|
|
1800
1800
|
const n = this.pageWidth - i.x + 1, a = this.corner === "bottom" ? this.pageHeight - i.y : i.y;
|
|
1801
|
-
let
|
|
1802
|
-
a < 0 && (
|
|
1803
|
-
const
|
|
1804
|
-
if (!isFinite(
|
|
1805
|
-
return this.corner === "bottom" && (
|
|
1801
|
+
let l = 2 * Math.acos(n / Math.sqrt(a * a + n * n));
|
|
1802
|
+
a < 0 && (l = -l);
|
|
1803
|
+
const d = Math.PI - l;
|
|
1804
|
+
if (!isFinite(l) || d >= 0 && d < 3e-3) throw new Error("The G point is too small");
|
|
1805
|
+
return this.corner === "bottom" && (l = -l), l;
|
|
1806
1806
|
}
|
|
1807
1807
|
getPageRect(i) {
|
|
1808
1808
|
return this.corner === "top" ? this.getRectFromBasePoint([{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }, { x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }], i) : this.getRectFromBasePoint([{ x: 0, y: -this.pageHeight }, { x: this.pageWidth, y: -this.pageHeight }, { x: 0, y: 0 }, { x: this.pageWidth, y: 0 }], i);
|
|
@@ -1815,19 +1815,19 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1815
1815
|
}
|
|
1816
1816
|
calculateIntersectPoint(i) {
|
|
1817
1817
|
const n = { left: -1, top: -1, width: this.pageWidth + 2, height: this.pageHeight + 2 };
|
|
1818
|
-
this.corner === "top" ? (this.topIntersectPoint =
|
|
1818
|
+
this.corner === "top" ? (this.topIntersectPoint = g.GetIntersectBetweenTwoSegment(n, [i, this.rect.topRight], [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]), this.sideIntersectPoint = g.GetIntersectBetweenTwoSegment(n, [i, this.rect.bottomLeft], [{ x: this.pageWidth, y: 0 }, { x: this.pageWidth, y: this.pageHeight }]), this.bottomIntersectPoint = g.GetIntersectBetweenTwoSegment(n, [this.rect.bottomLeft, this.rect.bottomRight], [{ x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }])) : (this.topIntersectPoint = g.GetIntersectBetweenTwoSegment(n, [this.rect.topLeft, this.rect.topRight], [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]), this.sideIntersectPoint = g.GetIntersectBetweenTwoSegment(n, [i, this.rect.topLeft], [{ x: this.pageWidth, y: 0 }, { x: this.pageWidth, y: this.pageHeight }]), this.bottomIntersectPoint = g.GetIntersectBetweenTwoSegment(n, [this.rect.bottomLeft, this.rect.bottomRight], [{ x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }]));
|
|
1819
1819
|
}
|
|
1820
1820
|
checkPositionAtCenterLine(i, n, a) {
|
|
1821
|
-
let
|
|
1822
|
-
const
|
|
1823
|
-
|
|
1824
|
-
const
|
|
1821
|
+
let l = i;
|
|
1822
|
+
const d = g.LimitPointToCircle(n, this.pageWidth, l);
|
|
1823
|
+
l !== d && (l = d, this.updateAngleAndGeometry(l));
|
|
1824
|
+
const c = Math.sqrt(Math.pow(this.pageWidth, 2) + Math.pow(this.pageHeight, 2));
|
|
1825
1825
|
let v = this.rect.bottomRight, y = this.rect.topLeft;
|
|
1826
1826
|
if (this.corner === "bottom" && (v = this.rect.topRight, y = this.rect.bottomLeft), v.x <= 0) {
|
|
1827
|
-
const
|
|
1828
|
-
|
|
1827
|
+
const A = g.LimitPointToCircle(a, c, y);
|
|
1828
|
+
A !== l && (l = A, this.updateAngleAndGeometry(l));
|
|
1829
1829
|
}
|
|
1830
|
-
return
|
|
1830
|
+
return l;
|
|
1831
1831
|
}
|
|
1832
1832
|
getSegmentToShadowLine() {
|
|
1833
1833
|
const i = this.getShadowStartPoint();
|
|
@@ -1845,22 +1845,22 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1845
1845
|
if (this.app.getSettings().disableFlipByClick && !this.isPointOnCorners(i) || (this.calc !== null && this.render.finishAnimation(), !this.start(i))) return;
|
|
1846
1846
|
const n = this.getBoundsRect();
|
|
1847
1847
|
this.setState("flipping");
|
|
1848
|
-
const a = n.height / 10,
|
|
1849
|
-
this.calc.calc({ x: n.pageWidth - a, y:
|
|
1848
|
+
const a = n.height / 10, l = this.calc.getCorner() === "bottom" ? n.height - a : a, d = this.calc.getCorner() === "bottom" ? n.height : 0;
|
|
1849
|
+
this.calc.calc({ x: n.pageWidth - a, y: l }), this.animateFlippingTo({ x: n.pageWidth - a, y: l }, { x: -n.pageWidth, y: d }, !0);
|
|
1850
1850
|
}
|
|
1851
1851
|
start(i) {
|
|
1852
1852
|
this.reset();
|
|
1853
|
-
const n = this.render.convertToBook(i), a = this.getBoundsRect(),
|
|
1854
|
-
if (!this.checkDirection(
|
|
1853
|
+
const n = this.render.convertToBook(i), a = this.getBoundsRect(), l = this.getDirectionByPoint(n), d = n.y >= a.height / 2 ? "bottom" : "top";
|
|
1854
|
+
if (!this.checkDirection(l)) return !1;
|
|
1855
1855
|
try {
|
|
1856
|
-
if (this.flippingPage = this.app.getPageCollection().getFlippingPage(
|
|
1857
|
-
const
|
|
1858
|
-
|
|
1856
|
+
if (this.flippingPage = this.app.getPageCollection().getFlippingPage(l), this.bottomPage = this.app.getPageCollection().getBottomPage(l), this.render.getOrientation() === "landscape") if (l === 1) {
|
|
1857
|
+
const c = this.app.getPageCollection().nextBy(this.flippingPage);
|
|
1858
|
+
c !== null && this.flippingPage.getDensity() !== c.getDensity() && (this.flippingPage.setDrawingDensity("hard"), c.setDrawingDensity("hard"));
|
|
1859
1859
|
} else {
|
|
1860
|
-
const
|
|
1861
|
-
|
|
1860
|
+
const c = this.app.getPageCollection().prevBy(this.flippingPage);
|
|
1861
|
+
c !== null && this.flippingPage.getDensity() !== c.getDensity() && (this.flippingPage.setDrawingDensity("hard"), c.setDrawingDensity("hard"));
|
|
1862
1862
|
}
|
|
1863
|
-
return this.render.setDirection(
|
|
1863
|
+
return this.render.setDirection(l), this.calc = new b(l, d, a.pageWidth.toString(10), a.height.toString(10)), !0;
|
|
1864
1864
|
} catch {
|
|
1865
1865
|
return !1;
|
|
1866
1866
|
}
|
|
@@ -1872,9 +1872,9 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1872
1872
|
}
|
|
1873
1873
|
}
|
|
1874
1874
|
flipToPage(i, n) {
|
|
1875
|
-
const a = this.app.getPageCollection().getCurrentSpreadIndex(),
|
|
1875
|
+
const a = this.app.getPageCollection().getCurrentSpreadIndex(), l = this.app.getPageCollection().getSpreadIndexByPage(i);
|
|
1876
1876
|
try {
|
|
1877
|
-
|
|
1877
|
+
l > a && (this.app.getPageCollection().setCurrentSpreadIndex(l - 1), this.flipNext(n)), l < a && (this.app.getPageCollection().setCurrentSpreadIndex(l + 1), this.flipPrev(n));
|
|
1878
1878
|
} catch {
|
|
1879
1879
|
}
|
|
1880
1880
|
}
|
|
@@ -1895,17 +1895,17 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1895
1895
|
if (this.isPointOnCorners(i)) if (this.calc === null) {
|
|
1896
1896
|
if (!this.start(i)) return;
|
|
1897
1897
|
this.setState("fold_corner"), this.calc.calc({ x: a - 1, y: 1 });
|
|
1898
|
-
const
|
|
1899
|
-
this.animateFlippingTo({ x: a - 1, y:
|
|
1898
|
+
const l = 50, d = this.calc.getCorner() === "bottom" ? n.height - 1 : 1, c = this.calc.getCorner() === "bottom" ? n.height - l : l;
|
|
1899
|
+
this.animateFlippingTo({ x: a - 1, y: d }, { x: a - l, y: c }, !1, !1);
|
|
1900
1900
|
} else this.do(this.render.convertToPage(i));
|
|
1901
1901
|
else this.setState("read"), this.render.finishAnimation(), this.stopMove();
|
|
1902
1902
|
}
|
|
1903
|
-
animateFlippingTo(i, n, a,
|
|
1904
|
-
const
|
|
1905
|
-
for (const y of
|
|
1906
|
-
const v = this.getAnimationDuration(
|
|
1907
|
-
this.render.startAnimation(
|
|
1908
|
-
this.calc && (a && (this.calc.getDirection() === 1 ? this.app.turnToPrevPage() : this.app.turnToNextPage()),
|
|
1903
|
+
animateFlippingTo(i, n, a, l = !0) {
|
|
1904
|
+
const d = g.GetCordsFromTwoPoint(i, n), c = [];
|
|
1905
|
+
for (const y of d) c.push(() => this.do(y));
|
|
1906
|
+
const v = this.getAnimationDuration(d.length);
|
|
1907
|
+
this.render.startAnimation(c, v, () => {
|
|
1908
|
+
this.calc && (a && (this.calc.getDirection() === 1 ? this.app.turnToPrevPage() : this.app.turnToNextPage()), l && (this.render.setBottomPage(null), this.render.setFlippingPage(null), this.render.clearShadow(), this.setState("read"), this.reset()));
|
|
1909
1909
|
});
|
|
1910
1910
|
}
|
|
1911
1911
|
getCalculation() {
|
|
@@ -1942,8 +1942,8 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1942
1942
|
return !1;
|
|
1943
1943
|
}
|
|
1944
1944
|
isPointOnCorners(i) {
|
|
1945
|
-
const n = this.getBoundsRect(), a = n.pageWidth,
|
|
1946
|
-
return
|
|
1945
|
+
const n = this.getBoundsRect(), a = n.pageWidth, l = Math.sqrt(Math.pow(a, 2) + Math.pow(n.height, 2)) / 5, d = this.render.convertToBook(i);
|
|
1946
|
+
return d.x > 0 && d.y > 0 && d.x < n.width && d.y < n.height && (d.x < l || d.x > n.width - l) && (d.y < l || d.y > n.height - l);
|
|
1947
1947
|
}
|
|
1948
1948
|
}
|
|
1949
1949
|
class $ {
|
|
@@ -1979,14 +1979,14 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
1979
1979
|
}
|
|
1980
1980
|
calculateBoundsRect() {
|
|
1981
1981
|
let i = "landscape";
|
|
1982
|
-
const n = this.getBlockWidth(), a = n / 2,
|
|
1983
|
-
let
|
|
1984
|
-
return this.setting.size === "stretch" ? (n < 2 * this.setting.minWidth && this.app.getSettings().usePortrait && (i = "portrait"),
|
|
1982
|
+
const n = this.getBlockWidth(), a = n / 2, l = this.getBlockHeight() / 2, d = this.setting.width / this.setting.height;
|
|
1983
|
+
let c = this.setting.width, v = this.setting.height, y = a - c;
|
|
1984
|
+
return this.setting.size === "stretch" ? (n < 2 * this.setting.minWidth && this.app.getSettings().usePortrait && (i = "portrait"), c = i === "portrait" ? this.getBlockWidth() : this.getBlockWidth() / 2, c > this.setting.maxWidth && (c = this.setting.maxWidth), v = c / d, v > this.getBlockHeight() && (v = this.getBlockHeight(), c = v * d), y = i === "portrait" ? a - c / 2 - c : a - c) : n < 2 * c && this.app.getSettings().usePortrait && (i = "portrait", y = a - c / 2 - c), this.boundsRect = { left: y, top: l - v / 2, width: 2 * c, height: v, pageWidth: c }, i;
|
|
1985
1985
|
}
|
|
1986
|
-
setShadowData(i, n, a,
|
|
1986
|
+
setShadowData(i, n, a, l) {
|
|
1987
1987
|
if (!this.app.getSettings().drawShadow) return;
|
|
1988
|
-
const
|
|
1989
|
-
this.shadow = { pos: i, angle: n, width: 3 * this.getRect().pageWidth / 4 * a / 100, opacity: (100 - a) *
|
|
1988
|
+
const d = 100 * this.getSettings().maxShadowOpacity;
|
|
1989
|
+
this.shadow = { pos: i, angle: n, width: 3 * this.getRect().pageWidth / 4 * a / 100, opacity: (100 - a) * d / 100 / 100, direction: l, progress: 2 * a };
|
|
1990
1990
|
}
|
|
1991
1991
|
clearShadow() {
|
|
1992
1992
|
this.shadow = null;
|
|
@@ -2048,7 +2048,7 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
2048
2048
|
return n || (n = this.direction), { topLeft: this.convertToGlobal(i.topLeft, n), topRight: this.convertToGlobal(i.topRight, n), bottomLeft: this.convertToGlobal(i.bottomLeft, n), bottomRight: this.convertToGlobal(i.bottomRight, n) };
|
|
2049
2049
|
}
|
|
2050
2050
|
}
|
|
2051
|
-
class
|
|
2051
|
+
class C extends $ {
|
|
2052
2052
|
constructor(i, n, a) {
|
|
2053
2053
|
super(i, n), this.canvas = a, this.ctx = a.getContext("2d");
|
|
2054
2054
|
}
|
|
@@ -2069,8 +2069,8 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
2069
2069
|
this.ctx.rect(i.left, i.top, i.width, i.height);
|
|
2070
2070
|
const a = { x: i.left + i.width / 2 - n / 2, y: 0 };
|
|
2071
2071
|
this.ctx.translate(a.x, a.y);
|
|
2072
|
-
const
|
|
2073
|
-
|
|
2072
|
+
const l = this.ctx.createLinearGradient(0, 0, n, 0);
|
|
2073
|
+
l.addColorStop(0, "rgba(0, 0, 0, 0)"), l.addColorStop(0.4, "rgba(0, 0, 0, 0.2)"), l.addColorStop(0.49, "rgba(0, 0, 0, 0.1)"), l.addColorStop(0.5, "rgba(0, 0, 0, 0.5)"), l.addColorStop(0.51, "rgba(0, 0, 0, 0.4)"), l.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.clip(), this.ctx.fillStyle = l, this.ctx.fillRect(0, 0, n, 2 * i.height), this.ctx.restore();
|
|
2074
2074
|
}
|
|
2075
2075
|
drawOuterShadow() {
|
|
2076
2076
|
const i = this.getRect();
|
|
@@ -2085,53 +2085,53 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
2085
2085
|
this.ctx.save(), this.ctx.beginPath();
|
|
2086
2086
|
const n = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y }), a = this.convertRectToGlobal(this.pageRect);
|
|
2087
2087
|
this.ctx.moveTo(a.topLeft.x, a.topLeft.y), this.ctx.lineTo(a.topRight.x, a.topRight.y), this.ctx.lineTo(a.bottomRight.x, a.bottomRight.y), this.ctx.lineTo(a.bottomLeft.x, a.bottomLeft.y), this.ctx.translate(n.x, n.y), this.ctx.rotate(Math.PI + this.shadow.angle + Math.PI / 2);
|
|
2088
|
-
const
|
|
2089
|
-
this.shadow.direction === 0 ? (this.ctx.translate(-
|
|
2088
|
+
const l = 3 * this.shadow.width / 4, d = this.ctx.createLinearGradient(0, 0, l, 0);
|
|
2089
|
+
this.shadow.direction === 0 ? (this.ctx.translate(-l, -100), d.addColorStop(1, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), d.addColorStop(0.9, "rgba(0, 0, 0, 0.05)"), d.addColorStop(0.7, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), d.addColorStop(0, "rgba(0, 0, 0, 0)")) : (this.ctx.translate(0, -100), d.addColorStop(0, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), d.addColorStop(0.1, "rgba(0, 0, 0, 0.05)"), d.addColorStop(0.3, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), d.addColorStop(1, "rgba(0, 0, 0, 0)")), this.ctx.clip(), this.ctx.fillStyle = d, this.ctx.fillRect(0, 0, l, 2 * i.height), this.ctx.restore();
|
|
2090
2090
|
}
|
|
2091
2091
|
clear() {
|
|
2092
2092
|
this.ctx.fillStyle = "white", this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
|
|
2093
2093
|
}
|
|
2094
2094
|
}
|
|
2095
|
-
class
|
|
2095
|
+
class T {
|
|
2096
2096
|
constructor(i, n, a) {
|
|
2097
2097
|
this.touchPoint = null, this.swipeTimeout = 250, this.onResize = () => {
|
|
2098
2098
|
this.update();
|
|
2099
|
-
}, this.onMouseDown = (
|
|
2100
|
-
if (this.checkTarget(
|
|
2101
|
-
const
|
|
2102
|
-
this.app.startUserTouch(
|
|
2099
|
+
}, this.onMouseDown = (d) => {
|
|
2100
|
+
if (this.checkTarget(d.target)) {
|
|
2101
|
+
const c = this.getMousePos(d.clientX, d.clientY);
|
|
2102
|
+
this.app.startUserTouch(c), d.preventDefault();
|
|
2103
2103
|
}
|
|
2104
|
-
}, this.onTouchStart = (
|
|
2105
|
-
if (this.checkTarget(
|
|
2106
|
-
const
|
|
2104
|
+
}, this.onTouchStart = (d) => {
|
|
2105
|
+
if (this.checkTarget(d.target) && d.changedTouches.length > 0) {
|
|
2106
|
+
const c = d.changedTouches[0], v = this.getMousePos(c.clientX, c.clientY);
|
|
2107
2107
|
this.touchPoint = { point: v, time: Date.now() }, setTimeout(() => {
|
|
2108
2108
|
this.touchPoint !== null && this.app.startUserTouch(v);
|
|
2109
|
-
}, this.swipeTimeout), this.app.getSettings().mobileScrollSupport ||
|
|
2109
|
+
}, this.swipeTimeout), this.app.getSettings().mobileScrollSupport || d.preventDefault();
|
|
2110
2110
|
}
|
|
2111
|
-
}, this.onMouseUp = (
|
|
2112
|
-
const
|
|
2113
|
-
this.app.userStop(
|
|
2114
|
-
}, this.onMouseMove = (
|
|
2115
|
-
const
|
|
2116
|
-
this.app.userMove(
|
|
2117
|
-
}, this.onTouchMove = (
|
|
2118
|
-
if (
|
|
2119
|
-
const
|
|
2120
|
-
this.app.getSettings().mobileScrollSupport ? (this.touchPoint !== null && (Math.abs(this.touchPoint.point.x - v.x) > 10 || this.app.getState() !== "read") &&
|
|
2111
|
+
}, this.onMouseUp = (d) => {
|
|
2112
|
+
const c = this.getMousePos(d.clientX, d.clientY);
|
|
2113
|
+
this.app.userStop(c);
|
|
2114
|
+
}, this.onMouseMove = (d) => {
|
|
2115
|
+
const c = this.getMousePos(d.clientX, d.clientY);
|
|
2116
|
+
this.app.userMove(c, !1);
|
|
2117
|
+
}, this.onTouchMove = (d) => {
|
|
2118
|
+
if (d.changedTouches.length > 0) {
|
|
2119
|
+
const c = d.changedTouches[0], v = this.getMousePos(c.clientX, c.clientY);
|
|
2120
|
+
this.app.getSettings().mobileScrollSupport ? (this.touchPoint !== null && (Math.abs(this.touchPoint.point.x - v.x) > 10 || this.app.getState() !== "read") && d.cancelable && this.app.userMove(v, !0), this.app.getState() !== "read" && d.preventDefault()) : this.app.userMove(v, !0);
|
|
2121
2121
|
}
|
|
2122
|
-
}, this.onTouchEnd = (
|
|
2123
|
-
if (
|
|
2124
|
-
const
|
|
2122
|
+
}, this.onTouchEnd = (d) => {
|
|
2123
|
+
if (d.changedTouches.length > 0) {
|
|
2124
|
+
const c = d.changedTouches[0], v = this.getMousePos(c.clientX, c.clientY);
|
|
2125
2125
|
let y = !1;
|
|
2126
2126
|
if (this.touchPoint !== null) {
|
|
2127
|
-
const
|
|
2128
|
-
Math.abs(
|
|
2127
|
+
const A = v.x - this.touchPoint.point.x, R = Math.abs(v.y - this.touchPoint.point.y);
|
|
2128
|
+
Math.abs(A) > this.swipeDistance && R < 2 * this.swipeDistance && Date.now() - this.touchPoint.time < this.swipeTimeout && (A > 0 ? this.app.flipPrev(this.touchPoint.point.y < this.app.getRender().getRect().height / 2 ? "top" : "bottom") : this.app.flipNext(this.touchPoint.point.y < this.app.getRender().getRect().height / 2 ? "top" : "bottom"), y = !0), this.touchPoint = null;
|
|
2129
2129
|
}
|
|
2130
2130
|
this.app.userStop(v, y);
|
|
2131
2131
|
}
|
|
2132
2132
|
}, this.parentElement = i, i.classList.add("stf__parent"), i.insertAdjacentHTML("afterbegin", '<div class="stf__wrapper"></div>'), this.wrapper = i.querySelector(".stf__wrapper"), this.app = n;
|
|
2133
|
-
const
|
|
2134
|
-
i.style.minWidth = a.minWidth *
|
|
2133
|
+
const l = this.app.getSettings().usePortrait ? 1 : 2;
|
|
2134
|
+
i.style.minWidth = a.minWidth * l + "px", i.style.minHeight = a.minHeight + "px", a.size === "fixed" && (i.style.minWidth = a.width * l + "px", i.style.minHeight = a.height + "px"), a.autoSize && (i.style.width = "100%", i.style.maxWidth = 2 * a.maxWidth + "px"), i.style.display = "block", window.addEventListener("resize", this.onResize, !1), this.swipeDistance = a.swipeDistance;
|
|
2135
2135
|
}
|
|
2136
2136
|
destroy() {
|
|
2137
2137
|
this.app.getSettings().useMouseEvents && this.removeHandlers(), this.distElement.remove(), this.wrapper.remove();
|
|
@@ -2159,10 +2159,10 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
2159
2159
|
return !this.app.getSettings().clickEventForward || !["a", "button"].includes(i.tagName.toLowerCase());
|
|
2160
2160
|
}
|
|
2161
2161
|
}
|
|
2162
|
-
class
|
|
2163
|
-
constructor(i, n, a,
|
|
2164
|
-
super(i, n, a), this.wrapper.insertAdjacentHTML("afterbegin", '<div class="stf__block"></div>'), this.distElement = i.querySelector(".stf__block"), this.items =
|
|
2165
|
-
for (const
|
|
2162
|
+
class F extends T {
|
|
2163
|
+
constructor(i, n, a, l) {
|
|
2164
|
+
super(i, n, a), this.wrapper.insertAdjacentHTML("afterbegin", '<div class="stf__block"></div>'), this.distElement = i.querySelector(".stf__block"), this.items = l;
|
|
2165
|
+
for (const d of l) this.distElement.appendChild(d);
|
|
2166
2166
|
this.setHandlers();
|
|
2167
2167
|
}
|
|
2168
2168
|
clear() {
|
|
@@ -2177,7 +2177,7 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
2177
2177
|
this.app.getRender().update();
|
|
2178
2178
|
}
|
|
2179
2179
|
}
|
|
2180
|
-
class
|
|
2180
|
+
class B extends T {
|
|
2181
2181
|
constructor(i, n, a) {
|
|
2182
2182
|
super(i, n, a), this.wrapper.innerHTML = '<canvas class="stf__canvas"></canvas>', this.canvas = i.querySelectorAll("canvas")[0], this.distElement = this.canvas, this.resizeCanvas(), this.setHandlers();
|
|
2183
2183
|
}
|
|
@@ -2212,7 +2212,7 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
2212
2212
|
const i = this.getRect(), n = this.shadow.progress > 100 ? 200 - this.shadow.progress : this.shadow.progress;
|
|
2213
2213
|
let a = (100 - n) * (2.5 * i.pageWidth) / 100 + 20;
|
|
2214
2214
|
a > i.pageWidth && (a = i.pageWidth);
|
|
2215
|
-
let
|
|
2215
|
+
let l = `
|
|
2216
2216
|
display: block;
|
|
2217
2217
|
z-index: ${(this.getSettings().startZIndex + 5).toString(10)};
|
|
2218
2218
|
width: ${a}px;
|
|
@@ -2223,7 +2223,7 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
2223
2223
|
left: ${i.left + i.width / 2}px;
|
|
2224
2224
|
transform-origin: 0 0;
|
|
2225
2225
|
`;
|
|
2226
|
-
|
|
2226
|
+
l += this.getDirection() === 0 && this.shadow.progress > 100 || this.getDirection() === 1 && this.shadow.progress <= 100 ? "transform: translate3d(0, 0, 0);" : "transform: translate3d(0, 0, 0) rotateY(180deg);", this.hardInnerShadow.style.cssText = l;
|
|
2227
2227
|
}
|
|
2228
2228
|
drawHardOuterShadow() {
|
|
2229
2229
|
const i = this.getRect();
|
|
@@ -2241,36 +2241,36 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
2241
2241
|
a += this.getDirection() === 0 && this.shadow.progress > 100 || this.getDirection() === 1 && this.shadow.progress <= 100 ? "transform: translate3d(0, 0, 0) rotateY(180deg);" : "transform: translate3d(0, 0, 0);", this.hardShadow.style.cssText = a;
|
|
2242
2242
|
}
|
|
2243
2243
|
drawInnerShadow() {
|
|
2244
|
-
const i = this.getRect(), n = 3 * this.shadow.width / 4, a = this.getDirection() === 0 ? n : 0,
|
|
2244
|
+
const i = this.getRect(), n = 3 * this.shadow.width / 4, a = this.getDirection() === 0 ? n : 0, l = this.getDirection() === 0 ? "to left" : "to right", d = this.convertToGlobal(this.shadow.pos), c = this.shadow.angle + 3 * Math.PI / 2, v = [this.pageRect.topLeft, this.pageRect.topRight, this.pageRect.bottomRight, this.pageRect.bottomLeft];
|
|
2245
2245
|
let y = "polygon( ";
|
|
2246
2246
|
for (const R of v) {
|
|
2247
2247
|
let W = this.getDirection() === 1 ? { x: -R.x + this.shadow.pos.x, y: R.y - this.shadow.pos.y } : { x: R.x - this.shadow.pos.x, y: R.y - this.shadow.pos.y };
|
|
2248
|
-
W =
|
|
2248
|
+
W = g.GetRotatedPoint(W, { x: a, y: 100 }, c), y += W.x + "px " + W.y + "px, ";
|
|
2249
2249
|
}
|
|
2250
2250
|
y = y.slice(0, -2), y += ")";
|
|
2251
|
-
const
|
|
2251
|
+
const A = `
|
|
2252
2252
|
display: block;
|
|
2253
2253
|
z-index: ${(this.getSettings().startZIndex + 10).toString(10)};
|
|
2254
2254
|
width: ${n}px;
|
|
2255
2255
|
height: ${2 * i.height}px;
|
|
2256
|
-
background: linear-gradient(${
|
|
2256
|
+
background: linear-gradient(${l},
|
|
2257
2257
|
rgba(0, 0, 0, ${this.shadow.opacity}) 5%,
|
|
2258
2258
|
rgba(0, 0, 0, 0.05) 15%,
|
|
2259
2259
|
rgba(0, 0, 0, ${this.shadow.opacity}) 35%,
|
|
2260
2260
|
rgba(0, 0, 0, 0) 100%);
|
|
2261
2261
|
transform-origin: ${a}px 100px;
|
|
2262
|
-
transform: translate3d(${
|
|
2262
|
+
transform: translate3d(${d.x - a}px, ${d.y - 100}px, 0) rotate(${c}rad);
|
|
2263
2263
|
clip-path: ${y};
|
|
2264
2264
|
-webkit-clip-path: ${y};
|
|
2265
2265
|
`;
|
|
2266
|
-
this.innerShadow.style.cssText =
|
|
2266
|
+
this.innerShadow.style.cssText = A;
|
|
2267
2267
|
}
|
|
2268
2268
|
drawOuterShadow() {
|
|
2269
|
-
const i = this.getRect(), n = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y }), a = this.shadow.angle + 3 * Math.PI / 2,
|
|
2269
|
+
const i = this.getRect(), n = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y }), a = this.shadow.angle + 3 * Math.PI / 2, l = this.getDirection() === 1 ? this.shadow.width : 0, d = this.getDirection() === 0 ? "to right" : "to left", c = [{ x: 0, y: 0 }, { x: i.pageWidth, y: 0 }, { x: i.pageWidth, y: i.height }, { x: 0, y: i.height }];
|
|
2270
2270
|
let v = "polygon( ";
|
|
2271
|
-
for (const
|
|
2272
|
-
let R = this.getDirection() === 1 ? { x: -
|
|
2273
|
-
R =
|
|
2271
|
+
for (const A of c) if (A !== null) {
|
|
2272
|
+
let R = this.getDirection() === 1 ? { x: -A.x + this.shadow.pos.x, y: A.y - this.shadow.pos.y } : { x: A.x - this.shadow.pos.x, y: A.y - this.shadow.pos.y };
|
|
2273
|
+
R = g.GetRotatedPoint(R, { x: l, y: 100 }, a), v += R.x + "px " + R.y + "px, ";
|
|
2274
2274
|
}
|
|
2275
2275
|
v = v.slice(0, -2), v += ")";
|
|
2276
2276
|
const y = `
|
|
@@ -2278,9 +2278,9 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
2278
2278
|
z-index: ${(this.getSettings().startZIndex + 10).toString(10)};
|
|
2279
2279
|
width: ${this.shadow.width}px;
|
|
2280
2280
|
height: ${2 * i.height}px;
|
|
2281
|
-
background: linear-gradient(${
|
|
2282
|
-
transform-origin: ${
|
|
2283
|
-
transform: translate3d(${n.x -
|
|
2281
|
+
background: linear-gradient(${d}, rgba(0, 0, 0, ${this.shadow.opacity}), rgba(0, 0, 0, 0));
|
|
2282
|
+
transform-origin: ${l}px 100px;
|
|
2283
|
+
transform: translate3d(${n.x - l}px, ${n.y - 100}px, 0) rotate(${a}rad);
|
|
2284
2284
|
clip-path: ${v};
|
|
2285
2285
|
-webkit-clip-path: ${v};
|
|
2286
2286
|
`;
|
|
@@ -2323,8 +2323,8 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
2323
2323
|
i === void 0 && (i = {});
|
|
2324
2324
|
var n = i.insertAt;
|
|
2325
2325
|
if (typeof document < "u") {
|
|
2326
|
-
var a = document.head || document.getElementsByTagName("head")[0],
|
|
2327
|
-
|
|
2326
|
+
var a = document.head || document.getElementsByTagName("head")[0], l = document.createElement("style");
|
|
2327
|
+
l.type = "text/css", n === "top" && a.firstChild ? a.insertBefore(l, a.firstChild) : a.appendChild(l), l.styleSheet ? l.styleSheet.cssText = f : l.appendChild(document.createTextNode(f));
|
|
2328
2328
|
}
|
|
2329
2329
|
})(`.stf__parent {
|
|
2330
2330
|
position: relative;
|
|
@@ -2410,24 +2410,24 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
2410
2410
|
this.render.update(), this.pages.show();
|
|
2411
2411
|
}
|
|
2412
2412
|
loadFromImages(f) {
|
|
2413
|
-
this.ui = new
|
|
2413
|
+
this.ui = new B(this.block, this, this.setting);
|
|
2414
2414
|
const i = this.ui.getCanvas();
|
|
2415
|
-
this.render = new
|
|
2415
|
+
this.render = new C(this, this.setting, i), this.flipController = new D(this.render, this), this.pages = new u(this, this.render, f), this.pages.load(), this.render.start(), this.pages.show(this.setting.startPage), setTimeout(() => {
|
|
2416
2416
|
this.ui.update(), this.trigger("init", this, { page: this.setting.startPage, mode: this.render.getOrientation() });
|
|
2417
2417
|
}, 1);
|
|
2418
2418
|
}
|
|
2419
2419
|
loadFromHTML(f) {
|
|
2420
|
-
this.ui = new
|
|
2420
|
+
this.ui = new F(this.block, this, this.setting, f), this.render = new H(this, this.setting, this.ui.getDistElement()), this.flipController = new D(this.render, this), this.pages = new P(this, this.render, this.ui.getDistElement(), f), this.pages.load(), this.render.start(), this.pages.show(this.setting.startPage), setTimeout(() => {
|
|
2421
2421
|
this.ui.update(), this.trigger("init", this, { page: this.setting.startPage, mode: this.render.getOrientation() });
|
|
2422
2422
|
}, 1);
|
|
2423
2423
|
}
|
|
2424
2424
|
updateFromImages(f) {
|
|
2425
2425
|
const i = this.pages.getCurrentPageIndex();
|
|
2426
|
-
this.pages.destroy(), this.pages = new
|
|
2426
|
+
this.pages.destroy(), this.pages = new u(this, this.render, f), this.pages.load(), this.pages.show(i), this.trigger("update", this, { page: i, mode: this.render.getOrientation() });
|
|
2427
2427
|
}
|
|
2428
2428
|
updateFromHtml(f) {
|
|
2429
2429
|
const i = this.pages.getCurrentPageIndex();
|
|
2430
|
-
this.pages.destroy(), this.pages = new
|
|
2430
|
+
this.pages.destroy(), this.pages = new P(this, this.render, this.ui.getDistElement(), f), this.pages.load(), this.ui.updateItems(f), this.render.reload(), this.pages.show(i), this.trigger("update", this, { page: i, mode: this.render.getOrientation() });
|
|
2431
2431
|
}
|
|
2432
2432
|
clear() {
|
|
2433
2433
|
this.pages.destroy(), this.ui.clear();
|
|
@@ -2496,7 +2496,7 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
2496
2496
|
this.mousePosition = f, this.isUserTouch = !0, this.isUserMove = !1;
|
|
2497
2497
|
}
|
|
2498
2498
|
userMove(f, i) {
|
|
2499
|
-
this.isUserTouch || i || !this.setting.showPageCorners ? this.isUserTouch &&
|
|
2499
|
+
this.isUserTouch || i || !this.setting.showPageCorners ? this.isUserTouch && g.GetDistanceBetweenTwoPoint(this.mousePosition, f) > 5 && (this.isUserMove = !0, this.flipController.fold(f)) : this.flipController.showCorner(f);
|
|
2500
2500
|
}
|
|
2501
2501
|
userStop(f, i = !1) {
|
|
2502
2502
|
this.isUserTouch && (this.isUserTouch = !1, i || (this.isUserMove ? this.flipController.stopMove() : this.flipController.flip(f)));
|
|
@@ -2504,9 +2504,9 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
2504
2504
|
}, Object.defineProperty(s, "__esModule", { value: !0 });
|
|
2505
2505
|
});
|
|
2506
2506
|
})(Dt, Dt.exports);
|
|
2507
|
-
var
|
|
2507
|
+
var li = Dt.exports;
|
|
2508
2508
|
/**
|
|
2509
|
-
* @license FlipbookEngine v0.
|
|
2509
|
+
* @license FlipbookEngine v0.5.4
|
|
2510
2510
|
* Copyright (c) 2026 Murat Dogan
|
|
2511
2511
|
*
|
|
2512
2512
|
* This source code is dual-licensed under the AGPLv3 and a Commercial License.
|
|
@@ -2519,13 +2519,13 @@ var hi = Dt.exports;
|
|
|
2519
2519
|
* you must purchase a Commercial License from:
|
|
2520
2520
|
* https://flipbookengine.com/pricing
|
|
2521
2521
|
*/
|
|
2522
|
-
function
|
|
2522
|
+
function ci() {
|
|
2523
2523
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2524
2524
|
}
|
|
2525
|
-
function
|
|
2525
|
+
function di(e, t = ci()) {
|
|
2526
2526
|
return t ? 0 : typeof e == "number" && e >= 0 ? e : 1e3;
|
|
2527
2527
|
}
|
|
2528
|
-
class
|
|
2528
|
+
class ui {
|
|
2529
2529
|
constructor(t, s, o) {
|
|
2530
2530
|
m(this, "pageFlip", null);
|
|
2531
2531
|
m(this, "bookContainer");
|
|
@@ -2536,6 +2536,7 @@ class di {
|
|
|
2536
2536
|
m(this, "audioUnlockHandler", null);
|
|
2537
2537
|
m(this, "isLibraryFlipping", !1);
|
|
2538
2538
|
m(this, "autoPlayTimer", null);
|
|
2539
|
+
m(this, "layoutUpdateTimer", null);
|
|
2539
2540
|
this.bookContainer = t, this.options = s, this.store = o, s.soundUrl && (this.audioEl = new Audio(s.soundUrl), this.unlockAudio());
|
|
2540
2541
|
}
|
|
2541
2542
|
unlockAudio() {
|
|
@@ -2553,7 +2554,7 @@ class di {
|
|
|
2553
2554
|
this.audioUnlockHandler = t, document.addEventListener("touchstart", t, { once: !0 }), document.addEventListener("click", t, { once: !0 });
|
|
2554
2555
|
}
|
|
2555
2556
|
init(t, s) {
|
|
2556
|
-
this.pageFlip = new
|
|
2557
|
+
this.pageFlip = new li.PageFlip(this.bookContainer, {
|
|
2557
2558
|
width: t,
|
|
2558
2559
|
height: s,
|
|
2559
2560
|
size: "stretch",
|
|
@@ -2566,7 +2567,7 @@ class di {
|
|
|
2566
2567
|
usePortrait: !0,
|
|
2567
2568
|
mobileScrollSupport: !1,
|
|
2568
2569
|
maxShadowOpacity: this.options.maxShadowOpacity || 0.5,
|
|
2569
|
-
flippingTime:
|
|
2570
|
+
flippingTime: di(this.options.flippingTime)
|
|
2570
2571
|
});
|
|
2571
2572
|
const o = this.bookContainer.querySelectorAll(".bz-page");
|
|
2572
2573
|
this.pageFlip.loadFromHTML(Array.from(o)), this.bindEvents(), this.setupSignalSync();
|
|
@@ -2582,23 +2583,23 @@ class di {
|
|
|
2582
2583
|
}
|
|
2583
2584
|
setupSignalSync() {
|
|
2584
2585
|
this.unsubs.push(
|
|
2585
|
-
|
|
2586
|
+
G(() => {
|
|
2586
2587
|
const t = this.store.currentPage.value, s = this.store.flipState.peek();
|
|
2587
2588
|
if (!this.pageFlip || this.isLibraryFlipping || s !== "read") return;
|
|
2588
2589
|
const o = this.pageFlip.getCurrentPageIndex();
|
|
2589
2590
|
if (o !== t && !this.store.isSingleMode.value) {
|
|
2590
|
-
const r = (
|
|
2591
|
-
|
|
2591
|
+
const r = (g) => g === 0 ? 0 : Math.ceil(g / 2), h = r(t), u = r(o);
|
|
2592
|
+
h === u + 1 ? this.pageFlip.flipNext() : h === u - 1 ? this.pageFlip.flipPrev() : h !== u && this.pageFlip.turnToPage(t);
|
|
2592
2593
|
}
|
|
2593
2594
|
})
|
|
2594
2595
|
), this.unsubs.push(
|
|
2595
|
-
|
|
2596
|
-
this.store.isSingleMode.value, this.pageFlip && setTimeout(() => {
|
|
2597
|
-
this.pageFlip && this.pageFlip.update(), window.dispatchEvent(new Event("resize"));
|
|
2598
|
-
}, 50);
|
|
2596
|
+
G(() => {
|
|
2597
|
+
this.store.isSingleMode.value, this.pageFlip && (this.layoutUpdateTimer && clearTimeout(this.layoutUpdateTimer), this.layoutUpdateTimer = setTimeout(() => {
|
|
2598
|
+
this.layoutUpdateTimer = null, this.pageFlip && this.pageFlip.update(), window.dispatchEvent(new Event("resize"));
|
|
2599
|
+
}, 50));
|
|
2599
2600
|
})
|
|
2600
2601
|
), this.unsubs.push(
|
|
2601
|
-
|
|
2602
|
+
G(() => {
|
|
2602
2603
|
const t = this.store.isAutoPlaying.value, s = this.store.autoPlayInterval.value || 3e3;
|
|
2603
2604
|
this.autoPlayTimer && (clearInterval(this.autoPlayTimer), this.autoPlayTimer = null), t && (this.autoPlayTimer = setInterval(() => {
|
|
2604
2605
|
const o = this.store.pages.value.length - 1;
|
|
@@ -2631,14 +2632,14 @@ class di {
|
|
|
2631
2632
|
}
|
|
2632
2633
|
}
|
|
2633
2634
|
update() {
|
|
2634
|
-
this.pageFlip && this.pageFlip.update();
|
|
2635
|
+
this.pageFlip && this.pageFlip.update(), this.layoutUpdateTimer && (clearTimeout(this.layoutUpdateTimer), this.layoutUpdateTimer = null);
|
|
2635
2636
|
}
|
|
2636
2637
|
destroy() {
|
|
2637
2638
|
this.autoPlayTimer && (clearInterval(this.autoPlayTimer), this.autoPlayTimer = null), this.audioUnlockHandler && (document.removeEventListener("touchstart", this.audioUnlockHandler), document.removeEventListener("click", this.audioUnlockHandler), this.audioUnlockHandler = null), this.unsubs.forEach((t) => t()), this.unsubs = [], this.pageFlip && (this.pageFlip.destroy(), this.pageFlip = null);
|
|
2638
2639
|
}
|
|
2639
2640
|
}
|
|
2640
2641
|
/**
|
|
2641
|
-
* @license FlipbookEngine v0.
|
|
2642
|
+
* @license FlipbookEngine v0.5.4
|
|
2642
2643
|
* Copyright (c) 2026 Murat Dogan
|
|
2643
2644
|
*
|
|
2644
2645
|
* This source code is dual-licensed under the AGPLv3 and a Commercial License.
|
|
@@ -2651,7 +2652,7 @@ class di {
|
|
|
2651
2652
|
* you must purchase a Commercial License from:
|
|
2652
2653
|
* https://flipbookengine.com/pricing
|
|
2653
2654
|
*/
|
|
2654
|
-
class
|
|
2655
|
+
class gi {
|
|
2655
2656
|
constructor(t, s) {
|
|
2656
2657
|
m(this, "wrapperElement", null);
|
|
2657
2658
|
m(this, "sizerElement", null);
|
|
@@ -2661,6 +2662,7 @@ class ui {
|
|
|
2661
2662
|
m(this, "orientationMediaQuery", null);
|
|
2662
2663
|
m(this, "orientationChangeHandler", null);
|
|
2663
2664
|
m(this, "unsubs", []);
|
|
2665
|
+
m(this, "updateTimer", null);
|
|
2664
2666
|
m(this, "onResizeCallback");
|
|
2665
2667
|
this.pageViewport = t, this.store = s;
|
|
2666
2668
|
}
|
|
@@ -2669,8 +2671,8 @@ class ui {
|
|
|
2669
2671
|
}
|
|
2670
2672
|
setupStateSync() {
|
|
2671
2673
|
this.unsubs.push(
|
|
2672
|
-
|
|
2673
|
-
this.store.isSingleMode.value, this.store.orientation.value,
|
|
2674
|
+
G(() => {
|
|
2675
|
+
this.store.isSingleMode.value, this.store.orientation.value, this.scheduleAspectRatioUpdate();
|
|
2674
2676
|
})
|
|
2675
2677
|
);
|
|
2676
2678
|
}
|
|
@@ -2692,18 +2694,23 @@ class ui {
|
|
|
2692
2694
|
if (!this.wrapperElement || !this.sizerElement) return;
|
|
2693
2695
|
const t = this.wrapperElement.clientWidth, s = this.wrapperElement.clientHeight;
|
|
2694
2696
|
if (t === 0 || s === 0) return;
|
|
2695
|
-
const o = this.pageViewport.width, r = this.pageViewport.height,
|
|
2696
|
-
let
|
|
2697
|
-
x > s && (x = s,
|
|
2698
|
-
let
|
|
2699
|
-
|
|
2697
|
+
const o = this.pageViewport.width, r = this.pageViewport.height, u = this.store.isDoublePageLayout.value ? o * 2 / r : o / r;
|
|
2698
|
+
let g = t, x = t / u;
|
|
2699
|
+
x > s && (x = s, g = s * u);
|
|
2700
|
+
let P = Math.ceil(g);
|
|
2701
|
+
P % 2 !== 0 && (P += 1), this.sizerElement.style.width = `${P}px`, this.sizerElement.style.height = `${Math.floor(x)}px`, this.sizerElement.style.aspectRatio = "", this.onResizeCallback && this.onResizeCallback();
|
|
2700
2702
|
}
|
|
2701
2703
|
destroy() {
|
|
2702
|
-
this.unsubs.forEach((t) => t()), this.unsubs = [], this.resizeObserver && this.wrapperElement && (this.resizeObserver.unobserve(this.wrapperElement), this.resizeObserver.disconnect(), this.resizeObserver = null), this.orientationMediaQuery && (this.orientationChangeHandler && (this.orientationMediaQuery.removeEventListener ? this.orientationMediaQuery.removeEventListener("change", this.orientationChangeHandler) : this.orientationMediaQuery.removeListener(this.orientationChangeHandler)), this.orientationChangeHandler = null, this.orientationMediaQuery = null);
|
|
2704
|
+
this.updateTimer && (clearTimeout(this.updateTimer), this.updateTimer = null), this.unsubs.forEach((t) => t()), this.unsubs = [], this.resizeObserver && this.wrapperElement && (this.resizeObserver.unobserve(this.wrapperElement), this.resizeObserver.disconnect(), this.resizeObserver = null), this.orientationMediaQuery && (this.orientationChangeHandler && (this.orientationMediaQuery.removeEventListener ? this.orientationMediaQuery.removeEventListener("change", this.orientationChangeHandler) : this.orientationMediaQuery.removeListener(this.orientationChangeHandler)), this.orientationChangeHandler = null, this.orientationMediaQuery = null);
|
|
2705
|
+
}
|
|
2706
|
+
scheduleAspectRatioUpdate() {
|
|
2707
|
+
this.updateTimer && clearTimeout(this.updateTimer), this.updateTimer = setTimeout(() => {
|
|
2708
|
+
this.updateTimer = null, this.updateBookAspectRatio();
|
|
2709
|
+
}, 10);
|
|
2703
2710
|
}
|
|
2704
2711
|
}
|
|
2705
2712
|
/**
|
|
2706
|
-
* @license FlipbookEngine v0.
|
|
2713
|
+
* @license FlipbookEngine v0.5.4
|
|
2707
2714
|
* Copyright (c) 2026 Murat Dogan
|
|
2708
2715
|
*
|
|
2709
2716
|
* This source code is dual-licensed under the AGPLv3 and a Commercial License.
|
|
@@ -2716,7 +2723,7 @@ class ui {
|
|
|
2716
2723
|
* you must purchase a Commercial License from:
|
|
2717
2724
|
* https://flipbookengine.com/pricing
|
|
2718
2725
|
*/
|
|
2719
|
-
class
|
|
2726
|
+
class pi {
|
|
2720
2727
|
constructor(t, s, o) {
|
|
2721
2728
|
m(this, "container");
|
|
2722
2729
|
m(this, "pageFlipAdapter");
|
|
@@ -2724,9 +2731,9 @@ class gi {
|
|
|
2724
2731
|
m(this, "touchStartX", null);
|
|
2725
2732
|
m(this, "unsubs", []);
|
|
2726
2733
|
m(this, "listenerAbortController");
|
|
2727
|
-
var
|
|
2734
|
+
var h;
|
|
2728
2735
|
this.container = t, this.pageFlipAdapter = s, this.store = o;
|
|
2729
|
-
const r = ((
|
|
2736
|
+
const r = ((h = t.ownerDocument.defaultView) == null ? void 0 : h.AbortController) ?? globalThis.AbortController;
|
|
2730
2737
|
this.listenerAbortController = new r();
|
|
2731
2738
|
}
|
|
2732
2739
|
init() {
|
|
@@ -2734,7 +2741,7 @@ class gi {
|
|
|
2734
2741
|
}
|
|
2735
2742
|
setupStateSync() {
|
|
2736
2743
|
this.unsubs.push(
|
|
2737
|
-
|
|
2744
|
+
G(() => {
|
|
2738
2745
|
this.store.isZoomed.value = this.store.zoomState.value.isActive, this.store.zoomState.value.isActive ? (this.container.style.transform = `translate(${this.store.zoomState.value.translateX}px, ${this.store.zoomState.value.translateY}px) scale(${this.store.zoomState.value.scale})`, this.container.style.transition = "none") : (this.container.style.transform = "", this.container.style.transition = "transform 0.3s ease");
|
|
2739
2746
|
})
|
|
2740
2747
|
);
|
|
@@ -2748,13 +2755,13 @@ class gi {
|
|
|
2748
2755
|
}, { passive: !1, signal: this.listenerAbortController.signal });
|
|
2749
2756
|
}
|
|
2750
2757
|
bindMouseDrag() {
|
|
2751
|
-
let t = !1, s = 0, o = 0, r = 0,
|
|
2752
|
-
this.container.addEventListener("mousedown", (
|
|
2753
|
-
this.store.zoomState.value.isActive && (t = !0, s =
|
|
2754
|
-
}, { signal: this.listenerAbortController.signal }), window.addEventListener("mousemove", (
|
|
2758
|
+
let t = !1, s = 0, o = 0, r = 0, h = 0;
|
|
2759
|
+
this.container.addEventListener("mousedown", (u) => {
|
|
2760
|
+
this.store.zoomState.value.isActive && (t = !0, s = u.clientX, o = u.clientY, r = this.store.zoomState.value.translateX, h = this.store.zoomState.value.translateY, this.container.style.cursor = "grabbing");
|
|
2761
|
+
}, { signal: this.listenerAbortController.signal }), window.addEventListener("mousemove", (u) => {
|
|
2755
2762
|
if (!t || !this.store.zoomState.value.isActive) return;
|
|
2756
|
-
const
|
|
2757
|
-
this.updateZoomPan(r +
|
|
2763
|
+
const g = u.clientX - s, x = u.clientY - o;
|
|
2764
|
+
this.updateZoomPan(r + g, h + x);
|
|
2758
2765
|
}, { signal: this.listenerAbortController.signal }), window.addEventListener("mouseup", () => {
|
|
2759
2766
|
t && (t = !1, this.container.style.cursor = this.store.zoomState.value.isActive ? "grab" : "");
|
|
2760
2767
|
}, { signal: this.listenerAbortController.signal });
|
|
@@ -2767,19 +2774,19 @@ class gi {
|
|
|
2767
2774
|
this.touchStartX = r.touches[0].clientX;
|
|
2768
2775
|
else {
|
|
2769
2776
|
t = !0, this.touchStartX = r.touches[0].clientX;
|
|
2770
|
-
const
|
|
2771
|
-
s = this.store.zoomState.value.translateX, o = this.store.zoomState.value.translateY, this.container._touchStartY =
|
|
2777
|
+
const h = r.touches[0].clientY;
|
|
2778
|
+
s = this.store.zoomState.value.translateX, o = this.store.zoomState.value.translateY, this.container._touchStartY = h;
|
|
2772
2779
|
}
|
|
2773
2780
|
}, { passive: !0, signal: this.listenerAbortController.signal }), this.container.addEventListener("touchmove", (r) => {
|
|
2774
2781
|
if (t && this.store.zoomState.value.isActive && r.touches.length === 1 && this.touchStartX !== null) {
|
|
2775
2782
|
r.preventDefault();
|
|
2776
|
-
const
|
|
2777
|
-
this.updateZoomPan(s +
|
|
2783
|
+
const h = r.touches[0].clientX - this.touchStartX, u = r.touches[0].clientY - this.container._touchStartY;
|
|
2784
|
+
this.updateZoomPan(s + h, o + u);
|
|
2778
2785
|
}
|
|
2779
2786
|
}, { passive: !1, signal: this.listenerAbortController.signal }), this.container.addEventListener("touchend", (r) => {
|
|
2780
2787
|
if (this.touchStartX !== null && !this.store.zoomState.value.isActive && this.store.isSingleMode.value && r.changedTouches.length === 1) {
|
|
2781
|
-
const
|
|
2782
|
-
|
|
2788
|
+
const h = r.changedTouches[0].clientX - this.touchStartX;
|
|
2789
|
+
h > 50 && this.store.currentPage.value > 0 ? this.pageFlipAdapter.turnToPrevPage() : h < -50 && this.store.currentPage.value < this.store.totalPages.value - 1 && this.pageFlipAdapter.turnToNextPage();
|
|
2783
2790
|
}
|
|
2784
2791
|
this.touchStartX = null, t = !1;
|
|
2785
2792
|
}, { passive: !0, signal: this.listenerAbortController.signal });
|
|
@@ -2808,42 +2815,44 @@ class gi {
|
|
|
2808
2815
|
}
|
|
2809
2816
|
}
|
|
2810
2817
|
/**
|
|
2811
|
-
* @license FlipbookEngine v0.
|
|
2818
|
+
* @license FlipbookEngine v0.5.4
|
|
2812
2819
|
* Copyright (c) 2026 Murat Dogan
|
|
2813
2820
|
*
|
|
2814
2821
|
* This source code is dual-licensed under the AGPLv3 and a Commercial License.
|
|
2815
2822
|
*/
|
|
2816
|
-
const
|
|
2817
|
-
function
|
|
2818
|
-
const e = M(0), t = M(0), s = M(!1), o = M(!0), r = M(!0),
|
|
2819
|
-
return { currentPage: e, totalPages: t, isSingleMode: s, showThumbs: o, showArrows: r, orientation:
|
|
2820
|
-
t.value =
|
|
2823
|
+
const Kt = () => ({ isActive: !1, translateX: 0, translateY: 0, isDragging: !1, scale: 1 });
|
|
2824
|
+
function me() {
|
|
2825
|
+
const e = M(0), t = M(0), s = M(!1), o = M(!0), r = M(!0), h = M("landscape"), u = M("read"), g = M("auto"), x = M(!0), P = M(!1), b = M("#7367f0"), D = M(!1), $ = M(!1), C = M(!1), T = M(3e3), F = M(!0), B = M("en"), H = M({}), N = M(Kt()), f = M([]), i = w(() => !s.value && h.value === "landscape"), n = w(() => i.value && e.value === 0), a = w(() => i.value && e.value >= t.value - 1);
|
|
2826
|
+
return { currentPage: e, totalPages: t, isSingleMode: s, showThumbs: o, showArrows: r, orientation: h, flipState: u, themeMode: g, allowDownload: x, hasDownloadUrl: P, primaryColor: b, whiteLabel: D, isZoomed: $, isAutoPlaying: C, autoPlayInterval: T, soundEnabled: F, locale: B, messages: H, zoomState: N, pages: f, isDoublePageLayout: i, isFrontCover: n, isBackCover: a, init: (c, v, y, A) => {
|
|
2827
|
+
t.value = v, f.value = y, P.value = A, c.theme !== void 0 && (g.value = c.theme), c.primaryColor !== void 0 && (b.value = c.primaryColor), c.showThumbs !== void 0 && (o.value = c.showThumbs), c.showArrows !== void 0 && (r.value = c.showArrows), c.allowDownload !== void 0 && (x.value = c.allowDownload), c.whiteLabel !== void 0 && (D.value = c.whiteLabel), c.soundEnabled !== void 0 && (F.value = c.soundEnabled), c.locale !== void 0 && (B.value = c.locale), c.messages !== void 0 && (H.value = c.messages), c.isSingleMode !== void 0 && (s.value = c.isSingleMode), c.singleMode !== void 0 && (s.value = c.singleMode), c.autoPlay !== void 0 && (C.value = c.autoPlay), c.autoPlayInterval !== void 0 && (T.value = c.autoPlayInterval), e.value = 0;
|
|
2828
|
+
}, reset: () => {
|
|
2829
|
+
e.value = 0, t.value = 0, s.value = !1, o.value = !0, r.value = !0, h.value = "landscape", u.value = "read", g.value = "auto", x.value = !0, P.value = !1, b.value = "#7367f0", D.value = !1, $.value = !1, C.value = !1, T.value = 3e3, F.value = !0, B.value = "en", H.value = {}, N.value = Kt(), f.value = [];
|
|
2821
2830
|
} };
|
|
2822
2831
|
}
|
|
2823
|
-
const
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2832
|
+
const E = me();
|
|
2833
|
+
E.currentPage;
|
|
2834
|
+
E.totalPages;
|
|
2835
|
+
E.isSingleMode;
|
|
2836
|
+
E.showThumbs;
|
|
2837
|
+
E.showArrows;
|
|
2838
|
+
E.orientation;
|
|
2839
|
+
E.flipState;
|
|
2840
|
+
E.themeMode;
|
|
2841
|
+
E.allowDownload;
|
|
2842
|
+
E.hasDownloadUrl;
|
|
2843
|
+
E.primaryColor;
|
|
2844
|
+
E.whiteLabel;
|
|
2845
|
+
E.isZoomed;
|
|
2846
|
+
E.isAutoPlaying;
|
|
2847
|
+
E.autoPlayInterval;
|
|
2848
|
+
E.soundEnabled;
|
|
2849
|
+
E.locale;
|
|
2850
|
+
E.messages;
|
|
2851
|
+
E.zoomState;
|
|
2852
|
+
E.pages;
|
|
2853
|
+
E.isDoublePageLayout;
|
|
2854
|
+
E.isFrontCover;
|
|
2855
|
+
E.isBackCover;
|
|
2847
2856
|
function fi(e) {
|
|
2848
2857
|
if (!e || typeof e != "object") return !1;
|
|
2849
2858
|
const t = e;
|
|
@@ -2859,15 +2868,15 @@ function vi(e) {
|
|
|
2859
2868
|
const t = [];
|
|
2860
2869
|
let s = 1;
|
|
2861
2870
|
return e.forEach((o, r) => {
|
|
2862
|
-
const
|
|
2863
|
-
if (
|
|
2864
|
-
const b = x.length >= 2 ? x.slice(0, 2) : [s, s + 1], D = wi(
|
|
2865
|
-
b.forEach(($,
|
|
2871
|
+
const h = o.kind ?? "single", u = o.id ?? `asset-${r}`, g = o.splitDirection ?? "ltr", x = mi(o);
|
|
2872
|
+
if (h === "spread") {
|
|
2873
|
+
const b = x.length >= 2 ? x.slice(0, 2) : [s, s + 1], D = wi(g);
|
|
2874
|
+
b.forEach(($, C) => {
|
|
2866
2875
|
t.push({
|
|
2867
2876
|
index: t.length,
|
|
2868
|
-
assetId:
|
|
2877
|
+
assetId: u,
|
|
2869
2878
|
pageNumber: $,
|
|
2870
|
-
cropMode: D[
|
|
2879
|
+
cropMode: D[C] ?? "full",
|
|
2871
2880
|
normal: o.normal,
|
|
2872
2881
|
low: o.low,
|
|
2873
2882
|
thumb: o.thumb
|
|
@@ -2875,24 +2884,24 @@ function vi(e) {
|
|
|
2875
2884
|
}), s = b[b.length - 1] + 1;
|
|
2876
2885
|
return;
|
|
2877
2886
|
}
|
|
2878
|
-
const
|
|
2887
|
+
const P = x[0] ?? s;
|
|
2879
2888
|
t.push({
|
|
2880
2889
|
index: t.length,
|
|
2881
|
-
assetId:
|
|
2882
|
-
pageNumber:
|
|
2890
|
+
assetId: u,
|
|
2891
|
+
pageNumber: P,
|
|
2883
2892
|
cropMode: "full",
|
|
2884
2893
|
normal: o.normal,
|
|
2885
2894
|
low: o.low,
|
|
2886
2895
|
thumb: o.thumb
|
|
2887
|
-
}), s =
|
|
2896
|
+
}), s = P + 1;
|
|
2888
2897
|
}), t;
|
|
2889
2898
|
}
|
|
2890
|
-
function
|
|
2899
|
+
function Jt(e, t) {
|
|
2891
2900
|
e.classList.add("bk-container"), e.classList.remove("bk-theme-light", "bk-theme-dark"), t.theme === "light" && e.classList.add("bk-theme-light"), t.theme === "dark" && e.classList.add("bk-theme-dark"), t.primaryColor && e.style.setProperty("--flipbook-accent", t.primaryColor);
|
|
2892
2901
|
const s = t.cssVariables ?? {};
|
|
2893
2902
|
Object.entries(s).forEach(([o, r]) => {
|
|
2894
|
-
const
|
|
2895
|
-
e.style.setProperty(
|
|
2903
|
+
const h = o.startsWith("--") ? o : `--${o}`;
|
|
2904
|
+
e.style.setProperty(h, r);
|
|
2896
2905
|
});
|
|
2897
2906
|
}
|
|
2898
2907
|
class yi {
|
|
@@ -2951,14 +2960,14 @@ class bi {
|
|
|
2951
2960
|
const o = Bt.getDocument(t);
|
|
2952
2961
|
this.loadingTask = o;
|
|
2953
2962
|
const r = () => {
|
|
2954
|
-
var
|
|
2955
|
-
return (
|
|
2963
|
+
var h;
|
|
2964
|
+
return (h = o.destroy) == null ? void 0 : h.call(o);
|
|
2956
2965
|
};
|
|
2957
2966
|
s == null || s.addEventListener("abort", r, { once: !0 });
|
|
2958
2967
|
try {
|
|
2959
2968
|
return this.pdfDoc = await o.promise, this.throwIfAborted(s), this.pdfDoc.numPages;
|
|
2960
|
-
} catch (
|
|
2961
|
-
throw s != null && s.aborted ? this.createAbortError() :
|
|
2969
|
+
} catch (h) {
|
|
2970
|
+
throw s != null && s.aborted ? this.createAbortError() : h;
|
|
2962
2971
|
} finally {
|
|
2963
2972
|
s == null || s.removeEventListener("abort", r), this.loadingTask === o && (this.loadingTask = null);
|
|
2964
2973
|
}
|
|
@@ -2972,28 +2981,27 @@ class bi {
|
|
|
2972
2981
|
try {
|
|
2973
2982
|
const r = await this.pdfDoc.getPage(t);
|
|
2974
2983
|
this.throwIfAborted(s);
|
|
2975
|
-
const
|
|
2976
|
-
|
|
2977
|
-
const
|
|
2978
|
-
if (
|
|
2979
|
-
const x = r.render({ canvasContext:
|
|
2984
|
+
const h = r.getViewport({ scale: this.options.scale }), u = document.createElement("canvas");
|
|
2985
|
+
u.width = h.width, u.height = h.height;
|
|
2986
|
+
const g = u.getContext("2d");
|
|
2987
|
+
if (g) {
|
|
2988
|
+
const x = r.render({ canvasContext: g, viewport: h }), P = () => {
|
|
2980
2989
|
var D;
|
|
2981
2990
|
return (D = x.cancel) == null ? void 0 : D.call(x);
|
|
2982
2991
|
};
|
|
2983
|
-
s == null || s.addEventListener("abort",
|
|
2992
|
+
s == null || s.addEventListener("abort", P, { once: !0 });
|
|
2984
2993
|
try {
|
|
2985
2994
|
await x.promise, this.throwIfAborted(s);
|
|
2986
2995
|
} finally {
|
|
2987
|
-
s == null || s.removeEventListener("abort",
|
|
2996
|
+
s == null || s.removeEventListener("abort", P);
|
|
2988
2997
|
}
|
|
2989
|
-
const b =
|
|
2998
|
+
const b = u.toDataURL(this.options.format, this.options.quality);
|
|
2990
2999
|
return this.cache.set(t, b), b;
|
|
2991
3000
|
}
|
|
3001
|
+
throw new Error("Unable to create a PDF canvas rendering context.");
|
|
2992
3002
|
} catch (r) {
|
|
2993
|
-
|
|
2994
|
-
console.error(`PDF page ${t} render error:`, r);
|
|
3003
|
+
throw s != null && s.aborted ? this.createAbortError() : r;
|
|
2995
3004
|
}
|
|
2996
|
-
return "";
|
|
2997
3005
|
}
|
|
2998
3006
|
/** Calculates the best viewport dimensions based on the first page. */
|
|
2999
3007
|
async calculateViewportDimensions(t = 420) {
|
|
@@ -3006,25 +3014,25 @@ class bi {
|
|
|
3006
3014
|
if (!this.pdfDoc) return [];
|
|
3007
3015
|
this.throwIfAborted(t);
|
|
3008
3016
|
const o = this.pdfDoc.numPages, r = new Array(o);
|
|
3009
|
-
let
|
|
3010
|
-
const
|
|
3017
|
+
let h = 1, u = 0;
|
|
3018
|
+
const g = async () => {
|
|
3011
3019
|
for (; ; ) {
|
|
3012
3020
|
this.throwIfAborted(t);
|
|
3013
|
-
const
|
|
3014
|
-
if (
|
|
3015
|
-
const b = await this.renderPageToDataUrl(
|
|
3016
|
-
r[
|
|
3017
|
-
index:
|
|
3018
|
-
assetId: `pdf-page-${
|
|
3019
|
-
pageNumber:
|
|
3021
|
+
const P = h++;
|
|
3022
|
+
if (P > o) return;
|
|
3023
|
+
const b = await this.renderPageToDataUrl(P, t);
|
|
3024
|
+
r[P - 1] = {
|
|
3025
|
+
index: P - 1,
|
|
3026
|
+
assetId: `pdf-page-${P}`,
|
|
3027
|
+
pageNumber: P,
|
|
3020
3028
|
cropMode: "full",
|
|
3021
3029
|
normal: b,
|
|
3022
3030
|
low: b,
|
|
3023
3031
|
thumb: b
|
|
3024
|
-
},
|
|
3032
|
+
}, u++, s == null || s({ completed: u, total: o });
|
|
3025
3033
|
}
|
|
3026
3034
|
}, x = Math.min(this.options.concurrency, o);
|
|
3027
|
-
return await Promise.all(Array.from({ length: x }, () =>
|
|
3035
|
+
return await Promise.all(Array.from({ length: x }, () => g())), this.throwIfAborted(t), r;
|
|
3028
3036
|
}
|
|
3029
3037
|
getCacheStats() {
|
|
3030
3038
|
return this.cache.getStats();
|
|
@@ -3042,7 +3050,7 @@ class bi {
|
|
|
3042
3050
|
}
|
|
3043
3051
|
}
|
|
3044
3052
|
/**
|
|
3045
|
-
* @license FlipbookEngine v0.
|
|
3053
|
+
* @license FlipbookEngine v0.5.4
|
|
3046
3054
|
* Copyright (c) 2026 Murat Dogan
|
|
3047
3055
|
*
|
|
3048
3056
|
* This source code is dual-licensed under the AGPLv3 and a Commercial License.
|
|
@@ -3059,7 +3067,7 @@ const mt = class mt {
|
|
|
3059
3067
|
constructor(t, s = {}) {
|
|
3060
3068
|
m(this, "container", null);
|
|
3061
3069
|
m(this, "options");
|
|
3062
|
-
m(this, "store",
|
|
3070
|
+
m(this, "store", me());
|
|
3063
3071
|
// Core Managers
|
|
3064
3072
|
m(this, "pageFlipAdapter", null);
|
|
3065
3073
|
m(this, "layoutManager", null);
|
|
@@ -3074,6 +3082,7 @@ const mt = class mt {
|
|
|
3074
3082
|
m(this, "eventSyncStop", null);
|
|
3075
3083
|
m(this, "qualityObserver", null);
|
|
3076
3084
|
m(this, "pdfLazyStop", null);
|
|
3085
|
+
m(this, "hasActiveSession", !1);
|
|
3077
3086
|
m(this, "pdfPageRequests", /* @__PURE__ */ new Map());
|
|
3078
3087
|
m(this, "pdfRenderedPages", /* @__PURE__ */ new Set());
|
|
3079
3088
|
this.selector = t, this.options = {
|
|
@@ -3093,25 +3102,25 @@ const mt = class mt {
|
|
|
3093
3102
|
}
|
|
3094
3103
|
async init(t, s) {
|
|
3095
3104
|
if (typeof this.selector == "string" ? this.container = document.querySelector(this.selector) : this.container = this.selector, !this.container) return;
|
|
3096
|
-
this.
|
|
3105
|
+
this.eventsReady = !1, this.destroy(!0);
|
|
3097
3106
|
const o = this.initGeneration, r = new AbortController();
|
|
3098
3107
|
this.initAbortController = r;
|
|
3099
|
-
let
|
|
3108
|
+
let h = [], u = { ...mt.DEFAULT_PAGE_VIEWPORT };
|
|
3100
3109
|
if (s && s.length > 0) {
|
|
3101
3110
|
if (r.signal.aborted) return;
|
|
3102
|
-
const
|
|
3103
|
-
|
|
3104
|
-
const
|
|
3105
|
-
if (
|
|
3106
|
-
const
|
|
3107
|
-
if (
|
|
3108
|
-
const H = (
|
|
3109
|
-
|
|
3111
|
+
const C = s.filter(fi);
|
|
3112
|
+
h = vi(C);
|
|
3113
|
+
const T = h[0];
|
|
3114
|
+
if (T) {
|
|
3115
|
+
const F = await this.loadImageSize(T.low || T.normal);
|
|
3116
|
+
if (F) {
|
|
3117
|
+
const H = (T.cropMode !== "full" ? F.width / 2 : F.width) / F.height, N = 420;
|
|
3118
|
+
u = H >= 1 ? { width: Math.round(N * H), height: N } : { width: N, height: Math.round(N / H) };
|
|
3110
3119
|
}
|
|
3111
3120
|
}
|
|
3112
3121
|
} else if (t) {
|
|
3113
3122
|
if (r.signal.aborted) return;
|
|
3114
|
-
let
|
|
3123
|
+
let C = "load";
|
|
3115
3124
|
try {
|
|
3116
3125
|
this.pdfRenderer = new bi({
|
|
3117
3126
|
scale: this.options.pdfRenderScale,
|
|
@@ -3121,26 +3130,26 @@ const mt = class mt {
|
|
|
3121
3130
|
cacheSize: this.options.pdfRenderCacheSize,
|
|
3122
3131
|
workerSrc: this.options.pdfWorkerSrc
|
|
3123
3132
|
}), this.emit("progress", { phase: "loading", completed: 0, total: 0 });
|
|
3124
|
-
const
|
|
3125
|
-
|
|
3126
|
-
} catch (
|
|
3127
|
-
r.signal.aborted || (console.error("PDF load failed:",
|
|
3128
|
-
code:
|
|
3129
|
-
message:
|
|
3130
|
-
cause:
|
|
3133
|
+
const T = await this.pdfRenderer.loadDocument(t, r.signal);
|
|
3134
|
+
C = "render", this.emit("progress", { phase: "loading", completed: 1, total: T }), u = await this.pdfRenderer.calculateViewportDimensions(), h = Array.from({ length: T }, (F, B) => this.createPdfPlaceholder(B + 1));
|
|
3135
|
+
} catch (T) {
|
|
3136
|
+
r.signal.aborted || (console.error("PDF load failed:", T), this.emit("error", {
|
|
3137
|
+
code: C === "load" ? "PDF_LOAD_FAILED" : "PDF_RENDER_FAILED",
|
|
3138
|
+
message: T instanceof Error ? T.message : "Unable to load PDF.",
|
|
3139
|
+
cause: T
|
|
3131
3140
|
}));
|
|
3132
3141
|
return;
|
|
3133
3142
|
}
|
|
3134
3143
|
}
|
|
3135
|
-
if (r.signal.aborted || o !== this.initGeneration || !
|
|
3136
|
-
this.store.init(this.options,
|
|
3137
|
-
let
|
|
3138
|
-
const b = { current: null }, D = { current: null }, $ =
|
|
3144
|
+
if (r.signal.aborted || o !== this.initGeneration || !h.length) return;
|
|
3145
|
+
this.store.init(this.options, h.length, h, !!t), Jt(this.container, this.options), this.container.innerHTML = "";
|
|
3146
|
+
let g, x, P;
|
|
3147
|
+
const b = { current: null }, D = { current: null }, $ = ai({
|
|
3139
3148
|
pageFlipAdapterRef: b,
|
|
3140
3149
|
interactionManagerRef: D,
|
|
3141
|
-
bookWrapperRef: (
|
|
3142
|
-
bookSizerRef: (
|
|
3143
|
-
bookContainerRef: (
|
|
3150
|
+
bookWrapperRef: (C) => g = C,
|
|
3151
|
+
bookSizerRef: (C) => x = C,
|
|
3152
|
+
bookContainerRef: (C) => P = C,
|
|
3144
3153
|
className: this.options.className,
|
|
3145
3154
|
store: this.store,
|
|
3146
3155
|
onToggleFullscreen: () => this.toggleFullscreen(),
|
|
@@ -3148,29 +3157,29 @@ const mt = class mt {
|
|
|
3148
3157
|
t && (this.options.onDownload ? this.options.onDownload(t) : window.open(t, "_blank"));
|
|
3149
3158
|
}
|
|
3150
3159
|
});
|
|
3151
|
-
this.container.appendChild($), this.setupQualityLoading(), this.layoutManager = new
|
|
3160
|
+
this.container.appendChild($), this.setupQualityLoading(), this.layoutManager = new gi(u, this.store), this.layoutManager.onResizeCallback = () => {
|
|
3152
3161
|
this.pageFlipAdapter && this.pageFlipAdapter.update();
|
|
3153
|
-
}, this.layoutManager.init(
|
|
3154
|
-
const
|
|
3155
|
-
r.signal.removeEventListener("abort",
|
|
3162
|
+
}, this.layoutManager.init(g, x), this.pageFlipAdapter = new ui(P, this.options, this.store), b.current = this.pageFlipAdapter, await new Promise((C) => {
|
|
3163
|
+
const T = () => {
|
|
3164
|
+
r.signal.removeEventListener("abort", T), C();
|
|
3156
3165
|
};
|
|
3157
|
-
r.signal.addEventListener("abort",
|
|
3158
|
-
if (this.initializationTimer = null, r.signal.removeEventListener("abort",
|
|
3159
|
-
|
|
3166
|
+
r.signal.addEventListener("abort", T, { once: !0 }), this.initializationTimer = setTimeout(async () => {
|
|
3167
|
+
if (this.initializationTimer = null, r.signal.removeEventListener("abort", T), r.signal.aborted || o !== this.initGeneration || !this.pageFlipAdapter) {
|
|
3168
|
+
C();
|
|
3160
3169
|
return;
|
|
3161
3170
|
}
|
|
3162
|
-
if (this.pageFlipAdapter.init(
|
|
3171
|
+
if (this.pageFlipAdapter.init(u.width, u.height), this.interactionManager = new pi(g, this.pageFlipAdapter, this.store), this.interactionManager.init(), D.current = this.interactionManager, this.setupPdfLazyLoading(), this.pdfRenderer && t)
|
|
3163
3172
|
try {
|
|
3164
3173
|
await this.renderPdfPage(1, r.signal);
|
|
3165
3174
|
} catch {
|
|
3166
|
-
|
|
3175
|
+
C();
|
|
3167
3176
|
return;
|
|
3168
3177
|
}
|
|
3169
3178
|
if (r.signal.aborted || o !== this.initGeneration) {
|
|
3170
|
-
|
|
3179
|
+
C();
|
|
3171
3180
|
return;
|
|
3172
3181
|
}
|
|
3173
|
-
this.eventsReady = !0, this.captureEventState(), this.emit("init", { totalPages:
|
|
3182
|
+
this.eventsReady = !0, this.captureEventState(), this.hasActiveSession = !0, this.emit("init", { totalPages: h.length }), C();
|
|
3174
3183
|
}, 10);
|
|
3175
3184
|
}), this.initAbortController === r && (this.initAbortController = null);
|
|
3176
3185
|
}
|
|
@@ -3187,35 +3196,36 @@ const mt = class mt {
|
|
|
3187
3196
|
};
|
|
3188
3197
|
}
|
|
3189
3198
|
renderPdfPage(t, s) {
|
|
3190
|
-
const o = this.pdfRenderer;
|
|
3199
|
+
const o = this.pdfRenderer, r = this.initGeneration;
|
|
3191
3200
|
if (!o) return Promise.resolve("");
|
|
3192
|
-
const
|
|
3193
|
-
if (
|
|
3201
|
+
const h = this.pdfPageRequests.get(t);
|
|
3202
|
+
if (h) return h;
|
|
3194
3203
|
if (this.pdfRenderedPages.has(t)) return Promise.resolve("");
|
|
3195
|
-
const
|
|
3196
|
-
var
|
|
3197
|
-
if (
|
|
3198
|
-
|
|
3199
|
-
|
|
3204
|
+
const u = o.renderPageToDataUrl(t, s).then((g) => {
|
|
3205
|
+
var x;
|
|
3206
|
+
if (r !== this.initGeneration || s != null && s.aborted) throw this.createAbortError();
|
|
3207
|
+
if (!g) throw new Error("PDF page " + t + " produced no image.");
|
|
3208
|
+
return this.pdfRenderedPages.add(t), (x = this.container) == null || x.querySelectorAll('img[data-pdf-page="' + t + '"]').forEach((P) => {
|
|
3209
|
+
P.src = g, delete P.dataset.pdfPage;
|
|
3200
3210
|
}), this.emit("progress", {
|
|
3201
3211
|
phase: "rendering",
|
|
3202
3212
|
completed: this.pdfRenderedPages.size,
|
|
3203
3213
|
total: this.store.totalPages.value
|
|
3204
|
-
}),
|
|
3205
|
-
}).catch((
|
|
3206
|
-
throw (
|
|
3214
|
+
}), g;
|
|
3215
|
+
}).catch((g) => {
|
|
3216
|
+
throw r !== this.initGeneration && (g == null ? void 0 : g.name) !== "AbortError" ? this.createAbortError() : ((g == null ? void 0 : g.name) === "AbortError" || this.emit("error", {
|
|
3207
3217
|
code: "PDF_RENDER_FAILED",
|
|
3208
|
-
message:
|
|
3209
|
-
cause:
|
|
3210
|
-
}),
|
|
3218
|
+
message: g instanceof Error ? g.message : "Unable to render PDF page.",
|
|
3219
|
+
cause: g
|
|
3220
|
+
}), g);
|
|
3211
3221
|
}).finally(() => {
|
|
3212
|
-
this.pdfPageRequests.get(t) ===
|
|
3222
|
+
this.pdfPageRequests.get(t) === u && this.pdfPageRequests.delete(t);
|
|
3213
3223
|
});
|
|
3214
|
-
return this.pdfPageRequests.set(t,
|
|
3224
|
+
return this.pdfPageRequests.set(t, u), u;
|
|
3215
3225
|
}
|
|
3216
3226
|
setupPdfLazyLoading() {
|
|
3217
3227
|
var t;
|
|
3218
|
-
(t = this.pdfLazyStop) == null || t.call(this), this.pdfLazyStop = null, this.pdfRenderer && (this.pdfLazyStop =
|
|
3228
|
+
(t = this.pdfLazyStop) == null || t.call(this), this.pdfLazyStop = null, this.pdfRenderer && (this.pdfLazyStop = G(() => {
|
|
3219
3229
|
const s = this.store.currentPage.value + 1, o = this.store.totalPages.value;
|
|
3220
3230
|
[s, s + 1].filter((r) => r <= o).forEach((r) => {
|
|
3221
3231
|
this.renderPdfPage(r).catch(() => {
|
|
@@ -3270,7 +3280,7 @@ const mt = class mt {
|
|
|
3270
3280
|
this.store.isSingleMode.value = t;
|
|
3271
3281
|
}
|
|
3272
3282
|
updateOptions(t) {
|
|
3273
|
-
this.options = { ...this.options, ...t }, t.theme !== void 0 && (this.store.themeMode.value = t.theme), t.primaryColor !== void 0 && (this.store.primaryColor.value = t.primaryColor), t.showThumbs !== void 0 && (this.store.showThumbs.value = t.showThumbs), t.showArrows !== void 0 && (this.store.showArrows.value = t.showArrows), t.allowDownload !== void 0 && (this.store.allowDownload.value = t.allowDownload), t.whiteLabel !== void 0 && (this.store.whiteLabel.value = t.whiteLabel), t.soundEnabled !== void 0 && (this.store.soundEnabled.value = t.soundEnabled), t.locale !== void 0 && (this.store.locale.value = t.locale), t.messages !== void 0 && (this.store.messages.value = t.messages), t.singleMode !== void 0 && (this.store.isSingleMode.value = t.singleMode), t.isSingleMode !== void 0 && (this.store.isSingleMode.value = t.isSingleMode), t.autoPlay !== void 0 && (this.store.isAutoPlaying.value = t.autoPlay), t.autoPlayInterval !== void 0 && (this.store.autoPlayInterval.value = t.autoPlayInterval), this.container &&
|
|
3283
|
+
this.options = { ...this.options, ...t }, t.theme !== void 0 && (this.store.themeMode.value = t.theme), t.primaryColor !== void 0 && (this.store.primaryColor.value = t.primaryColor), t.showThumbs !== void 0 && (this.store.showThumbs.value = t.showThumbs), t.showArrows !== void 0 && (this.store.showArrows.value = t.showArrows), t.allowDownload !== void 0 && (this.store.allowDownload.value = t.allowDownload), t.whiteLabel !== void 0 && (this.store.whiteLabel.value = t.whiteLabel), t.soundEnabled !== void 0 && (this.store.soundEnabled.value = t.soundEnabled), t.locale !== void 0 && (this.store.locale.value = t.locale), t.messages !== void 0 && (this.store.messages.value = t.messages), t.singleMode !== void 0 && (this.store.isSingleMode.value = t.singleMode), t.isSingleMode !== void 0 && (this.store.isSingleMode.value = t.isSingleMode), t.autoPlay !== void 0 && (this.store.isAutoPlaying.value = t.autoPlay), t.autoPlayInterval !== void 0 && (this.store.autoPlayInterval.value = t.autoPlayInterval), this.container && Jt(this.container, this.options);
|
|
3274
3284
|
}
|
|
3275
3285
|
async setPages(t, s) {
|
|
3276
3286
|
if (!(t != null && t.length)) {
|
|
@@ -3282,32 +3292,32 @@ const mt = class mt {
|
|
|
3282
3292
|
setupQualityLoading() {
|
|
3283
3293
|
var r;
|
|
3284
3294
|
if (this.teardownQualityLoading(), !this.container) return;
|
|
3285
|
-
const t = Array.from(this.container.querySelectorAll("img[data-src], img[data-pdf-page]")), s = (
|
|
3286
|
-
const
|
|
3287
|
-
if (Number.isInteger(
|
|
3288
|
-
this.renderPdfPage(
|
|
3295
|
+
const t = Array.from(this.container.querySelectorAll("img[data-src], img[data-pdf-page]")), s = (h) => {
|
|
3296
|
+
const u = Number(h.dataset.pdfPage);
|
|
3297
|
+
if (Number.isInteger(u) && u > 0) {
|
|
3298
|
+
this.renderPdfPage(u).catch(() => {
|
|
3289
3299
|
});
|
|
3290
3300
|
return;
|
|
3291
3301
|
}
|
|
3292
|
-
const
|
|
3293
|
-
|
|
3302
|
+
const g = h.dataset.src;
|
|
3303
|
+
g && (h.src = g, delete h.dataset.src);
|
|
3294
3304
|
}, o = (r = this.container.ownerDocument.defaultView) == null ? void 0 : r.IntersectionObserver;
|
|
3295
3305
|
if (!o) {
|
|
3296
|
-
const
|
|
3297
|
-
t.forEach((
|
|
3298
|
-
const
|
|
3299
|
-
Number.isInteger(
|
|
3306
|
+
const h = /* @__PURE__ */ new Set();
|
|
3307
|
+
t.forEach((u) => {
|
|
3308
|
+
const g = Number(u.dataset.pdfPage);
|
|
3309
|
+
Number.isInteger(g) && g > 0 ? h.size < 2 && (h.add(g), s(u)) : s(u);
|
|
3300
3310
|
});
|
|
3301
3311
|
return;
|
|
3302
3312
|
}
|
|
3303
|
-
this.qualityObserver = new o((
|
|
3304
|
-
|
|
3305
|
-
var
|
|
3306
|
-
|
|
3313
|
+
this.qualityObserver = new o((h) => {
|
|
3314
|
+
h.forEach((u) => {
|
|
3315
|
+
var g;
|
|
3316
|
+
u.isIntersecting && (s(u.target), (g = this.qualityObserver) == null || g.unobserve(u.target));
|
|
3307
3317
|
});
|
|
3308
|
-
}, { root: this.container, rootMargin: "240px" }), t.forEach((
|
|
3309
|
-
var
|
|
3310
|
-
return (
|
|
3318
|
+
}, { root: this.container, rootMargin: "240px" }), t.forEach((h) => {
|
|
3319
|
+
var u;
|
|
3320
|
+
return (u = this.qualityObserver) == null ? void 0 : u.observe(h);
|
|
3311
3321
|
});
|
|
3312
3322
|
}
|
|
3313
3323
|
teardownQualityLoading() {
|
|
@@ -3315,7 +3325,7 @@ const mt = class mt {
|
|
|
3315
3325
|
(t = this.qualityObserver) == null || t.disconnect(), this.qualityObserver = null;
|
|
3316
3326
|
}
|
|
3317
3327
|
setupEventSync() {
|
|
3318
|
-
this.eventSyncStop =
|
|
3328
|
+
this.eventSyncStop = G(() => {
|
|
3319
3329
|
const t = {
|
|
3320
3330
|
currentPage: this.store.currentPage.value,
|
|
3321
3331
|
zoom: this.store.zoomState.value.scale,
|
|
@@ -3347,8 +3357,13 @@ const mt = class mt {
|
|
|
3347
3357
|
};
|
|
3348
3358
|
}
|
|
3349
3359
|
destroy(t = !1) {
|
|
3350
|
-
var
|
|
3351
|
-
|
|
3360
|
+
var o, r;
|
|
3361
|
+
const s = this.hasActiveSession || !!this.initAbortController || !!this.pageFlipAdapter || !!this.layoutManager || !!this.interactionManager || !!this.pdfRenderer;
|
|
3362
|
+
this.initGeneration++, (o = this.initAbortController) == null || o.abort(), this.initAbortController = null, this.initializationTimer && (clearTimeout(this.initializationTimer), this.initializationTimer = null), this.pageFlipAdapter && this.pageFlipAdapter.destroy(), this.layoutManager && this.layoutManager.destroy(), this.interactionManager && this.interactionManager.destroy(), this.teardownQualityLoading(), (r = this.pdfLazyStop) == null || r.call(this), this.pdfLazyStop = null, this.pdfPageRequests.clear(), this.pdfRenderedPages.clear(), this.pdfRenderer && this.pdfRenderer.destroy(), this.pageFlipAdapter = null, this.layoutManager = null, this.interactionManager = null, this.pdfRenderer = null, this.eventsReady = !1, this.hasActiveSession = !1, this.store.reset(), !t && this.container && (this.container.innerHTML = ""), s && this.emit("destroy", void 0);
|
|
3363
|
+
}
|
|
3364
|
+
createAbortError() {
|
|
3365
|
+
const t = new Error("Flipbook initialization was aborted.");
|
|
3366
|
+
return t.name = "AbortError", t;
|
|
3352
3367
|
}
|
|
3353
3368
|
on(t, s) {
|
|
3354
3369
|
const o = this.listeners[t] ?? /* @__PURE__ */ new Set();
|
|
@@ -3367,12 +3382,12 @@ const mt = class mt {
|
|
|
3367
3382
|
};
|
|
3368
3383
|
m(mt, "DEFAULT_PAGE_VIEWPORT", { width: 420, height: 594 });
|
|
3369
3384
|
let Rt = mt;
|
|
3370
|
-
const
|
|
3371
|
-
|
|
3372
|
-
|
|
3385
|
+
const we = globalThis, ve = we.FlipbookEngine || {};
|
|
3386
|
+
ve.FlipbookEngine = Rt;
|
|
3387
|
+
we.FlipbookEngine = ve;
|
|
3373
3388
|
export {
|
|
3374
3389
|
Rt as F,
|
|
3375
3390
|
fi as i,
|
|
3376
3391
|
vi as n
|
|
3377
3392
|
};
|
|
3378
|
-
//# sourceMappingURL=engine-
|
|
3393
|
+
//# sourceMappingURL=engine-7jWE07Zq.js.map
|