@xwadex/fesd 0.0.66 → 0.0.68
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 +260 -260
- package/dist/image-preview-bundle.js.map +1 -1
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ import "validator";
|
|
|
17
17
|
import "flatpickr";
|
|
18
18
|
import hi from "vanilla-lazyload";
|
|
19
19
|
import { lock as Ws, unlock as Gs } from "tua-body-scroll-lock";
|
|
20
|
-
const
|
|
20
|
+
const Ie = {
|
|
21
21
|
SETTINGS: {
|
|
22
22
|
videoId: null,
|
|
23
23
|
videoType: null,
|
|
@@ -336,13 +336,13 @@ const He = {
|
|
|
336
336
|
ripple4: vi,
|
|
337
337
|
share4: Rs,
|
|
338
338
|
tab4: gi,
|
|
339
|
-
video4:
|
|
339
|
+
video4: Ie
|
|
340
340
|
}, Symbol.toStringTag, { value: "Module" })), S = {
|
|
341
341
|
before: "beforebegin",
|
|
342
342
|
after: "afterend",
|
|
343
343
|
append: "beforeend",
|
|
344
344
|
prepend: "afterbegin"
|
|
345
|
-
}, ft = (n) => typeof n == "string" && n !== "",
|
|
345
|
+
}, ft = (n) => typeof n == "string" && n !== "", Me = (n) => n instanceof HTMLElement, vt = (n) => n instanceof NodeList, A = (n) => _(n) !== null, G = (n) => typeof n == "function", _ = (n) => Me(n) ? n : document.querySelector(n), D = (n) => vt(n) ? n : document.querySelectorAll(n), Us = () => Math.random().toString(36).substr(2, 9), Ys = (n) => {
|
|
346
346
|
const i = document.createElement("div");
|
|
347
347
|
return i.innerHTML = n, i.childNodes;
|
|
348
348
|
}, Fs = (n) => {
|
|
@@ -397,14 +397,14 @@ const He = {
|
|
|
397
397
|
easeOutQuart(n, i, t, e) {
|
|
398
398
|
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
|
399
399
|
}
|
|
400
|
-
},
|
|
400
|
+
}, qe = (n, i) => {
|
|
401
401
|
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", h = c ? "left" : "top", g = c ? "width" : "height", m = A(e) ? _(e) : document.scrollingElement, v = m[u], w = A(t) ? _(t).getBoundingClientRect()[h] : 0 - v, b = A(s) ? _(s).getBoundingClientRect()[g] : 0, T = w - a - b, C = 15;
|
|
402
402
|
let y = 0;
|
|
403
403
|
if (T === 0)
|
|
404
404
|
return;
|
|
405
405
|
const L = (k) => {
|
|
406
|
-
const
|
|
407
|
-
i && i.emit(k,
|
|
406
|
+
const J = _(t);
|
|
407
|
+
i && i.emit(k, J), !i && n.on && G(n.on[k]) && n.on[k](J);
|
|
408
408
|
};
|
|
409
409
|
L("beforeScroll");
|
|
410
410
|
const O = () => {
|
|
@@ -414,16 +414,16 @@ const He = {
|
|
|
414
414
|
};
|
|
415
415
|
requestAnimationFrame(O);
|
|
416
416
|
};
|
|
417
|
-
var
|
|
417
|
+
var et, Oe, Lt, yi, _t, wi;
|
|
418
418
|
class bi {
|
|
419
419
|
constructor(i, t = {}) {
|
|
420
|
-
p(this,
|
|
421
|
-
p(this, St);
|
|
420
|
+
p(this, et);
|
|
422
421
|
p(this, Lt);
|
|
422
|
+
p(this, _t);
|
|
423
423
|
this.__storage__ = {
|
|
424
424
|
el: i,
|
|
425
425
|
options: t
|
|
426
|
-
}, this.active = "data-anchor-active", d(this,
|
|
426
|
+
}, this.active = "data-anchor-active", d(this, et, Oe).call(this);
|
|
427
427
|
}
|
|
428
428
|
destroy() {
|
|
429
429
|
const { elements: i } = this;
|
|
@@ -433,12 +433,12 @@ class bi {
|
|
|
433
433
|
}
|
|
434
434
|
update() {
|
|
435
435
|
var i;
|
|
436
|
-
return d(i = this.destroy(),
|
|
436
|
+
return d(i = this.destroy(), et, Oe).call(i), this.emit("afterUpdate"), this;
|
|
437
437
|
}
|
|
438
438
|
static run(i) {
|
|
439
439
|
const { SETTINGS: t } = wt, e = Object.assign({}, t, i);
|
|
440
440
|
setTimeout(() => {
|
|
441
|
-
|
|
441
|
+
qe(e);
|
|
442
442
|
}, e.delay);
|
|
443
443
|
}
|
|
444
444
|
static url(i) {
|
|
@@ -447,11 +447,11 @@ class bi {
|
|
|
447
447
|
return;
|
|
448
448
|
const r = Object.assign({}, t, i, { target: a });
|
|
449
449
|
setTimeout(() => {
|
|
450
|
-
|
|
450
|
+
qe(r);
|
|
451
451
|
}, r.delay);
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
|
|
454
|
+
et = new WeakSet(), Oe = function() {
|
|
455
455
|
const { el: i, options: t } = this.__storage__;
|
|
456
456
|
if (!ft(i) || !A(i))
|
|
457
457
|
return;
|
|
@@ -459,13 +459,13 @@ tt = new WeakSet(), qe = function() {
|
|
|
459
459
|
if (this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.elements = D(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
460
460
|
for (const [o, a] of Object.entries(this.options.on))
|
|
461
461
|
this.__events__[o] = [a];
|
|
462
|
-
d(this,
|
|
463
|
-
},
|
|
462
|
+
d(this, Lt, yi).call(this);
|
|
463
|
+
}, Lt = new WeakSet(), yi = function() {
|
|
464
464
|
const { elements: i, options: t } = this;
|
|
465
465
|
i.forEach((e) => {
|
|
466
|
-
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this,
|
|
466
|
+
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, _t, wi), e.anchor.defaultOptions = t, e.anchor.methods = {}, e.anchor.methods.destroy = this.destroy, e.anchor.methods.update = this.update, e.addEventListener("click", e.anchor.eventHandler), e.setAttribute(this.active, "");
|
|
467
467
|
}), this.emit("afterInit");
|
|
468
|
-
},
|
|
468
|
+
}, _t = new WeakSet(), wi = function() {
|
|
469
469
|
const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor, s = {
|
|
470
470
|
target: this.getAttribute("data-anchor-target") || i.target,
|
|
471
471
|
container: this.getAttribute("data-anchor-container") || i.container,
|
|
@@ -479,7 +479,7 @@ tt = new WeakSet(), qe = function() {
|
|
|
479
479
|
this.removeEventListener("click", t), setTimeout(() => {
|
|
480
480
|
this.addEventListener("click", t);
|
|
481
481
|
}, s.speed), setTimeout(() => {
|
|
482
|
-
|
|
482
|
+
qe(s, e);
|
|
483
483
|
}, s.delay);
|
|
484
484
|
};
|
|
485
485
|
Object.assign(bi.prototype, z);
|
|
@@ -492,15 +492,15 @@ const { MODALS: P } = window, Zs = (n) => {
|
|
|
492
492
|
s.append(o);
|
|
493
493
|
}), e.children[0];
|
|
494
494
|
};
|
|
495
|
-
var
|
|
495
|
+
var Dt, Ei, kt, Ai, xt, Si, $t, Li, Ct, _i;
|
|
496
496
|
class Ti extends HTMLElement {
|
|
497
497
|
constructor() {
|
|
498
498
|
super();
|
|
499
|
-
p(this, _t);
|
|
500
499
|
p(this, Dt);
|
|
501
500
|
p(this, kt);
|
|
502
501
|
p(this, xt);
|
|
503
502
|
p(this, $t);
|
|
503
|
+
p(this, Ct);
|
|
504
504
|
this.initialize = !1;
|
|
505
505
|
}
|
|
506
506
|
static get observedAttributes() {
|
|
@@ -509,12 +509,12 @@ class Ti extends HTMLElement {
|
|
|
509
509
|
attributeChangedCallback(t, e, s) {
|
|
510
510
|
switch (t) {
|
|
511
511
|
case ":state":
|
|
512
|
-
d(this,
|
|
512
|
+
d(this, Ct, _i).call(this, s);
|
|
513
513
|
break;
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
516
|
connectedCallback() {
|
|
517
|
-
this.initialize || (this.initialize = !0, d(this,
|
|
517
|
+
this.initialize || (this.initialize = !0, d(this, Dt, Ei).call(this));
|
|
518
518
|
}
|
|
519
519
|
open() {
|
|
520
520
|
return this.setAttribute(":state", "open"), this;
|
|
@@ -526,22 +526,22 @@ class Ti extends HTMLElement {
|
|
|
526
526
|
return this.setAttribute(":state", "destroy"), this;
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
|
|
529
|
+
Dt = new WeakSet(), Ei = function() {
|
|
530
530
|
const { ATTRS: t } = j;
|
|
531
531
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
|
532
532
|
const e = this.getAttribute(t.id) || Us();
|
|
533
|
-
this.getAttribute(t.id) || (E(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), P[e] && E(`the ${t.id} "${e}" is already be used.`), P[e] = this, d(this,
|
|
534
|
-
},
|
|
535
|
-
this.childDom = this.childNodes, this.template = Zs(this), this.innerHTML = "", this.append(this.template), d(this,
|
|
536
|
-
},
|
|
533
|
+
this.getAttribute(t.id) || (E(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), P[e] && E(`the ${t.id} "${e}" is already be used.`), P[e] = this, d(this, kt, Ai).call(this);
|
|
534
|
+
}, kt = new WeakSet(), Ai = function() {
|
|
535
|
+
this.childDom = this.childNodes, this.template = Zs(this), this.innerHTML = "", this.append(this.template), d(this, xt, Si).call(this);
|
|
536
|
+
}, xt = new WeakSet(), Si = function() {
|
|
537
537
|
const t = this.querySelector(".modal-scroller");
|
|
538
538
|
this.__scroller__ = Ve(t, {
|
|
539
539
|
overflowBehavior: {
|
|
540
540
|
x: "hidden"
|
|
541
541
|
},
|
|
542
542
|
autoUpdate: !0
|
|
543
|
-
}), window.modalScroll = this.__scroller__, d(this,
|
|
544
|
-
},
|
|
543
|
+
}), window.modalScroll = this.__scroller__, d(this, $t, Li).call(this);
|
|
544
|
+
}, $t = new WeakSet(), Li = function() {
|
|
545
545
|
var a, r, l;
|
|
546
546
|
const t = this, { ATTRS: e } = j, { close: s, destroy: o } = e;
|
|
547
547
|
(a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
|
|
@@ -557,7 +557,7 @@ _t = new WeakSet(), Ei = function() {
|
|
|
557
557
|
}), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
|
|
558
558
|
c.stopPropagation();
|
|
559
559
|
});
|
|
560
|
-
},
|
|
560
|
+
}, Ct = new WeakSet(), _i = function(t) {
|
|
561
561
|
const { __scroller__: e } = this;
|
|
562
562
|
if (t === "open") {
|
|
563
563
|
if (this.style.display = "block", e) {
|
|
@@ -595,7 +595,7 @@ const { MODALS: ei } = window, bt = {}, Di = (n, i, ...t) => {
|
|
|
595
595
|
const e = n[i];
|
|
596
596
|
e && G(e) && e.apply(n, t);
|
|
597
597
|
}, ki = (n, ...i) => {
|
|
598
|
-
n && G(n) && n.apply(
|
|
598
|
+
n && G(n) && n.apply(tt, i);
|
|
599
599
|
}, oi = (n, i) => {
|
|
600
600
|
const { target: t } = n, e = ei[t] || _(n.target);
|
|
601
601
|
e && xi(n, i), e || Qs(n, i);
|
|
@@ -638,16 +638,16 @@ const { MODALS: ei } = window, bt = {}, Di = (n, i, ...t) => {
|
|
|
638
638
|
r("error", l), delete bt[t];
|
|
639
639
|
}));
|
|
640
640
|
};
|
|
641
|
-
var
|
|
641
|
+
var it, Pe, Ht, $i, It, Ci;
|
|
642
642
|
const B = class B {
|
|
643
643
|
constructor(i, t = {}) {
|
|
644
|
-
p(this,
|
|
645
|
-
p(this, Ct);
|
|
644
|
+
p(this, it);
|
|
646
645
|
p(this, Ht);
|
|
646
|
+
p(this, It);
|
|
647
647
|
this.__storage__ = {
|
|
648
648
|
el: i,
|
|
649
649
|
options: t
|
|
650
|
-
}, this.active = "data-modal-active", d(this,
|
|
650
|
+
}, this.active = "data-modal-active", d(this, it, Pe).call(this);
|
|
651
651
|
}
|
|
652
652
|
destroy() {
|
|
653
653
|
const { elements: i } = this;
|
|
@@ -657,7 +657,7 @@ const B = class B {
|
|
|
657
657
|
}
|
|
658
658
|
update() {
|
|
659
659
|
var i;
|
|
660
|
-
return d(i = this.destroy(),
|
|
660
|
+
return d(i = this.destroy(), it, Pe).call(i), this.emit("update"), this;
|
|
661
661
|
}
|
|
662
662
|
/** static method 'open' */
|
|
663
663
|
static open(i) {
|
|
@@ -673,7 +673,7 @@ const B = class B {
|
|
|
673
673
|
Object.assign(B.prototype, B.prototype.__methods__);
|
|
674
674
|
}
|
|
675
675
|
};
|
|
676
|
-
|
|
676
|
+
it = new WeakSet(), Pe = function() {
|
|
677
677
|
const { el: i, options: t } = this.__storage__;
|
|
678
678
|
if (!ft(i) || !A(i))
|
|
679
679
|
return;
|
|
@@ -681,13 +681,13 @@ et = new WeakSet(), Oe = function() {
|
|
|
681
681
|
if (this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
682
682
|
for (const [o, a] of Object.entries(this.options.on))
|
|
683
683
|
this.__events__[o] = [a];
|
|
684
|
-
d(this,
|
|
685
|
-
},
|
|
684
|
+
d(this, Ht, $i).call(this);
|
|
685
|
+
}, Ht = new WeakSet(), $i = function() {
|
|
686
686
|
const { elements: i, options: t } = this;
|
|
687
687
|
i.forEach((e) => {
|
|
688
|
-
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this,
|
|
688
|
+
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, It, Ci), e.modal.defaultOptions = t, e.modal.methods = {}, e.modal.methods.destroy = this.destroy, e.modal.methods.update = this.update, e.addEventListener("click", e.modal.eventHandler), e.setAttribute(this.active, "");
|
|
689
689
|
}), this.emit("init");
|
|
690
|
-
},
|
|
690
|
+
}, It = new WeakSet(), Ci = function(i) {
|
|
691
691
|
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = Fs(this.getAttribute("data-modal-on"));
|
|
692
692
|
o && typeof o != "object" && E("modal4", "data-modal-on must be a json string.");
|
|
693
693
|
const a = {
|
|
@@ -702,8 +702,8 @@ et = new WeakSet(), Oe = function() {
|
|
|
702
702
|
this.addEventListener("click", e);
|
|
703
703
|
}, 200), oi(a, s);
|
|
704
704
|
};
|
|
705
|
-
let
|
|
706
|
-
Object.assign(
|
|
705
|
+
let tt = B;
|
|
706
|
+
Object.assign(tt.prototype, z);
|
|
707
707
|
customElements.define("modern-modal", Ti);
|
|
708
708
|
const Ks = (n, i) => {
|
|
709
709
|
const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
|
|
@@ -721,15 +721,15 @@ const Ks = (n, i) => {
|
|
|
721
721
|
}
|
|
722
722
|
});
|
|
723
723
|
}, Vs = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
|
|
724
|
-
var
|
|
724
|
+
var st, Ne, Mt, Ii;
|
|
725
725
|
class Hi {
|
|
726
726
|
constructor(i, t = {}) {
|
|
727
|
-
p(this,
|
|
728
|
-
p(this,
|
|
727
|
+
p(this, st);
|
|
728
|
+
p(this, Mt);
|
|
729
729
|
this.__storage__ = {
|
|
730
730
|
el: i,
|
|
731
731
|
options: t
|
|
732
|
-
}, this.active = "data-aost-active", d(this,
|
|
732
|
+
}, this.active = "data-aost-active", d(this, st, Ne).call(this);
|
|
733
733
|
}
|
|
734
734
|
destroy(i) {
|
|
735
735
|
const { elements: t, options: e } = this;
|
|
@@ -745,10 +745,10 @@ class Hi {
|
|
|
745
745
|
}
|
|
746
746
|
update(i) {
|
|
747
747
|
var t;
|
|
748
|
-
d(t = this.destroy(i),
|
|
748
|
+
d(t = this.destroy(i), st, Ne).call(t);
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
|
|
751
|
+
st = new WeakSet(), Ne = function() {
|
|
752
752
|
const { el: i, options: t } = this.__storage__;
|
|
753
753
|
if (!ft(i) || !A(i))
|
|
754
754
|
return;
|
|
@@ -756,8 +756,8 @@ it = new WeakSet(), Pe = function() {
|
|
|
756
756
|
if (this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
757
757
|
for (const [o, a] of Object.entries(this.options.on))
|
|
758
758
|
this.__events__[o] = [a];
|
|
759
|
-
d(this,
|
|
760
|
-
},
|
|
759
|
+
d(this, Mt, Ii).call(this);
|
|
760
|
+
}, Mt = new WeakSet(), Ii = function() {
|
|
761
761
|
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !A(e) ? window : _(e);
|
|
762
762
|
this.eventHandler = () => {
|
|
763
763
|
Ks(s, i);
|
|
@@ -769,34 +769,34 @@ it = new WeakSet(), Pe = function() {
|
|
|
769
769
|
};
|
|
770
770
|
Object.assign(Hi.prototype, z);
|
|
771
771
|
const tn = (n) => {
|
|
772
|
-
const { TEMPLATE: i } =
|
|
772
|
+
const { TEMPLATE: i } = Ie, { childDom: t } = n, e = document.createElement("div");
|
|
773
773
|
e.innerHTML = i();
|
|
774
774
|
const s = e.querySelector(".player-wrapper");
|
|
775
775
|
return [...t].forEach((o) => {
|
|
776
776
|
s.append(o);
|
|
777
777
|
}), e.children[0];
|
|
778
778
|
};
|
|
779
|
-
var
|
|
779
|
+
var qt, Mi, Ot, qi, Pt, Oi, Nt, Pi, jt, Ni, zt, ji, Bt, zi, Wt, Bi, Gt, Wi, Rt, Gi;
|
|
780
780
|
class en extends HTMLElement {
|
|
781
781
|
constructor() {
|
|
782
782
|
super();
|
|
783
|
-
p(this, Mt);
|
|
784
783
|
p(this, qt);
|
|
785
784
|
p(this, Ot);
|
|
786
|
-
// youtube iframe
|
|
787
785
|
p(this, Pt);
|
|
788
|
-
//
|
|
786
|
+
// youtube iframe
|
|
789
787
|
p(this, Nt);
|
|
790
|
-
//
|
|
788
|
+
// vimeo iframe
|
|
791
789
|
p(this, jt);
|
|
790
|
+
// youku iframe
|
|
792
791
|
p(this, zt);
|
|
793
|
-
// 2025.02.11 新增 ig
|
|
794
792
|
p(this, Bt);
|
|
795
|
-
// 2025.02.11 新增
|
|
793
|
+
// 2025.02.11 新增 ig
|
|
796
794
|
p(this, Wt);
|
|
797
|
-
//
|
|
795
|
+
// 2025.02.11 新增 tiktok
|
|
798
796
|
p(this, Gt);
|
|
799
|
-
|
|
797
|
+
// 2026.01.15 新增 video
|
|
798
|
+
p(this, Rt);
|
|
799
|
+
d(this, qt, Mi).call(this);
|
|
800
800
|
}
|
|
801
801
|
play() {
|
|
802
802
|
const { videoType: t } = this;
|
|
@@ -833,16 +833,16 @@ class en extends HTMLElement {
|
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
|
|
836
|
+
qt = new WeakSet(), Mi = function() {
|
|
837
837
|
if (!this.getAttribute("video-id")) {
|
|
838
838
|
E("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
|
839
839
|
return;
|
|
840
840
|
}
|
|
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,
|
|
842
|
-
},
|
|
843
|
-
this.childDom = this.childNodes, this.template = tn(this), this.innerHTML = "", this.append(this.template), d(this,
|
|
844
|
-
},
|
|
845
|
-
const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: s } =
|
|
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, Ot, qi).call(this);
|
|
842
|
+
}, Ot = new WeakSet(), qi = function() {
|
|
843
|
+
this.childDom = this.childNodes, this.template = tn(this), this.innerHTML = "", this.append(this.template), d(this, Pt, Oi).call(this);
|
|
844
|
+
}, Pt = new WeakSet(), Oi = function() {
|
|
845
|
+
const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: s } = Ie;
|
|
846
846
|
let o = "";
|
|
847
847
|
function a(r) {
|
|
848
848
|
f(r).addClass("cookie-disagree"), f(".cookie-disagree").append(s);
|
|
@@ -851,55 +851,55 @@ Mt = new WeakSet(), Mi = function() {
|
|
|
851
851
|
case "youtubeAPI":
|
|
852
852
|
break;
|
|
853
853
|
case "youtube":
|
|
854
|
-
document.body.wd_youtube == !1 ? a("video-player") : o = d(this,
|
|
854
|
+
document.body.wd_youtube == !1 ? a("video-player") : o = d(this, Nt, Pi).call(this);
|
|
855
855
|
break;
|
|
856
856
|
case "youkuAPI":
|
|
857
857
|
break;
|
|
858
858
|
case "youku":
|
|
859
|
-
document.body.wd_youku == !1 ? a("video-player") : o = d(this,
|
|
859
|
+
document.body.wd_youku == !1 ? a("video-player") : o = d(this, zt, ji).call(this);
|
|
860
860
|
break;
|
|
861
861
|
case "vimeo":
|
|
862
|
-
document.body.wd_vimeo == !1 ? a("video-player") : o = d(this,
|
|
862
|
+
document.body.wd_vimeo == !1 ? a("video-player") : o = d(this, jt, Ni).call(this);
|
|
863
863
|
break;
|
|
864
864
|
case "bilibili":
|
|
865
|
-
document.body.wd_bilibili == !1 ? a("video-player") : o = d(this,
|
|
865
|
+
document.body.wd_bilibili == !1 ? a("video-player") : o = d(this, Bt, zi).call(this);
|
|
866
866
|
break;
|
|
867
867
|
case "instagram":
|
|
868
|
-
document.body.wd_instagram == !1 ? a(".instagram-media") : o = d(this,
|
|
868
|
+
document.body.wd_instagram == !1 ? a(".instagram-media") : o = d(this, Wt, Bi).call(this);
|
|
869
869
|
break;
|
|
870
870
|
case "tiktok":
|
|
871
|
-
document.body.wd_tiktok == !1 ? a("video-player") : o = d(this,
|
|
871
|
+
document.body.wd_tiktok == !1 ? a("video-player") : o = d(this, Gt, Wi).call(this);
|
|
872
872
|
break;
|
|
873
873
|
case "videojs":
|
|
874
874
|
break;
|
|
875
875
|
case "video":
|
|
876
|
-
o = d(this,
|
|
876
|
+
o = d(this, Rt, Gi).call(this);
|
|
877
877
|
break;
|
|
878
878
|
}
|
|
879
879
|
this.querySelector(".player-wrapper").insertAdjacentHTML(S.prepend, o);
|
|
880
|
-
},
|
|
880
|
+
}, Nt = new WeakSet(), Pi = function() {
|
|
881
881
|
const { videoId: t, autoplay: e, startTime: s } = this;
|
|
882
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>`;
|
|
883
|
-
},
|
|
883
|
+
}, jt = new WeakSet(), Ni = function() {
|
|
884
884
|
const { videoId: t, autoplay: e, hash: s } = this;
|
|
885
885
|
return `<iframe src="https://player.vimeo.com/video/${t}?h=${s}&${e === "on" ? "autoplay=1" : ""}&loop=1&color=ffffff&title=0&byline=0&portrait=0" frameborder="0" allow="${e === "on" ? "autoplay;" : ""} fullscreen; picture-in-picture" allowfullscreen></iframe><script src="https://player.vimeo.com/api/player.js"><\/script>`;
|
|
886
|
-
},
|
|
886
|
+
}, zt = new WeakSet(), ji = function() {
|
|
887
887
|
const { videoId: t, autoplay: e } = this;
|
|
888
888
|
return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=true" : ""}" allow="${e === "on" ? "autoplay;" : ""} width="100%" height="100%" frameborder=0 "allowfullscreen"></iframe>`;
|
|
889
|
-
},
|
|
889
|
+
}, Bt = new WeakSet(), zi = function() {
|
|
890
890
|
const { videoId: t, autoplay: e } = this;
|
|
891
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>`;
|
|
892
|
-
},
|
|
892
|
+
}, Wt = new WeakSet(), Bi = function() {
|
|
893
893
|
const { videoId: t, autoplay: e } = this;
|
|
894
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>`;
|
|
895
|
-
},
|
|
895
|
+
}, Gt = new WeakSet(), Wi = function() {
|
|
896
896
|
const { videoId: t, autoplay: e } = this;
|
|
897
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>`;
|
|
898
|
-
},
|
|
898
|
+
}, Rt = new WeakSet(), Gi = function() {
|
|
899
899
|
const { videoId: t, autoplay: e } = this;
|
|
900
900
|
return `<video src="${t}" ${e == "on" ? "autoplay" : ""} muted playsinline controls></video>`;
|
|
901
901
|
};
|
|
902
|
-
let
|
|
902
|
+
let K = 0;
|
|
903
903
|
function Ri(n) {
|
|
904
904
|
const i = [];
|
|
905
905
|
return (n || []).forEach((t) => {
|
|
@@ -908,12 +908,12 @@ function Ri(n) {
|
|
|
908
908
|
}
|
|
909
909
|
function Xi(n) {
|
|
910
910
|
const i = Ri(n);
|
|
911
|
-
|
|
911
|
+
K += 1, K === 1 && document.documentElement.classList.add("scrollLock"), Ws(i);
|
|
912
912
|
}
|
|
913
913
|
function Ui(n) {
|
|
914
|
-
|
|
914
|
+
K = Math.max(0, K - 1);
|
|
915
915
|
const i = Ri(n);
|
|
916
|
-
Gs(i),
|
|
916
|
+
Gs(i), K === 0 && document.documentElement.classList.remove("scrollLock");
|
|
917
917
|
}
|
|
918
918
|
async function zn(n = 0) {
|
|
919
919
|
if (f(".loading-wrapper").length)
|
|
@@ -1132,32 +1132,32 @@ function uo(n) {
|
|
|
1132
1132
|
return i.innerHTML = n, i.childNodes[0];
|
|
1133
1133
|
}
|
|
1134
1134
|
const ai = (n) => n.videoId !== "" || typeof n.videoId < "u", on = (n) => n.$selector.getAttribute("video4-active") === "on", yt = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`, ri = (n) => (console.log(n.videoId, "params.videoId"), `<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="${n.videoId}"></blockquote>`);
|
|
1135
|
-
var
|
|
1135
|
+
var nt, ze, Xt, Yi, ot, Be, at, We, Ut, Fi, rt, Ge, Yt, Ji;
|
|
1136
1136
|
const X = class X {
|
|
1137
1137
|
//*-* 給Article4用的 **//
|
|
1138
1138
|
constructor(i, t = {}) {
|
|
1139
|
-
p(this, st);
|
|
1140
|
-
p(this, Rt);
|
|
1141
1139
|
p(this, nt);
|
|
1142
|
-
p(this, ot);
|
|
1143
1140
|
p(this, Xt);
|
|
1141
|
+
p(this, ot);
|
|
1144
1142
|
p(this, at);
|
|
1145
1143
|
p(this, Ut);
|
|
1146
|
-
|
|
1144
|
+
p(this, rt);
|
|
1145
|
+
p(this, Yt);
|
|
1146
|
+
if (!ft(i) && !Me(i) && !vt(i)) {
|
|
1147
1147
|
ni("video4", `找不到該物件 -> ${i}`);
|
|
1148
1148
|
return;
|
|
1149
1149
|
}
|
|
1150
1150
|
this.__storage__ = {
|
|
1151
1151
|
el: i,
|
|
1152
1152
|
options: t
|
|
1153
|
-
}, this.active = "data-video-active", d(this,
|
|
1153
|
+
}, this.active = "data-video-active", d(this, nt, ze).call(this);
|
|
1154
1154
|
}
|
|
1155
1155
|
update() {
|
|
1156
|
-
d(this,
|
|
1156
|
+
d(this, nt, ze).call(this);
|
|
1157
1157
|
}
|
|
1158
1158
|
};
|
|
1159
|
-
|
|
1160
|
-
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s, LAYOUT: o } =
|
|
1159
|
+
nt = new WeakSet(), ze = function() {
|
|
1160
|
+
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s, LAYOUT: o } = Ie;
|
|
1161
1161
|
if (t.isGlobal && (X.globalOptions = t), this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.options = Object.assign(
|
|
1162
1162
|
{},
|
|
1163
1163
|
{ LAYOUT: o },
|
|
@@ -1171,18 +1171,18 @@ st = new WeakSet(), je = function() {
|
|
|
1171
1171
|
), this.__events__ = Object.assign({}, s), this.options.on)
|
|
1172
1172
|
for (const [a, r] of Object.entries(this.options.on))
|
|
1173
1173
|
this.__events__[a] = [r];
|
|
1174
|
-
d(this,
|
|
1175
|
-
},
|
|
1174
|
+
d(this, Xt, Yi).call(this);
|
|
1175
|
+
}, Xt = new WeakSet(), Yi = function() {
|
|
1176
1176
|
const { elements: i, options: t } = this;
|
|
1177
1177
|
i.forEach((e) => {
|
|
1178
|
-
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this,
|
|
1178
|
+
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, Yt, Ji).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), ai(e.video.params) && !on(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, Ut, Fi).call(this, e)), ai(e.video.params) || ni("video4", "無法取得影片 ID");
|
|
1179
1179
|
}), this.emit("init");
|
|
1180
|
-
},
|
|
1180
|
+
}, ot = new WeakSet(), Be = function(i) {
|
|
1181
1181
|
const { $selector: t, videoId: e, videoType: s, videoInboxImg: o, videoHighQualityPic: a } = i, r = t == null ? void 0 : t.querySelector("img"), l = (r == null ? void 0 : r.getAttribute("src")) || (r == null ? void 0 : r.getAttribute("data-src"));
|
|
1182
1182
|
return o ? Promise.resolve(o) : l ? Promise.resolve(l) : s == "youtube" ? a == "on" ? Promise.resolve(`https://img.youtube.com/vi/${e}/maxresdefault.jpg`) : Promise.resolve(`https://img.youtube.com/vi/${e}/0.jpg`) : s == "vimeo" ? Promise.resolve(`https://vumbnail.com/${e}_large.jpg`) : s == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${e}`, { method: "GET", redirect: "follow" }).then((c) => c.json()).then((c) => c.thumbnail_url).catch(function() {
|
|
1183
1183
|
return "";
|
|
1184
1184
|
}) : Promise.resolve("");
|
|
1185
|
-
},
|
|
1185
|
+
}, at = new WeakSet(), We = function(i, t) {
|
|
1186
1186
|
const { videoType: e, videoId: s } = t;
|
|
1187
1187
|
if (!(i != null && i.getAttribute("src") || i != null && i.getAttribute("data-src"))) {
|
|
1188
1188
|
if (e === "video") {
|
|
@@ -1195,11 +1195,11 @@ st = new WeakSet(), je = function() {
|
|
|
1195
1195
|
};
|
|
1196
1196
|
return;
|
|
1197
1197
|
}
|
|
1198
|
-
d(this,
|
|
1198
|
+
d(this, ot, Be).call(this, t).then((a) => {
|
|
1199
1199
|
a ? i.setAttribute("src", `${a}`) : E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
|
1200
1200
|
});
|
|
1201
1201
|
}
|
|
1202
|
-
},
|
|
1202
|
+
}, Ut = new WeakSet(), Fi = function(i) {
|
|
1203
1203
|
const { LAYOUT: t } = this.options, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: h } = e;
|
|
1204
1204
|
if (l === "onBox" || l === "inBox") {
|
|
1205
1205
|
let g = null;
|
|
@@ -1207,7 +1207,7 @@ st = new WeakSet(), je = function() {
|
|
|
1207
1207
|
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>'), E("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
|
1208
1208
|
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] || "";
|
|
1209
1209
|
if (w ? m.insertAdjacentHTML(S.after, w) : E("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !v)
|
|
1210
|
-
d(this,
|
|
1210
|
+
d(this, at, We).call(this, m, e);
|
|
1211
1211
|
else if (!v && r == "youtube")
|
|
1212
1212
|
h == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
|
|
1213
1213
|
else if (!v && r == "vimeo")
|
|
@@ -1228,7 +1228,7 @@ st = new WeakSet(), je = function() {
|
|
|
1228
1228
|
console.log("error");
|
|
1229
1229
|
}) : E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
|
1230
1230
|
}
|
|
1231
|
-
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e, g.video.instance = this), g.video.eventHandler = d(this,
|
|
1231
|
+
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e, g.video.instance = this), g.video.eventHandler = d(this, rt, Ge), g.addEventListener("click", g.video.eventHandler);
|
|
1232
1232
|
} else if (l === "onPage") {
|
|
1233
1233
|
let g = null;
|
|
1234
1234
|
if (u == "on") {
|
|
@@ -1241,14 +1241,14 @@ st = new WeakSet(), je = function() {
|
|
|
1241
1241
|
m.setAttribute("src", `${b}`);
|
|
1242
1242
|
}).catch(function(w) {
|
|
1243
1243
|
console.log("error");
|
|
1244
|
-
}) : v || E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片") : d(this,
|
|
1244
|
+
}) : v || E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片") : d(this, at, We).call(this, m, e), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
|
1245
1245
|
} else {
|
|
1246
1246
|
s.innerHTML = yt(e);
|
|
1247
1247
|
return;
|
|
1248
1248
|
}
|
|
1249
|
-
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this,
|
|
1249
|
+
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, rt, Ge), g.addEventListener("click", g.video.eventHandler);
|
|
1250
1250
|
}
|
|
1251
|
-
},
|
|
1251
|
+
}, rt = new WeakSet(), Ge = function(i) {
|
|
1252
1252
|
const { video: t } = this, e = t.instance, {
|
|
1253
1253
|
$selector: s,
|
|
1254
1254
|
videoMode: o,
|
|
@@ -1282,8 +1282,8 @@ st = new WeakSet(), je = function() {
|
|
|
1282
1282
|
const L = y.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1283
1283
|
if (b.update(), Xi([...L]), u == "instagram") {
|
|
1284
1284
|
const k = document.querySelector("[video-template] .modal-content");
|
|
1285
|
-
new ResizeObserver((
|
|
1286
|
-
|
|
1285
|
+
new ResizeObserver((Z) => {
|
|
1286
|
+
Z[0].contentRect.height > 50 && k.classList.add("active");
|
|
1287
1287
|
}).observe(k);
|
|
1288
1288
|
}
|
|
1289
1289
|
if (o == "inBox")
|
|
@@ -1291,8 +1291,8 @@ st = new WeakSet(), je = function() {
|
|
|
1291
1291
|
f(".video-content").remove();
|
|
1292
1292
|
else {
|
|
1293
1293
|
let k;
|
|
1294
|
-
const
|
|
1295
|
-
d(O = e,
|
|
1294
|
+
const J = y.querySelector(".video-content");
|
|
1295
|
+
d(O = e, ot, Be).call(O, t.params).then((Z) => {
|
|
1296
1296
|
k = `
|
|
1297
1297
|
<div
|
|
1298
1298
|
class="photo-box"
|
|
@@ -1306,16 +1306,16 @@ st = new WeakSet(), je = function() {
|
|
|
1306
1306
|
>
|
|
1307
1307
|
<picture>
|
|
1308
1308
|
<source
|
|
1309
|
-
srcset="${
|
|
1309
|
+
srcset="${Z || ""}"
|
|
1310
1310
|
type="image/webp"
|
|
1311
1311
|
/>
|
|
1312
1312
|
<source
|
|
1313
|
-
srcset="${
|
|
1313
|
+
srcset="${Z || ""}"
|
|
1314
1314
|
type="image/jpeg"
|
|
1315
1315
|
/>
|
|
1316
|
-
<img src="${
|
|
1316
|
+
<img src="${Z || ""}" alt="" />
|
|
1317
1317
|
</picture>
|
|
1318
|
-
</div>`,
|
|
1318
|
+
</div>`, J.insertAdjacentHTML(S.prepend, k);
|
|
1319
1319
|
const ii = y.querySelectorAll("[video-target]");
|
|
1320
1320
|
ii.length > 0 && new X(ii, {
|
|
1321
1321
|
LAYOUT: t.params.LAYOUT,
|
|
@@ -1333,7 +1333,7 @@ st = new WeakSet(), je = function() {
|
|
|
1333
1333
|
}
|
|
1334
1334
|
}
|
|
1335
1335
|
};
|
|
1336
|
-
|
|
1336
|
+
tt.open(C);
|
|
1337
1337
|
} else if (o == "onPage")
|
|
1338
1338
|
if (t.params.videoAutoplay = "on", r == "off") {
|
|
1339
1339
|
if (s.querySelector("video-player"))
|
|
@@ -1344,7 +1344,7 @@ st = new WeakSet(), je = function() {
|
|
|
1344
1344
|
(s.querySelector(r) ?? s).insertAdjacentHTML("beforeend", yt(t.params));
|
|
1345
1345
|
return;
|
|
1346
1346
|
}
|
|
1347
|
-
},
|
|
1347
|
+
}, Yt = new WeakSet(), Ji = function(i) {
|
|
1348
1348
|
const t = this.options;
|
|
1349
1349
|
return {
|
|
1350
1350
|
$selector: i,
|
|
@@ -1365,8 +1365,8 @@ st = new WeakSet(), je = function() {
|
|
|
1365
1365
|
LAYOUT: t.LAYOUT || []
|
|
1366
1366
|
};
|
|
1367
1367
|
}, si(X, "globalOptions", {});
|
|
1368
|
-
let
|
|
1369
|
-
Object.assign(
|
|
1368
|
+
let je = X;
|
|
1369
|
+
Object.assign(je.prototype, z);
|
|
1370
1370
|
customElements.define("video-player", en);
|
|
1371
1371
|
const an = {
|
|
1372
1372
|
"zh-tw": {
|
|
@@ -2198,7 +2198,7 @@ const an = {
|
|
|
2198
2198
|
]
|
|
2199
2199
|
}
|
|
2200
2200
|
};
|
|
2201
|
-
let
|
|
2201
|
+
let V;
|
|
2202
2202
|
const rn = (n) => {
|
|
2203
2203
|
const { TEMPLATE: i } = ti, { 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");
|
|
2204
2204
|
e.innerHTML = i(
|
|
@@ -2274,17 +2274,17 @@ const rn = (n) => {
|
|
|
2274
2274
|
}
|
|
2275
2275
|
}, cn = (n) => {
|
|
2276
2276
|
const i = n.s.cityLang;
|
|
2277
|
-
f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (
|
|
2277
|
+
f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (V = JSON.parse(f("#newCityData").val())[0], console.log([0])) : V = an, n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(V[i]).forEach((t) => {
|
|
2278
2278
|
const e = document.createElement("li");
|
|
2279
2279
|
e.textContent = t, e.setAttribute("data-option", t), n.s.dropdownEl.querySelector(".dropdown-list").append(e);
|
|
2280
2280
|
}), n.s.allLi = n.s.dropdownEl.querySelectorAll(".dropdown-list li"));
|
|
2281
2281
|
}, dn = (n, i) => {
|
|
2282
2282
|
const t = n.s.cityLang;
|
|
2283
|
-
|
|
2283
|
+
V[t][i].forEach((e, s) => {
|
|
2284
2284
|
const o = document.createElement("li");
|
|
2285
2285
|
o.textContent = e[0], o.setAttribute("data-option", e[0]), n.s.dropdownEl.querySelector(".dropdown-list").append(o);
|
|
2286
2286
|
});
|
|
2287
|
-
},
|
|
2287
|
+
}, Re = () => {
|
|
2288
2288
|
D('dropdown-el[d4-status="open"]').forEach((i) => {
|
|
2289
2289
|
i.close();
|
|
2290
2290
|
});
|
|
@@ -2298,18 +2298,18 @@ const rn = (n) => {
|
|
|
2298
2298
|
};
|
|
2299
2299
|
un();
|
|
2300
2300
|
document.addEventListener("click", function() {
|
|
2301
|
-
|
|
2301
|
+
Re();
|
|
2302
2302
|
});
|
|
2303
|
-
var
|
|
2303
|
+
var Ft, Qi, Jt, Ki, U, Tt, Zt, Vi, Qt, ts;
|
|
2304
2304
|
class Zi extends HTMLElement {
|
|
2305
2305
|
constructor() {
|
|
2306
2306
|
super();
|
|
2307
|
-
p(this, Yt);
|
|
2308
2307
|
p(this, Ft);
|
|
2309
|
-
// -** 獨立 dropdown 出 body 更新
|
|
2310
|
-
p(this, rt);
|
|
2311
2308
|
p(this, Jt);
|
|
2309
|
+
// -** 獨立 dropdown 出 body 更新
|
|
2310
|
+
p(this, U);
|
|
2312
2311
|
p(this, Zt);
|
|
2312
|
+
p(this, Qt);
|
|
2313
2313
|
this.initialize = !1;
|
|
2314
2314
|
}
|
|
2315
2315
|
static get observedAttributes() {
|
|
@@ -2355,7 +2355,7 @@ class Zi extends HTMLElement {
|
|
|
2355
2355
|
}
|
|
2356
2356
|
connectedCallback() {
|
|
2357
2357
|
const t = this;
|
|
2358
|
-
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this,
|
|
2358
|
+
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, Ft, Qi).call(this));
|
|
2359
2359
|
}
|
|
2360
2360
|
disconnectedCallback() {
|
|
2361
2361
|
this.s && this.s.dropdownEl && this.s.dropdownEl.parentNode === document.body && document.body.removeChild(this.s.dropdownEl);
|
|
@@ -2363,7 +2363,7 @@ class Zi extends HTMLElement {
|
|
|
2363
2363
|
open() {
|
|
2364
2364
|
const t = this;
|
|
2365
2365
|
let e;
|
|
2366
|
-
t.getAttribute("d4-portal") == "true" ? (
|
|
2366
|
+
t.getAttribute("d4-portal") == "true" ? (Re(), t.s.dropdownEl.parentNode !== document.body && document.body.appendChild(t.s.dropdownEl), t.__scroller__ || t.__events__.bindScrollbar(), d(this, U, Tt).call(this), t.s.dropdownEl.offsetHeight, e = t.s.dropdownEl.querySelector(".dropdown-scroller").clientHeight) : e = t.querySelector(".dropdown-scroller").clientHeight;
|
|
2367
2367
|
const s = t.classList.contains("filter"), o = () => {
|
|
2368
2368
|
if (t.getAttribute("d4-portal") == "true") {
|
|
2369
2369
|
if (s)
|
|
@@ -2382,10 +2382,10 @@ class Zi extends HTMLElement {
|
|
|
2382
2382
|
const c = o() + t.s.subDropdownTotalH;
|
|
2383
2383
|
return c > r ? r : c;
|
|
2384
2384
|
};
|
|
2385
|
-
return t.getAttribute("d4-portal") !== "true" &&
|
|
2385
|
+
return t.getAttribute("d4-portal") !== "true" && Re(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.getAttribute("d4-portal") == "true" ? (t.s.dropdownEl.style.setProperty("--maxHeight", `${l()}px`), t.s.dropdownEl.style.zIndex = "9999", d(this, U, Tt).call(this), t.s.dropdownEl.offsetHeight, t.s.dropdownEl.style.height = `${l()}px`, t.__events__._scrollUpdate = () => {
|
|
2386
2386
|
var u;
|
|
2387
2387
|
const c = t.getBoundingClientRect();
|
|
2388
|
-
c.bottom < 0 || c.top > window.innerHeight ? t.close() : d(u = t,
|
|
2388
|
+
c.bottom < 0 || c.top > window.innerHeight ? t.close() : d(u = t, U, Tt).call(u);
|
|
2389
2389
|
}, window.addEventListener("scroll", t.__events__._scrollUpdate, { passive: !0, capture: !0 }), window.addEventListener("resize", t.__events__._scrollUpdate, { passive: !0 })) : (t.style.cssText = `--maxHeight: ${l()}px;`, t.s.dropdownEl.style.cssText = `
|
|
2390
2390
|
height: ${l()}px;
|
|
2391
2391
|
z-index: 2;
|
|
@@ -2408,16 +2408,16 @@ class Zi extends HTMLElement {
|
|
|
2408
2408
|
this.__events__.selectOption();
|
|
2409
2409
|
}
|
|
2410
2410
|
}
|
|
2411
|
-
|
|
2412
|
-
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this,
|
|
2413
|
-
},
|
|
2414
|
-
this.s.childDom = this.childNodes, this.s.template = rn(this), this.innerHTML = "", this.append(this.s.template), this.s.dropdownEl = this.querySelector(".dropdown"), this.getAttribute("d4-portal") === "true" && (this.s.dropdownEl.setAttribute("data-d4-portal", ""), document.body.appendChild(this.s.dropdownEl)), d(this,
|
|
2415
|
-
},
|
|
2411
|
+
Ft = new WeakSet(), Qi = function() {
|
|
2412
|
+
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Jt, Ki).call(this);
|
|
2413
|
+
}, Jt = new WeakSet(), Ki = function() {
|
|
2414
|
+
this.s.childDom = this.childNodes, this.s.template = rn(this), this.innerHTML = "", this.append(this.s.template), this.s.dropdownEl = this.querySelector(".dropdown"), this.getAttribute("d4-portal") === "true" && (this.s.dropdownEl.setAttribute("data-d4-portal", ""), document.body.appendChild(this.s.dropdownEl)), d(this, Zt, Vi).call(this);
|
|
2415
|
+
}, U = new WeakSet(), Tt = function() {
|
|
2416
2416
|
const t = this, e = t.getBoundingClientRect(), s = t.s.dropdownEl;
|
|
2417
2417
|
s.style.position = "fixed", s.style.overflow = "hidden", s.style.left = `${e.left}px`, s.style.width = `${e.width}px`;
|
|
2418
2418
|
const o = parseInt(s.style.height) || s.scrollHeight;
|
|
2419
2419
|
window.innerHeight - e.bottom < o && e.top > o ? (s.style.top = "auto", s.style.bottom = `${window.innerHeight - e.top + 5}px`) : (s.style.top = `${e.bottom + 5}px`, s.style.bottom = "auto");
|
|
2420
|
-
},
|
|
2420
|
+
}, Zt = new WeakSet(), Vi = function() {
|
|
2421
2421
|
var s;
|
|
2422
2422
|
const t = this;
|
|
2423
2423
|
t.s.allLi = t.s.dropdownEl.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw", cn(t), t.s.subDropdownTotalH = 0;
|
|
@@ -2462,8 +2462,8 @@ Yt = new WeakSet(), Qi = function() {
|
|
|
2462
2462
|
};
|
|
2463
2463
|
break;
|
|
2464
2464
|
}
|
|
2465
|
-
M(t, t.s.value.index), d(s = t,
|
|
2466
|
-
},
|
|
2465
|
+
M(t, t.s.value.index), d(s = t, Qt, ts).call(s), t.classList.add("d4-initialize");
|
|
2466
|
+
}, Qt = new WeakSet(), ts = function() {
|
|
2467
2467
|
const t = this;
|
|
2468
2468
|
t.__events__.dropdownToggle = () => {
|
|
2469
2469
|
t.addEventListener("click", function(e) {
|
|
@@ -2538,7 +2538,7 @@ Yt = new WeakSet(), Qi = function() {
|
|
|
2538
2538
|
case "single":
|
|
2539
2539
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
|
2540
2540
|
const v = e.s.cityLang, w = l.textContent.trim(), b = document.getElementById(e.getAttribute("dist-select"));
|
|
2541
|
-
b && (b.s.dropdownEl.querySelector(".dropdown-list").textContent = "", M(b, -1),
|
|
2541
|
+
b && (b.s.dropdownEl.querySelector(".dropdown-list").textContent = "", M(b, -1), V[v][w].forEach((T, C) => {
|
|
2542
2542
|
const y = document.createElement("li");
|
|
2543
2543
|
y.textContent = T[0], y.setAttribute("data-option", T[0]), e.getAttribute("d4-portal") == "true" ? b.s.dropdownEl.querySelector(".dropdown-list").append(y) : b.querySelector(".dropdown-list").append(y);
|
|
2544
2544
|
}), e.__events__.selectOption(b));
|
|
@@ -2581,7 +2581,7 @@ Yt = new WeakSet(), Qi = function() {
|
|
|
2581
2581
|
};
|
|
2582
2582
|
Object.assign(Zi.prototype, z);
|
|
2583
2583
|
customElements.define("dropdown-el", Zi);
|
|
2584
|
-
function
|
|
2584
|
+
function Et(n) {
|
|
2585
2585
|
const i = {};
|
|
2586
2586
|
return [...n.attributes].forEach((t) => {
|
|
2587
2587
|
if (t.name.includes("duration-")) {
|
|
@@ -2591,9 +2591,9 @@ function Tt(n) {
|
|
|
2591
2591
|
}), Object.keys(i).length === 0 ? null : i;
|
|
2592
2592
|
}
|
|
2593
2593
|
function li(n) {
|
|
2594
|
-
if (
|
|
2594
|
+
if (Et(n)) {
|
|
2595
2595
|
let i;
|
|
2596
|
-
const t = Object.keys(
|
|
2596
|
+
const t = Object.keys(Et(n)).map((e) => ({
|
|
2597
2597
|
value: e,
|
|
2598
2598
|
point: e
|
|
2599
2599
|
}));
|
|
@@ -2602,7 +2602,7 @@ function li(n) {
|
|
|
2602
2602
|
const { point: s, value: o } = t[e];
|
|
2603
2603
|
window.matchMedia(`(max-width: ${o}px)`).matches && (i = s);
|
|
2604
2604
|
}
|
|
2605
|
-
return i ? Number(
|
|
2605
|
+
return i ? Number(Et(n)[i]) : n.s.options.duration;
|
|
2606
2606
|
} else
|
|
2607
2607
|
return n.s.options.duration;
|
|
2608
2608
|
}
|
|
@@ -2679,14 +2679,14 @@ function hn(n) {
|
|
|
2679
2679
|
i && clearTimeout(i), i = setTimeout(n, 200, t);
|
|
2680
2680
|
};
|
|
2681
2681
|
}
|
|
2682
|
-
var
|
|
2682
|
+
var Kt, es, Vt, is, te, ss, ee, ns;
|
|
2683
2683
|
class mn extends HTMLElement {
|
|
2684
2684
|
constructor() {
|
|
2685
2685
|
super();
|
|
2686
|
-
p(this, Qt);
|
|
2687
2686
|
p(this, Kt);
|
|
2688
2687
|
p(this, Vt);
|
|
2689
2688
|
p(this, te);
|
|
2689
|
+
p(this, ee);
|
|
2690
2690
|
this.initialize = !1;
|
|
2691
2691
|
}
|
|
2692
2692
|
static get observedAttributes() {
|
|
@@ -2695,7 +2695,7 @@ class mn extends HTMLElement {
|
|
|
2695
2695
|
attributeChangedCallback(t, e, s) {
|
|
2696
2696
|
}
|
|
2697
2697
|
connectedCallback() {
|
|
2698
|
-
this.initialize || (this.initialize = !0, d(this,
|
|
2698
|
+
this.initialize || (this.initialize = !0, d(this, Kt, es).call(this));
|
|
2699
2699
|
}
|
|
2700
2700
|
play() {
|
|
2701
2701
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
|
@@ -2704,7 +2704,7 @@ class mn extends HTMLElement {
|
|
|
2704
2704
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
|
2705
2705
|
}
|
|
2706
2706
|
}
|
|
2707
|
-
|
|
2707
|
+
Kt = new WeakSet(), es = function() {
|
|
2708
2708
|
const t = {
|
|
2709
2709
|
direction: this.getAttribute("direction") || I.SETTINGS.direction,
|
|
2710
2710
|
// up / down / left / right
|
|
@@ -2712,7 +2712,7 @@ Qt = new WeakSet(), es = function() {
|
|
|
2712
2712
|
// normal / alternate / endStop
|
|
2713
2713
|
duration: Number(this.getAttribute("duration")) || I.SETTINGS.duration,
|
|
2714
2714
|
// ms
|
|
2715
|
-
durationBreakpoints:
|
|
2715
|
+
durationBreakpoints: Et(this) || I.SETTINGS.durationBreakpoints,
|
|
2716
2716
|
autoplay: this.getAttribute("autoplay") || I.SETTINGS.autoplay,
|
|
2717
2717
|
// normal / alternate / endStop
|
|
2718
2718
|
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : I.SETTINGS.pauseOnMouseenter,
|
|
@@ -2721,8 +2721,8 @@ Qt = new WeakSet(), es = function() {
|
|
|
2721
2721
|
// true / false
|
|
2722
2722
|
gap: Number(this.getAttribute("gap")) || I.SETTINGS.gap
|
|
2723
2723
|
};
|
|
2724
|
-
this.s = {}, this.s.options = t, this.s.nowDuration = li(this), pn(this), d(this,
|
|
2725
|
-
},
|
|
2724
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = li(this), pn(this), d(this, Vt, is).call(this);
|
|
2725
|
+
}, Vt = new WeakSet(), is = function() {
|
|
2726
2726
|
const { direction: t, continual: e, gap: s } = this.s.options;
|
|
2727
2727
|
switch (t) {
|
|
2728
2728
|
case "left":
|
|
@@ -2734,8 +2734,8 @@ Qt = new WeakSet(), es = function() {
|
|
|
2734
2734
|
e ? this.style.cssText = `height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${s}px;` : this.style.cssText = `min-height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${s}px;`;
|
|
2735
2735
|
break;
|
|
2736
2736
|
}
|
|
2737
|
-
d(this,
|
|
2738
|
-
},
|
|
2737
|
+
d(this, te, ss).call(this), d(this, ee, ns).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
|
|
2738
|
+
}, te = new WeakSet(), ss = function() {
|
|
2739
2739
|
const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
|
|
2740
2740
|
let c;
|
|
2741
2741
|
function u() {
|
|
@@ -2800,7 +2800,7 @@ Qt = new WeakSet(), es = function() {
|
|
|
2800
2800
|
}), t.addEventListener("mouseleave", function() {
|
|
2801
2801
|
t.s.animation && r && t.s.animation.playState === "paused" && t.play();
|
|
2802
2802
|
});
|
|
2803
|
-
},
|
|
2803
|
+
}, ee = new WeakSet(), ns = function() {
|
|
2804
2804
|
const t = this;
|
|
2805
2805
|
function e() {
|
|
2806
2806
|
const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
|
@@ -2838,22 +2838,22 @@ const ci = function(n, i) {
|
|
|
2838
2838
|
}
|
|
2839
2839
|
n.classList.remove(i);
|
|
2840
2840
|
};
|
|
2841
|
-
var
|
|
2841
|
+
var ie, os, se, as, ne, rs, lt, Xe, Y, At, oe, ls;
|
|
2842
2842
|
class di {
|
|
2843
2843
|
constructor(i) {
|
|
2844
2844
|
// 初始化
|
|
2845
|
-
p(this, ee);
|
|
2846
|
-
// 左右箭頭事件綁定
|
|
2847
2845
|
p(this, ie);
|
|
2848
|
-
//
|
|
2846
|
+
// 左右箭頭事件綁定
|
|
2849
2847
|
p(this, se);
|
|
2848
|
+
// 左右拖拉事件綁定
|
|
2849
|
+
p(this, ne);
|
|
2850
2850
|
// 卷軸位置判斷
|
|
2851
2851
|
p(this, lt);
|
|
2852
2852
|
// 隱藏按鈕判斷
|
|
2853
|
-
p(this,
|
|
2853
|
+
p(this, Y);
|
|
2854
2854
|
// 選項事件綁定
|
|
2855
|
-
p(this,
|
|
2856
|
-
this.$element = i, this.option = i.s.option.drag, this._didInitialScroll = !1, d(this,
|
|
2855
|
+
p(this, oe);
|
|
2856
|
+
this.$element = i, this.option = i.s.option.drag, this._didInitialScroll = !1, d(this, ie, os).call(this);
|
|
2857
2857
|
}
|
|
2858
2858
|
// 更新 active 位置
|
|
2859
2859
|
update(i = !1) {
|
|
@@ -2874,7 +2874,7 @@ class di {
|
|
|
2874
2874
|
s();
|
|
2875
2875
|
}
|
|
2876
2876
|
}
|
|
2877
|
-
|
|
2877
|
+
ie = new WeakSet(), os = function() {
|
|
2878
2878
|
var s, o, a, r;
|
|
2879
2879
|
const i = this;
|
|
2880
2880
|
if (!i.$element)
|
|
@@ -2883,10 +2883,10 @@ ee = new WeakSet(), os = function() {
|
|
|
2883
2883
|
let t = !1;
|
|
2884
2884
|
const e = () => {
|
|
2885
2885
|
t || (requestAnimationFrame(() => {
|
|
2886
|
-
d(this, lt, Xe).call(this), d(this,
|
|
2886
|
+
d(this, lt, Xe).call(this), d(this, Y, At).call(this), t = !1;
|
|
2887
2887
|
}), t = !0);
|
|
2888
2888
|
};
|
|
2889
|
-
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,
|
|
2889
|
+
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, ne, rs).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
|
2890
2890
|
S.prepend,
|
|
2891
2891
|
`<div class="navigation">
|
|
2892
2892
|
<div class="button prev">
|
|
@@ -2896,10 +2896,10 @@ ee = new WeakSet(), os = function() {
|
|
|
2896
2896
|
<div></div>
|
|
2897
2897
|
</div>
|
|
2898
2898
|
</div>`
|
|
2899
|
-
), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i,
|
|
2900
|
-
d(this, lt, Xe).call(this), d(this,
|
|
2899
|
+
), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i, se, as).call(a)), d(r = i, oe, ls).call(r), i.update(!0), requestAnimationFrame(() => {
|
|
2900
|
+
d(this, lt, Xe).call(this), d(this, Y, At).call(this);
|
|
2901
2901
|
});
|
|
2902
|
-
},
|
|
2902
|
+
}, se = new WeakSet(), as = function() {
|
|
2903
2903
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
|
2904
2904
|
const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
|
|
2905
2905
|
t.scrollTo({
|
|
@@ -2907,13 +2907,13 @@ ee = new WeakSet(), os = function() {
|
|
|
2907
2907
|
behavior: "smooth"
|
|
2908
2908
|
}), setTimeout(() => {
|
|
2909
2909
|
var r;
|
|
2910
|
-
d(r = i,
|
|
2910
|
+
d(r = i, Y, At).call(r);
|
|
2911
2911
|
}, 100);
|
|
2912
2912
|
};
|
|
2913
2913
|
e.forEach((o) => {
|
|
2914
2914
|
o.removeEventListener("click", s), o.addEventListener("click", s);
|
|
2915
2915
|
});
|
|
2916
|
-
},
|
|
2916
|
+
}, ne = new WeakSet(), rs = function() {
|
|
2917
2917
|
const { $wrapper: i } = this;
|
|
2918
2918
|
let t = !1, e = !1, s = 0, o = 0;
|
|
2919
2919
|
const a = function(h) {
|
|
@@ -2946,7 +2946,7 @@ ee = new WeakSet(), os = function() {
|
|
|
2946
2946
|
}, lt = new WeakSet(), Xe = function() {
|
|
2947
2947
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
|
|
2948
2948
|
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")));
|
|
2949
|
-
},
|
|
2949
|
+
}, Y = new WeakSet(), At = function() {
|
|
2950
2950
|
const { $wrapper: i, $button: t, $element: e } = this;
|
|
2951
2951
|
if (!t)
|
|
2952
2952
|
return;
|
|
@@ -2968,7 +2968,7 @@ ee = new WeakSet(), os = function() {
|
|
|
2968
2968
|
}
|
|
2969
2969
|
$(a, "hide");
|
|
2970
2970
|
}) : $(t, "hide");
|
|
2971
|
-
},
|
|
2971
|
+
}, oe = new WeakSet(), ls = function() {
|
|
2972
2972
|
const { $element: i } = this, t = (s) => {
|
|
2973
2973
|
if (this.option.selected) {
|
|
2974
2974
|
const o = s.getAttribute("data-option").trim();
|
|
@@ -2982,31 +2982,31 @@ ee = new WeakSet(), os = function() {
|
|
|
2982
2982
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
|
2983
2983
|
});
|
|
2984
2984
|
};
|
|
2985
|
-
var
|
|
2985
|
+
var ae, cs, re, ds, le, us, ce, ps;
|
|
2986
2986
|
class gn {
|
|
2987
2987
|
constructor(i) {
|
|
2988
2988
|
// 初始化
|
|
2989
|
-
p(this, oe);
|
|
2990
|
-
// 隱藏按鈕判斷
|
|
2991
2989
|
p(this, ae);
|
|
2992
|
-
//
|
|
2990
|
+
// 隱藏按鈕判斷
|
|
2993
2991
|
p(this, re);
|
|
2994
|
-
//
|
|
2992
|
+
// 展開箭頭事件綁定
|
|
2995
2993
|
p(this, le);
|
|
2996
|
-
|
|
2994
|
+
// 選項事件綁定
|
|
2995
|
+
p(this, ce);
|
|
2996
|
+
this.$element = i, this.option = i.s.option.collapse, d(this, ae, cs).call(this);
|
|
2997
2997
|
}
|
|
2998
2998
|
}
|
|
2999
|
-
|
|
3000
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this,
|
|
3001
|
-
},
|
|
2999
|
+
ae = new WeakSet(), cs = function() {
|
|
3000
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, re, ds).call(this) && d(this, le, us).call(this), d(this, ce, ps).call(this));
|
|
3001
|
+
}, re = new WeakSet(), ds = function() {
|
|
3002
3002
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
|
3003
3003
|
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);
|
|
3004
|
-
},
|
|
3004
|
+
}, le = new WeakSet(), us = function() {
|
|
3005
3005
|
const { $element: i, $button: t } = this, e = function() {
|
|
3006
3006
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
|
3007
3007
|
};
|
|
3008
3008
|
t.removeEventListener("click", e), t.addEventListener("click", e);
|
|
3009
|
-
},
|
|
3009
|
+
}, ce = new WeakSet(), ps = function() {
|
|
3010
3010
|
const { $element: i } = this, t = (s, o) => {
|
|
3011
3011
|
if (i != null && i.classList.contains("expand") ? i == null || i.classList.remove("expand") : i == null || i.classList.add("expand"), this.option.selected) {
|
|
3012
3012
|
const a = s.getAttribute("data-option").trim();
|
|
@@ -3024,22 +3024,22 @@ const fn = (n) => {
|
|
|
3024
3024
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
|
3025
3025
|
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;
|
|
3026
3026
|
};
|
|
3027
|
-
var
|
|
3027
|
+
var de, hs, ue, ms, ct, Ue, dt, Ye, pe, gs, ut, Fe, F, St;
|
|
3028
3028
|
class vn extends HTMLElement {
|
|
3029
3029
|
constructor() {
|
|
3030
3030
|
super();
|
|
3031
|
-
p(this, ce);
|
|
3032
3031
|
p(this, de);
|
|
3032
|
+
p(this, ue);
|
|
3033
3033
|
// 斷點設定
|
|
3034
3034
|
p(this, ct);
|
|
3035
3035
|
// 同步目前選中的項目
|
|
3036
3036
|
p(this, dt);
|
|
3037
3037
|
// 下拉選項事件綁定
|
|
3038
|
-
p(this,
|
|
3038
|
+
p(this, pe);
|
|
3039
3039
|
// 關閉展開中的 collapse
|
|
3040
3040
|
p(this, ut);
|
|
3041
3041
|
// check type
|
|
3042
|
-
p(this,
|
|
3042
|
+
p(this, F);
|
|
3043
3043
|
this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
|
3044
3044
|
}
|
|
3045
3045
|
static get observedAttributes() {
|
|
@@ -3050,7 +3050,7 @@ class vn extends HTMLElement {
|
|
|
3050
3050
|
case "m4-type":
|
|
3051
3051
|
if (e === null || e === s)
|
|
3052
3052
|
return;
|
|
3053
|
-
this.s.type = s, d(this,
|
|
3053
|
+
this.s.type = s, d(this, F, St).call(this);
|
|
3054
3054
|
break;
|
|
3055
3055
|
case "m4-status":
|
|
3056
3056
|
if (e === s)
|
|
@@ -3060,13 +3060,13 @@ class vn extends HTMLElement {
|
|
|
3060
3060
|
}
|
|
3061
3061
|
}
|
|
3062
3062
|
connectedCallback() {
|
|
3063
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this,
|
|
3063
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, de, hs).call(this));
|
|
3064
3064
|
}
|
|
3065
3065
|
update() {
|
|
3066
3066
|
d(this, ut, Fe).call(this), d(this, ct, Ue).call(this);
|
|
3067
3067
|
}
|
|
3068
3068
|
}
|
|
3069
|
-
|
|
3069
|
+
de = new WeakSet(), hs = function() {
|
|
3070
3070
|
let t = {};
|
|
3071
3071
|
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? q.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
|
3072
3072
|
const e = (s) => {
|
|
@@ -3077,18 +3077,18 @@ ce = new WeakSet(), hs = function() {
|
|
|
3077
3077
|
}
|
|
3078
3078
|
this.update();
|
|
3079
3079
|
};
|
|
3080
|
-
window.removeEventListener("resize", ci(e)), window.addEventListener("resize", ci(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,
|
|
3081
|
-
},
|
|
3080
|
+
window.removeEventListener("resize", ci(e)), window.addEventListener("resize", ci(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, ue, ms).call(this);
|
|
3081
|
+
}, ue = new WeakSet(), ms = function() {
|
|
3082
3082
|
this.classList.add("m4-init"), d(this, ct, Ue).call(this);
|
|
3083
3083
|
}, ct = new WeakSet(), Ue = function() {
|
|
3084
3084
|
const t = Object.keys(this.s.option.breakpoint);
|
|
3085
3085
|
if (!t.length) {
|
|
3086
|
-
d(this,
|
|
3086
|
+
d(this, F, St).call(this);
|
|
3087
3087
|
return;
|
|
3088
3088
|
}
|
|
3089
3089
|
t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
|
|
3090
3090
|
var s, o, a, r;
|
|
3091
|
-
return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this,
|
|
3091
|
+
return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this, F, St).call(this), window.innerWidth >= e;
|
|
3092
3092
|
});
|
|
3093
3093
|
}, dt = new WeakSet(), Ye = function(t = this.getAttribute("m4-status")) {
|
|
3094
3094
|
var a;
|
|
@@ -3102,7 +3102,7 @@ ce = new WeakSet(), hs = function() {
|
|
|
3102
3102
|
s(".drag-container .item"), s(".collapse-container .item");
|
|
3103
3103
|
const o = this.querySelector("dropdown-el");
|
|
3104
3104
|
o && o.getAttribute("d4-value") !== e && o.setAttribute("d4-value", e), (a = this.drag) == null || a.update();
|
|
3105
|
-
},
|
|
3105
|
+
}, pe = new WeakSet(), gs = function() {
|
|
3106
3106
|
var e;
|
|
3107
3107
|
const t = this.querySelector("dropdown-el");
|
|
3108
3108
|
!t || typeof t.on != "function" || (this.__events__.dropdownChange = () => {
|
|
@@ -3112,7 +3112,7 @@ ce = new WeakSet(), hs = function() {
|
|
|
3112
3112
|
}, (e = t.off) == null || e.call(t, "change", this.__events__.dropdownChange), t.on("change", this.__events__.dropdownChange));
|
|
3113
3113
|
}, ut = new WeakSet(), Fe = function() {
|
|
3114
3114
|
this.classList.remove("expand");
|
|
3115
|
-
},
|
|
3115
|
+
}, F = new WeakSet(), St = function() {
|
|
3116
3116
|
const { type: t } = this.s;
|
|
3117
3117
|
switch (d(this, ut, Fe).call(this), this.innerHTML = "", [...fn(this)].forEach((e) => {
|
|
3118
3118
|
this.append(e);
|
|
@@ -3124,59 +3124,59 @@ ce = new WeakSet(), hs = function() {
|
|
|
3124
3124
|
this.drag = new di(this), this.collapse = new gn(this);
|
|
3125
3125
|
break;
|
|
3126
3126
|
case "dropdown":
|
|
3127
|
-
d(this,
|
|
3127
|
+
d(this, pe, gs).call(this);
|
|
3128
3128
|
break;
|
|
3129
3129
|
}
|
|
3130
3130
|
d(this, dt, Ye).call(this);
|
|
3131
3131
|
};
|
|
3132
3132
|
customElements.define("multipurpose-nav", vn);
|
|
3133
|
-
var
|
|
3133
|
+
var he, vs, me, bs, pt, Je, W, Q, ge, ys, fe, ws, ve, Ts, be, Es, ye, As, we, Ss, Te, Ls, Ee, _s, Ae, Ds, N, R, Se, ks, Le, xs, _e, $s, De, Cs;
|
|
3134
3134
|
class fs extends HTMLElement {
|
|
3135
3135
|
// 定義組件的初始狀態
|
|
3136
3136
|
constructor(t, e) {
|
|
3137
3137
|
super();
|
|
3138
|
-
p(this, pe);
|
|
3139
3138
|
p(this, he);
|
|
3139
|
+
p(this, me);
|
|
3140
3140
|
// 第一關 判斷數量以及id設定
|
|
3141
3141
|
p(this, pt);
|
|
3142
3142
|
// 第二關 id命名提醒
|
|
3143
3143
|
p(this, W);
|
|
3144
|
-
p(this, me);
|
|
3145
3144
|
p(this, ge);
|
|
3146
3145
|
p(this, fe);
|
|
3146
|
+
p(this, ve);
|
|
3147
3147
|
// 執行函式
|
|
3148
3148
|
// 移動至指定位置
|
|
3149
|
-
p(this, ve);
|
|
3150
|
-
// 移動
|
|
3151
3149
|
p(this, be);
|
|
3152
|
-
//
|
|
3150
|
+
// 移動
|
|
3153
3151
|
p(this, ye);
|
|
3154
|
-
//
|
|
3152
|
+
// 步驟狀態
|
|
3155
3153
|
p(this, we);
|
|
3156
|
-
//
|
|
3154
|
+
// next 按鈕狀態
|
|
3157
3155
|
p(this, Te);
|
|
3158
|
-
//
|
|
3156
|
+
// prev 按鈕狀態
|
|
3159
3157
|
p(this, Ee);
|
|
3158
|
+
// 頁籤狀態
|
|
3159
|
+
p(this, Ae);
|
|
3160
3160
|
// 第三關各種元件判斷 及 執行
|
|
3161
3161
|
p(this, N);
|
|
3162
3162
|
// 消失動畫
|
|
3163
|
-
p(this, Ae);
|
|
3164
|
-
// 出現動畫
|
|
3165
3163
|
p(this, Se);
|
|
3166
|
-
//
|
|
3164
|
+
// 出現動畫
|
|
3167
3165
|
p(this, Le);
|
|
3168
|
-
//
|
|
3166
|
+
// 狀態
|
|
3169
3167
|
p(this, _e);
|
|
3168
|
+
// resize
|
|
3169
|
+
p(this, De);
|
|
3170
3170
|
}
|
|
3171
3171
|
// 當組件的屬性被更改時會被呼叫
|
|
3172
3172
|
static get observedAttributes() {
|
|
3173
3173
|
return ["t4-active"];
|
|
3174
3174
|
}
|
|
3175
3175
|
attributeChangedCallback(t, e, s) {
|
|
3176
|
-
t === "t4-active" && e !== s && d(this,
|
|
3176
|
+
t === "t4-active" && e !== s && d(this, _e, $s).call(this, s);
|
|
3177
3177
|
}
|
|
3178
3178
|
connectedCallback() {
|
|
3179
|
-
this.classList.contains("t4-initialize") || d(this,
|
|
3179
|
+
this.classList.contains("t4-initialize") || d(this, he, vs).call(this);
|
|
3180
3180
|
}
|
|
3181
3181
|
// ------------- 我是分隔線呦 -------------
|
|
3182
3182
|
// 頁籤切換
|
|
@@ -3190,19 +3190,19 @@ class fs extends HTMLElement {
|
|
|
3190
3190
|
setActiveTab(t) {
|
|
3191
3191
|
const { t: e } = this, s = t === "" ? e.tabPanels[0].getAttribute("t4-id") : t;
|
|
3192
3192
|
e.activeTab = s, this.setAttribute("t4-active", s);
|
|
3193
|
-
const o = d(this, W,
|
|
3193
|
+
const o = d(this, W, Q).call(this, s);
|
|
3194
3194
|
e.tabPanels.forEach((a, r) => {
|
|
3195
|
-
r === o ? d(this,
|
|
3195
|
+
r === o ? d(this, Le, xs).call(this, r) : d(this, Se, ks).call(this, r);
|
|
3196
3196
|
});
|
|
3197
3197
|
}
|
|
3198
3198
|
// 外部呼叫方法 $0.goNext()
|
|
3199
3199
|
goNext() {
|
|
3200
|
-
const t = d(this, W,
|
|
3200
|
+
const t = d(this, W, Q).call(this, this.t.activeTab), e = Math.min(this.t.tabPanels.length - 1, t + 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
|
3201
3201
|
this.setActiveTab(s);
|
|
3202
3202
|
}
|
|
3203
3203
|
// 外部呼叫方法 $0.goPrev()
|
|
3204
3204
|
goPrev() {
|
|
3205
|
-
const t = d(this, W,
|
|
3205
|
+
const t = d(this, W, Q).call(this, this.t.activeTab), e = Math.max(0, t - 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
|
3206
3206
|
this.setActiveTab(s);
|
|
3207
3207
|
}
|
|
3208
3208
|
// 外部呼叫方法 $0.update()
|
|
@@ -3210,7 +3210,7 @@ class fs extends HTMLElement {
|
|
|
3210
3210
|
this.t.tabs = d(this, pt, Je).call(this), Hs(), console.log("tab update!!!!");
|
|
3211
3211
|
}
|
|
3212
3212
|
}
|
|
3213
|
-
|
|
3213
|
+
he = new WeakSet(), vs = function() {
|
|
3214
3214
|
const t = this.getAttribute("t4-name"), { SETTINGS: e } = gi;
|
|
3215
3215
|
document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
|
|
3216
3216
|
tabs: [],
|
|
@@ -3230,36 +3230,36 @@ pe = new WeakSet(), vs = function() {
|
|
|
3230
3230
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
|
3231
3231
|
},
|
|
3232
3232
|
tabGroup: this.getAttribute("t4-group") || e.tabGroup
|
|
3233
|
-
}, this.__events__ = {}, this.t.tabs = d(this, pt, Je).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this,
|
|
3234
|
-
},
|
|
3235
|
-
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this,
|
|
3233
|
+
}, this.__events__ = {}, this.t.tabs = d(this, pt, Je).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, me, bs).call(this);
|
|
3234
|
+
}, me = new WeakSet(), bs = function() {
|
|
3235
|
+
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, ge, ys).call(this), this.t.recordUrl) {
|
|
3236
3236
|
const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
|
|
3237
3237
|
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
|
3238
3238
|
}
|
|
3239
|
-
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this,
|
|
3239
|
+
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, De, Cs).call(this);
|
|
3240
3240
|
}, pt = new WeakSet(), Je = function() {
|
|
3241
3241
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
|
3242
3242
|
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) => {
|
|
3243
3243
|
s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
|
|
3244
3244
|
}), e;
|
|
3245
|
-
}, W = new WeakSet(),
|
|
3245
|
+
}, W = new WeakSet(), Q = function(t) {
|
|
3246
3246
|
const { t: e } = this, s = e.tabPanels.filter((a) => a.getAttribute("t4-id") === t);
|
|
3247
3247
|
s.length > 1 && console.warn("有兩個相同id設定", s);
|
|
3248
3248
|
const o = s[0];
|
|
3249
3249
|
return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
|
|
3250
|
-
},
|
|
3250
|
+
}, ge = new WeakSet(), ys = function() {
|
|
3251
3251
|
const t = document.createElement("div");
|
|
3252
3252
|
t.classList.add("swiper-container");
|
|
3253
3253
|
const e = document.createElement("div");
|
|
3254
3254
|
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
|
|
3255
3255
|
e.appendChild(s.cloneNode(!0));
|
|
3256
|
-
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this,
|
|
3257
|
-
},
|
|
3256
|
+
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, fe, ws).call(this);
|
|
3257
|
+
}, fe = new WeakSet(), ws = function() {
|
|
3258
3258
|
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
|
|
3259
3259
|
t.style.overflow = "hidden", e.style.display = "flex";
|
|
3260
3260
|
const o = s.length * 100 + "%";
|
|
3261
3261
|
e.style.width = o;
|
|
3262
|
-
},
|
|
3262
|
+
}, ve = new WeakSet(), Ts = function(t) {
|
|
3263
3263
|
const { t: e } = this;
|
|
3264
3264
|
if (e.recordUrl === "true") {
|
|
3265
3265
|
const s = new URLSearchParams(document.location.search);
|
|
@@ -3267,28 +3267,28 @@ pe = new WeakSet(), vs = function() {
|
|
|
3267
3267
|
const o = `${window.location.pathname}?${s.toString()}`;
|
|
3268
3268
|
history.replaceState({ t4Id: t }, "", o);
|
|
3269
3269
|
}
|
|
3270
|
-
},
|
|
3270
|
+
}, be = new WeakSet(), Es = function() {
|
|
3271
3271
|
const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
|
|
3272
|
-
d(this,
|
|
3273
|
-
},
|
|
3272
|
+
d(this, ye, As).call(this, o);
|
|
3273
|
+
}, ye = new WeakSet(), As = function(t) {
|
|
3274
3274
|
window.scrollTo({
|
|
3275
3275
|
top: t,
|
|
3276
3276
|
behavior: "smooth"
|
|
3277
3277
|
});
|
|
3278
|
-
},
|
|
3278
|
+
}, we = new WeakSet(), Ss = function(t) {
|
|
3279
3279
|
let e = parseInt(t, 10) + 1;
|
|
3280
3280
|
this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
|
|
3281
|
-
},
|
|
3281
|
+
}, Te = new WeakSet(), Ls = function(t) {
|
|
3282
3282
|
const e = document.querySelectorAll(`[t4-role="next"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === this.t.tabPanels.length - 1;
|
|
3283
3283
|
e.forEach((a) => {
|
|
3284
3284
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
|
3285
3285
|
});
|
|
3286
|
-
},
|
|
3286
|
+
}, Ee = new WeakSet(), _s = function(t) {
|
|
3287
3287
|
const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === 0;
|
|
3288
3288
|
e.forEach((a) => {
|
|
3289
3289
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
|
3290
3290
|
});
|
|
3291
|
-
},
|
|
3291
|
+
}, Ae = new WeakSet(), Ds = function(t, e) {
|
|
3292
3292
|
this.t.tabGroup === "true" ? this.t.tabs.forEach((s, o) => {
|
|
3293
3293
|
o == t ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
|
|
3294
3294
|
}) : this.t.tabs.forEach((s, o) => {
|
|
@@ -3297,25 +3297,25 @@ pe = new WeakSet(), vs = function() {
|
|
|
3297
3297
|
}, N = new WeakSet(), R = function(t, e, s) {
|
|
3298
3298
|
switch (t) {
|
|
3299
3299
|
case "step":
|
|
3300
|
-
|
|
3300
|
+
Me(this.t.step) && d(this, we, Ss).call(this, e);
|
|
3301
3301
|
break;
|
|
3302
3302
|
case "eventAnchor":
|
|
3303
|
-
this.t.anchor && d(this,
|
|
3303
|
+
this.t.anchor && d(this, be, Es).call(this);
|
|
3304
3304
|
break;
|
|
3305
3305
|
case "tabState":
|
|
3306
|
-
this.t.type == "normal" && d(this,
|
|
3306
|
+
this.t.type == "normal" && d(this, Ae, Ds).call(this, e, s);
|
|
3307
3307
|
break;
|
|
3308
3308
|
case "btnState":
|
|
3309
|
-
d(this,
|
|
3309
|
+
d(this, Te, Ls).call(this, e), d(this, Ee, _s).call(this, e);
|
|
3310
3310
|
break;
|
|
3311
3311
|
case "tabUrl":
|
|
3312
|
-
this.t.recordUrl === "true" && d(this,
|
|
3312
|
+
this.t.recordUrl === "true" && d(this, ve, Ts).call(this, e);
|
|
3313
3313
|
break;
|
|
3314
3314
|
default:
|
|
3315
3315
|
console.warn("請增加判斷,謝謝");
|
|
3316
3316
|
break;
|
|
3317
3317
|
}
|
|
3318
|
-
},
|
|
3318
|
+
}, Se = new WeakSet(), ks = function(t) {
|
|
3319
3319
|
const { t: e } = this;
|
|
3320
3320
|
this.t.transition;
|
|
3321
3321
|
const s = e.tabPanels[t];
|
|
@@ -3332,7 +3332,7 @@ pe = new WeakSet(), vs = function() {
|
|
|
3332
3332
|
s.style.display = "none";
|
|
3333
3333
|
break;
|
|
3334
3334
|
}
|
|
3335
|
-
},
|
|
3335
|
+
}, Le = new WeakSet(), xs = function(t) {
|
|
3336
3336
|
const { duration: e, timing: s, delay: o } = this.t.transition, a = this.t.tabPanels[t];
|
|
3337
3337
|
let r;
|
|
3338
3338
|
switch (a.classList.add("show"), a.classList.remove("hide"), a.style.transition = `opacity ${e}ms ${s} ${o}ms`, a.style.display = "block", this.t.display) {
|
|
@@ -3357,10 +3357,10 @@ pe = new WeakSet(), vs = function() {
|
|
|
3357
3357
|
console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
|
|
3358
3358
|
break;
|
|
3359
3359
|
}
|
|
3360
|
-
},
|
|
3361
|
-
const e = d(this, W,
|
|
3360
|
+
}, _e = new WeakSet(), $s = function(t) {
|
|
3361
|
+
const e = d(this, W, Q).call(this, t);
|
|
3362
3362
|
d(this, N, R).call(this, "step", e), d(this, N, R).call(this, "btnState", e), d(this, N, R).call(this, "tabState", e, t), d(this, N, R).call(this, "tabUrl", t), this.emit("change");
|
|
3363
|
-
},
|
|
3363
|
+
}, De = new WeakSet(), Cs = function() {
|
|
3364
3364
|
const t = this;
|
|
3365
3365
|
window.addEventListener(
|
|
3366
3366
|
"resize",
|
|
@@ -3415,14 +3415,14 @@ const ui = (n) => {
|
|
|
3415
3415
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
|
|
3416
3416
|
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";
|
|
3417
3417
|
};
|
|
3418
|
-
var ht, Ze,
|
|
3418
|
+
var ht, Ze, ke, Is, xe, Ms, mt, Qe;
|
|
3419
3419
|
class wn {
|
|
3420
3420
|
constructor(i, t = {}) {
|
|
3421
3421
|
p(this, ht);
|
|
3422
|
-
p(this, De);
|
|
3423
3422
|
p(this, ke);
|
|
3423
|
+
p(this, xe);
|
|
3424
3424
|
p(this, mt);
|
|
3425
|
-
!ft(i) && !
|
|
3425
|
+
!ft(i) && !Me(i) && !vt(i) && !A(i) || (this.__storage__ = {
|
|
3426
3426
|
el: i,
|
|
3427
3427
|
options: t
|
|
3428
3428
|
}, this.active = "data-collapse-active", d(this, ht, Ze).call(this));
|
|
@@ -3436,13 +3436,13 @@ ht = new WeakSet(), Ze = function() {
|
|
|
3436
3436
|
if (this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
3437
3437
|
for (const [o, a] of Object.entries(this.options.on))
|
|
3438
3438
|
this.__events__[o] = [a];
|
|
3439
|
-
d(this,
|
|
3440
|
-
},
|
|
3439
|
+
d(this, ke, Is).call(this);
|
|
3440
|
+
}, ke = new WeakSet(), Is = function() {
|
|
3441
3441
|
const { elements: i, options: t } = this;
|
|
3442
3442
|
i.forEach((e) => {
|
|
3443
|
-
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this,
|
|
3443
|
+
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this, xe, Ms).call(this, e);
|
|
3444
3444
|
}), this.emit("init");
|
|
3445
|
-
},
|
|
3445
|
+
}, xe = new WeakSet(), Ms = function(i) {
|
|
3446
3446
|
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
|
|
3447
3447
|
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, mt, Qe)), c.addEventListener("click", d(this, mt, Qe)), r) {
|
|
3448
3448
|
const h = (g) => {
|
|
@@ -3470,14 +3470,14 @@ function qs() {
|
|
|
3470
3470
|
});
|
|
3471
3471
|
}
|
|
3472
3472
|
document.addEventListener("click", qs);
|
|
3473
|
-
var gt, Ke,
|
|
3473
|
+
var gt, Ke, $e, Os, Ce, Ps, He, Ns;
|
|
3474
3474
|
class En extends HTMLElement {
|
|
3475
3475
|
constructor() {
|
|
3476
3476
|
super();
|
|
3477
3477
|
p(this, gt);
|
|
3478
|
-
p(this, xe);
|
|
3479
3478
|
p(this, $e);
|
|
3480
3479
|
p(this, Ce);
|
|
3480
|
+
p(this, He);
|
|
3481
3481
|
this.initialize = !1;
|
|
3482
3482
|
}
|
|
3483
3483
|
connectedCallback() {
|
|
@@ -3503,13 +3503,13 @@ gt = new WeakSet(), Ke = function() {
|
|
|
3503
3503
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
|
3504
3504
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
|
3505
3505
|
};
|
|
3506
|
-
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this,
|
|
3507
|
-
},
|
|
3508
|
-
d(this,
|
|
3509
|
-
},
|
|
3506
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, $e, Os).call(this);
|
|
3507
|
+
}, $e = new WeakSet(), Os = function() {
|
|
3508
|
+
d(this, Ce, Ps).call(this), d(this, He, Ns).call(this), this.classList.add("r4-initialize");
|
|
3509
|
+
}, Ce = new WeakSet(), Ps = function() {
|
|
3510
3510
|
const t = this, e = document.createElement("i");
|
|
3511
3511
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
|
3512
|
-
},
|
|
3512
|
+
}, He = new WeakSet(), Ns = function() {
|
|
3513
3513
|
const t = this.querySelector("i.hover-ball"), e = this;
|
|
3514
3514
|
e.addEventListener("click", function(a) {
|
|
3515
3515
|
a.stopPropagation(), e.s.options.click && Tn(a, e);
|
|
@@ -3717,7 +3717,7 @@ export {
|
|
|
3717
3717
|
Qn as J,
|
|
3718
3718
|
Kn as K,
|
|
3719
3719
|
Vn as L,
|
|
3720
|
-
|
|
3720
|
+
tt as M,
|
|
3721
3721
|
to as N,
|
|
3722
3722
|
eo as O,
|
|
3723
3723
|
io as P,
|
|
@@ -3734,7 +3734,7 @@ export {
|
|
|
3734
3734
|
vt as b,
|
|
3735
3735
|
Us as c,
|
|
3736
3736
|
Xs as d,
|
|
3737
|
-
|
|
3737
|
+
Ie as e,
|
|
3738
3738
|
S as f,
|
|
3739
3739
|
D as g,
|
|
3740
3740
|
jn as h,
|
|
@@ -3751,7 +3751,7 @@ export {
|
|
|
3751
3751
|
Rs as s,
|
|
3752
3752
|
Bn as t,
|
|
3753
3753
|
Wn as u,
|
|
3754
|
-
|
|
3754
|
+
je as v,
|
|
3755
3755
|
sn as w,
|
|
3756
3756
|
Gn as x,
|
|
3757
3757
|
Rn as y,
|