update with reason ${c} failed, initiated by generated fetcher`),r(e)})}));s.meta={name:"salesHomeWorkflowsUpdateFetcher",key:"createFetcherSalesHomeWorkflowsUpdateFetcher",description:"salesHome.workflows.update generated fetcher"}},0x10d5ee185:(e,t,a)=>{"use strict";a.d(t,{_:()=>r});var n=a(0x1d14b4538),i=a(0x11571542c);let r=(0,a(0x11c82607b).Ay)("Create workflow template and publish it",async(e,t,a)=>{let{reason:r}=a,{workflow_id:o}=await e((0,i.k)(a));return e((0,n.Y)({workflowId:o,reason:r}))});r.meta={name:"createWorkflowTemplate",key:"createThunkCreateWorkflowTemplate",description:"Create workflow template and publish it"}},0x783a2e96:(e,t,a)=>{"use strict";a.d(t,{_:()=>c});var n=a(0xd896af8a),i=a(0x1f9d49863),r=a(0xe2e863bc),o=a(0x11c82607b),l=a(0x16b708a7f),s=a(0x1c8beab7f);let c=(0,o.Ay)("Fetches a list of Salesforce orgs available to the user",async(e,t)=>{try{e((0,l.IL)());let a=await e((0,r.n)({reason:"sales-elevate-multi-org"}));if(!a.ok)throw Error(n.B.FetchAdminOrgList);if(e((0,l.Jj)(a.salesforce_orgs)),!(0,s.Ey)(t())){let t=a.salesforce_orgs.find(i.W);t&&e((0,l.Ox)(t))}return a}catch{e((0,l.mr)(n.B.FetchAdminOrgList))}return null});c.meta={name:"fetchAdminOrgList",key:"createThunkFetchAdminOrgList",description:"Fetches a list of Salesforce orgs available to the user"}},0x2037c754f:(e,t,a)=>{"use strict";a.d(t,{E:()=>s});var n=a(0x34ecbfe7),i=a(0xa58468ed),r=a(0x11c82607b),o=a(0x16b708a7f),l=a(0x1d104c491);let s=(0,r.Ay)("Fetches datasource info",async(e,t,{datasourceId:a=""})=>{let{datasource:r}=await e((0,i.H)({datasourceId:a,reason:"modern-selling"})),s=r?{...r,isSandbox:r.third_party_oauth2_provider?.provider_key===l.rI.Sandbox,isConnected:r.status===n.VW.Connected,isSynced:r.status===n.VW.Synced,isDisconnected:r.status===n.VW.Disconnected,isDeleted:r.status===n.VW.Deleted,isProblem:r.status===n.VW.Problem}:null;return e((0,o.MU)(s)),s});s.meta={name:"fetchDatasourceInfo",key:"createThunkFetchDatasourceInfo",description:"Fetches datasource info"}},0x1216bc813:(e,t,a)=>{"use strict";a.d(t,{g:()=>o});var n=a(0xbdbf0a38),i=a(0x11c82607b),r=a(0x1c8beab7f);let o=(0,i.Ay)("Fetches datasource object with fields",async(e,t,{objectId:a,datasourceId:i,salesforceOrgId:o=""})=>{let l=t(),s=(0,r.uS)(l,o),c=s?.datasource_id,d=i??c;if(!d||!a)return null;let{id:u,identifier:m,label:p,is_user_object:g,is_active:f,is_trigger_supported:_,fields:h}=await e((0,n.O)({reason:"modern-selling",datasourceId:d,schemaObjectId:a}));return{id:u,identifier:m,label:p,is_user_object:g,is_active:f,is_trigger_supported:_,fields:h}});o.meta={name:"fetchDatasourceObjectWithFields",key:"createThunkFetchDatasourceObjectWithFields",description:"Fetches datasource object with fields"}},0x91c8f270:(e,t,a)=>{"use strict";a.d(t,{S:()=>o});var n=a(0x1318fdf2a),i=a(0x11c82607b),r=a(0x1c8beab7f);let o=(0,i.Ay)("Fetches list of available objects for the current datasource",async(e,t,{datasourceId:a,salesforceOrgId:i=""})=>{let o=t(),l=(0,r.uS)(o,i),s=l?.datasource_id,c=a??s;if(!c)return null;let{objects:d}=await e((0,n.i)({datasourceId:c,reason:"modern-selling"}));return d});o.meta={name:"fetchDatasourceObjectsList",key:"createThunkFetchDatasourceObjectsList",description:"Fetches list of available objects for the current datasource"}},0x52b05cae:(e,t,a)=>{"use strict";a.d(t,{b:()=>o});var n=a(0x1dc39a002),i=a(0x11c82607b),r=a(0x16b708a7f);let o=(0,i.Ay)("Fetches notification prefs for given salesforce org id",async(e,t,{salesforceOrgId:a})=>{if(!a)return null;let i=await e((0,n.s)({salesforceOrgId:a,keys:["allow_slack_connect_channels","allow_channel_workspaces","send_notification_to_channel_permission","allow_admins_to_send_to_all_channel_types"],reason:"modern-selling"}));if(!i.ok||!i.org_configs||!i.org_configs.length)return null;let{datasource_id:o,allow_channel_workspaces:l,allow_slack_connect_channels:s,send_notification_to_channel_permission:c,allow_admins_to_send_to_all_channel_types:d}=i.org_configs[0],u={salesforce_org_id:a,datasource_id:o,allowed_channel_workspaces:l,allow_slack_connect_channels:s,send_notification_to_channel_permission:c,allow_admins_to_send_to_all_channel_types:d};return e((0,r.iQ)({[a]:u})),u});o.meta={name:"fetchNotificationPrefsBySalesforceOrgId",key:"createThunkFetchNotificationPrefsBySalesforceOrgId",description:"Fetches notification prefs for given salesforce org id"}},0x77e385ed:(e,t,a)=>{"use strict";a.d(t,{N:()=>p});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x20482ad21),o=a(0x1ec19bc0c),l=a(0x226892387),s=a(0x16b708a7f),c=a(0x1c8beab7f);let d=new r.Ay("modernselling"),ConnectNewUserOrgModal=({onOrgConnected:e})=>{let t=(0,i.wA)(),a=(0,l.d4)(c.lC),r=(0,n.useCallback)(()=>{t((0,s.Ko)())},[t]);return n.createElement(o.y,{title:d.t("Log in to connect a Salesforce org"),mainText:d.t("Which Salesforce org would you like to connect with the account?"),additionalText:d.t("To connect to orgs not listed, contact your Sales admin."),userOrgsToConnect:a,handleClose:r,onOrgConnected:e})};ConnectNewUserOrgModal.displayName="ConnectNewUserOrgModal";var u=a(0x11c82607b),m=a(0x46dbff89);let p=(0,u.Ay)("Opens Connect New User Org Modal",(e,t,{onOrgConnected:a}={})=>{e((0,m.q)({element:n.createElement(ConnectNewUserOrgModal,{onOrgConnected:a})}))});p.meta={name:"openConnectNewUserOrgModal",key:"createThunkOpenConnectNewUserOrgModal",description:"Opens Connect New User Org Modal"}},0x192df3d34:(e,t,a)=>{"use strict";a.d(t,{A:()=>y});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x20482ad21),o=a(0x11a296110),l=a(0x13eedc190),s=a(0x23b496ae9),c=a(0xf225ecf2),d=a(0x1c7997c1),u=a(0x96920791),m=a(0x16d221c7f),p=a(0x142775427),g=a(0x1f803375e),f=a(0x1fcbb004d);let _=new r.Ay("modernselling"),DisconnectOrgModal=({disconnectOrgId:e,isDisconnecting:t,handleDisconnect:a,children:r})=>{let h=(0,i.wA)(),b=(0,n.useCallback)(()=>{h((0,f.O)())},[h]),y=(0,n.useCallback)(async()=>{await a(e),h((0,f.O)())},[e,h,a]);return n.createElement(l.A,{centered:!0,role:"alertdialog",onClose:b},n.createElement(p.A,null,n.createElement(g.A,{title:_.t("Disconnect this org from Sales?")})),n.createElement(c.A,null,n.createElement(d.A,null,r)),n.createElement(u.A,null,n.createElement(m.A,null,n.createElement(s.A,{onClick:b,type:"outline","aria-label":_.t("Cancel")},_.t("Cancel")),n.createElement(o.lV,{type:"danger",loading:t,onClick:y,"aria-label":_.t("Disconnect")},_.t("Disconnect")))))};DisconnectOrgModal.displayName="DisconnectOrgModal";var h=a(0x11c82607b),b=a(0x46dbff89);let y=(0,h.Ay)("Opens Disconnect Org Modal",(e,t,a)=>{e((0,b.q)({element:n.createElement(DisconnectOrgModal,a)}))});y.meta={name:"openDisconnectOrgModal",key:"createThunkOpenDisconnectOrgModal",description:"Opens Disconnect Org Modal"}},0xcefedbca:(e,t,a)=>{"use strict";a.d(t,{A:()=>_});var n=a(0xe874a88a),i=a(0x22a29f141),r=a(0x1dfdeb1c8),o=a(0x1ec68d6a3),l=a(0xe747dd27);let s=(0,r.A)("salesHome.workflows.get generated fetcher",(e,t,a)=>new n.S((n,r)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,l.VA)(d);e((0,i.apiCall)({method:"salesHome.workflows.get",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,o.default)({getState:t}).error(`API call to salesHome.workflows.get with reason ${c} failed, initiated by generated fetcher`),r(e)})}));s.meta={name:"salesHomeWorkflowsGetFetcher",key:"createFetcherSalesHomeWorkflowsGetFetcher",description:"salesHome.workflows.get generated fetcher"};var c=a(0x11c82607b),d=a(0x16b708a7f),u=a(0x2fd935d8),m=a(0x1d104c491);let p={ADMIN_SALES_HOME_DEAL_WON:m.Lb.adminDealWon,ADMIN_SALES_HOME_FORECAST_REMINDER:m.Lb.adminForecastReminder,ADMIN_SALES_HOME_NEW_OPPORTUNITY:m.Lb.adminNewOpportunityAlert,ADMIN_SALES_HOME_OPPORTUNITY_AMOUNT_CHANGED:m.Lb.adminAmountChanged,ADMIN_SALES_HOME_OPPORTUNITY_CLOSE_DATE_CHANGED:m.Lb.adminCloseDateChanged,ADMIN_SALES_HOME_OPPORTUNITY_STAGE_CHANGED:m.Lb.adminStageChanged,ADMIN_SALES_HOME_OPPORTUNITY_CLOSING_SOON:m.Lb.adminClosingSoonAlert,ADMIN_SALES_HOME_OPPORTUNITY_PAST_CLOSE_DATE:m.Lb.adminPastCloseDateAlert,ADMIN_SALES_HOME_OUTDATED_FIELD:m.YB.adminOutdatedFields,ADMIN_SALES_HOME_MISSING_FIELD:m.YB.adminMissingFields},g={SALES_HOME_DEAL_WON:m.Lb.userDealWon,SALES_HOME_FORECAST_REMINDER:m.Lb.userForecastReminder,SALES_HOME_NEW_OPPORTUNITY:m.Lb.userNewOpportunityAlert,SALES_HOME_OPPORTUNITY_AMOUNT_CHANGED:m.Lb.userAmountChanged,SALES_HOME_OPPORTUNITY_CLOSE_DATE_CHANGED:m.Lb.userCloseDateChanged,SALES_HOME_OPPORTUNITY_STAGE_CHANGED:m.Lb.userStageChanged},f=(0,c.Ay)("Fetches data for existing workflow, hydrates form data and opens notification builder",(e,t,{workflowId:a,isAdmin:n=!1,reason:i="modern-selling"})=>(n?e((0,d.MB)(!0)):e((0,d.gG)(!0)),e(s({workflowId:a,reason:i})).then(({template_id:t,payload:a,salesforce_org_id:i})=>{let r=a.acn?.account?.id||a.condition?.account?.id,o=a.acn?.opportunity?.id||a.condition?.opportunity?.id;if(r||o){let l;return e((0,u.R)({sobjects:[{sobjectApiName:r?"Account":"Opportunity",fields:["Name"]}],asIntegrationUser:n,query:(l=r||o||"",`https://fake.com/sobjects/?record_id=${l}`),...i&&{salesforceOrgId:i},reason:"edit_workflow"})).then(({records:e})=>{let[l]=e,s={...a};return l&&(n&&r?s.acn.account.name=l.label:n&&o?s.acn.opportunity.name=l.label:!n&&r?s.condition.account.name=l.label:s.condition.opportunity.name=l.label),{templateId:t,payload:s,salesforceOrgId:i}})}return{templateId:t,payload:a,salesforceOrgId:i}}).then(({templateId:t,payload:i,salesforceOrgId:r})=>{if(n){let n=p[t];e((0,d.kC)({workflowView:n,workflowId:a,payload:i,salesforceOrgId:r}))}else{let n=g[t];e((0,d.yK)({workflowView:n,workflowId:a,payload:i,salesforceOrgId:r}))}}).finally(()=>{n?e((0,d.MB)(!1)):e((0,d.gG)(!1))})));f.meta={name:"openEditWorkflow",key:"createThunkOpenEditWorkflow",description:"Fetches data for existing workflow, hydrates form data and opens notification builder"};let _=f},0x11d9e4b2f:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(0x3ebf4390),i=a(0x91728dda),r=a(0x11c82607b),o=a(0x16b708a7f),l=a(0x1c8beab7f);let s=(0,r.Ay)("Validates a Sales Home notifications workflow view form",(e,t,{workflowView:a})=>{let r=t(),s=(0,l.C1)(r,a),c=(0,n.cB)(a,s,{experimentLobOrg62UnrestrictedGroupOn:(0,i.Jx)(r),experimentLobChannelAcnTokenGroupOn:(0,i.V$)(r)});return e((0,o.a2)({workflowView:a,errors:c.errors})),c});s.meta={name:"validateWorkflowForm",key:"createThunkValidateWorkflowForm",description:"Validates a Sales Home notifications workflow view form"};let c=s},0x12c0d9ca0:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x102edf836),o=a(0x11a296110),l=a(0xb1ea448c),s=a(0x2501a2cee),c=a(0x20e80190e);let d=new i.Ay("modernselling"),ModalUtil=({alternateFooterAction:e,backText:t,children:a,contentLoading:i,hideFooter:u=!1,onBack:m,onCancel:p,onSubmit:g,preContent:f,showBack:_,showCancel:h,showSpeedBump:b,speedBump:y,submitIsDisabled:x,submitIsExternalLink:S,submitIsLoading:A,submitText:C,submitType:w=r.QE.primary,title:E})=>n.createElement(n.Fragment,null,n.createElement(c.rQ,null,n.createElement(c.Rc,{title:E})),n.createElement(c.$m,null,f&&n.createElement(c.qf,null,f),n.createElement(c.qf,null,i?n.createElement(l.A,{className:"margin_top_200 margin_bottom_200 margin_left_auto margin_right_auto"}):a)),!u&&n.createElement(c.jl,null,e??null,n.createElement(c.ox,null,_&&n.createElement(c.s_,{type:"outline",onClick:m,"aria-label":void 0},t||d.t("Back")),h&&n.createElement(c.s_,{type:"outline",onClick:p,"aria-label":d.t("Cancel")},d.t("Cancel")),n.createElement(o.lV,{loading:A,disabled:x,onClick:g,type:w,"aria-label":void 0},C,S&&n.createElement("span",{className:"margin_left_50"},n.createElement(s.Ah,{name:"new-window",size:"20"})))),b&&y));ModalUtil.displayName="ModalUtil";let u=ModalUtil},0x1b955e8fc:(e,t,a)=>{"use strict";a.d(t,{A:()=>useOpenConnectModal});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x214e51545),o=a(0x1229d92d),l=a(0x20482ad21),s=a(0x12c0d9ca0),c=a(0xd896af8a),d=a(0x266be29c),u=a(0xa72c61bb),m=a(0x226892387),p=a(0x16b708a7f),g=a(0x1c8beab7f),f=a(0x100003af0),_=a(0x766d71f),h=a(0x34ecbfe7),b=a(0x11c82607b),y=a(0x4872ed8e);let x=(0,b.Ay)("Deletes a Sales Elevate data source",async(e,t,{datasourceId:a,onError:n})=>{try{let{ok:t}=await e((0,y.K)({reason:"delete-sales-elevate-data-source",datasourceId:a}));if(!t)throw Error("Datasource deletion failed")}catch{n?.()}return null});x.meta={name:"deleteDatasource",key:"createThunkDeleteDatasource",description:"Deletes a Sales Elevate data source"};var S=a(0x783a2e96),A=a(0xe874a88a),C=a(0x22a29f141),w=a(0x1dfdeb1c8),E=a(0x1ec68d6a3),v=a(0xe747dd27);let T=(0,w.A)("salesHome.admin.setDatasourceId generated fetcher",(e,t,a)=>new A.S((n,i)=>{let{abortSignal:r,reason:o,...l}=a,s=(0,v.VA)(l);e((0,C.apiCall)({method:"salesHome.admin.setDatasourceId",args:s,abortSignal:r,reason:o})).then(e=>{n(e)}).catch(e=>{(0,E.default)({getState:t}).error(`API call to salesHome.admin.setDatasourceId with reason ${o} failed, initiated by generated fetcher`),i(e)})}));T.meta={name:"salesHomeAdminSetDatasourceIdFetcher",key:"createFetcherSalesHomeAdminSetDatasourceIdFetcher",description:"salesHome.admin.setDatasourceId generated fetcher"};var O=a(0x2037c754f);let N=(0,b.Ay)("Sets selected datasource to an org",async(e,t,{datasourceId:a,selectedSalesforceOrg:n,onSuccess:i,onError:r})=>{try{e((0,p.fL)("updating"));let t=n.salesforce_org_id,{ok:r}=await e(T({datasourceId:a,salesforceOrgId:t,reason:"modern-selling"}));if(!r)throw Error(c.B.SelectDatasource);e((0,p.Ox)({...n,datasource_id:a}));let o=await e((0,O.E)({datasourceId:a}));i(o),e((0,S._)()),e((0,p.Zz)({})),e((0,p.fL)("success"))}catch{e((0,p.iA)(c.B.SelectDatasource)),r()}});N.meta={name:"setDatasource",key:"createThunkSetDatasource",description:"Sets selected datasource to an org"};let k=(0,b.Ay)("Adds a new datasource datasource and sets as connected",async(e,t,{thirdPartyOauth2TokenId:a,onSuccess:n,onError:i})=>{let r,handleError=(t,a)=>{e((0,p.DN)("error")),t&&e(x({datasourceId:t})),i(a)};try{e((0,p.DN)("fetching"));let{datasource:t}=await e((0,_.m)({third_party_oauth2_token_id:a,data_source_access_permission:h.Jw.Public,creation_source:h.$f.SalesElevate,name:"Datasource"}));if(!t)throw Error(c.B.AddDatasourceError);r=t.id;let{salesforce_orgs:i}=await e((0,S._)())??{},o=i&&(0,f.z)([t],i);if(!o)throw Error(c.B.AddDatasourceError);await e(N({datasourceId:r,onSuccess:t=>{n(t),t&&e((0,p.m4)({salesforceOrgId:o.salesforce_org_id,datasourceId:t.id})),e((0,p.DN)("success"))},onError:()=>{handleError(r,c.B.DuplicateOrgError)},selectedSalesforceOrg:o}))}catch{handleError(r,c.B.AddDatasourceError)}return null});k.meta={name:"addNewConnectedDatasource",key:"createThunkAddNewConnectedDatasource",description:"Adds a new datasource datasource and sets as connected"};let I=new l.Ay("modernselling"),AddSourceStep=({onDone:e,setError:t,windowRef:a,...r})=>{let o=(0,u.I)(),l=(0,i.wA)(),f=(0,m.d4)(g.O7),_=(0,m.d4)(g.T8),h=(0,m.d4)(g.bi),b=(0,m.d4)(g.oG),y="fetching"===h,x="fetching"===b,S=y||x,A=(0,d.s)({providerKey:f,appId:o}),C=(0,n.useCallback)(()=>{l((0,p.O_)("fetching")),A()},[l,A]);return(0,n.useEffect)(()=>{!_||y||l(k({thirdPartyOauth2TokenId:_.thirdPartyOauth2TokenId,onSuccess:t=>{e({closeModal:!0}),l((0,p.aB)())},onError:e=>{t(e??c.B.AddDatasourceError),l((0,p.Fi)())}}))},[l,y,_,e,t]),(0,n.useEffect)(()=>{let handleRefocus=async()=>{a.deref()?.removeEventListener("focus",handleRefocus),x&&(t(c.B.AddDatasourceError),l((0,p.O_)("error")))};return a.deref()?.addEventListener("focus",handleRefocus),()=>{a.deref()?.removeEventListener("focus",handleRefocus)}},[_,t,b,a,x,l]),n.createElement(s.A,{...r,title:I.t("Add a Salesforce org"),submitText:I.t("Login to Add"),submitIsExternalLink:!0,onSubmit:C,submitIsLoading:S},n.createElement("div",{className:"margin_top_100 margin_bottom_100"},n.createElement("p",null,I.rt("Sign in with a system user account.")),n.createElement("p",null,I.t("Slack will stay signed as the system user so the Sales team can set up notifications for opportunities in the Salesforce org."))))};AddSourceStep.displayName="AddSourceStep";let F=(0,o.A)(AddSourceStep);var D=a(0xca924ee1),M=a(0x2b7f0bcc),R=a(0x1d2cd7755),L=a(0x139c79d16),P=a(0xa5dbe09b),B=a(0x1faa3f1ac),H=a(0x1d104c491);let U=new l.Ay("modernselling"),ChooseEnvironmentStep=({onDone:e,windowRef:t,...a})=>{let r=(0,i.wA)(),o=(0,m.d4)(g.O7),l=(0,n.useMemo)(()=>({production:{value:H.rI.Production,label:U.t("Production")},sandbox:{value:H.rI.Sandbox,label:U.t("Sandbox")}}),[]),d=(0,n.useCallback)(()=>{e({goToStep:c.b.AddSource})},[e]),u=(0,n.useCallback)(e=>{r((0,p.M5)(e))},[r]),f=(0,n.useMemo)(()=>o===H.rI.Sandbox,[o]),_=(0,n.useMemo)(()=>{let e=U.t("What\u2019s the difference?");return n.createElement(B.A,{"aria-label":e,href:"https://help.salesforce.com/s/articleView?id=sf.deploy_sandboxes_intro.htm&type=5",target:"_blank"},e)},[]);return n.createElement(s.A,{...a,title:U.t("Add a Salesforce org"),submitText:U.t("Continue"),onSubmit:d,alternateFooterAction:_},n.createElement(P.A,{legendText:U.t("Select an environment"),className:"margin_top_100 margin_bottom_100"},Object.values(l).map(e=>{let t=(0,D.A)(()=>u(e.value));return n.createElement(R.A,{key:e.value,type:"inline",cursor:"pointer",text:e.label},n.createElement(L.A,{checked:e.value===o,onChange:t}))})),f&&n.createElement(M.Ay,{level:"warning",className:"margin_top_125 margin_bottom_100",heading:U.t("This Salesforce org will be deleted when the sandbox environment is refreshed")},U.t("If this happens, you\u2019ll need to add this org again and recreate any Sales notifications you set up.")))};ChooseEnvironmentStep.displayName="ChooseEnvironmentStep";let V=(0,o.A)(ChooseEnvironmentStep);var W=a(0x1fd440889);let q=(0,b.Ay)("Checks if user created a new datasource after being redirect to integrations builder",async(e,t)=>{try{let a=t(),n=(0,g.KY)(a),i=await e((0,W.z)({creationSource:h.N$.SalesElevate,reason:"modern-selling"}));if(!i.ok)throw Error(c.B.CreateDatasourceError);if(i.datasources.some(({id:e})=>!n.some(({id:t})=>e===t)))return await e((0,S._)()),e((0,p.Kg)("success")),!0;return!1}catch{return e((0,p.qO)(c.B.CreateDatasourceError)),!1}});q.meta={name:"getIsNewDatasourceCreated",key:"createThunkGetIsNewDatasourceCreated",description:"Checks if user created a new datasource after being redirect to integrations builder"};var j=a(0x20fb5e2f6);let Y=(0,b.Ay)("Opens WFB integrations manager page in new app window or browser tab",async e=>{try{e((0,p.Kg)("fetching"));let t=await e((0,W.z)({creationSource:h.N$.SalesElevate,reason:"modern-selling"}));if(!t.ok)throw Error(c.B.CreateDatasourceError);e((0,p._f)(t.datasources)),e((0,j.A)())}catch{e((0,p.qO)(c.B.CreateDatasourceError))}});Y.meta={name:"startCreateNewDatasource",key:"createThunkStartCreateNewDatasource",description:"Opens WFB integrations manager page in new app window or browser tab"};let z=new l.Ay("modernselling"),CreateSourceStep=({onDone:e,windowRef:t,...a})=>{let o=(0,i.wA)(),l=(0,m.d4)(g.yj),d=(0,m.d4)(g.k),u=(0,n.useCallback)(()=>{o(Y())},[o]);return(0,n.useEffect)(()=>{if("fetching"!==l)return;let handleRefocus=async()=>{await o(q())&&(t.deref()?.removeEventListener("focus",handleRefocus),e({goToStep:c.b.SelectSalesforceOrg}))};return t.deref()?.addEventListener("focus",handleRefocus),()=>{t.deref()?.removeEventListener("focus",handleRefocus),o((0,p.Kg)("initial"))}},[o,e,l,t]),n.createElement(s.A,{...a,title:z.t("Add a new integration"),submitText:z.t("Manage Integrations"),submitIsExternalLink:!0,submitIsLoading:"fetching"===l,onSubmit:u},"error"===l&&d&&n.createElement(r.F,{className:"margin_bottom_150",errorType:d}),n.createElement("p",null,z.rt("To use a new integration, you can add one in Workflow Builder. When you\u2019re done, come back here to Sales settings.")),n.createElement(M.Ay,{level:"info",className:"margin_top_25 margin_bottom_25",heading:z.t("When prompted, sign in to Salesforce")},z.t("Be sure to sign in using the account you want to use for the new integration. Slack will stay signed in using that account, and allow your team to set up notifications based on changes to that data.")))};CreateSourceStep.displayName="CreateSourceStep";let G=(0,o.A)(CreateSourceStep);var $=a(0x120c268ad),Q=a.n($),K=a(0x17294c72a),J=a(0x1595bdd0),Z=a(0x13815c0d1),X=a(0x1d01572a2),ee=a(0x1407c6c2c),et=a(0x15014e268),ea=a(0x1d1911997),en=a(0x6e87d4ec);let buildObjectMappingField=(e,t,a)=>{let n=e.fields?.find(e=>e.identifier===t),i={sfdc_field_identifier:n.identifier,sfdc_field_label:n.label,troops_schema_field_id:n.id,type:n.type,related_schema_object_id:n.relationships?.[0].related_schema_object_id,relationship_name:n.relationships?.[0].relationship_name};return a&&(i.values=a.values.reduce((e,t)=>(e[t.key]=t.values,e),{})),i};function buildObjectMappingSchema(e,t,a){let n={};return Object.entries(t||{}).forEach(([t,i])=>{let r=a?.find(e=>e.target===t);r?n[t]=buildObjectMappingField(e,i,r):n[t]=buildObjectMappingField(e,i)}),{troops_schema_object_id:e.id,sfdc_object_identifier:e.identifier,sfdc_object_label:e.label,fields:n}}var ei=a(0x20e80190e);let er=new l.Ay("modernselling"),MapFieldsChangeOpportunitySpeedBump=({onCancel:e,onSubmit:t})=>n.createElement(ei.ty,{heading:er.t("Change opportunity object?"),description:er.t("The opportunity field selections you\u2019ve made will be cleared."),onCancel:e,onContinue:t,continueButtonType:"danger",continueButtonLabel:er.t("Continue"),cancelButtonLabel:er.t("Cancel")});MapFieldsChangeOpportunitySpeedBump.displayName="MapFieldsChangeOpportunitySpeedBump";let eo=new l.Ay("modernselling"),MapFieldsSubmitSpeedBump=({isSubmitting:e,onCancel:t,onSubmit:a})=>n.createElement(ei.ty,{heading:eo.t("Confirm opportunity mapping update"),description:eo.t("Everyone will need to re-authenticate, recreate existing notifications, and admins will need to reconfigure the deal won celebration."),onCancel:t,onContinue:a,continueButtonType:"danger",continueButtonLabel:eo.t("Update"),cancelButtonLabel:eo.t("Cancel"),continueButtonIsLoading:e});MapFieldsSubmitSpeedBump.displayName="MapFieldsSubmitSpeedBump";var el=a(0xb77a689a),es=a(0xa7ec93c2),ec=a(0x1122238d8),ed=a(0x4a120eb2);let eu=new l.Ay("modernselling"),em=[],StageMultiSelect=({id:e,isLoading:t,onChange:a,stagesForClosed:i,stageField:r})=>{let o=(0,n.useMemo)(()=>r?(0,ec.I_)(r):[],[r]),l=(0,n.useMemo)(()=>o.filter(e=>i?.includes(e.value)),[i,o]),s=(0,n.useCallback)(async e=>e?o.filter(t=>((0,el.A)(t.label)?t.label:t.value).toLowerCase().includes(e.toLowerCase())):o,[o]),c=eu.t("Select\u2026");return n.createElement(n.Fragment,null,t&&n.createElement(es.Ay,{className:"normal full_width",isLoading:t,isRequired:!0,options:em,placeholderText:c,selectId:e,selectedOptions:void 0,width:"100%"}),!t&&n.createElement(ed.x,{key:r?.id,className:"normal full_width",expandOnFocus:!0,debounceWaitPeriod:0,onSelectedItemsChange:a,placeholderText:c,search:s,selectedOptions:l??void 0,selectId:e,shouldAllowUnselectInMultiSelectMode:!0,width:"100%"}))};StageMultiSelect.displayName="StageMultiSelect";var ep=a(0x200c38ed8),eg=a(0x1216bc813),ef=a(0x91c8f270),e_=a(0x609b6779),eh=a(0x6258badf);let eb=(0,w.A)("salesHome.admin.setObjectMappings fetcher with capitalized keys",async(e,t,a)=>{try{let t,n=(0,eh.A)(a,["reason"]),i=(0,v.VA)(n);return t=i.object_mappings,i.object_mappings=Object.keys(t).reduce((e,a)=>(e[(0,Z.A)(a)]=t[a],e),{}),await e((0,C.apiCall)({method:"salesHome.admin.setObjectMappings",args:i,reason:a.reason}))}catch(e){throw(0,E.default)({getState:t}).error(`API call to salesHome.admin.setObjectMappings with reason ${a.reason} failed`),e}});eb.meta={name:"setObjectMappingsWithCapitalizedKeys",key:"createFetcherSetObjectMappingsWithCapitalizedKeys",description:"salesHome.admin.setObjectMappings fetcher with capitalized keys"};let ey=(0,b.Ay)("Update notifications pref datasource object field mappings",async(e,t,{objectMappings:a,salesforceOrgId:n})=>{let i=(0,E.default)({label:"SALES-HOME-ADMIN"}),r=(0,g.J3)(t());r&&Object.keys(r).forEach(e=>{a[e]||(a[e]=r[e])});try{await e(eb({reason:"modern-selling",objectMappings:a,salesforceOrgId:n})),e((0,p.Zz)(a))}catch(e){throw i.error("failed to set object mapping",e),e}});ey.meta={name:"updateNotificationsDatasourceMappingsBySalesforceOrgId",key:"createThunkUpdateNotificationsDatasourceMappingsBySalesforceOrgId",description:"Update notifications pref datasource object field mappings"};var ex=a(0x16ffed5ab),eS=a(0x5a1d0c42),eA=a.n(eS);let eC=new l.Ay("modernselling"),ew=[],eE="Opportunity",ev={[H.Ix.AccountId]:"Account ID",[H.Ix.Amount]:"Amount",[H.Ix.CloseDate]:"Close Date",[H.Ix.NextSteps]:"Next Step",[H.Ix.Stage]:"Stage"},eT=[H.Ix.AccountId,H.Ix.Amount,H.Ix.CloseDate,H.Ix.NextSteps,H.Ix.Stage],eO={[H.Ix.Name]:"Name",[H.Ix.OwnerId]:"OwnerId"};function usePrefMappingsByTarget(){let e=(0,ep.aV)();return(0,n.useMemo)(()=>e?.field_mappings.reduce((e,t)=>(e[t.target]=t.source.sfdc_field_identifier,e),{}),[e])}let OpportunityObjectSelect=({onChange:e,salesforceObjects:t,selectedOppObjIdentifier:a})=>{let i=(0,ee.A)(),[r,o]=(0,n.useState)(0),l=(0,n.useMemo)(()=>{let e=t?.filter(e=>e.is_active&&(e.identifier.endsWith("__c")||e.identifier===eE));return(0,K.A)(e,"label").map(e=>({label:e.label,value:e.identifier}))},[t]),s=(0,n.useMemo)(()=>a?l.find(e=>e.value===a):void 0,[l,a]),c=(0,n.useCallback)(e=>{""===e.target.value&&s&&o(e=>e+1)},[s]);return(0,n.useEffect)(()=>{o(e=>e+1)},[s]),n.createElement(R.A,{text:eC.t("Opportunity object"),className:"margin_bottom_125"},n.createElement(ea.Ay,{key:`${i}_${r}`,selectId:i,selectedOption:s,options:l||ew,onOptionSelected:e,onBlur:c,width:"100%"}))};OpportunityObjectSelect.displayName="OpportunityObjectSelect";let FieldSelect=({type:e,label:t,schemaIdentifier:a,allFields:i,selectedField:r,selectId:o,onChange:l,isLoading:s,withoutLabel:c})=>{let d=(0,n.useMemo)(()=>{let t=i?.filter(t=>t.is_active&&t.type===e);return(0,K.A)(t,"label").map(e=>({label:e.label,value:e.identifier}))},[i,e]),u=(0,n.useMemo)(()=>r?d.find(e=>e.value===r):null,[d,r]),m=(0,n.useMemo)(()=>s||0!==d.length?[]:[{id:o,message:eC.t("There are no options compatible with this field.")}],[s,d.length,o]),p=eC.t("Loading options\u2026");return c?n.createElement(et.Ay,{key:a,isDisabled:s||0===d.length,placeholderText:s?p:void 0,selectId:o,onOptionSelected:l,options:d||ew,selectedOption:u,errors:m,width:"100%"}):n.createElement(R.A,{text:t,className:"margin_bottom_125 normal"},n.createElement(et.Ay,{key:a,isDisabled:s||0===d.length,placeholderText:s?p:void 0,selectId:o,onOptionSelected:l,options:d||ew,selectedOption:u,errors:m,width:"100%"}))};FieldSelect.displayName="FieldSelect";let MapFieldsStep=({onDone:e,setError:t,data:a,...r})=>{let o=(0,i.wA)(),l=a?.selectedSalesforceOrgDatasourceId,d=(0,m.d4)(g.e$),u=l??d,p=(0,m.d4)(g.rg),f=usePrefMappingsByTarget(),_=(0,m.d4)(g.CE),[h,b]=(0,n.useState)(_||null),y=(0,ep.aV)(),[x,S]=(0,n.useState)(!0),[A,C]=(0,n.useState)(!0),[w,E]=(0,n.useState)(!1),[v,T]=(0,n.useState)(!1),[O,N]=(0,n.useState)(!1),[k,I]=(0,n.useState)(!1),[F,L]=(0,n.useState)(null),[P,B]=(0,n.useState)(null),[U,V]=(0,n.useState)(!1),[W,q]=(0,n.useState)(!1),[j,Y]=(0,n.useState)(null),[z,G]=(0,n.useState)(null),[$,K]=(0,n.useState)(f||null),[ee,et]=(0,n.useState)(null);(0,X.A)(()=>{o((0,ef.S)({datasourceId:u,salesforceOrgId:p})).then(e=>{if(L(e),e){let t=y?.source.sfdc_object_identifier||eE;e.some(e=>e.identifier===t)&&Y(t||null)}}).catch(()=>{t(c.B.FetchDatasourceInfo)}).finally(()=>{S(!1)})}),(0,n.useEffect)(()=>{if(B(null),K(null),j&&F){C(!0);let e=F.find(e=>e.identifier===j)?.id;if(!e){t(c.B.FetchDatasourceInfo),C(!1);return}u&&o((0,eg.g)({objectId:e,datasourceId:u,salesforceOrgId:p})).then(t=>{if(B(t),V(t?.identifier!=="Opportunity"),f&&y?.source.troops_schema_object_id===e){q("StageName"!==f.stage),K(f);return}t?.fields&&K(()=>Object.entries(ev).reduce((e,[a,n])=>{let i=t?.fields?.find(e=>e.is_active&&e.label===n);return i&&(e[a]=i.identifier),e},{}))}).catch(()=>{t(c.B.FetchDatasourceInfo)}).finally(()=>{C(!1)})}},[o,f,y,j,t,F,u,p]);let ea=(0,n.useCallback)(e=>{e&&Object.keys($||{}).length>0?(G(e.value),T(!0)):(E(!0),Y(e?e.value:null))},[$]),ei=(0,n.useMemo)(()=>(0,D.A)(e=>t=>{E(!0),K(a=>({...a,[e]:t.value})),"stage"===e&&(b(null),et(null),q("StageName"!==t.value))}),[]),er=(0,n.useCallback)((e,t,a)=>{let n={target:e,values:[{key:t,values:(0,J.A)(a?.map(e=>e.value))}]};et(e=>e?e?.find(e=>e.target===n.target)?e?.map(e=>e.target===n.target?n:e):[...e,n]:[n])},[]),eo=(0,n.useCallback)(e=>{er("stage","stage_closed",e),E(!0)},[er]),el=(0,n.useCallback)(()=>{if(!P||!$||!j)return;t(null),I(!0);let a={};ee?a[(0,Z.A)(H.hd.Opportunity)]=buildObjectMappingSchema(P,$,ee):a[(0,Z.A)(H.hd.Opportunity)]=buildObjectMappingSchema(P,$),new Promise((e,t)=>{let a=$?.[H.Ix.AccountId],n=P.fields?.find(e=>e.identifier===a),i=n?.relationships?.[0].related_schema_object_id;i?e(i):t(Error("No related account object ID"))}).then(e=>o((0,eg.g)({objectId:e,datasourceId:u,salesforceOrgId:p}))).then(e=>e?(a[(0,Z.A)(H.hd.Account)]=buildObjectMappingSchema(e,eO),o(ey({salesforceOrgId:p??"",objectMappings:a}))):Promise.reject(Error("No related account object"))).then(()=>{o((0,ex.M)({element:n.createElement(en.A,{svgIconProps:{name:"check-circle"}},eC.t("Mapping saved."))})),o((0,e_.S)({forceFetch:!0,reason:"map-fields-step"})),e({closeModal:!0})}).catch(()=>{t(f?c.B.UpdateFieldMappings:c.B.CreateFieldMappings),I(!1),N(!1)})},[P,$,j,t,ee,o,u,p,e,f]),es=(0,n.useCallback)(()=>{T(!1),G(null)},[]),ec=(0,n.useCallback)(()=>{T(!1),E(!0),Y(z),G(null),b(null),et(null)},[z]),ed=(0,n.useMemo)(()=>n.createElement(MapFieldsChangeOpportunitySpeedBump,{onCancel:es,onSubmit:ec}),[ec,es]),eu=(0,n.useCallback)(()=>{N(!1)},[]),em=(0,n.useCallback)(()=>{N(!0)},[]),eh=(0,n.useMemo)(()=>n.createElement(MapFieldsSubmitSpeedBump,{isSubmitting:k,onCancel:eu,onSubmit:el}),[eu,el,k]),eb=(0,n.useMemo)(()=>{let e=ee?.find(e=>"stage"===e.target)?.values.find(e=>"stage_closed"===e.key);return(!U&&!W||!!e&&0!==e.values.length)&&!!($&&eT.every(e=>$?.[e]))},[$,ee,U,W]),eS=j||x||A,ew=!eb||!w&&!!f,eN=(0,n.useMemo)(()=>[{selectId:"amount",type:H.gI.CurrencySchemaField,label:eC.t("Amount"),selectedField:$?.[H.Ix.Amount],onChange:ei(H.Ix.Amount)},{selectId:"close_date",type:H.gI.DateSchemaField,label:eC.t("Close date"),selectedField:$?.[H.Ix.CloseDate],onChange:ei(H.Ix.CloseDate)},{selectId:"next_steps",type:H.gI.StringSchemaField,label:eC.t("Next steps"),selectedField:$?.[H.Ix.NextSteps],onChange:ei(H.Ix.NextSteps)},{selectId:"account",type:H.gI.ReferenceSchemaField,label:eC.t("Account"),selectedField:$?.[H.Ix.AccountId],onChange:ei(H.Ix.AccountId)},{selectId:"stage",type:H.gI.SelectSchemaField,label:eC.t("Stage"),selectedField:$?.[H.Ix.Stage],onChange:ei(H.Ix.Stage)}],[ei,$]),ek=(0,n.useMemo)(()=>{let e=eN.find(e=>"stage"===e.selectId)?.selectedField;return P?.fields?.find(t=>t.identifier===e)},[eN,P]);return n.createElement(s.A,{...r,title:eC.t("Map opportunity fields"),contentLoading:x&&A,submitText:eC.t("Save"),submitIsDisabled:ew,submitIsLoading:k,speedBump:v?ed:eh,showSpeedBump:v||O,onSubmit:em},n.createElement("p",null,eC.t("Now that you have an integration, you can map your opportunity fields.")),n.createElement("p",null,eC.t("If your team uses a custom opportunity object or custom opportunity fields, you can select them here. This ensures notifications will send when you expect them to.")),n.createElement(n.Fragment,null,n.createElement(OpportunityObjectSelect,{salesforceObjects:F,selectedOppObjIdentifier:z??j,onChange:ea}),n.createElement("div",{className:"border_bottom margin_top_100 margin_bottom_100"})),eS?n.createElement(n.Fragment,null,n.createElement("table",{className:eA().opportunity_mapping_table},n.createElement("thead",null,n.createElement("tr",null,n.createElement("th",{className:Q()(eA().header,eA().field_label_header)},n.createElement("div",{className:"bold"},eC.t("Field"))),n.createElement("th",{className:Q()(eA().header,eA().field_input_header)},n.createElement("div",{className:"bold"},eC.t("Maps to\u2026"))))),n.createElement("tbody",null,eN.map(e=>n.createElement("tr",{key:e.selectId},n.createElement("td",{className:Q()(eA().cell,eA().field_label_cell)},n.createElement(R.A,{type:"inline",text:e.label,htmlFor:`${e.selectId}_button`})),n.createElement("td",{className:Q()(eA().cell,eA().field_input_cell)},n.createElement(FieldSelect,{selectId:e.selectId,schemaIdentifier:P?.identifier,type:e.type,label:e.label,allFields:P?.fields,selectedField:e.selectedField,onChange:e.onChange,isLoading:A,withoutLabel:!0})))),(U||W)&&n.createElement("tr",null,n.createElement("td",{colSpan:2},n.createElement("div",{className:eA().stage_multi_select_container},n.createElement(R.A,{className:eA().stage_multi_select_label,text:eC.t('Stage for "closed"'),htmlFor:"stage_for_closed_button"}),n.createElement("div",{className:eA().stage_multi_select},n.createElement(StageMultiSelect,{stagesForClosed:h,isLoading:A,onChange:eo,id:"stage_for_closed_button",stageField:ek}))))))),n.createElement("div",null,eC.t("For more fields, you\u2019ll be able to use them in advanced options or in Workflow Builder when configuring notifications."))):null,!eS&&n.createElement(M.Ay,null,eC.t("Select an opportunity object first to start mapping opportunity fields.")))};MapFieldsStep.displayName="MapFieldsStep";let eN=(0,w.A)("salesHome.admin.addOrg generated fetcher",(e,t,a)=>new A.S((n,i)=>{let{abortSignal:r,reason:o,...l}=a,s=(0,v.VA)(l);e((0,C.apiCall)({method:"salesHome.admin.addOrg",args:s,abortSignal:r,reason:o})).then(e=>{n(e)}).catch(e=>{(0,E.default)({getState:t}).error(`API call to salesHome.admin.addOrg with reason ${o} failed, initiated by generated fetcher`),i(e)})}));eN.meta={name:"salesHomeAdminAddOrgFetcher",key:"createFetcherSalesHomeAdminAddOrgFetcher",description:"salesHome.admin.addOrg generated fetcher"};let ek=(0,b.Ay)("Sales admin action to add an org to the list of user orgs available to connect",async(e,t,{selectedSalesforceOrg:a})=>{await e(eN({reason:"sales-elevate",salesforceOrgId:a.salesforce_org_id})),e((0,p.Ox)(a)),e((0,p.Zz)({})),e((0,S._)())});ek.meta={name:"addAdminOrg",key:"createThunkAddAdminOrg",description:"Sales admin action to add an org to the list of user orgs available to connect"};var eI=a(0x1e217163d),eF=a(0x20158cb6);let eD=(0,b.Ay)("Prepares data for Select Source step",async(e,t,{selectedOrg:a,onSuccess:n,onError:i})=>{try{let t=a.salesforce_org_id;e((0,p.wO)());let{datasources:i}=await e((0,W.z)({creationSource:h.N$.SalesElevate,reason:"modern-selling"})),r=i.filter(({salesforce_org_id:e})=>e===t);e((0,p.Xb)(r)),n()}catch{e((0,p.iA)(c.B.FetchDatasourceInfo)),i(c.B.FetchDatasourceInfo)}});eD.meta={name:"getSelectSourceStep",key:"createThunkGetSelectSourceStep",description:"Prepares data for Select Source step"};var eM=a(0x24304a692),eR=a.n(eM);let eL=new l.Ay("modernselling"),eP="select-salesforce-org-radiogroup-label",eB="select-salesforce-org-radiogroup-label",SelectSalesforceOrgStep=({onDone:e,setError:t})=>{let a=(0,i.wA)(),[o,l]=(0,n.useState)(""),d=(0,m.d4)(g.Gq),u=(0,m.d4)(g.Ss),f=(0,m.d4)(g.Om),_=f.length,[h,b,y]=(()=>{let e=(0,i.wA)(),[t,a]=(0,n.useState)("initial");return["updating"===t,"error"===t,async(t,n)=>{try{a("updating"),await e(ek({selectedSalesforceOrg:t}));let i=await e((0,O.E)({datasourceId:t.datasource_id}));a("success"),n(i?.isConnected?{goToStep:c.b.Syncing}:i?.isSynced?{goToStep:c.b.MapFields}:{closeModal:!0})}catch{a("error")}}]})();return((0,n.useEffect)(()=>(a((0,S._)()),()=>{a((0,p.Un)())}),[a]),"initial"===d)?null:n.createElement(s.A,{showCancel:!0,contentLoading:"fetching"===d,title:eL.t("Add a Salesforce org"),onSubmit:()=>{let n=f.find(({salesforce_org_id:e})=>e===o);if(n){if(n.is_legacy_elevate_org)return void a(eD({selectedOrg:n,onSuccess:()=>{e({goToStep:c.b.ChooseSource})},onError:t}));y(n,e)}},submitText:eL.t("Connect"),submitIsDisabled:0===_,submitIsLoading:h},0===_&&n.createElement(n.Fragment,null,n.createElement("h2",{className:eR().header},eL.t("No available salesforce orgs.")),n.createElement("p",{className:eR().text},eL.t("To add more orgs, please contact your admin."))),_>0&&n.createElement(eI.B,{space:"125",as:"section"},u&&n.createElement(r.F,{errorType:c.B.FetchAdminOrgList}),b&&n.createElement(r.F,{errorType:c.B.AddAdminOrg}),n.createElement(eI.B,{space:"50"},n.createElement("h2",{id:eP,className:eR().header},eL.t("Choose an org that\u2019s already connected with Slack")),n.createElement("p",{id:eB,className:eR().text},eL.rt("Based on existing orgs from admin org dashboard."))),n.createElement(eF.v,{orgs:f,onOrgSelect:l,"aria-labelledby":eP,"aria-describedby":eB}),n.createElement("p",{className:eR().text},eL.rt("To add more orgs, please contact your admin."))))};function filterConnectedDatasources(e,t){return e?.filter(e=>e.status===h.VW.Connected||e.status===h.VW.Synced||t===e.id)}SelectSalesforceOrgStep.displayName="SelectSalesforceOrgStep";var eH=a(0xa1832ae4),eU=a(0x1ee439e69);let eV=new l.Ay("modernselling"),SelectSourceSpeedBump=({isSubmitting:e,onCancel:t,onSubmit:a})=>{let i=(0,m.d4)(eU.H7),r=(0,n.useCallback)(()=>{(0,eH.gC)(i,"/help/requests/new")},[i]),o=eV.rt("Make sure switching to a new integration is necessary before continuing, or {contactUs} if you have any concerns.",{contactUs:n.createElement(B.A,{onClick:r},eV.t("contact us"))});return n.createElement(ei.ty,{heading:eV.t("Confirm integration switch"),description:o,onCancel:t,onContinue:a,continueButtonType:"danger",continueButtonLabel:eV.t("Switch Now"),cancelButtonLabel:eV.t("Cancel"),continueButtonIsLoading:e})};SelectSourceSpeedBump.displayName="SelectSourceSpeedBump";var eW=a(0x24169e055);let eq=(0,b.Ay)("Sets selected datasource to an org",async(e,t,{datasourceId:a,selectedSalesforceOrg:n,onSuccess:i,onError:r})=>{try{e((0,p.fL)("updating"));let t=n.salesforce_org_id;if(!(await e((0,eW.O)({salesforceOrgId:t,reason:"modern-selling"}))).ok||!(await e(T({datasourceId:a,salesforceOrgId:t,reason:"modern-selling"}))).ok)throw Error(c.B.SwitchDatasource);e((0,p.Ox)({...n,datasource_id:a})),e((0,p.m4)({salesforceOrgId:t,datasourceId:a}));let r=await e((0,O.E)({datasourceId:a}));i(r),e((0,p.Zz)({})),e((0,p.fL)("success"))}catch{e((0,p.iA)(c.B.SwitchDatasource)),r()}});eq.meta={name:"switchDatasource",key:"createThunkSwitchDatasource",description:"Sets selected datasource to an org"};let ej=new l.Ay("modernselling"),SelectSourceStep=({onDone:e,setError:t,...a})=>{let r=(0,i.wA)(),o=(0,m.d4)(g.Ey),l=(0,m.d4)(g.C_),d=(0,m.d4)(g.fY),u=(0,m.d4)(g.aV),p=u?.name||"",f=(0,m.d4)(g.e$),_=(0,n.useMemo)(()=>filterConnectedDatasources(l,f),[l,f]),[h,b]=(0,n.useState)(f),[y,x]=(0,n.useState)(!1),S=o?.salesforce_org_id===u?.salesforce_org_id,A=!!o?.datasource_id,C=o?.datasource_id!==h,w=S&&!!h&&A&&C,E="updating"===d,v=(0,n.useCallback)(t=>{e(t?.isConnected?{goToStep:c.b.Syncing}:t?.isSynced?{goToStep:c.b.MapFields}:{closeModal:!0})},[e]),T=(0,n.useCallback)(e=>{x(!1),t(e?c.B.SwitchDatasource:c.B.SelectDatasource)},[t]),O=(0,n.useCallback)(()=>{h&&u&&r((w?eq:N)({datasourceId:h,selectedSalesforceOrg:u,onSuccess:v,onError:()=>T(w)}))},[r,w,h,u,v,T]),k=(0,n.useCallback)(e=>{let{value:t}=e.target;t!==f&&b(t)},[f]),I=(0,n.useCallback)(()=>{w?x(!0):O()},[w,O]),F=(0,n.useCallback)(()=>{x(!1)},[]),D=(0,n.useMemo)(()=>n.createElement(SelectSourceSpeedBump,{isSubmitting:E,onCancel:F,onSubmit:O}),[E,F,O]),M=w?ej.t("Switch"):ej.t("Connect");return n.createElement(s.A,{...a,title:ej.t("Salesforce org"),onSubmit:I,submitType:w?"danger":"primary",submitText:M,submitIsDisabled:!C,submitIsLoading:E,speedBump:D,showSpeedBump:y,showBack:!0},n.createElement(P.A,{legendText:ej.rt("Select an integration for {orgName}",{orgName:p})},_?.map(e=>{let t=f===e.id,a=t?ej.rt("{name} (Current)",{name:e.name}):e.name;return n.createElement(R.A,{key:e.id,htmlFor:e.id,type:"inline",text:a,subtext:e.third_party_oauth2_instance_url,isDisabled:t},n.createElement(L.A,{name:"selectDatasource",id:e.id,value:e.id,disabled:t,checked:h===e.id,onChange:k}))})))};SelectSourceStep.displayName="SelectSourceStep";let eY=new l.Ay("modernselling"),SyncingStep=({onDone:e,...t})=>{let a=(0,m.wz)(g.Lm),i=(0,n.useCallback)(()=>{e({closeModal:!0})},[e]);return(0,n.useEffect)(()=>{a?.isConnected||e({closeModal:!0})},[a,e]),n.createElement(s.A,{...t,title:eY.t("Sync in progress"),showBack:!1,backText:void 0,submitText:eY.t("Ok"),onSubmit:i},n.createElement("p",null,eY.t("You\u2019re on your way! You can continue setup as soon as the connection sync completes. This typically only takes a few minutes, but could take up to 30.")),n.createElement("p",null,eY.t("You\u2019ll receive a message when it\u2019s time to come back and finish setup.")))};SyncingStep.displayName="SyncingStep";let ez=new l.Ay("modernselling"),WarnRemapFieldsStep=({data:e,onDone:t,...a})=>{let i=(0,n.useCallback)(async()=>{t({goToStep:c.b.MapFields})},[t]);return n.createElement(s.A,{...a,title:ez.t("Update opportunity field map?"),onSubmit:i,submitText:ez.t("Next")},n.createElement(M.Ay,{className:"margin_bottom_100",level:"warning"},ez.t("{numWorkflows, plural, =1 {# existing notification uses} >999 {1K or more existing notifications use} other {# existing notifications use}} the existing mapping.",{numWorkflows:e.numWorkflows})),n.createElement("p",null,ez.t("Here\u2019s what will happen when you update the mapping:")),n.createElement("ul",null,n.createElement("li",null,ez.t("All new sales notifications created will use the updated mapping to determine when they should send.")),n.createElement("li",null,ez.t("Everyone who has notifications that reference a re-mapped field will need to delete and recreate those notifications.")),n.createElement("li",null,ez.t("People with affected notifications won\u2019t be notified \u2014 please reach out to your team about these changes.")),n.createElement("li",null,ez.t("If you update the opportunity object, existing admin-suggested opportunity lists will be cleared and you\u2019ll need to set up new ones.")),n.createElement("li",null,ez.t("Celebrations will stop showing on user profiles and need to be reconfigured."))))};WarnRemapFieldsStep.displayName="WarnRemapFieldsStep";let eG=new l.Ay("modernselling"),WarnSwitchSourceStep=({onDone:e,...t})=>{let a=(0,i.wA)(),r=(0,m.d4)(g.Ey),o=(0,m.d4)(g.fY),l=(0,n.useCallback)(()=>{e({goToStep:c.b.ChooseSource})},[e]),d=(0,n.useCallback)(()=>{r&&a(eD({selectedOrg:r,onSuccess:l,onError:t.setError}))},[t.setError,r,a,l]);return n.createElement(s.A,{...t,title:eG.t("Switch integration?"),onSubmit:d,submitType:"danger",submitText:eG.t("Next"),submitIsLoading:"fetching"===o},n.createElement(M.Ay,{className:"margin_bottom_100",level:"warning"},eG.t("Switching integrations could be disruptive for your team.")),n.createElement("p",null,eG.t("Here\u2019s what will happen when you switch integrations:")),n.createElement("ul",null,n.createElement("li",null,eG.t("All notifications created by anyone will be deleted immediately.")),n.createElement("li",null,eG.t("You\u2019ll need to re-map opportunity object fields for the new integration.")),n.createElement("li",null,eG.t("Everyone will need to recreate their custom notifications from scratch.")),n.createElement("li",null,eG.t("Everyone will need to re-authenticate."))))};WarnSwitchSourceStep.displayName="WarnSwitchSourceStep";var e$=a(0x1fcbb004d);let eQ={[c.b.SelectSalesforceOrg]:SelectSalesforceOrgStep,[c.b.ChooseSource]:SelectSourceStep,[c.b.ChooseEnvironment]:V,[c.b.AddSource]:F,[c.b.CreateSource]:G,[c.b.MapFields]:MapFieldsStep,[c.b.Syncing]:SyncingStep,[c.b.WarnRemapFields]:WarnRemapFieldsStep,[c.b.WarnSwitchSource]:WarnSwitchSourceStep},ConnectionModal=({startStep:e=c.b.ChooseSource,data:t})=>{let a=(0,i.wA)(),[o,l]=(0,n.useState)(null),[s,d]=(0,n.useState)([e]),u=s[s.length-1];(0,n.useEffect)(()=>{l(null)},[u]);let m=(0,n.useCallback)(()=>{a((0,e$.O)())},[a]),p=(0,n.useCallback)(()=>{d(e=>e.slice(0,e.length-1))},[]),g=(0,n.useCallback)(({closeModal:e,goToStep:t})=>{e?m():t&&d([...s,t])},[m,s]),f=(0,n.useMemo)(()=>o?n.createElement(r.F,{className:"margin_bottom_100",errorType:o}):null,[o]),_=eQ[u];return n.createElement(ei.dW,{closeModal:m},n.createElement(_,{onBack:p,onCancel:m,onDone:g,preContent:f,setError:l,showBack:s.length>1,showCancel:1===s.length,data:t}))};ConnectionModal.displayName="ConnectionModal";var eK=a(0x46dbff89);function useOpenConnectModal(){let e=(0,i.wA)();return(t,a)=>{e((0,eK.q)({element:n.createElement(ConnectionModal,{startStep:t,data:a})}))}}useOpenConnectModal.displayName="useOpenConnectModal"},0x30e98603:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>__WEBPACK_DEFAULT_EXPORT__,n9:()=>s,or:()=>c});var n,i,r=a(0xbad225b5),o=a(0x120c268ad),l=a.n(o),s=((n={}).ORANGE="orange",n.BLUE="blue",n.WHITE="white",n),c=((i={})[i.SMALL=12]="SMALL",i[i.MEDIUM=16]="MEDIUM",i[i.LARGE=20]="LARGE",i);let __WEBPACK_DEFAULT_EXPORT__=({className:e,fillColor:t,size:a=16})=>r.createElement("svg",{width:a,height:a,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:l()(e,`p-crown_icon--${t}`)},r.createElement("path",{d:"M14.1047 13.7426H2.89531C2.62969 13.7426 2.39062 13.9931 2.39062 14.2713V14.2992C2.39062 15.2175 3.10781 15.9688 3.98438 15.9688H13.0156C13.8922 15.9688 14.6094 15.2175 14.6094 14.2992V14.2713C14.6094 13.9931 14.3703 13.7426 14.1047 13.7426Z"}),r.createElement("path",{d:"M15.4063 2.3334C14.5297 2.3334 13.8125 3.08474 13.8125 4.00304C13.8125 4.50394 14.025 4.977 14.3703 5.2831C13.9187 6.36837 12.8828 7.11971 11.6609 7.06405C10.2531 6.98057 9.11094 5.78399 9.03125 4.30914C9.03125 4.0587 9.03125 3.83608 9.08438 3.61346C9.66875 3.36301 10.0938 2.77864 10.0938 2.05513C10.0938 1.13682 9.37656 0.385483 8.5 0.385483C7.62344 0.385483 6.90625 1.13682 6.90625 2.05513C6.90625 2.75081 7.33125 3.36301 7.91562 3.61346C7.96875 3.83608 7.96875 4.0587 7.96875 4.30914C7.88906 5.78399 6.74687 6.98057 5.33906 7.06405C4.11719 7.14754 3.05469 6.36837 2.62969 5.2831C2.975 4.977 3.1875 4.50394 3.1875 4.00304C3.1875 3.08474 2.47031 2.3334 1.59375 2.3334C0.717187 2.3334 0 3.08474 0 4.00304C0 4.92135 0.717187 5.67269 1.59375 5.67269L2.3375 11.6277C2.36406 11.8782 2.57656 12.073 2.84219 12.073H14.1578C14.3969 12.073 14.6094 11.8782 14.6625 11.6277L15.4063 5.67269C16.2828 5.67269 17 4.92135 17 4.00304C17 3.08474 16.2828 2.3334 15.4063 2.3334Z"}))},0x4c8d8a39:(e,t,a)=>{"use strict";a.d(t,{j:()=>SalesHomeHeader});var n=a(0xbad225b5),i=a(0x120c268ad),r=a.n(i),o=a(0x20482ad21),l=a(0x1feb18f19),s=a(0x344bb842),c=a(0x156eec78a),d=a(0x139aa1a7),u=a(0x1fe613d6e),m=a(0x226892387);let p=new o.Ay("modernselling"),OpenAdminPageButton=({iconClassName:e})=>{let t=(0,c.Q)(),a=(0,m.d4)(u.K),i=(0,n.useMemo)(()=>({name:"settings"}),[]),r=(0,n.useCallback)(()=>{t({viewType:d.D.SalesAdministration})},[t]);return a?n.createElement(s.A,{className:e,"aria-label":p.t("Open admin page",{fallbackHash:"15ae7c51e4b1c1ccd27edcee37a115fb6f35b3b8"}),svgIconProps:i,onClick:r}):null};OpenAdminPageButton.displayName="OpenAdminPageButton";var g=a(0x16cf1da63),f=a(0xb90de824),_=a(0x13953efe6),h=a(0x23c27866b),b=a(0x1472af90a),y=a(0xf052d367),x=a(0x18632f75a);let S=new o.Ay("modernselling"),OnboardingMultiOrgNewOrgAvailableCoachmark=()=>{let e=(0,g.wA)(),t=b.G7.SalesHomeMultiOrgNewOrgAvailableCoachmark,a="sales-home-multi-org-new-org-available-seen",i=(0,h.A)(t,a),r=(0,m.d4)(e=>(0,y.kI)(e,t,b.X8.Click)),o=(0,m.d4)(e=>(0,y.h$)(e,t));(0,n.useEffect)(()=>{(async()=>{await i()})()},[i]);let l=(0,n.useCallback)(()=>{e((0,x.z)({component:t,type:b.X8.Click,reason:a}))},[e,a,t]),s=(0,n.useMemo)(()=>n.createElement(f.Ay,{title:S.t("New org available"),bodyText:S.t("Easily add multiple Salesforce orgs to keep track of your deals in one place."),closeCoachmark:l,isOpen:!o,offsetY:5,offsetX:-62,width:420,arrowPosition:10}),[l,o]);return!r||o?null:n.createElement(_.Ay,{coachmarkElement:s,orientation:"bottom-right"})};OnboardingMultiOrgNewOrgAvailableCoachmark.displayName="OnboardingMultiOrgNewOrgAvailableCoachmark";var A=a(0x99233ecb),C=a(0xb90d5858),w=a(0x1a3c2e1af),E=a(0x94b8b4bd),v=a(0x2501a2cee),T=a(0x4c96e5d9),O=a(0x1fdec3e16),N=a(0xab4abe34),k=a.n(N);let I=new o.Ay("modernselling"),ConnectionStatus=({status:e,errors:t,total:a})=>{let i=(({errors:e,total:t})=>({connected:I.t("Connected \u{1F44D}"),"all-errors":I.t("Connection error"),"some-errors":I.t("{errors} out of {total} connection errors",{errors:e,total:t})}))({errors:t,total:a}),r=(0,n.useRef)(a),o=(0,n.useRef)(t),[l,s]=(0,n.useState)(r.current<=a&&"connected"===e?"":i[e]);return(0,n.useEffect)(()=>{o.current>t&&"connected"===e&&s(i[e]),o.current>t&&"some-errors"===e&&s(i[e]),o.current!==t&&(o.current=t)},[i,e,t]),(0,n.useEffect)(()=>{r.current{if(l!==i.connected)return;let e=setTimeout(()=>s(""),5e3);return()=>{clearTimeout(e)}},[l,i.connected]),n.createElement(O.A,{lines:1,withTooltip:!0},n.createElement("span",{className:k().status},l))};ConnectionStatus.displayName="ConnectionStatus";let F=new o.Ay("modernselling"),getTooltipText=(e,t,a)=>({connected:F.t("Connected to {total, select, 1 {{firstOrgName}} other {{firstOrgName} and {remained} other {remained, plural, one {org} other {orgs} }}}",{firstOrgName:t,total:a,remained:a-1}),error:F.t("Could not connect to {total, select, 1 {{firstOrgName}} other {{firstOrgName} and {remained} other {remained, plural, one {org} other {orgs} }}}",{firstOrgName:t,total:a,remained:a-1})})[e];var D=a(0x1be37a18e),M=a(0x95c69c7),R=a(0xa462266f),L=a(0x1c8beab7f),P=a(0x77e385ed),B=a(0x192df3d34),H=a(0x1ec19bc0c),U=a(0x16b708a7f);let V=new o.Ay("modernselling"),RefreshConnectionModal=({refreshConnectionOrgId:e})=>{let t=(0,g.wA)(),a=(0,m.d4)(t=>(0,L.iy)(t,e)),i=(0,n.useCallback)(()=>{t((0,U.Ko)())},[t]);return n.createElement(H.y,{title:V.t("Log in to refresh connection"),mainText:V.t("Refresh the connection with this Salesforce org by logging in with your account."),defaultSelectedOrgId:e,userOrgsToConnect:a,handleClose:i})};RefreshConnectionModal.displayName="RefreshConnectionModal";var W=a(0x11c82607b),q=a(0x46dbff89);let j=(0,W.Ay)("Opens Refresh Connection Modal",(e,t,a)=>{e((0,q.q)({element:n.createElement(RefreshConnectionModal,a)}))});j.meta={name:"openRefreshConnectionModal",key:"createThunkOpenRefreshConnectionModal",description:"Opens Refresh Connection Modal"};var Y=a(0x8ed8ca46),z=a(0x3aa3d802),G=a(0x15b7e3c51),$=a.n(G);let Q=new o.Ay("modernselling"),K={maskImage:"radial-gradient(circle 16px at 80% 80%, transparent 50%, black 51%)"},UserOrgMenu=({iconClassName:e})=>{let t,a,i=(0,g.wA)(),o=(0,m.d4)(Y.mO),c=(0,m.d4)(L.lC).length,d=(0,m.d4)(L.Lz),u=!!(0,M._)({view:"sidebar"}),{status:p,errors:f,total:_}=(t=o.length,0===(a=o.reduce((e,{auth:t})=>("error"===t&&(e+=1),e),0))?{status:"connected",errors:0,total:t}:a===o.length?{status:"all-errors",errors:t,total:t}:{status:"some-errors",errors:a,total:o.length}),h="connected"===p,b="all-errors"===p||"some-errors"===p,y=((e,t)=>{if("connected"===e)return getTooltipText("connected",t[0]?.name,t.length);if("all-errors"===e)return getTooltipText("error",t[0]?.name,t.length);if("some-errors"===e){let e=t.filter(({auth:e})=>"error"===e);return getTooltipText("error",e[0]?.name,e.length)}return""})(p,o),x=Q.t("Manage all Salesforce orgs"),S=(0,n.useCallback)(()=>{i((0,P.N)())},[i]),O=(0,n.useCallback)(()=>{i((0,R.A)({activeSection:D._.salesforce}))},[i]),N=(0,n.useCallback)(e=>{i(j({refreshConnectionOrgId:e}))},[i]),k=(0,n.useCallback)(async e=>{e&&await i((0,z.h)({reason:"modern-selling-disconnect-user-org",salesforceOrgId:e}))},[i]),I=(0,n.useCallback)(e=>{let t=o.find(({salesforce_org_id:t})=>e===t)?.name||"",a=n.createElement("p",null,Q.t("You won\u2019t be able to view or update {orgName} opportunities and any notifications based on information from {orgName} will stop.",{orgName:t}));i((0,B.A)({disconnectOrgId:e,isDisconnecting:"fetching"===d,handleDisconnect:k,children:a}))},[o,d,i,k]),F=(0,n.useCallback)(({orgName:e,orgUrl:t,orgId:a})=>i=>n.createElement(A.Ay,i,b&&n.createElement(C.A,{label:Q.t("Refresh connection"),onSelected:()=>N(a)}),n.createElement(C.A,{danger:!0,onSelected:()=>I(a)},Q.t("Disconnect {orgName}",{orgName:e})),n.createElement(A.bX,null),n.createElement("div",{className:$().url},t.split("https://")[1])),[I,b,N]),H=(0,n.useCallback)((e,t)=>n.createElement(n.Fragment,null,"ok"===e&&n.createElement("div",{className:r()($().connected,{[$().highlighted]:t})},n.createElement(v.Ah,{size:"20",name:"check-circle-filled"})),"error"===e&&n.createElement("div",{className:r()($().error,{[$().highlighted]:t})},n.createElement(v.Ah,{size:"20",name:"warning-filled"}))),[]),U=(0,n.useCallback)(({userOrgs:e,isDisplayingConnectAnotherOrg:t,showManageOrgs:a})=>i=>n.createElement(A.Ay,i,e.map(({name:e,salesforce_org_id:t,auth:a,instance_url:i,is_legacy:r})=>{if(!r)return n.createElement("div",{className:"c-menu_item__li",key:t},n.createElement("div",{className:$().orgListItem},n.createElement("div",{className:"c-menu_item__icon"},H(a,!1)),n.createElement("div",{className:"c-menu_item__label c-menu_item__label--with_description"},e,n.createElement("div",{className:"c-menu_item__description"},"error"===a?Q.t("Connection error"):Q.t("Connected")))));let o=(0,E.A)(r=>n.createElement(w.A,{...r,renderSubmenu:F({orgName:e,orgUrl:i,orgId:t,isError:"error"===a}),label:e,description:"error"===a?Q.t("Connection error"):Q.t("Connected"),icon:H(a,r.highlighted)}));return n.createElement(o,{key:t})}),a&&n.createElement(n.Fragment,null,n.createElement(A.bX,null),n.createElement(C.A,{onSelected:O},x)),t&&n.createElement(n.Fragment,null,n.createElement(A.bX,null),n.createElement(C.A,{onSelected:S},n.createElement(l.c,{space:"75"},n.createElement(v.Ah,{size:"20",name:"plus"}),Q.t("Connect another org"))))),[x,O,S,H,F]);return n.createElement(l.c,{space:"25"},n.createElement(A.cQ,{renderMenu:U({userOrgs:o,isDisplayingConnectAnotherOrg:c>0,showManageOrgs:void 0!==o.find(e=>!e.is_legacy)}),position:"left-bottom"},n.createElement(T.Ay,{position:"bottom",tip:y},n.createElement(s.A,{className:e,"aria-label":Q.t("Open Salesforce organizations menu")},h&&n.createElement(n.Fragment,null,n.createElement(v.Ah,{size:"20",name:"sf-cloud",style:K}),n.createElement(v.Ah,{size:"16",name:"check-circle-filled",style:{color:u?"var(--dt_color-content-inv-hgl-2)":"var(--dt_color-content-hgl-2)",position:"absolute",left:"16px",top:"16px"}})),b&&n.createElement(n.Fragment,null,n.createElement(v.Ah,{size:"20",name:"sf-cloud",style:K}),n.createElement(v.Ah,{size:"16",name:"warning-filled",style:{color:u?"var(--dt_color-content-inv-imp)":"var(--dt_color-content-imp)",position:"absolute",left:"16px",top:"16px"}}))))),n.createElement(ConnectionStatus,{status:p,errors:f,total:_}))};UserOrgMenu.displayName="UserOrgMenu";var J=a(0x1e84d332f);let Z=new o.Ay("modernselling"),SalesHomeHeader=({actions:e,className:t,title:a,showDropdownMenu:i=!0,showConnectedToSalesforce:o=!1,showHeaderTitle:s=!0,largeTitle:c=!1})=>{let d=(0,m.d4)(Y.mO),u=(0,m.d4)(L.lC),p=(0,J.K)(d),g=`${t}_icon`;return n.createElement("div",{className:r()(t,"p-sales_home_header")},s&&n.createElement("div",{className:r()("p-sales_home_header__title",{"p-sales_home_header__title--large":c})},a||Z.t("Sales")),o&&d.length>0&&p&&n.createElement(n.Fragment,null,n.createElement(UserOrgMenu,{iconClassName:g}),u.length>0&&n.createElement(OnboardingMultiOrgNewOrgAvailableCoachmark,null)),n.createElement(l.c,{space:"75"},e,i&&n.createElement(OpenAdminPageButton,{iconClassName:g})))};SalesHomeHeader.displayName="SalesHomeHeader"},0x16caa8075:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x1ea519746),o=a(0x23cb9e36f),l=a(0x348940af),s=a(0x1d104c491);let c=new i.Ay("modernselling"),AmountChangedFlowHeader=({isAdmin:e=!1})=>{let t=e?s.Lb.adminAmountChanged:s.Lb.userAmountChanged,a=(0,o.A)(t,e?"ADMIN_SALES_HOME_OPPORTUNITY_AMOUNT_CHANGED":"SALES_HOME_OPPORTUNITY_AMOUNT_CHANGED"),i=(0,r.Y)(t),d=(0,n.useCallback)(async()=>a({reason:"amount-changed"}),[a]);return n.createElement(l.A,{isAdmin:e,title:c.t("Amount changed"),imageUrl:i,onSave:d,description:c.t("Sent when opportunity amounts change")})};AmountChangedFlowHeader.displayName="AmountChangedFlowHeader";let d=AmountChangedFlowHeader},0xb9dbe72d:(e,t,a)=>{"use strict";a.d(t,{A:()=>x});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0xe976659c),o=a(0x13fb6986a),l=a(0xfca33088),s=a(0x1d104c491);let c=new i.Ay("modernselling"),d=[r.f.opportunity(),r.f.amountChange("desc"),r.f.amount()];function getAmountAnyChangeProps(){return{body:c.rt("Here are your biggest movers from last week."),columns:d,displayType:"standard",records:(0,r.E)({amountDirection:s.Us.Any}),title:c.t("Biggest movers")}}function getAmountIncreaseProps(){return{body:c.rt("Here are your increased top deals from last week."),columns:d,displayType:"trend_positive",records:(0,r.E)({amountDirection:s.Us.Increase}),title:c.t("Top increased opportunities")}}function getAmountDecreaseProps(){return{body:c.rt("Here are your decreased top deals from last week."),columns:d,displayType:"trend_negative",records:(0,r.E)({amountDirection:s.Us.Decrease}),title:c.t("Top decreased opportunities")}}let ScheduledNotificationPreview=({imageUrl:e,title:t,values:a})=>{let i=a.amountDirection,{body:r,columns:c,displayType:d,records:u,title:m}=(0,n.useMemo)(()=>{switch(i){case s.Us.Increase:return getAmountIncreaseProps();case s.Us.Decrease:return getAmountDecreaseProps();default:return getAmountAnyChangeProps()}},[i]);return n.createElement(o.A,{title:t,body:r,imageUrl:e},n.createElement(l.N,{displayType:d,columns:c,records:u,title:m,isExpandedByDefault:!0,isPreview:!0}))};ScheduledNotificationPreview.displayName="ScheduledNotificationPreview";var u=a(0x1ea519746),m=a(0x21ff11be5),p=a(0x1235cf4a4),g=a(0x62accd6b),f=a(0xf33ac3d1),_=a(0x2253dfab8),h=a(0xd2e7c536),b=a(0x107cfc47d);let y=new i.Ay("modernselling"),AmountChangedFlowPage=({isAdmin:e=!1})=>{let t=e?s.Lb.adminAmountChanged:s.Lb.userAmountChanged,a=(0,p.A)(t,!0,e),i=(0,g.Ht)(t),r=i?.isRecurring,l=(0,u.Y)(t);return n.createElement(b.IS,null,n.createElement(b.cp,{isAdmin:e},n.createElement(f.A,{workflowView:e?s.Lb.adminAmountChanged:s.Lb.userAmountChanged,defaultListTitle:y.t("Amount changed")})),n.createElement(b.OC,null,n.createElement(_.A,{title:a?.description}),r?n.createElement(ScheduledNotificationPreview,{values:i,title:y.t("Amount changed"),imageUrl:l}):n.createElement(o.A,{title:y.t("Amount changed"),body:y.rt('{person} changed an amount: 1,225,000 \u2192 1,350,000',{person:"@geeta"}),imageUrl:l,showNotificationButton:(0,m.r)(i),buttonLabel:i?.buttonText??void 0}),n.createElement(h.A,{title:a?.destination})))};AmountChangedFlowPage.displayName="AmountChangedFlowPage";let x=AmountChangedFlowPage},0xcf06bcff:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x1ea519746),o=a(0x23cb9e36f),l=a(0x348940af),s=a(0x1d104c491);let c=new i.Ay("modernselling"),CloseDateChangedFlowHeader=({isAdmin:e=!1})=>{let t=e?s.Lb.adminCloseDateChanged:s.Lb.userCloseDateChanged,a=(0,o.A)(t,e?"ADMIN_SALES_HOME_OPPORTUNITY_CLOSE_DATE_CHANGED":"SALES_HOME_OPPORTUNITY_CLOSE_DATE_CHANGED"),i=(0,r.Y)(t),d=(0,n.useCallback)(async()=>a({reason:"date-changed"}),[a]);return n.createElement(l.A,{isAdmin:e,title:c.t("Close date changed"),imageUrl:i,onSave:d,description:c.t("Sent when opportunity closed dates change")})};CloseDateChangedFlowHeader.displayName="CloseDateChangedFlowHeader";let d=CloseDateChangedFlowHeader},0x16f1d7d2b:(e,t,a)=>{"use strict";a.d(t,{A:()=>y});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0xe976659c),o=a(0x13fb6986a),l=a(0xfca33088),s=a(0x1d104c491);let c=new i.Ay("modernselling"),ScheduledNotificationPreview=({title:e,imageUrl:t})=>{let a=(0,n.useMemo)(()=>(0,r.E)({amountDirection:s.Us.Increase}),[]),i=(0,n.useMemo)(()=>[r.f.opportunity(),r.f.amount("desc")],[]);return n.createElement(o.A,{body:c.rt("These opportunities\u2019 close dates have been updated."),title:e,imageUrl:t},n.createElement(l.N,{displayType:"standard",columns:i,records:a,title:c.t("Top updated opportunities"),isExpandedByDefault:!0,isPreview:!0}))};ScheduledNotificationPreview.displayName="ScheduledNotificationPreview";var d=a(0x1ea519746),u=a(0x21ff11be5),m=a(0x1235cf4a4),p=a(0x62accd6b),g=a(0xf33ac3d1),f=a(0x2253dfab8),_=a(0xd2e7c536),h=a(0x107cfc47d);let b=new i.Ay("modernselling"),CloseDateChangedFlowPage=({isAdmin:e=!1})=>{let t=e?s.Lb.adminCloseDateChanged:s.Lb.userCloseDateChanged,a=(0,m.A)(t,!0,e),i=(0,d.Y)(t),r=(0,p.Ht)(t),l=r?.isRecurring,c=b.t("Close date changed");return n.createElement(h.IS,null,n.createElement(h.cp,{isAdmin:e},n.createElement(g.A,{workflowView:t,defaultListTitle:c})),n.createElement(h.OC,null,n.createElement(f.A,{title:a?.description}),l?n.createElement(ScheduledNotificationPreview,{title:c,imageUrl:i}):n.createElement(o.A,{body:b.rt('{person} changed the close date: 2023-12-31 \u2192 2024-01-15',{person:"@geeta"}),title:c,imageUrl:i,showNotificationButton:(0,u.r)(r),buttonLabel:r?.buttonText??void 0}),n.createElement(_.A,{title:a?.destination})))};CloseDateChangedFlowPage.displayName="CloseDateChangedFlowPage";let y=CloseDateChangedFlowPage},0x66c4c9f7:(e,t,a)=>{"use strict";a.d(t,{T:()=>getClosingSoonConditionFromFormValue,Z:()=>getClosingSoonFormValueFromCondition});let getClosingSoonConditionFromFormValue=e=>({period_type:"DaysTimePeriod",period_value:Number(e)}),getClosingSoonFormValueFromCondition=e=>e?.period_value.toString()||""},0x1853b39ce:(e,t,a)=>{"use strict";a.d(t,{a:()=>getClosingSoonConditionsString});var n=a(0x20482ad21),i=a(0x1e864b930),r=a(0x1bc8d2ce4);let o=new n.Ay("modernselling"),getClosingSoonConditionsString=e=>{let t,a=[(t=e.closingIn,o.t("the opportunities are closing in {closingInValue, plural, one {# day} other {# days}}",{closingInValue:Number(t)})),...(0,r.zV)({scope:e.scope,criteria:e.criteria,accountName:e.account?.label,opportunityName:""})||[],...e.advancedFilterOptions&&(0,r.SH)(e.advancedFilterOptions)||[]].filter(Boolean);return(0,i.A)(a,{noEscape:!0}).join("")}},0x404d43c5:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x1ea519746),o=a(0x23cb9e36f),l=a(0x348940af),s=a(0x1d104c491);let c=new i.Ay("modernselling"),DealWonFlowHeader=({isAdmin:e=!1})=>{let t=e?s.Lb.adminDealWon:s.Lb.userDealWon,a=(0,o.A)(t,e?"ADMIN_SALES_HOME_DEAL_WON":"SALES_HOME_DEAL_WON"),i=(0,r.Y)(t),d=(0,n.useCallback)(async()=>a({reason:"deal-won"}),[a]);return n.createElement(l.A,{isAdmin:e,title:c.t("Deal won"),imageUrl:i,onSave:d,description:c.t("Sent when your team wins a deal")})};DealWonFlowHeader.displayName="DealWonFlowHeader";let d=DealWonFlowHeader},0xd171ec55:(e,t,a)=>{"use strict";a.d(t,{A:()=>y});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0xe976659c),o=a(0x13fb6986a),l=a(0xfca33088),s=a(0x1d104c491);let c=new i.Ay("modernselling");function ScheduledNotificationPreview({title:e,imageUrl:t}){let a=(0,n.useMemo)(()=>(0,r.E)({amountDirection:s.Us.Increase}),[]),i=(0,n.useMemo)(()=>[r.f.opportunity(),r.f.amount("desc")],[]);return n.createElement(o.A,{body:c.rt("These deals are closed and won! Congratulations, team!"),title:e,imageUrl:t},n.createElement(l.N,{displayType:"trend_positive",columns:i,records:a,title:c.t("Top wins"),isExpandedByDefault:!0,isPreview:!0}))}ScheduledNotificationPreview.displayName="ScheduledNotificationPreview";var d=a(0x1ea519746),u=a(0x21ff11be5),m=a(0x1235cf4a4),p=a(0x62accd6b),g=a(0xf33ac3d1),f=a(0x2253dfab8),_=a(0xd2e7c536),h=a(0x107cfc47d);let b=new i.Ay("modernselling"),DealWonFlowPage=({isAdmin:e=!1})=>{let t=e?s.Lb.adminDealWon:s.Lb.userDealWon,a=(0,m.A)(t,!0,e),i=(0,p.Ht)(t),r=i?.isRecurring,l=(0,d.Y)(t);return n.createElement(h.IS,null,n.createElement(h.cp,{isAdmin:e},n.createElement(g.A,{workflowView:t,defaultListTitle:b.t("Deal won")})),n.createElement(h.OC,null,n.createElement(f.A,{title:a?.description}),r?n.createElement(ScheduledNotificationPreview,{title:b.t("Deal won"),imageUrl:l}):n.createElement(o.A,{body:b.rt('{person} just closed a deal and it\u2019s a win! Congratulations, team!',{person:"@geeta"}),title:b.t("Deal won"),imageUrl:l,showNotificationButton:(0,u.r)(i),buttonLabel:i?.buttonText??void 0}),n.createElement(_.A,{title:a?.destination})))};DealWonFlowPage.displayName="DealWonFlowPage";let y=DealWonFlowPage},0xd0e3a30d:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x1ea519746),o=a(0x23cb9e36f),l=a(0x348940af),s=a(0x1d104c491);let c=new i.Ay("modernselling"),ForecastReminderFlowHeader=({isAdmin:e=!1})=>{let t=e?s.Lb.adminForecastReminder:s.Lb.userForecastReminder,a=(0,o.A)(t,e?"ADMIN_SALES_HOME_FORECAST_REMINDER":"SALES_HOME_FORECAST_REMINDER"),i=(0,r.Y)(t),d=(0,n.useCallback)(async()=>a({reason:"forecast-reminder"}),[a]);return n.createElement(l.A,{isAdmin:e,title:c.t("Update opportunities"),imageUrl:i,description:c.t("Sent on a schedule to remind your team to update their opportunities"),onSave:d})};ForecastReminderFlowHeader.displayName="ForecastReminderFlowHeader";let d=ForecastReminderFlowHeader},0x24c2c2673:(e,t,a)=>{"use strict";a.d(t,{A:()=>D});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x4bdf0df6),o=a(0x20482ad21),l=a(0x1e217163d),s=a(0x93fa1f74),c=a(0x3b556df0),d=a(0x1be40479b),u=a(0x1ea519746),m=a(0x21ff11be5),p=a(0x1235cf4a4),g=a(0x2b3a07cf),f=a(0x6374e095),_=a(0x1f2c612f5),h=a(0xe1721148),b=a(0xd00e724),y=a(0xf1b54886),x=a(0xc2d5849d),S=a(0x2253dfab8),A=a(0xd2e7c536),C=a(0x13fb6986a),w=a(0x107cfc47d),E=a(0x124d99cb0),v=a(0x1b9d5cc0c),T=a(0x226892387),O=a(0xe684f705),N=a(0x1c8beab7f),k=a(0xbd196b81),I=a(0x1d104c491);let F=new o.Ay("modernselling"),ForecastReminderFlowPage=({isAdmin:e=!1})=>{let t=(0,i.wA)(),a=(0,T.d4)(O.cA),o=(0,E.rJ)(a,"iso"),D=(0,v.et)(a)??r.vp,M=e?I.Lb.adminForecastReminder:I.Lb.userForecastReminder,R=(0,p.A)(M,!0,e),L=(0,T.d4)(e?N.Tt:N.rm),P=(0,T.d4)(e?N.MH:N.gE),B=(0,T.d4)(N.RC),H=(0,T.d4)(N.cc),U=(0,T.d4)(N.tx),V=(0,u.Y)(M),W=(0,n.useMemo)(()=>{if(L)return(0,c.l8)(L,e);let t={channelId:null,frequency:I.Ns.weekly,sendTo:I.Oz.SalesHome,startTime:o,timezone:D,title:F.t("Update your opportunities"),canvasTemplateId:null,includeMessageAddOn:!1,buttonText:(0,d.L)(M)};return e?{...t,type:I.g$.AdminReminder,recipientType:null,recipientRoles:null,recipientUsers:null}:{...t,type:I.g$.UserReminder}},[o,L,e,D,M]),{values:q,errors:j,handleBlur:Y,handleChange:z}=(0,g.A)({workflowView:M,initialValues:W}),{title:G,sendTo:$,startTime:Q,channelId:K,tokenUserId:J,frequency:Z,canvasTemplateId:X,includeMessageAddOn:ee,buttonText:et}=q,ea=(0,n.useCallback)(e=>{let a=H?.find(t=>t.salesforce_org_id===e.value);a&&t((0,k.T)({salesforceOrgId:a.salesforce_org_id,setDefaultInApi:!1}))},[t,H]),en=(0,n.useCallback)((e,t)=>z(e)(t),[z]);return n.createElement(w.IS,null,n.createElement(w.cp,{isAdmin:e},n.createElement("div",{className:"p-sales_notifications__workflow__section"},n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},F.t("Notification details")),n.createElement("div",{className:"full_width"},n.createElement(h.A,{value:G,errors:j.title,onBlur:Y("title"),onChange:z("title")}),n.createElement(l.B,{space:"125"},n.createElement(x.A,{isAdmin:e,errors:j,channelId:K,tokenUserId:J,destination:$,isRecurring:q.isRecurring,isEditNotification:!!L,onChannelSelectBlur:Y("channelId"),onChannelSelected:z("channelId"),onTokenSelectBlur:Y("tokenUserId"),onTokenSelected:z("tokenUserId"),onSendToSelected:z("sendTo")})),n.createElement(l.B,{space:"125"},n.createElement(f.e,{value:Q,errors:j.startTime,onBlur:Y("startTime"),onChange:z("startTime"),required:!0}),n.createElement(_.x,{onChange:z("frequency"),startDate:Q,value:Z})),!e&&B&&U&&n.createElement(n.Fragment,null,n.createElement("hr",{className:"p-sales_notifications__workflow__form__divider margin_top_150"}),n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},F.t("Apply to")),n.createElement(s.k,{onChange:ea,salesforceOrgId:L&&P?P:B,disabled:!!L,disabledText:F.t("To change org, please create a new notification."),showCoachMark:!L}))),e&&q.sendTo===I.Oz.SalesHome&&n.createElement("div",{className:"p-sales_notifications__workflow__section"},n.createElement("hr",{className:"p-sales_notifications__workflow__form__divider margin_top_150"}),n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},F.t("Recipients")),n.createElement(y.M,{hasMatchOption:!1,errors:j?.recipientRoles,onBlur:Y("recipientRoles"),onChange:z("recipientRoles"),recipientRoles:q.recipientRoles})),e&&n.createElement(b.A,{onChange:en,errors:j,canvasTemplateId:X,includeMessageAddOn:ee,buttonText:et}))),n.createElement(w.OC,null,n.createElement(S.A,{title:R?.description}),n.createElement(C.A,{body:F.t("Anything changed? Record progress and updates in your opportunity list."),title:F.t("Reminder: Update your opportunities"),imageUrl:V,buttonLabel:et??void 0,showNotificationButton:(0,m.r)(q)}),n.createElement(A.A,{title:R?.destination})))};ForecastReminderFlowPage.displayName="ForecastReminderFlowPage";let D=ForecastReminderFlowPage},0x151f56714:(e,t,a)=>{"use strict";a.d(t,{$:()=>getMissingFieldFormValueFromCondition,l:()=>getMissingFieldConditionFromFormValue});let getMissingFieldConditionFromFormValue=e=>{if(null!==e)return{schema_field_id:e.value,schema_field_label:e.label}},getMissingFieldFormValueFromCondition=e=>e?{value:e.schema_field_id,label:e.schema_field_label}:null},0x1d0dc57a0:(e,t,a)=>{"use strict";a.d(t,{v:()=>getMissingFieldsConditionsString});var n=a(0x20482ad21),i=a(0x1e864b930),r=a(0x1bc8d2ce4);let o=new n.Ay("modernselling"),getMissingFieldsConditionsString=e=>{var t;let a=[(t=e.missingField)&&"string"==typeof t.label?o.t("the missing field is {missingFieldLabel}",{missingFieldLabel:t.label}):"",...(0,r.zV)({scope:e.scope,criteria:e.criteria,accountName:e.account?.label,opportunityName:""})||[],...e.advancedFilterOptions&&(0,r.SH)(e.advancedFilterOptions)||[]].filter(Boolean);return(0,i.A)(a,{noEscape:!0}).join("")}},0x212a2c2d5:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x1ea519746),o=a(0x23cb9e36f),l=a(0x348940af),s=a(0x1d104c491);let c=new i.Ay("modernselling"),NewOpportunityFlowHeader=({isAdmin:e=!1})=>{let t=e?s.Lb.adminNewOpportunityAlert:s.Lb.userNewOpportunityAlert,a=(0,o.A)(t,e?"ADMIN_SALES_HOME_NEW_OPPORTUNITY":"SALES_HOME_NEW_OPPORTUNITY"),i=(0,r.Y)(t),d=(0,n.useCallback)(async()=>a({reason:"new-opportunity"}),[a]);return n.createElement(l.A,{isAdmin:e,title:c.t("New opportunity"),description:c.t("Sent when new opportunities are added"),imageUrl:i,onSave:d})};NewOpportunityFlowHeader.displayName="NewOpportunityFlowHeader";let d=NewOpportunityFlowHeader},0x1ee39de0b:(e,t,a)=>{"use strict";a.d(t,{A:()=>_});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x1ea519746),o=a(0x21ff11be5),l=a(0x1235cf4a4),s=a(0x62accd6b),c=a(0xf33ac3d1),d=a(0x2253dfab8),u=a(0xd2e7c536),m=a(0x13fb6986a),p=a(0x107cfc47d),g=a(0x1d104c491);let f=new i.Ay("modernselling"),NewOpportunityFlowPage=({isAdmin:e=!1})=>{let t=e?g.Lb.adminNewOpportunityAlert:g.Lb.userNewOpportunityAlert,a=(0,l.A)(t,!0,e),i=(0,r.Y)(t),_=(0,s.Ht)(t);return n.createElement(p.IS,null,n.createElement(p.cp,{isAdmin:e},n.createElement(c.A,{workflowView:t,defaultListTitle:f.t("New opportunity")})),n.createElement(p.OC,null,n.createElement(d.A,{title:a?.description}),n.createElement(m.A,{body:f.rt('{person} created a new opportunity.',{person:"@geeta"}),title:f.t("New opportunity"),imageUrl:i,showNotificationButton:(0,o.r)(_),buttonLabel:_?.buttonText??void 0}),n.createElement(u.A,{title:a?.destination})))};NewOpportunityFlowPage.displayName="NewOpportunityFlowPage";let _=NewOpportunityFlowPage},0x1f58f3ef3:(e,t,a)=>{"use strict";a.d(t,{Sm:()=>i,a4:()=>o,em:()=>r});let n=new(a(0x20482ad21)).Ay("modernselling"),i={label:n.t("Day"),value:"DaysTimePeriod"},r={label:n.t("Month"),value:"MonthsTimePeriod"},o=[i,r]},0x125c85f04:(e,t,a)=>{"use strict";a.d(t,{ku:()=>getOutdatedFieldConditionFormValues,qJ:()=>getOutdatedFieldCondition,vZ:()=>i});var n=a(0x1f58f3ef3);let getOutdatedFieldCondition=(e,t,a)=>{if(null!==e)return{schema_field_id:e.value,schema_field_label:e.label,period:{period_type:t.value,period_value:Number(a)}}},i={outdatedFieldValue:null,outdatedFieldPeriod:n.Sm,outdatedFieldPeriodValue:"30"},r={DaysTimePeriod:n.Sm,MonthsTimePeriod:n.em},getOutdatedFieldConditionFormValues=e=>{if(!e)return i;let{schema_field_id:t,schema_field_label:a,period:n}=e;return{outdatedFieldValue:{value:t,label:a},outdatedFieldPeriod:r[n.period_type],outdatedFieldPeriodValue:n.period_value.toString()}}},0x7629109d:(e,t,a)=>{"use strict";a.d(t,{A:()=>getOutdatedFieldConditionsString});var n=a(0x1e864b930);let i=new(a(0x20482ad21)).Ay("modernselling"),r={DaysTimePeriod:(e,t)=>i.t("the outdated field is {outdatedFieldLabel} and it has not changed for {periodValueCount, plural, one {# day} other {# days}}",{outdatedFieldLabel:e,periodValueCount:t}),MonthsTimePeriod:(e,t)=>i.t("the outdated field is {outdatedFieldLabel} and it has not changed for {periodValueCount, plural, one {# month} other {# months}}",{outdatedFieldLabel:e,periodValueCount:t})};var o=a(0x1bc8d2ce4);let getOutdatedFieldConditionsString=e=>{let t=[(({outdatedFieldValue:e,outdatedFieldPeriod:t,outdatedFieldPeriodValue:a})=>{if(!e)return"";let n=r[t.value];return n&&"string"==typeof e.label?n(e.label,Number(a)):""})({outdatedFieldValue:e.outdatedFieldValue,outdatedFieldPeriodValue:e.outdatedFieldPeriodValue,outdatedFieldPeriod:e.outdatedFieldPeriod}),...(0,o.zV)({scope:e.scope,criteria:e.criteria,accountName:e.account?.label,opportunityName:""})||[],...e.advancedFilterOptions&&(0,o.SH)(e.advancedFilterOptions)||[]].filter(Boolean);return(0,n.A)(t,{noEscape:!0}).join("")}},0xb0222280:(e,t,a)=>{"use strict";a.d(t,{s:()=>getPastCloseDateConditionsString});var n=a(0x1e864b930),i=a(0x1bc8d2ce4);let getPastCloseDateConditionsString=e=>{let t=[...(0,i.zV)({scope:e.scope,criteria:e.criteria,accountName:e.account?.label,opportunityName:""})||[],...e.advancedFilterOptions&&(0,i.SH)(e.advancedFilterOptions)||[]].filter(Boolean);return(0,n.A)(t,{noEscape:!0}).join("")}},0x10b410a4d:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x1ea519746),o=a(0x23cb9e36f),l=a(0x348940af),s=a(0x1d104c491);let c=new i.Ay("modernselling"),StageChangedFlowHeader=({isAdmin:e=!1})=>{let t=e?s.Lb.adminStageChanged:s.Lb.userStageChanged,a=(0,o.A)(t,e?"ADMIN_SALES_HOME_OPPORTUNITY_STAGE_CHANGED":"SALES_HOME_OPPORTUNITY_STAGE_CHANGED"),i=(0,r.Y)(t),d=(0,n.useCallback)(async()=>a({reason:"stage-changed"}),[a]);return n.createElement(l.A,{isAdmin:e,imageUrl:i,title:c.t("Stage changed"),onSave:d,description:c.t("Sent when opportunity stages change")})};StageChangedFlowHeader.displayName="StageChangedFlowHeader";let d=StageChangedFlowHeader},0x18ee6860e:(e,t,a)=>{"use strict";a.d(t,{A:()=>y});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0xe976659c),o=a(0x13fb6986a),l=a(0xfca33088),s=a(0x1d104c491);let c=new i.Ay("modernselling");function ScheduledNotificationPreview({title:e,imageUrl:t}){let a=(0,n.useMemo)(()=>(0,r.E)({amountDirection:s.Us.Increase}),[]),i=(0,n.useMemo)(()=>[r.f.opportunity(),r.f.amount("desc")],[]);return n.createElement(o.A,{body:c.rt("These opportunities\u2019 stage have been updated."),title:e,imageUrl:t},n.createElement(l.N,{displayType:"standard",columns:i,records:a,title:c.t("Top updated opportunities"),isExpandedByDefault:!0,isPreview:!0}))}ScheduledNotificationPreview.displayName="ScheduledNotificationPreview";var d=a(0x1ea519746),u=a(0x21ff11be5),m=a(0x1235cf4a4),p=a(0x62accd6b),g=a(0xf33ac3d1),f=a(0x2253dfab8),_=a(0xd2e7c536),h=a(0x107cfc47d);let b=new i.Ay("modernselling"),StageChangedFlowPage=({isAdmin:e=!1})=>{let t=e?s.Lb.adminStageChanged:s.Lb.userStageChanged,a=(0,m.A)(t,!0,e),i=(0,p.Ht)(t),r=i?.isRecurring,l=(0,d.Y)(t);return n.createElement(h.IS,null,n.createElement(h.cp,{isAdmin:e},n.createElement(g.A,{workflowView:t,defaultListTitle:b.t("Stage changed")})),n.createElement(h.OC,null,n.createElement(f.A,{title:a?.description}),r?n.createElement(ScheduledNotificationPreview,{title:b.t("Stage changed"),imageUrl:l}):n.createElement(o.A,{body:b.rt('{person} changed a stage: 03-Proposal \u2192 04-Negotiation',{person:"@geeta"}),title:b.t("Stage changed"),imageUrl:l,showNotificationButton:(0,u.r)(i),buttonLabel:i?.buttonText??void 0}),n.createElement(_.A,{title:a?.destination})))};StageChangedFlowPage.displayName="StageChangedFlowPage";let y=StageChangedFlowPage},0x1f49c20b0:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x128d54e52),o=a(0x2501a2cee),l=a(0x1c659cbb1);let s=new i.Ay("modernselling"),NotificationTemplateEntity=({workflow:e,showDescription:t=!0,size:a="medium",className:i})=>{let c="medium"===a?l.RG.medium:l.RG.verySmall,d=(0,n.useCallback)(()=>n.createElement(l.f1,{className:"medium"===a?"margin_right_100":"margin_right_50",size:c,imageUrl:e.icons?.image_96,isInteractive:!1}),[c,a,e.icons?.image_96]),u=(0,n.useMemo)(()=>n.createElement(n.Fragment,null,e.isMuted&&!e.isDisabled&&n.createElement("div",{className:"p-sales_notifications__notification_template_entity__muted"},n.createElement(o.Ah,{inline:!0,name:"notifications-off",size:"inherit"}),n.createElement("div",{className:"margin_left_25"},s.t("Muted"))),n.createElement(r.CG,{withTruncationTooltip:!0},n.createElement("strong",null,e.title))),[e]),m=(0,n.useMemo)(()=>t?n.createElement(r.sT,{className:"caption"},e.description):null,[t,e.description]);return n.createElement(r.Ay,{size:"medium",className:i,avatar:d,text:u,subtext:m})};NotificationTemplateEntity.displayName="NotificationTemplateEntity";let c=NotificationTemplateEntity},0x93fa1f74:(e,t,a)=>{"use strict";a.d(t,{k:()=>SalesforceOrgSelect});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x1d2cd7755),o=a(0x15014e268),l=a(0x16cf1da63),s=a(0xed74b103),c=a(0x23c27866b),d=a(0x226892387),u=a(0x1472af90a),m=a(0xf052d367),p=a(0x18632f75a);let g=new i.Ay("modernselling"),OnboardingMultiOrgNotificationsCoachmark=()=>{let e=(0,l.wA)(),t=u.G7.SalesHomeMultiOrgNotificationsCoachmark,a="sales-home-multi-org-notifications-coachmark-seen",i=(0,c.A)(t,a),r=(0,d.d4)(e=>(0,m.kI)(e,t,u.X8.Click)),o=(0,d.d4)(e=>(0,m.h$)(e,t));(0,n.useEffect)(()=>{i()},[i]);let f=(0,n.useCallback)(()=>{e((0,p.z)({component:t,type:u.X8.Click,reason:a}))},[e,a,t]);return!r||o?null:n.createElement(s.r,{className:"p-sales_onboarding_multi_org_coachmark",onClose:f,theme:"purple"},g.t("Choose which org you\u2019d like this notification to apply to"))};function getAuthorizedUserOrgsAsOptions(e){return e.reduce((e,t)=>{if("ok"===t.auth){let a={label:t.name,value:t.salesforce_org_id};e.push(a)}return e},[])}OnboardingMultiOrgNotificationsCoachmark.displayName="OnboardingMultiOrgNotificationsCoachmark";var f=a(0x1c8beab7f);let _=new i.Ay("modernselling"),SalesforceOrgSelect=({className:e,salesforceOrgId:t,onChange:a,disabled:i,disabledText:l,hideLabel:s,size:c,showCoachMark:u})=>{let m=(0,d.d4)(f.cc),p=(0,n.useMemo)(()=>getAuthorizedUserOrgsAsOptions(m),[m]),g=(0,n.useMemo)(()=>n.createElement(o.Ay,{className:e,isRequired:!0,options:p,selectedOption:p.find(e=>e.value===t)||p[0],width:"100%",onOptionSelected:a,isDisabled:i,size:c}),[e,i,a,p,t,c]);return 1===p.length?null:n.createElement(n.Fragment,null,s?g:n.createElement(n.Fragment,null,n.createElement(r.A,{text:_.t("Salesforce org"),className:"p-sales_notifications__workflow__form__field"},g,i&&n.createElement("span",{className:"caption p-sales_notifications__workflow__form__field_caption"},l)),u&&n.createElement(OnboardingMultiOrgNotificationsCoachmark,null)))};SalesforceOrgSelect.displayName="SalesforceOrgSelect"},0x3b556df0:(e,t,a)=>{"use strict";a.d(t,{AN:()=>buildOpportunityChangedFormValues,DT:()=>buildPastCloseDateFormValues,MP:()=>buildMissingFieldsFormValues,Ni:()=>buildClosingSoonFormValues,S1:()=>buildOutdatedFieldsFormValues,l8:()=>buildReminderFormValues});var n=a(0x205f4fb61),i=a(0x66c4c9f7),r=a(0x151f56714),o=a(0x125c85f04),l=a(0x6f20b262),s=a(0xe08dc76c),c=a(0x1d104c491);function getFrequencyValue(e){return e?.type==="weekly"?e.on_days&&e.on_days.length>1?"weekdays":"weekly":e?.type||"weekly"}function getScheduleValues(e,t){return{isRecurring:!!e?.start_time,frequency:e?.frequency?.type?getFrequencyValue(e.frequency):t.frequency,startTime:e?.start_time||t.startTime,timezone:e?.timezone||t.timezone}}let d={owner:c._Y.Owner,account_owner:c._Y.AccountOwner,manager_chain:c._Y.ManagerChain,account_manager_chain:c._Y.AccountManagerChain,owner_manager:c._Y.OwnerManager,account_owner_manager:c._Y.AccountOwnerManager};function getRecipientValues(e){let t=e?.role_contains_one_of?.length||e?.role_contains_none_of?.length;return{recipientType:e?.user_ids?.length?c._Y.User:e?.relationships?.[0]?d[e.relationships[0]]:null,recipientRoles:{filter:t?c.yP.Match:c.yP.Specific,match:{containsOneOf:{isValid:!0,values:e?.role_contains_one_of||[]},containsNoneOf:{isValid:!0,values:e?.role_contains_none_of||[]}},specific:e?.roles||[]},recipientUsers:e?.user_ids||[]}}function getMessageAddOnValues(e){return{canvasTemplateId:e.canvas_template_id,includeMessageAddOn:!!e.message_add_on,buttonText:e.button_text}}function getStageValues(e){return e?.stage_to?.map(e=>({key:e,value:e,label:e}))??null}function getCloseDateValues(e){let t;switch(e?.direction){case"to_another":t=s.ig.ANY;break;case"to_future":t=s.ig.LATER;break;case"to_earlier":t=s.ig.EARLIER;break;default:t=null}return{closeDateDirection:t,closeDatePeriod:e?.period||null}}function getAdvancedOptionType(e){let t=e.rhs?.[0];if(e.type===l.hu.TimePeriodHasChangedTriggerCondition&&t){if(t.direction?.type===s.ig.ANY&&t.operator?.type===s.Kr.AT_LEAST&&t.period?.num===1)return l.hu.TimePeriodToAnotherTriggerCondition;if(t.direction?.type===s.ig.LATER&&t.operator?.type===s.Kr.AT_LEAST&&t.period?.num===1)return l.hu.TimePeriodToFutureTriggerCondition;if(t.direction?.type===s.ig.EARLIER&&t.operator?.type===s.Kr.AT_LEAST&&t.period?.num===1)return l.hu.TimePeriodToEarlierTriggerCondition;if(t.direction?.type===s.ig.ANY&&t.operator?.type===s.Kr.AT_LEAST)return l.hu.TimePeriodIsMoreThanTriggerCondition;if(t.direction?.type===s.ig.ANY&&t.operator?.type===s.Kr.AT_MOST)return l.hu.TimePeriodIsLessThanTriggerCondition;if(t.direction?.type===s.ig.ANY&&t.operator?.type===s.Kr.EXACT)return l.hu.TimePeriodIsEqualToTriggerCondition}else if(e.type===l.hu.TimePeriodWithinTriggerCondition&&t){if(t.operator?.type===s.Kr.AT_LEAST&&t.direction?.type===s.ig.EARLIER||t.operator?.type===s.Kr.AT_MOST&&t.direction?.type===s.ig.LATER)return l.hu.TimePeriodBeforeTriggerCondition;if(t.operator?.type===s.Kr.AT_LEAST&&t.direction?.type===s.ig.LATER)return l.hu.TimePeriodAfterTriggerCondition;if(t.operator?.type===s.Kr.EXACT)return l.hu.TimePeriodCurrentTriggerCondition}return e.type}function getAdvancedOptions(e){return e?.reduce((e,t)=>(t?.id&&(e[t.id]={...t,type:getAdvancedOptionType(t)}),e),{})}function getAdvancedFilterOptions(e){return e?e?.reduce((e,{rhs:t,...a})=>(a?.id&&(e[a.id]={...a,rhs:t&&!Array.isArray(t)?[t]:t}),e),{}):null}function getEcnScope(e){switch(e?.scope){case"account":return c.QO.SpecificAccount;case"opportunity":return c.QO.SpecificOpportunity;default:if(!e?.criteria?.length)return c.QO.All;switch(e.criteria[0]){case"account_owner":return c.QO.AccountsOwnedByMe;case"account_report_chain":return c.QO.AccountOwnedByReportChain;case"owner":return c.QO.OwnedByMe;case"direct_reports":return c.QO.OwnedByDirectReports;case"report_chain":return c.QO.OwnedByReportChain;default:return c.QO.MatchCriteria}}}function getDealWinCelebrationFields(e){return{displayOpportunityAccountName:e?.display_opportunity_account_name||!1,displayOpportunityAmount:e?.display_opportunity_amount||!1,displayOpportunityCloseDate:e?.display_opportunity_close_date||!1}}function getBaseReminderValues(e){let t=e.trigger.schedule;return{title:e.title,sendTo:e.send_to,channelId:e.channel_id||null,tokenUserId:e.token_user_id||null,startTime:t.start_time,timezone:t.timezone,frequency:getFrequencyValue(t.frequency),...getMessageAddOnValues(e)}}function getBaseOpportunityChangedValues(e){let t=e.condition||e.acn;return{title:e.title,sendTo:e.send_to,channelId:e.channel_id||null,tokenUserId:e.token_user_id||null,account:t?.account?{label:t.account.name,key:t.account.id,value:t.account.id}:null,amount:t?.min_deal_amount||t?.min_deal_amount===0?(0,n.ZV)(t.min_deal_amount):null,opportunity:t?.opportunity?{label:t.opportunity.name,key:t.opportunity.id,value:t.opportunity.id}:null,stage:t?.stage_for_win?{label:t.stage_for_win,key:t.stage_for_win,value:t.stage_for_win}:null,excludeSelfModifications:!!t?.exclude_self_modifications,includeCelebrations:!!e.display_celebration,criteria:void 0,recipientType:void 0,recipientRoles:void 0,recipientUsers:void 0,advancedOptions:getAdvancedOptions(t?.advanced_conditions),...getMessageAddOnValues(e),...getCloseDateValues(t?.close_date_condition)}}let u={account:c.QO.SpecificAccount,opportunity:c.QO.SpecificOpportunity,all:c.QO.All},getACNValuesOrFallbacks=e=>{if(!e)return{...o.vZ,opportunity:null,account:null,recipients:void 0,closingSoonFormValue:""};let{opportunity:t,account:a,recipients:n,outdated_field_condition:r,closing_soon_condition:l,advanced_filter_conditions:s,is_muting_disabled:c}=e,{outdatedFieldPeriod:d,outdatedFieldPeriodValue:u,outdatedFieldValue:m}=(0,o.ku)(r);return{recipients:n,outdatedFieldPeriod:d,outdatedFieldPeriodValue:u,outdatedFieldValue:m,closingSoonFormValue:(0,i.Z)(l),opportunity:t?{label:t.name,key:t.id,value:t.id}:null,account:a?{label:a.name,key:a.id,value:a.id}:null,advancedFilterConditions:s,isMutingDisabled:c}};function buildOutdatedFieldsFormValues(e,t){let a=e.acn?.scope?u[e.acn.scope]:c.QO.All,{acn:n,title:i="",send_to:r,trigger:o}=e,{account:l,recipients:s,outdatedFieldPeriod:d,outdatedFieldPeriodValue:m,outdatedFieldValue:p,advancedFilterConditions:g,isMutingDisabled:f}=getACNValuesOrFallbacks(n),{frequency:_,startTime:h,timezone:b}=getScheduleValues(o.schedule,t),y=getAdvancedFilterOptions(g);return{...getRecipientValues(s),type:c.g$.AdminOutdatedFields,scope:a,title:i,sendTo:r,account:l,frequency:_,startTime:h,timezone:b,outdatedFieldValue:p,outdatedFieldPeriod:d,outdatedFieldPeriodValue:m,advancedFilterOptions:y,channelId:null,tokenUserId:null,canvasTemplateId:null,buttonText:null,isMutingDisabled:f}}let buildClosingSoonFormValues=(e,t)=>{let a=e.acn?.scope?u[e.acn.scope]:c.QO.All,{acn:n,title:i="",send_to:r,trigger:o}=e,{account:l,recipients:s,closingSoonFormValue:d,advancedFilterConditions:m,isMutingDisabled:p}=getACNValuesOrFallbacks(n),{frequency:g,startTime:f,timezone:_}=getScheduleValues(o.schedule,t),h=getAdvancedFilterOptions(m);return{...getRecipientValues(s),type:c.g$.AdminClosingSoon,scope:a,title:i,sendTo:r,account:l,frequency:g,startTime:f,timezone:_,closingIn:d,advancedFilterOptions:h,channelId:null,tokenUserId:null,canvasTemplateId:null,buttonText:null,isMutingDisabled:p}},buildMissingFieldsFormValues=(e,t)=>{let a=e.acn?.scope?u[e.acn.scope]:c.QO.All,{acn:n,title:i="",send_to:o,trigger:l}=e,{account:s,recipients:d,advancedFilterConditions:m,isMutingDisabled:p}=getACNValuesOrFallbacks(n),g=(0,r.$)(e.acn?.missing_field_condition),{frequency:f,startTime:_,timezone:h}=getScheduleValues(l.schedule,t),b=getAdvancedFilterOptions(m);return{...getRecipientValues(d),type:c.g$.AdminMissingFields,scope:a,title:i,sendTo:o,account:s,frequency:f,startTime:_,timezone:h,missingField:g,advancedFilterOptions:b,channelId:null,tokenUserId:null,canvasTemplateId:null,buttonText:null,isMutingDisabled:p}},buildPastCloseDateFormValues=(e,t)=>{let a=e.acn?.scope?u[e.acn.scope]:c.QO.All,{acn:n,title:i="",send_to:r,trigger:o}=e,{account:l,recipients:s,advancedFilterConditions:d,isMutingDisabled:m}=getACNValuesOrFallbacks(n),{frequency:p,startTime:g,timezone:f}=getScheduleValues(o.schedule,t),_=getAdvancedFilterOptions(d);return{...getRecipientValues(s),type:c.g$.AdminPastCloseDate,scope:a,title:i,sendTo:r,account:l,frequency:p,startTime:g,timezone:f,advancedFilterOptions:_,channelId:null,tokenUserId:null,canvasTemplateId:null,buttonText:null,isMutingDisabled:m}};function buildOpportunityChangedFormValues(e,t=!1,a){return t?{...getBaseOpportunityChangedValues(e),...getRecipientValues(e.acn?.recipients),...getScheduleValues(e.trigger.schedule,a),amountDirection:e.acn?.amount_condition?.direction||null,scope:e.acn?.scope||c.QO.All,type:c.g$.AdminOpportunityChanged,stageChangedStages:getStageValues(e.acn?.stage_condition),isMutingDisabled:e.acn?.is_muting_disabled,dealWinCelebrationMessageFields:getDealWinCelebrationFields(e.acn?.deal_win_celebration_message_fields)}:{...getBaseOpportunityChangedValues(e),scope:getEcnScope(e.condition),criteria:e.condition?.criteria||[],type:c.g$.UserOpportunityChanged,stageChangedStages:getStageValues(e.acn?.stage_condition)}}function buildReminderFormValues(e,t=!1){return t?{...getBaseReminderValues(e),...getRecipientValues(e.acn?.recipients),type:c.g$.AdminReminder}:{...getBaseReminderValues(e),type:c.g$.UserReminder}}},0x3ebf4390:(e,t,a)=>{"use strict";a.d(t,{Un:()=>C,cB:()=>validateAllWorkflowFormFields,g7:()=>validateWorkflowFormField});var n=a(0xe180a236),i=a(0xb77a689a),r=a(0x1595bdd0),o=a(0x1b63e435a),l=a.n(o),s=a(0x20482ad21),c=a(0x405dcae6),d=a(0x124d99cb0),u=a(0x1d104c491);let m=new s.Ay("modernselling"),id=e=>`SALES_HOME_NOTIFICATIONS_CONFIG_${e}`,validateAccount=({currentValues:e,incomingValue:t})=>t||e.scope!==u.QO.SpecificAccount?null:[{id:id("ACCOUNT_SELECT"),message:m.t("Please select an account.")}],validateCriteria=({currentValues:e,incomingValue:t})=>e.scope!==u.QO.MatchCriteria||Array.isArray(t)&&t?.length?null:[{id:id("CRITERIA_SELECT"),message:m.t("Please select at least one option.")}],validateScope=({incomingValue:e})=>e?null:[{id:id("SCOPE_SELECT"),message:m.t("Please select an option.")}],validateOpportunity=({currentValues:e,incomingValue:t})=>t||e.scope!==u.QO.SpecificOpportunity?null:[{id:id("OPPORTUNITY_SELECT"),message:m.t("Please select an opportunity.")}],validateStage=({incomingValue:e,workflowView:t})=>e||t!==u.Lb.adminDealWon&&t!==u.Lb.userDealWon&&t!==u.Lb.adminDealWinCelebration?null:[{id:id("STAGE_FOR_WIN"),message:m.t("Please select an opportunity stage.")}],validateButtonText=({incomingValue:e,currentValues:t})=>e&&e.length<=40||!t.includeMessageAddOn?null:e&&e.length>40?[{id:id("BUTTON_TEXT_TOO_LONG"),message:m.t("You can\u2019t enter more than 40 characters.")}]:[{id:id("BUTTON_TEXT_CHANGE"),message:m.t("Please enter one or more keywords.")}],validateCanvasTemplate=({incomingValue:e,currentValues:t})=>e||!t.includeMessageAddOn?null:[{id:id("CANVAS_TEMPLATE_CHANGE"),message:m.t("Please select a canvas template.")}],validateStartTime=({currentValues:e,incomingValue:t})=>{let{type:a,isRecurring:n,timezone:r}=e;if(a===u.g$.AdminOpportunityChanged&&!n)return null;let o=(0,i.A)(t)?t:"";return(0,d.lP)(o,e.timezone).isAfter(l().tz(r))?null:[{id:id("START_TIME"),message:m.t("Scheduled to start in the past. Select a time today or on a future date.")}]},validateAdvancedOptions=({incomingValue:e})=>{if(!e)return null;let t=[];for(let a of(0,r.A)(Object.values(e))){let e=(0,c.K5)(a);e?.length&&t.push(...e)}return t.length?t:null},validateRecipientType=({currentValues:e,incomingValue:t})=>e.sendTo!==u.Oz.SalesHome||t?null:[{id:id("RECIPIENT_TYPE_SELECT"),message:m.t("Please select a recipient type.")}],validateRecipientRoles=({currentValues:e,incomingValue:t,workflowView:a,experiments:{experimentLobOrg62UnrestrictedGroupOn:n}})=>{if(e.sendTo!==u.Oz.SalesHome)return null;if(a===u.Lb.adminForecastReminder&&e.sendTo===u.Oz.SalesHome)return t?.filter===u.yP.Specific&&Array.isArray(t?.specific)&&t?.specific.length?null:[{id:id("RECIPIENT_ROLES_SPECIFIC"),message:m.t("Please select one or more roles.")}];if(e.recipientType===u._Y.User)return null;let i=e.recipientType===u._Y.Owner||e.recipientType===u._Y.AccountOwner;return t?.filter===u.yP.Specific?i||n||Array.isArray(t?.specific)&&t?.specific.length?null:[{id:id("RECIPIENT_ROLES_SPECIFIC"),message:m.t("Please select one or more roles.")}]:t?.filter===u.yP.Match?t.match.containsOneOf.isValid&&t.match.containsNoneOf.isValid?i||n||Array.isArray(t.match.containsOneOf.values)&&t.match.containsOneOf.values.length||Array.isArray(t.match.containsNoneOf.values)&&t.match?.containsNoneOf.values.length?null:[{id:id("RECIPIENT_ROLES_MATCH_EMPTY"),message:m.t("Please enter one or more keywords.")}]:[{id:id("RECIPIENT_ROLES_MATCH_INVALID"),message:""}]:null},validateRecipientUsers=({currentValues:e,incomingValue:t})=>e.sendTo!==u.Oz.SalesHome||e.recipientType!==u._Y.User||Array.isArray(t)&&t?.length?null:[{id:id("RECIPIENT_USERS_SELECT"),message:m.t("Please select one or more users.")}],p=Object.freeze({channelId:({currentValues:e,incomingValue:t})=>t||e.sendTo!==u.Oz.Channel?null:[{id:id("CHANNEL_ID"),message:m.t("Please select a channel.")}],tokenUserId:({currentValues:e,incomingValue:t,experiments:{experimentLobChannelAcnTokenGroupOn:a}})=>t||e.sendTo!==u.Oz.Channel||!a?null:[{id:id("TOKEN_USER_ID"),message:m.t("Please select a user.")}]}),g=Object.freeze({...p,startTime:validateStartTime}),f=Object.freeze({...p,startTime:validateStartTime,recipientRoles:validateRecipientRoles}),validateFieldOptionSelected=({incomingValue:e})=>e?null:[{id:id("FIELD_OPTION_IS_NOT_SELECTED"),message:m.t("Please select an option.")}],_={account:validateAccount,opportunity:validateOpportunity,recipientRoles:validateRecipientRoles,recipientType:validateRecipientType,recipientUsers:validateRecipientUsers,scope:validateScope,startTime:validateStartTime,outdatedFieldValue:validateFieldOptionSelected,outdatedFieldPeriodValue:({incomingValue:e})=>!e||0>=Number(e)||Number(e)>9999?[{id:id("OUTDATED_FIELD_PERIOD_VALUE"),message:m.t("Please enter the value between 1 and 9999.")}]:null,buttonText:validateButtonText,canvasTemplateId:validateCanvasTemplate,advancedFilterOptions:validateAdvancedOptions},h={account:validateAccount,opportunity:validateOpportunity,recipientRoles:validateRecipientRoles,recipientType:validateRecipientType,recipientUsers:validateRecipientUsers,scope:validateScope,startTime:validateStartTime,missingField:validateFieldOptionSelected,buttonText:validateButtonText,canvasTemplateId:validateCanvasTemplate,advancedFilterOptions:validateAdvancedOptions},b={account:validateAccount,opportunity:validateOpportunity,recipientRoles:validateRecipientRoles,recipientType:validateRecipientType,recipientUsers:validateRecipientUsers,closingIn:({incomingValue:e})=>!e||0>Number(e)?[{id:id("CLOSING_IN_DAYS_VALUE"),message:m.t("Negative numbers are not allowed.")}]:null,scope:validateScope,startTime:validateStartTime,buttonText:validateButtonText,canvasTemplateId:validateCanvasTemplate,advancedFilterOptions:validateAdvancedOptions},y={account:validateAccount,opportunity:validateOpportunity,recipientRoles:validateRecipientRoles,recipientType:validateRecipientType,recipientUsers:validateRecipientUsers,scope:validateScope,startTime:validateStartTime,buttonText:validateButtonText,canvasTemplateId:validateCanvasTemplate,advancedFilterOptions:validateAdvancedOptions},x=Object.freeze({...p,account:validateAccount,advancedOptions:validateAdvancedOptions,criteria:validateCriteria,opportunity:validateOpportunity,stage:validateStage,scope:validateScope,buttonText:validateButtonText,canvasTemplateId:validateCanvasTemplate}),S=Object.freeze({...p,account:validateAccount,advancedOptions:validateAdvancedOptions,criteria:validateCriteria,opportunity:validateOpportunity,recipientRoles:validateRecipientRoles,recipientType:validateRecipientType,recipientUsers:validateRecipientUsers,stage:validateStage,scope:validateScope,startTime:validateStartTime,stageChangedStages:({incomingValue:e,workflowView:t,currentValues:a})=>t!==u.Lb.userStageChanged&&t!==u.Lb.adminStageChanged||(0,n.A)(a.advancedOptions)||Array.isArray(e)&&e.length?null:[{id:id("STAGE_CHANGE_STAGES"),message:m.t("Please select at least one stage.")}],buttonText:validateButtonText,canvasTemplateId:validateCanvasTemplate});function getFormValidators(e){switch(e){case u.g$.AdminOpportunityChanged:return S;case u.g$.AdminReminder:return f;case u.g$.AdminOutdatedFields:return _;case u.g$.AdminClosingSoon:return b;case u.g$.AdminMissingFields:return h;case u.g$.AdminPastCloseDate:return y;case u.g$.UserOpportunityChanged:return x;case u.g$.UserReminder:return g;default:return p}}let A={ok:!1,errors:{}},C=[];function hasFormErrors(e){return!!e&&Object.values(e).some(e=>e?.length)}function validateWorkflowFormField(e,t,a,n,i){if(!n)return C;let r=getFormValidators(n.type);return r[t]?.({incomingValue:a,currentValues:n,workflowView:e,experiments:i})||C}function validateAllWorkflowFormFields(e,t,a){if(!e||!t)return A;let n={},i=getFormValidators(t.type),r={currentValues:t,workflowView:e,experiments:a};for(let[e,a]of Object.entries(i)){let i=t[e],o=a({...r,incomingValue:i});o&&(n[e]=o)}return{ok:!hasFormErrors(n),errors:n}}},0x1be40479b:(e,t,a)=>{"use strict";a.d(t,{L:()=>getDefaultButtonText});var n=a(0x20482ad21),i=a(0x1d104c491);let r=new n.Ay("modernselling");function getDefaultButtonText(e){switch(e){case i.Lb.adminDealWon:case i.Lb.userDealWon:return r.t("Create Win Story");case i.Lb.adminForecastReminder:case i.Lb.userForecastReminder:return r.t("Forecast Reminder");case i.Lb.adminNewOpportunityAlert:case i.Lb.userNewOpportunityAlert:return r.t("Create Proposal");default:case i.Lb.adminCloseDateChanged:case i.Lb.userCloseDateChanged:case i.Lb.adminStageChanged:case i.Lb.userStageChanged:return r.t("Create Deal Review")}}},0x1ea519746:(e,t,a)=>{"use strict";a.d(t,{Z:()=>getNotificationConfigIcon,Y:()=>useNotificationConfigIcon});var n=a(0x1d104c491);let i=a.p+"update-fa5aa52.svg",r=a.p+"amount-changed-0a849b9.svg",o=a.p+"close-date-changed-ab45769.svg";var l=a(0xc5a3e186);let s=a.p+"deal-won-da94eb7.svg",c=a.p+"forecast-reminder-14c2a6b.svg";var d=a(0x10398ed1f);let u=a.p+"new-opportunity-adf2289.svg";var m=a(0x86226b0b),p=a(0x11a940e89);let g=a.p+"stage-changed-069f628.svg";function getNewNotificationConfigIcon(e){switch(e){case n.Lb.adminAmountChanged:case n.Lb.userAmountChanged:return r;case n.Lb.adminCloseDateChanged:case n.Lb.userCloseDateChanged:return o;case n.Lb.adminDealWon:case n.Lb.userDealWon:return s;case n.Lb.adminForecastReminder:case n.Lb.userForecastReminder:return c;case n.Lb.adminNewOpportunityAlert:case n.Lb.userNewOpportunityAlert:return u;case n.Lb.adminStageChanged:case n.Lb.userStageChanged:return g;case n.Lb.adminMissingFields:return d;case n.Lb.adminOutdatedFields:return m;case n.Lb.adminClosingSoonAlert:return l;case n.Lb.adminPastCloseDateAlert:return p;default:return i}}function getNotificationConfigIcon(){return e=>getNewNotificationConfigIcon(e)}function useNotificationConfigIcon(e){return getNotificationConfigIcon()(e)}},0xe976659c:(e,t,a)=>{"use strict";a.d(t,{E:()=>mockScheduledRecords,f:()=>u});var n=a(0xd04cf7e4),i=a(0x237b6a339),r=a(0x1075d3a9c),o=a.n(r),l=a(0x205f4fb61),s=a(0x1d104c491);let c=["NextGen - Communications Cloud Integration","GreenTech - Solutions Software Upgrade","InnovateHub - Tech Expansion","AlphaData - Security Enhancement","QuantumSys - Data Analytics Revolution","EcoSync - Sustainable Connectivity Platform","NexGenius - AI-driven Business Optimization","CyberGuardian - Digital Defense Solutions","SolarSync - Renewable Energy Infrastructure","InnovateWare - Progressive Software Solutions","BlueSkyTech - Sky\u2018s the Limit Technology Innovations","ZenithConnect - Seamless Communication Integration","SafeBit Solutions - Data Security Fortification","RenewaGrid - Smart Grid Energy Solutions","EcoNet - Energy Management System"],d=["Qualification","Discovery","Proposal","Negotiation"];function mockStage(e){return e||d[(0,n.A)(0,d.length-1)]}function mockDate(e){return o()().add({days:e?(0,n.A)(3,90):(0,n.A)(0,7)}).locale(navigator.language).format("L")}function mockAmountFields(e){let t=(0,n.A)(1,400),a=(0,n.A)(Math.round(.05*t),Math.round(.5*t));t*=5e3,a*=5e3,e===s.Us.Decrease?a*=-1:e===s.Us.Any&&(a*=1===(0,n.A)(1,2)?-1:1);let i=t+a;return{amount:`${a<0?"-":""}$${(0,l.ZV)(Math.abs(i))}`,amount_raw:{amount:i},amount_change:`${a<0?"-":"+"}$${(0,l.ZV)(Math.abs(a))}`,amount_change_raw:{amount:a,percent:Math.round(Math.abs(100*a/t))}}}function mockScheduledRecords({amountDirection:e=s.Us.Any,stage:t,isClosingSoon:a}={}){return c.map(n=>({close_date:mockDate(a),id:(0,i.A)(),name:n,stage:mockStage(t),outdated_field_value_last_modified_date:mockDate(),...mockAmountFields(e),created_by:{},last_modified_by:{},owner:{},record_link:""}))}let u={amount:e=>({primary_sort:e,name:"Amount",type:"amount",payload_field:"amount",sort_payload_field:"amount_raw.amount"}),amountChange:e=>({primary_sort:e,name:"Amount Change",type:"delta",payload_field:"amount_change",sort_payload_field:"amount_change_raw.percent"}),closeDate:e=>({primary_sort:e,name:"Close Date",type:"date",payload_field:"close_date"}),opportunity:e=>({primary_sort:e,name:"Opportunity",type:"name",payload_field:"name"}),stage:e=>({primary_sort:e,name:"Stage",type:"stage",payload_field:"stage"}),nextStepLastUpdate:e=>({primary_sort:e,name:"Next step last update",type:"date",payload_field:"outdated_field_value_last_modified_date"})}},0x21ff11be5:(e,t,a)=>{"use strict";function shouldDisplayNotificationButton(e){return!!e?.includeMessageAddOn&&!!e?.canvasTemplateId&&!!e?.buttonText}a.d(t,{r:()=>shouldDisplayNotificationButton})},0x1bc8d2ce4:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>useBuildWorkflowDescription,SH:()=>getAdvancedOptionsConditionsString,eq:()=>getScheduleStrings,pk:()=>useGetDestinationString,x4:()=>getDestination,zV:()=>getScopeStrings});var n=a(0xbad225b5),i=a(0x1595bdd0),r=a(0x1f355b555),o=a(0x20482ad21),l=a(0x1e864b930),s=a(0x16ac9b089),c=a(0xe08dc76c),d=a(0x247cf31a2),u=a(0x71c724c8),m=a(0x1d5b32854),p=a(0x1ec69ee01),g=a(0x1ecc7f772),f=a(0x82980ab8),_=a(0x6960d8b9),h=a(0x226892387),b=a(0x217553e42),y=a(0xe684f705),x=a(0x1d104c491);let S=new o.Ay("modernselling");function getHasSpecificRolesFilter(e){return!!e?.specific&&e.filter===x.yP.Specific&&!!e.specific.length}function getHasMatchesRolesFilter(e){return!!e?.match&&e.filter===x.yP.Match&&(e.match.containsOneOf.values.length||e.match.containsNoneOf.values.length)}function getSpecificRolesString(e){return getHasSpecificRolesFilter(e)?(0,l.A)(e?.specific?.map(e=>e.name)||[],{noEscape:!0}).join(""):""}function getMatchesRolesStrings(e){let t=getHasMatchesRolesFilter(e);return{roleContains:t?(0,l.A)(e?.match?.containsOneOf.values||[],{noEscape:!0}).join(""):"",roleNotContains:t?(0,l.A)(e?.match?.containsNoneOf.values||[],{noEscape:!0}).join(""):""}}function getWeekNumString(e){let t=e.date(),a=e.daysInMonth(),n=Math.ceil(t/7);switch(n+7>a&&(n=-1),n){case 1:return S.t("first");case 2:return S.t("second");case 3:return S.t("third");case 4:return S.t("fourth");case -1:return S.t("last");default:return""}}function getScheduleStrings(e){let t,{frequency:a,startTime:n}=e,i=(0,r.Ay)(n),o=(0,_.xe)(i.toDate());switch(a){case x.Ns.daily:t=S.t("daily");break;case x.Ns.weekdays:t=S.t("every weekday (Monday to Friday)");break;case x.Ns.weekly:t=S.t("weekly on {day}",{day:(0,m.SJ)(i)});break;case x.Ns.monthly:t=S.t("{weekNum} {day} of the month",{weekNum:getWeekNumString(i),day:(0,m.SJ)(i)});break;default:t=""}return{scheduleStr:t,timeStr:o}}function getCloseDateConditionString({advancedOptions:e,closeDateDirection:t,closeDatePeriod:a}){let n,i;if(e)return"";switch(t){case c.ig.ANY:n=S.t("another");break;case c.ig.LATER:n=S.t("a future");break;case c.ig.EARLIER:n=S.t("an earlier");break;default:n=""}switch(a){case c.ts.DAYS:i=S.t("day");break;case c.ts.MONTHS:i=S.t("month");break;case c.ts.FISCAL_QUARTER:i=S.t("fiscal quarter");break;case c.ts.FISCAL_YEAR:i=S.t("fiscal year");break;default:i=""}return n&&i?S.t("the close date changed to {direction} {period}",{direction:n,period:i}):S.t("the close date changed")}function getAmountDirectionString(e){switch(e){case x.Us.Decrease:return S.t("the amount has decreased");case x.Us.Increase:return S.t("the amount has increased");default:return S.t("the amount has changed",{fallbackHash:"89b7c029d91fe61c121adc4faba6f2af9380dd0f"})}}function getTemplateConditionsString(e,t,a=!1){switch(e){case x.Lb.adminAmountChanged:case x.Lb.userAmountChanged:return getAmountDirectionString(t.amountDirection);case x.Lb.adminStageChanged:case x.Lb.userStageChanged:return S.t("the stage changed");case x.Lb.adminCloseDateChanged:case x.Lb.userCloseDateChanged:return getCloseDateConditionString(t);case x.Lb.adminNewOpportunityAlert:case x.Lb.userNewOpportunityAlert:if(a)return S.t("a new opportunity is created");return S.t("is new");case x.Lb.adminDealWon:case x.Lb.userDealWon:return S.t("the stage changed to {stage}",{stage:t.stage?.label,__handlebars:!0});default:return""}}function getCriteriaString(e){switch(e){case x.Jd.OpportunityOwnedByDirectReports:return S.t("your direct report owns the opportunity");case x.Jd.AccountOwnedByMe:return S.t("you own the account");case x.Jd.OpportunityOwnedByMe:return S.t("you own the opportunity");case x.Jd.OpportunityOwnedByAnyoneInReportChain:return S.t("owned by people who roll up to you");case x.Jd.AccountOwnedByReportChain:return S.t("on an account people who roll up to you own");default:return""}}function getScopeStrings({scope:e,criteria:t,accountName:a,opportunityName:n}){switch(e){case x.QO.SpecificAccount:return[S.t("belongs to {accountName}",{accountName:a,__handlebars:!0})];case x.QO.SpecificOpportunity:return[S.t("is {opportunityName}",{opportunityName:n,__handlebars:!0})];case x.QO.MatchCriteria:return(0,i.A)((t||[]).map(e=>getCriteriaString(e)));default:return null}}let getAdvancedOptionsConditionsString=e=>{let t=[];return e&&Object.values(e).forEach(e=>{e?.description&&t.push(e?.description)}),t};function getConditionsString(e,t,a=!1){let n=[];n.push(getTemplateConditionsString(e,t,a));let r=getScopeStrings({scope:t.scope,criteria:t.criteria,accountName:t.account?.label,opportunityName:t.opportunity?.label});if(r?.length&&n.push(...r),t.amount&&!t.advancedOptions&&n.push(S.t("is worth at least {amount}",{amount:t.amount})),t.stageChangedStages?.length&&!t.advancedOptions){let e=t.stageChangedStages.map(({label:e})=>e).join(", ");n.push(S.t("stage is equal to {stages}",{stages:e}))}return t.sendTo===x.Oz.SalesHome&&t.type===x.g$.UserOpportunityChanged&&t.excludeSelfModifications&&(e===x.Lb.userNewOpportunityAlert?n.push(S.t("you didn\u2019t create the opportunity")):n.push(S.t("you didn\u2019t make the update"))),t.advancedOptions&&n.push(...getAdvancedOptionsConditionsString(t.advancedOptions)),(0,l.A)((0,i.A)(n),{noEscape:!0}).join("")}function getRecipientOpportunityOwnerDestinationString(e){let t=getSpecificRolesString(e),{roleContains:a,roleNotContains:n}=getMatchesRolesStrings(e);return t?S.t("specific opportunity owners of applicable opportunities, including {rolesStr}",{rolesStr:(0,s.Ay)(t)}):a&&n?S.t("specific opportunity owners of applicable opportunities, including roles that contain {containsStr}, but do not contain {notContainsStr}",{containsStr:(0,s.Ay)(a),notContainsStr:(0,s.Ay)(n),fallbackHash:"b132d8afd3f486941fa552b6ebbaa1ab0656beb5"}):a&&!n?S.t("specific opportunity owners of applicable opportunities, including roles that contain {containsStr}",{containsStr:(0,s.Ay)(a),fallbackHash:"b132d8afd3f486941fa552b6ebbaa1ab0656beb5"}):!a&&n?S.t("specific opportunity owners of applicable opportunities, excluding roles that contain {notContainsStr}",{notContainsStr:(0,s.Ay)(n),fallbackHash:"b132d8afd3f486941fa552b6ebbaa1ab0656beb5"}):S.t("opportunity owners of applicable opportunities")}function getRecipientAccountOwnerDestinationString(e){let t=getSpecificRolesString(e),{roleContains:a,roleNotContains:n}=getMatchesRolesStrings(e);return t?S.t("specific account owners of applicable opportunities, including {rolesStr}",{rolesStr:(0,s.Ay)(t)}):a&&n?S.t("specific account owners of applicable opportunities, including roles that contain {containsStr}, but do not contain {notContainsStr}",{containsStr:(0,s.Ay)(a),notContainsStr:(0,s.Ay)(n),fallbackHash:"b94e01ce329e7518e9ed5764b435697b5bf10dd7"}):a&&!n?S.t("specific account owners of applicable opportunities, including roles that contain {containsStr}",{containsStr:(0,s.Ay)(a),fallbackHash:"b94e01ce329e7518e9ed5764b435697b5bf10dd7"}):!a&&n?S.t("specific account owners of applicable opportunities, excluding roles that contain {notContainsStr}",{notContainsStr:(0,s.Ay)(n),fallbackHash:"b94e01ce329e7518e9ed5764b435697b5bf10dd7"}):S.t("account owners of applicable opportunities")}function getRecipientAccountManagerChainDestinationString(e){let t=getSpecificRolesString(e),{roleContains:a,roleNotContains:n}=getMatchesRolesStrings(e);return t?S.t("specific roles that the account owner rolls up to, including {rolesStr}",{rolesStr:(0,s.Ay)(t)}):a&&n?S.t("specific roles that the account owner rolls up to, including roles that contain {containsStr}, but do not contain {notContainsStr}",{containsStr:(0,s.Ay)(a),notContainsStr:(0,s.Ay)(n)}):a&&!n?S.t("specific roles that the account owner rolls up to, including roles that contain {containsStr}",{containsStr:(0,s.Ay)(a)}):!a&&n?S.t("specific roles that the account owner rolls up to, excluding roles that contain {notContainsStr}",{notContainsStr:(0,s.Ay)(n)}):S.t("roles that the account owner rolls up to")}function getRecipientOpportunityManagerChainDestinationString(e){let t=getSpecificRolesString(e),{roleContains:a,roleNotContains:n}=getMatchesRolesStrings(e);return t?S.t("specific roles that the opportunity owner rolls up to, including {rolesStr}",{rolesStr:(0,s.Ay)(t)}):a&&n?S.t("specific roles that the opportunity owner rolls up to, including roles that contain {containsStr}, but do not contain {notContainsStr}",{containsStr:(0,s.Ay)(a),notContainsStr:(0,s.Ay)(n)}):a&&!n?S.t("specific roles that the opportunity owner rolls up to, including roles that contain {containsStr}",{containsStr:(0,s.Ay)(a)}):!a&&n?S.t("specific roles that the opportunity owner rolls up to, excluding roles that contain {notContainsStr}",{notContainsStr:(0,s.Ay)(n)}):S.t("roles that the opportunity owner rolls up to")}function getRecipientOpportunityOwnerManagerDestinationString(e){let t=getSpecificRolesString(e),{roleContains:a,roleNotContains:n}=getMatchesRolesStrings(e);return t?S.t("specific managers of opportunity owners of applicable opportunities, including {rolesStr}",{rolesStr:(0,s.Ay)(t)}):a&&n?S.t("specific managers of opportunity owners of applicable opportunities, including roles that contain {containsStr}, but do not contain {notContainsStr}",{containsStr:(0,s.Ay)(a),notContainsStr:(0,s.Ay)(n)}):a&&!n?S.t("specific managers of opportunity owners of applicable opportunities, including roles that contain {containsStr}",{containsStr:(0,s.Ay)(a)}):!a&&n?S.t("specific managers of opportunity owners of applicable opportunities, excluding roles that contain {notContainsStr}",{notContainsStr:(0,s.Ay)(n)}):S.t("managers of opportunity owners of applicable opportunities")}function getRecipientAccountOwnerManagerDestinationString(e){let t=getSpecificRolesString(e),{roleContains:a,roleNotContains:n}=getMatchesRolesStrings(e);return t?S.t("specific managers of account owners of applicable opportunities, including {rolesStr}",{rolesStr:(0,s.Ay)(t)}):a&&n?S.t("specific managers of account owners of applicable opportunities, including roles that contain {containsStr}, but do not contain {notContainsStr}",{containsStr:(0,s.Ay)(a),notContainsStr:(0,s.Ay)(n)}):a&&!n?S.t("specific managers of account owners of applicable opportunities, including roles that contain {containsStr}",{containsStr:(0,s.Ay)(a)}):!a&&n?S.t("specific managers of account owners of applicable opportunities, excluding roles that contain {notContainsStr}",{notContainsStr:(0,s.Ay)(n)}):S.t("managers of account owners of applicable opportunities")}function useGetRecipientUsersString(e){let t=(0,h.Z2)(t=>(0,y.gA)(t,e?.recipientUsers||[]).map(f.wg));return(0,n.useCallback)(()=>{if(t.length>3){let e=t.slice(0,3),a=t.length-3,n=S.t("{othersCount, plural, =1 {# other} other {# others}}",{othersCount:a});return(0,l.A)([...e,n],{noEscape:!0}).join("")}return(0,l.A)(t,{noEscape:!0}).join("")},[t])}function useGetChannelInfo(e){let t=(0,h.d4)(t=>(0,b.OL)(t,e?.channelId)),a=(0,h.d4)(e=>(0,g.SB)(e,t));return(0,n.useCallback)(()=>({name:a,memberCount:(0,p.vC)(t)}),[t,a])}function useGetDestinationString(e,t,a=!1){let i=useGetChannelInfo(t),r=useGetRecipientUsersString(t);return(0,n.useCallback)(()=>{if(!t)return"";let{sendTo:n,recipientRoles:o,recipientType:l,recipientUsers:s}=t,c=i();if(n===x.Oz.Channel&&c.name)return a&&c.memberCount?S.t("{name} ({count, plural, =1 {# member} other {# members}})",{name:c.name,count:c.memberCount}):c.name;if(l){let a=[];if(l===x._Y.User)return s?.length?r():"";switch(l){case x._Y.Owner:a.push(getRecipientOpportunityOwnerDestinationString(o));break;case x._Y.AccountOwner:a.push(getRecipientAccountOwnerDestinationString(o));break;case x._Y.AccountManagerChain:a.push(getRecipientAccountManagerChainDestinationString(o));break;case x._Y.ManagerChain:a.push(getRecipientOpportunityManagerChainDestinationString(o));break;case x._Y.OwnerManager:a.push(getRecipientOpportunityOwnerManagerDestinationString(o));break;case x._Y.AccountOwnerManager:a.push(getRecipientAccountOwnerManagerDestinationString(o))}return t.sendTo===x.Oz.SalesHome&&t.type===x.g$.AdminOpportunityChanged&&t.excludeSelfModifications&&(e===x.Lb.adminNewOpportunityAlert?a.push(S.t("excluding the person who created the opportunity")):a.push(S.t("excluding the person who made the update"))),a.join(", ")}if(t.type===x.g$.AdminReminder&&t.sendTo===x.Oz.SalesHome){let e=getSpecificRolesString(o);if(e)return e}return S.t("your sales dashboard")},[i,r,a,t,e])}let getChannel=e=>S.rt("To {channel}",{channel:n.createElement("span",{className:"sk_highlight"},n.createElement(d.A,{channelId:e}))});getChannel.displayName="getChannel";let getRecepientList=e=>S.rt("To specific people ({numberOfMembers, plural, one {# member} other {# members}}) {recepients}",{numberOfMembers:e.length,recepients:n.createElement("ul",{className:"p-sales_notifications__workflow__presentation_box__specific_people"},e.map(e=>n.createElement("li",{key:e,className:"margin_0"},n.createElement(u.Ay,{id:e,showPresence:!1}))))});getRecepientList.displayName="getRecepientList";let getDestination=({channelId:e,recipientUsers:t,recipientType:a,destinationStr:n})=>e?getChannel(e):a===x._Y.User&&t&&t?.length>0?getRecepientList(t):S.t("To {destinationText}",{destinationText:n,__handlebars:!0});function useGetReminderDescription(e,t,a=!1,i){let r=useGetDestinationString(e,t,a);return(0,n.useCallback)(()=>{if(!t||t.type===x.g$.AdminOpportunityChanged||t.type===x.g$.UserOpportunityChanged)return null;let e=r(),{timeStr:n,scheduleStr:o}=getScheduleStrings(t);if(a){let a=S.t("Scheduled {scheduleStr} at {timeStr}",{scheduleStr:o,timeStr:n});i&&(a=S.t("Scheduled {scheduleStr} at {timeStr} for {salesforceOrgName}",{scheduleStr:o,timeStr:n,salesforceOrgName:i,__handlebars:!0}));let{channelId:r,recipientUsers:l,recipientType:s}=t;return{description:a,destination:getDestination({channelId:r,recipientUsers:l,recipientType:s,destinationStr:e})}}return i?{description:S.t("Sends a reminder to {destinationStr} to update opportunities in {salesforceOrgName}. Scheduled {scheduleStr} at {timeStr}",{destinationStr:e,scheduleStr:o,timeStr:n,salesforceOrgName:i,__handlebars:!0}),destination:""}:{description:S.t("Sends a reminder to {destinationStr} to update opportunities. Scheduled {scheduleStr} at {timeStr}",{destinationStr:e,scheduleStr:o,timeStr:n,__handlebars:!0}),destination:""}},[r,a,t,i])}function useGetOpportunityChangedDescription(e,t,a=!1,i){let r=useGetDestinationString(e,t,a);return(0,n.useCallback)(()=>{if(!t)return null;let n=r(),o=getConditionsString(e,t,a);if(a){let e;if(t.isRecurring){let{timeStr:a,scheduleStr:n}=getScheduleStrings(t);e=i?S.t("Scheduled {scheduleStr} at {timeStr} for opportunities that meet these conditions: {conditionsStr} in {salesforceOrgName}",{conditionsStr:o,scheduleStr:n,timeStr:a,salesforceOrgName:i,__handlebars:!0}):S.t("Scheduled {scheduleStr} at {timeStr} for opportunities that meet these conditions: {conditionsStr}",{conditionsStr:o,scheduleStr:n,timeStr:a,__handlebars:!0})}else e=i?S.t("When {conditionsStr} in {salesforceOrgName}",{conditionsStr:o,salesforceOrgName:i,__handlebars:!0}):S.t("When {conditionsStr}",{conditionsStr:o,__handlebars:!0});let{channelId:a,recipientUsers:r,recipientType:l}=t;return{description:e,destination:getDestination({channelId:a,recipientUsers:r,recipientType:l,destinationStr:n})}}if(t.isRecurring){let{timeStr:e,scheduleStr:a}=getScheduleStrings(t);return i?{description:S.t("Scheduled {scheduleStr} at {timeStr}, send to {destinationStr} under these opportunity conditions: {conditionsStr} in {salesforceOrgName}",{conditionsStr:o,destinationStr:n,scheduleStr:a,timeStr:e,salesforceOrgName:i,__handlebars:!0}),destination:""}:{description:S.t("Scheduled {scheduleStr} at {timeStr}, send to {destinationStr} under these opportunity conditions: {conditionsStr}",{conditionsStr:o,destinationStr:n,scheduleStr:a,timeStr:e,__handlebars:!0}),destination:""}}return i?{description:S.t("Send to {destinationStr} under these opportunity conditions: {conditionsStr} in {salesforceOrgName}",{destinationStr:n,conditionsStr:o,salesforceOrgName:i,__handlebars:!0}),destination:""}:{description:S.t("Send to {destinationStr} under these opportunity conditions: {conditionsStr}",{destinationStr:n,conditionsStr:o,__handlebars:!0}),destination:""}},[r,a,t,e,i])}function useBuildWorkflowDescription(e,t,a=!1,i){let r=useGetReminderDescription(e,t,a,i),o=useGetOpportunityChangedDescription(e,t,a,i);return(0,n.useCallback)(()=>t?t?.type===x.g$.AdminReminder||t?.type===x.g$.UserReminder?r():o():null,[t,r,o])}},0x4dfa0edd:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>useBuildWorkflowPayload});var n=a(0xbad225b5),i=a(0x1db69cda),r=a(0x1595bdd0),o=a(0x1075d3a9c),l=a.n(o),s=a(0x20482ad21),c=a(0x16ac9b089),d=a(0x1853b39ce),u=a(0x1bc8d2ce4);let m=new s.Ay("modernselling");var p=a(0x66c4c9f7),g=a(0x151f56714),f=a(0x1d0dc57a0);let _=new s.Ay("modernselling");var h=a(0x7629109d);let b=new s.Ay("modernselling");var y=a(0x125c85f04),x=a(0xb0222280);let S=new s.Ay("modernselling");var A=a(0x3c7fcc66),C=a(0x6f20b262);function formatAdvancedFilterConditionsForTransmit(e){if(!e)return;let t=(0,r.A)(Object.values(e));if(t?.length)return t.filter(e=>!!e.type).map(({description:e,...t})=>{let a=t.rhs?.map(({formattedValue:e,label:t,...a})=>a);return t.type&&a?.length&&!C.EN.has(t.type)&&(a=a[0]),{...t,rhs:a}})}var w=a(0x405dcae6),E=a(0x98161168),v=a(0x1122238d8),T=a(0x124d99cb0),O=a(0x226892387),N=a(0x1c8beab7f),k=a(0x1d104c491);let getScopeFields=({scope:e,account:t})=>{let a={scope:e===k.QO.SpecificAccount?"account":e===k.QO.SpecificOpportunity?"opportunity":"all"};return"account"===e&&(a.account={id:t?.value||"",name:t?.label||""}),a};function getDayOfWeek(e){return[l()(e).locale("en").format("dddd")]}function getMonthWeekNum(e){return(0,T.Bz)(l()(e).format("YYYY-MM-DD"))??1}let getMinDealAmount=e=>null===e?void 0:(0,v.Ro)(e);function getSharedWorkflowPayload({sendTo:e,channelId:t,tokenUserId:a,title:n}){return{send_to:e,title:n,channel_id:t||void 0,token_user_id:a||void 0}}function getFrequencyPayload({frequency:e,startTime:t}){switch(e){case k.Ns.daily:return{type:"daily"};case k.Ns.weekdays:return{type:"weekly",on_days:["Monday","Tuesday","Wednesday","Thursday","Friday"]};case k.Ns.weekly:return{type:"weekly",on_days:getDayOfWeek(t)};case k.Ns.monthly:default:return{type:"monthly",on_days:getDayOfWeek(t),on_week_num:getMonthWeekNum(t)}}}function getRecipientRolesPayload(e){let t={roles:[],role_contains_none_of:[],role_contains_one_of:[]};return e?.filter===k.yP.Specific?t.roles=e.specific:(t.role_contains_none_of=e?.match.containsNoneOf.values||[],t.role_contains_one_of=e?.match.containsOneOf.values||[]),t}function getReminderTrigger(e){let{startTime:t,timezone:a}=e;return{type:"scheduled",schedule:{start_time:t,timezone:a,frequency:getFrequencyPayload(e)}}}function getRecurringTrigger(e){let{startTime:t,timezone:a}=e;return{type:"external",schedule:{start_time:t,timezone:a,frequency:getFrequencyPayload(e)}}}function getCloseDateChangePayload(e,t){let a,n;switch(e){case"LaterTemporalDirection":a=k.es.TO_FUTURE;break;case"EarlierTemporalDirection":a=k.es.TO_EARLIER;break;default:a=k.es.TO_ANOTHER}switch(t){case"FiscalYearTimePeriod":n=k.oE.FISCAL_YEAR;break;case"DaysTimePeriod":n=k.oE.DAYS;break;case"MonthsTimePeriod":n=k.oE.MONTHS;break;default:n=k.oE.FISCAL_QUARTER}return{direction:a,period:n}}function getFilteredAdvancedConditions(e){return e.map(e=>{if(e.type&&w.Xp.has(e.type)){let{rhs:t,...a}=e;return a}return e})}function setTimePeriodOperator(e){let t=(0,i.A)(e);return t&&Object.keys(t).forEach(e=>{let a=t[e];a?.type&&(C.aq.has(a.type)?a.type=C.hu.TimePeriodHasChangedTriggerCondition:C.rF.has(a.type)&&(a.type=C.hu.TimePeriodWithinTriggerCondition))}),t}let useGetSelectedOrgName=e=>{let t=(0,O.d4)(t=>e?(0,N.MH)(t):(0,N.gE)(t)),a=(0,O.d4)(N.RC),n=(0,O.d4)(N.Ey),i=(0,O.d4)(N.cc),r=(0,O.d4)(N.Kr),o=e?n?.name:i?.find(e=>e.salesforce_org_id===a)?.name,l=e?r?.find(e=>e.salesforce_org_id===t)?.name:i?.find(e=>e.salesforce_org_id===t)?.name;return(0,O.d4)(e?N.Tt:N.rm)?l:o},getRecipients=(e,t,a)=>e&&"user"!==e?{...getRecipientRolesPayload(t),relationships:[e]}:{user_ids:a||[]};function useBuildWorkflowPayload(e,t,a){let i,o,l,s,C,w,v,T,O=(0,A.iZ)(),N=(0,A.Se)(),I=a?O:N,F=(i=useGetSelectedOrgName(a),o=(0,u.Ay)(e,t,!1,i),(0,n.useCallback)(()=>{if(!t||t.type!==k.g$.AdminReminder)return null;let{canvasTemplateId:e,includeMessageAddOn:a,buttonText:n}=t,i={scope:k.QO.All};return t.sendTo===k.Oz.SalesHome&&(i.recipients=getRecipientRolesPayload(t.recipientRoles)),{...getSharedWorkflowPayload(t),trigger:getReminderTrigger(t),acn:i,description:o()?.description||"",canvas_template_id:e,message_add_on:a,button_text:n}},[o,t])),D=(l=useGetSelectedOrgName(a),s=(0,u.Ay)(e,t,!1,l),(0,n.useCallback)(()=>{if(!t||t.type!==k.g$.UserReminder)return null;let{canvasTemplateId:e,includeMessageAddOn:a,buttonText:n}=t;return{...getSharedWorkflowPayload(t),trigger:getReminderTrigger(t),description:s()?.description||"",canvas_template_id:e,message_add_on:a,button_text:n}},[s,t])),M=(C=useGetSelectedOrgName(!0),w=(0,u.Ay)(e,t,!1,C),(0,n.useCallback)(()=>{if(!t||t.type!==k.g$.AdminOpportunityChanged)return null;let{scope:a,amount:n,amountDirection:i,advancedOptions:o,opportunity:l,account:s,stage:c,sendTo:d,excludeSelfModifications:u,recipientType:m,recipientUsers:p,closeDateDirection:g,closeDatePeriod:f,includeCelebrations:_,isRecurring:h,stageChangedStages:b,canvasTemplateId:y,includeMessageAddOn:x,buttonText:S,isMutingDisabled:A,dealWinCelebrationMessageFields:C}=t,v={scope:a,stage_for_win:c?.key??void 0,is_muting_disabled:A};!o&&g&&f&&(v.close_date_condition=getCloseDateChangePayload(g,f));let T=setTimePeriodOperator(o);a===k.QO.SpecificAccount?v.account={id:s?.key,name:s?.label}:a===k.QO.SpecificOpportunity&&(v.opportunity={id:l?.key,name:l?.label});let O=T&&(0,E.V0)((0,r.A)(Object.values(T)));return O?.length?(v.advanced_conditions=getFilteredAdvancedConditions(O),e===k.Lb.adminDealWinCelebration&&(v.min_deal_amount=getMinDealAmount(n))):(v.min_deal_amount=getMinDealAmount(n),b?.length&&(v.stage_condition={stage_to:b.map(({value:e})=>e)})),i&&(v.amount_condition={direction:i}),d===k.Oz.SalesHome&&(v.exclude_self_modifications=!!u),d===k.Oz.SalesHome&&(m&&m!==k._Y.User?v.recipients={...getRecipientRolesPayload(t.recipientRoles),relationships:[m]}:v.recipients={user_ids:p||[]}),d===k.Oz.Profile&&m&&(v.recipients={...getRecipientRolesPayload(t.recipientRoles),relationships:[m]},v.exclude_self_modifications=!!u),C&&e===k.Lb.adminDealWinCelebration&&(v.deal_win_celebration_message_fields=C),{...getSharedWorkflowPayload(t),datasource_id:I,trigger:h?getRecurringTrigger(t):{type:"external"},acn:v,description:w()?.description||"",display_celebration:_,canvas_template_id:h?null:y,message_add_on:!h&&x,button_text:h?"":S}},[w,I,t,e])),R=(v=useGetSelectedOrgName(!1),T=(0,u.Ay)(e,t,!1,v),(0,n.useCallback)(()=>{if(!t||t.type!==k.g$.UserOpportunityChanged)return null;let{scope:e,amount:a,advancedOptions:n,criteria:i,opportunity:o,account:l,stage:s,sendTo:c,excludeSelfModifications:d,closeDateDirection:u,closeDatePeriod:m,includeCelebrations:p,canvasTemplateId:g}=t,f={scope:e,stage_for_win:s?.key??void 0};!n&&u&&m&&(f.close_date_condition=getCloseDateChangePayload(u,m));let _=setTimePeriodOperator(n);switch(e){case k.QO.All:f.scope=k.QO.MatchCriteria,f.criteria=[];break;case k.QO.AccountsOwnedByMe:f.scope=k.QO.MatchCriteria,f.criteria=[k.Jd.AccountOwnedByMe];break;case k.QO.AccountOwnedByReportChain:f.scope=k.QO.MatchCriteria,f.criteria=[k.Jd.AccountOwnedByReportChain];break;case k.QO.OwnedByMe:f.scope=k.QO.MatchCriteria,f.criteria=[k.Jd.OpportunityOwnedByMe];break;case k.QO.OwnedByDirectReports:f.scope=k.QO.MatchCriteria,f.criteria=[k.Jd.OpportunityOwnedByDirectReports];break;case k.QO.OwnedByReportChain:f.scope=k.QO.MatchCriteria,f.criteria=[k.Jd.OpportunityOwnedByAnyoneInReportChain];break;case k.QO.SpecificAccount:f.account={id:l?.key,name:l?.label};break;case k.QO.SpecificOpportunity:f.opportunity={id:o?.key,name:o?.label};break;case k.QO.MatchCriteria:f.criteria=i.filter(e=>e!==k.Jd.Any);break;default:return null}let h=_&&(0,E.V0)((0,r.A)(Object.values(_)));return h?.length?f.advanced_conditions=getFilteredAdvancedConditions(h):f.min_deal_amount=getMinDealAmount(a),c===k.Oz.SalesHome&&(f.exclude_self_modifications=!!d),{...getSharedWorkflowPayload(t),datasource_id:I,trigger:{type:"external"},condition:f,description:T()?.description||"",display_celebration:p,canvas_template_id:g}},[T,I,t])),L=useGetSelectedOrgName(a)||"",P=(0,u.pk)(e,t,!1)();return(0,n.useCallback)(()=>{switch(t?.type){case k.g$.AdminReminder:return F();case k.g$.UserReminder:return D();case k.g$.UserOpportunityChanged:return R();case k.g$.AdminOpportunityChanged:return M();case k.g$.AdminOutdatedFields:return(({values:e,datasourceId:t,selectedOrgName:a,destination:n})=>{if(!e||!t)return null;let{sendTo:i,title:r,channelId:o,startTime:l,timezone:s,frequency:d,scope:m,account:p,recipientType:g,recipientUsers:f,recipientRoles:_,outdatedFieldValue:x,outdatedFieldPeriod:S,outdatedFieldPeriodValue:A,advancedFilterOptions:C,isMutingDisabled:w}=e,E=getScopeFields({scope:m,account:p}),v=getRecipients(g,_,f),T=(0,y.qJ)(x,S,A),O=((e,t,a)=>{let n=(0,h.A)(e),{timeStr:i,scheduleStr:r}=(0,u.eq)(e);return(({schedule:e,time:t,destination:a,conditions:n,salesforceOrgName:i})=>b.t("Scheduled {schedule} at {time}, send to {destination} under these opportunity conditions: {conditions} in {salesforceOrgName}",{schedule:(0,c.Ay)(e),time:(0,c.Ay)(t),destination:(0,c.Ay)(a),conditions:(0,c.Ay)(n),salesforceOrgName:(0,c.Ay)(i)}))({time:i,schedule:r,salesforceOrgName:t,conditions:n,destination:a})})(e,a,n),N=C&&formatAdvancedFilterConditionsForTransmit(C);return{send_to:i,title:r,channel_id:void 0,token_user_id:void 0,datasource_id:t,trigger:{type:"external",schedule:{start_time:l,timezone:s,frequency:getFrequencyPayload({frequency:d,startTime:l})}},acn:{...E,recipients:v,outdated_field_condition:T,advanced_filter_conditions:N||void 0,is_muting_disabled:w},description:O}})({values:t,datasourceId:I,selectedOrgName:L,destination:P});case k.g$.AdminClosingSoon:return(({values:e,datasourceId:t,selectedOrgName:a,destination:n})=>{if(!e||!t)return null;let{sendTo:i,title:r,channelId:o,startTime:l,timezone:s,frequency:g,scope:f,account:_,recipientType:h,recipientUsers:b,recipientRoles:y,closingIn:x,advancedFilterOptions:S,isMutingDisabled:A}=e,C=getScopeFields({scope:f,account:_}),w=getRecipients(h,y,b),E=(0,p.T)(x),v=((e,t,a)=>{let n=(0,d.a)(e),{timeStr:i,scheduleStr:r}=(0,u.eq)(e);return(({schedule:e,time:t,destination:a,conditions:n,salesforceOrgName:i})=>m.t("Scheduled {schedule} at {time}, send to {destination} under these opportunity conditions: {conditions} in {salesforceOrgName}",{schedule:(0,c.Ay)(e),time:(0,c.Ay)(t),destination:(0,c.Ay)(a),conditions:(0,c.Ay)(n),salesforceOrgName:(0,c.Ay)(i)}))({time:i,schedule:r,salesforceOrgName:t,conditions:n,destination:a})})(e,a,n),T=S&&formatAdvancedFilterConditionsForTransmit(S);return{send_to:i,title:r,channel_id:void 0,token_user_id:void 0,datasource_id:t,trigger:{type:"external",schedule:{start_time:l,timezone:s,frequency:getFrequencyPayload({frequency:g,startTime:l})}},acn:{...C,recipients:w,closing_soon_condition:E,advanced_filter_conditions:T||void 0,is_muting_disabled:A},description:v}})({values:t,datasourceId:I,selectedOrgName:L,destination:P});case k.g$.AdminMissingFields:return(({values:e,datasourceId:t,selectedOrgName:a,destination:n})=>{if(!e||!t)return null;let{sendTo:i,title:r,channelId:o,startTime:l,timezone:s,frequency:d,scope:m,account:p,recipientType:h,recipientUsers:b,recipientRoles:y,missingField:x,advancedFilterOptions:S,isMutingDisabled:A}=e,C=getScopeFields({scope:m,account:p}),w=getRecipients(h,y,b),E=(0,g.l)(x),v=((e,t,a)=>{let n=(0,f.v)(e),{timeStr:i,scheduleStr:r}=(0,u.eq)(e);return(({schedule:e,time:t,destination:a,conditions:n,salesforceOrgName:i})=>_.t("Scheduled {schedule} at {time}, send to {destination} under these opportunity conditions: {conditions} in {salesforceOrgName}",{schedule:(0,c.Ay)(e),time:(0,c.Ay)(t),destination:(0,c.Ay)(a),conditions:(0,c.Ay)(n),salesforceOrgName:(0,c.Ay)(i)}))({time:i,schedule:r,salesforceOrgName:t,conditions:n,destination:a})})(e,a,n),T=formatAdvancedFilterConditionsForTransmit(S);return{send_to:i,title:r,channel_id:void 0,token_user_id:void 0,datasource_id:t,trigger:{type:"external",schedule:{start_time:l,timezone:s,frequency:getFrequencyPayload({frequency:d,startTime:l})}},acn:{...C,recipients:w,missing_field_condition:E,advanced_filter_conditions:T,is_muting_disabled:A},description:v}})({values:t,datasourceId:I,selectedOrgName:L,destination:P});case k.g$.AdminPastCloseDate:return(({values:e,datasourceId:t,selectedOrgName:a,destination:n})=>{if(!e||!t)return null;let{sendTo:i,title:r,channelId:o,startTime:l,timezone:s,frequency:d,scope:m,account:p,recipientType:g,recipientUsers:f,recipientRoles:_,advancedFilterOptions:h,isMutingDisabled:b}=e,y=getScopeFields({scope:m,account:p}),A=getRecipients(g,_,f),C=((e,t,a)=>{let n=(0,x.s)(e),{timeStr:i,scheduleStr:r}=(0,u.eq)(e);return(({schedule:e,time:t,destination:a,conditions:n,salesforceOrgName:i})=>S.t("Scheduled {schedule} at {time}, send to {destination} under these opportunity conditions: {conditions} in {salesforceOrgName}",{schedule:(0,c.Ay)(e),time:(0,c.Ay)(t),destination:(0,c.Ay)(a),conditions:(0,c.Ay)(n),salesforceOrgName:(0,c.Ay)(i)}))({time:i,schedule:r,salesforceOrgName:t,conditions:n,destination:a})})(e,a,n),w=formatAdvancedFilterConditionsForTransmit(h);return{send_to:i,title:r,channel_id:void 0,token_user_id:void 0,datasource_id:t,trigger:{type:"external",schedule:{start_time:l,timezone:s,frequency:getFrequencyPayload({frequency:d,startTime:l})}},acn:{...y,recipients:A,advanced_filter_conditions:w,is_muting_disabled:b},description:C}})({values:t,datasourceId:I,selectedOrgName:L,destination:P});default:return null}},[t,F,D,R,M,I,L,P])}},0x3c7fcc66:(e,t,a)=>{"use strict";a.d(t,{Se:()=>useGetSelectedDatasourceIdForSearchForUser,UE:()=>useGetSelectedSalesforceOrgIdForSearchForAdmin,iZ:()=>useGetSelectedDatasourceIdForSearchForAdmin,mi:()=>useGetSelectedSalesforceOrgIdForSearchForUser});var n=a(0x226892387),i=a(0x1c8beab7f);let useGetSelectedDatasourceIdForSearchForAdmin=()=>{let e=!!(0,n.d4)(e=>(0,i.DY)(e,!0)),t=(0,n.d4)(i.e$),a=(0,n.d4)(e=>(0,i.iN)(e)?.datasource_id);return e?a:t},useGetSelectedDatasourceIdForSearchForUser=()=>{let e=!!(0,n.d4)(e=>(0,i.DY)(e,!1)),t=(0,n.d4)(i.ZQ)?.datasource_id,a=(0,n.d4)(e=>(0,i.cw)(e)?.datasource_id);return e?a:t},useGetSelectedSalesforceOrgIdForSearchForAdmin=()=>{let e=!!(0,n.d4)(e=>(0,i.DY)(e,!0)),t=(0,n.d4)(i.rg),a=(0,n.d4)(i.MH);return e?a:t},useGetSelectedSalesforceOrgIdForSearchForUser=()=>{let e=!!(0,n.d4)(e=>(0,i.DY)(e,!1)),t=(0,n.d4)(i.ZQ)?.salesforce_org_id,a=(0,n.d4)(e=>(0,i.cw)(e)?.salesforce_org_id);return e?a:t}},0x133aee58f:(e,t,a)=>{"use strict";a.d(t,{A:()=>useGetSelectedSalesforceOrgIdForSearch});var n=a(0x226892387),i=a(0x1c8beab7f);function useGetSelectedSalesforceOrgIdForSearch(e=!1){let t=!!(0,n.d4)(t=>(0,i.DY)(t,e)),a=(0,n.d4)(i.rg),r=(0,n.d4)(i.RC),o=(0,n.d4)(e?i.MH:i.gE);return t?o:e?a:r}},0x173712bc0:(e,t,a)=>{"use strict";a.d(t,{A:()=>useIsEditWorkflow});var n=a(0x226892387),i=a(0x1c8beab7f);function useIsEditWorkflow(e=!1){return!!(0,n.d4)(t=>(0,i.DY)(t,e))}},0x10490d62c:(e,t,a)=>{"use strict";a.d(t,{A:()=>useMuteNotification});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x20482ad21),o=a(0x6e87d4ec),l=a(0xe874a88a),s=a(0x22a29f141),c=a(0x1dfdeb1c8),d=a(0x1ec68d6a3),u=a(0xe747dd27);let m=(0,c.A)("salesHome.notifications.mutePrefs.update generated fetcher",(e,t,a)=>new l.S((n,i)=>{let{abortSignal:r,reason:o,...l}=a,c=(0,u.VA)(l);e((0,s.apiCall)({method:"salesHome.notifications.mutePrefs.update",args:c,abortSignal:r,reason:o})).then(e=>{n(e)}).catch(e=>{(0,d.default)({getState:t}).error(`API call to salesHome.notifications.mutePrefs.update with reason ${o} failed, initiated by generated fetcher`),i(e)})}));m.meta={name:"salesHomeNotificationsMutePrefsUpdateFetcher",key:"createFetcherSalesHomeNotificationsMutePrefsUpdateFetcher",description:"salesHome.notifications.mutePrefs.update generated fetcher"};var p=a(0x16ffed5ab);let g=new r.Ay("modernselling");function useMuteNotification(){let e=(0,i.wA)(),t=(0,n.useCallback)(t=>{e((0,p.M)({element:n.createElement(o.A,{svgIconProps:{name:"check"}},t?g.t("Notification muted. You\u2019ll stop receiving notifications with these conditions."):g.t("Notification unmuted"))}))},[e]);return(0,n.useCallback)(async(a,n)=>{await e(m({workflowId:a,isMuted:n,reason:"sales-notifications"})),t(n)},[e,t])}useMuteNotification.displayName="useMuteNotification"},0x1aa0ab2cd:(e,t,a)=>{"use strict";a.d(t,{i:()=>useOpenAdminSetup});var n=a(0xbad225b5),i=a(0x1b955e8fc),r=a(0xd896af8a),o=a(0x226892387),l=a(0x1c8beab7f);function useOpenAdminSetup(){let e=(0,o.d4)(l.e$),t=(0,i.A)();return(0,n.useCallback)(()=>{t(r.b.MapFields,{selectedSalesforceOrgDatasourceId:e})},[t,e])}},0x1e85f5284:(e,t,a)=>{"use strict";a.d(t,{A:()=>useOpenDeleteNotificationModal});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0xca924ee1),o=a(0x20482ad21),l=a(0x6e87d4ec),s=a(0x40c0d834),c=a(0x2b7f0bcc),d=a(0x11a296110),u=a(0xce378727),m=a(0x20e80190e),p=a(0x3711e82d),g=a(0x1fcbb004d),f=a(0xd2ed875e),_=a(0x11c82607b),h=a(0x16b708a7f);let b=(0,_.Ay)("Delete sales notification Workflow",(e,t,{workflowId:a})=>e((0,f.a)({workflowId:a,reason:"delete-workflow-function"})).then(()=>{e((0,h.HC)({workflowId:a}))}).catch(()=>e((0,h.in)({workflowId:a}))));b.meta={name:"deleteSalesNotificationWorkflowFunction",key:"createThunkDeleteSalesNotificationWorkflowFunction",description:"Delete sales notification Workflow"};let y=new o.Ay("modernselling"),x={elementName:"delete_notification",onClick:{enableClogAction:!0}},NotificationDeleteModal=({workflow:e,onDelete:t})=>{let a=(0,i.wA)(),[r,o]=(0,n.useState)(!1),[l,f]=(0,n.useState)(!1),_=(0,n.useCallback)(()=>{a((0,g.O)()),f(!1)},[a]),h=(0,n.useCallback)(()=>{let n=e.id;o(!0),a(b({workflowId:n})).then(()=>{t(n),o(!1),a((0,g.O)())}).catch(()=>{f(!0),o(!1)})},[a,e,t]);return n.createElement(s.A,{eventId:p.EventId.LOB_NOTIFICATIONS,uiComponentName:p.UiComponentName.LOB_NOTIFICATIONS_LIST,workflowId:e.id},n.createElement(m.dW,{closeModal:_},n.createElement(m.rQ,null,n.createElement(m.Rc,{title:y.t("Delete Notification?")})),n.createElement(m.$m,null,n.createElement(m.qf,null,l?n.createElement(c.Ay,{type:"boxed",level:"error",className:"margin_bottom_150"},y.rt("Oops\u2026 we had trouble deleting this notification")):null,n.createElement("p",null,y.rt("{name} will be deleted from this list and will stop sending notifications. This can\u2019t be undone.",{name:e.title})))),n.createElement(m.jl,null,n.createElement(m.ox,null,n.createElement(d.Ay,{onClick:_,type:"outline"},y.t("Cancel")),n.createElement(u.A,{onClick:h,type:"danger",loading:r,autoClogProps:x,"aria-label":y.t("Delete Notification {name}",{name:e.title})},y.t("Delete Notification"))))))};NotificationDeleteModal.displayName="NotificationDeleteModal";var S=a(0x46dbff89),A=a(0x16ffed5ab);let C=new o.Ay("modernselling");function useOpenDeleteNotificationModal(){let e=(0,i.wA)(),t=(0,n.useCallback)(t=>{e((0,A.M)({element:n.createElement(l.A,null,C.rt("Successfully deleted notification {name}",{name:t}))}))},[e]);return(0,n.useCallback)((a,i)=>{let o=(0,r.A)(()=>{i?.(a.id),t(a.title)});e((0,S.q)({element:n.createElement(NotificationDeleteModal,{workflow:a,onDelete:o})}))},[e,t])}useOpenDeleteNotificationModal.displayName="useOpenDeleteNotificationModal"},0x23cb9e36f:(e,t,a)=>{"use strict";a.d(t,{A:()=>useSaveNotificationTemplate});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x4dfa0edd),o=a(0x62accd6b),l=a(0x1122238d8),s=a(0x75bda81e),c=a(0x226892387),d=a(0x1c8beab7f),u=a(0x10d5ee185);function useSaveNotificationTemplate(e,t){let a=(0,i.wA)(),m=(0,o.Ht)(e),p=(0,l.g1)(e),g=(0,r.Ay)(e,m,p),f=(0,c.d4)(e=>(0,d.DY)(e,p)),_=(0,c.d4)(d.rg),h=(0,c.d4)(d.RC);return(0,n.useCallback)(async({reason:e})=>{let n=g();if(!n)throw Error("Invalid workflow type. Missing payload.");f?await a((0,s.m)({workflowId:f,reason:e,payload:n})):await a((0,u._)({templateId:t,reason:e,payload:n,...p&&{salesforceOrgId:_},...!p&&h&&{salesforceOrgId:h}}))},[g,a,t,f,_,h,p])}},0x12e380801:(e,t,a)=>{"use strict";a.d(t,{d:()=>useStageForClosedSetUpRequired});var n=a(0x226892387),i=a(0x1c8beab7f);function useStageForClosedSetUpRequired(){let e=(0,n.d4)(i.i$),t=e?.field_mappings.find(e=>"stage"===e.target),a=t?.source.values?.stage_closed;return(e?.source.sfdc_object_identifier!=="Opportunity"||t?.source.sfdc_field_identifier!=="StageName")&&(!a||a?.length===0)}},0x1235cf4a4:(e,t,a)=>{"use strict";a.d(t,{A:()=>useValidatedDescription});var n=a(0xbad225b5),i=a(0x3ebf4390),r=a(0x1bc8d2ce4),o=a(0x62accd6b),l=a(0x91728dda),s=a(0x226892387),c=a(0x1c8beab7f);function useValidatedDescription(e,t=!1,a=!1){let d=(0,s.d4)(l.Jx),u=(0,s.d4)(l.V$),m=(0,o.Ht)(e),p=(0,s.d4)(c.RC),g=(0,s.d4)(c.Ey),f=(0,s.d4)(c.cc),_=(0,s.d4)(c.Kr),h=a?g?.name:f.find(e=>e.salesforce_org_id===p)?.name,b=(0,s.d4)(e=>a?(0,c.MH)(e):(0,c.gE)(e)),y=a?_?.find(e=>e.salesforce_org_id===b)?.name:f?.find(e=>e.salesforce_org_id===b)?.name,x=(0,s.d4)(a?c.Tt:c.rm),S=(0,r.Ay)(e,m,t,x?y:h);return(0,n.useMemo)(()=>(0,i.cB)(e,m,{experimentLobOrg62UnrestrictedGroupOn:d,experimentLobChannelAcnTokenGroupOn:u}).ok?S():null,[e,m,d,u,S])}},0x237e57f1d:(e,t,a)=>{"use strict";a.d(t,{K:()=>useAdvancedOptionsFieldData});var n=a(0xbad225b5),i=a(0x17b887603),r=a(0x1aa941557),o=a(0x205f4fb61),l=a(0x13d4e5f52),s=a(0x405dcae6),c=a(0x98161168),d=a(0x6f20b262),u=a(0x1122238d8),m=a(0x91728dda),p=a(0xe08dc76c),g=a(0x226892387);let f={[p.ig.ANY]:d.hu.TimePeriodToAnotherTriggerCondition,[p.ig.LATER]:d.hu.TimePeriodToFutureTriggerCondition,[p.ig.EARLIER]:d.hu.TimePeriodToEarlierTriggerCondition};function useAdvancedOptionsFieldData({opportunitySchema:e,isAllowedSchemaType:t=i.A,amount:a,stages:_,closeDateDirection:h,closeDatePeriod:b,isAdmin:y,isRecurring:x,workflowView:S,shouldDefaultToBlankOptions:A=!1}){let C=(0,g.d4)(m.sw),w=(0,n.useMemo)(()=>(e?.fields||[]).filter(({is_active:e,type:a})=>!1!==e&&!!s._h[a]&&t(a)),[e,t]),E=(0,n.useMemo)(()=>(0,r.A)(w,"id"),[w]),v=(0,l.q)("amount",e,y),T=(0,l.q)("close_date",e,y),O=(0,l.q)("stage",e,y);return{fieldOptions:(0,n.useMemo)(()=>{let e=[];return v&&e.push(v),T&&e.push(T),O&&e.push(O),(0,c.D0)(w,e)},[v,T,w,O]),fieldSchemaById:E,defaultCondition:(0,n.useMemo)(()=>{let e=(0,c.Gv)();if(!v||A)return[e];let t=x&&C?[]:[(0,c.kp)(v,{...(0,c.Gv)(),type:d.hu.GreaterThanTriggerCondition,schema_field_id:v.id,rhs:[{type:d.Yf.DoubleNumber,value:(0,u.Ro)(a),formattedValue:(0,o.ZV)((0,u.Ro)(a))}]})];return S&&x&&(0,u.Xk)(S)&&C&&t.unshift((0,c.kp)(v,{...(0,c.Gv)(),type:d.hu.GreaterThanTriggerCondition,schema_field_id:v.id,rhs:[{type:d.Yf.DoubleNumber,value:0,formattedValue:(0,o.ZV)(0)}]})),T&&h&&b&&t.unshift((0,c.kp)(T,{...(0,c.Gv)(),schema_field_id:T.id,type:f[h],rhs:[{type:d.Yf.TimePeriodChange,period:{type:b,num:1},direction:{type:h},operator:{type:p.Kr.AT_LEAST}}]})),_&&O&&t.unshift((0,c.kp)(O,{...(0,c.Gv)(),type:d.hu.EqualsTriggerCondition,schema_field_id:O.id,rhs:_.map(e=>({type:d.Yf.Select,value:e.value}))})),t},[a,v,h,b,T,A,_,O,x,S,C])}}},0x9a7ccd79:(e,t,a)=>{"use strict";a.d(t,{Cj:()=>getAdvancedOptionsOperatorLabels,Lb:()=>useAdvancedOptionsOperators,XG:()=>getAdvancedOptionsTemporalFrameLabels,Zs:()=>getAdvancedOptionsTemporalFrameValue,hn:()=>getAdvancedOptionsTimePeriodPeriodLabels});var n=a(0xbad225b5),i=a(0x17b887603),r=a(0x1595bdd0),o=a(0x20482ad21),l=a(0x6f20b262),s=a(0x1122238d8),c=a(0xe08dc76c),d=a(0x1d104c491);let u=new o.Ay("modernselling");function getAdvancedOptionsOperatorLabels(){return{[l.hu.ContainsTriggerCondition]:u.t("contains"),[l.hu.DoesNotContainTriggerCondition]:u.t("does not contain"),[l.hu.DoesNotEqualTriggerCondition]:u.t("does not equal"),[l.hu.EndsWithTriggerCondition]:u.t("ends with"),[l.hu.EqualsTriggerCondition]:u.t("is equal to"),[l.hu.GreaterThanTriggerCondition]:u.t("is greater than"),[l.hu.HasChangedTriggerCondition]:u.t("has changed"),[l.hu.HasDecreasedTriggerCondition]:u.t("has decreased"),[l.hu.HasIncreasedTriggerCondition]:u.t("has increased"),[l.hu.IsEmptyTriggerCondition]:u.t("is empty"),[l.hu.IsNotEmptyTriggerCondition]:u.t("is not empty"),[l.hu.LessThanTriggerCondition]:u.t("is less than"),[l.hu.SetContainsAllOfTriggerCondition]:u.t("contains all of"),[l.hu.SetContainsNoneOfTriggerCondition]:u.t("contains none of"),[l.hu.SetContainsOneOfTriggerCondition]:u.t("contains one of"),[l.hu.SetEqualsTriggerCondition]:u.t("is exactly all of"),[l.hu.SetNotEqualsTriggerCondition]:u.t("is not exactly all of"),[l.hu.StartsWithTriggerCondition]:u.t("starts with"),[l.hu.TimePeriodToAnotherTriggerCondition]:u.t("has changed to another"),[l.hu.TimePeriodToFutureTriggerCondition]:u.t("has changed to future"),[l.hu.TimePeriodToEarlierTriggerCondition]:u.t("has changed to earlier"),[l.hu.TimePeriodIsMoreThanTriggerCondition]:u.t("has changed at least by"),[l.hu.TimePeriodIsLessThanTriggerCondition]:u.t("has changed at most by"),[l.hu.TimePeriodIsEqualToTriggerCondition]:u.t("has changed by"),[l.hu.TimePeriodCurrentTriggerCondition]:u.t("is within"),[l.hu.TimePeriodBeforeTriggerCondition]:u.t("is before"),[l.hu.TimePeriodAfterTriggerCondition]:u.t("is after"),[l.hu.ContainsFilterCondition]:u.t("contains"),[l.hu.DoesNotContainFilterCondition]:u.t("does not contain"),[l.hu.DoesNotEqualFilterCondition]:u.t("does not equal"),[l.hu.EndsWithFilterCondition]:u.t("ends with"),[l.hu.EqualsFilterCondition]:u.t("is equal to"),[l.hu.GreaterThanFilterCondition]:u.t("is greater than"),[l.hu.IsEmptyFilterCondition]:u.t("is empty"),[l.hu.IsNotEmptyFilterCondition]:u.t("is not empty"),[l.hu.LessThanFilterCondition]:u.t("is less than"),[l.hu.SetEqualsFilterCondition]:u.t("is exactly all of"),[l.hu.SetNotEqualsFilterCondition]:u.t("is not exactly all of"),[l.hu.StartsWithFilterCondition]:u.t("starts with"),[l.hu.DateOffsetEqualsFilterCondition]:"",[l.hu.DateOffsetGreaterThanFilterCondition]:"",[l.hu.DateOffsetLessThanFilterCondition]:""}}function getAdvancedOptionsTemporalFrameValue(e,t){if(!t)return;let a=t.direction?.type,n=t.period?.num;switch(e){case l.hu.TimePeriodBeforeTriggerCondition:if(a===c.ig.EARLIER&&2===n)return c.kH.Previous;if(a===c.ig.EARLIER&&1===n)return c.kH.Current;if(a===c.ig.LATER&&0===n)return c.kH.Next;break;case l.hu.TimePeriodAfterTriggerCondition:if(a===c.ig.LATER&&0===n)return c.kH.Previous;if(a===c.ig.LATER&&1===n)return c.kH.Current;if(a===c.ig.LATER&&2===n)return c.kH.Next;break;case l.hu.TimePeriodCurrentTriggerCondition:if(a===c.ig.EARLIER&&1===n)return c.kH.Previous;if(a===c.ig.ANY&&0===n)return c.kH.Current;if(a===c.ig.LATER&&1===n)return c.kH.Next}}function getAdvancedOptionsTemporalFrameLabels(){return{[c.kH.Previous]:u.t("last"),[c.kH.Current]:u.t("this"),[c.kH.Next]:u.t("next")}}function getAdvancedOptionsTimePeriodPeriodLabels(e=!1){return e?{[c.ts.FISCAL_QUARTER]:u.t("fiscal quarters"),[c.ts.FISCAL_YEAR]:u.t("fiscal years"),[c.ts.DAYS]:u.t("days"),[c.ts.MONTHS]:u.t("months")}:{[c.ts.FISCAL_QUARTER]:u.t("fiscal quarter"),[c.ts.FISCAL_YEAR]:u.t("fiscal year"),[c.ts.DAYS]:u.t("day"),[c.ts.MONTHS]:u.t("month")}}function getTimePeriodOperatorList(e){return[{label:u.t("Value"),value:"",options:[{key:l.hu.TimePeriodBeforeTriggerCondition,value:l.hu.TimePeriodBeforeTriggerCondition,label:e[l.hu.TimePeriodBeforeTriggerCondition]},{key:l.hu.TimePeriodAfterTriggerCondition,value:l.hu.TimePeriodAfterTriggerCondition,label:e[l.hu.TimePeriodAfterTriggerCondition]},{key:l.hu.TimePeriodCurrentTriggerCondition,value:l.hu.TimePeriodCurrentTriggerCondition,label:e[l.hu.TimePeriodCurrentTriggerCondition]},{key:l.hu.IsEmptyTriggerCondition,value:l.hu.IsEmptyTriggerCondition,label:e[l.hu.IsEmptyTriggerCondition]},{key:l.hu.IsNotEmptyTriggerCondition,value:l.hu.IsNotEmptyTriggerCondition,label:e[l.hu.IsNotEmptyTriggerCondition]}]},{label:u.t("Change"),value:"",options:[{key:l.hu.HasChangedTriggerCondition,value:l.hu.HasChangedTriggerCondition,label:e[l.hu.HasChangedTriggerCondition]},{key:l.hu.TimePeriodToAnotherTriggerCondition,value:l.hu.TimePeriodToAnotherTriggerCondition,label:e[l.hu.TimePeriodToAnotherTriggerCondition]},{key:l.hu.TimePeriodToFutureTriggerCondition,value:l.hu.TimePeriodToFutureTriggerCondition,label:e[l.hu.TimePeriodToFutureTriggerCondition]},{key:l.hu.TimePeriodToEarlierTriggerCondition,value:l.hu.TimePeriodToEarlierTriggerCondition,label:e[l.hu.TimePeriodToEarlierTriggerCondition]},{key:l.hu.TimePeriodIsMoreThanTriggerCondition,value:l.hu.TimePeriodIsMoreThanTriggerCondition,label:e[l.hu.TimePeriodIsMoreThanTriggerCondition]}]}]}function getAmountOperatorList(e){return[{label:u.t("Value"),value:"",options:[{key:l.hu.GreaterThanTriggerCondition,value:l.hu.GreaterThanTriggerCondition,label:e[l.hu.GreaterThanTriggerCondition]},{key:l.hu.LessThanTriggerCondition,value:l.hu.LessThanTriggerCondition,label:e[l.hu.LessThanTriggerCondition]},{key:l.hu.EqualsTriggerCondition,value:l.hu.EqualsTriggerCondition,label:e[l.hu.EqualsTriggerCondition]},{key:l.hu.DoesNotEqualTriggerCondition,value:l.hu.DoesNotEqualTriggerCondition,label:e[l.hu.DoesNotEqualTriggerCondition]},{key:l.hu.IsEmptyTriggerCondition,value:l.hu.IsEmptyTriggerCondition,label:e[l.hu.IsEmptyTriggerCondition]},{key:l.hu.IsNotEmptyTriggerCondition,value:l.hu.IsNotEmptyTriggerCondition,label:e[l.hu.IsNotEmptyTriggerCondition]}]},{label:u.t("Change"),value:"",options:[{key:l.hu.HasChangedTriggerCondition,value:l.hu.HasChangedTriggerCondition,label:e[l.hu.HasChangedTriggerCondition]},{key:l.hu.HasIncreasedTriggerCondition,value:l.hu.HasIncreasedTriggerCondition,label:e[l.hu.HasIncreasedTriggerCondition]},{key:l.hu.HasDecreasedTriggerCondition,value:l.hu.HasDecreasedTriggerCondition,label:e[l.hu.HasDecreasedTriggerCondition]}]}]}function useAdvancedOptionsOperators(e,t,a=i.A,o=!1){let l=(0,n.useMemo)(()=>Object.keys(t||{}).filter(a),[a,t]),c=(0,n.useMemo)(()=>getAdvancedOptionsOperatorLabels(),[]);return(0,n.useMemo)(()=>{if(e===d.gI.DateSchemaField&&!o){let e=getTimePeriodOperatorList(c);return[l.join("-"),e]}if(e===d.gI.CurrencySchemaField&&!o)return[l.join("-"),getAmountOperatorList(c)];let t=(0,r.A)(l.map(e=>{let t=c[e];return t?{key:e,value:e,label:t}:null}));return[l.join("-"),t.sort(s.JC)]},[e,l,c,o])}},0x13d4e5f52:(e,t,a)=>{"use strict";a.d(t,{q:()=>useOpportunitySchemaField});var n=a(0xbad225b5),i=a(0x200c38ed8);function useOpportunitySchemaField(e,t,a){let r=(0,i.aV)(),o=(0,i.jv)(),l=a?r:o;return(0,n.useMemo)(()=>{if(!l||!e||!t)return null;let a=l.field_mappings?.find(t=>t.target===e),n=a?.source?.troops_schema_field_id;return n?t?.fields?.find?.(e=>e?.id===n)??null:null},[e,t,l])}},0x3bf6c48:(e,t,a)=>{"use strict";a.d(t,{hz:()=>useFetchListViewSfdcObjects,E:()=>useFetchOpportunitySchema,b1:()=>useFetchWithLoadStateOnMount});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x1d01572a2),o=a(0xe874a88a),l=a(0x3c7fcc66),s=a(0x133aee58f),c=a(0x200c38ed8),d=a(0x226892387),u=a(0x1c8beab7f),m=a(0x1216bc813),p=a(0x22a29f141),g=a(0x1dfdeb1c8),f=a(0x1ec68d6a3),_=a(0xe747dd27);let h=(0,g.A)("sfdc.getListViews generated fetcher",(e,t,a)=>new o.S((n,i)=>{let{abortSignal:r,reason:o,...l}=a,s=(0,_.VA)(l);e((0,p.apiCall)({method:"sfdc.getListViews",args:s,abortSignal:r,reason:o})).then(e=>{n(e)}).catch(e=>{(0,f.default)({getState:t}).error(`API call to sfdc.getListViews with reason ${o} failed, initiated by generated fetcher`),i(e)})}));h.meta={name:"sfdcGetListViewsFetcher",key:"createFetcherSfdcGetListViewsFetcher",description:"sfdc.getListViews generated fetcher"};var b=a(0x231dcfd36);let y=(0,a(0x11c82607b).Ay)("Fetches a set of SFDC objects related to a list view, given a list view label",async(e,t,{sobjectApiName:a,listViewLabel:n,sortByColumnKey:i,salesforceOrgId:r,asIntegrationUser:o})=>{try{let t=await e(h({sobjectApiName:a,reason:"modern-selling",...r&&{salesforceOrgId:r},asIntegrationUser:o})),l=t?.listviews?.find?.(e=>e?.label===n)?.id??null;if(!l)return null;let{objects:s}=await e((0,b.a)({reason:"modern-selling",listviewId:l,sortByColumnKey:i,...r&&{salesforceOrgId:r},asIntegrationUser:o}));return s||null}catch{return null}});function useFetchListViewSfdcObjects({isAdmin:e}={}){let t=(0,i.wA)(),a=(0,s.A)(e);return(0,n.useCallback)(async(n,i,r)=>t(y({sobjectApiName:n,listViewLabel:i,sortByColumnKey:r,salesforceOrgId:a,asIntegrationUser:e})),[t,a,e])}function useFetchOpportunitySchema({isAdmin:e}={}){let t=(0,i.wA)(),a=(0,c.aV)(),r=(0,c.jv)(),o=(e?a:r)?.source.troops_schema_object_id,s=(0,l.iZ)(),p=(0,l.Se)(),g=e?s:p,f=(0,l.UE)(),_=(0,l.mi)(),h=e?f:_,b=(0,d.d4)(u.UU);return(0,n.useCallback)(async()=>{try{if(b||!o)return null;return await t((0,m.g)({objectId:o,...g?{datasourceId:g}:void 0,salesforceOrgId:h??""}))}catch{return null}},[b,o,t,g,h])}function useFetchWithLoadStateOnMount(e){let t=(0,n.useRef)(e),[a,i]=(0,n.useState)(()=>({error:null,payload:null,isLoading:!0}));(0,n.useEffect)(()=>{t.current=e});let l=(0,n.useCallback)(()=>{o.S.resolve().then(t.current).then(e=>i({error:null,payload:e,isLoading:!1})).catch(e=>i({error:e,payload:null,isLoading:!1}))},[]),s=(0,n.useCallback)(()=>{i(e=>({...e,error:null,isLoading:!0})),l()},[l]);return(0,r.A)(()=>l()),(0,n.useMemo)(()=>({...a,retry:s}),[a,s])}y.meta={name:"fetchSfdcObjectsForListView",key:"createThunkFetchSfdcObjectsForListView",description:"Fetches a set of SFDC objects related to a list view, given a list view label"}},0x2b3a07cf:(e,t,a)=>{"use strict";a.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var n=a(0xbad225b5),i=a(0xb77a689a),r=a(0xf4930165),o=a(0xca924ee1),l=a(0x1d01572a2),s=a(0x3ebf4390),c=a(0x62accd6b),d=a(0x91728dda),u=a(0x226892387);function getMaybeDefaultedValue(e,t){return(0,i.A)(t)&&""===t.trim()?e:t}let __WEBPACK_DEFAULT_EXPORT__=function({workflowView:e,initialValues:t}){let[a,i]=(0,n.useState)(t),m=(0,n.useRef)(t),p=(0,n.useRef)(t),g=(0,c.sn)(e),f=(0,c.kR)(e),_=(0,c.HC)(e),h=(0,u.d4)(d.Jx),b=(0,u.d4)(d.V$);(0,l.A)(()=>{f({values:t,errors:(0,r.A)(t,()=>s.Un),formSubmitError:null})});let y=(0,n.useCallback)((e,t)=>i(a=>{let n=a[e]===t?a:{...a,[e]:t};return p.current=n,n}),[]),x=(0,n.useMemo)(()=>(0,o.A)(e=>t=>_({errors:{[e]:t}})),[_]),S=(0,n.useMemo)(()=>(0,o.A)((e,t=!0)=>a=>{y(e,a);let n={values:{[e]:a}};t&&(n.errors={[e]:s.Un}),_(n)}),[y,_]),A=(0,n.useMemo)(()=>(0,o.A)(t=>a=>{let n=a?.target&&"value"in a.target?getMaybeDefaultedValue(m.current?.[t],a?.target?.value):p.current[t],i=(0,s.g7)(e,t,n,p.current,{experimentLobOrg62UnrestrictedGroupOn:h,experimentLobChannelAcnTokenGroupOn:b}),r={errors:{[t]:i}};n!==p.current[t]&&(r.values={[t]:n}),y(t,n),_(r)}),[e,h,b,y,_]);return(0,n.useMemo)(()=>({values:a,errors:g||{},handleBlur:A,handleChange:S,setFieldErrors:x}),[a,g,A,S,x])}},0x62accd6b:(e,t,a)=>{"use strict";a.d(t,{HC:()=>useUpdateWorkflowFormState,Ht:()=>useWorkflowFormValues,kR:()=>useSetWorkflowFormState,sn:()=>useWorkflowFormErrors});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x226892387),o=a(0x16b708a7f),l=a(0x1c8beab7f);function useWorkflowFormValues(e){return(0,r.wz)(t=>e?(0,l.C1)(t,e):null)}function useWorkflowFormErrors(e){return(0,r.rY)(t=>e?(0,l.dl)(t,e):null)}function useSetWorkflowFormState(e){let t=(0,i.wA)();return(0,n.useCallback)(a=>{t((0,o.a2)({...a,workflowView:e}))},[t,e])}function useUpdateWorkflowFormState(e){let t=(0,i.wA)();return(0,n.useCallback)(a=>{t((0,o.jK)({workflowView:e,...a}))},[t,e])}},0x5702a22c:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>p});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x20482ad21),o=a(0x19709d5e1),l=a(0x20061cab9),s=a(0x5b1935a6),c=a(0x16b708a7f),d=a(0x1d104c491);let u=a.p+"bell_hero-b735f46.svg",m=new r.Ay("modernselling"),NotificationSettingsBanner=()=>{let e=(0,i.wA)(),t=(0,n.useCallback)(()=>{e((0,c.yK)({workflowView:d.Lb.userSelectNotificationType}))},[e]),a=(0,n.useCallback)(()=>{e((0,l.Ay)({spaceName:s.xu.SALES_HOME_NOTIFICATION_SETTINGS_HEADER,action:s.hw.DISMISS}))},[e]);return n.createElement("div",{className:"flex_shrink_none"},n.createElement(o.H,{backgroundColor:"lagoon",showBanner:!0,onCloseBanner:a,title:m.t("Streamline sales work with custom notifications"),content:m.t("Sales grow when work flows in Slack. Stay on top of all the important details with actionable reminders, alerts, and notifications about your key accounts and opportunities."),primaryImgSrc:u,primaryCTAButtonText:m.t("Create New Notification"),primaryCTAOnClick:t}))};NotificationSettingsBanner.displayName="NotificationSettingsBanner";let p=NotificationSettingsBanner},0x18a2f4bff:(e,t,a)=>{"use strict";a.r(t),a.d(t,{NotificationSettingsPage:()=>NotificationSettingsPage});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x1d01572a2),o=a(0x20482ad21),l=a(0xb9dbe72d),s=a(0x16f1d7d2b),c=a(0xd171ec55),d=a(0x24c2c2673),u=a(0x1ee39de0b),m=a(0x18ee6860e),p=a(0x11a296110),g=a(0x4c8d8a39),f=a(0x16caa8075),_=a(0xcf06bcff),h=a(0x404d43c5),b=a(0xd0e3a30d),y=a(0x212a2c2d5),x=a(0x10b410a4d),S=a(0x1ce916d0b),A=a(0x226892387),C=a(0x1c8beab7f),w=a(0x1d104c491);let WorkflowHeader=()=>{let e=(0,A.d4)(C.EH);return e===w.Lb.userAmountChanged?n.createElement(f.A,null):e===w.Lb.userCloseDateChanged?n.createElement(_.A,null):e===w.Lb.userDealWon?n.createElement(h.A,null):e===w.Lb.userNewOpportunityAlert?n.createElement(y.A,null):e===w.Lb.userForecastReminder?n.createElement(b.A,null):e===w.Lb.userStageChanged?n.createElement(x.A,null):e===w.Lb.userSelectNotificationType?n.createElement(S.A,null):null};WorkflowHeader.displayName="WorkflowHeader";var E=a(0x16b708a7f);let v=new o.Ay("modernselling"),NotificationSettingsHeader=()=>{let e=(0,A.d4)(C.EH),t=(0,i.wA)(),a=(0,n.useCallback)(()=>{t((0,E.yK)({workflowView:w.Lb.userSelectNotificationType}))},[t]);if(e)return n.createElement(WorkflowHeader,null);let r=n.createElement(p.Ay,{onClick:a},v.t("Create Notification"));return n.createElement(g.j,{title:v.t("Sales notifications"),largeTitle:!0,actions:r,showDropdownMenu:!1})};NotificationSettingsHeader.displayName="NotificationSettingsHeader";var T=a(0x14fad6485),O=a(0x40c0d834),N=a(0x11fe26014),k=a(0xb1ea448c),I=a(0x178788799),F=a(0xb90d5858),D=a(0xfe866216),M=a(0x6e87d4ec),R=a(0x1e85f5284),L=a(0x10490d62c);let P=new o.Ay("modernselling"),NotificationMuteButton=({item:e,onMuteChanged:t})=>{let a=(0,L.A)(),[i,r]=(0,n.useState)(!1),o=(0,n.useCallback)(async()=>{r(!0);try{await a(e.id,!e.isMuted),t(e.id,!e.isMuted)}catch(e){}finally{r(!1)}},[a,t,e]);return n.createElement(p.lV,{size:"small",type:"outline",loading:i,onClick:o,"aria-label":e.isMuted&&!e.isDisabled?P.t("Unmute {name}",{name:e.title}):P.t("Mute {name}",{name:e.title}),disabled:e.isDisabled},e.isMuted&&!e.isDisabled?P.t("Unmute"):P.t("Mute"))};NotificationMuteButton.displayName="NotificationMuteButton";var B=a(0x120c268ad),H=a.n(B),U=a(0xf3b0bc58),V=a(0x1f49c20b0),W=a(0xcaee4748),q=a(0x6960d8b9);let j=new o.Ay("modernselling"),LastSentAt=({ts:e})=>{let t=(0,n.useCallback)(()=>e?(0,q.cK)(e)?j.t("Last sent at {time}",{time:(0,q.xe)(e)}):j.rt("Last sent {date}",{date:(0,q.Yq)(e,"{date_short_pretty}",{shouldCapitalize:!1})}):j.t("Not yet sent"),[e]);return n.createElement("div",{className:"p-sales_notifications__list__cell__info"},t())};LastSentAt.displayName="LastSentAt";let LastUpdatedBy=({memberId:e})=>n.createElement("div",{className:"p-sales_notifications__list__cell__info"},j.rt("Last updated by {member}",{member:n.createElement(W.A,{id:e})}));LastUpdatedBy.displayName="LastUpdatedBy";let NotificationsList=({error:e,items:t,renderActions:a,showLastSentAt:i=!1,showLastUpdatedBy:r=!1})=>{let o=!!e,l=!o&&!t?.length,s=!o&&!l&&!!t?.length,c=(0,n.useCallback)(()=>n.createElement(U.A,{className:"p-sales_notifications__list__empty_state",title:j.t("There was an error loading notifications"),description:j.t("Please try refreshing your browser and let us know if this problem continues.")}),[]),d=(0,n.useCallback)(()=>n.createElement(U.A,{className:"p-sales_notifications__list__empty_state",title:j.t("You haven\u2019t set up notifications\u2026yet"),description:j.t("Go ahead! Set up your first notification and let Slack help you get work done.")}),[]);return n.createElement("div",{className:"p-sales_notifications__list"},o&&c(),l&&d(),s&&t.map(e=>n.createElement("div",{className:H()("p-sales_notifications__list__row",e.isMuted&&!e.isDisabled&&"p-sales_notifications__list__row--muted"),key:e.id},n.createElement("div",{className:"p-sales_notifications__list__cell__entity"},n.createElement(V.A,{workflow:e})),i&&n.createElement(LastSentAt,{ts:e.date_last_run}),r&&n.createElement(LastUpdatedBy,{memberId:e.last_updated_by}),n.createElement("div",{className:"p-sales_notifications__list__cell__actions"},a?.(e)))))};NotificationsList.displayName="NotificationsList";var Y=a(0x37d43f3),z=a(0xe874a88a),G=a(0x22a29f141),$=a(0x1dfdeb1c8),Q=a(0x1ec68d6a3),K=a(0xe747dd27);let J=(0,$.A)("salesHome.notifications.mutePrefs.list generated fetcher",(e,t,a)=>new z.S((n,i)=>{let{abortSignal:r,reason:o,...l}=a,s=(0,K.VA)(l);e((0,G.apiCall)({method:"salesHome.notifications.mutePrefs.list",args:s,abortSignal:r,reason:o})).then(e=>{n(e)}).catch(e=>{(0,Q.default)({getState:t}).error(`API call to salesHome.notifications.mutePrefs.list with reason ${o} failed, initiated by generated fetcher`),i(e)})}));J.meta={name:"salesHomeNotificationsMutePrefsListFetcher",key:"createFetcherSalesHomeNotificationsMutePrefsListFetcher",description:"salesHome.notifications.mutePrefs.list generated fetcher"};var Z=a(0xe4dce26f),X=a(0x1c2358c11),ee=a(0x1ed767a16),et=a(0x3711e82d),ea=a(0xcefedbca),en=a(0x16ffed5ab);let ei=new o.Ay("modernselling"),NotificationSettingsList=()=>{let{windowRef:e}=(0,n.useContext)(T._0),t=(0,i.wA)(),[a,r]=(0,n.useState)(""),o=(0,R.A)(),[l,s]=(0,n.useState)(null),[c,d]=(0,n.useState)(!1),{data:u,loading:m,error:g,refetch:f}=(0,X.L)({fetcher:Z.N,args:{reason:"ecn-sales-notifications",...a&&{salesforceOrgId:a}}}),{data:_,loading:h,error:b}=(0,X.L)({fetcher:J,args:{reason:"acn-sales-notifications",...a&&{salesforceOrgId:a}}});(0,n.useEffect)(()=>{(h&&m||m)&&d(!0)},[m,h]),(0,n.useEffect)(()=>{_?.mute_prefs?.length&&s(()=>_.mute_prefs.map(e=>({isMuted:e.is_muted,isDisabled:e.is_muting_disabled,...e.workflow})).sort((e,t)=>e.isMuted&&!t.isMuted?1:!e.isMuted&&t.isMuted?-1:0))},[_]);let y=(0,n.useCallback)(e=>{o(e,f)},[o,f]),x=(0,n.useCallback)(e=>{t((0,ea.A)({workflowId:e}))},[t]),S=(0,n.useCallback)(a=>{(0,ee.x3)(a,e.deref()),t((0,en.M)({element:n.createElement(M.A,null,ei.t("Notification ID copied to clipboard."))}))},[e,t]),A=(0,n.useCallback)((e,t)=>{let a={onClick:{enableClogAction:!0},elementName:"lob_notifications_copy_notification_id",workflowId:e.id,isLobNotificationWorkflowAdmin:!1};return n.createElement(I.Ay,{...t,width:200},n.createElement(n.Fragment,null,n.createElement(F.A,{ariaLabel:ei.t("Copy notification ID for {title}",{title:e.title}),autoClogProps:a,onSelected:()=>S(e.id)},ei.t("Copy notification ID")),n.createElement(D.Ay,null)),n.createElement(F.A,{danger:!0,onSelected:()=>y(e),ariaLabel:ei.t("Delete {title}",{title:e.title})},ei.t("Delete")))},[S,y]),C=(0,n.useCallback)(e=>{let t={onClick:{enableClogAction:!0},elementName:"lob_notifications_edit",workflowId:e.id,isLobNotificationWorkflowAdmin:!1},a=ei.t("Actions for {title}",{title:e.title}),i={onClick:{enableClogAction:!0},elementName:"lob_notifications_edit",workflowId:e.id,isLobNotificationWorkflowAdmin:!1},r={renderMenu:t=>A(e,t),width:"auto",children:n.createElement("div",null)};return n.createElement("div",{className:"display_flex justify_content_end gap_50"},!e.is_field_mappings_updated&&n.createElement(p.lV,{className:"flex_one",size:"small",type:"outline",onClick:()=>x(e.id),"aria-label":ei.t("Edit {name}",{name:e.title}),autoClogProps:t},ei.t("Edit")),n.createElement(N.A,{icon:"vertical-ellipsis",ariaLabel:a,menuProps:r,autoClogProps:i}))},[A,x]),w=(0,n.useCallback)((e,t)=>{s(a=>a?.map(a=>a.id===e?{...a,isMuted:t}:a)||null)},[]),E=(0,n.useCallback)(e=>{s([]),r(e)},[]),v=(0,n.useCallback)(e=>n.createElement(NotificationMuteButton,{item:e,onMuteChanged:w}),[w]),L=!c||m||h;return n.createElement(O.A,{eventId:et.EventId.LOB_SALES_HOME,uiComponentName:et.UiComponentName.LOB_NOTIFICATIONS_LIST},n.createElement(Y.k,{bold:!0,className:"inline_block margin_top_100",onChange:E,showAllOrgsOption:!0,shouldUpdateDefaultOrgOnChange:!1}),L&&n.createElement("div",{className:"full_width full_height display_flex align_items_center justify_content_center"},n.createElement(k.A,null)),!L&&n.createElement(n.Fragment,null,n.createElement("div",{className:"p-sales_notifications__notifications__list_section"},n.createElement("div",{className:"p-sales_notifications__notifications__list_title"},ei.t("Notifications created by you")),n.createElement(NotificationsList,{error:g,items:u?.workflows,renderActions:C,showLastSentAt:!0})),(!!l?.length||b)&&n.createElement("div",{className:"p-sales_notifications__notifications__list_section"},n.createElement("div",{className:"p-sales_notifications__notifications__list_title"},ei.t("Notifications created by admin")),n.createElement(NotificationsList,{error:b,items:l,renderActions:v,showLastUpdatedBy:!0}))))};NotificationSettingsList.displayName="NotificationSettingsList";var er=a(0x198f5e201),eo=a(0x92e81718),el=a(0x1789e94fa),es=a(0x5b1935a6);let ec=n.lazy(()=>Promise.resolve().then(a.bind(a,0x5702a22c))),ed={spaceName:es.xu.SALES_HOME_NOTIFICATION_SETTINGS_HEADER,notifications:{[es.ze.SALES_HOME_NOTIFICATIONS_SETTINGS_BANNER]:{component:ec}}};var eu=a(0x5e07c725),em=a(0xa1832ae4),ep=a(0xafce781a),eg=a(0x1ee439e69);let ef=new o.Ay("modernselling");function withDocumentTitle(e,t){return n.createElement(n.Fragment,null,n.createElement(NotificationSettingsHeader,null),n.createElement(eu.A,{title:e}),t)}withDocumentTitle.displayName="withDocumentTitle";let NotificationSettingsPage=()=>{let e=(0,i.wA)(),t=(0,A.d4)(e=>(0,em.F1)((0,eg.H7)(e))),a=(0,A.d4)(C.EH),o=(0,A.d4)(C.UY);(0,r.A)(()=>{e((0,E.yK)(null)),e((0,E.LO)()),e((0,ep.iR)({event:{type:es.jo.REQUEST_SPACES,spaces:[es.xu.SALES_HOME_NOTIFICATION_SETTINGS_HEADER]}}))});let p=ef.t("Sales - Sales notifications - {teamName} - Slack ",{teamName:t});return o?withDocumentTitle(p,n.createElement(eo.A,null)):a===w.Lb.userAmountChanged?withDocumentTitle(p,n.createElement(l.A,null)):a===w.Lb.userCloseDateChanged?withDocumentTitle(p,n.createElement(s.A,null)):a===w.Lb.userDealWon?withDocumentTitle(p,n.createElement(c.A,null)):a===w.Lb.userNewOpportunityAlert?withDocumentTitle(p,n.createElement(u.A,null)):a===w.Lb.userForecastReminder?withDocumentTitle(p,n.createElement(d.A,null)):a===w.Lb.userStageChanged?withDocumentTitle(p,n.createElement(m.A,null)):a===w.Lb.userSelectNotificationType?withDocumentTitle(p,n.createElement(er.A,null)):withDocumentTitle(p,n.createElement("div",{className:"p-sales_notifications__notifications__page"},n.createElement(el.A,ed),n.createElement("div",{className:"p-sales_notifications__notifications__body"},n.createElement(NotificationSettingsList,null))))};NotificationSettingsPage.displayName="NotificationSettingsPage"},0x1ce916d0b:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x348940af);let o=new i.Ay("modernselling"),SelectNotificationTypeHeader=({isAdmin:e=!1})=>{let t=e?o.t("Admin-created notifications"):o.t("Your active notifications");return n.createElement(r.A,{isAdmin:e,title:t})};SelectNotificationTypeHeader.displayName="SelectNotificationTypeHeader";let l=SelectNotificationTypeHeader},0x198f5e201:(e,t,a)=>{"use strict";a.d(t,{A:()=>C});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x20482ad21),o=a(0x1ea519746),l=a(0x11a296110),s=a(0x1aa0ab2cd),c=a(0x20e80190e),d=a(0x1fcbb004d);let u=new r.Ay("modernselling"),AdminSetupRequiredModal=()=>{let e=(0,i.wA)(),t=(0,n.useCallback)(()=>{e((0,d.O)())},[e]),a=(0,s.i)();return n.createElement(c.dW,{closeModal:t},n.createElement(c.rQ,null,n.createElement(c.Rc,{title:u.t("Admin setup required")})),n.createElement(c.$m,null,n.createElement(c.qf,null,n.createElement("p",null,u.t("Looks like you are using custom objects. To create this notification, please add additional stage values to ensure notifications will send as expected")))),n.createElement(c.jl,null,n.createElement(c.ox,null,n.createElement(l.Ay,{onClick:t,type:"outline"},u.t("Later")),n.createElement(l.Ay,{onClick:a,type:"primary","aria-label":u.t("Set Up")},u.t("Set Up")))))};AdminSetupRequiredModal.displayName="AdminSetupRequiredModal";var m=a(0x46dbff89);function useOpenAdminSetupRequiredModal(){let e=(0,i.wA)();return(0,n.useCallback)(()=>{e((0,m.q)({element:n.createElement(AdminSetupRequiredModal,null)}))},[e])}useOpenAdminSetupRequiredModal.displayName="useOpenAdminSetupRequiredModal";var p=a(0x12e380801),g=a(0x2501a2cee);let f=new r.Ay("modernselling"),SelectNotificationTypeButton=({imageUrl:e,title:t,details:a,onClick:i,addBadge:r=!1,requiresSetUp:o=!1})=>n.createElement(l.Nm,{className:"p-sales_notifications__select_notification_type_button",onClick:i},n.createElement("div",{className:"display_flex align_items_center"},n.createElement("img",{className:"p-sales_notifications__select_notification_type_button__image",src:e,alt:t}),n.createElement("div",{className:"p-sales_notifications__select_notification_type_button__main"},n.createElement("div",{className:"p-sales_notifications__select_notification_type_button__title"},t,n.createElement(g.Ah,{name:"caret-right",size:"20"})),n.createElement("div",{className:"p-sales_notifications__select_notification_type_button__details"},a))),r&&n.createElement("div",{className:"p-sales_notifications__select_notification_type_button_badge"},"Most popular"),o&&n.createElement("div",{className:"p-sales_notifications__select_notification_type_button_badge_admin_setup_required"},f.t("Admin setup required")));SelectNotificationTypeButton.displayName="SelectNotificationTypeButton";var _=a(0x16b708a7f),h=a(0x1d104c491);let b=a.p+"bubble-2a91bf6.svg",y=a.p+"clipboard-f9ce38b.svg",x=a.p+"megaphone-32a566a.svg";var S=a(0x86226b0b);let A=new r.Ay("modernselling"),SelectNotificationTypePage=({isAdmin:e=!1})=>{let t=(0,i.wA)(),a=(0,n.useCallback)(()=>{t((0,d.O)())},[t]),r=(0,n.useCallback)(n=>()=>{e?t((0,_.kC)({workflowView:n})):t((0,_.yK)({workflowView:n})),a()},[t,a,e]),l=e?h.Lb.adminForecastReminder:h.Lb.userForecastReminder,s=e?h.Lb.adminNewOpportunityAlert:h.Lb.userNewOpportunityAlert,c=e?h.Lb.adminAmountChanged:h.Lb.userAmountChanged,u=e?h.Lb.adminStageChanged:h.Lb.userStageChanged,m=e?h.Lb.adminCloseDateChanged:h.Lb.userCloseDateChanged,g=e?h.Lb.adminDealWon:h.Lb.userDealWon,f=(0,o.Z)(),C=useOpenAdminSetupRequiredModal(),w=(0,p.d)();return n.createElement("div",{className:"p-sales_notifications__select_notification_type__container"},n.createElement("div",{className:"p-sales_notifications__select_notification_type__container_inner"},n.createElement("div",{className:"p-sales_notifications__select_notification_type__title"},e&&A.t("Empower your team with sales insights and reminders"),!e&&A.t("Choose a template to get started")),n.createElement("div",{className:"p-sales_notifications__select_notification_type__section"},n.createElement("div",{className:"p-sales_notifications__select_notification_type__section_header"},n.createElement("div",null,n.createElement("div",{className:"p-sales_notifications__select_notification_type__section_title"},A.t("Stay informed about opportunity updates")),n.createElement("div",null,A.t("Automatically send alerts for more visibility with less overhead."))),n.createElement("img",{src:x,alt:""})),n.createElement(SelectNotificationTypeButton,{imageUrl:f(s),title:A.t("New opportunity"),details:A.t("Find out when new opportunities are added"),onClick:r(s),addBadge:!0}),n.createElement(SelectNotificationTypeButton,{imageUrl:f(c),title:A.t("Amount changed"),details:A.t("Get alerts when opportunity amounts change"),onClick:r(c)}),n.createElement(SelectNotificationTypeButton,{imageUrl:f(u),title:A.t("Stage changed"),details:A.t("Follow opportunities through the sales cycle"),onClick:r(u)}),n.createElement(SelectNotificationTypeButton,{imageUrl:f(m),title:A.t("Close date changed"),details:A.t("Keep an eye on opportunity close dates"),onClick:r(m)}),e&&n.createElement(SelectNotificationTypeButton,{imageUrl:f(g),title:A.t("Deal won",{fallbackHash:"02206b1aab8ed8b501ead50432dc8f091e382018"}),details:A.t("Make time to celebrate with your team"),onClick:r(g)})),n.createElement("div",{className:"p-sales_notifications__select_notification_type__section"},n.createElement("div",{className:"p-sales_notifications__select_notification_type__section_header"},n.createElement("div",null,n.createElement("div",{className:"p-sales_notifications__select_notification_type__section_title"},e&&A.t("Keep deals on track"),!e&&A.t("Build a winning sales culture")),n.createElement("div",null,e&&A.t("Send scheduled reminders to make sure opportunity details are accurate."),!e&&A.t("Healthy team habits start with updating forecasts and end with celebration."))),n.createElement("img",{src:e?y:b,alt:""})),!e&&n.createElement(SelectNotificationTypeButton,{imageUrl:f(g),title:A.t("Deal won"),details:A.t("Make time to celebrate with your team"),onClick:r(e?h.Lb.adminDealWon:h.Lb.userDealWon)}),n.createElement(SelectNotificationTypeButton,{imageUrl:f(l),title:A.t("Update opportunities"),details:A.t("Send a regular nudge to keep opportunity details up to date"),onClick:r(l)}),e&&n.createElement(n.Fragment,null,n.createElement(SelectNotificationTypeButton,{title:A.t("Review opportunities with out-of-date info"),details:A.t("Clean up opportunity details"),imageUrl:S,onClick:w?C:r(h.YB.adminOutdatedFields),requiresSetUp:w}),n.createElement(SelectNotificationTypeButton,{imageUrl:f(h.Lb.adminMissingFields),title:A.t("Add missing details"),details:A.t("Make sure key information is captured for every opportunity"),onClick:w?C:r(h.Lb.adminMissingFields),requiresSetUp:w}),n.createElement(SelectNotificationTypeButton,{imageUrl:f(h.Lb.adminClosingSoonAlert),title:A.t("Check upcoming close dates"),details:A.t("Make sure deals stay on track"),onClick:w?C:r(h.Lb.adminClosingSoonAlert),requiresSetUp:w}),n.createElement(SelectNotificationTypeButton,{imageUrl:f(h.Lb.adminPastCloseDateAlert),title:A.t("Review opportunities with past close dates"),details:A.t("Regain momentum on open opportunities"),onClick:w?C:r(h.Lb.adminPastCloseDateAlert),requiresSetUp:w}))),n.createElement("div",{className:"sk_foreground_high align_center"},A.t("Keep an eye on this space, we\u2019ll be adding more templates soon!"))))};SelectNotificationTypePage.displayName="SelectNotificationTypePage";let C=SelectNotificationTypePage},0x155f83bf4:(e,t,a)=>{"use strict";a.d(t,{m:()=>BooleanSchemaInput});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x15014e268),o=a(0x6f20b262);let l=new i.Ay("modernselling"),BooleanSchemaInput=({fieldSchema:e,operator:t,onBlur:a,onChange:i,value:s,error:c})=>{let d=(0,n.useMemo)(()=>c&&[c],[c]),u=(0,n.useMemo)(()=>[{value:!0,label:l.t("True")},{value:!1,label:l.t("False")}],[]),m=(0,n.useCallback)(e=>i([{type:o.Yf.BooleanValue,value:e.value}]),[i]);return n.createElement(r.Ay,{className:"full_width",key:`${e.id}-${t}`,ariaLabel:l.t("Value for {name}",{name:e.label}),errors:d,isInvalid:!!d,isRequired:!0,onOptionsListClose:a,onOptionSelected:m,options:u,placeholderText:l.t("Select a value\u2026"),selectedOption:u.find(e=>s.rhs?.[0]?.value===e.value),selectId:s.id,width:"100%"})};BooleanSchemaInput.displayName="BooleanSchemaInput"},0x2080006ef:(e,t,a)=>{"use strict";a.d(t,{W:()=>p,v:()=>m});var n=a(0xbad225b5),i=a(0x1d01572a2),r=a(0x20482ad21),o=a(0x205f4fb61),l=a(0x126f22530),s=a(0x1e586fbba),c=a(0x6f20b262),d=a(0x1122238d8);let u=new r.Ay("modernselling");function asNumericSchemaInput({type:e,getNumericValue:t,formatOptions:a}){return function({fieldSchema:r,onChange:c,error:d,value:m}){let p=(0,n.useCallback)(()=>{let n=t(+(m.rhs?.[0]?.value||0));c([{type:e,value:n,formattedValue:(0,o.Ay)(n,a)}])},[c,m.rhs]),g=(0,n.useCallback)(a=>{c([{type:e,value:t(a),formattedValue:a}])},[c]);return(0,i.A)(()=>{m.rhs?.[0]&&p()}),n.createElement("div",{className:"full_width"},n.createElement(l.A,{id:m.id,name:m.id,"aria-label":u.t("Value for {name}",{name:r.label}),onBlur:p,onChange:g,isInvalid:!!d,placeholder:u.t("Enter a value\u2026"),value:m.rhs?.[0]?.formattedValue}),d&&n.createElement(s.A,null,d.message))}}asNumericSchemaInput.displayName="asNumericSchemaInput";let m=asNumericSchemaInput({type:c.Yf.DoubleNumber,getNumericValue:e=>(0,d.Ro)(e,!0),formatOptions:{minimumFractionDigits:0,maximumFractionDigits:9}}),p=asNumericSchemaInput({type:c.Yf.LongInt,getNumericValue:e=>(0,d.Ro)(e,!1)})},0x200abc41e:(e,t,a)=>{"use strict";a.d(t,{_:()=>ReferenceFieldSchemaInputMulti});var n=a(0xbad225b5),i=a(0x1595bdd0),r=a(0x1407c6c2c),o=a(0x20482ad21),l=a(0x16cf1da63),s=a(0xe874a88a),c=a(0x3c7fcc66),d=a(0x1122238d8),u=a(0x28d59ea1);function toSchemaObject(e){if(!e.schema_object_id||!e.schema_object_label)return null;let t=(e.records||[]).map(e=>({key:e.identifier,value:e.identifier,label:e.name})).sort(d.JC);return{key:`${e.schema_object_id}`,value:e.schema_object_label,label:e.schema_object_label,options:t}}function useFieldReferencesSearch({id:e,schema_object_id:t}={},a){let r=(0,l.wA)(),o=(0,c.iZ)(),m=(0,c.Se)(),p=a?o:m;return(0,n.useCallback)((n="")=>{let o=n&&n.length>=3;return p&&e&&t&&o?r((0,u.J)({query:n,datasourceId:p,fieldId:e,reason:"modern-selling",schemaObjectId:t,asIntegrationUser:a})).then(({results:e})=>(0,i.A)(e?.flatMap(toSchemaObject)).sort(d.JC)):s.S.resolve([])},[p,r,e,t,a])}var m=a(0x6f20b262),p=a(0x18a03595d),g=a(0x4a120eb2);a(0xa9a7442);let f=new o.Ay("modern_selling");function getEmptyStateMessage(e){return(e?.length||0){let c=(0,n.useMemo)(()=>l&&[l],[l]),u=useFieldReferencesSearch(e,s),_=(0,r.A)(),h=(0,n.useCallback)(e=>getEmptyStateMessage(e),[]),b=(0,n.useCallback)(e=>{a(e.map(({label:e,value:t})=>({type:m.Yf.ReferenceValue,label:`${e}`,identifier:t})))},[a]),y=(0,n.useMemo)(()=>(0,i.A)(o?.rhs?.map(d.AS)),[o?.rhs]);return n.createElement(g.x,{ariaLabel:f.t("Values for {name}",{name:e.label}),className:"full_width",classPrefix:"p-sales_notifications__workflow__form__field__advanced_options__select",debounceWaitPeriod:p.Vp,disableSearchOnMount:!0,emptyStateMessage:h,errors:c,isInvalid:!!c?.length,isRequired:!0,minOptionsListWidth:350,onBlur:t,onSelectedItemsChange:b,placeholderText:f.t("Search\u2026"),search:u,selectedOptions:y,selectId:_,width:"100%"})};ReferenceFieldSchemaInputMulti.displayName="ReferenceFieldSchemaInputMulti"},0x423b2bde:(e,t,a)=>{"use strict";a.d(t,{a:()=>SelectSchemaInput,j:()=>MultiSelectSchemaInput});var n=a(0xbad225b5),i=a(0x1595bdd0),r=a(0x1407c6c2c),o=a(0x20482ad21),l=a(0xa7ec93c2),s=a(0x1d1911997),c=a(0x6f20b262),d=a(0x1122238d8);let u=new o.Ay("modernselling"),SelectSchemaInput=({error:e,fieldSchema:t,onBlur:a,onChange:i,value:o,operator:l})=>{let m=(0,r.A)(),p=(0,n.useMemo)(()=>e&&[e],[e]),g=(0,n.useMemo)(()=>(0,d.I_)(t),[t]),f=(0,n.useCallback)(e=>i([{type:c.Yf.Select,value:e.value}]),[i]);return n.createElement(s.Ay,{key:`${t.id}-${l}`,ariaLabel:u.t("Value for {name}",{name:t.label}),minOptionsListWidth:200,errors:p,isRequired:!0,onBlur:a,onOptionSelected:f,options:g,placeholderText:u.t("Select a value\u2026"),selectedOption:g?.find(e=>e.value===o.rhs?.[0]?.value),selectId:m})};SelectSchemaInput.displayName="SelectSchemaInput";let MultiSelectSchemaInput=({error:e,fieldSchema:t,onBlur:a,onChange:o,value:s})=>{let m=(0,r.A)(),p=(0,n.useMemo)(()=>e&&[e],[e]),g=(0,n.useMemo)(()=>(0,d.I_)(t),[t]),f=(0,n.useCallback)(e=>{o(e.map(e=>({type:c.Yf.Select,value:e.value})))},[o]),[_,h]=(0,n.useMemo)(()=>{let e=(0,i.A)(g?.filter(e=>s?.rhs?.find(t=>e.value===t.value)));return[e.map(e=>e.label).join("-"),e]},[s?.rhs,g]);return n.createElement(l.Ay,{className:"full_width",key:_,ariaLabel:u.t("Values for {name}",{name:t.label}),disableIdParsing:!0,errors:p,expandOnFocus:!0,isInvalid:!!p?.length,isRequired:!0,onBlur:a,onSelectedItemsChange:f,options:g,placeholderText:u.t("Select a value\u2026"),selectedOptions:h,selectId:m,shouldAllowUnselectInMultiSelectMode:!0,width:"100%"})};MultiSelectSchemaInput.displayName="MultiSelectSchemaInput"},0x1450587d7:(e,t,a)=>{"use strict";a.d(t,{IW:()=>_,jq:()=>f,sq:()=>g});var n=a(0xbad225b5),i=a(0x120c268ad),r=a.n(i),o=a(0x854f5389),l=a(0x1d01572a2),s=a(0x20482ad21),c=a(0x205f4fb61),d=a(0x6f20b262),u=a(0x1122238d8),m=a(0xb214261e);let p=new s.Ay("modernselling");function tokenize(e){return(e.rhs||[]).filter(e=>e.value||0===e.value).map(e=>`${e.formattedValue??e.value}`)}function getTokenizedInput({inputValueType:e,formatRawValue:t=o.A,formatDisplayValue:a=o.A}){return function({error:i,fieldSchema:o,onBlur:s,onChange:c,value:d}){let u=(0,n.useMemo)(()=>tokenize(d),[d]),[g,f]=(0,n.useState)(""),_=(0,n.useCallback)(n=>{c(n.map(n=>({type:e,value:t(n),formattedValue:a(n)})))},[c]),h=(0,n.useCallback)((e,t,a)=>{_(e),f(t),a&&s?.()},[s,_]);(0,l.A)(()=>{u.length&&_(u)});let b=i?.message?"p-sales_notifications__workflow__form__advanced_options__field__input__tokenized--invalid":void 0;return n.createElement(m.G,{className:r()("full_width",b),ariaLabel:p.t("Values for {name}",{name:o.label}),errorMessage:i?.message,isInvalid:!!i,onBlur:s,onChange:h,tokenizedItems:u,tokenizeOnBlur:!0,placeholderText:p.t("Enter a value\u2026"),untokenizedText:g})}}getTokenizedInput.displayName="getTokenizedInput";let g=getTokenizedInput({inputValueType:d.Yf.StringValue}),f=getTokenizedInput({inputValueType:d.Yf.LongInt,formatRawValue:u.Ro,formatDisplayValue:e=>(0,c.Ay)((0,u.Ro)(e))}),_=getTokenizedInput({inputValueType:d.Yf.DoubleNumber,formatRawValue:e=>(0,u.Ro)(e,!0),formatDisplayValue:e=>(0,c.Ay)((0,u.Ro)(e,!0),{minimumFractionDigits:0,maximumFractionDigits:9})})},0x405dcae6:(e,t,a)=>{"use strict";a.d(t,{_h:()=>P,Xp:()=>T,K5:()=>validateAdvancedCondition});var n=a(0x20482ad21),i=a(0x155f83bf4),r=a(0x2080006ef),o=a(0x200abc41e),l=a(0x423b2bde),s=a(0xbad225b5),c=a(0x120c268ad),d=a.n(c),u=a(0x1db69cda),m=a(0xc6a2c86f),p=a(0x126f22530),g=a(0x9a7ccd79),f=a(0x6f20b262),_=a(0xd7a36639),h=a(0x26f5f245),b=a(0x1122238d8),y=a(0xe08dc76c);let x=new Set([f.hu.TimePeriodIsMoreThanTriggerCondition,f.hu.TimePeriodIsLessThanTriggerCondition,f.hu.TimePeriodIsEqualToTriggerCondition]),S=new Set([f.hu.TimePeriodBeforeTriggerCondition,f.hu.TimePeriodAfterTriggerCondition,f.hu.TimePeriodCurrentTriggerCondition]),A=new Set([y.ts.MONTHS,y.ts.FISCAL_QUARTER,y.ts.FISCAL_YEAR]),C=new Set([y.ts.DAYS,y.ts.MONTHS,y.ts.FISCAL_QUARTER,y.ts.FISCAL_YEAR]);function getTimePeriodRhs(e,t,a=!1){let n=(0,u.A)(t);if(n?.direction&&n?.period&&n?.operator&&n.type===f.Yf.TimePeriodChange)switch(e){case f.hu.TimePeriodToAnotherTriggerCondition:n.direction.type=y.ig.ANY,n.operator.type=y.Kr.AT_LEAST,n.period.num=1;break;case f.hu.TimePeriodToFutureTriggerCondition:n.direction.type=y.ig.LATER,n.operator.type=y.Kr.AT_LEAST,n.period.num=1;break;case f.hu.TimePeriodToEarlierTriggerCondition:n.direction.type=y.ig.EARLIER,n.operator.type=y.Kr.AT_LEAST,n.period.num=1;break;case f.hu.TimePeriodIsMoreThanTriggerCondition:n.direction.type=y.ig.ANY,n.operator.type=y.Kr.AT_LEAST;break;case f.hu.TimePeriodIsLessThanTriggerCondition:n.direction.type=y.ig.ANY,n.operator.type=y.Kr.AT_MOST;break;case f.hu.TimePeriodIsEqualToTriggerCondition:n.direction.type=y.ig.ANY,n.operator.type=y.Kr.EXACT;break;case f.hu.TimePeriodBeforeTriggerCondition:a||(n.direction.type=y.ig.EARLIER,n.operator.type=y.Kr.AT_LEAST,n.period.num=1);break;case f.hu.TimePeriodAfterTriggerCondition:a||(n.direction.type=y.ig.LATER,n.operator.type=y.Kr.AT_LEAST,n.period.num=1);break;case f.hu.TimePeriodCurrentTriggerCondition:a||(n.direction.type=y.ig.ANY,n.operator.type=y.Kr.EXACT,n.period.num=0)}return n}let TimePeriodChangeSchemaInput=({error:e,onBlur:t,onChange:a,value:n,operator:i})=>{let r=(0,s.useMemo)(()=>e&&[e],[e]),o=(0,m.A)(i),[l,c]=(0,s.useState)({type:f.Yf.TimePeriodChange,period:{type:y.ts.FISCAL_QUARTER,num:1},direction:{type:y.ig.ANY},operator:{type:y.Kr.AT_LEAST}}),w=x.has(i),E=S.has(i),v=(0,s.useCallback)(e=>a([e]),[a]);(0,s.useEffect)(()=>{if(i===o)return;let e=!!(i&&!o),t=getTimePeriodRhs(i,n.rhs?.[0]||l,e);c(t),v(t)},[n,i,o,l,v]);let T=(0,s.useCallback)(e=>{let t=(0,u.A)(l);t.period&&(t.period.type=e),c(t),v(t)},[l,v]),O=(0,s.useCallback)(e=>{let t=(0,u.A)(l);t.period&&(t.period.num=e),c(t),v(t)},[l,v]),N=(0,s.useCallback)(()=>{let e=(0,u.A)(l);if(e.period){let t=(0,b.Ro)(e.period.num,!1);e.period.num=Math.min(Math.max(t,1),365)}c(e),v(e)},[l,v]),k=(0,s.useCallback)(e=>{let t=(0,u.A)(l);if(t.period)switch(i){case f.hu.TimePeriodBeforeTriggerCondition:e===y.kH.Previous?(t.operator={type:y.Kr.AT_LEAST},t.direction={type:y.ig.EARLIER},t.period.num=2):e===y.kH.Current?(t.operator={type:y.Kr.AT_LEAST},t.direction={type:y.ig.EARLIER},t.period.num=1):e===y.kH.Next&&(t.operator={type:y.Kr.AT_MOST},t.direction={type:y.ig.LATER},t.period.num=0);break;case f.hu.TimePeriodAfterTriggerCondition:t.operator={type:y.Kr.AT_LEAST},t.direction={type:y.ig.LATER},e===y.kH.Previous?t.period.num=0:e===y.kH.Current?t.period.num=1:e===y.kH.Next&&(t.period.num=2);break;case f.hu.TimePeriodCurrentTriggerCondition:t.operator={type:y.Kr.EXACT},e===y.kH.Previous?(t.direction={type:y.ig.EARLIER},t.period.num=1):e===y.kH.Current?(t.direction={type:y.ig.ANY},t.period.num=0):e===y.kH.Next&&(t.direction={type:y.ig.LATER},t.period.num=1)}c(t),v(t)},[v,i,l]);return s.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},w&&s.createElement(p.A,{className:"p-sales_notifications__workflow__form__advanced_options__field__input__fixed",id:n.id,type:"number",name:n.id,onBlur:N,onChange:O,isInvalid:!!e,value:l.period?.num,min:1,max:365}),E&&s.createElement(_.A,{onChange:k,temporalFrame:(0,g.Zs)(i,l)}),s.createElement(h.A,{className:d()(E&&"p-sales_notifications__workflow__form__advanced_options__field__input__fixed"),timePeriods:E?A:C,errors:r,selectedTimePeriod:l.period?.type,onChange:T,onBlur:t,periodNum:E?1:l.period?.num}))};TimePeriodChangeSchemaInput.displayName="TimePeriodChangeSchemaInput";var w=a(0x1450587d7),E=a(0x1d104c491);let v=new n.Ay("modernselling"),Null=()=>null,T=new Set([f.hu.HasChangedTriggerCondition,f.hu.HasDecreasedTriggerCondition,f.hu.HasIncreasedTriggerCondition,f.hu.IsEmptyTriggerCondition,f.hu.IsNotEmptyTriggerCondition,f.hu.IsEmptyFilterCondition,f.hu.IsNotEmptyFilterCondition]),O={[f.hu.HasChangedTriggerCondition]:Null},N={[f.hu.HasIncreasedTriggerCondition]:Null,[f.hu.HasDecreasedTriggerCondition]:Null},k={[f.hu.IsNotEmptyTriggerCondition]:Null},I={[f.hu.EqualsTriggerCondition]:w.sq,[f.hu.DoesNotEqualTriggerCondition]:w.sq,[f.hu.ContainsTriggerCondition]:w.sq,[f.hu.DoesNotContainTriggerCondition]:w.sq,[f.hu.StartsWithTriggerCondition]:w.sq,[f.hu.EndsWithTriggerCondition]:w.sq},F={[f.hu.EqualsTriggerCondition]:w.IW,[f.hu.DoesNotEqualTriggerCondition]:w.IW,[f.hu.GreaterThanTriggerCondition]:r.v,[f.hu.LessThanTriggerCondition]:r.v},D={[f.hu.EqualsTriggerCondition]:w.jq,[f.hu.DoesNotEqualTriggerCondition]:w.jq,[f.hu.GreaterThanTriggerCondition]:r.W,[f.hu.LessThanTriggerCondition]:r.W},M={[f.hu.SetContainsOneOfTriggerCondition]:l.j,[f.hu.SetContainsAllOfTriggerCondition]:l.j,[f.hu.SetContainsNoneOfTriggerCondition]:l.j,[f.hu.SetEqualsTriggerCondition]:l.j,[f.hu.SetNotEqualsTriggerCondition]:l.j},R={[f.hu.TimePeriodBeforeTriggerCondition]:TimePeriodChangeSchemaInput,[f.hu.TimePeriodAfterTriggerCondition]:TimePeriodChangeSchemaInput,[f.hu.TimePeriodCurrentTriggerCondition]:TimePeriodChangeSchemaInput},L={[f.hu.TimePeriodIsEqualToTriggerCondition]:TimePeriodChangeSchemaInput,[f.hu.TimePeriodIsLessThanTriggerCondition]:TimePeriodChangeSchemaInput,[f.hu.TimePeriodIsMoreThanTriggerCondition]:TimePeriodChangeSchemaInput,[f.hu.TimePeriodToAnotherTriggerCondition]:TimePeriodChangeSchemaInput,[f.hu.TimePeriodToEarlierTriggerCondition]:TimePeriodChangeSchemaInput,[f.hu.TimePeriodToFutureTriggerCondition]:TimePeriodChangeSchemaInput};function getBaseComponents(e){return{...O,...e.is_nullable?k:{}}}function getSelectFieldSetOperators(e){return e.is_multi_select?M:{[f.hu.EqualsTriggerCondition]:l.j,[f.hu.DoesNotEqualTriggerCondition]:l.a}}let P={[E.gI.DateSchemaField]:(e,{isSemanticPrevious:t})=>t?R:{...R,...L,...O},[E.gI.DateTimeSchemaField]:()=>O,[E.gI.BooleanSchemaField]:e=>({[f.hu.EqualsTriggerCondition]:i.m,[f.hu.DoesNotEqualTriggerCondition]:i.m,...getBaseComponents(e)}),[E.gI.ReferenceSchemaField]:e=>({[f.hu.EqualsTriggerCondition]:o._,[f.hu.DoesNotEqualTriggerCondition]:o._,...getBaseComponents(e)}),[E.gI.CurrencySchemaField]:(e,{isSemanticPrevious:t})=>t?F:{...F,...N,...getBaseComponents(e)},[E.gI.DoubleSchemaField]:e=>({...F,...N,...getBaseComponents(e)}),[E.gI.LongSchemaField]:e=>({...D,...N,...getBaseComponents(e)}),[E.gI.StringSchemaField]:e=>({...I,...getBaseComponents(e)}),[E.gI.EmailSchemaField]:e=>({...I,...getBaseComponents(e)}),[E.gI.URLSchemaField]:e=>({...I,...getBaseComponents(e)}),[E.gI.SelectSchemaField]:(e,{isSemanticPrevious:t})=>t?getSelectFieldSetOperators(e):{...getSelectFieldSetOperators(e),...getBaseComponents(e)}};function hasValidRHS({type:e,rhs:t}){return!!(e&&T.has(e))||!!e&&!!t?.length&&t.every(e=>null!=e)}function validateAdvancedCondition(e,t=["field","operator","value"]){let a=[],n=v.t("This field is required.");return t.includes("field")&&null==e.schema_field_id&&a.push({id:e.id,location:"field",message:n}),t.includes("operator")&&!e.type&&a.push({id:e.id,location:"operator",message:n}),t.includes("value")&&!hasValidRHS(e)&&a.push({id:e.id,location:"value",message:n}),a.length?a:null}},0x98161168:(e,t,a)=>{"use strict";a.d(t,{D0:()=>toFieldSchemaOptions,Gv:()=>getNewAdvancedCondition,V0:()=>formatAdvancedConditionsForTransmit,kp:()=>withConditionDescription,w_:()=>getResolvedSchemaLabel});var n=a(0x1595bdd0),i=a(0x20482ad21),r=a(0x2172ff7ff),o=a(0x12edaa96a),l=a(0x9a7ccd79),s=a(0x405dcae6),c=a(0x6f20b262),d=a(0x1122238d8);let u=new i.Ay("modernselling");function getResolvedSchemaLabel(e,t=!1){let a=e.relationships?.find(e=>e.is_active),n=a?.relationship_label??a?.relationship_name??e.label??e.identifier;return t?u.t("Last {label}",{label:n}):n}function toSelectOptionFromFieldSchema(e){return e&&e.id?{key:`${e.id}`,value:e.id,label:getResolvedSchemaLabel(e),extras:{isPrevious:!1,fieldId:e.id}}:null}function toSemanticPreviousSelectOptionFromFieldSchema(e){return{key:`previous-${e.id}`,value:`previous-${e.id}`,label:getResolvedSchemaLabel(e,!0),extras:{isPrevious:!0,fieldId:e.id}}}function toFieldSchemaOptions(e=[],t=[]){let a=e.map(toSelectOptionFromFieldSchema),i=t.map(toSemanticPreviousSelectOptionFromFieldSchema);return(0,n.A)([...a,...i]).sort(d.JC)}function getNewAdvancedCondition(){return{id:(0,o.A)()}}function getAdvancedConditionDescription(e,t){if(!t.type)return"";let a=[],i=(0,l.Cj)()[t.type]||"";if(c.aq.has(t.type)){let e=t.rhs?.[0].period;if(!e)return"";let n=!1;e.num>1&&(n=!0);let i=(0,l.hn)(n)[e.type]||"";switch(t.type){case c.hu.TimePeriodIsMoreThanTriggerCondition:case c.hu.TimePeriodIsLessThanTriggerCondition:case c.hu.TimePeriodIsEqualToTriggerCondition:null!=i&&a.push(`${e.num} ${i}`);break;default:null!=i&&a.push(`${i}`)}}else if(c.rF.has(t.type)){let e=t.rhs?.[0].period,n=t.rhs?.[0].direction?.type;if(!e||!n)return"";let i=(0,l.hn)()[e.type],r=(0,l.Zs)(t.type,t.rhs?.[0]);if(r&&i){let e=(0,l.XG)()[r];a.push(`${e} ${i}`)}}else if(!s.Xp.has(t.type))for(let{formattedValue:e,value:n,label:i}of t.rhs||[]){let t=e??n??i;null!=t&&a.push(`${t}`)}let o=a.sort(r.Ay).join(", "),d=t.semantics?.current_or_previous==="previous";return(0,n.A)([`${getResolvedSchemaLabel(e,d)}`,i,o]).join(" ")}function withConditionDescription(e,t){return e?{...t,description:getAdvancedConditionDescription(e,t)}:t}function formatAdvancedConditionsForTransmit(e){return e.map(e=>({...e,rhs:e.rhs?.map(({formattedValue:e,...t})=>t)}))}},0x6f20b262:(e,t,a)=>{"use strict";a.d(t,{EN:()=>r,Yf:()=>n,aq:()=>o,hu:()=>i,rF:()=>l});let n={Empty:"empty",StringValue:"StringValue",UnknownValue:"UnknownValue",DoubleNumber:"DoubleNumber",LongInt:"LongInt",BooleanValue:"BooleanValue",ReferenceValue:"ReferenceValue",Select:"Select",IntDaysAgo:"IntDaysAgo",IntDaysAway:"IntDaysAway",RelativeChange:"RelativeChange",TimePeriodChange:"TimePeriodChange"},i={ContainsTriggerCondition:"ContainsTriggerCondition",DoesNotContainTriggerCondition:"DoesNotContainTriggerCondition",DoesNotEqualTriggerCondition:"DoesNotEqualTriggerCondition",EndsWithTriggerCondition:"EndsWithTriggerCondition",EqualsTriggerCondition:"EqualsTriggerCondition",GreaterThanTriggerCondition:"GreaterThanTriggerCondition",HasChangedTriggerCondition:"HasChangedTriggerCondition",HasDecreasedTriggerCondition:"HasDecreasedTriggerCondition",HasIncreasedTriggerCondition:"HasIncreasedTriggerCondition",IsEmptyTriggerCondition:"IsEmptyTriggerCondition",IsNotEmptyTriggerCondition:"IsNotEmptyTriggerCondition",LessThanTriggerCondition:"LessThanTriggerCondition",SetContainsAllOfTriggerCondition:"SetContainsAllOfTriggerCondition",SetContainsNoneOfTriggerCondition:"SetContainsNoneOfTriggerCondition",SetContainsOneOfTriggerCondition:"SetContainsAnyOfTriggerCondition",SetEqualsTriggerCondition:"SetEqualsTriggerCondition",SetNotEqualsTriggerCondition:"SetNotEqualsTriggerCondition",StartsWithTriggerCondition:"StartsWithTriggerCondition",TimePeriodHasChangedTriggerCondition:"TimePeriodHasChangedByTriggerCondition",TimePeriodToAnotherTriggerCondition:"TimePeriodToAnotherTriggerCondition",TimePeriodToFutureTriggerCondition:"TimePeriodToFutureTriggerCondition",TimePeriodToEarlierTriggerCondition:"TimePeriodToEarlierTriggerCondition",TimePeriodIsMoreThanTriggerCondition:"TimePeriodIsMoreThanTriggerCondition",TimePeriodIsLessThanTriggerCondition:"TimePeriodIsLessThanTriggerCondition",TimePeriodIsEqualToTriggerCondition:"TimePeriodIsEqualToTriggerCondition",TimePeriodAfterTriggerCondition:"TimePeriodAfterTriggerCondition",TimePeriodBeforeTriggerCondition:"TimePeriodBeforeTriggerCondition",TimePeriodCurrentTriggerCondition:"TimePeriodCurrentTriggerCondition",TimePeriodWithinTriggerCondition:"TimePeriodWithinTriggerCondition",ContainsFilterCondition:"ContainsFilterCondition",DateOffsetEqualsFilterCondition:"DateOffsetEqualsFilterCondition",DateOffsetGreaterThanFilterCondition:"DateOffsetGreaterThanFilterCondition",DateOffsetLessThanFilterCondition:"DateOffsetLessThanFilterCondition",DoesNotContainFilterCondition:"DoesNotContainFilterCondition",DoesNotEqualFilterCondition:"DoesNotEqualFilterCondition",EndsWithFilterCondition:"EndsWithFilterCondition",EqualsFilterCondition:"EqualsFilterCondition",GreaterThanFilterCondition:"GreaterThanFilterCondition",IsEmptyFilterCondition:"IsEmptyFilterCondition",IsNotEmptyFilterCondition:"IsNotEmptyFilterCondition",LessThanFilterCondition:"LessThanFilterCondition",SetEqualsFilterCondition:"SetEqualsFilterCondition",SetNotEqualsFilterCondition:"SetNotEqualsFilterCondition",StartsWithFilterCondition:"StartsWithFilterCondition"},r=new Set([i.EqualsFilterCondition,i.DoesNotEqualFilterCondition,i.SetEqualsFilterCondition,i.SetNotEqualsFilterCondition]),o=new Set([i.TimePeriodToAnotherTriggerCondition,i.TimePeriodToFutureTriggerCondition,i.TimePeriodToEarlierTriggerCondition,i.TimePeriodIsMoreThanTriggerCondition,i.TimePeriodIsLessThanTriggerCondition,i.TimePeriodIsEqualToTriggerCondition]),l=new Set([i.TimePeriodAfterTriggerCondition,i.TimePeriodBeforeTriggerCondition,i.TimePeriodCurrentTriggerCondition])},0x2c625329:(e,t,a)=>{"use strict";a.d(t,{M:()=>AllowMutingNotificationCheckbox});var n=a(0xbad225b5),i=a(0x120c268ad),r=a.n(i),o=a(0x20482ad21),l=a(0x45bd075),s=a(0x1d2cd7755);let c=new o.Ay("modernselling"),AllowMutingNotificationCheckbox=({isMutingDisabled:e,onChange:t})=>{let a=(0,n.useCallback)(e=>{t(!e.target.checked)},[t]);return n.createElement(s.A,{text:c.t("Allow recipients to mute this notification"),className:r()("p-sales_notifications__workflow__form__field"),type:"inline",cursor:"pointer"},n.createElement(l.A,{name:"allowMutingNotificationOption",checked:!e,onChange:a}))};AllowMutingNotificationCheckbox.displayName="AllowMutingNotificationCheckbox"},0x15038689e:(e,t,a)=>{"use strict";a.d(t,{A:()=>g});var n=a(0xbad225b5),i=a(0x120c268ad),r=a.n(i),o=a(0x1407c6c2c),l=a(0x20482ad21),s=a(0x205f4fb61),c=a(0x1d2cd7755),d=a(0x126f22530),u=a(0x1122238d8),m=a(0x10047bce3);let p=new l.Ay("modernselling"),AmountInput=({className:e,currency:t="USD",onBlur:a,onChange:i,value:l})=>{let g=(0,o.A)(),f=(0,n.useCallback)(e=>i(e.replace(/[^\d,]/g,"")),[i]),_=(0,n.useCallback)(e=>{let t={...e.target,value:(0,s.ZV)((0,u.Ro)(e.target?.value))};a?.({...e,target:t})},[a]);return n.createElement(c.A,{className:r()("p-sales_notifications__workflow__form__field",e),htmlFor:g,text:p.t("Minimum opportunity amount")},n.createElement(d.A,{id:g,name:"sales-home-notifications-amount-input",value:l,prefix:`${(0,m.Q)(t)} `,onBlur:_,onChange:f,isRequired:!0}))};AmountInput.displayName="AmountInput";let g=AmountInput},0x6374e095:(e,t,a)=>{"use strict";a.d(t,{e:()=>DateTimeInput});var n=a(0xbad225b5),i=a(0x1b63e435a),r=a.n(i),o=a(0x1407c6c2c),l=a(0x4bdf0df6),s=a(0x20482ad21),c=a(0x2503b7c1),d=a(0x1d2cd7755),u=a(0x1e586fbba),m=a(0x9154b87c),p=a(0x1feb18f19),g=a(0x1e217163d),f=a(0x124d99cb0),_=a(0x1b9d5cc0c),h=a(0x226892387),b=a(0x19c76d181),y=a(0xe684f705);let x=new s.Ay("workflow_builder"),DateTimeInput=({caption:e,errors:t,onBlur:a,onChange:i,required:s,timezone:S,value:A,isInWorkflowBuilder:C})=>{let w=(0,h.d4)(b.WR),E=(0,h.d4)(e=>(0,y.nv)(e,w,{preferNonExistentToNull:!1})),v=(0,_.et)(E)??l.vp,T=S||v,O=(0,n.useMemo)(()=>r().tz(T),[T]),{valueDate:N,valueTime:k}=(0,n.useMemo)(()=>{let e=(0,f.lP)(A,T);return e?.isValid()?{valueDate:e.format("YYYY-MM-DD"),valueTime:e.format("HH:mm")}:{}},[T,A]),I=(0,n.useCallback)((e,t)=>{i((0,f.lP)(`${e} ${t}`,T).toISOString()),a?.()},[i,a,T]),F=(0,n.useCallback)(e=>{N&&k&&I(e,k)},[N,I,k]),D=(0,n.useCallback)(e=>{e&&k&&N&&I(N,e)},[k,N,I]),M=(0,n.useCallback)(()=>a?.(),[a]),R=(0,o.A)();return n.createElement(g.B,{space:"50"},n.createElement(g.B,{space:"0"},n.createElement(d.A,{text:x.t("Starts on"),htmlFor:R}),n.createElement(p.c,{space:"50",alignY:"start"},n.createElement("div",{className:"flex_one"},n.createElement(c.b,{id:R,selectedDate:N,dateFormat:"YYYY-MM-DD",displayFormat:"MMMM D, YYYY",disableDatesBefore:O.format("YYYY-MM-DD"),"aria-label":x.t("Select a date"),onBlur:M,onDateChange:F,isInvalid:!!t?.length,required:s})),C&&n.createElement("span",{className:"margin_50","aria-hidden":!0},x.t("at")),n.createElement("div",{className:"flex_one"},n.createElement(m.Ay,{onBlur:M,onChange:D,width:"100%",value:k,ariaLabel:x.t("Select a time"),optionsHourIncrement:"quarter",isInvalid:!!t?.length,isRequired:s,allowCustomInput:!0,showTimeZone:!1})))),e&&n.createElement("div",{className:"caption sk_foreground_max"},e),t?.map(e=>n.createElement(u.A,{key:e.id,className:"margin_0"},e.message)))};DateTimeInput.displayName="DateTimeInput"},0x1c815ab49:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(0xbad225b5),i=a(0x12edaa96a),r=a(0x1e586fbba),o=a(0x1d1911997),l=a(0x207fb9b92);let DynamicSelect=({className:e,options:t,value:a,id:s,placeholder:c,required:d=!1,errorText:u,isInvalid:m=!1,onChange:p,...g})=>{let f=(0,n.useMemo)(()=>`${(0,i.A)()}-${t.length}`,[t]),_=(0,n.useMemo)(()=>{let e=null;return t.some(t=>!!(Array.isArray(t.options)&&(e=t.options.find(e=>e.value===a)))||t.value===a&&(e=t,!0)),e||null},[t,a]),h=(0,n.useCallback)((e={})=>p(e.value,e),[p]),{onBlur:b,errorText:y}=(0,l.K)({errorMessage:u,isErrored:m,shouldErrorPreventSave:!0});return n.createElement(n.Fragment,null,n.createElement(o.Ay,{key:f,options:t,width:"100%",selectId:s,selectedOption:_||void 0,onOptionSelected:h,placeholderText:c,isRequired:d,onBlur:b,isInvalid:!!y,...g}),!!y&&n.createElement(r.A,null,y))};DynamicSelect.displayName="DynamicSelect";let s=DynamicSelect},0x1f2c612f5:(e,t,a)=>{"use strict";a.d(t,{x:()=>FrequencySelect});var n=a(0xbad225b5),i=a(0x1075d3a9c),r=a.n(i),o=a(0x20482ad21),l=a(0x1d2cd7755),s=a(0x1c815ab49),c=a(0x124d99cb0);let d=new o.Ay("workflow_builder"),NthDay=({date:e,toLowerCase:t=!1})=>{switch((0,c.Bz)(e)){case 1:if(t)return n.createElement(n.Fragment,null,d.t("first"));return n.createElement(n.Fragment,null,d.t("First"));case 2:if(t)return n.createElement(n.Fragment,null,d.t("second"));return n.createElement(n.Fragment,null,d.t("Second"));case 3:if(t)return n.createElement(n.Fragment,null,d.t("third"));return n.createElement(n.Fragment,null,d.t("Third"));case 4:if(t)return n.createElement(n.Fragment,null,d.t("fourth"));return n.createElement(n.Fragment,null,d.t("Fourth"));case -1:if(t)return n.createElement(n.Fragment,null,d.t("last"));return n.createElement(n.Fragment,null,d.t("Last"));default:return n.createElement(n.Fragment,null,d.t("Same"))}},u=new o.Ay("workflow_builder"),m=["daily","weekdays","weekly","monthly"];function getDayString(e){return r()(e).format("dddd")}function getNthDay(e){return n.createElement(NthDay,{date:e})}function getLabels(e){return{daily:()=>u.t("Daily"),weekdays:()=>u.t("Every weekday (Monday to Friday)"),weekly:()=>u.t("Weekly on {dayOfWeek}s",{dayOfWeek:getDayString(e)}),monthly:()=>u.rt("{nthDay} {dayOfWeek} of the month",{dayOfWeek:getDayString(e),nthDay:getNthDay(e)})}}getNthDay.displayName="getNthDay";let FrequencySelect=({frequencies:e=m,isDisabled:t=!1,onChange:a,startDate:i,value:r,...o})=>{let c=(0,n.useMemo)(()=>{let t=getLabels(i);return e.map(e=>({label:t[e](),value:e}))},[e,i]);return n.createElement(l.A,{text:u.t("Frequency")},n.createElement(s.A,{options:c,ariaLabel:u.t("Please select a frequency option"),id:"frequency-select",errorText:u.t("Please select one"),value:r,onChange:a,required:!0,...o}))};FrequencySelect.displayName="FrequencySelect"},0x1655dc9c9:(e,t,a)=>{"use strict";a.d(t,{v:()=>InputGroupBox});var n=a(0xbad225b5),i=a(0xff304643),r=a.n(i);let InputGroupBox=({children:e,isWrapping:t})=>n.createElement("div",{className:t?r().inputGroupBoxWrap:r().inputGroupBox},e);InputGroupBox.displayName="InputGroupBox"},0xe1721148:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(0xbad225b5),i=a(0x120c268ad),r=a.n(i),o=a(0x1407c6c2c),l=a(0x20482ad21),s=a(0x1d2cd7755),c=a(0x126f22530);let d=new l.Ay("modernselling"),ListNameInput=({className:e,errors:t,onBlur:a,onChange:i,value:l})=>{let u=(0,o.A)();return n.createElement(s.A,{className:r()("p-sales_notifications__workflow__form__field",e),htmlFor:u,text:d.t("Name")},n.createElement(c.A,{id:u,errorText:t?.[0]?.message,name:"sales-home-notifications-list-name-input",onBlur:a,onChange:i,value:l,isRequired:!0}))};ListNameInput.displayName="ListNameInput";let u=ListNameInput},0xd00e724:(e,t,a)=>{"use strict";a.d(t,{A:()=>C});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x1407c6c2c),o=a(0x20482ad21),l=a(0x45bd075),s=a(0x1d2cd7755),c=a(0x126f22530),d=a(0xe874a88a),u=a(0x2172ff7ff),m=a(0x7f5a02e8),p=a(0x408bdeff),g=a(0x226d2c646),f=a(0xa1832ae4),_=a(0x226892387),h=a(0xbc72568a),b=a(0x14ea3ce99),y=a(0x1ee439e69);let x=new o.Ay("lists"),InputCanvasSalesTemplateSelect=({isDisabled:e,onValueChange:t,canvasId:a,errors:i})=>{let o=(0,_.d4)(y.H7),l=(0,f.F1)(o),s=(0,_.d4)(h.sk),c=(0,_.d4)(h.jM),S=(0,_.d4)(h.GB),A=(0,_.d4)(h._I),C=(0,_.d4)(h.iS),w=(0,_.d4)(e=>a?(0,b.Lp)(e,a):null),E=(0,r.A)(),v=(0,n.useMemo)(()=>new Set([...s?.map(e=>e.id)??[],...c?.map(e=>e.id)??[],...S?.map(e=>e.id)??[],...A?.map(e=>e.id)??[],...C?.map(e=>e.id)??[]]),[s,C,A,c,S]),T=(0,n.useMemo)(()=>w?{value:w.id,label:w.title}:null,[w]),O=(0,n.useCallback)(e=>{t&&t(e.value)},[t]),getFilteredTemplateOptions=(e,t)=>{if(e&&e.length>0){let a=e.map(e=>({label:e.name,value:e.id}));return""===t?a:a.filter(e=>e.label?.toLowerCase().includes(t.toLowerCase()))}return[]},N=(0,n.useCallback)((e,t)=>{let a=[],n=v&&v.size>0?e.filter(e=>!v.has(e.value)):e;n.length>0&&a.push({label:x.t("Recent templates"),options:n});let i=getFilteredTemplateOptions(c,t);i.length>0&&a.push({label:x.t("Your templates"),options:i});let r=getFilteredTemplateOptions(S,t);r.length>0&&a.push({label:x.t("Sales templates"),options:r});let o=getFilteredTemplateOptions(A,t);o.length>0&&a.push({label:x.t("Shared with you"),options:o});let m=getFilteredTemplateOptions(C,t);m.length>0&&a.push({label:x.t("Created by {teamName}",{teamName:l}),options:m});let p=getFilteredTemplateOptions(s,t);return p.length>0&&a.push({label:x.t("Slack built templates",{teamName:l}),options:p.sort((e,t)=>(0,u.Ay)(e.label,t.label))}),d.K.resolve(a)},[v,c,S,A,C,s,l]),k=(0,n.useCallback)(e=>e.value?n.createElement(p.A,{id:e.value}):e.label,[]);return n.createElement(g.u,{selectId:E,width:"auto",isDisabled:!!e,placeholderText:x.t("Select a canvas"),processOptions:N,onOptionSelected:O,renderOption:k,renderSelectedOption:k,selectedOption:T,searcherOptions:(0,m.Zq)(m.oz),errors:i,size:"medium"})};InputCanvasSalesTemplateSelect.displayName="InputCanvasSalesTemplateSelect";var S=a(0x1bc939146);let A=new o.Ay("modernselling");function useCanvasTemplates(){let e=(0,i.wA)(),t=(0,_.d4)(h.uf);(0,n.useEffect)(()=>{t||e((0,S.dR)())},[e,t])}let MessageAddOn=({onChange:e,errors:t,includeMessageAddOn:a,canvasTemplateId:i,buttonText:o})=>{let d=(0,r.A)();useCanvasTemplates();let u=(0,n.useCallback)(t=>e("canvasTemplateId",t),[e]),m=(0,n.useCallback)(t=>{e("includeMessageAddOn",t.target.checked)},[e]),p=(0,n.useCallback)(t=>e("buttonText",t),[e]);return n.createElement("div",{className:"p-sales_notifications__workflow__form__field"},n.createElement("hr",{className:"p-sales_notifications__workflow__form__divider margin_top_150"}),n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},A.t("Message add-on")),n.createElement("div",null,n.createElement(s.A,{text:A.t("Add a button to create a canvas from a template"),type:"inline",cursor:"pointer"},n.createElement(l.A,{name:"includeCanvasTemplateButton",checked:!!a,onChange:m})),a&&n.createElement(n.Fragment,null,n.createElement(s.A,{className:"p-sales_notifications__workflow__form__field margin_top_50",htmlFor:d,text:A.t("Button text")},n.createElement(c.A,{id:d,errorText:t?.buttonText?.[0]?.message,name:"button-text-input",value:o,onChange:p,maxCharacterLimit:40,isRequired:!0})),n.createElement(s.A,{text:A.t("Canvas template"),className:"p-sales_notifications__workflow__form__field margin_top_50"},n.createElement(InputCanvasSalesTemplateSelect,{key:"lob-canvas-template-select",onValueChange:u,canvasId:i,errors:t?.canvasTemplateId})))))};MessageAddOn.displayName="MessageAddOn";let C=MessageAddOn},0xf33ac3d1:(e,t,a)=>{"use strict";a.d(t,{A:()=>ek});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x1d01572a2),o=a(0x4bdf0df6),l=a(0x20482ad21),s=a(0x205f4fb61),c=a(0x12edaa96a),d=a(0x1e217163d),u=a(0x93fa1f74),m=a(0x3b556df0),p=a(0x1be40479b),g=a(0x3bf6c48),f=a(0x2b3a07cf),_=a(0x13d4e5f52),h=a(0x98161168),b=a(0x1407c6c2c),y=a(0x1d2cd7755),x=a(0x15014e268),S=a(0x9a7ccd79),A=a(0x6f20b262),C=a(0x1d104c491);let w=new l.Ay("modernselling"),UnstyledAmountDirectionSelect=({className:e,isAdvancedOption:t=!1,onBlur:a,onChange:i,value:r})=>{let o=(0,b.A)(),l=(0,n.useMemo)(()=>{if(t){let e=(0,S.Cj)();return[{label:e[A.hu.HasChangedTriggerCondition],value:C.Us.Any},{label:e[A.hu.HasIncreasedTriggerCondition],value:C.Us.Increase},{label:e[A.hu.HasDecreasedTriggerCondition],value:C.Us.Decrease}]}return[{label:w.t("Any amount change"),value:C.Us.Any},{label:w.t("Increased amount"),value:C.Us.Increase},{label:w.t("Decreased amount"),value:C.Us.Decrease}]},[t]),s=(0,n.useMemo)(()=>l.find(e=>e.value===r),[l,r]),c=(0,n.useCallback)(e=>i(e.value),[i]);return n.createElement(x.Ay,{className:e,onBlur:a,onOptionSelected:c,options:l,selectedOption:s,selectId:o,width:"100%",isRequired:!0})};UnstyledAmountDirectionSelect.displayName="UnstyledAmountDirectionSelect";let AmountDirectionSelect=({className:e,onBlur:t,onChange:a,value:i})=>n.createElement(y.A,{text:w.t("Amount change"),className:"p-sales_notifications__workflow__form__field"},n.createElement(UnstyledAmountDirectionSelect,{className:e,onBlur:t,onChange:a,value:i}));AmountDirectionSelect.displayName="AmountDirectionSelect";var E=a(0x1c3fd5e76);let v=new l.Ay("modernselling"),T={[C.Lb.adminStageChanged]:"stage",[C.Lb.adminAmountChanged]:"amount",[C.Lb.adminDealWon]:"stage",[C.Lb.adminCloseDateChanged]:"close_date",[C.Lb.userStageChanged]:"stage",[C.Lb.userAmountChanged]:"amount",[C.Lb.userDealWon]:"stage",[C.Lb.userCloseDateChanged]:"close_date"};function useWorkflowViewReadOnlyCondition({handleBlur:e,handleChange:t,isAdmin:a,opportunitySchema:i,values:r,errors:o,workflowView:l}){let s=T[l],c=(0,_.q)(s,i,a);return(0,n.useMemo)(()=>{if(!i)return null;switch(l){case C.Lb.adminAmountChanged:case C.Lb.userAmountChanged:if(a)return c&&{field:(0,h.w_)(c),renderOperator:()=>n.createElement(UnstyledAmountDirectionSelect,{className:"p-sales_notifications__workflow__form__advanced_options__field__operator",isAdvancedOption:!0,onBlur:e("amountDirection"),onChange:t("amountDirection"),value:r.amountDirection})};return c&&{field:(0,h.w_)(c),operator:v.t("has changed")};case C.Lb.adminStageChanged:case C.Lb.adminCloseDateChanged:case C.Lb.userStageChanged:case C.Lb.userCloseDateChanged:return c&&{field:(0,h.w_)(c),operator:v.t("has changed")};case C.Lb.adminDealWon:case C.Lb.userDealWon:if(a)return c&&{field:(0,h.w_)(c),operator:v.t("is equal to"),renderValue:()=>n.createElement(E.N,{isAdmin:a,isLoading:!1,onBlur:e("stage"),onChange:t("stage"),value:r.stage,errors:o.stage,opportunitySchema:i})};return c&&{field:(0,h.w_)(c),operator:v.t("is equal to"),value:r.stage?.value};case C.Lb.adminNewOpportunityAlert:case C.Lb.userNewOpportunityAlert:return{field:v.t("is new opportunity")};default:return null}},[i,l,a,c,e,t,r.amountDirection,r.stage,o.stage])}useWorkflowViewReadOnlyCondition.displayName="useWorkflowViewReadOnlyCondition";var O=a(0x2c625329),N=a(0x120c268ad),k=a.n(N),I=a(0x2b7f0bcc),F=a(0x11a296110),D=a(0x1faa3f1ac),M=a(0x2501a2cee),R=a(0xb1ea448c),L=a(0x1595bdd0),P=a(0x237e57f1d),B=a(0x1d1911997),H=a(0x405dcae6),U=a(0x1122238d8);let V=new l.Ay("modernselling"),AdvancedOptionsField=({id:e,errors:t,fieldOptions:a,fieldSchema:i,focusOnMount:r,isAllowedOperator:o,isRemovable:l,labelText:s,onBlur:c,onChange:d,onRemove:u,value:m,isAdmin:p})=>{let g=m.semantics?.current_or_previous==="previous",f=!l,_=(0,b.A)(),h=(0,b.A)(),y=(0,n.useMemo)(()=>i&&H._h[i.type]?.(i,{isSemanticPrevious:g}),[i,g]),[A,C]=(0,S.Lb)(i?.type,y,o,g),w=(0,n.useMemo)(()=>a.find(e=>{let{fieldId:t,isPrevious:a}=e.extras;return g===a&&t===m.schema_field_id}),[a,g,m.schema_field_id]),E=(0,U.FT)(C).find(e=>e.value===m.type),v=E&&y?.[E.value],T=(0,n.useCallback)(()=>u(e),[e,u]),O=(0,n.useCallback)(()=>c(e,"field"),[e,c]),N=(0,n.useCallback)(()=>c(e,"operator"),[e,c]),k=(0,n.useCallback)(()=>c(e,"value"),[e,c]),I=(0,n.useCallback)(t=>{let{fieldId:a,isPrevious:n}=t.extras;d({id:e,schema_field_id:a,semantics:n?{type:"basic",current_or_previous:"previous",condition_or_filter:"filter"}:void 0})},[e,d]),D=(0,n.useCallback)(e=>{d({...m,type:e.value})},[d,m]),R=(0,n.useCallback)(e=>d({...m,rhs:e}),[d,m]),L=(0,n.useMemo)(()=>t?.find(e=>"value"===e.location),[t]),P=(0,n.useMemo)(()=>t?.filter(e=>"field"===e.location),[t]),W=(0,n.useMemo)(()=>t?.filter(e=>"operator"===e.location),[t]);return n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field"},n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__label"},s),n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__controls"},n.createElement(F.Nm,{"aria-disabled":f,"aria-label":V.t("Remove condition"),disabled:f,onClick:T},n.createElement("span",{className:f?"sk_soft_gray cursor_default":void 0},n.createElement(M.Ah,{name:"trash",size:"20"}))))),n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},n.createElement(B.Ay,{ariaLabel:V.t("Select an opportunity field"),errors:P,isInvalid:!!P?.length,isRequired:!0,minOptionsListWidth:200,onOptionsListClose:O,onOptionSelected:I,options:a,placeholderText:V.t("Select field\u2026"),selectedOption:w,selectId:_,focusOnMount:r,expandOnFocus:!1}),n.createElement(x.Ay,{key:`${w?.value}-${A}`,ariaLabel:V.t("Select operator"),errors:w&&W,isRequired:!0,isDisabled:!w,onOptionsListClose:N,onOptionSelected:D,options:C,placeholderText:V.t("Select operator\u2026"),selectedOption:E,selectId:h,width:"auto",className:"flex_one"})),i&&E&&v&&n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},n.createElement(v,{id:e,error:L,operator:E.value,fieldSchema:i,onBlur:k,onChange:R,value:m,isAdmin:p})))};AdvancedOptionsField.displayName="AdvancedOptionsField";var W=a(0x126f22530);let q=new l.Ay("modernselling"),AdvancedOptionsReadOnlyField=({field:e,operator:t,renderField:a,renderOperator:i,renderValue:r,value:o})=>{let l=(0,b.A)(),s=(0,b.A)(),c=(0,b.A)(),d=(0,n.useMemo)(()=>(0,L.A)([e&&{value:null,label:e}]),[e]),u=(0,n.useMemo)(()=>(0,L.A)([t&&{value:null,label:t}]),[t]);return n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field p-sales_notifications__workflow__form__advanced_options__field--read_only"},n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__label"},q.t("When"))),n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},a?.(),e&&n.createElement(B.Ay,{isDisabled:!0,options:d,selectedOption:d[0],selectId:s}),i?.(),t&&n.createElement(x.Ay,{isDisabled:!0,options:u,selectedOption:u[0],selectId:c,width:"auto",className:"p-sales_notifications__workflow__form__advanced_options__field__operator"})),r&&n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},r?.()),null!=o&&n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},n.createElement(W.A,{className:"full_width",id:l,"aria-label":e??"",name:"read-only-condition-value",value:`${o}`,isDisabled:!0})))};AdvancedOptionsReadOnlyField.displayName="AdvancedOptionsReadOnlyField";var j=a(0x1655dc9c9);let Y=new l.Ay("modernselling"),AdvancedOptionsFields=({errors:e,hasFocusOnMount:t=!1,onChange:a,setErrors:i,advancedOptions:o,isAllowedOperator:l,isAllowedSchemaType:s,opportunitySchema:c,maxAllowedConditions:d=7,firstReadOnlyCondition:u,amount:m,stages:p,closeDateDirection:g,closeDatePeriod:f,isAdmin:_,isRecurring:b,workflowView:y})=>{let x=(0,n.useRef)(o),S=(0,n.useRef)(e||null),{fieldOptions:A,fieldSchemaById:C,defaultCondition:w}=(0,P.K)({opportunitySchema:c,isAllowedSchemaType:s,amount:m,stages:p,closeDateDirection:g,closeDatePeriod:f,isAdmin:_,isRecurring:b,workflowView:y});(0,n.useEffect)(()=>{x.current=o,S.current=e||null});let E=(0,n.useCallback)(e=>{let t=S.current?.filter(t=>t.id!==e)||null;t?.length!==S.current?.length&&(S.current=t,i(S.current))},[i]),v=(0,n.useCallback)(e=>{a({...x.current,[e]:null}),E(e)},[a,E]),T=(0,n.useCallback)((e,t)=>{let a=x.current?.[e];if(!a)return;let n=S.current||[],r=(0,H.K5)(a,[t])||[],o=n.filter(a=>a.id!==e||a.id===e&&a.location!==t);if(r.length||o.length!==n.length){let e=[...o,...r];S.current=e.length?e:null,i(S.current)}},[i]),O=(0,n.useCallback)(e=>{let{id:t}=e;if(!x.current?.[t])return;let n=e.schema_field_id,i=n?C[n]:null,r=(0,h.kp)(i,e);x.current={...x.current,[t]:r},a(x.current),E(t)},[a,E,C]),N=(0,n.useMemo)(()=>(0,L.A)(Object.values(o||{})),[o]),k=(0,n.useCallback)((e,t,n=!1)=>{let i=t||[(0,h.Gv)()],r={...x.current};i.forEach(e=>{r[e.id]=e}),a(r,n)},[a]);(0,r.A)(()=>{N.length||k(null,w,!0)});let I=N.length?N:w;return n.createElement(j.v,{isWrapping:!0},u&&n.createElement(AdvancedOptionsReadOnlyField,u),I.map((a,i)=>{let{schema_field_id:r}=a;return n.createElement(AdvancedOptionsField,{id:a.id,key:a.id,errors:e?.filter(e=>e.id===a.id),fieldOptions:A,fieldSchema:null!=r?C[r]:void 0,focusOnMount:t&&i===I.length-1,isAllowedOperator:l,isRemovable:I.length>1,labelText:Y.t("And"),onBlur:T,onChange:O,onRemove:v,value:a,isAdmin:_})}),n.createElement(F.Ay,{size:"small",type:"outline",disabled:I.length>=d,onClick:k},Y.t("Add Condition")))};AdvancedOptionsFields.displayName="AdvancedOptionsFields";let z=new l.Ay("modernselling"),AdvancedOptions=({errors:e,onChange:t,setErrors:a,isLoading:i,hasFocusOnMount:r,advancedOptions:o,opportunitySchema:l,isAllowedOperator:s,isAllowedSchemaType:c,firstReadOnlyCondition:d,amount:u,stages:m,closeDateDirection:p,closeDatePeriod:g,isAdmin:f,isRecurring:_,workflowView:h})=>n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options"},n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__header"},n.createElement("div",{className:"bold"},z.t("Advanced conditions"))),n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__content"},i&&n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__spinner"},n.createElement(R.A,null)),!i&&l&&n.createElement(AdvancedOptionsFields,{hasFocusOnMount:r,onChange:t,setErrors:a,isAllowedOperator:s,isAllowedSchemaType:c,advancedOptions:o,opportunitySchema:l,firstReadOnlyCondition:d,errors:e,amount:u,stages:m,closeDateDirection:p,closeDatePeriod:g,isAdmin:f,isRecurring:_,workflowView:h})));AdvancedOptions.displayName="AdvancedOptions";var G=a(0x15038689e),$=a(0xe08dc76c);let Q=new l.Ay("modernselling"),K=[],TimePeriodDirectionSelect=({errors:e,timePeriodDirection:t,onChange:a,onBlur:i})=>{let r=(0,b.A)(),o=(0,n.useCallback)(e=>{a(e.value)},[a]),l=(0,n.useMemo)(()=>[{value:$.ig.ANY,label:Q.t("Another")},{value:$.ig.LATER,label:Q.t("Future")},{value:$.ig.EARLIER,label:Q.t("Earlier")}],[]);return n.createElement(x.Ay,{onBlur:i,errors:e,isRequired:!0,onOptionSelected:o,options:l||K,selectedOption:l.find(e=>t===e.value),selectId:r,width:"100%"})};TimePeriodDirectionSelect.displayName="TimePeriodDirectionSelect";var J=a(0x26f5f245);let Z=new l.Ay("modernselling"),CloseDateSelect=({errors:e,closeDateDirection:t,onCloseDateDirectionChange:a,onCloseDateDirectionBlur:i,closeDatePeriod:r,onCloseDatePeriodChange:o,onCloseDatePeriodBlur:l})=>n.createElement(y.A,{text:Z.t("Close date changes to\u2026"),className:"p-sales_notifications__workflow__form__field"},n.createElement("div",{className:"display_flex align_items_center"},n.createElement("div",{className:"flex_one margin_right_100"},n.createElement(TimePeriodDirectionSelect,{errors:e?.closeDateDirection,timePeriodDirection:t,onChange:a,onBlur:i})),n.createElement("div",{className:"flex_one"},n.createElement(J.A,{errors:e?.closeDatePeriod,selectedTimePeriod:r,onChange:o,onBlur:l,periodNum:1}))));CloseDateSelect.displayName="CloseDateSelect";var X=a(0xb77a689a),ee=a(0xa7ec93c2),et=a(0x4a120eb2);let ea=new l.Ay("modernselling"),en=[],UnstyledStageMultiSelect=({id:e,errors:t,isLoading:a,onBlur:i,onChange:r,opportunitySchema:o,value:l})=>{let s=(0,_.q)("stage",o,!0),c=(0,n.useMemo)(()=>s?(0,U.I_)(s):[],[s]),d=(0,n.useCallback)(async e=>e?c.filter(t=>((0,X.A)(t.label)?t.label:t.value).toLowerCase().includes(e.toLowerCase())):c,[c]),u=ea.t("Search for stages");return n.createElement(n.Fragment,null,a&&n.createElement(ee.Ay,{className:"normal",errors:t,isInvalid:!!t?.length,isLoading:a,isRequired:!0,onBlur:i,options:l||en,placeholderText:u,selectId:e,selectedOptions:l??void 0,width:"100%"}),!a&&n.createElement(et.x,{className:"normal",classPrefix:"p-sales_notifications__workflow__form__field__select",errors:t,expandOnFocus:!0,debounceWaitPeriod:0,isInvalid:!!t?.length,onBlur:i,onSelectedItemsChange:r,placeholderText:u,search:d,selectedOptions:l??void 0,selectId:e,shouldAllowUnselectInMultiSelectMode:!0,width:"100%"}))};UnstyledStageMultiSelect.displayName="UnstyledStageMultiSelect";let StageMultiSelect=({className:e,...t})=>{let a=(0,b.A)();return n.createElement(y.A,{className:k()("p-sales_notifications__workflow__form__field",e),htmlFor:a,text:ea.t("Stage changes to\u2026")},n.createElement(UnstyledStageMultiSelect,{...t,id:a}))};StageMultiSelect.displayName="StageMultiSelect";var ei=a(0x91728dda),er=a(0x226892387),eo=a(0x1c8beab7f);let el=new l.Ay("modernselling"),es=[],ec=new Set([A.hu.HasChangedTriggerCondition,A.hu.HasDecreasedTriggerCondition,A.hu.HasIncreasedTriggerCondition]),ed=new Set([C.gI.DateSchemaField,C.gI.DateTimeSchemaField]),ConditionalInputsWithAdvancedOptions=({values:e,errors:t,advancedOptions:a,advancedOptionsErrors:i,advancedOptionsLoadError:r,className:o,isAdmin:l,isAdvancedOptionsOpenOnMount:s=!1,isLoading:c,handleBlur:d,handleChange:u,onAmountInputBlur:m,onAmountInputChange:p,onAdvancedOptionsChange:g,opportunitySchema:f,refetchOpportunitySchema:_,setAdvancedOptionsFieldErrors:h,workflowView:b,firstReadOnlyCondition:y,onCloseDateDirectionChange:x,onCloseDateDirectionBlur:S,onCloseDatePeriodChange:A,onCloseDatePeriodBlur:C})=>{let[w,v]=(0,n.useState)(s),[T,O]=(0,n.useState)(!1),N=(0,er.d4)(ei.sw),R=(0,er.d4)(eo.UU);(0,n.useEffect)(()=>{T||(s||g(null),v(s))},[s,T,g]);let L=(0,U.g0)(b),P=(0,n.useCallback)(()=>{v(!0),O(!0)},[]),B=(0,n.useCallback)((e,t)=>{g(e),t||O(!0)},[g]),H=(0,n.useCallback)(e=>!L||!ec.has(e),[L]),V=(0,n.useCallback)(e=>!L||!ed.has(e),[L]);if(!w)return n.createElement("div",{className:o},l&&(0,U.N)(b)&&n.createElement(E.A,{value:e.stage,errors:t.stage,isLoading:c,onBlur:d("stage"),onChange:u("stage"),opportunitySchema:f,isAdmin:!0}),l&&(0,U.Bf)(b)&&n.createElement(StageMultiSelect,{value:e.stageChangedStages,errors:t.stageChangedStages,isLoading:c,onBlur:d("stageChangedStages"),onChange:u("stageChangedStages"),opportunitySchema:f}),l&&(0,U.Xk)(b)&&n.createElement(AmountDirectionSelect,{onBlur:d("amountDirection"),onChange:u("amountDirection"),value:e.amountDirection}),(0,U.DD)(b)&&n.createElement(CloseDateSelect,{onCloseDateDirectionBlur:S,onCloseDateDirectionChange:x,onCloseDatePeriodBlur:C,onCloseDatePeriodChange:A,closeDateDirection:e.closeDateDirection,closeDatePeriod:e.closeDatePeriod,errors:t}),N&&e.isRecurring?null:n.createElement(G.A,{value:e.amount,onBlur:m,onChange:p}),n.createElement(D.A,{className:"p-sales_notifications__workflow__form__field",onClick:P},n.createElement(M.Ah,{size:"18",name:"settings",inline:!0}),n.createElement("span",{className:"margin_left_25"},el.t("Use advanced conditions"))));let W=R&&!l;if(r||!c&&!f&&!W)return n.createElement("div",{className:o},n.createElement(G.A,{value:e.amount,onBlur:m,onChange:p}),n.createElement(I.Ay,{type:"boxed",level:"warning"},el.t("There was a problem loading advanced conditions.")," ",n.createElement(F.jV,{onClick:_},el.t("Try again?"))));let q=l&&(0,U.Bf)(b)?e.stageChangedStages||es:null;return n.createElement("div",{className:k()("full_width margin_bottom_125",o)},n.createElement(AdvancedOptions,{errors:i,advancedOptions:a,isLoading:c,onChange:B,opportunitySchema:f,setErrors:h,hasFocusOnMount:!s,isAllowedOperator:H,isAllowedSchemaType:V,firstReadOnlyCondition:y,amount:e.amount,stages:q,closeDateDirection:e.closeDateDirection,closeDatePeriod:e.closeDatePeriod,isAdmin:l,isRecurring:e.isRecurring,workflowView:b}))};ConditionalInputsWithAdvancedOptions.displayName="ConditionalInputsWithAdvancedOptions";var eu=a(0x45bd075);let em=new l.Ay("modernselling"),ExcludeCheckbox=({isAdmin:e,className:t,workflowView:a,excludeSelfModifications:i,onChange:r})=>{let o=(0,n.useCallback)(e=>{r(e.target.checked)},[r]),l=(0,n.useMemo)(()=>e?(0,U.g0)(a)?em.t("Exclude the person who created the opportunity"):em.t("Exclude the person who made the update"):(0,U.g0)(a)?em.t("Don\u2019t send this notification if you created the opportunity"):em.t("Don\u2019t send this notification if you made the update"),[e,a]);return n.createElement(y.A,{text:l,className:k()("p-sales_notifications__workflow__form__field",t),type:"inline",cursor:"pointer"},n.createElement(eu.A,{name:"excludeSelfModificationsOption",checked:!!i,onChange:o}))};ExcludeCheckbox.displayName="ExcludeCheckbox";var ep=a(0xe1721148),eg=a(0xd00e724),ef=a(0x1c24ff2dd),e_=a(0x4cdd4e70),eh=a(0xc2d5849d),eb=a(0x199da57a4);let ey=new l.Ay("modernselling"),TriggerTypeSelectButton=({icon:e,isSelected:t,onClick:a,subtext:i,text:r})=>n.createElement(F.Ay,{"aria-selected":t,className:k()("p-sales_notifications__workflow__form__trigger_type_button",{"p-sales_notifications__workflow__form__trigger_type_button--selected":t}),onClick:a,type:"outline"},n.createElement("div",{className:"flex_shrink_none padding_top_25"},n.createElement(M.Ah,{name:e,size:"20"})),n.createElement("div",{className:"flex_one align_left"},n.createElement("div",{className:"bold margin_bottom_25"},r),n.createElement("div",{className:"caption sk_foreground_high"},i)));TriggerTypeSelectButton.displayName="TriggerTypeSelectButton";let TriggerTypeSelect=({isRecurring:e,onIsRecurringChange:t})=>{let a=(0,n.useCallback)(()=>{t(!1)},[t]),i=(0,n.useCallback)(()=>{t(!0)},[t]),r=ey.t("Real-time"),o=ey.t("Get notified as soon as an opportunity meets your criteria"),l=ey.t("Scheduled"),s=ey.t("Get a recurring summary of updated opportunities (up to 50)");return n.createElement("div",{className:"display_flex gap_100"},n.createElement(TriggerTypeSelectButton,{icon:"bolt",isSelected:!e,onClick:a,subtext:o,text:r}),n.createElement(TriggerTypeSelectButton,{icon:"schedule-send",isSelected:e,onClick:i,subtext:s,text:l}))};TriggerTypeSelect.displayName="TriggerTypeSelect";let ex=new l.Ay("modernselling"),TriggerConfig=({frequency:e,isRecurring:t,onFrequencyChange:a,onIsRecurringChange:i,onStartTimeBlur:r,onStartTimeChange:o,startTime:l,startTimeErrors:s})=>{let c=ex.t("Notification type");return n.createElement(d.B,{space:"125"},n.createElement(d.B,{space:"0"},n.createElement(y.A,{text:c}),n.createElement(TriggerTypeSelect,{isRecurring:t,onIsRecurringChange:i})),t&&n.createElement(eb.Y,{frequency:e,onFrequencyChange:a,onStartTimeBlur:r,onStartTimeChange:o,startTime:l,startTimeErrors:s}))};TriggerConfig.displayName="TriggerConfig";var eS=a(0x124d99cb0),eA=a(0x1b9d5cc0c),eC=a(0xe684f705),ew=a(0x16b708a7f),eE=a(0xbd196b81),ev=a(0x11c82607b),eT=a(0xa49ba833);let eO=(0,ev.Ay)("Fetch and set object mappings for a selected org",async(e,t,a)=>{if((0,eo.cw)(t())?.datasource_id){let t=await e((0,eT.Y)({salesforceOrgId:a}));e((0,ew.hr)({objectMappings:t,salesforceOrgId:a}))}});eO.meta={name:"setUserSalesforceOrgObjectMappings",key:"createThunkSetUserSalesforceOrgObjectMappings",description:"Fetch and set object mappings for a selected org"};let eN=new l.Ay("modernselling"),OpportunityChangedForm=({workflowView:e,defaultListTitle:t})=>{let a=(0,i.wA)(),l=e in C.u3,_=(0,g.E)({isAdmin:l}),h=(0,er.d4)(ei.QJ),b=(0,er.d4)(ei.sw),y=(0,er.d4)(eo.RC),x=(0,er.d4)(eo.cc),[S,A]=(0,n.useState)(),w=(0,er.d4)(eo.UU),[v,T]=(0,n.useState)(!0),[N,k]=(0,n.useState)(null),[I,F]=(0,n.useState)(null),D=(0,er.d4)(l?eo.Tt:eo.rm),M=(0,er.d4)(l?eo.MH:eo.gE),R=(0,er.d4)(eC.cA),L=(0,n.useMemo)(()=>h?[]:[C.Jd.OpportunityOwnedByDirectReports,C.Jd.AccountOwnedByMe],[h]),P=(0,n.useMemo)(()=>{let e=(0,eS.rJ)(R,"iso"),t=(0,eA.et)(R)??o.vp;return{isRecurring:!1,frequency:C.Ns.weekly,startTime:e,timezone:t}},[R]),B=(0,n.useMemo)(()=>{if(D)return(0,m.AN)(D,l,P);let a={account:null,advancedOptions:null,amount:(0,s.ZV)(5e4),channelId:null,tokenUserId:null,opportunity:null,scope:null,sendTo:C.Oz.SalesHome,stage:null,title:t,stageChangedStages:null,canvasTemplateId:null,includeMessageAddOn:!1,buttonText:(0,p.L)(e),isMutingDisabled:!1};return((0,U.DD)(e)&&(a.closeDateDirection=$.ig.ANY,a.closeDatePeriod=$.ts.FISCAL_QUARTER),l)?((0,U.Xk)(e)&&(a.amountDirection=C.Us.Any),{...a,...P,type:C.g$.AdminOpportunityChanged,recipientType:null,recipientRoles:null,recipientUsers:null}):{...a,type:C.g$.UserOpportunityChanged,criteria:L,excludeSelfModifications:!1}},[D,t,e,l,L,P]),{values:H,errors:V,handleBlur:W,handleChange:q,setFieldErrors:j}=(0,f.A)({workflowView:e,initialValues:B}),Y=(0,n.useCallback)(e=>{q("isRecurring")(e),!0===e?(q("sendTo")("sales_home"),q("excludeSelfModifications")(void 0),b&&q("amount")(null),(0,U.Yo)(H.scope)&&q("scope")(null)):b&&q("amount")((0,s.ZV)(5e4))},[q,H.scope,b]),z=(0,n.useCallback)(e=>{q("sendTo")(e),(0,U.lA)(e)&&q("excludeSelfModifications")(void 0)},[q]),G=(0,n.useCallback)(e=>W(e)(),[W]),Q=(0,n.useCallback)((e,t)=>q(e)(t),[q]),K=(0,n.useCallback)((e,t)=>q(e)(t),[q]),J=(0,n.useCallback)(e=>{let t=x?.find(t=>t.salesforce_org_id===e.value);t&&(T(!0),H.advancedOptions&&q("advancedOptions")(null),a((0,ew.c2)(!0)),a((0,eE.T)({salesforceOrgId:t.salesforce_org_id,setDefaultInApi:!1})),A((0,c.A)()),((0,U.Yo)(H.scope)||(0,U.Su)(H.scope))&&(q("scope")(null),q("account")(null)))},[a,q,A,H.scope,x,T,H.advancedOptions]),Z=(0,n.useMemo)(()=>(0,U.g0)(e)||H.isRecurring?[C.QO.SpecificOpportunity]:null,[e,H.isRecurring]);(0,r.A)(()=>{D&&M&&!l&&(a((0,ew.c2)(!0)),T(!0),k(null),a(eO(M)))});let X=(0,n.useCallback)(async()=>{T(!0),k(null),F(null);try{let e=await _();F(e)}catch(e){k(e)}finally{T(!1)}},[_]);(0,n.useEffect)(()=>{w||X()},[X,w]);let ee=useWorkflowViewReadOnlyCondition({values:H,errors:V,isAdmin:l,handleBlur:W,handleChange:q,opportunitySchema:I,workflowView:e}),et=l&&!(0,U.g0)(e),ea=(0,U.ti)(H.sendTo)&&!H.isRecurring,en=!!((0,U.L8)(H.scope)||(0,U.dy)(H.criteria)||D?.condition?.advanced_conditions?.length||D?.acn?.advanced_conditions?.length);return n.createElement(n.Fragment,null,n.createElement("div",{className:"p-sales_notifications__workflow__section"},n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},eN.t("Notification details")),n.createElement(ep.A,{errors:V.title,onBlur:W("title"),onChange:q("title"),value:H.title}),n.createElement(d.B,{space:"125"},et&&n.createElement(TriggerConfig,{frequency:H.frequency,isRecurring:!!H.isRecurring,onFrequencyChange:q("frequency"),onIsRecurringChange:Y,onStartTimeBlur:W("startTime"),onStartTimeChange:q("startTime"),startTime:H.startTime,startTimeErrors:V.startTime}),n.createElement(eh.A,{channelId:H.channelId,tokenUserId:H.tokenUserId,destination:H.sendTo,errors:V,isAdmin:l,isRecurring:H.isRecurring,isEditNotification:!!D,onChannelSelectBlur:W("channelId"),onChannelSelected:q("channelId"),onTokenSelectBlur:W("tokenUserId"),onTokenSelected:q("tokenUserId"),onSendToSelected:z})),ea&&n.createElement(ExcludeCheckbox,{isAdmin:l,workflowView:e,excludeSelfModifications:H.excludeSelfModifications,onChange:q("excludeSelfModifications")}),!l&&(0,U.N)(e)&&n.createElement(E.A,{value:H.stage,errors:V.stage,isLoading:v,onBlur:W("stage"),onChange:q("stage"),opportunitySchema:I,isAdmin:l}),n.createElement("hr",{className:"p-sales_notifications__workflow__form__divider"}),n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},eN.t("Apply to")),!l&&y&&n.createElement(u.k,{onChange:J,salesforceOrgId:D&&M?M:y,disabled:!!D,disabledText:eN.t("To change org, please create a new notification."),showCoachMark:!D}),n.createElement(e_.A,{key:S,isAdmin:l,errors:V,account:H.account,criteria:H.criteria,ignoreScopes:Z,onScopeTypeBlur:W("scope"),onScopeTypeChange:q("scope"),onScopeValueBlur:G,onScopeValueChange:Q,opportunity:H.opportunity,scope:H.scope}),n.createElement(ConditionalInputsWithAdvancedOptions,{values:H,errors:V,isAdmin:l,handleBlur:W,handleChange:q,advancedOptions:H.advancedOptions,advancedOptionsErrors:V.advancedOptions,advancedOptionsLoadError:N,isLoading:v,onAdvancedOptionsChange:q("advancedOptions",!1),onAmountInputBlur:W("amount"),onAmountInputChange:q("amount"),opportunitySchema:I,refetchOpportunitySchema:X,setAdvancedOptionsFieldErrors:j("advancedOptions"),workflowView:e,firstReadOnlyCondition:ee,isAdvancedOptionsOpenOnMount:en,onCloseDateDirectionBlur:W("closeDateDirection"),onCloseDateDirectionChange:q("closeDateDirection"),onCloseDatePeriodBlur:W("closeDatePeriod"),onCloseDatePeriodChange:q("closeDatePeriod")})),l&&(0,U.ti)(H.sendTo)&&n.createElement("div",{className:"p-sales_notifications__workflow__section"},n.createElement("hr",{className:"p-sales_notifications__workflow__form__divider"}),n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},eN.t("Recipients")),n.createElement(ef.$,{errors:V,onRecipientTypeBlur:W("recipientType"),onRecipientTypeChange:q("recipientType"),onRecipientRolesBlur:W("recipientRoles"),onRecipientRolesChange:q("recipientRoles"),onRecipientUsersBlur:W("recipientUsers"),onRecipientUsersChange:q("recipientUsers"),recipientType:H.recipientType,recipientRoles:H.recipientRoles,recipientUsers:H.recipientUsers,setRecipientRolesFieldsErrors:j("recipientRoles"),setRecipientUsersFieldsErrors:j("recipientUsers")})),l&&!H.isRecurring&&n.createElement(eg.A,{onChange:K,errors:V,canvasTemplateId:H.canvasTemplateId,includeMessageAddOn:H.includeMessageAddOn,buttonText:H.buttonText}),l&&n.createElement("div",{className:"p-sales_notifications__workflow__section"},n.createElement(O.M,{isMutingDisabled:H.isMutingDisabled,onChange:q("isMutingDisabled")})))};OpportunityChangedForm.displayName="OpportunityChangedForm";let ek=OpportunityChangedForm},0x1c24ff2dd:(e,t,a)=>{"use strict";a.d(t,{$:()=>RecipientsSelect});var n=a(0xbad225b5),i=a(0x1407c6c2c),r=a(0x20482ad21),o=a(0x1d2cd7755),l=a(0x15014e268),s=a(0x226892387),c=a(0x1c8beab7f),d=a(0x10d53599f),u=a(0x19dc73101);let m=new r.Ay("modernselling"),p={entities:{channels:!1,members:{includeSelf:!0,includeSlackbot:!1,includeBots:!1},userGroups:!1},sort:{frecency:!0},allowEmptyQuery:!0},MembersSelect=({errors:e,onBlur:t,onChange:a,selectedMembers:r})=>{let o=(0,i.A)(),l=(0,n.useCallback)(e=>n.createElement(d.A,{id:e.value,showAvatar:!0,showPresence:!1}),[]),s=(0,n.useCallback)(e=>{a(e.map(e=>e.value))},[a]),c=(0,n.useMemo)(()=>r?.map(e=>({value:e})),[r]);return n.createElement("div",{className:"p-sales_notifications__workflow__form__field"},n.createElement(u.h,{className:"normal",errors:e,onBlur:t,classPrefix:"p-sales_notifications__workflow__form__field__select",onSelectedItemsChange:s,placeholderText:m.t("Search for users"),renderOption:l,searcherOptions:p,selectedOptions:c,selectId:o,width:"100%",expandOnFocus:!0,forceRealName:!0}))};MembersSelect.displayName="MembersSelect";var g=a(0xf1b54886),f=a(0x1122238d8),_=a(0x91728dda),h=a(0x1d104c491);let b=new r.Ay("modernselling"),RecipientsSelect=({hasFrontLineManagerOptions:e,errors:t,recipientType:a,onRecipientTypeChange:r,onRecipientTypeBlur:d,recipientRoles:u,onRecipientRolesChange:m,onRecipientRolesBlur:p,setRecipientRolesFieldsErrors:y,recipientUsers:x,onRecipientUsersChange:S,onRecipientUsersBlur:A,setRecipientUsersFieldsErrors:C})=>{let w,E=(0,s.d4)(_.Jx),v=(0,i.A)(),T=(w=(0,s.d4)(c.yp),!!w?.some(e=>"UserRole"===e.identifier)),O=(0,n.useCallback)(e=>{r(e.value),y([]),C([])},[r,y,C]),N=(0,n.useMemo)(()=>e?[{label:b.t("Direct owner"),value:"",options:[{label:b.t("Opportunity owner"),value:h._Y.Owner},{label:b.t("Account owner"),value:h._Y.AccountOwner}]},{label:b.t("Manager"),value:"",options:[{label:b.t("Manager of the opportunity owner"),value:h._Y.OwnerManager},{label:b.t("Manager of the account owner"),value:h._Y.AccountOwnerManager}]},{label:b.t("Specific people"),value:h._Y.User}]:[{label:b.t("Direct owner"),value:"",options:[{label:b.t("Opportunity owner"),value:h._Y.Owner},{label:b.t("Account owner"),value:h._Y.AccountOwner}]},{label:b.t("Manager or leader"),value:"",options:[{label:b.t("People the opportunity owner rolls up to"),value:h._Y.ManagerChain},{label:b.t("People the account owner rolls up to"),value:h._Y.AccountManagerChain}]},{label:b.t("Specific people"),value:h._Y.User}],[e]),k=(0,n.useMemo)(()=>a?(0,f.FT)(N).find(e=>e.value===a):null,[N,a]);return n.createElement(n.Fragment,null,n.createElement(o.A,{text:b.t("Recipient types"),className:"p-sales_notifications__workflow__form__field"},n.createElement(l.Ay,{errors:t?.recipientType,options:N,selectId:v,onOptionsListClose:d,selectedOption:k,onOptionSelected:O,width:"100%",maxListHeight:400})),T&&a&&a!==h._Y.User&&n.createElement(g.M,{errors:t?.recipientRoles,isOptional:[h._Y.Owner,h._Y.AccountOwner].includes(a)||E,onBlur:p,onChange:m,recipientRoles:u}),a&&a===h._Y.User&&n.createElement(MembersSelect,{errors:t?.recipientUsers,onBlur:A,onChange:S,selectedMembers:x}))};RecipientsSelect.displayName="RecipientsSelect"},0xf1b54886:(e,t,a)=>{"use strict";a.d(t,{M:()=>RolesSelect});var n,i=a(0xbad225b5),r=a(0x1d01572a2),o=a(0x20482ad21),l=a(0x1d2cd7755),s=a(0x8716533d),c=a(0x15014e268),d=a(0x1faa3f1ac),u=a(0x2501a2cee),m=a(0x1655dc9c9),p=a(0x120c268ad),g=a.n(p),f=a(0xb77a689a),_=a(0x237b6a339),h=a(0x1cbdfeceb),b=a(0x1229d92d),y=a(0xc6a2c86f),x=a(0xb6f15b90),S=a(0x223fb5a56);let A=new o.Ay("modernselling"),C={filterQuery:"",options:[],selectedOptions:[],selectId:""};var w=((n=w||{}).BAD_ENTRY="bad_entry",n.DUPLICATE_ENTRIES="duplicate_entries",n.MAX_TOKENS_EXCEEDED="max_tokens_exceeded",n.TOO_LONG="too_long",n.TOO_SHORT="too_short",n);let getFormatErrors=(e="")=>{let t=[];return(0,f.A)(e)||t.push("bad_entry"),e.length>50&&t.push("too_long"),e.length<2&&t.push("too_short"),t},createTokens=e=>e.map(e=>({key:(0,_.A)("token"),label:e,value:e})),renderCountStatus=(e,t=!1)=>i.createElement("div",{className:g()("caption",t?"sk_raspberry_red":"sk_foreground_max")},e);renderCountStatus.displayName="renderCountStatus";let E=(0,b.A)(({instruction:e,onBlur:t,onChange:a,placeholderText:n,selectId:r,selectedValues:o=[],windowRef:l})=>{let c=(0,i.useRef)(null),[d,u]=(0,i.useState)(!1),[m,p]=(0,i.useState)([]),[g,f]=(0,i.useState)([]),[_,b]=(0,i.useState)({...C,selectedOptions:createTokens(o),selectId:r}),{filterQuery:w,selectedOptions:E}=_,v=(0,i.useMemo)(()=>E?.map(e=>e.value)||[],[E]),T=(0,y.A)(v),O=!g.length&&!m.length&&!w?.trim(),N=(0,y.A)(O),k=(0,i.useCallback)(()=>{let e=[],t=new Set,a=v.filter((e,t)=>v.indexOf(e)!==t);a?.length&&(t=new Set([...t,...a]),e.push("duplicate_entries")),v.length>50&&e.push("max_tokens_exceeded"),f(e),b(a=>({...a,isInvalid:m.length>0||e.length>0,selectedOptions:a.selectedOptions?.map(e=>({...e,isError:t.has(e.value)}))||[]}))},[m,v]),I=(0,i.useCallback)(e=>{let t=e.includes(",")?e.split(","):e.split(/\n|\t/),{newTokenValues:a,badEntries:n,errors:i}=(t=t.filter(e=>""!==e.trim())).reduce((e,t)=>{let a=t.trim(),n=getFormatErrors(a);return n.length>0?(e.errors=new Set([...e.errors,...n]),e.badEntries.push(a)):e.newTokenValues.push(a),e},{newTokenValues:[],badEntries:[],errors:new Set});p([...i]);let r=createTokens(a);b(e=>({...e,isInvalid:i.size>0||g.length>0,selectedOptions:[...e.selectedOptions||[],...r],filterQuery:n.join(" ")}))},[g.length]),F=(0,i.useCallback)(e=>{b(t=>({...t,...e()}))},[]),D=(0,i.useCallback)(e=>{("Enter"===e.key||"Tab"===e.key)&&I(w)},[w,I]),M=(0,i.useCallback)(e=>{let t=e.clipboardData.getData("text");l.deref()?.requestAnimationFrame(()=>{I(t)})},[I,l]),R=(0,i.useCallback)(()=>{t(),I(w),u(!1)},[t,I,w]),L=(0,i.useCallback)(()=>{u(!0)},[]),P=(0,i.useMemo)(()=>[...g,...m].reduce((e,t)=>("max_tokens_exceeded"!==t&&e.push({id:t,message:(e=>{switch(e){case"bad_entry":return A.t("Invalid entry");case"too_short":return A.t("Minimum of {count} characters required",{count:2});case"too_long":return A.t("Maximum of {count} characters exceeded",{count:50});case"duplicate_entries":return A.t("Duplicate entries");default:return""}})(t)}),e),[]),[m,g]);(0,i.useEffect)(()=>{!w?.trim()&&(p([]),v?.length||b(e=>({...e,isInvalid:!1})))},[w,v]),(0,i.useEffect)(()=>{v?.length!==T?.length&&k()},[v,T,k]),(0,i.useEffect)(()=>{(v!==T||O!==N)&&a({isValid:O,values:v})},[v,O,a,T,N]);let B=(0,i.useMemo)(()=>{let e=d&&!!w?.length,t=!e&&(d||v.length>50);if(e){let e=50-(w?.length||0);return renderCountStatus(A.t("{count, plural, =1 {# character} other {# characters}} left",{count:e}),e<0)}if(t){let e=50-v.length;return e<0?renderCountStatus(A.t("{maxTokens} keywords maximum",{maxTokens:50}),!0):renderCountStatus(A.t("{count, plural, =1 {# token} other {# tokens}} left",{count:e}))}return null},[d,w,v]),H=(0,i.useMemo)(()=>({filterQuery:w,options:[],selectId:r}),[w,r]),U=d&&0===getFormatErrors(w?.trim()).length,V=(0,i.useCallback)(()=>null,[]);return i.createElement("div",{className:"margin_bottom_125 position_relative"},i.createElement(x.A,{width:"100%",placeholderText:n,selectState:_,setSelectState:F,onFocus:L,onBlur:R,onKeyDown:D,onFilterQueryPaste:M,inputRef:c}),U&&i.createElement(S.Ay,{className:"position_absolute full_width",emptyStateMessage:e=>i.createElement("div",{className:"display_flex justify_content_between full_width caption"},i.createElement("div",null,A.t("Add \u201C{filterQuery}\u201D",{filterQuery:e})),i.createElement("div",{className:"flex_shrink_none margin_left_50 sk_foreground_max"},A.rt("Return to add"))),renderOption:V,selectState:H,setSelectState:h.A,width:1}),i.createElement("div",{className:"margin_top_50 display_flex justify_content_between"},i.createElement("div",{className:"caption sk_foreground_max",role:"note"},e),B),P&&i.createElement(s.A,{errors:P}))});var v=a(0x226892387),T=a(0x1c8beab7f);let O=new o.Ay("modernselling"),RolesSelectMatch=({matches:e,onBlur:t,onChange:a})=>{let n,r=(0,v.d4)(T.Ey),o=(0,i.useCallback)(t=>n=>{a({...e,[t]:n})},[e,a]);return i.createElement(m.v,null,i.createElement(l.A,{className:"bold",text:O.t("Contain")}),i.createElement(E,{instruction:O.rt("Include roles with any keyword match in their names"),onBlur:t,onChange:o("containsOneOf"),placeholderText:O.t("ex. AMER SVP, RVP, Retail"),selectedValues:e?.containsOneOf.values,selectId:"containsOneOf"}),i.createElement(l.A,{className:"bold",text:O.t("Do not contain")}),i.createElement(E,{instruction:O.rt("Exclude roles with any keyword match in their names"),onBlur:t,onChange:o("containsNoneOf"),placeholderText:O.t("ex. ACME, CSE"),selectedValues:e?.containsNoneOf.values,selectId:"containsNoneOf"}),r&&i.createElement(d.A,{className:"display_flex align_items_center",href:(n=r.instance_url,`${n}/lightning/setup/Roles/home`)},i.createElement(u.Ah,{name:"new-window",inline:!0,size:"20"}),i.createElement("span",{className:"margin_left_25"},O.t("Check all roles in Salesforce"))))};RolesSelectMatch.displayName="RolesSelectMatch";var N=a(0x16cf1da63),k=a(0x1407c6c2c),I=a(0x133aee58f),F=a(0x18a03595d),D=a(0x1952a5c50),M=a(0x4a120eb2),R=a(0x2fd935d8);let L=new o.Ay("modernselling"),RolesSelectSpecific=({onBlur:e,onChange:t,selectedRoles:a})=>{let n=(0,N.wA)(),r=(0,k.A)(),o=(0,I.A)(!0),l=(0,i.useCallback)(async e=>{if(!(0,D.u)(e))return[{label:L.t("Type at least 3 characters to search roles"),value:"",options:[]}];let{records:t}=await n((0,R.R)({sobjects:[{sobjectApiName:"UserRole",fields:["Name"]}],asIntegrationUser:!0,query:e,...o&&{salesforceOrgId:o},reason:"notifications_role_search"}));return t},[n,o]),s=(0,i.useCallback)(e=>{t(e.map(e=>({id:e.value,name:e.label})))},[t]);return i.createElement(M.x,{className:"normal",onBlur:e,classPrefix:"p-sales_notifications__workflow__form__field__select",debounceWaitPeriod:F.Vp,onSelectedItemsChange:s,placeholderText:L.t("Search for roles"),search:l,selectedOptions:a?.map(e=>({key:e.id,value:e.id,label:e.name})),selectId:r,width:"100%"})};RolesSelectSpecific.displayName="RolesSelectSpecific";var P=a(0x1d104c491);let B=new o.Ay("modernselling"),H={filter:P.yP.Specific,match:{containsOneOf:{isValid:!0,values:[]},containsNoneOf:{isValid:!0,values:[]}},specific:[]},RolesSelect=({errors:e,hasMatchOption:t=!0,isOptional:a=!1,onBlur:n,onChange:o,recipientRoles:d})=>{let u=d||H;t||(u.filter=P.yP.Specific);let m=(0,i.useMemo)(()=>[{label:B.t("Specific roles"),value:P.yP.Specific},{label:B.t("Roles with matching keyword"),value:P.yP.Match}],[]),p=(0,i.useCallback)(e=>{o({...u,filter:e.value})},[o,u]),g=(0,i.useCallback)(e=>{o({...u,match:e})},[o,u]),f=(0,i.useCallback)(e=>{o({...u,specific:e})},[o,u]);return(0,r.A)(()=>{o({...u})}),i.createElement(i.Fragment,null,i.createElement(l.A,{className:"p-sales_notifications__workflow__form__field margin_bottom_75",text:B.t("Narrow by roles"),optional:a},t?i.createElement(c.Ay,{onOptionSelected:p,options:m,selectedOption:m.find(e=>e.value===u.filter),width:"100%"}):i.createElement(RolesSelectSpecific,{onBlur:n,onChange:f,selectedRoles:u.specific})),t&&i.createElement(i.Fragment,null,u.filter===P.yP.Match&&i.createElement(RolesSelectMatch,{matches:u.match,onBlur:n,onChange:g}),u.filter===P.yP.Specific&&i.createElement(RolesSelectSpecific,{onBlur:n,onChange:f,selectedRoles:u.specific})),e&&i.createElement(s.A,{errors:e}),i.createElement("div",{className:"caption sk_dark_grey margin_top_50"},B.t("People without access to a sales dashboard won\u2019t receive notifications.")))};RolesSelect.displayName="RolesSelect"},0x4cdd4e70:(e,t,a)=>{"use strict";a.d(t,{A:()=>M});var n=a(0xbad225b5),i=a(0x120c268ad),r=a.n(i),o=a(0x1595bdd0),l=a(0x1407c6c2c),s=a(0x1df96de4c),c=a(0x20482ad21),d=a(0x1d2cd7755),u=a(0x15014e268),m=a(0x3bf6c48),p=a(0x16cf1da63),g=a(0x1d1911997),f=a(0x133aee58f);let select_option=({label:e,width:t=16,height:a,image:i})=>n.createElement("div",{className:"display_flex align_items_center"},"string"==typeof i?n.createElement("img",{alt:e,className:"margin_right_50",height:a,src:i,width:t}):n.createElement("span",{className:"display_flex margin_right_50"},i),e);var _=a(0x18a03595d),h=a(0x1952a5c50),b=a(0xa9a7442),y=a(0x2fd935d8);let x=a.p+"account-24d2400.svg",S=new c.Ay("modernselling"),A=[],AccountsSearchSelect=({isAdmin:e=!1,value:t,errors:a,className:i,initialSelectOptions:o=A,isLoading:s,onBlur:c,onChange:d})=>{let u=(0,p.wA)(),m=(0,l.A)(),C=(0,n.useRef)(!0),w=(0,f.A)(e),E=(0,n.useCallback)(e=>d(e),[d]),v=(0,n.useCallback)(async t=>{if(C.current||!(0,h.u)(t))return C.current=!1,o;let{records:a}=await u((0,y.R)({sobjects:[{sobjectApiName:"Account",fields:["Name"]}],asIntegrationUser:e,query:t,...w&&{salesforceOrgId:w},reason:"notifications_account_search"}));return a},[u,o,e,w]),T=(0,n.useCallback)(({label:e},{isGroupHeader:t})=>t?e:n.createElement(select_option,{width:12,image:x,label:e}),[]),O=(0,n.useCallback)(({label:e})=>n.createElement(select_option,{width:16,image:x,label:e}),[]);return n.createElement("div",{className:r()("p-sales_notifications__workflow__form__field",i)},s&&n.createElement(g.Ay,{isLoading:!0,options:o,selectId:m,width:"100%"}),!s&&n.createElement(b.m,{errors:a,onBlur:c,classPrefix:"p-sales_notifications__workflow__form__field__select",debounceWaitPeriod:_.Vp,onOptionSelected:E,placeholderText:S.t("Search for accounts"),renderOption:T,renderSelectedOption:O,search:v,selectId:m,selectedOption:t||void 0,width:"100%"}))};AccountsSearchSelect.displayName="AccountsSearchSelect";var C=a(0xa7ec93c2),w=a(0x85e904d5),E=a(0x91728dda),v=a(0x226892387),T=a(0x1d104c491);let O=new c.Ay("modernselling"),MatchCriteriaSelect=({className:e,errors:t,onBlur:a,onChange:i,value:o})=>{let l=(0,n.useRef)(null),s=(0,v.d4)(E.QJ),c=(0,n.useMemo)(()=>s?[{label:O.t("Direct owner"),options:[{label:O.t("Opportunities you own"),value:T.Jd.OpportunityOwnedByMe},{label:O.t("Opportunities on an account you own"),value:T.Jd.AccountOwnedByMe}],value:T.Jd.AccountOwnedByMe},{label:O.t("Manager or leader"),options:[{label:O.t("Opportunities that roll up to you"),value:T.Jd.OpportunityOwnedByAnyoneInReportChain},{label:O.t("Opportunities on accounts that roll up to you"),value:T.Jd.AccountOwnedByReportChain}],value:T.Jd.AccountOwnedByReportChain},{label:O.t("Any ownership"),value:T.Jd.Any}]:[{label:O.t("You own the account"),value:T.Jd.AccountOwnedByMe},{label:O.t("Your direct report owns the opportunity"),value:T.Jd.OpportunityOwnedByDirectReports},{label:O.t("You own the opportunity"),value:T.Jd.OpportunityOwnedByMe},{label:O.t("People who roll up to you own the opportunity"),value:T.Jd.OpportunityOwnedByAnyoneInReportChain},{label:O.t("People who roll up to you own the accounts"),value:T.Jd.AccountOwnedByReportChain}],[s]),[u,m]=(0,n.useState)({filterQuery:"",options:c,selectedOptions:[],selectId:"matchCriteriaSelect"}),p=(0,n.useCallback)(e=>{m(t=>{let a=e();return void 0!==a.filterQuery&&a.filterQuery!==t.filterQuery?a=(0,w.k)(c,a):s&&void 0!==a.selectedOptions&&(a.selectedOptions.some(e=>e.value===T.Jd.Any)&&!o.includes(T.Jd.Any)?a.selectedOptions=[c.find(e=>e.value===T.Jd.Any)]:a.selectedOptions=a.selectedOptions.filter(e=>e.value!==T.Jd.Any)),{...t,...a}})},[s,c,o]),g=(0,n.useCallback)(e=>{i(e.map(e=>e.value))},[i]);return n.createElement(d.A,{text:O.t("Ownership"),className:r()("p-sales_notifications__workflow__form__field",e)},n.createElement(C.yW,{inputRef:l,width:"100%",expandOnFocus:!0,className:e,shouldAllowUnselectInMultiSelectMode:!0,onBlur:a,errors:t,selectState:u,setSelectState:p,onSelectedItemsChange:g}))};MatchCriteriaSelect.displayName="MatchCriteriaSelect";var N=a(0x30e98603);let k=new c.Ay("modernselling"),I=[],OpportunitySearchSelect=({isAdmin:e=!1,value:t,errors:a,initialSelectOptions:i=I,isLoading:r,onBlur:o,onChange:s})=>{let c=(0,p.wA)(),d=(0,l.A)(),u=(0,n.useRef)(!0),m=(0,f.A)(e),x=(0,n.useCallback)(e=>s(e),[s]),S=(0,n.useCallback)(async t=>{if(u.current||!(0,h.u)(t))return u.current=!1,i;let{records:a}=await c((0,y.R)({sobjects:[{sobjectApiName:"Opportunity",fields:["Name"]}],asIntegrationUser:e,query:t,...m&&{salesforceOrgId:m},reason:"notifications_opportunity_search"}));return a},[c,i,e,m]),A=(0,n.useCallback)(({label:e},{isGroupHeader:t})=>t?e:n.createElement(select_option,{width:12,image:n.createElement(N.Ay,{fillColor:N.n9.ORANGE,size:N.or.SMALL}),label:e}),[]),C=(0,n.useCallback)(({label:e})=>n.createElement(select_option,{width:16,image:n.createElement(N.Ay,{fillColor:N.n9.ORANGE}),label:e}),[]);return n.createElement("div",{className:"p-sales_notifications__workflow__form__field"},r&&n.createElement(g.Ay,{isLoading:!0,options:I,selectId:d,width:"100%"}),!r&&n.createElement(b.m,{errors:a,onBlur:o,classPrefix:"p-sales_notifications__workflow__form__field__select",debounceWaitPeriod:_.Vp,onOptionSelected:x,placeholderText:k.t("Search for opportunity by name"),renderOption:A,renderSelectedOption:C,search:S,selectedOption:t||void 0,selectId:d,width:"100%"}))};OpportunitySearchSelect.displayName="OpportunitySearchSelect";var F=a(0x1122238d8);let D=new c.Ay("modernselling"),ScopeSelect=({isAdmin:e=!1,account:t,className:a,criteria:i,errors:c,ignoreScopes:p,onScopeTypeBlur:g,onScopeTypeChange:f,onScopeValueBlur:_,onScopeValueChange:h,opportunity:b,scope:y,key:x})=>{let S=(0,l.A)(),A=x??S,C=(0,v.d4)(E.QJ),w=(0,m.hz)({isAdmin:e}),O=(0,n.useMemo)(()=>e?[{label:D.t("All opportunities"),value:T.QO.All},{label:D.t("A specific opportunity"),value:T.QO.SpecificOpportunity},{label:D.t("A specific account\u2019s opportunities"),value:T.QO.SpecificAccount}].filter(e=>!p?.includes(e.value)):C?[{label:D.t("All opportunities"),value:T.QO.MatchCriteria},{label:D.t("A specific opportunity"),value:T.QO.SpecificOpportunity},{label:D.t("A specific account\u2019s opportunities"),value:T.QO.SpecificAccount}].filter(e=>!p?.includes(e.value)):[{label:D.t("Direct owner"),options:[{label:D.t("Opportunities you own"),value:T.QO.OwnedByMe},{label:D.t("Opportunities on an account you own"),value:T.QO.AccountsOwnedByMe}],value:T.QO.AccountsOwnedByMe},{label:D.t("Manager or leader"),options:[{label:D.t("Opportunities that roll up to you"),value:T.QO.OwnedByReportChain},{label:D.t("Opportunities on accounts that roll up to you"),value:T.QO.AccountOwnedByReportChain}],value:T.QO.OwnedByReportChain},{label:D.t("General"),options:[{label:D.t("All opportunities"),value:T.QO.All},{label:D.t("A specific opportunity"),value:T.QO.SpecificOpportunity},{label:D.t("A specific account\u2019s opportunities"),value:T.QO.SpecificAccount}],value:T.QO.SpecificOpportunity}].map(e=>e.options?{label:e.label,options:e.options.filter(e=>!p?.includes(e.value)),value:e.value}:e),[C,p,e]),N=(0,n.useCallback)(e=>f(e.value),[f]),k=(0,n.useCallback)(()=>_?.(y),[y,_]),I=(0,n.useCallback)(e=>h(y,e),[h,y]),M=(0,m.b1)(()=>w("Account","My Accounts","Name").then(e=>{let t={label:D.t("Type at least 3 characters to search all accounts"),value:"",options:[]};return e?.length?[t,{label:D.t("My Accounts"),value:"",options:(0,o.A)(e?.map(F._F))}]:[t]})),R=(0,m.b1)(()=>w("Opportunity","My Opportunities","CloseDate").then(e=>{let t={label:D.t("Type at least 3 characters to search all opportunities"),value:"",options:[]};return e?.length?[t,{label:D.t("My Opportunities"),value:"",options:(0,o.A)(e?.map(F._F))}]:[t]})),L=(0,n.useMemo)(()=>(0,F.FT)(O).find(e=>e.value===y),[y,O]);return n.createElement("div",{className:a},n.createElement(d.A,{text:D.t("Opportunity type"),className:r()("p-sales_notifications__workflow__form__field",{margin_bottom_50:(0,F.V)(y)||(0,F.Su)(y)||(0,F.Yo)(y)})},n.createElement(u.Ay,{key:`${A}-${O.length}`,errors:c?.scope,options:O,selectId:A,onOptionsListClose:g,selectedOption:L,onOptionSelected:N,width:"100%",maxListHeight:400})),(0,F.V)(y)&&n.createElement(MatchCriteriaSelect,{errors:c?.criteria,value:i||s.Ml,onBlur:k,onChange:I}),(0,F.Su)(y)&&n.createElement(AccountsSearchSelect,{isAdmin:e,value:t,errors:c?.account,onBlur:k,onChange:I,isLoading:M.isLoading,initialSelectOptions:M.payload||void 0}),(0,F.Yo)(y)&&n.createElement(OpportunitySearchSelect,{isAdmin:e,value:b,errors:c?.opportunity,onBlur:k,onChange:I,isLoading:R.isLoading,initialSelectOptions:R.payload||void 0}))};ScopeSelect.displayName="ScopeSelect";let M=ScopeSelect},0xc2d5849d:(e,t,a)=>{"use strict";a.d(t,{A:()=>D});var n=a(0xbad225b5),i=a(0x120c268ad),r=a.n(i),o=a(0x1595bdd0),l=a(0x1407c6c2c),s=a(0x20482ad21),c=a(0x1d2cd7755),d=a(0x15014e268),u=a(0x133aee58f),m=a(0x1fe613d6e),p=a(0x226892387),g=a(0x1c8beab7f),f=a(0x1d104c491);let _=new s.Ay("modernselling");function useCanSendNotificationToChannel(e,t){let a=(0,u.A)(e)??"",n=(0,p.d4)(e=>(0,g.uS)(e,a));if((0,p.d4)(m.K)&&n?.allow_admins_to_send_to_all_channel_types)return{canSendNotificationToChannel:!0,canSendNotificationtoChannelCaption:""};if(n?.send_notification_to_channel_permission===f.$4.NO_CHANNELS)return{canSendNotificationToChannel:!1,canSendNotificationtoChannelCaption:t?_.t("Sending to a channel has been turned off by an administrator. Click Save Notification to use the sales dashboard."):_.t("Sending to a channel has been turned off by an administrator.")};return{canSendNotificationToChannel:!0,canSendNotificationtoChannelCaption:""}}var h=a(0xb62e6bf4),b=a(0x200c38ed8),y=a(0x253c586a2),x=a(0x12185e091),S=a(0xb8504a42),A=a(0x217553e42),C=a(0x1ee439e69);let w=new s.Ay("modernselling"),ChannelsSelect=({className:e,errors:t,isAdmin:a,channelId:i,onBlur:o,placeholder:l,...s})=>{let c=(0,p.d4)(C.H7),d=(0,S.kA)(c),m=(0,p.d4)(h.ss),_=l||w.t("Search for channel"),E=(0,u.A)(a)??"",{isFetchingPrefs:v,searcherOptions:T}=(0,b.qI)(E),O=(0,p.d4)(e=>(0,g.uS)(e,E)),N=(0,p.d4)(e=>(0,A.OL)(e,i)),k=(0,n.useMemo)(()=>{let e=[];return t&&e.push(...t),O?.send_notification_to_channel_permission===f.$4.PRIVATE_CHANNELS_ONLY&&(0,x.rW)(N)&&e.push({id:"restricted_channel_type",message:w.t("Sending to a public channel has been turned off by an administrator.")}),e},[t,O?.send_notification_to_channel_permission,N]);return n.createElement("div",{className:r()(e)},n.createElement(y.NV,{key:v?"fetching":"fetched",...s,ariaLabel:w.t("Search for channel"),searcherOptions:T,placeholder:_,className:"p-sales_notifications__workflow__form__field__channel_select",isRequired:!0,isDisabled:v,errors:k,onOptionsListClose:o,showTeamForLocalChannels:d||m}))};ChannelsSelect.displayName="ChannelsSelect";var E=a(0x10d53599f);let v=new s.Ay("modernselling"),MemberSelect=({errors:e,onBlur:t,onChange:a,selectedMember:i,currentUserId:r})=>{let o=(0,l.A)(),s=(0,n.useCallback)(e=>n.createElement(E.A,{id:e.value,showAvatar:!0,showPresence:!1}),[]),c=(0,n.useCallback)(e=>{a(e.value)},[a]),u=(0,n.useMemo)(()=>[{value:r,label:"self"}],[r]),m=(0,n.useMemo)(()=>i?{value:i,label:"selected"}:void 0,[i]);return n.createElement("div",{className:"p-sales_notifications__workflow__form__field"},n.createElement(d.Ay,{className:"normal",errors:e,onBlur:t,classPrefix:"p-sales_notifications__workflow__form__field__select",placeholderText:v.t("Select a user",{fallbackHash:"6876c5c6fc9e725b31fc5f6014d319fb5e2b9c51"}),renderOption:s,renderSelectedOption:s,options:u,selectedOption:m,onOptionSelected:c,shouldAllowUnselectInSingleSelectMode:!1,selectId:o,selectDataQa:"member-select",width:"100%",isRequired:!0}))};MemberSelect.displayName="MemberSelect";var T=a(0x1122238d8),O=a(0x91728dda),N=a(0x19c76d181),k=a(0x250d8187a),I=a.n(k);let F=new s.Ay("modernselling");function getCaption(e,t){return t?F.t("Sending scheduled notifications to channels is not supported right now."):e||""}let SendToSelect=({channelId:e=null,tokenUserId:t=null,className:a,destination:i=f.Oz.SalesHome,errors:s,isAdmin:m,isRecurring:g,isEditNotification:_,onChannelSelectBlur:h,onChannelSelected:y,onTokenSelectBlur:x,onTokenSelected:S,onSendToSelected:A})=>{let C=(0,l.A)(),w=(0,u.A)(m)??"",{isFetchingPrefs:E}=(0,b.qI)(w),{canSendNotificationToChannel:v,canSendNotificationtoChannelCaption:k}=useCanSendNotificationToChannel(m,_),D=getCaption(k,g),M=!v||g,R=(0,n.useMemo)(()=>(0,o.A)([{label:m?F.t("Recipient\u2019s sales dashboards"):F.t("Your sales notifications"),value:f.Oz.SalesHome},!M&&{label:F.t("A channel"),value:f.Oz.Channel}]),[m,M]),L=(0,p.d4)(N.WR),P=(0,p.d4)(O.V$),B=(0,n.useCallback)(({value:e})=>{(0,T.lA)(e)?P&&S(L):(y(null),S(null)),A(e)},[y,A,L,S,P]);return(0,n.useEffect)(()=>{M&&(A(f.Oz.SalesHome),y(null))},[i,M,A,y]),n.createElement(n.Fragment,null,n.createElement(c.A,{text:F.t("Notification destination"),className:r()("p-sales_notifications__workflow__form__field",(0,T.lA)(i)&&"margin_bottom_75",a)},n.createElement(d.Ay,{ariaLabel:F.t("Notification destination"),key:M?"single-option":"multi-option",errors:s?.sendTo,isDisabled:1===R.length||E,onOptionSelected:B,options:R,selectedOption:R.find(e=>e.value===i),selectId:C,width:"100%"}),(0,T.lA)(i)&&n.createElement("div",{className:"caption full_width sk_foreground_max margin_top_50"},P?F.t("Notifications will be visible to everyone in the channel."):F.t("Notifications will be visible to everyone in the channel, and show data accessible by the integration user.")),D&&n.createElement("div",{className:"caption margin_top_50 sk_foreground_max"},D)),(0,T.lA)(i)&&n.createElement(ChannelsSelect,{className:r()(I().channelSelect,P&&I().channelSelectWithTokenSelect),isAdmin:m,onBlur:h,onChange:y,channelId:e,value:e,errors:s?.channelId}),P&&(0,T.lA)(i)&&n.createElement(c.A,{text:P?F.t("Notification token"):"Notification token",className:r()("p-sales_notifications__workflow__form__field",(0,T.lA)(i)&&"margin_bottom_75",a)},n.createElement("div",{className:"caption full_width sk_foreground_max"},P?F.t("Notifications will only contain information this account can access in Salesforce.",{fallbackHash:"4cd03e97a30852a3e507298a63fb6b5e216449c6"}):"Notifications will only contain information this account can access in Salesforce."),n.createElement(MemberSelect,{errors:s?.tokenUserId,onBlur:x,onChange:S,selectedMember:t,currentUserId:L})))};SendToSelect.displayName="SendToSelect";let D=SendToSelect},0x1c3fd5e76:(e,t,a)=>{"use strict";a.d(t,{A:()=>f,N:()=>UnstyledStageSelect});var n=a(0xbad225b5),i=a(0x120c268ad),r=a.n(i),o=a(0x1407c6c2c),l=a(0x20482ad21),s=a(0x1d2cd7755),c=a(0x15014e268),d=a(0x1d1911997),u=a(0x13d4e5f52),m=a(0x1122238d8);let p=new l.Ay("modernselling"),g=[],UnstyledStageSelect=({errors:e,isLoading:t,onBlur:a,onChange:i,opportunitySchema:r,value:l,isAdmin:s})=>{let p=(0,o.A)(),f=(0,n.useRef)(!1),_=(0,u.q)("stage",r,s),h=(0,n.useMemo)(()=>_?(0,m.I_)(_,"desc"):g,[_]),b=(0,n.useMemo)(()=>{if(l){let e=h.find(e=>e.label===l.label);if(e)return e}return h.find(e=>"Closed Won"===e.label)||h[0]||null},[h,l]);return(0,n.useEffect)(()=>{l||t||f.current||(f.current=!0,i(b))},[l,t,i,b]),n.createElement(n.Fragment,null,t&&n.createElement(d.Ay,{onBlur:a,errors:e,isRequired:!0,isLoading:t,options:g,selectId:p,width:"100%"}),!t&&n.createElement(c.Ay,{onBlur:a,errors:e,isRequired:!0,onOptionSelected:i,options:h||g,selectedOption:b,selectId:p,width:"100%"}))};UnstyledStageSelect.displayName="UnstyledStageSelect";let StageSelect=({className:e,...t})=>n.createElement(s.A,{text:p.t("Stage for \u201Cwin\u201D"),className:r()("p-sales_notifications__workflow__form__field",e)},n.createElement(UnstyledStageSelect,t));StageSelect.displayName="StageSelect";let f=StageSelect},0xd7a36639:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(0xbad225b5),i=a(0x1407c6c2c),r=a(0x20482ad21),o=a(0x15014e268),l=a(0xe08dc76c);let s=new r.Ay("modernselling"),TimePeriodFrameSelect=({errors:e,onChange:t,temporalFrame:a,isDisabled:r=!1})=>{let c=(0,i.A)(),d=(0,n.useCallback)(e=>{t(e.value)},[t]),u=(0,n.useMemo)(()=>[{value:l.kH.Previous,label:s.t("last")},{value:l.kH.Current,label:s.t("this")},{value:l.kH.Next,label:s.t("next")}],[]);return n.createElement(o.Ay,{errors:e,isRequired:!0,onOptionSelected:d,options:u,selectedOption:u.find(e=>a===e.value),selectId:c,width:"auto",className:"flex_one",isDisabled:r})};TimePeriodFrameSelect.displayName="TimePeriodFrameSelect";let c=TimePeriodFrameSelect},0x26f5f245:(e,t,a)=>{"use strict";a.d(t,{A:()=>f});var n=a(0xbad225b5),i=a(0x120c268ad),r=a.n(i),o=a(0x1595bdd0),l=a(0x1407c6c2c),s=a(0x20482ad21),c=a(0x12edaa96a),d=a(0x15014e268),u=a(0xe08dc76c);let m=new s.Ay("modernselling"),p=[],g=new Set([u.ts.DAYS,u.ts.MONTHS,u.ts.FISCAL_QUARTER,u.ts.FISCAL_YEAR]),TimePeriodSelect=({className:e,timePeriods:t=g,errors:a,selectedTimePeriod:i,onChange:s,onBlur:f,periodNum:_,isDisabled:h=!1})=>{let b=(0,l.A)(),y=(0,n.useCallback)(e=>{s(e.value)},[s]),x=(0,n.useMemo)(()=>{let e=[{value:u.ts.FISCAL_QUARTER,label:m.t("{periodNum, plural, one {Fiscal quarter} other {Fiscal quarters}}",{periodNum:_})},{value:u.ts.FISCAL_YEAR,label:m.t("{periodNum, plural, one {Fiscal year} other {Fiscal years}}",{periodNum:_})},{value:u.ts.DAYS,label:m.t("{periodNum, plural, one {Day} other {Days}}",{periodNum:_})},{value:u.ts.MONTHS,label:m.t("{periodNum, plural, one {Month} other {Months}}",{periodNum:_})}];return(0,o.A)(e.filter(e=>e&&t?.has(e.value)))},[_,t]),S=(0,n.useMemo)(()=>`${(0,c.A)()}-${x.length}`,[x]);return n.createElement(d.Ay,{key:S,onBlur:f,errors:a,isRequired:!0,onOptionSelected:y,options:x||p,selectedOption:x.find(e=>i===e.value),selectId:b,width:"auto",className:r()(e,{flex_one:!e}),isDisabled:h})};TimePeriodSelect.displayName="TimePeriodSelect";let f=TimePeriodSelect},0x199da57a4:(e,t,a)=>{"use strict";a.d(t,{Y:()=>TriggerScheduleSelect});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x1e217163d),o=a(0x6374e095),l=a(0x1f2c612f5),s=a(0x1d104c491);let c=new i.Ay("modernselling"),d=[s.Ns.daily,s.Ns.weekdays,s.Ns.weekly],TriggerScheduleSelect=({frequency:e,onFrequencyChange:t,onStartTimeBlur:a,onStartTimeChange:i,startTime:s,startTimeErrors:u})=>{let m=c.t("Will send based on recipient\u2019s configured timezone");return n.createElement(r.B,{space:"125"},n.createElement(o.e,{caption:m,errors:u,onBlur:a,onChange:i,required:!0,value:s}),n.createElement(l.x,{frequencies:d,onChange:t,startDate:s,value:e}))};TriggerScheduleSelect.displayName="TriggerScheduleSelect"},0x2253dfab8:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x2333b5d68);let o=new i.Ay("modernselling"),NotificationConditions=({title:e})=>n.createElement(r.A,{iconName:"clock",title:e||o.t("When\u2026")});NotificationConditions.displayName="NotificationConditions";let l=NotificationConditions},0xd2e7c536:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x2333b5d68);let o=new i.Ay("modernselling"),NotificationDestination=({title:e})=>n.createElement(r.A,{iconName:"user-groups",title:e||o.t("To\u2026")});NotificationDestination.displayName="NotificationDestination";let l=NotificationDestination},0x13fb6986a:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x11a296110),o=a(0x15e813115),l=a.n(o);let NotificationPreviewTitle=({children:e})=>n.createElement("span",{className:l().notificationPreviewTitle},e);NotificationPreviewTitle.displayName="NotificationPreviewTitle";var s=a(0x2333b5d68),c=a(0x6960d8b9);let d=new i.Ay("modernselling"),NotificationPreview=({body:e,children:t,imageUrl:a,title:i,buttonLabel:o,showNotificationButton:l})=>n.createElement(s.A,{iconName:"send",title:d.t("Send this notification")},n.createElement(n.Fragment,null,n.createElement("div",{className:"display_flex flex_wrap align_items_start"},n.createElement("div",{className:"margin_top_25"},n.createElement("img",{src:a,alt:i})),n.createElement("div",{className:"flex_one margin_left_50"},n.createElement("div",{className:"display_flex justify_content_between flex_wrap"},n.createElement(NotificationPreviewTitle,null,i),n.createElement("span",{className:"micro sk_light_grey margin_left_50 flex_shrink_none"},(0,c.Yq)("11:30 AM","{time}"))),n.createElement("div",null,e),l&&n.createElement(r.Ay,{className:"flex_two margin_top_50",type:"outline",size:"small"},o||i))),t));NotificationPreview.displayName="NotificationPreview";let u=NotificationPreview},0x1122238d8:(e,t,a)=>{"use strict";a.d(t,{AS:()=>toSelectOptionFromSchema,Bf:()=>f,DD:()=>_,FT:()=>toFlatSelectOptions,I_:()=>getSelectOptionsFromFieldSchema,JC:()=>labelSort,L8:()=>s,N:()=>p,Ro:()=>toNumber,Su:()=>d,V:()=>c,Xk:()=>m,Yo:()=>u,_F:()=>toSelectOptionFromSfdcObjectField,dy:()=>b,g0:()=>g,g1:()=>h,lA:()=>isSendToChannel,ti:()=>isSendToSalesHome});var n=a(0x174bb7323),i=a(0x1595bdd0),r=a(0xe1870af4),o=a(0x2172ff7ff),l=a(0x1d104c491);function labelSort(e,t){return(0,o.Ay)((0,n.A)(e.label),(0,n.A)(t.label))}function toNumber(e,t=!1){return+(t?`${e||0}`.replace(/[^-\d.]/g,""):`${e||0}`.replace(/[^-\d]/g,""))||0}function toFlatSelectOptions(e){return e.reduce((e,t)=>(t.options?t.options.forEach(t=>{e.push(t)}):e.push(t),e),[])}function toSelectOptionFromSfdcObjectField(e){return e?.Id?.value&&e?.Name?.value?{key:e.Id.value,value:e.Id.value,label:e.Name.value}:null}function toSelectOptionFromSchema(e){if(!e||!e.identifier||!1===e.is_active)return null;let t=e.label||e.identifier;return{key:e.identifier,value:e.identifier,label:t}}function getSelectOptionsFromFieldSchema(e,t="asc"){return(0,i.A)((0,r.A)(e?.options||[],"position",[t]).map(toSelectOptionFromSchema))}function isScope(e){return t=>e===t}function isWorkflowView(e){return t=>!!e?.includes(t)}function hasCriteria(e){return t=>t?.includes(e)}let s=isScope(l.QO.All),c=isScope(l.QO.MatchCriteria),d=isScope(l.QO.SpecificAccount),u=isScope(l.QO.SpecificOpportunity),m=isWorkflowView([l.Lb.adminAmountChanged,l.Lb.userAmountChanged]),p=isWorkflowView([l.Lb.adminDealWon,l.Lb.userDealWon]);isWorkflowView([l.Lb.adminForecastReminder,l.Lb.userForecastReminder]);let g=isWorkflowView([l.Lb.adminNewOpportunityAlert,l.Lb.userNewOpportunityAlert]),f=isWorkflowView([l.Lb.adminStageChanged,l.Lb.userStageChanged]),_=isWorkflowView([l.Lb.adminCloseDateChanged,l.Lb.userCloseDateChanged]),h=isWorkflowView(Object.values(l.YB)),b=hasCriteria(l.Jd.Any),isSendToSalesHome=e=>e===l.Oz.SalesHome,isSendToChannel=e=>e===l.Oz.Channel},0x348940af:(e,t,a)=>{"use strict";a.d(t,{A:()=>w});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0xe0376d2),o=a(0x40c0d834),l=a(0x20482ad21),s=a(0x11a296110),c=a(0x2501a2cee),d=a(0x6e87d4ec),u=a(0x1fdec3e16),m=a(0x3ebf4390),p=a(0x173712bc0),g=a(0x62accd6b),f=a(0x91728dda),_=a(0x3711e82d),h=a(0x226892387),b=a(0x16b708a7f),y=a(0x1c8beab7f),x=a(0x11d9e4b2f),S=a(0x1d104c491),A=a(0x16ffed5ab);let C=new l.Ay("modernselling"),WorkflowHeader=({description:e,imageUrl:t,isAdmin:a=!1,onSave:l,title:w})=>{let E=(0,h.d4)(f.QJ),v=(0,h.d4)(f.Jx),T=(0,h.d4)(f.V$),O=(0,i.wA)(),[N,k]=(0,n.useState)(!1),[I,F]=(0,n.useState)(!1),D=(0,h.d4)(y.RC),M=(0,h.d4)(a?y.uJ:y.EH),R=(0,g.Ht)(M),L=(0,p.A)(a),P=(0,h.d4)(e=>(0,y.DY)(e,a)),B=R?.type!==S.g$.UserReminder&&R?.type!==S.g$.AdminReminder&&R?.isRecurring,H=(0,n.useMemo)(()=>({elementName:L?"update_notification":"add_notification",action:L?_.UiAction.UPDATE:_.UiAction.ADD,onClick:{enableClogAction:!0}}),[L]),U=(0,n.useMemo)(()=>R&&(R.type===S.g$.UserOpportunityChanged||R.type===S.g$.AdminOpportunityChanged)&&R.scope?R.scope:void 0,[R]),V=(0,n.useMemo)(()=>{let e=[];if(!E){if(U)switch(U){case S.QO.All:case S.QO.SpecificOpportunity:case S.QO.SpecificAccount:e.push(S.bc.General);break;case S.QO.OwnedByMe:case S.QO.AccountsOwnedByMe:e.push(S.bc.DirectOwner);break;case S.QO.AccountOwnedByReportChain:case S.QO.OwnedByDirectReports:case S.QO.OwnedByReportChain:e.push(S.bc.ManagerOrLeader)}return(0,r.A)(e)}if(R&&R.type===S.g$.UserOpportunityChanged&&R.scope===S.QO.MatchCriteria&&R.criteria)for(let t of R.criteria)switch(t){case S.Jd.Any:e.push(S.bc.Any);break;case S.Jd.OpportunityOwnedByMe:case S.Jd.AccountOwnedByMe:e.push(S.bc.DirectOwner);break;case S.Jd.AccountOwnedByReportChain:case S.Jd.OpportunityOwnedByDirectReports:case S.Jd.OpportunityOwnedByAnyoneInReportChain:e.push(S.bc.ManagerOrLeader)}return(0,r.A)(e)},[U,E,R]),W=(0,n.useMemo)(()=>{let e=[];switch(R?.recipientType){case S._Y.User:e.push(S.bc.General);break;case S._Y.Owner:case S._Y.AccountOwner:e.push(S.bc.DirectOwner);break;case S._Y.AccountManagerChain:case S._Y.ManagerChain:e.push(S.bc.ManagerOrLeader)}return(0,r.A)(e)},[R]),q=(0,n.useMemo)(()=>R?.type===S.g$.UserOpportunityChanged?V:R?.type===S.g$.AdminOpportunityChanged?W:void 0,[R,V,W]);(0,n.useEffect)(()=>{I&&(0,m.cB)(M,R,{experimentLobOrg62UnrestrictedGroupOn:v,experimentLobChannelAcnTokenGroupOn:T}).ok&&F(!1)},[I,M,R,v,T]);let j=(0,n.useCallback)(async()=>{if(!M||!l)return;let{ok:e}=O((0,x.A)({workflowView:M}));if(!e)return void F(!0);k(!0),O((0,b.a2)({workflowView:M,formSubmitError:null}));try{await l(),a?O((0,b.kC)(null)):O((0,b.yK)(null)),O((0,b.a2)({workflowView:M,values:null,errors:null,formSubmitError:null})),O((0,A.M)({element:n.createElement(d.A,{svgIconProps:{name:"check"}},C.t("Notification saved."))}))}catch(e){O((0,b.a2)({workflowView:M,formSubmitError:C.t("There was a problem saving this notification. Please try again.")}))}k(!1)},[M,l,O,a]),Y=(0,n.useCallback)(()=>{if(a){O((0,b.JH)()),M===S.Lb.adminSelectNotificationType||L?O((0,b.kC)(null)):O((0,b.kC)({workflowView:S.Lb.adminSelectNotificationType}));return}O((0,b.LO)()),M===S.Lb.userSelectNotificationType||L?O((0,b.yK)(null)):O((0,b.yK)({workflowView:S.Lb.userSelectNotificationType}))},[O,a,M,L]);return n.createElement(o.A,{eventId:_.EventId.LOB_NOTIFICATIONS,uiComponentName:_.UiComponentName.LOB_NOTIFICATION_WORKFLOW,lobNotificationWorkflowView:M??void 0,lobNotificationWorkflowScope:U,lobNotificationWorkflowCriteriaGroup:q,isLobNotificationWorkflowAdmin:a,isLobNotificationWorkflowScheduled:B,workflowId:P??void 0,salesforceOrgId:D||""},n.createElement("div",{className:"p-view_header p-sales_notifications__workflow_header"},n.createElement("div",{className:"display_flex align_items_center"},n.createElement(s.jV,{"aria-label":C.t("Back"),onClick:Y},n.createElement(c.Ah,{name:"caret-left-full"})),t?n.createElement("img",{className:"p-sales_notifications__workflow_header__image",alt:w,src:t}):null,n.createElement("h2",null,n.createElement(u.A,{lines:1},w)),e?n.createElement(u.A,{lines:2},n.createElement("div",{className:"p-sales_notifications__workflow_header__description"},e)):null),l?n.createElement(s.lV,{disabled:I,loading:N,onClick:j,autoClogProps:H,"aria-label":C.t("Save Notification")},C.t("Save Notification")):null))};WorkflowHeader.displayName="WorkflowHeader";let w=WorkflowHeader},0x92e81718:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(0xbad225b5),i=a(0x107cfc47d);let WorkflowLoading=()=>n.createElement(i.IS,null,n.createElement(i.cp,{isLoading:!0}),n.createElement(i.OC,null));WorkflowLoading.displayName="WorkflowLoading";let r=WorkflowLoading},0x107cfc47d:(e,t,a)=>{"use strict";a.d(t,{IS:()=>WorkflowPageBase,OC:()=>WorkflowPageSecondaryContent,cp:()=>WorkflowPagePrimaryContent});var n=a(0xbad225b5),i=a(0x20482ad21),r=a(0x2b7f0bcc),o=a(0xb1ea448c),l=a(0x226892387),s=a(0x1c8beab7f);let c=new i.Ay("modernselling"),WorkflowPageBase=({children:e})=>n.createElement("div",{className:"p-sales_notifications__workflow"},n.createElement("div",{className:"p-sales_notifications__workflow__page"},e));WorkflowPageBase.displayName="WorkflowPageBase";let WorkflowPagePrimaryContent=({children:e,isAdmin:t=!1,isLoading:a=!1})=>{let i=(0,l.d4)(t?s.uJ:s.EH),c=(0,l.d4)(e=>i?(0,s.CP)(e,i):null);return a?n.createElement("div",{className:"full_width display_flex justify_content_center align_items_center"},n.createElement(o.A,null)):n.createElement("div",{className:"p-sales_notifications__workflow__page__primary"},c&&n.createElement(r.Ay,{type:"boxed",level:"error",className:"margin_bottom_150 full_width"},c),e)};WorkflowPagePrimaryContent.displayName="WorkflowPagePrimaryContent";let WorkflowPageSecondaryContent=({children:e})=>n.createElement("div",{className:"p-sales_notifications__workflow__page__secondary"},n.createElement("div",{className:"p-sales_notifications__workflow__page__secondary__inner"},e&&n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},c.t("What to expect")),n.Children.map(e,(e,t)=>t>0&&e?n.createElement(n.Fragment,null,n.createElement("div",{className:"p-sales_notifications__workflow__page__presentation_box_connector"}),e):e)));WorkflowPageSecondaryContent.displayName="WorkflowPageSecondaryContent"},0x2333b5d68:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(0xbad225b5),i=a(0x2501a2cee);let WorkflowPresentationBox=({iconName:e,title:t,children:a})=>n.createElement("div",{role:"presentation",className:"p-sales_notifications__workflow__presentation_box"},n.createElement("div",{className:"display_flex"},n.createElement("div",{className:"p-sales_notifications__workflow__presentation_box__icon"},n.createElement(i.Ah,{name:e,size:"18"})),n.createElement("div",{className:"flex_one margin_left_50"},t)),a&&n.createElement("div",{className:"margin_top_50"},a));WorkflowPresentationBox.displayName="WorkflowPresentationBox";let r=WorkflowPresentationBox},0x37d43f3:(e,t,a)=>{"use strict";a.d(t,{k:()=>SalesforceOrgSelect});var n=a(0xbad225b5),i=a(0x120c268ad),r=a.n(i),o=a(0x20482ad21),l=a(0x15014e268),s=a(0xa794c1d5),c=a(0x226892387),d=a(0x8ed8ca46),u=a(0x122c16d45),m=a.n(u);let p=new o.Ay("modernselling"),g="small",SalesforceOrgSelect=({allowEmptyInitialSelection:e=!1,bold:t=!1,className:a,fullWidth:i=!1,hideSelfIfSingleOrg:o=!0,initialSelectedOrgId:u,isDisabled:f=!1,onChange:_,requiresConfirmation:h=!1,showAllOrgsOption:b=!1,size:y=g,autoClogProps:x,shouldUpdateDefaultOrgOnChange:S=!0})=>{let A=(0,c.d4)(d.mO),C=o&&A.length<2,{handleSelect:w,options:E,selectedOption:v}=(0,s.V)({allowEmptyInitialSelection:e,doNotRender:C,initialSelectedOrgId:u,onChange:_,requiresConfirmation:h,shouldUpdateDefaultOrgOnChange:S,showAllOrgsOption:b}),T=(0,n.useCallback)(e=>n.createElement("span",{className:r()({bold:t})},e.orgName||e.label),[t]);return C?null:n.createElement(l.Ay,{className:r()(a,m().orgSelect,{[m().orgSelectMaxWidth]:!i}),classPrefix:"salesforce_org_select",isDisabled:f,isRequired:!0,options:E,placeholderText:p.t("Select an org"),selectId:"salesforce_org_select",size:y,onOptionSelected:w,renderSelectedOption:T,selectedOption:v,width:i?"100%":"auto",autoClogProps:x})};SalesforceOrgSelect.displayName="SalesforceOrgSelect"},0x1ec19bc0c:(e,t,a)=>{"use strict";a.d(t,{y:()=>UserOrgConnectionBaseModal});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x20482ad21),o=a(0x11a296110),l=a(0x189615fa),s=a(0x23b496ae9),c=a(0xf225ecf2),d=a(0x1c7997c1),u=a(0x96920791),m=a(0x16d221c7f),p=a(0x142775427),g=a(0x1f803375e),f=a(0x214e51545),_=a(0x1e217163d),h=a(0x20158cb6),b=a(0x14fad6485),y=a(0x226892387),x=a(0x1c8beab7f),S=a(0xcf9c4f5d);function useWaitForOrgConnection(e,t){let a=(0,i.wA)(),{windowRef:r}=(0,n.useContext)(b._0),o=(0,y.d4)(x.H2);(0,n.useEffect)(()=>{if("fetching"!==o)return;let handleRefocus=async()=>{await a((0,S.u)({salesforceOrgId:e,reason:"wait-for-org-connection"}))&&(r.deref()?.removeEventListener("focus",handleRefocus),t?.())};return r.deref()?.addEventListener("focus",handleRefocus),()=>{r.deref()?.removeEventListener("focus",handleRefocus)}},[r,a,o,e,t])}var A=a(0x1fcbb004d),C=a(0x230985d4a),w=a(0x40c0d834),E=a(0x1a02c72b5),v=a(0xd6a16321),T=a(0x20e80190e),O=a(0x3711e82d),N=a(0x1fb2d2a87),k=a(0x16b708a7f);let I=a.p+"onboarding-new-org-connected-dark-6a97fd8.png",F=a.p+"onboarding-new-org-connected-light-eaac6f1.png",D=new r.Ay("modernselling"),M={elementName:"sales_home_onboarding_new_org_connected",onClick:{enableClogAction:!0}},OnboardingNewOrgConnectedModal=()=>{let e=(0,i.wA)(),t=(0,y.d4)(N.to),a=(0,n.useCallback)(()=>{e((0,k.Ko)())},[e]),r=(0,n.useCallback)(()=>{e((0,A.O)()),a()},[e,a]),o=(0,n.useCallback)(()=>{e((0,A.O)()),e((0,E.o)((0,v.RJ)())),a()},[e,a]),s=(0,y.d4)(x.RC),c=(0,y.d4)(x.cc).find(e=>e.salesforce_org_id===s)?.name;if(!c)throw Error("No org name found");return n.createElement(w.A,{eventId:O.EventId.LOB_SALES_HOME,uiComponentName:O.UiComponentName.SALES_ONBOARDING_MULTI_ORG,clogImpression:!0},n.createElement(l.A,{closeModal:r,maxWidth:520,role:"dialog"},n.createElement(T.$m,null,n.createElement(T.hR,{height:200,width:520,alt:"",src:"light"===t?F:I}),n.createElement(T.rQ,{className:".p-sales_onboarding__new_org_connected_modal_header"},n.createElement(T.Rc,{title:D.t("New Salesforce org connected"),className:".p-sales_onboarding__new_org_connected_modal_header"})),n.createElement(T.qf,null,D.rt("With {salesforceOrgName} connected, you can now keep track of all the deals you care about across organizations. Start by viewing Salesforce lists from this new org to stay informed.",{salesforceOrgName:c}))),n.createElement(T.jl,null,n.createElement(T.ox,null,n.createElement(T.s_,{type:"outline",onClick:r,autoClogProps:M,"aria-label":D.t("Later")},D.t("Later")),n.createElement(T.s_,{type:"primary",onClick:o,autoClogProps:M,"aria-label":D.t("View Salesforce Lists")},D.t("View Salesforce Lists"))))))};OnboardingNewOrgConnectedModal.displayName="OnboardingNewOrgConnectedModal";var R=a(0x11c82607b),L=a(0x46dbff89);let P=(0,R.Ay)("Opens Onboarding New Org Connected Modal",(e,t)=>{e((0,L.q)({element:n.createElement(OnboardingNewOrgConnectedModal,null)}))});P.meta={name:"openOnboardingNewOrgConnectedModal",key:"createThunkOpenOnboardingNewOrgConnectedModal",description:"Opens Onboarding New Org Connected Modal"};var B=a(0xbd196b81),H=a(0x330e5328),U=a(0x1472af90a),V=a(0xf052d367),W=a(0x1bee6742c),q=a.n(W);let j=new r.Ay("modernselling"),UserOrgConnectionBaseModal=({title:e,mainText:t,additionalText:a,userOrgsToConnect:r,defaultSelectedOrgId:b="",handleClose:S,onOrgConnected:w})=>{let E=(0,i.wA)(),v=(0,y.d4)(x.H2),T=(0,y.d4)(x.$r),[O,N]=(0,n.useState)(b),k=(0,y.d4)(e=>(0,V.h$)(e,U.G7.SalesHomeNotificationsOnboarding)),I=(0,n.useCallback)(()=>{S(),E((0,A.O)())},[E,S]),F=(0,n.useCallback)(()=>{E((0,C.m)({salesforceOrgId:O})),k?(E((0,B.T)({salesforceOrgId:O})),E(P())):I(),w?.()},[E,O,I,w,k]),handleContinue=async()=>{let e=r.find(({salesforce_org_id:e})=>e===O);if(!e)return;let{salesforce_org_id:t}=e;"seamless-auth"===await E((0,H.m)({salesforceOrgId:t}))&&F()};return useWaitForOrgConnection(O,F),n.createElement(l.A,{centered:!0,closeModal:I},n.createElement(p.A,null,n.createElement(g.A,{title:e})),n.createElement(c.A,null,n.createElement(d.A,null,n.createElement(_.B,{space:"150"},"error"===v&&T&&n.createElement(f.F,{errorType:T}),n.createElement("span",{className:q().primaryText},t),n.createElement(h.v,{defaultCheckedOrgId:O,orgs:r,onOrgSelect:N}),n.createElement("span",{className:q().tertiaryText},a)))),n.createElement(u.A,null,n.createElement(m.A,null,n.createElement(s.A,{onClick:I,type:"outline","aria-label":j.t("Cancel")},j.t("Cancel")),n.createElement(o.lV,{loading:"fetching"===v,type:"primary",onClick:handleContinue,disabled:!O,"aria-label":j.t("Continue")},j.t("Continue")))))};UserOrgConnectionBaseModal.displayName="UserOrgConnectionBaseModal"},0x200c38ed8:(e,t,a)=>{"use strict";a.d(t,{aV:()=>useNotificationsOpportunitySchema,jv:()=>useNotificationsOpportunitySchemaForEndUser,qI:()=>useSalesHomeNotificationsSearcherOptions});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x133aee58f),o=a(0x3d5a0d18),l=a(0x12185e091),s=a(0x1fe613d6e),c=a(0x226892387),d=a(0x4f86f8f5),u=a(0x1c8beab7f),m=a(0x52b05cae),p=a(0x1d104c491);function useNotificationsOpportunitySchema(){return(0,c.d4)(e=>(0,u.Y)(e,p.hd.Opportunity))}function useNotificationsOpportunitySchemaForEndUser(){let e=!!(0,c.d4)(e=>(0,u.DY)(e,!1)),t=(0,r.A)(!1),a=(0,c.d4)(e=>(0,u.vV)(e,p.hd.Opportunity,t)),n=(0,c.d4)(e=>(0,u.oL)(e,p.hd.Opportunity));return e?a:n}function getChannelPermissions(e,t){let a=e?.send_notification_to_channel_permission,n=e?.allow_admins_to_send_to_all_channel_types??!1,i=!0,r=!0,o=e?.allow_slack_connect_channels??!1;if(t&&n)return{shouldIncludePublicChannels:i,shouldIncludePrivateChannels:r,shouldIncludeSlackConnectChannels:o=!0};switch(a){case p.$4.PRIVATE_CHANNELS_ONLY:i=!1;break;case p.$4.NO_CHANNELS:i=!1,r=!1;case p.$4.ALL_CHANNELS:}return{shouldIncludePublicChannels:i,shouldIncludePrivateChannels:r,shouldIncludeSlackConnectChannels:o}}function useSalesHomeNotificationsSearcherOptions(e=""){let[t,a]=(0,n.useState)(!1),r=(0,i.wA)(),p=(0,c.d4)(t=>(0,u.uS)(t,e)),g=(0,c.d4)(s.K),f=p?.allowed_channel_workspaces,{shouldIncludePublicChannels:_,shouldIncludePrivateChannels:h,shouldIncludeSlackConnectChannels:b}=getChannelPermissions(p,g),y=(0,n.useMemo)(()=>({workspaceFilter:{type:d.MR.All},peopleFilter:{type:d.E7.All}}),[]),x=(0,o.J)(y),S=(0,n.useCallback)(e=>!(0,l.jq)(e)||x(e),[x]);return(0,n.useEffect)(()=>{a(!p),e&&!p&&r((0,m.b)({salesforceOrgId:e}))},[e,p,r]),{isFetchingPrefs:t,searcherOptions:(0,n.useMemo)(()=>({entities:{channels:{includeOnlyExternallyShared:b,includePrivate:h,includePublic:_,includeArchived:!1,includeMpims:!1,excludeElmChannels:!0,allowedInternalTeams:f,onlyIfMember:!0},members:!1,userGroups:!1},allowEmptyQuery:!0,limit:100,sort:{frecency:!0,preferChannelsUserBelongsTo:!0,preferExactMatch:!0},filter:S}),[f,b,h,_,S])}}},0x1e84d332f:(e,t,a)=>{"use strict";a.d(t,{K:()=>isMigratingOrgPresent});let isMigratingOrgPresent=e=>e.some(e=>e.is_migrating)},0x146e4ebc8:(e,t,a)=>{"use strict";a.d(t,{V:()=>ActionBarForward});var n=a(0xbad225b5),i=a(0x16cf1da63),r=a(0x8601851c),o=a(0x40c0d834),l=a(0x20482ad21),s=a(0x344bb842),c=a(0x2501a2cee),d=a(0x4c96e5d9),u=a(0x11036d95f),m=a(0xe874a88a),p=a(0x22a29f141),g=a(0x1dfdeb1c8),f=a(0x1ec68d6a3),_=a(0xe747dd27);let h=(0,g.A)("salesHome.notifications.formatShare generated fetcher",(e,t,a)=>new m.S((n,i)=>{let{abortSignal:r,reason:o,...l}=a,s=(0,_.VA)(l);e((0,p.apiCall)({method:"salesHome.notifications.formatShare",args:s,abortSignal:r,reason:o})).then(e=>{n(e)}).catch(e=>{(0,f.default)({getState:t}).error(`API call to salesHome.notifications.formatShare with reason ${o} failed, initiated by generated fetcher`),i(e)})}));h.meta={name:"salesHomeNotificationsFormatShareFetcher",key:"createFetcherSalesHomeNotificationsFormatShareFetcher",description:"salesHome.notifications.formatShare generated fetcher"};var b=a(0x3711e82d),y=a(0x32d3ef3d),x=a(0xcea4a81c),S=a(0x113cdbbd7),A=a(0x1608420cc),C=a(0x103f48cb9),w=a(0x1506d547b),E=a(0xf7a922a4),v=a(0x181fc1a60);let T=(0,g.A)("salesHome.notifications.share generated fetcher",(e,t,a)=>new m.S((n,i)=>{let{abortSignal:r,reason:o,...l}=a,s=(0,_.VA)(l);e((0,p.apiCall)({method:"salesHome.notifications.share",args:s,abortSignal:r,reason:o})).then(e=>{n(e)}).catch(e=>{(0,f.default)({getState:t}).error(`API call to salesHome.notifications.share with reason ${o} failed, initiated by generated fetcher`),i(e)})}));T.meta={name:"salesHomeNotificationsShareFetcher",key:"createFetcherSalesHomeNotificationsShareFetcher",description:"salesHome.notifications.share generated fetcher"};var O=a(0x1d600678),N=a(0xa6b90d4b),k=a(0x24cf1145d),I=a(0x226892387);let F=new l.Ay("modernselling"),ForwardNotificationModal=e=>{let{createdTs:t,notificationType:a,isAdminCreated:r,msgOps:l,selectedChannelId:s,opportunityId:c,attachmentBlocks:d,salesforceRecord:u}=e,m=(0,i.wA)(),p="forward-sales-notification-dialog",g=F.t("Forward this notification");c&&(g=F.t("Forward this record update"));let f=F.t("Forward"),_=(0,n.useCallback)(()=>m((0,k.I)({channelOrMemberId:s,reason:p})).then(e=>{let a=m((0,N.A)({msgOps:l,channelId:e}))||[];return m(T({createdTs:t,channelId:e,...a.length&&{shareBlocks:a},reason:"sales-home-forward-notification",opportunityId:c}))}),[m,s,l,t,c]),h=(0,n.useMemo)(()=>({onClick:{enableClogAction:!0},elementName:"forward_notification_modal_btn",elementValue:t}),[t]),E=(0,n.useMemo)(()=>d&&n.createElement("div",{className:"c-message_attachment_v2"},n.createElement(C.A,{version2:!0}),n.createElement("div",null,n.createElement(A.A,{blocks:d,service:void 0,channelId:s,blocksContainerContext:S.pi.share_dialog}),u&&n.createElement("div",{className:"margin_top_100"},n.createElement(x.a,{entityState:y.w.enabled,size:y.S.expanded,record:u,showActionsBar:!1,isInteractive:!1})))),[d,u,s]),D=(0,I.d4)(e=>(0,O.x)(e,"salesforce_forwarding")?.default==="speedbump");return n.createElement(o.A,{eventId:b.EventId.LOB_SALES_HOME,uiComponentName:b.UiComponentName.LOB_NOTIFICATION_FORWARD_MODAL,channelId:s,lobNotificationType:a,isLobNotificationWorkflowAdmin:r},n.createElement(w.A,{...e,title:g,goButtonText:f,goButtonAutoClogProps:h,goHandler:_,dialogType:v.hs.NOTIFICATION,shareReason:p,notificationType:a,attachment:E,forwardingSpeedbumpEnabled:D}))};ForwardNotificationModal.displayName="ForwardNotificationModal";let D=(0,E.A)(ForwardNotificationModal);var M=a(0x11c82607b),R=a(0x46dbff89);let L=(0,M.Ay)("Opens the Forward Notification Modal",(e,t,a)=>{e((0,R.q)({element:n.createElement(D,a)}))});L.meta={name:"openForwardNotificationModal",key:"createThunkOpenForwardNotificationModal",description:"Opens the Forward Notification Modal"};let P=new l.Ay("modernselling"),ActionBarForward=({hasFocus:e,createdTs:t,notificationType:a,isAdminCreated:l,opportunityId:m})=>{let p=(0,i.wA)(),{maybeClosePeek:g}=(0,n.useContext)(u.Z),f=P.t("Forward notification");m&&(f=P.t("Forward record update"));let _=(0,n.useCallback)(()=>!e,[e]),y=(0,n.useCallback)(async e=>{e.stopPropagation();let n=await p(h({createdTs:t,opportunityId:m,reason:"sales-home-get-notification-blocks"}));if(n&&n.ok){let{content_blocks:e,attachment_blocks:i,salesforce_record:r}=n;p(L({createdTs:t,notificationType:a,isAdminCreated:l,contentBlocks:e,attachmentBlocks:i,salesforceRecord:r,opportunityId:m}))}g()},[p,t,m,g,a,l]),x=(0,n.useCallback)(()=>({onClick:{enableClogAction:!0},elementName:"forward_notification_action_bar",elementValue:t}),[t]);return(0,n.useEffect)(()=>{let e=new r.A;return e.bindAll([{keys:["f"],handler:y,filter:_,action:"keyup"}]),()=>e.reset()},[_,y]),n.createElement(o.A,{eventId:b.EventId.LOB_SALES_HOME,uiComponentName:b.UiComponentName.LOB_NOTIFICATION_ACTIONS_BAR,lobNotificationType:a,isLobNotificationWorkflowAdmin:l},n.createElement(d.Ay,{tip:f,position:"top"},n.createElement(s.A,{"aria-label":f,onClick:y,className:"c-message_actions__button",size:"small",autoClogProps:x()},n.createElement(c.Ah,{name:"share-message"}))))};ActionBarForward.displayName="ActionBarForward"},0x129529b49:(e,t,a)=>{"use strict";a.d(t,{E:()=>OpportunityHoverCardTrigger});var n=a(0xbad225b5),i=a(0x1cbdfeceb),r=a(0x217f0c263),o=a(0x14fad6485),l=a(0x1f3598f80),s=a(0xc745739a),c=a(0x20482ad21),d=a(0x2b7f0bcc),u=a(0x102edf836),m=a(0x11a296110),p=a(0x1ee57b3a0),g=a(0x1fa67866c),f=a(0xb1ea448c),_=a(0x128d54e52),h=a(0x1535e80f3),b=a(0x15fb82076),y=a(0x2501a2cee),x=a(0x4c96e5d9),S=a(0x12b6a33fc),A=a(0x16cf1da63),C=a(0xe874a88a),w=a(0x22a29f141),E=a(0x1dfdeb1c8),v=a(0x1ec68d6a3),T=a(0xe747dd27);let O=(0,E.A)("sfdc.getOpportunity generated fetcher",(e,t,a)=>new C.S((n,i)=>{let{abortSignal:r,reason:o,...l}=a,s=(0,T.VA)(l);e((0,w.apiCall)({method:"sfdc.getOpportunity",args:s,abortSignal:r,reason:o})).then(e=>{n(e)}).catch(e=>{(0,v.default)({getState:t}).error(`API call to sfdc.getOpportunity with reason ${o} failed, initiated by generated fetcher`),i(e)})}));function useFetchOpportunityInfo(){let e=(0,A.wA)();return(0,n.useCallback)((t,a)=>e(O({id:t,reason:"sales-home-get-opportunity-info",salesforceOrgId:a})),[e])}O.meta={name:"sfdcGetOpportunityFetcher",key:"createFetcherSfdcGetOpportunityFetcher",description:"sfdc.getOpportunity generated fetcher"};var N=a(0x1c659cbb1),k=a(0x110b4f809),I=a(0xe38b5635),F=a(0x1ed767a16),D=a(0x6960d8b9),M=a(0x226892387),R=a(0x1c8beab7f);let L=a.p+"crown-f27246b.svg",P=new c.Ay("modernselling"),B={elementName:"open_in_salesforce",onClick:{enableClogAction:!0}},H={elementName:"copy_opportunity_link",onClick:{enableClogAction:!0}},U=new RegExp(/\bhttps?:\/\/[^\s]+\b/g),OpportunityNextStep=({nextStep:e})=>{let t=e.split(U),a=e.match(U)||[],i=t.reduce((e,t,i)=>{if(e.push(t),i{let i,r=e?.id??t?.record_identifier,o=e?.record_link??t?.record_link,l=useFetchOpportunityInfo(),s=(0,M.d4)(R.cc),[c,b]=(0,n.useState)(),[A,C]=(0,n.useState)(!0),[w,E]=(0,n.useState)(!1),[v,T]=(0,k.A)(!1,2e3);(0,n.useEffect)(()=>{r&&l(r,a).then(e=>{b(e)}).catch(()=>{E(!0)}).finally(()=>{C(!1)})},[l,r,a]);let O=(0,n.useCallback)(()=>n.createElement(N.f1,{className:"p-sales_feed__opp_hover_card_avatar",size:36,imageUrl:L,isInteractive:!1}),[]),U=(0,n.useCallback)(()=>n.createElement(N.Ay,{className:"c-base_entity__avatar",size:h.RG.small,userId:e?.owner.slack_user_id,isInteractive:!1,tabIndex:-1,ariaHidden:!0}),[e]),V=(0,n.useCallback)(()=>{(0,F.x3)(o),T(!0)},[o,T]),W=s.length>1?s.find(e=>e.salesforce_org_id===a)?.name:void 0;return i=c?W?c.account?.name?P.rt("Opportunity in {account_name}, {salesforceOrgName}",{account_name:c.account.name,salesforceOrgName:W}):P.rt("Opportunity in {salesforceOrgName}",{salesforceOrgName:W}):c.account?.name?P.t("Opportunity in {account_name}",{account_name:c.account.name}):P.t("Opportunity"):W?P.rt("Opportunity in {salesforceOrgName}",{salesforceOrgName:W}):"Opportunity",n.createElement(I.A,{elevation:4,size:"medium",className:"p-sales_feed__opp_hover_card"},A&&n.createElement(g.A,{className:"margin_top_200"},n.createElement(f.A,{size:"jumbo"})),w&&n.createElement(g.A,null,n.createElement(d.Ay,{type:"boxed",level:"error",className:"margin_bottom_150"},P.rt("Oops\u2026 we had trouble fetching opportunity info"))),c&&n.createElement(n.Fragment,null,n.createElement(p.A,null,n.createElement(_.Ay,{size:"medium",avatar:O,text:n.createElement(_.CG,{className:"black",withTruncationTooltip:!0},c.name),subtext:n.createElement(_.sT,{className:"caption p-sales_feed__opp_hover_card_header_subtext"},i)})),n.createElement(g.A,null,n.createElement("div",{className:"p-sales_feed__opp_hover_card_details_container"},n.createElement("div",{className:"p-sales_feed__opp_hover_card_stage_details"},n.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},P.t("Stage")),n.createElement("div",{className:"p-sales_feed__opp_hover_card_stage_details_pill"},c.stage)),n.createElement("div",{className:"p-sales_feed__opp_hover_card_details"},n.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},P.t("Close date")),(0,D.Yq)((0,D.$4)(c.close_date,{parseFormat:"YYYY-MM-DD",returnMoment:!0}),"{date_slash}")),n.createElement("div",{className:"p-sales_feed__opp_hover_card_details"},n.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},P.t("Amount")),c.amount.display_value),n.createElement("div",{className:"p-sales_feed__opp_hover_card_owner_details"},n.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},P.t("Owner")),n.createElement(_.Ay,{avatar:U,className:"c-member c-member--small",text:n.createElement("span",{className:"c-member__primary_content"},n.createElement(_.CG,{className:"c-member_name"},c.owner.name)),size:"small"}))),""!==c.next_step?n.createElement("div",{className:"p-sales_feed__opp_hover_card_next_steps_details"},n.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},P.t("Next Step")),n.createElement(OpportunityNextStep,{nextStep:c.next_step})):null,n.createElement("div",{className:"p-sales_feed__opp_hover_card_actions"},n.createElement(u.z9,{className:"p-sales_feed__opp_hover_card_linkbutton",size:"medium",type:"outline",href:o,autoClogProps:B},n.createElement("span",{className:"p-sales_feed__opp_hover_card_linkbutton_text"},P.t("Open in Salesforce")),n.createElement(y.Ah,{inline:!0,name:"new-window"})),n.createElement(x.Ay,{tip:v?P.t("Copied!"):P.t("Copy link"),status:v?S.YU.Success:S.YU.Info},n.createElement(m.Ay,{className:"p-sales_feed__opp_hover_card_copybutton",size:"medium",type:"outline",onClick:V,autoClogProps:H,"aria-label":v?P.t("Copied"):P.t("Copy Salesforce Url")},n.createElement(y.Ah,{name:"files"})))))))};OpportunityHoverCard.displayName="OpportunityHoverCard";let OpportunityHoverCardTrigger=({children:e,opportunity:t,record:a,salesforceOrgId:c})=>{let{windowRef:d}=(0,n.useContext)(o._0),[u,m]=(0,n.useState)(null),p=(0,n.useRef)(null),g=(0,n.useCallback)(()=>{let e=(e=>{let{pageYOffset:t,innerWidth:a,innerHeight:n}=e.deref()||{pageYOffset:0,innerWidth:0,innerHeight:0};return{top:(0,s.ci)(t+10),right:a-16,bottom:t+n-10,left:16}})(d),t=p.current.getBoundingClientRect(),a={top:void 0,bottom:void 0,right:void 0,left:void 0},n=t.right+345>e.right,i=t.bottom+250>e.bottom,r=t.top-250{m(null)},[]),_=(0,n.useCallback)(()=>{let e=g();m(n.createElement(r.A,{isOpen:!0,className:"opportunity-hover-modal",overlayClassName:"p-sales_feed__opportunity_hover_card__modal",shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,onRequestClose:f},n.createElement("div",{className:"p-sales_feed__opportunity_hover_card__popover",style:e},n.createElement(OpportunityHoverCard,{record:a,opportunity:t,salesforceOrgId:c}))))},[g,a,t,f,c]),[h,b]=(0,l.i)(_),[y,x]=(0,l.i)(f),S=(0,n.useCallback)(()=>(x(),u)?void b():h(350),[x,h,b,u]),A=(0,n.useCallback)(()=>(b(),u)?y(250):void x(),[b,y,x,u]);return n.createElement("span",{className:"p-sales_feed__opportunity_hover_card",onMouseOver:S,onMouseLeave:A,onClick:S,role:"presentation",onFocus:i.A,ref:p},e,u)};OpportunityHoverCardTrigger.displayName="OpportunityHoverCardTrigger"},0xfca33088:(e,t,a)=>{"use strict";a.d(t,{N:()=>P});var n=a(0xbad225b5),i=a(0x120c268ad),r=a.n(i),o=a(0x11a296110),l=a(0x2501a2cee),s=a(0x1fdec3e16),c=a(0x16cf1da63),d=a(0x77727995),u=a(0x130d89881),m=a(0x1a043bf26),p=a(0x20482ad21),g=a(0x1d104c491),f=a(0x2493ba930),_=a.n(f);let h=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??h.t("Missing Data"):e.name}function getObjectType(e){return isGenericRecord(e)?e.object_identifier:g.Dj.Opportunity}function getRecordField(e,t){return isGenericRecord(e)?getGenericRecordField(e,t)??h.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:_()[`${e}_text`]||_().standard_text,border:_()[`${e}_border`]||_().standard_border,borderDark:_()[`${e}_border_dark`]||_().standard_border_dark,lightText:_()[`${e}_light_text`]||_().standard_light_text,background:_()[`${e}_background`]||_().standard_background}}function RecordsListTableHeader({column:e,displayType:t,isSortAsc:a,isSortKey:i,onClick:c}){let d=getDisplayTypeClassNames(t);return n.createElement(o.Nm,{onClick:c,className:r()(_().records_list_table_cell,_().records_list_table_cell_header,d.text)},n.createElement(s.A,{withTooltip:!0,lines:1},e.name),i&&n.createElement(l.Ah,{name:a?"arrow-up":"arrow-down",size:"16"}))}RecordsListTableHeader.displayName="RecordsListTableHeader";let b=new p.Ay("modernselling");function RecordsListTablePagination({pageRange:[e,t],totalItems:a,autoClogProps:i,onNextClick:r,onPrevClick:s}){return n.createElement("div",{className:_().records_list_table_pagination},n.createElement(o.Nm,{"aria-label":b.t("Previous page"),autoClogProps:i,disabled:!s,onClick:s},n.createElement(l.Ah,{name:"caret-left",size:"16"})),n.createElement("span",null,b.t("Showing {start}-{end} of {totalItems}",{start:e+1,end:t,totalItems:a})),n.createElement(o.Nm,{"aria-label":b.t("Next page"),autoClogProps:i,disabled:!r,onClick:r},n.createElement(l.Ah,{name:"caret-right",size:"16"})))}RecordsListTablePagination.displayName="RecordsListTablePagination";var y=a(0x4c96e5d9),x=a(0x146e4ebc8),S=a(0x174bb7323),A=a(0x1faa3f1ac),C=a(0x1feb18f19),w=a(0x129529b49),E=a(0x11928a844),v=a.n(E);let Stage=e=>n.createElement("div",{className:r()(v().stage,{[v().previous]:"previous"===e.type,[v().current]:"current"===e.type})},n.createElement(s.A,{lines:1,withTooltip:!0},e.children));Stage.displayName="Stage";var T=a(0x113cdbbd7),O=a(0x944e06df),N=a(0x81d6854c),k=a(0xf01a9d50);let I=new p.Ay("modernselling");function MaybeHoverCard({record:e,children:t,shouldHide:a,salesforceOrgId:i}){return a||isGenericRecord(e)?n.createElement(n.Fragment,null,t):n.createElement(w.E,{opportunity:e,salesforceOrgId:i},t)}function MaybeLink({record:e,children:t,shouldHide:a}){return a?n.createElement(n.Fragment,null,t):n.createElement(A.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,i=e.amount_change_raw.percent,r=!t&&100===i,o=`${r?"-":""}${i}%`;return 0x7fffffff===i&&(o=I.t("New")),n.createElement("div",{className:r||a<0?_().amount_change_negative:_().amount_change_positive},n.createElement(s.A,{lines:1,withTooltip:!0},n.createElement("span",{className:"bold"},e.amount_change),n.createElement("span",null," (",o,")")))};renderRecordDeltaValue.displayName="renderRecordDeltaValue";let renderRecordNameValue=(e,t,{isPreview:a,showHoverCard:i},r)=>n.createElement(MaybeHoverCard,{record:e,shouldHide:a||!i,salesforceOrgId:r},n.createElement(MaybeLink,{record:e,shouldHide:!i},n.createElement(A.A,null,n.createElement(s.A,{lines:1},n.createElement(l.Ah,{inline:!0,...(0,k.C)(getObjectType(e))}),n.createElement("span",{className:"margin_left_25 bold"},getRecordName(e)))))),renderOpportunityRecordStageChangeValue=e=>n.createElement(C.c,{space:"75"},n.createElement(Stage,{type:"previous"},e.prev_stage),n.createElement(l.Ah,{name:"arrow-right"}),n.createElement(Stage,{type:"current"},e.stage));renderOpportunityRecordStageChangeValue.displayName="renderOpportunityRecordStageChangeValue";let renderOpportunityRecordRichTextValue=(e,t)=>"close_date_change"===t.payload_field?n.createElement(O.A,{blocks:e.close_date_change?.blocks,blocksContainerContext:T.pi.sales_home_notification}):n.createElement(C.c,{space:"75"},n.createElement(N.A,null));renderOpportunityRecordRichTextValue.displayName="renderOpportunityRecordRichTextValue";let renderOpportunityRecordStageValue=e=>n.createElement(Stage,{type:"current"},e.stage);renderOpportunityRecordStageValue.displayName="renderOpportunityRecordStageValue";let renderRecordValueAsString=(e,t)=>n.createElement(s.A,{lines:1,withTooltip:!0},n.createElement("span",{className:t.primary_sort?"bold":void 0},(0,S.A)(getRecordField(e,t.payload_field))));function renderRecordValue(e,t,a,n){return isGenericRecord(e)?renderGenericRecordValue(e,t,a):renderOpportunityRecordValue(e,t,a,n)}function renderOpportunityRecordValue(e,t,a,n){switch(t.type){case"name":return renderRecordNameValue(e,t,a,n);case"stage":return renderOpportunityRecordStageValue(e);case"stage_change":return renderOpportunityRecordStageChangeValue(e);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,n){return"name"===t.type?renderRecordNameValue(e,t,a,n):renderRecordValueAsString(e,t,a)}let F=new p.Ay("modernselling");function RecordsListTableRow({columns:e,isFocused:t,isPreview:a,record:i,salesforceOrgId:o,notificationCreatedTs:l,isLastRow:s,isWorkflowPreview:c}){let[d,u]=(0,n.useState)(!1),m=(0,n.useMemo)(()=>{if(a)return[];let e=getRecordKey(i);return[{key:"opportunity-share-button",enabled:!!l,render:()=>e&&l&&n.createElement(x.V,{hasFocus:!!t,createdTs:l,notificationType:"record",isAdminCreated:!0,opportunityId:e})}].filter(({enabled:e=!0})=>e)},[a,i,l,t]),p=!a&&m.length>0,g=(0,n.useCallback)(()=>u(!0),[]),f=(0,n.useCallback)(()=>u(!1),[]),h=!a,b=n.createElement("div",{onPointerOver:g,onPointerLeave:f,className:r()(_().records_list_table_row,_().records_list_table_row_body,{[_().records_list_table_row_border]:!s}),style:h?{cursor:"pointer"}:void 0},e.map(t=>c?n.createElement("div",{key:t.name,className:r()(_().records_list_table_cell,_().preview_table_cell,getDisplayTypeClassNames("standard").background)}):n.createElement("div",{key:t.name,className:r()(_().records_list_table_cell,{[_().records_list_table_cell_2_col]:2===e.length})},renderRecordValue(i,t,{isPreview:a,showHoverCard:!1},o))),p&&n.createElement("div",{className:r()(_().records_list_action_bar_container,p&&(t||d)&&_().records_list_action_bar_container_visible)},m.map(({key:e,render:t})=>n.createElement(n.Fragment,{key:e},t()))));return h?n.createElement(y.Ay,{tip:F.t("Open Record"),position:"top"},b):b}RecordsListTableRow.displayName="RecordsListTableRow";var D=a(0x106809bc6);function getPageRange(e,t,a){return[(0,D.A)(e,0,a-1),(0,D.A)(e+t,t,a)]}function usePagination(e,{pageSize:t}){let[a,i]=(0,n.useState)(0);(0,n.useEffect)(()=>i(0),[t]);let r=e.length,o=Math.ceil(r/t),l=a>=t,s=ai(0),[]),d=(0,n.useCallback)(()=>i(e=>e-t),[t]),u=(0,n.useCallback)(()=>i(e=>e+t),[t]),m=(0,n.useMemo)(()=>getPageRange(a,t,r),[a,t,r]);return{page:(0,n.useMemo)(()=>e.slice(...m),[e,m]),prev:l?d:void 0,next:s?u:void 0,range:m,reset:c,totalPages:o}}var M=a(0x754ea859),R=a(0xc0b7c558);function RecordsListTable({columns:e,displayType:t,isPreview:a,records:i,paginationAutoClogProps:o,salesforceOrgId:l,notificationCreatedTs:s,isWorkflowPreview:p,isStepPreview:g}){let[f,h]=(0,n.useState)(!1),[b,y]=(0,n.useState)(()=>getInitialSortByValue(e)),x=getDisplayTypeClassNames(t),{page:S,reset:A,...C}=usePagination((0,n.useMemo)(()=>p?[...i]:[...i].sort((e,t)=>{let a="asc"===b.dir,n=isGenericRecord(e)?getGenericRecordValue(e,b):(0,d.A)(e,b.key),i=isGenericRecord(t)?getGenericRecordValue(t,b):(0,d.A)(t,b.key);return("string"==typeof n&&"string"==typeof i&&(n=n.toLocaleUpperCase(),i=i.toLocaleUpperCase()),void 0===n)?1:void 0===i?-1:ni?a?1:-1:0}),[p,i,b]),{pageSize:5}),w=(0,n.useCallback)(e=>()=>{A(),y(({key:t,dir:a})=>({key:e,dir:e===t&&"asc"===a?"desc":"asc"}))},[A]),E=(0,n.useCallback)(e=>{let a=getColumnSortField(e);return n.createElement(RecordsListTableHeader,{key:e.name,column:e,displayType:t,isSortAsc:"asc"===b.dir,isSortKey:!p&&a===b.key,onClick:w(a)})},[b,w,t,p]),v=(0,n.useCallback)((i,{hasFocus:r,hasFocusWithin:o})=>n.createElement(RecordsListTableRow,{key:getRecordKey(S[i]),columns:e,displayType:t,isFocused:r||o,isPreview:a,record:S[i],salesforceOrgId:l,notificationCreatedTs:s,isLastRow:i===S.length-1,isWorkflowPreview:p}),[S,e,t,a,l,s,p]),T=(0,n.useCallback)(()=>h(!0),[]),O=(0,n.useCallback)(()=>h(!1),[]),N=(0,c.wA)(),k=(0,n.useCallback)(e=>{N((0,M.c)({recordId:S[e.id].slack_record_id??(0,R.j)(l,getRecordKey(S[e.id]))}))},[N,S,l]);return n.createElement("div",{onPointerOver:T,onPointerLeave:O,className:r()(x.background,_().records_list_table,{[_().records_list_table_workflow_preview]:p,[_().records_list_table_workflow_step_preview]:g})},n.createElement("div",{className:_().records_list_table_row},e.map(E)),n.createElement(u.A,{disableHeight:!0},({width:e})=>n.createElement(m.A,{keys:Object.keys(S),width:e,height:51*S.length,rowRenderer:v,onItemClick:a?void 0:k,containerClassName:r()(_().records_list_table_rows_container,f&&!p?x.borderDark:x.border)})),C.totalPages>1&&n.createElement(RecordsListTablePagination,{pageRange:C.range,totalItems:i.length,autoClogProps:o,onNextClick:C.next,onPrevClick:C.prev}))}RecordsListTable.displayName="RecordsListTable";var L=a(0x3711e82d);let P=n.memo(({columns:e,displayType:t="standard",isWorkflowPreview:a,isExpandedByDefault:i=a,isPreview:c,isStepPreview:d,records:u,title:m,workflowId:p,salesforceOrgId:g,notificationCreatedTs:f})=>{let[h,b]=(0,n.useState)(i),y=(0,n.useCallback)(()=>b(e=>!e),[]),x=getDisplayTypeClassNames(t),S=(0,n.useCallback)(e=>{if(!c)return{onClick:{enableClogAction:!0},eventId:L.EventId.LOB_NOTIFICATIONS,elementName:e,workflowId:p}},[p,c]);return n.createElement("div",{className:r()(_().records_list_container,{[_().preview_not_expanded]:a&&!h})},n.createElement(o.Nm,{autoClogProps:S("expand_notification"),className:r()(x.text,x.background,_().records_list_toggle,h&&_().records_list_toggle_expanded),onClick:y},n.createElement(l.Ah,{name:h?"caret-down-filled":"caret-right-filled",size:"20"}),a?n.createElement(s.A,{withTooltip:!0,lines:1},n.createElement("span",{className:_().records_list_title},m)):n.createElement(n.Fragment,null,n.createElement("span",{className:_().records_list_title},m),n.createElement("span",{className:x.text},u.length))),h&&n.createElement(RecordsListTable,{columns:e,displayType:t,isPreview:c,records:u,paginationAutoClogProps:S("show_more"),salesforceOrgId:g,notificationCreatedTs:f,isWorkflowPreview:a,isStepPreview:d}))})},0xc5a3e186:(e,t,a)=>{"use strict";e.exports=a.p+"closing-soon-56adea6.svg"},0x10398ed1f:(e,t,a)=>{"use strict";e.exports=a.p+"missing-fields-6aaf1ef.svg"},0x86226b0b:(e,t,a)=>{"use strict";e.exports=a.p+"outdated-fields-a212a08.svg"},0x11a940e89:(e,t,a)=>{"use strict";e.exports=a.p+"past-close-date-993aaf3.svg"},0x17b887603:(e,t,a)=>{"use strict";a.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});let __WEBPACK_DEFAULT_EXPORT__=function(){return!0}}}]); //# sourceMappingURL=https://slack.com/source-maps/bv1-13/gantry-v2-async-client-sales-notifications-view.ca59307adee286ede5ac.min.js.mapØA —Eoúô