@emoo-ai/ui-vue 0.0.0-stage → 0.1.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.
Files changed (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +23 -2
  3. package/dist/components/EmooActionPill.vue.d.ts +13 -0
  4. package/dist/components/EmooActionSheet.vue.d.ts +36 -0
  5. package/dist/components/EmooAgentSelect.vue.d.ts +22 -0
  6. package/dist/components/EmooButton.vue.d.ts +32 -0
  7. package/dist/components/EmooCard.vue.d.ts +22 -0
  8. package/dist/components/EmooChips.vue.d.ts +27 -0
  9. package/dist/components/EmooChoice.vue.d.ts +51 -0
  10. package/dist/components/EmooColumnMenu.vue.d.ts +53 -0
  11. package/dist/components/EmooDrawer.vue.d.ts +41 -0
  12. package/dist/components/EmooEmpty.vue.d.ts +26 -0
  13. package/dist/components/EmooField.vue.d.ts +37 -0
  14. package/dist/components/EmooFieldGrid.vue.d.ts +19 -0
  15. package/dist/components/EmooGhostButton.vue.d.ts +17 -0
  16. package/dist/components/EmooGroupLabel.vue.d.ts +9 -0
  17. package/dist/components/EmooHistoryList.vue.d.ts +71 -0
  18. package/dist/components/EmooMemberRoleSelect.vue.d.ts +21 -0
  19. package/dist/components/EmooMemberSelect.vue.d.ts +22 -0
  20. package/dist/components/EmooMemberTag.vue.d.ts +22 -0
  21. package/dist/components/EmooMessage.vue.d.ts +33 -0
  22. package/dist/components/EmooNavMenu.vue.d.ts +35 -0
  23. package/dist/components/EmooNavSegmented.vue.d.ts +15 -0
  24. package/dist/components/EmooOptionRows.vue.d.ts +32 -0
  25. package/dist/components/EmooPagination.vue.d.ts +25 -0
  26. package/dist/components/EmooPopover.vue.d.ts +22 -0
  27. package/dist/components/EmooProgress.vue.d.ts +14 -0
  28. package/dist/components/EmooRoleSelect.vue.d.ts +24 -0
  29. package/dist/components/EmooSearchBox.vue.d.ts +35 -0
  30. package/dist/components/EmooSegmented.vue.d.ts +35 -0
  31. package/dist/components/EmooSidebarShell.vue.d.ts +30 -0
  32. package/dist/components/EmooSkeleton.vue.d.ts +22 -0
  33. package/dist/components/EmooSpinner.vue.d.ts +10 -0
  34. package/dist/components/EmooStatusTag.vue.d.ts +17 -0
  35. package/dist/components/EmooSwitcherPanel.vue.d.ts +23 -0
  36. package/dist/components/EmooTable.vue.d.ts +147 -0
  37. package/dist/components/EmooTagsInput.vue.d.ts +18 -0
  38. package/dist/components/EmooTooltip.vue.d.ts +25 -0
  39. package/dist/components/EmooUpload.vue.d.ts +40 -0
  40. package/dist/components/EmooValueDiff.vue.d.ts +7 -0
  41. package/dist/components/IconChatCirclePlus.vue.d.ts +3 -0
  42. package/dist/components/history-contract.d.ts +13 -0
  43. package/dist/components/select-contract.d.ts +29 -0
  44. package/dist/components/useRemoteOptions.d.ts +16 -0
  45. package/dist/components/useSelectedOptions.d.ts +8 -0
  46. package/dist/composables/useColumnPrefs.d.ts +84 -0
  47. package/dist/composables/useMessageScroll.d.ts +15 -0
  48. package/dist/composables/useSheetHeightDrag.d.ts +7 -0
  49. package/dist/constants.d.ts +4 -0
  50. package/dist/eslint.d.ts +18 -0
  51. package/dist/eslint.js +43 -0
  52. package/dist/global/SheetDragHandle.vue.d.ts +11 -0
  53. package/dist/icons.d.ts +414 -0
  54. package/dist/icons.js +153 -0
  55. package/dist/index.d.ts +59 -0
  56. package/dist/index.js +3710 -0
  57. package/dist/locales/cn.d.ts +73 -0
  58. package/dist/locales/en.d.ts +73 -0
  59. package/dist/locales/index.d.ts +4 -0
  60. package/dist/locales.js +151 -0
  61. package/dist/styles.css +1 -0
  62. package/dist/theme.d.ts +6 -0
  63. package/dist/utils/avatar-tint.d.ts +1 -0
  64. package/dist/utils/drawer-size.d.ts +2 -0
  65. package/package.json +46 -4
package/dist/index.js ADDED
@@ -0,0 +1,3710 @@
1
+ import { defineComponent as N, openBlock as t, createElementBlock as s, createBlock as x, resolveDynamicComponent as ze, createCommentVNode as S, createElementVNode as m, toDisplayString as g, withModifiers as le, normalizeClass as W, computed as V, unref as a, mergeProps as Ge, withCtx as w, createVNode as P, renderSlot as U, Fragment as D, renderList as J, createSlots as Se, reactive as wt, normalizeStyle as pe, createTextVNode as Z, ref as O, getCurrentInstance as Qt, onBeforeUnmount as at, nextTick as ke, shallowRef as eo, watch as we, useAttrs as Pe, onMounted as Xe, withDirectives as We, vShow as et, normalizeProps as Fe, guardReactiveProps as Ne, onUnmounted as St, useSlots as Ct, withKeys as qe, h as ve, onScopeDispose as $t } from "vue";
2
+ import { ElDrawer as Et, ElTooltip as to, ElSelect as Ae, ElOption as Ie, ElCheckboxGroup as Tt, ElCheckbox as lt, ElRadioGroup as xt, ElRadio as zt, ElDropdown as st, ElButton as Qe, ElInput as tt, ElDropdownMenu as oo, vLoading as ao, ElDropdownItem as lo, ElPopover as so, ElTag as no, ElTable as io, ElTableColumn as Ve } from "element-plus";
3
+ import { useI18n as me } from "vue-i18n";
4
+ import { PhX as nt, PhSpinner as ro, PhCaretUp as It, PhCaretDown as it, PhPushPinSlash as uo, PhArrowLineLeft as co, PhArrowLineRight as mo, PhEyeSlash as Rt, PhEye as vo, PhArrowCounterClockwise as Vt, PhMagnifyingGlass as fo, PhSlidersHorizontal as ho, PhDotsThree as Mt, PhCaretRight as je, PhArrowsVertical as po, PhCheck as Bt, PhCaretLeft as Dt, PhDotsSixVertical as _t, PhCaretUpDown as yo, PhPushPin as bo, PhUploadSimple as go, PhFileText as ko, PhArrowRight as $o } from "./icons.js";
5
+ import { primaryColorVars as _o } from "@emoo-ai/brand/colors";
6
+ import { AVATAR_TINT_PALETTE as ti, PRESET_COLORS as oi, avatarTintOf as ai, hexToRgbString as li, mixColor as si, primaryColorVars as ni } from "@emoo-ai/brand/colors";
7
+ import { emoouiMessages as ri } from "./locales.js";
8
+ const wo = { class: "emoo-action-pill__label" }, So = {
9
+ key: 1,
10
+ class: "emoo-action-pill__kbd"
11
+ }, Co = /* @__PURE__ */ N({
12
+ __name: "EmooActionPill",
13
+ props: {
14
+ icon: {},
15
+ label: {},
16
+ kbd: {}
17
+ },
18
+ emits: ["click"],
19
+ setup(e, { emit: i }) {
20
+ const o = i;
21
+ return (l, r) => (t(), s("button", {
22
+ type: "button",
23
+ class: "emoo-action-pill",
24
+ onClick: r[0] || (r[0] = (n) => o("click", n))
25
+ }, [
26
+ e.icon ? (t(), x(ze(e.icon), {
27
+ key: 0,
28
+ class: "emoo-action-pill__icon"
29
+ })) : S("", !0),
30
+ m("span", wo, g(e.label), 1),
31
+ e.kbd ? (t(), s("kbd", So, g(e.kbd), 1)) : S("", !0)
32
+ ]));
33
+ }
34
+ }), Y = (e, i) => {
35
+ const o = e.__vccOpts || e;
36
+ for (const [l, r] of i)
37
+ o[l] = r;
38
+ return o;
39
+ }, wn = /* @__PURE__ */ Y(Co, [["__scopeId", "data-v-f9e9873a"]]), Eo = /* @__PURE__ */ N({
40
+ __name: "SheetDragHandle",
41
+ props: {
42
+ dragging: { type: Boolean },
43
+ dense: { type: Boolean }
44
+ },
45
+ emits: ["dragstart"],
46
+ setup(e) {
47
+ return (i, o) => (t(), s("div", {
48
+ class: W(["sheet-drag-handle", { "is-dragging": e.dragging, "is-dense": e.dense }]),
49
+ "data-testid": "sheet-drag-handle",
50
+ onPointerdown: o[0] || (o[0] = le((l) => i.$emit("dragstart", l), ["prevent"]))
51
+ }, [...o[1] || (o[1] = [
52
+ m("span", { class: "sheet-drag-handle__bar" }, null, -1)
53
+ ])], 34));
54
+ }
55
+ }), Pt = /* @__PURE__ */ Y(Eo, [["__scopeId", "data-v-ef0108a1"]]), To = { class: "emoo-asheet" }, xo = {
56
+ key: 0,
57
+ class: "emoo-asheet__title"
58
+ }, zo = { class: "emoo-asheet__list" }, Io = ["disabled", "data-testid", "onClick"], Sn = /* @__PURE__ */ N({
59
+ inheritAttrs: !1,
60
+ __name: "EmooActionSheet",
61
+ props: {
62
+ modelValue: { type: Boolean },
63
+ items: {},
64
+ title: {},
65
+ cancelText: {}
66
+ },
67
+ emits: ["update:modelValue", "select", "cancel"],
68
+ setup(e, { emit: i }) {
69
+ const o = e, l = i, r = V({
70
+ get: () => o.modelValue,
71
+ set: (v) => l("update:modelValue", v)
72
+ });
73
+ function n(v, k) {
74
+ r.value = !1, l("select", v, k);
75
+ }
76
+ function p() {
77
+ r.value = !1, l("cancel");
78
+ }
79
+ return (v, k) => (t(), x(a(Et), Ge(v.$attrs, {
80
+ modelValue: r.value,
81
+ "onUpdate:modelValue": k[0] || (k[0] = (u) => r.value = u),
82
+ direction: "btt",
83
+ size: "auto",
84
+ "with-header": !1,
85
+ class: "emoo-action-sheet"
86
+ }), {
87
+ default: w(() => [
88
+ m("div", To, [
89
+ P(Pt),
90
+ e.title ? (t(), s("p", xo, g(e.title), 1)) : S("", !0),
91
+ m("div", zo, [
92
+ U(v.$slots, "default"),
93
+ v.$slots.default ? S("", !0) : (t(!0), s(D, { key: 0 }, J(e.items, (u, b) => (t(), s("button", {
94
+ key: u.key,
95
+ type: "button",
96
+ class: W(["emoo-asheet__item", { "is-danger": u.danger }]),
97
+ disabled: u.disabled,
98
+ "data-testid": u.testid,
99
+ onClick: (_) => n(u, b)
100
+ }, [
101
+ u.icon ? (t(), x(ze(u.icon), {
102
+ key: 0,
103
+ class: "emoo-asheet__ic"
104
+ })) : S("", !0),
105
+ m("span", null, g(u.label), 1)
106
+ ], 10, Io))), 128))
107
+ ]),
108
+ e.cancelText ? (t(), s("button", {
109
+ key: 1,
110
+ type: "button",
111
+ class: "emoo-asheet__cancel",
112
+ "data-testid": "emoo-asheet-cancel",
113
+ onClick: p
114
+ }, g(e.cancelText), 1)) : S("", !0)
115
+ ])
116
+ ]),
117
+ _: 3
118
+ }, 16, ["modelValue"]));
119
+ }
120
+ }), he = /* @__PURE__ */ N({
121
+ __name: "EmooTooltip",
122
+ props: {
123
+ showAfter: { default: 300 },
124
+ placement: { default: "top" },
125
+ popperClass: { default: "" }
126
+ },
127
+ setup(e) {
128
+ const i = e, o = V(() => ["emo-tip", i.popperClass].filter(Boolean).join(" "));
129
+ return (l, r) => (t(), x(a(to), Ge(l.$attrs, {
130
+ placement: e.placement,
131
+ "show-after": e.showAfter,
132
+ "popper-class": o.value
133
+ }), Se({
134
+ default: w(() => [
135
+ U(l.$slots, "default")
136
+ ]),
137
+ _: 2
138
+ }, [
139
+ l.$slots.content ? {
140
+ name: "content",
141
+ fn: w(() => [
142
+ U(l.$slots, "content")
143
+ ]),
144
+ key: "0"
145
+ } : void 0
146
+ ]), 1040, ["placement", "show-after", "popper-class"]));
147
+ }
148
+ }), Ro = { class: "emoo-mtags" }, Vo = ["src", "onError"], Mo = { class: "emoo-mtag__name" }, Bo = ["aria-label", "onClick"], Do = {
149
+ class: "emoo-mtag emoo-mtag--more",
150
+ "data-testid": "emoo-mtag-more"
151
+ }, Po = /* @__PURE__ */ N({
152
+ __name: "EmooMemberTag",
153
+ props: {
154
+ items: {},
155
+ max: { default: 2 },
156
+ removable: { type: Boolean, default: !1 },
157
+ square: { type: Boolean, default: !1 }
158
+ },
159
+ emits: ["remove"],
160
+ setup(e) {
161
+ const { t: i } = me(), o = e, l = V(() => o.items.slice(0, o.max)), r = wt(/* @__PURE__ */ new Set()), n = V(() => Math.max(0, o.items.length - o.max)), p = V(() => o.items.slice(o.max).map((v) => v.name).join("、"));
162
+ return (v, k) => (t(), s("span", Ro, [
163
+ (t(!0), s(D, null, J(l.value, (u, b) => (t(), s("span", {
164
+ key: `${u.name}-${b}`,
165
+ class: "emoo-mtag",
166
+ style: pe({ "--tint": u.color || "var(--el-color-primary)" })
167
+ }, [
168
+ m("span", {
169
+ class: W(["emoo-mtag__avatar", { "is-square": u.square || e.square }]),
170
+ "aria-hidden": "true"
171
+ }, [
172
+ u.avatar && !r.has(b) ? (t(), s("img", {
173
+ key: 0,
174
+ src: u.avatar,
175
+ alt: "",
176
+ class: "emoo-mtag__img",
177
+ onError: (_) => r.add(b)
178
+ }, null, 40, Vo)) : (t(), s(D, { key: 1 }, [
179
+ Z(g(u.name[0]), 1)
180
+ ], 64))
181
+ ], 2),
182
+ m("span", Mo, g(u.name), 1),
183
+ e.removable ? (t(), s("button", {
184
+ key: 0,
185
+ type: "button",
186
+ class: "emoo-mtag__x",
187
+ "aria-label": a(i)("common.emooMemberTag.remove", { name: u.name }),
188
+ onClick: (_) => v.$emit("remove", b)
189
+ }, [
190
+ P(a(nt), { size: 10 })
191
+ ], 8, Bo)) : S("", !0)
192
+ ], 4))), 128)),
193
+ n.value > 0 ? (t(), x(he, {
194
+ key: 0,
195
+ content: p.value
196
+ }, {
197
+ default: w(() => [
198
+ m("span", Do, "+" + g(n.value), 1)
199
+ ]),
200
+ _: 1
201
+ }, 8, ["content"])) : S("", !0)
202
+ ]));
203
+ }
204
+ }), xe = /* @__PURE__ */ Y(Po, [["__scopeId", "data-v-33f4fffc"]]);
205
+ function Me(e, i) {
206
+ const o = O([]), l = O(!1), r = O(!0), n = O(null), p = `${i}-${Qt()?.uid ?? Math.random().toString(36).slice(2)}`, v = `${i} ${p}`;
207
+ let k = 1, u = "", b, _ = null, y = 0, R = null;
208
+ const E = (q) => new Promise((de) => setTimeout(de, q)), $ = () => {
209
+ y++, l.value = !1, _ && (clearTimeout(_), _ = null);
210
+ }, z = async (q, de, ce) => {
211
+ const H = e();
212
+ if (!H) return;
213
+ const te = ++y;
214
+ l.value = !0, n.value = null;
215
+ try {
216
+ const F = await H(de, q);
217
+ if (te !== y || e() !== H) return;
218
+ k = q, u = de, b = H, o.value = I(ce ? o.value : [], F.items), r.value = F.hasMore, R = null;
219
+ } catch (F) {
220
+ te === y && e() === H && (n.value = F, R = { target: q, keyword: de, append: ce }, console.error("选择器远程选项加载失败:", F));
221
+ } finally {
222
+ te === y && (l.value = !1);
223
+ }
224
+ }, I = (q, de) => {
225
+ const ce = new Set(q.map((te) => te.id)), H = [...q];
226
+ for (const te of de)
227
+ ce.has(te.id) || (ce.add(te.id), H.push(te));
228
+ return H;
229
+ }, j = (q) => {
230
+ $(), n.value = null, _ = setTimeout(() => {
231
+ _ = null, z(1, q.trim(), !1);
232
+ }, 300);
233
+ }, X = () => {
234
+ const q = e();
235
+ l.value || !q || (b !== q || o.value.length === 0 || u !== "") && z(1, "", !1);
236
+ }, ie = () => {
237
+ if (!R || l.value) return;
238
+ const { target: q, keyword: de, append: ce } = R;
239
+ z(q, de, ce);
240
+ }, ee = () => {
241
+ const q = e();
242
+ if (!(l.value || !q)) {
243
+ if (b !== q) return void X();
244
+ r.value && z(k + 1, u, !0);
245
+ }
246
+ };
247
+ let d = null, T = null;
248
+ const B = () => {
249
+ const q = document.querySelector(`.${p}`);
250
+ return q?.querySelector(".el-select-dropdown__wrap") || q?.querySelector(".el-scrollbar__wrap");
251
+ }, se = () => {
252
+ d && T && d.removeEventListener("scroll", T), d = null, T = null;
253
+ }, ne = async () => {
254
+ await ke();
255
+ let q = null;
256
+ for (let de = 0; de < 6 && (q = B(), !q); de++)
257
+ await E(50);
258
+ !q || q === d || (se(), d = q, T = () => {
259
+ d && d.scrollTop + d.clientHeight >= d.scrollHeight - 16 && ee();
260
+ }, d.addEventListener("scroll", T, { passive: !0 }));
261
+ }, ye = (q) => {
262
+ if (!q) {
263
+ $(), se();
264
+ return;
265
+ }
266
+ X(), ne();
267
+ };
268
+ return at(() => {
269
+ $(), se();
270
+ }), { items: o, loading: l, hasMore: r, error: n, search: j, retry: ie, ensureFirstPage: X, loadMore: ee, onVisibleChange: ye, popperClass: v };
271
+ }
272
+ function Be(e, i, o) {
273
+ const l = eo([]), r = (k) => Array.isArray(k) ? k : k == null ? [] : [k], n = (k) => {
274
+ const u = new Map([...l.value, ...o(), ...i()].map((b) => [b.id, b]));
275
+ return l.value = r(k).map((b) => u.get(b)).filter((b) => b !== void 0), l.value;
276
+ };
277
+ we(() => [e(), i(), o()], () => n(e()), { immediate: !0, deep: !0, flush: "sync" });
278
+ const p = V(() => {
279
+ const k = i();
280
+ return [...l.value.filter((u) => !k.some((b) => b.id === u.id)), ...k];
281
+ }), v = V(() => r(e()).map((k) => l.value.find((u) => u.id === k)).filter((k) => k !== void 0));
282
+ return { mergedOptions: p, selectedOptions: v, remember: n };
283
+ }
284
+ const Ao = { class: "emoo-asel__opt" }, Lo = { class: "emoo-asel__avatar" }, Oo = ["src"], Uo = { class: "emoo-asel__name" }, Ho = {
285
+ key: 0,
286
+ class: "emoo-asel__sub"
287
+ }, Ko = {
288
+ class: "emoo-sel-remote-error",
289
+ role: "alert",
290
+ "data-testid": "remote-error"
291
+ }, Wo = /* @__PURE__ */ N({
292
+ __name: "EmooAgentSelect",
293
+ props: {
294
+ modelValue: {},
295
+ options: {},
296
+ source: {},
297
+ selected: {},
298
+ multiple: { type: Boolean, default: !1 },
299
+ placeholder: {},
300
+ clearable: { type: Boolean, default: !0 },
301
+ collapse: { default: 2 }
302
+ },
303
+ emits: ["update:modelValue"],
304
+ setup(e, { emit: i }) {
305
+ const o = e, l = i, { t: r } = me(), n = V(() => o.source !== void 0), { items: p, loading: v, error: k, retry: u, search: b, ensureFirstPage: _, onVisibleChange: y, popperClass: R } = Me(() => o.source, "emoo-asel-popper"), { mergedOptions: E, selectedOptions: $, remember: z } = Be(
306
+ () => o.modelValue,
307
+ () => n.value ? p.value : o.options ?? [],
308
+ () => o.selected ?? []
309
+ ), I = (d) => E.value.find((T) => T.id === d), j = Pe(), X = V(() => j.disabled !== void 0 && j.disabled !== !1);
310
+ Xe(() => {
311
+ const d = o.modelValue, T = Array.isArray(d) ? d.length > 0 : d != null, B = Array.isArray(d) ? d : [d];
312
+ n.value && T && B.some((se) => se !== null && !I(se)) && _();
313
+ });
314
+ const ie = (d) => {
315
+ z(d), l("update:modelValue", d);
316
+ }, ee = (d) => {
317
+ if (X.value) return;
318
+ const T = $.value[d]?.id;
319
+ T !== void 0 && ie(o.modelValue.filter((B) => B !== T));
320
+ };
321
+ return (d, T) => (t(), x(a(Ae), {
322
+ class: "emoo-asel",
323
+ "model-value": e.modelValue,
324
+ multiple: e.multiple,
325
+ placeholder: e.placeholder || a(r)("common.emooSelect.agentPlaceholder"),
326
+ clearable: !e.multiple && e.clearable,
327
+ filterable: "",
328
+ "fit-input-width": "",
329
+ remote: n.value,
330
+ "remote-method": a(b),
331
+ loading: a(v),
332
+ "popper-class": a(R),
333
+ "onUpdate:modelValue": ie,
334
+ onVisibleChange: a(y)
335
+ }, Se({
336
+ default: w(() => [
337
+ (t(!0), s(D, null, J(a(E), (B) => (t(), x(a(Ie), {
338
+ key: B.id,
339
+ label: B.name,
340
+ value: B.id
341
+ }, {
342
+ default: w(() => [
343
+ m("span", Ao, [
344
+ m("span", Lo, [
345
+ B.avatar ? (t(), s("img", {
346
+ key: 0,
347
+ src: B.avatar,
348
+ alt: "",
349
+ class: "emoo-asel__img"
350
+ }, null, 8, Oo)) : (t(), s(D, { key: 1 }, [
351
+ Z(g(B.name[0]), 1)
352
+ ], 64))
353
+ ]),
354
+ m("span", Uo, g(B.name), 1),
355
+ B.sub ? (t(), s("span", Ho, g(B.sub), 1)) : S("", !0)
356
+ ])
357
+ ]),
358
+ _: 2
359
+ }, 1032, ["label", "value"]))), 128))
360
+ ]),
361
+ _: 2
362
+ }, [
363
+ e.multiple ? {
364
+ name: "tag",
365
+ fn: w(() => [
366
+ P(xe, {
367
+ square: "",
368
+ items: a($),
369
+ max: e.collapse,
370
+ removable: !X.value,
371
+ onRemove: ee
372
+ }, null, 8, ["items", "max", "removable"])
373
+ ]),
374
+ key: "1"
375
+ } : {
376
+ name: "label",
377
+ fn: w(({ value: B }) => [
378
+ I(B) ? (t(), x(xe, {
379
+ key: 0,
380
+ square: "",
381
+ items: [I(B)]
382
+ }, null, 8, ["items"])) : S("", !0)
383
+ ]),
384
+ key: "0"
385
+ },
386
+ a(k) ? {
387
+ name: "footer",
388
+ fn: w(() => [
389
+ m("div", Ko, [
390
+ m("span", null, g(a(r)("common.emooSelect.loadFailed")), 1),
391
+ m("button", {
392
+ type: "button",
393
+ "data-testid": "remote-retry",
394
+ onClick: T[0] || (T[0] = //@ts-ignore
395
+ (...B) => a(u) && a(u)(...B))
396
+ }, g(a(r)("common.emooSelect.retry")), 1)
397
+ ])
398
+ ]),
399
+ key: "2"
400
+ } : void 0
401
+ ]), 1032, ["model-value", "multiple", "placeholder", "clearable", "remote", "remote-method", "loading", "popper-class", "onVisibleChange"]));
402
+ }
403
+ }), Cn = /* @__PURE__ */ Y(Wo, [["__scopeId", "data-v-465d3a49"]]), Fo = ["type", "disabled", "aria-busy"], No = {
404
+ key: 0,
405
+ class: "emoo-button__icon",
406
+ "aria-hidden": "true"
407
+ }, qo = /* @__PURE__ */ N({
408
+ __name: "EmooButton",
409
+ props: {
410
+ variant: { default: "secondary" },
411
+ size: { default: "default" },
412
+ type: { default: "button" },
413
+ disabled: { type: Boolean, default: !1 },
414
+ loading: { type: Boolean, default: !1 },
415
+ iconOnly: { type: Boolean, default: !1 },
416
+ circle: { type: Boolean, default: !1 }
417
+ },
418
+ setup(e) {
419
+ return (i, o) => (t(), s("button", {
420
+ class: W(["emoo-button", [
421
+ `emoo-button--${e.variant}`,
422
+ `emoo-button--${e.size}`,
423
+ { "emoo-button--icon-only": e.iconOnly, "emoo-button--circle": e.circle }
424
+ ]]),
425
+ type: e.type,
426
+ disabled: e.disabled || e.loading,
427
+ "aria-busy": e.loading || void 0
428
+ }, [
429
+ e.loading || i.$slots.icon ? (t(), s("span", No, [
430
+ e.loading ? (t(), x(a(ro), {
431
+ key: 0,
432
+ class: "emoo-button__spinner"
433
+ })) : U(i.$slots, "icon", {}, void 0, !0, 1)
434
+ ])) : S("", !0),
435
+ U(i.$slots, "default", {}, void 0, !0)
436
+ ], 10, Fo));
437
+ }
438
+ }), De = /* @__PURE__ */ Y(qo, [["__scopeId", "data-v-6415e495"]]), jo = { class: "emoo-card" }, Go = {
439
+ key: 0,
440
+ class: "emoo-card__header"
441
+ }, Xo = {
442
+ key: 1,
443
+ class: "emoo-card__footer"
444
+ }, Jo = /* @__PURE__ */ N({
445
+ __name: "EmooCard",
446
+ props: {
447
+ flush: { type: Boolean, default: !1 }
448
+ },
449
+ setup(e) {
450
+ return (i, o) => (t(), s("div", jo, [
451
+ i.$slots.header ? (t(), s("div", Go, [
452
+ U(i.$slots, "header", {}, void 0, !0)
453
+ ])) : S("", !0),
454
+ m("div", {
455
+ class: W(["emoo-card__body", { "emoo-card__body--flush": e.flush }])
456
+ }, [
457
+ U(i.$slots, "default", {}, void 0, !0)
458
+ ], 2),
459
+ i.$slots.footer ? (t(), s("div", Xo, [
460
+ U(i.$slots, "footer", {}, void 0, !0)
461
+ ])) : S("", !0)
462
+ ]));
463
+ }
464
+ }), En = /* @__PURE__ */ Y(Jo, [["__scopeId", "data-v-4fffe6bc"]]), Yo = ["data-testid"], Zo = {
465
+ key: 0,
466
+ class: "emoo-chips__more",
467
+ "data-testid": "emoo-chips-more"
468
+ }, Qo = { name: "EmooChips" }, ea = /* @__PURE__ */ N({
469
+ ...Qo,
470
+ props: {
471
+ items: {},
472
+ labelOf: {},
473
+ gap: { default: 10 }
474
+ },
475
+ setup(e) {
476
+ const i = e, o = O(), l = O([]), r = O(i.items.length), n = O(0), p = V(() => i.items.map(i.labelOf).join("、")), v = 40, k = () => {
477
+ const _ = l.value, y = o.value?.clientWidth ?? 0;
478
+ if (!_.length || y <= 0) {
479
+ r.value = i.items.length, n.value = 0;
480
+ return;
481
+ }
482
+ const R = _.map((I) => I.offsetWidth);
483
+ if (R.reduce((I, j) => I + j, 0) + i.gap * (_.length - 1) <= y) {
484
+ r.value = _.length, n.value = 0;
485
+ return;
486
+ }
487
+ let $ = 0, z = 0;
488
+ for (const I of R) {
489
+ const j = z === 0 ? I : $ + i.gap + I;
490
+ if (j > y - v) break;
491
+ $ = j, z++;
492
+ }
493
+ r.value = Math.max(1, z), n.value = _.length - r.value;
494
+ }, u = () => {
495
+ r.value = i.items.length, ke(k);
496
+ };
497
+ let b = null;
498
+ return Xe(() => {
499
+ ke(k), setTimeout(u, 400), o.value && (b = new ResizeObserver(u), b.observe(o.value));
500
+ }), at(() => b?.disconnect()), we(() => i.items, u), (_, y) => (t(), x(he, {
501
+ content: p.value,
502
+ disabled: n.value === 0
503
+ }, {
504
+ default: w(() => [
505
+ m("div", {
506
+ ref_key: "wrapRef",
507
+ ref: o,
508
+ class: "emoo-chips",
509
+ style: pe({ gap: `${e.gap}px` })
510
+ }, [
511
+ (t(!0), s(D, null, J(e.items, (R, E) => We((t(), s("span", {
512
+ key: E,
513
+ ref_for: !0,
514
+ ref_key: "chipRefs",
515
+ ref: l,
516
+ class: "emoo-chips__chip",
517
+ "data-testid": `emoo-chips-chip-${E}`
518
+ }, [
519
+ U(_.$slots, "default", {
520
+ item: R,
521
+ index: E
522
+ }, void 0, !0)
523
+ ], 8, Yo)), [
524
+ [et, E < r.value]
525
+ ])), 128)),
526
+ n.value > 0 ? (t(), s("span", Zo, "+" + g(n.value), 1)) : S("", !0)
527
+ ], 4)
528
+ ]),
529
+ _: 3
530
+ }, 8, ["content", "disabled"]));
531
+ }
532
+ }), Tn = /* @__PURE__ */ Y(ea, [["__scopeId", "data-v-1c5db445"]]), ta = /* @__PURE__ */ N({
533
+ __name: "EmooChoice",
534
+ props: {
535
+ options: {},
536
+ modelValue: {},
537
+ multiple: { type: Boolean, default: !1 },
538
+ disabled: { type: Boolean, default: !1 },
539
+ clearable: { type: Boolean, default: !1 },
540
+ placeholder: {},
541
+ ariaLabel: {},
542
+ testid: {}
543
+ },
544
+ emits: ["update:modelValue"],
545
+ setup(e, { emit: i }) {
546
+ const o = e, l = i, r = Pe(), n = V(() => Array.isArray(o.modelValue) ? o.modelValue.length > 0 : o.modelValue !== void 0 && o.modelValue !== null), p = (b) => {
547
+ !b.currentTarget.contains(b.relatedTarget) && typeof r.onBlur == "function" && r.onBlur(b);
548
+ }, v = () => {
549
+ const b = o.multiple ? [] : void 0;
550
+ l("update:modelValue", b), typeof r.onChange == "function" && r.onChange(b), typeof r.onClear == "function" && r.onClear();
551
+ }, k = (b, _) => {
552
+ !o.clearable || o.disabled || b.disabled || o.modelValue !== b.value || (_.preventDefault(), _.stopPropagation(), v());
553
+ }, u = (b) => {
554
+ o.multiple && Array.isArray(b) ? l("update:modelValue", b.filter(
555
+ (_) => typeof _ == "string" || typeof _ == "number" || typeof _ == "boolean"
556
+ )) : !o.multiple && (typeof b == "string" || typeof b == "number" || typeof b == "boolean" || o.clearable && b === void 0) && l("update:modelValue", b);
557
+ };
558
+ return (b, _) => e.options.length > 4 ? (t(), x(a(Ae), {
559
+ key: 0,
560
+ class: "emoo-choice",
561
+ "model-value": e.modelValue ?? (e.multiple ? [] : void 0),
562
+ multiple: e.multiple,
563
+ disabled: e.disabled,
564
+ clearable: e.clearable,
565
+ placeholder: e.placeholder,
566
+ "aria-label": e.ariaLabel || e.placeholder,
567
+ "collapse-tags": "",
568
+ "collapse-tags-tooltip": "",
569
+ "max-collapse-tags": 2,
570
+ "empty-values": [null, void 0],
571
+ "value-on-clear": void 0,
572
+ "onUpdate:modelValue": u
573
+ }, Se({
574
+ default: w(() => [
575
+ (t(!0), s(D, null, J(e.options, (y) => (t(), x(a(Ie), {
576
+ key: `${typeof y.value}:${y.value}`,
577
+ value: y.value,
578
+ label: y.label,
579
+ disabled: y.disabled,
580
+ "data-testid": e.testid ? `${e.testid}-${String(y.value)}` : void 0
581
+ }, {
582
+ default: w(() => [
583
+ U(b.$slots, "option", { option: y }, () => [
584
+ Z(g(y.label), 1)
585
+ ], !0)
586
+ ]),
587
+ _: 2
588
+ }, 1032, ["value", "label", "disabled", "data-testid"]))), 128))
589
+ ]),
590
+ _: 2
591
+ }, [
592
+ b.$slots.label ? {
593
+ name: "label",
594
+ fn: w((y) => [
595
+ U(b.$slots, "label", Fe(Ne(y)), void 0, !0)
596
+ ]),
597
+ key: "0"
598
+ } : void 0,
599
+ b.$slots.prefix ? {
600
+ name: "prefix",
601
+ fn: w(() => [
602
+ U(b.$slots, "prefix", {}, void 0, !0)
603
+ ]),
604
+ key: "1"
605
+ } : void 0,
606
+ b.$slots.tag ? {
607
+ name: "tag",
608
+ fn: w((y) => [
609
+ U(b.$slots, "tag", Fe(Ne(y)), void 0, !0)
610
+ ]),
611
+ key: "2"
612
+ } : void 0
613
+ ]), 1032, ["model-value", "multiple", "disabled", "clearable", "placeholder", "aria-label"])) : e.multiple ? (t(), x(a(Tt), {
614
+ key: 1,
615
+ class: "emoo-choice emoo-choice--inline",
616
+ "model-value": Array.isArray(e.modelValue) ? e.modelValue : [],
617
+ disabled: e.disabled,
618
+ "aria-label": e.ariaLabel || e.placeholder,
619
+ "onUpdate:modelValue": u,
620
+ onFocusout: p
621
+ }, {
622
+ default: w(() => [
623
+ (t(!0), s(D, null, J(e.options, (y) => (t(), x(a(lt), {
624
+ key: `${typeof y.value}:${y.value}`,
625
+ value: y.value,
626
+ disabled: y.disabled,
627
+ "data-testid": e.testid ? `${e.testid}-${String(y.value)}` : void 0
628
+ }, {
629
+ default: w(() => [
630
+ U(b.$slots, "option", { option: y }, () => [
631
+ Z(g(y.label), 1)
632
+ ], !0)
633
+ ]),
634
+ _: 2
635
+ }, 1032, ["value", "disabled", "data-testid"]))), 128)),
636
+ e.clearable && n.value ? (t(), x(De, {
637
+ key: 0,
638
+ variant: "text",
639
+ size: "small",
640
+ circle: "",
641
+ disabled: e.disabled,
642
+ "aria-label": b.$t("common.emooSelect.clearSelection"),
643
+ onClick: le(v, ["stop"])
644
+ }, {
645
+ default: w(() => [
646
+ P(a(nt), { size: 12 })
647
+ ]),
648
+ _: 1
649
+ }, 8, ["disabled", "aria-label"])) : S("", !0)
650
+ ]),
651
+ _: 3
652
+ }, 8, ["model-value", "disabled", "aria-label"])) : (t(), x(a(xt), {
653
+ key: 2,
654
+ class: "emoo-choice emoo-choice--inline",
655
+ "model-value": Array.isArray(e.modelValue) ? void 0 : e.modelValue ?? void 0,
656
+ disabled: e.disabled,
657
+ "aria-label": e.ariaLabel || e.placeholder,
658
+ "onUpdate:modelValue": u,
659
+ onFocusout: p
660
+ }, {
661
+ default: w(() => [
662
+ (t(!0), s(D, null, J(e.options, (y) => (t(), x(a(zt), {
663
+ key: `${typeof y.value}:${y.value}`,
664
+ value: y.value,
665
+ disabled: y.disabled,
666
+ "data-testid": e.testid ? `${e.testid}-${String(y.value)}` : void 0,
667
+ onClickCapture: (R) => k(y, R)
668
+ }, {
669
+ default: w(() => [
670
+ U(b.$slots, "option", { option: y }, () => [
671
+ Z(g(y.label), 1)
672
+ ], !0)
673
+ ]),
674
+ _: 2
675
+ }, 1032, ["value", "disabled", "data-testid", "onClickCapture"]))), 128))
676
+ ]),
677
+ _: 3
678
+ }, 8, ["model-value", "disabled", "aria-label"]));
679
+ }
680
+ }), oa = /* @__PURE__ */ Y(ta, [["__scopeId", "data-v-d18fb571"]]), aa = { class: "emt-colmenu__list" }, la = ["data-testid"], sa = ["data-testid"], na = ["data-testid"], ia = ["data-testid"], ra = ["data-testid"], da = ["disabled", "data-testid"], ua = { class: "emt-colmenu__section" }, ca = ["data-testid", "onClick"], ma = /* @__PURE__ */ N({
681
+ __name: "EmooColumnMenu",
682
+ props: {
683
+ colKey: {},
684
+ sortable: { type: [Boolean, String], default: !1 },
685
+ sorted: { default: null },
686
+ pinsEnabled: { type: Boolean, default: !1 },
687
+ fixed: { default: "" },
688
+ canHide: { type: Boolean, default: !0 },
689
+ hidden: { default: () => [] },
690
+ resettable: { type: Boolean, default: !1 }
691
+ },
692
+ emits: ["sort", "unpin", "pin", "hide", "restore", "reset"],
693
+ setup(e, { emit: i }) {
694
+ const o = i, { t: l } = me();
695
+ return (r, n) => (t(), x(a(st), {
696
+ trigger: "click",
697
+ placement: "bottom-end",
698
+ "popper-class": "emt-colmenu"
699
+ }, {
700
+ dropdown: w(() => [
701
+ m("div", aa, [
702
+ e.sortable ? (t(), s(D, { key: 0 }, [
703
+ m("button", {
704
+ class: W(["emt-colmenu__item", { "is-on": e.sorted === "ascending" }]),
705
+ type: "button",
706
+ "data-testid": `emcm-sort-asc-${e.colKey}`,
707
+ onClick: n[0] || (n[0] = (p) => o("sort", "ascending"))
708
+ }, [
709
+ P(a(It), {
710
+ size: 13,
711
+ weight: "bold",
712
+ "aria-hidden": "true"
713
+ }),
714
+ Z(g(a(l)("common.emooTable.sortAsc")), 1)
715
+ ], 10, la),
716
+ m("button", {
717
+ class: W(["emt-colmenu__item", { "is-on": e.sorted === "descending" }]),
718
+ type: "button",
719
+ "data-testid": `emcm-sort-desc-${e.colKey}`,
720
+ onClick: n[1] || (n[1] = (p) => o("sort", "descending"))
721
+ }, [
722
+ P(a(it), {
723
+ size: 13,
724
+ weight: "bold",
725
+ "aria-hidden": "true"
726
+ }),
727
+ Z(g(a(l)("common.emooTable.sortDesc")), 1)
728
+ ], 10, sa),
729
+ n[7] || (n[7] = m("div", { class: "emt-colmenu__divider" }, null, -1))
730
+ ], 64)) : S("", !0),
731
+ e.pinsEnabled ? (t(), s(D, { key: 1 }, [
732
+ e.fixed ? (t(), s("button", {
733
+ key: 0,
734
+ class: "emt-colmenu__item",
735
+ type: "button",
736
+ "data-testid": `emcm-unpin-${e.colKey}`,
737
+ onClick: n[2] || (n[2] = (p) => o("unpin"))
738
+ }, [
739
+ P(a(uo), {
740
+ size: 14,
741
+ "aria-hidden": "true"
742
+ }),
743
+ Z(g(a(l)("common.emooTable.unpin")), 1)
744
+ ], 8, na)) : (t(), s(D, { key: 1 }, [
745
+ m("button", {
746
+ class: "emt-colmenu__item",
747
+ type: "button",
748
+ "data-testid": `emcm-pin-left-${e.colKey}`,
749
+ onClick: n[3] || (n[3] = (p) => o("pin", "left"))
750
+ }, [
751
+ P(a(co), {
752
+ size: 14,
753
+ "aria-hidden": "true"
754
+ }),
755
+ Z(g(a(l)("common.emooTable.pinLeftThrough")), 1)
756
+ ], 8, ia),
757
+ m("button", {
758
+ class: "emt-colmenu__item",
759
+ type: "button",
760
+ "data-testid": `emcm-pin-right-${e.colKey}`,
761
+ onClick: n[4] || (n[4] = (p) => o("pin", "right"))
762
+ }, [
763
+ P(a(mo), {
764
+ size: 14,
765
+ "aria-hidden": "true"
766
+ }),
767
+ Z(g(a(l)("common.emooTable.pinRightFrom")), 1)
768
+ ], 8, ra)
769
+ ], 64)),
770
+ n[8] || (n[8] = m("div", { class: "emt-colmenu__divider" }, null, -1))
771
+ ], 64)) : S("", !0),
772
+ U(r.$slots, "extra"),
773
+ m("button", {
774
+ class: "emt-colmenu__item",
775
+ type: "button",
776
+ disabled: !e.canHide,
777
+ "data-testid": `emcm-hide-${e.colKey}`,
778
+ onClick: n[5] || (n[5] = (p) => o("hide"))
779
+ }, [
780
+ P(a(Rt), {
781
+ size: 14,
782
+ "aria-hidden": "true"
783
+ }),
784
+ Z(g(a(l)("common.emooTable.hideColumn")), 1)
785
+ ], 8, da),
786
+ e.hidden.length ? (t(), s(D, { key: 2 }, [
787
+ n[9] || (n[9] = m("div", { class: "emt-colmenu__divider" }, null, -1)),
788
+ m("div", ua, g(a(l)("common.emooTable.hiddenColumns")), 1),
789
+ (t(!0), s(D, null, J(e.hidden, (p) => (t(), s("button", {
790
+ key: p.key,
791
+ class: "emt-colmenu__item",
792
+ type: "button",
793
+ "data-testid": `emcm-restore-${p.key}`,
794
+ onClick: le((v) => o("restore", p.key), ["stop"])
795
+ }, [
796
+ P(a(vo), {
797
+ size: 14,
798
+ "aria-hidden": "true"
799
+ }),
800
+ Z(g(p.label), 1)
801
+ ], 8, ca))), 128))
802
+ ], 64)) : S("", !0),
803
+ e.resettable ? (t(), s(D, { key: 3 }, [
804
+ n[10] || (n[10] = m("div", { class: "emt-colmenu__divider" }, null, -1)),
805
+ m("button", {
806
+ class: "emt-colmenu__item",
807
+ type: "button",
808
+ "data-testid": "emt-reset-prefs",
809
+ onClick: n[6] || (n[6] = le((p) => o("reset"), ["stop"]))
810
+ }, [
811
+ P(a(Vt), {
812
+ size: 14,
813
+ "aria-hidden": "true"
814
+ }),
815
+ Z(g(a(l)("common.emooTable.resetPrefs")), 1)
816
+ ])
817
+ ], 64)) : S("", !0)
818
+ ])
819
+ ]),
820
+ default: w(() => [
821
+ U(r.$slots, "default")
822
+ ]),
823
+ _: 3
824
+ }));
825
+ }
826
+ }), Je = {
827
+ DRAWER_WIDTHS: "emoo-drawer-widths",
828
+ DRAWER_HEIGHTS: "emoo-drawer-heights"
829
+ }, va = 360, At = 0.98;
830
+ function Lt() {
831
+ try {
832
+ const e = localStorage.getItem(Je.DRAWER_WIDTHS), i = e ? JSON.parse(e) : {};
833
+ return typeof i == "object" && i !== null ? i : {};
834
+ } catch {
835
+ return {};
836
+ }
837
+ }
838
+ function fa(e, i) {
839
+ const o = Lt()[e];
840
+ return typeof o != "number" || Number.isNaN(o) ? i : `${Math.round(Math.min(Math.max(o, va), window.innerWidth * At))}px`;
841
+ }
842
+ function ha(e, i) {
843
+ try {
844
+ const o = Math.min(Math.round(i), Math.round(window.innerWidth * At));
845
+ localStorage.setItem(
846
+ Je.DRAWER_WIDTHS,
847
+ JSON.stringify({ ...Lt(), [e]: o })
848
+ );
849
+ } catch {
850
+ }
851
+ }
852
+ const Ot = [0.6, 0.85, 1], pa = 0.08, ya = 250;
853
+ function Ut() {
854
+ try {
855
+ const e = localStorage.getItem(Je.DRAWER_HEIGHTS), i = e ? JSON.parse(e) : {};
856
+ return typeof i == "object" && i !== null ? i : {};
857
+ } catch {
858
+ return {};
859
+ }
860
+ }
861
+ function ba(e, i) {
862
+ try {
863
+ localStorage.setItem(
864
+ Je.DRAWER_HEIGHTS,
865
+ JSON.stringify({ ...Ut(), [e]: i })
866
+ );
867
+ } catch {
868
+ }
869
+ }
870
+ function ga(e) {
871
+ return Ot.reduce((i, o) => Math.abs(o - e) < Math.abs(i - e) ? o : i);
872
+ }
873
+ function ka(e, i) {
874
+ const o = Ut()[e], l = typeof o == "number" && o > 0 && o <= 1 ? o : i, r = O(l), n = O(null), p = V(() => n.value === null ? `${Math.round(r.value * 100)}%` : `${n.value}px`), v = O(!1), k = O(!1);
875
+ let u = 0, b = 0, _ = !1, y;
876
+ function R() {
877
+ y !== void 0 && clearTimeout(y), y = void 0, k.value = !1, n.value = null;
878
+ }
879
+ function E(I) {
880
+ _ = !0;
881
+ const j = b + (u - I.clientY);
882
+ n.value = Math.round(Math.min(Math.max(j, Ot[0] * window.innerHeight), window.innerHeight));
883
+ }
884
+ function $() {
885
+ if (window.removeEventListener("pointermove", E), window.removeEventListener("pointerup", $), window.removeEventListener("pointercancel", $), v.value = !1, !_) {
886
+ n.value = null;
887
+ return;
888
+ }
889
+ const I = n.value / window.innerHeight, j = ga(I), X = Math.abs(j - I) <= pa;
890
+ if (r.value = X ? j : Math.round(I * 100) / 100, ba(e, r.value), !X) {
891
+ n.value = null;
892
+ return;
893
+ }
894
+ k.value = !0, requestAnimationFrame(() => {
895
+ n.value = Math.round(j * window.innerHeight), y = setTimeout(R, ya);
896
+ });
897
+ }
898
+ function z(I) {
899
+ I.button !== void 0 && I.button !== 0 || (R(), v.value = !0, _ = !1, u = I.clientY, b = r.value * window.innerHeight, n.value = Math.round(b), window.addEventListener("pointermove", E), window.addEventListener("pointerup", $), window.addEventListener("pointercancel", $));
900
+ }
901
+ return St(() => {
902
+ window.removeEventListener("pointermove", E), window.removeEventListener("pointerup", $), window.removeEventListener("pointercancel", $), y !== void 0 && clearTimeout(y);
903
+ }), { size: p, dragging: v, animating: k, onDragStart: z };
904
+ }
905
+ const $a = {
906
+ key: 0,
907
+ class: "emoo-drawer__sheet"
908
+ }, _a = { class: "emoo-drawer__sheet-content" }, xn = /* @__PURE__ */ N({
909
+ inheritAttrs: !1,
910
+ __name: "EmooDrawer",
911
+ props: {
912
+ modelValue: { type: Boolean },
913
+ scene: {},
914
+ size: { default: "80%" },
915
+ isMobile: { type: Boolean, default: !1 },
916
+ direction: {},
917
+ mobileRatio: { default: 0.9 },
918
+ mobileFull: { type: Boolean, default: !1 },
919
+ flush: { type: Boolean, default: !1 }
920
+ },
921
+ emits: ["update:modelValue", "resize-end"],
922
+ setup(e, { emit: i }) {
923
+ const o = e, l = i, r = V({
924
+ get: () => o.modelValue,
925
+ set: (y) => l("update:modelValue", y)
926
+ }), n = V(() => o.isMobile && !!o.scene && !o.mobileFull), { size: p, dragging: v, animating: k, onDragStart: u } = ka(
927
+ o.scene ?? "__emoo-no-scene__",
928
+ o.mobileRatio
929
+ ), b = V(() => o.isMobile ? n.value ? p.value : o.direction === "rtl" || o.direction === "ltr" ? o.size : "100%" : o.scene ? fa(o.scene, o.size) : o.size);
930
+ function _(y, R) {
931
+ o.scene && ha(o.scene, R), l("resize-end", y, R);
932
+ }
933
+ return (y, R) => (t(), x(a(Et), Ge(y.$attrs, {
934
+ modelValue: r.value,
935
+ "onUpdate:modelValue": R[0] || (R[0] = (E) => r.value = E),
936
+ class: ["emoo-drawer", {
937
+ "emoo-drawer--flush": e.flush,
938
+ "is-sheet": n.value,
939
+ "sheet-height-animating": n.value && a(k)
940
+ }],
941
+ size: b.value,
942
+ direction: e.direction ?? (e.isMobile ? "btt" : "rtl"),
943
+ resizable: !e.isMobile && !!e.scene,
944
+ onResizeEnd: _
945
+ }), Se({
946
+ default: w(() => [
947
+ n.value ? (t(), s("div", $a, [
948
+ P(Pt, {
949
+ dragging: a(v),
950
+ onDragstart: a(u)
951
+ }, null, 8, ["dragging", "onDragstart"]),
952
+ m("div", _a, [
953
+ U(y.$slots, "default")
954
+ ])
955
+ ])) : U(y.$slots, "default", {}, void 0, void 0, 1)
956
+ ]),
957
+ _: 2
958
+ }, [
959
+ y.$slots.header ? {
960
+ name: "header",
961
+ fn: w(() => [
962
+ U(y.$slots, "header")
963
+ ]),
964
+ key: "0"
965
+ } : void 0,
966
+ y.$slots.footer ? {
967
+ name: "footer",
968
+ fn: w(() => [
969
+ U(y.$slots, "footer")
970
+ ]),
971
+ key: "1"
972
+ } : void 0
973
+ ]), 1040, ["modelValue", "class", "size", "direction", "resizable"]));
974
+ }
975
+ }), wa = {
976
+ key: 0,
977
+ class: "emoo-empty__stage",
978
+ "aria-hidden": "true"
979
+ }, Sa = {
980
+ key: 1,
981
+ class: "emoo-empty__title"
982
+ }, Ca = {
983
+ key: 2,
984
+ class: "emoo-empty__desc"
985
+ }, Ea = {
986
+ key: 3,
987
+ class: "emoo-empty__actions"
988
+ }, Ta = /* @__PURE__ */ N({
989
+ __name: "EmooEmpty",
990
+ props: {
991
+ variant: { default: "stage" },
992
+ icon: {},
993
+ title: {},
994
+ description: {},
995
+ tone: { default: "invite" },
996
+ size: { default: "md" }
997
+ },
998
+ setup(e) {
999
+ return (i, o) => (t(), s("div", {
1000
+ class: W(["emoo-empty", e.variant === "mini" ? "is-mini" : [`is-${e.size}`, { "is-neutral": e.tone === "neutral" }]]),
1001
+ "data-testid": "emoo-empty"
1002
+ }, [
1003
+ e.variant === "stage" ? (t(), s(D, { key: 0 }, [
1004
+ e.icon ? (t(), s("span", wa, [
1005
+ (t(), x(ze(e.icon), { weight: "duotone" }))
1006
+ ])) : S("", !0),
1007
+ e.title ? (t(), s("p", Sa, g(e.title), 1)) : S("", !0),
1008
+ e.description ? (t(), s("p", Ca, g(e.description), 1)) : S("", !0),
1009
+ i.$slots.actions ? (t(), s("div", Ea, [
1010
+ U(i.$slots, "actions", {}, void 0, !0)
1011
+ ])) : S("", !0)
1012
+ ], 64)) : (t(), s(D, { key: 1 }, [
1013
+ Z(g(e.title), 1)
1014
+ ], 64))
1015
+ ], 2));
1016
+ }
1017
+ }), xa = /* @__PURE__ */ Y(Ta, [["__scopeId", "data-v-e50a5864"]]), za = ["id", "for"], Ia = { class: "emoo-field__body" }, Ra = ["data-testid"], Va = ["id"], Ma = ["id", "data-testid"], Ba = /* @__PURE__ */ N({
1018
+ __name: "EmooField",
1019
+ props: {
1020
+ id: {},
1021
+ label: {},
1022
+ required: { type: Boolean, default: !1 },
1023
+ labelTone: { default: "default" },
1024
+ help: {},
1025
+ error: {},
1026
+ text: {},
1027
+ mode: { default: "edit" },
1028
+ span: { default: 1 },
1029
+ testid: {}
1030
+ },
1031
+ setup(e) {
1032
+ const i = e, o = V(() => i.id ? `${i.id}-control` : void 0), l = V(() => i.id ? `${i.id}-label` : void 0), r = V(() => i.id ? `${i.id}-help` : void 0), n = V(() => i.id ? `${i.id}-error` : void 0), p = V(
1033
+ () => [i.error && n.value, i.help && r.value].filter(Boolean).join(" ") || void 0
1034
+ ), v = V(() => {
1035
+ if (!(i.span === 1 || i.span === void 0))
1036
+ return i.span === "full" ? "is-span-full" : `is-span-${Math.min(4, Math.max(1, i.span))}`;
1037
+ });
1038
+ return (k, u) => e.mode !== "hidden" ? (t(), s("div", {
1039
+ key: 0,
1040
+ class: W(["emoo-field", [`is-${e.mode}`, v.value, { "is-required": e.required && e.mode === "edit" }]])
1041
+ }, [
1042
+ e.label ? (t(), s("label", {
1043
+ key: 0,
1044
+ id: l.value,
1045
+ for: o.value || void 0,
1046
+ class: W(["emoo-field__label", { "is-danger": e.labelTone === "danger" }])
1047
+ }, g(e.label), 11, za)) : S("", !0),
1048
+ m("div", Ia, [
1049
+ e.mode === "view" ? (t(), s("div", {
1050
+ key: 0,
1051
+ class: "emoo-field__value",
1052
+ "data-testid": e.testid ? `${e.testid}-value` : void 0
1053
+ }, [
1054
+ U(k.$slots, "view", {}, () => [
1055
+ Z(g(e.text), 1)
1056
+ ], !0)
1057
+ ], 8, Ra)) : U(k.$slots, "default", {
1058
+ id: o.value || void 0,
1059
+ describedBy: p.value,
1060
+ invalid: !!e.error,
1061
+ testid: e.testid ? `${e.testid}-control` : void 0
1062
+ }, void 0, !0, 1),
1063
+ e.help && e.mode === "edit" ? (t(), s("p", {
1064
+ key: 2,
1065
+ id: r.value,
1066
+ class: "emoo-field__help"
1067
+ }, g(e.help), 9, Va)) : S("", !0),
1068
+ e.error && e.mode === "edit" ? (t(), s("p", {
1069
+ key: 3,
1070
+ id: n.value,
1071
+ class: "emoo-field__error",
1072
+ role: "alert",
1073
+ "data-testid": e.testid ? `${e.testid}-error` : void 0
1074
+ }, g(e.error), 9, Ma)) : S("", !0)
1075
+ ])
1076
+ ], 2)) : S("", !0);
1077
+ }
1078
+ }), zn = /* @__PURE__ */ Y(Ba, [["__scopeId", "data-v-54a72611"]]), Da = ["aria-label"], Pa = /* @__PURE__ */ N({
1079
+ __name: "EmooFieldGrid",
1080
+ props: {
1081
+ ariaLabel: {},
1082
+ inset: { type: Boolean, default: !1 }
1083
+ },
1084
+ setup(e) {
1085
+ return (i, o) => (t(), s("div", {
1086
+ class: W(["emoo-field-grid", { "is-inset": e.inset }]),
1087
+ role: "group",
1088
+ "aria-label": e.ariaLabel
1089
+ }, [
1090
+ U(i.$slots, "default", {}, void 0, !0)
1091
+ ], 10, Da));
1092
+ }
1093
+ }), In = /* @__PURE__ */ Y(Pa, [["__scopeId", "data-v-12f1e7e0"]]), Aa = /* @__PURE__ */ N({
1094
+ __name: "EmooGhostButton",
1095
+ props: {
1096
+ pill: { type: Boolean },
1097
+ touch: { type: Boolean }
1098
+ },
1099
+ setup(e) {
1100
+ return (i, o) => (t(), s("button", {
1101
+ type: "button",
1102
+ class: W(["emoo-ghost-btn", { "is-pill": e.pill, "is-touch": e.touch }])
1103
+ }, [
1104
+ U(i.$slots, "default", {}, void 0, !0)
1105
+ ], 2));
1106
+ }
1107
+ }), Rn = /* @__PURE__ */ Y(Aa, [["__scopeId", "data-v-d0346949"]]), La = /* @__PURE__ */ N({
1108
+ __name: "EmooGroupLabel",
1109
+ props: {
1110
+ title: {},
1111
+ first: { type: Boolean, default: !1 }
1112
+ },
1113
+ setup(e) {
1114
+ const { t: i } = me();
1115
+ return (o, l) => (t(), s("p", {
1116
+ class: W(["emoo-group-label", { "is-first": e.first }])
1117
+ }, [
1118
+ m("span", null, g(a(i)(e.title)), 1)
1119
+ ], 2));
1120
+ }
1121
+ }), Vn = /* @__PURE__ */ Y(La, [["__scopeId", "data-v-0135d501"]]), Oa = { class: "emoo-skel__lines" }, Ua = { class: "emoo-skel__head" }, Ha = {
1122
+ key: 4,
1123
+ class: "emoo-skel__pill-row"
1124
+ }, Ka = { class: "emoo-skel__detail" }, Wa = { class: "emoo-skel__lines" }, Fa = /* @__PURE__ */ N({
1125
+ __name: "EmooSkeleton",
1126
+ props: {
1127
+ variant: { default: "lines" },
1128
+ lines: { default: 3 },
1129
+ rows: { default: 4 },
1130
+ tiles: { default: 4 },
1131
+ height: { default: 260 },
1132
+ pills: { default: 4 },
1133
+ cols: { default: 4 },
1134
+ cells: { default: 8 }
1135
+ },
1136
+ setup(e) {
1137
+ return (i, o) => (t(), s("div", {
1138
+ class: W(["emoo-skel", `is-${e.variant}`]),
1139
+ "aria-hidden": "true"
1140
+ }, [
1141
+ e.variant === "lines" ? (t(!0), s(D, { key: 0 }, J(e.lines, (l) => (t(), s("span", {
1142
+ key: l,
1143
+ class: W(["emoo-skel__bone emoo-skel__line", { "is-tail": l === e.lines }])
1144
+ }, null, 2))), 128)) : e.variant === "list" ? (t(!0), s(D, { key: 1 }, J(e.rows, (l) => (t(), s("div", {
1145
+ key: l,
1146
+ class: "emoo-skel__item"
1147
+ }, [
1148
+ o[0] || (o[0] = m("span", { class: "emoo-skel__bone emoo-skel__avatar" }, null, -1)),
1149
+ m("span", Oa, [
1150
+ m("span", {
1151
+ class: "emoo-skel__bone emoo-skel__line",
1152
+ style: pe({ width: `${52 - l * 8}%` })
1153
+ }, null, 4),
1154
+ m("span", {
1155
+ class: "emoo-skel__bone emoo-skel__line is-thin",
1156
+ style: pe({ width: `${78 - l * 10}%` })
1157
+ }, null, 4)
1158
+ ])
1159
+ ]))), 128)) : e.variant === "table" ? (t(), s(D, { key: 2 }, [
1160
+ m("span", Ua, [
1161
+ (t(), s(D, null, J(["18%", "26%", "14%", "22%"], (l, r) => m("span", {
1162
+ key: r,
1163
+ class: "emoo-skel__bone emoo-skel__cell",
1164
+ style: pe({ width: l })
1165
+ }, null, 4)), 64))
1166
+ ]),
1167
+ (t(!0), s(D, null, J(e.rows, (l) => (t(), s("span", {
1168
+ key: l,
1169
+ class: "emoo-skel__row"
1170
+ }, [
1171
+ (t(), s(D, null, J(["18%", "26%", "14%", "22%"], (r, n) => m("span", {
1172
+ key: n,
1173
+ class: "emoo-skel__bone emoo-skel__cell",
1174
+ style: pe({ width: r })
1175
+ }, null, 4)), 64))
1176
+ ]))), 128))
1177
+ ], 64)) : e.variant === "tiles" ? (t(!0), s(D, { key: 3 }, J(e.tiles, (l) => (t(), s("div", {
1178
+ key: l,
1179
+ class: "emoo-skel__tile"
1180
+ }, [...o[1] || (o[1] = [
1181
+ m("span", {
1182
+ class: "emoo-skel__bone emoo-skel__line is-thin",
1183
+ style: { width: "56%" }
1184
+ }, null, -1),
1185
+ m("span", { class: "emoo-skel__bone emoo-skel__tile-value" }, null, -1)
1186
+ ])]))), 128)) : e.variant === "pills" ? (t(), s("div", Ha, [
1187
+ (t(!0), s(D, null, J(e.pills, (l) => (t(), s("span", {
1188
+ key: l,
1189
+ class: "emoo-skel__bone emoo-skel__pill"
1190
+ }))), 128))
1191
+ ])) : e.variant === "grid" ? (t(), s("div", {
1192
+ key: 5,
1193
+ class: "emoo-skel__grid",
1194
+ style: pe({ gridTemplateColumns: `repeat(${e.cols}, 1fr)` })
1195
+ }, [
1196
+ (t(!0), s(D, null, J(e.cells, (l) => (t(), s("div", {
1197
+ key: l,
1198
+ class: "emoo-skel__cell"
1199
+ }, [...o[2] || (o[2] = [
1200
+ m("span", { class: "emoo-skel__bone emoo-skel__cell-icon" }, null, -1),
1201
+ m("span", { class: "emoo-skel__bone emoo-skel__cell-label" }, null, -1)
1202
+ ])]))), 128))
1203
+ ], 4)) : e.variant === "chart" ? (t(), s(D, { key: 6 }, [
1204
+ o[3] || (o[3] = m("span", { class: "emoo-skel__bone emoo-skel__title" }, null, -1)),
1205
+ m("span", {
1206
+ class: "emoo-skel__bone emoo-skel__chart",
1207
+ style: pe({ height: `${e.height}px` })
1208
+ }, null, 4)
1209
+ ], 64)) : (t(), s(D, { key: 7 }, [
1210
+ o[5] || (o[5] = m("span", { class: "emoo-skel__bone emoo-skel__title" }, null, -1)),
1211
+ m("span", Ka, [
1212
+ m("span", Wa, [
1213
+ (t(!0), s(D, null, J(e.lines, (l) => (t(), s("span", {
1214
+ key: l,
1215
+ class: W(["emoo-skel__bone emoo-skel__line", { "is-tail": l === e.lines }])
1216
+ }, null, 2))), 128))
1217
+ ]),
1218
+ o[4] || (o[4] = m("span", { class: "emoo-skel__bone emoo-skel__media" }, null, -1))
1219
+ ])
1220
+ ], 64))
1221
+ ], 2));
1222
+ }
1223
+ }), Na = /* @__PURE__ */ Y(Fa, [["__scopeId", "data-v-9e0a33de"]]), qa = ["aria-label"], ja = /* @__PURE__ */ N({
1224
+ __name: "EmooSpinner",
1225
+ props: {
1226
+ size: { default: 20 },
1227
+ label: { default: "加载中" }
1228
+ },
1229
+ setup(e) {
1230
+ return (i, o) => (t(), s("span", {
1231
+ class: "emoo-spinner",
1232
+ style: pe({ width: `${e.size}px`, height: `${e.size}px` }),
1233
+ role: "status",
1234
+ "aria-label": e.label
1235
+ }, [...o[0] || (o[0] = [
1236
+ m("svg", {
1237
+ viewBox: "0 0 20 20",
1238
+ fill: "none",
1239
+ "aria-hidden": "true"
1240
+ }, [
1241
+ m("circle", {
1242
+ class: "emoo-spinner__arc",
1243
+ cx: "10",
1244
+ cy: "10",
1245
+ r: "8",
1246
+ "stroke-dasharray": "37.7 12.57"
1247
+ })
1248
+ ], -1)
1249
+ ])], 12, qa));
1250
+ }
1251
+ }), Ht = /* @__PURE__ */ Y(ja, [["__scopeId", "data-v-d168f9f3"]]), Ga = {
1252
+ class: "emoo-history-list",
1253
+ "data-testid": "emoo-history-list"
1254
+ }, Xa = {
1255
+ key: 0,
1256
+ class: "history-float"
1257
+ }, Ja = ["data-item-id", "tabindex", "onClick", "onFocus", "onKeydown"], Ya = { class: "history-name" }, Za = { key: 0 }, Qa = {
1258
+ key: 1,
1259
+ class: "status-indicator",
1260
+ "data-testid": "chat-status-indicator"
1261
+ }, el = {
1262
+ key: 1,
1263
+ class: "status-dot"
1264
+ }, tl = /* @__PURE__ */ N({
1265
+ __name: "EmooHistoryList",
1266
+ props: {
1267
+ groups: {},
1268
+ activeId: { default: null },
1269
+ keyword: { default: "" },
1270
+ loading: { type: Boolean, default: !1 },
1271
+ anyRecord: { type: Boolean, default: !0 },
1272
+ selectable: { type: Boolean, default: !1 },
1273
+ selectedIds: { default: () => [] },
1274
+ batchBusy: { type: Boolean, default: !1 },
1275
+ searchPlaceholder: { default: void 0 },
1276
+ selectLabel: { default: void 0 },
1277
+ emptyTitle: { default: void 0 },
1278
+ noMatchTitle: { default: void 0 }
1279
+ },
1280
+ emits: ["update:keyword", "update:selectedIds", "select", "load-more", "delete", "rename"],
1281
+ setup(e, { expose: i, emit: o }) {
1282
+ const l = e, r = o, { t: n } = me(), p = V(() => l.searchPlaceholder ?? n("common.emooHistory.searchPlaceholder")), v = V(() => l.selectLabel ?? n("common.emooHistory.select")), k = V(() => l.emptyTitle ?? n("common.emooHistory.empty")), u = V(() => l.noMatchTitle ?? n("common.emooHistory.noMatch")), b = V(() => l.groups.some((M) => M.items.length > 0)), _ = O(!1), y = O(!1), R = O(null), E = async () => {
1283
+ _.value = !0, await ke(), R.value?.focus();
1284
+ }, $ = () => {
1285
+ !l.keyword && !y.value && (_.value = !1);
1286
+ }, z = () => {
1287
+ y.value = !1, $();
1288
+ }, I = O(null), j = O(null), X = V(() => l.groups.flatMap((M) => M.items)), ie = (M) => M.id === (j.value ?? X.value[0]?.id) ? 0 : -1, ee = (M) => {
1289
+ M !== void 0 && I.value?.querySelector(`.history-item[data-item-id="${M}"]`)?.focus();
1290
+ }, d = () => ee(X.value[0]?.id), T = (M, L) => {
1291
+ if (M.target !== M.currentTarget) return;
1292
+ const G = X.value, oe = G.findIndex((re) => re.id === L.id);
1293
+ if (M.key === "ArrowDown")
1294
+ M.preventDefault(), oe < G.length - 1 && ee(G[oe + 1].id);
1295
+ else if (M.key === "ArrowUp")
1296
+ M.preventDefault(), oe > 0 && ee(G[oe - 1].id);
1297
+ else if (M.key === "Enter")
1298
+ M.preventDefault(), A(L);
1299
+ else if (M.key === "Backspace" || M.key === "Delete") {
1300
+ if (se.value || H.value || !ae) return;
1301
+ M.preventDefault(), r("delete", L);
1302
+ }
1303
+ }, B = (M) => {
1304
+ if ((M.metaKey || M.ctrlKey) && M.key.toLowerCase() === "k") {
1305
+ if (!l.anyRecord) return;
1306
+ M.preventDefault(), E();
1307
+ }
1308
+ }, se = O(null), ne = O(""), ye = O(!1), q = (M) => {
1309
+ se.value = M.id, ne.value = M.title;
1310
+ }, de = () => {
1311
+ se.value = null, ne.value = "";
1312
+ }, ce = () => {
1313
+ se.value !== null && r("rename", { id: se.value, title: ne.value });
1314
+ }, H = O(!1), te = (M, L) => {
1315
+ r(
1316
+ "update:selectedIds",
1317
+ L ? [...l.selectedIds, M] : l.selectedIds.filter((G) => G !== M)
1318
+ );
1319
+ }, F = () => {
1320
+ H.value = !H.value, H.value ? de() : r("update:selectedIds", []);
1321
+ }, C = () => {
1322
+ H.value && (H.value = !1, r("update:selectedIds", []));
1323
+ }, A = (M) => {
1324
+ if (H.value) {
1325
+ te(M.id, !l.selectedIds.includes(M.id));
1326
+ return;
1327
+ }
1328
+ r("select", M);
1329
+ }, Q = (M) => {
1330
+ const L = M.target;
1331
+ L.scrollTop + L.clientHeight >= L.scrollHeight - 60 && r("load-more");
1332
+ }, ae = !!Ct()["row-action"];
1333
+ return Xe(() => {
1334
+ window.addEventListener("keydown", B);
1335
+ }), St(() => {
1336
+ window.removeEventListener("keydown", B);
1337
+ }), i({ startRename: q, cancelRename: de, exitSelectMode: C, focusSearch: E }), (M, L) => (t(), s("div", Ga, [
1338
+ e.anyRecord ? (t(), s("div", Xa, [
1339
+ m("div", {
1340
+ class: W(["search-area", { expanded: _.value }]),
1341
+ onMouseenter: L[2] || (L[2] = (G) => _.value = !0),
1342
+ onMouseleave: $,
1343
+ onClick: E
1344
+ }, [
1345
+ P(he, { content: p.value }, {
1346
+ default: w(() => [
1347
+ P(a(Qe), {
1348
+ link: "",
1349
+ size: "small",
1350
+ class: "search-toggle",
1351
+ "aria-label": p.value,
1352
+ "data-testid": "chat-history-search-toggle"
1353
+ }, {
1354
+ default: w(() => [
1355
+ P(a(fo), { size: 14 })
1356
+ ]),
1357
+ _: 1
1358
+ }, 8, ["aria-label"])
1359
+ ]),
1360
+ _: 1
1361
+ }, 8, ["content"]),
1362
+ P(a(tt), {
1363
+ ref_key: "searchInputRef",
1364
+ ref: R,
1365
+ "model-value": e.keyword,
1366
+ size: "small",
1367
+ clearable: "",
1368
+ placeholder: p.value,
1369
+ class: "search-input",
1370
+ "data-testid": "chat-history-search",
1371
+ "onUpdate:modelValue": L[0] || (L[0] = (G) => r("update:keyword", G)),
1372
+ onFocus: L[1] || (L[1] = (G) => y.value = !0),
1373
+ onBlur: z,
1374
+ onKeydown: qe(le(d, ["prevent"]), ["down"])
1375
+ }, null, 8, ["model-value", "placeholder", "onKeydown"])
1376
+ ], 34),
1377
+ e.selectable ? (t(), s(D, { key: 0 }, [
1378
+ H.value ? (t(), s(D, { key: 1 }, [
1379
+ P(De, {
1380
+ variant: "text",
1381
+ size: "small",
1382
+ class: "float-toggle",
1383
+ "data-testid": "chat-history-select-cancel",
1384
+ disabled: e.batchBusy,
1385
+ onClick: F
1386
+ }, {
1387
+ default: w(() => [
1388
+ Z(g(a(n)("common.emooHistory.cancel")), 1)
1389
+ ]),
1390
+ _: 1
1391
+ }, 8, ["disabled"]),
1392
+ U(M.$slots, "batch-actions", { selectedIds: e.selectedIds }, void 0, !0)
1393
+ ], 64)) : (t(), x(he, {
1394
+ key: 0,
1395
+ content: v.value
1396
+ }, {
1397
+ default: w(() => [
1398
+ P(a(Qe), {
1399
+ link: "",
1400
+ size: "small",
1401
+ class: "float-toggle",
1402
+ "data-testid": "chat-history-select-toggle",
1403
+ "aria-label": v.value,
1404
+ disabled: e.batchBusy,
1405
+ onClick: F
1406
+ }, {
1407
+ default: w(() => [
1408
+ P(a(ho), { size: 14 })
1409
+ ]),
1410
+ _: 1
1411
+ }, 8, ["aria-label", "disabled"])
1412
+ ]),
1413
+ _: 1
1414
+ }, 8, ["content"]))
1415
+ ], 64)) : S("", !0)
1416
+ ])) : S("", !0),
1417
+ We((t(), s("div", {
1418
+ ref_key: "historyScrollRef",
1419
+ ref: I,
1420
+ class: "history-scroll",
1421
+ onScroll: Q
1422
+ }, [
1423
+ e.loading && !b.value ? (t(), x(Na, {
1424
+ key: 0,
1425
+ variant: "lines",
1426
+ lines: 4,
1427
+ class: "history-skel"
1428
+ })) : b.value ? (t(!0), s(D, { key: 1 }, J(e.groups, (G) => (t(), s("div", {
1429
+ key: G.key
1430
+ }, [
1431
+ m("div", {
1432
+ class: W(["group-title", { "group-title--dim": G.dim }])
1433
+ }, [
1434
+ L[11] || (L[11] = m("span", { class: "group-dot" }, null, -1)),
1435
+ Z(" " + g(a(n)(G.label)), 1)
1436
+ ], 2),
1437
+ (t(!0), s(D, null, J(G.items, (oe) => (t(), x(he, {
1438
+ key: oe.id,
1439
+ content: oe.tooltip,
1440
+ disabled: !oe.tooltip,
1441
+ placement: "right"
1442
+ }, {
1443
+ default: w(() => [
1444
+ m("div", {
1445
+ class: W(["history-item", { active: oe.id === e.activeId }]),
1446
+ "data-item-id": oe.id,
1447
+ tabindex: ie(oe),
1448
+ onClick: (re) => A(oe),
1449
+ onFocus: (re) => j.value = oe.id,
1450
+ onKeydown: (re) => T(re, oe)
1451
+ }, [
1452
+ H.value ? (t(), x(a(lt), {
1453
+ key: 0,
1454
+ class: "row-checkbox",
1455
+ "data-testid": "chat-history-item-checkbox",
1456
+ "model-value": e.selectedIds.includes(oe.id),
1457
+ onClick: L[3] || (L[3] = le(() => {
1458
+ }, ["stop"])),
1459
+ "onUpdate:modelValue": (re) => te(oe.id, !!re)
1460
+ }, null, 8, ["model-value", "onUpdate:modelValue"])) : S("", !0),
1461
+ m("span", Ya, [
1462
+ se.value !== oe.id ? (t(), s("span", Za, g(oe.title), 1)) : (t(), x(a(tt), {
1463
+ key: 1,
1464
+ modelValue: ne.value,
1465
+ "onUpdate:modelValue": L[4] || (L[4] = (re) => ne.value = re),
1466
+ class: "rename-input",
1467
+ "data-testid": "chat-history-rename-input",
1468
+ onClick: L[5] || (L[5] = le(() => {
1469
+ }, ["stop"])),
1470
+ onCompositionstart: L[6] || (L[6] = (re) => ye.value = !0),
1471
+ onCompositionend: L[7] || (L[7] = (re) => ye.value = !1),
1472
+ onKeydown: L[8] || (L[8] = qe((re) => !ye.value && ce(), ["enter"])),
1473
+ onBlur: le(ce, ["stop"])
1474
+ }, null, 8, ["modelValue"]))
1475
+ ]),
1476
+ se.value !== oe.id && oe.id !== e.activeId && oe.status ? (t(), s("span", Qa, [
1477
+ oe.status === "generating" ? (t(), x(Ht, {
1478
+ key: 0,
1479
+ size: 14,
1480
+ label: a(n)("common.loading")
1481
+ }, null, 8, ["label"])) : (t(), s("span", el))
1482
+ ])) : S("", !0),
1483
+ se.value !== oe.id && !H.value && ae ? (t(), x(a(st), {
1484
+ key: 2,
1485
+ class: "history-actions",
1486
+ trigger: "click",
1487
+ placement: "bottom-end",
1488
+ teleported: !0,
1489
+ "popper-options": { strategy: "fixed" },
1490
+ "popper-class": "emoo-history-dropdown",
1491
+ onClick: L[10] || (L[10] = le(() => {
1492
+ }, ["stop"]))
1493
+ }, {
1494
+ dropdown: w(() => [
1495
+ P(a(oo), null, {
1496
+ default: w(() => [
1497
+ U(M.$slots, "row-action", { item: oe }, void 0, !0)
1498
+ ]),
1499
+ _: 2
1500
+ }, 1024)
1501
+ ]),
1502
+ default: w(() => [
1503
+ P(a(Qe), {
1504
+ link: "",
1505
+ size: "small",
1506
+ class: "more-btn",
1507
+ onClick: L[9] || (L[9] = le(() => {
1508
+ }, ["stop"]))
1509
+ }, {
1510
+ default: w(() => [
1511
+ P(a(Mt), { class: "ic" })
1512
+ ]),
1513
+ _: 1
1514
+ })
1515
+ ]),
1516
+ _: 2
1517
+ }, 1024)) : S("", !0)
1518
+ ], 42, Ja)
1519
+ ]),
1520
+ _: 2
1521
+ }, 1032, ["content", "disabled"]))), 128))
1522
+ ]))), 128)) : (t(), x(xa, {
1523
+ key: 2,
1524
+ variant: "mini",
1525
+ title: e.keyword.trim() ? u.value : k.value
1526
+ }, null, 8, ["title"]))
1527
+ ], 32)), [
1528
+ [a(ao), e.loading && b.value]
1529
+ ])
1530
+ ]));
1531
+ }
1532
+ }), Mn = /* @__PURE__ */ Y(tl, [["__scopeId", "data-v-862f7ee9"]]), ol = {
1533
+ class: "emoo-mrsel__tabs",
1534
+ role: "tablist"
1535
+ }, al = ["aria-selected", "onClick"], ll = { class: "emoo-mrsel__count" }, sl = {
1536
+ class: "emoo-sel-remote-error",
1537
+ role: "alert",
1538
+ "data-testid": "remote-error"
1539
+ }, nl = { class: "emoo-mrsel__opt" }, il = ["src"], rl = { class: "emoo-mrsel__name" }, dl = {
1540
+ key: 0,
1541
+ class: "emoo-mrsel__dept"
1542
+ }, ul = { class: "emoo-mrsel__opt" }, cl = ["src"], ml = { class: "emoo-mrsel__col" }, vl = { class: "emoo-mrsel__name" }, fl = {
1543
+ key: 0,
1544
+ class: "emoo-mrsel__desc"
1545
+ }, hl = /* @__PURE__ */ N({
1546
+ __name: "EmooMemberRoleSelect",
1547
+ props: {
1548
+ modelValue: {},
1549
+ members: {},
1550
+ roles: {},
1551
+ memberSource: {},
1552
+ roleSource: {},
1553
+ selectedMembers: {},
1554
+ selectedRoles: {},
1555
+ placeholder: {},
1556
+ collapse: { default: 2 }
1557
+ },
1558
+ emits: ["update:modelValue"],
1559
+ setup(e, { emit: i }) {
1560
+ const o = e, l = i, { t: r } = me(), n = O("member"), p = V(() => o.modelValue?.memberIds ?? []), v = V(() => o.modelValue?.roleIds ?? []), k = V(() => [
1561
+ { key: "member", label: r("common.emooSelect.memberTab"), count: p.value.length },
1562
+ { key: "role", label: r("common.emooSelect.roleTab"), count: v.value.length }
1563
+ ]), u = V(() => o.memberSource !== void 0 || o.roleSource !== void 0), b = Me(() => o.memberSource, "emoo-mrsel-popper"), _ = Me(() => o.roleSource, "emoo-mrsel-popper"), y = (H) => H === "member" ? b : _, R = V(() => `${b.popperClass} ${_.popperClass}`), E = V(() => n.value === "member" ? p.value : v.value), $ = Be(
1564
+ () => p.value,
1565
+ () => u.value ? b.items.value : o.members ?? [],
1566
+ () => o.selectedMembers ?? []
1567
+ ), z = Be(
1568
+ () => v.value,
1569
+ () => u.value ? _.items.value : o.roles ?? [],
1570
+ () => o.selectedRoles ?? []
1571
+ ), I = $.mergedOptions, j = z.mergedOptions, X = V(() => [
1572
+ ...$.selectedOptions.value,
1573
+ ...z.selectedOptions.value.map((H) => ({ ...H, square: !0 }))
1574
+ ]), ie = Pe(), ee = V(() => ie.disabled !== void 0 && ie.disabled !== !1), d = O(!1), T = (H) => {
1575
+ if (d.value = H, !H) {
1576
+ b.onVisibleChange(!1), _.onVisibleChange(!1);
1577
+ return;
1578
+ }
1579
+ u.value && y(n.value).onVisibleChange(!0);
1580
+ }, B = (H) => {
1581
+ u.value && y(n.value).search(H);
1582
+ }, se = V(() => u.value ? y(n.value).loading.value : !1), ne = V(() => u.value ? y(n.value).error.value : null), ye = () => y(n.value).retry(), q = (H) => {
1583
+ n.value !== H && (n.value = H, u.value && d.value && y(H).onVisibleChange(!0));
1584
+ }, de = (H) => {
1585
+ const te = Array.isArray(H) ? [...H] : H == null || H === "" ? [] : [H];
1586
+ n.value === "member" ? $.remember(te) : z.remember(te), l(
1587
+ "update:modelValue",
1588
+ n.value === "member" ? { memberIds: te, roleIds: [...v.value] } : { memberIds: [...p.value], roleIds: te }
1589
+ );
1590
+ }, ce = (H) => {
1591
+ if (ee.value) return;
1592
+ const te = X.value[H];
1593
+ if (!te) return;
1594
+ const F = H < $.selectedOptions.value.length, C = {
1595
+ memberIds: F ? p.value.filter((A) => A !== te.id) : [...p.value],
1596
+ roleIds: F ? [...v.value] : v.value.filter((A) => A !== te.id)
1597
+ };
1598
+ $.remember(C.memberIds), z.remember(C.roleIds), l("update:modelValue", C);
1599
+ };
1600
+ return (H, te) => (t(), x(a(Ae), {
1601
+ class: "emoo-mrsel",
1602
+ multiple: "",
1603
+ "model-value": E.value,
1604
+ placeholder: e.placeholder || a(r)("common.emooSelect.memberRolePlaceholder"),
1605
+ filterable: "",
1606
+ "fit-input-width": "",
1607
+ remote: u.value,
1608
+ "remote-method": B,
1609
+ loading: se.value,
1610
+ "popper-class": R.value,
1611
+ "onUpdate:modelValue": de,
1612
+ onVisibleChange: T
1613
+ }, Se({
1614
+ tag: w(() => [
1615
+ P(xe, {
1616
+ items: X.value,
1617
+ max: e.collapse,
1618
+ removable: !ee.value,
1619
+ onRemove: ce
1620
+ }, null, 8, ["items", "max", "removable"])
1621
+ ]),
1622
+ header: w(() => [
1623
+ m("div", ol, [
1624
+ (t(!0), s(D, null, J(k.value, (F) => (t(), s("button", {
1625
+ key: F.key,
1626
+ type: "button",
1627
+ class: W(["emoo-mrsel__tab", { "is-active": n.value === F.key }]),
1628
+ "aria-selected": n.value === F.key,
1629
+ onClick: (C) => q(F.key)
1630
+ }, [
1631
+ Z(g(F.label) + " ", 1),
1632
+ m("span", ll, g(F.count), 1)
1633
+ ], 10, al))), 128))
1634
+ ])
1635
+ ]),
1636
+ default: w(() => [
1637
+ n.value === "member" ? (t(!0), s(D, { key: 0 }, J(a(I), (F) => (t(), x(a(Ie), {
1638
+ key: F.id,
1639
+ label: F.name,
1640
+ value: F.id
1641
+ }, {
1642
+ default: w(() => [
1643
+ m("span", nl, [
1644
+ m("span", {
1645
+ class: "emoo-mrsel__avatar",
1646
+ style: pe({ "--tint": F.color || "var(--el-color-primary)" })
1647
+ }, [
1648
+ F.avatar ? (t(), s("img", {
1649
+ key: 0,
1650
+ src: F.avatar,
1651
+ alt: "",
1652
+ class: "emoo-mrsel__img"
1653
+ }, null, 8, il)) : (t(), s(D, { key: 1 }, [
1654
+ Z(g(F.name[0]), 1)
1655
+ ], 64))
1656
+ ], 4),
1657
+ m("span", rl, g(F.name), 1),
1658
+ F.dept ? (t(), s("span", dl, g(F.dept), 1)) : S("", !0)
1659
+ ])
1660
+ ]),
1661
+ _: 2
1662
+ }, 1032, ["label", "value"]))), 128)) : (t(!0), s(D, { key: 1 }, J(a(j), (F) => (t(), x(a(Ie), {
1663
+ key: F.id,
1664
+ label: F.name,
1665
+ value: F.id
1666
+ }, {
1667
+ default: w(() => [
1668
+ m("span", ul, [
1669
+ m("span", {
1670
+ class: "emoo-mrsel__avatar is-square",
1671
+ style: pe({ "--tint": F.color || "var(--el-color-primary)" })
1672
+ }, [
1673
+ F.avatar ? (t(), s("img", {
1674
+ key: 0,
1675
+ src: F.avatar,
1676
+ alt: "",
1677
+ class: "emoo-mrsel__img"
1678
+ }, null, 8, cl)) : (t(), s(D, { key: 1 }, [
1679
+ Z(g(F.name[0]), 1)
1680
+ ], 64))
1681
+ ], 4),
1682
+ m("span", ml, [
1683
+ m("span", vl, g(F.name), 1),
1684
+ F.desc ? (t(), s("span", fl, g(F.desc), 1)) : S("", !0)
1685
+ ])
1686
+ ])
1687
+ ]),
1688
+ _: 2
1689
+ }, 1032, ["label", "value"]))), 128))
1690
+ ]),
1691
+ _: 2
1692
+ }, [
1693
+ ne.value ? {
1694
+ name: "footer",
1695
+ fn: w(() => [
1696
+ m("div", sl, [
1697
+ m("span", null, g(a(r)("common.emooSelect.loadFailed")), 1),
1698
+ m("button", {
1699
+ type: "button",
1700
+ "data-testid": "remote-retry",
1701
+ onClick: te[0] || (te[0] = (F) => ye())
1702
+ }, g(a(r)("common.emooSelect.retry")), 1)
1703
+ ])
1704
+ ]),
1705
+ key: "0"
1706
+ } : void 0
1707
+ ]), 1032, ["model-value", "placeholder", "remote", "loading", "popper-class"]));
1708
+ }
1709
+ }), Bn = /* @__PURE__ */ Y(hl, [["__scopeId", "data-v-ff057c7b"]]), pl = { class: "emoo-msel__opt" }, yl = ["src"], bl = { class: "emoo-msel__name" }, gl = {
1710
+ key: 0,
1711
+ class: "emoo-msel__dept"
1712
+ }, kl = {
1713
+ class: "emoo-sel-remote-error",
1714
+ role: "alert",
1715
+ "data-testid": "remote-error"
1716
+ }, $l = /* @__PURE__ */ N({
1717
+ __name: "EmooMemberSelect",
1718
+ props: {
1719
+ modelValue: {},
1720
+ options: {},
1721
+ source: {},
1722
+ selected: {},
1723
+ multiple: { type: Boolean, default: !1 },
1724
+ placeholder: {},
1725
+ clearable: { type: Boolean, default: !0 },
1726
+ collapse: { default: 2 }
1727
+ },
1728
+ emits: ["update:modelValue"],
1729
+ setup(e, { emit: i }) {
1730
+ const o = e, l = i, { t: r } = me(), n = V(() => o.source !== void 0), { items: p, loading: v, error: k, retry: u, search: b, onVisibleChange: _, popperClass: y } = Me(() => o.source, "emoo-msel-popper"), { mergedOptions: R, selectedOptions: E, remember: $ } = Be(
1731
+ () => o.modelValue,
1732
+ () => n.value ? p.value : o.options ?? [],
1733
+ () => o.selected ?? []
1734
+ ), z = (ee) => R.value.find((d) => d.id === ee), I = Pe(), j = V(() => I.disabled !== void 0 && I.disabled !== !1), X = (ee) => {
1735
+ $(ee), l("update:modelValue", ee);
1736
+ }, ie = (ee) => {
1737
+ if (j.value) return;
1738
+ const d = E.value[ee]?.id;
1739
+ d !== void 0 && X(o.modelValue.filter((T) => T !== d));
1740
+ };
1741
+ return (ee, d) => (t(), x(a(Ae), {
1742
+ class: "emoo-msel",
1743
+ "model-value": e.modelValue,
1744
+ multiple: e.multiple,
1745
+ placeholder: e.placeholder || a(r)("common.emooSelect.memberPlaceholder"),
1746
+ clearable: !e.multiple && e.clearable,
1747
+ filterable: "",
1748
+ "fit-input-width": "",
1749
+ remote: n.value,
1750
+ "remote-method": a(b),
1751
+ loading: a(v),
1752
+ "popper-class": a(y),
1753
+ "onUpdate:modelValue": X,
1754
+ onVisibleChange: a(_)
1755
+ }, Se({
1756
+ default: w(() => [
1757
+ (t(!0), s(D, null, J(a(R), (T) => (t(), x(a(Ie), {
1758
+ key: T.id,
1759
+ label: T.name,
1760
+ value: T.id
1761
+ }, {
1762
+ default: w(() => [
1763
+ m("span", pl, [
1764
+ m("span", {
1765
+ class: "emoo-msel__avatar",
1766
+ style: pe({ "--tint": T.color || "var(--el-color-primary)" })
1767
+ }, [
1768
+ T.avatar ? (t(), s("img", {
1769
+ key: 0,
1770
+ src: T.avatar,
1771
+ alt: "",
1772
+ class: "emoo-msel__img"
1773
+ }, null, 8, yl)) : (t(), s(D, { key: 1 }, [
1774
+ Z(g(T.name[0]), 1)
1775
+ ], 64))
1776
+ ], 4),
1777
+ m("span", bl, g(T.name), 1),
1778
+ T.dept ? (t(), s("span", gl, g(T.dept), 1)) : S("", !0)
1779
+ ])
1780
+ ]),
1781
+ _: 2
1782
+ }, 1032, ["label", "value"]))), 128))
1783
+ ]),
1784
+ _: 2
1785
+ }, [
1786
+ e.multiple ? {
1787
+ name: "tag",
1788
+ fn: w(() => [
1789
+ P(xe, {
1790
+ items: a(E),
1791
+ max: e.collapse,
1792
+ removable: !j.value,
1793
+ onRemove: ie
1794
+ }, null, 8, ["items", "max", "removable"])
1795
+ ]),
1796
+ key: "1"
1797
+ } : {
1798
+ name: "label",
1799
+ fn: w(({ value: T }) => [
1800
+ z(T) ? (t(), x(xe, {
1801
+ key: 0,
1802
+ items: [z(T)]
1803
+ }, null, 8, ["items"])) : S("", !0)
1804
+ ]),
1805
+ key: "0"
1806
+ },
1807
+ a(k) ? {
1808
+ name: "footer",
1809
+ fn: w(() => [
1810
+ m("div", kl, [
1811
+ m("span", null, g(a(r)("common.emooSelect.loadFailed")), 1),
1812
+ m("button", {
1813
+ type: "button",
1814
+ "data-testid": "remote-retry",
1815
+ onClick: d[0] || (d[0] = //@ts-ignore
1816
+ (...T) => a(u) && a(u)(...T))
1817
+ }, g(a(r)("common.emooSelect.retry")), 1)
1818
+ ])
1819
+ ]),
1820
+ key: "2"
1821
+ } : void 0
1822
+ ]), 1032, ["model-value", "multiple", "placeholder", "clearable", "remote", "remote-method", "loading", "popper-class", "onVisibleChange"]));
1823
+ }
1824
+ }), Dn = /* @__PURE__ */ Y($l, [["__scopeId", "data-v-f6059e7c"]]), _l = ["data-testid", "data-role"], wl = {
1825
+ key: 0,
1826
+ class: "emoo-message__side"
1827
+ }, Sl = {
1828
+ key: 0,
1829
+ class: "emoo-message__avatar"
1830
+ }, Cl = ["src"], El = { class: "emoo-message__main" }, Tl = {
1831
+ key: 0,
1832
+ class: "emoo-message__name"
1833
+ }, xl = ["data-status"], zl = {
1834
+ key: 0,
1835
+ class: "emoo-message__dots",
1836
+ "aria-label": "loading",
1837
+ role: "status"
1838
+ }, Il = {
1839
+ key: 1,
1840
+ class: "emoo-message__stopped"
1841
+ }, Rl = {
1842
+ key: 2,
1843
+ class: "emoo-message__error"
1844
+ }, Vl = {
1845
+ key: 4,
1846
+ class: "emoo-message__attachments"
1847
+ }, Ml = {
1848
+ key: 1,
1849
+ class: "emoo-message__foot"
1850
+ }, Bl = {
1851
+ key: 0,
1852
+ class: "emoo-message__time"
1853
+ }, Dl = {
1854
+ key: 1,
1855
+ class: "emoo-message__actions"
1856
+ }, Pl = {
1857
+ key: 1,
1858
+ class: "emoo-message__side"
1859
+ }, Al = {
1860
+ key: 0,
1861
+ class: "emoo-message__avatar"
1862
+ }, Ll = ["src"], Ol = /* @__PURE__ */ N({
1863
+ __name: "EmooMessage",
1864
+ props: {
1865
+ role: {},
1866
+ status: { default: "done" },
1867
+ text: { default: "" },
1868
+ avatar: {},
1869
+ name: {},
1870
+ time: {},
1871
+ testid: {}
1872
+ },
1873
+ setup(e) {
1874
+ const { t: i } = me();
1875
+ return (o, l) => (t(), s("div", {
1876
+ class: W(["emoo-message", [`is-${e.role}`, `is-${e.status}`]]),
1877
+ "data-testid": e.testid,
1878
+ "data-role": e.role
1879
+ }, [
1880
+ e.role === "assistant" || e.role === "system" ? (t(), s("div", wl, [
1881
+ U(o.$slots, "avatar", {}, () => [
1882
+ e.avatar ? (t(), s("span", Sl, [
1883
+ m("img", {
1884
+ src: e.avatar,
1885
+ alt: ""
1886
+ }, null, 8, Cl)
1887
+ ])) : S("", !0)
1888
+ ], !0)
1889
+ ])) : S("", !0),
1890
+ m("div", El, [
1891
+ e.role === "system" && e.name ? (t(), s("div", Tl, g(e.name), 1)) : S("", !0),
1892
+ m("div", {
1893
+ class: "emoo-message__body",
1894
+ "data-status": e.status
1895
+ }, [
1896
+ e.status === "loading" ? (t(), s("span", zl, [...l[0] || (l[0] = [
1897
+ m("i", null, null, -1),
1898
+ m("i", null, null, -1),
1899
+ m("i", null, null, -1)
1900
+ ])])) : e.status === "stopped" ? (t(), s("span", Il, g(a(i)("common.emooMessage.stopped")), 1)) : e.status === "error" ? (t(), s("span", Rl, g(e.text || a(i)("common.emooMessage.failed")), 1)) : U(o.$slots, "default", {}, () => [
1901
+ Z(g(e.text), 1)
1902
+ ], !0, 3),
1903
+ o.$slots.attachments ? (t(), s("div", Vl, [
1904
+ U(o.$slots, "attachments", {}, void 0, !0)
1905
+ ])) : S("", !0)
1906
+ ], 8, xl),
1907
+ e.time || o.$slots.actions ? (t(), s("div", Ml, [
1908
+ e.time ? (t(), s("span", Bl, g(e.time), 1)) : S("", !0),
1909
+ o.$slots.actions ? (t(), s("span", Dl, [
1910
+ U(o.$slots, "actions", {}, void 0, !0)
1911
+ ])) : S("", !0)
1912
+ ])) : S("", !0)
1913
+ ]),
1914
+ e.role === "user" ? (t(), s("div", Pl, [
1915
+ U(o.$slots, "avatar", {}, () => [
1916
+ e.avatar ? (t(), s("span", Al, [
1917
+ m("img", {
1918
+ src: e.avatar,
1919
+ alt: ""
1920
+ }, null, 8, Ll)
1921
+ ])) : S("", !0)
1922
+ ], !0)
1923
+ ])) : S("", !0)
1924
+ ], 10, _l));
1925
+ }
1926
+ }), Pn = /* @__PURE__ */ Y(Ol, [["__scopeId", "data-v-fca7a127"]]), Ul = /* @__PURE__ */ N({
1927
+ __name: "EmooNavMenu",
1928
+ props: {
1929
+ items: {},
1930
+ activePath: { default: "" },
1931
+ canShow: { type: Function, default: () => !0 },
1932
+ navigate: {},
1933
+ touch: { type: Boolean, default: !1 }
1934
+ },
1935
+ emits: ["select", "group-select"],
1936
+ setup(e, { emit: i }) {
1937
+ const o = e, l = i, { t: r } = me(), n = Ct(), p = wt(/* @__PURE__ */ new Map()), v = (d) => typeof d.title == "string" ? r(d.title) : d.title, k = (d) => !!(d.children && d.children.length > 0), u = V(
1938
+ () => o.items.filter((d) => !d.hidden && o.canShow(d))
1939
+ ), b = (d) => (d.children ?? []).filter((T) => !T.hidden && o.canShow(T)), _ = V(() => o.activePath ?? ""), y = (d) => !!d.action && !d.path && !d.children, R = (d) => d.active ?? _.value === (d.path || d.key), E = (d) => d.path && _.value.startsWith(d.path) ? !0 : (d.children ?? []).some((T) => T.path && _.value.startsWith(T.path) || E(T)), $ = (d) => p.get(d.key) ?? E(d), z = (d) => `emoo-nav-${d.key.replace(/[^a-zA-Z0-9_-]/g, "-")}-children`, I = (d) => {
1940
+ const T = !$(d);
1941
+ p.set(d.key, T), T && d.path && o.navigate?.(d.path), l("group-select", d, T);
1942
+ }, j = (d) => {
1943
+ l("select", d), d.path ? o.navigate?.(d.path) : d.action && d.action();
1944
+ }, X = (d) => d.badge !== void 0 && d.badge !== "" ? ve("span", { class: "menu-badge" }, String(d.badge)) : null, ie = (d) => d.trailing ? ve(d.trailing, { class: "trailing-ic" }) : null, ee = (d, T) => {
1945
+ if (!k(d))
1946
+ return T === 0 ? ve("button", {
1947
+ type: "button",
1948
+ class: ["single-menu-item", {
1949
+ "is-active": R(d),
1950
+ "functional-button": y(d) && d.active !== !0
1951
+ }],
1952
+ "data-testid": d.testid,
1953
+ "aria-pressed": typeof d.active == "boolean" ? d.active : void 0,
1954
+ "aria-current": R(d) && d.path ? "page" : void 0,
1955
+ onClick: (ne) => {
1956
+ ne.stopPropagation(), j(d);
1957
+ }
1958
+ }, [
1959
+ n.leading?.({ item: d }) ?? (d.icon ? ve(d.icon, { class: "ic" }) : null),
1960
+ ve("span", { class: "menu-title" }, v(d)),
1961
+ ie(d),
1962
+ X(d)
1963
+ ]) : ve("button", {
1964
+ type: "button",
1965
+ class: ["child-menu-item", { "is-active": R(d) }],
1966
+ "data-testid": d.testid,
1967
+ "aria-current": R(d) && d.path ? "page" : void 0,
1968
+ onClick: (ne) => {
1969
+ ne.stopPropagation(), j(d);
1970
+ }
1971
+ }, [
1972
+ ve("span", { class: "child-menu-title" }, v(d)),
1973
+ ie(d),
1974
+ X(d)
1975
+ ]);
1976
+ const B = $(d), se = T === 0 ? ve("button", {
1977
+ type: "button",
1978
+ class: ["menu-group-title", { "is-open": B }],
1979
+ "aria-expanded": String(B),
1980
+ "aria-controls": z(d),
1981
+ "data-testid": d.testid ? `${d.testid}-group` : void 0,
1982
+ onClick: (ne) => {
1983
+ ne.stopPropagation(), I(d);
1984
+ }
1985
+ }, [
1986
+ n.leading?.({ item: d }) ?? (d.icon ? ve(d.icon, { class: "ic" }) : null),
1987
+ ve("span", { class: "menu-title" }, v(d)),
1988
+ X(d),
1989
+ ve(je, { class: "tree-caret" })
1990
+ ]) : ve("button", {
1991
+ type: "button",
1992
+ class: ["child-menu-item", "menu-group-child-title", { "is-open": B }],
1993
+ "aria-expanded": String(B),
1994
+ "aria-controls": z(d),
1995
+ "data-testid": d.testid ? `${d.testid}-group` : void 0,
1996
+ onClick: (ne) => {
1997
+ ne.stopPropagation(), I(d);
1998
+ }
1999
+ }, [
2000
+ ve("span", { class: "child-menu-title" }, v(d)),
2001
+ ve(je, { class: "tree-caret" })
2002
+ ]);
2003
+ return ve("div", { class: "menu-group" }, [
2004
+ se,
2005
+ ve("div", {
2006
+ id: z(d),
2007
+ class: ["children-container", { expanded: B }],
2008
+ role: "group",
2009
+ "aria-label": v(d)
2010
+ }, b(d).map((ne) => [
2011
+ ne.separatorBefore ? ve("span", { class: "tree-sep" }) : null,
2012
+ ee(ne, T + 1)
2013
+ ]).flat())
2014
+ ]);
2015
+ };
2016
+ return (d, T) => (t(), s("nav", {
2017
+ class: W(["emoo-nav", { "is-touch": e.touch }])
2018
+ }, [
2019
+ (t(!0), s(D, null, J(u.value, (B) => (t(), x(ze(ee(B, 0)), {
2020
+ key: B.key
2021
+ }))), 128))
2022
+ ], 2));
2023
+ }
2024
+ }), An = /* @__PURE__ */ Y(Ul, [["__scopeId", "data-v-ebbf674d"]]), Hl = { class: "emoo-nav-segmented" }, Kl = ["onClick"], Wl = /* @__PURE__ */ N({
2025
+ __name: "EmooNavSegmented",
2026
+ props: {
2027
+ items: {},
2028
+ activeKey: { default: "" },
2029
+ navigate: {}
2030
+ },
2031
+ emits: ["select"],
2032
+ setup(e, { emit: i }) {
2033
+ const o = e, l = i, { t: r } = me(), n = (v) => typeof v.title == "string" ? r(v.title) : v.title, p = (v) => {
2034
+ l("select", v), v.path && o.navigate?.(v.path);
2035
+ };
2036
+ return (v, k) => (t(), s("nav", Hl, [
2037
+ (t(!0), s(D, null, J(e.items, (u) => (t(), s("button", {
2038
+ key: u.key,
2039
+ type: "button",
2040
+ class: W(["emoo-nav-segmented__item", { "is-active": u.key === e.activeKey }]),
2041
+ onClick: le((b) => p(u), ["stop"])
2042
+ }, [
2043
+ u.icon ? (t(), x(ze(u.icon), {
2044
+ key: 0,
2045
+ "aria-hidden": "true"
2046
+ })) : S("", !0),
2047
+ m("span", null, g(n(u)), 1)
2048
+ ], 10, Kl))), 128))
2049
+ ]));
2050
+ }
2051
+ }), Ln = /* @__PURE__ */ Y(Wl, [["__scopeId", "data-v-a88dea1a"]]), Fl = /* @__PURE__ */ N({
2052
+ __name: "EmooOptionRows",
2053
+ props: {
2054
+ options: {},
2055
+ modelValue: {},
2056
+ multiple: { type: Boolean, default: !1 },
2057
+ inline: { type: Boolean, default: !0 },
2058
+ disabled: { type: Boolean, default: !1 },
2059
+ testid: {}
2060
+ },
2061
+ emits: ["update:modelValue"],
2062
+ setup(e, { emit: i }) {
2063
+ const o = e, l = i, r = (v, k) => {
2064
+ o.disabled || o.modelValue !== v || (k.preventDefault(), k.stopPropagation(), l("update:modelValue", null));
2065
+ }, n = (v) => {
2066
+ v == null ? l("update:modelValue", null) : (typeof v == "string" || typeof v == "number") && l("update:modelValue", v);
2067
+ }, p = (v) => {
2068
+ l("update:modelValue", Array.isArray(v) ? v.filter(
2069
+ (k) => typeof k == "string" || typeof k == "number"
2070
+ ) : []);
2071
+ };
2072
+ return (v, k) => (t(), s("div", {
2073
+ class: W(["emoo-option-rows", { "emoo-option-rows--inline": e.inline }])
2074
+ }, [
2075
+ e.options.length > 4 ? (t(), s("div", {
2076
+ key: 0,
2077
+ class: W(["emoo-option-rows__choices", { "emoo-option-rows__choices--inline": e.inline }])
2078
+ }, [
2079
+ P(oa, {
2080
+ class: "emoo-option-rows__select",
2081
+ options: e.options,
2082
+ "model-value": e.modelValue,
2083
+ multiple: e.multiple,
2084
+ disabled: e.disabled,
2085
+ clearable: !e.multiple,
2086
+ testid: e.testid,
2087
+ "onUpdate:modelValue": k[0] || (k[0] = (u) => e.multiple ? p(u) : n(u))
2088
+ }, null, 8, ["options", "model-value", "multiple", "disabled", "clearable", "testid"])
2089
+ ], 2)) : e.multiple ? (t(), x(a(Tt), {
2090
+ key: 2,
2091
+ class: W(["emoo-option-rows__choices", { "emoo-option-rows__choices--inline": e.inline }]),
2092
+ "model-value": e.modelValue ?? [],
2093
+ disabled: e.disabled,
2094
+ "onUpdate:modelValue": p
2095
+ }, {
2096
+ default: w(() => [
2097
+ (t(!0), s(D, null, J(e.options, (u) => (t(), x(a(lt), {
2098
+ key: `${typeof u.value}:${u.value}`,
2099
+ value: u.value,
2100
+ "data-testid": e.testid ? `${e.testid}-${String(u.value)}` : void 0,
2101
+ border: ""
2102
+ }, {
2103
+ default: w(() => [
2104
+ Z(g(u.label), 1)
2105
+ ]),
2106
+ _: 2
2107
+ }, 1032, ["value", "data-testid"]))), 128))
2108
+ ]),
2109
+ _: 1
2110
+ }, 8, ["class", "model-value", "disabled"])) : (t(), x(a(xt), {
2111
+ key: 1,
2112
+ class: W(["emoo-option-rows__choices", { "emoo-option-rows__choices--inline": e.inline }]),
2113
+ "model-value": Array.isArray(e.modelValue) ? void 0 : e.modelValue ?? void 0,
2114
+ disabled: e.disabled,
2115
+ "onUpdate:modelValue": n
2116
+ }, {
2117
+ default: w(() => [
2118
+ (t(!0), s(D, null, J(e.options, (u) => (t(), x(a(zt), {
2119
+ key: `${typeof u.value}:${u.value}`,
2120
+ value: u.value,
2121
+ "data-testid": e.testid ? `${e.testid}-${String(u.value)}` : void 0,
2122
+ border: "",
2123
+ onClickCapture: (b) => r(u.value, b)
2124
+ }, {
2125
+ default: w(() => [
2126
+ Z(g(u.label), 1)
2127
+ ]),
2128
+ _: 2
2129
+ }, 1032, ["value", "data-testid", "onClickCapture"]))), 128))
2130
+ ]),
2131
+ _: 1
2132
+ }, 8, ["class", "model-value", "disabled"])),
2133
+ U(v.$slots, "append", {}, void 0, !0)
2134
+ ], 2));
2135
+ }
2136
+ }), On = /* @__PURE__ */ Y(Fl, [["__scopeId", "data-v-44e7d258"]]), Nl = {
2137
+ key: 0,
2138
+ class: "emt-foot",
2139
+ "data-testid": "emt-foot"
2140
+ }, ql = { class: "emt-foot__info" }, jl = { class: "emt-foot__right" }, Gl = ["aria-label"], Xl = {
2141
+ class: "emt-foot__size",
2142
+ type: "button",
2143
+ "data-testid": "emt-pagesize"
2144
+ }, Jl = { class: "emt-colmenu__list" }, Yl = { class: "emt-tick" }, Zl = {
2145
+ class: "emt-pager",
2146
+ "data-testid": "emt-pager"
2147
+ }, Ql = ["disabled", "aria-label"], es = ["data-testid", "onClick"], ts = {
2148
+ key: 1,
2149
+ class: "emt-pager__btn is-ellipsis"
2150
+ }, os = ["disabled", "aria-label"], as = /* @__PURE__ */ N({
2151
+ __name: "EmooPagination",
2152
+ props: {
2153
+ total: {},
2154
+ page: { default: 1 },
2155
+ pageSize: { default: 20 },
2156
+ pageSizes: { default: () => [10, 20, 50, 100] },
2157
+ density: { default: void 0 },
2158
+ densityBase: { default: "standard" }
2159
+ },
2160
+ emits: ["update:page", "update:pageSize", "update:density"],
2161
+ setup(e, { emit: i }) {
2162
+ const o = e, l = i, { t: r } = me(), n = V(() => o.page), p = V(() => Math.max(1, Math.ceil(o.total / o.pageSize))), v = V(() => (n.value - 1) * o.pageSize + 1), k = V(() => Math.min(o.total, n.value * o.pageSize)), u = (E) => E.toLocaleString(), b = V(() => {
2163
+ const E = p.value, $ = n.value;
2164
+ return E <= 7 ? Array.from({ length: E }, (z, I) => I + 1) : $ <= 4 ? [1, 2, 3, 4, 5, "…", E] : $ >= E - 3 ? [1, "…", E - 4, E - 3, E - 2, E - 1, E] : [1, "…", $ - 1, $, $ + 1, "…", E];
2165
+ }), _ = (E) => {
2166
+ const $ = Math.min(Math.max(1, E), p.value);
2167
+ $ !== o.page && l("update:page", $);
2168
+ }, y = (E) => {
2169
+ E !== o.pageSize && (l("update:pageSize", E), l("update:page", 1));
2170
+ };
2171
+ we(p, (E) => {
2172
+ o.page > E && l("update:page", E);
2173
+ });
2174
+ const R = V(
2175
+ () => o.density === "compact" ? r(o.densityBase === "comfort" ? "common.emooTable.switchToComfort" : "common.emooTable.switchToStandard") : r("common.emooTable.switchToCompact")
2176
+ );
2177
+ return (E, $) => e.total > 0 ? (t(), s("footer", Nl, [
2178
+ m("span", ql, g(a(r)("common.emooTable.totalInfo", { total: u(e.total), from: u(v.value), to: u(k.value) })), 1),
2179
+ m("div", jl, [
2180
+ e.density ? (t(), x(he, {
2181
+ key: 0,
2182
+ content: R.value,
2183
+ placement: "top"
2184
+ }, {
2185
+ default: w(() => [
2186
+ m("button", {
2187
+ class: W(["emt-foot__dens", { "is-on": e.density === "compact" }]),
2188
+ type: "button",
2189
+ "aria-label": R.value,
2190
+ "data-testid": "emt-density",
2191
+ onClick: $[0] || ($[0] = (z) => l("update:density", e.density === "compact" ? "default" : "compact"))
2192
+ }, [
2193
+ P(a(po), {
2194
+ size: 14,
2195
+ "aria-hidden": "true"
2196
+ })
2197
+ ], 10, Gl)
2198
+ ]),
2199
+ _: 1
2200
+ }, 8, ["content"])) : S("", !0),
2201
+ P(a(st), {
2202
+ trigger: "click",
2203
+ placement: "top-end",
2204
+ "popper-class": "emt-colmenu",
2205
+ onCommand: $[1] || ($[1] = (z) => y(Number(z)))
2206
+ }, {
2207
+ dropdown: w(() => [
2208
+ m("div", Jl, [
2209
+ (t(!0), s(D, null, J(e.pageSizes, (z) => (t(), x(a(lo), {
2210
+ key: z,
2211
+ class: W(["emt-colmenu__item", { "is-on": z === e.pageSize }]),
2212
+ command: z,
2213
+ "data-testid": `emt-pagesize-${z}`
2214
+ }, {
2215
+ default: w(() => [
2216
+ m("span", Yl, [
2217
+ z === e.pageSize ? (t(), x(a(Bt), {
2218
+ key: 0,
2219
+ size: 13,
2220
+ "aria-hidden": "true"
2221
+ })) : S("", !0)
2222
+ ]),
2223
+ Z(g(a(r)("common.emooTable.perPage", { n: z })), 1)
2224
+ ]),
2225
+ _: 2
2226
+ }, 1032, ["class", "command", "data-testid"]))), 128))
2227
+ ])
2228
+ ]),
2229
+ default: w(() => [
2230
+ m("button", Xl, [
2231
+ Z(g(a(r)("common.emooTable.perPage", { n: e.pageSize })) + " ", 1),
2232
+ P(a(it), {
2233
+ size: 11,
2234
+ "aria-hidden": "true"
2235
+ })
2236
+ ])
2237
+ ]),
2238
+ _: 1
2239
+ }),
2240
+ m("div", Zl, [
2241
+ m("button", {
2242
+ class: "emt-pager__btn",
2243
+ type: "button",
2244
+ disabled: n.value <= 1,
2245
+ "aria-label": a(r)("common.emooTable.prevPage"),
2246
+ "data-testid": "emt-page-prev",
2247
+ onClick: $[2] || ($[2] = (z) => _(n.value - 1))
2248
+ }, [
2249
+ P(a(Dt), {
2250
+ size: 14,
2251
+ "aria-hidden": "true"
2252
+ })
2253
+ ], 8, Ql),
2254
+ (t(!0), s(D, null, J(b.value, (z, I) => (t(), s(D, { key: I }, [
2255
+ typeof z == "number" ? (t(), s("button", {
2256
+ key: 0,
2257
+ class: W(["emt-pager__btn", { "is-active": z === n.value }]),
2258
+ type: "button",
2259
+ "data-testid": `emt-page-${z}`,
2260
+ onClick: (j) => _(z)
2261
+ }, g(z), 11, es)) : (t(), s("span", ts, "…"))
2262
+ ], 64))), 128)),
2263
+ m("button", {
2264
+ class: "emt-pager__btn",
2265
+ type: "button",
2266
+ disabled: n.value >= p.value,
2267
+ "aria-label": a(r)("common.emooTable.nextPage"),
2268
+ "data-testid": "emt-page-next",
2269
+ onClick: $[3] || ($[3] = (z) => _(n.value + 1))
2270
+ }, [
2271
+ P(a(je), {
2272
+ size: 14,
2273
+ "aria-hidden": "true"
2274
+ })
2275
+ ], 8, os)
2276
+ ])
2277
+ ])
2278
+ ])) : S("", !0);
2279
+ }
2280
+ }), ls = /* @__PURE__ */ Y(as, [["__scopeId", "data-v-fc98e78c"]]), Un = /* @__PURE__ */ N({
2281
+ __name: "EmooPopover",
2282
+ props: {
2283
+ popperClass: { default: "" },
2284
+ showArrow: { type: Boolean, default: !1 }
2285
+ },
2286
+ setup(e) {
2287
+ const i = e, o = V(() => ["emo-pop", i.popperClass].filter(Boolean).join(" "));
2288
+ return (l, r) => (t(), x(a(so), Ge(l.$attrs, {
2289
+ "show-arrow": e.showArrow,
2290
+ "popper-class": o.value
2291
+ }), Se({
2292
+ default: w(() => [
2293
+ U(l.$slots, "default")
2294
+ ]),
2295
+ _: 2
2296
+ }, [
2297
+ l.$slots.reference ? {
2298
+ name: "reference",
2299
+ fn: w(() => [
2300
+ U(l.$slots, "reference")
2301
+ ]),
2302
+ key: "0"
2303
+ } : void 0
2304
+ ]), 1040, ["show-arrow", "popper-class"]));
2305
+ }
2306
+ }), ss = ["aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext"], ns = {
2307
+ class: "emoo-progress__track",
2308
+ "aria-hidden": "true"
2309
+ }, is = {
2310
+ key: 0,
2311
+ class: "emoo-progress__label"
2312
+ }, rs = /* @__PURE__ */ N({
2313
+ __name: "EmooProgress",
2314
+ props: {
2315
+ value: { default: null },
2316
+ status: { default: "run" },
2317
+ size: { default: "md" },
2318
+ label: {},
2319
+ ariaLabel: {}
2320
+ },
2321
+ setup(e) {
2322
+ const i = e, o = V(
2323
+ () => typeof i.value == "number" && Number.isFinite(i.value) ? i.value : null
2324
+ ), l = V(() => o.value == null), r = V(() => Math.min(100, Math.max(0, o.value ?? 0))), n = V(
2325
+ () => l.value ? void 0 : { width: `${r.value}%` }
2326
+ ), p = V(() => {
2327
+ if (!l.value)
2328
+ return i.label || `${Math.round(r.value)}%`;
2329
+ });
2330
+ return (v, k) => (t(), s("span", {
2331
+ class: W(["emoo-progress", [`is-${e.size}`, `is-${e.status}`, { "is-indeterminate": l.value }]]),
2332
+ role: "progressbar",
2333
+ "aria-label": e.ariaLabel || e.label || void 0,
2334
+ "aria-valuemin": l.value ? void 0 : 0,
2335
+ "aria-valuemax": l.value ? void 0 : 100,
2336
+ "aria-valuenow": l.value ? void 0 : r.value,
2337
+ "aria-valuetext": p.value
2338
+ }, [
2339
+ m("span", ns, [
2340
+ m("span", {
2341
+ class: "emoo-progress__fill",
2342
+ style: pe(n.value)
2343
+ }, null, 4)
2344
+ ]),
2345
+ e.label ? (t(), s("span", is, g(e.label), 1)) : S("", !0)
2346
+ ], 10, ss));
2347
+ }
2348
+ }), ds = /* @__PURE__ */ Y(rs, [["__scopeId", "data-v-cab4f706"]]), us = { class: "emoo-rsel__opt" }, cs = ["src"], ms = { class: "emoo-rsel__col" }, vs = { class: "emoo-rsel__name" }, fs = {
2349
+ key: 0,
2350
+ class: "emoo-rsel__desc"
2351
+ }, hs = {
2352
+ class: "emoo-sel-remote-error",
2353
+ role: "alert",
2354
+ "data-testid": "remote-error"
2355
+ }, ps = /* @__PURE__ */ N({
2356
+ __name: "EmooRoleSelect",
2357
+ props: {
2358
+ modelValue: {},
2359
+ options: {},
2360
+ source: {},
2361
+ selected: {},
2362
+ multiple: { type: Boolean, default: !1 },
2363
+ placeholder: {},
2364
+ clearable: { type: Boolean, default: !0 },
2365
+ collapse: { default: 2 }
2366
+ },
2367
+ emits: ["update:modelValue", "update:selected"],
2368
+ setup(e, { emit: i }) {
2369
+ const o = e, l = i, { t: r } = me(), n = V(() => o.source !== void 0), { items: p, loading: v, error: k, retry: u, search: b, onVisibleChange: _, popperClass: y } = Me(() => o.source, "emoo-rsel-popper"), { mergedOptions: R, selectedOptions: E, remember: $ } = Be(
2370
+ () => o.modelValue,
2371
+ () => n.value ? p.value : o.options ?? [],
2372
+ () => o.selected ?? []
2373
+ ), z = (d) => R.value.find((T) => T.id === d), I = Pe(), j = V(() => I.disabled !== void 0 && I.disabled !== !1), X = (d) => ({ ...d, square: !0 }), ie = (d) => {
2374
+ const T = $(d);
2375
+ l("update:modelValue", d), l("update:selected", T);
2376
+ }, ee = (d) => {
2377
+ const T = E.value[d]?.id;
2378
+ T !== void 0 && ie(o.modelValue.filter((B) => B !== T));
2379
+ };
2380
+ return (d, T) => (t(), x(a(Ae), {
2381
+ class: "emoo-rsel",
2382
+ "model-value": e.modelValue,
2383
+ multiple: e.multiple,
2384
+ placeholder: e.placeholder || a(r)("common.emooSelect.rolePlaceholder"),
2385
+ clearable: !e.multiple && e.clearable,
2386
+ filterable: "",
2387
+ "fit-input-width": "",
2388
+ remote: n.value,
2389
+ "remote-method": a(b),
2390
+ loading: a(v),
2391
+ "popper-class": a(y),
2392
+ "onUpdate:modelValue": ie,
2393
+ onVisibleChange: a(_)
2394
+ }, Se({
2395
+ default: w(() => [
2396
+ (t(!0), s(D, null, J(a(R), (B) => (t(), x(a(Ie), {
2397
+ key: B.id,
2398
+ label: B.name,
2399
+ value: B.id
2400
+ }, {
2401
+ default: w(() => [
2402
+ m("span", us, [
2403
+ m("span", {
2404
+ class: "emoo-rsel__avatar",
2405
+ style: pe({ "--tint": B.color || "var(--el-color-primary)" })
2406
+ }, [
2407
+ B.avatar ? (t(), s("img", {
2408
+ key: 0,
2409
+ src: B.avatar,
2410
+ alt: "",
2411
+ class: "emoo-rsel__img"
2412
+ }, null, 8, cs)) : (t(), s(D, { key: 1 }, [
2413
+ Z(g(B.name[0]), 1)
2414
+ ], 64))
2415
+ ], 4),
2416
+ m("span", ms, [
2417
+ m("span", vs, g(B.name), 1),
2418
+ B.desc ? (t(), s("span", fs, g(B.desc), 1)) : S("", !0)
2419
+ ])
2420
+ ])
2421
+ ]),
2422
+ _: 2
2423
+ }, 1032, ["label", "value"]))), 128))
2424
+ ]),
2425
+ _: 2
2426
+ }, [
2427
+ e.multiple ? {
2428
+ name: "tag",
2429
+ fn: w(() => [
2430
+ P(xe, {
2431
+ items: a(E).map(X),
2432
+ max: e.collapse,
2433
+ removable: !j.value,
2434
+ onRemove: ee
2435
+ }, null, 8, ["items", "max", "removable"])
2436
+ ]),
2437
+ key: "1"
2438
+ } : {
2439
+ name: "label",
2440
+ fn: w(({ value: B }) => [
2441
+ z(B) ? (t(), x(xe, {
2442
+ key: 0,
2443
+ items: [X(z(B))]
2444
+ }, null, 8, ["items"])) : S("", !0)
2445
+ ]),
2446
+ key: "0"
2447
+ },
2448
+ a(k) ? {
2449
+ name: "footer",
2450
+ fn: w(() => [
2451
+ m("div", hs, [
2452
+ m("span", null, g(a(r)("common.emooSelect.loadFailed")), 1),
2453
+ m("button", {
2454
+ type: "button",
2455
+ "data-testid": "remote-retry",
2456
+ onClick: T[0] || (T[0] = //@ts-ignore
2457
+ (...B) => a(u) && a(u)(...B))
2458
+ }, g(a(r)("common.emooSelect.retry")), 1)
2459
+ ])
2460
+ ]),
2461
+ key: "2"
2462
+ } : void 0
2463
+ ]), 1032, ["model-value", "multiple", "placeholder", "clearable", "remote", "remote-method", "loading", "popper-class", "onVisibleChange"]));
2464
+ }
2465
+ }), Hn = /* @__PURE__ */ Y(ps, [["__scopeId", "data-v-6c4ae65a"]]), ys = {
2466
+ key: 1,
2467
+ class: "emoo-search-box__top"
2468
+ }, bs = {
2469
+ key: 2,
2470
+ class: "emoo-search-box__extras"
2471
+ }, gs = { class: "emoo-search-box__field" }, ks = {
2472
+ key: 3,
2473
+ class: "emoo-search-box__bar"
2474
+ }, $s = {
2475
+ key: 0,
2476
+ class: "emoo-search-box__trailing"
2477
+ }, _s = /* @__PURE__ */ N({
2478
+ __name: "EmooSearchBox",
2479
+ props: {
2480
+ variant: { default: "composer" },
2481
+ grip: { type: Boolean, default: !1 },
2482
+ resizing: { type: Boolean, default: !1 },
2483
+ gripTip: {}
2484
+ },
2485
+ emits: ["grip-mousedown"],
2486
+ setup(e, { emit: i }) {
2487
+ const { t: o } = me(), l = i;
2488
+ return (r, n) => (t(), s("div", {
2489
+ class: W(["emoo-search-box", [
2490
+ `emoo-search-box--${e.variant}`,
2491
+ { "emoo-search-box--resizing": e.resizing }
2492
+ ]])
2493
+ }, [
2494
+ e.grip ? (t(), x(he, {
2495
+ key: 0,
2496
+ content: e.gripTip || a(o)("common.emooSearchBox.gripTip")
2497
+ }, {
2498
+ default: w(() => [
2499
+ m("span", {
2500
+ class: W(["emoo-search-box__grip", { "is-on": e.resizing }]),
2501
+ onMousedown: n[0] || (n[0] = (p) => l("grip-mousedown", p))
2502
+ }, null, 34)
2503
+ ]),
2504
+ _: 1
2505
+ }, 8, ["content"])) : S("", !0),
2506
+ r.$slots.top ? (t(), s("div", ys, [
2507
+ U(r.$slots, "top", {}, void 0, !0)
2508
+ ])) : S("", !0),
2509
+ r.$slots.extras ? (t(), s("div", bs, [
2510
+ U(r.$slots, "extras", {}, void 0, !0)
2511
+ ])) : S("", !0),
2512
+ m("div", gs, [
2513
+ U(r.$slots, "default", {}, void 0, !0)
2514
+ ]),
2515
+ r.$slots.bar || r.$slots.trailing ? (t(), s("div", ks, [
2516
+ U(r.$slots, "bar", {}, void 0, !0),
2517
+ r.$slots.trailing ? (t(), s("div", $s, [
2518
+ U(r.$slots, "trailing", {}, void 0, !0)
2519
+ ])) : S("", !0)
2520
+ ])) : S("", !0)
2521
+ ], 2));
2522
+ }
2523
+ }), Kn = /* @__PURE__ */ Y(_s, [["__scopeId", "data-v-98479d22"]]), ws = ["aria-label"], Ss = ["aria-pressed", "aria-label", "disabled", "onClick"], Cs = { key: 1 }, Es = {
2524
+ key: 2,
2525
+ class: "emoo-segmented__count"
2526
+ }, Ts = /* @__PURE__ */ N({
2527
+ __name: "EmooSegmented",
2528
+ props: {
2529
+ options: {},
2530
+ modelValue: {},
2531
+ size: { default: "default" },
2532
+ disabled: { type: Boolean, default: !1 },
2533
+ ariaLabel: {}
2534
+ },
2535
+ emits: ["update:modelValue", "change"],
2536
+ setup(e, { emit: i }) {
2537
+ const { t: o } = me(), l = e, r = V(() => l.size === "small" ? 12 : l.size === "large" ? 16 : 14), n = i;
2538
+ function p(v) {
2539
+ l.disabled || v.disabled || v.value === l.modelValue || (n("update:modelValue", v.value), n("change", v.value));
2540
+ }
2541
+ return (v, k) => (t(), s("div", {
2542
+ class: W(["emoo-segmented", `emoo-segmented--${e.size}`]),
2543
+ role: "group",
2544
+ "aria-label": e.ariaLabel || a(o)("common.emooSegmented.ariaLabel")
2545
+ }, [
2546
+ (t(!0), s(D, null, J(e.options, (u) => (t(), s("button", {
2547
+ key: u.value,
2548
+ type: "button",
2549
+ class: W(["emoo-segmented__item", { "is-active": u.value === e.modelValue, "is-icon-only": !!u.icon && !u.label }]),
2550
+ "aria-pressed": u.value === e.modelValue,
2551
+ "aria-label": u.ariaLabel,
2552
+ disabled: e.disabled || u.disabled,
2553
+ onClick: (b) => p(u)
2554
+ }, [
2555
+ u.icon ? (t(), x(ze(u.icon), {
2556
+ key: 0,
2557
+ size: r.value,
2558
+ "aria-hidden": "true"
2559
+ }, null, 8, ["size"])) : S("", !0),
2560
+ u.label ? (t(), s("span", Cs, g(u.label), 1)) : S("", !0),
2561
+ u.count !== void 0 ? (t(), s("span", Es, g(u.count), 1)) : S("", !0)
2562
+ ], 10, Ss))), 128))
2563
+ ], 10, ws));
2564
+ }
2565
+ }), Wn = /* @__PURE__ */ Y(Ts, [["__scopeId", "data-v-bcd69b5a"]]), xs = /* @__PURE__ */ N({
2566
+ __name: "EmooSidebarShell",
2567
+ props: {
2568
+ collapsed: { type: Boolean, default: !1 },
2569
+ overlay: { type: Boolean, default: !1 },
2570
+ resizing: { type: Boolean, default: !1 },
2571
+ instant: { type: Boolean, default: !1 },
2572
+ width: { default: void 0 }
2573
+ },
2574
+ setup(e) {
2575
+ const i = e, o = V(() => {
2576
+ if (i.width !== void 0)
2577
+ return { width: typeof i.width == "number" ? `${i.width}px` : i.width };
2578
+ });
2579
+ return (l, r) => (t(), s("aside", {
2580
+ class: W(["emsh", { "collapsed-hidden": e.collapsed, "collapsed-overlay": e.overlay, resizing: e.resizing, instant: e.instant }]),
2581
+ style: pe(o.value)
2582
+ }, [
2583
+ U(l.$slots, "header", {}, void 0, !0),
2584
+ U(l.$slots, "default", {}, void 0, !0),
2585
+ U(l.$slots, "footer", {}, void 0, !0)
2586
+ ], 6));
2587
+ }
2588
+ }), Fn = /* @__PURE__ */ Y(xs, [["__scopeId", "data-v-8f94cc28"]]), zs = /* @__PURE__ */ N({
2589
+ __name: "EmooStatusTag",
2590
+ props: {
2591
+ tone: {},
2592
+ pulse: { type: Boolean }
2593
+ },
2594
+ setup(e) {
2595
+ return (i, o) => (t(), s("span", {
2596
+ class: W(["emoo-status-tag", [`emoo-status-tag--${e.tone}`, { "emoo-status-tag--pulse": e.pulse }]])
2597
+ }, [
2598
+ U(i.$slots, "default", {}, void 0, !0)
2599
+ ], 2));
2600
+ }
2601
+ }), Is = /* @__PURE__ */ Y(zs, [["__scopeId", "data-v-9c6a9ab7"]]), Rs = { class: "emoo-switcher" }, Vs = {
2602
+ key: 0,
2603
+ class: "switcher-title"
2604
+ }, Ms = ["data-testid", "onClick"], Bs = ["src", "alt"], Ds = { class: "switcher-label" }, Ps = /* @__PURE__ */ N({
2605
+ __name: "EmooSwitcherPanel",
2606
+ props: {
2607
+ title: {},
2608
+ items: {},
2609
+ scrollable: { type: Boolean }
2610
+ },
2611
+ emits: ["select"],
2612
+ setup(e, { emit: i }) {
2613
+ const o = e, l = i, { t: r } = me(), n = (u) => r(u.title), p = V(() => o.title ? r(o.title) : ""), v = V(() => o.items.filter((u) => !u.hidden)), k = (u) => {
2614
+ l("select", u), u.action?.();
2615
+ };
2616
+ return (u, b) => (t(), s("div", Rs, [
2617
+ e.title ? (t(), s("p", Vs, g(p.value), 1)) : S("", !0),
2618
+ m("div", {
2619
+ class: W(["switcher-list", { "is-scrollable": e.scrollable }])
2620
+ }, [
2621
+ (t(!0), s(D, null, J(v.value, (_) => (t(), s("button", {
2622
+ key: _.key,
2623
+ type: "button",
2624
+ class: W(["switcher-item", { "is-active": _.active }]),
2625
+ "data-testid": _.testid,
2626
+ onClick: le((y) => k(_), ["stop"])
2627
+ }, [
2628
+ _.image ? (t(), s("img", {
2629
+ key: 0,
2630
+ src: _.image,
2631
+ alt: n(_),
2632
+ class: "switcher-image"
2633
+ }, null, 8, Bs)) : _.icon ? (t(), x(ze(_.icon), {
2634
+ key: 1,
2635
+ class: "ic"
2636
+ })) : S("", !0),
2637
+ m("span", Ds, g(n(_)), 1),
2638
+ _.active ? (t(), x(a(Bt), {
2639
+ key: 2,
2640
+ class: "switcher-check"
2641
+ })) : S("", !0)
2642
+ ], 10, Ms))), 128))
2643
+ ], 2)
2644
+ ]));
2645
+ }
2646
+ }), Nn = /* @__PURE__ */ Y(Ps, [["__scopeId", "data-v-a2309e72"]]), As = /* @__PURE__ */ N({
2647
+ __name: "EmooTagsInput",
2648
+ props: {
2649
+ modelValue: { default: () => [] },
2650
+ placeholder: { default: "" },
2651
+ readonly: { type: Boolean, default: !1 },
2652
+ disabled: { type: Boolean, default: !1 }
2653
+ },
2654
+ emits: ["update:modelValue"],
2655
+ setup(e, { emit: i }) {
2656
+ const o = e, l = i, { t: r } = me(), n = O(""), p = O(!1), v = O(!1), k = O(), u = O(), b = (E) => {
2657
+ l("update:modelValue", o.modelValue.filter(($) => $ !== E));
2658
+ }, _ = () => {
2659
+ p.value = !0, ke(() => k.value?.focus());
2660
+ }, y = () => {
2661
+ const E = n.value;
2662
+ E !== "" && !o.modelValue.includes(E) && l("update:modelValue", [...o.modelValue, E]), p.value = !1, n.value = "", setTimeout(() => u.value?.$el?.focus?.(), 0);
2663
+ }, R = (E) => {
2664
+ !(E instanceof KeyboardEvent) || E.key !== "Enter" || !v.value && !E.isComposing && y();
2665
+ };
2666
+ return (E, $) => (t(), s("div", {
2667
+ class: W(["emoo-tags-input", { "is-disabled": e.disabled }])
2668
+ }, [
2669
+ (t(!0), s(D, null, J(e.modelValue, (z, I) => (t(), x(a(no), {
2670
+ key: `${I}:${z}`,
2671
+ class: "emoo-tags-input__tag",
2672
+ "disable-transitions": !1,
2673
+ closable: !e.readonly && !e.disabled,
2674
+ "data-testid": `tags-tag-${I}`,
2675
+ onClose: (j) => b(z)
2676
+ }, {
2677
+ default: w(() => [
2678
+ Z(g(z), 1)
2679
+ ]),
2680
+ _: 2
2681
+ }, 1032, ["closable", "data-testid", "onClose"]))), 128)),
2682
+ !e.readonly && !e.disabled ? (t(), s(D, { key: 0 }, [
2683
+ p.value ? (t(), x(a(tt), {
2684
+ key: 0,
2685
+ ref_key: "inputRef",
2686
+ ref: k,
2687
+ modelValue: n.value,
2688
+ "onUpdate:modelValue": $[0] || ($[0] = (z) => n.value = z),
2689
+ class: "emoo-tags-input__input",
2690
+ size: "small",
2691
+ placeholder: e.placeholder,
2692
+ "data-testid": "tags-input",
2693
+ onCompositionstart: $[1] || ($[1] = (z) => v.value = !0),
2694
+ onCompositionend: $[2] || ($[2] = (z) => v.value = !1),
2695
+ onKeydown: R,
2696
+ onBlur: y
2697
+ }, null, 8, ["modelValue", "placeholder"])) : (t(), x(De, {
2698
+ key: 1,
2699
+ ref_key: "addButtonRef",
2700
+ ref: u,
2701
+ class: "emoo-tags-input__add",
2702
+ size: "small",
2703
+ "data-testid": "tags-add",
2704
+ onClick: _
2705
+ }, {
2706
+ default: w(() => [
2707
+ Z(" + " + g(a(r)("common.emooTagsInput.add")), 1)
2708
+ ]),
2709
+ _: 1
2710
+ }, 512))
2711
+ ], 64)) : S("", !0)
2712
+ ], 2));
2713
+ }
2714
+ }), qn = /* @__PURE__ */ Y(As, [["__scopeId", "data-v-2b248a6f"]]), Ls = 140, ot = 64;
2715
+ function Os(e) {
2716
+ const i = e.minColWidth ?? ot, o = (C) => e.columns().find((A) => A.key === C), l = () => e.columns().map((C) => ({ key: C.key, visible: !0, fixed: "" })), r = (C) => {
2717
+ if (!Array.isArray(C)) return l();
2718
+ const A = /* @__PURE__ */ new Map(), Q = [];
2719
+ for (const L of C) {
2720
+ if (!L || typeof L != "object") continue;
2721
+ const G = L;
2722
+ !G.key || !e.columns().some((oe) => oe.key === G.key) || (A.set(G.key, G), Q.push(G.key));
2723
+ }
2724
+ const ae = new Map(Q.map((L, G) => [L, G])), M = e.columns().map((L) => {
2725
+ const G = A.get(L.key);
2726
+ return {
2727
+ key: L.key,
2728
+ visible: typeof G?.visible == "boolean" ? G.visible : !0,
2729
+ fixed: G?.fixed === "left" || G?.fixed === "right" ? G.fixed : "",
2730
+ width: typeof G?.width == "number" && G.width >= i ? Math.round(G.width) : void 0
2731
+ };
2732
+ });
2733
+ return !Q.length || e.persistOrder === !1 ? M : [...M].sort((L, G) => (ae.get(L.key) ?? M.length) - (ae.get(G.key) ?? M.length));
2734
+ }, n = (C) => !!C && typeof C == "object" && typeof C.key == "string" && (C.order === "ascending" || C.order === "descending"), p = () => {
2735
+ if (!e.storageKey) return { columns: l() };
2736
+ try {
2737
+ const C = localStorage.getItem(e.storageKey);
2738
+ if (!C) return { columns: l() };
2739
+ const A = JSON.parse(C);
2740
+ if (Array.isArray(A)) return { columns: r(A) };
2741
+ if (A && typeof A == "object") {
2742
+ const Q = A;
2743
+ return {
2744
+ columns: r(Q.columns),
2745
+ pageSize: typeof Q.pageSize == "number" ? Q.pageSize : void 0,
2746
+ sort: n(Q.sort) ? Q.sort : void 0,
2747
+ density: Q.density === "compact" ? "compact" : "default"
2748
+ };
2749
+ }
2750
+ } catch {
2751
+ }
2752
+ return { columns: l() };
2753
+ }, v = p(), k = O(v.columns), u = O(v.pageSize ?? e.defaultPageSize ?? 20), b = O(v.density ?? "default"), _ = () => {
2754
+ if (!e.storageKey) return;
2755
+ const C = {
2756
+ columns: k.value,
2757
+ pageSize: u.value,
2758
+ sort: T.value && B.value ? { key: T.value, order: B.value } : void 0,
2759
+ density: b.value
2760
+ };
2761
+ localStorage.setItem(e.storageKey, JSON.stringify(C));
2762
+ };
2763
+ we(
2764
+ k,
2765
+ () => {
2766
+ _(), ke(() => e.onColumnsChange?.());
2767
+ },
2768
+ { deep: !0 }
2769
+ );
2770
+ const y = V(() => k.value.filter((C) => C.visible)), R = V(() => y.value.length), E = V(() => k.value.filter((C) => !C.visible)), $ = (C) => C.width ?? (o(C.key)?.minWidth ? void 0 : o(C.key)?.width), z = (C) => C.width ?? o(C.key)?.minWidth, I = (C) => (C.width ?? o(C.key)?.width ?? o(C.key)?.minWidth ?? 0) >= Ls, j = (C) => {
2771
+ R.value <= 1 || (C.visible = !1);
2772
+ }, X = () => {
2773
+ k.value = l();
2774
+ }, ie = (C) => k.value.some((A) => A.key === C.key && A.visible && !!o(C.key)?.sortable), ee = v.sort && ie(v.sort) ? v.sort : null, d = ee ?? (e.defaultSort && ie(e.defaultSort) ? e.defaultSort : null), T = O(d?.key ?? ""), B = O(d?.order ?? null), se = () => v.sort && ie(v.sort) ? v.sort : null;
2775
+ we([u, b, T, B], _), we(
2776
+ () => e.columns().map((C) => C.key).join(","),
2777
+ () => {
2778
+ k.value = p().columns;
2779
+ }
2780
+ );
2781
+ const ne = (C) => {
2782
+ e.storageKey && localStorage.removeItem(e.storageKey), k.value = l(), u.value = e.defaultPageSize ?? 20, b.value = "default", e.defaultSort ? C(e.defaultSort.key, e.defaultSort.order) : C("", null);
2783
+ }, ye = () => {
2784
+ const C = k.value.filter((ae) => ae.visible);
2785
+ let A = !1;
2786
+ for (const ae of C)
2787
+ ae.fixed === "left" ? A && (ae.fixed = "") : A = !0;
2788
+ let Q = !1;
2789
+ for (let ae = C.length - 1; ae >= 0; ae--) {
2790
+ const M = C[ae];
2791
+ M.fixed === "right" ? Q && (M.fixed = "") : Q = !0;
2792
+ }
2793
+ }, q = (C) => {
2794
+ for (const A of k.value) A.fixed === C && (A.fixed = "");
2795
+ }, de = (C) => {
2796
+ C.fixed && q(C.fixed);
2797
+ }, ce = (C, A) => {
2798
+ const Q = y.value, ae = Q.findIndex((M) => M.key === C.key);
2799
+ ae < 0 || (Q.forEach((M, L) => {
2800
+ (A === "left" ? L <= ae : L >= ae) ? M.fixed = A : M.fixed === A && (M.fixed = "");
2801
+ }), ye());
2802
+ }, H = (C) => {
2803
+ const A = y.value;
2804
+ if (C === "left") {
2805
+ let Q = -1;
2806
+ return A.forEach((ae, M) => {
2807
+ ae.fixed === "left" && (Q = M);
2808
+ }), Q;
2809
+ }
2810
+ return A.findIndex((Q) => Q.fixed === "right");
2811
+ }, te = (C, A) => {
2812
+ const ae = y.value.findIndex((M) => M.key === C.key);
2813
+ if (C.fixed !== A) {
2814
+ ce(C, A);
2815
+ return;
2816
+ }
2817
+ ae === H(A) ? q(A) : ce(C, A);
2818
+ };
2819
+ return {
2820
+ // 状态
2821
+ colState: k,
2822
+ pageSize: u,
2823
+ density: b,
2824
+ sortKey: T,
2825
+ sortOrder: B,
2826
+ effectiveStoredSort: se,
2827
+ prefs: v,
2828
+ storageSort: ee,
2829
+ restoredSort: d,
2830
+ // 记忆
2831
+ savePrefs: _,
2832
+ resetPrefsCore: ne,
2833
+ // 派生
2834
+ visibleCols: y,
2835
+ hiddenCols: E,
2836
+ visibleCount: R,
2837
+ defOf: o,
2838
+ colWidth: $,
2839
+ colMinWidth: z,
2840
+ isWide: I,
2841
+ // 列操作
2842
+ hideColumn: j,
2843
+ resetColumns: X,
2844
+ normalizeColumns: ye,
2845
+ unpinSide: q,
2846
+ unpinCurrent: de,
2847
+ pinThrough: ce,
2848
+ pinEdge: H,
2849
+ togglePinSide: te,
2850
+ togglePinSmart: (C) => {
2851
+ if (C.fixed) {
2852
+ te(C, C.fixed);
2853
+ return;
2854
+ }
2855
+ const A = y.value, Q = A.findIndex((ae) => ae.key === C.key);
2856
+ ce(C, Q < A.length / 2 ? "left" : "right");
2857
+ }
2858
+ };
2859
+ }
2860
+ const Us = ["aria-label", "data-testid", "onDragstart"], Hs = ["onDragover", "onDragleave", "onDrop"], Ks = ["aria-label", "data-testid", "onDragstart"], Ws = { class: "emt-th__label" }, Fs = ["data-testid", "onClick"], Ns = { class: "emt-th__tools" }, qs = ["data-testid", "onClick"], js = ["disabled", "data-testid", "onClick"], Gs = ["title", "aria-label", "data-testid"], Xs = ["data-testid", "onMousedown"], Js = ["aria-label"], Ys = ["aria-label"], Zs = ["aria-label"], Qs = /* @__PURE__ */ N({
2861
+ __name: "EmooTable",
2862
+ props: {
2863
+ data: {},
2864
+ columns: {},
2865
+ storageKey: {},
2866
+ selectable: { type: Boolean, default: !1 },
2867
+ reorderable: { type: Boolean },
2868
+ expandable: { type: Boolean },
2869
+ expandRowKeys: {},
2870
+ actionsWidth: { default: 90 },
2871
+ rowKey: {},
2872
+ rowClassName: {},
2873
+ total: {},
2874
+ page: {},
2875
+ defaultPageSize: { default: 20 },
2876
+ pageSizes: { default: () => [10, 20, 50, 100] },
2877
+ loading: { type: Boolean },
2878
+ defaultSort: {},
2879
+ height: {},
2880
+ maxHeight: {},
2881
+ defaultDensity: {}
2882
+ },
2883
+ emits: ["sort-change", "selection-change", "update:page", "size-change", "row-click", "row-move"],
2884
+ setup(e, { expose: i, emit: o }) {
2885
+ const { t: l } = me(), r = e, n = o, p = O(), v = (h) => r.columns.find((c) => c.key === h), k = V(() => {
2886
+ const h = r.rowKey;
2887
+ return typeof h != "function" ? h : (c) => String(h(c));
2888
+ }), u = (h) => v(h)?.sortBy, b = (h) => {
2889
+ const c = v(h);
2890
+ return c ? c.ellipsis != null ? c.ellipsis : (c.width ?? c.minWidth ?? 1 / 0) >= 50 : !1;
2891
+ }, {
2892
+ colState: _,
2893
+ pageSize: y,
2894
+ density: R,
2895
+ sortKey: E,
2896
+ sortOrder: $,
2897
+ storageSort: z,
2898
+ restoredSort: I,
2899
+ resetPrefsCore: j,
2900
+ visibleCols: X,
2901
+ hiddenCols: ie,
2902
+ visibleCount: ee,
2903
+ colWidth: d,
2904
+ colMinWidth: T,
2905
+ isWide: B,
2906
+ hideColumn: se,
2907
+ resetColumns: ne,
2908
+ normalizeColumns: ye,
2909
+ unpinCurrent: q,
2910
+ pinEdge: de,
2911
+ togglePinSide: ce,
2912
+ togglePinSmart: H
2913
+ } = Os({
2914
+ columns: () => r.columns,
2915
+ storageKey: r.storageKey,
2916
+ defaultPageSize: r.defaultPageSize,
2917
+ defaultSort: r.defaultSort,
2918
+ // 列宽/钉住/显隐/顺序变化后强制重排,否则 sticky 钉列会按旧宽度错位
2919
+ onColumnsChange: () => {
2920
+ ke(() => {
2921
+ p.value?.doLayout(), requestAnimationFrame(Te);
2922
+ });
2923
+ }
2924
+ }), te = () => {
2925
+ j((h, c) => {
2926
+ c === null ? Le("", null) : p.value?.sort(h, c);
2927
+ }), n("size-change", y.value), ke(() => {
2928
+ p.value?.doLayout(), Te();
2929
+ });
2930
+ }, F = (h) => {
2931
+ const c = X.value, f = c.findIndex((K) => K.key === h.key);
2932
+ return h.fixed === "left" ? f === de("left") ? l("common.emooTable.unpin") : l("common.emooTable.pinLeftThrough") : h.fixed === "right" ? f === de("right") ? l("common.emooTable.unpin") : l("common.emooTable.pinRightFrom") : f < c.length / 2 ? l("common.emooTable.pinLeftThrough") : l("common.emooTable.pinRightFrom");
2933
+ }, C = O(""), A = O(""), Q = O("left"), ae = (h, c) => {
2934
+ C.value = h.key, c.dataTransfer && (c.dataTransfer.effectAllowed = "move", c.dataTransfer.setData("text/plain", h.key));
2935
+ }, M = () => {
2936
+ C.value = "", A.value = "";
2937
+ }, L = (h, c) => {
2938
+ if (!C.value) return;
2939
+ if (C.value === h.key) {
2940
+ A.value = "";
2941
+ return;
2942
+ }
2943
+ A.value = h.key;
2944
+ const f = c.currentTarget.getBoundingClientRect();
2945
+ Q.value = c.clientX < f.left + f.width / 2 ? "left" : "right";
2946
+ }, G = (h, c) => {
2947
+ if (A.value !== h.key) return;
2948
+ const f = c.currentTarget;
2949
+ !f || f.contains(c.relatedTarget) || (A.value = "");
2950
+ }, oe = (h) => {
2951
+ const c = _.value.findIndex((_e) => _e.key === C.value), f = _.value.findIndex((_e) => _e.key === h.key), K = Q.value;
2952
+ if (M(), c < 0 || f < 0 || c === f) return;
2953
+ let ue = K === "left" ? f : f + 1;
2954
+ const [fe] = _.value.splice(c, 1);
2955
+ c < ue && (ue -= 1), _.value.splice(ue, 0, fe), ye();
2956
+ }, re = O(-1), Ce = O(-1), Ye = O("above"), Kt = (h, c) => {
2957
+ re.value = h, c.dataTransfer && (c.dataTransfer.effectAllowed = "move", c.dataTransfer.setData("text/plain", String(h)));
2958
+ }, rt = () => {
2959
+ re.value = -1, Ce.value = -1;
2960
+ }, dt = (h) => {
2961
+ const c = h.target.closest(".el-table__body tr"), f = c?.parentElement;
2962
+ if (!c || !f) return null;
2963
+ const K = [...f.children].indexOf(c);
2964
+ if (K < 0) return null;
2965
+ const ue = c.getBoundingClientRect();
2966
+ return { idx: K, side: h.clientY < ue.top + ue.height / 2 ? "above" : "below" };
2967
+ }, Wt = (h) => {
2968
+ if (re.value < 0) return;
2969
+ h.preventDefault(), h.dataTransfer && (h.dataTransfer.dropEffect = "move");
2970
+ const c = dt(h);
2971
+ if (!c) {
2972
+ Ce.value = -1;
2973
+ return;
2974
+ }
2975
+ Ce.value = c.idx, Ye.value = c.side;
2976
+ }, Ft = (h) => {
2977
+ if (re.value < 0) return;
2978
+ const c = h.relatedTarget;
2979
+ c && h.currentTarget.contains(c) || (Ce.value = -1);
2980
+ }, Nt = (h) => {
2981
+ if (re.value < 0) return;
2982
+ h.preventDefault();
2983
+ const c = dt(h), f = re.value;
2984
+ if (rt(), !c) return;
2985
+ let K = c.side === "above" ? c.idx : c.idx + 1;
2986
+ f < K && (K -= 1), K !== f && n("row-move", { from: f, to: K });
2987
+ }, qt = (h, c) => {
2988
+ c.preventDefault(), c.stopPropagation();
2989
+ const f = _.value.find((Re) => Re.key === h);
2990
+ if (!f) return;
2991
+ const K = c.clientX, ue = f.width ?? v(h)?.width ?? v(h)?.minWidth ?? ot, fe = (Re) => {
2992
+ f.width = Math.max(ot, Math.round(ue + Re.clientX - K));
2993
+ }, _e = () => {
2994
+ window.removeEventListener("mousemove", fe), window.removeEventListener("mouseup", _e);
2995
+ };
2996
+ window.addEventListener("mousemove", fe), window.addEventListener("mouseup", _e);
2997
+ }, jt = I ? { prop: I.key, order: I.order } : void 0, ut = ({ prop: h, order: c }) => {
2998
+ E.value = h ?? "", $.value = c, n("sort-change", { key: h ?? "", order: c });
2999
+ }, Le = (h, c) => {
3000
+ c === null ? (p.value?.clearSort(), ut({ prop: "", order: null })) : p.value?.sort(h, c);
3001
+ }, Gt = (h) => {
3002
+ if (E.value !== h) {
3003
+ Le(h, "ascending");
3004
+ return;
3005
+ }
3006
+ Le(h, $.value === "ascending" ? "descending" : $.value === "descending" ? null : "ascending");
3007
+ }, Ee = O([]), Xt = (h) => {
3008
+ Ee.value = h, n("selection-change", h);
3009
+ }, Jt = (h) => [
3010
+ Ee.value.includes(h.row) ? "emt-row-selected" : "",
3011
+ r.rowClassName?.(h) ?? "",
3012
+ Yt(h.rowIndex)
3013
+ ].filter(Boolean).join(" "), Yt = (h) => {
3014
+ if (re.value < 0 || Ce.value !== h) return "";
3015
+ let c = Ye.value === "above" ? Ce.value : Ce.value + 1;
3016
+ return re.value < c && (c -= 1), c === re.value ? "" : Ye.value === "above" ? "emt-drop-above" : "emt-drop-below";
3017
+ }, Zt = () => p.value?.clearSelection(), $e = O(-1), ge = { active: !1, state: !1, last: -1 }, Oe = () => p.value?.store?.states?.data?.value ?? r.data, Ze = (h) => {
3018
+ const c = h.target.closest("tr"), f = c?.parentElement;
3019
+ return !c || !f ? -1 : [...f.children].indexOf(c);
3020
+ }, Ue = (h, c) => {
3021
+ const f = Oe()[h];
3022
+ f && Ee.value.includes(f) !== c && p.value?.toggleRowSelection(f, c);
3023
+ }, ct = (h) => {
3024
+ const c = h.target, f = c.closest(".el-checkbox");
3025
+ return f && c.closest(".el-table__body") ? f : null;
3026
+ }, mt = (h) => {
3027
+ if (!ct(h) || (h.preventDefault(), h.stopPropagation(), !h.shiftKey)) return;
3028
+ const c = Ze(h);
3029
+ if (!(c < 0))
3030
+ if ($e.value >= 0 && $e.value !== c) {
3031
+ const f = !Ee.value.includes(Oe()[c]), [K, ue] = $e.value < c ? [$e.value, c] : [c, $e.value];
3032
+ for (let fe = K; fe <= ue; fe++) Ue(fe, f);
3033
+ } else
3034
+ Ue(c, !Ee.value.includes(Oe()[c])), $e.value = c;
3035
+ }, vt = (h) => {
3036
+ if (!ct(h) || (h.preventDefault(), h.shiftKey)) return;
3037
+ const c = Ze(h);
3038
+ c < 0 || (ge.active = !0, ge.state = !Ee.value.includes(Oe()[c]), ge.last = c, Ue(c, ge.state), $e.value = c);
3039
+ }, ft = (h) => {
3040
+ if (!ge.active || !h.target.closest(".el-table__body")) return;
3041
+ const f = Ze(h);
3042
+ f < 0 || f === ge.last || (Ue(f, ge.state), ge.last = f);
3043
+ }, ht = () => {
3044
+ ge.active = !1;
3045
+ };
3046
+ we(
3047
+ () => Ee.value.length,
3048
+ (h) => {
3049
+ h === 0 && ($e.value = -1);
3050
+ }
3051
+ );
3052
+ const pt = O(), yt = O(!1), bt = O(!1);
3053
+ let be = null, He = null;
3054
+ const Te = () => {
3055
+ be && (yt.value = be.scrollLeft > 2, bt.value = be.scrollLeft + be.clientWidth < be.scrollWidth - 2);
3056
+ }, gt = (h) => {
3057
+ be?.scrollBy({ left: h * 280, behavior: "smooth" });
3058
+ }, Ke = O(""), kt = (h) => {
3059
+ const c = pt.value;
3060
+ if (!c) return;
3061
+ const f = (ue) => {
3062
+ if (!ue) return !1;
3063
+ const fe = ue.getBoundingClientRect(), _e = fe.x + fe.width / 2, Re = fe.y + fe.height / 2;
3064
+ return Math.hypot(h.clientX - _e, h.clientY - Re) < 26;
3065
+ }, K = f(c.querySelector(".emt-scrollbtn.is-left")) ? "left" : f(c.querySelector(".emt-scrollbtn.is-right")) ? "right" : "";
3066
+ K !== Ke.value && (Ke.value = K);
3067
+ };
3068
+ return Xe(() => {
3069
+ document.addEventListener("mousemove", kt, !0);
3070
+ const h = p.value?.$el;
3071
+ h?.addEventListener("click", mt, !0), h?.addEventListener("mousedown", vt, !0), h?.addEventListener("mouseover", ft, !0), window.addEventListener("mouseup", ht), be = h?.querySelector(".el-table__body-wrapper .el-scrollbar__wrap") ?? h?.querySelector(".el-table__body-wrapper") ?? null, be?.addEventListener("scroll", Te, { passive: !0 }), be && (He = new ResizeObserver(Te), He.observe(be), be.firstElementChild instanceof HTMLElement && He.observe(be.firstElementChild)), Te(), z && n("sort-change", { key: z.key, order: z.order });
3072
+ }), we(X, () => ke(Te)), at(() => {
3073
+ document.removeEventListener("mousemove", kt, !0);
3074
+ const h = p.value?.$el;
3075
+ h?.removeEventListener("click", mt, !0), h?.removeEventListener("mousedown", vt, !0), h?.removeEventListener("mouseover", ft, !0), window.removeEventListener("mouseup", ht), be?.removeEventListener("scroll", Te), He?.disconnect();
3076
+ }), i({
3077
+ colState: _,
3078
+ pageSize: y,
3079
+ density: R,
3080
+ resetColumns: ne,
3081
+ resetTablePrefs: te,
3082
+ normalizeColumns: ye,
3083
+ togglePinSide: ce,
3084
+ togglePinSmart: H,
3085
+ clearSelection: Zt,
3086
+ toggleRowSelection: (h, c) => p.value?.toggleRowSelection(h, c),
3087
+ toggleRowExpansion: (h, c) => p.value?.toggleRowExpansion(h, c)
3088
+ }), (h, c) => (t(), s("div", {
3089
+ class: W(["emt", { "is-compact": a(R) === "compact", "is-comfort": a(R) !== "compact" && e.defaultDensity === "comfort" }])
3090
+ }, [
3091
+ m("div", {
3092
+ ref_key: "scrollWrapRef",
3093
+ ref: pt,
3094
+ class: W(["emt-scroll", { "is-dragging": !!C.value, "is-rowdragging": re.value >= 0 }]),
3095
+ onDragover: Wt,
3096
+ onDragleave: Ft,
3097
+ onDrop: Nt
3098
+ }, [
3099
+ P(a(io), {
3100
+ ref_key: "tableRef",
3101
+ ref: p,
3102
+ data: e.data,
3103
+ "row-key": k.value,
3104
+ "row-class-name": Jt,
3105
+ "default-sort": a(jt),
3106
+ height: e.height,
3107
+ "max-height": e.maxHeight,
3108
+ "expand-row-keys": e.expandable ? e.expandRowKeys : void 0,
3109
+ "tooltip-options": { popperClass: "emo-tip", showAfter: 300, placement: "top", transition: "el-fade-in-linear" },
3110
+ onSelectionChange: Xt,
3111
+ onSortChange: ut,
3112
+ onRowClick: c[6] || (c[6] = (f, K, ue) => n("row-click", f, K, ue))
3113
+ }, {
3114
+ empty: w(() => [
3115
+ U(h.$slots, "empty", {}, void 0, !0)
3116
+ ]),
3117
+ default: w(() => [
3118
+ e.expandable ? (t(), x(a(Ve), {
3119
+ key: 0,
3120
+ type: "expand"
3121
+ }, {
3122
+ default: w((f) => [
3123
+ f.$index !== -1 ? U(h.$slots, "expand", Fe(Ne(f)), void 0, !0, 0) : S("", !0)
3124
+ ]),
3125
+ _: 3
3126
+ })) : S("", !0),
3127
+ e.reorderable ? (t(), x(a(Ve), {
3128
+ key: 1,
3129
+ width: 24,
3130
+ fixed: "left",
3131
+ align: "center",
3132
+ "class-name": "emt-col-rowdrag"
3133
+ }, {
3134
+ header: w(() => [...c[12] || (c[12] = [
3135
+ m("span", null, null, -1)
3136
+ ])]),
3137
+ default: w(({ $index: f }) => [
3138
+ P(he, {
3139
+ content: a(l)("common.emooTable.dragToReorderRows")
3140
+ }, {
3141
+ default: w(() => [
3142
+ m("button", {
3143
+ class: "emt-rowdrag",
3144
+ type: "button",
3145
+ draggable: "true",
3146
+ "aria-label": a(l)("common.emooTable.dragToReorderRows"),
3147
+ "data-testid": `emt-rowdrag-${f}`,
3148
+ onClick: c[0] || (c[0] = le(() => {
3149
+ }, ["stop"])),
3150
+ onDragstart: (K) => Kt(f, K),
3151
+ onDragend: rt
3152
+ }, [
3153
+ P(a(_t), {
3154
+ size: 12,
3155
+ "aria-hidden": "true"
3156
+ })
3157
+ ], 40, Us)
3158
+ ]),
3159
+ _: 2
3160
+ }, 1032, ["content"])
3161
+ ]),
3162
+ _: 1
3163
+ })) : S("", !0),
3164
+ e.selectable ? (t(), x(a(Ve), {
3165
+ key: 2,
3166
+ type: "selection",
3167
+ width: "28",
3168
+ fixed: "left",
3169
+ "reserve-selection": !!e.rowKey
3170
+ }, null, 8, ["reserve-selection"])) : S("", !0),
3171
+ (t(!0), s(D, null, J(a(X), (f) => (t(), x(a(Ve), {
3172
+ key: f.key,
3173
+ prop: f.key,
3174
+ label: v(f.key)?.label,
3175
+ sortable: v(f.key)?.sortable ?? !1,
3176
+ "sort-by": u(f.key),
3177
+ "show-overflow-tooltip": b(f.key),
3178
+ resizable: v(f.key)?.resizable ?? !0,
3179
+ width: a(d)(f),
3180
+ "min-width": a(T)(f),
3181
+ align: v(f.key)?.align,
3182
+ fixed: f.fixed === "" ? !1 : f.fixed
3183
+ }, {
3184
+ header: w(() => [
3185
+ m("div", {
3186
+ class: W(["emt-th", {
3187
+ "is-drop-left": A.value === f.key && Q.value === "left",
3188
+ "is-drop-right": A.value === f.key && Q.value === "right"
3189
+ }]),
3190
+ onDragover: le((K) => L(f, K), ["prevent"]),
3191
+ onDragleave: (K) => G(f, K),
3192
+ onDrop: le((K) => oe(f), ["prevent"])
3193
+ }, [
3194
+ P(he, {
3195
+ content: a(l)("common.emooTable.dragToReorder")
3196
+ }, {
3197
+ default: w(() => [
3198
+ m("button", {
3199
+ class: "emt-th__grip",
3200
+ type: "button",
3201
+ draggable: "true",
3202
+ "aria-label": a(l)("common.emooTable.dragToReorderCol", { col: v(f.key)?.label }),
3203
+ "data-testid": `emt-th-grip-${f.key}`,
3204
+ onClick: c[1] || (c[1] = le(() => {
3205
+ }, ["stop"])),
3206
+ onDragstart: (K) => ae(f, K),
3207
+ onDragend: M
3208
+ }, [
3209
+ P(a(_t), {
3210
+ size: 12,
3211
+ "aria-hidden": "true"
3212
+ })
3213
+ ], 40, Ks)
3214
+ ]),
3215
+ _: 2
3216
+ }, 1032, ["content"]),
3217
+ m("span", Ws, g(v(f.key)?.label), 1),
3218
+ U(h.$slots, `${f.key}-header`, {
3219
+ col: v(f.key)
3220
+ }, void 0, !0),
3221
+ v(f.key)?.sortable ? (t(), x(he, {
3222
+ key: 0,
3223
+ content: a(l)("common.emooTable.sort")
3224
+ }, {
3225
+ default: w(() => [
3226
+ m("button", {
3227
+ class: "emt-th__sort",
3228
+ type: "button",
3229
+ "data-testid": `emt-th-sort-${f.key}`,
3230
+ onClick: le((K) => Gt(f.key), ["stop"])
3231
+ }, [
3232
+ a(E) === f.key && a($) === "ascending" ? (t(), x(a(It), {
3233
+ key: 0,
3234
+ size: 12,
3235
+ weight: "bold",
3236
+ "aria-hidden": "true"
3237
+ })) : a(E) === f.key && a($) === "descending" ? (t(), x(a(it), {
3238
+ key: 1,
3239
+ size: 12,
3240
+ weight: "bold",
3241
+ "aria-hidden": "true"
3242
+ })) : (t(), x(a(yo), {
3243
+ key: 2,
3244
+ size: 12,
3245
+ class: "emt-th__sortidle",
3246
+ "aria-hidden": "true"
3247
+ }))
3248
+ ], 8, Fs)
3249
+ ]),
3250
+ _: 2
3251
+ }, 1032, ["content"])) : S("", !0),
3252
+ c[13] || (c[13] = m("span", { class: "emt-th__spacer" }, null, -1)),
3253
+ m("span", Ns, [
3254
+ a(B)(f) || f.fixed ? (t(), x(he, {
3255
+ key: 0,
3256
+ content: F(f)
3257
+ }, {
3258
+ default: w(() => [
3259
+ m("button", {
3260
+ class: W(["emt-th__tool", { "is-on": !!f.fixed }]),
3261
+ type: "button",
3262
+ "data-testid": `emt-th-pin-${f.key}`,
3263
+ onClick: le((K) => a(H)(f), ["stop"])
3264
+ }, [
3265
+ P(a(bo), {
3266
+ size: 13,
3267
+ weight: f.fixed ? "fill" : void 0,
3268
+ "aria-hidden": "true"
3269
+ }, null, 8, ["weight"])
3270
+ ], 10, qs)
3271
+ ]),
3272
+ _: 2
3273
+ }, 1032, ["content"])) : S("", !0),
3274
+ a(B)(f) ? (t(), x(he, {
3275
+ key: 1,
3276
+ content: a(l)("common.emooTable.hideColumn")
3277
+ }, {
3278
+ default: w(() => [
3279
+ m("button", {
3280
+ class: "emt-th__tool",
3281
+ type: "button",
3282
+ disabled: a(ee) === 1,
3283
+ "data-testid": `emt-th-hide-${f.key}`,
3284
+ onClick: le((K) => a(se)(f), ["stop"])
3285
+ }, [
3286
+ P(a(Rt), {
3287
+ size: 13,
3288
+ "aria-hidden": "true"
3289
+ })
3290
+ ], 8, js)
3291
+ ]),
3292
+ _: 2
3293
+ }, 1032, ["content"])) : S("", !0),
3294
+ P(ma, {
3295
+ "col-key": f.key,
3296
+ sortable: v(f.key)?.sortable,
3297
+ sorted: a(E) === f.key ? a($) : null,
3298
+ "pins-enabled": "",
3299
+ fixed: f.fixed,
3300
+ "can-hide": a(ee) > 1,
3301
+ hidden: a(ie).map((K) => ({ key: K.key, label: v(K.key)?.label ?? K.key })),
3302
+ resettable: "",
3303
+ onSort: (K) => Le(f.key, K),
3304
+ onUnpin: (K) => a(q)(f),
3305
+ onPin: (K) => a(ce)(f, K),
3306
+ onHide: (K) => a(se)(f),
3307
+ onRestore: c[4] || (c[4] = (K) => {
3308
+ const ue = a(_).find((fe) => fe.key === K);
3309
+ ue && (ue.visible = !0);
3310
+ }),
3311
+ onReset: te
3312
+ }, {
3313
+ default: w(() => [
3314
+ m("button", {
3315
+ class: "emt-th__tool emt-th__dots",
3316
+ type: "button",
3317
+ title: a(l)("common.emooTable.colActions"),
3318
+ "aria-label": a(l)("common.emooTable.colActionsCol", { col: v(f.key)?.label }),
3319
+ "data-testid": `emt-th-menu-${f.key}`,
3320
+ onClick: c[2] || (c[2] = le(() => {
3321
+ }, ["stop"])),
3322
+ onMousedown: c[3] || (c[3] = le(() => {
3323
+ }, ["stop"]))
3324
+ }, [
3325
+ P(a(Mt), {
3326
+ size: 14,
3327
+ weight: "bold",
3328
+ "aria-hidden": "true"
3329
+ })
3330
+ ], 40, Gs)
3331
+ ]),
3332
+ _: 2
3333
+ }, 1032, ["col-key", "sortable", "sorted", "fixed", "can-hide", "hidden", "onSort", "onUnpin", "onPin", "onHide"])
3334
+ ]),
3335
+ v(f.key)?.resizable ?? !0 ? (t(), x(he, {
3336
+ key: 1,
3337
+ content: a(l)("common.emooTable.dragToResize")
3338
+ }, {
3339
+ default: w(() => [
3340
+ m("span", {
3341
+ class: "emt-th__resize",
3342
+ "data-testid": `emt-th-resize-${f.key}`,
3343
+ onMousedown: (K) => qt(f.key, K),
3344
+ onClick: c[5] || (c[5] = le(() => {
3345
+ }, ["stop"]))
3346
+ }, null, 40, Xs)
3347
+ ]),
3348
+ _: 2
3349
+ }, 1032, ["content"])) : S("", !0)
3350
+ ], 42, Hs)
3351
+ ]),
3352
+ default: w(({ row: K, $index: ue }) => [
3353
+ ue !== -1 ? U(h.$slots, f.key, {
3354
+ row: K,
3355
+ index: ue
3356
+ }, () => [
3357
+ Z(g(K[f.key]), 1)
3358
+ ], !0, 0) : S("", !0)
3359
+ ]),
3360
+ _: 2
3361
+ }, 1032, ["prop", "label", "sortable", "sort-by", "show-overflow-tooltip", "resizable", "width", "min-width", "align", "fixed"]))), 128)),
3362
+ h.$slots.actions ? (t(), x(a(Ve), {
3363
+ key: 3,
3364
+ width: e.actionsWidth,
3365
+ align: "right",
3366
+ fixed: "right",
3367
+ "class-name": "emt-col-actions"
3368
+ }, {
3369
+ default: w((f) => [
3370
+ f.$index !== -1 ? U(h.$slots, "actions", Fe(Ne(f)), void 0, !0, 0) : S("", !0)
3371
+ ]),
3372
+ _: 3
3373
+ }, 8, ["width"])) : S("", !0)
3374
+ ]),
3375
+ _: 3
3376
+ }, 8, ["data", "row-key", "default-sort", "height", "max-height", "expand-row-keys"]),
3377
+ P(he, {
3378
+ content: a(l)("common.emooTable.scrollLeft")
3379
+ }, {
3380
+ default: w(() => [
3381
+ We(m("button", {
3382
+ class: W(["emt-scrollbtn is-left", { "is-live": Ke.value === "left" }]),
3383
+ type: "button",
3384
+ "aria-label": a(l)("common.emooTable.scrollLeft"),
3385
+ "data-testid": "emt-scroll-left",
3386
+ onClick: c[7] || (c[7] = (f) => gt(-1))
3387
+ }, [
3388
+ P(a(Dt), {
3389
+ size: 14,
3390
+ "aria-hidden": "true"
3391
+ })
3392
+ ], 10, Js), [
3393
+ [et, yt.value]
3394
+ ])
3395
+ ]),
3396
+ _: 1
3397
+ }, 8, ["content"]),
3398
+ P(he, {
3399
+ content: a(l)("common.emooTable.scrollRight")
3400
+ }, {
3401
+ default: w(() => [
3402
+ We(m("button", {
3403
+ class: W(["emt-scrollbtn is-right", { "is-live": Ke.value === "right" }]),
3404
+ type: "button",
3405
+ "aria-label": a(l)("common.emooTable.scrollRight"),
3406
+ "data-testid": "emt-scroll-right",
3407
+ onClick: c[8] || (c[8] = (f) => gt(1))
3408
+ }, [
3409
+ P(a(je), {
3410
+ size: 14,
3411
+ "aria-hidden": "true"
3412
+ })
3413
+ ], 10, Ys), [
3414
+ [et, bt.value]
3415
+ ])
3416
+ ]),
3417
+ _: 1
3418
+ }, 8, ["content"]),
3419
+ e.loading ? (t(), s("div", {
3420
+ key: 0,
3421
+ class: "emt-loading",
3422
+ role: "status",
3423
+ "aria-label": a(l)("common.loading"),
3424
+ "data-testid": "emt-loading"
3425
+ }, [
3426
+ P(Ht, { size: 18 })
3427
+ ], 8, Zs)) : S("", !0)
3428
+ ], 34),
3429
+ P(ls, {
3430
+ total: e.total ?? 0,
3431
+ page: e.page ?? 1,
3432
+ "page-size": a(y),
3433
+ "page-sizes": e.pageSizes,
3434
+ density: a(R),
3435
+ "density-base": e.defaultDensity,
3436
+ "onUpdate:page": c[9] || (c[9] = (f) => n("update:page", f)),
3437
+ "onUpdate:pageSize": c[10] || (c[10] = (f) => {
3438
+ y.value = f, n("size-change", f);
3439
+ }),
3440
+ "onUpdate:density": c[11] || (c[11] = (f) => R.value = f)
3441
+ }, null, 8, ["total", "page", "page-size", "page-sizes", "density", "density-base"])
3442
+ ], 2));
3443
+ }
3444
+ }), jn = /* @__PURE__ */ Y(Qs, [["__scopeId", "data-v-bbdd9cda"]]), en = { class: "emoo-upload" }, tn = ["tabindex", "aria-disabled", "aria-label", "onKeydown"], on = { class: "emoo-upload__title" }, an = { class: "emoo-upload__browse" }, ln = {
3445
+ key: 0,
3446
+ class: "emoo-upload__hint"
3447
+ }, sn = ["accept", "multiple"], nn = ["data-testid"], rn = { class: "emoo-upload__meta" }, dn = ["disabled", "data-testid", "onClick"], un = {
3448
+ key: 0,
3449
+ class: "emoo-upload__sub"
3450
+ }, cn = { class: "emoo-upload__err" }, mn = {
3451
+ key: 2,
3452
+ class: "emoo-upload__pct"
3453
+ }, vn = /* @__PURE__ */ N({
3454
+ __name: "EmooUpload",
3455
+ props: {
3456
+ files: {},
3457
+ accept: {},
3458
+ multiple: { type: Boolean, default: !0 },
3459
+ disabled: { type: Boolean, default: !1 },
3460
+ readonly: { type: Boolean, default: !1 },
3461
+ hint: {},
3462
+ listTestId: {}
3463
+ },
3464
+ emits: ["select", "remove", "retry", "preview"],
3465
+ setup(e, { emit: i }) {
3466
+ const o = e, l = i, { t: r } = me(), n = O(), p = O(!1), v = ($) => $.status ?? "ready", k = () => o.disabled || o.readonly, u = () => {
3467
+ k() || n.value?.click();
3468
+ }, b = () => {
3469
+ k() || (p.value = !0);
3470
+ }, _ = ($) => {
3471
+ k() || !$.length || l("select", o.multiple ? $ : [$[0]]);
3472
+ }, y = ($) => {
3473
+ const z = $.target;
3474
+ _(Array.from(z.files ?? [])), z.value = "";
3475
+ }, R = ($) => {
3476
+ p.value = !1, _(Array.from($.dataTransfer?.files ?? []));
3477
+ }, E = ($) => $ < 1024 ? `${$} B` : $ < 1024 * 1024 ? `${Math.round($ / 1024)} KB` : $ < 1024 * 1024 * 1024 ? `${($ / 1024 / 1024).toFixed(1)} MB` : `${($ / 1024 / 1024 / 1024).toFixed(1)} GB`;
3478
+ return ($, z) => (t(), s("div", en, [
3479
+ e.readonly ? S("", !0) : (t(), s("div", {
3480
+ key: 0,
3481
+ class: W(["emoo-upload__drop", { "is-over": p.value, "is-disabled": e.disabled }]),
3482
+ role: "button",
3483
+ tabindex: e.disabled ? -1 : 0,
3484
+ "aria-disabled": e.disabled,
3485
+ "aria-label": a(r)("common.emooUpload.dropTitle"),
3486
+ onDragover: le(b, ["prevent"]),
3487
+ onDragleave: z[0] || (z[0] = (I) => p.value = !1),
3488
+ onDrop: le(R, ["prevent"]),
3489
+ onClick: u,
3490
+ onKeydown: [
3491
+ qe(le(u, ["prevent"]), ["enter"]),
3492
+ qe(le(u, ["prevent"]), ["space"])
3493
+ ]
3494
+ }, [
3495
+ P(a(go), {
3496
+ class: "emoo-upload__ico",
3497
+ "aria-hidden": "true"
3498
+ }),
3499
+ m("p", on, [
3500
+ Z(g(a(r)("common.emooUpload.dropTitle")) + " ", 1),
3501
+ m("span", an, g(a(r)("common.emooUpload.browse")), 1)
3502
+ ]),
3503
+ e.hint ? (t(), s("p", ln, g(e.hint), 1)) : S("", !0),
3504
+ m("input", {
3505
+ ref_key: "inputRef",
3506
+ ref: n,
3507
+ type: "file",
3508
+ hidden: "",
3509
+ accept: e.accept,
3510
+ multiple: e.multiple,
3511
+ onChange: y
3512
+ }, null, 40, sn)
3513
+ ], 42, tn)),
3514
+ e.files.length ? (t(), s("ul", {
3515
+ key: 1,
3516
+ class: "emoo-upload__list",
3517
+ "data-testid": e.listTestId
3518
+ }, [
3519
+ (t(!0), s(D, null, J(e.files, (I, j) => (t(), s("li", {
3520
+ key: j,
3521
+ class: "emoo-upload__file"
3522
+ }, [
3523
+ P(a(ko), {
3524
+ class: "emoo-upload__file-ico",
3525
+ "aria-hidden": "true"
3526
+ }),
3527
+ m("div", rn, [
3528
+ m("button", {
3529
+ type: "button",
3530
+ class: "emoo-upload__name",
3531
+ disabled: e.disabled,
3532
+ "data-testid": `upload-preview-${j}`,
3533
+ onClick: (X) => l("preview", I)
3534
+ }, g(I.name), 9, dn),
3535
+ I.size != null ? (t(), s("span", un, g(E(I.size)), 1)) : S("", !0),
3536
+ v(I) === "uploading" ? (t(), x(ds, {
3537
+ key: 1,
3538
+ class: "emoo-upload__progress",
3539
+ size: "mini",
3540
+ status: "run",
3541
+ value: I.progress ?? null
3542
+ }, null, 8, ["value"])) : S("", !0)
3543
+ ]),
3544
+ v(I) === "done" ? (t(), x(Is, {
3545
+ key: 0,
3546
+ tone: "success"
3547
+ }, {
3548
+ default: w(() => [
3549
+ Z(g(a(r)("common.emooUpload.done")), 1)
3550
+ ]),
3551
+ _: 1
3552
+ })) : v(I) === "failed" ? (t(), s(D, { key: 1 }, [
3553
+ m("span", cn, g(I.error || a(r)("common.emooUpload.failed")), 1),
3554
+ e.readonly ? S("", !0) : (t(), x(De, {
3555
+ key: 0,
3556
+ variant: "text",
3557
+ size: "small",
3558
+ onClick: (X) => l("retry", I)
3559
+ }, {
3560
+ icon: w(() => [
3561
+ P(a(Vt))
3562
+ ]),
3563
+ default: w(() => [
3564
+ Z(" " + g(a(r)("common.emooUpload.retry")), 1)
3565
+ ]),
3566
+ _: 1
3567
+ }, 8, ["onClick"]))
3568
+ ], 64)) : v(I) === "uploading" && I.progress != null ? (t(), s("span", mn, g(Math.round(I.progress)) + "% ", 1)) : S("", !0),
3569
+ e.readonly ? S("", !0) : (t(), x(De, {
3570
+ key: 3,
3571
+ variant: "text",
3572
+ size: "small",
3573
+ "icon-only": "",
3574
+ "aria-label": a(r)("common.emooUpload.remove", { name: I.name }),
3575
+ onClick: (X) => l("remove", I)
3576
+ }, {
3577
+ icon: w(() => [
3578
+ P(a(nt))
3579
+ ]),
3580
+ _: 1
3581
+ }, 8, ["aria-label", "onClick"]))
3582
+ ]))), 128))
3583
+ ], 8, nn)) : S("", !0)
3584
+ ]));
3585
+ }
3586
+ }), Gn = /* @__PURE__ */ Y(vn, [["__scopeId", "data-v-65eda28b"]]), fn = { class: "emoo-value-diff" }, hn = { class: "emoo-value-diff__old" }, pn = /* @__PURE__ */ N({
3587
+ __name: "EmooValueDiff",
3588
+ props: {
3589
+ value: {},
3590
+ old: {}
3591
+ },
3592
+ setup(e) {
3593
+ const i = e, o = V(() => !!i.old && i.old !== i.value);
3594
+ return (l, r) => (t(), s("span", fn, [
3595
+ o.value ? (t(), s(D, { key: 0 }, [
3596
+ m("span", hn, g(e.old), 1),
3597
+ P(a($o), {
3598
+ class: "emoo-value-diff__arrow",
3599
+ "aria-hidden": "true"
3600
+ })
3601
+ ], 64)) : S("", !0),
3602
+ m("span", {
3603
+ class: W(["emoo-value-diff__value", { "emoo-value-diff__value--changed": o.value }])
3604
+ }, g(e.value), 3)
3605
+ ]));
3606
+ }
3607
+ }), Xn = /* @__PURE__ */ Y(pn, [["__scopeId", "data-v-40f98722"]]), yn = {
3608
+ xmlns: "http://www.w3.org/2000/svg",
3609
+ viewBox: "0 0 256 256",
3610
+ width: "1em",
3611
+ height: "1em",
3612
+ fill: "currentColor"
3613
+ }, Jn = /* @__PURE__ */ N({
3614
+ __name: "IconChatCirclePlus",
3615
+ setup(e) {
3616
+ return (i, o) => (t(), s("svg", yn, [...o[0] || (o[0] = [
3617
+ m("path", { d: "M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z" }, null, -1),
3618
+ m("path", { d: "M168,128a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h24A8,8,0,0,1,168,128Z" }, null, -1)
3619
+ ])]));
3620
+ }
3621
+ });
3622
+ function Yn(e, i = {}) {
3623
+ const o = i.bottomTolerance ?? 24, l = i.awayThreshold ?? 80, r = O(!0), n = O(!1);
3624
+ let p = null;
3625
+ const v = () => {
3626
+ const R = p;
3627
+ if (!R) return;
3628
+ const E = R.scrollHeight - R.scrollTop - R.clientHeight;
3629
+ E <= o ? (!r.value || n.value) && (r.value = !0, n.value = !1, i.onDockUpdate?.(!0)) : E > l && (r.value || !n.value) && (r.value = !1, n.value = !0, i.onDockUpdate?.(!1));
3630
+ }, k = () => {
3631
+ const R = e();
3632
+ !R || R === p || (p && p.removeEventListener("scroll", v), p = R, R.addEventListener("scroll", v, { passive: !0 }), v());
3633
+ }, u = () => {
3634
+ p?.removeEventListener("scroll", v), p = null;
3635
+ }, b = () => typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, _ = () => {
3636
+ !r.value || !p || p.scrollTo({ top: p.scrollHeight, behavior: "auto" });
3637
+ }, y = () => {
3638
+ p && (p.scrollTo({
3639
+ top: p.scrollHeight,
3640
+ behavior: b() ? "auto" : "smooth"
3641
+ }), r.value = !0, n.value = !1, i.onDockUpdate?.(!0));
3642
+ };
3643
+ return typeof $t == "function" && $t(u), { docked: r, showScrollToBottom: n, attach: k, detach: u, notifyContentChanged: _, scrollToBottom: y, handleScroll: v };
3644
+ }
3645
+ function Zn(e, i = !1) {
3646
+ const o = _o(e, i), l = {};
3647
+ for (const [r, n] of Object.entries(o))
3648
+ l[r.replace("--emoo-", "--el-")] = n;
3649
+ return l;
3650
+ }
3651
+ export {
3652
+ ti as AVATAR_TINT_PALETTE,
3653
+ wn as EmooActionPill,
3654
+ Sn as EmooActionSheet,
3655
+ Cn as EmooAgentSelect,
3656
+ De as EmooButton,
3657
+ En as EmooCard,
3658
+ Tn as EmooChips,
3659
+ oa as EmooChoice,
3660
+ ma as EmooColumnMenu,
3661
+ xn as EmooDrawer,
3662
+ xa as EmooEmpty,
3663
+ zn as EmooField,
3664
+ In as EmooFieldGrid,
3665
+ Rn as EmooGhostButton,
3666
+ Vn as EmooGroupLabel,
3667
+ Mn as EmooHistoryList,
3668
+ Bn as EmooMemberRoleSelect,
3669
+ Dn as EmooMemberSelect,
3670
+ xe as EmooMemberTag,
3671
+ Pn as EmooMessage,
3672
+ An as EmooNavMenu,
3673
+ Ln as EmooNavSegmented,
3674
+ On as EmooOptionRows,
3675
+ ls as EmooPagination,
3676
+ Un as EmooPopover,
3677
+ ds as EmooProgress,
3678
+ Hn as EmooRoleSelect,
3679
+ Kn as EmooSearchBox,
3680
+ Wn as EmooSegmented,
3681
+ Fn as EmooSidebarShell,
3682
+ Na as EmooSkeleton,
3683
+ Ht as EmooSpinner,
3684
+ Is as EmooStatusTag,
3685
+ Nn as EmooSwitcherPanel,
3686
+ jn as EmooTable,
3687
+ qn as EmooTagsInput,
3688
+ he as EmooTooltip,
3689
+ Gn as EmooUpload,
3690
+ Xn as EmooValueDiff,
3691
+ Ls as INLINE_TOOLS_MIN_WIDTH,
3692
+ Jn as IconChatCirclePlus,
3693
+ ot as MIN_COL_WIDTH,
3694
+ oi as PRESET_COLORS,
3695
+ Pt as SheetDragHandle,
3696
+ ai as avatarTintOf,
3697
+ Zn as elementPlusColorVars,
3698
+ ri as emoouiMessages,
3699
+ fa as getDrawerWidth,
3700
+ li as hexToRgbString,
3701
+ si as mixColor,
3702
+ ga as nearestSheetTier,
3703
+ ni as primaryColorVars,
3704
+ ha as saveDrawerWidth,
3705
+ Os as useColumnPrefs,
3706
+ Yn as useMessageScroll,
3707
+ Me as useRemoteOptions,
3708
+ Be as useSelectedOptions,
3709
+ ka as useSheetHeightDrag
3710
+ };