@ctc-front/components-ui-next 0.2.0 → 0.3.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.js CHANGED
@@ -1,17 +1,75 @@
1
- import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createVNode as s, defineComponent as c, guardReactiveProps as l, h as u, inject as d, mergeProps as f, normalizeClass as p, normalizeProps as m, normalizeStyle as h, onBeforeUnmount as g, openBlock as _, ref as v, renderList as y, renderSlot as b, toDisplayString as x, unref as S, useAttrs as C, useSlots as w, useTemplateRef as T, withCtx as E, withDirectives as D } from "vue";
2
- import { ElDialog as O, ElDrawer as k, ElIcon as A, ElPagination as j, ElTable as M, ElTableColumn as N, vLoading as P } from "element-plus";
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, h as d, inject as f, mergeProps as p, nextTick as m, normalizeClass as h, normalizeProps as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, onUnmounted as b, openBlock as x, ref as S, renderList as C, renderSlot as w, resolveDynamicComponent as T, toDisplayString as E, unref as D, useAttrs as O, useSlots as k, useTemplateRef as A, vShow as j, watch as M, withCtx as N, withDirectives as P } from "vue";
2
+ import { ElDatePicker as F, ElDialog as I, ElDrawer as L, ElIcon as R, ElInput as z, ElPagination as B, ElScrollbar as ee, ElSegmented as te, ElSlider as ne, ElTable as V, ElTableColumn as re, ElTag as ie, ElTooltip as H, vLoading as ae } from "element-plus";
3
3
  //#region src/config.ts
4
- var F = Symbol("CtcComponentsUiConfig");
5
- function I() {
6
- return d(F, {});
4
+ var oe = Symbol("CtcComponentsUiConfig");
5
+ function U() {
6
+ return f(oe, {});
7
7
  }
8
8
  //#endregion
9
9
  //#region node_modules/.pnpm/@element-plus+icons-vue@2.3.2_vue@3.5.41_typescript@5.8.3_/node_modules/@element-plus/icons-vue/dist/index.js
10
- var L = /* @__PURE__ */ c({
10
+ var W = /* @__PURE__ */ l({
11
+ name: "ArrowDown",
12
+ __name: "arrow-down",
13
+ setup(e) {
14
+ return (e, t) => (x(), i("svg", {
15
+ xmlns: "http://www.w3.org/2000/svg",
16
+ viewBox: "0 0 1024 1024"
17
+ }, [a("path", {
18
+ fill: "currentColor",
19
+ d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"
20
+ })]));
21
+ }
22
+ }), se = /* @__PURE__ */ l({
23
+ name: "ArrowRight",
24
+ __name: "arrow-right",
25
+ setup(e) {
26
+ return (e, t) => (x(), i("svg", {
27
+ xmlns: "http://www.w3.org/2000/svg",
28
+ viewBox: "0 0 1024 1024"
29
+ }, [a("path", {
30
+ fill: "currentColor",
31
+ d: "M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
32
+ })]));
33
+ }
34
+ }), ce = /* @__PURE__ */ l({
35
+ name: "Bell",
36
+ __name: "bell",
37
+ setup(e) {
38
+ return (e, t) => (x(), i("svg", {
39
+ xmlns: "http://www.w3.org/2000/svg",
40
+ viewBox: "0 0 1024 1024"
41
+ }, [
42
+ a("path", {
43
+ fill: "currentColor",
44
+ d: "M512 64a64 64 0 0 1 64 64v64H448v-64a64 64 0 0 1 64-64"
45
+ }),
46
+ a("path", {
47
+ fill: "currentColor",
48
+ d: "M256 768h512V448a256 256 0 1 0-512 0zm256-640a320 320 0 0 1 320 320v384H192V448a320 320 0 0 1 320-320"
49
+ }),
50
+ a("path", {
51
+ fill: "currentColor",
52
+ d: "M96 768h832q32 0 32 32t-32 32H96q-32 0-32-32t32-32m352 128h128a64 64 0 0 1-128 0"
53
+ })
54
+ ]));
55
+ }
56
+ }), le = /* @__PURE__ */ l({
57
+ name: "Camera",
58
+ __name: "camera",
59
+ setup(e) {
60
+ return (e, t) => (x(), i("svg", {
61
+ xmlns: "http://www.w3.org/2000/svg",
62
+ viewBox: "0 0 1024 1024"
63
+ }, [a("path", {
64
+ fill: "currentColor",
65
+ d: "M896 256H128v576h768zm-199.424-64-32.064-64h-304.96l-32 64zM96 192h160l46.336-92.608A64 64 0 0 1 359.552 64h304.96a64 64 0 0 1 57.216 35.328L768.192 192H928a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32m416 512a160 160 0 1 0 0-320 160 160 0 0 0 0 320m0 64a224 224 0 1 1 0-448 224 224 0 0 1 0 448"
66
+ })]));
67
+ }
68
+ }), G = /* @__PURE__ */ l({
11
69
  name: "Close",
12
70
  __name: "close",
13
71
  setup(e) {
14
- return (e, t) => (_(), i("svg", {
72
+ return (e, t) => (x(), i("svg", {
15
73
  xmlns: "http://www.w3.org/2000/svg",
16
74
  viewBox: "0 0 1024 1024"
17
75
  }, [a("path", {
@@ -19,11 +77,23 @@ var L = /* @__PURE__ */ c({
19
77
  d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
20
78
  })]));
21
79
  }
22
- }), R = /* @__PURE__ */ c({
80
+ }), K = /* @__PURE__ */ l({
81
+ name: "Fold",
82
+ __name: "fold",
83
+ setup(e) {
84
+ return (e, t) => (x(), i("svg", {
85
+ xmlns: "http://www.w3.org/2000/svg",
86
+ viewBox: "0 0 1024 1024"
87
+ }, [a("path", {
88
+ fill: "currentColor",
89
+ d: "M896 192H128v128h768zm0 256H384v128h512zm0 256H128v128h768zM320 384 128 512l192 128z"
90
+ })]));
91
+ }
92
+ }), q = /* @__PURE__ */ l({
23
93
  name: "FullScreen",
24
94
  __name: "full-screen",
25
95
  setup(e) {
26
- return (e, t) => (_(), i("svg", {
96
+ return (e, t) => (x(), i("svg", {
27
97
  xmlns: "http://www.w3.org/2000/svg",
28
98
  viewBox: "0 0 1024 1024"
29
99
  }, [a("path", {
@@ -31,11 +101,23 @@ var L = /* @__PURE__ */ c({
31
101
  d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"
32
102
  })]));
33
103
  }
34
- }), z = /* @__PURE__ */ c({
104
+ }), ue = /* @__PURE__ */ l({
105
+ name: "Loading",
106
+ __name: "loading",
107
+ setup(e) {
108
+ return (e, t) => (x(), i("svg", {
109
+ xmlns: "http://www.w3.org/2000/svg",
110
+ viewBox: "0 0 1024 1024"
111
+ }, [a("path", {
112
+ fill: "currentColor",
113
+ d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"
114
+ })]));
115
+ }
116
+ }), de = /* @__PURE__ */ l({
35
117
  name: "Minus",
36
118
  __name: "minus",
37
119
  setup(e) {
38
- return (e, t) => (_(), i("svg", {
120
+ return (e, t) => (x(), i("svg", {
39
121
  xmlns: "http://www.w3.org/2000/svg",
40
122
  viewBox: "0 0 1024 1024"
41
123
  }, [a("path", {
@@ -43,10 +125,112 @@ var L = /* @__PURE__ */ c({
43
125
  d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"
44
126
  })]));
45
127
  }
128
+ }), fe = /* @__PURE__ */ l({
129
+ name: "MuteNotification",
130
+ __name: "mute-notification",
131
+ setup(e) {
132
+ return (e, t) => (x(), i("svg", {
133
+ xmlns: "http://www.w3.org/2000/svg",
134
+ viewBox: "0 0 1024 1024"
135
+ }, [a("path", {
136
+ fill: "currentColor",
137
+ d: "m241.216 832 63.616-64H768V448c0-42.368-10.24-82.304-28.48-117.504l46.912-47.232C815.36 331.392 832 387.84 832 448v320h96a32 32 0 1 1 0 64zm-90.24 0H96a32 32 0 1 1 0-64h96V448a320.13 320.13 0 0 1 256-313.6V128a64 64 0 1 1 128 0v6.4a319.55 319.55 0 0 1 171.648 97.088l-45.184 45.44A256 256 0 0 0 256 448v278.336L151.04 832zM448 896h128a64 64 0 0 1-128 0"
138
+ }), a("path", {
139
+ fill: "currentColor",
140
+ d: "M150.72 859.072a32 32 0 0 1-45.44-45.056l704-708.544a32 32 0 0 1 45.44 45.056z"
141
+ })]));
142
+ }
143
+ }), pe = /* @__PURE__ */ l({
144
+ name: "Mute",
145
+ __name: "mute",
146
+ setup(e) {
147
+ return (e, t) => (x(), i("svg", {
148
+ xmlns: "http://www.w3.org/2000/svg",
149
+ viewBox: "0 0 1024 1024"
150
+ }, [a("path", {
151
+ fill: "currentColor",
152
+ d: "m412.16 592.128-45.44 45.44A191.23 191.23 0 0 1 320 512V256a192 192 0 1 1 384 0v44.352l-64 64V256a128 128 0 1 0-256 0v256c0 30.336 10.56 58.24 28.16 80.128m51.968 38.592A128 128 0 0 0 640 512v-57.152l64-64V512a192 192 0 0 1-287.68 166.528zM314.88 779.968l46.144-46.08A223 223 0 0 0 480 768h64a224 224 0 0 0 224-224v-32a32 32 0 1 1 64 0v32a288 288 0 0 1-288 288v64h64a32 32 0 1 1 0 64H416a32 32 0 1 1 0-64h64v-64c-61.44 0-118.4-19.2-165.12-52.032M266.752 737.6A286.98 286.98 0 0 1 192 544v-32a32 32 0 0 1 64 0v32c0 56.832 21.184 108.8 56.064 148.288z"
153
+ }), a("path", {
154
+ fill: "currentColor",
155
+ d: "M150.72 859.072a32 32 0 0 1-45.44-45.056l704-708.544a32 32 0 0 1 45.44 45.056z"
156
+ })]));
157
+ }
158
+ }), me = /* @__PURE__ */ l({
159
+ name: "Refresh",
160
+ __name: "refresh",
161
+ setup(e) {
162
+ return (e, t) => (x(), i("svg", {
163
+ xmlns: "http://www.w3.org/2000/svg",
164
+ viewBox: "0 0 1024 1024"
165
+ }, [a("path", {
166
+ fill: "currentColor",
167
+ d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
168
+ })]));
169
+ }
170
+ }), he = /* @__PURE__ */ l({
171
+ name: "Search",
172
+ __name: "search",
173
+ setup(e) {
174
+ return (e, t) => (x(), i("svg", {
175
+ xmlns: "http://www.w3.org/2000/svg",
176
+ viewBox: "0 0 1024 1024"
177
+ }, [a("path", {
178
+ fill: "currentColor",
179
+ d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"
180
+ })]));
181
+ }
182
+ }), ge = /* @__PURE__ */ l({
183
+ name: "VideoCamera",
184
+ __name: "video-camera",
185
+ setup(e) {
186
+ return (e, t) => (x(), i("svg", {
187
+ xmlns: "http://www.w3.org/2000/svg",
188
+ viewBox: "0 0 1024 1024"
189
+ }, [a("path", {
190
+ fill: "currentColor",
191
+ d: "M704 768V256H128v512zm64-416 192-96v512l-192-96v128a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zm0 71.552v176.896l128 64V359.552zM192 320h192v64H192z"
192
+ })]));
193
+ }
194
+ }), _e = /* @__PURE__ */ l({
195
+ name: "VideoPause",
196
+ __name: "video-pause",
197
+ setup(e) {
198
+ return (e, t) => (x(), i("svg", {
199
+ xmlns: "http://www.w3.org/2000/svg",
200
+ viewBox: "0 0 1024 1024"
201
+ }, [a("path", {
202
+ fill: "currentColor",
203
+ d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m-96-544q32 0 32 32v256q0 32-32 32t-32-32V384q0-32 32-32m192 0q32 0 32 32v256q0 32-32 32t-32-32V384q0-32 32-32"
204
+ })]));
205
+ }
206
+ }), ve = /* @__PURE__ */ l({
207
+ name: "VideoPlay",
208
+ __name: "video-play",
209
+ setup(e) {
210
+ return (e, t) => (x(), i("svg", {
211
+ xmlns: "http://www.w3.org/2000/svg",
212
+ viewBox: "0 0 1024 1024"
213
+ }, [a("path", {
214
+ fill: "currentColor",
215
+ d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m-48-247.616L668.608 512 464 375.616zm10.624-342.656 249.472 166.336a48 48 0 0 1 0 79.872L474.624 718.272A48 48 0 0 1 400 678.336V345.6a48 48 0 0 1 74.624-39.936z"
216
+ })]));
217
+ }
218
+ }), ye = /* @__PURE__ */ l({
219
+ name: "Warning",
220
+ __name: "warning",
221
+ setup(e) {
222
+ return (e, t) => (x(), i("svg", {
223
+ xmlns: "http://www.w3.org/2000/svg",
224
+ viewBox: "0 0 1024 1024"
225
+ }, [a("path", {
226
+ fill: "currentColor",
227
+ d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"
228
+ })]));
229
+ }
46
230
  });
47
231
  //#endregion
48
232
  //#region src/composables/useFullscreen.ts
49
- function B(e, n) {
233
+ function be(e, n) {
50
234
  let r = t(() => e.fullscreen ?? !1);
51
235
  function i() {
52
236
  n("update:fullscreen", !r.value);
@@ -58,11 +242,11 @@ function B(e, n) {
58
242
  }
59
243
  //#endregion
60
244
  //#region src/components/dialog/src/useResizable.ts
61
- function V(e, t, n) {
245
+ function xe(e, t, n) {
62
246
  return Math.min(Math.max(e, t), n);
63
247
  }
64
- function ee(e, t) {
65
- let n = v(!1), r = v({}), i = () => {};
248
+ function J(e, t) {
249
+ let n = S(!1), r = S({}), i = () => {};
66
250
  function a() {
67
251
  i(), i = () => {};
68
252
  }
@@ -73,7 +257,7 @@ function ee(e, t) {
73
257
  o.preventDefault(), a();
74
258
  let c = s.getBoundingClientRect(), l = e.minWidth ?? 400, u = e.minHeight ?? 240, d = Math.max(l, window.innerWidth - c.left - 32), f = Math.max(u, window.innerHeight - c.top - 32), p = o.clientX, m = o.clientY;
75
259
  function h(e) {
76
- let i = Math.round(V(c.width + e.clientX - p, l, d)), a = Math.round(V(c.height + e.clientY - m, u, f));
260
+ let i = Math.round(xe(c.width + e.clientX - p, l, d)), a = Math.round(xe(c.height + e.clientY - m, u, f));
77
261
  n.value = !0, r.value = {
78
262
  height: `${a}px`,
79
263
  width: `${i}px`
@@ -89,7 +273,7 @@ function ee(e, t) {
89
273
  window.removeEventListener("pointermove", h), window.removeEventListener("pointerup", g);
90
274
  };
91
275
  }
92
- return g(a), {
276
+ return v(a), {
93
277
  isResized: n,
94
278
  resizeStyle: r,
95
279
  startResize: o
@@ -97,7 +281,7 @@ function ee(e, t) {
97
281
  }
98
282
  //#endregion
99
283
  //#region src/components/dialog/src/index.vue?vue&type=script&setup=true&lang.ts
100
- var te = { class: "ctc-dialog__header-content" }, ne = { class: "ctc-dialog__title" }, re = { class: "ctc-dialog__header-actions" }, ie = ["aria-label", "title"], ae = { class: "ctc-dialog__content" }, H = /* @__PURE__ */ c({
284
+ var Se = { class: "ctc-dialog__header-content" }, Ce = { class: "ctc-dialog__title" }, we = { class: "ctc-dialog__header-actions" }, Te = ["aria-label", "title"], Ee = { class: "ctc-dialog__content" }, De = /* @__PURE__ */ l({
101
285
  name: "CtcDialog",
102
286
  inheritAttrs: !1,
103
287
  __name: "index",
@@ -187,12 +371,12 @@ var te = { class: "ctc-dialog__header-content" }, ne = { class: "ctc-dialog__tit
187
371
  "close",
188
372
  "closed"
189
373
  ],
190
- setup(e, { emit: c }) {
191
- let l = e, u = c, d = C(), p = w(), m = I(), { isFullscreen: h, toggleFullscreen: g } = B(l, u), { isResized: v, resizeStyle: y, startResize: T } = ee(l, u), D = t(() => h.value ? {} : y.value), k = t(() => v.value && !h.value), j = t(() => l.closeOnClickModal ?? m.dialog?.closeOnClickModal ?? !1);
192
- function M(e) {
374
+ setup(e, { emit: s }) {
375
+ let l = e, u = s, d = O(), f = k(), m = U(), { isFullscreen: h, toggleFullscreen: g } = be(l, u), { isResized: _, resizeStyle: v, startResize: y } = J(l, u), b = t(() => h.value ? {} : v.value), S = t(() => _.value && !h.value), C = t(() => l.closeOnClickModal ?? m.dialog?.closeOnClickModal ?? !1);
376
+ function T(e) {
193
377
  u("update:modelValue", e);
194
378
  }
195
- function N() {
379
+ function A() {
196
380
  if (l.beforeClose) {
197
381
  l.beforeClose((e) => {
198
382
  e || u("update:modelValue", !1);
@@ -201,22 +385,22 @@ var te = { class: "ctc-dialog__header-content" }, ne = { class: "ctc-dialog__tit
201
385
  }
202
386
  u("update:modelValue", !1);
203
387
  }
204
- return (t, c) => (_(), n(S(O), f(S(d), {
388
+ return (t, s) => (x(), n(D(I), p(D(d), {
205
389
  class: ["ctc-dialog", {
206
390
  "ctc-dialog--content-fill": e.contentFill,
207
391
  "ctc-dialog--resizable": e.resizable,
208
- "ctc-dialog--resized": k.value
392
+ "ctc-dialog--resized": S.value
209
393
  }],
210
- style: D.value,
394
+ style: b.value,
211
395
  "model-value": e.modelValue,
212
- fullscreen: S(h),
396
+ fullscreen: D(h),
213
397
  title: e.title,
214
398
  width: e.width,
215
399
  "align-center": e.alignCenter,
216
400
  "append-to": e.appendTo,
217
401
  "before-close": e.beforeClose,
218
402
  "close-delay": e.closeDelay,
219
- "close-on-click-modal": j.value,
403
+ "close-on-click-modal": C.value,
220
404
  "close-on-press-escape": e.closeOnPressEscape,
221
405
  "destroy-on-close": e.destroyOnClose,
222
406
  draggable: e.draggable,
@@ -232,46 +416,46 @@ var te = { class: "ctc-dialog__header-content" }, ne = { class: "ctc-dialog__tit
232
416
  "header-class": "ctc-dialog__header",
233
417
  "body-class": "ctc-dialog__body",
234
418
  "footer-class": "ctc-dialog__footer",
235
- "onUpdate:modelValue": M,
236
- onOpen: c[2] ||= (e) => u("open"),
237
- onOpened: c[3] ||= (e) => u("opened"),
238
- onClose: c[4] ||= (e) => u("close"),
239
- onClosed: c[5] ||= (e) => u("closed")
419
+ "onUpdate:modelValue": T,
420
+ onOpen: s[2] ||= (e) => u("open"),
421
+ onOpened: s[3] ||= (e) => u("opened"),
422
+ onClose: s[4] ||= (e) => u("close"),
423
+ onClosed: s[5] ||= (e) => u("closed")
240
424
  }), o({
241
- header: E(() => [a("div", te, [b(t.$slots, "header", {}, () => [a("span", ne, x(e.title), 1)])]), a("div", re, [e.showFullscreen ? (_(), i("button", {
425
+ header: N(() => [a("div", Se, [w(t.$slots, "header", {}, () => [a("span", Ce, E(e.title), 1)])]), a("div", we, [e.showFullscreen ? (x(), i("button", {
242
426
  key: 0,
243
427
  class: "ctc-dialog__fullscreen-toggle",
244
428
  type: "button",
245
- "aria-label": S(h) ? "退出全屏" : "全屏显示",
246
- title: S(h) ? "退出全屏" : "全屏显示",
429
+ "aria-label": D(h) ? "退出全屏" : "全屏显示",
430
+ title: D(h) ? "退出全屏" : "全屏显示",
247
431
  "data-ctc-fullscreen-toggle": "",
248
- onClick: c[0] ||= (...e) => S(g) && S(g)(...e)
249
- }, [s(S(A), { "aria-hidden": "true" }, {
250
- default: E(() => [S(h) ? (_(), n(S(z), { key: 0 })) : (_(), n(S(R), { key: 1 }))]),
432
+ onClick: s[0] ||= (...e) => D(g) && D(g)(...e)
433
+ }, [c(D(R), { "aria-hidden": "true" }, {
434
+ default: N(() => [D(h) ? (x(), n(D(de), { key: 0 })) : (x(), n(D(q), { key: 1 }))]),
251
435
  _: 1
252
- })], 8, ie)) : r("", !0), e.showClose ? (_(), i("button", {
436
+ })], 8, Te)) : r("", !0), e.showClose ? (x(), i("button", {
253
437
  key: 1,
254
438
  class: "ctc-dialog__close",
255
439
  type: "button",
256
440
  "aria-label": "关闭弹窗",
257
441
  title: "关闭",
258
442
  "data-ctc-close": "",
259
- onClick: N
260
- }, [s(S(A), { "aria-hidden": "true" }, {
261
- default: E(() => [s(S(L))]),
443
+ onClick: A
444
+ }, [c(D(R), { "aria-hidden": "true" }, {
445
+ default: N(() => [c(D(G))]),
262
446
  _: 1
263
447
  })])) : r("", !0)])]),
264
- default: E(() => [a("div", ae, [b(t.$slots, "default")]), e.resizable && !S(h) ? (_(), i("div", {
448
+ default: N(() => [a("div", Ee, [w(t.$slots, "default")]), e.resizable && !D(h) ? (x(), i("div", {
265
449
  key: 0,
266
450
  class: "ctc-dialog__resize-handle",
267
451
  "aria-hidden": "true",
268
452
  "data-ctc-resize-handle": "",
269
- onPointerdown: c[1] ||= (...e) => S(T) && S(T)(...e)
453
+ onPointerdown: s[1] ||= (...e) => D(y) && D(y)(...e)
270
454
  }, null, 32)) : r("", !0)]),
271
455
  _: 2
272
- }, [S(p).footer ? {
456
+ }, [D(f).footer ? {
273
457
  name: "footer",
274
- fn: E(() => [b(t.$slots, "footer")]),
458
+ fn: N(() => [w(t.$slots, "footer")]),
275
459
  key: "0"
276
460
  } : void 0]), 1040, [
277
461
  "class",
@@ -298,10 +482,10 @@ var te = { class: "ctc-dialog__header-content" }, ne = { class: "ctc-dialog__tit
298
482
  "z-index"
299
483
  ]));
300
484
  }
301
- }), oe = { class: "ctc-drawer__header-content" }, se = { class: "ctc-drawer__title" }, ce = { class: "ctc-drawer__header-actions" }, le = ["aria-label", "title"], U = { class: "ctc-drawer__content" }, ue = {
485
+ }), Oe = { class: "ctc-drawer__header-content" }, ke = { class: "ctc-drawer__title" }, Ae = { class: "ctc-drawer__header-actions" }, je = ["aria-label", "title"], Me = { class: "ctc-drawer__content" }, Ne = {
302
486
  key: 0,
303
487
  class: "ctc-drawer__footer"
304
- }, W = /* @__PURE__ */ c({
488
+ }, Pe = /* @__PURE__ */ l({
305
489
  name: "CtcDrawer",
306
490
  inheritAttrs: !1,
307
491
  __name: "index",
@@ -369,21 +553,21 @@ var te = { class: "ctc-dialog__header-content" }, ne = { class: "ctc-dialog__tit
369
553
  "closed"
370
554
  ],
371
555
  setup(e, { emit: o }) {
372
- let c = e, l = o, u = C(), d = w(), { isFullscreen: m, toggleFullscreen: h } = B(c, l), g = t(() => m.value ? "100%" : c.size);
373
- function v(e) {
556
+ let s = e, l = o, u = O(), d = k(), { isFullscreen: f, toggleFullscreen: m } = be(s, l), g = t(() => f.value ? "100%" : s.size);
557
+ function _(e) {
374
558
  l("update:modelValue", e);
375
559
  }
376
- function y() {
377
- if (c.beforeClose) {
378
- c.beforeClose((e) => {
560
+ function v() {
561
+ if (s.beforeClose) {
562
+ s.beforeClose((e) => {
379
563
  e || l("update:modelValue", !1);
380
564
  });
381
565
  return;
382
566
  }
383
567
  l("update:modelValue", !1);
384
568
  }
385
- return (t, o) => (_(), n(S(k), f(S(u), {
386
- class: ["ctc-drawer", { "is-fullscreen": S(m) }],
569
+ return (t, o) => (x(), n(D(L), p(D(u), {
570
+ class: ["ctc-drawer", { "is-fullscreen": D(f) }],
387
571
  "model-value": e.modelValue,
388
572
  "append-to": e.appendTo,
389
573
  "before-close": e.beforeClose,
@@ -399,36 +583,36 @@ var te = { class: "ctc-dialog__header-content" }, ne = { class: "ctc-dialog__tit
399
583
  "z-index": e.zIndex,
400
584
  "header-class": "ctc-drawer__header",
401
585
  "body-class": "ctc-drawer__body",
402
- "onUpdate:modelValue": v,
586
+ "onUpdate:modelValue": _,
403
587
  onOpen: o[1] ||= (e) => l("open"),
404
588
  onOpened: o[2] ||= (e) => l("opened"),
405
589
  onClose: o[3] ||= (e) => l("close"),
406
590
  onClosed: o[4] ||= (e) => l("closed")
407
591
  }), {
408
- header: E(() => [a("div", oe, [b(t.$slots, "header", {}, () => [a("span", se, x(e.title), 1)])]), a("div", ce, [e.showFullscreen ? (_(), i("button", {
592
+ header: N(() => [a("div", Oe, [w(t.$slots, "header", {}, () => [a("span", ke, E(e.title), 1)])]), a("div", Ae, [e.showFullscreen ? (x(), i("button", {
409
593
  key: 0,
410
594
  class: "ctc-drawer__fullscreen-toggle",
411
595
  type: "button",
412
- "aria-label": S(m) ? "退出全屏" : "全屏显示",
413
- title: S(m) ? "退出全屏" : "全屏显示",
596
+ "aria-label": D(f) ? "退出全屏" : "全屏显示",
597
+ title: D(f) ? "退出全屏" : "全屏显示",
414
598
  "data-ctc-fullscreen-toggle": "",
415
- onClick: o[0] ||= (...e) => S(h) && S(h)(...e)
416
- }, [s(S(A), { "aria-hidden": "true" }, {
417
- default: E(() => [S(m) ? (_(), n(S(z), { key: 0 })) : (_(), n(S(R), { key: 1 }))]),
599
+ onClick: o[0] ||= (...e) => D(m) && D(m)(...e)
600
+ }, [c(D(R), { "aria-hidden": "true" }, {
601
+ default: N(() => [D(f) ? (x(), n(D(de), { key: 0 })) : (x(), n(D(q), { key: 1 }))]),
418
602
  _: 1
419
- })], 8, le)) : r("", !0), e.showClose ? (_(), i("button", {
603
+ })], 8, je)) : r("", !0), e.showClose ? (x(), i("button", {
420
604
  key: 1,
421
605
  class: "ctc-drawer__close",
422
606
  type: "button",
423
607
  "aria-label": "关闭抽屉",
424
608
  title: "关闭",
425
609
  "data-ctc-close": "",
426
- onClick: y
427
- }, [s(S(A), { "aria-hidden": "true" }, {
428
- default: E(() => [s(S(L))]),
610
+ onClick: v
611
+ }, [c(D(R), { "aria-hidden": "true" }, {
612
+ default: N(() => [c(D(G))]),
429
613
  _: 1
430
614
  })])) : r("", !0)])]),
431
- default: E(() => [a("div", { class: p(["ctc-drawer__layout", { "has-footer": S(d).footer }]) }, [a("div", U, [b(t.$slots, "default")]), S(d).footer ? (_(), i("div", ue, [b(t.$slots, "footer")])) : r("", !0)], 2)]),
615
+ default: N(() => [a("div", { class: h(["ctc-drawer__layout", { "has-footer": D(d).footer }]) }, [a("div", Me, [w(t.$slots, "default")]), D(d).footer ? (x(), i("div", Ne, [w(t.$slots, "footer")])) : r("", !0)], 2)]),
432
616
  _: 3
433
617
  }, 16, [
434
618
  "class",
@@ -446,7 +630,7 @@ var te = { class: "ctc-dialog__header-content" }, ne = { class: "ctc-dialog__tit
446
630
  "z-index"
447
631
  ]));
448
632
  }
449
- }), G = /* @__PURE__ */ c({
633
+ }), Y = /* @__PURE__ */ l({
450
634
  name: "CtcFlex",
451
635
  __name: "index",
452
636
  props: {
@@ -473,16 +657,16 @@ var te = { class: "ctc-dialog__header-content" }, ne = { class: "ctc-dialog__tit
473
657
  };
474
658
  return n.gap !== 0 && n.gap !== "" && (e.gap = typeof n.gap == "number" ? `${n.gap}px` : n.gap), n.fill && (e.flex = n.grow), n.direction === "column" ? e.minHeight = "0" : e.minWidth = "0", n.scroll === "x" ? (e.overflowX = "auto", e.overflowY = "hidden") : n.scroll === "y" ? (e.overflowX = "hidden", e.overflowY = "auto") : n.scroll && (e.overflow = "auto"), e;
475
659
  });
476
- return (e, t) => (_(), i("div", {
660
+ return (e, t) => (x(), i("div", {
477
661
  class: "ctc-flex",
478
- style: h(r.value)
479
- }, [b(e.$slots, "default")], 4));
662
+ style: _(r.value)
663
+ }, [w(e.$slots, "default")], 4));
480
664
  }
481
- }), de = /* @__PURE__ */ new Set([
665
+ }), Fe = /* @__PURE__ */ new Set([
482
666
  "selection",
483
667
  "index",
484
668
  "expand"
485
- ]), K = /* @__PURE__ */ new Map(), fe = c({
669
+ ]), Ie = /* @__PURE__ */ new Map(), Le = l({
486
670
  name: "CtcTableColumn",
487
671
  props: {
488
672
  column: {
@@ -497,8 +681,8 @@ var te = { class: "ctc-dialog__header-content" }, ne = { class: "ctc-dialog__tit
497
681
  setup(e) {
498
682
  let t = (e) => e.slot ?? e.prop, n = (e, t) => {
499
683
  if (!t) return;
500
- let n = K.get(t);
501
- return n || (n = t.replace(/\[(?:'([^']*)'|"([^"]*)"|([^\]]+))\]/g, ".$1$2$3").split(".").filter(Boolean), K.set(t, n)), n.reduce((e, t) => {
684
+ let n = Ie.get(t);
685
+ return n || (n = t.replace(/\[(?:'([^']*)'|"([^"]*)"|([^\]]+))\]/g, ".$1$2$3").split(".").filter(Boolean), Ie.set(t, n)), n.reduce((e, t) => {
502
686
  if (!(typeof e != "object" || !e)) return e[t];
503
687
  }, e);
504
688
  }, r = (r, i) => {
@@ -519,8 +703,8 @@ var te = { class: "ctc-dialog__header-content" }, ne = { class: "ctc-dialog__tit
519
703
  config: t
520
704
  }) : t.renderHeader?.(n);
521
705
  }, a = (t) => {
522
- let { children: n, slot: o, headerSlot: s, renderCell: c, renderHeader: l, formatter: d, ...f } = t, p = !!n?.length, m = o ?? t.prop, h = !!(m && e.slots[m] || c || d), g = !!(s && e.slots[s] || l), _ = t.type ? de.has(t.type) : !1;
523
- return u(N, f, {
706
+ let { children: n, slot: o, headerSlot: s, renderCell: c, renderHeader: l, formatter: u, ...f } = t, p = !!n?.length, m = o ?? t.prop, h = !!(m && e.slots[m] || c || u), g = !!(s && e.slots[s] || l), _ = t.type ? Fe.has(t.type) : !1;
707
+ return d(re, f, {
524
708
  default: p ? () => n?.map(a) : h && !_ ? (e) => r(t, e) : void 0,
525
709
  header: g ? (e) => i(t, e) : void 0
526
710
  });
@@ -530,15 +714,15 @@ var te = { class: "ctc-dialog__header-content" }, ne = { class: "ctc-dialog__tit
530
714
  });
531
715
  //#endregion
532
716
  //#region src/components/table/src/merge.ts
533
- function q(e, t) {
717
+ function Re(e, t) {
534
718
  return t.replace(/\[(?:'([^']*)'|"([^"]*)"|([^\]]+))\]/g, ".$1$2$3").split(".").filter(Boolean).reduce((e, t) => {
535
719
  if (!(typeof e != "object" || !e)) return e[t];
536
720
  }, e);
537
721
  }
538
- function J(e, t, n) {
539
- return n.every((n) => Object.is(q(e, n), q(t, n)));
722
+ function ze(e, t, n) {
723
+ return n.every((n) => Object.is(Re(e, n), Re(t, n)));
540
724
  }
541
- function pe(e, t) {
725
+ function Be(e, t) {
542
726
  let n = new Map(t.filter((e) => e.prop && e.by.length > 0).map((e) => [e.prop, e]));
543
727
  return ({ column: t, rowIndex: r }) => {
544
728
  if (t.type === "selection" || t.type === "index" || t.type === "expand") return;
@@ -546,12 +730,12 @@ function pe(e, t) {
546
730
  if (!a) return;
547
731
  let o = e[r];
548
732
  if (!o) return;
549
- if (r > 0 && J(e[r - 1], o, a.by)) return {
733
+ if (r > 0 && ze(e[r - 1], o, a.by)) return {
550
734
  rowspan: 0,
551
735
  colspan: 0
552
736
  };
553
737
  let s = 1;
554
- for (; r + s < e.length && J(o, e[r + s], a.by);) s += 1;
738
+ for (; r + s < e.length && ze(o, e[r + s], a.by);) s += 1;
555
739
  return {
556
740
  rowspan: s,
557
741
  colspan: 1
@@ -560,10 +744,10 @@ function pe(e, t) {
560
744
  }
561
745
  //#endregion
562
746
  //#region src/components/table/src/index.vue?vue&type=script&setup=true&lang.ts
563
- var me = {
747
+ var Ve = {
564
748
  key: 0,
565
749
  class: "ctc-table__pagination"
566
- }, Y = /* @__PURE__ */ c({
750
+ }, He = /* @__PURE__ */ l({
567
751
  name: "CtcTable",
568
752
  inheritAttrs: !1,
569
753
  __name: "index",
@@ -598,118 +782,118 @@ var me = {
598
782
  "prev-click",
599
783
  "next-click"
600
784
  ],
601
- setup(a, { expose: c, emit: l }) {
602
- let u = M, d = a, m = l, h = C(), g = w(), v = I(), x = T("tableRef"), O = /* @__PURE__ */ new Set(/* @__PURE__ */ "currentPage.pageSize.total.layout.pageSizes.pagerCount.background.disabled.hideOnSinglePage.small.prevText.nextText.prevIcon.nextIcon.popperClass.popperStyle.teleported.appendSizeTo.pageCount.defaultCurrentPage.defaultPageSize.onUpdate:currentPage.onUpdate:pageSize.onCurrentChange.onSizeChange.onPrevClick.onNextClick".split(".")), k = t(() => {
603
- let e = Object.fromEntries(Object.entries(h).filter(([e]) => !O.has(e) && e !== "height" && e !== "spanMethod" && e !== "span-method")), t = {};
604
- return !("border" in h) && v.table?.border !== void 0 && (t.border = v.table.border), !("stripe" in h) && v.table?.stripe !== void 0 && (t.stripe = v.table.stripe), {
785
+ setup(a, { expose: s, emit: l }) {
786
+ let u = V, d = a, f = l, m = O(), g = k(), _ = U(), v = A("tableRef"), y = /* @__PURE__ */ new Set(/* @__PURE__ */ "currentPage.pageSize.total.layout.pageSizes.pagerCount.background.disabled.hideOnSinglePage.small.prevText.nextText.prevIcon.nextIcon.popperClass.popperStyle.teleported.appendSizeTo.pageCount.defaultCurrentPage.defaultPageSize.onUpdate:currentPage.onUpdate:pageSize.onCurrentChange.onSizeChange.onPrevClick.onNextClick".split(".")), b = t(() => {
787
+ let e = Object.fromEntries(Object.entries(m).filter(([e]) => !y.has(e) && e !== "height" && e !== "spanMethod" && e !== "span-method")), t = {};
788
+ return !("border" in m) && _.table?.border !== void 0 && (t.border = _.table.border), !("stripe" in m) && _.table?.stripe !== void 0 && (t.stripe = _.table.stripe), {
605
789
  ...t,
606
790
  ...e
607
791
  };
608
- }), A = t(() => d.pageSize ?? v.table?.pageSize ?? 10), N = t(() => ({
609
- ...v.table?.paginationProps,
792
+ }), S = t(() => d.pageSize ?? _.table?.pageSize ?? 10), T = t(() => ({
793
+ ..._.table?.paginationProps,
610
794
  ...d.paginationProps
611
- })), F = t(() => {
795
+ })), E = t(() => {
612
796
  if (typeof d.height == "string" || typeof d.height == "number") return d.height;
613
- }), L = t(() => d.autoHeight && F.value === void 0), R = t(() => F.value ?? (L.value ? "100%" : void 0)), z = t(() => {
614
- let e = h.spanMethod ?? h["span-method"];
797
+ }), j = t(() => d.autoHeight && E.value === void 0), M = t(() => E.value ?? (j.value ? "100%" : void 0)), F = t(() => {
798
+ let e = m.spanMethod ?? m["span-method"];
615
799
  if (typeof e == "function") return e;
616
- if (d.merge.length !== 0) return pe(d.data, d.merge);
800
+ if (d.merge.length !== 0) return Be(d.data, d.merge);
617
801
  });
618
- function B(e, t) {
619
- m("current-change", e, t);
802
+ function I(e, t) {
803
+ f("current-change", e, t);
620
804
  }
621
- return c({
622
- elTableRef: x,
623
- clearSelection: () => x.value?.clearSelection(),
624
- toggleRowSelection: (e, t) => x.value?.toggleRowSelection(e, t),
625
- toggleAllSelection: () => x.value?.toggleAllSelection(),
626
- toggleRowExpansion: (e, t) => x.value?.toggleRowExpansion(e, t),
627
- setCurrentRow: (e) => x.value?.setCurrentRow(e),
628
- clearSort: () => x.value?.clearSort(),
629
- clearFilter: (e) => x.value?.clearFilter(e),
630
- doLayout: () => x.value?.doLayout(),
631
- sort: (e, t) => x.value?.sort(e, t),
632
- scrollTo: (e, t) => x.value?.scrollTo(e, t),
633
- setScrollTop: (e) => x.value?.setScrollTop(e),
634
- setScrollLeft: (e) => x.value?.setScrollLeft(e)
635
- }), (t, a) => (_(), i("div", { class: p(["ctc-table", { "ctc-table--auto-height": L.value }]) }, [D((_(), n(S(u), f({
805
+ return s({
806
+ elTableRef: v,
807
+ clearSelection: () => v.value?.clearSelection(),
808
+ toggleRowSelection: (e, t) => v.value?.toggleRowSelection(e, t),
809
+ toggleAllSelection: () => v.value?.toggleAllSelection(),
810
+ toggleRowExpansion: (e, t) => v.value?.toggleRowExpansion(e, t),
811
+ setCurrentRow: (e) => v.value?.setCurrentRow(e),
812
+ clearSort: () => v.value?.clearSort(),
813
+ clearFilter: (e) => v.value?.clearFilter(e),
814
+ doLayout: () => v.value?.doLayout(),
815
+ sort: (e, t) => v.value?.sort(e, t),
816
+ scrollTo: (e, t) => v.value?.scrollTo(e, t),
817
+ setScrollTop: (e) => v.value?.setScrollTop(e),
818
+ setScrollLeft: (e) => v.value?.setScrollLeft(e)
819
+ }), (t, a) => (x(), i("div", { class: h(["ctc-table", { "ctc-table--auto-height": j.value }]) }, [P((x(), n(D(u), p({
636
820
  ref_key: "tableRef",
637
- ref: x
638
- }, k.value, {
821
+ ref: v
822
+ }, b.value, {
639
823
  data: d.data,
640
- height: R.value,
641
- "span-method": z.value,
642
- onCurrentChange: B
824
+ height: M.value,
825
+ "span-method": F.value,
826
+ onCurrentChange: I
643
827
  }), o({
644
- default: E(() => [(_(!0), i(e, null, y(d.columns, (e, t) => (_(), n(fe, {
828
+ default: N(() => [(x(!0), i(e, null, C(d.columns, (e, t) => (x(), n(Le, {
645
829
  key: e.prop ?? e.property ?? e.label ?? t,
646
830
  column: e,
647
- slots: S(g)
831
+ slots: D(g)
648
832
  }, null, 8, ["column", "slots"]))), 128))]),
649
833
  _: 2
650
- }, [S(g).empty ? {
834
+ }, [D(g).empty ? {
651
835
  name: "empty",
652
- fn: E(() => [b(t.$slots, "empty")]),
836
+ fn: N(() => [w(t.$slots, "empty")]),
653
837
  key: "0"
654
- } : void 0, S(g).append ? {
838
+ } : void 0, D(g).append ? {
655
839
  name: "append",
656
- fn: E(() => [b(t.$slots, "append")]),
840
+ fn: N(() => [w(t.$slots, "append")]),
657
841
  key: "1"
658
842
  } : void 0]), 1040, [
659
843
  "data",
660
844
  "height",
661
845
  "span-method"
662
- ])), [[S(P), d.loading]]), d.pagination ? (_(), i("div", me, [s(S(j), f(N.value, {
846
+ ])), [[D(ae), d.loading]]), d.pagination ? (x(), i("div", Ve, [c(D(B), p(T.value, {
663
847
  "current-page": d.currentPage,
664
- "page-size": A.value,
848
+ "page-size": S.value,
665
849
  total: d.total,
666
- "onUpdate:currentPage": a[0] ||= (e) => m("update:currentPage", e),
667
- "onUpdate:pageSize": a[1] ||= (e) => m("update:pageSize", e),
668
- onCurrentChange: a[2] ||= (e) => m("page-change", e),
669
- onSizeChange: a[3] ||= (e) => m("page-size-change", e),
670
- onPrevClick: a[4] ||= (e) => m("prev-click", e),
671
- onNextClick: a[5] ||= (e) => m("next-click", e)
850
+ "onUpdate:currentPage": a[0] ||= (e) => f("update:currentPage", e),
851
+ "onUpdate:pageSize": a[1] ||= (e) => f("update:pageSize", e),
852
+ onCurrentChange: a[2] ||= (e) => f("page-change", e),
853
+ onSizeChange: a[3] ||= (e) => f("page-size-change", e),
854
+ onPrevClick: a[4] ||= (e) => f("prev-click", e),
855
+ onNextClick: a[5] ||= (e) => f("next-click", e)
672
856
  }), null, 16, [
673
857
  "current-page",
674
858
  "page-size",
675
859
  "total"
676
- ]), b(t.$slots, "pagination")])) : r("", !0)], 2));
860
+ ]), w(t.$slots, "pagination")])) : r("", !0)], 2));
677
861
  }
678
- }), X = {
862
+ }), Ue = {
679
863
  key: 0,
680
864
  class: "ctc-report__bar-left"
681
- }, he = {
865
+ }, We = {
682
866
  key: 1,
683
867
  class: "ctc-report__bar-right"
684
- }, Z = /* @__PURE__ */ c({
868
+ }, X = /* @__PURE__ */ l({
685
869
  __name: "ReportBar",
686
870
  setup(e) {
687
- return (e, t) => (_(), n(S(G), {
871
+ return (e, t) => (x(), n(D(Y), {
688
872
  class: "ctc-report__bar",
689
873
  direction: "row",
690
874
  align: "center",
691
875
  justify: "space-between"
692
876
  }, {
693
- default: E(() => [b(e.$slots, "default", {}, () => [e.$slots.left ? (_(), i("div", X, [b(e.$slots, "left")])) : r("", !0), e.$slots.right ? (_(), i("div", he, [b(e.$slots, "right")])) : r("", !0)])]),
877
+ default: N(() => [w(e.$slots, "default", {}, () => [e.$slots.left ? (x(), i("div", Ue, [w(e.$slots, "left")])) : r("", !0), e.$slots.right ? (x(), i("div", We, [w(e.$slots, "right")])) : r("", !0)])]),
694
878
  _: 3
695
879
  }));
696
880
  }
697
- }), ge = {
881
+ }), Ge = {
698
882
  key: 0,
699
883
  class: "ctc-report__container-top"
700
- }, _e = {
884
+ }, Ke = {
701
885
  key: 0,
702
886
  class: "ctc-report__table-bar"
703
- }, ve = {
887
+ }, qe = {
704
888
  key: 0,
705
889
  class: "ctc-report__title"
706
- }, ye = {
890
+ }, Je = {
707
891
  key: 1,
708
892
  class: "ctc-report__before"
709
- }, be = {
893
+ }, Ye = {
710
894
  key: 2,
711
895
  class: "ctc-report__after"
712
- }, Q = /* @__PURE__ */ c({
896
+ }, Xe = /* @__PURE__ */ l({
713
897
  name: "CtcReport",
714
898
  inheritAttrs: !1,
715
899
  __name: "index",
@@ -734,8 +918,8 @@ var me = {
734
918
  "prev-click",
735
919
  "next-click"
736
920
  ],
737
- setup(c, { expose: u, emit: d }) {
738
- let g = c, v = d, D = w(), O = C(), k = T("tableRef"), A = /* @__PURE__ */ new Set([
921
+ setup(s, { expose: l, emit: d }) {
922
+ let f = s, m = d, v = k(), y = O(), b = A("tableRef"), S = /* @__PURE__ */ new Set([
739
923
  "custom-tool-bar",
740
924
  "tool-bar",
741
925
  "tool-bar-left",
@@ -752,130 +936,130 @@ var me = {
752
936
  "table-empty",
753
937
  "append-table"
754
938
  ]);
755
- function j(e) {
939
+ function T(e) {
756
940
  return typeof e == "number" ? `${e}px` : typeof e == "string" ? e : e.map((e) => `${e}px`).join(" ");
757
941
  }
758
- let M = t(() => ({
759
- margin: j(g.margin),
760
- padding: j(g.padding)
761
- })), N = t(() => ({
762
- margin: j(g.containerMargin),
763
- padding: j(g.containerPadding)
942
+ let j = t(() => ({
943
+ margin: T(f.margin),
944
+ padding: T(f.padding)
945
+ })), M = t(() => ({
946
+ margin: T(f.containerMargin),
947
+ padding: T(f.containerPadding)
764
948
  }));
765
949
  function P() {
766
- return Object.fromEntries(Object.entries(O).filter(([e]) => e !== "class" && e !== "style"));
950
+ return Object.fromEntries(Object.entries(y).filter(([e]) => e !== "class" && e !== "style"));
767
951
  }
768
952
  function F() {
769
- return Object.keys(D).filter((e) => !A.has(e) && !(e === "empty" && D["table-empty"]));
953
+ return Object.keys(v).filter((e) => !S.has(e) && !(e === "empty" && v["table-empty"]));
770
954
  }
771
955
  function I(e, t) {
772
- v("current-change", e, t);
773
- }
774
- return u({
775
- tableRef: k,
776
- clearSelection: () => k.value?.clearSelection(),
777
- toggleRowSelection: (e, t) => k.value?.toggleRowSelection(e, t),
778
- toggleAllSelection: () => k.value?.toggleAllSelection(),
779
- toggleRowExpansion: (e, t) => k.value?.toggleRowExpansion(e, t),
780
- setCurrentRow: (e) => k.value?.setCurrentRow(e),
781
- clearSort: () => k.value?.clearSort(),
782
- clearFilter: (e) => k.value?.clearFilter(e),
783
- doLayout: () => k.value?.doLayout(),
784
- sort: (e, t) => k.value?.sort(e, t),
785
- scrollTo: (e, t) => k.value?.scrollTo(e, t),
786
- setScrollTop: (e) => k.value?.setScrollTop(e),
787
- setScrollLeft: (e) => k.value?.setScrollLeft(e)
788
- }), (t, c) => (_(), n(S(G), {
789
- class: p(["ctc-report", S(O).class]),
790
- style: h(S(O).style)
956
+ m("current-change", e, t);
957
+ }
958
+ return l({
959
+ tableRef: b,
960
+ clearSelection: () => b.value?.clearSelection(),
961
+ toggleRowSelection: (e, t) => b.value?.toggleRowSelection(e, t),
962
+ toggleAllSelection: () => b.value?.toggleAllSelection(),
963
+ toggleRowExpansion: (e, t) => b.value?.toggleRowExpansion(e, t),
964
+ setCurrentRow: (e) => b.value?.setCurrentRow(e),
965
+ clearSort: () => b.value?.clearSort(),
966
+ clearFilter: (e) => b.value?.clearFilter(e),
967
+ doLayout: () => b.value?.doLayout(),
968
+ sort: (e, t) => b.value?.sort(e, t),
969
+ scrollTo: (e, t) => b.value?.scrollTo(e, t),
970
+ setScrollTop: (e) => b.value?.setScrollTop(e),
971
+ setScrollLeft: (e) => b.value?.setScrollLeft(e)
972
+ }), (t, s) => (x(), n(D(Y), {
973
+ class: h(["ctc-report", D(y).class]),
974
+ style: _(D(y).style)
791
975
  }, {
792
- default: E(() => [D["custom-tool-bar"] || D["tool-bar"] || D["tool-bar-left"] || D["tool-bar-right"] || D["search-bar"] || D["search-bar-left"] || D["search-bar-right"] ? (_(), i("div", {
976
+ default: N(() => [v["custom-tool-bar"] || v["tool-bar"] || v["tool-bar-left"] || v["tool-bar-right"] || v["search-bar"] || v["search-bar-left"] || v["search-bar-right"] ? (x(), i("div", {
793
977
  key: 0,
794
978
  class: "ctc-report__header",
795
- style: h(M.value)
796
- }, [D["custom-tool-bar"] ? b(t.$slots, "custom-tool-bar", {}, void 0, void 0, 0) : D["tool-bar"] || D["tool-bar-left"] || D["tool-bar-right"] ? (_(), n(Z, {
979
+ style: _(j.value)
980
+ }, [v["custom-tool-bar"] ? w(t.$slots, "custom-tool-bar", {}, void 0, void 0, 0) : v["tool-bar"] || v["tool-bar-left"] || v["tool-bar-right"] ? (x(), n(X, {
797
981
  key: 1,
798
982
  class: "ctc-report__toolbar"
799
983
  }, o({ _: 2 }, [
800
- D["tool-bar"] ? {
984
+ v["tool-bar"] ? {
801
985
  name: "default",
802
- fn: E(() => [b(t.$slots, "tool-bar")]),
986
+ fn: N(() => [w(t.$slots, "tool-bar")]),
803
987
  key: "0"
804
988
  } : void 0,
805
- D["tool-bar-left"] ? {
989
+ v["tool-bar-left"] ? {
806
990
  name: "left",
807
- fn: E(() => [b(t.$slots, "tool-bar-left")]),
991
+ fn: N(() => [w(t.$slots, "tool-bar-left")]),
808
992
  key: "1"
809
993
  } : void 0,
810
- D["tool-bar-right"] ? {
994
+ v["tool-bar-right"] ? {
811
995
  name: "right",
812
- fn: E(() => [b(t.$slots, "tool-bar-right")]),
996
+ fn: N(() => [w(t.$slots, "tool-bar-right")]),
813
997
  key: "2"
814
998
  } : void 0
815
- ]), 1024)) : r("", !0), D["search-bar"] || D["search-bar-left"] || D["search-bar-right"] ? (_(), n(Z, {
999
+ ]), 1024)) : r("", !0), v["search-bar"] || v["search-bar-left"] || v["search-bar-right"] ? (x(), n(X, {
816
1000
  key: 2,
817
1001
  class: "ctc-report__search"
818
1002
  }, o({ _: 2 }, [
819
- D["search-bar"] ? {
1003
+ v["search-bar"] ? {
820
1004
  name: "default",
821
- fn: E(() => [b(t.$slots, "search-bar")]),
1005
+ fn: N(() => [w(t.$slots, "search-bar")]),
822
1006
  key: "0"
823
1007
  } : void 0,
824
- D["search-bar-left"] ? {
1008
+ v["search-bar-left"] ? {
825
1009
  name: "left",
826
- fn: E(() => [b(t.$slots, "search-bar-left")]),
1010
+ fn: N(() => [w(t.$slots, "search-bar-left")]),
827
1011
  key: "1"
828
1012
  } : void 0,
829
- D["search-bar-right"] ? {
1013
+ v["search-bar-right"] ? {
830
1014
  name: "right",
831
- fn: E(() => [b(t.$slots, "search-bar-right")]),
1015
+ fn: N(() => [w(t.$slots, "search-bar-right")]),
832
1016
  key: "2"
833
1017
  } : void 0
834
- ]), 1024)) : r("", !0)], 4)) : r("", !0), s(S(G), {
1018
+ ]), 1024)) : r("", !0)], 4)) : r("", !0), c(D(Y), {
835
1019
  class: "ctc-report__container",
836
1020
  fill: "",
837
- style: h(N.value)
1021
+ style: _(M.value)
838
1022
  }, {
839
- default: E(() => [D["container-top"] ? (_(), i("div", ge, [b(t.$slots, "container-top")])) : r("", !0), s(S(G), {
1023
+ default: N(() => [v["container-top"] ? (x(), i("div", Ge, [w(t.$slots, "container-top")])) : r("", !0), c(D(Y), {
840
1024
  class: "ctc-report__body",
841
1025
  fill: ""
842
1026
  }, {
843
- default: E(() => [
844
- D["table-bar"] || D["table-title"] || g.title || D["table-info-left"] || D["table-info-right"] ? (_(), i("div", _e, [D["table-bar"] ? b(t.$slots, "table-bar", {}, void 0, void 0, 0) : (_(), i(e, { key: 1 }, [D["table-title"] || g.title ? (_(), i("div", ve, [b(t.$slots, "table-title", {}, () => [a("h2", null, x(g.title), 1)])])) : r("", !0), D["table-info-left"] || D["table-info-right"] ? (_(), n(Z, {
1027
+ default: N(() => [
1028
+ v["table-bar"] || v["table-title"] || f.title || v["table-info-left"] || v["table-info-right"] ? (x(), i("div", Ke, [v["table-bar"] ? w(t.$slots, "table-bar", {}, void 0, void 0, 0) : (x(), i(e, { key: 1 }, [v["table-title"] || f.title ? (x(), i("div", qe, [w(t.$slots, "table-title", {}, () => [a("h2", null, E(f.title), 1)])])) : r("", !0), v["table-info-left"] || v["table-info-right"] ? (x(), n(X, {
845
1029
  key: 1,
846
1030
  class: "ctc-report__info"
847
- }, o({ _: 2 }, [D["table-info-left"] ? {
1031
+ }, o({ _: 2 }, [v["table-info-left"] ? {
848
1032
  name: "left",
849
- fn: E(() => [b(t.$slots, "table-info-left")]),
1033
+ fn: N(() => [w(t.$slots, "table-info-left")]),
850
1034
  key: "0"
851
- } : void 0, D["table-info-right"] ? {
1035
+ } : void 0, v["table-info-right"] ? {
852
1036
  name: "right",
853
- fn: E(() => [b(t.$slots, "table-info-right")]),
1037
+ fn: N(() => [w(t.$slots, "table-info-right")]),
854
1038
  key: "1"
855
1039
  } : void 0]), 1024)) : r("", !0)], 64))])) : r("", !0),
856
- D.default ? (_(), i("div", ye, [b(t.$slots, "default")])) : r("", !0),
857
- a("div", { class: p(["ctc-report__table", { "ctc-report__table--auto-height": g.autoHeight && g.height === void 0 }]) }, [s(S(Y), f({
1040
+ v.default ? (x(), i("div", Je, [w(t.$slots, "default")])) : r("", !0),
1041
+ a("div", { class: h(["ctc-report__table", { "ctc-report__table--auto-height": f.autoHeight && f.height === void 0 }]) }, [c(D(He), p({
858
1042
  ref_key: "tableRef",
859
- ref: k
1043
+ ref: b
860
1044
  }, P(), {
861
- "auto-height": g.autoHeight,
862
- height: g.height,
863
- "onUpdate:currentPage": c[0] ||= (e) => v("update:currentPage", e),
864
- "onUpdate:pageSize": c[1] ||= (e) => v("update:pageSize", e),
1045
+ "auto-height": f.autoHeight,
1046
+ height: f.height,
1047
+ "onUpdate:currentPage": s[0] ||= (e) => m("update:currentPage", e),
1048
+ "onUpdate:pageSize": s[1] ||= (e) => m("update:pageSize", e),
865
1049
  onCurrentChange: I,
866
- onPageChange: c[2] ||= (e) => v("page-change", e),
867
- onPageSizeChange: c[3] ||= (e) => v("page-size-change", e),
868
- onPrevClick: c[4] ||= (e) => v("prev-click", e),
869
- onNextClick: c[5] ||= (e) => v("next-click", e)
870
- }), o({ _: 2 }, [D["table-empty"] ? {
1050
+ onPageChange: s[2] ||= (e) => m("page-change", e),
1051
+ onPageSizeChange: s[3] ||= (e) => m("page-size-change", e),
1052
+ onPrevClick: s[4] ||= (e) => m("prev-click", e),
1053
+ onNextClick: s[5] ||= (e) => m("next-click", e)
1054
+ }), o({ _: 2 }, [v["table-empty"] ? {
871
1055
  name: "empty",
872
- fn: E(() => [b(t.$slots, "table-empty")]),
1056
+ fn: N(() => [w(t.$slots, "table-empty")]),
873
1057
  key: "0"
874
- } : void 0, y(F(), (e) => ({
1058
+ } : void 0, C(F(), (e) => ({
875
1059
  name: e,
876
- fn: E((n) => [b(t.$slots, e, m(l(n)))])
1060
+ fn: N((n) => [w(t.$slots, e, g(u(n)))])
877
1061
  }))]), 1040, ["auto-height", "height"])], 2),
878
- D["append-table"] ? (_(), i("div", be, [b(t.$slots, "append-table")])) : r("", !0)
1062
+ v["append-table"] ? (x(), i("div", Ye, [w(t.$slots, "append-table")])) : r("", !0)
879
1063
  ]),
880
1064
  _: 3
881
1065
  })]),
@@ -884,16 +1068,1330 @@ var me = {
884
1068
  _: 3
885
1069
  }, 8, ["class", "style"]));
886
1070
  }
887
- }), xe = [
888
- H,
889
- W,
890
- G,
1071
+ });
1072
+ //#endregion
1073
+ //#region src/components/video/src/time.ts
1074
+ function Z(e) {
1075
+ return String(e).padStart(2, "0");
1076
+ }
1077
+ function Ze(e) {
1078
+ return `${e.getFullYear()}-${Z(e.getMonth() + 1)}-${Z(e.getDate())} ${Z(e.getHours())}:${Z(e.getMinutes())}:${Z(e.getSeconds())}`;
1079
+ }
1080
+ function Qe() {
1081
+ let e = /* @__PURE__ */ new Date();
1082
+ return e.setHours(0, 0, 0, 0), Ze(e);
1083
+ }
1084
+ function $e(e) {
1085
+ let t = /(?:^|\s)(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?/.exec(e || "");
1086
+ return t ? Number(t[1]) + Number(t[2] ?? 0) / 60 + Number(t[3] ?? 0) / 3600 : 0;
1087
+ }
1088
+ function Q(e) {
1089
+ let t = /^(\d{4})-(\d{2})-(\d{2})\s+(.*)$/.exec(e || "");
1090
+ if (t) {
1091
+ let [, e, n, r, i] = t;
1092
+ return Date.UTC(Number(e), Number(n) - 1, Number(r)) / 864e5 * 24 + $e(i ?? "");
1093
+ }
1094
+ return $e(e);
1095
+ }
1096
+ function et(e, t) {
1097
+ let n = Q(t) - Q(e);
1098
+ return n > 0 ? n : n < 0 ? n + 24 : 0;
1099
+ }
1100
+ function tt(e) {
1101
+ let t = Math.max(0, Math.round(e * 3600));
1102
+ return `${Z(Math.floor(t / 3600))}:${Z(Math.floor(t % 3600 / 60))}:${Z(t % 60)}`;
1103
+ }
1104
+ function nt(e, t) {
1105
+ let n = e || "00:00", r = Math.max(0, Math.round((t - Q(n)) * 36e5));
1106
+ return n.split(" ")[0] ? Ze(new Date(new Date(n.replace(" ", "T")).getTime() + r)) : tt(($e(n) * 36e5 + r) % 864e5 / 36e5);
1107
+ }
1108
+ function rt() {
1109
+ return Q(Ze(/* @__PURE__ */ new Date()));
1110
+ }
1111
+ //#endregion
1112
+ //#region src/components/video/src/useMpegtsPlayer.ts
1113
+ var it = 2e4, at = 6e4;
1114
+ function ot(e, t) {
1115
+ let n = e, r = n?.response?.data ?? n, i = String(r?.msg ?? r?.message ?? "").trim();
1116
+ if (i) return /network error/i.test(i) ? "网络异常,请检查网络后重试" : /timeout/i.test(i) ? "请求超时,请重试" : i;
1117
+ let a = n?.response?.status;
1118
+ return typeof a == "number" && a >= 400 ? `${t}(HTTP ${a})` : t;
1119
+ }
1120
+ var st = null;
1121
+ function ct() {
1122
+ return st ||= import("@brid9e/mpegts.js").then((e) => e.default), st;
1123
+ }
1124
+ function lt(e) {
1125
+ let n = S(), r = S(!1), i = S(!1), a = S(""), o = S(!1), s = S(!1), c = S([]), l = S(0), u = S(""), d = null, f = null, p = null, h = 0, g = t(() => c.value[l.value]);
1126
+ function _() {
1127
+ y(), p = setTimeout(() => {
1128
+ p = null, r.value && (r.value = !1, i.value = !0, a.value = "视频加载超时,请重试");
1129
+ }, it);
1130
+ }
1131
+ function y() {
1132
+ p &&= (clearTimeout(p), null);
1133
+ }
1134
+ function b() {
1135
+ f &&= (clearTimeout(f), null);
1136
+ }
1137
+ function x() {
1138
+ i.value = !1, a.value = "";
1139
+ }
1140
+ function C(t, n) {
1141
+ i.value = !0, a.value = t, r.value = !1, y(), e.onError?.({
1142
+ channel: e.channel(),
1143
+ error: n ?? Error(t),
1144
+ mode: e.mode()
1145
+ });
1146
+ }
1147
+ function w(e) {
1148
+ r.value = !0, s.value = e, _();
1149
+ }
1150
+ function T() {
1151
+ if (b(), y(), d) {
1152
+ let e = d;
1153
+ d = null, e.pause(), e.unload(), e.detachMediaElement(), e.destroy();
1154
+ }
1155
+ let e = n.value;
1156
+ e && (e.removeAttribute("src"), e.load());
1157
+ }
1158
+ async function E(e, t, i) {
1159
+ let a = await ct();
1160
+ if (i !== h) return;
1161
+ if (!a.isSupported()) {
1162
+ C("当前浏览器不支持 flv 播放");
1163
+ return;
1164
+ }
1165
+ if (T(), n.value || await m(), i !== h) return;
1166
+ if (!n.value) {
1167
+ C("视频容器尚未就绪");
1168
+ return;
1169
+ }
1170
+ let o = a.createPlayer({
1171
+ type: "flv",
1172
+ url: e,
1173
+ isLive: t
1174
+ }, t ? {
1175
+ enableWorker: !1,
1176
+ enableStashBuffer: !1,
1177
+ stashInitialSize: 128,
1178
+ lazyLoad: !1,
1179
+ autoCleanupSourceBuffer: !0,
1180
+ autoDisableAudioOnUnsupportedCodec: !0,
1181
+ autoDisableAudioTimeout: 1e3
1182
+ } : {
1183
+ enableWorker: !1,
1184
+ lazyLoad: !1,
1185
+ seekType: "range",
1186
+ enableStashBuffer: !0,
1187
+ stashInitialSize: 8192,
1188
+ autoCleanupSourceBuffer: !0,
1189
+ autoCleanupMaxBackwardDuration: 120,
1190
+ autoCleanupMinBackwardDuration: 60,
1191
+ autoDisableAudioOnUnsupportedCodec: !0,
1192
+ autoDisableAudioTimeout: 1e3
1193
+ });
1194
+ o.attachMediaElement(n.value), o.on(a.Events.ERROR, () => {
1195
+ i === h && C("视频流播放中断,请重试");
1196
+ }), o.load();
1197
+ let s = o.play();
1198
+ s && typeof s.catch == "function" && s.catch(() => {}), d = o, r.value && _();
1199
+ }
1200
+ async function D(t) {
1201
+ let n = e.source?.();
1202
+ return n?.live ? n.live(t) : t.liveUrl ? { url: t.liveUrl } : null;
1203
+ }
1204
+ async function O(t, n, r) {
1205
+ let i = e.source?.();
1206
+ return i?.playback ? i.playback(t, {
1207
+ beginTime: n,
1208
+ endTime: r
1209
+ }) : t.playbackUrl ? { url: t.playbackUrl } : null;
1210
+ }
1211
+ async function k(t = !0) {
1212
+ let n = e.channel();
1213
+ if (!n) return;
1214
+ let r = ++h;
1215
+ s.value = !1, t && w(!1), x();
1216
+ try {
1217
+ let t = await D(n);
1218
+ if (r !== h || e.channel()?.id !== n.id) return;
1219
+ if (!t?.url) {
1220
+ C("未获取到拉流地址");
1221
+ return;
1222
+ }
1223
+ await E(t.url, !0, r), r === h && N(t.expireTime, r);
1224
+ } catch (e) {
1225
+ r === h && C(ot(e, "视频加载失败,请切换其他通道"), e);
1226
+ }
1227
+ }
1228
+ async function A(t = !0, n = !1) {
1229
+ let r = e.channel();
1230
+ if (!r) return;
1231
+ let i = ++h;
1232
+ s.value = !1, n || (u.value = e.beginTime()), t && w(!1), x();
1233
+ try {
1234
+ let t = await O(r, u.value || e.beginTime(), e.endTime());
1235
+ if (i !== h || e.channel()?.id !== r.id) return;
1236
+ let n = t?.segments ?? [];
1237
+ if (c.value = n, n.length > 0) l.value = 0, await E(n[0].url, !1, i);
1238
+ else if (t?.url) c.value = [], await E(t.url, !1, i);
1239
+ else {
1240
+ C("该时段无录像");
1241
+ return;
1242
+ }
1243
+ i === h && N(t?.expireTime, i);
1244
+ } catch (e) {
1245
+ i === h && C(ot(e, "录像获取失败,请切换其他时段"), e);
1246
+ }
1247
+ }
1248
+ async function j(t) {
1249
+ if (e.mode() !== "playback") return;
1250
+ let n = e.channel();
1251
+ if (!n) return;
1252
+ let i = ++h;
1253
+ x(), w(!0);
1254
+ try {
1255
+ u.value = nt(e.beginTime(), t);
1256
+ let r = await O(n, u.value, e.endTime());
1257
+ if (i !== h || e.channel()?.id !== n.id) return;
1258
+ let a = r?.segments ?? [];
1259
+ if (c.value = a, a.length > 0) l.value = 0, await E(a[0].url, !1, i);
1260
+ else if (r?.url) c.value = [], await E(r.url, !1, i);
1261
+ else {
1262
+ C("该时段无录像");
1263
+ return;
1264
+ }
1265
+ i === h && N(r?.expireTime, i);
1266
+ } catch {
1267
+ r.value = !1, s.value = !1, y();
1268
+ }
1269
+ }
1270
+ function N(t, n) {
1271
+ if (b(), !t) return;
1272
+ let r = new Date(t.replace(/-/g, "/")).getTime() - Date.now() - at;
1273
+ r <= 0 || (f = setTimeout(() => {
1274
+ f = null, !(n !== h || !e.channel()) && (e.mode() === "playback" ? A(!1, !0) : k(!1));
1275
+ }, r));
1276
+ }
1277
+ function P() {
1278
+ r.value = !1, s.value = !1, y();
1279
+ }
1280
+ function F() {
1281
+ o.value = !1;
1282
+ }
1283
+ function I() {
1284
+ o.value = !0;
1285
+ }
1286
+ function L() {
1287
+ let t = n.value;
1288
+ !t || e.mode() !== "playback" || (t.paused ? t.play().catch(() => {}) : t.pause());
1289
+ }
1290
+ function R() {
1291
+ if (e.mode() !== "playback") return;
1292
+ let t = l.value + 1;
1293
+ if (c.value.length > 0 && t < c.value.length) {
1294
+ l.value = t;
1295
+ let e = c.value[t];
1296
+ e && E(e.url, !1, h);
1297
+ return;
1298
+ }
1299
+ e.onPlaybackEnded?.({
1300
+ channel: e.channel(),
1301
+ mode: e.mode()
1302
+ });
1303
+ }
1304
+ function z() {
1305
+ if (e.mode() !== "playback") return NaN;
1306
+ let t = n.value, r = g.value, i = Q(u.value || e.beginTime() || "00:00");
1307
+ if (!t || !r) return NaN;
1308
+ let a = c.value.slice(0, l.value).reduce((e, t) => e + et(t.segmentBeginTime ?? "", t.segmentEndTime ?? ""), 0), o = t.currentTime > 0 ? t.currentTime / 3600 : 0;
1309
+ return i + a + o;
1310
+ }
1311
+ function B() {
1312
+ r.value || !e.channel() || (e.mode() === "live" ? k(!0) : g.value ? j(z()) : A(!0, !0));
1313
+ }
1314
+ function ee() {
1315
+ h++, T(), r.value = !1, i.value = !1, a.value = "", o.value = !1, s.value = !1, c.value = [], l.value = 0, u.value = e.beginTime();
1316
+ }
1317
+ function te() {
1318
+ let t = e.channel();
1319
+ ee(), t && (e.mode() === "live" ? k(!0) : A(!0));
1320
+ }
1321
+ return M([() => e.channel()?.id, () => e.mode()], () => te(), { immediate: !0 }), M([() => e.beginTime(), () => e.endTime()], () => {
1322
+ e.mode() === "playback" && te();
1323
+ }), v(() => {
1324
+ h++, T(), b();
1325
+ }), {
1326
+ clearWatchdog: y,
1327
+ cursorHour: z,
1328
+ currentSegment: g,
1329
+ destroy: T,
1330
+ error: i,
1331
+ errorText: a,
1332
+ isPaused: o,
1333
+ isSeekReload: s,
1334
+ loading: r,
1335
+ onEnded: R,
1336
+ onPause: I,
1337
+ onPlay: F,
1338
+ onPlaying: P,
1339
+ playbackBeginTime: u,
1340
+ reload: B,
1341
+ segmentIndex: l,
1342
+ segments: c,
1343
+ seekTo: j,
1344
+ togglePause: L,
1345
+ videoEl: n
1346
+ };
1347
+ }
1348
+ //#endregion
1349
+ //#region src/components/video/src/useVideoTimeline.ts
1350
+ var ut = {
1351
+ none: () => !0,
1352
+ alt: (e) => e.altKey,
1353
+ ctrl: (e) => e.ctrlKey,
1354
+ meta: (e) => e.metaKey,
1355
+ shift: (e) => e.shiftKey
1356
+ };
1357
+ function $(e, t) {
1358
+ return typeof window > "u" ? t : getComputedStyle(document.documentElement).getPropertyValue(e).trim() || t;
1359
+ }
1360
+ function dt(e) {
1361
+ let n = S(), r = S(0), i = S(!1), a = S(-1), o = S(0), s = null, c = null, l = !1, u = null, d = null, f = e.axisRange ?? S({
1362
+ start: 0,
1363
+ end: 24
1364
+ }), p = t(() => f.value.start), h = t(() => f.value.end), g = t(() => Math.max(h.value - p.value, 1e-4)), _ = t(() => Math.min(h.value, e.availableEndHour?.() ?? h.value)), v = t(() => _.value < h.value - 1e-6), x = S(g.value), C = S(p.value), w = t(() => Math.min(C.value + x.value, h.value)), T = [
1365
+ 1 / 12,
1366
+ .25,
1367
+ .5,
1368
+ 1,
1369
+ 2,
1370
+ 4,
1371
+ 6,
1372
+ 8,
1373
+ 12,
1374
+ 24,
1375
+ 48
1376
+ ], E = t(() => {
1377
+ let e = x.value / 20;
1378
+ for (let t of T) if (t >= e) return t;
1379
+ return T[T.length - 1] ?? 48;
1380
+ }), D = t(() => (o.value, {
1381
+ alarm: $("--el-color-danger", "#f56c6c"),
1382
+ forbidden: $("--ctc-color-text-placeholder", "#94969e"),
1383
+ hoverBox: $("--ctc-color-surface-elevated", "#282a32"),
1384
+ hoverHint: $("--ctc-color-text-secondary", "#b8bcc6"),
1385
+ hoverLinePlayed: $("--ctc-color-on-primary", "#ffffff"),
1386
+ hoverLineRest: $("--ctc-color-primary", "#1f5eff"),
1387
+ hoverText: $("--ctc-color-text", "#e5e7eb"),
1388
+ labelPlayed: $("--ctc-color-on-primary", "#ffffff"),
1389
+ labelRest: $("--ctc-color-text-secondary", "#b8bcc6"),
1390
+ played: $("--ctc-color-primary", "#1f5eff"),
1391
+ tickPlayed: $("--ctc-color-on-primary", "#ffffff"),
1392
+ tickRest: $("--ctc-color-text-placeholder", "#98a2b3"),
1393
+ track: $("--ctc-color-fill", "#2e3039")
1394
+ }));
1395
+ function O(e, t, n, r = !1) {
1396
+ let i = n - t, a = /* @__PURE__ */ new Date(Math.floor(e / 24) * 864e5), o = `${String(a.getUTCMonth() + 1).padStart(2, "0")}-${String(a.getUTCDate()).padStart(2, "0")}`;
1397
+ if (r) {
1398
+ let t = Math.floor((e % 24 + 24) % 24 * 3600);
1399
+ return `${o} ${String(Math.floor(t / 3600)).padStart(2, "0")}:${String(Math.floor(t % 3600 / 60)).padStart(2, "0")}:${String(t % 60).padStart(2, "0")}`;
1400
+ }
1401
+ let s = Math.round((e % 24 + 24) % 24 * 60), c = `${String(Math.floor(s / 60)).padStart(2, "0")}:${String(s % 60).padStart(2, "0")}`;
1402
+ return Math.floor(t / 24) === Math.floor(n / 24) ? c : i >= 168 ? o : `${o} ${c}`;
1403
+ }
1404
+ let k = t(() => {
1405
+ let e = p.value + r.value * g.value, t = (e % 24 + 24) % 24 * 3600, n = `${String(Math.floor(t / 3600)).padStart(2, "0")}:${String(Math.floor(t % 3600 / 60)).padStart(2, "0")}:${String(Math.floor(t % 60)).padStart(2, "0")}`;
1406
+ if (Math.floor(p.value / 24) !== Math.floor(h.value / 24)) {
1407
+ let t = /* @__PURE__ */ new Date(Math.floor(e / 24) * 864e5);
1408
+ return `${String(t.getUTCMonth() + 1).padStart(2, "0")}-${String(t.getUTCDate()).padStart(2, "0")} ${n}`;
1409
+ }
1410
+ return n;
1411
+ });
1412
+ function A(e) {
1413
+ let t = Q(e);
1414
+ return /^\d{4}-\d{2}-\d{2}/.test(e) ? t : Math.floor(p.value / 24) * 24 + t;
1415
+ }
1416
+ let j = t(() => {
1417
+ let t = p.value + r.value * g.value;
1418
+ return e.alarms.value.filter((e) => t >= A(e.startTime) && t <= A(e.endTime));
1419
+ });
1420
+ function N() {
1421
+ if (e.getCursorHour) {
1422
+ let t = e.getCursorHour();
1423
+ if (Number.isFinite(t)) return t;
1424
+ }
1425
+ let t = e.videoRef.value, n = t?.duration;
1426
+ return t && n && Number.isFinite(n) ? p.value + t.currentTime / n * g.value : p.value + r.value * g.value;
1427
+ }
1428
+ function P() {
1429
+ let e = x.value, t = p.value + r.value * g.value, n = C.value, i = Math.min(n + e, h.value), a = e * .15;
1430
+ t < n + a && n > p.value ? C.value = Math.max(p.value, t - a) : t > i - a && i < h.value && (C.value = Math.min(h.value - e, t - e + a));
1431
+ }
1432
+ function F() {
1433
+ let t = e.videoRef.value, a = n.value;
1434
+ if (!t || !a || t.paused || i.value) {
1435
+ c = null;
1436
+ return;
1437
+ }
1438
+ r.value = Math.max(0, Math.min(1, (N() - p.value) / g.value)), P(), I(), c = requestAnimationFrame(F);
1439
+ }
1440
+ function I() {
1441
+ let t = n.value;
1442
+ if (!t) return;
1443
+ let o = t.getContext("2d");
1444
+ if (!o) return;
1445
+ let s = t.getBoundingClientRect();
1446
+ if (s.width <= 0 || s.height <= 0) return;
1447
+ let c = window.devicePixelRatio || 1;
1448
+ t.width = s.width * c, t.height = s.height * c, o.scale(c, c), o.clearRect(0, 0, s.width, s.height);
1449
+ let l = o, u = D.value, d = s.width, f = s.height, m = f / 2, h = C.value, y = w.value, b = p.value + r.value * g.value, x = (e) => (e - h) / (y - h) * d, S = (e) => Math.max(0, Math.min(d, e)), T = (e) => Math.max(10, Math.min(d - 10, e));
1450
+ l.fillStyle = u.track, l.fillRect(0, 0, d, f);
1451
+ let k = S(x(p.value)), j = S(x(b));
1452
+ l.fillStyle = u.played, l.fillRect(k, 0, Math.max(j - k, 0), f);
1453
+ for (let t of e.alarms.value) {
1454
+ let e = A(t.startTime), n = A(t.endTime);
1455
+ if (n < h || e > y) continue;
1456
+ let r = S(x(e)), i = S(x(n));
1457
+ i - r < 1 || (l.globalAlpha = .85, l.fillStyle = u.alarm, l.fillRect(r, 0, i - r, f), l.globalAlpha = 1);
1458
+ }
1459
+ l.lineWidth = 1, l.textAlign = "left", l.textBaseline = "middle";
1460
+ let M = E.value, N = y - h, P = N >= 168 || Math.floor(h / 24) === Math.floor(y / 24) ? 34 : 52, F = Math.max(M, (P + 8) / d * N), I = Math.max(1, Math.ceil(F / M));
1461
+ function L(e, t) {
1462
+ l.strokeStyle = e, l.fillStyle = t, l.font = M < .5 ? "8px sans-serif" : "9px sans-serif";
1463
+ let n = Math.ceil(h / M) * M, r = 0;
1464
+ for (; n <= y + 1e-6;) {
1465
+ let e = x(n);
1466
+ e >= 0 && e <= d && (l.globalAlpha = .55, l.beginPath(), l.moveTo(e, 0), l.lineTo(e, f / 2), l.stroke(), l.globalAlpha = 1, r % I === 0 && l.fillText(O(n, h, y), T(e + 4), m)), n += M, r++;
1467
+ }
1468
+ }
1469
+ function R(e, t, n, r) {
1470
+ t - e <= 0 || (l.save(), l.beginPath(), l.rect(e, 0, t - e, f), l.clip(), L(n, r), l.restore());
1471
+ }
1472
+ if (R(0, j, u.tickPlayed, u.labelPlayed), R(j, d, u.tickRest, u.labelRest), v.value && _.value < y) {
1473
+ let e = S(x(_.value)), t = S(x(y));
1474
+ t - e >= 1 && (l.globalAlpha = .32, l.fillStyle = u.forbidden, l.fillRect(e, 0, t - e, f), l.globalAlpha = 1);
1475
+ }
1476
+ if (a.value >= 0 && !i.value) {
1477
+ let e = h + a.value * (y - h), t = x(e), n = t >= k && t <= j, r = e > _.value + 1e-6;
1478
+ l.strokeStyle = n ? u.hoverLinePlayed : u.hoverLineRest, l.lineWidth = 1, l.setLineDash([3, 3]), l.beginPath(), l.moveTo(t, 0), l.lineTo(t, f), l.stroke(), l.setLineDash([]), l.font = "bold 9px sans-serif";
1479
+ let i = O(e, h, y, !0), o = "(还未生成回放)", s = Math.max(l.measureText(i).width, l.measureText(o).width), c = T(t), d = s + 10, p = r ? 28 : 14, g = m - p / 2;
1480
+ l.globalAlpha = .95, l.fillStyle = u.hoverBox, l.fillRect(c - d / 2, g, d, p), l.globalAlpha = 1, l.fillStyle = u.hoverText, l.textAlign = "center", l.textBaseline = "middle", r ? (l.fillText(i, c, m - 7), l.fillStyle = u.hoverHint, l.fillText(o, c, m + 7)) : l.fillText(i, c, m);
1481
+ }
1482
+ }
1483
+ function L(t) {
1484
+ let a = n.value;
1485
+ if (!a) return;
1486
+ let o = a.getBoundingClientRect(), s = Math.max(0, Math.min(1, (t.clientX - o.left) / o.width)), u = C.value + s * x.value, d = Math.min(u, _.value);
1487
+ if (r.value = Math.max(0, Math.min(1, (d - p.value) / g.value)), e.onSeekHour ? l = !0 : e.videoRef.value?.duration && Number.isFinite(e.videoRef.value.duration) && (e.videoRef.value.currentTime = r.value * e.videoRef.value.duration, e.mode.value === "playback" && e.videoRef.value.paused && e.videoRef.value.play()), P(), I(), !i.value) {
1488
+ let t = e.videoRef.value;
1489
+ t && !t.paused && e.mode.value === "playback" && !c && F();
1490
+ }
1491
+ }
1492
+ function R(e) {
1493
+ i.value = !0, L(e);
1494
+ }
1495
+ function z(e) {
1496
+ i.value && L(e);
1497
+ }
1498
+ function B() {
1499
+ if (i.value = !1, e.onSeekHour && l) {
1500
+ l = !1;
1501
+ let t = p.value + r.value * g.value;
1502
+ e.onSeekHour(Math.max(p.value, Math.min(_.value, t)));
1503
+ }
1504
+ let t = e.videoRef.value;
1505
+ t && !t.paused && e.mode.value === "playback" && !c && F();
1506
+ }
1507
+ function ee(e) {
1508
+ let t = n.value;
1509
+ if (!t) return;
1510
+ let r = t.getBoundingClientRect();
1511
+ a.value = Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)), s && cancelAnimationFrame(s), s = requestAnimationFrame(I);
1512
+ }
1513
+ function te() {
1514
+ a.value = -1, s && cancelAnimationFrame(s), s = requestAnimationFrame(I);
1515
+ }
1516
+ function ne(t) {
1517
+ if (!ut[e.zoomModifier?.() ?? "none"](t)) return;
1518
+ t.preventDefault();
1519
+ let n = Math.abs(t.deltaY) > Math.abs(t.deltaX) ? t.deltaY : t.deltaX;
1520
+ if (Math.abs(n) < 1) return;
1521
+ let r = x.value, i = n > 0 ? 1.5 : 1 / 1.5, a = Math.max(.25, Math.min(g.value, r * i));
1522
+ a !== r && (x.value = a);
1523
+ }
1524
+ function V() {
1525
+ !e.videoRef.value || i.value || (r.value = Math.max(0, Math.min(1, (N() - p.value) / g.value)), I());
1526
+ }
1527
+ function re() {
1528
+ e.mode.value === "playback" && !c && F();
1529
+ }
1530
+ function ie() {
1531
+ a.value = -1, s &&= (cancelAnimationFrame(s), null), c &&= (cancelAnimationFrame(c), null), i.value = !1, l = !1, r.value = 0, x.value = g.value, C.value = p.value, m(I);
1532
+ }
1533
+ return y(() => {
1534
+ document.addEventListener("mousemove", z), document.addEventListener("mouseup", B), d = new MutationObserver(() => {
1535
+ o.value++, m(I);
1536
+ }), d.observe(document.documentElement, {
1537
+ attributeFilter: [
1538
+ "class",
1539
+ "data-ctc-theme",
1540
+ "data-ctc-theme-mode",
1541
+ "style"
1542
+ ],
1543
+ attributes: !0
1544
+ }), m(I);
1545
+ }), b(() => {
1546
+ document.removeEventListener("mousemove", z), document.removeEventListener("mouseup", B), s && cancelAnimationFrame(s), c && cancelAnimationFrame(c), u?.disconnect(), d?.disconnect();
1547
+ }), M(n, (e) => {
1548
+ u?.disconnect(), !(!e || typeof ResizeObserver > "u") && (u = new ResizeObserver(() => I()), u.observe(e), m(I));
1549
+ }, { immediate: !0 }), M(x, () => {
1550
+ let e = p.value + r.value * g.value, t = x.value;
1551
+ C.value = Math.max(p.value, Math.min(h.value - t, e - t / 2)), m(I);
1552
+ }), M(f, (e) => {
1553
+ x.value = Math.max(.1, e.end - e.start), C.value = e.start, m(I);
1554
+ }), M(C, () => m(I)), M(e.mode, () => {
1555
+ e.mode.value === "playback" && m(I);
1556
+ }), {
1557
+ cursorPercent: r,
1558
+ cursorTimeText: k,
1559
+ currentAlarms: j,
1560
+ drawTimeline: I,
1561
+ onCanvasMouseLeave: te,
1562
+ onCanvasMouseMove: ee,
1563
+ onTimelineMouseDown: R,
1564
+ onTimelineWheel: ne,
1565
+ onVideoTimeUpdate: V,
1566
+ resetTimeline: ie,
1567
+ startSync: re,
1568
+ timelineCanvas: n
1569
+ };
1570
+ }
1571
+ //#endregion
1572
+ //#region src/components/video/src/VideoChannelNav.vue?vue&type=script&setup=true&lang.ts
1573
+ var ft = { class: "ctc-video__sidebar" }, pt = { class: "ctc-video__sidebar-toolbar" }, mt = ["onClick"], ht = { class: "ctc-video__channel-label" }, gt = {
1574
+ key: 0,
1575
+ class: "ctc-video__empty"
1576
+ }, _t = /* @__PURE__ */ l({
1577
+ name: "CtcVideoChannelNav",
1578
+ __name: "VideoChannelNav",
1579
+ props: {
1580
+ activeChannel: {},
1581
+ channels: {},
1582
+ emptyText: {},
1583
+ tree: {}
1584
+ },
1585
+ emits: ["select", "toggle-collapsed"],
1586
+ setup(o, { expose: s, emit: l }) {
1587
+ let u = o, d = l, f = S(""), p = S(/* @__PURE__ */ new Set());
1588
+ function m(e, t = /* @__PURE__ */ new Set()) {
1589
+ for (let n of e) n.children?.length && (t.add(n.key), m(n.children, t));
1590
+ return t;
1591
+ }
1592
+ M(() => u.tree, (e) => {
1593
+ p.value = e?.length ? m(e) : /* @__PURE__ */ new Set();
1594
+ }, { immediate: !0 });
1595
+ let g = t(() => {
1596
+ let e = u.tree;
1597
+ if (!e?.length) return [];
1598
+ let t = f.value.trim().toLowerCase();
1599
+ if (!t) return e;
1600
+ function n(e) {
1601
+ return e.flatMap((e) => {
1602
+ let r = e.children ? n(e.children) : [];
1603
+ return e.label.toLowerCase().includes(t) || r.length > 0 ? [{
1604
+ ...e,
1605
+ children: r
1606
+ }] : [];
1607
+ });
1608
+ }
1609
+ return n(e);
1610
+ }), v = t(() => {
1611
+ if (!u.tree?.length) {
1612
+ let e = f.value.trim().toLowerCase();
1613
+ return u.channels.filter((t) => !e || t.name.toLowerCase().includes(e)).map((e) => ({
1614
+ channel: e,
1615
+ depth: 0,
1616
+ hasChildren: !1,
1617
+ key: e.id,
1618
+ label: e.name,
1619
+ online: e.online,
1620
+ open: !1,
1621
+ value: e.id
1622
+ }));
1623
+ }
1624
+ let e = [];
1625
+ function t(n, r) {
1626
+ for (let i of n) {
1627
+ let n = !!i.children?.length, a = n && p.value.has(i.key);
1628
+ e.push({
1629
+ channel: i.value ? u.channels.find((e) => e.id === i.value) : void 0,
1630
+ depth: r,
1631
+ hasChildren: n,
1632
+ key: i.key,
1633
+ label: i.label,
1634
+ node: i,
1635
+ online: i.online,
1636
+ open: a,
1637
+ value: i.value
1638
+ }), n && a && t(i.children, r + 1);
1639
+ }
1640
+ }
1641
+ return t(g.value, 0), e;
1642
+ });
1643
+ function y(e) {
1644
+ let t = new Set(p.value);
1645
+ t.has(e) ? t.delete(e) : t.add(e), p.value = t;
1646
+ }
1647
+ function b(e) {
1648
+ if (e.hasChildren) {
1649
+ y(e.key);
1650
+ return;
1651
+ }
1652
+ e.value && d("select", e.value);
1653
+ }
1654
+ return s({ keyword: f }), (t, o) => (x(), i("aside", ft, [a("div", pt, [c(D(z), {
1655
+ modelValue: f.value,
1656
+ "onUpdate:modelValue": o[0] ||= (e) => f.value = e,
1657
+ size: "small",
1658
+ clearable: "",
1659
+ placeholder: "搜索通道",
1660
+ class: "ctc-video__search"
1661
+ }, {
1662
+ prefix: N(() => [c(D(R), null, {
1663
+ default: N(() => [c(D(he))]),
1664
+ _: 1
1665
+ })]),
1666
+ _: 1
1667
+ }, 8, ["modelValue"]), a("button", {
1668
+ type: "button",
1669
+ class: "ctc-video__icon-button",
1670
+ title: "收起通道列表",
1671
+ onClick: o[1] ||= (e) => d("toggle-collapsed")
1672
+ }, [c(D(R), null, {
1673
+ default: N(() => [c(D(K))]),
1674
+ _: 1
1675
+ })])]), c(D(ee), { class: "ctc-video__sidebar-body" }, {
1676
+ default: N(() => [(x(!0), i(e, null, C(v.value, (e) => (x(), i("button", {
1677
+ key: e.key,
1678
+ type: "button",
1679
+ class: h(["ctc-video__channel", {
1680
+ "is-active": e.value === u.activeChannel,
1681
+ "is-parent": e.hasChildren
1682
+ }]),
1683
+ style: _({ paddingLeft: `calc(var(--ctc-video-space) + ${e.depth} * var(--ctc-video-tree-indent))` }),
1684
+ onClick: (t) => b(e)
1685
+ }, [w(t.$slots, "channel", {
1686
+ channel: e.channel,
1687
+ node: e.node,
1688
+ row: e,
1689
+ active: e.value === u.activeChannel,
1690
+ depth: e.depth,
1691
+ online: e.online,
1692
+ hasChildren: e.hasChildren
1693
+ }, () => [
1694
+ e.hasChildren ? (x(), n(D(R), {
1695
+ key: 0,
1696
+ class: "ctc-video__channel-caret"
1697
+ }, {
1698
+ default: N(() => [e.open ? (x(), n(D(W), { key: 0 })) : (x(), n(D(se), { key: 1 }))]),
1699
+ _: 2
1700
+ }, 1024)) : (x(), n(D(R), {
1701
+ key: 1,
1702
+ class: "ctc-video__channel-icon"
1703
+ }, {
1704
+ default: N(() => [c(D(ge))]),
1705
+ _: 1
1706
+ })),
1707
+ a("span", ht, E(e.label), 1),
1708
+ e.online === void 0 ? r("", !0) : (x(), i("span", {
1709
+ key: 2,
1710
+ class: h(["ctc-video__dot", { "is-online": e.online }])
1711
+ }, null, 2))
1712
+ ])], 14, mt))), 128)), v.value.length === 0 ? (x(), i("div", gt, E(u.emptyText), 1)) : r("", !0)]),
1713
+ _: 3
1714
+ })]));
1715
+ }
1716
+ }), vt = { class: "ctc-video__toolbar" }, yt = {
1717
+ key: 0,
1718
+ class: "ctc-video__record-timer"
1719
+ }, bt = {
1720
+ type: "button",
1721
+ class: "ctc-video__tool-button ctc-video__rate-button",
1722
+ title: "播放速度"
1723
+ }, xt = ["onClick"], St = {
1724
+ type: "button",
1725
+ class: "ctc-video__tool-button",
1726
+ disabled: ""
1727
+ }, Ct = 150, wt = 5, Tt = /* @__PURE__ */ l({
1728
+ name: "CtcVideoToolbar",
1729
+ __name: "VideoToolbar",
1730
+ props: {
1731
+ channelName: {},
1732
+ fullscreenTarget: {},
1733
+ mode: {},
1734
+ video: {}
1735
+ },
1736
+ emits: ["notice", "reload"],
1737
+ setup(o, { emit: s }) {
1738
+ let l = o, u = s, d = [
1739
+ .5,
1740
+ 1,
1741
+ 1.5,
1742
+ 2,
1743
+ 4
1744
+ ], f = S(0), p = S(50), m = S(!1), g = S(!1), _ = S(1), b = S(!1), w = S(!1), O = S(0), k = null, A = null, F = null, I = null, L = [], z = 0, B = "video/webm", ee = t(() => f.value === 0 ? fe : ce), te = t(() => {
1745
+ let e = Math.floor(O.value / 60);
1746
+ return `${String(e).padStart(2, "0")}:${String(O.value % 60).padStart(2, "0")}`;
1747
+ });
1748
+ function V(e) {
1749
+ u("notice", e);
1750
+ }
1751
+ function re(e) {
1752
+ e.volume = f.value / 100, e.muted = f.value === 0;
1753
+ }
1754
+ function ie(e) {
1755
+ e.playbackRate = _.value;
1756
+ }
1757
+ function ae() {
1758
+ k && clearTimeout(k), m.value = !0;
1759
+ }
1760
+ function oe() {
1761
+ k && clearTimeout(k), k = setTimeout(() => {
1762
+ m.value = !1, k = null;
1763
+ }, Ct);
1764
+ }
1765
+ function U() {
1766
+ f.value > 0 ? (p.value = f.value, f.value = 0) : f.value = p.value || 50;
1767
+ }
1768
+ function W() {
1769
+ A && clearTimeout(A), g.value = !0;
1770
+ }
1771
+ function se() {
1772
+ A && clearTimeout(A), A = setTimeout(() => {
1773
+ g.value = !1, A = null;
1774
+ }, Ct);
1775
+ }
1776
+ function G(e) {
1777
+ _.value = e, g.value = !1, l.video && ie(l.video);
1778
+ }
1779
+ function K(e, t) {
1780
+ let n = l.channelName || "视频", r = (/* @__PURE__ */ new Date()).toISOString().replace(/[.:]/g, "-"), i = URL.createObjectURL(e), a = document.createElement("a");
1781
+ a.href = i, a.download = `${n}_${r}.${t}`, a.click(), URL.revokeObjectURL(i);
1782
+ }
1783
+ function ue() {
1784
+ let e = l.video;
1785
+ if (!e?.videoWidth) {
1786
+ V("视频未加载,无法截屏");
1787
+ return;
1788
+ }
1789
+ try {
1790
+ let t = document.createElement("canvas");
1791
+ t.width = e.videoWidth, t.height = e.videoHeight, t.getContext("2d")?.drawImage(e, 0, 0, t.width, t.height), t.toBlob((e) => {
1792
+ e ? K(e, "png") : V("截屏失败");
1793
+ }, "image/png");
1794
+ } catch {
1795
+ V("截屏失败");
1796
+ }
1797
+ }
1798
+ function de() {
1799
+ return [
1800
+ "video/mp4;codecs=avc1",
1801
+ "video/mp4;codecs=h264",
1802
+ "video/mp4",
1803
+ "video/webm;codecs=vp9",
1804
+ "video/webm;codecs=vp8",
1805
+ "video/webm"
1806
+ ].find((e) => MediaRecorder.isTypeSupported?.(e)) ?? "video/webm";
1807
+ }
1808
+ function he() {
1809
+ let e = l.video, t = e?.captureStream?.bind(e);
1810
+ if (!e || !t || typeof MediaRecorder > "u") {
1811
+ V("当前浏览器不支持录屏");
1812
+ return;
1813
+ }
1814
+ try {
1815
+ L = [], B = de(), I = new MediaRecorder(t(), { mimeType: B }), I.addEventListener("dataavailable", (e) => {
1816
+ e.data.size > 0 && L.push(e.data);
1817
+ }), I.addEventListener("stop", () => {
1818
+ if (Date.now() - z < wt * 1e3) V(`录制时长不足 ${wt} 秒,已取消保存`);
1819
+ else if (L.length > 0) {
1820
+ let e = B.startsWith("video/mp4") ? "mp4" : "webm";
1821
+ K(new Blob(L, { type: B }), e);
1822
+ }
1823
+ L = [], I = null;
1824
+ }), I.start(), z = Date.now(), O.value = 0, F = setInterval(() => {
1825
+ O.value = Math.floor((Date.now() - z) / 1e3);
1826
+ }, 1e3), w.value = !0;
1827
+ } catch {
1828
+ V("录屏启动失败");
1829
+ }
1830
+ }
1831
+ function ve() {
1832
+ I?.stop(), w.value = !1, F &&= (clearInterval(F), null);
1833
+ }
1834
+ function ye() {
1835
+ w.value ? ve() : he();
1836
+ }
1837
+ function be() {
1838
+ b.value = document.fullscreenElement === l.fullscreenTarget;
1839
+ }
1840
+ function xe() {
1841
+ let e = l.fullscreenTarget ?? l.video?.parentElement;
1842
+ e && (document.fullscreenElement ? document.exitFullscreen() : e.requestFullscreen());
1843
+ }
1844
+ return M(f, () => {
1845
+ l.video && re(l.video);
1846
+ }), M(() => l.video, (e) => {
1847
+ e && (re(e), ie(e));
1848
+ }, { immediate: !0 }), M(() => l.channelName, () => {
1849
+ _.value = 1, l.video && ie(l.video), w.value && ve();
1850
+ }), y(() => {
1851
+ document.addEventListener("fullscreenchange", be);
1852
+ }), v(() => {
1853
+ document.removeEventListener("fullscreenchange", be), w.value && ve(), k && clearTimeout(k), A && clearTimeout(A);
1854
+ }), (t, s) => (x(), i("div", vt, [
1855
+ a("div", {
1856
+ class: "ctc-video__tool",
1857
+ onMouseenter: ae,
1858
+ onMouseleave: oe
1859
+ }, [c(D(H), {
1860
+ content: f.value === 0 ? "取消静音" : "静音",
1861
+ placement: "top",
1862
+ "show-arrow": !1,
1863
+ teleported: !1,
1864
+ disabled: m.value
1865
+ }, {
1866
+ default: N(() => [a("button", {
1867
+ type: "button",
1868
+ class: "ctc-video__tool-button",
1869
+ onClick: U
1870
+ }, [c(D(R), null, {
1871
+ default: N(() => [(x(), n(T(ee.value)))]),
1872
+ _: 1
1873
+ })])]),
1874
+ _: 1
1875
+ }, 8, ["content", "disabled"]), P(a("div", {
1876
+ class: "ctc-video__popup",
1877
+ onMouseenter: ae,
1878
+ onMouseleave: oe
1879
+ }, [c(D(ne), {
1880
+ modelValue: f.value,
1881
+ "onUpdate:modelValue": s[0] ||= (e) => f.value = e,
1882
+ vertical: "",
1883
+ height: "80px",
1884
+ "show-tooltip": !1
1885
+ }, null, 8, ["modelValue"])], 544), [[j, m.value]])], 32),
1886
+ c(D(H), {
1887
+ content: "截屏",
1888
+ placement: "top",
1889
+ "show-arrow": !1,
1890
+ teleported: !1
1891
+ }, {
1892
+ default: N(() => [a("button", {
1893
+ type: "button",
1894
+ class: "ctc-video__tool-button",
1895
+ onClick: ue
1896
+ }, [c(D(R), null, {
1897
+ default: N(() => [c(D(le))]),
1898
+ _: 1
1899
+ })])]),
1900
+ _: 1
1901
+ }),
1902
+ c(D(H), {
1903
+ content: w.value ? "停止录屏" : "录屏",
1904
+ placement: "top",
1905
+ "show-arrow": !1,
1906
+ teleported: !1
1907
+ }, {
1908
+ default: N(() => [a("button", {
1909
+ type: "button",
1910
+ class: h(["ctc-video__tool-button", { "is-recording": w.value }]),
1911
+ onClick: ye
1912
+ }, [c(D(R), null, {
1913
+ default: N(() => [w.value ? (x(), n(D(_e), { key: 0 })) : (x(), n(D(ge), { key: 1 }))]),
1914
+ _: 1
1915
+ })], 2)]),
1916
+ _: 1
1917
+ }, 8, ["content"]),
1918
+ w.value ? (x(), i("span", yt, E(te.value), 1)) : r("", !0),
1919
+ o.mode === "playback" ? (x(), i("div", {
1920
+ key: 1,
1921
+ class: "ctc-video__tool",
1922
+ onMouseenter: W,
1923
+ onMouseleave: se
1924
+ }, [a("button", bt, E(_.value) + "x ", 1), P(a("div", {
1925
+ class: "ctc-video__popup ctc-video__rate-popup",
1926
+ onMouseenter: W,
1927
+ onMouseleave: se
1928
+ }, [(x(), i(e, null, C(d, (e) => a("button", {
1929
+ key: e,
1930
+ type: "button",
1931
+ class: h(["ctc-video__rate-option", { "is-active": e === _.value }]),
1932
+ onClick: (t) => G(e)
1933
+ }, E(e) + "x ", 11, xt)), 64))], 544), [[j, g.value]])], 32)) : r("", !0),
1934
+ o.mode === "live" ? (x(), n(D(H), {
1935
+ key: 2,
1936
+ content: "语音喊话(暂未开放)",
1937
+ placement: "top",
1938
+ "show-arrow": !1,
1939
+ teleported: !1
1940
+ }, {
1941
+ default: N(() => [a("button", St, [c(D(R), null, {
1942
+ default: N(() => [c(D(pe))]),
1943
+ _: 1
1944
+ })])]),
1945
+ _: 1
1946
+ })) : r("", !0),
1947
+ c(D(H), {
1948
+ content: b.value ? "退出全屏" : "全屏",
1949
+ placement: "top",
1950
+ "show-arrow": !1,
1951
+ teleported: !1
1952
+ }, {
1953
+ default: N(() => [a("button", {
1954
+ type: "button",
1955
+ class: "ctc-video__tool-button",
1956
+ onClick: xe
1957
+ }, [c(D(R), null, {
1958
+ default: N(() => [c(D(q))]),
1959
+ _: 1
1960
+ })])]),
1961
+ _: 1
1962
+ }, 8, ["content"]),
1963
+ c(D(H), {
1964
+ content: "刷新",
1965
+ placement: "top",
1966
+ "show-arrow": !1,
1967
+ teleported: !1
1968
+ }, {
1969
+ default: N(() => [a("button", {
1970
+ type: "button",
1971
+ class: "ctc-video__tool-button",
1972
+ onClick: s[1] ||= (e) => u("reload")
1973
+ }, [c(D(R), null, {
1974
+ default: N(() => [c(D(me))]),
1975
+ _: 1
1976
+ })])]),
1977
+ _: 1
1978
+ })
1979
+ ]));
1980
+ }
1981
+ }), Et = {
1982
+ key: 0,
1983
+ class: "ctc-video__header"
1984
+ }, Dt = { class: "ctc-video__header-title" }, Ot = {
1985
+ key: 2,
1986
+ class: "ctc-video__header-name"
1987
+ }, kt = {
1988
+ key: 2,
1989
+ class: "ctc-video__meta"
1990
+ }, At = { class: "ctc-video__meta-label" }, jt = ["title"], Mt = { class: "ctc-video__header-extra" }, Nt = { class: "ctc-video__body" }, Pt = { class: "ctc-video__stage" }, Ft = { class: "ctc-video__screen" }, It = [
1991
+ "autoplay",
1992
+ "loop",
1993
+ "muted"
1994
+ ], Lt = {
1995
+ key: 0,
1996
+ class: "ctc-video__overlay"
1997
+ }, Rt = {
1998
+ key: 1,
1999
+ class: "ctc-video__hint"
2000
+ }, zt = {
2001
+ key: 2,
2002
+ class: "ctc-video__rec"
2003
+ }, Bt = {
2004
+ key: 3,
2005
+ class: "ctc-video__stage-tip"
2006
+ }, Vt = { class: "ctc-video__stage-empty" }, Ht = 640, Ut = 480, Wt = /* @__PURE__ */ l({
2007
+ name: "CtcVideoPlayer",
2008
+ __name: "index",
2009
+ props: {
2010
+ activeChannel: { default: "" },
2011
+ alwaysShowSidebar: {
2012
+ type: Boolean,
2013
+ default: !1
2014
+ },
2015
+ alarms: { default: () => [] },
2016
+ beginTime: { default: "" },
2017
+ channels: { default: () => [] },
2018
+ compact: {
2019
+ type: Boolean,
2020
+ default: !1
2021
+ },
2022
+ emptyText: { default: "暂无视频通道" },
2023
+ endTime: { default: "" },
2024
+ headerFields: { default: () => [
2025
+ "outlet",
2026
+ "mp",
2027
+ "channel",
2028
+ "location"
2029
+ ] },
2030
+ mode: { default: "live" },
2031
+ showHeader: {
2032
+ type: Boolean,
2033
+ default: !1
2034
+ },
2035
+ showModeSwitch: {
2036
+ type: Boolean,
2037
+ default: !1
2038
+ },
2039
+ showSidebar: {
2040
+ type: Boolean,
2041
+ default: !0
2042
+ },
2043
+ showTimeline: {
2044
+ type: Boolean,
2045
+ default: !0
2046
+ },
2047
+ showToolbar: {
2048
+ type: Boolean,
2049
+ default: !0
2050
+ },
2051
+ source: {},
2052
+ timelineZoomModifier: { default: "none" },
2053
+ tree: {}
2054
+ },
2055
+ emits: [
2056
+ "update:activeChannel",
2057
+ "update:beginTime",
2058
+ "update:endTime",
2059
+ "update:mode",
2060
+ "channel-change",
2061
+ "playback-ended",
2062
+ "seek",
2063
+ "source-error"
2064
+ ],
2065
+ setup(l, { expose: d, emit: f }) {
2066
+ let p = l, _ = f, b = k(), T = S(p.activeChannel);
2067
+ M(() => p.activeChannel, (e) => {
2068
+ e !== T.value && (T.value = e);
2069
+ }), M(T, (e) => _("update:activeChannel", e)), M(() => p.channels, (e) => {
2070
+ e.length && (e.some((e) => e.id === T.value) || (T.value = e[0].id));
2071
+ }, { immediate: !0 });
2072
+ let O = t(() => p.channels.find((e) => e.id === T.value));
2073
+ M(O, (e) => _("channel-change", e));
2074
+ let A = S(p.mode);
2075
+ M(() => p.mode, (e) => {
2076
+ e !== A.value && (A.value = e);
2077
+ }), M(A, (e) => _("update:mode", e));
2078
+ let j = [{
2079
+ label: "实时监控",
2080
+ value: "live"
2081
+ }, {
2082
+ label: "历史回放",
2083
+ value: "playback"
2084
+ }], P = t({
2085
+ get: () => A.value,
2086
+ set: (e) => {
2087
+ A.value = e === "playback" ? "playback" : "live";
2088
+ }
2089
+ }), I = S(p.beginTime || (p.showModeSwitch ? Qe() : "")), L = S(p.endTime || (p.showModeSwitch ? Ze(/* @__PURE__ */ new Date()) : ""));
2090
+ M([() => p.beginTime, () => p.endTime], ([e, t]) => {
2091
+ I.value = e, L.value = t;
2092
+ }), M(I, (e) => _("update:beginTime", e)), M(L, (e) => _("update:endTime", e));
2093
+ let z = t({
2094
+ get: () => I.value && L.value ? [I.value.slice(0, 10), L.value.slice(0, 10)] : null,
2095
+ set: (e) => {
2096
+ e && (I.value = `${e[0]} 00:00:00`, L.value = `${e[1]} 23:59:59`);
2097
+ }
2098
+ });
2099
+ function B(e) {
2100
+ let t = null;
2101
+ return e instanceof Date ? t = e : typeof e?.toDate == "function" && (t = e.toDate()), t && !Number.isNaN(t.getTime()) ? t : null;
2102
+ }
2103
+ function ee(e) {
2104
+ return new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime();
2105
+ }
2106
+ function ne(e) {
2107
+ let t = B(e);
2108
+ return t ? ee(t) > ee(/* @__PURE__ */ new Date()) : !1;
2109
+ }
2110
+ let V = {
2111
+ channel: "通道",
2112
+ location: "位置",
2113
+ mp: "监测点",
2114
+ outlet: "排放口"
2115
+ }, re = t(() => p.headerFields.flatMap((e) => {
2116
+ let t = O.value, n = e === "channel" ? t?.name : e === "location" ? t?.location : e === "mp" ? t?.mpName : t?.outletName;
2117
+ return n ? [{
2118
+ label: V[e],
2119
+ value: n
2120
+ }] : [];
2121
+ })), H = t(() => p.showModeSwitch && p.channels.length > 0), ae = t(() => p.showHeader || H.value || !!b.title || !!b.extra || !!b.header), oe = t(() => p.showSidebar && (p.channels.length > 1 || p.alwaysShowSidebar || !!p.tree?.length)), U = S(!1), W = S(!1), ce = t(() => oe.value && !U.value), le = !1, G = 0, K = 0, q = null;
2122
+ function de() {
2123
+ U.value = !0;
2124
+ }
2125
+ function fe() {
2126
+ if (!G || !K) return;
2127
+ let e = K < Ht || G < Ut;
2128
+ e !== W.value && (W.value = e, e ? U.value ||= (le = !0, !0) : le && (le = !1, U.value = !1));
2129
+ }
2130
+ function pe() {
2131
+ K = window.innerWidth, fe();
2132
+ }
2133
+ let me = S({
2134
+ start: Q(I.value || "00:00"),
2135
+ end: Q(L.value || "24:00")
2136
+ });
2137
+ M([I, L], () => {
2138
+ me.value = {
2139
+ start: Q(I.value || "00:00"),
2140
+ end: Q(L.value || "24:00")
2141
+ };
2142
+ });
2143
+ let { cursorHour: he, error: _e, errorText: be, isSeekReload: xe, loading: J, onEnded: Se, onPause: Ce, onPlay: we, onPlaying: Te, reload: Ee, seekTo: De, togglePause: Oe, videoEl: ke } = lt({
2144
+ beginTime: () => I.value,
2145
+ channel: () => O.value,
2146
+ endTime: () => L.value,
2147
+ mode: () => A.value,
2148
+ onError: (e) => _("source-error", e),
2149
+ onPlaybackEnded: (e) => _("playback-ended", e),
2150
+ source: () => p.source
2151
+ }), Ae = S();
2152
+ function je() {
2153
+ let e = Ae.value, t = ke.value;
2154
+ if (e) {
2155
+ if (!t?.videoWidth) {
2156
+ e.width = 0, e.height = 0;
2157
+ return;
2158
+ }
2159
+ e.width = t.videoWidth, e.height = t.videoHeight, e.getContext("2d")?.drawImage(t, 0, 0, e.width, e.height);
2160
+ }
2161
+ }
2162
+ function Me(e) {
2163
+ je(), De(e), _("seek", {
2164
+ hour: e,
2165
+ beginTime: nt(I.value || "00:00", e)
2166
+ });
2167
+ }
2168
+ let { drawTimeline: Ne, onCanvasMouseLeave: Pe, onCanvasMouseMove: Y, onTimelineMouseDown: Fe, onTimelineWheel: Ie, onVideoTimeUpdate: Le, resetTimeline: Re, startSync: ze, timelineCanvas: Be } = dt({
2169
+ alarms: t(() => p.alarms),
2170
+ axisRange: me,
2171
+ availableEndHour: rt,
2172
+ getCursorHour: he,
2173
+ mode: A,
2174
+ onSeekHour: Me,
2175
+ videoRef: ke,
2176
+ zoomModifier: () => p.timelineZoomModifier
2177
+ });
2178
+ M([T, A], () => {
2179
+ Re(), m(Ne);
2180
+ }), M(Be, (e) => {
2181
+ e && m(Ne);
2182
+ });
2183
+ let Ve = t(() => be.value || (A.value === "playback" ? "该时段无录像" : "视频加载失败,请切换其他通道")), He = S(""), Ue = null;
2184
+ function We(e) {
2185
+ He.value = e, Ue && clearTimeout(Ue), Ue = setTimeout(() => {
2186
+ He.value = "", Ue = null;
2187
+ }, 2e3);
2188
+ }
2189
+ let X = S(), Ge = /* @__PURE__ */ new Set([
2190
+ "A",
2191
+ "BUTTON",
2192
+ "INPUT",
2193
+ "SELECT",
2194
+ "TEXTAREA"
2195
+ ]);
2196
+ function Ke(e) {
2197
+ if (e.code !== "Space" || e.repeat || A.value !== "playback" || J.value || _e.value) return;
2198
+ let t = e.target;
2199
+ t?.tagName && (t.isContentEditable || Ge.has(t.tagName) || X.value?.getClientRects().length && (e.preventDefault(), Oe()));
2200
+ }
2201
+ function qe() {
2202
+ we(), A.value === "playback" && ze();
2203
+ }
2204
+ function Je() {
2205
+ Te(), A.value === "playback" && m(ze);
2206
+ }
2207
+ function Ye() {
2208
+ A.value !== "playback" || J.value || _e.value || Oe();
2209
+ }
2210
+ function Xe(e) {
2211
+ p.channels.some((t) => t.id === e) && (T.value = e), W.value && de();
2212
+ }
2213
+ return y(() => {
2214
+ document.addEventListener("keydown", Ke);
2215
+ let e = X.value;
2216
+ e && (K = window.innerWidth, G = e.clientWidth, fe(), window.addEventListener("resize", pe), !(typeof ResizeObserver > "u") && (q = new ResizeObserver((t) => {
2217
+ G = t[0]?.contentRect.width ?? e.clientWidth, fe();
2218
+ }), q.observe(e)));
2219
+ }), v(() => {
2220
+ document.removeEventListener("keydown", Ke), window.removeEventListener("resize", pe), Ue && clearTimeout(Ue), q?.disconnect(), q = null;
2221
+ }), d({
2222
+ reload: Ee,
2223
+ seek: Me,
2224
+ videoRef: ke
2225
+ }), (t, l) => (x(), i("div", { class: h(["ctc-video", {
2226
+ "is-compact": p.compact,
2227
+ "is-narrow": W.value
2228
+ }]) }, [a("div", {
2229
+ ref_key: "panelRef",
2230
+ ref: X,
2231
+ class: "ctc-video__panel"
2232
+ }, [ae.value ? (x(), i("div", Et, [D(b).header ? w(t.$slots, "header", {
2233
+ channel: O.value,
2234
+ mode: A.value
2235
+ }, void 0, void 0, 0) : (x(), i(e, { key: 1 }, [
2236
+ a("div", Dt, [w(t.$slots, "title", {}, () => [A.value === "playback" ? (x(), n(D(ie), {
2237
+ key: 0,
2238
+ type: "primary",
2239
+ size: "small",
2240
+ effect: "plain",
2241
+ "disable-transitions": ""
2242
+ }, {
2243
+ default: N(() => [...l[11] ||= [s(" 回放 ", -1)]]),
2244
+ _: 1
2245
+ })) : O.value ? (x(), n(D(ie), {
2246
+ key: 1,
2247
+ type: O.value.online ? "success" : "danger",
2248
+ size: "small",
2249
+ effect: "plain",
2250
+ "disable-transitions": ""
2251
+ }, {
2252
+ default: N(() => [s(E(O.value.online ? "在线" : "离线"), 1)]),
2253
+ _: 1
2254
+ }, 8, ["type"])) : r("", !0), O.value ? (x(), i("span", Ot, E(O.value.name), 1)) : r("", !0)])]),
2255
+ H.value ? (x(), n(D(te), {
2256
+ key: 0,
2257
+ modelValue: P.value,
2258
+ "onUpdate:modelValue": l[0] ||= (e) => P.value = e,
2259
+ options: j,
2260
+ size: "small",
2261
+ class: "ctc-video__mode-switch"
2262
+ }, null, 8, ["modelValue"])) : r("", !0),
2263
+ H.value && A.value === "playback" ? (x(), n(D(F), {
2264
+ key: 1,
2265
+ modelValue: z.value,
2266
+ "onUpdate:modelValue": l[1] ||= (e) => z.value = e,
2267
+ type: "daterange",
2268
+ size: "small",
2269
+ "value-format": "YYYY-MM-DD",
2270
+ "range-separator": "至",
2271
+ "start-placeholder": "开始日期",
2272
+ "end-placeholder": "结束日期",
2273
+ clearable: !1,
2274
+ "disabled-date": ne,
2275
+ class: "ctc-video__range"
2276
+ }, null, 8, ["modelValue"])) : r("", !0),
2277
+ re.value.length > 0 ? (x(), i("div", kt, [(x(!0), i(e, null, C(re.value, (e) => (x(), i("span", {
2278
+ key: e.label,
2279
+ class: "ctc-video__meta-item"
2280
+ }, [a("span", At, E(e.label) + ":", 1), a("span", {
2281
+ class: "ctc-video__meta-value",
2282
+ title: e.value
2283
+ }, E(e.value), 9, jt)]))), 128))])) : r("", !0),
2284
+ a("div", Mt, [w(t.$slots, "extra")])
2285
+ ], 64))])) : r("", !0), a("div", Nt, [
2286
+ W.value && ce.value ? (x(), i("div", {
2287
+ key: 0,
2288
+ class: "ctc-video__sidebar-backdrop",
2289
+ onClick: de
2290
+ })) : r("", !0),
2291
+ oe.value && !U.value ? (x(), n(_t, {
2292
+ key: 1,
2293
+ "active-channel": T.value,
2294
+ channels: p.channels,
2295
+ "empty-text": p.emptyText,
2296
+ tree: p.tree,
2297
+ onSelect: Xe,
2298
+ onToggleCollapsed: l[2] ||= (e) => U.value = !0
2299
+ }, o({ _: 2 }, [D(b).channel ? {
2300
+ name: "channel",
2301
+ fn: N((e) => [w(t.$slots, "channel", g(u(e)))]),
2302
+ key: "0"
2303
+ } : void 0]), 1032, [
2304
+ "active-channel",
2305
+ "channels",
2306
+ "empty-text",
2307
+ "tree"
2308
+ ])) : r("", !0),
2309
+ a("div", Pt, [
2310
+ oe.value && U.value ? (x(), i("button", {
2311
+ key: 0,
2312
+ type: "button",
2313
+ class: "ctc-video__sidebar-reopen",
2314
+ title: "展开通道列表",
2315
+ onClick: l[3] ||= (e) => U.value = !1
2316
+ }, [c(D(R), null, {
2317
+ default: N(() => [c(D(se))]),
2318
+ _: 1
2319
+ })])) : r("", !0),
2320
+ a("div", Ft, [O.value ? (x(), i(e, { key: 0 }, [
2321
+ (x(), i("video", {
2322
+ ref_key: "videoEl",
2323
+ ref: ke,
2324
+ key: O.value.id,
2325
+ class: "ctc-video__video",
2326
+ autoplay: A.value !== "playback",
2327
+ loop: A.value !== "playback",
2328
+ muted: A.value !== "playback",
2329
+ playsinline: "",
2330
+ preload: "metadata",
2331
+ onClick: Ye,
2332
+ onEnded: l[4] ||= (...e) => D(Se) && D(Se)(...e),
2333
+ onPause: l[5] ||= (...e) => D(Ce) && D(Ce)(...e),
2334
+ onPlay: qe,
2335
+ onPlaying: Je,
2336
+ onTimeupdate: l[6] ||= (...e) => D(Le) && D(Le)(...e)
2337
+ }, null, 40, It)),
2338
+ a("canvas", {
2339
+ ref_key: "seekFrameCanvas",
2340
+ ref: Ae,
2341
+ class: h(["ctc-video__video ctc-video__seek-frame", { "is-visible": D(xe) && D(J) }])
2342
+ }, null, 2),
2343
+ D(J) ? (x(), i("div", Lt, [c(D(R), { class: "is-loading" }, {
2344
+ default: N(() => [c(D(ue))]),
2345
+ _: 1
2346
+ }), l[12] ||= s(" 正在加载视频... ", -1)])) : D(_e) ? (x(), i("div", Rt, [c(D(R), null, {
2347
+ default: N(() => [c(D(ye))]),
2348
+ _: 1
2349
+ }), s(" " + E(Ve.value), 1)])) : r("", !0),
2350
+ A.value === "live" && !D(J) && !D(_e) ? (x(), i("div", zt, " REC ")) : r("", !0),
2351
+ He.value ? (x(), i("div", Bt, E(He.value), 1)) : r("", !0),
2352
+ p.showToolbar && !D(J) && !D(_e) ? (x(), n(Tt, {
2353
+ key: 4,
2354
+ "channel-name": O.value.name,
2355
+ "fullscreen-target": X.value,
2356
+ mode: A.value,
2357
+ video: D(ke),
2358
+ onNotice: We,
2359
+ onReload: D(Ee)
2360
+ }, null, 8, [
2361
+ "channel-name",
2362
+ "fullscreen-target",
2363
+ "mode",
2364
+ "video",
2365
+ "onReload"
2366
+ ])) : r("", !0)
2367
+ ], 64)) : w(t.$slots, "empty", {}, () => [a("div", Vt, [c(D(R), null, {
2368
+ default: N(() => [A.value === "live" ? (x(), n(D(ge), { key: 0 })) : (x(), n(D(ve), { key: 1 }))]),
2369
+ _: 1
2370
+ }), a("span", null, E(p.emptyText), 1)])], void 0, 1)]),
2371
+ p.showTimeline && A.value === "playback" && O.value && !D(_e) && (!D(J) || D(xe)) ? (x(), i("canvas", {
2372
+ key: 1,
2373
+ ref_key: "timelineCanvas",
2374
+ ref: Be,
2375
+ class: "ctc-video__timeline",
2376
+ onMousedown: l[7] ||= (...e) => D(Fe) && D(Fe)(...e),
2377
+ onMousemove: l[8] ||= (...e) => D(Y) && D(Y)(...e),
2378
+ onMouseleave: l[9] ||= (...e) => D(Pe) && D(Pe)(...e),
2379
+ onWheel: l[10] ||= (...e) => D(Ie) && D(Ie)(...e)
2380
+ }, null, 544)) : r("", !0)
2381
+ ])
2382
+ ])], 512)], 2));
2383
+ }
2384
+ }), Gt = [
2385
+ De,
2386
+ Pe,
891
2387
  Y,
892
- Q
893
- ], $ = { install(e, t = {}) {
894
- e.provide(F, t), xe.forEach((t) => {
2388
+ He,
2389
+ Xe,
2390
+ Wt
2391
+ ], Kt = { install(e, t = {}) {
2392
+ e.provide(oe, t), Gt.forEach((t) => {
895
2393
  e.component(t.name ?? "", t);
896
2394
  });
897
2395
  } };
898
2396
  //#endregion
899
- export { $ as CtcComponentsUi, $ as default, H as CtcDialog, W as CtcDrawer, G as CtcFlex, Q as CtcReport, Y as CtcTable };
2397
+ export { Kt as CtcComponentsUi, Kt as default, De as CtcDialog, Pe as CtcDrawer, Y as CtcFlex, Xe as CtcReport, He as CtcTable, Wt as CtcVideoPlayer };