@hbis-uni/components 2.0.5 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,25 +1,25 @@
1
- import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString, createElementVNode, createCommentVNode, computed, ref, onMounted, watch, Fragment, renderList, normalizeStyle, useCssVars, nextTick, onUnmounted } from "vue";
2
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1
+ import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString, createElementVNode, createCommentVNode, computed, ref, onMounted, watch, Fragment, renderList, normalizeStyle, useCssVars, nextTick, onUnmounted, useSlots, resolveComponent, withDirectives, vModelText, createVNode, withCtx } from "vue";
2
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3
3
  __name: "C1",
4
4
  props: {
5
5
  title: { default: "C1 Component" },
6
6
  primary: { type: Boolean, default: !1 }
7
7
  },
8
- setup(y) {
9
- return (g, n) => (openBlock(), createElementBlock("div", {
10
- class: normalizeClass(["c1-container", { "c1-primary": y.primary }])
8
+ setup(p) {
9
+ return (g, o) => (openBlock(), createElementBlock("div", {
10
+ class: normalizeClass(["c1-container", { "c1-primary": p.primary }])
11
11
  }, [
12
12
  renderSlot(g.$slots, "default", {}, () => [
13
- createTextVNode(toDisplayString(y.title), 1)
13
+ createTextVNode(toDisplayString(p.title), 1)
14
14
  ], !0)
15
15
  ], 2));
16
16
  }
17
- }), _export_sfc = (y, g) => {
18
- const n = y.__vccOpts || y;
17
+ }), _export_sfc = (p, g) => {
18
+ const o = p.__vccOpts || p;
19
19
  for (const [t, r] of g)
20
- n[t] = r;
21
- return n;
22
- }, C1 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-e2028f64"]]), _hoisted_1$2 = { class: "c2-container" }, _hoisted_2$2 = { class: "c2-title" }, _hoisted_3$2 = { class: "c2-content" }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
20
+ o[t] = r;
21
+ return o;
22
+ }, C1 = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-e2028f64"]]), _hoisted_1$4 = { class: "c2-container" }, _hoisted_2$4 = { class: "c2-title" }, _hoisted_3$4 = { class: "c2-content" }, _sfc_main$6 = /* @__PURE__ */ defineComponent({
23
23
  __name: "C2",
24
24
  props: {
25
25
  title: { default: "C2 Component" },
@@ -27,33 +27,33 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
27
27
  buttonText: { default: "Click Me" }
28
28
  },
29
29
  emits: ["click"],
30
- setup(y, { emit: g }) {
31
- const n = g, t = (r) => {
32
- n("click", r);
30
+ setup(p, { emit: g }) {
31
+ const o = g, t = (r) => {
32
+ o("click", r);
33
33
  };
34
- return (r, v) => (openBlock(), createElementBlock("div", _hoisted_1$2, [
35
- createElementVNode("h2", _hoisted_2$2, toDisplayString(y.title), 1),
36
- createElementVNode("div", _hoisted_3$2, [
34
+ return (r, h) => (openBlock(), createElementBlock("div", _hoisted_1$4, [
35
+ createElementVNode("h2", _hoisted_2$4, toDisplayString(p.title), 1),
36
+ createElementVNode("div", _hoisted_3$4, [
37
37
  renderSlot(r.$slots, "default", {}, void 0, !0)
38
38
  ]),
39
- y.showButton ? (openBlock(), createElementBlock("button", {
39
+ p.showButton ? (openBlock(), createElementBlock("button", {
40
40
  key: 0,
41
41
  class: "c2-button",
42
42
  onClick: t
43
- }, toDisplayString(y.buttonText), 1)) : createCommentVNode("", !0)
43
+ }, toDisplayString(p.buttonText), 1)) : createCommentVNode("", !0)
44
44
  ]));
45
45
  }
46
- }), C2 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-b1d573ae"]]), _hoisted_1$1 = { key: 0 }, _hoisted_2$1 = { class: "hbis-date-strip__weekdays" }, _hoisted_3$1 = { class: "hbis-date-strip__dates" }, _hoisted_4$1 = ["onClick"], _hoisted_5$1 = { class: "hbis-date-strip__date-number" }, _hoisted_6$1 = { class: "hbis-date-strip__date-slot" }, _hoisted_7$1 = {
46
+ }), C2 = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-b1d573ae"]]), _hoisted_1$3 = { key: 0 }, _hoisted_2$3 = { class: "hbis-date-strip__weekdays" }, _hoisted_3$3 = { class: "hbis-date-strip__dates" }, _hoisted_4$3 = ["onClick"], _hoisted_5$3 = { class: "hbis-date-strip__date-number" }, _hoisted_6$2 = { class: "hbis-date-strip__date-slot" }, _hoisted_7$2 = {
47
47
  key: 1,
48
48
  class: "hbis-date-strip__scroll-wrapper"
49
- }, _hoisted_8$1 = { class: "hbis-date-strip__scroll-container" }, _hoisted_9 = { class: "hbis-date-strip__weekdays" }, _hoisted_10 = { class: "hbis-date-strip__dates" }, _hoisted_11 = ["onClick"], _hoisted_12 = { class: "hbis-date-strip__date-number" }, _hoisted_13 = { class: "hbis-date-strip__date-slot" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
49
+ }, _hoisted_8$1 = { class: "hbis-date-strip__scroll-container" }, _hoisted_9 = { class: "hbis-date-strip__weekdays" }, _hoisted_10 = { class: "hbis-date-strip__dates" }, _hoisted_11 = ["onClick"], _hoisted_12 = { class: "hbis-date-strip__date-number" }, _hoisted_13 = { class: "hbis-date-strip__date-slot" }, _sfc_main$5 = /* @__PURE__ */ defineComponent({
50
50
  __name: "hbis-dateStrip",
51
51
  props: {
52
52
  modelValue: { default: () => /* @__PURE__ */ new Date() },
53
53
  startDate: { default: () => /* @__PURE__ */ new Date() },
54
54
  endDate: { default: () => {
55
- const y = /* @__PURE__ */ new Date();
56
- return y.setDate(y.getDate() + 30), y;
55
+ const p = /* @__PURE__ */ new Date();
56
+ return p.setDate(p.getDate() + 30), p;
57
57
  } },
58
58
  highlightType: { default: "bg" },
59
59
  showToday: { type: Boolean, default: !0 },
@@ -67,33 +67,33 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
67
67
  visibleDays: { default: 7 }
68
68
  },
69
69
  emits: ["update:modelValue", "dateClick"],
70
- setup(y, { emit: g }) {
71
- const n = y, t = g, r = computed(() => {
70
+ setup(p, { emit: g }) {
71
+ const o = p, t = g, r = computed(() => {
72
72
  if (console.log("props:", {
73
- startDate: n.startDate,
74
- endDate: n.endDate,
75
- scrollable: n.scrollable
76
- }), n.scrollable)
73
+ startDate: o.startDate,
74
+ endDate: o.endDate,
75
+ scrollable: o.scrollable
76
+ }), o.scrollable)
77
77
  return console.log("显式设置了scrollable为true,允许滚动"), !0;
78
78
  try {
79
- const a = new Date(n.startDate);
80
- a.setHours(0, 0, 0, 0);
81
- const p = new Date(n.endDate);
82
- if (p.setHours(0, 0, 0, 0), isNaN(a.getTime()) || isNaN(p.getTime()))
79
+ const s = new Date(o.startDate);
80
+ s.setHours(0, 0, 0, 0);
81
+ const d = new Date(o.endDate);
82
+ if (d.setHours(0, 0, 0, 0), isNaN(s.getTime()) || isNaN(d.getTime()))
83
83
  return console.log("无效的日期对象,使用默认滚动行为"), !1;
84
- const e = p.getTime() - a.getTime(), A = Math.ceil(e / (1e3 * 60 * 60 * 24)), d = A + 1;
84
+ const e = d.getTime() - s.getTime(), x = Math.ceil(e / (1e3 * 60 * 60 * 24)), v = x + 1;
85
85
  return console.log("日期范围天数计算:", {
86
- start: a.toLocaleDateString(),
87
- end: p.toLocaleDateString(),
86
+ start: s.toLocaleDateString(),
87
+ end: d.toLocaleDateString(),
88
88
  diffTime: e,
89
- diffDays: A,
90
- totalDays: d,
91
- shouldScroll: d > 7
92
- }), d > 7;
93
- } catch (a) {
94
- return console.error("计算日期范围时出错:", a), !1;
89
+ diffDays: x,
90
+ totalDays: v,
91
+ shouldScroll: v > 7
92
+ }), v > 7;
93
+ } catch (s) {
94
+ return console.error("计算日期范围时出错:", s), !1;
95
95
  }
96
- }), v = [
96
+ }), h = [
97
97
  { value: 0, label: "日", isWeekend: !0 },
98
98
  { value: 1, label: "一", isWeekend: !1 },
99
99
  { value: 2, label: "二", isWeekend: !1 },
@@ -101,155 +101,155 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
101
101
  { value: 4, label: "四", isWeekend: !1 },
102
102
  { value: 5, label: "五", isWeekend: !1 },
103
103
  { value: 6, label: "六", isWeekend: !0 }
104
- ], h = computed(() => {
105
- const a = s.value[0];
106
- if (!a)
107
- return v;
108
- const p = a.weekday, e = [];
109
- for (let A = 0; A < 7; A++) {
110
- const d = (p + A) % 7;
111
- e.push(v[d]);
104
+ ], l = computed(() => {
105
+ const s = n.value[0];
106
+ if (!s)
107
+ return h;
108
+ const d = s.weekday, e = [];
109
+ for (let x = 0; x < 7; x++) {
110
+ const v = (d + x) % 7;
111
+ e.push(h[v]);
112
112
  }
113
113
  return e;
114
114
  });
115
115
  ref((() => {
116
- const a = n.startDate || /* @__PURE__ */ new Date(), p = a.getDay(), e = a.getDate() - (p === 0 ? 6 : p - 1), A = new Date(a);
117
- return A.setDate(e), A;
116
+ const s = o.startDate || /* @__PURE__ */ new Date(), d = s.getDay(), e = s.getDate() - (d === 0 ? 6 : d - 1), x = new Date(s);
117
+ return x.setDate(e), x;
118
118
  })()), onMounted(() => {
119
- console.log("props:", n), console.log("highlightType:", n.highlightType);
119
+ console.log("props:", o), console.log("highlightType:", o.highlightType);
120
120
  }), watch(
121
- () => n.highlightType,
122
- (a) => {
123
- console.log("highlightType changed:", a);
121
+ () => o.highlightType,
122
+ (s) => {
123
+ console.log("highlightType changed:", s);
124
124
  }
125
125
  ), watch(
126
- () => n.modelValue,
127
- (a) => {
128
- console.log("modelValue changed:", a);
126
+ () => o.modelValue,
127
+ (s) => {
128
+ console.log("modelValue changed:", s);
129
129
  }
130
130
  );
131
- const o = computed(() => {
132
- const a = [];
131
+ const c = computed(() => {
132
+ const s = [];
133
133
  try {
134
- const p = n.startDate, e = n.endDate;
135
- if (isNaN(p.getTime()) || isNaN(e.getTime()))
136
- return console.log("无效的日期对象,返回空数组"), a;
137
- const A = Math.ceil((e.getTime() - p.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
138
- for (let d = 0; d < A; d++) {
139
- const w = new Date(p);
140
- w.setDate(p.getDate() + d), isNaN(w.getTime()) || a.push({
141
- date: w,
142
- dateString: l(w),
143
- day: w.getDate(),
144
- month: w.getMonth() + 1,
145
- year: w.getFullYear(),
146
- isWeekend: w.getDay() === 0 || w.getDay() === 6,
147
- weekday: w.getDay()
134
+ const d = o.startDate, e = o.endDate;
135
+ if (isNaN(d.getTime()) || isNaN(e.getTime()))
136
+ return console.log("无效的日期对象,返回空数组"), s;
137
+ const x = Math.ceil((e.getTime() - d.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
138
+ for (let v = 0; v < x; v++) {
139
+ const _ = new Date(d);
140
+ _.setDate(d.getDate() + v), isNaN(_.getTime()) || s.push({
141
+ date: _,
142
+ dateString: f(_),
143
+ day: _.getDate(),
144
+ month: _.getMonth() + 1,
145
+ year: _.getFullYear(),
146
+ isWeekend: _.getDay() === 0 || _.getDay() === 6,
147
+ weekday: _.getDay()
148
148
  });
149
149
  }
150
- } catch (p) {
151
- console.error("生成日期数组时出错:", p);
150
+ } catch (d) {
151
+ console.error("生成日期数组时出错:", d);
152
152
  }
153
- return a;
154
- }), s = computed(() => o.value.filter((a) => !!(a && a.date && a.dateString && !isNaN(a.date.getTime()) && typeof a.dateString == "string" && typeof a.day == "number"))), l = (a) => `${a.getFullYear()}-${String(a.getMonth() + 1).padStart(2, "0")}-${String(a.getDate()).padStart(2, "0")}`, i = (a) => {
155
- const p = a.dateString;
156
- return n.modelValue ? Array.isArray(n.modelValue) ? n.modelValue.some((e) => !e || isNaN(e.getTime()) ? !1 : l(e) === p) : isNaN(n.modelValue.getTime()) ? !1 : l(n.modelValue) === p : !1;
157
- }, f = (a) => {
158
- const p = l(/* @__PURE__ */ new Date());
159
- return a.dateString === p;
160
- }, u = (a) => {
161
- const p = a.date;
162
- return n.disablePast && p < new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0)) || n.disableFuture && p > new Date((/* @__PURE__ */ new Date()).setHours(23, 59, 59, 999)) ? !1 : p >= n.startDate && p <= n.endDate;
163
- }, S = (a) => {
164
- var p;
165
- return ((p = v.find((e) => e.value === a)) == null ? void 0 : p.label) || "";
166
- }, k = (a) => {
167
- u(a) && (t("dateClick", a), t("update:modelValue", a.date));
153
+ return s;
154
+ }), n = computed(() => c.value.filter((s) => !!(s && s.date && s.dateString && !isNaN(s.date.getTime()) && typeof s.dateString == "string" && typeof s.day == "number"))), f = (s) => `${s.getFullYear()}-${String(s.getMonth() + 1).padStart(2, "0")}-${String(s.getDate()).padStart(2, "0")}`, i = (s) => {
155
+ const d = s.dateString;
156
+ return o.modelValue ? Array.isArray(o.modelValue) ? o.modelValue.some((e) => !e || isNaN(e.getTime()) ? !1 : f(e) === d) : isNaN(o.modelValue.getTime()) ? !1 : f(o.modelValue) === d : !1;
157
+ }, y = (s) => {
158
+ const d = f(/* @__PURE__ */ new Date());
159
+ return s.dateString === d;
160
+ }, a = (s) => {
161
+ const d = s.date;
162
+ return o.disablePast && d < new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0)) || o.disableFuture && d > new Date((/* @__PURE__ */ new Date()).setHours(23, 59, 59, 999)) ? !1 : d >= o.startDate && d <= o.endDate;
163
+ }, b = (s) => {
164
+ var d;
165
+ return ((d = h.find((e) => e.value === s)) == null ? void 0 : d.label) || "";
166
+ }, w = (s) => {
167
+ a(s) && (t("dateClick", s), t("update:modelValue", s.date));
168
168
  };
169
- return (a, p) => (openBlock(), createElementBlock("div", {
169
+ return (s, d) => (openBlock(), createElementBlock("div", {
170
170
  class: normalizeClass(["hbis-date-strip", {
171
- "hbis-date-strip--highlight-bg": y.highlightType === "bg",
172
- "hbis-date-strip--highlight-dot": y.highlightType === "dot",
173
- "hbis-date-strip--highlight-round": y.highlightType === "round",
171
+ "hbis-date-strip--highlight-bg": p.highlightType === "bg",
172
+ "hbis-date-strip--highlight-dot": p.highlightType === "dot",
173
+ "hbis-date-strip--highlight-round": p.highlightType === "round",
174
174
  "hbis-date-strip--scrollable": r.value
175
175
  }])
176
176
  }, [
177
- r.value ? (openBlock(), createElementBlock("div", _hoisted_7$1, [
177
+ r.value ? (openBlock(), createElementBlock("div", _hoisted_7$2, [
178
178
  createElementVNode("div", _hoisted_8$1, [
179
179
  createElementVNode("div", _hoisted_9, [
180
- (openBlock(!0), createElementBlock(Fragment, null, renderList(s.value, (e) => (openBlock(), createElementBlock("div", {
180
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (e) => (openBlock(), createElementBlock("div", {
181
181
  key: e.dateString + "-weekday",
182
182
  class: normalizeClass(["hbis-date-strip__weekday", {
183
183
  "hbis-date-strip__weekday--weekend": e.isWeekend
184
184
  }])
185
- }, toDisplayString(S(e.weekday)), 3))), 128))
185
+ }, toDisplayString(b(e.weekday)), 3))), 128))
186
186
  ]),
187
187
  createElementVNode("div", _hoisted_10, [
188
- (openBlock(!0), createElementBlock(Fragment, null, renderList(s.value, (e) => (openBlock(), createElementBlock("div", {
188
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (e) => (openBlock(), createElementBlock("div", {
189
189
  key: e.dateString,
190
190
  class: normalizeClass(["hbis-date-strip__date", {
191
191
  "hbis-date-strip__date--selected": i(e),
192
- "hbis-date-strip__date--today": f(e),
193
- "hbis-date-strip__date--disabled": !u(e),
192
+ "hbis-date-strip__date--today": y(e),
193
+ "hbis-date-strip__date--disabled": !a(e),
194
194
  "hbis-date-strip__date--weekend": e.isWeekend
195
195
  }]),
196
196
  style: normalizeStyle({
197
- color: i(e) ? y.selectedColor : y.normalColor,
198
- backgroundColor: i(e) ? y.selectedBgColor : y.normalBgColor
197
+ color: i(e) ? p.selectedColor : p.normalColor,
198
+ backgroundColor: i(e) ? p.selectedBgColor : p.normalBgColor
199
199
  }),
200
- onClick: (A) => k(e)
200
+ onClick: (x) => w(e)
201
201
  }, [
202
202
  createElementVNode("div", _hoisted_12, toDisplayString(e.day), 1),
203
203
  createElementVNode("div", _hoisted_13, [
204
- renderSlot(a.$slots, "default", { date: e }, void 0, !0)
204
+ renderSlot(s.$slots, "default", { date: e }, void 0, !0)
205
205
  ])
206
206
  ], 14, _hoisted_11))), 128))
207
207
  ])
208
208
  ])
209
- ])) : (openBlock(), createElementBlock("div", _hoisted_1$1, [
210
- createElementVNode("div", _hoisted_2$1, [
211
- (openBlock(!0), createElementBlock(Fragment, null, renderList(h.value, (e) => (openBlock(), createElementBlock("div", {
209
+ ])) : (openBlock(), createElementBlock("div", _hoisted_1$3, [
210
+ createElementVNode("div", _hoisted_2$3, [
211
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(l.value, (e) => (openBlock(), createElementBlock("div", {
212
212
  key: e.value,
213
213
  class: normalizeClass(["hbis-date-strip__weekday", {
214
214
  "hbis-date-strip__weekday--weekend": e.isWeekend
215
215
  }])
216
216
  }, toDisplayString(e.label), 3))), 128))
217
217
  ]),
218
- createElementVNode("div", _hoisted_3$1, [
219
- (openBlock(!0), createElementBlock(Fragment, null, renderList(s.value, (e) => (openBlock(), createElementBlock("div", {
218
+ createElementVNode("div", _hoisted_3$3, [
219
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (e) => (openBlock(), createElementBlock("div", {
220
220
  key: e.dateString,
221
221
  class: normalizeClass(["hbis-date-strip__date", {
222
222
  "hbis-date-strip__date--selected": i(e),
223
- "hbis-date-strip__date--today": f(e),
224
- "hbis-date-strip__date--disabled": !u(e),
223
+ "hbis-date-strip__date--today": y(e),
224
+ "hbis-date-strip__date--disabled": !a(e),
225
225
  "hbis-date-strip__date--weekend": e.isWeekend
226
226
  }]),
227
227
  style: normalizeStyle({
228
- color: i(e) ? y.selectedColor : y.normalColor,
229
- backgroundColor: i(e) ? y.selectedBgColor : y.normalBgColor
228
+ color: i(e) ? p.selectedColor : p.normalColor,
229
+ backgroundColor: i(e) ? p.selectedBgColor : p.normalBgColor
230
230
  }),
231
- onClick: (A) => k(e)
231
+ onClick: (x) => w(e)
232
232
  }, [
233
- createElementVNode("div", _hoisted_5$1, toDisplayString(e.day), 1),
234
- createElementVNode("div", _hoisted_6$1, [
235
- renderSlot(a.$slots, "default", { date: e }, void 0, !0)
233
+ createElementVNode("div", _hoisted_5$3, toDisplayString(e.day), 1),
234
+ createElementVNode("div", _hoisted_6$2, [
235
+ renderSlot(s.$slots, "default", { date: e }, void 0, !0)
236
236
  ])
237
- ], 14, _hoisted_4$1))), 128))
237
+ ], 14, _hoisted_4$3))), 128))
238
238
  ])
239
239
  ]))
240
240
  ], 2));
241
241
  }
242
- }), hbisDateStrip = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-2e8258eb"]]), _hoisted_1 = { class: "image-preview" }, _hoisted_2 = {
242
+ }), hbisDateStrip = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-2e8258eb"]]), _hoisted_1$2 = { class: "image-preview" }, _hoisted_2$2 = {
243
243
  key: 0,
244
244
  class: "counter"
245
- }, _hoisted_3 = { class: "counter-text" }, _hoisted_4 = { class: "swiper-container" }, _hoisted_5 = ["onWheel"], _hoisted_6 = ["src", "onLoad"], _hoisted_7 = ["disabled"], _hoisted_8 = ["disabled"], _sfc_main$2 = {
245
+ }, _hoisted_3$2 = { class: "counter-text" }, _hoisted_4$2 = { class: "swiper-container" }, _hoisted_5$2 = ["onWheel"], _hoisted_6$1 = ["src", "onLoad"], _hoisted_7$1 = ["disabled"], _hoisted_8 = ["disabled"], _sfc_main$4 = {
246
246
  __name: "hbis-previewImage",
247
247
  props: {
248
248
  // 图片集合
249
249
  images: {
250
250
  type: Array,
251
251
  required: !0,
252
- validator: (y) => y.every((g) => typeof g == "string")
252
+ validator: (p) => p.every((g) => typeof g == "string")
253
253
  },
254
254
  // 当前显示的图片索引
255
255
  initialIndex: {
@@ -278,129 +278,129 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
278
278
  }
279
279
  },
280
280
  emits: ["close", "change", "update:initialIndex"],
281
- setup(y, { emit: g }) {
282
- const n = y, t = g, r = ref(n.initialIndex), v = ref(null), h = ref(!1), m = ref(!1), o = ref(0), s = ref(0), l = ref(0), i = ref(window.innerWidth), f = ref(window.innerHeight), u = ref(n.images.map(() => ({
281
+ setup(p, { emit: g }) {
282
+ const o = p, t = g, r = ref(o.initialIndex), h = ref(null), l = ref(!1), u = ref(!1), c = ref(0), n = ref(0), f = ref(0), i = ref(window.innerWidth), y = ref(window.innerHeight), a = ref(o.images.map(() => ({
283
283
  scale: 1,
284
284
  translateX: 0,
285
285
  translateY: 0,
286
286
  naturalWidth: 0,
287
287
  naturalHeight: 0,
288
288
  isLoaded: !1
289
- }))), S = ref(0), k = ref(0), a = ref(0), p = ref(0), e = ref(0), A = computed(() => ({
290
- transform: `translateX(${l.value}px)`,
291
- transition: h.value ? "none" : "transform 0.3s ease"
292
- })), d = computed(() => ({
289
+ }))), b = ref(0), w = ref(0), s = ref(0), d = ref(0), e = ref(0), x = computed(() => ({
290
+ transform: `translateX(${f.value}px)`,
291
+ transition: l.value ? "none" : "transform 0.3s ease"
292
+ })), v = computed(() => ({
293
293
  width: `${i.value}px`,
294
- height: `${f.value}px`
294
+ height: `${y.value}px`
295
295
  }));
296
- watch(() => n.initialIndex, (c) => {
297
- c !== r.value && (r.value = c, w());
296
+ watch(() => o.initialIndex, (m) => {
297
+ m !== r.value && (r.value = m, _());
298
298
  }), onMounted(() => {
299
- const c = () => {
300
- i.value = window.innerWidth, f.value = window.innerHeight, w();
299
+ const m = () => {
300
+ i.value = window.innerWidth, y.value = window.innerHeight, _();
301
301
  };
302
- return window.addEventListener("resize", c), c(), () => {
303
- window.removeEventListener("resize", c);
302
+ return window.addEventListener("resize", m), m(), () => {
303
+ window.removeEventListener("resize", m);
304
304
  };
305
305
  });
306
- const w = () => {
307
- l.value = -r.value * i.value;
308
- }, x = () => {
309
- r.value > 0 && (r.value--, w(), N(), t("change", r.value), t("update:initialIndex", r.value));
310
- }, _ = () => {
311
- r.value < n.images.length - 1 && (r.value++, w(), N(), t("change", r.value), t("update:initialIndex", r.value));
312
- }, N = () => {
313
- u.value[r.value] = {
314
- ...u.value[r.value],
306
+ const _ = () => {
307
+ f.value = -r.value * i.value;
308
+ }, E = () => {
309
+ r.value > 0 && (r.value--, _(), O(), t("change", r.value), t("update:initialIndex", r.value));
310
+ }, S = () => {
311
+ r.value < o.images.length - 1 && (r.value++, _(), O(), t("change", r.value), t("update:initialIndex", r.value));
312
+ }, O = () => {
313
+ a.value[r.value] = {
314
+ ...a.value[r.value],
315
315
  scale: 1,
316
316
  translateX: 0,
317
317
  translateY: 0
318
318
  };
319
- }, T = (c) => {
320
- const b = u.value[c];
319
+ }, T = (m) => {
320
+ const k = a.value[m];
321
321
  return {
322
- transform: `scale(${b.scale}) translate(${b.translateX}px, ${b.translateY}px)`,
323
- transition: m.value ? "none" : "transform 0.1s ease",
324
- opacity: b.isLoaded ? 1 : 0
322
+ transform: `scale(${k.scale}) translate(${k.translateX}px, ${k.translateY}px)`,
323
+ transition: u.value ? "none" : "transform 0.1s ease",
324
+ opacity: k.isLoaded ? 1 : 0
325
325
  };
326
- }, F = (c) => {
327
- const b = event.target;
328
- u.value[c] = {
329
- ...u.value[c],
330
- naturalWidth: b.naturalWidth,
331
- naturalHeight: b.naturalHeight,
326
+ }, I = (m) => {
327
+ const k = event.target;
328
+ a.value[m] = {
329
+ ...a.value[m],
330
+ naturalWidth: k.naturalWidth,
331
+ naturalHeight: k.naturalHeight,
332
332
  isLoaded: !0
333
333
  };
334
- }, C = (c) => {
335
- c.target.tagName === "IMG" ? (m.value = !0, o.value = c.clientX - u.value[r.value].translateX, s.value = c.clientY - u.value[r.value].translateY) : (h.value = !0, o.value = c.clientX - l.value), c.preventDefault();
336
- }, D = (c) => {
337
- if (m.value) {
338
- const b = c.clientX - o.value, O = c.clientY - s.value;
339
- u.value[r.value] = {
340
- ...u.value[r.value],
341
- translateX: b,
342
- translateY: O
334
+ }, C = (m) => {
335
+ m.target.tagName === "IMG" ? (u.value = !0, c.value = m.clientX - a.value[r.value].translateX, n.value = m.clientY - a.value[r.value].translateY) : (l.value = !0, c.value = m.clientX - f.value), m.preventDefault();
336
+ }, B = (m) => {
337
+ if (u.value) {
338
+ const k = m.clientX - c.value, N = m.clientY - n.value;
339
+ a.value[r.value] = {
340
+ ...a.value[r.value],
341
+ translateX: k,
342
+ translateY: N
343
343
  };
344
- } else if (h.value && n.enableSwipe) {
345
- const b = c.clientX - o.value;
346
- l.value = b;
344
+ } else if (l.value && o.enableSwipe) {
345
+ const k = m.clientX - c.value;
346
+ f.value = k;
347
347
  }
348
- }, P = () => {
349
- if (h.value && n.enableSwipe) {
350
- const c = i.value * 0.3;
351
- Math.abs(l.value + r.value * i.value) > c ? l.value > 0 ? x() : _() : w();
348
+ }, $ = () => {
349
+ if (l.value && o.enableSwipe) {
350
+ const m = i.value * 0.3;
351
+ Math.abs(f.value + r.value * i.value) > m ? f.value > 0 ? E() : S() : _();
352
352
  }
353
- h.value = !1, m.value = !1;
354
- }, L = (c) => {
355
- const b = c.touches[0];
356
- S.value = b.clientX, k.value = b.clientY, a.value = Date.now();
357
- }, V = (c) => {
358
- const b = c.touches[0];
359
- p.value = b.clientX, e.value = b.clientY;
360
- const O = p.value - S.value, E = e.value - k.value;
361
- if (Math.abs(O) > Math.abs(E))
362
- c.preventDefault(), h.value = !0, l.value = -r.value * i.value + O;
363
- else if (u.value[r.value].scale > 1) {
364
- c.preventDefault(), m.value = !0;
365
- const B = O + u.value[r.value].translateX, j = E + u.value[r.value].translateY;
366
- u.value[r.value] = {
367
- ...u.value[r.value],
368
- translateX: B,
353
+ l.value = !1, u.value = !1;
354
+ }, R = (m) => {
355
+ const k = m.touches[0];
356
+ b.value = k.clientX, w.value = k.clientY, s.value = Date.now();
357
+ }, V = (m) => {
358
+ const k = m.touches[0];
359
+ d.value = k.clientX, e.value = k.clientY;
360
+ const N = d.value - b.value, A = e.value - w.value;
361
+ if (Math.abs(N) > Math.abs(A))
362
+ m.preventDefault(), l.value = !0, f.value = -r.value * i.value + N;
363
+ else if (a.value[r.value].scale > 1) {
364
+ m.preventDefault(), u.value = !0;
365
+ const D = N + a.value[r.value].translateX, j = A + a.value[r.value].translateY;
366
+ a.value[r.value] = {
367
+ ...a.value[r.value],
368
+ translateX: D,
369
369
  translateY: j
370
370
  };
371
371
  }
372
372
  }, M = () => {
373
- if (h.value) {
374
- const c = p.value - S.value, b = Date.now() - a.value, O = i.value * 0.2, E = Math.abs(c) / b;
375
- Math.abs(c) > O || E > 0.5 ? c > 0 ? x() : _() : w();
373
+ if (l.value) {
374
+ const m = d.value - b.value, k = Date.now() - s.value, N = i.value * 0.2, A = Math.abs(m) / k;
375
+ Math.abs(m) > N || A > 0.5 ? m > 0 ? E() : S() : _();
376
376
  }
377
- h.value = !1, m.value = !1;
378
- }, I = (c, b) => {
379
- if (b !== r.value) return;
380
- c.preventDefault();
381
- const O = c.deltaY > 0 ? -0.1 : 0.1, E = c.clientX, B = c.clientY;
382
- W(E, B, O);
383
- }, W = (c, b, O) => {
384
- const E = u.value[r.value], B = Math.max(
385
- n.minScale,
386
- Math.min(n.maxScale, E.scale + O)
387
- ), j = event.target.getBoundingClientRect(), $ = c - j.left, R = b - j.top, z = B - E.scale, U = E.translateX + ($ - E.translateX) * (z / E.scale), X = E.translateY + (R - E.translateY) * (z / E.scale);
388
- u.value[r.value] = {
389
- ...E,
390
- scale: B,
377
+ l.value = !1, u.value = !1;
378
+ }, F = (m, k) => {
379
+ if (k !== r.value) return;
380
+ m.preventDefault();
381
+ const N = m.deltaY > 0 ? -0.1 : 0.1, A = m.clientX, D = m.clientY;
382
+ W(A, D, N);
383
+ }, W = (m, k, N) => {
384
+ const A = a.value[r.value], D = Math.max(
385
+ o.minScale,
386
+ Math.min(o.maxScale, A.scale + N)
387
+ ), j = event.target.getBoundingClientRect(), L = m - j.left, P = k - j.top, z = D - A.scale, U = A.translateX + (L - A.translateX) * (z / A.scale), H = A.translateY + (P - A.translateY) * (z / A.scale);
388
+ a.value[r.value] = {
389
+ ...A,
390
+ scale: D,
391
391
  translateX: U,
392
- translateY: X
392
+ translateY: H
393
393
  };
394
394
  };
395
- return (c, b) => (openBlock(), createElementBlock("div", _hoisted_1, [
396
- y.images.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_2, [
397
- createElementVNode("span", _hoisted_3, toDisplayString(r.value + 1) + "/" + toDisplayString(y.images.length), 1)
395
+ return (m, k) => (openBlock(), createElementBlock("div", _hoisted_1$2, [
396
+ p.images.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
397
+ createElementVNode("span", _hoisted_3$2, toDisplayString(r.value + 1) + "/" + toDisplayString(p.images.length), 1)
398
398
  ])) : createCommentVNode("", !0),
399
- y.showCloseBtn ? (openBlock(), createElementBlock("button", {
399
+ p.showCloseBtn ? (openBlock(), createElementBlock("button", {
400
400
  key: 1,
401
401
  class: "close-btn",
402
- onClick: b[0] || (b[0] = (O) => t("close"))
403
- }, [...b[1] || (b[1] = [
402
+ onClick: k[0] || (k[0] = (N) => t("close"))
403
+ }, [...k[1] || (k[1] = [
404
404
  createElementVNode("svg", {
405
405
  width: "24",
406
406
  height: "24",
@@ -423,46 +423,46 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
423
423
  })
424
424
  ], -1)
425
425
  ])])) : createCommentVNode("", !0),
426
- createElementVNode("div", _hoisted_4, [
426
+ createElementVNode("div", _hoisted_4$2, [
427
427
  createElementVNode("div", {
428
428
  class: "swiper-wrapper",
429
429
  ref_key: "swiperWrapper",
430
- ref: v,
431
- style: normalizeStyle(A.value),
432
- onTouchstart: L,
430
+ ref: h,
431
+ style: normalizeStyle(x.value),
432
+ onTouchstart: R,
433
433
  onTouchmove: V,
434
434
  onTouchend: M,
435
435
  onMousedown: C,
436
- onMousemove: D,
437
- onMouseup: P,
438
- onMouseleave: P
436
+ onMousemove: B,
437
+ onMouseup: $,
438
+ onMouseleave: $
439
439
  }, [
440
- (openBlock(!0), createElementBlock(Fragment, null, renderList(y.images, (O, E) => (openBlock(), createElementBlock("div", {
441
- key: E,
440
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(p.images, (N, A) => (openBlock(), createElementBlock("div", {
441
+ key: A,
442
442
  class: "swiper-slide",
443
- style: normalizeStyle(d.value)
443
+ style: normalizeStyle(v.value)
444
444
  }, [
445
445
  createElementVNode("div", {
446
446
  class: "image-container",
447
- onWheel: (B) => I(B, E)
447
+ onWheel: (D) => F(D, A)
448
448
  }, [
449
449
  createElementVNode("img", {
450
- src: O,
450
+ src: N,
451
451
  alt: "Preview image",
452
452
  class: "preview-image",
453
- style: normalizeStyle(T(E)),
454
- onLoad: (B) => F(E),
453
+ style: normalizeStyle(T(A)),
454
+ onLoad: (D) => I(A),
455
455
  loading: "lazy"
456
- }, null, 44, _hoisted_6)
457
- ], 40, _hoisted_5)
456
+ }, null, 44, _hoisted_6$1)
457
+ ], 40, _hoisted_5$2)
458
458
  ], 4))), 128))
459
459
  ], 36)
460
460
  ]),
461
461
  createElementVNode("button", {
462
462
  class: "nav-btn prev-btn",
463
- onClick: x,
463
+ onClick: E,
464
464
  disabled: r.value === 0
465
- }, [...b[2] || (b[2] = [
465
+ }, [...k[2] || (k[2] = [
466
466
  createElementVNode("svg", {
467
467
  width: "24",
468
468
  height: "24",
@@ -473,12 +473,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
473
473
  }, [
474
474
  createElementVNode("polyline", { points: "15 18 9 12 15 6" })
475
475
  ], -1)
476
- ])], 8, _hoisted_7),
476
+ ])], 8, _hoisted_7$1),
477
477
  createElementVNode("button", {
478
478
  class: "nav-btn next-btn",
479
- onClick: _,
480
- disabled: r.value === y.images.length - 1
481
- }, [...b[3] || (b[3] = [
479
+ onClick: S,
480
+ disabled: r.value === p.images.length - 1
481
+ }, [...k[3] || (k[3] = [
482
482
  createElementVNode("svg", {
483
483
  width: "24",
484
484
  height: "24",
@@ -503,63 +503,63 @@ var svga_lite_min = { exports: {} };
503
503
  * Released under the MIT License.
504
504
  */
505
505
  (function(module, exports$1) {
506
- (function(y, g) {
506
+ (function(p, g) {
507
507
  module.exports = g();
508
508
  })(window, function() {
509
- return function(y) {
509
+ return function(p) {
510
510
  var g = {};
511
- function n(t) {
511
+ function o(t) {
512
512
  if (g[t]) return g[t].exports;
513
513
  var r = g[t] = { i: t, l: !1, exports: {} };
514
- return y[t].call(r.exports, r, r.exports, n), r.l = !0, r.exports;
514
+ return p[t].call(r.exports, r, r.exports, o), r.l = !0, r.exports;
515
515
  }
516
- return n.m = y, n.c = g, n.d = function(t, r, v) {
517
- n.o(t, r) || Object.defineProperty(t, r, { enumerable: !0, get: v });
518
- }, n.r = function(t) {
516
+ return o.m = p, o.c = g, o.d = function(t, r, h) {
517
+ o.o(t, r) || Object.defineProperty(t, r, { enumerable: !0, get: h });
518
+ }, o.r = function(t) {
519
519
  typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 });
520
- }, n.t = function(t, r) {
521
- if (1 & r && (t = n(t)), 8 & r || 4 & r && typeof t == "object" && t && t.__esModule) return t;
522
- var v = /* @__PURE__ */ Object.create(null);
523
- if (n.r(v), Object.defineProperty(v, "default", { enumerable: !0, value: t }), 2 & r && typeof t != "string") for (var h in t) n.d(v, h, (function(m) {
524
- return t[m];
525
- }).bind(null, h));
526
- return v;
527
- }, n.n = function(t) {
520
+ }, o.t = function(t, r) {
521
+ if (1 & r && (t = o(t)), 8 & r || 4 & r && typeof t == "object" && t && t.__esModule) return t;
522
+ var h = /* @__PURE__ */ Object.create(null);
523
+ if (o.r(h), Object.defineProperty(h, "default", { enumerable: !0, value: t }), 2 & r && typeof t != "string") for (var l in t) o.d(h, l, (function(u) {
524
+ return t[u];
525
+ }).bind(null, l));
526
+ return h;
527
+ }, o.n = function(t) {
528
528
  var r = t && t.__esModule ? function() {
529
529
  return t.default;
530
530
  } : function() {
531
531
  return t;
532
532
  };
533
- return n.d(r, "a", r), r;
534
- }, n.o = function(t, r) {
533
+ return o.d(r, "a", r), r;
534
+ }, o.o = function(t, r) {
535
535
  return Object.prototype.hasOwnProperty.call(t, r);
536
- }, n.p = "", n(n.s = 1);
537
- }([function(y, g, n) {
536
+ }, o.p = "", o(o.s = 1);
537
+ }([function(p, g, o) {
538
538
  Object.defineProperty(g, "__esModule", { value: !0 });
539
- var t = function(r, v, h) {
540
- this._d = r, this._transform = v, this._styles = h;
539
+ var t = function(r, h, l) {
540
+ this._d = r, this._transform = h, this._styles = l;
541
541
  };
542
542
  g.default = t;
543
- }, function(y, g, n) {
543
+ }, function(p, g, o) {
544
544
  Object.defineProperty(g, "__esModule", { value: !0 });
545
- var t = n(2), r = n(3), v = n(4), h = { Downloader: t.default, Parser: r.default, Player: v.default };
546
- g.default = h;
547
- }, function(y, g, n) {
545
+ var t = o(2), r = o(3), h = o(4), l = { Downloader: t.default, Parser: r.default, Player: h.default };
546
+ g.default = l;
547
+ }, function(p, g, o) {
548
548
  Object.defineProperty(g, "__esModule", { value: !0 });
549
549
  var t = function() {
550
550
  function r() {
551
551
  this.request = null;
552
552
  }
553
- return r.prototype.get = function(v) {
554
- var h = this;
555
- if (!v) throw new Error("download link undefined");
556
- return new Promise(function(m, o) {
557
- var s = new XMLHttpRequest();
558
- s.open("GET", v, !0), s.responseType = "arraybuffer", s.onloadend = function() {
559
- !s.response || s.status !== 200 && s.status !== 304 ? o(s) : m(s.response);
560
- }, s.onerror = function() {
561
- return o(s.response);
562
- }, s.send(), h.request = s;
553
+ return r.prototype.get = function(h) {
554
+ var l = this;
555
+ if (!h) throw new Error("download link undefined");
556
+ return new Promise(function(u, c) {
557
+ var n = new XMLHttpRequest();
558
+ n.open("GET", h, !0), n.responseType = "arraybuffer", n.onloadend = function() {
559
+ !n.response || n.status !== 200 && n.status !== 304 ? c(n) : u(n.response);
560
+ }, n.onerror = function() {
561
+ return c(n.response);
562
+ }, n.send(), l.request = n;
563
563
  });
564
564
  }, r.prototype.cancel = function() {
565
565
  this.request && this.request.abort();
@@ -577,39 +577,39 @@ var svga_lite_min = { exports: {} };
577
577
  var disableWorker = (_a === void 0 ? { disableWorker: !1 } : _a).disableWorker;
578
578
  disableWorker ? (eval(WORKER), this.worker = window.SVGAParserMockWorker) : this.worker = new Worker(window.URL.createObjectURL(new Blob([WORKER])));
579
579
  }
580
- return Parser.prototype.do = function(y) {
581
- var g = this, n = new Uint8Array(y, 0, 4);
582
- if (n[0] == 80 && n[1] == 75 && n[2] == 3 && n[3] == 4) throw "this parser not support version@1.x of svga.";
583
- if (!y) throw new Error("Parser Data not found");
580
+ return Parser.prototype.do = function(p) {
581
+ var g = this, o = new Uint8Array(p, 0, 4);
582
+ if (o[0] == 80 && o[1] == 75 && o[2] == 3 && o[3] == 4) throw "this parser not support version@1.x of svga.";
583
+ if (!p) throw new Error("Parser Data not found");
584
584
  if (!this.worker) throw new Error("Parser Worker not found");
585
585
  return new Promise(function(t, r) {
586
- var v;
587
- g.worker.disableWorker ? ((v = g.worker).onmessageCallback = function(h) {
588
- t(h);
589
- }, v.onmessage({ data: y })) : ((v = g.worker).postMessage(y), v.onmessage = function(h) {
590
- var m = h.data;
591
- t(m);
586
+ var h;
587
+ g.worker.disableWorker ? ((h = g.worker).onmessageCallback = function(l) {
588
+ t(l);
589
+ }, h.onmessage({ data: p })) : ((h = g.worker).postMessage(p), h.onmessage = function(l) {
590
+ var u = l.data;
591
+ t(u);
592
592
  });
593
593
  });
594
594
  }, Parser.prototype.destroy = function() {
595
- var y = this.worker;
596
- y.terminate && y.terminate();
595
+ var p = this.worker;
596
+ p.terminate && p.terminate();
597
597
  }, Parser;
598
598
  }();
599
599
  exports$1.default = Parser;
600
- }, function(y, g, n) {
600
+ }, function(p, g, o) {
601
601
  Object.defineProperty(g, "__esModule", { value: !0 });
602
- var t, r, v, h = n(5), m = n(9);
603
- (function(l) {
604
- l.START = "start", l.RESUME = "resume", l.PROCESS = "process", l.PAUSE = "pause", l.STOP = "stop", l.END = "end", l.CLEAR = "clear";
605
- })(t || (t = {})), function(l) {
606
- l.FORWARDS = "forwards", l.BACKWARDS = "backwards";
607
- }(r || (r = {})), function(l) {
608
- l.FORWARDS = "forwards", l.FALLBACKS = "fallbacks";
609
- }(v || (v = {}));
610
- var o = typeof window < "u" && "IntersectionObserver" in window, s = function() {
611
- function l(i, f, u) {
612
- if (this.videoItem = f, this.loop = !0, this.fillMode = r.FORWARDS, this.playMode = v.FORWARDS, this.progress = 0, this.currentFrame = 0, this.totalFramesCount = 0, this.startFrame = 0, this.endFrame = 0, this.cacheFrames = !1, this.intersectionObserverRender = !1, this.intersectionObserverRenderShow = !0, this._intersectionObserver = null, this.$onEvent = { start: function() {
602
+ var t, r, h, l = o(5), u = o(9);
603
+ (function(f) {
604
+ f.START = "start", f.RESUME = "resume", f.PROCESS = "process", f.PAUSE = "pause", f.STOP = "stop", f.END = "end", f.CLEAR = "clear";
605
+ })(t || (t = {})), function(f) {
606
+ f.FORWARDS = "forwards", f.BACKWARDS = "backwards";
607
+ }(r || (r = {})), function(f) {
608
+ f.FORWARDS = "forwards", f.FALLBACKS = "fallbacks";
609
+ }(h || (h = {}));
610
+ var c = typeof window < "u" && "IntersectionObserver" in window, n = function() {
611
+ function f(i, y, a) {
612
+ if (this.videoItem = y, this.loop = !0, this.fillMode = r.FORWARDS, this.playMode = h.FORWARDS, this.progress = 0, this.currentFrame = 0, this.totalFramesCount = 0, this.startFrame = 0, this.endFrame = 0, this.cacheFrames = !1, this.intersectionObserverRender = !1, this.intersectionObserverRenderShow = !0, this._intersectionObserver = null, this.$onEvent = { start: function() {
613
613
  }, resume: function() {
614
614
  }, process: function() {
615
615
  }, pause: function() {
@@ -618,242 +618,242 @@ var svga_lite_min = { exports: {} };
618
618
  }, clear: function() {
619
619
  } }, this.container = typeof i == "string" ? document.body.querySelector(i) : i, !this.container) throw new Error("container undefined.");
620
620
  if (!this.container.getContext) throw new Error("container should be HTMLCanvasElement.");
621
- this._renderer = new h.default(this), this._animator = new m.default(), this.videoItem && this.mount(f), u && this.set(u);
621
+ this._renderer = new l.default(this), this._animator = new u.default(), this.videoItem && this.mount(y), a && this.set(a);
622
622
  }
623
- return l.prototype.set = function(i) {
624
- var f = this;
625
- i.loop !== void 0 && (this.loop = i.loop), i.fillMode && (this.fillMode = i.fillMode), i.playMode && (this.playMode = i.playMode), i.cacheFrames !== void 0 && (this.cacheFrames = i.cacheFrames), this.startFrame = i.startFrame ? i.startFrame : this.startFrame, this.endFrame = i.endFrame ? i.endFrame : this.endFrame, i.intersectionObserverRender !== void 0 && (this.intersectionObserverRender = i.intersectionObserverRender), o && this.intersectionObserverRender ? (this._intersectionObserver = new IntersectionObserver(function(u) {
626
- u[0].intersectionRatio <= 0 ? f.intersectionObserverRenderShow && (f.intersectionObserverRenderShow = !1) : !f.intersectionObserverRenderShow && (f.intersectionObserverRenderShow = !0);
623
+ return f.prototype.set = function(i) {
624
+ var y = this;
625
+ i.loop !== void 0 && (this.loop = i.loop), i.fillMode && (this.fillMode = i.fillMode), i.playMode && (this.playMode = i.playMode), i.cacheFrames !== void 0 && (this.cacheFrames = i.cacheFrames), this.startFrame = i.startFrame ? i.startFrame : this.startFrame, this.endFrame = i.endFrame ? i.endFrame : this.endFrame, i.intersectionObserverRender !== void 0 && (this.intersectionObserverRender = i.intersectionObserverRender), c && this.intersectionObserverRender ? (this._intersectionObserver = new IntersectionObserver(function(a) {
626
+ a[0].intersectionRatio <= 0 ? y.intersectionObserverRenderShow && (y.intersectionObserverRenderShow = !1) : !y.intersectionObserverRenderShow && (y.intersectionObserverRenderShow = !0);
627
627
  }, { rootMargin: "0px", threshold: [0, 0.5, 1] }), this._intersectionObserver.observe(this.container)) : (this._intersectionObserver && this._intersectionObserver.disconnect(), this.intersectionObserverRender = !1, this.intersectionObserverRenderShow = !0), this._animator.noExecutionDelay = i.noExecutionDelay;
628
- }, l.prototype.mount = function(i) {
629
- var f = this;
630
- return new Promise(function(u, S) {
631
- f.currentFrame = 0, f.progress = 0, f.totalFramesCount = i.frames - 1, f.videoItem = i, f._renderer.prepare().then(u), f._renderer.clear(), f._setSize();
628
+ }, f.prototype.mount = function(i) {
629
+ var y = this;
630
+ return new Promise(function(a, b) {
631
+ y.currentFrame = 0, y.progress = 0, y.totalFramesCount = i.frames - 1, y.videoItem = i, y._renderer.prepare().then(a), y._renderer.clear(), y._setSize();
632
632
  });
633
- }, l.prototype.start = function() {
633
+ }, f.prototype.start = function() {
634
634
  if (!this.videoItem) throw new Error("video item undefined.");
635
635
  this._renderer.clear(), this._startAnimation(), this.$onEvent.start();
636
- }, l.prototype.resume = function() {
636
+ }, f.prototype.resume = function() {
637
637
  if (!this.videoItem) throw new Error("video item undefined.");
638
638
  this._startAnimation(), this.$onEvent.resume();
639
- }, l.prototype.pause = function() {
639
+ }, f.prototype.pause = function() {
640
640
  this._animator && this._animator.stop(), this.$onEvent.pause();
641
- }, l.prototype.stop = function() {
641
+ }, f.prototype.stop = function() {
642
642
  this._animator && this._animator.stop(), this.currentFrame = 0, this._renderer.drawFrame(this.currentFrame), this.$onEvent.stop();
643
- }, l.prototype.clear = function() {
643
+ }, f.prototype.clear = function() {
644
644
  this._animator && this._animator.stop(), this._renderer.clear(), this.$onEvent.clear();
645
- }, l.prototype.destroy = function() {
645
+ }, f.prototype.destroy = function() {
646
646
  this._animator && this._animator.stop(), this._renderer.clear(), this._animator = null, this._renderer = null, this.videoItem = null;
647
- }, l.prototype.$on = function(i, f) {
648
- var u = this;
649
- return this.$onEvent[i] = f, i === "end" && (this._animator.onEnd = function() {
650
- return u.$onEvent.end();
647
+ }, f.prototype.$on = function(i, y) {
648
+ var a = this;
649
+ return this.$onEvent[i] = y, i === "end" && (this._animator.onEnd = function() {
650
+ return a.$onEvent.end();
651
651
  }), this;
652
- }, l.prototype._startAnimation = function() {
653
- var i = this, f = this, u = f.playMode, S = f.totalFramesCount, k = f.startFrame, a = f.endFrame, p = f.videoItem;
654
- this.currentFrame === S && (this.currentFrame = k || 0), this._animator.startValue = u === "fallbacks" ? a || S : k || 0, this._animator.endValue = u === "fallbacks" ? k || 0 : a || S;
655
- var e = p.frames;
656
- a > 0 && a > k ? e = a - k : a <= 0 && k > 0 && (e = p.frames - k), this._animator.duration = e * (1 / p.FPS) * 1e3, this._animator.loop = this.loop === !0 || this.loop <= 0 ? 1 / 0 : this.loop === !1 ? 1 : this.loop, this._animator.fillRule = this.fillMode === "backwards" ? 1 : 0, this._animator.onUpdate = function(A) {
657
- A = Math.floor(A), i.currentFrame !== A && (i.currentFrame = A, i.progress = parseFloat((A + 1).toString()) / parseFloat(p.frames.toString()) * 100, i._renderer.drawFrame(i.currentFrame), i.$onEvent.process());
652
+ }, f.prototype._startAnimation = function() {
653
+ var i = this, y = this, a = y.playMode, b = y.totalFramesCount, w = y.startFrame, s = y.endFrame, d = y.videoItem;
654
+ this.currentFrame === b && (this.currentFrame = w || 0), this._animator.startValue = a === "fallbacks" ? s || b : w || 0, this._animator.endValue = a === "fallbacks" ? w || 0 : s || b;
655
+ var e = d.frames;
656
+ s > 0 && s > w ? e = s - w : s <= 0 && w > 0 && (e = d.frames - w), this._animator.duration = e * (1 / d.FPS) * 1e3, this._animator.loop = this.loop === !0 || this.loop <= 0 ? 1 / 0 : this.loop === !1 ? 1 : this.loop, this._animator.fillRule = this.fillMode === "backwards" ? 1 : 0, this._animator.onUpdate = function(x) {
657
+ x = Math.floor(x), i.currentFrame !== x && (i.currentFrame = x, i.progress = parseFloat((x + 1).toString()) / parseFloat(d.frames.toString()) * 100, i._renderer.drawFrame(i.currentFrame), i.$onEvent.process());
658
658
  }, this._animator.start(this.currentFrame);
659
- }, l.prototype._setSize = function() {
659
+ }, f.prototype._setSize = function() {
660
660
  var i = this.videoItem.videoSize;
661
661
  this.container.width = i.width, this.container.height = i.height;
662
- }, l;
662
+ }, f;
663
663
  }();
664
- g.default = s;
665
- }, function(y, g, n) {
664
+ g.default = n;
665
+ }, function(p, g, o) {
666
666
  Object.defineProperty(g, "__esModule", { value: !0 });
667
- var t = n(6), r = function() {
668
- function v(h) {
669
- this._bitmapCache = {}, this._dynamicElements = {}, this._frames = {}, this._player = h;
670
- var m = this._player.container;
671
- this._ofsCanvas = window.OffscreenCanvas ? new window.OffscreenCanvas(m.width, m.height) : document.createElement("canvas");
667
+ var t = o(6), r = function() {
668
+ function h(l) {
669
+ this._bitmapCache = {}, this._dynamicElements = {}, this._frames = {}, this._player = l;
670
+ var u = this._player.container;
671
+ this._ofsCanvas = window.OffscreenCanvas ? new window.OffscreenCanvas(u.width, u.height) : document.createElement("canvas");
672
672
  }
673
- return v.prototype.prepare = function() {
674
- var h = this;
675
- return new Promise(function(m, o) {
676
- if (h._bitmapCache = {}, h._player.videoItem.images && Object.keys(h._player.videoItem.images).length != 0) {
677
- h._player.videoItem.dynamicElements && (h._dynamicElements = h._player.videoItem.dynamicElements);
678
- var s = 0, l = 0;
679
- for (var i in h._player.videoItem.images) {
680
- var f = h._player.videoItem.images[i];
681
- if (typeof f != "string" || f.indexOf("iVBO") !== 0 && f.indexOf("/9j/2w") !== 0) h._bitmapCache[i] = f;
673
+ return h.prototype.prepare = function() {
674
+ var l = this;
675
+ return new Promise(function(u, c) {
676
+ if (l._bitmapCache = {}, l._player.videoItem.images && Object.keys(l._player.videoItem.images).length != 0) {
677
+ l._player.videoItem.dynamicElements && (l._dynamicElements = l._player.videoItem.dynamicElements);
678
+ var n = 0, f = 0;
679
+ for (var i in l._player.videoItem.images) {
680
+ var y = l._player.videoItem.images[i];
681
+ if (typeof y != "string" || y.indexOf("iVBO") !== 0 && y.indexOf("/9j/2w") !== 0) l._bitmapCache[i] = y;
682
682
  else {
683
- s++;
684
- var u = document.createElement("img");
685
- u.src = "data:image/png;base64," + f, h._bitmapCache[i] = u, u.onload = function() {
686
- ++l === s && m();
683
+ n++;
684
+ var a = document.createElement("img");
685
+ a.src = "data:image/png;base64," + y, l._bitmapCache[i] = a, a.onload = function() {
686
+ ++f === n && u();
687
687
  };
688
688
  }
689
689
  }
690
- } else m();
690
+ } else u();
691
691
  });
692
- }, v.prototype.clear = function() {
692
+ }, h.prototype.clear = function() {
693
693
  this._player.container.width = this._player.container.width;
694
- }, v.prototype.drawFrame = function(h) {
695
- var m = this._player;
696
- if (!m.intersectionObserverRender || m.intersectionObserverRenderShow) {
694
+ }, h.prototype.drawFrame = function(l) {
695
+ var u = this._player;
696
+ if (!u.intersectionObserverRender || u.intersectionObserverRenderShow) {
697
697
  this.clear();
698
- var o = m.container.getContext("2d");
699
- if (this._player.cacheFrames && this._frames[h]) {
700
- var s = this._frames[h];
701
- o.drawImage(s, 0, 0, s.width, s.height, 0, 0, s.width, s.height);
698
+ var c = u.container.getContext("2d");
699
+ if (this._player.cacheFrames && this._frames[l]) {
700
+ var n = this._frames[l];
701
+ c.drawImage(n, 0, 0, n.width, n.height, 0, 0, n.width, n.height);
702
702
  } else {
703
- var l = this._ofsCanvas;
704
- if (l.width = this._player.container.width, l.height = this._player.container.height, t.default(l, this._bitmapCache, this._dynamicElements, this._player.videoItem, this._player.currentFrame), o.drawImage(l, 0, 0, l.width, l.height, 0, 0, l.width, l.height), this._player.cacheFrames) if ("toDataURL" in l) {
705
- var i = l.toDataURL(), f = new Image();
706
- f.src = i, this._frames[h] = f;
707
- } else this._frames[h] = l.transferToImageBitmap();
703
+ var f = this._ofsCanvas;
704
+ if (f.width = this._player.container.width, f.height = this._player.container.height, t.default(f, this._bitmapCache, this._dynamicElements, this._player.videoItem, this._player.currentFrame), c.drawImage(f, 0, 0, f.width, f.height, 0, 0, f.width, f.height), this._player.cacheFrames) if ("toDataURL" in f) {
705
+ var i = f.toDataURL(), y = new Image();
706
+ y.src = i, this._frames[l] = y;
707
+ } else this._frames[l] = f.transferToImageBitmap();
708
708
  }
709
709
  }
710
- }, v;
710
+ }, h;
711
711
  }();
712
712
  g.default = r;
713
- }, function(y, g, n) {
713
+ }, function(p, g, o) {
714
714
  Object.defineProperty(g, "__esModule", { value: !0 }), g.default = void 0;
715
- var t = h(n(0)), r = h(n(7)), v = h(n(8));
716
- function h(i) {
715
+ var t = l(o(0)), r = l(o(7)), h = l(o(8));
716
+ function l(i) {
717
717
  return i && i.__esModule ? i : { default: i };
718
718
  }
719
- var m = "MLHVCSQRZmlhvcsqrz";
720
- function o(i, f) {
721
- var u = f._styles;
722
- u !== void 0 && (u && u.stroke ? i.strokeStyle = "rgba(".concat(parseInt((255 * u.stroke[0]).toString()), ", ").concat(parseInt((255 * u.stroke[1]).toString()), ", ").concat(parseInt((255 * u.stroke[2]).toString()), ", ").concat(u.stroke[3], ")") : i.strokeStyle = "transparent", u && (i.lineWidth = u.strokeWidth || void 0, i.lineCap = u.lineCap || void 0, i.lineJoin = u.lineJoin || void 0, i.miterLimit = u.miterLimit || void 0), u && u.fill ? i.fillStyle = "rgba(".concat(parseInt((255 * u.fill[0]).toString()), ", ").concat(parseInt((255 * u.fill[1]).toString()), ", ").concat(parseInt((255 * u.fill[2]).toString()), ", ").concat(u.fill[3], ")") : i.fillStyle = "transparent", u && u.lineDash && i.setLineDash(u.lineDash));
719
+ var u = "MLHVCSQRZmlhvcsqrz";
720
+ function c(i, y) {
721
+ var a = y._styles;
722
+ a !== void 0 && (a && a.stroke ? i.strokeStyle = "rgba(".concat(parseInt((255 * a.stroke[0]).toString()), ", ").concat(parseInt((255 * a.stroke[1]).toString()), ", ").concat(parseInt((255 * a.stroke[2]).toString()), ", ").concat(a.stroke[3], ")") : i.strokeStyle = "transparent", a && (i.lineWidth = a.strokeWidth || void 0, i.lineCap = a.lineCap || void 0, i.lineJoin = a.lineJoin || void 0, i.miterLimit = a.miterLimit || void 0), a && a.fill ? i.fillStyle = "rgba(".concat(parseInt((255 * a.fill[0]).toString()), ", ").concat(parseInt((255 * a.fill[1]).toString()), ", ").concat(parseInt((255 * a.fill[2]).toString()), ", ").concat(a.fill[3], ")") : i.fillStyle = "transparent", a && a.lineDash && i.setLineDash(a.lineDash));
723
723
  }
724
- function s(i, f) {
725
- i.save(), o(i, f), f._transform !== void 0 && f._transform !== null && i.transform(f._transform.a || 1, f._transform.b || 0, f._transform.c || 0, f._transform.d || 1, f._transform.tx || 0, f._transform.ty || 0);
726
- var u = { x: 0, y: 0, x1: 0, y1: 0, x2: 0, y2: 0 };
727
- i.beginPath(), f._d.replace(/([a-zA-Z])/g, "|||$1 ").replace(/,/g, " ").split("|||").forEach(function(S) {
728
- if (S.length != 0) {
729
- var k = S.substr(0, 1);
730
- if (m.indexOf(k) >= 0) {
731
- var a = S.substr(1).trim().split(" ");
732
- (function(p, e, A, d) {
733
- switch (A) {
724
+ function n(i, y) {
725
+ i.save(), c(i, y), y._transform !== void 0 && y._transform !== null && i.transform(y._transform.a || 1, y._transform.b || 0, y._transform.c || 0, y._transform.d || 1, y._transform.tx || 0, y._transform.ty || 0);
726
+ var a = { x: 0, y: 0, x1: 0, y1: 0, x2: 0, y2: 0 };
727
+ i.beginPath(), y._d.replace(/([a-zA-Z])/g, "|||$1 ").replace(/,/g, " ").split("|||").forEach(function(b) {
728
+ if (b.length != 0) {
729
+ var w = b.substr(0, 1);
730
+ if (u.indexOf(w) >= 0) {
731
+ var s = b.substr(1).trim().split(" ");
732
+ (function(d, e, x, v) {
733
+ switch (x) {
734
734
  case "M":
735
- e.x = Number(d[0]), e.y = Number(d[1]), p.moveTo(e.x, e.y);
735
+ e.x = Number(v[0]), e.y = Number(v[1]), d.moveTo(e.x, e.y);
736
736
  break;
737
737
  case "m":
738
- e.x += Number(d[0]), e.y += Number(d[1]), p.moveTo(e.x, e.y);
738
+ e.x += Number(v[0]), e.y += Number(v[1]), d.moveTo(e.x, e.y);
739
739
  break;
740
740
  case "L":
741
- e.x = Number(d[0]), e.y = Number(d[1]), p.lineTo(e.x, e.y);
741
+ e.x = Number(v[0]), e.y = Number(v[1]), d.lineTo(e.x, e.y);
742
742
  break;
743
743
  case "l":
744
- e.x += Number(d[0]), e.y += Number(d[1]), p.lineTo(e.x, e.y);
744
+ e.x += Number(v[0]), e.y += Number(v[1]), d.lineTo(e.x, e.y);
745
745
  break;
746
746
  case "H":
747
- e.x = Number(d[0]), p.lineTo(e.x, e.y);
747
+ e.x = Number(v[0]), d.lineTo(e.x, e.y);
748
748
  break;
749
749
  case "h":
750
- e.x += Number(d[0]), p.lineTo(e.x, e.y);
750
+ e.x += Number(v[0]), d.lineTo(e.x, e.y);
751
751
  break;
752
752
  case "V":
753
- e.y = Number(d[0]), p.lineTo(e.x, e.y);
753
+ e.y = Number(v[0]), d.lineTo(e.x, e.y);
754
754
  break;
755
755
  case "v":
756
- e.y += Number(d[0]), p.lineTo(e.x, e.y);
756
+ e.y += Number(v[0]), d.lineTo(e.x, e.y);
757
757
  break;
758
758
  case "C":
759
- e.x1 = Number(d[0]), e.y1 = Number(d[1]), e.x2 = Number(d[2]), e.y2 = Number(d[3]), e.x = Number(d[4]), e.y = Number(d[5]), p.bezierCurveTo(e.x1, e.y1, e.x2, e.y2, e.x, e.y);
759
+ e.x1 = Number(v[0]), e.y1 = Number(v[1]), e.x2 = Number(v[2]), e.y2 = Number(v[3]), e.x = Number(v[4]), e.y = Number(v[5]), d.bezierCurveTo(e.x1, e.y1, e.x2, e.y2, e.x, e.y);
760
760
  break;
761
761
  case "c":
762
- e.x1 = e.x + Number(d[0]), e.y1 = e.y + Number(d[1]), e.x2 = e.x + Number(d[2]), e.y2 = e.y + Number(d[3]), e.x += Number(d[4]), e.y += Number(d[5]), p.bezierCurveTo(e.x1, e.y1, e.x2, e.y2, e.x, e.y);
762
+ e.x1 = e.x + Number(v[0]), e.y1 = e.y + Number(v[1]), e.x2 = e.x + Number(v[2]), e.y2 = e.y + Number(v[3]), e.x += Number(v[4]), e.y += Number(v[5]), d.bezierCurveTo(e.x1, e.y1, e.x2, e.y2, e.x, e.y);
763
763
  break;
764
764
  case "S":
765
- e.x1 && e.y1 && e.x2 && e.y2 ? (e.x1 = e.x - e.x2 + e.x, e.y1 = e.y - e.y2 + e.y, e.x2 = Number(d[0]), e.y2 = Number(d[1]), e.x = Number(d[2]), e.y = Number(d[3]), p.bezierCurveTo(e.x1, e.y1, e.x2, e.y2, e.x, e.y)) : (e.x1 = Number(d[0]), e.y1 = Number(d[1]), e.x = Number(d[2]), e.y = Number(d[3]), p.quadraticCurveTo(e.x1, e.y1, e.x, e.y));
765
+ e.x1 && e.y1 && e.x2 && e.y2 ? (e.x1 = e.x - e.x2 + e.x, e.y1 = e.y - e.y2 + e.y, e.x2 = Number(v[0]), e.y2 = Number(v[1]), e.x = Number(v[2]), e.y = Number(v[3]), d.bezierCurveTo(e.x1, e.y1, e.x2, e.y2, e.x, e.y)) : (e.x1 = Number(v[0]), e.y1 = Number(v[1]), e.x = Number(v[2]), e.y = Number(v[3]), d.quadraticCurveTo(e.x1, e.y1, e.x, e.y));
766
766
  break;
767
767
  case "s":
768
- e.x1 && e.y1 && e.x2 && e.y2 ? (e.x1 = e.x - e.x2 + e.x, e.y1 = e.y - e.y2 + e.y, e.x2 = e.x + Number(d[0]), e.y2 = e.y + Number(d[1]), e.x += Number(d[2]), e.y += Number(d[3]), p.bezierCurveTo(e.x1, e.y1, e.x2, e.y2, e.x, e.y)) : (e.x1 = e.x + Number(d[0]), e.y1 = e.y + Number(d[1]), e.x += Number(d[2]), e.y += Number(d[3]), p.quadraticCurveTo(e.x1, e.y1, e.x, e.y));
768
+ e.x1 && e.y1 && e.x2 && e.y2 ? (e.x1 = e.x - e.x2 + e.x, e.y1 = e.y - e.y2 + e.y, e.x2 = e.x + Number(v[0]), e.y2 = e.y + Number(v[1]), e.x += Number(v[2]), e.y += Number(v[3]), d.bezierCurveTo(e.x1, e.y1, e.x2, e.y2, e.x, e.y)) : (e.x1 = e.x + Number(v[0]), e.y1 = e.y + Number(v[1]), e.x += Number(v[2]), e.y += Number(v[3]), d.quadraticCurveTo(e.x1, e.y1, e.x, e.y));
769
769
  break;
770
770
  case "Q":
771
- e.x1 = Number(d[0]), e.y1 = Number(d[1]), e.x = Number(d[2]), e.y = Number(d[3]), p.quadraticCurveTo(e.x1, e.y1, e.x, e.y);
771
+ e.x1 = Number(v[0]), e.y1 = Number(v[1]), e.x = Number(v[2]), e.y = Number(v[3]), d.quadraticCurveTo(e.x1, e.y1, e.x, e.y);
772
772
  break;
773
773
  case "q":
774
- e.x1 = e.x + Number(d[0]), e.y1 = e.y + Number(d[1]), e.x += Number(d[2]), e.y += Number(d[3]), p.quadraticCurveTo(e.x1, e.y1, e.x, e.y);
774
+ e.x1 = e.x + Number(v[0]), e.y1 = e.y + Number(v[1]), e.x += Number(v[2]), e.y += Number(v[3]), d.quadraticCurveTo(e.x1, e.y1, e.x, e.y);
775
775
  break;
776
776
  case "A":
777
777
  case "a":
778
778
  break;
779
779
  case "Z":
780
780
  case "z":
781
- p.closePath();
781
+ d.closePath();
782
782
  }
783
- })(i, u, k, a);
783
+ })(i, a, w, s);
784
784
  }
785
785
  }
786
- }), f._styles && f._styles.fill ? i.fill() : f._styles && f._styles.stroke && i.stroke(), i.restore();
786
+ }), y._styles && y._styles.fill ? i.fill() : y._styles && y._styles.stroke && i.stroke(), i.restore();
787
787
  }
788
- var l = function(i, f, u, S, k) {
789
- var a = i.getContext("2d");
790
- return S.sprites.forEach(function(p) {
791
- var e = p.frames[k];
788
+ var f = function(i, y, a, b, w) {
789
+ var s = i.getContext("2d");
790
+ return b.sprites.forEach(function(d) {
791
+ var e = d.frames[w];
792
792
  if (!(e.alpha < 0.05)) {
793
- a.save(), a.globalAlpha = e.alpha, a.transform(e.transform.a || 1, e.transform.b || 0, e.transform.c || 0, e.transform.d || 1, e.transform.tx || 0, e.transform.ty || 0);
794
- var A = f[p.imageKey];
795
- A && (e.maskPath !== void 0 && e.maskPath !== null && (e.maskPath._styles = void 0, s(a, e.maskPath), a.clip()), a.drawImage(A, 0, 0));
796
- var d = u[p.imageKey];
797
- d && a.drawImage(d, (e.layout.width - d.width) / 2, (e.layout.height - d.height) / 2), e.shapes && e.shapes.forEach(function(w) {
798
- w.type === "shape" && w.pathArgs && w.pathArgs.d ? s(a, new t.default(w.pathArgs.d, w.transform, w.styles)) : w.type === "ellipse" && w.pathArgs ? function(x, _) {
799
- x.save(), o(x, _), _._transform !== void 0 && _._transform !== null && x.transform(_._transform.a || 1, _._transform.b || 0, _._transform.c || 0, _._transform.d || 1, _._transform.tx || 0, _._transform.ty || 0);
800
- var N = _._x - _._radiusX, T = _._y - _._radiusY, F = 2 * _._radiusX, C = 2 * _._radiusY, D = F / 2 * 0.5522848, P = C / 2 * 0.5522848, L = N + F, V = T + C, M = N + F / 2, I = T + C / 2;
801
- x.beginPath(), x.moveTo(N, I), x.bezierCurveTo(N, I - P, M - D, T, M, T), x.bezierCurveTo(M + D, T, L, I - P, L, I), x.bezierCurveTo(L, I + P, M + D, V, M, V), x.bezierCurveTo(M - D, V, N, I + P, N, I), _._styles && _._styles.fill ? x.fill() : _._styles && _._styles.stroke && x.stroke(), x.restore();
802
- }(a, new r.default(parseFloat(w.pathArgs.x) || 0, parseFloat(w.pathArgs.y) || 0, parseFloat(w.pathArgs.radiusX) || 0, parseFloat(w.pathArgs.radiusY) || 0, w.transform, w.styles)) : w.type === "rect" && w.pathArgs && function(x, _) {
803
- x.save(), o(x, _), _._transform !== void 0 && _._transform !== null && x.transform(_._transform.a || 1, _._transform.b || 0, _._transform.c || 0, _._transform.d || 1, _._transform.tx || 0, _._transform.ty || 0);
804
- var N = _._x, T = _._y, F = _._width, C = _._height, D = _._cornerRadius;
805
- F < 2 * D && (D = F / 2), C < 2 * D && (D = C / 2), x.beginPath(), x.moveTo(N + D, T), x.arcTo(N + F, T, N + F, T + C, D), x.arcTo(N + F, T + C, N, T + C, D), x.arcTo(N, T + C, N, T, D), x.arcTo(N, T, N + F, T, D), x.closePath(), _._styles && _._styles.fill ? x.fill() : _._styles && _._styles.stroke && x.stroke(), x.restore();
806
- }(a, new v.default(parseFloat(w.pathArgs.x) || 0, parseFloat(w.pathArgs.y) || 0, parseFloat(w.pathArgs.width) || 0, parseFloat(w.pathArgs.height) || 0, parseFloat(w.pathArgs.cornerRadius) || 0, w.transform, w.styles));
807
- }), a.restore();
793
+ s.save(), s.globalAlpha = e.alpha, s.transform(e.transform.a || 1, e.transform.b || 0, e.transform.c || 0, e.transform.d || 1, e.transform.tx || 0, e.transform.ty || 0);
794
+ var x = y[d.imageKey];
795
+ x && (e.maskPath !== void 0 && e.maskPath !== null && (e.maskPath._styles = void 0, n(s, e.maskPath), s.clip()), s.drawImage(x, 0, 0));
796
+ var v = a[d.imageKey];
797
+ v && s.drawImage(v, (e.layout.width - v.width) / 2, (e.layout.height - v.height) / 2), e.shapes && e.shapes.forEach(function(_) {
798
+ _.type === "shape" && _.pathArgs && _.pathArgs.d ? n(s, new t.default(_.pathArgs.d, _.transform, _.styles)) : _.type === "ellipse" && _.pathArgs ? function(E, S) {
799
+ E.save(), c(E, S), S._transform !== void 0 && S._transform !== null && E.transform(S._transform.a || 1, S._transform.b || 0, S._transform.c || 0, S._transform.d || 1, S._transform.tx || 0, S._transform.ty || 0);
800
+ var O = S._x - S._radiusX, T = S._y - S._radiusY, I = 2 * S._radiusX, C = 2 * S._radiusY, B = I / 2 * 0.5522848, $ = C / 2 * 0.5522848, R = O + I, V = T + C, M = O + I / 2, F = T + C / 2;
801
+ E.beginPath(), E.moveTo(O, F), E.bezierCurveTo(O, F - $, M - B, T, M, T), E.bezierCurveTo(M + B, T, R, F - $, R, F), E.bezierCurveTo(R, F + $, M + B, V, M, V), E.bezierCurveTo(M - B, V, O, F + $, O, F), S._styles && S._styles.fill ? E.fill() : S._styles && S._styles.stroke && E.stroke(), E.restore();
802
+ }(s, new r.default(parseFloat(_.pathArgs.x) || 0, parseFloat(_.pathArgs.y) || 0, parseFloat(_.pathArgs.radiusX) || 0, parseFloat(_.pathArgs.radiusY) || 0, _.transform, _.styles)) : _.type === "rect" && _.pathArgs && function(E, S) {
803
+ E.save(), c(E, S), S._transform !== void 0 && S._transform !== null && E.transform(S._transform.a || 1, S._transform.b || 0, S._transform.c || 0, S._transform.d || 1, S._transform.tx || 0, S._transform.ty || 0);
804
+ var O = S._x, T = S._y, I = S._width, C = S._height, B = S._cornerRadius;
805
+ I < 2 * B && (B = I / 2), C < 2 * B && (B = C / 2), E.beginPath(), E.moveTo(O + B, T), E.arcTo(O + I, T, O + I, T + C, B), E.arcTo(O + I, T + C, O, T + C, B), E.arcTo(O, T + C, O, T, B), E.arcTo(O, T, O + I, T, B), E.closePath(), S._styles && S._styles.fill ? E.fill() : S._styles && S._styles.stroke && E.stroke(), E.restore();
806
+ }(s, new h.default(parseFloat(_.pathArgs.x) || 0, parseFloat(_.pathArgs.y) || 0, parseFloat(_.pathArgs.width) || 0, parseFloat(_.pathArgs.height) || 0, parseFloat(_.pathArgs.cornerRadius) || 0, _.transform, _.styles));
807
+ }), s.restore();
808
808
  }
809
809
  }), i;
810
810
  };
811
- g.default = l;
812
- }, function(y, g, n) {
813
- var t, r = (t = function(h, m) {
814
- return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(o, s) {
815
- o.__proto__ = s;
816
- } || function(o, s) {
817
- for (var l in s) Object.prototype.hasOwnProperty.call(s, l) && (o[l] = s[l]);
818
- })(h, m);
819
- }, function(h, m) {
820
- function o() {
821
- this.constructor = h;
811
+ g.default = f;
812
+ }, function(p, g, o) {
813
+ var t, r = (t = function(l, u) {
814
+ return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(c, n) {
815
+ c.__proto__ = n;
816
+ } || function(c, n) {
817
+ for (var f in n) Object.prototype.hasOwnProperty.call(n, f) && (c[f] = n[f]);
818
+ })(l, u);
819
+ }, function(l, u) {
820
+ function c() {
821
+ this.constructor = l;
822
822
  }
823
- t(h, m), h.prototype = m === null ? Object.create(m) : (o.prototype = m.prototype, new o());
823
+ t(l, u), l.prototype = u === null ? Object.create(u) : (c.prototype = u.prototype, new c());
824
824
  });
825
825
  Object.defineProperty(g, "__esModule", { value: !0 });
826
- var v = function(h) {
827
- function m(o, s, l, i, f, u) {
828
- var S = h.call(this) || this;
829
- return S._x = o, S._y = s, S._radiusX = l, S._radiusY = i, S._transform = f, S._styles = u, S;
826
+ var h = function(l) {
827
+ function u(c, n, f, i, y, a) {
828
+ var b = l.call(this) || this;
829
+ return b._x = c, b._y = n, b._radiusX = f, b._radiusY = i, b._transform = y, b._styles = a, b;
830
830
  }
831
- return r(m, h), m;
832
- }(n(0).default);
833
- g.default = v;
834
- }, function(y, g, n) {
835
- var t, r = (t = function(h, m) {
836
- return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(o, s) {
837
- o.__proto__ = s;
838
- } || function(o, s) {
839
- for (var l in s) Object.prototype.hasOwnProperty.call(s, l) && (o[l] = s[l]);
840
- })(h, m);
841
- }, function(h, m) {
842
- function o() {
843
- this.constructor = h;
831
+ return r(u, l), u;
832
+ }(o(0).default);
833
+ g.default = h;
834
+ }, function(p, g, o) {
835
+ var t, r = (t = function(l, u) {
836
+ return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(c, n) {
837
+ c.__proto__ = n;
838
+ } || function(c, n) {
839
+ for (var f in n) Object.prototype.hasOwnProperty.call(n, f) && (c[f] = n[f]);
840
+ })(l, u);
841
+ }, function(l, u) {
842
+ function c() {
843
+ this.constructor = l;
844
844
  }
845
- t(h, m), h.prototype = m === null ? Object.create(m) : (o.prototype = m.prototype, new o());
845
+ t(l, u), l.prototype = u === null ? Object.create(u) : (c.prototype = u.prototype, new c());
846
846
  });
847
847
  Object.defineProperty(g, "__esModule", { value: !0 });
848
- var v = function(h) {
849
- function m(o, s, l, i, f, u, S) {
850
- var k = h.call(this) || this;
851
- return k._x = o, k._y = s, k._width = l, k._height = i, k._cornerRadius = f, k._transform = u, k._styles = S, k;
848
+ var h = function(l) {
849
+ function u(c, n, f, i, y, a, b) {
850
+ var w = l.call(this) || this;
851
+ return w._x = c, w._y = n, w._width = f, w._height = i, w._cornerRadius = y, w._transform = a, w._styles = b, w;
852
852
  }
853
- return r(m, h), m;
854
- }(n(0).default);
855
- g.default = v;
856
- }, function(y, g, n) {
853
+ return r(u, l), u;
854
+ }(o(0).default);
855
+ g.default = h;
856
+ }, function(p, g, o) {
857
857
  Object.defineProperty(g, "__esModule", { value: !0 });
858
858
  var t = function() {
859
859
  function r() {
@@ -864,22 +864,22 @@ var svga_lite_min = { exports: {} };
864
864
  }, this.onEnd = function() {
865
865
  }, this._isRunning = !1, this._mStartTime = 0, this._currentFrication = 0, this._worker = null;
866
866
  }
867
- return r.prototype.start = function(v) {
868
- this.doStart(v);
867
+ return r.prototype.start = function(h) {
868
+ this.doStart(h);
869
869
  }, r.prototype.stop = function() {
870
870
  this._doStop();
871
871
  }, Object.defineProperty(r.prototype, "animatedValue", { get: function() {
872
872
  return (this.endValue - this.startValue) * this._currentFrication + this.startValue;
873
- }, enumerable: !1, configurable: !0 }), r.prototype.doStart = function(v) {
874
- this._isRunning = !0, this._mStartTime = this._currentTimeMillsecond(), v && (this._mStartTime -= v / (this.endValue - this.startValue) * this.duration), this._currentFrication = 0, this.noExecutionDelay && this._worker === null && (this._worker = new Worker(window.URL.createObjectURL(new Blob([`onmessage = function () {
873
+ }, enumerable: !1, configurable: !0 }), r.prototype.doStart = function(h) {
874
+ this._isRunning = !0, this._mStartTime = this._currentTimeMillsecond(), h && (this._mStartTime -= h / (this.endValue - this.startValue) * this.duration), this._currentFrication = 0, this.noExecutionDelay && this._worker === null && (this._worker = new Worker(window.URL.createObjectURL(new Blob([`onmessage = function () {
875
875
  setTimeout(function() {postMessage(null)}, 1 / 60)
876
876
  }`])))), this.onStart(), this._doFrame();
877
877
  }, r.prototype._doStop = function() {
878
878
  this._isRunning = !1, this._worker !== null && (this._worker.terminate(), this._worker = null);
879
879
  }, r.prototype._doFrame = function() {
880
880
  this._isRunning && (this._doDeltaTime(this._currentTimeMillsecond() - this._mStartTime), this._isRunning && (this._worker ? (this._worker.onmessage = this._doFrame.bind(this), this._worker.postMessage(null)) : window.requestAnimationFrame(this._doFrame.bind(this))));
881
- }, r.prototype._doDeltaTime = function(v) {
882
- v >= this.duration * this.loop ? (this._currentFrication = this.fillRule === 1 ? 0 : 1, this._isRunning = !1) : this._currentFrication = v % this.duration / this.duration, this.onUpdate(this.animatedValue), this._isRunning === !1 && (this._worker !== null && (this._worker.terminate(), this._worker = null), this.onEnd());
881
+ }, r.prototype._doDeltaTime = function(h) {
882
+ h >= this.duration * this.loop ? (this._currentFrication = this.fillRule === 1 ? 0 : 1, this._isRunning = !1) : this._currentFrication = h % this.duration / this.duration, this.onUpdate(this.animatedValue), this._isRunning === !1 && (this._worker !== null && (this._worker.terminate(), this._worker = null), this.onEnd());
883
883
  }, r;
884
884
  }();
885
885
  g.default = t;
@@ -887,7 +887,7 @@ var svga_lite_min = { exports: {} };
887
887
  });
888
888
  })(svga_lite_min);
889
889
  var svga_lite_minExports = svga_lite_min.exports;
890
- const _sfc_main$1 = {
890
+ const _sfc_main$3 = {
891
891
  __name: "hbis-svgaPlayer",
892
892
  props: {
893
893
  /**
@@ -966,67 +966,221 @@ const _sfc_main$1 = {
966
966
  */
967
967
  "error"
968
968
  ],
969
- setup(y, { expose: g, emit: n }) {
969
+ setup(p, { expose: g, emit: o }) {
970
970
  useCssVars((e) => ({
971
- v5ce75b7f: y.width,
972
- v26351a8e: y.height
971
+ v5ce75b7f: p.width,
972
+ v26351a8e: p.height
973
973
  }));
974
- const t = y, r = n, v = ref(null), h = ref(null);
975
- let m = null, o = null, s = null;
976
- const l = async () => {
974
+ const t = p, r = o, h = ref(null), l = ref(null);
975
+ let u = null, c = null, n = null;
976
+ const f = async () => {
977
977
  try {
978
- m = new svga_lite_minExports.Parser(), s = await m.load(t.src), o = new svga_lite_minExports.Player(h.value), o.loop = t.loop, o.speed = t.speed, o.onStart = () => r("play"), o.onPause = () => r("pause"), o.onEnd = () => r("ended"), o.onFrame = () => r("progress", o.progress), await o.setAnimationData(s), t.progress > 0 && (o.progress = t.progress), t.autoplay && o.start(), r("loaded");
978
+ u = new svga_lite_minExports.Parser(), n = await u.load(t.src), c = new svga_lite_minExports.Player(l.value), c.loop = t.loop, c.speed = t.speed, c.onStart = () => r("play"), c.onPause = () => r("pause"), c.onEnd = () => r("ended"), c.onFrame = () => r("progress", c.progress), await c.setAnimationData(n), t.progress > 0 && (c.progress = t.progress), t.autoplay && c.start(), r("loaded");
979
979
  } catch (e) {
980
980
  console.error("SVGA 加载失败:", e), r("error", e);
981
981
  }
982
982
  }, i = () => {
983
- o && o.start();
984
- }, f = () => {
985
- o && o.pause();
986
- }, u = () => {
987
- o && o.stop();
988
- }, S = () => {
989
- o && (o.stop(), o.start());
990
- }, k = (e) => {
991
- o && (o.progress = e);
992
- }, a = (e) => {
993
- o && (o.speed = e);
994
- }, p = (e) => {
995
- o && (o.loop = e);
983
+ c && c.start();
984
+ }, y = () => {
985
+ c && c.pause();
986
+ }, a = () => {
987
+ c && c.stop();
988
+ }, b = () => {
989
+ c && (c.stop(), c.start());
990
+ }, w = (e) => {
991
+ c && (c.progress = e);
992
+ }, s = (e) => {
993
+ c && (c.speed = e);
994
+ }, d = (e) => {
995
+ c && (c.loop = e);
996
996
  };
997
997
  return g({
998
998
  play: i,
999
- pause: f,
1000
- stop: u,
1001
- restart: S,
1002
- setProgress: k,
1003
- setSpeed: a,
1004
- setLoop: p
999
+ pause: y,
1000
+ stop: a,
1001
+ restart: b,
1002
+ setProgress: w,
1003
+ setSpeed: s,
1004
+ setLoop: d
1005
1005
  }), watch(() => t.src, async (e) => {
1006
- e && await l();
1006
+ e && await f();
1007
1007
  }), watch(() => t.loop, (e) => {
1008
- p(e);
1008
+ d(e);
1009
1009
  }), watch(() => t.speed, (e) => {
1010
- a(e);
1010
+ s(e);
1011
1011
  }), watch(() => t.progress, (e) => {
1012
- k(e);
1012
+ w(e);
1013
1013
  }), onMounted(async () => {
1014
- await nextTick(), await l();
1014
+ await nextTick(), await f();
1015
1015
  }), onUnmounted(() => {
1016
- o && (o.stop(), o = null), m && (m = null), s = null;
1017
- }), (e, A) => (openBlock(), createElementBlock("div", {
1016
+ c && (c.stop(), c = null), u && (u = null), n = null;
1017
+ }), (e, x) => (openBlock(), createElementBlock("div", {
1018
1018
  ref_key: "containerRef",
1019
- ref: v,
1019
+ ref: h,
1020
1020
  class: "svga-player-container"
1021
1021
  }, [
1022
1022
  createElementVNode("canvas", {
1023
1023
  ref_key: "canvasRef",
1024
- ref: h,
1024
+ ref: l,
1025
1025
  class: "svga-player-canvas"
1026
1026
  }, null, 512)
1027
1027
  ], 512));
1028
1028
  }
1029
- }, HbisSvgaPlayer = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-6b83dcf1"]]), _sfc_main = {
1029
+ }, HbisSvgaPlayer = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-6b83dcf1"]]), _hoisted_1$1 = { class: "waterfall-debug" }, _hoisted_2$1 = { class: "waterfall-container" }, _hoisted_3$1 = { class: "column-debug" }, _hoisted_4$1 = {
1030
+ key: 0,
1031
+ class: "waterfall-item-with-slot"
1032
+ }, _hoisted_5$1 = ["src"], _hoisted_6 = { class: "waterfall-content" }, _hoisted_7 = ["src"], _sfc_main$2 = /* @__PURE__ */ Object.assign({
1033
+ name: "HbisWaterfall"
1034
+ }, {
1035
+ __name: "hbis-waterfall",
1036
+ props: {
1037
+ /**
1038
+ * 瀑布流数据
1039
+ */
1040
+ data: {
1041
+ type: Array,
1042
+ default: () => []
1043
+ },
1044
+ /**
1045
+ * 列数
1046
+ */
1047
+ column: {
1048
+ type: Number,
1049
+ default: 2,
1050
+ validator: (p) => p >= 2
1051
+ },
1052
+ /**
1053
+ * 最大列数
1054
+ */
1055
+ maxColumn: {
1056
+ type: Number,
1057
+ default: 5
1058
+ },
1059
+ /**
1060
+ * 列间距
1061
+ */
1062
+ columnGap: {
1063
+ type: [Number, String],
1064
+ default: 10
1065
+ },
1066
+ /**
1067
+ * 行间距
1068
+ */
1069
+ rowGap: {
1070
+ type: [Number, String],
1071
+ default: 10
1072
+ },
1073
+ /**
1074
+ * 数据唯一键
1075
+ */
1076
+ itemKey: {
1077
+ type: String,
1078
+ default: "id"
1079
+ },
1080
+ /**
1081
+ * 图片字段名
1082
+ */
1083
+ imageKey: {
1084
+ type: String,
1085
+ default: "url"
1086
+ }
1087
+ },
1088
+ emits: ["load", "error"],
1089
+ setup(p, { expose: g, emit: o }) {
1090
+ const t = useSlots(), r = ref(null), h = p, l = o;
1091
+ useCssVars(() => ({
1092
+ columnGap: String(h.columnGap) + "px",
1093
+ rowGap: String(h.rowGap) + "px"
1094
+ }));
1095
+ const u = ref([]), c = ref(2), n = computed(() => t.default !== void 0), f = (b) => (r.value && r.value.offsetWidth, Math.min(h.column, h.maxColumn), parseInt(h.columnGap), parseInt(h.rowGap), 200 + Math.floor(Math.random() * 100) + 20), i = () => {
1096
+ console.log("开始分配数据,总数据量:", h.data.length);
1097
+ const b = Math.min(h.column, h.maxColumn);
1098
+ c.value = b;
1099
+ const w = [];
1100
+ for (let s = 0; s < b; s++)
1101
+ w.push({
1102
+ items: [],
1103
+ height: 0
1104
+ });
1105
+ u.value = w, h.data.forEach((s, d) => {
1106
+ const e = f();
1107
+ let x = 1 / 0, v = 0;
1108
+ for (let _ = 0; _ < b; _++)
1109
+ u.value[_].height < x && (x = u.value[_].height, v = _);
1110
+ u.value[v].items.push(s), u.value[v].height += e, console.log("分配数据到列:", { itemIndex: d, columnIndex: v, itemHeight: e, columnHeight: u.value[v].height });
1111
+ }), console.log("分配完成,各列数据量:", u.value.map((s, d) => `列${d + 1}: ${s.items.length}个`)), console.log("分配完成,各列高度:", u.value.map((s, d) => `列${d + 1}: ${s.height}px`));
1112
+ }, y = (b) => {
1113
+ l("load", b);
1114
+ }, a = (b) => {
1115
+ l("error", b);
1116
+ };
1117
+ return watch(() => h.data, () => {
1118
+ console.log("数据变化,重新分配数据"), i();
1119
+ }, { deep: !0 }), watch(() => [h.column, h.maxColumn], () => {
1120
+ console.log("列数变化,更新列数"), c.value = Math.min(h.column, h.maxColumn), i();
1121
+ }), watch(() => [h.columnGap, h.rowGap], () => {
1122
+ console.log("间距变化,重新计算高度和分配数据"), i();
1123
+ }), onMounted(() => {
1124
+ console.log("===== 组件挂载 ====="), console.log("组件挂载,初始化数据"), console.log("初始数据量:", h.data.length);
1125
+ try {
1126
+ i(), console.log("===== 组件挂载完成 =====");
1127
+ } catch (b) {
1128
+ console.error("refresh函数执行失败:", b), console.log("===== 组件挂载失败 =====");
1129
+ }
1130
+ }), g({
1131
+ refresh: i
1132
+ }), (b, w) => (openBlock(), createElementBlock("div", {
1133
+ ref_key: "waterfallRef",
1134
+ ref: r
1135
+ }, [
1136
+ createElementVNode("div", _hoisted_1$1, [
1137
+ createTextVNode(" 列数: " + toDisplayString(c.value) + " ", 1),
1138
+ w[1] || (w[1] = createElementVNode("br", null, null, -1)),
1139
+ createTextVNode(" 数据总量: " + toDisplayString(p.data.length) + " ", 1),
1140
+ w[2] || (w[2] = createElementVNode("br", null, null, -1)),
1141
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(u.value, (s, d) => (openBlock(), createElementBlock(Fragment, { key: d }, [
1142
+ createTextVNode(" 列" + toDisplayString(d + 1) + "数据量: " + toDisplayString(s.items.length), 1),
1143
+ w[0] || (w[0] = createElementVNode("br", null, null, -1))
1144
+ ], 64))), 128))
1145
+ ]),
1146
+ createElementVNode("div", _hoisted_2$1, [
1147
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(u.value, (s, d) => (openBlock(), createElementBlock("div", {
1148
+ key: d,
1149
+ class: "waterfall-column"
1150
+ }, [
1151
+ createElementVNode("div", _hoisted_3$1, " 列" + toDisplayString(d + 1) + ": " + toDisplayString(s.items.length) + "个元素 ", 1),
1152
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(s.items, (e, x) => (openBlock(), createElementBlock("div", {
1153
+ key: e[p.itemKey] || `col${d}-${x}`,
1154
+ class: "waterfall-item"
1155
+ }, [
1156
+ n.value ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
1157
+ createElementVNode("img", {
1158
+ src: e[p.imageKey],
1159
+ class: "waterfall-image",
1160
+ style: normalizeStyle({ height: f() + "px" }),
1161
+ onLoad: y,
1162
+ onError: a
1163
+ }, null, 44, _hoisted_5$1),
1164
+ createElementVNode("div", _hoisted_6, [
1165
+ renderSlot(b.$slots, "default", {
1166
+ item: e,
1167
+ index: x
1168
+ }, void 0, !0)
1169
+ ])
1170
+ ])) : (openBlock(), createElementBlock("img", {
1171
+ key: 1,
1172
+ src: e[p.imageKey],
1173
+ class: "waterfall-image",
1174
+ style: normalizeStyle({ height: f() + "px" }),
1175
+ onLoad: y,
1176
+ onError: a
1177
+ }, null, 44, _hoisted_7))
1178
+ ]))), 128))
1179
+ ]))), 128))
1180
+ ])
1181
+ ], 512));
1182
+ }
1183
+ }), HbisWaterfall = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-20459ccd"]]), _sfc_main$1 = {
1030
1184
  __name: "hbis-auto-scroll-list",
1031
1185
  props: {
1032
1186
  // 列表数据数组
@@ -1043,7 +1197,7 @@ const _sfc_main$1 = {
1043
1197
  direction: {
1044
1198
  type: String,
1045
1199
  default: "vertical",
1046
- validator: (y) => ["vertical", "horizontal"].includes(y)
1200
+ validator: (p) => ["vertical", "horizontal"].includes(p)
1047
1201
  },
1048
1202
  // 鼠标悬停是否暂停
1049
1203
  pauseOnHover: {
@@ -1087,8 +1241,8 @@ const _sfc_main$1 = {
1087
1241
  }
1088
1242
  },
1089
1243
  emits: ["scroll", "pause", "resume", "dragStart", "dragEnd"],
1090
- setup(y, { expose: g, emit: n }) {
1091
- const t = y, r = n, v = ref(null), h = ref(null), m = ref(!1), o = ref(null), s = ref(0), l = ref([]), i = ref(!1), f = ref(0), u = ref(0), S = ref(0), k = ref(!1), a = computed(() => ({
1244
+ setup(p, { expose: g, emit: o }) {
1245
+ const t = p, r = o, h = ref(null), l = ref(null), u = ref(!1), c = ref(null), n = ref(0), f = ref([]), i = ref(!1), y = ref(0), a = ref(0), b = ref(0), w = ref(!1), s = computed(() => ({
1092
1246
  // 动态设置容器高度和宽度
1093
1247
  height: typeof t.containerHeight == "number" ? `${t.containerHeight}px` : t.containerHeight,
1094
1248
  width: typeof t.containerWidth == "number" ? `${t.containerWidth}px` : t.containerWidth,
@@ -1096,8 +1250,8 @@ const _sfc_main$1 = {
1096
1250
  // 隐藏超出部分
1097
1251
  position: "relative"
1098
1252
  // 相对定位,为绝对定位的内容容器提供参考
1099
- })), p = computed(() => {
1100
- const c = {
1253
+ })), d = computed(() => {
1254
+ const m = {
1101
1255
  position: "absolute",
1102
1256
  // 绝对定位,实现自由移动
1103
1257
  transition: "none",
@@ -1105,169 +1259,268 @@ const _sfc_main$1 = {
1105
1259
  willChange: "transform"
1106
1260
  // 告诉浏览器将要变化的属性,优化性能
1107
1261
  };
1108
- return t.direction === "vertical" ? c.transform = `translateY(${s.value}px)` : c.transform = `translateX(${s.value}px)`, c;
1262
+ return t.direction === "vertical" ? m.transform = `translateY(${n.value}px)` : m.transform = `translateX(${n.value}px)`, m;
1109
1263
  }), e = () => {
1110
1264
  if (!t.data || t.data.length === 0) {
1111
- l.value = [];
1265
+ f.value = [];
1112
1266
  return;
1113
1267
  }
1114
- t.loop ? l.value = [...t.data, ...t.data] : l.value = [...t.data];
1115
- }, A = () => {
1116
- if (m.value || i.value) {
1117
- o.value = requestAnimationFrame(A);
1268
+ t.loop ? f.value = [...t.data, ...t.data] : f.value = [...t.data];
1269
+ }, x = () => {
1270
+ if (u.value || i.value) {
1271
+ c.value = requestAnimationFrame(x);
1118
1272
  return;
1119
1273
  }
1120
- const c = v.value, b = h.value;
1121
- if (!c || !b) {
1122
- o.value = requestAnimationFrame(A);
1274
+ const m = h.value, k = l.value;
1275
+ if (!m || !k) {
1276
+ c.value = requestAnimationFrame(x);
1123
1277
  return;
1124
1278
  }
1125
- const O = t.direction === "vertical" ? c.offsetHeight : c.offsetWidth, B = (t.direction === "vertical" ? t.itemHeight : t.itemWidth) * t.data.length;
1126
- if (s.value -= t.speed, t.loop)
1127
- Math.abs(s.value) >= B && (s.value = 0);
1279
+ const N = t.direction === "vertical" ? m.offsetHeight : m.offsetWidth, D = (t.direction === "vertical" ? t.itemHeight : t.itemWidth) * t.data.length;
1280
+ if (n.value -= t.speed, t.loop)
1281
+ Math.abs(n.value) >= D && (n.value = 0);
1128
1282
  else {
1129
- const j = -(B - O);
1130
- if (s.value <= j) {
1131
- s.value = j, m.value = !0, r("scroll", s.value);
1283
+ const j = -(D - N);
1284
+ if (n.value <= j) {
1285
+ n.value = j, u.value = !0, r("scroll", n.value);
1132
1286
  return;
1133
1287
  }
1134
1288
  }
1135
- r("scroll", s.value), o.value = requestAnimationFrame(A);
1136
- }, d = () => {
1137
- o.value && cancelAnimationFrame(o.value), o.value = requestAnimationFrame(A);
1138
- }, w = () => {
1139
- o.value && (cancelAnimationFrame(o.value), o.value = null);
1140
- }, x = () => {
1141
- m.value = !0, r("pause");
1289
+ r("scroll", n.value), c.value = requestAnimationFrame(x);
1290
+ }, v = () => {
1291
+ c.value && cancelAnimationFrame(c.value), c.value = requestAnimationFrame(x);
1142
1292
  }, _ = () => {
1143
- m.value = !1, r("resume");
1144
- }, N = () => {
1145
- t.pauseOnHover && x();
1293
+ c.value && (cancelAnimationFrame(c.value), c.value = null);
1294
+ }, E = () => {
1295
+ u.value = !0, r("pause");
1296
+ }, S = () => {
1297
+ u.value = !1, r("resume");
1298
+ }, O = () => {
1299
+ t.pauseOnHover && E();
1146
1300
  }, T = () => {
1147
- t.pauseOnHover && !i.value && _();
1148
- }, F = (c) => {
1149
- i.value = !0, k.value = m.value, m.value = !0, f.value = t.direction === "vertical" ? c.clientY : c.clientX, u.value = f.value, S.value = s.value, r("dragStart"), document.addEventListener("mousemove", C), document.addEventListener("mouseup", D);
1150
- }, C = (c) => {
1301
+ t.pauseOnHover && !i.value && S();
1302
+ }, I = (m) => {
1303
+ i.value = !0, w.value = u.value, u.value = !0, y.value = t.direction === "vertical" ? m.clientY : m.clientX, a.value = y.value, b.value = n.value, r("dragStart"), document.addEventListener("mousemove", C), document.addEventListener("mouseup", B);
1304
+ }, C = (m) => {
1151
1305
  if (!i.value) return;
1152
- u.value = t.direction === "vertical" ? c.clientY : c.clientX;
1153
- const b = u.value - f.value;
1154
- s.value = S.value + b;
1155
- const O = v.value, E = h.value;
1156
- if (O && E) {
1157
- const B = t.direction === "vertical" ? O.offsetHeight : O.offsetWidth, $ = (t.direction === "vertical" ? t.itemHeight : t.itemWidth) * t.data.length;
1306
+ a.value = t.direction === "vertical" ? m.clientY : m.clientX;
1307
+ const k = a.value - y.value;
1308
+ n.value = b.value + k;
1309
+ const N = h.value, A = l.value;
1310
+ if (N && A) {
1311
+ const D = t.direction === "vertical" ? N.offsetHeight : N.offsetWidth, L = (t.direction === "vertical" ? t.itemHeight : t.itemWidth) * t.data.length;
1158
1312
  if (t.loop)
1159
- s.value > 0 ? s.value = 0 : Math.abs(s.value) > $ && (s.value = -$);
1313
+ n.value > 0 ? n.value = 0 : Math.abs(n.value) > L && (n.value = -L);
1160
1314
  else {
1161
- const R = -($ - B);
1162
- s.value > 0 ? s.value = 0 : s.value < R && (s.value = R);
1315
+ const P = -(L - D);
1316
+ n.value > 0 ? n.value = 0 : n.value < P && (n.value = P);
1163
1317
  }
1164
1318
  }
1165
- r("scroll", s.value);
1166
- }, D = () => {
1167
- i.value && (i.value = !1, document.removeEventListener("mousemove", C), document.removeEventListener("mouseup", D), k.value || (m.value = !1), r("dragEnd"));
1168
- }, P = (c) => {
1169
- const b = c.touches[0];
1170
- i.value = !0, k.value = m.value, m.value = !0, f.value = t.direction === "vertical" ? b.clientY : b.clientX, u.value = f.value, S.value = s.value, r("dragStart");
1171
- }, L = (c) => {
1319
+ r("scroll", n.value);
1320
+ }, B = () => {
1321
+ i.value && (i.value = !1, document.removeEventListener("mousemove", C), document.removeEventListener("mouseup", B), w.value || (u.value = !1), r("dragEnd"));
1322
+ }, $ = (m) => {
1323
+ const k = m.touches[0];
1324
+ i.value = !0, w.value = u.value, u.value = !0, y.value = t.direction === "vertical" ? k.clientY : k.clientX, a.value = y.value, b.value = n.value, r("dragStart");
1325
+ }, R = (m) => {
1172
1326
  if (!i.value) return;
1173
- c.preventDefault();
1174
- const b = c.touches[0];
1175
- u.value = t.direction === "vertical" ? b.clientY : b.clientX;
1176
- const O = u.value - f.value;
1177
- s.value = S.value + O;
1178
- const E = v.value, B = h.value;
1179
- if (E && B) {
1180
- const j = t.direction === "vertical" ? E.offsetHeight : E.offsetWidth, R = (t.direction === "vertical" ? t.itemHeight : t.itemWidth) * t.data.length;
1327
+ m.preventDefault();
1328
+ const k = m.touches[0];
1329
+ a.value = t.direction === "vertical" ? k.clientY : k.clientX;
1330
+ const N = a.value - y.value;
1331
+ n.value = b.value + N;
1332
+ const A = h.value, D = l.value;
1333
+ if (A && D) {
1334
+ const j = t.direction === "vertical" ? A.offsetHeight : A.offsetWidth, P = (t.direction === "vertical" ? t.itemHeight : t.itemWidth) * t.data.length;
1181
1335
  if (t.loop)
1182
- s.value > 0 ? s.value = 0 : Math.abs(s.value) > R && (s.value = -R);
1336
+ n.value > 0 ? n.value = 0 : Math.abs(n.value) > P && (n.value = -P);
1183
1337
  else {
1184
- const z = -(R - j);
1185
- s.value > 0 ? s.value = 0 : s.value < z && (s.value = z);
1338
+ const z = -(P - j);
1339
+ n.value > 0 ? n.value = 0 : n.value < z && (n.value = z);
1186
1340
  }
1187
1341
  }
1188
- r("scroll", s.value);
1342
+ r("scroll", n.value);
1189
1343
  }, V = () => {
1190
- i.value && (i.value = !1, k.value || (m.value = !1), r("dragEnd"));
1191
- }, M = (c) => {
1192
- s.value = c;
1193
- }, I = () => {
1194
- s.value = 0;
1344
+ i.value && (i.value = !1, w.value || (u.value = !1), r("dragEnd"));
1345
+ }, M = (m) => {
1346
+ n.value = m;
1347
+ }, F = () => {
1348
+ n.value = 0;
1195
1349
  }, W = () => {
1196
- const c = v.value;
1197
- if (c) {
1198
- const b = h.value;
1199
- if (b) {
1200
- const O = t.direction === "vertical" ? b.offsetHeight : b.offsetWidth;
1201
- s.value = -(O - c.offsetHeight);
1350
+ const m = h.value;
1351
+ if (m) {
1352
+ const k = l.value;
1353
+ if (k) {
1354
+ const N = t.direction === "vertical" ? k.offsetHeight : k.offsetWidth;
1355
+ n.value = -(N - m.offsetHeight);
1202
1356
  }
1203
1357
  }
1204
1358
  };
1205
1359
  return watch(() => t.data, () => {
1206
- e(), s.value = 0;
1360
+ e(), n.value = 0;
1207
1361
  }, { deep: !0 }), watch(() => t.speed, () => {
1208
- m.value || (w(), d());
1362
+ u.value || (_(), v());
1209
1363
  }), onMounted(() => {
1210
1364
  e(), nextTick(() => {
1211
- d();
1212
- const c = v.value;
1213
- c && (c.addEventListener("mouseenter", N), c.addEventListener("mouseleave", T));
1365
+ v();
1366
+ const m = h.value;
1367
+ m && (m.addEventListener("mouseenter", O), m.addEventListener("mouseleave", T));
1214
1368
  });
1215
1369
  }), onUnmounted(() => {
1216
- w();
1217
- const c = v.value;
1218
- c && (c.removeEventListener("mouseenter", N), c.removeEventListener("mouseleave", T)), document.removeEventListener("mousemove", C), document.removeEventListener("mouseup", D);
1370
+ _();
1371
+ const m = h.value;
1372
+ m && (m.removeEventListener("mouseenter", O), m.removeEventListener("mouseleave", T)), document.removeEventListener("mousemove", C), document.removeEventListener("mouseup", B);
1219
1373
  }), g({
1220
- pause: x,
1374
+ pause: E,
1221
1375
  // 暂停滚动
1222
- resume: _,
1376
+ resume: S,
1223
1377
  // 恢复滚动
1224
1378
  scrollTo: M,
1225
1379
  // 滚动到指定位置
1226
- scrollToTop: I,
1380
+ scrollToTop: F,
1227
1381
  // 滚动到顶部
1228
1382
  scrollToBottom: W,
1229
1383
  // 滚动到底部
1230
- isPaused: m,
1384
+ isPaused: u,
1231
1385
  // 是否暂停(响应式)
1232
1386
  isDragging: i
1233
1387
  // 是否正在拖拽(响应式)
1234
- }), (c, b) => (openBlock(), createElementBlock("div", {
1388
+ }), (m, k) => (openBlock(), createElementBlock("div", {
1235
1389
  class: "hbis-auto-scroll-list",
1236
1390
  ref_key: "containerRef",
1237
- ref: v,
1238
- style: normalizeStyle(a.value),
1239
- onMousedown: F,
1240
- onTouchstart: P,
1241
- onTouchmove: L,
1391
+ ref: h,
1392
+ style: normalizeStyle(s.value),
1393
+ onMousedown: I,
1394
+ onTouchstart: $,
1395
+ onTouchmove: R,
1242
1396
  onTouchend: V
1243
1397
  }, [
1244
1398
  createElementVNode("div", {
1245
1399
  class: "scroll-content",
1246
1400
  ref_key: "contentRef",
1247
- ref: h,
1248
- style: normalizeStyle(p.value)
1401
+ ref: l,
1402
+ style: normalizeStyle(d.value)
1249
1403
  }, [
1250
- (openBlock(!0), createElementBlock(Fragment, null, renderList(l.value, (O, E) => renderSlot(c.$slots, "item", {
1251
- item: O,
1252
- index: E
1404
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(f.value, (N, A) => renderSlot(m.$slots, "item", {
1405
+ item: N,
1406
+ index: A
1253
1407
  }, () => [
1254
1408
  createElementVNode("div", {
1255
1409
  class: "default-item",
1256
- style: normalizeStyle(y.itemStyle)
1257
- }, toDisplayString(O), 5)
1410
+ style: normalizeStyle(p.itemStyle)
1411
+ }, toDisplayString(N), 5)
1258
1412
  ], !0)), 256))
1259
1413
  ], 4)
1260
1414
  ], 36));
1261
1415
  }
1262
- }, HbisAutoScrollList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d23f102b"]]);
1416
+ }, HbisAutoScrollList = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-d23f102b"]]), _hoisted_1 = { class: "search-dropdown" }, _hoisted_2 = ["placeholder"], _hoisted_3 = {
1417
+ key: 0,
1418
+ class: "dropdown-list"
1419
+ }, _hoisted_4 = ["onClick"], _hoisted_5 = { class: "item-text" }, _sfc_main = {
1420
+ __name: "hbis-search-input",
1421
+ props: {
1422
+ list: {
1423
+ type: Array,
1424
+ default: () => []
1425
+ },
1426
+ placeholder: {
1427
+ type: String,
1428
+ default: "请输入关键词搜索"
1429
+ },
1430
+ defaultValue: {
1431
+ type: String,
1432
+ default: ""
1433
+ },
1434
+ maxHeight: {
1435
+ type: Number,
1436
+ default: 400
1437
+ },
1438
+ showClear: {
1439
+ type: Boolean,
1440
+ default: !0
1441
+ }
1442
+ },
1443
+ emits: ["clearIcon", "search", "select"],
1444
+ setup(p, { emit: g }) {
1445
+ const o = p, t = g, r = ref(o.defaultValue), h = ref(!1), l = ref(!1), u = ref([]);
1446
+ function c() {
1447
+ r.value = "", u.value = [], l.value = !1, t("clearIcon", "", []);
1448
+ }
1449
+ function n() {
1450
+ const a = r.value;
1451
+ u.value = o.list.filter(
1452
+ (b) => b.name && b.name.includes(a)
1453
+ ), l.value = u.value.length > 0, t("search", a, u.value);
1454
+ }
1455
+ function f() {
1456
+ u.value = o.list.filter(
1457
+ (a) => a.name && a.name.includes(r.value)
1458
+ ), h.value = !0, l.value = !0;
1459
+ }
1460
+ function i() {
1461
+ setTimeout(() => {
1462
+ h.value = !1, l.value = !1;
1463
+ }, 150);
1464
+ }
1465
+ function y(a) {
1466
+ r.value = a.name, l.value = !1, t("select", a);
1467
+ }
1468
+ return onMounted(() => {
1469
+ o.defaultValue && (r.value = o.defaultValue);
1470
+ }), (a, b) => {
1471
+ const w = resolveComponent("scroll-view");
1472
+ return openBlock(), createElementBlock("div", _hoisted_1, [
1473
+ createElementVNode("div", {
1474
+ class: normalizeClass(["input-wrapper", { focus: h.value }])
1475
+ }, [
1476
+ withDirectives(createElementVNode("input", {
1477
+ class: "search-input",
1478
+ placeholder: p.placeholder,
1479
+ "onUpdate:modelValue": b[0] || (b[0] = (s) => r.value = s),
1480
+ onInput: n,
1481
+ onFocus: f,
1482
+ onBlur: i
1483
+ }, null, 40, _hoisted_2), [
1484
+ [vModelText, r.value]
1485
+ ]),
1486
+ r.value && p.showClear ? (openBlock(), createElementBlock("div", {
1487
+ key: 0,
1488
+ class: "clear-icon",
1489
+ onClick: c
1490
+ }, "×")) : createCommentVNode("", !0)
1491
+ ], 2),
1492
+ l.value && u.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3, [
1493
+ createVNode(w, {
1494
+ "scroll-y": "",
1495
+ style: normalizeStyle({ maxHeight: p.maxHeight + "px" })
1496
+ }, {
1497
+ default: withCtx(() => [
1498
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(u.value, (s, d) => (openBlock(), createElementBlock("div", {
1499
+ key: d,
1500
+ class: "dropdown-item",
1501
+ onClick: (e) => y(s)
1502
+ }, [
1503
+ createElementVNode("span", _hoisted_5, toDisplayString(s.name), 1)
1504
+ ], 8, _hoisted_4))), 128))
1505
+ ]),
1506
+ _: 1
1507
+ }, 8, ["style"])
1508
+ ])) : createCommentVNode("", !0)
1509
+ ]);
1510
+ };
1511
+ }
1512
+ };
1263
1513
  export {
1264
1514
  C1,
1265
1515
  C2,
1266
1516
  HbisAutoScrollList,
1267
1517
  HbisSvgaPlayer,
1518
+ HbisWaterfall,
1268
1519
  HbisAutoScrollList as hbisAutoScrollList,
1269
1520
  hbisDateStrip,
1270
- _sfc_main$2 as hbisPreviewImage,
1271
- HbisSvgaPlayer as hbisSvgaPlayer
1521
+ _sfc_main$4 as hbisPreviewImage,
1522
+ _sfc_main as hbisSearchInput,
1523
+ HbisSvgaPlayer as hbisSvgaPlayer,
1524
+ HbisWaterfall as hbisWaterfall
1272
1525
  };
1273
1526
  //# sourceMappingURL=index.es.js.map