pb-sxp-ui 1.20.2 → 1.20.4

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 (45) hide show
  1. package/dist/index.cjs +379 -123
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +379 -123
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +7 -7
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +7 -7
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +379 -123
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +7 -7
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/SxpPageRender/LikeButton/index.js +12 -4
  14. package/es/core/components/SxpPageRender/VideoWidget/index.js +6 -2
  15. package/es/core/components/SxpPageRender/WaterFall/List.js +12 -22
  16. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +6 -4
  17. package/es/core/components/SxpPageRender/WaterFall/index.js +6 -2
  18. package/es/core/components/SxpPageRender/index.js +62 -16
  19. package/es/core/context/SxpDataSourceProvider.d.ts +8 -3
  20. package/es/core/context/SxpDataSourceProvider.js +63 -43
  21. package/es/core/utils/tool.d.ts +2 -1
  22. package/es/core/utils/tool.js +15 -1
  23. package/es/materials/sxp/cta/AniLink/index.js +18 -7
  24. package/es/materials/sxp/cta/AniLinkPopup/index.js +21 -10
  25. package/es/materials/sxp/popup/CommodityDetail/index.js +59 -2
  26. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +60 -3
  27. package/es/materials/sxp/popup/CommodityList/index.js +21 -5
  28. package/es/materials/sxp/template/components/EventProvider.js +22 -10
  29. package/lib/core/components/SxpPageRender/LikeButton/index.js +12 -4
  30. package/lib/core/components/SxpPageRender/VideoWidget/index.js +6 -2
  31. package/lib/core/components/SxpPageRender/WaterFall/List.js +11 -21
  32. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +6 -4
  33. package/lib/core/components/SxpPageRender/WaterFall/index.js +6 -2
  34. package/lib/core/components/SxpPageRender/index.js +62 -16
  35. package/lib/core/context/SxpDataSourceProvider.d.ts +8 -3
  36. package/lib/core/context/SxpDataSourceProvider.js +61 -41
  37. package/lib/core/utils/tool.d.ts +2 -1
  38. package/lib/core/utils/tool.js +16 -1
  39. package/lib/materials/sxp/cta/AniLink/index.js +18 -7
  40. package/lib/materials/sxp/cta/AniLinkPopup/index.js +21 -10
  41. package/lib/materials/sxp/popup/CommodityDetail/index.js +59 -2
  42. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +60 -3
  43. package/lib/materials/sxp/popup/CommodityList/index.js +21 -5
  44. package/lib/materials/sxp/template/components/EventProvider.js +22 -10
  45. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -285,6 +285,20 @@ function deleteCookie(name, path = '/', domain = '') {
285
285
  document.cookie = `${name}=; ${expiration}${pathPart}${domainPart}`;
286
286
  console.log(`已尝试删除Cookie: ${name}`);
287
287
  }
288
+ function getUrlParamByKey(key) {
289
+ var _a, _b;
290
+ const queryString = location.search.slice(1);
291
+ const params = {};
292
+ (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
293
+ const key = val.split('=')[0];
294
+ const value = val.split('=')[1];
295
+ params[key] = value;
296
+ });
297
+ for (const key in params) {
298
+ params[key] = params[key].replace(/%2B/g, '+');
299
+ }
300
+ return (_b = params[key]) !== null && _b !== void 0 ? _b : '';
301
+ }
288
302
 
289
303
  function unzip(b64Data) {
290
304
  const strData = atob(b64Data);
@@ -968,7 +982,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
968
982
  }
969
983
  });
970
984
  };
971
- }, [bffCollectEvent]);
985
+ }, []);
972
986
  useEffect(() => {
973
987
  const originalOpen = XMLHttpRequest.prototype.open;
974
988
  const originalSend = XMLHttpRequest.prototype.send;
@@ -1179,19 +1193,51 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1179
1193
  playbookType,
1180
1194
  bffDataSource
1181
1195
  ]);
1182
- const getEventParamsByJson = useCallback((json, product) => {
1183
- var _a, _b, _c;
1196
+ const getEventParamsByJson = useCallback((_a) => {
1197
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
1198
+ var { json, product = [], rec, contentType = 'post', position, eventName } = _a, props = __rest(_a, ["json", "product", "rec", "contentType", "position", "eventName"]);
1184
1199
  const jsonParams = cloneDeep(json);
1185
1200
  const urlParams = new URLSearchParams(window.location.search);
1186
1201
  const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
1187
1202
  const fix_par = {
1188
- event_source_url: (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href,
1203
+ event_source_url: (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href,
1189
1204
  external_id: fakeUserId,
1190
- client_user_agent: (_c = (_b = window === null || window === void 0 ? void 0 : window.navigator) === null || _b === void 0 ? void 0 : _b.userAgent) !== null && _c !== void 0 ? _c : '',
1205
+ client_user_agent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '',
1191
1206
  fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
1192
1207
  fbp: getCookie('_fbp') ? `${getCookie('_fbp')}` : '',
1193
1208
  time: Math.floor(Date.now() / 1000)
1194
1209
  };
1210
+ let customData = Object.assign({
1211
+ // funnel_type
1212
+ content_ids: [(_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.itemId, ...((_f = product === null || product === void 0 ? void 0 : product.map((item) => item === null || item === void 0 ? void 0 : item.itemId)) !== null && _f !== void 0 ? _f : [])], content_type: contentType, content_name: (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.title, total_posts: rtcList === null || rtcList === void 0 ? void 0 : rtcList.length, position,
1213
+ // content_category
1214
+ currency: (_h = product === null || product === void 0 ? void 0 : product[0]) === null || _h === void 0 ? void 0 : _h.currency, contents: (_j = product === null || product === void 0 ? void 0 : product.map((item) => ({
1215
+ item_id: item === null || item === void 0 ? void 0 : item.itemId,
1216
+ item_price: item === null || item === void 0 ? void 0 : item.price
1217
+ }))) !== null && _j !== void 0 ? _j : [], image_urls: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) !== null && _l !== void 0 ? _l : [], video_urls: (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.url,
1218
+ // prompt
1219
+ headline: getUrlParamByKey('headline'), scene: getUrlParamByKey('scene'), campaign_id: getUrlParamByKey('campaign_id'), ad_id: getUrlParamByKey('ad_id'), utm_source: getUrlParamByKey('utm_source'), utm_medium: getUrlParamByKey('utm_medium'), utm_campaign: getUrlParamByKey('utm_campaign'), utm_content: getUrlParamByKey('utm_content') }, props);
1220
+ if (!((_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.url) && !((_q = (_p = rec === null || rec === void 0 ? void 0 : rec.video) === null || _p === void 0 ? void 0 : _p.imgUrls) === null || _q === void 0 ? void 0 : _q.length) && (rec === null || rec === void 0 ? void 0 : rec.product) && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_r = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _r === void 0 ? void 0 : _r.length) > 0) {
1221
+ const product = rec === null || rec === void 0 ? void 0 : rec.product;
1222
+ const productCustomData = {
1223
+ content_ids: [product === null || product === void 0 ? void 0 : product.itemId],
1224
+ content_type: 'product',
1225
+ content_name: '',
1226
+ contents: [{
1227
+ item_id: product === null || product === void 0 ? void 0 : product.itemId,
1228
+ item_price: product === null || product === void 0 ? void 0 : product.price
1229
+ }],
1230
+ image_urls: (_s = product.homePage) !== null && _s !== void 0 ? _s : []
1231
+ };
1232
+ customData = Object.assign(Object.assign({}, customData), productCustomData);
1233
+ }
1234
+ if (eventName === 'ContentSwipe' || eventName === 'Engagement' || eventName === 'ExitFeed') {
1235
+ const deleteKeys = ['content_ids', 'content_category', 'currency', 'contents', 'image_urls', 'video_urls', 'prompt'];
1236
+ deleteKeys.forEach(key => {
1237
+ if (customData === null || customData === void 0 ? void 0 : customData[key])
1238
+ delete customData[key];
1239
+ });
1240
+ }
1195
1241
  const regex = /\{\{(.*?)\}\}/g;
1196
1242
  const getEventParams = (obj) => {
1197
1243
  if (!obj)
@@ -1204,6 +1250,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1204
1250
  if (Object.prototype.hasOwnProperty.call(obj, key)) {
1205
1251
  const value = obj === null || obj === void 0 ? void 0 : obj[key];
1206
1252
  if (typeof value === 'object') {
1253
+ if (key === 'custom_data') {
1254
+ obj[key] = customData !== null && customData !== void 0 ? customData : {};
1255
+ }
1207
1256
  getEventParams(value);
1208
1257
  }
1209
1258
  else if (typeof value === 'string') {
@@ -1213,7 +1262,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1213
1262
  var _a;
1214
1263
  const prop = match.substring(2, match.length - 2);
1215
1264
  try {
1216
- let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
1265
+ let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product === null || product === void 0 ? void 0 : product[0]);
1217
1266
  if (replaceValue) {
1218
1267
  if ((prop === null || prop === void 0 ? void 0 : prop.indexOf('currency')) !== -1 &&
1219
1268
  (replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.indexOf('-')) !== -1 &&
@@ -1238,15 +1287,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1238
1287
  }
1239
1288
  };
1240
1289
  getEventParams(jsonParams);
1290
+ console.log('capi event params:', jsonParams);
1241
1291
  return jsonParams;
1242
- }, [fakeUserId]);
1243
- const bffFbReport = useCallback(({ eventName, product }) => {
1244
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1292
+ }, [fakeUserId, globalConfig, rtcList]);
1293
+ const bffFbReport = useCallback((_a) => {
1294
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1295
+ var { eventName } = _a, props = __rest(_a, ["eventName"]);
1245
1296
  if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || getTargetingCookie()) {
1246
1297
  return;
1247
1298
  }
1248
1299
  let isPushState = false;
1249
- const pixelEventParamsJson = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.pixel) === null || _a === void 0 ? void 0 : _a[eventName];
1300
+ const pixelEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.pixel) === null || _b === void 0 ? void 0 : _b[eventName];
1250
1301
  if ((pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
1251
1302
  function updateQueryStringParameter(uri, key, value) {
1252
1303
  const re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i');
@@ -1270,39 +1321,39 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1270
1321
  }
1271
1322
  }
1272
1323
  else {
1273
- window === null || window === void 0 ? void 0 : window.fbq('track', pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name, getEventParamsByJson(pixelEventParamsJson, product));
1324
+ window === null || window === void 0 ? void 0 : window.fbq('track', pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name, getEventParamsByJson(Object.assign({ json: pixelEventParamsJson, eventName }, props)));
1274
1325
  }
1275
1326
  }
1276
1327
  if (!isPushState) {
1277
1328
  if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
1278
1329
  window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
1279
1330
  }
1280
- const tiktokPixelEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _b === void 0 ? void 0 : _b[eventName];
1331
+ const tiktokPixelEventParamsJson = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _c === void 0 ? void 0 : _c[eventName];
1281
1332
  if ((tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name) &&
1282
1333
  typeof (window === null || window === void 0 ? void 0 : window.ttq) === 'object' &&
1283
- typeof ((_c = window === null || window === void 0 ? void 0 : window.ttq) === null || _c === void 0 ? void 0 : _c.track) === 'function') {
1284
- (_d = window === null || window === void 0 ? void 0 : window.ttq) === null || _d === void 0 ? void 0 : _d.track(tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name, getEventParamsByJson(tiktokPixelEventParamsJson, product));
1334
+ typeof ((_d = window === null || window === void 0 ? void 0 : window.ttq) === null || _d === void 0 ? void 0 : _d.track) === 'function') {
1335
+ (_e = window === null || window === void 0 ? void 0 : window.ttq) === null || _e === void 0 ? void 0 : _e.track(tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name, getEventParamsByJson(Object.assign({ json: tiktokPixelEventParamsJson, eventName }, props)));
1285
1336
  }
1286
1337
  }
1287
- const snapchatPixelEventParamsJson = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _e === void 0 ? void 0 : _e[eventName];
1338
+ const snapchatPixelEventParamsJson = (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _f === void 0 ? void 0 : _f[eventName];
1288
1339
  if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
1289
- window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, getEventParamsByJson(snapchatPixelEventParamsJson, product));
1340
+ window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, getEventParamsByJson(Object.assign({ json: snapchatPixelEventParamsJson, eventName }, props)));
1290
1341
  }
1291
- if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.Northbeam) === 'object' && typeof ((_f = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _f === void 0 ? void 0 : _f.trackPageView) === 'function') {
1292
- (_g = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _g === void 0 ? void 0 : _g.trackPageView();
1342
+ if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.Northbeam) === 'object' && typeof ((_g = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _g === void 0 ? void 0 : _g.trackPageView) === 'function') {
1343
+ (_h = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _h === void 0 ? void 0 : _h.trackPageView();
1293
1344
  }
1294
- const converApiEventParamsJson = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _h === void 0 ? void 0 : _h[eventName];
1345
+ const converApiEventParamsJson = (_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _j === void 0 ? void 0 : _j[eventName];
1295
1346
  if (enabledMetaConversionApi && converApiEventParamsJson) {
1296
- const body = getEventParamsByJson(converApiEventParamsJson, product);
1347
+ const body = getEventParamsByJson(Object.assign({ json: converApiEventParamsJson, eventName }, props));
1297
1348
  const params = {};
1298
1349
  const queryString = location.search.slice(1);
1299
- (_j = splitUrlParams(queryString)) === null || _j === void 0 ? void 0 : _j.forEach((val) => {
1350
+ (_k = splitUrlParams(queryString)) === null || _k === void 0 ? void 0 : _k.forEach((val) => {
1300
1351
  const key = val.split('=')[0];
1301
1352
  const value = val.split('=')[1];
1302
1353
  params[key] = value;
1303
1354
  });
1304
1355
  const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
1305
- bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_k = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _k === void 0 ? void 0 : _k['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
1356
+ bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_l = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _l === void 0 ? void 0 : _l['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
1306
1357
  method: 'POST',
1307
1358
  body,
1308
1359
  type: 'beacon'
@@ -1340,7 +1391,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1340
1391
  console.log('e', e);
1341
1392
  }
1342
1393
  }), [bffFetch, utmVal]);
1343
- const ctaEvent = useCallback((eventInfo, rec, product, position) => {
1394
+ const ctaEvent = useCallback((eventInfo, rec, product, position, ctaActionType, targetUrl, contentType) => {
1344
1395
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
1345
1396
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
1346
1397
  const isProd = ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) || (((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
@@ -1363,32 +1414,21 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1363
1414
  });
1364
1415
  }, [bffEventReport, isFromHashtag]);
1365
1416
  const h5EnterLink = useCallback(() => {
1366
- var _a, _b, _c;
1367
- const queryString = location.search.slice(1);
1368
- const params = {};
1369
- (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
1370
- const key = val.split('=')[0];
1371
- const value = val.split('=')[1];
1372
- params[key] = value;
1373
- });
1374
- for (const key in params) {
1375
- params[key] = params[key].replace(/%2B/g, '+');
1376
- }
1377
- const getVal = (key) => { var _a; return (_a = params[key]) !== null && _a !== void 0 ? _a : ''; };
1417
+ var _a, _b;
1378
1418
  const time = new Date();
1379
1419
  curTime.current = time;
1380
1420
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1381
1421
  eventInfo: {
1382
1422
  eventSubject: 'h5LinkEnterFeed',
1383
1423
  eventDescription: 'User enter h5 link',
1384
- utmSource: getVal('utm_source'),
1385
- utmMedium: getVal('utm_medium'),
1386
- utmCampaign: getVal('utm_campaign'),
1387
- utmId: getVal('utm_id'),
1388
- utmContent: getVal('utm_content'),
1424
+ utmSource: getUrlParamByKey('utm_source'),
1425
+ utmMedium: getUrlParamByKey('utm_medium'),
1426
+ utmCampaign: getUrlParamByKey('utm_campaign'),
1427
+ utmId: getUrlParamByKey('utm_id'),
1428
+ utmContent: getUrlParamByKey('utm_content'),
1389
1429
  enterTime: Math.floor(time / 1000) + '',
1390
1430
  requestId: null,
1391
- enterUrl: (_c = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href) !== null && _c !== void 0 ? _c : ''
1431
+ enterUrl: (_b = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href) !== null && _b !== void 0 ? _b : ''
1392
1432
  },
1393
1433
  reportLayId: false
1394
1434
  });
@@ -10808,22 +10848,78 @@ const CommodityDetail$1 = (_a) => {
10808
10848
  eventSubject: 'clickCta',
10809
10849
  eventDescription: 'User clicked the CTA'
10810
10850
  }, data, product, position);
10851
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10852
+ eventName: 'ClickCTA',
10853
+ product: product ? [product] : undefined,
10854
+ contentType: 'product',
10855
+ data,
10856
+ position,
10857
+ cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
10858
+ cta_action_type: 'open_external_link',
10859
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
10860
+ target_url: product.link
10861
+ });
10811
10862
  }
10812
10863
  window.location.href = window.getJointUtmLink(product.link);
10813
10864
  }
10814
10865
  };
10815
10866
  useEffect(() => {
10867
+ var _a;
10816
10868
  if (!isActive)
10817
10869
  return;
10870
+ const recData = Object.assign(Object.assign({}, data), { video: (data === null || data === void 0 ? void 0 : data.video) ? Object.assign(Object.assign({}, data === null || data === void 0 ? void 0 : data.video), { title: '', imgUrls: !isPost ? product === null || product === void 0 ? void 0 : product.homePage : (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.imgUrls }) : null });
10818
10871
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10819
10872
  eventName: 'ProductView',
10820
- product
10873
+ product: product ? [product] : undefined,
10874
+ contentType: 'product',
10875
+ rec: recData,
10876
+ position
10821
10877
  });
10822
10878
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10823
10879
  eventName: 'PageView',
10824
- product
10880
+ product: product ? [product] : undefined,
10881
+ contentType: 'product',
10882
+ rec: recData,
10883
+ position
10825
10884
  });
10826
10885
  }, [isActive, bffFbReport]);
10886
+ useEffect(() => {
10887
+ if (!isActive || isPost)
10888
+ return;
10889
+ const onShow = () => {
10890
+ curTimeRef.current = new Date();
10891
+ };
10892
+ const recData = Object.assign(Object.assign({}, data), { video: (data === null || data === void 0 ? void 0 : data.video) ? Object.assign(Object.assign({}, data === null || data === void 0 ? void 0 : data.video), { title: '' }) : null });
10893
+ const onHide = () => {
10894
+ var _a;
10895
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10896
+ eventName: 'ExitFeed',
10897
+ product: product ? [product] : undefined,
10898
+ contentType: 'product',
10899
+ rec: recData,
10900
+ position,
10901
+ view_time: new Date() - curTimeRef.current,
10902
+ content_id: (_a = product === null || product === void 0 ? void 0 : product.itemId) !== null && _a !== void 0 ? _a : ''
10903
+ });
10904
+ };
10905
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
10906
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
10907
+ return () => {
10908
+ var _a;
10909
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10910
+ eventName: 'Engagement',
10911
+ product: product ? [product] : undefined,
10912
+ rec: recData,
10913
+ position,
10914
+ content_id: (_a = product === null || product === void 0 ? void 0 : product.itemId) !== null && _a !== void 0 ? _a : '',
10915
+ engagement_type: 'close_popup',
10916
+ contentType: 'product',
10917
+ view_time: new Date() - curTimeRef.current
10918
+ });
10919
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
10920
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
10921
+ };
10922
+ }, [isActive, isPost, bffFbReport, data, product, position, curTimeRef]);
10827
10923
  useEffect(() => {
10828
10924
  const initTime = () => {
10829
10925
  curTimeRef.current = new Date();
@@ -11715,22 +11811,78 @@ const CommodityDetailDiroNew$1 = (_a) => {
11715
11811
  eventSubject: 'clickCta',
11716
11812
  eventDescription: 'User clicked the CTA'
11717
11813
  }, data, product, position);
11814
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11815
+ eventName: 'ClickCTA',
11816
+ product: product ? [product] : undefined,
11817
+ contentType: 'product',
11818
+ data,
11819
+ position,
11820
+ cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
11821
+ cta_action_type: 'open_external_link',
11822
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
11823
+ target_url: product.link
11824
+ });
11718
11825
  }
11719
11826
  window.location.href = window.getJointUtmLink(product.link);
11720
11827
  }
11721
11828
  };
11722
11829
  useEffect(() => {
11830
+ var _a;
11723
11831
  if (!isActive)
11724
11832
  return;
11833
+ const recData = Object.assign(Object.assign({}, data), { video: (data === null || data === void 0 ? void 0 : data.video) ? Object.assign(Object.assign({}, data === null || data === void 0 ? void 0 : data.video), { title: '', imgUrls: !isPost ? product === null || product === void 0 ? void 0 : product.homePage : (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.imgUrls }) : null });
11725
11834
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11726
11835
  eventName: 'ProductView',
11727
- product
11836
+ product: product ? [product] : undefined,
11837
+ contentType: 'product',
11838
+ rec: recData,
11839
+ position
11728
11840
  });
11729
11841
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11730
11842
  eventName: 'PageView',
11731
- product
11843
+ product: product ? [product] : undefined,
11844
+ contentType: 'product',
11845
+ rec: recData,
11846
+ position
11732
11847
  });
11733
- }, [isActive, bffFbReport]);
11848
+ }, [isActive, bffFbReport, isPost]);
11849
+ useEffect(() => {
11850
+ if (!isActive || isPost)
11851
+ return;
11852
+ const onShow = () => {
11853
+ curTimeRef.current = new Date();
11854
+ };
11855
+ const recData = Object.assign(Object.assign({}, data), { video: (data === null || data === void 0 ? void 0 : data.video) ? Object.assign(Object.assign({}, data === null || data === void 0 ? void 0 : data.video), { title: '' }) : null });
11856
+ const onHide = () => {
11857
+ var _a;
11858
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11859
+ eventName: 'ExitFeed',
11860
+ product: product ? [product] : undefined,
11861
+ contentType: 'product',
11862
+ rec: recData,
11863
+ position,
11864
+ view_time: new Date() - curTimeRef.current,
11865
+ content_id: (_a = product === null || product === void 0 ? void 0 : product.itemId) !== null && _a !== void 0 ? _a : ''
11866
+ });
11867
+ };
11868
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
11869
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
11870
+ return () => {
11871
+ var _a;
11872
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11873
+ eventName: 'Engagement',
11874
+ product: product ? [product] : undefined,
11875
+ rec: recData,
11876
+ position,
11877
+ content_id: (_a = product === null || product === void 0 ? void 0 : product.itemId) !== null && _a !== void 0 ? _a : '',
11878
+ engagement_type: 'close_popup',
11879
+ contentType: 'product',
11880
+ view_time: new Date() - curTimeRef.current
11881
+ });
11882
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
11883
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
11884
+ };
11885
+ }, [isActive, isPost, bffFbReport, data, product, position, curTimeRef]);
11734
11886
  useEffect(() => {
11735
11887
  const initTime = () => {
11736
11888
  if (!isActive)
@@ -12395,16 +12547,28 @@ const CommodityList$1 = (_a) => {
12395
12547
  });
12396
12548
  }, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
12397
12549
  const handleClick = throttle((item, multiCheckIndex, e) => {
12550
+ var _a;
12398
12551
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12399
12552
  eventSubject: 'clickCta',
12400
12553
  eventDescription: 'User clicked the CTA'
12401
12554
  }, recData, item, index);
12555
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
12556
+ eventName: 'ClickCTA',
12557
+ product: item ? [item] : undefined,
12558
+ contentType: 'product',
12559
+ recData,
12560
+ index,
12561
+ cta_text: (_a = item === null || item === void 0 ? void 0 : item.bindCta) === null || _a === void 0 ? void 0 : _a.enTitle,
12562
+ cta_action_type: isExternalLink && !!(item === null || item === void 0 ? void 0 : item.link) ? 'open_external_link' : 'open_internal_popup',
12563
+ target_content_id: item === null || item === void 0 ? void 0 : item.itemId,
12564
+ target_url: item.link
12565
+ });
12402
12566
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
12403
12567
  if (isExternalLink) {
12404
- if (item === null || item === void 0 ? void 0 : item.link) {
12405
- jumpToWeb(e, recData, item, item.bindCta, index);
12406
- window.location.href = window.getJointUtmLink(item.link);
12407
- }
12568
+ if (!(item === null || item === void 0 ? void 0 : item.link))
12569
+ return;
12570
+ jumpToWeb(e, recData, item, item.bindCta, index);
12571
+ window.location.href = window.getJointUtmLink(item.link);
12408
12572
  }
12409
12573
  else {
12410
12574
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -12412,7 +12576,11 @@ const CommodityList$1 = (_a) => {
12412
12576
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
12413
12577
  useEffect(() => {
12414
12578
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
12415
- eventName: 'PageView'
12579
+ eventName: 'PageView',
12580
+ product: (product !== null && product !== void 0 ? product : []),
12581
+ contentType: 'product',
12582
+ rec: recData,
12583
+ position: index
12416
12584
  });
12417
12585
  }, []);
12418
12586
  return (React.createElement("ul", { role: 'list', className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
@@ -12924,28 +13092,40 @@ const EventProvider = (_a) => {
12924
13092
  var { rec, children, className, onClick, style, isExternalLink = false, index, jumpLink, multItem, multiCheckIndex } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index", "jumpLink", "multItem", "multiCheckIndex"]);
12925
13093
  const ref = useRef(null);
12926
13094
  const { popup } = useEditor();
12927
- const { setPopupDetailData, ctaEvent } = useSxpDataSource();
13095
+ const { setPopupDetailData, ctaEvent, bffFbReport } = useSxpDataSource();
12928
13096
  const { jumpToWeb } = useEventReport();
12929
13097
  const [element, setElement] = useState(null);
12930
13098
  const handleClick = throttle((e) => {
12931
- var _a, _b, _c, _d, _e, _f;
13099
+ var _a, _b, _c, _d, _e, _f, _g, _h;
12932
13100
  e.preventDefault();
12933
- const item = multItem ? multItem : (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
13101
+ const item = multItem || ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video);
13102
+ const link = jumpLink || ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) || (multItem === null || multItem === void 0 ? void 0 : multItem.link) || '';
12934
13103
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12935
13104
  eventSubject: 'clickCta',
12936
13105
  eventDescription: 'User clicked the CTA'
12937
13106
  }, rec, item, index);
13107
+ const product = multItem || ((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindProduct);
13108
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
13109
+ eventName: 'ClickCTA',
13110
+ product: product ? [product] : undefined,
13111
+ contentType: 'post',
13112
+ rec,
13113
+ index,
13114
+ cta_text: (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle,
13115
+ cta_action_type: isExternalLink && (!!link) ? 'open_external_link' : 'open_internal_popup',
13116
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
13117
+ target_url: link
13118
+ });
12938
13119
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(multItem && multiCheckIndex !== undefined && multiCheckIndex >= 0
12939
13120
  ? Object.assign(Object.assign({}, rec), { video: Object.assign(Object.assign({}, rec === null || rec === void 0 ? void 0 : rec.video), { bindProduct: multItem }), index, multiCheckIndex }) : Object.assign(Object.assign({}, rec), { index }));
12940
13121
  setElement(ref === null || ref === void 0 ? void 0 : ref.current);
12941
13122
  if (isExternalLink) {
12942
- const link = ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) || (multItem === null || multItem === void 0 ? void 0 : multItem.link);
12943
- if (jumpLink || link) {
12944
- const cta = ((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta) || (multItem === null || multItem === void 0 ? void 0 : multItem.bindCta);
12945
- const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
12946
- jumpToWeb(e, rec, product, cta, index);
12947
- window.location.href = window.getJointUtmLink(jumpLink || link || '');
12948
- }
13123
+ if (!link)
13124
+ return;
13125
+ const cta = ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindCta) || (multItem === null || multItem === void 0 ? void 0 : multItem.bindCta);
13126
+ const product = ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.bindProduct) || multItem;
13127
+ jumpToWeb(e, rec, product, cta, index);
13128
+ window.location.href = window.getJointUtmLink(link);
12949
13129
  }
12950
13130
  else {
12951
13131
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -15430,7 +15610,7 @@ var previewData = {
15430
15610
 
15431
15611
  const WaterfallFlowItem$1 = (props) => {
15432
15612
  var _a;
15433
- const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
15613
+ const { listItem, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
15434
15614
  const { swiperRef, setRtcList, setOpenHashtag, sxpParameter, globalConfig } = useSxpDataSource();
15435
15615
  const [showVideo, setShowVideo] = useState(false);
15436
15616
  useState(false);
@@ -15443,6 +15623,7 @@ const WaterfallFlowItem$1 = (props) => {
15443
15623
  useRef(null);
15444
15624
  useRef(null);
15445
15625
  const [firstFrameSrc, setFirstFrameSrc] = useState('');
15626
+ const rec = listItem;
15446
15627
  const src = useMemo(() => {
15447
15628
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
15448
15629
  if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) {
@@ -15535,7 +15716,7 @@ const WaterfallFlowItem$1 = (props) => {
15535
15716
  function WaterfallList$1(_a) {
15536
15717
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
15537
15718
  var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
15538
- const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = useSxpDataSource();
15719
+ const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex, bffFbReport } = useSxpDataSource();
15539
15720
  const { jumpToWeb } = useEventReport();
15540
15721
  /** 滚动的父元素 */
15541
15722
  const scrollParent = useRef(null);
@@ -15662,7 +15843,8 @@ function WaterfallList$1(_a) {
15662
15843
  }).then((res) => {
15663
15844
  var _a, _b;
15664
15845
  setData(res);
15665
- setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
15846
+ const list = (_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : [];
15847
+ setList(list);
15666
15848
  setIsLoadingData(false);
15667
15849
  }));
15668
15850
  if (isOpenHashTag) {
@@ -15751,7 +15933,7 @@ function WaterfallList$1(_a) {
15751
15933
  React.createElement("div", { className: 'waterFallList-content' }, list === null || list === void 0 ? void 0 :
15752
15934
  list.map((item, ind) => {
15753
15935
  var _a;
15754
- return (React.createElement(WaterfallFlowItem$1, Object.assign({ key: ind, index: ind, rec: item, list: list, showBorder: scrollTop + ((_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.clientHeight), style: styleList[ind], sizeChange: onSizeChange, unitWidth: unitWidth, reportTagsView: reportTagsView }, props)));
15936
+ return (React.createElement(WaterfallFlowItem$1, Object.assign({ key: ind, index: ind, listItem: item, list: list, showBorder: scrollTop + ((_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.clientHeight), style: styleList[ind], sizeChange: onSizeChange, unitWidth: unitWidth, reportTagsView: reportTagsView }, props)));
15755
15937
  }),
15756
15938
  React.createElement("div", { hidden: !((_l = data === null || data === void 0 ? void 0 : data.tag) === null || _l === void 0 ? void 0 : _l.link), style: {
15757
15939
  position: 'absolute',
@@ -15773,7 +15955,8 @@ var img$6 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeA
15773
15955
 
15774
15956
  const WaterfallFlowItem = (props) => {
15775
15957
  var _a;
15776
- const { rec, index, list, reportTagsView, textStyles, space, openFixedSize, fixedSizeRatio } = props;
15958
+ const { listItem, index, list, reportTagsView, textStyles, space, openFixedSize, fixedSizeRatio } = props;
15959
+ const rec = listItem;
15777
15960
  const { swiperRef, setRtcList, setOpenHashtag, sxpParameter, globalConfig } = useSxpDataSource();
15778
15961
  const [showVideo, setShowVideo] = useState(false);
15779
15962
  const imgDom = useRef(null);
@@ -15898,41 +16081,30 @@ const WaterfallFlowItem = (props) => {
15898
16081
  function WaterfallList(_a) {
15899
16082
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
15900
16083
  var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
15901
- const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = useSxpDataSource();
16084
+ const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex, bffFbReport } = useSxpDataSource();
15902
16085
  const { jumpToWeb } = useEventReport();
15903
16086
  const [list, setList] = useState();
15904
16087
  const [data, setData] = useState();
15905
16088
  const [isLoadingData, setIsLoadingData] = useState(false);
15906
16089
  const containerRef = useRef(null);
15907
16090
  const [isLoadMore, setIsLoadMore] = useState(false);
15908
- useCallback(() => {
15909
- if (isLoadMore)
15910
- return;
15911
- setIsLoadMore(true);
15912
- waterFallData &&
15913
- (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
15914
- hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag
15915
- }).then((res) => {
15916
- var _a;
15917
- setList(list === null || list === void 0 ? void 0 : list.concat((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []));
15918
- setIsLoadMore(false);
15919
- }));
15920
- }, [waterFallData, getRecommendVideos, list, isLoadMore]);
15921
16091
  useEffect(() => {
15922
16092
  var _a, _b;
15923
16093
  setIsLoadingData(true);
15924
- waterFallData &&
15925
- (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
16094
+ if (waterFallData) {
16095
+ getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
15926
16096
  hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
15927
16097
  defaultSize: hashTagSize,
15928
16098
  maxSize: hashTagSize
15929
16099
  }).then((res) => {
15930
16100
  var _a, _b;
15931
16101
  setData(res);
15932
- setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
16102
+ const list = (_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : [];
16103
+ setList(list);
15933
16104
  setIsLoadingData(false);
15934
- }));
15935
- if (isOpenHashTag) {
16105
+ });
16106
+ }
16107
+ else if (isOpenHashTag) {
15936
16108
  const res = previewData;
15937
16109
  setData(res);
15938
16110
  setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
@@ -15980,7 +16152,7 @@ function WaterfallList(_a) {
15980
16152
  __html: setFontForText(((_j = data === null || data === void 0 ? void 0 : data.tag) === null || _j === void 0 ? void 0 : _j.linkTitle) || 'Shop the collection', (_k = props === null || props === void 0 ? void 0 : props.textStyles) === null || _k === void 0 ? void 0 : _k.hashTagLink)
15981
16153
  } }),
15982
16154
  React.createElement("div", { className: 'list-content' }, list === null || list === void 0 ? void 0 : list.map((item, ind) => {
15983
- return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, reportTagsView: reportTagsView }, props)));
16155
+ return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, listItem: item, list: list, reportTagsView: reportTagsView }, props)));
15984
16156
  })),
15985
16157
  React.createElement("div", { hidden: !isLoadMore, style: { textAlign: 'center' } }, "loading..."),
15986
16158
  React.createElement("div", { hidden: !((_l = data === null || data === void 0 ? void 0 : data.tag) === null || _l === void 0 ? void 0 : _l.link), style: {
@@ -16069,13 +16241,17 @@ const WaterFall = (props) => {
16069
16241
  });
16070
16242
  }, [recData, bffEventReport, viewTime, isFromHashtag, cacheActiveIndex]);
16071
16243
  useEffect(() => {
16244
+ var _a, _b;
16072
16245
  if (openHashtag) {
16073
16246
  setViewTime(new Date());
16074
16247
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16075
- eventName: 'PageView'
16248
+ eventName: 'PageView',
16249
+ product: (_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProducts,
16250
+ rec: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec,
16251
+ position: cacheActiveIndex
16076
16252
  });
16077
16253
  }
16078
- }, [openHashtag, bffFbReport]);
16254
+ }, [openHashtag, bffFbReport, waterFallData, cacheActiveIndex]);
16079
16255
  useEffect(() => {
16080
16256
  const initTime = () => {
16081
16257
  setViewTime(new Date());
@@ -16386,7 +16562,7 @@ var styles$1 = {"animated-button":"index-module_animated-button__lqTbg","gradien
16386
16562
  const AniLink$1 = (_a) => {
16387
16563
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
16388
16564
  var { style, recData, ctaTempStyles, index, event, onClick, isExternalLink = false, isActive } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "onClick", "isExternalLink", "isActive"]);
16389
- const { ctaEvent, setPopupDetailData } = useSxpDataSource();
16565
+ const { ctaEvent, setPopupDetailData, bffFbReport } = useSxpDataSource();
16390
16566
  const { jumpToWeb } = useEventReport();
16391
16567
  const [visible, setVisible] = useState(false);
16392
16568
  const ref = useRef(null);
@@ -16396,17 +16572,28 @@ const AniLink$1 = (_a) => {
16396
16572
  const handleTo = (e) => {
16397
16573
  var _a, _b, _c, _d;
16398
16574
  const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
16575
+ const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
16399
16576
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
16400
16577
  eventSubject: 'clickCta',
16401
16578
  eventDescription: 'User clicked the CTA'
16402
16579
  }, recData, item, index);
16580
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16581
+ eventName: 'ClickCTA',
16582
+ product: product ? [product] : undefined,
16583
+ contentType: 'post',
16584
+ recData,
16585
+ index,
16586
+ cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
16587
+ cta_action_type: (isExternalLink && !!link) ? 'open_external_link' : 'open_internal_popup',
16588
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
16589
+ target_url: link
16590
+ });
16403
16591
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
16404
16592
  if (isExternalLink) {
16405
- const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
16406
- if (link) {
16407
- jumpToWeb(e, recData, product, cta, index);
16408
- window.location.href = window.getJointUtmLink(link);
16409
- }
16593
+ if (!link)
16594
+ return;
16595
+ jumpToWeb(e, recData, product, cta, index);
16596
+ window.location.href = window.getJointUtmLink(link);
16410
16597
  }
16411
16598
  else {
16412
16599
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -16889,7 +17076,7 @@ const AniLinkPopup$1 = (_a) => {
16889
17076
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
16890
17077
  var { style, recData, ctaTempStyles, index, event, bottom_image, translateY, isTel, onClick, isExternalLink = false, isActive } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "bottom_image", "translateY", "isTel", "onClick", "isExternalLink", "isActive"]);
16891
17078
  style === null || style === void 0 ? true : delete style.transform;
16892
- const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
17079
+ const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData, bffFbReport } = useSxpDataSource();
16893
17080
  const { jumpToWeb } = useEventReport();
16894
17081
  const [visible, setVisible] = useState(true);
16895
17082
  const cta = ((_d = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.bindCta) || ((_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.bindCta) || ((_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindCta);
@@ -16897,17 +17084,28 @@ const AniLinkPopup$1 = (_a) => {
16897
17084
  const handleTo = (e) => {
16898
17085
  var _a, _b, _c, _d;
16899
17086
  const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
17087
+ const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
16900
17088
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
16901
17089
  eventSubject: 'clickCta',
16902
17090
  eventDescription: 'User clicked the CTA'
16903
17091
  }, recData, item, index);
17092
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
17093
+ eventName: 'ClickCTA',
17094
+ product: product ? [product] : undefined,
17095
+ contentType: 'post',
17096
+ recData,
17097
+ index,
17098
+ cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
17099
+ cta_action_type: (isExternalLink && !!link) ? 'open_external_link' : 'open_internal_popup',
17100
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
17101
+ target_url: link
17102
+ });
16904
17103
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
16905
17104
  if (isExternalLink) {
16906
- const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
16907
- if (link) {
16908
- jumpToWeb(e, recData, product, cta, index);
16909
- window.location.href = window.getJointUtmLink(link);
16910
- }
17105
+ if (!link)
17106
+ return;
17107
+ jumpToWeb(e, recData, product, cta, index);
17108
+ window.location.href = window.getJointUtmLink(link);
16911
17109
  }
16912
17110
  else {
16913
17111
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -16941,8 +17139,8 @@ const AniLinkPopup$1 = (_a) => {
16941
17139
  height: '40px',
16942
17140
  lineHeight: '40px',
16943
17141
  paddingLeft: '6px'
16944
- } }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${css(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${styles['aniLinkPopup']} ${aniNamStyle} ${css(aniTimStyle)}`, onClick: handleTo }),
16945
- React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style['padding']) !== null && _s !== void 0 ? _s : 0 } },
17142
+ } }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${css(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${styles.aniLinkPopup} ${aniNamStyle} ${css(aniTimStyle)}`, onClick: handleTo }),
17143
+ React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style.padding) !== null && _s !== void 0 ? _s : 0 } },
16946
17144
  React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
16947
17145
  React.createElement(Img$1, { src: src, rec: recData, item: (_x = (_v = (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u[0]) !== null && _v !== void 0 ? _v : (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.bindProduct) !== null && _x !== void 0 ? _x : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
16948
17146
  (!recData || (product === null || product === void 0 ? void 0 : product.title)) && (React.createElement("div", { className: styles['one-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
@@ -18133,12 +18331,12 @@ const defaultLikeIconPath$2 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
18133
18331
  const LikeButton = (_a) => {
18134
18332
  var _b;
18135
18333
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
18136
- const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
18334
+ const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList, bffFbReport } = useSxpDataSource();
18137
18335
  const [state, setState] = useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
18138
18336
  const likeIcon = useIconLink(defaultLikeIconPath$2);
18139
18337
  const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
18140
18338
  const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
18141
- var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
18339
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
18142
18340
  if (state) {
18143
18341
  // 先设置状态
18144
18342
  setState(false);
@@ -18184,16 +18382,24 @@ const LikeButton = (_a) => {
18184
18382
  traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
18185
18383
  }
18186
18384
  });
18385
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18386
+ eventName: 'Engagement',
18387
+ product: (_z = recData === null || recData === void 0 ? void 0 : recData.video) === null || _z === void 0 ? void 0 : _z.bindProducts,
18388
+ rec: recData,
18389
+ position,
18390
+ content_id: (_1 = (_0 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _0 === void 0 ? void 0 : _0.itemId) !== null && _1 !== void 0 ? _1 : '',
18391
+ engagement_type: 'like'
18392
+ });
18187
18393
  if (!result) {
18188
18394
  setState(false);
18189
18395
  }
18190
18396
  else {
18191
- const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18397
+ const nRtcList = (_2 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18192
18398
  if (index === position) {
18193
18399
  item.isCollected = true;
18194
18400
  }
18195
18401
  return item;
18196
- })) !== null && _z !== void 0 ? _z : [];
18402
+ })) !== null && _2 !== void 0 ? _2 : [];
18197
18403
  setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
18198
18404
  }
18199
18405
  }
@@ -18505,11 +18711,15 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
18505
18711
  if (isActive) {
18506
18712
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18507
18713
  eventName: 'ViewContent',
18508
- product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
18714
+ product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProducts,
18715
+ rec: data === null || data === void 0 ? void 0 : data[index],
18716
+ position: index
18509
18717
  });
18510
18718
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18511
18719
  eventName: 'PageView',
18512
- product: (_d = (_c = data === null || data === void 0 ? void 0 : data[index]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.bindProduct
18720
+ product: (_d = (_c = data === null || data === void 0 ? void 0 : data[index]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.bindProducts,
18721
+ rec: data === null || data === void 0 ? void 0 : data[index],
18722
+ position: index
18513
18723
  });
18514
18724
  (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
18515
18725
  }
@@ -19161,7 +19371,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19161
19371
  (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
19162
19372
  }, [data, ctaType, swiperRef]);
19163
19373
  const handleSessionCompleted = useCallback((fk) => {
19164
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
19374
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
19165
19375
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
19166
19376
  let fromKName = '';
19167
19377
  if (popupDetailData && (((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
@@ -19196,7 +19406,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19196
19406
  traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : ''
19197
19407
  }
19198
19408
  });
19199
- }, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
19409
+ const isPostType = ((_w = item === null || item === void 0 ? void 0 : item.video) === null || _w === void 0 ? void 0 : _w.url) || ((_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.imgUrls) === null || _y === void 0 ? void 0 : _y.length);
19410
+ if (!popupDetailData) {
19411
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19412
+ eventName: 'ExitFeed',
19413
+ product: isPostType ? (_z = item === null || item === void 0 ? void 0 : item.video) === null || _z === void 0 ? void 0 : _z.bindProducts : (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [],
19414
+ rec: item,
19415
+ position: activeIndex,
19416
+ content_id: isPostType ? (_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.itemId) !== null && _1 !== void 0 ? _1 : '' : (_3 = (_2 = item === null || item === void 0 ? void 0 : item.product) === null || _2 === void 0 ? void 0 : _2.itemId) !== null && _3 !== void 0 ? _3 : '',
19417
+ view_time: new Date() - viewTime.current
19418
+ });
19419
+ }
19420
+ }, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime, bffFbReport]);
19200
19421
  useEffect(() => {
19201
19422
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
19202
19423
  const visibleChange = () => {
@@ -19499,50 +19720,81 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19499
19720
  }
19500
19721
  };
19501
19722
  const handleScrollEvent = (swiper) => {
19502
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
19723
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
19503
19724
  const item = data[swiper.previousIndex];
19725
+ const activeItem = data[swiper.activeIndex];
19504
19726
  if (!item)
19505
19727
  return;
19506
19728
  let contentFormat = null;
19507
- if ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) {
19729
+ let previousContentType = 'post';
19730
+ let previousContentId = (_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '';
19731
+ let previousProduct = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProducts;
19732
+ let previousContentsName = (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.title) !== null && _e !== void 0 ? _e : '';
19733
+ let previousDirection = '';
19734
+ let contentId = (_g = (_f = activeItem === null || activeItem === void 0 ? void 0 : activeItem.video) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '';
19735
+ if ((_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.url) {
19508
19736
  contentFormat = 'video';
19509
19737
  }
19510
- else if ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls) === null || _c === void 0 ? void 0 : _c.length) {
19738
+ else if ((_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.imgUrls) === null || _k === void 0 ? void 0 : _k.length) {
19511
19739
  contentFormat = 'image';
19512
19740
  }
19741
+ else {
19742
+ previousContentType = 'product';
19743
+ previousContentId = (_m = (_l = item === null || item === void 0 ? void 0 : item.product) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '';
19744
+ previousProduct = (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [];
19745
+ previousContentsName = '';
19746
+ }
19747
+ if (!((_o = activeItem === null || activeItem === void 0 ? void 0 : activeItem.video) === null || _o === void 0 ? void 0 : _o.url) && !((_q = (_p = activeItem === null || activeItem === void 0 ? void 0 : activeItem.video) === null || _p === void 0 ? void 0 : _p.imgUrls) === null || _q === void 0 ? void 0 : _q.length)) {
19748
+ contentId = (_s = (_r = activeItem === null || activeItem === void 0 ? void 0 : activeItem.product) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '';
19749
+ }
19513
19750
  if (swiper.previousIndex - swiper.activeIndex < 0) {
19514
19751
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19515
19752
  eventInfo: {
19516
19753
  eventSubject: 'scrollDown',
19517
19754
  eventDescription: 'User scroll down',
19518
- contentId: (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.itemId) !== null && _e !== void 0 ? _e : '',
19519
- productId: (_g = (_f = item === null || item === void 0 ? void 0 : item.product) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
19755
+ contentId: (_u = (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
19756
+ productId: (_w = (_v = item === null || item === void 0 ? void 0 : item.product) === null || _v === void 0 ? void 0 : _v.itemId) !== null && _w !== void 0 ? _w : '',
19520
19757
  requestId: null,
19521
- traceInfo: (_l = (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.traceInfo) !== null && _j !== void 0 ? _j : (_k = item === null || item === void 0 ? void 0 : item.product) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : '',
19758
+ traceInfo: (_0 = (_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_z = item === null || item === void 0 ? void 0 : item.product) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : '',
19522
19759
  contentFormat,
19523
- position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
19760
+ position: ((_1 = swiper.previousIndex) !== null && _1 !== void 0 ? _1 : 0) + ''
19524
19761
  }
19525
19762
  });
19526
19763
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
19527
19764
  handleViewImageStartEnd(item);
19528
19765
  handleSlideSkip(item, swiper.previousIndex);
19766
+ previousDirection = 'up';
19529
19767
  }
19530
19768
  else {
19531
19769
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19532
19770
  eventInfo: {
19533
19771
  eventSubject: 'scrollUp',
19534
19772
  eventDescription: 'User scroll up',
19535
- contentId: (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
19536
- productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
19773
+ contentId: (_3 = (_2 = item === null || item === void 0 ? void 0 : item.video) === null || _2 === void 0 ? void 0 : _2.itemId) !== null && _3 !== void 0 ? _3 : '',
19774
+ productId: (_5 = (_4 = item.product) === null || _4 === void 0 ? void 0 : _4.itemId) !== null && _5 !== void 0 ? _5 : '',
19537
19775
  requestId: null,
19538
- traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : '',
19776
+ traceInfo: (_9 = (_7 = (_6 = item === null || item === void 0 ? void 0 : item.video) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_8 = item === null || item === void 0 ? void 0 : item.product) === null || _8 === void 0 ? void 0 : _8.traceInfo) !== null && _9 !== void 0 ? _9 : '',
19539
19777
  contentFormat,
19540
- position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
19778
+ position: ((_10 = swiper.previousIndex) !== null && _10 !== void 0 ? _10 : 0) + ''
19541
19779
  }
19542
19780
  });
19543
19781
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
19544
19782
  handleViewImageStartEnd(item);
19783
+ previousDirection = 'down';
19545
19784
  }
19785
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19786
+ eventName: 'ContentSwipe',
19787
+ product: previousProduct,
19788
+ rec: activeItem,
19789
+ position: swiper.activeIndex,
19790
+ previous_content_id: previousContentId,
19791
+ previous_content_type: previousContentType,
19792
+ previous_contents_name: previousContentsName,
19793
+ previosu_position: swiper.previousIndex,
19794
+ swipe_direction: previousDirection,
19795
+ view_time: new Date() - viewTime.current,
19796
+ content_id: contentId
19797
+ });
19546
19798
  // 商品浏览事件
19547
19799
  handleReportProductView(item);
19548
19800
  viewTime.current = new Date();
@@ -19646,11 +19898,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19646
19898
  if (enableCapi) {
19647
19899
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19648
19900
  eventName: 'ViewContent',
19649
- product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
19901
+ product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProducts,
19902
+ rec: item,
19903
+ position: activeIndex
19650
19904
  });
19651
19905
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19652
19906
  eventName: 'PageView',
19653
- product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
19907
+ product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProducts,
19908
+ rec: item,
19909
+ position: activeIndex
19654
19910
  });
19655
19911
  }
19656
19912
  }