@huyooo/ui 3.0.2 → 4.0.2

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 (64) hide show
  1. package/dist/{AuthkitAppSetting-DNUAV5I8.js → AuthkitAppSetting-Cg8j3nES.js} +41 -42
  2. package/dist/{Contact-CNLjyOCR.js → Contact-D9NRguTE.js} +4 -4
  3. package/dist/{CustomTable-B1KjkixL.js → CustomTable-C15Dgbks.js} +4 -4
  4. package/dist/{FeedbackItem-BP-SiJ2u.js → FeedbackItem-hnJ7YXdE.js} +1 -1
  5. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-Ddy1jcdL.js +1526 -0
  6. package/dist/{LandingPageSectionTabs-BEAnU8B0.js → LandingPageSectionTabs-BJQeq3V5.js} +515 -402
  7. package/dist/{LegalDocViewer-B8nGoL2n.js → LegalDocViewer-BuzKCAfO.js} +44 -45
  8. package/dist/{Menu-uCexrsKP.js → Menu-C6NA8hCs.js} +1 -1
  9. package/dist/{MessageHandle-BKMBtqZM.js → MessageHandle-Cu23QspL.js} +13 -14
  10. package/dist/{MessageList-BK4u5DCH.js → MessageList-DdDKl9wk.js} +6 -7
  11. package/dist/{PaySubscriptions-tJSQUmhE.js → PaySubscriptions-ZSvRTG2i.js} +14 -15
  12. package/dist/{PricingPlans-B3HVDVac.js → PricingPlans-DTGJ-_us.js} +13 -14
  13. package/dist/{ReferrerReferees-DEdEjkFH.js → ReferrerReferees-gkKtDau-.js} +25 -26
  14. package/dist/{Upload.vue_vue_type_script_setup_true_lang-CZjNlns_.js → Upload.vue_vue_type_script_setup_true_lang-C6B5_Hjo.js} +2 -2
  15. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-Bal7vFj8.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BH6l-SKs.js} +34 -35
  16. package/dist/{WidthContainer-Ck7Cr5Wc.js → WidthContainer-DXwIiG2x.js} +32 -32
  17. package/dist/{apiClients-8_c5cDW5.js → apiClients-5u4_uxFE.js} +47 -48
  18. package/dist/authkit.js +10 -10
  19. package/dist/common/globalConfig.d.ts +4 -4
  20. package/dist/common.js +3 -3
  21. package/dist/components/LandingPage/LandingPageHero.vue.d.ts +22 -0
  22. package/dist/components/Pay/PricingPlans.vue.d.ts +1 -1
  23. package/dist/composables/Authkit/useAuthkitAppsAuthPageInfo.d.ts +21 -0
  24. package/dist/composables/useAccessPosture.d.ts +31 -0
  25. package/dist/composables.d.ts +1 -0
  26. package/dist/composables.js +53 -49
  27. package/dist/feedback.js +3 -3
  28. package/dist/{fetchAuthPageAboutUs--dArFYk6.js → fetchAuthPageAboutUs-C-jQ44QK.js} +2 -2
  29. package/dist/{index-D9YtlhTa.js → index-5OR_BVTz.js} +4 -5
  30. package/dist/{index-D56hUMeD.js → index-BIxwv9Xs.js} +1 -1
  31. package/dist/landingPage.js +1 -1
  32. package/dist/legalDocs/constants.d.ts +1 -0
  33. package/dist/main.js +266 -262
  34. package/dist/message.js +36 -37
  35. package/dist/pay.js +5 -5
  36. package/dist/privateCom.js +1 -1
  37. package/dist/referrer.js +1 -1
  38. package/dist/{runtime-CDEl4QQl.js → runtime-B-tHI8-q.js} +191 -186
  39. package/dist/style.css +1 -1
  40. package/dist/types/api/auth.generated.d.ts +188 -37
  41. package/dist/types/api/ones.generated.d.ts +1512 -364
  42. package/dist/types/app.d.ts +9 -0
  43. package/dist/types/auth.d.ts +2 -1
  44. package/dist/upload.js +2 -2
  45. package/dist/useAccessPosture-DBNTLWQn.js +219 -0
  46. package/dist/{useAuthkitAppsAuthPageInfo-mv7hOnhi.js → useAuthkitAppsAuthPageInfo-CsivtUQH.js} +40 -33
  47. package/dist/{useAuthkitAuth-DSC6QSKm.js → useAuthkitAuth-CV60Hc3o.js} +2 -2
  48. package/dist/useAuthkitCreateAndUpdate-DJIn96EE.js +24 -0
  49. package/dist/{useAuthkitUsersProfile-DSd5VA3_.js → useAuthkitUsersProfile-CQOLEAxC.js} +3 -3
  50. package/dist/{useBillingStatusOptions-C8fwW-AI.js → useBillingStatusOptions-BHVLZhEB.js} +1 -1
  51. package/dist/{useBillingSubscriptionSummary-C2E3p68U.js → useBillingSubscriptionSummary-DakAVL-3.js} +1 -1
  52. package/dist/{useEnsureAuthenticated-COQKiCLk.js → useEnsureAuthenticated-BYGI2uYZ.js} +2 -2
  53. package/dist/{useLegalDocs-DUbab5R9.js → useLegalDocs-BrYWCDh3.js} +6 -5
  54. package/dist/{useMessageNotifications-BXimltcx.js → useMessageNotifications-Dcl8TXr-.js} +1 -1
  55. package/dist/{usePageSEO-D8CocvOJ.js → usePageSEO-BHYaXnDU.js} +12 -13
  56. package/dist/useRoutePermission-BkWHsFxN.js +212 -0
  57. package/dist/{useSubscriptionCheckout-LrwlCr84.js → useSubscriptionCheckout-QSNro05_.js} +17 -18
  58. package/dist/user.js +1 -1
  59. package/dist/{userMenuModal-D-nDaYqM.js → userMenuModal-B4m4CHlW.js} +1 -1
  60. package/package.json +1 -1
  61. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-DEuryJ4s.js +0 -1516
  62. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
  63. package/dist/useAuthkitCreateAndUpdate-CYIcEuub.js +0 -25
  64. package/dist/useRoutePermission-DgQlbUBI.js +0 -249
@@ -0,0 +1,1526 @@
1
+ import { g as ce } from "./apiClients-5u4_uxFE.js";
2
+ /* empty css */
3
+ import { U as st } from "./userMenuModal-B4m4CHlW.js";
4
+ import { defineComponent as N, useModel as nt, openBlock as s, createBlock as P, Teleport as lt, createElementBlock as u, withKeys as rt, createElementVNode as h, toDisplayString as I, withModifiers as Z, createCommentVNode as R, mergeModels as it, ref as b, computed as F, Fragment as L, renderList as j, createVNode as m, unref as a, normalizeStyle as ne, withCtx as v, createTextVNode as V, normalizeClass as de, onBeforeUnmount as ot, onUnmounted as ut, watch as ye, readonly as ct, nextTick as le } from "vue";
5
+ import { ImagePreviewGroup as Ce, Avatar as fe, Space as ve, Descriptions as dt, DescriptionsItem as re, Tag as te, Spin as ft, Empty as vt, Button as he, Message as ae, Form as pt, FormItem as Q, Input as mt, Select as Re, Option as Pe, Alert as gt, Textarea as bt, Breadcrumb as kt, BreadcrumbItem as Be, Modal as yt } from "@arco-design/web-vue";
6
+ import { M as _t } from "./Menu-C6NA8hCs.js";
7
+ /* empty css */
8
+ import { C as pe } from "./index-5OR_BVTz.js";
9
+ /* empty css */
10
+ /* empty css */
11
+ /* empty css */
12
+ import { h as ht, u as Le } from "./runtime-B-tHI8-q.js";
13
+ import { _ as X } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
+ import { r as wt, m as Te, a as Ct, M as St } from "./MessageList-DdDKl9wk.js";
15
+ import { f as se } from "./index-BIxwv9Xs.js";
16
+ import { Bubble as Ve, Sender as Ut } from "ant-design-x-vue";
17
+ import { u as xt } from "./useAuthkitUsersProfile-CQOLEAxC.js";
18
+ import { u as $t } from "./useUserMenu-ClPBlvaM.js";
19
+ /* empty css */
20
+ import { Icon as It } from "@iconify/vue";
21
+ import { _ as Ft, g as At, i as Rt } from "./plugin-vue_export-helper-LjDO2Zua.js";
22
+ const Pt = {
23
+ class: "video-preview__header"
24
+ }, Bt = {
25
+ class: "video-preview__title"
26
+ }, Tt = {
27
+ class: "video-preview__stage"
28
+ }, Mt = ["src"], Lt = /* @__PURE__ */ N({
29
+ __name: "VideoPreview",
30
+ props: /* @__PURE__ */ it({
31
+ src: {
32
+ type: String,
33
+ default: ""
34
+ },
35
+ title: {
36
+ type: String,
37
+ default: ""
38
+ }
39
+ }, {
40
+ visible: {
41
+ type: Boolean,
42
+ default: !1
43
+ },
44
+ visibleModifiers: {}
45
+ }),
46
+ emits: ["update:visible"],
47
+ setup(t) {
48
+ const e = nt(t, "visible"), l = t;
49
+ function i() {
50
+ e.value = !1;
51
+ }
52
+ return (d, f) => (s(), P(lt, {
53
+ to: "body"
54
+ }, [e.value ? (s(), u("div", {
55
+ key: 0,
56
+ class: "video-preview",
57
+ tabindex: "0",
58
+ onClick: i,
59
+ onKeydown: rt(i, ["esc"])
60
+ }, [h("div", Pt, [h("div", Bt, I(l.title), 1), h("button", {
61
+ type: "button",
62
+ class: "video-preview__close",
63
+ onClick: Z(i, ["stop"])
64
+ }, " × ")]), h("div", Tt, [l.src ? (s(), u("video", {
65
+ key: 0,
66
+ class: "video-preview__video",
67
+ src: l.src,
68
+ controls: "",
69
+ autoplay: "",
70
+ onClick: f[0] || (f[0] = Z(() => {
71
+ }, ["stop"]))
72
+ }, null, 8, Mt)) : R("", !0)])], 32)) : R("", !0)]));
73
+ }
74
+ }), Se = /* @__PURE__ */ X(Lt, [["__scopeId", "data-v-3f517bc8"]]), Vt = {
75
+ key: 0,
76
+ class: "message-attachments"
77
+ }, Et = ["title", "onClick"], Dt = ["src", "alt"], qt = ["title", "onClick"], Ot = ["src"], zt = ["href", "title"], Nt = {
78
+ class: "message-attachment-main"
79
+ }, jt = {
80
+ class: "message-attachment-name"
81
+ }, Wt = {
82
+ class: "message-attachment-meta"
83
+ }, Kt = /* @__PURE__ */ N({
84
+ __name: "FeedbackMessageAttachments",
85
+ props: {
86
+ attachments: {
87
+ type: Array,
88
+ default: () => []
89
+ }
90
+ },
91
+ setup(t) {
92
+ const e = t, l = b(!1), i = b(0), d = b(!1), f = b(""), _ = b(""), k = F(() => e.attachments.filter((g) => g.kind === "image")), S = F(() => e.attachments.filter((g) => g.kind === "video")), x = F(() => e.attachments.filter((g) => g.kind === "file")), T = F(() => k.value.map((g) => g.url || ""));
93
+ function w(g) {
94
+ i.value = g, l.value = !0;
95
+ }
96
+ function B(g) {
97
+ f.value = g.url || "", _.value = g.name, d.value = !0;
98
+ }
99
+ function O(g) {
100
+ return g < 1024 ? `${g} B` : g < 1024 * 1024 ? `${(g / 1024).toFixed(1)} KB` : g < 1024 * 1024 * 1024 ? `${(g / 1024 / 1024).toFixed(1)} MB` : `${(g / 1024 / 1024 / 1024).toFixed(1)} GB`;
101
+ }
102
+ return (g, C) => (s(), u(L, null, [e.attachments.length > 0 ? (s(), u("div", Vt, [(s(!0), u(L, null, j(k.value, (o, A) => (s(), u("button", {
103
+ key: o.key,
104
+ type: "button",
105
+ class: "message-media message-media--image",
106
+ title: o.name,
107
+ onClick: (M) => w(A)
108
+ }, [h("img", {
109
+ src: o.url,
110
+ alt: o.name,
111
+ class: "message-media__content"
112
+ }, null, 8, Dt)], 8, Et))), 128)), (s(!0), u(L, null, j(S.value, (o) => (s(), u("button", {
113
+ key: o.key,
114
+ type: "button",
115
+ class: "message-media message-media--video",
116
+ title: o.name,
117
+ onClick: (A) => B(o)
118
+ }, [h("video", {
119
+ class: "message-media__content",
120
+ src: o.url,
121
+ muted: "",
122
+ preload: "metadata"
123
+ }, null, 8, Ot), C[3] || (C[3] = h("span", {
124
+ class: "message-video-play"
125
+ }, "播放", -1))], 8, qt))), 128)), (s(!0), u(L, null, j(x.value, (o) => (s(), u("a", {
126
+ key: o.key,
127
+ class: "message-file",
128
+ href: o.url,
129
+ target: "_blank",
130
+ rel: "noopener noreferrer",
131
+ title: o.name
132
+ }, [C[4] || (C[4] = h("span", {
133
+ class: "message-file-icon"
134
+ }, "FILE", -1)), h("span", Nt, [h("span", jt, I(o.name), 1), h("span", Wt, I(O(o.size)), 1)])], 8, zt))), 128))])) : R("", !0), m(a(Ce), {
135
+ "src-list": T.value,
136
+ visible: l.value,
137
+ "onUpdate:visible": C[0] || (C[0] = (o) => l.value = o),
138
+ current: i.value,
139
+ "onUpdate:current": C[1] || (C[1] = (o) => i.value = o)
140
+ }, null, 8, ["src-list", "visible", "current"]), m(Se, {
141
+ visible: d.value,
142
+ "onUpdate:visible": C[2] || (C[2] = (o) => d.value = o),
143
+ title: _.value,
144
+ src: f.value
145
+ }, null, 8, ["visible", "title", "src"])], 64));
146
+ }
147
+ }), Ee = /* @__PURE__ */ X(Kt, [["__scopeId", "data-v-49a094a3"]]), Ht = /* @__PURE__ */ N({
148
+ __name: "FeedbackRefresh",
149
+ setup(t) {
150
+ return (e, l) => (s(), P(a(It), {
151
+ class: "icon",
152
+ icon: "mingcute:refresh-2-line"
153
+ }));
154
+ }
155
+ }), Me = /* @__PURE__ */ X(Ht, [["__scopeId", "data-v-64bb6fc2"]]), Gt = ["src"], Xt = {
156
+ key: 1
157
+ }, Yt = {
158
+ class: "feedback-message-body"
159
+ }, Jt = {
160
+ key: 0,
161
+ class: "feedback-text-bubble"
162
+ }, Zt = {
163
+ key: 1,
164
+ class: "feedback-bubble-stack feedback-bubble-stack--end"
165
+ }, Qt = ["src"], ea = {
166
+ key: 1
167
+ }, ta = /* @__PURE__ */ N({
168
+ __name: "FeedbackBubbleEnd",
169
+ props: {
170
+ text: {
171
+ type: String,
172
+ default: ""
173
+ },
174
+ attachments: {
175
+ type: Array,
176
+ default: () => []
177
+ },
178
+ avatarUrl: {
179
+ type: String,
180
+ default: ""
181
+ },
182
+ avatarText: {
183
+ type: String,
184
+ default: "U"
185
+ },
186
+ bubbleStyle: {
187
+ type: Object,
188
+ default: () => ({
189
+ paddingLeft: "52px"
190
+ })
191
+ },
192
+ showRefresh: {
193
+ type: Boolean,
194
+ default: !1
195
+ },
196
+ showClipboard: {
197
+ type: Boolean,
198
+ default: !1
199
+ }
200
+ },
201
+ emits: ["refresh"],
202
+ setup(t, {
203
+ emit: e
204
+ }) {
205
+ const l = t, i = e;
206
+ function d(S) {
207
+ return S.startsWith("http://") || S.startsWith("https://") || S.startsWith("data:");
208
+ }
209
+ const f = F(() => {
210
+ const S = l.avatarUrl.trim();
211
+ return d(S) ? S : "";
212
+ }), _ = F(() => l.attachments.length > 0);
213
+ function k() {
214
+ i("refresh");
215
+ }
216
+ return (S, x) => _.value ? (s(), u("div", {
217
+ key: 0,
218
+ class: "feedback-message-group feedback-message-group--end",
219
+ style: ne(l.bubbleStyle)
220
+ }, [m(a(fe), {
221
+ class: "feedback-message-avatar"
222
+ }, {
223
+ default: v(() => [f.value ? (s(), u("img", {
224
+ key: 0,
225
+ alt: "avatar",
226
+ src: f.value
227
+ }, null, 8, Gt)) : (s(), u("span", Xt, I(l.avatarText), 1))]),
228
+ _: 1
229
+ }), h("div", Yt, [l.text ? (s(), u("div", Jt, I(l.text), 1)) : R("", !0), l.showClipboard || l.showRefresh ? (s(), P(a(ve), {
230
+ key: 1,
231
+ class: "feedback-message-footer"
232
+ }, {
233
+ default: v(() => [l.showClipboard ? (s(), P(pe, {
234
+ key: 0,
235
+ value: l.text
236
+ }, null, 8, ["value"])) : R("", !0), l.showRefresh ? (s(), P(Me, {
237
+ key: 1,
238
+ onClick: k
239
+ })) : R("", !0)]),
240
+ _: 1
241
+ })) : R("", !0), m(Ee, {
242
+ attachments: l.attachments
243
+ }, null, 8, ["attachments"])])], 4)) : (s(), u("div", Zt, [m(a(Ve), {
244
+ placement: "end",
245
+ style: ne(l.bubbleStyle)
246
+ }, {
247
+ avatar: v(() => [m(a(fe), null, {
248
+ default: v(() => [f.value ? (s(), u("img", {
249
+ key: 0,
250
+ alt: "avatar",
251
+ src: f.value
252
+ }, null, 8, Qt)) : (s(), u("span", ea, I(l.avatarText), 1))]),
253
+ _: 1
254
+ })]),
255
+ message: v(() => [l.text ? (s(), u(L, {
256
+ key: 0
257
+ }, [V(I(l.text), 1)], 64)) : R("", !0)]),
258
+ footer: v(() => [m(a(ve), null, {
259
+ default: v(() => [l.showClipboard && l.text ? (s(), P(pe, {
260
+ key: 0,
261
+ value: l.text
262
+ }, null, 8, ["value"])) : R("", !0), l.showRefresh ? (s(), P(Me, {
263
+ key: 1,
264
+ onClick: k
265
+ })) : R("", !0)]),
266
+ _: 1
267
+ })]),
268
+ _: 1
269
+ }, 8, ["style"])]));
270
+ }
271
+ }), aa = /* @__PURE__ */ X(ta, [["__scopeId", "data-v-ed8f32cc"]]), sa = ["src"], na = {
272
+ key: 1
273
+ }, la = {
274
+ class: "feedback-message-body"
275
+ }, ra = {
276
+ key: 0,
277
+ class: "feedback-text-bubble"
278
+ }, ia = {
279
+ key: 1,
280
+ class: "feedback-bubble-stack feedback-bubble-stack--start"
281
+ }, oa = ["src"], ua = {
282
+ key: 1
283
+ }, ca = /* @__PURE__ */ N({
284
+ __name: "FeedbackBubbleStart",
285
+ props: {
286
+ text: {
287
+ type: String,
288
+ default: ""
289
+ },
290
+ attachments: {
291
+ type: Array,
292
+ default: () => []
293
+ },
294
+ avatarUrl: {
295
+ type: String,
296
+ default: ""
297
+ },
298
+ avatarText: {
299
+ type: String,
300
+ default: "U"
301
+ },
302
+ bubbleStyle: {
303
+ type: Object,
304
+ default: () => ({
305
+ paddingRight: "52px"
306
+ })
307
+ },
308
+ showClipboard: {
309
+ type: Boolean,
310
+ default: !1
311
+ }
312
+ },
313
+ setup(t) {
314
+ const e = t;
315
+ function l(f) {
316
+ return f.startsWith("http://") || f.startsWith("https://") || f.startsWith("data:");
317
+ }
318
+ const i = F(() => {
319
+ const f = e.avatarUrl.trim();
320
+ return l(f) ? f : "";
321
+ }), d = F(() => e.attachments.length > 0);
322
+ return (f, _) => d.value ? (s(), u("div", {
323
+ key: 0,
324
+ class: "feedback-message-group feedback-message-group--start",
325
+ style: ne(e.bubbleStyle)
326
+ }, [m(a(fe), {
327
+ class: "feedback-message-avatar"
328
+ }, {
329
+ default: v(() => [i.value ? (s(), u("img", {
330
+ key: 0,
331
+ alt: "avatar",
332
+ src: i.value
333
+ }, null, 8, sa)) : (s(), u("span", na, I(e.avatarText), 1))]),
334
+ _: 1
335
+ }), h("div", la, [e.text ? (s(), u("div", ra, I(e.text), 1)) : R("", !0), e.showClipboard ? (s(), P(a(ve), {
336
+ key: 1,
337
+ class: "feedback-message-footer"
338
+ }, {
339
+ default: v(() => [m(pe, {
340
+ value: e.text
341
+ }, null, 8, ["value"])]),
342
+ _: 1
343
+ })) : R("", !0), m(Ee, {
344
+ attachments: e.attachments
345
+ }, null, 8, ["attachments"])])], 4)) : (s(), u("div", ia, [m(a(Ve), {
346
+ placement: "start",
347
+ style: ne(e.bubbleStyle)
348
+ }, {
349
+ avatar: v(() => [m(a(fe), null, {
350
+ default: v(() => [i.value ? (s(), u("img", {
351
+ key: 0,
352
+ alt: "avatar",
353
+ src: i.value
354
+ }, null, 8, oa)) : (s(), u("span", ua, I(e.avatarText), 1))]),
355
+ _: 1
356
+ })]),
357
+ message: v(() => [e.text ? (s(), u(L, {
358
+ key: 0
359
+ }, [V(I(e.text), 1)], 64)) : R("", !0)]),
360
+ footer: v(() => [m(a(ve), null, {
361
+ default: v(() => [e.showClipboard && e.text ? (s(), P(pe, {
362
+ key: 0,
363
+ value: e.text
364
+ }, null, 8, ["value"])) : R("", !0)]),
365
+ _: 1
366
+ })]),
367
+ _: 1
368
+ }, 8, ["style"])]));
369
+ }
370
+ }), da = /* @__PURE__ */ X(ca, [["__scopeId", "data-v-a88b5650"]]), fa = N({
371
+ name: "IconLink",
372
+ props: {
373
+ size: {
374
+ type: [Number, String]
375
+ },
376
+ strokeWidth: {
377
+ type: Number,
378
+ default: 4
379
+ },
380
+ strokeLinecap: {
381
+ type: String,
382
+ default: "butt",
383
+ validator: (t) => ["butt", "round", "square"].includes(t)
384
+ },
385
+ strokeLinejoin: {
386
+ type: String,
387
+ default: "miter",
388
+ validator: (t) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(t)
389
+ },
390
+ rotate: Number,
391
+ spin: Boolean
392
+ },
393
+ emits: {
394
+ click: (t) => !0
395
+ },
396
+ setup(t, {
397
+ emit: e
398
+ }) {
399
+ const l = At("icon"), i = F(() => [l, `${l}-link`, {
400
+ [`${l}-spin`]: t.spin
401
+ }]), d = F(() => {
402
+ const _ = {};
403
+ return t.size && (_.fontSize = Rt(t.size) ? `${t.size}px` : t.size), t.rotate && (_.transform = `rotate(${t.rotate}deg)`), _;
404
+ });
405
+ return {
406
+ cls: i,
407
+ innerStyle: d,
408
+ onClick: (_) => {
409
+ e("click", _);
410
+ }
411
+ };
412
+ }
413
+ }), va = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
414
+ function pa(t, e, l, i, d, f) {
415
+ return s(), u("svg", {
416
+ viewBox: "0 0 48 48",
417
+ fill: "none",
418
+ xmlns: "http://www.w3.org/2000/svg",
419
+ stroke: "currentColor",
420
+ class: de(t.cls),
421
+ style: ne(t.innerStyle),
422
+ "stroke-width": t.strokeWidth,
423
+ "stroke-linecap": t.strokeLinecap,
424
+ "stroke-linejoin": t.strokeLinejoin,
425
+ onClick: e[0] || (e[0] = (..._) => t.onClick && t.onClick(..._))
426
+ }, e[1] || (e[1] = [h("path", {
427
+ d: "m14.1 25.414-4.95 4.95a6 6 0 0 0 8.486 8.485l8.485-8.485a6 6 0 0 0 0-8.485m7.779.707 4.95-4.95a6 6 0 1 0-8.486-8.485l-8.485 8.485a6 6 0 0 0 0 8.485"
428
+ }, null, -1)]), 14, va);
429
+ }
430
+ var _e = /* @__PURE__ */ Ft(fa, [["render", pa]]);
431
+ const ma = Object.assign(_e, {
432
+ install: (t, e) => {
433
+ var l;
434
+ const i = (l = e == null ? void 0 : e.iconPrefix) != null ? l : "";
435
+ t.component(i + _e.name, _e);
436
+ }
437
+ }), De = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".mp4", ".webm", ".mov", ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".txt", ".md", ".csv", ".json", ".zip"], qe = De.join(","), ga = /* @__PURE__ */ new Set(["image/jpeg", "image/png", "image/gif", "image/webp"]), ba = /* @__PURE__ */ new Set(["video/mp4", "video/webm", "video/quicktime"]);
438
+ function ka(t) {
439
+ const e = t.lastIndexOf(".");
440
+ return e < 0 ? "" : t.slice(e).toLowerCase();
441
+ }
442
+ function ya(t) {
443
+ return De.includes(ka(t.name));
444
+ }
445
+ function Oe(t, e = t.type) {
446
+ return ga.has(e) ? "image" : ba.has(e) ? "video" : "file";
447
+ }
448
+ const ie = 9;
449
+ function _a(t) {
450
+ const e = Oe(t);
451
+ return {
452
+ id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
453
+ file: t,
454
+ kind: e,
455
+ previewUrl: e === "image" || e === "video" ? URL.createObjectURL(t) : void 0
456
+ };
457
+ }
458
+ function ze(t) {
459
+ const e = b([]), l = F(() => e.value.length > 0), i = F(() => e.value.filter((w) => w.kind === "image" && !!w.previewUrl)), d = F(() => e.value.filter((w) => w.kind === "video" && !!w.previewUrl)), f = F(() => e.value.filter((w) => w.kind === "file"));
460
+ function _(w) {
461
+ t == null || t(w);
462
+ }
463
+ function k(w) {
464
+ w.previewUrl && URL.revokeObjectURL(w.previewUrl);
465
+ }
466
+ function S(w) {
467
+ if (w.length === 0) return;
468
+ const B = w.filter(ya);
469
+ if (w.length - B.length > 0 && _("仅支持常见图片、浏览器可预览视频、文档、文本、CSV、JSON 和 ZIP 文件"), B.length === 0) return;
470
+ const g = ie - e.value.length;
471
+ if (g <= 0) {
472
+ _(`最多只能添加 ${ie} 个附件`);
473
+ return;
474
+ }
475
+ const C = B.slice(0, g);
476
+ B.length > g && _(`最多只能添加 ${ie} 个附件,已跳过多余文件`), e.value.push(...C.map(_a));
477
+ }
478
+ function x(w) {
479
+ const B = e.value[w];
480
+ B && (k(B), e.value.splice(w, 1));
481
+ }
482
+ function T() {
483
+ e.value.forEach(k), e.value = [];
484
+ }
485
+ return ot(() => {
486
+ T();
487
+ }), {
488
+ items: e,
489
+ imageItems: i,
490
+ videoItems: d,
491
+ fileItems: f,
492
+ hasAttachments: l,
493
+ addFiles: S,
494
+ removeAt: x,
495
+ clear: T,
496
+ maxAttachments: ie
497
+ };
498
+ }
499
+ async function ha(t, e, l) {
500
+ const {
501
+ data: i,
502
+ error: d
503
+ } = await t.upload({
504
+ file: e,
505
+ bucketId: l
506
+ });
507
+ return {
508
+ data: (i == null ? void 0 : i.key) ?? null,
509
+ error: d
510
+ };
511
+ }
512
+ async function Ne(t, e, l) {
513
+ const i = [];
514
+ for (const d of e) {
515
+ const f = await ha(t, d, l);
516
+ if (f.error || !f.data)
517
+ return {
518
+ data: null,
519
+ error: f.error ?? new Error("上传反馈附件失败")
520
+ };
521
+ const _ = ht(d);
522
+ i.push({
523
+ key: f.data,
524
+ name: d.name,
525
+ size: d.size,
526
+ mimeType: _,
527
+ kind: Oe(d, _)
528
+ });
529
+ }
530
+ return {
531
+ data: i,
532
+ error: null
533
+ };
534
+ }
535
+ function wa(t, e = {}) {
536
+ const {
537
+ interval: l = 2e3,
538
+ immediate: i = !1,
539
+ autoStart: d = !1
540
+ } = e, f = b(!1);
541
+ let _ = null;
542
+ async function k() {
543
+ try {
544
+ await t();
545
+ } catch (w) {
546
+ console.error("轮询回调执行失败:", w);
547
+ }
548
+ }
549
+ function S() {
550
+ if (f.value) {
551
+ console.warn("轮询已在运行中");
552
+ return;
553
+ }
554
+ f.value = !0, i && k(), _ = setInterval(k, l);
555
+ }
556
+ function x() {
557
+ _ && (clearInterval(_), _ = null), f.value = !1;
558
+ }
559
+ function T() {
560
+ x(), S();
561
+ }
562
+ return d && S(), ut(() => {
563
+ x();
564
+ }), {
565
+ isPolling: f,
566
+ start: S,
567
+ stop: x,
568
+ restart: T
569
+ };
570
+ }
571
+ const me = b(0);
572
+ let ee = null, ue = null, we = !1;
573
+ function Ca() {
574
+ me.value = 0;
575
+ }
576
+ async function Sa() {
577
+ const {
578
+ data: t,
579
+ error: e
580
+ } = await ce().ones.feedbackCenter.unreadReplyCount.post({});
581
+ return e ? null : typeof (t == null ? void 0 : t.count) == "number" ? t.count : 0;
582
+ }
583
+ async function J() {
584
+ return ee || (ee = (async () => {
585
+ await Ct();
586
+ const t = await Sa();
587
+ t !== null && (me.value = t);
588
+ })().finally(() => {
589
+ ee = null;
590
+ }), ee);
591
+ }
592
+ function Ua() {
593
+ we || (we = !0, ue = setInterval(() => {
594
+ J();
595
+ }, 6e4));
596
+ }
597
+ function xa() {
598
+ ue && (clearInterval(ue), ue = null), we = !1;
599
+ }
600
+ function Is() {
601
+ const {
602
+ isLoggedIn: t
603
+ } = xt(), {
604
+ isOpen: e,
605
+ messagesTrigger: l,
606
+ feedbackTrigger: i
607
+ } = $t();
608
+ return ye(t, (d) => {
609
+ if (d) {
610
+ J(), Ua();
611
+ return;
612
+ }
613
+ wt(), Ca(), xa();
614
+ }, {
615
+ immediate: !0
616
+ }), ye(e, (d) => {
617
+ d && t.value && J();
618
+ }), ye([l, i], () => {
619
+ t.value && window.setTimeout(() => {
620
+ J();
621
+ }, 1500);
622
+ }), {
623
+ messageUnreadCount: Te,
624
+ feedbackUnreadCount: ct(me),
625
+ hasMessageBadge: F(() => Te.value > 0),
626
+ hasFeedbackBadge: F(() => me.value > 0),
627
+ refreshUserMenuBadgeCounts: J
628
+ };
629
+ }
630
+ const Ue = [{
631
+ key: "bugReports",
632
+ label: "问题报告"
633
+ }, {
634
+ key: "featureSuggestions",
635
+ label: "功能建议"
636
+ }, {
637
+ key: "technicalSupportRequests",
638
+ label: "技术支持请求"
639
+ }, {
640
+ key: "generalOpinions",
641
+ label: "一般意见"
642
+ }, {
643
+ key: "illegalContentReports",
644
+ label: "违法不良信息举报"
645
+ }], je = [{
646
+ key: "urgent",
647
+ label: "紧急"
648
+ }, {
649
+ key: "high",
650
+ label: "高"
651
+ }, {
652
+ key: "normal",
653
+ label: "普通"
654
+ }, {
655
+ key: "low",
656
+ label: "低"
657
+ }], We = [{
658
+ key: "newFeedback",
659
+ label: "新反馈"
660
+ }, {
661
+ key: "inProgress",
662
+ label: "处理中"
663
+ }, {
664
+ key: "pending",
665
+ label: "待处理"
666
+ }, {
667
+ key: "resolved",
668
+ label: "已解决"
669
+ }, {
670
+ key: "closed",
671
+ label: "已关闭"
672
+ }];
673
+ function $a(t) {
674
+ return t ? t.startsWith("http://") || t.startsWith("https://") || t.startsWith("data:") : !1;
675
+ }
676
+ function oe(t) {
677
+ const e = (t.attachments ?? []).filter((l) => $a(l.url));
678
+ return {
679
+ text: t.content ?? "",
680
+ attachments: e
681
+ };
682
+ }
683
+ const Ia = {
684
+ class: "FeedBackDetails"
685
+ }, Fa = {
686
+ class: "scrollable-content__inner"
687
+ }, Aa = {
688
+ class: "content"
689
+ }, Ra = {
690
+ class: "empty-title"
691
+ }, Pa = {
692
+ class: "empty-tips"
693
+ }, Ba = {
694
+ key: 1,
695
+ class: "Bubbles"
696
+ }, Ta = {
697
+ class: "sender-container"
698
+ }, Ma = {
699
+ key: 0,
700
+ class: "attachments-preview"
701
+ }, La = ["onClick"], Va = ["src"], Ea = ["src"], Da = {
702
+ class: "attachment-file-name"
703
+ }, qa = ["onClick"], Oa = ["accept"], za = /* @__PURE__ */ N({
704
+ __name: "FeedbackDetails",
705
+ props: {
706
+ id: {},
707
+ senderRole: {},
708
+ apiClient: {},
709
+ uploadService: {}
710
+ },
711
+ setup(t) {
712
+ const e = Ut;
713
+ function l(r) {
714
+ return r === "inProgress" ? "orangered" : r === "pending" ? "gold" : r === "resolved" ? "green" : r === "closed" ? "gray" : "arcoblue";
715
+ }
716
+ const i = b(""), d = b(!1), f = Le(), _ = b(null), k = b(null), S = b(null), x = b(!1), T = b(!1), w = b(0), B = b(!1), O = b(""), g = b(""), C = ze((r) => {
717
+ ae.warning(r);
718
+ }), o = F(() => C.imageItems.value.map((r) => r.previewUrl || "")), A = F(() => i.value.trim().length > 0 || C.hasAttachments.value), M = () => {
719
+ var r;
720
+ (r = _.value) == null || r.focus({
721
+ cursor: "end"
722
+ }), le(() => {
723
+ k.value && (k.value.scrollTop = k.value.scrollHeight);
724
+ });
725
+ }, U = t;
726
+ function H() {
727
+ return U.apiClient ?? f.api.ones;
728
+ }
729
+ function ge() {
730
+ return U.uploadService ?? f.upload;
731
+ }
732
+ const be = F(() => U.senderRole === "support" ? "暂无沟通记录" : "还没有消息"), $ = F(() => U.senderRole === "support" ? ["可在下方输入框回复用户", "支持发送文字、图片和文件附件"] : ["请尽量详细描述问题或需求", "可上传多张图片或文件附件,支持与文字一起发送"]), y = F(() => U.senderRole === "support" ? "输入回复内容,Enter 发送" : "补充问题描述或追问,Enter 发送"), p = b(!1), E = b([]), W = b(void 0);
733
+ function K(r, c) {
734
+ const n = "seq" in r && typeof r.seq == "number" ? r.seq : c;
735
+ return `${r.senderRole}-${n}-${c}`;
736
+ }
737
+ function xe(r) {
738
+ var c;
739
+ return String(((c = r.senderInfo) == null ? void 0 : c.avatarUrl) || "");
740
+ }
741
+ function $e(r) {
742
+ var n;
743
+ const c = String(((n = r.senderInfo) == null ? void 0 : n.nickname) || "").trim();
744
+ return c ? c.slice(0, 1).toUpperCase() : r.senderRole === "support" ? "S" : "U";
745
+ }
746
+ const G = b({
747
+ id: void 0,
748
+ title: "",
749
+ description: "",
750
+ type: "bugReports",
751
+ status: "newFeedback",
752
+ reply: "",
753
+ createAt: ""
754
+ });
755
+ function Ke() {
756
+ var r;
757
+ (r = S.value) == null || r.click();
758
+ }
759
+ function He(r) {
760
+ const c = r.target, n = c.files;
761
+ n != null && n.length && C.addFiles(Array.from(n)), c.value = "";
762
+ }
763
+ function Ge(r) {
764
+ if (r.kind === "image" && r.previewUrl) {
765
+ const c = C.imageItems.value.findIndex((n) => n.id === r.id);
766
+ if (c < 0) return;
767
+ w.value = c, T.value = !0;
768
+ return;
769
+ }
770
+ r.kind === "video" && r.previewUrl && (O.value = r.previewUrl, g.value = r.file.name, B.value = !0);
771
+ }
772
+ function Xe(r) {
773
+ var D;
774
+ const c = (D = r.clipboardData) == null ? void 0 : D.items;
775
+ if (!c) return;
776
+ const n = [];
777
+ for (const z of c)
778
+ if (z.type.startsWith("image/")) {
779
+ const q = z.getAsFile();
780
+ q && n.push(q);
781
+ }
782
+ n.length > 0 && (r.preventDefault(), C.addFiles(n));
783
+ }
784
+ function Ye(r) {
785
+ var c;
786
+ (c = r.dataTransfer) != null && c.types.includes("Files") && (x.value = !0);
787
+ }
788
+ function Je() {
789
+ x.value = !1;
790
+ }
791
+ function Ze(r) {
792
+ var n;
793
+ x.value = !1;
794
+ const c = (n = r.dataTransfer) == null ? void 0 : n.files;
795
+ c && C.addFiles(Array.from(c));
796
+ }
797
+ async function Qe() {
798
+ U.senderRole === "support" && G.value.status === "newFeedback" && await Ie();
799
+ }
800
+ async function et() {
801
+ var Ae;
802
+ const r = i.value, c = C.items.value.map((Y) => Y.file);
803
+ if (!r.trim() && c.length === 0)
804
+ return;
805
+ d.value = !0;
806
+ let n = [];
807
+ if (c.length > 0) {
808
+ const Y = await Ne(ge(), c, f.config.feedbackBucketId);
809
+ if (Y.error || !Y.data) {
810
+ d.value = !1, ae.error(((Ae = Y.error) == null ? void 0 : Ae.message) || "上传反馈附件失败");
811
+ return;
812
+ }
813
+ n = Y.data;
814
+ }
815
+ const D = r.trim(), {
816
+ data: z,
817
+ error: q
818
+ } = await H().feedbackCenter.update.messages.post({
819
+ id: U.id,
820
+ message: {
821
+ type: "text",
822
+ content: D,
823
+ attachments: n,
824
+ senderRole: U.senderRole
825
+ }
826
+ });
827
+ if (d.value = !1, q || !z)
828
+ return;
829
+ const ke = z;
830
+ E.value.push(ke.message), typeof ke.message.seq == "number" && (W.value = ke.message.seq), i.value = "", C.clear(), le(() => {
831
+ M();
832
+ }), await Qe();
833
+ }
834
+ async function Ie() {
835
+ p.value = !0;
836
+ const {
837
+ data: r,
838
+ error: c
839
+ } = await H().feedbackCenter.findOne.post({
840
+ id: U.id
841
+ });
842
+ if (p.value = !1, c || !r)
843
+ return;
844
+ const n = r;
845
+ G.value = n;
846
+ }
847
+ async function Fe() {
848
+ if (U.senderRole !== "user")
849
+ return;
850
+ const {
851
+ error: r
852
+ } = await H().feedbackCenter.markRead.post({
853
+ id: U.id
854
+ });
855
+ r || J();
856
+ }
857
+ async function tt() {
858
+ var D;
859
+ const {
860
+ data: r,
861
+ error: c
862
+ } = await H().messages.list.incremental.post({
863
+ id: U.id,
864
+ lastSeq: W.value
865
+ });
866
+ if (c || !r)
867
+ return;
868
+ const n = r;
869
+ if ((D = n.messages) != null && D.length) {
870
+ const z = n.messages;
871
+ E.value.push(...z);
872
+ const q = z.at(-1);
873
+ q && "seq" in q && typeof q.seq == "number" && (W.value = q.seq), le(() => {
874
+ M();
875
+ }), await Fe();
876
+ }
877
+ }
878
+ async function at() {
879
+ var D;
880
+ p.value = !0;
881
+ const {
882
+ data: r,
883
+ error: c
884
+ } = await H().messages.list.post({
885
+ id: U.id
886
+ });
887
+ if (p.value = !1, c || !r)
888
+ return;
889
+ const n = r;
890
+ if ((D = n.messages) != null && D.length) {
891
+ const z = n.messages;
892
+ E.value = z;
893
+ const q = z.at(-1);
894
+ q && "seq" in q && typeof q.seq == "number" && (W.value = q.seq), le(() => {
895
+ M();
896
+ });
897
+ }
898
+ await Fe();
899
+ }
900
+ return wa(tt, {
901
+ interval: 2e3,
902
+ autoStart: !0
903
+ }), Ie(), at(), (r, c) => (s(), u("div", Ia, [h("div", {
904
+ ref_key: "scrollableContentRef",
905
+ ref: k,
906
+ class: "scrollable-content"
907
+ }, [h("div", Fa, [m(a(dt), {
908
+ title: "基本信息"
909
+ }, {
910
+ title: v(() => [...c[4] || (c[4] = [h("div", {
911
+ class: "title"
912
+ }, "基本信息", -1)])]),
913
+ default: v(() => [m(a(re), {
914
+ label: "标题:",
915
+ span: 3
916
+ }, {
917
+ default: v(() => [V(I(G.value.title), 1)]),
918
+ _: 1
919
+ }), m(a(re), {
920
+ label: "问题描述:",
921
+ span: 3
922
+ }, {
923
+ default: v(() => [V(I(G.value.description || "-"), 1)]),
924
+ _: 1
925
+ }), m(a(re), {
926
+ label: "反馈类型:",
927
+ span: 1
928
+ }, {
929
+ default: v(() => [m(a(te), {
930
+ color: "arcoblue"
931
+ }, {
932
+ default: v(() => {
933
+ var n;
934
+ return [V(I((n = a(se)(a(Ue), G.value.type)) == null ? void 0 : n.label), 1)];
935
+ }),
936
+ _: 1
937
+ })]),
938
+ _: 1
939
+ }), m(a(re), {
940
+ label: "状态:",
941
+ span: 1
942
+ }, {
943
+ default: v(() => [m(a(te), {
944
+ color: l(G.value.status)
945
+ }, {
946
+ default: v(() => {
947
+ var n;
948
+ return [V(I((n = a(se)(a(We), G.value.status)) == null ? void 0 : n.label), 1)];
949
+ }),
950
+ _: 1
951
+ }, 8, ["color"])]),
952
+ _: 1
953
+ })]),
954
+ _: 1
955
+ }), h("div", Aa, [c[5] || (c[5] = h("div", {
956
+ class: "title"
957
+ }, "沟通记录", -1)), m(a(ft), {
958
+ class: "messageContent",
959
+ loading: p.value
960
+ }, {
961
+ default: v(() => [E.value.length === 0 ? (s(), P(a(vt), {
962
+ key: 0,
963
+ class: "message-empty"
964
+ }, {
965
+ description: v(() => [h("div", Ra, I(be.value), 1), h("ul", Pa, [(s(!0), u(L, null, j($.value, (n) => (s(), u("li", {
966
+ key: n
967
+ }, I(n), 1))), 128))])]),
968
+ _: 1
969
+ })) : (s(), u("div", Ba, [(s(!0), u(L, null, j(E.value, (n, D) => (s(), u(L, {
970
+ key: K(n, D)
971
+ }, [n.senderRole !== U.senderRole ? (s(), P(da, {
972
+ key: 0,
973
+ text: a(oe)(n).text,
974
+ attachments: a(oe)(n).attachments,
975
+ "avatar-url": xe(n),
976
+ "avatar-text": $e(n)
977
+ }, null, 8, ["text", "attachments", "avatar-url", "avatar-text"])) : (s(), P(aa, {
978
+ key: 1,
979
+ text: a(oe)(n).text,
980
+ attachments: a(oe)(n).attachments,
981
+ "avatar-url": xe(n),
982
+ "avatar-text": $e(n)
983
+ }, null, 8, ["text", "attachments", "avatar-url", "avatar-text"]))], 64))), 128))]))]),
984
+ _: 1
985
+ }, 8, ["loading"])])])], 512), h("div", Ta, [h("div", {
986
+ class: de(["sender-panel", {
987
+ "is-drag-over": x.value
988
+ }]),
989
+ onDragover: Z(Ye, ["prevent"]),
990
+ onDragleave: Je,
991
+ onDrop: Z(Ze, ["prevent"]),
992
+ onPaste: Xe
993
+ }, [a(C).hasAttachments.value ? (s(), u("div", Ma, [(s(!0), u(L, null, j(a(C).items.value, (n, D) => (s(), u("div", {
994
+ key: n.id,
995
+ class: de(["attachment-preview-item", {
996
+ "is-image": n.kind === "image",
997
+ "is-video": n.kind === "video"
998
+ }]),
999
+ onClick: (z) => Ge(n)
1000
+ }, [n.kind === "image" && n.previewUrl ? (s(), u("img", {
1001
+ key: 0,
1002
+ src: n.previewUrl,
1003
+ alt: "预览",
1004
+ class: "attachment-thumbnail"
1005
+ }, null, 8, Va)) : n.kind === "video" && n.previewUrl ? (s(), u(L, {
1006
+ key: 1
1007
+ }, [h("video", {
1008
+ class: "attachment-thumbnail",
1009
+ src: n.previewUrl,
1010
+ muted: "",
1011
+ preload: "metadata"
1012
+ }, null, 8, Ea), c[6] || (c[6] = h("span", {
1013
+ class: "attachment-video-play"
1014
+ }, "播放", -1))], 64)) : (s(), u(L, {
1015
+ key: 2
1016
+ }, [c[7] || (c[7] = h("span", {
1017
+ class: "attachment-file-icon"
1018
+ }, "FILE", -1)), h("span", Da, I(n.file.name), 1)], 64)), h("button", {
1019
+ type: "button",
1020
+ class: "attachment-remove-btn",
1021
+ title: "移除附件",
1022
+ onClick: Z((z) => a(C).removeAt(D), ["stop"])
1023
+ }, " × ", 8, qa)], 10, La))), 128))])) : R("", !0), m(a(Ce), {
1024
+ "src-list": o.value,
1025
+ visible: T.value,
1026
+ "onUpdate:visible": c[0] || (c[0] = (n) => T.value = n),
1027
+ current: w.value,
1028
+ "onUpdate:current": c[1] || (c[1] = (n) => w.value = n)
1029
+ }, null, 8, ["src-list", "visible", "current"]), m(Se, {
1030
+ visible: B.value,
1031
+ "onUpdate:visible": c[2] || (c[2] = (n) => B.value = n),
1032
+ title: g.value,
1033
+ src: O.value
1034
+ }, null, 8, ["visible", "title", "src"]), m(a(e), {
1035
+ ref_key: "senderRef",
1036
+ ref: _,
1037
+ value: i.value,
1038
+ "onUpdate:value": c[3] || (c[3] = (n) => i.value = n),
1039
+ placeholder: y.value,
1040
+ loading: d.value,
1041
+ "allow-speech": !1,
1042
+ "read-only": d.value,
1043
+ "send-disabled": !A.value,
1044
+ onSubmit: et
1045
+ }, {
1046
+ prefix: v(() => [m(a(he), {
1047
+ type: "text",
1048
+ class: "IconLink",
1049
+ disabled: d.value,
1050
+ onClick: Ke
1051
+ }, {
1052
+ icon: v(() => [m(a(ma))]),
1053
+ _: 1
1054
+ }, 8, ["disabled"])]),
1055
+ _: 1
1056
+ }, 8, ["value", "placeholder", "loading", "read-only", "send-disabled"]), h("input", {
1057
+ ref_key: "fileInputRef",
1058
+ ref: S,
1059
+ type: "file",
1060
+ accept: a(qe),
1061
+ multiple: "",
1062
+ class: "hidden-file-input",
1063
+ onChange: He
1064
+ }, null, 40, Oa)], 34)])]));
1065
+ }
1066
+ }), Na = /* @__PURE__ */ X(za, [["__scopeId", "data-v-d96562c6"]]), ja = {
1067
+ class: "FeedBackFrom"
1068
+ }, Wa = {
1069
+ class: "feedback-attachments-field"
1070
+ }, Ka = {
1071
+ key: 0,
1072
+ class: "attachments-preview"
1073
+ }, Ha = ["onClick"], Ga = ["src"], Xa = ["src"], Ya = {
1074
+ class: "attachment-file-name"
1075
+ }, Ja = ["onClick"], Za = ["accept"], Qa = /* @__PURE__ */ N({
1076
+ __name: "FeedbackForm",
1077
+ emits: ["confirm"],
1078
+ setup(t, {
1079
+ emit: e
1080
+ }) {
1081
+ const l = e, i = b(), d = b(!1), {
1082
+ config: f,
1083
+ upload: _
1084
+ } = Le(), k = b({
1085
+ id: void 0,
1086
+ title: "",
1087
+ type: "bugReports",
1088
+ priority: "normal",
1089
+ description: ""
1090
+ }), S = b(null), x = b(!1), T = b(0), w = b(!1), B = b(""), O = b(""), g = ze(($) => {
1091
+ ae.warning($);
1092
+ }), C = F(() => g.imageItems.value.map(($) => $.previewUrl || "")), o = F(() => k.value.type === "illegalContentReports"), A = F(() => o.value ? "请写明违规内容出现的位置、生成时间和具体违规情形" : "请输入问题描述");
1093
+ function M() {
1094
+ var $;
1095
+ ($ = S.value) == null || $.click();
1096
+ }
1097
+ function U($) {
1098
+ const y = $.target, p = y.files;
1099
+ p != null && p.length && g.addFiles(Array.from(p)), y.value = "";
1100
+ }
1101
+ function H($) {
1102
+ if ($.kind === "image" && $.previewUrl) {
1103
+ const y = g.imageItems.value.findIndex((p) => p.id === $.id);
1104
+ if (y < 0) return;
1105
+ T.value = y, x.value = !0;
1106
+ return;
1107
+ }
1108
+ $.kind === "video" && $.previewUrl && (B.value = $.previewUrl, O.value = $.file.name, w.value = !0);
1109
+ }
1110
+ function ge() {
1111
+ var $, y;
1112
+ k.value = {
1113
+ id: void 0,
1114
+ title: "",
1115
+ type: "bugReports",
1116
+ priority: "normal",
1117
+ description: ""
1118
+ }, g.clear(), (y = ($ = i.value) == null ? void 0 : $.resetFields) == null || y.call($);
1119
+ }
1120
+ async function be() {
1121
+ var y;
1122
+ if (!await i.value.validate()) {
1123
+ d.value = !0;
1124
+ const p = g.items.value.map((K) => K.file);
1125
+ let E = [];
1126
+ if (p.length > 0) {
1127
+ const K = await Ne(_, p, f.feedbackBucketId);
1128
+ if (K.error || !K.data) {
1129
+ d.value = !1, ae.error(((y = K.error) == null ? void 0 : y.message) || "上传反馈附件失败");
1130
+ return;
1131
+ }
1132
+ E = K.data;
1133
+ }
1134
+ const {
1135
+ error: W
1136
+ } = await ce().ones.feedbackCenter.create.post({
1137
+ title: k.value.title,
1138
+ type: k.value.type,
1139
+ priority: k.value.priority,
1140
+ description: k.value.description,
1141
+ attachments: E
1142
+ });
1143
+ d.value = !1, W || (ae.success("新建反馈成功"), ge(), l("confirm"));
1144
+ }
1145
+ }
1146
+ return ($, y) => (s(), u("div", ja, [m(a(pt), {
1147
+ ref_key: "formRef",
1148
+ ref: i,
1149
+ model: k.value,
1150
+ "auto-label-width": "",
1151
+ layout: "vertical"
1152
+ }, {
1153
+ default: v(() => [m(a(Q), {
1154
+ field: "title",
1155
+ label: "标题",
1156
+ rules: [{
1157
+ required: !0,
1158
+ message: "请输入标题"
1159
+ }]
1160
+ }, {
1161
+ default: v(() => [m(a(mt), {
1162
+ modelValue: k.value.title,
1163
+ "onUpdate:modelValue": y[0] || (y[0] = (p) => k.value.title = p),
1164
+ placeholder: "请输入标题"
1165
+ }, null, 8, ["modelValue"])]),
1166
+ _: 1
1167
+ }), m(a(Q), {
1168
+ field: "type",
1169
+ label: "反馈类型",
1170
+ rules: [{
1171
+ required: !0,
1172
+ message: "请选择反馈类型"
1173
+ }]
1174
+ }, {
1175
+ default: v(() => [m(a(Re), {
1176
+ modelValue: k.value.type,
1177
+ "onUpdate:modelValue": y[1] || (y[1] = (p) => k.value.type = p),
1178
+ placeholder: "请选择反馈类型"
1179
+ }, {
1180
+ default: v(() => [(s(!0), u(L, null, j(a(Ue), (p, E) => (s(), P(a(Pe), {
1181
+ key: E,
1182
+ value: p.key
1183
+ }, {
1184
+ default: v(() => [V(I(p.label), 1)]),
1185
+ _: 2
1186
+ }, 1032, ["value"]))), 128))]),
1187
+ _: 1
1188
+ }, 8, ["modelValue"])]),
1189
+ _: 1
1190
+ }), o.value ? (s(), P(a(gt), {
1191
+ key: 0,
1192
+ class: "report-tips",
1193
+ type: "warning"
1194
+ }, {
1195
+ default: v(() => [...y[7] || (y[7] = [V(" 举报将按最高优先级处理。请在描述中写明违规内容出现的位置(页面或会话链接)、生成时间和违规情形,并在附件中上传截图作为凭证。 ", -1)])]),
1196
+ _: 1
1197
+ })) : R("", !0), o.value ? R("", !0) : (s(), P(a(Q), {
1198
+ key: 1,
1199
+ field: "priority",
1200
+ label: "优先级",
1201
+ rules: [{
1202
+ required: !0,
1203
+ message: "请选择优先级"
1204
+ }]
1205
+ }, {
1206
+ default: v(() => [m(a(Re), {
1207
+ modelValue: k.value.priority,
1208
+ "onUpdate:modelValue": y[2] || (y[2] = (p) => k.value.priority = p),
1209
+ placeholder: "请选择优先级"
1210
+ }, {
1211
+ default: v(() => [(s(!0), u(L, null, j(a(je), (p, E) => (s(), P(a(Pe), {
1212
+ key: E,
1213
+ value: p.key
1214
+ }, {
1215
+ default: v(() => [V(I(p.label), 1)]),
1216
+ _: 2
1217
+ }, 1032, ["value"]))), 128))]),
1218
+ _: 1
1219
+ }, 8, ["modelValue"])]),
1220
+ _: 1
1221
+ })), m(a(Q), {
1222
+ field: "description",
1223
+ label: "问题描述",
1224
+ rules: [{
1225
+ required: !0,
1226
+ message: "请输入问题描述"
1227
+ }]
1228
+ }, {
1229
+ default: v(() => [m(a(bt), {
1230
+ modelValue: k.value.description,
1231
+ "onUpdate:modelValue": y[3] || (y[3] = (p) => k.value.description = p),
1232
+ placeholder: A.value,
1233
+ "allow-clear": "",
1234
+ "auto-size": {
1235
+ minRows: 5
1236
+ }
1237
+ }, null, 8, ["modelValue", "placeholder"])]),
1238
+ _: 1
1239
+ }), m(a(Q), {
1240
+ field: "attachments",
1241
+ label: "附件"
1242
+ }, {
1243
+ default: v(() => [h("div", Wa, [m(a(he), {
1244
+ type: "outline",
1245
+ disabled: d.value,
1246
+ onClick: M
1247
+ }, {
1248
+ default: v(() => [...y[8] || (y[8] = [V(" 添加图片、视频或文件 ", -1)])]),
1249
+ _: 1
1250
+ }, 8, ["disabled"]), a(g).hasAttachments.value ? (s(), u("div", Ka, [(s(!0), u(L, null, j(a(g).items.value, (p, E) => (s(), u("div", {
1251
+ key: p.id,
1252
+ class: de(["attachment-preview-item", {
1253
+ "is-image": p.kind === "image",
1254
+ "is-video": p.kind === "video"
1255
+ }]),
1256
+ onClick: (W) => H(p)
1257
+ }, [p.kind === "image" && p.previewUrl ? (s(), u("img", {
1258
+ key: 0,
1259
+ src: p.previewUrl,
1260
+ alt: "预览",
1261
+ class: "attachment-thumbnail"
1262
+ }, null, 8, Ga)) : p.kind === "video" && p.previewUrl ? (s(), u(L, {
1263
+ key: 1
1264
+ }, [h("video", {
1265
+ class: "attachment-thumbnail",
1266
+ src: p.previewUrl,
1267
+ muted: "",
1268
+ preload: "metadata"
1269
+ }, null, 8, Xa), y[9] || (y[9] = h("span", {
1270
+ class: "attachment-video-play"
1271
+ }, "播放", -1))], 64)) : (s(), u(L, {
1272
+ key: 2
1273
+ }, [y[10] || (y[10] = h("span", {
1274
+ class: "attachment-file-icon"
1275
+ }, "FILE", -1)), h("span", Ya, I(p.file.name), 1)], 64)), h("button", {
1276
+ type: "button",
1277
+ class: "attachment-remove-btn",
1278
+ title: "移除附件",
1279
+ onClick: Z((W) => a(g).removeAt(E), ["stop"])
1280
+ }, " × ", 8, Ja)], 10, Ha))), 128))])) : R("", !0), m(a(Ce), {
1281
+ "src-list": C.value,
1282
+ visible: x.value,
1283
+ "onUpdate:visible": y[4] || (y[4] = (p) => x.value = p),
1284
+ current: T.value,
1285
+ "onUpdate:current": y[5] || (y[5] = (p) => T.value = p)
1286
+ }, null, 8, ["src-list", "visible", "current"]), m(Se, {
1287
+ visible: w.value,
1288
+ "onUpdate:visible": y[6] || (y[6] = (p) => w.value = p),
1289
+ title: O.value,
1290
+ src: B.value
1291
+ }, null, 8, ["visible", "title", "src"]), h("input", {
1292
+ ref_key: "fileInputRef",
1293
+ ref: S,
1294
+ type: "file",
1295
+ accept: a(qe),
1296
+ multiple: "",
1297
+ class: "hidden-file-input",
1298
+ onChange: U
1299
+ }, null, 40, Za)])]),
1300
+ _: 1
1301
+ }), m(a(he), {
1302
+ loading: d.value,
1303
+ type: "primary",
1304
+ onClick: be
1305
+ }, {
1306
+ default: v(() => [...y[11] || (y[11] = [V(" 提交 ", -1)])]),
1307
+ _: 1
1308
+ }, 8, ["loading"])]),
1309
+ _: 1
1310
+ }, 8, ["model"])]));
1311
+ }
1312
+ }), es = /* @__PURE__ */ X(Qa, [["__scopeId", "data-v-0643d809"]]), ts = {
1313
+ class: "message-panel"
1314
+ }, as = {
1315
+ key: 2,
1316
+ class: "message-panel__detail"
1317
+ }, ss = /* @__PURE__ */ N({
1318
+ __name: "FeedbackList",
1319
+ emits: ["toDetail"],
1320
+ setup(t, {
1321
+ expose: e,
1322
+ emit: l
1323
+ }) {
1324
+ const i = b(!0), d = b([]), f = b(!1), _ = b(!1), k = b(""), S = b({
1325
+ total: 0,
1326
+ current: 1,
1327
+ pageSize: 10
1328
+ });
1329
+ function x() {
1330
+ i.value = !0, S.value.current = 1, g();
1331
+ }
1332
+ function T(o) {
1333
+ k.value = o.id, i.value = !1;
1334
+ }
1335
+ function w(o) {
1336
+ return o === "inProgress" ? "orangered" : o === "pending" ? "gold" : o === "resolved" ? "green" : o === "closed" ? "gray" : "arcoblue";
1337
+ }
1338
+ function B(o) {
1339
+ return o === "urgent" ? "red" : o === "high" ? "orangered" : o === "low" ? "gray" : "blue";
1340
+ }
1341
+ function O(o) {
1342
+ return o.map((A) => ({
1343
+ ...A,
1344
+ read: A.read ?? !0
1345
+ }));
1346
+ }
1347
+ async function g() {
1348
+ f.value = !0;
1349
+ const {
1350
+ data: o,
1351
+ error: A
1352
+ } = await ce().ones.feedbackCenter.own.post({
1353
+ current: S.value.current,
1354
+ pageSize: S.value.pageSize
1355
+ });
1356
+ if (f.value = !1, !A && o) {
1357
+ const M = o, U = O(M.items || []);
1358
+ d.value = U, S.value.total = M.count || 0, _.value = U.length < S.value.pageSize;
1359
+ }
1360
+ }
1361
+ async function C() {
1362
+ if (f.value || _.value) return;
1363
+ S.value.current += 1, f.value = !0;
1364
+ const {
1365
+ data: o,
1366
+ error: A
1367
+ } = await ce().ones.feedbackCenter.own.post({
1368
+ current: S.value.current,
1369
+ pageSize: S.value.pageSize
1370
+ });
1371
+ if (f.value = !1, !A && o) {
1372
+ const U = O(o.items || []);
1373
+ d.value = [...d.value, ...U], _.value = U.length < S.value.pageSize;
1374
+ }
1375
+ }
1376
+ return g(), e({
1377
+ refresh: g
1378
+ }), (o, A) => (s(), u("div", ts, [i.value ? R("", !0) : (s(), P(a(kt), {
1379
+ key: 0,
1380
+ class: "message-panel__breadcrumb"
1381
+ }, {
1382
+ default: v(() => [m(a(Be), {
1383
+ onClick: x
1384
+ }, {
1385
+ default: v(() => [...A[0] || (A[0] = [V("我的反馈", -1)])]),
1386
+ _: 1
1387
+ }), m(a(Be), null, {
1388
+ default: v(() => [...A[1] || (A[1] = [V("反馈详情", -1)])]),
1389
+ _: 1
1390
+ })]),
1391
+ _: 1
1392
+ })), i.value ? (s(), P(St, {
1393
+ key: 1,
1394
+ "message-list": d.value,
1395
+ loading: f.value,
1396
+ finished: _.value,
1397
+ "show-read-status": !0,
1398
+ "show-view-button": !1,
1399
+ "empty-description": "暂无反馈",
1400
+ onItemClick: T,
1401
+ onLoadMore: C
1402
+ }, {
1403
+ tags: v(({
1404
+ item: M
1405
+ }) => [m(a(te), {
1406
+ color: "arcoblue",
1407
+ size: "small"
1408
+ }, {
1409
+ default: v(() => {
1410
+ var U;
1411
+ return [V(I((U = a(se)(a(Ue), M.type)) == null ? void 0 : U.label), 1)];
1412
+ }),
1413
+ _: 2
1414
+ }, 1024), m(a(te), {
1415
+ color: B(M.priority),
1416
+ size: "small"
1417
+ }, {
1418
+ default: v(() => {
1419
+ var U;
1420
+ return [V(I(((U = a(se)(a(je), M.priority)) == null ? void 0 : U.label) || "普通"), 1)];
1421
+ }),
1422
+ _: 2
1423
+ }, 1032, ["color"]), m(a(te), {
1424
+ color: w(M.status),
1425
+ size: "small"
1426
+ }, {
1427
+ default: v(() => {
1428
+ var U;
1429
+ return [V(I((U = a(se)(a(We), M.status)) == null ? void 0 : U.label), 1)];
1430
+ }),
1431
+ _: 2
1432
+ }, 1032, ["color"])]),
1433
+ description: v(({
1434
+ item: M
1435
+ }) => [V(I(M.description || "暂无描述"), 1)]),
1436
+ _: 1
1437
+ }, 8, ["message-list", "loading", "finished"])) : (s(), u("div", as, [m(Na, {
1438
+ id: k.value,
1439
+ "sender-role": "user",
1440
+ class: "feedback-details-panel"
1441
+ }, null, 8, ["id"])]))]));
1442
+ }
1443
+ }), ns = {
1444
+ key: 0,
1445
+ class: "user-menu-modal-content"
1446
+ }, ls = {
1447
+ class: "left"
1448
+ }, rs = {
1449
+ key: 1,
1450
+ class: "user-menu-modal-form"
1451
+ }, Fs = /* @__PURE__ */ N({
1452
+ __name: "FeedbackModal",
1453
+ emits: ["confirm", "cancel"],
1454
+ setup(t, {
1455
+ expose: e,
1456
+ emit: l
1457
+ }) {
1458
+ const i = b(!1), d = b(Symbol("feedback-list")), f = b(Symbol("feedback-form")), _ = l;
1459
+ function k() {
1460
+ x.value = ["FeedbackList"], d.value = Symbol("feedback-list"), f.value = Symbol("feedback-form");
1461
+ }
1462
+ function S() {
1463
+ k(), _("cancel");
1464
+ }
1465
+ const x = b(["FeedbackList"]), T = b([{
1466
+ name: "我的反馈",
1467
+ path: "FeedbackList",
1468
+ meta: {
1469
+ icon: "mingcute:cube-3d-fill"
1470
+ }
1471
+ }, {
1472
+ name: "新建反馈",
1473
+ path: "CreateFeedback",
1474
+ meta: {
1475
+ icon: "mingcute:cube-3d-fill"
1476
+ }
1477
+ }]), w = F(() => x.value.length !== 0 ? x.value[0] : "");
1478
+ function B() {
1479
+ x.value = ["FeedbackList"], d.value = Symbol("feedback-list");
1480
+ }
1481
+ function O(C) {
1482
+ x.value = [C.path];
1483
+ }
1484
+ function g(C) {
1485
+ i.value = C, C && k();
1486
+ }
1487
+ return e({
1488
+ setData: g
1489
+ }), (C, o) => (s(), P(a(yt), {
1490
+ visible: i.value,
1491
+ "onUpdate:visible": o[1] || (o[1] = (A) => i.value = A),
1492
+ loading: !1,
1493
+ "body-class": "AppMessagebodyClass",
1494
+ "mask-closable": !1,
1495
+ footer: !1,
1496
+ width: a(st),
1497
+ title: "系统反馈",
1498
+ "hide-title": !1,
1499
+ onCancel: S
1500
+ }, {
1501
+ default: v(() => [i.value ? (s(), u("div", ns, [h("div", ls, [m(_t, {
1502
+ "selected-keys": x.value,
1503
+ "onUpdate:selectedKeys": o[0] || (o[0] = (A) => x.value = A),
1504
+ menus: T.value,
1505
+ onChange: O
1506
+ }, null, 8, ["selected-keys", "menus"])]), w.value === "FeedbackList" ? (s(), P(ss, {
1507
+ key: d.value
1508
+ })) : R("", !0), w.value === "CreateFeedback" ? (s(), u("div", rs, [(s(), P(es, {
1509
+ key: f.value,
1510
+ onConfirm: B
1511
+ }))])) : R("", !0)])) : R("", !0)]),
1512
+ _: 1
1513
+ }, 8, ["visible", "width"]));
1514
+ }
1515
+ });
1516
+ export {
1517
+ aa as B,
1518
+ Na as F,
1519
+ Me as R,
1520
+ Se as V,
1521
+ ss as _,
1522
+ da as a,
1523
+ es as b,
1524
+ Fs as c,
1525
+ Is as u
1526
+ };