@xwadex/fesd 0.0.45 → 0.0.47

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