@netless/app-slide 0.3.0-canary.19 → 0.3.0-canary.20
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/dist/SlideViewer/index.d.ts +4 -4
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/dist/main.mjs +557 -538
- package/dist/main.mjs.map +1 -1
- package/package.json +2 -2
- package/src/SlideViewer/index.ts +18 -17
- package/src/connect.ts +33 -27
- package/src/index.ts +1 -0
- package/src/style.scss +6 -1
package/dist/main.mjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
var yt = Object.defineProperty;
|
|
2
|
+
var kt = (e, t, s) => t in e ? yt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var u = (e, t, s) => (kt(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
1
4
|
import { Slide as ue } from "@netless/slide";
|
|
2
|
-
import { Slide as
|
|
3
|
-
const
|
|
4
|
-
for (let e = 0; e <
|
|
5
|
-
Ae[e] =
|
|
5
|
+
import { Slide as mr } from "@netless/slide";
|
|
6
|
+
const St = "!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", xt = 87, Et = 20, Ae = [], Ct = () => {
|
|
7
|
+
for (let e = 0; e < Et; e++)
|
|
8
|
+
Ae[e] = St.charAt(Math.random() * xt);
|
|
6
9
|
return Ae.join("");
|
|
7
10
|
};
|
|
8
11
|
function Pe(e) {
|
|
@@ -17,24 +20,24 @@ class De {
|
|
|
17
20
|
this.push = this.addDisposer, this.disposers = /* @__PURE__ */ new Map();
|
|
18
21
|
}
|
|
19
22
|
addDisposer(t, s = this.genUID()) {
|
|
20
|
-
return this.flush(s), this.disposers.set(s, Array.isArray(t) ?
|
|
23
|
+
return this.flush(s), this.disposers.set(s, Array.isArray(t) ? At(t) : t), s;
|
|
21
24
|
}
|
|
22
25
|
add(t, s = this.genUID()) {
|
|
23
26
|
const r = t();
|
|
24
27
|
return r ? this.addDisposer(r, s) : s;
|
|
25
28
|
}
|
|
26
|
-
addEventListener(t, s, r,
|
|
27
|
-
return t.addEventListener(s, r,
|
|
29
|
+
addEventListener(t, s, r, o, i = this.genUID()) {
|
|
30
|
+
return t.addEventListener(s, r, o), this.addDisposer(() => t.removeEventListener(s, r, o), i), i;
|
|
28
31
|
}
|
|
29
32
|
setTimeout(t, s, r = this.genUID()) {
|
|
30
|
-
const
|
|
33
|
+
const o = window.setTimeout(() => {
|
|
31
34
|
this.remove(r), t();
|
|
32
35
|
}, s);
|
|
33
|
-
return this.addDisposer(() => window.clearTimeout(
|
|
36
|
+
return this.addDisposer(() => window.clearTimeout(o), r);
|
|
34
37
|
}
|
|
35
38
|
setInterval(t, s, r = this.genUID()) {
|
|
36
|
-
const
|
|
37
|
-
return this.addDisposer(() => window.clearInterval(
|
|
39
|
+
const o = window.setInterval(t, s);
|
|
40
|
+
return this.addDisposer(() => window.clearInterval(o), r);
|
|
38
41
|
}
|
|
39
42
|
remove(t) {
|
|
40
43
|
const s = this.disposers.get(t);
|
|
@@ -50,18 +53,21 @@ class De {
|
|
|
50
53
|
genUID() {
|
|
51
54
|
let t;
|
|
52
55
|
do
|
|
53
|
-
t =
|
|
56
|
+
t = Ct();
|
|
54
57
|
while (this.disposers.has(t));
|
|
55
58
|
return t;
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
|
-
function
|
|
61
|
+
function At(e) {
|
|
59
62
|
return () => e.forEach(Pe);
|
|
60
63
|
}
|
|
61
|
-
const
|
|
62
|
-
class
|
|
64
|
+
const D = "netless-app-slide", Fe = "https://convertcdn.netless.link/dynamicConvert";
|
|
65
|
+
class It {
|
|
63
66
|
constructor() {
|
|
64
|
-
this
|
|
67
|
+
u(this, "threshold", 2);
|
|
68
|
+
u(this, "_map", /* @__PURE__ */ new Map());
|
|
69
|
+
u(this, "_box", /* @__PURE__ */ new Map());
|
|
70
|
+
u(this, "_queue", []);
|
|
65
71
|
}
|
|
66
72
|
set(t, s, r) {
|
|
67
73
|
return this._map.set(t, s), this._box.set(t, r), this._queue.includes(t) || this._queue.unshift(t), this._refresh(), () => {
|
|
@@ -78,29 +84,29 @@ class Et {
|
|
|
78
84
|
_refresh() {
|
|
79
85
|
let t;
|
|
80
86
|
this._queue.sort((s, r) => {
|
|
81
|
-
var
|
|
82
|
-
const
|
|
83
|
-
return -(
|
|
87
|
+
var n, a;
|
|
88
|
+
const o = ((n = this._box.get(s)) == null ? void 0 : n.zIndex) ?? 0, i = ((a = this._box.get(r)) == null ? void 0 : a.zIndex) ?? 0;
|
|
89
|
+
return -(o - i);
|
|
84
90
|
}), this._queue.forEach((s, r) => {
|
|
85
91
|
(t = this._map.get(s)) && (r < this.threshold ? t.unfreeze() : t.freeze());
|
|
86
92
|
});
|
|
87
93
|
}
|
|
88
94
|
}
|
|
89
|
-
const Re = new
|
|
95
|
+
const Re = new It(), dr = function(t) {
|
|
90
96
|
t.on("focus", (s) => {
|
|
91
97
|
Re.focus(s.appId);
|
|
92
98
|
});
|
|
93
99
|
};
|
|
94
|
-
class
|
|
100
|
+
class zt {
|
|
95
101
|
constructor() {
|
|
96
102
|
this.a = /* @__PURE__ */ new Map(), this.b = /* @__PURE__ */ new Set();
|
|
97
103
|
}
|
|
98
104
|
emit(t, s) {
|
|
99
105
|
const r = this.a.get(t);
|
|
100
106
|
if (r)
|
|
101
|
-
for (const
|
|
107
|
+
for (const o of r)
|
|
102
108
|
try {
|
|
103
|
-
|
|
109
|
+
o(s);
|
|
104
110
|
} catch (i) {
|
|
105
111
|
console.error(i);
|
|
106
112
|
}
|
|
@@ -108,27 +114,27 @@ class Ct {
|
|
|
108
114
|
on(t, s) {
|
|
109
115
|
let r = this.a.get(t);
|
|
110
116
|
if (r || (r = /* @__PURE__ */ new Set(), this.a.set(t, r)), r.add(s), r.size === 1)
|
|
111
|
-
for (const
|
|
112
|
-
|
|
117
|
+
for (const o of this.b)
|
|
118
|
+
o.e(t);
|
|
113
119
|
return () => {
|
|
114
120
|
this.off(t, s);
|
|
115
121
|
};
|
|
116
122
|
}
|
|
117
123
|
once(t, s) {
|
|
118
|
-
const r = (
|
|
124
|
+
const r = (o) => (this.off(t, s), s(o));
|
|
119
125
|
return this.c = this.c || /* @__PURE__ */ new WeakMap(), this.c.set(s, r), this.on(t, r);
|
|
120
126
|
}
|
|
121
127
|
off(t, s) {
|
|
122
128
|
var r;
|
|
123
|
-
const
|
|
124
|
-
if (
|
|
125
|
-
const i =
|
|
129
|
+
const o = this.a.get(t);
|
|
130
|
+
if (o) {
|
|
131
|
+
const i = o.delete(
|
|
126
132
|
((r = this.c) == null ? void 0 : r.get(s)) || s
|
|
127
133
|
);
|
|
128
|
-
if (
|
|
134
|
+
if (o.size <= 0) {
|
|
129
135
|
this.a.delete(t);
|
|
130
|
-
for (const
|
|
131
|
-
|
|
136
|
+
for (const n of this.b)
|
|
137
|
+
n.d(t);
|
|
132
138
|
}
|
|
133
139
|
return i;
|
|
134
140
|
}
|
|
@@ -144,27 +150,27 @@ class Ct {
|
|
|
144
150
|
return ((s = this.a.get(t)) == null ? void 0 : s.size) || 0;
|
|
145
151
|
{
|
|
146
152
|
let r = 0;
|
|
147
|
-
for (const
|
|
148
|
-
r +=
|
|
153
|
+
for (const o of this.a.values())
|
|
154
|
+
r += o.size;
|
|
149
155
|
return r;
|
|
150
156
|
}
|
|
151
157
|
}
|
|
152
158
|
remit(t, s) {
|
|
153
159
|
var r;
|
|
154
|
-
let
|
|
160
|
+
let o;
|
|
155
161
|
const i = {
|
|
156
|
-
e: (
|
|
157
|
-
if (
|
|
162
|
+
e: (n) => {
|
|
163
|
+
if (n === t)
|
|
158
164
|
try {
|
|
159
|
-
|
|
165
|
+
o = s(this);
|
|
160
166
|
} catch (a) {
|
|
161
167
|
console.error(a);
|
|
162
168
|
}
|
|
163
169
|
},
|
|
164
|
-
d: (
|
|
165
|
-
if (
|
|
170
|
+
d: (n) => {
|
|
171
|
+
if (o && (!n || n === t))
|
|
166
172
|
try {
|
|
167
|
-
|
|
173
|
+
o();
|
|
168
174
|
} catch (a) {
|
|
169
175
|
console.error(a);
|
|
170
176
|
}
|
|
@@ -181,14 +187,14 @@ class Ct {
|
|
|
181
187
|
this.b.clear();
|
|
182
188
|
}
|
|
183
189
|
}
|
|
184
|
-
var pe = {},
|
|
190
|
+
var pe = {}, $t = {
|
|
185
191
|
get exports() {
|
|
186
192
|
return pe;
|
|
187
193
|
},
|
|
188
194
|
set exports(e) {
|
|
189
195
|
pe = e;
|
|
190
196
|
}
|
|
191
|
-
},
|
|
197
|
+
}, Lt = {
|
|
192
198
|
aliceblue: [240, 248, 255],
|
|
193
199
|
antiquewhite: [250, 235, 215],
|
|
194
200
|
aqua: [0, 255, 255],
|
|
@@ -337,19 +343,19 @@ var pe = {}, At = {
|
|
|
337
343
|
whitesmoke: [245, 245, 245],
|
|
338
344
|
yellow: [255, 255, 0],
|
|
339
345
|
yellowgreen: [154, 205, 50]
|
|
340
|
-
}, he = {},
|
|
346
|
+
}, he = {}, Mt = {
|
|
341
347
|
get exports() {
|
|
342
348
|
return he;
|
|
343
349
|
},
|
|
344
350
|
set exports(e) {
|
|
345
351
|
he = e;
|
|
346
352
|
}
|
|
347
|
-
},
|
|
353
|
+
}, Nt = function(t) {
|
|
348
354
|
return !t || typeof t == "string" ? !1 : t instanceof Array || Array.isArray(t) || t.length >= 0 && (t.splice instanceof Function || Object.getOwnPropertyDescriptor(t, t.length - 1) && t.constructor.name !== "String");
|
|
349
|
-
},
|
|
350
|
-
for (var s = [], r = 0,
|
|
355
|
+
}, Ot = Nt, Tt = Array.prototype.concat, Pt = Array.prototype.slice, Ie = Mt.exports = function(t) {
|
|
356
|
+
for (var s = [], r = 0, o = t.length; r < o; r++) {
|
|
351
357
|
var i = t[r];
|
|
352
|
-
|
|
358
|
+
Ot(i) ? s = Tt.call(s, Pt.call(i)) : s.push(i);
|
|
353
359
|
}
|
|
354
360
|
return s;
|
|
355
361
|
};
|
|
@@ -358,138 +364,138 @@ Ie.wrap = function(e) {
|
|
|
358
364
|
return e(Ie(arguments));
|
|
359
365
|
};
|
|
360
366
|
};
|
|
361
|
-
var
|
|
362
|
-
for (var de in
|
|
363
|
-
Ve.call(
|
|
364
|
-
var
|
|
367
|
+
var Z = Lt, Q = he, Ve = Object.hasOwnProperty, Ue = /* @__PURE__ */ Object.create(null);
|
|
368
|
+
for (var de in Z)
|
|
369
|
+
Ve.call(Z, de) && (Ue[Z[de]] = de);
|
|
370
|
+
var C = $t.exports = {
|
|
365
371
|
to: {},
|
|
366
372
|
get: {}
|
|
367
373
|
};
|
|
368
|
-
|
|
374
|
+
C.get = function(e) {
|
|
369
375
|
var t = e.substring(0, 3).toLowerCase(), s, r;
|
|
370
376
|
switch (t) {
|
|
371
377
|
case "hsl":
|
|
372
|
-
s =
|
|
378
|
+
s = C.get.hsl(e), r = "hsl";
|
|
373
379
|
break;
|
|
374
380
|
case "hwb":
|
|
375
|
-
s =
|
|
381
|
+
s = C.get.hwb(e), r = "hwb";
|
|
376
382
|
break;
|
|
377
383
|
default:
|
|
378
|
-
s =
|
|
384
|
+
s = C.get.rgb(e), r = "rgb";
|
|
379
385
|
break;
|
|
380
386
|
}
|
|
381
387
|
return s ? { model: r, value: s } : null;
|
|
382
388
|
};
|
|
383
|
-
|
|
389
|
+
C.get.rgb = function(e) {
|
|
384
390
|
if (!e)
|
|
385
391
|
return null;
|
|
386
|
-
var t = /^#([a-f0-9]{3,4})$/i, s = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i, r = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,
|
|
392
|
+
var t = /^#([a-f0-9]{3,4})$/i, s = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i, r = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, o = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, i = /^(\w+)$/, n = [0, 0, 0, 1], a, l, d;
|
|
387
393
|
if (a = e.match(s)) {
|
|
388
|
-
for (
|
|
394
|
+
for (d = a[2], a = a[1], l = 0; l < 3; l++) {
|
|
389
395
|
var b = l * 2;
|
|
390
|
-
|
|
396
|
+
n[l] = parseInt(a.slice(b, b + 2), 16);
|
|
391
397
|
}
|
|
392
|
-
|
|
398
|
+
d && (n[3] = parseInt(d, 16) / 255);
|
|
393
399
|
} else if (a = e.match(t)) {
|
|
394
|
-
for (a = a[1],
|
|
395
|
-
|
|
396
|
-
|
|
400
|
+
for (a = a[1], d = a[3], l = 0; l < 3; l++)
|
|
401
|
+
n[l] = parseInt(a[l] + a[l], 16);
|
|
402
|
+
d && (n[3] = parseInt(d + d, 16) / 255);
|
|
397
403
|
} else if (a = e.match(r)) {
|
|
398
404
|
for (l = 0; l < 3; l++)
|
|
399
|
-
|
|
400
|
-
a[4] && (a[5] ?
|
|
401
|
-
} else if (a = e.match(
|
|
405
|
+
n[l] = parseInt(a[l + 1], 0);
|
|
406
|
+
a[4] && (a[5] ? n[3] = parseFloat(a[4]) * 0.01 : n[3] = parseFloat(a[4]));
|
|
407
|
+
} else if (a = e.match(o)) {
|
|
402
408
|
for (l = 0; l < 3; l++)
|
|
403
|
-
|
|
404
|
-
a[4] && (a[5] ?
|
|
409
|
+
n[l] = Math.round(parseFloat(a[l + 1]) * 2.55);
|
|
410
|
+
a[4] && (a[5] ? n[3] = parseFloat(a[4]) * 0.01 : n[3] = parseFloat(a[4]));
|
|
405
411
|
} else
|
|
406
|
-
return (a = e.match(i)) ? a[1] === "transparent" ? [0, 0, 0, 0] : Ve.call(
|
|
412
|
+
return (a = e.match(i)) ? a[1] === "transparent" ? [0, 0, 0, 0] : Ve.call(Z, a[1]) ? (n = Z[a[1]], n[3] = 1, n) : null : null;
|
|
407
413
|
for (l = 0; l < 3; l++)
|
|
408
|
-
|
|
409
|
-
return
|
|
414
|
+
n[l] = R(n[l], 0, 255);
|
|
415
|
+
return n[3] = R(n[3], 0, 1), n;
|
|
410
416
|
};
|
|
411
|
-
|
|
417
|
+
C.get.hsl = function(e) {
|
|
412
418
|
if (!e)
|
|
413
419
|
return null;
|
|
414
420
|
var t = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, s = e.match(t);
|
|
415
421
|
if (s) {
|
|
416
|
-
var r = parseFloat(s[4]),
|
|
417
|
-
return [
|
|
422
|
+
var r = parseFloat(s[4]), o = (parseFloat(s[1]) % 360 + 360) % 360, i = R(parseFloat(s[2]), 0, 100), n = R(parseFloat(s[3]), 0, 100), a = R(isNaN(r) ? 1 : r, 0, 1);
|
|
423
|
+
return [o, i, n, a];
|
|
418
424
|
}
|
|
419
425
|
return null;
|
|
420
426
|
};
|
|
421
|
-
|
|
427
|
+
C.get.hwb = function(e) {
|
|
422
428
|
if (!e)
|
|
423
429
|
return null;
|
|
424
430
|
var t = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, s = e.match(t);
|
|
425
431
|
if (s) {
|
|
426
|
-
var r = parseFloat(s[4]),
|
|
427
|
-
return [
|
|
432
|
+
var r = parseFloat(s[4]), o = (parseFloat(s[1]) % 360 + 360) % 360, i = R(parseFloat(s[2]), 0, 100), n = R(parseFloat(s[3]), 0, 100), a = R(isNaN(r) ? 1 : r, 0, 1);
|
|
433
|
+
return [o, i, n, a];
|
|
428
434
|
}
|
|
429
435
|
return null;
|
|
430
436
|
};
|
|
431
|
-
|
|
432
|
-
var e =
|
|
433
|
-
return "#" +
|
|
437
|
+
C.to.hex = function() {
|
|
438
|
+
var e = Q(arguments);
|
|
439
|
+
return "#" + re(e[0]) + re(e[1]) + re(e[2]) + (e[3] < 1 ? re(Math.round(e[3] * 255)) : "");
|
|
434
440
|
};
|
|
435
|
-
|
|
436
|
-
var e =
|
|
441
|
+
C.to.rgb = function() {
|
|
442
|
+
var e = Q(arguments);
|
|
437
443
|
return e.length < 4 || e[3] === 1 ? "rgb(" + Math.round(e[0]) + ", " + Math.round(e[1]) + ", " + Math.round(e[2]) + ")" : "rgba(" + Math.round(e[0]) + ", " + Math.round(e[1]) + ", " + Math.round(e[2]) + ", " + e[3] + ")";
|
|
438
444
|
};
|
|
439
|
-
|
|
440
|
-
var e =
|
|
445
|
+
C.to.rgb.percent = function() {
|
|
446
|
+
var e = Q(arguments), t = Math.round(e[0] / 255 * 100), s = Math.round(e[1] / 255 * 100), r = Math.round(e[2] / 255 * 100);
|
|
441
447
|
return e.length < 4 || e[3] === 1 ? "rgb(" + t + "%, " + s + "%, " + r + "%)" : "rgba(" + t + "%, " + s + "%, " + r + "%, " + e[3] + ")";
|
|
442
448
|
};
|
|
443
|
-
|
|
444
|
-
var e =
|
|
449
|
+
C.to.hsl = function() {
|
|
450
|
+
var e = Q(arguments);
|
|
445
451
|
return e.length < 4 || e[3] === 1 ? "hsl(" + e[0] + ", " + e[1] + "%, " + e[2] + "%)" : "hsla(" + e[0] + ", " + e[1] + "%, " + e[2] + "%, " + e[3] + ")";
|
|
446
452
|
};
|
|
447
|
-
|
|
448
|
-
var e =
|
|
453
|
+
C.to.hwb = function() {
|
|
454
|
+
var e = Q(arguments), t = "";
|
|
449
455
|
return e.length >= 4 && e[3] !== 1 && (t = ", " + e[3]), "hwb(" + e[0] + ", " + e[1] + "%, " + e[2] + "%" + t + ")";
|
|
450
456
|
};
|
|
451
|
-
|
|
457
|
+
C.to.keyword = function(e) {
|
|
452
458
|
return Ue[e.slice(0, 3)];
|
|
453
459
|
};
|
|
454
|
-
function
|
|
460
|
+
function R(e, t, s) {
|
|
455
461
|
return Math.min(Math.max(t, e), s);
|
|
456
462
|
}
|
|
457
|
-
function
|
|
463
|
+
function re(e) {
|
|
458
464
|
var t = Math.round(e).toString(16).toUpperCase();
|
|
459
465
|
return t.length < 2 ? "0" + t : t;
|
|
460
466
|
}
|
|
461
|
-
function
|
|
467
|
+
function G() {
|
|
462
468
|
}
|
|
463
|
-
function
|
|
469
|
+
function oe(e) {
|
|
464
470
|
return document.createElement(e);
|
|
465
471
|
}
|
|
466
|
-
function
|
|
467
|
-
const s =
|
|
468
|
-
return
|
|
472
|
+
function y(e, t) {
|
|
473
|
+
const s = oe(e);
|
|
474
|
+
return Dt(s, t), s;
|
|
469
475
|
}
|
|
470
|
-
function
|
|
476
|
+
function q(e, t) {
|
|
471
477
|
return e.appendChild(t);
|
|
472
478
|
}
|
|
473
|
-
function
|
|
474
|
-
return `${
|
|
479
|
+
function _(e) {
|
|
480
|
+
return `${D}-${e}`;
|
|
475
481
|
}
|
|
476
|
-
function
|
|
477
|
-
e.className =
|
|
482
|
+
function Dt(e, t) {
|
|
483
|
+
e.className = _(t);
|
|
478
484
|
}
|
|
479
|
-
function
|
|
485
|
+
function Ft(e) {
|
|
480
486
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
481
487
|
}
|
|
482
488
|
function ze(e, t) {
|
|
483
489
|
if (typeof e == "object" && e !== null)
|
|
484
490
|
return e[t];
|
|
485
491
|
}
|
|
486
|
-
function
|
|
492
|
+
function $e() {
|
|
487
493
|
let e;
|
|
488
494
|
return [new Promise((s) => {
|
|
489
495
|
e = s;
|
|
490
496
|
}), e];
|
|
491
497
|
}
|
|
492
|
-
function
|
|
498
|
+
function Rt(e) {
|
|
493
499
|
const t = e.room, s = e.displayer;
|
|
494
500
|
return t ? () => t.calibrationTimestamp : s ? () => s.beginTimestamp + s.progressTime : () => Date.now();
|
|
495
501
|
}
|
|
@@ -497,41 +503,41 @@ function Be(e) {
|
|
|
497
503
|
try {
|
|
498
504
|
let t = window.getComputedStyle(e).backgroundColor;
|
|
499
505
|
if (t !== "rgba(0, 0, 0, 0)" && t !== "transparent")
|
|
500
|
-
return t =
|
|
506
|
+
return t = Vt(t), console.log("[Slide] guess bg color:", t), t;
|
|
501
507
|
if (e.parentElement)
|
|
502
508
|
return Be(e.parentElement);
|
|
503
509
|
} catch {
|
|
504
510
|
}
|
|
505
511
|
return "#ffffff";
|
|
506
512
|
}
|
|
507
|
-
function
|
|
513
|
+
function Vt(e) {
|
|
508
514
|
const t = pe.get(e);
|
|
509
515
|
if (t && t.model === "rgb") {
|
|
510
|
-
const s = t.value,
|
|
511
|
-
return "#" + "000000".substring(
|
|
516
|
+
const s = t.value, o = (((Math.round(s[0]) & 255) << 16) + ((Math.round(s[1]) & 255) << 8) + (Math.round(s[2]) & 255)).toString(16);
|
|
517
|
+
return "#" + "000000".substring(o.length) + o;
|
|
512
518
|
} else
|
|
513
519
|
return e;
|
|
514
520
|
}
|
|
515
|
-
function
|
|
516
|
-
return `${
|
|
521
|
+
function qe(e, t) {
|
|
522
|
+
return `${Ft(t || Fe)}/${e}`;
|
|
517
523
|
}
|
|
518
|
-
async function
|
|
519
|
-
const s =
|
|
524
|
+
async function Ut({ taskId: e, url: t }) {
|
|
525
|
+
const s = qe(e, t), r = `${s}/preview/1.png`, o = `${s}/jsonOutput/slide-1.json`, i = new Promise((a) => {
|
|
520
526
|
const l = new Image();
|
|
521
527
|
l.onload = () => a(l), l.onerror = () => a(null), l.src = r;
|
|
522
|
-
}),
|
|
523
|
-
return { preview: await i, slide: await
|
|
528
|
+
}), n = fetch(o).then((a) => a.json());
|
|
529
|
+
return { preview: await i, slide: await n };
|
|
524
530
|
}
|
|
525
|
-
function
|
|
531
|
+
function Bt(e) {
|
|
526
532
|
if (typeof document < "u") {
|
|
527
533
|
const t = () => e(document.visibilityState === "visible");
|
|
528
534
|
return document.addEventListener("visibilitychange", t), () => document.removeEventListener("visibilitychange", t);
|
|
529
535
|
}
|
|
530
|
-
return
|
|
536
|
+
return G;
|
|
531
537
|
}
|
|
532
|
-
const
|
|
538
|
+
const qt = `.netless-app-slide-tele-fancy-scrollbar{overscroll-behavior:contain;overflow:auto;overflow-y:scroll;overflow-y:overlay;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;scrollbar-width:auto}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar{height:8px;width:8px}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-track{background-color:transparent}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb{background-color:#444e601a;background-color:transparent;border-radius:4px;transition:background-color .4s}.netless-app-slide-tele-fancy-scrollbar:hover::-webkit-scrollbar-thumb{background-color:#444e601a}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb:hover{background-color:#444e6033}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb:active{background-color:#444e6033}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb:vertical{min-height:50px}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb:horizontal{min-width:50px}.netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-slide{width:100%;height:100%;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:10200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:10300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.netless-app-slide-overlay{display:flex;align-items:center;justify-content:center;position:absolute;z-index:10100;top:0;left:0;width:100%;height:100%;padding:10px;box-sizing:border-box;background:rgba(255,0,0,.25);transition:opacity .3s;opacity:0;pointer-events:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{display:flex;align-items:center;height:26px;margin-left:auto;font-size:13px;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;word-break:keep-all;font-variant-numeric:tabular-nums}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 .5em 0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;border-radius:2px;color:currentColor;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";background:transparent;transition:background .4s;font-variant-numeric:tabular-nums;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{user-select:text;background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly .netless-app-slide-footer-btn{cursor:not-allowed}.netless-app-slide-readonly .netless-app-slide-footer-btn:hover{background:transparent}.netless-app-slide-readonly .netless-app-slide-page-number-input{cursor:not-allowed}.netless-app-slide-readonly .netless-app-slide-page-number-input:hover,.netless-app-slide-readonly .netless-app-slide-page-number-input:focus,.netless-app-slide-readonly .netless-app-slide-page-number-input:active{background:transparent;box-shadow:none}.netless-app-slide-readonly .netless-app-slide-page-number-input:disabled{color:inherit}.netless-app-slide-readonly.netless-app-slide-float-footer,.netless-app-slide-wb-view-hidden{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:currentColor;background:#25282e}.telebox-color-scheme-dark .netless-app-slide-footer{border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-preview-wrapper{width:100%;height:100%;overflow:hidden;display:flex;flex-flow:column nowrap}.netless-app-slide-preview-wrapper .netless-app-slide-content{flex:1}.netless-app-slide-preview-wrapper .netless-app-slide-footer{flex-shrink:0}
|
|
533
539
|
`;
|
|
534
|
-
function
|
|
540
|
+
function Ht(e) {
|
|
535
541
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
536
542
|
s.setAttribute("class", `${e}-footer-icon-sidebar`), s.setAttribute("viewBox", "0 0 64 64");
|
|
537
543
|
const r = document.createElementNS(t, "path");
|
|
@@ -540,7 +546,7 @@ function Ut(e) {
|
|
|
540
546
|
"M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"
|
|
541
547
|
), s.appendChild(r), s;
|
|
542
548
|
}
|
|
543
|
-
function
|
|
549
|
+
function jt(e) {
|
|
544
550
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
545
551
|
s.setAttribute("class", `${e}-footer-icon-arrow-left`), s.setAttribute("viewBox", "0 0 500 500");
|
|
546
552
|
const r = document.createElementNS(t, "path");
|
|
@@ -549,7 +555,7 @@ function Bt(e) {
|
|
|
549
555
|
"M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"
|
|
550
556
|
), s.appendChild(r), s;
|
|
551
557
|
}
|
|
552
|
-
function
|
|
558
|
+
function Gt(e) {
|
|
553
559
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
554
560
|
s.setAttribute("class", `${e}-footer-icon-play`), s.setAttribute("viewBox", "0 0 500 500");
|
|
555
561
|
const r = document.createElementNS(t, "path");
|
|
@@ -558,7 +564,7 @@ function Ht(e) {
|
|
|
558
564
|
"M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"
|
|
559
565
|
), s.appendChild(r), s;
|
|
560
566
|
}
|
|
561
|
-
function
|
|
567
|
+
function Wt(e) {
|
|
562
568
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
563
569
|
s.setAttribute("class", `${e}-footer-icon-pause`), s.setAttribute("viewBox", "0 0 500 500");
|
|
564
570
|
const r = document.createElementNS(t, "path");
|
|
@@ -567,7 +573,7 @@ function qt(e) {
|
|
|
567
573
|
"M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"
|
|
568
574
|
), s.appendChild(r), s;
|
|
569
575
|
}
|
|
570
|
-
function
|
|
576
|
+
function Jt(e) {
|
|
571
577
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
572
578
|
s.setAttribute("class", `${e}-footer-icon-arrow-right`), s.setAttribute("viewBox", "0 0 500 500");
|
|
573
579
|
const r = document.createElementNS(t, "path");
|
|
@@ -576,7 +582,7 @@ function jt(e) {
|
|
|
576
582
|
"M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"
|
|
577
583
|
), s.appendChild(r), s;
|
|
578
584
|
}
|
|
579
|
-
function
|
|
585
|
+
function Xt(e) {
|
|
580
586
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
581
587
|
s.setAttribute("class", `${e}-footer-icon-save`), s.setAttribute("viewBox", "0 0 448 512");
|
|
582
588
|
const r = document.createElementNS(t, "path");
|
|
@@ -585,7 +591,7 @@ function Gt(e) {
|
|
|
585
591
|
"M224 256c-35.2 0-64 28.8-64 64c0 35.2 28.8 64 64 64c35.2 0 64-28.8 64-64C288 284.8 259.2 256 224 256zM433.1 129.1l-83.9-83.9C341.1 37.06 328.8 32 316.1 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V163.9C448 151.2 442.9 138.9 433.1 129.1zM128 80h144V160H128V80zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h16v104c0 13.25 10.75 24 24 24h192C309.3 208 320 197.3 320 184V83.88l78.25 78.25C399.4 163.2 400 164.8 400 166.3V416z"
|
|
586
592
|
), s.appendChild(r), s;
|
|
587
593
|
}
|
|
588
|
-
function
|
|
594
|
+
function Zt(e) {
|
|
589
595
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
590
596
|
s.setAttribute("class", `${e}-footer-icon-spinner`), s.setAttribute("viewBox", "0 0 512 512");
|
|
591
597
|
const r = document.createElementNS(t, "path");
|
|
@@ -593,96 +599,96 @@ function Wt(e) {
|
|
|
593
599
|
"d",
|
|
594
600
|
"M304 48c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zm0 416c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zM48 304c26.5 0 48-21.5 48-48s-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48zm464-48c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zM142.9 437c18.7-18.7 18.7-49.1 0-67.9s-49.1-18.7-67.9 0s-18.7 49.1 0 67.9s49.1 18.7 67.9 0zm0-294.2c18.7-18.7 18.7-49.1 0-67.9S93.7 56.2 75 75s-18.7 49.1 0 67.9s49.1 18.7 67.9 0zM369.1 437c18.7 18.7 49.1 18.7 67.9 0s18.7-49.1 0-67.9s-49.1-18.7-67.9 0s-18.7 49.1 0 67.9z"
|
|
595
601
|
);
|
|
596
|
-
const
|
|
597
|
-
|
|
602
|
+
const o = document.createElementNS(t, "animateTransform");
|
|
603
|
+
o.setAttribute("attributeName", "transform"), o.setAttribute("attributeType", "xml"), o.setAttribute("type", "rotate"), o.setAttribute("from", "0 256 256"), o.setAttribute("to", "360 256 256"), o.setAttribute("begin", "0s"), o.setAttribute("dur", "2s"), o.setAttribute("fill", "freeze"), o.setAttribute("repeatCount", "indefinite"), r.appendChild(o);
|
|
598
604
|
const i = document.createElementNS(t, "text");
|
|
599
605
|
return i.setAttribute("x", "125"), i.setAttribute("y", "345"), i.setAttribute("data-id", "progress"), i.style.fontSize = "246px", i.textContent = "20", s.appendChild(i), s.appendChild(r), s;
|
|
600
606
|
}
|
|
601
|
-
function
|
|
602
|
-
let e =
|
|
603
|
-
const t = (
|
|
604
|
-
e =
|
|
607
|
+
function Kt() {
|
|
608
|
+
let e = G;
|
|
609
|
+
const t = (h) => {
|
|
610
|
+
e = h;
|
|
605
611
|
};
|
|
606
|
-
let s =
|
|
607
|
-
const r = (
|
|
608
|
-
s =
|
|
612
|
+
let s = G;
|
|
613
|
+
const r = (h) => {
|
|
614
|
+
s = h;
|
|
609
615
|
};
|
|
610
|
-
let
|
|
611
|
-
const i = (
|
|
612
|
-
|
|
616
|
+
let o = G;
|
|
617
|
+
const i = (h) => {
|
|
618
|
+
o = h;
|
|
613
619
|
};
|
|
614
|
-
let
|
|
615
|
-
const b =
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
},
|
|
619
|
-
const
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
},
|
|
623
|
-
const
|
|
624
|
-
|
|
625
|
-
let
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
620
|
+
let n = !1, a = !1, l = 0, d = 0;
|
|
621
|
+
const b = y("div", "footer"), g = y("button", "btn-sidebar");
|
|
622
|
+
g.classList.add(_("footer-btn")), g.appendChild(Ht(D)), g.onclick = function() {
|
|
623
|
+
n || s();
|
|
624
|
+
}, g.style.display = "none", b.appendChild(g);
|
|
625
|
+
const m = y("div", "page-jumps"), c = y("button", "btn-page-back");
|
|
626
|
+
c.classList.add(_("footer-btn")), c.appendChild(jt(D)), c.onclick = function() {
|
|
627
|
+
n || e(l - 1);
|
|
628
|
+
}, m.appendChild(c);
|
|
629
|
+
const f = y("button", "btn-page-play");
|
|
630
|
+
f.classList.add(_("footer-btn")), f.appendChild(Gt(D)), f.appendChild(Wt(D));
|
|
631
|
+
let E = 0;
|
|
632
|
+
f.onclick = function() {
|
|
633
|
+
n || (f.classList.add(_("footer-btn-playing")), o(), clearTimeout(E), E = window.setTimeout(() => {
|
|
634
|
+
f.classList.remove(_("footer-btn-playing"));
|
|
629
635
|
}, 500));
|
|
630
|
-
},
|
|
631
|
-
const
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
},
|
|
635
|
-
const
|
|
636
|
-
|
|
637
|
-
|
|
636
|
+
}, m.appendChild(f);
|
|
637
|
+
const $ = y("button", "btn-page-next");
|
|
638
|
+
$.classList.add(_("footer-btn")), $.appendChild(Jt(D)), $.onclick = function() {
|
|
639
|
+
n || e(l + 1);
|
|
640
|
+
}, m.appendChild($);
|
|
641
|
+
const A = y("div", "page-number"), v = y("input", "page-number-input");
|
|
642
|
+
v.value = String(l + 1), v.onchange = function() {
|
|
643
|
+
n || v.value && e(Number(v.value) - 1);
|
|
638
644
|
};
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
const w =
|
|
642
|
-
let
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
},
|
|
646
|
-
if (
|
|
647
|
-
|
|
648
|
-
const
|
|
649
|
-
|
|
645
|
+
const p = y("span", "total-page");
|
|
646
|
+
p.textContent = " / ", A.appendChild(v), A.appendChild(p), b.appendChild(m), b.appendChild(A);
|
|
647
|
+
const w = _("readonly");
|
|
648
|
+
let k = G;
|
|
649
|
+
const S = (h) => {
|
|
650
|
+
k = h;
|
|
651
|
+
}, I = (h) => {
|
|
652
|
+
if (h < 99) {
|
|
653
|
+
z.style.display = "block", M.style.display = "none";
|
|
654
|
+
const se = z.querySelector("[data-id]");
|
|
655
|
+
se && (se.textContent = h.toString().padStart(2, "0"));
|
|
650
656
|
} else
|
|
651
|
-
|
|
652
|
-
},
|
|
653
|
-
|
|
654
|
-
const
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
},
|
|
658
|
-
function
|
|
659
|
-
|
|
657
|
+
z.style.display = "none", M.style.display = "block";
|
|
658
|
+
}, M = Xt(D), z = Zt(D);
|
|
659
|
+
z.style.display = "none";
|
|
660
|
+
const T = y("button", "footer-btn");
|
|
661
|
+
T.appendChild(M), T.onclick = function() {
|
|
662
|
+
k(I);
|
|
663
|
+
}, T.appendChild(z);
|
|
664
|
+
function P(h) {
|
|
665
|
+
n !== h && (n = h, b.classList.toggle(w, n), v.disabled = n);
|
|
660
666
|
}
|
|
661
|
-
function
|
|
662
|
-
a !==
|
|
667
|
+
function vt(h) {
|
|
668
|
+
a !== h && (a = h, g.style.display = a ? "" : "none");
|
|
663
669
|
}
|
|
664
|
-
function
|
|
665
|
-
(
|
|
670
|
+
function wt(h, se = !1) {
|
|
671
|
+
(se || l !== h) && (l = h, v.value = String(l + 1));
|
|
666
672
|
}
|
|
667
|
-
function
|
|
668
|
-
|
|
673
|
+
function _t(h) {
|
|
674
|
+
d !== h && (d = h, p.textContent = ` / ${d}`);
|
|
669
675
|
}
|
|
670
676
|
return {
|
|
671
677
|
$footer: b,
|
|
672
|
-
$pageNumberInput:
|
|
673
|
-
set_readonly:
|
|
674
|
-
set_sidebar:
|
|
675
|
-
set_page_index:
|
|
676
|
-
set_page_count:
|
|
678
|
+
$pageNumberInput: v,
|
|
679
|
+
set_readonly: P,
|
|
680
|
+
set_sidebar: vt,
|
|
681
|
+
set_page_index: wt,
|
|
682
|
+
set_page_count: _t,
|
|
677
683
|
on_new_page_index: t,
|
|
678
684
|
on_toggle_preview: r,
|
|
679
685
|
on_play: i,
|
|
680
|
-
on_save_to_pdf:
|
|
686
|
+
on_save_to_pdf: S
|
|
681
687
|
};
|
|
682
688
|
}
|
|
683
|
-
const
|
|
689
|
+
const U = typeof window < "u", He = U && !("onscroll" in window) || typeof navigator < "u" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent), je = U && "IntersectionObserver" in window, Ge = U && "classList" in document.createElement("p"), We = U && window.devicePixelRatio > 1, Qt = {
|
|
684
690
|
elements_selector: ".lazy",
|
|
685
|
-
container:
|
|
691
|
+
container: He || U ? document : null,
|
|
686
692
|
threshold: 300,
|
|
687
693
|
thresholds: null,
|
|
688
694
|
data_src: "src",
|
|
@@ -713,30 +719,30 @@ const R = typeof window < "u", qe = R && !("onscroll" in window) || typeof navig
|
|
|
713
719
|
callback_cancel: null,
|
|
714
720
|
use_native: !1,
|
|
715
721
|
restore_on_error: !1
|
|
716
|
-
},
|
|
722
|
+
}, Je = (e) => Object.assign({}, Qt, e), Le = function(e, t) {
|
|
717
723
|
let s;
|
|
718
|
-
const r = "LazyLoad::Initialized",
|
|
724
|
+
const r = "LazyLoad::Initialized", o = new e(t);
|
|
719
725
|
try {
|
|
720
|
-
s = new CustomEvent(r, { detail: { instance:
|
|
726
|
+
s = new CustomEvent(r, { detail: { instance: o } });
|
|
721
727
|
} catch {
|
|
722
|
-
s = document.createEvent("CustomEvent"), s.initCustomEvent(r, !1, !1, { instance:
|
|
728
|
+
s = document.createEvent("CustomEvent"), s.initCustomEvent(r, !1, !1, { instance: o });
|
|
723
729
|
}
|
|
724
730
|
window.dispatchEvent(s);
|
|
725
731
|
}, Yt = (e, t) => {
|
|
726
732
|
if (t)
|
|
727
733
|
if (!t.length)
|
|
728
|
-
|
|
734
|
+
Le(e, t);
|
|
729
735
|
else
|
|
730
736
|
for (let s = 0, r; r = t[s]; s += 1)
|
|
731
|
-
|
|
732
|
-
},
|
|
737
|
+
Le(e, r);
|
|
738
|
+
}, O = "src", ge = "srcset", be = "sizes", Xe = "poster", Y = "llOriginalAttrs", Ze = "data", me = "loading", Ke = "loaded", Qe = "applied", es = "entered", ve = "error", Ye = "native", et = "data-", tt = "ll-status", x = (e, t) => e.getAttribute(et + t), ts = (e, t, s) => {
|
|
733
739
|
var r = et + t;
|
|
734
740
|
if (s === null) {
|
|
735
741
|
e.removeAttribute(r);
|
|
736
742
|
return;
|
|
737
743
|
}
|
|
738
744
|
e.setAttribute(r, s);
|
|
739
|
-
},
|
|
745
|
+
}, ee = (e) => x(e, tt), j = (e, t) => ts(e, tt, t), ae = (e) => j(e, null), we = (e) => ee(e) === null, ss = (e) => ee(e) === me, rs = (e) => ee(e) === ve, _e = (e) => ee(e) === Ye, os = [me, Ke, Qe, ve], ns = (e) => os.indexOf(ee(e)) >= 0, B = (e, t, s, r) => {
|
|
740
746
|
if (e) {
|
|
741
747
|
if (r !== void 0) {
|
|
742
748
|
e(t, s, r);
|
|
@@ -748,38 +754,38 @@ const R = typeof window < "u", qe = R && !("onscroll" in window) || typeof navig
|
|
|
748
754
|
}
|
|
749
755
|
e(t);
|
|
750
756
|
}
|
|
751
|
-
},
|
|
757
|
+
}, J = (e, t) => {
|
|
752
758
|
if (Ge) {
|
|
753
759
|
e.classList.add(t);
|
|
754
760
|
return;
|
|
755
761
|
}
|
|
756
762
|
e.className += (e.className ? " " : "") + t;
|
|
757
|
-
},
|
|
763
|
+
}, L = (e, t) => {
|
|
758
764
|
if (Ge) {
|
|
759
765
|
e.classList.remove(t);
|
|
760
766
|
return;
|
|
761
767
|
}
|
|
762
768
|
e.className = e.className.replace(new RegExp("(^|\\s+)" + t + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "");
|
|
763
|
-
},
|
|
769
|
+
}, as = (e) => {
|
|
764
770
|
e.llTempImage = document.createElement("IMG");
|
|
765
|
-
},
|
|
771
|
+
}, is = (e) => {
|
|
766
772
|
delete e.llTempImage;
|
|
767
773
|
}, st = (e) => e.llTempImage, ie = (e, t) => {
|
|
768
774
|
if (!t)
|
|
769
775
|
return;
|
|
770
776
|
const s = t._observer;
|
|
771
777
|
s && s.unobserve(e);
|
|
772
|
-
},
|
|
778
|
+
}, ls = (e) => {
|
|
773
779
|
e.disconnect();
|
|
774
|
-
},
|
|
780
|
+
}, cs = (e, t, s) => {
|
|
775
781
|
t.unobserve_entered && ie(e, s);
|
|
776
782
|
}, ye = (e, t) => {
|
|
777
783
|
e && (e.loadingCount += t);
|
|
778
|
-
},
|
|
784
|
+
}, ds = (e) => {
|
|
779
785
|
e && (e.toLoadCount -= 1);
|
|
780
786
|
}, rt = (e, t) => {
|
|
781
787
|
e && (e.toLoadCount = t);
|
|
782
|
-
},
|
|
788
|
+
}, us = (e) => e.loadingCount > 0, ps = (e) => e.toLoadCount > 0, ot = (e) => {
|
|
783
789
|
let t = [];
|
|
784
790
|
for (let s = 0, r; r = e.children[s]; s += 1)
|
|
785
791
|
r.tagName === "SOURCE" && t.push(r);
|
|
@@ -791,84 +797,84 @@ const R = typeof window < "u", qe = R && !("onscroll" in window) || typeof navig
|
|
|
791
797
|
ot(s).forEach(t);
|
|
792
798
|
}, nt = (e, t) => {
|
|
793
799
|
ot(e).forEach(t);
|
|
794
|
-
},
|
|
795
|
-
if (
|
|
800
|
+
}, le = [O], at = [O, Xe], K = [O, ge, be], it = [Ze], ce = (e) => !!e[Y], lt = (e) => e[Y], ct = (e) => delete e[Y], W = (e, t) => {
|
|
801
|
+
if (ce(e))
|
|
796
802
|
return;
|
|
797
803
|
const s = {};
|
|
798
804
|
t.forEach((r) => {
|
|
799
805
|
s[r] = e.getAttribute(r);
|
|
800
|
-
}), e[
|
|
801
|
-
},
|
|
802
|
-
|
|
803
|
-
},
|
|
806
|
+
}), e[Y] = s;
|
|
807
|
+
}, hs = (e) => {
|
|
808
|
+
ce(e) || (e[Y] = { backgroundImage: e.style.backgroundImage });
|
|
809
|
+
}, fs = (e, t, s) => {
|
|
804
810
|
if (!s) {
|
|
805
811
|
e.removeAttribute(t);
|
|
806
812
|
return;
|
|
807
813
|
}
|
|
808
814
|
e.setAttribute(t, s);
|
|
809
815
|
}, H = (e, t) => {
|
|
810
|
-
if (!
|
|
816
|
+
if (!ce(e))
|
|
811
817
|
return;
|
|
812
818
|
const s = lt(e);
|
|
813
819
|
t.forEach((r) => {
|
|
814
|
-
|
|
820
|
+
fs(e, r, s[r]);
|
|
815
821
|
});
|
|
816
|
-
},
|
|
817
|
-
if (!
|
|
822
|
+
}, gs = (e) => {
|
|
823
|
+
if (!ce(e))
|
|
818
824
|
return;
|
|
819
825
|
const t = lt(e);
|
|
820
826
|
e.style.backgroundImage = t.backgroundImage;
|
|
821
827
|
}, dt = (e, t, s) => {
|
|
822
|
-
|
|
828
|
+
J(e, t.class_applied), j(e, Qe), s && (t.unobserve_completed && ie(e, t), B(t.callback_applied, e, s));
|
|
823
829
|
}, ut = (e, t, s) => {
|
|
824
|
-
|
|
825
|
-
},
|
|
830
|
+
J(e, t.class_loading), j(e, me), s && (ye(s, 1), B(t.callback_loading, e, s));
|
|
831
|
+
}, V = (e, t, s) => {
|
|
826
832
|
s && e.setAttribute(t, s);
|
|
827
833
|
}, Me = (e, t) => {
|
|
828
|
-
|
|
829
|
-
},
|
|
834
|
+
V(e, be, x(e, t.data_sizes)), V(e, ge, x(e, t.data_srcset)), V(e, O, x(e, t.data_src));
|
|
835
|
+
}, bs = (e, t) => {
|
|
830
836
|
ke(e, (s) => {
|
|
831
|
-
|
|
832
|
-
}),
|
|
833
|
-
},
|
|
834
|
-
|
|
835
|
-
},
|
|
837
|
+
W(s, K), Me(s, t);
|
|
838
|
+
}), W(e, K), Me(e, t);
|
|
839
|
+
}, ms = (e, t) => {
|
|
840
|
+
W(e, le), V(e, O, x(e, t.data_src));
|
|
841
|
+
}, vs = (e, t) => {
|
|
836
842
|
nt(e, (s) => {
|
|
837
|
-
|
|
838
|
-
}),
|
|
839
|
-
},
|
|
840
|
-
|
|
841
|
-
},
|
|
842
|
-
const r =
|
|
843
|
-
i && (e.style.backgroundImage = `url("${i}")`, st(e).setAttribute(
|
|
844
|
-
},
|
|
845
|
-
const r =
|
|
843
|
+
W(s, le), V(s, O, x(s, t.data_src));
|
|
844
|
+
}), W(e, at), V(e, Xe, x(e, t.data_poster)), V(e, O, x(e, t.data_src)), e.load();
|
|
845
|
+
}, ws = (e, t) => {
|
|
846
|
+
W(e, it), V(e, Ze, x(e, t.data_src));
|
|
847
|
+
}, _s = (e, t, s) => {
|
|
848
|
+
const r = x(e, t.data_bg), o = x(e, t.data_bg_hidpi), i = We && o ? o : r;
|
|
849
|
+
i && (e.style.backgroundImage = `url("${i}")`, st(e).setAttribute(O, i), ut(e, t, s));
|
|
850
|
+
}, ys = (e, t, s) => {
|
|
851
|
+
const r = x(e, t.data_bg_multi), o = x(e, t.data_bg_multi_hidpi), i = We && o ? o : r;
|
|
846
852
|
i && (e.style.backgroundImage = i, dt(e, t, s));
|
|
847
|
-
},
|
|
848
|
-
const r =
|
|
853
|
+
}, ks = (e, t, s) => {
|
|
854
|
+
const r = x(e, t.data_bg_set);
|
|
849
855
|
if (!r)
|
|
850
856
|
return;
|
|
851
|
-
const
|
|
852
|
-
let i =
|
|
853
|
-
e.style.backgroundImage = i.join(), e.style.backgroundImage === "" && (i =
|
|
857
|
+
const o = r.split("|");
|
|
858
|
+
let i = o.map((n) => `image-set(${n})`);
|
|
859
|
+
e.style.backgroundImage = i.join(), e.style.backgroundImage === "" && (i = o.map((n) => `-webkit-image-set(${n})`), e.style.backgroundImage = i.join()), dt(e, t, s);
|
|
854
860
|
}, pt = {
|
|
855
|
-
IMG:
|
|
856
|
-
IFRAME:
|
|
857
|
-
VIDEO:
|
|
858
|
-
OBJECT:
|
|
859
|
-
},
|
|
861
|
+
IMG: bs,
|
|
862
|
+
IFRAME: ms,
|
|
863
|
+
VIDEO: vs,
|
|
864
|
+
OBJECT: ws
|
|
865
|
+
}, Ss = (e, t) => {
|
|
860
866
|
const s = pt[e.tagName];
|
|
861
867
|
s && s(e, t);
|
|
862
|
-
},
|
|
868
|
+
}, xs = (e, t, s) => {
|
|
863
869
|
const r = pt[e.tagName];
|
|
864
870
|
r && (r(e, t), ut(e, t, s));
|
|
865
|
-
},
|
|
866
|
-
t && !
|
|
871
|
+
}, Es = ["IMG", "IFRAME", "VIDEO", "OBJECT"], Cs = (e) => Es.indexOf(e.tagName) > -1, ht = (e, t) => {
|
|
872
|
+
t && !us(t) && !ps(t) && B(e.callback_finish, t);
|
|
867
873
|
}, Ne = (e, t, s) => {
|
|
868
874
|
e.addEventListener(t, s), e.llEvLisnrs[t] = s;
|
|
869
|
-
},
|
|
875
|
+
}, As = (e, t, s) => {
|
|
870
876
|
e.removeEventListener(t, s);
|
|
871
|
-
}, Se = (e) => !!e.llEvLisnrs,
|
|
877
|
+
}, Se = (e) => !!e.llEvLisnrs, Is = (e, t, s) => {
|
|
872
878
|
Se(e) || (e.llEvLisnrs = {});
|
|
873
879
|
const r = e.tagName === "VIDEO" ? "loadeddata" : "load";
|
|
874
880
|
Ne(e, r, t), Ne(e, "error", s);
|
|
@@ -878,320 +884,338 @@ const R = typeof window < "u", qe = R && !("onscroll" in window) || typeof navig
|
|
|
878
884
|
const t = e.llEvLisnrs;
|
|
879
885
|
for (let s in t) {
|
|
880
886
|
const r = t[s];
|
|
881
|
-
|
|
887
|
+
As(e, s, r);
|
|
882
888
|
}
|
|
883
889
|
delete e.llEvLisnrs;
|
|
884
890
|
}, ft = (e, t, s) => {
|
|
885
|
-
|
|
886
|
-
},
|
|
887
|
-
const
|
|
888
|
-
ft(t, s, r),
|
|
889
|
-
},
|
|
890
|
-
const
|
|
891
|
-
ft(t, s, r),
|
|
891
|
+
is(e), ye(s, -1), ds(s), L(e, t.class_loading), t.unobserve_completed && ie(e, s);
|
|
892
|
+
}, zs = (e, t, s, r) => {
|
|
893
|
+
const o = _e(t);
|
|
894
|
+
ft(t, s, r), J(t, s.class_loaded), j(t, Ke), B(s.callback_loaded, t, r), o || ht(s, r);
|
|
895
|
+
}, $s = (e, t, s, r) => {
|
|
896
|
+
const o = _e(t);
|
|
897
|
+
ft(t, s, r), J(t, s.class_error), j(t, ve), B(s.callback_error, t, r), s.restore_on_error && H(t, K), o || ht(s, r);
|
|
892
898
|
}, xe = (e, t, s) => {
|
|
893
899
|
const r = st(e) || e;
|
|
894
900
|
if (Se(r))
|
|
895
901
|
return;
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
}, (
|
|
899
|
-
|
|
902
|
+
Is(r, (n) => {
|
|
903
|
+
zs(n, e, t, s), fe(r);
|
|
904
|
+
}, (n) => {
|
|
905
|
+
$s(n, e, t, s), fe(r);
|
|
900
906
|
});
|
|
901
|
-
}, Is = (e, t, s) => {
|
|
902
|
-
rs(e), xe(e, t, s), ds(e), ms(e, t, s), vs(e, t, s), ws(e, t, s);
|
|
903
|
-
}, zs = (e, t, s) => {
|
|
904
|
-
xe(e, t, s), ys(e, t, s);
|
|
905
|
-
}, Ee = (e, t, s) => {
|
|
906
|
-
Ss(e) ? zs(e, t, s) : Is(e, t, s);
|
|
907
907
|
}, Ls = (e, t, s) => {
|
|
908
|
-
e
|
|
909
|
-
},
|
|
910
|
-
e
|
|
911
|
-
},
|
|
908
|
+
as(e), xe(e, t, s), hs(e), _s(e, t, s), ys(e, t, s), ks(e, t, s);
|
|
909
|
+
}, Ms = (e, t, s) => {
|
|
910
|
+
xe(e, t, s), xs(e, t, s);
|
|
911
|
+
}, Ee = (e, t, s) => {
|
|
912
|
+
Cs(e) ? Ms(e, t, s) : Ls(e, t, s);
|
|
913
|
+
}, Ns = (e, t, s) => {
|
|
914
|
+
e.setAttribute("loading", "lazy"), xe(e, t, s), Ss(e, t), j(e, Ye);
|
|
915
|
+
}, Oe = (e) => {
|
|
916
|
+
e.removeAttribute(O), e.removeAttribute(ge), e.removeAttribute(be);
|
|
917
|
+
}, Os = (e) => {
|
|
912
918
|
ke(e, (t) => {
|
|
913
|
-
|
|
914
|
-
}),
|
|
919
|
+
Oe(t);
|
|
920
|
+
}), Oe(e);
|
|
915
921
|
}, gt = (e) => {
|
|
916
922
|
ke(e, (t) => {
|
|
917
|
-
H(t,
|
|
918
|
-
}), H(e,
|
|
919
|
-
}, Ms = (e) => {
|
|
920
|
-
nt(e, (t) => {
|
|
921
|
-
H(t, ae);
|
|
922
|
-
}), H(e, it), e.load();
|
|
923
|
-
}, Ns = (e) => {
|
|
924
|
-
H(e, ae);
|
|
923
|
+
H(t, K);
|
|
924
|
+
}), H(e, K);
|
|
925
925
|
}, Ts = (e) => {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
IFRAME: Ns,
|
|
930
|
-
VIDEO: Ms,
|
|
931
|
-
OBJECT: Ts
|
|
926
|
+
nt(e, (t) => {
|
|
927
|
+
H(t, le);
|
|
928
|
+
}), H(e, at), e.load();
|
|
932
929
|
}, Ps = (e) => {
|
|
933
|
-
|
|
930
|
+
H(e, le);
|
|
931
|
+
}, Ds = (e) => {
|
|
932
|
+
H(e, it);
|
|
933
|
+
}, Fs = {
|
|
934
|
+
IMG: gt,
|
|
935
|
+
IFRAME: Ps,
|
|
936
|
+
VIDEO: Ts,
|
|
937
|
+
OBJECT: Ds
|
|
938
|
+
}, Rs = (e) => {
|
|
939
|
+
const t = Fs[e.tagName];
|
|
934
940
|
if (!t) {
|
|
935
|
-
|
|
941
|
+
gs(e);
|
|
936
942
|
return;
|
|
937
943
|
}
|
|
938
944
|
t(e);
|
|
939
|
-
},
|
|
940
|
-
we(e) || _e(e) || (
|
|
941
|
-
},
|
|
942
|
-
|
|
943
|
-
},
|
|
944
|
-
s.cancel_on_exit &&
|
|
945
|
-
},
|
|
946
|
-
const
|
|
947
|
-
|
|
948
|
-
},
|
|
949
|
-
we(e) || (
|
|
950
|
-
},
|
|
945
|
+
}, Vs = (e, t) => {
|
|
946
|
+
we(e) || _e(e) || (L(e, t.class_entered), L(e, t.class_exited), L(e, t.class_applied), L(e, t.class_loading), L(e, t.class_loaded), L(e, t.class_error));
|
|
947
|
+
}, Us = (e, t) => {
|
|
948
|
+
Rs(e), Vs(e, t), ae(e), ct(e);
|
|
949
|
+
}, Bs = (e, t, s, r) => {
|
|
950
|
+
s.cancel_on_exit && ss(e) && e.tagName === "IMG" && (fe(e), Os(e), gt(e), L(e, s.class_loading), ye(r, -1), ae(e), B(s.callback_cancel, e, t, r));
|
|
951
|
+
}, qs = (e, t, s, r) => {
|
|
952
|
+
const o = ns(e);
|
|
953
|
+
j(e, es), J(e, s.class_entered), L(e, s.class_exited), cs(e, s, r), B(s.callback_enter, e, t, r), !o && Ee(e, s, r);
|
|
954
|
+
}, Hs = (e, t, s, r) => {
|
|
955
|
+
we(e) || (J(e, s.class_exited), Bs(e, t, s, r), B(s.callback_exit, e, t, r));
|
|
956
|
+
}, js = ["IMG", "IFRAME", "VIDEO"], bt = (e) => e.use_native && "loading" in HTMLImageElement.prototype, Gs = (e, t, s) => {
|
|
951
957
|
e.forEach((r) => {
|
|
952
|
-
|
|
958
|
+
js.indexOf(r.tagName) !== -1 && Ns(r, t, s);
|
|
953
959
|
}), rt(s, 0);
|
|
954
|
-
},
|
|
960
|
+
}, Ws = (e) => e.isIntersecting || e.intersectionRatio > 0, Js = (e) => ({
|
|
955
961
|
root: e.container === document ? null : e.container,
|
|
956
962
|
rootMargin: e.thresholds || e.threshold + "px"
|
|
957
|
-
}),
|
|
963
|
+
}), Xs = (e, t, s) => {
|
|
958
964
|
e.forEach(
|
|
959
|
-
(r) =>
|
|
965
|
+
(r) => Ws(r) ? qs(r.target, r, t, s) : Hs(r.target, r, t, s)
|
|
960
966
|
);
|
|
961
|
-
},
|
|
967
|
+
}, Zs = (e, t) => {
|
|
962
968
|
t.forEach((s) => {
|
|
963
969
|
e.observe(s);
|
|
964
970
|
});
|
|
965
|
-
},
|
|
966
|
-
|
|
967
|
-
},
|
|
971
|
+
}, Ks = (e, t) => {
|
|
972
|
+
ls(e), Zs(e, t);
|
|
973
|
+
}, Qs = (e, t) => {
|
|
968
974
|
!je || bt(e) || (t._observer = new IntersectionObserver((s) => {
|
|
969
|
-
|
|
970
|
-
},
|
|
971
|
-
}, mt = (e) => Array.prototype.slice.call(e),
|
|
972
|
-
|
|
973
|
-
|
|
975
|
+
Xs(s, e, t);
|
|
976
|
+
}, Js(e)));
|
|
977
|
+
}, mt = (e) => Array.prototype.slice.call(e), ne = (e) => e.container.querySelectorAll(e.elements_selector), Ys = (e) => mt(e).filter(we), er = (e) => rs(e), tr = (e) => mt(e).filter(er), Te = (e, t) => Ys(e || ne(t)), sr = (e, t) => {
|
|
978
|
+
tr(ne(e)).forEach((r) => {
|
|
979
|
+
L(r, e.class_error), ae(r);
|
|
974
980
|
}), t.update();
|
|
975
|
-
},
|
|
976
|
-
|
|
977
|
-
|
|
981
|
+
}, rr = (e, t) => {
|
|
982
|
+
U && (t._onlineHandler = () => {
|
|
983
|
+
sr(e, t);
|
|
978
984
|
}, window.addEventListener("online", t._onlineHandler));
|
|
979
|
-
},
|
|
980
|
-
|
|
981
|
-
},
|
|
982
|
-
const s =
|
|
983
|
-
this._settings = s, this.loadingCount = 0,
|
|
985
|
+
}, or = (e) => {
|
|
986
|
+
U && window.removeEventListener("online", e._onlineHandler);
|
|
987
|
+
}, te = function(e, t) {
|
|
988
|
+
const s = Je(e);
|
|
989
|
+
this._settings = s, this.loadingCount = 0, Qs(s, this), rr(s, this), this.update(t);
|
|
984
990
|
};
|
|
985
|
-
|
|
991
|
+
te.prototype = {
|
|
986
992
|
update: function(e) {
|
|
987
|
-
const t = this._settings, s =
|
|
988
|
-
if (rt(this, s.length),
|
|
993
|
+
const t = this._settings, s = Te(e, t);
|
|
994
|
+
if (rt(this, s.length), He || !je) {
|
|
989
995
|
this.loadAll(s);
|
|
990
996
|
return;
|
|
991
997
|
}
|
|
992
998
|
if (bt(t)) {
|
|
993
|
-
|
|
999
|
+
Gs(s, t, this);
|
|
994
1000
|
return;
|
|
995
1001
|
}
|
|
996
|
-
|
|
1002
|
+
Ks(this._observer, s);
|
|
997
1003
|
},
|
|
998
1004
|
destroy: function() {
|
|
999
|
-
this._observer && this._observer.disconnect(),
|
|
1005
|
+
this._observer && this._observer.disconnect(), or(this), ne(this._settings).forEach((e) => {
|
|
1000
1006
|
ct(e);
|
|
1001
1007
|
}), delete this._observer, delete this._settings, delete this._onlineHandler, delete this.loadingCount, delete this.toLoadCount;
|
|
1002
1008
|
},
|
|
1003
1009
|
loadAll: function(e) {
|
|
1004
1010
|
const t = this._settings;
|
|
1005
|
-
|
|
1011
|
+
Te(e, t).forEach((r) => {
|
|
1006
1012
|
ie(r, this), Ee(r, t, this);
|
|
1007
1013
|
});
|
|
1008
1014
|
},
|
|
1009
1015
|
restoreAll: function() {
|
|
1010
1016
|
const e = this._settings;
|
|
1011
|
-
|
|
1012
|
-
|
|
1017
|
+
ne(e).forEach((t) => {
|
|
1018
|
+
Us(t, e);
|
|
1013
1019
|
});
|
|
1014
1020
|
}
|
|
1015
1021
|
};
|
|
1016
|
-
|
|
1017
|
-
const s =
|
|
1022
|
+
te.load = (e, t) => {
|
|
1023
|
+
const s = Je(t);
|
|
1018
1024
|
Ee(e, s);
|
|
1019
1025
|
};
|
|
1020
|
-
|
|
1021
|
-
|
|
1026
|
+
te.resetStatus = (e) => {
|
|
1027
|
+
ae(e);
|
|
1022
1028
|
};
|
|
1023
|
-
|
|
1024
|
-
function
|
|
1025
|
-
let e =
|
|
1026
|
-
const t = (
|
|
1027
|
-
e =
|
|
1029
|
+
U && Yt(te, window.lazyLoadOptions);
|
|
1030
|
+
function nr() {
|
|
1031
|
+
let e = G;
|
|
1032
|
+
const t = (p) => {
|
|
1033
|
+
e = p;
|
|
1028
1034
|
};
|
|
1029
|
-
let s = !1, r = !1,
|
|
1030
|
-
const a =
|
|
1035
|
+
let s = !1, r = !1, o = !1, i = [], n = 0;
|
|
1036
|
+
const a = _("readonly"), l = _("preview-active"), d = y("div", "content"), b = y("div", "preview-mask");
|
|
1031
1037
|
b.onclick = function(w) {
|
|
1032
|
-
r || w.target === b &&
|
|
1033
|
-
},
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1036
|
-
var
|
|
1038
|
+
r || w.target === b && f(!1);
|
|
1039
|
+
}, q(d, b);
|
|
1040
|
+
const g = y("div", "preview");
|
|
1041
|
+
g.classList.add(_("tele-fancy-scrollbar")), g.onclick = function(w) {
|
|
1042
|
+
var S;
|
|
1037
1043
|
if (r)
|
|
1038
1044
|
return;
|
|
1039
|
-
const
|
|
1040
|
-
|
|
1041
|
-
},
|
|
1042
|
-
let
|
|
1043
|
-
function
|
|
1044
|
-
r !==
|
|
1045
|
-
}
|
|
1046
|
-
function
|
|
1047
|
-
|
|
1048
|
-
container:
|
|
1049
|
-
elements_selector: `.${
|
|
1045
|
+
const k = (S = w.target.dataset) == null ? void 0 : S.pageIndex;
|
|
1046
|
+
k && (w.preventDefault(), w.stopPropagation(), w.stopImmediatePropagation(), e(Number(k)), f(!1));
|
|
1047
|
+
}, q(d, g);
|
|
1048
|
+
let m;
|
|
1049
|
+
function c(p) {
|
|
1050
|
+
r !== p && (r = p, d.classList.toggle(a, r));
|
|
1051
|
+
}
|
|
1052
|
+
function f(p) {
|
|
1053
|
+
o !== p && (o = p, d.classList.toggle(l, o), o && !m && (m = new te({
|
|
1054
|
+
container: g,
|
|
1055
|
+
elements_selector: `.${_("preview-page>img")}`
|
|
1050
1056
|
})));
|
|
1051
1057
|
}
|
|
1052
|
-
function
|
|
1053
|
-
if (i !==
|
|
1054
|
-
i =
|
|
1055
|
-
const w =
|
|
1056
|
-
i.forEach((
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1059
|
-
const
|
|
1060
|
-
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1063
|
-
}), s ||
|
|
1058
|
+
function E(p) {
|
|
1059
|
+
if (i !== p) {
|
|
1060
|
+
i = p;
|
|
1061
|
+
const w = _("preview-page"), k = _("preview-page-name");
|
|
1062
|
+
i.forEach((S, I) => {
|
|
1063
|
+
const M = String(I), z = oe("a");
|
|
1064
|
+
z.className = w + " " + _(`preview-page-${I}`), z.href = "#", z.dataset.pageIndex = M;
|
|
1065
|
+
const T = oe("span");
|
|
1066
|
+
T.className = k, T.textContent = String(I + 1), T.dataset.pageIndex = M;
|
|
1067
|
+
const P = oe("img");
|
|
1068
|
+
P.width = S.width, P.height = S.height, P.alt = `page-${I}`, P.dataset.src = S.thumbnail, P.dataset.pageIndex = M, q(z, P), q(z, T), q(g, z);
|
|
1069
|
+
}), s || m == null || m.update();
|
|
1064
1070
|
}
|
|
1065
1071
|
}
|
|
1066
|
-
function
|
|
1067
|
-
if (w ||
|
|
1068
|
-
|
|
1069
|
-
const
|
|
1070
|
-
`.${
|
|
1072
|
+
function $(p, w = !1) {
|
|
1073
|
+
if (w || n !== p) {
|
|
1074
|
+
n = p;
|
|
1075
|
+
const k = g.querySelector(
|
|
1076
|
+
`.${_(`preview-page-${n}`)}`
|
|
1071
1077
|
);
|
|
1072
|
-
|
|
1078
|
+
k && g.scrollTo({ top: k.offsetTop - 16 });
|
|
1073
1079
|
}
|
|
1074
1080
|
}
|
|
1075
|
-
function
|
|
1076
|
-
s = !0,
|
|
1081
|
+
function A() {
|
|
1082
|
+
s = !0, m == null || m.destroy();
|
|
1077
1083
|
}
|
|
1078
|
-
function
|
|
1079
|
-
return
|
|
1084
|
+
function v() {
|
|
1085
|
+
return o;
|
|
1080
1086
|
}
|
|
1081
1087
|
return {
|
|
1082
|
-
$content:
|
|
1083
|
-
$preview:
|
|
1084
|
-
set_readonly:
|
|
1085
|
-
set_active:
|
|
1086
|
-
get_active:
|
|
1087
|
-
set_pages:
|
|
1088
|
+
$content: d,
|
|
1089
|
+
$preview: g,
|
|
1090
|
+
set_readonly: c,
|
|
1091
|
+
set_active: f,
|
|
1092
|
+
get_active: v,
|
|
1093
|
+
set_pages: E,
|
|
1088
1094
|
on_new_page_index: t,
|
|
1089
|
-
set_page_index:
|
|
1090
|
-
destroy:
|
|
1095
|
+
set_page_index: $,
|
|
1096
|
+
destroy: A
|
|
1091
1097
|
};
|
|
1092
1098
|
}
|
|
1093
|
-
const
|
|
1094
|
-
constructor(
|
|
1095
|
-
|
|
1099
|
+
const Ce = class {
|
|
1100
|
+
constructor(t) {
|
|
1101
|
+
u(this, "sideEffect", new De());
|
|
1102
|
+
u(this, "events", new zt());
|
|
1103
|
+
u(this, "$slide", y("div", "slide"));
|
|
1104
|
+
u(this, "$overlay", y("div", "overlay"));
|
|
1105
|
+
u(this, "sidebar", nr());
|
|
1106
|
+
u(this, "footer", Kt());
|
|
1107
|
+
u(this, "$content");
|
|
1108
|
+
u(this, "$footer");
|
|
1109
|
+
u(this, "slide");
|
|
1110
|
+
u(this, "_slideTitle", "");
|
|
1111
|
+
u(this, "_getWhiteSnapshot", null);
|
|
1112
|
+
u(this, "_readyPromise");
|
|
1113
|
+
u(this, "_infoPromise");
|
|
1114
|
+
u(this, "_ready", !1);
|
|
1115
|
+
u(this, "_slideCount", 0);
|
|
1116
|
+
u(this, "_destroyed", !1);
|
|
1117
|
+
u(this, "_isFrozen", !1);
|
|
1118
|
+
u(this, "_cachedIsFrozen", !1);
|
|
1119
|
+
u(this, "onPlay", () => {
|
|
1096
1120
|
this.slide.nextStep();
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
|
|
1121
|
+
});
|
|
1122
|
+
u(this, "onNewPageIndex", (t) => {
|
|
1123
|
+
this._ready && t >= 0 && t < this._slideCount ? this.slide.renderSlide(t + 1) : this.setPage(this.slide.slideState.currentSlideIndex);
|
|
1124
|
+
});
|
|
1125
|
+
u(this, "onTogglePreview", () => {
|
|
1100
1126
|
this.sidebar.set_active(!this.sidebar.get_active());
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1127
|
+
});
|
|
1128
|
+
u(this, "toPdf", async (t) => {
|
|
1129
|
+
const r = document.createElement("canvas"), o = r.getContext("2d"), { slideCount: i, width: n, height: a } = this.slide;
|
|
1130
|
+
let l = Math.floor(n), d = Math.floor(a);
|
|
1131
|
+
l > 1920 && (l = 1920, d = Math.floor(a * l / n)), d > 1920 && (d = 1920, l = Math.floor(n * d / a)), r.width = l, r.height = d;
|
|
1132
|
+
const b = document.createElement("canvas");
|
|
1133
|
+
b.width = n, b.height = a;
|
|
1134
|
+
const g = b.getContext("2d");
|
|
1135
|
+
if (!g || !this._getWhiteSnapshot || !o)
|
|
1109
1136
|
return null;
|
|
1110
|
-
const
|
|
1111
|
-
format: [
|
|
1112
|
-
orientation:
|
|
1137
|
+
const m = l > d ? "l" : "p", { jsPDF: c } = await import("jspdf"), f = new c({
|
|
1138
|
+
format: [l, d],
|
|
1139
|
+
orientation: m,
|
|
1113
1140
|
compress: !0
|
|
1114
1141
|
});
|
|
1115
|
-
for (let
|
|
1116
|
-
const
|
|
1117
|
-
if (
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1142
|
+
for (let p = 1; p <= i; p++) {
|
|
1143
|
+
const w = await this.slide.snapshotWithTimingEnd(p);
|
|
1144
|
+
if (w) {
|
|
1145
|
+
const S = document.createElement("img");
|
|
1146
|
+
S.src = w, await new Promise((I) => S.onload = I), o.drawImage(S, 0, 0, l, d);
|
|
1120
1147
|
}
|
|
1121
|
-
|
|
1148
|
+
g.clearRect(0, 0, n, a), this._getWhiteSnapshot(p, b, g);
|
|
1122
1149
|
try {
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1150
|
+
const S = b.toDataURL("image/png"), I = document.createElement("img");
|
|
1151
|
+
I.src = S, await new Promise((M) => I.onload = M), o.drawImage(I, 0, 0, l, d);
|
|
1125
1152
|
} catch {
|
|
1126
1153
|
}
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1154
|
+
const k = r.toDataURL("image/jpeg", 0.6);
|
|
1155
|
+
p > 1 && f.addPage(), f.addImage(k, "JPEG", 0, 0, l, d, "", "FAST"), o.clearRect(0, 0, l, d), t(Math.ceil(p / i * 100));
|
|
1129
1156
|
}
|
|
1130
|
-
const
|
|
1131
|
-
|
|
1132
|
-
}
|
|
1157
|
+
const E = f.output("arraybuffer"), $ = new Blob([E]), A = URL.createObjectURL($), v = document.createElement("a");
|
|
1158
|
+
v.setAttribute("href", A), v.setAttribute("download", `${this._slideTitle || "snapshot"}.pdf`), v.style.display = "none", document.body.appendChild(v), v.click(), document.body.removeChild(v), window.postMessage({ type: "@app-slide/_download_pdf_", buf: E });
|
|
1159
|
+
});
|
|
1160
|
+
this.$content = this.sidebar.$content, this.$footer = this.footer.$footer, q(this.$content, this.$slide), q(this.$content, this.$overlay), this.sidebar.on_new_page_index(this.onNewPageIndex), this.footer.on_new_page_index(this.onNewPageIndex), this.footer.on_toggle_preview(this.onTogglePreview), this.footer.on_play(this.onPlay), this.footer.on_save_to_pdf(this.toPdf), this.sideEffect.push(this.sidebar.destroy), this.sideEffect.push(() => this.slide.destroy()), this.sideEffect.push(() => {
|
|
1133
1161
|
this.$content.parentElement && this.$content.remove(), this.$footer.parentElement && this.$footer.remove(), this.$slide.parentElement && this.$slide.remove();
|
|
1134
1162
|
}), this.sideEffect.push(
|
|
1135
|
-
|
|
1136
|
-
this._destroyed || (
|
|
1163
|
+
Bt((a) => {
|
|
1164
|
+
this._destroyed || (a ? this._cachedIsFrozen || this.unfreeze() : (this._cachedIsFrozen = this._isFrozen, this.freeze()));
|
|
1137
1165
|
})
|
|
1138
1166
|
);
|
|
1139
|
-
const [
|
|
1140
|
-
this._infoPromise =
|
|
1167
|
+
const [s, r] = $e();
|
|
1168
|
+
this._infoPromise = s, Ce.fetchSlideInfo(t).then(({ preview: a, slide: l }) => {
|
|
1141
1169
|
if (!this._destroyed) {
|
|
1142
|
-
if (this._slideCount =
|
|
1143
|
-
const { taskId:
|
|
1144
|
-
width:
|
|
1145
|
-
height:
|
|
1146
|
-
thumbnail: `${f}/preview/${
|
|
1170
|
+
if (this._slideCount = l.slideCount, a) {
|
|
1171
|
+
const { taskId: d, url: b } = t, { slideCount: g } = l, { width: m, height: c } = a, f = qe(d, b), E = Array.from({ length: g }, ($, A) => ({
|
|
1172
|
+
width: m,
|
|
1173
|
+
height: c,
|
|
1174
|
+
thumbnail: `${f}/preview/${A + 1}.png`
|
|
1147
1175
|
}));
|
|
1148
|
-
this.sidebar.set_pages(
|
|
1176
|
+
this.sidebar.set_pages(E), this.footer.set_sidebar(!0);
|
|
1149
1177
|
}
|
|
1150
|
-
this.footer.set_page_count(
|
|
1178
|
+
this.footer.set_page_count(l.slideCount), r(l);
|
|
1151
1179
|
}
|
|
1152
|
-
}).catch((
|
|
1153
|
-
console.log("[Slide] fetch slide info error"), console.error(
|
|
1180
|
+
}).catch((a) => {
|
|
1181
|
+
console.log("[Slide] fetch slide info error"), console.error(a), this.events.emit("prepareError", a);
|
|
1154
1182
|
});
|
|
1155
|
-
const [
|
|
1156
|
-
this._readyPromise =
|
|
1183
|
+
const [i, n] = $e();
|
|
1184
|
+
this._readyPromise = i, this.slide = new ue({
|
|
1157
1185
|
anchor: this.$slide,
|
|
1158
1186
|
mode: "local",
|
|
1159
1187
|
interactive: !0,
|
|
1160
1188
|
enableGlobalClick: !0,
|
|
1161
1189
|
useLocalCache: !0,
|
|
1162
|
-
...
|
|
1163
|
-
}), this.slide.setResource(
|
|
1164
|
-
this._destroyed || this.
|
|
1165
|
-
}), this.slide.on("
|
|
1166
|
-
this.
|
|
1167
|
-
|
|
1190
|
+
...t
|
|
1191
|
+
}), this.slide.setResource(t.taskId, t.url || Fe), this.slide.on("renderStart", () => {
|
|
1192
|
+
this._destroyed || this.events.emit("renderStart");
|
|
1193
|
+
}), this.slide.on("slideChange", (a) => {
|
|
1194
|
+
this._destroyed || (this.setPage(a), this.$overlay.style.opacity = "", this.events.emit("renderEnd"));
|
|
1195
|
+
}), this.slide.once("renderEnd", () => {
|
|
1196
|
+
this._ready || setTimeout(() => {
|
|
1197
|
+
this._ready = !0, n();
|
|
1168
1198
|
}, 1e3);
|
|
1169
|
-
}), this.slide.on("renderError", (
|
|
1170
|
-
this._destroyed ||
|
|
1199
|
+
}), this.slide.on("renderError", (a) => {
|
|
1200
|
+
this._destroyed || a.error && (console.error(a.error), this.$overlay.textContent = `Error on slide.index=${a.index}: ${a.error.message}`, this.$overlay.style.opacity = "1", this.events.emit("renderError", a));
|
|
1171
1201
|
}), this.ready(() => {
|
|
1172
1202
|
this._isFrozen && this.freeze();
|
|
1173
1203
|
});
|
|
1174
1204
|
}
|
|
1175
|
-
prepare(
|
|
1176
|
-
return this._infoPromise.then(
|
|
1177
|
-
}
|
|
1178
|
-
attachWhiteSnapshot(e) {
|
|
1179
|
-
this._getWhiteSnapshot = e;
|
|
1205
|
+
prepare(t) {
|
|
1206
|
+
return this._infoPromise.then(t);
|
|
1180
1207
|
}
|
|
1181
|
-
|
|
1182
|
-
this.
|
|
1183
|
-
}
|
|
1184
|
-
ready(e) {
|
|
1185
|
-
return this._readyPromise.then(e);
|
|
1208
|
+
ready(t) {
|
|
1209
|
+
return this._readyPromise.then(t);
|
|
1186
1210
|
}
|
|
1187
1211
|
destroy() {
|
|
1188
1212
|
this._destroyed = !0, this.sideEffect.flushAll();
|
|
1189
1213
|
}
|
|
1190
|
-
setReadonly(
|
|
1191
|
-
this.slide.setInteractive(!
|
|
1214
|
+
setReadonly(t) {
|
|
1215
|
+
this.slide.setInteractive(!t), this.sidebar.set_readonly(t), this.footer.set_readonly(t);
|
|
1192
1216
|
}
|
|
1193
|
-
setPage(
|
|
1194
|
-
this.sidebar.set_page_index(
|
|
1217
|
+
setPage(t) {
|
|
1218
|
+
this.sidebar.set_page_index(t - 1, !0), this.footer.set_page_index(t - 1, !0);
|
|
1195
1219
|
}
|
|
1196
1220
|
freeze() {
|
|
1197
1221
|
this._destroyed || (this._isFrozen = !0, this._ready && (this.slide.frozen(), this.events.emit("freeze")));
|
|
@@ -1200,53 +1224,40 @@ const vt = class {
|
|
|
1200
1224
|
this._destroyed || (this._isFrozen = !1, this._ready && (this.slide.release(), this.events.emit("unfreeze")));
|
|
1201
1225
|
}
|
|
1202
1226
|
};
|
|
1203
|
-
let
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
function rr(e) {
|
|
1227
|
+
let F = Ce;
|
|
1228
|
+
u(F, "styles", qt), u(F, "fetchSlideInfo", Ut);
|
|
1229
|
+
function ar(e) {
|
|
1207
1230
|
return e.displayer.logger;
|
|
1208
1231
|
}
|
|
1209
|
-
const
|
|
1210
|
-
constructor(
|
|
1211
|
-
this
|
|
1212
|
-
|
|
1213
|
-
}
|
|
1232
|
+
const N = class {
|
|
1233
|
+
constructor(t) {
|
|
1234
|
+
u(this, "info", (t) => {
|
|
1235
|
+
N.roomLogger && this.context ? N.roomLogger.info(t + ` (${this.context.appId})`) : this.context ? console.debug(t + ` (${this.context.appId})`) : console.debug(t);
|
|
1236
|
+
});
|
|
1237
|
+
this.context = t, t && (N.active.add(t.appId), N.roomLogger = ar(t));
|
|
1214
1238
|
}
|
|
1215
1239
|
destroy() {
|
|
1216
|
-
this.context &&
|
|
1240
|
+
this.context && N.active.delete(this.context.appId), N.active.size === 0 && (N.roomLogger = null);
|
|
1217
1241
|
}
|
|
1218
1242
|
};
|
|
1219
|
-
let
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
k.width = o.view.size.width, k.height = o.view.size.height, o.view.screenshotToCanvas(
|
|
1232
|
-
S,
|
|
1233
|
-
N,
|
|
1234
|
-
o.view.size.width,
|
|
1235
|
-
o.view.size.height,
|
|
1236
|
-
{
|
|
1237
|
-
centerX: 0,
|
|
1238
|
-
centerY: 0,
|
|
1239
|
-
scale: o.view.camera.scale
|
|
1240
|
-
}
|
|
1241
|
-
);
|
|
1242
|
-
}
|
|
1243
|
-
), h());
|
|
1243
|
+
let X = N;
|
|
1244
|
+
u(X, "active", /* @__PURE__ */ new Set()), u(X, "roomLogger", null);
|
|
1245
|
+
function ir({ context: e, storage: t, viewer: s, sideEffect: r, logger: o }) {
|
|
1246
|
+
const i = o.info.bind(o);
|
|
1247
|
+
let n = null;
|
|
1248
|
+
s.prepare(({ width: c, height: f, slideCount: E }) => {
|
|
1249
|
+
e.destroyed || (c && e.box.setStageRatio(f / c), n = e.createWhiteBoardView({ size: E }), n.setBaseRect({ width: c, height: f }), s._slideTitle = e.box.title, s._getWhiteSnapshot = ($, A, v) => {
|
|
1250
|
+
if (!n)
|
|
1251
|
+
return null;
|
|
1252
|
+
const p = n.pageState.pages[$ - 1], { width: w, height: k } = n.view.size;
|
|
1253
|
+
A.width = w, A.height = k, n.view.screenshotToCanvas(v, p, w, k, n.view.camera);
|
|
1254
|
+
}, d());
|
|
1244
1255
|
});
|
|
1245
1256
|
const { slide: a } = s;
|
|
1246
1257
|
function l(c = t.state.state) {
|
|
1247
1258
|
return JSON.stringify(c);
|
|
1248
1259
|
}
|
|
1249
|
-
function
|
|
1260
|
+
function d() {
|
|
1250
1261
|
if (t.state.state)
|
|
1251
1262
|
i("[Slide] restore " + l()), a.setSlideState(t.state.state);
|
|
1252
1263
|
else if (e.isAddApp)
|
|
@@ -1254,13 +1265,13 @@ function or({ context: e, storage: t, viewer: s, sideEffect: r, logger: n }) {
|
|
|
1254
1265
|
else {
|
|
1255
1266
|
i("[Slide] wait for restore");
|
|
1256
1267
|
const c = r.add(() => {
|
|
1257
|
-
const
|
|
1268
|
+
const E = setInterval(() => {
|
|
1258
1269
|
t.state.state || (i("[Slide] timeout"), a.renderSlide(1));
|
|
1259
1270
|
}, 15e3);
|
|
1260
|
-
return () => clearInterval(
|
|
1261
|
-
}),
|
|
1271
|
+
return () => clearInterval(E);
|
|
1272
|
+
}), f = r.push(
|
|
1262
1273
|
t.on("stateChanged", () => {
|
|
1263
|
-
t.state.state && (i("[Slide] restore " + l()), a.setSlideState(t.state.state), r.flush(
|
|
1274
|
+
t.state.state && (i("[Slide] restore " + l()), a.setSlideState(t.state.state), r.flush(f), r.flush(c));
|
|
1264
1275
|
})
|
|
1265
1276
|
);
|
|
1266
1277
|
}
|
|
@@ -1278,47 +1289,55 @@ function or({ context: e, storage: t, viewer: s, sideEffect: r, logger: n }) {
|
|
|
1278
1289
|
{ fireSelfEventAfterCommit: !0 }
|
|
1279
1290
|
)
|
|
1280
1291
|
), a.on("slideChange", (c) => {
|
|
1281
|
-
e.isWritable &&
|
|
1282
|
-
})
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
)
|
|
1287
|
-
|
|
1292
|
+
e.isWritable && n && (i("[Slide] page to " + c), n.jumpPage(c - 1));
|
|
1293
|
+
});
|
|
1294
|
+
function b() {
|
|
1295
|
+
n && n.view.divElement && n.view.divElement.classList.add(_("wb-view-hidden"));
|
|
1296
|
+
}
|
|
1297
|
+
function g() {
|
|
1298
|
+
n && n.view.divElement && n.view.divElement.classList.remove(_("wb-view-hidden"));
|
|
1299
|
+
}
|
|
1300
|
+
s.setReadonly(!e.isWritable), r.push([
|
|
1301
|
+
e.emitter.on("writableChange", () => s.setReadonly(!e.isWritable)),
|
|
1302
|
+
s.events.on("renderStart", b),
|
|
1303
|
+
s.events.on("renderEnd", g)
|
|
1304
|
+
]);
|
|
1305
|
+
const m = (c) => {
|
|
1288
1306
|
if (!c)
|
|
1289
1307
|
return !1;
|
|
1290
|
-
const
|
|
1291
|
-
return
|
|
1308
|
+
const f = c.tagName;
|
|
1309
|
+
return f === "INPUT" || f === "TEXTAREA" || f === "SELECT";
|
|
1292
1310
|
};
|
|
1293
1311
|
r.addEventListener(window, "keydown", (c) => {
|
|
1294
|
-
e.box.focus && !e.box.readonly && !
|
|
1312
|
+
!c || c.target.className === "telebox-quarantine-outer" || e.box.focus && !e.box.readonly && !m(c.target) && ((c.key === "ArrowUp" || c.key === "ArrowLeft") && s.slide.prevStep(), (c.key === "ArrowRight" || c.key === "ArrowDown") && s.slide.nextStep());
|
|
1295
1313
|
});
|
|
1296
1314
|
}
|
|
1297
|
-
function
|
|
1298
|
-
const { container: t, ...s } = e, r =
|
|
1299
|
-
return r.appendChild(document.createElement("style")).textContent =
|
|
1315
|
+
function ur(e) {
|
|
1316
|
+
const { container: t, ...s } = e, r = y("div", "preview-wrapper"), o = new F(s);
|
|
1317
|
+
return r.appendChild(document.createElement("style")).textContent = F.styles, r.appendChild(o.$content), r.appendChild(o.$footer), t.appendChild(r), o.prepare(() => o.slide.renderSlide(1)), o;
|
|
1300
1318
|
}
|
|
1301
|
-
const
|
|
1319
|
+
const pr = /* @__PURE__ */ ue.usePlugin.bind(ue), hr = "0.3.0-canary.20", fr = {
|
|
1302
1320
|
kind: "Slide",
|
|
1321
|
+
config: { enableShadowDOM: !1 },
|
|
1303
1322
|
setup(e) {
|
|
1304
|
-
console.log("[Slide] setup @ 0.3.0-canary.
|
|
1305
|
-
const t = new
|
|
1306
|
-
if (t.info("[Slide] setup @ 0.3.0-canary.
|
|
1323
|
+
console.log("[Slide] setup @ 0.3.0-canary.20 (" + e.appId + ")");
|
|
1324
|
+
const t = new X(e);
|
|
1325
|
+
if (t.info("[Slide] setup @ 0.3.0-canary.20"), !e.attributes.taskId)
|
|
1307
1326
|
throw new Error("[Slide] no taskId");
|
|
1308
|
-
const s = e.createStorage("slide", e.attributes), r = e.getAppOptions() || {},
|
|
1327
|
+
const s = e.createStorage("slide", e.attributes), r = e.getAppOptions() || {}, o = r.renderOptions || {}, i = new De(), n = new F({
|
|
1309
1328
|
interactive: !0,
|
|
1310
1329
|
mode: "interactive",
|
|
1311
1330
|
enableGlobalClick: !0,
|
|
1312
|
-
timestamp:
|
|
1331
|
+
timestamp: Rt(e),
|
|
1313
1332
|
logger: r.logger || t,
|
|
1314
1333
|
renderOptions: {
|
|
1315
|
-
minFPS:
|
|
1316
|
-
maxFPS:
|
|
1317
|
-
autoFPS:
|
|
1318
|
-
autoResolution:
|
|
1319
|
-
resolution:
|
|
1320
|
-
maxResolutionLevel:
|
|
1321
|
-
transactionBgColor:
|
|
1334
|
+
minFPS: o.minFPS || 25,
|
|
1335
|
+
maxFPS: o.maxFPS || 30,
|
|
1336
|
+
autoFPS: o.autoFPS ?? !0,
|
|
1337
|
+
autoResolution: o.autoResolution ?? !0,
|
|
1338
|
+
resolution: o.resolution,
|
|
1339
|
+
maxResolutionLevel: o.maxResolutionLevel,
|
|
1340
|
+
transactionBgColor: o.transactionBgColor || Be(e.box.$content)
|
|
1322
1341
|
},
|
|
1323
1342
|
rtcAudio: r.rtcAudio,
|
|
1324
1343
|
useLocalCache: r.useLocalCache,
|
|
@@ -1329,30 +1348,30 @@ const lr = /* @__PURE__ */ ue.usePlugin.bind(ue), cr = "0.3.0-canary.19", dr = {
|
|
|
1329
1348
|
taskId: s.state.taskId,
|
|
1330
1349
|
url: s.state.url
|
|
1331
1350
|
});
|
|
1332
|
-
return Object.assign(
|
|
1333
|
-
|
|
1351
|
+
return Object.assign(n, { context: e, logger: t }), i.push(Re.set(e.appId, n, e.box)), i.push(n.events.on("freeze", () => t.info("[Slide] freeze"))), i.push(n.events.on("unfreeze", () => t.info("[Slide] unfreeze"))), i.push(
|
|
1352
|
+
n.events.on(
|
|
1334
1353
|
"prepareError",
|
|
1335
1354
|
(a) => t.info("[Slide] fetch slide info failed: " + a.message)
|
|
1336
1355
|
)
|
|
1337
1356
|
), i.push(
|
|
1338
|
-
|
|
1357
|
+
n.events.on(
|
|
1339
1358
|
"renderError",
|
|
1340
1359
|
({ error: a, index: l }) => t.info(`[Slide] render failed [${l}]: ${a.message}`)
|
|
1341
1360
|
)
|
|
1342
|
-
), e.box.mountStyles(
|
|
1361
|
+
), e.box.mountStyles(F.styles), e.box.mountStage(n.$slide), e.box.mountFooter(n.$footer), e.box.mountContent(n.$content), i.push(() => n.destroy()), ir({ context: e, storage: s, viewer: n, sideEffect: i, logger: t }), e.emitter.on("destroy", () => {
|
|
1343
1362
|
t.info("[Slide] destroy"), t.destroy(), i.flushAll();
|
|
1344
|
-
}),
|
|
1363
|
+
}), n;
|
|
1345
1364
|
}
|
|
1346
1365
|
};
|
|
1347
1366
|
export {
|
|
1348
1367
|
Fe as DefaultUrl,
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1368
|
+
mr as Slide,
|
|
1369
|
+
F as SlideViewer,
|
|
1370
|
+
dr as addHooks,
|
|
1371
|
+
fr as default,
|
|
1372
|
+
ur as previewSlide,
|
|
1354
1373
|
Re as refrigerator,
|
|
1355
|
-
|
|
1356
|
-
|
|
1374
|
+
pr as usePlugin,
|
|
1375
|
+
hr as version
|
|
1357
1376
|
};
|
|
1358
1377
|
//# sourceMappingURL=main.mjs.map
|