@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260326064607 → 0.8.1-dev.20260326104921

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 (3) hide show
  1. package/dist/index.js +1267 -1031
  2. package/dist/index.mjs +1109 -873
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -30,82 +30,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
- // src/components/CopyButton.tsx
34
- var CopyButton_exports = {};
35
- __export(CopyButton_exports, {
36
- default: () => CopyButton
37
- });
38
- function CopyButton({ text }) {
39
- const [copied, setCopied] = (0, import_react39.useState)(false);
40
- const timeoutRef = (0, import_react39.useRef)(null);
41
- (0, import_react39.useEffect)(() => {
42
- return () => {
43
- if (timeoutRef.current) clearTimeout(timeoutRef.current);
44
- };
45
- }, []);
46
- const handleCopy = async () => {
47
- try {
48
- await navigator.clipboard.writeText(text);
49
- setCopied(true);
50
- if (timeoutRef.current) clearTimeout(timeoutRef.current);
51
- timeoutRef.current = setTimeout(() => setCopied(false), 2e3);
52
- } catch (err) {
53
- console.error("Failed to copy: ", err);
54
- }
55
- };
56
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
57
- "button",
58
- {
59
- onClick: handleCopy,
60
- className: "flex gap-1 items-center hover:text-white transition",
61
- children: [
62
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
63
- "svg",
64
- {
65
- width: "16",
66
- height: "16",
67
- viewBox: "0 0 24 24",
68
- className: "w-4 h-4",
69
- fill: "currentColor",
70
- children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
71
- "path",
72
- {
73
- fillRule: "evenodd",
74
- clipRule: "evenodd",
75
- d: "M12 4C10.8954 4 10 4.89543 10 6H14C14 4.89543 13.1046 4 12 4ZM8.53513 4C9.22675 2.8044 10.5194 2 12 2C13.4806 2 14.7733 2.8044 15.4649 4H17C18.6569 4 20 5.34315 20 7V19C20 20.6569 18.6569 22 17 22H7C5.34315 22 4 20.6569 4 19V7C4 5.34315 5.34315 4 7 4H8.53513ZM8 6H7C6.44772 6 6 6.44772 6 7V19C6 19.5523 6.44772 20 7 20H17C17.5523 20 18 19.5523 18 19V7C18 6.44772 17.5523 6 17 6H16C16 7.10457 15.1046 8 14 8H10C8.89543 8 8 7.10457 8 6Z"
76
- }
77
- )
78
- }
79
- ),
80
- copied ? "Copied!" : "Copy code"
81
- ]
82
- }
83
- );
84
- }
85
- var import_react39, import_jsx_runtime51;
86
- var init_CopyButton = __esm({
87
- "src/components/CopyButton.tsx"() {
88
- "use strict";
89
- "use client";
90
- import_react39 = require("react");
91
- import_jsx_runtime51 = require("react/jsx-runtime");
92
- }
93
- });
94
-
95
33
  // src/components/HlsPlayer.tsx
96
34
  var HlsPlayer_exports = {};
97
35
  __export(HlsPlayer_exports, {
98
36
  default: () => HlsPlayer_default
99
37
  });
100
- var import_react41, import_hls, import_jsx_runtime54, HlsPlayer, HlsPlayer_default;
38
+ var import_react33, import_hls, import_jsx_runtime42, HlsPlayer, HlsPlayer_default;
101
39
  var init_HlsPlayer = __esm({
102
40
  "src/components/HlsPlayer.tsx"() {
103
41
  "use strict";
104
42
  "use client";
105
- import_react41 = __toESM(require("react"));
43
+ import_react33 = __toESM(require("react"));
106
44
  import_hls = __toESM(require("hls.js"));
107
- import_jsx_runtime54 = require("react/jsx-runtime");
108
- HlsPlayer = import_react41.default.memo(
45
+ import_jsx_runtime42 = require("react/jsx-runtime");
46
+ HlsPlayer = import_react33.default.memo(
109
47
  ({
110
48
  assetUrl,
111
49
  posterUrl,
@@ -115,13 +53,13 @@ var init_HlsPlayer = __esm({
115
53
  loop = false,
116
54
  playOptions = "autoplay"
117
55
  }) => {
118
- const videoRef = (0, import_react41.useRef)(null);
119
- const hlsRef = (0, import_react41.useRef)(null);
120
- const [isPlaying, setIsPlaying] = (0, import_react41.useState)(playOptions === "autoplay");
121
- const [isHovered, setIsHovered] = (0, import_react41.useState)(false);
122
- const [isMobile, setIsMobile] = (0, import_react41.useState)(false);
123
- const wasManuallyPausedRef = (0, import_react41.useRef)(false);
124
- (0, import_react41.useEffect)(() => {
56
+ const videoRef = (0, import_react33.useRef)(null);
57
+ const hlsRef = (0, import_react33.useRef)(null);
58
+ const [isPlaying, setIsPlaying] = (0, import_react33.useState)(playOptions === "autoplay");
59
+ const [isHovered, setIsHovered] = (0, import_react33.useState)(false);
60
+ const [isMobile, setIsMobile] = (0, import_react33.useState)(false);
61
+ const wasManuallyPausedRef = (0, import_react33.useRef)(false);
62
+ (0, import_react33.useEffect)(() => {
125
63
  const checkMobile = () => {
126
64
  const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
127
65
  const isSmallScreen = window.innerWidth <= 768;
@@ -133,7 +71,7 @@ var init_HlsPlayer = __esm({
133
71
  window.addEventListener("resize", checkMobile);
134
72
  return () => window.removeEventListener("resize", checkMobile);
135
73
  }, []);
136
- (0, import_react41.useEffect)(() => {
74
+ (0, import_react33.useEffect)(() => {
137
75
  const v = videoRef.current;
138
76
  if (!v || !assetUrl) return;
139
77
  if (hlsRef.current) {
@@ -154,7 +92,7 @@ var init_HlsPlayer = __esm({
154
92
  v.src = assetUrl;
155
93
  }
156
94
  }, [assetUrl, isPlaying]);
157
- const handlePlayPause = (0, import_react41.useCallback)(() => {
95
+ const handlePlayPause = (0, import_react33.useCallback)(() => {
158
96
  const v = videoRef.current;
159
97
  if (!v) return;
160
98
  if (v.paused) {
@@ -166,14 +104,14 @@ var init_HlsPlayer = __esm({
166
104
  setIsPlaying(false);
167
105
  }
168
106
  }, []);
169
- const handleMouseEnter = (0, import_react41.useCallback)(() => {
107
+ const handleMouseEnter = (0, import_react33.useCallback)(() => {
170
108
  if (isMobile) return;
171
109
  setIsHovered(true);
172
110
  if (playOptions === "playOnHover" && videoRef.current && !wasManuallyPausedRef.current) {
173
111
  videoRef.current.play().then(() => setIsPlaying(true));
174
112
  }
175
113
  }, [playOptions, isMobile]);
176
- const handleMouseLeave = (0, import_react41.useCallback)(() => {
114
+ const handleMouseLeave = (0, import_react33.useCallback)(() => {
177
115
  if (isMobile) return;
178
116
  setIsHovered(false);
179
117
  if (playOptions === "playOnHover" && videoRef.current) {
@@ -182,14 +120,14 @@ var init_HlsPlayer = __esm({
182
120
  setIsPlaying(false);
183
121
  }
184
122
  }, [playOptions, isMobile]);
185
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
123
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
186
124
  "div",
187
125
  {
188
126
  className: "relative w-full aspect-video bg-black",
189
127
  onMouseEnter: handleMouseEnter,
190
128
  onMouseLeave: handleMouseLeave,
191
129
  children: [
192
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
130
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
193
131
  "video",
194
132
  {
195
133
  ref: videoRef,
@@ -203,7 +141,7 @@ var init_HlsPlayer = __esm({
203
141
  onClick: !isMobile && !isPlaying ? handlePlayPause : void 0
204
142
  }
205
143
  ),
206
- !isMobile && playOptions === "playOnHover" && posterUrl && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
144
+ !isMobile && playOptions === "playOnHover" && posterUrl && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
207
145
  "img",
208
146
  {
209
147
  src: posterUrl,
@@ -213,7 +151,7 @@ var init_HlsPlayer = __esm({
213
151
  className: `absolute inset-0 object-cover transition-opacity ${isHovered ? "opacity-0" : "opacity-100"}`
214
152
  }
215
153
  ),
216
- !isMobile && !isPlaying && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
154
+ !isMobile && !isPlaying && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
217
155
  "div",
218
156
  {
219
157
  className: "absolute inset-0 flex items-center justify-center cursor-pointer",
@@ -231,44 +169,106 @@ var init_HlsPlayer = __esm({
231
169
  }
232
170
  });
233
171
 
172
+ // src/components/CopyButton.tsx
173
+ var CopyButton_exports = {};
174
+ __export(CopyButton_exports, {
175
+ default: () => CopyButton
176
+ });
177
+ function CopyButton({ text }) {
178
+ const [copied, setCopied] = (0, import_react42.useState)(false);
179
+ const timeoutRef = (0, import_react42.useRef)(null);
180
+ (0, import_react42.useEffect)(() => {
181
+ return () => {
182
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
183
+ };
184
+ }, []);
185
+ const handleCopy = async () => {
186
+ try {
187
+ await navigator.clipboard.writeText(text);
188
+ setCopied(true);
189
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
190
+ timeoutRef.current = setTimeout(() => setCopied(false), 2e3);
191
+ } catch (err) {
192
+ console.error("Failed to copy: ", err);
193
+ }
194
+ };
195
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
196
+ "button",
197
+ {
198
+ onClick: handleCopy,
199
+ className: "flex gap-1 items-center hover:text-white transition",
200
+ children: [
201
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
202
+ "svg",
203
+ {
204
+ width: "16",
205
+ height: "16",
206
+ viewBox: "0 0 24 24",
207
+ className: "w-4 h-4",
208
+ fill: "currentColor",
209
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
210
+ "path",
211
+ {
212
+ fillRule: "evenodd",
213
+ clipRule: "evenodd",
214
+ d: "M12 4C10.8954 4 10 4.89543 10 6H14C14 4.89543 13.1046 4 12 4ZM8.53513 4C9.22675 2.8044 10.5194 2 12 2C13.4806 2 14.7733 2.8044 15.4649 4H17C18.6569 4 20 5.34315 20 7V19C20 20.6569 18.6569 22 17 22H7C5.34315 22 4 20.6569 4 19V7C4 5.34315 5.34315 4 7 4H8.53513ZM8 6H7C6.44772 6 6 6.44772 6 7V19C6 19.5523 6.44772 20 7 20H17C17.5523 20 18 19.5523 18 19V7C18 6.44772 17.5523 6 17 6H16C16 7.10457 15.1046 8 14 8H10C8.89543 8 8 7.10457 8 6Z"
215
+ }
216
+ )
217
+ }
218
+ ),
219
+ copied ? "Copied!" : "Copy code"
220
+ ]
221
+ }
222
+ );
223
+ }
224
+ var import_react42, import_jsx_runtime55;
225
+ var init_CopyButton = __esm({
226
+ "src/components/CopyButton.tsx"() {
227
+ "use strict";
228
+ "use client";
229
+ import_react42 = require("react");
230
+ import_jsx_runtime55 = require("react/jsx-runtime");
231
+ }
232
+ });
233
+
234
234
  // src/components/IFrameLoaderView.tsx
235
- var import_react44, import_jsx_runtime60, IFrameLoaderView, IFrameLoaderView_default;
235
+ var import_react45, import_jsx_runtime61, IFrameLoaderView, IFrameLoaderView_default;
236
236
  var init_IFrameLoaderView = __esm({
237
237
  "src/components/IFrameLoaderView.tsx"() {
238
238
  "use strict";
239
- import_react44 = __toESM(require("react"));
240
- import_jsx_runtime60 = require("react/jsx-runtime");
239
+ import_react45 = __toESM(require("react"));
240
+ import_jsx_runtime61 = require("react/jsx-runtime");
241
241
  IFrameLoaderView = (props) => {
242
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_react44.default.Fragment, { children: [
243
- props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
244
- /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex items-center mb-4", children: [
245
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
246
- /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ml-2", children: [
247
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
248
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
242
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_react45.default.Fragment, { children: [
243
+ props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
244
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center mb-4", children: [
245
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
246
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ml-2", children: [
247
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
248
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
249
249
  ] })
250
250
  ] }),
251
- /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
252
- /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "animate-pulse", children: [
253
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
254
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
255
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
256
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
257
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
251
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
252
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "animate-pulse", children: [
253
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
254
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
255
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
256
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
257
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
258
258
  ] }),
259
- /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "animate-pulse", children: [
260
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
261
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
262
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
263
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
264
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
259
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "animate-pulse", children: [
260
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
261
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
262
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
263
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
264
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
265
265
  ] }),
266
- /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "animate-pulse", children: [
267
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
268
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
269
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
270
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
271
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
266
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "animate-pulse", children: [
267
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
268
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
269
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
270
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
271
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
272
272
  ] })
273
273
  ] })
274
274
  ] }) }),
@@ -284,19 +284,19 @@ var IframeClient_exports = {};
284
284
  __export(IframeClient_exports, {
285
285
  default: () => IframeClient_default
286
286
  });
287
- var import_react45, import_jsx_runtime61, IframeClient, IframeClient_default;
287
+ var import_react46, import_jsx_runtime62, IframeClient, IframeClient_default;
288
288
  var init_IframeClient = __esm({
289
289
  "src/components/pageRenderingEngine/nodes/IframeClient.tsx"() {
290
290
  "use strict";
291
291
  "use client";
292
- import_react45 = __toESM(require("react"));
292
+ import_react46 = __toESM(require("react"));
293
293
  init_IFrameLoaderView();
294
- import_jsx_runtime61 = require("react/jsx-runtime");
294
+ import_jsx_runtime62 = require("react/jsx-runtime");
295
295
  IframeClient = ({ src }) => {
296
- const iframeRef = (0, import_react45.useRef)(null);
297
- const [iframeHeight, setIframeHeight] = (0, import_react45.useState)("100%");
298
- const [isDataFound, setIsDataFound] = (0, import_react45.useState)(null);
299
- (0, import_react45.useEffect)(() => {
296
+ const iframeRef = (0, import_react46.useRef)(null);
297
+ const [iframeHeight, setIframeHeight] = (0, import_react46.useState)("100%");
298
+ const [isDataFound, setIsDataFound] = (0, import_react46.useState)(null);
299
+ (0, import_react46.useEffect)(() => {
300
300
  const handleReceiveMessage = (event) => {
301
301
  const eventName = event?.data?.eventName;
302
302
  const payload = event?.data?.payload;
@@ -311,7 +311,7 @@ var init_IframeClient = __esm({
311
311
  window.addEventListener("message", handleReceiveMessage);
312
312
  return () => window.removeEventListener("message", handleReceiveMessage);
313
313
  }, []);
314
- (0, import_react45.useEffect)(() => {
314
+ (0, import_react46.useEffect)(() => {
315
315
  const handleResize = () => {
316
316
  if (iframeRef.current) {
317
317
  iframeRef.current.contentWindow?.postMessage({ eventName: "RESIZE" }, "*");
@@ -323,7 +323,7 @@ var init_IframeClient = __esm({
323
323
  const handleIframeLoad = () => {
324
324
  setIsDataFound(true);
325
325
  };
326
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react45.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
326
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react46.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
327
327
  "iframe",
328
328
  {
329
329
  ref: iframeRef,
@@ -1593,25 +1593,10 @@ var buttonClasses = /* @__PURE__ */ new Map([
1593
1593
  ["Primary" /* Solid */, "btn-solid"],
1594
1594
  ["PrimaryHollow" /* Hollow */, "btn-hollow"],
1595
1595
  ["Link" /* Link */, "btn-link"]
1596
- // [StyleTypes.Solid, "relative inline-flex items-center justify-center bg-gradient-to-b from-secondary to-secondary-strong rounded px-4 py-3 lg:py-2 font-medium shadow-sm hover:shadow-lg focus:outline-none active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed transition duration-150 ease-in-out text-body hover:bg-secondary-strong"],
1597
- // [StyleTypes.Solid, "relative inline-flex items-center justify-center bg-neutral-strong rounded px-4 py-3 lg:py-2 font-medium shadow-sm hover:shadow-lg focus:outline-none active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed transition duration-150 ease-in-out text-body hover:bg-neutral-stronger"],
1598
- // [StyleTypes.Hollow, "inline-flex font-medium items-center justify-center px-4 py-3 lg:py-2 transparent border-primary border text-primary rounded hover:shadow-md focus:outline-none transition duration-150 ease-in-out active:scale-95"],
1599
- // [StyleTypes.Hollow, "inline-flex font-medium items-center justify-center px-4 py-3 lg:py-2 transparent border-secondary border text-secondary rounded hover:shadow-md focus:outline-none transition duration-150 ease-in-out active:scale-95"],
1600
- // [StyleTypes.Hollow, "inline-flex font-medium items-center justify-center px-4 py-3 lg:py-2 transparent border-neutral border text-neutral rounded hover:shadow-md focus:outline-none transition duration-150 ease-in-out active:scale-95"],
1601
- // [StyleTypes.Ripple, "px-3 py-1.5 inline-flex items-center text-sm font-medium rounded border-[1.5px] border-primary ripple btn-bg-primary btn-primary-text"],
1602
- // [StyleTypes.Danger, "inline-flex text-sm font-medium items-center justify-center px-4 py-2 border border-alert bg-alert text-white rounded hover:bg-alert-600 hover:border-alert-600 focus:outline-none active:ring-1 active:ring-alert"],
1603
- // [StyleTypes.Link, ""],
1604
- // [StyleTypes.Light, "inline-flex items-center justify-center rounded bg-white border px-4 py-2 leading-6 text-primary shadow-sm hover:shadow focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:opacity-50 disabled:cursor-not-allowed"],
1605
1596
  ]);
1606
1597
  var progressClasses = /* @__PURE__ */ new Map([
1607
1598
  ["Primary" /* Solid */, ""],
1608
1599
  ["PrimaryHollow" /* Hollow */, ""],
1609
- // [StyleTypes.Solid, ""],
1610
- // [StyleTypes.Hollow, ""],
1611
- // [StyleTypes.Solid, ""],
1612
- // [StyleTypes.Hollow, ""],
1613
- // [StyleTypes.Ripple, ""],
1614
- // [StyleTypes.Danger, ""],
1615
1600
  ["Link" /* Link */, ""]
1616
1601
  ]);
1617
1602
 
@@ -2990,10 +2975,10 @@ var DataList = (props) => {
2990
2975
  var DataList_default = DataList;
2991
2976
 
2992
2977
  // src/components/pageRenderingEngine/PageBodyRenderer.tsx
2993
- var import_react49 = __toESM(require("react"));
2978
+ var import_react50 = __toESM(require("react"));
2994
2979
 
2995
2980
  // src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
2996
- var import_react34 = __toESM(require("react"));
2981
+ var import_react37 = __toESM(require("react"));
2997
2982
 
2998
2983
  // src/components/pageRenderingEngine/nodes/TextNode.tsx
2999
2984
  var import_jsx_runtime40 = (
@@ -3069,670 +3054,1125 @@ var LineBreakNode = () => {
3069
3054
  var LineBreakNode_default = LineBreakNode;
3070
3055
 
3071
3056
  // src/components/pageRenderingEngine/nodes/LinkNode.tsx
3072
- var import_react33 = __toESM(require("react"));
3073
- var import_link2 = __toESM(require("next/link"));
3074
- var import_jsx_runtime42 = require("react/jsx-runtime");
3075
- var LinkNode = (props) => {
3076
- const NodeTypes2 = {
3077
- ["text"]: TextNode_default
3078
- };
3079
- {
3080
- }
3081
- let formatClasses = props.node.cssClass || "";
3082
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_link2.default, { className: formatClasses, href: props.node.url, title: props.node.title, children: [
3083
- props.node.children && props.node.children.map((node, index) => {
3084
- const SelectedNode = NodeTypes2[node.type];
3085
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react33.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectedNode, { node }) }, index);
3086
- }),
3087
- props.node.children.length == 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("br", {})
3088
- ] });
3089
- };
3090
- var LinkNode_default = LinkNode;
3057
+ var import_react36 = __toESM(require("react"));
3091
3058
 
3092
- // src/components/pageRenderingEngine/nodes/SVGIconNode.tsx
3093
- var import_jsx_runtime43 = require("react/jsx-runtime");
3094
- var SVGIconNode = ({ node }) => {
3095
- if (!node?.svgCode) return null;
3096
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3097
- "span",
3098
- {
3099
- style: {
3100
- display: "inline-flex",
3101
- width: node.width,
3102
- height: node.height,
3103
- color: node.color
3104
- },
3105
- dangerouslySetInnerHTML: { __html: node.svgCode }
3106
- }
3107
- );
3108
- };
3109
- var SVGIconNode_default = SVGIconNode;
3059
+ // src/components/pageRenderingEngine/nodes/ImageNode.tsx
3060
+ var import_react34 = __toESM(require("react"));
3110
3061
 
3111
- // src/components/pageRenderingEngine/nodes/EquationNode.tsx
3112
- var import_katex = __toESM(require("katex"));
3113
- var import_jsx_runtime44 = require("react/jsx-runtime");
3114
- var EquationNode = ({ node }) => {
3115
- const { equation, inline } = node;
3116
- let html = "";
3117
- try {
3118
- html = import_katex.default.renderToString(equation, {
3119
- displayMode: !inline,
3120
- throwOnError: false
3121
- });
3122
- } catch (error) {
3123
- html = import_katex.default.renderToString(`\\text{Invalid equation}`, {
3124
- throwOnError: false
3125
- });
3062
+ // src/components/utilities/AssetUtility.tsx
3063
+ var AssetUtility = class {
3064
+ constructor() {
3126
3065
  }
3127
- if (inline) {
3128
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3129
- "span",
3130
- {
3131
- className: "katex-inline",
3132
- dangerouslySetInnerHTML: { __html: html }
3133
- }
3134
- );
3066
+ static resolveUrl(assetBaseUrl, url) {
3067
+ if (!url) return void 0;
3068
+ if (url.startsWith("http")) return url;
3069
+ if (!assetBaseUrl) return url;
3070
+ return `${assetBaseUrl}/${url}`;
3071
+ }
3072
+ // static getAssetUrl(apiBaseUrl: string) {
3073
+ // let domainName = apiBaseUrl.replace("https://", "");
3074
+ // return `https://cdn.g-assets.com/${domainName}`;
3075
+ // }
3076
+ static getAssetFullPath(apiBaseUrl, relativePath) {
3077
+ const domainName = apiBaseUrl.replace("https://", "");
3078
+ return `https://cdn.g-assets.com/${domainName}/${relativePath}`;
3135
3079
  }
3136
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3137
- "div",
3138
- {
3139
- className: "katex-block my-3 text-center",
3140
- dangerouslySetInnerHTML: { __html: html }
3141
- }
3142
- );
3143
3080
  };
3144
- var EquationNode_default = EquationNode;
3081
+ var AssetUtility_default = AssetUtility;
3145
3082
 
3146
- // src/components/pageRenderingEngine/nodes/DatafieldNode.tsx
3147
- var import_jsx_runtime45 = require("react/jsx-runtime");
3148
- function getNestedProperty(obj, path) {
3149
- if (!obj || !path) return null;
3150
- if (path.includes(".")) {
3151
- return path.split(".").reduce((prev, curr) => {
3152
- if (prev && typeof prev === "object") {
3153
- return prev[curr];
3154
- }
3155
- return null;
3156
- }, obj);
3157
- }
3158
- const value = obj[path];
3159
- if (Array.isArray(value)) {
3160
- return value.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { children: String(item) }, index));
3161
- }
3162
- return value;
3163
- }
3164
- var DatafieldNode = (props) => {
3165
- function cssStringToJson(cssString) {
3166
- const styleObject = {};
3167
- const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
3168
- if (matches) {
3169
- matches.forEach((match) => {
3170
- const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
3171
- if (parts && parts.length === 3) {
3172
- styleObject[parts[1].trim()] = parts[2].trim();
3173
- }
3174
- });
3083
+ // src/components/pageRenderingEngine/nodes/ImageNode.tsx
3084
+ var import_dynamic = __toESM(require("next/dynamic"));
3085
+
3086
+ // src/components/DeviceAssetSelector.tsx
3087
+ init_HlsPlayer();
3088
+ var import_jsx_runtime43 = require("react/jsx-runtime");
3089
+ var DeviceAssetSelector = ({
3090
+ assets,
3091
+ assetBaseUrl,
3092
+ session,
3093
+ // This should receive the session
3094
+ width,
3095
+ tag,
3096
+ customProps,
3097
+ nodeProps,
3098
+ device
3099
+ }) => {
3100
+ console.log("\u{1F511} Session in DeviceAssetSelector:", session);
3101
+ const targetTag = tag || nodeProps?.tag;
3102
+ const selectAssetByDevice = (assets2, currentDevice) => {
3103
+ if (!assets2 || assets2.length === 0) return void 0;
3104
+ const exactMatch = assets2.find((asset) => asset.device === currentDevice);
3105
+ if (exactMatch) return exactMatch;
3106
+ const noDeviceMatch = assets2.find((asset) => !asset.device || asset.device === "");
3107
+ if (noDeviceMatch) return noDeviceMatch;
3108
+ return void 0;
3109
+ };
3110
+ const selectAssetByTagAndDevice = (assets2, currentDevice, targetTag2) => {
3111
+ if (!assets2 || assets2.length === 0) return void 0;
3112
+ if (!targetTag2) return selectAssetByDevice(assets2, currentDevice);
3113
+ const taggedAssets = assets2.filter((asset) => asset.tag === targetTag2);
3114
+ if (taggedAssets.length === 0) {
3115
+ return selectAssetByDevice(assets2, currentDevice);
3175
3116
  }
3176
- return styleObject;
3177
- }
3178
- function toCamelCase2(str) {
3179
- return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
3117
+ const exactTaggedMatch = taggedAssets.find((asset) => asset.device === currentDevice);
3118
+ if (exactTaggedMatch) return exactTaggedMatch;
3119
+ const noDeviceTaggedMatch = taggedAssets.find((asset) => !asset.device || asset.device === "");
3120
+ if (noDeviceTaggedMatch) return noDeviceTaggedMatch;
3121
+ return void 0;
3122
+ };
3123
+ const selectAsset = () => {
3124
+ if (!assets || assets.length === 0) return void 0;
3125
+ if (targetTag) {
3126
+ return selectAssetByTagAndDevice(assets, device, targetTag);
3127
+ }
3128
+ return selectAssetByDevice(assets, device);
3129
+ };
3130
+ const selectedAsset = selectAsset();
3131
+ if (!selectedAsset) {
3132
+ console.warn("No suitable asset found for device:", device, "and tag:", targetTag);
3133
+ return null;
3180
3134
  }
3181
- function convertKeysToCamelCase2(obj) {
3182
- return Object.fromEntries(
3183
- Object.entries(obj).map(([key, value2]) => [
3184
- toCamelCase2(key),
3185
- value2
3186
- ])
3187
- );
3135
+ const resolvedAssetUrl = AssetUtility_default.resolveUrl(assetBaseUrl, selectedAsset.assetUrl);
3136
+ const resolvedThumbnailUrl = selectedAsset.posterUrl ? AssetUtility_default.resolveUrl(assetBaseUrl, selectedAsset.posterUrl) : void 0;
3137
+ console.log("Selected Asset:", resolvedThumbnailUrl);
3138
+ const title = selectedAsset.title || nodeProps?.title;
3139
+ const intrinsicWidth = selectedAsset.intrinsicWidth?.toString();
3140
+ const intrinsicHeight = selectedAsset.intrinsicHeight?.toString();
3141
+ const isHls = resolvedAssetUrl?.endsWith(".m3u8");
3142
+ const showControls = customProps?.showControls ?? nodeProps?.showControls === "true";
3143
+ const loop = customProps?.loop ?? nodeProps?.loop === "true";
3144
+ const playOptions = customProps?.playOptions ?? nodeProps?.playOptions;
3145
+ const styles = {};
3146
+ if (nodeProps?.height) {
3147
+ styles.height = nodeProps.height;
3188
3148
  }
3189
- const Formats = [
3190
- "",
3191
- "font-medium",
3192
- "italic",
3193
- "font-medium italic",
3194
- "",
3195
- "",
3196
- "",
3197
- "",
3198
- "underline",
3199
- "font-medium underline",
3200
- "italic underline",
3201
- "italic underline font-medium"
3202
- ];
3203
- const styles = convertKeysToCamelCase2(
3204
- cssStringToJson(props.node.style)
3205
- );
3206
- const fieldName = props.node.fieldName ?? "";
3207
- const value = props.dataitem ? getNestedProperty(props.dataitem, fieldName) : null;
3208
- const isEmptyValue = value === null || value === void 0 || value === "" || Array.isArray(value) && value.length === 0 || typeof value === "object" && value !== null && Object.keys(value).length === 0;
3209
- const maxLines = props.node.maxLines;
3210
- if (maxLines && Number(maxLines) > 0) {
3211
- Object.assign(styles, {
3212
- display: "-webkit-box",
3213
- overflow: "hidden",
3214
- WebkitBoxOrient: "vertical",
3215
- WebkitLineClamp: String(maxLines)
3216
- });
3149
+ if (nodeProps?.borderRadius) {
3150
+ styles.borderRadius = nodeProps.borderRadius;
3217
3151
  }
3218
- const dataType = props.node.dataType;
3219
- if (isEmptyValue) return null;
3220
- if (dataType === "rawContent") {
3221
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3222
- PageBodyRenderer_default,
3223
- {
3224
- rawBody: String(value ?? `@databound[${fieldName}]`),
3225
- routeParameters: props.routeParameters,
3226
- query: props.query,
3227
- session: props.session,
3228
- host: props.host,
3229
- path: props.path,
3230
- apiBaseUrl: props.apiBaseUrl,
3231
- breadcrumb: props.breadcrumb,
3232
- donotApplyContainerClass: true
3233
- }
3234
- );
3152
+ if (nodeProps?.width) {
3153
+ styles.width = nodeProps.width;
3235
3154
  }
3236
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3237
- "span",
3238
- {
3239
- className: `datafield-node ${props.node.format < Formats.length ? Formats[props.node.format] : ""}`,
3240
- style: styles,
3241
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3242
- ViewControl_default,
3155
+ const FormatClass = {
3156
+ "center": "justify-center",
3157
+ "left": "justify-start",
3158
+ "right": "justify-end"
3159
+ };
3160
+ const formatClasses = FormatClass[nodeProps?.format || ""] || "";
3161
+ const renderMedia = () => {
3162
+ if (isHls) {
3163
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3164
+ HlsPlayer_default,
3243
3165
  {
3244
- controlType: dataType,
3245
- value: value ?? `@databound[${fieldName}]`
3166
+ assetUrl: resolvedAssetUrl,
3167
+ posterUrl: resolvedThumbnailUrl,
3168
+ intrinsicWidth,
3169
+ intrinsicHeight,
3170
+ showControls,
3171
+ loop,
3172
+ playOptions,
3173
+ apiBaseUrl: assetBaseUrl,
3174
+ session
3246
3175
  }
3247
- )
3176
+ );
3177
+ } else {
3178
+ return (
3179
+ /* eslint-disable-next-line @next/next/no-img-element */
3180
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3181
+ "img",
3182
+ {
3183
+ style: styles,
3184
+ loading: "lazy",
3185
+ className: "object-cover w-full",
3186
+ src: resolvedAssetUrl,
3187
+ width: selectedAsset.intrinsicWidth,
3188
+ alt: title || "Asset image",
3189
+ height: selectedAsset.intrinsicHeight
3190
+ }
3191
+ )
3192
+ );
3248
3193
  }
3249
- );
3194
+ };
3195
+ if (width) {
3196
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { style: { width }, children: renderMedia() });
3197
+ }
3198
+ if (nodeProps?.format) {
3199
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
3200
+ }
3201
+ return renderMedia();
3250
3202
  };
3251
- var DatafieldNode_default = DatafieldNode;
3203
+ var DeviceAssetSelector_default = DeviceAssetSelector;
3252
3204
 
3253
- // src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
3254
- var import_jsx_runtime46 = require("react/jsx-runtime");
3255
- var ParagraphNode = (props) => {
3256
- const NodeTypes2 = {
3257
- ["text"]: TextNode_default,
3258
- ["linebreak"]: LineBreakNode_default,
3259
- ["link"]: LinkNode_default,
3260
- ["datafield"]: DatafieldNode_default,
3261
- ["equation"]: EquationNode_default,
3262
- ["svg-icon"]: SVGIconNode_default
3263
- };
3205
+ // src/components/pageRenderingEngine/nodes/ImageNode.tsx
3206
+ var import_jsx_runtime44 = require("react/jsx-runtime");
3207
+ var HlsPlayer2 = (0, import_dynamic.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), {
3208
+ ssr: false
3209
+ });
3210
+ var getNestedValue = (obj, path) => {
3211
+ if (!obj || !path) return void 0;
3212
+ return path.split(".").reduce((current, key) => {
3213
+ return current && current[key] !== void 0 ? current[key] : void 0;
3214
+ }, obj);
3215
+ };
3216
+ var ImageNode = (props) => {
3217
+ let assets;
3218
+ let imageUrl;
3219
+ let posterUrl;
3220
+ const currentDevice = props.device;
3221
+ if (props.node.device) {
3222
+ const nodeDevice = props.node.device;
3223
+ if (nodeDevice !== currentDevice) {
3224
+ return null;
3225
+ }
3226
+ }
3227
+ console.log("ImageNode device / currentDevice:", props.node.device, currentDevice);
3228
+ if (props.node.imageUrl.startsWith("http")) {
3229
+ imageUrl = props.node.imageUrl;
3230
+ posterUrl = AssetUtility_default.resolveUrl(
3231
+ props.assetBaseUrl,
3232
+ props.node.posterUrl
3233
+ );
3234
+ } else if (props.dataitem && props.node.datafield) {
3235
+ const image = getNestedValue(props.dataitem, props.node.datafield);
3236
+ console.log("ImageNode Datafield Image:", image);
3237
+ try {
3238
+ if (typeof image === "string") {
3239
+ assets = JSON.parse(image);
3240
+ } else if (Array.isArray(image)) {
3241
+ assets = image;
3242
+ } else if (image && typeof image === "object") {
3243
+ assets = [image];
3244
+ }
3245
+ } catch (error) {
3246
+ console.error("Error parsing assets in ImageNode:", error);
3247
+ }
3248
+ if (assets && assets.length > 0) {
3249
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_jsx_runtime44.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3250
+ DeviceAssetSelector_default,
3251
+ {
3252
+ device: props.device,
3253
+ assets,
3254
+ assetBaseUrl: props.assetBaseUrl,
3255
+ session: props.session,
3256
+ nodeProps: {
3257
+ title: props.node.title,
3258
+ showControls: props.node.showControls,
3259
+ loop: props.node.loop,
3260
+ playOptions: props.node.playOptions,
3261
+ borderRadius: props.node.borderRadius,
3262
+ width: props.node.width,
3263
+ height: props.node.height,
3264
+ format: props.node.format,
3265
+ tag: props.node.tag,
3266
+ // Add tag to ImageNode if needed
3267
+ placementCode: props.node.placementCode
3268
+ }
3269
+ }
3270
+ ) });
3271
+ } else {
3272
+ imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
3273
+ posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
3274
+ }
3275
+ } else {
3276
+ imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
3277
+ posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
3278
+ }
3279
+ console.log("ImageNode Assets:", assets);
3280
+ if (!imageUrl) {
3281
+ return null;
3282
+ }
3283
+ const styles = {};
3284
+ if (props.node.height) styles.height = props.node.height;
3285
+ if (props.node.borderRadius) styles.borderRadius = props.node.borderRadius;
3286
+ if (props.node.width) styles.width = props.node.width;
3264
3287
  const FormatClass = {
3265
- "center": "text-center",
3266
- "right": "text-right"
3288
+ "center": "justify-center",
3289
+ "left": "justify-start",
3290
+ "right": "justify-end"
3267
3291
  };
3268
3292
  {
3269
3293
  }
3270
3294
  const formatClasses = FormatClass[props.node.format] || "";
3271
- const isInlineOnlyParent = props.parentTag === "summary";
3272
- const hasChildren = props.node.children && props.node.children.length > 0;
3273
- if (isInlineOnlyParent) {
3274
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: hasChildren && props.node.children.map((node, index) => {
3275
- const SelectedNode = NodeTypes2[node.type];
3276
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react34.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3277
- SelectedNode,
3295
+ const isHls = imageUrl?.endsWith(".m3u8");
3296
+ const renderMedia = () => {
3297
+ if (isHls) {
3298
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3299
+ HlsPlayer2,
3278
3300
  {
3279
- node,
3280
- dataitem: props.dataitem,
3281
- session: props.session,
3301
+ assetUrl: imageUrl,
3302
+ posterUrl,
3303
+ intrinsicWidth: props.node.intrinsicWidth,
3304
+ intrinsicHeight: props.node.intrinsicHeight,
3305
+ showControls: props.node.showControls === "true",
3306
+ loop: props.node.loop === "true",
3307
+ playOptions: props.node.playOptions,
3282
3308
  apiBaseUrl: props.apiBaseUrl,
3283
- routeParameters: props.routeParameters
3309
+ session: props.session
3284
3310
  }
3285
- ) }, index);
3286
- }) });
3287
- }
3288
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: " " + formatClasses, children: [
3289
- hasChildren && props.node.children.map((node, index) => {
3290
- const SelectedNode = NodeTypes2[node.type];
3291
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react34.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3292
- SelectedNode,
3311
+ );
3312
+ } else {
3313
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react34.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3314
+ "img",
3293
3315
  {
3294
- node,
3295
- dataitem: props.dataitem,
3296
- session: props.session,
3297
- apiBaseUrl: props.apiBaseUrl,
3298
- routeParameters: props.routeParameters
3316
+ style: styles,
3317
+ loading: "lazy",
3318
+ className: "object-cover",
3319
+ src: imageUrl,
3320
+ width: props.node.intrinsicWidth,
3321
+ alt: props.node.title,
3322
+ height: props.node.intrinsicHeight
3299
3323
  }
3300
- ) }, index);
3301
- }),
3302
- !hasChildren && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "py-1.5 lg:py-2" })
3303
- ] });
3304
- };
3305
- var ParagraphNode_default = ParagraphNode;
3306
-
3307
- // src/components/pageRenderingEngine/nodes/HeadingNode.tsx
3308
- var import_react35 = __toESM(require("react"));
3309
- var import_jsx_runtime47 = require("react/jsx-runtime");
3310
- var HeadingNode = (props) => {
3311
- const NodeTypes2 = {
3312
- ["text"]: TextNode_default,
3313
- ["link"]: LinkNode_default,
3314
- ["svg-icon"]: SVGIconNode_default,
3315
- ["linebreak"]: LineBreakNode_default,
3316
- ["datafield"]: DatafieldNode_default
3317
- };
3318
- const HeadingTag = `${props.node.tag}`;
3319
- const FormatClass = {
3320
- "center": "text-center"
3321
- };
3322
- {
3323
- }
3324
- const formatClasses = FormatClass[props.node.format] || "";
3325
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: import_react35.default.createElement(
3326
- HeadingTag,
3327
- { className: formatClasses },
3328
- props.node.children && props.node.children.map((childNode, index) => {
3329
- const SelectedNode = NodeTypes2[childNode.type];
3330
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react35.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectedNode, { node: childNode, dataitem: props.dataitem, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
3331
- })
3332
- ) });
3333
- };
3334
- var HeadingNode_default = HeadingNode;
3335
-
3336
- // src/components/pageRenderingEngine/nodes/ListNode.tsx
3337
- var import_react37 = __toESM(require("react"));
3338
-
3339
- // src/components/pageRenderingEngine/nodes/ListItemNode.tsx
3340
- var import_react36 = __toESM(require("react"));
3341
- var import_jsx_runtime48 = require("react/jsx-runtime");
3342
- var ListItemNode = (props) => {
3343
- const NodeTypes2 = {
3344
- text: TextNode_default,
3345
- linebreak: LineBreakNode_default,
3346
- link: LinkNode_default,
3347
- list: ListNode_default
3348
- };
3349
- let foundFirstBreak = false;
3350
- const firstTextChild = props.node.children?.find((c) => c.type === "text");
3351
- let liStyle = {};
3352
- if (firstTextChild?.style) {
3353
- const match = firstTextChild.style.match(/font-size\s*:\s*([^;]+);?/);
3354
- if (match) {
3355
- liStyle.fontSize = match[1].trim();
3356
- }
3357
- }
3358
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { style: liStyle, children: props.node.children && props.node.children.map((node, index) => {
3359
- const SelectedNode = NodeTypes2[node.type];
3360
- if (node.type === "linebreak") {
3361
- if (!foundFirstBreak) {
3362
- foundFirstBreak = true;
3363
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", {}, index);
3364
- } else {
3365
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "py-1 lg:py-2" }, index);
3366
- }
3367
- } else {
3368
- foundFirstBreak = false;
3369
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react36.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
3324
+ ) });
3370
3325
  }
3371
- }) });
3372
- };
3373
- var ListItemNode_default = ListItemNode;
3374
-
3375
- // src/components/pageRenderingEngine/nodes/ListNode.tsx
3376
- var import_jsx_runtime49 = require("react/jsx-runtime");
3377
- var ListNode = (props) => {
3378
- const NodeTypes2 = {
3379
- listitem: ListItemNode_default
3380
- };
3381
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react37.default.Fragment, { children: [
3382
- props.node.listType == "bullet" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("ul", { children: props.node.children && props.node.children.map((node, index) => {
3383
- const SelectedNode = NodeTypes2[node.type];
3384
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react37.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
3385
- }) }),
3386
- props.node.listType == "number" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("ol", { children: props.node.children && props.node.children.map((node, index) => {
3387
- const SelectedNode = NodeTypes2[node.type];
3388
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react37.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
3389
- }) })
3390
- ] });
3391
- };
3392
- var ListNode_default = ListNode;
3393
-
3394
- // src/components/pageRenderingEngine/nodes/QuoteNode.tsx
3395
- var import_react38 = __toESM(require("react"));
3396
- var import_jsx_runtime50 = require("react/jsx-runtime");
3397
- var QuoteNode = (props) => {
3398
- const NodeTypes2 = {
3399
- ["text"]: TextNode_default,
3400
- ["linebreak"]: LineBreakNode_default,
3401
- ["link"]: LinkNode_default
3402
- };
3403
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
3404
- const SelectedNode = NodeTypes2[node.type];
3405
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react38.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
3406
- }) });
3407
- };
3408
- var QuoteNode_default = QuoteNode;
3409
-
3410
- // src/components/pageRenderingEngine/nodes/CodeNode.tsx
3411
- var import_react40 = __toESM(require("react"));
3412
- var import_dynamic = __toESM(require("next/dynamic"));
3413
- var import_jsx_runtime52 = require("react/jsx-runtime");
3414
- var CopyButton2 = (0, import_dynamic.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
3415
- ssr: false,
3416
- // optional: fallback UI while loading
3417
- loading: () => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
3418
- });
3419
- var CodeNode = (props) => {
3420
- const NodeTypes2 = {
3421
- text: TextNode_default,
3422
- linebreak: LineBreakNode_default,
3423
- link: LinkNode_default
3424
3326
  };
3425
- const textContent = props.node?.children?.map((node) => {
3426
- if (node.type === "text") return node.text || "";
3427
- if (node.type === "linebreak") return "\n";
3428
- if (node.type === "link") return node.text || node.url || "";
3429
- return "";
3430
- }).join("") ?? "";
3431
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
3432
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center relative bg-neutral-strong px-4 py-3 text-xs font-sans justify-between rounded-t-md ", children: [
3433
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: "Code Snippet" }),
3434
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CopyButton2, { text: textContent })
3435
- ] }),
3436
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("code", { className: "bg-neutral-soft p-4 text-sm whitespace-pre-wrap border border-2 block", children: props.node.children && props.node.children.map((node, index) => {
3437
- const SelectedNode = NodeTypes2[node.type];
3438
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react40.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
3439
- SelectedNode,
3440
- {
3441
- node,
3442
- session: props.session,
3443
- apiBaseUrl: props.apiBaseUrl,
3444
- routeParameters: props.routeParameters
3445
- }
3446
- ) }, index);
3447
- }) })
3448
- ] });
3449
- };
3450
- var CodeNode_default = CodeNode;
3451
-
3452
- // src/components/pageRenderingEngine/nodes/HorizontalRuleNode.tsx
3453
- var import_jsx_runtime53 = require("react/jsx-runtime");
3454
- var HorizontalRuleNode = () => {
3455
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("hr", {});
3327
+ if (props.node.width) {
3328
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
3329
+ }
3330
+ return renderMedia();
3456
3331
  };
3457
- var HorizontalRuleNode_default = HorizontalRuleNode;
3332
+ var ImageNode_default = ImageNode;
3458
3333
 
3459
- // src/components/pageRenderingEngine/nodes/ImageNode.tsx
3460
- var import_react42 = __toESM(require("react"));
3334
+ // src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx
3335
+ var import_react35 = require("react");
3461
3336
 
3462
- // src/components/utilities/AssetUtility.tsx
3463
- var AssetUtility = class {
3337
+ // src/clients/CacheManage.tsx
3338
+ var import_node_cache = __toESM(require("node-cache"));
3339
+ var CacheManager = class _CacheManager {
3464
3340
  constructor() {
3341
+ this.maxCacheSize = 1e3;
3342
+ this.cache = new import_node_cache.default({ stdTTL: 0, checkperiod: 300 });
3465
3343
  }
3466
- static resolveUrl(assetBaseUrl, url) {
3467
- if (!url) return void 0;
3468
- if (url.startsWith("http")) return url;
3469
- if (!assetBaseUrl) return url;
3470
- return `${assetBaseUrl}/${url}`;
3471
- }
3472
- // static getAssetUrl(apiBaseUrl: string) {
3473
- // let domainName = apiBaseUrl.replace("https://", "");
3474
- // return `https://cdn.g-assets.com/${domainName}`;
3475
- // }
3476
- static getAssetFullPath(apiBaseUrl, relativePath) {
3477
- const domainName = apiBaseUrl.replace("https://", "");
3478
- return `https://cdn.g-assets.com/${domainName}/${relativePath}`;
3479
- }
3480
- };
3481
- var AssetUtility_default = AssetUtility;
3482
-
3483
- // src/components/pageRenderingEngine/nodes/ImageNode.tsx
3484
- var import_dynamic2 = __toESM(require("next/dynamic"));
3485
-
3486
- // src/components/DeviceAssetSelector.tsx
3487
- init_HlsPlayer();
3488
- var import_jsx_runtime55 = require("react/jsx-runtime");
3489
- var DeviceAssetSelector = ({
3490
- assets,
3491
- assetBaseUrl,
3492
- session,
3493
- // This should receive the session
3494
- width,
3495
- tag,
3496
- customProps,
3497
- nodeProps,
3498
- device
3499
- }) => {
3500
- console.log("\u{1F511} Session in DeviceAssetSelector:", session);
3501
- const targetTag = tag || nodeProps?.tag;
3502
- const selectAssetByDevice = (assets2, currentDevice) => {
3503
- if (!assets2 || assets2.length === 0) return void 0;
3504
- const exactMatch = assets2.find((asset) => asset.device === currentDevice);
3505
- if (exactMatch) return exactMatch;
3506
- const noDeviceMatch = assets2.find((asset) => !asset.device || asset.device === "");
3507
- if (noDeviceMatch) return noDeviceMatch;
3508
- return void 0;
3509
- };
3510
- const selectAssetByTagAndDevice = (assets2, currentDevice, targetTag2) => {
3511
- if (!assets2 || assets2.length === 0) return void 0;
3512
- if (!targetTag2) return selectAssetByDevice(assets2, currentDevice);
3513
- const taggedAssets = assets2.filter((asset) => asset.tag === targetTag2);
3514
- if (taggedAssets.length === 0) {
3515
- return selectAssetByDevice(assets2, currentDevice);
3516
- }
3517
- const exactTaggedMatch = taggedAssets.find((asset) => asset.device === currentDevice);
3518
- if (exactTaggedMatch) return exactTaggedMatch;
3519
- const noDeviceTaggedMatch = taggedAssets.find((asset) => !asset.device || asset.device === "");
3520
- if (noDeviceTaggedMatch) return noDeviceTaggedMatch;
3521
- return void 0;
3522
- };
3523
- const selectAsset = () => {
3524
- if (!assets || assets.length === 0) return void 0;
3525
- if (targetTag) {
3526
- return selectAssetByTagAndDevice(assets, device, targetTag);
3344
+ static getInstance() {
3345
+ if (!_CacheManager.instance) {
3346
+ _CacheManager.instance = new _CacheManager();
3527
3347
  }
3528
- return selectAssetByDevice(assets, device);
3529
- };
3530
- const selectedAsset = selectAsset();
3531
- if (!selectedAsset) {
3532
- console.warn("No suitable asset found for device:", device, "and tag:", targetTag);
3348
+ return _CacheManager.instance;
3349
+ }
3350
+ get(key) {
3533
3351
  return null;
3534
3352
  }
3535
- const resolvedAssetUrl = AssetUtility_default.resolveUrl(assetBaseUrl, selectedAsset.assetUrl);
3536
- const resolvedThumbnailUrl = selectedAsset.posterUrl ? AssetUtility_default.resolveUrl(assetBaseUrl, selectedAsset.posterUrl) : void 0;
3537
- console.log("Selected Asset:", resolvedThumbnailUrl);
3538
- const title = selectedAsset.title || nodeProps?.title;
3539
- const intrinsicWidth = selectedAsset.intrinsicWidth?.toString();
3540
- const intrinsicHeight = selectedAsset.intrinsicHeight?.toString();
3541
- const isHls = resolvedAssetUrl?.endsWith(".m3u8");
3542
- const showControls = customProps?.showControls ?? nodeProps?.showControls === "true";
3543
- const loop = customProps?.loop ?? nodeProps?.loop === "true";
3544
- const playOptions = customProps?.playOptions ?? nodeProps?.playOptions;
3545
- const styles = {};
3546
- if (nodeProps?.height) {
3547
- styles.height = nodeProps.height;
3353
+ set(key, data, ttl) {
3548
3354
  }
3549
- if (nodeProps?.borderRadius) {
3550
- styles.borderRadius = nodeProps.borderRadius;
3355
+ clear() {
3356
+ this.cache.flushAll();
3551
3357
  }
3552
- if (nodeProps?.width) {
3553
- styles.width = nodeProps.width;
3358
+ size() {
3359
+ return this.cache.keys().length;
3554
3360
  }
3555
- const FormatClass = {
3556
- "center": "justify-center",
3557
- "left": "justify-start",
3558
- "right": "justify-end"
3559
- };
3560
- const formatClasses = FormatClass[nodeProps?.format || ""] || "";
3561
- const renderMedia = () => {
3562
- if (isHls) {
3563
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
3564
- HlsPlayer_default,
3565
- {
3566
- assetUrl: resolvedAssetUrl,
3567
- posterUrl: resolvedThumbnailUrl,
3568
- intrinsicWidth,
3569
- intrinsicHeight,
3570
- showControls,
3571
- loop,
3572
- playOptions,
3573
- apiBaseUrl: assetBaseUrl,
3574
- session
3361
+ destroy() {
3362
+ this.cache.close();
3363
+ }
3364
+ };
3365
+
3366
+ // src/clients/ServiceClient.tsx
3367
+ var ServerApiError = class extends Error {
3368
+ constructor(data, status) {
3369
+ super(data.message || "---");
3370
+ this.status = status;
3371
+ this.data = data;
3372
+ this.data.isSuccessful = false;
3373
+ }
3374
+ };
3375
+ var ServiceClient = class {
3376
+ constructor(apiBaseUrl, session) {
3377
+ this.cacheManager = CacheManager.getInstance();
3378
+ this.baseUrl = apiBaseUrl;
3379
+ this.session = session;
3380
+ }
3381
+ buildFullPath(path, params) {
3382
+ let updatedPath = path;
3383
+ if (params) {
3384
+ Object.keys(params).forEach((key) => {
3385
+ updatedPath = updatedPath.replace(
3386
+ `{${key}}`,
3387
+ String(params[key])
3388
+ );
3389
+ });
3390
+ }
3391
+ return this.baseUrl + updatedPath;
3392
+ }
3393
+ getConfig() {
3394
+ const config = { headers: {} };
3395
+ if (this.session) {
3396
+ if (this.session.oAuthToken) {
3397
+ config.headers["Authorization"] = "Bearer " + this.session.oAuthToken;
3398
+ }
3399
+ config.headers["cid"] = this.session.cid || "";
3400
+ config.headers["UserCurrencyCode"] = this.session.userCurrencyCode || "INR";
3401
+ config.headers["MarketCode"] = this.session?.marketCode || "IND";
3402
+ }
3403
+ return config;
3404
+ }
3405
+ handleFetchError(error) {
3406
+ console.log(error);
3407
+ const serverApiError = error;
3408
+ if (serverApiError) {
3409
+ return serverApiError.data;
3410
+ }
3411
+ return {
3412
+ message: "There is some error. Please try after sometime.",
3413
+ isSuccessful: false
3414
+ };
3415
+ }
3416
+ async fetchJsonWithCache(fullPath, config) {
3417
+ const cacheKey = fullPath + "--" + (this.session?.marketCode || "IND");
3418
+ const cachedData = this.cacheManager.get(cacheKey);
3419
+ if (cachedData) {
3420
+ return cachedData;
3421
+ }
3422
+ console.log("*****************CALLING API:", cacheKey, (/* @__PURE__ */ new Date()).toISOString());
3423
+ const response = await fetch(fullPath, { headers: config.headers });
3424
+ if (!response.ok) {
3425
+ const apiErrorData = await response.json();
3426
+ throw new ServerApiError(apiErrorData, response.status);
3427
+ }
3428
+ const cacheControl = response.headers.get("Cache-Control");
3429
+ let revalidate = null;
3430
+ if (cacheControl) {
3431
+ const maxAgeMatch = cacheControl.match(/max-age=(\d+)/);
3432
+ if (maxAgeMatch && maxAgeMatch[1]) {
3433
+ const maxAge = parseInt(maxAgeMatch[1], 10);
3434
+ revalidate = maxAge * 1e3;
3435
+ }
3436
+ }
3437
+ const data = await response.json();
3438
+ data.isSuccessful = true;
3439
+ if (revalidate !== null && revalidate > 0) {
3440
+ console.log("revalidate............I am caching:" + revalidate);
3441
+ this.cacheManager.set(cacheKey, data, revalidate);
3442
+ }
3443
+ return data;
3444
+ }
3445
+ // private async refreshToken(): Promise<void> {
3446
+ // console.log("*******************calling refresh token***********************");
3447
+ // try {
3448
+ // const response = await fetch(this.baseUrl + "/auth/storefront/login/refreshToken", {
3449
+ // method: 'POST',
3450
+ // headers: {
3451
+ // 'Content-Type': 'application/json'
3452
+ // },
3453
+ // body: JSON.stringify({ refreshToken: this.session.refreshToken })
3454
+ // });
3455
+ // if (!response.ok) {
3456
+ // throw new Error("Failed to refresh token");
3457
+ // }
3458
+ // const responseData = await response.json();
3459
+ // this.session.oAuthToken = responseData.result.accessToken;
3460
+ // if (typeof window === "undefined") {
3461
+ // // Running on the server
3462
+ // } else {
3463
+ // await fetch("/api/login", {
3464
+ // method: "post",
3465
+ // headers: {
3466
+ // "Content-Type": "application/json",
3467
+ // },
3468
+ // body: JSON.stringify({ session: this.session }),
3469
+ // });
3470
+ // }
3471
+ // } catch (error: any) {
3472
+ // throw new Error("Failed to refresh token");
3473
+ // }
3474
+ // }
3475
+ async handleRequest(request) {
3476
+ try {
3477
+ return await request();
3478
+ } catch (error) {
3479
+ throw error;
3480
+ }
3481
+ }
3482
+ async post(path, data) {
3483
+ const request = async () => {
3484
+ const fullPath = this.baseUrl + path;
3485
+ const config = this.getConfig();
3486
+ const response = await fetch(fullPath, {
3487
+ method: "POST",
3488
+ headers: {
3489
+ ...config.headers,
3490
+ "Content-Type": "application/json"
3491
+ },
3492
+ body: JSON.stringify(data)
3493
+ });
3494
+ if (!response.ok) {
3495
+ const apiErrorData = await response.json();
3496
+ throw new ServerApiError(apiErrorData, response.status);
3497
+ }
3498
+ const responseData = await response.json();
3499
+ responseData.isSuccessful = true;
3500
+ return responseData;
3501
+ };
3502
+ try {
3503
+ return await this.handleRequest(request);
3504
+ } catch (error) {
3505
+ return this.handleFetchError(error);
3506
+ }
3507
+ }
3508
+ async getSingle(path, params) {
3509
+ const request = async () => {
3510
+ const sanitizedParams = params ? Object.fromEntries(
3511
+ Object.entries(params).map(([k, v]) => [k, String(v)])
3512
+ ) : void 0;
3513
+ const fullPath = this.buildFullPath(path, sanitizedParams);
3514
+ const config = this.getConfig();
3515
+ return await this.fetchJsonWithCache(fullPath, config);
3516
+ };
3517
+ try {
3518
+ return await this.handleRequest(request);
3519
+ } catch (error) {
3520
+ return this.handleFetchError(error);
3521
+ }
3522
+ }
3523
+ async get(path, params) {
3524
+ const request = async () => {
3525
+ const sanitizedParams = params ? Object.fromEntries(
3526
+ Object.entries(params).map(([k, v]) => [k, String(v)])
3527
+ ) : void 0;
3528
+ const fullPath = this.buildFullPath(path, sanitizedParams);
3529
+ const config = this.getConfig();
3530
+ console.log(fullPath);
3531
+ return await this.fetchJsonWithCache(fullPath, config);
3532
+ };
3533
+ try {
3534
+ return await this.handleRequest(request);
3535
+ } catch (error) {
3536
+ return this.handleFetchError(error);
3537
+ }
3538
+ }
3539
+ };
3540
+ var ServiceClient_default = ServiceClient;
3541
+
3542
+ // src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx
3543
+ var import_jsx_runtime45 = require("react/jsx-runtime");
3544
+ var LinkNodeButton = (props) => {
3545
+ const { node, dataitem, children, linkText, linkType, linkUrl } = props;
3546
+ const [isLoading, setIsLoading] = (0, import_react35.useState)(false);
3547
+ const [error, setError] = (0, import_react35.useState)(null);
3548
+ const extractFieldNames = (0, import_react35.useCallback)((template) => {
3549
+ if (!template) return [];
3550
+ const regex = /\{(\{\})?([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\}\})?\}/g;
3551
+ const matches = Array.from(template.matchAll(regex));
3552
+ const fieldNames = matches.map((match) => match[2] || match[1]).filter((name, index, self) => self.indexOf(name) === index);
3553
+ return fieldNames;
3554
+ }, []);
3555
+ const replaceTemplateVariables = (0, import_react35.useCallback)((template, responseData) => {
3556
+ if (!template) return template;
3557
+ let result = template;
3558
+ const fieldNames = extractFieldNames(template);
3559
+ if (responseData) {
3560
+ fieldNames.forEach((fieldName) => {
3561
+ const value = getNestedValue3(responseData, fieldName);
3562
+ if (value !== void 0) {
3563
+ const regex1 = new RegExp(`\\{${fieldName}\\}`, "g");
3564
+ const regex2 = new RegExp(`\\{\\{${fieldName}\\}\\}`, "g");
3565
+ result = result.replace(regex1, String(value));
3566
+ result = result.replace(regex2, String(value));
3575
3567
  }
3576
- );
3577
- } else {
3578
- return (
3579
- /* eslint-disable-next-line @next/next/no-img-element */
3580
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
3581
- "img",
3582
- {
3583
- style: styles,
3584
- loading: "lazy",
3585
- className: "object-cover w-full",
3586
- src: resolvedAssetUrl,
3587
- width: selectedAsset.intrinsicWidth,
3588
- alt: title || "Asset image",
3589
- height: selectedAsset.intrinsicHeight
3568
+ });
3569
+ }
3570
+ if (props.routeParameters) {
3571
+ Object.entries(props.routeParameters).forEach(([key, value]) => {
3572
+ const regex = new RegExp(`\\{\\{${key}\\}\\}`, "g");
3573
+ result = result.replace(regex, String(value));
3574
+ });
3575
+ }
3576
+ if (dataitem) {
3577
+ Object.entries(dataitem).forEach(([key, value]) => {
3578
+ const regex = new RegExp(`\\{\\{${key}\\}\\}`, "g");
3579
+ result = result.replace(regex, String(value));
3580
+ });
3581
+ }
3582
+ return result;
3583
+ }, [props.routeParameters, dataitem, extractFieldNames]);
3584
+ const getNestedValue3 = (0, import_react35.useCallback)((obj, path) => {
3585
+ if (!obj || !path) return void 0;
3586
+ if (obj[path] !== void 0) {
3587
+ return obj[path];
3588
+ }
3589
+ const keys = path.split(".");
3590
+ let current = obj;
3591
+ for (const key of keys) {
3592
+ if (current[key] === void 0) {
3593
+ return void 0;
3594
+ }
3595
+ current = current[key];
3596
+ }
3597
+ return current;
3598
+ }, []);
3599
+ const onClick = (0, import_react35.useCallback)(async (e) => {
3600
+ if (!node.postUrl) {
3601
+ setError("No POST URL configured for this button");
3602
+ return;
3603
+ }
3604
+ setIsLoading(true);
3605
+ setError(null);
3606
+ try {
3607
+ const resolvedPostUrl = replaceTemplateVariables(node.postUrl);
3608
+ let parsedPayload = {};
3609
+ if (node.payload) {
3610
+ try {
3611
+ const payloadStr = replaceTemplateVariables(node.payload);
3612
+ parsedPayload = JSON.parse(payloadStr);
3613
+ console.log("Parsed payload:", parsedPayload);
3614
+ } catch (err) {
3615
+ console.error("Failed to parse payload JSON:", err);
3616
+ parsedPayload = { error: "Invalid payload JSON" };
3617
+ }
3618
+ }
3619
+ const serviceClient = new ServiceClient_default(props.apiBaseUrl, props.session);
3620
+ const response = await serviceClient.post(resolvedPostUrl, parsedPayload);
3621
+ console.log("API Response:", response);
3622
+ if (response && !response.isSuccessful) {
3623
+ const errorMessage = response.message || "API request failed";
3624
+ setError(errorMessage);
3625
+ setIsLoading(false);
3626
+ return { isSuccessful: false, message: errorMessage };
3627
+ }
3628
+ if (response && node.redirectUrl) {
3629
+ const fieldNames = extractFieldNames(node.redirectUrl);
3630
+ console.log("Field names in redirect URL:", fieldNames);
3631
+ const fieldValueMap = {};
3632
+ fieldNames.forEach((fieldName) => {
3633
+ const value = getNestedValue3(response, fieldName);
3634
+ if (value !== void 0) {
3635
+ fieldValueMap[fieldName] = String(value);
3636
+ } else {
3637
+ const resultValue = getNestedValue3(response, `result.${fieldName}`);
3638
+ if (resultValue !== void 0) {
3639
+ fieldValueMap[fieldName] = String(resultValue);
3640
+ } else {
3641
+ const dataValue = getNestedValue3(response, `data.${fieldName}`);
3642
+ if (dataValue !== void 0) {
3643
+ fieldValueMap[fieldName] = String(dataValue);
3644
+ }
3645
+ }
3590
3646
  }
3591
- )
3592
- );
3647
+ });
3648
+ console.log("Field value map:", fieldValueMap);
3649
+ const missingFields = fieldNames.filter((fieldName) => !fieldValueMap[fieldName]);
3650
+ if (missingFields.length > 0) {
3651
+ console.warn(`Missing field values for: ${missingFields.join(", ")}`);
3652
+ }
3653
+ let resolvedRedirectUrl = node.redirectUrl;
3654
+ Object.entries(fieldValueMap).forEach(([fieldName, value]) => {
3655
+ const regex1 = new RegExp(`\\{${fieldName}\\}`, "g");
3656
+ const regex2 = new RegExp(`\\{\\{${fieldName}\\}\\}`, "g");
3657
+ resolvedRedirectUrl = resolvedRedirectUrl.replace(regex1, value);
3658
+ resolvedRedirectUrl = resolvedRedirectUrl.replace(regex2, value);
3659
+ });
3660
+ resolvedRedirectUrl = replaceTemplateVariables(resolvedRedirectUrl, response);
3661
+ console.log("Final redirect URL:", resolvedRedirectUrl);
3662
+ if (resolvedRedirectUrl && !resolvedRedirectUrl.includes("{")) {
3663
+ window.location.href = resolvedRedirectUrl;
3664
+ }
3665
+ } else if (response && !response.result && response.message) {
3666
+ setError(response.message);
3667
+ throw new Error(response.message);
3668
+ } else if (!response) {
3669
+ setError("No response from server");
3670
+ }
3671
+ setIsLoading(false);
3672
+ return { isSuccessful: true, response };
3673
+ } catch (err) {
3674
+ console.error("Button API call failed:", err);
3675
+ setError(err.message || "An unexpected error occurred");
3676
+ setIsLoading(false);
3677
+ return { isSuccessful: false, message: err.message };
3593
3678
  }
3679
+ }, [node.postUrl, node.payload, node.redirectUrl, replaceTemplateVariables, extractFieldNames, getNestedValue3, props.apiBaseUrl, props.session]);
3680
+ const renderButtonContent = () => {
3681
+ if (children) {
3682
+ return children;
3683
+ }
3684
+ if (linkText) {
3685
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: linkText });
3686
+ }
3687
+ return node.title || "Button";
3594
3688
  };
3595
- if (width) {
3596
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { style: { width }, children: renderMedia() });
3689
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "link-button-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3690
+ Button_default,
3691
+ {
3692
+ ButtonType: linkType,
3693
+ onClick,
3694
+ disabled: isLoading,
3695
+ className: "w-full",
3696
+ children: renderButtonContent()
3697
+ }
3698
+ ) });
3699
+ };
3700
+ var LinkNodeButton_default = LinkNodeButton;
3701
+
3702
+ // src/components/pageRenderingEngine/nodes/LinkNode.tsx
3703
+ var import_jsx_runtime46 = require("react/jsx-runtime");
3704
+ var LinkNode = (props) => {
3705
+ const NodeTypes2 = {
3706
+ text: TextNode_default,
3707
+ image: ImageNode_default
3708
+ };
3709
+ const { node, dataitem } = props;
3710
+ let linkUrl = node.url;
3711
+ if (node.datafield_link_url && dataitem) {
3712
+ const dynamicUrl = dataitem[node.datafield_link_url];
3713
+ if (dynamicUrl && typeof dynamicUrl === "string") {
3714
+ linkUrl = dynamicUrl;
3715
+ }
3716
+ }
3717
+ if (props.routeParameters && linkUrl && linkUrl.includes("{")) {
3718
+ Object.keys(props.routeParameters).forEach((param) => {
3719
+ const value = props.routeParameters[param];
3720
+ if (value !== void 0 && value !== null) {
3721
+ linkUrl = linkUrl.replace(
3722
+ new RegExp(`\\{${param}\\}`, "gi"),
3723
+ encodeURIComponent(String(value))
3724
+ );
3725
+ }
3726
+ });
3597
3727
  }
3598
- if (nodeProps?.format) {
3599
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
3728
+ let linkText = null;
3729
+ if (node.datafield_link_text && dataitem) {
3730
+ const dynamicText = dataitem[node.datafield_link_text];
3731
+ if (dynamicText && typeof dynamicText === "string") {
3732
+ linkText = dynamicText;
3733
+ }
3600
3734
  }
3601
- return renderMedia();
3735
+ const getLinkTypeFromCssClass = (cssClass) => {
3736
+ const classToTypeMap = {
3737
+ Primary: "Primary" /* Solid */,
3738
+ PrimaryHollow: "PrimaryHollow" /* Hollow */,
3739
+ Link: "Link" /* Link */
3740
+ };
3741
+ return classToTypeMap[cssClass];
3742
+ };
3743
+ const linkType = node.cssClass ? getLinkTypeFromCssClass(node.cssClass) : void 0;
3744
+ const isButton = node.isButton === true;
3745
+ const renderChildren = () => {
3746
+ if (!node.children || node.children.length === 0) return null;
3747
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: node.children.map((childNode, index) => {
3748
+ const SelectedNode = NodeTypes2[childNode.type];
3749
+ if (!SelectedNode) {
3750
+ console.warn("Unknown node type:", childNode.type);
3751
+ return null;
3752
+ }
3753
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react36.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3754
+ SelectedNode,
3755
+ {
3756
+ node: childNode,
3757
+ dataitem,
3758
+ linkText,
3759
+ routeParameters: props.routeParameters
3760
+ }
3761
+ ) }, index);
3762
+ }) });
3763
+ };
3764
+ const renderFallback = () => {
3765
+ if ((!node.children || node.children.length === 0) && linkText) {
3766
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: linkText });
3767
+ }
3768
+ if ((!node.children || node.children.length === 0) && !linkText) {
3769
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("br", {});
3770
+ }
3771
+ return null;
3772
+ };
3773
+ if (isButton) {
3774
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
3775
+ LinkNodeButton_default,
3776
+ {
3777
+ node,
3778
+ dataitem,
3779
+ routeParameters: props.routeParameters,
3780
+ session: props.session,
3781
+ apiBaseUrl: props.apiBaseUrl || "",
3782
+ linkText,
3783
+ linkType,
3784
+ linkUrl,
3785
+ children: [
3786
+ renderChildren(),
3787
+ renderFallback()
3788
+ ]
3789
+ }
3790
+ );
3791
+ }
3792
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
3793
+ Hyperlink,
3794
+ {
3795
+ href: linkUrl || "#",
3796
+ linkType,
3797
+ alt: linkText || node.title || "",
3798
+ children: [
3799
+ renderChildren(),
3800
+ renderFallback()
3801
+ ]
3802
+ }
3803
+ );
3602
3804
  };
3603
- var DeviceAssetSelector_default = DeviceAssetSelector;
3805
+ var LinkNode_default = LinkNode;
3604
3806
 
3605
- // src/components/pageRenderingEngine/nodes/ImageNode.tsx
3606
- var import_jsx_runtime56 = require("react/jsx-runtime");
3607
- var HlsPlayer2 = (0, import_dynamic2.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), {
3608
- ssr: false
3609
- });
3610
- var getNestedValue = (obj, path) => {
3611
- if (!obj || !path) return void 0;
3612
- return path.split(".").reduce((current, key) => {
3613
- return current && current[key] !== void 0 ? current[key] : void 0;
3614
- }, obj);
3807
+ // src/components/pageRenderingEngine/nodes/SVGIconNode.tsx
3808
+ var import_jsx_runtime47 = require("react/jsx-runtime");
3809
+ var SVGIconNode = ({ node }) => {
3810
+ if (!node?.svgCode) return null;
3811
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3812
+ "span",
3813
+ {
3814
+ style: {
3815
+ display: "inline-flex",
3816
+ width: node.width,
3817
+ height: node.height,
3818
+ color: node.color
3819
+ },
3820
+ dangerouslySetInnerHTML: { __html: node.svgCode }
3821
+ }
3822
+ );
3615
3823
  };
3616
- var ImageNode = (props) => {
3617
- let assets;
3618
- let imageUrl;
3619
- let posterUrl;
3620
- const currentDevice = props.device;
3621
- if (props.node.device) {
3622
- const nodeDevice = props.node.device;
3623
- if (nodeDevice !== currentDevice) {
3824
+ var SVGIconNode_default = SVGIconNode;
3825
+
3826
+ // src/components/pageRenderingEngine/nodes/EquationNode.tsx
3827
+ var import_katex = __toESM(require("katex"));
3828
+ var import_jsx_runtime48 = require("react/jsx-runtime");
3829
+ var EquationNode = ({ node }) => {
3830
+ const { equation, inline } = node;
3831
+ let html = "";
3832
+ try {
3833
+ html = import_katex.default.renderToString(equation, {
3834
+ displayMode: !inline,
3835
+ throwOnError: false
3836
+ });
3837
+ } catch (error) {
3838
+ html = import_katex.default.renderToString(`\\text{Invalid equation}`, {
3839
+ throwOnError: false
3840
+ });
3841
+ }
3842
+ if (inline) {
3843
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3844
+ "span",
3845
+ {
3846
+ className: "katex-inline",
3847
+ dangerouslySetInnerHTML: { __html: html }
3848
+ }
3849
+ );
3850
+ }
3851
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3852
+ "div",
3853
+ {
3854
+ className: "katex-block my-3 text-center",
3855
+ dangerouslySetInnerHTML: { __html: html }
3856
+ }
3857
+ );
3858
+ };
3859
+ var EquationNode_default = EquationNode;
3860
+
3861
+ // src/components/pageRenderingEngine/nodes/DatafieldNode.tsx
3862
+ var import_jsx_runtime49 = require("react/jsx-runtime");
3863
+ function getNestedProperty(obj, path) {
3864
+ if (!obj || !path) return null;
3865
+ if (path.includes(".")) {
3866
+ return path.split(".").reduce((prev, curr) => {
3867
+ if (prev && typeof prev === "object") {
3868
+ return prev[curr];
3869
+ }
3624
3870
  return null;
3871
+ }, obj);
3872
+ }
3873
+ const value = obj[path];
3874
+ if (Array.isArray(value)) {
3875
+ return value.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { children: String(item) }, index));
3876
+ }
3877
+ return value;
3878
+ }
3879
+ var DatafieldNode = (props) => {
3880
+ function cssStringToJson(cssString) {
3881
+ const styleObject = {};
3882
+ const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
3883
+ if (matches) {
3884
+ matches.forEach((match) => {
3885
+ const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
3886
+ if (parts && parts.length === 3) {
3887
+ styleObject[parts[1].trim()] = parts[2].trim();
3888
+ }
3889
+ });
3625
3890
  }
3891
+ return styleObject;
3892
+ }
3893
+ function toCamelCase2(str) {
3894
+ return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
3895
+ }
3896
+ function convertKeysToCamelCase2(obj) {
3897
+ return Object.fromEntries(
3898
+ Object.entries(obj).map(([key, value2]) => [
3899
+ toCamelCase2(key),
3900
+ value2
3901
+ ])
3902
+ );
3903
+ }
3904
+ const Formats = [
3905
+ "",
3906
+ "font-medium",
3907
+ "italic",
3908
+ "font-medium italic",
3909
+ "",
3910
+ "",
3911
+ "",
3912
+ "",
3913
+ "underline",
3914
+ "font-medium underline",
3915
+ "italic underline",
3916
+ "italic underline font-medium"
3917
+ ];
3918
+ const styles = convertKeysToCamelCase2(
3919
+ cssStringToJson(props.node.style)
3920
+ );
3921
+ const fieldName = props.node.fieldName ?? "";
3922
+ const value = props.dataitem ? getNestedProperty(props.dataitem, fieldName) : null;
3923
+ const isEmptyValue = value === null || value === void 0 || value === "" || Array.isArray(value) && value.length === 0 || typeof value === "object" && value !== null && Object.keys(value).length === 0;
3924
+ const maxLines = props.node.maxLines;
3925
+ if (maxLines && Number(maxLines) > 0) {
3926
+ Object.assign(styles, {
3927
+ display: "-webkit-box",
3928
+ overflow: "hidden",
3929
+ WebkitBoxOrient: "vertical",
3930
+ WebkitLineClamp: String(maxLines)
3931
+ });
3626
3932
  }
3627
- console.log("ImageNode device / currentDevice:", props.node.device, currentDevice);
3628
- if (props.node.imageUrl.startsWith("http")) {
3629
- imageUrl = props.node.imageUrl;
3630
- posterUrl = AssetUtility_default.resolveUrl(
3631
- props.assetBaseUrl,
3632
- props.node.posterUrl
3633
- );
3634
- } else if (props.dataitem && props.node.datafield) {
3635
- const image = getNestedValue(props.dataitem, props.node.datafield);
3636
- console.log("ImageNode Datafield Image:", image);
3637
- try {
3638
- if (typeof image === "string") {
3639
- assets = JSON.parse(image);
3640
- } else if (Array.isArray(image)) {
3641
- assets = image;
3642
- } else if (image && typeof image === "object") {
3643
- assets = [image];
3933
+ const dataType = props.node.dataType;
3934
+ if (isEmptyValue) return null;
3935
+ if (dataType === "rawContent") {
3936
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
3937
+ PageBodyRenderer_default,
3938
+ {
3939
+ rawBody: String(value ?? `@databound[${fieldName}]`),
3940
+ routeParameters: props.routeParameters,
3941
+ query: props.query,
3942
+ session: props.session,
3943
+ host: props.host,
3944
+ path: props.path,
3945
+ apiBaseUrl: props.apiBaseUrl,
3946
+ breadcrumb: props.breadcrumb,
3947
+ donotApplyContainerClass: true
3644
3948
  }
3645
- } catch (error) {
3646
- console.error("Error parsing assets in ImageNode:", error);
3647
- }
3648
- if (assets && assets.length > 0) {
3649
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_jsx_runtime56.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
3650
- DeviceAssetSelector_default,
3949
+ );
3950
+ }
3951
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
3952
+ "span",
3953
+ {
3954
+ className: `datafield-node ${props.node.format < Formats.length ? Formats[props.node.format] : ""}`,
3955
+ style: styles,
3956
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
3957
+ ViewControl_default,
3651
3958
  {
3652
- device: props.device,
3653
- assets,
3654
- assetBaseUrl: props.assetBaseUrl,
3655
- session: props.session,
3656
- nodeProps: {
3657
- title: props.node.title,
3658
- showControls: props.node.showControls,
3659
- loop: props.node.loop,
3660
- playOptions: props.node.playOptions,
3661
- borderRadius: props.node.borderRadius,
3662
- width: props.node.width,
3663
- height: props.node.height,
3664
- format: props.node.format,
3665
- tag: props.node.tag,
3666
- // Add tag to ImageNode if needed
3667
- placementCode: props.node.placementCode
3668
- }
3959
+ controlType: dataType,
3960
+ value: value ?? `@databound[${fieldName}]`
3669
3961
  }
3670
- ) });
3671
- } else {
3672
- imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
3673
- posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
3962
+ )
3674
3963
  }
3675
- } else {
3676
- imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
3677
- posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
3678
- }
3679
- console.log("ImageNode Assets:", assets);
3680
- if (!imageUrl) {
3681
- return null;
3682
- }
3683
- const styles = {};
3684
- if (props.node.height) styles.height = props.node.height;
3685
- if (props.node.borderRadius) styles.borderRadius = props.node.borderRadius;
3686
- if (props.node.width) styles.width = props.node.width;
3964
+ );
3965
+ };
3966
+ var DatafieldNode_default = DatafieldNode;
3967
+
3968
+ // src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
3969
+ var import_jsx_runtime50 = require("react/jsx-runtime");
3970
+ var ParagraphNode = (props) => {
3971
+ const NodeTypes2 = {
3972
+ ["text"]: TextNode_default,
3973
+ ["linebreak"]: LineBreakNode_default,
3974
+ ["link"]: LinkNode_default,
3975
+ ["datafield"]: DatafieldNode_default,
3976
+ ["equation"]: EquationNode_default,
3977
+ ["svg-icon"]: SVGIconNode_default
3978
+ };
3687
3979
  const FormatClass = {
3688
- "center": "justify-center",
3689
- "left": "justify-start",
3690
- "right": "justify-end"
3980
+ "center": "text-center",
3981
+ "right": "text-right"
3691
3982
  };
3692
3983
  {
3693
3984
  }
3694
3985
  const formatClasses = FormatClass[props.node.format] || "";
3695
- const isHls = imageUrl?.endsWith(".m3u8");
3696
- const renderMedia = () => {
3697
- if (isHls) {
3698
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
3699
- HlsPlayer2,
3986
+ const isInlineOnlyParent = props.parentTag === "summary";
3987
+ const hasChildren = props.node.children && props.node.children.length > 0;
3988
+ if (isInlineOnlyParent) {
3989
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: hasChildren && props.node.children.map((node, index) => {
3990
+ const SelectedNode = NodeTypes2[node.type];
3991
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react37.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3992
+ SelectedNode,
3700
3993
  {
3701
- assetUrl: imageUrl,
3702
- posterUrl,
3703
- intrinsicWidth: props.node.intrinsicWidth,
3704
- intrinsicHeight: props.node.intrinsicHeight,
3705
- showControls: props.node.showControls === "true",
3706
- loop: props.node.loop === "true",
3707
- playOptions: props.node.playOptions,
3994
+ node,
3995
+ dataitem: props.dataitem,
3996
+ session: props.session,
3708
3997
  apiBaseUrl: props.apiBaseUrl,
3709
- session: props.session
3998
+ routeParameters: props.routeParameters
3710
3999
  }
3711
- );
4000
+ ) }, index);
4001
+ }) });
4002
+ }
4003
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: " " + formatClasses, children: [
4004
+ hasChildren && props.node.children.map((node, index) => {
4005
+ const SelectedNode = NodeTypes2[node.type];
4006
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react37.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
4007
+ SelectedNode,
4008
+ {
4009
+ node,
4010
+ dataitem: props.dataitem,
4011
+ session: props.session,
4012
+ apiBaseUrl: props.apiBaseUrl,
4013
+ routeParameters: props.routeParameters
4014
+ }
4015
+ ) }, index);
4016
+ }),
4017
+ !hasChildren && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "py-1.5 lg:py-2" })
4018
+ ] });
4019
+ };
4020
+ var ParagraphNode_default = ParagraphNode;
4021
+
4022
+ // src/components/pageRenderingEngine/nodes/HeadingNode.tsx
4023
+ var import_react38 = __toESM(require("react"));
4024
+ var import_jsx_runtime51 = require("react/jsx-runtime");
4025
+ var HeadingNode = (props) => {
4026
+ const NodeTypes2 = {
4027
+ ["text"]: TextNode_default,
4028
+ ["link"]: LinkNode_default,
4029
+ ["svg-icon"]: SVGIconNode_default,
4030
+ ["linebreak"]: LineBreakNode_default,
4031
+ ["datafield"]: DatafieldNode_default
4032
+ };
4033
+ const HeadingTag = `${props.node.tag}`;
4034
+ const FormatClass = {
4035
+ "center": "text-center"
4036
+ };
4037
+ {
4038
+ }
4039
+ const formatClasses = FormatClass[props.node.format] || "";
4040
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: import_react38.default.createElement(
4041
+ HeadingTag,
4042
+ { className: formatClasses },
4043
+ props.node.children && props.node.children.map((childNode, index) => {
4044
+ const SelectedNode = NodeTypes2[childNode.type];
4045
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react38.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SelectedNode, { node: childNode, dataitem: props.dataitem, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
4046
+ })
4047
+ ) });
4048
+ };
4049
+ var HeadingNode_default = HeadingNode;
4050
+
4051
+ // src/components/pageRenderingEngine/nodes/ListNode.tsx
4052
+ var import_react40 = __toESM(require("react"));
4053
+
4054
+ // src/components/pageRenderingEngine/nodes/ListItemNode.tsx
4055
+ var import_react39 = __toESM(require("react"));
4056
+ var import_jsx_runtime52 = require("react/jsx-runtime");
4057
+ var ListItemNode = (props) => {
4058
+ const NodeTypes2 = {
4059
+ text: TextNode_default,
4060
+ linebreak: LineBreakNode_default,
4061
+ link: LinkNode_default,
4062
+ list: ListNode_default
4063
+ };
4064
+ let foundFirstBreak = false;
4065
+ const firstTextChild = props.node.children?.find((c) => c.type === "text");
4066
+ let liStyle = {};
4067
+ if (firstTextChild?.style) {
4068
+ const match = firstTextChild.style.match(/font-size\s*:\s*([^;]+);?/);
4069
+ if (match) {
4070
+ liStyle.fontSize = match[1].trim();
4071
+ }
4072
+ }
4073
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("li", { style: liStyle, children: props.node.children && props.node.children.map((node, index) => {
4074
+ const SelectedNode = NodeTypes2[node.type];
4075
+ if (node.type === "linebreak") {
4076
+ if (!foundFirstBreak) {
4077
+ foundFirstBreak = true;
4078
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", {}, index);
4079
+ } else {
4080
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "py-1 lg:py-2" }, index);
4081
+ }
3712
4082
  } else {
3713
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react42.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
3714
- "img",
4083
+ foundFirstBreak = false;
4084
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react39.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
4085
+ }
4086
+ }) });
4087
+ };
4088
+ var ListItemNode_default = ListItemNode;
4089
+
4090
+ // src/components/pageRenderingEngine/nodes/ListNode.tsx
4091
+ var import_jsx_runtime53 = require("react/jsx-runtime");
4092
+ var ListNode = (props) => {
4093
+ const NodeTypes2 = {
4094
+ listitem: ListItemNode_default
4095
+ };
4096
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_react40.default.Fragment, { children: [
4097
+ props.node.listType == "bullet" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("ul", { children: props.node.children && props.node.children.map((node, index) => {
4098
+ const SelectedNode = NodeTypes2[node.type];
4099
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react40.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
4100
+ }) }),
4101
+ props.node.listType == "number" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("ol", { children: props.node.children && props.node.children.map((node, index) => {
4102
+ const SelectedNode = NodeTypes2[node.type];
4103
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react40.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
4104
+ }) })
4105
+ ] });
4106
+ };
4107
+ var ListNode_default = ListNode;
4108
+
4109
+ // src/components/pageRenderingEngine/nodes/QuoteNode.tsx
4110
+ var import_react41 = __toESM(require("react"));
4111
+ var import_jsx_runtime54 = require("react/jsx-runtime");
4112
+ var QuoteNode = (props) => {
4113
+ const NodeTypes2 = {
4114
+ ["text"]: TextNode_default,
4115
+ ["linebreak"]: LineBreakNode_default,
4116
+ ["link"]: LinkNode_default
4117
+ };
4118
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
4119
+ const SelectedNode = NodeTypes2[node.type];
4120
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react41.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
4121
+ }) });
4122
+ };
4123
+ var QuoteNode_default = QuoteNode;
4124
+
4125
+ // src/components/pageRenderingEngine/nodes/CodeNode.tsx
4126
+ var import_react43 = __toESM(require("react"));
4127
+ var import_dynamic2 = __toESM(require("next/dynamic"));
4128
+ var import_jsx_runtime56 = require("react/jsx-runtime");
4129
+ var CopyButton2 = (0, import_dynamic2.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
4130
+ ssr: false,
4131
+ // optional: fallback UI while loading
4132
+ loading: () => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
4133
+ });
4134
+ var CodeNode = (props) => {
4135
+ const NodeTypes2 = {
4136
+ text: TextNode_default,
4137
+ linebreak: LineBreakNode_default,
4138
+ link: LinkNode_default
4139
+ };
4140
+ const textContent = props.node?.children?.map((node) => {
4141
+ if (node.type === "text") return node.text || "";
4142
+ if (node.type === "linebreak") return "\n";
4143
+ if (node.type === "link") return node.text || node.url || "";
4144
+ return "";
4145
+ }).join("") ?? "";
4146
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
4147
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center relative bg-neutral-strong px-4 py-3 text-xs font-sans justify-between rounded-t-md ", children: [
4148
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { children: "Code Snippet" }),
4149
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(CopyButton2, { text: textContent })
4150
+ ] }),
4151
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "bg-neutral-soft p-4 text-sm whitespace-pre-wrap border border-2 block", children: props.node.children && props.node.children.map((node, index) => {
4152
+ const SelectedNode = NodeTypes2[node.type];
4153
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react43.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
4154
+ SelectedNode,
3715
4155
  {
3716
- style: styles,
3717
- loading: "lazy",
3718
- className: "object-cover",
3719
- src: imageUrl,
3720
- width: props.node.intrinsicWidth,
3721
- alt: props.node.title,
3722
- height: props.node.intrinsicHeight
4156
+ node,
4157
+ session: props.session,
4158
+ apiBaseUrl: props.apiBaseUrl,
4159
+ routeParameters: props.routeParameters
3723
4160
  }
3724
- ) });
3725
- }
3726
- };
3727
- if (props.node.width) {
3728
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
3729
- }
3730
- return renderMedia();
4161
+ ) }, index);
4162
+ }) })
4163
+ ] });
3731
4164
  };
3732
- var ImageNode_default = ImageNode;
4165
+ var CodeNode_default = CodeNode;
3733
4166
 
3734
- // src/components/pageRenderingEngine/nodes/WidgetNode.tsx
4167
+ // src/components/pageRenderingEngine/nodes/HorizontalRuleNode.tsx
3735
4168
  var import_jsx_runtime57 = require("react/jsx-runtime");
4169
+ var HorizontalRuleNode = () => {
4170
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("hr", {});
4171
+ };
4172
+ var HorizontalRuleNode_default = HorizontalRuleNode;
4173
+
4174
+ // src/components/pageRenderingEngine/nodes/WidgetNode.tsx
4175
+ var import_jsx_runtime58 = require("react/jsx-runtime");
3736
4176
  var WidgetNode = (props) => {
3737
4177
  const getWidgetParameters = () => {
3738
4178
  const widgetInputParameters = {
@@ -3789,14 +4229,14 @@ var WidgetNode = (props) => {
3789
4229
  };
3790
4230
  const widgetCode = props.node?.widgetCode;
3791
4231
  if (!widgetCode) {
3792
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_jsx_runtime57.Fragment, { children: "Invalid widget" });
4232
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_jsx_runtime58.Fragment, { children: "Invalid widget" });
3793
4233
  }
3794
4234
  const SelectedWidget = getWidget(widgetCode);
3795
4235
  if (!SelectedWidget) {
3796
4236
  if (process.env.NODE_ENV !== "production") {
3797
4237
  console.warn("Widget not found:", widgetCode);
3798
4238
  }
3799
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
4239
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
3800
4240
  "Widget not found: ",
3801
4241
  widgetCode
3802
4242
  ] });
@@ -3804,7 +4244,7 @@ var WidgetNode = (props) => {
3804
4244
  const widgetParams = getWidgetParameters();
3805
4245
  return (
3806
4246
  // eslint-disable-next-line react-hooks/static-components
3807
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
4247
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
3808
4248
  SelectedWidget,
3809
4249
  {
3810
4250
  params: widgetParams,
@@ -3820,12 +4260,12 @@ var WidgetNode = (props) => {
3820
4260
  var WidgetNode_default = WidgetNode;
3821
4261
 
3822
4262
  // src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
3823
- var import_react43 = __toESM(require("react"));
4263
+ var import_react44 = __toESM(require("react"));
3824
4264
 
3825
4265
  // src/components/pageRenderingEngine/nodes/InputControlNode.tsx
3826
- var import_jsx_runtime58 = require("react/jsx-runtime");
4266
+ var import_jsx_runtime59 = require("react/jsx-runtime");
3827
4267
  var InputControlNode = (props) => {
3828
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
4268
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
3829
4269
  InputControl_default,
3830
4270
  {
3831
4271
  name: props.node.name,
@@ -3853,228 +4293,23 @@ var InputControlNode = (props) => {
3853
4293
  };
3854
4294
  var InputControlNode_default = InputControlNode;
3855
4295
 
3856
- // src/clients/CacheManage.tsx
3857
- var import_node_cache = __toESM(require("node-cache"));
3858
- var CacheManager = class _CacheManager {
3859
- constructor() {
3860
- this.maxCacheSize = 1e3;
3861
- this.cache = new import_node_cache.default({ stdTTL: 0, checkperiod: 300 });
3862
- }
3863
- static getInstance() {
3864
- if (!_CacheManager.instance) {
3865
- _CacheManager.instance = new _CacheManager();
3866
- }
3867
- return _CacheManager.instance;
3868
- }
3869
- get(key) {
3870
- return null;
3871
- }
3872
- set(key, data, ttl) {
3873
- }
3874
- clear() {
3875
- this.cache.flushAll();
3876
- }
3877
- size() {
3878
- return this.cache.keys().length;
3879
- }
3880
- destroy() {
3881
- this.cache.close();
3882
- }
3883
- };
3884
-
3885
- // src/clients/ServiceClient.tsx
3886
- var ServerApiError = class extends Error {
3887
- constructor(data, status) {
3888
- super(data.message || "---");
3889
- this.status = status;
3890
- this.data = data;
3891
- this.data.isSuccessful = false;
3892
- }
3893
- };
3894
- var ServiceClient = class {
3895
- constructor(apiBaseUrl, session) {
3896
- this.cacheManager = CacheManager.getInstance();
3897
- this.baseUrl = apiBaseUrl;
3898
- this.session = session;
3899
- }
3900
- buildFullPath(path, params) {
3901
- let updatedPath = path;
3902
- if (params) {
3903
- Object.keys(params).forEach((key) => {
3904
- updatedPath = updatedPath.replace(
3905
- `{${key}}`,
3906
- String(params[key])
3907
- );
3908
- });
3909
- }
3910
- return this.baseUrl + updatedPath;
3911
- }
3912
- getConfig() {
3913
- const config = { headers: {} };
3914
- if (this.session) {
3915
- if (this.session.oAuthToken) {
3916
- config.headers["Authorization"] = "Bearer " + this.session.oAuthToken;
3917
- }
3918
- config.headers["cid"] = this.session.cid || "";
3919
- config.headers["UserCurrencyCode"] = this.session.userCurrencyCode || "INR";
3920
- config.headers["MarketCode"] = this.session?.marketCode || "IND";
3921
- }
3922
- return config;
3923
- }
3924
- handleFetchError(error) {
3925
- console.log(error);
3926
- const serverApiError = error;
3927
- if (serverApiError) {
3928
- return serverApiError.data;
3929
- }
3930
- return {
3931
- message: "There is some error. Please try after sometime.",
3932
- isSuccessful: false
3933
- };
3934
- }
3935
- async fetchJsonWithCache(fullPath, config) {
3936
- const cacheKey = fullPath + "--" + (this.session?.marketCode || "IND");
3937
- const cachedData = this.cacheManager.get(cacheKey);
3938
- if (cachedData) {
3939
- return cachedData;
3940
- }
3941
- console.log("*****************CALLING API:", cacheKey, (/* @__PURE__ */ new Date()).toISOString());
3942
- const response = await fetch(fullPath, { headers: config.headers });
3943
- if (!response.ok) {
3944
- const apiErrorData = await response.json();
3945
- throw new ServerApiError(apiErrorData, response.status);
3946
- }
3947
- const cacheControl = response.headers.get("Cache-Control");
3948
- let revalidate = null;
3949
- if (cacheControl) {
3950
- const maxAgeMatch = cacheControl.match(/max-age=(\d+)/);
3951
- if (maxAgeMatch && maxAgeMatch[1]) {
3952
- const maxAge = parseInt(maxAgeMatch[1], 10);
3953
- revalidate = maxAge * 1e3;
3954
- }
3955
- }
3956
- const data = await response.json();
3957
- data.isSuccessful = true;
3958
- if (revalidate !== null && revalidate > 0) {
3959
- console.log("revalidate............I am caching:" + revalidate);
3960
- this.cacheManager.set(cacheKey, data, revalidate);
3961
- }
3962
- return data;
3963
- }
3964
- // private async refreshToken(): Promise<void> {
3965
- // console.log("*******************calling refresh token***********************");
3966
- // try {
3967
- // const response = await fetch(this.baseUrl + "/auth/storefront/login/refreshToken", {
3968
- // method: 'POST',
3969
- // headers: {
3970
- // 'Content-Type': 'application/json'
3971
- // },
3972
- // body: JSON.stringify({ refreshToken: this.session.refreshToken })
3973
- // });
3974
- // if (!response.ok) {
3975
- // throw new Error("Failed to refresh token");
3976
- // }
3977
- // const responseData = await response.json();
3978
- // this.session.oAuthToken = responseData.result.accessToken;
3979
- // if (typeof window === "undefined") {
3980
- // // Running on the server
3981
- // } else {
3982
- // await fetch("/api/login", {
3983
- // method: "post",
3984
- // headers: {
3985
- // "Content-Type": "application/json",
3986
- // },
3987
- // body: JSON.stringify({ session: this.session }),
3988
- // });
3989
- // }
3990
- // } catch (error: any) {
3991
- // throw new Error("Failed to refresh token");
3992
- // }
3993
- // }
3994
- async handleRequest(request) {
3995
- try {
3996
- return await request();
3997
- } catch (error) {
3998
- throw error;
3999
- }
4000
- }
4001
- async post(path, data) {
4002
- const request = async () => {
4003
- const fullPath = this.baseUrl + path;
4004
- const config = this.getConfig();
4005
- const response = await fetch(fullPath, {
4006
- method: "POST",
4007
- headers: {
4008
- ...config.headers,
4009
- "Content-Type": "application/json"
4010
- },
4011
- body: JSON.stringify(data)
4012
- });
4013
- if (!response.ok) {
4014
- const apiErrorData = await response.json();
4015
- throw new ServerApiError(apiErrorData, response.status);
4016
- }
4017
- const responseData = await response.json();
4018
- responseData.isSuccessful = true;
4019
- return responseData;
4020
- };
4021
- try {
4022
- return await this.handleRequest(request);
4023
- } catch (error) {
4024
- return this.handleFetchError(error);
4025
- }
4026
- }
4027
- async getSingle(path, params) {
4028
- const request = async () => {
4029
- const sanitizedParams = params ? Object.fromEntries(
4030
- Object.entries(params).map(([k, v]) => [k, String(v)])
4031
- ) : void 0;
4032
- const fullPath = this.buildFullPath(path, sanitizedParams);
4033
- const config = this.getConfig();
4034
- return await this.fetchJsonWithCache(fullPath, config);
4035
- };
4036
- try {
4037
- return await this.handleRequest(request);
4038
- } catch (error) {
4039
- return this.handleFetchError(error);
4040
- }
4041
- }
4042
- async get(path, params) {
4043
- const request = async () => {
4044
- const sanitizedParams = params ? Object.fromEntries(
4045
- Object.entries(params).map(([k, v]) => [k, String(v)])
4046
- ) : void 0;
4047
- const fullPath = this.buildFullPath(path, sanitizedParams);
4048
- const config = this.getConfig();
4049
- console.log(fullPath);
4050
- return await this.fetchJsonWithCache(fullPath, config);
4051
- };
4052
- try {
4053
- return await this.handleRequest(request);
4054
- } catch (error) {
4055
- return this.handleFetchError(error);
4056
- }
4057
- }
4058
- };
4059
- var ServiceClient_default = ServiceClient;
4060
-
4061
4296
  // src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
4062
- var import_jsx_runtime59 = require("react/jsx-runtime");
4297
+ var import_jsx_runtime60 = require("react/jsx-runtime");
4063
4298
  var FormContainerNode = (props) => {
4064
4299
  const NodeTypes2 = {
4065
4300
  ["input-control"]: InputControlNode_default
4066
4301
  };
4067
4302
  const { node } = props;
4068
- const formRef = (0, import_react43.useRef)(null);
4303
+ const formRef = (0, import_react44.useRef)(null);
4069
4304
  const initialState = {
4070
4305
  inputValues: {},
4071
4306
  lastPropertyChanged: ""
4072
4307
  };
4073
- const [formState, dispatch] = (0, import_react43.useReducer)(FormReducer_default, initialState);
4074
- const handleInputChange = (0, import_react43.useCallback)((updatedValues) => {
4308
+ const [formState, dispatch] = (0, import_react44.useReducer)(FormReducer_default, initialState);
4309
+ const handleInputChange = (0, import_react44.useCallback)((updatedValues) => {
4075
4310
  dispatch({ type: FORM_INPUT_UPDATE, name: updatedValues.name, value: updatedValues.value });
4076
4311
  }, [dispatch]);
4077
- (0, import_react43.useEffect)(() => {
4312
+ (0, import_react44.useEffect)(() => {
4078
4313
  const fetchInitialData = async () => {
4079
4314
  const client = new ServiceClient_default(props.apiBaseUrl, props.session);
4080
4315
  const response = await client.getSingle(props.node.dataFetchApi, props.routeParameters);
@@ -4089,12 +4324,12 @@ var FormContainerNode = (props) => {
4089
4324
  };
4090
4325
  fetchInitialData();
4091
4326
  }, [props.apiBaseUrl, props.node, props.session, props.routeParameters]);
4092
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("form", { className: "group space-y-6 pb-6 overflow-y-auto", noValidate: true, ref: formRef, children: [
4327
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("form", { className: "group space-y-6 pb-6 overflow-y-auto", noValidate: true, ref: formRef, children: [
4093
4328
  node.children && node.children.map((node2, index) => {
4094
4329
  {
4095
4330
  }
4096
4331
  const SelectedNode = NodeTypes2[node2.type];
4097
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react43.default.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
4332
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react44.default.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
4098
4333
  InputControlNode_default,
4099
4334
  {
4100
4335
  value: formState.inputValues[node2.name],
@@ -4103,17 +4338,17 @@ var FormContainerNode = (props) => {
4103
4338
  }
4104
4339
  ) }, index);
4105
4340
  }),
4106
- node.children.length == 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "py-0.5 lg:py-1.5" })
4341
+ node.children.length == 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "py-0.5 lg:py-1.5" })
4107
4342
  ] });
4108
4343
  };
4109
4344
  var FormContainerNode_default = FormContainerNode;
4110
4345
 
4111
4346
  // src/components/pageRenderingEngine/nodes/DivContainer.tsx
4112
- var import_react48 = __toESM(require("react"));
4347
+ var import_react49 = __toESM(require("react"));
4113
4348
 
4114
4349
  // src/components/pageRenderingEngine/nodes/EmbedNode.tsx
4115
4350
  var import_dynamic3 = __toESM(require("next/dynamic"));
4116
- var import_jsx_runtime62 = require("react/jsx-runtime");
4351
+ var import_jsx_runtime63 = require("react/jsx-runtime");
4117
4352
  var IframeClient2 = (0, import_dynamic3.default)(() => Promise.resolve().then(() => (init_IframeClient(), IframeClient_exports)), {
4118
4353
  ssr: false
4119
4354
  });
@@ -4126,13 +4361,13 @@ var EmbedNode = (props) => {
4126
4361
  } else {
4127
4362
  src = props.node.embedSrc;
4128
4363
  }
4129
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "aspect-video", children: src && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(IframeClient2, { src }) });
4364
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "aspect-video", children: src && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(IframeClient2, { src }) });
4130
4365
  };
4131
4366
  var EmbedNode_default = EmbedNode;
4132
4367
 
4133
4368
  // src/components/Slider.tsx
4134
- var import_react46 = __toESM(require("react"));
4135
- var import_jsx_runtime63 = require("react/jsx-runtime");
4369
+ var import_react47 = __toESM(require("react"));
4370
+ var import_jsx_runtime64 = require("react/jsx-runtime");
4136
4371
  var Slider = ({
4137
4372
  children,
4138
4373
  slidesToShow = 4,
@@ -4150,13 +4385,13 @@ var Slider = ({
4150
4385
  pillStyle = "cumulative",
4151
4386
  progressPosition = "bottom"
4152
4387
  }) => {
4153
- const [currentSlide, setCurrentSlide] = (0, import_react46.useState)(0);
4154
- const [transition, setTransition] = (0, import_react46.useState)(true);
4155
- const [slidesToShowState, setSlidesToShowState] = (0, import_react46.useState)(
4388
+ const [currentSlide, setCurrentSlide] = (0, import_react47.useState)(0);
4389
+ const [transition, setTransition] = (0, import_react47.useState)(true);
4390
+ const [slidesToShowState, setSlidesToShowState] = (0, import_react47.useState)(
4156
4391
  typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
4157
4392
  );
4158
- const [isPlaying, setIsPlaying] = (0, import_react46.useState)(autoplay);
4159
- (0, import_react46.useEffect)(() => {
4393
+ const [isPlaying, setIsPlaying] = (0, import_react47.useState)(autoplay);
4394
+ (0, import_react47.useEffect)(() => {
4160
4395
  if (typeof slidesToShow === "number") return;
4161
4396
  const handleResize = () => {
4162
4397
  if (window.innerWidth >= 1024) {
@@ -4171,7 +4406,7 @@ var Slider = ({
4171
4406
  window.addEventListener("resize", handleResize);
4172
4407
  return () => window.removeEventListener("resize", handleResize);
4173
4408
  }, [slidesToShow]);
4174
- (0, import_react46.useEffect)(() => {
4409
+ (0, import_react47.useEffect)(() => {
4175
4410
  if (!autoplay) return;
4176
4411
  const timer = setInterval(() => {
4177
4412
  if (isPlaying) {
@@ -4180,7 +4415,7 @@ var Slider = ({
4180
4415
  }, autoplay_speed);
4181
4416
  return () => clearInterval(timer);
4182
4417
  }, [autoplay, autoplay_speed, currentSlide, isPlaying]);
4183
- const totalSlides = import_react46.Children.count(children);
4418
+ const totalSlides = import_react47.Children.count(children);
4184
4419
  const maxSlide = totalSlides - slidesToShowState;
4185
4420
  const nextSlide = () => {
4186
4421
  if (currentSlide >= maxSlide) {
@@ -4225,16 +4460,16 @@ var Slider = ({
4225
4460
  }
4226
4461
  };
4227
4462
  const translateX = -currentSlide * (100 / slidesToShowState);
4228
- const slides = import_react46.Children.map(children, (child, index) => {
4229
- if (!import_react46.default.isValidElement(child)) return null;
4463
+ const slides = import_react47.Children.map(children, (child, index) => {
4464
+ if (!import_react47.default.isValidElement(child)) return null;
4230
4465
  const childProps = child.props;
4231
4466
  const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
4232
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4467
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4233
4468
  "div",
4234
4469
  {
4235
4470
  className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
4236
4471
  style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
4237
- children: (0, import_react46.cloneElement)(child, {
4472
+ children: (0, import_react47.cloneElement)(child, {
4238
4473
  className: mergedClassName
4239
4474
  })
4240
4475
  },
@@ -4252,14 +4487,14 @@ var Slider = ({
4252
4487
  return "bottom-4";
4253
4488
  }
4254
4489
  };
4255
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
4490
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
4256
4491
  "div",
4257
4492
  {
4258
4493
  className: `relative w-full overflow-hidden ${className}`,
4259
4494
  onMouseEnter: handleMouseEnter,
4260
4495
  onMouseLeave: handleMouseLeave,
4261
4496
  children: [
4262
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4497
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4263
4498
  "div",
4264
4499
  {
4265
4500
  className: "flex h-full",
@@ -4270,18 +4505,18 @@ var Slider = ({
4270
4505
  children: slides
4271
4506
  }
4272
4507
  ),
4273
- show_arrows && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
4274
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4508
+ show_arrows && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
4509
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4275
4510
  ArrowButton,
4276
4511
  {
4277
4512
  direction: "left",
4278
4513
  onClick: prevSlide,
4279
4514
  visible: infinite_scroll || currentSlide > 0,
4280
4515
  className: arrowClassName,
4281
- children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5 8.25 12l7.5-7.5" }) })
4516
+ children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5 8.25 12l7.5-7.5" }) })
4282
4517
  }
4283
4518
  ),
4284
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
4519
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
4285
4520
  ArrowButton,
4286
4521
  {
4287
4522
  direction: "right",
@@ -4289,13 +4524,13 @@ var Slider = ({
4289
4524
  visible: infinite_scroll || currentSlide < maxSlide,
4290
4525
  className: arrowClassName,
4291
4526
  children: [
4292
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5" }) }),
4527
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5" }) }),
4293
4528
  " "
4294
4529
  ]
4295
4530
  }
4296
4531
  )
4297
4532
  ] }),
4298
- show_dots && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: `absolute left-1/2 -translate-x-1/2 flex justify-center space-x-1.5 ${getProgressPositionClass()}`, children: Array.from({ length: totalSlides }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4533
+ show_dots && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: `absolute left-1/2 -translate-x-1/2 flex justify-center space-x-1.5 ${getProgressPositionClass()}`, children: Array.from({ length: totalSlides }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4299
4534
  ProgressPill,
4300
4535
  {
4301
4536
  active: index === currentSlide,
@@ -4321,7 +4556,7 @@ var ArrowButton = ({
4321
4556
  visible,
4322
4557
  children,
4323
4558
  className = ""
4324
- }) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4559
+ }) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4325
4560
  "button",
4326
4561
  {
4327
4562
  className: `
@@ -4347,13 +4582,13 @@ var ProgressPill = ({
4347
4582
  currentSlide,
4348
4583
  totalSlides
4349
4584
  }) => {
4350
- const [progress, setProgress] = (0, import_react46.useState)(0);
4351
- (0, import_react46.useEffect)(() => {
4585
+ const [progress, setProgress] = (0, import_react47.useState)(0);
4586
+ (0, import_react47.useEffect)(() => {
4352
4587
  if (active) {
4353
4588
  setProgress(0);
4354
4589
  }
4355
4590
  }, [active, index]);
4356
- (0, import_react46.useEffect)(() => {
4591
+ (0, import_react47.useEffect)(() => {
4357
4592
  if (!active || !isPlaying) {
4358
4593
  if (!active) {
4359
4594
  setProgress(0);
@@ -4408,7 +4643,7 @@ var ProgressPill = ({
4408
4643
  const renderProgressBar = () => {
4409
4644
  if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
4410
4645
  const displayProgress = style === "cumulative" && isFilled ? 100 : progress;
4411
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4646
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4412
4647
  "div",
4413
4648
  {
4414
4649
  className: `absolute top-0 left-0 h-full rounded-full ${style === "cumulative" && isFilled ? activeClassName || "bg-white" : activeClassName || "bg-white"} transition-all duration-50 ease-linear`,
@@ -4420,7 +4655,7 @@ var ProgressPill = ({
4420
4655
  };
4421
4656
  const renderCumulativeFill = () => {
4422
4657
  if (style === "cumulative" && isFilled && !isActive) {
4423
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4658
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4424
4659
  "div",
4425
4660
  {
4426
4661
  className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-300`,
@@ -4430,7 +4665,7 @@ var ProgressPill = ({
4430
4665
  }
4431
4666
  return null;
4432
4667
  };
4433
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
4668
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
4434
4669
  "button",
4435
4670
  {
4436
4671
  className: `${baseClasses} ${getStyleClasses()}`,
@@ -4606,10 +4841,10 @@ var PathUtility = class {
4606
4841
  var PathUtility_default = new PathUtility();
4607
4842
 
4608
4843
  // src/components/NoDataFound.tsx
4609
- var import_jsx_runtime64 = require("react/jsx-runtime");
4844
+ var import_jsx_runtime65 = require("react/jsx-runtime");
4610
4845
  var NoDataFound = () => {
4611
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center bg-neutral-weak", children: [
4612
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "mx-auto w-20 h-20 rounded-full flex items-center justify-center bg-neutral-soft", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4846
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center bg-neutral-weak", children: [
4847
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mx-auto w-20 h-20 rounded-full flex items-center justify-center bg-neutral-soft", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
4613
4848
  "svg",
4614
4849
  {
4615
4850
  className: "w-10 h-10",
@@ -4617,7 +4852,7 @@ var NoDataFound = () => {
4617
4852
  stroke: "currentColor",
4618
4853
  viewBox: "0 0 24 24",
4619
4854
  xmlns: "http://www.w3.org/2000/svg",
4620
- children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4855
+ children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
4621
4856
  "path",
4622
4857
  {
4623
4858
  strokeLinecap: "round",
@@ -4628,18 +4863,18 @@ var NoDataFound = () => {
4628
4863
  )
4629
4864
  }
4630
4865
  ) }) }),
4631
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("h3", { className: "text-lg font-medium mb-2", children: "No data available" }),
4632
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: " max-w-sm mb-0", children: "No records found. Data may be empty or not available at the moment." })
4866
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h3", { className: "text-lg font-medium mb-2", children: "No data available" }),
4867
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: " max-w-sm mb-0", children: "No records found. Data may be empty or not available at the moment." })
4633
4868
  ] });
4634
4869
  };
4635
4870
  var NoDataFound_default = NoDataFound;
4636
4871
 
4637
4872
  // src/components/Pagination.tsx
4638
- var import_react47 = require("react");
4639
- var import_jsx_runtime65 = require("react/jsx-runtime");
4873
+ var import_react48 = require("react");
4874
+ var import_jsx_runtime66 = require("react/jsx-runtime");
4640
4875
  var Pagination = (props) => {
4641
4876
  const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
4642
- const builder = (0, import_react47.useMemo)(() => {
4877
+ const builder = (0, import_react48.useMemo)(() => {
4643
4878
  const b = new OdataBuilder(path);
4644
4879
  if (query) b.setQuery(query);
4645
4880
  return b;
@@ -4680,7 +4915,7 @@ var Pagination = (props) => {
4680
4915
  return range;
4681
4916
  };
4682
4917
  const paginationRange = getPaginationRange();
4683
- const PageButton = ({ page, children }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
4918
+ const PageButton = ({ page, children }) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
4684
4919
  Hyperlink,
4685
4920
  {
4686
4921
  linkType: "Link" /* Link */,
@@ -4695,9 +4930,9 @@ var Pagination = (props) => {
4695
4930
  );
4696
4931
  const NavigationButton = ({ page, disabled, children }) => {
4697
4932
  if (disabled) {
4698
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border bg-neutral-base cursor-not-allowed", children });
4933
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border bg-neutral-base cursor-not-allowed", children });
4699
4934
  }
4700
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
4935
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
4701
4936
  Hyperlink,
4702
4937
  {
4703
4938
  className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border transition-colors duration-150",
@@ -4707,35 +4942,35 @@ var Pagination = (props) => {
4707
4942
  );
4708
4943
  };
4709
4944
  if (totalPages <= 1 && totalItems === 0) return null;
4710
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "py-6 border-t bg-default", children: [
4711
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-4", children: [
4712
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "text-sm", children: [
4945
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "py-6 border-t bg-default", children: [
4946
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-4", children: [
4947
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "text-sm", children: [
4713
4948
  "Showing ",
4714
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("span", { className: "font-semibold", children: [
4949
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("span", { className: "font-semibold", children: [
4715
4950
  startItem,
4716
4951
  "-",
4717
4952
  endItem
4718
4953
  ] }),
4719
4954
  " ",
4720
4955
  "out of ",
4721
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
4956
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
4722
4957
  " results"
4723
4958
  ] }),
4724
- totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center space-x-1", children: [
4725
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
4959
+ totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center space-x-1", children: [
4960
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
4726
4961
  NavigationButton,
4727
4962
  {
4728
4963
  page: activePageNumber - 1,
4729
4964
  disabled: activePageNumber === 1,
4730
4965
  children: [
4731
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 mr-1" }) }),
4732
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Prev" })
4966
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 mr-1" }) }),
4967
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm", children: "Prev" })
4733
4968
  ]
4734
4969
  }
4735
4970
  ),
4736
4971
  paginationRange.map((item, index) => {
4737
4972
  if (item === "...") {
4738
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
4973
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
4739
4974
  "span",
4740
4975
  {
4741
4976
  className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center text-gray-500",
@@ -4745,23 +4980,23 @@ var Pagination = (props) => {
4745
4980
  );
4746
4981
  }
4747
4982
  const page = item;
4748
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(PageButton, { page, children: page }, page);
4983
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(PageButton, { page, children: page }, page);
4749
4984
  }),
4750
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
4985
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
4751
4986
  NavigationButton,
4752
4987
  {
4753
4988
  page: activePageNumber + 1,
4754
4989
  disabled: activePageNumber === totalPages,
4755
4990
  children: [
4756
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Next" }),
4757
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Icon_default, { name: "chevronRight", className: "w-4 h-4 ml-1" }) })
4991
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm", children: "Next" }),
4992
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Icon_default, { name: "chevronRight", className: "w-4 h-4 ml-1" }) })
4758
4993
  ]
4759
4994
  }
4760
4995
  )
4761
4996
  ] }),
4762
- showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center space-x-2", children: [
4763
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Go to:" }),
4764
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
4997
+ showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center space-x-2", children: [
4998
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm", children: "Go to:" }),
4999
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
4765
5000
  "input",
4766
5001
  {
4767
5002
  type: "number",
@@ -4782,9 +5017,9 @@ var Pagination = (props) => {
4782
5017
  ) })
4783
5018
  ] })
4784
5019
  ] }),
4785
- showPageSizeSelector && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mt-4 pt-4 border-t bg-default", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center justify-center space-x-2", children: [
4786
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "Show:" }),
4787
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex space-x-1", children: [10, 25, 50, 100].map((size) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
5020
+ showPageSizeSelector && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mt-4 pt-4 border-t bg-default", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center justify-center space-x-2", children: [
5021
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm", children: "Show:" }),
5022
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex space-x-1", children: [10, 25, 50, 100].map((size) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
4788
5023
  Hyperlink,
4789
5024
  {
4790
5025
  className: `
@@ -4796,7 +5031,7 @@ var Pagination = (props) => {
4796
5031
  },
4797
5032
  size
4798
5033
  )) }),
4799
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm", children: "per page" })
5034
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm", children: "per page" })
4800
5035
  ] }) })
4801
5036
  ] });
4802
5037
  };
@@ -4804,7 +5039,7 @@ var Pagination_default = Pagination;
4804
5039
 
4805
5040
  // src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
4806
5041
  var import_dynamic4 = __toESM(require("next/dynamic"));
4807
- var import_jsx_runtime66 = require("react/jsx-runtime");
5042
+ var import_jsx_runtime67 = require("react/jsx-runtime");
4808
5043
  var HlsPlayer1 = (0, import_dynamic4.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), {
4809
5044
  ssr: false
4810
5045
  });
@@ -4841,7 +5076,7 @@ var ImageGalleryNode = (props) => {
4841
5076
  right: "justify-end"
4842
5077
  };
4843
5078
  const formatClasses = FormatClass[props.node.format || ""] || "";
4844
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: `flex flex-wrap gap-4 ${formatClasses}`, children: visibleImages.map((img, idx) => {
5079
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: `flex flex-wrap gap-4 ${formatClasses}`, children: visibleImages.map((img, idx) => {
4845
5080
  const imageUrl = resolveImageUrl(img.imageUrl);
4846
5081
  if (!imageUrl) return null;
4847
5082
  const posterUrl = resolvePosterUrl(img.posterUrl);
@@ -4849,7 +5084,7 @@ var ImageGalleryNode = (props) => {
4849
5084
  const intrinsicHeight = parseMaybeNumber(img.intrinsicHeight);
4850
5085
  const isHls = imageUrl.endsWith(".m3u8");
4851
5086
  const alt = img.title || "Gallery image";
4852
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "max-w-full", children: isHls ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5087
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "max-w-full", children: isHls ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
4853
5088
  HlsPlayer1,
4854
5089
  {
4855
5090
  assetUrl: imageUrl,
@@ -4864,7 +5099,7 @@ var ImageGalleryNode = (props) => {
4864
5099
  }
4865
5100
  ) : (
4866
5101
  /* eslint-disable-next-line @next/next/no-img-element */
4867
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5102
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
4868
5103
  "img",
4869
5104
  {
4870
5105
  loading: "lazy",
@@ -4881,7 +5116,8 @@ var ImageGalleryNode = (props) => {
4881
5116
  var ImageGalleryNode_default = ImageGalleryNode;
4882
5117
 
4883
5118
  // src/components/pageRenderingEngine/nodes/DivContainer.tsx
4884
- var import_jsx_runtime67 = require("react/jsx-runtime");
5119
+ var import_link2 = __toESM(require("next/link"));
5120
+ var import_jsx_runtime68 = require("react/jsx-runtime");
4885
5121
  function toCamelCase(str) {
4886
5122
  return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
4887
5123
  }
@@ -5064,7 +5300,7 @@ var DivContainer = async (props) => {
5064
5300
  response = await serviceClient.get(endpoint);
5065
5301
  result = response?.result;
5066
5302
  if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
5067
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(NoDataFound_default, {});
5303
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(NoDataFound_default, {});
5068
5304
  }
5069
5305
  if (dataBindingProperties.childCollectionName && props.dataitem) {
5070
5306
  childCollectionData = getNestedValue2(props.dataitem, dataBindingProperties.childCollectionName);
@@ -5076,7 +5312,7 @@ var DivContainer = async (props) => {
5076
5312
  }
5077
5313
  const SelectedNode = NodeTypes2[node.type];
5078
5314
  if (!SelectedNode) return null;
5079
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react48.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
5315
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5080
5316
  SelectedNode,
5081
5317
  {
5082
5318
  node,
@@ -5144,7 +5380,7 @@ var DivContainer = async (props) => {
5144
5380
  wrapperProps = { ...props.node.componentProperties, "slidesToShow": slidesToShow };
5145
5381
  break;
5146
5382
  case !!(props.node.href || props.href):
5147
- Wrapper = "a";
5383
+ Wrapper = import_link2.default;
5148
5384
  let href = props.node.href || props.href;
5149
5385
  if (href?.includes("{")) {
5150
5386
  href = resolveHrefTemplate(href, props.dataitem);
@@ -5176,9 +5412,9 @@ var DivContainer = async (props) => {
5176
5412
  props.node.autoFormat && "auto-format",
5177
5413
  props.node.bgClass
5178
5414
  ].filter(Boolean).join(" ");
5179
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react48.default.Fragment, { children: [
5180
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
5181
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react48.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
5415
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_react49.default.Fragment, { children: [
5416
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
5417
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5182
5418
  Wrapper,
5183
5419
  {
5184
5420
  id: guid,
@@ -5187,18 +5423,18 @@ var DivContainer = async (props) => {
5187
5423
  ...wrapperProps,
5188
5424
  children: dataToRender.map(
5189
5425
  (item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
5190
- (child, i) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react48.default.Fragment, { children: child }, i)
5426
+ (child, i) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react49.default.Fragment, { children: child }, i)
5191
5427
  ) : renderChildren(props.node.children, props, item, idx)
5192
5428
  )
5193
5429
  }
5194
5430
  ) }),
5195
- dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
5431
+ dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
5196
5432
  ] });
5197
5433
  };
5198
5434
  var DivContainer_default = DivContainer;
5199
5435
 
5200
5436
  // src/components/pageRenderingEngine/PageBodyRenderer.tsx
5201
- var import_jsx_runtime68 = require("react/jsx-runtime");
5437
+ var import_jsx_runtime69 = require("react/jsx-runtime");
5202
5438
  var NodeTypes = {
5203
5439
  ["paragraph"]: ParagraphNode_default,
5204
5440
  ["heading"]: HeadingNode_default,
@@ -5226,11 +5462,11 @@ var PageBodyRenderer = (props) => {
5226
5462
  if (pageBodyTree && pageBodyTree.root) {
5227
5463
  rootNode = pageBodyTree.root;
5228
5464
  }
5229
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react49.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
5465
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react50.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
5230
5466
  {
5231
5467
  }
5232
5468
  const SelectedNode = NodeTypes[node.type];
5233
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react49.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react49.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5469
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react50.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react50.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
5234
5470
  SelectedNode,
5235
5471
  {
5236
5472
  node,
@@ -5245,7 +5481,7 @@ var PageBodyRenderer = (props) => {
5245
5481
  assetBaseUrl: props.assetBaseUrl,
5246
5482
  device: props.device
5247
5483
  }
5248
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5484
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
5249
5485
  SelectedNode,
5250
5486
  {
5251
5487
  node,