@feedmepos/mf-report 5.34.2 → 5.35.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.
Files changed (39) hide show
  1. package/dist/{App-D-YQ3yMW.js → App-Dv36-JBr.js} +4 -4
  2. package/dist/{DateRangeSelect-OTyc3v5_.js → DateRangeSelect-CSuWTBDR.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-CxIN_bfu.js → Default.vue_vue_type_script_setup_true_lang-BFuav3fL.js} +1 -1
  4. package/dist/{DigestListView-DCpIQY1v.js → DigestListView-lWXR-Yqe.js} +3 -3
  5. package/dist/DigestReaderView-cKRrj4qw.js +489 -0
  6. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-iRcCryhy.js → DynamicWidget.vue_vue_type_script_setup_true_lang-D0OTyDep.js} +173 -173
  7. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-VTI9bq-3.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-lFm4G3pA.js} +175 -175
  8. package/dist/{InsightView-WQ3IXr2b.js → InsightView-BO2y0s6E.js} +5 -5
  9. package/dist/{Integration-Bx6Xt8rm.js → Integration-DZR0sg3Y.js} +3 -3
  10. package/dist/{Integrations-BSsJGc4e.js → Integrations-C8IJSs8_.js} +2 -2
  11. package/dist/{Layout-CmTYhuDW.js → Layout-DKE_UPyV.js} +1 -1
  12. package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-SjaEdhpI.js → LocationSelect.vue_vue_type_script_setup_true_lang-pKBQdsry.js} +1553 -1547
  13. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-CtJRTkuw.js → MenuTab.vue_vue_type_script_setup_true_lang-DsTCV4je.js} +5 -5
  14. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-DERX_GCc.js → NavigationTab.vue_vue_type_script_setup_true_lang-uFKb4Unh.js} +5 -5
  15. package/dist/{OverviewView-BXuqus0r.js → OverviewView--6juk8Ny.js} +5 -5
  16. package/dist/{Report-Cj7xHOMI.js → Report-B7tYzV-u.js} +3 -3
  17. package/dist/ReportCanvasView-DJZItxK4.js +1066 -0
  18. package/dist/{ReportEditor-v3CRHflb.js → ReportEditor-lP1wy7eF.js} +7 -7
  19. package/dist/{ReportView-IbQC8Qf1.js → ReportView-BFdf3j2m.js} +6 -6
  20. package/dist/{ReportViewRoute-NwvXWZDf.js → ReportViewRoute-D5tZcb3A.js} +2 -2
  21. package/dist/{Setting-GyFSTgFs.js → Setting-CdOGOX1H.js} +94 -94
  22. package/dist/{Template-DLVGn41O.js → Template-CcNz2aVR.js} +3 -3
  23. package/dist/{TileEditor-DT4ayXKN.js → TileEditor-D8QsUytE.js} +6 -6
  24. package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-Bh0NcO-n.js → TilePageStack.vue_vue_type_script_setup_true_lang-D2Tz0EW3.js} +2 -2
  25. package/dist/{TransitionFade-DIDahT3W.js → TransitionFade-qKsTOksI.js} +5 -5
  26. package/dist/{app-X-tKojve.js → app-D9WJwZyu.js} +19 -19
  27. package/dist/app.js +1 -1
  28. package/dist/assets/{formatChartData.worker-Cpgnh20a.js → formatChartData.worker-Bt8turfo.js} +22 -22
  29. package/dist/assets/{processTableData.worker-B7I6PElJ.js → processTableData.worker-MGb36f8J.js} +22 -22
  30. package/dist/{currency-Cebf4JT_.js → currency-Dx3wVA1Q.js} +1 -1
  31. package/dist/{index-Brvkpnxl.js → index-c2QQydke.js} +503 -473
  32. package/dist/{report-CoK9Yl1E.js → report-tffVXl4d.js} +1 -1
  33. package/dist/style.css +1 -1
  34. package/dist/{useDigestFont-DUUhWR6u.js → useDigestFont-DfORxCFz.js} +1 -1
  35. package/dist/{useReportCanvasPanel-B8qruqY0.js → useReportCanvasPicks-D1IdA31H.js} +1353 -1264
  36. package/dist/{useRestaurantPermission-BTBg_goI.js → useRestaurantPermission-CrqMkVed.js} +1 -1
  37. package/package.json +2 -2
  38. package/dist/DigestReaderView-W6sW8h9Q.js +0 -526
  39. package/dist/ReportCanvasView-CGt4ayU2.js +0 -1035
@@ -1,1035 +0,0 @@
1
- import { defineComponent as ut, ref as d, computed as _, watch as $e, onMounted as dt, onBeforeUnmount as He, resolveComponent as se, openBlock as s, createElementBlock as p, createElementVNode as r, createVNode as D, toDisplayString as c, createCommentVNode as x, Fragment as Pe, renderList as Ne, normalizeClass as Ue, createBlock as ne, nextTick as qe, unref as a, withCtx as fe, isRef as lt, withDirectives as ea, vShow as ta, withKeys as aa, withModifiers as oa } from "vue";
2
- import { useRoute as ra, useRouter as na } from "vue-router";
3
- import { u as ct, _ as vt } from "./_plugin-vue_export-helper-Bx7s49ra.js";
4
- import { storeToRefs as je } from "pinia";
5
- import { useSnackbar as sa } from "@feedmepos/ui-library";
6
- import { g as la, r as ia, f as ua, h as da, u as ca, c as va, b as ma, a as fa, R as pa, e as ya, p as ba, i as ha, j as ga, k as it, l as wa } from "./useReportCanvasPanel-B8qruqY0.js";
7
- import { _ as ka } from "./LocationSelect.vue_vue_type_script_setup_true_lang-SjaEdhpI.js";
8
- import { D as _a } from "./DateRangeSelect-OTyc3v5_.js";
9
- import { a as mt, j as xa } from "./app-X-tKojve.js";
10
- import { u as Ca } from "./report-CoK9Yl1E.js";
11
- import { u as Sa } from "./global-loader-BuxFfehu.js";
12
- import { r as Ra } from "./i18n-DbyciK4x.js";
13
- const Va = ["aria-label"], Aa = { class: "flex h-64 shrink-0 items-center gap-12 border-b border-fm-color-border-secondary px-[20px]" }, $a = { class: "fm-typo-en-body-md-600 grow" }, Ea = ["aria-label", "disabled"], Fa = { class: "min-h-0 grow overflow-y-auto px-[20px] py-[20px]" }, Da = { class: "fm-typo-en-body-md-400 mb-[20px] text-fm-color-typo-secondary" }, Ia = { class: "mb-24 rounded-[12px] border border-fm-color-border-secondary p-16" }, Ta = { class: "mb-8 flex items-center gap-8" }, Oa = { class: "fm-typo-en-body-md-600 grow" }, Ba = { class: "fm-typo-en-body-sm-600 rounded-md bg-fm-color-neutral-gray-100 px-8 py-4" }, La = {
14
- key: 0,
15
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
16
- }, za = ["aria-label"], Pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Na = {
17
- key: 1,
18
- role: "alert",
19
- class: "rounded-[12px] border border-fm-color-border-secondary p-[20px]"
20
- }, Ua = { class: "fm-typo-en-body-md-600 mb-8" }, qa = { class: "fm-typo-en-body-md-400 mb-16 text-fm-color-typo-secondary" }, ja = {
21
- key: 2,
22
- class: "flex flex-col items-center rounded-[12px] bg-fm-color-neutral-gray-50 px-16 py-32 text-center"
23
- }, Ha = { class: "fm-typo-en-body-md-600 mb-8" }, Ma = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ka = { class: "fm-typo-en-body-sm-600 mb-12 text-fm-color-typo-secondary" }, Ja = { class: "ml-4 border-l border-fm-color-border-secondary pl-16" }, Wa = ["aria-expanded", "aria-controls", "aria-current", "disabled", "onClick"], Za = { class: "mb-4 flex items-center gap-8" }, Ga = ["datetime", "title"], Qa = {
24
- key: 0,
25
- "data-testid": "canvas-version-current",
26
- class: "fm-typo-en-body-sm-600 rounded-md bg-fm-color-neutral-gray-100 px-8 py-4 text-fm-color-typo-secondary"
27
- }, Xa = {
28
- key: 0,
29
- class: "fm-typo-en-body-md-600 block break-words text-fm-color-typo-secondary"
30
- }, Ya = { class: "fm-typo-en-body-md-400 line-clamp-3 block break-words" }, eo = {
31
- "data-testid": "canvas-version-author",
32
- class: "mt-8 flex items-center gap-8 text-fm-color-typo-secondary"
33
- }, to = { class: "fm-typo-en-body-sm-400 line-clamp-1 break-words" }, ao = { class: "shrink-0 border-t border-fm-color-border-secondary p-[20px]" }, oo = { class: "fm-typo-en-body-sm-400 mb-4 text-fm-color-typo-secondary" }, ro = { class: "fm-typo-en-body-md-400 mb-16 max-h-[120px] overflow-y-auto whitespace-pre-wrap break-words" }, no = {
34
- key: 0,
35
- role: "alert",
36
- class: "fm-typo-en-body-md-400 mb-12 text-fm-color-typo-error"
37
- }, so = {
38
- key: 1,
39
- class: "fm-typo-en-body-md-400 mb-12 text-fm-color-typo-secondary"
40
- }, lo = {
41
- key: 2,
42
- class: "flex items-center justify-end gap-8"
43
- }, io = ["disabled"], uo = {
44
- key: 1,
45
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
46
- }, co = { class: "fm-typo-en-body-sm-400 mt-12 text-fm-color-typo-secondary" }, vo = /* @__PURE__ */ ut({
47
- __name: "ReportCanvasHistory",
48
- props: {
49
- reportId: {},
50
- publishedAt: {},
51
- timezone: {},
52
- hasDraft: { type: Boolean },
53
- busy: { type: Boolean }
54
- },
55
- emits: ["close", "restored", "restoring"],
56
- setup(A, { emit: le }) {
57
- const U = A, K = le, { t: m, locale: C } = ct(), l = (o, n = {}) => m(`reportV5.reportCanvas.history.${o}`, n), E = d([]), I = d(!0), Z = d(!1), te = d(!1), v = d(!1), i = d(!1), T = d(), ie = d(), ae = d(), q = d(), z = _(() => E.value.find((o) => o.id === T.value)), w = _(() => U.hasDraft || U.busy || v.value);
58
- let j = !0, G = null;
59
- function ue(o, n) {
60
- const V = new Date(o);
61
- return Number.isFinite(V.getTime()) ? new Intl.DateTimeFormat(C.value, { ...n, timeZone: U.timezone }).format(
62
- V
63
- ) : l("unknownDate");
64
- }
65
- const de = (o) => ue(o, { dateStyle: "medium", timeStyle: "short" }), f = (o) => ue(o, { hour: "numeric", minute: "2-digit", second: "2-digit" }), b = (o) => ue(o, { year: "numeric", month: "2-digit", day: "2-digit" });
66
- function R(o) {
67
- return b(o) === b((/* @__PURE__ */ new Date()).toISOString()) ? l("today") : ue(o, { month: "long", day: "numeric", year: "numeric" });
68
- }
69
- const O = _(() => {
70
- const o = [];
71
- for (const n of [...E.value].sort((V, H) => Date.parse(H.at) - Date.parse(V.at))) {
72
- const V = b(n.at), H = o.find((ge) => ge.key === V);
73
- H ? H.versions.push(n) : o.push({ key: V, label: R(n.at), versions: [n] });
74
- }
75
- return o;
76
- }), P = (o) => {
77
- var n;
78
- return o.id === ((n = E.value[0]) == null ? void 0 : n.id);
79
- }, Q = (o) => o.prompt.trim() || l("noPrompt"), J = (o) => o.restoredFrom ? l("restoredFrom", { at: de(o.restoredFrom) }) : "", ve = (o) => [J(o), Q(o)].filter(Boolean).join(" "), Ce = (o) => {
80
- var n, V;
81
- return ((n = o.author) == null ? void 0 : n.name) || ((V = o.author) == null ? void 0 : V.email) || l("unknownUser");
82
- };
83
- async function he() {
84
- I.value = !0, Z.value = !1;
85
- try {
86
- const o = await la(U.reportId);
87
- j && (E.value = o);
88
- } catch {
89
- j && (Z.value = !0);
90
- } finally {
91
- j && (I.value = !1);
92
- }
93
- }
94
- function X(o) {
95
- v.value || P(o) || (T.value = T.value === o.id ? void 0 : o.id, i.value = !1, te.value = !1);
96
- }
97
- async function Se() {
98
- var o;
99
- !z.value || w.value || (i.value = !0, await qe(), (o = ae.value) == null || o.focus());
100
- }
101
- async function S() {
102
- var o;
103
- i.value = !1, te.value = !1, await qe(), (o = q.value) == null || o.focus();
104
- }
105
- async function oe() {
106
- if (!(!z.value || w.value || !i.value)) {
107
- v.value = !0, K("restoring", !0), te.value = !1;
108
- try {
109
- const o = await ia(U.reportId, z.value.id);
110
- j && K("restored", o);
111
- } catch {
112
- j && (te.value = !0);
113
- } finally {
114
- v.value = !1, K("restoring", !1);
115
- }
116
- }
117
- }
118
- function pe(o) {
119
- o.key === "Escape" && (o.stopPropagation(), !v.value && (i.value ? S() : K("close")));
120
- }
121
- return $e(w, (o) => {
122
- o && !v.value && (i.value = !1);
123
- }), dt(() => {
124
- var o;
125
- G = document.activeElement, (o = ie.value) == null || o.focus(), he();
126
- }), He(() => {
127
- j = !1, G == null || G.focus();
128
- }), (o, n) => {
129
- const V = se("FmIcon"), H = se("FmButton"), ge = se("FmAvatar");
130
- return s(), p("aside", {
131
- "data-testid": "canvas-versions",
132
- class: "flex h-full min-h-0 flex-col border-l border-fm-color-border-secondary bg-fm-color-neutral-white text-fm-color-typo-primary",
133
- "aria-label": l("title"),
134
- onKeydown: pe
135
- }, [
136
- r("header", Aa, [
137
- D(V, {
138
- name: "history",
139
- size: "md",
140
- class: "text-fm-color-typo-secondary"
141
- }),
142
- r("h2", $a, c(l("title")), 1),
143
- r("button", {
144
- ref_key: "closeButton",
145
- ref: ie,
146
- "data-testid": "canvas-versions-close",
147
- class: "history-button flex h-[36px] w-[36px] items-center justify-center rounded-md text-fm-color-typo-secondary",
148
- "aria-label": l("close"),
149
- disabled: v.value,
150
- onClick: n[0] || (n[0] = (W) => K("close"))
151
- }, [
152
- D(V, {
153
- name: "close",
154
- size: "md"
155
- })
156
- ], 8, Ea)
157
- ]),
158
- r("div", Fa, [
159
- r("p", Da, c(l("intro")), 1),
160
- r("div", Ia, [
161
- r("div", Ta, [
162
- n[1] || (n[1] = r("span", {
163
- class: "h-8 w-8 rounded-full bg-fm-color-primary",
164
- "aria-hidden": "true"
165
- }, null, -1)),
166
- r("span", Oa, c(l("current")), 1),
167
- r("span", Ba, c(l("published")), 1)
168
- ]),
169
- A.publishedAt ? (s(), p("p", La, c(de(A.publishedAt)), 1)) : x("", !0)
170
- ]),
171
- I.value ? (s(), p("div", {
172
- key: 0,
173
- role: "status",
174
- class: "space-y-16",
175
- "aria-label": l("loading")
176
- }, [
177
- r("p", Pa, c(l("loading")), 1),
178
- (s(), p(Pe, null, Ne(3, (W) => r("div", {
179
- key: W,
180
- class: "rounded-lg border border-fm-color-border-secondary p-16",
181
- "aria-hidden": "true"
182
- }, [...n[2] || (n[2] = [
183
- r("div", { class: "mb-12 h-12 w-1/3 rounded bg-fm-color-neutral-gray-100" }, null, -1),
184
- r("div", { class: "h-12 w-3/4 rounded bg-fm-color-neutral-gray-100" }, null, -1)
185
- ])])), 64))
186
- ], 8, za)) : Z.value ? (s(), p("div", Na, [
187
- r("p", Ua, c(l("loadFailed")), 1),
188
- r("p", qa, c(l("loadFailedHint")), 1),
189
- D(H, {
190
- variant: "secondary",
191
- label: l("retry"),
192
- onClick: he
193
- }, null, 8, ["label"])
194
- ])) : E.value.length ? x("", !0) : (s(), p("div", ja, [
195
- D(V, {
196
- name: "history",
197
- size: "lg",
198
- class: "mb-12 text-fm-color-typo-secondary"
199
- }),
200
- r("p", Ha, c(l("empty")), 1),
201
- r("p", Ma, c(l("emptyHint")), 1)
202
- ])),
203
- (s(!0), p(Pe, null, Ne(I.value || Z.value ? [] : O.value, (W) => (s(), p("section", {
204
- key: W.key,
205
- class: "mb-[20px]"
206
- }, [
207
- r("h3", Ka, c(W.label), 1),
208
- r("ul", Ja, [
209
- (s(!0), p(Pe, null, Ne(W.versions, (h) => {
210
- var ye, we, Re;
211
- return s(), p("li", {
212
- key: h.id,
213
- "data-testid": "canvas-version-row",
214
- class: "relative mb-8"
215
- }, [
216
- n[3] || (n[3] = r("span", {
217
- class: "history-dot absolute top-[20px] h-8 w-8 rounded-full border border-fm-color-border-secondary bg-fm-color-neutral-white",
218
- "aria-hidden": "true"
219
- }, null, -1)),
220
- r("button", {
221
- class: Ue([
222
- "history-button w-full rounded-lg border p-12 text-left",
223
- T.value === h.id ? "border-fm-color-primary bg-fm-color-primary-50" : "border-transparent"
224
- ]),
225
- "aria-expanded": T.value === h.id,
226
- "aria-controls": T.value === h.id ? "canvas-version-details" : void 0,
227
- "aria-current": P(h) ? "true" : void 0,
228
- disabled: v.value || P(h),
229
- onClick: (Ee) => X(h)
230
- }, [
231
- r("span", Za, [
232
- r("time", {
233
- datetime: h.at,
234
- title: de(h.at),
235
- class: "fm-typo-en-body-sm-400 grow text-fm-color-typo-secondary"
236
- }, c(f(h.at)), 9, Ga),
237
- P(h) ? (s(), p("span", Qa, c(l("currentBadge")), 1)) : T.value === h.id ? (s(), ne(V, {
238
- key: 1,
239
- name: "check",
240
- size: "sm",
241
- class: "text-fm-color-primary"
242
- })) : x("", !0)
243
- ]),
244
- J(h) ? (s(), p("span", Xa, c(J(h)), 1)) : x("", !0),
245
- r("span", Ya, c(Q(h)), 1),
246
- r("span", eo, [
247
- D(ge, {
248
- size: "sm",
249
- name: ((ye = h.author) == null ? void 0 : ye.name) || ((we = h.author) == null ? void 0 : we.email) || "?",
250
- src: (Re = h.author) == null ? void 0 : Re.photoUrl
251
- }, null, 8, ["name", "src"]),
252
- r("span", to, c(Ce(h)), 1)
253
- ])
254
- ], 10, Wa)
255
- ]);
256
- }), 128))
257
- ])
258
- ]))), 128))
259
- ]),
260
- r("footer", ao, [
261
- z.value ? (s(), p("div", {
262
- key: 0,
263
- id: "canvas-version-details",
264
- ref_key: "details",
265
- ref: q,
266
- tabindex: "-1",
267
- class: "history-details"
268
- }, [
269
- r("p", oo, c(l("savedBy", { user: Ce(z.value), at: de(z.value.at) })), 1),
270
- r("p", ro, c(i.value ? l("confirmHint") : ve(z.value)), 1),
271
- te.value ? (s(), p("p", no, c(l("restoreFailed")), 1)) : x("", !0),
272
- A.hasDraft || A.busy ? (s(), p("p", so, c(l(A.hasDraft ? "draftHint" : "busyHint")), 1)) : x("", !0),
273
- i.value ? (s(), p("div", lo, [
274
- r("button", {
275
- ref_key: "cancelButton",
276
- ref: ae,
277
- class: "history-button fm-typo-en-body-md-600 rounded-lg px-16 py-12",
278
- disabled: v.value,
279
- onClick: S
280
- }, c(l("cancel")), 9, io),
281
- D(H, {
282
- "data-testid": "canvas-version-confirm",
283
- variant: "primary",
284
- label: l(v.value ? "restoring" : "confirm"),
285
- disabled: w.value,
286
- onClick: oe
287
- }, null, 8, ["label", "disabled"])
288
- ])) : (s(), ne(H, {
289
- key: 3,
290
- "data-testid": "canvas-version-restore",
291
- class: "w-full",
292
- variant: "primary",
293
- "prepend-icon": "restore",
294
- label: l("restore"),
295
- disabled: w.value,
296
- onClick: Se
297
- }, null, 8, ["label", "disabled"]))
298
- ], 512)) : (s(), p("p", uo, c(l("selectHint")), 1)),
299
- r("p", co, c(l("timezone", { timezone: A.timezone })), 1)
300
- ])
301
- ], 40, Va);
302
- };
303
- }
304
- }), mo = /* @__PURE__ */ vt(vo, [["__scopeId", "data-v-7df5ac71"]]), fo = 2e3, po = 10 * 6e4;
305
- function yo(A, le, U, K) {
306
- const { timezone: m } = je(mt()), C = d(null), l = d(null), E = d(!1), I = d(""), Z = [];
307
- function te(f) {
308
- Z.push(f);
309
- }
310
- let v;
311
- function i() {
312
- v !== void 0 && (window.clearInterval(v), v = void 0);
313
- }
314
- function T() {
315
- var f;
316
- v !== void 0 || le.value || ((f = C.value) == null ? void 0 : f.status) === "running" && (v = window.setInterval(() => void ie(), fo));
317
- }
318
- async function ie() {
319
- var f;
320
- if (le.value) {
321
- i();
322
- return;
323
- }
324
- try {
325
- const { run: b } = await da(A, K == null ? void 0 : K.value);
326
- b && ae(b), ((f = C.value) == null ? void 0 : f.status) !== "running" ? i() : C.value.updatedAt && Date.now() - new Date(C.value.updatedAt).getTime() > po && (E.value = !0, i());
327
- } catch {
328
- }
329
- }
330
- function ae(f, b) {
331
- b !== void 0 && (l.value = b);
332
- const R = f.sections.some((O) => {
333
- var Q;
334
- const P = (Q = C.value) == null ? void 0 : Q.sections.find((J) => J.id === O.id);
335
- return O.status === "ok" && (P == null ? void 0 : P.status) !== "ok";
336
- });
337
- C.value = f, E.value = !1, R && Z.forEach((O) => O()), T();
338
- }
339
- function q(f) {
340
- var R;
341
- if (f.name !== "build_run") return;
342
- const b = f.data;
343
- Array.isArray(b.sections) && ae(
344
- {
345
- runId: b.runId ? String(b.runId) : void 0,
346
- status: b.status ?? "running",
347
- sections: b.sections,
348
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
349
- },
350
- // first snapshot of this turn claims the anchor; later ones keep it
351
- (R = C.value) != null && R.runId && C.value.runId === b.runId ? void 0 : (U == null ? void 0 : U.value) ?? null
352
- );
353
- }
354
- function z() {
355
- i(), C.value = null, l.value = null, E.value = !1, I.value = "";
356
- }
357
- function w(f, b = []) {
358
- f && f.status !== "ok" && ae(f, G(f, b));
359
- }
360
- function j(f) {
361
- l.value || !C.value || (l.value = G(C.value, f));
362
- }
363
- function G(f, b) {
364
- if (!f.runId) return null;
365
- const R = b.find(
366
- (O) => O.role === "assistant" && O.parts.some(
367
- (P) => {
368
- var Q;
369
- return P.type === "data-build_run" && ((Q = P.data) == null ? void 0 : Q.runId) === f.runId;
370
- }
371
- )
372
- );
373
- return (R == null ? void 0 : R.id) ?? null;
374
- }
375
- async function ue(f) {
376
- var b;
377
- if (!(!((b = C.value) != null && b.runId) || C.value.status === "running")) {
378
- I.value = "";
379
- try {
380
- const { run: R } = await ua(
381
- A,
382
- C.value.runId,
383
- f,
384
- a(m.value)
385
- );
386
- ae(R);
387
- } catch (R) {
388
- I.value = R instanceof Error ? R.message : String(R);
389
- }
390
- }
391
- }
392
- async function de() {
393
- E.value = !1, await ie();
394
- }
395
- return He(i), {
396
- run: C,
397
- anchorId: l,
398
- stale: E,
399
- retryError: I,
400
- seed: w,
401
- reanchor: j,
402
- clear: z,
403
- noteEvent: q,
404
- retry: ue,
405
- refresh: de,
406
- onLanded: te
407
- };
408
- }
409
- const bo = "page_filters", ho = { class: "flex min-w-0 grow flex-col" }, go = { class: "fm-typo-en-title-md-600 block min-w-0 max-w-full overflow-hidden text-ellipsis whitespace-nowrap" }, wo = { class: "relative shrink-0" }, ko = {
410
- key: 0,
411
- class: "flex items-center gap-8 border-b border-fm-color-border-secondary px-16 py-8"
412
- }, _o = {
413
- key: 0,
414
- class: "flex min-w-0 grow items-start overflow-x-auto scrollbar-hide"
415
- }, xo = {
416
- key: 1,
417
- class: "grow"
418
- }, Co = {
419
- key: 2,
420
- class: "flex shrink-0 items-center gap-4"
421
- }, So = ["aria-pressed", "aria-label", "disabled"], Ro = {
422
- key: 1,
423
- "data-testid": "canvas-draft-bar",
424
- class: "flex items-center gap-12 border-b border-fm-color-border-secondary bg-fm-color-system-info-100 px-16 py-8"
425
- }, Vo = { class: "fm-typo-en-body-sm-500 text-fm-color-typo-primary" }, Ao = { class: "fm-typo-en-body-sm-400 grow text-fm-color-typo-secondary" }, $o = {
426
- key: 0,
427
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-error"
428
- }, Eo = {
429
- key: 2,
430
- role: "status",
431
- class: "fm-typo-en-body-sm-400 flex items-center gap-8 border-b border-fm-color-border-secondary px-16 py-8"
432
- }, Fo = { class: "grow" }, Do = ["aria-label"], Io = {
433
- key: 3,
434
- class: "fm-typo-en-body-sm-400 border-b border-fm-color-border-secondary bg-fm-color-system-warning-100 px-16 py-8"
435
- }, To = {
436
- key: 4,
437
- class: "fm-typo-en-body-sm-400 p-16 text-fm-color-typo-error"
438
- }, Oo = ["srcdoc", "title"], Bo = ["role", "aria-modal", "aria-label"], Lo = { class: "fm-typo-en-title-sm-600" }, zo = ["onKeydown"], Po = /* @__PURE__ */ ut({
439
- __name: "ReportCanvasView",
440
- props: {
441
- reportId: {},
442
- viewOnly: { type: Boolean }
443
- },
444
- setup(A) {
445
- const le = A, U = ra(), K = na(), { t: m, te: C } = ct(), l = Ca(), { currentReport: E } = je(l), I = _(() => {
446
- var e;
447
- return Ra(m, C, (e = E.value) == null ? void 0 : e.name, "other");
448
- }), Z = sa(), { promptLoader: te } = Sa(), v = le.reportId || String(U.query.reportId ?? ""), i = d(), T = d(""), ie = _(() => {
449
- var e;
450
- return ((e = i.value) == null ? void 0 : e.state) === "draft";
451
- }), ae = _(() => {
452
- var e, t;
453
- return ((t = (e = i.value) == null ? void 0 : e.unpublishedTurnIds) == null ? void 0 : t.length) ?? 0;
454
- }), q = d(!1), z = d(""), w = d(!1), j = d(!1), G = d(!1);
455
- function ue() {
456
- w.value = !0, S.value = !1;
457
- }
458
- function de() {
459
- G.value || (w.value ? w.value = !1 : X.value = !1);
460
- }
461
- async function f(e) {
462
- await Ae(() => Promise.resolve(e)), w.value = !1, j.value = !0;
463
- }
464
- const { isAdmin: b, canUpdate: R } = xa(), O = _(() => !le.viewOnly && b.value), P = _(
465
- () => {
466
- var e;
467
- return !le.viewOnly && !!((e = E.value) != null && e.editable) && R(E.value);
468
- }
469
- ), Q = _(
470
- () => P.value ? [{ label: m("report.common.rename"), value: "rename", isPrimary: !1 }] : []
471
- ), J = d(!1), ve = d("");
472
- function Ce() {
473
- ve.value = I.value, J.value = !0;
474
- }
475
- async function he() {
476
- const e = E.value, t = ve.value.trim();
477
- if (!(!e || !t) && (J.value = !1, t !== I.value))
478
- try {
479
- await te(() => l.createOrUpdateReport({ ...e, name: t })), Z.open({ message: m("report.messages.saveSuccess"), type: "success" });
480
- } catch {
481
- Z.open({
482
- message: m("report.messages.failedToAction", { action: m("report.common.rename") }),
483
- type: "error"
484
- });
485
- }
486
- }
487
- const X = d(!1), Se = d(), S = d(!1), oe = d(!1), pe = d(), o = d(), n = _({
488
- get: () => oe.value ? pe.value : o.value,
489
- set: (e) => {
490
- oe.value ? pe.value = e : o.value = e;
491
- }
492
- }), V = _(
493
- () => {
494
- var e;
495
- return !!n.value && !((e = i.value) != null && e.sections.some(
496
- (t) => {
497
- var u, g;
498
- return t.id === ((u = n.value) == null ? void 0 : u.sectionId) && t.version === ((g = n.value) == null ? void 0 : g.version);
499
- }
500
- ));
501
- }
502
- ), H = d({});
503
- function ge(e, t) {
504
- var u;
505
- return String(
506
- ((u = e.config) == null ? void 0 : u.title) || H.value[e.id] || m("reportV5.reportAi.chat.widgetNumber", { number: t + 1 })
507
- );
508
- }
509
- const W = d([]), h = d([]), ye = _({
510
- get: () => oe.value ? W.value : h.value,
511
- set: (e) => {
512
- oe.value ? W.value = e : h.value = e;
513
- }
514
- });
515
- function we() {
516
- n.value = void 0, ye.value = [], S.value = !1;
517
- }
518
- function Re() {
519
- const e = n.value;
520
- if (!(e != null && e.element)) return we();
521
- const { element: t, ...u } = e, g = ye.value.shift();
522
- n.value = g ? { ...u, element: g, elementText: g.text ?? "", elementTag: g.tag } : u;
523
- }
524
- function Ee(e) {
525
- e.key === "Escape" && (S.value = !1);
526
- }
527
- function ft(e, t = []) {
528
- var g;
529
- if (!S.value || Y.value) return;
530
- const u = (g = i.value) == null ? void 0 : g.sections.find((F) => F.id === e.sectionId);
531
- !u || u.version !== e.version || (n.value = {
532
- ...e,
533
- viewParams: JSON.parse(JSON.stringify(k.params.value)),
534
- viewIntent: JSON.parse(JSON.stringify(k.intent.value)),
535
- label: e.label || ge(u, i.value.sections.indexOf(u))
536
- }, ye.value = t, S.value = !1, X.value = !0);
537
- }
538
- const B = d(""), Me = d(""), Ke = d("");
539
- function Je(e) {
540
- return M.stashDraft(B.value, o.value), N.clear(), e().then(() => {
541
- const t = M.recallDraft();
542
- B.value = t.text, o.value = t.target, h.value = [], S.value = !1;
543
- });
544
- }
545
- async function pt(e) {
546
- if (tt.value) return;
547
- const t = e ? pe.value : void 0, u = e ? [...W.value] : [];
548
- let g = !1;
549
- await Je(async () => {
550
- g = await M.startChat();
551
- }), g && e && (oe.value = !1, o.value = t, h.value = u, pe.value = void 0, W.value = [], B.value = e, await Ve());
552
- }
553
- const yt = (e) => Je(async () => {
554
- const t = await M.select(e);
555
- N.seed(t, ke.value);
556
- });
557
- async function Ve() {
558
- const e = B.value.trim();
559
- if (!(!e || V.value || Y.value)) {
560
- if (Ke.value = e, B.value = "", await zt(e, n.value), Ye.value) {
561
- B.value || (B.value = Ke.value);
562
- return;
563
- }
564
- we();
565
- }
566
- }
567
- function bt(e) {
568
- const t = M.takeUnsent(e);
569
- if (t)
570
- return B.value = t.text, n.value = t.target, Ve();
571
- }
572
- function ht(e) {
573
- Y.value || (B.value = m("reportV5.reportAi.build.askBuilderPrompt", { title: e }), n.value = void 0);
574
- }
575
- async function gt() {
576
- const e = await M.stop();
577
- !e || B.value.trim() || (B.value = e.text, n.value = e.target);
578
- }
579
- function wt(e) {
580
- const t = M.requestOf(e);
581
- t && (B.value = t.text, n.value = t.target);
582
- }
583
- function kt(e) {
584
- const t = M.requestOf(e);
585
- if (t)
586
- return B.value = t.text, n.value = t.target, Ve();
587
- }
588
- const k = ca(v), M = va(v), {
589
- messages: ke,
590
- sessionId: We,
591
- title: _t,
592
- chats: xt,
593
- chatsCursor: Ze,
594
- chatsLoading: Ct,
595
- chatsError: St,
596
- switching: Ge,
597
- earlier: Rt,
598
- loadingEarlier: Vt,
599
- streaming: Qe,
600
- turnId: Xe,
601
- step: At,
602
- error: Ye,
603
- interrupted: $t,
604
- stoppable: Et,
605
- stopping: Ft,
606
- unsent: Dt,
607
- slow: It,
608
- startedAt: Tt,
609
- awaiting: Ot,
610
- noReplyId: Bt,
611
- load: Lt,
612
- send: zt,
613
- onLifecycle: Pt,
614
- onSettled: Nt,
615
- onResumed: Ut
616
- } = M, Y = _(() => Qe.value || Ot.value), { dateRange: Fe, selectedLocationIds: De, locations: et, timezone: qt } = je(mt()), N = yo(v, Qe, Xe, We), tt = _(
617
- () => {
618
- var e;
619
- return Y.value || Ge.value || ((e = N.run.value) == null ? void 0 : e.status) === "running";
620
- }
621
- ), at = _(
622
- () => {
623
- var e;
624
- return ((e = i.value) == null ? void 0 : e.sections.filter((t) => t.id !== bo)) ?? [];
625
- }
626
- ), ot = _(() => at.value.length === 0), rt = _({
627
- get: () => O.value && X.value || w.value,
628
- set: (e) => {
629
- X.value = e, e || (w.value = !1);
630
- }
631
- }), { root: jt, drawer: Ht, docked: Ie, modal: Te } = ma(rt, S), Mt = _(
632
- () => {
633
- var e;
634
- return ((e = i.value) == null ? void 0 : e.sections.some((t) => t.status === "pending")) ?? !1;
635
- }
636
- ), Kt = _(() => Y.value ? At.value ?? "working" : Mt.value ? "loading" : "updating"), ee = fa(Se, {
637
- onSelectSection: ft,
638
- onCancelSelection: () => {
639
- S.value = !1;
640
- },
641
- onSetParams: (e, t) => {
642
- k.setParams(e, t);
643
- },
644
- onSectionRendered: (e, t, u) => {
645
- u && (H.value = { ...H.value, [e]: u }), Oe(e, t, "ok");
646
- },
647
- onSectionError: (e, t, u) => {
648
- console.warn("[report-canvas] section failed", { reportId: v, sectionId: e, message: u }), Oe(e, t, "error", u);
649
- },
650
- onSectionLayout: (e, t, u) => {
651
- var F;
652
- const g = (F = i.value) == null ? void 0 : F.sections.find(($) => $.id === e);
653
- (g == null ? void 0 : g.status) === "ok" && Oe(e, t, "ok", void 0, u);
654
- }
655
- });
656
- k.onResult((e) => ee.pushRows(e)), k.onParamsChanged(() => ee.pushParams(k.paramState())), k.bindStore(), $e([S, n, ee.ready, Y], () => {
657
- ee.setCommentMode(S.value && !Y.value, n.value);
658
- });
659
- async function Oe(e, t, u, g, F) {
660
- var me, xe;
661
- const $ = (me = i.value) == null ? void 0 : me.sections.find((be) => be.id === e);
662
- if (!$ || t !== $.version) return;
663
- const ce = u === "error" ? g ?? "the section failed to render" : void 0, re = F ?? $.warnings ?? [];
664
- if (!($.status === u && $.error === ce && ($.warnings ?? []).join(`
665
- `) === re.join(`
666
- `))) {
667
- $.status = u, $.error = ce, $.warnings = re.length ? re : void 0;
668
- try {
669
- await wa(
670
- v,
671
- e,
672
- { version: t, status: u, error: ce, warnings: re },
673
- (xe = i.value) == null ? void 0 : xe.state
674
- );
675
- } catch (be) {
676
- console.warn("[report-canvas] ack failed", { reportId: v, sectionId: e, err: be });
677
- }
678
- }
679
- }
680
- async function Ae(e) {
681
- if (!q.value) {
682
- q.value = !0, z.value = "";
683
- try {
684
- const t = await e();
685
- i.value = t, k.load(t), await ee.init(t.sections, k.paramState(), k.env());
686
- } catch (t) {
687
- z.value = t instanceof Error ? t.message : String(t);
688
- } finally {
689
- q.value = !1;
690
- }
691
- }
692
- }
693
- const Jt = () => Ae(() => ba(v)), Wt = () => Ae(() => ha(v)), Zt = (e) => Ae(() => ga(v, e));
694
- async function Gt() {
695
- try {
696
- T.value = "";
697
- const e = await it(v);
698
- i.value = e, k.load(e), O.value && ot.value && Ie.value && (X.value = !0), await qe(), await ee.init(e.sections, k.paramState(), k.env());
699
- } catch (e) {
700
- T.value = e instanceof Error ? e.message : String(e);
701
- }
702
- }
703
- const Be = /* @__PURE__ */ new Set();
704
- let _e = null, Le = !1;
705
- function ze() {
706
- return _e ? (Le = !0, _e) : (_e = (async () => {
707
- do {
708
- Le = !1;
709
- try {
710
- await Qt();
711
- } catch (e) {
712
- console.warn("[report-canvas] refresh failed", { reportId: v, err: e });
713
- }
714
- } while (Le);
715
- })().finally(() => {
716
- _e = null;
717
- }), _e);
718
- }
719
- async function Qt() {
720
- var ce, re;
721
- const e = (((ce = i.value) == null ? void 0 : ce.sections) ?? []).map((L) => L.id), t = new Map(
722
- (((re = i.value) == null ? void 0 : re.sections) ?? []).map((L) => [L.id, L.version])
723
- ), u = await it(v);
724
- i.value = u;
725
- const g = [...Be];
726
- Be.clear(), k.applyCanvas(u, g) && ee.pushParams(k.paramState());
727
- const F = u.sections.map((L) => L.id);
728
- if (F.length !== e.length || F.some((L, me) => L !== e[me])) {
729
- await ee.init(u.sections, k.paramState(), k.env());
730
- return;
731
- }
732
- const $ = u.sections.filter(
733
- (L) => t.get(L.id) !== L.version
734
- );
735
- $.length && await ee.swapSections($);
736
- }
737
- const Xt = ["param_written", "sql_written", "section_written", "deleted", "reordered", "restored"];
738
- Pt((e) => {
739
- e.name === "sql_written" && typeof e.data.queryId == "string" && Be.add(e.data.queryId), Xt.includes(e.name) && ze(), N.noteEvent(e);
740
- }), Nt(() => void ze()), Ut((e) => N.seed(e, ke.value)), $e(ke, (e) => N.reanchor(e)), N.onLanded(() => void ze()), $e([et, qt], () => {
741
- i.value && ee.pushEnv(k.env());
742
- });
743
- const Yt = _(
744
- () => Object.values(k.results.value).some((e) => e.truncated)
745
- );
746
- return dt(async () => {
747
- window.addEventListener("keydown", Ee), await Gt(), O.value && N.seed(await Lt(), ke.value);
748
- }), He(() => window.removeEventListener("keydown", Ee)), (e, t) => {
749
- var L, me, xe, be, nt, st;
750
- const u = se("FmTooltip"), g = se("FmPageHead"), F = se("FmButton"), $ = se("FmIcon"), ce = se("FmTextField"), re = se("FmDialog");
751
- return s(), p("div", {
752
- ref_key: "root",
753
- ref: jt,
754
- class: "relative flex h-full min-h-0 w-full"
755
- }, [
756
- r("div", ho, [
757
- A.viewOnly ? x("", !0) : (s(), ne(g, {
758
- key: 0,
759
- class: "remove-line-clamping shrink-0",
760
- title: I.value,
761
- "back-button": !0,
762
- actions: Q.value,
763
- "onClick:back": t[0] || (t[0] = (y) => a(K).push({ name: "reports", query: a(U).query })),
764
- "onClick:action": t[1] || (t[1] = (y) => y === "rename" && Ce())
765
- }, {
766
- title: fe(() => [
767
- D(u, {
768
- content: I.value,
769
- placement: "bottom",
770
- "z-index": 2e3,
771
- class: "flex min-w-0 max-w-full justify-start"
772
- }, {
773
- default: fe(() => [
774
- r("p", go, c(I.value), 1)
775
- ]),
776
- _: 1
777
- }, 8, ["content"])
778
- ]),
779
- _: 1
780
- }, 8, ["title", "actions"])),
781
- r("div", wo, [
782
- !A.viewOnly || ((L = i.value) == null ? void 0 : L.hostFilters) !== !1 ? (s(), p("div", ko, [
783
- ((me = i.value) == null ? void 0 : me.hostFilters) !== !1 ? (s(), p("div", _o, [
784
- D(ka, {
785
- modelValue: a(De),
786
- "onUpdate:modelValue": t[3] || (t[3] = (y) => lt(De) ? De.value = y : null),
787
- options: a(et)
788
- }, {
789
- default: fe(() => [
790
- D(_a, {
791
- "date-range": a(Fe),
792
- "onUpdate:dateRange": t[2] || (t[2] = (y) => lt(Fe) ? Fe.value = y : null)
793
- }, null, 8, ["date-range"])
794
- ]),
795
- _: 1
796
- }, 8, ["modelValue", "options"])
797
- ])) : (s(), p("div", xo)),
798
- at.value.length && !A.viewOnly ? (s(), p("div", Co, [
799
- (xe = i.value) != null && xe.canEdit && ((be = i.value) != null && be.publishedAt) ? (s(), ne(F, {
800
- key: 0,
801
- "data-testid": "canvas-versions-open",
802
- variant: "tertiary",
803
- "prepend-icon": "history",
804
- label: a(m)("reportV5.reportCanvas.draft.history"),
805
- "aria-expanded": w.value,
806
- onClick: ue
807
- }, null, 8, ["label", "aria-expanded"])) : x("", !0),
808
- O.value ? (s(), ne(u, {
809
- key: 1,
810
- placement: "bottom",
811
- content: a(m)(
812
- S.value ? "reportV5.reportAi.chat.cancelSelection" : "reportV5.reportAi.chat.commentWidget"
813
- )
814
- }, {
815
- default: fe(() => [
816
- r("button", {
817
- "data-testid": "canvas-comment-toggle",
818
- class: Ue(["canvas-comment-target flex h-32 w-32 items-center justify-center rounded-md text-fm-color-typo-secondary disabled:opacity-50", S.value && "bg-fm-color-neutral-gray-100 text-fm-color-primary"]),
819
- "aria-pressed": S.value,
820
- "aria-label": a(m)("reportV5.reportAi.chat.commentWidget"),
821
- disabled: Y.value || w.value,
822
- onClick: t[4] || (t[4] = (y) => S.value = !S.value)
823
- }, [...t[19] || (t[19] = [
824
- r("svg", {
825
- width: "20",
826
- height: "20",
827
- viewBox: "0 0 20 20",
828
- fill: "none",
829
- "aria-hidden": "true"
830
- }, [
831
- r("path", {
832
- d: "M5 3.5h5a6.5 6.5 0 1 1-6.5 6.5V5A1.5 1.5 0 0 1 5 3.5Z",
833
- stroke: "currentColor",
834
- "stroke-width": "1.5",
835
- "stroke-linecap": "round",
836
- "stroke-linejoin": "round"
837
- })
838
- ], -1)
839
- ])], 10, So)
840
- ]),
841
- _: 1
842
- }, 8, ["content"])) : x("", !0),
843
- O.value && !X.value && !w.value ? (s(), ne(F, {
844
- key: 2,
845
- "data-testid": "report-canvas-chat-open",
846
- variant: "tertiary",
847
- "prepend-icon": "auto_awesome",
848
- label: a(m)("reportV5.reportAi.chat.open"),
849
- onClick: t[5] || (t[5] = (y) => X.value = !0)
850
- }, null, 8, ["label"])) : x("", !0)
851
- ])) : x("", !0)
852
- ])) : x("", !0)
853
- ]),
854
- ie.value && !A.viewOnly ? (s(), p("div", Ro, [
855
- r("span", Vo, c(a(m)("reportV5.reportCanvas.draft.pending", { count: ae.value })), 1),
856
- r("span", Ao, c(a(m)("reportV5.reportCanvas.draft.hint")), 1),
857
- z.value ? (s(), p("span", $o, c(z.value), 1)) : x("", !0),
858
- D(F, {
859
- "data-testid": "canvas-draft-discard",
860
- variant: "tertiary",
861
- label: a(m)("reportV5.reportCanvas.draft.discard"),
862
- disabled: q.value,
863
- onClick: Wt
864
- }, null, 8, ["label", "disabled"]),
865
- D(F, {
866
- "data-testid": "canvas-draft-publish",
867
- variant: "primary",
868
- label: a(m)("reportV5.reportCanvas.draft.publish"),
869
- disabled: q.value,
870
- onClick: Jt
871
- }, null, 8, ["label", "disabled"])
872
- ])) : x("", !0),
873
- j.value ? (s(), p("div", Eo, [
874
- D($, {
875
- name: "check_circle",
876
- size: "sm"
877
- }),
878
- r("span", Fo, c(a(m)("reportV5.reportCanvas.history.restored")), 1),
879
- r("button", {
880
- class: "flex h-32 w-32 items-center justify-center rounded-md",
881
- "aria-label": a(m)("reportV5.reportCanvas.draft.close"),
882
- onClick: t[6] || (t[6] = (y) => j.value = !1)
883
- }, [
884
- D($, {
885
- name: "close",
886
- size: "sm"
887
- })
888
- ], 8, Do)
889
- ])) : x("", !0),
890
- Yt.value ? (s(), p("div", Io, c(a(m)("reportV5.reportCanvas.canvas.truncated")), 1)) : x("", !0),
891
- T.value ? (s(), p("p", To, c(T.value), 1)) : x("", !0),
892
- ea(r("iframe", {
893
- ref_key: "frame",
894
- ref: Se,
895
- "data-testid": "report-canvas-frame",
896
- class: "min-h-0 grow border-0",
897
- srcdoc: a(pa),
898
- sandbox: "allow-scripts",
899
- title: a(m)("reportV5.reportCanvas.canvas.title")
900
- }, null, 8, Oo), [
901
- [ta, !T.value]
902
- ])
903
- ]),
904
- a(Te) ? (s(), p("button", {
905
- key: 0,
906
- type: "button",
907
- tabindex: "-1",
908
- "aria-hidden": "true",
909
- "data-testid": "canvas-scrim",
910
- class: "canvas-scrim absolute inset-0 z-20 cursor-default",
911
- onClick: de
912
- })) : x("", !0),
913
- !A.viewOnly && rt.value && (a(Ie) || !S.value) ? (s(), p("div", {
914
- key: 1,
915
- ref_key: "drawer",
916
- ref: Ht,
917
- class: Ue(
918
- a(Ie) ? "w-[380px] shrink-0" : "absolute inset-y-0 right-0 z-30 w-full max-w-[380px] shadow-lg"
919
- ),
920
- role: a(Te) ? "dialog" : void 0,
921
- "aria-modal": a(Te) ? "true" : void 0,
922
- "aria-label": a(m)(w.value ? "reportV5.reportCanvas.draft.history" : "reportV5.reportAi.chat.title")
923
- }, [
924
- w.value ? (s(), ne(mo, {
925
- key: 0,
926
- "report-id": a(v),
927
- "published-at": (nt = i.value) == null ? void 0 : nt.publishedAt,
928
- timezone: a(k).env().timezone,
929
- "has-draft": ie.value,
930
- busy: Y.value || q.value,
931
- onClose: t[7] || (t[7] = (y) => w.value = !1),
932
- onRestored: f,
933
- onRestoring: t[8] || (t[8] = (y) => G.value = y)
934
- }, null, 8, ["report-id", "published-at", "timezone", "has-draft", "busy"])) : (s(), ne(ya, {
935
- key: 1,
936
- "home-draft": Me.value,
937
- "onUpdate:homeDraft": t[9] || (t[9] = (y) => Me.value = y),
938
- "home-open": oe.value,
939
- "onUpdate:homeOpen": t[10] || (t[10] = (y) => oe.value = y),
940
- messages: a(ke),
941
- draft: B.value,
942
- target: n.value,
943
- "target-stale": V.value,
944
- streaming: Y.value,
945
- "turn-id": a(Xe),
946
- phase: Kt.value,
947
- slow: a(It),
948
- "started-at": a(Tt),
949
- error: a(Ye),
950
- interrupted: a($t),
951
- blank: ot.value,
952
- run: a(N).run.value,
953
- "run-anchor-id": a(N).anchorId.value,
954
- "run-stale": a(N).stale.value,
955
- "retry-error": a(N).retryError.value,
956
- "undoable-turn-ids": ((st = i.value) == null ? void 0 : st.unpublishedTurnIds) ?? [],
957
- undoing: q.value,
958
- "unsent-ids": a(Dt),
959
- "no-reply-id": a(Bt),
960
- "chat-id": a(We),
961
- "chat-title": a(_t),
962
- chats: a(xt),
963
- "chats-cursor": a(Ze),
964
- "chats-loading": a(Ct),
965
- "chats-error": a(St),
966
- switching: a(Ge),
967
- busy: tt.value,
968
- stoppable: a(Et),
969
- stopping: a(Ft),
970
- earlier: a(Rt),
971
- "loading-earlier": a(Vt),
972
- "onUpdate:draft": t[11] || (t[11] = (y) => B.value = y),
973
- onClearTarget: Re,
974
- onSubmit: Ve,
975
- onClose: t[12] || (t[12] = (y) => X.value = !1),
976
- onRetry: a(N).retry,
977
- onUndo: Zt,
978
- onResend: bt,
979
- onAskAgain: kt,
980
- onEditRequest: wt,
981
- onStop: gt,
982
- onAskBuilder: ht,
983
- onCheckStatus: a(N).refresh,
984
- onNewChat: pt,
985
- onSelectChat: yt,
986
- onLoadChats: t[13] || (t[13] = (y) => a(M).loadChats()),
987
- onLoadMoreChats: t[14] || (t[14] = (y) => a(M).loadChats(a(Ze) ?? void 0)),
988
- onLoadEarlier: t[15] || (t[15] = (y) => a(M).loadEarlier())
989
- }, null, 8, ["home-draft", "home-open", "messages", "draft", "target", "target-stale", "streaming", "turn-id", "phase", "slow", "started-at", "error", "interrupted", "blank", "run", "run-anchor-id", "run-stale", "retry-error", "undoable-turn-ids", "undoing", "unsent-ids", "no-reply-id", "chat-id", "chat-title", "chats", "chats-cursor", "chats-loading", "chats-error", "switching", "busy", "stoppable", "stopping", "earlier", "loading-earlier", "onRetry", "onCheckStatus"]))
990
- ], 10, Bo)) : x("", !0),
991
- P.value ? (s(), ne(re, {
992
- key: 2,
993
- modelValue: J.value,
994
- "onUpdate:modelValue": t[18] || (t[18] = (y) => J.value = y),
995
- overlay: !0,
996
- "dismiss-away": !0
997
- }, {
998
- "dialog-header": fe(() => [
999
- r("p", Lo, c(a(m)("report.common.rename")), 1)
1000
- ]),
1001
- default: fe(() => [
1002
- r("div", {
1003
- onKeydown: aa(oa(he, ["prevent"]), ["enter"])
1004
- }, [
1005
- D(ce, {
1006
- modelValue: ve.value,
1007
- "onUpdate:modelValue": t[16] || (t[16] = (y) => ve.value = y),
1008
- label: a(m)("report.view.report.name"),
1009
- placeholder: a(m)("report.view.report.enter")
1010
- }, null, 8, ["modelValue", "label", "placeholder"])
1011
- ], 40, zo)
1012
- ]),
1013
- "dialog-footer": fe(() => [
1014
- t[20] || (t[20] = r("div", { class: "grow" }, null, -1)),
1015
- D(F, {
1016
- label: a(m)("report.common.cancel"),
1017
- variant: "tertiary",
1018
- onClick: t[17] || (t[17] = (y) => J.value = !1)
1019
- }, null, 8, ["label"]),
1020
- D(F, {
1021
- label: a(m)("report.common.save"),
1022
- variant: "primary",
1023
- disabled: ve.value.trim() === "",
1024
- onClick: he
1025
- }, null, 8, ["label", "disabled"])
1026
- ]),
1027
- _: 1
1028
- }, 8, ["modelValue"])) : x("", !0)
1029
- ], 512);
1030
- };
1031
- }
1032
- }), Xo = /* @__PURE__ */ vt(Po, [["__scopeId", "data-v-13446d13"]]);
1033
- export {
1034
- Xo as default
1035
- };