@platform-x/hcltechx-mfe-wrapper 1.0.22 → 1.0.23
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/ArticleVodListComponent-B13nOAHm.mjs +36 -0
- package/{ChallengeDetailComponent-BQOqyQe4.mjs → ChallengeDetailComponent-eCWonz4X.mjs} +61 -53
- package/ChallengeSliderComponent-d4VVvxbZ.mjs +93 -0
- package/CommonContentComponent-6oOYYwHd.mjs +81 -0
- package/{DailyMotion-BttO0I0C.mjs → DailyMotion-C0EcZJX2.mjs} +2 -2
- package/EngagementHomeComponent-DLLaxG3f.mjs +120 -0
- package/{EventDetailComponent-BlbyfC5O.mjs → EventDetailComponent-XKyLFMdx.mjs} +54 -46
- package/EventListComponent-atyam6Il.mjs +90 -0
- package/ExperienceZone-C3pb2ftT.mjs +132 -0
- package/ExperienceZoneComponent-OQKzzWTq.mjs +56 -0
- package/{Facebook-BhbZsSMB.mjs → Facebook-NEdjRx3Y.mjs} +2 -2
- package/{FilePlayer-DBOphwby.mjs → FilePlayer-C38ReldQ.mjs} +2 -2
- package/IndividualChallengeComponent-CRf_V_Tt.mjs +198 -0
- package/{Kaltura-DkAlATL_.mjs → Kaltura-B7p2oI0M.mjs} +2 -2
- package/{Mixcloud-CguOqMm8.mjs → Mixcloud-c2NEtTRK.mjs} +2 -2
- package/{Mux-D6PeF7j6.mjs → Mux-CQMD2dJX.mjs} +2 -2
- package/PageComponent-BEgpO1AP.mjs +92 -0
- package/{Preview-9xbWxXDK.mjs → Preview-CFQxRzbQ.mjs} +1 -1
- package/RecentCarousel-D_0jaVP1.mjs +340 -0
- package/Share-CkEOnac8.mjs +2140 -0
- package/{SoundCloud-CZ-yrJeU.mjs → SoundCloud-JBRcYad3.mjs} +10 -10
- package/{Streamable-CnJYyZu0.mjs → Streamable-CANteIE2.mjs} +19 -19
- package/{ToggleButton-8IOlYjrU.mjs → ToggleButton-Czdz0-6I.mjs} +88109 -78947
- package/{Twitch-DvDm30_Y.mjs → Twitch-sg7Li74z.mjs} +2 -2
- package/{Vidyard-CxuW7iGh.mjs → Vidyard-CVzB2oJ_.mjs} +2 -2
- package/{Vimeo-BkQKIRE4.mjs → Vimeo-Bfj3B_wY.mjs} +2 -2
- package/{Wistia-CQeoZyhr.mjs → Wistia-eytGmvyf.mjs} +12 -12
- package/{YouTube-DOOQlFVu.mjs → YouTube-B536yAUn.mjs} +2 -2
- package/{index-BPqB2yy1.mjs → index-6HCIStyP.mjs} +4487 -3213
- package/{index-BQE4JEea.mjs → index-C0IB0ocK.mjs} +4 -4
- package/index.mjs +2 -2
- package/lib/services/fetchQueries.d.ts +1 -1
- package/{mutateApi-BcmEMqEd.mjs → mutateApi-FU_0iEJ8.mjs} +1 -1
- package/package.json +1 -1
- package/ArticleVodListComponent-DnI80nGq.mjs +0 -28
- package/ChallengeSliderComponent-DVyhqNVQ.mjs +0 -85
- package/CommonContentComponent-Hnb8Xr5I.mjs +0 -73
- package/EngagementHomeComponent-LYRrGICV.mjs +0 -112
- package/EventListComponent-B39xrxgu.mjs +0 -82
- package/ExperienceZone-Bhkjbth9.mjs +0 -89
- package/ExperienceZoneComponent-F16DcM9H.mjs +0 -48
- package/IndividualChallengeComponent-BJ5RfzMH.mjs +0 -190
- package/PageComponent-CLrj-Wc_.mjs +0 -64
- package/RecentCarousel-D6dx6TIr.mjs +0 -245
- package/Share-DQnAo1oF.mjs +0 -1780
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { j as s } from "./index-6HCIStyP.mjs";
|
|
2
|
+
import { A as m } from "./ToggleButton-Czdz0-6I.mjs";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
import "react/jsx-runtime";
|
|
6
|
+
const f = ({
|
|
7
|
+
data: e,
|
|
8
|
+
prelemAnalyticsProp: o,
|
|
9
|
+
prelemAuthoringHelper: t,
|
|
10
|
+
secondaryArgs: r,
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12
|
+
userId: a,
|
|
13
|
+
filters: n,
|
|
14
|
+
relativePath: i
|
|
15
|
+
}) => /* @__PURE__ */ s.jsxDEV(
|
|
16
|
+
m,
|
|
17
|
+
{
|
|
18
|
+
content: e,
|
|
19
|
+
analytics: o,
|
|
20
|
+
authoringHelper: t,
|
|
21
|
+
secondaryArgs: r,
|
|
22
|
+
filters: n,
|
|
23
|
+
relativePath: i
|
|
24
|
+
},
|
|
25
|
+
void 0,
|
|
26
|
+
!1,
|
|
27
|
+
{
|
|
28
|
+
fileName: "/Users/manikandan.kanna/Desktop/PlatformX/platformx-mono-repo-nx/libs/hc-wrapper/src/lib/prelems/Components/ArticleVodListComponent.tsx",
|
|
29
|
+
lineNumber: 14,
|
|
30
|
+
columnNumber: 5
|
|
31
|
+
},
|
|
32
|
+
void 0
|
|
33
|
+
);
|
|
34
|
+
export {
|
|
35
|
+
f as default
|
|
36
|
+
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { b as
|
|
3
|
-
import { useState as f, useEffect as
|
|
4
|
-
import {
|
|
5
|
-
import { m as N } from "./mutateApi-BcmEMqEd.mjs";
|
|
1
|
+
import { j as V, s as a, f as h } from "./index-6HCIStyP.mjs";
|
|
2
|
+
import { b as X } from "./ToggleButton-Czdz0-6I.mjs";
|
|
3
|
+
import { useState as f, useEffect as q } from "react";
|
|
4
|
+
import { m as z } from "./mutateApi-FU_0iEJ8.mjs";
|
|
6
5
|
import "react-dom";
|
|
7
|
-
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
const Y = (D) => {
|
|
8
8
|
const {
|
|
9
|
-
pageData:
|
|
9
|
+
pageData: n = {},
|
|
10
10
|
secondaryArgs: P,
|
|
11
|
-
prelemAnalyticsProp:
|
|
12
|
-
prelemAuthoringHelper:
|
|
11
|
+
prelemAnalyticsProp: L,
|
|
12
|
+
prelemAuthoringHelper: E,
|
|
13
13
|
userId: y
|
|
14
|
-
} =
|
|
15
|
-
prelemBaseEndpoint: { language:
|
|
16
|
-
} = P, [C, c] = f(!1), [v, I] = f(!1), [w, B] = f(0), [S,
|
|
17
|
-
var
|
|
18
|
-
if (!
|
|
14
|
+
} = D || {}, {
|
|
15
|
+
prelemBaseEndpoint: { language: g, site_host: d }
|
|
16
|
+
} = P, [C, c] = f(!1), [v, I] = f(!1), [w, B] = f(0), [S, T] = f(0), [p, G] = f([]), [b, A] = f(!1), [j, x] = f({}), u = localStorage.getItem("userId") || y, k = async (i) => {
|
|
17
|
+
var t, s, l, o;
|
|
18
|
+
if (!u) {
|
|
19
19
|
a("User ID is not available. Please log in.");
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
@@ -24,36 +24,36 @@ const Z = (L) => {
|
|
|
24
24
|
const r = {
|
|
25
25
|
input: {
|
|
26
26
|
...i,
|
|
27
|
-
userId:
|
|
27
|
+
userId: u
|
|
28
28
|
}
|
|
29
|
-
}, e = await
|
|
30
|
-
((
|
|
29
|
+
}, e = await z.joinChallenge(r, g, d);
|
|
30
|
+
((t = e == null ? void 0 : e.errors) == null ? void 0 : t.length) > 0 ? a((s = e == null ? void 0 : e.errors[0]) == null ? void 0 : s.message) : (o = (l = e == null ? void 0 : e.data) == null ? void 0 : l.community_joinChallenge) != null && o.id ? (I(!0), _(), A(!0)) : console.error("Join Challenge API failed");
|
|
31
31
|
} catch (r) {
|
|
32
32
|
console.error("Error in Join Challenge API:", r);
|
|
33
33
|
} finally {
|
|
34
34
|
c(!1);
|
|
35
35
|
}
|
|
36
36
|
}, _ = async () => {
|
|
37
|
-
var i,
|
|
38
|
-
if (!
|
|
37
|
+
var i, t, s, l;
|
|
38
|
+
if (!u) {
|
|
39
39
|
a("User ID is not available. Please log in.");
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
try {
|
|
43
43
|
c(!0);
|
|
44
44
|
const o = {
|
|
45
|
-
challenge_id:
|
|
45
|
+
challenge_id: n == null ? void 0 : n.page,
|
|
46
46
|
user_id: y
|
|
47
|
-
}, r = await
|
|
47
|
+
}, r = await h.getChallengeDetails(o, g, d);
|
|
48
48
|
if (((i = r == null ? void 0 : r.errors) == null ? void 0 : i.length) > 0)
|
|
49
|
-
a((
|
|
49
|
+
a((t = r == null ? void 0 : r.errors[0]) == null ? void 0 : t.message);
|
|
50
50
|
else if ((s = r == null ? void 0 : r.data) != null && s.community_challengesDetail) {
|
|
51
51
|
const {
|
|
52
52
|
total_participant: e,
|
|
53
|
-
is_joined:
|
|
54
|
-
user_steps:
|
|
53
|
+
is_joined: m,
|
|
54
|
+
user_steps: J = 0
|
|
55
55
|
} = (l = r == null ? void 0 : r.data) == null ? void 0 : l.community_challengesDetail;
|
|
56
|
-
I(
|
|
56
|
+
I(m), B(e), T(J);
|
|
57
57
|
} else
|
|
58
58
|
console.error("GetEventDetails API failed");
|
|
59
59
|
} catch (o) {
|
|
@@ -61,19 +61,19 @@ const Z = (L) => {
|
|
|
61
61
|
} finally {
|
|
62
62
|
c(!1);
|
|
63
63
|
}
|
|
64
|
-
},
|
|
65
|
-
var i,
|
|
64
|
+
}, U = async () => {
|
|
65
|
+
var i, t, s, l, o;
|
|
66
66
|
try {
|
|
67
67
|
c(!0);
|
|
68
68
|
const r = {
|
|
69
|
-
challenge_id:
|
|
69
|
+
challenge_id: n == null ? void 0 : n.page,
|
|
70
70
|
user_id: localStorage.getItem("userId")
|
|
71
|
-
}, e = await
|
|
71
|
+
}, e = await h.getLeaderBoardList(r, g, d);
|
|
72
72
|
if (((i = e == null ? void 0 : e.errors) == null ? void 0 : i.length) > 0)
|
|
73
|
-
a((
|
|
73
|
+
a((t = e == null ? void 0 : e.errors[0]) == null ? void 0 : t.message);
|
|
74
74
|
else if ((l = (s = e == null ? void 0 : e.data) == null ? void 0 : s.community_getLeaderBoardList) != null && l.records) {
|
|
75
|
-
const { records:
|
|
76
|
-
|
|
75
|
+
const { records: m } = (o = e == null ? void 0 : e.data) == null ? void 0 : o.community_getLeaderBoardList;
|
|
76
|
+
G(m);
|
|
77
77
|
} else
|
|
78
78
|
console.error("GetLeaderBoardList API failed");
|
|
79
79
|
} catch (r) {
|
|
@@ -81,19 +81,19 @@ const Z = (L) => {
|
|
|
81
81
|
} finally {
|
|
82
82
|
c(!1);
|
|
83
83
|
}
|
|
84
|
-
},
|
|
85
|
-
var
|
|
84
|
+
}, N = async (i = "") => {
|
|
85
|
+
var t, s, l, o;
|
|
86
86
|
try {
|
|
87
87
|
c(!0);
|
|
88
88
|
const r = {
|
|
89
89
|
date: i,
|
|
90
|
-
user_id:
|
|
91
|
-
}, e = await
|
|
92
|
-
if (((
|
|
90
|
+
user_id: u
|
|
91
|
+
}, e = await h.fetchPersonalTracker(r, g, d);
|
|
92
|
+
if (((t = e == null ? void 0 : e.errors) == null ? void 0 : t.length) > 0)
|
|
93
93
|
a((s = e == null ? void 0 : e.errors[0]) == null ? void 0 : s.message);
|
|
94
94
|
else if ((l = e == null ? void 0 : e.data) != null && l.community_fetchPersonalTracker) {
|
|
95
|
-
const { device_info:
|
|
96
|
-
|
|
95
|
+
const { device_info: m } = (o = e == null ? void 0 : e.data) == null ? void 0 : o.community_fetchPersonalTracker;
|
|
96
|
+
x(m);
|
|
97
97
|
} else
|
|
98
98
|
console.error("GetPersonalData API failed"), a("GetPersonalData API failed");
|
|
99
99
|
} catch (r) {
|
|
@@ -101,30 +101,38 @@ const Z = (L) => {
|
|
|
101
101
|
} finally {
|
|
102
102
|
c(!1);
|
|
103
103
|
}
|
|
104
|
-
},
|
|
105
|
-
joinChallenge:
|
|
104
|
+
}, H = {
|
|
105
|
+
joinChallenge: k,
|
|
106
106
|
loading: C,
|
|
107
107
|
isEnrolled: v,
|
|
108
108
|
enrolledParticipants: w,
|
|
109
109
|
userAchieved: S,
|
|
110
|
-
leaderBoardList:
|
|
110
|
+
leaderBoardList: p,
|
|
111
111
|
showPopup: b,
|
|
112
112
|
setShowPopup: A,
|
|
113
|
-
deviceInfo:
|
|
113
|
+
deviceInfo: j
|
|
114
114
|
};
|
|
115
|
-
return
|
|
116
|
-
|
|
117
|
-
}, [
|
|
118
|
-
|
|
115
|
+
return q(() => {
|
|
116
|
+
n != null && n.page && (_(), U(), N());
|
|
117
|
+
}, [n]), /* @__PURE__ */ V.jsxDEV(
|
|
118
|
+
X,
|
|
119
119
|
{
|
|
120
|
-
content:
|
|
121
|
-
analytics:
|
|
122
|
-
authoringHelper:
|
|
120
|
+
content: n,
|
|
121
|
+
analytics: L,
|
|
122
|
+
authoringHelper: E,
|
|
123
123
|
secondaryArgs: P,
|
|
124
|
-
challengeDetails:
|
|
125
|
-
}
|
|
124
|
+
challengeDetails: H
|
|
125
|
+
},
|
|
126
|
+
void 0,
|
|
127
|
+
!1,
|
|
128
|
+
{
|
|
129
|
+
fileName: "/Users/manikandan.kanna/Desktop/PlatformX/platformx-mono-repo-nx/libs/hc-wrapper/src/lib/contentTypes/Components/ChallengeDetailComponent.tsx",
|
|
130
|
+
lineNumber: 161,
|
|
131
|
+
columnNumber: 5
|
|
132
|
+
},
|
|
133
|
+
void 0
|
|
126
134
|
);
|
|
127
135
|
};
|
|
128
136
|
export {
|
|
129
|
-
|
|
137
|
+
Y as default
|
|
130
138
|
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { j as B, f as A, s as a, a as U } from "./index-6HCIStyP.mjs";
|
|
2
|
+
import { f as X, C as q } from "./ToggleButton-Czdz0-6I.mjs";
|
|
3
|
+
import { useState as d, useEffect as z } from "react";
|
|
4
|
+
import { m as F } from "./mutateApi-FU_0iEJ8.mjs";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
const Z = (k) => {
|
|
8
|
+
var w, S, P;
|
|
9
|
+
const { pageData: s = {}, secondaryArgs: h, userId: b, filters: E } = k || {}, [I, u] = d(!1), [T, y] = d({}), [_, x] = d(0), [G, L] = d([]), p = localStorage.getItem("userId") || b, {
|
|
10
|
+
prelemBaseEndpoint: { site_host: g, language: f }
|
|
11
|
+
} = h, v = {
|
|
12
|
+
pageId: s == null ? void 0 : s.page,
|
|
13
|
+
pageTitle: s == null ? void 0 : s.title,
|
|
14
|
+
pageDesc: s == null ? void 0 : s.description,
|
|
15
|
+
pageTags: (S = (w = s == null ? void 0 : s.settings) == null ? void 0 : w.keywords) == null ? void 0 : S.join(", "),
|
|
16
|
+
isAuthoring: !1,
|
|
17
|
+
isSeoEnabled: (P = s == null ? void 0 : s.settings) == null ? void 0 : P.seo_blockIndexing,
|
|
18
|
+
isAnalyticsEnabled: s == null ? void 0 : s.analytics_enable
|
|
19
|
+
}, j = {
|
|
20
|
+
isAuthoring: !1
|
|
21
|
+
}, D = async (c, n, l, r = "", o = "wellnessevent") => {
|
|
22
|
+
var e, i, m, C;
|
|
23
|
+
const t = await A.getContentSchemaList(
|
|
24
|
+
{
|
|
25
|
+
searchTerm: r,
|
|
26
|
+
filter: (o == null ? void 0 : o.toLocaleLowerCase()) === "events" ? "wellnessevent" : o == null ? void 0 : o.toLocaleLowerCase()
|
|
27
|
+
},
|
|
28
|
+
c || "en",
|
|
29
|
+
n
|
|
30
|
+
);
|
|
31
|
+
(i = (e = t == null ? void 0 : t.data) == null ? void 0 : e.publish_getContents) != null && i.records ? l((C = (m = t == null ? void 0 : t.data) == null ? void 0 : m.publish_getContents) == null ? void 0 : C.records) : a("Something went wrong !");
|
|
32
|
+
}, N = async (c, n, l) => {
|
|
33
|
+
var r, o;
|
|
34
|
+
try {
|
|
35
|
+
const t = {
|
|
36
|
+
input: { activity_type: l, target: c.toString(), action: n },
|
|
37
|
+
user_id: p
|
|
38
|
+
}, e = await F.setPersonalGoal(t, f, g);
|
|
39
|
+
((o = (r = e == null ? void 0 : e.data) == null ? void 0 : r.community_setPersonalGoal) == null ? void 0 : o.message) === "Created Successfully!!!" && n === "goal" ? U("Goal updated successfully!") : n !== "entry" && a("Something went wrong, please try after sometime !");
|
|
40
|
+
} catch (t) {
|
|
41
|
+
console.error("Error in update goal API:", t), a("Something went wrong, please try after sometime !");
|
|
42
|
+
}
|
|
43
|
+
}, H = async (c = "") => {
|
|
44
|
+
var n, l, r, o;
|
|
45
|
+
try {
|
|
46
|
+
u(!0);
|
|
47
|
+
const t = {
|
|
48
|
+
date: c,
|
|
49
|
+
user_id: p
|
|
50
|
+
}, e = await A.fetchPersonalTracker(t, f, g);
|
|
51
|
+
if (((n = e == null ? void 0 : e.errors) == null ? void 0 : n.length) > 0)
|
|
52
|
+
a((l = e == null ? void 0 : e.errors[0]) == null ? void 0 : l.message);
|
|
53
|
+
else if ((r = e == null ? void 0 : e.data) != null && r.community_fetchPersonalTracker) {
|
|
54
|
+
const { steps: i, streak_count: m } = (o = e == null ? void 0 : e.data) == null ? void 0 : o.community_fetchPersonalTracker;
|
|
55
|
+
y(i), x(m);
|
|
56
|
+
} else
|
|
57
|
+
console.error("GetPersonalData API failed"), a("GetPersonalData API failed");
|
|
58
|
+
} catch (t) {
|
|
59
|
+
a("Something went wrong !"), console.error("Error in GetPersonalData API:", t), a("Error in GetPersonalData API"), y({});
|
|
60
|
+
} finally {
|
|
61
|
+
u(!1);
|
|
62
|
+
}
|
|
63
|
+
}, M = {
|
|
64
|
+
stepsData: T,
|
|
65
|
+
loading: I,
|
|
66
|
+
updateGoals: N
|
|
67
|
+
};
|
|
68
|
+
return z(() => {
|
|
69
|
+
H(X(/* @__PURE__ */ new Date(), "yyyy-MM-dd")), D(f, g, L, "", "challenges");
|
|
70
|
+
}, []), /* @__PURE__ */ B.jsxDEV(
|
|
71
|
+
q,
|
|
72
|
+
{
|
|
73
|
+
analytics: v,
|
|
74
|
+
authoringHelper: j,
|
|
75
|
+
secondaryArgs: h,
|
|
76
|
+
stepsDetails: M,
|
|
77
|
+
streaksCount: _,
|
|
78
|
+
data: G,
|
|
79
|
+
filters: E
|
|
80
|
+
},
|
|
81
|
+
void 0,
|
|
82
|
+
!1,
|
|
83
|
+
{
|
|
84
|
+
fileName: "/Users/manikandan.kanna/Desktop/PlatformX/platformx-mono-repo-nx/libs/hc-wrapper/src/lib/prelems/Components/ChallengeSliderComponent.tsx",
|
|
85
|
+
lineNumber: 126,
|
|
86
|
+
columnNumber: 5
|
|
87
|
+
},
|
|
88
|
+
void 0
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
Z as default
|
|
93
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { F as N, j, f as L, s as b } from "./index-6HCIStyP.mjs";
|
|
2
|
+
import O, { memo as J, useState as w, useEffect as M } from "react";
|
|
3
|
+
import { m as $ } from "./mutateApi-FU_0iEJ8.mjs";
|
|
4
|
+
import { M as g } from "./Mapping-jqmNMEpL.mjs";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
const c = {};
|
|
8
|
+
Object.keys(g).forEach((l) => (c[l] = O.lazy(
|
|
9
|
+
() => import("./index-C0IB0ocK.mjs").then((o) => ({
|
|
10
|
+
default: o[g[l]]
|
|
11
|
+
}))
|
|
12
|
+
), c));
|
|
13
|
+
const B = (l) => {
|
|
14
|
+
var d, y, h, C, _, S;
|
|
15
|
+
const { pageData: o = {}, secondaryArgs: m = {}, filters: T, relativePath: k = "" } = l || {}, v = c[(o == null ? void 0 : o.content_type) || (o == null ? void 0 : o.tag_name)] || N, x = {
|
|
16
|
+
pageId: o == null ? void 0 : o.page,
|
|
17
|
+
pageTitle: o == null ? void 0 : o.title,
|
|
18
|
+
pageDesc: o == null ? void 0 : o.description,
|
|
19
|
+
pageTags: (y = (d = o == null ? void 0 : o.settings) == null ? void 0 : d.keywords) == null ? void 0 : y.join(", "),
|
|
20
|
+
isAuthoring: !1,
|
|
21
|
+
isSeoEnabled: (h = o == null ? void 0 : o.settings) == null ? void 0 : h.seo_blockIndexing,
|
|
22
|
+
isAnalyticsEnabled: o == null ? void 0 : o.analytics_enable
|
|
23
|
+
}, E = {
|
|
24
|
+
isModalShow: !0
|
|
25
|
+
}, [p, n] = w(!1), [P, A] = w([]), {
|
|
26
|
+
prelemBaseEndpoint: { site_host: f, language: u }
|
|
27
|
+
} = m, a = async () => {
|
|
28
|
+
var e, s;
|
|
29
|
+
try {
|
|
30
|
+
p || n(!0);
|
|
31
|
+
const t = await L.fetchPoll({ title: o.document_path }, u, f);
|
|
32
|
+
A((s = (e = t.data) == null ? void 0 : e.users_fetchContent) == null ? void 0 : s.options), n(!1);
|
|
33
|
+
} catch (t) {
|
|
34
|
+
n(!1), b(`${t}`);
|
|
35
|
+
}
|
|
36
|
+
}, I = async (e) => {
|
|
37
|
+
var s;
|
|
38
|
+
try {
|
|
39
|
+
n(!0);
|
|
40
|
+
const t = {
|
|
41
|
+
input: {
|
|
42
|
+
pollInfo: { ...e, start_date: "" }
|
|
43
|
+
}
|
|
44
|
+
}, i = await $.savePoll(t, u, f);
|
|
45
|
+
if (n(!1), (s = i == null ? void 0 : i.data) != null && s.users_saveContent) {
|
|
46
|
+
const r = JSON.parse(localStorage.getItem("TakenPoles") || "[]");
|
|
47
|
+
r != null && r.includes(o.page) || localStorage.setItem("TakenPoles", JSON.stringify([...r, o.page])), a();
|
|
48
|
+
}
|
|
49
|
+
} catch (t) {
|
|
50
|
+
n(!1), b(`${t}`);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return M(() => {
|
|
54
|
+
const e = JSON.parse(localStorage.getItem("TakenPoles") || "[]");
|
|
55
|
+
e != null && e.includes(o == null ? void 0 : o.page) && a();
|
|
56
|
+
}, []), /* @__PURE__ */ j.jsxDEV(
|
|
57
|
+
v,
|
|
58
|
+
{
|
|
59
|
+
content: o,
|
|
60
|
+
analytics: x,
|
|
61
|
+
authoringHelper: E,
|
|
62
|
+
secondaryArgs: m,
|
|
63
|
+
results: ((C = o == null ? void 0 : o.content_type) == null ? void 0 : C.toLowerCase()) === "poll" ? P : void 0,
|
|
64
|
+
onSubmit: ((_ = o == null ? void 0 : o.content_type) == null ? void 0 : _.toLowerCase()) === "poll" ? (e) => I(e) : void 0,
|
|
65
|
+
showLoading: ((S = o == null ? void 0 : o.content_type) == null ? void 0 : S.toLowerCase()) === "poll" ? p : void 0,
|
|
66
|
+
filters: T,
|
|
67
|
+
relativePath: k
|
|
68
|
+
},
|
|
69
|
+
void 0,
|
|
70
|
+
!1,
|
|
71
|
+
{
|
|
72
|
+
fileName: "/Users/manikandan.kanna/Desktop/PlatformX/platformx-mono-repo-nx/libs/hc-wrapper/src/lib/contentTypes/Components/CommonContentComponent.tsx",
|
|
73
|
+
lineNumber: 89,
|
|
74
|
+
columnNumber: 5
|
|
75
|
+
},
|
|
76
|
+
void 0
|
|
77
|
+
);
|
|
78
|
+
}, X = J(B);
|
|
79
|
+
export {
|
|
80
|
+
X as default
|
|
81
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as P } from "./index-6HCIStyP.mjs";
|
|
2
2
|
import v from "react";
|
|
3
|
-
import { y as D, z as O } from "./ToggleButton-
|
|
3
|
+
import { y as D, z as O } from "./ToggleButton-Czdz0-6I.mjs";
|
|
4
4
|
function b(t, e) {
|
|
5
5
|
for (var r = 0; r < e.length; r++) {
|
|
6
6
|
const o = e[r];
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { j as $, f as _, s as n, a as V } from "./index-6HCIStyP.mjs";
|
|
2
|
+
import { f as R, a as ee } from "./ToggleButton-Czdz0-6I.mjs";
|
|
3
|
+
import { useState as a, useEffect as te } from "react";
|
|
4
|
+
import { m as ae } from "./mutateApi-FU_0iEJ8.mjs";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
const E = async (p, f, D, w = "", t = "wellnessevent") => {
|
|
8
|
+
var g, d, s, r;
|
|
9
|
+
const o = await _.getContentSchemaList(
|
|
10
|
+
{
|
|
11
|
+
searchTerm: w,
|
|
12
|
+
filter: (t == null ? void 0 : t.toLocaleLowerCase()) === "events" ? "wellnessevent" : t == null ? void 0 : t.toLocaleLowerCase()
|
|
13
|
+
},
|
|
14
|
+
p || "en",
|
|
15
|
+
f
|
|
16
|
+
);
|
|
17
|
+
(d = (g = o == null ? void 0 : o.data) == null ? void 0 : g.publish_getContents) != null && d.records ? D((r = (s = o == null ? void 0 : o.data) == null ? void 0 : s.publish_getContents) == null ? void 0 : r.records) : n("Something went wrong !");
|
|
18
|
+
}, ie = (p) => {
|
|
19
|
+
const {
|
|
20
|
+
secondaryArgs: f,
|
|
21
|
+
prelemAnalyticsProp: D,
|
|
22
|
+
prelemAuthoringHelper: w,
|
|
23
|
+
userId: t,
|
|
24
|
+
filters: o,
|
|
25
|
+
relativePath: g = "",
|
|
26
|
+
articleData: d
|
|
27
|
+
} = p || {}, {
|
|
28
|
+
prelemBaseEndpoint: { language: s, site_host: r }
|
|
29
|
+
} = f, [P, y] = a(!1), [A, v] = a({}), [b, C] = a({}), [G, T] = a(0), u = localStorage.getItem("userId") || t, [x, L] = a([]), [H, j] = a([]), [N, U] = a({}), [M, B] = a({}), [W, X] = a({}), S = async (I, l, h) => {
|
|
30
|
+
var i, m;
|
|
31
|
+
if (!u) {
|
|
32
|
+
n("User ID is not available. Please log in.");
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
const c = {
|
|
37
|
+
input: { activity_type: h, target: I.toString(), action: l },
|
|
38
|
+
user_id: u
|
|
39
|
+
}, e = await ae.setPersonalGoal(c, s, r);
|
|
40
|
+
((m = (i = e == null ? void 0 : e.data) == null ? void 0 : i.community_setPersonalGoal) == null ? void 0 : m.message) === "Created Successfully!!!" && l === "goal" ? V("Goal updated successfully!") : l !== "entry" && n("Something went wrong, please try after sometime !");
|
|
41
|
+
} catch (c) {
|
|
42
|
+
console.error("Error in update goal API:", c), n("Something went wrong, please try after sometime !");
|
|
43
|
+
}
|
|
44
|
+
}, k = async (I = "") => {
|
|
45
|
+
var l, h, i, m;
|
|
46
|
+
if (!u) {
|
|
47
|
+
n("User ID is not available. Please log in.");
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
y(!0);
|
|
52
|
+
const c = {
|
|
53
|
+
date: I,
|
|
54
|
+
user_id: u
|
|
55
|
+
}, e = await _.fetchPersonalTracker(c, s, r);
|
|
56
|
+
if (((l = e == null ? void 0 : e.errors) == null ? void 0 : l.length) > 0)
|
|
57
|
+
n((h = e == null ? void 0 : e.errors[0]) == null ? void 0 : h.message);
|
|
58
|
+
else if ((i = e == null ? void 0 : e.data) != null && i.community_fetchPersonalTracker) {
|
|
59
|
+
const {
|
|
60
|
+
water_intake: F,
|
|
61
|
+
steps: J,
|
|
62
|
+
streak_count: K,
|
|
63
|
+
individual_challenge_info: O,
|
|
64
|
+
calories: Q,
|
|
65
|
+
distance: Y,
|
|
66
|
+
device_info: Z
|
|
67
|
+
} = (m = e == null ? void 0 : e.data) == null ? void 0 : m.community_fetchPersonalTracker;
|
|
68
|
+
v(F), C(J), T(K), U(O), B({ calories: Q, distance: Y }), X(Z);
|
|
69
|
+
} else
|
|
70
|
+
console.error("GetPersonalData API failed"), n("GetPersonalData API failed");
|
|
71
|
+
} catch (c) {
|
|
72
|
+
console.error("Error in GetPersonalData API:", c), n("Error in GetPersonalData API"), v({}), C({});
|
|
73
|
+
} finally {
|
|
74
|
+
y(!1);
|
|
75
|
+
}
|
|
76
|
+
}, q = {
|
|
77
|
+
waterIntakeData: A,
|
|
78
|
+
loading: P,
|
|
79
|
+
fetchPersonalData: k,
|
|
80
|
+
updateGoals: S
|
|
81
|
+
}, z = {
|
|
82
|
+
stepsData: b,
|
|
83
|
+
loading: P,
|
|
84
|
+
updateGoals: S
|
|
85
|
+
};
|
|
86
|
+
return te(() => {
|
|
87
|
+
k(R(/* @__PURE__ */ new Date(), "yyyy-MM-dd")), E(s, r, L, "", "challenges"), E(s, r, j, "", "wellnessevent");
|
|
88
|
+
}, []), /* @__PURE__ */ $.jsxDEV(
|
|
89
|
+
ee,
|
|
90
|
+
{
|
|
91
|
+
analytics: D,
|
|
92
|
+
authoringHelper: w,
|
|
93
|
+
secondaryArgs: f,
|
|
94
|
+
waterIntakeDetails: q,
|
|
95
|
+
stepsDetails: z,
|
|
96
|
+
streaksCount: G,
|
|
97
|
+
data: x,
|
|
98
|
+
eventData: H,
|
|
99
|
+
articleVodData: d,
|
|
100
|
+
filters: o,
|
|
101
|
+
relativePath: g,
|
|
102
|
+
userId: t,
|
|
103
|
+
deviceInfo: W,
|
|
104
|
+
individualChallengeInfo: N,
|
|
105
|
+
commonInfo: M
|
|
106
|
+
},
|
|
107
|
+
void 0,
|
|
108
|
+
!1,
|
|
109
|
+
{
|
|
110
|
+
fileName: "/Users/manikandan.kanna/Desktop/PlatformX/platformx-mono-repo-nx/libs/hc-wrapper/src/lib/prelems/Components/EngagementHomeComponent.tsx",
|
|
111
|
+
lineNumber: 152,
|
|
112
|
+
columnNumber: 5
|
|
113
|
+
},
|
|
114
|
+
void 0
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
export {
|
|
118
|
+
ie as EngagementHomeComponent,
|
|
119
|
+
ie as default
|
|
120
|
+
};
|