@sunbird-cb/consumption 0.0.45 → 0.0.46

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 (28) hide show
  1. package/bundles/sunbird-cb-consumption.umd.js +4227 -43
  2. package/bundles/sunbird-cb-consumption.umd.js.map +1 -1
  3. package/bundles/sunbird-cb-consumption.umd.min.js +1 -1
  4. package/bundles/sunbird-cb-consumption.umd.min.js.map +1 -1
  5. package/esm2015/lib/_common/cards/card-assessment/card-assessment/card-assessment.component.js +34 -24
  6. package/esm2015/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.component.js +2794 -0
  7. package/esm2015/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.model.js +218 -0
  8. package/esm2015/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.module.js +69 -0
  9. package/esm2015/public-api.js +2 -1
  10. package/esm2015/sunbird-cb-consumption.js +16 -15
  11. package/esm5/lib/_common/cards/card-assessment/card-assessment/card-assessment.component.js +46 -30
  12. package/esm5/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.component.js +4119 -0
  13. package/esm5/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.model.js +218 -0
  14. package/esm5/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.module.js +73 -0
  15. package/esm5/public-api.js +2 -1
  16. package/esm5/sunbird-cb-consumption.js +16 -15
  17. package/fesm2015/sunbird-cb-consumption.js +2872 -24
  18. package/fesm2015/sunbird-cb-consumption.js.map +1 -1
  19. package/fesm5/sunbird-cb-consumption.js +4211 -30
  20. package/fesm5/sunbird-cb-consumption.js.map +1 -1
  21. package/lib/_common/cards/card-assessment/card-assessment/card-assessment.component.d.ts +4 -3
  22. package/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.component.d.ts +202 -0
  23. package/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.model.d.ts +149 -0
  24. package/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.module.d.ts +5 -0
  25. package/package.json +1 -1
  26. package/public-api.d.ts +1 -0
  27. package/sunbird-cb-consumption.d.ts +14 -13
  28. package/sunbird-cb-consumption.metadata.json +1 -1
@@ -11044,6 +11044,7 @@ var CardAssessmentComponent = /** @class */ (function () {
11044
11044
  this.activeResource = [];
11045
11045
  this.daysRemaining = 0;
11046
11046
  this.daysPending = false;
11047
+ this.daysFinish = false;
11047
11048
  }
11048
11049
  /**
11049
11050
  * @return {?}
@@ -11056,65 +11057,69 @@ var CardAssessmentComponent = /** @class */ (function () {
11056
11057
  var instanceConfig = this.configSvc.instanceConfig;
11057
11058
  if (instanceConfig) {
11058
11059
  this.defaultThumbnail = instanceConfig.logos.defaultContent || '';
11059
- this.defaultSLogo = instanceConfig.logos.defaultSourceLogo || '/assets/instances/eagle/app_logos/KarmayogiBharat_Logo.svg';
11060
- }
11061
- else {
11062
- this.defaultThumbnail = '/assets/instances/eagle/app_logos/default.png';
11063
- this.defaultSLogo = '/assets/instances/eagle/app_logos/KarmayogiBharat_Logo.svg';
11060
+ this.defaultSLogo = instanceConfig.logos.defaultSourceLogo || '';
11064
11061
  }
11062
+ // console.log( this.daysPending, " this.daysPending===")
11065
11063
  };
11064
+ // updateStartDate(data: any ):void {
11065
+ // // this.startDate = startDate;
11066
+ // this.startCountdown(data)
11067
+ // }
11068
+ // updateStartDate(data: any ):void {
11069
+ // // this.startDate = startDate;
11070
+ // this.startCountdown(data)
11071
+ // }
11066
11072
  /**
11067
- * @param {?} startDate
11068
- * @return {?}
11069
- */
11070
- CardAssessmentComponent.prototype.updateStartDate = /**
11071
- * @param {?} startDate
11073
+ * @param {?} data
11072
11074
  * @return {?}
11073
11075
  */
11074
- function (startDate) {
11075
- this.startDate = startDate;
11076
- this.startCountdown(this.startDate);
11077
- };
11076
+ CardAssessmentComponent.prototype.startCountdown =
11077
+ // updateStartDate(data: any ):void {
11078
+ // // this.startDate = startDate;
11079
+ // this.startCountdown(data)
11080
+ // }
11078
11081
  /**
11079
- * @param {?} date
11080
- * @return {?}
11081
- */
11082
- CardAssessmentComponent.prototype.startCountdown = /**
11083
- * @param {?} date
11082
+ * @param {?} data
11084
11083
  * @return {?}
11085
11084
  */
11086
- function (date) {
11085
+ function (data) {
11087
11086
  var _this = this;
11088
- // Update the countdown immediately on start
11089
- this.updateCountdown(date);
11087
+ this.updateCountdown(data.startDate, data.endDate);
11090
11088
  // Update the countdown every second
11091
11089
  this.intervalId = setInterval((/**
11092
11090
  * @return {?}
11093
11091
  */
11094
11092
  function () {
11095
- _this.updateCountdown(date);
11093
+ _this.updateCountdown(data.startDate, data.endDate);
11096
11094
  }), 1000);
11097
11095
  };
11098
11096
  // Method to update the countdown values
11099
11097
  // Method to update the countdown values
11100
11098
  /**
11101
- * @param {?} targetDate
11099
+ * @param {?} startDate
11100
+ * @param {?} endDate
11102
11101
  * @return {?}
11103
11102
  */
11104
11103
  CardAssessmentComponent.prototype.updateCountdown =
11105
11104
  // Method to update the countdown values
11106
11105
  /**
11107
- * @param {?} targetDate
11106
+ * @param {?} startDate
11107
+ * @param {?} endDate
11108
11108
  * @return {?}
11109
11109
  */
11110
- function (targetDate) {
11110
+ function (startDate, endDate) {
11111
11111
  /** @type {?} */
11112
11112
  var now = new Date().getTime();
11113
11113
  // Current time in milliseconds
11114
11114
  /** @type {?} */
11115
- var targetTime = new Date(targetDate).getTime();
11115
+ var targetTime = new Date(startDate).getTime();
11116
+ /** @type {?} */
11117
+ var targetEndDate = new Date(endDate).getTime();
11116
11118
  /** @type {?} */
11117
11119
  var distance = targetTime - now;
11120
+ // Distance in milliseconds
11121
+ /** @type {?} */
11122
+ var endDistance = now - targetEndDate;
11118
11123
  if (distance > 0) {
11119
11124
  this.daysRemaining = Math.ceil(distance / (1000 * 60 * 60 * 24));
11120
11125
  this.daysPending = true;
@@ -11124,6 +11129,13 @@ var CardAssessmentComponent = /** @class */ (function () {
11124
11129
  this.daysPending = false;
11125
11130
  this.clearTimer();
11126
11131
  }
11132
+ if (endDistance > 0) {
11133
+ this.daysFinish = true;
11134
+ this.clearTimer();
11135
+ }
11136
+ else {
11137
+ this.daysFinish = false;
11138
+ }
11127
11139
  };
11128
11140
  // Method to clear the interval
11129
11141
  // Method to clear the interval
@@ -11167,8 +11179,8 @@ var CardAssessmentComponent = /** @class */ (function () {
11167
11179
  CardAssessmentComponent.decorators = [
11168
11180
  { type: Component, args: [{
11169
11181
  selector: 'sb-uic-card-assessment',
11170
- template: "<ng-container *ngIf=\"!isCardLoading\">\n<ng-container >\n\t<mat-card class=\"card-assessment card-scheduled-assessment card-users-container padding-remove cursor-pointer mr-4\">\n\t<a (click)=\"getRedirectUrlData(widgetData?.content); $event.stopPropagation()\">\n\t\t<div class=\"display-contents\">\n\t\t\t<ng-container *ngIf=\"widgetData\">\n\t\t\t\t<mat-card-content>\n\t\t\t\t\t<div class=\"flex flex-col h-full\">\n\t\t\t\t\t\t<div class=\"flex flex-1 flex-row padding-s\">\n\t\t\t\t\t\t\t<div class=\"flex image-container\">\n\t\t\t\t\t\t\t\t<ng-container *ngIf=\"widgetData?.content?.posterImage\">\n\t\t\t\t\t\t\t\t\t<img mat-card-image class=\"margin-remove assess-img\" [src]=\"widgetData?.content?.posterImage | pipePublicURL\"\n\t\t\t\t\t\t\t\t\t\t[alt]=\"widgetData?.content?.name\">\n\t\t\t\t\t\t\t\t</ng-container>\n\t\t\t\t\t\t\t\t<ng-container *ngIf=\"!widgetData?.content?.posterImage\">\n\t\t\t\t\t\t\t\t\t<ng-template #defaultImg>\n\t\t\t\t\t\t\t\t\t\t<img mat-card-image [src]=\"defaultThumbnail\" loading=\"lazy\"\n\t\t\t\t\t\t\t\t\t\t\tclass=\"card-wide-img ws-mat-primary-lite-background margin-remove assess-img\"\n\t\t\t\t\t\t\t\t\t\t\t[alt]=\"widgetData?.content?.name\" />\n\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t</ng-container>\n\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"flex title-container flex-col\">\n\t\t\t\t\t\t\t\t<div class=\"flex title-text mat-subheading-1\">\n\t\t\t\t\t\t\t\t\t{{ widgetData?.content?.name }}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"flex margin-remove margin-top-s font-normal mat-caption sub-title-text\">\n\t\t\t\t\t\t\t\t\t<div class=\"course_logo_box\">\n\t\t\t\t\t\t\t\t\t\t<img [src]=\"widgetData?.content?.creatorLogo | pipePublicURL \" class=\"source-icon\"\n\t\t\t\t\t\t\t\t\t\t\t[wsUtilsDefaultThumbnail]=\"defaultSLogo\"\n\t\t\t\t\t\t\t\t\t\t\t[alt]=\"(widgetData?.content?.sourceName + '_' + widgetData?.content?.identifier)\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<span class=\"sub-title-text\">\n\t\t\t\t\t\t\t\t\t\t{{ (widgetData?.content?.organisation && widgetData?.content?.organisation[0]) ?\n\t\t\t\t\t\t\t\t\t\twidgetData?.content?.organisation[0] : 'Karmayogi Bharat' }}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class=\"start-span\">Assessment starts in </span>\n\t\t\t\t\t\t<mat-card-footer class=\"assessment-card-footer padding-m\">\n\t\t\t\t\t\t\t<div class=\"flex flex-1 items-center justify-center col-row margin-top-m\">\n\t\t\t\t\t\t\t\t<div class=\"flex margin-right-m\">\n\t\t\t\t\t\t\t\t\t<span *ngIf=\"daysPending\"> {{ startCountdown(widgetData?.content?.batch?.startDate) }}<div id=\"demo\"></div> </span>\n\t\t\t\t\t\t\t\t\t<span *ngIf=\"!daysPending\" class=\"start-btn\"> Start Assessment\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"flex\">\n\t\t\t\t\t\t\t\t\t<span class=\"time-span flex items-center justify-center\">{{widgetData?.content?.batch?.startDate | date: 'd MMM, y' }}</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</mat-card-footer>\n\t\t\t\t\t</div>\n\t\t\t\t</mat-card-content>\n\t\t\t</ng-container>\n\t\t</div>\n\t</a>\n</mat-card>\n</ng-container>\n</ng-container>\n\n\n\n<ng-container *ngIf=\"isCardLoading\">\n\t<ng-container [ngTemplateOutlet]=\"skeltonLoader\"></ng-container>\n</ng-container>\n\n<ng-template #skeltonLoader>\n\n\t<mat-card class=\"card-assessment card-scheduled-assessment card-users-container padding-remove cursor-pointer mr-4\">\n\t\t<a>\n\t\t\t<div class=\"display-contents\">\n\t\t\t\t<ng-container>\n\t\t\t\t\t<mat-card-content>\n\t\t\t\t\t\t<div class=\"flex flex-col h-full\">\n\t\t\t\t\t\t\t<div class=\"flex flex-1 flex-row padding-s\">\n\t\t\t\t\t\t\t\t<div class=\"flex image-container\">\n\t\t\t\t\t\t\t\t\t<ng-container>\n\t\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'300px'\" [height]=\"'155px'\"\n\t\t\t\t\t\t\t\t\t\t\t></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t\t</ng-container>\n\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"flex title-container flex-col\">\n\t\t\t\t\t\t\t\t\t<div class=\"flex\">\n\t\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'100px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"flex margin-remove margin-top-l font-normal\">\n\t\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'100px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- <span class=\"text-center\"><sb-uic-skeleton-loader [width]=\"'90px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader> </span> -->\n\t\t\t\t\t\t\t<mat-card-footer\n\t\t\t\t\t\t\t\tclass=\"assessment-card-footer col-row padding-l\">\n\t\t\t\t\t\t\t\t<div class=\"flex flex-1 items-center justify-center col-row margin-top-m\">\n\t\t\t\t\t\t\t\t<div class=\"flex margin-right-m\">\n\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'100px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"flex\">\n\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'100px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</mat-card-footer>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</mat-card-content>\n\t\t\t\t</ng-container>\n\t\t\t</div>\n\t\t</a>\n\t</mat-card>\n</ng-template>",
11171
- styles: [".card-assessment{width:100%;min-height:190px;box-sizing:border-box;min-width:335px;margin-top:16px}.image-container{width:155px;height:120px;border-radius:8px;overflow:hidden;border:1px solid rgba(0,0,0,.08)}.title-container{margin-left:12px}.title-text{word-break:break-word;white-space:initial;margin:8px 0;position:relative;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;max-height:48px;font:600 14px/24px Montserrat}.sub-title-text{width:75%;word-break:break-word;white-space:initial;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.course_logo_box{width:38px;height:38px;background:#fff;border-radius:8px;box-sizing:border-box;margin-right:4px;box-shadow:0 2px 1px -1px rgb(0 0 0 / 20%),0 1px 1px 0 rgb(0 0 0 / 14%),0 1px 3px 0 rgb(0 0 0 / 12%)}.course_logo_box img.source-icon{height:28px;width:28px;padding:5px;display:inline-block}.mat-card-footer{margin:0!important}.time-span{padding:2px 8px;color:#fff;border-radius:4px;text-align:center;font-size:12px;background-color:green}span.start-span{border-radius:50px;border:2px solid rgba(0,0,0,.08);font-size:12px;text-align:center;position:absolute;bottom:0;width:140px;left:50%;margin-left:-70px;background-color:#fff;margin-bottom:62px;margin-right:8px}.assessment-card-footer{background:rgba(239,149,30,.16)!important;text-align:center;box-sizing:border-box}.start-btn{background:#1b4ca1!important;color:#fff;font-size:14px;font-weight:600;border-radius:25px;text-align:center;padding:4px 12px}.dots-container{display:none}"]
11182
+ template: "\n<ng-container *ngIf=\"!isCardLoading\">\n\t<ng-container *ngIf=\"!daysFinish\">\n\t<mat-card class=\"card-assessment card-scheduled-assessment card-users-container padding-remove cursor-pointer mr-4\">\n\t<a (click)=\"getRedirectUrlData(widgetData?.content); $event.stopPropagation()\">\n\t\t<div class=\"display-contents\">\n\t\t\t<ng-container *ngIf=\"widgetData\">\n\t\t\t\t<mat-card-content>\n\t\t\t\t\t<div class=\"flex flex-col h-full\">\n\t\t\t\t\t\t<div class=\"flex flex-1 flex-row padding-s\">\n\t\t\t\t\t\t\t<div class=\"flex image-container\">\n\t\t\t\t\t\t\t\t<ng-container *ngIf=\"widgetData?.content?.posterImage\">\n\t\t\t\t\t\t\t\t\t<img mat-card-image class=\"margin-remove assess-img\" [src]=\"widgetData?.content?.posterImage | pipePublicURL\"\n\t\t\t\t\t\t\t\t\t\t[alt]=\"widgetData?.content?.name\">\n\t\t\t\t\t\t\t\t</ng-container>\n\t\t\t\t\t\t\t\t<ng-container *ngIf=\"!widgetData?.content?.posterImage\">\n\t\t\t\t\t\t\t\t\t<ng-template #defaultImg>\n\t\t\t\t\t\t\t\t\t\t<img mat-card-image [src]=\"defaultThumbnail\" loading=\"lazy\"\n\t\t\t\t\t\t\t\t\t\t\tclass=\"card-wide-img ws-mat-primary-lite-background margin-remove assess-img\"\n\t\t\t\t\t\t\t\t\t\t\t[alt]=\"widgetData?.content?.name\" />\n\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t</ng-container>\n\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"flex title-container flex-col\">\n\t\t\t\t\t\t\t\t<div class=\"flex title-text mat-subheading-1\">\n\t\t\t\t\t\t\t\t\t{{ widgetData?.content?.name }}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"flex margin-remove margin-top-s font-normal mat-caption sub-title-text\">\n\t\t\t\t\t\t\t\t\t<div class=\"course_logo_box\">\n\t\t\t\t\t\t\t\t\t\t<img [src]=\"widgetData?.content?.creatorLogo | pipePublicURL \" class=\"source-icon\"\n\t\t\t\t\t\t\t\t\t\t\t[wsUtilsDefaultThumbnail]=\"defaultSLogo\"\n\t\t\t\t\t\t\t\t\t\t\t[alt]=\"(widgetData?.content?.sourceName + '_' + widgetData?.content?.identifier)\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<span class=\"sub-title-text\">\n\t\t\t\t\t\t\t\t\t\t{{ (widgetData?.content?.organisation && widgetData?.content?.organisation[0]) ?\n\t\t\t\t\t\t\t\t\t\twidgetData?.content?.organisation[0] : 'Karmayogi Bharat' }}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class=\"start-span\">Assessment starts in </span>\n\t\t\t\t\t\t<mat-card-footer class=\"assessment-card-footer padding-m\">\n\t\t\t\t\t\t\t<div class=\"flex flex-1 items-center justify-center col-row margin-top-m\">\n\t\t\t\t\t\t\t\t<div class=\"flex margin-right-m\">\n\t\t\t\t\t\t\t\t\t<span *ngIf=\"daysPending\"> {{ startCountdown(widgetData?.content?.batch?.startDate) }}<div id=\"demo\"></div> </span>\n\t\t\t\t\t\t\t\t\t<span *ngIf=\"!daysPending\" class=\"start-btn\"> Start Assessment </span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"flex\">\n\t\t\t\t\t\t\t\t\t<span class=\"time-span flex items-center justify-center\">{{widgetData?.content?.batch?.startDate | date: 'd MMM, y' }}</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</mat-card-footer>\n\t\t\t\t\t</div>\n\t\t\t\t</mat-card-content>\n\t\t\t</ng-container>\n\t\t</div>\n\t</a>\n</mat-card>\n</ng-container>\n</ng-container>\n\n\n\n<ng-container *ngIf=\"isCardLoading\">\n\t<ng-container [ngTemplateOutlet]=\"skeltonLoader\"></ng-container>\n</ng-container>\n\n<ng-template #skeltonLoader>\n\n\t<mat-card class=\"card-assessment card-scheduled-assessment card-users-container padding-remove cursor-pointer mr-4\">\n\t\t<a>\n\t\t\t<div class=\"display-contents\">\n\t\t\t\t<ng-container>\n\t\t\t\t\t<mat-card-content>\n\t\t\t\t\t\t<div class=\"flex flex-col h-full\">\n\t\t\t\t\t\t\t<div class=\"flex flex-1 flex-row padding-s\">\n\t\t\t\t\t\t\t\t<div class=\"flex image-container\">\n\t\t\t\t\t\t\t\t\t<ng-container>\n\t\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'300px'\" [height]=\"'155px'\"\n\t\t\t\t\t\t\t\t\t\t\t></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t\t</ng-container>\n\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"flex title-container flex-col margin-top-m\">\n\t\t\t\t\t\t\t\t\t<div class=\"flex\">\n\t\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'100px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"flex margin-remove margin-top-l font-normal\">\n\t\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'100px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- <span class=\"text-center\"><sb-uic-skeleton-loader [width]=\"'90px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader> </span> -->\n\t\t\t\t\t\t\t<mat-card-footer\n\t\t\t\t\t\t\t\tclass=\"assessment-card-footer col-row padding-l\">\n\t\t\t\t\t\t\t\t<div class=\"flex flex-1 items-center justify-center col-row margin-top-m\">\n\t\t\t\t\t\t\t\t<div class=\"flex margin-right-m\">\n\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'100px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"flex\">\n\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'100px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</mat-card-footer>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</mat-card-content>\n\t\t\t\t</ng-container>\n\t\t\t</div>\n\t\t</a>\n\t</mat-card>\n</ng-template>\n\n",
11183
+ styles: [".card-assessment{width:100%;min-height:190px;box-sizing:border-box;min-width:340px;margin-top:16px;margin-right:12px;border-radius:12px}.image-container{width:145px;height:120px;border-radius:8px;overflow:hidden;border:1px solid rgba(0,0,0,.08)}.image-container img{border-radius:8px;opacity:1;background-size:100%;width:145px!important;height:120px!important;display:flex}.title-container{width:155px;margin-left:12px}.title-text{word-break:break-word;white-space:initial;margin:8px 0;position:relative;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;max-height:48px;font:600 14px/24px Montserrat}.sub-title-text{width:75%;word-break:break-word;white-space:initial;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.course_logo_box{width:38px;height:38px;background:#fff;border-radius:8px;box-sizing:border-box;margin-right:4px;box-shadow:0 2px 1px -1px rgb(0 0 0 / 20%),0 1px 1px 0 rgb(0 0 0 / 14%),0 1px 3px 0 rgb(0 0 0 / 12%)}.course_logo_box img.source-icon{height:28px;width:28px;padding:5px;display:inline-block}.mat-card-footer{margin:0!important}.time-span{padding:2px 8px;color:#fff;border-radius:4px;text-align:center;font-size:12px;background-color:green;width:75px}span.start-span{border-radius:50px;border:2px solid rgba(0,0,0,.08);font-size:12px;text-align:center;position:absolute;bottom:0;width:140px;left:50%;margin-left:-70px;background-color:#fff;margin-bottom:62px;margin-right:8px}.assessment-card-footer{background:rgba(239,149,30,.16)!important;text-align:center;box-sizing:border-box;border-radius:0 0 8px 8px}.start-btn{background:#1b4ca1!important;color:#fff;font-size:14px;font-weight:600;border-radius:25px;text-align:center;padding:4px 12px}.dots-container{display:none}"]
11172
11184
  }] }
11173
11185
  ];
11174
11186
  /** @nocollapse */
@@ -11208,7 +11220,11 @@ if (false) {
11208
11220
  /** @type {?} */
11209
11221
  CardAssessmentComponent.prototype.startDate;
11210
11222
  /** @type {?} */
11223
+ CardAssessmentComponent.prototype.endDate;
11224
+ /** @type {?} */
11211
11225
  CardAssessmentComponent.prototype.daysPending;
11226
+ /** @type {?} */
11227
+ CardAssessmentComponent.prototype.daysFinish;
11212
11228
  /**
11213
11229
  * @type {?}
11214
11230
  * @private
@@ -12388,6 +12404,4171 @@ var WIDGET_REGISTRATION_LIB_CONFIG = [
12388
12404
  }
12389
12405
  ];
12390
12406
 
12407
+ /**
12408
+ * @fileoverview added by tsickle
12409
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
12410
+ */
12411
+ /**
12412
+ * @record
12413
+ */
12414
+ function IStripUnitContentData$1() { }
12415
+ if (false) {
12416
+ /** @type {?} */
12417
+ IStripUnitContentData$1.prototype.key;
12418
+ /** @type {?} */
12419
+ IStripUnitContentData$1.prototype.canHideStrip;
12420
+ /** @type {?|undefined} */
12421
+ IStripUnitContentData$1.prototype.mode;
12422
+ /** @type {?} */
12423
+ IStripUnitContentData$1.prototype.showStrip;
12424
+ /** @type {?} */
12425
+ IStripUnitContentData$1.prototype.disableTranslate;
12426
+ /** @type {?|undefined} */
12427
+ IStripUnitContentData$1.prototype.widgets;
12428
+ /** @type {?} */
12429
+ IStripUnitContentData$1.prototype.stripTitle;
12430
+ /** @type {?|undefined} */
12431
+ IStripUnitContentData$1.prototype.stripTitleLink;
12432
+ /** @type {?|undefined} */
12433
+ IStripUnitContentData$1.prototype.sliderConfig;
12434
+ /** @type {?} */
12435
+ IStripUnitContentData$1.prototype.stripConfig;
12436
+ /** @type {?|undefined} */
12437
+ IStripUnitContentData$1.prototype.tabs;
12438
+ /** @type {?|undefined} */
12439
+ IStripUnitContentData$1.prototype.stripName;
12440
+ /** @type {?|undefined} */
12441
+ IStripUnitContentData$1.prototype.stripLogo;
12442
+ /** @type {?|undefined} */
12443
+ IStripUnitContentData$1.prototype.description;
12444
+ /** @type {?|undefined} */
12445
+ IStripUnitContentData$1.prototype.stripInfo;
12446
+ /** @type {?|undefined} */
12447
+ IStripUnitContentData$1.prototype.noDataWidget;
12448
+ /** @type {?|undefined} */
12449
+ IStripUnitContentData$1.prototype.errorWidget;
12450
+ /** @type {?} */
12451
+ IStripUnitContentData$1.prototype.showOnNoData;
12452
+ /** @type {?} */
12453
+ IStripUnitContentData$1.prototype.showOnLoader;
12454
+ /** @type {?} */
12455
+ IStripUnitContentData$1.prototype.showOnError;
12456
+ /** @type {?|undefined} */
12457
+ IStripUnitContentData$1.prototype.loaderWidgets;
12458
+ /** @type {?|undefined} */
12459
+ IStripUnitContentData$1.prototype.stripBackground;
12460
+ /** @type {?|undefined} */
12461
+ IStripUnitContentData$1.prototype.secondaryHeading;
12462
+ /** @type {?} */
12463
+ IStripUnitContentData$1.prototype.viewMoreUrl;
12464
+ /** @type {?|undefined} */
12465
+ IStripUnitContentData$1.prototype.request;
12466
+ }
12467
+ var ContentStripWithTabsPillsComponent = /** @class */ (function (_super) {
12468
+ __extends(ContentStripWithTabsPillsComponent, _super);
12469
+ function ContentStripWithTabsPillsComponent(
12470
+ // private contentStripSvc: ContentStripNewMultipleService,
12471
+ environment, contentSvc, loggerSvc, eventSvc, configSvc, utilitySvc, router, userSvc, translate, langtranslations) {
12472
+ var _this = _super.call(this) || this;
12473
+ _this.contentSvc = contentSvc;
12474
+ _this.loggerSvc = loggerSvc;
12475
+ _this.eventSvc = eventSvc;
12476
+ _this.configSvc = configSvc;
12477
+ _this.utilitySvc = utilitySvc;
12478
+ _this.router = router;
12479
+ _this.userSvc = userSvc;
12480
+ _this.translate = translate;
12481
+ _this.langtranslations = langtranslations;
12482
+ _this.emptyResponse = new EventEmitter();
12483
+ _this.viewAllResponse = new EventEmitter();
12484
+ _this.telemtryResponse = new EventEmitter();
12485
+ _this.providerId = '';
12486
+ _this.emitViewAll = false;
12487
+ _this.channnelName = '';
12488
+ _this.id = "ws-strip-miltiple_" + Math.random();
12489
+ _this.stripsResultDataMap = {};
12490
+ _this.stripsKeyOrder = [];
12491
+ _this.showAccordionData = true;
12492
+ _this.showParentLoader = false;
12493
+ _this.showParentError = false;
12494
+ _this.showParentNoData = false;
12495
+ _this.errorDataCount = 0;
12496
+ _this.noDataCount = 0;
12497
+ _this.successDataCount = 0;
12498
+ _this.contentAvailable = true;
12499
+ _this.baseUrl = _this.configSvc.sitePath || '';
12500
+ _this.veifiedKarmayogi = false;
12501
+ _this.changeEventSubscription = null;
12502
+ _this.defaultMaxWidgets = 12;
12503
+ _this.todaysEvents = [];
12504
+ if (localStorage.getItem('websiteLanguage')) {
12505
+ _this.translate.setDefaultLang('en');
12506
+ /** @type {?} */
12507
+ var lang = JSON.stringify(localStorage.getItem('websiteLanguage'));
12508
+ lang = lang.replace(/\"/g, '');
12509
+ _this.translate.use(lang);
12510
+ }
12511
+ _this.environment = environment;
12512
+ return _this;
12513
+ }
12514
+ /**
12515
+ * @return {?}
12516
+ */
12517
+ ContentStripWithTabsPillsComponent.prototype.ngOnInit = /**
12518
+ * @return {?}
12519
+ */
12520
+ function () {
12521
+ var _this = this;
12522
+ // const url = window.location.href
12523
+ this.initData();
12524
+ this.contentSvc.telemetryData$.subscribe((/**
12525
+ * @param {?} data
12526
+ * @return {?}
12527
+ */
12528
+ function (data) {
12529
+ _this.telemtryResponse.emit(data);
12530
+ }));
12531
+ };
12532
+ /**
12533
+ * @return {?}
12534
+ */
12535
+ ContentStripWithTabsPillsComponent.prototype.ngOnDestroy = /**
12536
+ * @return {?}
12537
+ */
12538
+ function () {
12539
+ if (this.changeEventSubscription) {
12540
+ this.changeEventSubscription.unsubscribe();
12541
+ }
12542
+ };
12543
+ /**
12544
+ * @param {?} key
12545
+ * @return {?}
12546
+ */
12547
+ ContentStripWithTabsPillsComponent.prototype.showAccordion = /**
12548
+ * @param {?} key
12549
+ * @return {?}
12550
+ */
12551
+ function (key) {
12552
+ if (this.utilitySvc.isMobile && this.stripsResultDataMap[key].mode === 'accordion') {
12553
+ return this.showAccordionData;
12554
+ }
12555
+ return true;
12556
+ };
12557
+ /**
12558
+ * @param {?} key
12559
+ * @return {?}
12560
+ */
12561
+ ContentStripWithTabsPillsComponent.prototype.setHiddenForStrip = /**
12562
+ * @param {?} key
12563
+ * @return {?}
12564
+ */
12565
+ function (key) {
12566
+ this.stripsResultDataMap[key].showStrip = false;
12567
+ sessionStorage.setItem("cstrip_" + key, '1');
12568
+ };
12569
+ /**
12570
+ * @private
12571
+ * @param {?} key
12572
+ * @return {?}
12573
+ */
12574
+ ContentStripWithTabsPillsComponent.prototype.getIfStripHidden = /**
12575
+ * @private
12576
+ * @param {?} key
12577
+ * @return {?}
12578
+ */
12579
+ function (key) {
12580
+ /** @type {?} */
12581
+ var storageItem = sessionStorage.getItem("cstrip_" + key);
12582
+ return Boolean(storageItem !== '1');
12583
+ };
12584
+ /**
12585
+ * @private
12586
+ * @return {?}
12587
+ */
12588
+ ContentStripWithTabsPillsComponent.prototype.initData = /**
12589
+ * @private
12590
+ * @return {?}
12591
+ */
12592
+ function () {
12593
+ var e_1, _a;
12594
+ var _this = this;
12595
+ this.stripsKeyOrder = this.widgetData && this.widgetData.strips && this.widgetData.strips.map((/**
12596
+ * @param {?} strip
12597
+ * @return {?}
12598
+ */
12599
+ function (strip) { return strip.key; })) || [];
12600
+ if (this.widgetData.loader && this.widgetData.strips.length) {
12601
+ this.showParentLoader = true;
12602
+ }
12603
+ try {
12604
+ // Fetch the data
12605
+ for (var _b = __values(this.widgetData.strips), _c = _b.next(); !_c.done; _c = _b.next()) {
12606
+ var strip = _c.value;
12607
+ if (this.checkForEmptyWidget(strip)) {
12608
+ this.fetchStripFromRequestData(strip, false);
12609
+ }
12610
+ else {
12611
+ this.processStrip(strip, [], 'done', true, null);
12612
+ }
12613
+ }
12614
+ }
12615
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
12616
+ finally {
12617
+ try {
12618
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
12619
+ }
12620
+ finally { if (e_1) throw e_1.error; }
12621
+ }
12622
+ // Subscription for changes
12623
+ /** @type {?} */
12624
+ var keyAndEvent = this.widgetData.strips
12625
+ .map((/**
12626
+ * @param {?} strip
12627
+ * @return {?}
12628
+ */
12629
+ function (strip) { return ({
12630
+ key: strip.key,
12631
+ type: (strip.refreshEvent && strip.refreshEvent.eventType) || '',
12632
+ from: (strip.refreshEvent && strip.refreshEvent.from.toString()) || '',
12633
+ }); }))
12634
+ .filter((/**
12635
+ * @param {?} __0
12636
+ * @return {?}
12637
+ */
12638
+ function (_a) {
12639
+ var key = _a.key, type = _a.type, from = _a.from;
12640
+ return key && type && from;
12641
+ }));
12642
+ /** @type {?} */
12643
+ var eventTypeSet = new Set(keyAndEvent.map((/**
12644
+ * @param {?} e
12645
+ * @return {?}
12646
+ */
12647
+ function (e) { return e.type; })));
12648
+ this.changeEventSubscription = this.eventSvc.events$
12649
+ .pipe(filter((/**
12650
+ * @param {?} event
12651
+ * @return {?}
12652
+ */
12653
+ function (event) { return eventTypeSet.has(event.eventType); })))
12654
+ .subscribe((/**
12655
+ * @param {?} event
12656
+ * @return {?}
12657
+ */
12658
+ function (event) {
12659
+ keyAndEvent
12660
+ .filter((/**
12661
+ * @param {?} e
12662
+ * @return {?}
12663
+ */
12664
+ function (e) { return e.type === event.eventType && e.from === event.from; }))
12665
+ .map((/**
12666
+ * @param {?} e
12667
+ * @return {?}
12668
+ */
12669
+ function (e) { return e.key; }))
12670
+ .forEach((/**
12671
+ * @param {?} k
12672
+ * @return {?}
12673
+ */
12674
+ function (k) { return _this.fetchStripFromKey(k, false); }));
12675
+ }));
12676
+ };
12677
+ /**
12678
+ * @private
12679
+ * @param {?} key
12680
+ * @param {?=} calculateParentStatus
12681
+ * @return {?}
12682
+ */
12683
+ ContentStripWithTabsPillsComponent.prototype.fetchStripFromKey = /**
12684
+ * @private
12685
+ * @param {?} key
12686
+ * @param {?=} calculateParentStatus
12687
+ * @return {?}
12688
+ */
12689
+ function (key, calculateParentStatus) {
12690
+ if (calculateParentStatus === void 0) { calculateParentStatus = true; }
12691
+ /** @type {?} */
12692
+ var stripData = this.widgetData.strips.find((/**
12693
+ * @param {?} strip
12694
+ * @return {?}
12695
+ */
12696
+ function (strip) { return strip.key === key; }));
12697
+ if (stripData) {
12698
+ this.fetchStripFromRequestData(stripData, calculateParentStatus);
12699
+ }
12700
+ };
12701
+ /**
12702
+ * @param {?} data
12703
+ * @return {?}
12704
+ */
12705
+ ContentStripWithTabsPillsComponent.prototype.isStripShowing = /**
12706
+ * @param {?} data
12707
+ * @return {?}
12708
+ */
12709
+ function (data) {
12710
+ var _this = this;
12711
+ /** @type {?} */
12712
+ var count = 0;
12713
+ if (data && data.key === this.environment.programStripKey && (!data.tabs || !data.tabs.length) &&
12714
+ data.stripTitle === this.environment.programStripName && data.widgets.length > 0) {
12715
+ data.widgets.forEach((/**
12716
+ * @param {?} key
12717
+ * @return {?}
12718
+ */
12719
+ function (key) {
12720
+ if (key && key.widgetData.content.primaryCategory === _this.environment.programStripPrimaryCategory) {
12721
+ count = count + 1;
12722
+ }
12723
+ }));
12724
+ if (count > 0) {
12725
+ data.showStrip = true;
12726
+ }
12727
+ else {
12728
+ data.showStrip = false;
12729
+ }
12730
+ }
12731
+ // console.log('data.key', data, data.key, data.widgets);
12732
+ return data.showStrip;
12733
+ };
12734
+ Object.defineProperty(ContentStripWithTabsPillsComponent.prototype, "isMobile", {
12735
+ get: /**
12736
+ * @return {?}
12737
+ */
12738
+ function () {
12739
+ return this.utilitySvc.isMobile || false;
12740
+ },
12741
+ enumerable: true,
12742
+ configurable: true
12743
+ });
12744
+ /**
12745
+ * @param {?} data
12746
+ * @return {?}
12747
+ */
12748
+ ContentStripWithTabsPillsComponent.prototype.getdata = /**
12749
+ * @param {?} data
12750
+ * @return {?}
12751
+ */
12752
+ function (data) {
12753
+ if (data.stripInfo) {
12754
+ return data.stripInfo.widget;
12755
+ }
12756
+ return {};
12757
+ };
12758
+ /**
12759
+ * @param {?} wData
12760
+ * @param {?} data
12761
+ * @return {?}
12762
+ */
12763
+ ContentStripWithTabsPillsComponent.prototype.checkCondition = /**
12764
+ * @param {?} wData
12765
+ * @param {?} data
12766
+ * @return {?}
12767
+ */
12768
+ function (wData, data) {
12769
+ if (wData.strips[0].stripConfig && wData.strips[0].stripConfig.hideShowAll) {
12770
+ return !wData.strips[0].stripConfig.hideShowAll;
12771
+ }
12772
+ return wData.strips[0].viewMoreUrl && data.widgets && data.widgets.length >= 4;
12773
+ };
12774
+ /**
12775
+ * @param {?} data
12776
+ * @return {?}
12777
+ */
12778
+ ContentStripWithTabsPillsComponent.prototype.checkVisible = /**
12779
+ * @param {?} data
12780
+ * @return {?}
12781
+ */
12782
+ function (data) {
12783
+ return data.stripInfo && data.stripInfo.visibilityMode === 'visible';
12784
+ };
12785
+ /**
12786
+ * @param {?} data
12787
+ * @return {?}
12788
+ */
12789
+ ContentStripWithTabsPillsComponent.prototype.getContineuLearningLenth = /**
12790
+ * @param {?} data
12791
+ * @return {?}
12792
+ */
12793
+ function (data) {
12794
+ return data.widgets ? data.widgets.length : 0;
12795
+ };
12796
+ /**
12797
+ * @param {?} data
12798
+ * @return {?}
12799
+ */
12800
+ ContentStripWithTabsPillsComponent.prototype.getLength = /**
12801
+ * @param {?} data
12802
+ * @return {?}
12803
+ */
12804
+ function (data) {
12805
+ if (!data.tabs || !data.tabs.length) {
12806
+ return data.widgets ? data.widgets.length : 0;
12807
+ }
12808
+ {
12809
+ // if tabs are there check if each tab has widgets and get the tab with max widgets
12810
+ /** @type {?} */
12811
+ var tabWithMaxWidgets_1 = {};
12812
+ data.tabs.forEach((/**
12813
+ * @param {?} tab
12814
+ * @return {?}
12815
+ */
12816
+ function (tab) {
12817
+ if (tab.pillsData && tab.pillsData.length) {
12818
+ tabWithMaxWidgets_1 = tab.pillsData.reduce((/**
12819
+ * @param {?} prev
12820
+ * @param {?} current
12821
+ * @return {?}
12822
+ */
12823
+ function (prev, current) {
12824
+ if (!prev.widgets && !current.widgets) {
12825
+ return current;
12826
+ }
12827
+ if (prev.widgets && current.widgets) {
12828
+ return (prev.widgets.length > current.widgets.length) ? prev : current;
12829
+ }
12830
+ if (current.widgets && !prev.widgets) {
12831
+ return current;
12832
+ }
12833
+ if (!current.widgets && prev.widgets) {
12834
+ return prev;
12835
+ }
12836
+ return current;
12837
+ // return (prev.widgets && current.widgets && (prev.widgets.length > current.widgets.length) ) ? prev : current
12838
+ // tslint:disable-next-line: align
12839
+ }), data.tabs[0]);
12840
+ }
12841
+ }));
12842
+ // if tabs has atleast 1 widgets then strip will show or else not
12843
+ return tabWithMaxWidgets_1.widgets ? tabWithMaxWidgets_1.widgets.length : 0;
12844
+ }
12845
+ };
12846
+ /**
12847
+ * @private
12848
+ * @param {?} v6filters
12849
+ * @return {?}
12850
+ */
12851
+ ContentStripWithTabsPillsComponent.prototype.getFiltersFromArray = /**
12852
+ * @private
12853
+ * @param {?} v6filters
12854
+ * @return {?}
12855
+ */
12856
+ function (v6filters) {
12857
+ /** @type {?} */
12858
+ var filters = {};
12859
+ if (v6filters.constructor === Array) {
12860
+ v6filters.forEach(((/**
12861
+ * @param {?} f
12862
+ * @return {?}
12863
+ */
12864
+ function (f) {
12865
+ Object.keys(f).forEach((/**
12866
+ * @param {?} key
12867
+ * @return {?}
12868
+ */
12869
+ function (key) {
12870
+ filters[key] = f[key];
12871
+ }));
12872
+ })));
12873
+ return filters;
12874
+ }
12875
+ return v6filters;
12876
+ };
12877
+ /**
12878
+ * @private
12879
+ * @param {?} v6filters
12880
+ * @return {?}
12881
+ */
12882
+ ContentStripWithTabsPillsComponent.prototype.transformSearchV6FiltersV2 = /**
12883
+ * @private
12884
+ * @param {?} v6filters
12885
+ * @return {?}
12886
+ */
12887
+ function (v6filters) {
12888
+ /** @type {?} */
12889
+ var filters = {};
12890
+ if (v6filters.constructor === Array) {
12891
+ v6filters.forEach(((/**
12892
+ * @param {?} f
12893
+ * @return {?}
12894
+ */
12895
+ function (f) {
12896
+ Object.keys(f).forEach((/**
12897
+ * @param {?} key
12898
+ * @return {?}
12899
+ */
12900
+ function (key) {
12901
+ filters[key] = f[key];
12902
+ }));
12903
+ })));
12904
+ return filters;
12905
+ }
12906
+ return v6filters;
12907
+ };
12908
+ /**
12909
+ * @param {?} filters
12910
+ * @return {?}
12911
+ */
12912
+ ContentStripWithTabsPillsComponent.prototype.checkForDateFilters = /**
12913
+ * @param {?} filters
12914
+ * @return {?}
12915
+ */
12916
+ function (filters) {
12917
+ /** @type {?} */
12918
+ var userData;
12919
+ if (this.configSvc.userProfile) {
12920
+ userData = this.configSvc.userProfile;
12921
+ }
12922
+ if (filters && filters.hasOwnProperty('batches.endDate')) {
12923
+ // tslint:disable-next-line
12924
+ filters['batches.endDate']['>='] = eval(filters['batches.endDate']['>=']);
12925
+ }
12926
+ else if (filters && filters.hasOwnProperty('batches.enrollmentEndDate')) {
12927
+ // tslint:disable-next-line
12928
+ filters['batches.enrollmentEndDate']['>='] = eval(filters['batches.enrollmentEndDate']['>=']);
12929
+ }
12930
+ else if (filters.organisation &&
12931
+ filters.organisation.indexOf('<orgID>') >= 0) {
12932
+ if (this.providerId) {
12933
+ filters.organisation = this.providerId;
12934
+ }
12935
+ else {
12936
+ filters.organisation = userData && userData.rootOrgId;
12937
+ if (filters && filters.hasOwnProperty('designation')) {
12938
+ filters.designation = userData.professionalDetails.length > 0 ?
12939
+ userData.professionalDetails[0].designation : '';
12940
+ }
12941
+ }
12942
+ }
12943
+ return filters;
12944
+ };
12945
+ /**
12946
+ * @private
12947
+ * @param {?} strip
12948
+ * @param {?=} calculateParentStatus
12949
+ * @return {?}
12950
+ */
12951
+ ContentStripWithTabsPillsComponent.prototype.fetchStripFromRequestData = /**
12952
+ * @private
12953
+ * @param {?} strip
12954
+ * @param {?=} calculateParentStatus
12955
+ * @return {?}
12956
+ */
12957
+ function (strip, calculateParentStatus) {
12958
+ if (calculateParentStatus === void 0) { calculateParentStatus = true; }
12959
+ // setting initial values
12960
+ strip.loaderWidgets = this.transformSkeletonToWidgets(strip);
12961
+ this.processStrip(strip, [], 'fetching', false, null);
12962
+ this.fetchFromEnrollmentList(strip, calculateParentStatus);
12963
+ this.fetchFromSearchV6(strip, calculateParentStatus);
12964
+ this.fetchFromTrendingContent(strip, calculateParentStatus);
12965
+ this.fetchAllTopContent(strip, calculateParentStatus);
12966
+ this.fetchAllFeaturedContent(strip, calculateParentStatus);
12967
+ this.fetchAllBookMarkData(strip, calculateParentStatus);
12968
+ this.fetchAllPlaylistSearch(strip, calculateParentStatus);
12969
+ this.fetchPlaylistReadData(strip, calculateParentStatus);
12970
+ this.fetchCiosContentData(strip, calculateParentStatus);
12971
+ this.fetchForYouData(strip, calculateParentStatus);
12972
+ this.fetchAllCbpPlans(strip, calculateParentStatus);
12973
+ // this.enrollInterval = setInterval(() => {
12974
+ // this.fetchAllCbpPlans(strip, calculateParentStatus)
12975
+ // }, 1000)
12976
+ };
12977
+ /**
12978
+ * @param {?} strip
12979
+ * @param {?=} calculateParentStatus
12980
+ * @return {?}
12981
+ */
12982
+ ContentStripWithTabsPillsComponent.prototype.fetchFromEnrollmentList = /**
12983
+ * @param {?} strip
12984
+ * @param {?=} calculateParentStatus
12985
+ * @return {?}
12986
+ */
12987
+ function (strip, calculateParentStatus) {
12988
+ var _this = this;
12989
+ if (calculateParentStatus === void 0) { calculateParentStatus = true; }
12990
+ if (strip.request && strip.request.enrollmentList && Object.keys(strip.request.enrollmentList).length) {
12991
+ /** @type {?} */
12992
+ var userId = '';
12993
+ /** @type {?} */
12994
+ var content_1;
12995
+ /** @type {?} */
12996
+ var contentNew_1;
12997
+ /** @type {?} */
12998
+ var tabResults_1 = [];
12999
+ /** @type {?} */
13000
+ var queryParams = get(strip.request.enrollmentList, 'queryParams');
13001
+ if (this.configSvc.userProfile) {
13002
+ userId = this.configSvc.userProfile.userId;
13003
+ }
13004
+ // tslint:disable-next-line: deprecation
13005
+ this.userSvc.fetchUserBatchList(userId, queryParams).subscribe((/**
13006
+ * @param {?} result
13007
+ * @return {?}
13008
+ */
13009
+ function (result) {
13010
+ /** @type {?} */
13011
+ var courses = result && result.courses;
13012
+ /** @type {?} */
13013
+ var showViewMore = Boolean(courses.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch);
13014
+ /** @type {?} */
13015
+ var viewMoreUrl = showViewMore
13016
+ ? {
13017
+ path: (strip.viewMoreUrl && strip.viewMoreUrl.path) || '',
13018
+ queryParams: {
13019
+ q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
13020
+ f: strip.request && strip.request.searchV6 && strip.request.searchV6.filters
13021
+ ? JSON.stringify(
13022
+ // this.searchServSvc.transformSearchV6Filters(
13023
+ strip.request.searchV6.filters
13024
+ // ),
13025
+ )
13026
+ : {},
13027
+ },
13028
+ }
13029
+ : null;
13030
+ if (courses && courses.length) {
13031
+ content_1 = courses.map((/**
13032
+ * @param {?} c
13033
+ * @return {?}
13034
+ */
13035
+ function (c) {
13036
+ /** @type {?} */
13037
+ var contentTemp = c.content;
13038
+ contentTemp.completionPercentage = c.completionPercentage || c.progress || 0;
13039
+ contentTemp.completionStatus = c.completionStatus || c.status || 0;
13040
+ contentTemp.enrolledDate = c.enrolledDate || '';
13041
+ contentTemp.lastContentAccessTime = c.lastContentAccessTime || '';
13042
+ contentTemp.lastReadContentStatus = c.lastReadContentStatus || '';
13043
+ contentTemp.lastReadContentId = c.lastReadContentId || '';
13044
+ contentTemp.lrcProgressDetails = c.lrcProgressDetails || '';
13045
+ contentTemp.issuedCertificates = c.issuedCertificates || [];
13046
+ contentTemp.batchId = c.batchId || '';
13047
+ return contentTemp;
13048
+ }));
13049
+ }
13050
+ // To filter content with completionPercentage > 0,
13051
+ // so that only those content will show in home page
13052
+ // continue learing strip
13053
+ // if (content && content.length) {
13054
+ // contentNew = content.filter((c: any) => {
13055
+ // /** commented as both are 0 after enrolll */
13056
+ // if (c.completionPercentage && c.completionPercentage > 0) {
13057
+ // return c
13058
+ // }
13059
+ // })
13060
+ // }
13061
+ // To sort in descending order of the enrolled date
13062
+ contentNew_1 = (content_1 || []).sort((/**
13063
+ * @param {?} a
13064
+ * @param {?} b
13065
+ * @return {?}
13066
+ */
13067
+ function (a, b) {
13068
+ /** @type {?} */
13069
+ var dateA = new Date(a.lastContentAccessTime || 0);
13070
+ /** @type {?} */
13071
+ var dateB = new Date(b.lastContentAccessTime || 0);
13072
+ return dateB - dateA;
13073
+ }));
13074
+ if (strip.tabs && strip.tabs.length) {
13075
+ tabResults_1 = _this.splitEnrollmentTabsData(contentNew_1, strip);
13076
+ _this.processStrip(strip, _this.transformContentsToWidgets(contentNew_1, strip), 'done', calculateParentStatus, viewMoreUrl, tabResults_1);
13077
+ }
13078
+ else {
13079
+ _this.processStrip(strip, _this.transformContentsToWidgets(contentNew_1, strip), 'done', calculateParentStatus, viewMoreUrl);
13080
+ }
13081
+ }), (/**
13082
+ * @return {?}
13083
+ */
13084
+ function () {
13085
+ _this.processStrip(strip, [], 'error', calculateParentStatus, null);
13086
+ }));
13087
+ }
13088
+ };
13089
+ /**
13090
+ * @param {?} contentNew
13091
+ * @param {?} strip
13092
+ * @return {?}
13093
+ */
13094
+ ContentStripWithTabsPillsComponent.prototype.splitEnrollmentTabsData = /**
13095
+ * @param {?} contentNew
13096
+ * @param {?} strip
13097
+ * @return {?}
13098
+ */
13099
+ function (contentNew, strip) {
13100
+ /** @type {?} */
13101
+ var tabResults = [];
13102
+ /** @type {?} */
13103
+ var splitData = this.getInprogressAndCompleted(contentNew, (/**
13104
+ * @param {?} e
13105
+ * @return {?}
13106
+ */
13107
+ function (e) { return e.completionStatus === 1 || e.completionPercentage < 100; }), strip);
13108
+ if (strip.tabs && strip.tabs.length) {
13109
+ var _loop_1 = function (i) {
13110
+ if (strip.tabs[i]) {
13111
+ tabResults.push(__assign({}, strip.tabs[i], { fetchTabStatus: 'done' }, (splitData.find((/**
13112
+ * @param {?} itmInner
13113
+ * @return {?}
13114
+ */
13115
+ function (itmInner) {
13116
+ if (strip.tabs && strip.tabs[i] && itmInner.value === strip.tabs[i].value) {
13117
+ return itmInner;
13118
+ }
13119
+ return undefined;
13120
+ })))));
13121
+ }
13122
+ };
13123
+ for (var i = 0; i < strip.tabs.length; i += 1) {
13124
+ _loop_1(i);
13125
+ }
13126
+ }
13127
+ return tabResults;
13128
+ };
13129
+ /**
13130
+ * @param {?} array
13131
+ * @param {?} customFilter
13132
+ * @param {?} strip
13133
+ * @return {?}
13134
+ */
13135
+ ContentStripWithTabsPillsComponent.prototype.getInprogressAndCompleted = /**
13136
+ * @param {?} array
13137
+ * @param {?} customFilter
13138
+ * @param {?} strip
13139
+ * @return {?}
13140
+ */
13141
+ function (array, customFilter, strip) {
13142
+ /** @type {?} */
13143
+ var inprogress = [];
13144
+ /** @type {?} */
13145
+ var completed = [];
13146
+ array.forEach((/**
13147
+ * @param {?} e
13148
+ * @param {?} idx
13149
+ * @param {?} arr
13150
+ * @return {?}
13151
+ */
13152
+ function (e, idx, arr) { return (customFilter(e, idx, arr) ? inprogress : completed).push(e); }));
13153
+ return [
13154
+ { value: 'inprogress', widgets: this.transformContentsToWidgets(inprogress, strip) },
13155
+ { value: 'completed', widgets: this.transformContentsToWidgets(completed, strip) }
13156
+ ];
13157
+ };
13158
+ // async fetchFromSearchV6(strip: NsContentStripWithTabs.IContentStripUnit, calculateParentStatus = true) {
13159
+ // if (strip.request && strip.request.searchV6 && Object.keys(strip.request.searchV6).length) {
13160
+ // // if (!(strip.request.searchV6.locale && strip.request.searchV6.locale.length > 0)) {
13161
+ // // if (this.configSvc.activeLocale) {
13162
+ // // strip.request.searchV6.locale = [this.configSvc.activeLocale.locals[0]]
13163
+ // // } else {
13164
+ // // strip.request.searchV6.locale = ['en']
13165
+ // // }
13166
+ // // }
13167
+ // let originalFilters: any = [];
13168
+ // // tslint:disable:no-console
13169
+ // console.log(originalFilters);
13170
+ // if (strip.request &&
13171
+ // strip.request.searchV6 &&
13172
+ // strip.request.searchV6.request &&
13173
+ // strip.request.searchV6.request.filters) {
13174
+ // originalFilters = strip.request.searchV6.request.filters;
13175
+ // strip.request.searchV6.request.filters = this.checkForDateFilters(strip.request.searchV6.request.filters);
13176
+ // strip.request.searchV6.request.filters = this.getFiltersFromArray(
13177
+ // strip.request.searchV6.request.filters,
13178
+ // );
13179
+ // }
13180
+ // if (strip.tabs && strip.tabs.length) {
13181
+ // // TODO: Have to extract requestRequired to outer level of tabs config
13182
+ // const firstTab = strip.tabs[0];
13183
+ // if (firstTab.requestRequired) {
13184
+ // if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
13185
+ // const allTabs = this.stripsResultDataMap[strip.key].tabs;
13186
+ // const currentTabFromMap = (allTabs && allTabs.length && allTabs[0]) as NsContentStripWithTabs.IContentStripTab;
13187
+ // this.getTabDataByNewReqSearchV6(strip, 0, currentTabFromMap, calculateParentStatus);
13188
+ // }
13189
+ // }
13190
+ // } else {
13191
+ // try {
13192
+ // const response = await this.searchV6Request(strip, strip.request, calculateParentStatus);
13193
+ // // console.log('calling after - response, ', response)
13194
+ // if (response && response.results) {
13195
+ // // console.log('calling after-- ')
13196
+ // if (response.results.result.content) {
13197
+ // if(strip.key === 'scheduledAssessment') {
13198
+ // this.enrollInterval = setInterval(() => {
13199
+ // this.checkInvitOnlyAssessments(response.results.result.content, strip, calculateParentStatus, response.viewMoreUrl)
13200
+ // // tslint:disable-next-line
13201
+ // }, 1000)
13202
+ // } else {
13203
+ // this.processStrip(
13204
+ // strip,
13205
+ // this.transformContentsToWidgets(response.results.result.content, strip),
13206
+ // 'done',
13207
+ // calculateParentStatus,
13208
+ // response.viewMoreUrl,
13209
+ // );
13210
+ // }
13211
+ // } else if (response.results.result.Event) {
13212
+ // this.processStrip(
13213
+ // strip,
13214
+ // this.transformEventsToWidgets(response.results.result.Event, strip),
13215
+ // 'done',
13216
+ // calculateParentStatus,
13217
+ // response.viewMoreUrl,
13218
+ // );
13219
+ // } else {
13220
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
13221
+ // }
13222
+ // } else {
13223
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
13224
+ // }
13225
+ // } catch (error) {
13226
+ // // Handle errors
13227
+ // // console.error('Error:', error);
13228
+ // }
13229
+ // }
13230
+ // }
13231
+ // }
13232
+ // async fetchFromSearchV6(strip: NsContentStripWithTabs.IContentStripUnit, calculateParentStatus = true) {
13233
+ // if (strip.request && strip.request.searchV6 && Object.keys(strip.request.searchV6).length) {
13234
+ // // if (!(strip.request.searchV6.locale && strip.request.searchV6.locale.length > 0)) {
13235
+ // // if (this.configSvc.activeLocale) {
13236
+ // // strip.request.searchV6.locale = [this.configSvc.activeLocale.locals[0]]
13237
+ // // } else {
13238
+ // // strip.request.searchV6.locale = ['en']
13239
+ // // }
13240
+ // // }
13241
+ // let originalFilters: any = [];
13242
+ // // tslint:disable:no-console
13243
+ // console.log(originalFilters);
13244
+ // if (strip.request &&
13245
+ // strip.request.searchV6 &&
13246
+ // strip.request.searchV6.request &&
13247
+ // strip.request.searchV6.request.filters) {
13248
+ // originalFilters = strip.request.searchV6.request.filters;
13249
+ // strip.request.searchV6.request.filters = this.checkForDateFilters(strip.request.searchV6.request.filters);
13250
+ // strip.request.searchV6.request.filters = this.getFiltersFromArray(
13251
+ // strip.request.searchV6.request.filters,
13252
+ // );
13253
+ // }
13254
+ // if (strip.tabs && strip.tabs.length) {
13255
+ // // TODO: Have to extract requestRequired to outer level of tabs config
13256
+ // const firstTab = strip.tabs[0];
13257
+ // if (firstTab.requestRequired) {
13258
+ // if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
13259
+ // const allTabs = this.stripsResultDataMap[strip.key].tabs;
13260
+ // const currentTabFromMap = (allTabs && allTabs.length && allTabs[0]) as NsContentStripWithTabs.IContentStripTab;
13261
+ // this.getTabDataByNewReqSearchV6(strip, 0, currentTabFromMap, calculateParentStatus);
13262
+ // }
13263
+ // }
13264
+ // } else {
13265
+ // try {
13266
+ // const response = await this.searchV6Request(strip, strip.request, calculateParentStatus);
13267
+ // // console.log('calling after - response, ', response)
13268
+ // if (response && response.results) {
13269
+ // // console.log('calling after-- ')
13270
+ // if (response.results.result.content) {
13271
+ // if(strip.key === 'scheduledAssessment') {
13272
+ // this.enrollInterval = setInterval(() => {
13273
+ // this.checkInvitOnlyAssessments(response.results.result.content, strip, calculateParentStatus, response.viewMoreUrl)
13274
+ // // tslint:disable-next-line
13275
+ // }, 1000)
13276
+ // } else {
13277
+ // this.processStrip(
13278
+ // strip,
13279
+ // this.transformContentsToWidgets(response.results.result.content, strip),
13280
+ // 'done',
13281
+ // calculateParentStatus,
13282
+ // response.viewMoreUrl,
13283
+ // );
13284
+ // }
13285
+ // } else if (response.results.result.Event) {
13286
+ // this.processStrip(
13287
+ // strip,
13288
+ // this.transformEventsToWidgets(response.results.result.Event, strip),
13289
+ // 'done',
13290
+ // calculateParentStatus,
13291
+ // response.viewMoreUrl,
13292
+ // );
13293
+ // } else {
13294
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
13295
+ // }
13296
+ // } else {
13297
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
13298
+ // }
13299
+ // } catch (error) {
13300
+ // // Handle errors
13301
+ // // console.error('Error:', error);
13302
+ // }
13303
+ // }
13304
+ // }
13305
+ // }
13306
+ /**
13307
+ * @param {?} content
13308
+ * @param {?} strip
13309
+ * @param {?} calculateParentStatus
13310
+ * @param {?} viewMoreUrl
13311
+ * @return {?}
13312
+ */
13313
+ ContentStripWithTabsPillsComponent.prototype.checkInvitOnlyAssessments =
13314
+ // async fetchFromSearchV6(strip: NsContentStripWithTabs.IContentStripUnit, calculateParentStatus = true) {
13315
+ // if (strip.request && strip.request.searchV6 && Object.keys(strip.request.searchV6).length) {
13316
+ // // if (!(strip.request.searchV6.locale && strip.request.searchV6.locale.length > 0)) {
13317
+ // // if (this.configSvc.activeLocale) {
13318
+ // // strip.request.searchV6.locale = [this.configSvc.activeLocale.locals[0]]
13319
+ // // } else {
13320
+ // // strip.request.searchV6.locale = ['en']
13321
+ // // }
13322
+ // // }
13323
+ // let originalFilters: any = [];
13324
+ // // tslint:disable:no-console
13325
+ // console.log(originalFilters);
13326
+ // if (strip.request &&
13327
+ // strip.request.searchV6 &&
13328
+ // strip.request.searchV6.request &&
13329
+ // strip.request.searchV6.request.filters) {
13330
+ // originalFilters = strip.request.searchV6.request.filters;
13331
+ // strip.request.searchV6.request.filters = this.checkForDateFilters(strip.request.searchV6.request.filters);
13332
+ // strip.request.searchV6.request.filters = this.getFiltersFromArray(
13333
+ // strip.request.searchV6.request.filters,
13334
+ // );
13335
+ // }
13336
+ // if (strip.tabs && strip.tabs.length) {
13337
+ // // TODO: Have to extract requestRequired to outer level of tabs config
13338
+ // const firstTab = strip.tabs[0];
13339
+ // if (firstTab.requestRequired) {
13340
+ // if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
13341
+ // const allTabs = this.stripsResultDataMap[strip.key].tabs;
13342
+ // const currentTabFromMap = (allTabs && allTabs.length && allTabs[0]) as NsContentStripWithTabs.IContentStripTab;
13343
+ // this.getTabDataByNewReqSearchV6(strip, 0, currentTabFromMap, calculateParentStatus);
13344
+ // }
13345
+ // }
13346
+ // } else {
13347
+ // try {
13348
+ // const response = await this.searchV6Request(strip, strip.request, calculateParentStatus);
13349
+ // // console.log('calling after - response, ', response)
13350
+ // if (response && response.results) {
13351
+ // // console.log('calling after-- ')
13352
+ // if (response.results.result.content) {
13353
+ // if(strip.key === 'scheduledAssessment') {
13354
+ // this.enrollInterval = setInterval(() => {
13355
+ // this.checkInvitOnlyAssessments(response.results.result.content, strip, calculateParentStatus, response.viewMoreUrl)
13356
+ // // tslint:disable-next-line
13357
+ // }, 1000)
13358
+ // } else {
13359
+ // this.processStrip(
13360
+ // strip,
13361
+ // this.transformContentsToWidgets(response.results.result.content, strip),
13362
+ // 'done',
13363
+ // calculateParentStatus,
13364
+ // response.viewMoreUrl,
13365
+ // );
13366
+ // }
13367
+ // } else if (response.results.result.Event) {
13368
+ // this.processStrip(
13369
+ // strip,
13370
+ // this.transformEventsToWidgets(response.results.result.Event, strip),
13371
+ // 'done',
13372
+ // calculateParentStatus,
13373
+ // response.viewMoreUrl,
13374
+ // );
13375
+ // } else {
13376
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
13377
+ // }
13378
+ // } else {
13379
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
13380
+ // }
13381
+ // } catch (error) {
13382
+ // // Handle errors
13383
+ // // console.error('Error:', error);
13384
+ // }
13385
+ // }
13386
+ // }
13387
+ // }
13388
+ /**
13389
+ * @param {?} content
13390
+ * @param {?} strip
13391
+ * @param {?} calculateParentStatus
13392
+ * @param {?} viewMoreUrl
13393
+ * @return {?}
13394
+ */
13395
+ function (content, strip, calculateParentStatus, viewMoreUrl) {
13396
+ var _this = this;
13397
+ if (localStorage.getItem('enrollmentMapData')) {
13398
+ this.enrollmentMapData = JSON.parse(localStorage.getItem('enrollmentMapData') || '{}');
13399
+ /** @type {?} */
13400
+ var filteredArray_1 = [];
13401
+ content.forEach((/**
13402
+ * @param {?} data
13403
+ * @return {?}
13404
+ */
13405
+ function (data) {
13406
+ if (_this.enrollmentMapData[data.identifier]) {
13407
+ data['batch'] = _this.enrollmentMapData[data.identifier].batch;
13408
+ data['completionPercentage'] = _this.enrollmentMapData[data.identifier].completionPercentage;
13409
+ filteredArray_1.push(data);
13410
+ }
13411
+ }));
13412
+ this.processStrip(strip, this.transformContentsToWidgets(filteredArray_1, strip), 'done', calculateParentStatus, viewMoreUrl);
13413
+ clearInterval(this.enrollInterval);
13414
+ }
13415
+ };
13416
+ // async searchV6Request(strip: NsContentStripWithTabs.IContentStripUnit,
13417
+ // request: NsContentStripWithTabs.IContentStripUnit['request'],
13418
+ // calculateParentStatus: boolean
13419
+ // ): Promise<any> {
13420
+ // const originalFilters: any = [];
13421
+ // return new Promise<any>((resolve, reject) => {
13422
+ // if (request && request.searchV6) {
13423
+ // this.contentSvc.searchV6(request.searchV6).subscribe(results => {
13424
+ // const showViewMore = Boolean(
13425
+ // results.result.content && results.result.content.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch,
13426
+ // );
13427
+ // const viewMoreUrl = showViewMore
13428
+ // ? {
13429
+ // path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
13430
+ // queryParams: {
13431
+ // tab: 'Learn',
13432
+ // q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
13433
+ // f:
13434
+ // request &&
13435
+ // request.searchV6 &&
13436
+ // request.searchV6.request &&
13437
+ // request.searchV6.request.filters
13438
+ // ? JSON.stringify(
13439
+ // this.transformSearchV6FiltersV2(
13440
+ // originalFilters,
13441
+ // )
13442
+ // )
13443
+ // : {},
13444
+ // },
13445
+ // }
13446
+ // : null;
13447
+ // // if (viewMoreUrl && viewMoreUrl.queryParams) {
13448
+ // // viewMoreUrl.queryParams = viewMoreUrl.queryParams
13449
+ // // }
13450
+ // resolve({ results, viewMoreUrl });
13451
+ // }, (error: any) => {
13452
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
13453
+ // reject(error);
13454
+ // },
13455
+ // );
13456
+ // }
13457
+ // });
13458
+ // }
13459
+ // async searchV6Request(strip: NsContentStripWithTabs.IContentStripUnit,
13460
+ // request: NsContentStripWithTabs.IContentStripUnit['request'],
13461
+ // calculateParentStatus: boolean
13462
+ // ): Promise<any> {
13463
+ // const originalFilters: any = [];
13464
+ // return new Promise<any>((resolve, reject) => {
13465
+ // if (request && request.searchV6) {
13466
+ // this.contentSvc.searchV6(request.searchV6).subscribe(results => {
13467
+ // const showViewMore = Boolean(
13468
+ // results.result.content && results.result.content.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch,
13469
+ // );
13470
+ // const viewMoreUrl = showViewMore
13471
+ // ? {
13472
+ // path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
13473
+ // queryParams: {
13474
+ // tab: 'Learn',
13475
+ // q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
13476
+ // f:
13477
+ // request &&
13478
+ // request.searchV6 &&
13479
+ // request.searchV6.request &&
13480
+ // request.searchV6.request.filters
13481
+ // ? JSON.stringify(
13482
+ // this.transformSearchV6FiltersV2(
13483
+ // originalFilters,
13484
+ // )
13485
+ // )
13486
+ // : {},
13487
+ // },
13488
+ // }
13489
+ // : null;
13490
+ // // if (viewMoreUrl && viewMoreUrl.queryParams) {
13491
+ // // viewMoreUrl.queryParams = viewMoreUrl.queryParams
13492
+ // // }
13493
+ // resolve({ results, viewMoreUrl });
13494
+ // }, (error: any) => {
13495
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
13496
+ // reject(error);
13497
+ // },
13498
+ // );
13499
+ // }
13500
+ // });
13501
+ // }
13502
+ /**
13503
+ * @param {?} strip
13504
+ * @param {?=} calculateParentStatus
13505
+ * @return {?}
13506
+ */
13507
+ ContentStripWithTabsPillsComponent.prototype.fetchFromTrendingContent =
13508
+ // async searchV6Request(strip: NsContentStripWithTabs.IContentStripUnit,
13509
+ // request: NsContentStripWithTabs.IContentStripUnit['request'],
13510
+ // calculateParentStatus: boolean
13511
+ // ): Promise<any> {
13512
+ // const originalFilters: any = [];
13513
+ // return new Promise<any>((resolve, reject) => {
13514
+ // if (request && request.searchV6) {
13515
+ // this.contentSvc.searchV6(request.searchV6).subscribe(results => {
13516
+ // const showViewMore = Boolean(
13517
+ // results.result.content && results.result.content.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch,
13518
+ // );
13519
+ // const viewMoreUrl = showViewMore
13520
+ // ? {
13521
+ // path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
13522
+ // queryParams: {
13523
+ // tab: 'Learn',
13524
+ // q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
13525
+ // f:
13526
+ // request &&
13527
+ // request.searchV6 &&
13528
+ // request.searchV6.request &&
13529
+ // request.searchV6.request.filters
13530
+ // ? JSON.stringify(
13531
+ // this.transformSearchV6FiltersV2(
13532
+ // originalFilters,
13533
+ // )
13534
+ // )
13535
+ // : {},
13536
+ // },
13537
+ // }
13538
+ // : null;
13539
+ // // if (viewMoreUrl && viewMoreUrl.queryParams) {
13540
+ // // viewMoreUrl.queryParams = viewMoreUrl.queryParams
13541
+ // // }
13542
+ // resolve({ results, viewMoreUrl });
13543
+ // }, (error: any) => {
13544
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
13545
+ // reject(error);
13546
+ // },
13547
+ // );
13548
+ // }
13549
+ // });
13550
+ // }
13551
+ /**
13552
+ * @param {?} strip
13553
+ * @param {?=} calculateParentStatus
13554
+ * @return {?}
13555
+ */
13556
+ function (strip, calculateParentStatus) {
13557
+ if (calculateParentStatus === void 0) { calculateParentStatus = true; }
13558
+ return __awaiter(this, void 0, void 0, function () {
13559
+ var originalFilters, firstTab, allTabs, currentTabFromMap, response, content, error_1;
13560
+ return __generator(this, function (_a) {
13561
+ switch (_a.label) {
13562
+ case 0:
13563
+ if (!(strip.request && strip.request.trendingSearch && Object.keys(strip.request.trendingSearch).length)) return [3 /*break*/, 4];
13564
+ // if (!(strip.request.searchV6.locale && strip.request.searchV6.locale.length > 0)) {
13565
+ // if (this.configSvc.activeLocale) {
13566
+ // strip.request.searchV6.locale = [this.configSvc.activeLocale.locals[0]]
13567
+ // } else {
13568
+ // strip.request.searchV6.locale = ['en']
13569
+ // }
13570
+ // }
13571
+ originalFilters = [];
13572
+ // tslint:disable:no-console
13573
+ if (strip.request &&
13574
+ strip.request.trendingSearch &&
13575
+ strip.request.trendingSearch.request &&
13576
+ strip.request.trendingSearch.request.filters) {
13577
+ originalFilters = strip.request.trendingSearch.request.filters;
13578
+ strip.request.trendingSearch.request.filters = this.checkForDateFilters(strip.request.trendingSearch.request.filters);
13579
+ strip.request.trendingSearch.request.filters = this.getFiltersFromArray(strip.request.trendingSearch.request.filters);
13580
+ }
13581
+ if (!(strip.tabs && strip.tabs.length)) return [3 /*break*/, 1];
13582
+ // TODO: Have to extract requestRequired to outer level of tabs config
13583
+ firstTab = strip.tabs[0];
13584
+ if (firstTab.requestRequired) {
13585
+ if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
13586
+ allTabs = this.stripsResultDataMap[strip.key].tabs;
13587
+ currentTabFromMap = (/** @type {?} */ ((allTabs && allTabs.length && allTabs[0])));
13588
+ this.getTabDataByNewReqTrending(strip, 0, 0, currentTabFromMap, calculateParentStatus);
13589
+ }
13590
+ }
13591
+ return [3 /*break*/, 4];
13592
+ case 1:
13593
+ _a.trys.push([1, 3, , 4]);
13594
+ return [4 /*yield*/, this.trendingSearchRequest(strip, strip.request, calculateParentStatus)];
13595
+ case 2:
13596
+ response = _a.sent();
13597
+ if (response && response.results && response.results.response) {
13598
+ content = response.results.response[strip.request.trendingSearch.responseKey] || [];
13599
+ this.processStrip(strip, this.transformContentsToWidgets(content, strip), 'done', calculateParentStatus, response.viewMoreUrl || '');
13600
+ if (!content.length) {
13601
+ this.emptyResponse.emit(true);
13602
+ }
13603
+ }
13604
+ else {
13605
+ this.emptyResponse.emit(true);
13606
+ this.processStrip(strip, [], 'done', calculateParentStatus, null);
13607
+ }
13608
+ return [3 /*break*/, 4];
13609
+ case 3:
13610
+ error_1 = _a.sent();
13611
+ // Handle errors
13612
+ this.emptyResponse.emit(true);
13613
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
13614
+ return [3 /*break*/, 4];
13615
+ case 4: return [2 /*return*/];
13616
+ }
13617
+ });
13618
+ });
13619
+ };
13620
+ // async trendingSearchRequest(strip: NsContentStripWithTabs.IContentStripUnit,
13621
+ // request: NsContentStripWithTabs.IContentStripUnit['request'],
13622
+ // calculateParentStatus: boolean
13623
+ // ): Promise<any> {
13624
+ // const originalFilters: any = [];
13625
+ // return new Promise<any>((resolve, reject) => {
13626
+ // if (request && request.trendingSearch) {
13627
+ // // check for the request if it has dynamic values]
13628
+ // if (request.trendingSearch.request.filters.organisation &&
13629
+ // request.trendingSearch.request.filters.organisation.indexOf('<orgID>') >= 0
13630
+ // ) {
13631
+ // let userRootOrgId;
13632
+ // if (this.configSvc.userProfile) {
13633
+ // userRootOrgId = this.configSvc.userProfile.rootOrgId;
13634
+ // }
13635
+ // request.trendingSearch.request.filters.organisation = userRootOrgId;
13636
+ // }
13637
+ // this.contentSvc.trendingContentSearch(request.trendingSearch).subscribe(results => {
13638
+ // const showViewMore = Boolean(
13639
+ // results.result &&
13640
+ // strip.request &&
13641
+ // results.result[strip.request.trendingSearch.responseKey] &&
13642
+ // results.result[strip.request.trendingSearch.responseKey].length > 5 &&
13643
+ // strip.stripConfig && strip.stripConfig.postCardForSearch,
13644
+ // );
13645
+ // const viewMoreUrl = showViewMore
13646
+ // ? {
13647
+ // path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
13648
+ // queryParams: {
13649
+ // tab: 'Learn',
13650
+ // q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
13651
+ // f:
13652
+ // request &&
13653
+ // request.trendingSearch &&
13654
+ // request.trendingSearch.request &&
13655
+ // request.trendingSearch.request.filters
13656
+ // ? JSON.stringify(
13657
+ // this.transformSearchV6FiltersV2(
13658
+ // originalFilters,
13659
+ // )
13660
+ // )
13661
+ // : {},
13662
+ // },
13663
+ // }
13664
+ // : null;
13665
+ // let proccesedResult: any = []
13666
+ // if (results && results.response && results.response.certifications) {
13667
+ // results.response.certifications.map((result: any) => {
13668
+ // if (result.source === this.channnelName) {
13669
+ // proccesedResult.push(result)
13670
+ // }
13671
+ // })
13672
+ // }
13673
+ // results = {response: {certifications: proccesedResult}}
13674
+ // resolve({ results, viewMoreUrl });
13675
+ // }, (error: any) => {
13676
+ // if (error.error && error.error.status === 400) {
13677
+ // this.processStrip(strip, [], 'done', calculateParentStatus, null);
13678
+ // }
13679
+ // // this.processStrip(strip, [], 'done', calculateParentStatus, null)
13680
+ // reject(error);
13681
+ // },
13682
+ // );
13683
+ // }
13684
+ // });
13685
+ // }
13686
+ // async trendingSearchRequest(strip: NsContentStripWithTabs.IContentStripUnit,
13687
+ // request: NsContentStripWithTabs.IContentStripUnit['request'],
13688
+ // calculateParentStatus: boolean
13689
+ // ): Promise<any> {
13690
+ // const originalFilters: any = [];
13691
+ // return new Promise<any>((resolve, reject) => {
13692
+ // if (request && request.trendingSearch) {
13693
+ // // check for the request if it has dynamic values]
13694
+ // if (request.trendingSearch.request.filters.organisation &&
13695
+ // request.trendingSearch.request.filters.organisation.indexOf('<orgID>') >= 0
13696
+ // ) {
13697
+ // let userRootOrgId;
13698
+ // if (this.configSvc.userProfile) {
13699
+ // userRootOrgId = this.configSvc.userProfile.rootOrgId;
13700
+ // }
13701
+ // request.trendingSearch.request.filters.organisation = userRootOrgId;
13702
+ // }
13703
+ // this.contentSvc.trendingContentSearch(request.trendingSearch).subscribe(results => {
13704
+ // const showViewMore = Boolean(
13705
+ // results.result &&
13706
+ // strip.request &&
13707
+ // results.result[strip.request.trendingSearch.responseKey] &&
13708
+ // results.result[strip.request.trendingSearch.responseKey].length > 5 &&
13709
+ // strip.stripConfig && strip.stripConfig.postCardForSearch,
13710
+ // );
13711
+ // const viewMoreUrl = showViewMore
13712
+ // ? {
13713
+ // path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
13714
+ // queryParams: {
13715
+ // tab: 'Learn',
13716
+ // q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
13717
+ // f:
13718
+ // request &&
13719
+ // request.trendingSearch &&
13720
+ // request.trendingSearch.request &&
13721
+ // request.trendingSearch.request.filters
13722
+ // ? JSON.stringify(
13723
+ // this.transformSearchV6FiltersV2(
13724
+ // originalFilters,
13725
+ // )
13726
+ // )
13727
+ // : {},
13728
+ // },
13729
+ // }
13730
+ // : null;
13731
+ // let proccesedResult: any = []
13732
+ // if (results && results.response && results.response.certifications) {
13733
+ // results.response.certifications.map((result: any) => {
13734
+ // if (result.source === this.channnelName) {
13735
+ // proccesedResult.push(result)
13736
+ // }
13737
+ // })
13738
+ // }
13739
+ // results = {response: {certifications: proccesedResult}}
13740
+ // resolve({ results, viewMoreUrl });
13741
+ // }, (error: any) => {
13742
+ // if (error.error && error.error.status === 400) {
13743
+ // this.processStrip(strip, [], 'done', calculateParentStatus, null);
13744
+ // }
13745
+ // // this.processStrip(strip, [], 'done', calculateParentStatus, null)
13746
+ // reject(error);
13747
+ // },
13748
+ // );
13749
+ // }
13750
+ // });
13751
+ // }
13752
+ /**
13753
+ * @param {?} data
13754
+ * @return {?}
13755
+ */
13756
+ ContentStripWithTabsPillsComponent.prototype.toggleInfo =
13757
+ // async trendingSearchRequest(strip: NsContentStripWithTabs.IContentStripUnit,
13758
+ // request: NsContentStripWithTabs.IContentStripUnit['request'],
13759
+ // calculateParentStatus: boolean
13760
+ // ): Promise<any> {
13761
+ // const originalFilters: any = [];
13762
+ // return new Promise<any>((resolve, reject) => {
13763
+ // if (request && request.trendingSearch) {
13764
+ // // check for the request if it has dynamic values]
13765
+ // if (request.trendingSearch.request.filters.organisation &&
13766
+ // request.trendingSearch.request.filters.organisation.indexOf('<orgID>') >= 0
13767
+ // ) {
13768
+ // let userRootOrgId;
13769
+ // if (this.configSvc.userProfile) {
13770
+ // userRootOrgId = this.configSvc.userProfile.rootOrgId;
13771
+ // }
13772
+ // request.trendingSearch.request.filters.organisation = userRootOrgId;
13773
+ // }
13774
+ // this.contentSvc.trendingContentSearch(request.trendingSearch).subscribe(results => {
13775
+ // const showViewMore = Boolean(
13776
+ // results.result &&
13777
+ // strip.request &&
13778
+ // results.result[strip.request.trendingSearch.responseKey] &&
13779
+ // results.result[strip.request.trendingSearch.responseKey].length > 5 &&
13780
+ // strip.stripConfig && strip.stripConfig.postCardForSearch,
13781
+ // );
13782
+ // const viewMoreUrl = showViewMore
13783
+ // ? {
13784
+ // path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
13785
+ // queryParams: {
13786
+ // tab: 'Learn',
13787
+ // q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
13788
+ // f:
13789
+ // request &&
13790
+ // request.trendingSearch &&
13791
+ // request.trendingSearch.request &&
13792
+ // request.trendingSearch.request.filters
13793
+ // ? JSON.stringify(
13794
+ // this.transformSearchV6FiltersV2(
13795
+ // originalFilters,
13796
+ // )
13797
+ // )
13798
+ // : {},
13799
+ // },
13800
+ // }
13801
+ // : null;
13802
+ // let proccesedResult: any = []
13803
+ // if (results && results.response && results.response.certifications) {
13804
+ // results.response.certifications.map((result: any) => {
13805
+ // if (result.source === this.channnelName) {
13806
+ // proccesedResult.push(result)
13807
+ // }
13808
+ // })
13809
+ // }
13810
+ // results = {response: {certifications: proccesedResult}}
13811
+ // resolve({ results, viewMoreUrl });
13812
+ // }, (error: any) => {
13813
+ // if (error.error && error.error.status === 400) {
13814
+ // this.processStrip(strip, [], 'done', calculateParentStatus, null);
13815
+ // }
13816
+ // // this.processStrip(strip, [], 'done', calculateParentStatus, null)
13817
+ // reject(error);
13818
+ // },
13819
+ // );
13820
+ // }
13821
+ // });
13822
+ // }
13823
+ /**
13824
+ * @param {?} data
13825
+ * @return {?}
13826
+ */
13827
+ function (data) {
13828
+ /** @type {?} */
13829
+ var stripInfo = this.stripsResultDataMap[data.key].stripInfo;
13830
+ if (stripInfo) {
13831
+ if (stripInfo.mode !== 'below') {
13832
+ this.loggerSvc.warn("strip info mode: " + stripInfo.mode + " not implemented yet");
13833
+ stripInfo.mode = 'below';
13834
+ }
13835
+ if (stripInfo.mode === 'below') {
13836
+ this.stripsResultDataMap[data.key].stripInfo = __assign({}, stripInfo, { visibilityMode: stripInfo.visibilityMode === 'hidden' ? 'visible' : 'hidden' });
13837
+ }
13838
+ }
13839
+ };
13840
+ /**
13841
+ * @private
13842
+ * @param {?} contents
13843
+ * @param {?} strip
13844
+ * @return {?}
13845
+ */
13846
+ ContentStripWithTabsPillsComponent.prototype.transformContentsToWidgets = /**
13847
+ * @private
13848
+ * @param {?} contents
13849
+ * @param {?} strip
13850
+ * @return {?}
13851
+ */
13852
+ function (contents, strip) {
13853
+ return (contents || []).map((/**
13854
+ * @param {?} content
13855
+ * @param {?} idx
13856
+ * @return {?}
13857
+ */
13858
+ function (content, idx) { return (content ? {
13859
+ widgetType: 'cardLib',
13860
+ widgetSubType: 'cardContentLib',
13861
+ widgetHostClass: 'mb-2',
13862
+ widgetData: __assign({ content: content }, (content.batch && { batch: content.batch }), { cardSubType: strip.stripConfig && strip.stripConfig.cardSubType, cardCustomeClass: strip.customeClass ? strip.customeClass : '', context: { pageSection: strip.key, position: idx }, intranetMode: strip.stripConfig && strip.stripConfig.intranetMode, deletedMode: strip.stripConfig && strip.stripConfig.deletedMode, contentTags: strip.stripConfig && strip.stripConfig.contentTags }),
13863
+ } : {
13864
+ widgetType: 'card',
13865
+ widgetSubType: 'cardContent',
13866
+ widgetHostClass: 'mb-2',
13867
+ widgetData: {},
13868
+ }); }));
13869
+ };
13870
+ /**
13871
+ * @private
13872
+ * @param {?} contents
13873
+ * @param {?} strip
13874
+ * @return {?}
13875
+ */
13876
+ ContentStripWithTabsPillsComponent.prototype.transformEventsToWidgets = /**
13877
+ * @private
13878
+ * @param {?} contents
13879
+ * @param {?} strip
13880
+ * @return {?}
13881
+ */
13882
+ function (contents, strip) {
13883
+ this.eventSvc.setEventListData(contents);
13884
+ return (this.eventSvc.todaysEvents || []).map((/**
13885
+ * @param {?} content
13886
+ * @param {?} idx
13887
+ * @return {?}
13888
+ */
13889
+ function (content, idx) { return (content ? {
13890
+ widgetType: 'card',
13891
+ widgetSubType: 'eventHubCard',
13892
+ widgetHostClass: 'mb-2',
13893
+ widgetData: {
13894
+ content: content,
13895
+ cardSubType: strip.stripConfig && strip.stripConfig.cardSubType,
13896
+ cardCustomeClass: strip.customeClass ? strip.customeClass : '',
13897
+ context: { pageSection: strip.key, position: idx },
13898
+ intranetMode: strip.stripConfig && strip.stripConfig.intranetMode,
13899
+ deletedMode: strip.stripConfig && strip.stripConfig.deletedMode,
13900
+ contentTags: strip.stripConfig && strip.stripConfig.contentTags,
13901
+ },
13902
+ } : {
13903
+ widgetType: 'card',
13904
+ widgetSubType: 'eventHubCard',
13905
+ widgetHostClass: 'mb-2',
13906
+ widgetData: {},
13907
+ }); }));
13908
+ };
13909
+ /**
13910
+ * @private
13911
+ * @param {?} strip
13912
+ * @return {?}
13913
+ */
13914
+ ContentStripWithTabsPillsComponent.prototype.transformSkeletonToWidgets = /**
13915
+ * @private
13916
+ * @param {?} strip
13917
+ * @return {?}
13918
+ */
13919
+ function (strip) {
13920
+ return [1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10].map((/**
13921
+ * @param {?} _content
13922
+ * @return {?}
13923
+ */
13924
+ function (_content) { return ({
13925
+ widgetType: 'cardLib',
13926
+ widgetSubType: 'cardContentLib',
13927
+ widgetHostClass: 'mb-2',
13928
+ widgetData: {
13929
+ cardSubType: strip.loaderConfig && strip.loaderConfig.cardSubType || 'card-standard-skeleton',
13930
+ cardCustomeClass: strip.customeClass ? strip.customeClass : '',
13931
+ },
13932
+ }); }));
13933
+ };
13934
+ /**
13935
+ * @private
13936
+ * @param {?} strip
13937
+ * @param {?=} results
13938
+ * @param {?=} fetchStatus
13939
+ * @param {?=} calculateParentStatus
13940
+ * @param {?=} _viewMoreUrl
13941
+ * @param {?=} tabsResults
13942
+ * @return {?}
13943
+ */
13944
+ ContentStripWithTabsPillsComponent.prototype.processStrip = /**
13945
+ * @private
13946
+ * @param {?} strip
13947
+ * @param {?=} results
13948
+ * @param {?=} fetchStatus
13949
+ * @param {?=} calculateParentStatus
13950
+ * @param {?=} _viewMoreUrl
13951
+ * @param {?=} tabsResults
13952
+ * @return {?}
13953
+ */
13954
+ function (strip, results, fetchStatus, calculateParentStatus, _viewMoreUrl, tabsResults) {
13955
+ if (results === void 0) { results = []; }
13956
+ if (calculateParentStatus === void 0) { calculateParentStatus = true; }
13957
+ return __awaiter(this, void 0, void 0, function () {
13958
+ var stripData;
13959
+ var _a;
13960
+ return __generator(this, function (_b) {
13961
+ stripData = {
13962
+ viewMoreUrl: strip.viewMoreUrl,
13963
+ key: strip.key,
13964
+ canHideStrip: Boolean(strip.canHideStrip),
13965
+ showStrip: this.getIfStripHidden(strip.key),
13966
+ noDataWidget: strip.noDataWidget,
13967
+ errorWidget: strip.errorWidget,
13968
+ stripInfo: strip.info,
13969
+ stripTitle: strip.title,
13970
+ stripTitleLink: strip.stripTitleLink,
13971
+ disableTranslate: strip.disableTranslate,
13972
+ sliderConfig: strip.sliderConfig,
13973
+ tabs: tabsResults ? tabsResults : strip.tabs,
13974
+ stripName: strip.name,
13975
+ mode: strip.mode,
13976
+ stripConfig: strip.stripConfig,
13977
+ stripBackground: strip.stripBackground,
13978
+ secondaryHeading: strip.secondaryHeading,
13979
+ loaderWidgets: strip.loaderWidgets || [],
13980
+ widgets: fetchStatus === 'done'
13981
+ ? __spread((strip.preWidgets || []).map((/**
13982
+ * @param {?} w
13983
+ * @return {?}
13984
+ */
13985
+ function (w) { return (__assign({}, w, { widgetHostClass: "mb-2 " + w.widgetHostClass })); })), results, (strip.postWidgets || []).map((/**
13986
+ * @param {?} w
13987
+ * @return {?}
13988
+ */
13989
+ function (w) { return (__assign({}, w, { widgetHostClass: "mb-2 " + w.widgetHostClass })); }))) : [],
13990
+ showOnNoData: Boolean(strip.noDataWidget &&
13991
+ !((strip.preWidgets || []).length + results.length + (strip.postWidgets || []).length) &&
13992
+ fetchStatus === 'done'),
13993
+ showOnLoader: Boolean(strip.loader && fetchStatus === 'fetching'),
13994
+ showOnError: Boolean(strip.errorWidget && fetchStatus === 'error'),
13995
+ };
13996
+ // const stripData = this.stripsResultDataMap[strip.key]
13997
+ this.stripsResultDataMap = __assign({}, this.stripsResultDataMap, (_a = {}, _a[strip.key] = stripData, _a));
13998
+ if (!tabsResults) {
13999
+ if (calculateParentStatus &&
14000
+ (fetchStatus === 'done' || fetchStatus === 'error') &&
14001
+ stripData.widgets) {
14002
+ this.checkParentStatus(fetchStatus, stripData.widgets.length);
14003
+ }
14004
+ if (calculateParentStatus && !(results && results.length > 0)) {
14005
+ this.contentAvailable = false;
14006
+ }
14007
+ else if (results && results.length > 0) {
14008
+ this.contentAvailable = true;
14009
+ }
14010
+ }
14011
+ else {
14012
+ this.contentAvailable = true;
14013
+ }
14014
+ return [2 /*return*/];
14015
+ });
14016
+ });
14017
+ };
14018
+ /**
14019
+ * @private
14020
+ * @param {?} fetchStatus
14021
+ * @param {?} stripWidgetsCount
14022
+ * @return {?}
14023
+ */
14024
+ ContentStripWithTabsPillsComponent.prototype.checkParentStatus = /**
14025
+ * @private
14026
+ * @param {?} fetchStatus
14027
+ * @param {?} stripWidgetsCount
14028
+ * @return {?}
14029
+ */
14030
+ function (fetchStatus, stripWidgetsCount) {
14031
+ if (fetchStatus === 'done' && !stripWidgetsCount) {
14032
+ this.noDataCount += 1;
14033
+ }
14034
+ else if (fetchStatus === 'done' && stripWidgetsCount) {
14035
+ this.successDataCount += 1;
14036
+ }
14037
+ else if (fetchStatus === 'error') {
14038
+ this.errorDataCount += 1;
14039
+ }
14040
+ /** @type {?} */
14041
+ var settledCount = this.noDataCount + this.successDataCount + this.errorDataCount;
14042
+ /** @type {?} */
14043
+ var totalCount = this.widgetData.strips.length;
14044
+ if (this.successDataCount > 0 && settledCount < totalCount) {
14045
+ return;
14046
+ }
14047
+ this.showParentLoader = settledCount !== totalCount;
14048
+ this.showParentNoData =
14049
+ this.noDataCount > 0 && this.noDataCount + this.errorDataCount === totalCount;
14050
+ this.showParentError = this.errorDataCount === totalCount;
14051
+ };
14052
+ /**
14053
+ * @param {?} strip
14054
+ * @return {?}
14055
+ */
14056
+ ContentStripWithTabsPillsComponent.prototype.checkForEmptyWidget = /**
14057
+ * @param {?} strip
14058
+ * @return {?}
14059
+ */
14060
+ function (strip) {
14061
+ if (strip.request &&
14062
+ ((strip.request.api && Object.keys(strip.request.api).length) ||
14063
+ (strip.request.search && Object.keys(strip.request.search).length) ||
14064
+ (strip.request.searchRegionRecommendation &&
14065
+ Object.keys(strip.request.searchRegionRecommendation).length) ||
14066
+ (strip.request.searchV6 && Object.keys(strip.request.searchV6).length) ||
14067
+ (strip.request.enrollmentList && Object.keys(strip.request.enrollmentList).length) ||
14068
+ (strip.request.cbpList && Object.keys(strip.request.cbpList).length) ||
14069
+ (strip.request.trendingSearch && Object.keys(strip.request.trendingSearch).length) ||
14070
+ (strip.request.topContent && Object.keys(strip.request.topContent).length) ||
14071
+ (strip.request.featureContent && Object.keys(strip.request.featureContent).length) ||
14072
+ (strip.request.bookmarkRead && Object.keys(strip.request.bookmarkRead).length) ||
14073
+ (strip.request.playlistSearch && Object.keys(strip.request.playlistSearch).length) ||
14074
+ (strip.request.playlistRead && Object.keys(strip.request.playlistRead).length) ||
14075
+ (strip.request.ciosContent && Object.keys(strip.request.ciosContent).length) ||
14076
+ (strip && strip.tabs.length))) {
14077
+ return true;
14078
+ }
14079
+ return false;
14080
+ };
14081
+ // public tabClicked(tabEvent: MatTabChangeEvent, stripMap: IStripUnitContentData, stripKey: string) {
14082
+ // if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
14083
+ // stripMap.tabs[tabEvent.index].fetchTabStatus = 'inprogress';
14084
+ // stripMap.tabs[tabEvent.index].tabLoading = true;
14085
+ // stripMap.showOnLoader = true;
14086
+ // }
14087
+ // const data: WsEvents.ITelemetryTabData = {
14088
+ // label: `${tabEvent.tab.textLabel}`,
14089
+ // index: tabEvent.index,
14090
+ // };
14091
+ // this.eventSvc.raiseInteractTelemetry(
14092
+ // {
14093
+ // type: WsEvents.EnumInteractTypes.CLICK,
14094
+ // subType: WsEvents.EnumInteractSubTypes.HOME_PAGE_STRIP_TABS,
14095
+ // id: `${_.camelCase(data.label)}-tab`,
14096
+ // },
14097
+ // {},
14098
+ // {
14099
+ // module: WsEvents.EnumTelemetrymodules.HOME,
14100
+ // }
14101
+ // );
14102
+ // const currentTabFromMap: any = stripMap.tabs && stripMap.tabs[tabEvent.index];
14103
+ // const currentStrip = this.widgetData.strips.find(s => s.key === stripKey);
14104
+ // if (this.stripsResultDataMap[stripKey] && currentTabFromMap) {
14105
+ // this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams = {
14106
+ // ...this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams,
14107
+ // tabSelected: currentTabFromMap.label,
14108
+ // };
14109
+ // }
14110
+ // if (currentStrip && currentTabFromMap && !currentTabFromMap.computeDataOnClick) {
14111
+ // if (currentTabFromMap.requestRequired && currentTabFromMap.request) {
14112
+ // // call API to get tab data and process
14113
+ // // this.processStrip(currentStrip, [], 'fetching', true, null)
14114
+ // if (currentTabFromMap.request.searchV6) {
14115
+ // this.getTabDataByNewReqSearchV6(currentStrip, tabEvent.index, currentTabFromMap, true);
14116
+ // } else if (currentTabFromMap.request.trendingSearch) {
14117
+ // this.getTabDataByNewReqTrending(currentStrip, tabEvent.index, 0, currentTabFromMap, true);
14118
+ // }
14119
+ // if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
14120
+ // stripMap.tabs[tabEvent.index].tabLoading = false;
14121
+ // }
14122
+ // } else {
14123
+ // this.getTabDataByfilter(currentStrip, currentTabFromMap, true);
14124
+ // setTimeout(() => {
14125
+ // if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
14126
+ // stripMap.tabs[tabEvent.index].tabLoading = false;
14127
+ // stripMap.tabs[tabEvent.index].fetchTabStatus = 'done';
14128
+ // stripMap.showOnLoader = false;
14129
+ // }
14130
+ // }, 200);
14131
+ // }
14132
+ // }
14133
+ // }
14134
+ // async getTabDataByNewReqSearchV6(
14135
+ // strip: NsContentStripWithTabs.IContentStripUnit,
14136
+ // tabIndex: number,
14137
+ // currentTab: NsContentStripWithTabs.IContentStripTab,
14138
+ // calculateParentStatus: boolean
14139
+ // ) {
14140
+ // try {
14141
+ // const response = await this.searchV6Request(strip, currentTab.request, calculateParentStatus);
14142
+ // if (response && response.results) {
14143
+ // const widgets = this.transformContentsToWidgets(response.results.result.content, strip);
14144
+ // let tabResults: any[] = [];
14145
+ // if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
14146
+ // const allTabs = this.stripsResultDataMap[strip.key].tabs;
14147
+ // if (allTabs && allTabs.length && allTabs[tabIndex]) {
14148
+ // allTabs[tabIndex] = {
14149
+ // ...allTabs[tabIndex],
14150
+ // widgets,
14151
+ // fetchTabStatus: 'done',
14152
+ // };
14153
+ // tabResults = allTabs;
14154
+ // }
14155
+ // }
14156
+ // this.processStrip(
14157
+ // strip,
14158
+ // widgets,
14159
+ // 'done',
14160
+ // calculateParentStatus,
14161
+ // response.viewMoreUrl,
14162
+ // tabResults // tabResults as widgets
14163
+ // );
14164
+ // } else {
14165
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
14166
+ // }
14167
+ // } catch (error) {
14168
+ // // Handle errors
14169
+ // // console.error('Error:', error);
14170
+ // }
14171
+ // }
14172
+ // async getTabDataByNewReqTrending(
14173
+ // strip: NsContentStripWithTabs.IContentStripUnit,
14174
+ // tabIndex: number,
14175
+ // currentTab: NsContentStripWithTabs.IContentStripTab,
14176
+ // calculateParentStatus: boolean
14177
+ // ) {
14178
+ // try {
14179
+ // const response = await this.trendingSearchRequest(strip, currentTab.request, calculateParentStatus);
14180
+ // if (response && response.results && response.results.response) {
14181
+ // const content = response.results.response[currentTab.value] || [];
14182
+ // const widgets = this.transformContentsToWidgets(content, strip);
14183
+ // // console.log('currentTab --- widgets', widgets)
14184
+ // let tabResults: any[] = [];
14185
+ // if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
14186
+ // const allTabs = this.stripsResultDataMap[strip.key].tabs;
14187
+ // if (allTabs && allTabs.length && allTabs[tabIndex]) {
14188
+ // allTabs[tabIndex] = {
14189
+ // ...allTabs[tabIndex],
14190
+ // widgets,
14191
+ // fetchTabStatus: 'done',
14192
+ // };
14193
+ // tabResults = allTabs;
14194
+ // }
14195
+ // }
14196
+ // // console.log('tabResults -++++***--', tabResults)
14197
+ // // console.log('calling after-- ')
14198
+ // this.processStrip(
14199
+ // strip,
14200
+ // widgets,
14201
+ // 'done',
14202
+ // calculateParentStatus,
14203
+ // response.viewMoreUrl,
14204
+ // tabResults // tabResults as widgets
14205
+ // );
14206
+ // } else {
14207
+ // this.processStrip(strip, [], 'done', calculateParentStatus, null);
14208
+ // }
14209
+ // } catch (error) {
14210
+ // // Handle errors
14211
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
14212
+ // }
14213
+ // }
14214
+ // public tabClicked(tabEvent: MatTabChangeEvent, stripMap: IStripUnitContentData, stripKey: string) {
14215
+ // if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
14216
+ // stripMap.tabs[tabEvent.index].fetchTabStatus = 'inprogress';
14217
+ // stripMap.tabs[tabEvent.index].tabLoading = true;
14218
+ // stripMap.showOnLoader = true;
14219
+ // }
14220
+ // const data: WsEvents.ITelemetryTabData = {
14221
+ // label: `${tabEvent.tab.textLabel}`,
14222
+ // index: tabEvent.index,
14223
+ // };
14224
+ // this.eventSvc.raiseInteractTelemetry(
14225
+ // {
14226
+ // type: WsEvents.EnumInteractTypes.CLICK,
14227
+ // subType: WsEvents.EnumInteractSubTypes.HOME_PAGE_STRIP_TABS,
14228
+ // id: `${_.camelCase(data.label)}-tab`,
14229
+ // },
14230
+ // {},
14231
+ // {
14232
+ // module: WsEvents.EnumTelemetrymodules.HOME,
14233
+ // }
14234
+ // );
14235
+ // const currentTabFromMap: any = stripMap.tabs && stripMap.tabs[tabEvent.index];
14236
+ // const currentStrip = this.widgetData.strips.find(s => s.key === stripKey);
14237
+ // if (this.stripsResultDataMap[stripKey] && currentTabFromMap) {
14238
+ // this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams = {
14239
+ // ...this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams,
14240
+ // tabSelected: currentTabFromMap.label,
14241
+ // };
14242
+ // }
14243
+ // if (currentStrip && currentTabFromMap && !currentTabFromMap.computeDataOnClick) {
14244
+ // if (currentTabFromMap.requestRequired && currentTabFromMap.request) {
14245
+ // // call API to get tab data and process
14246
+ // // this.processStrip(currentStrip, [], 'fetching', true, null)
14247
+ // if (currentTabFromMap.request.searchV6) {
14248
+ // this.getTabDataByNewReqSearchV6(currentStrip, tabEvent.index, currentTabFromMap, true);
14249
+ // } else if (currentTabFromMap.request.trendingSearch) {
14250
+ // this.getTabDataByNewReqTrending(currentStrip, tabEvent.index, 0, currentTabFromMap, true);
14251
+ // }
14252
+ // if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
14253
+ // stripMap.tabs[tabEvent.index].tabLoading = false;
14254
+ // }
14255
+ // } else {
14256
+ // this.getTabDataByfilter(currentStrip, currentTabFromMap, true);
14257
+ // setTimeout(() => {
14258
+ // if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
14259
+ // stripMap.tabs[tabEvent.index].tabLoading = false;
14260
+ // stripMap.tabs[tabEvent.index].fetchTabStatus = 'done';
14261
+ // stripMap.showOnLoader = false;
14262
+ // }
14263
+ // }, 200);
14264
+ // }
14265
+ // }
14266
+ // }
14267
+ // async getTabDataByNewReqSearchV6(
14268
+ // strip: NsContentStripWithTabs.IContentStripUnit,
14269
+ // tabIndex: number,
14270
+ // currentTab: NsContentStripWithTabs.IContentStripTab,
14271
+ // calculateParentStatus: boolean
14272
+ // ) {
14273
+ // try {
14274
+ // const response = await this.searchV6Request(strip, currentTab.request, calculateParentStatus);
14275
+ // if (response && response.results) {
14276
+ // const widgets = this.transformContentsToWidgets(response.results.result.content, strip);
14277
+ // let tabResults: any[] = [];
14278
+ // if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
14279
+ // const allTabs = this.stripsResultDataMap[strip.key].tabs;
14280
+ // if (allTabs && allTabs.length && allTabs[tabIndex]) {
14281
+ // allTabs[tabIndex] = {
14282
+ // ...allTabs[tabIndex],
14283
+ // widgets,
14284
+ // fetchTabStatus: 'done',
14285
+ // };
14286
+ // tabResults = allTabs;
14287
+ // }
14288
+ // }
14289
+ // this.processStrip(
14290
+ // strip,
14291
+ // widgets,
14292
+ // 'done',
14293
+ // calculateParentStatus,
14294
+ // response.viewMoreUrl,
14295
+ // tabResults // tabResults as widgets
14296
+ // );
14297
+ // } else {
14298
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
14299
+ // }
14300
+ // } catch (error) {
14301
+ // // Handle errors
14302
+ // // console.error('Error:', error);
14303
+ // }
14304
+ // }
14305
+ // async getTabDataByNewReqTrending(
14306
+ // strip: NsContentStripWithTabs.IContentStripUnit,
14307
+ // tabIndex: number,
14308
+ // currentTab: NsContentStripWithTabs.IContentStripTab,
14309
+ // calculateParentStatus: boolean
14310
+ // ) {
14311
+ // try {
14312
+ // const response = await this.trendingSearchRequest(strip, currentTab.request, calculateParentStatus);
14313
+ // if (response && response.results && response.results.response) {
14314
+ // const content = response.results.response[currentTab.value] || [];
14315
+ // const widgets = this.transformContentsToWidgets(content, strip);
14316
+ // // console.log('currentTab --- widgets', widgets)
14317
+ // let tabResults: any[] = [];
14318
+ // if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
14319
+ // const allTabs = this.stripsResultDataMap[strip.key].tabs;
14320
+ // if (allTabs && allTabs.length && allTabs[tabIndex]) {
14321
+ // allTabs[tabIndex] = {
14322
+ // ...allTabs[tabIndex],
14323
+ // widgets,
14324
+ // fetchTabStatus: 'done',
14325
+ // };
14326
+ // tabResults = allTabs;
14327
+ // }
14328
+ // }
14329
+ // // console.log('tabResults -++++***--', tabResults)
14330
+ // // console.log('calling after-- ')
14331
+ // this.processStrip(
14332
+ // strip,
14333
+ // widgets,
14334
+ // 'done',
14335
+ // calculateParentStatus,
14336
+ // response.viewMoreUrl,
14337
+ // tabResults // tabResults as widgets
14338
+ // );
14339
+ // } else {
14340
+ // this.processStrip(strip, [], 'done', calculateParentStatus, null);
14341
+ // }
14342
+ // } catch (error) {
14343
+ // // Handle errors
14344
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
14345
+ // }
14346
+ // }
14347
+ /**
14348
+ * @param {?} strip
14349
+ * @param {?} currentTab
14350
+ * @param {?} calculateParentStatus
14351
+ * @return {?}
14352
+ */
14353
+ ContentStripWithTabsPillsComponent.prototype.getTabDataByfilter =
14354
+ // public tabClicked(tabEvent: MatTabChangeEvent, stripMap: IStripUnitContentData, stripKey: string) {
14355
+ // if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
14356
+ // stripMap.tabs[tabEvent.index].fetchTabStatus = 'inprogress';
14357
+ // stripMap.tabs[tabEvent.index].tabLoading = true;
14358
+ // stripMap.showOnLoader = true;
14359
+ // }
14360
+ // const data: WsEvents.ITelemetryTabData = {
14361
+ // label: `${tabEvent.tab.textLabel}`,
14362
+ // index: tabEvent.index,
14363
+ // };
14364
+ // this.eventSvc.raiseInteractTelemetry(
14365
+ // {
14366
+ // type: WsEvents.EnumInteractTypes.CLICK,
14367
+ // subType: WsEvents.EnumInteractSubTypes.HOME_PAGE_STRIP_TABS,
14368
+ // id: `${_.camelCase(data.label)}-tab`,
14369
+ // },
14370
+ // {},
14371
+ // {
14372
+ // module: WsEvents.EnumTelemetrymodules.HOME,
14373
+ // }
14374
+ // );
14375
+ // const currentTabFromMap: any = stripMap.tabs && stripMap.tabs[tabEvent.index];
14376
+ // const currentStrip = this.widgetData.strips.find(s => s.key === stripKey);
14377
+ // if (this.stripsResultDataMap[stripKey] && currentTabFromMap) {
14378
+ // this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams = {
14379
+ // ...this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams,
14380
+ // tabSelected: currentTabFromMap.label,
14381
+ // };
14382
+ // }
14383
+ // if (currentStrip && currentTabFromMap && !currentTabFromMap.computeDataOnClick) {
14384
+ // if (currentTabFromMap.requestRequired && currentTabFromMap.request) {
14385
+ // // call API to get tab data and process
14386
+ // // this.processStrip(currentStrip, [], 'fetching', true, null)
14387
+ // if (currentTabFromMap.request.searchV6) {
14388
+ // this.getTabDataByNewReqSearchV6(currentStrip, tabEvent.index, currentTabFromMap, true);
14389
+ // } else if (currentTabFromMap.request.trendingSearch) {
14390
+ // this.getTabDataByNewReqTrending(currentStrip, tabEvent.index, 0, currentTabFromMap, true);
14391
+ // }
14392
+ // if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
14393
+ // stripMap.tabs[tabEvent.index].tabLoading = false;
14394
+ // }
14395
+ // } else {
14396
+ // this.getTabDataByfilter(currentStrip, currentTabFromMap, true);
14397
+ // setTimeout(() => {
14398
+ // if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
14399
+ // stripMap.tabs[tabEvent.index].tabLoading = false;
14400
+ // stripMap.tabs[tabEvent.index].fetchTabStatus = 'done';
14401
+ // stripMap.showOnLoader = false;
14402
+ // }
14403
+ // }, 200);
14404
+ // }
14405
+ // }
14406
+ // }
14407
+ // async getTabDataByNewReqSearchV6(
14408
+ // strip: NsContentStripWithTabs.IContentStripUnit,
14409
+ // tabIndex: number,
14410
+ // currentTab: NsContentStripWithTabs.IContentStripTab,
14411
+ // calculateParentStatus: boolean
14412
+ // ) {
14413
+ // try {
14414
+ // const response = await this.searchV6Request(strip, currentTab.request, calculateParentStatus);
14415
+ // if (response && response.results) {
14416
+ // const widgets = this.transformContentsToWidgets(response.results.result.content, strip);
14417
+ // let tabResults: any[] = [];
14418
+ // if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
14419
+ // const allTabs = this.stripsResultDataMap[strip.key].tabs;
14420
+ // if (allTabs && allTabs.length && allTabs[tabIndex]) {
14421
+ // allTabs[tabIndex] = {
14422
+ // ...allTabs[tabIndex],
14423
+ // widgets,
14424
+ // fetchTabStatus: 'done',
14425
+ // };
14426
+ // tabResults = allTabs;
14427
+ // }
14428
+ // }
14429
+ // this.processStrip(
14430
+ // strip,
14431
+ // widgets,
14432
+ // 'done',
14433
+ // calculateParentStatus,
14434
+ // response.viewMoreUrl,
14435
+ // tabResults // tabResults as widgets
14436
+ // );
14437
+ // } else {
14438
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
14439
+ // }
14440
+ // } catch (error) {
14441
+ // // Handle errors
14442
+ // // console.error('Error:', error);
14443
+ // }
14444
+ // }
14445
+ // async getTabDataByNewReqTrending(
14446
+ // strip: NsContentStripWithTabs.IContentStripUnit,
14447
+ // tabIndex: number,
14448
+ // currentTab: NsContentStripWithTabs.IContentStripTab,
14449
+ // calculateParentStatus: boolean
14450
+ // ) {
14451
+ // try {
14452
+ // const response = await this.trendingSearchRequest(strip, currentTab.request, calculateParentStatus);
14453
+ // if (response && response.results && response.results.response) {
14454
+ // const content = response.results.response[currentTab.value] || [];
14455
+ // const widgets = this.transformContentsToWidgets(content, strip);
14456
+ // // console.log('currentTab --- widgets', widgets)
14457
+ // let tabResults: any[] = [];
14458
+ // if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
14459
+ // const allTabs = this.stripsResultDataMap[strip.key].tabs;
14460
+ // if (allTabs && allTabs.length && allTabs[tabIndex]) {
14461
+ // allTabs[tabIndex] = {
14462
+ // ...allTabs[tabIndex],
14463
+ // widgets,
14464
+ // fetchTabStatus: 'done',
14465
+ // };
14466
+ // tabResults = allTabs;
14467
+ // }
14468
+ // }
14469
+ // // console.log('tabResults -++++***--', tabResults)
14470
+ // // console.log('calling after-- ')
14471
+ // this.processStrip(
14472
+ // strip,
14473
+ // widgets,
14474
+ // 'done',
14475
+ // calculateParentStatus,
14476
+ // response.viewMoreUrl,
14477
+ // tabResults // tabResults as widgets
14478
+ // );
14479
+ // } else {
14480
+ // this.processStrip(strip, [], 'done', calculateParentStatus, null);
14481
+ // }
14482
+ // } catch (error) {
14483
+ // // Handle errors
14484
+ // this.processStrip(strip, [], 'error', calculateParentStatus, null);
14485
+ // }
14486
+ // }
14487
+ /**
14488
+ * @param {?} strip
14489
+ * @param {?} currentTab
14490
+ * @param {?} calculateParentStatus
14491
+ * @return {?}
14492
+ */
14493
+ function (strip, currentTab, calculateParentStatus) {
14494
+ // tslint:disable:no-console
14495
+ console.log('strip -- ', strip);
14496
+ // tslint:disable:no-console
14497
+ console.log('currentTab -- ', currentTab);
14498
+ // tslint:disable:no-console
14499
+ console.log('calculateParentStatus-- ', calculateParentStatus);
14500
+ // TODO: Write logic for individual filter if passed in config
14501
+ // add switch case based on config key passed
14502
+ };
14503
+ // async fetchAllCbpPlans(strip: any, calculateParentStatus = true) {
14504
+ // if (strip.request && strip.request.cbpList && Object.keys(strip.request.cbpList).length) {
14505
+ // let courses: NsContent.IContent[];
14506
+ // let tabResults: any[] = [];
14507
+ // const response = await this.userSvc.fetchCbpPlanList().toPromise();
14508
+ // if (response) {
14509
+ // courses = response;
14510
+ // if (strip.tabs && strip.tabs.length) {
14511
+ // tabResults = this.splitCbpTabsData(courses, strip);
14512
+ // await this.processStrip(
14513
+ // strip,
14514
+ // this.transformContentsToWidgets(courses, strip),
14515
+ // 'done',
14516
+ // calculateParentStatus,
14517
+ // '',
14518
+ // tabResults
14519
+ // );
14520
+ // } else {
14521
+ // this.processStrip(
14522
+ // strip,
14523
+ // this.transformContentsToWidgets(courses, strip),
14524
+ // 'done',
14525
+ // calculateParentStatus,
14526
+ // 'viewMoreUrl',
14527
+ // );
14528
+ // }
14529
+ // }
14530
+ // // this.userSvc.fetchCbpPlanList().subscribe( async (res: any) => {
14531
+ // // if (res) {
14532
+ // // console.log(res,'===============================>')
14533
+ // // courses = res
14534
+ // // if (strip.tabs && strip.tabs.length) {
14535
+ // // tabResults = this.splitCbpTabsData(courses, strip)
14536
+ // // await this.processStrip(
14537
+ // // strip,
14538
+ // // this.transformContentsToWidgets(courses, strip),
14539
+ // // 'done',
14540
+ // // calculateParentStatus,
14541
+ // // '',
14542
+ // // tabResults
14543
+ // // )
14544
+ // // } else {
14545
+ // // this.processStrip(
14546
+ // // strip,
14547
+ // // this.transformContentsToWidgets(courses, strip),
14548
+ // // 'done',
14549
+ // // calculateParentStatus,
14550
+ // // 'viewMoreUrl',
14551
+ // // )
14552
+ // // }
14553
+ // // }
14554
+ // // }, (_err: any) => {
14555
+ // // })
14556
+ // clearInterval(this.enrollInterval);
14557
+ // }
14558
+ // }
14559
+ // splitCbpTabsData(contentNew: NsContent.IContent[], strip: NsContentStripWithTabs.IContentStripUnit) {
14560
+ // const tabResults: any[] = [];
14561
+ // const splitData = this.getTabsList(
14562
+ // contentNew,
14563
+ // strip,
14564
+ // );
14565
+ // if (strip.tabs && strip.tabs.length) {
14566
+ // for (let i = 0; i < strip.tabs.length; i += 1) {
14567
+ // if (strip.tabs[i]) {
14568
+ // tabResults.push(
14569
+ // {
14570
+ // ...strip.tabs[i],
14571
+ // fetchTabStatus: 'done',
14572
+ // ...(splitData.find(itmInner => {
14573
+ // if (strip.tabs && strip.tabs[i] && itmInner.value === strip.tabs[i].value) {
14574
+ // return itmInner;
14575
+ // }
14576
+ // return undefined;
14577
+ // })),
14578
+ // }
14579
+ // );
14580
+ // }
14581
+ // }
14582
+ // }
14583
+ // return tabResults;
14584
+ // }
14585
+ // getTabsList(array: NsContent.IContent[],
14586
+ // strip: NsContentStripWithTabs.IContentStripUnit) {
14587
+ // let all: any[] = [];
14588
+ // let upcoming: any[] = [];
14589
+ // let overdue: any[] = [];
14590
+ // array.forEach((e: any) => {
14591
+ // all.push(e);
14592
+ // if (e.planDuration === NsCardContent.ACBPConst.OVERDUE) {
14593
+ // overdue.push(e);
14594
+ // } else if (e.planDuration === NsCardContent.ACBPConst.UPCOMING) {
14595
+ // upcoming.push(e);
14596
+ // }
14597
+ // });
14598
+ // const allCompleted = all.filter((allData: any) => allData.contentStatus === 2);
14599
+ // let allInCompleted = all.filter((allData: any) => allData.contentStatus < 2);
14600
+ // let allCompletedOverDue = allCompleted.filter((allData: any) => allData.planDuration === NsCardContent.ACBPConst.OVERDUE);
14601
+ // const allCompletedAll = allCompleted.filter((allData: any) => allData.planDuration !== NsCardContent.ACBPConst.OVERDUE);
14602
+ // allCompletedOverDue = allCompletedOverDue.sort((a: any, b: any): any => {
14603
+ // if (a.planDuration === NsCardContent.ACBPConst.OVERDUE && b.planDuration === NsCardContent.ACBPConst.OVERDUE) {
14604
+ // const firstDate: any = new Date(a.endDate);
14605
+ // const secondDate: any = new Date(b.endDate);
14606
+ // return firstDate > secondDate ? -1 : 1;
14607
+ // }
14608
+ // });
14609
+ // allInCompleted = allInCompleted.sort((a: any, b: any): any => {
14610
+ // if (a.planDuration === NsCardContent.ACBPConst.OVERDUE && b.planDuration === NsCardContent.ACBPConst.OVERDUE) {
14611
+ // const firstDate: any = new Date(a.endDate);
14612
+ // const secondDate: any = new Date(b.endDate);
14613
+ // return firstDate > secondDate ? -1 : 1;
14614
+ // }
14615
+ // });
14616
+ // all = [...allInCompleted, ...allCompletedAll, ...allCompletedOverDue];
14617
+ // overdue = overdue.filter((data: any): any => {
14618
+ // return data.contentStatus < 2;
14619
+ // });
14620
+ // overdue = overdue.sort((a: any, b: any): any => {
14621
+ // const firstDate: any = new Date(a.endDate);
14622
+ // const secondDate: any = new Date(b.endDate);
14623
+ // return firstDate > secondDate ? -1 : 1;
14624
+ // });
14625
+ // upcoming = upcoming.filter((data: any): any => {
14626
+ // return data.contentStatus < 2;
14627
+ // });
14628
+ // // this.getSelectedIndex(1)
14629
+ // return [
14630
+ // { value: 'all', widgets: this.transformContentsToWidgets(all, strip) },
14631
+ // { value: 'upcoming', widgets: this.transformContentsToWidgets(upcoming, strip) },
14632
+ // { value: 'overdue', widgets: this.transformContentsToWidgets(overdue, strip) }];
14633
+ // }
14634
+ // async fetchAllCbpPlans(strip: any, calculateParentStatus = true) {
14635
+ // if (strip.request && strip.request.cbpList && Object.keys(strip.request.cbpList).length) {
14636
+ // let courses: NsContent.IContent[];
14637
+ // let tabResults: any[] = [];
14638
+ // const response = await this.userSvc.fetchCbpPlanList().toPromise();
14639
+ // if (response) {
14640
+ // courses = response;
14641
+ // if (strip.tabs && strip.tabs.length) {
14642
+ // tabResults = this.splitCbpTabsData(courses, strip);
14643
+ // await this.processStrip(
14644
+ // strip,
14645
+ // this.transformContentsToWidgets(courses, strip),
14646
+ // 'done',
14647
+ // calculateParentStatus,
14648
+ // '',
14649
+ // tabResults
14650
+ // );
14651
+ // } else {
14652
+ // this.processStrip(
14653
+ // strip,
14654
+ // this.transformContentsToWidgets(courses, strip),
14655
+ // 'done',
14656
+ // calculateParentStatus,
14657
+ // 'viewMoreUrl',
14658
+ // );
14659
+ // }
14660
+ // }
14661
+ // // this.userSvc.fetchCbpPlanList().subscribe( async (res: any) => {
14662
+ // // if (res) {
14663
+ // // console.log(res,'===============================>')
14664
+ // // courses = res
14665
+ // // if (strip.tabs && strip.tabs.length) {
14666
+ // // tabResults = this.splitCbpTabsData(courses, strip)
14667
+ // // await this.processStrip(
14668
+ // // strip,
14669
+ // // this.transformContentsToWidgets(courses, strip),
14670
+ // // 'done',
14671
+ // // calculateParentStatus,
14672
+ // // '',
14673
+ // // tabResults
14674
+ // // )
14675
+ // // } else {
14676
+ // // this.processStrip(
14677
+ // // strip,
14678
+ // // this.transformContentsToWidgets(courses, strip),
14679
+ // // 'done',
14680
+ // // calculateParentStatus,
14681
+ // // 'viewMoreUrl',
14682
+ // // )
14683
+ // // }
14684
+ // // }
14685
+ // // }, (_err: any) => {
14686
+ // // })
14687
+ // clearInterval(this.enrollInterval);
14688
+ // }
14689
+ // }
14690
+ // splitCbpTabsData(contentNew: NsContent.IContent[], strip: NsContentStripWithTabs.IContentStripUnit) {
14691
+ // const tabResults: any[] = [];
14692
+ // const splitData = this.getTabsList(
14693
+ // contentNew,
14694
+ // strip,
14695
+ // );
14696
+ // if (strip.tabs && strip.tabs.length) {
14697
+ // for (let i = 0; i < strip.tabs.length; i += 1) {
14698
+ // if (strip.tabs[i]) {
14699
+ // tabResults.push(
14700
+ // {
14701
+ // ...strip.tabs[i],
14702
+ // fetchTabStatus: 'done',
14703
+ // ...(splitData.find(itmInner => {
14704
+ // if (strip.tabs && strip.tabs[i] && itmInner.value === strip.tabs[i].value) {
14705
+ // return itmInner;
14706
+ // }
14707
+ // return undefined;
14708
+ // })),
14709
+ // }
14710
+ // );
14711
+ // }
14712
+ // }
14713
+ // }
14714
+ // return tabResults;
14715
+ // }
14716
+ // getTabsList(array: NsContent.IContent[],
14717
+ // strip: NsContentStripWithTabs.IContentStripUnit) {
14718
+ // let all: any[] = [];
14719
+ // let upcoming: any[] = [];
14720
+ // let overdue: any[] = [];
14721
+ // array.forEach((e: any) => {
14722
+ // all.push(e);
14723
+ // if (e.planDuration === NsCardContent.ACBPConst.OVERDUE) {
14724
+ // overdue.push(e);
14725
+ // } else if (e.planDuration === NsCardContent.ACBPConst.UPCOMING) {
14726
+ // upcoming.push(e);
14727
+ // }
14728
+ // });
14729
+ // const allCompleted = all.filter((allData: any) => allData.contentStatus === 2);
14730
+ // let allInCompleted = all.filter((allData: any) => allData.contentStatus < 2);
14731
+ // let allCompletedOverDue = allCompleted.filter((allData: any) => allData.planDuration === NsCardContent.ACBPConst.OVERDUE);
14732
+ // const allCompletedAll = allCompleted.filter((allData: any) => allData.planDuration !== NsCardContent.ACBPConst.OVERDUE);
14733
+ // allCompletedOverDue = allCompletedOverDue.sort((a: any, b: any): any => {
14734
+ // if (a.planDuration === NsCardContent.ACBPConst.OVERDUE && b.planDuration === NsCardContent.ACBPConst.OVERDUE) {
14735
+ // const firstDate: any = new Date(a.endDate);
14736
+ // const secondDate: any = new Date(b.endDate);
14737
+ // return firstDate > secondDate ? -1 : 1;
14738
+ // }
14739
+ // });
14740
+ // allInCompleted = allInCompleted.sort((a: any, b: any): any => {
14741
+ // if (a.planDuration === NsCardContent.ACBPConst.OVERDUE && b.planDuration === NsCardContent.ACBPConst.OVERDUE) {
14742
+ // const firstDate: any = new Date(a.endDate);
14743
+ // const secondDate: any = new Date(b.endDate);
14744
+ // return firstDate > secondDate ? -1 : 1;
14745
+ // }
14746
+ // });
14747
+ // all = [...allInCompleted, ...allCompletedAll, ...allCompletedOverDue];
14748
+ // overdue = overdue.filter((data: any): any => {
14749
+ // return data.contentStatus < 2;
14750
+ // });
14751
+ // overdue = overdue.sort((a: any, b: any): any => {
14752
+ // const firstDate: any = new Date(a.endDate);
14753
+ // const secondDate: any = new Date(b.endDate);
14754
+ // return firstDate > secondDate ? -1 : 1;
14755
+ // });
14756
+ // upcoming = upcoming.filter((data: any): any => {
14757
+ // return data.contentStatus < 2;
14758
+ // });
14759
+ // // this.getSelectedIndex(1)
14760
+ // return [
14761
+ // { value: 'all', widgets: this.transformContentsToWidgets(all, strip) },
14762
+ // { value: 'upcoming', widgets: this.transformContentsToWidgets(upcoming, strip) },
14763
+ // { value: 'overdue', widgets: this.transformContentsToWidgets(overdue, strip) }];
14764
+ // }
14765
+ /**
14766
+ * @param {?} stripsResultDataMap
14767
+ * @param {?} key
14768
+ * @return {?}
14769
+ */
14770
+ ContentStripWithTabsPillsComponent.prototype.getSelectedIndex =
14771
+ // async fetchAllCbpPlans(strip: any, calculateParentStatus = true) {
14772
+ // if (strip.request && strip.request.cbpList && Object.keys(strip.request.cbpList).length) {
14773
+ // let courses: NsContent.IContent[];
14774
+ // let tabResults: any[] = [];
14775
+ // const response = await this.userSvc.fetchCbpPlanList().toPromise();
14776
+ // if (response) {
14777
+ // courses = response;
14778
+ // if (strip.tabs && strip.tabs.length) {
14779
+ // tabResults = this.splitCbpTabsData(courses, strip);
14780
+ // await this.processStrip(
14781
+ // strip,
14782
+ // this.transformContentsToWidgets(courses, strip),
14783
+ // 'done',
14784
+ // calculateParentStatus,
14785
+ // '',
14786
+ // tabResults
14787
+ // );
14788
+ // } else {
14789
+ // this.processStrip(
14790
+ // strip,
14791
+ // this.transformContentsToWidgets(courses, strip),
14792
+ // 'done',
14793
+ // calculateParentStatus,
14794
+ // 'viewMoreUrl',
14795
+ // );
14796
+ // }
14797
+ // }
14798
+ // // this.userSvc.fetchCbpPlanList().subscribe( async (res: any) => {
14799
+ // // if (res) {
14800
+ // // console.log(res,'===============================>')
14801
+ // // courses = res
14802
+ // // if (strip.tabs && strip.tabs.length) {
14803
+ // // tabResults = this.splitCbpTabsData(courses, strip)
14804
+ // // await this.processStrip(
14805
+ // // strip,
14806
+ // // this.transformContentsToWidgets(courses, strip),
14807
+ // // 'done',
14808
+ // // calculateParentStatus,
14809
+ // // '',
14810
+ // // tabResults
14811
+ // // )
14812
+ // // } else {
14813
+ // // this.processStrip(
14814
+ // // strip,
14815
+ // // this.transformContentsToWidgets(courses, strip),
14816
+ // // 'done',
14817
+ // // calculateParentStatus,
14818
+ // // 'viewMoreUrl',
14819
+ // // )
14820
+ // // }
14821
+ // // }
14822
+ // // }, (_err: any) => {
14823
+ // // })
14824
+ // clearInterval(this.enrollInterval);
14825
+ // }
14826
+ // }
14827
+ // splitCbpTabsData(contentNew: NsContent.IContent[], strip: NsContentStripWithTabs.IContentStripUnit) {
14828
+ // const tabResults: any[] = [];
14829
+ // const splitData = this.getTabsList(
14830
+ // contentNew,
14831
+ // strip,
14832
+ // );
14833
+ // if (strip.tabs && strip.tabs.length) {
14834
+ // for (let i = 0; i < strip.tabs.length; i += 1) {
14835
+ // if (strip.tabs[i]) {
14836
+ // tabResults.push(
14837
+ // {
14838
+ // ...strip.tabs[i],
14839
+ // fetchTabStatus: 'done',
14840
+ // ...(splitData.find(itmInner => {
14841
+ // if (strip.tabs && strip.tabs[i] && itmInner.value === strip.tabs[i].value) {
14842
+ // return itmInner;
14843
+ // }
14844
+ // return undefined;
14845
+ // })),
14846
+ // }
14847
+ // );
14848
+ // }
14849
+ // }
14850
+ // }
14851
+ // return tabResults;
14852
+ // }
14853
+ // getTabsList(array: NsContent.IContent[],
14854
+ // strip: NsContentStripWithTabs.IContentStripUnit) {
14855
+ // let all: any[] = [];
14856
+ // let upcoming: any[] = [];
14857
+ // let overdue: any[] = [];
14858
+ // array.forEach((e: any) => {
14859
+ // all.push(e);
14860
+ // if (e.planDuration === NsCardContent.ACBPConst.OVERDUE) {
14861
+ // overdue.push(e);
14862
+ // } else if (e.planDuration === NsCardContent.ACBPConst.UPCOMING) {
14863
+ // upcoming.push(e);
14864
+ // }
14865
+ // });
14866
+ // const allCompleted = all.filter((allData: any) => allData.contentStatus === 2);
14867
+ // let allInCompleted = all.filter((allData: any) => allData.contentStatus < 2);
14868
+ // let allCompletedOverDue = allCompleted.filter((allData: any) => allData.planDuration === NsCardContent.ACBPConst.OVERDUE);
14869
+ // const allCompletedAll = allCompleted.filter((allData: any) => allData.planDuration !== NsCardContent.ACBPConst.OVERDUE);
14870
+ // allCompletedOverDue = allCompletedOverDue.sort((a: any, b: any): any => {
14871
+ // if (a.planDuration === NsCardContent.ACBPConst.OVERDUE && b.planDuration === NsCardContent.ACBPConst.OVERDUE) {
14872
+ // const firstDate: any = new Date(a.endDate);
14873
+ // const secondDate: any = new Date(b.endDate);
14874
+ // return firstDate > secondDate ? -1 : 1;
14875
+ // }
14876
+ // });
14877
+ // allInCompleted = allInCompleted.sort((a: any, b: any): any => {
14878
+ // if (a.planDuration === NsCardContent.ACBPConst.OVERDUE && b.planDuration === NsCardContent.ACBPConst.OVERDUE) {
14879
+ // const firstDate: any = new Date(a.endDate);
14880
+ // const secondDate: any = new Date(b.endDate);
14881
+ // return firstDate > secondDate ? -1 : 1;
14882
+ // }
14883
+ // });
14884
+ // all = [...allInCompleted, ...allCompletedAll, ...allCompletedOverDue];
14885
+ // overdue = overdue.filter((data: any): any => {
14886
+ // return data.contentStatus < 2;
14887
+ // });
14888
+ // overdue = overdue.sort((a: any, b: any): any => {
14889
+ // const firstDate: any = new Date(a.endDate);
14890
+ // const secondDate: any = new Date(b.endDate);
14891
+ // return firstDate > secondDate ? -1 : 1;
14892
+ // });
14893
+ // upcoming = upcoming.filter((data: any): any => {
14894
+ // return data.contentStatus < 2;
14895
+ // });
14896
+ // // this.getSelectedIndex(1)
14897
+ // return [
14898
+ // { value: 'all', widgets: this.transformContentsToWidgets(all, strip) },
14899
+ // { value: 'upcoming', widgets: this.transformContentsToWidgets(upcoming, strip) },
14900
+ // { value: 'overdue', widgets: this.transformContentsToWidgets(overdue, strip) }];
14901
+ // }
14902
+ /**
14903
+ * @param {?} stripsResultDataMap
14904
+ * @param {?} key
14905
+ * @return {?}
14906
+ */
14907
+ function (stripsResultDataMap, key) {
14908
+ /** @type {?} */
14909
+ var returnValue = 0;
14910
+ // if (key === 'cbpPlan') {
14911
+ // if (stripsResultDataMap.tabs.length) {
14912
+ // const data = stripsResultDataMap.tabs.filter((ele: any) => ele.value === 'upcoming');
14913
+ // returnValue = data[0].widgets && data[0].widgets.length > 0 ? 1 : 0;
14914
+ // }
14915
+ // }
14916
+ return returnValue;
14917
+ };
14918
+ /**
14919
+ * @param {?} label
14920
+ * @param {?} type
14921
+ * @return {?}
14922
+ */
14923
+ ContentStripWithTabsPillsComponent.prototype.translateLabels = /**
14924
+ * @param {?} label
14925
+ * @param {?} type
14926
+ * @return {?}
14927
+ */
14928
+ function (label, type) {
14929
+ return this.langtranslations.translateLabel(label, type, '');
14930
+ };
14931
+ /**
14932
+ * @param {?} index
14933
+ * @param {?} item
14934
+ * @return {?}
14935
+ */
14936
+ ContentStripWithTabsPillsComponent.prototype.identify = /**
14937
+ * @param {?} index
14938
+ * @param {?} item
14939
+ * @return {?}
14940
+ */
14941
+ function (index, item) {
14942
+ if (index >= 0) { }
14943
+ return item;
14944
+ };
14945
+ /**
14946
+ * @param {?} index
14947
+ * @param {?} item
14948
+ * @return {?}
14949
+ */
14950
+ ContentStripWithTabsPillsComponent.prototype.tracker = /**
14951
+ * @param {?} index
14952
+ * @param {?} item
14953
+ * @return {?}
14954
+ */
14955
+ function (index, item) {
14956
+ if (index >= 0) { }
14957
+ return get(item, 'widgetData.content.identifier');
14958
+ };
14959
+ /**
14960
+ * @param {?} strip
14961
+ * @param {?=} calculateParentStatus
14962
+ * @return {?}
14963
+ */
14964
+ ContentStripWithTabsPillsComponent.prototype.fetchAllTopContent = /**
14965
+ * @param {?} strip
14966
+ * @param {?=} calculateParentStatus
14967
+ * @return {?}
14968
+ */
14969
+ function (strip, calculateParentStatus) {
14970
+ if (calculateParentStatus === void 0) { calculateParentStatus = true; }
14971
+ return __awaiter(this, void 0, void 0, function () {
14972
+ var originalFilters, response, error_2;
14973
+ return __generator(this, function (_a) {
14974
+ switch (_a.label) {
14975
+ case 0:
14976
+ if (!(strip.request && strip.request.topContent && Object.keys(strip.request.topContent).length)) return [3 /*break*/, 4];
14977
+ originalFilters = [];
14978
+ if (strip.request &&
14979
+ strip.request.topContent &&
14980
+ strip.request.topContent.request &&
14981
+ strip.request.topContent.request.filters) {
14982
+ originalFilters = strip.request.topContent.request.filters;
14983
+ strip.request.topContent.request.filters = this.postMethodFilters(strip.request.topContent.request.filters);
14984
+ }
14985
+ _a.label = 1;
14986
+ case 1:
14987
+ _a.trys.push([1, 3, , 4]);
14988
+ return [4 /*yield*/, this.postRequestMethod(strip, strip.request.topContent, strip.request.apiUrl, calculateParentStatus)];
14989
+ case 2:
14990
+ response = _a.sent();
14991
+ // console.log('calling after - response, ', response)
14992
+ if (response && response.results) {
14993
+ // console.log('calling after-- ')
14994
+ if (response.results.result.content && response.results.result.content.length) {
14995
+ this.processStrip(strip, this.transformContentsToWidgets(response.results.result.content, strip), 'done', calculateParentStatus, response.viewMoreUrl);
14996
+ }
14997
+ else {
14998
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
14999
+ this.emptyResponse.emit(true);
15000
+ }
15001
+ }
15002
+ else {
15003
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
15004
+ this.emptyResponse.emit(true);
15005
+ }
15006
+ return [3 /*break*/, 4];
15007
+ case 3:
15008
+ error_2 = _a.sent();
15009
+ return [3 /*break*/, 4];
15010
+ case 4: return [2 /*return*/];
15011
+ }
15012
+ });
15013
+ });
15014
+ };
15015
+ /**
15016
+ * @param {?} strip
15017
+ * @param {?=} calculateParentStatus
15018
+ * @return {?}
15019
+ */
15020
+ ContentStripWithTabsPillsComponent.prototype.fetchAllFeaturedContent = /**
15021
+ * @param {?} strip
15022
+ * @param {?=} calculateParentStatus
15023
+ * @return {?}
15024
+ */
15025
+ function (strip, calculateParentStatus) {
15026
+ if (calculateParentStatus === void 0) { calculateParentStatus = true; }
15027
+ return __awaiter(this, void 0, void 0, function () {
15028
+ var originalFilters, response, error_3;
15029
+ return __generator(this, function (_a) {
15030
+ switch (_a.label) {
15031
+ case 0:
15032
+ if (!(strip.request && strip.request.featureContent && Object.keys(strip.request.featureContent).length)) return [3 /*break*/, 4];
15033
+ originalFilters = [];
15034
+ if (strip.request &&
15035
+ strip.request.featureContent &&
15036
+ strip.request.featureContent.request &&
15037
+ strip.request.featureContent.request.filters) {
15038
+ originalFilters = strip.request.featureContent.request.filters;
15039
+ strip.request.featureContent.request.filters = this.postMethodFilters(strip.request.featureContent.request.filters);
15040
+ }
15041
+ _a.label = 1;
15042
+ case 1:
15043
+ _a.trys.push([1, 3, , 4]);
15044
+ return [4 /*yield*/, this.postRequestMethod(strip, strip.request.featureContent, strip.request.apiUrl, calculateParentStatus)];
15045
+ case 2:
15046
+ response = _a.sent();
15047
+ // console.log('calling after - response, ', response)
15048
+ if (response && response.results) {
15049
+ // console.log('calling after-- ')
15050
+ if (response.results.result.content && response.results.result.content.length) {
15051
+ this.processStrip(strip, this.transformContentsToWidgets(response.results.result.content, strip), 'done', calculateParentStatus, response.viewMoreUrl);
15052
+ }
15053
+ else {
15054
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
15055
+ this.emptyResponse.emit(true);
15056
+ }
15057
+ }
15058
+ else {
15059
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
15060
+ this.emptyResponse.emit(true);
15061
+ }
15062
+ return [3 /*break*/, 4];
15063
+ case 3:
15064
+ error_3 = _a.sent();
15065
+ this.emptyResponse.emit(true);
15066
+ return [3 /*break*/, 4];
15067
+ case 4: return [2 /*return*/];
15068
+ }
15069
+ });
15070
+ });
15071
+ };
15072
+ /**
15073
+ * @param {?} stripData
15074
+ * @return {?}
15075
+ */
15076
+ ContentStripWithTabsPillsComponent.prototype.raiseTelemetry = /**
15077
+ * @param {?} stripData
15078
+ * @return {?}
15079
+ */
15080
+ function (stripData) {
15081
+ this.telemtryResponse.emit(stripData);
15082
+ };
15083
+ /**
15084
+ * @param {?} strip
15085
+ * @param {?} request
15086
+ * @param {?} apiUrl
15087
+ * @param {?} calculateParentStatus
15088
+ * @return {?}
15089
+ */
15090
+ ContentStripWithTabsPillsComponent.prototype.postRequestMethod = /**
15091
+ * @param {?} strip
15092
+ * @param {?} request
15093
+ * @param {?} apiUrl
15094
+ * @param {?} calculateParentStatus
15095
+ * @return {?}
15096
+ */
15097
+ function (strip, request, apiUrl, calculateParentStatus) {
15098
+ return __awaiter(this, void 0, void 0, function () {
15099
+ var _this = this;
15100
+ return __generator(this, function (_a) {
15101
+ return [2 /*return*/, new Promise((/**
15102
+ * @param {?} resolve
15103
+ * @param {?} reject
15104
+ * @return {?}
15105
+ */
15106
+ function (resolve, reject) {
15107
+ if (request && request) {
15108
+ _this.contentSvc.postApiMethod(apiUrl, request).subscribe((/**
15109
+ * @param {?} results
15110
+ * @return {?}
15111
+ */
15112
+ function (results) {
15113
+ if (results.result && results.result.content) {
15114
+ /** @type {?} */
15115
+ var showViewMore = Boolean(results.result.content && results.result.content.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch);
15116
+ /** @type {?} */
15117
+ var viewMoreUrl = showViewMore
15118
+ ? {
15119
+ path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
15120
+ queryParams: {
15121
+ tab: 'Learn',
15122
+ q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
15123
+ f: {},
15124
+ },
15125
+ }
15126
+ : null;
15127
+ resolve({ results: results, viewMoreUrl: viewMoreUrl });
15128
+ }
15129
+ else if (results && results.data) {
15130
+ /** @type {?} */
15131
+ var showViewMore = Boolean(results.data && results.data.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch);
15132
+ /** @type {?} */
15133
+ var viewMoreUrl = showViewMore ? {
15134
+ path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
15135
+ queryParams: {
15136
+ tab: 'Learn',
15137
+ q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
15138
+ f: {},
15139
+ },
15140
+ }
15141
+ : null;
15142
+ resolve({ results: results, viewMoreUrl: viewMoreUrl });
15143
+ }
15144
+ else if (results.result && results.result.data) {
15145
+ /** @type {?} */
15146
+ var showViewMore = Boolean(results.data && results.result.data && results.result.data.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch);
15147
+ /** @type {?} */
15148
+ var viewMoreUrl = showViewMore ? {
15149
+ path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
15150
+ queryParams: {
15151
+ tab: 'Learn',
15152
+ q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
15153
+ f: {},
15154
+ },
15155
+ }
15156
+ : null;
15157
+ resolve({ results: results, viewMoreUrl: viewMoreUrl });
15158
+ }
15159
+ }), (/**
15160
+ * @param {?} error
15161
+ * @return {?}
15162
+ */
15163
+ function (error) {
15164
+ _this.processStrip(strip, [], 'error', calculateParentStatus, null);
15165
+ reject(error);
15166
+ }));
15167
+ }
15168
+ }))];
15169
+ });
15170
+ });
15171
+ };
15172
+ /**
15173
+ * @param {?} strip
15174
+ * @param {?} request
15175
+ * @param {?} apiUrl
15176
+ * @param {?} calculateParentStatus
15177
+ * @return {?}
15178
+ */
15179
+ ContentStripWithTabsPillsComponent.prototype.getRequestMethod = /**
15180
+ * @param {?} strip
15181
+ * @param {?} request
15182
+ * @param {?} apiUrl
15183
+ * @param {?} calculateParentStatus
15184
+ * @return {?}
15185
+ */
15186
+ function (strip, request, apiUrl, calculateParentStatus) {
15187
+ return __awaiter(this, void 0, void 0, function () {
15188
+ var originalFilters;
15189
+ var _this = this;
15190
+ return __generator(this, function (_a) {
15191
+ originalFilters = [];
15192
+ return [2 /*return*/, new Promise((/**
15193
+ * @param {?} resolve
15194
+ * @param {?} reject
15195
+ * @return {?}
15196
+ */
15197
+ function (resolve, reject) {
15198
+ if (request && request) {
15199
+ _this.contentSvc.getApiMethod(apiUrl).subscribe((/**
15200
+ * @param {?} results
15201
+ * @return {?}
15202
+ */
15203
+ function (results) {
15204
+ /** @type {?} */
15205
+ var showViewMore = Boolean(results.result.data && results.result.data.orgList.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch);
15206
+ /** @type {?} */
15207
+ var viewMoreUrl = showViewMore
15208
+ ? {
15209
+ path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
15210
+ }
15211
+ : null;
15212
+ resolve({ results: results, viewMoreUrl: viewMoreUrl });
15213
+ }), (/**
15214
+ * @param {?} error
15215
+ * @return {?}
15216
+ */
15217
+ function (error) {
15218
+ _this.processStrip(strip, [], 'error', calculateParentStatus, null);
15219
+ reject(error);
15220
+ }));
15221
+ }
15222
+ }))];
15223
+ });
15224
+ });
15225
+ };
15226
+ /**
15227
+ * @param {?} filters
15228
+ * @return {?}
15229
+ */
15230
+ ContentStripWithTabsPillsComponent.prototype.postMethodFilters = /**
15231
+ * @param {?} filters
15232
+ * @return {?}
15233
+ */
15234
+ function (filters) {
15235
+ if (filters.organisation &&
15236
+ filters.organisation.indexOf('<orgID>') >= 0) {
15237
+ filters.organisation = this.providerId;
15238
+ }
15239
+ return filters;
15240
+ };
15241
+ /**
15242
+ * @param {?} apiUrl
15243
+ * @param {?} id
15244
+ * @return {?}
15245
+ */
15246
+ ContentStripWithTabsPillsComponent.prototype.getFullUrl = /**
15247
+ * @param {?} apiUrl
15248
+ * @param {?} id
15249
+ * @return {?}
15250
+ */
15251
+ function (apiUrl, id) {
15252
+ /** @type {?} */
15253
+ var formedUrl = '';
15254
+ if (apiUrl.indexOf('<bookmarkId>') >= 0) {
15255
+ formedUrl = apiUrl.replace('<bookmarkId>', this.environment.mdoChannelsBookmarkId);
15256
+ }
15257
+ else if (apiUrl.indexOf('<playlistKey>') >= 0 && apiUrl.indexOf('<orgID>') >= 0) {
15258
+ formedUrl = apiUrl.replace('<playlistKey>', this.providerId + id);
15259
+ formedUrl = formedUrl.replace('<orgID>', this.providerId);
15260
+ }
15261
+ return formedUrl;
15262
+ };
15263
+ /**
15264
+ * @param {?} stripData
15265
+ * @param {?} path
15266
+ * @param {?} queryParamsData
15267
+ * @return {?}
15268
+ */
15269
+ ContentStripWithTabsPillsComponent.prototype.redirectViewAll = /**
15270
+ * @param {?} stripData
15271
+ * @param {?} path
15272
+ * @param {?} queryParamsData
15273
+ * @return {?}
15274
+ */
15275
+ function (stripData, path, queryParamsData) {
15276
+ if (this.emitViewAll) {
15277
+ this.viewAllResponse.emit(stripData);
15278
+ }
15279
+ else {
15280
+ this.router.navigate([path], { queryParams: queryParamsData });
15281
+ }
15282
+ };
15283
+ /**
15284
+ * @param {?} strip
15285
+ * @param {?=} calculateParentStatus
15286
+ * @return {?}
15287
+ */
15288
+ ContentStripWithTabsPillsComponent.prototype.fetchAllBookMarkData = /**
15289
+ * @param {?} strip
15290
+ * @param {?=} calculateParentStatus
15291
+ * @return {?}
15292
+ */
15293
+ function (strip, calculateParentStatus) {
15294
+ if (calculateParentStatus === void 0) { calculateParentStatus = true; }
15295
+ return __awaiter(this, void 0, void 0, function () {
15296
+ var originalFilters, response, content, error_4;
15297
+ return __generator(this, function (_a) {
15298
+ switch (_a.label) {
15299
+ case 0:
15300
+ if (!(strip.request && strip.request.bookmarkRead && Object.keys(strip.request.bookmarkRead).length)) return [3 /*break*/, 4];
15301
+ originalFilters = [];
15302
+ if (strip.request &&
15303
+ strip.request.bookmarkRead &&
15304
+ strip.request.bookmarkRead.bookmarkId) {
15305
+ strip.request.apiUrl = this.getFullUrl(strip.request.apiUrl, strip.request.bookmarkRead.bookmarkId);
15306
+ }
15307
+ _a.label = 1;
15308
+ case 1:
15309
+ _a.trys.push([1, 3, , 4]);
15310
+ return [4 /*yield*/, this.getRequestMethod(strip, strip.request.bookmarkRead, strip.request.apiUrl, calculateParentStatus)];
15311
+ case 2:
15312
+ response = _a.sent();
15313
+ content = response.results.result.data.orgList;
15314
+ if (response) {
15315
+ this.processStrip(strip, this.transformAllContentsToWidgets(content, strip), 'done', calculateParentStatus, response);
15316
+ }
15317
+ else {
15318
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
15319
+ this.emptyResponse.emit(true);
15320
+ }
15321
+ return [3 /*break*/, 4];
15322
+ case 3:
15323
+ error_4 = _a.sent();
15324
+ this.emptyResponse.emit(true);
15325
+ return [3 /*break*/, 4];
15326
+ case 4: return [2 /*return*/];
15327
+ }
15328
+ });
15329
+ });
15330
+ };
15331
+ /**
15332
+ * @private
15333
+ * @param {?} contents
15334
+ * @param {?} strip
15335
+ * @return {?}
15336
+ */
15337
+ ContentStripWithTabsPillsComponent.prototype.transformAllContentsToWidgets = /**
15338
+ * @private
15339
+ * @param {?} contents
15340
+ * @param {?} strip
15341
+ * @return {?}
15342
+ */
15343
+ function (contents, strip) {
15344
+ return (contents || []).map((/**
15345
+ * @param {?} content
15346
+ * @param {?} idx
15347
+ * @return {?}
15348
+ */
15349
+ function (content, idx) { return (content ? {
15350
+ widgetType: 'cardLib',
15351
+ widgetSubType: 'cardContentLib',
15352
+ widgetHostClass: 'mb-2',
15353
+ widgetData: __assign({ content: content }, (content.batch && { batch: content.batch }), { cardSubType: strip.stripConfig && strip.stripConfig.cardSubType, cardCustomeClass: strip.customeClass ? strip.customeClass : '', context: { pageSection: strip.key, position: idx }, intranetMode: strip.stripConfig && strip.stripConfig.intranetMode, deletedMode: strip.stripConfig && strip.stripConfig.deletedMode, contentTags: strip.stripConfig && strip.stripConfig.contentTags }),
15354
+ } : {
15355
+ widgetType: 'card',
15356
+ widgetSubType: 'cardContent',
15357
+ widgetHostClass: 'mb-2',
15358
+ widgetData: {},
15359
+ }); }));
15360
+ };
15361
+ /**
15362
+ * @param {?} strip
15363
+ * @param {?=} calculateParentStatus
15364
+ * @return {?}
15365
+ */
15366
+ ContentStripWithTabsPillsComponent.prototype.fetchAllPlaylistSearch = /**
15367
+ * @param {?} strip
15368
+ * @param {?=} calculateParentStatus
15369
+ * @return {?}
15370
+ */
15371
+ function (strip, calculateParentStatus) {
15372
+ if (calculateParentStatus === void 0) { calculateParentStatus = true; }
15373
+ return __awaiter(this, void 0, void 0, function () {
15374
+ var originalFilters, response, finalPlaylistData_1, programData, error_5;
15375
+ return __generator(this, function (_a) {
15376
+ switch (_a.label) {
15377
+ case 0:
15378
+ if (!(strip.request && strip.request.playlistSearch && Object.keys(strip.request.playlistSearch).length)) return [3 /*break*/, 4];
15379
+ originalFilters = [];
15380
+ if (strip.request &&
15381
+ strip.request.playlistSearch &&
15382
+ strip.request.playlistSearch.request &&
15383
+ strip.request.playlistSearch.request.filters) {
15384
+ originalFilters = strip.request.playlistSearch.request.filters;
15385
+ strip.request.playlistSearch.request.filters = this.postMethodFilters(strip.request.playlistSearch.request.filters);
15386
+ }
15387
+ _a.label = 1;
15388
+ case 1:
15389
+ _a.trys.push([1, 3, , 4]);
15390
+ return [4 /*yield*/, this.postRequestMethod(strip, strip.request.playlistSearch.request, strip.request.apiUrl, calculateParentStatus)];
15391
+ case 2:
15392
+ response = _a.sent();
15393
+ // console.log('calling after - response, ', response)
15394
+ if (response && response.results) {
15395
+ // console.log('calling after-- ')
15396
+ if (response.results.result.data && response.results.result.data.length) {
15397
+ finalPlaylistData_1 = [];
15398
+ programData = response.results.result.data;
15399
+ programData.forEach((/**
15400
+ * @param {?} prgData
15401
+ * @return {?}
15402
+ */
15403
+ function (prgData) {
15404
+ if (prgData.children && prgData.children.length) {
15405
+ finalPlaylistData_1.push(prgData);
15406
+ }
15407
+ }));
15408
+ if (finalPlaylistData_1.length) {
15409
+ this.processStrip(strip, this.transformContentsToWidgets(finalPlaylistData_1, strip), 'done', calculateParentStatus, response.viewMoreUrl);
15410
+ }
15411
+ else {
15412
+ this.emptyResponse.emit(true);
15413
+ }
15414
+ }
15415
+ else {
15416
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
15417
+ this.emptyResponse.emit(true);
15418
+ }
15419
+ }
15420
+ else {
15421
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
15422
+ this.emptyResponse.emit(true);
15423
+ }
15424
+ return [3 /*break*/, 4];
15425
+ case 3:
15426
+ error_5 = _a.sent();
15427
+ this.emptyResponse.emit(true);
15428
+ return [3 /*break*/, 4];
15429
+ case 4: return [2 /*return*/];
15430
+ }
15431
+ });
15432
+ });
15433
+ };
15434
+ /**
15435
+ * @param {?} strip
15436
+ * @param {?=} calculateParentStatus
15437
+ * @return {?}
15438
+ */
15439
+ ContentStripWithTabsPillsComponent.prototype.fetchPlaylistReadData = /**
15440
+ * @param {?} strip
15441
+ * @param {?=} calculateParentStatus
15442
+ * @return {?}
15443
+ */
15444
+ function (strip, calculateParentStatus) {
15445
+ if (calculateParentStatus === void 0) { calculateParentStatus = true; }
15446
+ return __awaiter(this, void 0, void 0, function () {
15447
+ var originalFilters, response, content, error_6;
15448
+ return __generator(this, function (_a) {
15449
+ switch (_a.label) {
15450
+ case 0:
15451
+ if (!(strip.request && strip.request.playlistRead && Object.keys(strip.request.playlistRead).length)) return [3 /*break*/, 4];
15452
+ originalFilters = [];
15453
+ if (strip.request &&
15454
+ strip.request.playlistRead &&
15455
+ strip.request.playlistRead.type) {
15456
+ strip.request.apiUrl = this.getFullUrl(strip.request.apiUrl, strip.request.playlistRead.type);
15457
+ }
15458
+ _a.label = 1;
15459
+ case 1:
15460
+ _a.trys.push([1, 3, , 4]);
15461
+ return [4 /*yield*/, this.getRequestMethod(strip, strip.request.playlistRead, strip.request.apiUrl, calculateParentStatus)];
15462
+ case 2:
15463
+ response = _a.sent();
15464
+ if (response && response.results.result.content) {
15465
+ content = response.results.result.content;
15466
+ this.processStrip(strip, this.transformAllContentsToWidgets(content, strip), 'done', calculateParentStatus, response);
15467
+ }
15468
+ else {
15469
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
15470
+ this.emptyResponse.emit(true);
15471
+ }
15472
+ return [3 /*break*/, 4];
15473
+ case 3:
15474
+ error_6 = _a.sent();
15475
+ this.emptyResponse.emit(true);
15476
+ return [3 /*break*/, 4];
15477
+ case 4: return [2 /*return*/];
15478
+ }
15479
+ });
15480
+ });
15481
+ };
15482
+ /**
15483
+ * @param {?} strip
15484
+ * @param {?=} calculateParentStatus
15485
+ * @return {?}
15486
+ */
15487
+ ContentStripWithTabsPillsComponent.prototype.fetchCiosContentData = /**
15488
+ * @param {?} strip
15489
+ * @param {?=} calculateParentStatus
15490
+ * @return {?}
15491
+ */
15492
+ function (strip, calculateParentStatus) {
15493
+ if (calculateParentStatus === void 0) { calculateParentStatus = true; }
15494
+ return __awaiter(this, void 0, void 0, function () {
15495
+ var originalFilters, response, extContentData, error_7;
15496
+ return __generator(this, function (_a) {
15497
+ switch (_a.label) {
15498
+ case 0:
15499
+ if (!(strip.request && strip.request.ciosContent && Object.keys(strip.request.ciosContent).length)) return [3 /*break*/, 4];
15500
+ originalFilters = [];
15501
+ if (strip.request &&
15502
+ strip.request.ciosContent &&
15503
+ strip.request.ciosContent.filterCriteriaMap) {
15504
+ originalFilters = strip.request.ciosContent.filterCriteriaMap;
15505
+ strip.request.ciosContent.filterCriteriaMap = this.postMethodFilters(strip.request.ciosContent.filterCriteriaMap);
15506
+ }
15507
+ _a.label = 1;
15508
+ case 1:
15509
+ _a.trys.push([1, 3, , 4]);
15510
+ return [4 /*yield*/, this.postRequestMethod(strip, strip.request.ciosContent, strip.request.apiUrl, calculateParentStatus)];
15511
+ case 2:
15512
+ response = _a.sent();
15513
+ // console.log('calling after - response, ', response)
15514
+ if (response && response.results) {
15515
+ // console.log('calling after-- ')
15516
+ if (response.results.data && response.results.data.length) {
15517
+ extContentData = response.results.data;
15518
+ if (extContentData.length) {
15519
+ this.processStrip(strip, this.transformContentsToWidgets(extContentData, strip), 'done', calculateParentStatus, response.viewMoreUrl);
15520
+ }
15521
+ else {
15522
+ this.emptyResponse.emit(true);
15523
+ }
15524
+ }
15525
+ else {
15526
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
15527
+ this.emptyResponse.emit(true);
15528
+ }
15529
+ }
15530
+ else {
15531
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
15532
+ this.emptyResponse.emit(true);
15533
+ }
15534
+ return [3 /*break*/, 4];
15535
+ case 3:
15536
+ error_7 = _a.sent();
15537
+ this.emptyResponse.emit(true);
15538
+ return [3 /*break*/, 4];
15539
+ case 4: return [2 /*return*/];
15540
+ }
15541
+ });
15542
+ });
15543
+ };
15544
+ // new code writting from here====new====
15545
+ // new code writting from here====new====
15546
+ /**
15547
+ * @param {?} strip
15548
+ * @param {?=} calculateParentStatus
15549
+ * @return {?}
15550
+ */
15551
+ ContentStripWithTabsPillsComponent.prototype.fetchForYouData =
15552
+ // new code writting from here====new====
15553
+ /**
15554
+ * @param {?} strip
15555
+ * @param {?=} calculateParentStatus
15556
+ * @return {?}
15557
+ */
15558
+ function (strip, calculateParentStatus) {
15559
+ if (calculateParentStatus === void 0) { calculateParentStatus = true; }
15560
+ if (strip && strip.type === 'forYou') {
15561
+ if (strip.tabs && strip.tabs.length) {
15562
+ /** @type {?} */
15563
+ var firstTab = strip.tabs[0];
15564
+ /** @type {?} */
15565
+ var pillData = firstTab.pillsData[0];
15566
+ if (pillData.requestRequired) {
15567
+ if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
15568
+ /** @type {?} */
15569
+ var allPills = this.stripsResultDataMap[strip.key].tabs[0].pillsData;
15570
+ /** @type {?} */
15571
+ var currenPillsFromMap = (/** @type {?} */ ((allPills && allPills.length && allPills[0])));
15572
+ this.getTabDataByNewReqTrending(strip, 0, 0, currenPillsFromMap, calculateParentStatus);
15573
+ if (this.stripsResultDataMap[strip.key] && currenPillsFromMap) {
15574
+ this.stripsResultDataMap[strip.key].viewMoreUrl.queryParams = __assign({}, this.stripsResultDataMap[strip.key].viewMoreUrl.queryParams, { key: strip.key, tabSelected: firstTab.value, pillSelected: pillData.value });
15575
+ }
15576
+ }
15577
+ }
15578
+ }
15579
+ }
15580
+ };
15581
+ /**
15582
+ * @param {?} strip
15583
+ * @param {?=} calculateParentStatus
15584
+ * @return {?}
15585
+ */
15586
+ ContentStripWithTabsPillsComponent.prototype.fetchFromSearchV6 = /**
15587
+ * @param {?} strip
15588
+ * @param {?=} calculateParentStatus
15589
+ * @return {?}
15590
+ */
15591
+ function (strip, calculateParentStatus) {
15592
+ if (calculateParentStatus === void 0) { calculateParentStatus = true; }
15593
+ return __awaiter(this, void 0, void 0, function () {
15594
+ var originalFilters, firstTab, allTabs, currentTabFromMap, response_1, error_8;
15595
+ var _this = this;
15596
+ return __generator(this, function (_a) {
15597
+ switch (_a.label) {
15598
+ case 0:
15599
+ if (!(strip.request && strip.request.searchV6 && Object.keys(strip.request.searchV6).length)) return [3 /*break*/, 4];
15600
+ // if (!(strip.request.searchV6.locale && strip.request.searchV6.locale.length > 0)) {
15601
+ // if (this.configSvc.activeLocale) {
15602
+ // strip.request.searchV6.locale = [this.configSvc.activeLocale.locals[0]]
15603
+ // } else {
15604
+ // strip.request.searchV6.locale = ['en']
15605
+ // }
15606
+ // }
15607
+ originalFilters = [];
15608
+ // tslint:disable:no-console
15609
+ if (strip.request &&
15610
+ strip.request.searchV6 &&
15611
+ strip.request.searchV6.request &&
15612
+ strip.request.searchV6.request.filters) {
15613
+ originalFilters = strip.request.searchV6.request.filters;
15614
+ strip.request.searchV6.request.filters = this.checkForDateFilters(strip.request.searchV6.request.filters);
15615
+ strip.request.searchV6.request.filters = this.getFiltersFromArray(strip.request.searchV6.request.filters);
15616
+ }
15617
+ if (!(strip.tabs && strip.tabs.length)) return [3 /*break*/, 1];
15618
+ // TODO: Have to extract requestRequired to outer level of tabs config
15619
+ firstTab = strip.tabs[0];
15620
+ if (firstTab.requestRequired) {
15621
+ if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
15622
+ allTabs = this.stripsResultDataMap[strip.key].tabs;
15623
+ currentTabFromMap = (/** @type {?} */ ((allTabs && allTabs.length && allTabs[0])));
15624
+ this.getTabDataByNewReqSearchV6(strip, 0, 0, currentTabFromMap, calculateParentStatus);
15625
+ }
15626
+ }
15627
+ return [3 /*break*/, 4];
15628
+ case 1:
15629
+ _a.trys.push([1, 3, , 4]);
15630
+ return [4 /*yield*/, this.searchV6Request(strip, strip.request, calculateParentStatus)];
15631
+ case 2:
15632
+ response_1 = _a.sent();
15633
+ // console.log('calling after - response, ', response)
15634
+ if (response_1 && response_1.results) {
15635
+ // console.log('calling after-- ')
15636
+ if (response_1.results.result.content) {
15637
+ if (strip.key === 'scheduledAssessment') {
15638
+ this.enrollInterval = setInterval((/**
15639
+ * @return {?}
15640
+ */
15641
+ function () {
15642
+ _this.checkInvitOnlyAssessments(response_1.results.result.content, strip, calculateParentStatus, response_1.viewMoreUrl);
15643
+ // tslint:disable-next-line
15644
+ }), 1000);
15645
+ }
15646
+ else {
15647
+ this.processStrip(strip, this.transformContentsToWidgets(response_1.results.result.content, strip), 'done', calculateParentStatus, response_1.viewMoreUrl);
15648
+ }
15649
+ }
15650
+ else if (response_1.results.result.Event) {
15651
+ this.processStrip(strip, this.transformEventsToWidgets(response_1.results.result.Event, strip), 'done', calculateParentStatus, response_1.viewMoreUrl);
15652
+ }
15653
+ else {
15654
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
15655
+ }
15656
+ }
15657
+ else {
15658
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
15659
+ }
15660
+ return [3 /*break*/, 4];
15661
+ case 3:
15662
+ error_8 = _a.sent();
15663
+ return [3 /*break*/, 4];
15664
+ case 4: return [2 /*return*/];
15665
+ }
15666
+ });
15667
+ });
15668
+ };
15669
+ /**
15670
+ * @param {?} strip
15671
+ * @param {?} tabIndex
15672
+ * @param {?} pillIndex
15673
+ * @param {?} currentTab
15674
+ * @param {?} calculateParentStatus
15675
+ * @return {?}
15676
+ */
15677
+ ContentStripWithTabsPillsComponent.prototype.getTabDataByNewReqTrending = /**
15678
+ * @param {?} strip
15679
+ * @param {?} tabIndex
15680
+ * @param {?} pillIndex
15681
+ * @param {?} currentTab
15682
+ * @param {?} calculateParentStatus
15683
+ * @return {?}
15684
+ */
15685
+ function (strip, tabIndex, pillIndex, currentTab, calculateParentStatus) {
15686
+ return __awaiter(this, void 0, void 0, function () {
15687
+ var response, tabResults, content, widgets, allTabs, allPills, allTabs, allPills, error_9;
15688
+ return __generator(this, function (_a) {
15689
+ switch (_a.label) {
15690
+ case 0:
15691
+ _a.trys.push([0, 2, , 3]);
15692
+ return [4 /*yield*/, this.trendingSearchRequest(strip, currentTab.request, calculateParentStatus)];
15693
+ case 1:
15694
+ response = _a.sent();
15695
+ tabResults = [];
15696
+ if (response && response.results && response.results.response) {
15697
+ content = response.results.response[currentTab.value] || [];
15698
+ widgets = this.transformContentsToWidgets(content, strip);
15699
+ if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
15700
+ allTabs = this.stripsResultDataMap[strip.key].tabs;
15701
+ allPills = this.stripsResultDataMap[strip.key].tabs[tabIndex].pillsData;
15702
+ this.resetSelectedPill(allPills);
15703
+ if (allTabs && allTabs.length && allTabs[tabIndex]) {
15704
+ if (allPills && allPills.length && allPills[pillIndex]) {
15705
+ allPills[pillIndex] = __assign({}, allPills[pillIndex], { widgets: widgets, fetchTabStatus: 'done', selected: true });
15706
+ }
15707
+ allTabs[tabIndex] = __assign({}, allTabs[tabIndex], { widgets: widgets, fetchTabStatus: 'done' });
15708
+ tabResults = allTabs;
15709
+ }
15710
+ }
15711
+ this.processStrip(strip, widgets, 'done', calculateParentStatus, response.viewMoreUrl, tabResults // tabResults as widgets
15712
+ );
15713
+ }
15714
+ else {
15715
+ if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
15716
+ allTabs = this.stripsResultDataMap[strip.key].tabs;
15717
+ allPills = this.stripsResultDataMap[strip.key].tabs[tabIndex].pillsData;
15718
+ this.resetSelectedPill(allPills);
15719
+ if (allTabs && allTabs.length && allTabs[tabIndex]) {
15720
+ if (allPills && allPills.length && allPills[pillIndex]) {
15721
+ allPills[pillIndex] = __assign({}, allPills[pillIndex], { widgets: [], fetchTabStatus: 'done', selected: true });
15722
+ }
15723
+ allTabs[tabIndex] = __assign({}, allTabs[tabIndex], { widgets: [], fetchTabStatus: 'done' });
15724
+ tabResults = allTabs;
15725
+ }
15726
+ }
15727
+ this.processStrip(strip, [], 'done', calculateParentStatus, null);
15728
+ }
15729
+ return [3 /*break*/, 3];
15730
+ case 2:
15731
+ error_9 = _a.sent();
15732
+ // Handle errors
15733
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
15734
+ return [3 /*break*/, 3];
15735
+ case 3: return [2 /*return*/];
15736
+ }
15737
+ });
15738
+ });
15739
+ };
15740
+ /**
15741
+ * @param {?} strip
15742
+ * @param {?} tabIndex
15743
+ * @param {?} pillIndex
15744
+ * @param {?} currentTab
15745
+ * @param {?} calculateParentStatus
15746
+ * @return {?}
15747
+ */
15748
+ ContentStripWithTabsPillsComponent.prototype.getTabDataByNewReqSearchV6 = /**
15749
+ * @param {?} strip
15750
+ * @param {?} tabIndex
15751
+ * @param {?} pillIndex
15752
+ * @param {?} currentTab
15753
+ * @param {?} calculateParentStatus
15754
+ * @return {?}
15755
+ */
15756
+ function (strip, tabIndex, pillIndex, currentTab, calculateParentStatus) {
15757
+ return __awaiter(this, void 0, void 0, function () {
15758
+ var response, widgets, tabResults, allTabs, allPills, error_10;
15759
+ return __generator(this, function (_a) {
15760
+ switch (_a.label) {
15761
+ case 0:
15762
+ _a.trys.push([0, 2, , 3]);
15763
+ return [4 /*yield*/, this.searchV6Request(strip, currentTab.request, calculateParentStatus)];
15764
+ case 1:
15765
+ response = _a.sent();
15766
+ if (response && response.results) {
15767
+ widgets = this.transformContentsToWidgets(response.results.result.content, strip);
15768
+ tabResults = [];
15769
+ if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
15770
+ allTabs = this.stripsResultDataMap[strip.key].tabs;
15771
+ allPills = this.stripsResultDataMap[strip.key].tabs[tabIndex].pillsData;
15772
+ this.resetSelectedPill(allPills);
15773
+ if (allTabs && allTabs.length && allTabs[tabIndex]) {
15774
+ if (allPills && allPills.length && allPills[pillIndex]) {
15775
+ allPills[pillIndex] = __assign({}, allPills[pillIndex], { widgets: widgets, fetchTabStatus: 'done', selected: true });
15776
+ }
15777
+ allTabs[tabIndex] = __assign({}, allTabs[tabIndex], { widgets: widgets, fetchTabStatus: 'done' });
15778
+ tabResults = allTabs;
15779
+ }
15780
+ }
15781
+ this.processStrip(strip, widgets, 'done', calculateParentStatus, response.viewMoreUrl, tabResults // tabResults as widgets
15782
+ );
15783
+ }
15784
+ else {
15785
+ this.processStrip(strip, [], 'error', calculateParentStatus, null);
15786
+ }
15787
+ return [3 /*break*/, 3];
15788
+ case 2:
15789
+ error_10 = _a.sent();
15790
+ return [3 /*break*/, 3];
15791
+ case 3: return [2 /*return*/];
15792
+ }
15793
+ });
15794
+ });
15795
+ };
15796
+ /**
15797
+ * @param {?} strip
15798
+ * @param {?} request
15799
+ * @param {?} calculateParentStatus
15800
+ * @return {?}
15801
+ */
15802
+ ContentStripWithTabsPillsComponent.prototype.trendingSearchRequest = /**
15803
+ * @param {?} strip
15804
+ * @param {?} request
15805
+ * @param {?} calculateParentStatus
15806
+ * @return {?}
15807
+ */
15808
+ function (strip, request, calculateParentStatus) {
15809
+ return __awaiter(this, void 0, void 0, function () {
15810
+ var originalFilters;
15811
+ var _this = this;
15812
+ return __generator(this, function (_a) {
15813
+ originalFilters = [];
15814
+ return [2 /*return*/, new Promise((/**
15815
+ * @param {?} resolve
15816
+ * @param {?} reject
15817
+ * @return {?}
15818
+ */
15819
+ function (resolve, reject) {
15820
+ if (request && request.trendingSearch) {
15821
+ // check for the request if it has dynamic values]
15822
+ if (request.trendingSearch.request.filters.organisation &&
15823
+ request.trendingSearch.request.filters.organisation.indexOf('<orgID>') >= 0) {
15824
+ /** @type {?} */
15825
+ var userRootOrgId = void 0;
15826
+ if (_this.configSvc.userProfile) {
15827
+ userRootOrgId = _this.configSvc.userProfile.rootOrgId;
15828
+ }
15829
+ request.trendingSearch.request.filters.organisation = userRootOrgId;
15830
+ }
15831
+ _this.contentSvc.trendingContentSearch(request.trendingSearch).subscribe((/**
15832
+ * @param {?} results
15833
+ * @return {?}
15834
+ */
15835
+ function (results) {
15836
+ /** @type {?} */
15837
+ var showViewMore = Boolean(results.result &&
15838
+ strip.request &&
15839
+ results.result[strip.request.trendingSearch.responseKey] &&
15840
+ results.result[strip.request.trendingSearch.responseKey].length > 5 &&
15841
+ strip.stripConfig && strip.stripConfig.postCardForSearch);
15842
+ /** @type {?} */
15843
+ var viewMoreUrl = showViewMore
15844
+ ? {
15845
+ path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
15846
+ queryParams: {
15847
+ tab: 'Learn',
15848
+ q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
15849
+ f: request &&
15850
+ request.trendingSearch &&
15851
+ request.trendingSearch.request &&
15852
+ request.trendingSearch.request.filters
15853
+ ? JSON.stringify(_this.transformSearchV6FiltersV2(originalFilters))
15854
+ : {},
15855
+ },
15856
+ }
15857
+ : null;
15858
+ /** @type {?} */
15859
+ var proccesedResult = [];
15860
+ if (results && results.response && results.response.certifications) {
15861
+ results.response.certifications.map((/**
15862
+ * @param {?} result
15863
+ * @return {?}
15864
+ */
15865
+ function (result) {
15866
+ if (result.source === _this.channnelName) {
15867
+ proccesedResult.push(result);
15868
+ }
15869
+ }));
15870
+ results = { response: { certifications: proccesedResult } };
15871
+ }
15872
+ resolve({ results: results, viewMoreUrl: viewMoreUrl });
15873
+ }), (/**
15874
+ * @param {?} error
15875
+ * @return {?}
15876
+ */
15877
+ function (error) {
15878
+ if (error.error && error.error.status === 400) {
15879
+ _this.processStrip(strip, [], 'done', calculateParentStatus, null);
15880
+ }
15881
+ // this.processStrip(strip, [], 'done', calculateParentStatus, null)
15882
+ reject(error);
15883
+ }));
15884
+ }
15885
+ }))];
15886
+ });
15887
+ });
15888
+ };
15889
+ /**
15890
+ * @param {?} tabEvent
15891
+ * @param {?} pillIndex
15892
+ * @param {?} stripMap
15893
+ * @param {?} stripKey
15894
+ * @return {?}
15895
+ */
15896
+ ContentStripWithTabsPillsComponent.prototype.tabClicked = /**
15897
+ * @param {?} tabEvent
15898
+ * @param {?} pillIndex
15899
+ * @param {?} stripMap
15900
+ * @param {?} stripKey
15901
+ * @return {?}
15902
+ */
15903
+ function (tabEvent, pillIndex, stripMap, stripKey) {
15904
+ if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
15905
+ stripMap.tabs[tabEvent.index].pillsData[pillIndex].fetchTabStatus = 'inprogress';
15906
+ stripMap.tabs[tabEvent.index].pillsData[pillIndex].tabLoading = true;
15907
+ stripMap.showOnLoader = true;
15908
+ }
15909
+ /** @type {?} */
15910
+ var data = {
15911
+ label: "" + tabEvent.tab.textLabel,
15912
+ index: tabEvent.index,
15913
+ };
15914
+ this.eventSvc.raiseInteractTelemetry({
15915
+ type: WsEvents.EnumInteractTypes.CLICK,
15916
+ subType: WsEvents.EnumInteractSubTypes.HOME_PAGE_STRIP_TABS,
15917
+ id: camelCase(data.label) + "-tab",
15918
+ }, {}, {
15919
+ module: WsEvents.EnumTelemetrymodules.HOME,
15920
+ });
15921
+ /** @type {?} */
15922
+ var currentTabFromMap = stripMap.tabs && stripMap.tabs[tabEvent.index];
15923
+ /** @type {?} */
15924
+ var currentPillFromMap = stripMap.tabs && stripMap.tabs[tabEvent.index].pillsData[pillIndex];
15925
+ /** @type {?} */
15926
+ var currentStrip = this.widgetData.strips.find((/**
15927
+ * @param {?} s
15928
+ * @return {?}
15929
+ */
15930
+ function (s) { return s.key === stripKey; }));
15931
+ if (this.stripsResultDataMap[stripKey] && currentTabFromMap) {
15932
+ this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams = __assign({}, this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams, { tabSelected: currentTabFromMap.value, pillSelected: currentPillFromMap.value });
15933
+ }
15934
+ if (currentStrip && currentTabFromMap && !currentTabFromMap.computeDataOnClick && currentPillFromMap) {
15935
+ if (currentPillFromMap.requestRequired && currentPillFromMap.request) {
15936
+ // call API to get tab data and process
15937
+ // this.processStrip(currentStrip, [], 'fetching', true, null)
15938
+ if (currentPillFromMap.request.searchV6) {
15939
+ this.getTabDataByNewReqSearchV6(currentStrip, tabEvent.index, 0, currentPillFromMap, true);
15940
+ }
15941
+ else if (currentPillFromMap.request.trendingSearch) {
15942
+ this.getTabDataByNewReqTrending(currentStrip, tabEvent.index, 0, currentPillFromMap, true);
15943
+ }
15944
+ // if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
15945
+ // stripMap.tabs[tabEvent.index].tabLoading = false;
15946
+ // }
15947
+ stripMap.tabs[tabEvent.index].pillsData[pillIndex].tabLoading = false;
15948
+ }
15949
+ else {
15950
+ // this.getTabDataByfilter(currentStrip, currentTabFromMap, true);
15951
+ // setTimeout(() => {
15952
+ // if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
15953
+ // stripMap.tabs[tabEvent.index].tabLoading = false;
15954
+ // stripMap.tabs[tabEvent.index].fetchTabStatus = 'done';
15955
+ // stripMap.showOnLoader = false;
15956
+ // }
15957
+ // }, 200);
15958
+ }
15959
+ }
15960
+ };
15961
+ /**
15962
+ * @param {?} event
15963
+ * @param {?} stripMap
15964
+ * @param {?} stripKey
15965
+ * @param {?} pillIndex
15966
+ * @param {?} tabIndex
15967
+ * @return {?}
15968
+ */
15969
+ ContentStripWithTabsPillsComponent.prototype.pillClicked = /**
15970
+ * @param {?} event
15971
+ * @param {?} stripMap
15972
+ * @param {?} stripKey
15973
+ * @param {?} pillIndex
15974
+ * @param {?} tabIndex
15975
+ * @return {?}
15976
+ */
15977
+ function (event, stripMap, stripKey, pillIndex, tabIndex) {
15978
+ var _this = this;
15979
+ if (stripMap && stripMap.tabs && stripMap.tabs[tabIndex]) {
15980
+ stripMap.tabs[tabIndex].pillsData[pillIndex].fetchTabStatus = 'inprogress';
15981
+ stripMap.tabs[tabIndex].pillsData[pillIndex].tabLoading = true;
15982
+ stripMap.showOnLoader = true;
15983
+ }
15984
+ /** @type {?} */
15985
+ var currentTabFromMap = stripMap.tabs && stripMap.tabs[tabIndex];
15986
+ /** @type {?} */
15987
+ var currentPillFromMap = stripMap.tabs && stripMap.tabs[tabIndex].pillsData[pillIndex];
15988
+ /** @type {?} */
15989
+ var currentStrip = this.widgetData.strips.find((/**
15990
+ * @param {?} s
15991
+ * @return {?}
15992
+ */
15993
+ function (s) { return s.key === stripKey; }));
15994
+ if (this.stripsResultDataMap[stripKey] && currentTabFromMap) {
15995
+ this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams = __assign({}, this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams, { tabSelected: currentTabFromMap.value, pillSelected: currentPillFromMap.value });
15996
+ }
15997
+ if (currentStrip && currentTabFromMap && !currentTabFromMap.computeDataOnClick && currentPillFromMap) {
15998
+ if (currentPillFromMap.requestRequired && currentPillFromMap.request) {
15999
+ // call API to get tab data and process
16000
+ // this.processStrip(currentStrip, [], 'fetching', true, null)
16001
+ if (currentPillFromMap.request.searchV6) {
16002
+ this.getTabDataByNewReqSearchV6(currentStrip, tabIndex, pillIndex, currentPillFromMap, true);
16003
+ }
16004
+ else if (currentPillFromMap.request.trendingSearch) {
16005
+ this.getTabDataByNewReqTrending(currentStrip, tabIndex, pillIndex, currentPillFromMap, true);
16006
+ }
16007
+ // if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
16008
+ // stripMap.tabs[tabEvent.index].tabLoading = false;
16009
+ // }
16010
+ stripMap.tabs[tabIndex].pillsData[pillIndex].tabLoading = false;
16011
+ }
16012
+ else {
16013
+ this.getTabDataByfilter(currentStrip, currentTabFromMap, true);
16014
+ setTimeout((/**
16015
+ * @return {?}
16016
+ */
16017
+ function () {
16018
+ if (stripMap && stripMap.tabs && stripMap.tabs[tabIndex]) {
16019
+ stripMap.tabs[tabIndex].pillsData[pillIndex].fetchTabStatus = 'inprogress';
16020
+ stripMap.tabs[tabIndex].pillsData[pillIndex].tabLoading = false;
16021
+ stripMap.showOnLoader = false;
16022
+ _this.resetSelectedPill(stripMap.tabs[tabIndex].pillsData);
16023
+ stripMap.tabs[tabIndex].pillsData[pillIndex]['selected'] = true;
16024
+ }
16025
+ }), 200);
16026
+ }
16027
+ }
16028
+ };
16029
+ /**
16030
+ * @param {?} strip
16031
+ * @param {?} request
16032
+ * @param {?} calculateParentStatus
16033
+ * @return {?}
16034
+ */
16035
+ ContentStripWithTabsPillsComponent.prototype.searchV6Request = /**
16036
+ * @param {?} strip
16037
+ * @param {?} request
16038
+ * @param {?} calculateParentStatus
16039
+ * @return {?}
16040
+ */
16041
+ function (strip, request, calculateParentStatus) {
16042
+ return __awaiter(this, void 0, void 0, function () {
16043
+ var originalFilters;
16044
+ var _this = this;
16045
+ return __generator(this, function (_a) {
16046
+ originalFilters = [];
16047
+ return [2 /*return*/, new Promise((/**
16048
+ * @param {?} resolve
16049
+ * @param {?} reject
16050
+ * @return {?}
16051
+ */
16052
+ function (resolve, reject) {
16053
+ if (request && request.searchV6) {
16054
+ _this.contentSvc.searchV6(request.searchV6).subscribe((/**
16055
+ * @param {?} results
16056
+ * @return {?}
16057
+ */
16058
+ function (results) {
16059
+ /** @type {?} */
16060
+ var showViewMore = Boolean(results.result.content && results.result.content.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch);
16061
+ /** @type {?} */
16062
+ var viewMoreUrl = showViewMore
16063
+ ? {
16064
+ path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
16065
+ queryParams: {
16066
+ tab: 'Learn',
16067
+ q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
16068
+ f: request &&
16069
+ request.searchV6 &&
16070
+ request.searchV6.request &&
16071
+ request.searchV6.request.filters
16072
+ ? JSON.stringify(_this.transformSearchV6FiltersV2(originalFilters))
16073
+ : {},
16074
+ },
16075
+ }
16076
+ : null;
16077
+ // if (viewMoreUrl && viewMoreUrl.queryParams) {
16078
+ // viewMoreUrl.queryParams = viewMoreUrl.queryParams
16079
+ // }
16080
+ resolve({ results: results, viewMoreUrl: viewMoreUrl });
16081
+ }), (/**
16082
+ * @param {?} error
16083
+ * @return {?}
16084
+ */
16085
+ function (error) {
16086
+ _this.processStrip(strip, [], 'error', calculateParentStatus, null);
16087
+ reject(error);
16088
+ }));
16089
+ }
16090
+ }))];
16091
+ });
16092
+ });
16093
+ };
16094
+ /**
16095
+ * @param {?} tabdata
16096
+ * @param {?} tabIndex
16097
+ * @return {?}
16098
+ */
16099
+ ContentStripWithTabsPillsComponent.prototype.getSelectedPillIndex = /**
16100
+ * @param {?} tabdata
16101
+ * @param {?} tabIndex
16102
+ * @return {?}
16103
+ */
16104
+ function (tabdata, tabIndex) {
16105
+ if (tabdata.pillsData && tabdata.pillsData.length) {
16106
+ // tabdata.pillsData.forEach((ele: any, index: any) => {
16107
+ // if(ele.selected) {
16108
+ // console.log(ele,'---------')
16109
+ // return index
16110
+ // }
16111
+ // // })
16112
+ // console.log(tabdata,'==========123')
16113
+ /** @type {?} */
16114
+ var index = tabdata.pillsData.findIndex((/**
16115
+ * @param {?} pill
16116
+ * @return {?}
16117
+ */
16118
+ function (pill) {
16119
+ // if(pill.selected){
16120
+ return pill.selected;
16121
+ // }
16122
+ }));
16123
+ return index;
16124
+ }
16125
+ return 0;
16126
+ };
16127
+ // cbp plans
16128
+ // cbp plans
16129
+ /**
16130
+ * @param {?} strip
16131
+ * @param {?=} calculateParentStatus
16132
+ * @return {?}
16133
+ */
16134
+ ContentStripWithTabsPillsComponent.prototype.fetchAllCbpPlans =
16135
+ // cbp plans
16136
+ /**
16137
+ * @param {?} strip
16138
+ * @param {?=} calculateParentStatus
16139
+ * @return {?}
16140
+ */
16141
+ function (strip, calculateParentStatus) {
16142
+ if (calculateParentStatus === void 0) { calculateParentStatus = true; }
16143
+ return __awaiter(this, void 0, void 0, function () {
16144
+ var courses, tabResults, response;
16145
+ return __generator(this, function (_a) {
16146
+ switch (_a.label) {
16147
+ case 0:
16148
+ if (!(strip.request && strip.request.cbpList && Object.keys(strip.request.cbpList).length)) return [3 /*break*/, 5];
16149
+ courses = void 0;
16150
+ tabResults = [];
16151
+ return [4 /*yield*/, this.userSvc.fetchCbpPlanList().toPromise()];
16152
+ case 1:
16153
+ response = _a.sent();
16154
+ if (!response) return [3 /*break*/, 4];
16155
+ courses = response;
16156
+ if (!(strip.tabs && strip.tabs.length)) return [3 /*break*/, 3];
16157
+ tabResults = this.splitCbpTabsData(courses, strip);
16158
+ return [4 /*yield*/, this.processStrip(strip, this.transformContentsToWidgets(courses, strip), 'done', calculateParentStatus, '', tabResults)];
16159
+ case 2:
16160
+ _a.sent();
16161
+ return [3 /*break*/, 4];
16162
+ case 3:
16163
+ this.processStrip(strip, this.transformContentsToWidgets(courses, strip), 'done', calculateParentStatus, 'viewMoreUrl');
16164
+ _a.label = 4;
16165
+ case 4:
16166
+ // this.userSvc.fetchCbpPlanList().subscribe( async (res: any) => {
16167
+ // if (res) {
16168
+ // console.log(res,'===============================>')
16169
+ // courses = res
16170
+ // if (strip.tabs && strip.tabs.length) {
16171
+ // tabResults = this.splitCbpTabsData(courses, strip)
16172
+ // await this.processStrip(
16173
+ // strip,
16174
+ // this.transformContentsToWidgets(courses, strip),
16175
+ // 'done',
16176
+ // calculateParentStatus,
16177
+ // '',
16178
+ // tabResults
16179
+ // )
16180
+ // } else {
16181
+ // this.processStrip(
16182
+ // strip,
16183
+ // this.transformContentsToWidgets(courses, strip),
16184
+ // 'done',
16185
+ // calculateParentStatus,
16186
+ // 'viewMoreUrl',
16187
+ // )
16188
+ // }
16189
+ // }
16190
+ // }, (_err: any) => {
16191
+ // })
16192
+ clearInterval(this.enrollInterval);
16193
+ _a.label = 5;
16194
+ case 5: return [2 /*return*/];
16195
+ }
16196
+ });
16197
+ });
16198
+ };
16199
+ /**
16200
+ * @param {?} contentNew
16201
+ * @param {?} strip
16202
+ * @return {?}
16203
+ */
16204
+ ContentStripWithTabsPillsComponent.prototype.splitCbpTabsData = /**
16205
+ * @param {?} contentNew
16206
+ * @param {?} strip
16207
+ * @return {?}
16208
+ */
16209
+ function (contentNew, strip) {
16210
+ /** @type {?} */
16211
+ var tabResults = [];
16212
+ /** @type {?} */
16213
+ var splitData = this.getTabsList(contentNew, strip);
16214
+ if (strip.tabs && strip.tabs.length) {
16215
+ var _loop_2 = function (i) {
16216
+ if (strip.tabs[i].value === "myIgotPlans") {
16217
+ if (strip.tabs[i].pillsData && strip.tabs[i].pillsData.length) {
16218
+ var _loop_3 = function (j) {
16219
+ if (j === 0) {
16220
+ strip.tabs[i].pillsData[j].selected = true;
16221
+ }
16222
+ if (strip.tabs[i].pillsData[j]) {
16223
+ tabResults.push(__assign({}, strip.tabs[i].pillsData[j], { fetchTabStatus: 'done' }, (splitData.find((/**
16224
+ * @param {?} itmInner
16225
+ * @return {?}
16226
+ */
16227
+ function (itmInner) {
16228
+ if (strip.tabs[i].pillsData && strip.tabs[i].pillsData[j] && itmInner.value === strip.tabs[i].pillsData[j].value) {
16229
+ return itmInner;
16230
+ }
16231
+ return undefined;
16232
+ })))));
16233
+ }
16234
+ };
16235
+ for (var j = 0; j < strip.tabs[i].pillsData.length; j += 1) {
16236
+ _loop_3(j);
16237
+ }
16238
+ strip.tabs[i].pillsData = tabResults;
16239
+ }
16240
+ }
16241
+ };
16242
+ for (var i = 0; i < strip.tabs.length; i += 1) {
16243
+ _loop_2(i);
16244
+ }
16245
+ }
16246
+ return strip.tabs;
16247
+ };
16248
+ /**
16249
+ * @param {?} array
16250
+ * @param {?} strip
16251
+ * @return {?}
16252
+ */
16253
+ ContentStripWithTabsPillsComponent.prototype.getTabsList = /**
16254
+ * @param {?} array
16255
+ * @param {?} strip
16256
+ * @return {?}
16257
+ */
16258
+ function (array, strip) {
16259
+ /** @type {?} */
16260
+ var all = [];
16261
+ /** @type {?} */
16262
+ var upcoming = [];
16263
+ /** @type {?} */
16264
+ var overdue = [];
16265
+ array.forEach((/**
16266
+ * @param {?} e
16267
+ * @return {?}
16268
+ */
16269
+ function (e) {
16270
+ all.push(e);
16271
+ if (e.planDuration === NsCardContent.ACBPConst.OVERDUE) {
16272
+ overdue.push(e);
16273
+ }
16274
+ else if (e.planDuration === NsCardContent.ACBPConst.UPCOMING) {
16275
+ upcoming.push(e);
16276
+ }
16277
+ }));
16278
+ /** @type {?} */
16279
+ var allCompleted = all.filter((/**
16280
+ * @param {?} allData
16281
+ * @return {?}
16282
+ */
16283
+ function (allData) { return allData.contentStatus === 2; }));
16284
+ /** @type {?} */
16285
+ var allInCompleted = all.filter((/**
16286
+ * @param {?} allData
16287
+ * @return {?}
16288
+ */
16289
+ function (allData) { return allData.contentStatus < 2; }));
16290
+ /** @type {?} */
16291
+ var allCompletedOverDue = allCompleted.filter((/**
16292
+ * @param {?} allData
16293
+ * @return {?}
16294
+ */
16295
+ function (allData) { return allData.planDuration === NsCardContent.ACBPConst.OVERDUE; }));
16296
+ /** @type {?} */
16297
+ var allCompletedAll = allCompleted.filter((/**
16298
+ * @param {?} allData
16299
+ * @return {?}
16300
+ */
16301
+ function (allData) { return allData.planDuration !== NsCardContent.ACBPConst.OVERDUE; }));
16302
+ allCompletedOverDue = allCompletedOverDue.sort((/**
16303
+ * @param {?} a
16304
+ * @param {?} b
16305
+ * @return {?}
16306
+ */
16307
+ function (a, b) {
16308
+ if (a.planDuration === NsCardContent.ACBPConst.OVERDUE && b.planDuration === NsCardContent.ACBPConst.OVERDUE) {
16309
+ /** @type {?} */
16310
+ var firstDate = new Date(a.endDate);
16311
+ /** @type {?} */
16312
+ var secondDate = new Date(b.endDate);
16313
+ return firstDate > secondDate ? -1 : 1;
16314
+ }
16315
+ }));
16316
+ allInCompleted = allInCompleted.sort((/**
16317
+ * @param {?} a
16318
+ * @param {?} b
16319
+ * @return {?}
16320
+ */
16321
+ function (a, b) {
16322
+ if (a.planDuration === NsCardContent.ACBPConst.OVERDUE && b.planDuration === NsCardContent.ACBPConst.OVERDUE) {
16323
+ /** @type {?} */
16324
+ var firstDate = new Date(a.endDate);
16325
+ /** @type {?} */
16326
+ var secondDate = new Date(b.endDate);
16327
+ return firstDate > secondDate ? -1 : 1;
16328
+ }
16329
+ }));
16330
+ all = __spread(allInCompleted, allCompletedAll, allCompletedOverDue);
16331
+ overdue = overdue.filter((/**
16332
+ * @param {?} data
16333
+ * @return {?}
16334
+ */
16335
+ function (data) {
16336
+ return data.contentStatus < 2;
16337
+ }));
16338
+ overdue = overdue.sort((/**
16339
+ * @param {?} a
16340
+ * @param {?} b
16341
+ * @return {?}
16342
+ */
16343
+ function (a, b) {
16344
+ /** @type {?} */
16345
+ var firstDate = new Date(a.endDate);
16346
+ /** @type {?} */
16347
+ var secondDate = new Date(b.endDate);
16348
+ return firstDate > secondDate ? -1 : 1;
16349
+ }));
16350
+ upcoming = upcoming.filter((/**
16351
+ * @param {?} data
16352
+ * @return {?}
16353
+ */
16354
+ function (data) {
16355
+ return data.contentStatus < 2;
16356
+ }));
16357
+ // this.getSelectedIndex(1)
16358
+ return [
16359
+ { value: 'all', widgets: this.transformContentsToWidgets(all, strip) },
16360
+ { value: 'upcoming', widgets: this.transformContentsToWidgets(upcoming, strip) },
16361
+ { value: 'completed', widgets: this.transformContentsToWidgets(allCompleted, strip) },
16362
+ { value: 'overdue', widgets: this.transformContentsToWidgets(overdue, strip) }
16363
+ ];
16364
+ };
16365
+ /**
16366
+ * @param {?} pillData
16367
+ * @return {?}
16368
+ */
16369
+ ContentStripWithTabsPillsComponent.prototype.resetSelectedPill = /**
16370
+ * @param {?} pillData
16371
+ * @return {?}
16372
+ */
16373
+ function (pillData) {
16374
+ if (pillData && pillData.length) {
16375
+ pillData.forEach((/**
16376
+ * @param {?} pill
16377
+ * @return {?}
16378
+ */
16379
+ function (pill) {
16380
+ pill['selected'] = false;
16381
+ }));
16382
+ }
16383
+ };
16384
+ ContentStripWithTabsPillsComponent.decorators = [
16385
+ { type: Component, args: [{
16386
+ selector: 'sb-uic-content-strip-with-tabs-pills',
16387
+ template: "<ng-container *ngIf=\"!contentAvailable; else otherTemplate\"></ng-container>\n<ng-template #otherTemplate>\n <!-- <div *ngIf=\"showParentLoader\" class=\"text-center my-2\">\n <mat-spinner class=\"inline-block\"></mat-spinner>\n </div> -->\n <ng-container *ngIf=\"showParentError\" [sbUiResolverWidget]=\"widgetData.errorWidget\"></ng-container>\n <ng-container *ngIf=\"showParentNoData\" [sbUiResolverWidget]=\"widgetData.noDataWidget\"></ng-container>\n <ng-container *ngFor=\"let key of stripsKeyOrder; let i = index; trackBy: identify\">\n <ng-container *ngIf=\"isStripShowing(stripsResultDataMap[key])\">\n <a name=\"{{stripsResultDataMap[key]?.stripTitle}}\" [class]=\"key\">\n <div *ngIf=\"stripsResultDataMap && (getLength(stripsResultDataMap[key]) ||\n stripsResultDataMap[key]?.showOnNoData ||\n stripsResultDataMap[key]?.showOnLoader ||\n stripsResultDataMap[key]?.showOnError)\n \" [ngClass]=\"\n !widgetData?.isChannelStrip ? 'xs:px-8 sx:px-10ss' : i > 0 ? 'mt-12' : ''\n \" [id]=\"key\" [ngClass]=\"!widgetData?.isChannelStrip ? margin-bottom-custom : margin-bottom-xs\">\n <div [ngClass]=\"{ pad: stripsResultDataMap[key]?.stripBackground }\"\n [ngStyle]=\"{ 'background-color': stripsResultDataMap[key]?.stripBackground }\">\n <div class=\"flex flex-col pl-4 pr-4 md:pr-0 md:pl-0 \" [ngClass]=\"\n !widgetData?.isChannelStrip\n ? ''\n : stripsResultDataMap[key]?.stripTitle\n ? 'mb-8'\n : ''\n \">\n <div class=\"flex flex-1 items-center\">\n <p class=\"mat-subheading-1 margin-remove inline-block \" *ngIf=\"stripsResultDataMap[key]?.stripTitle\">\n <span class=\"capitalize\" *ngIf=\"stripsResultDataMap[key]?.disableTranslate\">\n {{stripsResultDataMap[key]?.stripTitle}}\n </span>\n <span *ngIf=\"!stripsResultDataMap[key]?.disableTranslate\">\n {{ translateLabels(stripsResultDataMap[key]?.stripTitle, 'home') }}\n </span>\n </p>\n\n <button *ngIf=\"stripsResultDataMap[key]?.stripInfo?.icon\" type=\"button\" mat-icon-button\n (click)=\"toggleInfo(stripsResultDataMap[key])\" i18n-matTooltip matTooltip=\"info\"\n class=\"margin-left-xs\">\n <mat-icon>{{ stripsResultDataMap[key]?.stripInfo?.icon.icon }}</mat-icon>\n </button>\n <a *ngIf=\"stripsResultDataMap[key]?.stripTitleLink?.link\"\n [routerLink]=\"stripsResultDataMap[key]?.stripTitleLink?.link\"\n [queryParams]=\"stripsResultDataMap[key]?.stripTitleLink?.link?.queryParams\">\n <mat-icon class=\"ws-mat-primary-primary-text ws-mat-default-text\" [color]=\"'accent'\">{{\n stripsResultDataMap[key]?.stripTitleLink?.icon }}</mat-icon>\n </a>\n <span class=\"spacer\"></span>\n <!-- viewAll start-->\n <!-- <div *ngIf=\"checkCondition(widgetData , stripsResultDataMap[key])\"\n class=\"ml-4 pl-2 view-more ws-mat-default-text\">\n <a class=\"flex ws-mat-default-text items-center justify-center mat-body-1 cursor-pointer\" \n (click)=\"raiseTelemetry(stripsResultDataMap[key]);redirectViewAll(stripsResultDataMap[key], stripsResultDataMap[key]?.viewMoreUrl?.path, stripsResultDataMap[key]?.viewMoreUrl?.queryParams )\">\n <span i18n class=\"ws-mat-default-text\">{{translateLabels(widgetData.strips[0].viewMoreUrl.viewMoreText,'home') || 'See all'}}</span>\n <mat-icon class=\"ws-mat-default-text mat-icon notranslate material-icons mat-icon-no-color\" color=\"accent\">navigate_next</mat-icon>\n </a>\n </div> -->\n <!-- viewAll end-->\n </div>\n <button mat-icon-button (click)=\"setHiddenForStrip(key)\" *ngIf=\"stripsResultDataMap[key]?.canHideStrip\">\n <mat-icon>close</mat-icon>\n </button>\n <mat-icon class=\"cursor-pointer\" *ngIf=\"stripsResultDataMap[key]?.mode === 'accordion' && isMobile\"\n (click)=\"showAccordionData = !showAccordionData\">{{ showAccordionData ? 'expand_less' : 'expand_more' }}\n </mat-icon>\n </div>\n\n <div class=\"mb-4\" *ngIf=\"checkVisible(stripsResultDataMap[key])\">\n <ng-container [sbUiResolverWidget]=\"getdata(stripsResultDataMap[key])\">\n </ng-container>\n </div>\n <ng-container *ngIf=\"stripsResultDataMap[key]?.showOnNoData\"\n [sbUiResolverWidget]=\"stripsResultDataMap[key]?.noDataWidget\"></ng-container>\n <ng-container *ngIf=\"stripsResultDataMap[key]?.showOnError\"\n [sbUiResolverWidget]=\"stripsResultDataMap[key]?.errorWidget\"></ng-container>\n <!-- IF no errors then proceed to show tabs or non tabs strip -->\n <ng-container *ngIf=\"!stripsResultDataMap[key]?.showOnNoData && !stripsResultDataMap[key]?.showOnError\">\n <ng-container *ngIf=\"stripsResultDataMap[key].tabs && stripsResultDataMap[key].tabs.length\">\n <mat-tab-group animationDuration=\"0ms\" [selectedIndex]=\"getSelectedIndex(stripsResultDataMap[key], key)\"\n class=\"mat-tab-labels w-full strips-tabgroup\" dynamicHeight\n (selectedTabChange)=\"tabClicked($event, 0, stripsResultDataMap[key], key)\">\n <mat-tab label=\"{{tab?.label}}\" *ngFor=\"let tab of stripsResultDataMap[key].tabs; let last = last;let tabIndex = index\">\n <ng-template mat-tab-label>\n <span>{{ translateLabels(tab?.label, 'home') }} &nbsp;</span>\n <span *ngIf=\"tab?.showTabDataCount && tab?.widgets?.length\">({{tab?.widgets?.length}})</span>\n </ng-template>\n\n <div class=\"wfull\" *ngIf=\"tab?.pillsData && tab?.pillsData?.length\">\n <div class=\"flex justify-between\">\n <div>\n <ng-container >\n <mat-chip-list class=\"content-pill\" aria-label=\"Fish selection\">\n <ng-container *ngFor=\"let pill of tab?.pillsData;let p = index\">\n <mat-chip [selected]=\"pill?.selected\" (click)=\"pillClicked($event, stripsResultDataMap[key], key, p, tabIndex)\">\n <span class=\"pill-name\">{{pill?.label}}</span></mat-chip>\n </ng-container>\n </mat-chip-list>\n </ng-container>\n </div>\n <!-- viewAll start-->\n <!-- <div *ngIf=\"checkCondition(widgetData , stripsResultDataMap[key])\"\n class=\"ml-4 pl-2 view-more ws-mat-default-text\">\n <a class=\"flex ws-mat-default-text items-center justify-center mat-body-1 cursor-pointer\" \n (click)=\"raiseTelemetry(stripsResultDataMap[key]);redirectViewAll(stripsResultDataMap[key], stripsResultDataMap[key]?.viewMoreUrl?.path, stripsResultDataMap[key]?.viewMoreUrl?.queryParams )\">\n <span i18n class=\"ws-mat-default-text\">{{translateLabels(widgetData.strips[0].viewMoreUrl.viewMoreText,'home') || 'See all'}}</span>\n <mat-icon class=\"ws-mat-default-text mat-icon notranslate material-icons mat-icon-no-color\" color=\"accent\">navigate_next</mat-icon>\n </a>\n </div> -->\n <!-- viewAll end-->\n </div>\n <div *ngIf=\"stripsResultDataMap && stripsResultDataMap[key]?.showOnLoader ||\n !tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.fetchTabStatus\"\n class=\"text-center my-2\">\n <sb-uic-horizontal-scroller-v2 [sliderConfig]=\"stripsResultDataMap[key]?.sliderConfig\" [id]=\"key+'-scroller'\"\n [loadStatus]=\"'fetching'\" [stripConfig]=\"stripsResultDataMap[key]?.stripConfig\">\n <ng-container *ngFor=\"let widget of stripsResultDataMap[key]?.loaderWidgets; trackBy: tracker\">\n <ng-container [sbUiResolverWidget]=\"widget\"></ng-container>\n </ng-container>\n </sb-uic-horizontal-scroller-v2>\n </div>\n <ng-container *ngIf=\"tab?.pillsData && tab?.pillsData.length && tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]\">\n <div *ngIf=\"((tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.fetchTabStatus && tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.fetchTabStatus === 'done') &&\n (!tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.widgets || !tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.widgets?.length))\">\n <ng-container *ngIf=\"tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.value === 'inprogress'; else msgTemp\">\n <div class=\"w-full flex flex-col items-center justify-center\">\n <img alt=\"\" class=\"mt-4 mb-4\" src=\"assets/icons/home/nodataDefault.svg\">\n <div class=\"mat-subheading-1 text-center info-content\">{{ 'contentstripmultiple.getReadyForLearningAdventure' | translate }} -\n <a class=\"click-here\" [routerLink]=\"'/page/learn'\">{{ 'contentstripmultiple.clickHere' | translate }}</a> {{ 'contentstripmultiple.toEnrollNextCourse' | translate }}</div>\n </div>\n </ng-container>\n <ng-template #msgTemp>\n <div class=\"w-full flex flex-col items-center justify-center\">\n <img alt=\"\" class=\"mt-4 mb-4\" src=\"assets/icons/home/nodataDefault.png\">\n <div class=\"mat-subheading-1 text-center\">{{ translateLabels(tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.nodataMsg, 'home') }}</div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n <ng-container *ngIf=\"(tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.fetchTabStatus === 'done' || tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.widgets?.length)\">\n <ng-container *ngIf=\"!tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.tabLoading\">\n <sb-uic-horizontal-scroller-v2 [id]=\"key+'-scroller'\" [sliderConfig]=\"stripsResultDataMap[key]?.sliderConfig\" [widgetsLength]=\"tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.widgets?.length\"\n *ngIf=\"getContineuLearningLenth(stripsResultDataMap[key]) && showAccordion(key)\"\n [loadStatus]=\"'done'\" [defaultMaxWidgets]=\"tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.maxWidgets ||\n stripsResultDataMap[key]?.sliderConfig?.maxWidgets || defaultMaxWidgets\" [stripConfig]=\"stripsResultDataMap[key]?.stripConfig\">\n <ng-container *ngFor=\"let widget of tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.widgets| slice:0:(tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.maxWidgets ||\n stripsResultDataMap[key]?.sliderConfig?.maxWidgets || defaultMaxWidgets); trackBy: tracker\">\n <ng-container [sbUiResolverWidget]=\"widget\"></ng-container>\n </ng-container>\n </sb-uic-horizontal-scroller-v2>\n </ng-container>\n </ng-container>\n </div>\n </mat-tab>\n </mat-tab-group>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </a>\n\n </ng-container>\n </ng-container>\n</ng-template>",
16388
+ styles: [".view-more{display:flex;align-items:center;text-align:center;height:40px;justify-content:center}.view-more .icon{font-size:24px;width:24px;height:24px;border:1px solid;border-radius:50%;padding:8px;margin-bottom:8px}.margin-bottom-custom{margin-bottom:60px}.view-more:hover{background-color:#dcdfe5}::ng-deep.strips-tabgroup .mat-tab-header{border-bottom:2px solid rgba(0,0,0,.12)}::ng-deep.strips-tabgroup .mat-tab-body{padding:20px 0!important;box-sizing:border-box;overflow-y:initial!important}::ng-deep.strips-tabgroup .mat-tab-body-wrapper{overflow:inherit!important}::ng-deep.strips-tabgroup .mat-tab-label{border-bottom:0 solid rgba(0,0,0,.1);margin-right:0;opacity:1}::ng-deep.strips-tabgroup .mat-tab-label .mat-tab-label-content{text-transform:inherit;font:400 14px/20px Lato}::ng-deep.strips-tabgroup .mat-tab-label-active .mat-tab-label-content{font-weight:700!important}.click-here{color:#1b4ca1}.info-content{opacity:1;color:rgba(0,0,0,.87);font:700 14px/20px Lato-Bold;text-align:center}.active{background:#1b4ca1!important}.active .pill-name{color:#fff!important}::ng-deep .content-pill .mat-chip-selected{background-color:#1b4ca1!important}::ng-deep .content-pill .mat-chip-selected .pill-name{color:#fff!important}"]
16389
+ }] }
16390
+ ];
16391
+ /** @nocollapse */
16392
+ ContentStripWithTabsPillsComponent.ctorParameters = function () { return [
16393
+ { type: undefined, decorators: [{ type: Inject, args: ['environment',] }] },
16394
+ { type: WidgetContentService },
16395
+ { type: LoggerService },
16396
+ { type: EventService },
16397
+ { type: ConfigurationsService$1 },
16398
+ { type: UtilityService },
16399
+ { type: Router },
16400
+ { type: WidgetUserService },
16401
+ { type: TranslateService },
16402
+ { type: MultilingualTranslationsService }
16403
+ ]; };
16404
+ ContentStripWithTabsPillsComponent.propDecorators = {
16405
+ widgetData: [{ type: Input }],
16406
+ emptyResponse: [{ type: Output }],
16407
+ viewAllResponse: [{ type: Output }],
16408
+ telemtryResponse: [{ type: Output }],
16409
+ providerId: [{ type: Input }],
16410
+ emitViewAll: [{ type: Input }],
16411
+ channnelName: [{ type: Input }],
16412
+ id: [{ type: HostBinding, args: ['id',] }]
16413
+ };
16414
+ return ContentStripWithTabsPillsComponent;
16415
+ }(WidgetBaseComponent));
16416
+ if (false) {
16417
+ /** @type {?} */
16418
+ ContentStripWithTabsPillsComponent.prototype.widgetData;
16419
+ /** @type {?} */
16420
+ ContentStripWithTabsPillsComponent.prototype.emptyResponse;
16421
+ /** @type {?} */
16422
+ ContentStripWithTabsPillsComponent.prototype.viewAllResponse;
16423
+ /** @type {?} */
16424
+ ContentStripWithTabsPillsComponent.prototype.telemtryResponse;
16425
+ /** @type {?} */
16426
+ ContentStripWithTabsPillsComponent.prototype.providerId;
16427
+ /** @type {?} */
16428
+ ContentStripWithTabsPillsComponent.prototype.emitViewAll;
16429
+ /** @type {?} */
16430
+ ContentStripWithTabsPillsComponent.prototype.channnelName;
16431
+ /** @type {?} */
16432
+ ContentStripWithTabsPillsComponent.prototype.id;
16433
+ /** @type {?} */
16434
+ ContentStripWithTabsPillsComponent.prototype.stripsResultDataMap;
16435
+ /** @type {?} */
16436
+ ContentStripWithTabsPillsComponent.prototype.stripsKeyOrder;
16437
+ /** @type {?} */
16438
+ ContentStripWithTabsPillsComponent.prototype.showAccordionData;
16439
+ /** @type {?} */
16440
+ ContentStripWithTabsPillsComponent.prototype.showParentLoader;
16441
+ /** @type {?} */
16442
+ ContentStripWithTabsPillsComponent.prototype.showParentError;
16443
+ /** @type {?} */
16444
+ ContentStripWithTabsPillsComponent.prototype.showParentNoData;
16445
+ /** @type {?} */
16446
+ ContentStripWithTabsPillsComponent.prototype.errorDataCount;
16447
+ /** @type {?} */
16448
+ ContentStripWithTabsPillsComponent.prototype.noDataCount;
16449
+ /** @type {?} */
16450
+ ContentStripWithTabsPillsComponent.prototype.successDataCount;
16451
+ /** @type {?} */
16452
+ ContentStripWithTabsPillsComponent.prototype.contentAvailable;
16453
+ /** @type {?} */
16454
+ ContentStripWithTabsPillsComponent.prototype.baseUrl;
16455
+ /** @type {?} */
16456
+ ContentStripWithTabsPillsComponent.prototype.veifiedKarmayogi;
16457
+ /** @type {?} */
16458
+ ContentStripWithTabsPillsComponent.prototype.environment;
16459
+ /** @type {?} */
16460
+ ContentStripWithTabsPillsComponent.prototype.changeEventSubscription;
16461
+ /** @type {?} */
16462
+ ContentStripWithTabsPillsComponent.prototype.defaultMaxWidgets;
16463
+ /** @type {?} */
16464
+ ContentStripWithTabsPillsComponent.prototype.enrollInterval;
16465
+ /** @type {?} */
16466
+ ContentStripWithTabsPillsComponent.prototype.todaysEvents;
16467
+ /** @type {?} */
16468
+ ContentStripWithTabsPillsComponent.prototype.enrollmentMapData;
16469
+ /**
16470
+ * @type {?}
16471
+ * @private
16472
+ */
16473
+ ContentStripWithTabsPillsComponent.prototype.contentSvc;
16474
+ /**
16475
+ * @type {?}
16476
+ * @private
16477
+ */
16478
+ ContentStripWithTabsPillsComponent.prototype.loggerSvc;
16479
+ /**
16480
+ * @type {?}
16481
+ * @private
16482
+ */
16483
+ ContentStripWithTabsPillsComponent.prototype.eventSvc;
16484
+ /**
16485
+ * @type {?}
16486
+ * @private
16487
+ */
16488
+ ContentStripWithTabsPillsComponent.prototype.configSvc;
16489
+ /** @type {?} */
16490
+ ContentStripWithTabsPillsComponent.prototype.utilitySvc;
16491
+ /** @type {?} */
16492
+ ContentStripWithTabsPillsComponent.prototype.router;
16493
+ /**
16494
+ * @type {?}
16495
+ * @private
16496
+ */
16497
+ ContentStripWithTabsPillsComponent.prototype.userSvc;
16498
+ /**
16499
+ * @type {?}
16500
+ * @private
16501
+ */
16502
+ ContentStripWithTabsPillsComponent.prototype.translate;
16503
+ /**
16504
+ * @type {?}
16505
+ * @private
16506
+ */
16507
+ ContentStripWithTabsPillsComponent.prototype.langtranslations;
16508
+ }
16509
+
16510
+ /**
16511
+ * @fileoverview added by tsickle
16512
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
16513
+ */
16514
+ // tslint:disable-next-line:function-name
16515
+ /**
16516
+ * @param {?} http
16517
+ * @return {?}
16518
+ */
16519
+ function HttpLoaderFactory1(http) {
16520
+ return new TranslateHttpLoader(http);
16521
+ }
16522
+ var ContentStripWithTabsPillsModule = /** @class */ (function () {
16523
+ function ContentStripWithTabsPillsModule() {
16524
+ }
16525
+ ContentStripWithTabsPillsModule.decorators = [
16526
+ { type: NgModule, args: [{
16527
+ declarations: [ContentStripWithTabsPillsComponent],
16528
+ imports: [
16529
+ SbUiResolverModule,
16530
+ CommonModule,
16531
+ RouterModule,
16532
+ HorizontalScrollerV2Module,
16533
+ MatProgressSpinnerModule,
16534
+ MatToolbarModule,
16535
+ MatIconModule,
16536
+ MatButtonModule,
16537
+ MatTooltipModule,
16538
+ MatListModule,
16539
+ MatSidenavModule,
16540
+ MatCardModule,
16541
+ MatExpansionModule,
16542
+ MatRadioModule,
16543
+ MatChipsModule,
16544
+ MatInputModule,
16545
+ MatFormFieldModule,
16546
+ MatDialogModule,
16547
+ MatSnackBarModule,
16548
+ MatSelectModule,
16549
+ MatDatepickerModule,
16550
+ MatNativeDateModule,
16551
+ MatTableModule,
16552
+ MatCheckboxModule,
16553
+ MatProgressSpinnerModule,
16554
+ MatButtonToggleModule,
16555
+ MatTabsModule,
16556
+ MatAutocompleteModule,
16557
+ TranslateModule.forRoot({
16558
+ loader: {
16559
+ provide: TranslateLoader,
16560
+ useFactory: HttpLoaderFactory1,
16561
+ deps: [HttpClient],
16562
+ },
16563
+ }),
16564
+ ],
16565
+ entryComponents: [ContentStripWithTabsPillsComponent],
16566
+ exports: [ContentStripWithTabsPillsComponent],
16567
+ },] }
16568
+ ];
16569
+ return ContentStripWithTabsPillsModule;
16570
+ }());
16571
+
12391
16572
  /**
12392
16573
  * @fileoverview added by tsickle
12393
16574
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -14250,5 +18431,5 @@ var UserContentRatingLibModule = /** @class */ (function () {
14250
18431
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
14251
18432
  */
14252
18433
 
14253
- export { AnnouncementsModule, CalenderModule, CardsModule, CommonMethodsService, CommonStripModule, CompetencyPassbookMdoModule, CompetencyPassbookModule, ConsumptionComponent, ConsumptionModule, ConsumptionService, ContentProgressModule, ContentStripWithTabsLibModule, DataPointsModule, HttpLoaderFactory, MyHammerConfig, ROOT_WIDGET_CONFIG, SlidersLibModule, UserContentRatingLibModule, WIDGET_REGISTERED_LIB_MODULES, WIDGET_REGISTRATION_LIB_CONFIG, WidgetContentService, ContentStripWithTabsLibComponent as ɵa, WidgetUserService as ɵb, CardWideV2Component as ɵba, CardKarmaProgramsComponent as ɵbb, CardKarmaProgramsV2Component as ɵbc, ProviderCardComponent as ɵbd, CardPortraitExtComponent as ɵbe, CardAssessmentComponent as ɵbf, CardProgressPortraitLibComponent as ɵbg, CertificateService as ɵbh, CardMdoChannelV1Component as ɵbi, PipePublicURLModule as ɵbj, PipePublicURL as ɵbk, ObjectToArrayPipeModule as ɵbl, ObjectToArrayPipe as ɵbm, DisplayContentTypeLibModule as ɵbn, DisplayContentTypeLibComponent as ɵbo, DefaultThumbnailModule as ɵbp, DefaultThumbnailDirective as ɵbq, PipeDurationTransformModule as ɵbr, PipeDurationTransformPipe as ɵbs, ContentProgressComponent as ɵbt, DialogComponentsModule as ɵbu, CertificateDialogComponent as ɵbv, AvatarPhotoLibModule as ɵbw, AvatarPhotoLibComponent as ɵbx, CompetencyPassbookComponent as ɵby, CompetencyPassbookService as ɵbz, MultilingualTranslationsService as ɵc, PillsModule as ɵca, PillsComponent as ɵcb, CompetencyPassbookMdoComponent as ɵcc, CompetencyPassbookMdoService as ɵcd, UserContentRatingLibComponent as ɵce, ScrollableItemDirective as ɵcf, RatingService as ɵcg, UserContentRatingLibService as ɵch, MyHammerConfig$1 as ɵci, SlidersNgContentLibModule as ɵcj, SlidersNgContentLibComponent as ɵck, ScrollableItemModule as ɵcl, ConfigurationsService as ɵd, HorizontalScrollerV2Module as ɵe, HorizontalScrollerV2Component as ɵf, SlidersLibComponent as ɵg, NavigationModule as ɵh, NavigationDirective as ɵi, ImageResponsiveModule as ɵj, ImageResponsiveDirective as ɵk, DataPointsComponent as ɵl, InsiteDataService as ɵm, SkeletonLoaderLibModule as ɵn, SkeletonLoaderLibComponent as ɵo, CalenderComponent as ɵp, CalenderDayComponent as ɵq, CommonStripComponent as ɵr, AnnouncementsComponent as ɵs, CardResourceComponent as ɵt, CardsComponent as ɵu, CardPortraitComponent as ɵv, CardUserComponent as ɵw, CardLandscapeComponent as ɵx, CardWideComponent as ɵy, CardMDOChannelComponent as ɵz };
18434
+ export { AnnouncementsModule, CalenderModule, CardsModule, CommonMethodsService, CommonStripModule, CompetencyPassbookMdoModule, CompetencyPassbookModule, ConsumptionComponent, ConsumptionModule, ConsumptionService, ContentProgressModule, ContentStripWithTabsLibModule, ContentStripWithTabsPillsModule, DataPointsModule, HttpLoaderFactory, HttpLoaderFactory1, MyHammerConfig, ROOT_WIDGET_CONFIG, SlidersLibModule, UserContentRatingLibModule, WIDGET_REGISTERED_LIB_MODULES, WIDGET_REGISTRATION_LIB_CONFIG, WidgetContentService, ContentStripWithTabsLibComponent as ɵa, WidgetUserService as ɵb, CardWideV2Component as ɵba, CardKarmaProgramsComponent as ɵbb, CardKarmaProgramsV2Component as ɵbc, ProviderCardComponent as ɵbd, CardPortraitExtComponent as ɵbe, CardAssessmentComponent as ɵbf, CardProgressPortraitLibComponent as ɵbg, CertificateService as ɵbh, CardMdoChannelV1Component as ɵbi, PipePublicURLModule as ɵbj, PipePublicURL as ɵbk, ObjectToArrayPipeModule as ɵbl, ObjectToArrayPipe as ɵbm, DisplayContentTypeLibModule as ɵbn, DisplayContentTypeLibComponent as ɵbo, DefaultThumbnailModule as ɵbp, DefaultThumbnailDirective as ɵbq, PipeDurationTransformModule as ɵbr, PipeDurationTransformPipe as ɵbs, ContentProgressComponent as ɵbt, DialogComponentsModule as ɵbu, CertificateDialogComponent as ɵbv, AvatarPhotoLibModule as ɵbw, AvatarPhotoLibComponent as ɵbx, ContentStripWithTabsPillsComponent as ɵby, CompetencyPassbookComponent as ɵbz, MultilingualTranslationsService as ɵc, CompetencyPassbookService as ɵca, PillsModule as ɵcb, PillsComponent as ɵcc, CompetencyPassbookMdoComponent as ɵcd, CompetencyPassbookMdoService as ɵce, UserContentRatingLibComponent as ɵcf, ScrollableItemDirective as ɵcg, RatingService as ɵch, UserContentRatingLibService as ɵci, MyHammerConfig$1 as ɵcj, SlidersNgContentLibModule as ɵck, SlidersNgContentLibComponent as ɵcl, ScrollableItemModule as ɵcm, ConfigurationsService as ɵd, HorizontalScrollerV2Module as ɵe, HorizontalScrollerV2Component as ɵf, SlidersLibComponent as ɵg, NavigationModule as ɵh, NavigationDirective as ɵi, ImageResponsiveModule as ɵj, ImageResponsiveDirective as ɵk, DataPointsComponent as ɵl, InsiteDataService as ɵm, SkeletonLoaderLibModule as ɵn, SkeletonLoaderLibComponent as ɵo, CalenderComponent as ɵp, CalenderDayComponent as ɵq, CommonStripComponent as ɵr, AnnouncementsComponent as ɵs, CardResourceComponent as ɵt, CardsComponent as ɵu, CardPortraitComponent as ɵv, CardUserComponent as ɵw, CardLandscapeComponent as ɵx, CardWideComponent as ɵy, CardMDOChannelComponent as ɵz };
14254
18435
  //# sourceMappingURL=sunbird-cb-consumption.js.map