@xwadex/fesd 0.0.14-re.30 → 0.0.14-re.32

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.
@@ -1,21 +1,21 @@
1
- var Ft = (i, e, t) => {
2
- if (!e.has(i))
1
+ var Z = (r, e, t) => {
2
+ if (!e.has(r))
3
3
  throw TypeError("Cannot " + t);
4
4
  };
5
- var d = (i, e, t) => {
6
- if (e.has(i))
5
+ var d = (r, e, t) => {
6
+ if (e.has(r))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
- e instanceof WeakSet ? e.add(i) : e.set(i, t);
8
+ e instanceof WeakSet ? e.add(r) : e.set(r, t);
9
9
  };
10
- var o = (i, e, t) => (Ft(i, e, "access private method"), t);
11
- import { i as $t, a as ut, g as Lt, v as Ut, c as Vt, S as Jt, b as bt, d as Kt, e as Yt, f as A, s as Qt, m as y, h as $ } from "./image-preview-bundle.js";
12
- import { A as we, k as ye, C as Ee, j as $e, D as Le, l as Ae, I as Se, M as xe, R as ke, T as Te } from "./image-preview-bundle.js";
13
- const I = () => {
14
- const i = navigator.userAgent, e = {
10
+ var l = (r, e, t) => (Z(r, e, "access private method"), t);
11
+ import { i as P, a as X, g as F, v as ee, c as te, S as se, b as re, d as ie, e as oe, f as ae, s as ne } from "./image-preview-bundle.js";
12
+ import { A as Ae, j as xe, C as Se, h as Ee, D as Ce, m as Le, I as qe, k as We, M as ke, l as Te, R as _e, T as Me } from "./image-preview-bundle.js";
13
+ const $ = () => {
14
+ const r = navigator.userAgent, e = {
15
15
  // Firefox 1.0+
16
16
  isFirefox: typeof InstallTrigger < "u",
17
17
  // Opera 8.0+
18
- isOpera: !!window.opr && !!opr.addons || !!window.opera || i.indexOf(" OPR/") >= 0,
18
+ isOpera: !!window.opr && !!opr.addons || !!window.opera || r.indexOf(" OPR/") >= 0,
19
19
  // Internet Explorer 6-11
20
20
  isIE: (
21
21
  /*@cc_on!@*/
@@ -24,95 +24,95 @@ const I = () => {
24
24
  // Edge 20+
25
25
  isEdge: !document.documentMode && !!window.StyleMedia,
26
26
  // Edge (based on chromium) detection
27
- isEdgeChromium: /\sedg\//i.test(i) || /edg([ea]|ios)/i.test(i),
27
+ isEdgeChromium: /\sedg\//i.test(r) || /edg([ea]|ios)/i.test(r),
28
28
  // Safari 3.0+ "[object HTMLElementConstructor]"
29
- isSafari: !/chrome|crios|crmo/i.test(i) && /safari/i.test(i),
29
+ isSafari: !/chrome|crios|crmo/i.test(r) && /safari/i.test(r),
30
30
  // Chrome 1 - 79
31
- isChrome: !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime) || /chrome|crios|crmo/i.test(i)
31
+ isChrome: !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime) || /chrome|crios|crmo/i.test(r)
32
32
  }, t = {
33
33
  // Android
34
- isAndroid: i.indexOf("Android") > -1 || i.indexOf("Adr") > -1,
34
+ isAndroid: r.indexOf("Android") > -1 || r.indexOf("Adr") > -1,
35
35
  // iOS | ipad
36
- isiOS: i.indexOf("Mac") > -1 && "ontouchend" in document
36
+ isiOS: r.indexOf("Mac") > -1 && "ontouchend" in document
37
37
  }, s = {
38
38
  // window
39
- isWindows: i.indexOf("Win") > -1,
39
+ isWindows: r.indexOf("Win") > -1,
40
40
  // macos
41
- isMacOS: i.indexOf("Mac") > -1,
41
+ isMacOS: r.indexOf("Mac") > -1,
42
42
  // UNIX
43
- isUNIX: i.indexOf("X11") > -1,
43
+ isUNIX: r.indexOf("X11") > -1,
44
44
  // Linux
45
- isLinux: i.indexOf("Linux") > -1
45
+ isLinux: r.indexOf("Linux") > -1
46
46
  };
47
47
  return { browser: e, mobile: t, os: s };
48
- }, Zt = () => {
49
- const { browser: i } = I();
50
- return Object.keys(i).find((e) => {
51
- if (i[e])
52
- return i[e];
48
+ }, le = () => {
49
+ const { browser: r } = $();
50
+ return Object.keys(r).find((e) => {
51
+ if (r[e])
52
+ return r[e];
53
53
  });
54
- }, te = () => {
55
- const { mobile: i } = I();
56
- return Object.keys(i).some((e) => {
57
- if (i[e])
58
- return i[e];
54
+ }, ce = () => {
55
+ const { mobile: r } = $();
56
+ return Object.keys(r).some((e) => {
57
+ if (r[e])
58
+ return r[e];
59
59
  });
60
- }, ee = () => {
61
- const { os: i } = I();
62
- return Object.keys(i).find((e) => {
63
- if (i[e])
64
- return i[e];
60
+ }, de = () => {
61
+ const { os: r } = $();
62
+ return Object.keys(r).find((e) => {
63
+ if (r[e])
64
+ return r[e];
65
65
  });
66
- }, se = () => console.dir(I());
67
- function ue() {
66
+ }, ue = () => console.dir($());
67
+ function be() {
68
68
  return {
69
- init: I,
70
- isBrowser4: Zt,
71
- isMobile4: te,
72
- isOs4: ee,
73
- logs: se
69
+ init: $,
70
+ isBrowser4: le,
71
+ isMobile4: ce,
72
+ isOs4: de,
73
+ logs: ue
74
74
  };
75
75
  }
76
- const g = (i, e, t) => {
77
- i && (bt(i) ? i.forEach((s) => s.style[e] = t) : i.style[e] = t);
76
+ const u = (r, e, t) => {
77
+ r && (re(r) ? r.forEach((s) => s.style[e] = t) : r.style[e] = t);
78
78
  };
79
- var B, At, X, St, W, pt, R, xt, q, mt, G, kt;
80
- class pe {
79
+ var C, U, L, V, f, B, q, z, y, R, W, G;
80
+ class we {
81
81
  constructor(e, t = {}) {
82
- d(this, B);
83
- d(this, X);
82
+ d(this, C);
83
+ d(this, L);
84
84
  // 取得元件上的設定值
85
- d(this, W);
85
+ d(this, f);
86
86
  // 設置設定值的 CSS 樣式
87
- d(this, R);
88
87
  d(this, q);
89
- d(this, G);
90
- !$t(e) || !ut(e) || (this.__storage__ = {
88
+ d(this, y);
89
+ d(this, W);
90
+ !P(e) || !X(e) || (this.__storage__ = {
91
91
  el: e,
92
92
  options: t
93
- }, this.active = "data-article-active", o(this, B, At).call(this));
93
+ }, this.active = "data-article-active", l(this, C, U).call(this));
94
94
  }
95
95
  update() {
96
96
  const { elements: e } = this;
97
97
  e.forEach((t) => {
98
98
  t.querySelectorAll("._article").forEach((s) => {
99
- s.article = {}, s.article.parent = t, s.article.params = o(this, W, pt).call(this, s), o(this, q, mt).call(this, s);
99
+ s.article = {}, s.article.parent = t, s.article.params = l(this, f, B).call(this, s), l(this, y, R).call(this, s);
100
100
  });
101
101
  });
102
102
  }
103
103
  }
104
- B = new WeakSet(), At = function() {
105
- const { el: e, options: t } = this.__storage__, { SETTINGS: s } = Kt;
106
- this.elements = Lt(e + `:not([${this.active}])`), this.options = Object.assign({}, s, t), o(this, X, St).call(this);
107
- }, X = new WeakSet(), St = function() {
104
+ C = new WeakSet(), U = function() {
105
+ const { el: e, options: t } = this.__storage__, { SETTINGS: s } = ie;
106
+ this.elements = F(e + `:not([${this.active}])`), this.options = Object.assign({}, s, t), l(this, L, V).call(this);
107
+ }, L = new WeakSet(), V = function() {
108
108
  const { elements: e } = this;
109
109
  e.forEach((t) => {
110
110
  t.setAttribute(this.active, ""), t.querySelectorAll("._article").forEach((s) => {
111
- var a, n;
112
- s.article = {}, s.article.parent = t, s.article.params = o(this, W, pt).call(this, s), s.article.methods = {}, s.article.methods.update = this.update, o(n = o(a = o(this, R, xt).call(this, s), q, mt).call(a, s), G, kt).call(n, s);
111
+ var i, a;
112
+ s.article = {}, s.article.parent = t, s.article.params = l(this, f, B).call(this, s), s.article.methods = {}, s.article.methods.update = this.update, l(a = l(i = l(this, q, z).call(this, s), y, R).call(i, s), W, G).call(a, s);
113
113
  });
114
114
  });
115
- }, W = new WeakSet(), pt = function(e) {
115
+ }, f = new WeakSet(), B = function(e) {
116
116
  return {
117
117
  // 元件本身
118
118
  $selector: e,
@@ -144,171 +144,171 @@ B = new WeakSet(), At = function() {
144
144
  buttonTextColor: e.getAttribute("button-textcolor"),
145
145
  descriptionColor: e.getAttribute("description-color")
146
146
  };
147
- }, R = new WeakSet(), xt = function(e) {
147
+ }, q = new WeakSet(), z = function(e) {
148
148
  const { params: t } = e.article;
149
- return g(t.$h, "color", t.hColor), g(t.$subH, "color", t.subHColor), g(t.$p, "color", t.pColor), g(t.$description, "color", t.descriptionColor), g(t.$button, "backgroundColor", t.buttonColor), g(t.$button, "color", t.buttonTextColor), t.buttonColorHover && t.$button && (t.$button.appendChild(document.createElement("span")), g(t.$button.querySelector("span"), "backgroundColor", t.buttonColorHover)), g(t.$backgroundWrap, "backgroundColor", t.typeFullColor), g(t.$contentWrap, "backgroundColor", t.typeFullBoxColor), this;
150
- }, q = new WeakSet(), mt = function(e) {
149
+ return u(t.$h, "color", t.hColor), u(t.$subH, "color", t.subHColor), u(t.$p, "color", t.pColor), u(t.$description, "color", t.descriptionColor), u(t.$button, "backgroundColor", t.buttonColor), u(t.$button, "color", t.buttonTextColor), t.buttonColorHover && t.$button && (t.$button.appendChild(document.createElement("span")), u(t.$button.querySelector("span"), "backgroundColor", t.buttonColorHover)), u(t.$backgroundWrap, "backgroundColor", t.typeFullColor), u(t.$contentWrap, "backgroundColor", t.typeFullBoxColor), this;
150
+ }, y = new WeakSet(), R = function(e) {
151
151
  const { params: t } = e.article;
152
- return t.$video.length && new Ut(t.$video), this;
153
- }, G = new WeakSet(), kt = function(e) {
152
+ return t.$video.length && new ee(t.$video), this;
153
+ }, W = new WeakSet(), G = function(e) {
154
154
  const { basic_rwd: t } = this.options, { params: s } = e.article;
155
155
  if (!s.$swiper)
156
156
  return;
157
- const a = Vt(), n = this;
158
- let r = {
157
+ const i = te(), a = this;
158
+ let o = {
159
159
  on: {
160
- init(c) {
161
- const h = c.$el[0];
162
- s.$video.length && ([...h.querySelectorAll("[video4-active]")].forEach((f) => {
163
- var b, m;
164
- (b = f.querySelector(Yt.SETTINGS.videoButton)) == null || b.remove(), (m = f.querySelector(".overlay")) == null || m.remove(), f.removeAttribute("video4-active");
165
- }), n.update());
160
+ init(n) {
161
+ const g = n.$el[0];
162
+ s.$video.length && ([...g.querySelectorAll("[video4-active]")].forEach((v) => {
163
+ var x, p;
164
+ (x = v.querySelector(oe.SETTINGS.videoButton)) == null || x.remove(), (p = v.querySelector(".overlay")) == null || p.remove(), v.removeAttribute("video4-active");
165
+ }), a.update());
166
166
  },
167
- observerUpdate(c) {
168
- c.params.autoplay.enabled && (c.autoplay.start(), c.update());
167
+ observerUpdate(n) {
168
+ n.params.autoplay.enabled && (n.autoplay.start(), n.update());
169
169
  }
170
170
  },
171
171
  observer: !0,
172
172
  breakpoints: {}
173
173
  };
174
- if (s.$selector.setAttribute("img-swiper", "on"), s.$selector.classList.add(`swiper-${a}`), s.$selector.getAttribute("swiper-arrow") !== "off" && s.$selector.getAttribute("swiper-arrow")) {
175
- const c = document.createElement("div");
176
- c.className = `swiper-button-next swiper-${a}`, s.$swiperButtonCover.appendChild(c);
177
- const h = document.createElement("div");
178
- h.className = `swiper-button-prev swiper-${a}`, s.$swiperButtonCover.appendChild(h), r.navigation = {
179
- nextEl: `.swiper-button-next.swiper-${a}`,
180
- prevEl: `.swiper-button-prev.swiper-${a}`
174
+ if (s.$selector.setAttribute("img-swiper", "on"), s.$selector.classList.add(`swiper-${i}`), s.$selector.getAttribute("swiper-arrow") !== "off" && s.$selector.getAttribute("swiper-arrow")) {
175
+ const n = document.createElement("div");
176
+ n.className = `swiper-button-next swiper-${i}`, s.$swiperButtonCover.appendChild(n);
177
+ const g = document.createElement("div");
178
+ g.className = `swiper-button-prev swiper-${i}`, s.$swiperButtonCover.appendChild(g), o.navigation = {
179
+ nextEl: `.swiper-button-next.swiper-${i}`,
180
+ prevEl: `.swiper-button-prev.swiper-${i}`
181
181
  };
182
182
  }
183
183
  if (s.$selector.getAttribute("swiper-nav") !== "off" || !s.$selector.getAttribute("swiper-nav")) {
184
- const c = document.createElement("div");
185
- c.className = `swiper-pagination swiper-${a}`, s.$swiper.appendChild(c), r.pagination = {
186
- el: `.swiper-pagination.swiper-${a}`,
184
+ const n = document.createElement("div");
185
+ n.className = `swiper-pagination swiper-${i}`, s.$swiper.appendChild(n), o.pagination = {
186
+ el: `.swiper-pagination.swiper-${i}`,
187
187
  clickable: !0
188
188
  };
189
189
  }
190
- Number.parseInt(s.$selector.getAttribute("swiper-num")) && (r.breakpoints[t] = {
190
+ Number.parseInt(s.$selector.getAttribute("swiper-num")) && (o.breakpoints[t] = {
191
191
  slidesPerView: s.$selector.getAttribute("swiper-num") ? Number.parseInt(s.$selector.getAttribute("swiper-num")) > 5 ? 5 : Number.parseInt(s.$selector.getAttribute("swiper-num")) : 1
192
- }), (s.$selector.getAttribute("swiper-autoplay") !== "off" || !s.$selector.getAttribute("swiper-autoplay")) && (r.autoplay = {
192
+ }), (s.$selector.getAttribute("swiper-autoplay") !== "off" || !s.$selector.getAttribute("swiper-autoplay")) && (o.autoplay = {
193
193
  delay: 3e3,
194
194
  disableOnInteraction: !1
195
- }), (s.$selector.getAttribute("swiper-loop") !== "off" || !s.$selector.getAttribute("swiper-loop")) && (r.loop = !0), s.$selector.getAttribute("swiper-speed") && (r.speed = parseInt(s.$selector.getAttribute("swiper-speed"))), s.$selector.getAttribute("swiper-parallax") !== "off" && !s.$selector.getAttribute("swiper-loop") && (r.parallax = !0), s.$selector.getAttribute("swiper-pagination-dynamic") === "on" && (r.pagination.dynamicBullets = !0);
196
- let l = () => window.innerWidth > this.basic_rwd && Number(s.$selector.getAttribute("swiper-num")) || 1;
197
- s.$swiper.querySelectorAll(".swiper-slide").length <= l() && (r.navigation = !1, r.pagination = !1, r.autoplay = !1, r.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"));
198
- const p = new Jt(s.$swiper, r);
199
- return e.article.swiperList = [], e.article.swiperList.push(p), this;
195
+ }), (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);
196
+ let c = () => window.innerWidth > this.basic_rwd && Number(s.$selector.getAttribute("swiper-num")) || 1;
197
+ 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"));
198
+ const h = new se(s.$swiper, o);
199
+ return e.article.swiperList = [], e.article.swiperList.push(h), this;
200
200
  };
201
- let gt = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", vt = "ontouchend" in document.documentElement ? "touchend" : "mouseup", ct = "ontouchmove" in document.documentElement ? "touchmove" : "mousemove";
202
- function L(i) {
203
- const e = window.getComputedStyle(i), t = e.transform || e.mozTransform;
201
+ let j = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", D = "ontouchend" in document.documentElement ? "touchend" : "mouseup", I = "ontouchmove" in document.documentElement ? "touchmove" : "mousemove";
202
+ function m(r) {
203
+ const e = window.getComputedStyle(r), t = e.transform || e.mozTransform;
204
204
  if (t === "none")
205
205
  return {
206
206
  x: 0,
207
207
  y: 0,
208
208
  z: 0
209
209
  };
210
- const s = t.includes("3d") ? "3d" : "2d", a = t.match(/matrix.*\((.+)\)/)[1].split(", ");
210
+ const s = t.includes("3d") ? "3d" : "2d", i = t.match(/matrix.*\((.+)\)/)[1].split(", ");
211
211
  if (s === "2d")
212
212
  return {
213
- x: Number(a[4]),
214
- y: Number(a[5]),
213
+ x: Number(i[4]),
214
+ y: Number(i[5]),
215
215
  z: 0
216
216
  };
217
217
  if (s === "3d")
218
218
  return {
219
- x: Number(a[12]),
220
- y: Number(a[13]),
221
- z: Number(a[14])
219
+ x: Number(i[12]),
220
+ y: Number(i[13]),
221
+ z: Number(i[14])
222
222
  };
223
223
  }
224
- function H(i) {
225
- const t = i.querySelector(".wrapper").querySelectorAll(".item");
224
+ function E(r) {
225
+ const t = r.querySelector(".wrapper").querySelectorAll(".item");
226
226
  let s = 0;
227
- return t.forEach((a) => {
228
- const n = getComputedStyle(a), r = parseInt(n.marginLeft), l = parseInt(n.marginRight);
229
- s += a.getBoundingClientRect().width + r + l;
227
+ return t.forEach((i) => {
228
+ const a = getComputedStyle(i), o = parseInt(a.marginLeft), c = parseInt(a.marginRight);
229
+ s += i.getBoundingClientRect().width + o + c;
230
230
  }), s;
231
231
  }
232
- function dt(i) {
233
- if (L(i.slideWrapEl).x >= i.translateMin)
232
+ function N(r) {
233
+ if (m(r.slideWrapEl).x >= r.translateMin)
234
234
  return "is-start";
235
- if (L(i.slideWrapEl).x <= i.translateMax)
235
+ if (m(r.slideWrapEl).x <= r.translateMax)
236
236
  return "is-end";
237
- if (L(i.slideWrapEl).x < i.translateMin && L(i.slideWrapEl).x > i.translateMax)
237
+ if (m(r.slideWrapEl).x < r.translateMin && m(r.slideWrapEl).x > r.translateMax)
238
238
  return "is-middle";
239
239
  }
240
- function ie(i) {
241
- const e = i.el, t = e.querySelector(".wrapper");
242
- t.addEventListener(gt, function(s) {
243
- switch (i.isDown = !0, i.slidable && t.classList.add("dragging"), gt) {
240
+ function pe(r) {
241
+ const e = r.el, t = e.querySelector(".wrapper");
242
+ t.addEventListener(j, function(s) {
243
+ switch (r.isDown = !0, r.slidable && t.classList.add("dragging"), j) {
244
244
  case "mousedown":
245
- i.startX = s.pageX;
245
+ r.startX = s.pageX;
246
246
  break;
247
247
  case "touchstart":
248
- i.startX = s.changedTouches[0].pageX;
248
+ r.startX = s.changedTouches[0].pageX;
249
249
  break;
250
250
  }
251
- i.nowTranslateX = L(t).x;
252
- }), t.addEventListener(vt, function(s) {
253
- i.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving");
254
- let a;
255
- switch (ct) {
251
+ r.nowTranslateX = m(t).x;
252
+ }), t.addEventListener(D, function(s) {
253
+ r.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving");
254
+ let i;
255
+ switch (I) {
256
256
  case "mousemove":
257
- a = s.pageX - i.startX;
257
+ i = s.pageX - r.startX;
258
258
  break;
259
259
  case "touchmove":
260
- a = s.changedTouches[0].pageX - i.startX;
260
+ i = s.changedTouches[0].pageX - r.startX;
261
261
  break;
262
262
  }
263
- if (a === 0 && s.target.closest(".item")) {
264
- if (vt === "mouseup" && s.button !== 0)
263
+ if (i === 0 && s.target.closest(".item")) {
264
+ if (D === "mouseup" && s.button !== 0)
265
265
  return;
266
- t.querySelectorAll(".item").forEach((r) => {
267
- r.classList.remove("active");
268
- }), s.target.closest(".item").classList.add("active"), i.moveActive(i.params.speed);
266
+ t.querySelectorAll(".item").forEach((o) => {
267
+ o.classList.remove("active");
268
+ }), s.target.closest(".item").classList.add("active"), r.moveActive(r.params.speed);
269
269
  } else
270
- i.slidable && i.resetPos(e);
270
+ r.slidable && r.resetPos(e);
271
271
  }), t.addEventListener("mouseleave", function() {
272
- i.isDown && i.slidable && (i.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving"), i.resetPos(e));
273
- }), t.addEventListener(ct, function(s) {
274
- if (i.draggable && i.slidable) {
275
- if (!i.isDown)
272
+ r.isDown && r.slidable && (r.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving"), r.resetPos(e));
273
+ }), t.addEventListener(I, function(s) {
274
+ if (r.draggable && r.slidable) {
275
+ if (!r.isDown)
276
276
  return;
277
277
  s.preventDefault();
278
- let a;
279
- switch (ct) {
278
+ let i;
279
+ switch (I) {
280
280
  case "mousemove":
281
- a = s.pageX - i.startX;
281
+ i = s.pageX - r.startX;
282
282
  break;
283
283
  case "touchmove":
284
- a = s.changedTouches[0].pageX - i.startX;
284
+ i = s.changedTouches[0].pageX - r.startX;
285
285
  break;
286
286
  }
287
- if (a !== 0) {
287
+ if (i !== 0) {
288
288
  t.classList.add("moving");
289
- const n = {
289
+ const a = {
290
290
  transition: "all 0ms ease 0s",
291
- transform: `translate3d(${i.nowTranslateX + a}px,0,0)`
291
+ transform: `translate3d(${r.nowTranslateX + i}px,0,0)`
292
292
  };
293
- Object.assign(t.style, n);
293
+ Object.assign(t.style, a);
294
294
  }
295
295
  }
296
296
  });
297
297
  }
298
- function ae(i) {
299
- const e = i.querySelectorAll("a");
298
+ function me(r) {
299
+ const e = r.querySelectorAll("a");
300
300
  for (var t = 0, s = e.length; t < s; t++)
301
301
  e[t].draggable = !1;
302
302
  }
303
- class me {
303
+ class ve {
304
304
  constructor(e, t) {
305
305
  this.el = typeof e == "string" ? document.querySelector(e) : e, this.slideWrapEl = this.el.querySelector(".wrapper"), this.params = {
306
306
  speed: 300,
307
307
  clickSwitch: !0,
308
308
  breakpoint: !1
309
- }, Object.assign(this.params, t), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = L(this.slideWrapEl).x, this.slideTotalWidth = H(this.el), this.translateMin = 0, this.translateMax = -Math.floor(
309
+ }, Object.assign(this.params, t), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = m(this.slideWrapEl).x, this.slideTotalWidth = E(this.el), this.translateMin = 0, this.translateMax = -Math.floor(
310
310
  Math.abs(
311
- H(this.el) - this.el.querySelector(".wrapper").getBoundingClientRect().width
311
+ E(this.el) - this.el.querySelector(".wrapper").getBoundingClientRect().width
312
312
  )
313
313
  ), this.slidable = this.slideTotalWidth > Math.round(this.el.getBoundingClientRect().width) && (!this.params.breakpoint || window.innerWidth <= this.params.breakpoint), this.init();
314
314
  }
@@ -316,35 +316,35 @@ class me {
316
316
  const e = this;
317
317
  e.slidable && (e.slideWrapEl.style.width = `${e.slideTotalWidth}px`, e.el.classList.add("slidable"), e.slideWrapEl.querySelector(".item.active") && e.moveActive()), window.addEventListener("resize", function() {
318
318
  e.update();
319
- }), ie(e), ae(e.el);
319
+ }), pe(e), me(e.el);
320
320
  }
321
321
  moveActive(e) {
322
- const t = this, s = t.slideWrapEl.querySelector(".item.active"), n = s.previousElementSibling ? s.offsetLeft - t.el.clientWidth / 2 + s.clientWidth / 2 : 0;
322
+ const t = this, s = t.slideWrapEl.querySelector(".item.active"), a = s.previousElementSibling ? s.offsetLeft - t.el.clientWidth / 2 + s.clientWidth / 2 : 0;
323
323
  if (t.slidable) {
324
- if (-n < 0 && -n > t.translateMax) {
325
- const r = {
324
+ if (-a < 0 && -a > t.translateMax) {
325
+ const o = {
326
326
  transition: `all ${e || 0}ms ease 0s`,
327
- transform: `translate3d(-${n}px,0,0)`
327
+ transform: `translate3d(-${a}px,0,0)`
328
328
  };
329
- Object.assign(t.slideWrapEl.style, r);
330
- } else if (-n >= 0) {
331
- const r = {
329
+ Object.assign(t.slideWrapEl.style, o);
330
+ } else if (-a >= 0) {
331
+ const o = {
332
332
  transition: `all ${e || 0}ms ease 0s`,
333
333
  transform: "translate3d(0,0,0)"
334
334
  };
335
- Object.assign(t.slideWrapEl.style, r);
335
+ Object.assign(t.slideWrapEl.style, o);
336
336
  } else {
337
- const r = {
337
+ const o = {
338
338
  transition: `all ${e || 0}ms ease 0s`,
339
339
  transform: `translate3d(${t.translateMax}px,0,0)`
340
340
  };
341
- Object.assign(t.slideWrapEl.style, r);
341
+ Object.assign(t.slideWrapEl.style, o);
342
342
  }
343
343
  if (e)
344
344
  t.slideWrapEl.addEventListener(
345
345
  "transitionend",
346
346
  function() {
347
- switch (t.nowTranslateX = L(t.slideWrapEl).x, dt(t)) {
347
+ switch (t.nowTranslateX = m(t.slideWrapEl).x, N(t)) {
348
348
  case "is-start":
349
349
  t.el.classList.add("is-start"), t.el.classList.remove("is-end");
350
350
  break;
@@ -359,7 +359,7 @@ class me {
359
359
  !1
360
360
  );
361
361
  else
362
- switch (t.nowTranslateX = L(t.slideWrapEl).x, dt(t)) {
362
+ switch (t.nowTranslateX = m(t.slideWrapEl).x, N(t)) {
363
363
  case "is-start":
364
364
  t.el.classList.add("is-start"), t.el.classList.remove("is-end");
365
365
  break;
@@ -374,7 +374,7 @@ class me {
374
374
  }
375
375
  resetPos() {
376
376
  const e = this;
377
- switch (dt(e)) {
377
+ switch (N(e)) {
378
378
  case "is-start":
379
379
  e.el.classList.add("is-start"), e.el.classList.remove("is-end"), Object.assign(e.slideWrapEl.style, {
380
380
  transition: `all ${e.params.speed}ms ease 0s`,
@@ -394,630 +394,114 @@ class me {
394
394
  }
395
395
  update() {
396
396
  const e = this;
397
- e.el.querySelector(".wrapper").removeAttribute("style"), e.slideTotalWidth = H(e.el), e.translateMax = -Math.floor(
397
+ e.el.querySelector(".wrapper").removeAttribute("style"), e.slideTotalWidth = E(e.el), e.translateMax = -Math.floor(
398
398
  Math.abs(
399
- H(e.el) - e.el.querySelector(".wrapper").getBoundingClientRect().width
399
+ E(e.el) - e.el.querySelector(".wrapper").getBoundingClientRect().width
400
400
  )
401
401
  ), e.slidable = e.slideTotalWidth > Math.round(e.el.getBoundingClientRect().width) && (!e.params.breakpoint || window.innerWidth <= e.params.breakpoint), e.slidable ? (e.slideWrapEl.style.width = `${e.slideTotalWidth}px`, e.el.classList.add("slidable"), e.slideWrapEl.querySelector(".item.active") && e.moveActive()) : (e.el.classList.remove("slidable"), e.el.classList.remove("is-start"), e.el.classList.remove("is-end"), e.slideWrapEl.removeAttribute("style"));
402
402
  }
403
403
  }
404
- const wt = (i) => {
405
- if (i == "facebook")
404
+ const H = (r) => {
405
+ if (r == "facebook")
406
406
  return "https://www.facebook.com/sharer/sharer.php?u=";
407
- if (i == "line")
407
+ if (r == "line")
408
408
  return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "http://line.naver.jp/R/msg/text/?" : "https://lineit.line.me/share/ui?url=";
409
- if (i == "twitter")
409
+ if (r == "twitter")
410
410
  return "https://twitter.com/intent/tweet?url=";
411
- if (i == "linkedin")
411
+ if (r == "linkedin")
412
412
  return `http://www.linkedin.com/shareArticle?mini=true&title=${document.title}&source=${document.title}&url=`;
413
- if (i == "telegram")
413
+ if (r == "telegram")
414
414
  return "https://telegram.me/share/url?url=";
415
415
  };
416
- var P, Tt, z, Wt, F, qt;
417
- class he {
416
+ var k, Y, T, J, _, K;
417
+ class fe {
418
418
  constructor(e, t = {}) {
419
- d(this, P);
420
- d(this, z);
421
- d(this, F);
419
+ d(this, k);
420
+ d(this, T);
421
+ d(this, _);
422
422
  this.__storage__ = {
423
423
  el: e,
424
424
  options: t
425
- }, o(this, P, Tt).call(this);
425
+ }, l(this, k, Y).call(this);
426
426
  }
427
427
  }
428
- P = new WeakSet(), Tt = function() {
429
- const { el: e, options: t } = this.__storage__, { SETTINGS: s } = Qt;
430
- !$t(e) || !ut(e) || (this.elements = Lt(e), this.options = Object.assign({}, s, t), o(this, z, Wt).call(this));
431
- }, z = new WeakSet(), Wt = function() {
428
+ k = new WeakSet(), Y = function() {
429
+ const { el: e, options: t } = this.__storage__, { SETTINGS: s } = ne;
430
+ !P(e) || !X(e) || (this.elements = F(e), this.options = Object.assign({}, s, t), l(this, T, J).call(this));
431
+ }, T = new WeakSet(), J = function() {
432
432
  const { elements: e, options: t } = this;
433
433
  e.forEach((s) => {
434
- s.querySelectorAll("[share-target]").forEach((a) => {
435
- a.share = {}, a.share.instance = this, a.share.params = t, a.share.eventHandler = o(this, F, qt), a.addEventListener("click", a.share.eventHandler);
434
+ s.querySelectorAll("[share-target]").forEach((i) => {
435
+ i.share = {}, i.share.instance = this, i.share.params = t, i.share.eventHandler = l(this, _, K), i.addEventListener("click", i.share.eventHandler);
436
436
  });
437
437
  });
438
- }, F = new WeakSet(), qt = function() {
439
- const { eventHandler: e, params: t } = this.share, s = this.getAttribute("share-target"), a = {
438
+ }, _ = new WeakSet(), K = function() {
439
+ const { eventHandler: e, params: t } = this.share, s = this.getAttribute("share-target"), i = {
440
440
  source: this.getAttribute("utm-source"),
441
441
  medium: this.getAttribute("utm-medium"),
442
442
  campaign: this.getAttribute("utm-campaign")
443
- }, n = {
443
+ }, a = {
444
444
  success: this.getAttribute("copy-success") || t.success,
445
445
  text: this.getAttribute("copy-text") || t.text,
446
446
  className: this.getAttribute("copy-class") || t.className,
447
447
  duration: this.getAttribute("copy-duration") || t.duration
448
- }, r = encodeURIComponent(document.URL);
449
- let l = r;
448
+ }, o = encodeURIComponent(document.URL);
449
+ let c = o;
450
450
  if (s == "wechat") {
451
- window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${r}&size=250x250`, "share to wechat", "width=300,height=300");
451
+ window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${o}&size=250x250`, "share to wechat", "width=300,height=300");
452
452
  return;
453
453
  }
454
454
  if (s == "url") {
455
- if (ut(".copied-wrapper"))
455
+ if (X(".copied-wrapper"))
456
456
  return;
457
- document.querySelector("body").insertAdjacentHTML(A.append, `<div class='copied-wrapper'><div class='text'>${n.success ? n.success : ""}</div><input id='clipboard' type='text' readonly></div>`);
458
- const p = document.querySelector(".copied-wrapper");
459
- n.className && p.classList.add(n.className), p.style.top = this.getBoundingClientRect().top + window.scrollY + "px", p.style.left = this.getBoundingClientRect().left + this.getBoundingClientRect().width / 2 + "px", p.style.display = "block";
460
- const c = document.querySelector("#clipboard");
461
- if (c.value = n.text ?? window.location.href, c.setSelectionRange(0, 9999), c.select(), document.execCommand("copy")) {
457
+ document.querySelector("body").insertAdjacentHTML(ae.append, `<div class='copied-wrapper'><div class='text'>${a.success ? a.success : ""}</div><input id='clipboard' type='text' readonly></div>`);
458
+ const h = document.querySelector(".copied-wrapper");
459
+ a.className && h.classList.add(a.className), h.style.top = this.getBoundingClientRect().top + window.scrollY + "px", h.style.left = this.getBoundingClientRect().left + this.getBoundingClientRect().width / 2 + "px", h.style.display = "block";
460
+ const n = document.querySelector("#clipboard");
461
+ if (n.value = a.text ?? window.location.href, n.setSelectionRange(0, 9999), n.select(), document.execCommand("copy")) {
462
462
  document.execCommand("copy");
463
- const h = document.querySelector(".copied-wrapper"), u = document.querySelector(".copied-wrapper .text");
464
- u.style.display = "block", u.style.opacity = 0;
465
- const f = (m, ot) => {
466
- let S = 0;
467
- const x = 50, O = x / ot, lt = setInterval(function() {
468
- S += O, m.style.opacity = S, S >= 1 && (clearInterval(lt), setTimeout(function() {
469
- b(m, 300, function() {
470
- h.remove();
463
+ const g = document.querySelector(".copied-wrapper"), A = document.querySelector(".copied-wrapper .text");
464
+ A.style.display = "block", A.style.opacity = 0;
465
+ const v = (p, M) => {
466
+ let b = 0;
467
+ const w = 50, S = w / M, O = setInterval(function() {
468
+ b += S, p.style.opacity = b, b >= 1 && (clearInterval(O), setTimeout(function() {
469
+ x(p, 300, function() {
470
+ g.remove();
471
471
  });
472
- }, n.duration));
473
- }, x);
474
- }, b = (m, ot, S) => {
475
- let x = 1;
476
- const O = 50, lt = O / ot, zt = setInterval(() => {
477
- x -= lt, m.style.opacity = x, x <= 0 && (clearInterval(zt), m.style.display = "none", S && S());
478
- }, O);
472
+ }, a.duration));
473
+ }, w);
474
+ }, x = (p, M, b) => {
475
+ let w = 1;
476
+ const S = 50, O = S / M, Q = setInterval(() => {
477
+ w -= O, p.style.opacity = w, w <= 0 && (clearInterval(Q), p.style.display = "none", b && b());
478
+ }, S);
479
479
  };
480
- f(u, 300);
480
+ v(A, 300);
481
481
  }
482
482
  return;
483
483
  }
484
- l = `${l}${a.source ? `?utm_source=${a.source}` : ""}${a.medium ? `&utm_medium${a.medium}` : ""}${a.campaign ? `&utm_campaign${a.campaign}` : ""}`, l = l.replace("?", "%3F").replace(new RegExp("&", "g"), "%26"), s == "line" ? window.open(`${wt(s)}${r}`) : window.open(`${wt(s)}${l}&quote=${l}`), this.removeEventListener("click", e), setTimeout(() => {
484
+ 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(`${H(s)}${o}`) : window.open(`${H(s)}${c}&quote=${c}`), this.removeEventListener("click", e), setTimeout(() => {
485
485
  this.addEventListener("click", e);
486
486
  }, 100);
487
487
  };
488
- function D(i) {
489
- const e = {};
490
- return [...i.attributes].forEach((t) => {
491
- if (t.name.includes("duration-")) {
492
- const s = t.name.replace("duration-", ""), a = t.nodeValue;
493
- e[s] = Number(a);
494
- }
495
- }), Object.keys(e).length === 0 ? null : e;
496
- }
497
- function yt(i) {
498
- if (D(i)) {
499
- let e;
500
- const t = Object.keys(D(i)).map((s) => ({
501
- value: s,
502
- point: s
503
- }));
504
- t.sort((s, a) => parseInt(a.value, 10) - parseInt(s.value, 10));
505
- for (let s = 0; s < t.length; s += 1) {
506
- const { point: a, value: n } = t[s];
507
- window.matchMedia(`(max-width: ${n}px)`).matches && (e = a);
508
- }
509
- return e ? Number(D(i)[e]) : i.s.options.duration;
510
- } else
511
- return i.s.options.duration;
512
- }
513
- function re(i) {
514
- const { behavior: e, continual: t, gap: s } = i.s.options, a = i.childNodes, n = document.createElement("div"), r = document.createElement("div");
515
- n.className = "animate-container", r.className = "animate-item", [...a].forEach((p) => {
516
- r.append(p);
517
- });
518
- function l() {
519
- const p = r.cloneNode(!0);
520
- return p.classList.add("clone"), i.s.cloneAnimation = null, i.s.cloneAnimateEl = p, p;
521
- }
522
- i.s.animation = null, i.s.animateEl = r, i.textContent = "", n.append(r), i.append(n), r.clientWidth * 2 + s >= i.clientWidth ? e === "normal" && t && n.append(l()) : i.s.options.continual = !1;
523
- }
524
- function v(i) {
525
- const { behavior: e, direction: t, continual: s } = i.s.options;
526
- let a = {};
527
- switch (e) {
528
- case "normal":
529
- let n, r;
530
- switch (t) {
531
- case "top":
532
- n = s ? "translate3d(0,100%,0)" : `translate3d(0,${i.clientHeight}px,0)`, r = "translate3d(0,-100%,0)", a.animate1 = [{ transform: n }, { transform: r }], s && (a.animate2 = [{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(0,-200%,0)" }]);
533
- break;
534
- case "right":
535
- n = s ? "translate3d(0,0,0)" : "translate3d(-100%,0,0)", r = s ? "translate3d(200%,0,0)" : `translate3d(${i.clientWidth}px,0,0)`, a.animate1 = [{ transform: n }, { transform: r }], s && (a.animate2 = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(100%,0,0)" }]);
536
- break;
537
- case "bottom":
538
- n = "translate3d(0,-100%,0)", r = s ? "translate3d(0,100%,0)" : `translate3d(0,${i.clientHeight}px,0)`, a.animate1 = [{ transform: n }, { transform: r }], s && (a.animate2 = [{ transform: "translate3d(0,-200%,0)" }, { transform: "translate3d(0,0,0)" }]);
539
- break;
540
- case "left":
541
- n = s ? "translate3d(100%,0,0)" : `translate3d(${i.clientWidth}px,0,0)`, r = "translate3d(-100%,0,0)", a.animate1 = [{ transform: n }, { transform: r }], s && (a.animate2 = [{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(-200%,0,0)" }]);
542
- break;
543
- }
544
- break;
545
- case "alternate":
546
- switch (t) {
547
- case "top":
548
- a.animate1 = [{ transform: `translate3d(0,calc(${i.clientHeight}px - 100%),0)` }, { transform: "translate3d(0,0,0)" }, { transform: `translate3d(0,calc(${i.clientHeight}px - 100%),0)` }];
549
- break;
550
- case "right":
551
- a.animate1 = [{ transform: "translate3d(0,0,0)" }, { transform: `translate3d(calc(-100% + ${i.clientWidth}px),0,0)` }, { transform: "translate3d(0,0,0)" }];
552
- break;
553
- case "bottom":
554
- a.animate1 = [{ transform: "translate3d(0,0,0)" }, { transform: `translate3d(0,calc(${i.clientHeight}px - 100%),0)` }, { transform: "translate3d(0,0,0)" }];
555
- break;
556
- case "left":
557
- a.animate1 = [{ transform: `translate3d(calc(-100% + ${i.clientWidth}px),0,0)` }, { transform: "translate3d(0,0,0)" }, { transform: `translate3d(calc(-100% + ${i.clientWidth}px),0,0)` }];
558
- break;
559
- }
560
- break;
561
- case "endStop":
562
- switch (t) {
563
- case "top":
564
- a.animate1 = [{ transform: `translate3d(0,${i.clientHeight}px,0)` }, { transform: "translate3d(0,0,0)" }];
565
- break;
566
- case "right":
567
- a.animate1 = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
568
- break;
569
- case "bottom":
570
- a.animate1 = [{ transform: "translate3d(0,-100%,0)" }, { transform: `translate3d(0,calc(${i.clientHeight}px - 100%),0)` }];
571
- break;
572
- case "left":
573
- a.animate1 = [{ transform: `translate3d(${i.clientWidth}px,0,0)` }, { transform: `translate3d(calc(${i.clientWidth}px - 100%),0,0)` }];
574
- break;
575
- }
576
- break;
577
- }
578
- return a;
579
- }
580
- function ne(i) {
581
- let e;
582
- return function(t) {
583
- e && clearTimeout(e), e = setTimeout(i, 200, t);
584
- };
585
- }
586
- var U, Ct, V, Mt, J, It, K, Ot;
587
- class fe extends HTMLElement {
588
- constructor() {
589
- super();
590
- d(this, U);
591
- d(this, V);
592
- d(this, J);
593
- d(this, K);
594
- this.initialize = !1;
595
- }
596
- static get observedAttributes() {
597
- return [];
598
- }
599
- attributeChangedCallback(t, s, a) {
600
- }
601
- connectedCallback() {
602
- this.initialize || (this.initialize = !0, o(this, U, Ct).call(this));
603
- }
604
- play() {
605
- this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
606
- }
607
- pause() {
608
- this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
609
- }
610
- }
611
- U = new WeakSet(), Ct = function() {
612
- const t = {
613
- direction: this.getAttribute("direction") || y.SETTINGS.direction,
614
- // up / down / left / right
615
- behavior: this.getAttribute("behavior") || y.SETTINGS.behavior,
616
- // normal / alternate / endStop
617
- duration: Number(this.getAttribute("duration")) || y.SETTINGS.duration,
618
- // ms
619
- durationBreakpoints: D(this) || y.SETTINGS.durationBreakpoints,
620
- autoplay: this.getAttribute("autoplay") || y.SETTINGS.autoplay,
621
- // normal / alternate / endStop
622
- pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : y.SETTINGS.pauseOnMouseenter,
623
- // true / false
624
- continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : y.SETTINGS.continual,
625
- // true / false
626
- gap: Number(this.getAttribute("gap")) || y.SETTINGS.gap
627
- };
628
- this.s = {}, this.s.options = t, this.s.nowDuration = yt(this), re(this), o(this, V, Mt).call(this);
629
- }, V = new WeakSet(), Mt = function() {
630
- const { direction: t, continual: s, gap: a } = this.s.options;
631
- switch (t) {
632
- case "left":
633
- case "right":
634
- this.style.cssText = `--continual-gap: ${a}px;`;
635
- break;
636
- case "top":
637
- case "bottom":
638
- s ? this.style.cssText = `height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${a}px;` : this.style.cssText = `min-height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${a}px;`;
639
- break;
640
- }
641
- o(this, J, It).call(this), o(this, K, Ot).call(this), s && this.classList.add("continual"), this.classList.add("m4-initialize");
642
- }, J = new WeakSet(), It = function() {
643
- const t = this, { direction: s, behavior: a, duration: n, autoplay: r, pauseOnMouseenter: l, continual: p } = t.s.options;
644
- let c;
645
- function h() {
646
- switch (a) {
647
- case "normal":
648
- t.s.animateEl.style.transform = `${v(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(v(t).animate1, {
649
- duration: t.s.nowDuration,
650
- iterations: 1 / 0
651
- }), p && (t.s.cloneAnimateEl.style.transform = `${v(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(v(t).animate2, {
652
- duration: t.s.nowDuration,
653
- delay: -t.s.nowDuration / 2,
654
- iterations: 1 / 0
655
- }));
656
- break;
657
- case "alternate":
658
- let b = function() {
659
- let m = [];
660
- switch (s) {
661
- case "top":
662
- u = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), f = parseInt(t.s.nowDuration / (u * 2)) * t.s.animateEl.scrollHeight, m = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
663
- break;
664
- case "right":
665
- u = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), f = parseInt(t.s.nowDuration / (u * 2)) * t.s.animateEl.scrollWidth, m = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
666
- break;
667
- case "bottom":
668
- u = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), f = parseInt(n / (u * 2)) * t.s.animateEl.scrollHeight, m = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
669
- break;
670
- case "left":
671
- u = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), f = parseInt(n / (u * 2)) * t.s.animateEl.scrollWidth, m = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
672
- break;
673
- }
674
- return m;
675
- }, u, f;
676
- (t.clientHeight > t.s.animateEl.scrollHeight || s === "left" || s === "right") && (t.s.animateEl.style.transform = `${b()[0].transform}`, t.s.animateEl.animate(b(), {
677
- duration: f,
678
- fill: "forwards"
679
- }).finished.then(() => {
680
- t.s.animation = t.s.animateEl.animate(v(t).animate1, {
681
- duration: t.s.nowDuration,
682
- iterations: 1 / 0
683
- });
684
- })), t.s.animation && t.s.animation.ready.then(() => {
685
- t.s.animateEl.classList.add("ready");
686
- });
687
- break;
688
- case "endStop":
689
- t.s.animateEl.style.transform = `${v(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(v(t).animate1, {
690
- duration: t.s.nowDuration,
691
- fill: "forwards"
692
- });
693
- break;
694
- }
695
- t.s.animateEl.classList.add("start"), r === !1 && (t.s.animateEl.classList.remove("start"), t.s.animation.cancel());
696
- }
697
- clearTimeout(c), c = setTimeout(
698
- () => {
699
- h();
700
- },
701
- r || 0
702
- ), t.addEventListener("mouseenter", function() {
703
- t.s.animation && l && t.s.animation.playState === "running" && t.pause();
704
- }), t.addEventListener("mouseleave", function() {
705
- t.s.animation && l && t.s.animation.playState === "paused" && t.play();
706
- });
707
- }, K = new WeakSet(), Ot = function() {
708
- const t = this;
709
- function s() {
710
- const a = t.s.animation.startTime, n = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
711
- t.s.nowDuration = yt(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(v(t).animate1, {
712
- duration: t.s.nowDuration,
713
- iterations: 1 / 0
714
- }), t.s.animation.startTime = a, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(v(t).animate2, {
715
- duration: t.s.nowDuration,
716
- delay: -t.s.nowDuration / 2,
717
- iterations: 1 / 0
718
- }), t.s.cloneAnimation.startTime = n);
719
- }
720
- window.addEventListener("resize", ne(s));
721
- };
722
- const j = function(i) {
723
- let e;
724
- return function(t) {
725
- e && clearTimeout(e), e = setTimeout(i, 200, t);
726
- };
727
- }, E = (i, e) => {
728
- if (bt(i)) {
729
- i.forEach((t) => {
730
- t.classList.add(e);
731
- });
732
- return;
733
- }
734
- i.classList.add(e);
735
- }, w = (i, e) => {
736
- if (bt(i)) {
737
- i.forEach((t) => {
738
- t.classList.remove(e);
739
- });
740
- return;
741
- }
742
- i.classList.remove(e);
743
- };
744
- var Y, Ht, Q, Dt, Z, Nt, C, ht, k, N, tt, _t;
745
- class Et {
746
- constructor(e) {
747
- // 初始化
748
- d(this, Y);
749
- // 左右箭頭事件綁定
750
- d(this, Q);
751
- // 左右拖拉事件綁定
752
- d(this, Z);
753
- // 卷軸位置判斷
754
- d(this, C);
755
- // 隱藏按鈕判斷
756
- d(this, k);
757
- // 選項事件綁定
758
- d(this, tt);
759
- this.$element = e, this.option = e.s.option.drag, o(this, Y, Ht).call(this);
760
- }
761
- // 更新 active 位置
762
- update(e) {
763
- const t = e.querySelector(".wrapper"), s = t == null ? void 0 : t.querySelector(".active");
764
- if (s) {
765
- const a = s.offsetLeft + s.getBoundingClientRect().width / 2 - t.getBoundingClientRect().width / 2;
766
- t.scrollTo({
767
- left: a,
768
- behavior: "smooth"
769
- });
770
- }
771
- }
772
- }
773
- Y = new WeakSet(), Ht = function() {
774
- var s, a, n, r, l, p;
775
- const e = this;
776
- if (!e.$element)
777
- return;
778
- e.$container = e.$element.querySelector(".drag-container"), e.$wrapper = e.$container.querySelector(".wrapper");
779
- const t = () => {
780
- var c, h;
781
- o(c = e, C, ht).call(c), o(h = e, k, N).call(h);
782
- };
783
- e.$wrapper.removeEventListener("scroll", t), e.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize", j(t)), window.addEventListener("resize", j(t)), (e.option.draggable || e.$element.s.type == "collapse") && o(s = e, Z, Nt).call(s), e.option.navigation && e.$element.s.type !== "collapse" && (e.$container.insertAdjacentHTML(
784
- A.prepend,
785
- `<div class="navigation">
786
- <div class="button prev">
787
- <div></div>
788
- </div>
789
- <div class="button next">
790
- <div></div>
791
- </div>
792
- </div>`
793
- ), e.$button = (a = e.$container) == null ? void 0 : a.querySelectorAll(".button"), o(n = e, Q, Dt).call(n)), o(r = e, C, ht).call(r), o(l = e, k, N).call(l), o(p = e, tt, _t).call(p);
794
- }, Q = new WeakSet(), Dt = function() {
795
- const e = this, { $wrapper: t, $button: s } = e, a = function() {
796
- const n = this.classList.contains("next"), r = parseInt(t.getBoundingClientRect().width * 0.7);
797
- t.scrollTo({
798
- left: n ? t.scrollLeft + r : t.scrollLeft - r,
799
- behavior: "smooth"
800
- }), setTimeout(() => {
801
- var l;
802
- o(l = e, k, N).call(l);
803
- }, 100);
804
- };
805
- s.forEach((n) => {
806
- n.removeEventListener("click", a), n.addEventListener("click", a);
807
- });
808
- }, Z = new WeakSet(), Nt = function() {
809
- const { $wrapper: e } = this;
810
- let t = !1, s = !1, a = 0, n = 0;
811
- const r = function(u) {
812
- u.preventDefault(), s = !1, t = !0, a = u.pageX - e.offsetLeft, n = e.scrollLeft;
813
- };
814
- e.removeEventListener("mousedown", r), e.addEventListener("mousedown", r);
815
- const l = function() {
816
- s = !1, t = !1;
817
- };
818
- e.removeEventListener("mouseleave", l), e.addEventListener("mouseleave", l);
819
- const p = function(u) {
820
- u.preventDefault(), t = !1;
821
- };
822
- e.removeEventListener("mouseup", p), e.addEventListener("mouseup", p);
823
- const c = function(u) {
824
- if (u.preventDefault(), s = !0, !t)
825
- return;
826
- const b = u.pageX - e.offsetLeft - a;
827
- e.scrollTo({
828
- left: n - b
829
- });
830
- };
831
- e.removeEventListener("mousemove", c), e.addEventListener("mousemove", c);
832
- const h = function(u) {
833
- s && (u.preventDefault(), u.stopPropagation());
834
- };
835
- e.querySelectorAll("a").forEach((u) => {
836
- u.removeEventListener("click", h), u.addEventListener("click", h);
837
- });
838
- }, C = new WeakSet(), ht = function() {
839
- const { $container: e, $wrapper: t } = this, s = t.scrollWidth - t.clientWidth, a = t.scrollLeft;
840
- s <= 0 || (E(e, "scrollable"), a == 0 ? (w(e, "scrollable"), E(t, "start"), w(t, "end")) : a >= s ? (w(e, "scrollable"), w(t, "start"), E(t, "end")) : (E(t, "center"), w(t, "start"), w(t, "end")));
841
- }, k = new WeakSet(), N = function() {
842
- const { $wrapper: e, $button: t, $element: s } = this;
843
- if (!t)
844
- return;
845
- const a = e.scrollWidth - e.clientWidth, n = e.scrollLeft;
846
- if (a <= 0) {
847
- E(t, "hide"), E(s, "noScrollable");
848
- return;
849
- }
850
- n == 0 ? t.forEach((r) => {
851
- if (r.classList.contains("next")) {
852
- w(r, "hide");
853
- return;
854
- }
855
- E(r, "hide");
856
- }) : n >= a ? t.forEach((r) => {
857
- if (r.classList.contains("next")) {
858
- E(r, "hide");
859
- return;
860
- }
861
- w(r, "hide");
862
- }) : w(t, "hide");
863
- }, tt = new WeakSet(), _t = function() {
864
- const { $element: e } = this, t = (a) => {
865
- if (this.option.selected) {
866
- const n = a.getAttribute("data-option").trim();
867
- e.setAttribute("m4-status", n);
868
- }
869
- };
870
- function s() {
871
- t(this);
872
- }
873
- this.$container.querySelectorAll(".item").forEach((a) => {
874
- a.removeEventListener("click", s), a.addEventListener("click", s);
875
- });
876
- };
877
- var et, jt, st, Bt, it, Xt, at, Rt;
878
- class oe {
879
- constructor(e) {
880
- // 初始化
881
- d(this, et);
882
- // 隱藏按鈕判斷
883
- d(this, st);
884
- // 展開箭頭事件綁定
885
- d(this, it);
886
- // 選項事件綁定
887
- d(this, at);
888
- this.$element = e, this.option = e.s.option.collapse, o(this, et, jt).call(this);
889
- }
890
- }
891
- et = new WeakSet(), jt = function() {
892
- this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), o(this, st, Bt).call(this) && o(this, it, Xt).call(this), o(this, at, Rt).call(this));
893
- }, st = new WeakSet(), Bt = function() {
894
- const e = this.$element.querySelector(".drag-container"), t = e.querySelector(".wrapper");
895
- return t.scrollWidth - t.clientWidth > 0 ? (e.insertAdjacentHTML(A.append, '<div class="open-collapse"></div>'), this.$button = e.querySelector(".open-collapse"), !0) : !1;
896
- }, it = new WeakSet(), Xt = function() {
897
- const { $element: e, $button: t } = this, s = function() {
898
- e.classList.contains("expand") ? e.classList.remove("expand") : e.classList.add("expand");
899
- };
900
- t.removeEventListener("click", s), t.addEventListener("click", s);
901
- }, at = new WeakSet(), Rt = function() {
902
- const { $element: e } = this, t = (a, n) => {
903
- if (e != null && e.classList.contains("expand") ? e == null || e.classList.remove("expand") : e == null || e.classList.add("expand"), this.option.selected) {
904
- const r = a.getAttribute("data-option").trim();
905
- e.setAttribute("m4-status", r);
906
- }
907
- };
908
- function s() {
909
- t(this);
910
- }
911
- this.$container.querySelectorAll(".item").forEach((a) => {
912
- a.removeEventListener("click", s), a.addEventListener("click", s);
913
- });
914
- };
915
- const le = (i) => {
916
- const { type: e, option: t, originalDomString: s } = i.s, a = document.createElement("div");
917
- return e == "drag" && (a.innerHTML = $.TEMPLATE[e]().trim(), a.querySelector(".drag-container .wrapper").insertAdjacentHTML(A.append, s)), e == "collapse" && (a.innerHTML = $.TEMPLATE[e](t == null ? void 0 : t.collapse).trim(), a.querySelector(".drag-container .wrapper").insertAdjacentHTML(A.append, s), a.querySelector(".collapse-container .wrapper").insertAdjacentHTML(A.append, s)), e == "dropdown" && (a.innerHTML = $.TEMPLATE[e](t == null ? void 0 : t.dropdown).trim(), a.querySelector("dropdown-el").insertAdjacentHTML(A.append, s)), a.children;
918
- };
919
- var rt, Gt, nt, Pt, M, ft, T, _;
920
- class be extends HTMLElement {
921
- constructor() {
922
- super();
923
- d(this, rt);
924
- d(this, nt);
925
- // 斷點設定
926
- d(this, M);
927
- // check type
928
- d(this, T);
929
- this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
930
- }
931
- static get observedAttributes() {
932
- return ["m4-type", "m4-status"];
933
- }
934
- attributeChangedCallback(t, s, a) {
935
- var n, r, l;
936
- switch (t) {
937
- case "m4-type":
938
- if (s === null || s === a)
939
- return;
940
- this.s.type = a, o(this, T, _).call(this);
941
- break;
942
- case "m4-status":
943
- if (s === a)
944
- return;
945
- const p = this.getAttribute("m4-type");
946
- if (p !== "drag" && p !== "collapse")
947
- return;
948
- this.querySelectorAll(".drag-container .item").forEach((c) => {
949
- c.classList.remove("active");
950
- }), (n = this.querySelector(`.drag-container .item[data-option="${a}"]`)) == null || n.classList.add("active"), p === "collapse" && (this.querySelectorAll(".collapse-container .item").forEach((c) => {
951
- c.classList.remove("active");
952
- }), (r = this.querySelector(`.collapse-container .item[data-option="${a}"]`)) == null || r.classList.add("active")), (l = this.constructor.drag) == null || l.update(this);
953
- break;
954
- }
955
- }
956
- connectedCallback() {
957
- this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, o(this, rt, Gt).call(this));
958
- }
959
- update() {
960
- o(this, M, ft).call(this);
961
- }
962
- }
963
- rt = new WeakSet(), Gt = function() {
964
- let t = {};
965
- this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? $.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
966
- const s = (a) => {
967
- if (a.type === "resize") {
968
- if (window.innerWidth === this.previousWidth)
969
- return;
970
- this.previousWidth = window.innerWidth;
971
- }
972
- this.update();
973
- };
974
- window.removeEventListener("resize", j(s)), window.addEventListener("resize", j(s)), this.s.option = {}, this.s.option.drag = Object.assign({}, $.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, $.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, $.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, $.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), o(this, nt, Pt).call(this);
975
- }, nt = new WeakSet(), Pt = function() {
976
- this.classList.add("m4-init"), o(this, M, ft).call(this);
977
- }, M = new WeakSet(), ft = function() {
978
- const t = Object.keys(this.s.option.breakpoint);
979
- if (!t.length) {
980
- o(this, T, _).call(this);
981
- return;
982
- }
983
- t.map((s) => Number(s)).sort((s, a) => a - s).some((s) => {
984
- var a, n, r, l;
985
- return window.innerWidth >= s && (this.s.type = (a = this.s.option.breakpoint[s]) == null ? void 0 : a.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (n = this.s.option.breakpoint[s]) == null ? void 0 : n.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (r = this.s.option.breakpoint[s]) == null ? void 0 : r.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (l = this.s.option.breakpoint[s]) == null ? void 0 : l.dropdown)), o(this, T, _).call(this), window.innerWidth >= s;
986
- });
987
- }, T = new WeakSet(), _ = function() {
988
- var n;
989
- const { type: t } = this.s;
990
- this.innerHTML = "", [...le(this)].forEach((r) => {
991
- this.append(r);
992
- });
993
- const s = this.querySelector(`.drag-container .item[data-option="${this.getAttribute("m4-status")}"]`), a = this.querySelector(`.collapse-container .item[data-option="${this.getAttribute("m4-status")}"]`);
994
- switch (s == null || s.classList.add("active"), a == null || a.classList.add("active"), t) {
995
- case "drag":
996
- this.constructor.drag = new Et(this);
997
- break;
998
- case "collapse":
999
- this.constructor.drag = new Et(this), this.constructor.collapse = new oe(this);
1000
- break;
1001
- }
1002
- (n = this.constructor.drag) == null || n.update(this);
1003
- };
1004
488
  export {
1005
- we as Anchor4,
1006
- ye as Aost4,
1007
- pe as Article4,
1008
- me as CategorySlider,
1009
- Ee as Collapse4,
1010
- $e as Configs,
1011
- ue as Detect4,
1012
- Le as Dropdown4,
1013
- Ae as ImagePreview,
1014
- Se as ImageValidate,
1015
- fe as Marquee4,
1016
- xe as Modal4,
1017
- be as Multipurpose4,
1018
- ke as Ripple4,
1019
- he as Share4,
1020
- Te as Tab4,
1021
- Ut as Video4
489
+ Ae as Anchor4,
490
+ xe as Aost4,
491
+ we as Article4,
492
+ ve as CategorySlider,
493
+ Se as Collapse4,
494
+ Ee as Configs,
495
+ be as Detect4,
496
+ Ce as Dropdown4,
497
+ Le as ImagePreview,
498
+ qe as ImageValidate,
499
+ We as Marquee4,
500
+ ke as Modal4,
501
+ Te as Multipurpose4,
502
+ _e as Ripple4,
503
+ fe as Share4,
504
+ Me as Tab4,
505
+ ee as Video4
1022
506
  };
1023
507
  //# sourceMappingURL=fesd-bundle.js.map