@xwadex/fesd 0.0.34 → 0.0.35
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/fesd-bundle.js +496 -391
- package/dist/fesd-bundle.js.map +1 -1
- package/dist/image-preview-bundle.js +896 -965
- package/dist/image-preview-bundle.js.map +1 -1
- package/dist/tools-bundle.js +180 -188
- package/dist/tools-bundle.js.map +1 -1
- package/package.json +1 -1
@@ -1,20 +1,20 @@
|
|
1
|
-
var
|
2
|
-
if (!i.has(
|
1
|
+
var fs = (n, i, t) => {
|
2
|
+
if (!i.has(n))
|
3
3
|
throw TypeError("Cannot " + t);
|
4
4
|
};
|
5
|
-
var h = (
|
6
|
-
if (i.has(
|
5
|
+
var h = (n, i, t) => {
|
6
|
+
if (i.has(n))
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
8
|
-
i instanceof WeakSet ? i.add(
|
8
|
+
i instanceof WeakSet ? i.add(n) : i.set(n, t);
|
9
9
|
};
|
10
|
-
var d = (
|
11
|
-
import { OverlayScrollbars as
|
10
|
+
var d = (n, i, t) => (fs(n, i, "access private method"), t);
|
11
|
+
import { OverlayScrollbars as Me } from "overlayscrollbars";
|
12
12
|
import v from "jquery";
|
13
13
|
import "./vendor-bundle.js";
|
14
14
|
import "validator";
|
15
15
|
import "flatpickr";
|
16
|
-
import
|
17
|
-
import { lock as
|
16
|
+
import Fe from "vanilla-lazyload";
|
17
|
+
import { lock as vs, unlock as bs } from "tua-body-scroll-lock";
|
18
18
|
const Y = {
|
19
19
|
SETTINGS: {
|
20
20
|
videoId: null,
|
@@ -51,14 +51,14 @@ const Y = {
|
|
51
51
|
TEMPLATE() {
|
52
52
|
return '<div class="player-container"><div class="player-wrapper"></div></div>';
|
53
53
|
}
|
54
|
-
},
|
54
|
+
}, ys = {
|
55
55
|
SETTINGS: {
|
56
56
|
success: null,
|
57
57
|
text: null,
|
58
58
|
className: null,
|
59
59
|
duration: 1500
|
60
60
|
}
|
61
|
-
},
|
61
|
+
}, I = {
|
62
62
|
SETTINGS: {
|
63
63
|
target: null,
|
64
64
|
route: null,
|
@@ -80,16 +80,16 @@ const Y = {
|
|
80
80
|
destroy: null,
|
81
81
|
update: null
|
82
82
|
},
|
83
|
-
TEMPLATE(
|
83
|
+
TEMPLATE(n) {
|
84
84
|
return `
|
85
85
|
<div class="modal-scroller">
|
86
|
-
<div class="modal-wrapper" ${
|
86
|
+
<div class="modal-wrapper" ${n === "destroy" ? "data-modal-destroy" : "data-modal-close"}>
|
87
87
|
<div class="modal-content" stop-propagation>
|
88
88
|
</div>
|
89
89
|
</div>
|
90
90
|
`;
|
91
91
|
}
|
92
|
-
},
|
92
|
+
}, x = {
|
93
93
|
SETTINGS: {
|
94
94
|
direction: "left",
|
95
95
|
// 方向 - top || right || bottom || left
|
@@ -108,7 +108,7 @@ const Y = {
|
|
108
108
|
gap: 30
|
109
109
|
// 跑馬燈內容之間的距離 - Number
|
110
110
|
}
|
111
|
-
},
|
111
|
+
}, qe = {
|
112
112
|
SETTINGS: {
|
113
113
|
scrollbar: {
|
114
114
|
"scrollbar-track-color": "transparent",
|
@@ -117,7 +117,7 @@ const Y = {
|
|
117
117
|
"scrollbar-radius": "10px"
|
118
118
|
}
|
119
119
|
},
|
120
|
-
TEMPLATE(
|
120
|
+
TEMPLATE(n, i, t, e) {
|
121
121
|
const o = `
|
122
122
|
<i class="${e || "dropdown-icon"}"></i>
|
123
123
|
`, a = `
|
@@ -128,7 +128,7 @@ const Y = {
|
|
128
128
|
<div class="select-display"></div>
|
129
129
|
${o}
|
130
130
|
<div class="dropdown">
|
131
|
-
${
|
131
|
+
${n ? a : ""}
|
132
132
|
<div class="dropdown-scroller">
|
133
133
|
<ul class="dropdown-list"></ul>
|
134
134
|
</div>
|
@@ -136,7 +136,7 @@ const Y = {
|
|
136
136
|
</div>`;
|
137
137
|
return t || r;
|
138
138
|
}
|
139
|
-
},
|
139
|
+
}, ws = {
|
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
|
+
}, Ye = {
|
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
|
+
}, ct = {
|
171
171
|
SETTINGS: {
|
172
172
|
target: null,
|
173
173
|
container: null,
|
@@ -212,22 +212,22 @@ const Y = {
|
|
212
212
|
</ul>
|
213
213
|
</div>`;
|
214
214
|
},
|
215
|
-
collapse(
|
215
|
+
collapse(n) {
|
216
216
|
return `<div class="drag-container">
|
217
217
|
<ul class="wrapper">
|
218
218
|
</ul>
|
219
|
-
<div class="collapse-placeholder">${
|
219
|
+
<div class="collapse-placeholder">${n.placeholder}</div>
|
220
220
|
</div>
|
221
221
|
<div class="collapse-container">
|
222
222
|
<ul class="wrapper">
|
223
223
|
</ul>
|
224
224
|
</div>`;
|
225
225
|
},
|
226
|
-
dropdown(
|
227
|
-
return `<dropdown-el${
|
226
|
+
dropdown(n) {
|
227
|
+
return `<dropdown-el${n.placeholder ? ` d4-placeholder="${n.placeholder}"` : ""}${n.value ? ` d4-value="${n.value}"` : ""}></dropdown-el>`;
|
228
228
|
}
|
229
229
|
}
|
230
|
-
},
|
230
|
+
}, Ue = {
|
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
|
+
}, Je = {
|
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
|
+
}, Ze = {
|
284
284
|
SETTINGS: {
|
285
285
|
// 是否要加 hover 效果?
|
286
286
|
hover: !0,
|
@@ -295,170 +295,107 @@ const Y = {
|
|
295
295
|
// hover 毫秒 ?
|
296
296
|
speed: 600
|
297
297
|
}
|
298
|
-
},
|
298
|
+
}, mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
299
299
|
__proto__: null,
|
300
|
-
anchor4:
|
301
|
-
aost4:
|
302
|
-
article4:
|
303
|
-
collapse4:
|
304
|
-
dropdown4:
|
305
|
-
marquee4:
|
306
|
-
modal4:
|
300
|
+
anchor4: ct,
|
301
|
+
aost4: Ye,
|
302
|
+
article4: ws,
|
303
|
+
collapse4: Je,
|
304
|
+
dropdown4: qe,
|
305
|
+
marquee4: x,
|
306
|
+
modal4: I,
|
307
307
|
multipurpose4: H,
|
308
|
-
ripple4:
|
309
|
-
share4:
|
310
|
-
tab4:
|
308
|
+
ripple4: Ze,
|
309
|
+
share4: ys,
|
310
|
+
tab4: Ue,
|
311
311
|
video4: Y
|
312
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
313
|
-
const s = navigator.userAgent, i = {
|
314
|
-
// Firefox 1.0+
|
315
|
-
isFirefox: typeof InstallTrigger < "u",
|
316
|
-
// Opera 8.0+
|
317
|
-
isOpera: !!window.opr && !!opr.addons || !!window.opera || s.indexOf(" OPR/") >= 0,
|
318
|
-
// Internet Explorer 6-11
|
319
|
-
isIE: (
|
320
|
-
/*@cc_on!@*/
|
321
|
-
!!document.documentMode
|
322
|
-
),
|
323
|
-
// Edge 20+
|
324
|
-
isEdge: !document.documentMode && !!window.StyleMedia,
|
325
|
-
// Edge (based on chromium) detection
|
326
|
-
isEdgeChromium: /\sedg\//i.test(s) || /edg([ea]|ios)/i.test(s),
|
327
|
-
// Safari 3.0+ "[object HTMLElementConstructor]"
|
328
|
-
isSafari: !/chrome|crios|crmo/i.test(s) && /safari/i.test(s),
|
329
|
-
// Chrome 1 - 79
|
330
|
-
isChrome: !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime) || /chrome|crios|crmo/i.test(s)
|
331
|
-
}, t = {
|
332
|
-
// Android
|
333
|
-
isAndroid: s.indexOf("Android") > -1 || s.indexOf("Adr") > -1,
|
334
|
-
// iOS | ipad
|
335
|
-
isiOS: s.indexOf("Mac") > -1 && "ontouchend" in document
|
336
|
-
}, e = {
|
337
|
-
// window
|
338
|
-
isWindows: s.indexOf("Win") > -1,
|
339
|
-
// macos
|
340
|
-
isMacOS: s.indexOf("Mac") > -1,
|
341
|
-
// UNIX
|
342
|
-
isUNIX: s.indexOf("X11") > -1,
|
343
|
-
// Linux
|
344
|
-
isLinux: s.indexOf("Linux") > -1
|
345
|
-
};
|
346
|
-
return { browser: i, mobile: t, os: e };
|
347
|
-
}, Ls = () => {
|
348
|
-
const { browser: s } = at();
|
349
|
-
return Object.keys(s).find((i) => {
|
350
|
-
if (s[i])
|
351
|
-
return s[i];
|
352
|
-
});
|
353
|
-
}, Ss = () => {
|
354
|
-
const { mobile: s } = at();
|
355
|
-
return Object.keys(s).some((i) => {
|
356
|
-
if (s[i])
|
357
|
-
return s[i];
|
358
|
-
});
|
359
|
-
}, Ds = () => {
|
360
|
-
const { os: s } = at();
|
361
|
-
return Object.keys(s).find((i) => {
|
362
|
-
if (s[i])
|
363
|
-
return s[i];
|
364
|
-
});
|
365
|
-
}, xs = () => console.dir(at());
|
366
|
-
function mt() {
|
367
|
-
return {
|
368
|
-
init: at,
|
369
|
-
isBrowser4: Ls,
|
370
|
-
isMobile4: Ss,
|
371
|
-
isOs4: Ds,
|
372
|
-
logs: xs
|
373
|
-
};
|
374
|
-
}
|
375
|
-
const E = {
|
312
|
+
}, Symbol.toStringTag, { value: "Module" })), E = {
|
376
313
|
before: "beforebegin",
|
377
314
|
after: "afterend",
|
378
315
|
append: "beforeend",
|
379
316
|
prepend: "afterbegin"
|
380
|
-
},
|
317
|
+
}, at = (n) => typeof n == "string" && n !== "", we = (n) => n instanceof HTMLElement, rt = (n) => n instanceof NodeList, w = (n) => A(n) !== null, j = (n) => typeof n == "function", A = (n) => we(n) ? n : document.querySelector(n), L = (n) => rt(n) ? n : document.querySelectorAll(n), Ts = () => Math.random().toString(36).substr(2, 9), Es = (n) => {
|
381
318
|
const i = document.createElement("div");
|
382
|
-
return i.innerHTML =
|
383
|
-
},
|
319
|
+
return i.innerHTML = n, i.childNodes;
|
320
|
+
}, As = (n) => {
|
384
321
|
try {
|
385
|
-
JSON.parse(
|
322
|
+
JSON.parse(n);
|
386
323
|
} catch {
|
387
|
-
return
|
388
|
-
}
|
389
|
-
return JSON.parse(
|
390
|
-
}, T = (
|
391
|
-
console.warn(`[${
|
392
|
-
},
|
393
|
-
console.error(`[${
|
394
|
-
},
|
395
|
-
on(
|
324
|
+
return n;
|
325
|
+
}
|
326
|
+
return JSON.parse(n);
|
327
|
+
}, T = (n, i) => {
|
328
|
+
console.warn(`[${n} warn]: ${i}`);
|
329
|
+
}, je = (n, i) => {
|
330
|
+
console.error(`[${n} error]: ${i}`);
|
331
|
+
}, O = {
|
332
|
+
on(n, i) {
|
396
333
|
if (!j(i))
|
397
334
|
return this;
|
398
335
|
const { __events__: t } = this;
|
399
|
-
return
|
336
|
+
return n.split(" ").forEach((e) => {
|
400
337
|
t[e] || (t[e] = []), t[e].push(i);
|
401
338
|
}), this;
|
402
339
|
},
|
403
|
-
off(
|
340
|
+
off(n, i) {
|
404
341
|
const { __events__: t } = this;
|
405
|
-
return
|
406
|
-
typeof i > "u" ? t[e] = [] : t[e] && t[e].forEach((
|
407
|
-
|
342
|
+
return n.split(" ").forEach((e) => {
|
343
|
+
typeof i > "u" ? t[e] = [] : t[e] && t[e].forEach((s, o) => {
|
344
|
+
s === i && t[e].splice(o, 1);
|
408
345
|
});
|
409
346
|
}), this;
|
410
347
|
},
|
411
|
-
once(
|
348
|
+
once(n, i) {
|
412
349
|
if (!j(i))
|
413
350
|
return this;
|
414
351
|
const t = (...e) => {
|
415
|
-
this.off(
|
352
|
+
this.off(n, t), i.apply(this, e);
|
416
353
|
};
|
417
|
-
return this.on(
|
354
|
+
return this.on(n, t);
|
418
355
|
},
|
419
|
-
emit(...
|
420
|
-
const { __events__: i } = this, t =
|
421
|
-
return i[t] ? (i[t].forEach((
|
422
|
-
j(
|
356
|
+
emit(...n) {
|
357
|
+
const { __events__: i } = this, t = n[0], e = n.slice(1, n.length);
|
358
|
+
return i[t] ? (i[t].forEach((s) => {
|
359
|
+
j(s) && s.apply(this, e);
|
423
360
|
}), this) : this;
|
424
361
|
}
|
425
|
-
},
|
426
|
-
easeInOutCirc(
|
427
|
-
return (
|
362
|
+
}, Ls = {
|
363
|
+
easeInOutCirc(n, i, t, e) {
|
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;
|
428
365
|
},
|
429
|
-
easeInQuart(
|
430
|
-
return t * (
|
366
|
+
easeInQuart(n, i, t, e) {
|
367
|
+
return t * (n /= e) * n * n * n + i;
|
431
368
|
},
|
432
|
-
easeOutQuart(
|
433
|
-
return -t * ((
|
369
|
+
easeOutQuart(n, i, t, e) {
|
370
|
+
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
434
371
|
}
|
435
|
-
},
|
436
|
-
const { target: t, container: e, spacer:
|
372
|
+
}, Te = (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) ? A(e) : document.scrollingElement, f = m[u], b = w(t) ? A(t).getBoundingClientRect()[p] : 0 - f, y = w(s) ? A(s).getBoundingClientRect()[g] : 0, _ = b - a - y, G = 15;
|
437
374
|
let S = 0;
|
438
|
-
if (
|
375
|
+
if (_ === 0)
|
439
376
|
return;
|
440
|
-
const
|
441
|
-
const
|
442
|
-
i && i.emit(
|
377
|
+
const R = (X) => {
|
378
|
+
const Pe = A(t);
|
379
|
+
i && i.emit(X, Pe), !i && n.on && j(n.on[X]) && n.on[X](Pe);
|
443
380
|
};
|
444
|
-
|
445
|
-
const
|
381
|
+
R("beforeScroll");
|
382
|
+
const Ne = () => {
|
446
383
|
S += G;
|
447
|
-
const
|
448
|
-
m[u] =
|
384
|
+
const X = Ls[r](S, f, _, o);
|
385
|
+
m[u] = X, S < o && requestAnimationFrame(Ne), S >= o && R("afterScroll");
|
449
386
|
};
|
450
|
-
requestAnimationFrame(
|
387
|
+
requestAnimationFrame(Ne);
|
451
388
|
};
|
452
|
-
var J,
|
453
|
-
class
|
389
|
+
var J, Ee, mt, Ve, gt, Ke;
|
390
|
+
class Qe {
|
454
391
|
constructor(i, t = {}) {
|
455
392
|
h(this, J);
|
393
|
+
h(this, mt);
|
456
394
|
h(this, gt);
|
457
|
-
h(this, vt);
|
458
395
|
this.__storage__ = {
|
459
396
|
el: i,
|
460
397
|
options: t
|
461
|
-
}, this.active = "data-anchor-active", d(this, J,
|
398
|
+
}, this.active = "data-anchor-active", d(this, J, Ee).call(this);
|
462
399
|
}
|
463
400
|
destroy() {
|
464
401
|
const { elements: i } = this;
|
@@ -468,40 +405,40 @@ class ti {
|
|
468
405
|
}
|
469
406
|
update() {
|
470
407
|
var i;
|
471
|
-
return d(i = this.destroy(), J,
|
408
|
+
return d(i = this.destroy(), J, Ee).call(i), this.emit("afterUpdate"), this;
|
472
409
|
}
|
473
410
|
static run(i) {
|
474
|
-
const { SETTINGS: t } =
|
411
|
+
const { SETTINGS: t } = ct, e = Object.assign({}, t, i);
|
475
412
|
setTimeout(() => {
|
476
|
-
|
413
|
+
Te(e);
|
477
414
|
}, e.delay);
|
478
415
|
}
|
479
416
|
static url(i) {
|
480
|
-
const { SETTINGS: t } =
|
417
|
+
const { SETTINGS: t } = ct, { 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()}"]`);
|
481
418
|
if (!a)
|
482
419
|
return;
|
483
420
|
const r = Object.assign({}, t, i, { target: a });
|
484
421
|
setTimeout(() => {
|
485
|
-
|
422
|
+
Te(r);
|
486
423
|
}, r.delay);
|
487
424
|
}
|
488
425
|
}
|
489
|
-
J = new WeakSet(),
|
426
|
+
J = new WeakSet(), Ee = function() {
|
490
427
|
const { el: i, options: t } = this.__storage__;
|
491
|
-
if (!
|
428
|
+
if (!at(i) || !w(i))
|
492
429
|
return;
|
493
|
-
const { SETTINGS: e, EVENTS:
|
494
|
-
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.elements = L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({},
|
430
|
+
const { SETTINGS: e, EVENTS: s } = ct;
|
431
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.elements = L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
495
432
|
for (const [o, a] of Object.entries(this.options.on))
|
496
433
|
this.__events__[o] = [a];
|
497
|
-
d(this,
|
498
|
-
},
|
434
|
+
d(this, mt, Ve).call(this);
|
435
|
+
}, mt = new WeakSet(), Ve = function() {
|
499
436
|
const { elements: i, options: t } = this;
|
500
437
|
i.forEach((e) => {
|
501
|
-
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this,
|
438
|
+
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, gt, Ke), e.anchor.defaultOptions = t, e.anchor.methods = {}, e.anchor.methods.destroy = this.destroy, e.anchor.methods.update = this.update, e.addEventListener("click", e.anchor.eventHandler), e.setAttribute(this.active, "");
|
502
439
|
}), this.emit("afterInit");
|
503
|
-
},
|
504
|
-
const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor,
|
440
|
+
}, gt = new WeakSet(), Ke = function() {
|
441
|
+
const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor, s = {
|
505
442
|
target: this.getAttribute("data-anchor-target") || i.target,
|
506
443
|
container: this.getAttribute("data-anchor-container") || i.container,
|
507
444
|
spacer: this.getAttribute("data-anchor-spacer") || i.spacer,
|
@@ -513,43 +450,43 @@ J = new WeakSet(), Le = function() {
|
|
513
450
|
};
|
514
451
|
this.removeEventListener("click", t), setTimeout(() => {
|
515
452
|
this.addEventListener("click", t);
|
516
|
-
},
|
517
|
-
|
518
|
-
},
|
453
|
+
}, s.speed), setTimeout(() => {
|
454
|
+
Te(s, e);
|
455
|
+
}, s.delay);
|
519
456
|
};
|
520
|
-
Object.assign(
|
457
|
+
Object.assign(Qe.prototype, O);
|
521
458
|
window.MODALS || (window.MODALS = {});
|
522
|
-
const { MODALS: M } = window,
|
523
|
-
const { TEMPLATE: i } =
|
524
|
-
e.innerHTML = i(
|
525
|
-
const
|
459
|
+
const { MODALS: M } = window, Ss = (n) => {
|
460
|
+
const { TEMPLATE: i } = I, { childDom: t } = n, e = document.createElement("div");
|
461
|
+
e.innerHTML = i(n.getAttribute("data-modal-template-setting"));
|
462
|
+
const s = e.querySelector(".modal-content");
|
526
463
|
return [...t].forEach((o) => {
|
527
|
-
|
464
|
+
s.append(o);
|
528
465
|
}), e.children[0];
|
529
466
|
};
|
530
|
-
var
|
531
|
-
class
|
467
|
+
var ft, ei, vt, ii, bt, si, yt, ni, wt, oi;
|
468
|
+
class ti extends HTMLElement {
|
532
469
|
constructor() {
|
533
470
|
super();
|
471
|
+
h(this, ft);
|
472
|
+
h(this, vt);
|
534
473
|
h(this, bt);
|
535
474
|
h(this, yt);
|
536
475
|
h(this, wt);
|
537
|
-
h(this, Tt);
|
538
|
-
h(this, Et);
|
539
476
|
this.initialize = !1;
|
540
477
|
}
|
541
478
|
static get observedAttributes() {
|
542
479
|
return [":state"];
|
543
480
|
}
|
544
|
-
attributeChangedCallback(t, e,
|
481
|
+
attributeChangedCallback(t, e, s) {
|
545
482
|
switch (t) {
|
546
483
|
case ":state":
|
547
|
-
d(this,
|
484
|
+
d(this, wt, oi).call(this, s);
|
548
485
|
break;
|
549
486
|
}
|
550
487
|
}
|
551
488
|
connectedCallback() {
|
552
|
-
this.initialize || (this.initialize = !0, d(this,
|
489
|
+
this.initialize || (this.initialize = !0, d(this, ft, ei).call(this));
|
553
490
|
}
|
554
491
|
open() {
|
555
492
|
return this.setAttribute(":state", "open"), this;
|
@@ -561,27 +498,27 @@ class si extends HTMLElement {
|
|
561
498
|
return this.setAttribute(":state", "destroy"), this;
|
562
499
|
}
|
563
500
|
}
|
564
|
-
|
565
|
-
const { ATTRS: t } =
|
501
|
+
ft = new WeakSet(), ei = function() {
|
502
|
+
const { ATTRS: t } = I;
|
566
503
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
567
|
-
const e = this.getAttribute(t.id) ||
|
568
|
-
this.getAttribute(t.id) || (T(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), M[e] && T(`the ${t.id} "${e}" is already be used.`), M[e] = this, d(this,
|
569
|
-
},
|
570
|
-
this.childDom = this.childNodes, this.template =
|
571
|
-
},
|
504
|
+
const e = this.getAttribute(t.id) || Ts();
|
505
|
+
this.getAttribute(t.id) || (T(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), M[e] && T(`the ${t.id} "${e}" is already be used.`), M[e] = this, d(this, vt, ii).call(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);
|
508
|
+
}, bt = new WeakSet(), si = function() {
|
572
509
|
const t = this.querySelector(".modal-scroller");
|
573
|
-
this.__scroller__ =
|
510
|
+
this.__scroller__ = Me(t, {
|
574
511
|
overflowBehavior: {
|
575
512
|
x: "hidden"
|
576
513
|
},
|
577
514
|
autoUpdate: !0
|
578
|
-
}), window.modalScroll = this.__scroller__, d(this,
|
579
|
-
},
|
515
|
+
}), window.modalScroll = this.__scroller__, d(this, yt, ni).call(this);
|
516
|
+
}, yt = new WeakSet(), ni = function() {
|
580
517
|
var a, r, l;
|
581
|
-
const t = this, { ATTRS: e } =
|
582
|
-
(a = t.querySelectorAll(`[${
|
518
|
+
const t = this, { ATTRS: e } = I, { close: s, destroy: o } = e;
|
519
|
+
(a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
|
583
520
|
c.addEventListener("click", function() {
|
584
|
-
const u = this.getAttribute(
|
521
|
+
const u = this.getAttribute(s);
|
585
522
|
(u && M[u] ? M[u] : t).close();
|
586
523
|
});
|
587
524
|
}), (r = t.querySelectorAll(`[${o}]`)) == null || r.forEach((c) => {
|
@@ -592,12 +529,12 @@ bt = new WeakSet(), ni = function() {
|
|
592
529
|
}), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
|
593
530
|
c.stopPropagation();
|
594
531
|
});
|
595
|
-
},
|
532
|
+
}, wt = new WeakSet(), oi = function(t) {
|
596
533
|
const { __scroller__: e } = this;
|
597
534
|
if (t === "open") {
|
598
535
|
if (this.style.display = "block", e) {
|
599
|
-
const { viewport:
|
600
|
-
|
536
|
+
const { viewport: s } = e.elements();
|
537
|
+
s.scrollTo({
|
601
538
|
top: 0
|
602
539
|
});
|
603
540
|
}
|
@@ -609,36 +546,36 @@ bt = new WeakSet(), ni = function() {
|
|
609
546
|
if (!this.classList.contains("show"))
|
610
547
|
return;
|
611
548
|
this.classList.remove("show");
|
612
|
-
const
|
613
|
-
this.style.removeProperty("display"), this.emit("close"), this.removeEventListener("transitionend",
|
549
|
+
const s = () => {
|
550
|
+
this.style.removeProperty("display"), this.emit("close"), this.removeEventListener("transitionend", s);
|
614
551
|
};
|
615
|
-
this.addEventListener("transitionend",
|
552
|
+
this.addEventListener("transitionend", s);
|
616
553
|
}
|
617
554
|
if (t === "destroy") {
|
618
555
|
this.classList.remove("show");
|
619
|
-
const
|
620
|
-
const { ATTRS: o } =
|
556
|
+
const s = () => {
|
557
|
+
const { ATTRS: o } = I, a = this.getAttribute(o.id);
|
621
558
|
this.style.removeProperty("display"), this.emit("close"), this.remove(), this.emit("destroy"), M[a] && delete M[a];
|
622
559
|
};
|
623
|
-
this.addEventListener("transitionend",
|
560
|
+
this.addEventListener("transitionend", s);
|
624
561
|
}
|
625
562
|
};
|
626
|
-
Object.assign(
|
627
|
-
const { MODALS:
|
563
|
+
Object.assign(ti.prototype, O);
|
564
|
+
const { MODALS: Ie } = window, ai = (n, i, ...t) => {
|
628
565
|
if (!i)
|
629
566
|
return;
|
630
|
-
const e =
|
631
|
-
e && j(e) && e.apply(
|
632
|
-
},
|
633
|
-
|
634
|
-
},
|
635
|
-
const { target: t } =
|
636
|
-
e &&
|
637
|
-
},
|
638
|
-
const { target: t, action: e, on:
|
567
|
+
const e = n[i];
|
568
|
+
e && j(e) && e.apply(n, t);
|
569
|
+
}, ri = (n, ...i) => {
|
570
|
+
n && j(n) && n.apply(U, i);
|
571
|
+
}, ze = (n, i) => {
|
572
|
+
const { target: t } = n, e = Ie[t] || A(n.target);
|
573
|
+
e && li(n, i), e || Ds(n, i);
|
574
|
+
}, li = (n, i) => {
|
575
|
+
const { target: t, action: e, on: s, e: o } = n, a = Ie[t] || A(n.target);
|
639
576
|
switch (["open", "close", "destroy"].forEach((l) => {
|
640
577
|
a.once(l, () => {
|
641
|
-
i && (i.emit(l, a, o),
|
578
|
+
i && (i.emit(l, a, o), ai(i, s[l], a, o)), i || ri(s[l], a);
|
642
579
|
});
|
643
580
|
}), e) {
|
644
581
|
case "open":
|
@@ -655,34 +592,34 @@ const { MODALS: Pe } = window, ci = (s, i, ...t) => {
|
|
655
592
|
l === "close" && a.open(), l === "open" && a.close();
|
656
593
|
break;
|
657
594
|
}
|
658
|
-
},
|
659
|
-
const { target: t, route: e, container:
|
595
|
+
}, Ds = async (n, i) => {
|
596
|
+
const { target: t, route: e, container: s, on: o, e: a } = n;
|
660
597
|
if (!e)
|
661
598
|
return T("modal4", "cannot find target or data-modal-route is not defined");
|
662
599
|
const r = (l, ...c) => {
|
663
|
-
i && (i.emit(l, ...c),
|
600
|
+
i && (i.emit(l, ...c), ai(i, o[l], ...c)), i || ri(o[l], ...c);
|
664
601
|
};
|
665
602
|
fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
|
666
|
-
const c =
|
667
|
-
[...c].forEach((
|
668
|
-
u.append(
|
603
|
+
const c = Es(l), u = A(s) || A(I.SETTINGS.container);
|
604
|
+
[...c].forEach((g) => {
|
605
|
+
u.append(g);
|
669
606
|
});
|
670
|
-
const p =
|
671
|
-
r("complete", p),
|
607
|
+
const p = Ie[t] || A(n.target);
|
608
|
+
r("complete", p), li(n, i);
|
672
609
|
}).catch((l) => {
|
673
610
|
r("error", l);
|
674
611
|
});
|
675
612
|
};
|
676
|
-
var Z,
|
613
|
+
var Z, Ae, Tt, ci, Et, di;
|
677
614
|
const N = class N {
|
678
615
|
constructor(i, t = {}) {
|
679
616
|
h(this, Z);
|
680
|
-
h(this,
|
681
|
-
h(this,
|
617
|
+
h(this, Tt);
|
618
|
+
h(this, Et);
|
682
619
|
this.__storage__ = {
|
683
620
|
el: i,
|
684
621
|
options: t
|
685
|
-
}, this.active = "data-modal-active", d(this, Z,
|
622
|
+
}, this.active = "data-modal-active", d(this, Z, Ae).call(this);
|
686
623
|
}
|
687
624
|
destroy() {
|
688
625
|
const { elements: i } = this;
|
@@ -692,38 +629,38 @@ const N = class N {
|
|
692
629
|
}
|
693
630
|
update() {
|
694
631
|
var i;
|
695
|
-
return d(i = this.destroy(), Z,
|
632
|
+
return d(i = this.destroy(), Z, Ae).call(i), this.emit("update"), this;
|
696
633
|
}
|
697
634
|
/** static method 'open' */
|
698
635
|
static open(i) {
|
699
|
-
const { SETTINGS: t } =
|
700
|
-
|
636
|
+
const { SETTINGS: t } = I, e = Object.assign({}, t, { on: {} }, i);
|
637
|
+
ze(e);
|
701
638
|
}
|
702
639
|
/** static method 'defineMethods' */
|
703
640
|
static defineMethods(i) {
|
704
641
|
N.prototype.__methods__ || (N.prototype.__methods__ = {});
|
705
642
|
const t = N.prototype.__methods__;
|
706
|
-
for (const [e,
|
707
|
-
j(
|
643
|
+
for (const [e, s] of Object.entries(i))
|
644
|
+
j(s) && (t[e] = s);
|
708
645
|
Object.assign(N.prototype, N.prototype.__methods__);
|
709
646
|
}
|
710
647
|
};
|
711
|
-
Z = new WeakSet(),
|
648
|
+
Z = new WeakSet(), Ae = function() {
|
712
649
|
const { el: i, options: t } = this.__storage__;
|
713
|
-
if (!
|
650
|
+
if (!at(i) || !w(i))
|
714
651
|
return;
|
715
|
-
const { SETTINGS: e, EVENTS:
|
716
|
-
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({},
|
652
|
+
const { SETTINGS: e, EVENTS: s } = I;
|
653
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
717
654
|
for (const [o, a] of Object.entries(this.options.on))
|
718
655
|
this.__events__[o] = [a];
|
719
|
-
d(this,
|
720
|
-
},
|
656
|
+
d(this, Tt, ci).call(this);
|
657
|
+
}, Tt = new WeakSet(), ci = function() {
|
721
658
|
const { elements: i, options: t } = this;
|
722
659
|
i.forEach((e) => {
|
723
|
-
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this,
|
660
|
+
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, Et, di), e.modal.defaultOptions = t, e.modal.methods = {}, e.modal.methods.destroy = this.destroy, e.modal.methods.update = this.update, e.addEventListener("click", e.modal.eventHandler), e.setAttribute(this.active, "");
|
724
661
|
}), this.emit("init");
|
725
|
-
},
|
726
|
-
const { defaultOptions: t, eventHandler: e, instance:
|
662
|
+
}, Et = new WeakSet(), di = function(i) {
|
663
|
+
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = As(this.getAttribute("data-modal-on"));
|
727
664
|
o && typeof o != "object" && T("modal4", "data-modal-on must be a json string.");
|
728
665
|
const a = {
|
729
666
|
target: this.getAttribute("data-modal-target") || t.target,
|
@@ -735,42 +672,42 @@ Z = new WeakSet(), Se = function() {
|
|
735
672
|
};
|
736
673
|
this.removeEventListener("click", e), setTimeout(() => {
|
737
674
|
this.addEventListener("click", e);
|
738
|
-
}, 200),
|
675
|
+
}, 200), ze(a, s);
|
739
676
|
};
|
740
677
|
let U = N;
|
741
|
-
Object.assign(U.prototype,
|
742
|
-
customElements.define("modern-modal",
|
743
|
-
const
|
744
|
-
const t =
|
745
|
-
i.forEach((
|
746
|
-
const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } =
|
747
|
-
if (p - e <= m &&
|
678
|
+
Object.assign(U.prototype, O);
|
679
|
+
customElements.define("modern-modal", ti);
|
680
|
+
const _s = (n, i) => {
|
681
|
+
const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
|
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), f = t * (l / 100);
|
684
|
+
if (p - e <= m && g - e >= f && s.offsetParent)
|
748
685
|
setTimeout(() => {
|
749
|
-
|
686
|
+
s.classList.add(o);
|
750
687
|
}, a);
|
751
688
|
else {
|
752
|
-
const y =
|
689
|
+
const y = s.classList.contains(o) && c === "down" && p - e >= m || c === "up" && g - e <= f || c === !0;
|
753
690
|
setTimeout(() => {
|
754
|
-
y &&
|
691
|
+
y && s.classList.remove(o);
|
755
692
|
}, a);
|
756
693
|
}
|
757
694
|
});
|
758
|
-
},
|
759
|
-
var Q,
|
760
|
-
class
|
695
|
+
}, ks = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
|
696
|
+
var Q, Le, At, hi;
|
697
|
+
class ui {
|
761
698
|
constructor(i, t = {}) {
|
762
699
|
h(this, Q);
|
763
|
-
h(this,
|
700
|
+
h(this, At);
|
764
701
|
this.__storage__ = {
|
765
702
|
el: i,
|
766
703
|
options: t
|
767
|
-
}, this.active = "data-aost-active", d(this, Q,
|
704
|
+
}, this.active = "data-aost-active", d(this, Q, Le).call(this);
|
768
705
|
}
|
769
706
|
destroy(i) {
|
770
707
|
const { elements: t, options: e } = this;
|
771
708
|
if (!t)
|
772
709
|
return this;
|
773
|
-
const { scroller:
|
710
|
+
const { scroller: s } = e, o = s === window || !w(s) ? window : A(s);
|
774
711
|
return o.aost && (o.removeEventListener("scroll", o.aost.eventHandler), delete o.aost), t.forEach((a) => {
|
775
712
|
if (!a.aost)
|
776
713
|
return;
|
@@ -780,56 +717,56 @@ class mi {
|
|
780
717
|
}
|
781
718
|
update(i) {
|
782
719
|
var t;
|
783
|
-
d(t = this.destroy(i), Q,
|
720
|
+
d(t = this.destroy(i), Q, Le).call(t);
|
784
721
|
}
|
785
722
|
}
|
786
|
-
Q = new WeakSet(),
|
723
|
+
Q = new WeakSet(), Le = function() {
|
787
724
|
const { el: i, options: t } = this.__storage__;
|
788
|
-
if (!
|
725
|
+
if (!at(i) || !w(i))
|
789
726
|
return;
|
790
|
-
const { SETTINGS: e, EVENTS:
|
791
|
-
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({},
|
727
|
+
const { SETTINGS: e, EVENTS: s } = Ye;
|
728
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
792
729
|
for (const [o, a] of Object.entries(this.options.on))
|
793
730
|
this.__events__[o] = [a];
|
794
|
-
d(this,
|
795
|
-
},
|
796
|
-
const { elements: i, options: t } = this, { scroller: e } = t,
|
731
|
+
d(this, At, hi).call(this);
|
732
|
+
}, At = new WeakSet(), hi = function() {
|
733
|
+
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !w(e) ? window : A(e);
|
797
734
|
this.eventHandler = () => {
|
798
|
-
|
735
|
+
_s(s, i);
|
799
736
|
}, i.forEach((a) => {
|
800
|
-
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 = ks(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, "");
|
801
738
|
});
|
802
739
|
const { eventHandler: o } = this;
|
803
|
-
o(),
|
740
|
+
o(), s.aost = {}, s.aost.eventHandler = o, s.addEventListener("scroll", s.aost.eventHandler, !1);
|
804
741
|
};
|
805
|
-
Object.assign(
|
806
|
-
const
|
807
|
-
const { TEMPLATE: i } = Y, { childDom: t } =
|
742
|
+
Object.assign(ui.prototype, O);
|
743
|
+
const $s = (n) => {
|
744
|
+
const { TEMPLATE: i } = Y, { childDom: t } = n, e = document.createElement("div");
|
808
745
|
e.innerHTML = i();
|
809
|
-
const
|
746
|
+
const s = e.querySelector(".player-wrapper");
|
810
747
|
return [...t].forEach((o) => {
|
811
|
-
|
748
|
+
s.append(o);
|
812
749
|
}), e.children[0];
|
813
750
|
};
|
814
|
-
var
|
815
|
-
class
|
751
|
+
var Lt, pi, St, mi, Dt, gi, _t, fi, kt, vi, $t, bi, xt, yi, Ct, wi, Ht, Ti;
|
752
|
+
class xs extends HTMLElement {
|
816
753
|
constructor() {
|
817
754
|
super();
|
755
|
+
h(this, Lt);
|
756
|
+
h(this, St);
|
818
757
|
h(this, Dt);
|
819
|
-
h(this, xt);
|
820
|
-
h(this, _t);
|
821
758
|
// youtube iframe
|
822
|
-
h(this,
|
759
|
+
h(this, _t);
|
823
760
|
// vimeo iframe
|
824
|
-
h(this,
|
761
|
+
h(this, kt);
|
825
762
|
// youku iframe
|
826
|
-
h(this,
|
827
|
-
h(this,
|
763
|
+
h(this, $t);
|
764
|
+
h(this, xt);
|
828
765
|
// 2025.02.11 新增 ig
|
829
|
-
h(this,
|
766
|
+
h(this, Ct);
|
830
767
|
// 2025.02.11 新增 tiktok
|
831
|
-
h(this,
|
832
|
-
d(this,
|
768
|
+
h(this, Ht);
|
769
|
+
d(this, Lt, pi).call(this);
|
833
770
|
}
|
834
771
|
play() {
|
835
772
|
const { videoType: t } = this;
|
@@ -866,82 +803,77 @@ class Ns extends HTMLElement {
|
|
866
803
|
}
|
867
804
|
}
|
868
805
|
}
|
869
|
-
|
806
|
+
Lt = new WeakSet(), pi = function() {
|
870
807
|
if (!this.getAttribute("video-id")) {
|
871
808
|
T("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
872
809
|
return;
|
873
810
|
}
|
874
|
-
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,
|
875
|
-
},
|
876
|
-
this.childDom = this.childNodes, this.template =
|
877
|
-
},
|
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, St, mi).call(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);
|
814
|
+
}, Dt = new WeakSet(), gi = function() {
|
878
815
|
const { videoType: t } = this;
|
879
816
|
let e = "";
|
880
817
|
switch (t) {
|
881
818
|
case "youtubeAPI":
|
882
819
|
break;
|
883
820
|
case "youtube":
|
884
|
-
e = d(this,
|
821
|
+
e = d(this, _t, fi).call(this);
|
885
822
|
break;
|
886
823
|
case "youkuAPI":
|
887
824
|
break;
|
888
825
|
case "youku":
|
889
|
-
e = d(this,
|
826
|
+
e = d(this, $t, bi).call(this);
|
890
827
|
break;
|
891
828
|
case "vimeo":
|
892
|
-
e = d(this,
|
829
|
+
e = d(this, kt, vi).call(this);
|
893
830
|
break;
|
894
831
|
case "bilibili":
|
895
|
-
e = d(this,
|
832
|
+
e = d(this, xt, yi).call(this);
|
896
833
|
break;
|
897
834
|
case "instagram":
|
898
|
-
e = d(this,
|
835
|
+
e = d(this, Ct, wi).call(this);
|
899
836
|
break;
|
900
837
|
case "tiktok":
|
901
|
-
e = d(this,
|
838
|
+
e = d(this, Ht, Ti).call(this);
|
902
839
|
break;
|
903
840
|
}
|
904
841
|
this.querySelector(".player-wrapper").insertAdjacentHTML(E.prepend, e);
|
905
|
-
},
|
906
|
-
const { videoId: t, autoplay: e, startTime:
|
907
|
-
return `<iframe src="https://www.youtube.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}&start=${
|
908
|
-
},
|
909
|
-
const { videoId: t, autoplay: e, hash:
|
910
|
-
return `<iframe src="https://player.vimeo.com/video/${t}?h=${
|
911
|
-
},
|
842
|
+
}, _t = new WeakSet(), fi = function() {
|
843
|
+
const { videoId: t, autoplay: e, startTime: s } = this;
|
844
|
+
return `<iframe src="https://www.youtube.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}&start=${s}&mute=1&loop=1&enablejsapi=1" frameborder="0" allowfullscreen="0" volumn="0" allow="${e === "on" ? "autoplay;" : ""} encrypted-media; gyroscope; picture-in-picture;"></iframe>`;
|
845
|
+
}, kt = new WeakSet(), vi = function() {
|
846
|
+
const { videoId: t, autoplay: e, hash: s } = this;
|
847
|
+
return `<iframe src="https://player.vimeo.com/video/${t}?h=${s}&${e === "on" ? "autoplay=1" : ""}&loop=1&color=ffffff&title=0&byline=0&portrait=0" frameborder="0" allow="${e === "on" ? "autoplay;" : ""} fullscreen; picture-in-picture" allowfullscreen></iframe><script src="https://player.vimeo.com/api/player.js"><\/script>`;
|
848
|
+
}, $t = new WeakSet(), bi = function() {
|
912
849
|
const { videoId: t, autoplay: e } = this;
|
913
850
|
return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}" frameborder=0 "allowfullscreen"></iframe>`;
|
914
|
-
},
|
851
|
+
}, xt = new WeakSet(), yi = function() {
|
915
852
|
const { videoId: t, autoplay: e } = this;
|
916
853
|
return `<iframe src="//player.bilibili.com/player.html?bvid=${t}&page=1&as_wide=1&high_quality=1&danmaku=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>`;
|
917
|
-
},
|
854
|
+
}, Ct = new WeakSet(), wi = function() {
|
918
855
|
const { videoId: t, autoplay: e } = this;
|
919
856
|
return `<iframe class="instagram-media instagram-media-rendered" id="instagram-embed-0" src="https://www.instagram.com/p/${t}/embed/" width="num-w" height=" num-h" scrolling="auto" frameborder="0" data-instgrm-payload-id="instagram-media-payload-0"></iframe>`;
|
920
|
-
},
|
857
|
+
}, Ht = new WeakSet(), Ti = function() {
|
921
858
|
const { videoId: t, autoplay: e } = this;
|
922
859
|
return `<iframe name="__tt_embed__v79271677875424740" sandbox="allow-popups allow-popups-to-escape-sandbox allow-scripts allow-top-navigation allow-same-origin" src="https://www.tiktok.com/player/v1/${t}?&${e === "on" ? "autoplay=1" : ""}"></iframe>`;
|
923
860
|
};
|
924
|
-
const
|
925
|
-
let t = setTimeout(() => (clearTimeout(t), i()),
|
861
|
+
const gn = (n) => new Promise((i) => {
|
862
|
+
let t = setTimeout(() => (clearTimeout(t), i()), n);
|
926
863
|
});
|
927
|
-
|
928
|
-
function Si(s) {
|
864
|
+
function Ei(n) {
|
929
865
|
const i = [];
|
930
|
-
|
866
|
+
n && n.forEach((t) => {
|
931
867
|
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(`${t}`));
|
932
|
-
}), v("html").addClass("scrollLock"),
|
933
|
-
xe = window.scrollY, document.body.style.position = "fixed", document.body.style.top = `-${xe}px`, document.body.style.width = "100%", document.body.style.height = "auto", document.body.style.overflow = "hidden";
|
934
|
-
}, 0);
|
868
|
+
}), v("html").addClass("scrollLock"), vs(i);
|
935
869
|
}
|
936
|
-
function
|
870
|
+
function Ai(n) {
|
937
871
|
const i = [];
|
938
|
-
|
872
|
+
n && n.forEach((t) => {
|
939
873
|
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(`${t}`));
|
940
|
-
}), v("html").removeClass("scrollLock"),
|
941
|
-
document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", document.body.style.height = "", document.body.style.overflow = "", window.scrollTo(0, xe);
|
942
|
-
}, 0);
|
874
|
+
}), v("html").removeClass("scrollLock"), bs(i);
|
943
875
|
}
|
944
|
-
async function
|
876
|
+
async function fn(n = 0) {
|
945
877
|
if (v(".loading-wrapper").length)
|
946
878
|
return;
|
947
879
|
v("body").append(`
|
@@ -954,31 +886,31 @@ async function An(s = 0) {
|
|
954
886
|
</svg>
|
955
887
|
</div>
|
956
888
|
</div>
|
957
|
-
`), v(".loading-wrapper").delay(
|
958
|
-
|
889
|
+
`), v(".loading-wrapper").delay(n).fadeIn(300).promise().done(function() {
|
890
|
+
Ei();
|
959
891
|
});
|
960
892
|
}
|
961
|
-
function
|
893
|
+
function vn() {
|
962
894
|
v(".loading-wrapper").fadeOut(300).promise().done(function() {
|
963
|
-
v(".loading-wrapper").remove(),
|
895
|
+
v(".loading-wrapper").remove(), Ai();
|
964
896
|
});
|
965
897
|
}
|
966
|
-
function
|
967
|
-
new
|
898
|
+
function bn(n, i) {
|
899
|
+
new on(n, i);
|
968
900
|
}
|
969
|
-
function
|
970
|
-
const
|
971
|
-
} }), e = new
|
972
|
-
|
901
|
+
function Cs() {
|
902
|
+
const n = document.querySelector("[data-aost]") && new ui("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new Qe("[data-anchor-target]"), t = new Fe({ callback_loaded: () => {
|
903
|
+
} }), e = new Qs();
|
904
|
+
n == null || n.update(), t.update(), e.reValidate(), i == null || i.update();
|
973
905
|
}
|
974
|
-
function
|
906
|
+
function yn(n, i = () => {
|
975
907
|
}) {
|
976
|
-
v(`[data-tab-content=${
|
908
|
+
v(`[data-tab-content=${n}]`).fadeIn(function() {
|
977
909
|
typeof i == "function" && i();
|
978
|
-
}).siblings("[data-tab-content]").hide(),
|
910
|
+
}).siblings("[data-tab-content]").hide(), Cs();
|
979
911
|
}
|
980
|
-
function
|
981
|
-
|
912
|
+
function wn() {
|
913
|
+
Me(
|
982
914
|
{
|
983
915
|
target: document.body,
|
984
916
|
cancel: {
|
@@ -1002,86 +934,86 @@ function xn() {
|
|
1002
934
|
}
|
1003
935
|
);
|
1004
936
|
}
|
1005
|
-
function
|
1006
|
-
window.onpageshow = function(
|
1007
|
-
|
937
|
+
function Tn() {
|
938
|
+
window.onpageshow = function(n) {
|
939
|
+
n.persisted && window.location.reload();
|
1008
940
|
};
|
1009
941
|
}
|
1010
|
-
function
|
1011
|
-
const
|
942
|
+
function En() {
|
943
|
+
const n = navigator.userAgent;
|
1012
944
|
return {
|
1013
|
-
BigSurUP: /Mac OS X 10.15/.test(
|
945
|
+
BigSurUP: /Mac OS X 10.15/.test(n) || /Mac OS X 10_15_7/.test(n) || /Mac OS X 10_15_8/.test(n) || /Mac OS X 10_15_9/.test(n) || /Mac OS X 11_/.test(n) || /Mac OS X 12_/.test(n)
|
1014
946
|
};
|
1015
947
|
}
|
1016
|
-
function
|
1017
|
-
v(
|
948
|
+
function An(n, i) {
|
949
|
+
v(n).on("click", function() {
|
1018
950
|
v(this).toggleClass(i);
|
1019
951
|
});
|
1020
952
|
}
|
1021
|
-
function
|
1022
|
-
v(
|
1023
|
-
v(
|
953
|
+
function Ln(n, i) {
|
954
|
+
v(n).on("click", function() {
|
955
|
+
v(n).not(this).removeClass(i), v(this).addClass(i);
|
1024
956
|
});
|
1025
957
|
}
|
1026
|
-
function
|
958
|
+
function Hs(n, i = 250) {
|
1027
959
|
let t = null;
|
1028
960
|
return function(...e) {
|
1029
|
-
let
|
961
|
+
let s = this;
|
1030
962
|
clearTimeout(t), t = setTimeout(() => {
|
1031
|
-
|
963
|
+
n.apply(s, e);
|
1032
964
|
}, i);
|
1033
965
|
};
|
1034
966
|
}
|
1035
|
-
function
|
967
|
+
function Sn(n, i = 250) {
|
1036
968
|
let t, e;
|
1037
969
|
return function() {
|
1038
|
-
const
|
970
|
+
const s = this, o = arguments, a = +/* @__PURE__ */ new Date();
|
1039
971
|
t && a < t + i ? (clearTimeout(e), e = setTimeout(function() {
|
1040
|
-
t = a,
|
1041
|
-
}, i)) : (t = a,
|
972
|
+
t = a, n.apply(s, o);
|
973
|
+
}, i)) : (t = a, n.apply(s, o));
|
1042
974
|
};
|
1043
975
|
}
|
1044
|
-
function
|
976
|
+
function Dn() {
|
1045
977
|
window._g.interval = [], v(".countdown").each((i, t) => {
|
1046
978
|
const e = Number(v(t).attr("data-seconds")) + 1;
|
1047
|
-
let
|
979
|
+
let s = Math.floor(e / 60) + ":" + e % 60;
|
1048
980
|
window._g.interval[i] = setInterval(function() {
|
1049
|
-
var o =
|
1050
|
-
--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, v(t).html(a + ":" + r),
|
981
|
+
var o = s.split(":"), a = parseInt(o[0], 10), r = parseInt(o[1], 10);
|
982
|
+
--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, v(t).html(a + ":" + r), s = a + ":" + r;
|
1051
983
|
}, 1e3);
|
1052
984
|
});
|
1053
985
|
}
|
1054
|
-
function
|
986
|
+
function _n(n = 500) {
|
1055
987
|
return new Promise((i, t) => {
|
1056
988
|
let e = setTimeout(() => {
|
1057
989
|
clearTimeout(e), i();
|
1058
|
-
},
|
990
|
+
}, n);
|
1059
991
|
});
|
1060
992
|
}
|
1061
|
-
function
|
1062
|
-
const
|
993
|
+
function kn() {
|
994
|
+
const n = function() {
|
1063
995
|
let i = window.innerHeight * 0.01;
|
1064
996
|
document.documentElement.style.setProperty("--vh", i + "px");
|
1065
997
|
};
|
1066
|
-
|
998
|
+
n(), window.addEventListener("resize", Hs(n));
|
1067
999
|
}
|
1068
|
-
function
|
1069
|
-
const o = this, r = v(
|
1000
|
+
function $n(n, i, t, e, s) {
|
1001
|
+
const o = this, r = v(n).html().split("<br>");
|
1070
1002
|
let l = "", c = 0;
|
1071
1003
|
r.forEach((u, p) => {
|
1072
|
-
p !== 0 && (l += "<br>"), u.split("").forEach((m,
|
1073
|
-
i ? (
|
1004
|
+
p !== 0 && (l += "<br>"), u.split("").forEach((m, f) => {
|
1005
|
+
i ? (f === 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++), f === 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++);
|
1074
1006
|
});
|
1075
|
-
}), v(
|
1007
|
+
}), v(n).html(l);
|
1076
1008
|
}
|
1077
|
-
function
|
1009
|
+
function xn(n, i) {
|
1078
1010
|
const t = Math.pow(10, i);
|
1079
|
-
return Math.round(
|
1011
|
+
return Math.round(n * t) / t;
|
1080
1012
|
}
|
1081
|
-
function
|
1082
|
-
let i =
|
1083
|
-
if (
|
1084
|
-
switch (
|
1013
|
+
function Cn(n) {
|
1014
|
+
let i = n.activeIndex, t = n.slides.length;
|
1015
|
+
if (n.params.loop)
|
1016
|
+
switch (n.activeIndex) {
|
1085
1017
|
case 0:
|
1086
1018
|
i = t - 3;
|
1087
1019
|
break;
|
@@ -1093,27 +1025,27 @@ function Pn(s) {
|
|
1093
1025
|
}
|
1094
1026
|
return i;
|
1095
1027
|
}
|
1096
|
-
function
|
1097
|
-
const t =
|
1098
|
-
(
|
1028
|
+
function Hn(n, i) {
|
1029
|
+
const t = n.$el, e = n.params.grid.rows, s = i || n.params.slidesPerView * e;
|
1030
|
+
(n.loopedSlides ? n.slides.length - n.loopedSlides * 2 : n.slides.length) <= s ? (t.addClass("swiper-no-swiping"), v(n.params.navigation.nextEl).hide(), v(n.params.navigation.prevEl).hide(), v(n.params.pagination.el).hide(), n.params.autoplay.enabled = !1, n.autoplay.stop()) : (t.removeClass("swiper-no-swiping"), v(n.params.navigation.nextEl).show(), v(n.params.navigation.prevEl).show(), v(n.params.pagination.el).show(), n.params.autoplay.enabled && n.autoplay.start());
|
1099
1031
|
}
|
1100
|
-
function
|
1101
|
-
|
1032
|
+
function Mn(n) {
|
1033
|
+
n.el.querySelectorAll("img.detect-shade").forEach((i) => {
|
1102
1034
|
i.addEventListener("load", function() {
|
1103
1035
|
detectShade(i);
|
1104
1036
|
});
|
1105
1037
|
});
|
1106
1038
|
}
|
1107
|
-
function
|
1108
|
-
const i =
|
1109
|
-
|
1039
|
+
function qn(n) {
|
1040
|
+
const i = n.el, t = v(i).find(".swiper-slide-active"), e = v(t).find("video").get(0), s = v(i).find(".swiper-slide video");
|
1041
|
+
n.autoplay.stop(), v(e).off("ended"), e ? (s.each((o, a) => {
|
1110
1042
|
a.currentTime = 0;
|
1111
1043
|
}), v(e).on("ended", function() {
|
1112
|
-
|
1113
|
-
}), e.play()) :
|
1044
|
+
n.slideNext();
|
1045
|
+
}), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
|
1114
1046
|
}
|
1115
|
-
function
|
1116
|
-
v(".number-grow").each(function(
|
1047
|
+
function In() {
|
1048
|
+
v(".number-grow").each(function(n, i) {
|
1117
1049
|
const t = v(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
|
1118
1050
|
let r = "";
|
1119
1051
|
for (var l = 0; l <= 9; l++)
|
@@ -1126,142 +1058,142 @@ function Bn() {
|
|
1126
1058
|
});
|
1127
1059
|
});
|
1128
1060
|
}
|
1129
|
-
function
|
1130
|
-
v(".letter-grow").each(function(
|
1131
|
-
const t = v(i),
|
1061
|
+
function On() {
|
1062
|
+
v(".letter-grow").each(function(n, i) {
|
1063
|
+
const t = v(i), s = t.attr("data-letter").split(""), o = () => {
|
1132
1064
|
let a = "";
|
1133
1065
|
for (let r = 65; r <= 90; r++)
|
1134
1066
|
a += String.fromCharCode(r) + "<br>";
|
1135
1067
|
return a;
|
1136
1068
|
};
|
1137
|
-
v(
|
1069
|
+
v(s).each(function(a, r) {
|
1138
1070
|
const l = `<div class="letter" data-final-letter="${r}"><div><br>${o()}<br>${o()}</div></div>`;
|
1139
1071
|
t.append(l);
|
1140
1072
|
});
|
1141
1073
|
});
|
1142
1074
|
}
|
1143
|
-
function
|
1144
|
-
const i = getComputedStyle(
|
1075
|
+
function Nn(n) {
|
1076
|
+
const i = getComputedStyle(n).transform;
|
1145
1077
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
1146
1078
|
return t ? parseFloat(t[1].split(", ")[12]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[4]) : 0);
|
1147
1079
|
}
|
1148
|
-
function
|
1149
|
-
const i = getComputedStyle(
|
1080
|
+
function Pn(n) {
|
1081
|
+
const i = getComputedStyle(n).transform;
|
1150
1082
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
1151
1083
|
return t ? parseFloat(t[1].split(", ")[13]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[5]) : 0);
|
1152
1084
|
}
|
1153
|
-
function
|
1085
|
+
function jn(n) {
|
1154
1086
|
const i = document.createElement("div");
|
1155
|
-
return i.innerHTML =
|
1087
|
+
return i.innerHTML = n, i.childNodes[0];
|
1156
1088
|
}
|
1157
|
-
const
|
1158
|
-
var V,
|
1159
|
-
class
|
1089
|
+
const We = (n) => n.videoId !== "" || typeof n.videoId < "u", Ms = (n) => n.$selector.getAttribute("video4-active") === "on", lt = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`;
|
1090
|
+
var V, Se, Mt, Li, qt, Si, K, De, It, Di;
|
1091
|
+
class qs {
|
1160
1092
|
constructor(i, t = {}) {
|
1161
1093
|
h(this, V);
|
1094
|
+
h(this, Mt);
|
1162
1095
|
h(this, qt);
|
1163
|
-
h(this, It);
|
1164
1096
|
h(this, K);
|
1165
|
-
h(this,
|
1166
|
-
if (!
|
1167
|
-
|
1097
|
+
h(this, It);
|
1098
|
+
if (!at(i) && !we(i) && !rt(i)) {
|
1099
|
+
je("video4", `找不到該物件 -> ${i}`);
|
1168
1100
|
return;
|
1169
1101
|
}
|
1170
1102
|
this.__storage__ = {
|
1171
1103
|
el: i,
|
1172
1104
|
options: t
|
1173
|
-
}, this.active = "data-video-active", d(this, V,
|
1105
|
+
}, this.active = "data-video-active", d(this, V, Se).call(this);
|
1174
1106
|
}
|
1175
1107
|
update() {
|
1176
|
-
d(this, V,
|
1108
|
+
d(this, V, Se).call(this);
|
1177
1109
|
}
|
1178
1110
|
}
|
1179
|
-
V = new WeakSet(),
|
1180
|
-
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS:
|
1181
|
-
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({},
|
1111
|
+
V = new WeakSet(), Se = function() {
|
1112
|
+
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Y;
|
1113
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
1182
1114
|
for (const [o, a] of Object.entries(this.options.on))
|
1183
1115
|
this.__events__[o] = [a];
|
1184
|
-
d(this,
|
1185
|
-
},
|
1116
|
+
d(this, Mt, Li).call(this);
|
1117
|
+
}, Mt = new WeakSet(), Li = function() {
|
1186
1118
|
const { elements: i, options: t } = this;
|
1187
1119
|
i.forEach((e) => {
|
1188
|
-
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this,
|
1120
|
+
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, It, Di).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), We(e.video.params) && !Ms(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, qt, Si).call(this, e)), We(e.video.params) || je("video4", "無法取得影片 ID");
|
1189
1121
|
}), this.emit("init");
|
1190
|
-
},
|
1191
|
-
const { LAYOUT: t } = Y, e = i.video.params, { $selector:
|
1122
|
+
}, qt = new WeakSet(), Si = function(i) {
|
1123
|
+
const { LAYOUT: t } = Y, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: p } = e;
|
1192
1124
|
if (l === "onBox") {
|
1193
|
-
let
|
1125
|
+
let g = null;
|
1194
1126
|
if (u === "on") {
|
1195
|
-
i.classList.add("video4-cover"),
|
1196
|
-
const m =
|
1127
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(E.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), T("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
1128
|
+
const m = s.querySelector("img");
|
1197
1129
|
m.insertAdjacentHTML(E.after, t[o]);
|
1198
|
-
const
|
1199
|
-
!
|
1130
|
+
const f = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
1131
|
+
!f && r == "youtube" ? p == "on" ? m.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !f && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !f && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
|
1200
1132
|
const y = b.thumbnail_url;
|
1201
1133
|
m.setAttribute("src", `${y}`);
|
1202
1134
|
}).catch(function(b) {
|
1203
1135
|
console.log("error");
|
1204
1136
|
}) : T("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
1205
1137
|
}
|
1206
|
-
c == "off" ?
|
1138
|
+
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || T("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, K, De), g.addEventListener("click", g.video.eventHandler);
|
1207
1139
|
} else if (l === "onPage") {
|
1208
|
-
let
|
1140
|
+
let g = null;
|
1209
1141
|
if (u == "on") {
|
1210
|
-
i.classList.add("video4-cover"),
|
1211
|
-
const m =
|
1142
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(E.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), T("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
1143
|
+
const m = s.querySelector("img");
|
1212
1144
|
m.insertAdjacentHTML(E.after, t[o]);
|
1213
|
-
const
|
1214
|
-
!
|
1145
|
+
const f = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
1146
|
+
!f && r == "youtube" ? p == "on" ? m.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !f && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !f && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
|
1215
1147
|
const y = b.thumbnail_url;
|
1216
1148
|
m.setAttribute("src", `${y}`);
|
1217
1149
|
}).catch(function(b) {
|
1218
1150
|
console.log("error");
|
1219
|
-
}) :
|
1151
|
+
}) : f || T("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || T("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
1220
1152
|
} else {
|
1221
|
-
|
1153
|
+
s.innerHTML = lt(e);
|
1222
1154
|
return;
|
1223
1155
|
}
|
1224
|
-
|
1156
|
+
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, K, De), g.addEventListener("click", g.video.eventHandler);
|
1225
1157
|
}
|
1226
|
-
}, K = new WeakSet(),
|
1227
|
-
const { video: t, emit: e } = this, { $selector:
|
1158
|
+
}, K = new WeakSet(), De = function(i) {
|
1159
|
+
const { video: t, emit: e } = this, { $selector: s, videoMode: o, videoTarget: a, videoKeep: r, videoTargetRoute: l, videoType: c, videoIgHtml: u } = t.params, p = new Fe({ callback_loaded: (g) => {
|
1228
1160
|
} });
|
1229
1161
|
if (o == "onBox") {
|
1230
|
-
const
|
1162
|
+
const g = {
|
1231
1163
|
target: a,
|
1232
1164
|
route: l,
|
1233
1165
|
on: {
|
1234
1166
|
complete(m) {
|
1235
|
-
var
|
1236
|
-
c == "instagram" ? (m.setAttribute("video-typeStyle", `${c}`), (
|
1167
|
+
var f;
|
1168
|
+
c == "instagram" ? (m.setAttribute("video-typeStyle", `${c}`), (f = window.instgrm) != null && f.Embeds ? window.instgrm.Embeds.process() : console.log("window.instgrm is undefined")) : (m.querySelector(".modal-content").insertAdjacentHTML("beforeend", lt(t.params)), m.setAttribute("video-typeStyle", `${c}`));
|
1237
1169
|
},
|
1238
1170
|
open(m) {
|
1239
|
-
const
|
1240
|
-
if (p.update(),
|
1171
|
+
const f = m.querySelectorAll("[data-overlayscrollbars-viewport]");
|
1172
|
+
if (p.update(), Ei([...f]), c == "instagram") {
|
1241
1173
|
const b = document.querySelector("[video-template] .modal-content");
|
1242
|
-
new ResizeObserver((
|
1243
|
-
|
1174
|
+
new ResizeObserver((_) => {
|
1175
|
+
_[0].contentRect.height > 50 && b.classList.add("active");
|
1244
1176
|
}).observe(b);
|
1245
1177
|
}
|
1246
1178
|
},
|
1247
1179
|
close(m) {
|
1248
|
-
const
|
1249
|
-
|
1180
|
+
const f = m.querySelectorAll("[data-overlayscrollbars-viewport]");
|
1181
|
+
Ai([...f]);
|
1250
1182
|
},
|
1251
1183
|
destroy(m) {
|
1252
1184
|
}
|
1253
1185
|
}
|
1254
1186
|
};
|
1255
|
-
U.open(
|
1187
|
+
U.open(g);
|
1256
1188
|
} else if (o == "onPage")
|
1257
1189
|
if (t.params.videoAutoplay = "on", r == "off") {
|
1258
|
-
|
1190
|
+
s.innerHTML = lt(t.params);
|
1259
1191
|
return;
|
1260
1192
|
} else {
|
1261
|
-
(
|
1193
|
+
(s.querySelector(r) ?? s).insertAdjacentHTML("beforeend", lt(t.params));
|
1262
1194
|
return;
|
1263
1195
|
}
|
1264
|
-
},
|
1196
|
+
}, It = new WeakSet(), Di = function(i) {
|
1265
1197
|
const { SETTINGS: t } = Y;
|
1266
1198
|
return {
|
1267
1199
|
$selector: i,
|
@@ -1280,9 +1212,9 @@ V = new WeakSet(), _e = function() {
|
|
1280
1212
|
videoIgHtml: i.getAttribute("video-ig") || t.videoIgHtml
|
1281
1213
|
};
|
1282
1214
|
};
|
1283
|
-
Object.assign(
|
1284
|
-
customElements.define("video-player",
|
1285
|
-
const
|
1215
|
+
Object.assign(qs.prototype, O);
|
1216
|
+
customElements.define("video-player", xs);
|
1217
|
+
const Oe = {
|
1286
1218
|
"zh-tw": {
|
1287
1219
|
臺北市: [
|
1288
1220
|
["中正區", "100"],
|
@@ -2111,10 +2043,10 @@ const je = {
|
|
2111
2043
|
["Dongyin Township", "212"]
|
2112
2044
|
]
|
2113
2045
|
}
|
2114
|
-
},
|
2115
|
-
const { TEMPLATE: i } =
|
2046
|
+
}, Is = (n) => {
|
2047
|
+
const { TEMPLATE: i } = qe, { 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");
|
2116
2048
|
e.innerHTML = i(
|
2117
|
-
|
2049
|
+
s,
|
2118
2050
|
o,
|
2119
2051
|
r,
|
2120
2052
|
a
|
@@ -2125,126 +2057,126 @@ const je = {
|
|
2125
2057
|
(!p.hasAttribute("data-option") || p.getAttribute("data-option").trim() === "") && p.setAttribute("data-option", p.textContent.trim());
|
2126
2058
|
}) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
|
2127
2059
|
}), e.children[0];
|
2128
|
-
},
|
2060
|
+
}, Os = (n) => {
|
2129
2061
|
var t;
|
2130
|
-
const i = (t =
|
2062
|
+
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
2131
2063
|
i && i.forEach((e) => {
|
2132
|
-
const
|
2133
|
-
|
2064
|
+
const s = document.querySelector(e);
|
2065
|
+
s || T("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && C(s, [...s.s.allLi].indexOf(s.s.activeLi)));
|
2134
2066
|
});
|
2135
|
-
}, C = (
|
2136
|
-
const t =
|
2067
|
+
}, C = (n, i) => {
|
2068
|
+
const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
|
2137
2069
|
if (i < 0 || i.length === 0) {
|
2138
|
-
switch (e.forEach((
|
2139
|
-
|
2140
|
-
}),
|
2070
|
+
switch (e.forEach((s) => {
|
2071
|
+
s.classList.remove("active");
|
2072
|
+
}), n.s.activeLi = void 0, n.s.selectType) {
|
2141
2073
|
case "single":
|
2142
|
-
|
2074
|
+
n.s.value = {
|
2143
2075
|
index: -1,
|
2144
2076
|
id: void 0,
|
2145
2077
|
el: void 0
|
2146
2078
|
};
|
2147
2079
|
break;
|
2148
2080
|
case "multiple":
|
2149
|
-
|
2081
|
+
n.s.value = [];
|
2150
2082
|
break;
|
2151
2083
|
}
|
2152
|
-
|
2084
|
+
n.s.selectDisplayEl.textContent = t.trim(), n.setAttribute("d4-value", "");
|
2153
2085
|
} else {
|
2154
|
-
if (
|
2155
|
-
|
2086
|
+
if (n.classList.contains("disabled")) {
|
2087
|
+
n.s.selectDisplayEl.textContent = t.trim();
|
2156
2088
|
return;
|
2157
2089
|
}
|
2158
|
-
switch (
|
2090
|
+
switch (n.s.selectType) {
|
2159
2091
|
case "single":
|
2160
|
-
const
|
2161
|
-
|
2092
|
+
const s = e[i].textContent.trim();
|
2093
|
+
n.s.allLi.forEach((r) => {
|
2162
2094
|
r.classList.remove("active");
|
2163
|
-
}), e[i].classList.add("active"),
|
2095
|
+
}), e[i].classList.add("active"), n.s.selectDisplayEl.textContent = s, n.s.activeLi = e[i], n.s.value = {
|
2164
2096
|
index: i,
|
2165
2097
|
id: e[i].getAttribute("data-option"),
|
2166
2098
|
el: e[i]
|
2167
2099
|
};
|
2168
2100
|
break;
|
2169
2101
|
case "multiple":
|
2170
|
-
Array.isArray(i) &&
|
2171
|
-
i.indexOf([...
|
2102
|
+
Array.isArray(i) && n.s.allLi.forEach((r) => {
|
2103
|
+
i.indexOf([...n.s.allLi].indexOf(r)) >= 0 ? r.classList.add("active") : r.classList.remove("active");
|
2172
2104
|
});
|
2173
|
-
const o =
|
2174
|
-
o.length <= 0 ?
|
2105
|
+
const o = n.querySelectorAll(".dropdown-list li.active");
|
2106
|
+
o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
|
2175
2107
|
const l = r.getAttribute("data-option"), c = r.textContent.trim(), u = `<div class="option-btn" data-option="${l}"><div class="text">${c}</div><div class="remove-icon"></div></div>`;
|
2176
|
-
|
2177
|
-
})),
|
2108
|
+
n.s.selectDisplayEl.insertAdjacentHTML(E.append, u);
|
2109
|
+
})), n.s.activeLi = o, n.s.value = [...o].map((r) => ({
|
2178
2110
|
index: [...e].indexOf(r),
|
2179
2111
|
id: r.getAttribute("data-option"),
|
2180
2112
|
el: r
|
2181
2113
|
}));
|
2182
2114
|
const a = [...o].map((r) => r.getAttribute("data-option"));
|
2183
|
-
|
2115
|
+
n.setAttribute("d4-value", a.join());
|
2184
2116
|
break;
|
2185
2117
|
}
|
2186
2118
|
}
|
2187
|
-
},
|
2188
|
-
const i =
|
2189
|
-
|
2119
|
+
}, Ns = (n) => {
|
2120
|
+
const i = n.s.cityLang;
|
2121
|
+
n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(Oe[i]).forEach((t) => {
|
2190
2122
|
const e = document.createElement("li");
|
2191
|
-
e.textContent = t, e.setAttribute("data-option", t),
|
2192
|
-
}),
|
2193
|
-
},
|
2194
|
-
const t =
|
2195
|
-
|
2123
|
+
e.textContent = t, e.setAttribute("data-option", t), n.s.dropdownEl.querySelector(".dropdown-list").append(e);
|
2124
|
+
}), n.s.allLi = n.querySelectorAll(".dropdown-list li"));
|
2125
|
+
}, Ps = (n, i) => {
|
2126
|
+
const t = n.s.cityLang;
|
2127
|
+
Oe[t][i].forEach((e, s) => {
|
2196
2128
|
const o = document.createElement("li");
|
2197
|
-
o.textContent = e[0], o.setAttribute("data-option", e[0]),
|
2129
|
+
o.textContent = e[0], o.setAttribute("data-option", e[0]), n.querySelector(".dropdown-list").append(o);
|
2198
2130
|
});
|
2199
|
-
},
|
2131
|
+
}, _i = () => {
|
2200
2132
|
L('dropdown-el[d4-status="open"]').forEach((i) => {
|
2201
2133
|
i.close();
|
2202
2134
|
});
|
2203
|
-
},
|
2204
|
-
const { SETTINGS:
|
2135
|
+
}, js = () => {
|
2136
|
+
const { SETTINGS: n } = qe;
|
2205
2137
|
((t, e) => {
|
2206
|
-
Object.keys(e).forEach((
|
2207
|
-
t.style.setProperty(`--${
|
2138
|
+
Object.keys(e).forEach((s) => {
|
2139
|
+
t.style.setProperty(`--${s}`, e[s]);
|
2208
2140
|
});
|
2209
|
-
})(document.documentElement,
|
2141
|
+
})(document.documentElement, n.scrollbar);
|
2210
2142
|
};
|
2211
|
-
|
2143
|
+
js();
|
2212
2144
|
document.addEventListener("click", function() {
|
2213
|
-
|
2145
|
+
_i();
|
2214
2146
|
});
|
2215
|
-
var
|
2216
|
-
class
|
2147
|
+
var Ot, $i, Nt, xi, Pt, Ci, jt, Hi;
|
2148
|
+
class ki extends HTMLElement {
|
2217
2149
|
constructor() {
|
2218
2150
|
super();
|
2151
|
+
h(this, Ot);
|
2152
|
+
h(this, Nt);
|
2219
2153
|
h(this, Pt);
|
2220
2154
|
h(this, jt);
|
2221
|
-
h(this, zt);
|
2222
|
-
h(this, Wt);
|
2223
2155
|
this.initialize = !1;
|
2224
2156
|
}
|
2225
2157
|
static get observedAttributes() {
|
2226
2158
|
return ["d4-status", "d4-placeholder", "d4-value"];
|
2227
2159
|
}
|
2228
|
-
attributeChangedCallback(t, e,
|
2160
|
+
attributeChangedCallback(t, e, s) {
|
2229
2161
|
const o = this;
|
2230
2162
|
switch (t) {
|
2231
2163
|
case "d4-status":
|
2232
|
-
if (e === null || e ===
|
2164
|
+
if (e === null || e === s)
|
2233
2165
|
return;
|
2234
|
-
(
|
2166
|
+
(s === "open" || s === "close") && o.emit(s);
|
2235
2167
|
break;
|
2236
2168
|
case "d4-value":
|
2237
|
-
if (e === null || e ===
|
2169
|
+
if (e === null || e === s)
|
2238
2170
|
return;
|
2239
|
-
if (
|
2171
|
+
if (s !== "")
|
2240
2172
|
switch (o.hasAttribute("multiple") ? "multiple" : "single") {
|
2241
2173
|
case "single":
|
2242
|
-
const r = o.querySelector(`.dropdown-list li[data-option="${
|
2174
|
+
const r = o.querySelector(`.dropdown-list li[data-option="${s}"]`);
|
2243
2175
|
w(r) ? C(o, [...o.s.allLi].indexOf(r)) : C(o, -1);
|
2244
2176
|
break;
|
2245
2177
|
case "multiple":
|
2246
2178
|
const l = [];
|
2247
|
-
o.querySelector(".dropdown-list li").classList.remove("active"),
|
2179
|
+
o.querySelector(".dropdown-list li").classList.remove("active"), s.split(",").forEach((u) => {
|
2248
2180
|
const p = o.querySelector(`.dropdown-list li[data-option="${u}"]`);
|
2249
2181
|
w(p) && (p.classList.add("active"), l.push(p));
|
2250
2182
|
});
|
@@ -2259,30 +2191,30 @@ class Ci extends HTMLElement {
|
|
2259
2191
|
case "d4-placeholder":
|
2260
2192
|
if (e === null)
|
2261
2193
|
return;
|
2262
|
-
e !==
|
2194
|
+
e !== s && o.s.value.index < 0 && C(o, o.s.value.index);
|
2263
2195
|
break;
|
2264
2196
|
}
|
2265
2197
|
}
|
2266
2198
|
connectedCallback() {
|
2267
2199
|
const t = this;
|
2268
|
-
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this,
|
2200
|
+
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, Ot, $i).call(this));
|
2269
2201
|
}
|
2270
2202
|
open() {
|
2271
|
-
const t = this, e = t.querySelector(".dropdown-scroller").clientHeight,
|
2272
|
-
return
|
2203
|
+
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;
|
2204
|
+
return _i(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.style.cssText = `--maxHeight: ${o()}px;`, t.s.dropdownEl.style.cssText = `
|
2273
2205
|
height: ${o()}px;
|
2274
2206
|
z-index: 2;
|
2275
2207
|
`, this;
|
2276
2208
|
}
|
2277
2209
|
close() {
|
2278
|
-
const t = this, e = t.s.dropdownEl.querySelectorAll(".has-sublayer"),
|
2210
|
+
const t = this, e = t.s.dropdownEl.querySelectorAll(".has-sublayer"), s = parseInt(t.getAttribute("d4-default-height"));
|
2279
2211
|
return t.setAttribute("d4-status", "close"), t.s.dropdownEl.style.height = "0px", e.forEach((o) => {
|
2280
2212
|
o.classList.remove("open");
|
2281
|
-
}), t.style.cssText = `--maxHeight: ${
|
2213
|
+
}), t.style.cssText = `--maxHeight: ${s}px;`, t.s.subDropdownTotalH = 0, this;
|
2282
2214
|
}
|
2283
2215
|
scrollTo(t) {
|
2284
|
-
const e = this, { viewport:
|
2285
|
-
|
2216
|
+
const e = this, { viewport: s } = e.__scroller__.elements();
|
2217
|
+
s.scrollTo({
|
2286
2218
|
top: t,
|
2287
2219
|
behavior: "smooth"
|
2288
2220
|
});
|
@@ -2291,14 +2223,14 @@ class Ci extends HTMLElement {
|
|
2291
2223
|
this.__events__.selectOption();
|
2292
2224
|
}
|
2293
2225
|
}
|
2294
|
-
|
2295
|
-
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this,
|
2296
|
-
},
|
2297
|
-
this.s.childDom = this.childNodes, this.s.template =
|
2298
|
-
},
|
2299
|
-
var
|
2226
|
+
Ot = new WeakSet(), $i = function() {
|
2227
|
+
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Nt, xi).call(this);
|
2228
|
+
}, Nt = new WeakSet(), xi = function() {
|
2229
|
+
this.s.childDom = this.childNodes, this.s.template = Is(this), this.innerHTML = "", this.append(this.s.template), d(this, Pt, Ci).call(this);
|
2230
|
+
}, Pt = new WeakSet(), Ci = function() {
|
2231
|
+
var s;
|
2300
2232
|
const t = this;
|
2301
|
-
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",
|
2233
|
+
t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.dropdownEl = t.querySelector(".dropdown"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw", Ns(t), t.s.subDropdownTotalH = 0;
|
2302
2234
|
const e = t.getAttribute("d4-value");
|
2303
2235
|
switch (t.s.selectType) {
|
2304
2236
|
case "single":
|
@@ -2307,7 +2239,7 @@ Pt = new WeakSet(), Hi = function() {
|
|
2307
2239
|
const r = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), l = r ? r.getAttribute("d4-value") !== "" : !1;
|
2308
2240
|
if (r && l) {
|
2309
2241
|
const c = r.getAttribute("d4-value");
|
2310
|
-
if (
|
2242
|
+
if (Ps(t, c), t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
|
2311
2243
|
const u = e.split(",")[1];
|
2312
2244
|
o = t.querySelector(`.dropdown-list li[data-option="${u}"]`), t.setAttribute("d4-value", u);
|
2313
2245
|
}
|
@@ -2340,8 +2272,8 @@ Pt = new WeakSet(), Hi = function() {
|
|
2340
2272
|
};
|
2341
2273
|
break;
|
2342
2274
|
}
|
2343
|
-
C(t, t.s.value.index), d(
|
2344
|
-
},
|
2275
|
+
C(t, t.s.value.index), d(s = t, jt, Hi).call(s), t.classList.add("d4-initialize");
|
2276
|
+
}, jt = new WeakSet(), Hi = function() {
|
2345
2277
|
const t = this;
|
2346
2278
|
t.__events__.dropdownToggle = () => {
|
2347
2279
|
t.addEventListener("click", function(e) {
|
@@ -2355,8 +2287,8 @@ Pt = new WeakSet(), Hi = function() {
|
|
2355
2287
|
}
|
2356
2288
|
});
|
2357
2289
|
}, t.__events__.transitionend = () => {
|
2358
|
-
function e(
|
2359
|
-
if (
|
2290
|
+
function e(s) {
|
2291
|
+
if (s.target === this) {
|
2360
2292
|
const o = t.getAttribute("d4-status"), a = t.classList.contains("filter");
|
2361
2293
|
switch (o) {
|
2362
2294
|
case "open":
|
@@ -2364,9 +2296,9 @@ Pt = new WeakSet(), Hi = function() {
|
|
2364
2296
|
if (t.__scroller__) {
|
2365
2297
|
const { viewport: c } = t.__scroller__.elements();
|
2366
2298
|
if (w(t.s.activeLi)) {
|
2367
|
-
const u = t.s.activeLi.clientHeight / 2, p = t.s.activeLi.offsetTop,
|
2299
|
+
const u = t.s.activeLi.clientHeight / 2, p = t.s.activeLi.offsetTop, g = p - r.clientHeight / 2 + u > 0 ? p - r.clientHeight / 2 + u : 0;
|
2368
2300
|
c.scrollTo({
|
2369
|
-
top:
|
2301
|
+
top: g,
|
2370
2302
|
behavior: "smooth"
|
2371
2303
|
});
|
2372
2304
|
} else
|
@@ -2386,39 +2318,39 @@ Pt = new WeakSet(), Hi = function() {
|
|
2386
2318
|
}
|
2387
2319
|
t.s.dropdownEl.addEventListener("transitionend", e);
|
2388
2320
|
}, t.__events__.bindScrollbar = (e = this) => {
|
2389
|
-
const
|
2390
|
-
e.__scroller__ =
|
2321
|
+
const s = e.querySelector(".dropdown-scroller");
|
2322
|
+
e.__scroller__ = Me(s, {
|
2391
2323
|
overflowBehavior: {
|
2392
2324
|
x: "hidden"
|
2393
2325
|
}
|
2394
2326
|
});
|
2395
2327
|
}, t.__events__.selectOption = (e = this) => {
|
2396
|
-
let
|
2328
|
+
let s, o;
|
2397
2329
|
const a = e.querySelector(".dropdown-scroller"), r = e.classList.contains("city");
|
2398
2330
|
e.s.allLi = e.querySelectorAll(".dropdown-list li"), e.s.allLi.forEach((l) => {
|
2399
2331
|
l.addEventListener("click", function(c) {
|
2400
2332
|
var m;
|
2401
|
-
const u = this, p = [...e.s.allLi].indexOf(u),
|
2333
|
+
const u = this, p = [...e.s.allLi].indexOf(u), g = parseInt(e.getAttribute("d4-default-height"));
|
2402
2334
|
if (u.classList.contains("has-sublayer")) {
|
2403
2335
|
c.stopPropagation();
|
2404
|
-
const
|
2405
|
-
|
2406
|
-
const
|
2407
|
-
|
2336
|
+
const f = u.querySelector(".sub-dropdown"), b = f.querySelector(".sub-dropdown-list"), y = parseInt(getComputedStyle(b).marginTop) + parseInt(getComputedStyle(b).marginBottom);
|
2337
|
+
f.style.cssText = `--height: ${b.offsetHeight + y}px`;
|
2338
|
+
const _ = parseInt(f.style.cssText.replace("--height:", "").trim()), G = parseInt(getComputedStyle(a).maxHeight), S = () => {
|
2339
|
+
s = g + e.s.subDropdownTotalH, o = s > G ? G : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
|
2408
2340
|
};
|
2409
|
-
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -=
|
2410
|
-
const
|
2411
|
-
e.__scroller__.update(!0),
|
2341
|
+
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= _, S()) : (u.classList.add("open"), e.s.subDropdownTotalH += _, S());
|
2342
|
+
const R = () => {
|
2343
|
+
e.__scroller__.update(!0), f.removeEventListener("transitionend", R);
|
2412
2344
|
};
|
2413
|
-
|
2345
|
+
f.addEventListener("transitionend", R);
|
2414
2346
|
} else
|
2415
|
-
switch (
|
2347
|
+
switch (Os(e), e.s.selectType) {
|
2416
2348
|
case "single":
|
2417
2349
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
2418
|
-
const
|
2419
|
-
y && (y.querySelector(".dropdown-list").textContent = "", C(y, -1),
|
2350
|
+
const f = e.s.cityLang, b = l.textContent.trim(), y = document.getElementById(e.getAttribute("dist-select"));
|
2351
|
+
y && (y.querySelector(".dropdown-list").textContent = "", C(y, -1), Oe[f][b].forEach((_, G) => {
|
2420
2352
|
const S = document.createElement("li");
|
2421
|
-
S.textContent =
|
2353
|
+
S.textContent = _[0], S.setAttribute("data-option", _[0]), y.querySelector(".dropdown-list").append(S);
|
2422
2354
|
}), e.__events__.selectOption(y));
|
2423
2355
|
}
|
2424
2356
|
(m = u.parentNode.closest("li")) != null && m.classList.contains("has-sublayer") && (c.stopPropagation(), e.close());
|
@@ -2434,8 +2366,8 @@ Pt = new WeakSet(), Hi = function() {
|
|
2434
2366
|
e.stopPropagation();
|
2435
2367
|
}), t.querySelector(".filter-input").addEventListener("input", function() {
|
2436
2368
|
const e = this.value.toUpperCase();
|
2437
|
-
t.s.allLi.forEach((
|
2438
|
-
|
2369
|
+
t.s.allLi.forEach((s) => {
|
2370
|
+
s.textContent.toUpperCase().includes(e) ? s.removeAttribute("style") : s.style.display = "none";
|
2439
2371
|
});
|
2440
2372
|
}));
|
2441
2373
|
}, t.__events__.removeTag = () => {
|
@@ -2457,123 +2389,123 @@ Pt = new WeakSet(), Hi = function() {
|
|
2457
2389
|
});
|
2458
2390
|
}, t.__events__.dropdownToggle(), t.__events__.bindScrollbar(), t.__events__.selectOption(), t.__events__.filterHandler(), t.__events__.removeTag(), t.__events__.transitionend();
|
2459
2391
|
};
|
2460
|
-
Object.assign(
|
2461
|
-
customElements.define("dropdown-el",
|
2462
|
-
function
|
2392
|
+
Object.assign(ki.prototype, O);
|
2393
|
+
customElements.define("dropdown-el", ki);
|
2394
|
+
function dt(n) {
|
2463
2395
|
const i = {};
|
2464
|
-
return [...
|
2396
|
+
return [...n.attributes].forEach((t) => {
|
2465
2397
|
if (t.name.includes("duration-")) {
|
2466
|
-
const e = t.name.replace("duration-", ""),
|
2467
|
-
i[e] = Number(
|
2398
|
+
const e = t.name.replace("duration-", ""), s = t.nodeValue;
|
2399
|
+
i[e] = Number(s);
|
2468
2400
|
}
|
2469
2401
|
}), Object.keys(i).length === 0 ? null : i;
|
2470
2402
|
}
|
2471
|
-
function
|
2472
|
-
if (
|
2403
|
+
function Be(n) {
|
2404
|
+
if (dt(n)) {
|
2473
2405
|
let i;
|
2474
|
-
const t = Object.keys(
|
2406
|
+
const t = Object.keys(dt(n)).map((e) => ({
|
2475
2407
|
value: e,
|
2476
2408
|
point: e
|
2477
2409
|
}));
|
2478
|
-
t.sort((e,
|
2410
|
+
t.sort((e, s) => parseInt(s.value, 10) - parseInt(e.value, 10));
|
2479
2411
|
for (let e = 0; e < t.length; e += 1) {
|
2480
|
-
const { point:
|
2481
|
-
window.matchMedia(`(max-width: ${o}px)`).matches && (i =
|
2412
|
+
const { point: s, value: o } = t[e];
|
2413
|
+
window.matchMedia(`(max-width: ${o}px)`).matches && (i = s);
|
2482
2414
|
}
|
2483
|
-
return i ? Number(
|
2415
|
+
return i ? Number(dt(n)[i]) : n.s.options.duration;
|
2484
2416
|
} else
|
2485
|
-
return
|
2417
|
+
return n.s.options.duration;
|
2486
2418
|
}
|
2487
|
-
function
|
2488
|
-
const { behavior: i, continual: t, gap: e } =
|
2489
|
-
o.className = "animate-container", a.className = "animate-item", [...
|
2419
|
+
function zs(n) {
|
2420
|
+
const { behavior: i, continual: t, gap: e } = n.s.options, s = n.childNodes, o = document.createElement("div"), a = document.createElement("div");
|
2421
|
+
o.className = "animate-container", a.className = "animate-item", [...s].forEach((l) => {
|
2490
2422
|
a.append(l);
|
2491
2423
|
});
|
2492
2424
|
function r() {
|
2493
2425
|
const l = a.cloneNode(!0);
|
2494
|
-
return l.classList.add("clone"),
|
2426
|
+
return l.classList.add("clone"), n.s.cloneAnimation = null, n.s.cloneAnimateEl = l, l;
|
2495
2427
|
}
|
2496
|
-
|
2428
|
+
n.s.animation = null, n.s.animateEl = a, n.textContent = "", o.append(a), n.append(o), a.clientWidth * 2 + e >= n.clientWidth ? i === "normal" && t && o.append(r()) : n.s.options.continual = !1;
|
2497
2429
|
}
|
2498
|
-
function
|
2499
|
-
const { behavior: i, direction: t, continual: e } =
|
2500
|
-
let
|
2430
|
+
function k(n) {
|
2431
|
+
const { behavior: i, direction: t, continual: e } = n.s.options;
|
2432
|
+
let s = {};
|
2501
2433
|
switch (i) {
|
2502
2434
|
case "normal":
|
2503
2435
|
let o, a;
|
2504
2436
|
switch (t) {
|
2505
2437
|
case "top":
|
2506
|
-
o = e ? "translate3d(0,100%,0)" : `translate3d(0,${
|
2438
|
+
o = e ? "translate3d(0,100%,0)" : `translate3d(0,${n.clientHeight}px,0)`, a = "translate3d(0,-100%,0)", s.animate1 = [{ transform: o }, { transform: a }], e && (s.animate2 = [{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(0,-200%,0)" }]);
|
2507
2439
|
break;
|
2508
2440
|
case "right":
|
2509
|
-
o = e ? "translate3d(0,0,0)" : "translate3d(-100%,0,0)", a = e ? "translate3d(200%,0,0)" : `translate3d(${
|
2441
|
+
o = e ? "translate3d(0,0,0)" : "translate3d(-100%,0,0)", a = e ? "translate3d(200%,0,0)" : `translate3d(${n.clientWidth}px,0,0)`, s.animate1 = [{ transform: o }, { transform: a }], e && (s.animate2 = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(100%,0,0)" }]);
|
2510
2442
|
break;
|
2511
2443
|
case "bottom":
|
2512
|
-
o = "translate3d(0,-100%,0)", a = e ? "translate3d(0,100%,0)" : `translate3d(0,${
|
2444
|
+
o = "translate3d(0,-100%,0)", a = e ? "translate3d(0,100%,0)" : `translate3d(0,${n.clientHeight}px,0)`, s.animate1 = [{ transform: o }, { transform: a }], e && (s.animate2 = [{ transform: "translate3d(0,-200%,0)" }, { transform: "translate3d(0,0,0)" }]);
|
2513
2445
|
break;
|
2514
2446
|
case "left":
|
2515
|
-
o = e ? "translate3d(100%,0,0)" : `translate3d(${
|
2447
|
+
o = e ? "translate3d(100%,0,0)" : `translate3d(${n.clientWidth}px,0,0)`, a = "translate3d(-100%,0,0)", s.animate1 = [{ transform: o }, { transform: a }], e && (s.animate2 = [{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(-200%,0,0)" }]);
|
2516
2448
|
break;
|
2517
2449
|
}
|
2518
2450
|
break;
|
2519
2451
|
case "alternate":
|
2520
2452
|
switch (t) {
|
2521
2453
|
case "top":
|
2522
|
-
|
2454
|
+
s.animate1 = [{ transform: `translate3d(0,calc(${n.clientHeight}px - 100%),0)` }, { transform: "translate3d(0,0,0)" }, { transform: `translate3d(0,calc(${n.clientHeight}px - 100%),0)` }];
|
2523
2455
|
break;
|
2524
2456
|
case "right":
|
2525
|
-
|
2457
|
+
s.animate1 = [{ transform: "translate3d(0,0,0)" }, { transform: `translate3d(calc(-100% + ${n.clientWidth}px),0,0)` }, { transform: "translate3d(0,0,0)" }];
|
2526
2458
|
break;
|
2527
2459
|
case "bottom":
|
2528
|
-
|
2460
|
+
s.animate1 = [{ transform: "translate3d(0,0,0)" }, { transform: `translate3d(0,calc(${n.clientHeight}px - 100%),0)` }, { transform: "translate3d(0,0,0)" }];
|
2529
2461
|
break;
|
2530
2462
|
case "left":
|
2531
|
-
|
2463
|
+
s.animate1 = [{ transform: `translate3d(calc(-100% + ${n.clientWidth}px),0,0)` }, { transform: "translate3d(0,0,0)" }, { transform: `translate3d(calc(-100% + ${n.clientWidth}px),0,0)` }];
|
2532
2464
|
break;
|
2533
2465
|
}
|
2534
2466
|
break;
|
2535
2467
|
case "endStop":
|
2536
2468
|
switch (t) {
|
2537
2469
|
case "top":
|
2538
|
-
|
2470
|
+
s.animate1 = [{ transform: `translate3d(0,${n.clientHeight}px,0)` }, { transform: "translate3d(0,0,0)" }];
|
2539
2471
|
break;
|
2540
2472
|
case "right":
|
2541
|
-
|
2473
|
+
s.animate1 = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
|
2542
2474
|
break;
|
2543
2475
|
case "bottom":
|
2544
|
-
|
2476
|
+
s.animate1 = [{ transform: "translate3d(0,-100%,0)" }, { transform: `translate3d(0,calc(${n.clientHeight}px - 100%),0)` }];
|
2545
2477
|
break;
|
2546
2478
|
case "left":
|
2547
|
-
|
2479
|
+
s.animate1 = [{ transform: `translate3d(${n.clientWidth}px,0,0)` }, { transform: `translate3d(calc(${n.clientWidth}px - 100%),0,0)` }];
|
2548
2480
|
break;
|
2549
2481
|
}
|
2550
2482
|
break;
|
2551
2483
|
}
|
2552
|
-
return
|
2484
|
+
return s;
|
2553
2485
|
}
|
2554
|
-
function
|
2486
|
+
function Ws(n) {
|
2555
2487
|
let i;
|
2556
2488
|
return function(t) {
|
2557
|
-
i && clearTimeout(i), i = setTimeout(
|
2489
|
+
i && clearTimeout(i), i = setTimeout(n, 200, t);
|
2558
2490
|
};
|
2559
2491
|
}
|
2560
|
-
var
|
2561
|
-
class
|
2492
|
+
var zt, Mi, Wt, qi, Bt, Ii, Gt, Oi;
|
2493
|
+
class Bs extends HTMLElement {
|
2562
2494
|
constructor() {
|
2563
2495
|
super();
|
2496
|
+
h(this, zt);
|
2497
|
+
h(this, Wt);
|
2564
2498
|
h(this, Bt);
|
2565
2499
|
h(this, Gt);
|
2566
|
-
h(this, Xt);
|
2567
|
-
h(this, Rt);
|
2568
2500
|
this.initialize = !1;
|
2569
2501
|
}
|
2570
2502
|
static get observedAttributes() {
|
2571
2503
|
return [];
|
2572
2504
|
}
|
2573
|
-
attributeChangedCallback(t, e,
|
2505
|
+
attributeChangedCallback(t, e, s) {
|
2574
2506
|
}
|
2575
2507
|
connectedCallback() {
|
2576
|
-
this.initialize || (this.initialize = !0, d(this,
|
2508
|
+
this.initialize || (this.initialize = !0, d(this, zt, Mi).call(this));
|
2577
2509
|
}
|
2578
2510
|
play() {
|
2579
2511
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
@@ -2582,47 +2514,47 @@ class Js extends HTMLElement {
|
|
2582
2514
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
2583
2515
|
}
|
2584
2516
|
}
|
2585
|
-
|
2517
|
+
zt = new WeakSet(), Mi = function() {
|
2586
2518
|
const t = {
|
2587
|
-
direction: this.getAttribute("direction") ||
|
2519
|
+
direction: this.getAttribute("direction") || x.SETTINGS.direction,
|
2588
2520
|
// up / down / left / right
|
2589
|
-
behavior: this.getAttribute("behavior") ||
|
2521
|
+
behavior: this.getAttribute("behavior") || x.SETTINGS.behavior,
|
2590
2522
|
// normal / alternate / endStop
|
2591
|
-
duration: Number(this.getAttribute("duration")) ||
|
2523
|
+
duration: Number(this.getAttribute("duration")) || x.SETTINGS.duration,
|
2592
2524
|
// ms
|
2593
|
-
durationBreakpoints:
|
2594
|
-
autoplay: this.getAttribute("autoplay") ||
|
2525
|
+
durationBreakpoints: dt(this) || x.SETTINGS.durationBreakpoints,
|
2526
|
+
autoplay: this.getAttribute("autoplay") || x.SETTINGS.autoplay,
|
2595
2527
|
// normal / alternate / endStop
|
2596
|
-
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" :
|
2528
|
+
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : x.SETTINGS.pauseOnMouseenter,
|
2597
2529
|
// true / false
|
2598
|
-
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" :
|
2530
|
+
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : x.SETTINGS.continual,
|
2599
2531
|
// true / false
|
2600
|
-
gap: Number(this.getAttribute("gap")) ||
|
2532
|
+
gap: Number(this.getAttribute("gap")) || x.SETTINGS.gap
|
2601
2533
|
};
|
2602
|
-
this.s = {}, this.s.options = t, this.s.nowDuration =
|
2603
|
-
},
|
2604
|
-
const { direction: t, continual: e, gap:
|
2534
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = Be(this), zs(this), d(this, Wt, qi).call(this);
|
2535
|
+
}, Wt = new WeakSet(), qi = function() {
|
2536
|
+
const { direction: t, continual: e, gap: s } = this.s.options;
|
2605
2537
|
switch (t) {
|
2606
2538
|
case "left":
|
2607
2539
|
case "right":
|
2608
|
-
this.style.cssText = `--continual-gap: ${
|
2540
|
+
this.style.cssText = `--continual-gap: ${s}px;`;
|
2609
2541
|
break;
|
2610
2542
|
case "top":
|
2611
2543
|
case "bottom":
|
2612
|
-
e ? this.style.cssText = `height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${
|
2544
|
+
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;`;
|
2613
2545
|
break;
|
2614
2546
|
}
|
2615
|
-
d(this,
|
2616
|
-
},
|
2617
|
-
const t = this, { direction: e, behavior:
|
2547
|
+
d(this, Bt, Ii).call(this), d(this, Gt, Oi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
|
2548
|
+
}, Bt = new WeakSet(), Ii = function() {
|
2549
|
+
const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
|
2618
2550
|
let c;
|
2619
2551
|
function u() {
|
2620
|
-
switch (
|
2552
|
+
switch (s) {
|
2621
2553
|
case "normal":
|
2622
|
-
t.s.animateEl.style.transform = `${
|
2554
|
+
t.s.animateEl.style.transform = `${k(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(k(t).animate1, {
|
2623
2555
|
duration: t.s.nowDuration,
|
2624
2556
|
iterations: 1 / 0
|
2625
|
-
}), l && (t.s.cloneAnimateEl.style.transform = `${
|
2557
|
+
}), l && (t.s.cloneAnimateEl.style.transform = `${k(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(k(t).animate2, {
|
2626
2558
|
duration: t.s.nowDuration,
|
2627
2559
|
delay: -t.s.nowDuration / 2,
|
2628
2560
|
iterations: 1 / 0
|
@@ -2630,28 +2562,28 @@ Bt = new WeakSet(), Ii = function() {
|
|
2630
2562
|
break;
|
2631
2563
|
case "alternate":
|
2632
2564
|
let m = function() {
|
2633
|
-
let
|
2565
|
+
let f = [];
|
2634
2566
|
switch (e) {
|
2635
2567
|
case "top":
|
2636
|
-
p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight),
|
2568
|
+
p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), g = parseInt(t.s.nowDuration / (p * 2)) * t.s.animateEl.scrollHeight, f = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
|
2637
2569
|
break;
|
2638
2570
|
case "right":
|
2639
|
-
p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth),
|
2571
|
+
p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), g = parseInt(t.s.nowDuration / (p * 2)) * t.s.animateEl.scrollWidth, f = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
|
2640
2572
|
break;
|
2641
2573
|
case "bottom":
|
2642
|
-
p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight),
|
2574
|
+
p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), g = parseInt(o / (p * 2)) * t.s.animateEl.scrollHeight, f = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
|
2643
2575
|
break;
|
2644
2576
|
case "left":
|
2645
|
-
p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth),
|
2577
|
+
p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), g = parseInt(o / (p * 2)) * t.s.animateEl.scrollWidth, f = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
|
2646
2578
|
break;
|
2647
2579
|
}
|
2648
|
-
return
|
2649
|
-
}, p,
|
2580
|
+
return f;
|
2581
|
+
}, p, g;
|
2650
2582
|
(t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${m()[0].transform}`, t.s.animateEl.animate(m(), {
|
2651
|
-
duration:
|
2583
|
+
duration: g,
|
2652
2584
|
fill: "forwards"
|
2653
2585
|
}).finished.then(() => {
|
2654
|
-
t.s.animation = t.s.animateEl.animate(
|
2586
|
+
t.s.animation = t.s.animateEl.animate(k(t).animate1, {
|
2655
2587
|
duration: t.s.nowDuration,
|
2656
2588
|
iterations: 1 / 0
|
2657
2589
|
});
|
@@ -2660,7 +2592,7 @@ Bt = new WeakSet(), Ii = function() {
|
|
2660
2592
|
});
|
2661
2593
|
break;
|
2662
2594
|
case "endStop":
|
2663
|
-
t.s.animateEl.style.transform = `${
|
2595
|
+
t.s.animateEl.style.transform = `${k(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(k(t).animate1, {
|
2664
2596
|
duration: t.s.nowDuration,
|
2665
2597
|
fill: "forwards"
|
2666
2598
|
});
|
@@ -2678,84 +2610,84 @@ Bt = new WeakSet(), Ii = function() {
|
|
2678
2610
|
}), t.addEventListener("mouseleave", function() {
|
2679
2611
|
t.s.animation && r && t.s.animation.playState === "paused" && t.play();
|
2680
2612
|
});
|
2681
|
-
},
|
2613
|
+
}, Gt = new WeakSet(), Oi = function() {
|
2682
2614
|
const t = this;
|
2683
2615
|
function e() {
|
2684
|
-
const
|
2685
|
-
t.s.nowDuration =
|
2616
|
+
const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
2617
|
+
t.s.nowDuration = Be(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(k(t).animate1, {
|
2686
2618
|
duration: t.s.nowDuration,
|
2687
2619
|
iterations: 1 / 0
|
2688
|
-
}), t.s.animation.startTime =
|
2620
|
+
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(k(t).animate2, {
|
2689
2621
|
duration: t.s.nowDuration,
|
2690
2622
|
delay: -t.s.nowDuration / 2,
|
2691
2623
|
iterations: 1 / 0
|
2692
2624
|
}), t.s.cloneAnimation.startTime = o);
|
2693
2625
|
}
|
2694
|
-
window.addEventListener("resize",
|
2626
|
+
window.addEventListener("resize", Ws(e));
|
2695
2627
|
};
|
2696
|
-
customElements.define("marquee-el",
|
2697
|
-
const
|
2628
|
+
customElements.define("marquee-el", Bs);
|
2629
|
+
const pt = function(n, i) {
|
2698
2630
|
let t;
|
2699
2631
|
return function(e) {
|
2700
|
-
t && clearTimeout(t), t = setTimeout(
|
2632
|
+
t && clearTimeout(t), t = setTimeout(n, 200, e);
|
2701
2633
|
};
|
2702
|
-
},
|
2703
|
-
if (
|
2704
|
-
|
2634
|
+
}, $ = (n, i) => {
|
2635
|
+
if (rt(n)) {
|
2636
|
+
n.forEach((t) => {
|
2705
2637
|
t.classList.add(i);
|
2706
2638
|
});
|
2707
2639
|
return;
|
2708
2640
|
}
|
2709
|
-
|
2710
|
-
}, D = (
|
2711
|
-
if (
|
2712
|
-
|
2641
|
+
n.classList.add(i);
|
2642
|
+
}, D = (n, i) => {
|
2643
|
+
if (rt(n)) {
|
2644
|
+
n.forEach((t) => {
|
2713
2645
|
t.classList.remove(i);
|
2714
2646
|
});
|
2715
2647
|
return;
|
2716
2648
|
}
|
2717
|
-
|
2649
|
+
n.classList.remove(i);
|
2718
2650
|
};
|
2719
|
-
var
|
2720
|
-
class
|
2651
|
+
var Rt, Ni, Xt, Pi, Ft, ji, tt, _e, W, ut, Yt, zi;
|
2652
|
+
class Ge {
|
2721
2653
|
constructor(i) {
|
2722
2654
|
// 初始化
|
2723
|
-
h(this,
|
2655
|
+
h(this, Rt);
|
2724
2656
|
// 左右箭頭事件綁定
|
2725
|
-
h(this,
|
2657
|
+
h(this, Xt);
|
2726
2658
|
// 左右拖拉事件綁定
|
2727
|
-
h(this,
|
2659
|
+
h(this, Ft);
|
2728
2660
|
// 卷軸位置判斷
|
2729
2661
|
h(this, tt);
|
2730
2662
|
// 隱藏按鈕判斷
|
2731
2663
|
h(this, W);
|
2732
2664
|
// 選項事件綁定
|
2733
|
-
h(this,
|
2734
|
-
this.$element = i, this.option = i.s.option.drag, d(this,
|
2665
|
+
h(this, Yt);
|
2666
|
+
this.$element = i, this.option = i.s.option.drag, d(this, Rt, Ni).call(this);
|
2735
2667
|
}
|
2736
2668
|
// 更新 active 位置
|
2737
2669
|
update(i) {
|
2738
2670
|
const t = this.$element.querySelector(".wrapper"), e = t == null ? void 0 : t.querySelector(".active");
|
2739
2671
|
if (e) {
|
2740
|
-
const
|
2672
|
+
const s = e.offsetLeft + e.getBoundingClientRect().width / 2 - t.getBoundingClientRect().width / 2;
|
2741
2673
|
t.scrollTo({
|
2742
|
-
left:
|
2674
|
+
left: s,
|
2743
2675
|
behavior: "smooth"
|
2744
2676
|
});
|
2745
2677
|
}
|
2746
2678
|
}
|
2747
2679
|
}
|
2748
|
-
|
2749
|
-
var e,
|
2680
|
+
Rt = new WeakSet(), Ni = function() {
|
2681
|
+
var e, s, o, a, r, l;
|
2750
2682
|
const i = this;
|
2751
2683
|
if (!i.$element)
|
2752
2684
|
return;
|
2753
2685
|
i.$container = i.$element.querySelector(".drag-container"), i.$wrapper = i.$container.querySelector(".wrapper");
|
2754
2686
|
const t = () => {
|
2755
2687
|
var c, u;
|
2756
|
-
d(c = i, tt,
|
2688
|
+
d(c = i, tt, _e).call(c), d(u = i, W, ut).call(u);
|
2757
2689
|
};
|
2758
|
-
i.$wrapper.removeEventListener("scroll", t), i.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize",
|
2690
|
+
i.$wrapper.removeEventListener("scroll", t), i.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize", pt(t)), window.addEventListener("resize", pt(t)), (i.option.draggable || i.$element.s.type == "collapse") && d(e = i, Ft, ji).call(e), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
2759
2691
|
E.prepend,
|
2760
2692
|
`<div class="navigation">
|
2761
2693
|
<div class="button prev">
|
@@ -2765,26 +2697,26 @@ Ft = new WeakSet(), zi = function() {
|
|
2765
2697
|
<div></div>
|
2766
2698
|
</div>
|
2767
2699
|
</div>`
|
2768
|
-
), i.$button = (
|
2769
|
-
},
|
2770
|
-
const i = this, { $wrapper: t, $button: e } = i,
|
2700
|
+
), i.$button = (s = i.$container) == null ? void 0 : s.querySelectorAll(".button"), d(o = i, Xt, Pi).call(o)), d(a = i, tt, _e).call(a), d(r = i, W, ut).call(r), d(l = i, Yt, zi).call(l), i.update();
|
2701
|
+
}, Xt = new WeakSet(), Pi = function() {
|
2702
|
+
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
2771
2703
|
const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
|
2772
2704
|
t.scrollTo({
|
2773
2705
|
left: o ? t.scrollLeft + a : t.scrollLeft - a,
|
2774
2706
|
behavior: "smooth"
|
2775
2707
|
}), setTimeout(() => {
|
2776
2708
|
var r;
|
2777
|
-
d(r = i, W,
|
2709
|
+
d(r = i, W, ut).call(r);
|
2778
2710
|
}, 100);
|
2779
2711
|
};
|
2780
2712
|
e.forEach((o) => {
|
2781
|
-
o.removeEventListener("click",
|
2713
|
+
o.removeEventListener("click", s), o.addEventListener("click", s);
|
2782
2714
|
});
|
2783
|
-
},
|
2715
|
+
}, Ft = new WeakSet(), ji = function() {
|
2784
2716
|
const { $wrapper: i } = this;
|
2785
|
-
let t = !1, e = !1,
|
2717
|
+
let t = !1, e = !1, s = 0, o = 0;
|
2786
2718
|
const a = function(p) {
|
2787
|
-
p.preventDefault(), e = !1, t = !0,
|
2719
|
+
p.preventDefault(), e = !1, t = !0, s = p.pageX - i.offsetLeft, o = i.scrollLeft;
|
2788
2720
|
};
|
2789
2721
|
i.removeEventListener("mousedown", a), i.addEventListener("mousedown", a);
|
2790
2722
|
const r = function() {
|
@@ -2798,7 +2730,7 @@ Ft = new WeakSet(), zi = function() {
|
|
2798
2730
|
const c = function(p) {
|
2799
2731
|
if (p.preventDefault(), e = !0, !t)
|
2800
2732
|
return;
|
2801
|
-
const m = p.pageX - i.offsetLeft -
|
2733
|
+
const m = p.pageX - i.offsetLeft - s;
|
2802
2734
|
i.scrollTo({
|
2803
2735
|
left: o - m
|
2804
2736
|
});
|
@@ -2810,93 +2742,93 @@ Ft = new WeakSet(), zi = function() {
|
|
2810
2742
|
i.querySelectorAll("a").forEach((p) => {
|
2811
2743
|
p.removeEventListener("click", u), p.addEventListener("click", u);
|
2812
2744
|
});
|
2813
|
-
}, tt = new WeakSet(),
|
2814
|
-
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth,
|
2815
|
-
e <= 0 || (
|
2816
|
-
}, W = new WeakSet(),
|
2745
|
+
}, tt = new WeakSet(), _e = function() {
|
2746
|
+
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
|
2747
|
+
e <= 0 || ($(i, "scrollable"), s == 0 ? (D(i, "scrollable"), $(t, "start"), D(t, "end")) : s + 1 >= e ? (D(i, "scrollable"), D(t, "start"), $(t, "end")) : ($(t, "center"), D(t, "start"), D(t, "end")));
|
2748
|
+
}, W = new WeakSet(), ut = function() {
|
2817
2749
|
const { $wrapper: i, $button: t, $element: e } = this;
|
2818
2750
|
if (!t)
|
2819
2751
|
return;
|
2820
|
-
const
|
2821
|
-
if (
|
2822
|
-
|
2752
|
+
const s = i.scrollWidth - i.clientWidth, o = i.scrollLeft;
|
2753
|
+
if (s <= 0) {
|
2754
|
+
$(t, "hide"), D(t, "active"), $(e, "noScrollable");
|
2823
2755
|
return;
|
2824
2756
|
}
|
2825
|
-
|
2757
|
+
s > 0 && ($(t, "active"), D(e, "noScrollable")), o == 0 ? t.forEach((a) => {
|
2826
2758
|
if (a.classList.contains("next")) {
|
2827
2759
|
D(a, "hide");
|
2828
2760
|
return;
|
2829
2761
|
}
|
2830
|
-
|
2831
|
-
}) : o + 1 >=
|
2762
|
+
$(a, "hide");
|
2763
|
+
}) : o + 1 >= s ? t.forEach((a) => {
|
2832
2764
|
if (a.classList.contains("next")) {
|
2833
|
-
|
2765
|
+
$(a, "hide");
|
2834
2766
|
return;
|
2835
2767
|
}
|
2836
2768
|
D(a, "hide");
|
2837
2769
|
}) : D(t, "hide");
|
2838
|
-
},
|
2839
|
-
const { $element: i } = this, t = (
|
2770
|
+
}, Yt = new WeakSet(), zi = function() {
|
2771
|
+
const { $element: i } = this, t = (s) => {
|
2840
2772
|
if (this.option.selected) {
|
2841
|
-
const o =
|
2773
|
+
const o = s.getAttribute("data-option").trim();
|
2842
2774
|
i.setAttribute("m4-status", o);
|
2843
2775
|
}
|
2844
2776
|
};
|
2845
2777
|
function e() {
|
2846
2778
|
t(this);
|
2847
2779
|
}
|
2848
|
-
this.$container.querySelectorAll(".item").forEach((
|
2849
|
-
|
2780
|
+
this.$container.querySelectorAll(".item").forEach((s) => {
|
2781
|
+
s.removeEventListener("click", e), s.addEventListener("click", e);
|
2850
2782
|
});
|
2851
2783
|
};
|
2852
|
-
var
|
2853
|
-
class
|
2784
|
+
var Ut, Wi, Jt, Bi, Zt, Gi, Qt, Ri;
|
2785
|
+
class Gs {
|
2854
2786
|
constructor(i) {
|
2855
2787
|
// 初始化
|
2856
|
-
h(this,
|
2788
|
+
h(this, Ut);
|
2857
2789
|
// 隱藏按鈕判斷
|
2858
|
-
h(this,
|
2790
|
+
h(this, Jt);
|
2859
2791
|
// 展開箭頭事件綁定
|
2860
|
-
h(this,
|
2792
|
+
h(this, Zt);
|
2861
2793
|
// 選項事件綁定
|
2862
|
-
h(this,
|
2863
|
-
this.$element = i, this.option = i.s.option.collapse, d(this,
|
2794
|
+
h(this, Qt);
|
2795
|
+
this.$element = i, this.option = i.s.option.collapse, d(this, Ut, Wi).call(this);
|
2864
2796
|
}
|
2865
2797
|
}
|
2866
|
-
|
2867
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this,
|
2868
|
-
},
|
2798
|
+
Ut = new WeakSet(), Wi = function() {
|
2799
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, Jt, Bi).call(this) && d(this, Zt, Gi).call(this), d(this, Qt, Ri).call(this));
|
2800
|
+
}, Jt = new WeakSet(), Bi = function() {
|
2869
2801
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
2870
2802
|
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(E.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), !0) : !1;
|
2871
|
-
},
|
2803
|
+
}, Zt = new WeakSet(), Gi = function() {
|
2872
2804
|
const { $element: i, $button: t } = this, e = function() {
|
2873
2805
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
2874
2806
|
};
|
2875
2807
|
t.removeEventListener("click", e), t.addEventListener("click", e);
|
2876
|
-
},
|
2877
|
-
const { $element: i } = this, t = (
|
2808
|
+
}, Qt = new WeakSet(), Ri = function() {
|
2809
|
+
const { $element: i } = this, t = (s, o) => {
|
2878
2810
|
if (i != null && i.classList.contains("expand") ? i == null || i.classList.remove("expand") : i == null || i.classList.add("expand"), this.option.selected) {
|
2879
|
-
const a =
|
2811
|
+
const a = s.getAttribute("data-option").trim();
|
2880
2812
|
i.setAttribute("m4-status", a);
|
2881
2813
|
}
|
2882
2814
|
};
|
2883
2815
|
function e() {
|
2884
2816
|
t(this);
|
2885
2817
|
}
|
2886
|
-
this.$container.querySelectorAll(".item").forEach((
|
2887
|
-
|
2818
|
+
this.$container.querySelectorAll(".item").forEach((s) => {
|
2819
|
+
s.removeEventListener("click", e), s.addEventListener("click", e);
|
2888
2820
|
});
|
2889
2821
|
};
|
2890
|
-
const
|
2891
|
-
const { type: i, option: t, originalDomString: e } =
|
2892
|
-
return i == "drag" && (
|
2822
|
+
const Rs = (n) => {
|
2823
|
+
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
2824
|
+
return i == "drag" && (s.innerHTML = H.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(E.append, e)), i == "collapse" && (s.innerHTML = H.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(E.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(E.append, e)), i == "dropdown" && (s.innerHTML = H.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(E.append, e)), s.children;
|
2893
2825
|
};
|
2894
|
-
var
|
2895
|
-
class
|
2826
|
+
var Vt, Xi, Kt, Fi, et, ke, B, ht;
|
2827
|
+
class Xs extends HTMLElement {
|
2896
2828
|
constructor() {
|
2897
2829
|
super();
|
2898
|
-
h(this,
|
2899
|
-
h(this,
|
2830
|
+
h(this, Vt);
|
2831
|
+
h(this, Kt);
|
2900
2832
|
// 斷點設定
|
2901
2833
|
h(this, et);
|
2902
2834
|
// check type
|
@@ -2906,159 +2838,159 @@ class Vs extends HTMLElement {
|
|
2906
2838
|
static get observedAttributes() {
|
2907
2839
|
return ["m4-type", "m4-status"];
|
2908
2840
|
}
|
2909
|
-
attributeChangedCallback(t, e,
|
2841
|
+
attributeChangedCallback(t, e, s) {
|
2910
2842
|
var o, a, r;
|
2911
2843
|
switch (t) {
|
2912
2844
|
case "m4-type":
|
2913
|
-
if (e === null || e ===
|
2845
|
+
if (e === null || e === s)
|
2914
2846
|
return;
|
2915
|
-
this.s.type =
|
2847
|
+
this.s.type = s, d(this, B, ht).call(this);
|
2916
2848
|
break;
|
2917
2849
|
case "m4-status":
|
2918
|
-
if (e ===
|
2850
|
+
if (e === s)
|
2919
2851
|
return;
|
2920
2852
|
const l = this.getAttribute("m4-type");
|
2921
2853
|
if (l !== "drag" && l !== "collapse")
|
2922
2854
|
return;
|
2923
2855
|
this.querySelectorAll(".drag-container .item").forEach((c) => {
|
2924
2856
|
c.classList.remove("active");
|
2925
|
-
}), (o = this.querySelector(`.drag-container .item[data-option="${
|
2857
|
+
}), (o = this.querySelector(`.drag-container .item[data-option="${s}"]`)) == null || o.classList.add("active"), l === "collapse" && (this.querySelectorAll(".collapse-container .item").forEach((c) => {
|
2926
2858
|
c.classList.remove("active");
|
2927
|
-
}), (a = this.querySelector(`.collapse-container .item[data-option="${
|
2859
|
+
}), (a = this.querySelector(`.collapse-container .item[data-option="${s}"]`)) == null || a.classList.add("active")), (r = this.drag) == null || r.update();
|
2928
2860
|
break;
|
2929
2861
|
}
|
2930
2862
|
}
|
2931
2863
|
connectedCallback() {
|
2932
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this,
|
2864
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, Vt, Xi).call(this));
|
2933
2865
|
}
|
2934
2866
|
update() {
|
2935
|
-
d(this, et,
|
2867
|
+
d(this, et, ke).call(this);
|
2936
2868
|
}
|
2937
2869
|
}
|
2938
|
-
|
2870
|
+
Vt = new WeakSet(), Xi = function() {
|
2939
2871
|
let t = {};
|
2940
2872
|
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"));
|
2941
|
-
const e = (
|
2942
|
-
if (
|
2873
|
+
const e = (s) => {
|
2874
|
+
if (s.type === "resize") {
|
2943
2875
|
if (window.innerWidth === this.previousWidth)
|
2944
2876
|
return;
|
2945
2877
|
this.previousWidth = window.innerWidth;
|
2946
2878
|
}
|
2947
2879
|
this.update();
|
2948
2880
|
};
|
2949
|
-
window.removeEventListener("resize",
|
2950
|
-
},
|
2951
|
-
this.classList.add("m4-init"), d(this, et,
|
2952
|
-
}, et = new WeakSet(),
|
2881
|
+
window.removeEventListener("resize", pt(e)), window.addEventListener("resize", pt(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, Kt, Fi).call(this);
|
2882
|
+
}, Kt = new WeakSet(), Fi = function() {
|
2883
|
+
this.classList.add("m4-init"), d(this, et, ke).call(this);
|
2884
|
+
}, et = new WeakSet(), ke = function() {
|
2953
2885
|
const t = Object.keys(this.s.option.breakpoint);
|
2954
2886
|
if (!t.length) {
|
2955
|
-
d(this, B,
|
2887
|
+
d(this, B, ht).call(this);
|
2956
2888
|
return;
|
2957
2889
|
}
|
2958
|
-
t.map((e) => Number(e)).sort((e,
|
2959
|
-
var
|
2960
|
-
return window.innerWidth >= e && (this.s.type = (
|
2890
|
+
t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
|
2891
|
+
var s, o, a, r;
|
2892
|
+
return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this, B, ht).call(this), window.innerWidth >= e;
|
2961
2893
|
});
|
2962
|
-
}, B = new WeakSet(),
|
2894
|
+
}, B = new WeakSet(), ht = function() {
|
2963
2895
|
var o;
|
2964
2896
|
const { type: t } = this.s;
|
2965
|
-
this.innerHTML = "", [...
|
2897
|
+
this.innerHTML = "", [...Rs(this)].forEach((a) => {
|
2966
2898
|
this.append(a);
|
2967
2899
|
});
|
2968
|
-
const e = this.querySelector(`.drag-container .item[data-option="${this.getAttribute("m4-status")}"]`),
|
2969
|
-
switch (e == null || e.classList.add("active"),
|
2900
|
+
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")}"]`);
|
2901
|
+
switch (e == null || e.classList.add("active"), s == null || s.classList.add("active"), t) {
|
2970
2902
|
case "drag":
|
2971
|
-
this.
|
2903
|
+
this.drag = new Ge(this);
|
2972
2904
|
break;
|
2973
2905
|
case "collapse":
|
2974
|
-
this.
|
2906
|
+
this.drag = new Ge(this), this.collapse = new Gs(this);
|
2975
2907
|
break;
|
2976
2908
|
}
|
2977
|
-
(o = this.
|
2909
|
+
(o = this.drag) == null || o.update();
|
2978
2910
|
};
|
2979
|
-
customElements.define("multipurpose-nav",
|
2980
|
-
var
|
2981
|
-
class
|
2911
|
+
customElements.define("multipurpose-nav", Xs);
|
2912
|
+
var te, Ui, ee, Ji, it, $e, P, F, ie, Zi, se, Qi, ne, Vi, oe, Ki, ae, ts, re, es, le, is, ce, ss, de, ns, q, z, ue, os, he, as, pe, rs, me, ls;
|
2913
|
+
class Yi extends HTMLElement {
|
2982
2914
|
// 定義組件的初始狀態
|
2983
2915
|
constructor(t, e) {
|
2984
2916
|
super();
|
2985
|
-
h(this,
|
2986
|
-
h(this,
|
2917
|
+
h(this, te);
|
2918
|
+
h(this, ee);
|
2987
2919
|
// 第一關 判斷數量以及id設定
|
2988
2920
|
h(this, it);
|
2989
2921
|
// 第二關 id命名提醒
|
2990
2922
|
h(this, P);
|
2923
|
+
h(this, ie);
|
2924
|
+
h(this, se);
|
2991
2925
|
h(this, ne);
|
2992
|
-
h(this, oe);
|
2993
|
-
h(this, ae);
|
2994
2926
|
// 執行函式
|
2995
2927
|
// 移動至指定位置
|
2996
|
-
h(this,
|
2928
|
+
h(this, oe);
|
2997
2929
|
// 移動
|
2998
|
-
h(this,
|
2930
|
+
h(this, ae);
|
2999
2931
|
// 步驟狀態
|
3000
|
-
h(this,
|
2932
|
+
h(this, re);
|
3001
2933
|
// next 按鈕狀態
|
3002
|
-
h(this,
|
2934
|
+
h(this, le);
|
3003
2935
|
// prev 按鈕狀態
|
3004
|
-
h(this,
|
2936
|
+
h(this, ce);
|
3005
2937
|
// 頁籤狀態
|
3006
|
-
h(this,
|
2938
|
+
h(this, de);
|
3007
2939
|
// 第三關各種元件判斷 及 執行
|
3008
|
-
h(this,
|
2940
|
+
h(this, q);
|
3009
2941
|
// 消失動畫
|
3010
|
-
h(this,
|
2942
|
+
h(this, ue);
|
3011
2943
|
// 出現動畫
|
3012
|
-
h(this,
|
2944
|
+
h(this, he);
|
3013
2945
|
// 狀態
|
3014
|
-
h(this,
|
2946
|
+
h(this, pe);
|
3015
2947
|
// resize
|
3016
|
-
h(this,
|
2948
|
+
h(this, me);
|
3017
2949
|
}
|
3018
2950
|
// 當組件的屬性被更改時會被呼叫
|
3019
2951
|
static get observedAttributes() {
|
3020
2952
|
return ["t4-active"];
|
3021
2953
|
}
|
3022
|
-
attributeChangedCallback(t, e,
|
3023
|
-
t === "t4-active" && e !==
|
2954
|
+
attributeChangedCallback(t, e, s) {
|
2955
|
+
t === "t4-active" && e !== s && d(this, pe, rs).call(this, s);
|
3024
2956
|
}
|
3025
2957
|
connectedCallback() {
|
3026
|
-
this.classList.contains("t4-initialize") || d(this,
|
2958
|
+
this.classList.contains("t4-initialize") || d(this, te, Ui).call(this);
|
3027
2959
|
}
|
3028
2960
|
// ------------- 我是分隔線呦 -------------
|
3029
2961
|
// 頁籤切換
|
3030
2962
|
tabClick(t) {
|
3031
|
-
const { t: e } = this,
|
2963
|
+
const { t: e } = this, s = e.tabs.indexOf(t) % e.tabPanels.length, o = e.tabGroup === "true" ? String(s) : t.getAttribute("t4-id");
|
3032
2964
|
this.setActiveTab(o), setTimeout(() => {
|
3033
|
-
d(this,
|
2965
|
+
d(this, q, z).call(this, "eventAnchor");
|
3034
2966
|
}, e.transition.duration);
|
3035
2967
|
}
|
3036
2968
|
// 外部呼叫方法 $0.setActiveTab(0)
|
3037
2969
|
setActiveTab(t) {
|
3038
|
-
const { t: e } = this,
|
3039
|
-
e.activeTab =
|
3040
|
-
const o = d(this, P, F).call(this,
|
2970
|
+
const { t: e } = this, s = t === "" ? e.tabPanels[0].getAttribute("t4-id") : t;
|
2971
|
+
e.activeTab = s, this.setAttribute("t4-active", s);
|
2972
|
+
const o = d(this, P, F).call(this, s);
|
3041
2973
|
e.tabPanels.forEach((a, r) => {
|
3042
|
-
r === o ? d(this,
|
2974
|
+
r === o ? d(this, he, as).call(this, r) : d(this, ue, os).call(this, r);
|
3043
2975
|
});
|
3044
2976
|
}
|
3045
2977
|
// 外部呼叫方法 $0.goNext()
|
3046
2978
|
goNext() {
|
3047
|
-
const t = d(this, P, F).call(this, this.t.activeTab), e = Math.min(this.t.tabPanels.length - 1, t + 1),
|
3048
|
-
this.setActiveTab(
|
2979
|
+
const t = d(this, P, F).call(this, this.t.activeTab), e = Math.min(this.t.tabPanels.length - 1, t + 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
2980
|
+
this.setActiveTab(s);
|
3049
2981
|
}
|
3050
2982
|
// 外部呼叫方法 $0.goPrev()
|
3051
2983
|
goPrev() {
|
3052
|
-
const t = d(this, P, F).call(this, this.t.activeTab), e = Math.max(0, t - 1),
|
3053
|
-
this.setActiveTab(
|
2984
|
+
const t = d(this, P, F).call(this, this.t.activeTab), e = Math.max(0, t - 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
2985
|
+
this.setActiveTab(s);
|
3054
2986
|
}
|
3055
2987
|
// 外部呼叫方法 $0.update()
|
3056
2988
|
update() {
|
3057
|
-
this.t.tabs = d(this, it,
|
2989
|
+
this.t.tabs = d(this, it, $e).call(this), cs(), console.log("tab update!!!!");
|
3058
2990
|
}
|
3059
2991
|
}
|
3060
|
-
|
3061
|
-
const t = this.getAttribute("t4-name"), { SETTINGS: e } =
|
2992
|
+
te = new WeakSet(), Ui = function() {
|
2993
|
+
const t = this.getAttribute("t4-name"), { SETTINGS: e } = Ue;
|
3062
2994
|
document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
|
3063
2995
|
tabs: [],
|
3064
2996
|
name: t,
|
@@ -3077,112 +3009,112 @@ ie = new WeakSet(), Qi = function() {
|
|
3077
3009
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
3078
3010
|
},
|
3079
3011
|
tabGroup: this.getAttribute("t4-group") || e.tabGroup
|
3080
|
-
}, this.__events__ = {}, this.t.tabs = d(this, it,
|
3081
|
-
},
|
3082
|
-
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this,
|
3083
|
-
const e = new URLSearchParams(document.location.search).get(this.t.name),
|
3084
|
-
e &&
|
3085
|
-
}
|
3086
|
-
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this,
|
3087
|
-
}, it = new WeakSet(),
|
3012
|
+
}, this.__events__ = {}, this.t.tabs = d(this, it, $e).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, ee, Ji).call(this);
|
3013
|
+
}, ee = new WeakSet(), Ji = function() {
|
3014
|
+
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, ie, Zi).call(this), this.t.recordUrl) {
|
3015
|
+
const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
|
3016
|
+
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
3017
|
+
}
|
3018
|
+
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, me, ls).call(this);
|
3019
|
+
}, it = new WeakSet(), $e = function() {
|
3088
3020
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
3089
|
-
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((
|
3090
|
-
|
3021
|
+
return t.type === "normal" && t.tabGroup === "true" && t.tabPanels.length !== e.length && console.warn("按鈕與內容數量不同喔", t.tabPanels.length, e.length), t.tabGroup === "true" ? t.tabPanels.forEach((s, o) => s.setAttribute("t4-id", o)) : t.tabPanels.forEach((s) => {
|
3022
|
+
s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
|
3091
3023
|
}), e;
|
3092
3024
|
}, P = new WeakSet(), F = function(t) {
|
3093
|
-
const { t: e } = this,
|
3094
|
-
|
3095
|
-
const o =
|
3025
|
+
const { t: e } = this, s = e.tabPanels.filter((a) => a.getAttribute("t4-id") === t);
|
3026
|
+
s.length > 1 && console.warn("有兩個相同id設定", s);
|
3027
|
+
const o = s[0];
|
3096
3028
|
return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
|
3097
|
-
},
|
3029
|
+
}, ie = new WeakSet(), Zi = function() {
|
3098
3030
|
const t = document.createElement("div");
|
3099
3031
|
t.classList.add("swiper-container");
|
3100
3032
|
const e = document.createElement("div");
|
3101
|
-
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((
|
3102
|
-
e.appendChild(
|
3103
|
-
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this,
|
3104
|
-
},
|
3105
|
-
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"),
|
3033
|
+
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
|
3034
|
+
e.appendChild(s.cloneNode(!0));
|
3035
|
+
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, se, Qi).call(this);
|
3036
|
+
}, se = new WeakSet(), Qi = function() {
|
3037
|
+
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
|
3106
3038
|
t.style.overflow = "hidden", e.style.display = "flex";
|
3107
|
-
const o =
|
3039
|
+
const o = s.length * 100 + "%";
|
3108
3040
|
e.style.width = o;
|
3109
|
-
},
|
3041
|
+
}, ne = new WeakSet(), Vi = function(t) {
|
3110
3042
|
const { t: e } = this;
|
3111
3043
|
if (e.recordUrl === "true") {
|
3112
|
-
const
|
3113
|
-
|
3114
|
-
const o = `${window.location.pathname}?${
|
3044
|
+
const s = new URLSearchParams(document.location.search);
|
3045
|
+
s.set(e.name, t);
|
3046
|
+
const o = `${window.location.pathname}?${s.toString()}`;
|
3115
3047
|
history.replaceState({ t4Id: t }, "", o);
|
3116
3048
|
}
|
3117
|
-
},
|
3049
|
+
}, oe = new WeakSet(), Ki = function() {
|
3118
3050
|
const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
|
3119
|
-
d(this,
|
3120
|
-
},
|
3051
|
+
d(this, ae, ts).call(this, o);
|
3052
|
+
}, ae = new WeakSet(), ts = function(t) {
|
3121
3053
|
window.scrollTo({
|
3122
3054
|
top: t,
|
3123
3055
|
behavior: "smooth"
|
3124
3056
|
});
|
3125
|
-
},
|
3057
|
+
}, re = new WeakSet(), es = function(t) {
|
3126
3058
|
let e = parseInt(t, 10) + 1;
|
3127
3059
|
this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
|
3128
|
-
},
|
3129
|
-
const e = document.querySelectorAll(`[t4-role="next"][t4-control="${this.t.name}"]`),
|
3060
|
+
}, le = new WeakSet(), is = function(t) {
|
3061
|
+
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;
|
3130
3062
|
e.forEach((a) => {
|
3131
|
-
|
3063
|
+
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
3132
3064
|
});
|
3133
|
-
},
|
3134
|
-
const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`),
|
3065
|
+
}, ce = new WeakSet(), ss = function(t) {
|
3066
|
+
const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === 0;
|
3135
3067
|
e.forEach((a) => {
|
3136
|
-
|
3068
|
+
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
3137
3069
|
});
|
3138
|
-
},
|
3139
|
-
this.t.tabGroup === "true" ? this.t.tabs.forEach((
|
3140
|
-
o == t ?
|
3141
|
-
}) : this.t.tabs.forEach((
|
3142
|
-
|
3070
|
+
}, de = new WeakSet(), ns = function(t, e) {
|
3071
|
+
this.t.tabGroup === "true" ? this.t.tabs.forEach((s, o) => {
|
3072
|
+
o == t ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
|
3073
|
+
}) : this.t.tabs.forEach((s, o) => {
|
3074
|
+
s.getAttribute("t4-id") === e ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
|
3143
3075
|
});
|
3144
|
-
},
|
3076
|
+
}, q = new WeakSet(), z = function(t, e, s) {
|
3145
3077
|
switch (t) {
|
3146
3078
|
case "step":
|
3147
|
-
|
3079
|
+
we(this.t.step) && d(this, re, es).call(this, e);
|
3148
3080
|
break;
|
3149
3081
|
case "eventAnchor":
|
3150
|
-
this.t.anchor && d(this,
|
3082
|
+
this.t.anchor && d(this, oe, Ki).call(this);
|
3151
3083
|
break;
|
3152
3084
|
case "tabState":
|
3153
|
-
this.t.type == "normal" && d(this,
|
3085
|
+
this.t.type == "normal" && d(this, de, ns).call(this, e, s);
|
3154
3086
|
break;
|
3155
3087
|
case "btnState":
|
3156
|
-
d(this,
|
3088
|
+
d(this, le, is).call(this, e), d(this, ce, ss).call(this, e);
|
3157
3089
|
break;
|
3158
3090
|
case "tabUrl":
|
3159
|
-
this.t.recordUrl === "true" && d(this,
|
3091
|
+
this.t.recordUrl === "true" && d(this, ne, Vi).call(this, e);
|
3160
3092
|
break;
|
3161
3093
|
default:
|
3162
3094
|
console.warn("請增加判斷,謝謝");
|
3163
3095
|
break;
|
3164
3096
|
}
|
3165
|
-
},
|
3097
|
+
}, ue = new WeakSet(), os = function(t) {
|
3166
3098
|
const { t: e } = this;
|
3167
3099
|
this.t.transition;
|
3168
|
-
const
|
3169
|
-
switch (
|
3100
|
+
const s = e.tabPanels[t];
|
3101
|
+
switch (s.classList.remove("show"), s.classList.add("hide"), e.display) {
|
3170
3102
|
case "fade":
|
3171
|
-
|
3103
|
+
s.style.cssText = "display: none; opacity: 0;";
|
3172
3104
|
break;
|
3173
3105
|
case "slide":
|
3174
|
-
|
3106
|
+
s.style.cssText = "display: none; opacity: 0; max-height: unset;";
|
3175
3107
|
break;
|
3176
3108
|
case "swiper":
|
3177
3109
|
break;
|
3178
3110
|
default:
|
3179
|
-
|
3111
|
+
s.style.display = "none";
|
3180
3112
|
break;
|
3181
3113
|
}
|
3182
|
-
},
|
3183
|
-
const { duration: e, timing:
|
3114
|
+
}, he = new WeakSet(), as = function(t) {
|
3115
|
+
const { duration: e, timing: s, delay: o } = this.t.transition, a = this.t.tabPanels[t];
|
3184
3116
|
let r;
|
3185
|
-
switch (a.classList.add("show"), a.classList.remove("hide"), a.style.transition = `opacity ${e}ms ${
|
3117
|
+
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) {
|
3186
3118
|
case "fade":
|
3187
3119
|
a.style.opacity = "0", r = setTimeout(() => {
|
3188
3120
|
clearTimeout(r), a.style.opacity = "1";
|
@@ -3198,41 +3130,41 @@ ie = new WeakSet(), Qi = function() {
|
|
3198
3130
|
case "swiper":
|
3199
3131
|
a.style.opacity = "1";
|
3200
3132
|
const c = this.querySelector(".swiper-wrapper"), u = this.t.tabPanels[0].offsetWidth, p = -t * u;
|
3201
|
-
c.style.transition = `transform ${e}ms ${
|
3133
|
+
c.style.transition = `transform ${e}ms ${s} ${o}ms`, c.style.transform = `translateX(${p}px)`;
|
3202
3134
|
break;
|
3203
3135
|
default:
|
3204
3136
|
console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
|
3205
3137
|
break;
|
3206
3138
|
}
|
3207
|
-
},
|
3139
|
+
}, pe = new WeakSet(), rs = function(t) {
|
3208
3140
|
const e = d(this, P, F).call(this, t);
|
3209
|
-
d(this,
|
3210
|
-
},
|
3141
|
+
d(this, q, z).call(this, "step", e), d(this, q, z).call(this, "btnState", e), d(this, q, z).call(this, "tabState", e, t), d(this, q, z).call(this, "tabUrl", t), this.emit("change");
|
3142
|
+
}, me = new WeakSet(), ls = function() {
|
3211
3143
|
const t = this;
|
3212
3144
|
window.addEventListener(
|
3213
3145
|
"resize",
|
3214
|
-
|
3146
|
+
Fs(() => {
|
3215
3147
|
t.update();
|
3216
3148
|
}, 1e3)
|
3217
3149
|
);
|
3218
3150
|
};
|
3219
|
-
function
|
3151
|
+
function Fs(n, i = 1e3) {
|
3220
3152
|
let t;
|
3221
3153
|
return function(e) {
|
3222
|
-
t && clearTimeout(t), t = setTimeout(
|
3154
|
+
t && clearTimeout(t), t = setTimeout(n, i, e);
|
3223
3155
|
};
|
3224
3156
|
}
|
3225
|
-
function
|
3226
|
-
const
|
3157
|
+
function cs() {
|
3158
|
+
const n = document.querySelectorAll("[t4-control]");
|
3227
3159
|
document.addEventListener("click", function(i) {
|
3228
3160
|
let t = !1;
|
3229
|
-
for (const e of
|
3161
|
+
for (const e of n)
|
3230
3162
|
if (e.contains(i.target) || i.target.closest("[t4-control]") === e) {
|
3231
3163
|
t = !0;
|
3232
3164
|
break;
|
3233
3165
|
}
|
3234
3166
|
if (t) {
|
3235
|
-
const e = i.target.closest("[t4-control]"),
|
3167
|
+
const e = i.target.closest("[t4-control]"), s = e.getAttribute("t4-control"), o = document.querySelectorAll(`tab-el[t4-name="${s}"]`), a = e.getAttribute("t4-role");
|
3236
3168
|
o.forEach((r) => {
|
3237
3169
|
switch (a) {
|
3238
3170
|
case "tab":
|
@@ -3252,97 +3184,97 @@ function hs() {
|
|
3252
3184
|
}
|
3253
3185
|
});
|
3254
3186
|
}
|
3255
|
-
|
3256
|
-
Object.assign(
|
3257
|
-
customElements.define("tab-el",
|
3258
|
-
const
|
3259
|
-
const { defaultOptions: i } =
|
3260
|
-
|
3261
|
-
},
|
3262
|
-
const { defaultOptions: i } =
|
3263
|
-
|
3187
|
+
cs();
|
3188
|
+
Object.assign(Yi.prototype, O);
|
3189
|
+
customElements.define("tab-el", Yi);
|
3190
|
+
const Re = (n) => {
|
3191
|
+
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e);
|
3192
|
+
n.classList.add(t), o.style.height = 0, o.style["transition-property"] = s.property, o.style["transition-duration"] = s.duration, o.style["transition-timing-function"] = s.function, o.style["transition-delay"] = s.delay, o.style.overflow = "hidden";
|
3193
|
+
}, Ys = (n) => {
|
3194
|
+
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
|
3195
|
+
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";
|
3264
3196
|
};
|
3265
|
-
var st,
|
3266
|
-
class
|
3197
|
+
var st, xe, ge, ds, fe, us, nt, Ce;
|
3198
|
+
class Us {
|
3267
3199
|
constructor(i, t = {}) {
|
3268
3200
|
h(this, st);
|
3269
|
-
h(this,
|
3270
|
-
h(this,
|
3201
|
+
h(this, ge);
|
3202
|
+
h(this, fe);
|
3271
3203
|
h(this, nt);
|
3272
|
-
!
|
3204
|
+
!at(i) && !we(i) && !rt(i) && !w(i) || (this.__storage__ = {
|
3273
3205
|
el: i,
|
3274
3206
|
options: t
|
3275
|
-
}, this.active = "data-collapse-active", d(this, st,
|
3207
|
+
}, this.active = "data-collapse-active", d(this, st, xe).call(this));
|
3276
3208
|
}
|
3277
3209
|
update() {
|
3278
|
-
d(this, st,
|
3210
|
+
d(this, st, xe).call(this);
|
3279
3211
|
}
|
3280
3212
|
}
|
3281
|
-
st = new WeakSet(),
|
3282
|
-
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS:
|
3283
|
-
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({},
|
3213
|
+
st = new WeakSet(), xe = function() {
|
3214
|
+
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Je;
|
3215
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
3284
3216
|
for (const [o, a] of Object.entries(this.options.on))
|
3285
3217
|
this.__events__[o] = [a];
|
3286
|
-
d(this,
|
3287
|
-
},
|
3218
|
+
d(this, ge, ds).call(this);
|
3219
|
+
}, ge = new WeakSet(), ds = function() {
|
3288
3220
|
const { elements: i, options: t } = this;
|
3289
3221
|
i.forEach((e) => {
|
3290
|
-
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,
|
3222
|
+
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this, fe, us).call(this, e);
|
3291
3223
|
}), this.emit("init");
|
3292
|
-
},
|
3293
|
-
const { options: t } = this, { collapseClass: e, block:
|
3294
|
-
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, nt,
|
3295
|
-
const p = (
|
3296
|
-
|
3224
|
+
}, fe = new WeakSet(), us = function(i) {
|
3225
|
+
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
|
3226
|
+
if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this, nt, Ce)), c.addEventListener("click", d(this, nt, Ce)), r) {
|
3227
|
+
const p = (g) => {
|
3228
|
+
g.stopPropagation();
|
3297
3229
|
};
|
3298
3230
|
u.removeEventListener("click", p), u.addEventListener("click", p);
|
3299
3231
|
}
|
3300
|
-
}, nt = new WeakSet(),
|
3301
|
-
const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block:
|
3232
|
+
}, nt = new WeakSet(), Ce = function() {
|
3233
|
+
const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
|
3302
3234
|
r.classList.contains(e) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
|
3303
|
-
|
3304
|
-
}),
|
3235
|
+
Re(l);
|
3236
|
+
}), Ys(r)) : Re(r), i.emit("afterCollapse");
|
3305
3237
|
};
|
3306
|
-
Object.assign(
|
3307
|
-
function
|
3308
|
-
const t = i, { color: e, opacity:
|
3309
|
-
let a = document.createElement("span"), r =
|
3310
|
-
a.style.cssText = `background: ${e};left: ${r}px;top: ${l}px;opacity: ${
|
3238
|
+
Object.assign(Us.prototype, O);
|
3239
|
+
function Js(n, i) {
|
3240
|
+
const t = i, { color: e, opacity: s, duration: o } = i.s.options;
|
3241
|
+
let a = document.createElement("span"), r = n.clientX - t.getBoundingClientRect().left, l = n.clientY - t.getBoundingClientRect().top;
|
3242
|
+
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() {
|
3311
3243
|
a.remove();
|
3312
3244
|
}, `${o}`);
|
3313
3245
|
}
|
3314
|
-
function
|
3315
|
-
document.querySelectorAll("ripple-btn").forEach((
|
3316
|
-
|
3246
|
+
function hs() {
|
3247
|
+
document.querySelectorAll("ripple-btn").forEach((n) => {
|
3248
|
+
n.querySelector(".hover-ball"), n.style.setProperty("--r", ""), n.classList.remove("entered");
|
3317
3249
|
});
|
3318
3250
|
}
|
3319
|
-
document.addEventListener("click",
|
3320
|
-
var ot,
|
3321
|
-
class
|
3251
|
+
document.addEventListener("click", hs);
|
3252
|
+
var ot, He, ve, ps, be, ms, ye, gs;
|
3253
|
+
class Zs extends HTMLElement {
|
3322
3254
|
constructor() {
|
3323
3255
|
super();
|
3324
3256
|
h(this, ot);
|
3257
|
+
h(this, ve);
|
3258
|
+
h(this, be);
|
3325
3259
|
h(this, ye);
|
3326
|
-
h(this, we);
|
3327
|
-
h(this, Te);
|
3328
3260
|
this.initialize = !1;
|
3329
3261
|
}
|
3330
3262
|
connectedCallback() {
|
3331
3263
|
const t = this;
|
3332
|
-
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, ot,
|
3264
|
+
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, ot, He).call(this));
|
3333
3265
|
}
|
3334
3266
|
update() {
|
3335
|
-
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, ot,
|
3267
|
+
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, ot, He).call(this);
|
3336
3268
|
}
|
3337
3269
|
}
|
3338
|
-
ot = new WeakSet(),
|
3339
|
-
const { SETTINGS: t } =
|
3270
|
+
ot = new WeakSet(), He = function() {
|
3271
|
+
const { SETTINGS: t } = Ze;
|
3340
3272
|
this.s = {};
|
3341
3273
|
function e(o) {
|
3342
3274
|
let a = !!o;
|
3343
3275
|
return a = o === "true", a;
|
3344
3276
|
}
|
3345
|
-
const
|
3277
|
+
const s = {
|
3346
3278
|
color: this.getAttribute("r4-color") || t.color,
|
3347
3279
|
opacity: this.getAttribute("r4-opacity") || t.opacity,
|
3348
3280
|
duration: Number(this.getAttribute("r4-duration")) || t.duration,
|
@@ -3350,21 +3282,21 @@ ot = new WeakSet(), qe = function() {
|
|
3350
3282
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
3351
3283
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
3352
3284
|
};
|
3353
|
-
this.s.options =
|
3354
|
-
},
|
3355
|
-
d(this,
|
3356
|
-
},
|
3285
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, ve, ps).call(this);
|
3286
|
+
}, ve = new WeakSet(), ps = function() {
|
3287
|
+
d(this, be, ms).call(this), d(this, ye, gs).call(this), this.classList.add("r4-initialize");
|
3288
|
+
}, be = new WeakSet(), ms = function() {
|
3357
3289
|
const t = this, e = document.createElement("i");
|
3358
3290
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
3359
|
-
},
|
3291
|
+
}, ye = new WeakSet(), gs = function() {
|
3360
3292
|
const t = this.querySelector("i.hover-ball"), e = this;
|
3361
3293
|
e.addEventListener("click", function(a) {
|
3362
|
-
a.stopPropagation(), e.s.options.click &&
|
3294
|
+
a.stopPropagation(), e.s.options.click && Js(a, e);
|
3363
3295
|
});
|
3364
|
-
let
|
3365
|
-
e.addEventListener(
|
3366
|
-
if (
|
3367
|
-
const r = Math.round(
|
3296
|
+
let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
|
3297
|
+
e.addEventListener(s, function(a) {
|
3298
|
+
if (s === "touchstart" && hs(), e.s.options.hover) {
|
3299
|
+
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);
|
3368
3300
|
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");
|
3369
3301
|
}
|
3370
3302
|
}), e.addEventListener(o, function(a) {
|
@@ -3374,8 +3306,8 @@ ot = new WeakSet(), qe = function() {
|
|
3374
3306
|
}
|
3375
3307
|
});
|
3376
3308
|
};
|
3377
|
-
customElements.define("ripple-btn",
|
3378
|
-
class
|
3309
|
+
customElements.define("ripple-btn", Zs);
|
3310
|
+
class Qs {
|
3379
3311
|
constructor() {
|
3380
3312
|
this.init();
|
3381
3313
|
}
|
@@ -3408,7 +3340,7 @@ class on {
|
|
3408
3340
|
`, c.appendChild(t(r, l));
|
3409
3341
|
}
|
3410
3342
|
});
|
3411
|
-
function
|
3343
|
+
function s() {
|
3412
3344
|
const o = document.querySelectorAll(".no-image");
|
3413
3345
|
o.length <= 0 || o.forEach((a) => {
|
3414
3346
|
const r = a.parentElement.clientWidth, l = a.parentElement.clientHeight, c = Math.sqrt(r ** 2 + l ** 2), u = Math.asin(l / c) * 180 / Math.PI;
|
@@ -3421,22 +3353,22 @@ class on {
|
|
3421
3353
|
`;
|
3422
3354
|
});
|
3423
3355
|
}
|
3424
|
-
window.addEventListener("resize",
|
3356
|
+
window.addEventListener("resize", s);
|
3425
3357
|
}
|
3426
3358
|
reValidate() {
|
3427
3359
|
this.init();
|
3428
3360
|
}
|
3429
3361
|
}
|
3430
|
-
function
|
3431
|
-
return
|
3432
|
-
Function(
|
3362
|
+
function Xe(n, i) {
|
3363
|
+
return n ? function(t, e) {
|
3364
|
+
Function(n)(t, e);
|
3433
3365
|
} : i;
|
3434
3366
|
}
|
3435
|
-
function
|
3436
|
-
const
|
3367
|
+
function Vs(n, i, t, e) {
|
3368
|
+
const s = i.params, o = n.closest("[data-upload-item]").querySelector("[data-preview]");
|
3437
3369
|
o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(e.imgElement);
|
3438
|
-
const a =
|
3439
|
-
if (
|
3370
|
+
const a = n.dataset.group, r = document.querySelector(i.el).dataset.index;
|
3371
|
+
if (s.compress) {
|
3440
3372
|
const l = t.name.substring(t.name.lastIndexOf(".")).replace("."), c = t.name.replace(`.${l}`, "");
|
3441
3373
|
e.originalCanvas.toBlob(
|
3442
3374
|
function(u) {
|
@@ -3444,43 +3376,43 @@ function an(s, i, t, e) {
|
|
3444
3376
|
uploadImage[`${a}`][r] = {
|
3445
3377
|
file: p,
|
3446
3378
|
info: e
|
3447
|
-
},
|
3379
|
+
}, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
|
3448
3380
|
},
|
3449
3381
|
t.type,
|
3450
|
-
|
3382
|
+
s.compress
|
3451
3383
|
);
|
3452
3384
|
} else
|
3453
3385
|
uploadImage[`${a}`][r] = {
|
3454
3386
|
file: t,
|
3455
3387
|
info: e
|
3456
|
-
},
|
3388
|
+
}, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
|
3457
3389
|
}
|
3458
|
-
function
|
3459
|
-
const
|
3390
|
+
function Ks(n, i, t, e) {
|
3391
|
+
const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
|
3460
3392
|
let u = 0, p = 0;
|
3461
|
-
switch (
|
3393
|
+
switch (s.width = t, s.height = e, n.previewSize) {
|
3462
3394
|
case "contain":
|
3463
|
-
l < c ? (u =
|
3395
|
+
l < c ? (u = s.width, p = t * l / 100) : l > c ? (u = e / l * 100, p = s.height) : (u = s.width, p = s.height);
|
3464
3396
|
break;
|
3465
3397
|
case "cover":
|
3466
|
-
l < c ? (u = e / l * 100, p =
|
3398
|
+
l < c ? (u = e / l * 100, p = s.height) : l > c ? (u = s.width, p = t * l / 100) : l === c && (u = s.width, p = s.height);
|
3467
3399
|
break;
|
3468
3400
|
}
|
3469
|
-
const
|
3470
|
-
return o.drawImage(i,
|
3401
|
+
const g = (s.width - u) * 0.5, m = (s.height - p) * 0.5;
|
3402
|
+
return o.drawImage(i, g, m, u, p), s;
|
3471
3403
|
}
|
3472
|
-
function
|
3404
|
+
function tn(n, i) {
|
3473
3405
|
return new Promise((t, e) => {
|
3474
3406
|
if (i) {
|
3475
|
-
const
|
3476
|
-
|
3407
|
+
const s = new Image();
|
3408
|
+
s.src = i, s.classList.add(n.previewSize), s.onload = () => {
|
3477
3409
|
let o = {
|
3478
|
-
imgElement:
|
3479
|
-
originalCanvas:
|
3410
|
+
imgElement: s,
|
3411
|
+
originalCanvas: Ks(n, s, s.width, s.height),
|
3480
3412
|
info: {
|
3481
|
-
originalWidth:
|
3482
|
-
originalHeight:
|
3483
|
-
ratio:
|
3413
|
+
originalWidth: s.width,
|
3414
|
+
originalHeight: s.height,
|
3415
|
+
ratio: s.height / s.width * 100 + "%"
|
3484
3416
|
}
|
3485
3417
|
};
|
3486
3418
|
t(o);
|
@@ -3489,31 +3421,31 @@ function ln(s, i) {
|
|
3489
3421
|
t();
|
3490
3422
|
});
|
3491
3423
|
}
|
3492
|
-
function
|
3424
|
+
function en(n, i) {
|
3493
3425
|
const t = Math.pow(10, i);
|
3494
|
-
return Math.round(
|
3426
|
+
return Math.round(n * t) / t;
|
3495
3427
|
}
|
3496
|
-
function
|
3497
|
-
let t =
|
3498
|
-
return `${
|
3428
|
+
function sn(n, i) {
|
3429
|
+
let t = n.size / 1024 / 1024;
|
3430
|
+
return `${en(t, 2)}` <= i;
|
3499
3431
|
}
|
3500
|
-
function
|
3501
|
-
if (
|
3432
|
+
function nn(n, i, t) {
|
3433
|
+
if (n.target.files.length <= 0)
|
3502
3434
|
return;
|
3503
|
-
const e =
|
3435
|
+
const e = n.target.files[0], s = i.closest("[data-upload-item]");
|
3504
3436
|
let o = new FileReader();
|
3505
3437
|
o.onload = (a) => {
|
3506
3438
|
const r = e.type.split("/")[0] === "image" ? a.target.result : null;
|
3507
|
-
if (t.params.sizeLimit && !
|
3508
|
-
i.value = "",
|
3439
|
+
if (t.params.sizeLimit && !sn(e, t.params.sizeLimit)) {
|
3440
|
+
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);
|
3509
3441
|
return;
|
3510
3442
|
} else
|
3511
|
-
|
3512
|
-
|
3443
|
+
s.classList.remove("over-limit"), s.classList.add("uploaded"), tn(t.params, r).then((l) => {
|
3444
|
+
Vs(i, t, e, l);
|
3513
3445
|
});
|
3514
3446
|
}, o.readAsDataURL(e);
|
3515
3447
|
}
|
3516
|
-
class
|
3448
|
+
class on {
|
3517
3449
|
constructor(i, t) {
|
3518
3450
|
const e = this;
|
3519
3451
|
e.el = i, e.params = {
|
@@ -3533,7 +3465,7 @@ class hn {
|
|
3533
3465
|
}
|
3534
3466
|
init() {
|
3535
3467
|
const i = this, t = document.querySelectorAll(`${i.el}:not(.preview-active)`);
|
3536
|
-
t.length <= 0 || (window.uploadImage = {}, t.forEach((e,
|
3468
|
+
t.length <= 0 || (window.uploadImage = {}, t.forEach((e, s) => {
|
3537
3469
|
e.classList.add("preview-active");
|
3538
3470
|
const o = {
|
3539
3471
|
group: e.dataset.group || i.params.group,
|
@@ -3541,68 +3473,67 @@ class hn {
|
|
3541
3473
|
previewSize: e.dataset.previewSize || i.params.previewSize,
|
3542
3474
|
compress: e.dataset.compress || i.params.compress,
|
3543
3475
|
on: {
|
3544
|
-
changeAfter:
|
3545
|
-
overLimit:
|
3476
|
+
changeAfter: Xe(e.dataset.changeAfter, i.params.on.changeAfter),
|
3477
|
+
overLimit: Xe(e.dataset.overLimit, i.params.on.overLimit)
|
3546
3478
|
}
|
3547
3479
|
};
|
3548
3480
|
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) {
|
3549
|
-
|
3481
|
+
nn(a, e, i);
|
3550
3482
|
});
|
3551
3483
|
}));
|
3552
3484
|
}
|
3553
3485
|
}
|
3554
3486
|
export {
|
3555
|
-
|
3556
|
-
|
3557
|
-
|
3558
|
-
|
3559
|
-
|
3560
|
-
|
3561
|
-
|
3562
|
-
|
3563
|
-
|
3564
|
-
|
3565
|
-
|
3566
|
-
|
3487
|
+
Qe as A,
|
3488
|
+
Tn as B,
|
3489
|
+
Us as C,
|
3490
|
+
ki as D,
|
3491
|
+
En as E,
|
3492
|
+
An as F,
|
3493
|
+
Ln as G,
|
3494
|
+
Sn as H,
|
3495
|
+
Qs as I,
|
3496
|
+
Dn as J,
|
3497
|
+
_n as K,
|
3498
|
+
kn as L,
|
3567
3499
|
U as M,
|
3568
|
-
|
3569
|
-
|
3570
|
-
|
3571
|
-
|
3572
|
-
|
3573
|
-
|
3574
|
-
|
3575
|
-
|
3576
|
-
|
3577
|
-
|
3578
|
-
|
3579
|
-
|
3580
|
-
Rn as Z,
|
3500
|
+
$n as N,
|
3501
|
+
xn as O,
|
3502
|
+
Cn as P,
|
3503
|
+
Hn as Q,
|
3504
|
+
Zs as R,
|
3505
|
+
Mn as S,
|
3506
|
+
Yi as T,
|
3507
|
+
qn as U,
|
3508
|
+
In as V,
|
3509
|
+
On as W,
|
3510
|
+
Nn as X,
|
3511
|
+
Pn as Y,
|
3581
3512
|
w as a,
|
3582
|
-
|
3583
|
-
|
3584
|
-
|
3513
|
+
rt as b,
|
3514
|
+
Ts as c,
|
3515
|
+
ws as d,
|
3585
3516
|
Y as e,
|
3586
3517
|
E as f,
|
3587
3518
|
L as g,
|
3588
|
-
|
3589
|
-
|
3590
|
-
|
3591
|
-
|
3592
|
-
|
3593
|
-
|
3594
|
-
|
3595
|
-
|
3596
|
-
|
3597
|
-
|
3598
|
-
|
3599
|
-
|
3600
|
-
|
3601
|
-
|
3602
|
-
|
3603
|
-
|
3604
|
-
|
3605
|
-
|
3606
|
-
|
3519
|
+
mn as h,
|
3520
|
+
at as i,
|
3521
|
+
ui as j,
|
3522
|
+
Bs as k,
|
3523
|
+
Xs as l,
|
3524
|
+
on as m,
|
3525
|
+
Hs as n,
|
3526
|
+
jn as o,
|
3527
|
+
gn as p,
|
3528
|
+
Ei as q,
|
3529
|
+
Ai as r,
|
3530
|
+
ys as s,
|
3531
|
+
fn as t,
|
3532
|
+
vn as u,
|
3533
|
+
qs as v,
|
3534
|
+
bn as w,
|
3535
|
+
Cs as x,
|
3536
|
+
yn as y,
|
3537
|
+
wn as z
|
3607
3538
|
};
|
3608
3539
|
//# sourceMappingURL=image-preview-bundle.js.map
|