vue-chat-kit 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { ref as _, computed as we, nextTick as Oe, watch as Et, resolveComponent as be, openBlock as a, createBlock as G, withCtx as k, createElementVNode as e, createElementBlock as p, normalizeStyle as Xe, Fragment as me, renderList as fe, withModifiers as Be, normalizeClass as J, createVNode as m, createTextVNode as ue, onMounted as _t, onUnmounted as bt, unref as c, resolveDynamicComponent as kt, toDisplayString as y, createCommentVNode as S, isRef as Ie, withDirectives as wt, withKeys as Ct, vModelText as xt } from "vue";
2
- import { ChatDotRound as Ye, UserFilled as Qe, Bell as Ut, Setting as $t, Search as qe, Plus as St, MoreFilled as zt, Document as At, Download as Vt, Folder as Ze, Picture as Ft, ChatLineRound as It, Camera as Rt } from "@element-plus/icons-vue";
3
- import ft from "dayjs";
1
+ import { ref as _, computed as we, watch as _t, nextTick as Oe, resolveComponent as be, openBlock as a, createBlock as G, withCtx as k, createElementVNode as e, createElementBlock as p, normalizeStyle as Xe, Fragment as me, renderList as he, withModifiers as Be, normalizeClass as J, createVNode as m, createTextVNode as ue, onMounted as bt, onUnmounted as kt, unref as d, resolveDynamicComponent as wt, toDisplayString as y, createCommentVNode as S, isRef as Ie, withDirectives as Ct, withKeys as xt, vModelText as Ut } from "vue";
2
+ import { ChatDotRound as Ye, UserFilled as Qe, Bell as $t, Setting as St, Search as qe, Plus as zt, MoreFilled as At, Document as Vt, Download as Ft, Folder as Ze, Picture as It, ChatLineRound as Rt, Camera as Mt } from "@element-plus/icons-vue";
3
+ import ht from "dayjs";
4
4
  import { ElMessage as Q } from "element-plus";
5
5
  class Dt {
6
6
  constructor(t, n = {}) {
@@ -168,8 +168,8 @@ class Wt {
168
168
  fetch(Z, ve),
169
169
  this.timeoutPromise(this.timeout)
170
170
  ]);
171
- if (this.responseInterceptors.forEach((de) => {
172
- U = de(U);
171
+ if (this.responseInterceptors.forEach((ce) => {
172
+ U = ce(U);
173
173
  }), !U.ok)
174
174
  throw new Je(
175
175
  `HTTP ${U.status}: ${U.statusText}`,
@@ -177,8 +177,8 @@ class Wt {
177
177
  U.status
178
178
  );
179
179
  const A = U.headers.get("content-type");
180
- let f;
181
- return A && A.includes("application/json") ? f = await U.json() : f = await U.text(), f;
180
+ let h;
181
+ return A && A.includes("application/json") ? h = await U.json() : h = await U.text(), h;
182
182
  } catch (V) {
183
183
  throw V instanceof Je ? V : new Je(
184
184
  V instanceof Error ? V.message : "网络错误",
@@ -201,7 +201,7 @@ class Wt {
201
201
  return this.request(t, { ...n, method: "DELETE" });
202
202
  }
203
203
  }
204
- class ht {
204
+ class ft {
205
205
  constructor(t, n = null) {
206
206
  this.config = t, this.endpoints = t.api.endpoints, this.customAdapter = t.api.adapter, n ? this.http = n : this.http = new Wt({
207
207
  baseUrl: t.api.baseUrl,
@@ -235,6 +235,15 @@ class ht {
235
235
  async _getAvailableUsers(t) {
236
236
  return this.http.get(this.endpoints.getAvailableUsers, { currentUser: t });
237
237
  }
238
+ /**
239
+ * 搜索用户
240
+ */
241
+ async searchUser(t) {
242
+ return this._call("searchUser", t);
243
+ }
244
+ async _searchUser(t) {
245
+ return this.http.get(this.endpoints.searchUser, { keyword: t });
246
+ }
238
247
  /**
239
248
  * 添加好友
240
249
  */
@@ -340,13 +349,13 @@ class ht {
340
349
  return v.append("file", t), v.append("username", n), this.http.post(this.endpoints.uploadAvatar, v);
341
350
  }
342
351
  }
343
- const Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
352
+ const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
344
353
  __proto__: null,
345
- ChatApi: ht,
346
- default: ht
354
+ ChatApi: ft,
355
+ default: ft
347
356
  }, Symbol.toStringTag, { value: "Module" }));
348
- function Lt(x, t) {
349
- const n = new ht(x);
357
+ function Tt(x, t) {
358
+ const n = new ft(x);
350
359
  let v = null;
351
360
  const $ = x.user.username, ee = _(x.user.avatar || `https://api.dicebear.com/7.x/avataaars/svg?seed=${$}`), H = _({
352
361
  username: $,
@@ -354,82 +363,77 @@ function Lt(x, t) {
354
363
  email: x.user.email || "",
355
364
  phone: x.user.phone || "",
356
365
  bio: x.user.bio || ""
357
- }), Z = _(!1), X = _([]), ve = _([]), V = _([]), U = _(""), A = _(""), f = _(""), de = _(null), Ae = _(!1), he = _(""), C = _([]), ge = _(!1), Ce = _([]), Ve = _(!1), xe = we(() => {
366
+ }), Z = _(!1), X = _([]), ve = _([]), V = _([]), U = _(""), A = _(""), h = _(""), ce = _(null), Ae = _(!1), ye = _(""), C = _([]), fe = _(!1), Ce = _([]), Ve = _(!1), xe = we(() => {
358
367
  let i = ve.value;
359
368
  if (A.value) {
360
- const d = A.value.toLowerCase();
369
+ const c = A.value.toLowerCase();
361
370
  i = i.filter(
362
371
  (g) => {
363
372
  var F;
364
- return (F = g.username) == null ? void 0 : F.toLowerCase().includes(d);
373
+ return (F = g.username) == null ? void 0 : F.toLowerCase().includes(c);
365
374
  }
366
375
  );
367
376
  }
368
- return i.map((d) => ({
369
- id: d.username,
370
- name: d.username,
371
- avatar: d.avatar || ee.value,
372
- online: d.online,
373
- lastMsg: d.lastMsg || "暂无消息",
374
- lastTime: d.lastTime,
375
- unread: d.unReadNum || 0
377
+ return i.map((c) => ({
378
+ id: c.username,
379
+ name: c.username,
380
+ avatar: c.avatar || ee.value,
381
+ online: c.online,
382
+ lastMsg: c.lastMsg || "暂无消息",
383
+ lastTime: c.lastTime,
384
+ unread: c.unReadNum || 0
376
385
  }));
377
386
  }), Se = we(() => {
378
387
  let i = X.value;
379
388
  if (A.value) {
380
- const d = A.value.toLowerCase();
389
+ const c = A.value.toLowerCase();
381
390
  i = i.filter(
382
391
  (g) => {
383
392
  var F;
384
- return (F = g.username) == null ? void 0 : F.toLowerCase().includes(d);
393
+ return (F = g.username) == null ? void 0 : F.toLowerCase().includes(c);
385
394
  }
386
395
  );
387
396
  }
388
- return i.map((d) => ({
389
- id: d.username,
390
- name: d.username,
391
- avatar: d.avatar || ee.value,
392
- online: d.online,
393
- isChatting: d.isChatting
397
+ return i.map((c) => ({
398
+ id: c.username,
399
+ name: c.username,
400
+ avatar: c.avatar || ee.value,
401
+ online: c.online,
402
+ isChatting: c.isChatting
394
403
  }));
395
- }), Fe = we(() => he.value ? C.value.filter(
396
- (i) => {
397
- var d;
398
- return (d = i.username) == null ? void 0 : d.toLowerCase().includes(he.value.toLowerCase());
399
- }
400
- ) : C.value), Re = we(() => xe.value.find((i) => i.id === U.value) || null), De = we(() => V.value.map((i) => {
401
- const d = i.type === "file" || i.fileUrl || i.fileName, g = i.fileName || i.msgContent;
404
+ }), Fe = we(() => C.value), Re = we(() => xe.value.find((i) => i.id === U.value) || null), De = we(() => V.value.map((i) => {
405
+ const c = i.type === "file" || i.fileUrl || i.fileName, g = i.fileName || i.msgContent;
402
406
  return {
403
407
  text: i.msgContent,
404
408
  isSelf: i.sendUsername === $,
405
409
  time: i.createTime,
406
410
  sendUsername: i.sendUsername,
407
- type: d ? "file" : "text",
411
+ type: c ? "file" : "text",
408
412
  fileType: w(g) ? "image" : z(g),
409
413
  fileUrl: i.fileUrl || "",
410
414
  fileName: g,
411
415
  fileSize: i.fileSize || 0
412
416
  };
413
- })), We = (i) => ft(i).format("HH:mm"), Me = (i) => {
417
+ })), We = (i) => ht(i).format("HH:mm"), Me = (i) => {
414
418
  if (!i) return "";
415
- const d = ft(), g = ft(i);
416
- return d.isSame(g, "day") ? g.format("HH:mm") : d.diff(g, "day") === 1 ? "昨天" : d.diff(g, "day") < 7 ? ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][g.day()] : g.format("MM/DD");
419
+ const c = ht(), g = ht(i);
420
+ return c.isSame(g, "day") ? g.format("HH:mm") : c.diff(g, "day") === 1 ? "昨天" : c.diff(g, "day") < 7 ? ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][g.day()] : g.format("MM/DD");
417
421
  }, w = (i) => {
418
422
  if (!i) return !1;
419
- const d = ["jpg", "jpeg", "png", "gif", "bmp", "webp", "svg"], g = i.split(".").pop().toLowerCase();
420
- return d.includes(g);
423
+ const c = ["jpg", "jpeg", "png", "gif", "bmp", "webp", "svg"], g = i.split(".").pop().toLowerCase();
424
+ return c.includes(g);
421
425
  }, z = (i) => {
422
426
  if (!i) return "default";
423
- const d = i.split(".").pop().toLowerCase();
424
- return ["xls", "xlsx"].includes(d) ? "excel" : ["pdf"].includes(d) ? "pdf" : ["doc", "docx"].includes(d) ? "docx" : "default";
427
+ const c = i.split(".").pop().toLowerCase();
428
+ return ["xls", "xlsx"].includes(c) ? "excel" : ["pdf"].includes(c) ? "pdf" : ["doc", "docx"].includes(c) ? "docx" : "default";
425
429
  }, Y = () => {
426
430
  Oe(() => {
427
- de.value && (de.value.scrollTop = de.value.scrollHeight);
431
+ ce.value && (ce.value.scrollTop = ce.value.scrollHeight);
428
432
  });
429
433
  }, I = async () => {
430
434
  try {
431
- const d = (await n.getFriends($)).data || [];
432
- X.value = d, ve.value = d.filter((g) => g.isChatting === 1);
435
+ const c = (await n.getFriends($)).data || [];
436
+ X.value = c, ve.value = c.filter((g) => g.isChatting === 1);
433
437
  for (const g of ve.value)
434
438
  try {
435
439
  const _e = (await n.getHistory($, g.username)).data || [];
@@ -444,46 +448,46 @@ function Lt(x, t) {
444
448
  }
445
449
  }, R = async (i) => {
446
450
  try {
447
- const d = await n.getHistory($, i);
448
- V.value = d.data || [], Y();
449
- } catch (d) {
450
- console.error("[VueChatKit] 获取聊天历史失败", d);
451
+ const c = await n.getHistory($, i);
452
+ V.value = c.data || [], Y();
453
+ } catch (c) {
454
+ console.error("[VueChatKit] 获取聊天历史失败", c);
451
455
  }
452
456
  }, M = async (i) => {
453
457
  try {
454
458
  await n.setRead($, i), I();
455
- } catch (d) {
456
- console.error("[VueChatKit] 标记已读失败", d);
459
+ } catch (c) {
460
+ console.error("[VueChatKit] 标记已读失败", c);
457
461
  }
458
462
  }, E = async (i) => {
459
463
  U.value = i.id, await R(i.id), await M(i.id), Y();
460
- }, N = async (i, d = 1) => {
464
+ }, N = async (i, c = 1) => {
461
465
  try {
462
- return await n.setChatStatus($, i, d), await I(), !0;
466
+ return await n.setChatStatus($, i, c), await I(), !0;
463
467
  } catch (g) {
464
468
  return console.error("[VueChatKit] 设置聊天状态失败", g), !1;
465
469
  }
466
470
  }, P = () => {
467
- if (!f.value.trim() || !U.value || !v) return;
468
- if (v.send(U.value, f.value.trim(), "text")) {
469
- const d = {
470
- msgContent: f.value.trim(),
471
+ if (!h.value.trim() || !U.value || !v) return;
472
+ if (v.send(U.value, h.value.trim(), "text")) {
473
+ const c = {
474
+ msgContent: h.value.trim(),
471
475
  sendUsername: $,
472
476
  receiveUsername: U.value,
473
477
  createTime: /* @__PURE__ */ new Date(),
474
478
  isRead: 0,
475
479
  type: "text"
476
480
  };
477
- V.value.push(d), f.value = "", Y(), setTimeout(() => {
481
+ V.value.push(c), h.value = "", Y(), setTimeout(() => {
478
482
  R(U.value), I();
479
483
  }, 300);
480
484
  }
481
485
  }, L = async (i) => {
482
486
  if (!U.value || !v) return !1;
483
487
  try {
484
- const d = await n.uploadFile(i);
485
- if (d.code === 200 && d.data) {
486
- const { fileUrl: g, fileName: F } = d.data;
488
+ const c = await n.uploadFile(i);
489
+ if (c.code === 200 && c.data) {
490
+ const { fileUrl: g, fileName: F } = c.data;
487
491
  if (v.send(
488
492
  U.value,
489
493
  F,
@@ -507,14 +511,14 @@ function Lt(x, t) {
507
511
  }
508
512
  }
509
513
  return !1;
510
- } catch (d) {
511
- return console.error("[VueChatKit] 发送文件失败", d), !1;
514
+ } catch (c) {
515
+ return console.error("[VueChatKit] 发送文件失败", c), !1;
512
516
  }
513
- }, q = async (i, d) => {
517
+ }, q = async (i, c) => {
514
518
  if (!(!U.value || !v)) {
515
- if (d && d.trim() && v.send(U.value, d.trim(), "text")) {
519
+ if (c && c.trim() && v.send(U.value, c.trim(), "text")) {
516
520
  const F = {
517
- msgContent: d.trim(),
521
+ msgContent: c.trim(),
518
522
  sendUsername: $,
519
523
  receiveUsername: U.value,
520
524
  createTime: /* @__PURE__ */ new Date(),
@@ -546,18 +550,18 @@ function Lt(x, t) {
546
550
  };
547
551
  } catch {
548
552
  }
549
- const d = i.match(/^\[(.+?)\]:(.+)$/);
550
- if (d)
553
+ const c = i.match(/^\[(.+?)\]:(.+)$/);
554
+ if (c)
551
555
  return {
552
- username: d[1],
553
- content: d[2],
556
+ username: c[1],
557
+ content: c[2],
554
558
  type: "text"
555
559
  };
556
- } catch (d) {
557
- console.error("[VueChatKit] 解析消息失败", d);
560
+ } catch (c) {
561
+ console.error("[VueChatKit] 解析消息失败", c);
558
562
  }
559
563
  return null;
560
- }, se = (i) => {
564
+ }, ae = (i) => {
561
565
  if (i.includes("【状态变更】")) {
562
566
  const g = /【状态变更】(.+?) 已(上线|下线)/, F = i.match(g);
563
567
  if (F) {
@@ -566,29 +570,29 @@ function Lt(x, t) {
566
570
  }
567
571
  return;
568
572
  }
569
- const d = te(i);
570
- if (d) {
573
+ const c = te(i);
574
+ if (c) {
571
575
  const g = {
572
- content: d.content,
573
- username: d.username || U.value,
574
- type: d.type || "text",
575
- fileUrl: d.fileUrl || "",
576
- fileName: d.fileName || "",
577
- fileSize: d.fileSize || 0,
576
+ content: c.content,
577
+ username: c.username || U.value,
578
+ type: c.type || "text",
579
+ fileUrl: c.fileUrl || "",
580
+ fileName: c.fileName || "",
581
+ fileSize: c.fileSize || 0,
578
582
  timestamp: /* @__PURE__ */ new Date()
579
583
  };
580
584
  if (U.value) {
581
585
  try {
582
586
  let F = {
583
- msgContent: d.content,
587
+ msgContent: c.content,
584
588
  sendUsername: g.username,
585
589
  receiveUsername: $,
586
590
  createTime: /* @__PURE__ */ new Date(),
587
591
  isRead: 0,
588
- type: d.type || "text",
589
- fileUrl: d.fileUrl || "",
590
- fileName: d.fileName || "",
591
- fileSize: d.fileSize || 0
592
+ type: c.type || "text",
593
+ fileUrl: c.fileUrl || "",
594
+ fileName: c.fileName || "",
595
+ fileSize: c.fileSize || 0
592
596
  };
593
597
  V.value.push(F), Y();
594
598
  } catch (F) {
@@ -598,32 +602,32 @@ function Lt(x, t) {
598
602
  }
599
603
  I(), t && typeof t == "function" && t(g);
600
604
  }
601
- }, le = () => {
605
+ }, de = () => {
602
606
  const i = `${x.api.websocketUrl}?userId=${$}`;
603
607
  v = new Dt($, {
604
608
  wsUrl: i,
605
609
  maxReconnectAttempts: x.websocket.maxReconnectAttempts,
606
610
  reconnectDelay: x.websocket.reconnectDelay
607
- }), v.on("message", se), v.connect();
611
+ }), v.on("message", ae), v.connect();
608
612
  }, pe = () => {
609
613
  v && (v.close(), v = null);
610
614
  }, B = async () => {
611
- Ae.value = !0, he.value = "", await ae();
612
- }, ae = async () => {
613
- ge.value = !0;
615
+ Ae.value = !0, ye.value = "", C.value = [];
616
+ }, se = async (i = "") => {
617
+ fe.value = !0;
614
618
  try {
615
- const i = await n.getAvailableUsers($);
616
- C.value = (i == null ? void 0 : i.data) || [];
617
- } catch (i) {
618
- console.error("[VueChatKit] 获取可用用户失败", i);
619
+ let c;
620
+ i ? c = await n.searchUser(i) : c = await n.getAvailableUsers($), C.value = (c == null ? void 0 : c.data) || [];
621
+ } catch (c) {
622
+ console.error("[VueChatKit] 获取可用用户失败", c);
619
623
  } finally {
620
- ge.value = !1;
624
+ fe.value = !1;
621
625
  }
622
626
  }, ne = async (i) => {
623
627
  try {
624
628
  await n.addFriend($, i.username), await I(), Ae.value = !1;
625
- } catch (d) {
626
- console.error("[VueChatKit] 添加好友失败", d);
629
+ } catch (c) {
630
+ console.error("[VueChatKit] 添加好友失败", c);
627
631
  }
628
632
  }, D = async () => {
629
633
  Ve.value = !0;
@@ -638,8 +642,8 @@ function Lt(x, t) {
638
642
  }, W = async (i) => {
639
643
  try {
640
644
  await n.agreeFriend(i, $), await D(), await I();
641
- } catch (d) {
642
- console.error("[VueChatKit] 同意好友申请失败", d);
645
+ } catch (c) {
646
+ console.error("[VueChatKit] 同意好友申请失败", c);
643
647
  }
644
648
  }, ie = async () => {
645
649
  try {
@@ -648,7 +652,7 @@ function Lt(x, t) {
648
652
  } catch (i) {
649
653
  console.warn("[VueChatKit] 加载头像失败", i);
650
654
  }
651
- }, oe = (i) => {
655
+ }, le = (i) => {
652
656
  ee.value = i;
653
657
  }, K = async () => {
654
658
  Z.value = !0;
@@ -663,19 +667,21 @@ function Lt(x, t) {
663
667
  } finally {
664
668
  Z.value = !1;
665
669
  }
666
- }, re = async (i) => {
670
+ }, oe = async (i) => {
667
671
  try {
668
672
  return (await n.updateUserInfo($, i)).code === 200 ? (H.value = {
669
673
  ...H.value,
670
674
  ...i
671
675
  }, !0) : !1;
672
- } catch (d) {
673
- return console.error("[VueChatKit] 更新用户信息失败", d), !1;
676
+ } catch (c) {
677
+ return console.error("[VueChatKit] 更新用户信息失败", c), !1;
674
678
  }
675
679
  }, ze = () => {
676
- U.value = "", V.value = [], f.value = "", A.value = "";
680
+ U.value = "", V.value = [], h.value = "", A.value = "";
677
681
  };
678
- return ie(), {
682
+ return ie(), _t(ye, async (i) => {
683
+ await se(i);
684
+ }), {
679
685
  // 状态
680
686
  myUsername: $,
681
687
  myAvatar: ee,
@@ -687,16 +693,16 @@ function Lt(x, t) {
687
693
  chatMsgList: V,
688
694
  currentSelectName: U,
689
695
  searchText: A,
690
- inputText: f,
691
- messagesContainer: de,
696
+ inputText: h,
697
+ messagesContainer: ce,
692
698
  filteredUsers: xe,
693
699
  filteredAvailableUsers: Fe,
694
700
  currentUser: Re,
695
701
  currentMessages: De,
696
702
  addFriendDialogVisible: Ae,
697
- addFriendSearchText: he,
703
+ addFriendSearchText: ye,
698
704
  availableUsers: C,
699
- loadingAvailableUsers: ge,
705
+ loadingAvailableUsers: fe,
700
706
  friendApplyList: Ce,
701
707
  loadingFriendApply: Ve,
702
708
  // 方法
@@ -710,16 +716,17 @@ function Lt(x, t) {
710
716
  sendMessage: P,
711
717
  sendFile: L,
712
718
  sendFilesAndText: q,
713
- initWebSocket: le,
719
+ initWebSocket: de,
714
720
  closeWebSocket: pe,
715
721
  reset: ze,
716
722
  openAddFriendDialog: B,
723
+ loadAvailableUsers: se,
717
724
  addFriend: ne,
718
725
  loadFriendApplyList: D,
719
726
  agreeFriend: W,
720
- updateMyAvatar: oe,
727
+ updateMyAvatar: le,
721
728
  getUserInfo: K,
722
- updateUserInfo: re
729
+ updateUserInfo: oe
723
730
  };
724
731
  }
725
732
  const gt = (x, t) => {
@@ -761,25 +768,25 @@ const gt = (x, t) => {
761
768
  displayHeight: 0,
762
769
  offsetX: 0,
763
770
  offsetY: 0
764
- }), f = _({
771
+ }), h = _({
765
772
  x: 0,
766
773
  y: 0,
767
774
  size: 150,
768
775
  minSize: v.minSize
769
- }), de = we(() => ({
776
+ }), ce = we(() => ({
770
777
  width: `${A.value.displayWidth}px`,
771
778
  height: `${A.value.displayHeight}px`,
772
779
  maxWidth: "none",
773
780
  maxHeight: "none",
774
781
  display: "block"
775
782
  })), Ae = we(() => ({
776
- left: `${f.value.x}px`,
777
- top: `${f.value.y}px`,
778
- width: `${f.value.size}px`,
779
- height: `${f.value.size / v.aspectRatio}px`
783
+ left: `${h.value.x}px`,
784
+ top: `${h.value.y}px`,
785
+ width: `${h.value.size}px`,
786
+ height: `${h.value.size / v.aspectRatio}px`
780
787
  }));
781
- let he = null, C = null;
782
- const ge = () => {
788
+ let ye = null, C = null;
789
+ const fe = () => {
783
790
  Oe(() => {
784
791
  const w = V.value, z = ve.value;
785
792
  if (!w || !z) return;
@@ -794,27 +801,27 @@ const gt = (x, t) => {
794
801
  offsetY: L
795
802
  };
796
803
  const q = Math.min(E, N) * 0.6;
797
- f.value.size = q, f.value.x = P + (E - q) / 2, f.value.y = L + (N - q / v.aspectRatio) / 2, Ce();
804
+ h.value.size = q, h.value.x = P + (E - q) / 2, h.value.y = L + (N - q / v.aspectRatio) / 2, Ce();
798
805
  });
799
806
  }, Ce = () => {
800
807
  const w = U.value, z = V.value;
801
808
  if (!w || !z) return;
802
- const Y = w.getContext("2d"), { naturalWidth: I, naturalHeight: R, displayWidth: M, displayHeight: E, offsetX: N, offsetY: P } = A.value, L = I / M, q = R / E, te = (f.value.x - N) * L, se = (f.value.y - P) * q, le = f.value.size * L, pe = f.value.size / v.aspectRatio * q;
803
- Y.clearRect(0, 0, w.width, w.height), Y.drawImage(z, te, se, le, pe, 0, 0, w.width, w.height);
809
+ const Y = w.getContext("2d"), { naturalWidth: I, naturalHeight: R, displayWidth: M, displayHeight: E, offsetX: N, offsetY: P } = A.value, L = I / M, q = R / E, te = (h.value.x - N) * L, ae = (h.value.y - P) * q, de = h.value.size * L, pe = h.value.size / v.aspectRatio * q;
810
+ Y.clearRect(0, 0, w.width, w.height), Y.drawImage(z, te, ae, de, pe, 0, 0, w.width, w.height);
804
811
  }, Ve = (w) => {
805
812
  w.preventDefault();
806
813
  const z = w.clientX || w.touches[0].clientX, Y = w.clientY || w.touches[0].clientY;
807
- he = {
814
+ ye = {
808
815
  startX: z,
809
816
  startY: Y,
810
- boxX: f.value.x,
811
- boxY: f.value.y
817
+ boxX: h.value.x,
818
+ boxY: h.value.y
812
819
  };
813
820
  const I = (M) => {
814
- const E = M.clientX || M.touches[0].clientX, N = M.clientY || M.touches[0].clientY, P = E - he.startX, L = N - he.startY, { offsetX: q, offsetY: te, displayWidth: se, displayHeight: le } = A.value, pe = f.value.size / v.aspectRatio, B = Math.max(q, Math.min(q + se - f.value.size, he.boxX + P)), ae = Math.max(te, Math.min(te + le - pe, he.boxY + L));
815
- f.value.x = B, f.value.y = ae, Ce();
821
+ const E = M.clientX || M.touches[0].clientX, N = M.clientY || M.touches[0].clientY, P = E - ye.startX, L = N - ye.startY, { offsetX: q, offsetY: te, displayWidth: ae, displayHeight: de } = A.value, pe = h.value.size / v.aspectRatio, B = Math.max(q, Math.min(q + ae - h.value.size, ye.boxX + P)), se = Math.max(te, Math.min(te + de - pe, ye.boxY + L));
822
+ h.value.x = B, h.value.y = se, Ce();
816
823
  }, R = () => {
817
- he = null, document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", R), document.removeEventListener("touchmove", I), document.removeEventListener("touchend", R);
824
+ ye = null, document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", R), document.removeEventListener("touchmove", I), document.removeEventListener("touchend", R);
818
825
  };
819
826
  document.addEventListener("mousemove", I), document.addEventListener("mouseup", R), document.addEventListener("touchmove", I, { passive: !1 }), document.addEventListener("touchend", R);
820
827
  }, xe = (w, z) => {
@@ -824,41 +831,41 @@ const gt = (x, t) => {
824
831
  handle: w,
825
832
  startX: Y,
826
833
  startY: I,
827
- boxX: f.value.x,
828
- boxY: f.value.y,
829
- boxSize: f.value.size
834
+ boxX: h.value.x,
835
+ boxY: h.value.y,
836
+ boxSize: h.value.size
830
837
  };
831
838
  const R = (E) => {
832
- const N = E.clientX || E.touches[0].clientX, P = E.clientY || E.touches[0].clientY, L = N - C.startX, q = P - C.startY, { offsetX: te, offsetY: se, displayWidth: le, displayHeight: pe } = A.value;
833
- let B = C.boxSize, ae = C.boxX, ne = C.boxY;
839
+ const N = E.clientX || E.touches[0].clientX, P = E.clientY || E.touches[0].clientY, L = N - C.startX, q = P - C.startY, { offsetX: te, offsetY: ae, displayWidth: de, displayHeight: pe } = A.value;
840
+ let B = C.boxSize, se = C.boxX, ne = C.boxY;
834
841
  const D = C.boxSize / v.aspectRatio;
835
842
  switch (w) {
836
843
  case "se":
837
- B = Math.max(f.value.minSize, Math.min(le - (C.boxX - te), pe - (C.boxY - se), C.boxSize + Math.max(L, q)));
844
+ B = Math.max(h.value.minSize, Math.min(de - (C.boxX - te), pe - (C.boxY - ae), C.boxSize + Math.max(L, q)));
838
845
  break;
839
846
  case "nw":
840
- B = Math.max(f.value.minSize, Math.min(C.boxX - te + C.boxSize, C.boxY - se + D, C.boxSize - Math.max(L, q))), ae = C.boxX + (C.boxSize - B), ne = C.boxY + (D - B / v.aspectRatio);
847
+ B = Math.max(h.value.minSize, Math.min(C.boxX - te + C.boxSize, C.boxY - ae + D, C.boxSize - Math.max(L, q))), se = C.boxX + (C.boxSize - B), ne = C.boxY + (D - B / v.aspectRatio);
841
848
  break;
842
849
  case "ne":
843
- B = Math.max(f.value.minSize, Math.min(te + le - C.boxX, C.boxY - se + D, C.boxSize + Math.max(L, -q))), ne = C.boxY + (D - B / v.aspectRatio);
850
+ B = Math.max(h.value.minSize, Math.min(te + de - C.boxX, C.boxY - ae + D, C.boxSize + Math.max(L, -q))), ne = C.boxY + (D - B / v.aspectRatio);
844
851
  break;
845
852
  case "sw":
846
- B = Math.max(f.value.minSize, Math.min(C.boxX - te + C.boxSize, se + pe - C.boxY, C.boxSize + Math.max(-L, q))), ae = C.boxX + (C.boxSize - B);
853
+ B = Math.max(h.value.minSize, Math.min(C.boxX - te + C.boxSize, ae + pe - C.boxY, C.boxSize + Math.max(-L, q))), se = C.boxX + (C.boxSize - B);
847
854
  break;
848
855
  case "n":
849
- B = Math.max(f.value.minSize, Math.min(C.boxY - se + D, C.boxSize - q)), ne = C.boxY + (D - B / v.aspectRatio);
856
+ B = Math.max(h.value.minSize, Math.min(C.boxY - ae + D, C.boxSize - q)), ne = C.boxY + (D - B / v.aspectRatio);
850
857
  break;
851
858
  case "s":
852
- B = Math.max(f.value.minSize, Math.min(se + pe - C.boxY, C.boxSize + q));
859
+ B = Math.max(h.value.minSize, Math.min(ae + pe - C.boxY, C.boxSize + q));
853
860
  break;
854
861
  case "w":
855
- B = Math.max(f.value.minSize, Math.min(C.boxX - te + C.boxSize, C.boxSize - L)), ae = C.boxX + (C.boxSize - B);
862
+ B = Math.max(h.value.minSize, Math.min(C.boxX - te + C.boxSize, C.boxSize - L)), se = C.boxX + (C.boxSize - B);
856
863
  break;
857
864
  case "e":
858
- B = Math.max(f.value.minSize, Math.min(te + le - C.boxX, C.boxSize + L));
865
+ B = Math.max(h.value.minSize, Math.min(te + de - C.boxX, C.boxSize + L));
859
866
  break;
860
867
  }
861
- f.value.size = B, f.value.x = ae, f.value.y = ne, Ce();
868
+ h.value.size = B, h.value.x = se, h.value.y = ne, Ce();
862
869
  }, M = () => {
863
870
  C = null, document.removeEventListener("mousemove", R), document.removeEventListener("mouseup", M), document.removeEventListener("touchmove", R), document.removeEventListener("touchend", M);
864
871
  };
@@ -866,11 +873,11 @@ const gt = (x, t) => {
866
873
  }, Se = () => {
867
874
  const w = document.createElement("canvas"), z = V.value;
868
875
  if (!z) return null;
869
- const { naturalWidth: Y, naturalHeight: I, displayWidth: R, displayHeight: M, offsetX: E, offsetY: N } = A.value, P = Y / R, L = I / M, q = (f.value.x - E) * P, te = (f.value.y - N) * L, se = f.value.size * P, le = f.value.size / v.aspectRatio * L;
870
- return w.width = v.outputSize, w.height = v.outputSize / v.aspectRatio, w.getContext("2d").drawImage(z, q, te, se, le, 0, 0, w.width, w.height), new Promise((B) => {
876
+ const { naturalWidth: Y, naturalHeight: I, displayWidth: R, displayHeight: M, offsetX: E, offsetY: N } = A.value, P = Y / R, L = I / M, q = (h.value.x - E) * P, te = (h.value.y - N) * L, ae = h.value.size * P, de = h.value.size / v.aspectRatio * L;
877
+ return w.width = v.outputSize, w.height = v.outputSize / v.aspectRatio, w.getContext("2d").drawImage(z, q, te, ae, de, 0, 0, w.width, w.height), new Promise((B) => {
871
878
  w.toBlob(
872
- (ae) => {
873
- B(new File([ae], "avatar.jpg", { type: v.outputType }));
879
+ (se) => {
880
+ B(new File([se], "avatar.jpg", { type: v.outputType }));
874
881
  },
875
882
  v.outputType,
876
883
  v.outputQuality
@@ -879,8 +886,8 @@ const gt = (x, t) => {
879
886
  }, Fe = () => {
880
887
  const w = document.createElement("canvas"), z = V.value;
881
888
  if (!z) return null;
882
- const { naturalWidth: Y, naturalHeight: I, displayWidth: R, displayHeight: M, offsetX: E, offsetY: N } = A.value, P = Y / R, L = I / M, q = (f.value.x - E) * P, te = (f.value.y - N) * L, se = f.value.size * P, le = f.value.size / v.aspectRatio * L;
883
- return w.width = v.outputSize, w.height = v.outputSize / v.aspectRatio, w.getContext("2d").drawImage(z, q, te, se, le, 0, 0, w.width, w.height), w.toDataURL(v.outputType, v.outputQuality);
889
+ const { naturalWidth: Y, naturalHeight: I, displayWidth: R, displayHeight: M, offsetX: E, offsetY: N } = A.value, P = Y / R, L = I / M, q = (h.value.x - E) * P, te = (h.value.y - N) * L, ae = h.value.size * P, de = h.value.size / v.aspectRatio * L;
890
+ return w.width = v.outputSize, w.height = v.outputSize / v.aspectRatio, w.getContext("2d").drawImage(z, q, te, ae, de, 0, 0, w.width, w.height), w.toDataURL(v.outputType, v.outputQuality);
884
891
  }, Re = async () => {
885
892
  if (H.value) {
886
893
  X.value = !0;
@@ -898,13 +905,13 @@ const gt = (x, t) => {
898
905
  }, We = () => {
899
906
  Me(), $("closed");
900
907
  }, Me = () => {
901
- f.value = { x: 0, y: 0, size: 150, minSize: v.minSize };
908
+ h.value = { x: 0, y: 0, size: 150, minSize: v.minSize };
902
909
  };
903
- return Et(
910
+ return _t(
904
911
  () => v.src,
905
912
  (w) => {
906
913
  w && Oe(() => {
907
- V.value && V.value.complete && ge();
914
+ V.value && V.value.complete && fe();
908
915
  });
909
916
  }
910
917
  ), t({
@@ -956,8 +963,8 @@ const gt = (x, t) => {
956
963
  src: H.value,
957
964
  ref_key: "imageRef",
958
965
  ref: V,
959
- onLoad: ge,
960
- style: Xe(de.value)
966
+ onLoad: fe,
967
+ style: Xe(ce.value)
961
968
  }, null, 44, Yt),
962
969
  e("div", {
963
970
  class: "crop-box",
@@ -965,7 +972,7 @@ const gt = (x, t) => {
965
972
  onMousedown: Ve,
966
973
  onTouchstart: Ve
967
974
  }, [
968
- (a(), p(me, null, fe(Z, (M) => e("div", {
975
+ (a(), p(me, null, he(Z, (M) => e("div", {
969
976
  key: M,
970
977
  class: J(["crop-handle", M]),
971
978
  onMousedown: Be((E) => xe(M, E), ["stop"]),
@@ -1007,7 +1014,7 @@ const gt = (x, t) => {
1007
1014
  }, os = { class: "chat-list-info" }, rs = { class: "chat-list-header" }, cs = { class: "chat-list-name" }, ds = { class: "chat-list-time" }, us = { class: "chat-list-preview" }, vs = { class: "chat-list-last-msg" }, ps = {
1008
1015
  key: 0,
1009
1016
  class: "chat-list-unread"
1010
- }, ms = { key: 1 }, fs = { class: "add-friend-section" }, hs = { class: "add-friend-icon" }, gs = ["onClick"], ys = { class: "chat-list-avatar-wrapper" }, _s = ["src", "alt"], bs = { class: "chat-list-info" }, ks = { class: "chat-list-name" }, ws = { key: 2 }, Cs = { class: "friend-request-info" }, xs = ["src", "alt"], Us = { class: "friend-request-details" }, $s = { class: "friend-request-username" }, Ss = { class: "chat-main-area" }, zs = {
1017
+ }, ms = { key: 1 }, hs = { class: "add-friend-section" }, fs = { class: "add-friend-icon" }, gs = ["onClick"], ys = { class: "chat-list-avatar-wrapper" }, _s = ["src", "alt"], bs = { class: "chat-list-info" }, ks = { class: "chat-list-name" }, ws = { key: 2 }, Cs = { class: "friend-request-info" }, xs = ["src", "alt"], Us = { class: "friend-request-details" }, $s = { class: "friend-request-username" }, Ss = { class: "chat-main-area" }, zs = {
1011
1018
  key: 0,
1012
1019
  class: "friend-profile-area"
1013
1020
  }, As = ["src", "alt"], Vs = { class: "profile-name" }, Fs = { class: "profile-status" }, Is = {
@@ -1037,7 +1044,7 @@ const gt = (x, t) => {
1037
1044
  }, da = { class: "empty-state-text" }, ua = {
1038
1045
  key: 0,
1039
1046
  class: "chat-detail-panel"
1040
- }, va = { class: "chat-detail-content" }, pa = { class: "chat-detail-profile" }, ma = ["src", "alt"], fa = { class: "chat-detail-name" }, ha = { class: "add-friend-search-wrapper" }, ga = { class: "add-friend-users-list" }, ya = { class: "add-friend-user-info" }, _a = ["src", "alt"], ba = { class: "add-friend-user-name" }, ka = { class: "chat-settings-container" }, wa = { class: "chat-settings-avatar-section" }, Ca = { class: "chat-settings-avatar-wrapper" }, xa = ["src"], Ua = { class: "chat-settings-user-display" }, $a = { class: "chat-settings-nickname" }, Sa = { class: "chat-settings-username" }, za = { class: "chat-settings-form-section" }, Aa = { class: "chat-settings-form-header" }, Va = { class: "chat-settings-form-title" }, Fa = { class: "chat-settings-form" }, Ia = { class: "chat-settings-form-item" }, Ra = {
1047
+ }, va = { class: "chat-detail-content" }, pa = { class: "chat-detail-profile" }, ma = ["src", "alt"], ha = { class: "chat-detail-name" }, fa = { class: "add-friend-search-wrapper" }, ga = { class: "add-friend-users-list" }, ya = { class: "add-friend-user-info" }, _a = ["src", "alt"], ba = { class: "add-friend-user-name" }, ka = { class: "chat-settings-container" }, wa = { class: "chat-settings-avatar-section" }, Ca = { class: "chat-settings-avatar-wrapper" }, xa = ["src"], Ua = { class: "chat-settings-user-display" }, $a = { class: "chat-settings-nickname" }, Sa = { class: "chat-settings-username" }, za = { class: "chat-settings-form-section" }, Aa = { class: "chat-settings-form-header" }, Va = { class: "chat-settings-form-title" }, Fa = { class: "chat-settings-form" }, Ia = { class: "chat-settings-form-item" }, Ra = {
1041
1048
  key: 1,
1042
1049
  class: "chat-settings-form-value"
1043
1050
  }, Ma = { class: "chat-settings-form-item" }, La = {
@@ -1069,12 +1076,12 @@ const gt = (x, t) => {
1069
1076
  searchText: V,
1070
1077
  inputText: U,
1071
1078
  messagesContainer: A,
1072
- filteredUsers: f,
1073
- filteredAvailableUsers: de,
1079
+ filteredUsers: h,
1080
+ filteredAvailableUsers: ce,
1074
1081
  currentUser: Ae,
1075
- currentMessages: he,
1082
+ currentMessages: ye,
1076
1083
  addFriendDialogVisible: C,
1077
- addFriendSearchText: ge,
1084
+ addFriendSearchText: fe,
1078
1085
  availableUsers: Ce,
1079
1086
  loadingAvailableUsers: Ve,
1080
1087
  friendApplyList: xe,
@@ -1096,48 +1103,48 @@ const gt = (x, t) => {
1096
1103
  addFriend: L,
1097
1104
  loadFriendApplyList: q,
1098
1105
  agreeFriend: te,
1099
- updateMyAvatar: se,
1100
- getUserInfo: le,
1106
+ updateMyAvatar: ae,
1107
+ getUserInfo: de,
1101
1108
  updateUserInfo: pe
1102
- } = Lt(n.config, (h) => {
1103
- v("message", h);
1109
+ } = Tt(n.config, (f) => {
1110
+ v("message", f);
1104
1111
  }), B = we(() => {
1105
1112
  var r;
1106
- const h = [{ id: "chat", icon: Ye, badge: 0 }];
1107
- return n.config.modules.friends && h.push({ id: "friends", icon: Qe, badge: 0 }), n.config.modules.apply && h.push({ id: "apply", icon: Ut, badge: ((r = xe.value) == null ? void 0 : r.length) || 0 }), h;
1108
- }), ae = _("chat"), ne = _(null), D = _(null), W = _(null), ie = _(!1), oe = _(!1), K = _({ nickname: "", email: "", phone: "", bio: "" }), re = _(!1), ze = _(!1), i = _(!1), d = _(!1), g = _(null), F = _(""), _e = _(null), j = _([]), O = _({ visible: !1, x: 0, y: 0, chat: null }), Ue = (h, r) => {
1109
- h.preventDefault(), h.stopPropagation(), O.value = { visible: !0, x: h.clientX, y: h.clientY, chat: r };
1113
+ const f = [{ id: "chat", icon: Ye, badge: 0 }];
1114
+ return n.config.modules.friends && f.push({ id: "friends", icon: Qe, badge: 0 }), n.config.modules.apply && f.push({ id: "apply", icon: $t, badge: ((r = xe.value) == null ? void 0 : r.length) || 0 }), f;
1115
+ }), se = _("chat"), ne = _(null), D = _(null), W = _(null), ie = _(!1), le = _(!1), K = _({ nickname: "", email: "", phone: "", bio: "" }), oe = _(!1), ze = _(!1), i = _(!1), c = _(!1), g = _(null), F = _(""), _e = _(null), j = _([]), O = _({ visible: !1, x: 0, y: 0, chat: null }), Ue = (f, r) => {
1116
+ f.preventDefault(), f.stopPropagation(), O.value = { visible: !0, x: f.clientX, y: f.clientY, chat: r };
1110
1117
  }, Le = () => {
1111
1118
  O.value.visible = !1;
1112
1119
  }, et = async () => {
1113
1120
  if (!O.value.chat) return;
1114
1121
  await w(O.value.chat.id, 0) && ne.value === O.value.chat.id && (ne.value = null, D.value = null), Le();
1115
- }, Te = (h) => {
1116
- ne.value = h.id, D.value = h, W.value = null, ie.value = !1, z({
1117
- id: h.id,
1118
- name: h.name,
1119
- avatar: h.avatar,
1120
- online: h.online
1122
+ }, Te = (f) => {
1123
+ ne.value = f.id, D.value = f, W.value = null, ie.value = !1, z({
1124
+ id: f.id,
1125
+ name: f.name,
1126
+ avatar: f.avatar,
1127
+ online: f.online
1121
1128
  });
1122
- }, tt = (h) => {
1123
- W.value = h, ne.value = null, D.value = null;
1129
+ }, tt = (f) => {
1130
+ W.value = f, ne.value = null, D.value = null;
1124
1131
  }, st = async () => {
1125
1132
  if (!W.value) return;
1126
1133
  if (await w(W.value.id)) {
1127
- ae.value = "chat", await Oe();
1128
- const r = f.value.find((u) => u.id === W.value.id);
1134
+ se.value = "chat", await Oe();
1135
+ const r = h.value.find((u) => u.id === W.value.id);
1129
1136
  r && Te(r), W.value = null;
1130
1137
  }
1131
1138
  }, at = () => {
1132
1139
  ze.value = !0;
1133
1140
  }, nt = () => {
1134
- var h;
1135
- (h = g.value) == null || h.click();
1141
+ var f;
1142
+ (f = g.value) == null || f.click();
1136
1143
  }, it = () => {
1137
- var h;
1138
- (h = _e.value) == null || h.click();
1139
- }, lt = (h) => {
1140
- const r = Array.from(h.target.files || []);
1144
+ var f;
1145
+ (f = _e.value) == null || f.click();
1146
+ }, lt = (f) => {
1147
+ const r = Array.from(f.target.files || []);
1141
1148
  if (r.length !== 0) {
1142
1149
  for (const u of r) {
1143
1150
  if (u.size > 50 * 1024 * 1024) {
@@ -1157,22 +1164,22 @@ const gt = (x, t) => {
1157
1164
  }
1158
1165
  _e.value && (_e.value.value = "");
1159
1166
  }
1160
- }, Ke = (h) => {
1161
- const r = j.value[h];
1162
- r.previewUrl && URL.revokeObjectURL(r.previewUrl), j.value.splice(h, 1);
1163
- }, Ne = (h) => {
1164
- if (h === 0) return "0 B";
1165
- const r = 1024, u = ["B", "KB", "MB", "GB"], s = Math.floor(Math.log(h) / Math.log(r));
1166
- return parseFloat((h / Math.pow(r, s)).toFixed(2)) + " " + u[s];
1167
+ }, Ke = (f) => {
1168
+ const r = j.value[f];
1169
+ r.previewUrl && URL.revokeObjectURL(r.previewUrl), j.value.splice(f, 1);
1170
+ }, Ne = (f) => {
1171
+ if (f === 0) return "0 B";
1172
+ const r = 1024, u = ["B", "KB", "MB", "GB"], s = Math.floor(Math.log(f) / Math.log(r));
1173
+ return parseFloat((f / Math.pow(r, s)).toFixed(2)) + " " + u[s];
1167
1174
  }, Pe = async () => {
1168
1175
  if (!U.value.trim() && j.value.length === 0) return;
1169
- const h = [...j.value], r = U.value;
1176
+ const f = [...j.value], r = U.value;
1170
1177
  U.value = "", j.value.forEach((u) => {
1171
1178
  u.previewUrl && URL.revokeObjectURL(u.previewUrl);
1172
- }), j.value = [], await R(h, r), v("send", { text: r, files: h });
1173
- }, ot = (h) => {
1179
+ }), j.value = [], await R(f, r), v("send", { text: r, files: f });
1180
+ }, ot = (f) => {
1174
1181
  var u;
1175
- const r = (u = h.clipboardData) == null ? void 0 : u.items;
1182
+ const r = (u = f.clipboardData) == null ? void 0 : u.items;
1176
1183
  if (r) {
1177
1184
  for (const s of r)
1178
1185
  if (s.kind === "file") {
@@ -1195,16 +1202,16 @@ const gt = (x, t) => {
1195
1202
  }
1196
1203
  }
1197
1204
  }
1198
- }, je = (h) => {
1199
- if (!h) {
1205
+ }, je = (f) => {
1206
+ if (!f) {
1200
1207
  Q.warning("文件地址无效");
1201
1208
  return;
1202
1209
  }
1203
- window.open(h, "_blank");
1204
- }, rt = (h) => {
1205
- console.warn("图片加载失败", h);
1206
- }, ct = (h) => {
1207
- const r = h.target.files[0];
1210
+ window.open(f, "_blank");
1211
+ }, rt = (f) => {
1212
+ console.warn("图片加载失败", f);
1213
+ }, ct = (f) => {
1214
+ const r = f.target.files[0];
1208
1215
  if (!r) return;
1209
1216
  if (!r.type.startsWith("image/")) {
1210
1217
  Q.error("只能上传图片文件");
@@ -1218,16 +1225,16 @@ const gt = (x, t) => {
1218
1225
  u.onload = (s) => {
1219
1226
  F.value = s.target.result, i.value = !0;
1220
1227
  }, u.readAsDataURL(r);
1221
- }, dt = async ({ file: h }) => {
1222
- if (h) {
1223
- d.value = !0;
1228
+ }, dt = async ({ file: f }) => {
1229
+ if (f) {
1230
+ c.value = !0;
1224
1231
  try {
1225
- const { ChatApi: r } = await Promise.resolve().then(() => Mt), s = await new r(n.config).uploadAvatar(h, $);
1226
- s.code === 200 ? (Q.success("头像上传成功"), se(s.data), Ge()) : Q.error(s.msg || "头像上传失败");
1232
+ const { ChatApi: r } = await Promise.resolve().then(() => Lt), s = await new r(n.config).uploadAvatar(f, $);
1233
+ s.code === 200 ? (Q.success("头像上传成功"), ae(s.data), Ge()) : Q.error(s.msg || "头像上传失败");
1227
1234
  } catch (r) {
1228
1235
  console.error(r), Q.error("头像上传失败");
1229
1236
  } finally {
1230
- d.value = !1;
1237
+ c.value = !1;
1231
1238
  }
1232
1239
  }
1233
1240
  }, Ge = () => {
@@ -1238,26 +1245,26 @@ const gt = (x, t) => {
1238
1245
  email: H.value.email || "",
1239
1246
  phone: H.value.phone || "",
1240
1247
  bio: H.value.bio || ""
1241
- }, oe.value = !0;
1248
+ }, le.value = !0;
1242
1249
  }, vt = () => {
1243
- oe.value = !1, K.value = { nickname: "", email: "", phone: "", bio: "" };
1250
+ le.value = !1, K.value = { nickname: "", email: "", phone: "", bio: "" };
1244
1251
  }, pt = async () => {
1245
- re.value = !0;
1252
+ oe.value = !0;
1246
1253
  try {
1247
- await pe(K.value) ? (Q.success("保存成功"), oe.value = !1) : Q.error("保存失败");
1248
- } catch (h) {
1249
- console.error(h), Q.error("保存失败");
1254
+ await pe(K.value) ? (Q.success("保存成功"), le.value = !1) : Q.error("保存失败");
1255
+ } catch (f) {
1256
+ console.error(f), Q.error("保存失败");
1250
1257
  } finally {
1251
- re.value = !1;
1258
+ oe.value = !1;
1252
1259
  }
1253
1260
  };
1254
- return _t(async () => {
1255
- await Promise.all([We(), q(), le()]), M(), f.value.length > 0 && Te(f.value[0]), v("init"), document.addEventListener("click", Le);
1256
- }), bt(() => {
1261
+ return bt(async () => {
1262
+ await Promise.all([We(), q()]), M(), h.value.length > 0 && Te(h.value[0]), v("init"), document.addEventListener("click", Le);
1263
+ }), kt(() => {
1257
1264
  N(), E(), document.removeEventListener("click", Le);
1258
- }), (h, r) => {
1265
+ }), (f, r) => {
1259
1266
  var ke, He, Ee;
1260
- const u = be("el-icon"), s = be("el-input"), b = be("el-empty"), T = be("el-button"), ce = be("el-dialog");
1267
+ const u = be("el-icon"), s = be("el-input"), b = be("el-empty"), T = be("el-button"), re = be("el-dialog");
1261
1268
  return a(), p("div", jt, [
1262
1269
  e("div", Ot, [
1263
1270
  e("div", {
@@ -1265,22 +1272,22 @@ const gt = (x, t) => {
1265
1272
  onClick: at
1266
1273
  }, [
1267
1274
  e("img", {
1268
- src: c(ee),
1275
+ src: d(ee),
1269
1276
  alt: "头像",
1270
1277
  class: "sidebar-avatar-img"
1271
1278
  }, null, 8, Gt)
1272
1279
  ]),
1273
- (a(!0), p(me, null, fe(B.value, (o) => (a(), p("div", {
1280
+ (a(!0), p(me, null, he(B.value, (o) => (a(), p("div", {
1274
1281
  key: o.id,
1275
1282
  class: J([
1276
1283
  "sidebar-nav-item",
1277
- ae.value === o.id ? "sidebar-nav-item-active" : "sidebar-nav-item-inactive"
1284
+ se.value === o.id ? "sidebar-nav-item-active" : "sidebar-nav-item-inactive"
1278
1285
  ]),
1279
- onClick: (ye) => ae.value = o.id
1286
+ onClick: (ge) => se.value = o.id
1280
1287
  }, [
1281
1288
  m(u, { size: 24 }, {
1282
1289
  default: k(() => [
1283
- (a(), G(kt(o.icon)))
1290
+ (a(), G(wt(o.icon)))
1284
1291
  ]),
1285
1292
  _: 2
1286
1293
  }, 1024),
@@ -1295,7 +1302,7 @@ const gt = (x, t) => {
1295
1302
  }, [
1296
1303
  m(u, { size: 24 }, {
1297
1304
  default: k(() => [
1298
- m(c($t))
1305
+ m(d(St))
1299
1306
  ]),
1300
1307
  _: 1
1301
1308
  })
@@ -1304,23 +1311,23 @@ const gt = (x, t) => {
1304
1311
  e("div", Zt, [
1305
1312
  e("div", es, [
1306
1313
  m(s, {
1307
- modelValue: c(V),
1314
+ modelValue: d(V),
1308
1315
  "onUpdate:modelValue": r[1] || (r[1] = (o) => Ie(V) ? V.value = o : null),
1309
1316
  placeholder: "搜索",
1310
- "prefix-icon": c(qe),
1317
+ "prefix-icon": d(qe),
1311
1318
  class: "chat-search-input"
1312
1319
  }, null, 8, ["modelValue", "prefix-icon"])
1313
1320
  ]),
1314
1321
  e("div", ts, [
1315
- ae.value === "chat" ? (a(), p("div", ss, [
1316
- (a(!0), p(me, null, fe(c(f), (o) => (a(), p("div", {
1322
+ se.value === "chat" ? (a(), p("div", ss, [
1323
+ (a(!0), p(me, null, he(d(h), (o) => (a(), p("div", {
1317
1324
  key: o.id,
1318
1325
  class: J([
1319
1326
  "chat-list-item",
1320
1327
  ne.value === o.id ? "chat-list-item-active" : ""
1321
1328
  ]),
1322
- onClick: (ye) => Te(o),
1323
- onContextmenu: Be((ye) => Ue(ye, o), ["prevent", "stop"])
1329
+ onClick: (ge) => Te(o),
1330
+ onContextmenu: Be((ge) => Ue(ge, o), ["prevent", "stop"])
1324
1331
  }, [
1325
1332
  e("div", ns, [
1326
1333
  e("img", {
@@ -1333,7 +1340,7 @@ const gt = (x, t) => {
1333
1340
  e("div", os, [
1334
1341
  e("div", rs, [
1335
1342
  e("span", cs, y(o.name), 1),
1336
- e("span", ds, y(c(Re)(o.lastTime)), 1)
1343
+ e("span", ds, y(d(Re)(o.lastTime)), 1)
1337
1344
  ]),
1338
1345
  e("div", us, [
1339
1346
  e("span", vs, y(o.lastMsg), 1),
@@ -1342,19 +1349,19 @@ const gt = (x, t) => {
1342
1349
  ])
1343
1350
  ], 42, as))), 128))
1344
1351
  ])) : S("", !0),
1345
- ae.value === "friends" && x.config.modules.friends ? (a(), p("div", ms, [
1346
- e("div", fs, [
1352
+ se.value === "friends" && x.config.modules.friends ? (a(), p("div", ms, [
1353
+ e("div", hs, [
1347
1354
  e("div", {
1348
1355
  class: "add-friend-btn",
1349
- onClick: r[2] || (r[2] = (...o) => c(P) && c(P)(...o))
1356
+ onClick: r[2] || (r[2] = (...o) => d(P) && d(P)(...o))
1350
1357
  }, [
1351
- e("div", hs, [
1358
+ e("div", fs, [
1352
1359
  m(u, {
1353
1360
  class: "text-white",
1354
1361
  size: 20
1355
1362
  }, {
1356
1363
  default: k(() => [
1357
- m(c(St))
1364
+ m(d(zt))
1358
1365
  ]),
1359
1366
  _: 1
1360
1367
  })
@@ -1362,10 +1369,10 @@ const gt = (x, t) => {
1362
1369
  r[14] || (r[14] = e("span", { class: "add-friend-text" }, "添加好友", -1))
1363
1370
  ])
1364
1371
  ]),
1365
- (a(!0), p(me, null, fe(c(ve), (o) => (a(), p("div", {
1372
+ (a(!0), p(me, null, he(d(ve), (o) => (a(), p("div", {
1366
1373
  key: o.id,
1367
1374
  class: "chat-list-item",
1368
- onClick: (ye) => tt(o)
1375
+ onClick: (ge) => tt(o)
1369
1376
  }, [
1370
1377
  e("div", ys, [
1371
1378
  e("img", {
@@ -1385,14 +1392,14 @@ const gt = (x, t) => {
1385
1392
  ])
1386
1393
  ], 8, gs))), 128))
1387
1394
  ])) : S("", !0),
1388
- ae.value === "apply" && x.config.modules.apply ? (a(), p("div", ws, [
1389
- c(Se) ? (a(), G(b, {
1395
+ se.value === "apply" && x.config.modules.apply ? (a(), p("div", ws, [
1396
+ d(Se) ? (a(), G(b, {
1390
1397
  key: 0,
1391
1398
  description: "加载中..."
1392
- })) : c(xe).length === 0 ? (a(), G(b, {
1399
+ })) : d(xe).length === 0 ? (a(), G(b, {
1393
1400
  key: 1,
1394
1401
  description: "暂无好友申请"
1395
- })) : (a(!0), p(me, { key: 2 }, fe(c(xe), (o) => (a(), p("div", {
1402
+ })) : (a(!0), p(me, { key: 2 }, he(d(xe), (o) => (a(), p("div", {
1396
1403
  key: o.applyUser || o.id,
1397
1404
  class: "friend-request-item"
1398
1405
  }, [
@@ -1410,7 +1417,7 @@ const gt = (x, t) => {
1410
1417
  m(T, {
1411
1418
  type: "primary",
1412
1419
  size: "small",
1413
- onClick: (ye) => c(te)(o.applyUser)
1420
+ onClick: (ge) => d(te)(o.applyUser)
1414
1421
  }, {
1415
1422
  default: k(() => [...r[16] || (r[16] = [
1416
1423
  ue("同意", -1)
@@ -1447,7 +1454,7 @@ const gt = (x, t) => {
1447
1454
  default: k(() => [
1448
1455
  m(u, null, {
1449
1456
  default: k(() => [
1450
- m(c(Ye))
1457
+ m(d(Ye))
1451
1458
  ]),
1452
1459
  _: 1
1453
1460
  }),
@@ -1470,7 +1477,7 @@ const gt = (x, t) => {
1470
1477
  e("div", Ts, [
1471
1478
  m(u, { class: "chat-action-icon" }, {
1472
1479
  default: k(() => [
1473
- m(c(qe))
1480
+ m(d(qe))
1474
1481
  ]),
1475
1482
  _: 1
1476
1483
  }),
@@ -1479,7 +1486,7 @@ const gt = (x, t) => {
1479
1486
  onClick: r[3] || (r[3] = (o) => ie.value = !ie.value)
1480
1487
  }, {
1481
1488
  default: k(() => [
1482
- m(c(zt))
1489
+ m(d(At))
1483
1490
  ]),
1484
1491
  _: 1
1485
1492
  })
@@ -1490,8 +1497,8 @@ const gt = (x, t) => {
1490
1497
  ref: A,
1491
1498
  class: "chat-messages-container"
1492
1499
  }, [
1493
- (a(!0), p(me, null, fe(c(he), (o, ye) => (a(), p("div", {
1494
- key: ye,
1500
+ (a(!0), p(me, null, he(d(ye), (o, ge) => (a(), p("div", {
1501
+ key: ge,
1495
1502
  class: J([
1496
1503
  "message-wrapper",
1497
1504
  o.isSelf ? "message-self" : "message-other"
@@ -1499,7 +1506,7 @@ const gt = (x, t) => {
1499
1506
  }, [
1500
1507
  e("div", Es, [
1501
1508
  e("img", {
1502
- src: o.isSelf ? c(ee) : D.value.avatar,
1509
+ src: o.isSelf ? d(ee) : D.value.avatar,
1503
1510
  class: "message-avatar-img"
1504
1511
  }, null, 8, Ds)
1505
1512
  ]),
@@ -1546,7 +1553,7 @@ const gt = (x, t) => {
1546
1553
  e("div", Ns, [
1547
1554
  m(u, { size: 28 }, {
1548
1555
  default: k(() => [
1549
- m(c(At))
1556
+ m(d(Vt))
1550
1557
  ]),
1551
1558
  _: 1
1552
1559
  })
@@ -1556,7 +1563,7 @@ const gt = (x, t) => {
1556
1563
  e("div", Os, [
1557
1564
  m(u, { size: 12 }, {
1558
1565
  default: k(() => [
1559
- m(c(Vt))
1566
+ m(d(Ft))
1560
1567
  ]),
1561
1568
  _: 1
1562
1569
  }),
@@ -1571,14 +1578,14 @@ const gt = (x, t) => {
1571
1578
  "message-time",
1572
1579
  o.isSelf ? "message-time-right" : "message-time-left"
1573
1580
  ])
1574
- }, y(c(Fe)(o.time)), 3)
1581
+ }, y(d(Fe)(o.time)), 3)
1575
1582
  ])
1576
1583
  ], 2)
1577
1584
  ], 2))), 128))
1578
1585
  ], 512),
1579
1586
  e("div", Js, [
1580
1587
  j.value.length > 0 ? (a(), p("div", Qs, [
1581
- (a(!0), p(me, null, fe(j.value, (o, ye) => (a(), p("div", {
1588
+ (a(!0), p(me, null, he(j.value, (o, ge) => (a(), p("div", {
1582
1589
  key: o.id,
1583
1590
  class: "pending-file-item"
1584
1591
  }, [
@@ -1589,19 +1596,19 @@ const gt = (x, t) => {
1589
1596
  class: "pending-image"
1590
1597
  }, null, 8, ea),
1591
1598
  e("button", {
1592
- onClick: (l) => Ke(ye),
1599
+ onClick: (l) => Ke(ge),
1593
1600
  class: "pending-file-remove-btn"
1594
1601
  }, " × ", 8, ta)
1595
1602
  ])) : (a(), p("div", sa, [
1596
1603
  m(u, { class: "pending-file-icon" }, {
1597
1604
  default: k(() => [
1598
- m(c(Ze))
1605
+ m(d(Ze))
1599
1606
  ]),
1600
1607
  _: 1
1601
1608
  }),
1602
1609
  e("span", aa, y(o.name), 1),
1603
1610
  e("button", {
1604
- onClick: (l) => Ke(ye),
1611
+ onClick: (l) => Ke(ge),
1605
1612
  class: "pending-file-remove-btn"
1606
1613
  }, " × ", 8, na)
1607
1614
  ]))
@@ -1610,7 +1617,7 @@ const gt = (x, t) => {
1610
1617
  x.config.modules.fileUpload ? (a(), p("div", ia, [
1611
1618
  m(u, { class: "input-toolbar-icon" }, {
1612
1619
  default: k(() => [
1613
- m(c(Ye))
1620
+ m(d(Ye))
1614
1621
  ]),
1615
1622
  _: 1
1616
1623
  }),
@@ -1619,33 +1626,33 @@ const gt = (x, t) => {
1619
1626
  onClick: it
1620
1627
  }, {
1621
1628
  default: k(() => [
1622
- m(c(Ze))
1629
+ m(d(Ze))
1623
1630
  ]),
1624
1631
  _: 1
1625
1632
  }),
1626
1633
  m(u, { class: "input-toolbar-icon" }, {
1627
1634
  default: k(() => [
1628
- m(c(Ft))
1635
+ m(d(It))
1629
1636
  ]),
1630
1637
  _: 1
1631
1638
  })
1632
1639
  ])) : S("", !0),
1633
1640
  e("div", la, [
1634
- wt(e("textarea", {
1641
+ Ct(e("textarea", {
1635
1642
  "onUpdate:modelValue": r[4] || (r[4] = (o) => Ie(U) ? U.value = o : null),
1636
- onKeydown: Ct(Be(Pe, ["prevent"]), ["enter"]),
1643
+ onKeydown: xt(Be(Pe, ["prevent"]), ["enter"]),
1637
1644
  onPaste: ot,
1638
1645
  placeholder: "输入消息或粘贴文件...",
1639
1646
  class: "message-input-textarea",
1640
1647
  rows: "3"
1641
1648
  }, null, 40, oa), [
1642
- [xt, c(U)]
1649
+ [Ut, d(U)]
1643
1650
  ])
1644
1651
  ]),
1645
1652
  e("div", ra, [
1646
1653
  m(T, {
1647
1654
  type: "primary",
1648
- disabled: !c(U).trim() && j.value.length === 0,
1655
+ disabled: !d(U).trim() && j.value.length === 0,
1649
1656
  onClick: Pe,
1650
1657
  class: "send-message-btn"
1651
1658
  }, {
@@ -1670,11 +1677,11 @@ const gt = (x, t) => {
1670
1677
  class: "empty-state-icon"
1671
1678
  }, {
1672
1679
  default: k(() => [
1673
- m(c(It))
1680
+ m(d(Rt))
1674
1681
  ]),
1675
1682
  _: 1
1676
1683
  }),
1677
- e("div", da, y(ae.value === "apply" ? "在左侧选择好友申请" : "在左侧选择好友开始聊天"), 1)
1684
+ e("div", da, y(se.value === "apply" ? "在左侧选择好友申请" : "在左侧选择好友开始聊天"), 1)
1678
1685
  ]))
1679
1686
  ]),
1680
1687
  ie.value ? (a(), p("div", ua, [
@@ -1686,7 +1693,7 @@ const gt = (x, t) => {
1686
1693
  alt: (He = D.value) == null ? void 0 : He.name,
1687
1694
  class: "chat-detail-avatar"
1688
1695
  }, null, 8, ma),
1689
- e("div", fa, y((Ee = D.value) == null ? void 0 : Ee.name), 1),
1696
+ e("div", ha, y((Ee = D.value) == null ? void 0 : Ee.name), 1),
1690
1697
  r[20] || (r[20] = e("div", { class: "chat-detail-actions" }, [
1691
1698
  e("div", { class: "chat-detail-action-item" }, "查找聊天记录"),
1692
1699
  e("div", { class: "chat-detail-action-item" }, "清空聊天记录")
@@ -1694,31 +1701,31 @@ const gt = (x, t) => {
1694
1701
  ])
1695
1702
  ])
1696
1703
  ])) : S("", !0),
1697
- m(ce, {
1698
- modelValue: c(C),
1704
+ m(re, {
1705
+ modelValue: d(C),
1699
1706
  "onUpdate:modelValue": r[6] || (r[6] = (o) => Ie(C) ? C.value = o : null),
1700
1707
  title: "添加好友",
1701
1708
  width: "500px",
1702
1709
  "append-to-body": ""
1703
1710
  }, {
1704
1711
  default: k(() => [
1705
- e("div", ha, [
1712
+ e("div", fa, [
1706
1713
  m(s, {
1707
- modelValue: c(ge),
1708
- "onUpdate:modelValue": r[5] || (r[5] = (o) => Ie(ge) ? ge.value = o : null),
1714
+ modelValue: d(fe),
1715
+ "onUpdate:modelValue": r[5] || (r[5] = (o) => Ie(fe) ? fe.value = o : null),
1709
1716
  placeholder: "搜索用户",
1710
- "prefix-icon": c(qe),
1717
+ "prefix-icon": d(qe),
1711
1718
  class: "add-friend-search-input"
1712
1719
  }, null, 8, ["modelValue", "prefix-icon"])
1713
1720
  ]),
1714
1721
  e("div", ga, [
1715
- c(Ve) ? (a(), G(b, {
1722
+ d(Ve) ? (a(), G(b, {
1716
1723
  key: 0,
1717
1724
  description: "加载中..."
1718
- })) : c(de).length === 0 ? (a(), G(b, {
1725
+ })) : d(ce).length === 0 ? (a(), G(b, {
1719
1726
  key: 1,
1720
1727
  description: "暂无用户"
1721
- })) : (a(!0), p(me, { key: 2 }, fe(c(de), (o) => (a(), p("div", {
1728
+ })) : (a(!0), p(me, { key: 2 }, he(d(ce), (o) => (a(), p("div", {
1722
1729
  key: o.username,
1723
1730
  class: "add-friend-user-item"
1724
1731
  }, [
@@ -1733,7 +1740,7 @@ const gt = (x, t) => {
1733
1740
  m(T, {
1734
1741
  type: "primary",
1735
1742
  size: "small",
1736
- onClick: (ye) => c(L)(o)
1743
+ onClick: (ge) => d(L)(o)
1737
1744
  }, {
1738
1745
  default: k(() => [...r[22] || (r[22] = [
1739
1746
  ue("添加", -1)
@@ -1745,7 +1752,7 @@ const gt = (x, t) => {
1745
1752
  ]),
1746
1753
  _: 1
1747
1754
  }, 8, ["modelValue"]),
1748
- m(ce, {
1755
+ m(re, {
1749
1756
  modelValue: ze.value,
1750
1757
  "onUpdate:modelValue": r[11] || (r[11] = (o) => ze.value = o),
1751
1758
  title: "个人设置",
@@ -1759,7 +1766,7 @@ const gt = (x, t) => {
1759
1766
  e("div", wa, [
1760
1767
  e("div", Ca, [
1761
1768
  e("img", {
1762
- src: c(ee),
1769
+ src: d(ee),
1763
1770
  alt: "头像",
1764
1771
  class: "chat-settings-avatar"
1765
1772
  }, null, 8, xa),
@@ -1773,7 +1780,7 @@ const gt = (x, t) => {
1773
1780
  class: "chat-settings-avatar-icon"
1774
1781
  }, {
1775
1782
  default: k(() => [
1776
- m(c(Rt))
1783
+ m(d(Mt))
1777
1784
  ]),
1778
1785
  _: 1
1779
1786
  })
@@ -1788,8 +1795,8 @@ const gt = (x, t) => {
1788
1795
  }, null, 544)
1789
1796
  ]),
1790
1797
  e("div", Ua, [
1791
- e("div", $a, y(c(H).nickname || c($)), 1),
1792
- e("div", Sa, "@" + y(c($)), 1)
1798
+ e("div", $a, y(d(H).nickname || d($)), 1),
1799
+ e("div", Sa, "@" + y(d($)), 1)
1793
1800
  ])
1794
1801
  ]),
1795
1802
  e("div", za, [
@@ -1797,13 +1804,13 @@ const gt = (x, t) => {
1797
1804
  e("div", Va, [
1798
1805
  m(u, null, {
1799
1806
  default: k(() => [
1800
- m(c(Qe))
1807
+ m(d(Qe))
1801
1808
  ]),
1802
1809
  _: 1
1803
1810
  }),
1804
1811
  r[23] || (r[23] = ue(" 个人信息 ", -1))
1805
1812
  ]),
1806
- oe.value ? S("", !0) : (a(), G(T, {
1813
+ le.value ? S("", !0) : (a(), G(T, {
1807
1814
  key: 0,
1808
1815
  type: "primary",
1809
1816
  size: "small",
@@ -1819,37 +1826,37 @@ const gt = (x, t) => {
1819
1826
  e("div", Fa, [
1820
1827
  e("div", Ia, [
1821
1828
  r[25] || (r[25] = e("label", { class: "chat-settings-form-label" }, "昵称", -1)),
1822
- oe.value ? (a(), G(s, {
1829
+ le.value ? (a(), G(s, {
1823
1830
  key: 0,
1824
1831
  modelValue: K.value.nickname,
1825
1832
  "onUpdate:modelValue": r[7] || (r[7] = (o) => K.value.nickname = o),
1826
1833
  placeholder: "请输入昵称",
1827
1834
  size: "large"
1828
- }, null, 8, ["modelValue"])) : (a(), p("div", Ra, y(c(H).nickname || "未设置"), 1))
1835
+ }, null, 8, ["modelValue"])) : (a(), p("div", Ra, y(d(H).nickname || "未设置"), 1))
1829
1836
  ]),
1830
1837
  e("div", Ma, [
1831
1838
  r[26] || (r[26] = e("label", { class: "chat-settings-form-label" }, "邮箱", -1)),
1832
- oe.value ? (a(), G(s, {
1839
+ le.value ? (a(), G(s, {
1833
1840
  key: 0,
1834
1841
  modelValue: K.value.email,
1835
1842
  "onUpdate:modelValue": r[8] || (r[8] = (o) => K.value.email = o),
1836
1843
  placeholder: "请输入邮箱",
1837
1844
  size: "large"
1838
- }, null, 8, ["modelValue"])) : (a(), p("div", La, y(c(H).email || "未设置"), 1))
1845
+ }, null, 8, ["modelValue"])) : (a(), p("div", La, y(d(H).email || "未设置"), 1))
1839
1846
  ]),
1840
1847
  e("div", Ta, [
1841
1848
  r[27] || (r[27] = e("label", { class: "chat-settings-form-label" }, "手机号", -1)),
1842
- oe.value ? (a(), G(s, {
1849
+ le.value ? (a(), G(s, {
1843
1850
  key: 0,
1844
1851
  modelValue: K.value.phone,
1845
1852
  "onUpdate:modelValue": r[9] || (r[9] = (o) => K.value.phone = o),
1846
1853
  placeholder: "请输入手机号",
1847
1854
  size: "large"
1848
- }, null, 8, ["modelValue"])) : (a(), p("div", Ea, y(c(H).phone || "未设置"), 1))
1855
+ }, null, 8, ["modelValue"])) : (a(), p("div", Ea, y(d(H).phone || "未设置"), 1))
1849
1856
  ]),
1850
1857
  e("div", Da, [
1851
1858
  r[28] || (r[28] = e("label", { class: "chat-settings-form-label" }, "个人简介", -1)),
1852
- oe.value ? (a(), G(s, {
1859
+ le.value ? (a(), G(s, {
1853
1860
  key: 0,
1854
1861
  modelValue: K.value.bio,
1855
1862
  "onUpdate:modelValue": r[10] || (r[10] = (o) => K.value.bio = o),
@@ -1857,9 +1864,9 @@ const gt = (x, t) => {
1857
1864
  rows: 4,
1858
1865
  placeholder: "介绍一下自己吧...",
1859
1866
  size: "large"
1860
- }, null, 8, ["modelValue"])) : (a(), p("div", Wa, y(c(H).bio || "这个人很懒,什么都没写~"), 1))
1867
+ }, null, 8, ["modelValue"])) : (a(), p("div", Wa, y(d(H).bio || "这个人很懒,什么都没写~"), 1))
1861
1868
  ]),
1862
- oe.value ? (a(), p("div", Ha, [
1869
+ le.value ? (a(), p("div", Ha, [
1863
1870
  m(T, {
1864
1871
  size: "default",
1865
1872
  onClick: vt
@@ -1872,7 +1879,7 @@ const gt = (x, t) => {
1872
1879
  m(T, {
1873
1880
  type: "primary",
1874
1881
  size: "default",
1875
- loading: re.value,
1882
+ loading: oe.value,
1876
1883
  onClick: pt
1877
1884
  }, {
1878
1885
  default: k(() => [...r[30] || (r[30] = [
@@ -1906,7 +1913,7 @@ const gt = (x, t) => {
1906
1913
  ]);
1907
1914
  };
1908
1915
  }
1909
- }, Ya = /* @__PURE__ */ gt(Xa, [["__scopeId", "data-v-f5908195"]]), qa = { class: "chat-container" }, Ba = { class: "sidebar-nav" }, Ka = ["src"], Na = ["onClick"], Pa = {
1916
+ }, Ya = /* @__PURE__ */ gt(Xa, [["__scopeId", "data-v-c08932e1"]]), qa = { class: "chat-container" }, Ba = { class: "sidebar-nav" }, Ka = ["src"], Na = ["onClick"], Pa = {
1910
1917
  key: 0,
1911
1918
  class: "nav-badge"
1912
1919
  }, ja = { class: "content-panel" }, Oa = { class: "search-bar" }, Ga = { class: "content-scroll" }, Ja = { key: 0 }, Qa = ["onClick", "onContextmenu"], Za = { class: "friend-avatar-wrapper" }, en = ["src", "alt"], tn = {
@@ -1915,7 +1922,7 @@ const gt = (x, t) => {
1915
1922
  }, sn = { class: "friend-info" }, an = { class: "friend-header" }, nn = { class: "friend-name" }, ln = { class: "last-time" }, on = { class: "friend-preview" }, rn = { class: "last-msg" }, cn = {
1916
1923
  key: 0,
1917
1924
  class: "unread-badge"
1918
- }, dn = { key: 1 }, un = { class: "add-friend-section" }, vn = { class: "add-friend-icon" }, pn = ["onClick"], mn = { class: "friend-avatar-wrapper" }, fn = ["src", "alt"], hn = { class: "friend-info" }, gn = { class: "friend-name" }, yn = { key: 2 }, _n = { class: "request-info" }, bn = ["src", "alt"], kn = { class: "request-details" }, wn = { class: "request-username" }, Cn = { class: "chat-area" }, xn = {
1925
+ }, dn = { key: 1 }, un = { class: "add-friend-section" }, vn = { class: "add-friend-icon" }, pn = ["onClick"], mn = { class: "friend-avatar-wrapper" }, hn = ["src", "alt"], fn = { class: "friend-info" }, gn = { class: "friend-name" }, yn = { key: 2 }, _n = { class: "request-info" }, bn = ["src", "alt"], kn = { class: "request-details" }, wn = { class: "request-username" }, Cn = { class: "chat-area" }, xn = {
1919
1926
  key: 0,
1920
1927
  class: "friend-profile"
1921
1928
  }, Un = ["src", "alt"], $n = { class: "profile-name" }, Sn = { class: "profile-status" }, zn = {
@@ -1945,7 +1952,7 @@ const gt = (x, t) => {
1945
1952
  }, li = { class: "empty-text" }, oi = {
1946
1953
  key: 0,
1947
1954
  class: "detail-panel"
1948
- }, ri = { class: "detail-content" }, ci = { class: "detail-profile" }, di = ["src", "alt"], ui = { class: "detail-name" }, vi = { class: "search-users-wrapper" }, pi = { class: "search-users-input" }, mi = { class: "users-list-scroll" }, fi = { class: "available-user-info" }, hi = ["src", "alt"], gi = { class: "available-user-name" }, yi = { class: "settings-container" }, _i = { class: "settings-avatar-section" }, bi = { class: "settings-avatar-wrapper" }, ki = ["src"], wi = { class: "settings-user-display" }, Ci = { class: "settings-nickname" }, xi = { class: "settings-username" }, Ui = { class: "settings-form-section" }, $i = { class: "settings-form-header" }, Si = { class: "settings-form-title" }, zi = { class: "settings-form" }, Ai = { class: "settings-form-item" }, Vi = {
1955
+ }, ri = { class: "detail-content" }, ci = { class: "detail-profile" }, di = ["src", "alt"], ui = { class: "detail-name" }, vi = { class: "search-users-wrapper" }, pi = { class: "search-users-input" }, mi = { class: "users-list-scroll" }, hi = { class: "available-user-info" }, fi = ["src", "alt"], gi = { class: "available-user-name" }, yi = { class: "settings-container" }, _i = { class: "settings-avatar-section" }, bi = { class: "settings-avatar-wrapper" }, ki = ["src"], wi = { class: "settings-user-display" }, Ci = { class: "settings-nickname" }, xi = { class: "settings-username" }, Ui = { class: "settings-form-section" }, $i = { class: "settings-form-header" }, Si = { class: "settings-form-title" }, zi = { class: "settings-form" }, Ai = { class: "settings-form-item" }, Vi = {
1949
1956
  key: 1,
1950
1957
  class: "settings-form-value"
1951
1958
  }, Fi = { class: "settings-form-item" }, Ii = {
@@ -1981,12 +1988,12 @@ const gt = (x, t) => {
1981
1988
  filteredFriendList: V,
1982
1989
  searchText: U,
1983
1990
  inputText: A,
1984
- messagesContainer: f,
1985
- filteredUsers: de,
1991
+ messagesContainer: h,
1992
+ filteredUsers: ce,
1986
1993
  filteredAvailableUsers: Ae,
1987
- currentUser: he,
1994
+ currentUser: ye,
1988
1995
  currentMessages: C,
1989
- addFriendDialogVisible: ge,
1996
+ addFriendDialogVisible: fe,
1990
1997
  addFriendSearchText: Ce,
1991
1998
  availableUsers: Ve,
1992
1999
  loadingAvailableUsers: xe,
@@ -2008,21 +2015,21 @@ const gt = (x, t) => {
2008
2015
  openAddFriendDialog: L,
2009
2016
  addFriend: q,
2010
2017
  loadFriendApplyList: te,
2011
- agreeFriend: se,
2012
- updateMyAvatar: le,
2018
+ agreeFriend: ae,
2019
+ updateMyAvatar: de,
2013
2020
  getUserInfo: pe,
2014
2021
  updateUserInfo: B
2015
- } = Lt(n.config), ae = we(() => {
2022
+ } = Tt(n.config), se = we(() => {
2016
2023
  var s;
2017
2024
  const u = [{ id: "chat", icon: Ye, badge: 0 }];
2018
- return n.config.modules.friends && u.push({ id: "friends", icon: Qe, badge: 0 }), n.config.modules.apply && u.push({ id: "apply", icon: Ut, badge: ((s = Se.value) == null ? void 0 : s.length) || 0 }), u;
2019
- }), ne = _("chat"), D = _(null), W = _(null), ie = _(null), oe = _(!1), K = _(!1), re = _({ nickname: "", email: "", phone: "", bio: "" }), ze = _(!1), i = _(!1), d = _(!1), g = _(!1), F = _(null), _e = _(""), j = _(null), O = _([]), Ue = _({ visible: !1, x: 0, y: 0, chat: null }), Le = () => {
2025
+ return n.config.modules.friends && u.push({ id: "friends", icon: Qe, badge: 0 }), n.config.modules.apply && u.push({ id: "apply", icon: $t, badge: ((s = Se.value) == null ? void 0 : s.length) || 0 }), u;
2026
+ }), ne = _("chat"), D = _(null), W = _(null), ie = _(null), le = _(!1), K = _(!1), oe = _({ nickname: "", email: "", phone: "", bio: "" }), ze = _(!1), i = _(!1), c = _(!1), g = _(!1), F = _(null), _e = _(""), j = _(null), O = _([]), Ue = _({ visible: !1, x: 0, y: 0, chat: null }), Le = () => {
2020
2027
  Ue.value.visible = !1;
2021
2028
  }, et = async () => {
2022
2029
  if (!Ue.value.chat) return;
2023
2030
  await z(Ue.value.chat.id, 0) && D.value === Ue.value.chat.id && (D.value = null, W.value = null), Le();
2024
2031
  }, Te = (u) => {
2025
- D.value = u.id, W.value = u, ie.value = null, oe.value = !1, Y({
2032
+ D.value = u.id, W.value = u, ie.value = null, le.value = !1, Y({
2026
2033
  id: u.id,
2027
2034
  name: u.name,
2028
2035
  avatar: u.avatar,
@@ -2034,7 +2041,7 @@ const gt = (x, t) => {
2034
2041
  if (!ie.value) return;
2035
2042
  if (await z(ie.value.id)) {
2036
2043
  ne.value = "chat", await Oe();
2037
- const s = de.value.find((b) => b.id === ie.value.id);
2044
+ const s = ce.value.find((b) => b.id === ie.value.id);
2038
2045
  s && Te(s), ie.value = null;
2039
2046
  }
2040
2047
  }, at = () => {
@@ -2085,21 +2092,21 @@ const gt = (x, t) => {
2085
2092
  if (s) {
2086
2093
  for (const T of s)
2087
2094
  if (T.kind === "file") {
2088
- const ce = T.getAsFile();
2089
- if (ce) {
2090
- if (ce.size > 50 * 1024 * 1024) {
2091
- Q.warning(`文件 ${ce.name} 超过50MB,已跳过`);
2095
+ const re = T.getAsFile();
2096
+ if (re) {
2097
+ if (re.size > 50 * 1024 * 1024) {
2098
+ Q.warning(`文件 ${re.name} 超过50MB,已跳过`);
2092
2099
  continue;
2093
2100
  }
2094
- const ke = URL.createObjectURL(ce);
2101
+ const ke = URL.createObjectURL(re);
2095
2102
  O.value.push({
2096
2103
  id: Date.now() + Math.random(),
2097
- file: ce,
2098
- name: ce.name,
2099
- size: ce.size,
2100
- type: ce.type,
2104
+ file: re,
2105
+ name: re.name,
2106
+ size: re.size,
2107
+ type: re.type,
2101
2108
  previewUrl: ke,
2102
- isImage: ce.type.startsWith("image/")
2109
+ isImage: re.type.startsWith("image/")
2103
2110
  });
2104
2111
  }
2105
2112
  }
@@ -2125,14 +2132,14 @@ const gt = (x, t) => {
2125
2132
  }
2126
2133
  const b = new FileReader();
2127
2134
  b.onload = (T) => {
2128
- _e.value = T.target.result, d.value = !0;
2135
+ _e.value = T.target.result, c.value = !0;
2129
2136
  }, b.readAsDataURL(s);
2130
2137
  }, dt = async ({ file: u }) => {
2131
2138
  if (u) {
2132
2139
  g.value = !0;
2133
2140
  try {
2134
- const { ChatApi: s } = await Promise.resolve().then(() => Mt), T = await new s(n.config).uploadAvatar(u, ee);
2135
- T.code === 200 ? (Q.success("头像上传成功"), le(T.data), Ge()) : Q.error(T.msg || "头像上传失败");
2141
+ const { ChatApi: s } = await Promise.resolve().then(() => Lt), T = await new s(n.config).uploadAvatar(u, ee);
2142
+ T.code === 200 ? (Q.success("头像上传成功"), de(T.data), Ge()) : Q.error(T.msg || "头像上传失败");
2136
2143
  } catch (s) {
2137
2144
  console.error(s), Q.error("头像上传失败");
2138
2145
  } finally {
@@ -2140,36 +2147,36 @@ const gt = (x, t) => {
2140
2147
  }
2141
2148
  }
2142
2149
  }, Ge = () => {
2143
- _e.value = "", d.value = !1, F.value && (F.value.value = "");
2150
+ _e.value = "", c.value = !1, F.value && (F.value.value = "");
2144
2151
  }, ut = () => {
2145
- re.value = {
2152
+ oe.value = {
2146
2153
  nickname: Z.value.nickname || "",
2147
2154
  email: Z.value.email || "",
2148
2155
  phone: Z.value.phone || "",
2149
2156
  bio: Z.value.bio || ""
2150
2157
  }, K.value = !0;
2151
2158
  }, vt = () => {
2152
- K.value = !1, re.value = { nickname: "", email: "", phone: "", bio: "" };
2159
+ K.value = !1, oe.value = { nickname: "", email: "", phone: "", bio: "" };
2153
2160
  }, pt = async () => {
2154
2161
  ze.value = !0;
2155
2162
  try {
2156
- await B(re.value) ? (Q.success("保存成功"), K.value = !1) : Q.error("保存失败");
2163
+ await B(oe.value) ? (Q.success("保存成功"), K.value = !1) : Q.error("保存失败");
2157
2164
  } catch (u) {
2158
2165
  console.error(u), Q.error("保存失败");
2159
2166
  } finally {
2160
2167
  ze.value = !1;
2161
2168
  }
2162
- }, h = () => {
2163
- P(), N(), oe.value = !1, i.value = !1, Ge(), K.value = !1, v("close");
2169
+ }, f = () => {
2170
+ P(), N(), le.value = !1, i.value = !1, Ge(), K.value = !1, v("close");
2164
2171
  }, r = async () => {
2165
- await Promise.all([Me(), te(), pe()]), E(), de.value.length > 0 && Te(de.value[0]), v("open");
2172
+ await Promise.all([Me(), te(), pe()]), E(), ce.value.length > 0 && Te(ce.value[0]), v("open");
2166
2173
  };
2167
- return _t(() => {
2174
+ return bt(() => {
2168
2175
  document.addEventListener("click", Le);
2169
- }), bt(() => {
2176
+ }), kt(() => {
2170
2177
  document.removeEventListener("click", Le), N();
2171
2178
  }), (u, s) => {
2172
- const b = be("el-icon"), T = be("el-input"), ce = be("el-empty"), ke = be("el-button"), He = be("el-dialog");
2179
+ const b = be("el-icon"), T = be("el-input"), re = be("el-empty"), ke = be("el-button"), He = be("el-dialog");
2173
2180
  return a(), G(He, {
2174
2181
  modelValue: $.value,
2175
2182
  "onUpdate:modelValue": s[13] || (s[13] = (Ee) => $.value = Ee),
@@ -2177,11 +2184,11 @@ const gt = (x, t) => {
2177
2184
  "close-on-click-modal": !1,
2178
2185
  class: "chat-dialog",
2179
2186
  "append-to-body": "",
2180
- onClosed: h,
2187
+ onClosed: f,
2181
2188
  onOpen: r
2182
2189
  }, {
2183
2190
  default: k(() => {
2184
- var Ee, o, ye;
2191
+ var Ee, o, ge;
2185
2192
  return [
2186
2193
  e("div", qa, [
2187
2194
  e("div", Ba, [
@@ -2190,12 +2197,12 @@ const gt = (x, t) => {
2190
2197
  onClick: at
2191
2198
  }, [
2192
2199
  e("img", {
2193
- src: c(H),
2200
+ src: d(H),
2194
2201
  alt: "头像",
2195
2202
  class: "avatar-img"
2196
2203
  }, null, 8, Ka)
2197
2204
  ]),
2198
- (a(!0), p(me, null, fe(ae.value, (l) => (a(), p("div", {
2205
+ (a(!0), p(me, null, he(se.value, (l) => (a(), p("div", {
2199
2206
  key: l.id,
2200
2207
  class: J([
2201
2208
  "nav-item",
@@ -2205,7 +2212,7 @@ const gt = (x, t) => {
2205
2212
  }, [
2206
2213
  m(b, { size: 24 }, {
2207
2214
  default: k(() => [
2208
- (a(), G(kt(l.icon)))
2215
+ (a(), G(wt(l.icon)))
2209
2216
  ]),
2210
2217
  _: 2
2211
2218
  }, 1024),
@@ -2220,7 +2227,7 @@ const gt = (x, t) => {
2220
2227
  }, [
2221
2228
  m(b, { size: 24 }, {
2222
2229
  default: k(() => [
2223
- m(c($t))
2230
+ m(d(St))
2224
2231
  ]),
2225
2232
  _: 1
2226
2233
  })
@@ -2229,15 +2236,15 @@ const gt = (x, t) => {
2229
2236
  e("div", ja, [
2230
2237
  e("div", Oa, [
2231
2238
  m(T, {
2232
- modelValue: c(U),
2239
+ modelValue: d(U),
2233
2240
  "onUpdate:modelValue": s[1] || (s[1] = (l) => Ie(U) ? U.value = l : null),
2234
2241
  placeholder: "搜索",
2235
- "prefix-icon": c(qe)
2242
+ "prefix-icon": d(qe)
2236
2243
  }, null, 8, ["modelValue", "prefix-icon"])
2237
2244
  ]),
2238
2245
  e("div", Ga, [
2239
2246
  ne.value === "chat" ? (a(), p("div", Ja, [
2240
- (a(!0), p(me, null, fe(c(de), (l) => (a(), p("div", {
2247
+ (a(!0), p(me, null, he(d(ce), (l) => (a(), p("div", {
2241
2248
  key: l.id,
2242
2249
  class: J([
2243
2250
  "chat-item",
@@ -2257,7 +2264,7 @@ const gt = (x, t) => {
2257
2264
  e("div", sn, [
2258
2265
  e("div", an, [
2259
2266
  e("span", nn, y(l.name), 1),
2260
- e("span", ln, y(c(De)(l.lastTime)), 1)
2267
+ e("span", ln, y(d(De)(l.lastTime)), 1)
2261
2268
  ]),
2262
2269
  e("div", on, [
2263
2270
  e("span", rn, y(l.lastMsg), 1),
@@ -2270,7 +2277,7 @@ const gt = (x, t) => {
2270
2277
  e("div", un, [
2271
2278
  e("div", {
2272
2279
  class: "add-friend-btn",
2273
- onClick: s[2] || (s[2] = (...l) => c(L) && c(L)(...l))
2280
+ onClick: s[2] || (s[2] = (...l) => d(L) && d(L)(...l))
2274
2281
  }, [
2275
2282
  e("div", vn, [
2276
2283
  m(b, {
@@ -2278,7 +2285,7 @@ const gt = (x, t) => {
2278
2285
  size: 20
2279
2286
  }, {
2280
2287
  default: k(() => [
2281
- m(c(St))
2288
+ m(d(zt))
2282
2289
  ]),
2283
2290
  _: 1
2284
2291
  })
@@ -2286,7 +2293,7 @@ const gt = (x, t) => {
2286
2293
  s[15] || (s[15] = e("span", { class: "add-friend-text" }, "添加好友", -1))
2287
2294
  ])
2288
2295
  ]),
2289
- (a(!0), p(me, null, fe(c(V), (l) => (a(), p("div", {
2296
+ (a(!0), p(me, null, he(d(V), (l) => (a(), p("div", {
2290
2297
  key: l.id,
2291
2298
  class: "chat-item",
2292
2299
  onClick: ($e) => tt(l)
@@ -2296,7 +2303,7 @@ const gt = (x, t) => {
2296
2303
  src: l.avatar,
2297
2304
  alt: l.name,
2298
2305
  class: "friend-avatar"
2299
- }, null, 8, fn),
2306
+ }, null, 8, hn),
2300
2307
  e("span", {
2301
2308
  class: J([
2302
2309
  "online-indicator",
@@ -2304,19 +2311,19 @@ const gt = (x, t) => {
2304
2311
  ])
2305
2312
  }, null, 2)
2306
2313
  ]),
2307
- e("div", hn, [
2314
+ e("div", fn, [
2308
2315
  e("span", gn, y(l.name), 1)
2309
2316
  ])
2310
2317
  ], 8, pn))), 128))
2311
2318
  ])) : S("", !0),
2312
2319
  ne.value === "apply" && x.config.modules.apply ? (a(), p("div", yn, [
2313
- c(Fe) ? (a(), G(ce, {
2320
+ d(Fe) ? (a(), G(re, {
2314
2321
  key: 0,
2315
2322
  description: "加载中..."
2316
- })) : c(Se).length === 0 ? (a(), G(ce, {
2323
+ })) : d(Se).length === 0 ? (a(), G(re, {
2317
2324
  key: 1,
2318
2325
  description: "暂无好友申请"
2319
- })) : (a(!0), p(me, { key: 2 }, fe(c(Se), (l) => (a(), p("div", {
2326
+ })) : (a(!0), p(me, { key: 2 }, he(d(Se), (l) => (a(), p("div", {
2320
2327
  key: l.applyUser || l.id,
2321
2328
  class: "friend-request-item"
2322
2329
  }, [
@@ -2334,7 +2341,7 @@ const gt = (x, t) => {
2334
2341
  m(ke, {
2335
2342
  type: "primary",
2336
2343
  size: "small",
2337
- onClick: ($e) => c(se)(l.applyUser)
2344
+ onClick: ($e) => d(ae)(l.applyUser)
2338
2345
  }, {
2339
2346
  default: k(() => [...s[17] || (s[17] = [
2340
2347
  ue("同意", -1)
@@ -2371,7 +2378,7 @@ const gt = (x, t) => {
2371
2378
  default: k(() => [
2372
2379
  m(b, null, {
2373
2380
  default: k(() => [
2374
- m(c(Ye))
2381
+ m(d(Ye))
2375
2382
  ]),
2376
2383
  _: 1
2377
2384
  }),
@@ -2394,16 +2401,16 @@ const gt = (x, t) => {
2394
2401
  e("div", In, [
2395
2402
  m(b, { class: "action-icon" }, {
2396
2403
  default: k(() => [
2397
- m(c(qe))
2404
+ m(d(qe))
2398
2405
  ]),
2399
2406
  _: 1
2400
2407
  }),
2401
2408
  m(b, {
2402
2409
  class: "action-icon",
2403
- onClick: s[3] || (s[3] = (l) => oe.value = !oe.value)
2410
+ onClick: s[3] || (s[3] = (l) => le.value = !le.value)
2404
2411
  }, {
2405
2412
  default: k(() => [
2406
- m(c(zt))
2413
+ m(d(At))
2407
2414
  ]),
2408
2415
  _: 1
2409
2416
  })
@@ -2411,10 +2418,10 @@ const gt = (x, t) => {
2411
2418
  ]),
2412
2419
  e("div", {
2413
2420
  ref_key: "messagesContainer",
2414
- ref: f,
2421
+ ref: h,
2415
2422
  class: "messages-container"
2416
2423
  }, [
2417
- (a(!0), p(me, null, fe(c(C), (l, $e) => (a(), p("div", {
2424
+ (a(!0), p(me, null, he(d(C), (l, $e) => (a(), p("div", {
2418
2425
  key: $e,
2419
2426
  class: J([
2420
2427
  "message-wrapper",
@@ -2423,7 +2430,7 @@ const gt = (x, t) => {
2423
2430
  }, [
2424
2431
  e("div", Rn, [
2425
2432
  e("img", {
2426
- src: l.isSelf ? c(H) : W.value.avatar,
2433
+ src: l.isSelf ? d(H) : W.value.avatar,
2427
2434
  class: "avatar-sm"
2428
2435
  }, null, 8, Mn)
2429
2436
  ]),
@@ -2470,7 +2477,7 @@ const gt = (x, t) => {
2470
2477
  e("div", Yn, [
2471
2478
  m(b, { size: 28 }, {
2472
2479
  default: k(() => [
2473
- m(c(At))
2480
+ m(d(Vt))
2474
2481
  ]),
2475
2482
  _: 1
2476
2483
  })
@@ -2480,7 +2487,7 @@ const gt = (x, t) => {
2480
2487
  e("div", Kn, [
2481
2488
  m(b, { size: 12 }, {
2482
2489
  default: k(() => [
2483
- m(c(Vt))
2490
+ m(d(Ft))
2484
2491
  ]),
2485
2492
  _: 1
2486
2493
  }),
@@ -2495,14 +2502,14 @@ const gt = (x, t) => {
2495
2502
  "message-time",
2496
2503
  l.isSelf ? "time-right" : "time-left"
2497
2504
  ])
2498
- }, y(c(Re)(l.time)), 3)
2505
+ }, y(d(Re)(l.time)), 3)
2499
2506
  ])
2500
2507
  ], 2)
2501
2508
  ], 2))), 128))
2502
2509
  ], 512),
2503
2510
  e("div", Pn, [
2504
2511
  O.value.length > 0 ? (a(), p("div", jn, [
2505
- (a(!0), p(me, null, fe(O.value, (l, $e) => (a(), p("div", {
2512
+ (a(!0), p(me, null, he(O.value, (l, $e) => (a(), p("div", {
2506
2513
  key: l.id,
2507
2514
  class: "pending-file"
2508
2515
  }, [
@@ -2519,7 +2526,7 @@ const gt = (x, t) => {
2519
2526
  ])) : (a(), p("div", Qn, [
2520
2527
  m(b, { class: "pending-file-icon" }, {
2521
2528
  default: k(() => [
2522
- m(c(Ze))
2529
+ m(d(Ze))
2523
2530
  ]),
2524
2531
  _: 1
2525
2532
  }),
@@ -2534,7 +2541,7 @@ const gt = (x, t) => {
2534
2541
  x.config.modules.fileUpload ? (a(), p("div", ti, [
2535
2542
  m(b, { class: "action-icon" }, {
2536
2543
  default: k(() => [
2537
- m(c(Ye))
2544
+ m(d(Ye))
2538
2545
  ]),
2539
2546
  _: 1
2540
2547
  }),
@@ -2543,33 +2550,33 @@ const gt = (x, t) => {
2543
2550
  onClick: it
2544
2551
  }, {
2545
2552
  default: k(() => [
2546
- m(c(Ze))
2553
+ m(d(Ze))
2547
2554
  ]),
2548
2555
  _: 1
2549
2556
  }),
2550
2557
  m(b, { class: "action-icon" }, {
2551
2558
  default: k(() => [
2552
- m(c(Ft))
2559
+ m(d(It))
2553
2560
  ]),
2554
2561
  _: 1
2555
2562
  })
2556
2563
  ])) : S("", !0),
2557
2564
  e("div", si, [
2558
- wt(e("textarea", {
2565
+ Ct(e("textarea", {
2559
2566
  "onUpdate:modelValue": s[4] || (s[4] = (l) => Ie(A) ? A.value = l : null),
2560
- onKeydown: Ct(Be(Pe, ["prevent"]), ["enter"]),
2567
+ onKeydown: xt(Be(Pe, ["prevent"]), ["enter"]),
2561
2568
  onPaste: ot,
2562
2569
  placeholder: "输入消息或粘贴文件...",
2563
2570
  class: "message-input",
2564
2571
  rows: "3"
2565
2572
  }, null, 40, ai), [
2566
- [xt, c(A)]
2573
+ [Ut, d(A)]
2567
2574
  ])
2568
2575
  ]),
2569
2576
  e("div", ni, [
2570
2577
  m(ke, {
2571
2578
  type: "primary",
2572
- disabled: !c(A).trim() && O.value.length === 0,
2579
+ disabled: !d(A).trim() && O.value.length === 0,
2573
2580
  onClick: Pe,
2574
2581
  class: "send-btn"
2575
2582
  }, {
@@ -2594,14 +2601,14 @@ const gt = (x, t) => {
2594
2601
  class: "empty-icon"
2595
2602
  }, {
2596
2603
  default: k(() => [
2597
- m(c(It))
2604
+ m(d(Rt))
2598
2605
  ]),
2599
2606
  _: 1
2600
2607
  }),
2601
2608
  e("div", li, y(ne.value === "apply" ? "在左侧选择好友申请" : "在左侧选择好友开始聊天"), 1)
2602
2609
  ]))
2603
2610
  ]),
2604
- oe.value ? (a(), p("div", oi, [
2611
+ le.value ? (a(), p("div", oi, [
2605
2612
  s[22] || (s[22] = e("div", { class: "detail-header" }, "聊天详情", -1)),
2606
2613
  e("div", ri, [
2607
2614
  e("div", ci, [
@@ -2610,7 +2617,7 @@ const gt = (x, t) => {
2610
2617
  alt: (o = W.value) == null ? void 0 : o.name,
2611
2618
  class: "detail-avatar"
2612
2619
  }, null, 8, di),
2613
- e("div", ui, y((ye = W.value) == null ? void 0 : ye.name), 1),
2620
+ e("div", ui, y((ge = W.value) == null ? void 0 : ge.name), 1),
2614
2621
  s[21] || (s[21] = e("div", { class: "detail-actions" }, [
2615
2622
  e("div", { class: "detail-action-item" }, "查找聊天记录"),
2616
2623
  e("div", { class: "detail-action-item" }, "清空聊天记录")
@@ -2620,8 +2627,8 @@ const gt = (x, t) => {
2620
2627
  ])) : S("", !0)
2621
2628
  ]),
2622
2629
  m(He, {
2623
- modelValue: c(ge),
2624
- "onUpdate:modelValue": s[6] || (s[6] = (l) => Ie(ge) ? ge.value = l : null),
2630
+ modelValue: d(fe),
2631
+ "onUpdate:modelValue": s[6] || (s[6] = (l) => Ie(fe) ? fe.value = l : null),
2625
2632
  title: "添加好友",
2626
2633
  width: "500px",
2627
2634
  "append-to-body": ""
@@ -2630,36 +2637,36 @@ const gt = (x, t) => {
2630
2637
  e("div", vi, [
2631
2638
  e("div", pi, [
2632
2639
  m(T, {
2633
- modelValue: c(Ce),
2640
+ modelValue: d(Ce),
2634
2641
  "onUpdate:modelValue": s[5] || (s[5] = (l) => Ie(Ce) ? Ce.value = l : null),
2635
2642
  placeholder: "搜索用户",
2636
- "prefix-icon": c(qe)
2643
+ "prefix-icon": d(qe)
2637
2644
  }, null, 8, ["modelValue", "prefix-icon"])
2638
2645
  ])
2639
2646
  ]),
2640
2647
  e("div", mi, [
2641
- c(xe) ? (a(), G(ce, {
2648
+ d(xe) ? (a(), G(re, {
2642
2649
  key: 0,
2643
2650
  description: "加载中..."
2644
- })) : c(Ae).length === 0 ? (a(), G(ce, {
2651
+ })) : d(Ae).length === 0 ? (a(), G(re, {
2645
2652
  key: 1,
2646
2653
  description: "暂无用户"
2647
- })) : (a(!0), p(me, { key: 2 }, fe(c(Ae), (l) => (a(), p("div", {
2654
+ })) : (a(!0), p(me, { key: 2 }, he(d(Ae), (l) => (a(), p("div", {
2648
2655
  key: l.username,
2649
2656
  class: "available-user-item"
2650
2657
  }, [
2651
- e("div", fi, [
2658
+ e("div", hi, [
2652
2659
  e("img", {
2653
2660
  src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${l.username}`,
2654
2661
  alt: l.username,
2655
2662
  class: "available-user-avatar"
2656
- }, null, 8, hi),
2663
+ }, null, 8, fi),
2657
2664
  e("div", gi, y(l.username), 1)
2658
2665
  ]),
2659
2666
  m(ke, {
2660
2667
  type: "primary",
2661
2668
  size: "small",
2662
- onClick: ($e) => c(q)(l)
2669
+ onClick: ($e) => d(q)(l)
2663
2670
  }, {
2664
2671
  default: k(() => [...s[23] || (s[23] = [
2665
2672
  ue("添加", -1)
@@ -2685,7 +2692,7 @@ const gt = (x, t) => {
2685
2692
  e("div", _i, [
2686
2693
  e("div", bi, [
2687
2694
  e("img", {
2688
- src: c(H),
2695
+ src: d(H),
2689
2696
  alt: "头像",
2690
2697
  class: "settings-avatar"
2691
2698
  }, null, 8, ki),
@@ -2699,7 +2706,7 @@ const gt = (x, t) => {
2699
2706
  class: "settings-avatar-icon"
2700
2707
  }, {
2701
2708
  default: k(() => [
2702
- m(c(Rt))
2709
+ m(d(Mt))
2703
2710
  ]),
2704
2711
  _: 1
2705
2712
  })
@@ -2714,8 +2721,8 @@ const gt = (x, t) => {
2714
2721
  }, null, 544)
2715
2722
  ]),
2716
2723
  e("div", wi, [
2717
- e("div", Ci, y(c(Z).nickname || c(ee)), 1),
2718
- e("div", xi, "@" + y(c(ee)), 1)
2724
+ e("div", Ci, y(d(Z).nickname || d(ee)), 1),
2725
+ e("div", xi, "@" + y(d(ee)), 1)
2719
2726
  ])
2720
2727
  ]),
2721
2728
  e("div", Ui, [
@@ -2723,7 +2730,7 @@ const gt = (x, t) => {
2723
2730
  e("div", Si, [
2724
2731
  m(b, null, {
2725
2732
  default: k(() => [
2726
- m(c(Qe))
2733
+ m(d(Qe))
2727
2734
  ]),
2728
2735
  _: 1
2729
2736
  }),
@@ -2747,43 +2754,43 @@ const gt = (x, t) => {
2747
2754
  s[26] || (s[26] = e("label", { class: "settings-form-label" }, "昵称", -1)),
2748
2755
  K.value ? (a(), G(T, {
2749
2756
  key: 0,
2750
- modelValue: re.value.nickname,
2751
- "onUpdate:modelValue": s[7] || (s[7] = (l) => re.value.nickname = l),
2757
+ modelValue: oe.value.nickname,
2758
+ "onUpdate:modelValue": s[7] || (s[7] = (l) => oe.value.nickname = l),
2752
2759
  placeholder: "请输入昵称",
2753
2760
  size: "large"
2754
- }, null, 8, ["modelValue"])) : (a(), p("div", Vi, y(c(Z).nickname || "未设置"), 1))
2761
+ }, null, 8, ["modelValue"])) : (a(), p("div", Vi, y(d(Z).nickname || "未设置"), 1))
2755
2762
  ]),
2756
2763
  e("div", Fi, [
2757
2764
  s[27] || (s[27] = e("label", { class: "settings-form-label" }, "邮箱", -1)),
2758
2765
  K.value ? (a(), G(T, {
2759
2766
  key: 0,
2760
- modelValue: re.value.email,
2761
- "onUpdate:modelValue": s[8] || (s[8] = (l) => re.value.email = l),
2767
+ modelValue: oe.value.email,
2768
+ "onUpdate:modelValue": s[8] || (s[8] = (l) => oe.value.email = l),
2762
2769
  placeholder: "请输入邮箱",
2763
2770
  size: "large"
2764
- }, null, 8, ["modelValue"])) : (a(), p("div", Ii, y(c(Z).email || "未设置"), 1))
2771
+ }, null, 8, ["modelValue"])) : (a(), p("div", Ii, y(d(Z).email || "未设置"), 1))
2765
2772
  ]),
2766
2773
  e("div", Ri, [
2767
2774
  s[28] || (s[28] = e("label", { class: "settings-form-label" }, "手机号", -1)),
2768
2775
  K.value ? (a(), G(T, {
2769
2776
  key: 0,
2770
- modelValue: re.value.phone,
2771
- "onUpdate:modelValue": s[9] || (s[9] = (l) => re.value.phone = l),
2777
+ modelValue: oe.value.phone,
2778
+ "onUpdate:modelValue": s[9] || (s[9] = (l) => oe.value.phone = l),
2772
2779
  placeholder: "请输入手机号",
2773
2780
  size: "large"
2774
- }, null, 8, ["modelValue"])) : (a(), p("div", Mi, y(c(Z).phone || "未设置"), 1))
2781
+ }, null, 8, ["modelValue"])) : (a(), p("div", Mi, y(d(Z).phone || "未设置"), 1))
2775
2782
  ]),
2776
2783
  e("div", Li, [
2777
2784
  s[29] || (s[29] = e("label", { class: "settings-form-label" }, "个人简介", -1)),
2778
2785
  K.value ? (a(), G(T, {
2779
2786
  key: 0,
2780
- modelValue: re.value.bio,
2781
- "onUpdate:modelValue": s[10] || (s[10] = (l) => re.value.bio = l),
2787
+ modelValue: oe.value.bio,
2788
+ "onUpdate:modelValue": s[10] || (s[10] = (l) => oe.value.bio = l),
2782
2789
  type: "textarea",
2783
2790
  rows: 4,
2784
2791
  placeholder: "介绍一下自己吧...",
2785
2792
  size: "large"
2786
- }, null, 8, ["modelValue"])) : (a(), p("div", Ti, y(c(Z).bio || "这个人很懒,什么都没写~"), 1))
2793
+ }, null, 8, ["modelValue"])) : (a(), p("div", Ti, y(d(Z).bio || "这个人很懒,什么都没写~"), 1))
2787
2794
  ]),
2788
2795
  K.value ? (a(), p("div", Ei, [
2789
2796
  m(ke, {
@@ -2814,8 +2821,8 @@ const gt = (x, t) => {
2814
2821
  _: 1
2815
2822
  }, 8, ["modelValue"]),
2816
2823
  m(yt, {
2817
- modelValue: d.value,
2818
- "onUpdate:modelValue": s[12] || (s[12] = (l) => d.value = l),
2824
+ modelValue: c.value,
2825
+ "onUpdate:modelValue": s[12] || (s[12] = (l) => c.value = l),
2819
2826
  src: _e.value,
2820
2827
  onConfirm: dt
2821
2828
  }, null, 8, ["modelValue", "src"]),
@@ -2850,6 +2857,7 @@ const gt = (x, t) => {
2850
2857
  agreeFriend: "/chart/friend/agree",
2851
2858
  setChatStatus: "/chart/friend/chat/status",
2852
2859
  getAvailableUsers: "/chart/user/canAddFriend",
2860
+ searchUser: "/chart/user/search",
2853
2861
  getUserInfo: "/user/info",
2854
2862
  updateUserInfo: "/user/info",
2855
2863
  getUserAvatar: "/user/getAvatar",
@@ -2899,13 +2907,13 @@ const gt = (x, t) => {
2899
2907
  }
2900
2908
  };
2901
2909
  function Ki(x = {}) {
2902
- const t = Tt(Hi, x);
2910
+ const t = Et(Hi, x);
2903
2911
  return t.api.baseUrl || console.warn("[VueChatKit] 请配置 api.baseUrl"), t.api.websocketUrl || console.warn("[VueChatKit] 请配置 api.websocketUrl"), t.user.username || console.warn("[VueChatKit] 请配置 user.username"), t;
2904
2912
  }
2905
- function Tt(x, t) {
2913
+ function Et(x, t) {
2906
2914
  const n = { ...x };
2907
2915
  for (const v in t)
2908
- t[v] && typeof t[v] == "object" && !Array.isArray(t[v]) ? n[v] = Tt(x[v] || {}, t[v]) : n[v] = t[v];
2916
+ t[v] && typeof t[v] == "object" && !Array.isArray(t[v]) ? n[v] = Et(x[v] || {}, t[v]) : n[v] = t[v];
2909
2917
  return n;
2910
2918
  }
2911
2919
  const Ni = {
@@ -2915,7 +2923,7 @@ const Ni = {
2915
2923
  };
2916
2924
  export {
2917
2925
  yt as AvatarCrop,
2918
- ht as ChatApi,
2926
+ ft as ChatApi,
2919
2927
  Ya as ChatPanel,
2920
2928
  Dt as ChatWebSocket,
2921
2929
  Wi as ChatWindow,
@@ -2923,5 +2931,5 @@ export {
2923
2931
  Ni as VueChatKit,
2924
2932
  Ki as createChatConfig,
2925
2933
  Ni as default,
2926
- Lt as useChat
2934
+ Tt as useChat
2927
2935
  };