@xwadex/fesd 0.0.69 → 0.0.71

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,11 +1,11 @@
1
- import m from "jquery";
2
- import { OverlayScrollbars as tt } from "overlayscrollbars";
1
+ import p from "jquery";
2
+ import { OverlayScrollbars as et } from "overlayscrollbars";
3
3
  import "./vendor-bundle.js";
4
4
  import "validator";
5
5
  import "flatpickr";
6
- import ht from "vanilla-lazyload";
7
- import { unlock as Ct, lock as Ht } from "tua-body-scroll-lock";
8
- const Z = {
6
+ import gt from "vanilla-lazyload";
7
+ import { unlock as Mt, lock as Ot } from "tua-body-scroll-lock";
8
+ const J = {
9
9
  SETTINGS: {
10
10
  videoId: null,
11
11
  videoType: null,
@@ -66,7 +66,7 @@ const Z = {
66
66
  TEMPLATE() {
67
67
  return '<div class="player-container"><div class="player-wrapper"></div></div>';
68
68
  }
69
- }, It = {
69
+ }, Pt = {
70
70
  SETTINGS: {
71
71
  success: null,
72
72
  text: null,
@@ -104,7 +104,7 @@ const Z = {
104
104
  </div>
105
105
  `;
106
106
  }
107
- }, $ = {
107
+ }, D = {
108
108
  SETTINGS: {
109
109
  direction: "left",
110
110
  // 方向 - top || right || bottom || left
@@ -123,7 +123,7 @@ const Z = {
123
123
  gap: 30
124
124
  // 跑馬燈內容之間的距離 - Number
125
125
  }
126
- }, et = {
126
+ }, it = {
127
127
  SETTINGS: {
128
128
  scrollbar: {
129
129
  "scrollbar-track-color": "transparent",
@@ -151,7 +151,7 @@ const Z = {
151
151
  </div>`;
152
152
  return e || r;
153
153
  }
154
- }, qt = {
154
+ }, Nt = {
155
155
  SETTINGS: {
156
156
  basic_rwd: 900,
157
157
  markdownLink: !1,
@@ -160,7 +160,7 @@ const Z = {
160
160
  navigation: !1,
161
161
  scrollStep: !1
162
162
  }
163
- }, mt = {
163
+ }, ft = {
164
164
  SETTINGS: {
165
165
  scroller: window,
166
166
  class: "aost-show",
@@ -243,7 +243,7 @@ const Z = {
243
243
  return `<dropdown-el${s.placeholder ? ` d4-placeholder="${s.placeholder}"` : ""}${s.value ? ` d4-value="${s.value}"` : ""}></dropdown-el>`;
244
244
  }
245
245
  }
246
- }, gt = {
246
+ }, vt = {
247
247
  SETTINGS: {
248
248
  // 樣式 normal / process
249
249
  type: "normal",
@@ -263,7 +263,7 @@ const Z = {
263
263
  // 步驟狀態綁定
264
264
  stepOutput: ".step-show"
265
265
  }
266
- }, ft = {
266
+ }, bt = {
267
267
  SETTINGS: {
268
268
  collapseClass: "collapse",
269
269
  block: "[collapse-block]",
@@ -296,7 +296,7 @@ const Z = {
296
296
  update: null,
297
297
  afterUpdate: null
298
298
  }
299
- }, vt = {
299
+ }, yt = {
300
300
  SETTINGS: {
301
301
  // 是否要加 hover 效果?
302
302
  hover: !0,
@@ -311,28 +311,28 @@ const Z = {
311
311
  // hover 毫秒 ?
312
312
  speed: 600
313
313
  }
314
- }, _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
314
+ }, Me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
315
315
  __proto__: null,
316
316
  anchor4: F,
317
- aost4: mt,
318
- article4: qt,
319
- collapse4: ft,
320
- dropdown4: et,
321
- marquee4: $,
317
+ aost4: ft,
318
+ article4: Nt,
319
+ collapse4: bt,
320
+ dropdown4: it,
321
+ marquee4: D,
322
322
  modal4: P,
323
323
  multipurpose4: x,
324
- ripple4: vt,
325
- share4: It,
326
- tab4: gt,
327
- video4: Z
324
+ ripple4: yt,
325
+ share4: Pt,
326
+ tab4: vt,
327
+ video4: J
328
328
  }, Symbol.toStringTag, { value: "Module" })), E = {
329
329
  after: "afterend",
330
330
  append: "beforeend",
331
331
  prepend: "afterbegin"
332
- }, R = (s) => typeof s == "string" && s !== "", Q = (s) => s instanceof HTMLElement, X = (s) => s instanceof NodeList, T = (s) => A(s) !== null, j = (s) => typeof s == "function", A = (s) => Q(s) ? s : document.querySelector(s), S = (s) => X(s) ? s : document.querySelectorAll(s), Mt = () => Math.random().toString(36).substr(2, 9), Ot = (s) => {
332
+ }, R = (s) => typeof s == "string" && s !== "", Q = (s) => s instanceof HTMLElement, X = (s) => s instanceof NodeList, T = (s) => A(s) !== null, j = (s) => typeof s == "function", A = (s) => Q(s) ? s : document.querySelector(s), S = (s) => X(s) ? s : document.querySelectorAll(s), jt = () => Math.random().toString(36).substr(2, 9), zt = (s) => {
333
333
  const t = document.createElement("div");
334
334
  return t.innerHTML = s, t.childNodes;
335
- }, Pt = (s) => {
335
+ }, Bt = (s) => {
336
336
  try {
337
337
  JSON.parse(s);
338
338
  } catch {
@@ -341,7 +341,7 @@ const Z = {
341
341
  return JSON.parse(s);
342
342
  }, w = (s, t) => {
343
343
  console.warn(`[${s} warn]: ${t}`);
344
- }, nt = (s, t) => {
344
+ }, ot = (s, t) => {
345
345
  console.error(`[${s} error]: ${t}`);
346
346
  }, N = {
347
347
  on(s, t) {
@@ -372,7 +372,7 @@ const Z = {
372
372
  j(n) && n.apply(this, i);
373
373
  }), this) : this;
374
374
  }
375
- }, Nt = {
375
+ }, Gt = {
376
376
  easeInOutCirc(s, t, e, i) {
377
377
  return (s /= i / 2) < 1 ? -e / 2 * (Math.sqrt(1 - s * s) - 1) + t : e / 2 * (Math.sqrt(1 - (s -= 2) * s) + 1) + t;
378
378
  },
@@ -383,22 +383,22 @@ const Z = {
383
383
  return -e * ((s = s / i - 1) * s * s * s - 1) + t;
384
384
  }
385
385
  }, K = (s, t) => {
386
- const { target: e, container: i, spacer: n, speed: o, gap: a, easing: r, direction: l } = s, c = l === "horizontal", d = c ? "scrollLeft" : "scrollTop", u = c ? "left" : "top", h = c ? "width" : "height", p = T(i) ? A(i) : document.scrollingElement, g = p[d], b = T(e) ? A(e).getBoundingClientRect()[u] : 0 - g, f = T(n) ? A(n).getBoundingClientRect()[h] : 0, v = b - a - f, H = 15;
386
+ const { target: e, container: i, spacer: n, speed: o, gap: a, easing: r, direction: l } = s, c = l === "horizontal", d = c ? "scrollLeft" : "scrollTop", u = c ? "left" : "top", h = c ? "width" : "height", m = T(i) ? A(i) : document.scrollingElement, g = m[d], b = T(e) ? A(e).getBoundingClientRect()[u] : 0 - g, f = T(n) ? A(n).getBoundingClientRect()[h] : 0, v = b - a - f, H = 15;
387
387
  let y = 0;
388
388
  if (v === 0) return;
389
- const z = (q) => {
389
+ const z = (I) => {
390
390
  const M = A(e);
391
- t && t.emit(q, M), !t && s.on && j(s.on[q]) && s.on[q](M);
391
+ t && t.emit(I, M), !t && s.on && j(s.on[I]) && s.on[I](M);
392
392
  };
393
393
  z("beforeScroll");
394
- const I = () => {
394
+ const q = () => {
395
395
  y += H;
396
- const q = Nt[r](y, g, v, o);
397
- p[d] = q, y < o && requestAnimationFrame(I), y >= o && z("afterScroll");
396
+ const I = Gt[r](y, g, v, o);
397
+ m[d] = I, y < o && requestAnimationFrame(q), y >= o && z("afterScroll");
398
398
  };
399
- requestAnimationFrame(I);
399
+ requestAnimationFrame(q);
400
400
  };
401
- class bt {
401
+ class wt {
402
402
  constructor(t, e = {}) {
403
403
  this.__storage__ = {
404
404
  el: t,
@@ -461,17 +461,141 @@ class bt {
461
461
  }, r.delay);
462
462
  }
463
463
  }
464
- Object.assign(bt.prototype, N);
464
+ Object.assign(wt.prototype, N);
465
+ const Wt = {
466
+ CG_A: function(s) {
467
+ p("html,body").delay(100).animate(
468
+ { opacity: "0" },
469
+ {
470
+ queue: !0,
471
+ duration: 800,
472
+ easing: "easeOutQuad",
473
+ complete: function() {
474
+ window.location.assign(s);
475
+ }
476
+ }
477
+ );
478
+ },
479
+ CG_B: function(s) {
480
+ p("main").append("<div id='CG_Abg'><div class='CG_Abg1'></div><div class='CG_Abg2'></div></div>"), p("body").delay(1200).animate(
481
+ { opacity: "0" },
482
+ {
483
+ queue: !0,
484
+ duration: 200,
485
+ easing: "easeOutQuad",
486
+ complete: function() {
487
+ setTimeout(function() {
488
+ window.location.assign(s);
489
+ }, 100);
490
+ }
491
+ }
492
+ );
493
+ },
494
+ CG_C: function(s) {
495
+ p("main").append("<div id='CG_Bbg'></div>"), p("body").delay(1200).animate(
496
+ { opacity: "0" },
497
+ {
498
+ queue: !0,
499
+ duration: 200,
500
+ easing: "easeOutQuad",
501
+ complete: function() {
502
+ setTimeout(function() {
503
+ window.location.assign(s);
504
+ }, 100);
505
+ }
506
+ }
507
+ );
508
+ },
509
+ CG_D: function(s) {
510
+ p("main").append("<div id='CG_Cbg'><div class='CG_Cbg1'></div><div class='CG_Cbg2'></div></div>"), p("body").delay(1200).animate(
511
+ { opacity: "0" },
512
+ {
513
+ queue: !0,
514
+ duration: 200,
515
+ easing: "easeOutQuad",
516
+ complete: function() {
517
+ setTimeout(function() {
518
+ window.location.assign(s);
519
+ }, 100);
520
+ }
521
+ }
522
+ );
523
+ }
524
+ }, Rt = (s) => {
525
+ Wt.CG_A(s);
526
+ }, V = (s, t) => {
527
+ s.preventDefault();
528
+ const e = p(s.currentTarget), i = e.attr("target"), n = e.attr("href");
529
+ let o;
530
+ if (t) {
531
+ if (e.is("[data-nolink]")) {
532
+ s.stopPropagation(), s.preventDefault();
533
+ return;
534
+ }
535
+ e.hasClass("href-link") ? o = e.closest("[data-href]").attr("data-href") : o = n;
536
+ } else {
537
+ if (e.is("[data-nolink]")) {
538
+ s.stopPropagation(), s.preventDefault();
539
+ return;
540
+ }
541
+ e.hasClass("click-block") ? o = e.closest("[data-href]").attr("data-href") : o = n;
542
+ }
543
+ let r = window.location.pathname.replace("http://", "").split("/");
544
+ r = d(r);
545
+ const l = o.replace("http://", "");
546
+ let c = l.split("/");
547
+ c = d(c);
548
+ function d(u) {
549
+ const h = u.pop();
550
+ return h.indexOf("#") > -1 || h.indexOf("html") > 0 ? u.push(h) : (h == "" || u.push(h), u.push("index.html")), u;
551
+ }
552
+ i == "_blank" || s.ctrlKey || s.metaKey ? window.open(o) : l.indexOf("jpg") > -1 || l.indexOf("javascript") > -1 || Rt(o);
553
+ }, Xt = (s) => {
554
+ const e = p(s.currentTarget).closest("[data-href]");
555
+ e.hasClass("isHover") || e.addClass("isHover");
556
+ }, Ut = (s) => {
557
+ const e = p(s.currentTarget).closest("[data-href]");
558
+ e.hasClass("isHover") && e.removeClass("isHover");
559
+ };
560
+ let Tt = !0;
561
+ const Et = () => Tt, Oe = (s = !0) => {
562
+ Tt = s, p.easing.jswing = p.easing.swing, p.extend(p.easing, {
563
+ def: "easeOutQuad",
564
+ easeOutQuad: function(t, e, i, n, o) {
565
+ return -n * (e /= o) * (e - 2) + i;
566
+ },
567
+ easeInOutCirc: function(t, e, i, n, o) {
568
+ return (e /= o / 2) < 1 ? -n / 2 * (Math.sqrt(1 - e * e) - 1) + i : n / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + i;
569
+ }
570
+ }), s ? p("body").on("click", "a:not(.nocg), .href-link, [data-nolink]", (t) => V(t, s)) : p("body").on("click", "a:not(.nocg), .click-block, [data-nolink]", (t) => V(t, s)), p("body").on("mouseenter", "[data-href] a", (t) => Xt(t)), p("body").on("mouseleave", "[data-href] a", (t) => Ut(t));
571
+ };
465
572
  window.MODALS || (window.MODALS = {});
466
- const { MODALS: O } = window, jt = (s) => {
573
+ const { MODALS: O } = window, Yt = (s) => {
467
574
  const { TEMPLATE: t } = P, { childDom: e } = s, i = document.createElement("div");
468
575
  i.innerHTML = t(s.getAttribute("data-modal-template-setting"));
469
576
  const n = i.querySelector(".modal-content");
470
577
  return [...e].forEach((o) => {
471
578
  n.append(o);
472
579
  }), i.children[0];
580
+ }, Ft = (s) => {
581
+ const t = p(s);
582
+ if (!s) return;
583
+ const e = Et();
584
+ if (!e) return;
585
+ let i = e ? "a:not(.nocg), .href-link, [data-nolink]" : "a:not(.nocg), .click-block, [data-nolink]";
586
+ const n = t.find(i);
587
+ n.off("click.modalHrefLink"), n.on("click.modalHrefLink", function(o) {
588
+ V(o, e);
589
+ });
590
+ }, at = (s) => {
591
+ const t = p(s);
592
+ if (!s) return;
593
+ const e = Et();
594
+ if (!e) return;
595
+ let i = e ? "a:not(.nocg), .href-link, [data-nolink]" : "a:not(.nocg), .click-block, [data-nolink]";
596
+ t.find(i).off("click.modalHrefLink");
473
597
  };
474
- class yt extends HTMLElement {
598
+ class At extends HTMLElement {
475
599
  constructor() {
476
600
  super(), this.initialize = !1;
477
601
  }
@@ -487,15 +611,15 @@ class yt extends HTMLElement {
487
611
  #t() {
488
612
  const { ATTRS: t } = P;
489
613
  this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
490
- const e = this.getAttribute(t.id) || Mt();
614
+ const e = this.getAttribute(t.id) || jt();
491
615
  this.getAttribute(t.id) || (w(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), O[e] && w(`the ${t.id} "${e}" is already be used.`), O[e] = this, this.#s();
492
616
  }
493
617
  #s() {
494
- this.childDom = this.childNodes, this.template = jt(this), this.innerHTML = "", this.append(this.template), this.#e();
618
+ this.childDom = this.childNodes, this.template = Yt(this), this.innerHTML = "", this.append(this.template), this.#e();
495
619
  }
496
620
  #e() {
497
621
  const t = this.querySelector(".modal-scroller");
498
- this.__scroller__ = tt(t, {
622
+ this.__scroller__ = et(t, {
499
623
  overflowBehavior: {
500
624
  x: "hidden"
501
625
  },
@@ -549,30 +673,30 @@ class yt extends HTMLElement {
549
673
  }
550
674
  }
551
675
  open() {
552
- return this.setAttribute(":state", "open"), this;
676
+ return this.setAttribute(":state", "open"), Ft(this), this;
553
677
  }
554
678
  close() {
555
- return this.setAttribute(":state", "close"), this;
679
+ return this.setAttribute(":state", "close"), at(this), this;
556
680
  }
557
681
  destroy() {
558
- return this.setAttribute(":state", "destroy"), this;
682
+ return this.setAttribute(":state", "destroy"), at(this), this;
559
683
  }
560
684
  }
561
- Object.assign(yt.prototype, N);
562
- const { MODALS: it } = window, U = {}, wt = (s, t, ...e) => {
685
+ Object.assign(At.prototype, N);
686
+ const { MODALS: st } = window, U = {}, St = (s, t, ...e) => {
563
687
  if (!t) return;
564
688
  const i = s[t];
565
689
  i && j(i) && i.apply(s, e);
566
- }, Tt = (s, ...t) => {
690
+ }, Lt = (s, ...t) => {
567
691
  s && j(s) && s.apply(C, t);
568
- }, ot = (s, t) => {
569
- const { target: e } = s, i = it[e] || A(s.target);
570
- i && Et(s, t), i || zt(s, t);
571
- }, Et = (s, t) => {
572
- const { target: e, action: i, on: n, e: o } = s, a = it[e] || A(s.target);
692
+ }, rt = (s, t) => {
693
+ const { target: e } = s, i = st[e] || A(s.target);
694
+ i && _t(s, t), i || Zt(s, t);
695
+ }, _t = (s, t) => {
696
+ const { target: e, action: i, on: n, e: o } = s, a = st[e] || A(s.target);
573
697
  switch (["open", "close", "destroy"].forEach((l) => {
574
698
  a.once(l, () => {
575
- t && (t.emit(l, a, o), wt(t, n[l], a, o)), t || Tt(n[l], a);
699
+ t && (t.emit(l, a, o), St(t, n[l], a, o)), t || Lt(n[l], a);
576
700
  });
577
701
  }), i) {
578
702
  case "open":
@@ -589,19 +713,19 @@ const { MODALS: it } = window, U = {}, wt = (s, t, ...e) => {
589
713
  l === "close" && a.open(), l === "open" && a.close();
590
714
  break;
591
715
  }
592
- }, zt = async (s, t) => {
716
+ }, Zt = async (s, t) => {
593
717
  const { target: e, route: i, container: n, on: o, e: a } = s;
594
718
  if (!i) return w("modal4", "cannot find target or data-modal-route is not defined");
595
719
  const r = (l, ...c) => {
596
- t && (t.emit(l, ...c), wt(t, o[l], ...c)), t || Tt(o[l], ...c);
720
+ t && (t.emit(l, ...c), St(t, o[l], ...c)), t || Lt(o[l], ...c);
597
721
  };
598
722
  U[e] || (U[e] = !0, fetch(i).then((l) => (r("success", a), l.text())).then((l) => {
599
- const c = Ot(l), d = A(n) || A(P.SETTINGS.container);
723
+ const c = zt(l), d = A(n) || A(P.SETTINGS.container);
600
724
  [...c].forEach((h) => {
601
725
  d.append(h);
602
726
  });
603
- const u = it[e] || A(s.target);
604
- r("complete", u), Et(s, t), delete U[e];
727
+ const u = st[e] || A(s.target);
728
+ r("complete", u), _t(s, t), delete U[e];
605
729
  }).catch((l) => {
606
730
  r("error", l), delete U[e];
607
731
  }));
@@ -629,7 +753,7 @@ class C {
629
753
  }), this.emit("init");
630
754
  }
631
755
  #e(t) {
632
- const { defaultOptions: e, eventHandler: i, instance: n } = this.modal, o = Pt(this.getAttribute("data-modal-on"));
756
+ const { defaultOptions: e, eventHandler: i, instance: n } = this.modal, o = Bt(this.getAttribute("data-modal-on"));
633
757
  o && typeof o != "object" && w("modal4", "data-modal-on must be a json string.");
634
758
  const a = {
635
759
  target: this.getAttribute("data-modal-target") || e.target,
@@ -641,7 +765,7 @@ class C {
641
765
  };
642
766
  this.removeEventListener("click", i), setTimeout(() => {
643
767
  this.addEventListener("click", i);
644
- }, 200), ot(a, n);
768
+ }, 200), rt(a, n);
645
769
  }
646
770
  destroy() {
647
771
  const { elements: t } = this;
@@ -655,7 +779,7 @@ class C {
655
779
  /** static method 'open' */
656
780
  static open(t) {
657
781
  const { SETTINGS: e } = P, i = Object.assign({}, e, { on: {} }, t);
658
- ot(i);
782
+ rt(i);
659
783
  }
660
784
  /** static method 'defineMethods' */
661
785
  static defineMethods(t) {
@@ -667,24 +791,24 @@ class C {
667
791
  }
668
792
  }
669
793
  Object.assign(C.prototype, N);
670
- customElements.define("modern-modal", yt);
671
- const Bt = (s, t) => {
794
+ customElements.define("modern-modal", At);
795
+ const Jt = (s, t) => {
672
796
  const e = s === window ? s.innerHeight : s.getBoundingClientRect().height, i = s === window ? 0 : s.getBoundingClientRect().top;
673
797
  t.forEach((n) => {
674
- const { class: o, delay: a, start: r, end: l, repeat: c, instance: d } = n.aost, { top: u, bottom: h } = n.getBoundingClientRect(), p = e * (r / 100), g = e * (l / 100);
675
- if (u - i <= p && h - i >= g && n.offsetParent)
798
+ const { class: o, delay: a, start: r, end: l, repeat: c, instance: d } = n.aost, { top: u, bottom: h } = n.getBoundingClientRect(), m = e * (r / 100), g = e * (l / 100);
799
+ if (u - i <= m && h - i >= g && n.offsetParent)
676
800
  setTimeout(() => {
677
801
  n.classList.add(o);
678
802
  }, a);
679
803
  else {
680
- const f = n.classList.contains(o) && c === "down" && u - i >= p || c === "up" && h - i <= g || c === !0;
804
+ const f = n.classList.contains(o) && c === "down" && u - i >= m || c === "up" && h - i <= g || c === !0;
681
805
  setTimeout(() => {
682
806
  f && n.classList.remove(o);
683
807
  }, a);
684
808
  }
685
809
  });
686
- }, Wt = (s, t) => s === "up" || s === "down" ? s : s !== null ? s === "true" ? !0 : s === "false" ? !1 : t.repeat : t.repeat;
687
- class At {
810
+ }, Qt = (s, t) => s === "up" || s === "down" ? s : s !== null ? s === "true" ? !0 : s === "false" ? !1 : t.repeat : t.repeat;
811
+ class kt {
688
812
  constructor(t, e = {}) {
689
813
  this.__storage__ = {
690
814
  el: t,
@@ -694,7 +818,7 @@ class At {
694
818
  #t() {
695
819
  const { el: t, options: e } = this.__storage__;
696
820
  if (!R(t) || !T(t)) return;
697
- const { SETTINGS: i, EVENTS: n } = mt;
821
+ const { SETTINGS: i, EVENTS: n } = ft;
698
822
  if (this.elements = e.state == "not active" ? S(t + `:not([${this.active}])`) : S(t), this.options = Object.assign({}, i, e), this.__events__ = Object.assign({}, n), this.options.on)
699
823
  for (const [o, a] of Object.entries(this.options.on))
700
824
  this.__events__[o] = [a];
@@ -703,9 +827,9 @@ class At {
703
827
  #s() {
704
828
  const { elements: t, options: e } = this, { scroller: i } = e, n = i === window || !T(i) ? window : A(i);
705
829
  this.eventHandler = () => {
706
- Bt(n, t);
830
+ Jt(n, t);
707
831
  }, t.forEach((a) => {
708
- a.aost = {}, a.aost.class = a.getAttribute("data-aost-class") || e.class, a.aost.delay = parseInt(a.getAttribute("data-aost-delay")) || e.delay, a.aost.start = parseInt(a.getAttribute("data-aost-start")) || e.start, a.aost.end = parseInt(a.getAttribute("data-aost-end")) || e.end, a.aost.repeat = Wt(a.getAttribute("data-aost-repeat"), e), a.aost.methods = {}, a.aost.methods.destroy = this.destroy, a.aost.methods.update = this.update, a.aost.instance = this, a.setAttribute(this.active, "");
832
+ a.aost = {}, a.aost.class = a.getAttribute("data-aost-class") || e.class, a.aost.delay = parseInt(a.getAttribute("data-aost-delay")) || e.delay, a.aost.start = parseInt(a.getAttribute("data-aost-start")) || e.start, a.aost.end = parseInt(a.getAttribute("data-aost-end")) || e.end, a.aost.repeat = Qt(a.getAttribute("data-aost-repeat"), e), a.aost.methods = {}, a.aost.methods.destroy = this.destroy, a.aost.methods.update = this.update, a.aost.instance = this, a.setAttribute(this.active, "");
709
833
  });
710
834
  const { eventHandler: o } = this;
711
835
  o(), n.aost = {}, n.aost.eventHandler = o, n.addEventListener("scroll", n.aost.eventHandler, !1);
@@ -724,16 +848,16 @@ class At {
724
848
  this.destroy(t).#t();
725
849
  }
726
850
  }
727
- Object.assign(At.prototype, N);
728
- const Gt = (s) => {
729
- const { TEMPLATE: t } = Z, { childDom: e } = s, i = document.createElement("div");
851
+ Object.assign(kt.prototype, N);
852
+ const Kt = (s) => {
853
+ const { TEMPLATE: t } = J, { childDom: e } = s, i = document.createElement("div");
730
854
  i.innerHTML = t();
731
855
  const n = i.querySelector(".player-wrapper");
732
856
  return [...e].forEach((o) => {
733
857
  n.append(o);
734
858
  }), i.children[0];
735
859
  };
736
- class Rt extends HTMLElement {
860
+ class Vt extends HTMLElement {
737
861
  constructor() {
738
862
  super(), this.#t();
739
863
  }
@@ -745,13 +869,13 @@ class Rt extends HTMLElement {
745
869
  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"), this.#s();
746
870
  }
747
871
  #s() {
748
- this.childDom = this.childNodes, this.template = Gt(this), this.innerHTML = "", this.append(this.template), this.#e();
872
+ this.childDom = this.childNodes, this.template = Kt(this), this.innerHTML = "", this.append(this.template), this.#e();
749
873
  }
750
874
  #e() {
751
- const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: i } = Z;
875
+ const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: i } = J;
752
876
  let n = "";
753
877
  function o(a) {
754
- m(a).addClass("cookie-disagree"), m(".cookie-disagree").append(i);
878
+ p(a).addClass("cookie-disagree"), p(".cookie-disagree").append(i);
755
879
  }
756
880
  switch (t) {
757
881
  case "youtubeAPI":
@@ -854,24 +978,24 @@ class Rt extends HTMLElement {
854
978
  }
855
979
  }
856
980
  let B = 0;
857
- function St(s) {
981
+ function Dt(s) {
858
982
  const t = [];
859
983
  return (s || []).forEach((e) => {
860
984
  e instanceof HTMLElement ? t.push(e) : typeof e == "string" && t.push(...document.querySelectorAll(e));
861
985
  }), t;
862
986
  }
863
- function Lt(s) {
864
- const t = St(s);
865
- B += 1, B === 1 && document.documentElement.classList.add("scrollLock"), Ht(t);
987
+ function $t(s) {
988
+ const t = Dt(s);
989
+ B += 1, B === 1 && document.documentElement.classList.add("scrollLock"), Ot(t);
866
990
  }
867
- function _t(s) {
991
+ function xt(s) {
868
992
  B = Math.max(0, B - 1);
869
- const t = St(s);
870
- Ct(t), B === 0 && document.documentElement.classList.remove("scrollLock");
993
+ const t = Dt(s);
994
+ Mt(t), B === 0 && document.documentElement.classList.remove("scrollLock");
871
995
  }
872
- async function De(s = 0) {
873
- if (m(".loading-wrapper").length) return;
874
- m("body").append(`
996
+ async function Pe(s = 0) {
997
+ if (p(".loading-wrapper").length) return;
998
+ p("body").append(`
875
999
  <div class="loading-wrapper">
876
1000
  <div class="icon-box">
877
1001
  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><path d="M10 50A40 40 0 0 0 90 50A40 42 0 0 1 10 50" fill="#ffffff" stroke="none">
@@ -881,31 +1005,31 @@ async function De(s = 0) {
881
1005
  </svg>
882
1006
  </div>
883
1007
  </div>
884
- `), m(".loading-wrapper").delay(s).fadeIn(300).promise().done(function() {
885
- Lt();
1008
+ `), p(".loading-wrapper").delay(s).fadeIn(300).promise().done(function() {
1009
+ $t();
886
1010
  });
887
1011
  }
888
- function $e() {
889
- m(".loading-wrapper").fadeOut(300).promise().done(function() {
890
- m(".loading-wrapper").remove(), _t();
1012
+ function Ne() {
1013
+ p(".loading-wrapper").fadeOut(300).promise().done(function() {
1014
+ p(".loading-wrapper").remove(), xt();
891
1015
  });
892
1016
  }
893
- function ke(s, t) {
894
- new be(s, t);
1017
+ function je(s, t) {
1018
+ new ke(s, t);
895
1019
  }
896
- function Xt() {
897
- const s = document.querySelector("[data-aost]") && new At("[data-aost]"), t = document.querySelector("[data-anchor-target]") && new bt("[data-anchor-target]"), e = new ht({ callback_loaded: () => {
898
- } }), i = new ue();
1020
+ function te() {
1021
+ const s = document.querySelector("[data-aost]") && new kt("[data-aost]"), t = document.querySelector("[data-anchor-target]") && new wt("[data-anchor-target]"), e = new gt({ callback_loaded: () => {
1022
+ } }), i = new we();
899
1023
  s?.update(), e.update(), i.reValidate(), t?.update();
900
1024
  }
901
- function xe(s, t = () => {
1025
+ function ze(s, t = () => {
902
1026
  }) {
903
- m(`[data-tab-content=${s}]`).fadeIn(function() {
1027
+ p(`[data-tab-content=${s}]`).fadeIn(function() {
904
1028
  typeof t == "function" && t();
905
- }).siblings("[data-tab-content]").hide(), Xt();
1029
+ }).siblings("[data-tab-content]").hide(), te();
906
1030
  }
907
- function Ce() {
908
- tt(
1031
+ function Be() {
1032
+ et(
909
1033
  {
910
1034
  target: document.body,
911
1035
  cancel: {
@@ -929,31 +1053,31 @@ function Ce() {
929
1053
  }
930
1054
  );
931
1055
  }
932
- function He() {
1056
+ function Ge() {
933
1057
  window.onpageshow = function(s) {
934
1058
  s.persisted && window.location.reload();
935
1059
  };
936
1060
  }
937
- function Ie() {
1061
+ function We() {
938
1062
  const s = navigator.userAgent;
939
1063
  return {
940
1064
  BigSurUP: /Mac OS X 10.15/.test(s) || /Mac OS X 10_15_7/.test(s) || /Mac OS X 10_15_8/.test(s) || /Mac OS X 10_15_9/.test(s) || /Mac OS X 11_/.test(s) || /Mac OS X 12_/.test(s)
941
1065
  };
942
1066
  }
943
- function qe(s, t) {
944
- m(s).on("click", function() {
945
- m(this).toggleClass(t);
1067
+ function Re(s, t) {
1068
+ p(s).on("click", function() {
1069
+ p(this).toggleClass(t);
946
1070
  });
947
1071
  }
948
- function Me(s, t) {
949
- m(s).on("click", function() {
950
- m(s).not(this).removeClass(t), m(this).addClass(t);
1072
+ function Xe(s, t) {
1073
+ p(s).on("click", function() {
1074
+ p(s).not(this).removeClass(t), p(this).addClass(t);
951
1075
  });
952
1076
  }
953
- const Oe = (s) => new Promise((t) => {
1077
+ const Ue = (s) => new Promise((t) => {
954
1078
  let e = setTimeout(() => (clearTimeout(e), t()), s);
955
1079
  });
956
- function Ut(s, t = 250) {
1080
+ function ee(s, t = 250) {
957
1081
  let e = null;
958
1082
  return function(...i) {
959
1083
  let n = this;
@@ -962,7 +1086,7 @@ function Ut(s, t = 250) {
962
1086
  }, t);
963
1087
  };
964
1088
  }
965
- function Pe(s, t = 250) {
1089
+ function Ye(s, t = 250) {
966
1090
  let e, i;
967
1091
  return function() {
968
1092
  const n = this, o = arguments, a = +/* @__PURE__ */ new Date();
@@ -971,44 +1095,44 @@ function Pe(s, t = 250) {
971
1095
  }, t)) : (e = a, s.apply(n, o));
972
1096
  };
973
1097
  }
974
- function Ne() {
975
- window._g.interval = [], m(".countdown").each((t, e) => {
976
- const i = Number(m(e).attr("data-seconds")) + 1;
1098
+ function Fe() {
1099
+ window._g.interval = [], p(".countdown").each((t, e) => {
1100
+ const i = Number(p(e).attr("data-seconds")) + 1;
977
1101
  let n = Math.floor(i / 60) + ":" + i % 60;
978
1102
  window._g.interval[t] = setInterval(function() {
979
1103
  var o = n.split(":"), a = parseInt(o[0], 10), r = parseInt(o[1], 10);
980
- --r, a = r < 0 ? --a : a, a = a < 10 ? a = "0" + a : a, a == 0 && r == 0 && clearInterval(window._g.interval[t]), r = r < 0 ? 59 : r, r = r < 10 ? "0" + r : r, m(e).html(a + ":" + r), n = a + ":" + r;
1104
+ --r, a = r < 0 ? --a : a, a = a < 10 ? a = "0" + a : a, a == 0 && r == 0 && clearInterval(window._g.interval[t]), r = r < 0 ? 59 : r, r = r < 10 ? "0" + r : r, p(e).html(a + ":" + r), n = a + ":" + r;
981
1105
  }, 1e3);
982
1106
  });
983
1107
  }
984
- function je(s = 500) {
1108
+ function Ze(s = 500) {
985
1109
  return new Promise((t, e) => {
986
1110
  let i = setTimeout(() => {
987
1111
  clearTimeout(i), t();
988
1112
  }, s);
989
1113
  });
990
1114
  }
991
- function ze() {
1115
+ function Je() {
992
1116
  const s = function() {
993
1117
  let t = window.innerHeight * 0.01;
994
1118
  document.documentElement.style.setProperty("--vh", t + "px");
995
1119
  };
996
- s(), window.addEventListener("resize", Ut(s));
1120
+ s(), window.addEventListener("resize", ee(s));
997
1121
  }
998
- function Be(s, t, e, i, n) {
999
- const o = this, r = m(s).html().split("<br>");
1122
+ function Qe(s, t, e, i, n) {
1123
+ const o = this, r = p(s).html().split("<br>");
1000
1124
  let l = "", c = 0;
1001
1125
  r.forEach((d, u) => {
1002
- u !== 0 && (l += "<br>"), d.split("").forEach((p, g) => {
1003
- t ? (g === 0 && (l += '<span class="letter-wrap" style="display: inline-block">'), p === " " ? l += '</span> <span class="letter-wrap" style="display: inline-block">' : (l += `<span class="letter"${n || e ? ` style="${n ? `transition: ${o.formatFloat(Math.random(), 2) * n}s;` : ""}${e ? e === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${e + c * i}s;` : ""}"` : ""}>${p}</span>`, c++), g === d.length - 1 && (l += "</span>")) : p === " " ? l += " " : (l += `<span class="letter"${n || e ? ` style="${n ? `transition: ${o.formatFloat(Math.random(), 2) * n}s;` : ""}${e ? e === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${e + c * i}s;` : ""}"` : ""}>${p}</span>`, c++);
1126
+ u !== 0 && (l += "<br>"), d.split("").forEach((m, g) => {
1127
+ t ? (g === 0 && (l += '<span class="letter-wrap" style="display: inline-block">'), m === " " ? l += '</span> <span class="letter-wrap" style="display: inline-block">' : (l += `<span class="letter"${n || e ? ` style="${n ? `transition: ${o.formatFloat(Math.random(), 2) * n}s;` : ""}${e ? e === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${e + c * i}s;` : ""}"` : ""}>${m}</span>`, c++), g === d.length - 1 && (l += "</span>")) : m === " " ? l += " " : (l += `<span class="letter"${n || e ? ` style="${n ? `transition: ${o.formatFloat(Math.random(), 2) * n}s;` : ""}${e ? e === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${e + c * i}s;` : ""}"` : ""}>${m}</span>`, c++);
1004
1128
  });
1005
- }), m(s).html(l);
1129
+ }), p(s).html(l);
1006
1130
  }
1007
- function We(s, t) {
1131
+ function Ke(s, t) {
1008
1132
  const e = Math.pow(10, t);
1009
1133
  return Math.round(s * e) / e;
1010
1134
  }
1011
- function Ge(s) {
1135
+ function Ve(s) {
1012
1136
  let t = s.activeIndex, e = s.slides.length;
1013
1137
  if (s.params.loop)
1014
1138
  switch (s.activeIndex) {
@@ -1023,74 +1147,74 @@ function Ge(s) {
1023
1147
  }
1024
1148
  return t;
1025
1149
  }
1026
- function Re(s, t) {
1150
+ function ti(s, t) {
1027
1151
  const e = s.$el, i = s.params.grid.rows, n = t || s.params.slidesPerView * i;
1028
- (s.loopedSlides ? s.slides.length - s.loopedSlides * 2 : s.slides.length) <= n ? (e.addClass("swiper-no-swiping"), m(s.params.navigation.nextEl).hide(), m(s.params.navigation.prevEl).hide(), m(s.params.pagination.el).hide(), s.params.autoplay.enabled = !1, s.autoplay.stop()) : (e.removeClass("swiper-no-swiping"), m(s.params.navigation.nextEl).show(), m(s.params.navigation.prevEl).show(), m(s.params.pagination.el).show(), s.params.autoplay.enabled && s.autoplay.start());
1152
+ (s.loopedSlides ? s.slides.length - s.loopedSlides * 2 : s.slides.length) <= n ? (e.addClass("swiper-no-swiping"), p(s.params.navigation.nextEl).hide(), p(s.params.navigation.prevEl).hide(), p(s.params.pagination.el).hide(), s.params.autoplay.enabled = !1, s.autoplay.stop()) : (e.removeClass("swiper-no-swiping"), p(s.params.navigation.nextEl).show(), p(s.params.navigation.prevEl).show(), p(s.params.pagination.el).show(), s.params.autoplay.enabled && s.autoplay.start());
1029
1153
  }
1030
- function Xe(s) {
1154
+ function ei(s) {
1031
1155
  s.el.querySelectorAll("img.detect-shade").forEach((t) => {
1032
1156
  t.addEventListener("load", function() {
1033
1157
  detectShade(t);
1034
1158
  });
1035
1159
  });
1036
1160
  }
1037
- function Ue(s) {
1038
- const t = s.el, e = m(t).find(".swiper-slide-active"), i = m(e).find("video").get(0), n = m(t).find(".swiper-slide video");
1039
- s.autoplay.stop(), m(i).off("ended"), i ? (n.each((o, a) => {
1161
+ function ii(s) {
1162
+ const t = s.el, e = p(t).find(".swiper-slide-active"), i = p(e).find("video").get(0), n = p(t).find(".swiper-slide video");
1163
+ s.autoplay.stop(), p(i).off("ended"), i ? (n.each((o, a) => {
1040
1164
  a.currentTime = 0;
1041
- }), m(i).on("ended", function() {
1165
+ }), p(i).on("ended", function() {
1042
1166
  s.slideNext();
1043
1167
  }), i.play()) : s.params.autoplay.enabled && s.autoplay.start();
1044
1168
  }
1045
- function Ye() {
1046
- m(".number-grow").each(function(s, t) {
1047
- const e = m(t), o = e.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
1169
+ function si() {
1170
+ p(".number-grow").each(function(s, t) {
1171
+ const e = p(t), o = e.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
1048
1172
  let r = "";
1049
1173
  for (var l = 0; l <= 9; l++)
1050
1174
  r += String(l) + "<br>";
1051
1175
  return r;
1052
1176
  };
1053
- m(o).each(function(r, l) {
1177
+ p(o).each(function(r, l) {
1054
1178
  const c = () => l !== "," ? `<div class="num" data-final-num="${l}"><div><br>${a()}<br>${a()}</div></div>` : `<div class="comma">${l}</div>`;
1055
1179
  e.append(c);
1056
1180
  });
1057
1181
  });
1058
1182
  }
1059
- function Fe() {
1060
- m(".letter-grow").each(function(s, t) {
1061
- const e = m(t), n = e.attr("data-letter").split(""), o = () => {
1183
+ function ni() {
1184
+ p(".letter-grow").each(function(s, t) {
1185
+ const e = p(t), n = e.attr("data-letter").split(""), o = () => {
1062
1186
  let a = "";
1063
1187
  for (let r = 65; r <= 90; r++)
1064
1188
  a += String.fromCharCode(r) + "<br>";
1065
1189
  return a;
1066
1190
  };
1067
- m(n).each(function(a, r) {
1191
+ p(n).each(function(a, r) {
1068
1192
  const l = `<div class="letter" data-final-letter="${r}"><div><br>${o()}<br>${o()}</div></div>`;
1069
1193
  e.append(l);
1070
1194
  });
1071
1195
  });
1072
1196
  }
1073
- function Je(s) {
1197
+ function oi(s) {
1074
1198
  const t = getComputedStyle(s).transform;
1075
1199
  let e = t.match(/^matrix3d\((.+)\)$/);
1076
1200
  return e ? parseFloat(e[1].split(", ")[12]) : (e = t.match(/^matrix\((.+)\)$/), e ? parseFloat(e[1].split(", ")[4]) : 0);
1077
1201
  }
1078
- function Ze(s) {
1202
+ function ai(s) {
1079
1203
  const t = getComputedStyle(s).transform;
1080
1204
  let e = t.match(/^matrix3d\((.+)\)$/);
1081
1205
  return e ? parseFloat(e[1].split(", ")[13]) : (e = t.match(/^matrix\((.+)\)$/), e ? parseFloat(e[1].split(", ")[5]) : 0);
1082
1206
  }
1083
- function Qe(s) {
1207
+ function ri(s) {
1084
1208
  const t = document.createElement("div");
1085
1209
  return t.innerHTML = s, t.childNodes[0];
1086
1210
  }
1087
- const at = (s) => s.videoId !== "" || typeof s.videoId < "u", Yt = (s) => s.$selector.getAttribute("video4-active") === "on", Y = (s) => `<video-player video-id="${s.videoId}" video-type="${s.videoType}" video-startTime="${s.videoStartTime}" video-autoplay="${s.videoAutoplay}"></video-player>`, rt = (s) => (console.log(s.videoId, "params.videoId"), `<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="${s.videoId}"></blockquote>`);
1088
- class W {
1211
+ const lt = (s) => s.videoId !== "" || typeof s.videoId < "u", ie = (s) => s.$selector.getAttribute("video4-active") === "on", Y = (s) => `<video-player video-id="${s.videoId}" video-type="${s.videoType}" video-startTime="${s.videoStartTime}" video-autoplay="${s.videoAutoplay}"></video-player>`, ct = (s) => (console.log(s.videoId, "params.videoId"), `<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="${s.videoId}"></blockquote>`);
1212
+ class G {
1089
1213
  static globalOptions = {};
1090
1214
  //*-* 給Article4用的 **//
1091
1215
  constructor(t, e = {}) {
1092
1216
  if (!R(t) && !Q(t) && !X(t)) {
1093
- nt("video4", `找不到該物件 -> ${t}`);
1217
+ ot("video4", `找不到該物件 -> ${t}`);
1094
1218
  return;
1095
1219
  }
1096
1220
  this.__storage__ = {
@@ -1099,14 +1223,14 @@ class W {
1099
1223
  }, this.active = "data-video-active", this.#t();
1100
1224
  }
1101
1225
  #t() {
1102
- const { el: t, options: e } = this.__storage__, { SETTINGS: i, EVENTS: n, LAYOUT: o } = Z;
1103
- if (e.isGlobal && (W.globalOptions = e), this.elements = e.state == "not active" ? S(t + `:not([${this.active}])`) : S(t), this.options = Object.assign(
1226
+ const { el: t, options: e } = this.__storage__, { SETTINGS: i, EVENTS: n, LAYOUT: o } = J;
1227
+ if (e.isGlobal && (G.globalOptions = e), this.elements = e.state == "not active" ? S(t + `:not([${this.active}])`) : S(t), this.options = Object.assign(
1104
1228
  {},
1105
1229
  { LAYOUT: o },
1106
1230
  // 原始 configs 的 LAYOUT
1107
1231
  i,
1108
1232
  // 原始 configs 的 SETTINGS
1109
- W.globalOptions,
1233
+ G.globalOptions,
1110
1234
  // 全站 A 設定
1111
1235
  e
1112
1236
  // 個別傳入的設定 (優先級最高)
@@ -1118,7 +1242,7 @@ class W {
1118
1242
  #s() {
1119
1243
  const { elements: t, options: e } = this;
1120
1244
  t.forEach((i) => {
1121
- i.video = {}, i.video.instance = this, i.video.defaultOptions = e, i.video.params = this.#a(i), i.video.methods = {}, i.video.methods.update = this.update, i.setAttribute(this.active, ""), at(i.video.params) && !Yt(i.video.params) && (i.setAttribute("video4-active", "on"), this.#n(i)), at(i.video.params) || nt("video4", "無法取得影片 ID");
1245
+ i.video = {}, i.video.instance = this, i.video.defaultOptions = e, i.video.params = this.#a(i), i.video.methods = {}, i.video.methods.update = this.update, i.setAttribute(this.active, ""), lt(i.video.params) && !ie(i.video.params) && (i.setAttribute("video4-active", "on"), this.#n(i)), lt(i.video.params) || ot("video4", "無法取得影片 ID");
1122
1246
  }), this.emit("init");
1123
1247
  }
1124
1248
  #e(t) {
@@ -1151,24 +1275,24 @@ class W {
1151
1275
  let h = null;
1152
1276
  if (d === "on") {
1153
1277
  t.classList.add("video4-cover"), n.querySelector("img") || (n.insertAdjacentHTML(E.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), w("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
1154
- const p = n.querySelector("img"), g = p?.getAttribute("src") || p?.getAttribute("data-src"), b = e[o] ? e[o] : e[0] || "";
1155
- if (b ? p.insertAdjacentHTML(E.after, b) : w("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !g)
1156
- this.#i(p, i);
1278
+ const m = n.querySelector("img"), g = m?.getAttribute("src") || m?.getAttribute("data-src"), b = e[o] ? e[o] : e[0] || "";
1279
+ if (b ? m.insertAdjacentHTML(E.after, b) : w("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !g)
1280
+ this.#i(m, i);
1157
1281
  else if (!g && r == "youtube")
1158
- u == "on" ? p.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : p.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
1282
+ u == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
1159
1283
  else if (!g && r == "vimeo")
1160
- p.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`);
1284
+ m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`);
1161
1285
  else if (!g && r === "video") {
1162
1286
  const f = document.createElement("video");
1163
1287
  f.src = a, f.preload = "metadata", f.muted = !0, f.playsInline = !0, f.crossOrigin = "anonymous", f.onloadeddata = () => {
1164
1288
  f.currentTime = 0.5;
1165
1289
  }, f.onseeked = () => {
1166
1290
  const v = document.createElement("canvas");
1167
- v.width = f.videoWidth, v.height = f.videoHeight, v.getContext("2d").drawImage(f, 0, 0), p.src = v.toDataURL("image/jpeg", 0.85);
1291
+ v.width = f.videoWidth, v.height = f.videoHeight, v.getContext("2d").drawImage(f, 0, 0), m.src = v.toDataURL("image/jpeg", 0.85);
1168
1292
  };
1169
1293
  } else !g && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((f) => f.json()).then((f) => {
1170
1294
  const v = f.thumbnail_url;
1171
- p.setAttribute("src", `${v}`);
1295
+ m.setAttribute("src", `${v}`);
1172
1296
  }).catch(function(f) {
1173
1297
  console.log("error");
1174
1298
  }) : w("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
@@ -1178,15 +1302,15 @@ class W {
1178
1302
  let h = null;
1179
1303
  if (d == "on") {
1180
1304
  t.classList.add("video4-cover"), n.querySelector("img") || (n.insertAdjacentHTML(E.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), w("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
1181
- const p = n.querySelector("img");
1182
- p.insertAdjacentHTML(E.after, e[o]);
1183
- const g = p?.getAttribute("src") || p?.getAttribute("data-src");
1184
- g ? !g && r == "youtube" ? u == "on" ? p.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : p.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !g && r == "vimeo" ? p.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !g && 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) => {
1305
+ const m = n.querySelector("img");
1306
+ m.insertAdjacentHTML(E.after, e[o]);
1307
+ const g = m?.getAttribute("src") || m?.getAttribute("data-src");
1308
+ g ? !g && r == "youtube" ? u == "on" ? m.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !g && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !g && 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) => {
1185
1309
  const f = b.thumbnail_url;
1186
- p.setAttribute("src", `${f}`);
1310
+ m.setAttribute("src", `${f}`);
1187
1311
  }).catch(function(b) {
1188
1312
  console.log("error");
1189
- }) : g || w("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片") : this.#i(p, i), c == "off" ? h = n : (h = n.querySelector(c) ?? n, n.querySelector(c) || w("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
1313
+ }) : g || w("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片") : this.#i(m, i), c == "off" ? h = n : (h = n.querySelector(c) ?? n, n.querySelector(c) || w("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
1190
1314
  } else {
1191
1315
  n.innerHTML = Y(i);
1192
1316
  return;
@@ -1205,10 +1329,10 @@ class W {
1205
1329
  videoType: d,
1206
1330
  videoIgHtml: u,
1207
1331
  videoInboxImg: h,
1208
- videoButton: p,
1332
+ videoButton: m,
1209
1333
  videoLayoutNo: g,
1210
1334
  videoStartTime: b
1211
- } = e.params, f = new ht({ callback_loaded: (H) => {
1335
+ } = e.params, f = new gt({ callback_loaded: (H) => {
1212
1336
  } }), v = new URLSearchParams({
1213
1337
  video_mode: o,
1214
1338
  video_type: d,
@@ -1220,31 +1344,31 @@ class W {
1220
1344
  route: c + `?${v.toString()}`,
1221
1345
  on: {
1222
1346
  complete(y) {
1223
- o == "onBox" && (d == "instagram" ? (y.setAttribute("video-typeStyle", `${d}`), window.instgrm?.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", rt(e.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", Y(e.params)), y.setAttribute("video-typeStyle", `${d}`))), o == "inBox" && (y.setAttribute("video-typeStyle", `${d}`), d == "instagram" && (window.instgrm?.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", rt(e.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")));
1347
+ o == "onBox" && (d == "instagram" ? (y.setAttribute("video-typeStyle", `${d}`), window.instgrm?.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", ct(e.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", Y(e.params)), y.setAttribute("video-typeStyle", `${d}`))), o == "inBox" && (y.setAttribute("video-typeStyle", `${d}`), d == "instagram" && (window.instgrm?.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", ct(e.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")));
1224
1348
  },
1225
1349
  open(y) {
1226
1350
  const z = y.querySelectorAll("[data-overlayscrollbars-viewport]");
1227
- if (f.update(), Lt([...z]), d == "instagram") {
1228
- const I = document.querySelector("[video-template] .modal-content");
1351
+ if (f.update(), $t([...z]), d == "instagram") {
1352
+ const q = document.querySelector("[video-template] .modal-content");
1229
1353
  new ResizeObserver((M) => {
1230
- M[0].contentRect.height > 50 && I.classList.add("active");
1231
- }).observe(I);
1354
+ M[0].contentRect.height > 50 && q.classList.add("active");
1355
+ }).observe(q);
1232
1356
  }
1233
1357
  if (o == "inBox")
1234
1358
  if (d == "instagram")
1235
- m(".video-content").remove();
1359
+ p(".video-content").remove();
1236
1360
  else {
1237
- let I;
1238
- const q = y.querySelector(".video-content");
1361
+ let q;
1362
+ const I = y.querySelector(".video-content");
1239
1363
  i.#e(e.params).then((M) => {
1240
- I = `
1364
+ q = `
1241
1365
  <div
1242
1366
  class="photo-box"
1243
1367
  video-target
1244
1368
  video-mode="onPage"
1245
1369
  video-type="${d}"
1246
1370
  video-id="${l}"
1247
- video-button="${p}"
1371
+ video-button="${m}"
1248
1372
  video-layout-no="${g}"
1249
1373
  video-starttime="${b}"
1250
1374
  >
@@ -1259,9 +1383,9 @@ class W {
1259
1383
  />
1260
1384
  <img src="${M || ""}" alt="" />
1261
1385
  </picture>
1262
- </div>`, q.insertAdjacentHTML(E.prepend, I);
1263
- const st = y.querySelectorAll("[video-target]");
1264
- st.length > 0 && new W(st, {
1386
+ </div>`, I.insertAdjacentHTML(E.prepend, q);
1387
+ const nt = y.querySelectorAll("[video-target]");
1388
+ nt.length > 0 && new G(nt, {
1265
1389
  LAYOUT: e.params.LAYOUT,
1266
1390
  videoLayoutNo: e.params.videoLayoutNo
1267
1391
  });
@@ -1271,7 +1395,7 @@ class W {
1271
1395
  },
1272
1396
  close(y) {
1273
1397
  const z = y.querySelectorAll("[data-overlayscrollbars-viewport]");
1274
- _t([...z]), i?.emit("closeModal");
1398
+ xt([...z]), i?.emit("closeModal");
1275
1399
  },
1276
1400
  destroy(y) {
1277
1401
  }
@@ -1314,9 +1438,9 @@ class W {
1314
1438
  this.#t();
1315
1439
  }
1316
1440
  }
1317
- Object.assign(W.prototype, N);
1318
- customElements.define("video-player", Rt);
1319
- const Ft = {
1441
+ Object.assign(G.prototype, N);
1442
+ customElements.define("video-player", Vt);
1443
+ const se = {
1320
1444
  "zh-tw": {
1321
1445
  臺北市: [
1322
1446
  ["中正區", "100"],
@@ -2146,9 +2270,9 @@ const Ft = {
2146
2270
  ]
2147
2271
  }
2148
2272
  };
2149
- let G;
2150
- const Jt = (s) => {
2151
- const { TEMPLATE: t } = et, { childDom: e } = s.s, i = document.createElement("div"), n = s.classList.contains("filter"), o = s.getAttribute("filter-placeholder"), a = s.getAttribute("d4-icon"), r = s.getAttribute("custom-template");
2273
+ let W;
2274
+ const ne = (s) => {
2275
+ const { TEMPLATE: t } = it, { childDom: e } = s.s, i = document.createElement("div"), n = s.classList.contains("filter"), o = s.getAttribute("filter-placeholder"), a = s.getAttribute("d4-icon"), r = s.getAttribute("custom-template");
2152
2276
  i.innerHTML = t(
2153
2277
  n,
2154
2278
  o,
@@ -2161,13 +2285,13 @@ const Jt = (s) => {
2161
2285
  (!u.hasAttribute("data-option") || u.getAttribute("data-option").trim() === "") && u.setAttribute("data-option", u.textContent.trim());
2162
2286
  }) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
2163
2287
  }), i.children[0];
2164
- }, Zt = (s) => {
2288
+ }, oe = (s) => {
2165
2289
  const t = s.getAttribute("control-elements")?.split(",");
2166
2290
  t && t.forEach((e) => {
2167
2291
  const i = document.querySelector(e);
2168
- i || w("dropdown", `Can't not find control element(${e})`), i && i.classList.contains("disabled") && (i.classList.remove("disabled"), i.tagName === "DROPDOWN-EL" && i.s.activeLi && k(i, [...i.s.allLi].indexOf(i.s.activeLi)));
2292
+ i || w("dropdown", `Can't not find control element(${e})`), i && i.classList.contains("disabled") && (i.classList.remove("disabled"), i.tagName === "DROPDOWN-EL" && i.s.activeLi && $(i, [...i.s.allLi].indexOf(i.s.activeLi)));
2169
2293
  });
2170
- }, k = (s, t) => {
2294
+ }, $ = (s, t) => {
2171
2295
  const e = s.getAttribute("d4-placeholder"), i = s.s.dropdownEl.querySelectorAll(".dropdown-list li");
2172
2296
  if (t < 0 || t.length === 0) {
2173
2297
  switch (i.forEach((n) => {
@@ -2219,35 +2343,35 @@ const Jt = (s) => {
2219
2343
  break;
2220
2344
  }
2221
2345
  }
2222
- }, Qt = (s) => {
2346
+ }, ae = (s) => {
2223
2347
  const t = s.s.cityLang;
2224
- m("#newCityData").length > 0 ? m("#newCityData").val() !== "" && (G = JSON.parse(m("#newCityData").val())[0], console.log([0])) : G = Ft, s.classList.contains("city") && (s.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(G[t]).forEach((e) => {
2348
+ p("#newCityData").length > 0 ? p("#newCityData").val() !== "" && (W = JSON.parse(p("#newCityData").val())[0], console.log([0])) : W = se, s.classList.contains("city") && (s.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(W[t]).forEach((e) => {
2225
2349
  const i = document.createElement("li");
2226
2350
  i.textContent = e, i.setAttribute("data-option", e), s.s.dropdownEl.querySelector(".dropdown-list").append(i);
2227
2351
  }), s.s.allLi = s.s.dropdownEl.querySelectorAll(".dropdown-list li"));
2228
- }, Kt = (s, t) => {
2352
+ }, re = (s, t) => {
2229
2353
  const e = s.s.cityLang;
2230
- G[e][t].forEach((i, n) => {
2354
+ W[e][t].forEach((i, n) => {
2231
2355
  const o = document.createElement("li");
2232
2356
  o.textContent = i[0], o.setAttribute("data-option", i[0]), s.s.dropdownEl.querySelector(".dropdown-list").append(o);
2233
2357
  });
2234
- }, V = () => {
2358
+ }, tt = () => {
2235
2359
  S('dropdown-el[d4-status="open"]').forEach((t) => {
2236
2360
  t.close();
2237
2361
  });
2238
- }, Vt = () => {
2239
- const { SETTINGS: s } = et;
2362
+ }, le = () => {
2363
+ const { SETTINGS: s } = it;
2240
2364
  ((e, i) => {
2241
2365
  Object.keys(i).forEach((n) => {
2242
2366
  e.style.setProperty(`--${n}`, i[n]);
2243
2367
  });
2244
2368
  })(document.documentElement, s.scrollbar);
2245
2369
  };
2246
- Vt();
2247
- document.addEventListener("click", function() {
2248
- V();
2249
- });
2250
- class Dt extends HTMLElement {
2370
+ le();
2371
+ document.addEventListener("click", function(s) {
2372
+ s.target.closest("dropdown-el") || s.target.closest("[data-d4-portal]") || tt();
2373
+ }, !0);
2374
+ class Ct extends HTMLElement {
2251
2375
  constructor() {
2252
2376
  super(), this.initialize = !1;
2253
2377
  }
@@ -2267,7 +2391,7 @@ class Dt extends HTMLElement {
2267
2391
  switch (n.hasAttribute("multiple") ? "multiple" : "single") {
2268
2392
  case "single":
2269
2393
  const a = n.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${i}"]`);
2270
- T(a) ? k(n, [...n.s.allLi].indexOf(a)) : k(n, -1);
2394
+ T(a) ? $(n, [...n.s.allLi].indexOf(a)) : $(n, -1);
2271
2395
  break;
2272
2396
  case "multiple":
2273
2397
  const r = [];
@@ -2276,16 +2400,16 @@ class Dt extends HTMLElement {
2276
2400
  T(d) && (d.classList.add("active"), r.push(d));
2277
2401
  });
2278
2402
  const l = r.map((c) => [...n.s.allLi].indexOf(c));
2279
- k(n, l);
2403
+ $(n, l);
2280
2404
  break;
2281
2405
  }
2282
2406
  else
2283
- k(n, -1);
2407
+ $(n, -1);
2284
2408
  n.emit("change");
2285
2409
  break;
2286
2410
  case "d4-placeholder":
2287
2411
  if (e === null) return;
2288
- e !== i && n.s.value.index < 0 && k(n, n.s.value.index);
2412
+ e !== i && n.s.value.index < 0 && $(n, n.s.value.index);
2289
2413
  break;
2290
2414
  }
2291
2415
  }
@@ -2300,7 +2424,7 @@ class Dt extends HTMLElement {
2300
2424
  this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), this.#s();
2301
2425
  }
2302
2426
  #s() {
2303
- this.s.childDom = this.childNodes, this.s.template = Jt(this), this.innerHTML = "", this.append(this.s.template), this.s.dropdownEl = this.querySelector(".dropdown"), this.getAttribute("d4-portal") === "true" && (this.s.dropdownEl.setAttribute("data-d4-portal", ""), document.body.appendChild(this.s.dropdownEl)), this.#i();
2427
+ this.s.childDom = this.childNodes, this.s.template = ne(this), this.innerHTML = "", this.append(this.s.template), this.s.dropdownEl = this.querySelector(".dropdown"), this.getAttribute("d4-portal") === "true" && (this.s.dropdownEl.setAttribute("data-d4-portal", ""), document.body.appendChild(this.s.dropdownEl)), this.#i();
2304
2428
  }
2305
2429
  // -** 獨立 dropdown 出 body 更新
2306
2430
  #e() {
@@ -2311,7 +2435,7 @@ class Dt extends HTMLElement {
2311
2435
  }
2312
2436
  #i() {
2313
2437
  const t = this;
2314
- t.s.allLi = t.s.dropdownEl.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw", Qt(t), t.s.subDropdownTotalH = 0;
2438
+ t.s.allLi = t.s.dropdownEl.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw", ae(t), t.s.subDropdownTotalH = 0;
2315
2439
  const e = t.getAttribute("d4-value");
2316
2440
  switch (t.s.selectType) {
2317
2441
  case "single":
@@ -2320,7 +2444,7 @@ class Dt extends HTMLElement {
2320
2444
  const o = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), a = o ? o.getAttribute("d4-value") !== "" : !1;
2321
2445
  if (o && a) {
2322
2446
  const r = o.getAttribute("d4-value");
2323
- if (Kt(t, r), t.s.allLi = t.s.dropdownEl.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
2447
+ if (re(t, r), t.s.allLi = t.s.dropdownEl.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
2324
2448
  const l = e.split(",")[1];
2325
2449
  i = t.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${l}"]`), t.setAttribute("d4-value", l);
2326
2450
  }
@@ -2353,7 +2477,7 @@ class Dt extends HTMLElement {
2353
2477
  };
2354
2478
  break;
2355
2479
  }
2356
- k(t, t.s.value.index), t.#n(), t.classList.add("d4-initialize");
2480
+ $(t, t.s.value.index), t.#n(), t.classList.add("d4-initialize");
2357
2481
  }
2358
2482
  #n() {
2359
2483
  const t = this;
@@ -2401,7 +2525,7 @@ class Dt extends HTMLElement {
2401
2525
  t.s.dropdownEl.addEventListener("transitionend", e);
2402
2526
  }, t.__events__.bindScrollbar = (e = this) => {
2403
2527
  const i = e.s.dropdownEl.querySelector(".dropdown-scroller");
2404
- e.__scroller__ = tt(i, {
2528
+ e.__scroller__ = et(i, {
2405
2529
  overflowBehavior: {
2406
2530
  x: "hidden"
2407
2531
  }
@@ -2414,8 +2538,8 @@ class Dt extends HTMLElement {
2414
2538
  const c = this, d = [...e.s.allLi].indexOf(c), u = parseInt(e.getAttribute("d4-default-height"));
2415
2539
  if (c.classList.contains("has-sublayer")) {
2416
2540
  l.stopPropagation();
2417
- const h = c.querySelector(".sub-dropdown"), p = h.querySelector(".sub-dropdown-list"), g = parseInt(getComputedStyle(p).marginTop) + parseInt(getComputedStyle(p).marginBottom);
2418
- h.style.cssText = `--height: ${p.offsetHeight + g}px`;
2541
+ const h = c.querySelector(".sub-dropdown"), m = h.querySelector(".sub-dropdown-list"), g = parseInt(getComputedStyle(m).marginTop) + parseInt(getComputedStyle(m).marginBottom);
2542
+ h.style.cssText = `--height: ${m.offsetHeight + g}px`;
2419
2543
  const b = parseInt(h.style.cssText.replace("--height:", "").trim()), f = parseInt(getComputedStyle(o).maxHeight), v = () => {
2420
2544
  i = u + e.s.subDropdownTotalH, n = i > f ? f : i, e.getAttribute("d4-portal") == "true" ? e.s.dropdownEl.style.setProperty("--maxHeight", `${n}px`) : e.style.cssText = `--maxHeight: ${n}px;`, e.s.dropdownEl.style.height = `${n}px`;
2421
2545
  };
@@ -2425,12 +2549,12 @@ class Dt extends HTMLElement {
2425
2549
  };
2426
2550
  h.addEventListener("transitionend", H);
2427
2551
  } else
2428
- switch (Zt(e), e.s.selectType) {
2552
+ switch (oe(e), e.s.selectType) {
2429
2553
  // 單選
2430
2554
  case "single":
2431
2555
  if (e.setAttribute("d4-value", c.getAttribute("data-option")), a) {
2432
- const h = e.s.cityLang, p = r.textContent.trim(), g = document.getElementById(e.getAttribute("dist-select"));
2433
- g && (g.s.dropdownEl.querySelector(".dropdown-list").textContent = "", k(g, -1), G[h][p].forEach((b, f) => {
2556
+ const h = e.s.cityLang, m = r.textContent.trim(), g = document.getElementById(e.getAttribute("dist-select"));
2557
+ g && (g.s.dropdownEl.querySelector(".dropdown-list").textContent = "", $(g, -1), W[h][m].forEach((b, f) => {
2434
2558
  const v = document.createElement("li");
2435
2559
  v.textContent = b[0], v.setAttribute("data-option", b[0]), e.getAttribute("d4-portal") == "true" ? g.s.dropdownEl.querySelector(".dropdown-list").append(v) : g.querySelector(".dropdown-list").append(v);
2436
2560
  }), e.__events__.selectOption(g));
@@ -2439,7 +2563,7 @@ class Dt extends HTMLElement {
2439
2563
  break;
2440
2564
  // 複選
2441
2565
  case "multiple":
2442
- l.stopPropagation(), c.classList.toggle("active"), k(e, d);
2566
+ l.stopPropagation(), c.classList.toggle("active"), $(e, d);
2443
2567
  break;
2444
2568
  }
2445
2569
  });
@@ -2474,13 +2598,13 @@ class Dt extends HTMLElement {
2474
2598
  open() {
2475
2599
  const t = this;
2476
2600
  let e;
2477
- t.getAttribute("d4-portal") == "true" ? (V(), t.s.dropdownEl.parentNode !== document.body && document.body.appendChild(t.s.dropdownEl), t.__scroller__ || t.__events__.bindScrollbar(), this.#e(), t.s.dropdownEl.offsetHeight, e = t.s.dropdownEl.querySelector(".dropdown-scroller").clientHeight) : e = t.querySelector(".dropdown-scroller").clientHeight;
2601
+ t.getAttribute("d4-portal") == "true" ? (tt(), t.s.dropdownEl.parentNode !== document.body && document.body.appendChild(t.s.dropdownEl), t.__scroller__ || t.__events__.bindScrollbar(), this.#e(), t.s.dropdownEl.offsetHeight, e = t.s.dropdownEl.querySelector(".dropdown-scroller").clientHeight) : e = t.querySelector(".dropdown-scroller").clientHeight;
2478
2602
  const i = t.classList.contains("filter"), n = () => {
2479
2603
  if (t.getAttribute("d4-portal") == "true") {
2480
2604
  if (i)
2481
- return t.s.dropdownEl.querySelector(".dropdown-scroller .filter-bar") ? e : t.s.dropdownEl.querySelector(".filter-bar").clientHeight + e;
2605
+ return t.s.dropdownEl.querySelector(".dropdown-scroller .filter-bar") ? e : t.s.dropdownEl.querySelector(".filter-bar") ? t.s.dropdownEl.querySelector(".filter-bar").clientHeight + e : e;
2482
2606
  } else if (i)
2483
- return t.querySelector(".dropdown-scroller .filter-bar") ? e : t.querySelector(".filter-bar").clientHeight + e;
2607
+ return t.querySelector(".dropdown-scroller .filter-bar") ? e : t.querySelector(".filter-bar") ? t.querySelector(".filter-bar").clientHeight + e : e;
2484
2608
  return e;
2485
2609
  };
2486
2610
  t.s.subDropdownTotalH = 0;
@@ -2490,10 +2614,10 @@ class Dt extends HTMLElement {
2490
2614
  c.style.cssText = `--height: ${d.offsetHeight + u}px`, t.s.subDropdownTotalH += parseInt(c.style.cssText.replace("--height:", "").trim()), l.classList.add("open");
2491
2615
  });
2492
2616
  const r = () => {
2493
- const l = n() + t.s.subDropdownTotalH;
2494
- return l > a ? a : l;
2617
+ const l = i ? t.getAttribute("d4-portal") == "true" ? t.s.dropdownEl.querySelector(".filter-bar") : t.querySelector(".filter-bar") : null, c = l ? l.clientHeight : 0, d = n() + t.s.subDropdownTotalH;
2618
+ return d > a + c ? a + c : d;
2495
2619
  };
2496
- return t.getAttribute("d4-portal") !== "true" && V(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", n()), t.getAttribute("d4-portal") == "true" ? (t.s.dropdownEl.style.setProperty("--maxHeight", `${r()}px`), t.s.dropdownEl.style.zIndex = "9999", this.#e(), t.s.dropdownEl.offsetHeight, t.s.dropdownEl.style.height = `${r()}px`, t.__events__._scrollUpdate = () => {
2620
+ return t.getAttribute("d4-portal") !== "true" && tt(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", n()), t.getAttribute("d4-portal") == "true" ? (t.s.dropdownEl.style.setProperty("--maxHeight", `${r()}px`), t.s.dropdownEl.style.zIndex = "9999", this.#e(), t.s.dropdownEl.offsetHeight, t.s.dropdownEl.style.height = `${r()}px`, t.__events__._scrollUpdate = () => {
2497
2621
  const l = t.getBoundingClientRect();
2498
2622
  l.bottom < 0 || l.top > window.innerHeight ? t.close() : t.#e();
2499
2623
  }, window.addEventListener("scroll", t.__events__._scrollUpdate, { passive: !0, capture: !0 }), window.addEventListener("resize", t.__events__._scrollUpdate, { passive: !0 })) : (t.style.cssText = `--maxHeight: ${r()}px;`, t.s.dropdownEl.style.cssText = `
@@ -2518,9 +2642,9 @@ class Dt extends HTMLElement {
2518
2642
  this.__events__.selectOption();
2519
2643
  }
2520
2644
  }
2521
- Object.assign(Dt.prototype, N);
2522
- customElements.define("dropdown-el", Dt);
2523
- function J(s) {
2645
+ Object.assign(Ct.prototype, N);
2646
+ customElements.define("dropdown-el", Ct);
2647
+ function Z(s) {
2524
2648
  const t = {};
2525
2649
  return [...s.attributes].forEach((e) => {
2526
2650
  if (e.name.includes("duration-")) {
@@ -2529,10 +2653,10 @@ function J(s) {
2529
2653
  }
2530
2654
  }), Object.keys(t).length === 0 ? null : t;
2531
2655
  }
2532
- function lt(s) {
2533
- if (J(s)) {
2656
+ function dt(s) {
2657
+ if (Z(s)) {
2534
2658
  let t;
2535
- const e = Object.keys(J(s)).map((i) => ({
2659
+ const e = Object.keys(Z(s)).map((i) => ({
2536
2660
  value: i,
2537
2661
  point: i
2538
2662
  }));
@@ -2541,11 +2665,11 @@ function lt(s) {
2541
2665
  const { point: n, value: o } = e[i];
2542
2666
  window.matchMedia(`(max-width: ${o}px)`).matches && (t = n);
2543
2667
  }
2544
- return t ? Number(J(s)[t]) : s.s.options.duration;
2668
+ return t ? Number(Z(s)[t]) : s.s.options.duration;
2545
2669
  } else
2546
2670
  return s.s.options.duration;
2547
2671
  }
2548
- function te(s) {
2672
+ function ce(s) {
2549
2673
  const { behavior: t, continual: e, gap: i } = s.s.options, n = s.childNodes, o = document.createElement("div"), a = document.createElement("div");
2550
2674
  o.className = "animate-container", a.className = "animate-item", [...n].forEach((l) => {
2551
2675
  a.append(l);
@@ -2556,7 +2680,7 @@ function te(s) {
2556
2680
  }
2557
2681
  s.s.animation = null, s.s.animateEl = a, s.textContent = "", o.append(a), s.append(o), a.clientWidth * 2 + i >= s.clientWidth ? t === "normal" && e && o.append(r()) : s.s.options.continual = !1;
2558
2682
  }
2559
- function D(s) {
2683
+ function k(s) {
2560
2684
  const { behavior: t, direction: e, continual: i } = s.s.options;
2561
2685
  let n = {};
2562
2686
  switch (t) {
@@ -2613,13 +2737,13 @@ function D(s) {
2613
2737
  }
2614
2738
  return n;
2615
2739
  }
2616
- function ee(s) {
2740
+ function de(s) {
2617
2741
  let t;
2618
2742
  return function(e) {
2619
2743
  t && clearTimeout(t), t = setTimeout(s, 200, e);
2620
2744
  };
2621
2745
  }
2622
- class ie extends HTMLElement {
2746
+ class ue extends HTMLElement {
2623
2747
  constructor() {
2624
2748
  super(), this.initialize = !1;
2625
2749
  }
@@ -2633,22 +2757,22 @@ class ie extends HTMLElement {
2633
2757
  }
2634
2758
  #t() {
2635
2759
  const t = {
2636
- direction: this.getAttribute("direction") || $.SETTINGS.direction,
2760
+ direction: this.getAttribute("direction") || D.SETTINGS.direction,
2637
2761
  // up / down / left / right
2638
- behavior: this.getAttribute("behavior") || $.SETTINGS.behavior,
2762
+ behavior: this.getAttribute("behavior") || D.SETTINGS.behavior,
2639
2763
  // normal / alternate / endStop
2640
- duration: Number(this.getAttribute("duration")) || $.SETTINGS.duration,
2764
+ duration: Number(this.getAttribute("duration")) || D.SETTINGS.duration,
2641
2765
  // ms
2642
- durationBreakpoints: J(this) || $.SETTINGS.durationBreakpoints,
2643
- autoplay: this.getAttribute("autoplay") || $.SETTINGS.autoplay,
2766
+ durationBreakpoints: Z(this) || D.SETTINGS.durationBreakpoints,
2767
+ autoplay: this.getAttribute("autoplay") || D.SETTINGS.autoplay,
2644
2768
  // normal / alternate / endStop
2645
- pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : $.SETTINGS.pauseOnMouseenter,
2769
+ pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : D.SETTINGS.pauseOnMouseenter,
2646
2770
  // true / false
2647
- continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : $.SETTINGS.continual,
2771
+ continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : D.SETTINGS.continual,
2648
2772
  // true / false
2649
- gap: Number(this.getAttribute("gap")) || $.SETTINGS.gap
2773
+ gap: Number(this.getAttribute("gap")) || D.SETTINGS.gap
2650
2774
  };
2651
- this.s = {}, this.s.options = t, this.s.nowDuration = lt(this), te(this), this.#s();
2775
+ this.s = {}, this.s.options = t, this.s.nowDuration = dt(this), ce(this), this.#s();
2652
2776
  }
2653
2777
  #s() {
2654
2778
  const { direction: t, continual: e, gap: i } = this.s.options;
@@ -2670,10 +2794,10 @@ class ie extends HTMLElement {
2670
2794
  function c() {
2671
2795
  switch (i) {
2672
2796
  case "normal":
2673
- t.s.animateEl.style.transform = `${D(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(D(t).animate1, {
2797
+ t.s.animateEl.style.transform = `${k(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(k(t).animate1, {
2674
2798
  duration: t.s.nowDuration,
2675
2799
  iterations: 1 / 0
2676
- }), r && (t.s.cloneAnimateEl.style.transform = `${D(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(D(t).animate2, {
2800
+ }), r && (t.s.cloneAnimateEl.style.transform = `${k(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(k(t).animate2, {
2677
2801
  duration: t.s.nowDuration,
2678
2802
  delay: -t.s.nowDuration / 2,
2679
2803
  iterations: 1 / 0
@@ -2681,28 +2805,28 @@ class ie extends HTMLElement {
2681
2805
  break;
2682
2806
  case "alternate":
2683
2807
  let h = function() {
2684
- let p = [];
2808
+ let m = [];
2685
2809
  switch (e) {
2686
2810
  case "top":
2687
- d = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), u = parseInt(t.s.nowDuration / (d * 2)) * t.s.animateEl.scrollHeight, p = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
2811
+ d = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), u = parseInt(t.s.nowDuration / (d * 2)) * t.s.animateEl.scrollHeight, m = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
2688
2812
  break;
2689
2813
  case "right":
2690
- d = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), u = parseInt(t.s.nowDuration / (d * 2)) * t.s.animateEl.scrollWidth, p = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
2814
+ d = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), u = parseInt(t.s.nowDuration / (d * 2)) * t.s.animateEl.scrollWidth, m = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
2691
2815
  break;
2692
2816
  case "bottom":
2693
- d = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), u = parseInt(n / (d * 2)) * t.s.animateEl.scrollHeight, p = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
2817
+ d = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), u = parseInt(n / (d * 2)) * t.s.animateEl.scrollHeight, m = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
2694
2818
  break;
2695
2819
  case "left":
2696
- d = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), u = parseInt(n / (d * 2)) * t.s.animateEl.scrollWidth, p = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
2820
+ d = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), u = parseInt(n / (d * 2)) * t.s.animateEl.scrollWidth, m = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
2697
2821
  break;
2698
2822
  }
2699
- return p;
2823
+ return m;
2700
2824
  }, d, u;
2701
2825
  (t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${h()[0].transform}`, t.s.animateEl.animate(h(), {
2702
2826
  duration: u,
2703
2827
  fill: "forwards"
2704
2828
  }).finished.then(() => {
2705
- t.s.animation = t.s.animateEl.animate(D(t).animate1, {
2829
+ t.s.animation = t.s.animateEl.animate(k(t).animate1, {
2706
2830
  duration: t.s.nowDuration,
2707
2831
  iterations: 1 / 0
2708
2832
  });
@@ -2711,7 +2835,7 @@ class ie extends HTMLElement {
2711
2835
  });
2712
2836
  break;
2713
2837
  case "endStop":
2714
- t.s.animateEl.style.transform = `${D(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(D(t).animate1, {
2838
+ t.s.animateEl.style.transform = `${k(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(k(t).animate1, {
2715
2839
  duration: t.s.nowDuration,
2716
2840
  fill: "forwards"
2717
2841
  });
@@ -2734,16 +2858,16 @@ class ie extends HTMLElement {
2734
2858
  const t = this;
2735
2859
  function e() {
2736
2860
  const i = t.s.animation.startTime, n = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
2737
- t.s.nowDuration = lt(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(D(t).animate1, {
2861
+ t.s.nowDuration = dt(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(k(t).animate1, {
2738
2862
  duration: t.s.nowDuration,
2739
2863
  iterations: 1 / 0
2740
- }), t.s.animation.startTime = i, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(D(t).animate2, {
2864
+ }), t.s.animation.startTime = i, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(k(t).animate2, {
2741
2865
  duration: t.s.nowDuration,
2742
2866
  delay: -t.s.nowDuration / 2,
2743
2867
  iterations: 1 / 0
2744
2868
  }), t.s.cloneAnimation.startTime = n);
2745
2869
  }
2746
- window.addEventListener("resize", ee(e));
2870
+ window.addEventListener("resize", de(e));
2747
2871
  }
2748
2872
  play() {
2749
2873
  this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
@@ -2752,8 +2876,8 @@ class ie extends HTMLElement {
2752
2876
  this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
2753
2877
  }
2754
2878
  }
2755
- customElements.define("marquee-el", ie);
2756
- const ct = function(s, t) {
2879
+ customElements.define("marquee-el", ue);
2880
+ const ut = function(s, t) {
2757
2881
  let e;
2758
2882
  return function(i) {
2759
2883
  e && clearTimeout(e), e = setTimeout(s, 200, i);
@@ -2775,7 +2899,7 @@ const ct = function(s, t) {
2775
2899
  }
2776
2900
  s.classList.remove(t);
2777
2901
  };
2778
- class dt {
2902
+ class pt {
2779
2903
  constructor(t) {
2780
2904
  this.$element = t, this.option = t.s.option.drag, this._didInitialScroll = !1, this.#t();
2781
2905
  }
@@ -2854,9 +2978,9 @@ class dt {
2854
2978
  t.removeEventListener("mouseup", l), t.addEventListener("mouseup", l);
2855
2979
  const c = function(u) {
2856
2980
  if (u.preventDefault(), i = !0, !e) return;
2857
- const p = u.pageX - t.offsetLeft - n;
2981
+ const m = u.pageX - t.offsetLeft - n;
2858
2982
  t.scrollTo({
2859
- left: o - p
2983
+ left: o - m
2860
2984
  });
2861
2985
  };
2862
2986
  t.removeEventListener("mousemove", c), t.addEventListener("mousemove", c);
@@ -2911,7 +3035,7 @@ class dt {
2911
3035
  });
2912
3036
  }
2913
3037
  }
2914
- class se {
3038
+ class pe {
2915
3039
  constructor(t) {
2916
3040
  this.$element = t, this.option = t.s.option.collapse, this.#t();
2917
3041
  }
@@ -2947,11 +3071,11 @@ class se {
2947
3071
  });
2948
3072
  }
2949
3073
  }
2950
- const ne = (s) => {
3074
+ const he = (s) => {
2951
3075
  const { type: t, option: e, originalDomString: i } = s.s, n = document.createElement("div");
2952
3076
  return t == "drag" && (n.innerHTML = x.TEMPLATE[t]().trim(), n.querySelector(".drag-container .wrapper").insertAdjacentHTML(E.append, i)), t == "collapse" && (n.innerHTML = x.TEMPLATE[t](e?.collapse).trim(), n.querySelector(".drag-container .wrapper").insertAdjacentHTML(E.append, i), n.querySelector(".collapse-container .wrapper").insertAdjacentHTML(E.append, i)), t == "dropdown" && (n.innerHTML = x.TEMPLATE[t](e?.dropdown).trim(), n.querySelector("dropdown-el").insertAdjacentHTML(E.append, i)), n.children;
2953
3077
  };
2954
- class oe extends HTMLElement {
3078
+ class me extends HTMLElement {
2955
3079
  constructor() {
2956
3080
  super(), this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
2957
3081
  }
@@ -2986,7 +3110,7 @@ class oe extends HTMLElement {
2986
3110
  }
2987
3111
  this.update();
2988
3112
  };
2989
- window.removeEventListener("resize", ct(e)), window.addEventListener("resize", ct(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, x.SETTINGS.drag, t?.drag), this.s.option.collapse = Object.assign({}, x.SETTINGS.collapse, t?.collapse), this.s.option.dropdown = Object.assign({}, x.SETTINGS.dropdown, t?.dropdown), this.s.option.breakpoint = Object.assign({}, x.SETTINGS.breakpoint, t?.breakpoint), this.#s();
3113
+ window.removeEventListener("resize", ut(e)), window.addEventListener("resize", ut(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, x.SETTINGS.drag, t?.drag), this.s.option.collapse = Object.assign({}, x.SETTINGS.collapse, t?.collapse), this.s.option.dropdown = Object.assign({}, x.SETTINGS.dropdown, t?.dropdown), this.s.option.breakpoint = Object.assign({}, x.SETTINGS.breakpoint, t?.breakpoint), this.#s();
2990
3114
  }
2991
3115
  #s() {
2992
3116
  this.classList.add("m4-init"), this.#e();
@@ -3027,14 +3151,14 @@ class oe extends HTMLElement {
3027
3151
  // check type
3028
3152
  #a() {
3029
3153
  const { type: t } = this.s;
3030
- switch (this.#o(), this.innerHTML = "", [...ne(this)].forEach((e) => {
3154
+ switch (this.#o(), this.innerHTML = "", [...he(this)].forEach((e) => {
3031
3155
  this.append(e);
3032
3156
  }), this.#i(), t) {
3033
3157
  case "drag":
3034
- this.drag = new dt(this);
3158
+ this.drag = new pt(this);
3035
3159
  break;
3036
3160
  case "collapse":
3037
- this.drag = new dt(this), this.collapse = new se(this);
3161
+ this.drag = new pt(this), this.collapse = new pe(this);
3038
3162
  break;
3039
3163
  case "dropdown":
3040
3164
  this.#n();
@@ -3042,8 +3166,8 @@ class oe extends HTMLElement {
3042
3166
  }
3043
3167
  }
3044
3168
  }
3045
- customElements.define("multipurpose-nav", oe);
3046
- class $t extends HTMLElement {
3169
+ customElements.define("multipurpose-nav", me);
3170
+ class Ht extends HTMLElement {
3047
3171
  // 定義組件的初始狀態
3048
3172
  constructor(t, e) {
3049
3173
  super();
@@ -3059,7 +3183,7 @@ class $t extends HTMLElement {
3059
3183
  this.classList.contains("t4-initialize") || this.#t();
3060
3184
  }
3061
3185
  #t() {
3062
- const t = this.getAttribute("t4-name"), { SETTINGS: e } = gt;
3186
+ const t = this.getAttribute("t4-name"), { SETTINGS: e } = vt;
3063
3187
  document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
3064
3188
  tabs: [],
3065
3189
  name: t,
@@ -3241,7 +3365,7 @@ class $t extends HTMLElement {
3241
3365
  const t = this;
3242
3366
  window.addEventListener(
3243
3367
  "resize",
3244
- ae(() => {
3368
+ ge(() => {
3245
3369
  t.update();
3246
3370
  }, 1e3)
3247
3371
  );
@@ -3275,16 +3399,16 @@ class $t extends HTMLElement {
3275
3399
  }
3276
3400
  // 外部呼叫方法 $0.update()
3277
3401
  update() {
3278
- this.t.tabs = this.#e(), kt(), console.log("tab update!!!!");
3402
+ this.t.tabs = this.#e(), qt(), console.log("tab update!!!!");
3279
3403
  }
3280
3404
  }
3281
- function ae(s, t = 1e3) {
3405
+ function ge(s, t = 1e3) {
3282
3406
  let e;
3283
3407
  return function(i) {
3284
3408
  e && clearTimeout(e), e = setTimeout(s, t, i);
3285
3409
  };
3286
3410
  }
3287
- function kt() {
3411
+ function qt() {
3288
3412
  const s = document.querySelectorAll("[t4-control]");
3289
3413
  document.addEventListener("click", function(t) {
3290
3414
  let e = !1;
@@ -3314,17 +3438,17 @@ function kt() {
3314
3438
  }
3315
3439
  });
3316
3440
  }
3317
- kt();
3318
- Object.assign($t.prototype, N);
3319
- customElements.define("tab-el", $t);
3320
- const ut = (s) => {
3441
+ qt();
3442
+ Object.assign(Ht.prototype, N);
3443
+ customElements.define("tab-el", Ht);
3444
+ const ht = (s) => {
3321
3445
  const { defaultOptions: t } = s.collapse, { collapseClass: e, target: i, transition: n } = t, o = s.querySelector(i);
3322
3446
  s.classList.add(e), o.style.height = 0, o.style["transition-property"] = n.property, o.style["transition-duration"] = n.duration, o.style["transition-timing-function"] = n.function, o.style["transition-delay"] = n.delay, o.style.overflow = "hidden";
3323
- }, re = (s) => {
3447
+ }, fe = (s) => {
3324
3448
  const { defaultOptions: t } = s.collapse, { collapseClass: e, target: i, transition: n } = t, o = s.querySelector(i), a = o.children[0].offsetHeight;
3325
3449
  s.collapse.height = a, s.classList.remove(e), o.style.display = "block", o.style.height = `${a}px`, o.style["transition-property"] = n.property, o.style["transition-duration"] = n.duration, o.style["transition-timing-function"] = n.function, o.style["transition-delay"] = n.delay, o.style.overflow = "hidden";
3326
3450
  };
3327
- class le {
3451
+ class ve {
3328
3452
  constructor(t, e = {}) {
3329
3453
  !R(t) && !Q(t) && !X(t) && !T(t) || (this.__storage__ = {
3330
3454
  el: t,
@@ -3332,7 +3456,7 @@ class le {
3332
3456
  }, this.active = "data-collapse-active", this.#t());
3333
3457
  }
3334
3458
  #t() {
3335
- const { el: t, options: e } = this.__storage__, { SETTINGS: i, EVENTS: n } = ft;
3459
+ const { el: t, options: e } = this.__storage__, { SETTINGS: i, EVENTS: n } = bt;
3336
3460
  if (this.elements = e.state == "not active" ? S(t + `:not([${this.active}])`) : S(t), this.options = Object.assign({}, i, e), this.__events__ = Object.assign({}, n), this.options.on)
3337
3461
  for (const [o, a] of Object.entries(this.options.on))
3338
3462
  this.__events__[o] = [a];
@@ -3356,28 +3480,28 @@ class le {
3356
3480
  #i() {
3357
3481
  const { instance: t, defaultOptions: e } = this.collapse, { collapseClass: i, block: n, target: o, single: a } = e, r = this;
3358
3482
  r.classList.contains(i) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
3359
- ut(l);
3360
- }), re(r)) : ut(r), t.emit("afterCollapse");
3483
+ ht(l);
3484
+ }), fe(r)) : ht(r), t.emit("afterCollapse");
3361
3485
  }
3362
3486
  update() {
3363
3487
  this.#t();
3364
3488
  }
3365
3489
  }
3366
- Object.assign(le.prototype, N);
3367
- function ce(s, t) {
3490
+ Object.assign(ve.prototype, N);
3491
+ function be(s, t) {
3368
3492
  const e = t, { color: i, opacity: n, duration: o } = t.s.options;
3369
3493
  let a = document.createElement("span"), r = s.clientX - e.getBoundingClientRect().left, l = s.clientY - e.getBoundingClientRect().top;
3370
3494
  a.style.cssText = `background: ${i};left: ${r}px;top: ${l}px;opacity: ${n};animation-duration: ${o}ms`, a.classList.add("circle"), e.appendChild(a), setTimeout(function() {
3371
3495
  a.remove();
3372
3496
  }, `${o}`);
3373
3497
  }
3374
- function xt() {
3498
+ function It() {
3375
3499
  document.querySelectorAll("ripple-btn").forEach((s) => {
3376
3500
  s.querySelector(".hover-ball"), s.style.setProperty("--r", ""), s.classList.remove("entered");
3377
3501
  });
3378
3502
  }
3379
- document.addEventListener("click", xt);
3380
- class de extends HTMLElement {
3503
+ document.addEventListener("click", It);
3504
+ class ye extends HTMLElement {
3381
3505
  constructor() {
3382
3506
  super(), this.initialize = !1;
3383
3507
  }
@@ -3386,7 +3510,7 @@ class de extends HTMLElement {
3386
3510
  t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, this.#t());
3387
3511
  }
3388
3512
  #t() {
3389
- const { SETTINGS: t } = vt;
3513
+ const { SETTINGS: t } = yt;
3390
3514
  this.s = {};
3391
3515
  function e(n) {
3392
3516
  let o = !!n;
@@ -3412,11 +3536,11 @@ class de extends HTMLElement {
3412
3536
  #i() {
3413
3537
  const t = this.querySelector("i.hover-ball"), e = this;
3414
3538
  e.addEventListener("click", function(o) {
3415
- o.stopPropagation(), e.s.options.click && ce(o, e);
3539
+ e.s.options.click && be(o, e);
3416
3540
  });
3417
3541
  let i = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", n = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
3418
3542
  e.addEventListener(i, function(o) {
3419
- if (i === "touchstart" && xt(), e.s.options.hover) {
3543
+ if (i === "touchstart" && It(), e.s.options.hover) {
3420
3544
  const a = Math.round(i === "mouseenter" ? o.clientX - e.getBoundingClientRect().left : o.changedTouches[0].clientX - e.getBoundingClientRect().x), r = Math.round(i === "mouseenter" ? o.clientY - e.getBoundingClientRect().top : o.changedTouches[0].clientY - e.getBoundingClientRect().y), { offsetWidth: l, offsetHeight: c } = e, d = Math.max(l, c);
3421
3545
  t.style.width = d * 2 + "px", t.style.height = d * 2 + "px", t.style.left = a + "px", t.style.top = r + "px", e.classList.add("entered");
3422
3546
  }
@@ -3431,8 +3555,8 @@ class de extends HTMLElement {
3431
3555
  this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), this.#t();
3432
3556
  }
3433
3557
  }
3434
- customElements.define("ripple-btn", de);
3435
- class ue {
3558
+ customElements.define("ripple-btn", ye);
3559
+ class we {
3436
3560
  constructor() {
3437
3561
  this.init();
3438
3562
  }
@@ -3484,12 +3608,12 @@ class ue {
3484
3608
  this.init();
3485
3609
  }
3486
3610
  }
3487
- function pt(s, t) {
3611
+ function mt(s, t) {
3488
3612
  return s ? function(e, i) {
3489
3613
  Function(s)(e, i);
3490
3614
  } : t;
3491
3615
  }
3492
- function pe(s, t, e, i) {
3616
+ function Te(s, t, e, i) {
3493
3617
  const n = t.params, o = s.closest("[data-upload-item]").querySelector("[data-preview]");
3494
3618
  o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(i.imgElement);
3495
3619
  const a = s.dataset.group, r = document.querySelector(t.el).dataset.index;
@@ -3512,7 +3636,7 @@ function pe(s, t, e, i) {
3512
3636
  info: i
3513
3637
  }, n.on.changeAfter && typeof n.on.changeAfter == "function" && n.on.changeAfter(s, i);
3514
3638
  }
3515
- function he(s, t, e, i) {
3639
+ function Ee(s, t, e, i) {
3516
3640
  const n = document.createElement("canvas"), o = n.getContext("2d"), a = t.width, l = t.height / a * 100, c = i / e * 100;
3517
3641
  let d = 0, u = 0;
3518
3642
  switch (n.width = e, n.height = i, s.previewSize) {
@@ -3523,17 +3647,17 @@ function he(s, t, e, i) {
3523
3647
  l < c ? (d = i / l * 100, u = n.height) : l > c ? (d = n.width, u = e * l / 100) : l === c && (d = n.width, u = n.height);
3524
3648
  break;
3525
3649
  }
3526
- const h = (n.width - d) * 0.5, p = (n.height - u) * 0.5;
3527
- return o.drawImage(t, h, p, d, u), n;
3650
+ const h = (n.width - d) * 0.5, m = (n.height - u) * 0.5;
3651
+ return o.drawImage(t, h, m, d, u), n;
3528
3652
  }
3529
- function me(s, t) {
3653
+ function Ae(s, t) {
3530
3654
  return new Promise((e, i) => {
3531
3655
  if (t) {
3532
3656
  const n = new Image();
3533
3657
  n.src = t, n.classList.add(s.previewSize), n.onload = () => {
3534
3658
  let o = {
3535
3659
  imgElement: n,
3536
- originalCanvas: he(s, n, n.width, n.height),
3660
+ originalCanvas: Ee(s, n, n.width, n.height),
3537
3661
  info: {
3538
3662
  originalWidth: n.width,
3539
3663
  originalHeight: n.height,
@@ -3546,30 +3670,30 @@ function me(s, t) {
3546
3670
  e();
3547
3671
  });
3548
3672
  }
3549
- function ge(s, t) {
3673
+ function Se(s, t) {
3550
3674
  const e = Math.pow(10, t);
3551
3675
  return Math.round(s * e) / e;
3552
3676
  }
3553
- function fe(s, t) {
3677
+ function Le(s, t) {
3554
3678
  let e = s.size / 1024 / 1024;
3555
- return `${ge(e, 2)}` <= t;
3679
+ return `${Se(e, 2)}` <= t;
3556
3680
  }
3557
- function ve(s, t, e) {
3681
+ function _e(s, t, e) {
3558
3682
  if (s.target.files.length <= 0) return;
3559
3683
  const i = s.target.files[0], n = t.closest("[data-upload-item]");
3560
3684
  let o = new FileReader();
3561
3685
  o.onload = (a) => {
3562
3686
  const r = i.type.split("/")[0] === "image" ? a.target.result : null;
3563
- if (e.params.sizeLimit && !fe(i, e.params.sizeLimit)) {
3687
+ if (e.params.sizeLimit && !Le(i, e.params.sizeLimit)) {
3564
3688
  t.value = "", n.classList.add("over-limit"), e.params.on.overLimit && typeof e.params.on.overLimit == "function" && e.params.on.overLimit(t, e.params.sizeLimit);
3565
3689
  return;
3566
3690
  } else
3567
- n.classList.remove("over-limit"), n.classList.add("uploaded"), me(e.params, r).then((l) => {
3568
- pe(t, e, i, l);
3691
+ n.classList.remove("over-limit"), n.classList.add("uploaded"), Ae(e.params, r).then((l) => {
3692
+ Te(t, e, i, l);
3569
3693
  });
3570
3694
  }, o.readAsDataURL(i);
3571
3695
  }
3572
- class be {
3696
+ class ke {
3573
3697
  constructor(t, e) {
3574
3698
  const i = this;
3575
3699
  i.el = t, i.params = {
@@ -3597,67 +3721,70 @@ class be {
3597
3721
  previewSize: i.dataset.previewSize || t.params.previewSize,
3598
3722
  compress: i.dataset.compress || t.params.compress,
3599
3723
  on: {
3600
- changeAfter: pt(i.dataset.changeAfter, t.params.on.changeAfter),
3601
- overLimit: pt(i.dataset.overLimit, t.params.on.overLimit)
3724
+ changeAfter: mt(i.dataset.changeAfter, t.params.on.changeAfter),
3725
+ overLimit: mt(i.dataset.overLimit, t.params.on.overLimit)
3602
3726
  }
3603
3727
  };
3604
3728
  t.params = o, typeof uploadImage[`${o.group}`] > "u" && (uploadImage[`${o.group}`] = []), i.dataset.group || (i.dataset.group = o.group), i.dataset.index = document.querySelectorAll(`[data-group="${o.group}"]`).length - 1, i.addEventListener("change", function(a) {
3605
- ve(a, i, t);
3729
+ _e(a, i, t);
3606
3730
  });
3607
3731
  }));
3608
3732
  }
3609
3733
  }
3610
3734
  export {
3611
- bt as A,
3612
- T as B,
3613
- le as C,
3614
- Dt as D,
3615
- X as E,
3616
- R as F,
3617
- Ue as G,
3618
- Fe as H,
3619
- be as I,
3620
- $e as J,
3621
- De as K,
3622
- Ye as L,
3623
- ie as M,
3624
- Lt as N,
3625
- _t as O,
3626
- It as P,
3627
- Oe as Q,
3628
- de as R,
3629
- Xe as S,
3630
- $t as T,
3631
- xe as U,
3632
- Pe as V,
3633
- W,
3634
- Z as X,
3635
- Be as Y,
3636
- At as a,
3637
- ue as b,
3735
+ Qe as $,
3736
+ wt as A,
3737
+ ri as B,
3738
+ ve as C,
3739
+ Ct as D,
3740
+ je as E,
3741
+ E as F,
3742
+ T as G,
3743
+ X as H,
3744
+ ke as I,
3745
+ R as J,
3746
+ ii as K,
3747
+ ni as L,
3748
+ ue as M,
3749
+ Ne as N,
3750
+ Pe as O,
3751
+ si as P,
3752
+ $t as Q,
3753
+ ye as R,
3754
+ xt as S,
3755
+ Ht as T,
3756
+ Pt as U,
3757
+ Ue as V,
3758
+ ei as W,
3759
+ ze as X,
3760
+ Ye as Y,
3761
+ G as Z,
3762
+ J as _,
3763
+ kt as a,
3764
+ we as b,
3638
3765
  C as c,
3639
- oe as d,
3640
- Xt as e,
3641
- He as f,
3642
- qt as g,
3643
- Ce as h,
3644
- Me as i,
3645
- qe as j,
3646
- _e as k,
3647
- Ne as l,
3648
- Mt as m,
3649
- Ut as n,
3650
- je as o,
3651
- Ie as p,
3652
- ze as q,
3766
+ me as d,
3767
+ te as e,
3768
+ Ge as f,
3769
+ Nt as g,
3770
+ Be as h,
3771
+ Oe as i,
3772
+ V as j,
3773
+ Xe as k,
3774
+ Re as l,
3775
+ Me as m,
3776
+ Fe as n,
3777
+ jt as o,
3778
+ ee as p,
3779
+ Ze as q,
3653
3780
  We as r,
3654
- S as s,
3655
- Ge as t,
3656
- Re as u,
3657
- Je as v,
3658
- Ze as w,
3659
- Qe as x,
3660
- ke as y,
3661
- E as z
3781
+ Je as s,
3782
+ Ke as t,
3783
+ S as u,
3784
+ Et as v,
3785
+ Ve as w,
3786
+ ti as x,
3787
+ oi as y,
3788
+ ai as z
3662
3789
  };
3663
3790
  //# sourceMappingURL=image-preview-bundle.js.map