@zeniai/web-app-ui 5.3.61-dev → 5.3.62-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/assets/{AccountMappingScreen-Dt4x9DJz.js → AccountMappingScreen-DwM3_WTC.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-BfyrJWDJ.js → ActualMatchingMatchDetailScreen---3NQIlW.js} +1 -1
  3. package/dist/assets/AddressRoutes-CRWje5aU.js +1 -0
  4. package/dist/assets/AddressScreen-DwDn6adU.js +9 -0
  5. package/dist/assets/{AiCfoScreen-SBmgGufP.js → AiCfoScreen-CmI1WP3p.js} +1 -1
  6. package/dist/assets/{AppDrawer-D7FI4GcX.js → AppDrawer-CqAnDatC.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-BxCZdf21.js → BillPayApprovalRoutes-uF3lLPXa.js} +1 -1
  8. package/dist/assets/BillPayRoutes-CxGXv0Eb.js +119 -0
  9. package/dist/assets/{BusinessVerificationPageScreen-B20TVwus.js → BusinessVerificationPageScreen-CWJBny4J.js} +2 -2
  10. package/dist/assets/{CardsAiCfoScreen-DkokQGnk.js → CardsAiCfoScreen-DTmIk225.js} +1 -1
  11. package/dist/assets/ChargeCardRoutes-CBA-C6S5.js +71 -0
  12. package/dist/assets/{CompanyPassportScreen-BEG9__1k.js → CompanyPassportScreen-C0r5_u0C.js} +1 -1
  13. package/dist/assets/ConnectionAuthScreen-D97ZGKWy.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-DREpIR3e.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-BFFEQyjG.js → CustomerOnboardingRoutes-BFK8USjA.js} +3 -3
  16. package/dist/assets/DashboardRoutes-CIiFmVuR.js +20 -0
  17. package/dist/assets/{DefaultTenantHome-CMvE7WXj.js → DefaultTenantHome-BWhhfpNZ.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-B2YgkOu5.js → DomesticWireDetailScreen-C8g5HYbF.js} +4 -4
  19. package/dist/assets/{DrawerScreen-I5-Ak-b_.js → DrawerScreen-jGeXohet.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-BPqa4e5a.js → EntityDetailRoutes-DDbPZyaE.js} +1 -1
  21. package/dist/assets/ExpenseAutomationRoutes-BhSlFN1-.js +38 -0
  22. package/dist/assets/{FeaturePreviewScreen-v5dVXn4p.js → FeaturePreviewScreen-t-KcIePh.js} +1 -1
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-CsqGaYGM.js → HubSpotOAuthCallbackScreen-B9Xsd5UE.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-B4UF_uUg.js → InboxNotificationsProvider-DcarX1j5.js} +1 -1
  25. package/dist/assets/InvoicingRoutes-BQHOoyRc.js +2 -0
  26. package/dist/assets/{MagicLinkRoutes-DDza_62u.js → MagicLinkRoutes-CfUJpVA_.js} +4 -4
  27. package/dist/assets/{MagicLinkSignInScreen-DGzxNaiE.js → MagicLinkSignInScreen-BR70G8WN.js} +1 -1
  28. package/dist/assets/MobileAppDrawer-DqgtjBKX.js +1 -0
  29. package/dist/assets/NotFoundScreen-C2GrPpNy.js +1 -0
  30. package/dist/assets/{NotificationRoutes-i3qnEWcR.js → NotificationRoutes-C1V1-m3K.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-CRExXXMv.js → OAuthConsentScreen-UVKKdhYW.js} +1 -1
  32. package/dist/assets/PandLWithForecastRoutes-x9MBz-SJ.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-D0Hr5oRB.js → PaymentLinkScreen-BtszXnNs.js} +9 -9
  34. package/dist/assets/{PeopleRoutes-CypmG1ct.js → PeopleRoutes-By-929Rc.js} +3 -3
  35. package/dist/assets/PerformanceRoutes-DwUVercL.js +1 -0
  36. package/dist/assets/{Preview-Co3i0Xrb.js → Preview-Dxr01VGI.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-BiN0lu_W.js → QBOConnectionScreen-Chdjbcg8.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-ryr0mHPH.js → ReimbursementApprovalRoutes-DVM8rE5F.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CRU8C8RZ.js → ReimbursementApprovalRuleDetailScreen-Bf1LI70e.js} +1 -1
  40. package/dist/assets/ReimbursementRoutes-ByU4nWbt.js +68 -0
  41. package/dist/assets/ReportsRoutes-Be1H67SI.js +1 -0
  42. package/dist/assets/RewardsRoutes-iweGs61q.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-UKD1lb2-.js → ScheduleDetailsPrepaidExpensesScreen-HIrqgD7A.js} +4 -4
  44. package/dist/assets/{ScreenRoutes-6zCS0eXm.js → ScreenRoutes-CFuAOQvL.js} +2 -2
  45. package/dist/assets/{SettingsRoutes-Bh4g9wCj.js → SettingsRoutes-CYdVWZYv.js} +5 -5
  46. package/dist/assets/{SetupPagesScreen-CdpIgBzw.js → SetupPagesScreen-BccJSzRN.js} +5 -5
  47. package/dist/assets/SignInScreen-DM0sUU51.js +1 -0
  48. package/dist/assets/SignOutScreen-Bs1NyDBL.js +9 -0
  49. package/dist/assets/{TaskListScreen-h6ryhshy.js → TaskListScreen-DQj6h_q_.js} +2 -2
  50. package/dist/assets/{TaskRoutes-BiQOVouS.js → TaskRoutes-DY92MrHK.js} +1 -1
  51. package/dist/assets/TransactionDetailRoutes-BFj2-oES.js +1 -0
  52. package/dist/assets/TransactionDetailScreen-fc6wRDCa.js +5 -0
  53. package/dist/assets/TransactionListRoutes-DoEWtZb8.js +1 -0
  54. package/dist/assets/TreasuryRoutes-BwZlVh2U.js +37 -0
  55. package/dist/assets/{VendorsRoutes-C9tsCt7G.js → VendorsRoutes-rWAhbgUX.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-XbaBW0oW.js → WiseConfirmationScreen-twAmgAST.js} +1 -1
  57. package/dist/assets/ZeniAccountRoutes-BqSVR2HC.js +57 -0
  58. package/dist/assets/{ZeniAccountStatementScreen-L3XK5pKW.js → ZeniAccountStatementScreen-xKZWX655.js} +1 -1
  59. package/dist/assets/{accountMappingHelper-Ci74NLEW.js → accountMappingHelper-DpfYWNe6.js} +1 -1
  60. package/dist/assets/{analytics-8lQ_GaR7.js → analytics-CiEh1qKr.js} +1 -1
  61. package/dist/assets/{analyticsHelper-C6SU-53H.js → analyticsHelper-DHPcRAai.js} +1 -1
  62. package/dist/assets/{core-B-8b0iz9.js → core-Caq7Zbsp.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-hAviH84T.js → decodeURIComponentSafe-DmjyT4t5.js} +1 -1
  64. package/dist/assets/{dnd-CtOxA7uX.js → dnd-DwckO6rX.js} +1 -1
  65. package/dist/assets/{empty-CyiOIGJw.js → empty-CviwvzhB.js} +1 -1
  66. package/dist/assets/{empty-ZUR8mjP1.js → empty-Dl3LsHNf.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-Dch9mr3K.js → emptyVideoElement-0ADxBh21.js} +1 -1
  68. package/dist/assets/{epic-C_YIXfJm.js → epic-DqqOk9a9.js} +1 -1
  69. package/dist/assets/{expenseAutomationHelper-BzOPc0En.js → expenseAutomationHelper-B83Qa5Jl.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-D57C4sYC.js → getLocaleForTenant-YgJPw-1W.js} +1 -1
  71. package/dist/assets/{index-BUsi93tT.js → index-B3LhL1WI.js} +2 -2
  72. package/dist/assets/{index-DeS-5gfC.js → index-BLBexBOn.js} +1 -1
  73. package/dist/assets/{index-CzpjeHcU.js → index-BggnOuo1.js} +1 -1
  74. package/dist/assets/{index-CgYr_9vs.js → index-Bi5Vnzzf.js} +1 -1
  75. package/dist/assets/{index-Ce-G0Vp2.js → index-BsIiLcaT.js} +1 -1
  76. package/dist/assets/{index-DuxR1XDX.js → index-DOXJLxdR.js} +23226 -23221
  77. package/dist/assets/{index-haVo7C6B.js → index-DZj1fENq.js} +1 -1
  78. package/dist/assets/{index-b65XjN06.js → index-De1Gw5gW.js} +1 -1
  79. package/dist/assets/{lexical-BVt4M34U.js → lexical-mmp2B1vq.js} +1 -1
  80. package/dist/assets/{liveblocks-BjcYyeQ6.js → liveblocks-CIxx6Ub6.js} +1 -1
  81. package/dist/assets/{lottie-BdAYiWcR.js → lottie-CrKh4Q_r.js} +1 -1
  82. package/dist/assets/{mui-C33Oegsm.js → mui-DI0hUuFr.js} +1 -1
  83. package/dist/assets/{pathToGoBack-Bgu6njoM.js → pathToGoBack-Ch5lrOj1.js} +1 -1
  84. package/dist/assets/{pdf-BkfulyEw.js → pdf-BlhN83fm.js} +3 -3
  85. package/dist/assets/{pdf-lib-D8o-uP9K.js → pdf-lib-WBpN-CHj.js} +1 -1
  86. package/dist/assets/{plaid-Bt28AVCt.js → plaid-CXvI7t9H.js} +1 -1
  87. package/dist/assets/{pusher-BWEmmbE9.js → pusher-BZAjVztW.js} +1 -1
  88. package/dist/assets/{react-BAH__mX9.js → react-BHfk4QRe.js} +1 -1
  89. package/dist/assets/{react-CIEK2Ei-.js → react-BqA23JAy.js} +1 -1
  90. package/dist/assets/{react-Dqb011PB.js → react-BsygV86H.js} +1 -1
  91. package/dist/assets/{react-B7GqIpoL.js → react-XoZ7aD8C.js} +1 -1
  92. package/dist/assets/{react-DT9gMpbF.js → react-rmAoHvXj.js} +1 -1
  93. package/dist/assets/{react-Ls8UDl46.js → react-tooGqts4.js} +1 -1
  94. package/dist/assets/{recharts-DkYxIsLi.js → recharts-DKmpCGIA.js} +1 -1
  95. package/dist/assets/{routePaths-B1syYHWh.js → routePaths-C1OqXYGB.js} +1 -1
  96. package/dist/assets/{sentry-DZ9rNYfw.js → sentry-BCPOyc0G.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-Te2Zqy4u.js → stripSplatSuffix-Dmnnw5Oe.js} +1 -1
  98. package/dist/assets/{url-BjdrSaU1.js → url-CdxI2rEH.js} +1 -1
  99. package/dist/assets/{url-DY2r7CPa.js → url-JduagIhH.js} +1 -1
  100. package/dist/assets/{useActualMatchingMatchDetail-DZnxtuQj.js → useActualMatchingMatchDetail-6t8vcRTI.js} +1 -1
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-SBKf0Pu3.js → useAiCfoDashboardSuggestedQuestionsChips-BO7_rPaJ.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-BvhP40c_.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-DmcXit2D.js → useChargeCardPusherEvents-2nVivR1x.js} +1 -1
  104. package/dist/assets/{useDeviceId-gFU5q5zf.js → useDeviceId-2NJBbYPM.js} +1 -1
  105. package/dist/assets/{useEmailConnectResultRefresh-BwFVhfcX.js → useEmailConnectResultRefresh-QqukN5jp.js} +1 -1
  106. package/dist/assets/{useInitialThreadRequest-Chu-ipGI.js → useInitialThreadRequest-uu8NipM7.js} +1 -1
  107. package/dist/assets/useTaskManagerAccess-DxrmaJfc.js +1 -0
  108. package/dist/assets/{useTaskManagerPusherEvents-BnGLCsCG.js → useTaskManagerPusherEvents-D5Hm7um3.js} +1 -1
  109. package/dist/assets/{utils-D3rZq_G4.js → utils-rX2IEvjD.js} +1 -1
  110. package/dist/assets/withTransactionSidePanel-C1wVwRW0.js +25 -0
  111. package/dist/assets/{zeni-epic-state-95zxmizy.js → zeni-epic-state-DROyxOLw.js} +3 -3
  112. package/dist/index.html +1 -1
  113. package/package.json +3 -3
  114. package/dist/assets/AddressRoutes-DfkTMfYF.js +0 -1
  115. package/dist/assets/AddressScreen-DvJ6yyMx.js +0 -9
  116. package/dist/assets/BillPayRoutes-07S7DRSx.js +0 -119
  117. package/dist/assets/ChargeCardRoutes-BO6dVldC.js +0 -71
  118. package/dist/assets/ConnectionAuthScreen-C_s5VCbI.js +0 -11
  119. package/dist/assets/CustomerOnboardingAuthScreen-DFMNQmWy.js +0 -1
  120. package/dist/assets/DashboardRoutes-B4NxbMLL.js +0 -20
  121. package/dist/assets/ExpenseAutomationRoutes-BW9gVxz9.js +0 -38
  122. package/dist/assets/InvoicingRoutes-CxKyyTQc.js +0 -2
  123. package/dist/assets/MobileAppDrawer-0TaE2Qid.js +0 -1
  124. package/dist/assets/NotFoundScreen-BatgS8le.js +0 -1
  125. package/dist/assets/PandLWithForecastRoutes-DiipWbFp.js +0 -1
  126. package/dist/assets/PerformanceRoutes-eA0QwQYt.js +0 -1
  127. package/dist/assets/ReimbursementRoutes-B8NK1spY.js +0 -68
  128. package/dist/assets/ReportsRoutes-DRBiAxJk.js +0 -1
  129. package/dist/assets/RewardsRoutes-DqoIHOPS.js +0 -1
  130. package/dist/assets/SignInScreen-C5RNgyDG.js +0 -1
  131. package/dist/assets/SignOutScreen-BZdppeCA.js +0 -9
  132. package/dist/assets/TransactionDetailRoutes-L8u6TmTF.js +0 -1
  133. package/dist/assets/TransactionDetailScreen-KBMzz0Xq.js +0 -5
  134. package/dist/assets/TransactionListRoutes-CKeYxgtl.js +0 -1
  135. package/dist/assets/TreasuryRoutes-DsNk_W1Q.js +0 -37
  136. package/dist/assets/ZeniAccountRoutes-Bgi1019U.js +0 -57
  137. package/dist/assets/useAskAiCfoHostNavButtonProps-CvEN7QS-.js +0 -1
  138. package/dist/assets/useTaskManagerAccess-ECD0Ec-b.js +0 -1
  139. package/dist/assets/withTransactionSidePanel-qep2Sc8k.js +0 -25
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-BjcYyeQ6.js";import{h as Y,g as Q,u as ee,i as W,j as v,N as j,l as H,t as Qe}from"./core-B-8b0iz9.js";import{bJ as en,fF as F,cG as nn,HT as $,Z0 as tn,Z3 as an,uX as ne,uL as te,mz as ae,BL as R,Z5 as Ce,gG as Ge,gF as We,gE as He,Z6 as sn,I0 as on,Mx as he,Mo as Ie,Ml as Ae,M3 as X,Mr as _e,Mu as ke,MA as ve,Cd as Pe,g_ as cn,cB as rn,d_ as un,dZ as dn,di as ln,bt as pn,cu as Fe,Z7 as mn,L3 as de,LH as yn,Z8 as fn,bK as gn,NS as le,NG as Sn,Z9 as bn,Za as Cn,NW as hn,N_ as In,Zb as je,BE as An,Sm as _n,Ow as be,Pl as pe,Zc as kn,Zd as vn,Ze as Pn,Zf as qe,Zg as Tn,Vq as En,Yh as Dn,VF as Un,Zh as Ke,M7 as On,VG as wn,Mb as Fn,Zi as we,OG as Je,mH as Vn,uO as Xe,BN as xn,bE as Ne,BZ as Re,cE as Bn,Zj as Ye,Od as jn,Oe as Nn,Oi as Rn,Zk as Ln,Oz as Le,Zl as Mn,Zm as zn,Zn,Zo as $n,gV as Gn,Jc as Wn,Zp as Hn,Jh as qn,Jg as Kn}from"./zeni-epic-state-95zxmizy.js";import{aj as Te,K as ie,o as me,S as J,E as Ee,z as E,a9 as se,k as D,a8 as De,V as G,bR as Jn,af as oe,bS as V,bj as Ve,bT as Xn,bU as Yn,bV as Qn,q as Be,bW as et,p as Me,aH as ze,a2 as nt,ac as tt,bX as at,bY as it,bZ as st,w as ot}from"./index-DuxR1XDX.js";import{a as h}from"./sentry-DZ9rNYfw.js";import{n as xe,D as ct,S as rt}from"./mui-C33Oegsm.js";import{u as ut,B as Oe}from"./BusinessVerificationPageScreen-B20TVwus.js";import{M as ye}from"./MobileAppDrawer-0TaE2Qid.js";import N from"./NotFoundScreen-BatgS8le.js";import{a as Ze}from"./analyticsHelper-C6SU-53H.js";import{d as $e}from"./routePaths-B1syYHWh.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="301905f3-859c-4523-b89e-39f219f53150",e._sentryDebugIdIdentifier="sentry-dbid-301905f3-859c-4523-b89e-39f219f53150")}catch{}})();const dt=xe.div`
1
+ import{j as u}from"./liveblocks-CIxx6Ub6.js";import{h as Y,g as Q,u as ee,i as G,j as v,N as j,l as H,t as Qe}from"./core-Caq7Zbsp.js";import{bJ as en,fF as F,cG as nn,HT as $,Z0 as tn,Z3 as an,uX as ne,uL as te,mz as ae,BL as R,Z5 as Ce,gG as We,gF as Ge,gE as He,Z6 as sn,I0 as on,Mx as he,Mo as Ie,Ml as Ae,M3 as X,Mr as _e,Mu as ke,MA as ve,Cd as Pe,g_ as cn,cB as rn,d_ as un,dZ as dn,di as ln,bt as pn,cu as Fe,Z7 as mn,L3 as de,LH as yn,Z8 as fn,bK as gn,NS as le,NG as Sn,Z9 as bn,Za as Cn,NW as hn,N_ as In,Zb as je,BE as An,Sm as _n,Ow as be,Pl as pe,Zc as kn,Zd as vn,Ze as Pn,Zf as qe,Zg as Tn,Vq as En,Yh as Dn,VF as Un,Zh as Je,M7 as On,VG as wn,Mb as Fn,Zi as we,OG as Ke,mH as Vn,uO as Xe,BN as xn,bE as Ne,BZ as Re,cE as Bn,Zj as Ye,Od as jn,Oe as Nn,Oi as Rn,Zk as Ln,Oz as Le,Zl as Mn,Zm as zn,Zn,Zo as $n,gV as Wn,Jc as Gn,Zp as Hn,Jh as qn,Jg as Jn}from"./zeni-epic-state-DROyxOLw.js";import{aj as Te,W as ie,N as me,f as K,E as Ee,z as E,a9 as se,k as D,a8 as De,U as W,bR as Kn,af as oe,bS as V,bj as Ve,bT as Xn,bU as Yn,bV as Qn,r as Be,bW as et,p as Me,aH as ze,a2 as nt,ac as tt,bX as at,bY as it,bZ as st,w as ot}from"./index-DOXJLxdR.js";import{a as h}from"./sentry-BCPOyc0G.js";import{n as xe,D as ct,S as rt}from"./mui-DI0hUuFr.js";import{u as ut,B as Oe}from"./BusinessVerificationPageScreen-CWJBny4J.js";import{M as ye}from"./MobileAppDrawer-DqgtjBKX.js";import N from"./NotFoundScreen-C2GrPpNy.js";import{a as Ze}from"./analyticsHelper-DHPcRAai.js";import{d as $e}from"./routePaths-C1OqXYGB.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="7042d370-c848-49ff-bf5d-980e442d0ec9",e._sentryDebugIdIdentifier="sentry-dbid-7042d370-c848-49ff-bf5d-980e442d0ec9")}catch{}})();const dt=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-BjcYyeQ6.js";import{h as Y,g as Q,u as ee,i as W
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,lt=H((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=F(e),n=tn(e),i=E.getSignedInUser(),l=r.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},c=an(e,t),p=a&&c.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&c.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{billPaySetupView:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyBillPayInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e($(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Pe("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(ve(n,t,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(_e(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e($(t,!0))},onEnableBillPayClick:()=>{e(X(t,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Ie(n,i,"bill_pay","bill_pay_setup"):Ae("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(he(t,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?a("../.."):a("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(t))},onAcceptUpdatedTOSSuccess:()=>{e($(t,!0))},onGetOtp:(n,i)=>{e(He(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(We(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(Ge(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(R(t,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{a("../../dashboard")},onNavigateToSettings:()=>{a("../bills/setup")},onInternationPaymentSetUpClick:()=>{a("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ce({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(t,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(Jn),pt=()=>{const e=Te(),o=Y(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=en(n?.loggedInUserRoleMap),{useFeatureGate:l}=me(),{isFeatureEnabled:s}=l(J.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(J.isBillPayLocalCurrencyFeatureEnabled),p=Ee(),[g,S]=h.useState(!1),_=h.useRef(!1),I=v((m=>m.billPaySetupViewState.fetchState)),d=v((m=>F(m)));ut();const y=d.companyId??E.getSignedInUserTenant(r)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const f=!!d.companyBillPayInfo?.info?.isBillPayTOSAccepted,P=nn(n?.loggedInUserRoleMap);h.useEffect((()=>{_.current||I!=="Not-Started"||y==null?_.current||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(_.current=!0,t($(y,!1,!0))):(_.current=!0,t($(y,!0)))}),[I,y,t]);const b=m=>{S(m)};if(f===!1||P&&!n?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(f===!0&&n?.loggedInUserRoleMap!=null){const m=C=>C.trackPageLoaded(G.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(se,{analytics:D,onLoad:C=>m(C)}),u.jsx(ye,{isAppContentDrawerOpen:g,handleDrawerToggle:b}),u.jsx(lt,{navigate:o,location:a,companyId:y,currentTenant:d,isUserBillPayAdmin:i,showIntlWiseWidget:s,meetingUrl:e("bill_pay_setup"),onClickMenuIcon:()=>{b(!0)},isLocalCurrencyEnabled:c})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:p.colors.grey5}})},$t=(e,o)=>e!=null&&(function(a){return a==="debit"||a==="credit"||a==="debit_and_credit"})(e)?e:o,Gt=e=>`/${e}/cards`,Wt=e=>`/${e}/cards/setup`,Ht=e=>`/${e}/cards/onboard`,qt=(e,o,a,t,r=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return t==null||t.status.code!=="inactive"||t.cardHolderUserId!==a.userId||t.type.code!=="business_physical_credit_card"&&t.type.code!=="business_physical_debit_card"?t!=null&&t.status.code==="active"&&t.cardHolderUserId===a.userId&&t.type.code==="business_physical_credit_card"&&r===!0?n+="/addToWallet":t==null||t.type.code!=="business_physical_debit_card"&&t.type.code!=="business_virtual_debit_card"||t.status.code!=="active"||t.cardHolderUserId!==a.userId||t.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Kt=(e,o)=>e.find((a=>a.id===o)),Jt=(e,o,a)=>!e||!o||a.fetchState==="Completed",mt=(e,o,a,t)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:a,isCreditCardEnabled:t}),Xt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Yt=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:V(t.limit.amount),creditAccountAvailableAmount:V(t.available.amount),creditAccountSpentAmount:V(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:V(r.remainingAmountDue.amount)}:void 0,Qt=(e,o,a,t,r)=>e&&o&&a?{debitAccountId:t.depositAccounts.map((n=>n.id)),debitAccountName:t.depositAccounts.map((n=>n.accountName)),debitAccountBalance:t.depositAccounts.map((n=>V(n.accountBalance.available.amount))),debitCardsSpend:V(r?.currentMonthSpends.amount??0),debitAccountStatus:t.depositAccounts.map((n=>n.accountStatus))}:void 0,ea=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,na=80,ta=80,aa=e=>e.companyId??E.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a,isDebitCardProductVisible:t,chargeCardsCreditAccountLimit:r})=>(e||o||a)&&(!t||r>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a})=>e||o||a,sa=({cardInfo:e,isProductVisible:o,isTOSAccepted:a,isSetupEnabled:t,isUserHasCardsAdminLevelAccess:r,isUserHasCardsAccess:n})=>!!e&&o&&(!a&&r||n&&!r&&!t),gt=H((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=F(e),l=E.getSignedInUser(),s=i.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=a&&t.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&t.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{chargeCardSetUpView:t,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:p,analytics:D,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:c,productInformation:p,controllerEmails:g,businessVerificationStatus:S,isCardPolicyEnabled:_,isUserChargeCardAdmin:I}=o;return{onBusinessVerificationSectionClick:()=>{D.trackCardsVerifyIdentityCompanyDetailsClick(g,p,S?.code),a("../verification"),r?.company?.companyChargeCardInfo!=null&&r.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(de(t,!1,!0))},...I&&_?{onCardPolicySectionClick:()=>{a("../policy")}}:{},onFetchLinkTokenClick:(d,y)=>{e(Pe("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(ve(d,t,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,f)=>{e(ke(d,y,"charge_cards","charge_card_setup",f))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(_e(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(de(t,!0))},onEnableChargeCardClick:()=>{D.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&c===!1?e(X(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(X(t,"charge_cards")):i===!0&&c===!1&&e(X(t,"debit_cards"))},onUpdateChargeCardClick:(d,y,f)=>{const P=n.allBankAccounts.find((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId)),b=n.allBankAccounts.find((m=>m.accountId===d));D.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:P?.accountName??"",newZeniCashAccount:b?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(f==="paymentAccount"?Ie(d,y,"charge_cards","charge_card_setup"):Ae("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const f=n.allFundingAccounts.find((m=>m.id===d)),P=n.allFundingAccounts.findIndex((m=>m.id===n.primaryFundingAccount?.id))+1,b=n.allFundingAccounts.findIndex((m=>m.id===d))+1;D.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:V(f?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:f?.accType==="depositAccount",oldPaymentAccountPosition:P,newPaymentAccountPosition:b,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(he(t,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(fn()),a("../",{relative:"path"})},onBackClick:()=>{r?.companyChargeCardInfo?.info?.isChargeCardEnabled||r?.companyDebitCardInfo?.info?.isDebitCardEnabled?a("../",{relative:"path"}):a("../..",{relative:"path"})},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(Ce({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(R(t,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(R(t,d,"charge_cards",!0,!0,!0)):i===!0&&e(R(t,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onUpdateAutoPayClick:d=>{e(yn(t,d))}}}))(Xn),St=()=>{const e=Te(),o=Y(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=v((L=>F(L))),{useDynamicConfig:l,useFeatureGate:s}=me(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(Ve.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[i.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:S}=s(J.isDebitCardFeatureEnabled),{isFeatureEnabled:_}=s(J.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(J.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=s(J.isCardPolicyEnabled),y=v((L=>cn(L,i.companyId))),f=rn(y.controllers),P=!!i.company?.companyChargeCardInfo.isChargeCardEnabled,b=!!i.company?.companyDebitCardInfo.isDebitCardEnabled,m=un(S,i),C=yt({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:m}),k=dn(i),T=ln(i),A=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=ft({isCardsOnlyTenant:k,isChargeCardFeatureEnabled:_,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:A}),M=C&&U===!1,x=C===!1&&U,z=pn(n?.loggedInUserRoleMap),w=Fe(n?.loggedInUserRoleMap),[ce,q]=h.useState(!1),[K,re]=h.useState(!1),Z=v((L=>L.chargeCardSetupViewState.fetchState)),B=E.getSignedInUserTenant(r)?.companyId??i.companyId,O=E.getSignedInUser(),Ue=L=>{q(L)},fe=v((L=>mn(L,B)));if(O==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{K||Z!=="Not-Started"||B==null?K||Z!=="Completed"||B==null||i.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(de(B,!1,!0)):(re(!0),t(de(B,!0)))}),[K,Z,B,t]);const ge=!!i.company?.companyChargeCardInfo.isChargeCardTOSAccepted,Se=!!i.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=mt(U,C,b,P);return ge||Se?ge||Se?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded(G.Event.cardsSetupVisited),D.trackCardsCardSetupView(f,ue,c==null?"Cards Setup":c.includes("cards/promo")?"Promo":c.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(ye,{isAppContentDrawerOpen:ce,handleDrawerToggle:Ue}),u.jsx(gt,{autoPayThreshold:g,navigate:o,meetingUrl:e("charge_card_setup"),location:a,companyId:B,currentTenant:i,isEarlyPayEnabled:I,isChargeCardTOSAccepted:ge,isDebitCardTOSAccepted:Se,isUserChargeCardAdmin:z,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:M,isCreditCardOnlyEnabled:x,chargeCardSetUpView:fe,isCreditCardProductVisible:U,isDebitCardFeatureEnabled:C,isChargeCardSetupEnabled:P,isDebitCardSetupEnabled:b,businessVerificationStatus:i.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:f,productInformation:ue,onClickMenuIcon:()=>{Ue(!0)},hasZeniAccountsAdminAccess:w})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},bt=xe.div`
9
+ `,lt=H((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=F(e),n=tn(e),i=E.getSignedInUser(),l=r.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},c=an(e,t),p=a&&c.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&c.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{billPaySetupView:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyBillPayInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e($(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Pe("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(ve(n,t,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(_e(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e($(t,!0))},onEnableBillPayClick:()=>{e(X(t,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Ie(n,i,"bill_pay","bill_pay_setup"):Ae("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(he(t,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?a("../.."):a("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(t))},onAcceptUpdatedTOSSuccess:()=>{e($(t,!0))},onGetOtp:(n,i)=>{e(He(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(We(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(R(t,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{a("../../dashboard")},onNavigateToSettings:()=>{a("../bills/setup")},onInternationPaymentSetUpClick:()=>{a("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ce({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(t,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(Kn),pt=()=>{const e=Te(),o=Y(),a=Q(),t=ee(),{tenantEmailDomain:r}=G(),n=ie(),i=en(n?.loggedInUserRoleMap),{useFeatureGate:l}=me(),{isFeatureEnabled:s}=l(K.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(K.isBillPayLocalCurrencyFeatureEnabled),p=Ee(),[g,S]=h.useState(!1),_=h.useRef(!1),I=v((m=>m.billPaySetupViewState.fetchState)),d=v((m=>F(m)));ut();const y=d.companyId??E.getSignedInUserTenant(r)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const f=!!d.companyBillPayInfo?.info?.isBillPayTOSAccepted,P=nn(n?.loggedInUserRoleMap);h.useEffect((()=>{_.current||I!=="Not-Started"||y==null?_.current||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(_.current=!0,t($(y,!1,!0))):(_.current=!0,t($(y,!0)))}),[I,y,t]);const b=m=>{S(m)};if(f===!1||P&&!n?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(f===!0&&n?.loggedInUserRoleMap!=null){const m=C=>C.trackPageLoaded(W.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(se,{analytics:D,onLoad:C=>m(C)}),u.jsx(ye,{isAppContentDrawerOpen:g,handleDrawerToggle:b}),u.jsx(lt,{navigate:o,location:a,companyId:y,currentTenant:d,isUserBillPayAdmin:i,showIntlWiseWidget:s,meetingUrl:e("bill_pay_setup"),onClickMenuIcon:()=>{b(!0)},isLocalCurrencyEnabled:c})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:p.colors.grey5}})},$t=(e,o)=>e!=null&&(function(a){return a==="debit"||a==="credit"||a==="debit_and_credit"})(e)?e:o,Wt=e=>`/${e}/cards`,Gt=e=>`/${e}/cards/setup`,Ht=e=>`/${e}/cards/onboard`,qt=(e,o,a,t,r=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return t==null||t.status.code!=="inactive"||t.cardHolderUserId!==a.userId||t.type.code!=="business_physical_credit_card"&&t.type.code!=="business_physical_debit_card"?t!=null&&t.status.code==="active"&&t.cardHolderUserId===a.userId&&t.type.code==="business_physical_credit_card"&&r===!0?n+="/addToWallet":t==null||t.type.code!=="business_physical_debit_card"&&t.type.code!=="business_virtual_debit_card"||t.status.code!=="active"||t.cardHolderUserId!==a.userId||t.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Jt=(e,o)=>e.find((a=>a.id===o)),Kt=(e,o,a)=>!e||!o||a.fetchState==="Completed",mt=(e,o,a,t)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:a,isCreditCardEnabled:t}),Xt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Yt=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:V(t.limit.amount),creditAccountAvailableAmount:V(t.available.amount),creditAccountSpentAmount:V(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:V(r.remainingAmountDue.amount)}:void 0,Qt=(e,o,a,t,r)=>e&&o&&a?{debitAccountId:t.depositAccounts.map((n=>n.id)),debitAccountName:t.depositAccounts.map((n=>n.accountName)),debitAccountBalance:t.depositAccounts.map((n=>V(n.accountBalance.available.amount))),debitCardsSpend:V(r?.currentMonthSpends.amount??0),debitAccountStatus:t.depositAccounts.map((n=>n.accountStatus))}:void 0,ea=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,na=80,ta=80,aa=e=>e.companyId??E.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a,isDebitCardProductVisible:t,chargeCardsCreditAccountLimit:r})=>(e||o||a)&&(!t||r>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a})=>e||o||a,sa=({cardInfo:e,isProductVisible:o,isTOSAccepted:a,isSetupEnabled:t,isUserHasCardsAdminLevelAccess:r,isUserHasCardsAccess:n})=>!!e&&o&&(!a&&r||n&&!r&&!t),gt=H((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=F(e),l=E.getSignedInUser(),s=i.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=a&&t.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&t.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{chargeCardSetUpView:t,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:p,analytics:D,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:c,productInformation:p,controllerEmails:g,businessVerificationStatus:S,isCardPolicyEnabled:_,isUserChargeCardAdmin:I}=o;return{onBusinessVerificationSectionClick:()=>{D.trackCardsVerifyIdentityCompanyDetailsClick(g,p,S?.code),a("../verification"),r?.company?.companyChargeCardInfo!=null&&r.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(de(t,!1,!0))},...I&&_?{onCardPolicySectionClick:()=>{a("../policy")}}:{},onFetchLinkTokenClick:(d,y)=>{e(Pe("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(ve(d,t,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,f)=>{e(ke(d,y,"charge_cards","charge_card_setup",f))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(_e(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(de(t,!0))},onEnableChargeCardClick:()=>{D.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&c===!1?e(X(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(X(t,"charge_cards")):i===!0&&c===!1&&e(X(t,"debit_cards"))},onUpdateChargeCardClick:(d,y,f)=>{const P=n.allBankAccounts.find((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId)),b=n.allBankAccounts.find((m=>m.accountId===d));D.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:P?.accountName??"",newZeniCashAccount:b?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(f==="paymentAccount"?Ie(d,y,"charge_cards","charge_card_setup"):Ae("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const f=n.allFundingAccounts.find((m=>m.id===d)),P=n.allFundingAccounts.findIndex((m=>m.id===n.primaryFundingAccount?.id))+1,b=n.allFundingAccounts.findIndex((m=>m.id===d))+1;D.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:V(f?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:f?.accType==="depositAccount",oldPaymentAccountPosition:P,newPaymentAccountPosition:b,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(he(t,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(fn()),a("../",{relative:"path"})},onBackClick:()=>{r?.companyChargeCardInfo?.info?.isChargeCardEnabled||r?.companyDebitCardInfo?.info?.isDebitCardEnabled?a("../",{relative:"path"}):a("../..",{relative:"path"})},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(Ce({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(R(t,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(R(t,d,"charge_cards",!0,!0,!0)):i===!0&&e(R(t,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onUpdateAutoPayClick:d=>{e(yn(t,d))}}}))(Xn),St=()=>{const e=Te(),o=Y(),a=Q(),t=ee(),{tenantEmailDomain:r}=G(),n=ie(),i=v((L=>F(L))),{useDynamicConfig:l,useFeatureGate:s}=me(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(Ve.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[i.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:S}=s(K.isDebitCardFeatureEnabled),{isFeatureEnabled:_}=s(K.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=s(K.isCardPolicyEnabled),y=v((L=>cn(L,i.companyId))),f=rn(y.controllers),P=!!i.company?.companyChargeCardInfo.isChargeCardEnabled,b=!!i.company?.companyDebitCardInfo.isDebitCardEnabled,m=un(S,i),C=yt({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:m}),k=dn(i),T=ln(i),A=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=ft({isCardsOnlyTenant:k,isChargeCardFeatureEnabled:_,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:A}),M=C&&U===!1,x=C===!1&&U,z=pn(n?.loggedInUserRoleMap),w=Fe(n?.loggedInUserRoleMap),[ce,q]=h.useState(!1),[J,re]=h.useState(!1),Z=v((L=>L.chargeCardSetupViewState.fetchState)),B=E.getSignedInUserTenant(r)?.companyId??i.companyId,O=E.getSignedInUser(),Ue=L=>{q(L)},fe=v((L=>mn(L,B)));if(O==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{J||Z!=="Not-Started"||B==null?J||Z!=="Completed"||B==null||i.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(de(B,!1,!0)):(re(!0),t(de(B,!0)))}),[J,Z,B,t]);const ge=!!i.company?.companyChargeCardInfo.isChargeCardTOSAccepted,Se=!!i.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=mt(U,C,b,P);return ge||Se?ge||Se?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded(W.Event.cardsSetupVisited),D.trackCardsCardSetupView(f,ue,c==null?"Cards Setup":c.includes("cards/promo")?"Promo":c.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(ye,{isAppContentDrawerOpen:ce,handleDrawerToggle:Ue}),u.jsx(gt,{autoPayThreshold:g,navigate:o,meetingUrl:e("charge_card_setup"),location:a,companyId:B,currentTenant:i,isEarlyPayEnabled:I,isChargeCardTOSAccepted:ge,isDebitCardTOSAccepted:Se,isUserChargeCardAdmin:z,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:M,isCreditCardOnlyEnabled:x,chargeCardSetUpView:fe,isCreditCardProductVisible:U,isDebitCardFeatureEnabled:C,isChargeCardSetupEnabled:P,isDebitCardSetupEnabled:b,businessVerificationStatus:i.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:f,productInformation:ue,onClickMenuIcon:()=>{Ue(!0)},hasZeniAccountsAdminAccess:w})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},bt=xe.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-BjcYyeQ6.js";import{h as Y,g as Q,u as ee,i as W
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,Ct=H((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=F(e),n=bn(e),i=Cn(e,t),l=E.getSignedInUser(),s=r.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""};return{remiSetupView:i,isDisabled:a&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",remiApprovalView:n,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:c,denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,description:_}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:c},denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,mileageCurrencyCode:s,mileageCurrencySymbol:c,mileageUnit:l,description:_}}))},onSaveMileageClick:n=>{e(hn(t)),D.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyReimbursementInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Pe("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(ve(n,t,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(_e(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(le(t,!0))},onEnableRemiClick:()=>{e(X(t,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Ie(n,i,"reimbursement","reimbursement_setup"):Ae("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&r.companyReimbursementInfo.info.isReimbursementEnabled===!1?a("../.."):a("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ce({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(t,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(he(t,"reimbursement_setup",n,i))}}}))(Qn),ht=()=>{const e=Te(),o=Y(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=Ee(),l=gn(n?.loggedInUserRoleMap),s=Fe(n?.loggedInUserRoleMap),[c,p]=h.useState(!1),g=h.useRef(!1),[S,_]=h.useState(!1),I=v((k=>k.remiSetupViewState.fetchState)),d=v((k=>F(k))),y=v((k=>k.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:f,isLoading:P}=Yn(d?.tenantId),b=E.getSignedInUserTenant(r)?.companyId??d.companyId,m=E.getSignedInUser(),C=k=>{p(k)};if(m==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{g.current||I!=="Not-Started"||b==null?g.current||I!=="Completed"||b==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(g.current=!0,t(le(b,!1,!0))):(g.current=!0,t(le(b,!0)))}),[I,b,t]),h.useEffect((()=>{S||y!=="Not-Started"||P||(_(!0),t(Sn(!0,!1,!1,f)))}),[S,y,P,f,t]),d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const k=T=>T.trackPageLoaded(G.Event.reimbursementSetup);return u.jsxs(bt,{children:[u.jsx(se,{analytics:D,onLoad:T=>k(T)}),u.jsx(ye,{isAppContentDrawerOpen:c,handleDrawerToggle:C}),u.jsx(Ct,{navigate:o,location:a,companyId:b,currentTenant:d,isUserRemiAdmin:l,meetingUrl:e("reimbursement_setup"),onClickMenuIcon:()=>{C(!0)},hasZeniAccountsAdminAccess:s})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},It=H((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=F(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=En(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=Dn(e.companyConfigState),p=Un(e.userRoleConfigState),g=t==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:c.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:a,productType:t,currentTenant:r,navigate:n,location:i}=o,{tenantEmailDomain:l}=r;return{onCompanyDetailsChanged:s=>{const{companyDescription:c,companyIndustry:p,companyIndustryType:g,companyLegalName:S,companyTaxId:_,companyWebsite:I,companyPhone:d,primaryContactEmail:y,primaryContactName:f,primaryContactUserId:P,primaryContactSyncToken:b,syncToken:m,fileIds:C,incDate:k,typeOfIncorporation:T,stateOfIncorporation:A,sourceOfFunds:U,companySubIndustry:M,countriesOfOperations:x,companySourceOfFunds:z,companySourceOfFundsDescription:w,transactionVolume:ce,transactionVolumeDescription:q,purposeOfAccount:K,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:B,usNexus:O,usNexusTypes:Ue}=s,fe=g?.selectedOption,ge={companyId:a,companyDescription:c,companyIndustry:p.selectedOption,companyIndustryType:fe==null||fe===""?void 0:fe,companyLegalName:S,taxIdOrEIN:_,website:I!=""&&I!=null?Bn(I):void 0,phone:d,syncToken:m,fileIds:C,incDate:k!=null?Ne(k?.toString()):k,typeOfIncorporation:T?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:U?.selectedOption??"",companySubIndustry:M?.selectedOption??"",countriesOfOperations:x?.selectedOptions.map((ue=>ue.length===2?ue:ze(ue)))??[],companySourceOfFunds:z?.selectedOption??"",companySourceOfFundsDescription:w,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:q,purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:B,usNexus:O,usNexusTypes:Ue?.selectedOptions??[]},Se={userId:P,firstName:f.firstName,lastName:f.lastName,email:y,syncToken:b};e(Re({companyDetails:ge,primaryContactDetails:Se}))},onCompanyOfficerUpdated:s=>{const c=s.map((p=>{const{officerType:g,userId:S,name:_,email:I,nationalityCountryCode:d,ssn:y,dob:f,phone:P,syncToken:b,selectDocument:m,role:C,ownership:k,isSelectedForVerification:T,userVerificationStatus:A,treasuryUserVerificationStatus:U,fileIds:M}=p;let x;return m.selectDocumentType==="driverLicense"?x="driving_license":m.selectDocumentType==="passport"?x="passport":m.selectDocumentType==="stateId"?x="id_document":m.selectDocumentType==="ssnCard"&&(x="social_security_card"),{officerType:g,userId:S,firstName:_.firstName,lastName:_.lastName,email:I,ssn:y,nationalityCountryCode:d?.selectedOption!=null?ze(d.selectedOption):void 0,phone:P,birthday:f!=null?Ne(f?.toString()):f,syncToken:b,titleAtCompany:C.selectedOption,ownershipInCompany:k,documentTypeSelectedForVerification:x,isSelectedForVerification:T,userVerificationStatus:A,treasuryUserVerificationStatus:U,fileIds:M,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Re({officers:c}))},onSaveDetailsClick:s=>{e(R(a,s,t))},onSendForVerificationClick:s=>{e(R(a,s,t,!0))},onAddressClick:s=>{const c=$e(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S={};g.forEach(((_,I)=>{S[I]=_})),n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onRegisteredAddressClick:s=>{const c=$e(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S=Object.fromEntries(g.entries());n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onBackClick:()=>{e(xn({companyId:a})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Xe(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(He(s,"SpendManagementSetup"))},onResendOtp:s=>{e(We(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(Ge(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(Vn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Je())},onOverlayClose:()=>{e(we())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=wn(s.documentType);c!=null&&e(Fn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(On({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))}}}))(et),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=Y(),r=Q(),n=ee(),[i]=Qe(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[c,p]=h.useState(!1),{tenantEmailDomain:g}=W(),S=ie(),{useDynamicConfig:_}=me(),I=Ee(),{configValue:d}=_(Ve.zeniAccountsConfig),y=je(d),f=v((A=>{switch(e){case"zeni_accounts":return A.zeniAccountSetupViewState.fetchState;case"reimbursement":return A.remiSetupViewState.fetchState;case"charge_cards":return A.chargeCardSetupViewState.fetchState;case"zeni_treasury":return A.treasurySetupViewState.fetchState;default:return A.billPaySetupViewState.fetchState}})),P=v((A=>A.companyConfigState.fetchState)),b=v((A=>A.userRoleConfigState.fetchState)),m=v((A=>F(A))),C=m.companyId??E.getSignedInUserTenant(g)?.companyId;if(h.useEffect((()=>{P==="Not-Started"&&n(An()),b==="Not-Started"&&n(_n(!0))}),[P,b,n]),h.useEffect((()=>{if(!c&&f==="Not-Started"&&C!=null)switch(p(!0),e){case"zeni_accounts":n(pe(C,!0));break;case"zeni_treasury":n(be(C,!0));break;case"reimbursement":n(le(C,!0));break;case"charge_cards":n(de(C,!0));break;default:n($(C,!0))}}),[c,f,C,n]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let k;switch(e){case"zeni_accounts":k=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":k=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":k=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":k=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:k=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}const T=v((A=>{let U;switch(e){case"zeni_accounts":U=Tn(A,C);break;case"zeni_treasury":U=qe(A,C);break;case"charge_cards":U=Pn(A,C);break;case"reimbursement":U=vn(A,C);break;default:U=kn(A,C)}return U}));return k===!1?null:T.fetchState==="Completed"&&k===!0&&S?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:A=>(U=>{switch(e){case"zeni_accounts":return U.trackPageLoaded(G.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return U.trackPageLoaded(G.Event.reimbursementBusinessVerification);default:return U.trackPageLoaded(G.Event.billPayBusinessVerification,Be(r)?"Settings":void 0)}})(A)}),u.jsx(It,{businessVerificationDetails:T,navigate:t,location:r,companyId:C,analytics:D,currentTenant:m,productType:e,roleMap:S.loggedInUserRoleMap,isSettings:Be(r),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:y.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},_t={overlayWidth:new tt(100,100,59)},kt=H((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=F(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Ye(e,t),c=qe(e,t),p=a&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=Ln(e),S=g.transactions,_=Ke(e),I=g.accountSummary?.totalBalance?.amount,d=S.length===0||I===0;return{treasurySetupView:s,businessVerificationDetails:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:S,transferDetails:_,isFirstTransfer:d,isDisabled:p,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isOnSetup:!0,maxInsuredAmount:o.maxInsuredAmount}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Zn(s))},onBusinessVerificationSectionClick:(s,c)=>{let p="../verification";s&&(p+="?showStepProgress=true",c&&(p+="&isTransferInitiated=true")),a(p),r?.company?.companyTreasuryInfo!=null&&r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(be(t,!1,!0))},onFetchLinkTokenClick:(s,c)=>{e(Pe("treasury_setup",s,c))},onEstablishConnectionClick:s=>{e(ve(s,t,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,c,p)=>{e(ke(s,c,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,c)=>{e(_e(!1,s,"zeni_treasury","treasury_setup",c))},onEstablishConnectionSuccess:()=>{e(be(t,!0))},onEnableTreasuryClick:()=>{e(X(t,"zeni_treasury"))},onUpdateTreasuryClick:(s,c,p)=>{e(p==="paymentAccount"?Ie(s,c,"zeni_treasury","treasury_setup"):Ae("treasury_setup",s,c))},onUpdatePrimaryFundingAccount:(s,c)=>{e(he(t,"treasury_setup",s,c))},onNavigateToDashboard:()=>{a(r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,c)=>{e(Ce({officerType:s,fileIds:c}))},onSendForVerificationClick:(s,c)=>{if(e(R(t,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(Le(!1))}c===!0&&e(Je())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:c}=s;e(zn({sourceOfFunds:c?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Ze(s)),e(Mn(s))},onConfirmFundAllocation:()=>{e(Le(n))},onOverlayClose:()=>{e(we())}}}))(at),vt=()=>{const e=Te(),o=Y(),a=Q(),t=ee(),r=Ee(),n=nt(),{tenantEmailDomain:i}=W(),{useDynamicConfig:l}=me(),s=ie(),[c,p]=h.useState(!1),g=Fe(s?.loggedInUserRoleMap),{configValue:S}=l(Ve.zeniAccountsConfig),_=je(S),[I,d]=h.useState(!1),[y,f]=h.useState(!1),[P,b]=h.useState(!1),[m,C]=h.useState(!1),[k,T]=h.useState(!1),A=v((O=>O.treasurySetupViewState.fetchState)),U=v((O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),M=v((O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),x=v((O=>O.treasuryDetailState.transactionsState?.fetchState)),z=v((O=>F(O))),w=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=v((O=>Ye(O,w))),q=ce.isAtomicAccountExists,K=E.getSignedInUser(),re=O=>{d(O)};if(K==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||A!=="Not-Started"||w==null||(f(!0),t(be(w,!0,!1)))}),[y,A,w,t]),h.useEffect((()=>{P||U!=="Not-Started"||w==null||(b(!0),t(jn()))}),[P,U,w,t]),h.useEffect((()=>{m||M!=="Not-Started"||w==null||(C(!0),t(Nn()))}),[m,M,w,t]),h.useEffect((()=>{k||x!=="Not-Started"||w==null||(T(!0),t(Rn(!0)))}),[k,x,w,t]);const Z=z.companyTreasuryInfo?.info?.businessVerificationStatus?.code,B=Z==="pending_review"||Z==="verified";return h.useEffect((()=>{c||A!=="Completed"||q||B||!a.pathname.includes("setup")||p(!0)}),[A,q,B]),z.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{}}),u.jsx(ye,{isAppContentDrawerOpen:I,handleDrawerToggle:re}),u.jsx(ct,{onClose:()=>{t(we()),o("../setup")},anchor:"right",open:a.pathname.includes("verification"),transitionDuration:c?0:250,PaperProps:{style:{width:_t.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c?"transparent":r.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Pt,{onClick:O=>O.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(we()),o("../setup")}})})}),u.jsx(kt,{navigate:o,location:a,companyId:w,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:_.maxInsuredAmount,isAllocationDone:q,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Pt=xe(rt)`
17
+ `,Ct=H((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=F(e),n=bn(e),i=Cn(e,t),l=E.getSignedInUser(),s=r.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""};return{remiSetupView:i,isDisabled:a&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",remiApprovalView:n,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:c,denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,description:_}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:c},denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,mileageCurrencyCode:s,mileageCurrencySymbol:c,mileageUnit:l,description:_}}))},onSaveMileageClick:n=>{e(hn(t)),D.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyReimbursementInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Pe("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(ve(n,t,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(_e(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(le(t,!0))},onEnableRemiClick:()=>{e(X(t,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Ie(n,i,"reimbursement","reimbursement_setup"):Ae("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&r.companyReimbursementInfo.info.isReimbursementEnabled===!1?a("../.."):a("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ce({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(t,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(he(t,"reimbursement_setup",n,i))}}}))(Qn),ht=()=>{const e=Te(),o=Y(),a=Q(),t=ee(),{tenantEmailDomain:r}=G(),n=ie(),i=Ee(),l=gn(n?.loggedInUserRoleMap),s=Fe(n?.loggedInUserRoleMap),[c,p]=h.useState(!1),g=h.useRef(!1),[S,_]=h.useState(!1),I=v((k=>k.remiSetupViewState.fetchState)),d=v((k=>F(k))),y=v((k=>k.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:f,isLoading:P}=Yn(d?.tenantId),b=E.getSignedInUserTenant(r)?.companyId??d.companyId,m=E.getSignedInUser(),C=k=>{p(k)};if(m==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{g.current||I!=="Not-Started"||b==null?g.current||I!=="Completed"||b==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(g.current=!0,t(le(b,!1,!0))):(g.current=!0,t(le(b,!0)))}),[I,b,t]),h.useEffect((()=>{S||y!=="Not-Started"||P||(_(!0),t(Sn(!0,!1,!1,f)))}),[S,y,P,f,t]),d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const k=T=>T.trackPageLoaded(W.Event.reimbursementSetup);return u.jsxs(bt,{children:[u.jsx(se,{analytics:D,onLoad:T=>k(T)}),u.jsx(ye,{isAppContentDrawerOpen:c,handleDrawerToggle:C}),u.jsx(Ct,{navigate:o,location:a,companyId:b,currentTenant:d,isUserRemiAdmin:l,meetingUrl:e("reimbursement_setup"),onClickMenuIcon:()=>{C(!0)},hasZeniAccountsAdminAccess:s})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},It=H((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=F(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=En(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=Dn(e.companyConfigState),p=Un(e.userRoleConfigState),g=t==="zeni_treasury"?Je(e):void 0;return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:c.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:a,productType:t,currentTenant:r,navigate:n,location:i}=o,{tenantEmailDomain:l}=r;return{onCompanyDetailsChanged:s=>{const{companyDescription:c,companyIndustry:p,companyIndustryType:g,companyLegalName:S,companyTaxId:_,companyWebsite:I,companyPhone:d,primaryContactEmail:y,primaryContactName:f,primaryContactUserId:P,primaryContactSyncToken:b,syncToken:m,fileIds:C,incDate:k,typeOfIncorporation:T,stateOfIncorporation:A,sourceOfFunds:U,companySubIndustry:M,countriesOfOperations:x,companySourceOfFunds:z,companySourceOfFundsDescription:w,transactionVolume:ce,transactionVolumeDescription:q,purposeOfAccount:J,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:B,usNexus:O,usNexusTypes:Ue}=s,fe=g?.selectedOption,ge={companyId:a,companyDescription:c,companyIndustry:p.selectedOption,companyIndustryType:fe==null||fe===""?void 0:fe,companyLegalName:S,taxIdOrEIN:_,website:I!=""&&I!=null?Bn(I):void 0,phone:d,syncToken:m,fileIds:C,incDate:k!=null?Ne(k?.toString()):k,typeOfIncorporation:T?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:U?.selectedOption??"",companySubIndustry:M?.selectedOption??"",countriesOfOperations:x?.selectedOptions.map((ue=>ue.length===2?ue:ze(ue)))??[],companySourceOfFunds:z?.selectedOption??"",companySourceOfFundsDescription:w,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:q,purposeOfAccount:J?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:B,usNexus:O,usNexusTypes:Ue?.selectedOptions??[]},Se={userId:P,firstName:f.firstName,lastName:f.lastName,email:y,syncToken:b};e(Re({companyDetails:ge,primaryContactDetails:Se}))},onCompanyOfficerUpdated:s=>{const c=s.map((p=>{const{officerType:g,userId:S,name:_,email:I,nationalityCountryCode:d,ssn:y,dob:f,phone:P,syncToken:b,selectDocument:m,role:C,ownership:k,isSelectedForVerification:T,userVerificationStatus:A,treasuryUserVerificationStatus:U,fileIds:M}=p;let x;return m.selectDocumentType==="driverLicense"?x="driving_license":m.selectDocumentType==="passport"?x="passport":m.selectDocumentType==="stateId"?x="id_document":m.selectDocumentType==="ssnCard"&&(x="social_security_card"),{officerType:g,userId:S,firstName:_.firstName,lastName:_.lastName,email:I,ssn:y,nationalityCountryCode:d?.selectedOption!=null?ze(d.selectedOption):void 0,phone:P,birthday:f!=null?Ne(f?.toString()):f,syncToken:b,titleAtCompany:C.selectedOption,ownershipInCompany:k,documentTypeSelectedForVerification:x,isSelectedForVerification:T,userVerificationStatus:A,treasuryUserVerificationStatus:U,fileIds:M,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Re({officers:c}))},onSaveDetailsClick:s=>{e(R(a,s,t))},onSendForVerificationClick:s=>{e(R(a,s,t,!0))},onAddressClick:s=>{const c=$e(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S={};g.forEach(((_,I)=>{S[I]=_})),n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onRegisteredAddressClick:s=>{const c=$e(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S=Object.fromEntries(g.entries());n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onBackClick:()=>{e(xn({companyId:a})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Xe(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(He(s,"SpendManagementSetup"))},onResendOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(We(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(Vn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(we())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=wn(s.documentType);c!=null&&e(Fn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(On({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))}}}))(et),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=Y(),r=Q(),n=ee(),[i]=Qe(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[c,p]=h.useState(!1),{tenantEmailDomain:g}=G(),S=ie(),{useDynamicConfig:_}=me(),I=Ee(),{configValue:d}=_(Ve.zeniAccountsConfig),y=je(d),f=v((A=>{switch(e){case"zeni_accounts":return A.zeniAccountSetupViewState.fetchState;case"reimbursement":return A.remiSetupViewState.fetchState;case"charge_cards":return A.chargeCardSetupViewState.fetchState;case"zeni_treasury":return A.treasurySetupViewState.fetchState;default:return A.billPaySetupViewState.fetchState}})),P=v((A=>A.companyConfigState.fetchState)),b=v((A=>A.userRoleConfigState.fetchState)),m=v((A=>F(A))),C=m.companyId??E.getSignedInUserTenant(g)?.companyId;if(h.useEffect((()=>{P==="Not-Started"&&n(An()),b==="Not-Started"&&n(_n(!0))}),[P,b,n]),h.useEffect((()=>{if(!c&&f==="Not-Started"&&C!=null)switch(p(!0),e){case"zeni_accounts":n(pe(C,!0));break;case"zeni_treasury":n(be(C,!0));break;case"reimbursement":n(le(C,!0));break;case"charge_cards":n(de(C,!0));break;default:n($(C,!0))}}),[c,f,C,n]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let k;switch(e){case"zeni_accounts":k=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":k=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":k=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":k=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:k=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}const T=v((A=>{let U;switch(e){case"zeni_accounts":U=Tn(A,C);break;case"zeni_treasury":U=qe(A,C);break;case"charge_cards":U=Pn(A,C);break;case"reimbursement":U=vn(A,C);break;default:U=kn(A,C)}return U}));return k===!1?null:T.fetchState==="Completed"&&k===!0&&S?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:A=>(U=>{switch(e){case"zeni_accounts":return U.trackPageLoaded(W.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return U.trackPageLoaded(W.Event.reimbursementBusinessVerification);default:return U.trackPageLoaded(W.Event.billPayBusinessVerification,Be(r)?"Settings":void 0)}})(A)}),u.jsx(It,{businessVerificationDetails:T,navigate:t,location:r,companyId:C,analytics:D,currentTenant:m,productType:e,roleMap:S.loggedInUserRoleMap,isSettings:Be(r),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:y.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},_t={overlayWidth:new tt(100,100,59)},kt=H((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=F(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Ye(e,t),c=qe(e,t),p=a&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=Ln(e),S=g.transactions,_=Je(e),I=g.accountSummary?.totalBalance?.amount,d=S.length===0||I===0;return{treasurySetupView:s,businessVerificationDetails:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:S,transferDetails:_,isFirstTransfer:d,isDisabled:p,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isOnSetup:!0,maxInsuredAmount:o.maxInsuredAmount}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Zn(s))},onBusinessVerificationSectionClick:(s,c)=>{let p="../verification";s&&(p+="?showStepProgress=true",c&&(p+="&isTransferInitiated=true")),a(p),r?.company?.companyTreasuryInfo!=null&&r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(be(t,!1,!0))},onFetchLinkTokenClick:(s,c)=>{e(Pe("treasury_setup",s,c))},onEstablishConnectionClick:s=>{e(ve(s,t,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,c,p)=>{e(ke(s,c,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,c)=>{e(_e(!1,s,"zeni_treasury","treasury_setup",c))},onEstablishConnectionSuccess:()=>{e(be(t,!0))},onEnableTreasuryClick:()=>{e(X(t,"zeni_treasury"))},onUpdateTreasuryClick:(s,c,p)=>{e(p==="paymentAccount"?Ie(s,c,"zeni_treasury","treasury_setup"):Ae("treasury_setup",s,c))},onUpdatePrimaryFundingAccount:(s,c)=>{e(he(t,"treasury_setup",s,c))},onNavigateToDashboard:()=>{a(r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,c)=>{e(Ce({officerType:s,fileIds:c}))},onSendForVerificationClick:(s,c)=>{if(e(R(t,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(Le(!1))}c===!0&&e(Ke())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:c}=s;e(zn({sourceOfFunds:c?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Ze(s)),e(Mn(s))},onConfirmFundAllocation:()=>{e(Le(n))},onOverlayClose:()=>{e(we())}}}))(at),vt=()=>{const e=Te(),o=Y(),a=Q(),t=ee(),r=Ee(),n=nt(),{tenantEmailDomain:i}=G(),{useDynamicConfig:l}=me(),s=ie(),[c,p]=h.useState(!1),g=Fe(s?.loggedInUserRoleMap),{configValue:S}=l(Ve.zeniAccountsConfig),_=je(S),[I,d]=h.useState(!1),[y,f]=h.useState(!1),[P,b]=h.useState(!1),[m,C]=h.useState(!1),[k,T]=h.useState(!1),A=v((O=>O.treasurySetupViewState.fetchState)),U=v((O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),M=v((O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),x=v((O=>O.treasuryDetailState.transactionsState?.fetchState)),z=v((O=>F(O))),w=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=v((O=>Ye(O,w))),q=ce.isAtomicAccountExists,J=E.getSignedInUser(),re=O=>{d(O)};if(J==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||A!=="Not-Started"||w==null||(f(!0),t(be(w,!0,!1)))}),[y,A,w,t]),h.useEffect((()=>{P||U!=="Not-Started"||w==null||(b(!0),t(jn()))}),[P,U,w,t]),h.useEffect((()=>{m||M!=="Not-Started"||w==null||(C(!0),t(Nn()))}),[m,M,w,t]),h.useEffect((()=>{k||x!=="Not-Started"||w==null||(T(!0),t(Rn(!0)))}),[k,x,w,t]);const Z=z.companyTreasuryInfo?.info?.businessVerificationStatus?.code,B=Z==="pending_review"||Z==="verified";return h.useEffect((()=>{c||A!=="Completed"||q||B||!a.pathname.includes("setup")||p(!0)}),[A,q,B]),z.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{}}),u.jsx(ye,{isAppContentDrawerOpen:I,handleDrawerToggle:re}),u.jsx(ct,{onClose:()=>{t(we()),o("../setup")},anchor:"right",open:a.pathname.includes("verification"),transitionDuration:c?0:250,PaperProps:{style:{width:_t.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c?"transparent":r.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Pt,{onClick:O=>O.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(we()),o("../setup")}})})}),u.jsx(kt,{navigate:o,location:a,companyId:w,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:_.maxInsuredAmount,isAllocationDone:q,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Pt=xe(rt)`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  flex-direction: column;
21
- `,Tt=H((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=F(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=$n(e,t),c=a&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:s,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyZeniAccountInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(t,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(Pe("account_setup",n,i))},onEstablishConnectionClick:n=>{e(ve(n,t,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(_e(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(t,!0))},onEnableZeniAccountClick:()=>{e(X(t,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Ie(n,i,"zeni_accounts","account_setup"):Ae("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(he(t,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?a("../"):a("../../")},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ce({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(t,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(it),Et=()=>{const e=Te(),o=Y(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),{useDynamicConfig:n}=me(),i=ie(),l=Fe(i?.loggedInUserRoleMap),{configValue:s}=n(Ve.zeniAccountsConfig),c=je(s),[p,g]=h.useState(!1),[S,_]=h.useState(!1),I=v((b=>b.zeniAccountSetupViewState.fetchState)),d=v((b=>F(b))),y=E.getSignedInUserTenant(r)?.companyId??d.companyId,f=E.getSignedInUser(),P=b=>{g(b)};if(f==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect((()=>{S||I!=="Not-Started"||y==null?S||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(pe(y,!1,!0)):(_(!0),t(pe(y,!0)))}),[S,I,y,t]),d.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const b=m=>m.trackPageLoaded(G.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:m=>b(m)}),u.jsx(ye,{isAppContentDrawerOpen:p,handleDrawerToggle:P}),u.jsx(Tt,{navigate:o,location:a,companyId:y,currentTenant:d,isUserZeniAccountsAdmin:l,accountsPromoConfig:c,meetingUrl:e("zeni_accounts_setup"),onClickMenuIcon:()=>{P(!0)}})]})}},Dt=xe.div`
21
+ `,Tt=H((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=F(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=$n(e,t),c=a&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:s,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyZeniAccountInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(t,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(Pe("account_setup",n,i))},onEstablishConnectionClick:n=>{e(ve(n,t,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(ke(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(_e(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(t,!0))},onEnableZeniAccountClick:()=>{e(X(t,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Ie(n,i,"zeni_accounts","account_setup"):Ae("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(he(t,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?a("../"):a("../../")},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ce({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(t,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(it),Et=()=>{const e=Te(),o=Y(),a=Q(),t=ee(),{tenantEmailDomain:r}=G(),{useDynamicConfig:n}=me(),i=ie(),l=Fe(i?.loggedInUserRoleMap),{configValue:s}=n(Ve.zeniAccountsConfig),c=je(s),[p,g]=h.useState(!1),[S,_]=h.useState(!1),I=v((b=>b.zeniAccountSetupViewState.fetchState)),d=v((b=>F(b))),y=E.getSignedInUserTenant(r)?.companyId??d.companyId,f=E.getSignedInUser(),P=b=>{g(b)};if(f==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect((()=>{S||I!=="Not-Started"||y==null?S||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(pe(y,!1,!0)):(_(!0),t(pe(y,!0)))}),[S,I,y,t]),d.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const b=m=>m.trackPageLoaded(W.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:m=>b(m)}),u.jsx(ye,{isAppContentDrawerOpen:p,handleDrawerToggle:P}),u.jsx(Tt,{navigate:o,location:a,companyId:y,currentTenant:d,isUserZeniAccountsAdmin:l,accountsPromoConfig:c,meetingUrl:e("zeni_accounts_setup"),onClickMenuIcon:()=>{P(!0)}})]})}},Dt=xe.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-BjcYyeQ6.js";import{h as Y,g as Q,u as ee,i as W
26
26
  flex-direction: column;
27
27
  align-items: center;
28
28
  background-color: ${e=>e.theme.colors.grey4};
29
- `,Ut=H((function(e,o){const a=F(e),t=E.getSignedInUser(),r=a.tenantId,n={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""};return{internationalOnboardingDetails:Hn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:D}}),(function(e,o){const{navigate:a}=o;return{onFormDataChange:t=>{e(Kn(t))},onSubmitClick:()=>{e(qn(o.companyId))},onCancelClick:()=>{a("../setup")},updateFilesEntity:t=>{e(ae({files:t}))},onDeleteFile:t=>{e(te(t))},onDeleteFileList:t=>{e(Xe(t))},onEditFileName:(t,r)=>{e(ne(t,r.split(".")[0]))}}}))(st),Ot=()=>{const e=Y(),o=Q(),a=ee(),[t,r]=h.useState(!1),[n,i]=h.useState(!1),[l,s]=h.useState(!1),{tenantEmailDomain:c}=W(),p=ie(),{useFeatureGate:g}=me(),{isFeatureEnabled:S}=g(J.isBillPayLocalCurrencyFeatureEnabled),_=v((T=>T.internationalWireVerificationState.verificationFormFetchState.fetchState)),I=v((T=>T.billPaySetupViewState.fetchState)),d=v((T=>F(T))),y=Ee(),f=d.companyId??E.getSignedInUserTenant(c)?.companyId,P=v((T=>Gn(T.companyState,d.companyId))),b=P?.company.companyBillPayInfo.internationalWireOnboardingStatus,m=b?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{t||_!=="Not-Started"||f==null||(r(!0),a(Wn(f)))}),[t,_,f,a]),h.useEffect((()=>{n||I!=="Not-Started"||f==null||(i(!0),a($(f,!0)))}),[I,n,f,a]),E.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const C=d.companyBillPayInfo?.info?.isBillPayTOSAccepted,k=T=>{s(T)};return C===!1?u.jsx(j,{to:"../promo"}):C===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(Dt,{children:[u.jsx(se,{analytics:D,onLoad:T=>(A=>A.trackPageLoaded(G.Event.billPayBusinessVerification,void 0))(T)}),Be(o)?u.jsx(ye,{isAppContentDrawerOpen:l,handleDrawerToggle:k}):null,u.jsx(Ut,{navigate:e,location:o,companyId:f,analytics:D,currentTenant:d,roleMap:p.loggedInUserRoleMap,isFormReadonly:m,isLocalCurrencyEnabled:S})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},wt=H((function(){return{}}),(function(e,o){const{companyId:a,productType:t}=o;return{onEventReceived:r=>{switch(r){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(t){case"reimbursement":e(le(a,!0,!0));break;case"zeni_accounts":e(pe(a,!0,!0));break;case"charge_cards":e(de(a,!0,!0));break;case"zeni_treasury":e(be(a,!0,!0));break;default:e($(a,!0,!0))}}}}}))(ot((e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:a,isReimbursementAdminLevelAccess:t,isZeniAccountAdminLevelAccess:r,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:c}=e;switch(s){case"bill_pay":switch(c){case"verification":return o?u.jsx(Oe,{productType:s}):a?u.jsx(j,{to:"../"}):u.jsx(N,{});case"international-wire":return o?u.jsx(Ot,{}):a?u.jsx(j,{to:"../"}):u.jsx(N,{});default:return o?u.jsx(pt,{}):a?u.jsx(j,{to:"../"}):u.jsx(N,{})}case"reimbursement":return c==="verification"?t?u.jsx(Oe,{productType:s}):u.jsx(N,{}):t?u.jsx(ht,{}):u.jsx(N,{});case"zeni_accounts":return c==="verification"?r?u.jsx(Oe,{productType:"zeni_accounts"}):u.jsx(N,{}):r?u.jsx(Et,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(vt,{}):u.jsx(N,{});case"charge_cards":return c==="verification"?i?u.jsx(Oe,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(N,{}):i?u.jsx(St,{}):l?u.jsx(j,{to:"../"}):u.jsx(N,{})}})));function oa(e){const{tenantEmailDomain:o}=W(),a=v((r=>F(r))).companyId??E.getSignedInUserTenant(o)?.companyId,t={events:a!=null?[`private-encrypted-${a}.bill-pay-set-up-verification-update`,`private-encrypted-${a}.bill-pay-wise-setup`]:[],eventCallback:(r,n,i)=>{i.onEventReceived(r)}};if(E.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(wt,{...e,companyId:a,...t})}export{na as A,ta as P,oa as S,Yt as a,ea as b,yt as c,ft as d,mt as e,aa as f,qt as g,Gt as h,Xt as i,Qt as j,ia as k,Jt as l,Kt as m,Wt as n,Ht as o,$t as p,sa as s};
29
+ `,Ut=H((function(e,o){const a=F(e),t=E.getSignedInUser(),r=a.tenantId,n={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""};return{internationalOnboardingDetails:Hn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:D}}),(function(e,o){const{navigate:a}=o;return{onFormDataChange:t=>{e(Jn(t))},onSubmitClick:()=>{e(qn(o.companyId))},onCancelClick:()=>{a("../setup")},updateFilesEntity:t=>{e(ae({files:t}))},onDeleteFile:t=>{e(te(t))},onDeleteFileList:t=>{e(Xe(t))},onEditFileName:(t,r)=>{e(ne(t,r.split(".")[0]))}}}))(st),Ot=()=>{const e=Y(),o=Q(),a=ee(),[t,r]=h.useState(!1),[n,i]=h.useState(!1),[l,s]=h.useState(!1),{tenantEmailDomain:c}=G(),p=ie(),{useFeatureGate:g}=me(),{isFeatureEnabled:S}=g(K.isBillPayLocalCurrencyFeatureEnabled),_=v((T=>T.internationalWireVerificationState.verificationFormFetchState.fetchState)),I=v((T=>T.billPaySetupViewState.fetchState)),d=v((T=>F(T))),y=Ee(),f=d.companyId??E.getSignedInUserTenant(c)?.companyId,P=v((T=>Wn(T.companyState,d.companyId))),b=P?.company.companyBillPayInfo.internationalWireOnboardingStatus,m=b?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{t||_!=="Not-Started"||f==null||(r(!0),a(Gn(f)))}),[t,_,f,a]),h.useEffect((()=>{n||I!=="Not-Started"||f==null||(i(!0),a($(f,!0)))}),[I,n,f,a]),E.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const C=d.companyBillPayInfo?.info?.isBillPayTOSAccepted,k=T=>{s(T)};return C===!1?u.jsx(j,{to:"../promo"}):C===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(Dt,{children:[u.jsx(se,{analytics:D,onLoad:T=>(A=>A.trackPageLoaded(W.Event.billPayBusinessVerification,void 0))(T)}),Be(o)?u.jsx(ye,{isAppContentDrawerOpen:l,handleDrawerToggle:k}):null,u.jsx(Ut,{navigate:e,location:o,companyId:f,analytics:D,currentTenant:d,roleMap:p.loggedInUserRoleMap,isFormReadonly:m,isLocalCurrencyEnabled:S})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},wt=H((function(){return{}}),(function(e,o){const{companyId:a,productType:t}=o;return{onEventReceived:r=>{switch(r){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(t){case"reimbursement":e(le(a,!0,!0));break;case"zeni_accounts":e(pe(a,!0,!0));break;case"charge_cards":e(de(a,!0,!0));break;case"zeni_treasury":e(be(a,!0,!0));break;default:e($(a,!0,!0))}}}}}))(ot((e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:a,isReimbursementAdminLevelAccess:t,isZeniAccountAdminLevelAccess:r,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:c}=e;switch(s){case"bill_pay":switch(c){case"verification":return o?u.jsx(Oe,{productType:s}):a?u.jsx(j,{to:"../"}):u.jsx(N,{});case"international-wire":return o?u.jsx(Ot,{}):a?u.jsx(j,{to:"../"}):u.jsx(N,{});default:return o?u.jsx(pt,{}):a?u.jsx(j,{to:"../"}):u.jsx(N,{})}case"reimbursement":return c==="verification"?t?u.jsx(Oe,{productType:s}):u.jsx(N,{}):t?u.jsx(ht,{}):u.jsx(N,{});case"zeni_accounts":return c==="verification"?r?u.jsx(Oe,{productType:"zeni_accounts"}):u.jsx(N,{}):r?u.jsx(Et,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(vt,{}):u.jsx(N,{});case"charge_cards":return c==="verification"?i?u.jsx(Oe,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(N,{}):i?u.jsx(St,{}):l?u.jsx(j,{to:"../"}):u.jsx(N,{})}})));function oa(e){const{tenantEmailDomain:o}=G(),a=v((r=>F(r))).companyId??E.getSignedInUserTenant(o)?.companyId,t={events:a!=null?[`private-encrypted-${a}.bill-pay-set-up-verification-update`,`private-encrypted-${a}.bill-pay-wise-setup`]:[],eventCallback:(r,n,i)=>{i.onEventReceived(r)}};if(E.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(wt,{...e,companyId:a,...t})}export{na as A,ta as P,oa as S,Yt as a,ea as b,yt as c,ft as d,mt as e,aa as f,qt as g,Wt as h,Xt as i,Qt as j,ia as k,Kt as l,Jt as m,Gt as n,Ht as o,$t as p,sa as s};
@@ -0,0 +1 @@
1
+ import{j as u}from"./liveblocks-CIxx6Ub6.js";import{a as f,R as T,q as A}from"./sentry-BCPOyc0G.js";import{u as z,h as D,j as l,g as j,N as F,l as M}from"./core-Caq7Zbsp.js";import{u as P,z as s,E as O,k as w,G as _,T as N,U as B,V,Y as $,Z,_ as v}from"./index-DOXJLxdR.js";import{fF as q,TZ as J,Uh as R,gi as W,gk as G,Um as H,gU as Y,dj as K,Un as b,Uo as Q,Up as X,b$ as U}from"./zeni-epic-state-DROyxOLw.js";import"./mui-DI0hUuFr.js";import{u as ee}from"./useDeviceId-2NJBbYPM.js";import{f as te}from"./analyticsHelper-DHPcRAai.js";import{t as ne}from"./getLocaleForTenant-YgJPw-1W.js";import"./recharts-DKmpCGIA.js";import"./analytics-CiEh1qKr.js";import"./plaid-CXvI7t9H.js";import"./dnd-DwckO6rX.js";import"./stripe-cKAAJElX.js";import"./lottie-CrKh4Q_r.js";import"./lexical-mmp2B1vq.js";import"./pdf-BlhN83fm.js";import"./utils-rX2IEvjD.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="80a202e5-2f17-43b3-bb0e-bc239750d9a6",t._sentryDebugIdIdentifier="sentry-dbid-80a202e5-2f17-43b3-bb0e-bc239750d9a6")}catch{}})();const ie=M((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(X({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Q(n,a)))},clearSignInError:()=>{t(b())}}}))(Z),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=P(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:y,accountUnlockTime:k}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>q(e))),I=l((e=>J(e))),m=j(),E=O().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),f.useEffect((()=>{t(void 0)}),[]),f.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(R(I.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(G(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),Y().then((()=>{const e=$();e!=null&&N(e)})),setTimeout((()=>{w.trackLogin(B.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))}),2e3))}),[S,p,L,o,r,I,E,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(F,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),y===!0&&k!=null?u.jsx(V,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-CIxx6Ub6.js";import{a as i}from"./sentry-BCPOyc0G.js";import{u as c,g as d,N as u}from"./core-Caq7Zbsp.js";import{z as a,k as n,U as m,a8 as p}from"./index-DOXJLxdR.js";import{gX as g,UD as b}from"./zeni-epic-state-DROyxOLw.js";import{n as y}from"./mui-DI0hUuFr.js";import"./recharts-DKmpCGIA.js";import"./analytics-CiEh1qKr.js";import"./plaid-CXvI7t9H.js";import"./dnd-DwckO6rX.js";import"./stripe-cKAAJElX.js";import"./lottie-CrKh4Q_r.js";import"./lexical-mmp2B1vq.js";import"./pdf-BlhN83fm.js";import"./utils-rX2IEvjD.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="3855b89b-a7aa-4b9a-81b1-94b97f636334",t._sentryDebugIdIdentifier="sentry-dbid-3855b89b-a7aa-4b9a-81b1-94b97f636334")}catch{}})();function N(){const t=c(),e=d(),r=i.useRef(!1),f=a.isSignedIn(),o=e.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{t(g()),b(),n.trackLogout(m.Event.logoutSuccess),n.resetUserIdentity(),a.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}}),[o,t]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=y.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${t=>t.theme.colors.grey4};
9
+ `;export{N as default};
@@ -1,4 +1,4 @@
1
- import{j as f}from"./liveblocks-BjcYyeQ6.js";import{a as A}from"./sentry-DZ9rNYfw.js";import{h as pa,u as Ta,g as ga,k as fa,j as v,i as _a,l as ma}from"./core-B-8b0iz9.js";import{z as w,o as Da,S as _,at as Sa,a9 as ya,k as Ea,V as ba,e6 as ha,p as C,a5 as Aa}from"./index-DuxR1XDX.js";import{fF as Ca,a27 as V,R8 as D,a28 as W,a23 as Ga,Qw as O,a29 as Ia,QE as N,Qe as Ba,PS as Ka,R9 as Q,a2a as z,gh as La,Q$ as va,R4 as Ra,QT as wa,QR as Z,R5 as Ua,QO as Pa,a2b as Fa,a2c as ja,a2d as xa,a2e as $a,a2f as m,dx as Oa,dw as Na,a2g as Qa,Qb as za}from"./zeni-epic-state-95zxmizy.js";import{n as Za}from"./mui-C33Oegsm.js";import{u as Ma}from"./useAskAiCfoHostNavButtonProps-CvEN7QS-.js";import{M as Va}from"./MobileAppDrawer-0TaE2Qid.js";import{u as Wa}from"./useTaskManagerPusherEvents-BnGLCsCG.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="d449633c-4b68-4e68-a4e8-8a6b85c7d380",e._sentryDebugIdIdentifier="sentry-dbid-d449633c-4b68-4e68-a4e8-8a6b85c7d380")}catch{}})();const c={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},qa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),Ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),G=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Ja=e=>{if(e==null||typeof e!="object")return null;const a=e,n=typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null;if(n==null||typeof a.tenant_id!="string"||typeof a.event_type!="string")return null;const i={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(i.is_private=a.is_private),G(a.assignees)&&(i.assignees=a.assignees),G(a.direct_assignees)&&(i.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(i.created_by=a.created_by),G(a.task_group_ids)&&(i.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(i.name=a.name),typeof a.parent_task_id=="string"&&(i.parent_task_id=a.parent_task_id),i},Xa=e=>{if(e==null||typeof e!="object")return null;const a=e;return G(a.task_ids)?{task_ids:a.task_ids}:null},ke=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},Ya=Za.div`
1
+ import{j as g}from"./liveblocks-CIxx6Ub6.js";import{a as A}from"./sentry-BCPOyc0G.js";import{h as pa,u as Ta,g as fa,k as ga,j as v,i as _a,l as ma}from"./core-Caq7Zbsp.js";import{z as w,N as Da,f as _,at as Sa,a9 as ba,k as ya,U as Ea,e6 as ha,p as C,a5 as Aa}from"./index-DOXJLxdR.js";import{fF as Ca,a27 as V,R8 as D,a28 as W,a23 as Ga,Qw as N,a29 as Ia,QE as O,Qe as Ba,PS as Ka,R9 as Q,a2a as z,gh as La,Q$ as va,R4 as Ra,QT as wa,QR as Z,R5 as Ua,QO as Pa,a2b as Fa,a2c as ja,a2d as xa,a2e as $a,a2f as m,dx as Na,dw as Oa,a2g as Qa,Qb as za}from"./zeni-epic-state-DROyxOLw.js";import{n as Za}from"./mui-DI0hUuFr.js";import{u as Ma}from"./useAskAiCfoHostNavButtonProps-BvhP40c_.js";import{M as Va}from"./MobileAppDrawer-DqgtjBKX.js";import{u as Wa}from"./useTaskManagerPusherEvents-D5Hm7um3.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="7d7bb1f0-6c1f-4bf0-8ead-36a5d4733ced",e._sentryDebugIdIdentifier="sentry-dbid-7d7bb1f0-6c1f-4bf0-8ead-36a5d4733ced")}catch{}})();const c={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},qa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),Ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),G=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Ja=e=>{if(e==null||typeof e!="object")return null;const a=e,n=typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null;if(n==null||typeof a.tenant_id!="string"||typeof a.event_type!="string")return null;const i={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(i.is_private=a.is_private),G(a.assignees)&&(i.assignees=a.assignees),G(a.direct_assignees)&&(i.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(i.created_by=a.created_by),G(a.task_group_ids)&&(i.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(i.name=a.name),typeof a.parent_task_id=="string"&&(i.parent_task_id=a.parent_task_id),i},Xa=e=>{if(e==null||typeof e!="object")return null;const a=e;return G(a.task_ids)?{task_ids:a.task_ids}:null},ke=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},Ya=Za.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as f}from"./liveblocks-BjcYyeQ6.js";import{a as A}from"./sentry-DZ9rNYf
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ae=ma((function(e,a){const n=V(e,a.isTaskTemplatesEnabled),{taskGroupId:i}=a,r=i!=null&&i!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((t=>({...t,tasks:t.tasks.filter((s=>s.taskGroupIds.includes(i)))}))).filter((t=>t.tasks.length>0))}:n,T=Ga(e),l=w.isZeniUser(),S=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:r,tagListView:T,localData:r.localData,isTaskTemplatesEnabled:a.isTaskTemplatesEnabled,isZeniUser:l,subTaskCreateStatus:S}}),(function(e,a){const{navigate:n,currentTenant:i,location:r,isTaskTemplatesEnabled:T}=a,{tenantEmailDomain:l}=i,{groupByKey:S}=a.uiState;return{onTaskManagementRowClick:t=>{const s=M(l,t),k=C(r.state?.pathnameStackToGoBack,r.pathname);n(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(D(!0,T))},onTabChange:t=>{e($a(t))},onParentTaskClick:t=>{const s=M(l,t);window.open(s,"_blank","noopener")},bulkUpdateTasks:(t,s)=>{e(Z(t,null,s))},onNewTaskClick:()=>{if(a.localData.defaultTaskGroupId!=null){const t=R(l,a.localData.defaultTaskGroupId),s=C(r.state?.pathnameStackToGoBack,r.pathname);n(t,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(t,s)=>{e(z({uiState:{sortKey:t,sortOrder:s}}))},onFiltersChange:t=>{e(xa({filters:t}))},onSearchTextChanged:t=>{e(ja({searchText:t}))},onReloadCards:()=>{e(D(!0,T))},onBackClick:()=>{if(r.state?.message==="triggerBackClick"){const t=Aa(r.state?.pathnameStackToGoBack),s=t.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:t.newStack}})}else n("../")},updateLocalData:t=>{e(Fa({localData:t}))},resetLocalData:()=>{e(W({taskGroupById:a.taskGroupState.taskGroupById}))},handleCreateGroup:t=>{e(Pa(a.localData.newTaskGroupName,t))},assignGroupToTasks:t=>{e(Z(a.localData.selectedTaskIds,t,Ua(a.uiState.groupByKey,t)))},onDeleteTaskGroup:t=>{e(wa(t))},onAddNewTaskToTaskGroup:t=>{if(a.localData.defaultTaskGroupId!=null){const s=te(S,t);e(O({taskDetailLocalData:s}));const k=R(l,a.uiState.groupByKey==="groupName"?t:a.localData.defaultTaskGroupId),I=C(r.state?.pathnameStackToGoBack,r.pathname);n(k,{state:{pathnameStackToGoBack:I,message:"comingFromTaskListPage"}})}},onDragNDrop:(t,s)=>{e(Ra(a.localData.selectedTaskIds.length>0?a.localData.selectedTaskIds:[t],s))},onTaskGroupRename:(t,s)=>{e(va(t,s))},onTimeSpentUpdate:(t,s)=>{e(Q({task:t,updates:s}))},onShowToast:t=>{e(La(t))},onGroupByFilterChange:t=>{e(z({uiState:{groupByKey:t}}))},updateTask:(t,s)=>{e(Q({task:t,updates:s}))},onCreateTagClick:(t,s)=>{e(Ka(t,s))},onSubtaskCreation:(t,s)=>{e(Ba({...s,parentTaskId:t}))},handleGroupTemplateClick:t=>{e(N(t,[]))},handleGroupTemplateTaskClick:(t,s)=>{e(N(t,[s]))},handleNewTaskInitialization:t=>{if(e(O({taskDetailLocalData:{...Ia,name:t}})),a.localData.defaultTaskGroupId!=null){const s=R(l,a.localData.defaultTaskGroupId),k=C(r.state?.pathnameStackToGoBack,r.pathname);n(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:t=>{n(`/${l}/tasks/group/${t}`)},onQuickResponsesClick:()=>{n(`/${l}/tasks/quick-responses`)}}}))(ha);function ee(){const e=pa(),a=Ta(),n=ga(),i=w.getSignedInUser(),r=w.isZeniUser(),T=fa(),l=v((u=>Ca(u))),{taskGroupId:S}=_a(),{useFeatureGate:t}=Da(),{isFeatureEnabled:s}=t(_.isTaskTemplatesEnabled),{isFeatureEnabled:k}=t(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:I}=t(_.isTaskCategorizationEnabled),{isFeatureEnabled:q}=t(_.isTaskBulkResolutionEnabled),{isFeatureEnabled:H}=t(_.isTaskGroupAssigneesEnabled),{isFeatureEnabled:J}=t(_.isTaskRecurringParentEnabled),[X,Y]=A.useState(!1),B=v((u=>V(u,s))),K=v((u=>u.taskGroupState)),y=B.fetchState,{isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea}=Ma({mobileExploreReferrer:"Task Checklist"});Sa({isDataReady:y==="Completed"}),A.useEffect((()=>{a(D(!1,s))}),[l?.tenantId,a,s]);const ta=A.useMemo((()=>{const u=[c.TASK_CREATED,c.TASK_UPDATED,c.TASKS_BULK_UPDATED,c.TASKS_BULK_DELETED],g=[c.TASK_CREATED,c.TASK_UPDATED,c.TASK_SNOOZE_RESURFACED,c.TASKS_BULK_UPDATED];return[...qa(l?.companyId,u),...Ha(i?.userId,g)]}),[l?.companyId,i?.userId]);if(Wa({events:ta,onEvent:(u,g)=>{switch(u){case c.TASK_CREATED:case c.TASK_UPDATED:{const o=Ja(g);if(o!=null){const h=T.getState(),U=o.task_id,p=U!=null?h.taskState.taskByID?.[U]:void 0,L=p!=null;if(!r)if(o.is_private===!0){if(!L)return}else{const E=i?.userId,b=new Set([...o.assignees??[],...o.direct_assignees??[]]);if(o.created_by!=null&&o.created_by!==""&&b.add(o.created_by),!(E!=null&&b.has(E))&&!L)return}if(u===c.TASK_UPDATED&&L&&p!=null&&Array.isArray(o.task_group_ids)){const E=new Set(Object.values(h.taskGroupState.taskGroupById??{}).filter((d=>d!=null&&!d.isDeleted)).map((d=>d.id))),b=(p.taskGroupIds??[]).filter((d=>E.has(d))),P=(o.task_group_ids??[]).filter((d=>E.has(d))),sa=b.length===P.length&&b.every((d=>P.includes(d))),F=p.taskGroupIds??[],j=o.task_group_ids??[],na=F.length!==j.length||!F.every((d=>j.includes(d))),oa=(d,da)=>{const x=d??[],$=da??[];if(x.length!==$.length)return!1;const ca=new Set($);return x.every((ka=>ca.has(ka)))},ia=o.name==null||o.name===p.name,ra=o.is_private==null||o.is_private===p.isPrivate,la=o.assignees==null||oa(o.assignees,p.assignees),ua=o.direct_assignees==null;if(sa&&na&&ia&&ra&&la&&ua)return}}return void a(D(!0,s))}case c.TASKS_BULK_DELETED:{const o=Xa(g);return o==null?void 0:void o.task_ids.forEach((h=>a(za(h))))}case c.TASKS_BULK_UPDATED:case c.TASK_SNOOZE_RESURFACED:return void a(D(!0,s))}},onSubscribed:()=>{a(D(!0,s))}}),A.useEffect((()=>{y==="Completed"&&a(W({taskGroupById:K.taskGroupById}))}),[y,K.taskGroupById]),i==null)throw Error("Can't access task list page without signing in...");return f.jsxs(f.Fragment,{children:[y==="Completed"?f.jsx(ya,{analytics:Ea,onLoad:u=>(g=>g.trackPageLoaded(ba.Event.taskListPage))(u)}):null,f.jsxs(Ya,{children:[f.jsx(Va,{isAppContentDrawerOpen:X,handleDrawerToggle:u=>{Y(u)}}),f.jsx(ae,{location:n,navigate:e,currentTenant:l,taskGroupId:S,taskGroupState:K,localData:B.localData,uiState:B.uiState,isTaskTemplatesEnabled:s,taskListFetchState:y,isTaskCategorizationEnabled:I,isTaskCannedResponsesEnabled:k,isTaskBulkResolutionEnabled:q,isTaskGroupAssigneesEnabled:H,isTaskRecurringParentEnabled:J,isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea})]})]})}const M=(e,a)=>`/${e}/tasks/${encodeURIComponent(a)}`,R=(e,a)=>`/${e}/tasks/new/${a}`,te=(e,a)=>{if(e==="assignee"){const n=a.split(",");return{...m.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Oa(a);return{...m.taskDetailLocalData,priority:n}}if(e==="status"){const n=Na(a);return{...m.taskDetailLocalData,status:n}}if(e==="tag"){const n=a.split(",");return{...m.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=Qa(a);return{...m.taskDetailLocalData,dueDate:n}}return{...m.taskDetailLocalData}},pe=Object.freeze(Object.defineProperty({__proto__:null,default:ee},Symbol.toStringTag,{value:"Module"}));export{c as T,Ha as a,qa as b,Xa as c,Ja as d,ee as e,pe as f,ke as t};
9
+ `,ae=ma((function(e,a){const n=V(e,a.isTaskTemplatesEnabled),{taskGroupId:i}=a,r=i!=null&&i!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((t=>({...t,tasks:t.tasks.filter((s=>s.taskGroupIds.includes(i)))}))).filter((t=>t.tasks.length>0))}:n,T=Ga(e),l=w.isZeniUser(),S=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:r,tagListView:T,localData:r.localData,isTaskTemplatesEnabled:a.isTaskTemplatesEnabled,isZeniUser:l,subTaskCreateStatus:S}}),(function(e,a){const{navigate:n,currentTenant:i,location:r,isTaskTemplatesEnabled:T}=a,{tenantEmailDomain:l}=i,{groupByKey:S}=a.uiState;return{onTaskManagementRowClick:t=>{const s=M(l,t),k=C(r.state?.pathnameStackToGoBack,r.pathname);n(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(D(!0,T))},onTabChange:t=>{e($a(t))},onParentTaskClick:t=>{const s=M(l,t);window.open(s,"_blank","noopener")},bulkUpdateTasks:(t,s)=>{e(Z(t,null,s))},onNewTaskClick:()=>{if(a.localData.defaultTaskGroupId!=null){const t=R(l,a.localData.defaultTaskGroupId),s=C(r.state?.pathnameStackToGoBack,r.pathname);n(t,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(t,s)=>{e(z({uiState:{sortKey:t,sortOrder:s}}))},onFiltersChange:t=>{e(xa({filters:t}))},onSearchTextChanged:t=>{e(ja({searchText:t}))},onReloadCards:()=>{e(D(!0,T))},onBackClick:()=>{if(r.state?.message==="triggerBackClick"){const t=Aa(r.state?.pathnameStackToGoBack),s=t.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:t.newStack}})}else n("../")},updateLocalData:t=>{e(Fa({localData:t}))},resetLocalData:()=>{e(W({taskGroupById:a.taskGroupState.taskGroupById}))},handleCreateGroup:t=>{e(Pa(a.localData.newTaskGroupName,t))},assignGroupToTasks:t=>{e(Z(a.localData.selectedTaskIds,t,Ua(a.uiState.groupByKey,t)))},onDeleteTaskGroup:t=>{e(wa(t))},onAddNewTaskToTaskGroup:t=>{if(a.localData.defaultTaskGroupId!=null){const s=te(S,t);e(N({taskDetailLocalData:s}));const k=R(l,a.uiState.groupByKey==="groupName"?t:a.localData.defaultTaskGroupId),I=C(r.state?.pathnameStackToGoBack,r.pathname);n(k,{state:{pathnameStackToGoBack:I,message:"comingFromTaskListPage"}})}},onDragNDrop:(t,s)=>{e(Ra(a.localData.selectedTaskIds.length>0?a.localData.selectedTaskIds:[t],s))},onTaskGroupRename:(t,s)=>{e(va(t,s))},onTimeSpentUpdate:(t,s)=>{e(Q({task:t,updates:s}))},onShowToast:t=>{e(La(t))},onGroupByFilterChange:t=>{e(z({uiState:{groupByKey:t}}))},updateTask:(t,s)=>{e(Q({task:t,updates:s}))},onCreateTagClick:(t,s)=>{e(Ka(t,s))},onSubtaskCreation:(t,s)=>{e(Ba({...s,parentTaskId:t}))},handleGroupTemplateClick:t=>{e(O(t,[]))},handleGroupTemplateTaskClick:(t,s)=>{e(O(t,[s]))},handleNewTaskInitialization:t=>{if(e(N({taskDetailLocalData:{...Ia,name:t}})),a.localData.defaultTaskGroupId!=null){const s=R(l,a.localData.defaultTaskGroupId),k=C(r.state?.pathnameStackToGoBack,r.pathname);n(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:t=>{n(`/${l}/tasks/group/${t}`)},onQuickResponsesClick:()=>{n(`/${l}/tasks/quick-responses`)}}}))(ha);function ee(){const e=pa(),a=Ta(),n=fa(),i=w.getSignedInUser(),r=w.isZeniUser(),T=ga(),l=v((u=>Ca(u))),{taskGroupId:S}=_a(),{useFeatureGate:t}=Da(),{isFeatureEnabled:s}=t(_.isTaskTemplatesEnabled),{isFeatureEnabled:k}=t(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:I}=t(_.isTaskCategorizationEnabled),{isFeatureEnabled:q}=t(_.isTaskBulkResolutionEnabled),{isFeatureEnabled:H}=t(_.isTaskGroupAssigneesEnabled),{isFeatureEnabled:J}=t(_.isTaskRecurringParentEnabled),[X,Y]=A.useState(!1),B=v((u=>V(u,s))),K=v((u=>u.taskGroupState)),b=B.fetchState,{isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea}=Ma({mobileExploreReferrer:"Task Checklist"});Sa({isDataReady:b==="Completed"}),A.useEffect((()=>{a(D(!1,s))}),[l?.tenantId,a,s]);const ta=A.useMemo((()=>{const u=[c.TASK_CREATED,c.TASK_UPDATED,c.TASKS_BULK_UPDATED,c.TASKS_BULK_DELETED],f=[c.TASK_CREATED,c.TASK_UPDATED,c.TASK_SNOOZE_RESURFACED,c.TASKS_BULK_UPDATED];return[...qa(l?.companyId,u),...Ha(i?.userId,f)]}),[l?.companyId,i?.userId]);if(Wa({events:ta,onEvent:(u,f)=>{switch(u){case c.TASK_CREATED:case c.TASK_UPDATED:{const o=Ja(f);if(o!=null){const h=T.getState(),U=o.task_id,p=U!=null?h.taskState.taskByID?.[U]:void 0,L=p!=null;if(!r)if(o.is_private===!0){if(!L)return}else{const y=i?.userId,E=new Set([...o.assignees??[],...o.direct_assignees??[]]);if(o.created_by!=null&&o.created_by!==""&&E.add(o.created_by),!(y!=null&&E.has(y))&&!L)return}if(u===c.TASK_UPDATED&&L&&p!=null&&Array.isArray(o.task_group_ids)){const y=new Set(Object.values(h.taskGroupState.taskGroupById??{}).filter((d=>d!=null&&!d.isDeleted)).map((d=>d.id))),E=(p.taskGroupIds??[]).filter((d=>y.has(d))),P=(o.task_group_ids??[]).filter((d=>y.has(d))),sa=E.length===P.length&&E.every((d=>P.includes(d))),F=p.taskGroupIds??[],j=o.task_group_ids??[],na=F.length!==j.length||!F.every((d=>j.includes(d))),oa=(d,da)=>{const x=d??[],$=da??[];if(x.length!==$.length)return!1;const ca=new Set($);return x.every((ka=>ca.has(ka)))},ia=o.name==null||o.name===p.name,ra=o.is_private==null||o.is_private===p.isPrivate,la=o.assignees==null||oa(o.assignees,p.assignees),ua=o.direct_assignees==null;if(sa&&na&&ia&&ra&&la&&ua)return}}return void a(D(!0,s))}case c.TASKS_BULK_DELETED:{const o=Xa(f);return o==null?void 0:void o.task_ids.forEach((h=>a(za(h))))}case c.TASKS_BULK_UPDATED:case c.TASK_SNOOZE_RESURFACED:return void a(D(!0,s))}},onSubscribed:()=>{a(D(!0,s))}}),A.useEffect((()=>{b==="Completed"&&a(W({taskGroupById:K.taskGroupById}))}),[b,K.taskGroupById]),i==null)throw Error("Can't access task list page without signing in...");return g.jsxs(g.Fragment,{children:[b==="Completed"?g.jsx(ba,{analytics:ya,onLoad:u=>(f=>f.trackPageLoaded(Ea.Event.taskListPage))(u)}):null,g.jsxs(Ya,{children:[g.jsx(Va,{isAppContentDrawerOpen:X,handleDrawerToggle:u=>{Y(u)}}),g.jsx(ae,{location:n,navigate:e,currentTenant:l,taskGroupId:S,taskGroupState:K,localData:B.localData,uiState:B.uiState,isTaskTemplatesEnabled:s,taskListFetchState:b,isTaskCategorizationEnabled:I,isTaskCannedResponsesEnabled:k,isTaskBulkResolutionEnabled:q,isTaskGroupAssigneesEnabled:H,isTaskRecurringParentEnabled:J,isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea})]})]})}const M=(e,a)=>`/${e}/tasks/${encodeURIComponent(a)}`,R=(e,a)=>`/${e}/tasks/new/${a}`,te=(e,a)=>{if(e==="assignee"){const n=a.split(",");return{...m.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Na(a);return{...m.taskDetailLocalData,priority:n}}if(e==="status"){const n=Oa(a);return{...m.taskDetailLocalData,status:n}}if(e==="tag"){const n=a.split(",");return{...m.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=Qa(a);return{...m.taskDetailLocalData,dueDate:n}}return{...m.taskDetailLocalData}},pe=Object.freeze(Object.defineProperty({__proto__:null,default:ee},Symbol.toStringTag,{value:"Module"}));export{c as T,Ha as a,qa as b,Xa as c,Ja as d,ee as e,pe as f,ke as t};
@@ -1,4 +1,4 @@
1
- import{j as r}from"./liveblocks-BjcYyeQ6.js";import ue from"./NotFoundScreen-BatgS8le.js";import{a as k}from"./sentry-DZ9rNYfw.js";import{h as H,u as ee,j as b,g as de,i as ke,N as pe,l as me,n as Se,o as E}from"./core-B-8b0iz9.js";import{Q3 as ae,Q6 as fe,Q0 as Te,a22 as ge,fF as te,a23 as se,Qs as g,Qk as T,PZ as he,QY as Ee,QR as be,a24 as ne,gh as oe,a25 as Z,PV as Ie,PS as De,uX as Ce,uL as Ge,mz as _e,Qi as Re,a26 as ye,R9 as Ue,Qe as xe,QD as we,QA as Be,Q9 as Ae,Qx as ve,Qw as je}from"./zeni-epic-state-95zxmizy.js";import{z as R,e4 as Pe,O as Fe,o as Le,S as G,a5 as ie,p as _,a9 as Ke,k as q,V as Qe,e5 as $e,_ as M,af as Ne}from"./index-DuxR1XDX.js";import{n as Oe}from"./mui-C33Oegsm.js";import{u as Ve}from"./useInitialThreadRequest-Chu-ipGI.js";import{M as ze}from"./MobileAppDrawer-0TaE2Qid.js";import{b as Ze,a as qe,T as f,t as Me,c as X,d as Y,e as Xe}from"./TaskListScreen-h6ryhshy.js";import{u as Ye}from"./useTaskManagerPusherEvents-BnGLCsCG.js";import"./recharts-DkYxIsLi.js";import"./analytics-8lQ_GaR7.js";import"./plaid-Bt28AVCt.js";import"./dnd-CtOxA7uX.js";import"./stripe-cKAAJElX.js";import"./lottie-BdAYiWcR.js";import"./lexical-BVt4M34U.js";import"./pdf-BkfulyEw.js";import"./utils-D3rZq_G4.js";import"./InboxNotificationsProvider-B4UF_uUg.js";import"./useTaskManagerAccess-ECD0Ec-b.js";import"./useAskAiCfoHostNavButtonProps-CvEN7QS-.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="211a075a-5166-4163-9b44-c153de699186",e._sentryDebugIdIdentifier="sentry-dbid-211a075a-5166-4163-9b44-c153de699186")}catch{}})();function Je(){const e=H(),a=ee(),n=R.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:u}=b((o=>o.cannedResponsesState)),d=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,I,D)=>{a(fe({name:o,content:I,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(Te({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(Pe,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:u==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:m})}const L=e=>e?.taskState?.taskByID,P=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},We=ge([P,(e,a)=>{const n=P(e,a),c=L(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=P(e,a),c=L(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let J,W=[];const He=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),u=te(e),d=We(e,a.taskId),m=s.taskGroupId??c,t=m!=null?Z(e.taskGroupState,m):void 0,o=R.getSignedInUser(),I=u.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:I??""},w=se(e),{tenantEmailDomain:B}=u,y=s.recurringSourceTaskId,A=y!=null?`${M.appUrl}/${B}/tasks/${encodeURIComponent(y)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:R.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==J&&(J=h,W=Object.values(h)),W),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Ne.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${M.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:A,tagListView:w,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>Z(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:u,taskGroupId:d}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(je({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(ve(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(Ae(a.taskId))},onSnoozeTask:(t,o)=>{e(Be(t,o))},onUnsnoozeTask:t=>{e(we(t))},onCreateSubtask:(t,o)=>{e(xe({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(Ue({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(u.state?.pathnameStackToGoBack,u.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(u.state?.pathnameStackToGoBack,u.pathname)}})},onDismissClick:()=>{if(u.state?.message==="triggerBackClick"){const t=ie(u.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=x(m),o=_(u.state?.pathnameStackToGoBack,u.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(ye({taskId:n}))},onDeleteTaskClick:()=>{e(Re(n))},updateFilesEntity:t=>{e(_e({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(g(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ie(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))($e);function F(){const e=H(),a=ee(),n=de(),c=Fe(),{taskId:s,taskGroupId:u}=ke(),d=b((i=>te(i))),m=Ve(d?.companyId),{useFeatureGate:t}=Le(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:I}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:w}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:B}=t(G.isTaskGroupAssigneesEnabled),[y,A]=k.useState(!1),[h,S]=k.useState(!1),[K,re]=k.useState(!1),[Q,v]=k.useState(!1),C=k.useRef(!1),U=b((i=>i.taskListState.updateTasksFetchState.fetchState)),$=b((i=>se(i))),N=b((i=>i.taskGroupViewState.fetchState));k.useEffect((()=>{a(g(!1,s)),s!=null&&a(T(s))}),[a,s]);const O=R.getSignedInUser()?.userId,ce=k.useMemo((()=>{const i=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],l=[...i,f.TASK_SNOOZE_RESURFACED];return[...Ze(d?.companyId,i),...qe(O,l)]}),[d?.companyId,O]);Ye({events:ce,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(i,l)=>{if(s!=null)switch(i){case f.TASK_CREATED:{Y(l)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=Y(l);if(p==null)break;p.task_id===s?(a(g(!0,s)),a(T(s))):p.parent_task_id===s&&a(T(s));break}case f.TASKS_BULK_UPDATED:{const p=X(l);if(p==null)break;p.task_ids.includes(s)&&a(g(!0,s)),a(T(s));break}case f.TASKS_BULK_DELETED:{const p=X(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),d?.tenantEmailDomain!=null&&e(x(d.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{Me(l)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||$.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,$.fetchState]),k.useEffect((()=>{K||N==="Completed"||(re(!0),a(Ee()))}),[K,a,N]);const le=k.useCallback((()=>{s!=null&&(C.current=!1,a(be([s],null,{isArchived:!1})),v(!0))}),[a,s]);k.useEffect((()=>{if(Q)if(U!=="In-Progress"){if(C.current){if(U==="Error")return v(!1),void(C.current=!1);if(U==="Completed"){v(!1),C.current=!1;const{tenantEmailDomain:i}=d;if(n.state?.message==="triggerBackClick"){const l=ie(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=x(i);e(l,{state:{pathnameStackToGoBack:_(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[Q,U,d,n,e]);const V=b((i=>ne(i,s))),j=V.fetchState,z=R.getSignedInUser();if(z==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&V.error?.code===400){const{tenantEmailDomain:i}=d,l=x(i),p=_(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[j==="Completed"?r.jsx(Ke,{analytics:q,onLoad:i=>(l=>l.trackPageLoaded(Qe.Event.taskDetailPage))(i)}):null,r.jsxs(ea,{children:[r.jsx(ze,{isAppContentDrawerOpen:y,handleDrawerToggle:i=>{A(i)}}),r.jsx(He,{analytics:q,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:z,navigate:e,taskGroupId:u,taskId:s,taskDetailFetchState:j,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:w,isTaskGroupAssigneesEnabled:B})]})]})}const ea=Oe.div`
1
+ import{j as r}from"./liveblocks-CIxx6Ub6.js";import ue from"./NotFoundScreen-C2GrPpNy.js";import{a as k}from"./sentry-BCPOyc0G.js";import{h as H,u as ee,j as b,g as de,i as ke,N as pe,l as me,n as Se,o as E}from"./core-Caq7Zbsp.js";import{Q3 as ae,Q6 as fe,Q0 as Te,a22 as ge,fF as te,a23 as se,Qs as g,Qk as T,PZ as he,QY as Ee,QR as be,a24 as ne,gh as oe,a25 as Z,PV as Ie,PS as De,uX as Ce,uL as Ge,mz as _e,Qi as Re,a26 as Ue,R9 as ye,Qe as xe,QD as we,QA as Be,Q9 as Ae,Qx as ve,Qw as je}from"./zeni-epic-state-DROyxOLw.js";import{z as R,e4 as Pe,F as Fe,N as Le,f as G,a5 as ie,p as _,a9 as Ke,k as q,U as Qe,e5 as $e,_ as M,af as Ne}from"./index-DOXJLxdR.js";import{n as ze}from"./mui-DI0hUuFr.js";import{u as Oe}from"./useInitialThreadRequest-uu8NipM7.js";import{M as Ve}from"./MobileAppDrawer-DqgtjBKX.js";import{b as Ze,a as qe,T as f,t as Me,c as X,d as Y,e as Xe}from"./TaskListScreen-DQj6h_q_.js";import{u as Ye}from"./useTaskManagerPusherEvents-D5Hm7um3.js";import"./recharts-DKmpCGIA.js";import"./analytics-CiEh1qKr.js";import"./plaid-CXvI7t9H.js";import"./dnd-DwckO6rX.js";import"./stripe-cKAAJElX.js";import"./lottie-CrKh4Q_r.js";import"./lexical-mmp2B1vq.js";import"./pdf-BlhN83fm.js";import"./utils-rX2IEvjD.js";import"./InboxNotificationsProvider-DcarX1j5.js";import"./useTaskManagerAccess-DxrmaJfc.js";import"./useAskAiCfoHostNavButtonProps-BvhP40c_.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="c76262f0-b4ce-45ec-a800-3aa42f97c1d9",e._sentryDebugIdIdentifier="sentry-dbid-c76262f0-b4ce-45ec-a800-3aa42f97c1d9")}catch{}})();function Je(){const e=H(),a=ee(),n=R.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:u}=b((o=>o.cannedResponsesState)),d=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,I,D)=>{a(fe({name:o,content:I,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(Te({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(Pe,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:u==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:m})}const L=e=>e?.taskState?.taskByID,P=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},We=ge([P,(e,a)=>{const n=P(e,a),c=L(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=P(e,a),c=L(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let J,W=[];const He=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),u=te(e),d=We(e,a.taskId),m=s.taskGroupId??c,t=m!=null?Z(e.taskGroupState,m):void 0,o=R.getSignedInUser(),I=u.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:I??""},w=se(e),{tenantEmailDomain:B}=u,U=s.recurringSourceTaskId,A=U!=null?`${M.appUrl}/${B}/tasks/${encodeURIComponent(U)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:R.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==J&&(J=h,W=Object.values(h)),W),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Ne.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${M.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:A,tagListView:w,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>Z(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:u,taskGroupId:d}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(je({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(ve(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(Ae(a.taskId))},onSnoozeTask:(t,o)=>{e(Be(t,o))},onUnsnoozeTask:t=>{e(we(t))},onCreateSubtask:(t,o)=>{e(xe({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(ye({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(u.state?.pathnameStackToGoBack,u.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(u.state?.pathnameStackToGoBack,u.pathname)}})},onDismissClick:()=>{if(u.state?.message==="triggerBackClick"){const t=ie(u.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=x(m),o=_(u.state?.pathnameStackToGoBack,u.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(Ue({taskId:n}))},onDeleteTaskClick:()=>{e(Re(n))},updateFilesEntity:t=>{e(_e({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(g(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ie(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))($e);function F(){const e=H(),a=ee(),n=de(),c=Fe(),{taskId:s,taskGroupId:u}=ke(),d=b((i=>te(i))),m=Oe(d?.companyId),{useFeatureGate:t}=Le(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:I}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:w}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:B}=t(G.isTaskGroupAssigneesEnabled),[U,A]=k.useState(!1),[h,S]=k.useState(!1),[K,re]=k.useState(!1),[Q,v]=k.useState(!1),C=k.useRef(!1),y=b((i=>i.taskListState.updateTasksFetchState.fetchState)),$=b((i=>se(i))),N=b((i=>i.taskGroupViewState.fetchState));k.useEffect((()=>{a(g(!1,s)),s!=null&&a(T(s))}),[a,s]);const z=R.getSignedInUser()?.userId,ce=k.useMemo((()=>{const i=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],l=[...i,f.TASK_SNOOZE_RESURFACED];return[...Ze(d?.companyId,i),...qe(z,l)]}),[d?.companyId,z]);Ye({events:ce,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(i,l)=>{if(s!=null)switch(i){case f.TASK_CREATED:{Y(l)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=Y(l);if(p==null)break;p.task_id===s?(a(g(!0,s)),a(T(s))):p.parent_task_id===s&&a(T(s));break}case f.TASKS_BULK_UPDATED:{const p=X(l);if(p==null)break;p.task_ids.includes(s)&&a(g(!0,s)),a(T(s));break}case f.TASKS_BULK_DELETED:{const p=X(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),d?.tenantEmailDomain!=null&&e(x(d.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{Me(l)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||$.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,$.fetchState]),k.useEffect((()=>{K||N==="Completed"||(re(!0),a(Ee()))}),[K,a,N]);const le=k.useCallback((()=>{s!=null&&(C.current=!1,a(be([s],null,{isArchived:!1})),v(!0))}),[a,s]);k.useEffect((()=>{if(Q)if(y!=="In-Progress"){if(C.current){if(y==="Error")return v(!1),void(C.current=!1);if(y==="Completed"){v(!1),C.current=!1;const{tenantEmailDomain:i}=d;if(n.state?.message==="triggerBackClick"){const l=ie(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=x(i);e(l,{state:{pathnameStackToGoBack:_(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[Q,y,d,n,e]);const O=b((i=>ne(i,s))),j=O.fetchState,V=R.getSignedInUser();if(V==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&O.error?.code===400){const{tenantEmailDomain:i}=d,l=x(i),p=_(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[j==="Completed"?r.jsx(Ke,{analytics:q,onLoad:i=>(l=>l.trackPageLoaded(Qe.Event.taskDetailPage))(i)}):null,r.jsxs(ea,{children:[r.jsx(Ve,{isAppContentDrawerOpen:U,handleDrawerToggle:i=>{A(i)}}),r.jsx(He,{analytics:q,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:V,navigate:e,taskGroupId:u,taskId:s,taskDetailFetchState:j,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:w,isTaskGroupAssigneesEnabled:B})]})]})}const ea=ze.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-CIxx6Ub6.js";import i from"./NotFoundScreen-C2GrPpNy.js";import{T as r}from"./TransactionDetailScreen-fc6wRDCa.js";import"./sentry-BCPOyc0G.js";import{n as a,o as e}from"./core-Caq7Zbsp.js";import"./zeni-epic-state-DROyxOLw.js";import"./recharts-DKmpCGIA.js";import"./index-DOXJLxdR.js";import"./mui-DI0hUuFr.js";import"./analytics-CiEh1qKr.js";import"./plaid-CXvI7t9H.js";import"./dnd-DwckO6rX.js";import"./stripe-cKAAJElX.js";import"./lottie-CrKh4Q_r.js";import"./lexical-mmp2B1vq.js";import"./pdf-BlhN83fm.js";import"./utils-rX2IEvjD.js";import"./useAskAiCfoHostNavButtonProps-BvhP40c_.js";import"./decodeURIComponentSafe-DmjyT4t5.js";import"./useInitialThreadRequest-uu8NipM7.js";import"./routePaths-C1OqXYGB.js";import"./expenseAutomationHelper-B83Qa5Jl.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="bfd19369-9f5a-4875-9ff9-f0a50fe2624d",o._sentryDebugIdIdentifier="sentry-dbid-bfd19369-9f5a-4875-9ff9-f0a50fe2624d")}catch{}})();function z(){return t.jsxs(a,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
@@ -0,0 +1,5 @@
1
+ import{j as R}from"./liveblocks-CIxx6Ub6.js";import{a as i}from"./sentry-BCPOyc0G.js";import{u as M,k as ot,j as g,s as ge,g as De,h as Ce,i as Ae,N as st,l as ct}from"./core-Caq7Zbsp.js";import{pv as Ie,fF as Z,gV as it,UK as rt,oB as lt,ob as dt,DF as se,WY as ut,gh as mt,bn as pt,df as Re,bq as _e,sS as q,VQ as H,WZ as we,W_ as le,We as Pe,ma as Fe,W$ as Ue,Wj as de,Wk as ue,m$ as xe,Sf as me,WU as W,m4 as Ve,m2 as Le,me as ft,pi as ht,X0 as St,X1 as yt,Dw as K,m9 as Be,RA as Oe,cm as Tt,dl as bt,X2 as gt,WT as It,X3 as vt,X4 as kt,X5 as Et,X6 as Dt,Ds as Ct,X7 as At,X8 as Rt,X9 as _t,Xa as wt,Xb as Pt,md as Ft,Xc as Ut,Xd as xt,WV as Vt,Xe as Lt,Xf as Bt,Xg as Ot,Ru as Nt,Rk as zt,RJ as jt,mf as Mt,Sg as ve,pn as Gt}from"./zeni-epic-state-DROyxOLw.js";import{N as Y,f as w,k as X,b3 as Wt,z as Ne,E as Xt,a2 as $t,b4 as qt,ac as Ht,a5 as ce,W as Yt,b5 as Jt,p as ie,at as Kt,b6 as Qt,b7 as Zt,b8 as en,af as tn,aw as oe}from"./index-DOXJLxdR.js";import{n as nn,S as an,D as on}from"./mui-DI0hUuFr.js";import{u as sn}from"./useAskAiCfoHostNavButtonProps-BvhP40c_.js";import{d as ze}from"./decodeURIComponentSafe-DmjyT4t5.js";import{u as cn}from"./useInitialThreadRequest-uu8NipM7.js";import{h as je,c as Me,g as rn,e as ln}from"./routePaths-C1OqXYGB.js";import{u as dn}from"./expenseAutomationHelper-B83Qa5Jl.js";import{A as un}from"./utils-rX2IEvjD.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="0f8b7973-17ef-44ec-a77d-1f5e955835d4",t._sentryDebugIdIdentifier="sentry-dbid-0f8b7973-17ef-44ec-a77d-1f5e955835d4")}catch{}})();function mn(t=!0){const e=M(),o=ot(),{useFeatureGate:n}=Y(),{isFeatureEnabled:a}=n(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||a!==!0)return;const s=c=>{const d=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return d!=="In-Progress"&&d!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[t,a,e,o])}function pn(t,e){const o=(function(){const d=M(),[y,h]=i.useState(!1),[D,p]=i.useState(null),[l,u]=i.useState(null),{useDynamicConfig:S}=Y(),{configValue:v,isDynamicConfigLoading:f}=S("transaction_categorization_config"),T=!f&&v?.capitalization_enabled===!0,E=g((I=>Z(I))),C=E.companyId,P=g((I=>it(I.companyState,E.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:A,capitalizableAccountOverrides:F,dismissedAccounts:U}=g((I=>{const b=I.tenantState.currentTenantId,_=b!=null?I.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:_?.capitalizableAccounts??null,capitalizableAccountOverrides:_?.capitalizableAccountOverrides??null,dismissedAccounts:_?.capitalizationOnboardingDismissedAccounts??null}}),ge),L=i.useRef(A);L.current=A;const x=i.useRef(F);x.current=F;const B=i.useRef(U);B.current=U;const O=g((I=>rt(I.accountState)),ge),G=i.useMemo((()=>{const I={};for(const b of O)b.accountId!=null&&b.accountName!=null&&(I[b.accountId]=b.accountName);return I}),[O]),$=l!=null?G[l]??null:null,N=i.useCallback((I=>{if(!T)return;const b=L.current;if(b==null)return;const _=b.accounts??[],J=new Set(I),ee=x.current??{},te=B.current;for(const z of _)if(J.has(z.accountId)&&ee[z.accountId]==null&&te?.[z.accountId]==null)return p(z.classificationType),u(z.accountId),void h(!0)}),[T]),k=i.useCallback(((I,b)=>{d(lt(C,I,b,!0)),h(!1),p(null),u(null)}),[d,C]),r=i.useCallback((()=>{l!=null&&(d(dt(C,l)),h(!1),p(null),u(null))}),[d,C,l]);return{showPopup:y&&T,popupType:D,popupAccountId:l,popupAccountName:$,currencySymbol:P,checkAndShowPopup:N,handleSubmit:k,handleDismiss:r}})(),n=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(a.current=c.current()),t==="Completed"&&n.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),n.current=t}),[t]),o}const j=new Map,ke=(t,e,o)=>`${t}|${e??""}|${o}`,Q=(t,e)=>{const[o,n]=t.shownRecommendations;return{recommendationFor:t.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:n?.name??null,alternativeRecommendationSource:n?.engine??null,alternativeRecommendationConfidencePercentage:n?.confidencePercentage??null,selectedValue:t.selected.name,numberOfRecommendations:t.shownRecommendations.length,transactionId:e,lineId:t.lineId??null}},re=(t,e,o)=>({transactionId:e,lineId:t.lineId,dimension:t.dimension,outcome:t.outcome,selected:{name:t.selected.name,id:t.selected.id},matchedSource:t.matchedSource,matchedRank:t.matchedRank,topPickSource:t.topPickSource,shownRecommendations:t.shownRecommendations.map((n=>({source:n.source,rank:n.rank,value:{name:n.name,id:n.id},confidence:n.confidencePercentage!=null?n.confidencePercentage/100:void 0}))),...o}),Ge=(t,e,o)=>{X.trackRecommendationFeedbackRetracted(Q(e,o)),t(se(re(e,o,{outcome:"retracted"})))},Ln=(t,e)=>{const o=new Set(e.map(String));j.forEach(((n,a)=>{o.has(n.transactionId)&&(j.delete(a),Ge(t,n.feedback,n.transactionId))}))},Bn=t=>{const e=new Set(t.map(String));j.forEach(((o,n)=>{e.has(o.transactionId)&&j.delete(n)}))};function fn(t){const e=M(),[o,n]=i.useState(null),[a,s]=i.useState(!1),{fetchState:c}=g(ut),{isEnabled:d,fallbackTransactionId:y}=t,h=i.useCallback((u=>u.transactionId??y??""),[y]),D=i.useCallback((u=>{if(!d)return;const S=h(u);if(S==="")return;if(u.outcome!=="accepted")return void n(u);((f,T,E,C)=>{const P=ke(T,E,C),A=j.get(P);return A!=null&&(j.delete(P),Ge(f,A.feedback,A.transactionId),!0)})(e,S,u.lineId,u.dimension)||(((f,T)=>{X.trackRecommendationAccepted(Q(f,T))})(u,S),e(se(re(u,S,{}))))}),[d,h,e]),p=i.useCallback((u=>{if(o==null)return;const S=h(o);((v,f,T)=>{X.trackRecommendationFeedbackSubmitted({...Q(v,f),feedbackReason:T})})(o,S,u),e(se(re(o,S,{reasonText:u,skipped:!1}))),((v,f)=>{j.set(ke(f,v.lineId,v.dimension),{feedback:v,transactionId:f})})(o,S),s(!0)}),[o,h,e]),l=i.useCallback((()=>{var u,S;o!=null&&(u=o,S=h(o),X.trackRecommendationFeedbackSkipped(Q(u,S)),s(!1),n(null))}),[o,h]);return i.useEffect((()=>{if(!a||c!=="Completed"&&c!=="Error")return;s(!1),n(null);const u=c==="Completed";e(mt({messageSection:"recommendation_feedback",messageText:u?"success":"failed",type:u?"success":"error",showStatusIcon:!0}))}),[a,c,e]),{onRecommendationSelection:D,popup:o!=null?R.jsx(Wt,{feedback:o,submitState:a?c:"Not-Started",onSubmit:p,onSkip:l}):null}}const pe=()=>{const t=Ne.getSignedInUser(),{useFeatureGate:e}=Y(),{isFeatureEnabled:o}=e(w.isChainOfThoughtEnabled);return i.useMemo((()=>pt(t)&&o),[t,o])};function We(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function On(t,e){const o=M(),{useFeatureGate:n}=Y(),a=g((r=>Z(r))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),d=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:y}=n(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=n(w.isExpenseAutomationEnabled),D=pe(),p=i.useMemo((()=>({id:t,type:q(e)})),[t,e]),l=g((r=>H(r,p))),u=l?.transactionDetailUpdateStatus?.fetchState,S=l?.transactionDetailLocalData?.lineItemById,v=g((r=>{const I=H(r,p)?.transactionDetailLocalData.vendorUpdates?.id;return I==null?"Not-Started":r.transactionVendorViewState.editVendorStateById[I]?.saveStatus.fetchState??"Not-Started"})),f=i.useMemo((()=>l?.fetchState==="Completed"?We(l?.transaction):void 0),[l?.fetchState,l?.transaction]),T=g((r=>{if(f!=null)return we(r.customerIncomeState,r.vendorExpenseState,r.trendState,f,"month")})),E=g((r=>le(r))),C=g((r=>{if(f!=null)return Pe(r.trendWithTransactionsState,f,"TransactionDetail")})),P=a.company?.companyInfo.firstMonthOfFY??1,A=g((r=>Fe(r.accountState,r.accountListState,"accountList"))),[F,U]=i.useState(!1),[L,x]=i.useState(!1),[B,O]=i.useState(!1);i.useEffect((()=>{U(!1),x(!1),O(!1)}),[t,e]);const G=i.useCallback((()=>{U(!1),x(!1)}),[]),[$,N]=i.useState(!1),k=C?.selectedPeriod?.timePeriod;return i.useEffect((()=>{B||l==null||l.transaction==null||(o(Ue({id:l.transaction.id,type:l.transaction.type})),O(!0)),f!=null&&(!s||c&&d===!1)&&(F?L||T==null||(x(!0),o(me(f,"TransactionDetail",{timeframe:"month",timePeriod:k??T}))):(o(de()),o(ue()),U(!0),o(xe(f))))}),[o,B,l?.fetchState,l?.transaction,f,s,c,d,F,L,T,k]),i.useEffect((()=>{E.newVendorState?.vendorDetailLocalData?.vendorName!=null?N(!0):N(!1)}),[E.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(W("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:d,isVendorBulkUpdateOnTransactionEnabled:y,isExpenseAutomationEnabled:h,isChainOfThoughtEnabled:D,selectedTransaction:p,transactionDetail:l,rawDetailSaveStatus:u,rawDetailLineItemById:S,vendorSaveStatus:v,tranEntity:f,defaultTrendTransactionTimePeriod:T,vendorViewDetails:E,uiState:C,firstMonthOfFY:P,uncategorizedAccounts:A,resetTrendIsFetchedStates:G,isCreateVendorDrawerOpen:$,setIsCreateVendorDrawerOpen:N}}const hn={overlayWidth:new Ht(100,100,58)},Sn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=Xt(),c=$t(),d=M(),y=g((p=>le(p))),h=()=>{n()},D={vendorDetailView:a??y,onSaveSuccess:()=>{d(Le()),d(ft("Not-Started")),o()},onSaveVendor:e,onCancelClick:h,saveVendorDetailLocalData:p=>{d(Ve({vendorId:void 0,localData:p}))}};return R.jsx(on,{anchor:"right",open:t,PaperProps:{style:{width:hn.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:h,children:R.jsx(yn,{onClick:p=>p.stopPropagation(),children:R.jsx(qt,{...D})})})},yn=nn(an)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `;function Tn(t,e){t(ht({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:q(e.transactionType),sourceTransactionType:q(e.sourceTransactionType)}))}function bn({currentTransactionId:t,enabled:e=!0,buildPath:o,beforeNavigate:n,navigate:a,navigateState:s}){const c=g((y=>y.createTransferEntryState.lastTransferEntryReplacement)),d=i.useRef(null);i.useEffect((()=>{if(!e||c==null||t==null||d.current===c)return;const{previousTransactionId:y,newTransactionId:h}=c;t.id===y.id&&t.type===y.type&&(d.current=c,n?.(),a(o(h),{replace:!0,state:s}))}),[e,c,t,o,n,a,s])}const gn=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:o})=>{const n=De(),a=Ce(),s=M(),c=pe(),{transactionTypeEncoded:d,transactionId:y}=Ae(),h=e??y,D=o??ze(d??"");let p;je(h,D)&&(p={id:h,type:q(D)});const l=p!=null?g((S=>H(S,p))):void 0,u=()=>{const S=ce(n.state?.pathnameStackToGoBack),v=S.poppedPathname??((f=2)=>{let T="../";for(let E=0;E<f;E++)T=`${T}../`;return T})(1);a(v,{state:{pathnameStackToGoBack:S.newStack}})};return{transactionId:p,onSaveVendor:()=>{s(Be(p,void 0))},onSaveSuccess:()=>{if(l!=null&&l?.transaction&&l?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&l?.transactionDetailLocalData.vendorUpdates?.id!=null){const S=l?.transactionDetailLocalData.vendorUpdates,v={id:l?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:l?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:S?.name,qboId:l?.transactionDetailLocalData.vendorUpdates?.qboId??""},f={transactionId:{id:l?.transaction?.id,type:l?.transaction?.type},transaction:l?.transaction,lineIds:l?.transaction?.lines?.map((T=>T.id))??[]};s(K({entity:v,amount:l?.transaction?.amount.amount,transactionDetails:f,flowType:"detail",isFetchCOT:c}))}u()},onCancel:()=>{p!=null&&s(St({transactionId:p})),s(Le()),s(yt()),t(!0),u()}}},In=ct((function(t,e){const o=H(t,e.selectedTransaction);let n;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=t.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(n=gt(t,e.entity,"TransactionDetail"));const d=t.entityAutoCompleteState.autoCompleteText.common,y=It(t,"common"),h=Z(t);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:h.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${tn.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:n,analytics:X,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:d,entityAutoCompleteView:y},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(t,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(t(W("common")),e.onBackClick!=null)return void e.onBackClick();const n=ce(e.location.state?.pathnameStackToGoBack),a=n.poppedPathname??Xe(2);e.navigate(a,{state:{pathnameStackToGoBack:n.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(n,a)=>{e.transaction!=null&&t(Gt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:n,customerId:a}))},onTransactionClick:n=>{e.resetTrendIsFetchedStates(),t(de()),t(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Me(n,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:n=>{if(n==null)e.defaultTrendTransactionTimePeriod!=null&&t(ve(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=n.currentTimePeriod==null?n.addTimePeriod:{startDate:n.addTimePeriod.startDate,endDate:n.currentTimePeriod.endDate};t(me(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:n.addTimePeriod})),t(ve(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:a}))}},onSaveUpdates:(n,a,s,c)=>{t(c===!0&&s!=null?Be(n,s,!0,e.isExpenseAutomationEnabled):Mt({transactionId:n,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),t(W("common"))},onUploadAttachmentAttachment:n=>{t(jt(n))},onDeleteAttachment:n=>{e.transaction!=null&&t(zt(n,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(n,a)=>{t(Nt({transactionId:n,transactionLocalData:a}))},onUpdateAllChecked:(n,a,s,c)=>{e.transaction!=null&&t(Ot(e.selectedTransaction,e.transaction,n,a,s,c))},onResetLineItemsCategoryClassInLocalData:(n,a,s,c,d,y)=>{t(Bt(n,a,s,c,d,y))},onChangeCategoryClassWhenUpdateAllIsChecked:(n,a)=>{e.transaction!=null&&t(Lt({id:e.transaction.id,type:e.transaction.type},e.transaction,n,a))},onSaveSuccess:()=>{const n=ce(e.location.state?.pathnameStackToGoBack);if(n.poppedPathname!=null){const a=un(n.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${rn(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${ln(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(Oe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(n,a)=>{n.trim().length>=2?t(Vt({searchString:n,entityType:a,searchOrigin:"common"})):n.trim().length===0&&t(W("common"))},onCancelAutoComplete:()=>{t(W("common"))}},onFetchRecommendationsForEntity:(n,a,s,c)=>{t(K({entity:n,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:n=>{const{transactionId:a,transaction:s,lineId:c}=n;t(xt(a,s,c))},resetUpdateErrorState:()=>{const n={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(Ut(n))},onSaveVendorInLocalData:(n,a,s,c,d)=>{if(t(Ft({transactionId:n,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(K({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o})),t(Ve({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const y=e.transaction,h=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(y.type??"")}/${y.id}/vendor/create`,{state:{pathnameStackToGoBack:h}})}},onSaveCustomerInLocalData:(n,a,s,c,d)=>{t(Pt({transactionId:n,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(K({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:n=>{t(wt({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:n}))},onClickUpdateVendorToAllLineItems:(n,a,s)=>{t(_t(n,a,s))},onResetVendorToAllLineItems:(n,a,s)=>{t(Rt(n,a,s))},saveLatestSelectedEntity:(n,a,s)=>{t(At({transactionId:n,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(n,a)=>{t(Ct(n,a))},setIsVendorUpdateAllChecked:(n,a,s)=>{t(Dt(n,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?n=>Tn(t,n):void 0,onLineAdd:()=>{if(e.transaction==null)return;const n={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",d=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};t(Et(n,d))},onLineDelete:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(kt(a,n))},onToggleSplitEditMode:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(vt(a,n))}}}))(en);function Nn(){const t=Ce(),e=M(),o=De(),{useFeatureGate:n}=Y(),a=Yt(),s=g((m=>Z(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),d=s.userRole!=null&&Re(s.userRole),y=s.userRole!=null&&_e(s.userRole),{isFeatureEnabled:h}=n(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:D}=n(w.isExpenseAutomationEnabled),{tenantEmailDomain:p,transactionTypeEncoded:l,transactionId:u}=Ae(),[S,v]=i.useState(!1),f=ze(l??""),T=je(u,f),E=g((m=>m.transactionVendorViewState)),C=pe(),{isFeatureEnabled:P}=n(w.isRecommendationFeedbackEnabled),A=Jt(),{onRecommendationSelection:F,popup:U}=fn({isEnabled:P,fallbackTransactionId:u}),L=i.useMemo((()=>({...A,onRecommendationSelection:F})),[A,F]),{isFeatureEnabled:x}=n(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=n(w.isProjectsTransactionsEnabled),{isFeatureEnabled:O}=n(w.isTransactionSplitEnabled),G=a?.currentTenant?.companyId,$=a?.currentTenant?.companyName,N=cn(G),k=i.useMemo((()=>{if(T)return{id:u,type:q(f)}}),[T,u,f]),r=k!=null?g((m=>H(m,k))):void 0,I=r?.transactionDetailLocalData.vendorUpdates?.id!=null?E.editVendorStateById[r?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",b=r?.fetchState==="Completed"?We(r?.transaction):void 0,_=g((m=>b!=null?we(m.customerIncomeState,m.vendorExpenseState,m.trendState,b,"month"):void 0)),J=g((m=>le(m))),ee=g((m=>b!=null?Pe(m.trendWithTransactionsState,b,"TransactionDetail"):void 0)),te=s.company?.companyInfo.firstMonthOfFY??1,z=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[$e,fe]=i.useState(!1),[qe,he]=i.useState(!1),[He,Se]=i.useState(!1),Ye=i.useCallback((m=>Me(m,p??"")+o.search),[p,o.search]),Je=i.useCallback((()=>{Se(!1)}),[]);bn({currentTransactionId:k,enabled:p!=null&&p!=="",buildPath:Ye,beforeNavigate:Je,navigate:t,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=dn();mn();const ne=i.useRef(r?.transaction);ne.current=r?.transaction;const Ke=r?.transactionDetailUpdateStatus?.fetchState,V=pn(Ke,(()=>{const m=[];if(ne.current!=null)for(const ae of ne.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{k!=null&&r!=null&&r.fetchState==="Not-Started"&&(e(Oe(k,!1)),ye())}),[e,k,r?.fetchState]),i.useEffect((()=>{if(k!=null&&r?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);t("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[k,r?.fetchState,t,o.state,o.pathname,Te]),i.useEffect((()=>{He||r==null||r.transaction==null||(e(Ue({id:r.transaction.id,type:r.transaction.type})),Se(!0));const m=o.state?.searchContext;b==null&&r?.fetchState==="Completed"&&Ee(r?.transaction,m),b!=null&&(!c||d&&y===!1)&&($e?qe||_==null||(he(!0),e(me(b,"TransactionDetail",{timeframe:"month",timePeriod:ee?.selectedPeriod?.timePeriod??_}))):(e(de()),e(ue()),Ee(r?.transaction,m),fe(!0),e(xe(b))))}),[r?.fetchState,r?.transaction,_,c]),i.useEffect((()=>{J.newVendorState?.vendorDetailLocalData?.vendorName!=null?v(!0):v(!1)}),[J.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(W("common"))}),[]);const Qe=[l,u].filter((m=>m!=null)),{transactionId:be,onSaveVendor:Ze,onSaveSuccess:et,onCancel:tt}=gn({closeDrawerHandler:m=>{v(!1),t(m?"../":"../..")}}),{isAiCfoAccessEnabled:nt,onAskAiCfoClick:at}=sn({mobileExploreReferrer:"Transaction Details"});return Kt({isDataReady:r?.fetchState==="Completed"}),T?R.jsxs(R.Fragment,{children:[be!=null&&S&&R.jsx(Sn,{isOpen:S,transactionId:be,onSaveVendor:Ze,onSaveSuccess:et,onCancel:tt}),R.jsx(Qt,{toolkit:L,children:R.jsx(In,{hideDeleteAttachment:!0,firstMonthOfFY:te,isDisabled:r?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:p,location:o,navigate:t,selectedTransaction:k,entity:b,isCOTEnabled:C,defaultTrendTransactionTimePeriod:_,resetTrendIsFetchedStates:ye,transaction:r?.transaction,uncategorizedAccounts:z,vendorSaveStatus:I,isVendorBulkUpdateOnTransactionEnabled:h,isCreateTransferEntryFromExpenseEnabled:x,isExpenseAutomationEnabled:D,isAiCfoAccessEnabled:nt,onAskAiCfoClick:at,isProjectsTransactionsEnabled:B,isTransactionSplitEnabled:O,companyId:G,companyName:$,initialOpenThreadRequest:N})}),U,V.showPopup&&V.popupType!=null&&R.jsx(Zt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):R.jsx(st,{to:Xe(Qe.length)})}const Xe=(t=2)=>{let e="../";for(let o=0;o<t;o++)e=`${e}../`;return e},Ee=(t,e)=>{if(t!=null){const{transactionCategory:o,transactionClass:n}=vn(t),a=kn(t);X.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,o.length>0?o:void 0,n.length>0?n:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},vn=t=>{const e=[],o=[];return t.lines?.forEach((n=>{switch(n.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const a=n;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},kn=t=>Tt(t)===!0?t.customer?.name??"":bt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Sn as C,Nn as T,fn as a,mn as b,pn as c,gn as d,In as e,bn as f,pe as g,Tn as h,Bn as i,Ee as l,Ln as r,On as u};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-CIxx6Ub6.js";import{h as W,g as J,u as K,i as Z,j as g,N as U,l as X,n as Me,o as M}from"./core-Caq7Zbsp.js";import{fF as q,ua as H,lf as p,eE as ee,S6 as Ae,br as me,$K as Ce,l$ as te,Wg as ae,$L as pe,$M as Be,bE as k,S2 as Se,$N as Le,$O as fe,$P as Fe,S5 as he,$Q as Oe,$R as Te,$S as $e,$T as ge,$U as Ge,$V as ze,$W as De,Ti as we}from"./zeni-epic-state-DROyxOLw.js";import{N as ne,f as ce,k as L,G as Ie,de as oe,p as R,a5 as se,ar as Re,Q as Ve}from"./index-DOXJLxdR.js";import"./mui-DI0hUuFr.js";import{a as y}from"./sentry-BCPOyc0G.js";import{w as ie}from"./withTransactionSidePanel-C1wVwRW0.js";import{p as re,c as de}from"./routePaths-C1OqXYGB.js";import{B as _e}from"./utils-rX2IEvjD.js";import{d as j}from"./decodeURIComponentSafe-DmjyT4t5.js";import{Z as Ne}from"./ZeniAccountStatementScreen-xKZWX655.js";import"./recharts-DKmpCGIA.js";import"./analytics-CiEh1qKr.js";import"./plaid-CXvI7t9H.js";import"./dnd-DwckO6rX.js";import"./stripe-cKAAJElX.js";import"./lottie-CrKh4Q_r.js";import"./lexical-mmp2B1vq.js";import"./pdf-BlhN83fm.js";import"./useAskAiCfoHostNavButtonProps-BvhP40c_.js";import"./TransactionDetailScreen-fc6wRDCa.js";import"./useInitialThreadRequest-uu8NipM7.js";import"./expenseAutomationHelper-B83Qa5Jl.js";import"./stripSplatSuffix-Dmnnw5Oe.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="3ca15294-ce73-4c1a-97ee-add2857774e3",a._sentryDebugIdIdentifier="sentry-dbid-3ca15294-ce73-4c1a-97ee-add2857774e3")}catch{}})();const Je=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>_e(a),ke=()=>{const{common:a,uncategorizedTransactionList:e}=Ie.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},Ue=X((function(a,e){const t=Ce(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=N(e.selectedAccount.tranListType),d=We(t,n,c,o,e.bookCloseDate);L.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(pe({uiState:{dateRange:d},type:N(e.selectedAccount.tranListType)})),a(Ae(o,p(d),!1,o==="missingReceipts"?ke():void 0)),e.onSelectedTimePeriodChange(p(d))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}}))(oe),_=ie((function({...a}){const e=W(),t=J(),n=K(),c=t.pathname.split("/").find((l=>Je.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=Z(),{accountType:Y,title:v,subTitle:A}=qe(o),f="month",T=g((l=>q(l))),P=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ne(),{isFeatureEnabled:h}=S(ce.isProjectsTransactionsEnabled),I=g((l=>H(l)))&&h,{dataAvailable:x,initialTimeframeTick:F}=Qe(o,P,T.bookCloseDate),[b,O]=y.useState(!1),[E,$]=y.useState(void 0),u=y.useMemo((()=>{const l=p(F);return{tranListType:o,accountType:ee(Y),title:v,subTitle:A,timeframe:f,period:l}}),[o,f,Y,x]);y.useEffect((()=>{if(!b&&u!=null){O(!0),L.trackTransactionList(void 0,void 0,void 0,u.title);const l=N(u.tranListType);n(Ae(l,u.period,!0,l==="missingReceipts"?ke():void 0))}}),[b,u,n]);let C=u;return u!=null&&E!=null&&(C={...u,period:E}),c==null||C==null?s.jsx(U,{to:"../"}):s.jsx(Ue,{firstMonthOfFY:P,tenantEmailDomain:d,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:x,navigate:e,showProjectField:I,selectedAccount:C,referrerType:o,bookCloseDate:T.bookCloseDate,onSelectedTimePeriodChange:l=>$(l),...a})})),qe=a=>{let e="",t="";const n=Ie.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.common.texts.uncategorizedExpenses;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.common.texts.receipts}return{accountType:e,title:t,subTitle:""}},Qe=(a,e,t)=>{const n=me();let c=me().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:re(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},We=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ke=X((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ye();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),Ze=ie((function({referrerType:a,...e}){const t=W(),n=J(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,classIdEncoded:v,timeframe:A,startDate:f,endDate:T,titleEncoded:P}=Z(),S=j(d??""),h=j(Y??""),I=j(v??""),x=j(P??""),F=g((r=>Be(r.transactionListState,h,S,I))),[b,O]=y.useState(!1),[E,$]=y.useState(void 0),u=g((r=>q(r))),C=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ne(),{isFeatureEnabled:m}=l(ce.isProjectsTransactionsEnabled),z=g((r=>H(r)))&&m;let i;const G=Xe(S,h,I,A,f,T,x);if(G){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},w=He(F?.dateRange,r);i={accountId:h,accountType:ee(S),classId:I,title:x,timeframe:A,period:w}}y.useEffect((()=>{b||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(Se(i.accountId,i.accountType,i.classId,i.period)))}),[b,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const V=[d,Y,v,A,f,T,P].filter((r=>r!=null));return G&&B!=null?s.jsx(Ke,{firstMonthOfFY:C,tenantEmailDomain:o,location:n,navigate:t,showProjectField:z,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>$(r),...e}):s.jsx(U,{to:Ye(V.length)})})),Ye=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,He=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),et=X((function(a,e){const t=Oe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ve();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(he(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),tt=ie((function({referrerType:a,...e}){const t=W(),n=J(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,projectIdEncoded:v,timeframe:A,startDate:f,endDate:T,titleEncoded:P}=Z(),S=j(d??""),h=j(Y??""),I=j(v??""),x=j(P??""),F=g((r=>Fe(r.transactionListState,h,S,I))),[b,O]=y.useState(!1),[E,$]=y.useState(void 0),u=g((r=>q(r))),C=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ne(),{isFeatureEnabled:m}=l(ce.isProjectsTransactionsEnabled),z=g((r=>H(r)))&&m;let i;const G=at(S,h,I,A,f,T,x);if(G){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},w=nt(F?.dateRange,r);i={accountId:h,accountType:ee(S),projectId:I,title:x,timeframe:A,period:w}}y.useEffect((()=>{b||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.projectId,i.period)))}),[b,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const V=[d,Y,v,A,f,T,P].filter((r=>r!=null));return G&&B!=null?s.jsx(et,{firstMonthOfFY:C,tenantEmailDomain:o,location:n,navigate:t,showProjectField:z,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>$(r),...e}):s.jsx(U,{to:ve(V.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},at=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,nt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ct=X((function(a,e){const t=Ge(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ze(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Pe();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=it(e.tenantEmailDomain),n=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),ye=ie((function({referrerType:a,...e}){const t=W(),n=J(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,timeframe:v,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:P}=Z(),S=j(d??""),h=j(Y??""),I=j(T??""),x=!(P!=null&&P==="exclude_subaccounts"),F=g((D=>$e(D.transactionListState,h,S))),[b,O]=y.useState(!1),[E,$]=y.useState(void 0),u=g((D=>q(D))),C=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const z=ot(S,h,v,A,f,I);if(z){const D={startDate:k(A,"YYYY-MM-DD"),endDate:k(f,"YYYY-MM-DD")},le=st(F?.dateRange,D);m={accountId:h,accountType:ee(S),title:I,timeframe:v,period:le}}let i=m;m!=null&&E!=null&&(i={...m,period:E});const{useFeatureGate:G}=ne(),B=y.useCallback(((D,le)=>{if(o==null)return;const ue=D.url.split(`/${o}/`)[1];if(ue==null)return;const[Ee,je]=ue.split("?"),Q=new URLSearchParams(je??"");Q.set("view","full"),Q.set("thread_id",le),Q.set("entity_type",D.entityType);const xe=R(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${Ee}?${Q.toString()}`,{state:{pathnameStackToGoBack:xe}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:V}=G(ce.isProjectsTransactionsEnabled),r=g((D=>H(D)))&&V,{areTenantIdsInSync:w}=Re();y.useEffect((()=>{!b&&m!=null&&w&&(O(!0),L.trackTransactionList(m.accountId,void 0,a,m.title),c(ge(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[b,m,c,w]);const be=[d,Y,v,A,f,T].filter((D=>D!=null));return z&&i!=null?s.jsx(ct,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:C,onCommentThreadClick:B,showProjectField:r,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>$(D),...e}):s.jsx(U,{to:Pe(be.length)})})),Pe=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},ot=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&k(n,"YYYY-MM-DD").isValid()&&k(c,"YYYY-MM-DD").isValid()&&o!=null,st=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),it=a=>`/${a}/transactions/${we}/statements`;function Ct(){const a=J().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>q(n))).tenantId],t=Ve();return s.jsxs(Me,{children:[s.jsx(M,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(ye,{referrerType:a})}),s.jsx(M,{path:"/zeni-clearing-account/statements",element:s.jsx(Ne,{})}),s.jsx(M,{path:"/*",element:s.jsx(ye,{referrerType:a})}),s.jsx(M,{path:"/uncategorized-income/*",element:s.jsx(_,{})}),s.jsx(M,{path:"/uncategorized-expense/*",element:s.jsx(_,{})}),s.jsx(M,{path:"/miscategorized-income/*",element:s.jsx(_,{})}),s.jsx(M,{path:"/miscategorized-expense/*",element:s.jsx(_,{})}),s.jsx(M,{path:"/missing-receipts/*",element:t?s.jsx(U,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(_,{})}),s.jsx(M,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ze,{referrerType:a})}),s.jsx(M,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(tt,{referrerType:a})})]})}export{Ct as default};
@@ -0,0 +1,37 @@
1
+ import{j as e}from"./liveblocks-CIxx6Ub6.js";import{h as L,g as U,u as F,i as M,j as y,N as D,l as V,n as xe,o as k}from"./core-Caq7Zbsp.js";import{cv as N,fF as E,Zj as P,Ow as ae,Od as $,Oe as ne,Zl as Ie,Oz as Te,Zh as we,Zi as se,Zx as Ce,MA as ke,Cd as je,Zn as Ae,OG as be,Zk as oe,dd as H,GK as re,dZ as ve,d_ as Ee,$H as De,$I as Le,Of as Ue,$J as Fe,Og as Pe,Op as Be,bq as Oe,bJ as Re,cG as Me,bK as Ve,cu as Ne,bt as _e,Ui as Ze,ct as ze}from"./zeni-epic-state-DROyxOLw.js";import{W as _,l as Ge,z as v,a9 as Z,k as A,d7 as $e,d8 as He,d9 as G,a2 as q,E as qe,ar as We,at as Je,N as ie,f as R,ac as Ke,a8 as Qe,da as Xe,af as W,p as Ye,db as et,a5 as J,dc as tt,aj as at,a0 as X,dd as nt,g as st}from"./index-DOXJLxdR.js";import{D as ot,n as O,S as rt}from"./mui-DI0hUuFr.js";import it from"./NotFoundScreen-C2GrPpNy.js";import{S as Y}from"./SetupPagesScreen-BccJSzRN.js";import{a as p}from"./sentry-BCPOyc0G.js";import{u as ct}from"./useAskAiCfoHostNavButtonProps-BvhP40c_.js";import{u as lt}from"./useInitialThreadRequest-uu8NipM7.js";import{M as ce}from"./MobileAppDrawer-DqgtjBKX.js";import{F as ut}from"./FeaturePreviewScreen-t-KcIePh.js";import{a as ee}from"./analyticsHelper-DHPcRAai.js";import"./recharts-DKmpCGIA.js";import"./analytics-CiEh1qKr.js";import"./plaid-CXvI7t9H.js";import"./dnd-DwckO6rX.js";import"./stripe-cKAAJElX.js";import"./lottie-CrKh4Q_r.js";import"./lexical-mmp2B1vq.js";import"./pdf-BlhN83fm.js";import"./utils-rX2IEvjD.js";import"./BusinessVerificationPageScreen-CWJBny4J.js";import"./routePaths-C1OqXYGB.js";import"./InboxNotificationsProvider-DcarX1j5.js";import"./useTaskManagerAccess-DxrmaJfc.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="0106bcd6-4d18-4ef5-8a73-b905ebca9833",t._sentryDebugIdIdentifier="sentry-dbid-0106bcd6-4d18-4ef5-8a73-b905ebca9833")}catch{}})();const dt=V((function(t,a){const{companyId:n}=a;return{treasurySetupView:P(t,n),analytics:A}}),(function(t,a){const{navigate:n,analytics:r,treasurySetupView:i}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const o=i.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(o.riskScore,ee(o)),t(Te(!0))},onUpdateFundAllocation:o=>{r.trackTreasuryAllocationAction("update",ee(o)),t(Ie(o))}}}))($e);function pt(){const t=L(),a=U(),n=F(),{tenantEmailDomain:r}=M(),i=_(),o=y((w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=Ge(o),s=N(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[S,I]=p.useState(!1),[l,u]=p.useState(!1),x=y((w=>E(w))),f=v.getSignedInUserTenant(r)?.companyId??x.companyId,C=v.getSignedInUser(),h=y((w=>P(w,f))),g=y((w=>w.treasurySetupViewState.fetchState)),j=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),T=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{d||g!=="Not-Started"||f==null||(c(!0),n(ae(f,!0,!1)))}),[d,g,f,n]),p.useEffect((()=>{l||T!=="Not-Started"||f==null||(u(!0),n($()))}),[l,T,f,n]),p.useEffect((()=>{S||j!=="Not-Started"||f==null||(I(!0),n(ne()))}),[S,j,f,n]),p.useEffect((()=>{m==="In-Progress"&&o==="Completed"&&t("../")}),[m,o,t]),x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const B=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!B&&e.jsx(Z,{analytics:A,onLoad:()=>{}}),e.jsx(dt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:B,isReadOnly:!s,treasurySetupView:h,analytics:A})]})}const mt=V((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:Ce(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:P(t,n)}}),(function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:i}=a,o=r.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{G(a.analytics,"cancel",o,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{G(a.analytics,"confirm",o,m,"Transfer"),t(be())},onSaveChangesToLocalStore:s=>{t(Ae(s))},onFetchLinkTokenClick:s=>{t(je("treasury_setup",s))},onEstablishConnectionClick:s=>{t(ke(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(He),ft=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:r}=M(),i=F(),[o,m]=p.useState(!1),[s,d]=p.useState(!1),[c,S]=p.useState(!1),[I,l]=p.useState(!1),u=y((T=>T.treasurySetupViewState.fetchState)),x=y((T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((T=>E(T))),h=v.getSignedInUserTenant(r)?.companyId??C.companyId,g=y((T=>we(T))),j=y((T=>P(T,h)));if(v.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||h==null||(d(!0),i(ae(h,!0,!1)))}),[s,u,h,i]),p.useEffect((()=>{c||x!=="Not-Started"||h==null||(S(!0),i($()))}),[c,x,h,i]),p.useEffect((()=>{I||f!=="Not-Started"||h==null||(l(!0),i(ne()))}),[I,f,h,i]),e.jsxs(e.Fragment,{children:[e.jsx(Z,{analytics:A,onLoad:()=>{}}),e.jsx(mt,{analytics:A,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:o,maxInsuredAmount:5e5,onReviewClick:()=>{G(A,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},yt=O.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${t=>t.theme.colors.grey4};
9
+ `,gt={overlayWidth:new Ke(100,100,48)},St=V((function(t,a){const n=oe(t),{companyId:r}=a;return{treasuryDetail:n,treasurySetupView:P(t,r),downloadEndPoint:`${W.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}}),(function(t,a){const{navigate:n,currentTenant:r,location:i,handleDrawerToggle:o,analytics:m}=a,{tenantEmailDomain:s}=r;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(re(!0))},handleTreasuryOptionSelection:d=>{let c="page-not-found";d==="editPortfolio"?c=ht(s):d==="statements"?c=xt(s):d==="taxLetter"?c=It(s):d==="settings"&&(c=Tt(s));const S=Ye(i.state?.pathnameStackToGoBack,i.pathname);n(c,{state:{pathnameStackToGoBack:S}})},onColumnSortConfigChanged:(d,c)=>{t(De({uiState:{sortKey:d,sortOrder:c}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{o(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}}))(Xe);function z({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=U(),r=L(),i=F(),o=q(),m=qe(),s=y((b=>E(b))),{tenantEmailDomain:d}=M(),c=s.companyId??v.getSignedInUserTenant(d)?.companyId,[S,I]=p.useState(!1),l=y((b=>oe(b))),u=l.fetchState,x=l.accountSummary?.totalBalance?.amount,f=y((b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus)),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=_(),g=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,j=N(h?.loggedInUserRoleMap),T=H(h?.loggedInUserRoleMap),{areTenantIdsInSync:B}=We();p.useEffect((()=>{u==="Not-Started"&&!S&&B&&(I(!0),i(re(!0)))}),[S,i,u,B]),p.useEffect((()=>{l.transactionsFetchState.fetchState==="Completed"&&l.transactions.length===0&&!n.pathname.includes("transfer")&&j&&r("./transfer")}),[l.transactionsFetchState.fetchState,l.transactions.length,n.pathname,j,r]);const w=()=>{r("..")},[le,ue]=p.useState(!1),K=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=ct({mobileExploreReferrer:"Treasury"});Je({isDataReady:u==="Completed"});const{useFeatureGate:Q}=ie(),{isFeatureEnabled:me}=Q(R.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=Q(R.isAutoTransferRuleEnabled),ye=lt(c,{clearParams:u==="Completed"&&f?.fetchState==="Completed"}),ge=ve(s),Se=Ee(me,s);if(ge===!0&&Se!==!0)return e.jsx(ut,{});if(C){const b=f?.fetchState!=="Completed"||l.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[l.accountSummaryFetchState.fetchState==="Completed"&&f?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(Z,{analytics:A,onLoad:()=>{}}):null,e.jsx(ot,{onClose:w,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:gt.overlayWidth.valuePercentage(o),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(wt,{onClick:he=>he.stopPropagation(),children:[t===!0?e.jsx(ft,{isFirstTransfer:l.transactions.length===0||x===0,isTransactionsLoaded:l.transactionsFetchState.fetchState!=="In-Progress"&&l.transactionsFetchState.fetchState!=="Not-Started"}):null,a===!0?e.jsx(pt,{}):null]})}),e.jsxs(yt,{windowSize:o,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:K}),e.jsx(St,{treasuryDetailsView:l,isAutoTransferRuleEnabled:fe,navigate:r,currentTenant:s,location:n,companyId:c,analytics:A,handleDrawerToggle:K,initialOpenThreadRequest:ye,isLoading:b,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return g&&j?e.jsx(D,{to:"../setup"}):s.companyTreasuryInfo?.info&&!g&&T?e.jsx(D,{to:"../promo",state:n.state}):e.jsx(Qe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const ht=t=>`/${t}/treasury/edit-portfolio`,xt=t=>`/${t}/treasury/statements`,It=t=>`/${t}/treasury/tax-letter`,Tt=t=>`/${t}/treasury/setup`,wt=O(rt)`
10
+ display: flex;
11
+ min-height: 100%;
12
+ flex-direction: column;
13
+ `,Ct=O.div`
14
+ display: flex;
15
+ height: 100vh;
16
+ width: 100%;
17
+ flex: 1 1 auto;
18
+ flex-direction: column;
19
+ align-items: center;
20
+ background-color: ${t=>t.theme.colors.grey4};
21
+ `;function kt(){const t=L(),a=F(),n=q(),r=U(),i=`${W.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[o,m]=p.useState(!1),s=y((u=>Le(u)));p.useEffect((()=>{o||s.fetchState!=="Not-Started"||(m(!0),a(Ue(!1)))}),[o,s.fetchState,a]);const d=v.getSignedInUser(),c=y((u=>E(u))),S={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},I=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access statements page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(Ct,{windowSize:n,children:e.jsx(et,{currentTenantCompanyName:I,statementListView:s,isLoading:l,onBackClick:()=>{const u=J(r.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const jt=O.div`
22
+ display: flex;
23
+ height: 100vh;
24
+ width: 100%;
25
+ flex: 1 1 auto;
26
+ flex-direction: column;
27
+ align-items: center;
28
+ background-color: ${t=>t.theme.colors.grey4};
29
+ `;function At(){const t=L(),a=q(),n=U(),r=F(),i=`${W.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[o,m]=p.useState(!1),s=y((u=>Fe(u)));p.useEffect((()=>{o||s.fetchState!=="Not-Started"||(m(!0),r(Pe(!1)))}),[o,s.fetchState,r]);const d=v.getSignedInUser(),c=y((u=>E(u))),S={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},I=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access tax letter page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(jt,{windowSize:a,children:e.jsx(tt,{currentTenantCompanyName:I,taxLetterListView:s,isLoading:l,onBackClick:()=>{const u=J(n.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const bt=V((function(t,a){const{companyId:n}=a,r=P(t,n);return{treasurySetupView:r,isSetupComplete:r.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),(function(t,a){const{navigate:n,companyId:r}=a;return{onSetupButtonClick:()=>{t(Be(r))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:i=>{n(i?"..":"../setup",{relative:"path"})}}}))(nt),vt=()=>{const t=at(),a=L(),n=U(),r=F(),{tenantEmailDomain:i}=M(),[o,m]=p.useState(!1),s=y((g=>E(g))),[d,c]=p.useState(!1),S=y((g=>g.treasurySetupViewState.treasuryFundsDetails?.fetchStatus));p.useEffect((()=>{d||S?.fetchState!=="Not-Started"||I==null||(c(!0),r($()))}),[S,r]);const I=v.getSignedInUserTenant(i)?.companyId??s.companyId,l=v.getSignedInUser(),u=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=g=>{m(g)};if(l==null)throw Error("Can't access treasury promo page without signing in...");const f=_(),C=N(f?.loggedInUserRoleMap),h=H(f?.loggedInUserRoleMap);if(u&&C)return e.jsx(D,{to:"../../treasury/setup"});if(s.company?.companyTreasuryInfo&&(!u&&C||h)){if(n.state?.message==="activation"){const g=J(n.state?.pathnameStackToGoBack);a(n.pathname,{state:{...n.state,message:void 0,pathnameStackToGoBack:g.newStack}})}return S?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(Z,{analytics:A,onLoad:g=>(j=>j.trackTreasuryPromoView("Treasury Promo Page"))(g)}),e.jsx(ce,{isAppContentDrawerOpen:o,handleDrawerToggle:x}),e.jsx(bt,{analytics:A,navigate:a,companyId:I,meetingUrl:t("treasury_promo"),onClickMenuIcon:()=>{x(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=O.div`
30
+ display: flex;
31
+ width: 100%;
32
+ height: 100%;
33
+ flex-direction: row;
34
+ justify-content: center;
35
+ align-items: center;
36
+ background-color: ${t=>t.theme.colors.grey5};
37
+ `;function ta(){const t=U(),a=y((g=>E(g))),{useFeatureGate:n}=ie(),r=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",i=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,o=_(),m=H(o?.loggedInUserRoleMap),s=a?.userRole!=null&&Oe(a?.userRole),d=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Re(o?.loggedInUserRoleMap),c=Me(o?.loggedInUserRoleMap),S=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Ve(o?.loggedInUserRoleMap),I=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!s&&Ne(o?.loggedInUserRoleMap),l=r&&!s&&N(o?.loggedInUserRoleMap),{isFeatureEnabled:u}=n(R.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=n(R.isDebitCardFeatureEnabled),f=st(a,u,x)&&!s&&_e(o?.loggedInUserRoleMap),C=Ze(o?.loggedInUserRoleMap),h=ze(o?.loggedInUserRoleMap);return e.jsxs(xe,{children:[h?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:d,isReimbursementAdminLevelAccess:S,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,isUserHasOnlyBillPayAccess:c,productType:"zeni_treasury",type:"setup"})}),h?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:d,isUserHasOnlyBillPayAccess:c,isReimbursementAdminLevelAccess:S,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(vt,{})}),e.jsx(k,{path:"statements",element:e.jsx(kt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(At,{})}),r?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(z,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),l?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(z,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(z,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(it,{})})]}):i&&l?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{ta as default};