@mx-cartographer/experiences 9.1.5 → 9.1.6
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/CHANGELOG.md +4 -0
- package/dist/{Analytics-CkYXKvco.mjs → Analytics-B8AaC22u.mjs} +2 -2
- package/dist/{Analytics-CkYXKvco.mjs.map → Analytics-B8AaC22u.mjs.map} +1 -1
- package/dist/ErrorBoundary-C7BlHx04.mjs +27 -0
- package/dist/ErrorBoundary-C7BlHx04.mjs.map +1 -0
- package/dist/GlobalCopyApi-CLhyon-B.mjs +145 -0
- package/dist/GlobalCopyApi-CLhyon-B.mjs.map +1 -0
- package/dist/{Help-zVZdcmlk.mjs → Help-D4sOpItq.mjs} +2 -2
- package/dist/{Help-zVZdcmlk.mjs.map → Help-D4sOpItq.mjs.map} +1 -1
- package/dist/{UserStore-DApsX4aO.mjs → UserStore-Bksi48jC.mjs} +66 -62
- package/dist/UserStore-Bksi48jC.mjs.map +1 -0
- package/dist/{ViewMoreMicroCard-fnwE0hqd.mjs → ViewMoreMicroCard-B4oeGrbE.mjs} +3 -3
- package/dist/{ViewMoreMicroCard-fnwE0hqd.mjs.map → ViewMoreMicroCard-B4oeGrbE.mjs.map} +1 -1
- package/dist/common/components/ErrorBoundary.d.ts +2 -0
- package/dist/common/index.es.js +3 -3
- package/dist/core/index.es.js +3 -3
- package/dist/core/stores/GlobalStore.d.ts +4 -2
- package/dist/core/types/Handlers.d.ts +1 -0
- package/dist/core/types/index.d.ts +1 -1
- package/dist/core/utils/Fetch.d.ts +4 -0
- package/dist/help/index.es.js +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/settings/index.es.js +1 -1
- package/dist/trends/index.es.js +1 -1
- package/package.json +1 -1
- package/dist/ErrorBoundary-CsdOcnJ9.mjs +0 -24
- package/dist/ErrorBoundary-CsdOcnJ9.mjs.map +0 -1
- package/dist/GlobalCopyApi-wcnDUzMV.mjs +0 -129
- package/dist/GlobalCopyApi-wcnDUzMV.mjs.map +0 -1
- package/dist/UserStore-DApsX4aO.mjs.map +0 -1
package/dist/core/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as g, a as m, b as C, c as N, d as h, B as f, e as E, f as D, g as b, C as I, h as M, i as R, j as B, D as L, F as G, k as _, G as H, l as P, m as U, n as x, o as O, H as F, p as k, q as v, r as w, M as W, s as Y, N as $, t as q, u as K, R as j, v as z, S as J, w as Q, T as X, x as Z, y as V, U as tt, z as at, W as st } from "../UserStore-
|
|
1
|
+
import { A as g, a as m, b as C, c as N, d as h, B as f, e as E, f as D, g as b, C as I, h as M, i as R, j as B, D as L, F as G, k as _, G as H, l as P, m as U, n as x, o as O, H as F, p as k, q as v, r as w, M as W, s as Y, N as $, t as q, u as K, R as j, v as z, S as J, w as Q, T as X, x as Z, y as V, U as tt, z as at, W as st } from "../UserStore-Bksi48jC.mjs";
|
|
2
2
|
import { b as ot, a as nt, d as rt, c as it, A as ct, C as pt, e as At, E as St, M as ut, N as lt, P as Tt, f as yt, g as dt, S as gt } from "../Account-DR7Plrqy.mjs";
|
|
3
3
|
import { A as Ct, B as Nt, I as ht, N as ft } from "../Notification-DTNYSd8P.mjs";
|
|
4
|
-
import { F as n } from "../GlobalCopyApi-
|
|
5
|
-
import { A as Dt, B as bt, G as It } from "../GlobalCopyApi-
|
|
4
|
+
import { F as n } from "../GlobalCopyApi-CLhyon-B.mjs";
|
|
5
|
+
import { A as Dt, B as bt, G as It } from "../GlobalCopyApi-CLhyon-B.mjs";
|
|
6
6
|
import { F as Rt, a as Bt, b as Lt, R as Gt } from "../RecurringTransactionsUtil-CfWviBh1.mjs";
|
|
7
7
|
import { G as Ht, M as Pt, T as Ut } from "../GoalsUtil-C9EnLWvC.mjs";
|
|
8
8
|
import { L as Ot, V as Ft, b as kt, g as vt } from "../Localization-DnoVyBNK.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AccountStore, AnalyticsStore, AppDataStore, BeatStore, BudgetsStore, CashflowStore, CategoryStore, ConnectStore, DebtsStore, FinstrongStore, GlobalCopyStore, GlobalUiStore, GoalStore, HelpStore, HoldingStore, MerchantStore, NetWorthStore, NotificationStore, RecurringTransactionsStore, SettingsStore, TransactionStore, TrendsStore, UserStore } from '../stores';
|
|
2
|
-
import { Account, Category, Institution, Member, AppConfig, AppData, Beat, GlobalErrorHandler, MerchantBudget, Tag, Tagging, Transaction, TransactionRule, UserFeature } from '../types';
|
|
2
|
+
import { Account, Category, Institution, Member, AppConfig, AppData, Beat, GlobalCaptureException, GlobalErrorHandler, MerchantBudget, Tag, Tagging, Transaction, TransactionRule, UserFeature } from '../types';
|
|
3
3
|
interface LoadDataProps {
|
|
4
4
|
accounts?: Account[];
|
|
5
5
|
appData?: AppData;
|
|
@@ -22,6 +22,7 @@ export declare class GlobalStore {
|
|
|
22
22
|
appConfig: AppConfig;
|
|
23
23
|
endpoint: string;
|
|
24
24
|
sessionToken: string;
|
|
25
|
+
onCaptureException?: GlobalCaptureException;
|
|
25
26
|
onError?: GlobalErrorHandler;
|
|
26
27
|
onStoreUpdate?: OnStoreUpdate;
|
|
27
28
|
accountStore: AccountStore;
|
|
@@ -47,8 +48,9 @@ export declare class GlobalStore {
|
|
|
47
48
|
trendsStore: TrendsStore;
|
|
48
49
|
userStore: UserStore;
|
|
49
50
|
globalUiStore: GlobalUiStore;
|
|
50
|
-
constructor(appConfig?: AppConfig, endpoint?: string, onError?: GlobalErrorHandler, onStoreUpdate?: OnStoreUpdate);
|
|
51
|
+
constructor(appConfig?: AppConfig, endpoint?: string, onError?: GlobalErrorHandler, onStoreUpdate?: OnStoreUpdate, onCaptureException?: GlobalCaptureException);
|
|
51
52
|
get isInitialized(): boolean;
|
|
53
|
+
captureException: (error: unknown, context?: Record<string, string>) => void;
|
|
52
54
|
emitUpdate: (change: ObservedUpdate) => void;
|
|
53
55
|
loadConfigData: () => Promise<void>;
|
|
54
56
|
loadData: ({ accounts, appData, associatedBeats, categories, institutions, transactionRules, transactions, userFeatures, merchantBudgets, }?: LoadDataProps) => Promise<void>;
|
|
@@ -15,7 +15,7 @@ export type { DynamicCopyElement, GlobalCopy } from './GlobalCopy';
|
|
|
15
15
|
export { GoalType, MetaType, TrackType } from './Goal';
|
|
16
16
|
export type { Goal, MonthlyCashFlowProfile, RetirementGoalAccount } from './Goal';
|
|
17
17
|
export type { Debt } from './Debt';
|
|
18
|
-
export type { GlobalErrorHandler, GlobalEventHandler } from './Handlers';
|
|
18
|
+
export type { GlobalCaptureException, GlobalErrorHandler, GlobalEventHandler } from './Handlers';
|
|
19
19
|
export type { HealthScore, HealthScoreReport, MonthlyHealthScore, MonthlySummaries, SpendingFeeTransaction, AllTransactions, } from './Finstrong';
|
|
20
20
|
export type { HelpAlertProps, HelpCategory, HelpContentProps, HelpTopic, HelpType, ImageContentProps, InstitutionData, NoImageContentProps, SectionProps, SelectedTopic, Ticket, } from './Help';
|
|
21
21
|
export type { Institution } from './Institution';
|
package/dist/help/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { observer as m } from "mobx-react-lite";
|
|
3
|
-
import { H as s } from "../Help-
|
|
3
|
+
import { H as s } from "../Help-D4sOpItq.mjs";
|
|
4
4
|
import { a } from "../hooks-97sNJ_lf.mjs";
|
|
5
5
|
import { u as p } from "../useWidgetLoadTimer-B0tB-yzL.mjs";
|
|
6
6
|
import { L as d } from "../Loader-CxeBwuPG.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as u, C as s, I as c, a as v, b as C, M as R, c as H, d as M, N as F, V, Z as x } from "../ViewMoreMicroCard-
|
|
1
|
+
import { A as u, C as s, I as c, a as v, b as C, M as R, c as H, d as M, N as F, V, Z as x } from "../ViewMoreMicroCard-B4oeGrbE.mjs";
|
|
2
2
|
import { B as Z } from "../BeatMaterialIcon-1KOfRZrA.mjs";
|
|
3
3
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
4
4
|
const a = ({
|
|
@@ -41,7 +41,7 @@ import Me from "@mui/material/ListItemText";
|
|
|
41
41
|
import { ChevronRight as Le, ChevronLeft as Be } from "@mxenabled/mx-icons";
|
|
42
42
|
import { D as He } from "../Drawer-DsnW2o0v.mjs";
|
|
43
43
|
import { u as ne } from "../useWidgetLoadTimer-B0tB-yzL.mjs";
|
|
44
|
-
import { H as Oe } from "../Help-
|
|
44
|
+
import { H as Oe } from "../Help-D4sOpItq.mjs";
|
|
45
45
|
import { W as q } from "../WidgetContainer-CjdCY4sj.mjs";
|
|
46
46
|
const Fe = ({ availableWidth: t, handleOnLeavClick: r }) => {
|
|
47
47
|
const i = L(), { common: o, settings: n } = k(), { isDesktop: u, isMobile: s, isSmallMobile: a, isTablet: l } = F(t), { config: b } = G(), { updateUser: _ } = E(), { user: d } = Ce(), [h, w] = m.useState({
|
package/dist/trends/index.es.js
CHANGED
|
@@ -29,7 +29,7 @@ import Ft from "@mui/material/ToggleButton";
|
|
|
29
29
|
import $t from "@mui/material/ToggleButtonGroup";
|
|
30
30
|
import { parseISO as lt } from "date-fns/parseISO";
|
|
31
31
|
import { H as ke } from "../HeaderCell-P8w6CmfO.mjs";
|
|
32
|
-
import { T as W, a as Kt } from "../ViewMoreMicroCard-
|
|
32
|
+
import { T as W, a as Kt } from "../ViewMoreMicroCard-B4oeGrbE.mjs";
|
|
33
33
|
import { useGridApiContext as Yt, useGridRootProps as jt, DataGridPro as Ut } from "@mui/x-data-grid-pro";
|
|
34
34
|
import Xt from "@mui/material/Badge";
|
|
35
35
|
import Zt from "@mui/material/IconButton";
|
package/package.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import o from "react";
|
|
3
|
-
import { H3 as s } from "@mxenabled/mxui";
|
|
4
|
-
const n = {
|
|
5
|
-
text: "Oops! Something went wrong."
|
|
6
|
-
};
|
|
7
|
-
class h extends o.Component {
|
|
8
|
-
state = {
|
|
9
|
-
hasError: !1
|
|
10
|
-
};
|
|
11
|
-
componentDidCatch(r, t) {
|
|
12
|
-
console.error("Uncaught error:", r, t);
|
|
13
|
-
}
|
|
14
|
-
static getDerivedStateFromError() {
|
|
15
|
-
return { hasError: !0 };
|
|
16
|
-
}
|
|
17
|
-
render() {
|
|
18
|
-
return this.state.hasError ? /* @__PURE__ */ e(s, { sx: { pt: 24 }, children: n.text }) : this.props.children;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
export {
|
|
22
|
-
h as E
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=ErrorBoundary-CsdOcnJ9.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary-CsdOcnJ9.mjs","sources":["../src/common/components/ErrorBoundary.tsx"],"sourcesContent":["import React from 'react'\n\nimport { H3 } from '@mxenabled/mxui'\n\nexport interface ErrorProps {\n children?: React.ReactNode\n}\n\nexport interface ErrorState {\n hasError: boolean\n}\n\nconst copy = {\n text: 'Oops! Something went wrong.',\n}\n\nclass ErrorBoundary extends React.Component<ErrorProps, ErrorState> {\n state: ErrorState = {\n hasError: false,\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n console.error('Uncaught error:', error, errorInfo)\n }\n\n static getDerivedStateFromError(): ErrorState {\n return { hasError: true }\n }\n\n render() {\n if (this.state.hasError) return <H3 sx={{ pt: 24 }}>{copy.text}</H3>\n\n return this.props.children\n }\n}\n\nexport default ErrorBoundary\n"],"names":["copy","ErrorBoundary","React","error","errorInfo","jsx","H3"],"mappings":";;;AAYA,MAAMA,IAAO;AAAA,EACX,MAAM;AACR;AAEA,MAAMC,UAAsBC,EAAM,UAAkC;AAAA,EAClE,QAAoB;AAAA,IAClB,UAAU;AAAA,EAAA;AAAA,EAGZ,kBAAkBC,GAAcC,GAA4B;AAC1D,YAAQ,MAAM,mBAAmBD,GAAOC,CAAS;AAAA,EACnD;AAAA,EAEA,OAAO,2BAAuC;AAC5C,WAAO,EAAE,UAAU,GAAA;AAAA,EACrB;AAAA,EAEA,SAAS;AACP,WAAI,KAAK,MAAM,WAAiB,gBAAAC,EAACC,GAAA,EAAG,IAAI,EAAE,IAAI,GAAA,GAAO,UAAAN,EAAK,KAAA,CAAK,IAExD,KAAK,MAAM;AAAA,EACpB;AACF;"}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import c from "bowser";
|
|
2
|
-
import { A as a } from "./ApiEndpoints-DXwIYNUV.mjs";
|
|
3
|
-
import { g as h } from "./Localization-DnoVyBNK.mjs";
|
|
4
|
-
class o {
|
|
5
|
-
endpoint = "/";
|
|
6
|
-
headers;
|
|
7
|
-
onError;
|
|
8
|
-
constructor(e, n, t, r) {
|
|
9
|
-
this.endpoint = e;
|
|
10
|
-
const s = {
|
|
11
|
-
Accept: "application/json",
|
|
12
|
-
"Accept-Language": h(),
|
|
13
|
-
"Content-Type": "application/json",
|
|
14
|
-
"MD-Session-Token": n
|
|
15
|
-
};
|
|
16
|
-
this.headers = t || s, this.onError = r;
|
|
17
|
-
}
|
|
18
|
-
get = async (e) => {
|
|
19
|
-
const n = {
|
|
20
|
-
method: "GET",
|
|
21
|
-
headers: this.headers
|
|
22
|
-
};
|
|
23
|
-
return fetch(`${this.endpoint}${e}`, n).then((t) => {
|
|
24
|
-
if (t.ok)
|
|
25
|
-
return t.text();
|
|
26
|
-
throw t;
|
|
27
|
-
}).then((t) => t.length ? JSON.parse(t) : {}).then((t) => t).catch((t) => {
|
|
28
|
-
throw this.onError?.(t, void 0, "ApiGetRequestError"), t;
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
post = async (e, n) => {
|
|
32
|
-
const t = n ? JSON.stringify(n) : void 0, r = {
|
|
33
|
-
method: "POST",
|
|
34
|
-
headers: this.headers,
|
|
35
|
-
body: t
|
|
36
|
-
};
|
|
37
|
-
return fetch(`${this.endpoint}${e}`, r).then((s) => {
|
|
38
|
-
if (!s.ok)
|
|
39
|
-
throw s;
|
|
40
|
-
return s.text();
|
|
41
|
-
}).then((s) => s.length ? JSON.parse(s) : {}).then((s) => s).catch((s) => {
|
|
42
|
-
throw s;
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
put = async (e, n) => {
|
|
46
|
-
const t = JSON.stringify(n), r = {
|
|
47
|
-
method: "PUT",
|
|
48
|
-
headers: this.headers,
|
|
49
|
-
body: t
|
|
50
|
-
};
|
|
51
|
-
return fetch(`${this.endpoint}${e}`, r).then((s) => {
|
|
52
|
-
if (s.ok)
|
|
53
|
-
return s.text();
|
|
54
|
-
throw new Error(`${s.status}`);
|
|
55
|
-
}).then((s) => s.length ? JSON.parse(s) : {}).then((s) => s).catch((s) => {
|
|
56
|
-
throw window?.app?.config?.type === "pulse" && this.onError?.(s.message), s.message;
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
delete = async (e) => {
|
|
60
|
-
const n = {
|
|
61
|
-
method: "DELETE",
|
|
62
|
-
headers: this.headers
|
|
63
|
-
};
|
|
64
|
-
return fetch(`${this.endpoint}${e}`, n).then((t) => t.ok ? t.text() : t.text().then((r) => {
|
|
65
|
-
throw new Error(r);
|
|
66
|
-
})).then((t) => t.length ? JSON.parse(t) : {}).then((t) => t).catch((t) => {
|
|
67
|
-
throw t;
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
class f {
|
|
72
|
-
fetchInstance;
|
|
73
|
-
constructor(e, n, t) {
|
|
74
|
-
this.fetchInstance = new o(e, n, void 0, t);
|
|
75
|
-
}
|
|
76
|
-
initializeAnalyticsSession = async (e, n) => {
|
|
77
|
-
const t = c.getParser(window.navigator.userAgent), { analytics_session: r } = await this.fetchInstance.post(a.ANALYTICS_SESSION, {
|
|
78
|
-
browser_name: t.getBrowserName() || "Unknown",
|
|
79
|
-
browser_version: t.getBrowserVersion() || "0.0.0",
|
|
80
|
-
is_first_visit: !1,
|
|
81
|
-
product_name: "Individual Widget",
|
|
82
|
-
product_version: e
|
|
83
|
-
});
|
|
84
|
-
return r ? (this.fetchInstance.post(a.ANALYTICS_FEATURE_VISITS, {
|
|
85
|
-
feature_visit: {
|
|
86
|
-
analytics_session_guid: r.guid,
|
|
87
|
-
feature_name: n || "Experiences",
|
|
88
|
-
is_first_visit: r.is_first_visit
|
|
89
|
-
}
|
|
90
|
-
}), { analytics_session: r }) : { analytics_session: null };
|
|
91
|
-
};
|
|
92
|
-
sendAnalyticEvent = async (e) => this.fetchInstance.post(a.ANALYTICS_EVENTS, e).catch((n) => {
|
|
93
|
-
throw n;
|
|
94
|
-
});
|
|
95
|
-
sendAnalyticsPageview = async (e) => this.fetchInstance.post(a.ANALYTICS_PAGEVIEWS, e).catch((n) => {
|
|
96
|
-
throw n;
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
class l {
|
|
100
|
-
fetchInstance;
|
|
101
|
-
constructor(e, n, t) {
|
|
102
|
-
this.fetchInstance = new o(e, n, void 0, t);
|
|
103
|
-
}
|
|
104
|
-
getBeats = async (e, n) => {
|
|
105
|
-
const t = `page=${e || 1}&per_page=${n || 5}`;
|
|
106
|
-
return this.fetchInstance.get(`${a.BEATS}?${t}`).then((r) => r.beats);
|
|
107
|
-
};
|
|
108
|
-
getBeatsWithAssociatedTransaction = async (e) => {
|
|
109
|
-
let n = "has_associated_transaction_guid=true";
|
|
110
|
-
return n += e ? `&from_date=${e}` : "", this.fetchInstance.get(`${a.BEATS}?${n}`).then((t) => t.beats);
|
|
111
|
-
};
|
|
112
|
-
getOffers = async () => this.fetchInstance.get(`${a.OFFERS}/${a.PULSE_COMMUNICATIONS}`).then((e) => e.pulse_communications);
|
|
113
|
-
updateBeat = async (e) => this.fetchInstance.put(`${a.BEATS}/${e.guid}`, e).then((n) => n.beat);
|
|
114
|
-
updateOffer = async (e) => this.fetchInstance.put(`${a.OFFERS}/${e.guid}`, e).then((n) => n.beat);
|
|
115
|
-
}
|
|
116
|
-
class g {
|
|
117
|
-
fetchInstance;
|
|
118
|
-
constructor(e, n, t) {
|
|
119
|
-
this.fetchInstance = new o(e, n, void 0, t);
|
|
120
|
-
}
|
|
121
|
-
getGlobalCopy = async (e, n) => this.fetchInstance.post(`${a.LOCALIZED_CONTENT}/${e}`, { translation_key: n }).then((t) => t);
|
|
122
|
-
}
|
|
123
|
-
export {
|
|
124
|
-
f as A,
|
|
125
|
-
l as B,
|
|
126
|
-
o as F,
|
|
127
|
-
g as G
|
|
128
|
-
};
|
|
129
|
-
//# sourceMappingURL=GlobalCopyApi-wcnDUzMV.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalCopyApi-wcnDUzMV.mjs","sources":["../src/core/utils/Fetch.ts","../src/core/api/AnalyticsApi.ts","../src/core/api/BeatApi.ts","../src/core/api/GlobalCopyApi.ts"],"sourcesContent":["import { type GlobalErrorHandler } from '../types'\nimport { getLocale } from './Localization'\n\nexport class Fetch {\n endpoint = '/'\n headers: Record<string, string>\n onError?: GlobalErrorHandler\n\n constructor(\n endpoint: string,\n token: string,\n headers?: Record<string, string>,\n onError?: GlobalErrorHandler,\n ) {\n this.endpoint = endpoint\n const defaultHeaders = {\n Accept: 'application/json',\n 'Accept-Language': getLocale(),\n 'Content-Type': 'application/json',\n 'MD-Session-Token': token,\n }\n this.headers = headers || defaultHeaders\n this.onError = onError\n }\n\n get = async (url: string) => {\n const options = {\n method: 'GET',\n headers: this.headers,\n }\n\n return fetch(`${this.endpoint}${url}`, options)\n .then((response) => {\n if (response.ok) {\n return response.text()\n } else {\n throw response\n }\n })\n .then((text) => (text.length ? JSON.parse(text) : {}))\n .then((data) => data)\n .catch((err) => {\n this.onError?.(err, undefined, 'ApiGetRequestError')\n throw err\n })\n }\n\n post = async (url: string, data?: any) => {\n const body = data ? JSON.stringify(data) : undefined\n const options = {\n method: 'POST',\n headers: this.headers,\n body,\n }\n\n return fetch(`${this.endpoint}${url}`, options)\n .then((response) => {\n if (!response.ok) {\n throw response\n }\n\n return response.text()\n })\n .then((text) => (text.length ? JSON.parse(text) : {}))\n .then((data) => data)\n .catch((error) => {\n throw error\n })\n }\n\n put = async (url: string, data: any) => {\n const body = JSON.stringify(data)\n const options = {\n method: 'PUT',\n headers: this.headers,\n body,\n }\n\n return fetch(`${this.endpoint}${url}`, options)\n .then((response) => {\n if (response.ok) {\n return response.text()\n } else {\n throw new Error(`${response.status}`)\n }\n })\n .then((text) => (text.length ? JSON.parse(text) : {}))\n .then((data) => data)\n .catch((err) => {\n if (window?.app?.config?.type === 'pulse') {\n this.onError?.(err.message)\n }\n throw err.message\n })\n }\n\n delete = async (url: string) => {\n const options = {\n method: 'DELETE',\n headers: this.headers,\n }\n\n return fetch(`${this.endpoint}${url}`, options)\n .then((response) => {\n if (response.ok) {\n return response.text()\n } else {\n return response.text().then((text) => {\n throw new Error(text)\n })\n }\n })\n .then((text) => (text.length ? JSON.parse(text) : {}))\n .then((data) => data)\n .catch((err) => {\n throw err\n })\n }\n}\n\nexport default Fetch\n","import Bowser from 'bowser'\n\nimport { Fetch } from '../utils'\nimport { ApiEndpoints } from '../constants'\nimport type { AnalyticsEvent, GlobalErrorHandler } from '..'\n\nexport class AnalyticsApi {\n fetchInstance: Fetch\n\n constructor(endpoint: string, token: string, onError?: GlobalErrorHandler) {\n this.fetchInstance = new Fetch(endpoint, token, undefined, onError)\n }\n\n initializeAnalyticsSession = async (version: string, featureName?: string) => {\n const browser = Bowser.getParser(window.navigator.userAgent)\n\n const { analytics_session } = await this.fetchInstance.post(ApiEndpoints.ANALYTICS_SESSION, {\n browser_name: browser.getBrowserName() || 'Unknown',\n browser_version: browser.getBrowserVersion() || '0.0.0',\n is_first_visit: false,\n product_name: 'Individual Widget',\n product_version: version,\n })\n if (!analytics_session) {\n return { analytics_session: null }\n }\n this.fetchInstance.post(ApiEndpoints.ANALYTICS_FEATURE_VISITS, {\n feature_visit: {\n analytics_session_guid: analytics_session.guid,\n feature_name: featureName ? featureName : 'Experiences',\n is_first_visit: analytics_session.is_first_visit,\n },\n })\n return { analytics_session }\n }\n\n sendAnalyticEvent = async (event: AnalyticsEvent) => {\n return this.fetchInstance.post(ApiEndpoints.ANALYTICS_EVENTS, event).catch((err) => {\n throw err\n })\n }\n\n sendAnalyticsPageview = async (event: any) => {\n return this.fetchInstance.post(ApiEndpoints.ANALYTICS_PAGEVIEWS, event).catch((err) => {\n throw err\n })\n }\n}\n","import { Fetch } from '../utils'\nimport { ApiEndpoints } from '../constants'\nimport type { Beat, GlobalErrorHandler } from '..'\n\nexport class BeatApi {\n fetchInstance: Fetch\n\n constructor(endpoint: string, token: string, onError?: GlobalErrorHandler) {\n this.fetchInstance = new Fetch(endpoint, token, undefined, onError)\n }\n\n getBeats = async (pageNum?: number, perPage?: number) => {\n const beatParams = `page=${pageNum ? pageNum : 1}&per_page=${perPage ? perPage : 5}`\n\n return this.fetchInstance.get(`${ApiEndpoints.BEATS}?${beatParams}`).then((data) => data.beats)\n }\n\n getBeatsWithAssociatedTransaction = async (fromDate?: string) => {\n let beatParams = 'has_associated_transaction_guid=true'\n beatParams += fromDate ? `&from_date=${fromDate}` : ''\n\n return this.fetchInstance.get(`${ApiEndpoints.BEATS}?${beatParams}`).then((data) => data.beats)\n }\n\n getOffers = async () => {\n return this.fetchInstance\n .get(`${ApiEndpoints.OFFERS}/${ApiEndpoints.PULSE_COMMUNICATIONS}`)\n .then((data) => data.pulse_communications)\n }\n\n updateBeat = async (beat: Beat) => {\n return this.fetchInstance\n .put(`${ApiEndpoints.BEATS}/${beat.guid}`, beat)\n .then((data) => data.beat)\n }\n\n updateOffer = async (beat: Beat) => {\n return this.fetchInstance\n .put(`${ApiEndpoints.OFFERS}/${beat.guid}`, beat)\n .then((data) => data.beat)\n }\n}\n","import { Fetch } from '../utils'\nimport { ApiEndpoints } from '../constants'\nimport type { GlobalErrorHandler } from '..'\n\nexport class GlobalCopyApi {\n fetchInstance: Fetch\n\n constructor(endpoint: string, token: string, onError?: GlobalErrorHandler) {\n this.fetchInstance = new Fetch(endpoint, token, undefined, onError)\n }\n\n getGlobalCopy = async (namespace: string, translationKey: string) => {\n return this.fetchInstance\n .post(`${ApiEndpoints.LOCALIZED_CONTENT}/${namespace}`, { translation_key: translationKey })\n .then((data) => data)\n }\n}\n"],"names":["Fetch","endpoint","token","headers","onError","defaultHeaders","getLocale","url","options","response","text","data","err","body","error","AnalyticsApi","version","featureName","browser","Bowser","analytics_session","ApiEndpoints","event","BeatApi","pageNum","perPage","beatParams","fromDate","beat","GlobalCopyApi","namespace","translationKey"],"mappings":";;;AAGO,MAAMA,EAAM;AAAA,EACjB,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EAEA,YACEC,GACAC,GACAC,GACAC,GACA;AACA,SAAK,WAAWH;AAChB,UAAMI,IAAiB;AAAA,MACrB,QAAQ;AAAA,MACR,mBAAmBC,EAAA;AAAA,MACnB,gBAAgB;AAAA,MAChB,oBAAoBJ;AAAA,IAAA;AAEtB,SAAK,UAAUC,KAAWE,GAC1B,KAAK,UAAUD;AAAA,EACjB;AAAA,EAEA,MAAM,OAAOG,MAAgB;AAC3B,UAAMC,IAAU;AAAA,MACd,QAAQ;AAAA,MACR,SAAS,KAAK;AAAA,IAAA;AAGhB,WAAO,MAAM,GAAG,KAAK,QAAQ,GAAGD,CAAG,IAAIC,CAAO,EAC3C,KAAK,CAACC,MAAa;AAClB,UAAIA,EAAS;AACX,eAAOA,EAAS,KAAA;AAEhB,YAAMA;AAAA,IAEV,CAAC,EACA,KAAK,CAACC,MAAUA,EAAK,SAAS,KAAK,MAAMA,CAAI,IAAI,CAAA,CAAG,EACpD,KAAK,CAACC,MAASA,CAAI,EACnB,MAAM,CAACC,MAAQ;AACd,iBAAK,UAAUA,GAAK,QAAW,oBAAoB,GAC7CA;AAAA,IACR,CAAC;AAAA,EACL;AAAA,EAEA,OAAO,OAAOL,GAAaI,MAAe;AACxC,UAAME,IAAOF,IAAO,KAAK,UAAUA,CAAI,IAAI,QACrCH,IAAU;AAAA,MACd,Q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