@xwadex/fesd 0.0.40 → 0.0.42
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 +523 -516
- package/dist/image-preview-bundle.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var vs = (n, i, t) => {
|
|
2
2
|
if (!i.has(n))
|
|
3
3
|
throw TypeError("Cannot " + t);
|
|
4
4
|
};
|
|
@@ -7,14 +7,14 @@ var h = (n, i, t) => {
|
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
i instanceof WeakSet ? i.add(n) : i.set(n, t);
|
|
9
9
|
};
|
|
10
|
-
var d = (n, i, t) => (
|
|
11
|
-
import { OverlayScrollbars as
|
|
12
|
-
import
|
|
10
|
+
var d = (n, i, t) => (vs(n, i, "access private method"), t);
|
|
11
|
+
import { OverlayScrollbars as qe } from "overlayscrollbars";
|
|
12
|
+
import f from "jquery";
|
|
13
13
|
import "./vendor-bundle.js";
|
|
14
14
|
import "validator";
|
|
15
15
|
import "flatpickr";
|
|
16
|
-
import
|
|
17
|
-
import { lock as
|
|
16
|
+
import Ye from "vanilla-lazyload";
|
|
17
|
+
import { lock as bs, unlock as ys } from "tua-body-scroll-lock";
|
|
18
18
|
const Y = {
|
|
19
19
|
SETTINGS: {
|
|
20
20
|
videoId: null,
|
|
@@ -51,7 +51,7 @@ const Y = {
|
|
|
51
51
|
TEMPLATE() {
|
|
52
52
|
return '<div class="player-container"><div class="player-wrapper"></div></div>';
|
|
53
53
|
}
|
|
54
|
-
},
|
|
54
|
+
}, ws = {
|
|
55
55
|
SETTINGS: {
|
|
56
56
|
success: null,
|
|
57
57
|
text: null,
|
|
@@ -108,7 +108,7 @@ const Y = {
|
|
|
108
108
|
gap: 30
|
|
109
109
|
// 跑馬燈內容之間的距離 - Number
|
|
110
110
|
}
|
|
111
|
-
},
|
|
111
|
+
}, Ie = {
|
|
112
112
|
SETTINGS: {
|
|
113
113
|
scrollbar: {
|
|
114
114
|
"scrollbar-track-color": "transparent",
|
|
@@ -136,7 +136,7 @@ const Y = {
|
|
|
136
136
|
</div>`;
|
|
137
137
|
return t || r;
|
|
138
138
|
}
|
|
139
|
-
},
|
|
139
|
+
}, Ts = {
|
|
140
140
|
SETTINGS: {
|
|
141
141
|
basic_rwd: 900,
|
|
142
142
|
markdownLink: !1,
|
|
@@ -144,7 +144,7 @@ const Y = {
|
|
|
144
144
|
navigation: !1,
|
|
145
145
|
scrollStep: !1
|
|
146
146
|
}
|
|
147
|
-
},
|
|
147
|
+
}, Ue = {
|
|
148
148
|
SETTINGS: {
|
|
149
149
|
scroller: window,
|
|
150
150
|
class: "aost-show",
|
|
@@ -167,7 +167,7 @@ const Y = {
|
|
|
167
167
|
enter: null,
|
|
168
168
|
leave: null
|
|
169
169
|
}
|
|
170
|
-
},
|
|
170
|
+
}, ut = {
|
|
171
171
|
SETTINGS: {
|
|
172
172
|
target: null,
|
|
173
173
|
container: null,
|
|
@@ -227,7 +227,7 @@ const Y = {
|
|
|
227
227
|
return `<dropdown-el${n.placeholder ? ` d4-placeholder="${n.placeholder}"` : ""}${n.value ? ` d4-value="${n.value}"` : ""}></dropdown-el>`;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
},
|
|
230
|
+
}, Je = {
|
|
231
231
|
SETTINGS: {
|
|
232
232
|
// 樣式 normal / process
|
|
233
233
|
type: "normal",
|
|
@@ -247,7 +247,7 @@ const Y = {
|
|
|
247
247
|
// 步驟狀態綁定
|
|
248
248
|
stepOutput: ".step-show"
|
|
249
249
|
}
|
|
250
|
-
},
|
|
250
|
+
}, Ze = {
|
|
251
251
|
SETTINGS: {
|
|
252
252
|
collapseClass: "collapse",
|
|
253
253
|
block: "[collapse-block]",
|
|
@@ -280,7 +280,7 @@ const Y = {
|
|
|
280
280
|
update: null,
|
|
281
281
|
afterUpdate: null
|
|
282
282
|
}
|
|
283
|
-
},
|
|
283
|
+
}, Qe = {
|
|
284
284
|
SETTINGS: {
|
|
285
285
|
// 是否要加 hover 效果?
|
|
286
286
|
hover: !0,
|
|
@@ -295,29 +295,29 @@ const Y = {
|
|
|
295
295
|
// hover 毫秒 ?
|
|
296
296
|
speed: 600
|
|
297
297
|
}
|
|
298
|
-
},
|
|
298
|
+
}, fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
299
299
|
__proto__: null,
|
|
300
|
-
anchor4:
|
|
301
|
-
aost4:
|
|
302
|
-
article4:
|
|
303
|
-
collapse4:
|
|
304
|
-
dropdown4:
|
|
300
|
+
anchor4: ut,
|
|
301
|
+
aost4: Ue,
|
|
302
|
+
article4: Ts,
|
|
303
|
+
collapse4: Ze,
|
|
304
|
+
dropdown4: Ie,
|
|
305
305
|
marquee4: x,
|
|
306
306
|
modal4: I,
|
|
307
307
|
multipurpose4: H,
|
|
308
|
-
ripple4:
|
|
309
|
-
share4:
|
|
310
|
-
tab4:
|
|
308
|
+
ripple4: Qe,
|
|
309
|
+
share4: ws,
|
|
310
|
+
tab4: Je,
|
|
311
311
|
video4: Y
|
|
312
312
|
}, Symbol.toStringTag, { value: "Module" })), A = {
|
|
313
313
|
before: "beforebegin",
|
|
314
314
|
after: "afterend",
|
|
315
315
|
append: "beforeend",
|
|
316
316
|
prepend: "afterbegin"
|
|
317
|
-
}, rt = (n) => typeof n == "string" && n !== "",
|
|
317
|
+
}, rt = (n) => typeof n == "string" && n !== "", Te = (n) => n instanceof HTMLElement, lt = (n) => n instanceof NodeList, w = (n) => L(n) !== null, j = (n) => typeof n == "function", L = (n) => Te(n) ? n : document.querySelector(n), S = (n) => lt(n) ? n : document.querySelectorAll(n), Es = () => Math.random().toString(36).substr(2, 9), As = (n) => {
|
|
318
318
|
const i = document.createElement("div");
|
|
319
319
|
return i.innerHTML = n, i.childNodes;
|
|
320
|
-
},
|
|
320
|
+
}, Ls = (n) => {
|
|
321
321
|
try {
|
|
322
322
|
JSON.parse(n);
|
|
323
323
|
} catch {
|
|
@@ -326,7 +326,7 @@ const Y = {
|
|
|
326
326
|
return JSON.parse(n);
|
|
327
327
|
}, E = (n, i) => {
|
|
328
328
|
console.warn(`[${n} warn]: ${i}`);
|
|
329
|
-
},
|
|
329
|
+
}, je = (n, i) => {
|
|
330
330
|
console.error(`[${n} error]: ${i}`);
|
|
331
331
|
}, O = {
|
|
332
332
|
on(n, i) {
|
|
@@ -359,7 +359,7 @@ const Y = {
|
|
|
359
359
|
j(s) && s.apply(this, e);
|
|
360
360
|
}), this) : this;
|
|
361
361
|
}
|
|
362
|
-
},
|
|
362
|
+
}, Ss = {
|
|
363
363
|
easeInOutCirc(n, i, t, e) {
|
|
364
364
|
return (n /= e / 2) < 1 ? -t / 2 * (Math.sqrt(1 - n * n) - 1) + i : t / 2 * (Math.sqrt(1 - (n -= 2) * n) + 1) + i;
|
|
365
365
|
},
|
|
@@ -369,33 +369,33 @@ const Y = {
|
|
|
369
369
|
easeOutQuart(n, i, t, e) {
|
|
370
370
|
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
|
371
371
|
}
|
|
372
|
-
},
|
|
373
|
-
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", g = c ? "width" : "height", m = w(e) ? L(e) : document.scrollingElement,
|
|
372
|
+
}, Ee = (n, i) => {
|
|
373
|
+
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", g = c ? "width" : "height", m = w(e) ? L(e) : document.scrollingElement, v = m[u], b = w(t) ? L(t).getBoundingClientRect()[p] : 0 - v, y = w(s) ? L(s).getBoundingClientRect()[g] : 0, k = b - a - y, G = 15;
|
|
374
374
|
let D = 0;
|
|
375
|
-
if (
|
|
375
|
+
if (k === 0)
|
|
376
376
|
return;
|
|
377
377
|
const R = (X) => {
|
|
378
|
-
const
|
|
379
|
-
i && i.emit(X,
|
|
378
|
+
const Pe = L(t);
|
|
379
|
+
i && i.emit(X, Pe), !i && n.on && j(n.on[X]) && n.on[X](Pe);
|
|
380
380
|
};
|
|
381
381
|
R("beforeScroll");
|
|
382
|
-
const
|
|
382
|
+
const Ne = () => {
|
|
383
383
|
D += G;
|
|
384
|
-
const X =
|
|
385
|
-
m[u] = X, D < o && requestAnimationFrame(
|
|
384
|
+
const X = Ss[r](D, v, k, o);
|
|
385
|
+
m[u] = X, D < o && requestAnimationFrame(Ne), D >= o && R("afterScroll");
|
|
386
386
|
};
|
|
387
|
-
requestAnimationFrame(
|
|
387
|
+
requestAnimationFrame(Ne);
|
|
388
388
|
};
|
|
389
|
-
var Z,
|
|
390
|
-
class
|
|
389
|
+
var Z, Ae, gt, Ke, ft, ti;
|
|
390
|
+
class Ve {
|
|
391
391
|
constructor(i, t = {}) {
|
|
392
392
|
h(this, Z);
|
|
393
|
-
h(this, mt);
|
|
394
393
|
h(this, gt);
|
|
394
|
+
h(this, ft);
|
|
395
395
|
this.__storage__ = {
|
|
396
396
|
el: i,
|
|
397
397
|
options: t
|
|
398
|
-
}, this.active = "data-anchor-active", d(this, Z,
|
|
398
|
+
}, this.active = "data-anchor-active", d(this, Z, Ae).call(this);
|
|
399
399
|
}
|
|
400
400
|
destroy() {
|
|
401
401
|
const { elements: i } = this;
|
|
@@ -405,39 +405,39 @@ class Qe {
|
|
|
405
405
|
}
|
|
406
406
|
update() {
|
|
407
407
|
var i;
|
|
408
|
-
return d(i = this.destroy(), Z,
|
|
408
|
+
return d(i = this.destroy(), Z, Ae).call(i), this.emit("afterUpdate"), this;
|
|
409
409
|
}
|
|
410
410
|
static run(i) {
|
|
411
|
-
const { SETTINGS: t } =
|
|
411
|
+
const { SETTINGS: t } = ut, e = Object.assign({}, t, i);
|
|
412
412
|
setTimeout(() => {
|
|
413
|
-
|
|
413
|
+
Ee(e);
|
|
414
414
|
}, e.delay);
|
|
415
415
|
}
|
|
416
416
|
static url(i) {
|
|
417
|
-
const { SETTINGS: t } =
|
|
417
|
+
const { SETTINGS: t } = ut, { hashName: e } = i, s = window.location.search || window.location.hash, { searchParams: o } = new URL(window.location), a = document.querySelector(`[data-anchor-id="${e ? o.get(e) : s.split("?").pop()}"]`);
|
|
418
418
|
if (!a)
|
|
419
419
|
return;
|
|
420
420
|
const r = Object.assign({}, t, i, { target: a });
|
|
421
421
|
setTimeout(() => {
|
|
422
|
-
|
|
422
|
+
Ee(r);
|
|
423
423
|
}, r.delay);
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
Z = new WeakSet(),
|
|
426
|
+
Z = new WeakSet(), Ae = function() {
|
|
427
427
|
const { el: i, options: t } = this.__storage__;
|
|
428
428
|
if (!rt(i) || !w(i))
|
|
429
429
|
return;
|
|
430
|
-
const { SETTINGS: e, EVENTS: s } =
|
|
430
|
+
const { SETTINGS: e, EVENTS: s } = ut;
|
|
431
431
|
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.elements = S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
432
432
|
for (const [o, a] of Object.entries(this.options.on))
|
|
433
433
|
this.__events__[o] = [a];
|
|
434
|
-
d(this,
|
|
435
|
-
},
|
|
434
|
+
d(this, gt, Ke).call(this);
|
|
435
|
+
}, gt = new WeakSet(), Ke = function() {
|
|
436
436
|
const { elements: i, options: t } = this;
|
|
437
437
|
i.forEach((e) => {
|
|
438
|
-
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this,
|
|
438
|
+
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, ft, ti), e.anchor.defaultOptions = t, e.anchor.methods = {}, e.anchor.methods.destroy = this.destroy, e.anchor.methods.update = this.update, e.addEventListener("click", e.anchor.eventHandler), e.setAttribute(this.active, "");
|
|
439
439
|
}), this.emit("afterInit");
|
|
440
|
-
},
|
|
440
|
+
}, ft = new WeakSet(), ti = function() {
|
|
441
441
|
const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor, s = {
|
|
442
442
|
target: this.getAttribute("data-anchor-target") || i.target,
|
|
443
443
|
container: this.getAttribute("data-anchor-container") || i.container,
|
|
@@ -451,12 +451,12 @@ Z = new WeakSet(), Ee = function() {
|
|
|
451
451
|
this.removeEventListener("click", t), setTimeout(() => {
|
|
452
452
|
this.addEventListener("click", t);
|
|
453
453
|
}, s.speed), setTimeout(() => {
|
|
454
|
-
|
|
454
|
+
Ee(s, e);
|
|
455
455
|
}, s.delay);
|
|
456
456
|
};
|
|
457
|
-
Object.assign(
|
|
457
|
+
Object.assign(Ve.prototype, O);
|
|
458
458
|
window.MODALS || (window.MODALS = {});
|
|
459
|
-
const { MODALS: M } = window,
|
|
459
|
+
const { MODALS: M } = window, Ds = (n) => {
|
|
460
460
|
const { TEMPLATE: i } = I, { childDom: t } = n, e = document.createElement("div");
|
|
461
461
|
e.innerHTML = i(n.getAttribute("data-modal-template-setting"));
|
|
462
462
|
const s = e.querySelector(".modal-content");
|
|
@@ -464,15 +464,15 @@ const { MODALS: M } = window, Ss = (n) => {
|
|
|
464
464
|
s.append(o);
|
|
465
465
|
}), e.children[0];
|
|
466
466
|
};
|
|
467
|
-
var
|
|
468
|
-
class
|
|
467
|
+
var vt, ii, bt, si, yt, ni, wt, oi, Tt, ai;
|
|
468
|
+
class ei extends HTMLElement {
|
|
469
469
|
constructor() {
|
|
470
470
|
super();
|
|
471
|
-
h(this, ft);
|
|
472
471
|
h(this, vt);
|
|
473
472
|
h(this, bt);
|
|
474
473
|
h(this, yt);
|
|
475
474
|
h(this, wt);
|
|
475
|
+
h(this, Tt);
|
|
476
476
|
this.initialize = !1;
|
|
477
477
|
}
|
|
478
478
|
static get observedAttributes() {
|
|
@@ -481,12 +481,12 @@ class ti extends HTMLElement {
|
|
|
481
481
|
attributeChangedCallback(t, e, s) {
|
|
482
482
|
switch (t) {
|
|
483
483
|
case ":state":
|
|
484
|
-
d(this,
|
|
484
|
+
d(this, Tt, ai).call(this, s);
|
|
485
485
|
break;
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
|
-
this.initialize || (this.initialize = !0, d(this,
|
|
489
|
+
this.initialize || (this.initialize = !0, d(this, vt, ii).call(this));
|
|
490
490
|
}
|
|
491
491
|
open() {
|
|
492
492
|
return this.setAttribute(":state", "open"), this;
|
|
@@ -498,22 +498,22 @@ class ti extends HTMLElement {
|
|
|
498
498
|
return this.setAttribute(":state", "destroy"), this;
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
|
|
501
|
+
vt = new WeakSet(), ii = function() {
|
|
502
502
|
const { ATTRS: t } = I;
|
|
503
503
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
|
504
|
-
const e = this.getAttribute(t.id) ||
|
|
505
|
-
this.getAttribute(t.id) || (E(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), M[e] && E(`the ${t.id} "${e}" is already be used.`), M[e] = this, d(this,
|
|
506
|
-
}, vt = new WeakSet(), ii = function() {
|
|
507
|
-
this.childDom = this.childNodes, this.template = Ss(this), this.innerHTML = "", this.append(this.template), d(this, bt, si).call(this);
|
|
504
|
+
const e = this.getAttribute(t.id) || Es();
|
|
505
|
+
this.getAttribute(t.id) || (E(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), M[e] && E(`the ${t.id} "${e}" is already be used.`), M[e] = this, d(this, bt, si).call(this);
|
|
508
506
|
}, bt = new WeakSet(), si = function() {
|
|
507
|
+
this.childDom = this.childNodes, this.template = Ds(this), this.innerHTML = "", this.append(this.template), d(this, yt, ni).call(this);
|
|
508
|
+
}, yt = new WeakSet(), ni = function() {
|
|
509
509
|
const t = this.querySelector(".modal-scroller");
|
|
510
|
-
this.__scroller__ =
|
|
510
|
+
this.__scroller__ = qe(t, {
|
|
511
511
|
overflowBehavior: {
|
|
512
512
|
x: "hidden"
|
|
513
513
|
},
|
|
514
514
|
autoUpdate: !0
|
|
515
|
-
}), window.modalScroll = this.__scroller__, d(this,
|
|
516
|
-
},
|
|
515
|
+
}), window.modalScroll = this.__scroller__, d(this, wt, oi).call(this);
|
|
516
|
+
}, wt = new WeakSet(), oi = function() {
|
|
517
517
|
var a, r, l;
|
|
518
518
|
const t = this, { ATTRS: e } = I, { close: s, destroy: o } = e;
|
|
519
519
|
(a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
|
|
@@ -529,7 +529,7 @@ ft = new WeakSet(), ei = function() {
|
|
|
529
529
|
}), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
|
|
530
530
|
c.stopPropagation();
|
|
531
531
|
});
|
|
532
|
-
},
|
|
532
|
+
}, Tt = new WeakSet(), ai = function(t) {
|
|
533
533
|
const { __scroller__: e } = this;
|
|
534
534
|
if (t === "open") {
|
|
535
535
|
if (this.style.display = "block", e) {
|
|
@@ -560,22 +560,22 @@ ft = new WeakSet(), ei = function() {
|
|
|
560
560
|
this.addEventListener("transitionend", s);
|
|
561
561
|
}
|
|
562
562
|
};
|
|
563
|
-
Object.assign(
|
|
564
|
-
const { MODALS:
|
|
563
|
+
Object.assign(ei.prototype, O);
|
|
564
|
+
const { MODALS: Oe } = window, ct = {}, ri = (n, i, ...t) => {
|
|
565
565
|
if (!i)
|
|
566
566
|
return;
|
|
567
567
|
const e = n[i];
|
|
568
568
|
e && j(e) && e.apply(n, t);
|
|
569
|
-
},
|
|
569
|
+
}, li = (n, ...i) => {
|
|
570
570
|
n && j(n) && n.apply(J, i);
|
|
571
|
-
},
|
|
572
|
-
const { target: t } = n, e =
|
|
573
|
-
e &&
|
|
574
|
-
},
|
|
575
|
-
const { target: t, action: e, on: s, e: o } = n, a =
|
|
571
|
+
}, ze = (n, i) => {
|
|
572
|
+
const { target: t } = n, e = Oe[t] || L(n.target);
|
|
573
|
+
e && ci(n, i), e || ks(n, i);
|
|
574
|
+
}, ci = (n, i) => {
|
|
575
|
+
const { target: t, action: e, on: s, e: o } = n, a = Oe[t] || L(n.target);
|
|
576
576
|
switch (["open", "close", "destroy"].forEach((l) => {
|
|
577
577
|
a.once(l, () => {
|
|
578
|
-
i && (i.emit(l, a, o),
|
|
578
|
+
i && (i.emit(l, a, o), ri(i, s[l], a, o)), i || li(s[l], a);
|
|
579
579
|
});
|
|
580
580
|
}), e) {
|
|
581
581
|
case "open":
|
|
@@ -592,34 +592,34 @@ const { MODALS: Ie } = window, ai = (n, i, ...t) => {
|
|
|
592
592
|
l === "close" && a.open(), l === "open" && a.close();
|
|
593
593
|
break;
|
|
594
594
|
}
|
|
595
|
-
},
|
|
595
|
+
}, ks = async (n, i) => {
|
|
596
596
|
const { target: t, route: e, container: s, on: o, e: a } = n;
|
|
597
597
|
if (!e)
|
|
598
598
|
return E("modal4", "cannot find target or data-modal-route is not defined");
|
|
599
599
|
const r = (l, ...c) => {
|
|
600
|
-
i && (i.emit(l, ...c),
|
|
600
|
+
i && (i.emit(l, ...c), ri(i, o[l], ...c)), i || li(o[l], ...c);
|
|
601
601
|
};
|
|
602
|
-
fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
|
|
603
|
-
const c =
|
|
602
|
+
ct[t] || (ct[t] = !0, fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
|
|
603
|
+
const c = As(l), u = L(s) || L(I.SETTINGS.container);
|
|
604
604
|
[...c].forEach((g) => {
|
|
605
605
|
u.append(g);
|
|
606
606
|
});
|
|
607
|
-
const p =
|
|
608
|
-
r("complete", p),
|
|
607
|
+
const p = Oe[t] || L(n.target);
|
|
608
|
+
r("complete", p), ci(n, i), delete ct[t];
|
|
609
609
|
}).catch((l) => {
|
|
610
|
-
r("error", l);
|
|
611
|
-
});
|
|
610
|
+
r("error", l), delete ct[t];
|
|
611
|
+
}));
|
|
612
612
|
};
|
|
613
|
-
var Q,
|
|
613
|
+
var Q, Le, Et, di, At, ui;
|
|
614
614
|
const N = class N {
|
|
615
615
|
constructor(i, t = {}) {
|
|
616
616
|
h(this, Q);
|
|
617
|
-
h(this, Tt);
|
|
618
617
|
h(this, Et);
|
|
618
|
+
h(this, At);
|
|
619
619
|
this.__storage__ = {
|
|
620
620
|
el: i,
|
|
621
621
|
options: t
|
|
622
|
-
}, this.active = "data-modal-active", d(this, Q,
|
|
622
|
+
}, this.active = "data-modal-active", d(this, Q, Le).call(this);
|
|
623
623
|
}
|
|
624
624
|
destroy() {
|
|
625
625
|
const { elements: i } = this;
|
|
@@ -629,12 +629,12 @@ const N = class N {
|
|
|
629
629
|
}
|
|
630
630
|
update() {
|
|
631
631
|
var i;
|
|
632
|
-
return d(i = this.destroy(), Q,
|
|
632
|
+
return d(i = this.destroy(), Q, Le).call(i), this.emit("update"), this;
|
|
633
633
|
}
|
|
634
634
|
/** static method 'open' */
|
|
635
635
|
static open(i) {
|
|
636
636
|
const { SETTINGS: t } = I, e = Object.assign({}, t, { on: {} }, i);
|
|
637
|
-
|
|
637
|
+
ze(e);
|
|
638
638
|
}
|
|
639
639
|
/** static method 'defineMethods' */
|
|
640
640
|
static defineMethods(i) {
|
|
@@ -645,7 +645,7 @@ const N = class N {
|
|
|
645
645
|
Object.assign(N.prototype, N.prototype.__methods__);
|
|
646
646
|
}
|
|
647
647
|
};
|
|
648
|
-
Q = new WeakSet(),
|
|
648
|
+
Q = new WeakSet(), Le = function() {
|
|
649
649
|
const { el: i, options: t } = this.__storage__;
|
|
650
650
|
if (!rt(i) || !w(i))
|
|
651
651
|
return;
|
|
@@ -653,14 +653,14 @@ Q = new WeakSet(), Ae = function() {
|
|
|
653
653
|
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
654
654
|
for (const [o, a] of Object.entries(this.options.on))
|
|
655
655
|
this.__events__[o] = [a];
|
|
656
|
-
d(this,
|
|
657
|
-
},
|
|
656
|
+
d(this, Et, di).call(this);
|
|
657
|
+
}, Et = new WeakSet(), di = function() {
|
|
658
658
|
const { elements: i, options: t } = this;
|
|
659
659
|
i.forEach((e) => {
|
|
660
|
-
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this,
|
|
660
|
+
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, At, ui), e.modal.defaultOptions = t, e.modal.methods = {}, e.modal.methods.destroy = this.destroy, e.modal.methods.update = this.update, e.addEventListener("click", e.modal.eventHandler), e.setAttribute(this.active, "");
|
|
661
661
|
}), this.emit("init");
|
|
662
|
-
},
|
|
663
|
-
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o =
|
|
662
|
+
}, At = new WeakSet(), ui = function(i) {
|
|
663
|
+
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = Ls(this.getAttribute("data-modal-on"));
|
|
664
664
|
o && typeof o != "object" && E("modal4", "data-modal-on must be a json string.");
|
|
665
665
|
const a = {
|
|
666
666
|
target: this.getAttribute("data-modal-target") || t.target,
|
|
@@ -672,36 +672,36 @@ Q = new WeakSet(), Ae = function() {
|
|
|
672
672
|
};
|
|
673
673
|
this.removeEventListener("click", e), setTimeout(() => {
|
|
674
674
|
this.addEventListener("click", e);
|
|
675
|
-
}, 200),
|
|
675
|
+
}, 200), ze(a, s);
|
|
676
676
|
};
|
|
677
677
|
let J = N;
|
|
678
678
|
Object.assign(J.prototype, O);
|
|
679
|
-
customElements.define("modern-modal",
|
|
679
|
+
customElements.define("modern-modal", ei);
|
|
680
680
|
const _s = (n, i) => {
|
|
681
681
|
const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
|
|
682
682
|
i.forEach((s) => {
|
|
683
|
-
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),
|
|
684
|
-
if (p - e <= m && g - e >=
|
|
683
|
+
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);
|
|
684
|
+
if (p - e <= m && g - e >= v && s.offsetParent)
|
|
685
685
|
setTimeout(() => {
|
|
686
686
|
s.classList.add(o);
|
|
687
687
|
}, a);
|
|
688
688
|
else {
|
|
689
|
-
const y = s.classList.contains(o) && c === "down" && p - e >= m || c === "up" && g - e <=
|
|
689
|
+
const y = s.classList.contains(o) && c === "down" && p - e >= m || c === "up" && g - e <= v || c === !0;
|
|
690
690
|
setTimeout(() => {
|
|
691
691
|
y && s.classList.remove(o);
|
|
692
692
|
}, a);
|
|
693
693
|
}
|
|
694
694
|
});
|
|
695
|
-
},
|
|
696
|
-
var V,
|
|
697
|
-
class
|
|
695
|
+
}, $s = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
|
|
696
|
+
var V, Se, Lt, pi;
|
|
697
|
+
class hi {
|
|
698
698
|
constructor(i, t = {}) {
|
|
699
699
|
h(this, V);
|
|
700
|
-
h(this,
|
|
700
|
+
h(this, Lt);
|
|
701
701
|
this.__storage__ = {
|
|
702
702
|
el: i,
|
|
703
703
|
options: t
|
|
704
|
-
}, this.active = "data-aost-active", d(this, V,
|
|
704
|
+
}, this.active = "data-aost-active", d(this, V, Se).call(this);
|
|
705
705
|
}
|
|
706
706
|
destroy(i) {
|
|
707
707
|
const { elements: t, options: e } = this;
|
|
@@ -717,30 +717,30 @@ class ui {
|
|
|
717
717
|
}
|
|
718
718
|
update(i) {
|
|
719
719
|
var t;
|
|
720
|
-
d(t = this.destroy(i), V,
|
|
720
|
+
d(t = this.destroy(i), V, Se).call(t);
|
|
721
721
|
}
|
|
722
722
|
}
|
|
723
|
-
V = new WeakSet(),
|
|
723
|
+
V = new WeakSet(), Se = function() {
|
|
724
724
|
const { el: i, options: t } = this.__storage__;
|
|
725
725
|
if (!rt(i) || !w(i))
|
|
726
726
|
return;
|
|
727
|
-
const { SETTINGS: e, EVENTS: s } =
|
|
727
|
+
const { SETTINGS: e, EVENTS: s } = Ue;
|
|
728
728
|
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
729
729
|
for (const [o, a] of Object.entries(this.options.on))
|
|
730
730
|
this.__events__[o] = [a];
|
|
731
|
-
d(this,
|
|
732
|
-
},
|
|
731
|
+
d(this, Lt, pi).call(this);
|
|
732
|
+
}, Lt = new WeakSet(), pi = function() {
|
|
733
733
|
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !w(e) ? window : L(e);
|
|
734
734
|
this.eventHandler = () => {
|
|
735
735
|
_s(s, i);
|
|
736
736
|
}, i.forEach((a) => {
|
|
737
|
-
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 =
|
|
737
|
+
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 = $s(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, "");
|
|
738
738
|
});
|
|
739
739
|
const { eventHandler: o } = this;
|
|
740
740
|
o(), s.aost = {}, s.aost.eventHandler = o, s.addEventListener("scroll", s.aost.eventHandler, !1);
|
|
741
741
|
};
|
|
742
|
-
Object.assign(
|
|
743
|
-
const
|
|
742
|
+
Object.assign(hi.prototype, O);
|
|
743
|
+
const xs = (n) => {
|
|
744
744
|
const { TEMPLATE: i } = Y, { childDom: t } = n, e = document.createElement("div");
|
|
745
745
|
e.innerHTML = i();
|
|
746
746
|
const s = e.querySelector(".player-wrapper");
|
|
@@ -748,25 +748,25 @@ const $s = (n) => {
|
|
|
748
748
|
s.append(o);
|
|
749
749
|
}), e.children[0];
|
|
750
750
|
};
|
|
751
|
-
var
|
|
752
|
-
class
|
|
751
|
+
var St, mi, Dt, gi, kt, fi, _t, vi, $t, bi, xt, yi, Ct, wi, Ht, Ti, Mt, Ei;
|
|
752
|
+
class Cs extends HTMLElement {
|
|
753
753
|
constructor() {
|
|
754
754
|
super();
|
|
755
|
-
h(this, Lt);
|
|
756
755
|
h(this, St);
|
|
757
756
|
h(this, Dt);
|
|
757
|
+
h(this, kt);
|
|
758
758
|
// youtube iframe
|
|
759
759
|
h(this, _t);
|
|
760
760
|
// vimeo iframe
|
|
761
|
-
h(this, kt);
|
|
762
|
-
// youku iframe
|
|
763
761
|
h(this, $t);
|
|
762
|
+
// youku iframe
|
|
764
763
|
h(this, xt);
|
|
765
|
-
// 2025.02.11 新增 ig
|
|
766
764
|
h(this, Ct);
|
|
767
|
-
// 2025.02.11 新增
|
|
765
|
+
// 2025.02.11 新增 ig
|
|
768
766
|
h(this, Ht);
|
|
769
|
-
|
|
767
|
+
// 2025.02.11 新增 tiktok
|
|
768
|
+
h(this, Mt);
|
|
769
|
+
d(this, St, mi).call(this);
|
|
770
770
|
}
|
|
771
771
|
play() {
|
|
772
772
|
const { videoType: t } = this;
|
|
@@ -803,92 +803,97 @@ class xs extends HTMLElement {
|
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
|
-
|
|
806
|
+
St = new WeakSet(), mi = function() {
|
|
807
807
|
if (!this.getAttribute("video-id")) {
|
|
808
808
|
E("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
|
809
809
|
return;
|
|
810
810
|
}
|
|
811
|
-
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), d(this,
|
|
812
|
-
}, St = new WeakSet(), mi = function() {
|
|
813
|
-
this.childDom = this.childNodes, this.template = $s(this), this.innerHTML = "", this.append(this.template), d(this, Dt, gi).call(this);
|
|
811
|
+
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), d(this, Dt, gi).call(this);
|
|
814
812
|
}, Dt = new WeakSet(), gi = function() {
|
|
813
|
+
this.childDom = this.childNodes, this.template = xs(this), this.innerHTML = "", this.append(this.template), d(this, kt, fi).call(this);
|
|
814
|
+
}, kt = new WeakSet(), fi = function() {
|
|
815
815
|
const { videoType: t } = this;
|
|
816
816
|
let e = "";
|
|
817
|
+
function s(o) {
|
|
818
|
+
f(o).addClass("cookie-disagree"), f(".cookie-disagree").append(`
|
|
819
|
+
<div class="disagree-inner">
|
|
820
|
+
<div class="icon"> <svg xmlns="http://www.w3.org/2000/svg" width="7" height="25" viewBox="0 0 7 25"
|
|
821
|
+
fill="none">
|
|
822
|
+
<path
|
|
823
|
+
d="M0 0H6.96277L5.77128 16.1948H1.22872L0 0ZM0 22.0304C0 21.1556 0.322695 20.442 0.968085 19.8895C1.6383 19.337 2.48227 19.0608 3.5 19.0608C4.51773 19.0608 5.34929 19.337 5.99468 19.8895C6.66489 20.442 7 21.1556 7 22.0304C7 22.9052 6.66489 23.6188 5.99468 24.1713C5.34929 24.7238 4.51773 25 3.5 25C2.48227 25 1.6383 24.7238 0.968085 24.1713C0.322695 23.6188 0 22.9052 0 22.0304Z"
|
|
824
|
+
fill="white"></path>
|
|
825
|
+
</svg></div>
|
|
826
|
+
<div class="title ch">由於未授權 Cookie 使用,影片無法播放</div>
|
|
827
|
+
<div class="title en">The video can’t be played due to unauthorized use of cookies.</div>
|
|
828
|
+
<div class="text">
|
|
829
|
+
<div class="box"><span>您可前往 </span><span data-cookie-open>Cookie 偏好設定</span><span> 進行修改</span></div>
|
|
830
|
+
<div class="box"><span>Modify your </span><span data-cookie-open>cookie preferences.</span></div>
|
|
831
|
+
</div>
|
|
832
|
+
</div>`);
|
|
833
|
+
}
|
|
817
834
|
switch (t) {
|
|
818
835
|
case "youtubeAPI":
|
|
819
836
|
break;
|
|
820
837
|
case "youtube":
|
|
821
|
-
|
|
822
|
-
return;
|
|
823
|
-
e = d(this, _t, fi).call(this);
|
|
838
|
+
document.body.wd_youtube == !1 ? s("video-player") : e = d(this, _t, vi).call(this);
|
|
824
839
|
break;
|
|
825
840
|
case "youkuAPI":
|
|
826
841
|
break;
|
|
827
842
|
case "youku":
|
|
828
|
-
|
|
829
|
-
return;
|
|
830
|
-
e = d(this, $t, bi).call(this);
|
|
843
|
+
document.body.wd_youku == !1 ? s("video-player") : e = d(this, xt, yi).call(this);
|
|
831
844
|
break;
|
|
832
845
|
case "vimeo":
|
|
833
|
-
|
|
834
|
-
return;
|
|
835
|
-
e = d(this, kt, vi).call(this);
|
|
846
|
+
document.body.wd_vimeo == !1 ? s("video-player") : e = d(this, $t, bi).call(this);
|
|
836
847
|
break;
|
|
837
848
|
case "bilibili":
|
|
838
|
-
|
|
839
|
-
return;
|
|
840
|
-
e = d(this, xt, yi).call(this);
|
|
849
|
+
document.body.wd_bilibili == !1 ? s("video-player") : e = d(this, Ct, wi).call(this);
|
|
841
850
|
break;
|
|
842
851
|
case "instagram":
|
|
843
|
-
|
|
844
|
-
return;
|
|
845
|
-
e = d(this, Ct, wi).call(this);
|
|
852
|
+
document.body.wd_instagram == !1 ? s(".instagram-media") : e = d(this, Ht, Ti).call(this);
|
|
846
853
|
break;
|
|
847
854
|
case "tiktok":
|
|
848
|
-
|
|
849
|
-
return;
|
|
850
|
-
e = d(this, Ht, Ti).call(this);
|
|
855
|
+
document.body.wd_tiktok == !1 ? s("video-player") : e = d(this, Mt, Ei).call(this);
|
|
851
856
|
break;
|
|
852
857
|
}
|
|
853
858
|
this.querySelector(".player-wrapper").insertAdjacentHTML(A.prepend, e);
|
|
854
|
-
}, _t = new WeakSet(),
|
|
859
|
+
}, _t = new WeakSet(), vi = function() {
|
|
855
860
|
const { videoId: t, autoplay: e, startTime: s } = this;
|
|
856
861
|
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>`;
|
|
857
|
-
},
|
|
862
|
+
}, $t = new WeakSet(), bi = function() {
|
|
858
863
|
const { videoId: t, autoplay: e, hash: s } = this;
|
|
859
864
|
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>`;
|
|
860
|
-
},
|
|
865
|
+
}, xt = new WeakSet(), yi = function() {
|
|
861
866
|
const { videoId: t, autoplay: e } = this;
|
|
862
867
|
return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}" frameborder=0 "allowfullscreen"></iframe>`;
|
|
863
|
-
},
|
|
868
|
+
}, Ct = new WeakSet(), wi = function() {
|
|
864
869
|
const { videoId: t, autoplay: e } = this;
|
|
865
870
|
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>`;
|
|
866
|
-
},
|
|
871
|
+
}, Ht = new WeakSet(), Ti = function() {
|
|
867
872
|
const { videoId: t, autoplay: e } = this;
|
|
868
873
|
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>`;
|
|
869
|
-
},
|
|
874
|
+
}, Mt = new WeakSet(), Ei = function() {
|
|
870
875
|
const { videoId: t, autoplay: e } = this;
|
|
871
876
|
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>`;
|
|
872
877
|
};
|
|
873
|
-
const
|
|
878
|
+
const vn = (n) => new Promise((i) => {
|
|
874
879
|
let t = setTimeout(() => (clearTimeout(t), i()), n);
|
|
875
880
|
});
|
|
876
|
-
function
|
|
881
|
+
function Ai(n) {
|
|
877
882
|
const i = [];
|
|
878
883
|
n && n.forEach((t) => {
|
|
879
884
|
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(`${t}`));
|
|
880
|
-
}),
|
|
885
|
+
}), f("html").addClass("scrollLock"), bs(i);
|
|
881
886
|
}
|
|
882
|
-
function
|
|
887
|
+
function Li(n) {
|
|
883
888
|
const i = [];
|
|
884
889
|
n && n.forEach((t) => {
|
|
885
890
|
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(`${t}`));
|
|
886
|
-
}),
|
|
891
|
+
}), f("html").removeClass("scrollLock"), ys(i);
|
|
887
892
|
}
|
|
888
|
-
async function
|
|
889
|
-
if (
|
|
893
|
+
async function bn(n = 0) {
|
|
894
|
+
if (f(".loading-wrapper").length)
|
|
890
895
|
return;
|
|
891
|
-
|
|
896
|
+
f("body").append(`
|
|
892
897
|
<div class="loading-wrapper">
|
|
893
898
|
<div class="icon-box">
|
|
894
899
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><path d="M10 50A40 40 0 0 0 90 50A40 42 0 0 1 10 50" fill="#ffffff" stroke="none">
|
|
@@ -898,31 +903,31 @@ async function vn(n = 0) {
|
|
|
898
903
|
</svg>
|
|
899
904
|
</div>
|
|
900
905
|
</div>
|
|
901
|
-
`),
|
|
902
|
-
|
|
906
|
+
`), f(".loading-wrapper").delay(n).fadeIn(300).promise().done(function() {
|
|
907
|
+
Ai();
|
|
903
908
|
});
|
|
904
909
|
}
|
|
905
|
-
function
|
|
906
|
-
|
|
907
|
-
|
|
910
|
+
function yn() {
|
|
911
|
+
f(".loading-wrapper").fadeOut(300).promise().done(function() {
|
|
912
|
+
f(".loading-wrapper").remove(), Li();
|
|
908
913
|
});
|
|
909
914
|
}
|
|
910
|
-
function
|
|
911
|
-
new
|
|
915
|
+
function wn(n, i) {
|
|
916
|
+
new rn(n, i);
|
|
912
917
|
}
|
|
913
|
-
function
|
|
914
|
-
const n = document.querySelector("[data-aost]") && new
|
|
915
|
-
} }), e = new
|
|
918
|
+
function Hs() {
|
|
919
|
+
const n = document.querySelector("[data-aost]") && new hi("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new Ve("[data-anchor-target]"), t = new Ye({ callback_loaded: () => {
|
|
920
|
+
} }), e = new Ks();
|
|
916
921
|
n == null || n.update(), t.update(), e.reValidate(), i == null || i.update();
|
|
917
922
|
}
|
|
918
|
-
function
|
|
923
|
+
function Tn(n, i = () => {
|
|
919
924
|
}) {
|
|
920
|
-
|
|
925
|
+
f(`[data-tab-content=${n}]`).fadeIn(function() {
|
|
921
926
|
typeof i == "function" && i();
|
|
922
|
-
}).siblings("[data-tab-content]").hide(),
|
|
927
|
+
}).siblings("[data-tab-content]").hide(), Hs();
|
|
923
928
|
}
|
|
924
|
-
function
|
|
925
|
-
|
|
929
|
+
function En() {
|
|
930
|
+
qe(
|
|
926
931
|
{
|
|
927
932
|
target: document.body,
|
|
928
933
|
cancel: {
|
|
@@ -946,28 +951,28 @@ function Tn() {
|
|
|
946
951
|
}
|
|
947
952
|
);
|
|
948
953
|
}
|
|
949
|
-
function
|
|
954
|
+
function An() {
|
|
950
955
|
window.onpageshow = function(n) {
|
|
951
956
|
n.persisted && window.location.reload();
|
|
952
957
|
};
|
|
953
958
|
}
|
|
954
|
-
function
|
|
959
|
+
function Ln() {
|
|
955
960
|
const n = navigator.userAgent;
|
|
956
961
|
return {
|
|
957
962
|
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)
|
|
958
963
|
};
|
|
959
964
|
}
|
|
960
|
-
function
|
|
961
|
-
|
|
962
|
-
|
|
965
|
+
function Sn(n, i) {
|
|
966
|
+
f(n).on("click", function() {
|
|
967
|
+
f(this).toggleClass(i);
|
|
963
968
|
});
|
|
964
969
|
}
|
|
965
|
-
function
|
|
966
|
-
|
|
967
|
-
|
|
970
|
+
function Dn(n, i) {
|
|
971
|
+
f(n).on("click", function() {
|
|
972
|
+
f(n).not(this).removeClass(i), f(this).addClass(i);
|
|
968
973
|
});
|
|
969
974
|
}
|
|
970
|
-
function
|
|
975
|
+
function Ms(n, i = 250) {
|
|
971
976
|
let t = null;
|
|
972
977
|
return function(...e) {
|
|
973
978
|
let s = this;
|
|
@@ -976,7 +981,7 @@ function Hs(n, i = 250) {
|
|
|
976
981
|
}, i);
|
|
977
982
|
};
|
|
978
983
|
}
|
|
979
|
-
function
|
|
984
|
+
function kn(n, i = 250) {
|
|
980
985
|
let t, e;
|
|
981
986
|
return function() {
|
|
982
987
|
const s = this, o = arguments, a = +/* @__PURE__ */ new Date();
|
|
@@ -986,43 +991,43 @@ function Dn(n, i = 250) {
|
|
|
986
991
|
};
|
|
987
992
|
}
|
|
988
993
|
function _n() {
|
|
989
|
-
window._g.interval = [],
|
|
990
|
-
const e = Number(
|
|
994
|
+
window._g.interval = [], f(".countdown").each((i, t) => {
|
|
995
|
+
const e = Number(f(t).attr("data-seconds")) + 1;
|
|
991
996
|
let s = Math.floor(e / 60) + ":" + e % 60;
|
|
992
997
|
window._g.interval[i] = setInterval(function() {
|
|
993
998
|
var o = s.split(":"), a = parseInt(o[0], 10), r = parseInt(o[1], 10);
|
|
994
|
-
--r, a = r < 0 ? --a : a, a = a < 10 ? a = "0" + a : a, a == 0 && r == 0 && clearInterval(window._g.interval[i]), r = r < 0 ? 59 : r, r = r < 10 ? "0" + r : r,
|
|
999
|
+
--r, a = r < 0 ? --a : a, a = a < 10 ? a = "0" + a : a, a == 0 && r == 0 && clearInterval(window._g.interval[i]), r = r < 0 ? 59 : r, r = r < 10 ? "0" + r : r, f(t).html(a + ":" + r), s = a + ":" + r;
|
|
995
1000
|
}, 1e3);
|
|
996
1001
|
});
|
|
997
1002
|
}
|
|
998
|
-
function
|
|
1003
|
+
function $n(n = 500) {
|
|
999
1004
|
return new Promise((i, t) => {
|
|
1000
1005
|
let e = setTimeout(() => {
|
|
1001
1006
|
clearTimeout(e), i();
|
|
1002
1007
|
}, n);
|
|
1003
1008
|
});
|
|
1004
1009
|
}
|
|
1005
|
-
function
|
|
1010
|
+
function xn() {
|
|
1006
1011
|
const n = function() {
|
|
1007
1012
|
let i = window.innerHeight * 0.01;
|
|
1008
1013
|
document.documentElement.style.setProperty("--vh", i + "px");
|
|
1009
1014
|
};
|
|
1010
|
-
n(), window.addEventListener("resize",
|
|
1015
|
+
n(), window.addEventListener("resize", Ms(n));
|
|
1011
1016
|
}
|
|
1012
|
-
function
|
|
1013
|
-
const o = this, r =
|
|
1017
|
+
function Cn(n, i, t, e, s) {
|
|
1018
|
+
const o = this, r = f(n).html().split("<br>");
|
|
1014
1019
|
let l = "", c = 0;
|
|
1015
1020
|
r.forEach((u, p) => {
|
|
1016
|
-
p !== 0 && (l += "<br>"), u.split("").forEach((m,
|
|
1017
|
-
i ? (
|
|
1021
|
+
p !== 0 && (l += "<br>"), u.split("").forEach((m, v) => {
|
|
1022
|
+
i ? (v === 0 && (l += '<span class="letter-wrap" style="display: inline-block">'), m === " " ? l += '</span> <span class="letter-wrap" style="display: inline-block">' : (l += `<span class="letter"${s || t ? ` style="${s ? `transition: ${o.formatFloat(Math.random(), 2) * s}s;` : ""}${t ? t === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${t + c * e}s;` : ""}"` : ""}>${m}</span>`, c++), v === u.length - 1 && (l += "</span>")) : m === " " ? l += " " : (l += `<span class="letter"${s || t ? ` style="${s ? `transition: ${o.formatFloat(Math.random(), 2) * s}s;` : ""}${t ? t === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${t + c * e}s;` : ""}"` : ""}>${m}</span>`, c++);
|
|
1018
1023
|
});
|
|
1019
|
-
}),
|
|
1024
|
+
}), f(n).html(l);
|
|
1020
1025
|
}
|
|
1021
|
-
function
|
|
1026
|
+
function Hn(n, i) {
|
|
1022
1027
|
const t = Math.pow(10, i);
|
|
1023
1028
|
return Math.round(n * t) / t;
|
|
1024
1029
|
}
|
|
1025
|
-
function
|
|
1030
|
+
function Mn(n) {
|
|
1026
1031
|
let i = n.activeIndex, t = n.slides.length;
|
|
1027
1032
|
if (n.params.loop)
|
|
1028
1033
|
switch (n.activeIndex) {
|
|
@@ -1037,101 +1042,101 @@ function Hn(n) {
|
|
|
1037
1042
|
}
|
|
1038
1043
|
return i;
|
|
1039
1044
|
}
|
|
1040
|
-
function
|
|
1045
|
+
function qn(n, i) {
|
|
1041
1046
|
const t = n.$el, e = n.params.grid.rows, s = i || n.params.slidesPerView * e;
|
|
1042
|
-
(n.loopedSlides ? n.slides.length - n.loopedSlides * 2 : n.slides.length) <= s ? (t.addClass("swiper-no-swiping"),
|
|
1047
|
+
(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());
|
|
1043
1048
|
}
|
|
1044
|
-
function
|
|
1049
|
+
function In(n) {
|
|
1045
1050
|
n.el.querySelectorAll("img.detect-shade").forEach((i) => {
|
|
1046
1051
|
i.addEventListener("load", function() {
|
|
1047
1052
|
detectShade(i);
|
|
1048
1053
|
});
|
|
1049
1054
|
});
|
|
1050
1055
|
}
|
|
1051
|
-
function
|
|
1052
|
-
const i = n.el, t =
|
|
1053
|
-
n.autoplay.stop(),
|
|
1056
|
+
function On(n) {
|
|
1057
|
+
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");
|
|
1058
|
+
n.autoplay.stop(), f(e).off("ended"), e ? (s.each((o, a) => {
|
|
1054
1059
|
a.currentTime = 0;
|
|
1055
|
-
}),
|
|
1060
|
+
}), f(e).on("ended", function() {
|
|
1056
1061
|
n.slideNext();
|
|
1057
1062
|
}), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
|
|
1058
1063
|
}
|
|
1059
|
-
function
|
|
1060
|
-
|
|
1061
|
-
const t =
|
|
1064
|
+
function Nn() {
|
|
1065
|
+
f(".number-grow").each(function(n, i) {
|
|
1066
|
+
const t = f(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
|
|
1062
1067
|
let r = "";
|
|
1063
1068
|
for (var l = 0; l <= 9; l++)
|
|
1064
1069
|
r += String(l) + "<br>";
|
|
1065
1070
|
return r;
|
|
1066
1071
|
};
|
|
1067
|
-
|
|
1072
|
+
f(o).each(function(r, l) {
|
|
1068
1073
|
const c = () => l !== "," ? `<div class="num" data-final-num="${l}"><div><br>${a()}<br>${a()}</div></div>` : `<div class="comma">${l}</div>`;
|
|
1069
1074
|
t.append(c);
|
|
1070
1075
|
});
|
|
1071
1076
|
});
|
|
1072
1077
|
}
|
|
1073
|
-
function
|
|
1074
|
-
|
|
1075
|
-
const t =
|
|
1078
|
+
function Pn() {
|
|
1079
|
+
f(".letter-grow").each(function(n, i) {
|
|
1080
|
+
const t = f(i), s = t.attr("data-letter").split(""), o = () => {
|
|
1076
1081
|
let a = "";
|
|
1077
1082
|
for (let r = 65; r <= 90; r++)
|
|
1078
1083
|
a += String.fromCharCode(r) + "<br>";
|
|
1079
1084
|
return a;
|
|
1080
1085
|
};
|
|
1081
|
-
|
|
1086
|
+
f(s).each(function(a, r) {
|
|
1082
1087
|
const l = `<div class="letter" data-final-letter="${r}"><div><br>${o()}<br>${o()}</div></div>`;
|
|
1083
1088
|
t.append(l);
|
|
1084
1089
|
});
|
|
1085
1090
|
});
|
|
1086
1091
|
}
|
|
1087
|
-
function
|
|
1092
|
+
function jn(n) {
|
|
1088
1093
|
const i = getComputedStyle(n).transform;
|
|
1089
1094
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
|
1090
1095
|
return t ? parseFloat(t[1].split(", ")[12]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[4]) : 0);
|
|
1091
1096
|
}
|
|
1092
|
-
function
|
|
1097
|
+
function zn(n) {
|
|
1093
1098
|
const i = getComputedStyle(n).transform;
|
|
1094
1099
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
|
1095
1100
|
return t ? parseFloat(t[1].split(", ")[13]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[5]) : 0);
|
|
1096
1101
|
}
|
|
1097
|
-
function
|
|
1102
|
+
function Wn(n) {
|
|
1098
1103
|
const i = document.createElement("div");
|
|
1099
1104
|
return i.innerHTML = n, i.childNodes[0];
|
|
1100
1105
|
}
|
|
1101
|
-
const
|
|
1102
|
-
var K,
|
|
1103
|
-
class
|
|
1106
|
+
const We = (n) => n.videoId !== "" || typeof n.videoId < "u", qs = (n) => n.$selector.getAttribute("video4-active") === "on", dt = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`;
|
|
1107
|
+
var K, De, qt, Si, It, Di, tt, ke, Ot, ki;
|
|
1108
|
+
class Is {
|
|
1104
1109
|
constructor(i, t = {}) {
|
|
1105
1110
|
h(this, K);
|
|
1106
|
-
h(this, Mt);
|
|
1107
1111
|
h(this, qt);
|
|
1108
|
-
h(this, tt);
|
|
1109
1112
|
h(this, It);
|
|
1110
|
-
|
|
1111
|
-
|
|
1113
|
+
h(this, tt);
|
|
1114
|
+
h(this, Ot);
|
|
1115
|
+
if (!rt(i) && !Te(i) && !lt(i)) {
|
|
1116
|
+
je("video4", `找不到該物件 -> ${i}`);
|
|
1112
1117
|
return;
|
|
1113
1118
|
}
|
|
1114
1119
|
this.__storage__ = {
|
|
1115
1120
|
el: i,
|
|
1116
1121
|
options: t
|
|
1117
|
-
}, this.active = "data-video-active", d(this, K,
|
|
1122
|
+
}, this.active = "data-video-active", d(this, K, De).call(this);
|
|
1118
1123
|
}
|
|
1119
1124
|
update() {
|
|
1120
|
-
d(this, K,
|
|
1125
|
+
d(this, K, De).call(this);
|
|
1121
1126
|
}
|
|
1122
1127
|
}
|
|
1123
|
-
K = new WeakSet(),
|
|
1128
|
+
K = new WeakSet(), De = function() {
|
|
1124
1129
|
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Y;
|
|
1125
1130
|
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
1126
1131
|
for (const [o, a] of Object.entries(this.options.on))
|
|
1127
1132
|
this.__events__[o] = [a];
|
|
1128
|
-
d(this,
|
|
1129
|
-
},
|
|
1133
|
+
d(this, qt, Si).call(this);
|
|
1134
|
+
}, qt = new WeakSet(), Si = function() {
|
|
1130
1135
|
const { elements: i, options: t } = this;
|
|
1131
1136
|
i.forEach((e) => {
|
|
1132
|
-
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this,
|
|
1137
|
+
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, Ot, ki).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), We(e.video.params) && !qs(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, It, Di).call(this, e)), We(e.video.params) || je("video4", "無法取得影片 ID");
|
|
1133
1138
|
}), this.emit("init");
|
|
1134
|
-
},
|
|
1139
|
+
}, It = new WeakSet(), Di = function(i) {
|
|
1135
1140
|
const { LAYOUT: t } = Y, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: p } = e;
|
|
1136
1141
|
if (l === "onBox") {
|
|
1137
1142
|
let g = null;
|
|
@@ -1139,36 +1144,36 @@ K = new WeakSet(), Se = function() {
|
|
|
1139
1144
|
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(A.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
|
1140
1145
|
const m = s.querySelector("img");
|
|
1141
1146
|
m.insertAdjacentHTML(A.after, t[o]);
|
|
1142
|
-
const
|
|
1143
|
-
!
|
|
1147
|
+
const v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
|
1148
|
+
!v && r == "youtube" ? p == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !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((b) => b.json()).then((b) => {
|
|
1144
1149
|
const y = b.thumbnail_url;
|
|
1145
1150
|
m.setAttribute("src", `${y}`);
|
|
1146
1151
|
}).catch(function(b) {
|
|
1147
1152
|
console.log("error");
|
|
1148
1153
|
}) : E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
|
1149
1154
|
}
|
|
1150
|
-
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, tt,
|
|
1155
|
+
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, tt, ke), g.addEventListener("click", g.video.eventHandler);
|
|
1151
1156
|
} else if (l === "onPage") {
|
|
1152
1157
|
let g = null;
|
|
1153
1158
|
if (u == "on") {
|
|
1154
1159
|
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(A.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
|
1155
1160
|
const m = s.querySelector("img");
|
|
1156
1161
|
m.insertAdjacentHTML(A.after, t[o]);
|
|
1157
|
-
const
|
|
1158
|
-
!
|
|
1162
|
+
const v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
|
1163
|
+
!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((b) => b.json()).then((b) => {
|
|
1159
1164
|
const y = b.thumbnail_url;
|
|
1160
1165
|
m.setAttribute("src", `${y}`);
|
|
1161
1166
|
}).catch(function(b) {
|
|
1162
1167
|
console.log("error");
|
|
1163
|
-
}) :
|
|
1168
|
+
}) : v || E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
|
1164
1169
|
} else {
|
|
1165
|
-
s.innerHTML =
|
|
1170
|
+
s.innerHTML = dt(e);
|
|
1166
1171
|
return;
|
|
1167
1172
|
}
|
|
1168
|
-
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, tt,
|
|
1173
|
+
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, tt, ke), g.addEventListener("click", g.video.eventHandler);
|
|
1169
1174
|
}
|
|
1170
|
-
}, tt = new WeakSet(),
|
|
1171
|
-
const { video: t, emit: e } = this, { $selector: s, videoMode: o, videoTarget: a, videoKeep: r, videoTargetRoute: l, videoType: c, videoIgHtml: u } = t.params, p = new
|
|
1175
|
+
}, tt = new WeakSet(), ke = function(i) {
|
|
1176
|
+
const { video: t, emit: e } = this, { $selector: s, videoMode: o, videoTarget: a, videoKeep: r, videoTargetRoute: l, videoType: c, videoIgHtml: u } = t.params, p = new Ye({ callback_loaded: (g) => {
|
|
1172
1177
|
} });
|
|
1173
1178
|
if (o == "onBox") {
|
|
1174
1179
|
const g = {
|
|
@@ -1176,21 +1181,21 @@ K = new WeakSet(), Se = function() {
|
|
|
1176
1181
|
route: l,
|
|
1177
1182
|
on: {
|
|
1178
1183
|
complete(m) {
|
|
1179
|
-
var
|
|
1180
|
-
c == "instagram" ? (m.setAttribute("video-typeStyle", `${c}`), (
|
|
1184
|
+
var v;
|
|
1185
|
+
c == "instagram" ? (m.setAttribute("video-typeStyle", `${c}`), (v = window.instgrm) != null && v.Embeds ? window.instgrm.Embeds.process() : console.log("window.instgrm is undefined")) : (m.querySelector(".modal-content").insertAdjacentHTML("beforeend", dt(t.params)), m.setAttribute("video-typeStyle", `${c}`));
|
|
1181
1186
|
},
|
|
1182
1187
|
open(m) {
|
|
1183
|
-
const
|
|
1184
|
-
if (p.update(),
|
|
1188
|
+
const v = m.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1189
|
+
if (p.update(), Ai([...v]), c == "instagram") {
|
|
1185
1190
|
const b = document.querySelector("[video-template] .modal-content");
|
|
1186
|
-
new ResizeObserver((
|
|
1187
|
-
|
|
1191
|
+
new ResizeObserver((k) => {
|
|
1192
|
+
k[0].contentRect.height > 50 && b.classList.add("active");
|
|
1188
1193
|
}).observe(b);
|
|
1189
1194
|
}
|
|
1190
1195
|
},
|
|
1191
1196
|
close(m) {
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1197
|
+
const v = m.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1198
|
+
Li([...v]);
|
|
1194
1199
|
},
|
|
1195
1200
|
destroy(m) {
|
|
1196
1201
|
}
|
|
@@ -1199,13 +1204,13 @@ K = new WeakSet(), Se = function() {
|
|
|
1199
1204
|
J.open(g);
|
|
1200
1205
|
} else if (o == "onPage")
|
|
1201
1206
|
if (t.params.videoAutoplay = "on", r == "off") {
|
|
1202
|
-
s.innerHTML =
|
|
1207
|
+
s.innerHTML = dt(t.params);
|
|
1203
1208
|
return;
|
|
1204
1209
|
} else {
|
|
1205
|
-
(s.querySelector(r) ?? s).insertAdjacentHTML("beforeend",
|
|
1210
|
+
(s.querySelector(r) ?? s).insertAdjacentHTML("beforeend", dt(t.params));
|
|
1206
1211
|
return;
|
|
1207
1212
|
}
|
|
1208
|
-
},
|
|
1213
|
+
}, Ot = new WeakSet(), ki = function(i) {
|
|
1209
1214
|
const { SETTINGS: t } = Y;
|
|
1210
1215
|
return {
|
|
1211
1216
|
$selector: i,
|
|
@@ -1224,9 +1229,9 @@ K = new WeakSet(), Se = function() {
|
|
|
1224
1229
|
videoIgHtml: i.getAttribute("video-ig") || t.videoIgHtml
|
|
1225
1230
|
};
|
|
1226
1231
|
};
|
|
1227
|
-
Object.assign(
|
|
1228
|
-
customElements.define("video-player",
|
|
1229
|
-
const
|
|
1232
|
+
Object.assign(Is.prototype, O);
|
|
1233
|
+
customElements.define("video-player", Cs);
|
|
1234
|
+
const Os = {
|
|
1230
1235
|
"zh-tw": {
|
|
1231
1236
|
臺北市: [
|
|
1232
1237
|
["中正區", "100"],
|
|
@@ -2057,8 +2062,8 @@ const Is = {
|
|
|
2057
2062
|
}
|
|
2058
2063
|
};
|
|
2059
2064
|
let U;
|
|
2060
|
-
const
|
|
2061
|
-
const { TEMPLATE: i } =
|
|
2065
|
+
const Ns = (n) => {
|
|
2066
|
+
const { TEMPLATE: i } = Ie, { childDom: t } = n.s, e = document.createElement("div"), s = n.classList.contains("filter"), o = n.getAttribute("filter-placeholder"), a = n.getAttribute("d4-icon"), r = n.getAttribute("custom-template");
|
|
2062
2067
|
e.innerHTML = i(
|
|
2063
2068
|
s,
|
|
2064
2069
|
o,
|
|
@@ -2071,7 +2076,7 @@ const Os = (n) => {
|
|
|
2071
2076
|
(!p.hasAttribute("data-option") || p.getAttribute("data-option").trim() === "") && p.setAttribute("data-option", p.textContent.trim());
|
|
2072
2077
|
}) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
|
|
2073
2078
|
}), e.children[0];
|
|
2074
|
-
},
|
|
2079
|
+
}, Ps = (n) => {
|
|
2075
2080
|
var t;
|
|
2076
2081
|
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
|
2077
2082
|
i && i.forEach((e) => {
|
|
@@ -2130,13 +2135,13 @@ const Os = (n) => {
|
|
|
2130
2135
|
break;
|
|
2131
2136
|
}
|
|
2132
2137
|
}
|
|
2133
|
-
},
|
|
2138
|
+
}, js = (n) => {
|
|
2134
2139
|
const i = n.s.cityLang;
|
|
2135
|
-
|
|
2140
|
+
f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (U = JSON.parse(f("#newCityData").val())[0], console.log([0])) : U = Os, n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(U[i]).forEach((t) => {
|
|
2136
2141
|
const e = document.createElement("li");
|
|
2137
2142
|
e.textContent = t, e.setAttribute("data-option", t), n.s.dropdownEl.querySelector(".dropdown-list").append(e);
|
|
2138
2143
|
}), n.s.allLi = n.querySelectorAll(".dropdown-list li"));
|
|
2139
|
-
},
|
|
2144
|
+
}, zs = (n, i) => {
|
|
2140
2145
|
const t = n.s.cityLang;
|
|
2141
2146
|
U[t][i].forEach((e, s) => {
|
|
2142
2147
|
const o = document.createElement("li");
|
|
@@ -2146,26 +2151,26 @@ const Os = (n) => {
|
|
|
2146
2151
|
S('dropdown-el[d4-status="open"]').forEach((i) => {
|
|
2147
2152
|
i.close();
|
|
2148
2153
|
});
|
|
2149
|
-
},
|
|
2150
|
-
const { SETTINGS: n } =
|
|
2154
|
+
}, Ws = () => {
|
|
2155
|
+
const { SETTINGS: n } = Ie;
|
|
2151
2156
|
((t, e) => {
|
|
2152
2157
|
Object.keys(e).forEach((s) => {
|
|
2153
2158
|
t.style.setProperty(`--${s}`, e[s]);
|
|
2154
2159
|
});
|
|
2155
2160
|
})(document.documentElement, n.scrollbar);
|
|
2156
2161
|
};
|
|
2157
|
-
|
|
2162
|
+
Ws();
|
|
2158
2163
|
document.addEventListener("click", function() {
|
|
2159
2164
|
_i();
|
|
2160
2165
|
});
|
|
2161
|
-
var
|
|
2162
|
-
class
|
|
2166
|
+
var Nt, xi, Pt, Ci, jt, Hi, zt, Mi;
|
|
2167
|
+
class $i extends HTMLElement {
|
|
2163
2168
|
constructor() {
|
|
2164
2169
|
super();
|
|
2165
|
-
h(this, Ot);
|
|
2166
2170
|
h(this, Nt);
|
|
2167
2171
|
h(this, Pt);
|
|
2168
2172
|
h(this, jt);
|
|
2173
|
+
h(this, zt);
|
|
2169
2174
|
this.initialize = !1;
|
|
2170
2175
|
}
|
|
2171
2176
|
static get observedAttributes() {
|
|
@@ -2211,7 +2216,7 @@ class ki extends HTMLElement {
|
|
|
2211
2216
|
}
|
|
2212
2217
|
connectedCallback() {
|
|
2213
2218
|
const t = this;
|
|
2214
|
-
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this,
|
|
2219
|
+
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, Nt, xi).call(this));
|
|
2215
2220
|
}
|
|
2216
2221
|
open() {
|
|
2217
2222
|
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;
|
|
@@ -2237,14 +2242,14 @@ class ki extends HTMLElement {
|
|
|
2237
2242
|
this.__events__.selectOption();
|
|
2238
2243
|
}
|
|
2239
2244
|
}
|
|
2240
|
-
|
|
2241
|
-
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this,
|
|
2242
|
-
}, Nt = new WeakSet(), xi = function() {
|
|
2243
|
-
this.s.childDom = this.childNodes, this.s.template = Os(this), this.innerHTML = "", this.append(this.s.template), d(this, Pt, Ci).call(this);
|
|
2245
|
+
Nt = new WeakSet(), xi = function() {
|
|
2246
|
+
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Pt, Ci).call(this);
|
|
2244
2247
|
}, Pt = new WeakSet(), Ci = function() {
|
|
2248
|
+
this.s.childDom = this.childNodes, this.s.template = Ns(this), this.innerHTML = "", this.append(this.s.template), d(this, jt, Hi).call(this);
|
|
2249
|
+
}, jt = new WeakSet(), Hi = function() {
|
|
2245
2250
|
var s;
|
|
2246
2251
|
const t = this;
|
|
2247
|
-
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",
|
|
2252
|
+
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", js(t), t.s.subDropdownTotalH = 0;
|
|
2248
2253
|
const e = t.getAttribute("d4-value");
|
|
2249
2254
|
switch (t.s.selectType) {
|
|
2250
2255
|
case "single":
|
|
@@ -2253,7 +2258,7 @@ Ot = new WeakSet(), $i = function() {
|
|
|
2253
2258
|
const r = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), l = r ? r.getAttribute("d4-value") !== "" : !1;
|
|
2254
2259
|
if (r && l) {
|
|
2255
2260
|
const c = r.getAttribute("d4-value");
|
|
2256
|
-
if (
|
|
2261
|
+
if (zs(t, c), t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
|
|
2257
2262
|
const u = e.split(",")[1];
|
|
2258
2263
|
o = t.querySelector(`.dropdown-list li[data-option="${u}"]`), t.setAttribute("d4-value", u);
|
|
2259
2264
|
}
|
|
@@ -2286,8 +2291,8 @@ Ot = new WeakSet(), $i = function() {
|
|
|
2286
2291
|
};
|
|
2287
2292
|
break;
|
|
2288
2293
|
}
|
|
2289
|
-
C(t, t.s.value.index), d(s = t,
|
|
2290
|
-
},
|
|
2294
|
+
C(t, t.s.value.index), d(s = t, zt, Mi).call(s), t.classList.add("d4-initialize");
|
|
2295
|
+
}, zt = new WeakSet(), Mi = function() {
|
|
2291
2296
|
const t = this;
|
|
2292
2297
|
t.__events__.dropdownToggle = () => {
|
|
2293
2298
|
t.addEventListener("click", function(e) {
|
|
@@ -2333,7 +2338,7 @@ Ot = new WeakSet(), $i = function() {
|
|
|
2333
2338
|
t.s.dropdownEl.addEventListener("transitionend", e);
|
|
2334
2339
|
}, t.__events__.bindScrollbar = (e = this) => {
|
|
2335
2340
|
const s = e.querySelector(".dropdown-scroller");
|
|
2336
|
-
e.__scroller__ =
|
|
2341
|
+
e.__scroller__ = qe(s, {
|
|
2337
2342
|
overflowBehavior: {
|
|
2338
2343
|
x: "hidden"
|
|
2339
2344
|
}
|
|
@@ -2347,24 +2352,24 @@ Ot = new WeakSet(), $i = function() {
|
|
|
2347
2352
|
const u = this, p = [...e.s.allLi].indexOf(u), g = parseInt(e.getAttribute("d4-default-height"));
|
|
2348
2353
|
if (u.classList.contains("has-sublayer")) {
|
|
2349
2354
|
c.stopPropagation();
|
|
2350
|
-
const
|
|
2351
|
-
|
|
2352
|
-
const
|
|
2355
|
+
const v = u.querySelector(".sub-dropdown"), b = v.querySelector(".sub-dropdown-list"), y = parseInt(getComputedStyle(b).marginTop) + parseInt(getComputedStyle(b).marginBottom);
|
|
2356
|
+
v.style.cssText = `--height: ${b.offsetHeight + y}px`;
|
|
2357
|
+
const k = parseInt(v.style.cssText.replace("--height:", "").trim()), G = parseInt(getComputedStyle(a).maxHeight), D = () => {
|
|
2353
2358
|
s = g + e.s.subDropdownTotalH, o = s > G ? G : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
|
|
2354
2359
|
};
|
|
2355
|
-
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -=
|
|
2360
|
+
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= k, D()) : (u.classList.add("open"), e.s.subDropdownTotalH += k, D());
|
|
2356
2361
|
const R = () => {
|
|
2357
|
-
e.__scroller__.update(!0),
|
|
2362
|
+
e.__scroller__.update(!0), v.removeEventListener("transitionend", R);
|
|
2358
2363
|
};
|
|
2359
|
-
|
|
2364
|
+
v.addEventListener("transitionend", R);
|
|
2360
2365
|
} else
|
|
2361
|
-
switch (
|
|
2366
|
+
switch (Ps(e), e.s.selectType) {
|
|
2362
2367
|
case "single":
|
|
2363
2368
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
|
2364
|
-
const
|
|
2365
|
-
y && (y.querySelector(".dropdown-list").textContent = "", C(y, -1), U[
|
|
2369
|
+
const v = e.s.cityLang, b = l.textContent.trim(), y = document.getElementById(e.getAttribute("dist-select"));
|
|
2370
|
+
y && (y.querySelector(".dropdown-list").textContent = "", C(y, -1), U[v][b].forEach((k, G) => {
|
|
2366
2371
|
const D = document.createElement("li");
|
|
2367
|
-
D.textContent =
|
|
2372
|
+
D.textContent = k[0], D.setAttribute("data-option", k[0]), y.querySelector(".dropdown-list").append(D);
|
|
2368
2373
|
}), e.__events__.selectOption(y));
|
|
2369
2374
|
}
|
|
2370
2375
|
(m = u.parentNode.closest("li")) != null && m.classList.contains("has-sublayer") && (c.stopPropagation(), e.close());
|
|
@@ -2403,9 +2408,9 @@ Ot = new WeakSet(), $i = function() {
|
|
|
2403
2408
|
});
|
|
2404
2409
|
}, t.__events__.dropdownToggle(), t.__events__.bindScrollbar(), t.__events__.selectOption(), t.__events__.filterHandler(), t.__events__.removeTag(), t.__events__.transitionend();
|
|
2405
2410
|
};
|
|
2406
|
-
Object.assign(
|
|
2407
|
-
customElements.define("dropdown-el",
|
|
2408
|
-
function
|
|
2411
|
+
Object.assign($i.prototype, O);
|
|
2412
|
+
customElements.define("dropdown-el", $i);
|
|
2413
|
+
function ht(n) {
|
|
2409
2414
|
const i = {};
|
|
2410
2415
|
return [...n.attributes].forEach((t) => {
|
|
2411
2416
|
if (t.name.includes("duration-")) {
|
|
@@ -2414,10 +2419,10 @@ function ut(n) {
|
|
|
2414
2419
|
}
|
|
2415
2420
|
}), Object.keys(i).length === 0 ? null : i;
|
|
2416
2421
|
}
|
|
2417
|
-
function
|
|
2418
|
-
if (
|
|
2422
|
+
function Be(n) {
|
|
2423
|
+
if (ht(n)) {
|
|
2419
2424
|
let i;
|
|
2420
|
-
const t = Object.keys(
|
|
2425
|
+
const t = Object.keys(ht(n)).map((e) => ({
|
|
2421
2426
|
value: e,
|
|
2422
2427
|
point: e
|
|
2423
2428
|
}));
|
|
@@ -2426,11 +2431,11 @@ function We(n) {
|
|
|
2426
2431
|
const { point: s, value: o } = t[e];
|
|
2427
2432
|
window.matchMedia(`(max-width: ${o}px)`).matches && (i = s);
|
|
2428
2433
|
}
|
|
2429
|
-
return i ? Number(
|
|
2434
|
+
return i ? Number(ht(n)[i]) : n.s.options.duration;
|
|
2430
2435
|
} else
|
|
2431
2436
|
return n.s.options.duration;
|
|
2432
2437
|
}
|
|
2433
|
-
function
|
|
2438
|
+
function Bs(n) {
|
|
2434
2439
|
const { behavior: i, continual: t, gap: e } = n.s.options, s = n.childNodes, o = document.createElement("div"), a = document.createElement("div");
|
|
2435
2440
|
o.className = "animate-container", a.className = "animate-item", [...s].forEach((l) => {
|
|
2436
2441
|
a.append(l);
|
|
@@ -2497,20 +2502,20 @@ function $(n) {
|
|
|
2497
2502
|
}
|
|
2498
2503
|
return s;
|
|
2499
2504
|
}
|
|
2500
|
-
function
|
|
2505
|
+
function Gs(n) {
|
|
2501
2506
|
let i;
|
|
2502
2507
|
return function(t) {
|
|
2503
2508
|
i && clearTimeout(i), i = setTimeout(n, 200, t);
|
|
2504
2509
|
};
|
|
2505
2510
|
}
|
|
2506
|
-
var
|
|
2507
|
-
class
|
|
2511
|
+
var Wt, qi, Bt, Ii, Gt, Oi, Rt, Ni;
|
|
2512
|
+
class Rs extends HTMLElement {
|
|
2508
2513
|
constructor() {
|
|
2509
2514
|
super();
|
|
2510
|
-
h(this, zt);
|
|
2511
2515
|
h(this, Wt);
|
|
2512
2516
|
h(this, Bt);
|
|
2513
2517
|
h(this, Gt);
|
|
2518
|
+
h(this, Rt);
|
|
2514
2519
|
this.initialize = !1;
|
|
2515
2520
|
}
|
|
2516
2521
|
static get observedAttributes() {
|
|
@@ -2519,7 +2524,7 @@ class Gs extends HTMLElement {
|
|
|
2519
2524
|
attributeChangedCallback(t, e, s) {
|
|
2520
2525
|
}
|
|
2521
2526
|
connectedCallback() {
|
|
2522
|
-
this.initialize || (this.initialize = !0, d(this,
|
|
2527
|
+
this.initialize || (this.initialize = !0, d(this, Wt, qi).call(this));
|
|
2523
2528
|
}
|
|
2524
2529
|
play() {
|
|
2525
2530
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
|
@@ -2528,7 +2533,7 @@ class Gs extends HTMLElement {
|
|
|
2528
2533
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
|
2529
2534
|
}
|
|
2530
2535
|
}
|
|
2531
|
-
|
|
2536
|
+
Wt = new WeakSet(), qi = function() {
|
|
2532
2537
|
const t = {
|
|
2533
2538
|
direction: this.getAttribute("direction") || x.SETTINGS.direction,
|
|
2534
2539
|
// up / down / left / right
|
|
@@ -2536,7 +2541,7 @@ zt = new WeakSet(), Mi = function() {
|
|
|
2536
2541
|
// normal / alternate / endStop
|
|
2537
2542
|
duration: Number(this.getAttribute("duration")) || x.SETTINGS.duration,
|
|
2538
2543
|
// ms
|
|
2539
|
-
durationBreakpoints:
|
|
2544
|
+
durationBreakpoints: ht(this) || x.SETTINGS.durationBreakpoints,
|
|
2540
2545
|
autoplay: this.getAttribute("autoplay") || x.SETTINGS.autoplay,
|
|
2541
2546
|
// normal / alternate / endStop
|
|
2542
2547
|
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : x.SETTINGS.pauseOnMouseenter,
|
|
@@ -2545,8 +2550,8 @@ zt = new WeakSet(), Mi = function() {
|
|
|
2545
2550
|
// true / false
|
|
2546
2551
|
gap: Number(this.getAttribute("gap")) || x.SETTINGS.gap
|
|
2547
2552
|
};
|
|
2548
|
-
this.s = {}, this.s.options = t, this.s.nowDuration =
|
|
2549
|
-
},
|
|
2553
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = Be(this), Bs(this), d(this, Bt, Ii).call(this);
|
|
2554
|
+
}, Bt = new WeakSet(), Ii = function() {
|
|
2550
2555
|
const { direction: t, continual: e, gap: s } = this.s.options;
|
|
2551
2556
|
switch (t) {
|
|
2552
2557
|
case "left":
|
|
@@ -2558,8 +2563,8 @@ zt = new WeakSet(), Mi = function() {
|
|
|
2558
2563
|
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;`;
|
|
2559
2564
|
break;
|
|
2560
2565
|
}
|
|
2561
|
-
d(this,
|
|
2562
|
-
},
|
|
2566
|
+
d(this, Gt, Oi).call(this), d(this, Rt, Ni).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
|
|
2567
|
+
}, Gt = new WeakSet(), Oi = function() {
|
|
2563
2568
|
const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
|
|
2564
2569
|
let c;
|
|
2565
2570
|
function u() {
|
|
@@ -2576,22 +2581,22 @@ zt = new WeakSet(), Mi = function() {
|
|
|
2576
2581
|
break;
|
|
2577
2582
|
case "alternate":
|
|
2578
2583
|
let m = function() {
|
|
2579
|
-
let
|
|
2584
|
+
let v = [];
|
|
2580
2585
|
switch (e) {
|
|
2581
2586
|
case "top":
|
|
2582
|
-
p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), g = parseInt(t.s.nowDuration / (p * 2)) * t.s.animateEl.scrollHeight,
|
|
2587
|
+
p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), g = parseInt(t.s.nowDuration / (p * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
|
|
2583
2588
|
break;
|
|
2584
2589
|
case "right":
|
|
2585
|
-
p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), g = parseInt(t.s.nowDuration / (p * 2)) * t.s.animateEl.scrollWidth,
|
|
2590
|
+
p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), g = parseInt(t.s.nowDuration / (p * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
|
|
2586
2591
|
break;
|
|
2587
2592
|
case "bottom":
|
|
2588
|
-
p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), g = parseInt(o / (p * 2)) * t.s.animateEl.scrollHeight,
|
|
2593
|
+
p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), g = parseInt(o / (p * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
|
|
2589
2594
|
break;
|
|
2590
2595
|
case "left":
|
|
2591
|
-
p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), g = parseInt(o / (p * 2)) * t.s.animateEl.scrollWidth,
|
|
2596
|
+
p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), g = parseInt(o / (p * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
|
|
2592
2597
|
break;
|
|
2593
2598
|
}
|
|
2594
|
-
return
|
|
2599
|
+
return v;
|
|
2595
2600
|
}, p, g;
|
|
2596
2601
|
(t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${m()[0].transform}`, t.s.animateEl.animate(m(), {
|
|
2597
2602
|
duration: g,
|
|
@@ -2624,11 +2629,11 @@ zt = new WeakSet(), Mi = function() {
|
|
|
2624
2629
|
}), t.addEventListener("mouseleave", function() {
|
|
2625
2630
|
t.s.animation && r && t.s.animation.playState === "paused" && t.play();
|
|
2626
2631
|
});
|
|
2627
|
-
},
|
|
2632
|
+
}, Rt = new WeakSet(), Ni = function() {
|
|
2628
2633
|
const t = this;
|
|
2629
2634
|
function e() {
|
|
2630
2635
|
const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
|
2631
|
-
t.s.nowDuration =
|
|
2636
|
+
t.s.nowDuration = Be(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate($(t).animate1, {
|
|
2632
2637
|
duration: t.s.nowDuration,
|
|
2633
2638
|
iterations: 1 / 0
|
|
2634
2639
|
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate($(t).animate2, {
|
|
@@ -2637,15 +2642,15 @@ zt = new WeakSet(), Mi = function() {
|
|
|
2637
2642
|
iterations: 1 / 0
|
|
2638
2643
|
}), t.s.cloneAnimation.startTime = o);
|
|
2639
2644
|
}
|
|
2640
|
-
window.addEventListener("resize",
|
|
2645
|
+
window.addEventListener("resize", Gs(e));
|
|
2641
2646
|
};
|
|
2642
|
-
customElements.define("marquee-el",
|
|
2643
|
-
const
|
|
2647
|
+
customElements.define("marquee-el", Rs);
|
|
2648
|
+
const Ge = function(n, i) {
|
|
2644
2649
|
let t;
|
|
2645
2650
|
return function(e) {
|
|
2646
2651
|
t && clearTimeout(t), t = setTimeout(n, 200, e);
|
|
2647
2652
|
};
|
|
2648
|
-
},
|
|
2653
|
+
}, _ = (n, i) => {
|
|
2649
2654
|
if (lt(n)) {
|
|
2650
2655
|
n.forEach((t) => {
|
|
2651
2656
|
t.classList.add(i);
|
|
@@ -2662,22 +2667,22 @@ const Be = function(n, i) {
|
|
|
2662
2667
|
}
|
|
2663
2668
|
n.classList.remove(i);
|
|
2664
2669
|
};
|
|
2665
|
-
var
|
|
2666
|
-
class
|
|
2670
|
+
var Xt, Pi, Ft, ji, Yt, zi, et, _e, W, pt, Ut, Wi;
|
|
2671
|
+
class Re {
|
|
2667
2672
|
constructor(i) {
|
|
2668
2673
|
// 初始化
|
|
2669
|
-
h(this, Rt);
|
|
2670
|
-
// 左右箭頭事件綁定
|
|
2671
2674
|
h(this, Xt);
|
|
2672
|
-
//
|
|
2675
|
+
// 左右箭頭事件綁定
|
|
2673
2676
|
h(this, Ft);
|
|
2677
|
+
// 左右拖拉事件綁定
|
|
2678
|
+
h(this, Yt);
|
|
2674
2679
|
// 卷軸位置判斷
|
|
2675
2680
|
h(this, et);
|
|
2676
2681
|
// 隱藏按鈕判斷
|
|
2677
2682
|
h(this, W);
|
|
2678
2683
|
// 選項事件綁定
|
|
2679
|
-
h(this,
|
|
2680
|
-
this.$element = i, this.option = i.s.option.drag, d(this,
|
|
2684
|
+
h(this, Ut);
|
|
2685
|
+
this.$element = i, this.option = i.s.option.drag, d(this, Xt, Pi).call(this);
|
|
2681
2686
|
}
|
|
2682
2687
|
// 更新 active 位置
|
|
2683
2688
|
update(i) {
|
|
@@ -2691,8 +2696,8 @@ class Ge {
|
|
|
2691
2696
|
}
|
|
2692
2697
|
}
|
|
2693
2698
|
}
|
|
2694
|
-
|
|
2695
|
-
var s, o, a, r
|
|
2699
|
+
Xt = new WeakSet(), Pi = function() {
|
|
2700
|
+
var s, o, a, r;
|
|
2696
2701
|
const i = this;
|
|
2697
2702
|
if (!i.$element)
|
|
2698
2703
|
return;
|
|
@@ -2700,10 +2705,10 @@ Rt = new WeakSet(), Ni = function() {
|
|
|
2700
2705
|
let t = !1;
|
|
2701
2706
|
const e = () => {
|
|
2702
2707
|
t || (requestAnimationFrame(() => {
|
|
2703
|
-
d(this, et, _e).call(this), d(this, W,
|
|
2708
|
+
d(this, et, _e).call(this), d(this, W, pt).call(this), t = !1;
|
|
2704
2709
|
}), t = !0);
|
|
2705
2710
|
};
|
|
2706
|
-
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,
|
|
2711
|
+
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, Yt, zi).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
|
2707
2712
|
A.prepend,
|
|
2708
2713
|
`<div class="navigation">
|
|
2709
2714
|
<div class="button prev">
|
|
@@ -2713,8 +2718,10 @@ Rt = new WeakSet(), Ni = function() {
|
|
|
2713
2718
|
<div></div>
|
|
2714
2719
|
</div>
|
|
2715
2720
|
</div>`
|
|
2716
|
-
), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i,
|
|
2717
|
-
|
|
2721
|
+
), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i, Ft, ji).call(a)), d(r = i, Ut, Wi).call(r), i.update(), requestAnimationFrame(() => {
|
|
2722
|
+
d(this, et, _e).call(this), d(this, W, pt).call(this);
|
|
2723
|
+
});
|
|
2724
|
+
}, Ft = new WeakSet(), ji = function() {
|
|
2718
2725
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
|
2719
2726
|
const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
|
|
2720
2727
|
t.scrollTo({
|
|
@@ -2722,13 +2729,13 @@ Rt = new WeakSet(), Ni = function() {
|
|
|
2722
2729
|
behavior: "smooth"
|
|
2723
2730
|
}), setTimeout(() => {
|
|
2724
2731
|
var r;
|
|
2725
|
-
d(r = i, W,
|
|
2732
|
+
d(r = i, W, pt).call(r);
|
|
2726
2733
|
}, 100);
|
|
2727
2734
|
};
|
|
2728
2735
|
e.forEach((o) => {
|
|
2729
2736
|
o.removeEventListener("click", s), o.addEventListener("click", s);
|
|
2730
2737
|
});
|
|
2731
|
-
},
|
|
2738
|
+
}, Yt = new WeakSet(), zi = function() {
|
|
2732
2739
|
const { $wrapper: i } = this;
|
|
2733
2740
|
let t = !1, e = !1, s = 0, o = 0;
|
|
2734
2741
|
const a = function(p) {
|
|
@@ -2760,30 +2767,30 @@ Rt = new WeakSet(), Ni = function() {
|
|
|
2760
2767
|
});
|
|
2761
2768
|
}, et = new WeakSet(), _e = function() {
|
|
2762
2769
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
|
|
2763
|
-
e <= 0 || (
|
|
2764
|
-
}, W = new WeakSet(),
|
|
2770
|
+
e <= 0 || (_(i, "scrollable"), s == 0 ? (T(i, "scrollable"), _(t, "start"), T(t, "end")) : s + 1 >= e ? (T(i, "scrollable"), T(t, "start"), _(t, "end")) : (_(t, "center"), T(t, "start"), T(t, "end")));
|
|
2771
|
+
}, W = new WeakSet(), pt = function() {
|
|
2765
2772
|
const { $wrapper: i, $button: t, $element: e } = this;
|
|
2766
2773
|
if (!t)
|
|
2767
2774
|
return;
|
|
2768
2775
|
const s = i.scrollWidth - i.clientWidth, o = i.scrollLeft;
|
|
2769
2776
|
if (s <= 0) {
|
|
2770
|
-
|
|
2777
|
+
_(t, "hide"), T(t, "active"), _(e, "noScrollable");
|
|
2771
2778
|
return;
|
|
2772
2779
|
}
|
|
2773
|
-
s > 0 && (
|
|
2780
|
+
s > 0 && (_(t, "active"), T(e, "noScrollable")), o == 0 ? t.forEach((a) => {
|
|
2774
2781
|
if (a.classList.contains("next")) {
|
|
2775
2782
|
T(a, "hide");
|
|
2776
2783
|
return;
|
|
2777
2784
|
}
|
|
2778
|
-
|
|
2785
|
+
_(a, "hide");
|
|
2779
2786
|
}) : o + 1 >= s ? t.forEach((a) => {
|
|
2780
2787
|
if (a.classList.contains("next")) {
|
|
2781
|
-
|
|
2788
|
+
_(a, "hide");
|
|
2782
2789
|
return;
|
|
2783
2790
|
}
|
|
2784
2791
|
T(a, "hide");
|
|
2785
2792
|
}) : T(t, "hide");
|
|
2786
|
-
},
|
|
2793
|
+
}, Ut = new WeakSet(), Wi = function() {
|
|
2787
2794
|
const { $element: i } = this, t = (s) => {
|
|
2788
2795
|
if (this.option.selected) {
|
|
2789
2796
|
const o = s.getAttribute("data-option").trim();
|
|
@@ -2797,31 +2804,31 @@ Rt = new WeakSet(), Ni = function() {
|
|
|
2797
2804
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
|
2798
2805
|
});
|
|
2799
2806
|
};
|
|
2800
|
-
var
|
|
2801
|
-
class
|
|
2807
|
+
var Jt, Bi, Zt, Gi, Qt, Ri, Vt, Xi;
|
|
2808
|
+
class Xs {
|
|
2802
2809
|
constructor(i) {
|
|
2803
2810
|
// 初始化
|
|
2804
|
-
h(this, Ut);
|
|
2805
|
-
// 隱藏按鈕判斷
|
|
2806
2811
|
h(this, Jt);
|
|
2807
|
-
//
|
|
2812
|
+
// 隱藏按鈕判斷
|
|
2808
2813
|
h(this, Zt);
|
|
2809
|
-
//
|
|
2814
|
+
// 展開箭頭事件綁定
|
|
2810
2815
|
h(this, Qt);
|
|
2811
|
-
|
|
2816
|
+
// 選項事件綁定
|
|
2817
|
+
h(this, Vt);
|
|
2818
|
+
this.$element = i, this.option = i.s.option.collapse, d(this, Jt, Bi).call(this);
|
|
2812
2819
|
}
|
|
2813
2820
|
}
|
|
2814
|
-
|
|
2815
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this,
|
|
2816
|
-
}, Jt = new WeakSet(), Bi = function() {
|
|
2817
|
-
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
|
2818
|
-
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(A.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), T(this.$element, "noScrollable"), !0) : (k(this.$element, "noScrollable"), !1);
|
|
2821
|
+
Jt = new WeakSet(), Bi = function() {
|
|
2822
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, Zt, Gi).call(this) && d(this, Qt, Ri).call(this), d(this, Vt, Xi).call(this));
|
|
2819
2823
|
}, Zt = new WeakSet(), Gi = function() {
|
|
2824
|
+
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
|
2825
|
+
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(A.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), T(this.$element, "noScrollable"), !0) : (_(this.$element, "noScrollable"), !1);
|
|
2826
|
+
}, Qt = new WeakSet(), Ri = function() {
|
|
2820
2827
|
const { $element: i, $button: t } = this, e = function() {
|
|
2821
2828
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
|
2822
2829
|
};
|
|
2823
2830
|
t.removeEventListener("click", e), t.addEventListener("click", e);
|
|
2824
|
-
},
|
|
2831
|
+
}, Vt = new WeakSet(), Xi = function() {
|
|
2825
2832
|
const { $element: i } = this, t = (s, o) => {
|
|
2826
2833
|
if (i != null && i.classList.contains("expand") ? i == null || i.classList.remove("expand") : i == null || i.classList.add("expand"), this.option.selected) {
|
|
2827
2834
|
const a = s.getAttribute("data-option").trim();
|
|
@@ -2835,16 +2842,16 @@ Ut = new WeakSet(), Wi = function() {
|
|
|
2835
2842
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
|
2836
2843
|
});
|
|
2837
2844
|
};
|
|
2838
|
-
const
|
|
2845
|
+
const Fs = (n) => {
|
|
2839
2846
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
|
2840
2847
|
return i == "drag" && (s.innerHTML = H.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(A.append, e)), i == "collapse" && (s.innerHTML = H.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(A.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(A.append, e)), i == "dropdown" && (s.innerHTML = H.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(A.append, e)), s.children;
|
|
2841
2848
|
};
|
|
2842
|
-
var
|
|
2843
|
-
class
|
|
2849
|
+
var Kt, Fi, te, Yi, it, $e, B, mt;
|
|
2850
|
+
class Ys extends HTMLElement {
|
|
2844
2851
|
constructor() {
|
|
2845
2852
|
super();
|
|
2846
|
-
h(this, Vt);
|
|
2847
2853
|
h(this, Kt);
|
|
2854
|
+
h(this, te);
|
|
2848
2855
|
// 斷點設定
|
|
2849
2856
|
h(this, it);
|
|
2850
2857
|
// check type
|
|
@@ -2860,7 +2867,7 @@ class Fs extends HTMLElement {
|
|
|
2860
2867
|
case "m4-type":
|
|
2861
2868
|
if (e === null || e === s)
|
|
2862
2869
|
return;
|
|
2863
|
-
this.s.type = s, d(this, B,
|
|
2870
|
+
this.s.type = s, d(this, B, mt).call(this);
|
|
2864
2871
|
break;
|
|
2865
2872
|
case "m4-status":
|
|
2866
2873
|
if (e === s)
|
|
@@ -2877,13 +2884,13 @@ class Fs extends HTMLElement {
|
|
|
2877
2884
|
}
|
|
2878
2885
|
}
|
|
2879
2886
|
connectedCallback() {
|
|
2880
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this,
|
|
2887
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, Kt, Fi).call(this));
|
|
2881
2888
|
}
|
|
2882
2889
|
update() {
|
|
2883
|
-
d(this, it,
|
|
2890
|
+
d(this, it, $e).call(this);
|
|
2884
2891
|
}
|
|
2885
2892
|
}
|
|
2886
|
-
|
|
2893
|
+
Kt = new WeakSet(), Fi = function() {
|
|
2887
2894
|
let t = {};
|
|
2888
2895
|
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? H.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
|
2889
2896
|
const e = (s) => {
|
|
@@ -2894,84 +2901,84 @@ Vt = new WeakSet(), Xi = function() {
|
|
|
2894
2901
|
}
|
|
2895
2902
|
this.update();
|
|
2896
2903
|
};
|
|
2897
|
-
window.removeEventListener("resize",
|
|
2898
|
-
},
|
|
2899
|
-
this.classList.add("m4-init"), d(this, it,
|
|
2900
|
-
}, it = new WeakSet(),
|
|
2904
|
+
window.removeEventListener("resize", Ge(e)), window.addEventListener("resize", Ge(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, H.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, H.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, H.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, H.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, te, Yi).call(this);
|
|
2905
|
+
}, te = new WeakSet(), Yi = function() {
|
|
2906
|
+
this.classList.add("m4-init"), d(this, it, $e).call(this);
|
|
2907
|
+
}, it = new WeakSet(), $e = function() {
|
|
2901
2908
|
const t = Object.keys(this.s.option.breakpoint);
|
|
2902
2909
|
if (!t.length) {
|
|
2903
|
-
d(this, B,
|
|
2910
|
+
d(this, B, mt).call(this);
|
|
2904
2911
|
return;
|
|
2905
2912
|
}
|
|
2906
2913
|
t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
|
|
2907
2914
|
var s, o, a, r;
|
|
2908
|
-
return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this, B,
|
|
2915
|
+
return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this, B, mt).call(this), window.innerWidth >= e;
|
|
2909
2916
|
});
|
|
2910
|
-
}, B = new WeakSet(),
|
|
2917
|
+
}, B = new WeakSet(), mt = function() {
|
|
2911
2918
|
var o;
|
|
2912
2919
|
const { type: t } = this.s;
|
|
2913
|
-
this.innerHTML = "", [...
|
|
2920
|
+
this.innerHTML = "", [...Fs(this)].forEach((a) => {
|
|
2914
2921
|
this.append(a);
|
|
2915
2922
|
});
|
|
2916
2923
|
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")}"]`);
|
|
2917
2924
|
switch (e == null || e.classList.add("active"), s == null || s.classList.add("active"), t) {
|
|
2918
2925
|
case "drag":
|
|
2919
|
-
|
|
2926
|
+
this.drag = new Re(this);
|
|
2920
2927
|
break;
|
|
2921
2928
|
case "collapse":
|
|
2922
|
-
this.drag = new
|
|
2929
|
+
this.drag = new Re(this), this.collapse = new Xs(this);
|
|
2923
2930
|
break;
|
|
2924
2931
|
}
|
|
2925
2932
|
(o = this.drag) == null || o.update();
|
|
2926
2933
|
};
|
|
2927
|
-
customElements.define("multipurpose-nav",
|
|
2928
|
-
var
|
|
2929
|
-
class
|
|
2934
|
+
customElements.define("multipurpose-nav", Ys);
|
|
2935
|
+
var ee, Ji, ie, Zi, st, xe, P, F, se, Qi, ne, Vi, oe, Ki, ae, ts, re, es, le, is, ce, ss, de, ns, ue, os, q, z, he, as, pe, rs, me, ls, ge, cs;
|
|
2936
|
+
class Ui extends HTMLElement {
|
|
2930
2937
|
// 定義組件的初始狀態
|
|
2931
2938
|
constructor(t, e) {
|
|
2932
2939
|
super();
|
|
2933
|
-
h(this, te);
|
|
2934
2940
|
h(this, ee);
|
|
2941
|
+
h(this, ie);
|
|
2935
2942
|
// 第一關 判斷數量以及id設定
|
|
2936
2943
|
h(this, st);
|
|
2937
2944
|
// 第二關 id命名提醒
|
|
2938
2945
|
h(this, P);
|
|
2939
|
-
h(this, ie);
|
|
2940
2946
|
h(this, se);
|
|
2941
2947
|
h(this, ne);
|
|
2948
|
+
h(this, oe);
|
|
2942
2949
|
// 執行函式
|
|
2943
2950
|
// 移動至指定位置
|
|
2944
|
-
h(this, oe);
|
|
2945
|
-
// 移動
|
|
2946
2951
|
h(this, ae);
|
|
2947
|
-
//
|
|
2952
|
+
// 移動
|
|
2948
2953
|
h(this, re);
|
|
2949
|
-
//
|
|
2954
|
+
// 步驟狀態
|
|
2950
2955
|
h(this, le);
|
|
2951
|
-
//
|
|
2956
|
+
// next 按鈕狀態
|
|
2952
2957
|
h(this, ce);
|
|
2953
|
-
//
|
|
2958
|
+
// prev 按鈕狀態
|
|
2954
2959
|
h(this, de);
|
|
2960
|
+
// 頁籤狀態
|
|
2961
|
+
h(this, ue);
|
|
2955
2962
|
// 第三關各種元件判斷 及 執行
|
|
2956
2963
|
h(this, q);
|
|
2957
2964
|
// 消失動畫
|
|
2958
|
-
h(this, ue);
|
|
2959
|
-
// 出現動畫
|
|
2960
2965
|
h(this, he);
|
|
2961
|
-
//
|
|
2966
|
+
// 出現動畫
|
|
2962
2967
|
h(this, pe);
|
|
2963
|
-
//
|
|
2968
|
+
// 狀態
|
|
2964
2969
|
h(this, me);
|
|
2970
|
+
// resize
|
|
2971
|
+
h(this, ge);
|
|
2965
2972
|
}
|
|
2966
2973
|
// 當組件的屬性被更改時會被呼叫
|
|
2967
2974
|
static get observedAttributes() {
|
|
2968
2975
|
return ["t4-active"];
|
|
2969
2976
|
}
|
|
2970
2977
|
attributeChangedCallback(t, e, s) {
|
|
2971
|
-
t === "t4-active" && e !== s && d(this,
|
|
2978
|
+
t === "t4-active" && e !== s && d(this, me, ls).call(this, s);
|
|
2972
2979
|
}
|
|
2973
2980
|
connectedCallback() {
|
|
2974
|
-
this.classList.contains("t4-initialize") || d(this,
|
|
2981
|
+
this.classList.contains("t4-initialize") || d(this, ee, Ji).call(this);
|
|
2975
2982
|
}
|
|
2976
2983
|
// ------------- 我是分隔線呦 -------------
|
|
2977
2984
|
// 頁籤切換
|
|
@@ -2987,7 +2994,7 @@ class Yi extends HTMLElement {
|
|
|
2987
2994
|
e.activeTab = s, this.setAttribute("t4-active", s);
|
|
2988
2995
|
const o = d(this, P, F).call(this, s);
|
|
2989
2996
|
e.tabPanels.forEach((a, r) => {
|
|
2990
|
-
r === o ? d(this,
|
|
2997
|
+
r === o ? d(this, pe, rs).call(this, r) : d(this, he, as).call(this, r);
|
|
2991
2998
|
});
|
|
2992
2999
|
}
|
|
2993
3000
|
// 外部呼叫方法 $0.goNext()
|
|
@@ -3002,11 +3009,11 @@ class Yi extends HTMLElement {
|
|
|
3002
3009
|
}
|
|
3003
3010
|
// 外部呼叫方法 $0.update()
|
|
3004
3011
|
update() {
|
|
3005
|
-
this.t.tabs = d(this, st,
|
|
3012
|
+
this.t.tabs = d(this, st, xe).call(this), ds(), console.log("tab update!!!!");
|
|
3006
3013
|
}
|
|
3007
3014
|
}
|
|
3008
|
-
|
|
3009
|
-
const t = this.getAttribute("t4-name"), { SETTINGS: e } =
|
|
3015
|
+
ee = new WeakSet(), Ji = function() {
|
|
3016
|
+
const t = this.getAttribute("t4-name"), { SETTINGS: e } = Je;
|
|
3010
3017
|
document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
|
|
3011
3018
|
tabs: [],
|
|
3012
3019
|
name: t,
|
|
@@ -3025,14 +3032,14 @@ te = new WeakSet(), Ui = function() {
|
|
|
3025
3032
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
|
3026
3033
|
},
|
|
3027
3034
|
tabGroup: this.getAttribute("t4-group") || e.tabGroup
|
|
3028
|
-
}, this.__events__ = {}, this.t.tabs = d(this, st,
|
|
3029
|
-
},
|
|
3030
|
-
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this,
|
|
3035
|
+
}, this.__events__ = {}, this.t.tabs = d(this, st, xe).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, ie, Zi).call(this);
|
|
3036
|
+
}, ie = new WeakSet(), Zi = function() {
|
|
3037
|
+
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, se, Qi).call(this), this.t.recordUrl) {
|
|
3031
3038
|
const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
|
|
3032
3039
|
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
|
3033
3040
|
}
|
|
3034
|
-
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this,
|
|
3035
|
-
}, st = new WeakSet(),
|
|
3041
|
+
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, ge, cs).call(this);
|
|
3042
|
+
}, st = new WeakSet(), xe = function() {
|
|
3036
3043
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
|
3037
3044
|
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) => {
|
|
3038
3045
|
s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
|
|
@@ -3042,19 +3049,19 @@ te = new WeakSet(), Ui = function() {
|
|
|
3042
3049
|
s.length > 1 && console.warn("有兩個相同id設定", s);
|
|
3043
3050
|
const o = s[0];
|
|
3044
3051
|
return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
|
|
3045
|
-
},
|
|
3052
|
+
}, se = new WeakSet(), Qi = function() {
|
|
3046
3053
|
const t = document.createElement("div");
|
|
3047
3054
|
t.classList.add("swiper-container");
|
|
3048
3055
|
const e = document.createElement("div");
|
|
3049
3056
|
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
|
|
3050
3057
|
e.appendChild(s.cloneNode(!0));
|
|
3051
|
-
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this,
|
|
3052
|
-
},
|
|
3058
|
+
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, ne, Vi).call(this);
|
|
3059
|
+
}, ne = new WeakSet(), Vi = function() {
|
|
3053
3060
|
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
|
|
3054
3061
|
t.style.overflow = "hidden", e.style.display = "flex";
|
|
3055
3062
|
const o = s.length * 100 + "%";
|
|
3056
3063
|
e.style.width = o;
|
|
3057
|
-
},
|
|
3064
|
+
}, oe = new WeakSet(), Ki = function(t) {
|
|
3058
3065
|
const { t: e } = this;
|
|
3059
3066
|
if (e.recordUrl === "true") {
|
|
3060
3067
|
const s = new URLSearchParams(document.location.search);
|
|
@@ -3062,28 +3069,28 @@ te = new WeakSet(), Ui = function() {
|
|
|
3062
3069
|
const o = `${window.location.pathname}?${s.toString()}`;
|
|
3063
3070
|
history.replaceState({ t4Id: t }, "", o);
|
|
3064
3071
|
}
|
|
3065
|
-
},
|
|
3072
|
+
}, ae = new WeakSet(), ts = function() {
|
|
3066
3073
|
const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
|
|
3067
|
-
d(this,
|
|
3068
|
-
},
|
|
3074
|
+
d(this, re, es).call(this, o);
|
|
3075
|
+
}, re = new WeakSet(), es = function(t) {
|
|
3069
3076
|
window.scrollTo({
|
|
3070
3077
|
top: t,
|
|
3071
3078
|
behavior: "smooth"
|
|
3072
3079
|
});
|
|
3073
|
-
},
|
|
3080
|
+
}, le = new WeakSet(), is = function(t) {
|
|
3074
3081
|
let e = parseInt(t, 10) + 1;
|
|
3075
3082
|
this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
|
|
3076
|
-
},
|
|
3083
|
+
}, ce = new WeakSet(), ss = function(t) {
|
|
3077
3084
|
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;
|
|
3078
3085
|
e.forEach((a) => {
|
|
3079
3086
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
|
3080
3087
|
});
|
|
3081
|
-
},
|
|
3088
|
+
}, de = new WeakSet(), ns = function(t) {
|
|
3082
3089
|
const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === 0;
|
|
3083
3090
|
e.forEach((a) => {
|
|
3084
3091
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
|
3085
3092
|
});
|
|
3086
|
-
},
|
|
3093
|
+
}, ue = new WeakSet(), os = function(t, e) {
|
|
3087
3094
|
this.t.tabGroup === "true" ? this.t.tabs.forEach((s, o) => {
|
|
3088
3095
|
o == t ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
|
|
3089
3096
|
}) : this.t.tabs.forEach((s, o) => {
|
|
@@ -3092,25 +3099,25 @@ te = new WeakSet(), Ui = function() {
|
|
|
3092
3099
|
}, q = new WeakSet(), z = function(t, e, s) {
|
|
3093
3100
|
switch (t) {
|
|
3094
3101
|
case "step":
|
|
3095
|
-
|
|
3102
|
+
Te(this.t.step) && d(this, le, is).call(this, e);
|
|
3096
3103
|
break;
|
|
3097
3104
|
case "eventAnchor":
|
|
3098
|
-
this.t.anchor && d(this,
|
|
3105
|
+
this.t.anchor && d(this, ae, ts).call(this);
|
|
3099
3106
|
break;
|
|
3100
3107
|
case "tabState":
|
|
3101
|
-
this.t.type == "normal" && d(this,
|
|
3108
|
+
this.t.type == "normal" && d(this, ue, os).call(this, e, s);
|
|
3102
3109
|
break;
|
|
3103
3110
|
case "btnState":
|
|
3104
|
-
d(this,
|
|
3111
|
+
d(this, ce, ss).call(this, e), d(this, de, ns).call(this, e);
|
|
3105
3112
|
break;
|
|
3106
3113
|
case "tabUrl":
|
|
3107
|
-
this.t.recordUrl === "true" && d(this,
|
|
3114
|
+
this.t.recordUrl === "true" && d(this, oe, Ki).call(this, e);
|
|
3108
3115
|
break;
|
|
3109
3116
|
default:
|
|
3110
3117
|
console.warn("請增加判斷,謝謝");
|
|
3111
3118
|
break;
|
|
3112
3119
|
}
|
|
3113
|
-
},
|
|
3120
|
+
}, he = new WeakSet(), as = function(t) {
|
|
3114
3121
|
const { t: e } = this;
|
|
3115
3122
|
this.t.transition;
|
|
3116
3123
|
const s = e.tabPanels[t];
|
|
@@ -3127,7 +3134,7 @@ te = new WeakSet(), Ui = function() {
|
|
|
3127
3134
|
s.style.display = "none";
|
|
3128
3135
|
break;
|
|
3129
3136
|
}
|
|
3130
|
-
},
|
|
3137
|
+
}, pe = new WeakSet(), rs = function(t) {
|
|
3131
3138
|
const { duration: e, timing: s, delay: o } = this.t.transition, a = this.t.tabPanels[t];
|
|
3132
3139
|
let r;
|
|
3133
3140
|
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) {
|
|
@@ -3152,25 +3159,25 @@ te = new WeakSet(), Ui = function() {
|
|
|
3152
3159
|
console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
|
|
3153
3160
|
break;
|
|
3154
3161
|
}
|
|
3155
|
-
},
|
|
3162
|
+
}, me = new WeakSet(), ls = function(t) {
|
|
3156
3163
|
const e = d(this, P, F).call(this, t);
|
|
3157
3164
|
d(this, q, z).call(this, "step", e), d(this, q, z).call(this, "btnState", e), d(this, q, z).call(this, "tabState", e, t), d(this, q, z).call(this, "tabUrl", t), this.emit("change");
|
|
3158
|
-
},
|
|
3165
|
+
}, ge = new WeakSet(), cs = function() {
|
|
3159
3166
|
const t = this;
|
|
3160
3167
|
window.addEventListener(
|
|
3161
3168
|
"resize",
|
|
3162
|
-
|
|
3169
|
+
Us(() => {
|
|
3163
3170
|
t.update();
|
|
3164
3171
|
}, 1e3)
|
|
3165
3172
|
);
|
|
3166
3173
|
};
|
|
3167
|
-
function
|
|
3174
|
+
function Us(n, i = 1e3) {
|
|
3168
3175
|
let t;
|
|
3169
3176
|
return function(e) {
|
|
3170
3177
|
t && clearTimeout(t), t = setTimeout(n, i, e);
|
|
3171
3178
|
};
|
|
3172
3179
|
}
|
|
3173
|
-
function
|
|
3180
|
+
function ds() {
|
|
3174
3181
|
const n = document.querySelectorAll("[t4-control]");
|
|
3175
3182
|
document.addEventListener("click", function(i) {
|
|
3176
3183
|
let t = !1;
|
|
@@ -3200,91 +3207,91 @@ function cs() {
|
|
|
3200
3207
|
}
|
|
3201
3208
|
});
|
|
3202
3209
|
}
|
|
3203
|
-
|
|
3204
|
-
Object.assign(
|
|
3205
|
-
customElements.define("tab-el",
|
|
3206
|
-
const
|
|
3210
|
+
ds();
|
|
3211
|
+
Object.assign(Ui.prototype, O);
|
|
3212
|
+
customElements.define("tab-el", Ui);
|
|
3213
|
+
const Xe = (n) => {
|
|
3207
3214
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e);
|
|
3208
3215
|
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";
|
|
3209
|
-
},
|
|
3216
|
+
}, Js = (n) => {
|
|
3210
3217
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
|
|
3211
3218
|
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";
|
|
3212
3219
|
};
|
|
3213
|
-
var nt,
|
|
3214
|
-
class
|
|
3220
|
+
var nt, Ce, fe, us, ve, hs, ot, He;
|
|
3221
|
+
class Zs {
|
|
3215
3222
|
constructor(i, t = {}) {
|
|
3216
3223
|
h(this, nt);
|
|
3217
|
-
h(this, ge);
|
|
3218
3224
|
h(this, fe);
|
|
3225
|
+
h(this, ve);
|
|
3219
3226
|
h(this, ot);
|
|
3220
|
-
!rt(i) && !
|
|
3227
|
+
!rt(i) && !Te(i) && !lt(i) && !w(i) || (this.__storage__ = {
|
|
3221
3228
|
el: i,
|
|
3222
3229
|
options: t
|
|
3223
|
-
}, this.active = "data-collapse-active", d(this, nt,
|
|
3230
|
+
}, this.active = "data-collapse-active", d(this, nt, Ce).call(this));
|
|
3224
3231
|
}
|
|
3225
3232
|
update() {
|
|
3226
|
-
d(this, nt,
|
|
3233
|
+
d(this, nt, Ce).call(this);
|
|
3227
3234
|
}
|
|
3228
3235
|
}
|
|
3229
|
-
nt = new WeakSet(),
|
|
3230
|
-
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } =
|
|
3236
|
+
nt = new WeakSet(), Ce = function() {
|
|
3237
|
+
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Ze;
|
|
3231
3238
|
if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
3232
3239
|
for (const [o, a] of Object.entries(this.options.on))
|
|
3233
3240
|
this.__events__[o] = [a];
|
|
3234
|
-
d(this,
|
|
3235
|
-
},
|
|
3241
|
+
d(this, fe, us).call(this);
|
|
3242
|
+
}, fe = new WeakSet(), us = function() {
|
|
3236
3243
|
const { elements: i, options: t } = this;
|
|
3237
3244
|
i.forEach((e) => {
|
|
3238
|
-
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,
|
|
3245
|
+
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this, ve, hs).call(this, e);
|
|
3239
3246
|
}), this.emit("init");
|
|
3240
|
-
},
|
|
3247
|
+
}, ve = new WeakSet(), hs = function(i) {
|
|
3241
3248
|
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
|
|
3242
|
-
if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this, ot,
|
|
3249
|
+
if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this, ot, He)), c.addEventListener("click", d(this, ot, He)), r) {
|
|
3243
3250
|
const p = (g) => {
|
|
3244
3251
|
g.stopPropagation();
|
|
3245
3252
|
};
|
|
3246
3253
|
u.removeEventListener("click", p), u.addEventListener("click", p);
|
|
3247
3254
|
}
|
|
3248
|
-
}, ot = new WeakSet(),
|
|
3255
|
+
}, ot = new WeakSet(), He = function() {
|
|
3249
3256
|
const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
|
|
3250
3257
|
r.classList.contains(e) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
|
|
3251
|
-
|
|
3252
|
-
}),
|
|
3258
|
+
Xe(l);
|
|
3259
|
+
}), Js(r)) : Xe(r), i.emit("afterCollapse");
|
|
3253
3260
|
};
|
|
3254
|
-
Object.assign(
|
|
3255
|
-
function
|
|
3261
|
+
Object.assign(Zs.prototype, O);
|
|
3262
|
+
function Qs(n, i) {
|
|
3256
3263
|
const t = i, { color: e, opacity: s, duration: o } = i.s.options;
|
|
3257
3264
|
let a = document.createElement("span"), r = n.clientX - t.getBoundingClientRect().left, l = n.clientY - t.getBoundingClientRect().top;
|
|
3258
3265
|
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() {
|
|
3259
3266
|
a.remove();
|
|
3260
3267
|
}, `${o}`);
|
|
3261
3268
|
}
|
|
3262
|
-
function
|
|
3269
|
+
function ps() {
|
|
3263
3270
|
document.querySelectorAll("ripple-btn").forEach((n) => {
|
|
3264
3271
|
n.querySelector(".hover-ball"), n.style.setProperty("--r", ""), n.classList.remove("entered");
|
|
3265
3272
|
});
|
|
3266
3273
|
}
|
|
3267
|
-
document.addEventListener("click",
|
|
3268
|
-
var at,
|
|
3269
|
-
class
|
|
3274
|
+
document.addEventListener("click", ps);
|
|
3275
|
+
var at, Me, be, ms, ye, gs, we, fs;
|
|
3276
|
+
class Vs extends HTMLElement {
|
|
3270
3277
|
constructor() {
|
|
3271
3278
|
super();
|
|
3272
3279
|
h(this, at);
|
|
3273
|
-
h(this, ve);
|
|
3274
3280
|
h(this, be);
|
|
3275
3281
|
h(this, ye);
|
|
3282
|
+
h(this, we);
|
|
3276
3283
|
this.initialize = !1;
|
|
3277
3284
|
}
|
|
3278
3285
|
connectedCallback() {
|
|
3279
3286
|
const t = this;
|
|
3280
|
-
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, at,
|
|
3287
|
+
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, at, Me).call(this));
|
|
3281
3288
|
}
|
|
3282
3289
|
update() {
|
|
3283
|
-
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, at,
|
|
3290
|
+
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, at, Me).call(this);
|
|
3284
3291
|
}
|
|
3285
3292
|
}
|
|
3286
|
-
at = new WeakSet(),
|
|
3287
|
-
const { SETTINGS: t } =
|
|
3293
|
+
at = new WeakSet(), Me = function() {
|
|
3294
|
+
const { SETTINGS: t } = Qe;
|
|
3288
3295
|
this.s = {};
|
|
3289
3296
|
function e(o) {
|
|
3290
3297
|
let a = !!o;
|
|
@@ -3298,20 +3305,20 @@ at = new WeakSet(), He = function() {
|
|
|
3298
3305
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
|
3299
3306
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
|
3300
3307
|
};
|
|
3301
|
-
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this,
|
|
3302
|
-
}, ve = new WeakSet(), ps = function() {
|
|
3303
|
-
d(this, be, ms).call(this), d(this, ye, gs).call(this), this.classList.add("r4-initialize");
|
|
3308
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, be, ms).call(this);
|
|
3304
3309
|
}, be = new WeakSet(), ms = function() {
|
|
3310
|
+
d(this, ye, gs).call(this), d(this, we, fs).call(this), this.classList.add("r4-initialize");
|
|
3311
|
+
}, ye = new WeakSet(), gs = function() {
|
|
3305
3312
|
const t = this, e = document.createElement("i");
|
|
3306
3313
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
|
3307
|
-
},
|
|
3314
|
+
}, we = new WeakSet(), fs = function() {
|
|
3308
3315
|
const t = this.querySelector("i.hover-ball"), e = this;
|
|
3309
3316
|
e.addEventListener("click", function(a) {
|
|
3310
|
-
a.stopPropagation(), e.s.options.click &&
|
|
3317
|
+
a.stopPropagation(), e.s.options.click && Qs(a, e);
|
|
3311
3318
|
});
|
|
3312
3319
|
let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
|
|
3313
3320
|
e.addEventListener(s, function(a) {
|
|
3314
|
-
if (s === "touchstart" &&
|
|
3321
|
+
if (s === "touchstart" && ps(), e.s.options.hover) {
|
|
3315
3322
|
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);
|
|
3316
3323
|
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");
|
|
3317
3324
|
}
|
|
@@ -3322,8 +3329,8 @@ at = new WeakSet(), He = function() {
|
|
|
3322
3329
|
}
|
|
3323
3330
|
});
|
|
3324
3331
|
};
|
|
3325
|
-
customElements.define("ripple-btn",
|
|
3326
|
-
class
|
|
3332
|
+
customElements.define("ripple-btn", Vs);
|
|
3333
|
+
class Ks {
|
|
3327
3334
|
constructor() {
|
|
3328
3335
|
this.init();
|
|
3329
3336
|
}
|
|
@@ -3375,12 +3382,12 @@ class Vs {
|
|
|
3375
3382
|
this.init();
|
|
3376
3383
|
}
|
|
3377
3384
|
}
|
|
3378
|
-
function
|
|
3385
|
+
function Fe(n, i) {
|
|
3379
3386
|
return n ? function(t, e) {
|
|
3380
3387
|
Function(n)(t, e);
|
|
3381
3388
|
} : i;
|
|
3382
3389
|
}
|
|
3383
|
-
function
|
|
3390
|
+
function tn(n, i, t, e) {
|
|
3384
3391
|
const s = i.params, o = n.closest("[data-upload-item]").querySelector("[data-preview]");
|
|
3385
3392
|
o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(e.imgElement);
|
|
3386
3393
|
const a = n.dataset.group, r = document.querySelector(i.el).dataset.index;
|
|
@@ -3403,7 +3410,7 @@ function Ks(n, i, t, e) {
|
|
|
3403
3410
|
info: e
|
|
3404
3411
|
}, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
|
|
3405
3412
|
}
|
|
3406
|
-
function
|
|
3413
|
+
function en(n, i, t, e) {
|
|
3407
3414
|
const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
|
|
3408
3415
|
let u = 0, p = 0;
|
|
3409
3416
|
switch (s.width = t, s.height = e, n.previewSize) {
|
|
@@ -3417,14 +3424,14 @@ function tn(n, i, t, e) {
|
|
|
3417
3424
|
const g = (s.width - u) * 0.5, m = (s.height - p) * 0.5;
|
|
3418
3425
|
return o.drawImage(i, g, m, u, p), s;
|
|
3419
3426
|
}
|
|
3420
|
-
function
|
|
3427
|
+
function sn(n, i) {
|
|
3421
3428
|
return new Promise((t, e) => {
|
|
3422
3429
|
if (i) {
|
|
3423
3430
|
const s = new Image();
|
|
3424
3431
|
s.src = i, s.classList.add(n.previewSize), s.onload = () => {
|
|
3425
3432
|
let o = {
|
|
3426
3433
|
imgElement: s,
|
|
3427
|
-
originalCanvas:
|
|
3434
|
+
originalCanvas: en(n, s, s.width, s.height),
|
|
3428
3435
|
info: {
|
|
3429
3436
|
originalWidth: s.width,
|
|
3430
3437
|
originalHeight: s.height,
|
|
@@ -3437,31 +3444,31 @@ function en(n, i) {
|
|
|
3437
3444
|
t();
|
|
3438
3445
|
});
|
|
3439
3446
|
}
|
|
3440
|
-
function
|
|
3447
|
+
function nn(n, i) {
|
|
3441
3448
|
const t = Math.pow(10, i);
|
|
3442
3449
|
return Math.round(n * t) / t;
|
|
3443
3450
|
}
|
|
3444
|
-
function
|
|
3451
|
+
function on(n, i) {
|
|
3445
3452
|
let t = n.size / 1024 / 1024;
|
|
3446
|
-
return `${
|
|
3453
|
+
return `${nn(t, 2)}` <= i;
|
|
3447
3454
|
}
|
|
3448
|
-
function
|
|
3455
|
+
function an(n, i, t) {
|
|
3449
3456
|
if (n.target.files.length <= 0)
|
|
3450
3457
|
return;
|
|
3451
3458
|
const e = n.target.files[0], s = i.closest("[data-upload-item]");
|
|
3452
3459
|
let o = new FileReader();
|
|
3453
3460
|
o.onload = (a) => {
|
|
3454
3461
|
const r = e.type.split("/")[0] === "image" ? a.target.result : null;
|
|
3455
|
-
if (t.params.sizeLimit && !
|
|
3462
|
+
if (t.params.sizeLimit && !on(e, t.params.sizeLimit)) {
|
|
3456
3463
|
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);
|
|
3457
3464
|
return;
|
|
3458
3465
|
} else
|
|
3459
|
-
s.classList.remove("over-limit"), s.classList.add("uploaded"),
|
|
3460
|
-
|
|
3466
|
+
s.classList.remove("over-limit"), s.classList.add("uploaded"), sn(t.params, r).then((l) => {
|
|
3467
|
+
tn(i, t, e, l);
|
|
3461
3468
|
});
|
|
3462
3469
|
}, o.readAsDataURL(e);
|
|
3463
3470
|
}
|
|
3464
|
-
class
|
|
3471
|
+
class rn {
|
|
3465
3472
|
constructor(i, t) {
|
|
3466
3473
|
const e = this;
|
|
3467
3474
|
e.el = i, e.params = {
|
|
@@ -3489,67 +3496,67 @@ class an {
|
|
|
3489
3496
|
previewSize: e.dataset.previewSize || i.params.previewSize,
|
|
3490
3497
|
compress: e.dataset.compress || i.params.compress,
|
|
3491
3498
|
on: {
|
|
3492
|
-
changeAfter:
|
|
3493
|
-
overLimit:
|
|
3499
|
+
changeAfter: Fe(e.dataset.changeAfter, i.params.on.changeAfter),
|
|
3500
|
+
overLimit: Fe(e.dataset.overLimit, i.params.on.overLimit)
|
|
3494
3501
|
}
|
|
3495
3502
|
};
|
|
3496
3503
|
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) {
|
|
3497
|
-
|
|
3504
|
+
an(a, e, i);
|
|
3498
3505
|
});
|
|
3499
3506
|
}));
|
|
3500
3507
|
}
|
|
3501
3508
|
}
|
|
3502
3509
|
export {
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3510
|
+
Ve as A,
|
|
3511
|
+
An as B,
|
|
3512
|
+
Zs as C,
|
|
3513
|
+
$i as D,
|
|
3514
|
+
Ln as E,
|
|
3515
|
+
Sn as F,
|
|
3516
|
+
Dn as G,
|
|
3517
|
+
kn as H,
|
|
3518
|
+
Ks as I,
|
|
3512
3519
|
_n as J,
|
|
3513
|
-
|
|
3514
|
-
|
|
3520
|
+
$n as K,
|
|
3521
|
+
xn as L,
|
|
3515
3522
|
J as M,
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3523
|
+
Cn as N,
|
|
3524
|
+
Hn as O,
|
|
3525
|
+
Mn as P,
|
|
3526
|
+
qn as Q,
|
|
3527
|
+
Vs as R,
|
|
3528
|
+
In as S,
|
|
3529
|
+
Ui as T,
|
|
3530
|
+
On as U,
|
|
3531
|
+
Nn as V,
|
|
3532
|
+
Pn as W,
|
|
3533
|
+
jn as X,
|
|
3534
|
+
zn as Y,
|
|
3528
3535
|
w as a,
|
|
3529
3536
|
lt as b,
|
|
3530
|
-
|
|
3531
|
-
|
|
3537
|
+
Es as c,
|
|
3538
|
+
Ts as d,
|
|
3532
3539
|
Y as e,
|
|
3533
3540
|
A as f,
|
|
3534
3541
|
S as g,
|
|
3535
|
-
|
|
3542
|
+
fn as h,
|
|
3536
3543
|
rt as i,
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3544
|
+
hi as j,
|
|
3545
|
+
Rs as k,
|
|
3546
|
+
Ys as l,
|
|
3547
|
+
rn as m,
|
|
3548
|
+
Ms as n,
|
|
3549
|
+
Wn as o,
|
|
3550
|
+
vn as p,
|
|
3551
|
+
Ai as q,
|
|
3552
|
+
Li as r,
|
|
3553
|
+
ws as s,
|
|
3554
|
+
bn as t,
|
|
3555
|
+
yn as u,
|
|
3556
|
+
Is as v,
|
|
3557
|
+
wn as w,
|
|
3558
|
+
Hs as x,
|
|
3559
|
+
Tn as y,
|
|
3560
|
+
En as z
|
|
3554
3561
|
};
|
|
3555
3562
|
//# sourceMappingURL=image-preview-bundle.js.map
|