@gui-chat-plugin/weather 0.0.1 → 0.1.0

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/vue.js CHANGED
@@ -1,554 +1,398 @@
1
- import { samples as E, fetchWeather as O, TOOL_DEFINITION as R } from "./core.js";
2
- import { defineComponent as F, computed as g, createElementBlock as o, openBlock as n, createElementVNode as e, createCommentVNode as d, Fragment as h, renderList as b, toDisplayString as a, normalizeClass as T, createTextVNode as y, createVNode as W, normalizeStyle as J } from "vue";
3
- const V = { class: "w-full" }, B = ["viewBox"], z = { class: "grid-lines" }, H = ["x1", "y1", "x2", "y2"], U = { class: "y-axis-labels" }, X = ["x", "y"], Y = ["points"], q = { key: 1 }, G = ["cx", "cy"], K = ["x", "y"], Q = ["points"], Z = { key: 3 }, I = ["cx", "cy"], tt = ["x", "y"], et = ["points"], st = { key: 5 }, ot = ["cx", "cy"], nt = { class: "x-axis-labels" }, lt = ["x", "y"], rt = { class: "flex justify-center gap-6 mt-4" }, it = {
4
- key: 0,
5
- class: "flex items-center gap-2"
6
- }, at = {
7
- key: 1,
8
- class: "flex items-center gap-2"
9
- }, dt = {
10
- key: 2,
11
- class: "flex items-center gap-2"
12
- }, C = 800, L = 300, ut = /* @__PURE__ */ F({
13
- __name: "TemperatureChart",
14
- props: {
15
- times: {},
16
- tempsMax: {},
17
- tempsMin: {},
18
- temps: {}
19
- },
20
- setup(_) {
21
- const m = _, x = { top: 40, right: 40, bottom: 60, left: 50 }, w = g(() => C - x.left - x.right), v = g(() => L - x.top - x.bottom), f = g(() => {
22
- const l = [];
23
- return m.tempsMax && l.push(...m.tempsMax.map(Number).filter((t) => !isNaN(t))), m.tempsMin && l.push(...m.tempsMin.map(Number).filter((t) => !isNaN(t))), m.temps && l.push(...m.temps.map(Number).filter((t) => !isNaN(t))), l;
24
- }), j = g(() => {
25
- if (f.value.length === 0) return { min: 0, max: 30 };
26
- const l = Math.floor(Math.min(...f.value) / 5) * 5, t = Math.ceil(Math.max(...f.value) / 5) * 5;
27
- return { min: l, max: t };
28
- }), P = g(() => {
29
- const { min: l, max: t } = j.value, i = (t - l) / 4;
30
- return [t, t - i, t - i * 2, t - i * 3, l];
31
- });
32
- function $(l) {
33
- const t = typeof l == "string" ? parseFloat(l) : l;
34
- if (isNaN(t)) return 0;
35
- const { min: i, max: p } = j.value, r = (t - i) / (p - i);
36
- return x.top + v.value * (1 - r);
37
- }
38
- function D(l, t) {
39
- return t <= 1 ? x.left + w.value / 2 : x.left + w.value / (t - 1) * l;
40
- }
41
- const M = g(() => m.tempsMax ? m.tempsMax.map((l, t) => l ? {
42
- x: D(t, m.times.length),
43
- y: $(l),
44
- value: l
45
- } : null).filter((l) => l !== null) : []), k = g(() => M.value.map((l) => `${l.x},${l.y}`).join(" ")), S = g(() => m.tempsMin ? m.tempsMin.map((l, t) => l ? {
46
- x: D(t, m.times.length),
47
- y: $(l),
48
- value: l
49
- } : null).filter((l) => l !== null) : []), N = g(() => S.value.map((l) => `${l.x},${l.y}`).join(" ")), u = g(() => m.temps ? m.temps.map((l, t) => l ? {
50
- x: D(t, m.times.length),
51
- y: $(l),
52
- value: l
53
- } : null).filter((l) => l !== null) : []), s = g(() => u.value.map((l) => `${l.x},${l.y}`).join(" ")), c = g(() => m.times.map((l) => {
54
- const t = new Date(l), i = /* @__PURE__ */ new Date(), p = new Date(i);
55
- p.setDate(p.getDate() + 1);
56
- const r = t.toLocaleDateString("ja-JP", {
57
- month: "short",
58
- day: "numeric"
59
- }), A = t.toLocaleTimeString("ja-JP", {
60
- hour: "2-digit",
61
- minute: "2-digit"
62
- });
63
- return t.toDateString() === i.toDateString() ? `Today ${A}` : t.toDateString() === p.toDateString() ? `Tomorrow ${A}` : `${r} ${A}`;
64
- }));
65
- return (l, t) => (n(), o("div", V, [
66
- (n(), o("svg", {
67
- viewBox: `0 0 ${C} ${L}`,
68
- class: "w-full h-auto"
69
- }, [
70
- e("g", z, [
71
- (n(), o(h, null, b(5, (i) => e("line", {
72
- key: `grid-${i}`,
73
- x1: x.left,
74
- y1: x.top + v.value / 4 * (i - 1),
75
- x2: C - x.right,
76
- y2: x.top + v.value / 4 * (i - 1),
77
- stroke: "#e5e7eb",
78
- "stroke-width": "1"
79
- }, null, 8, H)), 64))
80
- ]),
81
- e("g", U, [
82
- (n(!0), o(h, null, b(P.value, (i, p) => (n(), o("text", {
83
- key: `y-label-${p}`,
84
- x: x.left - 10,
85
- y: x.top + v.value / 4 * p + 5,
86
- "text-anchor": "end",
87
- class: "text-xs fill-gray-600"
88
- }, a(i) + "° ", 9, X))), 128))
89
- ]),
90
- k.value.length > 0 ? (n(), o("polyline", {
91
- key: 0,
92
- points: k.value,
93
- fill: "none",
94
- stroke: "#ef4444",
95
- "stroke-width": "3",
96
- "stroke-linecap": "round",
97
- "stroke-linejoin": "round"
98
- }, null, 8, Y)) : d("", !0),
99
- k.value.length > 0 ? (n(), o("g", q, [
100
- (n(!0), o(h, null, b(M.value, (i, p) => (n(), o("g", {
101
- key: `max-point-${p}`
102
- }, [
103
- e("circle", {
104
- cx: i.x,
105
- cy: i.y,
106
- r: "5",
107
- fill: "#ef4444"
108
- }, null, 8, G),
109
- e("text", {
110
- x: i.x,
111
- y: i.y - 12,
112
- "text-anchor": "middle",
113
- class: "text-sm font-bold fill-red-600"
114
- }, a(i.value) + "° ", 9, K)
115
- ]))), 128))
116
- ])) : d("", !0),
117
- N.value.length > 0 ? (n(), o("polyline", {
118
- key: 2,
119
- points: N.value,
120
- fill: "none",
121
- stroke: "#3b82f6",
122
- "stroke-width": "3",
123
- "stroke-linecap": "round",
124
- "stroke-linejoin": "round"
125
- }, null, 8, Q)) : d("", !0),
126
- N.value.length > 0 ? (n(), o("g", Z, [
127
- (n(!0), o(h, null, b(S.value, (i, p) => (n(), o("g", {
128
- key: `min-point-${p}`
129
- }, [
130
- e("circle", {
131
- cx: i.x,
132
- cy: i.y,
133
- r: "5",
134
- fill: "#3b82f6"
135
- }, null, 8, I),
136
- e("text", {
137
- x: i.x,
138
- y: i.y + 20,
139
- "text-anchor": "middle",
140
- class: "text-sm font-bold fill-blue-600"
141
- }, a(i.value) + "° ", 9, tt)
142
- ]))), 128))
143
- ])) : d("", !0),
144
- s.value.length > 0 ? (n(), o("polyline", {
145
- key: 4,
146
- points: s.value,
147
- fill: "none",
148
- stroke: "#f97316",
149
- "stroke-width": "3",
150
- "stroke-linecap": "round",
151
- "stroke-linejoin": "round",
152
- "stroke-dasharray": "5,5"
153
- }, null, 8, et)) : d("", !0),
154
- s.value.length > 0 ? (n(), o("g", st, [
155
- (n(!0), o(h, null, b(u.value, (i, p) => (n(), o("g", {
156
- key: `current-point-${p}`
157
- }, [
158
- e("circle", {
159
- cx: i.x,
160
- cy: i.y,
161
- r: "5",
162
- fill: "#f97316"
163
- }, null, 8, ot)
164
- ]))), 128))
165
- ])) : d("", !0),
166
- e("g", nt, [
167
- (n(!0), o(h, null, b(c.value, (i, p) => (n(), o("text", {
168
- key: `x-label-${p}`,
169
- x: x.left + w.value / (c.value.length - 1) * p,
170
- y: L - x.bottom + 20,
171
- "text-anchor": "middle",
172
- class: "text-xs fill-gray-700 font-medium"
173
- }, a(i), 9, lt))), 128))
174
- ])
175
- ], 8, B)),
176
- e("div", rt, [
177
- M.value.length > 0 ? (n(), o("div", it, [...t[0] || (t[0] = [
178
- e("div", { class: "w-4 h-4 rounded-full bg-red-500" }, null, -1),
179
- e("span", { class: "text-sm text-gray-700 font-medium" }, "最高気温", -1)
180
- ])])) : d("", !0),
181
- S.value.length > 0 ? (n(), o("div", at, [...t[1] || (t[1] = [
182
- e("div", { class: "w-4 h-4 rounded-full bg-blue-500" }, null, -1),
183
- e("span", { class: "text-sm text-gray-700 font-medium" }, "最低気温", -1)
184
- ])])) : d("", !0),
185
- u.value.length > 0 ? (n(), o("div", dt, [...t[2] || (t[2] = [
186
- e("div", { class: "w-4 h-4 rounded-full bg-orange-500" }, null, -1),
187
- e("span", { class: "text-sm text-gray-700 font-medium" }, "現在気温", -1)
188
- ])])) : d("", !0)
189
- ])
190
- ]));
191
- }
192
- }), ct = { class: "w-full h-full overflow-auto bg-gradient-to-br from-sky-100 via-blue-50 to-indigo-100" }, mt = { class: "max-w-6xl mx-auto p-6" }, xt = { class: "bg-gradient-to-r from-blue-500 to-indigo-600 rounded-2xl shadow-xl p-8 mb-8 text-white" }, pt = { class: "flex items-center justify-between" }, gt = { class: "text-4xl font-bold mb-2" }, ft = { class: "text-sm opacity-90" }, ht = { key: 0 }, bt = { key: 1 }, yt = {
193
- key: 0,
194
- class: "bg-white rounded-2xl shadow-lg p-8 text-center text-gray-600"
195
- }, vt = {
196
- key: 1,
197
- class: "space-y-8"
198
- }, _t = {
199
- key: 0,
200
- class: "text-3xl"
201
- }, wt = {
202
- key: 1,
203
- class: "text-3xl"
204
- }, kt = {
205
- key: 2,
206
- class: "text-3xl"
207
- }, $t = {
208
- key: 3,
209
- class: "text-3xl"
210
- }, Dt = {
211
- key: 0,
212
- class: "text-lg font-semibold text-gray-700 mb-4"
213
- }, Mt = { key: 1 }, St = { class: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-7 gap-4 mb-8" }, Nt = { class: "text-center mt-3 mb-3" }, Tt = { class: "text-sm font-medium text-gray-600" }, jt = {
214
- key: 0,
215
- class: "text-center mb-3"
216
- }, Pt = { class: "text-6xl mb-2 drop-shadow-lg" }, At = { class: "text-xs text-gray-700 font-medium" }, Ct = {
217
- key: 1,
218
- class: "text-center mb-3"
219
- }, Lt = { class: "flex items-center justify-center gap-2 mb-1" }, Ft = { class: "text-3xl" }, Et = { class: "text-2xl font-bold text-blue-600" }, Ot = { class: "text-center mb-3" }, Rt = {
220
- key: 0,
221
- class: "text-3xl font-bold text-red-500 mb-1"
222
- }, Wt = {
223
- key: 1,
224
- class: "text-xl font-semibold text-blue-500"
225
- }, Jt = {
226
- key: 2,
227
- class: "text-2xl font-bold text-orange-500"
228
- }, Vt = {
229
- key: 2,
230
- class: "text-xs text-gray-600 mb-1 text-center"
231
- }, Bt = {
232
- key: 3,
233
- class: "text-xs text-gray-600 text-center"
234
- }, zt = {
235
- key: 0,
236
- class: "bg-white rounded-xl p-6 shadow-lg"
237
- }, Ht = {
238
- key: 2,
239
- class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4"
240
- }, Ut = { class: "text-sm font-bold text-blue-700 mb-3" }, Xt = {
241
- key: 0,
242
- class: "mb-3 flex items-center gap-2"
243
- }, Yt = { class: "text-4xl drop-shadow" }, qt = { class: "text-gray-800 font-medium text-sm" }, Gt = {
244
- key: 1,
245
- class: "text-gray-700 mb-2"
246
- }, Kt = { class: "text-2xl font-bold ml-2" }, Qt = { class: "flex gap-3 mb-2" }, Zt = {
247
- key: 0,
248
- class: "flex items-center gap-1"
249
- }, It = { class: "text-xl font-bold text-red-600" }, te = {
250
- key: 1,
251
- class: "flex items-center gap-1"
252
- }, ee = { class: "text-xl font-bold text-blue-600" }, se = {
253
- key: 2,
254
- class: "mb-2"
255
- }, oe = { class: "flex items-center justify-between text-sm mb-1" }, ne = { class: "font-bold" }, le = { class: "w-full bg-gray-200 rounded-full h-2" }, re = {
256
- key: 3,
257
- class: "text-gray-700 text-sm mb-1"
1
+ import { n as e, r as t, t as n } from "./samples-B8UEyQ7o.js";
2
+ import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, normalizeStyle as f, openBlock as p, renderList as m, toDisplayString as h } from "vue";
3
+ //#region src/vue/components/TemperatureChart.vue?vue&type=script&setup=true&lang.ts
4
+ var g = { class: "w-full" }, _ = ["viewBox"], v = { class: "grid-lines" }, y = [
5
+ "x1",
6
+ "y1",
7
+ "x2",
8
+ "y2"
9
+ ], b = { class: "y-axis-labels" }, x = ["x", "y"], S = ["points"], C = { key: 1 }, w = ["cx", "cy"], T = ["x", "y"], ee = ["points"], E = { key: 3 }, D = ["cx", "cy"], O = ["x", "y"], k = ["points"], A = { key: 5 }, j = ["cx", "cy"], M = { class: "x-axis-labels" }, N = ["x", "y"], P = { class: "flex justify-center gap-6 mt-4" }, F = {
10
+ key: 0,
11
+ class: "flex items-center gap-2"
12
+ }, te = {
13
+ key: 1,
14
+ class: "flex items-center gap-2"
15
+ }, ne = {
16
+ key: 2,
17
+ class: "flex items-center gap-2"
18
+ }, I = 800, L = 300, R = /* @__PURE__ */ u({
19
+ __name: "TemperatureChart",
20
+ props: {
21
+ times: {},
22
+ tempsMax: {},
23
+ tempsMin: {},
24
+ temps: {}
25
+ },
26
+ setup(e) {
27
+ let t = e, n = {
28
+ top: 40,
29
+ right: 40,
30
+ bottom: 60,
31
+ left: 50
32
+ }, c = i(() => I - n.left - n.right), l = i(() => L - n.top - n.bottom), u = i(() => {
33
+ let e = [];
34
+ return t.tempsMax && e.push(...t.tempsMax.map(Number).filter((e) => !isNaN(e))), t.tempsMin && e.push(...t.tempsMin.map(Number).filter((e) => !isNaN(e))), t.temps && e.push(...t.temps.map(Number).filter((e) => !isNaN(e))), e;
35
+ }), d = i(() => u.value.length === 0 ? {
36
+ min: 0,
37
+ max: 30
38
+ } : {
39
+ min: Math.floor(Math.min(...u.value) / 5) * 5,
40
+ max: Math.ceil(Math.max(...u.value) / 5) * 5
41
+ }), f = i(() => {
42
+ let { min: e, max: t } = d.value, n = (t - e) / 4;
43
+ return [
44
+ t,
45
+ t - n,
46
+ t - n * 2,
47
+ t - n * 3,
48
+ e
49
+ ];
50
+ });
51
+ function R(e) {
52
+ let t = typeof e == "string" ? parseFloat(e) : e;
53
+ if (isNaN(t)) return 0;
54
+ let { min: r, max: i } = d.value, a = (t - r) / (i - r);
55
+ return n.top + l.value * (1 - a);
56
+ }
57
+ function z(e, t) {
58
+ return t <= 1 ? n.left + c.value / 2 : n.left + c.value / (t - 1) * e;
59
+ }
60
+ let B = i(() => t.tempsMax ? t.tempsMax.map((e, n) => e ? {
61
+ x: z(n, t.times.length),
62
+ y: R(e),
63
+ value: e
64
+ } : null).filter((e) => e !== null) : []), V = i(() => B.value.map((e) => `${e.x},${e.y}`).join(" ")), H = i(() => t.tempsMin ? t.tempsMin.map((e, n) => e ? {
65
+ x: z(n, t.times.length),
66
+ y: R(e),
67
+ value: e
68
+ } : null).filter((e) => e !== null) : []), U = i(() => H.value.map((e) => `${e.x},${e.y}`).join(" ")), W = i(() => t.temps ? t.temps.map((e, n) => e ? {
69
+ x: z(n, t.times.length),
70
+ y: R(e),
71
+ value: e
72
+ } : null).filter((e) => e !== null) : []), G = i(() => W.value.map((e) => `${e.x},${e.y}`).join(" ")), K = i(() => t.times.map((e) => {
73
+ let t = new Date(e), n = /* @__PURE__ */ new Date(), r = new Date(n);
74
+ r.setDate(r.getDate() + 1);
75
+ let i = t.toLocaleDateString("ja-JP", {
76
+ month: "short",
77
+ day: "numeric"
78
+ }), a = t.toLocaleTimeString("ja-JP", {
79
+ hour: "2-digit",
80
+ minute: "2-digit"
81
+ });
82
+ return t.toDateString() === n.toDateString() ? `Today ${a}` : t.toDateString() === r.toDateString() ? `Tomorrow ${a}` : `${i} ${a}`;
83
+ }));
84
+ return (e, t) => (p(), o("div", g, [(p(), o("svg", {
85
+ viewBox: `0 0 ${I} ${L}`,
86
+ class: "w-full h-auto"
87
+ }, [
88
+ s("g", v, [(p(), o(r, null, m(5, (e) => s("line", {
89
+ key: `grid-${e}`,
90
+ x1: n.left,
91
+ y1: n.top + l.value / 4 * (e - 1),
92
+ x2: I - n.right,
93
+ y2: n.top + l.value / 4 * (e - 1),
94
+ stroke: "#e5e7eb",
95
+ "stroke-width": "1"
96
+ }, null, 8, y)), 64))]),
97
+ s("g", b, [(p(!0), o(r, null, m(f.value, (e, t) => (p(), o("text", {
98
+ key: `y-label-${t}`,
99
+ x: n.left - 10,
100
+ y: n.top + l.value / 4 * t + 5,
101
+ "text-anchor": "end",
102
+ class: "text-xs fill-gray-600"
103
+ }, h(e) + "° ", 9, x))), 128))]),
104
+ V.value.length > 0 ? (p(), o("polyline", {
105
+ key: 0,
106
+ points: V.value,
107
+ fill: "none",
108
+ stroke: "#ef4444",
109
+ "stroke-width": "3",
110
+ "stroke-linecap": "round",
111
+ "stroke-linejoin": "round"
112
+ }, null, 8, S)) : a("", !0),
113
+ V.value.length > 0 ? (p(), o("g", C, [(p(!0), o(r, null, m(B.value, (e, t) => (p(), o("g", { key: `max-point-${t}` }, [s("circle", {
114
+ cx: e.x,
115
+ cy: e.y,
116
+ r: "5",
117
+ fill: "#ef4444"
118
+ }, null, 8, w), s("text", {
119
+ x: e.x,
120
+ y: e.y - 12,
121
+ "text-anchor": "middle",
122
+ class: "text-sm font-bold fill-red-600"
123
+ }, h(e.value) + "° ", 9, T)]))), 128))])) : a("", !0),
124
+ U.value.length > 0 ? (p(), o("polyline", {
125
+ key: 2,
126
+ points: U.value,
127
+ fill: "none",
128
+ stroke: "#3b82f6",
129
+ "stroke-width": "3",
130
+ "stroke-linecap": "round",
131
+ "stroke-linejoin": "round"
132
+ }, null, 8, ee)) : a("", !0),
133
+ U.value.length > 0 ? (p(), o("g", E, [(p(!0), o(r, null, m(H.value, (e, t) => (p(), o("g", { key: `min-point-${t}` }, [s("circle", {
134
+ cx: e.x,
135
+ cy: e.y,
136
+ r: "5",
137
+ fill: "#3b82f6"
138
+ }, null, 8, D), s("text", {
139
+ x: e.x,
140
+ y: e.y + 20,
141
+ "text-anchor": "middle",
142
+ class: "text-sm font-bold fill-blue-600"
143
+ }, h(e.value) + "° ", 9, O)]))), 128))])) : a("", !0),
144
+ G.value.length > 0 ? (p(), o("polyline", {
145
+ key: 4,
146
+ points: G.value,
147
+ fill: "none",
148
+ stroke: "#f97316",
149
+ "stroke-width": "3",
150
+ "stroke-linecap": "round",
151
+ "stroke-linejoin": "round",
152
+ "stroke-dasharray": "5,5"
153
+ }, null, 8, k)) : a("", !0),
154
+ G.value.length > 0 ? (p(), o("g", A, [(p(!0), o(r, null, m(W.value, (e, t) => (p(), o("g", { key: `current-point-${t}` }, [s("circle", {
155
+ cx: e.x,
156
+ cy: e.y,
157
+ r: "5",
158
+ fill: "#f97316"
159
+ }, null, 8, j)]))), 128))])) : a("", !0),
160
+ s("g", M, [(p(!0), o(r, null, m(K.value, (e, t) => (p(), o("text", {
161
+ key: `x-label-${t}`,
162
+ x: n.left + c.value / (K.value.length - 1) * t,
163
+ y: L - n.bottom + 20,
164
+ "text-anchor": "middle",
165
+ class: "text-xs fill-gray-700 font-medium"
166
+ }, h(e), 9, N))), 128))])
167
+ ], 8, _)), s("div", P, [
168
+ B.value.length > 0 ? (p(), o("div", F, [...t[0] ||= [s("div", { class: "w-4 h-4 rounded-full bg-red-500" }, null, -1), s("span", { class: "text-sm text-gray-700 font-medium" }, "最高気温", -1)]])) : a("", !0),
169
+ H.value.length > 0 ? (p(), o("div", te, [...t[1] ||= [s("div", { class: "w-4 h-4 rounded-full bg-blue-500" }, null, -1), s("span", { class: "text-sm text-gray-700 font-medium" }, "最低気温", -1)]])) : a("", !0),
170
+ W.value.length > 0 ? (p(), o("div", ne, [...t[2] ||= [s("div", { class: "w-4 h-4 rounded-full bg-orange-500" }, null, -1), s("span", { class: "text-sm text-gray-700 font-medium" }, "現在気温", -1)]])) : a("", !0)
171
+ ])]));
172
+ }
173
+ }), z = { class: "w-full h-full overflow-auto bg-gradient-to-br from-sky-100 via-blue-50 to-indigo-100" }, B = { class: "max-w-6xl mx-auto p-6" }, V = { class: "bg-gradient-to-r from-blue-500 to-indigo-600 rounded-2xl shadow-xl p-8 mb-8 text-white" }, H = { class: "flex items-center justify-between" }, U = { class: "text-4xl font-bold mb-2" }, W = { class: "text-sm opacity-90" }, G = { key: 0 }, K = { key: 1 }, q = {
174
+ key: 0,
175
+ class: "bg-white rounded-2xl shadow-lg p-8 text-center text-gray-600"
176
+ }, J = {
177
+ key: 1,
178
+ class: "space-y-8"
179
+ }, Y = {
180
+ key: 0,
181
+ class: "text-3xl"
182
+ }, X = {
183
+ key: 1,
184
+ class: "text-3xl"
185
+ }, Z = {
186
+ key: 2,
187
+ class: "text-3xl"
188
+ }, re = {
189
+ key: 3,
190
+ class: "text-3xl"
258
191
  }, ie = {
259
- key: 4,
260
- class: "text-gray-700 text-sm"
261
- }, ae = {
262
- key: 0,
263
- class: "bg-white rounded-2xl shadow-xl p-6"
264
- }, de = { class: "grid grid-cols-1 md:grid-cols-2 gap-6" }, ue = {
265
- key: 0,
266
- class: "bg-gradient-to-br from-orange-50 to-red-50 rounded-xl p-5 shadow-md border border-orange-200"
267
- }, ce = { class: "font-semibold text-gray-800 mb-1" }, me = { class: "flex gap-3" }, xe = {
268
- key: 0,
269
- class: "flex items-center gap-1"
270
- }, pe = { class: "text-xl font-bold text-blue-700" }, ge = {
271
- key: 1,
272
- class: "flex items-center gap-1"
273
- }, fe = { class: "text-xl font-bold text-red-700" }, he = {
274
- key: 1,
275
- class: "bg-gradient-to-br from-blue-50 to-cyan-50 rounded-xl p-5 shadow-md border border-blue-200"
276
- }, be = { class: "font-semibold text-gray-800 mb-1" }, ye = { class: "flex gap-3" }, ve = {
277
- key: 0,
278
- class: "flex items-center gap-1"
279
- }, _e = { class: "text-xl font-bold text-cyan-700" }, we = {
280
- key: 1,
281
- class: "flex items-center gap-1"
282
- }, ke = { class: "text-xl font-bold text-blue-700" }, $e = /* @__PURE__ */ F({
283
- __name: "View",
284
- props: {
285
- selectedResult: {},
286
- sendTextMessage: { type: Function }
287
- },
288
- setup(_) {
289
- const m = _, x = g(() => m.selectedResult?.data?.areaName || "Unknown Area"), w = g(() => m.selectedResult?.data?.publishingOffice || ""), v = g(() => m.selectedResult?.data?.reportDatetime || ""), f = g(() => m.selectedResult?.jsonData || null), j = g(() => v.value ? new Date(v.value).toLocaleString("ja-JP", {
290
- year: "numeric",
291
- month: "long",
292
- day: "numeric",
293
- hour: "2-digit",
294
- minute: "2-digit"
295
- }) : "");
296
- function P(u) {
297
- const s = new Date(u), c = /* @__PURE__ */ new Date(), l = new Date(c);
298
- l.setDate(l.getDate() + 1);
299
- const t = s.toLocaleDateString("ja-JP", {
300
- month: "short",
301
- day: "numeric"
302
- }), i = s.toLocaleTimeString("ja-JP", {
303
- hour: "2-digit",
304
- minute: "2-digit"
305
- });
306
- return s.toDateString() === c.toDateString() ? `Today ${i}` : s.toDateString() === l.toDateString() ? `Tomorrow ${i}` : `${t} ${i}`;
307
- }
308
- function $(u) {
309
- const s = new Date(u);
310
- return ["日", "月", "火", "水", "木", "金", "土"][s.getDay()] ?? "";
311
- }
312
- function D(u) {
313
- const s = typeof u == "string" ? parseInt(u) : u;
314
- return s >= 70 ? "bg-gradient-to-r from-blue-500 to-blue-600" : s >= 50 ? "bg-gradient-to-r from-blue-400 to-blue-500" : s >= 30 ? "bg-gradient-to-r from-cyan-400 to-blue-400" : s >= 10 ? "bg-gradient-to-r from-cyan-300 to-cyan-400" : "bg-gradient-to-r from-gray-300 to-gray-400";
315
- }
316
- function M(u) {
317
- return ["Current Forecast", "Extended Forecast", "Weekly Forecast"][u] || `Forecast ${u + 1}`;
318
- }
319
- function k(u) {
320
- if (!u) return "🌤️";
321
- const s = u.toLowerCase();
322
- return s.includes("晴") || s.includes("sunny") || s.includes("clear") ? "☀️" : s.includes("曇") || s.includes("cloudy") ? "☁️" : s.includes("雨") || s.includes("rain") ? "🌧️" : s.includes("雪") || s.includes("snow") ? "❄️" : s.includes("雷") || s.includes("thunder") ? "⛈️" : s.includes("霧") || s.includes("fog") ? "🌫️" : "🌤️";
323
- }
324
- function S(u) {
325
- const s = typeof u == "string" ? parseInt(u) : u;
326
- return s >= 50 ? "☔" : s >= 30 ? "🌂" : s >= 10 ? "☁️" : "☀️";
327
- }
328
- function N(u) {
329
- return !!(u.tempsMax || u.tempsMin || u.temps);
330
- }
331
- return (u, s) => (n(), o("div", ct, [
332
- e("div", mt, [
333
- e("div", xt, [
334
- e("div", pt, [
335
- e("div", null, [
336
- e("h1", gt, a(x.value), 1),
337
- e("div", ft, [
338
- w.value ? (n(), o("div", ht, a(w.value), 1)) : d("", !0),
339
- v.value ? (n(), o("div", bt, a(j.value), 1)) : d("", !0)
340
- ])
341
- ]),
342
- s[0] || (s[0] = e("div", { class: "text-8xl drop-shadow-lg" }, "⛅", -1))
343
- ])
344
- ]),
345
- f.value ? (n(), o("div", vt, [
346
- (n(!0), o(h, null, b(f.value.timeSeries, (c, l) => (n(), o("div", {
347
- key: l,
348
- class: T([
349
- "rounded-2xl shadow-xl p-6",
350
- l === 1 ? "bg-gradient-to-br from-orange-50 via-pink-50 to-purple-50" : l === 2 ? "bg-gradient-to-br from-green-50 via-teal-50 to-cyan-50" : "bg-white"
351
- ])
352
- }, [
353
- e("h2", {
354
- class: T([
355
- "text-2xl font-bold mb-6 flex items-center gap-2",
356
- l === 1 ? "text-purple-800" : l === 2 ? "text-teal-800" : "text-gray-800"
357
- ])
358
- }, [
359
- l === 1 ? (n(), o("span", _t, "📅")) : l === 2 ? (n(), o("span", wt, "📊")) : l === 0 ? (n(), o("span", kt, "🌤️")) : (n(), o("span", $t, "📋")),
360
- y(" " + a(M(l)), 1)
361
- ], 2),
362
- (n(!0), o(h, null, b(c.areas, (t, i) => (n(), o("div", {
363
- key: i,
364
- class: "mb-6 last:mb-0"
365
- }, [
366
- c.areas.length > 1 ? (n(), o("h3", Dt, a(t.area.name), 1)) : d("", !0),
367
- l === 1 || l === 2 ? (n(), o("div", Mt, [
368
- e("div", St, [
369
- (n(!0), o(h, null, b(c.timeDefines, (p, r) => (n(), o("div", {
370
- key: r,
371
- class: T([
372
- "relative bg-white rounded-xl p-5 shadow-lg hover:shadow-2xl transition-all duration-300 hover:scale-105 border-2 border-transparent",
373
- l === 1 ? "hover:border-purple-300" : "hover:border-teal-300"
374
- ])
375
- }, [
376
- e("div", {
377
- class: T([
378
- "absolute -top-3 left-1/2 transform -translate-x-1/2 text-white px-4 py-1 rounded-full text-xs font-bold shadow-md",
379
- l === 1 ? "bg-gradient-to-r from-purple-500 to-pink-500" : "bg-gradient-to-r from-teal-500 to-cyan-500"
380
- ])
381
- }, a($(p)), 3),
382
- e("div", Nt, [
383
- e("div", Tt, a(P(p)), 1)
384
- ]),
385
- t.weathers && t.weathers[r] ? (n(), o("div", jt, [
386
- e("div", Pt, a(k(t.weathers[r])), 1),
387
- e("div", At, a(t.weathers[r]), 1)
388
- ])) : d("", !0),
389
- t.pops && t.pops[r] ? (n(), o("div", Ct, [
390
- e("div", Lt, [
391
- e("span", Ft, a(S(t.pops[r])), 1),
392
- e("span", Et, a(t.pops[r]) + "%", 1)
393
- ])
394
- ])) : d("", !0),
395
- e("div", Ot, [
396
- t.tempsMax && t.tempsMax[r] ? (n(), o("div", Rt, a(t.tempsMax[r]) + ", 1)) : d("", !0),
397
- t.tempsMin && t.tempsMin[r] ? (n(), o("div", Wt, a(t.tempsMin[r]) + "° ", 1)) : d("", !0),
398
- t.temps && t.temps[r] ? (n(), o("div", Jt, a(t.temps[r]) + ", 1)) : d("", !0)
399
- ]),
400
- t.winds && t.winds[r] ? (n(), o("div", Vt, [
401
- s[1] || (s[1] = e("span", { class: "mr-1" }, "🌬️", -1)),
402
- y(" " + a(t.winds[r]), 1)
403
- ])) : d("", !0),
404
- t.waves && t.waves[r] ? (n(), o("div", Bt, [
405
- s[2] || (s[2] = e("span", { class: "mr-1" }, "🌊", -1)),
406
- y(" " + a(t.waves[r]), 1)
407
- ])) : d("", !0)
408
- ], 2))), 128))
409
- ]),
410
- N(t) ? (n(), o("div", zt, [
411
- s[3] || (s[3] = e("h3", { class: "text-lg font-bold text-gray-800 mb-4 flex items-center gap-2" }, [
412
- e("span", { class: "text-2xl" }, "📈"),
413
- y(" 気温の推移 ")
414
- ], -1)),
415
- W(ut, {
416
- times: c.timeDefines,
417
- tempsMax: t.tempsMax,
418
- tempsMin: t.tempsMin,
419
- temps: t.temps
420
- }, null, 8, ["times", "tempsMax", "tempsMin", "temps"])
421
- ])) : d("", !0)
422
- ])) : (n(), o("div", Ht, [
423
- (n(!0), o(h, null, b(c.timeDefines, (p, r) => (n(), o("div", {
424
- key: r,
425
- class: "bg-gradient-to-br from-blue-50 to-cyan-50 rounded-xl p-5 shadow-md hover:shadow-xl transition-all duration-300 border border-blue-100"
426
- }, [
427
- e("div", Ut, a(P(p)), 1),
428
- t.weathers && t.weathers[r] ? (n(), o("div", Xt, [
429
- e("span", Yt, a(k(t.weathers[r])), 1),
430
- e("span", qt, a(t.weathers[r]), 1)
431
- ])) : d("", !0),
432
- t.temps && t.temps[r] ? (n(), o("div", Gt, [
433
- s[4] || (s[4] = e("span", { class: "font-semibold text-orange-600" }, "気温:", -1)),
434
- e("span", Kt, a(t.temps[r]) + "°C", 1)
435
- ])) : d("", !0),
436
- e("div", Qt, [
437
- t.tempsMax && t.tempsMax[r] ? (n(), o("div", Zt, [
438
- s[5] || (s[5] = e("span", { class: "text-red-500 font-bold text-sm" }, "最高:", -1)),
439
- e("span", It, a(t.tempsMax[r]) + "°", 1)
440
- ])) : d("", !0),
441
- t.tempsMin && t.tempsMin[r] ? (n(), o("div", te, [
442
- s[6] || (s[6] = e("span", { class: "text-blue-500 font-bold text-sm" }, "最低:", -1)),
443
- e("span", ee, a(t.tempsMin[r]) + "°", 1)
444
- ])) : d("", !0)
445
- ]),
446
- t.pops && t.pops[r] ? (n(), o("div", se, [
447
- e("div", oe, [
448
- s[7] || (s[7] = e("span", { class: "font-semibold text-blue-600" }, "💧 降水確率", -1)),
449
- e("span", ne, a(t.pops[r]) + "%", 1)
450
- ]),
451
- e("div", le, [
452
- e("div", {
453
- class: T(["h-full rounded-full transition-all", D(t.pops[r])]),
454
- style: J({ width: t.pops[r] + "%" })
455
- }, null, 6)
456
- ])
457
- ])) : d("", !0),
458
- t.winds && t.winds[r] ? (n(), o("div", re, [
459
- s[8] || (s[8] = e("span", { class: "font-semibold" }, "🌬️ 風:", -1)),
460
- y(" " + a(t.winds[r]), 1)
461
- ])) : d("", !0),
462
- t.waves && t.waves[r] ? (n(), o("div", ie, [
463
- s[9] || (s[9] = e("span", { class: "font-semibold" }, "🌊 波:", -1)),
464
- y(" " + a(t.waves[r]), 1)
465
- ])) : d("", !0)
466
- ]))), 128))
467
- ]))
468
- ]))), 128))
469
- ], 2))), 128)),
470
- f.value.tempAverage || f.value.precipAverage ? (n(), o("div", ae, [
471
- s[16] || (s[16] = e("h2", { class: "text-2xl font-bold text-gray-800 mb-6 flex items-center gap-2" }, [
472
- e("span", { class: "text-3xl" }, "📊"),
473
- y(" Historical Averages ")
474
- ], -1)),
475
- e("div", de, [
476
- f.value.tempAverage ? (n(), o("div", ue, [
477
- s[12] || (s[12] = e("h3", { class: "font-bold text-orange-700 mb-3 text-lg flex items-center gap-2" }, [
478
- e("span", { class: "text-2xl" }, "🌡️"),
479
- y(" Temperature ")
480
- ], -1)),
481
- (n(!0), o(h, null, b(f.value.tempAverage.areas, (c, l) => (n(), o("div", {
482
- key: l,
483
- class: "text-gray-700 mb-3 last:mb-0"
484
- }, [
485
- e("div", ce, a(c.area.name), 1),
486
- e("div", me, [
487
- c.min ? (n(), o("div", xe, [
488
- s[10] || (s[10] = e("span", { class: "text-blue-600 font-semibold" }, "最低:", -1)),
489
- e("span", pe, a(c.min) + "°C", 1)
490
- ])) : d("", !0),
491
- c.max ? (n(), o("div", ge, [
492
- s[11] || (s[11] = e("span", { class: "text-red-600 font-semibold" }, "最高:", -1)),
493
- e("span", fe, a(c.max) + "°C", 1)
494
- ])) : d("", !0)
495
- ])
496
- ]))), 128))
497
- ])) : d("", !0),
498
- f.value.precipAverage ? (n(), o("div", he, [
499
- s[15] || (s[15] = e("h3", { class: "font-bold text-blue-700 mb-3 text-lg flex items-center gap-2" }, [
500
- e("span", { class: "text-2xl" }, "💧"),
501
- y(" Precipitation ")
502
- ], -1)),
503
- (n(!0), o(h, null, b(f.value.precipAverage.areas, (c, l) => (n(), o("div", {
504
- key: l,
505
- class: "text-gray-700 mb-3 last:mb-0"
506
- }, [
507
- e("div", be, a(c.area.name), 1),
508
- e("div", ye, [
509
- c.min ? (n(), o("div", ve, [
510
- s[13] || (s[13] = e("span", { class: "text-cyan-600 font-semibold" }, "最低:", -1)),
511
- e("span", _e, a(c.min) + "mm", 1)
512
- ])) : d("", !0),
513
- c.max ? (n(), o("div", we, [
514
- s[14] || (s[14] = e("span", { class: "text-blue-600 font-semibold" }, "最高:", -1)),
515
- e("span", ke, a(c.max) + "mm", 1)
516
- ])) : d("", !0)
517
- ])
518
- ]))), 128))
519
- ])) : d("", !0)
520
- ])
521
- ])) : d("", !0)
522
- ])) : (n(), o("div", yt, " No weather data available "))
523
- ])
524
- ]));
525
- }
526
- }), De = { class: "text-center p-4 bg-gradient-to-br from-sky-100 via-blue-100 to-indigo-100 rounded-xl shadow-md hover:shadow-xl transition-all duration-300 hover:scale-105 border-2 border-blue-200" }, Me = { class: "text-xs text-gray-700 font-medium" }, Se = /* @__PURE__ */ F({
527
- __name: "Preview",
528
- props: {
529
- result: {}
530
- },
531
- setup(_) {
532
- return (m, x) => (n(), o("div", De, [
533
- x[0] || (x[0] = e("div", { class: "text-5xl mb-2 drop-shadow-lg" }, "⛅", -1)),
534
- x[1] || (x[1] = e("div", { class: "text-blue-800 font-bold text-sm mb-1" }, "天気予報", -1)),
535
- e("div", Me, a(_.result.data?.areaName || _.result.title), 1)
536
- ]));
537
- }
538
- }), Ne = {
539
- toolDefinition: R,
540
- execute: O,
541
- generatingMessage: "Fetching weather forecast...",
542
- isEnabled: () => !0,
543
- delayAfterExecution: 2e3,
544
- viewComponent: $e,
545
- previewComponent: Se,
546
- systemPrompt: "When fetching weather, you can provide forecasts for Tokyo (130000) and Osaka (270000). Summarize the weather in a natural, conversational way.",
547
- samples: E
548
- }, Pe = { plugin: Ne };
549
- export {
550
- R as TOOL_DEFINITION,
551
- Pe as default,
552
- O as executeWeather,
553
- Ne as plugin
554
- };
192
+ key: 0,
193
+ class: "text-lg font-semibold text-gray-700 mb-4"
194
+ }, ae = { key: 1 }, oe = { class: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-7 gap-4 mb-8" }, se = { class: "text-center mt-3 mb-3" }, ce = { class: "text-sm font-medium text-gray-600" }, le = {
195
+ key: 0,
196
+ class: "text-center mb-3"
197
+ }, ue = { class: "text-6xl mb-2 drop-shadow-lg" }, de = { class: "text-xs text-gray-700 font-medium" }, fe = {
198
+ key: 1,
199
+ class: "text-center mb-3"
200
+ }, pe = { class: "flex items-center justify-center gap-2 mb-1" }, me = { class: "text-3xl" }, he = { class: "text-2xl font-bold text-blue-600" }, ge = { class: "text-center mb-3" }, _e = {
201
+ key: 0,
202
+ class: "text-3xl font-bold text-red-500 mb-1"
203
+ }, ve = {
204
+ key: 1,
205
+ class: "text-xl font-semibold text-blue-500"
206
+ }, ye = {
207
+ key: 2,
208
+ class: "text-2xl font-bold text-orange-500"
209
+ }, be = {
210
+ key: 2,
211
+ class: "text-xs text-gray-600 mb-1 text-center"
212
+ }, xe = {
213
+ key: 3,
214
+ class: "text-xs text-gray-600 text-center"
215
+ }, Se = {
216
+ key: 0,
217
+ class: "bg-white rounded-xl p-6 shadow-lg"
218
+ }, Ce = {
219
+ key: 2,
220
+ class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4"
221
+ }, we = { class: "text-sm font-bold text-blue-700 mb-3" }, Te = {
222
+ key: 0,
223
+ class: "mb-3 flex items-center gap-2"
224
+ }, Ee = { class: "text-4xl drop-shadow" }, De = { class: "text-gray-800 font-medium text-sm" }, Oe = {
225
+ key: 1,
226
+ class: "text-gray-700 mb-2"
227
+ }, ke = { class: "text-2xl font-bold ml-2" }, Ae = { class: "flex gap-3 mb-2" }, je = {
228
+ key: 0,
229
+ class: "flex items-center gap-1"
230
+ }, Me = { class: "text-xl font-bold text-red-600" }, Ne = {
231
+ key: 1,
232
+ class: "flex items-center gap-1"
233
+ }, Pe = { class: "text-xl font-bold text-blue-600" }, Fe = {
234
+ key: 2,
235
+ class: "mb-2"
236
+ }, Ie = { class: "flex items-center justify-between text-sm mb-1" }, Le = { class: "font-bold" }, Re = { class: "w-full bg-gray-200 rounded-full h-2" }, ze = {
237
+ key: 3,
238
+ class: "text-gray-700 text-sm mb-1"
239
+ }, Be = {
240
+ key: 4,
241
+ class: "text-gray-700 text-sm"
242
+ }, Ve = {
243
+ key: 0,
244
+ class: "bg-white rounded-2xl shadow-xl p-6"
245
+ }, He = { class: "grid grid-cols-1 md:grid-cols-2 gap-6" }, Ue = {
246
+ key: 0,
247
+ class: "bg-gradient-to-br from-orange-50 to-red-50 rounded-xl p-5 shadow-md border border-orange-200"
248
+ }, We = { class: "font-semibold text-gray-800 mb-1" }, Ge = { class: "flex gap-3" }, Ke = {
249
+ key: 0,
250
+ class: "flex items-center gap-1"
251
+ }, qe = { class: "text-xl font-bold text-blue-700" }, Je = {
252
+ key: 1,
253
+ class: "flex items-center gap-1"
254
+ }, Ye = { class: "text-xl font-bold text-red-700" }, Q = {
255
+ key: 1,
256
+ class: "bg-gradient-to-br from-blue-50 to-cyan-50 rounded-xl p-5 shadow-md border border-blue-200"
257
+ }, Xe = { class: "font-semibold text-gray-800 mb-1" }, Ze = { class: "flex gap-3" }, Qe = {
258
+ key: 0,
259
+ class: "flex items-center gap-1"
260
+ }, $e = { class: "text-xl font-bold text-cyan-700" }, et = {
261
+ key: 1,
262
+ class: "flex items-center gap-1"
263
+ }, tt = { class: "text-xl font-bold text-blue-700" }, nt = /* @__PURE__ */ u({
264
+ __name: "View",
265
+ props: {
266
+ selectedResult: {},
267
+ sendTextMessage: { type: Function }
268
+ },
269
+ setup(e) {
270
+ let t = e, n = i(() => t.selectedResult?.data?.areaName || "Unknown Area"), u = i(() => t.selectedResult?.data?.publishingOffice || ""), g = i(() => t.selectedResult?.data?.reportDatetime || ""), _ = i(() => t.selectedResult?.jsonData || null), v = i(() => g.value ? new Date(g.value).toLocaleString("ja-JP", {
271
+ year: "numeric",
272
+ month: "long",
273
+ day: "numeric",
274
+ hour: "2-digit",
275
+ minute: "2-digit"
276
+ }) : "");
277
+ function y(e) {
278
+ let t = new Date(e), n = /* @__PURE__ */ new Date(), r = new Date(n);
279
+ r.setDate(r.getDate() + 1);
280
+ let i = t.toLocaleDateString("ja-JP", {
281
+ month: "short",
282
+ day: "numeric"
283
+ }), a = t.toLocaleTimeString("ja-JP", {
284
+ hour: "2-digit",
285
+ minute: "2-digit"
286
+ });
287
+ return t.toDateString() === n.toDateString() ? `Today ${a}` : t.toDateString() === r.toDateString() ? `Tomorrow ${a}` : `${i} ${a}`;
288
+ }
289
+ function b(e) {
290
+ return [
291
+ "日",
292
+ "",
293
+ "",
294
+ "水",
295
+ "",
296
+ "金",
297
+ ""
298
+ ][new Date(e).getDay()] ?? "";
299
+ }
300
+ function x(e) {
301
+ let t = typeof e == "string" ? parseInt(e) : e;
302
+ return t >= 70 ? "bg-gradient-to-r from-blue-500 to-blue-600" : t >= 50 ? "bg-gradient-to-r from-blue-400 to-blue-500" : t >= 30 ? "bg-gradient-to-r from-cyan-400 to-blue-400" : t >= 10 ? "bg-gradient-to-r from-cyan-300 to-cyan-400" : "bg-gradient-to-r from-gray-300 to-gray-400";
303
+ }
304
+ function S(e) {
305
+ return [
306
+ "Current Forecast",
307
+ "Extended Forecast",
308
+ "Weekly Forecast"
309
+ ][e] || `Forecast ${e + 1}`;
310
+ }
311
+ function C(e) {
312
+ if (!e) return "🌤️";
313
+ let t = e.toLowerCase();
314
+ return t.includes("晴") || t.includes("sunny") || t.includes("clear") ? "☀️" : t.includes("曇") || t.includes("cloudy") ? "☁️" : t.includes("雨") || t.includes("rain") ? "🌧️" : t.includes("雪") || t.includes("snow") ? "❄️" : t.includes("雷") || t.includes("thunder") ? "⛈️" : t.includes("霧") || t.includes("fog") ? "🌫️" : "🌤️";
315
+ }
316
+ function w(e) {
317
+ let t = typeof e == "string" ? parseInt(e) : e;
318
+ return t >= 50 ? "☔" : t >= 30 ? "🌂" : t >= 10 ? "☁️" : "☀️";
319
+ }
320
+ function T(e) {
321
+ return !!(e.tempsMax || e.tempsMin || e.temps);
322
+ }
323
+ return (e, t) => (p(), o("div", z, [s("div", B, [s("div", V, [s("div", H, [s("div", null, [s("h1", U, h(n.value), 1), s("div", W, [u.value ? (p(), o("div", G, h(u.value), 1)) : a("", !0), g.value ? (p(), o("div", K, h(v.value), 1)) : a("", !0)])]), t[0] ||= s("div", { class: "text-8xl drop-shadow-lg" }, "⛅", -1)])]), _.value ? (p(), o("div", J, [(p(!0), o(r, null, m(_.value.timeSeries, (e, n) => (p(), o("div", {
324
+ key: n,
325
+ class: d(["rounded-2xl shadow-xl p-6", n === 1 ? "bg-gradient-to-br from-orange-50 via-pink-50 to-purple-50" : n === 2 ? "bg-gradient-to-br from-green-50 via-teal-50 to-cyan-50" : "bg-white"])
326
+ }, [s("h2", { class: d(["text-2xl font-bold mb-6 flex items-center gap-2", n === 1 ? "text-purple-800" : n === 2 ? "text-teal-800" : "text-gray-800"]) }, [n === 1 ? (p(), o("span", Y, "📅")) : n === 2 ? (p(), o("span", X, "📊")) : n === 0 ? (p(), o("span", Z, "🌤️")) : (p(), o("span", re, "📋")), c(" " + h(S(n)), 1)], 2), (p(!0), o(r, null, m(e.areas, (i, u) => (p(), o("div", {
327
+ key: u,
328
+ class: "mb-6 last:mb-0"
329
+ }, [e.areas.length > 1 ? (p(), o("h3", ie, h(i.area.name), 1)) : a("", !0), n === 1 || n === 2 ? (p(), o("div", ae, [s("div", oe, [(p(!0), o(r, null, m(e.timeDefines, (e, r) => (p(), o("div", {
330
+ key: r,
331
+ class: d(["relative bg-white rounded-xl p-5 shadow-lg hover:shadow-2xl transition-all duration-300 hover:scale-105 border-2 border-transparent", n === 1 ? "hover:border-purple-300" : "hover:border-teal-300"])
332
+ }, [
333
+ s("div", { class: d(["absolute -top-3 left-1/2 transform -translate-x-1/2 text-white px-4 py-1 rounded-full text-xs font-bold shadow-md", n === 1 ? "bg-gradient-to-r from-purple-500 to-pink-500" : "bg-gradient-to-r from-teal-500 to-cyan-500"]) }, h(b(e)), 3),
334
+ s("div", se, [s("div", ce, h(y(e)), 1)]),
335
+ i.weathers && i.weathers[r] ? (p(), o("div", le, [s("div", ue, h(C(i.weathers[r])), 1), s("div", de, h(i.weathers[r]), 1)])) : a("", !0),
336
+ i.pops && i.pops[r] ? (p(), o("div", fe, [s("div", pe, [s("span", me, h(w(i.pops[r])), 1), s("span", he, h(i.pops[r]) + "%", 1)])])) : a("", !0),
337
+ s("div", ge, [
338
+ i.tempsMax && i.tempsMax[r] ? (p(), o("div", _e, h(i.tempsMax[r]) + "° ", 1)) : a("", !0),
339
+ i.tempsMin && i.tempsMin[r] ? (p(), o("div", ve, h(i.tempsMin[r]) + "° ", 1)) : a("", !0),
340
+ i.temps && i.temps[r] ? (p(), o("div", ye, h(i.temps[r]) + "° ", 1)) : a("", !0)
341
+ ]),
342
+ i.winds && i.winds[r] ? (p(), o("div", be, [t[1] ||= s("span", { class: "mr-1" }, "🌬️", -1), c(" " + h(i.winds[r]), 1)])) : a("", !0),
343
+ i.waves && i.waves[r] ? (p(), o("div", xe, [t[2] ||= s("span", { class: "mr-1" }, "🌊", -1), c(" " + h(i.waves[r]), 1)])) : a("", !0)
344
+ ], 2))), 128))]), T(i) ? (p(), o("div", Se, [t[3] ||= s("h3", { class: "text-lg font-bold text-gray-800 mb-4 flex items-center gap-2" }, [s("span", { class: "text-2xl" }, "📈"), c(" 気温の推移 ")], -1), l(R, {
345
+ times: e.timeDefines,
346
+ tempsMax: i.tempsMax,
347
+ tempsMin: i.tempsMin,
348
+ temps: i.temps
349
+ }, null, 8, [
350
+ "times",
351
+ "tempsMax",
352
+ "tempsMin",
353
+ "temps"
354
+ ])])) : a("", !0)])) : (p(), o("div", Ce, [(p(!0), o(r, null, m(e.timeDefines, (e, n) => (p(), o("div", {
355
+ key: n,
356
+ class: "bg-gradient-to-br from-blue-50 to-cyan-50 rounded-xl p-5 shadow-md hover:shadow-xl transition-all duration-300 border border-blue-100"
357
+ }, [
358
+ s("div", we, h(y(e)), 1),
359
+ i.weathers && i.weathers[n] ? (p(), o("div", Te, [s("span", Ee, h(C(i.weathers[n])), 1), s("span", De, h(i.weathers[n]), 1)])) : a("", !0),
360
+ i.temps && i.temps[n] ? (p(), o("div", Oe, [t[4] ||= s("span", { class: "font-semibold text-orange-600" }, "気温:", -1), s("span", ke, h(i.temps[n]) + "°C", 1)])) : a("", !0),
361
+ s("div", Ae, [i.tempsMax && i.tempsMax[n] ? (p(), o("div", je, [t[5] ||= s("span", { class: "text-red-500 font-bold text-sm" }, "最高:", -1), s("span", Me, h(i.tempsMax[n]) + "°", 1)])) : a("", !0), i.tempsMin && i.tempsMin[n] ? (p(), o("div", Ne, [t[6] ||= s("span", { class: "text-blue-500 font-bold text-sm" }, "最低:", -1), s("span", Pe, h(i.tempsMin[n]) + "°", 1)])) : a("", !0)]),
362
+ i.pops && i.pops[n] ? (p(), o("div", Fe, [s("div", Ie, [t[7] ||= s("span", { class: "font-semibold text-blue-600" }, "💧 降水確率", -1), s("span", Le, h(i.pops[n]) + "%", 1)]), s("div", Re, [s("div", {
363
+ class: d(["h-full rounded-full transition-all", x(i.pops[n])]),
364
+ style: f({ width: i.pops[n] + "%" })
365
+ }, null, 6)])])) : a("", !0),
366
+ i.winds && i.winds[n] ? (p(), o("div", ze, [t[8] ||= s("span", { class: "font-semibold" }, "🌬️ 風:", -1), c(" " + h(i.winds[n]), 1)])) : a("", !0),
367
+ i.waves && i.waves[n] ? (p(), o("div", Be, [t[9] ||= s("span", { class: "font-semibold" }, "🌊 波:", -1), c(" " + h(i.waves[n]), 1)])) : a("", !0)
368
+ ]))), 128))]))]))), 128))], 2))), 128)), _.value.tempAverage || _.value.precipAverage ? (p(), o("div", Ve, [t[16] ||= s("h2", { class: "text-2xl font-bold text-gray-800 mb-6 flex items-center gap-2" }, [s("span", { class: "text-3xl" }, "📊"), c(" Historical Averages ")], -1), s("div", He, [_.value.tempAverage ? (p(), o("div", Ue, [t[12] ||= s("h3", { class: "font-bold text-orange-700 mb-3 text-lg flex items-center gap-2" }, [s("span", { class: "text-2xl" }, "🌡️"), c(" Temperature ")], -1), (p(!0), o(r, null, m(_.value.tempAverage.areas, (e, n) => (p(), o("div", {
369
+ key: n,
370
+ class: "text-gray-700 mb-3 last:mb-0"
371
+ }, [s("div", We, h(e.area.name), 1), s("div", Ge, [e.min ? (p(), o("div", Ke, [t[10] ||= s("span", { class: "text-blue-600 font-semibold" }, "最低:", -1), s("span", qe, h(e.min) + "°C", 1)])) : a("", !0), e.max ? (p(), o("div", Je, [t[11] ||= s("span", { class: "text-red-600 font-semibold" }, "最高:", -1), s("span", Ye, h(e.max) + "°C", 1)])) : a("", !0)])]))), 128))])) : a("", !0), _.value.precipAverage ? (p(), o("div", Q, [t[15] ||= s("h3", { class: "font-bold text-blue-700 mb-3 text-lg flex items-center gap-2" }, [s("span", { class: "text-2xl" }, "💧"), c(" Precipitation ")], -1), (p(!0), o(r, null, m(_.value.precipAverage.areas, (e, n) => (p(), o("div", {
372
+ key: n,
373
+ class: "text-gray-700 mb-3 last:mb-0"
374
+ }, [s("div", Xe, h(e.area.name), 1), s("div", Ze, [e.min ? (p(), o("div", Qe, [t[13] ||= s("span", { class: "text-cyan-600 font-semibold" }, "最低:", -1), s("span", $e, h(e.min) + "mm", 1)])) : a("", !0), e.max ? (p(), o("div", et, [t[14] ||= s("span", { class: "text-blue-600 font-semibold" }, "最高:", -1), s("span", tt, h(e.max) + "mm", 1)])) : a("", !0)])]))), 128))])) : a("", !0)])])) : a("", !0)])) : (p(), o("div", q, " No weather data available "))])]));
375
+ }
376
+ }), rt = { class: "text-center p-4 bg-gradient-to-br from-sky-100 via-blue-100 to-indigo-100 rounded-xl shadow-md hover:shadow-xl transition-all duration-300 hover:scale-105 border-2 border-blue-200" }, it = { class: "text-xs text-gray-700 font-medium" }, $ = {
377
+ toolDefinition: t,
378
+ execute: e,
379
+ generatingMessage: "Fetching weather forecast...",
380
+ isEnabled: () => !0,
381
+ delayAfterExecution: 2e3,
382
+ viewComponent: nt,
383
+ previewComponent: /* @__PURE__ */ u({
384
+ __name: "Preview",
385
+ props: { result: {} },
386
+ setup(e) {
387
+ return (t, n) => (p(), o("div", rt, [
388
+ n[0] ||= s("div", { class: "text-5xl mb-2 drop-shadow-lg" }, "⛅", -1),
389
+ n[1] ||= s("div", { class: "text-blue-800 font-bold text-sm mb-1" }, "天気予報", -1),
390
+ s("div", it, h(e.result.data?.areaName || e.result.title), 1)
391
+ ]));
392
+ }
393
+ }),
394
+ systemPrompt: "When fetching weather, you can provide forecasts for Tokyo (130000) and Osaka (270000). Summarize the weather in a natural, conversational way.",
395
+ samples: n
396
+ }, at = { plugin: $ };
397
+ //#endregion
398
+ export { t as TOOL_DEFINITION, at as default, e as executeWeather, $ as plugin };