@feedmepos/mf-report 5.34.2-beta.0 → 5.35.0-beta.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/{App-CTNqGWu3.js → App-DQyEf0mm.js} +4 -4
- package/dist/{DateRangeSelect-ugBAezWv.js → DateRangeSelect-DvE_au_i.js} +1 -1
- package/dist/{Default.vue_vue_type_script_setup_true_lang-BgdRmAaG.js → Default.vue_vue_type_script_setup_true_lang-B5Ir3Xuu.js} +1 -1
- package/dist/{DigestListView-Dw2-7g3V.js → DigestListView-Cl2EK5bf.js} +3 -3
- package/dist/DigestReaderView-BS0iuanX.js +489 -0
- package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-CQOfbsny.js → DynamicWidget.vue_vue_type_script_setup_true_lang-DfVW7Q_x.js} +173 -173
- package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-BQpXUl5Y.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Fcz2N71N.js} +175 -175
- package/dist/{InsightView-drYR-GoM.js → InsightView-CmA2Xi0T.js} +5 -5
- package/dist/{Integration-Bd5TU3TW.js → Integration-DdfS7Jgh.js} +3 -3
- package/dist/{Integrations-wIW0tkRi.js → Integrations-CRMbmKLq.js} +2 -2
- package/dist/{Layout-CpxtgZ_K.js → Layout-kcAw_A-E.js} +1 -1
- package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-5Wduoqrp.js → LocationSelect.vue_vue_type_script_setup_true_lang-BRYP_afx.js} +1553 -1547
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-BkyAL0XA.js → MenuTab.vue_vue_type_script_setup_true_lang-I8gsgGXJ.js} +5 -5
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-zCfpFbMB.js → NavigationTab.vue_vue_type_script_setup_true_lang-D3QOPpyj.js} +5 -5
- package/dist/{OverviewView-CPIbkUIQ.js → OverviewView-tS8EKm9q.js} +5 -5
- package/dist/{Report-DqHL8zAU.js → Report-BvJw6A0s.js} +3 -3
- package/dist/ReportCanvasView-Bywb09Z7.js +1066 -0
- package/dist/{ReportEditor-DyDsge8L.js → ReportEditor-D88J-04n.js} +7 -7
- package/dist/{ReportView-DK7g-7Ba.js → ReportView-DxnYH37m.js} +6 -6
- package/dist/{ReportViewRoute-Dpt84-XU.js → ReportViewRoute-DJdbgiqN.js} +2 -2
- package/dist/{Setting-Inns2xlq.js → Setting-CNrh7nBB.js} +94 -94
- package/dist/{Template-7ErGUPov.js → Template-BreFV27K.js} +3 -3
- package/dist/{TileEditor-BjWofHQ5.js → TileEditor-CLXi5in3.js} +6 -6
- package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-BxjkJQs_.js → TilePageStack.vue_vue_type_script_setup_true_lang-HMTKQELw.js} +2 -2
- package/dist/{TransitionFade-BlQMeZNA.js → TransitionFade-tUK-3l63.js} +5 -5
- package/dist/{app-BxEfKOCH.js → app-CwMmSHUw.js} +19 -19
- package/dist/app.js +1 -1
- package/dist/assets/{formatChartData.worker-Cpgnh20a.js → formatChartData.worker-Bt8turfo.js} +22 -22
- package/dist/assets/{processTableData.worker-B7I6PElJ.js → processTableData.worker-MGb36f8J.js} +22 -22
- package/dist/{currency-Gp2WcafT.js → currency-BUi-Xq6N.js} +1 -1
- package/dist/{index-CVkwce9f.js → index-cojDf4MH.js} +503 -473
- package/dist/{report-CYTvrsBN.js → report-CtMB0C_H.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useDigestFont-C1lXCGD5.js → useDigestFont-HI14Bq_l.js} +1 -1
- package/dist/{useReportCanvasPanel-DktKsHBS.js → useReportCanvasPicks-ZAlJK9Cv.js} +1353 -1264
- package/dist/{useRestaurantPermission-Dhr3bCra.js → useRestaurantPermission-DO4WIH7P.js} +1 -1
- package/package.json +2 -2
- package/dist/DigestReaderView-DGYa6bGl.js +0 -526
- package/dist/ReportCanvasView-Dv-CsDYk.js +0 -1035
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as pe, resolveComponent as Z, openBlock as C, createBlock as fe, isRef as Ke, unref as d, withCtx as P, createElementVNode as ne, createVNode as V, toDisplayString as se, createTextVNode as We, onMounted as ve, watch as z, ref as j, computed as ie, onBeforeMount as Pe, onBeforeUnmount as Ge, createElementBlock as G, Fragment as He } from "vue";
|
|
2
2
|
import { detectLocale as K, useCoreStore as H } from "@feedmepos/mf-common";
|
|
3
|
-
import { d as Y, u as Xe, a as ce, b as Ze, c as le, e as Ve, f as Ye, g as Me, r as X, h as ue, t as et, z as tt, i as ot } from "./app-
|
|
3
|
+
import { d as Y, u as Xe, a as ce, b as Ze, c as le, e as Ve, f as Ye, g as Me, r as X, h as ue, t as et, z as tt, i as ot } from "./app-CwMmSHUw.js";
|
|
4
4
|
import { storeToRefs as N } from "pinia";
|
|
5
5
|
import { u as at } from "./global-loader-BuxFfehu.js";
|
|
6
|
-
import { u as rt, a as nt } from "./report-
|
|
7
|
-
import { u as st, _ as it } from "./NavigationTab.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { u as rt, a as nt } from "./report-CtMB0C_H.js";
|
|
7
|
+
import { u as st, _ as it } from "./NavigationTab.vue_vue_type_script_setup_true_lang-D3QOPpyj.js";
|
|
8
8
|
import { u as de } from "./message-dialog-UoMWOnil.js";
|
|
9
9
|
import { u as ct } from "./_plugin-vue_export-helper-Bx7s49ra.js";
|
|
10
10
|
import { useRoute as lt, useRouter as ut } from "vue-router";
|
|
@@ -122,7 +122,7 @@ const ft = ["src"], vt = ["src"], bt = /* @__PURE__ */ pe({
|
|
|
122
122
|
}), Pe(() => {
|
|
123
123
|
ge(it);
|
|
124
124
|
}), ve(() => {
|
|
125
|
-
console.log("5.
|
|
125
|
+
console.log("5.35.0-beta.0", !0), window.addEventListener("message", te), window.addEventListener("message", oe);
|
|
126
126
|
}), Ge(() => {
|
|
127
127
|
window.removeEventListener("message", te), window.removeEventListener("message", oe), k.$dispose(), M.$dispose();
|
|
128
128
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as ne, resolveComponent as A, openBlock as C, createBlock as b, normalizeClass as fe, withCtx as U, createCommentVNode as F, createElementVNode as I, toDisplayString as De, renderSlot as ye, useModel as L, ref as P, computed as z, watch as M, nextTick as K, onMounted as ve, onBeforeUnmount as pe, createElementBlock as ge, unref as $, createVNode as Z, mergeModels as J } from "vue";
|
|
2
|
-
import { d as i, a as he, i as Q, z as X, C as E, s as Ce, t as be } from "./app-
|
|
2
|
+
import { d as i, a as he, i as Q, z as X, C as E, s as Ce, t as be } from "./app-CwMmSHUw.js";
|
|
3
3
|
import { detectLocale as _ } from "@feedmepos/mf-common";
|
|
4
4
|
import { u as Re, _ as Me } from "./_plugin-vue_export-helper-Bx7s49ra.js";
|
|
5
5
|
import { storeToRefs as Ye } from "pinia";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as u, computed as p, resolveComponent as f, openBlock as t, createElementBlock as r, normalizeStyle as n, unref as e, normalizeClass as d, createBlock as y, createCommentVNode as _, createVNode as h, createElementVNode as k, toDisplayString as g, renderSlot as x } from "vue";
|
|
2
|
-
import { _ as v } from "./NavigationTab.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as v } from "./NavigationTab.vue_vue_type_script_setup_true_lang-D3QOPpyj.js";
|
|
3
3
|
import { useBreakpoints as b } from "@feedmepos/ui-library";
|
|
4
4
|
import { storeToRefs as C } from "pinia";
|
|
5
5
|
import { u as q } from "./global-loader-BuxFfehu.js";
|
|
@@ -2,13 +2,13 @@ import { defineComponent as _t, ref as z, watch as Ft, onBeforeUnmount as Jt, co
|
|
|
2
2
|
import { storeToRefs as oe } from "pinia";
|
|
3
3
|
import { useI18n as St } from "@feedmepos/mf-common";
|
|
4
4
|
import { useBreakpoints as Yt } from "@feedmepos/ui-library";
|
|
5
|
-
import { _ as re } from "./Default.vue_vue_type_script_setup_true_lang-
|
|
5
|
+
import { _ as re } from "./Default.vue_vue_type_script_setup_true_lang-B5Ir3Xuu.js";
|
|
6
6
|
import { _ as jt } from "./SelectComponent.vue_vue_type_script_setup_true_lang-Cxx-TQz9.js";
|
|
7
7
|
import { useRoute as le } from "vue-router";
|
|
8
|
-
import { c as ie, d as Kt, u as ce, a as ue, n as de, _ as he, D as fe } from "./useDigestFont-
|
|
8
|
+
import { c as ie, d as Kt, u as ce, a as ue, n as de, _ as he, D as fe } from "./useDigestFont-HI14Bq_l.js";
|
|
9
9
|
import { l as me } from "./report-canvas-libs-CNx4fuqd.js";
|
|
10
10
|
import { _ as bt } from "./_plugin-vue_export-helper-Bx7s49ra.js";
|
|
11
|
-
import { j as pe, f as ge, A as ve, k as Ct, l as ye, m as xe } from "./app-
|
|
11
|
+
import { j as pe, f as ge, A as ve, k as Ct, l as ye, m as xe } from "./app-CwMmSHUw.js";
|
|
12
12
|
const W = () => ({ rects: [], circles: [], paths: [] }), Q = (e) => e.x1 - e.x0, tt = (e) => e.y1 - e.y0, S = (e) => e.toFixed(1), kt = [0.14, 0.32, 0.54, 0.78, 1], wt = (e) => kt[Math.min(kt.length - 1, Math.floor(Math.max(0, Math.min(1, e)) * kt.length))];
|
|
13
13
|
function Zt(e) {
|
|
14
14
|
const t = Math.min(0, ...e), n = Math.max(0, ...e);
|
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
import { defineComponent as ue, ref as f, watch as Q, onMounted as pe, nextTick as st, resolveComponent as $, openBlock as c, createElementBlock as h, createElementVNode as y, unref as t, createVNode as R, createCommentVNode as _, computed as k, onBeforeUnmount as ot, createBlock as V, withCtx as F, createSlots as rt, toDisplayString as D, normalizeClass as le } from "vue";
|
|
2
|
+
import { useRoute as nt, useRouter as it } from "vue-router";
|
|
3
|
+
import { useI18n as fe } from "@feedmepos/mf-common";
|
|
4
|
+
import { useBreakpoints as lt } from "@feedmepos/ui-library";
|
|
5
|
+
import { _ as ct } from "./Default.vue_vue_type_script_setup_true_lang-B5Ir3Xuu.js";
|
|
6
|
+
import { _ as ce } from "./SelectComponent.vue_vue_type_script_setup_true_lang-Cxx-TQz9.js";
|
|
7
|
+
import { u as dt, a as ut, R as pt, b as ft, c as mt, d as vt, e as gt, f as ht, g as M } from "./useReportCanvasPicks-ZAlJK9Cv.js";
|
|
8
|
+
import { b as kt, d as yt, a as wt, _ as bt, D as _t } from "./useDigestFont-HI14Bq_l.js";
|
|
9
|
+
import { f as xt, n as Ct, o as St, A as de } from "./app-CwMmSHUw.js";
|
|
10
|
+
import { _ as Vt } from "./_plugin-vue_export-helper-Bx7s49ra.js";
|
|
11
|
+
const Rt = { class: "relative flex min-h-0 grow flex-col" }, Et = ["srcdoc", "title"], Pt = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
14
|
+
"data-testid": "digest-frame-loading"
|
|
15
|
+
}, Tt = /* @__PURE__ */ ue({
|
|
16
|
+
__name: "DigestCanvasFrame",
|
|
17
|
+
props: {
|
|
18
|
+
digest: {},
|
|
19
|
+
commentMode: { type: Boolean },
|
|
20
|
+
picked: {}
|
|
21
|
+
},
|
|
22
|
+
emits: ["select", "area", "cancel"],
|
|
23
|
+
setup(Z, { emit: s }) {
|
|
24
|
+
const B = { MYR: "RM" }, m = Z, E = s, { t: q } = fe(), P = f(), x = f(!1), l = {
|
|
25
|
+
reportId: `digest-${m.digest.weekStart}`,
|
|
26
|
+
version: 1,
|
|
27
|
+
state: "published",
|
|
28
|
+
canEdit: !1,
|
|
29
|
+
hostFilters: !1,
|
|
30
|
+
...m.digest.canvas
|
|
31
|
+
}, v = dt(l.reportId, { frozen: m.digest.rows }), T = new Set(
|
|
32
|
+
l.sections.flatMap((o) => {
|
|
33
|
+
var n;
|
|
34
|
+
const r = (n = o.config) == null ? void 0 : n.href;
|
|
35
|
+
return o.component === "digest-idea" && typeof r == "string" ? [r] : [];
|
|
36
|
+
})
|
|
37
|
+
), w = ut(P, {
|
|
38
|
+
onSelectSection: (o, r) => E("select", o, r),
|
|
39
|
+
onSelectArea: (o) => E("area", o),
|
|
40
|
+
onCancelSelection: () => E("cancel"),
|
|
41
|
+
onSetParams: (o, r) => {
|
|
42
|
+
v.setParams(o, r);
|
|
43
|
+
},
|
|
44
|
+
// a saved page records nothing back (its sections were checked before it was saved); a drawn part ends the loader
|
|
45
|
+
onSectionRendered: () => {
|
|
46
|
+
x.value = !0;
|
|
47
|
+
},
|
|
48
|
+
onSectionError: (o, r, n) => {
|
|
49
|
+
x.value = !0, console.warn("[digest] section failed", { weekStart: m.digest.weekStart, sectionId: o, message: n });
|
|
50
|
+
},
|
|
51
|
+
onSectionLayout: () => {
|
|
52
|
+
},
|
|
53
|
+
onOpenLink: (o) => {
|
|
54
|
+
T.has(o) && window.open(o, "_blank", "noopener,noreferrer");
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return v.onResult((o) => w.pushRows(o)), v.onParamsChanged(() => w.pushParams(v.paramState())), Q([() => m.commentMode, () => m.picked, w.ready], () => {
|
|
58
|
+
w.setCommentMode(!!m.commentMode, m.picked ?? [], !0);
|
|
59
|
+
}), pe(async () => {
|
|
60
|
+
v.load(l), await st();
|
|
61
|
+
const o = v.env();
|
|
62
|
+
await w.init(l.sections, v.paramState(), {
|
|
63
|
+
...o,
|
|
64
|
+
currency: m.digest.money || B[o.currency] || o.currency,
|
|
65
|
+
digest: !0,
|
|
66
|
+
digestFont: kt
|
|
67
|
+
});
|
|
68
|
+
}), (o, r) => {
|
|
69
|
+
const n = $("FmCircularProgress");
|
|
70
|
+
return c(), h("div", Rt, [
|
|
71
|
+
y("iframe", {
|
|
72
|
+
ref_key: "frame",
|
|
73
|
+
ref: P,
|
|
74
|
+
"data-testid": "digest-frame",
|
|
75
|
+
class: "min-h-0 grow border-0",
|
|
76
|
+
srcdoc: t(pt),
|
|
77
|
+
sandbox: "allow-scripts",
|
|
78
|
+
title: t(q)("reportV5.digest.frameTitle")
|
|
79
|
+
}, null, 8, Et),
|
|
80
|
+
x.value ? _("", !0) : (c(), h("div", Pt, [
|
|
81
|
+
R(n, { size: "xl" })
|
|
82
|
+
]))
|
|
83
|
+
]);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}), At = { class: "flex min-w-0 grow flex-col" }, Ft = { class: "fm-typo-en-title-md-600 block min-w-0 max-w-full overflow-hidden text-ellipsis whitespace-nowrap" }, Dt = {
|
|
87
|
+
key: 0,
|
|
88
|
+
class: "flex shrink-0 flex-wrap items-center gap-8 border-b border-fm-color-border-secondary px-16 py-8",
|
|
89
|
+
"data-testid": "digest-toolbar"
|
|
90
|
+
}, Mt = { class: "digest-kind" }, $t = {
|
|
91
|
+
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary",
|
|
92
|
+
"data-testid": "digest-published"
|
|
93
|
+
}, Bt = {
|
|
94
|
+
key: 1,
|
|
95
|
+
"data-testid": "digest-comment-hint",
|
|
96
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
97
|
+
}, Lt = ["aria-pressed", "aria-label", "disabled"], jt = {
|
|
98
|
+
width: "20",
|
|
99
|
+
height: "20",
|
|
100
|
+
viewBox: "0 0 20 20",
|
|
101
|
+
fill: "none",
|
|
102
|
+
"aria-hidden": "true"
|
|
103
|
+
}, It = ["fill"], zt = {
|
|
104
|
+
key: 3,
|
|
105
|
+
class: "fm-typo-en-body-sm-400 p-16 text-fm-color-typo-error",
|
|
106
|
+
"data-testid": "digest-error"
|
|
107
|
+
}, Ot = {
|
|
108
|
+
key: 4,
|
|
109
|
+
class: "flex min-h-[75vh] flex-1 items-center justify-center",
|
|
110
|
+
"data-testid": "digest-loading"
|
|
111
|
+
}, qt = {
|
|
112
|
+
key: 5,
|
|
113
|
+
class: "flex min-h-[75vh] flex-1 flex-col"
|
|
114
|
+
}, Nt = ["role", "aria-modal", "aria-label"], Ut = /* @__PURE__ */ ue({
|
|
115
|
+
__name: "DigestReaderView",
|
|
116
|
+
setup(Z) {
|
|
117
|
+
var ie;
|
|
118
|
+
const { t: s, locale: B } = fe(), { breakpoints: m } = lt(), E = nt(), q = it(), P = xt(), x = k(() => String(E.params.weekStart ?? "")), l = f(), v = f(!0), T = f(""), w = f(!1), o = f(!1), r = f(!1), n = f(""), J = f(""), L = f(!1), d = f(!1), N = f(!1), K = k(() => d.value && !N.value), { root: me, drawer: ve, docked: U, modal: H } = ft(r, K);
|
|
119
|
+
Q([d, r], ([e, a]) => {
|
|
120
|
+
(!e || !a) && (N.value = !1);
|
|
121
|
+
});
|
|
122
|
+
const j = k(() => {
|
|
123
|
+
var e;
|
|
124
|
+
return ((e = l.value) == null ? void 0 : e.canvas.sections) ?? [];
|
|
125
|
+
}), {
|
|
126
|
+
homePicks: W,
|
|
127
|
+
threadPicks: Y,
|
|
128
|
+
picks: b,
|
|
129
|
+
targets: ge,
|
|
130
|
+
outlines: he,
|
|
131
|
+
chips: ke,
|
|
132
|
+
stale: X,
|
|
133
|
+
toggle: ye,
|
|
134
|
+
addArea: we,
|
|
135
|
+
widen: be
|
|
136
|
+
} = mt(L, { sections: () => j.value, named: xe });
|
|
137
|
+
function _e(e, a) {
|
|
138
|
+
var O;
|
|
139
|
+
const i = e.config ?? {}, g = i.title ?? i.headline;
|
|
140
|
+
if (typeof g == "string" && g) return g;
|
|
141
|
+
if (e.component === "digest-kpis") return s("reportV5.digest.ask.tiles");
|
|
142
|
+
const S = j.value.slice(0, a).reverse().find((p) => p.component === "digest-chapter");
|
|
143
|
+
return e.component === "digest-text" && typeof ((O = S == null ? void 0 : S.config) == null ? void 0 : O.title) == "string" ? S.config.title : s("reportV5.digest.ask.part", { number: a + 1 });
|
|
144
|
+
}
|
|
145
|
+
function I() {
|
|
146
|
+
b.value = [], d.value = !1;
|
|
147
|
+
}
|
|
148
|
+
function xe(e) {
|
|
149
|
+
const a = j.value.findIndex((g) => g.id === e.sectionId), i = j.value[a];
|
|
150
|
+
if (!(!i || i.version !== e.version))
|
|
151
|
+
return { ...e, label: e.label || _e(i, a) };
|
|
152
|
+
}
|
|
153
|
+
function Ce(e, a) {
|
|
154
|
+
!d.value || C.value || ye(e, a) && (r.value = !0);
|
|
155
|
+
}
|
|
156
|
+
function Se(e) {
|
|
157
|
+
!d.value || C.value || we(e) && (r.value = !0);
|
|
158
|
+
}
|
|
159
|
+
const Ve = ((ie = window.matchMedia) == null ? void 0 : ie.call(window, "(pointer: coarse)").matches) ?? !1;
|
|
160
|
+
function Re() {
|
|
161
|
+
if (d.value) return I();
|
|
162
|
+
d.value = !0, r.value = !0;
|
|
163
|
+
}
|
|
164
|
+
function Ee() {
|
|
165
|
+
N.value = !0, r.value = !0;
|
|
166
|
+
}
|
|
167
|
+
function ee(e) {
|
|
168
|
+
e.key === "Escape" && d.value && I();
|
|
169
|
+
}
|
|
170
|
+
const u = vt(gt(x.value)), {
|
|
171
|
+
messages: Pe,
|
|
172
|
+
sessionId: Te,
|
|
173
|
+
title: Ae,
|
|
174
|
+
chats: Fe,
|
|
175
|
+
chatsCursor: te,
|
|
176
|
+
chatsLoading: De,
|
|
177
|
+
chatsError: Me,
|
|
178
|
+
switching: G,
|
|
179
|
+
earlier: $e,
|
|
180
|
+
loadingEarlier: Be,
|
|
181
|
+
streaming: Le,
|
|
182
|
+
turnId: je,
|
|
183
|
+
step: Ie,
|
|
184
|
+
error: ae,
|
|
185
|
+
interrupted: ze,
|
|
186
|
+
stoppable: Oe,
|
|
187
|
+
stopping: qe,
|
|
188
|
+
unsent: Ne,
|
|
189
|
+
slow: Ue,
|
|
190
|
+
startedAt: He,
|
|
191
|
+
awaiting: Ye,
|
|
192
|
+
noReplyId: Ge
|
|
193
|
+
} = u, C = k(() => Le.value || Ye.value), se = k(() => C.value || G.value);
|
|
194
|
+
let oe = !1;
|
|
195
|
+
Q(r, (e) => {
|
|
196
|
+
!e || oe || (oe = !0, u.load());
|
|
197
|
+
});
|
|
198
|
+
async function z() {
|
|
199
|
+
const e = n.value.trim();
|
|
200
|
+
if (!(!e || C.value || G.value || X.value)) {
|
|
201
|
+
if (n.value = "", await u.send(e, ge.value), ae.value) {
|
|
202
|
+
n.value || (n.value = e);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
I();
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
async function re(e) {
|
|
209
|
+
u.stashDraft(
|
|
210
|
+
n.value,
|
|
211
|
+
Y.value.flatMap((i) => i.targets)
|
|
212
|
+
), await e();
|
|
213
|
+
const a = u.recallDraft();
|
|
214
|
+
n.value = a.text, Y.value = M(a.targets), d.value = !1;
|
|
215
|
+
}
|
|
216
|
+
async function Qe(e) {
|
|
217
|
+
if (se.value) return;
|
|
218
|
+
const a = e ? [...W.value] : [];
|
|
219
|
+
let i = !1;
|
|
220
|
+
await re(async () => {
|
|
221
|
+
i = await u.startChat();
|
|
222
|
+
}), i && e && (L.value = !1, Y.value = a, W.value = [], n.value = e, await z());
|
|
223
|
+
}
|
|
224
|
+
const Ze = (e) => re(() => u.select(e));
|
|
225
|
+
function Je(e) {
|
|
226
|
+
const a = u.takeUnsent(e);
|
|
227
|
+
if (a)
|
|
228
|
+
return n.value = a.text, b.value = M(a.targets), z();
|
|
229
|
+
}
|
|
230
|
+
async function Ke() {
|
|
231
|
+
const e = await u.stop();
|
|
232
|
+
!e || n.value.trim() || (n.value = e.text, b.value = M(e.targets));
|
|
233
|
+
}
|
|
234
|
+
function We(e) {
|
|
235
|
+
const a = u.requestOf(e);
|
|
236
|
+
a && (n.value = a.text, b.value = M(a.targets));
|
|
237
|
+
}
|
|
238
|
+
function Xe(e) {
|
|
239
|
+
const a = u.requestOf(e);
|
|
240
|
+
if (a)
|
|
241
|
+
return n.value = a.text, b.value = M(a.targets), z();
|
|
242
|
+
}
|
|
243
|
+
const A = k(
|
|
244
|
+
() => l.value ? yt(l.value.weekStart, l.value.weekEnd, B.value) : ""
|
|
245
|
+
), et = k(() => {
|
|
246
|
+
const e = l.value;
|
|
247
|
+
if (!e) return "";
|
|
248
|
+
const a = [
|
|
249
|
+
s("reportV5.digest.published", {
|
|
250
|
+
date: wt(e.createdAt, B.value, e.timezone)
|
|
251
|
+
})
|
|
252
|
+
];
|
|
253
|
+
return e.outlets && a.push(s("reportV5.digest.outlets", { count: e.outlets }, e.outlets)), a.join(" · ");
|
|
254
|
+
}), tt = k(
|
|
255
|
+
() => {
|
|
256
|
+
var e;
|
|
257
|
+
return (((e = l.value) == null ? void 0 : e.canvas.sections) ?? []).filter(
|
|
258
|
+
(a) => {
|
|
259
|
+
var i;
|
|
260
|
+
return a.component === "digest-chapter" && typeof ((i = a.config) == null ? void 0 : i.title) == "string";
|
|
261
|
+
}
|
|
262
|
+
).slice(0, 3).map((a) => {
|
|
263
|
+
var g;
|
|
264
|
+
const i = String((g = a.config) == null ? void 0 : g.title);
|
|
265
|
+
return { label: i, prompt: s("reportV5.digest.ask.about", { title: i }) };
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
), ne = k(() => ({
|
|
269
|
+
title: s("reportV5.digest.ask.title"),
|
|
270
|
+
welcome: s("reportV5.digest.ask.welcome"),
|
|
271
|
+
hint: s("reportV5.digest.ask.hint", { subject: A.value }),
|
|
272
|
+
target: s("reportV5.digest.ask.target", { subject: A.value }),
|
|
273
|
+
placeholder: s("reportV5.digest.ask.title"),
|
|
274
|
+
outcomes: {
|
|
275
|
+
withheld: s("reportV5.digest.ask.withheld"),
|
|
276
|
+
failed: s("reportV5.digest.ask.failed"),
|
|
277
|
+
stopped: s("reportV5.digest.ask.stopped")
|
|
278
|
+
}
|
|
279
|
+
}));
|
|
280
|
+
function at() {
|
|
281
|
+
q.push({ name: "digest", query: E.query });
|
|
282
|
+
}
|
|
283
|
+
return pe(async () => {
|
|
284
|
+
window.addEventListener("keydown", ee);
|
|
285
|
+
try {
|
|
286
|
+
l.value = await Ct(x.value), St(x.value).catch(() => {
|
|
287
|
+
});
|
|
288
|
+
} catch (e) {
|
|
289
|
+
e instanceof de && e.status === 403 ? w.value = !0 : e instanceof de && e.status === 404 ? o.value = !0 : T.value = e instanceof Error ? e.message : String(e);
|
|
290
|
+
} finally {
|
|
291
|
+
v.value = !1;
|
|
292
|
+
}
|
|
293
|
+
P.subscription || await P.loadSubscription().catch(() => {
|
|
294
|
+
});
|
|
295
|
+
}), ot(() => window.removeEventListener("keydown", ee)), (e, a) => {
|
|
296
|
+
const i = $("FmTooltip"), g = $("FmPageHead"), S = $("FmButton"), O = $("FmCircularProgress");
|
|
297
|
+
return c(), V(ct, null, {
|
|
298
|
+
default: F(() => [
|
|
299
|
+
y("div", {
|
|
300
|
+
ref_key: "root",
|
|
301
|
+
ref: me,
|
|
302
|
+
class: "relative flex h-full min-h-0 w-full"
|
|
303
|
+
}, [
|
|
304
|
+
y("div", At, [
|
|
305
|
+
R(g, {
|
|
306
|
+
class: "shrink-0",
|
|
307
|
+
title: A.value || t(s)("reportV5.digest.title"),
|
|
308
|
+
"back-button": !0,
|
|
309
|
+
"data-testid": "digest-reader-head",
|
|
310
|
+
"onClick:back": at
|
|
311
|
+
}, rt({
|
|
312
|
+
title: F(() => [
|
|
313
|
+
R(i, {
|
|
314
|
+
content: A.value,
|
|
315
|
+
placement: "bottom",
|
|
316
|
+
"z-index": 2e3,
|
|
317
|
+
class: "flex min-w-0 max-w-full justify-start"
|
|
318
|
+
}, {
|
|
319
|
+
default: F(() => [
|
|
320
|
+
y("p", Ft, D(A.value || t(s)("reportV5.digest.title")), 1)
|
|
321
|
+
]),
|
|
322
|
+
_: 1
|
|
323
|
+
}, 8, ["content"])
|
|
324
|
+
]),
|
|
325
|
+
_: 2
|
|
326
|
+
}, [
|
|
327
|
+
t(m).lg || t(m).md ? {
|
|
328
|
+
name: "append",
|
|
329
|
+
fn: F(() => [
|
|
330
|
+
l.value ? (c(), V(bt, { key: 0 })) : _("", !0)
|
|
331
|
+
]),
|
|
332
|
+
key: "0"
|
|
333
|
+
} : void 0
|
|
334
|
+
]), 1032, ["title"]),
|
|
335
|
+
l.value ? (c(), h("div", Dt, [
|
|
336
|
+
y("span", Mt, D(t(s)("reportV5.digest.card.weekly")), 1),
|
|
337
|
+
y("span", $t, D(et.value), 1),
|
|
338
|
+
a[9] || (a[9] = y("span", { class: "grow" }, null, -1)),
|
|
339
|
+
d.value && t(b).length && !t(U) ? (c(), V(S, {
|
|
340
|
+
key: 0,
|
|
341
|
+
"data-testid": "digest-ask-picked",
|
|
342
|
+
variant: "tertiary",
|
|
343
|
+
size: "sm",
|
|
344
|
+
"prepend-icon": "auto_awesome",
|
|
345
|
+
label: t(s)("reportV5.digest.ask.askPicked"),
|
|
346
|
+
onClick: Ee
|
|
347
|
+
}, null, 8, ["label"])) : d.value ? (c(), h("span", Bt, D(t(b).length ? t(s)("reportV5.digest.ask.picked", { count: t(b).length }) : t(s)(t(Ve) ? "reportV5.digest.ask.pickingTouch" : "reportV5.digest.ask.picking")), 1)) : _("", !0),
|
|
348
|
+
R(i, {
|
|
349
|
+
placement: "bottom",
|
|
350
|
+
content: d.value ? t(s)("reportV5.reportAi.chat.cancelSelection") : t(s)("reportV5.digest.ask.comment")
|
|
351
|
+
}, {
|
|
352
|
+
default: F(() => [
|
|
353
|
+
y("button", {
|
|
354
|
+
"data-testid": "digest-comment-toggle",
|
|
355
|
+
class: le(["digest-comment flex h-32 w-32 items-center justify-center rounded-md text-fm-color-typo-secondary disabled:opacity-50", d.value && "bg-fm-color-neutral-gray-100 text-fm-color-primary"]),
|
|
356
|
+
"aria-pressed": d.value,
|
|
357
|
+
"aria-label": t(s)("reportV5.digest.ask.comment"),
|
|
358
|
+
disabled: C.value,
|
|
359
|
+
onClick: Re
|
|
360
|
+
}, [
|
|
361
|
+
(c(), h("svg", jt, [
|
|
362
|
+
y("path", {
|
|
363
|
+
d: "M5 3.5h5a6.5 6.5 0 1 1-6.5 6.5V5A1.5 1.5 0 0 1 5 3.5Z",
|
|
364
|
+
fill: d.value ? "currentColor" : "none",
|
|
365
|
+
stroke: "currentColor",
|
|
366
|
+
"stroke-width": "1.5",
|
|
367
|
+
"stroke-linecap": "round",
|
|
368
|
+
"stroke-linejoin": "round"
|
|
369
|
+
}, null, 8, It)
|
|
370
|
+
]))
|
|
371
|
+
], 10, Lt)
|
|
372
|
+
]),
|
|
373
|
+
_: 1
|
|
374
|
+
}, 8, ["content"]),
|
|
375
|
+
r.value ? _("", !0) : (c(), V(S, {
|
|
376
|
+
key: 2,
|
|
377
|
+
"data-testid": "digest-ask-open",
|
|
378
|
+
variant: "tertiary",
|
|
379
|
+
"prepend-icon": "auto_awesome",
|
|
380
|
+
label: t(s)("reportV5.digest.ask.title"),
|
|
381
|
+
onClick: a[0] || (a[0] = (p) => r.value = !0)
|
|
382
|
+
}, null, 8, ["label"]))
|
|
383
|
+
])) : _("", !0),
|
|
384
|
+
w.value ? (c(), V(ce, {
|
|
385
|
+
key: 1,
|
|
386
|
+
"data-testid": "digest-refused",
|
|
387
|
+
title: t(s)("reportV5.digest.refusedTitle"),
|
|
388
|
+
"sub-title": t(s)("reportV5.digest.refusedBody")
|
|
389
|
+
}, null, 8, ["title", "sub-title"])) : o.value ? (c(), V(ce, {
|
|
390
|
+
key: 2,
|
|
391
|
+
title: t(s)("reportV5.digest.missingTitle"),
|
|
392
|
+
"sub-title": t(s)("reportV5.digest.missingBody")
|
|
393
|
+
}, null, 8, ["title", "sub-title"])) : T.value ? (c(), h("p", zt, D(T.value), 1)) : v.value ? (c(), h("div", Ot, [
|
|
394
|
+
R(O, { size: "xl" })
|
|
395
|
+
])) : l.value ? (c(), h("div", qt, [
|
|
396
|
+
R(_t, {
|
|
397
|
+
"hide-subscribed": "",
|
|
398
|
+
class: "m-16 shrink-0"
|
|
399
|
+
}),
|
|
400
|
+
(c(), V(Tt, {
|
|
401
|
+
key: `${l.value.weekStart}:${l.value.createdAt}`,
|
|
402
|
+
digest: l.value,
|
|
403
|
+
"comment-mode": d.value && !C.value,
|
|
404
|
+
picked: t(he),
|
|
405
|
+
onSelect: Ce,
|
|
406
|
+
onArea: Se,
|
|
407
|
+
onCancel: I
|
|
408
|
+
}, null, 8, ["digest", "comment-mode", "picked"]))
|
|
409
|
+
])) : _("", !0)
|
|
410
|
+
]),
|
|
411
|
+
t(H) ? (c(), h("div", {
|
|
412
|
+
key: 0,
|
|
413
|
+
class: "digest-scrim absolute inset-0 z-20",
|
|
414
|
+
onClick: a[1] || (a[1] = (p) => r.value = !1)
|
|
415
|
+
})) : _("", !0),
|
|
416
|
+
r.value && l.value && (t(U) || !K.value) ? (c(), h("div", {
|
|
417
|
+
key: 1,
|
|
418
|
+
ref_key: "drawer",
|
|
419
|
+
ref: ve,
|
|
420
|
+
"data-testid": "digest-chat",
|
|
421
|
+
class: le(
|
|
422
|
+
t(U) ? "w-[380px] shrink-0" : "absolute inset-y-0 right-0 z-30 w-full max-w-[380px] shadow-lg"
|
|
423
|
+
),
|
|
424
|
+
role: t(H) ? "dialog" : void 0,
|
|
425
|
+
"aria-modal": t(H) ? "true" : void 0,
|
|
426
|
+
"aria-label": ne.value.title
|
|
427
|
+
}, [
|
|
428
|
+
R(ht, {
|
|
429
|
+
"home-draft": J.value,
|
|
430
|
+
"onUpdate:homeDraft": a[2] || (a[2] = (p) => J.value = p),
|
|
431
|
+
"home-open": L.value,
|
|
432
|
+
"onUpdate:homeOpen": a[3] || (a[3] = (p) => L.value = p),
|
|
433
|
+
messages: t(Pe),
|
|
434
|
+
draft: n.value,
|
|
435
|
+
targets: t(ke),
|
|
436
|
+
"target-stale": t(X),
|
|
437
|
+
streaming: C.value,
|
|
438
|
+
"turn-id": t(je),
|
|
439
|
+
phase: t(Ie) ?? "working",
|
|
440
|
+
slow: t(Ue),
|
|
441
|
+
"started-at": t(He),
|
|
442
|
+
error: t(ae),
|
|
443
|
+
interrupted: t(ze),
|
|
444
|
+
blank: !1,
|
|
445
|
+
run: null,
|
|
446
|
+
"run-anchor-id": null,
|
|
447
|
+
"run-stale": !1,
|
|
448
|
+
"retry-error": "",
|
|
449
|
+
"unsent-ids": t(Ne),
|
|
450
|
+
"no-reply-id": t(Ge),
|
|
451
|
+
"chat-id": t(Te),
|
|
452
|
+
"chat-title": t(Ae),
|
|
453
|
+
chats: t(Fe),
|
|
454
|
+
"chats-cursor": t(te),
|
|
455
|
+
"chats-loading": t(De),
|
|
456
|
+
"chats-error": t(Me),
|
|
457
|
+
switching: t(G),
|
|
458
|
+
busy: se.value,
|
|
459
|
+
stoppable: t(Oe),
|
|
460
|
+
stopping: t(qe),
|
|
461
|
+
earlier: t($e),
|
|
462
|
+
"loading-earlier": t(Be),
|
|
463
|
+
copy: ne.value,
|
|
464
|
+
starters: tt.value,
|
|
465
|
+
"onUpdate:draft": a[4] || (a[4] = (p) => n.value = p),
|
|
466
|
+
onClearTarget: t(be),
|
|
467
|
+
onSubmit: z,
|
|
468
|
+
onClose: a[5] || (a[5] = (p) => r.value = !1),
|
|
469
|
+
onResend: Je,
|
|
470
|
+
onAskAgain: Xe,
|
|
471
|
+
onEditRequest: We,
|
|
472
|
+
onStop: Ke,
|
|
473
|
+
onNewChat: Qe,
|
|
474
|
+
onSelectChat: Ze,
|
|
475
|
+
onLoadChats: a[6] || (a[6] = (p) => t(u).loadChats()),
|
|
476
|
+
onLoadMoreChats: a[7] || (a[7] = (p) => t(u).loadChats(t(te) ?? void 0)),
|
|
477
|
+
onLoadEarlier: a[8] || (a[8] = (p) => t(u).loadEarlier())
|
|
478
|
+
}, null, 8, ["home-draft", "home-open", "messages", "draft", "targets", "target-stale", "streaming", "turn-id", "phase", "slow", "started-at", "error", "interrupted", "unsent-ids", "no-reply-id", "chat-id", "chat-title", "chats", "chats-cursor", "chats-loading", "chats-error", "switching", "busy", "stoppable", "stopping", "earlier", "loading-earlier", "copy", "starters", "onClearTarget"])
|
|
479
|
+
], 10, Nt)) : _("", !0)
|
|
480
|
+
], 512)
|
|
481
|
+
]),
|
|
482
|
+
_: 1
|
|
483
|
+
});
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
}), ta = /* @__PURE__ */ Vt(Ut, [["__scopeId", "data-v-bc7eaf2b"]]);
|
|
487
|
+
export {
|
|
488
|
+
ta as default
|
|
489
|
+
};
|