@xwadex/fesd 0.0.53 → 0.0.55
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/image-preview-bundle.js +282 -279
- package/dist/image-preview-bundle.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var Ds = Object.defineProperty;
|
|
2
2
|
var ks = (n, i, t) => i in n ? Ds(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
|
|
3
|
-
var Xe = (n, i, t) => (ks(n, typeof i != "symbol" ? i + "" : i, t), t),
|
|
3
|
+
var Xe = (n, i, t) => (ks(n, typeof i != "symbol" ? i + "" : i, t), t), $s = (n, i, t) => {
|
|
4
4
|
if (!i.has(n))
|
|
5
5
|
throw TypeError("Cannot " + t);
|
|
6
6
|
};
|
|
@@ -9,15 +9,15 @@ var h = (n, i, t) => {
|
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
i instanceof WeakSet ? i.add(n) : i.set(n, t);
|
|
11
11
|
};
|
|
12
|
-
var d = (n, i, t) => (
|
|
13
|
-
import { OverlayScrollbars as
|
|
12
|
+
var d = (n, i, t) => ($s(n, i, "access private method"), t);
|
|
13
|
+
import { OverlayScrollbars as ze } from "overlayscrollbars";
|
|
14
14
|
import f from "jquery";
|
|
15
15
|
import "./vendor-bundle.js";
|
|
16
16
|
import "validator";
|
|
17
17
|
import "flatpickr";
|
|
18
18
|
import ti from "vanilla-lazyload";
|
|
19
|
-
import { lock as
|
|
20
|
-
const
|
|
19
|
+
import { lock as xs, unlock as _s } from "tua-body-scroll-lock";
|
|
20
|
+
const Se = {
|
|
21
21
|
SETTINGS: {
|
|
22
22
|
videoId: null,
|
|
23
23
|
videoType: null,
|
|
@@ -45,7 +45,9 @@ const ze = {
|
|
|
45
45
|
init: null,
|
|
46
46
|
afterInit: null,
|
|
47
47
|
beforeDestroy: null,
|
|
48
|
-
afterUpdate: null
|
|
48
|
+
afterUpdate: null,
|
|
49
|
+
openModal: null,
|
|
50
|
+
closeModal: null
|
|
49
51
|
},
|
|
50
52
|
// video4 target 內放置結構 index 對應 videoLayoutNo
|
|
51
53
|
LAYOUT: [
|
|
@@ -56,6 +58,22 @@ const ze = {
|
|
|
56
58
|
<div class="overlay"></div>
|
|
57
59
|
`
|
|
58
60
|
],
|
|
61
|
+
COOKIEDISAGREELAYOUT: `
|
|
62
|
+
<div class="disagree-inner">
|
|
63
|
+
<div class="icon"> <svg xmlns="http://www.w3.org/2000/svg" width="7" height="25" viewBox="0 0 7 25"
|
|
64
|
+
fill="none">
|
|
65
|
+
<path
|
|
66
|
+
d="M0 0H6.96277L5.77128 16.1948H1.22872L0 0ZM0 22.0304C0 21.1556 0.322695 20.442 0.968085 19.8895C1.6383 19.337 2.48227 19.0608 3.5 19.0608C4.51773 19.0608 5.34929 19.337 5.99468 19.8895C6.66489 20.442 7 21.1556 7 22.0304C7 22.9052 6.66489 23.6188 5.99468 24.1713C5.34929 24.7238 4.51773 25 3.5 25C2.48227 25 1.6383 24.7238 0.968085 24.1713C0.322695 23.6188 0 22.9052 0 22.0304Z"
|
|
67
|
+
fill="white"></path>
|
|
68
|
+
</svg></div>
|
|
69
|
+
<div class="title ch">由於未授權 Cookie 使用,影片無法播放</div>
|
|
70
|
+
<div class="title en">The video can’t be played due to unauthorized use of cookies.</div>
|
|
71
|
+
<div class="text">
|
|
72
|
+
<div class="box"><span>您可前往 </span><span data-cookie data-cookie-open="advance">Cookie 偏好設定</span><span> 進行修改</span></div>
|
|
73
|
+
<div class="box"><span>Modify your </span><span data-cookie data-cookie-open="advance">cookie preferences.</span></div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
`,
|
|
59
77
|
// videoPlayer customElements 內結構
|
|
60
78
|
TEMPLATE() {
|
|
61
79
|
return '<div class="player-container"><div class="player-wrapper"></div></div>';
|
|
@@ -305,7 +323,7 @@ const ze = {
|
|
|
305
323
|
// hover 毫秒 ?
|
|
306
324
|
speed: 600
|
|
307
325
|
}
|
|
308
|
-
},
|
|
326
|
+
}, kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
309
327
|
__proto__: null,
|
|
310
328
|
anchor4: mt,
|
|
311
329
|
aost4: ei,
|
|
@@ -318,13 +336,13 @@ const ze = {
|
|
|
318
336
|
ripple4: ni,
|
|
319
337
|
share4: Cs,
|
|
320
338
|
tab4: ii,
|
|
321
|
-
video4:
|
|
339
|
+
video4: Se
|
|
322
340
|
}, Symbol.toStringTag, { value: "Module" })), S = {
|
|
323
341
|
before: "beforebegin",
|
|
324
342
|
after: "afterend",
|
|
325
343
|
append: "beforeend",
|
|
326
344
|
prepend: "afterbegin"
|
|
327
|
-
}, dt = (n) => typeof n == "string" && n !== "",
|
|
345
|
+
}, dt = (n) => typeof n == "string" && n !== "", De = (n) => n instanceof HTMLElement, ut = (n) => n instanceof NodeList, E = (n) => k(n) !== null, G = (n) => typeof n == "function", k = (n) => De(n) ? n : document.querySelector(n), $ = (n) => ut(n) ? n : document.querySelectorAll(n), Ms = () => Math.random().toString(36).substr(2, 9), Is = (n) => {
|
|
328
346
|
const i = document.createElement("div");
|
|
329
347
|
return i.innerHTML = n, i.childNodes;
|
|
330
348
|
}, qs = (n) => {
|
|
@@ -334,7 +352,7 @@ const ze = {
|
|
|
334
352
|
return n;
|
|
335
353
|
}
|
|
336
354
|
return JSON.parse(n);
|
|
337
|
-
},
|
|
355
|
+
}, L = (n, i) => {
|
|
338
356
|
console.warn(`[${n} warn]: ${i}`);
|
|
339
357
|
}, Ye = (n, i) => {
|
|
340
358
|
console.error(`[${n} error]: ${i}`);
|
|
@@ -379,33 +397,33 @@ const ze = {
|
|
|
379
397
|
easeOutQuart(n, i, t, e) {
|
|
380
398
|
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
|
381
399
|
}
|
|
382
|
-
},
|
|
400
|
+
}, ke = (n, i) => {
|
|
383
401
|
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", g = c ? "width" : "height", m = E(e) ? k(e) : document.scrollingElement, v = m[u], w = E(t) ? k(t).getBoundingClientRect()[p] : 0 - v, b = E(s) ? k(s).getBoundingClientRect()[g] : 0, T = w - a - b, C = 15;
|
|
384
402
|
let y = 0;
|
|
385
403
|
if (T === 0)
|
|
386
404
|
return;
|
|
387
|
-
const D = (
|
|
405
|
+
const D = (A) => {
|
|
388
406
|
const z = k(t);
|
|
389
|
-
i && i.emit(
|
|
407
|
+
i && i.emit(A, z), !i && n.on && G(n.on[A]) && n.on[A](z);
|
|
390
408
|
};
|
|
391
409
|
D("beforeScroll");
|
|
392
410
|
const U = () => {
|
|
393
411
|
y += C;
|
|
394
|
-
const
|
|
395
|
-
m[u] =
|
|
412
|
+
const A = Os[r](y, v, T, o);
|
|
413
|
+
m[u] = A, y < o && requestAnimationFrame(U), y >= o && D("afterScroll");
|
|
396
414
|
};
|
|
397
415
|
requestAnimationFrame(U);
|
|
398
416
|
};
|
|
399
|
-
var
|
|
417
|
+
var V, $e, bt, ai, yt, ri;
|
|
400
418
|
class oi {
|
|
401
419
|
constructor(i, t = {}) {
|
|
402
|
-
h(this,
|
|
420
|
+
h(this, V);
|
|
403
421
|
h(this, bt);
|
|
404
422
|
h(this, yt);
|
|
405
423
|
this.__storage__ = {
|
|
406
424
|
el: i,
|
|
407
425
|
options: t
|
|
408
|
-
}, this.active = "data-anchor-active", d(this,
|
|
426
|
+
}, this.active = "data-anchor-active", d(this, V, $e).call(this);
|
|
409
427
|
}
|
|
410
428
|
destroy() {
|
|
411
429
|
const { elements: i } = this;
|
|
@@ -415,12 +433,12 @@ class oi {
|
|
|
415
433
|
}
|
|
416
434
|
update() {
|
|
417
435
|
var i;
|
|
418
|
-
return d(i = this.destroy(),
|
|
436
|
+
return d(i = this.destroy(), V, $e).call(i), this.emit("afterUpdate"), this;
|
|
419
437
|
}
|
|
420
438
|
static run(i) {
|
|
421
439
|
const { SETTINGS: t } = mt, e = Object.assign({}, t, i);
|
|
422
440
|
setTimeout(() => {
|
|
423
|
-
|
|
441
|
+
ke(e);
|
|
424
442
|
}, e.delay);
|
|
425
443
|
}
|
|
426
444
|
static url(i) {
|
|
@@ -429,16 +447,16 @@ class oi {
|
|
|
429
447
|
return;
|
|
430
448
|
const r = Object.assign({}, t, i, { target: a });
|
|
431
449
|
setTimeout(() => {
|
|
432
|
-
|
|
450
|
+
ke(r);
|
|
433
451
|
}, r.delay);
|
|
434
452
|
}
|
|
435
453
|
}
|
|
436
|
-
|
|
454
|
+
V = new WeakSet(), $e = function() {
|
|
437
455
|
const { el: i, options: t } = this.__storage__;
|
|
438
456
|
if (!dt(i) || !E(i))
|
|
439
457
|
return;
|
|
440
458
|
const { SETTINGS: e, EVENTS: s } = mt;
|
|
441
|
-
if (this.elements = t.state == "not active" ?
|
|
459
|
+
if (this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.elements = $(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
442
460
|
for (const [o, a] of Object.entries(this.options.on))
|
|
443
461
|
this.__events__[o] = [a];
|
|
444
462
|
d(this, bt, ai).call(this);
|
|
@@ -461,7 +479,7 @@ K = new WeakSet(), ke = function() {
|
|
|
461
479
|
this.removeEventListener("click", t), setTimeout(() => {
|
|
462
480
|
this.addEventListener("click", t);
|
|
463
481
|
}, s.speed), setTimeout(() => {
|
|
464
|
-
|
|
482
|
+
ke(s, e);
|
|
465
483
|
}, s.delay);
|
|
466
484
|
};
|
|
467
485
|
Object.assign(oi.prototype, j);
|
|
@@ -474,15 +492,15 @@ const { MODALS: O } = window, Ns = (n) => {
|
|
|
474
492
|
s.append(o);
|
|
475
493
|
}), e.children[0];
|
|
476
494
|
};
|
|
477
|
-
var wt, ci, Tt, di, Et, ui,
|
|
495
|
+
var wt, ci, Tt, di, Et, ui, At, hi, Lt, pi;
|
|
478
496
|
class li extends HTMLElement {
|
|
479
497
|
constructor() {
|
|
480
498
|
super();
|
|
481
499
|
h(this, wt);
|
|
482
500
|
h(this, Tt);
|
|
483
501
|
h(this, Et);
|
|
484
|
-
h(this, Lt);
|
|
485
502
|
h(this, At);
|
|
503
|
+
h(this, Lt);
|
|
486
504
|
this.initialize = !1;
|
|
487
505
|
}
|
|
488
506
|
static get observedAttributes() {
|
|
@@ -491,7 +509,7 @@ class li extends HTMLElement {
|
|
|
491
509
|
attributeChangedCallback(t, e, s) {
|
|
492
510
|
switch (t) {
|
|
493
511
|
case ":state":
|
|
494
|
-
d(this,
|
|
512
|
+
d(this, Lt, pi).call(this, s);
|
|
495
513
|
break;
|
|
496
514
|
}
|
|
497
515
|
}
|
|
@@ -512,18 +530,18 @@ wt = new WeakSet(), ci = function() {
|
|
|
512
530
|
const { ATTRS: t } = P;
|
|
513
531
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
|
514
532
|
const e = this.getAttribute(t.id) || Ms();
|
|
515
|
-
this.getAttribute(t.id) || (
|
|
533
|
+
this.getAttribute(t.id) || (L(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), O[e] && L(`the ${t.id} "${e}" is already be used.`), O[e] = this, d(this, Tt, di).call(this);
|
|
516
534
|
}, Tt = new WeakSet(), di = function() {
|
|
517
535
|
this.childDom = this.childNodes, this.template = Ns(this), this.innerHTML = "", this.append(this.template), d(this, Et, ui).call(this);
|
|
518
536
|
}, Et = new WeakSet(), ui = function() {
|
|
519
537
|
const t = this.querySelector(".modal-scroller");
|
|
520
|
-
this.__scroller__ =
|
|
538
|
+
this.__scroller__ = ze(t, {
|
|
521
539
|
overflowBehavior: {
|
|
522
540
|
x: "hidden"
|
|
523
541
|
},
|
|
524
542
|
autoUpdate: !0
|
|
525
|
-
}), window.modalScroll = this.__scroller__, d(this,
|
|
526
|
-
},
|
|
543
|
+
}), window.modalScroll = this.__scroller__, d(this, At, hi).call(this);
|
|
544
|
+
}, At = new WeakSet(), hi = function() {
|
|
527
545
|
var a, r, l;
|
|
528
546
|
const t = this, { ATTRS: e } = P, { close: s, destroy: o } = e;
|
|
529
547
|
(a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
|
|
@@ -539,7 +557,7 @@ wt = new WeakSet(), ci = function() {
|
|
|
539
557
|
}), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
|
|
540
558
|
c.stopPropagation();
|
|
541
559
|
});
|
|
542
|
-
},
|
|
560
|
+
}, Lt = new WeakSet(), pi = function(t) {
|
|
543
561
|
const { __scroller__: e } = this;
|
|
544
562
|
if (t === "open") {
|
|
545
563
|
if (this.style.display = "block", e) {
|
|
@@ -577,7 +595,7 @@ const { MODALS: We } = window, ht = {}, mi = (n, i, ...t) => {
|
|
|
577
595
|
const e = n[i];
|
|
578
596
|
e && G(e) && e.apply(n, t);
|
|
579
597
|
}, gi = (n, ...i) => {
|
|
580
|
-
n && G(n) && n.apply(
|
|
598
|
+
n && G(n) && n.apply(K, i);
|
|
581
599
|
}, Fe = (n, i) => {
|
|
582
600
|
const { target: t } = n, e = We[t] || k(n.target);
|
|
583
601
|
e && fi(n, i), e || Ps(n, i);
|
|
@@ -605,7 +623,7 @@ const { MODALS: We } = window, ht = {}, mi = (n, i, ...t) => {
|
|
|
605
623
|
}, Ps = async (n, i) => {
|
|
606
624
|
const { target: t, route: e, container: s, on: o, e: a } = n;
|
|
607
625
|
if (!e)
|
|
608
|
-
return
|
|
626
|
+
return L("modal4", "cannot find target or data-modal-route is not defined");
|
|
609
627
|
const r = (l, ...c) => {
|
|
610
628
|
i && (i.emit(l, ...c), mi(i, o[l], ...c)), i || gi(o[l], ...c);
|
|
611
629
|
};
|
|
@@ -660,7 +678,7 @@ tt = new WeakSet(), xe = function() {
|
|
|
660
678
|
if (!dt(i) || !E(i))
|
|
661
679
|
return;
|
|
662
680
|
const { SETTINGS: e, EVENTS: s } = P;
|
|
663
|
-
if (this.elements = t.state == "not active" ?
|
|
681
|
+
if (this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
664
682
|
for (const [o, a] of Object.entries(this.options.on))
|
|
665
683
|
this.__events__[o] = [a];
|
|
666
684
|
d(this, St, vi).call(this);
|
|
@@ -671,7 +689,7 @@ tt = new WeakSet(), xe = function() {
|
|
|
671
689
|
}), this.emit("init");
|
|
672
690
|
}, Dt = new WeakSet(), bi = function(i) {
|
|
673
691
|
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = qs(this.getAttribute("data-modal-on"));
|
|
674
|
-
o && typeof o != "object" &&
|
|
692
|
+
o && typeof o != "object" && L("modal4", "data-modal-on must be a json string.");
|
|
675
693
|
const a = {
|
|
676
694
|
target: this.getAttribute("data-modal-target") || t.target,
|
|
677
695
|
action: this.getAttribute("data-modal-action") || t.action,
|
|
@@ -684,8 +702,8 @@ tt = new WeakSet(), xe = function() {
|
|
|
684
702
|
this.addEventListener("click", e);
|
|
685
703
|
}, 200), Fe(a, s);
|
|
686
704
|
};
|
|
687
|
-
let
|
|
688
|
-
Object.assign(
|
|
705
|
+
let K = B;
|
|
706
|
+
Object.assign(K.prototype, j);
|
|
689
707
|
customElements.define("modern-modal", li);
|
|
690
708
|
const js = (n, i) => {
|
|
691
709
|
const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
|
|
@@ -703,7 +721,7 @@ const js = (n, i) => {
|
|
|
703
721
|
}
|
|
704
722
|
});
|
|
705
723
|
}, zs = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
|
|
706
|
-
var et,
|
|
724
|
+
var et, _e, kt, wi;
|
|
707
725
|
class yi {
|
|
708
726
|
constructor(i, t = {}) {
|
|
709
727
|
h(this, et);
|
|
@@ -711,7 +729,7 @@ class yi {
|
|
|
711
729
|
this.__storage__ = {
|
|
712
730
|
el: i,
|
|
713
731
|
options: t
|
|
714
|
-
}, this.active = "data-aost-active", d(this, et,
|
|
732
|
+
}, this.active = "data-aost-active", d(this, et, _e).call(this);
|
|
715
733
|
}
|
|
716
734
|
destroy(i) {
|
|
717
735
|
const { elements: t, options: e } = this;
|
|
@@ -727,15 +745,15 @@ class yi {
|
|
|
727
745
|
}
|
|
728
746
|
update(i) {
|
|
729
747
|
var t;
|
|
730
|
-
d(t = this.destroy(i), et,
|
|
748
|
+
d(t = this.destroy(i), et, _e).call(t);
|
|
731
749
|
}
|
|
732
750
|
}
|
|
733
|
-
et = new WeakSet(),
|
|
751
|
+
et = new WeakSet(), _e = function() {
|
|
734
752
|
const { el: i, options: t } = this.__storage__;
|
|
735
753
|
if (!dt(i) || !E(i))
|
|
736
754
|
return;
|
|
737
755
|
const { SETTINGS: e, EVENTS: s } = ei;
|
|
738
|
-
if (this.elements = t.state == "not active" ?
|
|
756
|
+
if (this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
739
757
|
for (const [o, a] of Object.entries(this.options.on))
|
|
740
758
|
this.__events__[o] = [a];
|
|
741
759
|
d(this, kt, wi).call(this);
|
|
@@ -751,19 +769,19 @@ et = new WeakSet(), $e = function() {
|
|
|
751
769
|
};
|
|
752
770
|
Object.assign(yi.prototype, j);
|
|
753
771
|
const Bs = (n) => {
|
|
754
|
-
const { TEMPLATE: i } =
|
|
772
|
+
const { TEMPLATE: i } = Se, { childDom: t } = n, e = document.createElement("div");
|
|
755
773
|
e.innerHTML = i();
|
|
756
774
|
const s = e.querySelector(".player-wrapper");
|
|
757
775
|
return [...t].forEach((o) => {
|
|
758
776
|
s.append(o);
|
|
759
777
|
}), e.children[0];
|
|
760
778
|
};
|
|
761
|
-
var
|
|
779
|
+
var $t, Ti, xt, Ei, _t, Ai, Ct, Li, Ht, Si, Mt, Di, It, ki, qt, $i, Ot, xi, Nt, _i;
|
|
762
780
|
class Ws extends HTMLElement {
|
|
763
781
|
constructor() {
|
|
764
782
|
super();
|
|
765
|
-
h(this, xt);
|
|
766
783
|
h(this, $t);
|
|
784
|
+
h(this, xt);
|
|
767
785
|
h(this, _t);
|
|
768
786
|
// youtube iframe
|
|
769
787
|
h(this, Ct);
|
|
@@ -778,7 +796,7 @@ class Ws extends HTMLElement {
|
|
|
778
796
|
h(this, Ot);
|
|
779
797
|
// 2026.01.15 新增 video
|
|
780
798
|
h(this, Nt);
|
|
781
|
-
d(this,
|
|
799
|
+
d(this, $t, Ti).call(this);
|
|
782
800
|
}
|
|
783
801
|
play() {
|
|
784
802
|
const { videoType: t } = this;
|
|
@@ -815,67 +833,51 @@ class Ws extends HTMLElement {
|
|
|
815
833
|
}
|
|
816
834
|
}
|
|
817
835
|
}
|
|
818
|
-
|
|
836
|
+
$t = new WeakSet(), Ti = function() {
|
|
819
837
|
if (!this.getAttribute("video-id")) {
|
|
820
|
-
|
|
838
|
+
L("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
|
821
839
|
return;
|
|
822
840
|
}
|
|
823
|
-
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.videoMode = this.getAttribute("video-mode"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), this.videoInboxImg = this.getAttribute("video-inbox-img"), d(this,
|
|
824
|
-
},
|
|
825
|
-
this.childDom = this.childNodes, this.template = Bs(this), this.innerHTML = "", this.append(this.template), d(this, _t,
|
|
826
|
-
}, _t = new WeakSet(),
|
|
827
|
-
const { videoType: t, videoMode: e } = this;
|
|
828
|
-
let
|
|
829
|
-
function
|
|
830
|
-
f(
|
|
831
|
-
`
|
|
832
|
-
<div class="disagree-inner">
|
|
833
|
-
<div class="icon"> <svg xmlns="http://www.w3.org/2000/svg" width="7" height="25" viewBox="0 0 7 25"
|
|
834
|
-
fill="none">
|
|
835
|
-
<path
|
|
836
|
-
d="M0 0H6.96277L5.77128 16.1948H1.22872L0 0ZM0 22.0304C0 21.1556 0.322695 20.442 0.968085 19.8895C1.6383 19.337 2.48227 19.0608 3.5 19.0608C4.51773 19.0608 5.34929 19.337 5.99468 19.8895C6.66489 20.442 7 21.1556 7 22.0304C7 22.9052 6.66489 23.6188 5.99468 24.1713C5.34929 24.7238 4.51773 25 3.5 25C2.48227 25 1.6383 24.7238 0.968085 24.1713C0.322695 23.6188 0 22.9052 0 22.0304Z"
|
|
837
|
-
fill="white"></path>
|
|
838
|
-
</svg></div>
|
|
839
|
-
<div class="title ch">由於未授權 Cookie 使用,影片無法播放</div>
|
|
840
|
-
<div class="title en">The video can’t be played due to unauthorized use of cookies.</div>
|
|
841
|
-
<div class="text">
|
|
842
|
-
<div class="box"><span>您可前往 </span><span data-cookie-open>Cookie 偏好設定</span><span> 進行修改</span></div>
|
|
843
|
-
<div class="box"><span>Modify your </span><span data-cookie-open>cookie preferences.</span></div>
|
|
844
|
-
</div>
|
|
845
|
-
</div>`
|
|
846
|
-
);
|
|
841
|
+
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.videoMode = this.getAttribute("video-mode"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), this.videoInboxImg = this.getAttribute("video-inbox-img"), d(this, xt, Ei).call(this);
|
|
842
|
+
}, xt = new WeakSet(), Ei = function() {
|
|
843
|
+
this.childDom = this.childNodes, this.template = Bs(this), this.innerHTML = "", this.append(this.template), d(this, _t, Ai).call(this);
|
|
844
|
+
}, _t = new WeakSet(), Ai = function() {
|
|
845
|
+
const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: s } = Se;
|
|
846
|
+
let o = "";
|
|
847
|
+
function a(r) {
|
|
848
|
+
f(r).addClass("cookie-disagree"), f(".cookie-disagree").append(s);
|
|
847
849
|
}
|
|
848
850
|
switch (t) {
|
|
849
851
|
case "youtubeAPI":
|
|
850
852
|
break;
|
|
851
853
|
case "youtube":
|
|
852
|
-
document.body.wd_youtube == !1 ?
|
|
854
|
+
document.body.wd_youtube == !1 ? a("video-player") : o = d(this, Ct, Li).call(this);
|
|
853
855
|
break;
|
|
854
856
|
case "youkuAPI":
|
|
855
857
|
break;
|
|
856
858
|
case "youku":
|
|
857
|
-
document.body.wd_youku == !1 ?
|
|
859
|
+
document.body.wd_youku == !1 ? a("video-player") : o = d(this, Mt, Di).call(this);
|
|
858
860
|
break;
|
|
859
861
|
case "vimeo":
|
|
860
|
-
document.body.wd_vimeo == !1 ?
|
|
862
|
+
document.body.wd_vimeo == !1 ? a("video-player") : o = d(this, Ht, Si).call(this);
|
|
861
863
|
break;
|
|
862
864
|
case "bilibili":
|
|
863
|
-
document.body.wd_bilibili == !1 ?
|
|
865
|
+
document.body.wd_bilibili == !1 ? a("video-player") : o = d(this, It, ki).call(this);
|
|
864
866
|
break;
|
|
865
867
|
case "instagram":
|
|
866
|
-
document.body.wd_instagram == !1 ?
|
|
868
|
+
document.body.wd_instagram == !1 ? a(".instagram-media") : o = d(this, qt, $i).call(this);
|
|
867
869
|
break;
|
|
868
870
|
case "tiktok":
|
|
869
|
-
document.body.wd_tiktok == !1 ?
|
|
871
|
+
document.body.wd_tiktok == !1 ? a("video-player") : o = d(this, Ot, xi).call(this);
|
|
870
872
|
break;
|
|
871
873
|
case "videojs":
|
|
872
874
|
break;
|
|
873
875
|
case "video":
|
|
874
|
-
|
|
876
|
+
o = d(this, Nt, _i).call(this);
|
|
875
877
|
break;
|
|
876
878
|
}
|
|
877
|
-
this.querySelector(".player-wrapper").insertAdjacentHTML(S.prepend,
|
|
878
|
-
}, Ct = new WeakSet(),
|
|
879
|
+
this.querySelector(".player-wrapper").insertAdjacentHTML(S.prepend, o);
|
|
880
|
+
}, Ct = new WeakSet(), Li = function() {
|
|
879
881
|
const { videoId: t, autoplay: e, startTime: s } = this;
|
|
880
882
|
return `<iframe src="https://www.youtube.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}&start=${s}&mute=1&loop=1&enablejsapi=1" frameborder="0" allowfullscreen="0" volumn="0" allow="${e === "on" ? "autoplay;" : ""} encrypted-media; gyroscope; picture-in-picture;"></iframe>`;
|
|
881
883
|
}, Ht = new WeakSet(), Si = function() {
|
|
@@ -887,10 +889,10 @@ xt = new WeakSet(), Ti = function() {
|
|
|
887
889
|
}, It = new WeakSet(), ki = function() {
|
|
888
890
|
const { videoId: t, autoplay: e } = this;
|
|
889
891
|
return `<iframe src="//player.bilibili.com/player.html?bvid=${t}&page=1&as_wide=1&high_quality=1&danmaku=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>`;
|
|
890
|
-
}, qt = new WeakSet(),
|
|
892
|
+
}, qt = new WeakSet(), $i = function() {
|
|
891
893
|
const { videoId: t, autoplay: e } = this;
|
|
892
894
|
return `<iframe class="instagram-media instagram-media-rendered" id="instagram-embed-0" src="https://www.instagram.com/p/${t}/embed/" width="num-w" height=" num-h" scrolling="auto" frameborder="0" data-instgrm-payload-id="instagram-media-payload-0"></iframe>`;
|
|
893
|
-
}, Ot = new WeakSet(),
|
|
895
|
+
}, Ot = new WeakSet(), xi = function() {
|
|
894
896
|
const { videoId: t, autoplay: e } = this;
|
|
895
897
|
return `<iframe name="__tt_embed__v79271677875424740" sandbox="allow-popups allow-popups-to-escape-sandbox allow-scripts allow-top-navigation allow-same-origin" src="https://www.tiktok.com/player/v1/${t}?&${e === "on" ? "autoplay=1" : ""}"></iframe>`;
|
|
896
898
|
}, Nt = new WeakSet(), _i = function() {
|
|
@@ -906,7 +908,7 @@ function Ci(n) {
|
|
|
906
908
|
}
|
|
907
909
|
function Hi(n) {
|
|
908
910
|
const i = Ci(n);
|
|
909
|
-
Z += 1, Z === 1 && (document.documentElement.classList.add("scrollLock"),
|
|
911
|
+
Z += 1, Z === 1 && (document.documentElement.classList.add("scrollLock"), xs(i));
|
|
910
912
|
}
|
|
911
913
|
function Mi(n) {
|
|
912
914
|
if (Z = Math.max(0, Z - 1), Z === 0) {
|
|
@@ -914,7 +916,7 @@ function Mi(n) {
|
|
|
914
916
|
_s(i), document.documentElement.classList.remove("scrollLock");
|
|
915
917
|
}
|
|
916
918
|
}
|
|
917
|
-
async function
|
|
919
|
+
async function $n(n = 0) {
|
|
918
920
|
if (f(".loading-wrapper").length)
|
|
919
921
|
return;
|
|
920
922
|
f("body").append(`
|
|
@@ -936,22 +938,22 @@ function xn() {
|
|
|
936
938
|
f(".loading-wrapper").remove(), Mi();
|
|
937
939
|
});
|
|
938
940
|
}
|
|
939
|
-
function
|
|
940
|
-
new
|
|
941
|
+
function _n(n, i) {
|
|
942
|
+
new bn(n, i);
|
|
941
943
|
}
|
|
942
944
|
function Gs() {
|
|
943
945
|
const n = document.querySelector("[data-aost]") && new yi("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new oi("[data-anchor-target]"), t = new ti({ callback_loaded: () => {
|
|
944
|
-
} }), e = new
|
|
946
|
+
} }), e = new un();
|
|
945
947
|
n == null || n.update(), t.update(), e.reValidate(), i == null || i.update();
|
|
946
948
|
}
|
|
947
|
-
function
|
|
949
|
+
function Cn(n, i = () => {
|
|
948
950
|
}) {
|
|
949
951
|
f(`[data-tab-content=${n}]`).fadeIn(function() {
|
|
950
952
|
typeof i == "function" && i();
|
|
951
953
|
}).siblings("[data-tab-content]").hide(), Gs();
|
|
952
954
|
}
|
|
953
|
-
function
|
|
954
|
-
|
|
955
|
+
function Hn() {
|
|
956
|
+
ze(
|
|
955
957
|
{
|
|
956
958
|
target: document.body,
|
|
957
959
|
cancel: {
|
|
@@ -975,28 +977,28 @@ function Cn() {
|
|
|
975
977
|
}
|
|
976
978
|
);
|
|
977
979
|
}
|
|
978
|
-
function
|
|
980
|
+
function Mn() {
|
|
979
981
|
window.onpageshow = function(n) {
|
|
980
982
|
n.persisted && window.location.reload();
|
|
981
983
|
};
|
|
982
984
|
}
|
|
983
|
-
function
|
|
985
|
+
function In() {
|
|
984
986
|
const n = navigator.userAgent;
|
|
985
987
|
return {
|
|
986
988
|
BigSurUP: /Mac OS X 10.15/.test(n) || /Mac OS X 10_15_7/.test(n) || /Mac OS X 10_15_8/.test(n) || /Mac OS X 10_15_9/.test(n) || /Mac OS X 11_/.test(n) || /Mac OS X 12_/.test(n)
|
|
987
989
|
};
|
|
988
990
|
}
|
|
989
|
-
function
|
|
991
|
+
function qn(n, i) {
|
|
990
992
|
f(n).on("click", function() {
|
|
991
993
|
f(this).toggleClass(i);
|
|
992
994
|
});
|
|
993
995
|
}
|
|
994
|
-
function
|
|
996
|
+
function On(n, i) {
|
|
995
997
|
f(n).on("click", function() {
|
|
996
998
|
f(n).not(this).removeClass(i), f(this).addClass(i);
|
|
997
999
|
});
|
|
998
1000
|
}
|
|
999
|
-
const
|
|
1001
|
+
const Nn = (n) => new Promise((i) => {
|
|
1000
1002
|
let t = setTimeout(() => (clearTimeout(t), i()), n);
|
|
1001
1003
|
});
|
|
1002
1004
|
function Rs(n, i = 250) {
|
|
@@ -1008,7 +1010,7 @@ function Rs(n, i = 250) {
|
|
|
1008
1010
|
}, i);
|
|
1009
1011
|
};
|
|
1010
1012
|
}
|
|
1011
|
-
function
|
|
1013
|
+
function Pn(n, i = 250) {
|
|
1012
1014
|
let t, e;
|
|
1013
1015
|
return function() {
|
|
1014
1016
|
const s = this, o = arguments, a = +/* @__PURE__ */ new Date();
|
|
@@ -1017,7 +1019,7 @@ function Nn(n, i = 250) {
|
|
|
1017
1019
|
}, i)) : (t = a, n.apply(s, o));
|
|
1018
1020
|
};
|
|
1019
1021
|
}
|
|
1020
|
-
function
|
|
1022
|
+
function jn() {
|
|
1021
1023
|
window._g.interval = [], f(".countdown").each((i, t) => {
|
|
1022
1024
|
const e = Number(f(t).attr("data-seconds")) + 1;
|
|
1023
1025
|
let s = Math.floor(e / 60) + ":" + e % 60;
|
|
@@ -1027,21 +1029,21 @@ function Pn() {
|
|
|
1027
1029
|
}, 1e3);
|
|
1028
1030
|
});
|
|
1029
1031
|
}
|
|
1030
|
-
function
|
|
1032
|
+
function zn(n = 500) {
|
|
1031
1033
|
return new Promise((i, t) => {
|
|
1032
1034
|
let e = setTimeout(() => {
|
|
1033
1035
|
clearTimeout(e), i();
|
|
1034
1036
|
}, n);
|
|
1035
1037
|
});
|
|
1036
1038
|
}
|
|
1037
|
-
function
|
|
1039
|
+
function Bn() {
|
|
1038
1040
|
const n = function() {
|
|
1039
1041
|
let i = window.innerHeight * 0.01;
|
|
1040
1042
|
document.documentElement.style.setProperty("--vh", i + "px");
|
|
1041
1043
|
};
|
|
1042
1044
|
n(), window.addEventListener("resize", Rs(n));
|
|
1043
1045
|
}
|
|
1044
|
-
function
|
|
1046
|
+
function Wn(n, i, t, e, s) {
|
|
1045
1047
|
const o = this, r = f(n).html().split("<br>");
|
|
1046
1048
|
let l = "", c = 0;
|
|
1047
1049
|
r.forEach((u, p) => {
|
|
@@ -1050,11 +1052,11 @@ function Bn(n, i, t, e, s) {
|
|
|
1050
1052
|
});
|
|
1051
1053
|
}), f(n).html(l);
|
|
1052
1054
|
}
|
|
1053
|
-
function
|
|
1055
|
+
function Gn(n, i) {
|
|
1054
1056
|
const t = Math.pow(10, i);
|
|
1055
1057
|
return Math.round(n * t) / t;
|
|
1056
1058
|
}
|
|
1057
|
-
function
|
|
1059
|
+
function Rn(n) {
|
|
1058
1060
|
let i = n.activeIndex, t = n.slides.length;
|
|
1059
1061
|
if (n.params.loop)
|
|
1060
1062
|
switch (n.activeIndex) {
|
|
@@ -1069,18 +1071,18 @@ function Gn(n) {
|
|
|
1069
1071
|
}
|
|
1070
1072
|
return i;
|
|
1071
1073
|
}
|
|
1072
|
-
function
|
|
1074
|
+
function Xn(n, i) {
|
|
1073
1075
|
const t = n.$el, e = n.params.grid.rows, s = i || n.params.slidesPerView * e;
|
|
1074
1076
|
(n.loopedSlides ? n.slides.length - n.loopedSlides * 2 : n.slides.length) <= s ? (t.addClass("swiper-no-swiping"), f(n.params.navigation.nextEl).hide(), f(n.params.navigation.prevEl).hide(), f(n.params.pagination.el).hide(), n.params.autoplay.enabled = !1, n.autoplay.stop()) : (t.removeClass("swiper-no-swiping"), f(n.params.navigation.nextEl).show(), f(n.params.navigation.prevEl).show(), f(n.params.pagination.el).show(), n.params.autoplay.enabled && n.autoplay.start());
|
|
1075
1077
|
}
|
|
1076
|
-
function
|
|
1078
|
+
function Yn(n) {
|
|
1077
1079
|
n.el.querySelectorAll("img.detect-shade").forEach((i) => {
|
|
1078
1080
|
i.addEventListener("load", function() {
|
|
1079
1081
|
detectShade(i);
|
|
1080
1082
|
});
|
|
1081
1083
|
});
|
|
1082
1084
|
}
|
|
1083
|
-
function
|
|
1085
|
+
function Fn(n) {
|
|
1084
1086
|
const i = n.el, t = f(i).find(".swiper-slide-active"), e = f(t).find("video").get(0), s = f(i).find(".swiper-slide video");
|
|
1085
1087
|
n.autoplay.stop(), f(e).off("ended"), e ? (s.each((o, a) => {
|
|
1086
1088
|
a.currentTime = 0;
|
|
@@ -1088,7 +1090,7 @@ function Yn(n) {
|
|
|
1088
1090
|
n.slideNext();
|
|
1089
1091
|
}), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
|
|
1090
1092
|
}
|
|
1091
|
-
function
|
|
1093
|
+
function Un() {
|
|
1092
1094
|
f(".number-grow").each(function(n, i) {
|
|
1093
1095
|
const t = f(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
|
|
1094
1096
|
let r = "";
|
|
@@ -1102,7 +1104,7 @@ function Fn() {
|
|
|
1102
1104
|
});
|
|
1103
1105
|
});
|
|
1104
1106
|
}
|
|
1105
|
-
function
|
|
1107
|
+
function Jn() {
|
|
1106
1108
|
f(".letter-grow").each(function(n, i) {
|
|
1107
1109
|
const t = f(i), s = t.attr("data-letter").split(""), o = () => {
|
|
1108
1110
|
let a = "";
|
|
@@ -1116,22 +1118,22 @@ function Un() {
|
|
|
1116
1118
|
});
|
|
1117
1119
|
});
|
|
1118
1120
|
}
|
|
1119
|
-
function
|
|
1121
|
+
function Zn(n) {
|
|
1120
1122
|
const i = getComputedStyle(n).transform;
|
|
1121
1123
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
|
1122
1124
|
return t ? parseFloat(t[1].split(", ")[12]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[4]) : 0);
|
|
1123
1125
|
}
|
|
1124
|
-
function
|
|
1126
|
+
function Qn(n) {
|
|
1125
1127
|
const i = getComputedStyle(n).transform;
|
|
1126
1128
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
|
1127
1129
|
return t ? parseFloat(t[1].split(", ")[13]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[5]) : 0);
|
|
1128
1130
|
}
|
|
1129
|
-
function
|
|
1131
|
+
function Kn(n) {
|
|
1130
1132
|
const i = document.createElement("div");
|
|
1131
1133
|
return i.innerHTML = n, i.childNodes[0];
|
|
1132
1134
|
}
|
|
1133
|
-
const Ue = (n) => n.videoId !== "" || typeof n.videoId < "u", Xs = (n) => n.$selector.getAttribute("video4-active") === "on", pt = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player
|
|
1134
|
-
var it,
|
|
1135
|
+
const Ue = (n) => n.videoId !== "" || typeof n.videoId < "u", Xs = (n) => n.$selector.getAttribute("video4-active") === "on", pt = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`, Ys = (n) => (console.log(n.videoId, "params.videoId"), `<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="${n.videoId}"></blockquote>`);
|
|
1136
|
+
var it, He, Pt, Ii, jt, qi, st, Me, zt, Oi;
|
|
1135
1137
|
const X = class X {
|
|
1136
1138
|
//*-* 給Article4用的 **//
|
|
1137
1139
|
constructor(i, t = {}) {
|
|
@@ -1140,22 +1142,22 @@ const X = class X {
|
|
|
1140
1142
|
h(this, jt);
|
|
1141
1143
|
h(this, st);
|
|
1142
1144
|
h(this, zt);
|
|
1143
|
-
if (!dt(i) && !
|
|
1145
|
+
if (!dt(i) && !De(i) && !ut(i)) {
|
|
1144
1146
|
Ye("video4", `找不到該物件 -> ${i}`);
|
|
1145
1147
|
return;
|
|
1146
1148
|
}
|
|
1147
1149
|
this.__storage__ = {
|
|
1148
1150
|
el: i,
|
|
1149
1151
|
options: t
|
|
1150
|
-
}, this.active = "data-video-active", d(this, it,
|
|
1152
|
+
}, this.active = "data-video-active", d(this, it, He).call(this);
|
|
1151
1153
|
}
|
|
1152
1154
|
update() {
|
|
1153
|
-
d(this, it,
|
|
1155
|
+
d(this, it, He).call(this);
|
|
1154
1156
|
}
|
|
1155
1157
|
};
|
|
1156
|
-
it = new WeakSet(),
|
|
1157
|
-
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s, LAYOUT: o } =
|
|
1158
|
-
if (t.isGlobal && (X.globalOptions = t), this.elements = t.state == "not active" ?
|
|
1158
|
+
it = new WeakSet(), He = function() {
|
|
1159
|
+
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s, LAYOUT: o } = Se;
|
|
1160
|
+
if (t.isGlobal && (X.globalOptions = t), this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.options = Object.assign(
|
|
1159
1161
|
{},
|
|
1160
1162
|
{ LAYOUT: o },
|
|
1161
1163
|
// 原始 configs 的 LAYOUT
|
|
@@ -1179,9 +1181,9 @@ it = new WeakSet(), Ce = function() {
|
|
|
1179
1181
|
if (l === "onBox" || l === "inBox") {
|
|
1180
1182
|
let g = null;
|
|
1181
1183
|
if (u === "on") {
|
|
1182
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'),
|
|
1184
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), L("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
|
1183
1185
|
const m = s.querySelector("img"), v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src")), w = t[o] ? t[o] : t[0] || "";
|
|
1184
|
-
if (w ? m.insertAdjacentHTML(S.after, w) :
|
|
1186
|
+
if (w ? m.insertAdjacentHTML(S.after, w) : L("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !v && r == "youtube")
|
|
1185
1187
|
p == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
|
|
1186
1188
|
else if (!v && r == "vimeo")
|
|
1187
1189
|
m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`);
|
|
@@ -1199,13 +1201,13 @@ it = new WeakSet(), Ce = function() {
|
|
|
1199
1201
|
m.setAttribute("src", `${T}`);
|
|
1200
1202
|
}).catch(function(b) {
|
|
1201
1203
|
console.log("error");
|
|
1202
|
-
}) :
|
|
1204
|
+
}) : L("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
|
1203
1205
|
}
|
|
1204
|
-
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) ||
|
|
1206
|
+
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || L("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e, g.video.instance = this), g.video.eventHandler = d(this, st, Me), g.addEventListener("click", g.video.eventHandler);
|
|
1205
1207
|
} else if (l === "onPage") {
|
|
1206
1208
|
let g = null;
|
|
1207
1209
|
if (u == "on") {
|
|
1208
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'),
|
|
1210
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), L("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
|
1209
1211
|
const m = s.querySelector("img");
|
|
1210
1212
|
m.insertAdjacentHTML(S.after, t[o]);
|
|
1211
1213
|
const v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
|
@@ -1214,15 +1216,15 @@ it = new WeakSet(), Ce = function() {
|
|
|
1214
1216
|
m.setAttribute("src", `${b}`);
|
|
1215
1217
|
}).catch(function(w) {
|
|
1216
1218
|
console.log("error");
|
|
1217
|
-
}) : v ||
|
|
1219
|
+
}) : v || L("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || L("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
|
1218
1220
|
} else {
|
|
1219
1221
|
s.innerHTML = pt(e);
|
|
1220
1222
|
return;
|
|
1221
1223
|
}
|
|
1222
|
-
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, st,
|
|
1224
|
+
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, st, Me), g.addEventListener("click", g.video.eventHandler);
|
|
1223
1225
|
}
|
|
1224
|
-
}, st = new WeakSet(),
|
|
1225
|
-
const { video: t
|
|
1226
|
+
}, st = new WeakSet(), Me = function(i) {
|
|
1227
|
+
const { video: t } = this, e = t.instance, {
|
|
1226
1228
|
$selector: s,
|
|
1227
1229
|
videoMode: o,
|
|
1228
1230
|
videoTarget: a,
|
|
@@ -1248,21 +1250,21 @@ it = new WeakSet(), Ce = function() {
|
|
|
1248
1250
|
on: {
|
|
1249
1251
|
complete(y) {
|
|
1250
1252
|
var D;
|
|
1251
|
-
o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (D = window.instgrm) != null && D.Embeds ? window.instgrm.Embeds.process() : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", pt(t.params)), y.setAttribute("video-typeStyle", `${u}`))), o == "inBox" && y.setAttribute("video-typeStyle", `${u}`);
|
|
1253
|
+
o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (D = window.instgrm) != null && D.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", Ys(t.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", pt(t.params)), y.setAttribute("video-typeStyle", `${u}`))), o == "inBox" && y.setAttribute("video-typeStyle", `${u}`);
|
|
1252
1254
|
},
|
|
1253
1255
|
open(y) {
|
|
1254
1256
|
var U;
|
|
1255
1257
|
const D = y.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1256
1258
|
if (b.update(), Hi([...D]), o == "onBox" && u == "instagram") {
|
|
1257
|
-
const
|
|
1259
|
+
const A = document.querySelector("[video-template] .modal-content");
|
|
1258
1260
|
new ResizeObserver((Ge) => {
|
|
1259
|
-
Ge[0].contentRect.height > 50 &&
|
|
1260
|
-
}).observe(
|
|
1261
|
+
Ge[0].contentRect.height > 50 && A.classList.add("active");
|
|
1262
|
+
}).observe(A);
|
|
1261
1263
|
}
|
|
1262
1264
|
if (o == "inBox") {
|
|
1263
|
-
const
|
|
1265
|
+
const A = g || ((U = s.querySelector("img")) == null ? void 0 : U.src);
|
|
1264
1266
|
let z;
|
|
1265
|
-
|
|
1267
|
+
A == null ? z = `
|
|
1266
1268
|
<div
|
|
1267
1269
|
class="photo-box"
|
|
1268
1270
|
video-target
|
|
@@ -1286,14 +1288,14 @@ it = new WeakSet(), Ce = function() {
|
|
|
1286
1288
|
>
|
|
1287
1289
|
<picture>
|
|
1288
1290
|
<source
|
|
1289
|
-
srcset="${
|
|
1291
|
+
srcset="${A}"
|
|
1290
1292
|
type="image/webp"
|
|
1291
1293
|
/>
|
|
1292
1294
|
<source
|
|
1293
|
-
srcset="${
|
|
1295
|
+
srcset="${A}"
|
|
1294
1296
|
type="image/jpeg"
|
|
1295
1297
|
/>
|
|
1296
|
-
<img src="${
|
|
1298
|
+
<img src="${A}" alt="" />
|
|
1297
1299
|
</picture>
|
|
1298
1300
|
</div>`, y.querySelector(".video-content").insertAdjacentHTML(S.prepend, z);
|
|
1299
1301
|
const Re = y.querySelectorAll("[video-target]");
|
|
@@ -1302,16 +1304,17 @@ it = new WeakSet(), Ce = function() {
|
|
|
1302
1304
|
videoLayoutNo: t.params.videoLayoutNo
|
|
1303
1305
|
});
|
|
1304
1306
|
}
|
|
1307
|
+
e == null || e.emit("openModal");
|
|
1305
1308
|
},
|
|
1306
1309
|
close(y) {
|
|
1307
1310
|
const D = y.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1308
|
-
Mi([...D]);
|
|
1311
|
+
Mi([...D]), e == null || e.emit("closeModal");
|
|
1309
1312
|
},
|
|
1310
1313
|
destroy(y) {
|
|
1311
1314
|
}
|
|
1312
1315
|
}
|
|
1313
1316
|
};
|
|
1314
|
-
|
|
1317
|
+
K.open(C);
|
|
1315
1318
|
} else if (o == "onPage")
|
|
1316
1319
|
if (t.params.videoAutoplay = "on", r == "off") {
|
|
1317
1320
|
if (s.querySelector("video-player"))
|
|
@@ -1343,10 +1346,10 @@ it = new WeakSet(), Ce = function() {
|
|
|
1343
1346
|
LAYOUT: t.LAYOUT || []
|
|
1344
1347
|
};
|
|
1345
1348
|
}, Xe(X, "globalOptions", {});
|
|
1346
|
-
let
|
|
1347
|
-
Object.assign(
|
|
1349
|
+
let Ce = X;
|
|
1350
|
+
Object.assign(Ce.prototype, j);
|
|
1348
1351
|
customElements.define("video-player", Ws);
|
|
1349
|
-
const
|
|
1352
|
+
const Fs = {
|
|
1350
1353
|
"zh-tw": {
|
|
1351
1354
|
臺北市: [
|
|
1352
1355
|
["中正區", "100"],
|
|
@@ -2177,7 +2180,7 @@ const Ys = {
|
|
|
2177
2180
|
}
|
|
2178
2181
|
};
|
|
2179
2182
|
let Q;
|
|
2180
|
-
const
|
|
2183
|
+
const Us = (n) => {
|
|
2181
2184
|
const { TEMPLATE: i } = Be, { childDom: t } = n.s, e = document.createElement("div"), s = n.classList.contains("filter"), o = n.getAttribute("filter-placeholder"), a = n.getAttribute("d4-icon"), r = n.getAttribute("custom-template");
|
|
2182
2185
|
e.innerHTML = i(
|
|
2183
2186
|
s,
|
|
@@ -2191,12 +2194,12 @@ const Fs = (n) => {
|
|
|
2191
2194
|
(!p.hasAttribute("data-option") || p.getAttribute("data-option").trim() === "") && p.setAttribute("data-option", p.textContent.trim());
|
|
2192
2195
|
}) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
|
|
2193
2196
|
}), e.children[0];
|
|
2194
|
-
},
|
|
2197
|
+
}, Js = (n) => {
|
|
2195
2198
|
var t;
|
|
2196
2199
|
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
|
2197
2200
|
i && i.forEach((e) => {
|
|
2198
2201
|
const s = document.querySelector(e);
|
|
2199
|
-
s ||
|
|
2202
|
+
s || L("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && I(s, [...s.s.allLi].indexOf(s.s.activeLi)));
|
|
2200
2203
|
});
|
|
2201
2204
|
}, I = (n, i) => {
|
|
2202
2205
|
const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
|
|
@@ -2250,23 +2253,23 @@ const Fs = (n) => {
|
|
|
2250
2253
|
break;
|
|
2251
2254
|
}
|
|
2252
2255
|
}
|
|
2253
|
-
},
|
|
2256
|
+
}, Zs = (n) => {
|
|
2254
2257
|
const i = n.s.cityLang;
|
|
2255
|
-
f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (Q = JSON.parse(f("#newCityData").val())[0], console.log([0])) : Q =
|
|
2258
|
+
f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (Q = JSON.parse(f("#newCityData").val())[0], console.log([0])) : Q = Fs, n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(Q[i]).forEach((t) => {
|
|
2256
2259
|
const e = document.createElement("li");
|
|
2257
2260
|
e.textContent = t, e.setAttribute("data-option", t), n.s.dropdownEl.querySelector(".dropdown-list").append(e);
|
|
2258
2261
|
}), n.s.allLi = n.querySelectorAll(".dropdown-list li"));
|
|
2259
|
-
},
|
|
2262
|
+
}, Qs = (n, i) => {
|
|
2260
2263
|
const t = n.s.cityLang;
|
|
2261
2264
|
Q[t][i].forEach((e, s) => {
|
|
2262
2265
|
const o = document.createElement("li");
|
|
2263
2266
|
o.textContent = e[0], o.setAttribute("data-option", e[0]), n.querySelector(".dropdown-list").append(o);
|
|
2264
2267
|
});
|
|
2265
2268
|
}, Ni = () => {
|
|
2266
|
-
|
|
2269
|
+
$('dropdown-el[d4-status="open"]').forEach((i) => {
|
|
2267
2270
|
i.close();
|
|
2268
2271
|
});
|
|
2269
|
-
},
|
|
2272
|
+
}, Ks = () => {
|
|
2270
2273
|
const { SETTINGS: n } = Be;
|
|
2271
2274
|
((t, e) => {
|
|
2272
2275
|
Object.keys(e).forEach((s) => {
|
|
@@ -2274,7 +2277,7 @@ const Fs = (n) => {
|
|
|
2274
2277
|
});
|
|
2275
2278
|
})(document.documentElement, n.scrollbar);
|
|
2276
2279
|
};
|
|
2277
|
-
|
|
2280
|
+
Ks();
|
|
2278
2281
|
document.addEventListener("click", function() {
|
|
2279
2282
|
Ni();
|
|
2280
2283
|
});
|
|
@@ -2360,11 +2363,11 @@ class Pi extends HTMLElement {
|
|
|
2360
2363
|
Bt = new WeakSet(), ji = function() {
|
|
2361
2364
|
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Wt, zi).call(this);
|
|
2362
2365
|
}, Wt = new WeakSet(), zi = function() {
|
|
2363
|
-
this.s.childDom = this.childNodes, this.s.template =
|
|
2366
|
+
this.s.childDom = this.childNodes, this.s.template = Us(this), this.innerHTML = "", this.append(this.s.template), d(this, Gt, Bi).call(this);
|
|
2364
2367
|
}, Gt = new WeakSet(), Bi = function() {
|
|
2365
2368
|
var s;
|
|
2366
2369
|
const t = this;
|
|
2367
|
-
t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.dropdownEl = t.querySelector(".dropdown"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw",
|
|
2370
|
+
t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.dropdownEl = t.querySelector(".dropdown"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw", Zs(t), t.s.subDropdownTotalH = 0;
|
|
2368
2371
|
const e = t.getAttribute("d4-value");
|
|
2369
2372
|
switch (t.s.selectType) {
|
|
2370
2373
|
case "single":
|
|
@@ -2373,7 +2376,7 @@ Bt = new WeakSet(), ji = function() {
|
|
|
2373
2376
|
const r = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), l = r ? r.getAttribute("d4-value") !== "" : !1;
|
|
2374
2377
|
if (r && l) {
|
|
2375
2378
|
const c = r.getAttribute("d4-value");
|
|
2376
|
-
if (
|
|
2379
|
+
if (Qs(t, c), t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
|
|
2377
2380
|
const u = e.split(",")[1];
|
|
2378
2381
|
o = t.querySelector(`.dropdown-list li[data-option="${u}"]`), t.setAttribute("d4-value", u);
|
|
2379
2382
|
}
|
|
@@ -2453,7 +2456,7 @@ Bt = new WeakSet(), ji = function() {
|
|
|
2453
2456
|
t.s.dropdownEl.addEventListener("transitionend", e);
|
|
2454
2457
|
}, t.__events__.bindScrollbar = (e = this) => {
|
|
2455
2458
|
const s = e.querySelector(".dropdown-scroller");
|
|
2456
|
-
e.__scroller__ =
|
|
2459
|
+
e.__scroller__ = ze(s, {
|
|
2457
2460
|
overflowBehavior: {
|
|
2458
2461
|
x: "hidden"
|
|
2459
2462
|
}
|
|
@@ -2478,7 +2481,7 @@ Bt = new WeakSet(), ji = function() {
|
|
|
2478
2481
|
};
|
|
2479
2482
|
v.addEventListener("transitionend", D);
|
|
2480
2483
|
} else
|
|
2481
|
-
switch (
|
|
2484
|
+
switch (Js(e), e.s.selectType) {
|
|
2482
2485
|
case "single":
|
|
2483
2486
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
|
2484
2487
|
const v = e.s.cityLang, w = l.textContent.trim(), b = document.getElementById(e.getAttribute("dist-select"));
|
|
@@ -2617,14 +2620,14 @@ function H(n) {
|
|
|
2617
2620
|
}
|
|
2618
2621
|
return s;
|
|
2619
2622
|
}
|
|
2620
|
-
function
|
|
2623
|
+
function tn(n) {
|
|
2621
2624
|
let i;
|
|
2622
2625
|
return function(t) {
|
|
2623
2626
|
i && clearTimeout(i), i = setTimeout(n, 200, t);
|
|
2624
2627
|
};
|
|
2625
2628
|
}
|
|
2626
2629
|
var Xt, Gi, Yt, Ri, Ft, Xi, Ut, Yi;
|
|
2627
|
-
class
|
|
2630
|
+
class en extends HTMLElement {
|
|
2628
2631
|
constructor() {
|
|
2629
2632
|
super();
|
|
2630
2633
|
h(this, Xt);
|
|
@@ -2757,15 +2760,15 @@ Xt = new WeakSet(), Gi = function() {
|
|
|
2757
2760
|
iterations: 1 / 0
|
|
2758
2761
|
}), t.s.cloneAnimation.startTime = o);
|
|
2759
2762
|
}
|
|
2760
|
-
window.addEventListener("resize",
|
|
2763
|
+
window.addEventListener("resize", tn(e));
|
|
2761
2764
|
};
|
|
2762
|
-
customElements.define("marquee-el",
|
|
2765
|
+
customElements.define("marquee-el", en);
|
|
2763
2766
|
const Ze = function(n, i) {
|
|
2764
2767
|
let t;
|
|
2765
2768
|
return function(e) {
|
|
2766
2769
|
t && clearTimeout(t), t = setTimeout(n, 200, e);
|
|
2767
2770
|
};
|
|
2768
|
-
},
|
|
2771
|
+
}, x = (n, i) => {
|
|
2769
2772
|
if (ut(n)) {
|
|
2770
2773
|
n.forEach((t) => {
|
|
2771
2774
|
t.classList.add(i);
|
|
@@ -2782,7 +2785,7 @@ const Ze = function(n, i) {
|
|
|
2782
2785
|
}
|
|
2783
2786
|
n.classList.remove(i);
|
|
2784
2787
|
};
|
|
2785
|
-
var Jt, Fi, Zt, Ui, Qt, Ji, nt,
|
|
2788
|
+
var Jt, Fi, Zt, Ui, Qt, Ji, nt, Ie, Y, ft, Kt, Zi;
|
|
2786
2789
|
class Qe {
|
|
2787
2790
|
constructor(i) {
|
|
2788
2791
|
// 初始化
|
|
@@ -2796,7 +2799,7 @@ class Qe {
|
|
|
2796
2799
|
// 隱藏按鈕判斷
|
|
2797
2800
|
h(this, Y);
|
|
2798
2801
|
// 選項事件綁定
|
|
2799
|
-
h(this,
|
|
2802
|
+
h(this, Kt);
|
|
2800
2803
|
this.$element = i, this.option = i.s.option.drag, this._didInitialScroll = !1, d(this, Jt, Fi).call(this);
|
|
2801
2804
|
}
|
|
2802
2805
|
// 更新 active 位置
|
|
@@ -2827,7 +2830,7 @@ Jt = new WeakSet(), Fi = function() {
|
|
|
2827
2830
|
let t = !1;
|
|
2828
2831
|
const e = () => {
|
|
2829
2832
|
t || (requestAnimationFrame(() => {
|
|
2830
|
-
d(this, nt,
|
|
2833
|
+
d(this, nt, Ie).call(this), d(this, Y, ft).call(this), t = !1;
|
|
2831
2834
|
}), t = !0);
|
|
2832
2835
|
};
|
|
2833
2836
|
i.$wrapper.removeEventListener("scroll", e), i.$wrapper.addEventListener("scroll", e), window.removeEventListener("resize", e), window.addEventListener("resize", e), (i.option.draggable || i.$element.s.type == "collapse") && d(s = i, Qt, Ji).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
|
@@ -2840,8 +2843,8 @@ Jt = new WeakSet(), Fi = function() {
|
|
|
2840
2843
|
<div></div>
|
|
2841
2844
|
</div>
|
|
2842
2845
|
</div>`
|
|
2843
|
-
), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i, Zt, Ui).call(a)), d(r = i,
|
|
2844
|
-
d(this, nt,
|
|
2846
|
+
), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i, Zt, Ui).call(a)), d(r = i, Kt, Zi).call(r), i.update(!0), requestAnimationFrame(() => {
|
|
2847
|
+
d(this, nt, Ie).call(this), d(this, Y, ft).call(this);
|
|
2845
2848
|
});
|
|
2846
2849
|
}, Zt = new WeakSet(), Ui = function() {
|
|
2847
2850
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
|
@@ -2887,32 +2890,32 @@ Jt = new WeakSet(), Fi = function() {
|
|
|
2887
2890
|
i.querySelectorAll("a").forEach((p) => {
|
|
2888
2891
|
p.removeEventListener("click", u), p.addEventListener("click", u);
|
|
2889
2892
|
});
|
|
2890
|
-
}, nt = new WeakSet(),
|
|
2893
|
+
}, nt = new WeakSet(), Ie = function() {
|
|
2891
2894
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
|
|
2892
|
-
e <= 0 || (
|
|
2895
|
+
e <= 0 || (x(i, "scrollable"), s == 0 ? (x(t, "start"), _(t, "end")) : s + 1 >= e ? (_(t, "start"), x(t, "end")) : (x(t, "center"), _(t, "start"), _(t, "end")));
|
|
2893
2896
|
}, Y = new WeakSet(), ft = function() {
|
|
2894
2897
|
const { $wrapper: i, $button: t, $element: e } = this;
|
|
2895
2898
|
if (!t)
|
|
2896
2899
|
return;
|
|
2897
2900
|
const s = i.scrollWidth - i.clientWidth, o = i.scrollLeft;
|
|
2898
2901
|
if (s <= 0) {
|
|
2899
|
-
|
|
2902
|
+
x(t, "hide"), _(t, "active"), x(e, "noScrollable");
|
|
2900
2903
|
return;
|
|
2901
2904
|
}
|
|
2902
|
-
s > 0 && (
|
|
2905
|
+
s > 0 && (x(t, "active"), _(e, "noScrollable")), o == 0 ? t.forEach((a) => {
|
|
2903
2906
|
if (a.classList.contains("next")) {
|
|
2904
2907
|
_(a, "hide");
|
|
2905
2908
|
return;
|
|
2906
2909
|
}
|
|
2907
|
-
|
|
2910
|
+
x(a, "hide");
|
|
2908
2911
|
}) : o + 1 >= s ? t.forEach((a) => {
|
|
2909
2912
|
if (a.classList.contains("next")) {
|
|
2910
|
-
|
|
2913
|
+
x(a, "hide");
|
|
2911
2914
|
return;
|
|
2912
2915
|
}
|
|
2913
2916
|
_(a, "hide");
|
|
2914
2917
|
}) : _(t, "hide");
|
|
2915
|
-
},
|
|
2918
|
+
}, Kt = new WeakSet(), Zi = function() {
|
|
2916
2919
|
const { $element: i } = this, t = (s) => {
|
|
2917
2920
|
if (this.option.selected) {
|
|
2918
2921
|
const o = s.getAttribute("data-option").trim();
|
|
@@ -2926,26 +2929,26 @@ Jt = new WeakSet(), Fi = function() {
|
|
|
2926
2929
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
|
2927
2930
|
});
|
|
2928
2931
|
};
|
|
2929
|
-
var
|
|
2930
|
-
class
|
|
2932
|
+
var Vt, Qi, te, Ki, ee, Vi, ie, ts;
|
|
2933
|
+
class sn {
|
|
2931
2934
|
constructor(i) {
|
|
2932
2935
|
// 初始化
|
|
2933
|
-
h(this,
|
|
2936
|
+
h(this, Vt);
|
|
2934
2937
|
// 隱藏按鈕判斷
|
|
2935
2938
|
h(this, te);
|
|
2936
2939
|
// 展開箭頭事件綁定
|
|
2937
2940
|
h(this, ee);
|
|
2938
2941
|
// 選項事件綁定
|
|
2939
2942
|
h(this, ie);
|
|
2940
|
-
this.$element = i, this.option = i.s.option.collapse, d(this,
|
|
2943
|
+
this.$element = i, this.option = i.s.option.collapse, d(this, Vt, Qi).call(this);
|
|
2941
2944
|
}
|
|
2942
2945
|
}
|
|
2943
|
-
|
|
2944
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, te,
|
|
2945
|
-
}, te = new WeakSet(),
|
|
2946
|
+
Vt = new WeakSet(), Qi = function() {
|
|
2947
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, te, Ki).call(this) && d(this, ee, Vi).call(this), d(this, ie, ts).call(this));
|
|
2948
|
+
}, te = new WeakSet(), Ki = function() {
|
|
2946
2949
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
|
2947
|
-
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(S.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), _(this.$element, "noScrollable"), !0) : (
|
|
2948
|
-
}, ee = new WeakSet(),
|
|
2950
|
+
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(S.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), _(this.$element, "noScrollable"), !0) : (x(this.$element, "noScrollable"), !1);
|
|
2951
|
+
}, ee = new WeakSet(), Vi = function() {
|
|
2949
2952
|
const { $element: i, $button: t } = this, e = function() {
|
|
2950
2953
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
|
2951
2954
|
};
|
|
@@ -2964,12 +2967,12 @@ Kt = new WeakSet(), Qi = function() {
|
|
|
2964
2967
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
|
2965
2968
|
});
|
|
2966
2969
|
};
|
|
2967
|
-
const
|
|
2970
|
+
const nn = (n) => {
|
|
2968
2971
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
|
2969
2972
|
return i == "drag" && (s.innerHTML = q.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e)), i == "collapse" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(S.append, e)), i == "dropdown" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(S.append, e)), s.children;
|
|
2970
2973
|
};
|
|
2971
|
-
var se, es, ne, is, ot,
|
|
2972
|
-
class
|
|
2974
|
+
var se, es, ne, is, ot, qe, F, vt;
|
|
2975
|
+
class on extends HTMLElement {
|
|
2973
2976
|
constructor() {
|
|
2974
2977
|
super();
|
|
2975
2978
|
h(this, se);
|
|
@@ -3009,7 +3012,7 @@ class nn extends HTMLElement {
|
|
|
3009
3012
|
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, se, es).call(this));
|
|
3010
3013
|
}
|
|
3011
3014
|
update() {
|
|
3012
|
-
d(this, ot,
|
|
3015
|
+
d(this, ot, qe).call(this);
|
|
3013
3016
|
}
|
|
3014
3017
|
}
|
|
3015
3018
|
se = new WeakSet(), es = function() {
|
|
@@ -3025,8 +3028,8 @@ se = new WeakSet(), es = function() {
|
|
|
3025
3028
|
};
|
|
3026
3029
|
window.removeEventListener("resize", Ze(e)), window.addEventListener("resize", Ze(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, q.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, q.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, q.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, q.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, ne, is).call(this);
|
|
3027
3030
|
}, ne = new WeakSet(), is = function() {
|
|
3028
|
-
this.classList.add("m4-init"), d(this, ot,
|
|
3029
|
-
}, ot = new WeakSet(),
|
|
3031
|
+
this.classList.add("m4-init"), d(this, ot, qe).call(this);
|
|
3032
|
+
}, ot = new WeakSet(), qe = function() {
|
|
3030
3033
|
const t = Object.keys(this.s.option.breakpoint);
|
|
3031
3034
|
if (!t.length) {
|
|
3032
3035
|
d(this, F, vt).call(this);
|
|
@@ -3039,7 +3042,7 @@ se = new WeakSet(), es = function() {
|
|
|
3039
3042
|
}, F = new WeakSet(), vt = function() {
|
|
3040
3043
|
var o;
|
|
3041
3044
|
const { type: t } = this.s;
|
|
3042
|
-
this.innerHTML = "", [...
|
|
3045
|
+
this.innerHTML = "", [...nn(this)].forEach((a) => {
|
|
3043
3046
|
this.append(a);
|
|
3044
3047
|
});
|
|
3045
3048
|
const e = this.querySelector(`.drag-container .item[data-option="${this.getAttribute("m4-status")}"]`), s = this.querySelector(`.collapse-container .item[data-option="${this.getAttribute("m4-status")}"]`);
|
|
@@ -3048,13 +3051,13 @@ se = new WeakSet(), es = function() {
|
|
|
3048
3051
|
this.drag = new Qe(this);
|
|
3049
3052
|
break;
|
|
3050
3053
|
case "collapse":
|
|
3051
|
-
this.drag = new Qe(this), this.collapse = new
|
|
3054
|
+
this.drag = new Qe(this), this.collapse = new sn(this);
|
|
3052
3055
|
break;
|
|
3053
3056
|
}
|
|
3054
3057
|
(o = this.drag) == null || o.update();
|
|
3055
3058
|
};
|
|
3056
|
-
customElements.define("multipurpose-nav",
|
|
3057
|
-
var oe, ns, ae, os, at,
|
|
3059
|
+
customElements.define("multipurpose-nav", on);
|
|
3060
|
+
var oe, ns, ae, os, at, Oe, W, J, re, as, le, rs, ce, ls, de, cs, ue, ds, he, us, pe, hs, me, ps, ge, ms, N, R, fe, gs, ve, fs, be, vs, ye, bs;
|
|
3058
3061
|
class ss extends HTMLElement {
|
|
3059
3062
|
// 定義組件的初始狀態
|
|
3060
3063
|
constructor(t, e) {
|
|
@@ -3131,7 +3134,7 @@ class ss extends HTMLElement {
|
|
|
3131
3134
|
}
|
|
3132
3135
|
// 外部呼叫方法 $0.update()
|
|
3133
3136
|
update() {
|
|
3134
|
-
this.t.tabs = d(this, at,
|
|
3137
|
+
this.t.tabs = d(this, at, Oe).call(this), ys(), console.log("tab update!!!!");
|
|
3135
3138
|
}
|
|
3136
3139
|
}
|
|
3137
3140
|
oe = new WeakSet(), ns = function() {
|
|
@@ -3154,14 +3157,14 @@ oe = new WeakSet(), ns = function() {
|
|
|
3154
3157
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
|
3155
3158
|
},
|
|
3156
3159
|
tabGroup: this.getAttribute("t4-group") || e.tabGroup
|
|
3157
|
-
}, this.__events__ = {}, this.t.tabs = d(this, at,
|
|
3160
|
+
}, this.__events__ = {}, this.t.tabs = d(this, at, Oe).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, ae, os).call(this);
|
|
3158
3161
|
}, ae = new WeakSet(), os = function() {
|
|
3159
3162
|
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, re, as).call(this), this.t.recordUrl) {
|
|
3160
3163
|
const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
|
|
3161
3164
|
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
|
3162
3165
|
}
|
|
3163
3166
|
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, ye, bs).call(this);
|
|
3164
|
-
}, at = new WeakSet(),
|
|
3167
|
+
}, at = new WeakSet(), Oe = function() {
|
|
3165
3168
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
|
3166
3169
|
return t.type === "normal" && t.tabGroup === "true" && t.tabPanels.length !== e.length && console.warn("按鈕與內容數量不同喔", t.tabPanels.length, e.length), t.tabGroup === "true" ? t.tabPanels.forEach((s, o) => s.setAttribute("t4-id", o)) : t.tabPanels.forEach((s) => {
|
|
3167
3170
|
s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
|
|
@@ -3221,7 +3224,7 @@ oe = new WeakSet(), ns = function() {
|
|
|
3221
3224
|
}, N = new WeakSet(), R = function(t, e, s) {
|
|
3222
3225
|
switch (t) {
|
|
3223
3226
|
case "step":
|
|
3224
|
-
|
|
3227
|
+
De(this.t.step) && d(this, he, us).call(this, e);
|
|
3225
3228
|
break;
|
|
3226
3229
|
case "eventAnchor":
|
|
3227
3230
|
this.t.anchor && d(this, de, cs).call(this);
|
|
@@ -3288,12 +3291,12 @@ oe = new WeakSet(), ns = function() {
|
|
|
3288
3291
|
const t = this;
|
|
3289
3292
|
window.addEventListener(
|
|
3290
3293
|
"resize",
|
|
3291
|
-
|
|
3294
|
+
an(() => {
|
|
3292
3295
|
t.update();
|
|
3293
3296
|
}, 1e3)
|
|
3294
3297
|
);
|
|
3295
3298
|
};
|
|
3296
|
-
function
|
|
3299
|
+
function an(n, i = 1e3) {
|
|
3297
3300
|
let t;
|
|
3298
3301
|
return function(e) {
|
|
3299
3302
|
t && clearTimeout(t), t = setTimeout(n, i, e);
|
|
@@ -3332,32 +3335,32 @@ function ys() {
|
|
|
3332
3335
|
ys();
|
|
3333
3336
|
Object.assign(ss.prototype, j);
|
|
3334
3337
|
customElements.define("tab-el", ss);
|
|
3335
|
-
const
|
|
3338
|
+
const Ke = (n) => {
|
|
3336
3339
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e);
|
|
3337
3340
|
n.classList.add(t), o.style.height = 0, o.style["transition-property"] = s.property, o.style["transition-duration"] = s.duration, o.style["transition-timing-function"] = s.function, o.style["transition-delay"] = s.delay, o.style.overflow = "hidden";
|
|
3338
|
-
},
|
|
3341
|
+
}, rn = (n) => {
|
|
3339
3342
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
|
|
3340
3343
|
n.collapse.height = a, n.classList.remove(t), o.style.display = "block", o.style.height = `${a}px`, o.style["transition-property"] = s.property, o.style["transition-duration"] = s.duration, o.style["transition-timing-function"] = s.function, o.style["transition-delay"] = s.delay, o.style.overflow = "hidden";
|
|
3341
3344
|
};
|
|
3342
|
-
var rt,
|
|
3343
|
-
class
|
|
3345
|
+
var rt, Ne, we, ws, Te, Ts, lt, Pe;
|
|
3346
|
+
class ln {
|
|
3344
3347
|
constructor(i, t = {}) {
|
|
3345
3348
|
h(this, rt);
|
|
3346
3349
|
h(this, we);
|
|
3347
3350
|
h(this, Te);
|
|
3348
3351
|
h(this, lt);
|
|
3349
|
-
!dt(i) && !
|
|
3352
|
+
!dt(i) && !De(i) && !ut(i) && !E(i) || (this.__storage__ = {
|
|
3350
3353
|
el: i,
|
|
3351
3354
|
options: t
|
|
3352
|
-
}, this.active = "data-collapse-active", d(this, rt,
|
|
3355
|
+
}, this.active = "data-collapse-active", d(this, rt, Ne).call(this));
|
|
3353
3356
|
}
|
|
3354
3357
|
update() {
|
|
3355
|
-
d(this, rt,
|
|
3358
|
+
d(this, rt, Ne).call(this);
|
|
3356
3359
|
}
|
|
3357
3360
|
}
|
|
3358
|
-
rt = new WeakSet(),
|
|
3361
|
+
rt = new WeakSet(), Ne = function() {
|
|
3359
3362
|
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = si;
|
|
3360
|
-
if (this.elements = t.state == "not active" ?
|
|
3363
|
+
if (this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
3361
3364
|
for (const [o, a] of Object.entries(this.options.on))
|
|
3362
3365
|
this.__events__[o] = [a];
|
|
3363
3366
|
d(this, we, ws).call(this);
|
|
@@ -3368,20 +3371,20 @@ rt = new WeakSet(), Oe = function() {
|
|
|
3368
3371
|
}), this.emit("init");
|
|
3369
3372
|
}, Te = new WeakSet(), Ts = function(i) {
|
|
3370
3373
|
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
|
|
3371
|
-
if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this, lt,
|
|
3374
|
+
if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this, lt, Pe)), c.addEventListener("click", d(this, lt, Pe)), r) {
|
|
3372
3375
|
const p = (g) => {
|
|
3373
3376
|
g.stopPropagation();
|
|
3374
3377
|
};
|
|
3375
3378
|
u.removeEventListener("click", p), u.addEventListener("click", p);
|
|
3376
3379
|
}
|
|
3377
|
-
}, lt = new WeakSet(),
|
|
3380
|
+
}, lt = new WeakSet(), Pe = function() {
|
|
3378
3381
|
const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
|
|
3379
3382
|
r.classList.contains(e) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
|
|
3380
|
-
|
|
3381
|
-
}),
|
|
3383
|
+
Ke(l);
|
|
3384
|
+
}), rn(r)) : Ke(r), i.emit("afterCollapse");
|
|
3382
3385
|
};
|
|
3383
|
-
Object.assign(
|
|
3384
|
-
function
|
|
3386
|
+
Object.assign(ln.prototype, j);
|
|
3387
|
+
function cn(n, i) {
|
|
3385
3388
|
const t = i, { color: e, opacity: s, duration: o } = i.s.options;
|
|
3386
3389
|
let a = document.createElement("span"), r = n.clientX - t.getBoundingClientRect().left, l = n.clientY - t.getBoundingClientRect().top;
|
|
3387
3390
|
a.style.cssText = `background: ${e};left: ${r}px;top: ${l}px;opacity: ${s};animation-duration: ${o}ms`, a.classList.add("circle"), t.appendChild(a), setTimeout(function() {
|
|
@@ -3394,25 +3397,25 @@ function Es() {
|
|
|
3394
3397
|
});
|
|
3395
3398
|
}
|
|
3396
3399
|
document.addEventListener("click", Es);
|
|
3397
|
-
var ct,
|
|
3398
|
-
class
|
|
3400
|
+
var ct, je, Ee, As, Ae, Ls, Le, Ss;
|
|
3401
|
+
class dn extends HTMLElement {
|
|
3399
3402
|
constructor() {
|
|
3400
3403
|
super();
|
|
3401
3404
|
h(this, ct);
|
|
3402
3405
|
h(this, Ee);
|
|
3403
|
-
h(this, Le);
|
|
3404
3406
|
h(this, Ae);
|
|
3407
|
+
h(this, Le);
|
|
3405
3408
|
this.initialize = !1;
|
|
3406
3409
|
}
|
|
3407
3410
|
connectedCallback() {
|
|
3408
3411
|
const t = this;
|
|
3409
|
-
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, ct,
|
|
3412
|
+
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, ct, je).call(this));
|
|
3410
3413
|
}
|
|
3411
3414
|
update() {
|
|
3412
|
-
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, ct,
|
|
3415
|
+
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, ct, je).call(this);
|
|
3413
3416
|
}
|
|
3414
3417
|
}
|
|
3415
|
-
ct = new WeakSet(),
|
|
3418
|
+
ct = new WeakSet(), je = function() {
|
|
3416
3419
|
const { SETTINGS: t } = ni;
|
|
3417
3420
|
this.s = {};
|
|
3418
3421
|
function e(o) {
|
|
@@ -3427,16 +3430,16 @@ ct = new WeakSet(), Pe = function() {
|
|
|
3427
3430
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
|
3428
3431
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
|
3429
3432
|
};
|
|
3430
|
-
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, Ee,
|
|
3431
|
-
}, Ee = new WeakSet(),
|
|
3432
|
-
d(this,
|
|
3433
|
-
},
|
|
3433
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, Ee, As).call(this);
|
|
3434
|
+
}, Ee = new WeakSet(), As = function() {
|
|
3435
|
+
d(this, Ae, Ls).call(this), d(this, Le, Ss).call(this), this.classList.add("r4-initialize");
|
|
3436
|
+
}, Ae = new WeakSet(), Ls = function() {
|
|
3434
3437
|
const t = this, e = document.createElement("i");
|
|
3435
3438
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
|
3436
|
-
},
|
|
3439
|
+
}, Le = new WeakSet(), Ss = function() {
|
|
3437
3440
|
const t = this.querySelector("i.hover-ball"), e = this;
|
|
3438
3441
|
e.addEventListener("click", function(a) {
|
|
3439
|
-
a.stopPropagation(), e.s.options.click &&
|
|
3442
|
+
a.stopPropagation(), e.s.options.click && cn(a, e);
|
|
3440
3443
|
});
|
|
3441
3444
|
let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
|
|
3442
3445
|
e.addEventListener(s, function(a) {
|
|
@@ -3451,8 +3454,8 @@ ct = new WeakSet(), Pe = function() {
|
|
|
3451
3454
|
}
|
|
3452
3455
|
});
|
|
3453
3456
|
};
|
|
3454
|
-
customElements.define("ripple-btn",
|
|
3455
|
-
class
|
|
3457
|
+
customElements.define("ripple-btn", dn);
|
|
3458
|
+
class un {
|
|
3456
3459
|
constructor() {
|
|
3457
3460
|
this.init();
|
|
3458
3461
|
}
|
|
@@ -3504,12 +3507,12 @@ class dn {
|
|
|
3504
3507
|
this.init();
|
|
3505
3508
|
}
|
|
3506
3509
|
}
|
|
3507
|
-
function
|
|
3510
|
+
function Ve(n, i) {
|
|
3508
3511
|
return n ? function(t, e) {
|
|
3509
3512
|
Function(n)(t, e);
|
|
3510
3513
|
} : i;
|
|
3511
3514
|
}
|
|
3512
|
-
function
|
|
3515
|
+
function hn(n, i, t, e) {
|
|
3513
3516
|
const s = i.params, o = n.closest("[data-upload-item]").querySelector("[data-preview]");
|
|
3514
3517
|
o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(e.imgElement);
|
|
3515
3518
|
const a = n.dataset.group, r = document.querySelector(i.el).dataset.index;
|
|
@@ -3532,7 +3535,7 @@ function un(n, i, t, e) {
|
|
|
3532
3535
|
info: e
|
|
3533
3536
|
}, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
|
|
3534
3537
|
}
|
|
3535
|
-
function
|
|
3538
|
+
function pn(n, i, t, e) {
|
|
3536
3539
|
const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
|
|
3537
3540
|
let u = 0, p = 0;
|
|
3538
3541
|
switch (s.width = t, s.height = e, n.previewSize) {
|
|
@@ -3546,14 +3549,14 @@ function hn(n, i, t, e) {
|
|
|
3546
3549
|
const g = (s.width - u) * 0.5, m = (s.height - p) * 0.5;
|
|
3547
3550
|
return o.drawImage(i, g, m, u, p), s;
|
|
3548
3551
|
}
|
|
3549
|
-
function
|
|
3552
|
+
function mn(n, i) {
|
|
3550
3553
|
return new Promise((t, e) => {
|
|
3551
3554
|
if (i) {
|
|
3552
3555
|
const s = new Image();
|
|
3553
3556
|
s.src = i, s.classList.add(n.previewSize), s.onload = () => {
|
|
3554
3557
|
let o = {
|
|
3555
3558
|
imgElement: s,
|
|
3556
|
-
originalCanvas:
|
|
3559
|
+
originalCanvas: pn(n, s, s.width, s.height),
|
|
3557
3560
|
info: {
|
|
3558
3561
|
originalWidth: s.width,
|
|
3559
3562
|
originalHeight: s.height,
|
|
@@ -3566,31 +3569,31 @@ function pn(n, i) {
|
|
|
3566
3569
|
t();
|
|
3567
3570
|
});
|
|
3568
3571
|
}
|
|
3569
|
-
function
|
|
3572
|
+
function gn(n, i) {
|
|
3570
3573
|
const t = Math.pow(10, i);
|
|
3571
3574
|
return Math.round(n * t) / t;
|
|
3572
3575
|
}
|
|
3573
|
-
function
|
|
3576
|
+
function fn(n, i) {
|
|
3574
3577
|
let t = n.size / 1024 / 1024;
|
|
3575
|
-
return `${
|
|
3578
|
+
return `${gn(t, 2)}` <= i;
|
|
3576
3579
|
}
|
|
3577
|
-
function
|
|
3580
|
+
function vn(n, i, t) {
|
|
3578
3581
|
if (n.target.files.length <= 0)
|
|
3579
3582
|
return;
|
|
3580
3583
|
const e = n.target.files[0], s = i.closest("[data-upload-item]");
|
|
3581
3584
|
let o = new FileReader();
|
|
3582
3585
|
o.onload = (a) => {
|
|
3583
3586
|
const r = e.type.split("/")[0] === "image" ? a.target.result : null;
|
|
3584
|
-
if (t.params.sizeLimit && !
|
|
3587
|
+
if (t.params.sizeLimit && !fn(e, t.params.sizeLimit)) {
|
|
3585
3588
|
i.value = "", s.classList.add("over-limit"), t.params.on.overLimit && typeof t.params.on.overLimit == "function" && t.params.on.overLimit(i, t.params.sizeLimit);
|
|
3586
3589
|
return;
|
|
3587
3590
|
} else
|
|
3588
|
-
s.classList.remove("over-limit"), s.classList.add("uploaded"),
|
|
3589
|
-
|
|
3591
|
+
s.classList.remove("over-limit"), s.classList.add("uploaded"), mn(t.params, r).then((l) => {
|
|
3592
|
+
hn(i, t, e, l);
|
|
3590
3593
|
});
|
|
3591
3594
|
}, o.readAsDataURL(e);
|
|
3592
3595
|
}
|
|
3593
|
-
class
|
|
3596
|
+
class bn {
|
|
3594
3597
|
constructor(i, t) {
|
|
3595
3598
|
const e = this;
|
|
3596
3599
|
e.el = i, e.params = {
|
|
@@ -3618,67 +3621,67 @@ class vn {
|
|
|
3618
3621
|
previewSize: e.dataset.previewSize || i.params.previewSize,
|
|
3619
3622
|
compress: e.dataset.compress || i.params.compress,
|
|
3620
3623
|
on: {
|
|
3621
|
-
changeAfter:
|
|
3622
|
-
overLimit:
|
|
3624
|
+
changeAfter: Ve(e.dataset.changeAfter, i.params.on.changeAfter),
|
|
3625
|
+
overLimit: Ve(e.dataset.overLimit, i.params.on.overLimit)
|
|
3623
3626
|
}
|
|
3624
3627
|
};
|
|
3625
3628
|
i.params = o, typeof uploadImage[`${o.group}`] > "u" && (uploadImage[`${o.group}`] = []), e.dataset.group || (e.dataset.group = o.group), e.dataset.index = document.querySelectorAll(`[data-group="${o.group}"]`).length - 1, e.addEventListener("change", function(a) {
|
|
3626
|
-
|
|
3629
|
+
vn(a, e, i);
|
|
3627
3630
|
});
|
|
3628
3631
|
}));
|
|
3629
3632
|
}
|
|
3630
3633
|
}
|
|
3631
3634
|
export {
|
|
3632
3635
|
oi as A,
|
|
3633
|
-
|
|
3634
|
-
|
|
3636
|
+
In as B,
|
|
3637
|
+
ln as C,
|
|
3635
3638
|
Pi as D,
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3639
|
+
qn as E,
|
|
3640
|
+
On as F,
|
|
3641
|
+
Nn as G,
|
|
3642
|
+
Pn as H,
|
|
3643
|
+
un as I,
|
|
3644
|
+
jn as J,
|
|
3645
|
+
zn as K,
|
|
3646
|
+
Bn as L,
|
|
3647
|
+
K as M,
|
|
3648
|
+
Wn as N,
|
|
3649
|
+
Gn as O,
|
|
3650
|
+
Rn as P,
|
|
3651
|
+
Xn as Q,
|
|
3652
|
+
dn as R,
|
|
3653
|
+
Yn as S,
|
|
3651
3654
|
ss as T,
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3655
|
+
Fn as U,
|
|
3656
|
+
Un as V,
|
|
3657
|
+
Jn as W,
|
|
3658
|
+
Zn as X,
|
|
3659
|
+
Qn as Y,
|
|
3657
3660
|
E as a,
|
|
3658
3661
|
ut as b,
|
|
3659
3662
|
Ms as c,
|
|
3660
3663
|
Hs as d,
|
|
3661
|
-
|
|
3664
|
+
Se as e,
|
|
3662
3665
|
S as f,
|
|
3663
|
-
|
|
3664
|
-
|
|
3666
|
+
$ as g,
|
|
3667
|
+
kn as h,
|
|
3665
3668
|
dt as i,
|
|
3666
3669
|
yi as j,
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
+
en as k,
|
|
3671
|
+
on as l,
|
|
3672
|
+
bn as m,
|
|
3670
3673
|
Rs as n,
|
|
3671
|
-
|
|
3674
|
+
Kn as o,
|
|
3672
3675
|
Hi as p,
|
|
3673
3676
|
Mi as q,
|
|
3674
|
-
|
|
3677
|
+
$n as r,
|
|
3675
3678
|
Cs as s,
|
|
3676
3679
|
xn as t,
|
|
3677
|
-
|
|
3678
|
-
|
|
3680
|
+
_n as u,
|
|
3681
|
+
Ce as v,
|
|
3679
3682
|
Gs as w,
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
+
Cn as x,
|
|
3684
|
+
Hn as y,
|
|
3685
|
+
Mn as z
|
|
3683
3686
|
};
|
|
3684
3687
|
//# sourceMappingURL=image-preview-bundle.js.map
|