@feedmepos/mf-report 5.28.0 → 5.28.1

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 (29) hide show
  1. package/dist/{App-BDhSFQX_.js → App-BQcj7ZgK.js} +4 -4
  2. package/dist/{DateRangeSelect-CRsKMi0U.js → DateRangeSelect-TQA-9XXm.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-WGOOX2b8.js → Default.vue_vue_type_script_setup_true_lang-2PkkRpW_.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-CQM-l5Rk.js → DynamicWidget.vue_vue_type_script_setup_true_lang-BpZh4FDA.js} +4 -4
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CMioHpn1.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Ddimiuh3.js} +3 -3
  6. package/dist/{InsightView-lnOobZAr.js → InsightView-BG5IeWD1.js} +5 -5
  7. package/dist/{Integration-D5ssimUg.js → Integration-DUBg0wiX.js} +3 -3
  8. package/dist/{Integrations-CaqGvkzI.js → Integrations-CerT8IlU.js} +2 -2
  9. package/dist/{Layout-DS0XCT_E.js → Layout-Rr16bUkn.js} +1 -1
  10. package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-DC9QYJk-.js → LocationSelect.vue_vue_type_script_setup_true_lang-BEUDpozo.js} +2 -2
  11. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-nOukNXp3.js → MenuTab.vue_vue_type_script_setup_true_lang-Ca-Vlwmm.js} +5 -5
  12. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-DXNbt08D.js → NavigationTab.vue_vue_type_script_setup_true_lang-IJ7NUGbC.js} +5 -5
  13. package/dist/{OverviewView-BkIozvMs.js → OverviewView-D5q_5KwX.js} +4 -4
  14. package/dist/{Report-HiSGRNhn.js → Report-CDk8BkDF.js} +3 -3
  15. package/dist/{report-canvas-frame.html → ReportCanvasView-BNy6YAj6.js} +465 -17
  16. package/dist/{ReportEditor-B4tyVB8s.js → ReportEditor-JAgqGYhA.js} +7 -7
  17. package/dist/{ReportView-CIQQHvWT.js → ReportView-C3LFd5yk.js} +6 -6
  18. package/dist/{ReportViewRoute-B3KwVB0v.js → ReportViewRoute-NmDrsao2.js} +2 -2
  19. package/dist/{Setting-CvToMUKq.js → Setting-BCBWGuMP.js} +3 -3
  20. package/dist/{Template-BBQEaHrM.js → Template-B0Z7IA2P.js} +3 -3
  21. package/dist/{TileEditor-Cqy98LmJ.js → TileEditor-CUUIrvVX.js} +6 -6
  22. package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-CzggUdfI.js → TilePageStack.vue_vue_type_script_setup_true_lang-ByOoDTHP.js} +2 -2
  23. package/dist/{TransitionFade-D-8BYs6T.js → TransitionFade-DVVKEBlH.js} +5 -5
  24. package/dist/{app-Bjt_JuJi.js → app-CVVEOyIu.js} +12 -12
  25. package/dist/app.js +1 -1
  26. package/dist/{report-DjGDWvm3.js → report-35Rm6TvO.js} +1 -1
  27. package/dist/{useRestaurantPermission-Dkbh_cv8.js → useRestaurantPermission-BAkRCzWY.js} +1 -1
  28. package/package.json +1 -1
  29. package/dist/ReportCanvasView-ILVhB1KL.js +0 -448
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as o, resolveComponent as t, createBlock as r, openBlock as n, withCtx as _, createVNode as c } from "vue";
2
- import { _ as a } from "./Default.vue_vue_type_script_setup_true_lang-WGOOX2b8.js";
2
+ import { _ as a } from "./Default.vue_vue_type_script_setup_true_lang-2PkkRpW_.js";
3
3
  const f = /* @__PURE__ */ o({
4
4
  __name: "Layout",
5
5
  setup(m) {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as Zt, mergeModels as du, useModel as tl, ref as ve, createElementBlock as ce, onMounted as ry, openBlock as N, Fragment as Ze, createBlock as de, createCommentVNode as Oe, unref as yt, computed as Ee, watch as Jn, resolveComponent as W, createElementVNode as ne, createVNode as R, renderList as jt, withCtx as Se, toDisplayString as Bn, renderSlot as nl, mergeProps as ay, normalizeClass as rl, normalizeStyle as iy, withModifiers as lu, nextTick as uy } from "vue";
2
- import { _ as oy } from "./DateRangeSelect-CRsKMi0U.js";
3
- import { a as sy } from "./app-Bjt_JuJi.js";
2
+ import { _ as oy } from "./DateRangeSelect-TQA-9XXm.js";
3
+ import { a as sy } from "./app-CVVEOyIu.js";
4
4
  import { useBreakpoints as ly, useDialog as cy, useDialogChild as fy } from "@feedmepos/ui-library";
5
5
  import { u as dy } from "./_plugin-vue_export-helper-C6QDExPN.js";
6
6
  const py = { class: "px-8" }, hy = { class: "max-h-[160px] overflow-y-auto" }, vy = /* @__PURE__ */ Zt({
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as S, computed as w, watch as A, createElementBlock as k, openBlock as d, createElementVNode as C, createVNode as p, unref as t, isRef as g, withCtx as y, useModel as E, resolveComponent as x, normalizeClass as B, createBlock as b, createCommentVNode as I, Fragment as L, renderList as j, toDisplayString as q } from "vue";
2
- import { a as G, h as H, g as J, i as K, j as Q, k as M } from "./app-Bjt_JuJi.js";
2
+ import { a as G, h as H, g as J, i as K, j as Q, k as M } from "./app-CVVEOyIu.js";
3
3
  import { storeToRefs as F } from "pinia";
4
- import { _ as X } from "./LocationSelect.vue_vue_type_script_setup_true_lang-DC9QYJk-.js";
5
- import { D as Y } from "./DateRangeSelect-CRsKMi0U.js";
6
- import { f as Z, _ as h } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CMioHpn1.js";
4
+ import { _ as X } from "./LocationSelect.vue_vue_type_script_setup_true_lang-BEUDpozo.js";
5
+ import { D as Y } from "./DateRangeSelect-TQA-9XXm.js";
6
+ import { f as Z, _ as h } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Ddimiuh3.js";
7
7
  import { useRoute as ee } from "vue-router";
8
- import { u as te, o as ae } from "./report-DjGDWvm3.js";
8
+ import { u as te, o as ae } from "./report-35Rm6TvO.js";
9
9
  import { useBreakpoints as oe } from "@feedmepos/ui-library";
10
10
  const ne = { class: "flex flex-col gap-2 overflow-x-auto overflow-y-hidden scrollbar-hide" }, le = { class: "flex flex-col gap-2 py-2" }, re = /* @__PURE__ */ S({
11
11
  __name: "Filter",
@@ -4,15 +4,15 @@ var wn = (e, t, r) => so(e, typeof t != "symbol" ? t + "" : t, r);
4
4
  import { defineComponent as Ur, computed as Ne, useModel as ta, ref as xe, watch as ct, resolveComponent as ye, createBlock as Ge, unref as b, openBlock as fe, withCtx as De, createElementVNode as q, createVNode as re, toDisplayString as me, withDirectives as Aa, createElementBlock as be, Fragment as gr, renderList as wr, vShow as $a, createTextVNode as Hr, mergeModels as fn, createCommentVNode as Je, normalizeClass as Va, onMounted as b2, withKeys as x2, withModifiers as en, isRef as st, vModelText as P2, normalizeStyle as Ti, resolveDynamicComponent as ii, createSlots as io } from "vue";
5
5
  import { useRouter as S2, useRoute as O2 } from "vue-router";
6
6
  import { storeToRefs as Lr, defineStore as ki } from "pinia";
7
- import { u as Ha, w as Kt, E as mt, y as rn, z as Vn, v as fo, o as lo, A as oo } from "./report-DjGDWvm3.js";
7
+ import { u as Ha, w as Kt, E as mt, y as rn, z as Vn, v as fo, o as lo, A as oo } from "./report-35Rm6TvO.js";
8
8
  import { useBreakpoints as Ls, components as ha, useSnackbar as ga, FmButtonVariant as c0 } from "@feedmepos/ui-library";
9
9
  import { u as ft, _ as D2 } from "./_plugin-vue_export-helper-C6QDExPN.js";
10
10
  import { a as u0 } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
11
- import { C as dr, g as co, a as Qt, b as I2, D as L2 } from "./DateRangeSelect-CRsKMi0U.js";
12
- import { u as wt, F as yt, X as un, a as wa, d as Ze, q as Gn, Y as F2, Z as uo, z as Ao, e as ho, n as yn, r as V2, c as po, _ as vo } from "./app-Bjt_JuJi.js";
11
+ import { C as dr, g as co, a as Qt, b as I2, D as L2 } from "./DateRangeSelect-TQA-9XXm.js";
12
+ import { u as wt, F as yt, X as un, a as wa, d as Ze, q as Gn, Y as F2, Z as uo, z as Ao, e as ho, n as yn, r as V2, c as po, _ as vo } from "./app-CVVEOyIu.js";
13
13
  import { detectLocale as mo, useCoreStore as go } from "@feedmepos/mf-common";
14
- import { k as A0, l as wo, f as Ci, a as yo, _ as N2, i as To, r as ko, R as Nt, m as Co } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CMioHpn1.js";
15
- import { _ as M2 } from "./LocationSelect.vue_vue_type_script_setup_true_lang-DC9QYJk-.js";
14
+ import { k as A0, l as wo, f as Ci, a as yo, _ as N2, i as To, r as ko, R as Nt, m as Co } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Ddimiuh3.js";
15
+ import { _ as M2 } from "./LocationSelect.vue_vue_type_script_setup_true_lang-BEUDpozo.js";
16
16
  import { p as Eo } from "./index-CtZE4sab.js";
17
17
  const bo = { class: "flex flex-col" }, xo = { class: "fm-typo-en-title-sm-600" }, Po = { class: "grow" }, So = { class: "flex flex-col gap-8" }, Oo = { class: "flex flex-col w-full" }, Do = { class: "flex flex-col gap-5 p-6" }, Io = { class: "flex" }, h0 = {
18
18
  // sales: [
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as g, computed as s, resolveComponent as w, createBlock as l, openBlock as i, withCtx as y, createVNode as p, createElementVNode as c, unref as e, normalizeStyle as k, normalizeClass as b } from "vue";
2
- import { _ as h } from "./TilePageStack.vue_vue_type_script_setup_true_lang-CzggUdfI.js";
3
- import { u as I, l as $ } from "./report-DjGDWvm3.js";
4
- import { _ as C } from "./Default.vue_vue_type_script_setup_true_lang-WGOOX2b8.js";
2
+ import { _ as h } from "./TilePageStack.vue_vue_type_script_setup_true_lang-ByOoDTHP.js";
3
+ import { u as I, l as $ } from "./report-35Rm6TvO.js";
4
+ import { _ as C } from "./Default.vue_vue_type_script_setup_true_lang-2PkkRpW_.js";
5
5
  import { storeToRefs as B } from "pinia";
6
6
  import { _ as z } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
7
7
  import { useBreakpoints as P } from "@feedmepos/ui-library";
8
- import { _ as R } from "./MenuTab.vue_vue_type_script_setup_true_lang-nOukNXp3.js";
8
+ import { _ as R } from "./MenuTab.vue_vue_type_script_setup_true_lang-Ca-Vlwmm.js";
9
9
  import { useI18n as S } from "@feedmepos/mf-common";
10
10
  import { r as V } from "./i18n-DbyciK4x.js";
11
11
  const D = { class: "sticky top-0 z-10 bg-white" }, K = /* @__PURE__ */ g({
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as Ie, ref as Q, watch as de, computed as h, h as d, withModifiers as Fe, resolveComponent as x, createBlock as W, openBlock as T, withCtx as m, createVNode as i, createElementVNode as g, unref as e, normalizeStyle as Oe, normalizeClass as y, withDirectives as fe, createElementBlock as Pe, Fragment as Le, renderList as Ne, toDisplayString as _, createTextVNode as Ve, vShow as ye } from "vue";
2
2
  import { storeToRefs as ve } from "pinia";
3
- import { u as Ae } from "./report-DjGDWvm3.js";
4
- import { _ as Te } from "./Default.vue_vue_type_script_setup_true_lang-WGOOX2b8.js";
3
+ import { u as Ae } from "./report-35Rm6TvO.js";
4
+ import { _ as Te } from "./Default.vue_vue_type_script_setup_true_lang-2PkkRpW_.js";
5
5
  import { u as Je } from "./message-dialog-UoMWOnil.js";
6
6
  import { u as ze } from "./global-loader-BuxFfehu.js";
7
7
  import { useSnackbar as Be, useBreakpoints as Ue, components as Ee, FmButtonColorThemeVariant as Ke } from "@feedmepos/ui-library";
8
8
  import { _ as Me } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
9
- import { c as Ye, a as ge, h as qe } from "./app-Bjt_JuJi.js";
9
+ import { c as Ye, a as ge, h as qe } from "./app-CVVEOyIu.js";
10
10
  import { useRouter as je, useRoute as Ge, onBeforeRouteLeave as He } from "vue-router";
11
11
  import { useI18n as Qe } from "@feedmepos/mf-common";
12
12
  import { r as X } from "./i18n-DbyciK4x.js";
@@ -1,4 +1,245 @@
1
- <meta charset="utf-8" />
1
+ import { ref as q, shallowRef as en, onMounted as W, onBeforeUnmount as tn, defineComponent as rn, watch as H, computed as on, createElementBlock as T, openBlock as L, createElementVNode as P, createCommentVNode as U, withDirectives as an, createVNode as V, unref as j, isRef as F, withCtx as sn, toDisplayString as J, vShow as dn } from "vue";
2
+ import { useRoute as cn } from "vue-router";
3
+ import { u as ln } from "./_plugin-vue_export-helper-C6QDExPN.js";
4
+ import { storeToRefs as N } from "pinia";
5
+ import { _ as un } from "./LocationSelect.vue_vue_type_script_setup_true_lang-BEUDpozo.js";
6
+ import { D as fn } from "./DateRangeSelect-TQA-9XXm.js";
7
+ import { F as B, r as D, u as G, a as X, a0 as mn } from "./app-CVVEOyIu.js";
8
+ function $(r) {
9
+ const { businessId: c } = N(G());
10
+ if (!c.value) throw new Error("Business Id is not defined");
11
+ return `/${c.value}/report-canvas/${r}`;
12
+ }
13
+ const pn = (r) => {
14
+ const c = {
15
+ fetchType: B.Get,
16
+ url: $(r)
17
+ };
18
+ return D.fetch(c);
19
+ }, gn = (r, c, l, s) => {
20
+ const p = {
21
+ fetchType: B.Post,
22
+ url: `${$(r)}/query/${c}`,
23
+ data: { params: l, timezone: s }
24
+ };
25
+ return D.fetch(p);
26
+ }, hn = (r, c, l) => {
27
+ const s = {
28
+ fetchType: B.Post,
29
+ url: `${$(r)}/section/${c}/ack`,
30
+ data: l
31
+ };
32
+ return D.fetch(s);
33
+ }, vn = ["@from", "@to", "@locationIds", "@timezone"], bn = ["@from", "@to", "@locationIds"], yn = 1, xn = 1500;
34
+ function wn(r) {
35
+ if (!(!(r instanceof mn) || r.status !== 429))
36
+ return Math.min(Math.max(r.retryAfterMs ?? xn, 500), 5e3);
37
+ }
38
+ const kn = {
39
+ MY: "MYR",
40
+ SG: "SGD",
41
+ TH: "THB",
42
+ ID: "IDR",
43
+ PH: "PHP",
44
+ VN: "VND",
45
+ BN: "BND",
46
+ KH: "KHR",
47
+ MM: "MMK",
48
+ AE: "AED",
49
+ MO: "MOP",
50
+ MV: "MVR",
51
+ AU: "AUD",
52
+ JP: "JPY",
53
+ TW: "TWD",
54
+ HK: "HKD"
55
+ };
56
+ function K(r) {
57
+ return r == null ? !0 : Array.isArray(r) ? r.length === 0 : r === "";
58
+ }
59
+ function In(r) {
60
+ const c = X(), { dateRange: l, selectedLocationIds: s, locations: p, timezone: g } = N(c), { country: I } = N(G()), o = q({}), i = en({}), w = q([]), S = [], y = {}, h = {};
61
+ function C(n) {
62
+ S.push(n);
63
+ }
64
+ function O(n) {
65
+ i.value = { ...i.value, [n.queryId]: n }, S.forEach((t) => t(n));
66
+ }
67
+ function _(n) {
68
+ const t = {};
69
+ for (const m of n.params)
70
+ t[m.name] = m.default ?? null;
71
+ t["@from"] = l.value.startDate ?? null, t["@to"] = l.value.endDate ?? null, t["@timezone"] = g.value, t["@locationIds"] = s.value.length ? [...s.value] : p.value.map((m) => m.id), o.value = t;
72
+ }
73
+ function a() {
74
+ return {
75
+ locations: p.value.map((n) => ({
76
+ id: n.id,
77
+ name: n.name || n.id,
78
+ code: n.code
79
+ })),
80
+ timezone: g.value,
81
+ locale: navigator.language || "en-US",
82
+ currency: kn[(I.value || "").toUpperCase()] ?? ""
83
+ };
84
+ }
85
+ function v(n) {
86
+ return JSON.stringify(n.dependsOn.map((t) => o.value[t] ?? null));
87
+ }
88
+ function x(n) {
89
+ return !!n.lazy && n.dependsOn.some((t) => K(o.value[t] ?? null));
90
+ }
91
+ function A() {
92
+ return !bn.some((n) => n in o.value && K(o.value[n] ?? null));
93
+ }
94
+ async function E(n) {
95
+ var m;
96
+ const t = (y[n.id] ?? 0) + 1;
97
+ y[n.id] = t, O({
98
+ queryId: n.id,
99
+ runId: t,
100
+ status: "loading",
101
+ rows: ((m = i.value[n.id]) == null ? void 0 : m.rows) ?? [],
102
+ truncated: !1
103
+ });
104
+ for (let k = 0; ; k++)
105
+ try {
106
+ const b = await gn(
107
+ r,
108
+ n.id,
109
+ o.value,
110
+ g.value
111
+ );
112
+ if (y[n.id] !== t) return;
113
+ O({
114
+ queryId: n.id,
115
+ runId: t,
116
+ status: "ok",
117
+ rows: b.rows ?? [],
118
+ truncated: !!b.truncated
119
+ });
120
+ return;
121
+ } catch (b) {
122
+ if (y[n.id] !== t) return;
123
+ const f = wn(b);
124
+ if (f !== void 0 && k < yn) {
125
+ if (await new Promise((d) => setTimeout(d, f)), y[n.id] !== t) return;
126
+ continue;
127
+ }
128
+ O({
129
+ queryId: n.id,
130
+ runId: t,
131
+ status: "error",
132
+ rows: [],
133
+ truncated: !1,
134
+ error: b instanceof Error ? b.message : String(b)
135
+ });
136
+ return;
137
+ }
138
+ }
139
+ function R(n = {}) {
140
+ var m, k, b;
141
+ const t = !A();
142
+ for (const f of w.value) {
143
+ if (x(f)) {
144
+ delete h[f.id], ((m = i.value[f.id]) == null ? void 0 : m.status) !== "idle" && O({
145
+ queryId: f.id,
146
+ runId: y[f.id] ?? 0,
147
+ status: "idle",
148
+ rows: [],
149
+ truncated: !1
150
+ });
151
+ continue;
152
+ }
153
+ if (t) {
154
+ ((k = i.value[f.id]) == null ? void 0 : k.status) !== "loading" && O({
155
+ queryId: f.id,
156
+ runId: y[f.id] ?? 0,
157
+ status: "loading",
158
+ rows: ((b = i.value[f.id]) == null ? void 0 : b.rows) ?? [],
159
+ truncated: !1
160
+ });
161
+ continue;
162
+ }
163
+ const d = v(f);
164
+ !n.force && h[f.id] === d || (h[f.id] = d, E(f));
165
+ }
166
+ }
167
+ function M(n) {
168
+ const t = { ...o.value };
169
+ let m = !1;
170
+ for (const [k, b] of Object.entries(n))
171
+ k in t && JSON.stringify(t[k] ?? null) !== JSON.stringify(b ?? null) && (t[k] = b, m = !0);
172
+ return m ? (o.value = t, R(), !0) : !1;
173
+ }
174
+ function e(n) {
175
+ w.value = n.queries, i.value = {};
176
+ for (const t of Object.keys(y)) delete y[t];
177
+ for (const t of Object.keys(h)) delete h[t];
178
+ _(n), R();
179
+ }
180
+ function u(n, t = []) {
181
+ w.value = n.queries;
182
+ const m = JSON.stringify(o.value), k = {};
183
+ for (const d of n.params)
184
+ k[d.name] = d.name in o.value ? o.value[d.name] : d.default ?? null;
185
+ o.value = k;
186
+ const b = new Set(n.queries.map((d) => d.id));
187
+ for (const d of Object.keys(y)) b.has(d) || delete y[d];
188
+ for (const d of Object.keys(h)) b.has(d) || delete h[d];
189
+ const f = Object.keys(i.value).filter((d) => !b.has(d));
190
+ if (f.length) {
191
+ const d = { ...i.value };
192
+ for (const nn of f) delete d[nn];
193
+ i.value = d;
194
+ }
195
+ for (const d of t) delete h[d];
196
+ return R(), JSON.stringify(o.value) !== m;
197
+ }
198
+ return {
199
+ params: o,
200
+ results: i,
201
+ queries: w,
202
+ env: a,
203
+ load: e,
204
+ applyCanvas: u,
205
+ run: R,
206
+ setParams: M,
207
+ onResult: C,
208
+ RESERVED: vn
209
+ };
210
+ }
211
+ function En(r) {
212
+ const c = r.replace(/^\//, "");
213
+ try {
214
+ const l = new URL(import.meta.url);
215
+ if (typeof location < "u" && location.hostname !== l.hostname)
216
+ return new URL(c, l).href;
217
+ } catch {
218
+ }
219
+ return `${"/".replace(/\/$/, "")}/${c}`;
220
+ }
221
+ const Z = {
222
+ "chart.js@4": "chart.js-4.js",
223
+ "fm-ui@1": "fm-ui-1.js"
224
+ }, z = /* @__PURE__ */ new Map();
225
+ function Sn(r) {
226
+ return En(`report-canvas-libs/${Z[r]}`);
227
+ }
228
+ async function Y(r) {
229
+ const c = [...new Set(r)].filter((s) => Z[s]), l = {};
230
+ return await Promise.all(
231
+ c.map(async (s) => {
232
+ if (!z.has(s)) {
233
+ const g = await fetch(Sn(s));
234
+ if (!g.ok) return;
235
+ z.set(s, await g.text());
236
+ }
237
+ const p = z.get(s);
238
+ p && (l[s] = p);
239
+ })
240
+ ), l;
241
+ }
242
+ const On = `<meta charset="utf-8" />
2
243
  <meta name="viewport" content="width=device-width, initial-scale=1" />
3
244
  <!--
4
245
  Runtime shell for AI-written report sections. Loaded into ONE iframe per report with
@@ -492,8 +733,8 @@
492
733
 
493
734
  /**
494
735
  * Section code shares this window and can call parent.postMessage itself, so a render
495
- * outcome carries a nonce only this closure holds — never on `window`, never in the DOM.
496
- * The host learns it from `ready` and drops any ack without it.
736
+ * outcome carries a nonce only this closure holds — never on \`window\`, never in the DOM.
737
+ * The host learns it from \`ready\` and drops any ack without it.
497
738
  */
498
739
  var NONCE = (function () {
499
740
  try {
@@ -561,7 +802,7 @@
561
802
  }
562
803
 
563
804
  function renderMarkdown(source) {
564
- var lines = escapeHtml(String(source || "")).split(/\r?\n/)
805
+ var lines = escapeHtml(String(source || "")).split(/\\r?\\n/)
565
806
  var out = []
566
807
  var list = null
567
808
  function closeList() {
@@ -572,9 +813,9 @@
572
813
  }
573
814
  for (var i = 0; i < lines.length; i++) {
574
815
  var line = lines[i]
575
- var heading = /^(#{1,3})\s+(.*)$/.exec(line)
576
- var bullet = /^\s*[-*]\s+(.*)$/.exec(line)
577
- var numbered = /^\s*\d+\.\s+(.*)$/.exec(line)
816
+ var heading = /^(#{1,3})\\s+(.*)$/.exec(line)
817
+ var bullet = /^\\s*[-*]\\s+(.*)$/.exec(line)
818
+ var numbered = /^\\s*\\d+\\.\\s+(.*)$/.exec(line)
578
819
  if (heading) {
579
820
  closeList()
580
821
  var level = heading[1].length
@@ -599,10 +840,10 @@
599
840
 
600
841
  function inline(text) {
601
842
  return text
602
- .replace(/`([^`]+)`/g, "<code>$1</code>")
603
- .replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>")
604
- .replace(/(^|[^*])\*([^*]+)\*/g, "$1<em>$2</em>")
605
- .replace(/\[([^\]]+)\]\((https?:\/\/[^)\s]+|mailto:[^)\s]+)\)/g, function (_all, label, href) {
843
+ .replace(/\`([^\`]+)\`/g, "<code>$1</code>")
844
+ .replace(/\\*\\*([^*]+)\\*\\*/g, "<strong>$1</strong>")
845
+ .replace(/(^|[^*])\\*([^*]+)\\*/g, "$1<em>$2</em>")
846
+ .replace(/\\[([^\\]]+)\\]\\((https?:\\/\\/[^)\\s]+|mailto:[^)\\s]+)\\)/g, function (_all, label, href) {
606
847
  return '<a href="' + href + '" target="_blank" rel="noreferrer noopener">' + label + "</a>"
607
848
  })
608
849
  }
@@ -637,8 +878,8 @@
637
878
 
638
879
  /**
639
880
  * Sections share one DOM and one CSS cascade on purpose, but top-level JS is wrapped
640
- * so two sections cannot collide on a `const` — they share state through `window`.
641
- * Always attempts the persisted source, even one saved as `status: "error"`: that is
881
+ * so two sections cannot collide on a \`const\` — they share state through \`window\`.
882
+ * Always attempts the persisted source, even one saved as \`status: "error"\`: that is
642
883
  * what "restore last good source" means, and a genuinely broken one throws and re-acks.
643
884
  */
644
885
  function mountSection(section) {
@@ -670,7 +911,7 @@
670
911
  // Inline scripts throw past the caller's try/catch, so wrap the source itself.
671
912
  scripts.forEach(function (code, index) {
672
913
  var tag = document.createElement("script")
673
- tag.textContent = "try{(function(){\n" + code + "\n})()}catch(e){window.FM.__err(e)}"
914
+ tag.textContent = "try{(function(){\\n" + code + "\\n})()}catch(e){window.FM.__err(e)}"
674
915
  el.appendChild(tag)
675
916
  void index
676
917
  })
@@ -766,7 +1007,7 @@
766
1007
  /**
767
1008
  * Every report gets the same loading affordance, so no section hand-rolls one: a scrim
768
1009
  * over each section whose declared query is in flight, plus one bar for the report.
769
- * Only `loading` counts — an idle lazy query keeps the empty state it was designed with,
1010
+ * Only \`loading\` counts — an idle lazy query keeps the empty state it was designed with,
770
1011
  * and a query the shell has not heard about yet is not assumed to be running.
771
1012
  */
772
1013
  function paintBusy() {
@@ -860,7 +1101,7 @@
860
1101
  params = data.values || {}
861
1102
  Object.keys(subs).forEach(notify)
862
1103
  break
863
- // Mutated in place, never replaced: sections captured `env` at mount and a new
1104
+ // Mutated in place, never replaced: sections captured \`env\` at mount and a new
864
1105
  // object would leave every one of them reading the empty first snapshot.
865
1106
  case "env":
866
1107
  Object.keys(env).forEach(function (key) { delete env[key] })
@@ -885,4 +1126,211 @@
885
1126
 
886
1127
  post({ type: "ready", nonce: NONCE })
887
1128
  })()
888
- </script>
1129
+ <\/script>
1130
+ `, Rn = On, Q = 8e3;
1131
+ function Cn(r, c) {
1132
+ const l = q(!1);
1133
+ let s = null;
1134
+ const p = /* @__PURE__ */ new Map();
1135
+ let g;
1136
+ const I = /* @__PURE__ */ new Map();
1137
+ function o() {
1138
+ var e;
1139
+ return ((e = r.value) == null ? void 0 : e.contentWindow) ?? null;
1140
+ }
1141
+ function i(e) {
1142
+ var u;
1143
+ (u = o()) == null || u.postMessage(JSON.parse(JSON.stringify(e)), "*");
1144
+ }
1145
+ function w(e) {
1146
+ const u = o();
1147
+ if (!u || e.source !== u) return;
1148
+ const n = e.data;
1149
+ if (!(!n || typeof n != "object"))
1150
+ switch (n.type) {
1151
+ case "ready":
1152
+ if (l.value) return;
1153
+ g = n.nonce, l.value = !0, s == null || s(), s = null, A();
1154
+ break;
1155
+ case "setParams":
1156
+ c.onSetParams(n.values ?? {});
1157
+ break;
1158
+ case "rendered":
1159
+ if (!S(n)) return;
1160
+ h(n.sectionId, n.version), c.onSectionRendered(n.sectionId, n.version);
1161
+ break;
1162
+ case "error":
1163
+ if (!S(n)) return;
1164
+ h(n.sectionId, n.version), c.onSectionError(n.sectionId, n.version, n.message);
1165
+ break;
1166
+ }
1167
+ }
1168
+ function S(e) {
1169
+ return !g || e.nonce === g ? !0 : (console.warn("[report-canvas] dropped a render outcome without the shell nonce"), !1);
1170
+ }
1171
+ function y(e, u) {
1172
+ return `${e}@${u}`;
1173
+ }
1174
+ function h(e, u) {
1175
+ if (u === void 0) return;
1176
+ const n = y(e, u), t = I.get(n);
1177
+ t !== void 0 && (clearTimeout(t), I.delete(n));
1178
+ }
1179
+ function C() {
1180
+ I.forEach((e) => clearTimeout(e)), I.clear();
1181
+ }
1182
+ function O(e) {
1183
+ for (const u of e) {
1184
+ const n = y(u.id, u.version);
1185
+ I.has(n) || I.set(
1186
+ n,
1187
+ setTimeout(() => {
1188
+ I.delete(n), c.onSectionError(
1189
+ u.id,
1190
+ u.version,
1191
+ `the section did not report a render within ${Q}ms`
1192
+ );
1193
+ }, Q)
1194
+ );
1195
+ }
1196
+ }
1197
+ async function _(e, u, n) {
1198
+ const t = await Y(e.flatMap((k) => k.libs ?? [])), m = () => {
1199
+ i({ type: "init", sections: e, params: u, libs: t, env: n }), C(), O(e);
1200
+ };
1201
+ l.value ? m() : s = m;
1202
+ }
1203
+ async function a(e) {
1204
+ const u = await Y(e.flatMap((n) => n.libs ?? []));
1205
+ i({ type: "sections", sections: e, libs: u }), O(e);
1206
+ }
1207
+ function v(e) {
1208
+ i({ type: "params", values: e });
1209
+ }
1210
+ function x(e) {
1211
+ i({ type: "env", env: e });
1212
+ }
1213
+ function A() {
1214
+ const e = [...p.values()];
1215
+ p.clear(), e.forEach(E);
1216
+ }
1217
+ function E(e) {
1218
+ i({
1219
+ type: "rows",
1220
+ queryId: e.queryId,
1221
+ runId: e.runId,
1222
+ rows: e.rows,
1223
+ status: e.status,
1224
+ truncated: e.truncated,
1225
+ error: e.error
1226
+ });
1227
+ }
1228
+ function R(e) {
1229
+ if (!l.value) {
1230
+ p.set(e.queryId, e);
1231
+ return;
1232
+ }
1233
+ E(e);
1234
+ }
1235
+ W(() => window.addEventListener("message", w)), tn(() => {
1236
+ window.removeEventListener("message", w), C();
1237
+ });
1238
+ function M() {
1239
+ l.value = !1, s = null, g = void 0, p.clear(), C();
1240
+ }
1241
+ return { ready: l, init: _, swapSections: a, pushParams: v, pushEnv: x, pushRows: R, reset: M };
1242
+ }
1243
+ const Mn = { class: "flex h-full min-h-0 w-full" }, jn = { class: "flex min-w-0 grow flex-col" }, qn = { class: "flex items-start overflow-x-auto border-b border-fm-color-border-secondary px-16 py-8 scrollbar-hide" }, _n = {
1244
+ key: 0,
1245
+ class: "fm-typo-en-body-xs-400 border-b border-fm-color-border-secondary bg-fm-color-system-warning-100 px-16 py-8"
1246
+ }, An = {
1247
+ key: 1,
1248
+ class: "fm-typo-en-body-sm-400 p-16 text-fm-color-typo-error"
1249
+ }, Nn = ["srcdoc", "title"], Hn = /* @__PURE__ */ rn({
1250
+ __name: "ReportCanvasView",
1251
+ setup(r) {
1252
+ const c = cn(), { t: l } = ln(), s = String(c.query.reportId ?? ""), p = q(), g = q(""), I = q(), o = In(s), { dateRange: i, selectedLocationIds: w, locations: S, timezone: y } = N(X()), h = Cn(I, {
1253
+ onSetParams: (a) => {
1254
+ o.setParams(a) && h.pushParams(o.params.value);
1255
+ },
1256
+ onSectionRendered: (a, v) => void C(a, v, "ok"),
1257
+ onSectionError: (a, v, x) => {
1258
+ console.warn("[report-canvas] section failed", { reportId: s, sectionId: a, message: x }), C(a, v, "error", x);
1259
+ }
1260
+ });
1261
+ o.onResult((a) => h.pushRows(a));
1262
+ async function C(a, v, x, A) {
1263
+ var M;
1264
+ const E = (M = p.value) == null ? void 0 : M.sections.find((e) => e.id === a);
1265
+ if (!E || v !== E.version) return;
1266
+ const R = x === "error" ? A ?? "the section failed to render" : void 0;
1267
+ if (!(E.status === x && E.error === R)) {
1268
+ E.status = x, E.error = R;
1269
+ try {
1270
+ await hn(s, a, { version: v, status: x, error: R });
1271
+ } catch (e) {
1272
+ console.warn("[report-canvas] ack failed", { reportId: s, sectionId: a, err: e });
1273
+ }
1274
+ }
1275
+ }
1276
+ async function O() {
1277
+ try {
1278
+ g.value = "";
1279
+ const a = await pn(s);
1280
+ p.value = a, o.load(a), await h.init(a.sections, o.params.value, o.env());
1281
+ } catch (a) {
1282
+ g.value = a instanceof Error ? a.message : String(a);
1283
+ }
1284
+ }
1285
+ H([i, w, S], () => {
1286
+ if (!p.value) return;
1287
+ o.setParams({
1288
+ "@from": i.value.startDate ?? null,
1289
+ "@to": i.value.endDate ?? null,
1290
+ "@locationIds": w.value.length ? [...w.value] : S.value.map((v) => v.id)
1291
+ }) && h.pushParams(o.params.value);
1292
+ }), H([S, y], () => {
1293
+ p.value && h.pushEnv(o.env());
1294
+ });
1295
+ const _ = on(
1296
+ () => Object.values(o.results.value).some((a) => a.truncated)
1297
+ );
1298
+ return W(async () => {
1299
+ await O();
1300
+ }), (a, v) => (L(), T("div", Mn, [
1301
+ P("div", jn, [
1302
+ P("div", qn, [
1303
+ V(un, {
1304
+ modelValue: j(w),
1305
+ "onUpdate:modelValue": v[1] || (v[1] = (x) => F(w) ? w.value = x : null),
1306
+ options: j(S)
1307
+ }, {
1308
+ default: sn(() => [
1309
+ V(fn, {
1310
+ "date-range": j(i),
1311
+ "onUpdate:dateRange": v[0] || (v[0] = (x) => F(i) ? i.value = x : null)
1312
+ }, null, 8, ["date-range"])
1313
+ ]),
1314
+ _: 1
1315
+ }, 8, ["modelValue", "options"])
1316
+ ]),
1317
+ _.value ? (L(), T("div", _n, J(j(l)("reportV5.reportCanvas.canvas.truncated")), 1)) : U("", !0),
1318
+ g.value ? (L(), T("p", An, J(g.value), 1)) : U("", !0),
1319
+ an(P("iframe", {
1320
+ ref_key: "frame",
1321
+ ref: I,
1322
+ "data-testid": "report-canvas-frame",
1323
+ class: "min-h-0 grow border-0",
1324
+ srcdoc: j(Rn),
1325
+ sandbox: "allow-scripts",
1326
+ title: j(l)("reportV5.reportCanvas.canvas.title")
1327
+ }, null, 8, Nn), [
1328
+ [dn, !g.value]
1329
+ ])
1330
+ ])
1331
+ ]));
1332
+ }
1333
+ });
1334
+ export {
1335
+ Hn as default
1336
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as we, mergeModels as ke, useModel as Te, ref as E, computed as g, resolveComponent as C, createBlock as x, openBlock as c, withCtx as w, createElementVNode as v, createVNode as u, unref as l, normalizeClass as Le, createTextVNode as Ae, toDisplayString as U, createElementBlock as M, Fragment as he, renderSlot as gt, createCommentVNode as I, watch as pe, renderList as Ee, onMounted as bt, onUnmounted as Dt, resolveDynamicComponent as It, isRef as yt, normalizeStyle as rt } from "vue";
2
- import { W as Ot, g as Ut, _ as Nt, a as Bt, e as De, S as We, d as ht, b as wt, T as Mt, c as Rt } from "./TransitionFade-D-8BYs6T.js";
3
- import { C as xe, D as te, b as ze, F as Je, c as Ie, u as it, i as Pe, d as ce, M as _t, r as zt, e as et, n as Pt, f as qt, g as Et, h as Lt, j as Gt, k as Wt, m as At, a as Ht, o as mt, p as tt, q as jt, Q as Ke, l as Jt, s as Kt } from "./report-DjGDWvm3.js";
2
+ import { W as Ot, g as Ut, _ as Nt, a as Bt, e as De, S as We, d as ht, b as wt, T as Mt, c as Rt } from "./TransitionFade-DVVKEBlH.js";
3
+ import { C as xe, D as te, b as ze, F as Je, c as Ie, u as it, i as Pe, d as ce, M as _t, r as zt, e as et, n as Pt, f as qt, g as Et, h as Lt, j as Gt, k as Wt, m as At, a as Ht, o as mt, p as tt, q as jt, Q as Ke, l as Jt, s as Kt } from "./report-35Rm6TvO.js";
4
4
  import { storeToRefs as qe } from "pinia";
5
5
  import { useRouter as st, useRoute as ut } from "vue-router";
6
6
  import { useBreakpoints as Qe, useSnackbar as Ft, FmButtonColorThemeVariant as Ce } from "@feedmepos/ui-library";
@@ -8,13 +8,13 @@ import { u as dt } from "./message-dialog-UoMWOnil.js";
8
8
  import { u as Qt } from "./global-loader-BuxFfehu.js";
9
9
  import { u as Ge } from "./_plugin-vue_export-helper-C6QDExPN.js";
10
10
  import { r as He } from "./i18n-DbyciK4x.js";
11
- import { _ as lt } from "./TilePageStack.vue_vue_type_script_setup_true_lang-CzggUdfI.js";
11
+ import { _ as lt } from "./TilePageStack.vue_vue_type_script_setup_true_lang-ByOoDTHP.js";
12
12
  import { a as ot, _ as at } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
13
- import { d as Yt, e as Xt, i as Zt } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-CQM-l5Rk.js";
14
- import { g as el, d as tl, _ as ct } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CMioHpn1.js";
13
+ import { d as Yt, e as Xt, i as Zt } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-BpZh4FDA.js";
14
+ import { g as el, d as tl, _ as ct } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Ddimiuh3.js";
15
15
  import { useCoreStore as ll } from "@feedmepos/mf-common";
16
- import { u as ol, a as al } from "./app-Bjt_JuJi.js";
17
- import { d as rl } from "./DateRangeSelect-CRsKMi0U.js";
16
+ import { u as ol, a as al } from "./app-CVVEOyIu.js";
17
+ import { d as rl } from "./DateRangeSelect-TQA-9XXm.js";
18
18
  const nl = /* @__PURE__ */ we({
19
19
  __name: "WidgetDialog",
20
20
  props: /* @__PURE__ */ ke({