1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./S403r29x.js","./CevamKTt.js","./swiper-vue.DJHdZmOr.css","./D9BjAukf.js","./c-VL7Eqz.js","./vue-flow.BRW-e5f_.css","./DLW8pDv-.js","./DIbJ_cul.js","./Cgh5bDDp.js","./CJ-j2e4u.js","./eww5zdNV.js","./kuaitu.CS-KWDaL.css","./Ck92sr5C.js","./jRcVxtdN.js","./PPVm8Dsz.js","./DXCGYovu.js","./useWithdrawal.dWo2nXmT.css"])))=>i.map(i=>d[i]); 2import { i as E, __tla as __tla_0 } from "./CevamKTt.js"; 3import { _ as je, __tla as __tla_1 } from "./Ck92sr5C.js"; 4import { hj as bn, hk as kn, k9 as kt, ka as Cn, iK as Tn, e9 as Me, bn as R, d1 as gn, gw as hn, cg as Ze, d2 as Sn, d3 as Dn, d4 as Mn, h4 as _n, kb as St, bm as Dt, dr as Nn, u as Ge, dA as En, cP as Ln, ga as On, eT as Ct, fv as vn, kc as Rn, dk as In, cU as Bn, gM as Vn, dv as An, dt as Fn, gN as Pn, db as $n, fx as Mt, gO as Nt, kd as zn, k0 as Hn, ds as Yn, a as yn, e2 as Un, dU as Et, dc as Wn, dn as jn, ke as Lt, h5 as Ot, cq as xe, b as Zn, cY as Gn, m as qn, gQ as Xn, gR as Kn, fq as Jn, __tla as __tla_2 } from "./D9BjAukf.js"; 5import { o as wn, N as Rt } from "./DIbJ_cul.js"; 6import { useFileSaveToLocal as Qn, __tla as __tla_3 } from "./S403r29x.js"; 7import It, { deleteFailedHistory as eo, __tla as __tla_4 } from "./jRcVxtdN.js"; 8import { _ as to } from "./PPVm8Dsz.js"; 9import { _ as no, __tla as __tla_5 } from "./GiRjuYBZ.js"; 10import { _ as oo, a as so, b as ao, __tla as __tla_6 } from "./BppqoCTT.js"; 11import { u as ro, n as lo, __tla as __tla_7 } from "./Dxud7LqS.js"; 12import { k as io, J as co, __tla as __tla_8 } from "./BvSKRw6S.js"; 13import { _ as uo, __tla as __tla_9 } from "./BcSfRJ2E.js"; 14import { I as A, u as mo, __tla as __tla_10 } from "./DiA9JFk3.js"; 15import { f as po, __tla as __tla_11 } from "./Dd4SKlGW.js"; 16let Jr, el, rl, ll, ka, As, Eo, pa; 17let __tla = Promise.all([ 18 (() => { 19 try { 20 return __tla_0; 21 } catch { 22 } 23 })(), 24 (() => { 25 try { 26 return __tla_1; 27 } catch { 28 } 29 })(), 30 (() => { 31 try { 32 return __tla_2; 33 } catch { 34 } 35 })(), 36 (() => { 37 try { 38 return __tla_3; 39 } catch { 40 } 41 })(), 42 (() => { 43 try { 44 return __tla_4; 45 } catch { 46 } 47 })(), 48 (() => { 49 try { 50 return __tla_5; 51 } catch { 52 } 53 })(), 54 (() => { 55 try { 56 return __tla_6; 57 } catch { 58 } 59 })(), 60 (() => { 61 try { 62 return __tla_7; 63 } catch { 64 } 65 })(), 66 (() => { 67 try { 68 return __tla_8; 69 } catch { 70 } 71 })(), 72 (() => { 73 try { 74 return __tla_9; 75 } catch { 76 } 77 })(), 78 (() => { 79 try { 80 return __tla_10; 81 } catch { 82 } 83 })(), 84 (() => { 85 try { 86 return __tla_11; 87 } catch { 88 } 89 })() 90]).then(async () => { 91 function fo(s, t) { 92 return t === void 0 && (t = false), bn(function(l, o) { 93 var m = 0; 94 l.subscribe(kn(o, function(c) { 95 var u = s(c, m++); 96 (u || t) && o.next(c), !u && o.complete(); 97 })); 98 }); 99 } 100 const go = {}, { createElementVNode: Bt, openBlock: ho, createElementBlock: _o } = await E("vue"), vo = { 101 xmlns: "http://www.w3.org/2000/svg", 102 "xmlns:xlink": "http://www.w3.org/1999/xlink", 103 fill: "none", 104 version: "1.1", 105 width: "12.690858840942383", 106 height: "15.999993324279785", 107 viewBox: "0 0 12.690858840942383 15.999993324279785" 108 }; 109 function $o(s, t) { 110 return ho(), _o("svg", vo, [ 111 ...t[0] || (t[0] = [ 112 Bt("g", null, [ 113 Bt("path", { 114 d: "M8.0025158,15.999993C7.896163,15.999878,7.7916813,15.972017,7.6993909,15.919166L4.3347034,13.585103C4.1693158,13.469627,4.0696502,13.281579,4.0669379,13.079885L4.0669379,5.734149L0,0.65174294L0.13135938,0.31324291C0.22508141,0.11997991,0.42178255,-0.0019719931,0.63656253,0.000024127246L12.372578,0.000024127246L12.690859,0.60121167L12.483718,0.89928979L8.588562,5.7341332L8.588562,15.388698C8.5885611,15.726307,8.3148746,15.999993,7.9772654,15.999993L8.0025158,15.999993Z", 115 fill: "currentColor", 116 "fill-opacity": "1", 117 style: { 118 "mix-blend-mode": "passthrough" 119 } 120 }) 121 ], -1) 122 ]) 123 ]); 124 } 125 const yo = Object.assign(je(go, [ 126 [ 127 "render", 128 $o 129 ] 130 ]), { 131 __name: "IconsDrawFilter" 132 }), wo = (function(s, t, l) { 133 var o = t.prototype; 134 o.isToday = function() { 135 var m = "YYYY-MM-DD", c = l(); 136 return this.format(m) === c.format(m); 137 }; 138 }), xo = (function(s, t, l) { 139 var o = t.prototype; 140 o.isYesterday = function() { 141 var m = "YYYY-MM-DD", c = l().subtract(1, "day"); 142 return this.format(m) === c.format(m); 143 }; 144 }); 145 var bo = /[+-]\d\d(?::?\d\d)?/g, ko = /([+-]|\d\d)/g; 146 function Co(s) { 147 s === void 0 && (s = ""); 148 var t = s.match(bo); 149 if (!t) return null; 150 var l = ("" + t[0]).match(ko) || [ 151 "-", 152 0, 153 0 154 ], o = l[0], m = l[1], c = l[2], u = +m * 60 + +c; 155 return u === 0 ? 0 : o === "+" ? u : -u; 156 } 157 const To = (function(s, t, l) { 158 var o = t.prototype; 159 l.utc = function(i) { 160 var x = { 161 date: i, 162 utc: true, 163 args: arguments 164 }; 165 return new t(x); 166 }, o.utc = function(i) { 167 var x = l(this.toDate(), { 168 locale: this.$L, 169 utc: true 170 }); 171 return i ? x.add(this.utcOffset(), kt) : x; 172 }, o.local = function() { 173 return l(this.toDate(), { 174 locale: this.$L, 175 utc: false 176 }); 177 }; 178 var m = o.parse; 179 o.parse = function(i) { 180 i.utc && (this.$u = true), this.$utils().u(i.$offset) || (this.$offset = i.$offset), m.call(this, i); 181 }; 182 var c = o.init; 183 o.init = function() { 184 if (this.$u) { 185 var i = this.$d; 186 this.$y = i.getUTCFullYear(), this.$M = i.getUTCMonth(), this.$D = i.getUTCDate(), this.$W = i.getUTCDay(), this.$H = i.getUTCHours(), this.$m = i.getUTCMinutes(), this.$s = i.getUTCSeconds(), this.$ms = i.getUTCMilliseconds(); 187 } else c.call(this); 188 }; 189 var u = o.utcOffset; 190 o.utcOffset = function(i, x) { 191 var d = this.$utils(), h = d.u; 192 if (h(i)) return this.$u ? 0 : h(this.$offset) ? u.call(this) : this.$offset; 193 if (typeof i == "string" && (i = Co(i), i === null)) return this; 194 var g = Math.abs(i) <= 16 ? i * 60 : i; 195 if (g === 0) return this.utc(x); 196 var _ = this.clone(); 197 if (x) return _.$offset = g, _.$u = false, _; 198 var y = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
199 return _ = this.local().add(g + y, kt), _.$offset = g, _.$x.$localOffset = y, _; 200 }; 201 var n = o.format, r = "YYYY-MM-DDTHH:mm:ss[Z]"; 202 o.format = function(i) { 203 var x = i || (this.$u ? r : ""); 204 return n.call(this, x); 205 }, o.valueOf = function() { 206 var i = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset()); 207 return this.$d.valueOf() - i * Cn; 208 }, o.isUTC = function() { 209 return !!this.$u; 210 }, o.toISOString = function() { 211 return this.toDate().toISOString(); 212 }, o.toString = function() { 213 return this.toDate().toUTCString(); 214 }; 215 var a = o.toDate; 216 o.toDate = function(i) { 217 return i === "s" && this.$offset ? l(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : a.call(this); 218 }; 219 var p = o.diff; 220 o.diff = function(i, x, d) { 221 if (i && this.$u === i.$u) return p.call(this, i, x, d); 222 var h = this.local(), g = l(i).local(); 223 return p.call(h, g, x, d); 224 }; 225 }); 226 var So = { 227 year: 0, 228 month: 1, 229 day: 2, 230 hour: 3, 231 minute: 4, 232 second: 5 233 }, Vt = {}, Do = function(t, l) { 234 l === void 0 && (l = {}); 235 var o = l.timeZoneName || "short", m = t + "|" + o, c = Vt[m]; 236 return c || (c = new Intl.DateTimeFormat("en-US", { 237 hour12: false, 238 timeZone: t, 239 year: "numeric", 240 month: "2-digit", 241 day: "2-digit", 242 hour: "2-digit", 243 minute: "2-digit", 244 second: "2-digit", 245 timeZoneName: o 246 }), Vt[m] = c), c; 247 }; 248 const Mo = (function(s, t, l) { 249 var o, m = function(p, i, x) { 250 x === void 0 && (x = {}); 251 var d = new Date(p), h = Do(i, x); 252 return h.formatToParts(d); 253 }, c = function(p, i) { 254 for (var x = m(p, i), d = [], h = 0; h < x.length; h += 1) { 255 var g = x[h], _ = g.type, y = g.value, D = So[_]; 256 D >= 0 && (d[D] = parseInt(y, 10)); 257 } 258 var L = d[3], $ = L === 24 ? 0 : L, w = d[0] + "-" + d[1] + "-" + d[2] + " " + $ + ":" + d[4] + ":" + d[5] + ":000", N = l.utc(w).valueOf(), S = +p, I = S % 1e3; 259 return S -= I, (N - S) / 6e4; 260 }, u = function(p, i, x) { 261 var d = p - i * 60 * 1e3, h = c(d, x); 262 if (i === h) return [ 263 d, 264 i 265 ]; 266 d -= (h - i) * 60 * 1e3; 267 var g = c(d, x); 268 return h === g ? [ 269 d, 270 h 271 ] : [ 272 p - Math.min(h, g) * 60 * 1e3, 273 Math.max(h, g) 274 ]; 275 }, n = t.prototype; 276 n.tz = function(a, p) { 277 a === void 0 && (a = o); 278 var i = this.utcOffset(), x = this.toDate(), d = x.toLocaleString("en-US", { 279 timeZone: a 280 }), h = Math.round((x - new Date(d)) / 1e3 / 60), g = -Math.round(x.getTimezoneOffset() / 15) * 15 - h, _ = !Number(g), y; 281 if (_) y = this.utcOffset(0, p); 282 else if (y = l(d, { 283 locale: this.$L 284 }).$set(Tn, this.$ms).utcOffset(g, true), p) { 285 var D = y.utcOffset(); 286 y = y.add(i - D, kt); 287 } 288 return y.$x.$timezone = a, y; 289 }, n.offsetName = function(a) { 290 var p = this.$x.$timezone || l.tz.guess(), i = m(this.valueOf(), p, { 291 timeZoneName: a 292 }).find(function(x) { 293 return x.type.toLowerCase() === "timezonename"; 294 }); 295 return i && i.value; 296 }; 297 var r = n.startOf; 298 n.startOf = function(a, p) { 299 if (!this.$x || !this.$x.$timezone) return r.call(this, a, p); 300 var i = l(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { 301 locale: this.$L 302 }), x = r.call(i, a, p); 303 return x.tz(this.$x.$timezone, true); 304 }, l.tz = function(a, p, i) { 305 var x = i && p, d = i || p || o, h = c(+l(), d); 306 if (typeof a != "string") return l(a).tz(d); 307 var g = l.utc(a, x).valueOf(), _ = u(g, h, d), y = _[0], D = _[1], L = l(y).utcOffset(D); 308 return L.$x.$timezone = d, L; 309 }, l.tz.guess = function() { 310 return Intl.DateTimeFormat().resolvedOptions().timeZone; 311 }, l.tz.setDefault = function(a) { 312 o = a; 313 }; 314 }); 315 var No = { 316 name: "zh-cn", 317 weekdays: "\u661F\u671F\u65E5_\u661F\u671F\u4E00_\u661F\u671F\u4E8C_\u661F\u671F\u4E09_\u661F\u671F\u56DB_\u661F\u671F\u4E94_\u661F\u671F\u516D".split("_"), 318 weekdaysShort: "\u5468\u65E5_\u5468\u4E00_\u5468\u4E8C_\u5468\u4E09_\u5468\u56DB_\u5468\u4E94_\u5468\u516D".split("_"), 319 weekdaysMin: "\u65E5_\u4E00_\u4E8C_\u4E09_\u56DB_\u4E94_\u516D".split("_"), 320 months: "\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u56DB\u6708_\u4E94\u6708_\u516D\u6708_\u4E03\u6708_\u516B\u6708_\u4E5D\u6708_\u5341\u6708_\u5341\u4E00\u6708_\u5341\u4E8C\u6708".split("_"), 321 monthsShort: "1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"), 322 ordinal: function(t, l) { 323 return l === "W" ? t + "\u5468" : t + "\u65E5"; 324 }, 325 weekStart: 1, 326 yearStart: 4, 327 formats: { 328 LT: "HH:mm", 329 LTS: "HH:mm:ss", 330 L: "YYYY/MM/DD", 331 LL: "YYYY\u5E74M\u6708D\u65E5", 332 LLL: "YYYY\u5E74M\u6708D\u65E5Ah\u70B9mm\u5206", 333 LLLL: "YYYY\u5E74M\u6708D\u65E5ddddAh\u70B9mm\u5206", 334 l: "YYYY/M/D", 335 ll: "YYYY\u5E74M\u6708D\u65E5", 336 lll: "YYYY\u5E74M\u6708D\u65E5 HH:mm", 337 llll: "YYYY\u5E74M\u6708D\u65E5dddd HH:mm" 338 }, 339 relativeTime: { 340 future: "%s\u5185", 341 past: "%s\u524D", 342 s: "\u51E0\u79D2", 343 m: "1 \u5206\u949F", 344 mm: "%d \u5206\u949F", 345 h: "1 \u5C0F\u65F6", 346 hh: "%d \u5C0F\u65F6", 347 d: "1 \u5929", 348 dd: "%d \u5929", 349 M: "1 \u4E2A\u6708", 350 MM: "%d \u4E2A\u6708", 351 y: "1 \u5E74", 352 yy: "%d \u5E74" 353 }, 354 meridiem: function(t, l) { 355 var o = t * 100 + l; 356 return o < 600 ? "\u51CC\u6668" : o < 900 ? "\u65E9\u4E0A" : o < 1100 ? "\u4E0A\u5348" : o < 1300 ? "\u4E2D\u5348" : o < 1800 ? "\u4E0B\u5348" : "\u665A\u4E0A"; 357 } 358 }; 359 Me.locale(No, null, true); 360 Me.extend(To); 361 Me.extend(Mo); 362 Me.extend(wo); 363 Me.extend(xo); 364 let ue, Lo, de, At, Xr, Oo, Ro, qe, Ne, Ee, Qe, ve, Io, Bo, Vo, Ao, Fo, Po, zo, Ho, Yo, Uo, Wo, Ie, jo, Kr, $e, me, be, Xe, Ft, et, le, Be, Pt, tt, zt, Ht, Ve, Zo, Go, qo, Xo, Ko, Jo, Qo, es, ts, ns, os, ss, as, Yt, nt, rs, ls, ot, is, cs, us; 365 Eo = (s) => { 366 const t = Me(s).tz(); 367 if (t.isToday()) return R("common.today"); 368 if (t.isYesterday()) return R("common.yesterday"); 369 const l = R("common.dateFormatMD"); 370 return t.format(l); 371 }; 372 ue = (s) => Me().subtract(s, "day").startOf("day").valueOf(); 373 ({ defineComponent: Lo } = await E("vue")); 374 ({ unref: de, createTextVNode: At, resolveComponent: Xr, withCtx: Oo, createVNode: Ro, toDisplayString: qe, openBlock: Ne, createElementBlock: Ee, createCommentVNode: Qe, createElementVNode: ve } = await E("vue")); 375 ({ watch: Io } = await E("vue")); 376 Bo = { 377 class: "p-4" 378 }; 379 Vo = { 380 class: "mb-3" 381 }; 382 Ao = { 383 key: 0, 384 class: "text-xs my-2" 385 }; 386 Fo = { 387 key: 1 388 }; 389 Po = { 390 key: 0, 391 class: "ml-3 text-sm text-gray-700" 392 }; 393 zo = { 394 key: 1, 395 class: "ml-3 text-sm text-gray-500" 396 }; 397 Ho = { 398 class: "text-xs text-gray-600" 399 }; 400 Yo = { 401 key: 0, 402 class: "mt-1" 403 }; 404 Uo = Lo({ 405 __name: "DownloadToLoalFile", 406 props: { 407 data: { 408 default: () => [] 409 }, 410 hideInfo: { 411 type: Boolean, 412 default: false 413 } 414 }, 415 setup(s) { 416 const t = s, { downloadFiles: l, pickDirectory: o, status: m, lastSaved: c, dirName: u, isLoading: n } = Qn(); 417 return l.value = t.data, Io(() => t.data, () => { 418 l.value = t.data; 419 }), (r, a) => { 420 const p = gn; 421 return Ne(), Ee("div", Bo, [ 422 ve("div", Vo, [ 423 Ro(p, { 424 type: "primary", 425 loading: de(n), 426 onClick: a[0] || (a[0] = (i) => de(o)(true)) 427 }, { 428 default: Oo(() => [ 429 ...a[1] || (a[1] = [ 430 At(" \u4FDD\u5B58\u6240\u9009\u5230\u672C\u5730 ", -1) 431 ]) 432 ]), 433 _: 1 434 }, 8, [ 435 "loading" 436 ]), 437 de(m) !== "\u7A7A\u95F2" && s.hideInfo ? (Ne(), Ee("div", Ao, qe(de(m)), 1)) : Qe("", true), 438 s.hideInfo ? Qe("", true) : (Ne(), Ee("div", Fo, [ 439 de(u) ? (Ne(), Ee("span", Po, "\u5DF2\u9009\u62E9\uFF1A" + qe(de(u)), 1)) : (Ne(), Ee("span", zo, "\uFF08\u672A\u9
439009\u62E9\uFF09")), 440 ve("div", Ho, [ 441 ve("div", null, "\u72B6\u6001\uFF1A" + qe(de(m)), 1), 442 de(c) ? (Ne(), Ee("div", Yo, " \u4E0A\u6B21\u4FDD\u5B58\uFF1A" + qe(de(c)), 1)) : Qe("", true) 443 ]), 444 a[2] || (a[2] = ve("hr", { 445 class: "my-3" 446 }, null, -1)), 447 a[3] || (a[3] = ve("div", { 448 class: "text-xs text-gray-500" 449 }, [ 450 At(" \u8BF4\u660E\uFF1A "), 451 ve("ul", { 452 class: "list-disc ml-4" 453 }, [ 454 ve("li", null, "1. \u9009\u62E9\u4FDD\u5B58\u76EE\u5F55\uFF0C\u72B6\u6001\u663E\u793A\uFF1A\u5DF2\u83B7\u5F97\u76EE\u5F55\u6743\u9650"), 455 ve("li", null, "2. \u751F\u6210\u5C06\u4F1A\u81EA\u52A8\u4FDD\u5B58\u5230\u6307\u5B9A\u7684\u76EE\u5F55\u4E2D") 456 ]) 457 ], -1)) 458 ])) 459 ]) 460 ]); 461 }; 462 } 463 }); 464 Wo = Object.assign(je(Uo, [ 465 [ 466 "__scopeId", 467 "data-v-0ddd5b56" 468 ] 469 ]), { 470 __name: "AiDrawRecordDownloadToLoalFile" 471 }); 472 ({ unref: Ie } = await E("vue")); 473 ({ defineComponent: jo } = await E("vue")); 474 ({ resolveComponent: Kr, createVNode: $e, unref: me, openBlock: be, createElementBlock: Xe, createCommentVNode: Ft, withModifiers: et, createElementVNode: le, toDisplayString: Be, createTextVNode: Pt, createBlock: tt, renderList: zt, Fragment: Ht, withCtx: Ve, vShow: Zo, withDirectives: Go, Transition: qo } = await E("vue")); 475 Xo = { 476 key: 0, 477 class: "w-1.5 h-1.5 rounded-full bg-theme-success absolute ml-3.5 mb-3" 478 }; 479 Ko = { 480 class: "absolute right-0 mt-2 z-50 bg-theme-surface p-3 rounded-lg flex flex-col gap-3 w-48 shadow-lg" 481 }; 482 Jo = { 483 class: "font-bold flex justify-between align-center" 484 }; 485 Qo = { 486 class: "flex items-center gap-1 bg-theme-background p-2 rounded-lg cursor-pointer" 487 }; 488 es = { 489 class: "text-sm" 490 }; 491 ts = { 492 class: "flex flex-col gap-2" 493 }; 494 ns = { 495 class: "text-xs font-light" 496 }; 497 os = { 498 class: "grid grid-cols-2 gap-2" 499 }; 500 ss = [ 501 "onClick" 502 ]; 503 as = { 504 class: "text-sm" 505 }; 506 ({ ref: Yt, computed: nt } = await E("vue")); 507 rs = jo({ 508 __name: "Filter", 509 setup(s) { 510 const { filterCondition: t, visibleTasksComputeRef: l } = hn(), o = Yt(false), m = [ 511 { 512 label: "common.today", 513 begin: ue(0) 514 }, 515 { 516 label: "common.yesterday", 517 begin: ue(1), 518 end: ue(0) 519 }, 520 { 521 label: "common.pastWeek", 522 begin: ue(6), 523 end: ue(1) 524 }, 525 { 526 label: "common.pastMonth", 527 begin: ue(29), 528 end: ue(6) 529 }, 530 { 531 label: "common.past3Months", 532 begin: ue(89), 533 end: ue(29) 534 } 535 ], c = nt(() => { 536 var _a2; 537 return ((_a2 = t.value.dateRange) == null ? void 0 : _a2.label) || "common.timePicker"; 538 }), u = (d) => { 539 t.value.dateRange = d; 540 }, n = [ 541 { 542 label: "common.image", 543 value: "image" 544 }, 545 { 546 label: "common.video", 547 value: "video" 548 }, 549 { 550 label: "common.audio", 551 value: "audio" 552 }, 553 { 554 label: "common.threeD", 555 value: "3d" 556 }, 557 { 558 label: "common.text", 559 value: "text" 560 } 561 ], r = (d) => { 562 const h = t.value.outputType || []; 563 h.indexOf(d) !== -1 ? t.value.outputType = h.filter((_) => _ !== d) : t.value.outputType = [ 564 ...h, 565 d 566 ]; 567 }, a = Yt(null); 568 wn(a, () => { 569 o.value = false; 570 }); 571 const p = async () => { 572 t.value = { 573 dateRange: null, 574 outputType: null 575 }; 576 }, i = nt(() => !t.value.dateRange && !t.value.outputType), x = nt(() => { 577 const d = []; 578 return l.value.forEach((h) => { 579 var _a2; 580 h.output_content && h.output_content.length > 0 ? h.output_content.filter((g) => g.type !== "text").forEach((g) => { 581 d.push(g); 582 }) : (_a2 = h.output) == null ? void 0 : _a2.forEach((g) => { 583 d.push(g); 584 }); 585 }), d; 586 }); 587 return (d, h) => { 588 const g = yo, _ = Ze, y = Mn, D = Dn, L = Sn; 589 return be(), Xe("div", { 590 ref_key: "dropdownRef", 591 ref: a, 592 class: "inline-block" 593 }, [ 594 le("div", { 595 class: "cursor-pointer flex items-center p-2 bg-theme-surface theme-hover-surface rounded-lg gap-1 text-sm select-none", 596 onMousedown: h[0] || (h[0] = et(() => { 597 }, [ 598 "prevent" 599 ])), 600 onClick: h[1] || (h[1] = ($) => o.value = !me(o)) 601 }, [ 602 $e(g, { 603 size: "20" 604 }), 605 me(i) ? Ft("", true) : (be(), Xe("div", Xo)) 606 ], 32), 607 $e(qo, { 608 name: "fade" 609 }, { 610 default: Ve(() => [ 611 Go(le("div", Ko, [ 612 le("div", Jo, [ 613 Pt(Be(("$t" in d ? d.$t : Ie(R))("generate.filter")) + " ", 1), 614 $e(_, { 615 name: "mdi:refresh", 616 class: "cursor-pointer", 617 onClick: p 618 }) 619 ]), 620 $e(L, { 621 class: "cursor-pointer", 622 trigger: [ 623 "click" 624 ], 625 placement: "bottomRight", 626 "get-popup-container": () => me(a) 627 }, { 628 overlay: Ve(() => [ 629 $e(D, null, { 630 default: Ve(() => [ 631 (be(), Xe(Ht, null, zt(m, ($) => $e(y, { 632 key: $.value, 633 class: "text-sm", 634 onClick: et((w) => u($), [ 635 "prevent", 636 "stop" 637 ]) 638 }, { 639 default: Ve(() => [ 640 Pt(Be(("$t" in d ? d.$t : Ie(R))($.label)), 1) 641 ]), 642 _: 2 643 }, 1032, [ 644 "onClick" 645 ])), 64)) 646 ]), 647 _: 1 648 }) 649 ]), 650 default: Ve(() => [ 651 le("div", Qo, [ 652 $e(_, { 653 name: "mdi:date-range" 654 }), 655 le("span", es, Be(("$t" in d ? d.$t : Ie(R))(me(c))), 1), 656 me(t).dateRange ? (be(), tt(_, { 657 key: 0, 658 name: "mdi:close-circle", 659 class: "ml-auto", 660 onClick: h[2] || (h[2] = et(($) => me(t).dateRange = null, [ 661 "stop" 662 ])) 663 })) : (be(), tt(_, { 664 key: 1, 665 name: "mdi:chevron-down", 666 class: "ml-auto" 667 })) 668 ]) 669 ]), 670 _: 1 671 }, 8, [ 672 "get-popup-container" 673 ]), 674 le("div", ts, [ 675 le("div", ns, Be(("$t" in d ? d.$t : Ie(R))("generate.outputType")), 1), 676 le("div", os, [ 677 (be(), Xe(Ht, null, zt(n, ($) => { 678 var _a2; 679 return le("div", { 680 key: $.value, 681 class: "bg-theme-background px-2 py-1 rounded-lg cursor-pointer flex justify-between items-center", 682 onClick: (w) => r($.value) 683 }, [ 684 le("span", as, Be(("$t" in d ? d.$t : Ie(R))($.label)), 1), 685 ((_a2 = me(t).outputType) == null ? void 0 : _a2.includes($.value)) ? (be(), tt(_, { 686 key: 0, 687 name: "mdi:check" 688 })) : Ft("", true) 689 ], 8, ss); 690 }), 64)) 691 ]) 692 ]), 693 $e(Wo, { 694 data: me(x), 695 "hide-info": true 696 }, null, 8, [ 697 "data" 698 ]) 699 ], 512), [ 700 [ 701 Zo, 702 me(o) 703 ] 704 ]) 705 ]), 706 _: 1 707 }) 708 ], 512); 709 }; 710 } 711 }); 712 Jr = Object.assign(rs, { 713 __name: "AiDrawRecordFilter" 714 }); 715 ls = {}; 716 ({ createElementVNode: ot, openBlock: is, createElementBlock: cs } = await E("vue")); 717 us = { 718 xmlns: "http://www.w3.org/2000/svg", 719 "xmlns:xlink": "http://www.w3.org/1999/xlink", 720 fill: "currentColor", 721 version: "1.1", 722 width: "16", 723 height: "16",
724 viewBox: "0 0 16 16" 725 }; 726 function ds(s, t) { 727 return is(), cs("svg", us, [ 728 ...t[0] || (t[0] = [ 729 ot("g", null, [ 730 ot("g", null, [ 731 ot("path", { 732 d: "M15.840799,11.840798C15.800997,11.880599,15.761197,11.960201,15.681596,12.000002L8.7562208,15.820898C8.2786093,16.059704,7.721395,16.059704,7.243783,15.820898L0.23880745,12.000004C0.03980248,11.880601,-0.039799742,11.641795,0.079603396,11.442791C0.11940432,11.363189,0.15920523,11.323388,0.19900614,11.283587C0.55721515,11.044782,1.0348274,11.004979,1.3930367,11.243786L7.2437849,14.308464C7.721396,14.547269,8.2388096,14.547269,8.7164221,14.308464L14.487568,11.243786C14.885577,11.044782,15.323389,11.084582,15.681599,11.283587C15.920404,11.40299,15.960203,11.641795,15.840799,11.840798ZM15.840799,8.1791058C15.800997,8.2189064,15.761197,8.2985086,15.681596,8.3383102L8.7562208,12.159205C8.2786093,12.398011,7.721395,12.398011,7.243783,12.159205L0.23880745,8.3383102C0.03980248,8.2189064,-0.039799742,7.9801011,0.079603396,7.781096C0.11940432,7.7014937,0.15920523,7.6616931,0.19900614,7.621892C0.55721515,7.3830857,1.0348274,7.3432851,1.3930367,7.5820904L7.2437849,10.646768C7.721396,10.885575,8.2388096,10.885575,8.7164221,10.646768L14.487565,7.5820904C14.885574,7.3830857,15.323385,7.4228868,15.681596,7.621892C15.920401,7.7412949,15.9602,7.9801002,15.840799,8.1791058ZM15.9602,4.477613L15.840799,4.5970159L8.2786074,8.6567173C8.0796032,8.7761202,7.8805985,8.7761202,7.6815939,8.6567173L0.15920405,4.5970159C0,4.5174136,-0.039800916,4.3184094,0.039800916,4.159205L0.15920405,4.0398011L7.6815925,0.059701663C7.8805971,-0.019900555,8.0796013,-0.019900555,8.2786074,0.059701663L15.840796,4.0398011C16,4.159205,16.039803,4.3582096,15.9602,4.477613Z", 733 fill: "currentColor", 734 "fill-opacity": "1", 735 style: { 736 "mix-blend-mode": "passthrough" 737 } 738 }) 739 ]) 740 ], -1) 741 ]) 742 ]); 743 } 744 let ms, ke, ps, Qr, Ce, fs, Ut, pe, Ae, Wt, Fe, jt, Zt, gs, hs, _s, vs, $s, ys, ws, xs, Gt, bs, ks, st, Cs, Ts, at, rt, Ss, qt, Ds, Xt, Ms, Ns, Es, Ls, Kt, tl, Os, Rs, Is, Bs, Vs, Fs, Ps, Y, ie; 745 ms = Object.assign(je(ls, [ 746 [ 747 "render", 748 ds 749 ] 750 ]), { 751 __name: "IconsDrawList" 752 }); 753 ({ unref: ke } = await E("vue")); 754 ({ defineComponent: ps } = await E("vue")); 755 ({ resolveComponent: Qr, createVNode: Ce, withModifiers: fs, unref: Ut, createElementVNode: pe, toDisplayString: Ae, mergeProps: Wt, withCtx: Fe, openBlock: jt, createElementBlock: Zt, createCommentVNode: gs, Transition: hs } = await E("vue")); 756 _s = { 757 key: 0, 758 class: "absolute right-0 mt-2 z-50 bg-theme-surface p-3 rounded-lg flex flex-col gap-2 w-40 shadow-lg" 759 }; 760 vs = { 761 class: "text-xs" 762 }; 763 $s = { 764 class: "text-caption" 765 }; 766 ys = { 767 class: "text-xs" 768 }; 769 ws = { 770 class: "text-caption" 771 }; 772 xs = { 773 class: "text-xs" 774 }; 775 ({ ref: Gt } = await E("vue")); 776 bs = ps({ 777 __name: "Action", 778 setup(s) { 779 const { tasks: t } = _n(), l = Gt(false), o = Gt(null); 780 wn(o, () => { 781 l.value = false; 782 }); 783 const m = async () => { 784 var _a2; 785 console.log("\u5220\u9664\u5931\u8D25\u4EFB\u52A1"), await eo(), t.value = (_a2 = t.value) == null ? void 0 : _a2.filter((u) => u.status !== 2 && u.status !== 3), Dt(R("draw.deleteFailedTasksSuccess")); 786 }, c = () => { 787 console.log("\u6E05\u7A7A\u4EFB\u52A1"), t.value = []; 788 }; 789 return (u, n) => { 790 const r = ms, a = Ze; 791 return jt(), Zt("div", { 792 ref_key: "dropdownRef", 793 ref: o, 794 class: "inline-block" 795 }, [ 796 pe("div", { 797 class: "cursor-pointer flex items-center p-2 bg-theme-surface theme-hover-surface rounded-lg gap-1 text-sm select-none", 798 onMousedown: n[0] || (n[0] = fs(() => { 799 }, [ 800 "prevent" 801 ])), 802 onClick: n[1] || (n[1] = (p) => l.value = !Ut(l)) 803 }, [ 804 Ce(r, { 805 size: "20" 806 }) 807 ], 32), 808 Ce(hs, { 809 name: "fade" 810 }, { 811 default: Fe(() => [ 812 Ut(l) ? (jt(), Zt("div", _s, [ 813 pe("div", { 814 class: "flex items-center gap-1 bg-theme-background p-2 rounded-lg cursor-pointer", 815 onClick: m 816 }, [ 817 Ce(a, { 818 name: "mdi:delete" 819 }), 820 pe("span", vs, Ae(("$t" in u ? u.$t : ke(R))("draw.deleteFailedTasks")), 1) 821 ]), 822 Ce(St, { 823 location: "top" 824 }, { 825 activator: Fe(({ props: p }) => [ 826 pe("div", Wt(p, { 827 class: "flex items-center gap-1 bg-theme-background p-2 rounded-lg cursor-pointer", 828 onClick: c 829 }), [ 830 Ce(a, { 831 name: "mdi:clear-circle-outline" 832 }), 833 pe("span", ys, Ae(("$t" in u ? u.$t : ke(R))("draw.clearWorkspace")), 1) 834 ], 16) 835 ]), 836 default: Fe(() => [ 837 pe("span", $s, Ae(("$t" in u ? u.$t : ke(R))("draw.clearWorkspaceTips")), 1) 838 ]), 839 _: 1 840 }), 841 Ce(St, { 842 location: "top" 843 }, { 844 activator: Fe(({ props: p }) => [ 845 pe("div", Wt(p, { 846 class: "flex items-center gap-1 bg-theme-background p-2 rounded-lg cursor-pointer", 847 onClick: n[2] || (n[2] = (i) => { 848 u.handleReGetTask(), ("useCustomToast" in u ? u.useCustomToast : ke(Dt))(("$t" in u ? u.$t : ke(R))("draw.refreshSuccess")); 849 }) 850 }), [ 851 Ce(a, { 852 name: "mdi-refresh" 853 }), 854 pe("span", xs, Ae(("$t" in u ? u.$t : ke(R))("draw.refresh")), 1) 855 ], 16) 856 ]), 857 default: Fe(() => [ 858 pe("span", ws, Ae(("$t" in u ? u.$t : ke(R))("draw.refreshTips")), 1) 859 ]), 860 _: 1 861 }) 862 ])) : gs("", true) 863 ]), 864 _: 1 865 }) 866 ], 512); 867 }; 868 } 869 }); 870 el = Object.assign(bs, { 871 __name: "AiDrawRecordAction" 872 }); 873 ({ defineComponent: ks } = await E("vue")); 874 ({ unref: st, renderList: Cs, Fragment: Ts, openBlock: at, createElementBlock: rt, createElementVNode: Ss, normalizeStyle: qt } = await E("vue")); 875 ({ ref: Ds, computed: Xt } = await E("vue")); 876 Ms = [ 877 "src" 878 ]; 879 Ns = ks({ 880 __name: "HoverImageStack", 881 props: { 882 images: {}, 883 width: { 884 default: 35 885 }, 886 offset: { 887 default: 45 888 } 889 }, 890 setup(s) { 891 const t = s, l = Ds(false), o = Xt(() => t.width * 4 / 3), m = (u) => u % 2 === 0 ? -10 - u * 2 : 10 + u * 2, c = Xt(() => t.images.map((u, n) => ({ 892 transform: l.value ? `translateX(${n * t.offset}px) rotate(${m(n)}deg)` : `translateX(0px) rotate(${m(n)}deg)`, 893 zIndex: n + 1 894 }))); 895 return (u, n) => (at(), rt("div", { 896 class: "relative cursor-pointer m-2 group", 897 style: qt({ 898 width: t.width + "px", 899 height: st(o) + "px" 900 }), 901 onMouseenter: n[0] || (n[0] = (r) => l.value = true), 902 onMouseleave: n[1] || (n[1] = (r) => l.value = false) 903 }, [ 904 (at(true), rt(Ts, null, Cs(s.images, (r, a) => (at(), rt("div", { 905 key: a, 906 class: "absolute top-0 left-0 transition-transform duration-300 ease-in-out", 907 style: qt({ 908 ...st(c)[a], 909 width: t.width + "px", 910 height: st(o) + "px" 911 }) 912 }, [ 913 Ss("img", { 914 src: r, 915 alt: "img", 916 class: "w-full h-full rounded shadow-lg object-cover object-center group-hover:scale-105" 917 }, null, 8, Ms) 918 ], 4))), 128)) 919 ], 36)); 920 } 921 }); 922 Es = Object.assign(Ns, { 923 __name: "AiDrawRecordHoverImageStack" 924 }); 925 ({ defineComponent: Ls } = await E("vue")); 926 ({ unref: Kt, resolveComponent: tl, openBlock: Os, createBlock: Rs, createCommentVNode: Is } = await E("vue")); 927 ({ computed: Bs } = await E("vue")); 928 Vs = Ls({ 929 __name: "TaskInputImageStack", 930 props: { 931 task: {} 932 }, 933 setup(s) { 934 const t = s, l = (u) => { 935 const n = [], r = u.split(` 936`); 937 for (const a of r) { 938 const p = a.trim(); 939 if (!p) continue; 940 const { fileType: i } = Nn(p); 941 i === "image" && n.push(p); 942 } 943 return n; 944 }, o = (u) => { 945 if (!Array.isArray(u)) return []; 946 const n = []; 947 for (const r of u) if (r && typeof r == "object" && "url" in r) { 948 const a = r.url; 949 a && typeof a == "string" && n.push(a); 950 } 951 return n; 952 }, m = (u) => { 953 var _a2, _b; 954 if (!Array.isArray(u)) return []; 955 const n = []; 956 for (const r of u) { 957 if (!r || typeof r != "object") continue; 958 const p = r.inline_element; 959 if (!p) continue; 960 const i = p.frontal_image_url || ((_b = (_a2 = p.refer_images) == null ? void 0 : _a2[0]) == null ? void 0 : _b.url); 961 i && n.push(i); 962 } 963 return n; 964 }, c = Bs(() => { 965 var _a2; 966 if (!((_a2 = t.task) == null ? void 0 : _a2.params)) return []; 967 const u = [], n = t.task.params; 968 for (const [r, a] of Object.entries(n)) if (a != null) { 969 if (r === "image_list" || r.endsWith("_image_list")) { 970 u.push(...o(a)); 971 continue; 972 } 973 if (r === "element_list" || r.endsWith("_element_list")) { 974 u.push(...m(a)); 975 continue; 976 } 977 typeof a == "string" && u.push(...l(a)); 978 } 979 return [ 980 ...new Set(u) 981 ]; 982 }); 983 return (u, n) => { 984 const r = Es; 985 return Kt(c).length > 0 ? (Os(), Rs(r, { 986 key: 0, 987 images: Kt(c) 988 }, null, 8, [ 989 "images" 990 ])) : Is("", true); 991 }; 992 } 993 }); 994 As = Object.assign(Vs, {
995 __name: "AiDrawRecordTaskInputImageStack" 996 }); 997 Fs = '<svg class="chip-icon-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>'; 998 Ps = '<svg class="chip-icon-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 3v10.55a4 4 0 1 0 2 3.45V8h4V3h-6z"/></svg>'; 999 Y = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"); 1000 ie = (s) => (s || "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"); 1001 function xn() { 1002 const { t: s } = Ge(), t = (n) => ({ 1003 video: s("omni.materialTypeVideo"), 1004 image: s("omni.materialTypeImage"), 1005 element: s("omni.materialTypeElement"), 1006 audio: s("omni.materialTypeAudio") 1007 })[n], l = (n) => { 1008 const a = t(n).replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); 1009 return new RegExp(`@${a}(\\d+)`, "g"); 1010 }; 1011 return { 1012 getMaterialTypeName: t, 1013 buildTagRegex: l, 1014 buildAllTagsRegex: (n = "g") => { 1015 const r = t("video").replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), a = t("image").replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), p = t("element").replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), i = t("audio").replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); 1016 return new RegExp(`@(${r}|${a}|${p}|${i})\\d+`, n); 1017 }, 1018 textToHighlightHtmlWithChips: (n, r) => { 1019 const { videos: a, images: p, elements: i, audios: x = [] } = r; 1020 let d = n.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"); 1021 const h = t("video"), g = t("image"), _ = t("element"), y = t("audio"), D = ' contenteditable="false"'; 1022 return d = d.replace(l("video"), (L, $) => { 1023 const w = parseInt($, 10), N = Math.min(w, a.length); 1024 if (N < 1) return Y(L); 1025 const S = String(N), I = `@${h}${S}`, B = L.slice(I.length), V = a[N - 1], q = (V == null ? void 0 : V.thumbnail) ? ie(V.thumbnail) : "", X = (V == null ? void 0 : V.url) ? ie(V.url) : "", ne = I, e = q ? `<img class="chip-thumb" src="${q}" alt="">` : X ? `<video class="chip-thumb chip-video" src="${X}" muted preload="metadata" playsinline></video>` : '<span class="chip-thumb chip-placeholder"></span>'; 1026 return `<span${D} class="hl-tag hl-chip hl-video" data-tag="${ie(ne)}">${e}<span class="chip-ref text-xs text-white">${Y(ne)}</span></span>` + (B ? Y(B) : ""); 1027 }), d = d.replace(l("image"), (L, $) => { 1028 const w = parseInt($, 10), N = Math.min(w, p.length); 1029 if (N < 1) return Y(L); 1030 const S = String(N), I = `@${g}${S}`, B = L.slice(I.length), V = p[N - 1], q = (V == null ? void 0 : V.url) ? ie(V.url) : "", X = I; 1031 return `<span${D} class="hl-tag hl-chip hl-image" data-tag="${ie(X)}"><img class="chip-thumb" src="${q}" alt=""><span class="chip-ref text-xs text-white">${Y(X)}</span></span>` + (B ? Y(B) : ""); 1032 }), d = d.replace(l("element"), (L, $) => { 1033 const w = parseInt($, 10), N = Math.min(w, i.length); 1034 if (N < 1) return Y(L); 1035 const S = String(N), I = `@${_}${S}`, B = L.slice(I.length), V = i[N - 1], q = V ? ie(V.thumbnail || V.frontal_image_url || "") : "", X = (V == null ? void 0 : V.name) ? Y(V.name) : _ + S; 1036 return `<span${D} class="hl-tag hl-chip hl-element" data-tag="${ie(I)}"><img class="chip-thumb" src="${q}" alt=""><span class="chip-icon text-white" aria-hidden="true">${Fs}</span><span class="chip-name text-xs text-white">${X}</span></span>` + (B ? Y(B) : ""); 1037 }), d = d.replace(l("audio"), (L, $) => { 1038 const w = parseInt($, 10), N = Math.min(w, x.length); 1039 if (N < 1) return Y(L); 1040 const S = String(N), I = `@${y}${S}`, B = L.slice(I.length), V = I; 1041 return `<span${D} class="hl-tag hl-chip hl-audio" data-tag="${ie(V)}"><span class="chip-icon text-white" aria-hidden="true">${Ps}</span><span class="chip-ref text-xs text-white">${Y(V)}</span></span>` + (B ? Y(B) : ""); 1042 }), d = d.replace(/\n/g, "<br>"), d; 1043 }, 1044 textToDisplayHtmlWithChips: (n) => { 1045 if (!n) return ""; 1046 let r = n.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"); 1047 const a = t("video"), p = t("image"), i = t("element"), x = t("audio"), d = (h, g) =>
1047 `<span class="hl-tag hl-chip hl-display-only ${g}" data-tag="${ie(h)}"><span class="chip-ref text-xs text-white">${Y(h)}</span></span>`; 1048 return r = r.replace(l("video"), (h, g) => { 1049 const _ = String(Math.min(parseInt(g, 10) || 1, 999)), y = `@${a}${_}`, D = h.slice(y.length); 1050 return d(y, "hl-video") + (D ? Y(D) : ""); 1051 }), r = r.replace(l("image"), (h, g) => { 1052 const _ = String(Math.min(parseInt(g, 10) || 1, 999)), y = `@${p}${_}`, D = h.slice(y.length); 1053 return d(y, "hl-image") + (D ? Y(D) : ""); 1054 }), r = r.replace(l("element"), (h, g) => { 1055 const _ = String(Math.min(parseInt(g, 10) || 1, 999)), y = `@${i}${_}`, D = h.slice(y.length); 1056 return d(y, "hl-element") + (D ? Y(D) : ""); 1057 }), r = r.replace(l("audio"), (h, g) => { 1058 const _ = String(Math.min(parseInt(g, 10) || 1, 999)), y = `@${x}${_}`, D = h.slice(y.length); 1059 return d(y, "hl-audio") + (D ? Y(D) : ""); 1060 }), r = r.replace(/\n/g, "<br>"), r; 1061 }, 1062 parseRichPromptToDisplay: (n) => { 1063 if (!n) return ""; 1064 let r = n; 1065 const a = t("image"), p = t("video"), i = t("element"); 1066 return r = r.replace(/<<<image_(\d+)>>>/g, `@${a}$1`), r = r.replace(/<<<video_(\d+)>>>/g, `@${p}$1`), r = r.replace(/<<<element_(\d+)>>>/g, `@${i}$1`), r = r.replace(/<<<object_(\d+)>>>/g, `@${i}$1`), r = r.replace(/<<<audio_(\d+)>>>/g, `@${t("audio")}$1`), r; 1067 }, 1068 escapeHtml: Y, 1069 escapeAttr: ie 1070 }; 1071 } 1072 const { ref: Pe, computed: Jt, nextTick: Te, watch: zs } = await E("vue"); 1073 function Hs(s) { 1074 const t = [], l = (o) => { 1075 var _a2; 1076 if (o.nodeType === Node.TEXT_NODE) { 1077 t.push(o.textContent ?? ""); 1078 return; 1079 } 1080 if (o.nodeType !== Node.ELEMENT_NODE) return; 1081 const m = o, c = (_a2 = m.getAttribute) == null ? void 0 : _a2.call(m, "data-tag"); 1082 if (c != null) { 1083 t.push(c); 1084 return; 1085 } 1086 if (m.tagName === "BR") { 1087 t.push(` 1088`); 1089 return; 1090 } 1091 for (let u = 0; u < o.childNodes.length; u++) { 1092 const n = o.childNodes[u]; 1093 n && l(n); 1094 } 1095 }; 1096 for (let o = 0; o < s.childNodes.length; o++) { 1097 const m = s.childNodes[o]; 1098 m && l(m); 1099 } 1100 return t.join(""); 1101 } 1102 function lt(s) { 1103 const t = document.getSelection(); 1104 if (!t || t.rangeCount === 0) return 0; 1105 const l = t.getRangeAt(0); 1106 let o = 0; 1107 const m = (c) => { 1108 var _a2; 1109 if (c.nodeType === Node.TEXT_NODE) { 1110 const r = (c.textContent ?? "").length; 1111 return c === l.startContainer ? (o += l.startOffset, true) : (o += r, false); 1112 } 1113 if (c.nodeType !== Node.ELEMENT_NODE) return false; 1114 const u = c, n = (_a2 = u.getAttribute) == null ? void 0 : _a2.call(u, "data-tag"); 1115 if (n != null) { 1116 if (c === l.startContainer || c.contains(l.startContainer)) { 1117 const a = document.createRange(); 1118 a.setStart(c, 0), a.setEnd(c, 0); 1119 const p = l.compareBoundaryPoints(Range.START_TO_START, a) <= 0; 1120 return o += p ? 0 : n.length, true; 1121 } 1122 return o += n.length, false; 1123 } 1124 if (u.tagName === "BR") return o += 1, false; 1125 for (let r = 0; r < c.childNodes.length; r++) { 1126 const a = c.childNodes[r]; 1127 if (a && m(a)) return true; 1128 } 1129 return false; 1130 }; 1131 for (let c = 0; c < s.childNodes.length; c++) { 1132 const u = s.childNodes[c]; 1133 if (u && m(u)) break; 1134 } 1135 return o; 1136 } 1137 function Ke(s, t) { 1138 const l = document.getSelection(); 1139 if (!l) return; 1140 let o = 0, m = null, c = 0; 1141 const u = (n) => { 1142 var _a2; 1143 if (n.nodeType === Node.TEXT_NODE) { 1144 const p = (n.textContent ?? "").length; 1145 return o + p >= t ? (m = n, c = t - o, true) : (o += p, false); 1146 } 1147 if (n.nodeType !== Node.ELEMENT_NODE) return false; 1148 const r = n, a = (_a2 = r.getAttribute) == null ? void 0 : _a2.call(r, "data-tag"); 1149 if (a != null) { 1150 if (o + a.length >= t) { 1151 m = s; 1152 const p = Array.from(s.childNodes).indexOf(n); 1153 return c = (p >= 0 ? p : 0) + (t <= o ? 0 : 1), c > s.childNodes.length && (c = s.childNodes.length), true; 1154 } 1155 return o += a.length, false; 1156 } 1157 if (r.tagName === "BR") { 1158 if (o + 1 >= t) { 1159 m = s; 1160 const p = Array.from(s.childNodes).indexOf(n);
1161 return c = t <= o ? p : p + 1, true; 1162 } 1163 return o += 1, false; 1164 } 1165 for (let p = 0; p < n.childNodes.length; p++) { 1166 const i = n.childNodes[p]; 1167 if (i && u(i)) return true; 1168 } 1169 return false; 1170 }; 1171 for (let n = 0; n < s.childNodes.length; n++) { 1172 const r = s.childNodes[n]; 1173 if (r && u(r)) break; 1174 } 1175 m || (m = s, c = s.childNodes.length); 1176 try { 1177 const n = document.createRange(); 1178 if (m === s && c <= s.childNodes.length) if (s.childNodes.length === 0) n.setStart(s, 0), n.setEnd(s, 0); 1179 else if (c <= 0) { 1180 const r = s.childNodes[0]; 1181 r ? (n.setStart(r, 0), n.setEnd(r, 0)) : (n.setStart(s, 0), n.setEnd(s, 0)); 1182 } else { 1183 const r = c - 1, a = s.childNodes[r]; 1184 a ? (n.setStartAfter(a), n.setEndAfter(a)) : (n.setStart(s, 0), n.setEnd(s, 0)); 1185 } 1186 else n.setStart(m, c), n.setEnd(m, c); 1187 l.removeAllRanges(), l.addRange(n); 1188 } catch { 1189 const n = document.createRange(); 1190 n.selectNodeContents(s), n.collapse(false), l.removeAllRanges(), l.addRange(n); 1191 } 1192 } 1193 function ze(s) { 1194 if (!s) return; 1195 const t = document.getSelection(); 1196 if (!t || t.rangeCount === 0) return; 1197 const o = t.getRangeAt(0).getBoundingClientRect(), m = s.getBoundingClientRect(), c = parseInt(getComputedStyle(s).lineHeight, 10) || 21, { clientHeight: u, scrollHeight: n, scrollTop: r } = s, a = o.top - m.top + r, p = a + c, i = r, x = r + u; 1198 let d = r; 1199 a < i ? d = a : p > x && (d = p - u), d = Math.max(0, Math.min(d, n - u)), d !== r && (s.scrollTop = d); 1200 } 1201 function Ys(s) { 1202 const { promptText: t, promptEditableRef: l, materials: o, maxLength: m = 2e3, onUpdate: c } = s, { t: u } = Ge(), { getMaterialTypeName: n, textToHighlightHtmlWithChips: r, buildAllTagsRegex: a } = xn(), p = Pe(false), i = Pe(""), x = Pe({ 1203 top: 0, 1204 left: 0 1205 }), d = Pe(0), h = Pe(0), g = Jt(() => { 1206 const e = [], f = o.videos.value, v = o.images.value, M = o.elements.value; 1207 return f.forEach((b, C) => { 1208 e.push({ 1209 type: "video", 1210 index: C + 1, 1211 id: b.id, 1212 name: u("omni.videoLabel", [ 1213 C + 1 1214 ]), 1215 thumbnail: b.thumbnail 1216 }); 1217 }), v.forEach((b, C) => { 1218 e.push({ 1219 type: "image", 1220 index: C + 1, 1221 id: b.id, 1222 name: u("omni.imageLabel", [ 1223 C + 1 1224 ]), 1225 thumbnail: b.url 1226 }); 1227 }), M.forEach((b, C) => { 1228 e.push({ 1229 type: "element", 1230 index: C + 1, 1231 id: b.id, 1232 name: b.name || u("omni.elementLabel", [ 1233 C + 1 1234 ]), 1235 thumbnail: b.thumbnail || b.frontal_image_url 1236 }); 1237 }), e; 1238 }), _ = Jt(() => { 1239 if (!i.value) return g.value; 1240 const e = i.value.toLowerCase(); 1241 return g.value.filter((f) => f.name.toLowerCase().includes(e) || D(f).toLowerCase().includes(e)); 1242 }); 1243 function y(e) { 1244 switch (e.type) { 1245 case "video": 1246 return `@${n("video")}${e.index}`; 1247 case "image": 1248 return `@${n("image")}${e.index}`; 1249 case "element": 1250 return `@${n("element")}${e.index}`; 1251 default: 1252 return `@${e.name}`; 1253 } 1254 } 1255 function D(e) { 1256 switch (e.type) { 1257 case "video": 1258 return u("omni.videoLabel", [ 1259 e.index 1260 ]); 1261 case "image": 1262 return u("omni.imageLabel", [ 1263 e.index 1264 ]); 1265 case "element": 1266 return u("omni.elementLabel", [ 1267 e.index 1268 ]); 1269 default: 1270 return e.name; 1271 } 1272 } 1273 function L(e) { 1274 return e.type === "element" ? e.name || "" : e.type === "video" ? D(e) : ""; 1275 } 1276 function $(e) { 1277 return n(e); 1278 } 1279 function w(e) { 1280 const f = l.value; 1281 if (!f) return; 1282 const v = e ? r(e, { 1283 videos: o.videos.value, 1284 images: o.images.value, 1285 elements: o.elements.value 1286 }) : ""; 1287 f.innerHTML = v, Ke(f, e.length); 1288 } 1289 function N() { 1290 const e = l.value; 1291 if (!e) return; 1292 const f = Hs(e); 1293 if (f.length > m) { 1294 t.value = f.slice(0, m), c == null ? void 0 : c(t.value), Te(() => w(t.value)); 1295 return; 1296 } 1297 t.value = f, c == null ? void 0 : c(f); 1298 } 1299 function S() { 1300 const e = l.value; 1301 if (!e) return; 1302 N(); 1303 const f = lt(e); 1304 d.value = f; 1305 const M = t.value.substring(0, f), b = M.lastIndexOf("@"); 1306 if (b !== -1) { 1307 const C = M.substring(b + 1); 1308 if (!/[\s\n]/.test(C)) { 1309 i.value = C; 1310 const O = document.getSelection(); 1311 if (O && O.rangeCount > 0) { 1312 const K = O.getRangeAt(0).getBoundingClientRect(); 1313 x.value = { 1314 top: K.bottom + 4, 1315 left: K.left 1316 }; 1317 } 1318 p.value = g.value.length > 0, h.value = 0, Te(() => ze(e)); 1319 return; 1320 } 1321 } 1322 p.value = false, i.value = "", Te(() => ze(e)); 1323 } 1324 function I(e) { 1325 const f = t.value.substring(0, d.value), v = f.lastIndexOf("@"), M = t.value.substring(d.value), b = y(e); 1326 t.value = f.substring(0, v) + b + M, c == null ? void 0 : c(t.value), p.value = false, i.value = ""; 1327 const C = v + b.length; 1328 Te(() => { 1329 const O = l.value; 1330 O && (w(t.value), O.focus(), Ke(O, C), ze(O)); 1331 }); 1332 } 1333 function B() { 1334 setTimeout(() => { 1335 p.value = false, i.value = ""; 1336 }, 150); 1337 } 1338 function V(e) { 1339 const f = y(e), v = l.value, b = v && document.activeElement === v && v ? lt(v) : t.value.length, C = t.value.slice(0, b), O = t.value.slice(b); 1340 t.value = C + f + O, c == null ? void 0 : c(t.value), d.value = b + f.length, Te(() => { 1341 w(t.value), v && (v.focus(), Ke(v, b + f.length), ze(v)); 1342 }); 1343 } 1344 zs(() => p.value ? _.value.length : 0, (e) => { 1345 e > 0 && h.value >= e && (h.value = e - 1); 1346 }); 1347 function q() { 1348 S(); 1349 } 1350 function X(e) { 1351 var _a2; 1352 e.preventDefault(); 1353 const f = ((_a2 = e.clipboardData) == null ? void 0 : _a2.getData("text/plain")) ?? ""; 1354 if (!f) return; 1355 const v = document.getSelection(); 1356 if (!l.value || !v || v.rangeCount === 0) return; 1357 const b = v.getRangeAt(0); 1358 b.deleteContents(); 1359 const C = document.createTextNode(f);
1360 b.insertNode(C), b.setStartAfter(C), b.setEndAfter(C), v.removeAllRanges(), v.addRange(b), Te(() => { 1361 N(), S(); 1362 }); 1363 } 1364 function ne(e) { 1365 var _a2; 1366 const f = l.value, v = _.value, M = v.length; 1367 if (p.value && M > 0) { 1368 if (e.key === "ArrowDown") { 1369 e.preventDefault(), h.value = (h.value + 1) % M; 1370 return; 1371 } 1372 if (e.key === "ArrowUp") { 1373 e.preventDefault(), h.value = (h.value - 1 + M) % M; 1374 return; 1375 } 1376 if (e.key === "Enter") { 1377 e.preventDefault(); 1378 const T = Math.min(h.value, M - 1), k = v[T]; 1379 k && I(k); 1380 return; 1381 } 1382 if (e.key === "Escape") { 1383 e.preventDefault(), B(); 1384 return; 1385 } 1386 } 1387 if (e.key !== "Backspace" && e.key !== "Delete" || !f) return; 1388 const b = t.value; 1389 let C = lt(f); 1390 C = Math.max(0, Math.min(C, b.length)); 1391 const O = document.getSelection(); 1392 if (O && O.rangeCount > 0 && !O.getRangeAt(0).collapsed) return; 1393 const he = a("g"), re = (T, k) => { 1394 e.preventDefault(), t.value = T, c == null ? void 0 : c(T), Te(() => { 1395 w(t.value), Ke(f, k), ze(f); 1396 }); 1397 }; 1398 if (e.key === "Backspace") { 1399 if (C <= 0) return; 1400 const k = [ 1401 ...b.substring(0, C).matchAll(he) 1402 ], H = k.length > 0 ? k[k.length - 1] : null; 1403 if ((H ? (H.index ?? 0) + (((_a2 = H[0]) == null ? void 0 : _a2.length) ?? 0) : -1) === C) { 1404 const _e = (H == null ? void 0 : H.index) ?? 0; 1405 re(b.substring(0, _e) + b.substring(C), _e); 1406 } else { 1407 const _e = C - 1; 1408 re(b.substring(0, _e) + b.substring(C), _e); 1409 } 1410 } else if (e.key === "Delete") { 1411 if (C >= b.length) return; 1412 const T = b.substring(C), k = new RegExp(`^${a("").source}`), H = T.match(k); 1413 H && H[0] ? re(b.substring(0, C) + b.substring(C + H[0].length), C) : re(b.substring(0, C) + b.substring(C + 1), C); 1414 } 1415 } 1416 return { 1417 showMentionDropdown: p, 1418 mentionPosition: x, 1419 filteredMaterials: _, 1420 mentionHighlightIndex: h, 1421 allMaterials: g, 1422 getMaterialLabel: D, 1423 getMaterialDisplaySubtitle: L, 1424 getMaterialTypeLabel: $, 1425 selectMaterial: I, 1426 insertMaterialTag: V, 1427 handlePromptInput: S, 1428 handleKeyDown: ne, 1429 handleCompositionEnd: q, 1430 handlePaste: X, 1431 closeMentionDropdown: B, 1432 renderPromptToEditable: w, 1433 syncEditableToPromptText: N 1434 }; 1435 } 1436 let Us, F, J, oe, it, Se, ct, fe, Ws, js, nl, Qt, Zs, Gs, qs, Xs, Ks, Js, Qs, ea, ta, na, oa, sa, aa, ra, la, ia, ca, ua, en, tn, Le, nn, da, ma, fa, ga, ha, _a, ut, on, sn, dt, mt, ol, He, pt, an, va, $a, ft, ya, wa, xa, ba, gt, Ca, W, ht, Ye, P, Q, se, _t, vt, sl, Z, Ta, ye, we, Sa, Da, Ma, Na, Ea, La, Oa, Ra, Ia, Ba, Va, Aa, Fa, rn, Pa, za, ge, Ha, ee, te, ce, De, Ya, ln, cn, ae, j, al, G, Ue, We, un, Ua, Wa, ja, Za, Ga, qa, Xa, Ka, Ja, Qa, er, tr, nr, or, sr, ar, rr, lr, dn, ir, cr, ur, $t, dr, mr, mn, pr, U, Je, z, Oe, fr, yt, pn, wt, xt, bt, gr, hr, _r, vr, $r, yr, wr, xr, br, kr, Cr, Tr, Sr, Dr, Mr, Nr, Er, fn, Re, Lr, Or, Rr, Ir; 1437 ({ defineComponent: Us } = await E("vue")); 1438 ({ unref: F, openBlock: J, createElementBlock: oe, createCommentVNode: it, toDisplayString: Se, normalizeClass: ct, createElementVNode: fe, renderList: Ws, Fragment: js, resolveComponent: nl, createBlock: Qt, withModifiers: Zs, normalizeStyle: Gs, Teleport: qs } = await E("vue")); 1439 Xs = { 1440 class: "prompt-input-root" 1441 }; 1442 Ks = [ 1443 "innerHTML" 1444 ]; 1445 Js = { 1446 key: 1, 1447 class: "prompt-display-placeholder" 1448 }; 1449 Qs = { 1450 key: 1, 1451 class: "relative" 1452 }; 1453 ea = { 1454 class: "prompt-container" 1455 }; 1456 ta = [ 1457 "data-placeholder" 1458 ]; 1459 na = { 1460 key: 0, 1461 class: "flex items-center justify-between text-xs text-gray-400 mt-2" 1462 }; 1463 oa = { 1464 class: "mention-header" 1465 }; 1466 sa = { 1467 class: "mention-list" 1468 }; 1469 aa = [ 1470 "onMousedown" 1471 ]; 1472 ra = { 1473 class: "mention-thumb" 1474 }; 1475 la = [ 1476 "src" 1477 ]; 1478 ia = { 1479 class: "mention-info" 1480 }; 1481 ca = { 1482 key: 0, 1483 class: "mention-name mention-name--leading" 1484 }; 1485 ua = { 1486 class: "mention-label" 1487 }; 1488 ({ ref: en, watch: tn, computed: Le, nextTick: nn, onMounted: da } = await E("vue")); 1489 ma = Us({ 1490 __name: "PromptInput", 1491 props: { 1492 mode: { 1493 default: "edit" 1494 }, 1495 modelValue: { 1496 default: "" 1497 }, 1498 placeholder: { 1499 default: "" 1500 }, 1501 maxLength: { 1502 default: 2e3 1503 }, 1504 showCount: { 1505 type: Boolean, 1506 default: true 1507 }, 1508 materials: { 1509 default: void 0 1510 } 1511 }, 1512 emits: [ 1513 "update:modelValue" 1514 ], 1515 setup(s, { expose: t, emit: l }) { 1516 const o = s, m = l, { t: c } = Ge(), { textToDisplayHtmlWithChips: u, textToHighlightHtmlWithChips: n, parseRichPromptToDisplay: r } = xn(), a = en(o.modelValue), p = en(null); 1517 tn(() => o.modelValue, ($) => { 1518 $ !== a.value && (a.value = $ ?? ""); 1519 }, { 1520 immediate: true 1521 }); 1522 const i = Le(() => { 1523 var _a2; 1524 return ((_a2 = o.materials) == null ? void 0 : _a2.videos) ?? []; 1525 }), x = Le(() => { 1526 var _a2; 1527 return ((_a2 = o.materials) == null ? void 0 : _a2.images) ?? []; 1528 }), d = Le(() => { 1529 var _a2; 1530 return ((_a2 = o.materials) == null ? void 0 : _a2.elements) ?? []; 1531 }), h = Le(() => { 1532 var _a2; 1533 return ((_a2 = o.materials) == null ? void 0 : _a2.audios) ?? []; 1534 }), g = Ys({ 1535 promptText: a, 1536 promptEditableRef: p, 1537 materials: { 1538 videos: i, 1539 images: x, 1540 elements: d, 1541 audios: h 1542 }, 1543 maxLength: o.maxLength,
1544 onUpdate: ($) => m("update:modelValue", $ ?? "") 1545 }); 1546 tn(() => o.modelValue, ($) => { 1547 o.mode === "edit" && $ !== void 0 && (a.value = $, nn(() => g.renderPromptToEditable($))); 1548 }), da(() => { 1549 o.mode === "edit" && nn(() => g.renderPromptToEditable(a.value)); 1550 }); 1551 const _ = Le(() => { 1552 var _a2, _b, _c, _d; 1553 if (o.mode !== "display") return ""; 1554 const $ = o.modelValue ?? "", w = r($), N = o.materials; 1555 return N && (((_a2 = N.videos) == null ? void 0 : _a2.length) > 0 || ((_b = N.images) == null ? void 0 : _b.length) > 0 || ((_c = N.elements) == null ? void 0 : _c.length) > 0 || ((_d = N.audios) == null ? void 0 : _d.length) > 0) && N ? n(w, { 1556 videos: N.videos, 1557 images: N.images, 1558 elements: N.elements, 1559 audios: N.audios ?? [] 1560 }) : u(w); 1561 }), y = Le(() => o.placeholder || c("omni.promptPlaceholder")); 1562 function D($) { 1563 g.insertMaterialTag($); 1564 } 1565 function L($) { 1566 g.renderPromptToEditable($); 1567 } 1568 return t({ 1569 insertMaterialTag: D, 1570 renderPromptToEditable: L 1571 }), ($, w) => { 1572 var _a2, _b, _c; 1573 const N = Ze; 1574 return J(), oe("div", Xs, [ 1575 s.mode === "display" ? (J(), oe("div", { 1576 key: 0, 1577 class: ct([ 1578 "prompt-editable prompt-editable--display", 1579 { 1580 "is-empty": !((_a2 = s.modelValue) == null ? void 0 : _a2.trim()) 1581 } 1582 ]) 1583 }, [ 1584 ((_b = s.modelValue) == null ? void 0 : _b.trim()) ? (J(), oe("div", { 1585 key: 0, 1586 class: "prompt-display-inner", 1587 innerHTML: F(_) 1588 }, null, 8, Ks)) : (J(), oe("span", Js, Se(F(y)), 1)) 1589 ], 2)) : (J(), oe("div", Qs, [ 1590 fe("div", ea, [ 1591 fe("div", { 1592 ref_key: "promptEditableRef", 1593 ref: p, 1594 contenteditable: "true", 1595 class: "prompt-editable", 1596 "data-placeholder": F(y), 1597 onInput: w[0] || (w[0] = (S) => F(g).handlePromptInput()), 1598 onKeydown: w[1] || (w[1] = (S) => F(g).handleKeyDown(S)), 1599 onCompositionend: w[2] || (w[2] = (S) => F(g).handleCompositionEnd()), 1600 onPaste: w[3] || (w[3] = (S) => F(g).handlePaste(S)), 1601 onBlur: w[4] || (w[4] = (S) => F(g).closeMentionDropdown()) 1602 }, null, 40, ta), 1603 s.showCount ? (J(), oe("div", na, [ 1604 fe("span", null, Se(((_c = F(a)) == null ? void 0 : _c.length) ?? 0) + "/" + Se(s.maxLength), 1) 1605 ])) : it("", true) 1606 ]), 1607 (J(), Qt(qs, { 1608 to: "body" 1609 }, [ 1610 F(g).showMentionDropdown && F(g).filteredMaterials.length > 0 ? (J(), oe("div", { 1611 key: 0, 1612 class: "mention-dropdown", 1613 style: Gs({ 1614 top: F(g).mentionPosition.top + "px", 1615 left: F(g).mentionPosition.left + "px" 1616 }) 1617 }, [ 1618 fe("div", oa, Se(F(c)("omni.selectMaterialRef")), 1), 1619 fe("div", sa, [ 1620 (J(true), oe(js, null, Ws(F(g).filteredMaterials, (S, I) => { 1621 var _a3; 1622 return J(), oe("div", { 1623 key: S.id, 1624 class: ct([ 1625 "mention-item", 1626 { 1627 "mention-item-active": I === F(g).mentionHighlightIndex 1628 } 1629 ]), 1630 onMousedown: Zs((B) => F(g).selectMaterial(S), [ 1631 "prevent" 1632 ]) 1633 }, [ 1634 fe("div", ra, [ 1635 S.thumbnail ? (J(), oe("img", { 1636 key: 0, 1637 src: S.thumbnail, 1638 class: "w-full h-full object-cover" 1639 }, null, 8, la)) : (J(), Qt(N, { 1640 key: 1, 1641 name: S.type === "video" ? "mdi:video" : S.type === "image" ? "mdi:image" : S.type === "audio" ? "mdi:music-note" : "mdi:account", 1642 size: "16" 1643 }, null, 8, [ 1644 "name" 1645 ])) 1646 ]), 1647 fe("div", ia, [ 1648 F(g).getMaterialDisplaySubtitle(S) ? (J(), oe("span", ca, Se(F(g).getMaterialDisplaySubtitle(S)), 1)) : it("", true), 1649 fe("span", ua, Se(F(g).getMaterialLabel(S)), 1) 1650 ]), 1651 fe("div", { 1652 class: ct([ 1653 "mention-type", 1654 { 1655 "bg-theme-info-100 text-theme-info dark:bg-theme-info-900/50 dark:text-theme-info-400": S.type === "video", 1656 "bg-theme-success-100 text-theme-success dar
1656k:bg-theme-success-900/50 dark:text-theme-success-400": S.type === "image", 1657 "bg-theme-secondary-100 text-theme-secondary dark:bg-theme-secondary-900/50 dark:text-theme-secondary-400": S.type === "element", 1658 "bg-theme-warning-100 text-theme-warning dark:bg-theme-warning-900/50 dark:text-theme-warning-400": S.type === "audio" 1659 } 1660 ]) 1661 }, Se((_a3 = F(g)) == null ? void 0 : _a3.getMaterialTypeLabel(S.type)), 3) 1662 ], 42, aa); 1663 }), 128)) 1664 ]) 1665 ], 4)) : it("", true) 1666 ])) 1667 ])) 1668 ]); 1669 }; 1670 } 1671 }); 1672 pa = Object.assign(je(ma, [ 1673 [ 1674 "__scopeId", 1675 "data-v-dfb89554" 1676 ] 1677 ]), { 1678 __name: "AiPromptInput" 1679 }); 1680 ({ unref: fa } = await E("vue")); 1681 ({ useModel: ga, mergeModels: ha, defineComponent: _a } = await E("vue")); 1682 ({ toDisplayString: ut, vShow: on, withDirectives: sn, openBlock: dt, createElementBlock: mt, createCommentVNode: ol, unref: He, createElementVNode: pt, createVNode: an, normalizeClass: va, withCtx: $a } = await E("vue")); 1683 ({ computed: ft } = await E("vue")); 1684 ya = { 1685 class: "flex flex-row justify-center align-center w-full h-full" 1686 }; 1687 wa = { 1688 class: "text-center" 1689 }; 1690 xa = { 1691 key: 1, 1692 class: "text-caption font-weight-medium" 1693 }; 1694 ba = _a({ 1695 __name: "ProgressBarMulte", 1696 props: ha({ 1697 id: {}, 1698 taskStatus: {} 1699 }, { 1700 enable: { 1701 default: true 1702 }, 1703 enableModifiers: {} 1704 }), 1705 emits: [ 1706 "update:enable" 1707 ], 1708 setup(s) { 1709 const t = En(), { localTasks: l } = Ln(On()), o = s, m = ft(() => l.value.find((r) => r._id === o.id) || {}), c = ga(s, "enable"), u = ft(() => m.value.progress ? `${m.value.progress}%` : "0%"), n = ft(() => { 1710 var _a2; 1711 return m.value.queue && m.value.queue > 0 ? `${R("draw.currentQueue")}: ${m.value.queue} ${R("draw.estimatedTime")}: ${m.value.remainingTime}s` : m.value.queue && m.value.progress && m.value.progress > 0 && m.value.progress < 100 ? `${R("draw.estimatedTime")}: ${m.value.remainingTime}s` : m.value.remainingTime === 0 && m.value.progress === 100 ? R("draw.drawSuccess") : m.value.remainingTime && m.value.remainingTime > 0 ? R("draw.estimatedTime") + ": " + m.value.remainingTime + "s" : ((_a2 = m.value) == null ? void 0 : _a2.message) ? m.value.message : ""; 1712 }); 1713 return (r, a) => (dt(), mt("div", ya, [ 1714 pt("div", wa, [ 1715 s.taskStatus === 2 ? sn((dt(), mt("p", { 1716 key: 0, 1717 class: "text-caption font-weight-medium" 1718 }, ut(("$t" in r ? r.$t : fa(R))("draw.taskFailed")), 513)), [ 1719 [ 1720 on, 1721 c.value 1722 ] 1723 ]) : sn((dt(), mt("p", xa, [ 1724 pt("span", null, ut(He(n)), 1) 1725 ], 512)), [ 1726 [ 1727 on, 1728 c.value 1729 ] 1730 ]), 1731 an(Ct), 1732 an(vn, { 1733 "model-value": He(m).progress, 1734 rotate: 360, 1735 size: 50, 1736 width: 3, 1737 color: He(t) ? "white" : "primary" 1738 }, { 1739 default: $a(() => [ 1740 pt("span", { 1741 class: va([ 1742 He(t) ? "" : "text-black", 1743 "text-xs" 1744 ]) 1745 }, ut(He(u)), 3) 1746 ]), 1747 _: 1 1748 }, 8, [ 1749 "model-value", 1750 "color" 1751 ]) 1752 ]) 1753 ])); 1754 } 1755 }); 1756 ka = Object.assign(ba, { 1757 __name: "CommonProgressBarMulte" 1758 }); 1759 ({ unref: gt } = await E("vue")); 1760 ({ defineComponent: Ca } = await E("vue")); 1761 ({ unref: W, toDisplayString: ht, createElementVNode: Ye, openBlock: P, createElementBlock: Q, createCommentVNode: se, renderList: _t, Fragment: vt, resolveComponent: sl, createVNode: Z, isRef: Ta, withCtx: ye, createBlock: we, normalizeClass: Sa } = await E("vue")); 1762 Da = { 1763 key: 0 1764 }; 1765 Ma = { 1766 key: 0, 1767 class: "group relative" 1768 }; 1769 Na = { 1770 class: "my-2 text-caption text-warning line-clamp-1 group-hover:line-clamp-none group-hover:z-10 max-w-[1200px]" 1771 }; 1772 Ea = { 1773 key: 1 1774 }; 1775 La = [ 1776 "href" 1777 ]; 1778 Oa = { 1779 key: 2, 1780 class: "w-full" 1781 }; 1782 Ra = { 1783 key: 3, 1784 class: "group" 1785 }; 1786 Ia = { 1787 class: "text-caption font-weight-light text-theme-warning line-clamp-2 break-all group-hover:line-clamp-none" 1788 }; 1789 Ba = { 1790 class: "d-flex align-center justify-center fill-height" 1791 }; 1792 Va = { 1793 key: 5,
1794 class: "absolute bottom-2 right-2 flex opacity-0 group-hover:!opacity-100" 1795 }; 1796 Aa = { 1797 class: "absolute top-2 right-2 flex opacity-0 group-hover:!opacity-100 transition-opacity duration-200 bg-theme-surface rounded" 1798 }; 1799 ({ toRef: Fa, computed: rn } = await E("vue")); 1800 Pa = Ca({ 1801 __name: "TaskResult", 1802 props: { 1803 task: {}, 1804 classWhenTrue: { 1805 default: "md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-2" 1806 }, 1807 classWhenFalse: { 1808 default: "md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4" 1809 }, 1810 classTrueImageNum: { 1811 default: 3 1812 } 1813 }, 1814 setup(s) { 1815 const t = s, { normalizedOutputContent: l, fileOutput: o, textOutput: m, outputWithOutFile: c, noMediaInfo: u, isMediaType: n } = ro(Fa(t, "task")), r = (_) => { 1816 var _a2, _b; 1817 const y = Object.keys(_.params || {}).find((D) => zn.some((L) => D.startsWith(L))); 1818 if (y === "multi_image_path") { 1819 const D = (_a2 = _.params) == null ? void 0 : _a2[y]; 1820 return Hn(D)[0]; 1821 } 1822 return (_b = _.params) == null ? void 0 : _b[y]; 1823 }, a = (_) => { 1824 var _a2, _b; 1825 (_b = _.dataTransfer) == null ? void 0 : _b.setData("text/plain", ((_a2 = _.target) == null ? void 0 : _a2.src) ?? ""); 1826 }, { locale: p } = Ge(), i = rn(() => p.value === "zh-CN"), x = rn(() => l.value.some((_) => _.type === "3d" || _.type === "video" || _.type === "audio")), d = (_, y) => { 1827 const L = (_ === t.task ? l.value : lo(_)).filter(($) => $ && n($.type)).map(($) => $.url); 1828 Yn(L, y); 1829 }, h = Rn(), g = (_) => { 1830 const y = yn(); 1831 window.open(`${h.value.popShopUrl}?assets=${_}&username=${y.value.username}`, "_blank"); 1832 }; 1833 return (_, y) => { 1834 var _a2, _b, _c, _d, _e; 1835 const D = Ze, L = In, $ = ka, w = Vn, N = An, S = Pn, I = gn, B = $n, V = no, q = oo, X = so, ne = ao; 1836 return s.task ? (P(), Q("div", Da, [ 1837 (s.task.status === 2 || s.task.status === 3) && s.task.message && W(i) ? (P(), Q("div", Ma, [ 1838 Ye("p", Na, ht(s.task.message), 1) 1839 ])) : se("", true), 1840 W(o) && W(o).length > 0 ? (P(), Q("div", Ea, [ 1841 (P(true), Q(vt, null, _t(W(o), (e) => (P(), Q("span", { 1842 key: e.url, 1843 class: "flex items-center justify-start text-center text-sm cursor-pointer" 1844 }, [ 1845 Z(D, { 1846 name: "mdi:file-document-outline", 1847 class: "w-4 h-4" 1848 }), 1849 Ye("a", { 1850 href: e.url, 1851 download: "", 1852 class: "hover:underline hover:text-blue-500" 1853 }, ht(e.name), 9, La) 1854 ]))), 128)) 1855 ])) : se("", true), 1856 W(m) && ((_a2 = s.task) == null ? void 0 : _a2.status) === 1 ? (P(), Q("div", Oa, [ 1857 Z(L, { 1858 value: W(m), 1859 "onUpdate:value": y[0] || (y[0] = (e) => Ta(m) ? m.value = e : null), 1860 "auto-size": { 1861 minRows: 3, 1862 maxRows: 6 1863 }, 1864 rows: 3 1865 }, null, 8, [ 1866 "value" 1867 ]) 1868 ])) : se("", true), 1869 W(u) ? (P(), Q("div", Ra, [ 1870 Ye("span", Ia, ht(W(u)), 1) 1871 ])) : (P(), Q("div", { 1872 key: 4, 1873 class: Sa([ 1874 "grid gap-1 mt-2", 1875 W(c) && ((_b = W(c)) == null ? void 0 : _b.length) && W(c).length < s.classTrueImageNum || s.task.status !== 1 && (((_c = s.task.params) == null ? void 0 : _c.batch_size) ?? 1) < s.classTrueImageNum || W(x) ? s.classWhenTrue : s.classWhenFalse 1876 ]) 1877 }, [ 1878 ((_d = s.task) == null ? void 0 : _d.status) !== 1 && W(l).length === 0 ? (P(true), Q(vt, { 1879 key: 0 1880 }, _t(((_e = s.task.params) == null ? void 0 : _e.batch_size) || 1, (e) => { 1881 var _a3; 1882 return P(), Q("div", { 1883 key: e, 1884 class: "min-h-64 border rounded" 1885 }, [ 1886 Z($, { 1887 id: ((_a3 = s.task) == null ? void 0 : _a3._id
1887) || "", 1888 class: "rounded-lg aspect-square", 1889 "task-status": s.task.status || 0 1890 }, null, 8, [ 1891 "id", 1892 "task-status" 1893 ]) 1894 ]); 1895 }), 128)) : se("", true), 1896 (P(true), Q(vt, null, _t(W(c) || [], (e, f) => (P(), Q("div", { 1897 key: (e == null ? void 0 : e.url) ?? f, 1898 class: "flex justify-center align-center relative group w-full h-full aspect-square bg-neutral-100 dark:bg-neutral-800 rounded-lg hover:border-neutral-300 dark:hover:border-neutral-500 hover:border" 1899 }, [ 1900 e.type === "image" && e.url ? (P(), we(Bn, { 1901 key: e.url, 1902 draggable: "", 1903 class: "cursor-pointer rounded", 1904 src: e.url, 1905 "lazy-src": e.url, 1906 onDragstart: a, 1907 onClick: (v) => d(s.task, f) 1908 }, { 1909 placeholder: ye(() => [ 1910 Ye("div", Ba, [ 1911 Z(vn, { 1912 color: "grey-lighten-4", 1913 indeterminate: "" 1914 }) 1915 ]) 1916 ]), 1917 _: 1 1918 }, 8, [ 1919 "src", 1920 "lazy-src", 1921 "onClick" 1922 ])) : e.type === "video" ? (P(), we(w, { 1923 key: 1, 1924 class: "mx-auto my-auto h-full", 1925 src: e.url, 1926 onDragstart: a 1927 }, null, 8, [ 1928 "src" 1929 ])) : e.type === "3d" ? (P(), we(N, { 1930 key: 2, 1931 "mouse-enter-stop-rotation": true, 1932 class: "mx-auto w-full h-full", 1933 src: e.url 1934 }, null, 8, [ 1935 "src" 1936 ])) : e.type === "audio" ? (P(), we(Fn, { 1937 key: 3, 1938 src: e.url, 1939 "lyric-data": e.content 1940 }, null, 8, [ 1941 "src", 1942 "lyric-data" 1943 ])) : se("", true), 1944 e.type === "image" || e.type === "video" ? (P(), we(S, { 1945 key: 4, 1946 src: e.url, 1947 class: "text-gray-200 dark:text-gray-300 bg-neutral-500/50 px-1 py-0.5 rounded opacity-0 group-hover:!opacity-100 transition-opacity duration-200" 1948 }, null, 8, [ 1949 "src" 1950 ])) : se("", true), 1951 W(h).popShopUrl && e.type === "image" ? (P(), Q("div", Va, [ 1952 Z(B, { 1953 title: "\u53BB\u5546\u57CE\u4E0B\u5355", 1954 placement: "top" 1955 }, { 1956 default: ye(() => [ 1957 Z(I, { 1958 class: "rounded bg-theme-surface border-none shadow-none flex justify-center items-center gap-1", 1959 onClick: (v) => g(e.url) 1960 }, { 1961 icon: ye(() => [ 1962 Z(D, { 1963 name: "material-symbols:add-shopping-cart-rounded", 1964 size: "16" 1965 }) 1966 ]), 1967 _: 1 1968 }, 8, [ 1969 "onClick" 1970 ]) 1971 ]), 1972 _: 2 1973 }, 1024) 1974 ])) : se("", true), 1975 Ye("div", Aa, [ 1976 r(s.task) && e.type === "image" ? (P(), we(V, { 1977 key: 0, 1978 input: r(s.task) ?? "", 1979 output: e.url ?? "" 1980 }, null, 8, [ 1981 "input", 1982 "output" 1983 ])) : se("", true), 1984 Z(B, { 1985 title: ("$t" in _ ? _.$t : gt(R))("common.download") 1986 }, { 1987 default: ye(() => [ 1988 Z(q, { 1989 class: "hover:bg-slate-200 dark:hover:bg-neutral-700", 1990 output: e.url 1991 }, null, 8, [ 1992 "output" 1993 ]) 1994 ]), 1995 _: 2 1996 }, 1032, [ 1997 "title" 1998 ]), 1999 Z(Mt, { 2000 "feature-key": W(Nt).DownloadSvg 2001 }, { 2002 default: ye(() => [ 2003 Z(B, { 2004 title: ("$t" in _ ? _.$t : gt(R))("common.downloadSvg") 2005 }, { 2006 default: ye(() => [ 2007 e.type === "image" ? (P(), we(X, { 2008 key: 0, 2009 class: "hover:bg-slate-200 dark:hover:bg-neutral-700", 2010 output: e.url 2011 }, null, 8, [ 2012 "output" 2013 ])) : se("", true) 2014 ]), 2015 _: 2 2016 }, 1032, [ 2017 "title" 2018 ]) 2019 ]), 2020 _: 2 2021 }, 1032, [ 2022 "feature-key" 2023 ]), 2024 Z(Mt, { 2025 "feature-key": W(Nt).DownloadExr 2026 }, { 2027 default: ye(() => [ 2028 Z(B, { 2029 title: ("$t" in _ ? _.$t : gt(R))("common.downloadExr") 2030 }, { 2031 default: ye(() => [ 2032 e.type === "image" ? (P(), we(ne, { 2033 key: 0, 2034 class: "hover:bg-slate-200 dark:hover:bg-neutral-700", 2035 output: e.url 2036 }, null, 8, [ 2037 "output" 2038 ])) : se("", true) 2039 ]), 2040 _: 2 2041 }, 1032, [ 2042 "title" 2043 ]) 2044 ]), 2045 _: 2 2046 }, 1032, [ 2047 "feature-key" 2048 ]) 2049 ]) 2050 ]))), 128)), 2051 Z(Ct) 2052 ], 2)) 2053 ])) : se("", true); 2054 }; 2055 } 2056 }); 2057 za = Object.assign(Pa, { 2058 __name: "AiDrawRecordTaskResult" 2059 }); 2060 ({ unref: ge } = await E("vue")); 2061 ({ defineComponent: Ha } = await E("vue")); 2062 ({ unref: ee, openBlock: te, createElementBlock: ce, createCommentVNode: De, renderSlot: Ya, renderList: ln, Fragment: cn, toDisplayString: ae, createElementVNode: j, resolveComponent: al, createVNode: G, createTextVNode: Ue, withCtx: We, createBlock: un, vShow: Ua, withDirectives: Wa } = await E("vue")); 2063 ja = { 2064 class: "flex flex-col w-full justify-start" 2065 }; 2066 Za = { 2067 class: "text-lg font-bold" 2068 }; 2069 Ga = { 2070 class: "flex w-full" 2071 }; 2072 qa = { 2073 class: "flex-1" 2074 }; 2075 Xa = { 2076 class: "text-caption" 2077 }; 2078 Ka = { 2079 class: "text-caption" 2080 }; 2081 Ja = { 2082 key: 0, 2083 class: "text-caption mx-1.5" 2084 }; 2085 Qa = { 2086 key: 1, 2087 class: "text-caption" 2088 }; 2089 er = { 2090 class: "flex align-center gap-1" 2091 }; 2092 tr = [ 2093 "onClick" 2094 ]; 2095 nr = [ 2096 "onClick" 2097 ]; 2098 or = [ 2099 "onClick" 2100 ]; 2101 sr = [ 2102 "onClick" 2103 ]; 2104 ar = [ 2105 "onClick" 2106 ]; 2107 rr = { 2108 key: 0, 2109 class: "group relative prompt-row prompt-row--hover-expand" 2110 }; 2111 lr = { 2112 class: "text-caption font-weight-light prompt-label" 2113 }; 2114 ({ useTemplateRef: dn, onMounted: ir, nextTick: cr, onUnmounted: ur, ref: $t, inject: dr } = await E("vue")); 2115 mr = Ha({ 2116 __name: "index", 2117 props: { 2118 reverseSort: { 2119 type: Boolean, 2120 default: false 2121 },
2122 drawSameCallbackPath: { 2123 default: null 2124 } 2125 }, 2126 setup(s) { 2127 const { t } = Ge(), { handleCancelTask: l, handleRemoveTask: o, handleGenerateAgain: m } = _n(), { deleteHistoryById: c } = It(), { drawSameWork: u } = It(), { filteredTaskComputeRef: n, groupedTaskComputeRef: r, reverseSort: a, visibleCount: p, startWatchFilterChange: i, loadNextPageRemoteTasks: x } = hn(), d = s; 2128 a.value = d.reverseSort; 2129 const h = dn("bottomRef"); 2130 let g; 2131 ir(() => { 2132 Rt(h, async ([{ isIntersecting: e }]) => { 2133 console.log("\u89E6\u53D1bottomRef", { 2134 isIntersecting: e, 2135 visibleCount: p.value, 2136 total: n.value.length 2137 }), e && await x(); 2138 }, { 2139 root: null, 2140 rootMargin: "0px 0px 100px 0px", 2141 threshold: 0.1 2142 }), Rt(_, async ([{ isIntersecting: e }]) => { 2143 if (console.log("\u89E6\u53D1topRef", { 2144 isIntersecting: e, 2145 visibleCount: p.value, 2146 total: n.value.length 2147 }), e && !y.value) { 2148 y.value = true; 2149 const f = document.documentElement.scrollHeight, v = window.scrollY; 2150 await x(), cr(() => { 2151 const M = document.documentElement.scrollHeight; 2152 window.scrollTo({ 2153 top: v + (M - f) 2154 }), y.value = false; 2155 }); 2156 } 2157 }, { 2158 root: null, 2159 rootMargin: "100px 0px 0px 0px", 2160 threshold: 0.1 2161 }), setTimeout(() => { 2162 D.value = true; 2163 }, 1e3), g = i(); 2164 }), ur(() => { 2165 (g == null ? void 0 : g.stop) && g.stop(); 2166 }); 2167 const _ = dn("topRef"), y = $t(false), D = $t(false), { workflows: L } = dr(Un.AllWorkFlowApps, { 2168 workflows: void 0, 2169 refreshAllWorkflows: async () => { 2170 } 2171 }), $ = (e) => { 2172 const { workflow_id: f } = e.options || {}; 2173 if (!f) return false; 2174 const v = L == null ? void 0 : L.find((M) => M._id === f); 2175 return !((v == null ? void 0 : v.appType) !== "workflow" || v.disableCancel === true); 2176 }, w = (e) => { 2177 for (const f in e.params) if ([ 2178 "positive", 2179 "prompt" 2180 ].some((v) => f.startsWith(v)) && e.params[f]) return e.params[f]; 2181 }, N = (e) => { 2182 const f = e.params || {}, v = f.multi_prompt ?? f.shots, M = Array.isArray(v) ? v : []; 2183 if (M.length === 0) return w(e); 2184 const b = []; 2185 for (let C = 0; C < M.length; C++) { 2186 const O = M[C], he = (O == null ? void 0 : O.type) === "text" && ((O == null ? void 0 : O.role) === "shot_prompt" || (O == null ? void 0 : O.shot_index) !== void 0) ? O.text ?? "" : O.text ?? O.prompt ?? "", re = t("omni.shotLabel", [ 2187 (O.shot_index ?? C) + 1 2188 ]); 2189 b.push(`${re}: ${he}`); 2190 } 2191 return b.join(` 2192`) || w(e); 2193 }, S = (e) => { 2194 for (const f in e.params) if ([ 2195 "model", 2196 "model_alias" 2197 ].some((v) => f.startsWith(v)) && e.params[f]) return e.params[f]; 2198 }; 2199 function I(e, f) { 2200 for (const v of Object.keys(e)) { 2201 if (!f(v)) continue; 2202 const M = e[v]; 2203 return Array.isArray(M) ? M : []; 2204 } 2205 return []; 2206 } 2207 function B(e) { 2208 const f = e.params || {}, M = I(f, (T) => T === "video_list" || T.endsWith("_video_list")).map((T, k) => ({ 2209 id: `v-${k}`, 2210 url: (T == null ? void 0 : T.url) ?? "", 2211 referType: (T == null ? void 0 : T.refer_type) === "base" ? Lt.BASE : Lt.FEATURE, 2212 keepSound: (T == null ? void 0 : T.keep_original_sound) === "yes", 2213 thumbnail: void 0 2214 })).filter((T) => T.url), C = I(f, (T) => T === "image_list" || T.endsWith("_image_list")).map((T, k) => ({ 2215 id: `img-${k}`, 2216 url: (T == null ? void 0 : T.url) ?? "", 2217 name: (T == null ? void 0 : T.name) || `image_${k + 1}`, 2218 frameType: T == null ? void 0 : T.type 2219 })).filter((T) => T.url), K = I(f, (T) => T === "element_list" || T.endsWith("_element_list")).filter((T) => { 2220 var _a2; 2221 return (_a2 = T == null ? void 0 : T.inline_element) == null ? void 0 : _a2.frontal_image_url; 2222 }).map((T, k) => { 2223 const H = T.inline_element, Tt = (H.refer_images || []).map((_e) => ({ 2224 url: _e.url, 2225 slot_key: _e.slot_key 2226 })); 2227 return { 2228 id: T.id || `elem-${k}`, 2229 systemId: T.id, 2230 name: H.name || T.name || `element_${k + 1}`, 2231 frontal_image_url: H.frontal_image_url, 2232 refer_images: Tt, 2233 thumbnail: H.frontal_image_url 2234 }; 2235 }), re = I(f, (T) => T === "audio_list" || T.endsWith("_audio_list")).map((T, k) => ({ 2236 id: `audio-${k}`, 2237 url: (T == null ? void 0 : T.url) || (T == null ? void 0 : T.audio_url) || "", 2238 name: (T == null ? void 0 : T.name) || `audio_${k + 1}` 2239 })).filter((T) => T.url); 2240 return { 2241 videos: M, 2242 images: C, 2243 elements: K, 2244 audios: re 2245 }; 2246 } 2247 const V = (e) => e.output_content && e.output_content.length > 0 ? e.output_content.filter((v) => v.type !== "text" && v.type !== "file").length > 1 : e.output && e.output.length >
2247 0 ? e.output.filter((v) => { 2248 if (typeof v == "string") { 2249 const M = Ot(v, e.type || "image"); 2250 return M !== "text" && M !== "file"; 2251 } 2252 return false; 2253 }).length > 1 : false, q = (e) => { 2254 const f = []; 2255 return e.output_content && e.output_content.length > 0 ? e.output_content.filter((v) => v.type !== "text" && v.type !== "file").forEach((v) => { 2256 v.url && f.push(v.url); 2257 }) : e.output && e.output.length > 0 && e.output.forEach((v) => { 2258 if (v && typeof v == "string") { 2259 const M = Ot(v, e.type || "image"); 2260 M !== "text" && M !== "file" && f.push(v); 2261 } 2262 }), f; 2263 }, X = async (e) => { 2264 const f = q(e); 2265 if (f.length === 0) { 2266 xe({ 2267 type: "error", 2268 message: t("common.noDownloadableFiles") 2269 }); 2270 return; 2271 } 2272 try { 2273 const { useFileSaveToLocal: v } = await to(async () => { 2274 const { useFileSaveToLocal: K } = await import("./S403r29x.js").then(async (m2) => { 2275 await m2.__tla; 2276 return m2; 2277 }); 2278 return { 2279 useFileSaveToLocal: K 2280 }; 2281 }, __vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]), import.meta.url), { downloadFiles: M, pickDirectory: b, status: C } = v(); 2282 M.value = f, await b(true); 2283 const O = C.value || ""; 2284 if (O.includes("\u6240\u6709\u6587\u4EF6\u5DF2\u4FDD\u5B58") || O.includes("\u6210\u529F\u4FDD\u5B58\u6587\u4EF6")) { 2285 const K = O.match(/æåä¿åæä»¶(\d+)个/), he = K ? K[1] : f.length; 2286 xe({ 2287 type: "success", 2288 message: t("common.batchDownloadComplete", { 2289 count: he 2290 }) 2291 }); 2292 } else O.includes("\u90E8\u5206\u6587\u4EF6\u4FDD\u5B58\u5931\u8D25") ? xe({ 2293 type: "warning", 2294 message: t("common.batchDownloadPartialFailure") 2295 }) : O.includes("\u5931\u8D25") || O.includes("\u9519\u8BEF") ? xe({ 2296 type: "error", 2297 message: t("common.batchDownloadFailed") 2298 }) : O && !O.includes("\u9009\u62E9\u76EE\u5F55\u88AB\u53D6\u6D88") && !O.includes("\u672A\u83B7\u53D6\u76EE\u5F55\u9009\u62E9\u6743\u9650") && xe({ 2299 type: "success", 2300 message: t("common.batchDownloadCompleteWithCount", { 2301 count: f.length 2302 }) 2303 }); 2304 } catch (v) { 2305 console.error("\u6279\u91CF\u4E0B\u8F7D\u5931\u8D25:", v); 2306 const M = (v == null ? void 0 : v.message) || ""; 2307 (v == null ? void 0 : v.name) !== "AbortError" && !M.includes("\u53D6\u6D88") && !M.includes("user gesture") && xe({ 2308 type: "error", 2309 message: t("common.batchDownloadFailed") 2310 }); 2311 } 2312 }, ne = $t(null); 2313 return (e, f) => { 2314 const v = As, M = Ze, b = $n, C = pa, O = za, K = io, he = co; 2315 return te(), ce("div", { 2316 ref_key: "scrollContainer", 2317 ref: ne, 2318 class: "flex flex-col gap-4 w-full" 2319 }, [ 2320 ee(D) && ee(a) ? (te(), ce("div", { 2321 key: 0, 2322 ref_key: "topRef", 2323 ref: _, 2324 class: "h-[1px] w-full" 2325 }, null, 512)) : De("", true), 2326 Ya(e.$slots, "default", {}, void 0, true), 2327 (te(true), ce(cn, null, ln(ee(r), (re, T) => (te(), ce("div", { 2328 key: T 2329 }, [ 2330 j("div", ja, [ 2331 j("div", Za, ae(ee(Eo)(T)), 1), 2332 (te(true), ce(cn, null, ln(re, (k) => (te(), ce("div", { 2333 key: k._id, 2334 class: "mb-4" 2335 }, [ 2336 j("div", Ga, [ 2337 G(v, { 2338 task: k 2339 }, null, 8, [ 2340 "task" 2341 ]), 2342 j("div", qa, [ 2343 G(Et, { 2344 class: "bg-transparent" 2345 }), 2346 G(Et, { 2347 class: "d-flex justify-end align-center bg-transparent flex-wrap" 2348 }, { 2349 default: We(() => { 2350 var _a2, _b; 2351 return [ 2352 j("div", null, [ 2353 G(Wn, { 2354 size: "15", 2355 class: "mr-2" 2356 }, { 2357 default: We(() => [ 2358 ...f[0] || (f[0] = [ 2359 Ue(" mdi-shimmer ", -1) 2360 ]) 2361 ]), 2362 _: 1 2363 }), 2364 j("span", Xa, ae(("$t" in e ? e.$t : ge(R))("common.workflow")) + "\uFF1A" + ae(((_a2 = k.options) == null ? void 0 : _a2.workflow_title) || ((_b = k.options) == null ? void 0 : _b.workflow_name)), 1), 2365 f[1] || (f[1] = j("span", { 2366 class: "text-caption mx-1.5" 2367 }, "|", -1)), 2368 j("span", Ka, ae(("$t" in e ? e.$t : ge(R))("draw.createdAt")) + "\uFF1A" + ae(ee(jn)((k == null ? void 0 : k.finished_at) || k.created_at)), 1), 2369 S(k) ? (te(), ce("span", Ja, "|")) : De("", true), 2370 S(k) ? (te(), ce("span", Qa, ae(("$t" in e ? e.$t : ge(R))("common.model")) + ": " + ae(S(k)), 1)) : De("", true) 2371 ]), 2372 G(Ct), 2373 j("div", er, [ 2374 j("button", { 2375 class: "flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs bg-gray-200 dark:bg-neutral-700 hover:bg-gray-300 dark:hover:bg-neutral-600 transition", 2376 onClick: (H) => ee(m)(k) 2377 }, [ 2378 G(M, { 2379 name: "mdi:cached", 2380 class: "w-4 h-4" 2381 }), 2382 Ue(" " + ae(("$t" in e ? e.$t : ge(R))("common.drawAgain")), 1) 2383 ], 8, tr), 2384 (k == null ? void 0 : k.workflow_id) ? (te(), ce("button", { 2385 key: 0, 2386 class: "flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs bg-gray-200 dark:bg-neutral-700 hover:bg-gray-300 dark:hover:bg-neutral-600 transition", 2387 onClick: (H) => { 2388 var _a3; 2389 return ee(u)({ 2390 workflow_name: (_a3 = k.options) == null ? void 0 : _a3.workflow_name, 2391 workflow_id: k == null ? void 0 : k.workflow_id, 2392 params: k.params, 2393 taskId: k._id,
2394 callbackPath: s.drawSameCallbackPath 2395 }); 2396 } 2397 }, [ 2398 G(M, { 2399 name: "mdi:creation", 2400 class: "w-4 h-4" 2401 }), 2402 Ue(" " + ae(("$t" in e ? e.$t : ge(R))("common.drawSimilar")), 1) 2403 ], 8, nr)) : De("", true), 2404 V(k) ? (te(), un(b, { 2405 key: 1, 2406 title: ("$t" in e ? e.$t : ge(R))("common.batchDownload") 2407 }, { 2408 default: We(() => [ 2409 j("button", { 2410 class: "flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs bg-gray-200 dark:bg-neutral-700 hover:bg-gray-300 dark:hover:bg-neutral-600 transition", 2411 onClick: (H) => X(k) 2412 }, [ 2413 G(M, { 2414 name: "mdi:download-multiple", 2415 class: "w-4 h-4" 2416 }), 2417 Ue(" " + ae(("$t" in e ? e.$t : ge(R))("common.batchDownload")), 1) 2418 ], 8, or) 2419 ]), 2420 _: 2 2421 }, 1032, [ 2422 "title" 2423 ])) : De("", true), 2424 k.status === 0 && $(k) ? (te(), un(b, { 2425 key: 2, 2426 title: ("$t" in e ? e.$t : ge(R))("draw.cancelTask") 2427 }, { 2428 default: We(() => [ 2429 j("button", { 2430 class: "flex items-center gap-2 px-3 py-2 rounded-lg text-xs bg-gray-200 dark:bg-neutral-700 hover:bg-gray-300 dark:hover:bg-neutral-600 transition", 2431 onClick: (H) => ee(l)(k) 2432 }, [ 2433 G(M, { 2434 name: "mdi:cancel", 2435 class: "w-4 h-4" 2436 }) 2437 ], 8, sr) 2438 ]), 2439 _: 2 2440 }, 1032, [ 2441 "title" 2442 ])) : De("", true), 2443 j("button", { 2444 class: "flex items-center gap-2 px-3 py-2 rounded-lg text-xs bg-gray-200 dark:bg-neutral-700 hover:bg-gray-300 dark:hover:bg-neutral-600 transition", 2445 onClick: (H) => ee(c)(k._id || "").then(() => ee(o)(k._id)) 2446 }, [ 2447 G(M, { 2448 name: "mdi:delete", 2449 class: "w-4 h-4" 2450 }) 2451 ], 8, ar) 2452 ]) 2453 ]; 2454 }), 2455 _: 2 2456 }, 1024), 2457 N(k) ? (te(), ce("div", rr, [ 2458 j("span", lr, ae(("$t" in e ? e.$t : ge(R))("common.prompts")) + ": ", 1), 2459 G(C, { 2460 mode: "display", 2461 "model-value": N(k), 2462 materials: B(k), 2463 class: "prompt-display-inline" 2464 }, null, 8, [ 2465 "model-value", 2466 "materials" 2467 ]) 2468 ])) : De("", true) 2469 ]) 2470 ]), 2471 G(O, { 2472 task: k, 2473 "class-when-true": "md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-2", 2474 "class-when-false": "md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4", 2475 "class-true-image-num": 3 2476 }, null, 8, [ 2477 "task" 2478 ]) 2479 ]))), 128)) 2480 ]) 2481 ]))), 128)), 2482 Wa(j("div", { 2483 ref_key: "bottomRef", 2484 ref: h, 2485 class: "h-2 w-full invisible" 2486 }, [ 2487 G(K, { 2488 orientation: "center", 2489 plain: "" 2490 }, { 2491 default: We(() => [ 2492 ...f[2] || (f[2] = [ 2493 Ue(" \u2014\u2014 \u5DF2\u7ECF\u5230\u5E95\u5566 \u2014\u2014 ", -1) 2494 ]) 2495 ]), 2496 _: 1 2497 }) 2498 ], 512), [ 2499 [ 2500 Ua, 2501 ee(D) 2502 ] 2503 ]), 2504 G(he, { 2505 "scroll-target": ee(ne) 2506 }, null, 8, [ 2507 "scroll-target" 2508 ]) 2509 ], 512); 2510 }; 2511 } 2512 }); 2513 rl = Object.assign(je(mr, [ 2514 [ 2515 "__scopeId", 2516 "data-v-8d09e927" 2517 ] 2518 ]), { 2519 __name: "AiDrawRecord" 2520 }); 2521 ({ withAsyncContext: mn, defineComponent: pr } = await E("vue")); 2522 ({ unref: U, normalizeClass: Je, createElementVNode: z, toDisplayString: Oe, createTextVNode: fr, withCtx: yt, createVNode: pn, openBlock: wt, createElementBlock: xt, createCommentVNode: bt, isRef: gr } = await E("vue")); 2523 hr = { 2524 key: 0, 2525 class: "flex items-center space-x-3 absolute z-50" 2526 }; 2527 _r = { 2528 class: "text-sm text-gray-800 dark:text-gray-200" 2529 }; 2530 vr = { 2531 class: "flex items-center space-x-3 my-3" 2532 }; 2533 $r = { 2534 class: "text-xl font-bold text-gray-800 dark:text-slate-100" 2535 }; 2536 yr = { 2537 class: "grid grid-cols-1 gap-6 mb-6 text-gray-600" 2538 }; 2539 wr = { 2540 key: 0, 2541 class: "space-y-1" 2542 }; 2543 xr = { 2544 class: "text-sm font-mono bg-gray-100 p-2 rounded-md truncate" 2545 }; 2546 br = { 2547 key: 1, 2548 class: "space-y-1" 2549 }; 2550 kr = { 2551 class: "text-sm font-mono bg-gray-100 p-2 rounded-md truncate" 2552 }; 2553 Cr = { 2554 class: "space-y-1 dark:text-gray-200" 2555 }; 2556 Tr = { 2557 class: "text-sm text-gray-500 font-medium dark:text-gray-400" 2558 }; 2559 Sr = { 2560 class: "space-y-1 dark:text-gray-200" 2561 }; 2562 Dr = { 2563 class: "text-sm text-gray-500 font-medium dark:text-gray-400" 2564 }; 2565 Mr = { 2566 class: "flex flex-col md:flex-row space-y-3 md:space-y-0 md:space-x-3 mt-8" 2567 }; 2568 Nr = [ 2569 "disabled" 2570 ]; 2571 Er = [ 2572 "disabled" 2573 ]; 2574 ({ ref: fn, computed: Re, onBeforeUnmount: Lr, onMounted: Or, watch: Rr } = await E("vue")); 2575 Ir = pr({ 2576 __name: "CloseServer", 2577 async setup(s) { 2578 let t, l; 2579 const { handleCloseService: o } = mo(), m = yn(), { data: c, execute: u } = ([t, l] = mn(() => Zn(`/draw/server/exclusive/config/${m.value._id}`, { 2580 method: "GET" 2581 })), t = await t, l(), t); 2582 [t, l] = mn(() =>
2582 u()), await t, l(); 2583 const n = fn({ 2584 server: { 2585 deployment_container_uuid: "", 2586 http_url: "" 2587 }, 2588 status: "notStarted", 2589 expense: { 2590 expenseId: "", 2591 runTime: "", 2592 deductedPower: 0, 2593 balance: 0, 2594 remainingTime: "" 2595 } 2596 }), r = Re(() => { 2597 switch (n.value.status) { 2598 case A.running: 2599 case A.starting: 2600 return "bg-green-500"; 2601 case A.deploying: 2602 return "bg-yellow-500"; 2603 case A.shutdown: 2604 case A.destroyed: 2605 return "bg-gray-500"; 2606 case A.error: 2607 return "bg-red-500"; 2608 default: 2609 return "bg-gray-400"; 2610 } 2611 }), a = Re(() => { 2612 switch (n.value.status) { 2613 case A.notStarted: 2614 return "\u672A\u542F\u52A8"; 2615 case A.deploying: 2616 return "\u90E8\u7F72\u4E2D"; 2617 case A.starting: 2618 return "\u542F\u52A8\u4E2D"; 2619 case A.running: 2620 return "\u8FD0\u884C\u4E2D"; 2621 case A.shutdown: 2622 return "\u5DF2\u5173\u673A"; 2623 case A.destroyed: 2624 return "\u5DF2\u9500\u6BC1"; 2625 case A.error: 2626 return "\u9519\u8BEF"; 2627 default: 2628 return "\u672A\u77E5\u72B6\u6001"; 2629 } 2630 }), p = Re(() => [ 2631 A.notStarted 2632 ].includes(n.value.status) && c.value.manual_deploy); 2633 Re(() => [ 2634 A.running, 2635 A.starting 2636 ].includes(n.value.status)); 2637 const i = Re(() => [ 2638 A.shutdown, 2639 A.error, 2640 A.running 2641 ].includes(n.value.status)); 2642 Re(() => [ 2643 A.shutdown, 2644 A.error 2645 ].includes(n.value.status)); 2646 const x = async () => { 2647 await qn("/draw/server/exclusive/deploy", { 2648 method: "POST" 2649 }) && xe({ 2650 message: "\u90E8\u7F72\u6210\u529F", 2651 type: "success" 2652 }); 2653 }, d = () => { 2654 i.value && (console.log("\u9500\u6BC1\u5B9E\u4F8B"), o(n.value.server._id)); 2655 }, h = new AbortController(), g = h.signal; 2656 Lr(() => { 2657 h.abort(); 2658 }); 2659 const _ = () => { 2660 Xn("/draw/server/exclusive/status", { 2661 signal: g 2662 }).pipe(po((w) => w.trim().length > 0), Kn((w) => { 2663 try { 2664 return JSON.parse(w); 2665 } catch (N) { 2666 return console.error("Failed to parse JSON:", N), null; 2667 } 2668 }), fo((w) => w && w.status !== "complete")).subscribe({ 2669 next: (w) => { 2670 var _a2, _b; 2671 console.log("Received data:", w), n.value = { 2672 ...w 2673 }, ((_a2 = w == null ? void 0 : w.expense) == null ? void 0 : _a2.balance) && Jn({ 2674 balance: (_b = w == null ? void 0 : w.expense) == null ? void 0 : _b.balance 2675 }); 2676 }, 2677 error: (w) => { 2678 console.error("SSE Error:", w), xe({ 2679 message: w.message, 2680 type: "error" 2681 }); 2682 }, 2683 complete: () => { 2684 console.log("SSE stream completed."); 2685 } 2686 }); 2687 }, y = fn(false), D = () => { 2688 y.value = true; 2689 }; 2690 return Or(() => { 2691 c.value && c.value.isExclusiveDeploy && _(), Rr(() => { 2692 var _a2; 2693 return (_a2 = c.value) == null ? void 0 : _a2.isExclusiveDeploy; 2694 }, (L) => { 2695 L && _(); 2696 }); 2697 }), (L, $) => { 2698 var _a2; 2699 return ((_a2 = U(c)) == null ? void 0 : _a2.isExclusiveDeploy) ? (wt(), xt("div", hr, [ 2700 z("div", { 2701 class: Je([ 2702 U(r), 2703 "w-4 h-4 rounded-full animate-pulse" 2704 ]) 2705 }, null, 2), 2706 z("h2", _r, " \u670D\u52A1\u5668\u72B6\u6001\uFF1A" + Oe(U(a)), 1), 2707 pn(Gn, { 2708 variant: "tonal", 2709 size: "small", 2710 onClick: D 2711 }, { 2712 default: yt(() => [ 2713 ...$[1] || ($[1] = [ 2714 fr(" \u67E5\u770B\u8BE6\u60C5 ", -1) 2715 ]) 2716 ]), 2717 _: 1 2718 }), 2719 pn(uo, { 2720 modelValue: U(y), 2721 "onUpdate:modelValue": $[0] || ($[0] = (w) => gr(y) ? y.value = w : null),
2722 configs: { 2723 icon: "", 2724 title: "" 2725 }, 2726 "show-action": false 2727 }, { 2728 title: yt(() => [ 2729 z("div", vr, [ 2730 z("div", { 2731 class: Je([ 2732 U(r), 2733 "w-4 h-4 rounded-full animate-pulse" 2734 ]) 2735 }, null, 2), 2736 z("h2", $r, " \u670D\u52A1\u5668\u72B6\u6001\uFF1A" + Oe(U(a)), 1) 2737 ]) 2738 ]), 2739 default: yt(() => { 2740 var _a3, _b, _c, _d; 2741 return [ 2742 z("div", null, [ 2743 $[6] || ($[6] = z("hr", { 2744 class: "my-2 border-gray-200" 2745 }, null, -1)), 2746 z("div", yr, [ 2747 U(c).show_api_url ? (wt(), xt("div", wr, [ 2748 $[2] || ($[2] = z("div", { 2749 class: "font-semibold dark:text-gray-200" 2750 }, " \u670D\u52A1\u5668\u5730\u5740: ", -1)), 2751 z("div", xr, Oe(((_a3 = U(n).server) == null ? void 0 : _a3.http_url) ?? "\u6682\u65E0"), 1) 2752 ])) : bt("", true), 2753 U(c).show_api_url ? (wt(), xt("div", br, [ 2754 $[3] || ($[3] = z("div", { 2755 class: "font-semibold dark:text-gray-200" 2756 }, " \u5B9E\u4F8BID: ", -1)), 2757 z("div", kr, Oe(((_b = U(n).server) == null ? void 0 : _b.deployment_container_uuid) ?? "\u6682\u65E0"), 1) 2758 ])) : bt("", true), 2759 z("div", Cr, [ 2760 $[4] || ($[4] = z("div", { 2761 class: "font-semibold" 2762 }, " \u7D2F\u8BA1\u5F00\u673A\u65F6\u95F4: ", -1)), 2763 z("div", Tr, Oe(((_c = U(n).expense) == null ? void 0 : _c.runTime) ?? "00:00:00"), 1) 2764 ]), 2765 z("div", Sr, [ 2766 $[5] || ($[5] = z("div", { 2767 class: "font-semibold" 2768 }, " \u9884\u8BA1\u53EF\u7528\u65F6\u95F4: ", -1)), 2769 z("div", Dr, Oe(((_d = U(n).expense) == null ? void 0 : _d.remainingTime) ?? "00:00:00"), 1) 2770 ]) 2771 ]), 2772 z("div", Mr, [ 2773 z("button", { 2774 disabled: !U(p), 2775 class: Je([ 2776 "flex-1 py-2 px-4 rounded-md font-semibold transition duration-150 ease-in-out", 2777 { 2778 "bg-green-500 hover:bg-green-600 text-white": U(p), 2779 "bg-gray-300 text-gray-500 cursor-not-allowed": !U(p) 2780 } 2781 ]), 2782 onClick: x 2783 }, " \u624B\u52A8\u5F00\u542F\u5B9E\u4F8B ", 10, Nr), 2784 z("button", { 2785 disabled: !U(i), 2786 class: Je([ 2787 "flex-1 py-2 px-4 rounded-md font-semibold transition duration-150 ease-in-out", 2788 { 2789 "bg-red-600 hover:bg-red-700 text-white": U(i), 2790 "bg-gray-300 text-gray-500 cursor-not-allowed": !U(i) 2791 } 2792 ]), 2793 onClick: d 2794 }, " \u9500\u6BC1\u5B9E\u4F8B ", 10, Er) 2795 ]) 2796 ]) 2797 ]; 2798 }), 2799 _: 1 2800 }, 8, [ 2801 "modelValue" 2802 ]) 2803 ])) : bt("", true); 2804 }; 2805 } 2806 }); 2807 ll = Object.assign(Ir, { 2808 __name: "AiCloseServer" 2809 }); 2810}); 2811export { 2812 Jr as _, 2813 __tla, 2814 el as a, 2815 rl as b, 2816 ll as c, 2817 ka as d, 2818 As as e, 2819 Eo as f, 2820 pa as g 2821};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.