@8wave/ai-elements 0.103.0-beta.3 → 0.103.0-beta.4
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.
- package/dist/_chunks/PkLazyImg-CyeqD59M.js +34 -0
- package/dist/_chunks/{PkLazyImg-_389yCnQ.js.map → PkLazyImg-CyeqD59M.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-YJDdYD0E.js → PkStreamingMarkdown-DIkusrTI.js} +28 -28
- package/dist/_chunks/{PkStreamingMarkdown-YJDdYD0E.js.map → PkStreamingMarkdown-DIkusrTI.js.map} +1 -1
- package/dist/_chunks/PkToolRequestGeolocation-Cgus94KF.js +69 -0
- package/dist/_chunks/{PkToolRequestGeolocation-T16QI-Uv.js.map → PkToolRequestGeolocation-Cgus94KF.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-C8e5np2q.js → PkToolRequestOAuthConnection-DsUpUh97.js} +21 -21
- package/dist/_chunks/{PkToolRequestOAuthConnection-C8e5np2q.js.map → PkToolRequestOAuthConnection-DsUpUh97.js.map} +1 -1
- package/dist/_chunks/PkToolShowArtifact-griVx9w3.js +93 -0
- package/dist/_chunks/{PkToolShowArtifact-D15GjBm6.js.map → PkToolShowArtifact-griVx9w3.js.map} +1 -1
- package/dist/_chunks/{PkToolShowCalendarEvent-D_GjXl2_.js → PkToolShowCalendarEvent-DyiNmqqo.js} +43 -43
- package/dist/_chunks/{PkToolShowCalendarEvent-D_GjXl2_.js.map → PkToolShowCalendarEvent-DyiNmqqo.js.map} +1 -1
- package/dist/_chunks/PkToolShowComparison-RA72YL7R.js +66 -0
- package/dist/_chunks/{PkToolShowComparison-Bp2rP2Hx.js.map → PkToolShowComparison-RA72YL7R.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-NVzIu2t0.js → PkToolShowContactForm-BzDhv2yd.js} +41 -41
- package/dist/_chunks/{PkToolShowContactForm-NVzIu2t0.js.map → PkToolShowContactForm-BzDhv2yd.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-BnZrDPVC.js → PkToolShowDiagram-DhXe8IPm.js} +79 -79
- package/dist/_chunks/{PkToolShowDiagram-BnZrDPVC.js.map → PkToolShowDiagram-DhXe8IPm.js.map} +1 -1
- package/dist/_chunks/{PkToolShowEmail-DCSj4328.js → PkToolShowEmail-CBmfy_I9.js} +34 -34
- package/dist/_chunks/{PkToolShowEmail-DCSj4328.js.map → PkToolShowEmail-CBmfy_I9.js.map} +1 -1
- package/dist/_chunks/PkToolShowForm-CzIfm5de.js +365 -0
- package/dist/_chunks/{PkToolShowForm-ztQFyFd9.js.map → PkToolShowForm-CzIfm5de.js.map} +1 -1
- package/dist/_chunks/PkToolShowImageGallery-CSIiRuSC.js +74 -0
- package/dist/_chunks/{PkToolShowImageGallery-DiOR0vYa.js.map → PkToolShowImageGallery-CSIiRuSC.js.map} +1 -1
- package/dist/_chunks/{PkToolShowLocation-CQmgakEo.js → PkToolShowLocation-BHoUqpx4.js} +4079 -4079
- package/dist/_chunks/{PkToolShowLocation-CQmgakEo.js.map → PkToolShowLocation-BHoUqpx4.js.map} +1 -1
- package/dist/_chunks/PkToolShowMessage-CpDmPfCG.js +77 -0
- package/dist/_chunks/{PkToolShowMessage-BysjJ1oS.js.map → PkToolShowMessage-CpDmPfCG.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-D-JXSRmA.js → PkToolShowProductList-B8uuIvGo.js} +28 -28
- package/dist/_chunks/{PkToolShowProductList-D-JXSRmA.js.map → PkToolShowProductList-B8uuIvGo.js.map} +1 -1
- package/dist/_chunks/{PkToolShowQrCode-BcIwuGqm.js → PkToolShowQrCode-CD2lo3O0.js} +23 -23
- package/dist/_chunks/{PkToolShowQrCode-BcIwuGqm.js.map → PkToolShowQrCode-CD2lo3O0.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-U7etupUP.js → PkToolShowSources-JxaTAEpc.js} +98 -98
- package/dist/_chunks/{PkToolShowSources-U7etupUP.js.map → PkToolShowSources-JxaTAEpc.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-Dqe4gtEY.js → PkToolShowSuggestedReply-BTxqEwEm.js} +18 -18
- package/dist/_chunks/{PkToolShowSuggestedReply-Dqe4gtEY.js.map → PkToolShowSuggestedReply-BTxqEwEm.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-DYMhfXKH.js → PkToolShowVideo-CVksKdPD.js} +17 -17
- package/dist/_chunks/{PkToolShowVideo-DYMhfXKH.js.map → PkToolShowVideo-CVksKdPD.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWeather-D_pJe5DI.js → PkToolShowWeather-IDwTDozU.js} +68 -68
- package/dist/_chunks/{PkToolShowWeather-D_pJe5DI.js.map → PkToolShowWeather-IDwTDozU.js.map} +1 -1
- package/dist/_chunks/PkToolShowWebPages-D9Yst_2O.js +78 -0
- package/dist/_chunks/{PkToolShowWebPages-CPNgXzrS.js.map → PkToolShowWebPages-D9Yst_2O.js.map} +1 -1
- package/dist/_chunks/{PkUrl-C3gMPCjz.js → PkUrl-B3FTSURr.js} +19 -19
- package/dist/_chunks/{PkUrl-C3gMPCjz.js.map → PkUrl-B3FTSURr.js.map} +1 -1
- package/dist/_chunks/{VvCheckbox.es-CEfwI84M.js → VvCheckbox.es-C_dlDzrr.js} +78 -78
- package/dist/_chunks/{VvCheckbox.es-CEfwI84M.js.map → VvCheckbox.es-C_dlDzrr.js.map} +1 -1
- package/dist/_chunks/{VvCheckboxGroup.es-B-eWqe8G.js → VvCheckboxGroup.es-hY0kWpC2.js} +197 -197
- package/dist/_chunks/{VvCheckboxGroup.es-B-eWqe8G.js.map → VvCheckboxGroup.es-hY0kWpC2.js.map} +1 -1
- package/dist/_chunks/VvCombobox.es-DxhDF7ab.js +2044 -0
- package/dist/_chunks/{VvCombobox.es-CfRJtWOd.js.map → VvCombobox.es-DxhDF7ab.js.map} +1 -1
- package/dist/_chunks/{VvInputText.es-B0HHD6Th.js → VvInputText.es-CdpU8kvP.js} +460 -460
- package/dist/_chunks/{VvInputText.es-B0HHD6Th.js.map → VvInputText.es-CdpU8kvP.js.map} +1 -1
- package/dist/_chunks/{VvRadio.es-B3u8JJFF.js → VvRadio.es-BruZ5FHR.js} +144 -144
- package/dist/_chunks/{VvRadio.es-B3u8JJFF.js.map → VvRadio.es-BruZ5FHR.js.map} +1 -1
- package/dist/_chunks/{VvRadioGroup.es--AMV1wAw.js → VvRadioGroup.es-DSv6UdEy.js} +148 -148
- package/dist/_chunks/{VvRadioGroup.es--AMV1wAw.js.map → VvRadioGroup.es-DSv6UdEy.js.map} +1 -1
- package/dist/_chunks/{VvSelect.es-BfrDID0e.js → VvSelect.es-C244CAei.js} +155 -155
- package/dist/_chunks/{VvSelect.es-BfrDID0e.js.map → VvSelect.es-C244CAei.js.map} +1 -1
- package/dist/_chunks/VvTextarea.es-DbaPIcWl.js +1166 -0
- package/dist/_chunks/{VvTextarea.es-CAzFW944.js.map → VvTextarea.es-DbaPIcWl.js.map} +1 -1
- package/dist/_chunks/{dist-BvSGMyWS.js → dist-BgJVX4FG.js} +12 -12
- package/dist/_chunks/{dist-BvSGMyWS.js.map → dist-BgJVX4FG.js.map} +1 -1
- package/dist/_chunks/{dist-TFHdNK0W.js → dist-C5Y-NI3i.js} +230 -230
- package/dist/_chunks/{dist-TFHdNK0W.js.map → dist-C5Y-NI3i.js.map} +1 -1
- package/dist/_chunks/{esm-CUYQMpeA.js → esm-BTbGj6W3.js} +25 -25
- package/dist/_chunks/{esm-CUYQMpeA.js.map → esm-BTbGj6W3.js.map} +1 -1
- package/dist/_chunks/{floating-ui.vue-Br_zOLJv.js → floating-ui.vue-CoA4oagI.js} +16 -16
- package/dist/_chunks/{floating-ui.vue-Br_zOLJv.js.map → floating-ui.vue-CoA4oagI.js.map} +1 -1
- package/dist/_chunks/{iconify-BGSTR7vH.js → iconify-6ObncgfH.js} +36 -36
- package/dist/_chunks/{iconify-BGSTR7vH.js.map → iconify-6ObncgfH.js.map} +1 -1
- package/dist/_chunks/{index.es-B9rhQl9Z.js → index.es-BbyodRh9.js} +258 -258
- package/dist/_chunks/{index.es-B9rhQl9Z.js.map → index.es-BbyodRh9.js.map} +1 -1
- package/dist/_chunks/index.es-gbmOq0Nu.js +3124 -0
- package/dist/_chunks/index.es-gbmOq0Nu.js.map +1 -0
- package/dist/_chunks/{rolldown-runtime-CEFd7nDs.js → rolldown-runtime-CoeuCKPe.js} +4 -11
- package/dist/_chunks/{src-BjFv9Ag8.js → src-CIEdKLKO.js} +2 -2
- package/dist/_chunks/{src-BjFv9Ag8.js.map → src-CIEdKLKO.js.map} +1 -1
- package/dist/_chunks/useImageFallback-BAsLRsyg.js +19 -0
- package/dist/_chunks/{useImageFallback-8kfLDjXm.js.map → useImageFallback-BAsLRsyg.js.map} +1 -1
- package/dist/_chunks/{useLightbox-Bq6k-Wlt.js → useLightbox-Epg2fN87.js} +7 -7
- package/dist/_chunks/{useLightbox-Bq6k-Wlt.js.map → useLightbox-Epg2fN87.js.map} +1 -1
- package/dist/_chunks/useShortUrlResolver--HRa6Od3.js +72 -0
- package/dist/_chunks/{useShortUrlResolver-BTJM8XRw.js.map → useShortUrlResolver--HRa6Od3.js.map} +1 -1
- package/dist/_chunks/{vue-i18n-BJ7nxwO3.js → vue-i18n-t25g63Be.js} +81 -81
- package/dist/_chunks/{vue-i18n-BJ7nxwO3.js.map → vue-i18n-t25g63Be.js.map} +1 -1
- package/dist/_chunks/vue.runtime.esm-bundler-B3bThTaf.js +3747 -0
- package/dist/_chunks/vue.runtime.esm-bundler-B3bThTaf.js.map +1 -0
- package/dist/ai-elements.es.js +1861 -1861
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotAuth.js +1 -1
- package/dist-vue/PkChatbotFeedbackForm.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-DZ6TaZHh.js → PkChatbot-Ch8FlZjC.js} +2 -2
- package/dist-vue/_chunks/{PkChatbot-DZ6TaZHh.js.map → PkChatbot-Ch8FlZjC.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotAuth-CqwTN8ih.js → PkChatbotAuth-DvnmIukc.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotAuth-CqwTN8ih.js.map → PkChatbotAuth-DvnmIukc.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFeedbackForm-nEevDHmI.js → PkChatbotFeedbackForm-D0RNa7bE.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotFeedbackForm-nEevDHmI.js.map → PkChatbotFeedbackForm-D0RNa7bE.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-BgsyN-mB.js → PkChatbotMessages-DGO0WIqx.js} +4 -4
- package/dist-vue/_chunks/{PkChatbotMessages-BgsyN-mB.js.map → PkChatbotMessages-DGO0WIqx.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-0g30_sQH.js → PkChatbotViewChat-Dkz8dq8N.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewChat-0g30_sQH.js.map → PkChatbotViewChat-Dkz8dq8N.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-CMK4zR2J.js → PkToolShowContactForm-CkkWxSSz.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-CMK4zR2J.js.map → PkToolShowContactForm-CkkWxSSz.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-DoklcF3f.js → PkToolShowDiagram-D0NBG-Gy.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-DoklcF3f.js.map → PkToolShowDiagram-D0NBG-Gy.js.map} +1 -1
- package/dist-vue/_chunks/{index.es-BT6Jr2yi.js → index.es-BKxzs6Sh.js} +2 -2
- package/dist-vue/_chunks/{index.es-BT6Jr2yi.js.map → index.es-BKxzs6Sh.js.map} +1 -1
- package/dist-vue/index.js +10 -10
- package/package.json +2 -2
- package/dist/_chunks/PkLazyImg-_389yCnQ.js +0 -34
- package/dist/_chunks/PkToolRequestGeolocation-T16QI-Uv.js +0 -69
- package/dist/_chunks/PkToolShowArtifact-D15GjBm6.js +0 -93
- package/dist/_chunks/PkToolShowComparison-Bp2rP2Hx.js +0 -66
- package/dist/_chunks/PkToolShowForm-ztQFyFd9.js +0 -365
- package/dist/_chunks/PkToolShowImageGallery-DiOR0vYa.js +0 -74
- package/dist/_chunks/PkToolShowMessage-BysjJ1oS.js +0 -77
- package/dist/_chunks/PkToolShowWebPages-CPNgXzrS.js +0 -78
- package/dist/_chunks/VvCombobox.es-CfRJtWOd.js +0 -2044
- package/dist/_chunks/VvTextarea.es-CAzFW944.js +0 -1166
- package/dist/_chunks/index.es-DvV0VhDa.js +0 -9832
- package/dist/_chunks/index.es-DvV0VhDa.js.map +0 -1
- package/dist/_chunks/useImageFallback-8kfLDjXm.js +0 -19
- package/dist/_chunks/useShortUrlResolver-BTJM8XRw.js +0 -72
- package/dist/_chunks/vue.runtime.esm-bundler-DF2of3lp.js +0 -5007
- package/dist/_chunks/vue.runtime.esm-bundler-DF2of3lp.js.map +0 -1
package/dist/_chunks/{PkToolShowCalendarEvent-D_GjXl2_.js → PkToolShowCalendarEvent-DyiNmqqo.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as g } from "./vue-i18n-
|
|
3
|
-
import "./src-
|
|
1
|
+
import { $ as e, C as t, Ct as n, L as r, O as i, T as a, Tt as o, _ as s, b as c, bt as l, h as u, it as d, m as f, v as p, x as m, xt as h } from "./vue.runtime.esm-bundler-B3bThTaf.js";
|
|
2
|
+
import { r as g } from "./vue-i18n-t25g63Be.js";
|
|
3
|
+
import "./src-CIEdKLKO.js";
|
|
4
4
|
import { n as _ } from "./url-validation-uLMZ5-AU.js";
|
|
5
|
-
import { i as v } from "./dist-
|
|
6
|
-
import { a as y,
|
|
7
|
-
|
|
5
|
+
import { i as v } from "./dist-C5Y-NI3i.js";
|
|
6
|
+
import { a as y, i as b, o as x, p as S, t as C } from "./index.es-gbmOq0Nu.js";
|
|
7
|
+
i(), h(), d();
|
|
8
8
|
var w = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-surface"
|
|
@@ -18,16 +18,16 @@ var w = {
|
|
|
18
18
|
], L = { key: 1 }, R = {
|
|
19
19
|
key: 1,
|
|
20
20
|
class: "flex items-start gap-8 text-12 text-word-3"
|
|
21
|
-
}, z = /* @__PURE__ */
|
|
21
|
+
}, z = /* @__PURE__ */ t({
|
|
22
22
|
__name: "PkToolShowCalendarEvent",
|
|
23
23
|
props: { part: { type: null } },
|
|
24
|
-
setup(
|
|
25
|
-
let
|
|
24
|
+
setup(t) {
|
|
25
|
+
let i = t, { copy: d, copied: h } = v(), { d: z } = g(), B = f(() => i.part), V = f(() => {
|
|
26
26
|
let e = B.value.input;
|
|
27
27
|
if (!e) return "";
|
|
28
28
|
let { startDate: t, endDate: n, allDay: r } = e, i = new Date(t), a = new Date(n), o = t.slice(0, 10), s = n.slice(0, 10);
|
|
29
29
|
return r ? o === s ? z(i, "date-medium") : `${z(i, "date-medium")} - ${z(a, "date-medium")}` : o === s ? `${z(i, "date-time-medium")} - ${z(a, "time")}` : `${z(i, "date-time-medium")} - ${z(a, "date-time-medium")}`;
|
|
30
|
-
}), H =
|
|
30
|
+
}), H = f(() => B.value.input ? new Date(B.value.input.startDate) : null), U = f(() => H.value?.getDate().toString() ?? ""), W = f(() => H.value ? z(H.value, "month-short") : ""), G = (e) => e.replace(/[-:]/g, "").replace(/\.\d{3}$/, ""), K = (e) => e.replace(/\\/g, "\\\\").replace(/;/g, "\\;").replace(/,/g, "\\,").replace(/\n/g, "\\n"), q = () => {
|
|
31
31
|
let e = B.value.input;
|
|
32
32
|
if (!e) return;
|
|
33
33
|
let { title: t, startDate: n, endDate: r, location: i, additionalInfo: a } = e, o = [
|
|
@@ -68,80 +68,80 @@ var w = {
|
|
|
68
68
|
let e = B.value.input;
|
|
69
69
|
if (!e) return;
|
|
70
70
|
let t = [e.title, V.value];
|
|
71
|
-
e.location && t.push(e.location), e.additionalInfo && t.push(e.additionalInfo),
|
|
71
|
+
e.location && t.push(e.location), e.additionalInfo && t.push(e.additionalInfo), d(t.join("\n"));
|
|
72
72
|
};
|
|
73
|
-
return (
|
|
74
|
-
let
|
|
75
|
-
return B.value?.input ? (
|
|
76
|
-
|
|
73
|
+
return (t, i) => {
|
|
74
|
+
let d = S, f = x, g = C, v = y, z = b;
|
|
75
|
+
return B.value?.input ? (r(), p("div", w, [u("div", T, [
|
|
76
|
+
m(d, {
|
|
77
77
|
name: "ri:calendar-event-line",
|
|
78
78
|
class: "text-16"
|
|
79
79
|
}),
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
u("strong", E, o(t.$t("label.calendarEvent")), 1),
|
|
81
|
+
m(z, {
|
|
82
82
|
modifiers: "compact",
|
|
83
83
|
class: "ml-auto shrink-0"
|
|
84
84
|
}, {
|
|
85
|
-
default:
|
|
85
|
+
default: e(() => [m(f, {
|
|
86
86
|
modifiers: "action-quiet-small",
|
|
87
|
-
icon:
|
|
88
|
-
label:
|
|
87
|
+
icon: l(h) ? "ri:check-line" : "ri:file-copy-line",
|
|
88
|
+
label: l(h) ? t.$t("action.copied") : t.$t("action.copy"),
|
|
89
89
|
onClick: X
|
|
90
|
-
}, null, 8, ["icon", "label"]),
|
|
90
|
+
}, null, 8, ["icon", "label"]), m(v, n(a({
|
|
91
91
|
placement: "bottom-end",
|
|
92
92
|
modifiers: "menu",
|
|
93
93
|
flip: !0,
|
|
94
94
|
offset: 3,
|
|
95
95
|
strategy: "fixed"
|
|
96
96
|
})), {
|
|
97
|
-
items:
|
|
98
|
-
|
|
99
|
-
default:
|
|
97
|
+
items: e(() => [
|
|
98
|
+
m(g, { onClick: J }, {
|
|
99
|
+
default: e(() => [m(d, { name: "ri:google-line" }), i[0] ||= c(" Google Calendar ", -1)]),
|
|
100
100
|
_: 1
|
|
101
101
|
}),
|
|
102
|
-
|
|
103
|
-
default:
|
|
102
|
+
m(g, { onClick: Y }, {
|
|
103
|
+
default: e(() => [m(d, { name: "ri:microsoft-line" }), i[1] ||= c(" Outlook ", -1)]),
|
|
104
104
|
_: 1
|
|
105
105
|
}),
|
|
106
|
-
|
|
107
|
-
default:
|
|
106
|
+
m(g, { onClick: q }, {
|
|
107
|
+
default: e(() => [m(d, { name: "ri:download-line" }), c(" " + o(t.$t("action.downloadIcs")), 1)]),
|
|
108
108
|
_: 1
|
|
109
109
|
})
|
|
110
110
|
]),
|
|
111
|
-
default:
|
|
111
|
+
default: e(() => [m(f, {
|
|
112
112
|
icon: "ri:calendar-line",
|
|
113
113
|
modifiers: "action-quiet-small",
|
|
114
|
-
label:
|
|
114
|
+
label: t.$t("action.addToCalendar")
|
|
115
115
|
}, null, 8, ["label"])]),
|
|
116
116
|
_: 1
|
|
117
117
|
}, 16)]),
|
|
118
118
|
_: 1
|
|
119
119
|
})
|
|
120
|
-
]),
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
]), u("div", D, [u("div", O, [u("div", k, o(W.value), 1), u("div", A, o(U.value), 1)]), u("div", j, [
|
|
121
|
+
u("p", M, o(B.value.input.title), 1),
|
|
122
|
+
u("div", N, [m(d, {
|
|
123
123
|
name: "ri:time-line",
|
|
124
124
|
class: "text-14 shrink-0"
|
|
125
|
-
}),
|
|
126
|
-
B.value.input.location ? (
|
|
125
|
+
}), u("time", { datetime: B.value.input.startDate }, o(V.value), 9, P)]),
|
|
126
|
+
B.value.input.location ? (r(), p("div", F, [m(d, {
|
|
127
127
|
name: "ri:map-pin-line",
|
|
128
128
|
class: "text-14 shrink-0"
|
|
129
|
-
}), B.value.input.location.startsWith("http") ? (
|
|
129
|
+
}), B.value.input.location.startsWith("http") ? (r(), p("a", {
|
|
130
130
|
key: 0,
|
|
131
131
|
href: B.value.input.location,
|
|
132
|
-
target:
|
|
133
|
-
rel:
|
|
132
|
+
target: l(_)(B.value.input.location) ? void 0 : "_blank",
|
|
133
|
+
rel: l(_)(B.value.input.location) ? void 0 : "noopener noreferrer",
|
|
134
134
|
class: "underline truncate"
|
|
135
|
-
},
|
|
136
|
-
B.value.input.additionalInfo ? (
|
|
135
|
+
}, o(B.value.input.location), 9, I)) : (r(), p("span", L, o(B.value.input.location), 1))])) : s("", !0),
|
|
136
|
+
B.value.input.additionalInfo ? (r(), p("div", R, [m(d, {
|
|
137
137
|
name: "ri:sticky-note-line",
|
|
138
138
|
class: "text-14 shrink-0 mt-1"
|
|
139
|
-
}),
|
|
140
|
-
])])])) :
|
|
139
|
+
}), u("span", null, o(B.value.input.additionalInfo), 1)])) : s("", !0)
|
|
140
|
+
])])])) : s("", !0);
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
//#endregion
|
|
145
145
|
export { z as default };
|
|
146
146
|
|
|
147
|
-
//# sourceMappingURL=PkToolShowCalendarEvent-
|
|
147
|
+
//# sourceMappingURL=PkToolShowCalendarEvent-DyiNmqqo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkToolShowCalendarEvent-D_GjXl2_.js","names":["$t"],"sources":["../../../../packages/components/src/chat/PkToolShowCalendarEvent.vue","../../../../packages/components/src/chat/PkToolShowCalendarEvent.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { useClipboard } from '@vueuse/core'\n import { isSameSite } from 'utils'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n const { d } = useI18n()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n title: string\n startDate: string\n endDate: string\n location?: string\n additionalInfo?: string\n allDay?: boolean\n }\n }\n return part\n })\n\n const dateDisplay = computed(() => {\n const input = toolPart.value.input\n if (!input) {\n return ''\n }\n const { startDate, endDate, allDay } = input\n const start = new Date(startDate)\n const end = new Date(endDate)\n const startDay = startDate.slice(0, 10)\n const endDay = endDate.slice(0, 10)\n if (allDay) {\n if (startDay === endDay) {\n return d(start, 'date-medium')\n }\n return `${d(start, 'date-medium')} - ${d(end, 'date-medium')}`\n }\n if (startDay === endDay) {\n return `${d(start, 'date-time-medium')} - ${d(end, 'time')}`\n }\n return `${d(start, 'date-time-medium')} - ${d(end, 'date-time-medium')}`\n })\n\n const calendarStart = computed(() =>\n toolPart.value.input ? new Date(toolPart.value.input.startDate) : null,\n )\n\n const calendarDay = computed(\n () => calendarStart.value?.getDate().toString() ?? '',\n )\n\n const calendarMonth = computed(() =>\n calendarStart.value ? d(calendarStart.value, 'month-short') : '',\n )\n\n // Floating time: remove dashes/colons without converting to UTC\n const toIcsDateTime = (iso: string) =>\n iso.replace(/[-:]/g, '').replace(/\\.\\d{3}$/, '')\n\n const escapeIcs = (str: string) =>\n str\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/;/g, '\\\\;')\n .replace(/,/g, '\\\\,')\n .replace(/\\n/g, '\\\\n')\n\n const generateIcs = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const { title, startDate, endDate, location, additionalInfo } = input\n const ics = [\n 'BEGIN:VCALENDAR',\n 'VERSION:2.0',\n 'PRODID:-//8wave//8bot//EN',\n 'BEGIN:VEVENT',\n `DTSTART:${toIcsDateTime(startDate)}`,\n `DTEND:${toIcsDateTime(endDate)}`,\n `SUMMARY:${escapeIcs(title)}`,\n location ? `LOCATION:${escapeIcs(location)}` : '',\n additionalInfo ? `DESCRIPTION:${escapeIcs(additionalInfo)}` : '',\n `DTSTAMP:${new Date()\n .toISOString()\n .replace(/[-:]/g, '')\n .replace(/\\.\\d{3}/, '')}`,\n `UID:${crypto.randomUUID()}@8bot.ai`,\n 'END:VEVENT',\n 'END:VCALENDAR',\n ]\n .filter(Boolean)\n .join('\\r\\n')\n\n const blob = new Blob([ics], { type: 'text/calendar;charset=utf-8' })\n const url = URL.createObjectURL(blob)\n const a = document.createElement('a')\n a.href = url\n a.download = `${title.replace(/[^a-zA-Z0-9\\s-]/g, '')}.ics`\n a.click()\n URL.revokeObjectURL(url)\n }\n\n const openGoogleCalendar = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const { title, startDate, endDate, location, additionalInfo } = input\n const start = toIcsDateTime(startDate)\n const end = toIcsDateTime(endDate)\n const params = new URLSearchParams({\n action: 'TEMPLATE',\n text: title,\n dates: `${start}/${end}`,\n })\n if (location) {\n params.set('location', location)\n }\n if (additionalInfo) {\n params.set('details', additionalInfo)\n }\n window.open(\n `https://calendar.google.com/calendar/render?${params.toString()}`,\n '_blank',\n )\n }\n\n const openOutlook = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const { title, startDate, endDate, location, additionalInfo } = input\n const params = new URLSearchParams({\n subject: title,\n startdt: startDate,\n enddt: endDate,\n })\n if (location) {\n params.set('location', location)\n }\n if (additionalInfo) {\n params.set('body', additionalInfo)\n }\n window.open(\n `https://outlook.office.com/calendar/0/action/compose?${params.toString()}`,\n '_blank',\n )\n }\n\n const copyEvent = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const lines = [input.title, dateDisplay.value]\n if (input.location) {\n lines.push(input.location)\n }\n if (input.additionalInfo) {\n lines.push(input.additionalInfo)\n }\n copy(lines.join('\\n'))\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:calendar-event-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.calendarEvent') }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copyEvent\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:calendar-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.addToCalendar')\" />\n <template #items>\n <VvDropdownAction @click=\"openGoogleCalendar\">\n <VvIcon name=\"ri:google-line\" />\n Google Calendar\n </VvDropdownAction>\n <VvDropdownAction @click=\"openOutlook\">\n <VvIcon name=\"ri:microsoft-line\" />\n Outlook\n </VvDropdownAction>\n <VvDropdownAction @click=\"generateIcs\">\n <VvIcon name=\"ri:download-line\" />\n {{ $t('action.downloadIcs') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"p-sm flex gap-sm items-start\">\n <div\n class=\"shrink-0 w-44 rounded-xl overflow-hidden border border-surface-3 text-center select-none\">\n <div\n class=\"bg-brand px-8 py-2 text-white text-10 font-bold uppercase tracking-wide\">\n {{ calendarMonth }}\n </div>\n <div\n class=\"bg-surface-1 py-4 text-word-1 text-24 font-bold leading-none\">\n {{ calendarDay }}\n </div>\n </div>\n <div class=\"flex flex-col gap-4 min-w-0\">\n <p class=\"font-semibold text-word-1 text-14\">\n {{ toolPart.input.title }}\n </p>\n <div class=\"flex items-center gap-8 text-12 text-word-3\">\n <VvIcon name=\"ri:time-line\" class=\"text-14 shrink-0\" />\n <time :datetime=\"toolPart.input.startDate\">{{\n dateDisplay\n }}</time>\n </div>\n <div\n v-if=\"toolPart.input.location\"\n class=\"flex items-center gap-8 text-12 text-word-3\">\n <VvIcon name=\"ri:map-pin-line\" class=\"text-14 shrink-0\" />\n <a\n v-if=\"toolPart.input.location.startsWith('http')\"\n :href=\"toolPart.input.location\"\n :target=\"\n isSameSite(toolPart.input.location)\n ? undefined\n : '_blank'\n \"\n :rel=\"\n isSameSite(toolPart.input.location)\n ? undefined\n : 'noopener noreferrer'\n \"\n class=\"underline truncate\">\n {{ toolPart.input.location }}\n </a>\n <span v-else>{{ toolPart.input.location }}</span>\n </div>\n <div\n v-if=\"toolPart.input.additionalInfo\"\n class=\"flex items-start gap-8 text-12 text-word-3\">\n <VvIcon\n name=\"ri:sticky-note-line\"\n class=\"text-14 shrink-0 mt-1\" />\n <span>{{ toolPart.input.additionalInfo }}</span>\n </div>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { useClipboard } from '@vueuse/core'\n import { isSameSite } from 'utils'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n const { d } = useI18n()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n title: string\n startDate: string\n endDate: string\n location?: string\n additionalInfo?: string\n allDay?: boolean\n }\n }\n return part\n })\n\n const dateDisplay = computed(() => {\n const input = toolPart.value.input\n if (!input) {\n return ''\n }\n const { startDate, endDate, allDay } = input\n const start = new Date(startDate)\n const end = new Date(endDate)\n const startDay = startDate.slice(0, 10)\n const endDay = endDate.slice(0, 10)\n if (allDay) {\n if (startDay === endDay) {\n return d(start, 'date-medium')\n }\n return `${d(start, 'date-medium')} - ${d(end, 'date-medium')}`\n }\n if (startDay === endDay) {\n return `${d(start, 'date-time-medium')} - ${d(end, 'time')}`\n }\n return `${d(start, 'date-time-medium')} - ${d(end, 'date-time-medium')}`\n })\n\n const calendarStart = computed(() =>\n toolPart.value.input ? new Date(toolPart.value.input.startDate) : null,\n )\n\n const calendarDay = computed(\n () => calendarStart.value?.getDate().toString() ?? '',\n )\n\n const calendarMonth = computed(() =>\n calendarStart.value ? d(calendarStart.value, 'month-short') : '',\n )\n\n // Floating time: remove dashes/colons without converting to UTC\n const toIcsDateTime = (iso: string) =>\n iso.replace(/[-:]/g, '').replace(/\\.\\d{3}$/, '')\n\n const escapeIcs = (str: string) =>\n str\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/;/g, '\\\\;')\n .replace(/,/g, '\\\\,')\n .replace(/\\n/g, '\\\\n')\n\n const generateIcs = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const { title, startDate, endDate, location, additionalInfo } = input\n const ics = [\n 'BEGIN:VCALENDAR',\n 'VERSION:2.0',\n 'PRODID:-//8wave//8bot//EN',\n 'BEGIN:VEVENT',\n `DTSTART:${toIcsDateTime(startDate)}`,\n `DTEND:${toIcsDateTime(endDate)}`,\n `SUMMARY:${escapeIcs(title)}`,\n location ? `LOCATION:${escapeIcs(location)}` : '',\n additionalInfo ? `DESCRIPTION:${escapeIcs(additionalInfo)}` : '',\n `DTSTAMP:${new Date()\n .toISOString()\n .replace(/[-:]/g, '')\n .replace(/\\.\\d{3}/, '')}`,\n `UID:${crypto.randomUUID()}@8bot.ai`,\n 'END:VEVENT',\n 'END:VCALENDAR',\n ]\n .filter(Boolean)\n .join('\\r\\n')\n\n const blob = new Blob([ics], { type: 'text/calendar;charset=utf-8' })\n const url = URL.createObjectURL(blob)\n const a = document.createElement('a')\n a.href = url\n a.download = `${title.replace(/[^a-zA-Z0-9\\s-]/g, '')}.ics`\n a.click()\n URL.revokeObjectURL(url)\n }\n\n const openGoogleCalendar = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const { title, startDate, endDate, location, additionalInfo } = input\n const start = toIcsDateTime(startDate)\n const end = toIcsDateTime(endDate)\n const params = new URLSearchParams({\n action: 'TEMPLATE',\n text: title,\n dates: `${start}/${end}`,\n })\n if (location) {\n params.set('location', location)\n }\n if (additionalInfo) {\n params.set('details', additionalInfo)\n }\n window.open(\n `https://calendar.google.com/calendar/render?${params.toString()}`,\n '_blank',\n )\n }\n\n const openOutlook = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const { title, startDate, endDate, location, additionalInfo } = input\n const params = new URLSearchParams({\n subject: title,\n startdt: startDate,\n enddt: endDate,\n })\n if (location) {\n params.set('location', location)\n }\n if (additionalInfo) {\n params.set('body', additionalInfo)\n }\n window.open(\n `https://outlook.office.com/calendar/0/action/compose?${params.toString()}`,\n '_blank',\n )\n }\n\n const copyEvent = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const lines = [input.title, dateDisplay.value]\n if (input.location) {\n lines.push(input.location)\n }\n if (input.additionalInfo) {\n lines.push(input.additionalInfo)\n }\n copy(lines.join('\\n'))\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:calendar-event-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.calendarEvent') }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copyEvent\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:calendar-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.addToCalendar')\" />\n <template #items>\n <VvDropdownAction @click=\"openGoogleCalendar\">\n <VvIcon name=\"ri:google-line\" />\n Google Calendar\n </VvDropdownAction>\n <VvDropdownAction @click=\"openOutlook\">\n <VvIcon name=\"ri:microsoft-line\" />\n Outlook\n </VvDropdownAction>\n <VvDropdownAction @click=\"generateIcs\">\n <VvIcon name=\"ri:download-line\" />\n {{ $t('action.downloadIcs') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"p-sm flex gap-sm items-start\">\n <div\n class=\"shrink-0 w-44 rounded-xl overflow-hidden border border-surface-3 text-center select-none\">\n <div\n class=\"bg-brand px-8 py-2 text-white text-10 font-bold uppercase tracking-wide\">\n {{ calendarMonth }}\n </div>\n <div\n class=\"bg-surface-1 py-4 text-word-1 text-24 font-bold leading-none\">\n {{ calendarDay }}\n </div>\n </div>\n <div class=\"flex flex-col gap-4 min-w-0\">\n <p class=\"font-semibold text-word-1 text-14\">\n {{ toolPart.input.title }}\n </p>\n <div class=\"flex items-center gap-8 text-12 text-word-3\">\n <VvIcon name=\"ri:time-line\" class=\"text-14 shrink-0\" />\n <time :datetime=\"toolPart.input.startDate\">{{\n dateDisplay\n }}</time>\n </div>\n <div\n v-if=\"toolPart.input.location\"\n class=\"flex items-center gap-8 text-12 text-word-3\">\n <VvIcon name=\"ri:map-pin-line\" class=\"text-14 shrink-0\" />\n <a\n v-if=\"toolPart.input.location.startsWith('http')\"\n :href=\"toolPart.input.location\"\n :target=\"\n isSameSite(toolPart.input.location)\n ? undefined\n : '_blank'\n \"\n :rel=\"\n isSameSite(toolPart.input.location)\n ? undefined\n : 'noopener noreferrer'\n \"\n class=\"underline truncate\">\n {{ toolPart.input.location }}\n </a>\n <span v-else>{{ toolPart.input.location }}</span>\n </div>\n <div\n v-if=\"toolPart.input.additionalInfo\"\n class=\"flex items-start gap-8 text-12 text-word-3\">\n <VvIcon\n name=\"ri:sticky-note-line\"\n class=\"text-14 shrink-0 mt-1\" />\n <span>{{ toolPart.input.additionalInfo }}</span>\n </div>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAMI,IAAM,IAAQ,GAIR,EAAE,SAAM,cAAW,EAAa,GAChC,EAAE,SAAM,EAAQ,GAEhB,IAAW,QACA,EAAM,IAWtB,GAEK,IAAc,QAAe;GAC/B,IAAM,IAAQ,EAAS,MAAM;GAC7B,IAAI,CAAC,GACD,OAAO;GAEX,IAAM,EAAE,cAAW,YAAS,cAAW,GACjC,IAAQ,IAAI,KAAK,CAAS,GAC1B,IAAM,IAAI,KAAK,CAAO,GACtB,IAAW,EAAU,MAAM,GAAG,EAAE,GAChC,IAAS,EAAQ,MAAM,GAA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"}
|
|
1
|
+
{"version":3,"file":"PkToolShowCalendarEvent-DyiNmqqo.js","names":["$t"],"sources":["../../../../packages/components/src/chat/PkToolShowCalendarEvent.vue","../../../../packages/components/src/chat/PkToolShowCalendarEvent.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { useClipboard } from '@vueuse/core'\n import { isSameSite } from 'utils'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n const { d } = useI18n()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n title: string\n startDate: string\n endDate: string\n location?: string\n additionalInfo?: string\n allDay?: boolean\n }\n }\n return part\n })\n\n const dateDisplay = computed(() => {\n const input = toolPart.value.input\n if (!input) {\n return ''\n }\n const { startDate, endDate, allDay } = input\n const start = new Date(startDate)\n const end = new Date(endDate)\n const startDay = startDate.slice(0, 10)\n const endDay = endDate.slice(0, 10)\n if (allDay) {\n if (startDay === endDay) {\n return d(start, 'date-medium')\n }\n return `${d(start, 'date-medium')} - ${d(end, 'date-medium')}`\n }\n if (startDay === endDay) {\n return `${d(start, 'date-time-medium')} - ${d(end, 'time')}`\n }\n return `${d(start, 'date-time-medium')} - ${d(end, 'date-time-medium')}`\n })\n\n const calendarStart = computed(() =>\n toolPart.value.input ? new Date(toolPart.value.input.startDate) : null,\n )\n\n const calendarDay = computed(\n () => calendarStart.value?.getDate().toString() ?? '',\n )\n\n const calendarMonth = computed(() =>\n calendarStart.value ? d(calendarStart.value, 'month-short') : '',\n )\n\n // Floating time: remove dashes/colons without converting to UTC\n const toIcsDateTime = (iso: string) =>\n iso.replace(/[-:]/g, '').replace(/\\.\\d{3}$/, '')\n\n const escapeIcs = (str: string) =>\n str\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/;/g, '\\\\;')\n .replace(/,/g, '\\\\,')\n .replace(/\\n/g, '\\\\n')\n\n const generateIcs = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const { title, startDate, endDate, location, additionalInfo } = input\n const ics = [\n 'BEGIN:VCALENDAR',\n 'VERSION:2.0',\n 'PRODID:-//8wave//8bot//EN',\n 'BEGIN:VEVENT',\n `DTSTART:${toIcsDateTime(startDate)}`,\n `DTEND:${toIcsDateTime(endDate)}`,\n `SUMMARY:${escapeIcs(title)}`,\n location ? `LOCATION:${escapeIcs(location)}` : '',\n additionalInfo ? `DESCRIPTION:${escapeIcs(additionalInfo)}` : '',\n `DTSTAMP:${new Date()\n .toISOString()\n .replace(/[-:]/g, '')\n .replace(/\\.\\d{3}/, '')}`,\n `UID:${crypto.randomUUID()}@8bot.ai`,\n 'END:VEVENT',\n 'END:VCALENDAR',\n ]\n .filter(Boolean)\n .join('\\r\\n')\n\n const blob = new Blob([ics], { type: 'text/calendar;charset=utf-8' })\n const url = URL.createObjectURL(blob)\n const a = document.createElement('a')\n a.href = url\n a.download = `${title.replace(/[^a-zA-Z0-9\\s-]/g, '')}.ics`\n a.click()\n URL.revokeObjectURL(url)\n }\n\n const openGoogleCalendar = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const { title, startDate, endDate, location, additionalInfo } = input\n const start = toIcsDateTime(startDate)\n const end = toIcsDateTime(endDate)\n const params = new URLSearchParams({\n action: 'TEMPLATE',\n text: title,\n dates: `${start}/${end}`,\n })\n if (location) {\n params.set('location', location)\n }\n if (additionalInfo) {\n params.set('details', additionalInfo)\n }\n window.open(\n `https://calendar.google.com/calendar/render?${params.toString()}`,\n '_blank',\n )\n }\n\n const openOutlook = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const { title, startDate, endDate, location, additionalInfo } = input\n const params = new URLSearchParams({\n subject: title,\n startdt: startDate,\n enddt: endDate,\n })\n if (location) {\n params.set('location', location)\n }\n if (additionalInfo) {\n params.set('body', additionalInfo)\n }\n window.open(\n `https://outlook.office.com/calendar/0/action/compose?${params.toString()}`,\n '_blank',\n )\n }\n\n const copyEvent = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const lines = [input.title, dateDisplay.value]\n if (input.location) {\n lines.push(input.location)\n }\n if (input.additionalInfo) {\n lines.push(input.additionalInfo)\n }\n copy(lines.join('\\n'))\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:calendar-event-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.calendarEvent') }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copyEvent\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:calendar-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.addToCalendar')\" />\n <template #items>\n <VvDropdownAction @click=\"openGoogleCalendar\">\n <VvIcon name=\"ri:google-line\" />\n Google Calendar\n </VvDropdownAction>\n <VvDropdownAction @click=\"openOutlook\">\n <VvIcon name=\"ri:microsoft-line\" />\n Outlook\n </VvDropdownAction>\n <VvDropdownAction @click=\"generateIcs\">\n <VvIcon name=\"ri:download-line\" />\n {{ $t('action.downloadIcs') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"p-sm flex gap-sm items-start\">\n <div\n class=\"shrink-0 w-44 rounded-xl overflow-hidden border border-surface-3 text-center select-none\">\n <div\n class=\"bg-brand px-8 py-2 text-white text-10 font-bold uppercase tracking-wide\">\n {{ calendarMonth }}\n </div>\n <div\n class=\"bg-surface-1 py-4 text-word-1 text-24 font-bold leading-none\">\n {{ calendarDay }}\n </div>\n </div>\n <div class=\"flex flex-col gap-4 min-w-0\">\n <p class=\"font-semibold text-word-1 text-14\">\n {{ toolPart.input.title }}\n </p>\n <div class=\"flex items-center gap-8 text-12 text-word-3\">\n <VvIcon name=\"ri:time-line\" class=\"text-14 shrink-0\" />\n <time :datetime=\"toolPart.input.startDate\">{{\n dateDisplay\n }}</time>\n </div>\n <div\n v-if=\"toolPart.input.location\"\n class=\"flex items-center gap-8 text-12 text-word-3\">\n <VvIcon name=\"ri:map-pin-line\" class=\"text-14 shrink-0\" />\n <a\n v-if=\"toolPart.input.location.startsWith('http')\"\n :href=\"toolPart.input.location\"\n :target=\"\n isSameSite(toolPart.input.location)\n ? undefined\n : '_blank'\n \"\n :rel=\"\n isSameSite(toolPart.input.location)\n ? undefined\n : 'noopener noreferrer'\n \"\n class=\"underline truncate\">\n {{ toolPart.input.location }}\n </a>\n <span v-else>{{ toolPart.input.location }}</span>\n </div>\n <div\n v-if=\"toolPart.input.additionalInfo\"\n class=\"flex items-start gap-8 text-12 text-word-3\">\n <VvIcon\n name=\"ri:sticky-note-line\"\n class=\"text-14 shrink-0 mt-1\" />\n <span>{{ toolPart.input.additionalInfo }}</span>\n </div>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { useClipboard } from '@vueuse/core'\n import { isSameSite } from 'utils'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n const { d } = useI18n()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n title: string\n startDate: string\n endDate: string\n location?: string\n additionalInfo?: string\n allDay?: boolean\n }\n }\n return part\n })\n\n const dateDisplay = computed(() => {\n const input = toolPart.value.input\n if (!input) {\n return ''\n }\n const { startDate, endDate, allDay } = input\n const start = new Date(startDate)\n const end = new Date(endDate)\n const startDay = startDate.slice(0, 10)\n const endDay = endDate.slice(0, 10)\n if (allDay) {\n if (startDay === endDay) {\n return d(start, 'date-medium')\n }\n return `${d(start, 'date-medium')} - ${d(end, 'date-medium')}`\n }\n if (startDay === endDay) {\n return `${d(start, 'date-time-medium')} - ${d(end, 'time')}`\n }\n return `${d(start, 'date-time-medium')} - ${d(end, 'date-time-medium')}`\n })\n\n const calendarStart = computed(() =>\n toolPart.value.input ? new Date(toolPart.value.input.startDate) : null,\n )\n\n const calendarDay = computed(\n () => calendarStart.value?.getDate().toString() ?? '',\n )\n\n const calendarMonth = computed(() =>\n calendarStart.value ? d(calendarStart.value, 'month-short') : '',\n )\n\n // Floating time: remove dashes/colons without converting to UTC\n const toIcsDateTime = (iso: string) =>\n iso.replace(/[-:]/g, '').replace(/\\.\\d{3}$/, '')\n\n const escapeIcs = (str: string) =>\n str\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/;/g, '\\\\;')\n .replace(/,/g, '\\\\,')\n .replace(/\\n/g, '\\\\n')\n\n const generateIcs = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const { title, startDate, endDate, location, additionalInfo } = input\n const ics = [\n 'BEGIN:VCALENDAR',\n 'VERSION:2.0',\n 'PRODID:-//8wave//8bot//EN',\n 'BEGIN:VEVENT',\n `DTSTART:${toIcsDateTime(startDate)}`,\n `DTEND:${toIcsDateTime(endDate)}`,\n `SUMMARY:${escapeIcs(title)}`,\n location ? `LOCATION:${escapeIcs(location)}` : '',\n additionalInfo ? `DESCRIPTION:${escapeIcs(additionalInfo)}` : '',\n `DTSTAMP:${new Date()\n .toISOString()\n .replace(/[-:]/g, '')\n .replace(/\\.\\d{3}/, '')}`,\n `UID:${crypto.randomUUID()}@8bot.ai`,\n 'END:VEVENT',\n 'END:VCALENDAR',\n ]\n .filter(Boolean)\n .join('\\r\\n')\n\n const blob = new Blob([ics], { type: 'text/calendar;charset=utf-8' })\n const url = URL.createObjectURL(blob)\n const a = document.createElement('a')\n a.href = url\n a.download = `${title.replace(/[^a-zA-Z0-9\\s-]/g, '')}.ics`\n a.click()\n URL.revokeObjectURL(url)\n }\n\n const openGoogleCalendar = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const { title, startDate, endDate, location, additionalInfo } = input\n const start = toIcsDateTime(startDate)\n const end = toIcsDateTime(endDate)\n const params = new URLSearchParams({\n action: 'TEMPLATE',\n text: title,\n dates: `${start}/${end}`,\n })\n if (location) {\n params.set('location', location)\n }\n if (additionalInfo) {\n params.set('details', additionalInfo)\n }\n window.open(\n `https://calendar.google.com/calendar/render?${params.toString()}`,\n '_blank',\n )\n }\n\n const openOutlook = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const { title, startDate, endDate, location, additionalInfo } = input\n const params = new URLSearchParams({\n subject: title,\n startdt: startDate,\n enddt: endDate,\n })\n if (location) {\n params.set('location', location)\n }\n if (additionalInfo) {\n params.set('body', additionalInfo)\n }\n window.open(\n `https://outlook.office.com/calendar/0/action/compose?${params.toString()}`,\n '_blank',\n )\n }\n\n const copyEvent = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n const lines = [input.title, dateDisplay.value]\n if (input.location) {\n lines.push(input.location)\n }\n if (input.additionalInfo) {\n lines.push(input.additionalInfo)\n }\n copy(lines.join('\\n'))\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:calendar-event-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.calendarEvent') }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copyEvent\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:calendar-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.addToCalendar')\" />\n <template #items>\n <VvDropdownAction @click=\"openGoogleCalendar\">\n <VvIcon name=\"ri:google-line\" />\n Google Calendar\n </VvDropdownAction>\n <VvDropdownAction @click=\"openOutlook\">\n <VvIcon name=\"ri:microsoft-line\" />\n Outlook\n </VvDropdownAction>\n <VvDropdownAction @click=\"generateIcs\">\n <VvIcon name=\"ri:download-line\" />\n {{ $t('action.downloadIcs') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"p-sm flex gap-sm items-start\">\n <div\n class=\"shrink-0 w-44 rounded-xl overflow-hidden border border-surface-3 text-center select-none\">\n <div\n class=\"bg-brand px-8 py-2 text-white text-10 font-bold uppercase tracking-wide\">\n {{ calendarMonth }}\n </div>\n <div\n class=\"bg-surface-1 py-4 text-word-1 text-24 font-bold leading-none\">\n {{ calendarDay }}\n </div>\n </div>\n <div class=\"flex flex-col gap-4 min-w-0\">\n <p class=\"font-semibold text-word-1 text-14\">\n {{ toolPart.input.title }}\n </p>\n <div class=\"flex items-center gap-8 text-12 text-word-3\">\n <VvIcon name=\"ri:time-line\" class=\"text-14 shrink-0\" />\n <time :datetime=\"toolPart.input.startDate\">{{\n dateDisplay\n }}</time>\n </div>\n <div\n v-if=\"toolPart.input.location\"\n class=\"flex items-center gap-8 text-12 text-word-3\">\n <VvIcon name=\"ri:map-pin-line\" class=\"text-14 shrink-0\" />\n <a\n v-if=\"toolPart.input.location.startsWith('http')\"\n :href=\"toolPart.input.location\"\n :target=\"\n isSameSite(toolPart.input.location)\n ? undefined\n : '_blank'\n \"\n :rel=\"\n isSameSite(toolPart.input.location)\n ? undefined\n : 'noopener noreferrer'\n \"\n class=\"underline truncate\">\n {{ toolPart.input.location }}\n </a>\n <span v-else>{{ toolPart.input.location }}</span>\n </div>\n <div\n v-if=\"toolPart.input.additionalInfo\"\n class=\"flex items-start gap-8 text-12 text-word-3\">\n <VvIcon\n name=\"ri:sticky-note-line\"\n class=\"text-14 shrink-0 mt-1\" />\n <span>{{ toolPart.input.additionalInfo }}</span>\n </div>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAMI,IAAM,IAAQ,GAIR,EAAE,SAAM,cAAW,EAAa,GAChC,EAAE,SAAM,EAAQ,GAEhB,IAAW,QACA,EAAM,IAWtB,GAEK,IAAc,QAAe;GAC/B,IAAM,IAAQ,EAAS,MAAM;GAC7B,IAAI,CAAC,GACD,OAAO;GAEX,IAAM,EAAE,cAAW,YAAS,cAAW,GACjC,IAAQ,IAAI,KAAK,CAAS,GAC1B,IAAM,IAAI,KAAK,CAAO,GACtB,IAAW,EAAU,MAAM,GAAG,EAAE,GAChC,IAAS,EAAQ,MAAM,GAAG,EAAE;GAUlC,OATI,IACI,MAAa,IACN,EAAE,GAAO,aAAa,IAE1B,GAAG,EAAE,GAAO,aAAa,EAAE,KAAK,EAAE,GAAK,aAAa,MAE3D,MAAa,IACN,GAAG,EAAE,GAAO,kBAAkB,EAAE,KAAK,EAAE,GAAK,MAAM,MAEtD,GAAG,EAAE,GAAO,kBAAkB,EAAE,KAAK,EAAE,GAAK,kBAAkB;EACzE,CAAC,GAEK,IAAgB,QAClB,EAAS,MAAM,QAAQ,IAAI,KAAK,EAAS,MAAM,MAAM,SAAS,IAAI,IACtE,GAEM,IAAc,QACV,EAAc,OAAO,QAAQ,CAAC,CAAC,SAAS,KAAK,EACvD,GAEM,IAAgB,QAClB,EAAc,QAAQ,EAAE,EAAc,OAAO,aAAa,IAAI,EAClE,GAGM,KAAiB,MACnB,EAAI,QAAQ,SAAS,EAAE,CAAC,CAAC,QAAQ,YAAY,EAAE,GAE7C,KAAa,MACf,EACK,QAAQ,OAAO,MAAM,CAAA,CACrB,QAAQ,MAAM,KAAK,CAAA,CACnB,QAAQ,MAAM,KAAK,CAAA,CACnB,QAAQ,OAAO,KAAK,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AS,MAAM,QAAQ,IAAoC,KAAA,IAAA;KAK3G,KAAkC,EAAA,CAAA,CAAU,CAAC,EAAA,MAAS,MAAM,QAAQ,IAAoC,KAAA,IAAA;KAKzG,OAAM;IACH,GAAA,EAAA,EAAA,MAAS,MAAM,QAAQ,GAAA,GAAA,CAAA,MAE9B,EAAA,GAAA,EAAiD,QAAA,GAAA,EAAjC,EAAA,MAAS,MAAM,QAAQ,GAAA,CAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA;IAGjC,EAAA,MAAS,MAAM,kBADzB,EAAA,GAAA,EAOM,OAPN,GAOM,CAJF,EAEoC,GAAA;KADhC,MAAK;KACL,OAAM;IACV,CAAA,GAAA,EAAgD,QAAA,MAAA,EAAvC,EAAA,MAAS,MAAM,cAAc,GAAA,CAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { $ as e, C as t, L as n, O as r, St as i, Tt as a, _ as o, b as s, bt as c, d as l, h as u, it as d, m as f, v as p, x as m, xt as h, z as g } from "./vue.runtime.esm-bundler-B3bThTaf.js";
|
|
2
|
+
import { i as _ } from "./dist-C5Y-NI3i.js";
|
|
3
|
+
import { i as v, o as y, p as b } from "./index.es-gbmOq0Nu.js";
|
|
4
|
+
r(), h(), d();
|
|
5
|
+
var x = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "border border-surface-3 rounded-xl w-full overflow-hidden"
|
|
8
|
+
}, S = { class: "px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8" }, C = { class: "font-bold" }, w = { class: "overflow-x-auto" }, T = { class: "w-full text-12 border-collapse bg-surface" }, E = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "ml-4"
|
|
11
|
+
}, D = /* @__PURE__ */ t({
|
|
12
|
+
__name: "PkToolShowComparison",
|
|
13
|
+
props: { part: { type: null } },
|
|
14
|
+
setup(t) {
|
|
15
|
+
let r = t, { copy: d, copied: h } = _(), D = f(() => r.part), O = f(() => {
|
|
16
|
+
let e = D.value.input?.items;
|
|
17
|
+
return !e || e.length === 0 ? [] : Object.keys(e[0].values);
|
|
18
|
+
}), k = () => {
|
|
19
|
+
let e = D.value.input?.items;
|
|
20
|
+
if (!e) return;
|
|
21
|
+
let t = ["", ...e.map((e) => e.name)].join(" "), n = O.value.map((t) => [t.replace(/_/g, " "), ...e.map((e) => e.values[t] ?? "")].join(" "));
|
|
22
|
+
d([t, ...n].join("\n"));
|
|
23
|
+
};
|
|
24
|
+
return (t, r) => {
|
|
25
|
+
let d = b, f = y, _ = v;
|
|
26
|
+
return D.value?.input?.items?.length ? (n(), p("div", x, [u("div", S, [
|
|
27
|
+
m(d, {
|
|
28
|
+
name: "ri:scales-line",
|
|
29
|
+
class: "text-16"
|
|
30
|
+
}),
|
|
31
|
+
u("strong", C, a(D.value.input.title ?? t.$t("label.comparison")), 1),
|
|
32
|
+
m(_, {
|
|
33
|
+
modifiers: "compact",
|
|
34
|
+
class: "ml-auto shrink-0"
|
|
35
|
+
}, {
|
|
36
|
+
default: e(() => [m(f, {
|
|
37
|
+
modifiers: "action-quiet-small",
|
|
38
|
+
icon: c(h) ? "ri:check-line" : "ri:file-copy-line",
|
|
39
|
+
label: c(h) ? t.$t("action.copied") : t.$t("action.copy"),
|
|
40
|
+
onClick: k
|
|
41
|
+
}, null, 8, ["icon", "label"])]),
|
|
42
|
+
_: 1
|
|
43
|
+
})
|
|
44
|
+
]), u("div", w, [u("table", T, [u("thead", null, [u("tr", null, [r[0] ||= u("th", { class: "text-left text-word-3 font-medium p-8 border-b border-surface-3 min-w-32" }, null, -1), (n(!0), p(l, null, g(D.value.input.items, (e) => (n(), p("th", {
|
|
45
|
+
key: e.name,
|
|
46
|
+
class: i(["text-center font-semibold text-word-1 p-8 border-b border-surface-3 min-w-24", e.highlighted ? "bg-primary/5 border-primary/20" : ""])
|
|
47
|
+
}, [s(a(e.name) + " ", 1), e.highlighted ? (n(), p("span", E, "⭐")) : o("", !0)], 2))), 128))])]), u("tbody", null, [(n(!0), p(l, null, g(O.value, (e, t) => (n(), p("tr", {
|
|
48
|
+
key: e,
|
|
49
|
+
class: i({ "bg-surface-1": t % 2 != 0 })
|
|
50
|
+
}, [u("td", { class: i(["text-word-3 font-medium p-8 whitespace-nowrap", { "border-b border-surface-3": t !== O.value.length - 1 }]) }, a(e.replace(/_/g, " ")), 3), (n(!0), p(l, null, g(D.value.input.items, (r) => (n(), p("td", {
|
|
51
|
+
key: r.name,
|
|
52
|
+
class: i(["text-center p-8", {
|
|
53
|
+
"border-b border-surface-3": t !== O.value.length - 1,
|
|
54
|
+
"bg-surface-info": r.highlighted,
|
|
55
|
+
"text-success": r.values[e] === "✓",
|
|
56
|
+
"text-danger": r.values[e] === "✗",
|
|
57
|
+
"text-word-2": r.values[e] !== "✓" && r.values[e] !== "✗"
|
|
58
|
+
}])
|
|
59
|
+
}, a(r.values[e] ?? "-"), 3))), 128))], 2))), 128))])])])])) : o("", !0);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
//#endregion
|
|
64
|
+
export { D as default };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=PkToolShowComparison-RA72YL7R.js.map
|
package/dist/_chunks/{PkToolShowComparison-Bp2rP2Hx.js.map → PkToolShowComparison-RA72YL7R.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkToolShowComparison-Bp2rP2Hx.js","names":["$t"],"sources":["../../../../packages/components/src/chat/PkToolShowComparison.vue","../../../../packages/components/src/chat/PkToolShowComparison.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n title?: string\n items: Array<{\n name: string\n values: Record<string, string>\n highlighted?: boolean\n }>\n }\n }\n return part\n })\n\n const features = computed(() => {\n const items = toolPart.value.input?.items\n if (!items || items.length === 0) {\n return []\n }\n return Object.keys(items[0].values)\n })\n\n const copyTable = () => {\n const items = toolPart.value.input?.items\n if (!items) {\n return\n }\n const header = ['', ...items.map((i) => i.name)].join('\\t')\n const rows = features.value.map((f) =>\n [f.replace(/_/g, ' '), ...items.map((i) => i.values[f] ?? '')].join(\n '\\t',\n ),\n )\n copy([header, ...rows].join('\\n'))\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input?.items?.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:scales-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{\n toolPart.input.title ?? $t('label.comparison')\n }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copyTable\" />\n </VvButtonGroup>\n </div>\n <div class=\"overflow-x-auto\">\n <table class=\"w-full text-12 border-collapse bg-surface\">\n <thead>\n <tr>\n <th\n class=\"text-left text-word-3 font-medium p-8 border-b border-surface-3 min-w-32\"></th>\n <th\n v-for=\"item in toolPart.input.items\"\n :key=\"item.name\"\n class=\"text-center font-semibold text-word-1 p-8 border-b border-surface-3 min-w-24\"\n :class=\"\n item.highlighted\n ? 'bg-primary/5 border-primary/20'\n : ''\n \">\n {{ item.name }}\n <span v-if=\"item.highlighted\" class=\"ml-4\">⭐</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n v-for=\"(feature, fIdx) in features\"\n :key=\"feature\"\n :class=\"{ 'bg-surface-1': fIdx % 2 !== 0 }\">\n <td\n class=\"text-word-3 font-medium p-8 whitespace-nowrap\"\n :class=\"{\n 'border-b border-surface-3':\n fIdx !== features.length - 1,\n }\">\n {{ feature.replace(/_/g, ' ') }}\n </td>\n <td\n v-for=\"item in toolPart.input.items\"\n :key=\"item.name\"\n class=\"text-center p-8\"\n :class=\"{\n 'border-b border-surface-3':\n fIdx !== features.length - 1,\n 'bg-surface-info': item.highlighted,\n 'text-success': item.values[feature] === '✓',\n 'text-danger':\n item.values[feature] === '\\u2717',\n 'text-word-2':\n item.values[feature] !== '✓' &&\n item.values[feature] !== '\\u2717',\n }\">\n {{ item.values[feature] ?? '-' }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n title?: string\n items: Array<{\n name: string\n values: Record<string, string>\n highlighted?: boolean\n }>\n }\n }\n return part\n })\n\n const features = computed(() => {\n const items = toolPart.value.input?.items\n if (!items || items.length === 0) {\n return []\n }\n return Object.keys(items[0].values)\n })\n\n const copyTable = () => {\n const items = toolPart.value.input?.items\n if (!items) {\n return\n }\n const header = ['', ...items.map((i) => i.name)].join('\\t')\n const rows = features.value.map((f) =>\n [f.replace(/_/g, ' '), ...items.map((i) => i.values[f] ?? '')].join(\n '\\t',\n ),\n )\n copy([header, ...rows].join('\\n'))\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input?.items?.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:scales-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{\n toolPart.input.title ?? $t('label.comparison')\n }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copyTable\" />\n </VvButtonGroup>\n </div>\n <div class=\"overflow-x-auto\">\n <table class=\"w-full text-12 border-collapse bg-surface\">\n <thead>\n <tr>\n <th\n class=\"text-left text-word-3 font-medium p-8 border-b border-surface-3 min-w-32\"></th>\n <th\n v-for=\"item in toolPart.input.items\"\n :key=\"item.name\"\n class=\"text-center font-semibold text-word-1 p-8 border-b border-surface-3 min-w-24\"\n :class=\"\n item.highlighted\n ? 'bg-primary/5 border-primary/20'\n : ''\n \">\n {{ item.name }}\n <span v-if=\"item.highlighted\" class=\"ml-4\">⭐</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n v-for=\"(feature, fIdx) in features\"\n :key=\"feature\"\n :class=\"{ 'bg-surface-1': fIdx % 2 !== 0 }\">\n <td\n class=\"text-word-3 font-medium p-8 whitespace-nowrap\"\n :class=\"{\n 'border-b border-surface-3':\n fIdx !== features.length - 1,\n }\">\n {{ feature.replace(/_/g, ' ') }}\n </td>\n <td\n v-for=\"item in toolPart.input.items\"\n :key=\"item.name\"\n class=\"text-center p-8\"\n :class=\"{\n 'border-b border-surface-3':\n fIdx !== features.length - 1,\n 'bg-surface-info': item.highlighted,\n 'text-success': item.values[feature] === '✓',\n 'text-danger':\n item.values[feature] === '\\u2717',\n 'text-word-2':\n item.values[feature] !== '✓' &&\n item.values[feature] !== '\\u2717',\n }\">\n {{ item.values[feature] ?? '-' }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAII,IAAM,IAAQ,GAIR,EAAE,SAAM,cAAW,EAAa,GAEhC,IAAW,QACA,EAAM,IAWtB,GAEK,IAAW,QAAe;GAC5B,IAAM,IAAQ,EAAS,MAAM,OAAO;GAIpC,OAHI,CAAC,KAAS,EAAM,WAAW,IACpB,CAAC,IAEL,OAAO,KAAK,EAAM,EAAE,CAAC,MAAM;EACtC,CA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AAA,mCAAA,EAAA,CAAA;GAK3C,GAAA,CAAA,EAAA,EAAA,EAAK,IAAI,IAAG,KACf,CAAA,GAAY,EAAK,eAAjB,EAAA,GAAA,EAAmD,QAAnD,GAA2C,GAAC,KAAA,EAAA,IAAA,EAAA,CAAA,GAAA,CAAA,EAIxD,GAAA,GAAA,EAAA,CAAA,CAAA,CAAA,GAAA,EA+BQ,SAAA,MAAA,EA9BJ,EAAA,EAAA,GAAA,EA6BK,GAAA,MAAA,EA5ByB,EAAA,QAAlB,GAAS,OADrB,EAAA,GAAA,EA6BK,MAAA;IA3BA,KAAK;IACL,OAAK,EAAA,EAAA,gBAAoB,IAAI,KAAA,EAAA,CAAA;GAC9B,GAAA,CAAA,EAOK,MAAA,EAND,OAAK,EAAA,CAAC,iDAA+C,EAAA,6BACsD,MAAS,EAAA,MAAS,SAAM,EAAA,CAAA,CAAA,EAIhI,GAAA,EAAA,EAAQ,QAAO,MAAA,GAAA,CAAA,GAAA,CAAA,IAEtB,EAAA,EAAA,GAAA,EAgBK,GAAA,MAAA,EAfc,EAAA,MAAS,MAAM,QAAvB,OADX,EAAA,GAAA,EAgBK,MAAA;IAdA,KAAK,EAAK;IACX,OAAK,EAAA,CAAC,mBAAiB;KACoF,6BAAA,MAAS,EAAA,MAAS,SAAM;KAAyD,mBAAA,EAAK;KAA6D,gBAAA,EAAK,OAAO,OAAO;KAA8F,eAAA,EAAK,OAAO,OAAO;KAAmG,eAAA,EAAK,OAAO,OAAO,OAAiD,EAAK,OAAO,OAAO;;GAWzjB,GAAA,EAAA,EAAK,OAAO,MAAO,GAAA,GAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"PkToolShowComparison-RA72YL7R.js","names":["$t"],"sources":["../../../../packages/components/src/chat/PkToolShowComparison.vue","../../../../packages/components/src/chat/PkToolShowComparison.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n title?: string\n items: Array<{\n name: string\n values: Record<string, string>\n highlighted?: boolean\n }>\n }\n }\n return part\n })\n\n const features = computed(() => {\n const items = toolPart.value.input?.items\n if (!items || items.length === 0) {\n return []\n }\n return Object.keys(items[0].values)\n })\n\n const copyTable = () => {\n const items = toolPart.value.input?.items\n if (!items) {\n return\n }\n const header = ['', ...items.map((i) => i.name)].join('\\t')\n const rows = features.value.map((f) =>\n [f.replace(/_/g, ' '), ...items.map((i) => i.values[f] ?? '')].join(\n '\\t',\n ),\n )\n copy([header, ...rows].join('\\n'))\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input?.items?.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:scales-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{\n toolPart.input.title ?? $t('label.comparison')\n }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copyTable\" />\n </VvButtonGroup>\n </div>\n <div class=\"overflow-x-auto\">\n <table class=\"w-full text-12 border-collapse bg-surface\">\n <thead>\n <tr>\n <th\n class=\"text-left text-word-3 font-medium p-8 border-b border-surface-3 min-w-32\"></th>\n <th\n v-for=\"item in toolPart.input.items\"\n :key=\"item.name\"\n class=\"text-center font-semibold text-word-1 p-8 border-b border-surface-3 min-w-24\"\n :class=\"\n item.highlighted\n ? 'bg-primary/5 border-primary/20'\n : ''\n \">\n {{ item.name }}\n <span v-if=\"item.highlighted\" class=\"ml-4\">⭐</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n v-for=\"(feature, fIdx) in features\"\n :key=\"feature\"\n :class=\"{ 'bg-surface-1': fIdx % 2 !== 0 }\">\n <td\n class=\"text-word-3 font-medium p-8 whitespace-nowrap\"\n :class=\"{\n 'border-b border-surface-3':\n fIdx !== features.length - 1,\n }\">\n {{ feature.replace(/_/g, ' ') }}\n </td>\n <td\n v-for=\"item in toolPart.input.items\"\n :key=\"item.name\"\n class=\"text-center p-8\"\n :class=\"{\n 'border-b border-surface-3':\n fIdx !== features.length - 1,\n 'bg-surface-info': item.highlighted,\n 'text-success': item.values[feature] === '✓',\n 'text-danger':\n item.values[feature] === '\\u2717',\n 'text-word-2':\n item.values[feature] !== '✓' &&\n item.values[feature] !== '\\u2717',\n }\">\n {{ item.values[feature] ?? '-' }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n title?: string\n items: Array<{\n name: string\n values: Record<string, string>\n highlighted?: boolean\n }>\n }\n }\n return part\n })\n\n const features = computed(() => {\n const items = toolPart.value.input?.items\n if (!items || items.length === 0) {\n return []\n }\n return Object.keys(items[0].values)\n })\n\n const copyTable = () => {\n const items = toolPart.value.input?.items\n if (!items) {\n return\n }\n const header = ['', ...items.map((i) => i.name)].join('\\t')\n const rows = features.value.map((f) =>\n [f.replace(/_/g, ' '), ...items.map((i) => i.values[f] ?? '')].join(\n '\\t',\n ),\n )\n copy([header, ...rows].join('\\n'))\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input?.items?.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:scales-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{\n toolPart.input.title ?? $t('label.comparison')\n }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copyTable\" />\n </VvButtonGroup>\n </div>\n <div class=\"overflow-x-auto\">\n <table class=\"w-full text-12 border-collapse bg-surface\">\n <thead>\n <tr>\n <th\n class=\"text-left text-word-3 font-medium p-8 border-b border-surface-3 min-w-32\"></th>\n <th\n v-for=\"item in toolPart.input.items\"\n :key=\"item.name\"\n class=\"text-center font-semibold text-word-1 p-8 border-b border-surface-3 min-w-24\"\n :class=\"\n item.highlighted\n ? 'bg-primary/5 border-primary/20'\n : ''\n \">\n {{ item.name }}\n <span v-if=\"item.highlighted\" class=\"ml-4\">⭐</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n v-for=\"(feature, fIdx) in features\"\n :key=\"feature\"\n :class=\"{ 'bg-surface-1': fIdx % 2 !== 0 }\">\n <td\n class=\"text-word-3 font-medium p-8 whitespace-nowrap\"\n :class=\"{\n 'border-b border-surface-3':\n fIdx !== features.length - 1,\n }\">\n {{ feature.replace(/_/g, ' ') }}\n </td>\n <td\n v-for=\"item in toolPart.input.items\"\n :key=\"item.name\"\n class=\"text-center p-8\"\n :class=\"{\n 'border-b border-surface-3':\n fIdx !== features.length - 1,\n 'bg-surface-info': item.highlighted,\n 'text-success': item.values[feature] === '✓',\n 'text-danger':\n item.values[feature] === '\\u2717',\n 'text-word-2':\n item.values[feature] !== '✓' &&\n item.values[feature] !== '\\u2717',\n }\">\n {{ item.values[feature] ?? '-' }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAII,IAAM,IAAQ,GAIR,EAAE,SAAM,cAAW,EAAa,GAEhC,IAAW,QACA,EAAM,IAWtB,GAEK,IAAW,QAAe;GAC5B,IAAM,I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1
|
-
import {
|
|
2
|
-
import { r as g } from "./vue-i18n-
|
|
3
|
-
import { t as _ } from "./PkStreamingMarkdown-
|
|
4
|
-
import {
|
|
1
|
+
import { $ as e, C as t, L as n, O as r, Tt as i, X as a, bt as o, ct as s, h as c, it as l, m as u, r as d, t as f, v as p, x as m, xt as h } from "./vue.runtime.esm-bundler-B3bThTaf.js";
|
|
2
|
+
import { r as g } from "./vue-i18n-t25g63Be.js";
|
|
3
|
+
import { t as _ } from "./PkStreamingMarkdown-DIkusrTI.js";
|
|
4
|
+
import { o as v, p as y } from "./index.es-gbmOq0Nu.js";
|
|
5
5
|
import { g as b, u as x, v as S } from "./schemas-COkEQ0wM.js";
|
|
6
|
-
import { n as C, r as w, t as T } from "./index.es-
|
|
7
|
-
|
|
6
|
+
import { n as C, r as w, t as T } from "./index.es-BbyodRh9.js";
|
|
7
|
+
r(), l(), h(), d();
|
|
8
8
|
var E = { class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-surface" }, D = { class: "px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40" }, O = { class: "font-bold" }, k = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "p-sm"
|
|
11
11
|
}, A = { class: "flex justify-between items-center gap-16 mt-xs" }, j = { class: "text-smaller text-word-3 flex items-center gap-8" }, M = {
|
|
12
12
|
key: 1,
|
|
13
13
|
class: "p-sm"
|
|
14
|
-
}, N = { class: "flex items-center gap-sm" }, P = { class: "font-semibold block text-success" }, F = { class: "text-word-3" }, I = /* @__PURE__ */
|
|
14
|
+
}, N = { class: "flex items-center gap-sm" }, P = { class: "font-semibold block text-success" }, F = { class: "text-word-3" }, I = /* @__PURE__ */ t({
|
|
15
15
|
__name: "PkToolShowContactForm",
|
|
16
16
|
props: {
|
|
17
17
|
part: { type: null },
|
|
@@ -22,84 +22,84 @@ var E = { class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-s
|
|
|
22
22
|
privacyPolicyNotice: { type: null }
|
|
23
23
|
},
|
|
24
24
|
emits: ["submit"],
|
|
25
|
-
setup(
|
|
26
|
-
let { t:
|
|
25
|
+
setup(t, { emit: r }) {
|
|
26
|
+
let { t: l } = g({ useScope: "global" }), d = t, h = u(() => d.part), I = u(() => h.value.input), L = w(u(() => `${h.value.toolCallId}-${h.value.type}-submitted`), !1), R = b({
|
|
27
27
|
name: S().min(1).max(255).default(""),
|
|
28
28
|
email: x().max(255).default(""),
|
|
29
|
-
phone: S().max(50).regex(/^[+0-9\s\-.()]*$/,
|
|
30
|
-
}), z =
|
|
31
|
-
|
|
29
|
+
phone: S().max(50).regex(/^[+0-9\s\-.()]*$/, l("validation.invalidPhoneNumber")).optional()
|
|
30
|
+
}), z = r, { VvForm: B, VvFormField: V, formData: H } = T(R, { lazyLoad: !0 });
|
|
31
|
+
a(I, (e) => {
|
|
32
32
|
H.value = {
|
|
33
33
|
name: e?.name || "",
|
|
34
34
|
email: e?.email || "",
|
|
35
35
|
phone: e?.phone || ""
|
|
36
36
|
};
|
|
37
|
-
}, { immediate: !0 }),
|
|
37
|
+
}, { immediate: !0 }), a(() => d.submitted, (e) => {
|
|
38
38
|
e && (L.value = !0);
|
|
39
39
|
}, { immediate: !0 });
|
|
40
|
-
let U =
|
|
40
|
+
let U = u(() => d.submitted || L.value), W = async (e) => {
|
|
41
41
|
z("submit", {
|
|
42
42
|
...e,
|
|
43
43
|
metadata: I.value?.conversationContext
|
|
44
44
|
});
|
|
45
45
|
}, G = C(() => d.privacyPolicyNotice, "message.defaultPrivacyPolicyNotice");
|
|
46
|
-
return (
|
|
47
|
-
let
|
|
48
|
-
return
|
|
46
|
+
return (r, a) => {
|
|
47
|
+
let u = y, d = v;
|
|
48
|
+
return n(), p("div", E, [c("div", D, [m(u, {
|
|
49
49
|
name: "ri:send-plane-2-line",
|
|
50
50
|
class: "text-16"
|
|
51
|
-
}),
|
|
52
|
-
default:
|
|
51
|
+
}), c("strong", O, i(o(l)("label.contactUs")), 1)]), m(f, { mode: "out-in" }, {
|
|
52
|
+
default: e(() => [U.value ? (n(), p("div", M, [c("div", N, [m(u, {
|
|
53
53
|
name: "ri:mail-check-line",
|
|
54
54
|
class: "text-24 text-success"
|
|
55
|
-
}),
|
|
56
|
-
modelValue:
|
|
57
|
-
"onUpdate:modelValue":
|
|
58
|
-
readonly:
|
|
55
|
+
}), c("div", null, [c("strong", P, i(o(l)("message.leadSubmittedTitle")), 1), c("p", F, i(o(l)("message.leadSubmittedMessage")), 1)])])])) : (n(), p("div", k, [m(o(B), {
|
|
56
|
+
modelValue: o(H),
|
|
57
|
+
"onUpdate:modelValue": a[0] ||= (e) => s(H) ? H.value = e : null,
|
|
58
|
+
readonly: t.readonly,
|
|
59
59
|
onSubmit: W
|
|
60
60
|
}, {
|
|
61
|
-
default:
|
|
62
|
-
|
|
61
|
+
default: e(() => [
|
|
62
|
+
m(o(V), {
|
|
63
63
|
name: "name",
|
|
64
64
|
type: "text",
|
|
65
|
-
label:
|
|
66
|
-
placeholder:
|
|
65
|
+
label: o(l)("label.name"),
|
|
66
|
+
placeholder: o(l)("placeholder.name"),
|
|
67
67
|
icon: "ri:user-line",
|
|
68
68
|
modifiers: "compact no-label",
|
|
69
69
|
class: "mb-md"
|
|
70
70
|
}, null, 8, ["label", "placeholder"]),
|
|
71
|
-
|
|
71
|
+
m(o(V), {
|
|
72
72
|
name: "email",
|
|
73
73
|
type: "email",
|
|
74
|
-
label:
|
|
75
|
-
placeholder:
|
|
74
|
+
label: o(l)("label.email"),
|
|
75
|
+
placeholder: o(l)("placeholder.email"),
|
|
76
76
|
icon: "ri:mail-line",
|
|
77
77
|
modifiers: "compact no-label",
|
|
78
78
|
class: "mb-md"
|
|
79
79
|
}, null, 8, ["label", "placeholder"]),
|
|
80
|
-
|
|
80
|
+
m(o(V), {
|
|
81
81
|
name: "phone",
|
|
82
82
|
type: "tel",
|
|
83
|
-
label:
|
|
84
|
-
placeholder:
|
|
83
|
+
label: o(l)("label.phone"),
|
|
84
|
+
placeholder: o(l)("placeholder.phone"),
|
|
85
85
|
icon: "ri:phone-line",
|
|
86
86
|
class: "mb-md",
|
|
87
87
|
modifiers: "compact no-label"
|
|
88
88
|
}, null, 8, ["label", "placeholder"]),
|
|
89
|
-
|
|
89
|
+
c("div", A, [c("div", j, [m(u, {
|
|
90
90
|
name: "ri:shield-check-line",
|
|
91
91
|
class: "text-16 shrink-0"
|
|
92
|
-
}),
|
|
93
|
-
markdown:
|
|
92
|
+
}), m(_, {
|
|
93
|
+
markdown: o(G),
|
|
94
94
|
class: "wysiwyg"
|
|
95
|
-
}, null, 8, ["markdown"])]),
|
|
95
|
+
}, null, 8, ["markdown"])]), m(d, {
|
|
96
96
|
type: "submit",
|
|
97
97
|
modifiers: "primary",
|
|
98
|
-
loading:
|
|
99
|
-
disabled:
|
|
98
|
+
loading: t.loading,
|
|
99
|
+
disabled: t.loading || t.readonly,
|
|
100
100
|
"icon-position": "right",
|
|
101
101
|
class: "shrink-0",
|
|
102
|
-
label:
|
|
102
|
+
label: o(l)("action.submit")
|
|
103
103
|
}, null, 8, [
|
|
104
104
|
"loading",
|
|
105
105
|
"disabled",
|
|
@@ -116,4 +116,4 @@ var E = { class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-s
|
|
|
116
116
|
//#endregion
|
|
117
117
|
export { I as default };
|
|
118
118
|
|
|
119
|
-
//# sourceMappingURL=PkToolShowContactForm-
|
|
119
|
+
//# sourceMappingURL=PkToolShowContactForm-BzDhv2yd.js.map
|