tSignal:l,reason:o,...s}=a,i=(0,f.VA)(s);e((0,p.apiCall)({method:"salesHome.notifications.formatShare",args:i,abortSignal:l,reason:o})).then(e=>{r(e)}).catch(e=>{(0,g.default)({getState:t}).error(`API call to salesHome.notifications.formatShare
						with reason ${o} failed, initiated by generated fetcher`),n(e)})}));b.meta={name:"salesHomeNotificationsFormatShareFetcher",key:"createFetcherSalesHomeNotificationsFormatShareFetcher",description:"salesHome.notifications.formatShare generated fetcher"};var h=a(0x3711e82d),E=a(0x32d3ef3d),x=a(0xcea4a81c),y=a(0x113cdbbd7),A=a(0x1608420cc),C=a(0x103f48cb9),k=a(0x1506d547b),S=a(0xf7a922a4),N=a(0x181fc1a60);let w=(0,u.A)("salesHome.notifications.share generated fetcher",(e,t,a)=>new _.S((r,n)=>{let{abortSignal:l,reason:o,...s}=a,i=(0,f.VA)(s);e((0,p.apiCall)({method:"salesHome.notifications.share",args:i,abortSignal:l,reason:o})).then(e=>{r(e)}).catch(e=>{(0,g.default)({getState:t}).error(`API call to salesHome.notifications.share
						with reason ${o} failed, initiated by generated fetcher`),n(e)})}));w.meta={name:"salesHomeNotificationsShareFetcher",key:"createFetcherSalesHomeNotificationsShareFetcher",description:"salesHome.notifications.share generated fetcher"};var v=a(0x1d600678),O=a(0xa6b90d4b),I=a(0x24cf1145d),M=a(0x226892387);let R=new s.Ay("modernselling"),ForwardNotificationModal=e=>{let{createdTs:t,notificationType:a,isAdminCreated:l,msgOps:s,selectedChannelId:i,opportunityId:c,attachmentBlocks:d,salesforceRecord:m}=e,_=(0,n.wA)(),p="forward-sales-notification-dialog",u=R.t("Forward this notification");c&&(u=R.t("Forward this record update"));let g=R.t("Forward"),f=(0,r.useCallback)(()=>_((0,I.I)({channelOrMemberId:i,reason:p})).then(e=>{let a=_((0,O.A)({msgOps:s,channelId:e}))||[];return _(w({createdTs:t,channelId:e,...a.length&&{shareBlocks:a},reason:"sales-home-forward-notification",opportunityId:c}))}),[_,i,s,t,c]),b=(0,r.useMemo)(()=>({onClick:{enableClogAction:!0},elementName:"forward_notification_modal_btn",elementValue:t}),[t]),S=(0,r.useMemo)(()=>d&&r.createElement("div",{className:"c-message_attachment_v2"},r.createElement(C.A,{version2:!0}),r.createElement("div",null,r.createElement(A.A,{blocks:d,service:void 0,channelId:i,blocksContainerContext:y.pi.share_dialog}),m&&r.createElement("div",{className:"margin_top_100"},r.createElement(x.a,{entityState:E.w.enabled,size:E.S.expanded,record:m,showActionsBar:!1,isInteractive:!1})))),[d,m,i]),T=(0,M.d4)(e=>(0,v.x)(e,"salesforce_forwarding")?.default==="speedbump");return r.createElement(o.A,{eventId:h.EventId.LOB_SALES_HOME,uiComponentName:h.UiComponentName.LOB_NOTIFICATION_FORWARD_MODAL,channelId:i,lobNotificationType:a,isLobNotificationWorkflowAdmin:l},r.createElement(k.A,{...e,title:u,goButtonText:g,goButtonAutoClogProps:b,goHandler:f,dialogType:N.hs.NOTIFICATION,shareReason:p,notificationType:a,attachment:S,forwardingSpeedbumpEnabled:T}))};ForwardNotificationModal.displayName="ForwardNotificationModal";let T=(0,S.A)(ForwardNotificationModal);var F=a(0x11c82607b),H=a(0x46dbff89);let L=(0,F.Ay)("Opens the Forward Notification Modal",(e,t,a)=>{e((0,H.q)({element:r.createElement(T,a)}))});L.meta={name:"openForwardNotificationModal",key:"createThunkOpenForwardNotificationModal",description:"Opens the Forward Notification Modal"};let P=new s.Ay("modernselling"),ActionBarForward=({hasFocus:e,createdTs:t,notificationType:a,isAdminCreated:s,opportunityId:_})=>{let p=(0,n.wA)(),{maybeClosePeek:u}=(0,r.useContext)(m.Z),g=P.t("Forward notification");_&&(g=P.t("Forward record update"));let f=(0,r.useCallback)(()=>!e,[e]),E=(0,r.useCallback)(async e=>{e.stopPropagation();let r=await p(b({createdTs:t,opportunityId:_,reason:"sales-home-get-notification-blocks"}));if(r&&r.ok){let{content_blocks:e,attachment_blocks:n,salesforce_record:l}=r;p(L({createdTs:t,notificationType:a,isAdminCreated:s,contentBlocks:e,attachmentBlocks:n,salesforceRecord:l,opportunityId:_}))}u()},[p,t,_,u,a,s]),x=(0,r.useCallback)(()=>({onClick:{enableClogAction:!0},elementName:"forward_notification_action_bar",elementValue:t}),[t]);return(0,r.useEffect)(()=>{let e=new l.A;return e.bindAll([{keys:["f"],handler:E,filter:f,action:"keyup"}]),()=>e.reset()},[f,E]),r.createElement(o.A,{eventId:h.EventId.LOB_SALES_HOME,uiComponentName:h.UiComponentName.LOB_NOTIFICATION_ACTIONS_BAR,lobNotificationType:a,isLobNotificationWorkflowAdmin:s},r.createElement(d.Ay,{tip:g,position:"top"},r.createElement(i.A,{"aria-label":g,onClick:E,className:"c-message_actions__button",size:"small",autoClogProps:x()},r.createElement(c.Ah,{name:"share-message"}))))};ActionBarForward.displayName="ActionBarForward"},0x1090ee536:(e,t,a)=>{"use strict";a.d(t,{H:()=>ActionBarMore});var r=a(0xbad225b5),n=a(0x20482ad21),l=a(0x344bb842),o=a(0x99233ecb),s=a(0x4c96e5d9);let i=new n.Ay("modernselling"),ActionBarMore=({children:e,onMenuOpen:t,onMenuClose:a})=>{let n=(0,r.useCallback)(t=>r.createElement(o.Ay,t,e),[e]);return r.createElement(o.cQ,{onOpen:t,onClose:a,renderMenu:n,position:"left-bottom"},r.createElement(s.Ay,{tip:i.t("More actions"),position:"top"},r.createElement(l.A,{"aria-label":i.t("More actions"),className:"c-message_actions__button",size:"small",svgIconProps:{name:"ellipsis-vertical-filled"}})))};ActionBarMore.displayName="ActionBarMore"},0x21b980720:(e,t,a)=>{"use strict";a.d(t,{E:()=>ActionBar});var r=a(0xbad225b5),n=a(0x120c268ad),l=a.n(n);let ActionBar=({children:e,isVisible:t})=>r.createElement("div",{className:l()("p-sales_feed__action_bar",t&&"p-sales_feed__action_bar--visible")},r.createElement("div",{className:"c-message_actions__container"},r.createElement("div",{className:"c-message_actions__group",role:"group"},e)));ActionBar.displayName="ActionBar"},0x139d2f9a8:(e,t,a)=>{"use strict";a.d(t,{_:()=>useMenuItemCreator});var r=a(0xbad225b5),n=a(0x16cf1da63),l=a(0x20482ad21),o=a(0xf4097f62),s=a(0x13638bd77);let i=new l.Ay("modernselling"),useMenuItemCreator=e=>{let t=(0,n.wA)(),a=(0,r.useCallback)(()=>{t((0,s.b)({memberId:e}))},[t,e]);return{label:i.rt("Notification created by {admin}",{admin:r.createElement(o.A,{id:e})}),onSelect:a}};useMenuItemCreator.displayName="useMenuItemCreator"},0xcdc086ce:(e,t,a)=>{"use strict";a.d(t,{e:()=>useMenuItemEdit});var r=a(0xbad225b5),n=a(0x16cf1da63),l=a(0x20482ad21),o=a(0x156eec78a),s=a(0x139aa1a7),i=a(0xcefedbca);let c=new l.Ay("modernselling"),useMenuItemEdit=(e,t=!1)=>{let a=(0,o.Q)(),l=(0,n.wA)(),d=(0,r.useCallback)(()=>{e&&(a({viewType:t?s.D.SalesAdministration:s.D.SalesNotifications}),l((0,i.A)({workflowId:e,isAdmin:t})))},[e,a,l,t]),m=(0,r.useMemo)(()=>({onClick:{enableClogAction:!0},elementName:"lob_notifications_edit",workflowId:e,isLobNotificationWorkflowAdmin:t}),[t,e]);return{label:c.t("Edit notification conditions"),onSelect:d,autoClogProps:m}}},0xc77a8bc3:(e,t,a)=>{"use strict";a.d(t,{z:()=>useMenuItemMute});var r=a(0xbad225b5),n=a(0x20482ad21),l=a(0x10490d62c);let o=new n.Ay("modernselling"),useMenuItemMute=(e,t)=>{let a=(0,l.A)(),[n,s]=(0,r.useState)(t),i=(0,r.useCallback)(()=>{e&&a(e,!n).then(()=>{s(!n)})},[a,n,e]),c=o.t("Mute notification"),d=o.t("Unmute notification");return{label:n?d:c,onSelect:i}}},0x23b93d6d0:(e,t,a)=>{"use strict";a.d(t,{Z:()=>FeedItemScheduled});var r=a(0xbad225b5),n=a(0x20482ad21),l=a(0xb90d5858),o=a(0x2501a2cee),s=a(0x21b980720),i=a(0x1090ee536),c=a(0x139d2f9a8),d=a(0xcdc086ce),m=a(0xc77a8bc3),_=a(0x1e5093c5a),p=a(0xfca33088),u=a(0xbf61ff25);let g=new n.Ay("modernselling"),FeedItemScheduled=({notification:e,isWorkflowPreview:t,isStepPreview:a,...n})=>{let{is_acn:f,is_workflow_deleted:b,is_workflow_editable:h,is_workflow_muted:E,notification_display_columns:x,notification_display_type:y,payload:{opportunities:A,generic_records:C,workflow:k},workflow_created_by:S,workflow_id:N,salesforce_org_id:w,created_ts:v}=e,O=(0,m.z)(N,E),I=(0,d.e)(N,f),M=(0,c._)(S),R=(0,r.useMemo)(()=>r.createElement(o.Ah,{name:"calendar"}),[]),T=(0,r.useCallback)(({isVisible:e,onMenuOpen:t,onMenuClose:a})=>{let n=f&&!!N&&!b,o=h&&!b;return n||o||f?r.createElement(s.E,{isVisible:e},r.createElement(i.H,{onMenuOpen:t,onMenuClose:a},n&&r.createElement(l.A,{onSelected:O.onSelect},O.label),o&&r.createElement(l.A,{onSelected:I.onSelect,autoClogProps:I.autoClogProps},I.label),f&&r.createElement(l.A,{className:"padding_top_75",description:M.label,onSelected:M.onSelect}))):null},[f,N,O,I,M,h,b]),F=(0,r.useCallback)(()=>{let e=C?.length?C:A;return x?.length&&e?.length&&k?.subtitle?r.createElement(p.N,{columns:x,displayType:y,records:e,title:k.subtitle,workflowId:N,salesforceOrgId:w,notificationCreatedTs:v,isWorkflowPreview:t,isStepPreview:a}):null},[C,A,x,k.subtitle,y,N,w,v,t,a]);return r.createElement(_.G,{...n,headerIcon:R,headerText:g.t("Scheduled"),iconFallbackUrl:u,notification:e,renderActionBar:T,renderMore:F,isWorkflowPreview:t,isStepPreview:a})};FeedItemScheduled.displayName="FeedItemScheduled"},0x1e5093c5a:(e,t,a)=>{"use strict";a.d(t,{G:()=>FeedItem});var r=a(0xbad225b5),n=a(0x16cf1da63),l=a(0x120c268ad),o=a.n(l),s=a(0x14fad6485),i=a(0x40c0d834),c=a(0x1faa3f1ac),d=a(0x113cdbbd7),m=a(0xc368465d),_=a(0x754ea859),p=a(0x184825275),u=a(0x6960d8b9),g=a(0xc0b7c558);let FeedItem=({hasFocus:e,headerIcon:t,headerText:a,headerLinkUrl:l,iconFallbackUrl:f,isFirst:b,notification:h,renderActionBar:E,renderInlineActions:x,renderMore:y,withHeaderWrapper:A,isWorkflowPreview:C,isStepPreview:k})=>{let{body:S,workflow_id:N,created_ts:w,icon_url:v,is_unread:O,salesforce_org_id:I,payload:{workflow:{title:M,service_id:R,service_team_id:T},opportunities:F=[],records:H=[]}}=h,{windowRef:L}=(0,r.useContext)(s._0),P=(0,r.useRef)(null),[D,U]=(0,r.useState)(!1),[G,B]=(0,r.useState)(!1),V=e||D||G,$=(0,n.wA)(),z=(0,r.useCallback)(()=>{U(!0)},[]),W=(0,r.useCallback)(()=>{U(!1)},[]),Y=(0,r.useCallback)(()=>{B(!0)},[]),j=(0,r.useCallback)(()=>{B(!1),L.deref()?.requestAnimationFrame(()=>{U(P.current?.matches(":hover")===!0)})},[L]),K=(0,r.useCallback)(()=>{let e=F.length?F[0]?.slack_record_id:(0,g.j)(I,H[0].record_identifier);e&&$((0,_.c)({recordId:e}))},[$,F,H,I]),X=(0,r.useMemo)(()=>{let e=r.createElement("div",{className:o()("display_flex align_items_center",{sk_foreground_max:!O,sk_primary_foreground:O,bold:O})},t,r.createElement("div",{className:"caption margin_left_25 margin_right_25"},a));if(l){let t=F.length||H.length&&I;e=r.createElement(c.A,{className:"p-sales_feed__item__header__link",href:t?"":l,target:"_blank",onClick:t?K:void 0},e)}return A&&(e=A(e)),e},[O,t,a,l,A,K,F,H,I]),q=(0,r.useMemo)(()=>({hasFocus:e,isVisible:V,onMenuOpen:Y,onMenuClose:j}),[j,Y,e,V]),Q=(0,r.useCallback)(e=>{let t={serviceId:R,serviceTeamId:T,container:{type:d.pi.lob_notification,notificationTs:w},actions:[e]};return $((0,p.W)(t))},[R,T,w,$]);return r.createElement(i.A,{clogImpression:!0,elementName:"lob_sales_notification_item",elementValue:w,workflowId:N},r.createElement("div",{ref:P,onPointerOver:z,onPointerLeave:W,className:o()("p-sales_feed__item",{"p-sales_feed__item--first":b,"p-sales_feed__item--preview":C,"p-sales_feed__item--no-border":C&&!k})},r.createElement("div",{className:o()("p-sales_feed__item__inner",{"p-sales_feed__item__inner--preview":C})},!C&&r.createElement("div",{className:"display_flex justify_content_between align_items_center"},X,r.createElement("div",{className:"display_flex align_items_center"},r.createElement("div",{className:o()("caption",{bold:O})},(0,u.Yq)(w,"{status_expiration}")),O&&r.createElement("div",{className:"p-sales_feed__item__unread_dot"}))),r.createElement("div",{className:o()("display_flex",{margin_top_50:!C})},r.createElement("img",{className:"p-sales_feed__item__icon",src:v||f,alt:M}),r.createElement("div",{className:"flex_one display_flex"},r.createElement("div",{className:"flex_one"},r.createElement("div",{className:"sk_primary_foreground black"},M),r.createElement(m.A,{blocks:S,blocksContainerContext:d.pi.sales_home_notification,onAction:Q}),y?.()),x&&r.createElement("div",{className:"flex_shrink_none"},x()))),E?.(q))))};FeedItem.displayName="FeedItem"},0x129529b49:(e,t,a)=>{"use strict";a.d(t,{E:()=>OpportunityHoverCardTrigger});var r=a(0xbad225b5),n=a(0x1cbdfeceb),l=a(0x217f0c263),o=a(0x14fad6485),s=a(0x1f3598f80),i=a(0xc745739a),c=a(0x20482ad21),d=a(0x2b7f0bcc),m=a(0x102edf836),_=a(0x11a296110),p=a(0x1ee57b3a0),u=a(0x1fa67866c),g=a(0xb1ea448c),f=a(0x128d54e52),b=a(0x1535e80f3),h=a(0x15fb82076),E=a(0x2501a2cee),x=a(0x4c96e5d9),y=a(0x12b6a33fc),A=a(0x16cf1da63),C=a(0xe874a88a),k=a(0x22a29f141),S=a(0x1dfdeb1c8),N=a(0x1ec68d6a3),w=a(0xe747dd27);let v=(0,S.A)("sfdc.getOpportunity generated fetcher",(e,t,a)=>new C.S((r,n)=>{let{abortSignal:l,reason:o,...s}=a,i=(0,w.VA)(s);e((0,k.apiCall)({method:"sfdc.getOpportunity",args:i,abortSignal:l,reason:o})).then(e=>{r(e)}).catch(e=>{(0,N.default)({getState:t}).error(`API call to sfdc.getOpportunity
						with reason ${o} failed, initiated by generated fetcher`),n(e)})}));function useFetchOpportunityInfo(){let e=(0,A.wA)();return(0,r.useCallback)((t,a)=>e(v({id:t,reason:"sales-home-get-opportunity-info",salesforceOrgId:a})),[e])}v.meta={name:"sfdcGetOpportunityFetcher",key:"createFetcherSfdcGetOpportunityFetcher",description:"sfdc.getOpportunity generated fetcher"};var O=a(0x1c659cbb1),I=a(0x110b4f809),M=a(0xe38b5635),R=a(0x1ed767a16),T=a(0x6960d8b9),F=a(0x226892387),H=a(0x1c8beab7f);let L=a.p+"crown-f27246b.svg",P=new c.Ay("modernselling"),D={elementName:"open_in_salesforce",onClick:{enableClogAction:!0}},U={elementName:"copy_opportunity_link",onClick:{enableClogAction:!0}},G=new RegExp(/\bhttps?:\/\/[^\s]+\b/g),OpportunityNextStep=({nextStep:e})=>{let t=e.split(G),a=e.match(G)||[],n=t.reduce((e,t,n)=>{if(e.push(t),n<a.length){let t=a[n];e.push(r.createElement(h.A,{key:n+t,href:t}))}return e},[]);return r.createElement(r.Fragment,null,n)};OpportunityNextStep.displayName="OpportunityNextStep";let OpportunityHoverCard=({opportunity:e,record:t,salesforceOrgId:a})=>{let n,l=e?.id??t?.record_identifier,o=e?.record_link??t?.record_link,s=useFetchOpportunityInfo(),i=(0,F.d4)(H.cc),[c,h]=(0,r.useState)(),[A,C]=(0,r.useState)(!0),[k,S]=(0,r.useState)(!1),[N,w]=(0,I.A)(!1,2e3);(0,r.useEffect)(()=>{l&&s(l,a).then(e=>{h(e)}).catch(()=>{S(!0)}).finally(()=>{C(!1)})},[s,l,a]);let v=(0,r.useCallback)(()=>r.createElement(O.f1,{className:"p-sales_feed__opp_hover_card_avatar",size:36,imageUrl:L,isInteractive:!1}),[]),G=(0,r.useCallback)(()=>r.createElement(O.Ay,{className:"c-base_entity__avatar",size:b.RG.small,userId:e?.owner.slack_user_id,isInteractive:!1,tabIndex:-1,ariaHidden:!0}),[e]),B=(0,r.useCallback)(()=>{(0,R.x3)(o),w(!0)},[o,w]),V=i.length>1?i.find(e=>e.salesforce_org_id===a)?.name:void 0;return n=c?V?c.account?.name?P.rt("Opportunity in {account_name}, <b>{salesforceOrgName}</b>",{account_name:c.account.name,salesforceOrgName:V}):P.rt("Opportunity in <b>{salesforceOrgName}</b>",{salesforceOrgName:V}):c.account?.name?P.t("Opportunity in {account_name}",{account_name:c.account.name}):P.t("Opportunity"):V?P.rt("Opportunity in <b>{salesforceOrgName}</b>",{salesforceOrgName:V}):"Opportunity",r.createElement(M.A,{elevation:4,size:"medium",className:"p-sales_feed__opp_hover_card"},A&&r.createElement(u.A,{className:"margin_top_200"},r.createElement(g.A,{size:"jumbo"})),k&&r.createElement(u.A,null,r.createElement(d.Ay,{type:"boxed",level:"error",className:"margin_bottom_150"},P.rt("Oops\u2026 we had trouble fetching opportunity info"))),c&&r.createElement(r.Fragment,null,r.createElement(p.A,null,r.createElement(f.Ay,{size:"medium",avatar:v,text:r.createElement(f.CG,{className:"black",withTruncationTooltip:!0},c.name),subtext:r.createElement(f.sT,{className:"caption p-sales_feed__opp_hover_card_header_subtext"},n)})),r.createElement(u.A,null,r.createElement("div",{className:"p-sales_feed__opp_hover_card_details_container"},r.createElement("div",{className:"p-sales_feed__opp_hover_card_stage_details"},r.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},P.t("Stage")),r.createElement("div",{className:"p-sales_feed__opp_hover_card_stage_details_pill"},c.stage)),r.createElement("div",{className:"p-sales_feed__opp_hover_card_details"},r.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},P.t("Close date")),(0,T.Yq)((0,T.$4)(c.close_date,{parseFormat:"YYYY-MM-DD",returnMoment:!0}),"{date_slash}")),r.createElement("div",{className:"p-sales_feed__opp_hover_card_details"},r.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},P.t("Amount")),c.amount.display_value),r.createElement("div",{className:"p-sales_feed__opp_hover_card_owner_details"},r.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},P.t("Owner")),r.createElement(f.Ay,{avatar:G,className:"c-member c-member--small",text:r.createElement("span",{className:"c-member__primary_content"},r.createElement(f.CG,{className:"c-member_name"},c.owner.name)),size:"small"}))),""!==c.next_step?r.createElement("div",{className:"p-sales_feed__opp_hover_card_next_steps_details"},r.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},P.t("Next Step")),r.createElement(OpportunityNextStep,{nextStep:c.next_step})):null,r.createElement("div",{className:"p-sales_feed__opp_hover_card_actions"},r.createElement(m.z9,{className:"p-sales_feed__opp_hover_card_linkbutton",size:"medium",type:"outline",href:o,autoClogProps:D},r.createElement("span",{className:"p-sales_feed__opp_hover_card_linkbutton_text"},P.t("Open in Salesforce")),r.createElement(E.Ah,{inline:!0,name:"new-window"})),r.createElement(x.Ay,{tip:N?P.t("Copied!"):P.t("Copy link"),status:N?y.YU.Success:y.YU.Info},r.createElement(_.Ay,{className:"p-sales_feed__opp_hover_card_copybutton",size:"medium",type:"outline",onClick:B,autoClogProps:U,"aria-label":N?P.t("Copied"):P.t("Copy Salesforce Url")},r.createElement(E.Ah,{name:"files"})))))))};OpportunityHoverCard.displayName="OpportunityHoverCard";let OpportunityHoverCardTrigger=({children:e,opportunity:t,record:a,salesforceOrgId:c})=>{let{windowRef:d}=(0,r.useContext)(o._0),[m,_]=(0,r.useState)(null),p=(0,r.useRef)(null),u=(0,r.useCallback)(()=>{let e=(e=>{let{pageYOffset:t,innerWidth:a,innerHeight:r}=e.deref()||{pageYOffset:0,innerWidth:0,innerHeight:0};return{top:(0,i.ci)(t+10),right:a-16,bottom:t+r-10,left:16}})(d),t=p.current.getBoundingClientRect(),a={top:void 0,bottom:void 0,right:void 0,left:void 0},r=t.right+345>e.right,n=t.bottom+250>e.bottom,l=t.top-250<e.top;if(r){let r=e.right-(t.left+345)<0;n&&l?(a.top=t.bottom+12,a.right=e.right-t.left+25):(n?a.bottom=e.bottom-t.y+12:l?a.top=t.bottom+12:a.bottom=e.bottom-t.y+25,a.left=t.left),r&&(a.right=12,a.left="auto")}else l&&n?(a.top=t.top-100,a.left=t.right+12):n?(a.left=t.left,a.bottom=e.bottom-t.y+25):l?(a.top=t.bottom+12,a.left=t.left):(a.left=t.right+12,a.top=t.top);return a},[d]),g=(0,r.useCallback)(()=>{_(null)},[]),f=(0,r.useCallback)(()=>{let e=u();_(r.createElement(l.A,{isOpen:!0,className:"opportunity-hover-modal",overlayClassName:"p-sales_feed__opportunity_hover_card__modal",shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,onRequestClose:g},r.createElement("div",{className:"p-sales_feed__opportunity_hover_card__popover",style:e},r.createElement(OpportunityHoverCard,{record:a,opportunity:t,salesforceOrgId:c}))))},[u,a,t,g,c]),[b,h]=(0,s.i)(f),[E,x]=(0,s.i)(g),y=(0,r.useCallback)(()=>(x(),m)?void h():b(350),[x,b,h,m]),A=(0,r.useCallback)(()=>(h(),m)?E(250):void x(),[h,E,x,m]);return r.createElement("span",{className:"p-sales_feed__opportunity_hover_card",onMouseOver:y,onMouseLeave:A,onClick:y,role:"presentation",onFocus:n.A,ref:p},e,m)};OpportunityHoverCardTrigger.displayName="OpportunityHoverCardTrigger"},0xfca33088:(e,t,a)=>{"use strict";a.d(t,{N:()=>U});var r=a(0xbad225b5),n=a(0x120c268ad),l=a.n(n),o=a(0x11a296110),s=a(0x2501a2cee),i=a(0x1fdec3e16),c=a(0x16cf1da63),d=a(0x77727995),m=a(0x130d89881),_=a(0x1a043bf26),p=a(0x20482ad21),u=a(0x1d104c491),g=a(0x2493ba930),f=a.n(g);let b=new p.Ay("workflow_builder");function getColumnSortField(e){return e.sort_payload_field??e.payload_field}let getGenericRecordValue=(e,t)=>{let a=(0,d.A)(e.record_fields,t.key);return a.record_field_sort_value??a.record_field_rendered_value},isGenericRecord=e=>"record_identifier"in e&&void 0!==e.record_identifier;function getRecordKey(e){return isGenericRecord(e)?e.record_identifier:e.id}function getRecordName(e){return isGenericRecord(e)?e.record_name??b.t("Missing Data"):e.name}function getObjectType(e){return isGenericRecord(e)?e.object_identifier:u.Dj.Opportunity}function getRecordField(e,t){return isGenericRecord(e)?getGenericRecordField(e,t)??b.t("Missing Data"):e[t]}function getGenericRecordField(e,t){return e.record_fields[t]?.record_field_rendered_value}function getInitialSortByValue(e){let t=e.find(e=>e.primary_sort)||e[0],a=t?.primary_sort?.toLowerCase();return{key:getColumnSortField(t),dir:"desc"===a||"descending"===a?"desc":"asc"}}function getDisplayTypeClassNames(e){return{text:f()[`${e}_text`]||f().standard_text,border:f()[`${e}_border`]||f().standard_border,borderDark:f()[`${e}_border_dark`]||f().standard_border_dark,lightText:f()[`${e}_light_text`]||f().standard_light_text,background:f()[`${e}_background`]||f().standard_background}}function RecordsListTableHeader({column:e,displayType:t,isSortAsc:a,isSortKey:n,onClick:c}){let d=getDisplayTypeClassNames(t);return r.createElement(o.Nm,{onClick:c,className:l()(f().records_list_table_cell,f().records_list_table_cell_header,d.text)},r.createElement(i.A,{withTooltip:!0,lines:1},e.name),n&&r.createElement(s.Ah,{name:a?"arrow-up":"arrow-down",size:"16"}))}RecordsListTableHeader.displayName="RecordsListTableHeader";let h=new p.Ay("modernselling");function RecordsListTablePagination({pageRange:[e,t],totalItems:a,autoClogProps:n,onNextClick:l,onPrevClick:i}){return r.createElement("div",{className:f().records_list_table_pagination},r.createElement(o.Nm,{"aria-label":h.t("Previous page"),autoClogProps:n,disabled:!i,onClick:i},r.createElement(s.Ah,{name:"caret-left",size:"16"})),r.createElement("span",null,h.t("Showing {start}-{end} of {totalItems}",{start:e+1,end:t,totalItems:a})),r.createElement(o.Nm,{"aria-label":h.t("Next page"),autoClogProps:n,disabled:!l,onClick:l},r.createElement(s.Ah,{name:"caret-right",size:"16"})))}RecordsListTablePagination.displayName="RecordsListTablePagination";var E=a(0x4c96e5d9),x=a(0x91728dda),y=a(0x146e4ebc8),A=a(0x174bb7323),C=a(0x1faa3f1ac),k=a(0x1feb18f19),S=a(0x129529b49),N=a(0x11928a844),w=a.n(N);let Stage=e=>r.createElement("div",{"aria-label":e["aria-label"],className:l()(w().stage,{[w().previous]:"previous"===e.type,[w().current]:"current"===e.type})},r.createElement(i.A,{lines:1,withTooltip:!0},e.children));Stage.displayName="Stage";var v=a(0x113cdbbd7),O=a(0xc368465d),I=a(0x81d6854c),M=a(0xf01a9d50);let R=new p.Ay("modernselling");function MaybeHoverCard({record:e,children:t,shouldHide:a,salesforceOrgId:n}){return a||isGenericRecord(e)?r.createElement(r.Fragment,null,t):r.createElement(S.E,{opportunity:e,salesforceOrgId:n},t)}function MaybeLink({record:e,children:t,shouldHide:a}){return a?r.createElement(r.Fragment,null,t):r.createElement(C.A,{href:e.record_link},t)}MaybeHoverCard.displayName="MaybeHoverCard",MaybeLink.displayName="MaybeLink";let renderRecordDeltaValue=e=>{if(isGenericRecord(e)||!e.amount_change||!e.amount_change_raw)return null;let t=e.amount_raw?.amount||0,a=e.amount_change_raw.amount,n=e.amount_change_raw.percent,l=!t&&100===n,o=`${l?"-":""}${n}%`;return 0x7fffffff===n&&(o=R.t("New")),r.createElement("div",{className:l||a<0?f().amount_change_negative:f().amount_change_positive},r.createElement(i.A,{lines:1,withTooltip:!0},r.createElement("span",{className:"bold"},e.amount_change),r.createElement("span",null," (",o,")")))};renderRecordDeltaValue.displayName="renderRecordDeltaValue";let renderRecordNameValue=(e,t,{isPreview:a,showHoverCard:n},l)=>r.createElement(MaybeHoverCard,{record:e,shouldHide:a||!n,salesforceOrgId:l},r.createElement(MaybeLink,{record:e,shouldHide:!n},r.createElement(C.A,null,r.createElement(i.A,{lines:1},r.createElement(s.Ah,{inline:!0,...(0,M.C)(getObjectType(e))}),r.createElement("span",{className:"margin_left_25 bold"},getRecordName(e)))))),renderOpportunityRecordStageChangeValue=(e,t)=>r.createElement(k.c,{space:"75"},r.createElement(Stage,{"aria-label":t?R.t("Previous stage {stage}",{stage:e.prev_stage}):`Previous stage ${e.prev_stage}`,type:"previous"},e.prev_stage),r.createElement(s.Ah,{name:"arrow-right"}),r.createElement(Stage,{"aria-label":t?R.t("Current stage {stage}",{stage:e.stage}):`Current stage ${e.stage}`,type:"current"},e.stage));renderOpportunityRecordStageChangeValue.displayName="renderOpportunityRecordStageChangeValue";let renderOpportunityRecordRichTextValue=(e,t)=>"close_date_change"===t.payload_field?r.createElement(O.A,{blocks:e.close_date_change?.blocks,blocksContainerContext:v.pi.sales_home_notification}):r.createElement(k.c,{space:"75"},r.createElement(I.A,null));renderOpportunityRecordRichTextValue.displayName="renderOpportunityRecordRichTextValue";let renderOpportunityRecordStageValue=e=>r.createElement(Stage,{"aria-label":"",type:"current"},e.stage);renderOpportunityRecordStageValue.displayName="renderOpportunityRecordStageValue";let renderRecordValueAsString=(e,t)=>r.createElement(i.A,{lines:1,withTooltip:!0},r.createElement("span",{className:t.primary_sort?"bold":void 0},(0,A.A)(getRecordField(e,t.payload_field))));function renderRecordValue(e,t,a,r,n=!1){return isGenericRecord(e)?renderGenericRecordValue(e,t,a):renderOpportunityRecordValue(e,t,a,r,n)}function renderOpportunityRecordValue(e,t,a,r,n=!1){switch(t.type){case"name":return renderRecordNameValue(e,t,a,r);case"stage":return renderOpportunityRecordStageValue(e);case"stage_change":return renderOpportunityRecordStageChangeValue(e,n);case"rich_text":return renderOpportunityRecordRichTextValue(e,t);case"delta":return renderRecordDeltaValue(e,t,a);default:return renderRecordValueAsString(e,t,a)}}function renderGenericRecordValue(e,t,a,r){return"name"===t.type?renderRecordNameValue(e,t,a,r):renderRecordValueAsString(e,t,a)}var T=a(0x226892387);let F=new p.Ay("modernselling");function RecordsListTableRow({columns:e,isFocused:t,isPreview:a,record:n,salesforceOrgId:o,notificationCreatedTs:s,isLastRow:i,isWorkflowPreview:c}){let[d,m]=(0,r.useState)(!1),_=(0,T.d4)(x.zX),p=(0,r.useMemo)(()=>{if(a)return[];let e=getRecordKey(n);return[{key:"opportunity-share-button",enabled:!!s,render:()=>e&&s&&r.createElement(y.V,{hasFocus:!!t,createdTs:s,notificationType:"record",isAdminCreated:!0,opportunityId:e})}].filter(({enabled:e=!0})=>e)},[a,n,s,t]),u=!a&&p.length>0,g=(0,r.useCallback)(()=>m(!0),[]),b=(0,r.useCallback)(()=>m(!1),[]),h=!a,A=r.createElement("div",{onPointerOver:g,onPointerLeave:b,className:l()(f().records_list_table_row,f().records_list_table_row_body,{[f().records_list_table_row_border]:!i}),style:h?{cursor:"pointer"}:void 0},e.map(t=>c?r.createElement("div",{key:t.name,className:l()(f().records_list_table_cell,f().preview_table_cell,getDisplayTypeClassNames("standard").background)}):r.createElement("div",{key:t.name,className:l()(f().records_list_table_cell,{[f().records_list_table_cell_2_col]:2===e.length})},renderRecordValue(n,t,{isPreview:a,showHoverCard:!1},o,_))),u&&r.createElement("div",{className:l()(f().records_list_action_bar_container,u&&(t||d)&&f().records_list_action_bar_container_visible)},p.map(({key:e,render:t})=>r.createElement(r.Fragment,{key:e},t()))));return h?r.createElement(E.Ay,{tip:F.t("Open Record"),position:"top"},A):A}RecordsListTableRow.displayName="RecordsListTableRow";var H=a(0x106809bc6);function getPageRange(e,t,a){return[(0,H.A)(e,0,a-1),(0,H.A)(e+t,t,a)]}function usePagination(e,{pageSize:t}){let[a,n]=(0,r.useState)(0);(0,r.useEffect)(()=>n(0),[t]);let l=e.length,o=Math.ceil(l/t),s=a>=t,i=a<l-t,c=(0,r.useCallback)(()=>n(0),[]),d=(0,r.useCallback)(()=>n(e=>e-t),[t]),m=(0,r.useCallback)(()=>n(e=>e+t),[t]),_=(0,r.useMemo)(()=>getPageRange(a,t,l),[a,t,l]);return{page:(0,r.useMemo)(()=>e.slice(..._),[e,_]),prev:s?d:void 0,next:i?m:void 0,range:_,reset:c,totalPages:o}}var L=a(0x754ea859),P=a(0xc0b7c558);function RecordsListTable({columns:e,displayType:t,isPreview:a,records:n,paginationAutoClogProps:o,salesforceOrgId:s,notificationCreatedTs:i,isWorkflowPreview:p,isStepPreview:u}){let[g,b]=(0,r.useState)(!1),[h,E]=(0,r.useState)(()=>getInitialSortByValue(e)),x=getDisplayTypeClassNames(t),{page:y,reset:A,...C}=usePagination((0,r.useMemo)(()=>p?[...n]:[...n].sort((e,t)=>{let a="asc"===h.dir,r=isGenericRecord(e)?getGenericRecordValue(e,h):(0,d.A)(e,h.key),n=isGenericRecord(t)?getGenericRecordValue(t,h):(0,d.A)(t,h.key);return("string"==typeof r&&"string"==typeof n&&(r=r.toLocaleUpperCase(),n=n.toLocaleUpperCase()),void 0===r)?1:void 0===n?-1:r<n?a?-1:1:r>n?a?1:-1:0}),[p,n,h]),{pageSize:5}),k=(0,r.useCallback)(e=>()=>{A(),E(({key:t,dir:a})=>({key:e,dir:e===t&&"asc"===a?"desc":"asc"}))},[A]),S=(0,r.useCallback)(e=>{let a=getColumnSortField(e);return r.createElement(RecordsListTableHeader,{key:e.name,column:e,displayType:t,isSortAsc:"asc"===h.dir,isSortKey:!p&&a===h.key,onClick:k(a)})},[h,k,t,p]),N=(0,r.useCallback)((n,{hasFocus:l,hasFocusWithin:o})=>r.createElement(RecordsListTableRow,{key:getRecordKey(y[n]),columns:e,displayType:t,isFocused:l||o,isPreview:a,record:y[n],salesforceOrgId:s,notificationCreatedTs:i,isLastRow:n===y.length-1,isWorkflowPreview:p}),[y,e,t,a,s,i,p]),w=(0,r.useCallback)(()=>b(!0),[]),v=(0,r.useCallback)(()=>b(!1),[]),O=(0,c.wA)(),I=(0,r.useCallback)(e=>{O((0,L.c)({recordId:y[e.id].slack_record_id??(0,P.j)(s,getRecordKey(y[e.id]))}))},[O,y,s]);return r.createElement("div",{onPointerOver:w,onPointerLeave:v,className:l()(x.background,f().records_list_table,{[f().records_list_table_workflow_preview]:p,[f().records_list_table_workflow_step_preview]:u})},r.createElement("div",{className:f().records_list_table_row},e.map(S)),r.createElement(m.A,{disableHeight:!0},({width:e})=>r.createElement(_.A,{keys:Object.keys(y),width:e,height:51*y.length,rowRenderer:N,onItemClick:a?void 0:I,containerClassName:l()(f().records_list_table_rows_container,g&&!p?x.borderDark:x.border)})),C.totalPages>1&&r.createElement(RecordsListTablePagination,{pageRange:C.range,totalItems:n.length,autoClogProps:o,onNextClick:C.next,onPrevClick:C.prev}))}RecordsListTable.displayName="RecordsListTable";var D=a(0x3711e82d);let U=r.memo(({columns:e,displayType:t="standard",isWorkflowPreview:a,isExpandedByDefault:n=a,isPreview:c,isStepPreview:d,records:m,title:_,workflowId:p,salesforceOrgId:u,notificationCreatedTs:g})=>{let[b,h]=(0,r.useState)(n),E=(0,r.useCallback)(()=>h(e=>!e),[]),x=getDisplayTypeClassNames(t),y=(0,r.useCallback)(e=>{if(!c)return{onClick:{enableClogAction:!0},eventId:D.EventId.LOB_NOTIFICATIONS,elementName:e,workflowId:p}},[p,c]);return r.createElement("div",{className:l()(f().records_list_container,{[f().preview_not_expanded]:a&&!b})},r.createElement(o.Nm,{autoClogProps:y("expand_notification"),className:l()(x.text,x.background,f().records_list_toggle,b&&f().records_list_toggle_expanded),onClick:E},r.createElement(s.Ah,{name:b?"caret-down-filled":"caret-right-filled",size:"20"}),a?r.createElement(i.A,{withTooltip:!0,lines:1},r.createElement("span",{className:f().records_list_title},_)):r.createElement(r.Fragment,null,r.createElement("span",{className:f().records_list_title},_),r.createElement("span",{className:x.text},m.length))),b&&r.createElement(RecordsListTable,{columns:e,displayType:t,isPreview:c,records:m,paginationAutoClogProps:y("show_more"),salesforceOrgId:u,notificationCreatedTs:g,isWorkflowPreview:a,isStepPreview:d}))})}}]);
//# sourceMappingURL=https://slack.com/source-maps/bv1-13/gantry-v2-async-client-sales-home-view.aa9c2f4070a8f8597d47.min.js.mapØA
—Eoúô