@xwadex/fesd 0.0.35 → 0.0.37
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 +422 -420
- package/dist/image-preview-bundle.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ var h = (n, i, t) => {
|
|
|
8
8
|
i instanceof WeakSet ? i.add(n) : i.set(n, t);
|
|
9
9
|
};
|
|
10
10
|
var d = (n, i, t) => (fs(n, i, "access private method"), t);
|
|
11
|
-
import { OverlayScrollbars as
|
|
11
|
+
import { OverlayScrollbars as qe } from "overlayscrollbars";
|
|
12
12
|
import v from "jquery";
|
|
13
13
|
import "./vendor-bundle.js";
|
|
14
14
|
import "validator";
|
|
@@ -108,7 +108,7 @@ const Y = {
|
|
|
108
108
|
gap: 30
|
|
109
109
|
// 跑馬燈內容之間的距離 - Number
|
|
110
110
|
}
|
|
111
|
-
},
|
|
111
|
+
}, Ie = {
|
|
112
112
|
SETTINGS: {
|
|
113
113
|
scrollbar: {
|
|
114
114
|
"scrollbar-track-color": "transparent",
|
|
@@ -167,7 +167,7 @@ const Y = {
|
|
|
167
167
|
enter: null,
|
|
168
168
|
leave: null
|
|
169
169
|
}
|
|
170
|
-
},
|
|
170
|
+
}, dt = {
|
|
171
171
|
SETTINGS: {
|
|
172
172
|
target: null,
|
|
173
173
|
container: null,
|
|
@@ -295,13 +295,13 @@ const Y = {
|
|
|
295
295
|
// hover 毫秒 ?
|
|
296
296
|
speed: 600
|
|
297
297
|
}
|
|
298
|
-
},
|
|
298
|
+
}, gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
299
299
|
__proto__: null,
|
|
300
|
-
anchor4:
|
|
300
|
+
anchor4: dt,
|
|
301
301
|
aost4: Ye,
|
|
302
302
|
article4: ws,
|
|
303
303
|
collapse4: Je,
|
|
304
|
-
dropdown4:
|
|
304
|
+
dropdown4: Ie,
|
|
305
305
|
marquee4: x,
|
|
306
306
|
modal4: I,
|
|
307
307
|
multipurpose4: H,
|
|
@@ -309,12 +309,12 @@ const Y = {
|
|
|
309
309
|
share4: ys,
|
|
310
310
|
tab4: Ue,
|
|
311
311
|
video4: Y
|
|
312
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
312
|
+
}, Symbol.toStringTag, { value: "Module" })), A = {
|
|
313
313
|
before: "beforebegin",
|
|
314
314
|
after: "afterend",
|
|
315
315
|
append: "beforeend",
|
|
316
316
|
prepend: "afterbegin"
|
|
317
|
-
},
|
|
317
|
+
}, rt = (n) => typeof n == "string" && n !== "", Te = (n) => n instanceof HTMLElement, lt = (n) => n instanceof NodeList, w = (n) => L(n) !== null, j = (n) => typeof n == "function", L = (n) => Te(n) ? n : document.querySelector(n), S = (n) => lt(n) ? n : document.querySelectorAll(n), Ts = () => Math.random().toString(36).substr(2, 9), Es = (n) => {
|
|
318
318
|
const i = document.createElement("div");
|
|
319
319
|
return i.innerHTML = n, i.childNodes;
|
|
320
320
|
}, As = (n) => {
|
|
@@ -324,7 +324,7 @@ const Y = {
|
|
|
324
324
|
return n;
|
|
325
325
|
}
|
|
326
326
|
return JSON.parse(n);
|
|
327
|
-
},
|
|
327
|
+
}, E = (n, i) => {
|
|
328
328
|
console.warn(`[${n} warn]: ${i}`);
|
|
329
329
|
}, je = (n, i) => {
|
|
330
330
|
console.error(`[${n} error]: ${i}`);
|
|
@@ -369,33 +369,33 @@ const Y = {
|
|
|
369
369
|
easeOutQuart(n, i, t, e) {
|
|
370
370
|
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
|
371
371
|
}
|
|
372
|
-
},
|
|
373
|
-
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 = w(e) ?
|
|
374
|
-
let
|
|
372
|
+
}, Ee = (n, i) => {
|
|
373
|
+
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 = w(e) ? L(e) : document.scrollingElement, f = m[u], b = w(t) ? L(t).getBoundingClientRect()[p] : 0 - f, y = w(s) ? L(s).getBoundingClientRect()[g] : 0, _ = b - a - y, G = 15;
|
|
374
|
+
let D = 0;
|
|
375
375
|
if (_ === 0)
|
|
376
376
|
return;
|
|
377
377
|
const R = (X) => {
|
|
378
|
-
const Pe =
|
|
378
|
+
const Pe = L(t);
|
|
379
379
|
i && i.emit(X, Pe), !i && n.on && j(n.on[X]) && n.on[X](Pe);
|
|
380
380
|
};
|
|
381
381
|
R("beforeScroll");
|
|
382
382
|
const Ne = () => {
|
|
383
|
-
|
|
384
|
-
const X = Ls[r](
|
|
385
|
-
m[u] = X,
|
|
383
|
+
D += G;
|
|
384
|
+
const X = Ls[r](D, f, _, o);
|
|
385
|
+
m[u] = X, D < o && requestAnimationFrame(Ne), D >= o && R("afterScroll");
|
|
386
386
|
};
|
|
387
387
|
requestAnimationFrame(Ne);
|
|
388
388
|
};
|
|
389
|
-
var
|
|
389
|
+
var Z, Ae, gt, Ve, ft, Ke;
|
|
390
390
|
class Qe {
|
|
391
391
|
constructor(i, t = {}) {
|
|
392
|
-
h(this,
|
|
393
|
-
h(this, mt);
|
|
392
|
+
h(this, Z);
|
|
394
393
|
h(this, gt);
|
|
394
|
+
h(this, ft);
|
|
395
395
|
this.__storage__ = {
|
|
396
396
|
el: i,
|
|
397
397
|
options: t
|
|
398
|
-
}, this.active = "data-anchor-active", d(this,
|
|
398
|
+
}, this.active = "data-anchor-active", d(this, Z, Ae).call(this);
|
|
399
399
|
}
|
|
400
400
|
destroy() {
|
|
401
401
|
const { elements: i } = this;
|
|
@@ -405,39 +405,39 @@ class Qe {
|
|
|
405
405
|
}
|
|
406
406
|
update() {
|
|
407
407
|
var i;
|
|
408
|
-
return d(i = this.destroy(),
|
|
408
|
+
return d(i = this.destroy(), Z, Ae).call(i), this.emit("afterUpdate"), this;
|
|
409
409
|
}
|
|
410
410
|
static run(i) {
|
|
411
|
-
const { SETTINGS: t } =
|
|
411
|
+
const { SETTINGS: t } = dt, e = Object.assign({}, t, i);
|
|
412
412
|
setTimeout(() => {
|
|
413
|
-
|
|
413
|
+
Ee(e);
|
|
414
414
|
}, e.delay);
|
|
415
415
|
}
|
|
416
416
|
static url(i) {
|
|
417
|
-
const { SETTINGS: t } =
|
|
417
|
+
const { SETTINGS: t } = dt, { hashName: e } = i, s = window.location.search || window.location.hash, { searchParams: o } = new URL(window.location), a = document.querySelector(`[data-anchor-id="${e ? o.get(e) : s.split("?").pop()}"]`);
|
|
418
418
|
if (!a)
|
|
419
419
|
return;
|
|
420
420
|
const r = Object.assign({}, t, i, { target: a });
|
|
421
421
|
setTimeout(() => {
|
|
422
|
-
|
|
422
|
+
Ee(r);
|
|
423
423
|
}, r.delay);
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
|
|
426
|
+
Z = new WeakSet(), Ae = function() {
|
|
427
427
|
const { el: i, options: t } = this.__storage__;
|
|
428
|
-
if (!
|
|
428
|
+
if (!rt(i) || !w(i))
|
|
429
429
|
return;
|
|
430
|
-
const { SETTINGS: e, EVENTS: s } =
|
|
431
|
-
if (this.elements = t.state == "not active" ?
|
|
430
|
+
const { SETTINGS: e, EVENTS: s } = dt;
|
|
431
|
+
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.elements = S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
432
432
|
for (const [o, a] of Object.entries(this.options.on))
|
|
433
433
|
this.__events__[o] = [a];
|
|
434
|
-
d(this,
|
|
435
|
-
},
|
|
434
|
+
d(this, gt, Ve).call(this);
|
|
435
|
+
}, gt = new WeakSet(), Ve = function() {
|
|
436
436
|
const { elements: i, options: t } = this;
|
|
437
437
|
i.forEach((e) => {
|
|
438
|
-
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this,
|
|
438
|
+
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, ft, Ke), 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, "");
|
|
439
439
|
}), this.emit("afterInit");
|
|
440
|
-
},
|
|
440
|
+
}, ft = new WeakSet(), Ke = function() {
|
|
441
441
|
const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor, s = {
|
|
442
442
|
target: this.getAttribute("data-anchor-target") || i.target,
|
|
443
443
|
container: this.getAttribute("data-anchor-container") || i.container,
|
|
@@ -451,7 +451,7 @@ J = new WeakSet(), Ee = function() {
|
|
|
451
451
|
this.removeEventListener("click", t), setTimeout(() => {
|
|
452
452
|
this.addEventListener("click", t);
|
|
453
453
|
}, s.speed), setTimeout(() => {
|
|
454
|
-
|
|
454
|
+
Ee(s, e);
|
|
455
455
|
}, s.delay);
|
|
456
456
|
};
|
|
457
457
|
Object.assign(Qe.prototype, O);
|
|
@@ -464,15 +464,15 @@ const { MODALS: M } = window, Ss = (n) => {
|
|
|
464
464
|
s.append(o);
|
|
465
465
|
}), e.children[0];
|
|
466
466
|
};
|
|
467
|
-
var
|
|
467
|
+
var vt, ei, bt, ii, yt, si, wt, ni, Tt, oi;
|
|
468
468
|
class ti extends HTMLElement {
|
|
469
469
|
constructor() {
|
|
470
470
|
super();
|
|
471
|
-
h(this, ft);
|
|
472
471
|
h(this, vt);
|
|
473
472
|
h(this, bt);
|
|
474
473
|
h(this, yt);
|
|
475
474
|
h(this, wt);
|
|
475
|
+
h(this, Tt);
|
|
476
476
|
this.initialize = !1;
|
|
477
477
|
}
|
|
478
478
|
static get observedAttributes() {
|
|
@@ -481,12 +481,12 @@ class ti extends HTMLElement {
|
|
|
481
481
|
attributeChangedCallback(t, e, s) {
|
|
482
482
|
switch (t) {
|
|
483
483
|
case ":state":
|
|
484
|
-
d(this,
|
|
484
|
+
d(this, Tt, oi).call(this, s);
|
|
485
485
|
break;
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
|
-
this.initialize || (this.initialize = !0, d(this,
|
|
489
|
+
this.initialize || (this.initialize = !0, d(this, vt, ei).call(this));
|
|
490
490
|
}
|
|
491
491
|
open() {
|
|
492
492
|
return this.setAttribute(":state", "open"), this;
|
|
@@ -498,22 +498,22 @@ class ti extends HTMLElement {
|
|
|
498
498
|
return this.setAttribute(":state", "destroy"), this;
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
|
|
501
|
+
vt = new WeakSet(), ei = function() {
|
|
502
502
|
const { ATTRS: t } = I;
|
|
503
503
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
|
504
504
|
const e = this.getAttribute(t.id) || Ts();
|
|
505
|
-
this.getAttribute(t.id) || (
|
|
506
|
-
},
|
|
507
|
-
this.childDom = this.childNodes, this.template = Ss(this), this.innerHTML = "", this.append(this.template), d(this,
|
|
508
|
-
},
|
|
505
|
+
this.getAttribute(t.id) || (E(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), M[e] && E(`the ${t.id} "${e}" is already be used.`), M[e] = this, d(this, bt, ii).call(this);
|
|
506
|
+
}, bt = new WeakSet(), ii = function() {
|
|
507
|
+
this.childDom = this.childNodes, this.template = Ss(this), this.innerHTML = "", this.append(this.template), d(this, yt, si).call(this);
|
|
508
|
+
}, yt = new WeakSet(), si = function() {
|
|
509
509
|
const t = this.querySelector(".modal-scroller");
|
|
510
|
-
this.__scroller__ =
|
|
510
|
+
this.__scroller__ = qe(t, {
|
|
511
511
|
overflowBehavior: {
|
|
512
512
|
x: "hidden"
|
|
513
513
|
},
|
|
514
514
|
autoUpdate: !0
|
|
515
|
-
}), window.modalScroll = this.__scroller__, d(this,
|
|
516
|
-
},
|
|
515
|
+
}), window.modalScroll = this.__scroller__, d(this, wt, ni).call(this);
|
|
516
|
+
}, wt = new WeakSet(), ni = function() {
|
|
517
517
|
var a, r, l;
|
|
518
518
|
const t = this, { ATTRS: e } = I, { close: s, destroy: o } = e;
|
|
519
519
|
(a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
|
|
@@ -529,7 +529,7 @@ ft = new WeakSet(), ei = function() {
|
|
|
529
529
|
}), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
|
|
530
530
|
c.stopPropagation();
|
|
531
531
|
});
|
|
532
|
-
},
|
|
532
|
+
}, Tt = new WeakSet(), oi = function(t) {
|
|
533
533
|
const { __scroller__: e } = this;
|
|
534
534
|
if (t === "open") {
|
|
535
535
|
if (this.style.display = "block", e) {
|
|
@@ -561,18 +561,18 @@ ft = new WeakSet(), ei = function() {
|
|
|
561
561
|
}
|
|
562
562
|
};
|
|
563
563
|
Object.assign(ti.prototype, O);
|
|
564
|
-
const { MODALS:
|
|
564
|
+
const { MODALS: Oe } = window, ai = (n, i, ...t) => {
|
|
565
565
|
if (!i)
|
|
566
566
|
return;
|
|
567
567
|
const e = n[i];
|
|
568
568
|
e && j(e) && e.apply(n, t);
|
|
569
569
|
}, ri = (n, ...i) => {
|
|
570
|
-
n && j(n) && n.apply(
|
|
570
|
+
n && j(n) && n.apply(J, i);
|
|
571
571
|
}, ze = (n, i) => {
|
|
572
|
-
const { target: t } = n, e =
|
|
572
|
+
const { target: t } = n, e = Oe[t] || L(n.target);
|
|
573
573
|
e && li(n, i), e || Ds(n, i);
|
|
574
574
|
}, li = (n, i) => {
|
|
575
|
-
const { target: t, action: e, on: s, e: o } = n, a =
|
|
575
|
+
const { target: t, action: e, on: s, e: o } = n, a = Oe[t] || L(n.target);
|
|
576
576
|
switch (["open", "close", "destroy"].forEach((l) => {
|
|
577
577
|
a.once(l, () => {
|
|
578
578
|
i && (i.emit(l, a, o), ai(i, s[l], a, o)), i || ri(s[l], a);
|
|
@@ -595,31 +595,31 @@ const { MODALS: Ie } = window, ai = (n, i, ...t) => {
|
|
|
595
595
|
}, Ds = async (n, i) => {
|
|
596
596
|
const { target: t, route: e, container: s, on: o, e: a } = n;
|
|
597
597
|
if (!e)
|
|
598
|
-
return
|
|
598
|
+
return E("modal4", "cannot find target or data-modal-route is not defined");
|
|
599
599
|
const r = (l, ...c) => {
|
|
600
600
|
i && (i.emit(l, ...c), ai(i, o[l], ...c)), i || ri(o[l], ...c);
|
|
601
601
|
};
|
|
602
602
|
fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
|
|
603
|
-
const c = Es(l), u =
|
|
603
|
+
const c = Es(l), u = L(s) || L(I.SETTINGS.container);
|
|
604
604
|
[...c].forEach((g) => {
|
|
605
605
|
u.append(g);
|
|
606
606
|
});
|
|
607
|
-
const p =
|
|
607
|
+
const p = Oe[t] || L(n.target);
|
|
608
608
|
r("complete", p), li(n, i);
|
|
609
609
|
}).catch((l) => {
|
|
610
610
|
r("error", l);
|
|
611
611
|
});
|
|
612
612
|
};
|
|
613
|
-
var
|
|
613
|
+
var Q, Le, Et, ci, At, di;
|
|
614
614
|
const N = class N {
|
|
615
615
|
constructor(i, t = {}) {
|
|
616
|
-
h(this,
|
|
617
|
-
h(this, Tt);
|
|
616
|
+
h(this, Q);
|
|
618
617
|
h(this, Et);
|
|
618
|
+
h(this, At);
|
|
619
619
|
this.__storage__ = {
|
|
620
620
|
el: i,
|
|
621
621
|
options: t
|
|
622
|
-
}, this.active = "data-modal-active", d(this,
|
|
622
|
+
}, this.active = "data-modal-active", d(this, Q, Le).call(this);
|
|
623
623
|
}
|
|
624
624
|
destroy() {
|
|
625
625
|
const { elements: i } = this;
|
|
@@ -629,7 +629,7 @@ const N = class N {
|
|
|
629
629
|
}
|
|
630
630
|
update() {
|
|
631
631
|
var i;
|
|
632
|
-
return d(i = this.destroy(),
|
|
632
|
+
return d(i = this.destroy(), Q, Le).call(i), this.emit("update"), this;
|
|
633
633
|
}
|
|
634
634
|
/** static method 'open' */
|
|
635
635
|
static open(i) {
|
|
@@ -645,23 +645,23 @@ const N = class N {
|
|
|
645
645
|
Object.assign(N.prototype, N.prototype.__methods__);
|
|
646
646
|
}
|
|
647
647
|
};
|
|
648
|
-
|
|
648
|
+
Q = new WeakSet(), Le = function() {
|
|
649
649
|
const { el: i, options: t } = this.__storage__;
|
|
650
|
-
if (!
|
|
650
|
+
if (!rt(i) || !w(i))
|
|
651
651
|
return;
|
|
652
652
|
const { SETTINGS: e, EVENTS: s } = I;
|
|
653
|
-
if (this.elements = t.state == "not active" ?
|
|
653
|
+
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
654
654
|
for (const [o, a] of Object.entries(this.options.on))
|
|
655
655
|
this.__events__[o] = [a];
|
|
656
|
-
d(this,
|
|
657
|
-
},
|
|
656
|
+
d(this, Et, ci).call(this);
|
|
657
|
+
}, Et = new WeakSet(), ci = function() {
|
|
658
658
|
const { elements: i, options: t } = this;
|
|
659
659
|
i.forEach((e) => {
|
|
660
|
-
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this,
|
|
660
|
+
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, At, di), 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, "");
|
|
661
661
|
}), this.emit("init");
|
|
662
|
-
},
|
|
662
|
+
}, At = new WeakSet(), di = function(i) {
|
|
663
663
|
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = As(this.getAttribute("data-modal-on"));
|
|
664
|
-
o && typeof o != "object" &&
|
|
664
|
+
o && typeof o != "object" && E("modal4", "data-modal-on must be a json string.");
|
|
665
665
|
const a = {
|
|
666
666
|
target: this.getAttribute("data-modal-target") || t.target,
|
|
667
667
|
action: this.getAttribute("data-modal-action") || t.action,
|
|
@@ -674,8 +674,8 @@ Z = new WeakSet(), Ae = function() {
|
|
|
674
674
|
this.addEventListener("click", e);
|
|
675
675
|
}, 200), ze(a, s);
|
|
676
676
|
};
|
|
677
|
-
let
|
|
678
|
-
Object.assign(
|
|
677
|
+
let J = N;
|
|
678
|
+
Object.assign(J.prototype, O);
|
|
679
679
|
customElements.define("modern-modal", ti);
|
|
680
680
|
const _s = (n, i) => {
|
|
681
681
|
const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
|
|
@@ -693,21 +693,21 @@ const _s = (n, i) => {
|
|
|
693
693
|
}
|
|
694
694
|
});
|
|
695
695
|
}, ks = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
|
|
696
|
-
var
|
|
696
|
+
var V, Se, Lt, hi;
|
|
697
697
|
class ui {
|
|
698
698
|
constructor(i, t = {}) {
|
|
699
|
-
h(this,
|
|
700
|
-
h(this,
|
|
699
|
+
h(this, V);
|
|
700
|
+
h(this, Lt);
|
|
701
701
|
this.__storage__ = {
|
|
702
702
|
el: i,
|
|
703
703
|
options: t
|
|
704
|
-
}, this.active = "data-aost-active", d(this,
|
|
704
|
+
}, this.active = "data-aost-active", d(this, V, Se).call(this);
|
|
705
705
|
}
|
|
706
706
|
destroy(i) {
|
|
707
707
|
const { elements: t, options: e } = this;
|
|
708
708
|
if (!t)
|
|
709
709
|
return this;
|
|
710
|
-
const { scroller: s } = e, o = s === window || !w(s) ? window :
|
|
710
|
+
const { scroller: s } = e, o = s === window || !w(s) ? window : L(s);
|
|
711
711
|
return o.aost && (o.removeEventListener("scroll", o.aost.eventHandler), delete o.aost), t.forEach((a) => {
|
|
712
712
|
if (!a.aost)
|
|
713
713
|
return;
|
|
@@ -717,20 +717,20 @@ class ui {
|
|
|
717
717
|
}
|
|
718
718
|
update(i) {
|
|
719
719
|
var t;
|
|
720
|
-
d(t = this.destroy(i),
|
|
720
|
+
d(t = this.destroy(i), V, Se).call(t);
|
|
721
721
|
}
|
|
722
722
|
}
|
|
723
|
-
|
|
723
|
+
V = new WeakSet(), Se = function() {
|
|
724
724
|
const { el: i, options: t } = this.__storage__;
|
|
725
|
-
if (!
|
|
725
|
+
if (!rt(i) || !w(i))
|
|
726
726
|
return;
|
|
727
727
|
const { SETTINGS: e, EVENTS: s } = Ye;
|
|
728
|
-
if (this.elements = t.state == "not active" ?
|
|
728
|
+
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
729
729
|
for (const [o, a] of Object.entries(this.options.on))
|
|
730
730
|
this.__events__[o] = [a];
|
|
731
|
-
d(this,
|
|
732
|
-
},
|
|
733
|
-
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !w(e) ? window :
|
|
731
|
+
d(this, Lt, hi).call(this);
|
|
732
|
+
}, Lt = new WeakSet(), hi = function() {
|
|
733
|
+
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !w(e) ? window : L(e);
|
|
734
734
|
this.eventHandler = () => {
|
|
735
735
|
_s(s, i);
|
|
736
736
|
}, i.forEach((a) => {
|
|
@@ -748,25 +748,25 @@ const $s = (n) => {
|
|
|
748
748
|
s.append(o);
|
|
749
749
|
}), e.children[0];
|
|
750
750
|
};
|
|
751
|
-
var
|
|
751
|
+
var St, pi, Dt, mi, _t, gi, kt, fi, $t, vi, xt, bi, Ct, yi, Ht, wi, Mt, Ti;
|
|
752
752
|
class xs extends HTMLElement {
|
|
753
753
|
constructor() {
|
|
754
754
|
super();
|
|
755
|
-
h(this, Lt);
|
|
756
755
|
h(this, St);
|
|
757
756
|
h(this, Dt);
|
|
758
|
-
// youtube iframe
|
|
759
757
|
h(this, _t);
|
|
760
|
-
//
|
|
758
|
+
// youtube iframe
|
|
761
759
|
h(this, kt);
|
|
762
|
-
//
|
|
760
|
+
// vimeo iframe
|
|
763
761
|
h(this, $t);
|
|
762
|
+
// youku iframe
|
|
764
763
|
h(this, xt);
|
|
765
|
-
// 2025.02.11 新增 ig
|
|
766
764
|
h(this, Ct);
|
|
767
|
-
// 2025.02.11 新增
|
|
765
|
+
// 2025.02.11 新增 ig
|
|
768
766
|
h(this, Ht);
|
|
769
|
-
|
|
767
|
+
// 2025.02.11 新增 tiktok
|
|
768
|
+
h(this, Mt);
|
|
769
|
+
d(this, St, pi).call(this);
|
|
770
770
|
}
|
|
771
771
|
play() {
|
|
772
772
|
const { videoType: t } = this;
|
|
@@ -803,62 +803,62 @@ class xs extends HTMLElement {
|
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
|
-
|
|
806
|
+
St = new WeakSet(), pi = function() {
|
|
807
807
|
if (!this.getAttribute("video-id")) {
|
|
808
|
-
|
|
808
|
+
E("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
|
809
809
|
return;
|
|
810
810
|
}
|
|
811
|
-
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), d(this,
|
|
812
|
-
},
|
|
813
|
-
this.childDom = this.childNodes, this.template = $s(this), this.innerHTML = "", this.append(this.template), d(this,
|
|
814
|
-
},
|
|
811
|
+
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), d(this, Dt, mi).call(this);
|
|
812
|
+
}, Dt = new WeakSet(), mi = function() {
|
|
813
|
+
this.childDom = this.childNodes, this.template = $s(this), this.innerHTML = "", this.append(this.template), d(this, _t, gi).call(this);
|
|
814
|
+
}, _t = new WeakSet(), gi = function() {
|
|
815
815
|
const { videoType: t } = this;
|
|
816
816
|
let e = "";
|
|
817
817
|
switch (t) {
|
|
818
818
|
case "youtubeAPI":
|
|
819
819
|
break;
|
|
820
820
|
case "youtube":
|
|
821
|
-
e = d(this,
|
|
821
|
+
e = d(this, kt, fi).call(this);
|
|
822
822
|
break;
|
|
823
823
|
case "youkuAPI":
|
|
824
824
|
break;
|
|
825
825
|
case "youku":
|
|
826
|
-
e = d(this,
|
|
826
|
+
e = d(this, xt, bi).call(this);
|
|
827
827
|
break;
|
|
828
828
|
case "vimeo":
|
|
829
|
-
e = d(this,
|
|
829
|
+
e = d(this, $t, vi).call(this);
|
|
830
830
|
break;
|
|
831
831
|
case "bilibili":
|
|
832
|
-
e = d(this,
|
|
832
|
+
e = d(this, Ct, yi).call(this);
|
|
833
833
|
break;
|
|
834
834
|
case "instagram":
|
|
835
|
-
e = d(this,
|
|
835
|
+
e = d(this, Ht, wi).call(this);
|
|
836
836
|
break;
|
|
837
837
|
case "tiktok":
|
|
838
|
-
e = d(this,
|
|
838
|
+
e = d(this, Mt, Ti).call(this);
|
|
839
839
|
break;
|
|
840
840
|
}
|
|
841
|
-
this.querySelector(".player-wrapper").insertAdjacentHTML(
|
|
842
|
-
},
|
|
841
|
+
this.querySelector(".player-wrapper").insertAdjacentHTML(A.prepend, e);
|
|
842
|
+
}, kt = new WeakSet(), fi = function() {
|
|
843
843
|
const { videoId: t, autoplay: e, startTime: s } = this;
|
|
844
844
|
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>`;
|
|
845
|
-
},
|
|
845
|
+
}, $t = new WeakSet(), vi = function() {
|
|
846
846
|
const { videoId: t, autoplay: e, hash: s } = this;
|
|
847
847
|
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>`;
|
|
848
|
-
},
|
|
848
|
+
}, xt = new WeakSet(), bi = function() {
|
|
849
849
|
const { videoId: t, autoplay: e } = this;
|
|
850
850
|
return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}" frameborder=0 "allowfullscreen"></iframe>`;
|
|
851
|
-
},
|
|
851
|
+
}, Ct = new WeakSet(), yi = function() {
|
|
852
852
|
const { videoId: t, autoplay: e } = this;
|
|
853
853
|
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>`;
|
|
854
|
-
},
|
|
854
|
+
}, Ht = new WeakSet(), wi = function() {
|
|
855
855
|
const { videoId: t, autoplay: e } = this;
|
|
856
856
|
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>`;
|
|
857
|
-
},
|
|
857
|
+
}, Mt = new WeakSet(), Ti = function() {
|
|
858
858
|
const { videoId: t, autoplay: e } = this;
|
|
859
859
|
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>`;
|
|
860
860
|
};
|
|
861
|
-
const
|
|
861
|
+
const fn = (n) => new Promise((i) => {
|
|
862
862
|
let t = setTimeout(() => (clearTimeout(t), i()), n);
|
|
863
863
|
});
|
|
864
864
|
function Ei(n) {
|
|
@@ -873,7 +873,7 @@ function Ai(n) {
|
|
|
873
873
|
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(`${t}`));
|
|
874
874
|
}), v("html").removeClass("scrollLock"), bs(i);
|
|
875
875
|
}
|
|
876
|
-
async function
|
|
876
|
+
async function vn(n = 0) {
|
|
877
877
|
if (v(".loading-wrapper").length)
|
|
878
878
|
return;
|
|
879
879
|
v("body").append(`
|
|
@@ -890,27 +890,27 @@ async function fn(n = 0) {
|
|
|
890
890
|
Ei();
|
|
891
891
|
});
|
|
892
892
|
}
|
|
893
|
-
function
|
|
893
|
+
function bn() {
|
|
894
894
|
v(".loading-wrapper").fadeOut(300).promise().done(function() {
|
|
895
895
|
v(".loading-wrapper").remove(), Ai();
|
|
896
896
|
});
|
|
897
897
|
}
|
|
898
|
-
function
|
|
899
|
-
new
|
|
898
|
+
function yn(n, i) {
|
|
899
|
+
new an(n, i);
|
|
900
900
|
}
|
|
901
901
|
function Cs() {
|
|
902
902
|
const n = document.querySelector("[data-aost]") && new ui("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new Qe("[data-anchor-target]"), t = new Fe({ callback_loaded: () => {
|
|
903
|
-
} }), e = new
|
|
903
|
+
} }), e = new Vs();
|
|
904
904
|
n == null || n.update(), t.update(), e.reValidate(), i == null || i.update();
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function wn(n, i = () => {
|
|
907
907
|
}) {
|
|
908
908
|
v(`[data-tab-content=${n}]`).fadeIn(function() {
|
|
909
909
|
typeof i == "function" && i();
|
|
910
910
|
}).siblings("[data-tab-content]").hide(), Cs();
|
|
911
911
|
}
|
|
912
|
-
function
|
|
913
|
-
|
|
912
|
+
function Tn() {
|
|
913
|
+
qe(
|
|
914
914
|
{
|
|
915
915
|
target: document.body,
|
|
916
916
|
cancel: {
|
|
@@ -934,23 +934,23 @@ function wn() {
|
|
|
934
934
|
}
|
|
935
935
|
);
|
|
936
936
|
}
|
|
937
|
-
function
|
|
937
|
+
function En() {
|
|
938
938
|
window.onpageshow = function(n) {
|
|
939
939
|
n.persisted && window.location.reload();
|
|
940
940
|
};
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function An() {
|
|
943
943
|
const n = navigator.userAgent;
|
|
944
944
|
return {
|
|
945
945
|
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)
|
|
946
946
|
};
|
|
947
947
|
}
|
|
948
|
-
function
|
|
948
|
+
function Ln(n, i) {
|
|
949
949
|
v(n).on("click", function() {
|
|
950
950
|
v(this).toggleClass(i);
|
|
951
951
|
});
|
|
952
952
|
}
|
|
953
|
-
function
|
|
953
|
+
function Sn(n, i) {
|
|
954
954
|
v(n).on("click", function() {
|
|
955
955
|
v(n).not(this).removeClass(i), v(this).addClass(i);
|
|
956
956
|
});
|
|
@@ -964,7 +964,7 @@ function Hs(n, i = 250) {
|
|
|
964
964
|
}, i);
|
|
965
965
|
};
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function Dn(n, i = 250) {
|
|
968
968
|
let t, e;
|
|
969
969
|
return function() {
|
|
970
970
|
const s = this, o = arguments, a = +/* @__PURE__ */ new Date();
|
|
@@ -973,7 +973,7 @@ function Sn(n, i = 250) {
|
|
|
973
973
|
}, i)) : (t = a, n.apply(s, o));
|
|
974
974
|
};
|
|
975
975
|
}
|
|
976
|
-
function
|
|
976
|
+
function _n() {
|
|
977
977
|
window._g.interval = [], v(".countdown").each((i, t) => {
|
|
978
978
|
const e = Number(v(t).attr("data-seconds")) + 1;
|
|
979
979
|
let s = Math.floor(e / 60) + ":" + e % 60;
|
|
@@ -983,21 +983,21 @@ function Dn() {
|
|
|
983
983
|
}, 1e3);
|
|
984
984
|
});
|
|
985
985
|
}
|
|
986
|
-
function
|
|
986
|
+
function kn(n = 500) {
|
|
987
987
|
return new Promise((i, t) => {
|
|
988
988
|
let e = setTimeout(() => {
|
|
989
989
|
clearTimeout(e), i();
|
|
990
990
|
}, n);
|
|
991
991
|
});
|
|
992
992
|
}
|
|
993
|
-
function
|
|
993
|
+
function $n() {
|
|
994
994
|
const n = function() {
|
|
995
995
|
let i = window.innerHeight * 0.01;
|
|
996
996
|
document.documentElement.style.setProperty("--vh", i + "px");
|
|
997
997
|
};
|
|
998
998
|
n(), window.addEventListener("resize", Hs(n));
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1000
|
+
function xn(n, i, t, e, s) {
|
|
1001
1001
|
const o = this, r = v(n).html().split("<br>");
|
|
1002
1002
|
let l = "", c = 0;
|
|
1003
1003
|
r.forEach((u, p) => {
|
|
@@ -1006,11 +1006,11 @@ function $n(n, i, t, e, s) {
|
|
|
1006
1006
|
});
|
|
1007
1007
|
}), v(n).html(l);
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1009
|
+
function Cn(n, i) {
|
|
1010
1010
|
const t = Math.pow(10, i);
|
|
1011
1011
|
return Math.round(n * t) / t;
|
|
1012
1012
|
}
|
|
1013
|
-
function
|
|
1013
|
+
function Hn(n) {
|
|
1014
1014
|
let i = n.activeIndex, t = n.slides.length;
|
|
1015
1015
|
if (n.params.loop)
|
|
1016
1016
|
switch (n.activeIndex) {
|
|
@@ -1025,18 +1025,18 @@ function Cn(n) {
|
|
|
1025
1025
|
}
|
|
1026
1026
|
return i;
|
|
1027
1027
|
}
|
|
1028
|
-
function
|
|
1028
|
+
function Mn(n, i) {
|
|
1029
1029
|
const t = n.$el, e = n.params.grid.rows, s = i || n.params.slidesPerView * e;
|
|
1030
1030
|
(n.loopedSlides ? n.slides.length - n.loopedSlides * 2 : n.slides.length) <= s ? (t.addClass("swiper-no-swiping"), v(n.params.navigation.nextEl).hide(), v(n.params.navigation.prevEl).hide(), v(n.params.pagination.el).hide(), n.params.autoplay.enabled = !1, n.autoplay.stop()) : (t.removeClass("swiper-no-swiping"), v(n.params.navigation.nextEl).show(), v(n.params.navigation.prevEl).show(), v(n.params.pagination.el).show(), n.params.autoplay.enabled && n.autoplay.start());
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1032
|
+
function qn(n) {
|
|
1033
1033
|
n.el.querySelectorAll("img.detect-shade").forEach((i) => {
|
|
1034
1034
|
i.addEventListener("load", function() {
|
|
1035
1035
|
detectShade(i);
|
|
1036
1036
|
});
|
|
1037
1037
|
});
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function In(n) {
|
|
1040
1040
|
const i = n.el, t = v(i).find(".swiper-slide-active"), e = v(t).find("video").get(0), s = v(i).find(".swiper-slide video");
|
|
1041
1041
|
n.autoplay.stop(), v(e).off("ended"), e ? (s.each((o, a) => {
|
|
1042
1042
|
a.currentTime = 0;
|
|
@@ -1044,7 +1044,7 @@ function qn(n) {
|
|
|
1044
1044
|
n.slideNext();
|
|
1045
1045
|
}), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1047
|
+
function On() {
|
|
1048
1048
|
v(".number-grow").each(function(n, i) {
|
|
1049
1049
|
const t = v(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
|
|
1050
1050
|
let r = "";
|
|
@@ -1058,7 +1058,7 @@ function In() {
|
|
|
1058
1058
|
});
|
|
1059
1059
|
});
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1061
|
+
function Nn() {
|
|
1062
1062
|
v(".letter-grow").each(function(n, i) {
|
|
1063
1063
|
const t = v(i), s = t.attr("data-letter").split(""), o = () => {
|
|
1064
1064
|
let a = "";
|
|
@@ -1072,90 +1072,90 @@ function On() {
|
|
|
1072
1072
|
});
|
|
1073
1073
|
});
|
|
1074
1074
|
}
|
|
1075
|
-
function
|
|
1075
|
+
function Pn(n) {
|
|
1076
1076
|
const i = getComputedStyle(n).transform;
|
|
1077
1077
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
|
1078
1078
|
return t ? parseFloat(t[1].split(", ")[12]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[4]) : 0);
|
|
1079
1079
|
}
|
|
1080
|
-
function
|
|
1080
|
+
function jn(n) {
|
|
1081
1081
|
const i = getComputedStyle(n).transform;
|
|
1082
1082
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
|
1083
1083
|
return t ? parseFloat(t[1].split(", ")[13]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[5]) : 0);
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function zn(n) {
|
|
1086
1086
|
const i = document.createElement("div");
|
|
1087
1087
|
return i.innerHTML = n, i.childNodes[0];
|
|
1088
1088
|
}
|
|
1089
|
-
const We = (n) => n.videoId !== "" || typeof n.videoId < "u", Ms = (n) => n.$selector.getAttribute("video4-active") === "on",
|
|
1090
|
-
var
|
|
1089
|
+
const We = (n) => n.videoId !== "" || typeof n.videoId < "u", Ms = (n) => n.$selector.getAttribute("video4-active") === "on", ct = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`;
|
|
1090
|
+
var K, De, qt, Li, It, Si, tt, _e, Ot, Di;
|
|
1091
1091
|
class qs {
|
|
1092
1092
|
constructor(i, t = {}) {
|
|
1093
|
-
h(this, V);
|
|
1094
|
-
h(this, Mt);
|
|
1095
|
-
h(this, qt);
|
|
1096
1093
|
h(this, K);
|
|
1094
|
+
h(this, qt);
|
|
1097
1095
|
h(this, It);
|
|
1098
|
-
|
|
1096
|
+
h(this, tt);
|
|
1097
|
+
h(this, Ot);
|
|
1098
|
+
if (!rt(i) && !Te(i) && !lt(i)) {
|
|
1099
1099
|
je("video4", `找不到該物件 -> ${i}`);
|
|
1100
1100
|
return;
|
|
1101
1101
|
}
|
|
1102
1102
|
this.__storage__ = {
|
|
1103
1103
|
el: i,
|
|
1104
1104
|
options: t
|
|
1105
|
-
}, this.active = "data-video-active", d(this,
|
|
1105
|
+
}, this.active = "data-video-active", d(this, K, De).call(this);
|
|
1106
1106
|
}
|
|
1107
1107
|
update() {
|
|
1108
|
-
d(this,
|
|
1108
|
+
d(this, K, De).call(this);
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
|
-
|
|
1111
|
+
K = new WeakSet(), De = function() {
|
|
1112
1112
|
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Y;
|
|
1113
|
-
if (this.elements = t.state == "not active" ?
|
|
1113
|
+
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
1114
1114
|
for (const [o, a] of Object.entries(this.options.on))
|
|
1115
1115
|
this.__events__[o] = [a];
|
|
1116
|
-
d(this,
|
|
1117
|
-
},
|
|
1116
|
+
d(this, qt, Li).call(this);
|
|
1117
|
+
}, qt = new WeakSet(), Li = function() {
|
|
1118
1118
|
const { elements: i, options: t } = this;
|
|
1119
1119
|
i.forEach((e) => {
|
|
1120
|
-
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this,
|
|
1120
|
+
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, Ot, Di).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), We(e.video.params) && !Ms(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, It, Si).call(this, e)), We(e.video.params) || je("video4", "無法取得影片 ID");
|
|
1121
1121
|
}), this.emit("init");
|
|
1122
|
-
},
|
|
1122
|
+
}, It = new WeakSet(), Si = function(i) {
|
|
1123
1123
|
const { LAYOUT: t } = Y, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: p } = e;
|
|
1124
1124
|
if (l === "onBox") {
|
|
1125
1125
|
let g = null;
|
|
1126
1126
|
if (u === "on") {
|
|
1127
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
|
1127
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(A.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
|
1128
1128
|
const m = s.querySelector("img");
|
|
1129
|
-
m.insertAdjacentHTML(
|
|
1129
|
+
m.insertAdjacentHTML(A.after, t[o]);
|
|
1130
1130
|
const f = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
|
1131
|
-
!f && r == "youtube" ? p == "on" ? m.setAttribute("src", `
|
|
1131
|
+
!f && r == "youtube" ? p == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !f && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !f && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
|
|
1132
1132
|
const y = b.thumbnail_url;
|
|
1133
1133
|
m.setAttribute("src", `${y}`);
|
|
1134
1134
|
}).catch(function(b) {
|
|
1135
1135
|
console.log("error");
|
|
1136
|
-
}) :
|
|
1136
|
+
}) : E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
|
1137
1137
|
}
|
|
1138
|
-
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) ||
|
|
1138
|
+
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.eventHandler = d(this, tt, _e), g.addEventListener("click", g.video.eventHandler);
|
|
1139
1139
|
} else if (l === "onPage") {
|
|
1140
1140
|
let g = null;
|
|
1141
1141
|
if (u == "on") {
|
|
1142
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
|
1142
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(A.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
|
1143
1143
|
const m = s.querySelector("img");
|
|
1144
|
-
m.insertAdjacentHTML(
|
|
1144
|
+
m.insertAdjacentHTML(A.after, t[o]);
|
|
1145
1145
|
const f = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
|
1146
1146
|
!f && r == "youtube" ? p == "on" ? m.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !f && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !f && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
|
|
1147
1147
|
const y = b.thumbnail_url;
|
|
1148
1148
|
m.setAttribute("src", `${y}`);
|
|
1149
1149
|
}).catch(function(b) {
|
|
1150
1150
|
console.log("error");
|
|
1151
|
-
}) : f ||
|
|
1151
|
+
}) : f || E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
|
1152
1152
|
} else {
|
|
1153
|
-
s.innerHTML =
|
|
1153
|
+
s.innerHTML = ct(e);
|
|
1154
1154
|
return;
|
|
1155
1155
|
}
|
|
1156
|
-
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this,
|
|
1156
|
+
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, tt, _e), g.addEventListener("click", g.video.eventHandler);
|
|
1157
1157
|
}
|
|
1158
|
-
},
|
|
1158
|
+
}, tt = new WeakSet(), _e = function(i) {
|
|
1159
1159
|
const { video: t, emit: e } = this, { $selector: s, videoMode: o, videoTarget: a, videoKeep: r, videoTargetRoute: l, videoType: c, videoIgHtml: u } = t.params, p = new Fe({ callback_loaded: (g) => {
|
|
1160
1160
|
} });
|
|
1161
1161
|
if (o == "onBox") {
|
|
@@ -1165,7 +1165,7 @@ V = new WeakSet(), Se = function() {
|
|
|
1165
1165
|
on: {
|
|
1166
1166
|
complete(m) {
|
|
1167
1167
|
var f;
|
|
1168
|
-
c == "instagram" ? (m.setAttribute("video-typeStyle", `${c}`), (f = window.instgrm) != null && f.Embeds ? window.instgrm.Embeds.process() : console.log("window.instgrm is undefined")) : (m.querySelector(".modal-content").insertAdjacentHTML("beforeend",
|
|
1168
|
+
c == "instagram" ? (m.setAttribute("video-typeStyle", `${c}`), (f = window.instgrm) != null && f.Embeds ? window.instgrm.Embeds.process() : console.log("window.instgrm is undefined")) : (m.querySelector(".modal-content").insertAdjacentHTML("beforeend", ct(t.params)), m.setAttribute("video-typeStyle", `${c}`));
|
|
1169
1169
|
},
|
|
1170
1170
|
open(m) {
|
|
1171
1171
|
const f = m.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
@@ -1184,16 +1184,16 @@ V = new WeakSet(), Se = function() {
|
|
|
1184
1184
|
}
|
|
1185
1185
|
}
|
|
1186
1186
|
};
|
|
1187
|
-
|
|
1187
|
+
J.open(g);
|
|
1188
1188
|
} else if (o == "onPage")
|
|
1189
1189
|
if (t.params.videoAutoplay = "on", r == "off") {
|
|
1190
|
-
s.innerHTML =
|
|
1190
|
+
s.innerHTML = ct(t.params);
|
|
1191
1191
|
return;
|
|
1192
1192
|
} else {
|
|
1193
|
-
(s.querySelector(r) ?? s).insertAdjacentHTML("beforeend",
|
|
1193
|
+
(s.querySelector(r) ?? s).insertAdjacentHTML("beforeend", ct(t.params));
|
|
1194
1194
|
return;
|
|
1195
1195
|
}
|
|
1196
|
-
},
|
|
1196
|
+
}, Ot = new WeakSet(), Di = function(i) {
|
|
1197
1197
|
const { SETTINGS: t } = Y;
|
|
1198
1198
|
return {
|
|
1199
1199
|
$selector: i,
|
|
@@ -1214,7 +1214,7 @@ V = new WeakSet(), Se = function() {
|
|
|
1214
1214
|
};
|
|
1215
1215
|
Object.assign(qs.prototype, O);
|
|
1216
1216
|
customElements.define("video-player", xs);
|
|
1217
|
-
const
|
|
1217
|
+
const Is = {
|
|
1218
1218
|
"zh-tw": {
|
|
1219
1219
|
臺北市: [
|
|
1220
1220
|
["中正區", "100"],
|
|
@@ -2043,8 +2043,10 @@ const Oe = {
|
|
|
2043
2043
|
["Dongyin Township", "212"]
|
|
2044
2044
|
]
|
|
2045
2045
|
}
|
|
2046
|
-
}
|
|
2047
|
-
|
|
2046
|
+
};
|
|
2047
|
+
let U;
|
|
2048
|
+
const Os = (n) => {
|
|
2049
|
+
const { TEMPLATE: i } = Ie, { 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");
|
|
2048
2050
|
e.innerHTML = i(
|
|
2049
2051
|
s,
|
|
2050
2052
|
o,
|
|
@@ -2057,12 +2059,12 @@ const Oe = {
|
|
|
2057
2059
|
(!p.hasAttribute("data-option") || p.getAttribute("data-option").trim() === "") && p.setAttribute("data-option", p.textContent.trim());
|
|
2058
2060
|
}) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
|
|
2059
2061
|
}), e.children[0];
|
|
2060
|
-
},
|
|
2062
|
+
}, Ns = (n) => {
|
|
2061
2063
|
var t;
|
|
2062
2064
|
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
|
2063
2065
|
i && i.forEach((e) => {
|
|
2064
2066
|
const s = document.querySelector(e);
|
|
2065
|
-
s ||
|
|
2067
|
+
s || E("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && C(s, [...s.s.allLi].indexOf(s.s.activeLi)));
|
|
2066
2068
|
});
|
|
2067
2069
|
}, C = (n, i) => {
|
|
2068
2070
|
const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
|
|
@@ -2105,7 +2107,7 @@ const Oe = {
|
|
|
2105
2107
|
const o = n.querySelectorAll(".dropdown-list li.active");
|
|
2106
2108
|
o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
|
|
2107
2109
|
const l = r.getAttribute("data-option"), c = r.textContent.trim(), u = `<div class="option-btn" data-option="${l}"><div class="text">${c}</div><div class="remove-icon"></div></div>`;
|
|
2108
|
-
n.s.selectDisplayEl.insertAdjacentHTML(
|
|
2110
|
+
n.s.selectDisplayEl.insertAdjacentHTML(A.append, u);
|
|
2109
2111
|
})), n.s.activeLi = o, n.s.value = [...o].map((r) => ({
|
|
2110
2112
|
index: [...e].indexOf(r),
|
|
2111
2113
|
id: r.getAttribute("data-option"),
|
|
@@ -2116,42 +2118,42 @@ const Oe = {
|
|
|
2116
2118
|
break;
|
|
2117
2119
|
}
|
|
2118
2120
|
}
|
|
2119
|
-
},
|
|
2121
|
+
}, Ps = (n) => {
|
|
2120
2122
|
const i = n.s.cityLang;
|
|
2121
|
-
n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(
|
|
2123
|
+
v("#newCityData").val() !== "" ? (U = JSON.parse(v("#newCityData").val())[0], console.log([0])) : U = Is, n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(U[i]).forEach((t) => {
|
|
2122
2124
|
const e = document.createElement("li");
|
|
2123
2125
|
e.textContent = t, e.setAttribute("data-option", t), n.s.dropdownEl.querySelector(".dropdown-list").append(e);
|
|
2124
2126
|
}), n.s.allLi = n.querySelectorAll(".dropdown-list li"));
|
|
2125
|
-
},
|
|
2127
|
+
}, js = (n, i) => {
|
|
2126
2128
|
const t = n.s.cityLang;
|
|
2127
|
-
|
|
2129
|
+
U[t][i].forEach((e, s) => {
|
|
2128
2130
|
const o = document.createElement("li");
|
|
2129
2131
|
o.textContent = e[0], o.setAttribute("data-option", e[0]), n.querySelector(".dropdown-list").append(o);
|
|
2130
2132
|
});
|
|
2131
2133
|
}, _i = () => {
|
|
2132
|
-
|
|
2134
|
+
S('dropdown-el[d4-status="open"]').forEach((i) => {
|
|
2133
2135
|
i.close();
|
|
2134
2136
|
});
|
|
2135
|
-
},
|
|
2136
|
-
const { SETTINGS: n } =
|
|
2137
|
+
}, zs = () => {
|
|
2138
|
+
const { SETTINGS: n } = Ie;
|
|
2137
2139
|
((t, e) => {
|
|
2138
2140
|
Object.keys(e).forEach((s) => {
|
|
2139
2141
|
t.style.setProperty(`--${s}`, e[s]);
|
|
2140
2142
|
});
|
|
2141
2143
|
})(document.documentElement, n.scrollbar);
|
|
2142
2144
|
};
|
|
2143
|
-
|
|
2145
|
+
zs();
|
|
2144
2146
|
document.addEventListener("click", function() {
|
|
2145
2147
|
_i();
|
|
2146
2148
|
});
|
|
2147
|
-
var
|
|
2149
|
+
var Nt, $i, Pt, xi, jt, Ci, zt, Hi;
|
|
2148
2150
|
class ki extends HTMLElement {
|
|
2149
2151
|
constructor() {
|
|
2150
2152
|
super();
|
|
2151
|
-
h(this, Ot);
|
|
2152
2153
|
h(this, Nt);
|
|
2153
2154
|
h(this, Pt);
|
|
2154
2155
|
h(this, jt);
|
|
2156
|
+
h(this, zt);
|
|
2155
2157
|
this.initialize = !1;
|
|
2156
2158
|
}
|
|
2157
2159
|
static get observedAttributes() {
|
|
@@ -2197,7 +2199,7 @@ class ki extends HTMLElement {
|
|
|
2197
2199
|
}
|
|
2198
2200
|
connectedCallback() {
|
|
2199
2201
|
const t = this;
|
|
2200
|
-
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this,
|
|
2202
|
+
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, Nt, $i).call(this));
|
|
2201
2203
|
}
|
|
2202
2204
|
open() {
|
|
2203
2205
|
const t = this, e = t.querySelector(".dropdown-scroller").clientHeight, s = t.classList.contains("filter"), o = () => s ? t.querySelector(".dropdown-scroller .filter-bar") ? e : t.querySelector(".filter-bar").clientHeight + e : e;
|
|
@@ -2223,14 +2225,14 @@ class ki extends HTMLElement {
|
|
|
2223
2225
|
this.__events__.selectOption();
|
|
2224
2226
|
}
|
|
2225
2227
|
}
|
|
2226
|
-
|
|
2227
|
-
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this,
|
|
2228
|
-
},
|
|
2229
|
-
this.s.childDom = this.childNodes, this.s.template =
|
|
2230
|
-
},
|
|
2228
|
+
Nt = new WeakSet(), $i = function() {
|
|
2229
|
+
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Pt, xi).call(this);
|
|
2230
|
+
}, Pt = new WeakSet(), xi = function() {
|
|
2231
|
+
this.s.childDom = this.childNodes, this.s.template = Os(this), this.innerHTML = "", this.append(this.s.template), d(this, jt, Ci).call(this);
|
|
2232
|
+
}, jt = new WeakSet(), Ci = function() {
|
|
2231
2233
|
var s;
|
|
2232
2234
|
const t = this;
|
|
2233
|
-
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",
|
|
2235
|
+
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", Ps(t), t.s.subDropdownTotalH = 0;
|
|
2234
2236
|
const e = t.getAttribute("d4-value");
|
|
2235
2237
|
switch (t.s.selectType) {
|
|
2236
2238
|
case "single":
|
|
@@ -2239,7 +2241,7 @@ Ot = new WeakSet(), $i = function() {
|
|
|
2239
2241
|
const r = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), l = r ? r.getAttribute("d4-value") !== "" : !1;
|
|
2240
2242
|
if (r && l) {
|
|
2241
2243
|
const c = r.getAttribute("d4-value");
|
|
2242
|
-
if (
|
|
2244
|
+
if (js(t, c), t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
|
|
2243
2245
|
const u = e.split(",")[1];
|
|
2244
2246
|
o = t.querySelector(`.dropdown-list li[data-option="${u}"]`), t.setAttribute("d4-value", u);
|
|
2245
2247
|
}
|
|
@@ -2272,8 +2274,8 @@ Ot = new WeakSet(), $i = function() {
|
|
|
2272
2274
|
};
|
|
2273
2275
|
break;
|
|
2274
2276
|
}
|
|
2275
|
-
C(t, t.s.value.index), d(s = t,
|
|
2276
|
-
},
|
|
2277
|
+
C(t, t.s.value.index), d(s = t, zt, Hi).call(s), t.classList.add("d4-initialize");
|
|
2278
|
+
}, zt = new WeakSet(), Hi = function() {
|
|
2277
2279
|
const t = this;
|
|
2278
2280
|
t.__events__.dropdownToggle = () => {
|
|
2279
2281
|
t.addEventListener("click", function(e) {
|
|
@@ -2319,7 +2321,7 @@ Ot = new WeakSet(), $i = function() {
|
|
|
2319
2321
|
t.s.dropdownEl.addEventListener("transitionend", e);
|
|
2320
2322
|
}, t.__events__.bindScrollbar = (e = this) => {
|
|
2321
2323
|
const s = e.querySelector(".dropdown-scroller");
|
|
2322
|
-
e.__scroller__ =
|
|
2324
|
+
e.__scroller__ = qe(s, {
|
|
2323
2325
|
overflowBehavior: {
|
|
2324
2326
|
x: "hidden"
|
|
2325
2327
|
}
|
|
@@ -2335,22 +2337,22 @@ Ot = new WeakSet(), $i = function() {
|
|
|
2335
2337
|
c.stopPropagation();
|
|
2336
2338
|
const f = u.querySelector(".sub-dropdown"), b = f.querySelector(".sub-dropdown-list"), y = parseInt(getComputedStyle(b).marginTop) + parseInt(getComputedStyle(b).marginBottom);
|
|
2337
2339
|
f.style.cssText = `--height: ${b.offsetHeight + y}px`;
|
|
2338
|
-
const _ = parseInt(f.style.cssText.replace("--height:", "").trim()), G = parseInt(getComputedStyle(a).maxHeight),
|
|
2340
|
+
const _ = parseInt(f.style.cssText.replace("--height:", "").trim()), G = parseInt(getComputedStyle(a).maxHeight), D = () => {
|
|
2339
2341
|
s = g + e.s.subDropdownTotalH, o = s > G ? G : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
|
|
2340
2342
|
};
|
|
2341
|
-
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= _,
|
|
2343
|
+
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= _, D()) : (u.classList.add("open"), e.s.subDropdownTotalH += _, D());
|
|
2342
2344
|
const R = () => {
|
|
2343
2345
|
e.__scroller__.update(!0), f.removeEventListener("transitionend", R);
|
|
2344
2346
|
};
|
|
2345
2347
|
f.addEventListener("transitionend", R);
|
|
2346
2348
|
} else
|
|
2347
|
-
switch (
|
|
2349
|
+
switch (Ns(e), e.s.selectType) {
|
|
2348
2350
|
case "single":
|
|
2349
2351
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
|
2350
2352
|
const f = e.s.cityLang, b = l.textContent.trim(), y = document.getElementById(e.getAttribute("dist-select"));
|
|
2351
|
-
y && (y.querySelector(".dropdown-list").textContent = "", C(y, -1),
|
|
2352
|
-
const
|
|
2353
|
-
|
|
2353
|
+
y && (y.querySelector(".dropdown-list").textContent = "", C(y, -1), U[f][b].forEach((_, G) => {
|
|
2354
|
+
const D = document.createElement("li");
|
|
2355
|
+
D.textContent = _[0], D.setAttribute("data-option", _[0]), y.querySelector(".dropdown-list").append(D);
|
|
2354
2356
|
}), e.__events__.selectOption(y));
|
|
2355
2357
|
}
|
|
2356
2358
|
(m = u.parentNode.closest("li")) != null && m.classList.contains("has-sublayer") && (c.stopPropagation(), e.close());
|
|
@@ -2391,7 +2393,7 @@ Ot = new WeakSet(), $i = function() {
|
|
|
2391
2393
|
};
|
|
2392
2394
|
Object.assign(ki.prototype, O);
|
|
2393
2395
|
customElements.define("dropdown-el", ki);
|
|
2394
|
-
function
|
|
2396
|
+
function ut(n) {
|
|
2395
2397
|
const i = {};
|
|
2396
2398
|
return [...n.attributes].forEach((t) => {
|
|
2397
2399
|
if (t.name.includes("duration-")) {
|
|
@@ -2401,9 +2403,9 @@ function dt(n) {
|
|
|
2401
2403
|
}), Object.keys(i).length === 0 ? null : i;
|
|
2402
2404
|
}
|
|
2403
2405
|
function Be(n) {
|
|
2404
|
-
if (
|
|
2406
|
+
if (ut(n)) {
|
|
2405
2407
|
let i;
|
|
2406
|
-
const t = Object.keys(
|
|
2408
|
+
const t = Object.keys(ut(n)).map((e) => ({
|
|
2407
2409
|
value: e,
|
|
2408
2410
|
point: e
|
|
2409
2411
|
}));
|
|
@@ -2412,11 +2414,11 @@ function Be(n) {
|
|
|
2412
2414
|
const { point: s, value: o } = t[e];
|
|
2413
2415
|
window.matchMedia(`(max-width: ${o}px)`).matches && (i = s);
|
|
2414
2416
|
}
|
|
2415
|
-
return i ? Number(
|
|
2417
|
+
return i ? Number(ut(n)[i]) : n.s.options.duration;
|
|
2416
2418
|
} else
|
|
2417
2419
|
return n.s.options.duration;
|
|
2418
2420
|
}
|
|
2419
|
-
function
|
|
2421
|
+
function Ws(n) {
|
|
2420
2422
|
const { behavior: i, continual: t, gap: e } = n.s.options, s = n.childNodes, o = document.createElement("div"), a = document.createElement("div");
|
|
2421
2423
|
o.className = "animate-container", a.className = "animate-item", [...s].forEach((l) => {
|
|
2422
2424
|
a.append(l);
|
|
@@ -2427,7 +2429,7 @@ function zs(n) {
|
|
|
2427
2429
|
}
|
|
2428
2430
|
n.s.animation = null, n.s.animateEl = a, n.textContent = "", o.append(a), n.append(o), a.clientWidth * 2 + e >= n.clientWidth ? i === "normal" && t && o.append(r()) : n.s.options.continual = !1;
|
|
2429
2431
|
}
|
|
2430
|
-
function
|
|
2432
|
+
function $(n) {
|
|
2431
2433
|
const { behavior: i, direction: t, continual: e } = n.s.options;
|
|
2432
2434
|
let s = {};
|
|
2433
2435
|
switch (i) {
|
|
@@ -2483,20 +2485,20 @@ function k(n) {
|
|
|
2483
2485
|
}
|
|
2484
2486
|
return s;
|
|
2485
2487
|
}
|
|
2486
|
-
function
|
|
2488
|
+
function Bs(n) {
|
|
2487
2489
|
let i;
|
|
2488
2490
|
return function(t) {
|
|
2489
2491
|
i && clearTimeout(i), i = setTimeout(n, 200, t);
|
|
2490
2492
|
};
|
|
2491
2493
|
}
|
|
2492
|
-
var
|
|
2493
|
-
class
|
|
2494
|
+
var Wt, Mi, Bt, qi, Gt, Ii, Rt, Oi;
|
|
2495
|
+
class Gs extends HTMLElement {
|
|
2494
2496
|
constructor() {
|
|
2495
2497
|
super();
|
|
2496
|
-
h(this, zt);
|
|
2497
2498
|
h(this, Wt);
|
|
2498
2499
|
h(this, Bt);
|
|
2499
2500
|
h(this, Gt);
|
|
2501
|
+
h(this, Rt);
|
|
2500
2502
|
this.initialize = !1;
|
|
2501
2503
|
}
|
|
2502
2504
|
static get observedAttributes() {
|
|
@@ -2505,7 +2507,7 @@ class Bs extends HTMLElement {
|
|
|
2505
2507
|
attributeChangedCallback(t, e, s) {
|
|
2506
2508
|
}
|
|
2507
2509
|
connectedCallback() {
|
|
2508
|
-
this.initialize || (this.initialize = !0, d(this,
|
|
2510
|
+
this.initialize || (this.initialize = !0, d(this, Wt, Mi).call(this));
|
|
2509
2511
|
}
|
|
2510
2512
|
play() {
|
|
2511
2513
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
|
@@ -2514,7 +2516,7 @@ class Bs extends HTMLElement {
|
|
|
2514
2516
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
|
2515
2517
|
}
|
|
2516
2518
|
}
|
|
2517
|
-
|
|
2519
|
+
Wt = new WeakSet(), Mi = function() {
|
|
2518
2520
|
const t = {
|
|
2519
2521
|
direction: this.getAttribute("direction") || x.SETTINGS.direction,
|
|
2520
2522
|
// up / down / left / right
|
|
@@ -2522,7 +2524,7 @@ zt = new WeakSet(), Mi = function() {
|
|
|
2522
2524
|
// normal / alternate / endStop
|
|
2523
2525
|
duration: Number(this.getAttribute("duration")) || x.SETTINGS.duration,
|
|
2524
2526
|
// ms
|
|
2525
|
-
durationBreakpoints:
|
|
2527
|
+
durationBreakpoints: ut(this) || x.SETTINGS.durationBreakpoints,
|
|
2526
2528
|
autoplay: this.getAttribute("autoplay") || x.SETTINGS.autoplay,
|
|
2527
2529
|
// normal / alternate / endStop
|
|
2528
2530
|
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : x.SETTINGS.pauseOnMouseenter,
|
|
@@ -2531,8 +2533,8 @@ zt = new WeakSet(), Mi = function() {
|
|
|
2531
2533
|
// true / false
|
|
2532
2534
|
gap: Number(this.getAttribute("gap")) || x.SETTINGS.gap
|
|
2533
2535
|
};
|
|
2534
|
-
this.s = {}, this.s.options = t, this.s.nowDuration = Be(this),
|
|
2535
|
-
},
|
|
2536
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = Be(this), Ws(this), d(this, Bt, qi).call(this);
|
|
2537
|
+
}, Bt = new WeakSet(), qi = function() {
|
|
2536
2538
|
const { direction: t, continual: e, gap: s } = this.s.options;
|
|
2537
2539
|
switch (t) {
|
|
2538
2540
|
case "left":
|
|
@@ -2544,17 +2546,17 @@ zt = new WeakSet(), Mi = function() {
|
|
|
2544
2546
|
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;`;
|
|
2545
2547
|
break;
|
|
2546
2548
|
}
|
|
2547
|
-
d(this,
|
|
2548
|
-
},
|
|
2549
|
+
d(this, Gt, Ii).call(this), d(this, Rt, Oi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
|
|
2550
|
+
}, Gt = new WeakSet(), Ii = function() {
|
|
2549
2551
|
const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
|
|
2550
2552
|
let c;
|
|
2551
2553
|
function u() {
|
|
2552
2554
|
switch (s) {
|
|
2553
2555
|
case "normal":
|
|
2554
|
-
t.s.animateEl.style.transform = `${
|
|
2556
|
+
t.s.animateEl.style.transform = `${$(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate($(t).animate1, {
|
|
2555
2557
|
duration: t.s.nowDuration,
|
|
2556
2558
|
iterations: 1 / 0
|
|
2557
|
-
}), l && (t.s.cloneAnimateEl.style.transform = `${
|
|
2559
|
+
}), l && (t.s.cloneAnimateEl.style.transform = `${$(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate($(t).animate2, {
|
|
2558
2560
|
duration: t.s.nowDuration,
|
|
2559
2561
|
delay: -t.s.nowDuration / 2,
|
|
2560
2562
|
iterations: 1 / 0
|
|
@@ -2583,7 +2585,7 @@ zt = new WeakSet(), Mi = function() {
|
|
|
2583
2585
|
duration: g,
|
|
2584
2586
|
fill: "forwards"
|
|
2585
2587
|
}).finished.then(() => {
|
|
2586
|
-
t.s.animation = t.s.animateEl.animate(
|
|
2588
|
+
t.s.animation = t.s.animateEl.animate($(t).animate1, {
|
|
2587
2589
|
duration: t.s.nowDuration,
|
|
2588
2590
|
iterations: 1 / 0
|
|
2589
2591
|
});
|
|
@@ -2592,7 +2594,7 @@ zt = new WeakSet(), Mi = function() {
|
|
|
2592
2594
|
});
|
|
2593
2595
|
break;
|
|
2594
2596
|
case "endStop":
|
|
2595
|
-
t.s.animateEl.style.transform = `${
|
|
2597
|
+
t.s.animateEl.style.transform = `${$(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate($(t).animate1, {
|
|
2596
2598
|
duration: t.s.nowDuration,
|
|
2597
2599
|
fill: "forwards"
|
|
2598
2600
|
});
|
|
@@ -2610,37 +2612,37 @@ zt = new WeakSet(), Mi = function() {
|
|
|
2610
2612
|
}), t.addEventListener("mouseleave", function() {
|
|
2611
2613
|
t.s.animation && r && t.s.animation.playState === "paused" && t.play();
|
|
2612
2614
|
});
|
|
2613
|
-
},
|
|
2615
|
+
}, Rt = new WeakSet(), Oi = function() {
|
|
2614
2616
|
const t = this;
|
|
2615
2617
|
function e() {
|
|
2616
2618
|
const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
|
2617
|
-
t.s.nowDuration = Be(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(
|
|
2619
|
+
t.s.nowDuration = Be(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate($(t).animate1, {
|
|
2618
2620
|
duration: t.s.nowDuration,
|
|
2619
2621
|
iterations: 1 / 0
|
|
2620
|
-
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(
|
|
2622
|
+
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate($(t).animate2, {
|
|
2621
2623
|
duration: t.s.nowDuration,
|
|
2622
2624
|
delay: -t.s.nowDuration / 2,
|
|
2623
2625
|
iterations: 1 / 0
|
|
2624
2626
|
}), t.s.cloneAnimation.startTime = o);
|
|
2625
2627
|
}
|
|
2626
|
-
window.addEventListener("resize",
|
|
2628
|
+
window.addEventListener("resize", Bs(e));
|
|
2627
2629
|
};
|
|
2628
|
-
customElements.define("marquee-el",
|
|
2629
|
-
const
|
|
2630
|
+
customElements.define("marquee-el", Gs);
|
|
2631
|
+
const mt = function(n, i) {
|
|
2630
2632
|
let t;
|
|
2631
2633
|
return function(e) {
|
|
2632
2634
|
t && clearTimeout(t), t = setTimeout(n, 200, e);
|
|
2633
2635
|
};
|
|
2634
|
-
},
|
|
2635
|
-
if (
|
|
2636
|
+
}, k = (n, i) => {
|
|
2637
|
+
if (lt(n)) {
|
|
2636
2638
|
n.forEach((t) => {
|
|
2637
2639
|
t.classList.add(i);
|
|
2638
2640
|
});
|
|
2639
2641
|
return;
|
|
2640
2642
|
}
|
|
2641
2643
|
n.classList.add(i);
|
|
2642
|
-
},
|
|
2643
|
-
if (
|
|
2644
|
+
}, T = (n, i) => {
|
|
2645
|
+
if (lt(n)) {
|
|
2644
2646
|
n.forEach((t) => {
|
|
2645
2647
|
t.classList.remove(i);
|
|
2646
2648
|
});
|
|
@@ -2648,22 +2650,22 @@ const pt = function(n, i) {
|
|
|
2648
2650
|
}
|
|
2649
2651
|
n.classList.remove(i);
|
|
2650
2652
|
};
|
|
2651
|
-
var
|
|
2653
|
+
var Xt, Ni, Ft, Pi, Yt, ji, et, ke, W, ht, Ut, zi;
|
|
2652
2654
|
class Ge {
|
|
2653
2655
|
constructor(i) {
|
|
2654
2656
|
// 初始化
|
|
2655
|
-
h(this, Rt);
|
|
2656
|
-
// 左右箭頭事件綁定
|
|
2657
2657
|
h(this, Xt);
|
|
2658
|
-
//
|
|
2658
|
+
// 左右箭頭事件綁定
|
|
2659
2659
|
h(this, Ft);
|
|
2660
|
+
// 左右拖拉事件綁定
|
|
2661
|
+
h(this, Yt);
|
|
2660
2662
|
// 卷軸位置判斷
|
|
2661
|
-
h(this,
|
|
2663
|
+
h(this, et);
|
|
2662
2664
|
// 隱藏按鈕判斷
|
|
2663
2665
|
h(this, W);
|
|
2664
2666
|
// 選項事件綁定
|
|
2665
|
-
h(this,
|
|
2666
|
-
this.$element = i, this.option = i.s.option.drag, d(this,
|
|
2667
|
+
h(this, Ut);
|
|
2668
|
+
this.$element = i, this.option = i.s.option.drag, d(this, Xt, Ni).call(this);
|
|
2667
2669
|
}
|
|
2668
2670
|
// 更新 active 位置
|
|
2669
2671
|
update(i) {
|
|
@@ -2677,7 +2679,7 @@ class Ge {
|
|
|
2677
2679
|
}
|
|
2678
2680
|
}
|
|
2679
2681
|
}
|
|
2680
|
-
|
|
2682
|
+
Xt = new WeakSet(), Ni = function() {
|
|
2681
2683
|
var e, s, o, a, r, l;
|
|
2682
2684
|
const i = this;
|
|
2683
2685
|
if (!i.$element)
|
|
@@ -2685,10 +2687,10 @@ Rt = new WeakSet(), Ni = function() {
|
|
|
2685
2687
|
i.$container = i.$element.querySelector(".drag-container"), i.$wrapper = i.$container.querySelector(".wrapper");
|
|
2686
2688
|
const t = () => {
|
|
2687
2689
|
var c, u;
|
|
2688
|
-
d(c = i,
|
|
2690
|
+
d(c = i, et, ke).call(c), d(u = i, W, ht).call(u);
|
|
2689
2691
|
};
|
|
2690
|
-
i.$wrapper.removeEventListener("scroll", t), i.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize",
|
|
2691
|
-
|
|
2692
|
+
i.$wrapper.removeEventListener("scroll", t), i.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize", mt(t)), window.addEventListener("resize", mt(t)), (i.option.draggable || i.$element.s.type == "collapse") && d(e = i, Yt, ji).call(e), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
|
2693
|
+
A.prepend,
|
|
2692
2694
|
`<div class="navigation">
|
|
2693
2695
|
<div class="button prev">
|
|
2694
2696
|
<div></div>
|
|
@@ -2697,8 +2699,8 @@ Rt = new WeakSet(), Ni = function() {
|
|
|
2697
2699
|
<div></div>
|
|
2698
2700
|
</div>
|
|
2699
2701
|
</div>`
|
|
2700
|
-
), i.$button = (s = i.$container) == null ? void 0 : s.querySelectorAll(".button"), d(o = i,
|
|
2701
|
-
},
|
|
2702
|
+
), i.$button = (s = i.$container) == null ? void 0 : s.querySelectorAll(".button"), d(o = i, Ft, Pi).call(o)), d(a = i, et, ke).call(a), d(r = i, W, ht).call(r), d(l = i, Ut, zi).call(l), i.update();
|
|
2703
|
+
}, Ft = new WeakSet(), Pi = function() {
|
|
2702
2704
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
|
2703
2705
|
const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
|
|
2704
2706
|
t.scrollTo({
|
|
@@ -2706,13 +2708,13 @@ Rt = new WeakSet(), Ni = function() {
|
|
|
2706
2708
|
behavior: "smooth"
|
|
2707
2709
|
}), setTimeout(() => {
|
|
2708
2710
|
var r;
|
|
2709
|
-
d(r = i, W,
|
|
2711
|
+
d(r = i, W, ht).call(r);
|
|
2710
2712
|
}, 100);
|
|
2711
2713
|
};
|
|
2712
2714
|
e.forEach((o) => {
|
|
2713
2715
|
o.removeEventListener("click", s), o.addEventListener("click", s);
|
|
2714
2716
|
});
|
|
2715
|
-
},
|
|
2717
|
+
}, Yt = new WeakSet(), ji = function() {
|
|
2716
2718
|
const { $wrapper: i } = this;
|
|
2717
2719
|
let t = !1, e = !1, s = 0, o = 0;
|
|
2718
2720
|
const a = function(p) {
|
|
@@ -2742,32 +2744,32 @@ Rt = new WeakSet(), Ni = function() {
|
|
|
2742
2744
|
i.querySelectorAll("a").forEach((p) => {
|
|
2743
2745
|
p.removeEventListener("click", u), p.addEventListener("click", u);
|
|
2744
2746
|
});
|
|
2745
|
-
},
|
|
2747
|
+
}, et = new WeakSet(), ke = function() {
|
|
2746
2748
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
|
|
2747
|
-
e <= 0 || (
|
|
2748
|
-
}, W = new WeakSet(),
|
|
2749
|
+
e <= 0 || (k(i, "scrollable"), s == 0 ? (T(i, "scrollable"), k(t, "start"), T(t, "end")) : s + 1 >= e ? (T(i, "scrollable"), T(t, "start"), k(t, "end")) : (k(t, "center"), T(t, "start"), T(t, "end")));
|
|
2750
|
+
}, W = new WeakSet(), ht = function() {
|
|
2749
2751
|
const { $wrapper: i, $button: t, $element: e } = this;
|
|
2750
2752
|
if (!t)
|
|
2751
2753
|
return;
|
|
2752
2754
|
const s = i.scrollWidth - i.clientWidth, o = i.scrollLeft;
|
|
2753
2755
|
if (s <= 0) {
|
|
2754
|
-
|
|
2756
|
+
k(t, "hide"), T(t, "active"), k(e, "noScrollable");
|
|
2755
2757
|
return;
|
|
2756
2758
|
}
|
|
2757
|
-
s > 0 && (
|
|
2759
|
+
s > 0 && (k(t, "active"), T(e, "noScrollable")), o == 0 ? t.forEach((a) => {
|
|
2758
2760
|
if (a.classList.contains("next")) {
|
|
2759
|
-
|
|
2761
|
+
T(a, "hide");
|
|
2760
2762
|
return;
|
|
2761
2763
|
}
|
|
2762
|
-
|
|
2764
|
+
k(a, "hide");
|
|
2763
2765
|
}) : o + 1 >= s ? t.forEach((a) => {
|
|
2764
2766
|
if (a.classList.contains("next")) {
|
|
2765
|
-
|
|
2767
|
+
k(a, "hide");
|
|
2766
2768
|
return;
|
|
2767
2769
|
}
|
|
2768
|
-
|
|
2769
|
-
}) :
|
|
2770
|
-
},
|
|
2770
|
+
T(a, "hide");
|
|
2771
|
+
}) : T(t, "hide");
|
|
2772
|
+
}, Ut = new WeakSet(), zi = function() {
|
|
2771
2773
|
const { $element: i } = this, t = (s) => {
|
|
2772
2774
|
if (this.option.selected) {
|
|
2773
2775
|
const o = s.getAttribute("data-option").trim();
|
|
@@ -2781,31 +2783,31 @@ Rt = new WeakSet(), Ni = function() {
|
|
|
2781
2783
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
|
2782
2784
|
});
|
|
2783
2785
|
};
|
|
2784
|
-
var
|
|
2785
|
-
class
|
|
2786
|
+
var Jt, Wi, Zt, Bi, Qt, Gi, Vt, Ri;
|
|
2787
|
+
class Rs {
|
|
2786
2788
|
constructor(i) {
|
|
2787
2789
|
// 初始化
|
|
2788
|
-
h(this, Ut);
|
|
2789
|
-
// 隱藏按鈕判斷
|
|
2790
2790
|
h(this, Jt);
|
|
2791
|
-
//
|
|
2791
|
+
// 隱藏按鈕判斷
|
|
2792
2792
|
h(this, Zt);
|
|
2793
|
-
//
|
|
2793
|
+
// 展開箭頭事件綁定
|
|
2794
2794
|
h(this, Qt);
|
|
2795
|
-
|
|
2795
|
+
// 選項事件綁定
|
|
2796
|
+
h(this, Vt);
|
|
2797
|
+
this.$element = i, this.option = i.s.option.collapse, d(this, Jt, Wi).call(this);
|
|
2796
2798
|
}
|
|
2797
2799
|
}
|
|
2798
|
-
|
|
2799
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this,
|
|
2800
|
-
},
|
|
2800
|
+
Jt = new WeakSet(), Wi = function() {
|
|
2801
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, Zt, Bi).call(this) && d(this, Qt, Gi).call(this), d(this, Vt, Ri).call(this));
|
|
2802
|
+
}, Zt = new WeakSet(), Bi = function() {
|
|
2801
2803
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
|
2802
|
-
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(
|
|
2803
|
-
},
|
|
2804
|
+
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(A.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), T(this.$element, "noScrollable"), !0) : (k(this.$element, "noScrollable"), !1);
|
|
2805
|
+
}, Qt = new WeakSet(), Gi = function() {
|
|
2804
2806
|
const { $element: i, $button: t } = this, e = function() {
|
|
2805
2807
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
|
2806
2808
|
};
|
|
2807
2809
|
t.removeEventListener("click", e), t.addEventListener("click", e);
|
|
2808
|
-
},
|
|
2810
|
+
}, Vt = new WeakSet(), Ri = function() {
|
|
2809
2811
|
const { $element: i } = this, t = (s, o) => {
|
|
2810
2812
|
if (i != null && i.classList.contains("expand") ? i == null || i.classList.remove("expand") : i == null || i.classList.add("expand"), this.option.selected) {
|
|
2811
2813
|
const a = s.getAttribute("data-option").trim();
|
|
@@ -2819,18 +2821,18 @@ Ut = new WeakSet(), Wi = function() {
|
|
|
2819
2821
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
|
2820
2822
|
});
|
|
2821
2823
|
};
|
|
2822
|
-
const
|
|
2824
|
+
const Xs = (n) => {
|
|
2823
2825
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
|
2824
|
-
return i == "drag" && (s.innerHTML = H.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(
|
|
2826
|
+
return i == "drag" && (s.innerHTML = H.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(A.append, e)), i == "collapse" && (s.innerHTML = H.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(A.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(A.append, e)), i == "dropdown" && (s.innerHTML = H.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(A.append, e)), s.children;
|
|
2825
2827
|
};
|
|
2826
|
-
var
|
|
2827
|
-
class
|
|
2828
|
+
var Kt, Xi, te, Fi, it, $e, B, pt;
|
|
2829
|
+
class Fs extends HTMLElement {
|
|
2828
2830
|
constructor() {
|
|
2829
2831
|
super();
|
|
2830
|
-
h(this, Vt);
|
|
2831
2832
|
h(this, Kt);
|
|
2833
|
+
h(this, te);
|
|
2832
2834
|
// 斷點設定
|
|
2833
|
-
h(this,
|
|
2835
|
+
h(this, it);
|
|
2834
2836
|
// check type
|
|
2835
2837
|
h(this, B);
|
|
2836
2838
|
this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
|
@@ -2844,7 +2846,7 @@ class Xs extends HTMLElement {
|
|
|
2844
2846
|
case "m4-type":
|
|
2845
2847
|
if (e === null || e === s)
|
|
2846
2848
|
return;
|
|
2847
|
-
this.s.type = s, d(this, B,
|
|
2849
|
+
this.s.type = s, d(this, B, pt).call(this);
|
|
2848
2850
|
break;
|
|
2849
2851
|
case "m4-status":
|
|
2850
2852
|
if (e === s)
|
|
@@ -2861,13 +2863,13 @@ class Xs extends HTMLElement {
|
|
|
2861
2863
|
}
|
|
2862
2864
|
}
|
|
2863
2865
|
connectedCallback() {
|
|
2864
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this,
|
|
2866
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, Kt, Xi).call(this));
|
|
2865
2867
|
}
|
|
2866
2868
|
update() {
|
|
2867
|
-
d(this,
|
|
2869
|
+
d(this, it, $e).call(this);
|
|
2868
2870
|
}
|
|
2869
2871
|
}
|
|
2870
|
-
|
|
2872
|
+
Kt = new WeakSet(), Xi = function() {
|
|
2871
2873
|
let t = {};
|
|
2872
2874
|
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? H.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
|
2873
2875
|
const e = (s) => {
|
|
@@ -2878,23 +2880,23 @@ Vt = new WeakSet(), Xi = function() {
|
|
|
2878
2880
|
}
|
|
2879
2881
|
this.update();
|
|
2880
2882
|
};
|
|
2881
|
-
window.removeEventListener("resize",
|
|
2882
|
-
},
|
|
2883
|
-
this.classList.add("m4-init"), d(this,
|
|
2884
|
-
},
|
|
2883
|
+
window.removeEventListener("resize", mt(e)), window.addEventListener("resize", mt(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, H.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, H.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, H.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, H.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, te, Fi).call(this);
|
|
2884
|
+
}, te = new WeakSet(), Fi = function() {
|
|
2885
|
+
this.classList.add("m4-init"), d(this, it, $e).call(this);
|
|
2886
|
+
}, it = new WeakSet(), $e = function() {
|
|
2885
2887
|
const t = Object.keys(this.s.option.breakpoint);
|
|
2886
2888
|
if (!t.length) {
|
|
2887
|
-
d(this, B,
|
|
2889
|
+
d(this, B, pt).call(this);
|
|
2888
2890
|
return;
|
|
2889
2891
|
}
|
|
2890
2892
|
t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
|
|
2891
2893
|
var s, o, a, r;
|
|
2892
|
-
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, B,
|
|
2894
|
+
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, B, pt).call(this), window.innerWidth >= e;
|
|
2893
2895
|
});
|
|
2894
|
-
}, B = new WeakSet(),
|
|
2896
|
+
}, B = new WeakSet(), pt = function() {
|
|
2895
2897
|
var o;
|
|
2896
2898
|
const { type: t } = this.s;
|
|
2897
|
-
this.innerHTML = "", [...
|
|
2899
|
+
this.innerHTML = "", [...Xs(this)].forEach((a) => {
|
|
2898
2900
|
this.append(a);
|
|
2899
2901
|
});
|
|
2900
2902
|
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")}"]`);
|
|
@@ -2903,59 +2905,59 @@ Vt = new WeakSet(), Xi = function() {
|
|
|
2903
2905
|
this.drag = new Ge(this);
|
|
2904
2906
|
break;
|
|
2905
2907
|
case "collapse":
|
|
2906
|
-
this.drag = new Ge(this), this.collapse = new
|
|
2908
|
+
this.drag = new Ge(this), this.collapse = new Rs(this);
|
|
2907
2909
|
break;
|
|
2908
2910
|
}
|
|
2909
2911
|
(o = this.drag) == null || o.update();
|
|
2910
2912
|
};
|
|
2911
|
-
customElements.define("multipurpose-nav",
|
|
2912
|
-
var
|
|
2913
|
+
customElements.define("multipurpose-nav", Fs);
|
|
2914
|
+
var ee, Ui, ie, Ji, st, xe, P, F, se, Zi, ne, Qi, oe, Vi, ae, Ki, re, ts, le, es, ce, is, de, ss, ue, ns, q, z, he, os, pe, as, me, rs, ge, ls;
|
|
2913
2915
|
class Yi extends HTMLElement {
|
|
2914
2916
|
// 定義組件的初始狀態
|
|
2915
2917
|
constructor(t, e) {
|
|
2916
2918
|
super();
|
|
2917
|
-
h(this, te);
|
|
2918
2919
|
h(this, ee);
|
|
2920
|
+
h(this, ie);
|
|
2919
2921
|
// 第一關 判斷數量以及id設定
|
|
2920
|
-
h(this,
|
|
2922
|
+
h(this, st);
|
|
2921
2923
|
// 第二關 id命名提醒
|
|
2922
2924
|
h(this, P);
|
|
2923
|
-
h(this, ie);
|
|
2924
2925
|
h(this, se);
|
|
2925
2926
|
h(this, ne);
|
|
2927
|
+
h(this, oe);
|
|
2926
2928
|
// 執行函式
|
|
2927
2929
|
// 移動至指定位置
|
|
2928
|
-
h(this, oe);
|
|
2929
|
-
// 移動
|
|
2930
2930
|
h(this, ae);
|
|
2931
|
-
//
|
|
2931
|
+
// 移動
|
|
2932
2932
|
h(this, re);
|
|
2933
|
-
//
|
|
2933
|
+
// 步驟狀態
|
|
2934
2934
|
h(this, le);
|
|
2935
|
-
//
|
|
2935
|
+
// next 按鈕狀態
|
|
2936
2936
|
h(this, ce);
|
|
2937
|
-
//
|
|
2937
|
+
// prev 按鈕狀態
|
|
2938
2938
|
h(this, de);
|
|
2939
|
+
// 頁籤狀態
|
|
2940
|
+
h(this, ue);
|
|
2939
2941
|
// 第三關各種元件判斷 及 執行
|
|
2940
2942
|
h(this, q);
|
|
2941
2943
|
// 消失動畫
|
|
2942
|
-
h(this, ue);
|
|
2943
|
-
// 出現動畫
|
|
2944
2944
|
h(this, he);
|
|
2945
|
-
//
|
|
2945
|
+
// 出現動畫
|
|
2946
2946
|
h(this, pe);
|
|
2947
|
-
//
|
|
2947
|
+
// 狀態
|
|
2948
2948
|
h(this, me);
|
|
2949
|
+
// resize
|
|
2950
|
+
h(this, ge);
|
|
2949
2951
|
}
|
|
2950
2952
|
// 當組件的屬性被更改時會被呼叫
|
|
2951
2953
|
static get observedAttributes() {
|
|
2952
2954
|
return ["t4-active"];
|
|
2953
2955
|
}
|
|
2954
2956
|
attributeChangedCallback(t, e, s) {
|
|
2955
|
-
t === "t4-active" && e !== s && d(this,
|
|
2957
|
+
t === "t4-active" && e !== s && d(this, me, rs).call(this, s);
|
|
2956
2958
|
}
|
|
2957
2959
|
connectedCallback() {
|
|
2958
|
-
this.classList.contains("t4-initialize") || d(this,
|
|
2960
|
+
this.classList.contains("t4-initialize") || d(this, ee, Ui).call(this);
|
|
2959
2961
|
}
|
|
2960
2962
|
// ------------- 我是分隔線呦 -------------
|
|
2961
2963
|
// 頁籤切換
|
|
@@ -2971,7 +2973,7 @@ class Yi extends HTMLElement {
|
|
|
2971
2973
|
e.activeTab = s, this.setAttribute("t4-active", s);
|
|
2972
2974
|
const o = d(this, P, F).call(this, s);
|
|
2973
2975
|
e.tabPanels.forEach((a, r) => {
|
|
2974
|
-
r === o ? d(this,
|
|
2976
|
+
r === o ? d(this, pe, as).call(this, r) : d(this, he, os).call(this, r);
|
|
2975
2977
|
});
|
|
2976
2978
|
}
|
|
2977
2979
|
// 外部呼叫方法 $0.goNext()
|
|
@@ -2986,10 +2988,10 @@ class Yi extends HTMLElement {
|
|
|
2986
2988
|
}
|
|
2987
2989
|
// 外部呼叫方法 $0.update()
|
|
2988
2990
|
update() {
|
|
2989
|
-
this.t.tabs = d(this,
|
|
2991
|
+
this.t.tabs = d(this, st, xe).call(this), cs(), console.log("tab update!!!!");
|
|
2990
2992
|
}
|
|
2991
2993
|
}
|
|
2992
|
-
|
|
2994
|
+
ee = new WeakSet(), Ui = function() {
|
|
2993
2995
|
const t = this.getAttribute("t4-name"), { SETTINGS: e } = Ue;
|
|
2994
2996
|
document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
|
|
2995
2997
|
tabs: [],
|
|
@@ -3009,14 +3011,14 @@ te = new WeakSet(), Ui = function() {
|
|
|
3009
3011
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
|
3010
3012
|
},
|
|
3011
3013
|
tabGroup: this.getAttribute("t4-group") || e.tabGroup
|
|
3012
|
-
}, this.__events__ = {}, this.t.tabs = d(this,
|
|
3013
|
-
},
|
|
3014
|
-
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this,
|
|
3014
|
+
}, this.__events__ = {}, this.t.tabs = d(this, st, xe).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, ie, Ji).call(this);
|
|
3015
|
+
}, ie = new WeakSet(), Ji = function() {
|
|
3016
|
+
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, se, Zi).call(this), this.t.recordUrl) {
|
|
3015
3017
|
const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
|
|
3016
3018
|
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
|
3017
3019
|
}
|
|
3018
|
-
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this,
|
|
3019
|
-
},
|
|
3020
|
+
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, ge, ls).call(this);
|
|
3021
|
+
}, st = new WeakSet(), xe = function() {
|
|
3020
3022
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
|
3021
3023
|
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) => {
|
|
3022
3024
|
s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
|
|
@@ -3026,19 +3028,19 @@ te = new WeakSet(), Ui = function() {
|
|
|
3026
3028
|
s.length > 1 && console.warn("有兩個相同id設定", s);
|
|
3027
3029
|
const o = s[0];
|
|
3028
3030
|
return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
|
|
3029
|
-
},
|
|
3031
|
+
}, se = new WeakSet(), Zi = function() {
|
|
3030
3032
|
const t = document.createElement("div");
|
|
3031
3033
|
t.classList.add("swiper-container");
|
|
3032
3034
|
const e = document.createElement("div");
|
|
3033
3035
|
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
|
|
3034
3036
|
e.appendChild(s.cloneNode(!0));
|
|
3035
|
-
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this,
|
|
3036
|
-
},
|
|
3037
|
+
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, ne, Qi).call(this);
|
|
3038
|
+
}, ne = new WeakSet(), Qi = function() {
|
|
3037
3039
|
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
|
|
3038
3040
|
t.style.overflow = "hidden", e.style.display = "flex";
|
|
3039
3041
|
const o = s.length * 100 + "%";
|
|
3040
3042
|
e.style.width = o;
|
|
3041
|
-
},
|
|
3043
|
+
}, oe = new WeakSet(), Vi = function(t) {
|
|
3042
3044
|
const { t: e } = this;
|
|
3043
3045
|
if (e.recordUrl === "true") {
|
|
3044
3046
|
const s = new URLSearchParams(document.location.search);
|
|
@@ -3046,28 +3048,28 @@ te = new WeakSet(), Ui = function() {
|
|
|
3046
3048
|
const o = `${window.location.pathname}?${s.toString()}`;
|
|
3047
3049
|
history.replaceState({ t4Id: t }, "", o);
|
|
3048
3050
|
}
|
|
3049
|
-
},
|
|
3051
|
+
}, ae = new WeakSet(), Ki = function() {
|
|
3050
3052
|
const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
|
|
3051
|
-
d(this,
|
|
3052
|
-
},
|
|
3053
|
+
d(this, re, ts).call(this, o);
|
|
3054
|
+
}, re = new WeakSet(), ts = function(t) {
|
|
3053
3055
|
window.scrollTo({
|
|
3054
3056
|
top: t,
|
|
3055
3057
|
behavior: "smooth"
|
|
3056
3058
|
});
|
|
3057
|
-
},
|
|
3059
|
+
}, le = new WeakSet(), es = function(t) {
|
|
3058
3060
|
let e = parseInt(t, 10) + 1;
|
|
3059
3061
|
this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
|
|
3060
|
-
},
|
|
3062
|
+
}, ce = new WeakSet(), is = function(t) {
|
|
3061
3063
|
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;
|
|
3062
3064
|
e.forEach((a) => {
|
|
3063
3065
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
|
3064
3066
|
});
|
|
3065
|
-
},
|
|
3067
|
+
}, de = new WeakSet(), ss = function(t) {
|
|
3066
3068
|
const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === 0;
|
|
3067
3069
|
e.forEach((a) => {
|
|
3068
3070
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
|
3069
3071
|
});
|
|
3070
|
-
},
|
|
3072
|
+
}, ue = new WeakSet(), ns = function(t, e) {
|
|
3071
3073
|
this.t.tabGroup === "true" ? this.t.tabs.forEach((s, o) => {
|
|
3072
3074
|
o == t ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
|
|
3073
3075
|
}) : this.t.tabs.forEach((s, o) => {
|
|
@@ -3076,25 +3078,25 @@ te = new WeakSet(), Ui = function() {
|
|
|
3076
3078
|
}, q = new WeakSet(), z = function(t, e, s) {
|
|
3077
3079
|
switch (t) {
|
|
3078
3080
|
case "step":
|
|
3079
|
-
|
|
3081
|
+
Te(this.t.step) && d(this, le, es).call(this, e);
|
|
3080
3082
|
break;
|
|
3081
3083
|
case "eventAnchor":
|
|
3082
|
-
this.t.anchor && d(this,
|
|
3084
|
+
this.t.anchor && d(this, ae, Ki).call(this);
|
|
3083
3085
|
break;
|
|
3084
3086
|
case "tabState":
|
|
3085
|
-
this.t.type == "normal" && d(this,
|
|
3087
|
+
this.t.type == "normal" && d(this, ue, ns).call(this, e, s);
|
|
3086
3088
|
break;
|
|
3087
3089
|
case "btnState":
|
|
3088
|
-
d(this,
|
|
3090
|
+
d(this, ce, is).call(this, e), d(this, de, ss).call(this, e);
|
|
3089
3091
|
break;
|
|
3090
3092
|
case "tabUrl":
|
|
3091
|
-
this.t.recordUrl === "true" && d(this,
|
|
3093
|
+
this.t.recordUrl === "true" && d(this, oe, Vi).call(this, e);
|
|
3092
3094
|
break;
|
|
3093
3095
|
default:
|
|
3094
3096
|
console.warn("請增加判斷,謝謝");
|
|
3095
3097
|
break;
|
|
3096
3098
|
}
|
|
3097
|
-
},
|
|
3099
|
+
}, he = new WeakSet(), os = function(t) {
|
|
3098
3100
|
const { t: e } = this;
|
|
3099
3101
|
this.t.transition;
|
|
3100
3102
|
const s = e.tabPanels[t];
|
|
@@ -3111,7 +3113,7 @@ te = new WeakSet(), Ui = function() {
|
|
|
3111
3113
|
s.style.display = "none";
|
|
3112
3114
|
break;
|
|
3113
3115
|
}
|
|
3114
|
-
},
|
|
3116
|
+
}, pe = new WeakSet(), as = function(t) {
|
|
3115
3117
|
const { duration: e, timing: s, delay: o } = this.t.transition, a = this.t.tabPanels[t];
|
|
3116
3118
|
let r;
|
|
3117
3119
|
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) {
|
|
@@ -3136,19 +3138,19 @@ te = new WeakSet(), Ui = function() {
|
|
|
3136
3138
|
console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
|
|
3137
3139
|
break;
|
|
3138
3140
|
}
|
|
3139
|
-
},
|
|
3141
|
+
}, me = new WeakSet(), rs = function(t) {
|
|
3140
3142
|
const e = d(this, P, F).call(this, t);
|
|
3141
3143
|
d(this, q, z).call(this, "step", e), d(this, q, z).call(this, "btnState", e), d(this, q, z).call(this, "tabState", e, t), d(this, q, z).call(this, "tabUrl", t), this.emit("change");
|
|
3142
|
-
},
|
|
3144
|
+
}, ge = new WeakSet(), ls = function() {
|
|
3143
3145
|
const t = this;
|
|
3144
3146
|
window.addEventListener(
|
|
3145
3147
|
"resize",
|
|
3146
|
-
|
|
3148
|
+
Ys(() => {
|
|
3147
3149
|
t.update();
|
|
3148
3150
|
}, 1e3)
|
|
3149
3151
|
);
|
|
3150
3152
|
};
|
|
3151
|
-
function
|
|
3153
|
+
function Ys(n, i = 1e3) {
|
|
3152
3154
|
let t;
|
|
3153
3155
|
return function(e) {
|
|
3154
3156
|
t && clearTimeout(t), t = setTimeout(n, i, e);
|
|
@@ -3190,53 +3192,53 @@ customElements.define("tab-el", Yi);
|
|
|
3190
3192
|
const Re = (n) => {
|
|
3191
3193
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e);
|
|
3192
3194
|
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";
|
|
3193
|
-
},
|
|
3195
|
+
}, Us = (n) => {
|
|
3194
3196
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
|
|
3195
3197
|
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";
|
|
3196
3198
|
};
|
|
3197
|
-
var
|
|
3198
|
-
class
|
|
3199
|
+
var nt, Ce, fe, ds, ve, us, ot, He;
|
|
3200
|
+
class Js {
|
|
3199
3201
|
constructor(i, t = {}) {
|
|
3200
|
-
h(this, st);
|
|
3201
|
-
h(this, ge);
|
|
3202
|
-
h(this, fe);
|
|
3203
3202
|
h(this, nt);
|
|
3204
|
-
|
|
3203
|
+
h(this, fe);
|
|
3204
|
+
h(this, ve);
|
|
3205
|
+
h(this, ot);
|
|
3206
|
+
!rt(i) && !Te(i) && !lt(i) && !w(i) || (this.__storage__ = {
|
|
3205
3207
|
el: i,
|
|
3206
3208
|
options: t
|
|
3207
|
-
}, this.active = "data-collapse-active", d(this,
|
|
3209
|
+
}, this.active = "data-collapse-active", d(this, nt, Ce).call(this));
|
|
3208
3210
|
}
|
|
3209
3211
|
update() {
|
|
3210
|
-
d(this,
|
|
3212
|
+
d(this, nt, Ce).call(this);
|
|
3211
3213
|
}
|
|
3212
3214
|
}
|
|
3213
|
-
|
|
3215
|
+
nt = new WeakSet(), Ce = function() {
|
|
3214
3216
|
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Je;
|
|
3215
|
-
if (this.elements = t.state == "not active" ?
|
|
3217
|
+
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
3216
3218
|
for (const [o, a] of Object.entries(this.options.on))
|
|
3217
3219
|
this.__events__[o] = [a];
|
|
3218
|
-
d(this,
|
|
3219
|
-
},
|
|
3220
|
+
d(this, fe, ds).call(this);
|
|
3221
|
+
}, fe = new WeakSet(), ds = function() {
|
|
3220
3222
|
const { elements: i, options: t } = this;
|
|
3221
3223
|
i.forEach((e) => {
|
|
3222
|
-
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,
|
|
3224
|
+
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, ve, us).call(this, e);
|
|
3223
3225
|
}), this.emit("init");
|
|
3224
|
-
},
|
|
3226
|
+
}, ve = new WeakSet(), us = function(i) {
|
|
3225
3227
|
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
|
|
3226
|
-
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,
|
|
3228
|
+
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, ot, He)), c.addEventListener("click", d(this, ot, He)), r) {
|
|
3227
3229
|
const p = (g) => {
|
|
3228
3230
|
g.stopPropagation();
|
|
3229
3231
|
};
|
|
3230
3232
|
u.removeEventListener("click", p), u.addEventListener("click", p);
|
|
3231
3233
|
}
|
|
3232
|
-
},
|
|
3234
|
+
}, ot = new WeakSet(), He = function() {
|
|
3233
3235
|
const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
|
|
3234
3236
|
r.classList.contains(e) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
|
|
3235
3237
|
Re(l);
|
|
3236
|
-
}),
|
|
3238
|
+
}), Us(r)) : Re(r), i.emit("afterCollapse");
|
|
3237
3239
|
};
|
|
3238
|
-
Object.assign(
|
|
3239
|
-
function
|
|
3240
|
+
Object.assign(Js.prototype, O);
|
|
3241
|
+
function Zs(n, i) {
|
|
3240
3242
|
const t = i, { color: e, opacity: s, duration: o } = i.s.options;
|
|
3241
3243
|
let a = document.createElement("span"), r = n.clientX - t.getBoundingClientRect().left, l = n.clientY - t.getBoundingClientRect().top;
|
|
3242
3244
|
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() {
|
|
@@ -3249,25 +3251,25 @@ function hs() {
|
|
|
3249
3251
|
});
|
|
3250
3252
|
}
|
|
3251
3253
|
document.addEventListener("click", hs);
|
|
3252
|
-
var
|
|
3253
|
-
class
|
|
3254
|
+
var at, Me, be, ps, ye, ms, we, gs;
|
|
3255
|
+
class Qs extends HTMLElement {
|
|
3254
3256
|
constructor() {
|
|
3255
3257
|
super();
|
|
3256
|
-
h(this,
|
|
3257
|
-
h(this, ve);
|
|
3258
|
+
h(this, at);
|
|
3258
3259
|
h(this, be);
|
|
3259
3260
|
h(this, ye);
|
|
3261
|
+
h(this, we);
|
|
3260
3262
|
this.initialize = !1;
|
|
3261
3263
|
}
|
|
3262
3264
|
connectedCallback() {
|
|
3263
3265
|
const t = this;
|
|
3264
|
-
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this,
|
|
3266
|
+
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, at, Me).call(this));
|
|
3265
3267
|
}
|
|
3266
3268
|
update() {
|
|
3267
|
-
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this,
|
|
3269
|
+
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, at, Me).call(this);
|
|
3268
3270
|
}
|
|
3269
3271
|
}
|
|
3270
|
-
|
|
3272
|
+
at = new WeakSet(), Me = function() {
|
|
3271
3273
|
const { SETTINGS: t } = Ze;
|
|
3272
3274
|
this.s = {};
|
|
3273
3275
|
function e(o) {
|
|
@@ -3282,16 +3284,16 @@ ot = new WeakSet(), He = function() {
|
|
|
3282
3284
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
|
3283
3285
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
|
3284
3286
|
};
|
|
3285
|
-
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this,
|
|
3286
|
-
},
|
|
3287
|
-
d(this,
|
|
3288
|
-
},
|
|
3287
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, be, ps).call(this);
|
|
3288
|
+
}, be = new WeakSet(), ps = function() {
|
|
3289
|
+
d(this, ye, ms).call(this), d(this, we, gs).call(this), this.classList.add("r4-initialize");
|
|
3290
|
+
}, ye = new WeakSet(), ms = function() {
|
|
3289
3291
|
const t = this, e = document.createElement("i");
|
|
3290
3292
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
|
3291
|
-
},
|
|
3293
|
+
}, we = new WeakSet(), gs = function() {
|
|
3292
3294
|
const t = this.querySelector("i.hover-ball"), e = this;
|
|
3293
3295
|
e.addEventListener("click", function(a) {
|
|
3294
|
-
a.stopPropagation(), e.s.options.click &&
|
|
3296
|
+
a.stopPropagation(), e.s.options.click && Zs(a, e);
|
|
3295
3297
|
});
|
|
3296
3298
|
let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
|
|
3297
3299
|
e.addEventListener(s, function(a) {
|
|
@@ -3306,8 +3308,8 @@ ot = new WeakSet(), He = function() {
|
|
|
3306
3308
|
}
|
|
3307
3309
|
});
|
|
3308
3310
|
};
|
|
3309
|
-
customElements.define("ripple-btn",
|
|
3310
|
-
class
|
|
3311
|
+
customElements.define("ripple-btn", Qs);
|
|
3312
|
+
class Vs {
|
|
3311
3313
|
constructor() {
|
|
3312
3314
|
this.init();
|
|
3313
3315
|
}
|
|
@@ -3364,7 +3366,7 @@ function Xe(n, i) {
|
|
|
3364
3366
|
Function(n)(t, e);
|
|
3365
3367
|
} : i;
|
|
3366
3368
|
}
|
|
3367
|
-
function
|
|
3369
|
+
function Ks(n, i, t, e) {
|
|
3368
3370
|
const s = i.params, o = n.closest("[data-upload-item]").querySelector("[data-preview]");
|
|
3369
3371
|
o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(e.imgElement);
|
|
3370
3372
|
const a = n.dataset.group, r = document.querySelector(i.el).dataset.index;
|
|
@@ -3387,7 +3389,7 @@ function Vs(n, i, t, e) {
|
|
|
3387
3389
|
info: e
|
|
3388
3390
|
}, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
|
|
3389
3391
|
}
|
|
3390
|
-
function
|
|
3392
|
+
function tn(n, i, t, e) {
|
|
3391
3393
|
const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
|
|
3392
3394
|
let u = 0, p = 0;
|
|
3393
3395
|
switch (s.width = t, s.height = e, n.previewSize) {
|
|
@@ -3401,14 +3403,14 @@ function Ks(n, i, t, e) {
|
|
|
3401
3403
|
const g = (s.width - u) * 0.5, m = (s.height - p) * 0.5;
|
|
3402
3404
|
return o.drawImage(i, g, m, u, p), s;
|
|
3403
3405
|
}
|
|
3404
|
-
function
|
|
3406
|
+
function en(n, i) {
|
|
3405
3407
|
return new Promise((t, e) => {
|
|
3406
3408
|
if (i) {
|
|
3407
3409
|
const s = new Image();
|
|
3408
3410
|
s.src = i, s.classList.add(n.previewSize), s.onload = () => {
|
|
3409
3411
|
let o = {
|
|
3410
3412
|
imgElement: s,
|
|
3411
|
-
originalCanvas:
|
|
3413
|
+
originalCanvas: tn(n, s, s.width, s.height),
|
|
3412
3414
|
info: {
|
|
3413
3415
|
originalWidth: s.width,
|
|
3414
3416
|
originalHeight: s.height,
|
|
@@ -3421,31 +3423,31 @@ function tn(n, i) {
|
|
|
3421
3423
|
t();
|
|
3422
3424
|
});
|
|
3423
3425
|
}
|
|
3424
|
-
function
|
|
3426
|
+
function sn(n, i) {
|
|
3425
3427
|
const t = Math.pow(10, i);
|
|
3426
3428
|
return Math.round(n * t) / t;
|
|
3427
3429
|
}
|
|
3428
|
-
function
|
|
3430
|
+
function nn(n, i) {
|
|
3429
3431
|
let t = n.size / 1024 / 1024;
|
|
3430
|
-
return `${
|
|
3432
|
+
return `${sn(t, 2)}` <= i;
|
|
3431
3433
|
}
|
|
3432
|
-
function
|
|
3434
|
+
function on(n, i, t) {
|
|
3433
3435
|
if (n.target.files.length <= 0)
|
|
3434
3436
|
return;
|
|
3435
3437
|
const e = n.target.files[0], s = i.closest("[data-upload-item]");
|
|
3436
3438
|
let o = new FileReader();
|
|
3437
3439
|
o.onload = (a) => {
|
|
3438
3440
|
const r = e.type.split("/")[0] === "image" ? a.target.result : null;
|
|
3439
|
-
if (t.params.sizeLimit && !
|
|
3441
|
+
if (t.params.sizeLimit && !nn(e, t.params.sizeLimit)) {
|
|
3440
3442
|
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);
|
|
3441
3443
|
return;
|
|
3442
3444
|
} else
|
|
3443
|
-
s.classList.remove("over-limit"), s.classList.add("uploaded"),
|
|
3444
|
-
|
|
3445
|
+
s.classList.remove("over-limit"), s.classList.add("uploaded"), en(t.params, r).then((l) => {
|
|
3446
|
+
Ks(i, t, e, l);
|
|
3445
3447
|
});
|
|
3446
3448
|
}, o.readAsDataURL(e);
|
|
3447
3449
|
}
|
|
3448
|
-
class
|
|
3450
|
+
class an {
|
|
3449
3451
|
constructor(i, t) {
|
|
3450
3452
|
const e = this;
|
|
3451
3453
|
e.el = i, e.params = {
|
|
@@ -3478,62 +3480,62 @@ class on {
|
|
|
3478
3480
|
}
|
|
3479
3481
|
};
|
|
3480
3482
|
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) {
|
|
3481
|
-
|
|
3483
|
+
on(a, e, i);
|
|
3482
3484
|
});
|
|
3483
3485
|
}));
|
|
3484
3486
|
}
|
|
3485
3487
|
}
|
|
3486
3488
|
export {
|
|
3487
3489
|
Qe as A,
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
+
En as B,
|
|
3491
|
+
Js as C,
|
|
3490
3492
|
ki as D,
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3493
|
+
An as E,
|
|
3494
|
+
Ln as F,
|
|
3495
|
+
Sn as G,
|
|
3496
|
+
Dn as H,
|
|
3497
|
+
Vs as I,
|
|
3498
|
+
_n as J,
|
|
3499
|
+
kn as K,
|
|
3500
|
+
$n as L,
|
|
3501
|
+
J as M,
|
|
3502
|
+
xn as N,
|
|
3503
|
+
Cn as O,
|
|
3504
|
+
Hn as P,
|
|
3505
|
+
Mn as Q,
|
|
3506
|
+
Qs as R,
|
|
3507
|
+
qn as S,
|
|
3506
3508
|
Yi as T,
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3509
|
+
In as U,
|
|
3510
|
+
On as V,
|
|
3511
|
+
Nn as W,
|
|
3512
|
+
Pn as X,
|
|
3513
|
+
jn as Y,
|
|
3512
3514
|
w as a,
|
|
3513
|
-
|
|
3515
|
+
lt as b,
|
|
3514
3516
|
Ts as c,
|
|
3515
3517
|
ws as d,
|
|
3516
3518
|
Y as e,
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3519
|
+
A as f,
|
|
3520
|
+
S as g,
|
|
3521
|
+
gn as h,
|
|
3522
|
+
rt as i,
|
|
3521
3523
|
ui as j,
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3524
|
+
Gs as k,
|
|
3525
|
+
Fs as l,
|
|
3526
|
+
an as m,
|
|
3525
3527
|
Hs as n,
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
+
zn as o,
|
|
3529
|
+
fn as p,
|
|
3528
3530
|
Ei as q,
|
|
3529
3531
|
Ai as r,
|
|
3530
3532
|
ys as s,
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
+
vn as t,
|
|
3534
|
+
bn as u,
|
|
3533
3535
|
qs as v,
|
|
3534
|
-
|
|
3536
|
+
yn as w,
|
|
3535
3537
|
Cs as x,
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
+
wn as y,
|
|
3539
|
+
Tn as z
|
|
3538
3540
|
};
|
|
3539
3541
|
//# sourceMappingURL=image-preview-bundle.js.map
|