@8wave/ai-elements 0.125.0-beta.31 → 0.125.0-beta.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/_chunks/{PkChatbotFilePreview-CqxtVySb.js → PkChatbotFilePreview-DsRAk1js.js} +2 -2
  2. package/dist/_chunks/{PkChatbotFilePreview-CqxtVySb.js.map → PkChatbotFilePreview-DsRAk1js.js.map} +1 -1
  3. package/dist/_chunks/PkImageEditorDialog-BQwM06kT.js +939 -0
  4. package/dist/_chunks/PkImageEditorDialog-BQwM06kT.js.map +1 -0
  5. package/dist/_chunks/{PkStreamingMarkdown-BqDooeUU.js → PkStreamingMarkdown-CjL7l_3E.js} +2 -2
  6. package/dist/_chunks/{PkStreamingMarkdown-BqDooeUU.js.map → PkStreamingMarkdown-CjL7l_3E.js.map} +1 -1
  7. package/dist/_chunks/{PkToolChatFile-DpStX3wS.js → PkToolChatFile-weptM8iA.js} +2 -2
  8. package/dist/_chunks/{PkToolChatFile-DpStX3wS.js.map → PkToolChatFile-weptM8iA.js.map} +1 -1
  9. package/dist/_chunks/{PkToolShareDocument-BvHklbzb.js → PkToolShareDocument-D5K3uJ2x.js} +2 -2
  10. package/dist/_chunks/{PkToolShareDocument-BvHklbzb.js.map → PkToolShareDocument-D5K3uJ2x.js.map} +1 -1
  11. package/dist/_chunks/{PkToolShowArtifact-YPwJLLlW.js → PkToolShowArtifact-Bm2zS5YS.js} +2 -2
  12. package/dist/_chunks/{PkToolShowArtifact-YPwJLLlW.js.map → PkToolShowArtifact-Bm2zS5YS.js.map} +1 -1
  13. package/dist/_chunks/{PkToolShowContactForm-CTc1mbA8.js → PkToolShowContactForm-BKJCv5To.js} +2 -2
  14. package/dist/_chunks/{PkToolShowContactForm-CTc1mbA8.js.map → PkToolShowContactForm-BKJCv5To.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowDiagram-COt1Z3q9.js → PkToolShowDiagram-jpaEAi2X.js} +2 -2
  16. package/dist/_chunks/{PkToolShowDiagram-COt1Z3q9.js.map → PkToolShowDiagram-jpaEAi2X.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowForm-DT5EyYVY.js → PkToolShowForm-DvAcJgDP.js} +2 -2
  18. package/dist/_chunks/{PkToolShowForm-DT5EyYVY.js.map → PkToolShowForm-DvAcJgDP.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowImageGallery-DKrCrrB5.js → PkToolShowImageGallery-D0htuXNL.js} +4 -4
  20. package/dist/_chunks/{PkToolShowImageGallery-DKrCrrB5.js.map → PkToolShowImageGallery-D0htuXNL.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowSources-CzSknPo6.js → PkToolShowSources-Cfj6iRGj.js} +2 -2
  22. package/dist/_chunks/{PkToolShowSources-CzSknPo6.js.map → PkToolShowSources-Cfj6iRGj.js.map} +1 -1
  23. package/dist/_chunks/{useLightbox-D2Zi-Fpe.js → useLightbox-C54BCSbU.js} +130 -89
  24. package/dist/_chunks/useLightbox-C54BCSbU.js.map +1 -0
  25. package/dist/ai-elements.es.js +2774 -2721
  26. package/dist/ai-elements.es.js.map +1 -1
  27. package/dist-vue/PkChatbot.js +1 -1
  28. package/dist-vue/PkChatbotEmptyState.js +1 -1
  29. package/dist-vue/PkChatbotFilePreview.js +1 -1
  30. package/dist-vue/PkChatbotInput.js +1 -1
  31. package/dist-vue/PkChatbotMessages.js +1 -1
  32. package/dist-vue/PkChatbotSteps.js +1 -1
  33. package/dist-vue/PkChatbotViewChat.js +1 -1
  34. package/dist-vue/_chunks/{PkChatbot-DLgPqMWd.js → PkChatbot-Bc2hlwFO.js} +3 -3
  35. package/dist-vue/_chunks/{PkChatbot-DLgPqMWd.js.map → PkChatbot-Bc2hlwFO.js.map} +1 -1
  36. package/dist-vue/_chunks/{PkChatbotEmptyState-DMPEj1Qa.js → PkChatbotEmptyState-NHarCaDm.js} +2 -2
  37. package/dist-vue/_chunks/{PkChatbotEmptyState-DMPEj1Qa.js.map → PkChatbotEmptyState-NHarCaDm.js.map} +1 -1
  38. package/dist-vue/_chunks/{PkChatbotFilePreview-j_8sDZUE.js → PkChatbotFilePreview-BIta8Yg-.js} +2 -2
  39. package/dist-vue/_chunks/{PkChatbotFilePreview-j_8sDZUE.js.map → PkChatbotFilePreview-BIta8Yg-.js.map} +1 -1
  40. package/dist-vue/_chunks/{PkChatbotInput-TamSYiA7.js → PkChatbotInput-BSzDRoDD.js} +192 -181
  41. package/dist-vue/_chunks/PkChatbotInput-BSzDRoDD.js.map +1 -0
  42. package/dist-vue/_chunks/{PkChatbotMessages-bPBOSAv7.js → PkChatbotMessages-DEMKZDCb.js} +17 -17
  43. package/dist-vue/_chunks/{PkChatbotMessages-bPBOSAv7.js.map → PkChatbotMessages-DEMKZDCb.js.map} +1 -1
  44. package/dist-vue/_chunks/{PkChatbotSteps-pibgqxus.js → PkChatbotSteps-DGQoYxJ9.js} +2 -2
  45. package/dist-vue/_chunks/{PkChatbotSteps-pibgqxus.js.map → PkChatbotSteps-DGQoYxJ9.js.map} +1 -1
  46. package/dist-vue/_chunks/{PkChatbotViewChat-y60IA9aQ.js → PkChatbotViewChat-aKi08vCz.js} +440 -431
  47. package/dist-vue/_chunks/PkChatbotViewChat-aKi08vCz.js.map +1 -0
  48. package/dist-vue/_chunks/{PkFilePreview-CPSYaOV7.js → PkFilePreview-D2HInDoA.js} +2 -2
  49. package/dist-vue/_chunks/{PkFilePreview-CPSYaOV7.js.map → PkFilePreview-D2HInDoA.js.map} +1 -1
  50. package/dist-vue/_chunks/{PkFilePreviewDialog-D6zFO_H_.js → PkFilePreviewDialog-jxcUSzPx.js} +2 -2
  51. package/dist-vue/_chunks/{PkFilePreviewDialog-D6zFO_H_.js.map → PkFilePreviewDialog-jxcUSzPx.js.map} +1 -1
  52. package/dist-vue/_chunks/PkImageEditorDialog-Dn3HV_ny.js +934 -0
  53. package/dist-vue/_chunks/PkImageEditorDialog-Dn3HV_ny.js.map +1 -0
  54. package/dist-vue/_chunks/{PkStreamingMarkdown-B3VWOaWb.js → PkStreamingMarkdown-DdOv86Eb.js} +11 -11
  55. package/dist-vue/_chunks/{PkStreamingMarkdown-B3VWOaWb.js.map → PkStreamingMarkdown-DdOv86Eb.js.map} +1 -1
  56. package/dist-vue/_chunks/{PkSvgViewer-BsdSOBpH.js → PkSvgViewer-vkd5Dluw.js} +2 -2
  57. package/dist-vue/_chunks/{PkSvgViewer-BsdSOBpH.js.map → PkSvgViewer-vkd5Dluw.js.map} +1 -1
  58. package/dist-vue/_chunks/{PkToolChatFile-PXpiJLZ6.js → PkToolChatFile-8nx166iM.js} +2 -2
  59. package/dist-vue/_chunks/{PkToolChatFile-PXpiJLZ6.js.map → PkToolChatFile-8nx166iM.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkToolShareDocument-cMUqik6v.js → PkToolShareDocument-CspvFwRR.js} +2 -2
  61. package/dist-vue/_chunks/{PkToolShareDocument-cMUqik6v.js.map → PkToolShareDocument-CspvFwRR.js.map} +1 -1
  62. package/dist-vue/_chunks/{PkToolShowArtifact-DouCz_dZ.js → PkToolShowArtifact-BppP_xSN.js} +2 -2
  63. package/dist-vue/_chunks/{PkToolShowArtifact-DouCz_dZ.js.map → PkToolShowArtifact-BppP_xSN.js.map} +1 -1
  64. package/dist-vue/_chunks/{PkToolShowContactForm-BmiNlFfx.js → PkToolShowContactForm-Bm0icz24.js} +2 -2
  65. package/dist-vue/_chunks/{PkToolShowContactForm-BmiNlFfx.js.map → PkToolShowContactForm-Bm0icz24.js.map} +1 -1
  66. package/dist-vue/_chunks/{PkToolShowDiagram-D6mYTDU-.js → PkToolShowDiagram-CgukB1Ss.js} +2 -2
  67. package/dist-vue/_chunks/{PkToolShowDiagram-D6mYTDU-.js.map → PkToolShowDiagram-CgukB1Ss.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkToolShowForm-CksTiimD.js → PkToolShowForm-CyyN7GQP.js} +2 -2
  69. package/dist-vue/_chunks/{PkToolShowForm-CksTiimD.js.map → PkToolShowForm-CyyN7GQP.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkToolShowImageGallery-B-lVY0xH.js → PkToolShowImageGallery-zQF_lsxI.js} +5 -5
  71. package/dist-vue/_chunks/{PkToolShowImageGallery-B-lVY0xH.js.map → PkToolShowImageGallery-zQF_lsxI.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkToolShowLocation-B8FE_Sqd.js → PkToolShowLocation-WdRqG8Wi.js} +2 -2
  73. package/dist-vue/_chunks/{PkToolShowLocation-B8FE_Sqd.js.map → PkToolShowLocation-WdRqG8Wi.js.map} +1 -1
  74. package/dist-vue/_chunks/{PkToolShowProductList-Dcq3Kdse.js → PkToolShowProductList-DW_P0gC2.js} +2 -2
  75. package/dist-vue/_chunks/{PkToolShowProductList-Dcq3Kdse.js.map → PkToolShowProductList-DW_P0gC2.js.map} +1 -1
  76. package/dist-vue/_chunks/{PkToolShowSources-DApWmwvk.js → PkToolShowSources-BugMybUx.js} +2 -2
  77. package/dist-vue/_chunks/{PkToolShowSources-DApWmwvk.js.map → PkToolShowSources-BugMybUx.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkToolShowVideo-CjrYh9-q.js → PkToolShowVideo-BW7aRKs_.js} +2 -2
  79. package/dist-vue/_chunks/{PkToolShowVideo-CjrYh9-q.js.map → PkToolShowVideo-BW7aRKs_.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkToolShowWebPages-DSIAizw-.js → PkToolShowWebPages-DxKimT-2.js} +2 -2
  81. package/dist-vue/_chunks/{PkToolShowWebPages-DSIAizw-.js.map → PkToolShowWebPages-DxKimT-2.js.map} +1 -1
  82. package/dist-vue/_chunks/{useLightbox-FDyQrPWe.js → useLightbox-Ctl9zaMX.js} +132 -91
  83. package/dist-vue/_chunks/useLightbox-Ctl9zaMX.js.map +1 -0
  84. package/dist-vue/composables.js +36 -2
  85. package/dist-vue/composables.js.map +1 -1
  86. package/dist-vue/index.js +22 -22
  87. package/dist-vue/index.js.map +1 -1
  88. package/dist-vue/locales.js +34 -0
  89. package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +5 -0
  90. package/dist-vue/packages/components/src/chat/PkImageEditor.d.ts +11 -9
  91. package/dist-vue/packages/components/src/chat/PkImageEditorDialog.d.ts +12 -5
  92. package/dist-vue/packages/components/src/chat/imageEdits.d.ts +77 -1
  93. package/dist-vue/packages/components/src/composables/useLightbox.d.ts +26 -0
  94. package/dist-vue/style.css +1 -1
  95. package/package.json +1 -1
  96. package/dist/_chunks/PkImageEditorDialog-Cq8y_PtC.js +0 -555
  97. package/dist/_chunks/PkImageEditorDialog-Cq8y_PtC.js.map +0 -1
  98. package/dist/_chunks/useLightbox-D2Zi-Fpe.js.map +0 -1
  99. package/dist-vue/_chunks/PkChatbotInput-TamSYiA7.js.map +0 -1
  100. package/dist-vue/_chunks/PkChatbotViewChat-y60IA9aQ.js.map +0 -1
  101. package/dist-vue/_chunks/PkImageEditorDialog-BLUyILVi.js +0 -550
  102. package/dist-vue/_chunks/PkImageEditorDialog-BLUyILVi.js.map +0 -1
  103. package/dist-vue/_chunks/useLightbox-FDyQrPWe.js.map +0 -1
@@ -1,33 +1,33 @@
1
1
  import { s as e } from "./Media-DylqhvaF.js";
2
2
  import { t } from "./VvButtonLocalized-C-vx25u4.js";
3
- import { t as n } from "./PkStreamingMarkdown-B3VWOaWb.js";
3
+ import { t as n } from "./PkStreamingMarkdown-DdOv86Eb.js";
4
4
  import { O as r } from "./utils-DXOZ6zjh.js";
5
- import { t as i } from "./PkChatbotFilePreview-j_8sDZUE.js";
5
+ import { t as i } from "./PkChatbotFilePreview-BIta8Yg-.js";
6
6
  import { VvDropdown as a, VvDropdownAction as o, VvIcon as s } from "@volverjs/ui-vue/components";
7
- import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineAsyncComponent as g, defineComponent as _, mergeModels as v, mergeProps as ee, nextTick as y, normalizeClass as b, normalizeProps as te, onBeforeUnmount as ne, onMounted as re, openBlock as x, ref as S, renderList as C, renderSlot as w, toDisplayString as T, unref as E, useId as ie, useModel as D, useTemplateRef as O, watch as k, withCtx as A, withKeys as ae, withModifiers as oe } from "vue";
8
- import { useI18n as se } from "vue-i18n";
9
- import { useResizeObserver as ce } from "@vueuse/core";
7
+ import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineAsyncComponent as g, defineComponent as _, mergeModels as v, mergeProps as ee, nextTick as y, normalizeClass as b, normalizeProps as te, onBeforeUnmount as ne, onMounted as re, openBlock as x, ref as S, renderList as C, renderSlot as w, shallowRef as ie, toDisplayString as T, unref as E, useId as ae, useModel as oe, useTemplateRef as D, watch as O, withCtx as k, withKeys as se, withModifiers as ce } from "vue";
8
+ import { useI18n as le } from "vue-i18n";
9
+ import { useResizeObserver as ue } from "@vueuse/core";
10
10
  // ../../node_modules/.pnpm/autosize@6.0.1/node_modules/autosize/dist/autosize.esm.js
11
- var j = /* @__PURE__ */ new Map();
12
- function le(e) {
13
- var t = j.get(e);
11
+ var A = /* @__PURE__ */ new Map();
12
+ function de(e) {
13
+ var t = A.get(e);
14
14
  t && t.destroy();
15
15
  }
16
- function M(e) {
17
- var t = j.get(e);
16
+ function j(e) {
17
+ var t = A.get(e);
18
18
  t && t.update();
19
19
  }
20
- var N = null;
21
- typeof window > "u" ? ((N = function(e) {
20
+ var M = null;
21
+ typeof window > "u" ? ((M = function(e) {
22
22
  return e;
23
23
  }).destroy = function(e) {
24
24
  return e;
25
- }, N.update = function(e) {
25
+ }, M.update = function(e) {
26
26
  return e;
27
- }) : ((N = function(e, t) {
27
+ }) : ((M = function(e, t) {
28
28
  return e && Array.prototype.forEach.call(e.length ? e : [e], function(e) {
29
29
  return function(e) {
30
- if (e && e.nodeName && e.nodeName === "TEXTAREA" && !j.has(e)) {
30
+ if (e && e.nodeName && e.nodeName === "TEXTAREA" && !A.has(e)) {
31
31
  var t, n = null, r = window.getComputedStyle(e), i = (t = e.value, function() {
32
32
  o({
33
33
  testForHeightReduction: t === "" || !e.value.startsWith(t),
@@ -36,7 +36,7 @@ typeof window > "u" ? ((N = function(e) {
36
36
  }), a = function(t) {
37
37
  e.removeEventListener("autosize:destroy", a), e.removeEventListener("autosize:update", s), e.removeEventListener("input", i), window.removeEventListener("resize", s), Object.keys(t).forEach(function(n) {
38
38
  return e.style[n] = t[n];
39
- }), j.delete(e);
39
+ }), A.delete(e);
40
40
  }.bind(e, {
41
41
  height: e.style.height,
42
42
  resize: e.style.resize,
@@ -45,7 +45,7 @@ typeof window > "u" ? ((N = function(e) {
45
45
  overflowX: e.style.overflowX,
46
46
  wordWrap: e.style.wordWrap
47
47
  });
48
- e.addEventListener("autosize:destroy", a), e.addEventListener("autosize:update", s), e.addEventListener("input", i), window.addEventListener("resize", s), e.style.overflowX = "hidden", e.style.wordWrap = "break-word", j.set(e, {
48
+ e.addEventListener("autosize:destroy", a), e.addEventListener("autosize:update", s), e.addEventListener("input", i), window.addEventListener("resize", s), e.style.overflowX = "hidden", e.style.wordWrap = "break-word", A.set(e, {
49
49
  destroy: a,
50
50
  update: s
51
51
  }), s();
@@ -77,14 +77,14 @@ typeof window > "u" ? ((N = function(e) {
77
77
  }(e);
78
78
  }), e;
79
79
  }).destroy = function(e) {
80
- return e && Array.prototype.forEach.call(e.length ? e : [e], le), e;
81
- }, N.update = function(e) {
82
- return e && Array.prototype.forEach.call(e.length ? e : [e], M), e;
80
+ return e && Array.prototype.forEach.call(e.length ? e : [e], de), e;
81
+ }, M.update = function(e) {
82
+ return e && Array.prototype.forEach.call(e.length ? e : [e], j), e;
83
83
  });
84
- var P = N, F = ["type"], I = {
84
+ var N = M, P = ["type"], F = {
85
85
  key: 0,
86
86
  class: "pk-chat-button__label"
87
- }, L = /* @__PURE__ */ _({
87
+ }, I = /* @__PURE__ */ _({
88
88
  __name: "PkChatButton",
89
89
  props: {
90
90
  icon: {},
@@ -101,33 +101,33 @@ var P = N, F = ["type"], I = {
101
101
  }, [h(r, {
102
102
  name: e.icon,
103
103
  class: "pk-chat-button__icon"
104
- }, null, 8, ["name"]), e.label ? (x(), f("span", I, T(e.label), 1)) : d("", !0)], 10, F);
104
+ }, null, 8, ["name"]), e.label ? (x(), f("span", F, T(e.label), 1)) : d("", !0)], 10, P);
105
105
  };
106
106
  }
107
- }), ue = { class: "pk-chatbot-input" }, de = {
107
+ }), fe = { class: "pk-chatbot-input" }, pe = {
108
108
  key: 0,
109
109
  class: "pk-chatbot-input__notice",
110
110
  role: "status"
111
- }, fe = {
111
+ }, me = {
112
112
  key: 2,
113
113
  class: "pk-chatbot-input__notice-text"
114
- }, pe = ["title"], me = {
114
+ }, he = ["title"], ge = {
115
115
  key: 1,
116
116
  class: "pk-chatbot-input__pointer"
117
- }, he = { class: "pk-chatbot-input__pointer-label" }, ge = {
117
+ }, _e = { class: "pk-chatbot-input__pointer-label" }, ve = {
118
118
  key: 2,
119
119
  class: "pk-chatbot-input__attachments"
120
- }, _e = { class: "pk-chatbot-input__fieldset" }, ve = [
120
+ }, ye = { class: "pk-chatbot-input__fieldset" }, be = [
121
121
  "title",
122
122
  "disabled",
123
123
  "onClick"
124
- ], ye = ["accept"], be = ["accept"], xe = { class: "pk-chatbot-input__content" }, Se = [
124
+ ], xe = ["accept"], Se = ["accept"], Ce = { class: "pk-chatbot-input__content" }, we = [
125
125
  "value",
126
126
  "aria-label",
127
127
  "aria-describedby",
128
128
  "aria-invalid",
129
129
  "placeholder"
130
- ], Ce = ["id"], we = { class: "opacity-60" }, R = /* @__PURE__ */ _({
130
+ ], Te = ["id"], Ee = { class: "opacity-60" }, L = /* @__PURE__ */ _({
131
131
  __name: "PkChatbotInput",
132
132
  props: /*@__PURE__*/ v({
133
133
  placeholder: {},
@@ -169,100 +169,110 @@ var P = N, F = ["type"], I = {
169
169
  "remove-pointer",
170
170
  "manual-confirmations"
171
171
  ], ["update:modelValue", "update:pendingAttachments"]),
172
- setup(_, { expose: v, emit: j }) {
173
- let le = g(() => import("./PkImageEditorDialog-BLUyILVi.js")), M = D(_, "modelValue"), N = D(_, "pendingAttachments"), F = j, I = _, { t: R } = se({ useScope: "global" }), z = O("textareaEl"), B = O("fileInputEl"), V = O("cameraInputEl"), H = O("formEl"), U = S(M.value ?? ""), W = null, G = () => {
174
- W !== null && (clearTimeout(W), W = null);
175
- }, Te = () => {
176
- G(), M.value = U.value;
177
- }, Ee = () => {
178
- G(), W = setTimeout(() => {
179
- M.value = U.value, W = null;
172
+ setup(_, { expose: v, emit: A }) {
173
+ let de = g(() => import("./PkImageEditorDialog-Dn3HV_ny.js")), j = oe(_, "modelValue"), M = oe(_, "pendingAttachments"), P = A, F = _, { t: L } = le({ useScope: "global" }), R = D("textareaEl"), De = D("fileInputEl"), z = D("cameraInputEl"), B = D("formEl"), V = S(j.value ?? ""), H = null, U = () => {
174
+ H !== null && (clearTimeout(H), H = null);
175
+ }, Oe = () => {
176
+ U(), j.value = V.value;
177
+ }, ke = () => {
178
+ U(), H = setTimeout(() => {
179
+ j.value = V.value, H = null;
180
180
  }, 300);
181
- }, De = () => {
182
- U.value = z.value?.value ?? "", Ee();
181
+ }, Ae = () => {
182
+ V.value = R.value?.value ?? "", ke();
183
183
  };
184
- k(M, (e) => {
185
- e !== U.value && (U.value = e ?? "", y(() => {
186
- z.value && P.update(z.value);
184
+ O(j, (e) => {
185
+ e !== V.value && (V.value = e ?? "", y(() => {
186
+ R.value && N.update(R.value);
187
187
  }));
188
188
  });
189
- let K = l(() => I.status === "streaming"), q = l(() => I.status === "submitted"), J = l(() => K.value || q.value), Oe = ie(), ke = l(() => U.value.length), Y = l(() => I.maxMessageLength !== void 0 && ke.value > I.maxMessageLength), Ae = l(() => N.value.some((e) => e.state === "uploading")), je = l(() => N.value.some((e) => e.state === "error")), X = l(() => J.value && !I.queueEnabled || Ae.value || je.value || Y.value ? !1 : U.value.trim().length > 0), Me = l(() => J.value && X.value), Ne = "capture" in document.createElement("input"), Pe = l(() => {
190
- let t = I.fileUpload?.allowedMimeTypes ?? [];
189
+ let W = l(() => F.status === "streaming"), G = l(() => F.status === "submitted"), K = l(() => W.value || G.value), q = ae(), je = l(() => V.value.length), J = l(() => F.maxMessageLength !== void 0 && je.value > F.maxMessageLength), Me = l(() => M.value.some((e) => e.state === "uploading")), Ne = l(() => M.value.some((e) => e.state === "error")), Y = l(() => K.value && !F.queueEnabled || Me.value || Ne.value || J.value ? !1 : V.value.trim().length > 0), Pe = l(() => K.value && Y.value), Fe = "capture" in document.createElement("input"), Ie = l(() => {
190
+ let t = F.fileUpload?.allowedMimeTypes ?? [];
191
191
  return [...t, ...e(t)].join(",");
192
- }), Fe = l(() => (I.fileUpload?.allowedMimeTypes ?? []).filter((e) => e.startsWith("image/")).join(",")), Z = l(() => Ne && Fe.value.length > 0), Ie = () => {
193
- B.value?.click();
194
- }, Le = () => {
195
- V.value?.click();
196
- }, Re = (e) => {
197
- for (let t of e) F("file-select", t);
198
- }, ze = (e) => {
199
- let t = e.target;
200
- Re(Array.from(t.files ?? [])), t.value = "";
192
+ }), Le = l(() => (F.fileUpload?.allowedMimeTypes ?? []).filter((e) => e.startsWith("image/")).join(",")), X = l(() => Fe && Le.value.length > 0), Re = () => {
193
+ De.value?.click();
194
+ }, ze = () => {
195
+ z.value?.click();
201
196
  }, Be = (e) => {
202
- let t = N.value.find((t) => t.id === e);
203
- t && (URL.revokeObjectURL(t.localUrl), N.value = N.value.filter((t) => t.id !== e), F("remove-attachment", t));
204
- }, Q = S(), $ = l(() => N.value.find((e) => e.id === Q.value)), Ve = (e) => !!I.editableImages && e.state !== "uploading" && r(e.file.type), He = async (e) => {
205
- let t = $.value;
206
- Q.value = void 0, t && (F("replace-attachment", t, e), await y(), z.value?.focus());
207
- }, Ue = S(!0), We = () => {
208
- Ue.value = !1;
209
- }, Ge = l(() => {
210
- if (I.attachmentNotice) return [{
197
+ for (let t of e) P("file-select", t);
198
+ }, Ve = (e) => {
199
+ let t = e.target;
200
+ Be(Array.from(t.files ?? [])), t.value = "";
201
+ }, He = (e) => {
202
+ let t = M.value.find((t) => t.id === e);
203
+ t && (URL.revokeObjectURL(t.localUrl), M.value = M.value.filter((t) => t.id !== e), P("remove-attachment", t));
204
+ }, Z = S(), Q = l(() => M.value.find((e) => e.id === Z.value)), $ = ie(), Ue = l(() => Q.value?.file ?? $.value), We = (e) => !!F.editableImages && e.state !== "uploading" && r(e.file.type), Ge = () => {
205
+ Z.value = void 0, $.value = void 0;
206
+ }, Ke = async (e) => {
207
+ let t = Q.value, n = !t && !!$.value;
208
+ if (Ge(), t) P("replace-attachment", t, e);
209
+ else if (n) P("file-select", e);
210
+ else return;
211
+ await y(), R.value?.focus();
212
+ }, qe = S(!0), Je = () => {
213
+ qe.value = !1;
214
+ }, Ye = l(() => {
215
+ if (F.attachmentNotice) return [{
211
216
  id: "limit",
212
217
  icon: "ri:information-line",
213
- text: I.attachmentNotice,
214
- dismiss: () => F("dismiss-attachment-notice")
218
+ text: F.attachmentNotice,
219
+ dismiss: () => P("dismiss-attachment-notice")
215
220
  }];
216
221
  let e = [];
217
- je.value && e.push({
222
+ Ne.value && e.push({
218
223
  id: "upload-failed",
219
224
  icon: "ri:error-warning-line",
220
- text: R("message.attachmentUploadFailed")
225
+ text: L("message.attachmentUploadFailed")
221
226
  });
222
- for (let t of I.answerNotices ?? []) e.push({
227
+ for (let t of F.answerNotices ?? []) e.push({
223
228
  id: `answer-${t.id}`,
224
229
  icon: "ri:chat-check-line",
225
230
  text: t.text,
226
- open: () => F("open-answer-notice", t.id),
227
- dismiss: () => F("dismiss-answer-notice", t.id)
231
+ open: () => P("open-answer-notice", t.id),
232
+ dismiss: () => P("dismiss-answer-notice", t.id)
228
233
  });
229
- return I.pageNotice && e.push({
234
+ return F.pageNotice && e.push({
230
235
  id: "page",
231
236
  icon: "ri:pages-line",
232
- text: I.pageNotice,
233
- dismiss: () => F("dismiss-page-notice")
234
- }), I.dismissableNotice && Ue.value && e.push({
237
+ text: F.pageNotice,
238
+ dismiss: () => P("dismiss-page-notice")
239
+ }), F.dismissableNotice && qe.value && e.push({
235
240
  id: "dismissable",
236
- markdown: I.dismissableNotice,
237
- dismiss: We
241
+ markdown: F.dismissableNotice,
242
+ dismiss: Je
238
243
  }), e;
239
- }), Ke = () => {
240
- H.value?.querySelector("button:focus-visible") && z.value?.focus();
241
- }, qe = () => {
242
- Ke(), F("stop-generation");
243
- }, Je = () => {
244
- X.value && (Ke(), Te(), F("submit"), U.value = "", M.value = "", y(() => {
245
- z.value && (z.value.value = "", P.update(z.value));
244
+ }), Xe = () => {
245
+ B.value?.querySelector("button:focus-visible") && R.value?.focus();
246
+ }, Ze = () => {
247
+ Xe(), P("stop-generation");
248
+ }, Qe = () => {
249
+ Y.value && (Xe(), Oe(), P("submit"), V.value = "", j.value = "", y(() => {
250
+ R.value && (R.value.value = "", N.update(R.value));
246
251
  }));
247
- }, Ye = (e) => {
248
- e.shiftKey || e.isComposing || e.keyCode === 229 || (e.preventDefault(), Je());
252
+ }, $e = (e) => {
253
+ e.shiftKey || e.isComposing || e.keyCode === 229 || (e.preventDefault(), Qe());
249
254
  };
250
255
  re(() => {
251
- z.value && P(z.value);
256
+ R.value && N(R.value);
252
257
  });
253
- let Xe = 0;
254
- return ce(z, ([e]) => {
258
+ let et = 0;
259
+ return ue(R, ([e]) => {
255
260
  let t = e?.contentRect.width ?? 0;
256
- z.value && t !== Xe && (Xe = t, P.update(z.value));
257
- }), k(() => I.placeholder, async () => {
258
- await y(), z.value && P.update(z.value);
261
+ R.value && t !== et && (et = t, N.update(R.value));
262
+ }), O(() => F.placeholder, async () => {
263
+ await y(), R.value && N.update(R.value);
259
264
  }), ne(() => {
260
- G(), z.value && P.destroy(z.value);
261
- for (let e of N.value) URL.revokeObjectURL(e.localUrl);
262
- }), v({ focus: () => z.value?.focus() }), (e, r) => {
265
+ U(), R.value && N.destroy(R.value);
266
+ for (let e of M.value) URL.revokeObjectURL(e.localUrl);
267
+ }), v({
268
+ focus: () => R.value?.focus(),
269
+ annotateImage: (e) => {
270
+ Z.value = void 0, $.value = e;
271
+ }
272
+ }), (e, r) => {
263
273
  let l = s, g = t, v = o, y = a;
264
- return x(), f("div", ue, [
265
- Ge.value.length ? (x(), f("div", de, [(x(!0), f(c, null, C(Ge.value, (e) => (x(), f("div", {
274
+ return x(), f("div", fe, [
275
+ Ye.value.length ? (x(), f("div", pe, [(x(!0), f(c, null, C(Ye.value, (e) => (x(), f("div", {
266
276
  key: e.id,
267
277
  class: "pk-chatbot-input__notice-item"
268
278
  }, [
@@ -275,17 +285,17 @@ var P = N, F = ["type"], I = {
275
285
  key: 1,
276
286
  markdown: e.markdown,
277
287
  class: "wysiwyg pk-chatbot-input__notice-text"
278
- }, null, 8, ["markdown"])) : (x(), f("span", fe, T(e.text), 1)),
288
+ }, null, 8, ["markdown"])) : (x(), f("span", me, T(e.text), 1)),
279
289
  e.open ? (x(), u(g, {
280
290
  key: 3,
281
- label: E(R)("action.open"),
291
+ label: E(L)("action.open"),
282
292
  modifiers: "link",
283
293
  class: "pk-chatbot-input__notice-action",
284
294
  onClick: (t) => e.open()
285
295
  }, null, 8, ["label", "onClick"])) : d("", !0),
286
296
  e.dismiss ? (x(), u(g, {
287
297
  key: 4,
288
- title: E(R)("action.close"),
298
+ title: E(L)("action.close"),
289
299
  modifiers: "action-quiet",
290
300
  icon: "ri:close-line",
291
301
  class: "w-18 h-18",
@@ -294,42 +304,42 @@ var P = N, F = ["type"], I = {
294
304
  ]))), 128))])) : d("", !0),
295
305
  p("form", {
296
306
  ref_key: "formEl",
297
- ref: H,
307
+ ref: B,
298
308
  class: "pk-chatbot-input__form",
299
- onSubmit: oe(Je, ["prevent"])
309
+ onSubmit: ce(Qe, ["prevent"])
300
310
  }, [
301
311
  _.automaticConfirmations ? (x(), f("button", {
302
312
  key: 0,
303
313
  type: "button",
304
314
  class: "pk-chatbot-input__mode",
305
- title: E(R)("action.manualConfirmations"),
306
- onClick: r[0] ||= (e) => F("manual-confirmations")
315
+ title: E(L)("action.manualConfirmations"),
316
+ onClick: r[0] ||= (e) => P("manual-confirmations")
307
317
  }, [
308
318
  h(l, {
309
319
  name: "ri:flashlight-line",
310
320
  class: "pk-chatbot-input__pointer-icon"
311
321
  }),
312
- m(" " + T(E(R)("label.automaticConfirmations")) + " ", 1),
322
+ m(" " + T(E(L)("label.automaticConfirmations")) + " ", 1),
313
323
  h(l, {
314
324
  name: "ri:close-line",
315
325
  class: "pk-chatbot-input__pointer-icon"
316
326
  })
317
- ], 8, pe)) : d("", !0),
318
- _.pointer ? (x(), f("div", me, [
327
+ ], 8, he)) : d("", !0),
328
+ _.pointer ? (x(), f("div", ge, [
319
329
  h(l, {
320
330
  name: _.pointer.kind === "text" ? "ri:double-quotes-l" : "ri:focus-3-line",
321
331
  class: "pk-chatbot-input__pointer-icon"
322
332
  }, null, 8, ["name"]),
323
- p("span", he, T(_.pointer.kind === "text" ? `«${_.pointer.label}»` : _.pointer.label), 1),
333
+ p("span", _e, T(_.pointer.kind === "text" ? `«${_.pointer.label}»` : _.pointer.label), 1),
324
334
  h(g, {
325
- title: E(R)("pagePointer.remove"),
335
+ title: E(L)("pagePointer.remove"),
326
336
  modifiers: "action-quiet",
327
337
  icon: "ri:close-line",
328
338
  class: "w-18 h-18",
329
- onClick: r[1] ||= (e) => F("remove-pointer")
339
+ onClick: r[1] ||= (e) => P("remove-pointer")
330
340
  }, null, 8, ["title"])
331
341
  ])) : d("", !0),
332
- N.value.length ? (x(), f("div", ge, [(x(!0), f(c, null, C(N.value, (e) => (x(), u(i, {
342
+ M.value.length ? (x(), f("div", ve, [(x(!0), f(c, null, C(M.value, (e) => (x(), u(i, {
333
343
  key: e.id,
334
344
  "media-type": e.mediaSource?.mimeType ?? e.file.type,
335
345
  url: e.localUrl,
@@ -338,12 +348,12 @@ var P = N, F = ["type"], I = {
338
348
  loading: e.state === "uploading",
339
349
  error: e.state === "error" ? e.error : void 0,
340
350
  removable: e.state !== "uploading",
341
- editable: Ve(e),
351
+ editable: We(e),
342
352
  retryable: _.retryableAttachments && e.state === "error",
343
353
  compact: "",
344
- onRemove: (t) => Be(e.id),
345
- onEdit: (t) => Q.value = e.id,
346
- onRetry: (t) => F("retry-attachment", e)
354
+ onRemove: (t) => He(e.id),
355
+ onEdit: (t) => Z.value = e.id,
356
+ onRetry: (t) => P("retry-attachment", e)
347
357
  }, null, 8, [
348
358
  "media-type",
349
359
  "url",
@@ -358,135 +368,135 @@ var P = N, F = ["type"], I = {
358
368
  "onEdit",
359
369
  "onRetry"
360
370
  ]))), 128))])) : d("", !0),
361
- p("div", _e, [
371
+ p("div", ye, [
362
372
  w(e.$slots, "prepend"),
363
- _.fileUpload && _.fileUpload.enabled && (Z.value || e.$slots["additional-actions"]) ? (x(), u(y, te(ee({ key: 0 }, {
373
+ _.fileUpload && _.fileUpload.enabled && (X.value || e.$slots["additional-actions"]) ? (x(), u(y, te(ee({ key: 0 }, {
364
374
  placement: "top-start",
365
375
  modifiers: "menu",
366
376
  flip: !0,
367
377
  offset: 3
368
378
  })), {
369
- default: A(({ init: e, toggle: t, aria: n }) => [p("button", ee({ ref: (t) => e(t) }, n, {
379
+ default: k(({ init: e, toggle: t, aria: n }) => [p("button", ee({ ref: (t) => e(t) }, n, {
370
380
  class: "pk-chat-button",
371
381
  type: "button",
372
- title: E(R)("action.attachFile"),
373
- disabled: J.value,
382
+ title: E(L)("action.attachFile"),
383
+ disabled: K.value,
374
384
  onClick: t
375
385
  }), [h(l, {
376
386
  name: "ri:add-line",
377
387
  class: "pk-chat-button__icon"
378
- })], 16, ve)]),
379
- items: A(() => [
380
- Z.value ? (x(), u(v, {
388
+ })], 16, be)]),
389
+ items: k(() => [
390
+ X.value ? (x(), u(v, {
381
391
  key: 0,
382
- disabled: J.value || _.attachmentLimitReached,
383
- onClick: Le
392
+ disabled: K.value || _.attachmentLimitReached,
393
+ onClick: ze
384
394
  }, {
385
- default: A(() => [h(l, {
395
+ default: k(() => [h(l, {
386
396
  name: "ri:camera-line",
387
397
  class: "pk-chatbot-input__dropdown-icon"
388
- }), m(" " + T(E(R)("action.takePhoto")), 1)]),
398
+ }), m(" " + T(E(L)("action.takePhoto")), 1)]),
389
399
  _: 1
390
400
  }, 8, ["disabled"])) : d("", !0),
391
401
  h(v, {
392
- disabled: J.value || _.attachmentLimitReached,
393
- onClick: Ie
402
+ disabled: K.value || _.attachmentLimitReached,
403
+ onClick: Re
394
404
  }, {
395
- default: A(() => [h(l, {
405
+ default: k(() => [h(l, {
396
406
  name: "ri:attachment-line",
397
407
  class: "pk-chatbot-input__dropdown-icon"
398
- }), m(" " + T(E(R)("action.attachFile")), 1)]),
408
+ }), m(" " + T(E(L)("action.attachFile")), 1)]),
399
409
  _: 1
400
410
  }, 8, ["disabled"]),
401
411
  w(e.$slots, "additional-actions")
402
412
  ]),
403
413
  _: 3
404
- }, 16)) : _.fileUpload && _.fileUpload.enabled ? (x(), u(L, {
414
+ }, 16)) : _.fileUpload && _.fileUpload.enabled ? (x(), u(I, {
405
415
  key: 1,
406
416
  icon: "ri:add-line",
407
- title: E(R)("action.attachFile"),
408
- disabled: J.value || _.attachmentLimitReached,
409
- onClick: Ie
417
+ title: E(L)("action.attachFile"),
418
+ disabled: K.value || _.attachmentLimitReached,
419
+ onClick: Re
410
420
  }, null, 8, ["title", "disabled"])) : d("", !0),
411
421
  _.fileUpload && _.fileUpload.enabled ? (x(), f("input", {
412
422
  key: 2,
413
423
  ref_key: "fileInputEl",
414
- ref: B,
424
+ ref: De,
415
425
  type: "file",
416
426
  hidden: "",
417
427
  multiple: "",
418
- accept: Pe.value,
419
- onChange: ze
420
- }, null, 40, ye)) : d("", !0),
421
- _.fileUpload && _.fileUpload.enabled && Z.value ? (x(), f("input", {
428
+ accept: Ie.value,
429
+ onChange: Ve
430
+ }, null, 40, xe)) : d("", !0),
431
+ _.fileUpload && _.fileUpload.enabled && X.value ? (x(), f("input", {
422
432
  key: 3,
423
433
  ref_key: "cameraInputEl",
424
- ref: V,
434
+ ref: z,
425
435
  type: "file",
426
436
  capture: "environment",
427
437
  hidden: "",
428
- accept: Fe.value,
429
- onChange: ze
430
- }, null, 40, be)) : d("", !0),
431
- _.pointerAvailable ? (x(), u(L, {
438
+ accept: Le.value,
439
+ onChange: Ve
440
+ }, null, 40, Se)) : d("", !0),
441
+ _.pointerAvailable ? (x(), u(I, {
432
442
  key: 4,
433
443
  icon: "ri:focus-3-line",
434
- title: E(R)("pagePointer.start"),
444
+ title: E(L)("pagePointer.start"),
435
445
  "aria-pressed": _.pointing,
436
- disabled: J.value,
437
- onClick: r[2] ||= (e) => F("point")
446
+ disabled: K.value,
447
+ onClick: r[2] ||= (e) => P("point")
438
448
  }, null, 8, [
439
449
  "title",
440
450
  "aria-pressed",
441
451
  "disabled"
442
452
  ])) : d("", !0),
443
- p("div", xe, [p("textarea", {
453
+ p("div", Ce, [p("textarea", {
444
454
  ref_key: "textareaEl",
445
- ref: z,
446
- value: U.value,
455
+ ref: R,
456
+ value: V.value,
447
457
  class: "pk-chatbot-input__textarea",
448
458
  name: "message",
449
459
  rows: "1",
450
460
  enterkeyhint: "send",
451
- "aria-label": E(R)("label.message"),
452
- "aria-describedby": _.maxMessageLength ? E(Oe) : void 0,
453
- "aria-invalid": Y.value || void 0,
461
+ "aria-label": E(L)("label.message"),
462
+ "aria-describedby": _.maxMessageLength ? E(q) : void 0,
463
+ "aria-invalid": J.value || void 0,
454
464
  placeholder: _.placeholder,
455
- onInput: De,
456
- onKeydown: ae(Ye, ["enter"])
457
- }, null, 40, Se)]),
465
+ onInput: Ae,
466
+ onKeydown: se($e, ["enter"])
467
+ }, null, 40, we)]),
458
468
  _.maxMessageLength ? (x(), f("div", {
459
469
  key: 5,
460
- id: E(Oe),
461
- class: b(["pk-chatbot-input__counter", { "pk-chatbot-input__counter--over": Y.value }])
462
- }, [m(T(e.$n(ke.value, "integer")) + "/", 1), p("span", we, T(e.$n(_.maxMessageLength, "integer")), 1)], 10, Ce)) : d("", !0),
463
- _.voiceEnabled && !K.value ? (x(), u(L, {
470
+ id: E(q),
471
+ class: b(["pk-chatbot-input__counter", { "pk-chatbot-input__counter--over": J.value }])
472
+ }, [m(T(e.$n(je.value, "integer")) + "/", 1), p("span", Ee, T(e.$n(_.maxMessageLength, "integer")), 1)], 10, Te)) : d("", !0),
473
+ _.voiceEnabled && !W.value ? (x(), u(I, {
464
474
  key: 6,
465
475
  icon: "ri:mic-line",
466
- title: E(R)("action.talk"),
467
- disabled: J.value,
468
- onClick: r[3] ||= (e) => F("voice-start")
476
+ title: E(L)("action.talk"),
477
+ disabled: K.value,
478
+ onClick: r[3] ||= (e) => P("voice-start")
469
479
  }, null, 8, ["title", "disabled"])) : d("", !0),
470
- K.value ? (x(), u(L, {
480
+ W.value ? (x(), u(I, {
471
481
  key: 7,
472
482
  icon: "ri:stop-fill",
473
- modifiers: Me.value ? void 0 : "primary",
474
- title: E(R)("action.stop"),
475
- onClick: qe
483
+ modifiers: Pe.value ? void 0 : "primary",
484
+ title: E(L)("action.stop"),
485
+ onClick: Ze
476
486
  }, null, 8, ["modifiers", "title"])) : d("", !0),
477
- Me.value ? (x(), u(L, {
487
+ Pe.value ? (x(), u(I, {
478
488
  key: 8,
479
489
  type: "submit",
480
490
  modifiers: "primary",
481
491
  icon: "ri:arrow-up-line",
482
- title: E(R)("action.queueMessage")
483
- }, null, 8, ["title"])) : K.value ? d("", !0) : (x(), u(L, {
492
+ title: E(L)("action.queueMessage")
493
+ }, null, 8, ["title"])) : W.value ? d("", !0) : (x(), u(I, {
484
494
  key: 9,
485
495
  type: "submit",
486
496
  modifiers: "primary",
487
- icon: q.value ? "loading-loop" : "ri:arrow-up-line",
488
- title: E(R)("action.submit"),
489
- disabled: !X.value
497
+ icon: G.value ? "loading-loop" : "ri:arrow-up-line",
498
+ title: E(L)("action.submit"),
499
+ disabled: !Y.value
490
500
  }, null, 8, [
491
501
  "icon",
492
502
  "title",
@@ -494,16 +504,17 @@ var P = N, F = ["type"], I = {
494
504
  ]))
495
505
  ])
496
506
  ], 544),
497
- $.value ? (x(), u(E(le), {
498
- key: 1,
499
- file: $.value.file,
500
- onApply: He,
501
- onClose: r[4] ||= (e) => Q.value = void 0
502
- }, null, 8, ["file"])) : d("", !0)
507
+ Ue.value ? (x(), u(E(de), {
508
+ key: Q.value?.id ?? "annotating",
509
+ file: Ue.value,
510
+ "initial-tool": Q.value ? void 0 : "arrow",
511
+ onApply: Ke,
512
+ onClose: Ge
513
+ }, null, 8, ["file", "initial-tool"])) : d("", !0)
503
514
  ]);
504
515
  };
505
516
  }
506
517
  });
507
- export { L as n, R as t };
518
+ export { I as n, L as t };
508
519
 
509
- //# sourceMappingURL=PkChatbotInput-TamSYiA7.js.map
520
+ //# sourceMappingURL=PkChatbotInput-BSzDRoDD.js.map