@xwadex/fesd 0.0.55 → 0.0.56
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 +647 -627
- package/dist/image-preview-bundle.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var Cs = Object.defineProperty;
|
|
2
|
+
var Hs = (n, i, t) => i in n ? Cs(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
|
|
3
|
+
var Je = (n, i, t) => (Hs(n, typeof i != "symbol" ? i + "" : i, t), t), Ms = (n, i, t) => {
|
|
4
4
|
if (!i.has(n))
|
|
5
5
|
throw TypeError("Cannot " + t);
|
|
6
6
|
};
|
|
@@ -9,15 +9,15 @@ var h = (n, i, t) => {
|
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
i instanceof WeakSet ? i.add(n) : i.set(n, t);
|
|
11
11
|
};
|
|
12
|
-
var d = (n, i, t) => (
|
|
13
|
-
import { OverlayScrollbars as ze } from "overlayscrollbars";
|
|
12
|
+
var d = (n, i, t) => (Ms(n, i, "access private method"), t);
|
|
14
13
|
import f from "jquery";
|
|
14
|
+
import { OverlayScrollbars as Xe } from "overlayscrollbars";
|
|
15
15
|
import "./vendor-bundle.js";
|
|
16
16
|
import "validator";
|
|
17
17
|
import "flatpickr";
|
|
18
|
-
import
|
|
19
|
-
import { lock as
|
|
20
|
-
const
|
|
18
|
+
import oi from "vanilla-lazyload";
|
|
19
|
+
import { lock as Is, unlock as qs } from "tua-body-scroll-lock";
|
|
20
|
+
const _e = {
|
|
21
21
|
SETTINGS: {
|
|
22
22
|
videoId: null,
|
|
23
23
|
videoType: null,
|
|
@@ -78,14 +78,14 @@ const Se = {
|
|
|
78
78
|
TEMPLATE() {
|
|
79
79
|
return '<div class="player-container"><div class="player-wrapper"></div></div>';
|
|
80
80
|
}
|
|
81
|
-
},
|
|
81
|
+
}, Os = {
|
|
82
82
|
SETTINGS: {
|
|
83
83
|
success: null,
|
|
84
84
|
text: null,
|
|
85
85
|
className: null,
|
|
86
86
|
duration: 1500
|
|
87
87
|
}
|
|
88
|
-
},
|
|
88
|
+
}, j = {
|
|
89
89
|
SETTINGS: {
|
|
90
90
|
target: null,
|
|
91
91
|
route: null,
|
|
@@ -135,7 +135,7 @@ const Se = {
|
|
|
135
135
|
gap: 30
|
|
136
136
|
// 跑馬燈內容之間的距離 - Number
|
|
137
137
|
}
|
|
138
|
-
},
|
|
138
|
+
}, Ye = {
|
|
139
139
|
SETTINGS: {
|
|
140
140
|
scrollbar: {
|
|
141
141
|
"scrollbar-track-color": "transparent",
|
|
@@ -163,7 +163,7 @@ const Se = {
|
|
|
163
163
|
</div>`;
|
|
164
164
|
return t || r;
|
|
165
165
|
}
|
|
166
|
-
},
|
|
166
|
+
}, Ps = {
|
|
167
167
|
SETTINGS: {
|
|
168
168
|
basic_rwd: 900,
|
|
169
169
|
markdownLink: !1,
|
|
@@ -172,7 +172,7 @@ const Se = {
|
|
|
172
172
|
navigation: !1,
|
|
173
173
|
scrollStep: !1
|
|
174
174
|
}
|
|
175
|
-
},
|
|
175
|
+
}, ai = {
|
|
176
176
|
SETTINGS: {
|
|
177
177
|
scroller: window,
|
|
178
178
|
class: "aost-show",
|
|
@@ -195,7 +195,7 @@ const Se = {
|
|
|
195
195
|
enter: null,
|
|
196
196
|
leave: null
|
|
197
197
|
}
|
|
198
|
-
},
|
|
198
|
+
}, vt = {
|
|
199
199
|
SETTINGS: {
|
|
200
200
|
target: null,
|
|
201
201
|
container: null,
|
|
@@ -255,7 +255,7 @@ const Se = {
|
|
|
255
255
|
return `<dropdown-el${n.placeholder ? ` d4-placeholder="${n.placeholder}"` : ""}${n.value ? ` d4-value="${n.value}"` : ""}></dropdown-el>`;
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
},
|
|
258
|
+
}, ri = {
|
|
259
259
|
SETTINGS: {
|
|
260
260
|
// 樣式 normal / process
|
|
261
261
|
type: "normal",
|
|
@@ -275,7 +275,7 @@ const Se = {
|
|
|
275
275
|
// 步驟狀態綁定
|
|
276
276
|
stepOutput: ".step-show"
|
|
277
277
|
}
|
|
278
|
-
},
|
|
278
|
+
}, li = {
|
|
279
279
|
SETTINGS: {
|
|
280
280
|
collapseClass: "collapse",
|
|
281
281
|
block: "[collapse-block]",
|
|
@@ -308,7 +308,7 @@ const Se = {
|
|
|
308
308
|
update: null,
|
|
309
309
|
afterUpdate: null
|
|
310
310
|
}
|
|
311
|
-
},
|
|
311
|
+
}, ci = {
|
|
312
312
|
SETTINGS: {
|
|
313
313
|
// 是否要加 hover 效果?
|
|
314
314
|
hover: !0,
|
|
@@ -323,40 +323,40 @@ const Se = {
|
|
|
323
323
|
// hover 毫秒 ?
|
|
324
324
|
speed: 600
|
|
325
325
|
}
|
|
326
|
-
},
|
|
326
|
+
}, Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
327
327
|
__proto__: null,
|
|
328
|
-
anchor4:
|
|
329
|
-
aost4:
|
|
330
|
-
article4:
|
|
331
|
-
collapse4:
|
|
332
|
-
dropdown4:
|
|
328
|
+
anchor4: vt,
|
|
329
|
+
aost4: ai,
|
|
330
|
+
article4: Ps,
|
|
331
|
+
collapse4: li,
|
|
332
|
+
dropdown4: Ye,
|
|
333
333
|
marquee4: M,
|
|
334
|
-
modal4:
|
|
334
|
+
modal4: j,
|
|
335
335
|
multipurpose4: q,
|
|
336
|
-
ripple4:
|
|
337
|
-
share4:
|
|
338
|
-
tab4:
|
|
339
|
-
video4:
|
|
340
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
336
|
+
ripple4: ci,
|
|
337
|
+
share4: Os,
|
|
338
|
+
tab4: ri,
|
|
339
|
+
video4: _e
|
|
340
|
+
}, Symbol.toStringTag, { value: "Module" })), L = {
|
|
341
341
|
before: "beforebegin",
|
|
342
342
|
after: "afterend",
|
|
343
343
|
append: "beforeend",
|
|
344
344
|
prepend: "afterbegin"
|
|
345
|
-
},
|
|
345
|
+
}, pt = (n) => typeof n == "string" && n !== "", xe = (n) => n instanceof HTMLElement, mt = (n) => n instanceof NodeList, A = (n) => D(n) !== null, G = (n) => typeof n == "function", D = (n) => xe(n) ? n : document.querySelector(n), k = (n) => mt(n) ? n : document.querySelectorAll(n), Ns = () => Math.random().toString(36).substr(2, 9), js = (n) => {
|
|
346
346
|
const i = document.createElement("div");
|
|
347
347
|
return i.innerHTML = n, i.childNodes;
|
|
348
|
-
},
|
|
348
|
+
}, zs = (n) => {
|
|
349
349
|
try {
|
|
350
350
|
JSON.parse(n);
|
|
351
351
|
} catch {
|
|
352
352
|
return n;
|
|
353
353
|
}
|
|
354
354
|
return JSON.parse(n);
|
|
355
|
-
},
|
|
355
|
+
}, E = (n, i) => {
|
|
356
356
|
console.warn(`[${n} warn]: ${i}`);
|
|
357
|
-
},
|
|
357
|
+
}, Ze = (n, i) => {
|
|
358
358
|
console.error(`[${n} error]: ${i}`);
|
|
359
|
-
},
|
|
359
|
+
}, z = {
|
|
360
360
|
on(n, i) {
|
|
361
361
|
if (!G(i))
|
|
362
362
|
return this;
|
|
@@ -387,7 +387,7 @@ const Se = {
|
|
|
387
387
|
G(s) && s.apply(this, e);
|
|
388
388
|
}), this) : this;
|
|
389
389
|
}
|
|
390
|
-
},
|
|
390
|
+
}, Bs = {
|
|
391
391
|
easeInOutCirc(n, i, t, e) {
|
|
392
392
|
return (n /= e / 2) < 1 ? -t / 2 * (Math.sqrt(1 - n * n) - 1) + i : t / 2 * (Math.sqrt(1 - (n -= 2) * n) + 1) + i;
|
|
393
393
|
},
|
|
@@ -397,33 +397,33 @@ const Se = {
|
|
|
397
397
|
easeOutQuart(n, i, t, e) {
|
|
398
398
|
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
|
399
399
|
}
|
|
400
|
-
},
|
|
401
|
-
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", g = c ? "width" : "height", m =
|
|
400
|
+
}, $e = (n, i) => {
|
|
401
|
+
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", g = c ? "width" : "height", m = A(e) ? D(e) : document.scrollingElement, v = m[u], w = A(t) ? D(t).getBoundingClientRect()[p] : 0 - v, b = A(s) ? D(s).getBoundingClientRect()[g] : 0, T = w - a - b, C = 15;
|
|
402
402
|
let y = 0;
|
|
403
403
|
if (T === 0)
|
|
404
404
|
return;
|
|
405
|
-
const
|
|
406
|
-
const
|
|
407
|
-
i && i.emit(
|
|
405
|
+
const S = (_) => {
|
|
406
|
+
const U = D(t);
|
|
407
|
+
i && i.emit(_, U), !i && n.on && G(n.on[_]) && n.on[_](U);
|
|
408
408
|
};
|
|
409
|
-
|
|
410
|
-
const
|
|
409
|
+
S("beforeScroll");
|
|
410
|
+
const O = () => {
|
|
411
411
|
y += C;
|
|
412
|
-
const
|
|
413
|
-
m[u] =
|
|
412
|
+
const _ = Bs[r](y, v, T, o);
|
|
413
|
+
m[u] = _, y < o && requestAnimationFrame(O), y >= o && S("afterScroll");
|
|
414
414
|
};
|
|
415
|
-
requestAnimationFrame(
|
|
415
|
+
requestAnimationFrame(O);
|
|
416
416
|
};
|
|
417
|
-
var
|
|
418
|
-
class
|
|
417
|
+
var tt, Ce, Tt, ui, Et, hi;
|
|
418
|
+
class di {
|
|
419
419
|
constructor(i, t = {}) {
|
|
420
|
-
h(this,
|
|
421
|
-
h(this,
|
|
422
|
-
h(this,
|
|
420
|
+
h(this, tt);
|
|
421
|
+
h(this, Tt);
|
|
422
|
+
h(this, Et);
|
|
423
423
|
this.__storage__ = {
|
|
424
424
|
el: i,
|
|
425
425
|
options: t
|
|
426
|
-
}, this.active = "data-anchor-active", d(this,
|
|
426
|
+
}, this.active = "data-anchor-active", d(this, tt, Ce).call(this);
|
|
427
427
|
}
|
|
428
428
|
destroy() {
|
|
429
429
|
const { elements: i } = this;
|
|
@@ -433,39 +433,39 @@ class oi {
|
|
|
433
433
|
}
|
|
434
434
|
update() {
|
|
435
435
|
var i;
|
|
436
|
-
return d(i = this.destroy(),
|
|
436
|
+
return d(i = this.destroy(), tt, Ce).call(i), this.emit("afterUpdate"), this;
|
|
437
437
|
}
|
|
438
438
|
static run(i) {
|
|
439
|
-
const { SETTINGS: t } =
|
|
439
|
+
const { SETTINGS: t } = vt, e = Object.assign({}, t, i);
|
|
440
440
|
setTimeout(() => {
|
|
441
|
-
|
|
441
|
+
$e(e);
|
|
442
442
|
}, e.delay);
|
|
443
443
|
}
|
|
444
444
|
static url(i) {
|
|
445
|
-
const { SETTINGS: t } =
|
|
445
|
+
const { SETTINGS: t } = vt, { 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()}"]`);
|
|
446
446
|
if (!a)
|
|
447
447
|
return;
|
|
448
448
|
const r = Object.assign({}, t, i, { target: a });
|
|
449
449
|
setTimeout(() => {
|
|
450
|
-
|
|
450
|
+
$e(r);
|
|
451
451
|
}, r.delay);
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
|
|
454
|
+
tt = new WeakSet(), Ce = function() {
|
|
455
455
|
const { el: i, options: t } = this.__storage__;
|
|
456
|
-
if (!
|
|
456
|
+
if (!pt(i) || !A(i))
|
|
457
457
|
return;
|
|
458
|
-
const { SETTINGS: e, EVENTS: s } =
|
|
459
|
-
if (this.elements = t.state == "not active" ?
|
|
458
|
+
const { SETTINGS: e, EVENTS: s } = vt;
|
|
459
|
+
if (this.elements = t.state == "not active" ? k(i + `:not([${this.active}])`) : k(i), this.elements = k(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
460
460
|
for (const [o, a] of Object.entries(this.options.on))
|
|
461
461
|
this.__events__[o] = [a];
|
|
462
|
-
d(this,
|
|
463
|
-
},
|
|
462
|
+
d(this, Tt, ui).call(this);
|
|
463
|
+
}, Tt = new WeakSet(), ui = function() {
|
|
464
464
|
const { elements: i, options: t } = this;
|
|
465
465
|
i.forEach((e) => {
|
|
466
|
-
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this,
|
|
466
|
+
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, Et, hi), e.anchor.defaultOptions = t, e.anchor.methods = {}, e.anchor.methods.destroy = this.destroy, e.anchor.methods.update = this.update, e.addEventListener("click", e.anchor.eventHandler), e.setAttribute(this.active, "");
|
|
467
467
|
}), this.emit("afterInit");
|
|
468
|
-
},
|
|
468
|
+
}, Et = new WeakSet(), hi = function() {
|
|
469
469
|
const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor, s = {
|
|
470
470
|
target: this.getAttribute("data-anchor-target") || i.target,
|
|
471
471
|
container: this.getAttribute("data-anchor-container") || i.container,
|
|
@@ -479,28 +479,28 @@ V = new WeakSet(), $e = function() {
|
|
|
479
479
|
this.removeEventListener("click", t), setTimeout(() => {
|
|
480
480
|
this.addEventListener("click", t);
|
|
481
481
|
}, s.speed), setTimeout(() => {
|
|
482
|
-
|
|
482
|
+
$e(s, e);
|
|
483
483
|
}, s.delay);
|
|
484
484
|
};
|
|
485
|
-
Object.assign(
|
|
485
|
+
Object.assign(di.prototype, z);
|
|
486
486
|
window.MODALS || (window.MODALS = {});
|
|
487
|
-
const { MODALS:
|
|
488
|
-
const { TEMPLATE: i } =
|
|
487
|
+
const { MODALS: P } = window, Ws = (n) => {
|
|
488
|
+
const { TEMPLATE: i } = j, { childDom: t } = n, e = document.createElement("div");
|
|
489
489
|
e.innerHTML = i(n.getAttribute("data-modal-template-setting"));
|
|
490
490
|
const s = e.querySelector(".modal-content");
|
|
491
491
|
return [...t].forEach((o) => {
|
|
492
492
|
s.append(o);
|
|
493
493
|
}), e.children[0];
|
|
494
494
|
};
|
|
495
|
-
var
|
|
496
|
-
class
|
|
495
|
+
var At, mi, Lt, gi, St, fi, Dt, vi, kt, bi;
|
|
496
|
+
class pi extends HTMLElement {
|
|
497
497
|
constructor() {
|
|
498
498
|
super();
|
|
499
|
-
h(this, wt);
|
|
500
|
-
h(this, Tt);
|
|
501
|
-
h(this, Et);
|
|
502
499
|
h(this, At);
|
|
503
500
|
h(this, Lt);
|
|
501
|
+
h(this, St);
|
|
502
|
+
h(this, Dt);
|
|
503
|
+
h(this, kt);
|
|
504
504
|
this.initialize = !1;
|
|
505
505
|
}
|
|
506
506
|
static get observedAttributes() {
|
|
@@ -509,12 +509,12 @@ class li extends HTMLElement {
|
|
|
509
509
|
attributeChangedCallback(t, e, s) {
|
|
510
510
|
switch (t) {
|
|
511
511
|
case ":state":
|
|
512
|
-
d(this,
|
|
512
|
+
d(this, kt, bi).call(this, s);
|
|
513
513
|
break;
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
516
|
connectedCallback() {
|
|
517
|
-
this.initialize || (this.initialize = !0, d(this,
|
|
517
|
+
this.initialize || (this.initialize = !0, d(this, At, mi).call(this));
|
|
518
518
|
}
|
|
519
519
|
open() {
|
|
520
520
|
return this.setAttribute(":state", "open"), this;
|
|
@@ -526,38 +526,38 @@ class li extends HTMLElement {
|
|
|
526
526
|
return this.setAttribute(":state", "destroy"), this;
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
|
|
530
|
-
const { ATTRS: t } =
|
|
529
|
+
At = new WeakSet(), mi = function() {
|
|
530
|
+
const { ATTRS: t } = j;
|
|
531
531
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
|
532
|
-
const e = this.getAttribute(t.id) ||
|
|
533
|
-
this.getAttribute(t.id) || (
|
|
534
|
-
},
|
|
535
|
-
this.childDom = this.childNodes, this.template =
|
|
536
|
-
},
|
|
532
|
+
const e = this.getAttribute(t.id) || Ns();
|
|
533
|
+
this.getAttribute(t.id) || (E(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), P[e] && E(`the ${t.id} "${e}" is already be used.`), P[e] = this, d(this, Lt, gi).call(this);
|
|
534
|
+
}, Lt = new WeakSet(), gi = function() {
|
|
535
|
+
this.childDom = this.childNodes, this.template = Ws(this), this.innerHTML = "", this.append(this.template), d(this, St, fi).call(this);
|
|
536
|
+
}, St = new WeakSet(), fi = function() {
|
|
537
537
|
const t = this.querySelector(".modal-scroller");
|
|
538
|
-
this.__scroller__ =
|
|
538
|
+
this.__scroller__ = Xe(t, {
|
|
539
539
|
overflowBehavior: {
|
|
540
540
|
x: "hidden"
|
|
541
541
|
},
|
|
542
542
|
autoUpdate: !0
|
|
543
|
-
}), window.modalScroll = this.__scroller__, d(this,
|
|
544
|
-
},
|
|
543
|
+
}), window.modalScroll = this.__scroller__, d(this, Dt, vi).call(this);
|
|
544
|
+
}, Dt = new WeakSet(), vi = function() {
|
|
545
545
|
var a, r, l;
|
|
546
|
-
const t = this, { ATTRS: e } =
|
|
546
|
+
const t = this, { ATTRS: e } = j, { close: s, destroy: o } = e;
|
|
547
547
|
(a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
|
|
548
548
|
c.addEventListener("click", function() {
|
|
549
549
|
const u = this.getAttribute(s);
|
|
550
|
-
(u &&
|
|
550
|
+
(u && P[u] ? P[u] : t).close();
|
|
551
551
|
});
|
|
552
552
|
}), (r = t.querySelectorAll(`[${o}]`)) == null || r.forEach((c) => {
|
|
553
553
|
c.addEventListener("click", function() {
|
|
554
554
|
const u = this.getAttribute(o);
|
|
555
|
-
(u &&
|
|
555
|
+
(u && P[u] ? P[u] : t).destroy();
|
|
556
556
|
});
|
|
557
557
|
}), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
|
|
558
558
|
c.stopPropagation();
|
|
559
559
|
});
|
|
560
|
-
},
|
|
560
|
+
}, kt = new WeakSet(), bi = function(t) {
|
|
561
561
|
const { __scroller__: e } = this;
|
|
562
562
|
if (t === "open") {
|
|
563
563
|
if (this.style.display = "block", e) {
|
|
@@ -582,28 +582,28 @@ wt = new WeakSet(), ci = function() {
|
|
|
582
582
|
if (t === "destroy") {
|
|
583
583
|
this.classList.remove("show");
|
|
584
584
|
const s = () => {
|
|
585
|
-
const { ATTRS: o } =
|
|
586
|
-
this.style.removeProperty("display"), this.emit("close"), this.remove(), this.emit("destroy"),
|
|
585
|
+
const { ATTRS: o } = j, a = this.getAttribute(o.id);
|
|
586
|
+
this.style.removeProperty("display"), this.emit("close"), this.remove(), this.emit("destroy"), P[a] && delete P[a];
|
|
587
587
|
};
|
|
588
588
|
this.addEventListener("transitionend", s);
|
|
589
589
|
}
|
|
590
590
|
};
|
|
591
|
-
Object.assign(
|
|
592
|
-
const { MODALS:
|
|
591
|
+
Object.assign(pi.prototype, z);
|
|
592
|
+
const { MODALS: Fe } = window, gt = {}, yi = (n, i, ...t) => {
|
|
593
593
|
if (!i)
|
|
594
594
|
return;
|
|
595
595
|
const e = n[i];
|
|
596
596
|
e && G(e) && e.apply(n, t);
|
|
597
|
-
},
|
|
598
|
-
n && G(n) && n.apply(
|
|
599
|
-
},
|
|
600
|
-
const { target: t } = n, e =
|
|
601
|
-
e &&
|
|
602
|
-
},
|
|
603
|
-
const { target: t, action: e, on: s, e: o } = n, a =
|
|
597
|
+
}, wi = (n, ...i) => {
|
|
598
|
+
n && G(n) && n.apply(V, i);
|
|
599
|
+
}, Qe = (n, i) => {
|
|
600
|
+
const { target: t } = n, e = Fe[t] || D(n.target);
|
|
601
|
+
e && Ti(n, i), e || Gs(n, i);
|
|
602
|
+
}, Ti = (n, i) => {
|
|
603
|
+
const { target: t, action: e, on: s, e: o } = n, a = Fe[t] || D(n.target);
|
|
604
604
|
switch (["open", "close", "destroy"].forEach((l) => {
|
|
605
605
|
a.once(l, () => {
|
|
606
|
-
i && (i.emit(l, a, o),
|
|
606
|
+
i && (i.emit(l, a, o), yi(i, s[l], a, o)), i || wi(s[l], a);
|
|
607
607
|
});
|
|
608
608
|
}), e) {
|
|
609
609
|
case "open":
|
|
@@ -620,34 +620,34 @@ const { MODALS: We } = window, ht = {}, mi = (n, i, ...t) => {
|
|
|
620
620
|
l === "close" && a.open(), l === "open" && a.close();
|
|
621
621
|
break;
|
|
622
622
|
}
|
|
623
|
-
},
|
|
623
|
+
}, Gs = async (n, i) => {
|
|
624
624
|
const { target: t, route: e, container: s, on: o, e: a } = n;
|
|
625
625
|
if (!e)
|
|
626
|
-
return
|
|
626
|
+
return E("modal4", "cannot find target or data-modal-route is not defined");
|
|
627
627
|
const r = (l, ...c) => {
|
|
628
|
-
i && (i.emit(l, ...c),
|
|
628
|
+
i && (i.emit(l, ...c), yi(i, o[l], ...c)), i || wi(o[l], ...c);
|
|
629
629
|
};
|
|
630
|
-
|
|
631
|
-
const c =
|
|
630
|
+
gt[t] || (gt[t] = !0, fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
|
|
631
|
+
const c = js(l), u = D(s) || D(j.SETTINGS.container);
|
|
632
632
|
[...c].forEach((g) => {
|
|
633
633
|
u.append(g);
|
|
634
634
|
});
|
|
635
|
-
const p =
|
|
636
|
-
r("complete", p),
|
|
635
|
+
const p = Fe[t] || D(n.target);
|
|
636
|
+
r("complete", p), Ti(n, i), delete gt[t];
|
|
637
637
|
}).catch((l) => {
|
|
638
|
-
r("error", l), delete
|
|
638
|
+
r("error", l), delete gt[t];
|
|
639
639
|
}));
|
|
640
640
|
};
|
|
641
|
-
var
|
|
641
|
+
var et, He, _t, Ei, xt, Ai;
|
|
642
642
|
const B = class B {
|
|
643
643
|
constructor(i, t = {}) {
|
|
644
|
-
h(this,
|
|
645
|
-
h(this,
|
|
646
|
-
h(this,
|
|
644
|
+
h(this, et);
|
|
645
|
+
h(this, _t);
|
|
646
|
+
h(this, xt);
|
|
647
647
|
this.__storage__ = {
|
|
648
648
|
el: i,
|
|
649
649
|
options: t
|
|
650
|
-
}, this.active = "data-modal-active", d(this,
|
|
650
|
+
}, this.active = "data-modal-active", d(this, et, He).call(this);
|
|
651
651
|
}
|
|
652
652
|
destroy() {
|
|
653
653
|
const { elements: i } = this;
|
|
@@ -657,12 +657,12 @@ const B = class B {
|
|
|
657
657
|
}
|
|
658
658
|
update() {
|
|
659
659
|
var i;
|
|
660
|
-
return d(i = this.destroy(),
|
|
660
|
+
return d(i = this.destroy(), et, He).call(i), this.emit("update"), this;
|
|
661
661
|
}
|
|
662
662
|
/** static method 'open' */
|
|
663
663
|
static open(i) {
|
|
664
|
-
const { SETTINGS: t } =
|
|
665
|
-
|
|
664
|
+
const { SETTINGS: t } = j, e = Object.assign({}, t, { on: {} }, i);
|
|
665
|
+
Qe(e);
|
|
666
666
|
}
|
|
667
667
|
/** static method 'defineMethods' */
|
|
668
668
|
static defineMethods(i) {
|
|
@@ -673,23 +673,23 @@ const B = class B {
|
|
|
673
673
|
Object.assign(B.prototype, B.prototype.__methods__);
|
|
674
674
|
}
|
|
675
675
|
};
|
|
676
|
-
|
|
676
|
+
et = new WeakSet(), He = function() {
|
|
677
677
|
const { el: i, options: t } = this.__storage__;
|
|
678
|
-
if (!
|
|
678
|
+
if (!pt(i) || !A(i))
|
|
679
679
|
return;
|
|
680
|
-
const { SETTINGS: e, EVENTS: s } =
|
|
681
|
-
if (this.elements = t.state == "not active" ?
|
|
680
|
+
const { SETTINGS: e, EVENTS: s } = j;
|
|
681
|
+
if (this.elements = t.state == "not active" ? k(i + `:not([${this.active}])`) : k(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
682
682
|
for (const [o, a] of Object.entries(this.options.on))
|
|
683
683
|
this.__events__[o] = [a];
|
|
684
|
-
d(this,
|
|
685
|
-
},
|
|
684
|
+
d(this, _t, Ei).call(this);
|
|
685
|
+
}, _t = new WeakSet(), Ei = function() {
|
|
686
686
|
const { elements: i, options: t } = this;
|
|
687
687
|
i.forEach((e) => {
|
|
688
|
-
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this,
|
|
688
|
+
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, xt, Ai), e.modal.defaultOptions = t, e.modal.methods = {}, e.modal.methods.destroy = this.destroy, e.modal.methods.update = this.update, e.addEventListener("click", e.modal.eventHandler), e.setAttribute(this.active, "");
|
|
689
689
|
}), this.emit("init");
|
|
690
|
-
},
|
|
691
|
-
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o =
|
|
692
|
-
o && typeof o != "object" &&
|
|
690
|
+
}, xt = new WeakSet(), Ai = function(i) {
|
|
691
|
+
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = zs(this.getAttribute("data-modal-on"));
|
|
692
|
+
o && typeof o != "object" && E("modal4", "data-modal-on must be a json string.");
|
|
693
693
|
const a = {
|
|
694
694
|
target: this.getAttribute("data-modal-target") || t.target,
|
|
695
695
|
action: this.getAttribute("data-modal-action") || t.action,
|
|
@@ -700,12 +700,12 @@ tt = new WeakSet(), xe = function() {
|
|
|
700
700
|
};
|
|
701
701
|
this.removeEventListener("click", e), setTimeout(() => {
|
|
702
702
|
this.addEventListener("click", e);
|
|
703
|
-
}, 200),
|
|
703
|
+
}, 200), Qe(a, s);
|
|
704
704
|
};
|
|
705
|
-
let
|
|
706
|
-
Object.assign(
|
|
707
|
-
customElements.define("modern-modal",
|
|
708
|
-
const
|
|
705
|
+
let V = B;
|
|
706
|
+
Object.assign(V.prototype, z);
|
|
707
|
+
customElements.define("modern-modal", pi);
|
|
708
|
+
const Rs = (n, i) => {
|
|
709
709
|
const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
|
|
710
710
|
i.forEach((s) => {
|
|
711
711
|
const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } = s.aost, { top: p, bottom: g } = s.getBoundingClientRect(), m = t * (r / 100), v = t * (l / 100);
|
|
@@ -720,22 +720,22 @@ const js = (n, i) => {
|
|
|
720
720
|
}, a);
|
|
721
721
|
}
|
|
722
722
|
});
|
|
723
|
-
},
|
|
724
|
-
var
|
|
725
|
-
class
|
|
723
|
+
}, Xs = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
|
|
724
|
+
var it, Me, $t, Si;
|
|
725
|
+
class Li {
|
|
726
726
|
constructor(i, t = {}) {
|
|
727
|
-
h(this,
|
|
728
|
-
h(this,
|
|
727
|
+
h(this, it);
|
|
728
|
+
h(this, $t);
|
|
729
729
|
this.__storage__ = {
|
|
730
730
|
el: i,
|
|
731
731
|
options: t
|
|
732
|
-
}, this.active = "data-aost-active", d(this,
|
|
732
|
+
}, this.active = "data-aost-active", d(this, it, Me).call(this);
|
|
733
733
|
}
|
|
734
734
|
destroy(i) {
|
|
735
735
|
const { elements: t, options: e } = this;
|
|
736
736
|
if (!t)
|
|
737
737
|
return this;
|
|
738
|
-
const { scroller: s } = e, o = s === window || !
|
|
738
|
+
const { scroller: s } = e, o = s === window || !A(s) ? window : D(s);
|
|
739
739
|
return o.aost && (o.removeEventListener("scroll", o.aost.eventHandler), delete o.aost), t.forEach((a) => {
|
|
740
740
|
if (!a.aost)
|
|
741
741
|
return;
|
|
@@ -745,58 +745,58 @@ class yi {
|
|
|
745
745
|
}
|
|
746
746
|
update(i) {
|
|
747
747
|
var t;
|
|
748
|
-
d(t = this.destroy(i),
|
|
748
|
+
d(t = this.destroy(i), it, Me).call(t);
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
|
|
751
|
+
it = new WeakSet(), Me = function() {
|
|
752
752
|
const { el: i, options: t } = this.__storage__;
|
|
753
|
-
if (!
|
|
753
|
+
if (!pt(i) || !A(i))
|
|
754
754
|
return;
|
|
755
|
-
const { SETTINGS: e, EVENTS: s } =
|
|
756
|
-
if (this.elements = t.state == "not active" ?
|
|
755
|
+
const { SETTINGS: e, EVENTS: s } = ai;
|
|
756
|
+
if (this.elements = t.state == "not active" ? k(i + `:not([${this.active}])`) : k(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
757
757
|
for (const [o, a] of Object.entries(this.options.on))
|
|
758
758
|
this.__events__[o] = [a];
|
|
759
|
-
d(this,
|
|
760
|
-
},
|
|
761
|
-
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !
|
|
759
|
+
d(this, $t, Si).call(this);
|
|
760
|
+
}, $t = new WeakSet(), Si = function() {
|
|
761
|
+
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !A(e) ? window : D(e);
|
|
762
762
|
this.eventHandler = () => {
|
|
763
|
-
|
|
763
|
+
Rs(s, i);
|
|
764
764
|
}, i.forEach((a) => {
|
|
765
|
-
a.aost = {}, a.aost.class = a.getAttribute("data-aost-class") || t.class, a.aost.delay = parseInt(a.getAttribute("data-aost-delay")) || t.delay, a.aost.start = parseInt(a.getAttribute("data-aost-start")) || t.start, a.aost.end = parseInt(a.getAttribute("data-aost-end")) || t.end, a.aost.repeat =
|
|
765
|
+
a.aost = {}, a.aost.class = a.getAttribute("data-aost-class") || t.class, a.aost.delay = parseInt(a.getAttribute("data-aost-delay")) || t.delay, a.aost.start = parseInt(a.getAttribute("data-aost-start")) || t.start, a.aost.end = parseInt(a.getAttribute("data-aost-end")) || t.end, a.aost.repeat = Xs(a.getAttribute("data-aost-repeat"), t), a.aost.methods = {}, a.aost.methods.destroy = this.destroy, a.aost.methods.update = this.update, a.aost.instance = this, a.setAttribute(this.active, "");
|
|
766
766
|
});
|
|
767
767
|
const { eventHandler: o } = this;
|
|
768
768
|
o(), s.aost = {}, s.aost.eventHandler = o, s.addEventListener("scroll", s.aost.eventHandler, !1);
|
|
769
769
|
};
|
|
770
|
-
Object.assign(
|
|
771
|
-
const
|
|
772
|
-
const { TEMPLATE: i } =
|
|
770
|
+
Object.assign(Li.prototype, z);
|
|
771
|
+
const Ys = (n) => {
|
|
772
|
+
const { TEMPLATE: i } = _e, { childDom: t } = n, e = document.createElement("div");
|
|
773
773
|
e.innerHTML = i();
|
|
774
774
|
const s = e.querySelector(".player-wrapper");
|
|
775
775
|
return [...t].forEach((o) => {
|
|
776
776
|
s.append(o);
|
|
777
777
|
}), e.children[0];
|
|
778
778
|
};
|
|
779
|
-
var
|
|
780
|
-
class
|
|
779
|
+
var Ct, Di, Ht, ki, Mt, _i, It, xi, qt, $i, Ot, Ci, Pt, Hi, Nt, Mi, jt, Ii, zt, qi;
|
|
780
|
+
class Fs extends HTMLElement {
|
|
781
781
|
constructor() {
|
|
782
782
|
super();
|
|
783
|
-
h(this, $t);
|
|
784
|
-
h(this, xt);
|
|
785
|
-
h(this, _t);
|
|
786
|
-
// youtube iframe
|
|
787
783
|
h(this, Ct);
|
|
788
|
-
// vimeo iframe
|
|
789
784
|
h(this, Ht);
|
|
790
|
-
// youku iframe
|
|
791
785
|
h(this, Mt);
|
|
786
|
+
// youtube iframe
|
|
792
787
|
h(this, It);
|
|
793
|
-
//
|
|
788
|
+
// vimeo iframe
|
|
794
789
|
h(this, qt);
|
|
795
|
-
//
|
|
790
|
+
// youku iframe
|
|
796
791
|
h(this, Ot);
|
|
797
|
-
|
|
792
|
+
h(this, Pt);
|
|
793
|
+
// 2025.02.11 新增 ig
|
|
798
794
|
h(this, Nt);
|
|
799
|
-
|
|
795
|
+
// 2025.02.11 新增 tiktok
|
|
796
|
+
h(this, jt);
|
|
797
|
+
// 2026.01.15 新增 video
|
|
798
|
+
h(this, zt);
|
|
799
|
+
d(this, Ct, Di).call(this);
|
|
800
800
|
}
|
|
801
801
|
play() {
|
|
802
802
|
const { videoType: t } = this;
|
|
@@ -833,16 +833,16 @@ class Ws extends HTMLElement {
|
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
|
|
836
|
+
Ct = new WeakSet(), Di = function() {
|
|
837
837
|
if (!this.getAttribute("video-id")) {
|
|
838
|
-
|
|
838
|
+
E("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
|
839
839
|
return;
|
|
840
840
|
}
|
|
841
|
-
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.videoMode = this.getAttribute("video-mode"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), this.videoInboxImg = this.getAttribute("video-inbox-img"), d(this,
|
|
842
|
-
},
|
|
843
|
-
this.childDom = this.childNodes, this.template =
|
|
844
|
-
},
|
|
845
|
-
const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: s } =
|
|
841
|
+
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.videoMode = this.getAttribute("video-mode"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), this.videoInboxImg = this.getAttribute("video-inbox-img"), d(this, Ht, ki).call(this);
|
|
842
|
+
}, Ht = new WeakSet(), ki = function() {
|
|
843
|
+
this.childDom = this.childNodes, this.template = Ys(this), this.innerHTML = "", this.append(this.template), d(this, Mt, _i).call(this);
|
|
844
|
+
}, Mt = new WeakSet(), _i = function() {
|
|
845
|
+
const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: s } = _e;
|
|
846
846
|
let o = "";
|
|
847
847
|
function a(r) {
|
|
848
848
|
f(r).addClass("cookie-disagree"), f(".cookie-disagree").append(s);
|
|
@@ -851,72 +851,72 @@ $t = new WeakSet(), Ti = function() {
|
|
|
851
851
|
case "youtubeAPI":
|
|
852
852
|
break;
|
|
853
853
|
case "youtube":
|
|
854
|
-
document.body.wd_youtube == !1 ? a("video-player") : o = d(this,
|
|
854
|
+
document.body.wd_youtube == !1 ? a("video-player") : o = d(this, It, xi).call(this);
|
|
855
855
|
break;
|
|
856
856
|
case "youkuAPI":
|
|
857
857
|
break;
|
|
858
858
|
case "youku":
|
|
859
|
-
document.body.wd_youku == !1 ? a("video-player") : o = d(this,
|
|
859
|
+
document.body.wd_youku == !1 ? a("video-player") : o = d(this, Ot, Ci).call(this);
|
|
860
860
|
break;
|
|
861
861
|
case "vimeo":
|
|
862
|
-
document.body.wd_vimeo == !1 ? a("video-player") : o = d(this,
|
|
862
|
+
document.body.wd_vimeo == !1 ? a("video-player") : o = d(this, qt, $i).call(this);
|
|
863
863
|
break;
|
|
864
864
|
case "bilibili":
|
|
865
|
-
document.body.wd_bilibili == !1 ? a("video-player") : o = d(this,
|
|
865
|
+
document.body.wd_bilibili == !1 ? a("video-player") : o = d(this, Pt, Hi).call(this);
|
|
866
866
|
break;
|
|
867
867
|
case "instagram":
|
|
868
|
-
document.body.wd_instagram == !1 ? a(".instagram-media") : o = d(this,
|
|
868
|
+
document.body.wd_instagram == !1 ? a(".instagram-media") : o = d(this, Nt, Mi).call(this);
|
|
869
869
|
break;
|
|
870
870
|
case "tiktok":
|
|
871
|
-
document.body.wd_tiktok == !1 ? a("video-player") : o = d(this,
|
|
871
|
+
document.body.wd_tiktok == !1 ? a("video-player") : o = d(this, jt, Ii).call(this);
|
|
872
872
|
break;
|
|
873
873
|
case "videojs":
|
|
874
874
|
break;
|
|
875
875
|
case "video":
|
|
876
|
-
o = d(this,
|
|
876
|
+
o = d(this, zt, qi).call(this);
|
|
877
877
|
break;
|
|
878
878
|
}
|
|
879
|
-
this.querySelector(".player-wrapper").insertAdjacentHTML(
|
|
880
|
-
},
|
|
879
|
+
this.querySelector(".player-wrapper").insertAdjacentHTML(L.prepend, o);
|
|
880
|
+
}, It = new WeakSet(), xi = function() {
|
|
881
881
|
const { videoId: t, autoplay: e, startTime: s } = this;
|
|
882
882
|
return `<iframe src="https://www.youtube.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}&start=${s}&mute=1&loop=1&enablejsapi=1" frameborder="0" allowfullscreen="0" volumn="0" allow="${e === "on" ? "autoplay;" : ""} encrypted-media; gyroscope; picture-in-picture;"></iframe>`;
|
|
883
|
-
},
|
|
883
|
+
}, qt = new WeakSet(), $i = function() {
|
|
884
884
|
const { videoId: t, autoplay: e, hash: s } = this;
|
|
885
885
|
return `<iframe src="https://player.vimeo.com/video/${t}?h=${s}&${e === "on" ? "autoplay=1" : ""}&loop=1&color=ffffff&title=0&byline=0&portrait=0" frameborder="0" allow="${e === "on" ? "autoplay;" : ""} fullscreen; picture-in-picture" allowfullscreen></iframe><script src="https://player.vimeo.com/api/player.js"><\/script>`;
|
|
886
|
-
},
|
|
886
|
+
}, Ot = new WeakSet(), Ci = function() {
|
|
887
887
|
const { videoId: t, autoplay: e } = this;
|
|
888
888
|
return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}" frameborder=0 "allowfullscreen"></iframe>`;
|
|
889
|
-
},
|
|
889
|
+
}, Pt = new WeakSet(), Hi = function() {
|
|
890
890
|
const { videoId: t, autoplay: e } = this;
|
|
891
891
|
return `<iframe src="//player.bilibili.com/player.html?bvid=${t}&page=1&as_wide=1&high_quality=1&danmaku=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>`;
|
|
892
|
-
},
|
|
892
|
+
}, Nt = new WeakSet(), Mi = function() {
|
|
893
893
|
const { videoId: t, autoplay: e } = this;
|
|
894
894
|
return `<iframe class="instagram-media instagram-media-rendered" id="instagram-embed-0" src="https://www.instagram.com/p/${t}/embed/" width="num-w" height=" num-h" scrolling="auto" frameborder="0" data-instgrm-payload-id="instagram-media-payload-0"></iframe>`;
|
|
895
|
-
},
|
|
895
|
+
}, jt = new WeakSet(), Ii = function() {
|
|
896
896
|
const { videoId: t, autoplay: e } = this;
|
|
897
897
|
return `<iframe name="__tt_embed__v79271677875424740" sandbox="allow-popups allow-popups-to-escape-sandbox allow-scripts allow-top-navigation allow-same-origin" src="https://www.tiktok.com/player/v1/${t}?&${e === "on" ? "autoplay=1" : ""}"></iframe>`;
|
|
898
|
-
},
|
|
898
|
+
}, zt = new WeakSet(), qi = function() {
|
|
899
899
|
const { videoId: t, autoplay: e } = this;
|
|
900
900
|
return `<video src="${t}" ${e == "on" ? "autoplay" : ""} muted playsinline controls></video>`;
|
|
901
901
|
};
|
|
902
|
-
let
|
|
903
|
-
function
|
|
902
|
+
let Q = 0;
|
|
903
|
+
function Oi(n) {
|
|
904
904
|
const i = [];
|
|
905
905
|
return (n || []).forEach((t) => {
|
|
906
906
|
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(t));
|
|
907
907
|
}), i;
|
|
908
908
|
}
|
|
909
|
-
function
|
|
910
|
-
const i =
|
|
911
|
-
|
|
909
|
+
function Pi(n) {
|
|
910
|
+
const i = Oi(n);
|
|
911
|
+
Q += 1, Q === 1 && (document.documentElement.classList.add("scrollLock"), Is(i));
|
|
912
912
|
}
|
|
913
|
-
function
|
|
914
|
-
if (
|
|
915
|
-
const i =
|
|
916
|
-
|
|
913
|
+
function Ni(n) {
|
|
914
|
+
if (Q = Math.max(0, Q - 1), Q === 0) {
|
|
915
|
+
const i = Oi(n);
|
|
916
|
+
qs(i), document.documentElement.classList.remove("scrollLock");
|
|
917
917
|
}
|
|
918
918
|
}
|
|
919
|
-
async function
|
|
919
|
+
async function Hn(n = 0) {
|
|
920
920
|
if (f(".loading-wrapper").length)
|
|
921
921
|
return;
|
|
922
922
|
f("body").append(`
|
|
@@ -930,30 +930,30 @@ async function $n(n = 0) {
|
|
|
930
930
|
</div>
|
|
931
931
|
</div>
|
|
932
932
|
`), f(".loading-wrapper").delay(n).fadeIn(300).promise().done(function() {
|
|
933
|
-
|
|
933
|
+
Pi();
|
|
934
934
|
});
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function Mn() {
|
|
937
937
|
f(".loading-wrapper").fadeOut(300).promise().done(function() {
|
|
938
|
-
f(".loading-wrapper").remove(),
|
|
938
|
+
f(".loading-wrapper").remove(), Ni();
|
|
939
939
|
});
|
|
940
940
|
}
|
|
941
|
-
function
|
|
942
|
-
new
|
|
941
|
+
function In(n, i) {
|
|
942
|
+
new En(n, i);
|
|
943
943
|
}
|
|
944
|
-
function
|
|
945
|
-
const n = document.querySelector("[data-aost]") && new
|
|
946
|
-
} }), e = new
|
|
944
|
+
function Us() {
|
|
945
|
+
const n = document.querySelector("[data-aost]") && new Li("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new di("[data-anchor-target]"), t = new oi({ callback_loaded: () => {
|
|
946
|
+
} }), e = new gn();
|
|
947
947
|
n == null || n.update(), t.update(), e.reValidate(), i == null || i.update();
|
|
948
948
|
}
|
|
949
|
-
function
|
|
949
|
+
function qn(n, i = () => {
|
|
950
950
|
}) {
|
|
951
951
|
f(`[data-tab-content=${n}]`).fadeIn(function() {
|
|
952
952
|
typeof i == "function" && i();
|
|
953
|
-
}).siblings("[data-tab-content]").hide(),
|
|
953
|
+
}).siblings("[data-tab-content]").hide(), Us();
|
|
954
954
|
}
|
|
955
|
-
function
|
|
956
|
-
|
|
955
|
+
function On() {
|
|
956
|
+
Xe(
|
|
957
957
|
{
|
|
958
958
|
target: document.body,
|
|
959
959
|
cancel: {
|
|
@@ -977,31 +977,31 @@ function Hn() {
|
|
|
977
977
|
}
|
|
978
978
|
);
|
|
979
979
|
}
|
|
980
|
-
function
|
|
980
|
+
function Pn() {
|
|
981
981
|
window.onpageshow = function(n) {
|
|
982
982
|
n.persisted && window.location.reload();
|
|
983
983
|
};
|
|
984
984
|
}
|
|
985
|
-
function
|
|
985
|
+
function Nn() {
|
|
986
986
|
const n = navigator.userAgent;
|
|
987
987
|
return {
|
|
988
988
|
BigSurUP: /Mac OS X 10.15/.test(n) || /Mac OS X 10_15_7/.test(n) || /Mac OS X 10_15_8/.test(n) || /Mac OS X 10_15_9/.test(n) || /Mac OS X 11_/.test(n) || /Mac OS X 12_/.test(n)
|
|
989
989
|
};
|
|
990
990
|
}
|
|
991
|
-
function
|
|
991
|
+
function jn(n, i) {
|
|
992
992
|
f(n).on("click", function() {
|
|
993
993
|
f(this).toggleClass(i);
|
|
994
994
|
});
|
|
995
995
|
}
|
|
996
|
-
function
|
|
996
|
+
function zn(n, i) {
|
|
997
997
|
f(n).on("click", function() {
|
|
998
998
|
f(n).not(this).removeClass(i), f(this).addClass(i);
|
|
999
999
|
});
|
|
1000
1000
|
}
|
|
1001
|
-
const
|
|
1001
|
+
const Bn = (n) => new Promise((i) => {
|
|
1002
1002
|
let t = setTimeout(() => (clearTimeout(t), i()), n);
|
|
1003
1003
|
});
|
|
1004
|
-
function
|
|
1004
|
+
function Js(n, i = 250) {
|
|
1005
1005
|
let t = null;
|
|
1006
1006
|
return function(...e) {
|
|
1007
1007
|
let s = this;
|
|
@@ -1010,7 +1010,7 @@ function Rs(n, i = 250) {
|
|
|
1010
1010
|
}, i);
|
|
1011
1011
|
};
|
|
1012
1012
|
}
|
|
1013
|
-
function
|
|
1013
|
+
function Wn(n, i = 250) {
|
|
1014
1014
|
let t, e;
|
|
1015
1015
|
return function() {
|
|
1016
1016
|
const s = this, o = arguments, a = +/* @__PURE__ */ new Date();
|
|
@@ -1019,7 +1019,7 @@ function Pn(n, i = 250) {
|
|
|
1019
1019
|
}, i)) : (t = a, n.apply(s, o));
|
|
1020
1020
|
};
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1022
|
+
function Gn() {
|
|
1023
1023
|
window._g.interval = [], f(".countdown").each((i, t) => {
|
|
1024
1024
|
const e = Number(f(t).attr("data-seconds")) + 1;
|
|
1025
1025
|
let s = Math.floor(e / 60) + ":" + e % 60;
|
|
@@ -1029,21 +1029,21 @@ function jn() {
|
|
|
1029
1029
|
}, 1e3);
|
|
1030
1030
|
});
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1032
|
+
function Rn(n = 500) {
|
|
1033
1033
|
return new Promise((i, t) => {
|
|
1034
1034
|
let e = setTimeout(() => {
|
|
1035
1035
|
clearTimeout(e), i();
|
|
1036
1036
|
}, n);
|
|
1037
1037
|
});
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function Xn() {
|
|
1040
1040
|
const n = function() {
|
|
1041
1041
|
let i = window.innerHeight * 0.01;
|
|
1042
1042
|
document.documentElement.style.setProperty("--vh", i + "px");
|
|
1043
1043
|
};
|
|
1044
|
-
n(), window.addEventListener("resize",
|
|
1044
|
+
n(), window.addEventListener("resize", Js(n));
|
|
1045
1045
|
}
|
|
1046
|
-
function
|
|
1046
|
+
function Yn(n, i, t, e, s) {
|
|
1047
1047
|
const o = this, r = f(n).html().split("<br>");
|
|
1048
1048
|
let l = "", c = 0;
|
|
1049
1049
|
r.forEach((u, p) => {
|
|
@@ -1052,11 +1052,11 @@ function Wn(n, i, t, e, s) {
|
|
|
1052
1052
|
});
|
|
1053
1053
|
}), f(n).html(l);
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1055
|
+
function Fn(n, i) {
|
|
1056
1056
|
const t = Math.pow(10, i);
|
|
1057
1057
|
return Math.round(n * t) / t;
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1059
|
+
function Un(n) {
|
|
1060
1060
|
let i = n.activeIndex, t = n.slides.length;
|
|
1061
1061
|
if (n.params.loop)
|
|
1062
1062
|
switch (n.activeIndex) {
|
|
@@ -1071,18 +1071,18 @@ function Rn(n) {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
return i;
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1074
|
+
function Jn(n, i) {
|
|
1075
1075
|
const t = n.$el, e = n.params.grid.rows, s = i || n.params.slidesPerView * e;
|
|
1076
1076
|
(n.loopedSlides ? n.slides.length - n.loopedSlides * 2 : n.slides.length) <= s ? (t.addClass("swiper-no-swiping"), f(n.params.navigation.nextEl).hide(), f(n.params.navigation.prevEl).hide(), f(n.params.pagination.el).hide(), n.params.autoplay.enabled = !1, n.autoplay.stop()) : (t.removeClass("swiper-no-swiping"), f(n.params.navigation.nextEl).show(), f(n.params.navigation.prevEl).show(), f(n.params.pagination.el).show(), n.params.autoplay.enabled && n.autoplay.start());
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1078
|
+
function Zn(n) {
|
|
1079
1079
|
n.el.querySelectorAll("img.detect-shade").forEach((i) => {
|
|
1080
1080
|
i.addEventListener("load", function() {
|
|
1081
1081
|
detectShade(i);
|
|
1082
1082
|
});
|
|
1083
1083
|
});
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function Qn(n) {
|
|
1086
1086
|
const i = n.el, t = f(i).find(".swiper-slide-active"), e = f(t).find("video").get(0), s = f(i).find(".swiper-slide video");
|
|
1087
1087
|
n.autoplay.stop(), f(e).off("ended"), e ? (s.each((o, a) => {
|
|
1088
1088
|
a.currentTime = 0;
|
|
@@ -1090,7 +1090,7 @@ function Fn(n) {
|
|
|
1090
1090
|
n.slideNext();
|
|
1091
1091
|
}), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
|
|
1092
1092
|
}
|
|
1093
|
-
function
|
|
1093
|
+
function Kn() {
|
|
1094
1094
|
f(".number-grow").each(function(n, i) {
|
|
1095
1095
|
const t = f(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
|
|
1096
1096
|
let r = "";
|
|
@@ -1104,7 +1104,7 @@ function Un() {
|
|
|
1104
1104
|
});
|
|
1105
1105
|
});
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function Vn() {
|
|
1108
1108
|
f(".letter-grow").each(function(n, i) {
|
|
1109
1109
|
const t = f(i), s = t.attr("data-letter").split(""), o = () => {
|
|
1110
1110
|
let a = "";
|
|
@@ -1118,46 +1118,48 @@ function Jn() {
|
|
|
1118
1118
|
});
|
|
1119
1119
|
});
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function to(n) {
|
|
1122
1122
|
const i = getComputedStyle(n).transform;
|
|
1123
1123
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
|
1124
1124
|
return t ? parseFloat(t[1].split(", ")[12]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[4]) : 0);
|
|
1125
1125
|
}
|
|
1126
|
-
function
|
|
1126
|
+
function eo(n) {
|
|
1127
1127
|
const i = getComputedStyle(n).transform;
|
|
1128
1128
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
|
1129
1129
|
return t ? parseFloat(t[1].split(", ")[13]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[5]) : 0);
|
|
1130
1130
|
}
|
|
1131
|
-
function
|
|
1131
|
+
function io(n) {
|
|
1132
1132
|
const i = document.createElement("div");
|
|
1133
1133
|
return i.innerHTML = n, i.childNodes[0];
|
|
1134
1134
|
}
|
|
1135
|
-
const
|
|
1136
|
-
var
|
|
1135
|
+
const Ke = (n) => n.videoId !== "" || typeof n.videoId < "u", Zs = (n) => n.$selector.getAttribute("video4-active") === "on", ft = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`, Ve = (n) => (console.log(n.videoId, "params.videoId"), `<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="${n.videoId}"></blockquote>`);
|
|
1136
|
+
var st, qe, Bt, ji, nt, Oe, ot, Pe, Wt, zi, at, Ne, Gt, Bi;
|
|
1137
1137
|
const X = class X {
|
|
1138
1138
|
//*-* 給Article4用的 **//
|
|
1139
1139
|
constructor(i, t = {}) {
|
|
1140
|
-
h(this, it);
|
|
1141
|
-
h(this, Pt);
|
|
1142
|
-
h(this, jt);
|
|
1143
1140
|
h(this, st);
|
|
1144
|
-
h(this,
|
|
1145
|
-
|
|
1146
|
-
|
|
1141
|
+
h(this, Bt);
|
|
1142
|
+
h(this, nt);
|
|
1143
|
+
h(this, ot);
|
|
1144
|
+
h(this, Wt);
|
|
1145
|
+
h(this, at);
|
|
1146
|
+
h(this, Gt);
|
|
1147
|
+
if (!pt(i) && !xe(i) && !mt(i)) {
|
|
1148
|
+
Ze("video4", `找不到該物件 -> ${i}`);
|
|
1147
1149
|
return;
|
|
1148
1150
|
}
|
|
1149
1151
|
this.__storage__ = {
|
|
1150
1152
|
el: i,
|
|
1151
1153
|
options: t
|
|
1152
|
-
}, this.active = "data-video-active", d(this,
|
|
1154
|
+
}, this.active = "data-video-active", d(this, st, qe).call(this);
|
|
1153
1155
|
}
|
|
1154
1156
|
update() {
|
|
1155
|
-
d(this,
|
|
1157
|
+
d(this, st, qe).call(this);
|
|
1156
1158
|
}
|
|
1157
1159
|
};
|
|
1158
|
-
|
|
1159
|
-
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s, LAYOUT: o } =
|
|
1160
|
-
if (t.isGlobal && (X.globalOptions = t), this.elements = t.state == "not active" ?
|
|
1160
|
+
st = new WeakSet(), qe = function() {
|
|
1161
|
+
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s, LAYOUT: o } = _e;
|
|
1162
|
+
if (t.isGlobal && (X.globalOptions = t), this.elements = t.state == "not active" ? k(i + `:not([${this.active}])`) : k(i), this.options = Object.assign(
|
|
1161
1163
|
{},
|
|
1162
1164
|
{ LAYOUT: o },
|
|
1163
1165
|
// 原始 configs 的 LAYOUT
|
|
@@ -1170,20 +1172,44 @@ it = new WeakSet(), He = function() {
|
|
|
1170
1172
|
), this.__events__ = Object.assign({}, s), this.options.on)
|
|
1171
1173
|
for (const [a, r] of Object.entries(this.options.on))
|
|
1172
1174
|
this.__events__[a] = [r];
|
|
1173
|
-
d(this,
|
|
1174
|
-
},
|
|
1175
|
+
d(this, Bt, ji).call(this);
|
|
1176
|
+
}, Bt = new WeakSet(), ji = function() {
|
|
1175
1177
|
const { elements: i, options: t } = this;
|
|
1176
1178
|
i.forEach((e) => {
|
|
1177
|
-
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this,
|
|
1179
|
+
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, Gt, Bi).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), Ke(e.video.params) && !Zs(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, Wt, zi).call(this, e)), Ke(e.video.params) || Ze("video4", "無法取得影片 ID");
|
|
1178
1180
|
}), this.emit("init");
|
|
1179
|
-
},
|
|
1181
|
+
}, nt = new WeakSet(), Oe = function(i) {
|
|
1182
|
+
const { $selector: t, videoId: e, videoType: s, videoInboxImg: o, videoHighQualityPic: a } = i, r = t == null ? void 0 : t.querySelector("img"), l = (r == null ? void 0 : r.getAttribute("src")) || (r == null ? void 0 : r.getAttribute("data-src"));
|
|
1183
|
+
return o ? Promise.resolve(o) : l ? Promise.resolve(l) : s == "youtube" ? a == "on" ? Promise.resolve(`https://img.youtube.com/vi/${e}/maxresdefault.jpg`) : Promise.resolve(`https://img.youtube.com/vi/${e}/0.jpg`) : s == "vimeo" ? Promise.resolve(`https://vumbnail.com/${e}_large.jpg`) : s == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${e}`, { method: "GET", redirect: "follow" }).then((c) => c.json()).then((c) => c.thumbnail_url).catch(function() {
|
|
1184
|
+
return "";
|
|
1185
|
+
}) : Promise.resolve("");
|
|
1186
|
+
}, ot = new WeakSet(), Pe = function(i, t) {
|
|
1187
|
+
const { videoType: e, videoId: s } = t;
|
|
1188
|
+
if (!(i != null && i.getAttribute("src") || i != null && i.getAttribute("data-src"))) {
|
|
1189
|
+
if (e === "video") {
|
|
1190
|
+
const a = document.createElement("video");
|
|
1191
|
+
a.src = s, a.preload = "metadata", a.muted = !0, a.playsInline = !0, a.crossOrigin = "anonymous", a.onloadeddata = () => {
|
|
1192
|
+
a.currentTime = 0.5;
|
|
1193
|
+
}, a.onseeked = () => {
|
|
1194
|
+
const r = document.createElement("canvas");
|
|
1195
|
+
r.width = a.videoWidth, r.height = a.videoHeight, r.getContext("2d").drawImage(a, 0, 0), i.src = r.toDataURL("image/jpeg", 0.85);
|
|
1196
|
+
};
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
d(this, nt, Oe).call(this, t).then((a) => {
|
|
1200
|
+
a ? i.setAttribute("src", `${a}`) : E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
}, Wt = new WeakSet(), zi = function(i) {
|
|
1180
1204
|
const { LAYOUT: t } = this.options, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: p } = e;
|
|
1181
1205
|
if (l === "onBox" || l === "inBox") {
|
|
1182
1206
|
let g = null;
|
|
1183
1207
|
if (u === "on") {
|
|
1184
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
|
1208
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(L.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
|
1185
1209
|
const m = s.querySelector("img"), v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src")), w = t[o] ? t[o] : t[0] || "";
|
|
1186
|
-
if (w ? m.insertAdjacentHTML(
|
|
1210
|
+
if (w ? m.insertAdjacentHTML(L.after, w) : E("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !v)
|
|
1211
|
+
d(this, ot, Pe).call(this, m, e);
|
|
1212
|
+
else if (!v && r == "youtube")
|
|
1187
1213
|
p == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
|
|
1188
1214
|
else if (!v && r == "vimeo")
|
|
1189
1215
|
m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`);
|
|
@@ -1201,29 +1227,29 @@ it = new WeakSet(), He = function() {
|
|
|
1201
1227
|
m.setAttribute("src", `${T}`);
|
|
1202
1228
|
}).catch(function(b) {
|
|
1203
1229
|
console.log("error");
|
|
1204
|
-
}) :
|
|
1230
|
+
}) : E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
|
1205
1231
|
}
|
|
1206
|
-
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) ||
|
|
1232
|
+
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e, g.video.instance = this), g.video.eventHandler = d(this, at, Ne), g.addEventListener("click", g.video.eventHandler);
|
|
1207
1233
|
} else if (l === "onPage") {
|
|
1208
1234
|
let g = null;
|
|
1209
1235
|
if (u == "on") {
|
|
1210
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
|
1236
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(L.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
|
1211
1237
|
const m = s.querySelector("img");
|
|
1212
|
-
m.insertAdjacentHTML(
|
|
1238
|
+
m.insertAdjacentHTML(L.after, t[o]);
|
|
1213
1239
|
const v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
|
1214
|
-
!v && 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`) : !v && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((w) => w.json()).then((w) => {
|
|
1240
|
+
v ? !v && 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`) : !v && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((w) => w.json()).then((w) => {
|
|
1215
1241
|
const b = w.thumbnail_url;
|
|
1216
1242
|
m.setAttribute("src", `${b}`);
|
|
1217
1243
|
}).catch(function(w) {
|
|
1218
1244
|
console.log("error");
|
|
1219
|
-
}) : v ||
|
|
1245
|
+
}) : v || E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片") : d(this, ot, Pe).call(this, m, e), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
|
1220
1246
|
} else {
|
|
1221
|
-
s.innerHTML =
|
|
1247
|
+
s.innerHTML = ft(e);
|
|
1222
1248
|
return;
|
|
1223
1249
|
}
|
|
1224
|
-
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this,
|
|
1250
|
+
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, at, Ne), g.addEventListener("click", g.video.eventHandler);
|
|
1225
1251
|
}
|
|
1226
|
-
},
|
|
1252
|
+
}, at = new WeakSet(), Ne = function(i) {
|
|
1227
1253
|
const { video: t } = this, e = t.instance, {
|
|
1228
1254
|
$selector: s,
|
|
1229
1255
|
videoMode: o,
|
|
@@ -1237,7 +1263,7 @@ it = new WeakSet(), He = function() {
|
|
|
1237
1263
|
videoButton: m,
|
|
1238
1264
|
videoLayoutNo: v,
|
|
1239
1265
|
videoStartTime: w
|
|
1240
|
-
} = t.params, b = new
|
|
1266
|
+
} = t.params, b = new oi({ callback_loaded: (C) => {
|
|
1241
1267
|
} }), T = new URLSearchParams({
|
|
1242
1268
|
video_mode: o,
|
|
1243
1269
|
video_type: u,
|
|
@@ -1249,83 +1275,77 @@ it = new WeakSet(), He = function() {
|
|
|
1249
1275
|
route: c + `?${T.toString()}`,
|
|
1250
1276
|
on: {
|
|
1251
1277
|
complete(y) {
|
|
1252
|
-
var
|
|
1253
|
-
o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (
|
|
1278
|
+
var S, O;
|
|
1279
|
+
o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (S = window.instgrm) != null && S.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", Ve(t.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", ft(t.params)), y.setAttribute("video-typeStyle", `${u}`))), o == "inBox" && (y.setAttribute("video-typeStyle", `${u}`), u == "instagram" && ((O = window.instgrm) != null && O.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", Ve(t.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")));
|
|
1254
1280
|
},
|
|
1255
1281
|
open(y) {
|
|
1256
|
-
var
|
|
1257
|
-
const
|
|
1258
|
-
if (b.update(),
|
|
1259
|
-
const
|
|
1260
|
-
new ResizeObserver((
|
|
1261
|
-
|
|
1262
|
-
}).observe(
|
|
1263
|
-
}
|
|
1264
|
-
if (o == "inBox") {
|
|
1265
|
-
const A = g || ((U = s.querySelector("img")) == null ? void 0 : U.src);
|
|
1266
|
-
let z;
|
|
1267
|
-
A == null ? z = `
|
|
1268
|
-
<div
|
|
1269
|
-
class="photo-box"
|
|
1270
|
-
video-target
|
|
1271
|
-
video-mode="onPage"
|
|
1272
|
-
video-type="${u}"
|
|
1273
|
-
video-id="${l}"
|
|
1274
|
-
video-button="${m}"
|
|
1275
|
-
video-layout-no="${v}"
|
|
1276
|
-
video-starttime="${w}"
|
|
1277
|
-
>
|
|
1278
|
-
</div>` : z = `
|
|
1279
|
-
<div
|
|
1280
|
-
class="photo-box"
|
|
1281
|
-
video-target
|
|
1282
|
-
video-mode="onPage"
|
|
1283
|
-
video-type="${u}"
|
|
1284
|
-
video-id="${l}"
|
|
1285
|
-
video-button="${m}"
|
|
1286
|
-
video-layout-no="${v}"
|
|
1287
|
-
video-starttime="${w}"
|
|
1288
|
-
>
|
|
1289
|
-
<picture>
|
|
1290
|
-
<source
|
|
1291
|
-
srcset="${A}"
|
|
1292
|
-
type="image/webp"
|
|
1293
|
-
/>
|
|
1294
|
-
<source
|
|
1295
|
-
srcset="${A}"
|
|
1296
|
-
type="image/jpeg"
|
|
1297
|
-
/>
|
|
1298
|
-
<img src="${A}" alt="" />
|
|
1299
|
-
</picture>
|
|
1300
|
-
</div>`, y.querySelector(".video-content").insertAdjacentHTML(S.prepend, z);
|
|
1301
|
-
const Re = y.querySelectorAll("[video-target]");
|
|
1302
|
-
Re.length > 0 && new X(Re, {
|
|
1303
|
-
LAYOUT: t.params.LAYOUT,
|
|
1304
|
-
videoLayoutNo: t.params.videoLayoutNo
|
|
1305
|
-
});
|
|
1282
|
+
var O;
|
|
1283
|
+
const S = y.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1284
|
+
if (b.update(), Pi([...S]), u == "instagram") {
|
|
1285
|
+
const _ = document.querySelector("[video-template] .modal-content");
|
|
1286
|
+
new ResizeObserver((J) => {
|
|
1287
|
+
J[0].contentRect.height > 50 && _.classList.add("active");
|
|
1288
|
+
}).observe(_);
|
|
1306
1289
|
}
|
|
1290
|
+
if (o == "inBox")
|
|
1291
|
+
if (u == "instagram")
|
|
1292
|
+
f(".video-content").remove();
|
|
1293
|
+
else {
|
|
1294
|
+
let _;
|
|
1295
|
+
const U = y.querySelector(".video-content");
|
|
1296
|
+
d(O = e, nt, Oe).call(O, t.params).then((J) => {
|
|
1297
|
+
_ = `
|
|
1298
|
+
<div
|
|
1299
|
+
class="photo-box"
|
|
1300
|
+
video-target
|
|
1301
|
+
video-mode="onPage"
|
|
1302
|
+
video-type="${u}"
|
|
1303
|
+
video-id="${l}"
|
|
1304
|
+
video-button="${m}"
|
|
1305
|
+
video-layout-no="${v}"
|
|
1306
|
+
video-starttime="${w}"
|
|
1307
|
+
>
|
|
1308
|
+
<picture>
|
|
1309
|
+
<source
|
|
1310
|
+
srcset="${J || ""}"
|
|
1311
|
+
type="image/webp"
|
|
1312
|
+
/>
|
|
1313
|
+
<source
|
|
1314
|
+
srcset="${J || ""}"
|
|
1315
|
+
type="image/jpeg"
|
|
1316
|
+
/>
|
|
1317
|
+
<img src="${J || ""}" alt="" />
|
|
1318
|
+
</picture>
|
|
1319
|
+
</div>`, U.insertAdjacentHTML(L.prepend, _);
|
|
1320
|
+
const Ue = y.querySelectorAll("[video-target]");
|
|
1321
|
+
Ue.length > 0 && new X(Ue, {
|
|
1322
|
+
LAYOUT: t.params.LAYOUT,
|
|
1323
|
+
videoLayoutNo: t.params.videoLayoutNo
|
|
1324
|
+
});
|
|
1325
|
+
});
|
|
1326
|
+
}
|
|
1307
1327
|
e == null || e.emit("openModal");
|
|
1308
1328
|
},
|
|
1309
1329
|
close(y) {
|
|
1310
|
-
const
|
|
1311
|
-
|
|
1330
|
+
const S = y.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1331
|
+
Ni([...S]), e == null || e.emit("closeModal");
|
|
1312
1332
|
},
|
|
1313
1333
|
destroy(y) {
|
|
1314
1334
|
}
|
|
1315
1335
|
}
|
|
1316
1336
|
};
|
|
1317
|
-
|
|
1337
|
+
V.open(C);
|
|
1318
1338
|
} else if (o == "onPage")
|
|
1319
1339
|
if (t.params.videoAutoplay = "on", r == "off") {
|
|
1320
1340
|
if (s.querySelector("video-player"))
|
|
1321
1341
|
return;
|
|
1322
|
-
s.innerHTML =
|
|
1342
|
+
s.innerHTML = ft(t.params);
|
|
1323
1343
|
return;
|
|
1324
1344
|
} else {
|
|
1325
|
-
(s.querySelector(r) ?? s).insertAdjacentHTML("beforeend",
|
|
1345
|
+
(s.querySelector(r) ?? s).insertAdjacentHTML("beforeend", ft(t.params));
|
|
1326
1346
|
return;
|
|
1327
1347
|
}
|
|
1328
|
-
},
|
|
1348
|
+
}, Gt = new WeakSet(), Bi = function(i) {
|
|
1329
1349
|
const t = this.options;
|
|
1330
1350
|
return {
|
|
1331
1351
|
$selector: i,
|
|
@@ -1345,11 +1365,11 @@ it = new WeakSet(), He = function() {
|
|
|
1345
1365
|
videoInboxImg: i.getAttribute("video-inbox-img") || t.videoInboxImgHtml,
|
|
1346
1366
|
LAYOUT: t.LAYOUT || []
|
|
1347
1367
|
};
|
|
1348
|
-
},
|
|
1349
|
-
let
|
|
1350
|
-
Object.assign(
|
|
1351
|
-
customElements.define("video-player",
|
|
1352
|
-
const
|
|
1368
|
+
}, Je(X, "globalOptions", {});
|
|
1369
|
+
let Ie = X;
|
|
1370
|
+
Object.assign(Ie.prototype, z);
|
|
1371
|
+
customElements.define("video-player", Fs);
|
|
1372
|
+
const Qs = {
|
|
1353
1373
|
"zh-tw": {
|
|
1354
1374
|
臺北市: [
|
|
1355
1375
|
["中正區", "100"],
|
|
@@ -2179,9 +2199,9 @@ const Fs = {
|
|
|
2179
2199
|
]
|
|
2180
2200
|
}
|
|
2181
2201
|
};
|
|
2182
|
-
let
|
|
2183
|
-
const
|
|
2184
|
-
const { TEMPLATE: i } =
|
|
2202
|
+
let K;
|
|
2203
|
+
const Ks = (n) => {
|
|
2204
|
+
const { TEMPLATE: i } = Ye, { 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");
|
|
2185
2205
|
e.innerHTML = i(
|
|
2186
2206
|
s,
|
|
2187
2207
|
o,
|
|
@@ -2194,12 +2214,12 @@ const Us = (n) => {
|
|
|
2194
2214
|
(!p.hasAttribute("data-option") || p.getAttribute("data-option").trim() === "") && p.setAttribute("data-option", p.textContent.trim());
|
|
2195
2215
|
}) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
|
|
2196
2216
|
}), e.children[0];
|
|
2197
|
-
},
|
|
2217
|
+
}, Vs = (n) => {
|
|
2198
2218
|
var t;
|
|
2199
2219
|
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
|
2200
2220
|
i && i.forEach((e) => {
|
|
2201
2221
|
const s = document.querySelector(e);
|
|
2202
|
-
s ||
|
|
2222
|
+
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 && I(s, [...s.s.allLi].indexOf(s.s.activeLi)));
|
|
2203
2223
|
});
|
|
2204
2224
|
}, I = (n, i) => {
|
|
2205
2225
|
const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
|
|
@@ -2242,7 +2262,7 @@ const Us = (n) => {
|
|
|
2242
2262
|
const o = n.querySelectorAll(".dropdown-list li.active");
|
|
2243
2263
|
o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
|
|
2244
2264
|
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>`;
|
|
2245
|
-
n.s.selectDisplayEl.insertAdjacentHTML(
|
|
2265
|
+
n.s.selectDisplayEl.insertAdjacentHTML(L.append, u);
|
|
2246
2266
|
})), n.s.activeLi = o, n.s.value = [...o].map((r) => ({
|
|
2247
2267
|
index: [...e].indexOf(r),
|
|
2248
2268
|
id: r.getAttribute("data-option"),
|
|
@@ -2253,42 +2273,42 @@ const Us = (n) => {
|
|
|
2253
2273
|
break;
|
|
2254
2274
|
}
|
|
2255
2275
|
}
|
|
2256
|
-
},
|
|
2276
|
+
}, tn = (n) => {
|
|
2257
2277
|
const i = n.s.cityLang;
|
|
2258
|
-
f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (
|
|
2278
|
+
f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (K = JSON.parse(f("#newCityData").val())[0], console.log([0])) : K = Qs, n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(K[i]).forEach((t) => {
|
|
2259
2279
|
const e = document.createElement("li");
|
|
2260
2280
|
e.textContent = t, e.setAttribute("data-option", t), n.s.dropdownEl.querySelector(".dropdown-list").append(e);
|
|
2261
2281
|
}), n.s.allLi = n.querySelectorAll(".dropdown-list li"));
|
|
2262
|
-
},
|
|
2282
|
+
}, en = (n, i) => {
|
|
2263
2283
|
const t = n.s.cityLang;
|
|
2264
|
-
|
|
2284
|
+
K[t][i].forEach((e, s) => {
|
|
2265
2285
|
const o = document.createElement("li");
|
|
2266
2286
|
o.textContent = e[0], o.setAttribute("data-option", e[0]), n.querySelector(".dropdown-list").append(o);
|
|
2267
2287
|
});
|
|
2268
|
-
},
|
|
2269
|
-
|
|
2288
|
+
}, Wi = () => {
|
|
2289
|
+
k('dropdown-el[d4-status="open"]').forEach((i) => {
|
|
2270
2290
|
i.close();
|
|
2271
2291
|
});
|
|
2272
|
-
},
|
|
2273
|
-
const { SETTINGS: n } =
|
|
2292
|
+
}, sn = () => {
|
|
2293
|
+
const { SETTINGS: n } = Ye;
|
|
2274
2294
|
((t, e) => {
|
|
2275
2295
|
Object.keys(e).forEach((s) => {
|
|
2276
2296
|
t.style.setProperty(`--${s}`, e[s]);
|
|
2277
2297
|
});
|
|
2278
2298
|
})(document.documentElement, n.scrollbar);
|
|
2279
2299
|
};
|
|
2280
|
-
|
|
2300
|
+
sn();
|
|
2281
2301
|
document.addEventListener("click", function() {
|
|
2282
|
-
|
|
2302
|
+
Wi();
|
|
2283
2303
|
});
|
|
2284
|
-
var
|
|
2285
|
-
class
|
|
2304
|
+
var Rt, Ri, Xt, Xi, Yt, Yi, Ft, Fi;
|
|
2305
|
+
class Gi extends HTMLElement {
|
|
2286
2306
|
constructor() {
|
|
2287
2307
|
super();
|
|
2288
|
-
h(this, Bt);
|
|
2289
|
-
h(this, Wt);
|
|
2290
|
-
h(this, Gt);
|
|
2291
2308
|
h(this, Rt);
|
|
2309
|
+
h(this, Xt);
|
|
2310
|
+
h(this, Yt);
|
|
2311
|
+
h(this, Ft);
|
|
2292
2312
|
this.initialize = !1;
|
|
2293
2313
|
}
|
|
2294
2314
|
static get observedAttributes() {
|
|
@@ -2309,13 +2329,13 @@ class Pi extends HTMLElement {
|
|
|
2309
2329
|
switch (o.hasAttribute("multiple") ? "multiple" : "single") {
|
|
2310
2330
|
case "single":
|
|
2311
2331
|
const r = o.querySelector(`.dropdown-list li[data-option="${s}"]`);
|
|
2312
|
-
|
|
2332
|
+
A(r) ? I(o, [...o.s.allLi].indexOf(r)) : I(o, -1);
|
|
2313
2333
|
break;
|
|
2314
2334
|
case "multiple":
|
|
2315
2335
|
const l = [];
|
|
2316
2336
|
o.querySelector(".dropdown-list li").classList.remove("active"), s.split(",").forEach((u) => {
|
|
2317
2337
|
const p = o.querySelector(`.dropdown-list li[data-option="${u}"]`);
|
|
2318
|
-
|
|
2338
|
+
A(p) && (p.classList.add("active"), l.push(p));
|
|
2319
2339
|
});
|
|
2320
2340
|
const c = l.map((u) => [...o.s.allLi].indexOf(u));
|
|
2321
2341
|
I(o, c);
|
|
@@ -2334,11 +2354,11 @@ class Pi extends HTMLElement {
|
|
|
2334
2354
|
}
|
|
2335
2355
|
connectedCallback() {
|
|
2336
2356
|
const t = this;
|
|
2337
|
-
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this,
|
|
2357
|
+
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, Rt, Ri).call(this));
|
|
2338
2358
|
}
|
|
2339
2359
|
open() {
|
|
2340
2360
|
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;
|
|
2341
|
-
return
|
|
2361
|
+
return Wi(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.style.cssText = `--maxHeight: ${o()}px;`, t.s.dropdownEl.style.cssText = `
|
|
2342
2362
|
height: ${o()}px;
|
|
2343
2363
|
z-index: 2;
|
|
2344
2364
|
`, this;
|
|
@@ -2360,14 +2380,14 @@ class Pi extends HTMLElement {
|
|
|
2360
2380
|
this.__events__.selectOption();
|
|
2361
2381
|
}
|
|
2362
2382
|
}
|
|
2363
|
-
|
|
2364
|
-
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this,
|
|
2365
|
-
},
|
|
2366
|
-
this.s.childDom = this.childNodes, this.s.template =
|
|
2367
|
-
},
|
|
2383
|
+
Rt = new WeakSet(), Ri = function() {
|
|
2384
|
+
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Xt, Xi).call(this);
|
|
2385
|
+
}, Xt = new WeakSet(), Xi = function() {
|
|
2386
|
+
this.s.childDom = this.childNodes, this.s.template = Ks(this), this.innerHTML = "", this.append(this.s.template), d(this, Yt, Yi).call(this);
|
|
2387
|
+
}, Yt = new WeakSet(), Yi = function() {
|
|
2368
2388
|
var s;
|
|
2369
2389
|
const t = this;
|
|
2370
|
-
t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.dropdownEl = t.querySelector(".dropdown"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw",
|
|
2390
|
+
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", tn(t), t.s.subDropdownTotalH = 0;
|
|
2371
2391
|
const e = t.getAttribute("d4-value");
|
|
2372
2392
|
switch (t.s.selectType) {
|
|
2373
2393
|
case "single":
|
|
@@ -2376,14 +2396,14 @@ Bt = new WeakSet(), ji = function() {
|
|
|
2376
2396
|
const r = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), l = r ? r.getAttribute("d4-value") !== "" : !1;
|
|
2377
2397
|
if (r && l) {
|
|
2378
2398
|
const c = r.getAttribute("d4-value");
|
|
2379
|
-
if (
|
|
2399
|
+
if (en(t, c), t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
|
|
2380
2400
|
const u = e.split(",")[1];
|
|
2381
2401
|
o = t.querySelector(`.dropdown-list li[data-option="${u}"]`), t.setAttribute("d4-value", u);
|
|
2382
2402
|
}
|
|
2383
2403
|
}
|
|
2384
2404
|
} else
|
|
2385
2405
|
o = t.querySelector(`.dropdown-list li[data-option="${e}"]`);
|
|
2386
|
-
|
|
2406
|
+
A(o) ? (o.classList.add("active"), t.s.activeLi = o, t.s.value = {
|
|
2387
2407
|
index: [...t.s.allLi].indexOf(o),
|
|
2388
2408
|
id: e,
|
|
2389
2409
|
el: o
|
|
@@ -2397,7 +2417,7 @@ Bt = new WeakSet(), ji = function() {
|
|
|
2397
2417
|
const a = [];
|
|
2398
2418
|
e.split(",").forEach((r) => {
|
|
2399
2419
|
const l = t.querySelector(`.dropdown-list li[data-option="${r}"]`);
|
|
2400
|
-
|
|
2420
|
+
A(l) && a.push(l);
|
|
2401
2421
|
}), a.length > 0 ? t.s.value = {
|
|
2402
2422
|
index: a.map((r) => [...t.s.allLi].indexOf(r)),
|
|
2403
2423
|
id: a.map((r) => r.getAttribute("data-option")),
|
|
@@ -2409,8 +2429,8 @@ Bt = new WeakSet(), ji = function() {
|
|
|
2409
2429
|
};
|
|
2410
2430
|
break;
|
|
2411
2431
|
}
|
|
2412
|
-
I(t, t.s.value.index), d(s = t,
|
|
2413
|
-
},
|
|
2432
|
+
I(t, t.s.value.index), d(s = t, Ft, Fi).call(s), t.classList.add("d4-initialize");
|
|
2433
|
+
}, Ft = new WeakSet(), Fi = function() {
|
|
2414
2434
|
const t = this;
|
|
2415
2435
|
t.__events__.dropdownToggle = () => {
|
|
2416
2436
|
t.addEventListener("click", function(e) {
|
|
@@ -2432,7 +2452,7 @@ Bt = new WeakSet(), ji = function() {
|
|
|
2432
2452
|
const r = t.querySelector(".dropdown-scroller"), l = () => {
|
|
2433
2453
|
if (t.__scroller__) {
|
|
2434
2454
|
const { viewport: c } = t.__scroller__.elements();
|
|
2435
|
-
if (
|
|
2455
|
+
if (A(t.s.activeLi)) {
|
|
2436
2456
|
const u = t.s.activeLi.clientHeight / 2, p = t.s.activeLi.offsetTop, g = p - r.clientHeight / 2 + u > 0 ? p - r.clientHeight / 2 + u : 0;
|
|
2437
2457
|
c.scrollTo({
|
|
2438
2458
|
top: g,
|
|
@@ -2456,7 +2476,7 @@ Bt = new WeakSet(), ji = function() {
|
|
|
2456
2476
|
t.s.dropdownEl.addEventListener("transitionend", e);
|
|
2457
2477
|
}, t.__events__.bindScrollbar = (e = this) => {
|
|
2458
2478
|
const s = e.querySelector(".dropdown-scroller");
|
|
2459
|
-
e.__scroller__ =
|
|
2479
|
+
e.__scroller__ = Xe(s, {
|
|
2460
2480
|
overflowBehavior: {
|
|
2461
2481
|
x: "hidden"
|
|
2462
2482
|
}
|
|
@@ -2476,16 +2496,16 @@ Bt = new WeakSet(), ji = function() {
|
|
|
2476
2496
|
s = g + e.s.subDropdownTotalH, o = s > C ? C : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
|
|
2477
2497
|
};
|
|
2478
2498
|
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= T, y()) : (u.classList.add("open"), e.s.subDropdownTotalH += T, y());
|
|
2479
|
-
const
|
|
2480
|
-
e.__scroller__.update(!0), v.removeEventListener("transitionend",
|
|
2499
|
+
const S = () => {
|
|
2500
|
+
e.__scroller__.update(!0), v.removeEventListener("transitionend", S);
|
|
2481
2501
|
};
|
|
2482
|
-
v.addEventListener("transitionend",
|
|
2502
|
+
v.addEventListener("transitionend", S);
|
|
2483
2503
|
} else
|
|
2484
|
-
switch (
|
|
2504
|
+
switch (Vs(e), e.s.selectType) {
|
|
2485
2505
|
case "single":
|
|
2486
2506
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
|
2487
2507
|
const v = e.s.cityLang, w = l.textContent.trim(), b = document.getElementById(e.getAttribute("dist-select"));
|
|
2488
|
-
b && (b.querySelector(".dropdown-list").textContent = "", I(b, -1),
|
|
2508
|
+
b && (b.querySelector(".dropdown-list").textContent = "", I(b, -1), K[v][w].forEach((T, C) => {
|
|
2489
2509
|
const y = document.createElement("li");
|
|
2490
2510
|
y.textContent = T[0], y.setAttribute("data-option", T[0]), b.querySelector(".dropdown-list").append(y);
|
|
2491
2511
|
}), e.__events__.selectOption(b));
|
|
@@ -2526,9 +2546,9 @@ Bt = new WeakSet(), ji = function() {
|
|
|
2526
2546
|
});
|
|
2527
2547
|
}, t.__events__.dropdownToggle(), t.__events__.bindScrollbar(), t.__events__.selectOption(), t.__events__.filterHandler(), t.__events__.removeTag(), t.__events__.transitionend();
|
|
2528
2548
|
};
|
|
2529
|
-
Object.assign(
|
|
2530
|
-
customElements.define("dropdown-el",
|
|
2531
|
-
function
|
|
2549
|
+
Object.assign(Gi.prototype, z);
|
|
2550
|
+
customElements.define("dropdown-el", Gi);
|
|
2551
|
+
function bt(n) {
|
|
2532
2552
|
const i = {};
|
|
2533
2553
|
return [...n.attributes].forEach((t) => {
|
|
2534
2554
|
if (t.name.includes("duration-")) {
|
|
@@ -2537,10 +2557,10 @@ function gt(n) {
|
|
|
2537
2557
|
}
|
|
2538
2558
|
}), Object.keys(i).length === 0 ? null : i;
|
|
2539
2559
|
}
|
|
2540
|
-
function
|
|
2541
|
-
if (
|
|
2560
|
+
function ti(n) {
|
|
2561
|
+
if (bt(n)) {
|
|
2542
2562
|
let i;
|
|
2543
|
-
const t = Object.keys(
|
|
2563
|
+
const t = Object.keys(bt(n)).map((e) => ({
|
|
2544
2564
|
value: e,
|
|
2545
2565
|
point: e
|
|
2546
2566
|
}));
|
|
@@ -2549,11 +2569,11 @@ function Je(n) {
|
|
|
2549
2569
|
const { point: s, value: o } = t[e];
|
|
2550
2570
|
window.matchMedia(`(max-width: ${o}px)`).matches && (i = s);
|
|
2551
2571
|
}
|
|
2552
|
-
return i ? Number(
|
|
2572
|
+
return i ? Number(bt(n)[i]) : n.s.options.duration;
|
|
2553
2573
|
} else
|
|
2554
2574
|
return n.s.options.duration;
|
|
2555
2575
|
}
|
|
2556
|
-
function
|
|
2576
|
+
function nn(n) {
|
|
2557
2577
|
const { behavior: i, continual: t, gap: e } = n.s.options, s = n.childNodes, o = document.createElement("div"), a = document.createElement("div");
|
|
2558
2578
|
o.className = "animate-container", a.className = "animate-item", [...s].forEach((l) => {
|
|
2559
2579
|
a.append(l);
|
|
@@ -2620,20 +2640,20 @@ function H(n) {
|
|
|
2620
2640
|
}
|
|
2621
2641
|
return s;
|
|
2622
2642
|
}
|
|
2623
|
-
function
|
|
2643
|
+
function on(n) {
|
|
2624
2644
|
let i;
|
|
2625
2645
|
return function(t) {
|
|
2626
2646
|
i && clearTimeout(i), i = setTimeout(n, 200, t);
|
|
2627
2647
|
};
|
|
2628
2648
|
}
|
|
2629
|
-
var
|
|
2630
|
-
class
|
|
2649
|
+
var Ut, Ui, Jt, Ji, Zt, Zi, Qt, Qi;
|
|
2650
|
+
class an extends HTMLElement {
|
|
2631
2651
|
constructor() {
|
|
2632
2652
|
super();
|
|
2633
|
-
h(this, Xt);
|
|
2634
|
-
h(this, Yt);
|
|
2635
|
-
h(this, Ft);
|
|
2636
2653
|
h(this, Ut);
|
|
2654
|
+
h(this, Jt);
|
|
2655
|
+
h(this, Zt);
|
|
2656
|
+
h(this, Qt);
|
|
2637
2657
|
this.initialize = !1;
|
|
2638
2658
|
}
|
|
2639
2659
|
static get observedAttributes() {
|
|
@@ -2642,7 +2662,7 @@ class en extends HTMLElement {
|
|
|
2642
2662
|
attributeChangedCallback(t, e, s) {
|
|
2643
2663
|
}
|
|
2644
2664
|
connectedCallback() {
|
|
2645
|
-
this.initialize || (this.initialize = !0, d(this,
|
|
2665
|
+
this.initialize || (this.initialize = !0, d(this, Ut, Ui).call(this));
|
|
2646
2666
|
}
|
|
2647
2667
|
play() {
|
|
2648
2668
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
|
@@ -2651,7 +2671,7 @@ class en extends HTMLElement {
|
|
|
2651
2671
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
|
2652
2672
|
}
|
|
2653
2673
|
}
|
|
2654
|
-
|
|
2674
|
+
Ut = new WeakSet(), Ui = function() {
|
|
2655
2675
|
const t = {
|
|
2656
2676
|
direction: this.getAttribute("direction") || M.SETTINGS.direction,
|
|
2657
2677
|
// up / down / left / right
|
|
@@ -2659,7 +2679,7 @@ Xt = new WeakSet(), Gi = function() {
|
|
|
2659
2679
|
// normal / alternate / endStop
|
|
2660
2680
|
duration: Number(this.getAttribute("duration")) || M.SETTINGS.duration,
|
|
2661
2681
|
// ms
|
|
2662
|
-
durationBreakpoints:
|
|
2682
|
+
durationBreakpoints: bt(this) || M.SETTINGS.durationBreakpoints,
|
|
2663
2683
|
autoplay: this.getAttribute("autoplay") || M.SETTINGS.autoplay,
|
|
2664
2684
|
// normal / alternate / endStop
|
|
2665
2685
|
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : M.SETTINGS.pauseOnMouseenter,
|
|
@@ -2668,8 +2688,8 @@ Xt = new WeakSet(), Gi = function() {
|
|
|
2668
2688
|
// true / false
|
|
2669
2689
|
gap: Number(this.getAttribute("gap")) || M.SETTINGS.gap
|
|
2670
2690
|
};
|
|
2671
|
-
this.s = {}, this.s.options = t, this.s.nowDuration =
|
|
2672
|
-
},
|
|
2691
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = ti(this), nn(this), d(this, Jt, Ji).call(this);
|
|
2692
|
+
}, Jt = new WeakSet(), Ji = function() {
|
|
2673
2693
|
const { direction: t, continual: e, gap: s } = this.s.options;
|
|
2674
2694
|
switch (t) {
|
|
2675
2695
|
case "left":
|
|
@@ -2681,8 +2701,8 @@ Xt = new WeakSet(), Gi = function() {
|
|
|
2681
2701
|
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;`;
|
|
2682
2702
|
break;
|
|
2683
2703
|
}
|
|
2684
|
-
d(this,
|
|
2685
|
-
},
|
|
2704
|
+
d(this, Zt, Zi).call(this), d(this, Qt, Qi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
|
|
2705
|
+
}, Zt = new WeakSet(), Zi = function() {
|
|
2686
2706
|
const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
|
|
2687
2707
|
let c;
|
|
2688
2708
|
function u() {
|
|
@@ -2747,11 +2767,11 @@ Xt = new WeakSet(), Gi = function() {
|
|
|
2747
2767
|
}), t.addEventListener("mouseleave", function() {
|
|
2748
2768
|
t.s.animation && r && t.s.animation.playState === "paused" && t.play();
|
|
2749
2769
|
});
|
|
2750
|
-
},
|
|
2770
|
+
}, Qt = new WeakSet(), Qi = function() {
|
|
2751
2771
|
const t = this;
|
|
2752
2772
|
function e() {
|
|
2753
2773
|
const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
|
2754
|
-
t.s.nowDuration =
|
|
2774
|
+
t.s.nowDuration = ti(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(H(t).animate1, {
|
|
2755
2775
|
duration: t.s.nowDuration,
|
|
2756
2776
|
iterations: 1 / 0
|
|
2757
2777
|
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(H(t).animate2, {
|
|
@@ -2760,24 +2780,24 @@ Xt = new WeakSet(), Gi = function() {
|
|
|
2760
2780
|
iterations: 1 / 0
|
|
2761
2781
|
}), t.s.cloneAnimation.startTime = o);
|
|
2762
2782
|
}
|
|
2763
|
-
window.addEventListener("resize",
|
|
2783
|
+
window.addEventListener("resize", on(e));
|
|
2764
2784
|
};
|
|
2765
|
-
customElements.define("marquee-el",
|
|
2766
|
-
const
|
|
2785
|
+
customElements.define("marquee-el", an);
|
|
2786
|
+
const ei = function(n, i) {
|
|
2767
2787
|
let t;
|
|
2768
2788
|
return function(e) {
|
|
2769
2789
|
t && clearTimeout(t), t = setTimeout(n, 200, e);
|
|
2770
2790
|
};
|
|
2771
2791
|
}, x = (n, i) => {
|
|
2772
|
-
if (
|
|
2792
|
+
if (mt(n)) {
|
|
2773
2793
|
n.forEach((t) => {
|
|
2774
2794
|
t.classList.add(i);
|
|
2775
2795
|
});
|
|
2776
2796
|
return;
|
|
2777
2797
|
}
|
|
2778
2798
|
n.classList.add(i);
|
|
2779
|
-
},
|
|
2780
|
-
if (
|
|
2799
|
+
}, $ = (n, i) => {
|
|
2800
|
+
if (mt(n)) {
|
|
2781
2801
|
n.forEach((t) => {
|
|
2782
2802
|
t.classList.remove(i);
|
|
2783
2803
|
});
|
|
@@ -2785,22 +2805,22 @@ const Ze = function(n, i) {
|
|
|
2785
2805
|
}
|
|
2786
2806
|
n.classList.remove(i);
|
|
2787
2807
|
};
|
|
2788
|
-
var
|
|
2789
|
-
class
|
|
2808
|
+
var Kt, Ki, Vt, Vi, te, ts, rt, je, Y, yt, ee, es;
|
|
2809
|
+
class ii {
|
|
2790
2810
|
constructor(i) {
|
|
2791
2811
|
// 初始化
|
|
2792
|
-
h(this,
|
|
2812
|
+
h(this, Kt);
|
|
2793
2813
|
// 左右箭頭事件綁定
|
|
2794
|
-
h(this,
|
|
2814
|
+
h(this, Vt);
|
|
2795
2815
|
// 左右拖拉事件綁定
|
|
2796
|
-
h(this,
|
|
2816
|
+
h(this, te);
|
|
2797
2817
|
// 卷軸位置判斷
|
|
2798
|
-
h(this,
|
|
2818
|
+
h(this, rt);
|
|
2799
2819
|
// 隱藏按鈕判斷
|
|
2800
2820
|
h(this, Y);
|
|
2801
2821
|
// 選項事件綁定
|
|
2802
|
-
h(this,
|
|
2803
|
-
this.$element = i, this.option = i.s.option.drag, this._didInitialScroll = !1, d(this,
|
|
2822
|
+
h(this, ee);
|
|
2823
|
+
this.$element = i, this.option = i.s.option.drag, this._didInitialScroll = !1, d(this, Kt, Ki).call(this);
|
|
2804
2824
|
}
|
|
2805
2825
|
// 更新 active 位置
|
|
2806
2826
|
update(i = !1) {
|
|
@@ -2821,7 +2841,7 @@ class Qe {
|
|
|
2821
2841
|
s();
|
|
2822
2842
|
}
|
|
2823
2843
|
}
|
|
2824
|
-
|
|
2844
|
+
Kt = new WeakSet(), Ki = function() {
|
|
2825
2845
|
var s, o, a, r;
|
|
2826
2846
|
const i = this;
|
|
2827
2847
|
if (!i.$element)
|
|
@@ -2830,11 +2850,11 @@ Jt = new WeakSet(), Fi = function() {
|
|
|
2830
2850
|
let t = !1;
|
|
2831
2851
|
const e = () => {
|
|
2832
2852
|
t || (requestAnimationFrame(() => {
|
|
2833
|
-
d(this,
|
|
2853
|
+
d(this, rt, je).call(this), d(this, Y, yt).call(this), t = !1;
|
|
2834
2854
|
}), t = !0);
|
|
2835
2855
|
};
|
|
2836
|
-
i.$wrapper.removeEventListener("scroll", e), i.$wrapper.addEventListener("scroll", e), window.removeEventListener("resize", e), window.addEventListener("resize", e), (i.option.draggable || i.$element.s.type == "collapse") && d(s = i,
|
|
2837
|
-
|
|
2856
|
+
i.$wrapper.removeEventListener("scroll", e), i.$wrapper.addEventListener("scroll", e), window.removeEventListener("resize", e), window.addEventListener("resize", e), (i.option.draggable || i.$element.s.type == "collapse") && d(s = i, te, ts).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
|
2857
|
+
L.prepend,
|
|
2838
2858
|
`<div class="navigation">
|
|
2839
2859
|
<div class="button prev">
|
|
2840
2860
|
<div></div>
|
|
@@ -2843,10 +2863,10 @@ Jt = new WeakSet(), Fi = function() {
|
|
|
2843
2863
|
<div></div>
|
|
2844
2864
|
</div>
|
|
2845
2865
|
</div>`
|
|
2846
|
-
), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i,
|
|
2847
|
-
d(this,
|
|
2866
|
+
), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i, Vt, Vi).call(a)), d(r = i, ee, es).call(r), i.update(!0), requestAnimationFrame(() => {
|
|
2867
|
+
d(this, rt, je).call(this), d(this, Y, yt).call(this);
|
|
2848
2868
|
});
|
|
2849
|
-
},
|
|
2869
|
+
}, Vt = new WeakSet(), Vi = function() {
|
|
2850
2870
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
|
2851
2871
|
const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
|
|
2852
2872
|
t.scrollTo({
|
|
@@ -2854,13 +2874,13 @@ Jt = new WeakSet(), Fi = function() {
|
|
|
2854
2874
|
behavior: "smooth"
|
|
2855
2875
|
}), setTimeout(() => {
|
|
2856
2876
|
var r;
|
|
2857
|
-
d(r = i, Y,
|
|
2877
|
+
d(r = i, Y, yt).call(r);
|
|
2858
2878
|
}, 100);
|
|
2859
2879
|
};
|
|
2860
2880
|
e.forEach((o) => {
|
|
2861
2881
|
o.removeEventListener("click", s), o.addEventListener("click", s);
|
|
2862
2882
|
});
|
|
2863
|
-
},
|
|
2883
|
+
}, te = new WeakSet(), ts = function() {
|
|
2864
2884
|
const { $wrapper: i } = this;
|
|
2865
2885
|
let t = !1, e = !1, s = 0, o = 0;
|
|
2866
2886
|
const a = function(p) {
|
|
@@ -2890,21 +2910,21 @@ Jt = new WeakSet(), Fi = function() {
|
|
|
2890
2910
|
i.querySelectorAll("a").forEach((p) => {
|
|
2891
2911
|
p.removeEventListener("click", u), p.addEventListener("click", u);
|
|
2892
2912
|
});
|
|
2893
|
-
},
|
|
2913
|
+
}, rt = new WeakSet(), je = function() {
|
|
2894
2914
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
|
|
2895
|
-
e <= 0 || (x(i, "scrollable"), s == 0 ? (x(t, "start"),
|
|
2896
|
-
}, Y = new WeakSet(),
|
|
2915
|
+
e <= 0 || (x(i, "scrollable"), s == 0 ? (x(t, "start"), $(t, "end")) : s + 1 >= e ? ($(t, "start"), x(t, "end")) : (x(t, "center"), $(t, "start"), $(t, "end")));
|
|
2916
|
+
}, Y = new WeakSet(), yt = function() {
|
|
2897
2917
|
const { $wrapper: i, $button: t, $element: e } = this;
|
|
2898
2918
|
if (!t)
|
|
2899
2919
|
return;
|
|
2900
2920
|
const s = i.scrollWidth - i.clientWidth, o = i.scrollLeft;
|
|
2901
2921
|
if (s <= 0) {
|
|
2902
|
-
x(t, "hide"),
|
|
2922
|
+
x(t, "hide"), $(t, "active"), x(e, "noScrollable");
|
|
2903
2923
|
return;
|
|
2904
2924
|
}
|
|
2905
|
-
s > 0 && (x(t, "active"),
|
|
2925
|
+
s > 0 && (x(t, "active"), $(e, "noScrollable")), o == 0 ? t.forEach((a) => {
|
|
2906
2926
|
if (a.classList.contains("next")) {
|
|
2907
|
-
|
|
2927
|
+
$(a, "hide");
|
|
2908
2928
|
return;
|
|
2909
2929
|
}
|
|
2910
2930
|
x(a, "hide");
|
|
@@ -2913,9 +2933,9 @@ Jt = new WeakSet(), Fi = function() {
|
|
|
2913
2933
|
x(a, "hide");
|
|
2914
2934
|
return;
|
|
2915
2935
|
}
|
|
2916
|
-
|
|
2917
|
-
}) :
|
|
2918
|
-
},
|
|
2936
|
+
$(a, "hide");
|
|
2937
|
+
}) : $(t, "hide");
|
|
2938
|
+
}, ee = new WeakSet(), es = function() {
|
|
2919
2939
|
const { $element: i } = this, t = (s) => {
|
|
2920
2940
|
if (this.option.selected) {
|
|
2921
2941
|
const o = s.getAttribute("data-option").trim();
|
|
@@ -2929,31 +2949,31 @@ Jt = new WeakSet(), Fi = function() {
|
|
|
2929
2949
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
|
2930
2950
|
});
|
|
2931
2951
|
};
|
|
2932
|
-
var
|
|
2933
|
-
class
|
|
2952
|
+
var ie, is, se, ss, ne, ns, oe, os;
|
|
2953
|
+
class rn {
|
|
2934
2954
|
constructor(i) {
|
|
2935
2955
|
// 初始化
|
|
2936
|
-
h(this,
|
|
2956
|
+
h(this, ie);
|
|
2937
2957
|
// 隱藏按鈕判斷
|
|
2938
|
-
h(this,
|
|
2958
|
+
h(this, se);
|
|
2939
2959
|
// 展開箭頭事件綁定
|
|
2940
|
-
h(this,
|
|
2960
|
+
h(this, ne);
|
|
2941
2961
|
// 選項事件綁定
|
|
2942
|
-
h(this,
|
|
2943
|
-
this.$element = i, this.option = i.s.option.collapse, d(this,
|
|
2962
|
+
h(this, oe);
|
|
2963
|
+
this.$element = i, this.option = i.s.option.collapse, d(this, ie, is).call(this);
|
|
2944
2964
|
}
|
|
2945
2965
|
}
|
|
2946
|
-
|
|
2947
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this,
|
|
2948
|
-
},
|
|
2966
|
+
ie = new WeakSet(), is = function() {
|
|
2967
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, se, ss).call(this) && d(this, ne, ns).call(this), d(this, oe, os).call(this));
|
|
2968
|
+
}, se = new WeakSet(), ss = function() {
|
|
2949
2969
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
|
2950
|
-
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(
|
|
2951
|
-
},
|
|
2970
|
+
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(L.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), $(this.$element, "noScrollable"), !0) : (x(this.$element, "noScrollable"), !1);
|
|
2971
|
+
}, ne = new WeakSet(), ns = function() {
|
|
2952
2972
|
const { $element: i, $button: t } = this, e = function() {
|
|
2953
2973
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
|
2954
2974
|
};
|
|
2955
2975
|
t.removeEventListener("click", e), t.addEventListener("click", e);
|
|
2956
|
-
},
|
|
2976
|
+
}, oe = new WeakSet(), os = function() {
|
|
2957
2977
|
const { $element: i } = this, t = (s, o) => {
|
|
2958
2978
|
if (i != null && i.classList.contains("expand") ? i == null || i.classList.remove("expand") : i == null || i.classList.add("expand"), this.option.selected) {
|
|
2959
2979
|
const a = s.getAttribute("data-option").trim();
|
|
@@ -2967,18 +2987,18 @@ Vt = new WeakSet(), Qi = function() {
|
|
|
2967
2987
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
|
2968
2988
|
});
|
|
2969
2989
|
};
|
|
2970
|
-
const
|
|
2990
|
+
const ln = (n) => {
|
|
2971
2991
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
|
2972
|
-
return i == "drag" && (s.innerHTML = q.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(
|
|
2992
|
+
return i == "drag" && (s.innerHTML = q.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(L.append, e)), i == "collapse" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(L.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(L.append, e)), i == "dropdown" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(L.append, e)), s.children;
|
|
2973
2993
|
};
|
|
2974
|
-
var
|
|
2975
|
-
class
|
|
2994
|
+
var ae, as, re, rs, lt, ze, F, wt;
|
|
2995
|
+
class cn extends HTMLElement {
|
|
2976
2996
|
constructor() {
|
|
2977
2997
|
super();
|
|
2978
|
-
h(this,
|
|
2979
|
-
h(this,
|
|
2998
|
+
h(this, ae);
|
|
2999
|
+
h(this, re);
|
|
2980
3000
|
// 斷點設定
|
|
2981
|
-
h(this,
|
|
3001
|
+
h(this, lt);
|
|
2982
3002
|
// check type
|
|
2983
3003
|
h(this, F);
|
|
2984
3004
|
this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
|
@@ -2992,7 +3012,7 @@ class on extends HTMLElement {
|
|
|
2992
3012
|
case "m4-type":
|
|
2993
3013
|
if (e === null || e === s)
|
|
2994
3014
|
return;
|
|
2995
|
-
this.s.type = s, d(this, F,
|
|
3015
|
+
this.s.type = s, d(this, F, wt).call(this);
|
|
2996
3016
|
break;
|
|
2997
3017
|
case "m4-status":
|
|
2998
3018
|
if (e === s)
|
|
@@ -3009,13 +3029,13 @@ class on extends HTMLElement {
|
|
|
3009
3029
|
}
|
|
3010
3030
|
}
|
|
3011
3031
|
connectedCallback() {
|
|
3012
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this,
|
|
3032
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, ae, as).call(this));
|
|
3013
3033
|
}
|
|
3014
3034
|
update() {
|
|
3015
|
-
d(this,
|
|
3035
|
+
d(this, lt, ze).call(this);
|
|
3016
3036
|
}
|
|
3017
3037
|
}
|
|
3018
|
-
|
|
3038
|
+
ae = new WeakSet(), as = function() {
|
|
3019
3039
|
let t = {};
|
|
3020
3040
|
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? q.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
|
3021
3041
|
const e = (s) => {
|
|
@@ -3026,84 +3046,84 @@ se = new WeakSet(), es = function() {
|
|
|
3026
3046
|
}
|
|
3027
3047
|
this.update();
|
|
3028
3048
|
};
|
|
3029
|
-
window.removeEventListener("resize",
|
|
3030
|
-
},
|
|
3031
|
-
this.classList.add("m4-init"), d(this,
|
|
3032
|
-
},
|
|
3049
|
+
window.removeEventListener("resize", ei(e)), window.addEventListener("resize", ei(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, q.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, q.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, q.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, q.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, re, rs).call(this);
|
|
3050
|
+
}, re = new WeakSet(), rs = function() {
|
|
3051
|
+
this.classList.add("m4-init"), d(this, lt, ze).call(this);
|
|
3052
|
+
}, lt = new WeakSet(), ze = function() {
|
|
3033
3053
|
const t = Object.keys(this.s.option.breakpoint);
|
|
3034
3054
|
if (!t.length) {
|
|
3035
|
-
d(this, F,
|
|
3055
|
+
d(this, F, wt).call(this);
|
|
3036
3056
|
return;
|
|
3037
3057
|
}
|
|
3038
3058
|
t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
|
|
3039
3059
|
var s, o, a, r;
|
|
3040
|
-
return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this, F,
|
|
3060
|
+
return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this, F, wt).call(this), window.innerWidth >= e;
|
|
3041
3061
|
});
|
|
3042
|
-
}, F = new WeakSet(),
|
|
3062
|
+
}, F = new WeakSet(), wt = function() {
|
|
3043
3063
|
var o;
|
|
3044
3064
|
const { type: t } = this.s;
|
|
3045
|
-
this.innerHTML = "", [...
|
|
3065
|
+
this.innerHTML = "", [...ln(this)].forEach((a) => {
|
|
3046
3066
|
this.append(a);
|
|
3047
3067
|
});
|
|
3048
3068
|
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")}"]`);
|
|
3049
3069
|
switch (e == null || e.classList.add("active"), s == null || s.classList.add("active"), t) {
|
|
3050
3070
|
case "drag":
|
|
3051
|
-
this.drag = new
|
|
3071
|
+
this.drag = new ii(this);
|
|
3052
3072
|
break;
|
|
3053
3073
|
case "collapse":
|
|
3054
|
-
this.drag = new
|
|
3074
|
+
this.drag = new ii(this), this.collapse = new rn(this);
|
|
3055
3075
|
break;
|
|
3056
3076
|
}
|
|
3057
3077
|
(o = this.drag) == null || o.update();
|
|
3058
3078
|
};
|
|
3059
|
-
customElements.define("multipurpose-nav",
|
|
3060
|
-
var
|
|
3061
|
-
class
|
|
3079
|
+
customElements.define("multipurpose-nav", cn);
|
|
3080
|
+
var le, cs, ce, ds, ct, Be, W, Z, de, us, ue, hs, he, ps, pe, ms, me, gs, ge, fs, fe, vs, ve, bs, be, ys, N, R, ye, ws, we, Ts, Te, Es, Ee, As;
|
|
3081
|
+
class ls extends HTMLElement {
|
|
3062
3082
|
// 定義組件的初始狀態
|
|
3063
3083
|
constructor(t, e) {
|
|
3064
3084
|
super();
|
|
3065
|
-
h(this,
|
|
3066
|
-
h(this,
|
|
3085
|
+
h(this, le);
|
|
3086
|
+
h(this, ce);
|
|
3067
3087
|
// 第一關 判斷數量以及id設定
|
|
3068
|
-
h(this,
|
|
3088
|
+
h(this, ct);
|
|
3069
3089
|
// 第二關 id命名提醒
|
|
3070
3090
|
h(this, W);
|
|
3071
|
-
h(this,
|
|
3072
|
-
h(this,
|
|
3073
|
-
h(this,
|
|
3091
|
+
h(this, de);
|
|
3092
|
+
h(this, ue);
|
|
3093
|
+
h(this, he);
|
|
3074
3094
|
// 執行函式
|
|
3075
3095
|
// 移動至指定位置
|
|
3076
|
-
h(this,
|
|
3096
|
+
h(this, pe);
|
|
3077
3097
|
// 移動
|
|
3078
|
-
h(this,
|
|
3098
|
+
h(this, me);
|
|
3079
3099
|
// 步驟狀態
|
|
3080
|
-
h(this,
|
|
3100
|
+
h(this, ge);
|
|
3081
3101
|
// next 按鈕狀態
|
|
3082
|
-
h(this,
|
|
3102
|
+
h(this, fe);
|
|
3083
3103
|
// prev 按鈕狀態
|
|
3084
|
-
h(this,
|
|
3104
|
+
h(this, ve);
|
|
3085
3105
|
// 頁籤狀態
|
|
3086
|
-
h(this,
|
|
3106
|
+
h(this, be);
|
|
3087
3107
|
// 第三關各種元件判斷 及 執行
|
|
3088
3108
|
h(this, N);
|
|
3089
3109
|
// 消失動畫
|
|
3090
|
-
h(this,
|
|
3110
|
+
h(this, ye);
|
|
3091
3111
|
// 出現動畫
|
|
3092
|
-
h(this,
|
|
3112
|
+
h(this, we);
|
|
3093
3113
|
// 狀態
|
|
3094
|
-
h(this,
|
|
3114
|
+
h(this, Te);
|
|
3095
3115
|
// resize
|
|
3096
|
-
h(this,
|
|
3116
|
+
h(this, Ee);
|
|
3097
3117
|
}
|
|
3098
3118
|
// 當組件的屬性被更改時會被呼叫
|
|
3099
3119
|
static get observedAttributes() {
|
|
3100
3120
|
return ["t4-active"];
|
|
3101
3121
|
}
|
|
3102
3122
|
attributeChangedCallback(t, e, s) {
|
|
3103
|
-
t === "t4-active" && e !== s && d(this,
|
|
3123
|
+
t === "t4-active" && e !== s && d(this, Te, Es).call(this, s);
|
|
3104
3124
|
}
|
|
3105
3125
|
connectedCallback() {
|
|
3106
|
-
this.classList.contains("t4-initialize") || d(this,
|
|
3126
|
+
this.classList.contains("t4-initialize") || d(this, le, cs).call(this);
|
|
3107
3127
|
}
|
|
3108
3128
|
// ------------- 我是分隔線呦 -------------
|
|
3109
3129
|
// 頁籤切換
|
|
@@ -3117,28 +3137,28 @@ class ss extends HTMLElement {
|
|
|
3117
3137
|
setActiveTab(t) {
|
|
3118
3138
|
const { t: e } = this, s = t === "" ? e.tabPanels[0].getAttribute("t4-id") : t;
|
|
3119
3139
|
e.activeTab = s, this.setAttribute("t4-active", s);
|
|
3120
|
-
const o = d(this, W,
|
|
3140
|
+
const o = d(this, W, Z).call(this, s);
|
|
3121
3141
|
e.tabPanels.forEach((a, r) => {
|
|
3122
|
-
r === o ? d(this,
|
|
3142
|
+
r === o ? d(this, we, Ts).call(this, r) : d(this, ye, ws).call(this, r);
|
|
3123
3143
|
});
|
|
3124
3144
|
}
|
|
3125
3145
|
// 外部呼叫方法 $0.goNext()
|
|
3126
3146
|
goNext() {
|
|
3127
|
-
const t = d(this, W,
|
|
3147
|
+
const t = d(this, W, Z).call(this, this.t.activeTab), e = Math.min(this.t.tabPanels.length - 1, t + 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
|
3128
3148
|
this.setActiveTab(s);
|
|
3129
3149
|
}
|
|
3130
3150
|
// 外部呼叫方法 $0.goPrev()
|
|
3131
3151
|
goPrev() {
|
|
3132
|
-
const t = d(this, W,
|
|
3152
|
+
const t = d(this, W, Z).call(this, this.t.activeTab), e = Math.max(0, t - 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
|
3133
3153
|
this.setActiveTab(s);
|
|
3134
3154
|
}
|
|
3135
3155
|
// 外部呼叫方法 $0.update()
|
|
3136
3156
|
update() {
|
|
3137
|
-
this.t.tabs = d(this,
|
|
3157
|
+
this.t.tabs = d(this, ct, Be).call(this), Ls(), console.log("tab update!!!!");
|
|
3138
3158
|
}
|
|
3139
3159
|
}
|
|
3140
|
-
|
|
3141
|
-
const t = this.getAttribute("t4-name"), { SETTINGS: e } =
|
|
3160
|
+
le = new WeakSet(), cs = function() {
|
|
3161
|
+
const t = this.getAttribute("t4-name"), { SETTINGS: e } = ri;
|
|
3142
3162
|
document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
|
|
3143
3163
|
tabs: [],
|
|
3144
3164
|
name: t,
|
|
@@ -3157,36 +3177,36 @@ oe = new WeakSet(), ns = function() {
|
|
|
3157
3177
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
|
3158
3178
|
},
|
|
3159
3179
|
tabGroup: this.getAttribute("t4-group") || e.tabGroup
|
|
3160
|
-
}, this.__events__ = {}, this.t.tabs = d(this,
|
|
3161
|
-
},
|
|
3162
|
-
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this,
|
|
3180
|
+
}, this.__events__ = {}, this.t.tabs = d(this, ct, Be).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, ce, ds).call(this);
|
|
3181
|
+
}, ce = new WeakSet(), ds = function() {
|
|
3182
|
+
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, de, us).call(this), this.t.recordUrl) {
|
|
3163
3183
|
const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
|
|
3164
3184
|
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
|
3165
3185
|
}
|
|
3166
|
-
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this,
|
|
3167
|
-
},
|
|
3186
|
+
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, Ee, As).call(this);
|
|
3187
|
+
}, ct = new WeakSet(), Be = function() {
|
|
3168
3188
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
|
3169
3189
|
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) => {
|
|
3170
3190
|
s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
|
|
3171
3191
|
}), e;
|
|
3172
|
-
}, W = new WeakSet(),
|
|
3192
|
+
}, W = new WeakSet(), Z = function(t) {
|
|
3173
3193
|
const { t: e } = this, s = e.tabPanels.filter((a) => a.getAttribute("t4-id") === t);
|
|
3174
3194
|
s.length > 1 && console.warn("有兩個相同id設定", s);
|
|
3175
3195
|
const o = s[0];
|
|
3176
3196
|
return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
|
|
3177
|
-
},
|
|
3197
|
+
}, de = new WeakSet(), us = function() {
|
|
3178
3198
|
const t = document.createElement("div");
|
|
3179
3199
|
t.classList.add("swiper-container");
|
|
3180
3200
|
const e = document.createElement("div");
|
|
3181
3201
|
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
|
|
3182
3202
|
e.appendChild(s.cloneNode(!0));
|
|
3183
|
-
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this,
|
|
3184
|
-
},
|
|
3203
|
+
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, ue, hs).call(this);
|
|
3204
|
+
}, ue = new WeakSet(), hs = function() {
|
|
3185
3205
|
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
|
|
3186
3206
|
t.style.overflow = "hidden", e.style.display = "flex";
|
|
3187
3207
|
const o = s.length * 100 + "%";
|
|
3188
3208
|
e.style.width = o;
|
|
3189
|
-
},
|
|
3209
|
+
}, he = new WeakSet(), ps = function(t) {
|
|
3190
3210
|
const { t: e } = this;
|
|
3191
3211
|
if (e.recordUrl === "true") {
|
|
3192
3212
|
const s = new URLSearchParams(document.location.search);
|
|
@@ -3194,28 +3214,28 @@ oe = new WeakSet(), ns = function() {
|
|
|
3194
3214
|
const o = `${window.location.pathname}?${s.toString()}`;
|
|
3195
3215
|
history.replaceState({ t4Id: t }, "", o);
|
|
3196
3216
|
}
|
|
3197
|
-
},
|
|
3217
|
+
}, pe = new WeakSet(), ms = function() {
|
|
3198
3218
|
const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
|
|
3199
|
-
d(this,
|
|
3200
|
-
},
|
|
3219
|
+
d(this, me, gs).call(this, o);
|
|
3220
|
+
}, me = new WeakSet(), gs = function(t) {
|
|
3201
3221
|
window.scrollTo({
|
|
3202
3222
|
top: t,
|
|
3203
3223
|
behavior: "smooth"
|
|
3204
3224
|
});
|
|
3205
|
-
},
|
|
3225
|
+
}, ge = new WeakSet(), fs = function(t) {
|
|
3206
3226
|
let e = parseInt(t, 10) + 1;
|
|
3207
3227
|
this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
|
|
3208
|
-
},
|
|
3228
|
+
}, fe = new WeakSet(), vs = function(t) {
|
|
3209
3229
|
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;
|
|
3210
3230
|
e.forEach((a) => {
|
|
3211
3231
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
|
3212
3232
|
});
|
|
3213
|
-
},
|
|
3233
|
+
}, ve = new WeakSet(), bs = function(t) {
|
|
3214
3234
|
const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === 0;
|
|
3215
3235
|
e.forEach((a) => {
|
|
3216
3236
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
|
3217
3237
|
});
|
|
3218
|
-
},
|
|
3238
|
+
}, be = new WeakSet(), ys = function(t, e) {
|
|
3219
3239
|
this.t.tabGroup === "true" ? this.t.tabs.forEach((s, o) => {
|
|
3220
3240
|
o == t ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
|
|
3221
3241
|
}) : this.t.tabs.forEach((s, o) => {
|
|
@@ -3224,25 +3244,25 @@ oe = new WeakSet(), ns = function() {
|
|
|
3224
3244
|
}, N = new WeakSet(), R = function(t, e, s) {
|
|
3225
3245
|
switch (t) {
|
|
3226
3246
|
case "step":
|
|
3227
|
-
|
|
3247
|
+
xe(this.t.step) && d(this, ge, fs).call(this, e);
|
|
3228
3248
|
break;
|
|
3229
3249
|
case "eventAnchor":
|
|
3230
|
-
this.t.anchor && d(this,
|
|
3250
|
+
this.t.anchor && d(this, pe, ms).call(this);
|
|
3231
3251
|
break;
|
|
3232
3252
|
case "tabState":
|
|
3233
|
-
this.t.type == "normal" && d(this,
|
|
3253
|
+
this.t.type == "normal" && d(this, be, ys).call(this, e, s);
|
|
3234
3254
|
break;
|
|
3235
3255
|
case "btnState":
|
|
3236
|
-
d(this,
|
|
3256
|
+
d(this, fe, vs).call(this, e), d(this, ve, bs).call(this, e);
|
|
3237
3257
|
break;
|
|
3238
3258
|
case "tabUrl":
|
|
3239
|
-
this.t.recordUrl === "true" && d(this,
|
|
3259
|
+
this.t.recordUrl === "true" && d(this, he, ps).call(this, e);
|
|
3240
3260
|
break;
|
|
3241
3261
|
default:
|
|
3242
3262
|
console.warn("請增加判斷,謝謝");
|
|
3243
3263
|
break;
|
|
3244
3264
|
}
|
|
3245
|
-
},
|
|
3265
|
+
}, ye = new WeakSet(), ws = function(t) {
|
|
3246
3266
|
const { t: e } = this;
|
|
3247
3267
|
this.t.transition;
|
|
3248
3268
|
const s = e.tabPanels[t];
|
|
@@ -3259,7 +3279,7 @@ oe = new WeakSet(), ns = function() {
|
|
|
3259
3279
|
s.style.display = "none";
|
|
3260
3280
|
break;
|
|
3261
3281
|
}
|
|
3262
|
-
},
|
|
3282
|
+
}, we = new WeakSet(), Ts = function(t) {
|
|
3263
3283
|
const { duration: e, timing: s, delay: o } = this.t.transition, a = this.t.tabPanels[t];
|
|
3264
3284
|
let r;
|
|
3265
3285
|
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) {
|
|
@@ -3284,25 +3304,25 @@ oe = new WeakSet(), ns = function() {
|
|
|
3284
3304
|
console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
|
|
3285
3305
|
break;
|
|
3286
3306
|
}
|
|
3287
|
-
},
|
|
3288
|
-
const e = d(this, W,
|
|
3307
|
+
}, Te = new WeakSet(), Es = function(t) {
|
|
3308
|
+
const e = d(this, W, Z).call(this, t);
|
|
3289
3309
|
d(this, N, R).call(this, "step", e), d(this, N, R).call(this, "btnState", e), d(this, N, R).call(this, "tabState", e, t), d(this, N, R).call(this, "tabUrl", t), this.emit("change");
|
|
3290
|
-
},
|
|
3310
|
+
}, Ee = new WeakSet(), As = function() {
|
|
3291
3311
|
const t = this;
|
|
3292
3312
|
window.addEventListener(
|
|
3293
3313
|
"resize",
|
|
3294
|
-
|
|
3314
|
+
dn(() => {
|
|
3295
3315
|
t.update();
|
|
3296
3316
|
}, 1e3)
|
|
3297
3317
|
);
|
|
3298
3318
|
};
|
|
3299
|
-
function
|
|
3319
|
+
function dn(n, i = 1e3) {
|
|
3300
3320
|
let t;
|
|
3301
3321
|
return function(e) {
|
|
3302
3322
|
t && clearTimeout(t), t = setTimeout(n, i, e);
|
|
3303
3323
|
};
|
|
3304
3324
|
}
|
|
3305
|
-
function
|
|
3325
|
+
function Ls() {
|
|
3306
3326
|
const n = document.querySelectorAll("[t4-control]");
|
|
3307
3327
|
document.addEventListener("click", function(i) {
|
|
3308
3328
|
let t = !1;
|
|
@@ -3332,91 +3352,91 @@ function ys() {
|
|
|
3332
3352
|
}
|
|
3333
3353
|
});
|
|
3334
3354
|
}
|
|
3335
|
-
|
|
3336
|
-
Object.assign(
|
|
3337
|
-
customElements.define("tab-el",
|
|
3338
|
-
const
|
|
3355
|
+
Ls();
|
|
3356
|
+
Object.assign(ls.prototype, z);
|
|
3357
|
+
customElements.define("tab-el", ls);
|
|
3358
|
+
const si = (n) => {
|
|
3339
3359
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e);
|
|
3340
3360
|
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";
|
|
3341
|
-
},
|
|
3361
|
+
}, un = (n) => {
|
|
3342
3362
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
|
|
3343
3363
|
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";
|
|
3344
3364
|
};
|
|
3345
|
-
var
|
|
3346
|
-
class
|
|
3365
|
+
var dt, We, Ae, Ss, Le, Ds, ut, Ge;
|
|
3366
|
+
class hn {
|
|
3347
3367
|
constructor(i, t = {}) {
|
|
3348
|
-
h(this,
|
|
3349
|
-
h(this,
|
|
3350
|
-
h(this,
|
|
3351
|
-
h(this,
|
|
3352
|
-
!
|
|
3368
|
+
h(this, dt);
|
|
3369
|
+
h(this, Ae);
|
|
3370
|
+
h(this, Le);
|
|
3371
|
+
h(this, ut);
|
|
3372
|
+
!pt(i) && !xe(i) && !mt(i) && !A(i) || (this.__storage__ = {
|
|
3353
3373
|
el: i,
|
|
3354
3374
|
options: t
|
|
3355
|
-
}, this.active = "data-collapse-active", d(this,
|
|
3375
|
+
}, this.active = "data-collapse-active", d(this, dt, We).call(this));
|
|
3356
3376
|
}
|
|
3357
3377
|
update() {
|
|
3358
|
-
d(this,
|
|
3378
|
+
d(this, dt, We).call(this);
|
|
3359
3379
|
}
|
|
3360
3380
|
}
|
|
3361
|
-
|
|
3362
|
-
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } =
|
|
3363
|
-
if (this.elements = t.state == "not active" ?
|
|
3381
|
+
dt = new WeakSet(), We = function() {
|
|
3382
|
+
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = li;
|
|
3383
|
+
if (this.elements = t.state == "not active" ? k(i + `:not([${this.active}])`) : k(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
3364
3384
|
for (const [o, a] of Object.entries(this.options.on))
|
|
3365
3385
|
this.__events__[o] = [a];
|
|
3366
|
-
d(this,
|
|
3367
|
-
},
|
|
3386
|
+
d(this, Ae, Ss).call(this);
|
|
3387
|
+
}, Ae = new WeakSet(), Ss = function() {
|
|
3368
3388
|
const { elements: i, options: t } = this;
|
|
3369
3389
|
i.forEach((e) => {
|
|
3370
|
-
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,
|
|
3390
|
+
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, Le, Ds).call(this, e);
|
|
3371
3391
|
}), this.emit("init");
|
|
3372
|
-
},
|
|
3392
|
+
}, Le = new WeakSet(), Ds = function(i) {
|
|
3373
3393
|
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
|
|
3374
|
-
if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this,
|
|
3394
|
+
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, ut, Ge)), c.addEventListener("click", d(this, ut, Ge)), r) {
|
|
3375
3395
|
const p = (g) => {
|
|
3376
3396
|
g.stopPropagation();
|
|
3377
3397
|
};
|
|
3378
3398
|
u.removeEventListener("click", p), u.addEventListener("click", p);
|
|
3379
3399
|
}
|
|
3380
|
-
},
|
|
3400
|
+
}, ut = new WeakSet(), Ge = function() {
|
|
3381
3401
|
const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
|
|
3382
3402
|
r.classList.contains(e) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
|
|
3383
|
-
|
|
3384
|
-
}),
|
|
3403
|
+
si(l);
|
|
3404
|
+
}), un(r)) : si(r), i.emit("afterCollapse");
|
|
3385
3405
|
};
|
|
3386
|
-
Object.assign(
|
|
3387
|
-
function
|
|
3406
|
+
Object.assign(hn.prototype, z);
|
|
3407
|
+
function pn(n, i) {
|
|
3388
3408
|
const t = i, { color: e, opacity: s, duration: o } = i.s.options;
|
|
3389
3409
|
let a = document.createElement("span"), r = n.clientX - t.getBoundingClientRect().left, l = n.clientY - t.getBoundingClientRect().top;
|
|
3390
3410
|
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() {
|
|
3391
3411
|
a.remove();
|
|
3392
3412
|
}, `${o}`);
|
|
3393
3413
|
}
|
|
3394
|
-
function
|
|
3414
|
+
function ks() {
|
|
3395
3415
|
document.querySelectorAll("ripple-btn").forEach((n) => {
|
|
3396
3416
|
n.querySelector(".hover-ball"), n.style.setProperty("--r", ""), n.classList.remove("entered");
|
|
3397
3417
|
});
|
|
3398
3418
|
}
|
|
3399
|
-
document.addEventListener("click",
|
|
3400
|
-
var
|
|
3401
|
-
class
|
|
3419
|
+
document.addEventListener("click", ks);
|
|
3420
|
+
var ht, Re, Se, _s, De, xs, ke, $s;
|
|
3421
|
+
class mn extends HTMLElement {
|
|
3402
3422
|
constructor() {
|
|
3403
3423
|
super();
|
|
3404
|
-
h(this,
|
|
3405
|
-
h(this,
|
|
3406
|
-
h(this,
|
|
3407
|
-
h(this,
|
|
3424
|
+
h(this, ht);
|
|
3425
|
+
h(this, Se);
|
|
3426
|
+
h(this, De);
|
|
3427
|
+
h(this, ke);
|
|
3408
3428
|
this.initialize = !1;
|
|
3409
3429
|
}
|
|
3410
3430
|
connectedCallback() {
|
|
3411
3431
|
const t = this;
|
|
3412
|
-
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this,
|
|
3432
|
+
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, ht, Re).call(this));
|
|
3413
3433
|
}
|
|
3414
3434
|
update() {
|
|
3415
|
-
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this,
|
|
3435
|
+
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, ht, Re).call(this);
|
|
3416
3436
|
}
|
|
3417
3437
|
}
|
|
3418
|
-
|
|
3419
|
-
const { SETTINGS: t } =
|
|
3438
|
+
ht = new WeakSet(), Re = function() {
|
|
3439
|
+
const { SETTINGS: t } = ci;
|
|
3420
3440
|
this.s = {};
|
|
3421
3441
|
function e(o) {
|
|
3422
3442
|
let a = !!o;
|
|
@@ -3430,20 +3450,20 @@ ct = new WeakSet(), je = function() {
|
|
|
3430
3450
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
|
3431
3451
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
|
3432
3452
|
};
|
|
3433
|
-
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this,
|
|
3434
|
-
},
|
|
3435
|
-
d(this,
|
|
3436
|
-
},
|
|
3453
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, Se, _s).call(this);
|
|
3454
|
+
}, Se = new WeakSet(), _s = function() {
|
|
3455
|
+
d(this, De, xs).call(this), d(this, ke, $s).call(this), this.classList.add("r4-initialize");
|
|
3456
|
+
}, De = new WeakSet(), xs = function() {
|
|
3437
3457
|
const t = this, e = document.createElement("i");
|
|
3438
3458
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
|
3439
|
-
},
|
|
3459
|
+
}, ke = new WeakSet(), $s = function() {
|
|
3440
3460
|
const t = this.querySelector("i.hover-ball"), e = this;
|
|
3441
3461
|
e.addEventListener("click", function(a) {
|
|
3442
|
-
a.stopPropagation(), e.s.options.click &&
|
|
3462
|
+
a.stopPropagation(), e.s.options.click && pn(a, e);
|
|
3443
3463
|
});
|
|
3444
3464
|
let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
|
|
3445
3465
|
e.addEventListener(s, function(a) {
|
|
3446
|
-
if (s === "touchstart" &&
|
|
3466
|
+
if (s === "touchstart" && ks(), e.s.options.hover) {
|
|
3447
3467
|
const r = Math.round(s === "mouseenter" ? a.clientX - e.getBoundingClientRect().left : a.changedTouches[0].clientX - e.getBoundingClientRect().x), l = Math.round(s === "mouseenter" ? a.clientY - e.getBoundingClientRect().top : a.changedTouches[0].clientY - e.getBoundingClientRect().y), { offsetWidth: c, offsetHeight: u } = e, p = Math.max(c, u);
|
|
3448
3468
|
t.style.width = p * 2 + "px", t.style.height = p * 2 + "px", t.style.left = r + "px", t.style.top = l + "px", e.classList.add("entered");
|
|
3449
3469
|
}
|
|
@@ -3454,8 +3474,8 @@ ct = new WeakSet(), je = function() {
|
|
|
3454
3474
|
}
|
|
3455
3475
|
});
|
|
3456
3476
|
};
|
|
3457
|
-
customElements.define("ripple-btn",
|
|
3458
|
-
class
|
|
3477
|
+
customElements.define("ripple-btn", mn);
|
|
3478
|
+
class gn {
|
|
3459
3479
|
constructor() {
|
|
3460
3480
|
this.init();
|
|
3461
3481
|
}
|
|
@@ -3507,12 +3527,12 @@ class un {
|
|
|
3507
3527
|
this.init();
|
|
3508
3528
|
}
|
|
3509
3529
|
}
|
|
3510
|
-
function
|
|
3530
|
+
function ni(n, i) {
|
|
3511
3531
|
return n ? function(t, e) {
|
|
3512
3532
|
Function(n)(t, e);
|
|
3513
3533
|
} : i;
|
|
3514
3534
|
}
|
|
3515
|
-
function
|
|
3535
|
+
function fn(n, i, t, e) {
|
|
3516
3536
|
const s = i.params, o = n.closest("[data-upload-item]").querySelector("[data-preview]");
|
|
3517
3537
|
o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(e.imgElement);
|
|
3518
3538
|
const a = n.dataset.group, r = document.querySelector(i.el).dataset.index;
|
|
@@ -3535,7 +3555,7 @@ function hn(n, i, t, e) {
|
|
|
3535
3555
|
info: e
|
|
3536
3556
|
}, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
|
|
3537
3557
|
}
|
|
3538
|
-
function
|
|
3558
|
+
function vn(n, i, t, e) {
|
|
3539
3559
|
const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
|
|
3540
3560
|
let u = 0, p = 0;
|
|
3541
3561
|
switch (s.width = t, s.height = e, n.previewSize) {
|
|
@@ -3549,14 +3569,14 @@ function pn(n, i, t, e) {
|
|
|
3549
3569
|
const g = (s.width - u) * 0.5, m = (s.height - p) * 0.5;
|
|
3550
3570
|
return o.drawImage(i, g, m, u, p), s;
|
|
3551
3571
|
}
|
|
3552
|
-
function
|
|
3572
|
+
function bn(n, i) {
|
|
3553
3573
|
return new Promise((t, e) => {
|
|
3554
3574
|
if (i) {
|
|
3555
3575
|
const s = new Image();
|
|
3556
3576
|
s.src = i, s.classList.add(n.previewSize), s.onload = () => {
|
|
3557
3577
|
let o = {
|
|
3558
3578
|
imgElement: s,
|
|
3559
|
-
originalCanvas:
|
|
3579
|
+
originalCanvas: vn(n, s, s.width, s.height),
|
|
3560
3580
|
info: {
|
|
3561
3581
|
originalWidth: s.width,
|
|
3562
3582
|
originalHeight: s.height,
|
|
@@ -3569,31 +3589,31 @@ function mn(n, i) {
|
|
|
3569
3589
|
t();
|
|
3570
3590
|
});
|
|
3571
3591
|
}
|
|
3572
|
-
function
|
|
3592
|
+
function yn(n, i) {
|
|
3573
3593
|
const t = Math.pow(10, i);
|
|
3574
3594
|
return Math.round(n * t) / t;
|
|
3575
3595
|
}
|
|
3576
|
-
function
|
|
3596
|
+
function wn(n, i) {
|
|
3577
3597
|
let t = n.size / 1024 / 1024;
|
|
3578
|
-
return `${
|
|
3598
|
+
return `${yn(t, 2)}` <= i;
|
|
3579
3599
|
}
|
|
3580
|
-
function
|
|
3600
|
+
function Tn(n, i, t) {
|
|
3581
3601
|
if (n.target.files.length <= 0)
|
|
3582
3602
|
return;
|
|
3583
3603
|
const e = n.target.files[0], s = i.closest("[data-upload-item]");
|
|
3584
3604
|
let o = new FileReader();
|
|
3585
3605
|
o.onload = (a) => {
|
|
3586
3606
|
const r = e.type.split("/")[0] === "image" ? a.target.result : null;
|
|
3587
|
-
if (t.params.sizeLimit && !
|
|
3607
|
+
if (t.params.sizeLimit && !wn(e, t.params.sizeLimit)) {
|
|
3588
3608
|
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);
|
|
3589
3609
|
return;
|
|
3590
3610
|
} else
|
|
3591
|
-
s.classList.remove("over-limit"), s.classList.add("uploaded"),
|
|
3592
|
-
|
|
3611
|
+
s.classList.remove("over-limit"), s.classList.add("uploaded"), bn(t.params, r).then((l) => {
|
|
3612
|
+
fn(i, t, e, l);
|
|
3593
3613
|
});
|
|
3594
3614
|
}, o.readAsDataURL(e);
|
|
3595
3615
|
}
|
|
3596
|
-
class
|
|
3616
|
+
class En {
|
|
3597
3617
|
constructor(i, t) {
|
|
3598
3618
|
const e = this;
|
|
3599
3619
|
e.el = i, e.params = {
|
|
@@ -3621,67 +3641,67 @@ class bn {
|
|
|
3621
3641
|
previewSize: e.dataset.previewSize || i.params.previewSize,
|
|
3622
3642
|
compress: e.dataset.compress || i.params.compress,
|
|
3623
3643
|
on: {
|
|
3624
|
-
changeAfter:
|
|
3625
|
-
overLimit:
|
|
3644
|
+
changeAfter: ni(e.dataset.changeAfter, i.params.on.changeAfter),
|
|
3645
|
+
overLimit: ni(e.dataset.overLimit, i.params.on.overLimit)
|
|
3626
3646
|
}
|
|
3627
3647
|
};
|
|
3628
3648
|
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) {
|
|
3629
|
-
|
|
3649
|
+
Tn(a, e, i);
|
|
3630
3650
|
});
|
|
3631
3651
|
}));
|
|
3632
3652
|
}
|
|
3633
3653
|
}
|
|
3634
3654
|
export {
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3655
|
+
di as A,
|
|
3656
|
+
Nn as B,
|
|
3657
|
+
hn as C,
|
|
3658
|
+
Gi as D,
|
|
3659
|
+
jn as E,
|
|
3660
|
+
zn as F,
|
|
3661
|
+
Bn as G,
|
|
3662
|
+
Wn as H,
|
|
3663
|
+
gn as I,
|
|
3664
|
+
Gn as J,
|
|
3665
|
+
Rn as K,
|
|
3666
|
+
Xn as L,
|
|
3667
|
+
V as M,
|
|
3668
|
+
Yn as N,
|
|
3669
|
+
Fn as O,
|
|
3670
|
+
Un as P,
|
|
3671
|
+
Jn as Q,
|
|
3672
|
+
mn as R,
|
|
3673
|
+
Zn as S,
|
|
3674
|
+
ls as T,
|
|
3675
|
+
Qn as U,
|
|
3676
|
+
Kn as V,
|
|
3677
|
+
Vn as W,
|
|
3678
|
+
to as X,
|
|
3679
|
+
eo as Y,
|
|
3680
|
+
A as a,
|
|
3681
|
+
mt as b,
|
|
3682
|
+
Ns as c,
|
|
3683
|
+
Ps as d,
|
|
3684
|
+
_e as e,
|
|
3685
|
+
L as f,
|
|
3686
|
+
k as g,
|
|
3687
|
+
Cn as h,
|
|
3688
|
+
pt as i,
|
|
3689
|
+
Li as j,
|
|
3690
|
+
an as k,
|
|
3691
|
+
cn as l,
|
|
3692
|
+
En as m,
|
|
3693
|
+
Js as n,
|
|
3694
|
+
io as o,
|
|
3695
|
+
Pi as p,
|
|
3696
|
+
Ni as q,
|
|
3697
|
+
Hn as r,
|
|
3698
|
+
Os as s,
|
|
3699
|
+
Mn as t,
|
|
3700
|
+
In as u,
|
|
3701
|
+
Ie as v,
|
|
3702
|
+
Us as w,
|
|
3703
|
+
qn as x,
|
|
3704
|
+
On as y,
|
|
3705
|
+
Pn as z
|
|
3686
3706
|
};
|
|
3687
3707
|
//# sourceMappingURL=image-preview-bundle.js.map
|