@xwadex/fesd 0.0.26 → 0.0.27
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
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
var
|
1
|
+
var mt = (r, t, e) => {
|
2
2
|
if (!t.has(r))
|
3
3
|
throw TypeError("Cannot " + e);
|
4
4
|
};
|
5
|
-
var
|
5
|
+
var g = (r, t, e) => {
|
6
6
|
if (t.has(r))
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
8
8
|
t instanceof WeakSet ? t.add(r) : t.set(r, e);
|
9
9
|
};
|
10
|
-
var p = (r, t, e) => (
|
11
|
-
import { i as
|
10
|
+
var p = (r, t, e) => (mt(r, t, "access private method"), e);
|
11
|
+
import { i as Z, a as U, g as T, v as gt, c as bt, b as ft, d as wt, e as vt, f as yt, s as $t } from "./image-preview-bundle.js";
|
12
12
|
import { A as Nt, j as Dt, C as zt, h as Ht, D as jt, m as Pt, I as Ft, k as Ut, M as Vt, l as Yt, R as Gt, T as Jt } from "./image-preview-bundle.js";
|
13
|
-
import {
|
14
|
-
const
|
13
|
+
import { m as L, S as At, p as xt } from "./vendor-bundle.js";
|
14
|
+
const C = () => {
|
15
15
|
const r = navigator.userAgent, t = {
|
16
16
|
// Firefox 1.0+
|
17
17
|
isFirefox: typeof InstallTrigger < "u",
|
@@ -46,84 +46,84 @@ const E = () => {
|
|
46
46
|
isLinux: r.indexOf("Linux") > -1
|
47
47
|
};
|
48
48
|
return { browser: t, mobile: e, os: s };
|
49
|
-
},
|
50
|
-
const { browser: r } =
|
49
|
+
}, St = () => {
|
50
|
+
const { browser: r } = C();
|
51
51
|
return Object.keys(r).find((t) => {
|
52
52
|
if (r[t])
|
53
53
|
return r[t];
|
54
54
|
});
|
55
|
-
},
|
56
|
-
const { mobile: r } =
|
55
|
+
}, Ct = () => {
|
56
|
+
const { mobile: r } = C();
|
57
57
|
return Object.keys(r).some((t) => {
|
58
58
|
if (r[t])
|
59
59
|
return r[t];
|
60
60
|
});
|
61
|
-
},
|
62
|
-
const { os: r } =
|
61
|
+
}, Et = () => {
|
62
|
+
const { os: r } = C();
|
63
63
|
return Object.keys(r).find((t) => {
|
64
64
|
if (r[t])
|
65
65
|
return r[t];
|
66
66
|
});
|
67
|
-
}, Lt = () => console.dir(
|
67
|
+
}, Lt = () => console.dir(C());
|
68
68
|
function Ot() {
|
69
69
|
return {
|
70
|
-
init:
|
71
|
-
isBrowser4:
|
72
|
-
isMobile4:
|
73
|
-
isOs4:
|
70
|
+
init: C,
|
71
|
+
isBrowser4: St,
|
72
|
+
isMobile4: Ct,
|
73
|
+
isOs4: Et,
|
74
74
|
logs: Lt
|
75
75
|
};
|
76
76
|
}
|
77
77
|
const f = (r, t, e) => {
|
78
|
-
r && (
|
78
|
+
r && (ft(r) ? r.forEach((s) => s.style[t] = e) : r.style[t] = e);
|
79
79
|
};
|
80
|
-
var
|
80
|
+
var q, tt, W, et, A, V, _, st, O, rt, M, it, R, ot, I, at, X, nt, B, lt, x, Y, N, ct, S, G;
|
81
81
|
class Mt {
|
82
82
|
constructor(t, e = {}) {
|
83
|
-
|
84
|
-
|
83
|
+
g(this, q);
|
84
|
+
g(this, W);
|
85
85
|
// 取得元件上的設定值
|
86
|
-
|
86
|
+
g(this, A);
|
87
87
|
// 設置設定值的 CSS 樣式
|
88
|
-
|
88
|
+
g(this, _);
|
89
89
|
// 表格拖曳功能
|
90
|
-
|
90
|
+
g(this, O);
|
91
91
|
// 設置表格凍結
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
92
|
+
g(this, M);
|
93
|
+
g(this, R);
|
94
|
+
g(this, I);
|
95
|
+
g(this, X);
|
96
96
|
// Markdown 設置
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
!
|
97
|
+
g(this, B);
|
98
|
+
g(this, x);
|
99
|
+
g(this, N);
|
100
|
+
g(this, S);
|
101
|
+
!Z(t) || !U(t) || (this.__storage__ = {
|
102
102
|
el: t,
|
103
103
|
options: e
|
104
|
-
}, this.active = "data-article-active", p(this,
|
104
|
+
}, this.active = "data-article-active", p(this, q, tt).call(this));
|
105
105
|
}
|
106
106
|
update() {
|
107
107
|
const { elements: t } = this;
|
108
108
|
t.forEach((e) => {
|
109
109
|
e.querySelectorAll("._article").forEach((s) => {
|
110
|
-
s.article = {}, s.article.parent = e, s.article.params = p(this, A,
|
110
|
+
s.article = {}, s.article.parent = e, s.article.params = p(this, A, V).call(this, s), p(this, x, Y).call(this, s), p(this, S, G).call(this, s);
|
111
111
|
});
|
112
112
|
});
|
113
113
|
}
|
114
114
|
}
|
115
|
-
|
116
|
-
const { el: t, options: e } = this.__storage__, { SETTINGS: s } =
|
117
|
-
this.elements = e.state == "not active" ? T(t + `:not([${this.active}])`) : T(t), this.elements = T(t), this.options = Object.assign({}, s, e), p(this,
|
118
|
-
},
|
115
|
+
q = new WeakSet(), tt = function() {
|
116
|
+
const { el: t, options: e } = this.__storage__, { SETTINGS: s } = wt;
|
117
|
+
this.elements = e.state == "not active" ? T(t + `:not([${this.active}])`) : T(t), this.elements = T(t), this.options = Object.assign({}, s, e), p(this, W, et).call(this);
|
118
|
+
}, W = new WeakSet(), et = function() {
|
119
119
|
const { elements: t } = this;
|
120
120
|
t.forEach((e) => {
|
121
121
|
e.setAttribute(this.active, ""), e.querySelectorAll("._article").forEach((s) => {
|
122
|
-
var i,
|
123
|
-
s.article = {}, s.article.parent = e, s.article.params = p(this, A,
|
122
|
+
var i, n;
|
123
|
+
s.article = {}, s.article.parent = e, s.article.params = p(this, A, V).call(this, s), s.article.methods = {}, s.article.methods.update = this.update, p(n = p(i = p(this, _, st).call(this, s), x, Y).call(i, s), N, ct).call(n, s), p(this, S, G).call(this, s);
|
124
124
|
});
|
125
125
|
});
|
126
|
-
}, A = new WeakSet(),
|
126
|
+
}, A = new WeakSet(), V = function(t) {
|
127
127
|
return {
|
128
128
|
// 元件本身
|
129
129
|
$selector: t,
|
@@ -136,6 +136,7 @@ k = new WeakSet(), Z = function() {
|
|
136
136
|
$cover: t.querySelectorAll("._cover"),
|
137
137
|
$swiper: t.querySelector(".swiper"),
|
138
138
|
$table: t.querySelector("._table"),
|
139
|
+
$quote: t.querySelector("._quote"),
|
139
140
|
$swiperButtonCover: t.querySelector(".swiper-button-cover"),
|
140
141
|
// 子層元件
|
141
142
|
$h: t.querySelector("._H"),
|
@@ -154,139 +155,167 @@ k = new WeakSet(), Z = function() {
|
|
154
155
|
buttonColor: t.getAttribute("button-color"),
|
155
156
|
buttonColorHover: t.getAttribute("button-color-hover"),
|
156
157
|
buttonTextColor: t.getAttribute("button-textcolor"),
|
157
|
-
descriptionColor: t.getAttribute("description-color")
|
158
|
+
descriptionColor: t.getAttribute("description-color"),
|
159
|
+
quoteColor: t.getAttribute("quote-color"),
|
160
|
+
markdown: t.getAttribute("data-table-markdown") ?? !1
|
158
161
|
};
|
159
|
-
}, W = new WeakSet(), et = function(t) {
|
160
|
-
const { params: e } = t.article;
|
161
|
-
return f(e.$h, "color", e.hColor), f(e.$subH, "color", e.subHColor), f(e.$p, "color", e.pColor), f(e.$description, "color", e.descriptionColor), f(e.$button, "backgroundColor", e.buttonColor), f(e.$button, "color", e.buttonTextColor), e.buttonColorHover && e.$button && (e.$button.appendChild(document.createElement("span")), f(e.$button.querySelector("span"), "backgroundColor", e.buttonColorHover)), f(e.$backgroundWrap, "backgroundColor", e.typeFullColor), f(e.$contentWrap, "backgroundColor", e.typeFullBoxColor), this;
|
162
162
|
}, _ = new WeakSet(), st = function(t) {
|
163
|
+
const { params: e } = t.article;
|
164
|
+
return f(e.$h, "color", e.hColor), f(e.$subH, "color", e.subHColor), f(e.$p, "color", e.pColor), f(e.$description, "color", e.descriptionColor), f(e.$button, "backgroundColor", e.buttonColor), f(e.$button, "color", e.buttonTextColor), e.buttonColorHover && e.$button && (e.$button.appendChild(document.createElement("span")), f(e.$button.querySelector("span"), "backgroundColor", e.buttonColorHover)), f(e.$backgroundWrap, "backgroundColor", e.typeFullColor), f(e.$contentWrap, "backgroundColor", e.typeFullBoxColor), f(e.$quote, "color", e.quoteColor), this;
|
165
|
+
}, O = new WeakSet(), rt = function(t) {
|
163
166
|
const { params: e } = t.article, s = e.$table;
|
164
|
-
let i = !1,
|
165
|
-
s.addEventListener("mousedown", function(
|
166
|
-
|
167
|
-
const
|
168
|
-
|
167
|
+
let i = !1, n, o, c, l;
|
168
|
+
s.addEventListener("mousedown", function(a) {
|
169
|
+
a.preventDefault(), i = !0;
|
170
|
+
const d = s.getBoundingClientRect();
|
171
|
+
n = a.pageX - d.left, o = a.pageY - d.top, c = s.scrollLeft, l = s.scrollTop;
|
169
172
|
}), s.addEventListener("mouseleave", function() {
|
170
173
|
i = !1;
|
171
174
|
}), s.addEventListener("mouseup", function() {
|
172
175
|
i = !1;
|
173
|
-
}), s.addEventListener("mousemove", function(
|
176
|
+
}), s.addEventListener("mousemove", function(a) {
|
174
177
|
if (!i)
|
175
178
|
return;
|
176
|
-
|
177
|
-
const
|
178
|
-
s.scrollLeft =
|
179
|
+
a.preventDefault();
|
180
|
+
const d = s.getBoundingClientRect(), u = a.pageX - d.left, h = a.pageY - d.top, b = u - n, m = h - o;
|
181
|
+
s.scrollLeft = c - b, s.scrollTop = l - m;
|
179
182
|
});
|
180
|
-
},
|
181
|
-
const { basic_rwd: i } = this.options,
|
182
|
-
if (
|
183
|
+
}, M = new WeakSet(), it = function(t, e, s) {
|
184
|
+
const { basic_rwd: i } = this.options, n = window.innerWidth < i, o = [...t.querySelectorAll("tr")];
|
185
|
+
if (n || !o.length)
|
183
186
|
return;
|
184
|
-
const
|
185
|
-
p(this,
|
186
|
-
},
|
187
|
+
const c = p(this, R, ot).call(this, o);
|
188
|
+
p(this, X, nt).call(this, t, c, e, s);
|
189
|
+
}, R = new WeakSet(), ot = function(t) {
|
187
190
|
const e = [], s = /* @__PURE__ */ new Set();
|
188
|
-
return t.forEach((i,
|
191
|
+
return t.forEach((i, n) => {
|
189
192
|
const o = [...i.children];
|
190
|
-
e[
|
191
|
-
let
|
192
|
-
o.forEach((
|
193
|
-
const
|
194
|
-
for (; e[
|
195
|
-
|
196
|
-
for (let
|
197
|
-
const
|
198
|
-
e[
|
199
|
-
for (let b = 0; b <
|
200
|
-
const
|
201
|
-
e[
|
202
|
-
el:
|
203
|
-
topRow:
|
204
|
-
leftCol:
|
205
|
-
rowspan:
|
206
|
-
colspan:
|
207
|
-
},
|
193
|
+
e[n] = [];
|
194
|
+
let c = 0;
|
195
|
+
o.forEach((l) => {
|
196
|
+
const a = +l.getAttribute("rowspan") || 1, d = +l.getAttribute("colspan") || 1;
|
197
|
+
for (; e[n][c] || s.has(`${n},${c}`); )
|
198
|
+
c++;
|
199
|
+
for (let u = 0; u < a; u++) {
|
200
|
+
const h = n + u;
|
201
|
+
e[h] ?? (e[h] = []);
|
202
|
+
for (let b = 0; b < d; b++) {
|
203
|
+
const m = c + b;
|
204
|
+
e[h][m] = {
|
205
|
+
el: u === 0 && b === 0 ? l : null,
|
206
|
+
topRow: n,
|
207
|
+
leftCol: c,
|
208
|
+
rowspan: a,
|
209
|
+
colspan: d
|
210
|
+
}, u > 0 && s.add(`${h},${m}`);
|
208
211
|
}
|
209
212
|
}
|
210
|
-
|
213
|
+
c += d;
|
211
214
|
});
|
212
215
|
}), e;
|
213
|
-
},
|
216
|
+
}, I = new WeakSet(), at = function(t, e) {
|
214
217
|
var o;
|
215
|
-
const s = e.length, i = Array(s).fill(0),
|
216
|
-
for (let
|
217
|
-
for (let
|
218
|
-
const
|
219
|
-
if (
|
220
|
-
const
|
221
|
-
i[
|
218
|
+
const s = e.length, i = Array(s).fill(0), n = t.getBoundingClientRect().top;
|
219
|
+
for (let c = 0; c < s; c++)
|
220
|
+
for (let l = 0; l < (((o = e[c]) == null ? void 0 : o.length) || 0); l++) {
|
221
|
+
const a = e[c][l];
|
222
|
+
if (a != null && a.el) {
|
223
|
+
const d = a.el.getBoundingClientRect().top;
|
224
|
+
i[c] = d - n;
|
222
225
|
break;
|
223
226
|
}
|
224
227
|
}
|
225
228
|
return i;
|
226
|
-
},
|
227
|
-
var
|
228
|
-
const
|
229
|
-
for (let
|
230
|
-
for (let
|
231
|
-
const
|
232
|
-
if (
|
233
|
-
|
229
|
+
}, X = new WeakSet(), nt = function(t, e, s, i) {
|
230
|
+
var l;
|
231
|
+
const n = p(this, I, at).call(this, t, e), o = ((l = e[0]) == null ? void 0 : l.length) ?? 0, c = Array(o).fill(0);
|
232
|
+
for (let a = 0; a < o; a++)
|
233
|
+
for (let d = 0; d < e.length; d++) {
|
234
|
+
const u = e[d][a];
|
235
|
+
if (u != null && u.el) {
|
236
|
+
c[a] = u.el.offsetLeft;
|
234
237
|
break;
|
235
238
|
}
|
236
239
|
}
|
237
240
|
e.forEach(
|
238
|
-
(
|
239
|
-
if (!(
|
241
|
+
(a) => a.forEach((d) => {
|
242
|
+
if (!(d != null && d.el))
|
240
243
|
return;
|
241
|
-
const { el:
|
242
|
-
|
244
|
+
const { el: u, topRow: h, leftCol: b } = d, m = h < s, v = b < i;
|
245
|
+
u.style.position = "sticky", u.style.zIndex = m && v ? 3 : m ? 2 : v ? 1 : 0, u.style.backgroundColor = getComputedStyle(u).backgroundColor, m && (u.style.top = `${n[h]}px`), v && (u.style.left = `${c[b]}px`);
|
243
246
|
})
|
244
247
|
);
|
245
|
-
},
|
246
|
-
const
|
247
|
-
|
248
|
+
}, B = new WeakSet(), lt = function(t) {
|
249
|
+
const { markdownLink: e } = this.options;
|
250
|
+
new L.Renderer(), L.use({
|
251
|
+
extensions: [{
|
252
|
+
name: "center",
|
253
|
+
level: "block",
|
254
|
+
start(l) {
|
255
|
+
var a;
|
256
|
+
return (a = l.match(/==/)) == null ? void 0 : a.index;
|
257
|
+
},
|
258
|
+
tokenizer(l) {
|
259
|
+
const d = /^@center@(.+?)@center@/.exec(l);
|
260
|
+
if (d)
|
261
|
+
return {
|
262
|
+
type: "center",
|
263
|
+
raw: d[0],
|
264
|
+
text: d[1],
|
265
|
+
tokens: this.lexer.inlineTokens(d[1])
|
266
|
+
};
|
267
|
+
},
|
268
|
+
renderer(l) {
|
269
|
+
return `<div data-center='true'>${L.parser(l.tokens)}</div>`;
|
270
|
+
}
|
271
|
+
}]
|
272
|
+
});
|
273
|
+
const s = ["h2", "h3", "h4", "h5", "h6", "b", "del", "i", "em", "strong", "p", "ul", "ol", "li", "br", "span", "div"], i = ["data-center"], n = (l) => xt.sanitize(l, {
|
274
|
+
ALLOWED_TAGS: e ? [...s, "a"] : s,
|
275
|
+
ALLOWED_ATTR: e ? [...i, "href", "title", "target"] : i,
|
248
276
|
RETURN_TRUSTED_TYPE: !1
|
249
|
-
}),
|
250
|
-
t.querySelectorAll("td,th").forEach((
|
251
|
-
|
252
|
-
|
277
|
+
}), o = (l) => n(L.parse(l));
|
278
|
+
t.querySelectorAll("td,th").forEach((l) => {
|
279
|
+
l.innerHTML = l.textContent;
|
280
|
+
const a = l.textContent.trim().replace(/<[^>]*>/g, "");
|
281
|
+
l.innerHTML = o(a);
|
253
282
|
});
|
254
|
-
},
|
283
|
+
}, x = new WeakSet(), Y = function(t) {
|
255
284
|
const { params: e } = t.article;
|
256
|
-
return e.$video.length && new
|
257
|
-
},
|
285
|
+
return e.$video.length && new gt(e.$video), this;
|
286
|
+
}, N = new WeakSet(), ct = function(t) {
|
258
287
|
const { basic_rwd: e } = this.options, { params: s } = t.article;
|
259
288
|
if (!s.$swiper)
|
260
289
|
return;
|
261
|
-
const i =
|
290
|
+
const i = bt(), n = this;
|
262
291
|
let o = {
|
263
292
|
on: {
|
264
|
-
init(
|
265
|
-
const
|
266
|
-
s.$video.length && ([...
|
267
|
-
var b,
|
268
|
-
(b =
|
269
|
-
}),
|
293
|
+
init(a) {
|
294
|
+
const d = a.$el[0];
|
295
|
+
s.$video.length && ([...d.querySelectorAll("[video4-active]")].forEach((h) => {
|
296
|
+
var b, m;
|
297
|
+
(b = h.querySelector(vt.SETTINGS.videoButton)) == null || b.remove(), (m = h.querySelector(".overlay")) == null || m.remove(), h.removeAttribute("video4-active");
|
298
|
+
}), n.update());
|
270
299
|
},
|
271
|
-
observerUpdate(
|
272
|
-
|
300
|
+
observerUpdate(a) {
|
301
|
+
a.params.autoplay.enabled && (a.autoplay.start(), a.update());
|
273
302
|
}
|
274
303
|
},
|
275
304
|
observer: !0,
|
276
305
|
breakpoints: {}
|
277
306
|
};
|
278
307
|
if (s.$selector.setAttribute("img-swiper", "on"), s.$selector.classList.add(`swiper-${i}`), s.$selector.getAttribute("swiper-arrow") !== "off" && s.$selector.getAttribute("swiper-arrow")) {
|
279
|
-
const
|
280
|
-
|
281
|
-
const
|
282
|
-
|
308
|
+
const a = document.createElement("div");
|
309
|
+
a.className = `swiper-button-next swiper-${i}`, s.$swiperButtonCover.appendChild(a);
|
310
|
+
const d = document.createElement("div");
|
311
|
+
d.className = `swiper-button-prev swiper-${i}`, s.$swiperButtonCover.appendChild(d), o.navigation = {
|
283
312
|
nextEl: `.swiper-button-next.swiper-${i}`,
|
284
313
|
prevEl: `.swiper-button-prev.swiper-${i}`
|
285
314
|
};
|
286
315
|
}
|
287
316
|
if (s.$selector.getAttribute("swiper-nav") !== "off" || !s.$selector.getAttribute("swiper-nav")) {
|
288
|
-
const
|
289
|
-
|
317
|
+
const a = document.createElement("div");
|
318
|
+
a.className = `swiper-pagination swiper-${i}`, s.$swiper.appendChild(a), o.pagination = {
|
290
319
|
el: `.swiper-pagination.swiper-${i}`,
|
291
320
|
clickable: !0
|
292
321
|
};
|
@@ -297,20 +326,20 @@ k = new WeakSet(), Z = function() {
|
|
297
326
|
delay: 3e3,
|
298
327
|
disableOnInteraction: !1
|
299
328
|
}), (s.$selector.getAttribute("swiper-loop") !== "off" || !s.$selector.getAttribute("swiper-loop")) && (o.loop = !0), s.$selector.getAttribute("swiper-speed") && (o.speed = parseInt(s.$selector.getAttribute("swiper-speed"))), s.$selector.getAttribute("swiper-parallax") !== "off" && !s.$selector.getAttribute("swiper-loop") && (o.parallax = !0), s.$selector.getAttribute("swiper-pagination-dynamic") === "on" && (o.pagination.dynamicBullets = !0, o.pagination ? o.pagination.dynamicBullets = !0 : console.warn("pagination undefined"));
|
300
|
-
let
|
301
|
-
s.$swiper.querySelectorAll(".swiper-slide").length <=
|
302
|
-
const
|
303
|
-
return t.article.swiperList = [], t.article.swiperList.push(
|
304
|
-
},
|
329
|
+
let c = () => window.innerWidth > e && Number(s.$selector.getAttribute("swiper-num")) || 1;
|
330
|
+
s.$swiper.querySelectorAll(".swiper-slide").length <= c() && (o.navigation = !1, o.pagination = !1, o.autoplay = !1, o.loop = !1, s.$selector.querySelector(".swiper-button-cover").style.display = "none", s.$selector.querySelector(".swiper-pagination").style.display = "none", s.$swiper.classList.add("swiper-no-swiping"));
|
331
|
+
const l = new At(s.$swiper, o);
|
332
|
+
return t.article.swiperList = [], t.article.swiperList.push(l), this;
|
333
|
+
}, S = new WeakSet(), G = function(t) {
|
305
334
|
const { params: e } = t.article;
|
306
335
|
if (!e.$table)
|
307
336
|
return;
|
308
|
-
const s = t.getAttribute("freeze-table") === "on", i = parseInt(t.getAttribute("freeze-table-row") ?? "1", 10),
|
309
|
-
s && p(this,
|
337
|
+
const s = t.getAttribute("freeze-table") === "on", i = parseInt(t.getAttribute("freeze-table-row") ?? "1", 10), n = parseInt(t.getAttribute("freeze-table-col") ?? "1", 10), o = t.querySelector("table"), c = t.querySelector("._tipText"), l = t.offsetWidth, a = o.offsetWidth, d = l < a, u = e.markdown === "on", h = () => {
|
338
|
+
s && p(this, M, it).call(this, o, i, n), (s || d) && p(this, O, rt).call(this, t), u && p(this, B, lt).call(this, o), d ? (t.classList.add("overflow"), c.style.display = "flex") : (t.classList.remove("overflow"), c.style.display = "none");
|
310
339
|
};
|
311
|
-
return
|
340
|
+
return h(), window.addEventListener("resize", h), this;
|
312
341
|
};
|
313
|
-
let
|
342
|
+
let J = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", K = "ontouchend" in document.documentElement ? "touchend" : "mouseup", P = "ontouchmove" in document.documentElement ? "touchmove" : "mousemove";
|
314
343
|
function w(r) {
|
315
344
|
const t = window.getComputedStyle(r), e = t.transform || t.mozTransform;
|
316
345
|
if (e === "none")
|
@@ -333,15 +362,15 @@ function w(r) {
|
|
333
362
|
z: Number(i[14])
|
334
363
|
};
|
335
364
|
}
|
336
|
-
function
|
365
|
+
function k(r) {
|
337
366
|
const e = r.querySelector(".wrapper").querySelectorAll(".item");
|
338
367
|
let s = 0;
|
339
368
|
return e.forEach((i) => {
|
340
|
-
const
|
341
|
-
s += i.getBoundingClientRect().width + o +
|
369
|
+
const n = getComputedStyle(i), o = parseInt(n.marginLeft), c = parseInt(n.marginRight);
|
370
|
+
s += i.getBoundingClientRect().width + o + c;
|
342
371
|
}), s;
|
343
372
|
}
|
344
|
-
function
|
373
|
+
function F(r) {
|
345
374
|
if (w(r.slideWrapEl).x >= r.translateMin)
|
346
375
|
return "is-start";
|
347
376
|
if (w(r.slideWrapEl).x <= r.translateMax)
|
@@ -349,10 +378,10 @@ function P(r) {
|
|
349
378
|
if (w(r.slideWrapEl).x < r.translateMin && w(r.slideWrapEl).x > r.translateMax)
|
350
379
|
return "is-middle";
|
351
380
|
}
|
352
|
-
function
|
381
|
+
function kt(r) {
|
353
382
|
const t = r.el, e = t.querySelector(".wrapper");
|
354
|
-
e.addEventListener(
|
355
|
-
switch (r.isDown = !0, r.slidable && e.classList.add("dragging"),
|
383
|
+
e.addEventListener(J, function(s) {
|
384
|
+
switch (r.isDown = !0, r.slidable && e.classList.add("dragging"), J) {
|
356
385
|
case "mousedown":
|
357
386
|
r.startX = s.pageX;
|
358
387
|
break;
|
@@ -361,10 +390,10 @@ function Tt(r) {
|
|
361
390
|
break;
|
362
391
|
}
|
363
392
|
r.nowTranslateX = w(e).x;
|
364
|
-
}), e.addEventListener(
|
393
|
+
}), e.addEventListener(K, function(s) {
|
365
394
|
r.isDown = !1, e.classList.remove("dragging"), e.classList.remove("moving");
|
366
395
|
let i;
|
367
|
-
switch (
|
396
|
+
switch (P) {
|
368
397
|
case "mousemove":
|
369
398
|
i = s.pageX - r.startX;
|
370
399
|
break;
|
@@ -373,7 +402,7 @@ function Tt(r) {
|
|
373
402
|
break;
|
374
403
|
}
|
375
404
|
if (i === 0 && s.target.closest(".item")) {
|
376
|
-
if (
|
405
|
+
if (K === "mouseup" && s.button !== 0)
|
377
406
|
return;
|
378
407
|
e.querySelectorAll(".item").forEach((o) => {
|
379
408
|
o.classList.remove("active");
|
@@ -382,13 +411,13 @@ function Tt(r) {
|
|
382
411
|
r.slidable && r.resetPos(t);
|
383
412
|
}), e.addEventListener("mouseleave", function() {
|
384
413
|
r.isDown && r.slidable && (r.isDown = !1, e.classList.remove("dragging"), e.classList.remove("moving"), r.resetPos(t));
|
385
|
-
}), e.addEventListener(
|
414
|
+
}), e.addEventListener(P, function(s) {
|
386
415
|
if (r.draggable && r.slidable) {
|
387
416
|
if (!r.isDown)
|
388
417
|
return;
|
389
418
|
s.preventDefault();
|
390
419
|
let i;
|
391
|
-
switch (
|
420
|
+
switch (P) {
|
392
421
|
case "mousemove":
|
393
422
|
i = s.pageX - r.startX;
|
394
423
|
break;
|
@@ -398,16 +427,16 @@ function Tt(r) {
|
|
398
427
|
}
|
399
428
|
if (i !== 0) {
|
400
429
|
e.classList.add("moving");
|
401
|
-
const
|
430
|
+
const n = {
|
402
431
|
transition: "all 0ms ease 0s",
|
403
432
|
transform: `translate3d(${r.nowTranslateX + i}px,0,0)`
|
404
433
|
};
|
405
|
-
Object.assign(e.style,
|
434
|
+
Object.assign(e.style, n);
|
406
435
|
}
|
407
436
|
}
|
408
437
|
});
|
409
438
|
}
|
410
|
-
function
|
439
|
+
function Tt(r) {
|
411
440
|
const t = r.querySelectorAll("a");
|
412
441
|
for (var e = 0, s = t.length; e < s; e++)
|
413
442
|
t[e].draggable = !1;
|
@@ -418,9 +447,9 @@ class Rt {
|
|
418
447
|
speed: 300,
|
419
448
|
clickSwitch: !0,
|
420
449
|
breakpoint: !1
|
421
|
-
}, Object.assign(this.params, e), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = w(this.slideWrapEl).x, this.slideTotalWidth =
|
450
|
+
}, Object.assign(this.params, e), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = w(this.slideWrapEl).x, this.slideTotalWidth = k(this.el), this.translateMin = 0, this.translateMax = -Math.floor(
|
422
451
|
Math.abs(
|
423
|
-
|
452
|
+
k(this.el) - this.el.querySelector(".wrapper").getBoundingClientRect().width
|
424
453
|
)
|
425
454
|
), this.slidable = this.slideTotalWidth > Math.round(this.el.getBoundingClientRect().width) && (!this.params.breakpoint || window.innerWidth <= this.params.breakpoint), this.init();
|
426
455
|
}
|
@@ -428,18 +457,18 @@ class Rt {
|
|
428
457
|
const t = this;
|
429
458
|
t.slidable && (t.slideWrapEl.style.width = `${t.slideTotalWidth}px`, t.el.classList.add("slidable"), t.slideWrapEl.querySelector(".item.active") && t.moveActive()), window.addEventListener("resize", function() {
|
430
459
|
t.update();
|
431
|
-
}),
|
460
|
+
}), kt(t), Tt(t.el);
|
432
461
|
}
|
433
462
|
moveActive(t) {
|
434
|
-
const e = this, s = e.slideWrapEl.querySelector(".item.active"),
|
463
|
+
const e = this, s = e.slideWrapEl.querySelector(".item.active"), n = s.previousElementSibling ? s.offsetLeft - e.el.clientWidth / 2 + s.clientWidth / 2 : 0;
|
435
464
|
if (e.slidable) {
|
436
|
-
if (-
|
465
|
+
if (-n < 0 && -n > e.translateMax) {
|
437
466
|
const o = {
|
438
467
|
transition: `all ${t || 0}ms ease 0s`,
|
439
|
-
transform: `translate3d(-${
|
468
|
+
transform: `translate3d(-${n}px,0,0)`
|
440
469
|
};
|
441
470
|
Object.assign(e.slideWrapEl.style, o);
|
442
|
-
} else if (-
|
471
|
+
} else if (-n >= 0) {
|
443
472
|
const o = {
|
444
473
|
transition: `all ${t || 0}ms ease 0s`,
|
445
474
|
transform: "translate3d(0,0,0)"
|
@@ -456,7 +485,7 @@ class Rt {
|
|
456
485
|
e.slideWrapEl.addEventListener(
|
457
486
|
"transitionend",
|
458
487
|
function() {
|
459
|
-
switch (e.nowTranslateX = w(e.slideWrapEl).x,
|
488
|
+
switch (e.nowTranslateX = w(e.slideWrapEl).x, F(e)) {
|
460
489
|
case "is-start":
|
461
490
|
e.el.classList.add("is-start"), e.el.classList.remove("is-end");
|
462
491
|
break;
|
@@ -471,7 +500,7 @@ class Rt {
|
|
471
500
|
!1
|
472
501
|
);
|
473
502
|
else
|
474
|
-
switch (e.nowTranslateX = w(e.slideWrapEl).x,
|
503
|
+
switch (e.nowTranslateX = w(e.slideWrapEl).x, F(e)) {
|
475
504
|
case "is-start":
|
476
505
|
e.el.classList.add("is-start"), e.el.classList.remove("is-end");
|
477
506
|
break;
|
@@ -486,7 +515,7 @@ class Rt {
|
|
486
515
|
}
|
487
516
|
resetPos() {
|
488
517
|
const t = this;
|
489
|
-
switch (
|
518
|
+
switch (F(t)) {
|
490
519
|
case "is-start":
|
491
520
|
t.el.classList.add("is-start"), t.el.classList.remove("is-end"), Object.assign(t.slideWrapEl.style, {
|
492
521
|
transition: `all ${t.params.speed}ms ease 0s`,
|
@@ -506,14 +535,14 @@ class Rt {
|
|
506
535
|
}
|
507
536
|
update() {
|
508
537
|
const t = this;
|
509
|
-
t.el.querySelector(".wrapper").removeAttribute("style"), t.slideTotalWidth =
|
538
|
+
t.el.querySelector(".wrapper").removeAttribute("style"), t.slideTotalWidth = k(t.el), t.translateMax = -Math.floor(
|
510
539
|
Math.abs(
|
511
|
-
|
540
|
+
k(t.el) - t.el.querySelector(".wrapper").getBoundingClientRect().width
|
512
541
|
)
|
513
542
|
), t.slidable = t.slideTotalWidth > Math.round(t.el.getBoundingClientRect().width) && (!t.params.breakpoint || window.innerWidth <= t.params.breakpoint), t.slidable ? (t.slideWrapEl.style.width = `${t.slideTotalWidth}px`, t.el.classList.add("slidable"), t.slideWrapEl.querySelector(".item.active") && t.moveActive()) : (t.el.classList.remove("slidable"), t.el.classList.remove("is-start"), t.el.classList.remove("is-end"), t.slideWrapEl.removeAttribute("style"));
|
514
543
|
}
|
515
544
|
}
|
516
|
-
const
|
545
|
+
const Q = (r) => {
|
517
546
|
if (r == "facebook")
|
518
547
|
return "https://www.facebook.com/sharer/sharer.php?u=";
|
519
548
|
if (r == "line")
|
@@ -525,75 +554,75 @@ const K = (r) => {
|
|
525
554
|
if (r == "telegram")
|
526
555
|
return "https://telegram.me/share/url?url=";
|
527
556
|
};
|
528
|
-
var
|
557
|
+
var D, dt, z, ut, H, pt;
|
529
558
|
class It {
|
530
559
|
constructor(t, e = {}) {
|
531
|
-
|
532
|
-
|
533
|
-
|
560
|
+
g(this, D);
|
561
|
+
g(this, z);
|
562
|
+
g(this, H);
|
534
563
|
this.__storage__ = {
|
535
564
|
el: t,
|
536
565
|
options: e
|
537
|
-
}, p(this,
|
566
|
+
}, p(this, D, dt).call(this);
|
538
567
|
}
|
539
568
|
}
|
540
|
-
|
541
|
-
const { el: t, options: e } = this.__storage__, { SETTINGS: s } =
|
542
|
-
!
|
543
|
-
},
|
569
|
+
D = new WeakSet(), dt = function() {
|
570
|
+
const { el: t, options: e } = this.__storage__, { SETTINGS: s } = $t;
|
571
|
+
!Z(t) || !U(t) || (this.elements = T(t), this.options = Object.assign({}, s, e), p(this, z, ut).call(this));
|
572
|
+
}, z = new WeakSet(), ut = function() {
|
544
573
|
const { elements: t, options: e } = this;
|
545
574
|
t.forEach((s) => {
|
546
575
|
s.querySelectorAll("[share-target]").forEach((i) => {
|
547
|
-
i.share = {}, i.share.instance = this, i.share.params = e, i.share.eventHandler = p(this,
|
576
|
+
i.share = {}, i.share.instance = this, i.share.params = e, i.share.eventHandler = p(this, H, pt), i.addEventListener("click", i.share.eventHandler);
|
548
577
|
});
|
549
578
|
});
|
550
|
-
},
|
579
|
+
}, H = new WeakSet(), pt = function() {
|
551
580
|
const { eventHandler: t, params: e } = this.share, s = this.getAttribute("share-target"), i = {
|
552
581
|
source: this.getAttribute("utm-source"),
|
553
582
|
medium: this.getAttribute("utm-medium"),
|
554
583
|
campaign: this.getAttribute("utm-campaign")
|
555
|
-
},
|
584
|
+
}, n = {
|
556
585
|
success: this.getAttribute("copy-success") || e.success,
|
557
586
|
text: this.getAttribute("copy-text") || e.text,
|
558
587
|
className: this.getAttribute("copy-class") || e.className,
|
559
588
|
duration: this.getAttribute("copy-duration") || e.duration
|
560
589
|
}, o = encodeURIComponent(document.URL);
|
561
|
-
let
|
590
|
+
let c = o;
|
562
591
|
if (s == "wechat") {
|
563
592
|
window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${o}&size=250x250`, "share to wechat", "width=300,height=300");
|
564
593
|
return;
|
565
594
|
}
|
566
595
|
if (s == "url") {
|
567
|
-
if (
|
596
|
+
if (U(".copied-wrapper"))
|
568
597
|
return;
|
569
|
-
document.querySelector("body").insertAdjacentHTML(
|
570
|
-
const
|
571
|
-
|
572
|
-
const
|
573
|
-
if (
|
598
|
+
document.querySelector("body").insertAdjacentHTML(yt.append, `<div class='copied-wrapper'><div class='text'>${n.success ? n.success : ""}</div><input id='clipboard' type='text' readonly></div>`);
|
599
|
+
const l = document.querySelector(".copied-wrapper");
|
600
|
+
n.className && l.classList.add(n.className), l.style.top = this.getBoundingClientRect().top + window.scrollY + "px", l.style.left = this.getBoundingClientRect().left + this.getBoundingClientRect().width / 2 + "px", l.style.display = "block";
|
601
|
+
const a = document.querySelector("#clipboard");
|
602
|
+
if (a.value = n.text ?? window.location.href, a.setSelectionRange(0, 9999), a.select(), document.execCommand("copy")) {
|
574
603
|
document.execCommand("copy");
|
575
|
-
const
|
576
|
-
|
577
|
-
const
|
604
|
+
const d = document.querySelector(".copied-wrapper"), u = document.querySelector(".copied-wrapper .text");
|
605
|
+
u.style.display = "block", u.style.opacity = 0;
|
606
|
+
const h = (m, v) => {
|
578
607
|
let y = 0;
|
579
|
-
const $ = 50,
|
580
|
-
y +=
|
581
|
-
b(
|
582
|
-
|
608
|
+
const $ = 50, E = $ / v, j = setInterval(function() {
|
609
|
+
y += E, m.style.opacity = y, y >= 1 && (clearInterval(j), setTimeout(function() {
|
610
|
+
b(m, 300, function() {
|
611
|
+
d.remove();
|
583
612
|
});
|
584
|
-
},
|
613
|
+
}, n.duration));
|
585
614
|
}, $);
|
586
|
-
}, b = (
|
615
|
+
}, b = (m, v, y) => {
|
587
616
|
let $ = 1;
|
588
|
-
const
|
589
|
-
$ -=
|
590
|
-
},
|
617
|
+
const E = 50, j = E / v, ht = setInterval(() => {
|
618
|
+
$ -= j, m.style.opacity = $, $ <= 0 && (clearInterval(ht), m.style.display = "none", y && y());
|
619
|
+
}, E);
|
591
620
|
};
|
592
|
-
|
621
|
+
h(u, 300);
|
593
622
|
}
|
594
623
|
return;
|
595
624
|
}
|
596
|
-
|
625
|
+
c = `${c}${i.source ? `?utm_source=${i.source}` : ""}${i.medium ? `&utm_medium${i.medium}` : ""}${i.campaign ? `&utm_campaign${i.campaign}` : ""}`, c = c.replace("?", "%3F").replace(new RegExp("&", "g"), "%26"), s == "line" ? window.open(`${Q(s)}${o}`) : window.open(`${Q(s)}${c}"e=${c}`), this.removeEventListener("click", t), setTimeout(() => {
|
597
626
|
this.addEventListener("click", t);
|
598
627
|
}, 100);
|
599
628
|
};
|
@@ -614,6 +643,6 @@ export {
|
|
614
643
|
Gt as Ripple4,
|
615
644
|
It as Share4,
|
616
645
|
Jt as Tab4,
|
617
|
-
|
646
|
+
gt as Video4
|
618
647
|
};
|
619
648
|
//# sourceMappingURL=fesd-bundle.js.map
|