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