@doderasoftware/restify-ai 0.1.0-beta.11 → 0.1.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  var Hs = Object.defineProperty;
2
2
  var Bs = (n, e, t) => e in n ? Hs(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var K = (n, e, t) => Bs(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { ref as q, nextTick as Pe, onUnmounted as bt, computed as N, onMounted as vt, watch as _e, isRef as Fs, onBeforeUnmount as Us, defineComponent as he, createElementBlock as v, openBlock as x, normalizeClass as b, renderSlot as ce, createElementVNode as h, createCommentVNode as F, Fragment as be, renderList as Fe, toDisplayString as P, createBlock as Ee, resolveDynamicComponent as nn, withCtx as Ae, createVNode as ye, normalizeStyle as cn, Transition as wt, withModifiers as tt, unref as D, withDirectives as qs, vModelText as js, createTextVNode as sn, createStaticVNode as _n, Teleport as Ws, normalizeProps as zn, guardReactiveProps as Hn, onErrorCaptured as Ks } from "vue";
3
+ var V = (n, e, t) => Bs(n, typeof e != "symbol" ? e + "" : e, t);
4
+ import { ref as U, nextTick as Pe, onUnmounted as vt, computed as N, onMounted as Tt, watch as _e, isRef as Fs, onBeforeUnmount as Us, defineComponent as he, createElementBlock as T, openBlock as k, normalizeClass as v, renderSlot as ce, createElementVNode as h, createCommentVNode as F, Fragment as be, renderList as Fe, toDisplayString as P, createBlock as Ee, resolveDynamicComponent as nn, withCtx as Ae, createVNode as ye, normalizeStyle as cn, Transition as bt, withModifiers as tt, unref as $, withDirectives as qs, vModelText as js, createTextVNode as sn, createStaticVNode as _n, Teleport as Ws, normalizeProps as zn, guardReactiveProps as Hn, onErrorCaptured as Ks } from "vue";
5
5
  import { defineStore as Vs } from "pinia";
6
6
  let Ke = null;
7
- const Gs = q(null), os = {
7
+ const Gs = U(null), os = {
8
8
  title: "AI Assistant",
9
9
  aiName: "AI Assistant",
10
10
  you: "You",
@@ -160,8 +160,8 @@ function Xs(n, e, t) {
160
160
  n(s.id = c);
161
161
  break;
162
162
  case "retry":
163
- const g = parseInt(c, 10);
164
- isNaN(g) || e(s.retry = g);
163
+ const y = parseInt(c, 10);
164
+ isNaN(y) || e(s.retry = y);
165
165
  break;
166
166
  }
167
167
  }
@@ -190,39 +190,39 @@ var er = function(n, e) {
190
190
  const rn = "text/event-stream", tr = 1e3, Un = "last-event-id";
191
191
  function nr(n, e) {
192
192
  var { signal: t, headers: s, onopen: r, onmessage: o, onclose: i, onerror: a, openWhenHidden: u, fetch: d } = e, c = er(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
193
- return new Promise((g, m) => {
193
+ return new Promise((y, x) => {
194
194
  const f = Object.assign({}, s);
195
195
  f.accept || (f.accept = rn);
196
196
  let p;
197
- function A() {
197
+ function D() {
198
198
  p.abort(), document.hidden || z();
199
199
  }
200
- u || document.addEventListener("visibilitychange", A);
201
- let k = tr, y = 0;
202
- function S() {
203
- document.removeEventListener("visibilitychange", A), window.clearTimeout(y), p.abort();
200
+ u || document.addEventListener("visibilitychange", D);
201
+ let g = tr, m = 0;
202
+ function C() {
203
+ document.removeEventListener("visibilitychange", D), window.clearTimeout(m), p.abort();
204
204
  }
205
205
  t == null || t.addEventListener("abort", () => {
206
- S(), g();
206
+ C(), y();
207
207
  });
208
- const E = d ?? window.fetch, T = r ?? sr;
208
+ const S = d ?? window.fetch, b = r ?? sr;
209
209
  async function z() {
210
- var U;
210
+ var q;
211
211
  p = new AbortController();
212
212
  try {
213
- const J = await E(n, Object.assign(Object.assign({}, c), { headers: f, signal: p.signal }));
214
- await T(J), await Zs(J.body, Ys(Xs((C) => {
215
- C ? f[Un] = C : delete f[Un];
216
- }, (C) => {
217
- k = C;
218
- }, o))), i == null || i(), S(), g();
219
- } catch (J) {
213
+ const G = await S(n, Object.assign(Object.assign({}, c), { headers: f, signal: p.signal }));
214
+ await b(G), await Zs(G.body, Ys(Xs((A) => {
215
+ A ? f[Un] = A : delete f[Un];
216
+ }, (A) => {
217
+ g = A;
218
+ }, o))), i == null || i(), C(), y();
219
+ } catch (G) {
220
220
  if (!p.signal.aborted)
221
221
  try {
222
- const C = (U = a == null ? void 0 : a(J)) !== null && U !== void 0 ? U : k;
223
- window.clearTimeout(y), y = window.setTimeout(z, C);
224
- } catch (C) {
225
- S(), m(C);
222
+ const A = (q = a == null ? void 0 : a(G)) !== null && q !== void 0 ? q : g;
223
+ window.clearTimeout(m), m = window.setTimeout(z, A);
224
+ } catch (A) {
225
+ C(), x(A);
226
226
  }
227
227
  }
228
228
  }
@@ -234,7 +234,7 @@ function sr(n) {
234
234
  if (!(e != null && e.startsWith(rn)))
235
235
  throw new Error(`Expected content-type to be ${rn}, Actual: ${e}`);
236
236
  }
237
- function It(n) {
237
+ function $t(n) {
238
238
  if (!n)
239
239
  throw console.error("[RestifyAi] Endpoint is undefined. Check your endpoints configuration."), new Error("AI service endpoint is not configured. Please contact support.");
240
240
  const e = te(), t = (e == null ? void 0 : e.baseUrl) || "";
@@ -272,7 +272,7 @@ function Ue(n) {
272
272
  const e = te();
273
273
  return n === "chatHistory" ? (e == null ? void 0 : e.chatHistoryKey) || "restify_ai_chat_history" : n === "setupComplete" ? "restify_ai_setup_complete" : (e == null ? void 0 : e.drawerStateKey) || "restify_ai_drawer_open";
274
274
  }
275
- function $t(n) {
275
+ function ct(n) {
276
276
  try {
277
277
  sessionStorage.setItem(Ue("chatHistory"), JSON.stringify(n));
278
278
  } catch (e) {
@@ -379,7 +379,7 @@ function jn() {
379
379
  lastError: null
380
380
  };
381
381
  }
382
- let ct = new AbortController();
382
+ let dt = new AbortController();
383
383
  const Ge = Vs("restifyAiStore", {
384
384
  state: () => {
385
385
  const n = lr(), e = dr();
@@ -443,7 +443,7 @@ const Ge = Vs("restifyAiStore", {
443
443
  let o = "", i = !1;
444
444
  const a = r.retry || {}, u = a.maxRetries ?? 0, d = a.retryDelay ?? 1e3;
445
445
  let c = 0;
446
- const g = e.map((p) => ({
446
+ const y = e.map((p) => ({
447
447
  id: p.id,
448
448
  name: p.name,
449
449
  url: p.url,
@@ -456,62 +456,62 @@ const Ge = Vs("restifyAiStore", {
456
456
  role: nt.User,
457
457
  message: n,
458
458
  loading: !1,
459
- attachments: g,
459
+ attachments: y,
460
460
  mentions: t,
461
461
  timestamp: Date.now()
462
- }), g.forEach((p) => this.registerUploadedFile(p)), $t(this.chatHistory), this.sending = !0, this.quota.remaining > 0 && !s && (this.quota.remaining--, this.quota.used++), this.scrollToBottom(), this.chatHistory.length >= this.chatHistoryLimit && ((f = r.onError) == null || f.call(r, new Error("Chat history limit reached")));
463
- const m = async () => {
464
- var p, A, k;
462
+ }), y.forEach((p) => this.registerUploadedFile(p)), ct(this.chatHistory), this.sending = !0, this.quota.remaining > 0 && !s && (this.quota.remaining--, this.quota.used++), this.scrollToBottom(), this.chatHistory.length >= this.chatHistoryLimit && ((f = r.onError) == null || f.call(r, new Error("Chat history limit reached")));
463
+ const x = async () => {
464
+ var p, D, g;
465
465
  try {
466
- const y = this.chatHistory.map((I) => ({
467
- role: I.role,
468
- content: I.message
469
- })), S = {}, E = (I) => {
470
- I != null && I.id && (S[I.id] = {
471
- extracted_text: I.extractedText || "",
472
- file_name: I.name,
473
- mime_type: I.type || "",
474
- ...I.size ? { file_size: I.size } : {},
475
- ...I.url ? { file_url: I.url } : {}
466
+ const m = this.chatHistory.map((M) => ({
467
+ role: M.role,
468
+ content: M.message
469
+ })), C = {}, S = (M) => {
470
+ M != null && M.id && (C[M.id] = {
471
+ extracted_text: M.extractedText || "",
472
+ file_name: M.name,
473
+ mime_type: M.type || "",
474
+ ...M.size ? { file_size: M.size } : {},
475
+ ...M.url ? { file_url: M.url } : {}
476
476
  });
477
477
  };
478
- Object.values(this.uploadedFiles).forEach(E), this.chatHistory.forEach((I) => {
479
- var V;
480
- return (V = I.attachments) == null ? void 0 : V.forEach(E);
481
- }), g.forEach(E);
482
- const T = Object.values(S), z = this.chatHistory.length;
478
+ Object.values(this.uploadedFiles).forEach(S), this.chatHistory.forEach((M) => {
479
+ var W;
480
+ return (W = M.attachments) == null ? void 0 : W.forEach(S);
481
+ }), y.forEach(S);
482
+ const b = Object.values(C), z = this.chatHistory.length;
483
483
  this.chatHistory.push({
484
484
  id: crypto.randomUUID(),
485
485
  role: nt.Assistant,
486
486
  message: "",
487
487
  loading: !0,
488
488
  timestamp: Date.now()
489
- }), $t(this.chatHistory), ct = new AbortController(), this.scrollToBottom();
490
- const U = await r.getAuthToken(), C = {
489
+ }), ct(this.chatHistory), dt = new AbortController(), this.scrollToBottom();
490
+ const q = await r.getAuthToken(), A = {
491
491
  "Content-Type": "application/json",
492
492
  Accept: "application/vnd.api+json",
493
493
  ...r.getCustomHeaders ? await r.getCustomHeaders() : {}
494
494
  };
495
- this.setupState.isActive && this.setupState.testApiKey ? C["X-Test-Api-Key"] = this.setupState.testApiKey : U && (C.Authorization = `Bearer ${U}`);
495
+ this.setupState.isActive && this.setupState.testApiKey ? A["X-Test-Api-Key"] = this.setupState.testApiKey : q && (A.Authorization = `Bearer ${q}`);
496
496
  const _ = {};
497
497
  if (typeof window < "u") {
498
498
  _.route = window.location.pathname;
499
- const I = new URLSearchParams(window.location.search), V = {};
500
- I.forEach((qe, Me) => {
501
- V[Me] = qe;
502
- }), Object.keys(V).length > 0 && (_.query = V), document.title && (_.pageTitle = document.title);
499
+ const M = new URLSearchParams(window.location.search), W = {};
500
+ M.forEach((qe, Me) => {
501
+ W[Me] = qe;
502
+ }), Object.keys(W).length > 0 && (_.query = W), document.title && (_.pageTitle = document.title);
503
503
  }
504
- t.length > 0 && (_.mentionedEntities = t.map((I) => ({
505
- type: I.type,
506
- id: I.id,
507
- displayName: I.name,
508
- metadata: I.metadata
504
+ t.length > 0 && (_.mentionedEntities = t.map((M) => ({
505
+ type: M.type,
506
+ id: M.id,
507
+ displayName: M.name,
508
+ metadata: M.metadata
509
509
  })));
510
510
  let R = {
511
511
  message: n,
512
- history: y,
512
+ history: m,
513
513
  stream: !0,
514
- ...T.length > 0 && { files: T },
514
+ ...b.length > 0 && { files: b },
515
515
  ...Object.keys(_).length > 0 && { context: _ },
516
516
  ...this.supportRequestMode && { contact_support: !0 },
517
517
  ...r.model && { model: r.model },
@@ -519,70 +519,75 @@ const Ge = Vs("restifyAiStore", {
519
519
  ...r.maxTokens && { max_tokens: r.maxTokens }
520
520
  };
521
521
  r.beforeSend && (R = await r.beforeSend(R)), r.buildRequest && (R = await r.buildRequest(R)), (p = r.onMessageSent) == null || p.call(r, this.chatHistory[z - 1]);
522
- const M = It(r.endpoints.ask);
523
- let Z = {
522
+ const E = $t(r.endpoints.ask);
523
+ let Y = {
524
524
  method: "POST",
525
525
  body: JSON.stringify(R),
526
- headers: C
526
+ headers: A
527
527
  };
528
- return r.requestInterceptor && (Z = await r.requestInterceptor(M, Z)), (A = r.onStreamStart) == null || A.call(r), await nr(M, {
528
+ return r.requestInterceptor && (Y = await r.requestInterceptor(E, Y)), (D = r.onStreamStart) == null || D.call(r), await nr(E, {
529
529
  method: "POST",
530
530
  body: JSON.stringify(R),
531
- signal: ct.signal,
532
- headers: Z.headers,
531
+ signal: dt.signal,
532
+ headers: Y.headers,
533
533
  openWhenHidden: !0,
534
- async onopen(I) {
535
- if (!I.ok) {
536
- if (I.status === 429) {
537
- const V = Ge();
538
- throw V.error = {
534
+ async onopen(M) {
535
+ if (!M.ok) {
536
+ if (M.status === 429) {
537
+ const W = Ge();
538
+ throw W.error = {
539
539
  message: de("noQuota"),
540
540
  failedQuestion: n,
541
- failedAttachments: g,
541
+ failedAttachments: y,
542
542
  timestamp: Date.now(),
543
543
  quotaExceeded: !0
544
- }, await V.fetchQuota(), new Error("Quota exceeded");
544
+ }, await W.fetchQuota(), new Error("Quota exceeded");
545
545
  }
546
- throw new Error(`Failed to connect: ${I.status}`);
546
+ throw new Error(`Failed to connect: ${M.status}`);
547
547
  }
548
548
  },
549
- onmessage: async (I) => {
549
+ onmessage: async (M) => {
550
550
  var Me, Re, ze;
551
- const V = this.parseStreamContent(I.event, I.data);
552
- if (!V) return;
551
+ const W = this.parseStreamContent(M.event, M.data);
552
+ if (!W) return;
553
553
  this.chatHistory[z].loading = !1;
554
554
  const qe = {
555
- content: V,
556
- done: V === "[DONE]",
557
- raw: I.data
555
+ content: W,
556
+ done: W === "[DONE]",
557
+ raw: M.data
558
558
  };
559
- (Me = r.onStreamChunk) == null || Me.call(r, qe), o ? V === "[DONE]" ? (this.chatHistory[z].streaming = !1, $t(this.chatHistory), (Re = r.onStreamEnd) == null || Re.call(r, o), this.quota.remaining === 0 && r.enableSupportMode !== !1 && (this.supportRequestMode = !0), this.supportRequestMode && this.quota.remaining > 0 && (this.supportRequestMode = !1), r.afterResponse && await r.afterResponse(this.chatHistory[z]), (ze = r.onResponseReceived) == null || ze.call(r, this.chatHistory[z])) : (o += V, this.chatHistory[z].message = o) : (o = V, this.chatHistory[z].message = o, this.chatHistory[z].streaming = !0), await this.scrollToBottom();
559
+ (Me = r.onStreamChunk) == null || Me.call(r, qe), o ? W === "[DONE]" ? (this.chatHistory[z].streaming = !1, ct(this.chatHistory), (Re = r.onStreamEnd) == null || Re.call(r, o), this.quota.remaining === 0 && r.enableSupportMode !== !1 && (this.supportRequestMode = !0), this.supportRequestMode && this.quota.remaining > 0 && (this.supportRequestMode = !1), r.afterResponse && await r.afterResponse(this.chatHistory[z]), (ze = r.onResponseReceived) == null || ze.call(r, this.chatHistory[z])) : (o += W, this.chatHistory[z].message = o) : (o = W, this.chatHistory[z].message = o, this.chatHistory[z].streaming = !0), await this.scrollToBottom();
560
+ },
561
+ onclose: () => {
562
+ var M, W;
563
+ o && !i && (this.chatHistory[z].streaming = !1, this.chatHistory[z].loading = !1, ct(this.chatHistory), (M = r.onStreamEnd) == null || M.call(r, o), r.afterResponse && r.afterResponse(this.chatHistory[z]), (W = r.onResponseReceived) == null || W.call(r, this.chatHistory[z]));
560
564
  },
561
- onerror(I) {
562
- throw i = !0, I;
565
+ onerror: (M) => {
566
+ if (!o)
567
+ throw i = !0, M;
563
568
  }
564
569
  }), !0;
565
- } catch (y) {
570
+ } catch (m) {
566
571
  i = !0;
567
- const S = this.chatHistory.length - 1;
568
- return this.chatHistory.splice(S, 1), y.name === "AbortError" ? !0 : c < u && (a.shouldRetry ? a.shouldRetry(y, c) : !0) ? (c++, await ir(d * c), m()) : (this.error = {
569
- message: rr(y),
572
+ const C = this.chatHistory.length - 1;
573
+ return this.chatHistory.splice(C, 1), m.name === "AbortError" ? !0 : c < u && (a.shouldRetry ? a.shouldRetry(m, c) : !0) ? (c++, await ir(d * c), x()) : (this.error = {
574
+ message: rr(m),
570
575
  failedQuestion: n,
571
- failedAttachments: g,
576
+ failedAttachments: y,
572
577
  timestamp: Date.now()
573
578
  }, cr({
574
579
  message: this.error.message,
575
580
  failedQuestion: this.error.failedQuestion,
576
581
  failedAttachments: this.error.failedAttachments || null
577
- }), (k = r.onError) == null || k.call(r, y), !1);
582
+ }), (g = r.onError) == null || g.call(r, m), !1);
578
583
  } finally {
579
584
  this.sending = !1;
580
585
  }
581
586
  };
582
- return m();
587
+ return x();
583
588
  },
584
589
  cancelRequest() {
585
- ct == null || ct.abort(), this.chatHistory = this.chatHistory.map((n) => ({
590
+ dt == null || dt.abort(), this.chatHistory = this.chatHistory.map((n) => ({
586
591
  ...n,
587
592
  streaming: !1,
588
593
  loading: !1
@@ -598,7 +603,7 @@ const Ge = Vs("restifyAiStore", {
598
603
  async retry() {
599
604
  if (!this.error.failedQuestion) return !1;
600
605
  const n = this.error.failedQuestion, e = this.error.failedAttachments || [], t = this.chatHistory[this.chatHistory.length - 1];
601
- return (t == null ? void 0 : t.role) === nt.User && t.message === n && (this.chatHistory.pop(), $t(this.chatHistory)), this.clearError(), await this.askQuestion(n, e);
606
+ return (t == null ? void 0 : t.role) === nt.User && t.message === n && (this.chatHistory.pop(), ct(this.chatHistory)), this.clearError(), await this.askQuestion(n, e);
602
607
  },
603
608
  clearError() {
604
609
  this.error = {
@@ -617,7 +622,7 @@ const Ge = Vs("restifyAiStore", {
617
622
  const n = te();
618
623
  if ((e = n == null ? void 0 : n.endpoints) != null && e.quota)
619
624
  try {
620
- const s = await n.getAuthToken(), r = n.getCustomHeaders ? await n.getCustomHeaders() : {}, o = It(n.endpoints.quota), i = await fetch(o, {
625
+ const s = await n.getAuthToken(), r = n.getCustomHeaders ? await n.getCustomHeaders() : {}, o = $t(n.endpoints.quota), i = await fetch(o, {
621
626
  headers: {
622
627
  Accept: "application/json",
623
628
  ...s ? { Authorization: `Bearer ${s}` } : {},
@@ -651,34 +656,34 @@ const Ge = Vs("restifyAiStore", {
651
656
  };
652
657
  (o = e.onFileUploadStart) == null || o.call(e, s);
653
658
  try {
654
- const d = await e.getAuthToken(), c = e.getCustomHeaders ? await e.getCustomHeaders() : {}, g = It(e.endpoints.uploadFile), m = new FormData();
655
- m.append("file", n);
656
- const f = await new Promise((p, A) => {
657
- const k = new XMLHttpRequest();
658
- k.upload.addEventListener("progress", (y) => {
659
- var S;
660
- if (y.lengthComputable) {
661
- const E = Math.round(y.loaded / y.total * 100);
662
- s.progress = E, (S = e.onFileUploadProgress) == null || S.call(e, s, E);
659
+ const d = await e.getAuthToken(), c = e.getCustomHeaders ? await e.getCustomHeaders() : {}, y = $t(e.endpoints.uploadFile), x = new FormData();
660
+ x.append("file", n);
661
+ const f = await new Promise((p, D) => {
662
+ const g = new XMLHttpRequest();
663
+ g.upload.addEventListener("progress", (m) => {
664
+ var C;
665
+ if (m.lengthComputable) {
666
+ const S = Math.round(m.loaded / m.total * 100);
667
+ s.progress = S, (C = e.onFileUploadProgress) == null || C.call(e, s, S);
663
668
  }
664
- }), k.addEventListener("load", () => {
665
- var y, S;
666
- if (k.status >= 200 && k.status < 300)
669
+ }), g.addEventListener("load", () => {
670
+ var m, C;
671
+ if (g.status >= 200 && g.status < 300)
667
672
  try {
668
- const E = JSON.parse(k.responseText), T = {
673
+ const S = JSON.parse(g.responseText), b = {
669
674
  ...s,
670
- url: E.url || ((y = E.data) == null ? void 0 : y.url),
671
- extractedText: E.extracted_text || ((S = E.data) == null ? void 0 : S.extracted_text),
675
+ url: S.url || ((m = S.data) == null ? void 0 : m.url),
676
+ extractedText: S.extracted_text || ((C = S.data) == null ? void 0 : C.extracted_text),
672
677
  uploading: !1,
673
678
  progress: 100
674
679
  };
675
- p(T);
680
+ p(b);
676
681
  } catch {
677
- A(new Error("Failed to parse upload response"));
682
+ D(new Error("Failed to parse upload response"));
678
683
  }
679
684
  else
680
- A(new Error(`Upload failed: ${k.status}`));
681
- }), k.addEventListener("error", () => A(new Error("Upload failed"))), k.open("POST", g), d && k.setRequestHeader("Authorization", `Bearer ${d}`), Object.entries(c).forEach(([y, S]) => k.setRequestHeader(y, S)), k.send(m);
685
+ D(new Error(`Upload failed: ${g.status}`));
686
+ }), g.addEventListener("error", () => D(new Error("Upload failed"))), g.open("POST", y), d && g.setRequestHeader("Authorization", `Bearer ${d}`), Object.entries(c).forEach(([m, C]) => g.setRequestHeader(m, C)), g.send(x);
682
687
  });
683
688
  return (i = e.onFileUploadComplete) == null || i.call(e, f), f;
684
689
  } catch (d) {
@@ -738,7 +743,7 @@ const Ge = Vs("restifyAiStore", {
738
743
  Accept: "application/json"
739
744
  };
740
745
  this.setupState.testApiKey && (e["X-Test-Api-Key"] = this.setupState.testApiKey);
741
- const t = n.endpoints.quota || n.endpoints.ask, s = It(t), r = await fetch(s, {
746
+ const t = n.endpoints.quota || n.endpoints.ask, s = $t(t), r = await fetch(s, {
742
747
  method: n.endpoints.quota ? "GET" : "POST",
743
748
  headers: e,
744
749
  ...n.endpoints.quota ? {} : {
@@ -879,7 +884,7 @@ function xe(n, e) {
879
884
  return n;
880
885
  }
881
886
  const vr = /(^|[^\[])\^/g;
882
- function W(n, e) {
887
+ function K(n, e) {
883
888
  let t = typeof n == "string" ? n : n.source;
884
889
  e = e || "";
885
890
  const s = {
@@ -899,7 +904,7 @@ function Kn(n) {
899
904
  }
900
905
  return n;
901
906
  }
902
- const xt = { exec: () => null };
907
+ const kt = { exec: () => null };
903
908
  function Vn(n, e) {
904
909
  const t = n.replace(/\|/g, (o, i, a) => {
905
910
  let u = !1, d = i;
@@ -918,7 +923,7 @@ function Vn(n, e) {
918
923
  s[r] = s[r].trim().replace(/\\\|/g, "|");
919
924
  return s;
920
925
  }
921
- function dt(n, e, t) {
926
+ function ht(n, e, t) {
922
927
  const s = n.length;
923
928
  if (s === 0)
924
929
  return "";
@@ -980,10 +985,10 @@ function Sr(n, e) {
980
985
  class _t {
981
986
  // set by the lexer
982
987
  constructor(e) {
983
- K(this, "options");
984
- K(this, "rules");
988
+ V(this, "options");
989
+ V(this, "rules");
985
990
  // set by the lexer
986
- K(this, "lexer");
991
+ V(this, "lexer");
987
992
  this.options = e || Qe;
988
993
  }
989
994
  space(e) {
@@ -1002,7 +1007,7 @@ class _t {
1002
1007
  type: "code",
1003
1008
  raw: t[0],
1004
1009
  codeBlockStyle: "indented",
1005
- text: this.options.pedantic ? s : dt(s, `
1010
+ text: this.options.pedantic ? s : ht(s, `
1006
1011
  `)
1007
1012
  };
1008
1013
  }
@@ -1024,7 +1029,7 @@ class _t {
1024
1029
  if (t) {
1025
1030
  let s = t[2].trim();
1026
1031
  if (/#$/.test(s)) {
1027
- const r = dt(s, "#");
1032
+ const r = ht(s, "#");
1028
1033
  (this.options.pedantic || !r || / $/.test(r)) && (s = r.trim());
1029
1034
  }
1030
1035
  return {
@@ -1041,14 +1046,14 @@ class _t {
1041
1046
  if (t)
1042
1047
  return {
1043
1048
  type: "hr",
1044
- raw: dt(t[0], `
1049
+ raw: ht(t[0], `
1045
1050
  `)
1046
1051
  };
1047
1052
  }
1048
1053
  blockquote(e) {
1049
1054
  const t = this.rules.block.blockquote.exec(e);
1050
1055
  if (t) {
1051
- let s = dt(t[0], `
1056
+ let s = ht(t[0], `
1052
1057
  `).split(`
1053
1058
  `), r = "", o = "";
1054
1059
  const i = [];
@@ -1065,28 +1070,28 @@ class _t {
1065
1070
  break;
1066
1071
  s = s.slice(d);
1067
1072
  const c = u.join(`
1068
- `), g = c.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, `
1073
+ `), y = c.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, `
1069
1074
  $1`).replace(/^ {0,3}>[ \t]?/gm, "");
1070
1075
  r = r ? `${r}
1071
1076
  ${c}` : c, o = o ? `${o}
1072
- ${g}` : g;
1073
- const m = this.lexer.state.top;
1074
- if (this.lexer.state.top = !0, this.lexer.blockTokens(g, i, !0), this.lexer.state.top = m, s.length === 0)
1077
+ ${y}` : y;
1078
+ const x = this.lexer.state.top;
1079
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(y, i, !0), this.lexer.state.top = x, s.length === 0)
1075
1080
  break;
1076
1081
  const f = i[i.length - 1];
1077
1082
  if ((f == null ? void 0 : f.type) === "code")
1078
1083
  break;
1079
1084
  if ((f == null ? void 0 : f.type) === "blockquote") {
1080
- const p = f, A = p.raw + `
1085
+ const p = f, D = p.raw + `
1081
1086
  ` + s.join(`
1082
- `), k = this.blockquote(A);
1083
- i[i.length - 1] = k, r = r.substring(0, r.length - p.raw.length) + k.raw, o = o.substring(0, o.length - p.text.length) + k.text;
1087
+ `), g = this.blockquote(D);
1088
+ i[i.length - 1] = g, r = r.substring(0, r.length - p.raw.length) + g.raw, o = o.substring(0, o.length - p.text.length) + g.text;
1084
1089
  break;
1085
1090
  } else if ((f == null ? void 0 : f.type) === "list") {
1086
- const p = f, A = p.raw + `
1091
+ const p = f, D = p.raw + `
1087
1092
  ` + s.join(`
1088
- `), k = this.list(A);
1089
- i[i.length - 1] = k, r = r.substring(0, r.length - f.raw.length) + k.raw, o = o.substring(0, o.length - p.raw.length) + k.raw, s = A.substring(i[i.length - 1].raw.length).split(`
1093
+ `), g = this.list(D);
1094
+ i[i.length - 1] = g, r = r.substring(0, r.length - f.raw.length) + g.raw, o = o.substring(0, o.length - p.raw.length) + g.raw, s = D.substring(i[i.length - 1].raw.length).split(`
1090
1095
  `);
1091
1096
  continue;
1092
1097
  }
@@ -1119,38 +1124,38 @@ ${g}` : g;
1119
1124
  if (!(t = i.exec(e)) || this.rules.block.hr.test(e))
1120
1125
  break;
1121
1126
  d = t[0], e = e.substring(d.length);
1122
- let g = t[2].split(`
1123
- `, 1)[0].replace(/^\t+/, (y) => " ".repeat(3 * y.length)), m = e.split(`
1124
- `, 1)[0], f = !g.trim(), p = 0;
1125
- if (this.options.pedantic ? (p = 2, c = g.trimStart()) : f ? p = t[1].length + 1 : (p = t[2].search(/[^ ]/), p = p > 4 ? 1 : p, c = g.slice(p), p += t[1].length), f && /^[ \t]*$/.test(m) && (d += m + `
1126
- `, e = e.substring(m.length + 1), u = !0), !u) {
1127
- const y = new RegExp(`^ {0,${Math.min(3, p - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), S = new RegExp(`^ {0,${Math.min(3, p - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), E = new RegExp(`^ {0,${Math.min(3, p - 1)}}(?:\`\`\`|~~~)`), T = new RegExp(`^ {0,${Math.min(3, p - 1)}}#`), z = new RegExp(`^ {0,${Math.min(3, p - 1)}}<(?:[a-z].*>|!--)`, "i");
1127
+ let y = t[2].split(`
1128
+ `, 1)[0].replace(/^\t+/, (m) => " ".repeat(3 * m.length)), x = e.split(`
1129
+ `, 1)[0], f = !y.trim(), p = 0;
1130
+ if (this.options.pedantic ? (p = 2, c = y.trimStart()) : f ? p = t[1].length + 1 : (p = t[2].search(/[^ ]/), p = p > 4 ? 1 : p, c = y.slice(p), p += t[1].length), f && /^[ \t]*$/.test(x) && (d += x + `
1131
+ `, e = e.substring(x.length + 1), u = !0), !u) {
1132
+ const m = new RegExp(`^ {0,${Math.min(3, p - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), C = new RegExp(`^ {0,${Math.min(3, p - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), S = new RegExp(`^ {0,${Math.min(3, p - 1)}}(?:\`\`\`|~~~)`), b = new RegExp(`^ {0,${Math.min(3, p - 1)}}#`), z = new RegExp(`^ {0,${Math.min(3, p - 1)}}<(?:[a-z].*>|!--)`, "i");
1128
1133
  for (; e; ) {
1129
- const U = e.split(`
1134
+ const q = e.split(`
1130
1135
  `, 1)[0];
1131
- let J;
1132
- if (m = U, this.options.pedantic ? (m = m.replace(/^ {1,4}(?=( {4})*[^ ])/g, " "), J = m) : J = m.replace(/\t/g, " "), E.test(m) || T.test(m) || z.test(m) || y.test(m) || S.test(m))
1136
+ let G;
1137
+ if (x = q, this.options.pedantic ? (x = x.replace(/^ {1,4}(?=( {4})*[^ ])/g, " "), G = x) : G = x.replace(/\t/g, " "), S.test(x) || b.test(x) || z.test(x) || m.test(x) || C.test(x))
1133
1138
  break;
1134
- if (J.search(/[^ ]/) >= p || !m.trim())
1139
+ if (G.search(/[^ ]/) >= p || !x.trim())
1135
1140
  c += `
1136
- ` + J.slice(p);
1141
+ ` + G.slice(p);
1137
1142
  else {
1138
- if (f || g.replace(/\t/g, " ").search(/[^ ]/) >= 4 || E.test(g) || T.test(g) || S.test(g))
1143
+ if (f || y.replace(/\t/g, " ").search(/[^ ]/) >= 4 || S.test(y) || b.test(y) || C.test(y))
1139
1144
  break;
1140
1145
  c += `
1141
- ` + m;
1146
+ ` + x;
1142
1147
  }
1143
- !f && !m.trim() && (f = !0), d += U + `
1144
- `, e = e.substring(U.length + 1), g = J.slice(p);
1148
+ !f && !x.trim() && (f = !0), d += q + `
1149
+ `, e = e.substring(q.length + 1), y = G.slice(p);
1145
1150
  }
1146
1151
  }
1147
1152
  o.loose || (a ? o.loose = !0 : /\n[ \t]*\n[ \t]*$/.test(d) && (a = !0));
1148
- let A = null, k;
1149
- this.options.gfm && (A = /^\[[ xX]\] /.exec(c), A && (k = A[0] !== "[ ] ", c = c.replace(/^\[[ xX]\] +/, ""))), o.items.push({
1153
+ let D = null, g;
1154
+ this.options.gfm && (D = /^\[[ xX]\] /.exec(c), D && (g = D[0] !== "[ ] ", c = c.replace(/^\[[ xX]\] +/, ""))), o.items.push({
1150
1155
  type: "list_item",
1151
1156
  raw: d,
1152
- task: !!A,
1153
- checked: k,
1157
+ task: !!D,
1158
+ checked: g,
1154
1159
  loose: !1,
1155
1160
  text: c,
1156
1161
  tokens: []
@@ -1159,7 +1164,7 @@ ${g}` : g;
1159
1164
  o.items[o.items.length - 1].raw = o.items[o.items.length - 1].raw.trimEnd(), o.items[o.items.length - 1].text = o.items[o.items.length - 1].text.trimEnd(), o.raw = o.raw.trimEnd();
1160
1165
  for (let u = 0; u < o.items.length; u++)
1161
1166
  if (this.lexer.state.top = !1, o.items[u].tokens = this.lexer.blockTokens(o.items[u].text, []), !o.loose) {
1162
- const d = o.items[u].tokens.filter((g) => g.type === "space"), c = d.length > 0 && d.some((g) => /\n.*\n/.test(g.raw));
1167
+ const d = o.items[u].tokens.filter((y) => y.type === "space"), c = d.length > 0 && d.some((y) => /\n.*\n/.test(y.raw));
1163
1168
  o.loose = c;
1164
1169
  }
1165
1170
  if (o.loose)
@@ -1286,7 +1291,7 @@ ${g}` : g;
1286
1291
  if (!this.options.pedantic && /^</.test(s)) {
1287
1292
  if (!/>$/.test(s))
1288
1293
  return;
1289
- const i = dt(s.slice(0, -1), "\\");
1294
+ const i = ht(s.slice(0, -1), "\\");
1290
1295
  if ((s.length - i.length) % 2 === 0)
1291
1296
  return;
1292
1297
  } else {
@@ -1330,8 +1335,8 @@ ${g}` : g;
1330
1335
  if (!(r[1] || r[2] || "") || !s || this.rules.inline.punctuation.exec(s)) {
1331
1336
  const i = [...r[0]].length - 1;
1332
1337
  let a, u, d = i, c = 0;
1333
- const g = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1334
- for (g.lastIndex = 0, t = t.slice(-1 * e.length + i); (r = g.exec(t)) != null; ) {
1338
+ const y = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1339
+ for (y.lastIndex = 0, t = t.slice(-1 * e.length + i); (r = y.exec(t)) != null; ) {
1335
1340
  if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a)
1336
1341
  continue;
1337
1342
  if (u = [...a].length, r[3] || r[4]) {
@@ -1344,14 +1349,14 @@ ${g}` : g;
1344
1349
  if (d -= u, d > 0)
1345
1350
  continue;
1346
1351
  u = Math.min(u, u + d + c);
1347
- const m = [...r[0]][0].length, f = e.slice(0, i + r.index + m + u);
1352
+ const x = [...r[0]][0].length, f = e.slice(0, i + r.index + x + u);
1348
1353
  if (Math.min(i, u) % 2) {
1349
- const A = f.slice(1, -1);
1354
+ const D = f.slice(1, -1);
1350
1355
  return {
1351
1356
  type: "em",
1352
1357
  raw: f,
1353
- text: A,
1354
- tokens: this.lexer.inlineTokens(A)
1358
+ text: D,
1359
+ tokens: this.lexer.inlineTokens(D)
1355
1360
  };
1356
1361
  }
1357
1362
  const p = f.slice(2, -2);
@@ -1454,43 +1459,43 @@ ${g}` : g;
1454
1459
  }
1455
1460
  }
1456
1461
  }
1457
- const Ar = /^(?:[ \t]*(?:\n|$))+/, Cr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Er = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Tt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Mr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, ms = /(?:[*+-]|\d{1,9}[.)])/, ys = W(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, ms).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), fn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Rr = /^[^\n]+/, pn = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Lr = W(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", pn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ir = W(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, ms).getRegex(), Bt = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", gn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, $r = W("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", gn).replace("tag", Bt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), xs = W(fn).replace("hr", Tt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Bt).getRegex(), Dr = W(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", xs).getRegex(), mn = {
1462
+ const Ar = /^(?:[ \t]*(?:\n|$))+/, Cr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Er = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, St = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Mr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, ms = /(?:[*+-]|\d{1,9}[.)])/, ys = K(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, ms).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), fn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Rr = /^[^\n]+/, pn = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Lr = K(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", pn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ir = K(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, ms).getRegex(), Bt = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", gn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, $r = K("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", gn).replace("tag", Bt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), xs = K(fn).replace("hr", St).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Bt).getRegex(), Dr = K(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", xs).getRegex(), mn = {
1458
1463
  blockquote: Dr,
1459
1464
  code: Cr,
1460
1465
  def: Lr,
1461
1466
  fences: Er,
1462
1467
  heading: Mr,
1463
- hr: Tt,
1468
+ hr: St,
1464
1469
  html: $r,
1465
1470
  lheading: ys,
1466
1471
  list: Ir,
1467
1472
  newline: Ar,
1468
1473
  paragraph: xs,
1469
- table: xt,
1474
+ table: kt,
1470
1475
  text: Rr
1471
- }, Qn = W("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Tt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Bt).getRegex(), Or = {
1476
+ }, Qn = K("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", St).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Bt).getRegex(), Or = {
1472
1477
  ...mn,
1473
1478
  table: Qn,
1474
- paragraph: W(fn).replace("hr", Tt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Qn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Bt).getRegex()
1479
+ paragraph: K(fn).replace("hr", St).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Qn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Bt).getRegex()
1475
1480
  }, Nr = {
1476
1481
  ...mn,
1477
- html: W(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", gn).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
1482
+ html: K(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", gn).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
1478
1483
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
1479
1484
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
1480
- fences: xt,
1485
+ fences: kt,
1481
1486
  // fences not supported
1482
1487
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
1483
- paragraph: W(fn).replace("hr", Tt).replace("heading", ` *#{1,6} *[^
1488
+ paragraph: K(fn).replace("hr", St).replace("heading", ` *#{1,6} *[^
1484
1489
  ]`).replace("lheading", ys).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
1485
- }, ks = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Pr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ws = /^( {2,}|\\)\n(?!\s*$)/, _r = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, St = "\\p{P}\\p{S}", zr = W(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, St).getRegex(), Hr = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, Br = W(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, St).getRegex(), Fr = W("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, St).getRegex(), Ur = W("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, St).getRegex(), qr = W(/\\([punct])/, "gu").replace(/punct/g, St).getRegex(), jr = W(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Wr = W(gn).replace("(?:-->|$)", "-->").getRegex(), Kr = W("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Wr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), zt = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Vr = W(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", zt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), bs = W(/^!?\[(label)\]\[(ref)\]/).replace("label", zt).replace("ref", pn).getRegex(), vs = W(/^!?\[(ref)\](?:\[\])?/).replace("ref", pn).getRegex(), Gr = W("reflink|nolink(?!\\()", "g").replace("reflink", bs).replace("nolink", vs).getRegex(), yn = {
1486
- _backpedal: xt,
1490
+ }, ks = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Pr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ws = /^( {2,}|\\)\n(?!\s*$)/, _r = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, At = "\\p{P}\\p{S}", zr = K(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, At).getRegex(), Hr = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, Br = K(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, At).getRegex(), Fr = K("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, At).getRegex(), Ur = K("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, At).getRegex(), qr = K(/\\([punct])/, "gu").replace(/punct/g, At).getRegex(), jr = K(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Wr = K(gn).replace("(?:-->|$)", "-->").getRegex(), Kr = K("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Wr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), zt = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Vr = K(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", zt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), bs = K(/^!?\[(label)\]\[(ref)\]/).replace("label", zt).replace("ref", pn).getRegex(), vs = K(/^!?\[(ref)\](?:\[\])?/).replace("ref", pn).getRegex(), Gr = K("reflink|nolink(?!\\()", "g").replace("reflink", bs).replace("nolink", vs).getRegex(), yn = {
1491
+ _backpedal: kt,
1487
1492
  // only used for GFM url
1488
1493
  anyPunctuation: qr,
1489
1494
  autolink: jr,
1490
1495
  blockSkip: Hr,
1491
1496
  br: ws,
1492
1497
  code: Pr,
1493
- del: xt,
1498
+ del: kt,
1494
1499
  emStrongLDelim: Br,
1495
1500
  emStrongRDelimAst: Fr,
1496
1501
  emStrongRDelimUnd: Ur,
@@ -1502,27 +1507,27 @@ const Ar = /^(?:[ \t]*(?:\n|$))+/, Cr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*
1502
1507
  reflinkSearch: Gr,
1503
1508
  tag: Kr,
1504
1509
  text: _r,
1505
- url: xt
1510
+ url: kt
1506
1511
  }, Qr = {
1507
1512
  ...yn,
1508
- link: W(/^!?\[(label)\]\((.*?)\)/).replace("label", zt).getRegex(),
1509
- reflink: W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", zt).getRegex()
1513
+ link: K(/^!?\[(label)\]\((.*?)\)/).replace("label", zt).getRegex(),
1514
+ reflink: K(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", zt).getRegex()
1510
1515
  }, on = {
1511
1516
  ...yn,
1512
- escape: W(ks).replace("])", "~|])").getRegex(),
1513
- url: W(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
1517
+ escape: K(ks).replace("])", "~|])").getRegex(),
1518
+ url: K(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
1514
1519
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
1515
1520
  del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
1516
1521
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
1517
1522
  }, Zr = {
1518
1523
  ...on,
1519
- br: W(ws).replace("{2,}", "*").getRegex(),
1520
- text: W(on.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
1524
+ br: K(ws).replace("{2,}", "*").getRegex(),
1525
+ text: K(on.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
1521
1526
  }, Dt = {
1522
1527
  normal: mn,
1523
1528
  gfm: Or,
1524
1529
  pedantic: Nr
1525
- }, ht = {
1530
+ }, ft = {
1526
1531
  normal: yn,
1527
1532
  gfm: on,
1528
1533
  breaks: Zr,
@@ -1530,11 +1535,11 @@ const Ar = /^(?:[ \t]*(?:\n|$))+/, Cr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*
1530
1535
  };
1531
1536
  class ke {
1532
1537
  constructor(e) {
1533
- K(this, "tokens");
1534
- K(this, "options");
1535
- K(this, "state");
1536
- K(this, "tokenizer");
1537
- K(this, "inlineQueue");
1538
+ V(this, "tokens");
1539
+ V(this, "options");
1540
+ V(this, "state");
1541
+ V(this, "tokenizer");
1542
+ V(this, "inlineQueue");
1538
1543
  this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || Qe, this.options.tokenizer = this.options.tokenizer || new _t(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1539
1544
  inLink: !1,
1540
1545
  inRawBlock: !1,
@@ -1542,9 +1547,9 @@ class ke {
1542
1547
  };
1543
1548
  const t = {
1544
1549
  block: Dt.normal,
1545
- inline: ht.normal
1550
+ inline: ft.normal
1546
1551
  };
1547
- this.options.pedantic ? (t.block = Dt.pedantic, t.inline = ht.pedantic) : this.options.gfm && (t.block = Dt.gfm, this.options.breaks ? t.inline = ht.breaks : t.inline = ht.gfm), this.tokenizer.rules = t;
1552
+ this.options.pedantic ? (t.block = Dt.pedantic, t.inline = ft.pedantic) : this.options.gfm && (t.block = Dt.gfm, this.options.breaks ? t.inline = ft.breaks : t.inline = ft.gfm), this.tokenizer.rules = t;
1548
1553
  }
1549
1554
  /**
1550
1555
  * Expose Rules
@@ -1552,7 +1557,7 @@ class ke {
1552
1557
  static get rules() {
1553
1558
  return {
1554
1559
  block: Dt,
1555
- inline: ht
1560
+ inline: ft
1556
1561
  };
1557
1562
  }
1558
1563
  /**
@@ -1729,10 +1734,10 @@ class ke {
1729
1734
  }
1730
1735
  if (o = e, this.options.extensions && this.options.extensions.startInline) {
1731
1736
  let c = 1 / 0;
1732
- const g = e.slice(1);
1733
- let m;
1737
+ const y = e.slice(1);
1738
+ let x;
1734
1739
  this.options.extensions.startInline.forEach((f) => {
1735
- m = f.call({ lexer: this }, g), typeof m == "number" && m >= 0 && (c = Math.min(c, m));
1740
+ x = f.call({ lexer: this }, y), typeof x == "number" && x >= 0 && (c = Math.min(c, x));
1736
1741
  }), c < 1 / 0 && c >= 0 && (o = e.substring(0, c + 1));
1737
1742
  }
1738
1743
  if (s = this.tokenizer.inlineText(o)) {
@@ -1754,8 +1759,8 @@ class ke {
1754
1759
  class Ht {
1755
1760
  // set by the parser
1756
1761
  constructor(e) {
1757
- K(this, "options");
1758
- K(this, "parser");
1762
+ V(this, "options");
1763
+ V(this, "parser");
1759
1764
  this.options = e || Qe;
1760
1765
  }
1761
1766
  space(e) {
@@ -1916,9 +1921,9 @@ class xn {
1916
1921
  }
1917
1922
  class we {
1918
1923
  constructor(e) {
1919
- K(this, "options");
1920
- K(this, "renderer");
1921
- K(this, "textRenderer");
1924
+ V(this, "options");
1925
+ V(this, "renderer");
1926
+ V(this, "textRenderer");
1922
1927
  this.options = e || Qe, this.options.renderer = this.options.renderer || new Ht(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new xn();
1923
1928
  }
1924
1929
  /**
@@ -2076,10 +2081,10 @@ class we {
2076
2081
  return s;
2077
2082
  }
2078
2083
  }
2079
- class kt {
2084
+ class wt {
2080
2085
  constructor(e) {
2081
- K(this, "options");
2082
- K(this, "block");
2086
+ V(this, "options");
2087
+ V(this, "block");
2083
2088
  this.options = e || Qe;
2084
2089
  }
2085
2090
  /**
@@ -2113,23 +2118,23 @@ class kt {
2113
2118
  return this.block ? we.parse : we.parseInline;
2114
2119
  }
2115
2120
  }
2116
- K(kt, "passThroughHooks", /* @__PURE__ */ new Set([
2121
+ V(wt, "passThroughHooks", /* @__PURE__ */ new Set([
2117
2122
  "preprocess",
2118
2123
  "postprocess",
2119
2124
  "processAllTokens"
2120
2125
  ]));
2121
2126
  class Yr {
2122
2127
  constructor(...e) {
2123
- K(this, "defaults", hn());
2124
- K(this, "options", this.setOptions);
2125
- K(this, "parse", this.parseMarkdown(!0));
2126
- K(this, "parseInline", this.parseMarkdown(!1));
2127
- K(this, "Parser", we);
2128
- K(this, "Renderer", Ht);
2129
- K(this, "TextRenderer", xn);
2130
- K(this, "Lexer", ke);
2131
- K(this, "Tokenizer", _t);
2132
- K(this, "Hooks", kt);
2128
+ V(this, "defaults", hn());
2129
+ V(this, "options", this.setOptions);
2130
+ V(this, "parse", this.parseMarkdown(!0));
2131
+ V(this, "parseInline", this.parseMarkdown(!1));
2132
+ V(this, "Parser", we);
2133
+ V(this, "Renderer", Ht);
2134
+ V(this, "TextRenderer", xn);
2135
+ V(this, "Lexer", ke);
2136
+ V(this, "Tokenizer", _t);
2137
+ V(this, "Hooks", wt);
2133
2138
  this.use(...e);
2134
2139
  }
2135
2140
  /**
@@ -2194,8 +2199,8 @@ class Yr {
2194
2199
  continue;
2195
2200
  const a = i, u = s.renderer[a], d = o[a];
2196
2201
  o[a] = (...c) => {
2197
- let g = u.apply(o, c);
2198
- return g === !1 && (g = d.apply(o, c)), g || "";
2202
+ let y = u.apply(o, c);
2203
+ return y === !1 && (y = d.apply(o, c)), y || "";
2199
2204
  };
2200
2205
  }
2201
2206
  r.renderer = o;
@@ -2209,28 +2214,28 @@ class Yr {
2209
2214
  continue;
2210
2215
  const a = i, u = s.tokenizer[a], d = o[a];
2211
2216
  o[a] = (...c) => {
2212
- let g = u.apply(o, c);
2213
- return g === !1 && (g = d.apply(o, c)), g;
2217
+ let y = u.apply(o, c);
2218
+ return y === !1 && (y = d.apply(o, c)), y;
2214
2219
  };
2215
2220
  }
2216
2221
  r.tokenizer = o;
2217
2222
  }
2218
2223
  if (s.hooks) {
2219
- const o = this.defaults.hooks || new kt();
2224
+ const o = this.defaults.hooks || new wt();
2220
2225
  for (const i in s.hooks) {
2221
2226
  if (!(i in o))
2222
2227
  throw new Error(`hook '${i}' does not exist`);
2223
2228
  if (["options", "block"].includes(i))
2224
2229
  continue;
2225
2230
  const a = i, u = s.hooks[a], d = o[a];
2226
- kt.passThroughHooks.has(i) ? o[a] = (c) => {
2231
+ wt.passThroughHooks.has(i) ? o[a] = (c) => {
2227
2232
  if (this.defaults.async)
2228
- return Promise.resolve(u.call(o, c)).then((m) => d.call(o, m));
2229
- const g = u.call(o, c);
2230
- return d.call(o, g);
2233
+ return Promise.resolve(u.call(o, c)).then((x) => d.call(o, x));
2234
+ const y = u.call(o, c);
2235
+ return d.call(o, y);
2231
2236
  } : o[a] = (...c) => {
2232
- let g = u.apply(o, c);
2233
- return g === !1 && (g = d.apply(o, c)), g;
2237
+ let y = u.apply(o, c);
2238
+ return y === !1 && (y = d.apply(o, c)), y;
2234
2239
  };
2235
2240
  }
2236
2241
  r.hooks = o;
@@ -2271,8 +2276,8 @@ class Yr {
2271
2276
  i.hooks && (s = i.hooks.preprocess(s));
2272
2277
  let c = u(s, i);
2273
2278
  i.hooks && (c = i.hooks.processAllTokens(c)), i.walkTokens && this.walkTokens(c, i.walkTokens);
2274
- let g = d(c, i);
2275
- return i.hooks && (g = i.hooks.postprocess(g)), g;
2279
+ let y = d(c, i);
2280
+ return i.hooks && (y = i.hooks.postprocess(y)), y;
2276
2281
  } catch (c) {
2277
2282
  return a(c);
2278
2283
  }
@@ -2314,7 +2319,7 @@ j.TextRenderer = xn;
2314
2319
  j.Lexer = ke;
2315
2320
  j.lexer = ke.lex;
2316
2321
  j.Tokenizer = _t;
2317
- j.Hooks = kt;
2322
+ j.Hooks = wt;
2318
2323
  j.parse = j;
2319
2324
  j.options;
2320
2325
  j.setOptions;
@@ -2355,7 +2360,7 @@ un || (un = function(e) {
2355
2360
  s[r - 1] = arguments[r];
2356
2361
  return new e(...s);
2357
2362
  });
2358
- const Ot = ge(Array.prototype.forEach), to = ge(Array.prototype.lastIndexOf), Yn = ge(Array.prototype.pop), ft = ge(Array.prototype.push), no = ge(Array.prototype.splice), Pt = ge(String.prototype.toLowerCase), Zt = ge(String.prototype.toString), Yt = ge(String.prototype.match), pt = ge(String.prototype.replace), so = ge(String.prototype.indexOf), ro = ge(String.prototype.trim), Te = ge(Object.prototype.hasOwnProperty), fe = ge(RegExp.prototype.test), gt = oo(TypeError);
2363
+ const Ot = ge(Array.prototype.forEach), to = ge(Array.prototype.lastIndexOf), Yn = ge(Array.prototype.pop), pt = ge(Array.prototype.push), no = ge(Array.prototype.splice), Pt = ge(String.prototype.toLowerCase), Zt = ge(String.prototype.toString), Yt = ge(String.prototype.match), gt = ge(String.prototype.replace), so = ge(String.prototype.indexOf), ro = ge(String.prototype.trim), Te = ge(Object.prototype.hasOwnProperty), fe = ge(RegExp.prototype.test), mt = oo(TypeError);
2359
2364
  function ge(n) {
2360
2365
  return function(e) {
2361
2366
  e instanceof RegExp && (e.lastIndex = 0);
@@ -2396,7 +2401,7 @@ function Ne(n) {
2396
2401
  Te(n, t) && (Array.isArray(s) ? e[t] = io(s) : s && typeof s == "object" && s.constructor === Object ? e[t] = Ne(s) : e[t] = s);
2397
2402
  return e;
2398
2403
  }
2399
- function mt(n, e) {
2404
+ function yt(n, e) {
2400
2405
  for (; n !== null; ) {
2401
2406
  const s = eo(n, e);
2402
2407
  if (s) {
@@ -2432,7 +2437,7 @@ var ns = /* @__PURE__ */ Object.freeze({
2432
2437
  MUSTACHE_EXPR: uo,
2433
2438
  TMPLIT_EXPR: ho
2434
2439
  });
2435
- const yt = {
2440
+ const xt = {
2436
2441
  element: 1,
2437
2442
  text: 3,
2438
2443
  // Deprecated
@@ -2475,8 +2480,8 @@ const yt = {
2475
2480
  };
2476
2481
  function Cs() {
2477
2482
  let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : xo();
2478
- const e = ($) => Cs($);
2479
- if (e.version = "3.3.0", e.removed = [], !n || !n.document || n.document.nodeType !== yt.document || !n.Element)
2483
+ const e = (I) => Cs(I);
2484
+ if (e.version = "3.3.0", e.removed = [], !n || !n.document || n.document.nodeType !== xt.document || !n.Element)
2480
2485
  return e.isSupported = !1, e;
2481
2486
  let {
2482
2487
  document: t
@@ -2488,29 +2493,29 @@ function Cs() {
2488
2493
  Element: u,
2489
2494
  NodeFilter: d,
2490
2495
  NamedNodeMap: c = n.NamedNodeMap || n.MozNamedAttrMap,
2491
- HTMLFormElement: g,
2492
- DOMParser: m,
2496
+ HTMLFormElement: y,
2497
+ DOMParser: x,
2493
2498
  trustedTypes: f
2494
- } = n, p = u.prototype, A = mt(p, "cloneNode"), k = mt(p, "remove"), y = mt(p, "nextSibling"), S = mt(p, "childNodes"), E = mt(p, "parentNode");
2499
+ } = n, p = u.prototype, D = yt(p, "cloneNode"), g = yt(p, "remove"), m = yt(p, "nextSibling"), C = yt(p, "childNodes"), S = yt(p, "parentNode");
2495
2500
  if (typeof i == "function") {
2496
- const $ = t.createElement("template");
2497
- $.content && $.content.ownerDocument && (t = $.content.ownerDocument);
2501
+ const I = t.createElement("template");
2502
+ I.content && I.content.ownerDocument && (t = I.content.ownerDocument);
2498
2503
  }
2499
- let T, z = "";
2504
+ let b, z = "";
2500
2505
  const {
2501
- implementation: U,
2502
- createNodeIterator: J,
2503
- createDocumentFragment: C,
2506
+ implementation: q,
2507
+ createNodeIterator: G,
2508
+ createDocumentFragment: A,
2504
2509
  getElementsByTagName: _
2505
2510
  } = t, {
2506
2511
  importNode: R
2507
2512
  } = s;
2508
- let M = ss();
2509
- e.isSupported = typeof Ts == "function" && typeof E == "function" && U && U.createHTMLDocument !== void 0;
2513
+ let E = ss();
2514
+ e.isSupported = typeof Ts == "function" && typeof S == "function" && q && q.createHTMLDocument !== void 0;
2510
2515
  const {
2511
- MUSTACHE_EXPR: Z,
2512
- ERB_EXPR: I,
2513
- TMPLIT_EXPR: V,
2516
+ MUSTACHE_EXPR: Y,
2517
+ ERB_EXPR: M,
2518
+ TMPLIT_EXPR: W,
2514
2519
  DATA_ATTR: qe,
2515
2520
  ARIA_ATTR: Me,
2516
2521
  IS_SCRIPT_OR_DATA: Re,
@@ -2518,12 +2523,12 @@ function Cs() {
2518
2523
  CUSTOM_ELEMENT: Ft
2519
2524
  } = ns;
2520
2525
  let {
2521
- IS_ALLOWED_URI: At
2526
+ IS_ALLOWED_URI: Ct
2522
2527
  } = ns, ne = null;
2523
2528
  const Le = H({}, [...Xn, ...Xt, ...Jt, ...en, ...Jn]);
2524
2529
  let se = null;
2525
2530
  const st = H({}, [...es, ...tn, ...ts, ...Nt]);
2526
- let Y = Object.seal(an(null, {
2531
+ let X = Object.seal(an(null, {
2527
2532
  tagNameCheck: {
2528
2533
  writable: !0,
2529
2534
  configurable: !1,
@@ -2557,17 +2562,17 @@ function Cs() {
2557
2562
  value: null
2558
2563
  }
2559
2564
  }));
2560
- let ot = !0, it = !0, at = !1, O = !0, B = !1, X = !0, G = !1, oe = !1, ee = !1, ie = !1, He = !1, Ct = !1, kn = !0, wn = !1;
2565
+ let ot = !0, it = !0, at = !1, O = !0, B = !1, J = !0, Q = !1, oe = !1, ee = !1, ie = !1, He = !1, Et = !1, kn = !0, wn = !1;
2561
2566
  const Is = "user-content-";
2562
2567
  let Ut = !0, lt = !1, Ze = {}, Ye = null;
2563
2568
  const bn = H({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
2564
2569
  let vn = null;
2565
2570
  const Tn = H({}, ["audio", "video", "img", "source", "image", "track"]);
2566
2571
  let qt = null;
2567
- const Sn = H({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Et = "http://www.w3.org/1998/Math/MathML", Mt = "http://www.w3.org/2000/svg", $e = "http://www.w3.org/1999/xhtml";
2572
+ const Sn = H({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Mt = "http://www.w3.org/1998/Math/MathML", Rt = "http://www.w3.org/2000/svg", $e = "http://www.w3.org/1999/xhtml";
2568
2573
  let Xe = $e, jt = !1, Wt = null;
2569
- const $s = H({}, [Et, Mt, $e], Zt);
2570
- let Rt = H({}, ["mi", "mo", "mn", "ms", "mtext"]), Lt = H({}, ["annotation-xml"]);
2574
+ const $s = H({}, [Mt, Rt, $e], Zt);
2575
+ let Lt = H({}, ["mi", "mo", "mn", "ms", "mtext"]), It = H({}, ["annotation-xml"]);
2571
2576
  const Ds = H({}, ["title", "style", "font", "a", "script"]);
2572
2577
  let ut = null;
2573
2578
  const Os = ["application/xhtml+xml", "text/html"], Ns = "text/html";
@@ -2578,41 +2583,41 @@ function Cs() {
2578
2583
  let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2579
2584
  if (!(Je && Je === l)) {
2580
2585
  if ((!l || typeof l != "object") && (l = {}), l = Ne(l), ut = // eslint-disable-next-line unicorn/prefer-includes
2581
- Os.indexOf(l.PARSER_MEDIA_TYPE) === -1 ? Ns : l.PARSER_MEDIA_TYPE, ae = ut === "application/xhtml+xml" ? Zt : Pt, ne = Te(l, "ALLOWED_TAGS") ? H({}, l.ALLOWED_TAGS, ae) : Le, se = Te(l, "ALLOWED_ATTR") ? H({}, l.ALLOWED_ATTR, ae) : st, Wt = Te(l, "ALLOWED_NAMESPACES") ? H({}, l.ALLOWED_NAMESPACES, Zt) : $s, qt = Te(l, "ADD_URI_SAFE_ATTR") ? H(Ne(Sn), l.ADD_URI_SAFE_ATTR, ae) : Sn, vn = Te(l, "ADD_DATA_URI_TAGS") ? H(Ne(Tn), l.ADD_DATA_URI_TAGS, ae) : Tn, Ye = Te(l, "FORBID_CONTENTS") ? H({}, l.FORBID_CONTENTS, ae) : bn, je = Te(l, "FORBID_TAGS") ? H({}, l.FORBID_TAGS, ae) : Ne({}), rt = Te(l, "FORBID_ATTR") ? H({}, l.FORBID_ATTR, ae) : Ne({}), Ze = Te(l, "USE_PROFILES") ? l.USE_PROFILES : !1, ot = l.ALLOW_ARIA_ATTR !== !1, it = l.ALLOW_DATA_ATTR !== !1, at = l.ALLOW_UNKNOWN_PROTOCOLS || !1, O = l.ALLOW_SELF_CLOSE_IN_ATTR !== !1, B = l.SAFE_FOR_TEMPLATES || !1, X = l.SAFE_FOR_XML !== !1, G = l.WHOLE_DOCUMENT || !1, ie = l.RETURN_DOM || !1, He = l.RETURN_DOM_FRAGMENT || !1, Ct = l.RETURN_TRUSTED_TYPE || !1, ee = l.FORCE_BODY || !1, kn = l.SANITIZE_DOM !== !1, wn = l.SANITIZE_NAMED_PROPS || !1, Ut = l.KEEP_CONTENT !== !1, lt = l.IN_PLACE || !1, At = l.ALLOWED_URI_REGEXP || Ss, Xe = l.NAMESPACE || $e, Rt = l.MATHML_TEXT_INTEGRATION_POINTS || Rt, Lt = l.HTML_INTEGRATION_POINTS || Lt, Y = l.CUSTOM_ELEMENT_HANDLING || {}, l.CUSTOM_ELEMENT_HANDLING && An(l.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (Y.tagNameCheck = l.CUSTOM_ELEMENT_HANDLING.tagNameCheck), l.CUSTOM_ELEMENT_HANDLING && An(l.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (Y.attributeNameCheck = l.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), l.CUSTOM_ELEMENT_HANDLING && typeof l.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (Y.allowCustomizedBuiltInElements = l.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), B && (it = !1), He && (ie = !0), Ze && (ne = H({}, Jn), se = [], Ze.html === !0 && (H(ne, Xn), H(se, es)), Ze.svg === !0 && (H(ne, Xt), H(se, tn), H(se, Nt)), Ze.svgFilters === !0 && (H(ne, Jt), H(se, tn), H(se, Nt)), Ze.mathMl === !0 && (H(ne, en), H(se, ts), H(se, Nt))), l.ADD_TAGS && (typeof l.ADD_TAGS == "function" ? Ie.tagCheck = l.ADD_TAGS : (ne === Le && (ne = Ne(ne)), H(ne, l.ADD_TAGS, ae))), l.ADD_ATTR && (typeof l.ADD_ATTR == "function" ? Ie.attributeCheck = l.ADD_ATTR : (se === st && (se = Ne(se)), H(se, l.ADD_ATTR, ae))), l.ADD_URI_SAFE_ATTR && H(qt, l.ADD_URI_SAFE_ATTR, ae), l.FORBID_CONTENTS && (Ye === bn && (Ye = Ne(Ye)), H(Ye, l.FORBID_CONTENTS, ae)), Ut && (ne["#text"] = !0), G && H(ne, ["html", "head", "body"]), ne.table && (H(ne, ["tbody"]), delete je.tbody), l.TRUSTED_TYPES_POLICY) {
2586
+ Os.indexOf(l.PARSER_MEDIA_TYPE) === -1 ? Ns : l.PARSER_MEDIA_TYPE, ae = ut === "application/xhtml+xml" ? Zt : Pt, ne = Te(l, "ALLOWED_TAGS") ? H({}, l.ALLOWED_TAGS, ae) : Le, se = Te(l, "ALLOWED_ATTR") ? H({}, l.ALLOWED_ATTR, ae) : st, Wt = Te(l, "ALLOWED_NAMESPACES") ? H({}, l.ALLOWED_NAMESPACES, Zt) : $s, qt = Te(l, "ADD_URI_SAFE_ATTR") ? H(Ne(Sn), l.ADD_URI_SAFE_ATTR, ae) : Sn, vn = Te(l, "ADD_DATA_URI_TAGS") ? H(Ne(Tn), l.ADD_DATA_URI_TAGS, ae) : Tn, Ye = Te(l, "FORBID_CONTENTS") ? H({}, l.FORBID_CONTENTS, ae) : bn, je = Te(l, "FORBID_TAGS") ? H({}, l.FORBID_TAGS, ae) : Ne({}), rt = Te(l, "FORBID_ATTR") ? H({}, l.FORBID_ATTR, ae) : Ne({}), Ze = Te(l, "USE_PROFILES") ? l.USE_PROFILES : !1, ot = l.ALLOW_ARIA_ATTR !== !1, it = l.ALLOW_DATA_ATTR !== !1, at = l.ALLOW_UNKNOWN_PROTOCOLS || !1, O = l.ALLOW_SELF_CLOSE_IN_ATTR !== !1, B = l.SAFE_FOR_TEMPLATES || !1, J = l.SAFE_FOR_XML !== !1, Q = l.WHOLE_DOCUMENT || !1, ie = l.RETURN_DOM || !1, He = l.RETURN_DOM_FRAGMENT || !1, Et = l.RETURN_TRUSTED_TYPE || !1, ee = l.FORCE_BODY || !1, kn = l.SANITIZE_DOM !== !1, wn = l.SANITIZE_NAMED_PROPS || !1, Ut = l.KEEP_CONTENT !== !1, lt = l.IN_PLACE || !1, Ct = l.ALLOWED_URI_REGEXP || Ss, Xe = l.NAMESPACE || $e, Lt = l.MATHML_TEXT_INTEGRATION_POINTS || Lt, It = l.HTML_INTEGRATION_POINTS || It, X = l.CUSTOM_ELEMENT_HANDLING || {}, l.CUSTOM_ELEMENT_HANDLING && An(l.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (X.tagNameCheck = l.CUSTOM_ELEMENT_HANDLING.tagNameCheck), l.CUSTOM_ELEMENT_HANDLING && An(l.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (X.attributeNameCheck = l.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), l.CUSTOM_ELEMENT_HANDLING && typeof l.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (X.allowCustomizedBuiltInElements = l.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), B && (it = !1), He && (ie = !0), Ze && (ne = H({}, Jn), se = [], Ze.html === !0 && (H(ne, Xn), H(se, es)), Ze.svg === !0 && (H(ne, Xt), H(se, tn), H(se, Nt)), Ze.svgFilters === !0 && (H(ne, Jt), H(se, tn), H(se, Nt)), Ze.mathMl === !0 && (H(ne, en), H(se, ts), H(se, Nt))), l.ADD_TAGS && (typeof l.ADD_TAGS == "function" ? Ie.tagCheck = l.ADD_TAGS : (ne === Le && (ne = Ne(ne)), H(ne, l.ADD_TAGS, ae))), l.ADD_ATTR && (typeof l.ADD_ATTR == "function" ? Ie.attributeCheck = l.ADD_ATTR : (se === st && (se = Ne(se)), H(se, l.ADD_ATTR, ae))), l.ADD_URI_SAFE_ATTR && H(qt, l.ADD_URI_SAFE_ATTR, ae), l.FORBID_CONTENTS && (Ye === bn && (Ye = Ne(Ye)), H(Ye, l.FORBID_CONTENTS, ae)), Ut && (ne["#text"] = !0), Q && H(ne, ["html", "head", "body"]), ne.table && (H(ne, ["tbody"]), delete je.tbody), l.TRUSTED_TYPES_POLICY) {
2582
2587
  if (typeof l.TRUSTED_TYPES_POLICY.createHTML != "function")
2583
- throw gt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2588
+ throw mt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2584
2589
  if (typeof l.TRUSTED_TYPES_POLICY.createScriptURL != "function")
2585
- throw gt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2586
- T = l.TRUSTED_TYPES_POLICY, z = T.createHTML("");
2590
+ throw mt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2591
+ b = l.TRUSTED_TYPES_POLICY, z = b.createHTML("");
2587
2592
  } else
2588
- T === void 0 && (T = ko(f, r)), T !== null && typeof z == "string" && (z = T.createHTML(""));
2593
+ b === void 0 && (b = ko(f, r)), b !== null && typeof z == "string" && (z = b.createHTML(""));
2589
2594
  pe && pe(l), Je = l;
2590
2595
  }
2591
2596
  }, Cn = H({}, [...Xt, ...Jt, ...ao]), En = H({}, [...en, ...lo]), _s = function(l) {
2592
- let w = E(l);
2597
+ let w = S(l);
2593
2598
  (!w || !w.tagName) && (w = {
2594
2599
  namespaceURI: Xe,
2595
2600
  tagName: "template"
2596
2601
  });
2597
- const L = Pt(l.tagName), Q = Pt(w.tagName);
2598
- return Wt[l.namespaceURI] ? l.namespaceURI === Mt ? w.namespaceURI === $e ? L === "svg" : w.namespaceURI === Et ? L === "svg" && (Q === "annotation-xml" || Rt[Q]) : !!Cn[L] : l.namespaceURI === Et ? w.namespaceURI === $e ? L === "math" : w.namespaceURI === Mt ? L === "math" && Lt[Q] : !!En[L] : l.namespaceURI === $e ? w.namespaceURI === Mt && !Lt[Q] || w.namespaceURI === Et && !Rt[Q] ? !1 : !En[L] && (Ds[L] || !Cn[L]) : !!(ut === "application/xhtml+xml" && Wt[l.namespaceURI]) : !1;
2602
+ const L = Pt(l.tagName), Z = Pt(w.tagName);
2603
+ return Wt[l.namespaceURI] ? l.namespaceURI === Rt ? w.namespaceURI === $e ? L === "svg" : w.namespaceURI === Mt ? L === "svg" && (Z === "annotation-xml" || Lt[Z]) : !!Cn[L] : l.namespaceURI === Mt ? w.namespaceURI === $e ? L === "math" : w.namespaceURI === Rt ? L === "math" && It[Z] : !!En[L] : l.namespaceURI === $e ? w.namespaceURI === Rt && !It[Z] || w.namespaceURI === Mt && !Lt[Z] ? !1 : !En[L] && (Ds[L] || !Cn[L]) : !!(ut === "application/xhtml+xml" && Wt[l.namespaceURI]) : !1;
2599
2604
  }, Se = function(l) {
2600
- ft(e.removed, {
2605
+ pt(e.removed, {
2601
2606
  element: l
2602
2607
  });
2603
2608
  try {
2604
- E(l).removeChild(l);
2609
+ S(l).removeChild(l);
2605
2610
  } catch {
2606
- k(l);
2611
+ g(l);
2607
2612
  }
2608
2613
  }, We = function(l, w) {
2609
2614
  try {
2610
- ft(e.removed, {
2615
+ pt(e.removed, {
2611
2616
  attribute: w.getAttributeNode(l),
2612
2617
  from: w
2613
2618
  });
2614
2619
  } catch {
2615
- ft(e.removed, {
2620
+ pt(e.removed, {
2616
2621
  attribute: null,
2617
2622
  from: w
2618
2623
  });
@@ -2637,23 +2642,23 @@ function Cs() {
2637
2642
  L = re && re[0];
2638
2643
  }
2639
2644
  ut === "application/xhtml+xml" && Xe === $e && (l = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + l + "</body></html>");
2640
- const Q = T ? T.createHTML(l) : l;
2645
+ const Z = b ? b.createHTML(l) : l;
2641
2646
  if (Xe === $e)
2642
2647
  try {
2643
- w = new m().parseFromString(Q, ut);
2648
+ w = new x().parseFromString(Z, ut);
2644
2649
  } catch {
2645
2650
  }
2646
2651
  if (!w || !w.documentElement) {
2647
- w = U.createDocument(Xe, "template", null);
2652
+ w = q.createDocument(Xe, "template", null);
2648
2653
  try {
2649
- w.documentElement.innerHTML = jt ? z : Q;
2654
+ w.documentElement.innerHTML = jt ? z : Z;
2650
2655
  } catch {
2651
2656
  }
2652
2657
  }
2653
2658
  const ue = w.body || w.documentElement;
2654
- return l && L && ue.insertBefore(t.createTextNode(L), ue.childNodes[0] || null), Xe === $e ? _.call(w, G ? "html" : "body")[0] : G ? w.documentElement : ue;
2659
+ return l && L && ue.insertBefore(t.createTextNode(L), ue.childNodes[0] || null), Xe === $e ? _.call(w, Q ? "html" : "body")[0] : Q ? w.documentElement : ue;
2655
2660
  }, Rn = function(l) {
2656
- return J.call(
2661
+ return G.call(
2657
2662
  l.ownerDocument || l,
2658
2663
  l,
2659
2664
  // eslint-disable-next-line no-bitwise
@@ -2661,45 +2666,45 @@ function Cs() {
2661
2666
  null
2662
2667
  );
2663
2668
  }, Vt = function(l) {
2664
- return l instanceof g && (typeof l.nodeName != "string" || typeof l.textContent != "string" || typeof l.removeChild != "function" || !(l.attributes instanceof c) || typeof l.removeAttribute != "function" || typeof l.setAttribute != "function" || typeof l.namespaceURI != "string" || typeof l.insertBefore != "function" || typeof l.hasChildNodes != "function");
2669
+ return l instanceof y && (typeof l.nodeName != "string" || typeof l.textContent != "string" || typeof l.removeChild != "function" || !(l.attributes instanceof c) || typeof l.removeAttribute != "function" || typeof l.setAttribute != "function" || typeof l.namespaceURI != "string" || typeof l.insertBefore != "function" || typeof l.hasChildNodes != "function");
2665
2670
  }, Ln = function(l) {
2666
2671
  return typeof a == "function" && l instanceof a;
2667
2672
  };
2668
- function De($, l, w) {
2669
- Ot($, (L) => {
2673
+ function De(I, l, w) {
2674
+ Ot(I, (L) => {
2670
2675
  L.call(e, l, w, Je);
2671
2676
  });
2672
2677
  }
2673
2678
  const In = function(l) {
2674
2679
  let w = null;
2675
- if (De(M.beforeSanitizeElements, l, null), Vt(l))
2680
+ if (De(E.beforeSanitizeElements, l, null), Vt(l))
2676
2681
  return Se(l), !0;
2677
2682
  const L = ae(l.nodeName);
2678
- if (De(M.uponSanitizeElement, l, {
2683
+ if (De(E.uponSanitizeElement, l, {
2679
2684
  tagName: L,
2680
2685
  allowedTags: ne
2681
- }), X && l.hasChildNodes() && !Ln(l.firstElementChild) && fe(/<[/\w!]/g, l.innerHTML) && fe(/<[/\w!]/g, l.textContent) || l.nodeType === yt.progressingInstruction || X && l.nodeType === yt.comment && fe(/<[/\w]/g, l.data))
2686
+ }), J && l.hasChildNodes() && !Ln(l.firstElementChild) && fe(/<[/\w!]/g, l.innerHTML) && fe(/<[/\w!]/g, l.textContent) || l.nodeType === xt.progressingInstruction || J && l.nodeType === xt.comment && fe(/<[/\w]/g, l.data))
2682
2687
  return Se(l), !0;
2683
2688
  if (!(Ie.tagCheck instanceof Function && Ie.tagCheck(L)) && (!ne[L] || je[L])) {
2684
- if (!je[L] && Dn(L) && (Y.tagNameCheck instanceof RegExp && fe(Y.tagNameCheck, L) || Y.tagNameCheck instanceof Function && Y.tagNameCheck(L)))
2689
+ if (!je[L] && Dn(L) && (X.tagNameCheck instanceof RegExp && fe(X.tagNameCheck, L) || X.tagNameCheck instanceof Function && X.tagNameCheck(L)))
2685
2690
  return !1;
2686
2691
  if (Ut && !Ye[L]) {
2687
- const Q = E(l) || l.parentNode, ue = S(l) || l.childNodes;
2688
- if (ue && Q) {
2692
+ const Z = S(l) || l.parentNode, ue = C(l) || l.childNodes;
2693
+ if (ue && Z) {
2689
2694
  const re = ue.length;
2690
2695
  for (let me = re - 1; me >= 0; --me) {
2691
- const Oe = A(ue[me], !0);
2692
- Oe.__removalCount = (l.__removalCount || 0) + 1, Q.insertBefore(Oe, y(l));
2696
+ const Oe = D(ue[me], !0);
2697
+ Oe.__removalCount = (l.__removalCount || 0) + 1, Z.insertBefore(Oe, m(l));
2693
2698
  }
2694
2699
  }
2695
2700
  }
2696
2701
  return Se(l), !0;
2697
2702
  }
2698
- return l instanceof u && !_s(l) || (L === "noscript" || L === "noembed" || L === "noframes") && fe(/<\/no(script|embed|frames)/i, l.innerHTML) ? (Se(l), !0) : (B && l.nodeType === yt.text && (w = l.textContent, Ot([Z, I, V], (Q) => {
2699
- w = pt(w, Q, " ");
2700
- }), l.textContent !== w && (ft(e.removed, {
2703
+ return l instanceof u && !_s(l) || (L === "noscript" || L === "noembed" || L === "noframes") && fe(/<\/no(script|embed|frames)/i, l.innerHTML) ? (Se(l), !0) : (B && l.nodeType === xt.text && (w = l.textContent, Ot([Y, M, W], (Z) => {
2704
+ w = gt(w, Z, " ");
2705
+ }), l.textContent !== w && (pt(e.removed, {
2701
2706
  element: l.cloneNode()
2702
- }), l.textContent = w)), De(M.afterSanitizeElements, l, null), !1);
2707
+ }), l.textContent = w)), De(E.afterSanitizeElements, l, null), !1);
2703
2708
  }, $n = function(l, w, L) {
2704
2709
  if (kn && (w === "id" || w === "name") && (L in t || L in Ps))
2705
2710
  return !1;
@@ -2711,14 +2716,14 @@ function Cs() {
2711
2716
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
2712
2717
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
2713
2718
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
2714
- !(Dn(l) && (Y.tagNameCheck instanceof RegExp && fe(Y.tagNameCheck, l) || Y.tagNameCheck instanceof Function && Y.tagNameCheck(l)) && (Y.attributeNameCheck instanceof RegExp && fe(Y.attributeNameCheck, w) || Y.attributeNameCheck instanceof Function && Y.attributeNameCheck(w, l)) || // Alternative, second condition checks if it's an `is`-attribute, AND
2719
+ !(Dn(l) && (X.tagNameCheck instanceof RegExp && fe(X.tagNameCheck, l) || X.tagNameCheck instanceof Function && X.tagNameCheck(l)) && (X.attributeNameCheck instanceof RegExp && fe(X.attributeNameCheck, w) || X.attributeNameCheck instanceof Function && X.attributeNameCheck(w, l)) || // Alternative, second condition checks if it's an `is`-attribute, AND
2715
2720
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
2716
- w === "is" && Y.allowCustomizedBuiltInElements && (Y.tagNameCheck instanceof RegExp && fe(Y.tagNameCheck, L) || Y.tagNameCheck instanceof Function && Y.tagNameCheck(L)))
2721
+ w === "is" && X.allowCustomizedBuiltInElements && (X.tagNameCheck instanceof RegExp && fe(X.tagNameCheck, L) || X.tagNameCheck instanceof Function && X.tagNameCheck(L)))
2717
2722
  ) return !1;
2718
2723
  } else if (!qt[w]) {
2719
- if (!fe(At, pt(L, ze, ""))) {
2724
+ if (!fe(Ct, gt(L, ze, ""))) {
2720
2725
  if (!((w === "src" || w === "xlink:href" || w === "href") && l !== "script" && so(L, "data:") === 0 && vn[l])) {
2721
- if (!(at && !fe(Re, pt(L, ze, "")))) {
2726
+ if (!(at && !fe(Re, gt(L, ze, "")))) {
2722
2727
  if (L)
2723
2728
  return !1;
2724
2729
  }
@@ -2732,7 +2737,7 @@ function Cs() {
2732
2737
  }, Dn = function(l) {
2733
2738
  return l !== "annotation-xml" && Yt(l, Ft);
2734
2739
  }, On = function(l) {
2735
- De(M.beforeSanitizeAttributes, l, null);
2740
+ De(E.beforeSanitizeAttributes, l, null);
2736
2741
  const {
2737
2742
  attributes: w
2738
2743
  } = l;
@@ -2745,15 +2750,15 @@ function Cs() {
2745
2750
  allowedAttributes: se,
2746
2751
  forceKeepAttr: void 0
2747
2752
  };
2748
- let Q = w.length;
2749
- for (; Q--; ) {
2750
- const ue = w[Q], {
2753
+ let Z = w.length;
2754
+ for (; Z--; ) {
2755
+ const ue = w[Z], {
2751
2756
  name: re,
2752
2757
  namespaceURI: me,
2753
2758
  value: Oe
2754
2759
  } = ue, et = ae(re), Gt = Oe;
2755
2760
  let le = re === "value" ? Gt : ro(Gt);
2756
- if (L.attrName = et, L.attrValue = le, L.keepAttr = !0, L.forceKeepAttr = void 0, De(M.uponSanitizeAttribute, l, L), le = L.attrValue, wn && (et === "id" || et === "name") && (We(re, l), le = Is + le), X && fe(/((--!?|])>)|<\/(style|title|textarea)/i, le)) {
2761
+ if (L.attrName = et, L.attrValue = le, L.keepAttr = !0, L.forceKeepAttr = void 0, De(E.uponSanitizeAttribute, l, L), le = L.attrValue, wn && (et === "id" || et === "name") && (We(re, l), le = Is + le), J && fe(/((--!?|])>)|<\/(style|title|textarea)/i, le)) {
2757
2762
  We(re, l);
2758
2763
  continue;
2759
2764
  }
@@ -2771,22 +2776,22 @@ function Cs() {
2771
2776
  We(re, l);
2772
2777
  continue;
2773
2778
  }
2774
- B && Ot([Z, I, V], (Pn) => {
2775
- le = pt(le, Pn, " ");
2779
+ B && Ot([Y, M, W], (Pn) => {
2780
+ le = gt(le, Pn, " ");
2776
2781
  });
2777
2782
  const Nn = ae(l.nodeName);
2778
2783
  if (!$n(Nn, et, le)) {
2779
2784
  We(re, l);
2780
2785
  continue;
2781
2786
  }
2782
- if (T && typeof f == "object" && typeof f.getAttributeType == "function" && !me)
2787
+ if (b && typeof f == "object" && typeof f.getAttributeType == "function" && !me)
2783
2788
  switch (f.getAttributeType(Nn, et)) {
2784
2789
  case "TrustedHTML": {
2785
- le = T.createHTML(le);
2790
+ le = b.createHTML(le);
2786
2791
  break;
2787
2792
  }
2788
2793
  case "TrustedScriptURL": {
2789
- le = T.createScriptURL(le);
2794
+ le = b.createScriptURL(le);
2790
2795
  break;
2791
2796
  }
2792
2797
  }
@@ -2797,79 +2802,79 @@ function Cs() {
2797
2802
  We(re, l);
2798
2803
  }
2799
2804
  }
2800
- De(M.afterSanitizeAttributes, l, null);
2801
- }, zs = function $(l) {
2805
+ De(E.afterSanitizeAttributes, l, null);
2806
+ }, zs = function I(l) {
2802
2807
  let w = null;
2803
2808
  const L = Rn(l);
2804
- for (De(M.beforeSanitizeShadowDOM, l, null); w = L.nextNode(); )
2805
- De(M.uponSanitizeShadowNode, w, null), In(w), On(w), w.content instanceof o && $(w.content);
2806
- De(M.afterSanitizeShadowDOM, l, null);
2809
+ for (De(E.beforeSanitizeShadowDOM, l, null); w = L.nextNode(); )
2810
+ De(E.uponSanitizeShadowNode, w, null), In(w), On(w), w.content instanceof o && I(w.content);
2811
+ De(E.afterSanitizeShadowDOM, l, null);
2807
2812
  };
2808
- return e.sanitize = function($) {
2809
- let l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, w = null, L = null, Q = null, ue = null;
2810
- if (jt = !$, jt && ($ = "<!-->"), typeof $ != "string" && !Ln($))
2811
- if (typeof $.toString == "function") {
2812
- if ($ = $.toString(), typeof $ != "string")
2813
- throw gt("dirty is not a string, aborting");
2813
+ return e.sanitize = function(I) {
2814
+ let l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, w = null, L = null, Z = null, ue = null;
2815
+ if (jt = !I, jt && (I = "<!-->"), typeof I != "string" && !Ln(I))
2816
+ if (typeof I.toString == "function") {
2817
+ if (I = I.toString(), typeof I != "string")
2818
+ throw mt("dirty is not a string, aborting");
2814
2819
  } else
2815
- throw gt("toString is not a function");
2820
+ throw mt("toString is not a function");
2816
2821
  if (!e.isSupported)
2817
- return $;
2818
- if (oe || Kt(l), e.removed = [], typeof $ == "string" && (lt = !1), lt) {
2819
- if ($.nodeName) {
2820
- const Oe = ae($.nodeName);
2822
+ return I;
2823
+ if (oe || Kt(l), e.removed = [], typeof I == "string" && (lt = !1), lt) {
2824
+ if (I.nodeName) {
2825
+ const Oe = ae(I.nodeName);
2821
2826
  if (!ne[Oe] || je[Oe])
2822
- throw gt("root node is forbidden and cannot be sanitized in-place");
2827
+ throw mt("root node is forbidden and cannot be sanitized in-place");
2823
2828
  }
2824
- } else if ($ instanceof a)
2825
- w = Mn("<!---->"), L = w.ownerDocument.importNode($, !0), L.nodeType === yt.element && L.nodeName === "BODY" || L.nodeName === "HTML" ? w = L : w.appendChild(L);
2829
+ } else if (I instanceof a)
2830
+ w = Mn("<!---->"), L = w.ownerDocument.importNode(I, !0), L.nodeType === xt.element && L.nodeName === "BODY" || L.nodeName === "HTML" ? w = L : w.appendChild(L);
2826
2831
  else {
2827
- if (!ie && !B && !G && // eslint-disable-next-line unicorn/prefer-includes
2828
- $.indexOf("<") === -1)
2829
- return T && Ct ? T.createHTML($) : $;
2830
- if (w = Mn($), !w)
2831
- return ie ? null : Ct ? z : "";
2832
+ if (!ie && !B && !Q && // eslint-disable-next-line unicorn/prefer-includes
2833
+ I.indexOf("<") === -1)
2834
+ return b && Et ? b.createHTML(I) : I;
2835
+ if (w = Mn(I), !w)
2836
+ return ie ? null : Et ? z : "";
2832
2837
  }
2833
2838
  w && ee && Se(w.firstChild);
2834
- const re = Rn(lt ? $ : w);
2835
- for (; Q = re.nextNode(); )
2836
- In(Q), On(Q), Q.content instanceof o && zs(Q.content);
2839
+ const re = Rn(lt ? I : w);
2840
+ for (; Z = re.nextNode(); )
2841
+ In(Z), On(Z), Z.content instanceof o && zs(Z.content);
2837
2842
  if (lt)
2838
- return $;
2843
+ return I;
2839
2844
  if (ie) {
2840
2845
  if (He)
2841
- for (ue = C.call(w.ownerDocument); w.firstChild; )
2846
+ for (ue = A.call(w.ownerDocument); w.firstChild; )
2842
2847
  ue.appendChild(w.firstChild);
2843
2848
  else
2844
2849
  ue = w;
2845
2850
  return (se.shadowroot || se.shadowrootmode) && (ue = R.call(s, ue, !0)), ue;
2846
2851
  }
2847
- let me = G ? w.outerHTML : w.innerHTML;
2848
- return G && ne["!doctype"] && w.ownerDocument && w.ownerDocument.doctype && w.ownerDocument.doctype.name && fe(As, w.ownerDocument.doctype.name) && (me = "<!DOCTYPE " + w.ownerDocument.doctype.name + `>
2849
- ` + me), B && Ot([Z, I, V], (Oe) => {
2850
- me = pt(me, Oe, " ");
2851
- }), T && Ct ? T.createHTML(me) : me;
2852
+ let me = Q ? w.outerHTML : w.innerHTML;
2853
+ return Q && ne["!doctype"] && w.ownerDocument && w.ownerDocument.doctype && w.ownerDocument.doctype.name && fe(As, w.ownerDocument.doctype.name) && (me = "<!DOCTYPE " + w.ownerDocument.doctype.name + `>
2854
+ ` + me), B && Ot([Y, M, W], (Oe) => {
2855
+ me = gt(me, Oe, " ");
2856
+ }), b && Et ? b.createHTML(me) : me;
2852
2857
  }, e.setConfig = function() {
2853
- let $ = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2854
- Kt($), oe = !0;
2858
+ let I = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2859
+ Kt(I), oe = !0;
2855
2860
  }, e.clearConfig = function() {
2856
2861
  Je = null, oe = !1;
2857
- }, e.isValidAttribute = function($, l, w) {
2862
+ }, e.isValidAttribute = function(I, l, w) {
2858
2863
  Je || Kt({});
2859
- const L = ae($), Q = ae(l);
2860
- return $n(L, Q, w);
2861
- }, e.addHook = function($, l) {
2862
- typeof l == "function" && ft(M[$], l);
2863
- }, e.removeHook = function($, l) {
2864
+ const L = ae(I), Z = ae(l);
2865
+ return $n(L, Z, w);
2866
+ }, e.addHook = function(I, l) {
2867
+ typeof l == "function" && pt(E[I], l);
2868
+ }, e.removeHook = function(I, l) {
2864
2869
  if (l !== void 0) {
2865
- const w = to(M[$], l);
2866
- return w === -1 ? void 0 : no(M[$], w, 1)[0];
2870
+ const w = to(E[I], l);
2871
+ return w === -1 ? void 0 : no(E[I], w, 1)[0];
2867
2872
  }
2868
- return Yn(M[$]);
2869
- }, e.removeHooks = function($) {
2870
- M[$] = [];
2873
+ return Yn(E[I]);
2874
+ }, e.removeHooks = function(I) {
2875
+ E[I] = [];
2871
2876
  }, e.removeAllHooks = function() {
2872
- M = ss();
2877
+ E = ss();
2873
2878
  }, e;
2874
2879
  }
2875
2880
  var wo = Cs();
@@ -2952,7 +2957,7 @@ function Ea() {
2952
2957
  function r() {
2953
2958
  n && (n.disconnect(), n = null);
2954
2959
  }
2955
- return bt(() => {
2960
+ return vt(() => {
2956
2961
  r();
2957
2962
  }), {
2958
2963
  scrollToBottom: e,
@@ -3090,9 +3095,9 @@ function La(n, e) {
3090
3095
  };
3091
3096
  t(a);
3092
3097
  }
3093
- return vt(() => {
3098
+ return Tt(() => {
3094
3099
  i();
3095
- }), bt(() => {
3100
+ }), vt(() => {
3096
3101
  s();
3097
3102
  }), e && _e(
3098
3103
  () => o(),
@@ -3119,32 +3124,32 @@ function Co(n) {
3119
3124
  function Eo(n, e) {
3120
3125
  const t = n.key.toLowerCase();
3121
3126
  if (e.mod) {
3122
- const d = navigator.platform.toUpperCase().indexOf("MAC") >= 0 || navigator.userAgent.toUpperCase().indexOf("MAC") >= 0 ? n.metaKey : n.ctrlKey, c = e.shift ? n.shiftKey : !n.shiftKey, g = e.alt ? n.altKey : !n.altKey;
3123
- return t === e.key && d && c && g;
3127
+ const d = navigator.platform.toUpperCase().indexOf("MAC") >= 0 || navigator.userAgent.toUpperCase().indexOf("MAC") >= 0 ? n.metaKey : n.ctrlKey, c = e.shift ? n.shiftKey : !n.shiftKey, y = e.alt ? n.altKey : !n.altKey;
3128
+ return t === e.key && d && c && y;
3124
3129
  }
3125
3130
  const s = e.meta ? n.metaKey : !n.metaKey, r = e.ctrl ? n.ctrlKey : !n.ctrlKey, o = e.shift ? n.shiftKey : !n.shiftKey, i = e.alt ? n.altKey : !n.altKey;
3126
3131
  let a = s && r && o && i;
3127
3132
  return (e.meta && !e.ctrl || !e.meta && e.ctrl) && (a = (n.metaKey || n.ctrlKey) && o && i), t === e.key && a;
3128
3133
  }
3129
3134
  function Mo(n) {
3130
- const { onToggle: e, enabled: t = !0 } = n, s = q(!1), r = n.shortcut !== void 0 ? n.shortcut : Be("keyboardShortcut") ?? "mod+g";
3135
+ const { onToggle: e, enabled: t = !0 } = n, s = U(!1), r = n.shortcut !== void 0 ? n.shortcut : Be("keyboardShortcut") ?? "mod+g";
3131
3136
  if (r === null)
3132
3137
  return { isActive: s };
3133
3138
  const o = Co(r);
3134
3139
  function i(a) {
3135
3140
  if (!t) return;
3136
- const u = a.target, d = u.tagName === "INPUT" || u.tagName === "TEXTAREA", c = u.isContentEditable, g = u.closest("[data-ai-input]");
3137
- if (!((d || c) && !g) && Eo(a, o)) {
3141
+ const u = a.target, d = u.tagName === "INPUT" || u.tagName === "TEXTAREA", c = u.isContentEditable, y = u.closest("[data-ai-input]");
3142
+ if (!((d || c) && !y) && Eo(a, o)) {
3138
3143
  a.preventDefault(), a.stopPropagation();
3139
- const m = te();
3140
- if (m != null && m.canToggle && !m.canToggle())
3144
+ const x = te();
3145
+ if (x != null && x.canToggle && !x.canToggle())
3141
3146
  return;
3142
3147
  s.value = !s.value, e();
3143
3148
  }
3144
3149
  }
3145
- return vt(() => {
3150
+ return Tt(() => {
3146
3151
  window.addEventListener("keydown", i, !0);
3147
- }), bt(() => {
3152
+ }), vt(() => {
3148
3153
  window.removeEventListener("keydown", i, !0);
3149
3154
  }), { isActive: s };
3150
3155
  }
@@ -3157,7 +3162,7 @@ function Ia(n) {
3157
3162
  });
3158
3163
  }
3159
3164
  function Ro(n, e) {
3160
- const t = q(de("loadingText"));
3165
+ const t = U(de("loadingText"));
3161
3166
  let s = [];
3162
3167
  function r() {
3163
3168
  return [
@@ -3179,18 +3184,18 @@ function Ro(n, e) {
3179
3184
  }
3180
3185
  function u() {
3181
3186
  i();
3182
- const d = e == null ? void 0 : e(), c = (d == null ? void 0 : d.messages) ?? r(), g = (d == null ? void 0 : d.intervals) ?? o();
3187
+ const d = e == null ? void 0 : e(), c = (d == null ? void 0 : d.messages) ?? r(), y = (d == null ? void 0 : d.intervals) ?? o();
3183
3188
  t.value = c[0] || de("loadingText");
3184
- let m = 0;
3189
+ let x = 0;
3185
3190
  for (let f = 1; f < c.length; f++) {
3186
- m += g[f] || 2e3;
3187
- const p = f, A = window.setTimeout(() => {
3191
+ x += y[f] || 2e3;
3192
+ const p = f, D = window.setTimeout(() => {
3188
3193
  n() && (t.value = c[p]);
3189
- }, m);
3190
- s.push(A);
3194
+ }, x);
3195
+ s.push(D);
3191
3196
  }
3192
3197
  }
3193
- return bt(() => {
3198
+ return vt(() => {
3194
3199
  i();
3195
3200
  }), {
3196
3201
  loadingMessage: t,
@@ -3207,44 +3212,44 @@ function Lo(n) {
3207
3212
  getTexts: r,
3208
3213
  onStartNewChat: o,
3209
3214
  onNewChatEmit: i
3210
- } = n, a = q({
3215
+ } = n, a = U({
3211
3216
  showWarning: !1,
3212
3217
  isReached: !1,
3213
3218
  pendingMessage: null
3214
3219
  }), u = N(() => {
3215
- var E;
3216
- return ((E = s()) == null ? void 0 : E.limit) ?? t();
3220
+ var S;
3221
+ return ((S = s()) == null ? void 0 : S.limit) ?? t();
3217
3222
  }), d = N(() => {
3218
- var E;
3219
- return ((E = s()) == null ? void 0 : E.showWarningAt) ?? u.value - 2;
3220
- }), c = N(() => Math.max(0, u.value - e())), g = N(
3223
+ var S;
3224
+ return ((S = s()) == null ? void 0 : S.showWarningAt) ?? u.value - 2;
3225
+ }), c = N(() => Math.max(0, u.value - e())), y = N(
3221
3226
  () => c.value <= u.value - d.value && c.value > 0
3222
- ), m = N(() => c.value === 0), f = N(() => {
3223
- var E, T;
3224
- return a.value.isReached || m.value ? ((E = r()) == null ? void 0 : E.historyLimitReachedTitle) ?? "Chat Limit Reached" : ((T = r()) == null ? void 0 : T.historyLimitWarningTitle) ?? "Approaching Chat Limit";
3227
+ ), x = N(() => c.value === 0), f = N(() => {
3228
+ var S, b;
3229
+ return a.value.isReached || x.value ? ((S = r()) == null ? void 0 : S.historyLimitReachedTitle) ?? "Chat Limit Reached" : ((b = r()) == null ? void 0 : b.historyLimitWarningTitle) ?? "Approaching Chat Limit";
3225
3230
  }), p = N(() => {
3226
- var E, T, z, U;
3227
- return a.value.isReached || m.value ? ((E = s()) == null ? void 0 : E.limitMessage) ?? ((T = r()) == null ? void 0 : T.historyLimitReachedMessage) ?? "You have reached the maximum number of messages in this conversation. Start a new chat to continue." : ((z = s()) == null ? void 0 : z.warningMessage) ?? ((U = r()) == null ? void 0 : U.historyLimitWarningMessage) ?? `You have ${c.value} message${c.value === 1 ? "" : "s"} remaining in this conversation.`;
3231
+ var S, b, z, q;
3232
+ return a.value.isReached || x.value ? ((S = s()) == null ? void 0 : S.limitMessage) ?? ((b = r()) == null ? void 0 : b.historyLimitReachedMessage) ?? "You have reached the maximum number of messages in this conversation. Start a new chat to continue." : ((z = s()) == null ? void 0 : z.warningMessage) ?? ((q = r()) == null ? void 0 : q.historyLimitWarningMessage) ?? `You have ${c.value} message${c.value === 1 ? "" : "s"} remaining in this conversation.`;
3228
3233
  });
3229
- function A() {
3234
+ function D() {
3230
3235
  a.value.showWarning = !1, a.value.isReached = !1, a.value.pendingMessage = null;
3231
3236
  }
3232
- async function k() {
3237
+ async function g() {
3233
3238
  a.value.showWarning = !1;
3234
- const E = s();
3235
- if (E != null && E.onLimitReached && !await E.onLimitReached())
3239
+ const S = s();
3240
+ if (S != null && S.onLimitReached && !await S.onLimitReached())
3236
3241
  return a.value.isReached = !1, null;
3237
3242
  if (o(), i(), a.value.isReached = !1, a.value.pendingMessage) {
3238
- const T = a.value.pendingMessage;
3239
- return a.value.pendingMessage = null, T;
3243
+ const b = a.value.pendingMessage;
3244
+ return a.value.pendingMessage = null, b;
3240
3245
  }
3241
3246
  return null;
3242
3247
  }
3243
- function y() {
3244
- return m.value ? (a.value.isReached = !0, a.value.showWarning = !0, !1) : (g.value && !a.value.showWarning && (a.value.showWarning = !0), !0);
3248
+ function m() {
3249
+ return x.value ? (a.value.isReached = !0, a.value.showWarning = !0, !1) : (y.value && !a.value.showWarning && (a.value.showWarning = !0), !0);
3245
3250
  }
3246
- function S(E) {
3247
- a.value.pendingMessage = E;
3251
+ function C(S) {
3252
+ a.value.pendingMessage = S;
3248
3253
  }
3249
3254
  return {
3250
3255
  // State
@@ -3256,49 +3261,49 @@ function Lo(n) {
3256
3261
  historyLimitDialogTitle: f,
3257
3262
  historyLimitDialogMessage: p,
3258
3263
  // Actions
3259
- dismissHistoryLimitWarning: A,
3260
- handleHistoryLimitAction: k,
3261
- checkHistoryLimit: y,
3262
- setPendingMessage: S
3264
+ dismissHistoryLimitWarning: D,
3265
+ handleHistoryLimitAction: g,
3266
+ checkHistoryLimit: m,
3267
+ setPendingMessage: C
3263
3268
  };
3264
3269
  }
3265
3270
  function Io() {
3266
- const n = Ge(), e = q([]), t = q(!1), s = q(0), r = Be("maxAttachments") || 5, o = Be("maxFileSize") || 10 * 1024 * 1024, i = Be("acceptedFileTypes") || "image/*,.pdf,.txt,.doc,.docx,.xls,.xlsx,.csv", a = N(() => e.value.length > 0), u = N(() => e.value.some((C) => C.uploading)), d = N(() => e.value.length < r);
3267
- function c(C) {
3268
- return (C.type || "").startsWith("image/") ? !0 : /(png|jpe?g|gif|webp)$/i.test(C.name);
3271
+ const n = Ge(), e = U([]), t = U(!1), s = U(0), r = Be("maxAttachments") || 5, o = Be("maxFileSize") || 10 * 1024 * 1024, i = Be("acceptedFileTypes") || "image/*,.pdf,.txt,.doc,.docx,.xls,.xlsx,.csv", a = N(() => e.value.length > 0), u = N(() => e.value.some((A) => A.uploading)), d = N(() => e.value.length < r);
3272
+ function c(A) {
3273
+ return (A.type || "").startsWith("image/") ? !0 : /(png|jpe?g|gif|webp)$/i.test(A.name);
3269
3274
  }
3270
- function g(C) {
3271
- if (C == null) return "";
3272
- const _ = typeof C == "string" ? parseInt(C, 10) : C;
3275
+ function y(A) {
3276
+ if (A == null) return "";
3277
+ const _ = typeof A == "string" ? parseInt(A, 10) : A;
3273
3278
  return Number.isNaN(_) ? "" : _ >= 1024 * 1024 ? `${(_ / (1024 * 1024)).toFixed(1)} MB` : _ >= 1024 ? `${Math.round(_ / 1024)} KB` : `${_} B`;
3274
3279
  }
3275
- function m(C) {
3276
- var V;
3277
- const _ = crypto.randomUUID(), R = C.type.startsWith("image/") ? URL.createObjectURL(C) : void 0, M = te(), Z = !!((V = M == null ? void 0 : M.endpoints) != null && V.uploadFile), I = {
3280
+ function x(A) {
3281
+ var W;
3282
+ const _ = crypto.randomUUID(), R = A.type.startsWith("image/") ? URL.createObjectURL(A) : void 0, E = te(), Y = !!((W = E == null ? void 0 : E.endpoints) != null && W.uploadFile), M = {
3278
3283
  id: _,
3279
- name: C.name,
3280
- type: C.type,
3281
- size: C.size,
3282
- uploading: Z,
3283
- progress: Z ? 0 : 100,
3284
+ name: A.name,
3285
+ type: A.type,
3286
+ size: A.size,
3287
+ uploading: Y,
3288
+ progress: Y ? 0 : 100,
3284
3289
  previewUrl: R
3285
3290
  };
3286
- e.value.push(I), Z && f(C, _);
3291
+ e.value.push(M), Y && f(A, _);
3287
3292
  }
3288
- async function f(C, _) {
3293
+ async function f(A, _) {
3289
3294
  try {
3290
- const R = await n.uploadFile(C), M = e.value.findIndex((Z) => Z.id === _);
3291
- if (M === -1) return;
3295
+ const R = await n.uploadFile(A), E = e.value.findIndex((Y) => Y.id === _);
3296
+ if (E === -1) return;
3292
3297
  if (R) {
3293
- const Z = e.value[M].previewUrl;
3294
- e.value[M] = {
3295
- ...e.value[M],
3298
+ const Y = e.value[E].previewUrl;
3299
+ e.value[E] = {
3300
+ ...e.value[E],
3296
3301
  id: R.id || _,
3297
3302
  url: R.url,
3298
3303
  extractedText: R.extractedText,
3299
3304
  uploading: !1,
3300
3305
  progress: 100,
3301
- previewUrl: Z || R.previewUrl
3306
+ previewUrl: Y || R.previewUrl
3302
3307
  };
3303
3308
  } else
3304
3309
  p(_);
@@ -3306,57 +3311,57 @@ function Io() {
3306
3311
  p(_);
3307
3312
  }
3308
3313
  }
3309
- function p(C) {
3310
- const _ = e.value.findIndex((M) => M.id === C);
3314
+ function p(A) {
3315
+ const _ = e.value.findIndex((E) => E.id === A);
3311
3316
  if (_ === -1) return;
3312
3317
  const [R] = e.value.splice(_, 1);
3313
3318
  R != null && R.previewUrl && URL.revokeObjectURL(R.previewUrl);
3314
3319
  }
3315
- function A() {
3316
- e.value.forEach((C) => {
3317
- C.previewUrl && URL.revokeObjectURL(C.previewUrl);
3320
+ function D() {
3321
+ e.value.forEach((A) => {
3322
+ A.previewUrl && URL.revokeObjectURL(A.previewUrl);
3318
3323
  }), e.value = [];
3319
3324
  }
3320
- function k() {
3321
- return e.value.filter((C) => !C.uploading).map((C) => ({
3322
- id: C.id,
3323
- name: C.name,
3324
- url: C.url,
3325
- type: C.type,
3326
- size: C.size
3325
+ function g() {
3326
+ return e.value.filter((A) => !A.uploading).map((A) => ({
3327
+ id: A.id,
3328
+ name: A.name,
3329
+ url: A.url,
3330
+ type: A.type,
3331
+ size: A.size
3327
3332
  }));
3328
3333
  }
3329
- function y(C) {
3330
- if (!C) return;
3331
- const _ = Array.from(C);
3334
+ function m(A) {
3335
+ if (!A) return;
3336
+ const _ = Array.from(A);
3332
3337
  for (const R of _) {
3333
3338
  if (e.value.length >= r) break;
3334
- R.size > o || m(R);
3339
+ R.size > o || x(R);
3335
3340
  }
3336
3341
  }
3337
- function S(C) {
3342
+ function C(A) {
3338
3343
  var _;
3339
- return Array.from(((_ = C.dataTransfer) == null ? void 0 : _.types) || []).includes("Files");
3344
+ return Array.from(((_ = A.dataTransfer) == null ? void 0 : _.types) || []).includes("Files");
3340
3345
  }
3341
- function E(C) {
3342
- S(C) && (s.value += 1, t.value = !0);
3346
+ function S(A) {
3347
+ C(A) && (s.value += 1, t.value = !0);
3343
3348
  }
3344
- function T(C) {
3345
- S(C) || C.preventDefault();
3349
+ function b(A) {
3350
+ C(A) || A.preventDefault();
3346
3351
  }
3347
- function z(C) {
3348
- S(C) && (s.value = Math.max(0, s.value - 1), s.value === 0 && (t.value = !1));
3352
+ function z(A) {
3353
+ C(A) && (s.value = Math.max(0, s.value - 1), s.value === 0 && (t.value = !1));
3349
3354
  }
3350
- function U(C) {
3355
+ function q(A) {
3351
3356
  var _;
3352
- S(C) && (s.value = 0, t.value = !1, y(((_ = C.dataTransfer) == null ? void 0 : _.files) || null));
3357
+ C(A) && (s.value = 0, t.value = !1, m(((_ = A.dataTransfer) == null ? void 0 : _.files) || null));
3353
3358
  }
3354
- function J(C) {
3355
- const _ = C.target, R = _.files;
3356
- R && R.length && y(R), _.value = "";
3359
+ function G(A) {
3360
+ const _ = A.target, R = _.files;
3361
+ R && R.length && m(R), _.value = "";
3357
3362
  }
3358
3363
  return Us(() => {
3359
- A();
3364
+ D();
3360
3365
  }), {
3361
3366
  // State
3362
3367
  attachments: e,
@@ -3368,97 +3373,101 @@ function Io() {
3368
3373
  acceptedFileTypes: i,
3369
3374
  // Utils
3370
3375
  isImage: c,
3371
- formatFileSize: g,
3376
+ formatFileSize: y,
3372
3377
  // Actions
3373
3378
  removeAttachment: p,
3374
- clearAttachments: A,
3375
- buildPayload: k,
3376
- processFiles: y,
3377
- handleFileSelect: J,
3379
+ clearAttachments: D,
3380
+ buildPayload: g,
3381
+ processFiles: m,
3382
+ handleFileSelect: G,
3378
3383
  // Drag & Drop
3379
- handleDragEnter: E,
3380
- handleDragOver: T,
3384
+ handleDragEnter: S,
3385
+ handleDragOver: b,
3381
3386
  handleDragLeave: z,
3382
- handleDrop: U
3387
+ handleDrop: q
3383
3388
  };
3384
3389
  }
3385
3390
  function $o(n, e, t) {
3386
- const s = q(!1), r = q([]), o = q(0), i = q({ inMention: !1, query: "", startPos: 0 }), a = q([]), u = N(() => {
3387
- const A = te();
3388
- return (A == null ? void 0 : A.mentionProviders) || [];
3391
+ const s = U(!1), r = U([]), o = U(0), i = U({ inMention: !1, query: "", startPos: 0 }), a = U(!1), u = U([]), d = N(() => {
3392
+ const g = te();
3393
+ return (g == null ? void 0 : g.mentionProviders) || [];
3389
3394
  });
3390
- function d(A) {
3391
- const k = t();
3392
- if (!k) return;
3393
- const y = k.selectionStart, S = us(A, y);
3394
- i.value = S, S.inMention && S.query.length >= 0 ? c(S.query) : (s.value = !1, r.value = []);
3395
- }
3396
- async function c(A) {
3397
- const k = hs();
3398
- if (k.length === 0) {
3395
+ function c(g) {
3396
+ if (a.value) {
3397
+ a.value = !1;
3398
+ return;
3399
+ }
3400
+ const m = t();
3401
+ if (!m) return;
3402
+ const C = m.selectionStart, S = us(g, C);
3403
+ i.value = S, S.inMention && S.query.length >= 0 ? y(S.query) : (s.value = !1, r.value = []);
3404
+ }
3405
+ async function y(g) {
3406
+ const m = hs();
3407
+ if (m.length === 0) {
3399
3408
  s.value = !1;
3400
3409
  return;
3401
3410
  }
3402
- const y = [];
3403
- for (const S of k)
3411
+ const C = [];
3412
+ for (const S of m)
3404
3413
  try {
3405
- const E = await S.search(A);
3406
- y.push(...E.map((T) => ({ ...T, type: S.type })));
3407
- } catch (E) {
3408
- console.warn(`Mention provider ${S.type} failed:`, E);
3414
+ const b = await S.search(g);
3415
+ C.push(...b.map((z) => ({ ...z, type: S.type })));
3416
+ } catch (b) {
3417
+ console.warn(`Mention provider ${S.type} failed:`, b);
3409
3418
  }
3410
- r.value = y.slice(0, 10), s.value = y.length > 0, o.value = 0;
3411
- }
3412
- function g(A) {
3413
- const { startPos: k } = i.value, y = n(), S = t(), E = y.slice(0, k), T = y.slice((S == null ? void 0 : S.selectionStart) || k), z = A.name || A.label || A.title || A.id;
3414
- e(`${E}@${z} ${T}`), a.value.push({
3415
- id: A.id,
3416
- name: z,
3417
- type: A.type,
3418
- metadata: A.attributes
3419
+ r.value = C.slice(0, 10), s.value = C.length > 0, o.value = 0;
3420
+ }
3421
+ function x(g) {
3422
+ const { startPos: m } = i.value, C = n(), S = t(), b = C.slice(0, m), z = C.slice((S == null ? void 0 : S.selectionStart) || m), q = g.name || g.label || g.title || g.id;
3423
+ a.value = !0, e(`${b}@${q} ${z}`), u.value.push({
3424
+ id: g.id,
3425
+ name: q,
3426
+ type: g.type,
3427
+ metadata: g.attributes
3419
3428
  }), s.value = !1, r.value = [], setTimeout(() => {
3420
- const U = t();
3421
- U == null || U.focus();
3422
- const J = E.length + z.length + 2;
3423
- U == null || U.setSelectionRange(J, J);
3429
+ const G = t();
3430
+ G == null || G.focus();
3431
+ const A = b.length + q.length + 2;
3432
+ G == null || G.setSelectionRange(A, A);
3424
3433
  }, 0);
3425
3434
  }
3426
- function m(A) {
3435
+ function f(g) {
3427
3436
  if (!s.value || r.value.length === 0)
3428
3437
  return !1;
3429
- if (A.key === "ArrowDown")
3430
- return A.preventDefault(), o.value = Math.min(o.value + 1, r.value.length - 1), !0;
3431
- if (A.key === "ArrowUp")
3432
- return A.preventDefault(), o.value = Math.max(o.value - 1, 0), !0;
3433
- if (A.key === "Enter" || A.key === "Tab") {
3434
- A.preventDefault();
3435
- const k = r.value[o.value];
3436
- return k && g(k), !0;
3438
+ if (g.key === "ArrowDown")
3439
+ return g.preventDefault(), o.value = Math.min(o.value + 1, r.value.length - 1), !0;
3440
+ if (g.key === "ArrowUp")
3441
+ return g.preventDefault(), o.value = Math.max(o.value - 1, 0), !0;
3442
+ if (g.key === "Enter" || g.key === "Tab") {
3443
+ g.preventDefault();
3444
+ const m = r.value[o.value];
3445
+ return m && x(m), !0;
3437
3446
  }
3438
- return A.key === "Escape" ? (A.preventDefault(), s.value = !1, !0) : !1;
3439
- }
3440
- function f() {
3441
- a.value = [];
3447
+ return g.key === "Escape" ? (g.preventDefault(), s.value = !1, !0) : !1;
3442
3448
  }
3443
3449
  function p() {
3444
- return [...a.value];
3450
+ u.value = [];
3451
+ }
3452
+ function D() {
3453
+ return [...u.value];
3445
3454
  }
3446
3455
  return {
3447
3456
  // State
3448
3457
  showMentions: s,
3449
3458
  mentionItems: r,
3450
3459
  selectedMentionIndex: o,
3451
- mentionProviders: u,
3460
+ mentionProviders: d,
3452
3461
  // Actions
3453
- checkForMentions: d,
3454
- handleMentionSelect: g,
3455
- handleMentionKeyDown: m,
3456
- clearMentions: f,
3457
- getMentions: p
3462
+ checkForMentions: c,
3463
+ handleMentionSelect: x,
3464
+ handleMentionKeyDown: f,
3465
+ clearMentions: p,
3466
+ getMentions: D
3458
3467
  };
3459
3468
  }
3460
3469
  function Do(n, e, t, s, r) {
3461
- const o = q(!1), i = q(-1), a = q(null);
3470
+ const o = U(!1), i = U(-1), a = U(null);
3462
3471
  function u() {
3463
3472
  setTimeout(() => {
3464
3473
  const f = a.value;
@@ -3477,19 +3486,19 @@ function Do(n, e, t, s, r) {
3477
3486
  return f.preventDefault(), i.value = Math.max(i.value - 1, 0), u(), !0;
3478
3487
  if (f.key === "Enter" && i.value >= 0) {
3479
3488
  f.preventDefault();
3480
- const A = p[i.value];
3481
- return A && c(A), !0;
3489
+ const D = p[i.value];
3490
+ return D && c(D), !0;
3482
3491
  }
3483
3492
  return f.key === "Escape" ? (f.preventDefault(), o.value = !1, i.value = -1, !0) : !1;
3484
3493
  }
3485
3494
  function c(f) {
3486
3495
  r(f), o.value = !1, i.value = -1;
3487
3496
  }
3488
- function g() {
3489
- const f = s(), p = e(), A = t(), k = n();
3490
- f && !p && A && k.length > 0 ? o.value = !0 : o.value = !1;
3497
+ function y() {
3498
+ const f = s(), p = e(), D = t(), g = n();
3499
+ f && !p && D && g.length > 0 ? o.value = !0 : o.value = !1;
3491
3500
  }
3492
- function m() {
3501
+ function x() {
3493
3502
  o.value = !1, i.value = -1;
3494
3503
  }
3495
3504
  return {
@@ -3498,8 +3507,8 @@ function Do(n, e, t, s, r) {
3498
3507
  dropdownRef: a,
3499
3508
  handleSuggestionKeyDown: d,
3500
3509
  handleSuggestionClick: c,
3501
- updateSuggestionsVisibility: g,
3502
- hideSuggestions: m
3510
+ updateSuggestionsVisibility: y,
3511
+ hideSuggestions: x
3503
3512
  };
3504
3513
  }
3505
3514
  function Oo(n, e = 300) {
@@ -3510,7 +3519,7 @@ function Oo(n, e = 300) {
3510
3519
  const r = Math.min(s.scrollHeight, e);
3511
3520
  s.style.height = `${r}px`, s.style.overflowY = s.scrollHeight > e ? "auto" : "hidden";
3512
3521
  }
3513
- return vt(() => {
3522
+ return Tt(() => {
3514
3523
  setTimeout(t, 0);
3515
3524
  }), {
3516
3525
  adjustTextareaHeight: t
@@ -3524,14 +3533,14 @@ const No = /* @__PURE__ */ he({
3524
3533
  setup(n) {
3525
3534
  return (e, t) => {
3526
3535
  var s;
3527
- return x(), v("div", {
3528
- class: b(["w-6 h-6 min-w-[24px] flex items-center justify-center rounded-full border border-gray-300 dark:border-gray-600", (s = n.ui) == null ? void 0 : s.container])
3536
+ return k(), T("div", {
3537
+ class: v(["w-6 h-6 min-w-[24px] flex items-center justify-center rounded-full border border-gray-300 dark:border-gray-600", (s = n.ui) == null ? void 0 : s.container])
3529
3538
  }, [
3530
3539
  ce(e.$slots, "default", {}, () => {
3531
3540
  var r;
3532
3541
  return [
3533
- (x(), v("svg", {
3534
- class: b(["w-4 h-4 text-gray-400 dark:text-gray-500", (r = n.ui) == null ? void 0 : r.icon]),
3542
+ (k(), T("svg", {
3543
+ class: v(["w-4 h-4 text-gray-400 dark:text-gray-500", (r = n.ui) == null ? void 0 : r.icon]),
3535
3544
  fill: "none",
3536
3545
  viewBox: "0 0 24 24",
3537
3546
  stroke: "currentColor",
@@ -3556,17 +3565,17 @@ const No = /* @__PURE__ */ he({
3556
3565
  setup(n) {
3557
3566
  return (e, t) => {
3558
3567
  var s;
3559
- return x(), v("div", {
3560
- class: b(["w-8 h-8 rounded-full bg-gray-200 dark:bg-gray-700 flex items-center justify-center flex-shrink-0", (s = n.ui) == null ? void 0 : s.container])
3568
+ return k(), T("div", {
3569
+ class: v(["w-8 h-8 rounded-full bg-gray-200 dark:bg-gray-700 flex items-center justify-center flex-shrink-0", (s = n.ui) == null ? void 0 : s.container])
3561
3570
  }, [
3562
3571
  ce(e.$slots, "default", {}, () => {
3563
3572
  var r;
3564
3573
  return [
3565
- (x(), v("svg", {
3574
+ (k(), T("svg", {
3566
3575
  xmlns: "http://www.w3.org/2000/svg",
3567
3576
  viewBox: "0 0 24 24",
3568
3577
  fill: "currentColor",
3569
- class: b(["w-5 h-5 text-gray-500 dark:text-gray-400", (r = n.ui) == null ? void 0 : r.icon])
3578
+ class: v(["w-5 h-5 text-gray-500 dark:text-gray-400", (r = n.ui) == null ? void 0 : r.icon])
3570
3579
  }, [...t[0] || (t[0] = [
3571
3580
  h("path", {
3572
3581
  "fill-rule": "evenodd",
@@ -3590,106 +3599,106 @@ const No = /* @__PURE__ */ he({
3590
3599
  },
3591
3600
  emits: ["select", "update:selectedIndex"],
3592
3601
  setup(n, { emit: e }) {
3593
- const t = n, s = N(() => t.ui || {}), r = e, o = q(t.selectedIndex);
3594
- _e(() => t.selectedIndex, (k) => {
3595
- o.value = k;
3596
- }), _e(o, (k) => {
3597
- r("update:selectedIndex", k);
3602
+ const t = n, s = N(() => t.ui || {}), r = e, o = U(t.selectedIndex);
3603
+ _e(() => t.selectedIndex, (g) => {
3604
+ o.value = g;
3605
+ }), _e(o, (g) => {
3606
+ r("update:selectedIndex", g);
3598
3607
  });
3599
3608
  const i = N(() => {
3600
- const k = {};
3601
- return t.items.forEach((y) => {
3602
- const S = y.type || "default";
3603
- k[S] || (k[S] = []), k[S].push(y);
3604
- }), k;
3609
+ const g = {};
3610
+ return t.items.forEach((m) => {
3611
+ const C = m.type || "default";
3612
+ g[C] || (g[C] = []), g[C].push(m);
3613
+ }), g;
3605
3614
  });
3606
- function a(k) {
3607
- return t.providers.find((y) => y.type === k) || ds(k);
3615
+ function a(g) {
3616
+ return t.providers.find((m) => m.type === g) || ds(g);
3608
3617
  }
3609
- function u(k) {
3610
- const y = a(k);
3611
- return (y == null ? void 0 : y.label) || k.charAt(0).toUpperCase() + k.slice(1) + "s";
3618
+ function u(g) {
3619
+ const m = a(g);
3620
+ return (m == null ? void 0 : m.label) || g.charAt(0).toUpperCase() + g.slice(1) + "s";
3612
3621
  }
3613
- function d(k, y) {
3614
- let S = 0;
3615
- const E = Object.keys(i.value);
3616
- for (const T of E) {
3617
- if (T === k)
3618
- return S + y;
3619
- S += i.value[T].length;
3622
+ function d(g, m) {
3623
+ let C = 0;
3624
+ const S = Object.keys(i.value);
3625
+ for (const b of S) {
3626
+ if (b === g)
3627
+ return C + m;
3628
+ C += i.value[b].length;
3620
3629
  }
3621
- return S;
3630
+ return C;
3622
3631
  }
3623
- function c(k) {
3624
- r("select", k);
3632
+ function c(g) {
3633
+ r("select", g);
3625
3634
  }
3626
- function g(k) {
3627
- o.value = k, r("update:selectedIndex", k);
3635
+ function y(g) {
3636
+ o.value = g, r("update:selectedIndex", g);
3628
3637
  }
3629
- function m(k) {
3630
- const y = a(k.type);
3631
- return dn(k, y);
3638
+ function x(g) {
3639
+ const m = a(g.type);
3640
+ return dn(g, m);
3632
3641
  }
3633
- function f(k) {
3634
- const y = a(k.type);
3635
- return cs(k, y);
3642
+ function f(g) {
3643
+ const m = a(g.type);
3644
+ return cs(g, m);
3636
3645
  }
3637
- function p(k) {
3638
- const y = {
3646
+ function p(g) {
3647
+ const m = {
3639
3648
  employee: "bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400",
3640
3649
  job: "bg-green-100 dark:bg-green-900/30 text-green-600 dark:text-green-400",
3641
3650
  candidate: "bg-purple-100 dark:bg-purple-900/30 text-purple-600 dark:text-purple-400",
3642
3651
  project: "bg-orange-100 dark:bg-orange-900/30 text-orange-600 dark:text-orange-400",
3643
3652
  default: "bg-primary/10 text-primary"
3644
3653
  };
3645
- return y[k] || y.default;
3654
+ return m[g] || m.default;
3646
3655
  }
3647
- function A(k) {
3648
- return k.split(" ").map((y) => y[0]).join("").slice(0, 2).toUpperCase();
3656
+ function D(g) {
3657
+ return g.split(" ").map((m) => m[0]).join("").slice(0, 2).toUpperCase();
3649
3658
  }
3650
- return (k, y) => n.items.length > 0 ? (x(), v("div", {
3659
+ return (g, m) => n.items.length > 0 ? (k(), T("div", {
3651
3660
  key: 0,
3652
- class: b(["absolute bottom-full left-0 right-0 mb-2 bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-lg max-h-60 overflow-y-auto z-50", s.value.root])
3661
+ class: v(["absolute bottom-full left-0 right-0 mb-2 bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-lg max-h-60 overflow-y-auto z-50", s.value.root])
3653
3662
  }, [
3654
3663
  h("div", {
3655
- class: b(["p-2", s.value.container])
3664
+ class: v(["p-2", s.value.container])
3656
3665
  }, [
3657
- (x(!0), v(be, null, Fe(i.value, (S, E) => (x(), v(be, { key: E }, [
3658
- Object.keys(i.value).length > 1 ? (x(), v("div", {
3666
+ (k(!0), T(be, null, Fe(i.value, (C, S) => (k(), T(be, { key: S }, [
3667
+ Object.keys(i.value).length > 1 ? (k(), T("div", {
3659
3668
  key: 0,
3660
- class: b(["px-3 py-1.5 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide", s.value.groupHeader])
3661
- }, P(u(E)), 3)) : F("", !0),
3662
- (x(!0), v(be, null, Fe(S, (T, z) => (x(), v("button", {
3663
- key: T.id,
3669
+ class: v(["px-3 py-1.5 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide", s.value.groupHeader])
3670
+ }, P(u(S)), 3)) : F("", !0),
3671
+ (k(!0), T(be, null, Fe(C, (b, z) => (k(), T("button", {
3672
+ key: b.id,
3664
3673
  type: "button",
3665
- class: b(["w-full flex items-center gap-3 px-3 py-2 rounded-lg text-left transition-colors mb-0.5", [
3674
+ class: v(["w-full flex items-center gap-3 px-3 py-2 rounded-lg text-left transition-colors mb-0.5", [
3666
3675
  s.value.item,
3667
3676
  {
3668
- [s.value.itemSelected || "bg-primary/10"]: d(E, z) === o.value,
3669
- "hover:bg-gray-50 dark:hover:bg-gray-700": d(E, z) !== o.value
3677
+ [s.value.itemSelected || "bg-primary/10"]: d(S, z) === o.value,
3678
+ "hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer": d(S, z) !== o.value
3670
3679
  }
3671
3680
  ]]),
3672
- onClick: (U) => c(T),
3673
- onMouseenter: (U) => g(d(E, z))
3681
+ onClick: (q) => c(b),
3682
+ onMouseenter: (q) => y(d(S, z))
3674
3683
  }, [
3675
- ce(k.$slots, "item-icon", {
3676
- item: T,
3677
- type: E
3684
+ ce(g.$slots, "item-icon", {
3685
+ item: b,
3686
+ type: S
3678
3687
  }, () => [
3679
3688
  h("span", {
3680
- class: b(["w-8 h-8 flex items-center justify-center rounded-full text-xs font-semibold flex-shrink-0", [s.value.itemIcon, p(T.type)]])
3681
- }, P(A(m(T))), 3)
3689
+ class: v(["w-8 h-8 flex items-center justify-center rounded-full text-xs font-semibold flex-shrink-0", [s.value.itemIcon, p(b.type)]])
3690
+ }, P(D(x(b))), 3)
3682
3691
  ]),
3683
3692
  h("div", {
3684
- class: b(["flex-1 min-w-0", s.value.itemContent])
3693
+ class: v(["flex-1 min-w-0", s.value.itemContent])
3685
3694
  }, [
3686
3695
  h("p", {
3687
- class: b(["text-sm font-medium text-gray-900 dark:text-gray-100 truncate", s.value.itemName])
3688
- }, P(m(T)), 3),
3689
- f(T) ? (x(), v("p", {
3696
+ class: v(["text-sm font-medium text-gray-900 dark:text-gray-100 truncate", s.value.itemName])
3697
+ }, P(x(b)), 3),
3698
+ f(b) ? (k(), T("p", {
3690
3699
  key: 0,
3691
- class: b(["text-xs text-gray-500 dark:text-gray-400 truncate", s.value.itemSubtitle])
3692
- }, P(f(T)), 3)) : F("", !0)
3700
+ class: v(["text-xs text-gray-500 dark:text-gray-400 truncate", s.value.itemSubtitle])
3701
+ }, P(f(b)), 3)) : F("", !0)
3693
3702
  ], 2)
3694
3703
  ], 42, Po))), 128))
3695
3704
  ], 64))), 128))
@@ -3717,7 +3726,7 @@ const No = /* @__PURE__ */ he({
3717
3726
  copyToClipboard: "copyToClipboard",
3718
3727
  copied: "copied"
3719
3728
  }[u]);
3720
- }, o = N(() => t.ui || {}), i = q(!1);
3729
+ }, o = N(() => t.ui || {}), i = U(!1);
3721
3730
  async function a() {
3722
3731
  try {
3723
3732
  await navigator.clipboard.writeText(t.message.message), i.value = !0, s("copy", t.message), setTimeout(() => {
@@ -3727,18 +3736,18 @@ const No = /* @__PURE__ */ he({
3727
3736
  console.error("Failed to copy:", u);
3728
3737
  }
3729
3738
  }
3730
- return (u, d) => (x(), v("div", {
3731
- class: b(["flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity", o.value.container])
3739
+ return (u, d) => (k(), T("div", {
3740
+ class: v(["flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity", o.value.container])
3732
3741
  }, [
3733
3742
  h("button", {
3734
3743
  type: "button",
3735
- class: b(["p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors", [o.value.button, o.value.copyButton]]),
3744
+ class: v(["p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors", [o.value.button, o.value.copyButton]]),
3736
3745
  title: i.value ? r("copied") : r("copyToClipboard"),
3737
3746
  onClick: a
3738
3747
  }, [
3739
- i.value ? (x(), v("svg", {
3748
+ i.value ? (k(), T("svg", {
3740
3749
  key: 1,
3741
- class: b(["w-4 h-4 text-green-500", o.value.successState]),
3750
+ class: v(["w-4 h-4 text-green-500", o.value.successState]),
3742
3751
  fill: "none",
3743
3752
  viewBox: "0 0 24 24",
3744
3753
  stroke: "currentColor"
@@ -3749,7 +3758,7 @@ const No = /* @__PURE__ */ he({
3749
3758
  "stroke-width": "2",
3750
3759
  d: "M5 13l4 4L19 7"
3751
3760
  }, null, -1)
3752
- ])], 2)) : (x(), v("svg", Ho, [...d[0] || (d[0] = [
3761
+ ])], 2)) : (k(), T("svg", Ho, [...d[0] || (d[0] = [
3753
3762
  h("path", {
3754
3763
  "stroke-linecap": "round",
3755
3764
  "stroke-linejoin": "round",
@@ -3794,51 +3803,51 @@ const No = /* @__PURE__ */ he({
3794
3803
  },
3795
3804
  emits: ["copy"],
3796
3805
  setup(n, { emit: e }) {
3797
- const t = n, s = e, r = (y) => {
3798
- var E;
3799
- return (E = t.texts) != null && E[y] ? t.texts[y] : {
3806
+ const t = n, s = e, r = (m) => {
3807
+ var S;
3808
+ return (S = t.texts) != null && S[m] ? t.texts[m] : {
3800
3809
  loadingText: "Gathering data...",
3801
3810
  showMore: "Show more",
3802
3811
  showLess: "Show less",
3803
3812
  openAttachment: "Open",
3804
3813
  attachment: "Attachment"
3805
- }[y] || y;
3806
- }, o = N(() => t.ui || {}), { parseMarkdown: i } = bo(), a = q(!1), u = N(() => t.message.attachments ?? []), d = N(() => u.value.length > 0), c = N(() => {
3814
+ }[m] || m;
3815
+ }, o = N(() => t.ui || {}), { parseMarkdown: i } = bo(), a = U(!1), u = N(() => t.message.attachments ?? []), d = N(() => u.value.length > 0), c = N(() => {
3807
3816
  if (t.message.role !== "user") return !1;
3808
- const y = t.message.message || "", S = y.split(`
3817
+ const m = t.message.message || "", C = m.split(`
3809
3818
  `).length;
3810
- return y.length > 200 || S > 4;
3819
+ return m.length > 200 || C > 4;
3811
3820
  });
3812
- function g() {
3821
+ function y() {
3813
3822
  a.value = !a.value;
3814
3823
  }
3815
- function m(y) {
3816
- return (y.type || "").startsWith("image/") ? !0 : /(png|jpe?g|gif|webp)$/i.test(y.name || "");
3824
+ function x(m) {
3825
+ return (m.type || "").startsWith("image/") ? !0 : /(png|jpe?g|gif|webp)$/i.test(m.name || "");
3817
3826
  }
3818
3827
  const f = N(() => {
3819
- const y = te();
3820
- return y != null && y.userAvatar ? typeof y.userAvatar == "string" ? y.userAvatar : typeof y.userAvatar == "function" ? y.userAvatar() : null : null;
3828
+ const m = te();
3829
+ return m != null && m.userAvatar ? typeof m.userAvatar == "string" ? m.userAvatar : typeof m.userAvatar == "function" ? m.userAvatar() : null : null;
3821
3830
  });
3822
- function p(y) {
3823
- if (y == null) return "";
3824
- const S = typeof y == "string" ? parseInt(y, 10) : y;
3825
- return Number.isNaN(S) ? "" : S >= 1024 * 1024 ? `${(S / (1024 * 1024)).toFixed(1)} MB` : S >= 1024 ? `${Math.round(S / 1024)} KB` : `${S} B`;
3831
+ function p(m) {
3832
+ if (m == null) return "";
3833
+ const C = typeof m == "string" ? parseInt(m, 10) : m;
3834
+ return Number.isNaN(C) ? "" : C >= 1024 * 1024 ? `${(C / (1024 * 1024)).toFixed(1)} MB` : C >= 1024 ? `${Math.round(C / 1024)} KB` : `${C} B`;
3826
3835
  }
3827
- const A = N(() => {
3836
+ const D = N(() => {
3828
3837
  if (t.message.role === "assistant") {
3829
- let y = t.message.message;
3830
- return y = y.replace(/\\n/g, `
3831
- `), i(y);
3838
+ let m = t.message.message;
3839
+ return m = m.replace(/\\n/g, `
3840
+ `), i(m);
3832
3841
  }
3833
3842
  return t.message.message;
3834
3843
  });
3835
- function k(y) {
3836
- s("copy", y);
3844
+ function g(m) {
3845
+ s("copy", m);
3837
3846
  }
3838
- return (y, S) => {
3839
- var E;
3840
- return x(), v("div", {
3841
- class: b(["group relative animate-in fade-in slide-in-from-bottom-2 duration-300", [
3847
+ return (m, C) => {
3848
+ var S;
3849
+ return k(), T("div", {
3850
+ class: v(["group relative animate-in fade-in slide-in-from-bottom-2 duration-300", [
3842
3851
  o.value.root,
3843
3852
  {
3844
3853
  "flex justify-end": n.message.role === "user",
@@ -3846,41 +3855,41 @@ const No = /* @__PURE__ */ he({
3846
3855
  }
3847
3856
  ]])
3848
3857
  }, [
3849
- n.message.role === "user" ? (x(), v("div", {
3858
+ n.message.role === "user" ? (k(), T("div", {
3850
3859
  key: 0,
3851
- class: b(["flex gap-3 justify-end", o.value.userMessage])
3860
+ class: v(["flex gap-3 justify-end", o.value.userMessage])
3852
3861
  }, [
3853
3862
  h("div", {
3854
- class: b(["rounded-2xl px-4 py-3 bg-primary-500 text-white max-w-fit", o.value.userBubble])
3863
+ class: v(["rounded-2xl px-4 py-3 bg-primary-500 text-white max-w-fit", o.value.userBubble])
3855
3864
  }, [
3856
- n.message.message ? (x(), v("p", {
3865
+ n.message.message ? (k(), T("p", {
3857
3866
  key: 0,
3858
- class: b(["text-sm whitespace-pre-wrap", [o.value.content, { "line-clamp-4": !a.value && c.value }]])
3867
+ class: v(["text-sm whitespace-pre-wrap", [o.value.content, { "line-clamp-4": !a.value && c.value }]])
3859
3868
  }, P(n.message.message), 3)) : F("", !0),
3860
- c.value ? (x(), v("button", {
3869
+ c.value ? (k(), T("button", {
3861
3870
  key: 1,
3862
- class: b(["mt-2 text-xs text-white/80 hover:text-white underline", o.value.showMoreButton]),
3863
- onClick: g
3871
+ class: v(["mt-2 text-xs text-white/80 hover:text-white underline", o.value.showMoreButton]),
3872
+ onClick: y
3864
3873
  }, P(a.value ? r("showLess") : r("showMore")), 3)) : F("", !0),
3865
- d.value ? (x(), v("div", {
3874
+ d.value ? (k(), T("div", {
3866
3875
  key: 2,
3867
- class: b(["mt-3 space-y-2", o.value.attachmentsContainer])
3876
+ class: v(["mt-3 space-y-2", o.value.attachmentsContainer])
3868
3877
  }, [
3869
- (x(!0), v(be, null, Fe(u.value, (T) => (x(), Ee(nn(T.url ? "a" : "div"), {
3870
- key: T.id,
3871
- href: T.url || void 0,
3872
- target: T.url ? "_blank" : void 0,
3878
+ (k(!0), T(be, null, Fe(u.value, (b) => (k(), Ee(nn(b.url ? "a" : "div"), {
3879
+ key: b.id,
3880
+ href: b.url || void 0,
3881
+ target: b.url ? "_blank" : void 0,
3873
3882
  rel: "noopener noreferrer",
3874
- class: b(["flex items-center gap-3 rounded-xl border border-white/20 bg-white/10 p-2 transition", [o.value.attachmentItem, T.url ? "hover:bg-white/20 cursor-pointer" : ""]])
3883
+ class: v(["flex items-center gap-3 rounded-xl border border-white/20 bg-white/10 p-2 transition", [o.value.attachmentItem, b.url ? "hover:bg-white/20 cursor-pointer" : ""]])
3875
3884
  }, {
3876
3885
  default: Ae(() => [
3877
3886
  h("div", Fo, [
3878
- T.url && m(T) ? (x(), v("img", {
3887
+ b.url && x(b) ? (k(), T("img", {
3879
3888
  key: 0,
3880
- src: T.url,
3889
+ src: b.url,
3881
3890
  class: "object-cover h-full w-full",
3882
3891
  alt: ""
3883
- }, null, 8, Uo)) : (x(), v("svg", qo, [...S[0] || (S[0] = [
3892
+ }, null, 8, Uo)) : (k(), T("svg", qo, [...C[0] || (C[0] = [
3884
3893
  h("path", {
3885
3894
  "stroke-linecap": "round",
3886
3895
  "stroke-linejoin": "round",
@@ -3890,24 +3899,24 @@ const No = /* @__PURE__ */ he({
3890
3899
  ])]))
3891
3900
  ]),
3892
3901
  h("div", jo, [
3893
- h("p", Wo, P(T.name || r("attachment")), 1),
3894
- h("p", Ko, P(p(T.size)), 1)
3902
+ h("p", Wo, P(b.name || r("attachment")), 1),
3903
+ h("p", Ko, P(p(b.size)), 1)
3895
3904
  ]),
3896
- T.url ? (x(), v("span", Vo, P(r("openAttachment")), 1)) : F("", !0)
3905
+ b.url ? (k(), T("span", Vo, P(r("openAttachment")), 1)) : F("", !0)
3897
3906
  ]),
3898
3907
  _: 2
3899
3908
  }, 1032, ["href", "target", "class"]))), 128))
3900
3909
  ], 2)) : F("", !0)
3901
3910
  ], 2),
3902
3911
  h("div", {
3903
- class: b(["flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary-500 overflow-hidden", o.value.userAvatar])
3912
+ class: v(["flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary-500 overflow-hidden", o.value.userAvatar])
3904
3913
  }, [
3905
- f.value ? (x(), v("img", {
3914
+ f.value ? (k(), T("img", {
3906
3915
  key: 0,
3907
3916
  src: f.value,
3908
3917
  alt: "User",
3909
3918
  class: "h-full w-full object-cover"
3910
- }, null, 8, Go)) : (x(), v("svg", Qo, [...S[1] || (S[1] = [
3919
+ }, null, 8, Go)) : (k(), T("svg", Qo, [...C[1] || (C[1] = [
3911
3920
  h("path", {
3912
3921
  "fill-rule": "evenodd",
3913
3922
  d: "M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z",
@@ -3915,23 +3924,23 @@ const No = /* @__PURE__ */ he({
3915
3924
  }, null, -1)
3916
3925
  ])]))
3917
3926
  ], 2)
3918
- ], 2)) : (x(), v("div", {
3927
+ ], 2)) : (k(), T("div", {
3919
3928
  key: 1,
3920
- class: b(["flex items-start gap-3", o.value.assistantMessage])
3929
+ class: v(["flex items-start gap-3", o.value.assistantMessage])
3921
3930
  }, [
3922
3931
  h("div", Zo, [
3923
3932
  ye(No)
3924
3933
  ]),
3925
3934
  h("div", {
3926
- class: b(["bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 px-4 py-3 shadow-sm rounded-2xl transition-all duration-200 max-w-[85%]", o.value.assistantBubble])
3935
+ class: v(["bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 px-4 py-3 shadow-sm rounded-2xl transition-all duration-200 max-w-[85%]", o.value.assistantBubble])
3927
3936
  }, [
3928
- n.message.loading ? (x(), v("div", {
3937
+ n.message.loading ? (k(), T("div", {
3929
3938
  key: 0,
3930
- class: b(["flex items-center gap-2 text-sm min-w-[150px]", o.value.loadingIndicator])
3939
+ class: v(["flex items-center gap-2 text-sm min-w-[150px]", o.value.loadingIndicator])
3931
3940
  }, [
3932
3941
  h("div", {
3933
- class: b(["flex space-x-1", o.value.loadingDots])
3934
- }, [...S[2] || (S[2] = [
3942
+ class: v(["flex space-x-1", o.value.loadingDots])
3943
+ }, [...C[2] || (C[2] = [
3935
3944
  h("div", {
3936
3945
  class: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
3937
3946
  style: { "animation-delay": "0ms" }
@@ -3945,32 +3954,32 @@ const No = /* @__PURE__ */ he({
3945
3954
  style: { "animation-delay": "300ms" }
3946
3955
  }, null, -1)
3947
3956
  ])], 2),
3948
- h("span", Yo, P(((E = n.texts) == null ? void 0 : E.loadingText) || n.loadingText), 1)
3949
- ], 2)) : n.message.message ? (x(), v("div", {
3957
+ h("span", Yo, P(((S = n.texts) == null ? void 0 : S.loadingText) || n.loadingText), 1)
3958
+ ], 2)) : n.message.message ? (k(), T("div", {
3950
3959
  key: 1,
3951
3960
  id: n.message.id,
3952
- class: b(["text-sm text-gray-700 dark:text-gray-200 leading-relaxed", o.value.content]),
3953
- innerHTML: A.value
3961
+ class: v(["text-sm text-gray-700 dark:text-gray-200 leading-relaxed", o.value.content]),
3962
+ innerHTML: D.value
3954
3963
  }, null, 10, Xo)) : F("", !0),
3955
- !n.message.loading && d.value ? (x(), v("div", {
3964
+ !n.message.loading && d.value ? (k(), T("div", {
3956
3965
  key: 2,
3957
- class: b(["mt-4 space-y-2", o.value.attachmentsContainer])
3966
+ class: v(["mt-4 space-y-2", o.value.attachmentsContainer])
3958
3967
  }, [
3959
- (x(!0), v(be, null, Fe(u.value, (T) => (x(), Ee(nn(T.url ? "a" : "div"), {
3960
- key: T.id,
3961
- href: T.url || void 0,
3962
- target: T.url ? "_blank" : void 0,
3968
+ (k(!0), T(be, null, Fe(u.value, (b) => (k(), Ee(nn(b.url ? "a" : "div"), {
3969
+ key: b.id,
3970
+ href: b.url || void 0,
3971
+ target: b.url ? "_blank" : void 0,
3963
3972
  rel: "noopener noreferrer",
3964
- class: b(["flex items-center gap-3 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 p-3 transition", [o.value.attachmentItem, T.url ? "hover:bg-white dark:hover:bg-gray-600 cursor-pointer" : ""]])
3973
+ class: v(["flex items-center gap-3 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 p-3 transition", [o.value.attachmentItem, b.url ? "hover:bg-white dark:hover:bg-gray-600 cursor-pointer" : ""]])
3965
3974
  }, {
3966
3975
  default: Ae(() => [
3967
3976
  h("div", Jo, [
3968
- T.url && m(T) ? (x(), v("img", {
3977
+ b.url && x(b) ? (k(), T("img", {
3969
3978
  key: 0,
3970
- src: T.url,
3979
+ src: b.url,
3971
3980
  class: "object-cover h-full w-full",
3972
3981
  alt: ""
3973
- }, null, 8, ei)) : (x(), v("svg", ti, [...S[3] || (S[3] = [
3982
+ }, null, 8, ei)) : (k(), T("svg", ti, [...C[3] || (C[3] = [
3974
3983
  h("path", {
3975
3984
  "stroke-linecap": "round",
3976
3985
  "stroke-linejoin": "round",
@@ -3980,21 +3989,21 @@ const No = /* @__PURE__ */ he({
3980
3989
  ])]))
3981
3990
  ]),
3982
3991
  h("div", ni, [
3983
- h("p", si, P(T.name || r("attachment")), 1),
3984
- h("p", ri, P(p(T.size)), 1)
3992
+ h("p", si, P(b.name || r("attachment")), 1),
3993
+ h("p", ri, P(p(b.size)), 1)
3985
3994
  ]),
3986
- T.url ? (x(), v("span", oi, P(r("openAttachment")), 1)) : F("", !0)
3995
+ b.url ? (k(), T("span", oi, P(r("openAttachment")), 1)) : F("", !0)
3987
3996
  ]),
3988
3997
  _: 2
3989
3998
  }, 1032, ["href", "target", "class"]))), 128))
3990
3999
  ], 2)) : F("", !0)
3991
4000
  ], 2)
3992
4001
  ], 2)),
3993
- n.message.role === "assistant" && !n.message.loading && !n.message.streaming && n.showActions ? (x(), Ee(Bo, {
4002
+ n.message.role === "assistant" && !n.message.loading && !n.message.streaming && n.showActions ? (k(), Ee(Bo, {
3994
4003
  key: 2,
3995
4004
  message: n.message,
3996
- class: b(["absolute top-0 left-0", o.value.actionsContainer]),
3997
- onCopy: k
4005
+ class: v(["absolute top-0 left-0", o.value.actionsContainer]),
4006
+ onCopy: g
3998
4007
  }, null, 8, ["message", "class"])) : F("", !0)
3999
4008
  ], 2);
4000
4009
  };
@@ -4004,7 +4013,7 @@ const No = /* @__PURE__ */ he({
4004
4013
  for (const [s, r] of e)
4005
4014
  t[s] = r;
4006
4015
  return t;
4007
- }, ai = /* @__PURE__ */ Ls(ii, [["__scopeId", "data-v-d045bee3"]]), li = { class: "text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide" }, ui = { class: "space-y-2" }, ci = ["src"], di = {
4016
+ }, ai = /* @__PURE__ */ Ls(ii, [["__scopeId", "data-v-1fd34583"]]), li = { class: "text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide" }, ui = { class: "space-y-2" }, ci = ["src"], di = {
4008
4017
  key: 1,
4009
4018
  class: "w-5 h-5 text-gray-500 dark:text-gray-400",
4010
4019
  fill: "none",
@@ -4029,24 +4038,24 @@ const No = /* @__PURE__ */ he({
4029
4038
  setup(n) {
4030
4039
  return (e, t) => {
4031
4040
  var s;
4032
- return x(), v("div", {
4033
- class: b(["border border-gray-200 dark:border-gray-700 rounded-2xl p-3 bg-gray-50 dark:bg-gray-800 space-y-3", n.ui.attachmentsContainer])
4041
+ return k(), T("div", {
4042
+ class: v(["border border-gray-200 dark:border-gray-700 rounded-2xl p-3 bg-gray-50 dark:bg-gray-800 space-y-3", n.ui.attachmentsContainer])
4034
4043
  }, [
4035
4044
  h("p", li, P(((s = n.texts) == null ? void 0 : s.attachedFiles) || "Attached files"), 1),
4036
4045
  h("ul", ui, [
4037
- (x(!0), v(be, null, Fe(n.attachments, (r) => (x(), v("li", {
4046
+ (k(!0), T(be, null, Fe(n.attachments, (r) => (k(), T("li", {
4038
4047
  key: r.id,
4039
- class: b(["flex items-center gap-3 rounded-xl bg-white dark:bg-gray-700 p-2 shadow-sm border border-gray-100 dark:border-gray-600", n.ui.attachmentItem])
4048
+ class: v(["flex items-center gap-3 rounded-xl bg-white dark:bg-gray-700 p-2 shadow-sm border border-gray-100 dark:border-gray-600", n.ui.attachmentItem])
4040
4049
  }, [
4041
4050
  h("div", {
4042
- class: b(["h-10 w-10 flex items-center justify-center rounded-lg bg-gray-100 dark:bg-gray-600 overflow-hidden", n.ui.attachmentThumbnail])
4051
+ class: v(["h-10 w-10 flex items-center justify-center rounded-lg bg-gray-100 dark:bg-gray-600 overflow-hidden", n.ui.attachmentThumbnail])
4043
4052
  }, [
4044
- n.isImage(r) ? (x(), v("img", {
4053
+ n.isImage(r) ? (k(), T("img", {
4045
4054
  key: 0,
4046
4055
  src: r.previewUrl || r.url,
4047
4056
  class: "object-cover h-full w-full",
4048
4057
  alt: ""
4049
- }, null, 8, ci)) : (x(), v("svg", di, [...t[0] || (t[0] = [
4058
+ }, null, 8, ci)) : (k(), T("svg", di, [...t[0] || (t[0] = [
4050
4059
  h("path", {
4051
4060
  "stroke-linecap": "round",
4052
4061
  "stroke-linejoin": "round",
@@ -4058,17 +4067,17 @@ const No = /* @__PURE__ */ he({
4058
4067
  h("div", hi, [
4059
4068
  h("p", fi, P(r.name), 1),
4060
4069
  h("p", pi, P(n.formatFileSize(r.size)), 1),
4061
- r.uploading ? (x(), v("div", gi, [
4070
+ r.uploading ? (k(), T("div", gi, [
4062
4071
  h("div", {
4063
4072
  class: "h-full bg-primary transition-all",
4064
4073
  style: cn({ width: `${r.progress ?? 10}%` })
4065
4074
  }, null, 4)
4066
4075
  ])) : F("", !0)
4067
4076
  ]),
4068
- r.uploading ? (x(), v("span", mi, P(Math.round(r.progress ?? 0)) + "% ", 1)) : F("", !0),
4077
+ r.uploading ? (k(), T("span", mi, P(Math.round(r.progress ?? 0)) + "% ", 1)) : F("", !0),
4069
4078
  h("button", {
4070
4079
  type: "button",
4071
- class: b(["p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed", n.ui.attachmentRemove]),
4080
+ class: v(["p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed", n.ui.attachmentRemove]),
4072
4081
  disabled: r.uploading,
4073
4082
  onClick: (o) => e.$emit("remove", r.id)
4074
4083
  }, [...t[1] || (t[1] = [
@@ -4100,8 +4109,8 @@ const No = /* @__PURE__ */ he({
4100
4109
  },
4101
4110
  emits: ["select", "hover"],
4102
4111
  setup(n, { expose: e }) {
4103
- const t = q(null);
4104
- return e({ dropdownRef: t }), (s, r) => (x(), Ee(wt, {
4112
+ const t = U(null);
4113
+ return e({ dropdownRef: t }), (s, r) => (k(), Ee(bt, {
4105
4114
  "enter-active-class": "transition ease-out duration-100",
4106
4115
  "enter-from-class": "transform opacity-0 scale-95",
4107
4116
  "enter-to-class": "transform opacity-100 scale-100",
@@ -4113,12 +4122,12 @@ const No = /* @__PURE__ */ he({
4113
4122
  h("div", {
4114
4123
  ref_key: "dropdownRef",
4115
4124
  ref: t,
4116
- class: b(["absolute bottom-full left-0 right-0 mb-2 bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-lg max-h-80 overflow-y-auto z-10", n.ui.suggestionsDropdown])
4125
+ class: v(["absolute bottom-full left-0 right-0 mb-2 bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-lg max-h-80 overflow-y-auto z-10", n.ui.suggestionsDropdown])
4117
4126
  }, [
4118
4127
  h("ul", ki, [
4119
- (x(!0), v(be, null, Fe(n.suggestions, (o, i) => (x(), v("li", {
4128
+ (k(!0), T(be, null, Fe(n.suggestions, (o, i) => (k(), T("li", {
4120
4129
  key: o.id,
4121
- class: b(["px-4 py-3 cursor-pointer transition-colors border-b border-gray-100 dark:border-gray-700 last:border-b-0", [
4130
+ class: v(["px-4 py-3 cursor-pointer transition-colors border-b border-gray-100 dark:border-gray-700 last:border-b-0", [
4122
4131
  n.ui.suggestionItem,
4123
4132
  {
4124
4133
  [n.ui.suggestionItemSelected || "bg-primary/10"]: i === n.selectedIndex,
@@ -4167,11 +4176,11 @@ const No = /* @__PURE__ */ he({
4167
4176
  const e = n, t = N(() => e.sending ? [e.ui.stopButton || "bg-red-500 text-white hover:bg-red-600"] : e.canSend ? [e.ui.sendButtonActive || "bg-primary-500 text-white hover:bg-primary-600"] : [e.ui.sendButtonDisabled || "bg-gray-200 dark:bg-gray-700 text-gray-400 dark:text-gray-500 cursor-not-allowed opacity-60"]);
4168
4177
  return (s, r) => {
4169
4178
  var o, i, a;
4170
- return x(), v("div", Ci, [
4171
- n.showSupportModeToggle && !n.supportRequestMode ? (x(), v("button", {
4179
+ return k(), T("div", Ci, [
4180
+ n.showSupportModeToggle && !n.supportRequestMode ? (k(), T("button", {
4172
4181
  key: 0,
4173
4182
  type: "button",
4174
- class: b(["h-9 w-9 rounded-xl flex items-center justify-center text-gray-400 hover:text-primary hover:bg-gray-100 dark:hover:bg-gray-700 transition flex-shrink-0", n.ui.supportToggle]),
4183
+ class: v(["h-9 w-9 rounded-xl flex items-center justify-center text-gray-400 hover:text-primary hover:bg-gray-100 dark:hover:bg-gray-700 transition flex-shrink-0", n.ui.supportToggle]),
4175
4184
  title: ((o = n.texts) == null ? void 0 : o.toggleSupportMode) || "Toggle support mode",
4176
4185
  onClick: r[0] || (r[0] = (u) => s.$emit("toggle-support-mode"))
4177
4186
  }, [...r[3] || (r[3] = [
@@ -4189,10 +4198,10 @@ const No = /* @__PURE__ */ he({
4189
4198
  })
4190
4199
  ], -1)
4191
4200
  ])], 10, Ei)) : F("", !0),
4192
- n.showSupportModeToggle && n.supportRequestMode ? (x(), v("button", {
4201
+ n.showSupportModeToggle && n.supportRequestMode ? (k(), T("button", {
4193
4202
  key: 1,
4194
4203
  type: "button",
4195
- class: b(["h-7 px-2 rounded-lg flex items-center gap-1 text-xs font-medium bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-400 hover:bg-amber-200 dark:hover:bg-amber-900/50 transition flex-shrink-0", n.ui.supportBadge]),
4204
+ class: v(["h-7 px-2 rounded-lg flex items-center gap-1 text-xs font-medium bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-400 hover:bg-amber-200 dark:hover:bg-amber-900/50 transition flex-shrink-0", n.ui.supportBadge]),
4196
4205
  title: ((i = n.texts) == null ? void 0 : i.exitSupportMode) || "Exit support mode",
4197
4206
  onClick: r[1] || (r[1] = (u) => s.$emit("toggle-support-mode"))
4198
4207
  }, [
@@ -4226,17 +4235,17 @@ const No = /* @__PURE__ */ he({
4226
4235
  ], 10, Mi)) : F("", !0),
4227
4236
  h("button", {
4228
4237
  disabled: !n.canSend && !n.sending,
4229
- class: b(["h-9 w-9 rounded-xl flex items-center justify-center transition-all duration-200 flex-shrink-0", t.value]),
4238
+ class: v(["h-9 w-9 rounded-xl flex items-center justify-center transition-all duration-200 flex-shrink-0", t.value]),
4230
4239
  type: "button",
4231
4240
  onClick: r[2] || (r[2] = tt((u) => s.$emit("click"), ["prevent"]))
4232
4241
  }, [
4233
- n.sending ? (x(), v("svg", Ii, [...r[7] || (r[7] = [
4242
+ n.sending ? (k(), T("svg", Ii, [...r[7] || (r[7] = [
4234
4243
  h("path", {
4235
4244
  "fill-rule": "evenodd",
4236
4245
  d: "M4.5 7.5a3 3 0 013-3h9a3 3 0 013 3v9a3 3 0 01-3 3h-9a3 3 0 01-3-3v-9z",
4237
4246
  "clip-rule": "evenodd"
4238
4247
  }, null, -1)
4239
- ])])) : (x(), v("svg", Li, [...r[6] || (r[6] = [
4248
+ ])])) : (k(), T("svg", Li, [...r[6] || (r[6] = [
4240
4249
  h("path", {
4241
4250
  "stroke-linecap": "round",
4242
4251
  "stroke-linejoin": "round",
@@ -4270,71 +4279,71 @@ const No = /* @__PURE__ */ he({
4270
4279
  },
4271
4280
  emits: ["update:modelValue", "submit", "cancel", "suggestion-select", "toggle-support-mode", "context-link-click"],
4272
4281
  setup(n, { expose: e, emit: t }) {
4273
- const s = n, r = N(() => s.ui || {}), o = t, i = q(s.modelValue), a = q(null), u = q(null), d = q(!1), c = Io(), g = $o(
4282
+ const s = n, r = N(() => s.ui || {}), o = t, i = U(s.modelValue), a = U(null), u = U(null), d = U(!1), c = Io(), y = $o(
4274
4283
  () => i.value,
4275
4284
  (R) => {
4276
4285
  i.value = R;
4277
4286
  },
4278
4287
  () => a.value
4279
- ), m = Do(
4288
+ ), x = Do(
4280
4289
  () => s.suggestions,
4281
4290
  () => s.hasHistory,
4282
4291
  () => d.value,
4283
4292
  () => i.value,
4284
4293
  (R) => {
4285
4294
  o("suggestion-select", R), Pe(() => {
4286
- var M;
4287
- return (M = a.value) == null ? void 0 : M.focus();
4295
+ var E;
4296
+ return (E = a.value) == null ? void 0 : E.focus();
4288
4297
  });
4289
4298
  }
4290
- ), { adjustTextareaHeight: f } = Oo(() => a.value), p = N(() => s.supportRequestMode ? s.supportPlaceholder : s.placeholder), A = N(() => s.showSupportModeToggle ? s.supportRequestMode ? { paddingLeft: "3rem", paddingRight: "8rem" } : { paddingLeft: "3rem", paddingRight: "6rem" } : { paddingLeft: "3rem", paddingRight: "3.5rem" }), k = N(() => {
4291
- var M;
4292
- return (((M = i.value) == null ? void 0 : M.trim()) ?? "").length >= s.minLength ? !0 : c.hasAttachments.value;
4293
- }), y = N(
4294
- () => !s.disabled && !s.sending && k.value && !c.isUploading.value
4299
+ ), { adjustTextareaHeight: f } = Oo(() => a.value), p = N(() => s.supportRequestMode ? s.supportPlaceholder : s.placeholder), D = N(() => s.showSupportModeToggle ? s.supportRequestMode ? { paddingLeft: "3rem", paddingRight: "8rem" } : { paddingLeft: "3rem", paddingRight: "6rem" } : { paddingLeft: "3rem", paddingRight: "3.5rem" }), g = N(() => {
4300
+ var E;
4301
+ return (((E = i.value) == null ? void 0 : E.trim()) ?? "").length >= s.minLength ? !0 : c.hasAttachments.value;
4302
+ }), m = N(
4303
+ () => !s.disabled && !s.sending && g.value && !c.isUploading.value
4295
4304
  );
4296
4305
  _e(() => s.modelValue, (R) => {
4297
4306
  i.value = R, Pe(f);
4298
4307
  }), _e(i, (R) => {
4299
- o("update:modelValue", R), Pe(f), g.checkForMentions(R), m.updateSuggestionsVisibility();
4308
+ o("update:modelValue", R), Pe(f), y.checkForMentions(R), x.updateSuggestionsVisibility();
4300
4309
  }), _e(() => s.suggestions, () => {
4301
- m.updateSuggestionsVisibility();
4310
+ x.updateSuggestionsVisibility();
4302
4311
  });
4303
- function S() {
4312
+ function C() {
4304
4313
  f();
4305
4314
  }
4306
- function E(R) {
4307
- if (!g.handleMentionKeyDown(R) && !m.handleSuggestionKeyDown(R) && R.key === "Enter") {
4315
+ function S(R) {
4316
+ if (!y.handleMentionKeyDown(R) && !x.handleSuggestionKeyDown(R) && R.key === "Enter") {
4308
4317
  if (R.shiftKey) return;
4309
- !s.sending && y.value && (R.preventDefault(), T());
4318
+ !s.sending && m.value && (R.preventDefault(), b());
4310
4319
  }
4311
4320
  }
4312
- function T() {
4313
- if (!y.value) return;
4314
- const R = c.buildPayload(), M = i.value.trim(), Z = g.getMentions();
4321
+ function b() {
4322
+ if (!m.value) return;
4323
+ const R = c.buildPayload(), E = i.value.trim(), Y = y.getMentions();
4315
4324
  o("submit", {
4316
- message: M,
4325
+ message: E,
4317
4326
  attachments: R,
4318
- mentions: Z,
4327
+ mentions: Y,
4319
4328
  isSupportRequest: s.supportRequestMode
4320
- }), i.value = "", c.clearAttachments(), g.clearMentions(), Pe(f);
4329
+ }), i.value = "", c.clearAttachments(), y.clearMentions(), Pe(f);
4321
4330
  }
4322
4331
  function z() {
4323
- s.sending ? o("cancel") : y.value && T();
4332
+ s.sending ? o("cancel") : m.value && b();
4324
4333
  }
4325
- function U() {
4334
+ function q() {
4326
4335
  var R;
4327
4336
  s.disabled || s.sending || c.canAddMore.value && ((R = u.value) == null || R.click());
4328
4337
  }
4329
- function J(R) {
4330
- m.handleSuggestionClick(R);
4338
+ function G(R) {
4339
+ x.handleSuggestionClick(R);
4331
4340
  }
4332
- function C() {
4333
- d.value = !0, m.updateSuggestionsVisibility();
4341
+ function A() {
4342
+ d.value = !0, x.updateSuggestionsVisibility();
4334
4343
  }
4335
4344
  function _() {
4336
4345
  d.value = !1, setTimeout(() => {
4337
- m.hideSuggestions(), g.showMentions.value = !1;
4346
+ x.hideSuggestions(), y.showMentions.value = !1;
4338
4347
  }, 200);
4339
4348
  }
4340
4349
  return e({
@@ -4342,36 +4351,36 @@ const No = /* @__PURE__ */ he({
4342
4351
  var R;
4343
4352
  return (R = a.value) == null ? void 0 : R.focus();
4344
4353
  }
4345
- }), vt(() => {
4354
+ }), Tt(() => {
4346
4355
  Pe(f);
4347
- }), (R, M) => {
4348
- var Z;
4349
- return x(), v("div", {
4350
- class: b(["px-4 pb-4 bg-white dark:bg-gray-900 sticky bottom-0", r.value.root]),
4351
- onDragenter: M[6] || (M[6] = tt(
4356
+ }), (R, E) => {
4357
+ var Y;
4358
+ return k(), T("div", {
4359
+ class: v(["px-4 pb-4 bg-white dark:bg-gray-900 sticky bottom-0", r.value.root]),
4360
+ onDragenter: E[6] || (E[6] = tt(
4352
4361
  //@ts-ignore
4353
- (...I) => D(c).handleDragEnter && D(c).handleDragEnter(...I),
4362
+ (...M) => $(c).handleDragEnter && $(c).handleDragEnter(...M),
4354
4363
  ["prevent"]
4355
4364
  )),
4356
- onDragover: M[7] || (M[7] = tt(
4365
+ onDragover: E[7] || (E[7] = tt(
4357
4366
  //@ts-ignore
4358
- (...I) => D(c).handleDragOver && D(c).handleDragOver(...I),
4367
+ (...M) => $(c).handleDragOver && $(c).handleDragOver(...M),
4359
4368
  ["prevent"]
4360
4369
  )),
4361
- onDragleave: M[8] || (M[8] = tt(
4370
+ onDragleave: E[8] || (E[8] = tt(
4362
4371
  //@ts-ignore
4363
- (...I) => D(c).handleDragLeave && D(c).handleDragLeave(...I),
4372
+ (...M) => $(c).handleDragLeave && $(c).handleDragLeave(...M),
4364
4373
  ["prevent"]
4365
4374
  )),
4366
- onDrop: M[9] || (M[9] = tt(
4375
+ onDrop: E[9] || (E[9] = tt(
4367
4376
  //@ts-ignore
4368
- (...I) => D(c).handleDrop && D(c).handleDrop(...I),
4377
+ (...M) => $(c).handleDrop && $(c).handleDrop(...M),
4369
4378
  ["prevent"]
4370
4379
  ))
4371
4380
  }, [
4372
4381
  h("form", {
4373
- class: b(r.value.form),
4374
- onSubmit: tt(T, ["prevent"])
4382
+ class: v(r.value.form),
4383
+ onSubmit: tt(b, ["prevent"])
4375
4384
  }, [
4376
4385
  h("div", Di, [
4377
4386
  h("input", {
@@ -4380,32 +4389,32 @@ const No = /* @__PURE__ */ he({
4380
4389
  type: "file",
4381
4390
  class: "hidden",
4382
4391
  multiple: "",
4383
- accept: D(c).acceptedFileTypes,
4384
- onChange: M[0] || (M[0] = //@ts-ignore
4385
- (...I) => D(c).handleFileSelect && D(c).handleFileSelect(...I))
4392
+ accept: $(c).acceptedFileTypes,
4393
+ onChange: E[0] || (E[0] = //@ts-ignore
4394
+ (...M) => $(c).handleFileSelect && $(c).handleFileSelect(...M))
4386
4395
  }, null, 40, Oi),
4387
- D(c).hasAttachments.value ? (x(), Ee(xi, {
4396
+ $(c).hasAttachments.value ? (k(), Ee(xi, {
4388
4397
  key: 0,
4389
- attachments: D(c).attachments.value,
4398
+ attachments: $(c).attachments.value,
4390
4399
  ui: r.value,
4391
4400
  texts: n.texts,
4392
- "is-image": D(c).isImage,
4393
- "format-file-size": D(c).formatFileSize,
4394
- onRemove: D(c).removeAttachment
4401
+ "is-image": $(c).isImage,
4402
+ "format-file-size": $(c).formatFileSize,
4403
+ onRemove: $(c).removeAttachment
4395
4404
  }, null, 8, ["attachments", "ui", "texts", "is-image", "format-file-size", "onRemove"])) : F("", !0),
4396
4405
  h("div", {
4397
- class: b(["relative", r.value.inputContainer])
4406
+ class: v(["relative", r.value.inputContainer])
4398
4407
  }, [
4399
- D(m).showSuggestions.value && n.suggestions.length > 0 ? (x(), Ee(Ai, {
4408
+ $(x).showSuggestions.value && n.suggestions.length > 0 ? (k(), Ee(Ai, {
4400
4409
  key: 0,
4401
4410
  ref: "suggestionsHandler.dropdownRef.value",
4402
4411
  suggestions: n.suggestions,
4403
- "selected-index": D(m).selectedSuggestionIndex.value,
4412
+ "selected-index": $(x).selectedSuggestionIndex.value,
4404
4413
  ui: r.value,
4405
- onSelect: J,
4406
- onHover: M[1] || (M[1] = (I) => D(m).selectedSuggestionIndex.value = I)
4414
+ onSelect: G,
4415
+ onHover: E[1] || (E[1] = (M) => $(x).selectedSuggestionIndex.value = M)
4407
4416
  }, null, 8, ["suggestions", "selected-index", "ui"])) : F("", !0),
4408
- ye(wt, {
4417
+ ye(bt, {
4409
4418
  "enter-active-class": "transition ease-out duration-100",
4410
4419
  "enter-from-class": "transform opacity-0 scale-95",
4411
4420
  "enter-to-class": "transform opacity-100 scale-100",
@@ -4414,32 +4423,32 @@ const No = /* @__PURE__ */ he({
4414
4423
  "leave-to-class": "transform opacity-0 scale-95"
4415
4424
  }, {
4416
4425
  default: Ae(() => [
4417
- D(g).showMentions.value && D(g).mentionItems.value.length > 0 ? (x(), Ee(_o, {
4426
+ $(y).showMentions.value && $(y).mentionItems.value.length > 0 ? (k(), Ee(_o, {
4418
4427
  key: 0,
4419
- items: D(g).mentionItems.value,
4420
- "selected-index": D(g).selectedMentionIndex.value,
4421
- providers: D(g).mentionProviders.value,
4422
- onSelect: D(g).handleMentionSelect,
4423
- "onUpdate:selectedIndex": M[2] || (M[2] = (I) => D(g).selectedMentionIndex.value = I)
4428
+ items: $(y).mentionItems.value,
4429
+ "selected-index": $(y).selectedMentionIndex.value,
4430
+ providers: $(y).mentionProviders.value,
4431
+ onSelect: $(y).handleMentionSelect,
4432
+ "onUpdate:selectedIndex": E[2] || (E[2] = (M) => $(y).selectedMentionIndex.value = M)
4424
4433
  }, null, 8, ["items", "selected-index", "providers", "onSelect"])) : F("", !0)
4425
4434
  ]),
4426
4435
  _: 1
4427
4436
  }),
4428
4437
  h("div", {
4429
- class: b(["rounded-2xl border shadow-lg transition-all duration-200 bg-white dark:bg-gray-800", [
4438
+ class: v(["rounded-2xl border shadow-lg transition-all duration-200 bg-white dark:bg-gray-800", [
4430
4439
  r.value.inputWrapper,
4431
4440
  {
4432
- "border-primary shadow-primary/30": d.value || D(c).isDraggingFiles.value,
4433
- "border-gray-200 dark:border-gray-700 shadow-gray-100 dark:shadow-gray-900": !d.value && !D(c).isDraggingFiles.value
4441
+ "border-primary shadow-primary/30": d.value || $(c).isDraggingFiles.value,
4442
+ "border-gray-200 dark:border-gray-700 shadow-gray-100 dark:shadow-gray-900": !d.value && !$(c).isDraggingFiles.value
4434
4443
  }
4435
4444
  ]])
4436
4445
  }, [
4437
4446
  h("button", {
4438
4447
  type: "button",
4439
- class: b(["absolute left-3 top-1/2 -translate-y-1/2 h-9 w-9 rounded-xl flex items-center justify-center text-gray-500 dark:text-gray-400 hover:text-primary transition z-10", r.value.attachButton]),
4440
- title: ((Z = n.texts) == null ? void 0 : Z.attachFiles) || "Attach files",
4441
- onClick: U
4442
- }, [...M[10] || (M[10] = [
4448
+ class: v(["absolute left-3 top-1/2 -translate-y-1/2 h-9 w-9 rounded-xl flex items-center justify-center text-gray-500 dark:text-gray-400 hover:text-primary transition z-10", r.value.attachButton]),
4449
+ title: ((Y = n.texts) == null ? void 0 : Y.attachFiles) || "Attach files",
4450
+ onClick: q
4451
+ }, [...E[10] || (E[10] = [
4443
4452
  h("svg", {
4444
4453
  class: "w-5 h-5",
4445
4454
  fill: "none",
@@ -4458,16 +4467,16 @@ const No = /* @__PURE__ */ he({
4458
4467
  qs(h("textarea", {
4459
4468
  ref_key: "textareaRef",
4460
4469
  ref: a,
4461
- "onUpdate:modelValue": M[3] || (M[3] = (I) => i.value = I),
4470
+ "onUpdate:modelValue": E[3] || (E[3] = (M) => i.value = M),
4462
4471
  rows: "1",
4463
4472
  "data-ai-input": "",
4464
4473
  placeholder: p.value,
4465
4474
  disabled: n.disabled,
4466
- class: b(["block w-full bg-transparent py-3 text-sm leading-5 text-gray-900 dark:text-gray-100 placeholder:text-gray-400 dark:placeholder:text-gray-500 border-0 focus:outline-none focus-visible:outline-none resize-none", r.value.textarea]),
4467
- style: cn(A.value),
4468
- onInput: S,
4469
- onKeydown: E,
4470
- onFocus: C,
4475
+ class: v(["block w-full bg-transparent py-3 text-sm leading-5 text-gray-900 dark:text-gray-100 placeholder:text-gray-400 dark:placeholder:text-gray-500 border-0 focus:outline-none focus-visible:outline-none resize-none", r.value.textarea]),
4476
+ style: cn(D.value),
4477
+ onInput: C,
4478
+ onKeydown: S,
4479
+ onFocus: A,
4471
4480
  onBlur: _
4472
4481
  }, null, 46, _i), [
4473
4482
  [js, i.value]
@@ -4475,22 +4484,22 @@ const No = /* @__PURE__ */ he({
4475
4484
  ]),
4476
4485
  ye($i, {
4477
4486
  sending: n.sending,
4478
- "can-send": y.value,
4487
+ "can-send": m.value,
4479
4488
  "support-request-mode": n.supportRequestMode,
4480
4489
  "show-support-mode-toggle": n.showSupportModeToggle,
4481
4490
  ui: r.value,
4482
4491
  texts: n.texts,
4483
- onToggleSupportMode: M[4] || (M[4] = (I) => R.$emit("toggle-support-mode")),
4492
+ onToggleSupportMode: E[4] || (E[4] = (M) => R.$emit("toggle-support-mode")),
4484
4493
  onClick: z
4485
4494
  }, null, 8, ["sending", "can-send", "support-request-mode", "show-support-mode-toggle", "ui", "texts"])
4486
4495
  ], 2)
4487
4496
  ], 2),
4488
4497
  ce(R.$slots, "context-link", {}, () => [
4489
- n.contextLinkText ? (x(), v("div", zi, [
4498
+ n.contextLinkText ? (k(), T("div", zi, [
4490
4499
  h("button", {
4491
4500
  type: "button",
4492
- class: b(["text-xs text-gray-400 hover:text-primary transition-colors", r.value.contextLink]),
4493
- onClick: M[5] || (M[5] = (I) => R.$emit("context-link-click"))
4501
+ class: v(["text-xs text-gray-400 hover:text-primary transition-colors", r.value.contextLink]),
4502
+ onClick: E[5] || (E[5] = (M) => R.$emit("context-link-click"))
4494
4503
  }, P(n.contextLinkText), 3)
4495
4504
  ])) : F("", !0)
4496
4505
  ])
@@ -4507,26 +4516,26 @@ const No = /* @__PURE__ */ he({
4507
4516
  },
4508
4517
  emits: ["item-click"],
4509
4518
  setup(n, { emit: e }) {
4510
- const t = n, s = e, r = (m) => {
4519
+ const t = n, s = e, r = (x) => {
4511
4520
  var p;
4512
- return (p = t.texts) != null && p[m] ? t.texts[m] : de({
4521
+ return (p = t.texts) != null && p[x] ? t.texts[x] : de({
4513
4522
  aiName: "aiName",
4514
4523
  title: "emptyStateTitle",
4515
4524
  description: "emptyStateDescription"
4516
- }[m]);
4525
+ }[x]);
4517
4526
  }, o = N(() => t.ui || {}), { suggestions: i, resolvePrompt: a } = Rs();
4518
- function u(m) {
4527
+ function u(x) {
4519
4528
  const f = {
4520
- ...m,
4521
- prompt: a(m)
4529
+ ...x,
4530
+ prompt: a(x)
4522
4531
  };
4523
4532
  s("item-click", f);
4524
4533
  }
4525
- function d(m) {
4526
- return m.gradientClass ? m.gradientClass : m.className ? m.className : "bg-gradient-to-br from-white to-gray-50 dark:from-gray-800 dark:to-gray-900";
4534
+ function d(x) {
4535
+ return x.gradientClass ? x.gradientClass : x.className ? x.className : "bg-gradient-to-br from-white to-gray-50 dark:from-gray-800 dark:to-gray-900";
4527
4536
  }
4528
- function c(m) {
4529
- const f = m.category || "default", p = {
4537
+ function c(x) {
4538
+ const f = x.category || "default", p = {
4530
4539
  hr: "bg-blue-100 dark:bg-blue-900/30",
4531
4540
  finance: "bg-green-100 dark:bg-green-900/30",
4532
4541
  analytics: "bg-purple-100 dark:bg-purple-900/30",
@@ -4535,8 +4544,8 @@ const No = /* @__PURE__ */ he({
4535
4544
  };
4536
4545
  return p[f] || p.default;
4537
4546
  }
4538
- function g(m) {
4539
- const f = m.category || "default", p = {
4547
+ function y(x) {
4548
+ const f = x.category || "default", p = {
4540
4549
  hr: "text-blue-600 dark:text-blue-400",
4541
4550
  finance: "text-green-600 dark:text-green-400",
4542
4551
  analytics: "text-purple-600 dark:text-purple-400",
@@ -4545,17 +4554,17 @@ const No = /* @__PURE__ */ he({
4545
4554
  };
4546
4555
  return p[f] || p.default;
4547
4556
  }
4548
- return (m, f) => (x(), v("div", {
4549
- class: b(["flex items-center justify-center p-4 h-full", o.value.root])
4557
+ return (x, f) => (k(), T("div", {
4558
+ class: v(["flex items-center justify-center p-4 h-full", o.value.root])
4550
4559
  }, [
4551
4560
  h("div", {
4552
- class: b(["w-full max-w-4xl", o.value.content])
4561
+ class: v(["w-full max-w-4xl", o.value.content])
4553
4562
  }, [
4554
4563
  h("div", {
4555
- class: b(["mb-8 text-center", o.value.header])
4564
+ class: v(["mb-8 text-center", o.value.header])
4556
4565
  }, [
4557
4566
  h("div", {
4558
- class: b(["mb-3 inline-flex items-center gap-2 rounded-full bg-primary/10 px-4 py-2 text-sm font-medium text-primary", o.value.badge])
4567
+ class: v(["mb-3 inline-flex items-center gap-2 rounded-full bg-primary/10 px-4 py-2 text-sm font-medium text-primary", o.value.badge])
4559
4568
  }, [
4560
4569
  f[0] || (f[0] = h("svg", {
4561
4570
  class: "w-4 h-4",
@@ -4573,29 +4582,29 @@ const No = /* @__PURE__ */ he({
4573
4582
  h("span", null, P(r("aiName")), 1)
4574
4583
  ], 2),
4575
4584
  h("h1", {
4576
- class: b(["mb-3 text-4xl font-bold tracking-tight text-gray-900 dark:text-white", o.value.title])
4585
+ class: v(["mb-3 text-4xl font-bold tracking-tight text-gray-900 dark:text-white", o.value.title])
4577
4586
  }, P(r("title")), 3),
4578
4587
  h("p", {
4579
- class: b(["text-gray-600 dark:text-gray-400", o.value.description])
4588
+ class: v(["text-gray-600 dark:text-gray-400", o.value.description])
4580
4589
  }, P(r("description")), 3)
4581
4590
  ], 2),
4582
4591
  h("div", {
4583
- class: b(["mb-8 grid gap-3 sm:grid-cols-2 lg:grid-cols-3", o.value.grid])
4592
+ class: v(["mb-8 grid gap-3 sm:grid-cols-2 lg:grid-cols-3", o.value.grid])
4584
4593
  }, [
4585
- (x(!0), v(be, null, Fe(D(i), (p, A) => (x(), v("button", {
4586
- key: p.id || A,
4587
- class: b(["group relative overflow-hidden rounded-xl border border-gray-300 dark:border-gray-600 p-4 text-left transition-all hover:shadow-md hover:scale-[1.02]", [o.value.suggestionCard, d(p)]]),
4588
- onClick: (k) => u(p)
4594
+ (k(!0), T(be, null, Fe($(i), (p, D) => (k(), T("button", {
4595
+ key: p.id || D,
4596
+ class: v(["group relative overflow-hidden rounded-xl border border-gray-300 dark:border-gray-600 p-4 text-left transition-all hover:shadow-md hover:scale-[1.02]", [o.value.suggestionCard, d(p)]]),
4597
+ onClick: (g) => u(p)
4589
4598
  }, [
4590
4599
  h("div", {
4591
- class: b(["mb-2 inline-flex h-10 w-10 items-center justify-center rounded-lg", [o.value.suggestionIconContainer, c(p)]])
4600
+ class: v(["mb-2 inline-flex h-10 w-10 items-center justify-center rounded-lg", [o.value.suggestionIconContainer, c(p)]])
4592
4601
  }, [
4593
- p.icon ? (x(), Ee(nn(p.icon), {
4602
+ p.icon ? (k(), Ee(nn(p.icon), {
4594
4603
  key: 0,
4595
- class: b(["h-5 w-5", [o.value.suggestionIcon, g(p)]])
4596
- }, null, 8, ["class"])) : (x(), v("svg", {
4604
+ class: v(["h-5 w-5", [o.value.suggestionIcon, y(p)]])
4605
+ }, null, 8, ["class"])) : (k(), T("svg", {
4597
4606
  key: 1,
4598
- class: b(["h-5 w-5", [o.value.suggestionIcon, g(p)]]),
4607
+ class: v(["h-5 w-5", [o.value.suggestionIcon, y(p)]]),
4599
4608
  fill: "none",
4600
4609
  viewBox: "0 0 24 24",
4601
4610
  stroke: "currentColor",
@@ -4609,10 +4618,10 @@ const No = /* @__PURE__ */ he({
4609
4618
  ])], 2))
4610
4619
  ], 2),
4611
4620
  h("h3", {
4612
- class: b(["mb-1 text-sm font-semibold text-gray-900 dark:text-white", o.value.suggestionTitle])
4621
+ class: v(["mb-1 text-sm font-semibold text-gray-900 dark:text-white", o.value.suggestionTitle])
4613
4622
  }, P(p.title), 3),
4614
4623
  h("p", {
4615
- class: b(["text-xs text-gray-600 dark:text-gray-400", o.value.suggestionDescription])
4624
+ class: v(["text-xs text-gray-600 dark:text-gray-400", o.value.suggestionDescription])
4616
4625
  }, P(p.description), 3)
4617
4626
  ], 10, Bi))), 128))
4618
4627
  ], 2)
@@ -4676,19 +4685,19 @@ const No = /* @__PURE__ */ he({
4676
4685
  return r >= 1 ? "text-red-500 dark:text-red-400" : r >= 0.8 ? "text-amber-500 dark:text-amber-400" : "text-gray-400 dark:text-gray-500";
4677
4686
  });
4678
4687
  return (r, o) => {
4679
- var i, a, u, d, c, g, m;
4680
- return x(), v("div", {
4681
- class: b(["flex items-center justify-between px-4 sm:px-6 pt-4 border-b border-gray-200 dark:border-gray-700 pb-4", (i = n.ui) == null ? void 0 : i.header])
4688
+ var i, a, u, d, c, y, x;
4689
+ return k(), T("div", {
4690
+ class: v(["flex items-center justify-between px-4 sm:px-6 pt-4 border-b border-gray-200 dark:border-gray-700 pb-4", (i = n.ui) == null ? void 0 : i.header])
4682
4691
  }, [
4683
4692
  h("div", Ui, [
4684
- n.isSetupMode ? (x(), v("div", ji, [...o[5] || (o[5] = [
4693
+ n.isSetupMode ? (k(), T("div", ji, [...o[5] || (o[5] = [
4685
4694
  h("span", { class: "flex h-2 w-2 rounded-full bg-amber-500 animate-pulse" }, null, -1),
4686
4695
  h("span", { class: "text-sm font-medium text-gray-700 dark:text-gray-300" }, "Setup Required", -1)
4687
- ])])) : (x(), v(be, { key: 0 }, [
4688
- n.showNewChatButton && n.hasHistory ? (x(), v("button", {
4696
+ ])])) : (k(), T(be, { key: 0 }, [
4697
+ n.showNewChatButton && n.hasHistory ? (k(), T("button", {
4689
4698
  key: 0,
4690
4699
  type: "button",
4691
- class: b(["inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 hover:border-gray-400 transition-all duration-200 shadow-sm", (a = n.ui) == null ? void 0 : a.newChatButton]),
4700
+ class: v(["inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 hover:border-gray-400 transition-all duration-200 shadow-sm", (a = n.ui) == null ? void 0 : a.newChatButton]),
4692
4701
  onClick: o[0] || (o[0] = (f) => r.$emit("new-chat"))
4693
4702
  }, [
4694
4703
  o[4] || (o[4] = h("svg", {
@@ -4705,16 +4714,16 @@ const No = /* @__PURE__ */ he({
4705
4714
  })
4706
4715
  ], -1)),
4707
4716
  h("span", null, P(n.t("newChat")), 1)
4708
- ], 2)) : (x(), v("span", qi, P(n.t("keyboardShortcutHint")), 1))
4717
+ ], 2)) : (k(), T("span", qi, P(n.t("keyboardShortcutHint")), 1))
4709
4718
  ], 64))
4710
4719
  ]),
4711
- !n.isSetupMode && (n.showMessageCount || n.showQuota) ? (x(), v("div", Wi, [
4712
- n.showMessageCount && n.hasHistory ? (x(), v("div", {
4720
+ !n.isSetupMode && (n.showMessageCount || n.showQuota) ? (k(), T("div", Wi, [
4721
+ n.showMessageCount && n.hasHistory ? (k(), T("div", {
4713
4722
  key: 0,
4714
- class: b(["flex items-center gap-1.5 px-2 py-1 rounded-md bg-gray-100 dark:bg-gray-800", (u = n.ui) == null ? void 0 : u.messageCountBadge])
4723
+ class: v(["flex items-center gap-1.5 px-2 py-1 rounded-md bg-gray-100 dark:bg-gray-800", (u = n.ui) == null ? void 0 : u.messageCountBadge])
4715
4724
  }, [
4716
- (x(), v("svg", {
4717
- class: b(["w-3.5 h-3.5", s.value]),
4725
+ (k(), T("svg", {
4726
+ class: v(["w-3.5 h-3.5", s.value]),
4718
4727
  fill: "none",
4719
4728
  viewBox: "0 0 24 24",
4720
4729
  stroke: "currentColor",
@@ -4727,7 +4736,7 @@ const No = /* @__PURE__ */ he({
4727
4736
  }, null, -1)
4728
4737
  ])], 2)),
4729
4738
  h("span", {
4730
- class: b(["text-xs font-medium tabular-nums", t.value])
4739
+ class: v(["text-xs font-medium tabular-nums", t.value])
4731
4740
  }, [
4732
4741
  ce(r.$slots, "message-count", {}, () => [
4733
4742
  sn(P(n.messageCount), 1),
@@ -4736,17 +4745,17 @@ const No = /* @__PURE__ */ he({
4736
4745
  ])
4737
4746
  ], 2)
4738
4747
  ], 2)) : F("", !0),
4739
- n.showMessageCount && n.hasHistory && n.showQuota && n.quota.remaining >= 0 ? (x(), v("span", Ki, " • ")) : F("", !0),
4748
+ n.showMessageCount && n.hasHistory && n.showQuota && n.quota.remaining >= 0 ? (k(), T("span", Ki, " • ")) : F("", !0),
4740
4749
  n.showQuota ? ce(r.$slots, "quota", { key: 2 }, () => {
4741
4750
  var f;
4742
4751
  return [
4743
- n.quota.remaining > 0 ? (x(), v("div", {
4752
+ n.quota.remaining > 0 ? (k(), T("div", {
4744
4753
  key: 0,
4745
- class: b(["flex items-center gap-1.5 text-xs", (f = n.ui) == null ? void 0 : f.quotaDisplay])
4754
+ class: v(["flex items-center gap-1.5 text-xs", (f = n.ui) == null ? void 0 : f.quotaDisplay])
4746
4755
  }, [
4747
4756
  h("span", Vi, P(n.quota.remaining), 1),
4748
4757
  h("span", Gi, P(n.t("quotaRemaining")), 1)
4749
- ], 2)) : n.quota.remaining === 0 ? (x(), v("div", Qi, [
4758
+ ], 2)) : n.quota.remaining === 0 ? (k(), T("div", Qi, [
4750
4759
  o[8] || (o[8] = h("svg", {
4751
4760
  class: "w-3.5 h-3.5 text-red-500",
4752
4761
  fill: "none",
@@ -4766,12 +4775,12 @@ const No = /* @__PURE__ */ he({
4766
4775
  }) : F("", !0)
4767
4776
  ])) : F("", !0),
4768
4777
  h("div", {
4769
- class: b(["flex items-center gap-1", (d = n.ui) == null ? void 0 : d.headerActions])
4778
+ class: v(["flex items-center gap-1", (d = n.ui) == null ? void 0 : d.headerActions])
4770
4779
  }, [
4771
- n.showCloseButton ? (x(), v("button", {
4780
+ n.showCloseButton ? (k(), T("button", {
4772
4781
  key: 0,
4773
4782
  type: "button",
4774
- class: b(["p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors", (c = n.ui) == null ? void 0 : c.headerActionButton]),
4783
+ class: v(["p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors", (c = n.ui) == null ? void 0 : c.headerActionButton]),
4775
4784
  title: n.t("close"),
4776
4785
  onClick: o[1] || (o[1] = (f) => r.$emit("close"))
4777
4786
  }, [...o[9] || (o[9] = [
@@ -4789,10 +4798,10 @@ const No = /* @__PURE__ */ he({
4789
4798
  })
4790
4799
  ], -1)
4791
4800
  ])], 10, Yi)) : F("", !0),
4792
- n.showMinimizeButton ? (x(), v("button", {
4801
+ n.showMinimizeButton ? (k(), T("button", {
4793
4802
  key: 1,
4794
4803
  type: "button",
4795
- class: b(["p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors", (g = n.ui) == null ? void 0 : g.headerActionButton]),
4804
+ class: v(["p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors", (y = n.ui) == null ? void 0 : y.headerActionButton]),
4796
4805
  title: n.t("minimize"),
4797
4806
  onClick: o[2] || (o[2] = (f) => r.$emit("minimize"))
4798
4807
  }, [...o[10] || (o[10] = [
@@ -4810,20 +4819,20 @@ const No = /* @__PURE__ */ he({
4810
4819
  })
4811
4820
  ], -1)
4812
4821
  ])], 10, Xi)) : F("", !0),
4813
- n.showFullscreenToggle ? (x(), v("button", {
4822
+ n.showFullscreenToggle ? (k(), T("button", {
4814
4823
  key: 2,
4815
4824
  type: "button",
4816
- class: b(["p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors", (m = n.ui) == null ? void 0 : m.headerActionButton]),
4825
+ class: v(["p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors", (x = n.ui) == null ? void 0 : x.headerActionButton]),
4817
4826
  title: n.isFullscreen ? n.t("exitFullscreen") : n.t("fullscreen"),
4818
4827
  onClick: o[3] || (o[3] = (f) => r.$emit("toggle-fullscreen"))
4819
4828
  }, [
4820
- n.isFullscreen ? (x(), v("svg", ta, [...o[12] || (o[12] = [
4829
+ n.isFullscreen ? (k(), T("svg", ta, [...o[12] || (o[12] = [
4821
4830
  h("path", {
4822
4831
  "stroke-linecap": "round",
4823
4832
  "stroke-linejoin": "round",
4824
4833
  d: "M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25"
4825
4834
  }, null, -1)
4826
- ])])) : (x(), v("svg", ea, [...o[11] || (o[11] = [
4835
+ ])])) : (k(), T("svg", ea, [...o[11] || (o[11] = [
4827
4836
  h("path", {
4828
4837
  "stroke-linecap": "round",
4829
4838
  "stroke-linejoin": "round",
@@ -4852,7 +4861,7 @@ const No = /* @__PURE__ */ he({
4852
4861
  setup(n) {
4853
4862
  return (e, t) => {
4854
4863
  var s, r, o;
4855
- return x(), v("div", sa, [
4864
+ return k(), T("div", sa, [
4856
4865
  h("div", ra, [
4857
4866
  h("div", oa, [
4858
4867
  t[3] || (t[3] = h("svg", {
@@ -4868,10 +4877,10 @@ const No = /* @__PURE__ */ he({
4868
4877
  d: "M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09Z"
4869
4878
  })
4870
4879
  ], -1)),
4871
- h("span", null, P(n.t("title") || D(de)("aiName")), 1)
4880
+ h("span", null, P(n.t("title") || $(de)("aiName")), 1)
4872
4881
  ])
4873
4882
  ]),
4874
- (x(!0), v(be, null, Fe(n.messages, (i, a) => ce(e.$slots, "message", {
4883
+ (k(!0), T(be, null, Fe(n.messages, (i, a) => ce(e.$slots, "message", {
4875
4884
  key: i.id || a,
4876
4885
  message: i,
4877
4886
  isUser: i.role === "user",
@@ -4884,7 +4893,7 @@ const No = /* @__PURE__ */ he({
4884
4893
  onCopy: t[0] || (t[0] = (u) => e.$emit("copy", u))
4885
4894
  }, null, 8, ["message", "loading-text"])
4886
4895
  ])), 128)),
4887
- n.quota.remaining === 0 ? (x(), v("div", ia, [
4896
+ n.quota.remaining === 0 ? (k(), T("div", ia, [
4888
4897
  h("button", {
4889
4898
  type: "button",
4890
4899
  class: "inline-flex items-center gap-2 px-6 py-3 bg-primary-500 text-white rounded-lg hover:bg-primary-600 transition-all shadow-sm",
@@ -4903,19 +4912,19 @@ const No = /* @__PURE__ */ he({
4903
4912
  d: "M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"
4904
4913
  })
4905
4914
  ], -1)),
4906
- h("span", null, P(D(de)("contactSupport")), 1)
4915
+ h("span", null, P($(de)("contactSupport")), 1)
4907
4916
  ])
4908
4917
  ])) : F("", !0),
4909
- n.error.message ? (x(), v("div", {
4918
+ n.error.message ? (k(), T("div", {
4910
4919
  key: 1,
4911
- class: b(["flex items-center gap-2 text-sm text-red-600 dark:text-red-400 px-2 py-1 pb-6", (s = n.ui) == null ? void 0 : s.errorContainer])
4920
+ class: v(["flex items-center gap-2 text-sm text-red-600 dark:text-red-400 px-2 py-1 pb-6", (s = n.ui) == null ? void 0 : s.errorContainer])
4912
4921
  }, [
4913
4922
  h("span", {
4914
- class: b((r = n.ui) == null ? void 0 : r.errorMessage)
4923
+ class: v((r = n.ui) == null ? void 0 : r.errorMessage)
4915
4924
  }, P(n.error.message), 3),
4916
4925
  h("button", {
4917
4926
  type: "button",
4918
- class: b(["inline-flex items-center gap-1 text-red-700 dark:text-red-300 hover:text-red-800 dark:hover:text-red-200 font-medium", (o = n.ui) == null ? void 0 : o.retryButton]),
4927
+ class: v(["inline-flex items-center gap-1 text-red-700 dark:text-red-300 hover:text-red-800 dark:hover:text-red-200 font-medium", (o = n.ui) == null ? void 0 : o.retryButton]),
4919
4928
  title: n.t("retry"),
4920
4929
  onClick: t[2] || (t[2] = (i) => e.$emit("retry"))
4921
4930
  }, [...t[5] || (t[5] = [
@@ -4944,7 +4953,7 @@ const No = /* @__PURE__ */ he({
4944
4953
  },
4945
4954
  emits: ["copy"],
4946
4955
  setup(n) {
4947
- return (e, t) => (x(), v(be, null, [
4956
+ return (e, t) => (k(), T(be, null, [
4948
4957
  t[4] || (t[4] = _n('<div class="w-14 h-14 rounded-2xl bg-primary/10 flex items-center justify-center mb-5"><svg class="w-7 h-7 text-primary" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09Z"></path></svg></div><h2 class="text-lg font-semibold text-gray-900 dark:text-white mb-1"> Almost there! </h2><p class="text-sm text-gray-500 dark:text-gray-400 mb-6 max-w-sm text-center"> Configure the plugin in your app entry file to start using AI. </p>', 3)),
4949
4958
  h("div", ua, [
4950
4959
  h("div", ca, [
@@ -5008,7 +5017,7 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
5008
5017
  const r = e.confirmVariant === "danger" ? "bg-red-600 hover:bg-red-700" : "bg-primary-500 hover:bg-primary-600", o = e.confirmVariant === "danger" ? (i = e.ui) == null ? void 0 : i.closeConfirmButton : (a = e.ui) == null ? void 0 : a.historyLimitButton;
5009
5018
  return [r, o];
5010
5019
  });
5011
- return (r, o) => (x(), Ee(wt, {
5020
+ return (r, o) => (k(), Ee(bt, {
5012
5021
  "enter-active-class": "transition ease-out duration-200",
5013
5022
  "enter-from-class": "opacity-0",
5014
5023
  "enter-to-class": "opacity-100",
@@ -5019,11 +5028,11 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
5019
5028
  default: Ae(() => {
5020
5029
  var i;
5021
5030
  return [
5022
- n.show ? (x(), v("div", fa, [
5031
+ n.show ? (k(), T("div", fa, [
5023
5032
  h("div", {
5024
- class: b(["bg-white dark:bg-gray-800 rounded-xl p-6 m-4 max-w-sm w-full shadow-xl", t.value])
5033
+ class: v(["bg-white dark:bg-gray-800 rounded-xl p-6 m-4 max-w-sm w-full shadow-xl", t.value])
5025
5034
  }, [
5026
- n.icon === "warning" ? (x(), v("div", pa, [
5035
+ n.icon === "warning" ? (k(), T("div", pa, [
5027
5036
  o[2] || (o[2] = h("div", { class: "flex-shrink-0 w-10 h-10 rounded-full bg-amber-100 dark:bg-amber-900/30 flex items-center justify-center" }, [
5028
5037
  h("svg", {
5029
5038
  class: "w-5 h-5 text-amber-600 dark:text-amber-400",
@@ -5040,17 +5049,17 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
5040
5049
  ])
5041
5050
  ], -1)),
5042
5051
  h("h3", ga, P(n.title), 1)
5043
- ])) : (x(), v("h3", ma, P(n.title), 1)),
5052
+ ])) : (k(), T("h3", ma, P(n.title), 1)),
5044
5053
  h("p", ya, P(n.message), 1),
5045
5054
  h("div", xa, [
5046
5055
  h("button", {
5047
5056
  type: "button",
5048
- class: b(["px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors", (i = n.ui) == null ? void 0 : i.cancelButton]),
5057
+ class: v(["px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors", (i = n.ui) == null ? void 0 : i.cancelButton]),
5049
5058
  onClick: o[0] || (o[0] = (a) => r.$emit("cancel"))
5050
5059
  }, P(n.cancelText), 3),
5051
5060
  h("button", {
5052
5061
  type: "button",
5053
- class: b(["px-4 py-2 text-sm font-medium text-white rounded-lg transition-colors", s.value]),
5062
+ class: v(["px-4 py-2 text-sm font-medium text-white rounded-lg transition-colors", s.value]),
5054
5063
  onClick: o[1] || (o[1] = (a) => r.$emit("confirm"))
5055
5064
  }, P(n.confirmText), 3)
5056
5065
  ])
@@ -5098,10 +5107,10 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
5098
5107
  set: (O) => s("update:modelValue", O)
5099
5108
  });
5100
5109
  function o(O, B) {
5101
- var G;
5102
- const X = (G = t.texts) == null ? void 0 : G[O];
5103
- if (X) {
5104
- let oe = X;
5110
+ var Q;
5111
+ const J = (Q = t.texts) == null ? void 0 : Q[O];
5112
+ if (J) {
5113
+ let oe = J;
5105
5114
  if (B)
5106
5115
  for (const [ee, ie] of Object.entries(B))
5107
5116
  oe = oe.replace(`{${ee}}`, String(ie));
@@ -5109,18 +5118,18 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
5109
5118
  }
5110
5119
  return de(O, B);
5111
5120
  }
5112
- const i = Ge(), a = q(""), u = q(null), d = q(null), c = q(!1), g = q(!1), m = q(!1), { loadingMessage: f, startLoadingText: p, resetLoadingText: A } = Ro(
5121
+ const i = Ge(), a = U(""), u = U(null), d = U(null), c = U(!1), y = U(!1), x = U(!1), { loadingMessage: f, startLoadingText: p, resetLoadingText: D } = Ro(
5113
5122
  () => i.sending,
5114
5123
  () => t.loadingText
5115
5124
  ), {
5116
- showHistoryLimitWarning: k,
5117
- historyLimitReached: y,
5118
- historyLimitDialogTitle: S,
5119
- historyLimitDialogMessage: E,
5120
- dismissHistoryLimitWarning: T,
5125
+ showHistoryLimitWarning: g,
5126
+ historyLimitReached: m,
5127
+ historyLimitDialogTitle: C,
5128
+ historyLimitDialogMessage: S,
5129
+ dismissHistoryLimitWarning: b,
5121
5130
  handleHistoryLimitAction: z,
5122
- checkHistoryLimit: U,
5123
- setPendingMessage: J
5131
+ checkHistoryLimit: q,
5132
+ setPendingMessage: G
5124
5133
  } = Lo({
5125
5134
  getHistoryLength: () => i.quota.limit - i.quota.remaining,
5126
5135
  getStoreLimit: () => i.quota.limit,
@@ -5128,25 +5137,25 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
5128
5137
  getTexts: () => t.texts,
5129
5138
  onStartNewChat: () => i.clearChatHistory(),
5130
5139
  onNewChatEmit: () => s("new-chat")
5131
- }), C = N(() => !is()), _ = N(() => Be("enableSupportMode") ?? !1), { suggestions: R, resolvePrompt: M } = Rs();
5140
+ }), A = N(() => !is()), _ = N(() => Be("enableSupportMode") ?? !1), { suggestions: R, resolvePrompt: E } = Rs();
5132
5141
  N(() => i.chatHistory.filter((O) => O.role === "user").length);
5133
- const Z = N(() => {
5134
- if (C.value) return [];
5142
+ const Y = N(() => {
5143
+ if (A.value) return [];
5135
5144
  const O = a.value.toLowerCase().trim(), B = R.value || [];
5136
- let X = B;
5145
+ let J = B;
5137
5146
  if (O) {
5138
- const G = /* @__PURE__ */ new Set(["a", "an", "the", "and", "or", "but", "in", "on", "at", "to", "for", "of", "with", "by"]), oe = O.split(/\s+/).filter((ee) => !G.has(ee));
5139
- oe.length > 0 && (X = B.filter((ee) => {
5147
+ const Q = /* @__PURE__ */ new Set(["a", "an", "the", "and", "or", "but", "in", "on", "at", "to", "for", "of", "with", "by"]), oe = O.split(/\s+/).filter((ee) => !Q.has(ee));
5148
+ oe.length > 0 && (J = B.filter((ee) => {
5140
5149
  const ie = `${ee.title} ${ee.description || ""}`.toLowerCase();
5141
5150
  return oe.every((He) => ie.includes(He));
5142
5151
  }));
5143
5152
  }
5144
- return X.slice(0, 5).map((G) => ({
5145
- id: G.id,
5146
- title: G.title,
5147
- description: G.description || ""
5153
+ return J.slice(0, 5).map((Q) => ({
5154
+ id: Q.id,
5155
+ title: Q.title,
5156
+ description: Q.description || ""
5148
5157
  }));
5149
- }), I = N(() => ({
5158
+ }), M = N(() => ({
5150
5159
  quota: i.quota,
5151
5160
  isFullscreen: c.value,
5152
5161
  hasHistory: i.chatHistory.length > 0,
@@ -5154,7 +5163,7 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
5154
5163
  onClose: ze,
5155
5164
  onMinimize: Re,
5156
5165
  onToggleFullscreen: Me
5157
- })), V = N(() => ({
5166
+ })), W = N(() => ({
5158
5167
  modelValue: a.value,
5159
5168
  sending: i.sending,
5160
5169
  disabled: !1,
@@ -5162,8 +5171,8 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
5162
5171
  onCancel: () => i.cancelRequest()
5163
5172
  }));
5164
5173
  function qe(O) {
5165
- const B = (R.value || []).find((X) => X.id === O.id);
5166
- B && (a.value = M(B));
5174
+ const B = (R.value || []).find((J) => J.id === O.id);
5175
+ B && (a.value = E(B));
5167
5176
  }
5168
5177
  function Me() {
5169
5178
  c.value = !c.value;
@@ -5172,12 +5181,12 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
5172
5181
  r.value = !1;
5173
5182
  }
5174
5183
  function ze() {
5175
- t.confirmClose && !C.value && i.chatHistory.length > 0 ? m.value = !0 : (r.value = !1, s("close"));
5184
+ t.confirmClose && !A.value && i.chatHistory.length > 0 ? x.value = !0 : (r.value = !1, s("close"));
5176
5185
  }
5177
5186
  function Ft() {
5178
- m.value = !1, i.clearChatHistory(), r.value = !1, s("close");
5187
+ x.value = !1, i.clearChatHistory(), r.value = !1, s("close");
5179
5188
  }
5180
- function At() {
5189
+ function Ct() {
5181
5190
  s("contact-support");
5182
5191
  }
5183
5192
  function ne() {
@@ -5194,7 +5203,7 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
5194
5203
  function st() {
5195
5204
  i.clearChatHistory(), s("new-chat");
5196
5205
  }
5197
- function Y(O) {
5206
+ function X(O) {
5198
5207
  }
5199
5208
  function je() {
5200
5209
  navigator.clipboard.writeText(`import { RestifyAiPlugin } from '@doderasoftware/restify-ai'
@@ -5205,41 +5214,41 @@ app.use(RestifyAiPlugin, {
5205
5214
  quota: '/api/ai/quota', // optional
5206
5215
  },
5207
5216
  getAuthToken: () => getToken(),
5208
- })`), g.value = !0, setTimeout(() => {
5209
- g.value = !1;
5217
+ })`), y.value = !0, setTimeout(() => {
5218
+ y.value = !1;
5210
5219
  }, 2e3);
5211
5220
  }
5212
5221
  async function rt() {
5213
5222
  const O = await z();
5214
5223
  O && (await Pe(), await Ie(O.message, O.attachments, O.mentions, O.isSupportRequest));
5215
5224
  }
5216
- async function Ie(O, B, X, G) {
5225
+ async function Ie(O, B, J, Q) {
5217
5226
  i.clearError(), p(), await Pe(), Le();
5218
- const oe = await i.askQuestion(O, B, X, G);
5219
- A(), oe && Le();
5227
+ const oe = await i.askQuestion(O, B, J, Q);
5228
+ D(), oe && Le();
5220
5229
  }
5221
5230
  async function ot(O) {
5222
- const { message: B, attachments: X, mentions: G, isSupportRequest: oe } = O;
5231
+ const { message: B, attachments: J, mentions: Q, isSupportRequest: oe } = O;
5223
5232
  if (i.sending) return;
5224
- const ee = G.map((ie) => ({
5233
+ const ee = Q.map((ie) => ({
5225
5234
  id: ie.id,
5226
5235
  name: ie.name,
5227
5236
  type: ie.type || "unknown",
5228
5237
  metadata: ie.metadata
5229
5238
  }));
5230
- if (!U()) {
5231
- J({ message: B, attachments: X, mentions: ee, isSupportRequest: oe });
5239
+ if (!q()) {
5240
+ G({ message: B, attachments: J, mentions: ee, isSupportRequest: oe });
5232
5241
  return;
5233
5242
  }
5234
- await Ie(B, X, ee, oe);
5243
+ await Ie(B, J, ee, oe);
5235
5244
  }
5236
5245
  async function it() {
5237
5246
  p();
5238
5247
  const O = await i.retry();
5239
- A(), O && Le();
5248
+ D(), O && Le();
5240
5249
  }
5241
5250
  function at(O) {
5242
- t.closeOnEscape && O.key === "Escape" && r.value && (m.value ? m.value = !1 : Re());
5251
+ t.closeOnEscape && O.key === "Escape" && r.value && (x.value ? x.value = !1 : Re());
5243
5252
  }
5244
5253
  return _e(
5245
5254
  () => i.chatHistory.length,
@@ -5254,56 +5263,56 @@ app.use(RestifyAiPlugin, {
5254
5263
  ), _e(() => t.modelValue, async (O) => {
5255
5264
  var B;
5256
5265
  O && (await Le(), (B = d.value) == null || B.focus()), O && t.autoFetchQuota && i.fetchQuota();
5257
- }, { immediate: !0 }), vt(() => {
5266
+ }, { immediate: !0 }), Tt(() => {
5258
5267
  window.addEventListener("keydown", at);
5259
- }), bt(() => {
5268
+ }), vt(() => {
5260
5269
  window.removeEventListener("keydown", at);
5261
- }), (O, B) => (x(), Ee(Ws, { to: "body" }, [
5262
- ye(wt, { name: "rai-fade" }, {
5270
+ }), (O, B) => (k(), Ee(Ws, { to: "body" }, [
5271
+ ye(bt, { name: "rai-fade" }, {
5263
5272
  default: Ae(() => {
5264
- var X;
5273
+ var J;
5265
5274
  return [
5266
- r.value && n.showBackdrop ? (x(), v("div", {
5275
+ r.value && n.showBackdrop ? (k(), T("div", {
5267
5276
  key: 0,
5268
- class: b(["fixed inset-0 bg-black/30 z-40", (X = n.ui) == null ? void 0 : X.backdrop]),
5269
- onClick: B[0] || (B[0] = (G) => n.closeOnBackdropClick && Re())
5277
+ class: v(["fixed inset-0 bg-black/30 z-40", (J = n.ui) == null ? void 0 : J.backdrop]),
5278
+ onClick: B[0] || (B[0] = (Q) => n.closeOnBackdropClick && Re())
5270
5279
  }, null, 2)) : F("", !0)
5271
5280
  ];
5272
5281
  }),
5273
5282
  _: 1
5274
5283
  }),
5275
- ye(wt, {
5284
+ ye(bt, {
5276
5285
  name: n.position === "left" ? "rai-slide-right" : "rai-slide-left"
5277
5286
  }, {
5278
5287
  default: Ae(() => {
5279
- var X, G, oe;
5288
+ var J, Q, oe;
5280
5289
  return [
5281
- r.value ? (x(), v("aside", {
5290
+ r.value ? (k(), T("aside", {
5282
5291
  key: 0,
5283
- class: b(["fixed bottom-0 z-50 flex-shrink-0 border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-2xl will-change-transform", [
5292
+ class: v(["fixed bottom-0 z-50 flex-shrink-0 border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-2xl will-change-transform", [
5284
5293
  n.position === "left" ? "left-0 border-r" : "right-0 border-l",
5285
- (X = n.ui) == null ? void 0 : X.drawer
5294
+ (J = n.ui) == null ? void 0 : J.drawer
5286
5295
  ]]),
5287
5296
  style: cn({ width: c.value ? n.fullscreenWidth : n.width, top: n.topOffset, height: `calc(100vh - ${n.topOffset})` })
5288
5297
  }, [
5289
5298
  h("div", {
5290
- class: b(["h-full flex flex-col relative bg-white dark:bg-gray-900", (G = n.ui) == null ? void 0 : G.panel])
5299
+ class: v(["h-full flex flex-col relative bg-white dark:bg-gray-900", (Q = n.ui) == null ? void 0 : Q.panel])
5291
5300
  }, [
5292
- ce(O.$slots, "header", zn(Hn(I.value)), () => [
5301
+ ce(O.$slots, "header", zn(Hn(M.value)), () => [
5293
5302
  ye(na, {
5294
5303
  ui: n.ui,
5295
- "is-setup-mode": C.value,
5304
+ "is-setup-mode": A.value,
5296
5305
  "show-new-chat-button": n.showNewChatButton,
5297
- "has-history": D(i).chatHistory.length > 0,
5306
+ "has-history": $(i).chatHistory.length > 0,
5298
5307
  "show-quota": n.showQuota,
5299
- quota: D(i).quota,
5308
+ quota: $(i).quota,
5300
5309
  "show-close-button": n.showCloseButton,
5301
5310
  "show-minimize-button": n.showMinimizeButton,
5302
5311
  "show-fullscreen-toggle": n.showFullscreenToggle,
5303
5312
  "is-fullscreen": c.value,
5304
5313
  "show-message-count": n.showMessageCount,
5305
- "message-count": D(i).quota.used,
5306
- "message-limit": D(i).quota.limit,
5314
+ "message-count": $(i).quota.used,
5315
+ "message-limit": $(i).quota.limit,
5307
5316
  t: o,
5308
5317
  onNewChat: st,
5309
5318
  onClose: ze,
@@ -5312,45 +5321,45 @@ app.use(RestifyAiPlugin, {
5312
5321
  }, {
5313
5322
  quota: Ae(() => [
5314
5323
  ce(O.$slots, "quota", {
5315
- quota: D(i).quota
5324
+ quota: $(i).quota
5316
5325
  }, void 0, !0)
5317
5326
  ]),
5318
5327
  _: 3
5319
5328
  }, 8, ["ui", "is-setup-mode", "show-new-chat-button", "has-history", "show-quota", "quota", "show-close-button", "show-minimize-button", "show-fullscreen-toggle", "is-fullscreen", "show-message-count", "message-count", "message-limit"])
5320
5329
  ], !0),
5321
5330
  h("div", {
5322
- class: b(["h-full flex flex-col mx-auto w-full overflow-hidden", [{ "max-w-5xl": c.value }, (oe = n.ui) == null ? void 0 : oe.body]])
5331
+ class: v(["h-full flex flex-col mx-auto w-full overflow-hidden", [{ "max-w-5xl": c.value }, (oe = n.ui) == null ? void 0 : oe.body]])
5323
5332
  }, [
5324
- C.value ? (x(), v("div", ka, [
5333
+ A.value ? (k(), T("div", ka, [
5325
5334
  ce(O.$slots, "setup", {}, () => [
5326
5335
  ye(ha, {
5327
- copied: g.value,
5336
+ copied: y.value,
5328
5337
  onCopy: je
5329
5338
  }, null, 8, ["copied"])
5330
5339
  ], !0)
5331
- ])) : (x(), v(be, { key: 1 }, [
5332
- D(i).chatHistory.length === 0 ? (x(), v("div", wa, [
5340
+ ])) : (k(), T(be, { key: 1 }, [
5341
+ $(i).chatHistory.length === 0 ? (k(), T("div", wa, [
5333
5342
  ce(O.$slots, "empty-state", {
5334
- suggestions: Z.value,
5343
+ suggestions: Y.value,
5335
5344
  onClick: se
5336
5345
  }, () => [
5337
5346
  ye(Fi, { onItemClick: se })
5338
5347
  ], !0)
5339
- ])) : (x(), v("div", {
5348
+ ])) : (k(), T("div", {
5340
5349
  key: 1,
5341
5350
  ref_key: "chatContainer",
5342
5351
  ref: u,
5343
5352
  class: "flex-1 overflow-y-auto py-6 pb-24"
5344
5353
  }, [
5345
5354
  ye(la, {
5346
- messages: D(i).chatHistory,
5347
- "loading-message": D(f),
5348
- quota: D(i).quota,
5349
- error: D(i).error,
5355
+ messages: $(i).chatHistory,
5356
+ "loading-message": $(f),
5357
+ quota: $(i).quota,
5358
+ error: $(i).error,
5350
5359
  ui: n.ui,
5351
5360
  t: o,
5352
- onCopy: Y,
5353
- onContactSupport: At,
5361
+ onCopy: X,
5362
+ onContactSupport: Ct,
5354
5363
  onRetry: it
5355
5364
  }, {
5356
5365
  message: Ae((ee) => [
@@ -5368,7 +5377,7 @@ app.use(RestifyAiPlugin, {
5368
5377
  id: "rai-chat-bottom",
5369
5378
  class: "h-8"
5370
5379
  }, null, -1)),
5371
- ce(O.$slots, "input", zn(Hn(V.value)), () => {
5380
+ ce(O.$slots, "input", zn(Hn(W.value)), () => {
5372
5381
  var ee, ie;
5373
5382
  return [
5374
5383
  ye(Hi, {
@@ -5376,15 +5385,15 @@ app.use(RestifyAiPlugin, {
5376
5385
  ref: d,
5377
5386
  modelValue: a.value,
5378
5387
  "onUpdate:modelValue": B[1] || (B[1] = (He) => a.value = He),
5379
- sending: D(i).sending,
5380
- placeholder: ((ee = t.texts) == null ? void 0 : ee.placeholder) || D(de)("inputPlaceholder"),
5381
- "support-placeholder": ((ie = t.texts) == null ? void 0 : ie.supportPlaceholder) || D(de)("supportPlaceholder"),
5382
- suggestions: Z.value,
5383
- "has-history": D(i).chatHistory.length > 0,
5384
- "support-request-mode": D(i).supportRequestMode,
5388
+ sending: $(i).sending,
5389
+ placeholder: ((ee = t.texts) == null ? void 0 : ee.placeholder) || $(de)("inputPlaceholder"),
5390
+ "support-placeholder": ((ie = t.texts) == null ? void 0 : ie.supportPlaceholder) || $(de)("supportPlaceholder"),
5391
+ suggestions: Y.value,
5392
+ "has-history": $(i).chatHistory.length > 0,
5393
+ "support-request-mode": $(i).supportRequestMode,
5385
5394
  "show-support-mode-toggle": _.value,
5386
5395
  onSubmit: ot,
5387
- onCancel: D(i).cancelRequest,
5396
+ onCancel: $(i).cancelRequest,
5388
5397
  onSuggestionSelect: qe,
5389
5398
  onToggleSupportMode: ne
5390
5399
  }, {
@@ -5399,7 +5408,7 @@ app.use(RestifyAiPlugin, {
5399
5408
  ], 2)
5400
5409
  ], 2),
5401
5410
  ye(rs, {
5402
- show: m.value,
5411
+ show: x.value,
5403
5412
  title: o("closeConfirmTitle"),
5404
5413
  message: o("closeConfirmMessage"),
5405
5414
  "confirm-text": o("confirmClose"),
@@ -5407,19 +5416,19 @@ app.use(RestifyAiPlugin, {
5407
5416
  ui: n.ui,
5408
5417
  "confirm-variant": "danger",
5409
5418
  onConfirm: Ft,
5410
- onCancel: B[2] || (B[2] = (ee) => m.value = !1)
5419
+ onCancel: B[2] || (B[2] = (ee) => x.value = !1)
5411
5420
  }, null, 8, ["show", "title", "message", "confirm-text", "cancel-text", "ui"]),
5412
5421
  ye(rs, {
5413
- show: D(k),
5414
- title: D(S),
5415
- message: D(E),
5422
+ show: $(g),
5423
+ title: $(C),
5424
+ message: $(S),
5416
5425
  "confirm-text": o("startNewChat"),
5417
- "cancel-text": D(y) ? o("continueChat") : o("cancel"),
5426
+ "cancel-text": $(m) ? o("continueChat") : o("cancel"),
5418
5427
  ui: n.ui,
5419
5428
  icon: "warning",
5420
5429
  "confirm-variant": "primary",
5421
5430
  onConfirm: rt,
5422
- onCancel: D(T)
5431
+ onCancel: $(b)
5423
5432
  }, null, 8, ["show", "title", "message", "confirm-text", "cancel-text", "ui", "onCancel"])
5424
5433
  ], 6)) : F("", !0)
5425
5434
  ];
@@ -5440,10 +5449,10 @@ app.use(RestifyAiPlugin, {
5440
5449
  },
5441
5450
  emits: ["error", "reset"],
5442
5451
  setup(n, { expose: e, emit: t }) {
5443
- const s = n, r = t, o = q(!1), i = q(null);
5452
+ const s = n, r = t, o = U(!1), i = U(null);
5444
5453
  Ks((u, d, c) => {
5445
- var g;
5446
- return o.value = !0, i.value = u, (g = s.onError) == null || g.call(s, u, c), r("error", u, c), !1;
5454
+ var y;
5455
+ return o.value = !0, i.value = u, (y = s.onError) == null || y.call(s, u, c), r("error", u, c), !1;
5447
5456
  });
5448
5457
  function a() {
5449
5458
  o.value = !1, i.value = null, r("reset");
@@ -5457,13 +5466,13 @@ app.use(RestifyAiPlugin, {
5457
5466
  error: i.value,
5458
5467
  reset: a
5459
5468
  }, () => {
5460
- var c, g, m, f, p;
5469
+ var c, y, x, f, p;
5461
5470
  return [
5462
5471
  h("div", {
5463
- class: b(["flex flex-col items-center justify-center p-6 text-center", (c = n.ui) == null ? void 0 : c.container])
5472
+ class: v(["flex flex-col items-center justify-center p-6 text-center", (c = n.ui) == null ? void 0 : c.container])
5464
5473
  }, [
5465
5474
  h("div", {
5466
- class: b(["w-12 h-12 mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center", (g = n.ui) == null ? void 0 : g.iconContainer])
5475
+ class: v(["w-12 h-12 mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center", (y = n.ui) == null ? void 0 : y.iconContainer])
5467
5476
  }, [...d[0] || (d[0] = [
5468
5477
  h("svg", {
5469
5478
  class: "w-6 h-6 text-red-600 dark:text-red-400",
@@ -5480,14 +5489,14 @@ app.use(RestifyAiPlugin, {
5480
5489
  ], -1)
5481
5490
  ])], 2),
5482
5491
  h("h3", {
5483
- class: b(["text-lg font-semibold text-gray-900 dark:text-white mb-2", (m = n.ui) == null ? void 0 : m.title])
5492
+ class: v(["text-lg font-semibold text-gray-900 dark:text-white mb-2", (x = n.ui) == null ? void 0 : x.title])
5484
5493
  }, P(n.title), 3),
5485
5494
  h("p", {
5486
- class: b(["text-sm text-gray-600 dark:text-gray-400 mb-4", (f = n.ui) == null ? void 0 : f.message])
5495
+ class: v(["text-sm text-gray-600 dark:text-gray-400 mb-4", (f = n.ui) == null ? void 0 : f.message])
5487
5496
  }, P(n.message), 3),
5488
- n.showRetry ? (x(), v("button", {
5497
+ n.showRetry ? (k(), T("button", {
5489
5498
  key: 0,
5490
- class: b(["px-4 py-2 text-sm font-medium text-white bg-primary rounded-lg hover:bg-primary/90 transition-colors", (p = n.ui) == null ? void 0 : p.retryButton]),
5499
+ class: v(["px-4 py-2 text-sm font-medium text-white bg-primary rounded-lg hover:bg-primary/90 transition-colors", (p = n.ui) == null ? void 0 : p.retryButton]),
5491
5500
  onClick: a
5492
5501
  }, P(n.retryText), 3)) : F("", !0)
5493
5502
  ], 2)