1(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([["cozy_data_actions_NotificationActions_tsx"],{
vendor: 162 bytes, line 1
1"./node_modules/lodash/_arrayAggregator.js":function(t){t.exports=function(t,e,n,o){for(var i=-1,a=null==t?0:t.length;++i<a;){var r=t[i];e(o,r,n(r),t)}return o}},
vendor: 182 bytes, line 1
1"./node_modules/lodash/_baseAggregator.js":function(t,e,n){var o=n("./node_modules/lodash/_baseEach.js");t.exports=function(t,e,n,i){return o(t,(function(t,o,a){e(i,t,n(t),a)})),i}},
vendor: 345 bytes, line 1
1"./node_modules/lodash/_createAggregator.js":function(t,e,n){var o=n("./node_modules/lodash/_arrayAggregator.js"),i=n("./node_modules/lodash/_baseAggregator.js"),a=n("./node_modules/lodash/_baseIteratee.js"),r=n("./node_modules/lodash/isArray.js");t.exports=function(t,e){return function(n,s){var c=r(n)?o:i,u=e?e():{};return c(n,t,a(s,2),u)}}},
vendor: 194 bytes, line 1
1"./node_modules/lodash/keyBy.js":function(t,e,n){var o=n("./node_modules/lodash/_baseAssignValue.js"),i=n("./node_modules/lodash/_createAggregator.js")((function(t,e,n){o(t,n,e)}));t.exports=i},
1"./cozy/data/actions/NotificationActions.tsx":function(t,e,n){"use strict";n.r(e),n.d(e,{changeCategory:function(){return E},clearHasInitialCategory:function(){return p},clearHasInitialNotification:function(){return O},getNotificationCategories:function(){return I},loadBuiltNotifications:function(){return A},loadNotificationCategoryInitial:function(){return g},loadNotifications:function(){return b},loadNotificationsInitial:function(){return T},markNotificationViewed:function(){return N}});var o=n("./node_modules/lodash/keyBy.js"),i=n.n(o),a=(n("./node_modules/core-js/modules/web.dom-collections.iterator.js"),n("./cozy/utils/i18n.tsx")),r=n("./cozy/routes/Routes.tsx"),s=n("./cozy/routes/RouteGenerators.tsx"),c=n("./cozy/data/constants/NotificationConstants.tsx"),u=n("./cozy/data/constants/FeedConstants.tsx");const l=t=>{const{type:e}=t;let n,o,i,l,d,_,f;if(e in c.Po)return null;switch(e){case"visit.feed":n=c.Rn.FEED,o=(0,a.ag)("Did you know that we recommend you great products on the feed page"),l=r.Mym;break;case"visit.profile":n=c.Rn.PROFILE,o=(0,a.ag)("Did you know we added the products you just saved to your profile?"),l=(0,s.S4)();break;case"dealdash.replay":o=t.mobile_message,f=t.mobile_title,n=c.Rn.WEBSITE,l=(0,s.pR)(u.vQ.BLITZ_BUY);break;case"feed.rec":o=t.mobile_message,f=t.mobile_title,n=c.Rn.FEED;const{tag:e}=t,{filter:y}=t;if(e)l="".concat((0,s.pR)(e.id),"?tag=").concat(e.id);else{if(!y)return null;l="".concat((0,s.pR)(y.tag),"?tag=").concat(y.tag)}break;case"daily-login-bonus.get-coupon":o=t.mobile_message||(0,a.ag)("You have a new notification. Check the website for details"),f=t.mobile_title,l=t.cozy_url,i=t.mobile_image_url,_=t.daily_login_message;break;default:if(o=t.mobile_message||(0,a.ag)("You have a new notification. Check the website for details"),f=t.mobile_title,i=t.mobile_image_url,t.non_cozy_url){d=t.non_cozy_url;break}if(t.cozy_url){l=t.cozy_url;break}const I=t.mobile_target_param;switch(t.mobile_target_type){case c.Rn.CONTEST:const{contest:e}=t;if(!e)return null;n=c.Rn.CONTEST,l=(0,s.ny)(e.id);break;case c.Rn.INVITE:n=c.Rn.INVITE;break;case c.Rn.WEBSITE:t.ticket?l=(0,s.UO)(t.ticket.id):t.transaction&&(l=(0,s.r3)(t.transaction.id));break;case c.Rn.PROFILE:if(!t.user)return null;n=c.Rn.PROFILE,i=t.user.profile_pic,l=(0,s.S4)(t.user.uid);break;case c.Rn.FEED:if(n=c.Rn.FEED,!I)return null;l=(0,s.pR)(I);break;case c.Rn.ALERT:case c.Rn.BRANDFEED:case c.Rn.RATE:return null;case c.Rn.DEEPLINK:t.ticket_id?l=(0,s.UO)(t.ticket_id):t.transaction_id&&(l=(0,s.r3)(t.transaction_id));break;default:return null}}let y=[];return i?y.push(i):t.extra_images&&(y=t.extra_images.slice(0,4)),{bucketNumber:t.bucket,notificationNumber:t.num,isViewed:t.viewed,timestamp:t.isotime,type:e,targetType:n,message:o,extraImages:y,target:l,displayType:t.display_type,nonCozyHref:d,category:t.category,dailyLoginMessage:_,title:f}},d=t=>{const e={},n={[c.x4]:[]},o=[];for(const i of t.notifications){const t=l(i);if(null!=t){e[t.notificationNumber]=t;const o=t.category,i=n[o]||[];i.push(t.notificationNumber),n[o]=i,n[c.x4].push(t.notificationNumber)}else i.viewed||o.push(i)}return[{bucket:t.count,unviewedCount:t.unviewed_count,currentBucket:t.current_bucket,shouldDirectMsiteBlitz:t.should_direct_msite_blitz,notificationsByID:e,notificationIDsByCategory:n},o]};var _=n("./cozy/utils/Api.tsx"),f=async(t,e)=>{await(0,_.ZP)("notification/viewed",{bucket_num:t,notification_num:e})},y=n("./cozy/data/actions/actionNameConstants/NotificationActionNameConstants.tsx");const I=()=>({type:y.E0,payload:async()=>{const{categories:t}=await(async()=>{const{data:t}=await(0,_.ZP)("notifications/categories/get");return t})();return{categoryIDs:t.map((t=>t.id)),categoryByID:i()(t,"id"),server:!1}}}),g=t=>{const e=t.map((t=>t.id));return{type:y.C,payload:{categoryIDs:e,categoryByID:i()(t,"id"),server:!0}}},E=t=>({type:y.r9,payload:t}),N=(t,e)=>({type:y.oF,payload:f(t,e)}),m=t=>async e=>{await Promise.all(t.map((t=>e(N(t.bucket,t.num)))))},A=(t,e)=>({type:y.j6,payload:{...t,server:e}}),T=function(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{const[o,i]=d(t);n(A(o,e)),m(i)}},b=t=>async e=>{try{e({type:y.Rj});const n=await async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{data:e}=await(0,_.ZP)("notifications/get",{bucket:t});return e}(t);e(T(n,!1))}catch(t){e({type:y.tf})}},p=()=>({type:y.tY}),O=()=>({type:y.br})},
1"./cozy/data/actions/actionNameConstants/NotificationActionNameConstants.tsx":function(t,e,n){"use strict";n.d(e,{E0:function(){return o},C:function(){return i},r9:function(){return a},oF:function(){return r},tY:function(){return s},Rj:function(){return c},j6:function(){return u},tf:function(){return l},br:function(){return d}});const o="NOTIFICATION_GET_CATEGORIES",i="NOTIFICATION_GET_CATEGORIES_FULFILLED",a="NOTIFICATION_CHANGE_CATEGORY",r="NOTIFICATION_MARK_VIEWED",s="NOTIFICATION_CLEAR_HAS_INITIAL_CATEGORY",c="NOTIFICATION_LOAD_NOTIFICATIONS_PENDING",u="NOTIFICATION_LOAD_NOTIFICATIONS_FULFILLED",l="NOTIFICATION_LOAD_NOTIFICATIONS_REJECTED",d="NOTIFICATION_CLEAR_HAS_INITIAL_NOTIFICATION"},
1"./cozy/data/constants/NotificationConstants.tsx":function(t,e,n){"use strict";n.d(e,{x4:function(){return o},Rn:function(){return i},Qs:function(){return a},Po:function(){return r},FF:function(){return s},fQ:function(){return c},ak:function(){return u}});const o="all",i={CONTEST:1,INVITE:2,WEBSITE:3,PROFILE:4,FEED:5,NONE:6,ALERT:7,BRANDFEED:8,ACTIVITY:9,RATE:10,DEEPLINK:11},a={DEFAULT:1,SMALL:2,LARGE:3,DEAL_DASH:4,REWARD:5,GET_GIVE_COUPON:6,DAILY_LOGIN_BONUS:8},r={"dropoff_retention.noti":!0,"products.rec":!0,"signup_category.noti":!0,"recently_wished.noti":!0,"sensei_retention.noti":!0},s=["/daily-login-bonus","/feed/blitz_buy__tab"],c="/daily-login-bonus",u="limited.refund_available"}
1}]); 2//# sourceMappingURL=cozy_data_actions_NotificationActions_tsx.724f04af7a13fd67af59.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.