@global.engg/switcher-lib 0.0.33 → 0.0.52

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.
@@ -56,23 +56,29 @@
56
56
  this.router = router;
57
57
  this._http = _http;
58
58
  this.windowRef = windowRef;
59
+ // {
60
+ // "name": "@jitender_sharma/switcher-lib",
61
+ // "version": "0.0.28",
62
+ // "peerDependencies": {
63
+ // "@angular/common": "^12.2.0",
64
+ // "@angular/core": "^12.2.0"
65
+ // },
66
+ // "dependencies": {
67
+ // "tslib": "^2.3.0"
68
+ // }
69
+ // }
59
70
  this.SR_CONSTANTS = {
60
- QuickWebBaseUrl: window.location.host == 'app.shiprocket.in'
61
- ? 'https://quick.shiprocket.in/'
62
- : 'https://sr-quick-courier-qa-1-web.kartrocket.com/',
63
- EngageWebBaseUrl: window.location.host == 'app.shiprocket.in'
64
- ? 'https://app-engage.shiprocket.in/'
65
- : 'https://sr-engage-web-stage.kartrocket.com/',
71
+ QuickWebBaseUrl: 'https://quick.shiprocket.in/',
72
+ EngageWebBaseUrl: 'https://app-engage.shiprocket.in/',
66
73
  CheckoutWebBaseUrl: 'https://checkout-app.shiprocket.in/',
67
74
  SrfWebBaseUrl: 'https://srf-app.shiprocket.in/',
68
75
  FulfillmentWebBaseUrl: 'https://fulfillment.shiprocket.in',
69
76
  WigzoWebBaseUrl: 'https://convert.shiprocket.in/wigzo/lite/auth/shiprocket/login',
70
- PickrrWebBaseUrl: window.location.host == 'app.shiprocket.in'
71
- ? 'https://dashboard.pickrr.com/'
72
- : 'https://shiprocket-to-pickrr.netlify.app/',
73
- EngagePlusWebBaseURL: window.location.host == 'app.shiprocket.in' ? 'https://app-engage.shiprocket.in/' : 'https://sr-engage-web-qa-3.kartrocket.com/'
77
+ PickrrWebBaseUrl: 'https://dashboard.pickrr.com/',
78
+ EngagePlusWebBaseURL: 'https://app-engage.shiprocket.in/'
74
79
  };
75
- this.userData = JSON.parse(localStorage.getItem('ngStorage-USER') || '{}');
80
+ this.DOMAIN = 'https://app.shiprocket.in';
81
+ this.userData = JSON.parse(localStorage.getItem('ngStorage-USER') || localStorage.getItem('_userData') || '{}');
76
82
  this.isDesktop = false;
77
83
  this.appSwitchList = [
78
84
  {
@@ -191,10 +197,10 @@
191
197
  }
192
198
  else if (app === 'rocketbox') {
193
199
  if (this.userData.allow_rb_panel || this.userData.is_rb_user) {
194
- window.location.href = window.location.origin + '/rocketbox';
200
+ window.location.href = this.DOMAIN + "/rocketbox";
195
201
  }
196
202
  else {
197
- window.location.href = window.location.origin + '/seller' + '/settings/internationalsettings/internationalkyc';
203
+ window.location.href = this.DOMAIN + "/seller/settings/internationalsettings/internationalkyc";
198
204
  }
199
205
  }
200
206
  else if (((_a = this.userData) === null || _a === void 0 ? void 0 : _a.allow_sr_convert) &&
@@ -239,17 +245,17 @@
239
245
  }
240
246
  else if (app === 'creditScore') {
241
247
  if ((_c = this.userData) === null || _c === void 0 ? void 0 : _c.is_crif_enabled) {
242
- window.open("https://app.shiprocket.in/capital/crif-home/?utm_source=App-Switcher&utm_medium=Manual-Adhoc&utm_content=crif_credit_score&utm_term=app_switcher_click", '_blank');
248
+ window.open("https://capital-web.shiprocket.in/crif-home/?utm_source=App-Switcher&utm_medium=Manual-Adhoc&utm_content=crif_credit_score&utm_term=app_switcher_click&authToken=" + this.userData.token, '_blank');
243
249
  }
244
250
  else {
245
251
  window.open("https://www.shiprocket.in/capital/", '_blank');
246
252
  }
247
253
  }
248
254
  else if (app === 'capital') {
249
- window.open("https://app.shiprocket.in/capital/home/?utm_source=App-Switcher&utm_medium=Manual-Adhoc&utm_content=capital&utm_term=flexi_business_loan", '_blank');
255
+ window.open("https://capital-web.shiprocket.in/home/?utm_source=App-Switcher&utm_medium=Manual-Adhoc&utm_content=capital&utm_term=flexi_business_loan&authToken=" + this.userData.token, '_blank');
250
256
  }
251
257
  else if (app === 'marketing') {
252
- window.location.href = window.location.origin + '/seller' + '/home';
258
+ window.location.href = this.DOMAIN + "/seller/home";
253
259
  }
254
260
  else if (app === 'whatsapp_solutions') {
255
261
  if (this.userData.allow_engage) {
@@ -261,20 +267,20 @@
261
267
  }
262
268
  else if (app === 'internationalParcels') {
263
269
  if (kyc_status == 0 || kyc_status == 1 || kyc_status == 2 || kyc_status == 4) {
264
- window.location.href = window.location.origin + '/seller' + '/internationalDashboard/overview';
270
+ window.location.href = this.DOMAIN + "/seller/internationalDashboard/overview";
265
271
  }
266
272
  else {
267
- window.location.href = window.location.origin + '/seller' + '/settings/internationalsettings/internationalkyc';
273
+ window.location.href = this.DOMAIN + "/seller/settings/internationalsettings/internationalkyc";
268
274
  }
269
275
  }
270
276
  else if (app === 'i_rocketbox') {
271
- window.location.href = window.location.origin + '/seller' + '/settings/internationalsettings/internationalkyc';
277
+ window.location.href = this.DOMAIN + "/seller/settings/internationalsettings/internationalkyc";
272
278
  }
273
279
  else if (app === 'brand_launch') {
274
- window.location.href = window.location.origin + '/seller' + '/settings/internationalsettings/internationalkyc';
280
+ window.location.href = this.DOMAIN + "/seller/settings/internationalsettings/internationalkyc";
275
281
  }
276
282
  else if (app === 'express_parcel') {
277
- window.location.href = window.location.origin + '/seller' + '/home';
283
+ window.location.href = this.DOMAIN + "/seller/home";
278
284
  }
279
285
  else if (app === 'instant_deliveries') {
280
286
  window.open(this.SR_CONSTANTS.QuickWebBaseUrl + "gate-keeper?token=" + this.userData.token, '_blank');
@@ -284,10 +290,10 @@
284
290
  window.open("https://fulfillment.shiprocket.in/", '_blank');
285
291
  }
286
292
  else if (app == 'srocketbox') {
287
- window.location.href = window.location.origin + '/seller' + '/settings/internationalsettings/internationalkyc';
293
+ window.location.href = this.DOMAIN + "/seller/settings/internationalsettings/internationalkyc";
288
294
  }
289
295
  else if (app == 'somuni') {
290
- window.location.href = window.location.origin + '/seller' + '/home';
296
+ window.location.href = this.DOMAIN + "/seller/home";
291
297
  }
292
298
  };
293
299
  AppSwitcherService.prototype.sendGaEvent = function (event) {
@@ -383,7 +389,7 @@
383
389
  this.send(category, eventName, label);
384
390
  };
385
391
  AppSwitcherService.prototype.send = function (eventCategory, eventAction, eventLabel) {
386
- var _a;
392
+ var _a, _b, _c;
387
393
  var source = ((_a = document.cookie
388
394
  .split('; ')
389
395
  .find(function (row) { return row.startsWith('UTM='); })) === null || _a === void 0 ? void 0 : _a.split('=')[1]) || '';
@@ -392,10 +398,12 @@
392
398
  eventAction: eventAction,
393
399
  eventLabel: eventLabel ? eventLabel : source,
394
400
  });
395
- this.windowRef.nativeWindow.gtag_g4('event', eventAction, {
396
- event_category: eventCategory,
397
- event_label: eventLabel ? eventLabel : source,
398
- });
401
+ if (((_c = (_b = this.windowRef) === null || _b === void 0 ? void 0 : _b.nativeWindow) === null || _c === void 0 ? void 0 : _c.gtag_g4) && typeof this.windowRef.nativeWindow.gtag_g4 === 'function') {
402
+ this.windowRef.nativeWindow.gtag_g4('event', eventAction, {
403
+ event_category: eventCategory,
404
+ event_label: eventLabel ? eventLabel : source,
405
+ });
406
+ }
399
407
  };
400
408
  AppSwitcherService.prototype.fetchOpenInAppLink = function () {
401
409
  this._http.get('oneimpression/open-app-redirection_url')
@@ -431,7 +439,7 @@
431
439
  }]
432
440
  }], ctorParameters: function () { return [{ type: i1__namespace.Router }, { type: i2__namespace.HttpClient }, { type: WindowRef }]; } });
433
441
 
434
- var user = JSON.parse(localStorage.getItem('ngStorage-USER') || '{}');
442
+ var user = JSON.parse(localStorage.getItem('ngStorage-USER') || localStorage.getItem('_userData') || '{}');
435
443
  var SwitcherComponent = /** @class */ (function () {
436
444
  function SwitcherComponent(appSwitcherService, _http, windowRef) {
437
445
  var _this = this;
@@ -443,21 +451,25 @@
443
451
  this.isDesktop = false;
444
452
  this.company_id = '';
445
453
  this.userData = user;
454
+ this.recentUsedProducts = [];
446
455
  this.appSwitcherApps = {
447
456
  shipping_fulfilment_india: [
448
457
  {
458
+ id: 1,
449
459
  appLogo: 'https://sr-cdn-1.shiprocket.in/img/Web_New/Express-Parcel.png',
450
460
  appName: 'express_parcel',
451
461
  checkKey: 'Domestic Shipping',
452
462
  displayName: 'Domestic Shipping',
453
463
  subText: 'Multiple couriers, SDD/NDD, widest reach'
454
464
  }, {
465
+ id: 2,
455
466
  appLogo: 'https://sr-cdn-1.shiprocket.in/img/Web_New/Instant-deliveries.png',
456
467
  appName: 'instant_deliveries',
457
468
  checkKey: 'Instant deliveries',
458
469
  displayName: 'Instant deliveries',
459
470
  subText: 'Multiple couriers, Hyperlocal, Intracity'
460
471
  }, {
472
+ id: 3,
461
473
  appLogo: 'https://sr-cdn-1.shiprocket.in/img/Web_New/Warehousing.png',
462
474
  appName: 'fullfilment',
463
475
  checkKey: 'Warehousing',
@@ -465,6 +477,7 @@
465
477
  subText: 'End-to-end brand fulfilment '
466
478
  },
467
479
  {
480
+ id: 4,
468
481
  appLogo: 'https://sr-cdn-1.shiprocket.in/img/Web_New/Cargo.png',
469
482
  appName: 'rocketbox',
470
483
  checkKey: 'allow_rocketbox',
@@ -473,18 +486,21 @@
473
486
  },
474
487
  ],
475
488
  cross_border_commerce: [{
489
+ id: 5,
476
490
  appLogo: 'https://sr-cdn-1.shiprocket.in/img/Web_New/International-Parcels.png',
477
491
  appName: 'internationalParcels',
478
492
  checkKey: 'internationalParcels',
479
493
  displayName: 'International Parcels',
480
494
  subText: 'Ship to 220+ countries'
481
495
  }, {
496
+ id: 6,
482
497
  appLogo: 'https://sr-cdn-1.shiprocket.in/img/Web_New/International-Cargo.png',
483
498
  appName: 'i_rocketbox',
484
499
  checkKey: 'i_allow_rocketbox',
485
500
  displayName: 'International Cargo',
486
501
  subText: 'Air & Ocean freight'
487
502
  }, {
503
+ id: 7,
488
504
  appLogo: 'https://sr-cdn-1.shiprocket.in/img/Web_New/Brand-Launch.png',
489
505
  appName: 'brand_launch',
490
506
  checkKey: 'brand_launch',
@@ -492,12 +508,14 @@
492
508
  subText: 'Expand your brand globally '
493
509
  }],
494
510
  growth_marketing_solutions: [{
511
+ id: 8,
495
512
  appLogo: 'https://sr-cdn-1.shiprocket.in/img/Web_New/Checkout.png',
496
513
  appName: 'checkout',
497
514
  checkKey: 'allow_checkout',
498
515
  displayName: 'Checkout',
499
516
  subText: 'Simplified one-click checkout'
500
517
  }, {
518
+ id: 9,
501
519
  appLogo: 'https://sr-cdn-1.shiprocket.in/img/Web_New/Whatsapp-Solutions.png',
502
520
  appName: 'whatsapp_solutions',
503
521
  checkKey: 'whatsapp_solutions',
@@ -505,12 +523,14 @@
505
523
  subText: 'Marketing, commerce, chatbot - ',
506
524
  nextLineLabel: ''
507
525
  }, {
526
+ id: 10,
508
527
  appLogo: 'https://sr-cdn-1.shiprocket.in/img/Web_New/Marketing.png',
509
528
  appName: 'marketing',
510
529
  checkKey: 'marketing',
511
530
  displayName: 'Marketing',
512
531
  subText: 'Digital and influencer marketing & more '
513
532
  }, {
533
+ id: 11,
514
534
  appLogo: 'https://sr-cdn-1.shiprocket.in/img/Web_New/trends.png',
515
535
  appName: 'trends',
516
536
  checkKey: 'allow_trends',
@@ -518,12 +538,14 @@
518
538
  subText: 'E-commerce analytics for Bharat'
519
539
  }],
520
540
  financial_servicea: [{
541
+ id: 12,
521
542
  appLogo: 'https://sr-cdn-1.shiprocket.in/img/Web_New/Capital.png',
522
543
  appName: 'capital',
523
544
  checkKey: 'Capital',
524
545
  displayName: 'Business Loan',
525
546
  subText: 'Flexible Business loan up to ₹20 Lakhs'
526
547
  }, {
548
+ id: 13,
527
549
  appLogo: 'https://sr-cdn-1.shiprocket.in/img/Web_New/Credit-Score.png',
528
550
  appName: 'creditScore',
529
551
  checkKey: 'Credit Score',
@@ -531,6 +553,7 @@
531
553
  subText: 'Check your credit score for free '
532
554
  }],
533
555
  other_services: [{
556
+ id: 14,
534
557
  appLogo: 'https://sr-cdn-1.shiprocket.in/img/Web_New/Omnichannel.png',
535
558
  appName: 'omuni',
536
559
  checkKey: 'allow_omuni',
@@ -542,7 +565,6 @@
542
565
  this.MOBILE_BREAKPOINT = 768;
543
566
  this.user = user;
544
567
  this.appSwitchList = [];
545
- console.log(this.data);
546
568
  this.resizeListener = function () {
547
569
  // Clear the timeout if it exists
548
570
  if (_this.resizeTimeout) {
@@ -564,6 +586,7 @@
564
586
  if (sidebar) {
565
587
  sidebar.setAttribute('style', 'display: none');
566
588
  }
589
+ this.getCompanyService();
567
590
  };
568
591
  SwitcherComponent.prototype.closeModal = function () {
569
592
  this.isModalOpen = false;
@@ -574,17 +597,15 @@
574
597
  };
575
598
  SwitcherComponent.prototype.ngOnInit = function () {
576
599
  var _this = this;
577
- this.userJson = localStorage.getItem('ngStorage-USER');
578
- this.company_id = this.userJson != null ? JSON.parse(this.userJson).company_id : '';
579
- // Filter out apps based on input data
600
+ var _a;
601
+ this.userJson = JSON.parse(localStorage.getItem('ngStorage-USER') || localStorage.getItem('_userData') || '{}');
602
+ this.company_id = this.userJson != null ? (_a = this.userJson) === null || _a === void 0 ? void 0 : _a.company_id : '';
580
603
  if (this.data) {
581
604
  var appsToRemove_1 = this.data.split(',').map(function (app) { return app.trim(); });
582
- // Filter each category in appSwitcherApps
583
605
  Object.keys(this.appSwitcherApps).forEach(function (category) {
584
606
  _this.appSwitcherApps[category] = _this.appSwitcherApps[category].filter(function (app) { return !appsToRemove_1.includes(app.appName); });
585
607
  });
586
608
  }
587
- this.getKYCData();
588
609
  };
589
610
  SwitcherComponent.prototype.ngOnDestroy = function () {
590
611
  this.windowRef.nativeWindow.removeEventListener('resize', this.resizeListener);
@@ -606,17 +627,108 @@
606
627
  }, function (error) {
607
628
  });
608
629
  };
609
- SwitcherComponent.prototype.callEvent = function (type, id) {
610
- this.appSwitcherService.appSwitch(type, this.kycStatus);
611
- this.appSwitcherService.send('Swithcer Service Selection', id, 'Company Id : ' + this.company_id);
630
+ SwitcherComponent.prototype.getBaseUrl = function () {
631
+ var currentUrl = window.location.hostname;
632
+ if (currentUrl.includes('multichannel-channels-partnerships-qa-web.kartrocket.com')) {
633
+ return 'https://multichannel-channels-partnerships-qa-api.kartrocket.com/v1/';
634
+ }
635
+ else if (currentUrl.includes('app.shiprocket.in')) {
636
+ return 'https://apiv2.shiprocket.co/v1/';
637
+ }
638
+ else {
639
+ return 'https://apiv2.shiprocket.co/v1/';
640
+ }
641
+ };
642
+ SwitcherComponent.prototype.callEvent = function (type, displayName) {
643
+ var _this = this;
644
+ // List of apps that require API call before redirection
645
+ var apiFirstApps = [
646
+ 'rocketbox', 'marketing', 'internationalParcels',
647
+ 'i_rocketbox', 'brand_launch', 'express_parcel',
648
+ 'srocketbox', 'somuni'
649
+ ];
650
+ // If not in apiFirstApps list, redirect immediately
651
+ if (!apiFirstApps.includes(type)) {
652
+ this.appSwitcherService.appSwitch(type, this.kycStatus);
653
+ }
654
+ this.appSwitcherService.send('Swithcer Service Selection', displayName, 'Company Id : ' + this.company_id);
655
+ // Find the app object across all categories that matches the displayName
656
+ var appId;
657
+ var clickedApp;
658
+ Object.values(this.appSwitcherApps).forEach(function (category) {
659
+ var categoryArray = category;
660
+ var app = categoryArray.find(function (app) { return app.displayName === displayName; });
661
+ if (app) {
662
+ appId = app.id;
663
+ clickedApp = app;
664
+ }
665
+ });
666
+ var data = {
667
+ service_id: appId.toString()
668
+ };
669
+ var headers = {
670
+ 'Content-Type': 'application/json',
671
+ 'Authorization': 'Bearer ' + this.userData.token
672
+ };
673
+ this._http.post(this.getBaseUrl() + "settings/company-service", data, { headers: headers }).subscribe(function (res) {
674
+ // API call complete, but we don't wait for it
675
+ }, function (error) { });
676
+ // Handle UI updates and navigation independently with timeout
677
+ setTimeout(function () {
678
+ if (clickedApp) {
679
+ var newRecentProduct = {
680
+ appName: clickedApp.appName,
681
+ appLogo: clickedApp.appLogo,
682
+ displayName: clickedApp.displayName
683
+ };
684
+ // Remove the clicked item if it exists
685
+ _this.recentUsedProducts = _this.recentUsedProducts.filter(function (item) { return item.displayName !== displayName; });
686
+ // Add new item at the beginning
687
+ _this.recentUsedProducts.unshift(newRecentProduct);
688
+ // Keep only the first 4 elements
689
+ _this.recentUsedProducts = _this.recentUsedProducts.slice(0, 4);
690
+ // For apps in apiFirstApps list, redirect after timeout
691
+ if (apiFirstApps.includes(type)) {
692
+ _this.appSwitcherService.appSwitch(type, _this.kycStatus);
693
+ }
694
+ }
695
+ }, 500); // 500ms timeout
612
696
  };
613
697
  SwitcherComponent.prototype.appSwitch = function (app) {
614
698
  this.appSwitcherService.appSwitch(app);
615
699
  };
700
+ SwitcherComponent.prototype.getCompanyService = function () {
701
+ var _this = this;
702
+ var headers = {
703
+ 'Content-Type': 'application/json',
704
+ 'Authorization': 'Bearer ' + this.userData.token
705
+ };
706
+ this._http.get(this.getBaseUrl() + "settings/company-service", { headers: headers }).subscribe(function (res) {
707
+ _this.appSwitchList = res.data;
708
+ // Map the API response to recentUsedProducts
709
+ _this.recentUsedProducts = res.data.map(function (item) {
710
+ // Search for matching app across all categories
711
+ var matchedApp;
712
+ Object.values(_this.appSwitcherApps).forEach(function (category) {
713
+ var categoryArray = category;
714
+ var app = categoryArray.find(function (app) { return app.id === item.service_id; });
715
+ if (app) {
716
+ matchedApp = app;
717
+ }
718
+ });
719
+ // Return mapped object if match found, otherwise return null
720
+ return matchedApp ? {
721
+ appName: matchedApp.appName,
722
+ appLogo: matchedApp.appLogo,
723
+ displayName: matchedApp.displayName
724
+ } : null;
725
+ }).filter(function (item) { return item !== null; });
726
+ });
727
+ };
616
728
  return SwitcherComponent;
617
729
  }());
618
730
  SwitcherComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SwitcherComponent, deps: [{ token: AppSwitcherService }, { token: i2__namespace.HttpClient }, { token: WindowRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
619
- SwitcherComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: SwitcherComponent, selector: "lib-switcher", inputs: { data: "data" }, ngImport: i0__namespace, template: "<div class=\"\" [style.display]=\"!isMobileView ? 'block' : 'none'\">\n <button class=\"p-0 me-2 appSwitcherBtn\" (click)=\"openModal()\" *ngIf=\"userData.allow_checkout || userData.allow_engage || userData.allow_fbs || !userData.allow_fbs\">\n <div class=\"appSwitcherTxt\">\n ALL PRODUCTS\n <img class=\"ml-2 position-relative w-15\" style=\"top: -1px\" src=\"https://sr-sidebar.shiprocket.in/assets/svg/apps.svg\" />\n </div>\n </button>\n</div>\n\n<div [style.display]=\"isMobileView ? 'block' : 'none'\">\n <button\n (click)=\"openModal()\"\n class=\"switcher_icon\"\n >\n <img\n src=\"https://sr-sidebar.shiprocket.in/assets/svg/apps.svg\"\n alt=\"apps\"\n class=\"logo\"\n />\n </button>\n</div>\n\n<div *ngIf=\"isModalOpen\" class=\"modal\" [@modalAnimation]>\n <div class=\"modal-content_new\">\n <span class=\"close\" (click)=\"closeModal()\"><img src=\"https://sr-sidebar.shiprocket.in/assets/svg/cross-dark.svg\" /></span>\n \n <!-- ------------------------------------------------------------------------------------------------- -->\n\n\n <div class=\"mobileScreen\">\n\n\n <div class=\"Topheader\">\n <h1>Select the product you would like to experience </h1>\n <p>Elevate your business with our industry-leading products.</p>\n </div>\n\n\n <ng-container *ngIf=\"appSwitchList && appSwitchList.length\">\n <h5 class=\"section_heading\">Featured Products</h5>\n <div class=\"d-flex gap-4 flex-wrap\">\n <div class=\"box_section featured_section mob_box_section\" (click)=\"appSwitch(item.appName)\" *ngFor=\"let item of appSwitchList; let i = index\">\n <img class=\"icon\" [src]=\"item.appLogo\" />\n <h6>{{item.displayName}}</h6>\n <span class=\"getstarted mob_getstarted\">Get Started <img src=\"https://app.shiprocket.in/seller/assets/images/arrow-small-left.svg\" /></span>\n </div>\n </div>\n </ng-container>\n \n <!-- ------------------------------------------------------------------------------------------------- -->\n \n\n\n \n <h5 class=\"section_heading\">Shipping & Fulfilment in India</h5>\n <div class=\"d-flex flex-wrap gap-4\" >\n <div class=\"box_section\" *ngFor=\"let app of appSwitcherApps.shipping_fulfilment_india\" (click)=\"callEvent(app.appName, app.displayName)\">\n <img class=\"icon\" [src]=\"app.appLogo\"/>\n <h6>{{app.displayName}}</h6>\n <p>{{app.subText}}</p>\n <span class=\"getstarted\">Get Started <img src=\"https://app.shiprocket.in/seller/assets/images/arrow-small-left.svg\"/></span>\n </div>\n </div>\n \n \n \n <h5 class=\"section_heading\">Cross Border Commerce</h5>\n <div class=\"d-flex flex-wrap gap-4\">\n <div class=\"box_section\" *ngFor=\"let app of appSwitcherApps.cross_border_commerce\" (click)=\"callEvent(app.appName, app.displayName)\">\n <img class=\"icon\" [src]=\"app.appLogo\"/>\n <h6>{{app.displayName}}</h6>\n <p>{{app.subText}}</p>\n <span class=\"getstarted\">Get Started <img src=\"https://app.shiprocket.in/seller/assets/images/arrow-small-left.svg\"/></span>\n </div>\n \n </div>\n \n \n \n <h5 class=\"section_heading\">Growth & Marketing Solutions</h5>\n <div class=\"d-flex flex-wrap gap-4\">\n <div class=\"box_section\" *ngFor=\"let app of appSwitcherApps.growth_marketing_solutions\" (click)=\"callEvent(app.appName, app.displayName)\">\n <img class=\"icon\" [src]=\"app.appLogo\"/>\n <h6>{{app.displayName}}</h6>\n <p>{{app.subText}} <span *ngIf=\"app.nextLineLabel\"><br>{{app.nextLineLabel}} </span></p>\n <span class=\"getstarted\">Get Started <img src=\"https://app.shiprocket.in/seller/assets/images/arrow-small-left.svg\"/></span>\n </div>\n </div>\n \n \n <h5 class=\"section_heading\">Financial Services</h5>\n <div class=\"d-flex flex-wrap gap-4\">\n <div class=\"box_section\" *ngFor=\"let app of appSwitcherApps.financial_servicea\" (click)=\"callEvent(app.appName, app.displayName)\">\n <span class=\"newtag\" *ngIf=\"app.appName === 'capital' || (app.appName === 'creditScore' && userData.is_crif_enabled)\"><em>New</em></span>\n <span class=\"newtag\" *ngIf=\"app.appName === 'creditScore' && !userData.is_crif_enabled\"><em>Coming Soon</em></span>\n <img class=\"icon\" [src]=\"app.appLogo\"/>\n <h6>{{app.displayName}}</h6>\n <p>{{app.subText}}</p>\n <span class=\"getstarted\">Get Started <img src=\"https://app.shiprocket.in/seller/assets/images/arrow-small-left.svg\"/></span>\n </div>\n </div>\n <h5 class=\"section_heading\">Other services</h5>\n <div class=\"d-flex flex-wrap gap-4\">\n <div class=\"box_section other_ser\" *ngFor=\"let app of appSwitcherApps.other_services\" (click)=\"callEvent(app.appName, app.displayName)\">\n <img class=\"icon\" src=\"https://sr-cdn-1.shiprocket.in/img/Web_New/Omnichannel.png\"/>\n <h6>Omnichannel</h6>\n <p style=\"text-wrap: wrap;\">Manage all sales channels - online + offline at one place</p>\n <span class=\"getstarted\" style=\"bottom: 5px;\">Get Started <img src=\"https://app.shiprocket.in/seller/assets/images/arrow-small-left.svg\"/></span>\n </div>\n </div>\n </div>\n\n \n\n\n </div>\n</div> ", styles: ["@import\"https://fonts.cdnfonts.com/css/sf-pro-display\";.modal{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1000;display:flex;justify-content:center;align-items:center}.modal-content_new{position:relative;width:100%;height:100%;background-color:#f7f5fb;overflow-y:scroll}.close{position:absolute;top:20px;right:20px;font-size:24px;cursor:pointer;z-index:1001}::ng-deep .ad-padding-b{min-height:0!important}.d-flex{display:flex;flex-wrap:wrap}.gap-4{grid-gap:16px;gap:16px}.mobileScreen{background:#F7F5FB;padding:80px;background-image:url(https://sr-cdn-1.shiprocket.in/img/Web/Bg-Pattern.svg);background-repeat:no-repeat;background-size:contain;background-position:top right}.Topheader{margin-bottom:35px}.Topheader h1{color:#1d1d1d;font-size:36px!important;line-height:32px!important;letter-spacing:-.48px;margin-top:0;font-family:\"SF Pro Display\",sans-serif;font-weight:500}.Topheader h1 span{color:#745be7}.Topheader p{color:#757575;font-size:18px;line-height:normal;margin-top:10px}.section_heading{color:#676767;font-size:20px!important;text-transform:uppercase;margin-bottom:0;margin-top:60px}.featured_section{width:225px!important}.box_section{height:242px;padding:12px;border-radius:16px;background:#FBFBFB;box-shadow:0 5px 20px #1b1f440d;cursor:pointer;margin-top:16px;margin-bottom:0;position:relative;width:268px}.box_section img.icon{width:100%;border-radius:10px}.box_section h6{color:#1d1d1d;font-size:18px!important;margin-top:14px;font-family:\"SF Pro Display\",sans-serif;font-weight:500;margin-bottom:8px;text-transform:capitalize;line-height:22px!important;text-wrap:wrap}.box_section p{color:#828488;font-size:14px;line-height:18px;margin-bottom:0;font-family:\"SF Pro Display\",sans-serif;font-weight:400}.box_section span.getstarted{color:#745be7;font-size:16px;position:absolute;bottom:18px;font-family:\"SF Pro Display\",sans-serif;font-weight:500}.box_section span img{margin-left:5px}.box_section .newtag{position:absolute;right:5px;padding:3px 8px 1px;background:#DDFFE8;top:5px;border-radius:30px}.box_section .newtag em{position:relative;border-radius:4px;padding:1px 8px;color:#3fc06a;font-size:10px;top:-1px;font-style:normal;text-align:center;width:100%;display:block;left:0px;line-height:20px}.appSwitcherBtn{border-radius:4px;border:0;cursor:pointer;line-height:12px;color:#1d1d1d;font-size:12px;background:linear-gradient(169deg,#12c2e999 40.8%,#12c2e999 45%,#c471ed99 60%);font-weight:400;transition:background-color .3s}.appSwitcherBtn:hover{background-color:#fff}.appSwitcherTxt{background:linear-gradient(150.38deg,#fefefe -5.2%,#e7f9fd 7.94%,#f9f1fd 40.98%);padding:8px 12px 6px;border-radius:4px;margin:1px;transition:background-color .5s}.appSwitcherTxt:hover{background-color:#f9f8fe!important}.appSwitcherTxt:hover{background-color:#f9f8fe!important;transition:.5s}@media only screen and (max-width:362px){.box_section h6{font-size:12px!important}.box_section p,.box_section span.getstarted{font-size:11px}}@media (min-width: 768px) and (max-width: 1059px){.box_section h6{font-size:16px!important}.box_section p{font-size:13px!important}.box_section{height:206px!important;width:188px!important}.box_section span.getstarted{font-size:12px!important}.section_heading{font-size:16px!important}}@media (max-width: 767px){.mob_box_section{width:100%!important;padding:12px!important;border-radius:16px!important;background:#FBFBFB!important;box-shadow:0 5px 20px #1b1f440d!important;cursor:pointer!important;margin-top:16px!important;margin-bottom:0!important;position:relative!important;line-height:18px!important;min-height:160px!important}.mob_box_section img.mob_icon{width:100%!important;border-radius:6px!important}.mob_box_section h6{color:#1b1f44!important;font-size:14px!important;margin-top:10px!important;font-family:\"SF Pro Display\",sans-serif!important;margin-bottom:5px!important;text-transform:capitalize!important;min-height:34px!important;font-weight:500!important;line-height:20px!important}.mob_getstarted{color:#745be7!important}.switcher_icon{border:none;background:#fff;position:relative;top:0px;box-shadow:0 -1px 4px #0000000f;padding:11px 7px}.mobileScreen{padding:40px}.box_section{flex:0 0 calc(50% - 16px);box-sizing:border-box}.box_section span.getstarted{bottom:10px;font-size:14px}.box_section{padding:10px;margin-top:0;height:auto}.box_section h6{font-size:14px;margin-top:10px}.box_section p{font-size:12px;line-height:1.3;max-height:70px;min-height:55px}.other_ser p{min-height:65px!important}.box_section .icon{height:auto}.getstarted{font-size:12px}.Topheader h1{font-size:25px!important;line-height:30px!important}.Topheader p{font-size:14px}.section_heading{font-size:16px!important;margin:45px 0 10px}}\n"], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]" }, { type: i4__namespace.NgForOf, selector: "[ngFor][ngForOf]" }], animations: [
731
+ SwitcherComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: SwitcherComponent, selector: "lib-switcher", inputs: { data: "data" }, ngImport: i0__namespace, template: "<div class=\"\" [style.display]=\"!isMobileView ? 'block' : 'none'\">\n <button class=\"appSwitcherBtn\" style=\"padding: 0 !important; margin-right: .5em !important;\" (click)=\"openModal()\" *ngIf=\"userData.allow_checkout || userData.allow_engage || userData.allow_fbs || !userData.allow_fbs\">\n <div class=\"appSwitcherTxt\" style=\"display: flex; align-items: center;\">\n <span>ALL PRODUCTS</span>\n <img style=\"top: -1px; width: 15px; position: relative; margin-left: 4px;\" src=\"https://sr-sidebar.shiprocket.in/assets/svg/apps.svg\" />\n </div>\n </button>\n</div>\n\n<div [style.display]=\"isMobileView ? 'block' : 'none'\">\n <button\n (click)=\"openModal()\"\n class=\"switcher_icon\"\n >\n <img\n src=\"https://sr-sidebar.shiprocket.in/assets/svg/apps.svg\"\n alt=\"apps\"\n class=\"logo\"\n />\n </button>\n</div>\n\n<div *ngIf=\"isModalOpen\" class=\"modal\" [@modalAnimation]>\n <div class=\"modal-content_new\">\n <span class=\"close\" (click)=\"closeModal()\"><img src=\"https://sr-sidebar.shiprocket.in/assets/svg/cross-dark.svg\" /></span>\n \n <!-- ------------------------------------------------------------------------------------------------- -->\n\n\n <div class=\"mobileScreen\">\n\n\n <div class=\"Topheader\">\n <h1>Select the product you would like to experience </h1>\n <p>Elevate your business with our industry-leading products.</p>\n </div>\n\n\n <ng-container *ngIf=\"recentUsedProducts && recentUsedProducts.length\">\n <h5 class=\"section_heading\">Recently Used Products</h5>\n <div class=\"d-flex gap-4 flex-wrap\">\n <div class=\"box_section featured_section mob_box_section h-195px\" (click)=\"appSwitch(item.appName)\" *ngFor=\"let item of recentUsedProducts; let i = index\">\n <img class=\"icon\" [src]=\"item.appLogo\" />\n <h6>{{item.displayName}}</h6>\n <span class=\"getstarted mob_getstarted\">Get Started <img src=\"https://app.shiprocket.in/seller/assets/images/arrow-small-left.svg\" /></span>\n </div>\n </div>\n </ng-container>\n\n\n <!-- <ng-container *ngIf=\"appSwitchList && appSwitchList.length\">\n <h5 class=\"section_heading\">Featured Products</h5>\n <div class=\"d-flex gap-4 flex-wrap\">\n <div class=\"box_section featured_section mob_box_section\" (click)=\"appSwitch(item.appName)\" *ngFor=\"let item of appSwitchList; let i = index\">\n <img class=\"icon\" [src]=\"item.appLogo\" />\n <h6>{{item.displayName}}</h6>\n <span class=\"getstarted mob_getstarted\">Get Started <img src=\"https://app.shiprocket.in/seller/assets/images/arrow-small-left.svg\" /></span>\n </div>\n </div>\n </ng-container> -->\n \n <!-- ------------------------------------------------------------------------------------------------- -->\n \n\n\n \n <h5 class=\"section_heading\">Shipping & Fulfilment in India</h5>\n <div class=\"d-flex flex-wrap gap-4\" >\n <div class=\"box_section\" *ngFor=\"let app of appSwitcherApps.shipping_fulfilment_india\" (click)=\"callEvent(app.appName, app.displayName)\">\n <img class=\"icon\" [src]=\"app.appLogo\"/>\n <h6>{{app.displayName}}</h6>\n <p>{{app.subText}}</p>\n <span class=\"getstarted\">Get Started <img src=\"https://app.shiprocket.in/seller/assets/images/arrow-small-left.svg\"/></span>\n </div>\n </div>\n \n \n \n <h5 class=\"section_heading\">Cross Border Commerce</h5>\n <div class=\"d-flex flex-wrap gap-4\">\n <div class=\"box_section\" *ngFor=\"let app of appSwitcherApps.cross_border_commerce\" (click)=\"callEvent(app.appName, app.displayName)\">\n <img class=\"icon\" [src]=\"app.appLogo\"/>\n <h6>{{app.displayName}}</h6>\n <p>{{app.subText}}</p>\n <span class=\"getstarted\">Get Started <img src=\"https://app.shiprocket.in/seller/assets/images/arrow-small-left.svg\"/></span>\n </div>\n \n </div>\n \n \n \n <h5 class=\"section_heading\">Growth & Marketing Solutions</h5>\n <div class=\"d-flex flex-wrap gap-4\">\n <div class=\"box_section\" *ngFor=\"let app of appSwitcherApps.growth_marketing_solutions\" (click)=\"callEvent(app.appName, app.displayName)\">\n <img class=\"icon\" [src]=\"app.appLogo\"/>\n <h6>{{app.displayName}}</h6>\n <p>{{app.subText}} <span *ngIf=\"app.nextLineLabel\"><br>{{app.nextLineLabel}} </span></p>\n <span class=\"getstarted\">Get Started <img src=\"https://app.shiprocket.in/seller/assets/images/arrow-small-left.svg\"/></span>\n </div>\n </div>\n \n \n <h5 class=\"section_heading\">Financial Services</h5>\n <div class=\"d-flex flex-wrap gap-4\">\n <div class=\"box_section\" *ngFor=\"let app of appSwitcherApps.financial_servicea\" (click)=\"callEvent(app.appName, app.displayName)\">\n <span class=\"newtag\" *ngIf=\"app.appName === 'capital' || (app.appName === 'creditScore' && userData.is_crif_enabled)\"><em>New</em></span>\n <span class=\"newtag\" *ngIf=\"app.appName === 'creditScore' && !userData.is_crif_enabled\"><em>Coming Soon</em></span>\n <img class=\"icon\" [src]=\"app.appLogo\"/>\n <h6>{{app.displayName}}</h6>\n <p>{{app.subText}}</p>\n <span class=\"getstarted\">Get Started <img src=\"https://app.shiprocket.in/seller/assets/images/arrow-small-left.svg\"/></span>\n </div>\n </div>\n <h5 class=\"section_heading\">Other services</h5>\n <div class=\"d-flex flex-wrap gap-4\">\n <div class=\"box_section other_ser\" *ngFor=\"let app of appSwitcherApps.other_services\" (click)=\"callEvent(app.appName, app.displayName)\">\n <img class=\"icon\" src=\"https://sr-cdn-1.shiprocket.in/img/Web_New/Omnichannel.png\"/>\n <h6>Omnichannel</h6>\n <p style=\"text-wrap: wrap;\">Manage all sales channels - online + offline at one place</p>\n <span class=\"getstarted\" style=\"bottom: 5px;\">Get Started <img src=\"https://app.shiprocket.in/seller/assets/images/arrow-small-left.svg\"/></span>\n </div>\n </div>\n </div>\n\n \n\n\n </div>\n</div> ", styles: ["@import\"https://fonts.cdnfonts.com/css/sf-pro-display\";.modal{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1000;display:flex;justify-content:center;align-items:center}.modal-content_new{position:relative;width:100%;height:100%;background-color:#f7f5fb;overflow-y:scroll}.h-195px{height:195px!important}.close{position:absolute;top:20px;right:20px;font-size:24px;cursor:pointer;z-index:1001}::ng-deep .ad-padding-b{min-height:0!important}.d-flex{display:flex;flex-wrap:wrap}.gap-4{grid-gap:16px;gap:16px}.mobileScreen{background:#F7F5FB;padding:80px;background-image:url(https://sr-cdn-1.shiprocket.in/img/Web/Bg-Pattern.svg);background-repeat:no-repeat;background-size:contain;background-position:top right}.Topheader{margin-bottom:35px}.Topheader h1{color:#1d1d1d;font-size:36px!important;line-height:32px!important;letter-spacing:-.48px;margin-top:0;font-family:\"SF Pro Display\",sans-serif;font-weight:500}.Topheader h1 span{color:#745be7}.Topheader p{color:#757575;font-size:18px;line-height:normal;margin-top:10px}.section_heading{color:#676767;font-size:20px!important;text-transform:uppercase;margin-bottom:0;margin-top:60px}.featured_section{width:225px!important}.box_section{height:242px;padding:12px;border-radius:16px;background:#FBFBFB;box-shadow:0 5px 20px #1b1f440d;cursor:pointer;margin-top:16px;margin-bottom:0;position:relative;width:268px}.box_section img.icon{width:100%;border-radius:10px}.box_section h6{color:#1d1d1d;font-size:18px!important;margin-top:14px;font-family:\"SF Pro Display\",sans-serif;font-weight:500;margin-bottom:8px;text-transform:capitalize;line-height:22px!important;text-wrap:wrap}.box_section p{color:#828488;font-size:14px;line-height:18px;margin-bottom:0;font-family:\"SF Pro Display\",sans-serif;font-weight:400}.box_section span.getstarted{color:#745be7;font-size:16px;position:absolute;bottom:18px;font-family:\"SF Pro Display\",sans-serif;font-weight:500}.box_section span img{margin-left:5px}.box_section .newtag{position:absolute;right:5px;padding:3px 8px 1px;background:#DDFFE8;top:5px;border-radius:30px}.box_section .newtag em{position:relative;border-radius:4px;padding:1px 8px;color:#3fc06a;font-size:10px;top:-1px;font-style:normal;text-align:center;width:100%;display:block;left:0px;line-height:20px}.appSwitcherBtn{border-radius:4px;border:0;cursor:pointer;line-height:12px;color:#1d1d1d;font-size:12px;background:linear-gradient(169deg,#12c2e999 40.8%,#12c2e999 45%,#c471ed99 60%);font-weight:400;transition:background-color .3s}.appSwitcherBtn:hover{background-color:#fff}.appSwitcherTxt{background:linear-gradient(150.38deg,#fefefe -5.2%,#e7f9fd 7.94%,#f9f1fd 40.98%);padding:8px 12px 6px;border-radius:4px;margin:1px;transition:background-color .5s}.appSwitcherTxt:hover{background-color:#f9f8fe!important}.appSwitcherTxt:hover{background-color:#f9f8fe!important;transition:.5s}@media only screen and (max-width:362px){.box_section h6{font-size:12px!important}.box_section p,.box_section span.getstarted{font-size:11px}}@media (min-width: 768px) and (max-width: 1059px){.box_section h6{font-size:16px!important}.box_section p{font-size:13px!important}.box_section{height:206px!important;width:188px!important}.box_section span.getstarted{font-size:12px!important}.section_heading{font-size:16px!important}}@media (max-width: 767px){.h-195px{height:142px!important}.mob_box_section.h-195px{min-height:142px!important}.mob_box_section.h-195px h6{min-height:auto!important}.mob_box_section{width:100%!important;padding:12px!important;border-radius:16px!important;background:#FBFBFB!important;box-shadow:0 5px 20px #1b1f440d!important;cursor:pointer!important;margin-top:16px!important;margin-bottom:0!important;position:relative!important;line-height:18px!important;min-height:160px!important}.mob_box_section img.mob_icon{width:100%!important;border-radius:6px!important}.mob_box_section h6{color:#1b1f44!important;font-size:14px!important;margin-top:10px!important;font-family:\"SF Pro Display\",sans-serif!important;margin-bottom:5px!important;text-transform:capitalize!important;min-height:34px!important;font-weight:500!important;line-height:20px!important}.mob_getstarted{color:#745be7!important}.switcher_icon{border:none;background:#fff;position:relative;top:0px;box-shadow:0 -1px 4px #0000000f;padding:11px 7px}.mobileScreen{padding:40px}.box_section{flex:0 0 calc(50% - 16px);box-sizing:border-box}.box_section span.getstarted{bottom:10px;font-size:14px}.box_section{padding:10px;margin-top:0;height:auto}.box_section h6{font-size:14px;margin-top:10px}.box_section p{font-size:12px;line-height:1.3;max-height:70px;min-height:55px}.other_ser p{min-height:65px!important}.box_section .icon{height:auto}.getstarted{font-size:12px}.Topheader h1{font-size:25px!important;line-height:30px!important}.Topheader p{font-size:14px}.section_heading{font-size:16px!important;margin:45px 0 10px}}\n"], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]" }, { type: i4__namespace.NgForOf, selector: "[ngFor][ngForOf]" }], animations: [
620
732
  animations.trigger('modalAnimation', [
621
733
  animations.transition(':enter', [
622
734
  animations.style({ opacity: 0, transform: 'scale(0.8)' }),