@zeniai/web-app-ui 5.3.43-qa → 5.3.44-qa

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 (146) hide show
  1. package/dist/assets/{AccountMappingScreen-A78kjWMW.js → AccountMappingScreen-B400AyQJ.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-H6FIHzKS.js → ActualMatchingMatchDetailScreen-at2idxY8.js} +1 -1
  3. package/dist/assets/AddressRoutes-Bf2-WRel.js +1 -0
  4. package/dist/assets/{AddressScreen-DbL2JK9V.js → AddressScreen-Cbo3iSD8.js} +2 -2
  5. package/dist/assets/AiCfoScreen-C2YvBVu2.js +22 -0
  6. package/dist/assets/{AppDrawer-B21egTDJ.js → AppDrawer-D0KfLMaT.js} +2 -2
  7. package/dist/assets/{BillPayApprovalRoutes-C0QG7H0A.js → BillPayApprovalRoutes-LmedJ5XD.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-BquhDc0u.js → BillPayRoutes-CDWH4S4C.js} +1 -1
  9. package/dist/assets/{BusinessVerificationPageScreen-DlH1zL57.js → BusinessVerificationPageScreen-BVXryUGP.js} +2 -2
  10. package/dist/assets/{CardsAiCfoScreen-B3hOZl8l.js → CardsAiCfoScreen-CyRzyeQR.js} +2 -2
  11. package/dist/assets/{ChargeCardRoutes-CWYnFFCQ.js → ChargeCardRoutes-00uaD3zR.js} +9 -9
  12. package/dist/assets/CompanyPassportScreen-DSUfEnP2.js +1 -0
  13. package/dist/assets/ConnectionAuthScreen-DlFUg2cH.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-DGrAYURi.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-DZOpRUqN.js → CustomerOnboardingRoutes-CfsElRde.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-BWa2chAm.js → DashboardRoutes-CsjwE5Mt.js} +3 -3
  17. package/dist/assets/{DefaultTenantHome-DLN4EyYk.js → DefaultTenantHome-BmcgKJw_.js} +1 -1
  18. package/dist/assets/DomesticWireDetailScreen-BHofWD_4.js +18 -0
  19. package/dist/assets/DrawerScreen-eoSileBw.js +1 -0
  20. package/dist/assets/EntityDetailRoutes-BTuykNTu.js +1 -0
  21. package/dist/assets/{ExpenseAutomationRoutes-ChA7_dQU.js → ExpenseAutomationRoutes-C41VbCrR.js} +5 -5
  22. package/dist/assets/FeaturePreviewScreen-BAENITNo.js +1 -0
  23. package/dist/assets/HubSpotOAuthCallbackScreen-B57X4QKD.js +1 -0
  24. package/dist/assets/InboxNotificationsProvider-CMdsyY0A.js +1 -0
  25. package/dist/assets/InvoicingRoutes-C6flJIVP.js +2 -0
  26. package/dist/assets/{MagicLinkRoutes-DSIncfO5.js → MagicLinkRoutes-Bo0FAVj9.js} +6 -6
  27. package/dist/assets/MagicLinkSignInScreen-Dusac1BV.js +12 -0
  28. package/dist/assets/MobileAppDrawer-Bm1u6Ken.js +1 -0
  29. package/dist/assets/NotFoundScreen-BHAnIkPW.js +1 -0
  30. package/dist/assets/NotificationRoutes-DxiudUgY.js +1 -0
  31. package/dist/assets/OAuthConsentScreen-yUIZ6DV2.js +1 -0
  32. package/dist/assets/PandLWithForecastRoutes-eu7U2LpI.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-B64FHPQ1.js → PaymentLinkScreen-DiueSn16.js} +7 -7
  34. package/dist/assets/PeopleRoutes-D0lDTK4i.js +22 -0
  35. package/dist/assets/PerformanceRoutes-UIwOxwXM.js +1 -0
  36. package/dist/assets/{Preview-DKbH4DZo.js → Preview-DEgobwYA.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-DSxjIxzn.js → QBOConnectionScreen-Dcslm4FM.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-BkXOBY6f.js → ReimbursementApprovalRoutes-C0yLDyE9.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CgsllBgS.js → ReimbursementApprovalRuleDetailScreen-C95Tlh44.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-BoLFmFGU.js → ReimbursementRoutes-Sdsth_9q.js} +7 -7
  41. package/dist/assets/{ReportsRoutes-CrzZ0bl7.js → ReportsRoutes-DA2ZKfqn.js} +1 -1
  42. package/dist/assets/RewardsRoutes-MCkqCd4q.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-DAsZ0K0d.js → ScheduleDetailsPrepaidExpensesScreen-BinEqncH.js} +5 -5
  44. package/dist/assets/ScreenRoutes-CoBHM0a5.js +2 -0
  45. package/dist/assets/{SettingsRoutes-_eJ2ckP-.js → SettingsRoutes-Cwcsb2Ys.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-Bn2r0Ale.js → SetupPagesScreen-C64hdzmo.js} +5 -5
  47. package/dist/assets/SignInScreen-D-UWxMUC.js +1 -0
  48. package/dist/assets/SignOutScreen-CLMaxTgY.js +9 -0
  49. package/dist/assets/{TaskListScreen-B7cUAwfe.js → TaskListScreen-BBXffRbT.js} +2 -2
  50. package/dist/assets/TaskRoutes-DvNx4Qap.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-Bz8OXpUB.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-C2_EB_46.js → TransactionDetailScreen-DcuSfVKO.js} +2 -2
  53. package/dist/assets/{TransactionListRoutes-DpOuohtl.js → TransactionListRoutes-B_voFmAT.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-DchkL4da.js → TreasuryRoutes-CXgACPbz.js} +6 -6
  55. package/dist/assets/{VendorsRoutes-DVyJDGrt.js → VendorsRoutes-DdY9Fw_b.js} +11 -11
  56. package/dist/assets/WiseConfirmationScreen-BLw9xWiw.js +12 -0
  57. package/dist/assets/{ZeniAccountRoutes-C4eET6j1.js → ZeniAccountRoutes-OVjm5L3x.js} +11 -11
  58. package/dist/assets/ZeniAccountStatementScreen-CJ2iauJ5.js +9 -0
  59. package/dist/assets/{accountMappingHelper-CQrmB6jj.js → accountMappingHelper-Djr6f8Xt.js} +1 -1
  60. package/dist/assets/{analytics-BTvt2K3S.js → analytics-B06OpwA-.js} +1 -1
  61. package/dist/assets/{analyticsHelper-sj9huSc9.js → analyticsHelper-xKlm2_zz.js} +1 -1
  62. package/dist/assets/{core-BwK6FGJd.js → core-Bl4MLhFi.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-iAavL6tS.js → decodeURIComponentSafe-Buybgpqw.js} +1 -1
  64. package/dist/assets/{dnd-Cbdx7tVf.js → dnd-CimhpTrK.js} +1 -1
  65. package/dist/assets/{empty-CTWnX7jn.js → empty-B4WpR10s.js} +1 -1
  66. package/dist/assets/{empty-DbO4voXD.js → empty-BTbLiTP7.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-BdvQlKL1.js → emptyVideoElement-Do1ktOmR.js} +1 -1
  68. package/dist/assets/epic-Ck-sEMUn.js +2 -0
  69. package/dist/assets/expenseAutomationHelper-CkBJgYs_.js +1 -0
  70. package/dist/assets/{getLocaleForTenant-B-DdN2Lw.js → getLocaleForTenant-NAFAfy2t.js} +1 -1
  71. package/dist/assets/{index-Bexws62p.js → index-BKWyG8Iu.js} +1 -1
  72. package/dist/assets/{index-DCOMaDuK.js → index-BXYzwgW0.js} +1 -1
  73. package/dist/assets/{index-SQoDfHg2.js → index-Bmwrrrme.js} +1 -1
  74. package/dist/assets/{index-BhX9D2PW.js → index-CivWMXxp.js} +1 -1
  75. package/dist/assets/{index-DstkpwOZ.js → index-DFR56SYR.js} +2 -2
  76. package/dist/assets/{index-CavSpTx-.js → index-D_qRPRIi.js} +26965 -26965
  77. package/dist/assets/{index-D2_EUTG6.js → index-H-kll8aI.js} +1 -1
  78. package/dist/assets/{index-B_VJsceg.js → index-jyJQzleF.js} +1 -1
  79. package/dist/assets/{lexical-DRfKJLK3.js → lexical-BbBoQdpc.js} +1 -1
  80. package/dist/assets/{liveblocks-y3zMPGKB.js → liveblocks-BXyXenK7.js} +2 -2
  81. package/dist/assets/{lottie-BQlGSG2c.js → lottie-2qUppQdg.js} +1 -1
  82. package/dist/assets/{mui-CxIkaR9n.js → mui-CyP-P4av.js} +1 -1
  83. package/dist/assets/{pathToGoBack-QMp9zrtx.js → pathToGoBack-sGBxvK0B.js} +1 -1
  84. package/dist/assets/{pdf-DGzvSuDl.js → pdf-BENieWk6.js} +4 -4
  85. package/dist/assets/{pdf-lib-Bm6tpkCo.js → pdf-lib-CLkFJB86.js} +1 -1
  86. package/dist/assets/{plaid-CQqwPn97.js → plaid-C0aCR9wu.js} +1 -1
  87. package/dist/assets/{pusher-DpL50lnb.js → pusher-B9dsvvYE.js} +1 -1
  88. package/dist/assets/{react-8Gpe_kpB.js → react-BqELFJJh.js} +1 -1
  89. package/dist/assets/{react-ZBsIhK1t.js → react-BvpkKAe3.js} +1 -1
  90. package/dist/assets/{react-Tycrsh8q.js → react-C4fns4CR.js} +1 -1
  91. package/dist/assets/{react-CwBUDYOl.js → react-DEsZRrdi.js} +1 -1
  92. package/dist/assets/{react-12W2NDka.js → react-DIwVQX4M.js} +1 -1
  93. package/dist/assets/{react-CCyW6CxJ.js → react-Do3Z3oDl.js} +1 -1
  94. package/dist/assets/{recharts-CoAMGh71.js → recharts-CZKBTuPa.js} +1 -1
  95. package/dist/assets/{routePaths-D5zGcGZG.js → routePaths-D20OKXnM.js} +1 -1
  96. package/dist/assets/{sentry-Jm7O5sR0.js → sentry-D4svnzxK.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-nQAZVh5Z.js → stripSplatSuffix-G7yC23v6.js} +1 -1
  98. package/dist/assets/{url-D9zjpdeS.js → url-SRUWz_6t.js} +1 -1
  99. package/dist/assets/{url-B9xXiyVk.js → url-m7LStd7o.js} +1 -1
  100. package/dist/assets/useActualMatchingMatchDetail-DjU1UsXK.js +1 -0
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-B8_gxBhe.js → useAiCfoDashboardSuggestedQuestionsChips-BfYubNz7.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-DYVVwney.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-BZNmvp7i.js → useChargeCardPusherEvents-CLgbV2wJ.js} +1 -1
  104. package/dist/assets/{useDeviceId-DdPl1EVl.js → useDeviceId-4WJY9vuN.js} +1 -1
  105. package/dist/assets/useEmailConnectResultRefresh-fWgBKuNg.js +1 -0
  106. package/dist/assets/{useInitialThreadRequest-BRvCrjqu.js → useInitialThreadRequest-R2hAErYY.js} +1 -1
  107. package/dist/assets/useTaskManagerAccess-Rxke8A9H.js +1 -0
  108. package/dist/assets/{utils-BVIT21dc.js → utils-Bycom664.js} +1 -1
  109. package/dist/assets/{withTransactionSidePanel-tINIzPX1.js → withTransactionSidePanel-rDK0lUVX.js} +2 -2
  110. package/dist/assets/{zeni-epic-state-BugXGzus.js → zeni-epic-state-UM7IPCLf.js} +6 -6
  111. package/dist/index.html +1 -1
  112. package/package.json +3 -3
  113. package/dist/assets/AddressRoutes-NMfqz3GH.js +0 -1
  114. package/dist/assets/AiCfoScreen-DQ-_2zus.js +0 -22
  115. package/dist/assets/CompanyPassportScreen-D55YyxAR.js +0 -1
  116. package/dist/assets/ConnectionAuthScreen-BzzSw1MN.js +0 -11
  117. package/dist/assets/CustomerOnboardingAuthScreen-CBDPd-_k.js +0 -1
  118. package/dist/assets/DomesticWireDetailScreen-Di0HmEb7.js +0 -18
  119. package/dist/assets/DrawerScreen-BKD3lmi2.js +0 -1
  120. package/dist/assets/EntityDetailRoutes-Dkd2Wwk0.js +0 -1
  121. package/dist/assets/FeaturePreviewScreen-DFQePQma.js +0 -1
  122. package/dist/assets/HubSpotOAuthCallbackScreen-Bho75VRj.js +0 -1
  123. package/dist/assets/InboxNotificationsProvider-ozJWRqdQ.js +0 -1
  124. package/dist/assets/InvoicingRoutes-BIJoBfxF.js +0 -2
  125. package/dist/assets/MagicLinkSignInScreen-CEPRWAV6.js +0 -12
  126. package/dist/assets/MobileAppDrawer-Ce8Zx46w.js +0 -1
  127. package/dist/assets/NotFoundScreen-Duy6T6m3.js +0 -1
  128. package/dist/assets/NotificationRoutes-RjDVJiKf.js +0 -1
  129. package/dist/assets/OAuthConsentScreen-CtkoMagm.js +0 -1
  130. package/dist/assets/PandLWithForecastRoutes-GmhxMHoN.js +0 -1
  131. package/dist/assets/PeopleRoutes-ecEzCyKE.js +0 -22
  132. package/dist/assets/PerformanceRoutes-BTYsYwgQ.js +0 -1
  133. package/dist/assets/RewardsRoutes-Bw-VJeWb.js +0 -1
  134. package/dist/assets/ScreenRoutes-BLctPWdO.js +0 -2
  135. package/dist/assets/SignInScreen-CV_GUIAF.js +0 -1
  136. package/dist/assets/SignOutScreen-CJIt_MEN.js +0 -9
  137. package/dist/assets/TaskRoutes-CTl9GKlH.js +0 -9
  138. package/dist/assets/TransactionDetailRoutes-DWBtPRgg.js +0 -1
  139. package/dist/assets/WiseConfirmationScreen-DxziV1eR.js +0 -12
  140. package/dist/assets/ZeniAccountStatementScreen-33Pf07v4.js +0 -9
  141. package/dist/assets/epic-BUtbsU0k.js +0 -2
  142. package/dist/assets/expenseAutomationHelper-MxNxlZNN.js +0 -1
  143. package/dist/assets/useActualMatchingMatchDetail-CxpYQNp7.js +0 -1
  144. package/dist/assets/useAskAiCfoHostNavButtonProps-DQ3F86Nw.js +0 -1
  145. package/dist/assets/useEmailConnectResultRefresh-98UHJ7hj.js +0 -1
  146. package/dist/assets/useTaskManagerAccess-B9_LRJIF.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-y3zMPGKB.js";import{a as d}from"./sentry-Jm7O5sR0.js";import{h as V,g as q,u as R,i as N,j as C,l as H,n as J,o as k}from"./core-BwK6FGJd.js";import{fE as w,Za as Pe,Np as ve,YK as we,YT as Ae,c8 as X,cT as De,cU as Ue,bq as Re,dd as Me,FO as Te,Zb as _e,OS as Be,Mg as Ze,M7 as de,M4 as Fe,FS as ue,Ma as pe,Md as ge,Mj as W,C2 as ee,FR as Oe,lt as $,lw as me,Zc as Ve,mG as Ne,G8 as Le,Vq as Ge,Vr as $e,lr as qe,Zd as He,lu as Ke,uz as ze,Vl as Ye,Vm as Je,uD as Qe,hU as Xe,Uk as Y,hM as ae,hJ as We,hR as en,Ul as nn,G5 as tn,Ze as an,Zf as on,Mx as sn,l_ as rn,dY as fe,dZ as he,Zg as ln,gB as cn,UA as dn,G4 as oe,gG as se,gF as un,G3 as pn,gE as gn,gD as mn,Zh as fn,TM as Ce,Zi as hn,Zj as Cn,Zk as Sn,Zl as yn,Zm as bn,Zn as In,Gb as xn,Zo as En,G2 as ie,FY as G,Zp as kn,Zq as jn,Zr as re,Zs as Pn,dR as vn,Zt as wn,Zu as An,Zv as Dn,TY as Un,c0 as Rn,c7 as Mn,c6 as Tn,c1 as _n,Zw as Bn,c4 as Zn,c3 as Fn,c5 as On,c2 as Vn}from"./zeni-epic-state-BugXGzus.js";import{bS as Nn,z as v,U as L,a7 as ne,c2 as Ln,k as K,O as te,c as F,g as Se,N as ye,c3 as Gn,j as $n,X as be,c4 as qn,ai as Hn,c5 as Kn,c6 as zn,aq as Yn,c7 as Jn,p as Qn,d as Ie,c8 as Xn}from"./index-CavSpTx-.js";import{n as B}from"./mui-CxIkaR9n.js";import{u as xe}from"./useTaskManagerAccess-B9_LRJIF.js";import{U as Wn}from"./AccountMappingScreen-A78kjWMW.js";import{t as et,A as nt}from"./AddressScreen-DbL2JK9V.js";import O from"./NotFoundScreen-Duy6T6m3.js";import{g as tt}from"./analyticsHelper-sj9huSc9.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-DlH1zL57.js";import{C as st}from"./CompanyPassportScreen-D55YyxAR.js";import{M as T}from"./MobileAppDrawer-Ce8Zx46w.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-98UHJ7hj.js";import{q as le}from"./QBOConnectionScreen-DSxjIxzn.js";import{B as lt}from"./BillPayApprovalRoutes-C0QG7H0A.js";import{R as ct}from"./ReimbursementApprovalRoutes-BkXOBY6f.js";import"./recharts-CoAMGh71.js";import"./analytics-BTvt2K3S.js";import"./plaid-CQqwPn97.js";import"./dnd-Cbdx7tVf.js";import"./stripe-cKAAJElX.js";import"./lottie-BQlGSG2c.js";import"./lexical-DRfKJLK3.js";import"./pdf-DGzvSuDl.js";import"./utils-BVIT21dc.js";import"./accountMappingHelper-CQrmB6jj.js";import"./routePaths-D5zGcGZG.js";import"./InboxNotificationsProvider-ozJWRqdQ.js";import"./empty-CTWnX7jn.js";import"./pdf-lib-Bm6tpkCo.js";import"./index-SQoDfHg2.js";import"./url-D9zjpdeS.js";import"./index-D2_EUTG6.js";import"./decodeURIComponentSafe-iAavL6tS.js";import"./ReimbursementApprovalRuleDetailScreen-CgsllBgS.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="fcac6c0d-3dd7-4f92-8d97-ad4f1d2979b1",e._sentryDebugIdIdentifier="sentry-dbid-fcac6c0d-3dd7-4f92-8d97-ad4f1d2979b1")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-BXyXenK7.js";import{a as d}from"./sentry-D4svnzxK.js";import{h as O,g as H,u as _,i as N,j as C,l as q,n as Q,o as k}from"./core-Bl4MLhFi.js";import{fE as w,Zc as Pe,Nr as ve,YM as we,YV as Ae,c8 as W,cT as De,cU as Ue,bq as _e,dd as Me,FQ as Re,Zd as Te,OU as Be,Mi as Ze,M9 as de,M6 as Fe,FU as ue,Mc as pe,Mf as ge,Ml as X,C4 as ee,FT as Ve,lt as $,lw as me,Ze as Oe,mG as Ne,Ga as Le,Vs as Ge,Vt as $e,lr as He,Zf as qe,lu as Ke,uz as ze,Vn as Je,Vo as Qe,uD as Ye,hU as We,Um as J,hM as ae,hJ as Xe,hR as en,Un as nn,G7 as tn,Zg as an,Zh as on,Mz as sn,l_ as rn,dY as fe,dZ as he,Zi as ln,gB as cn,UC as dn,G6 as oe,gG as se,gF as un,G5 as pn,gE as gn,gD as mn,Zj as fn,TO as Ce,Zk as hn,Zl as Cn,Zm as yn,Zn as Sn,Zo as bn,Zp as In,Gd as xn,Zq as En,G4 as ie,F_ as G,Zr as kn,Zs as jn,Zt as re,Zu as Pn,dR as vn,Zv as wn,Zw as An,Zx as Dn,T_ as Un,c0 as _n,c7 as Mn,c6 as Rn,c1 as Tn,Zy as Bn,c4 as Zn,c3 as Fn,c5 as Vn,c2 as On}from"./zeni-epic-state-UM7IPCLf.js";import{bS as Nn,z as v,U as L,a7 as ne,c2 as Ln,k as K,N as te,d as F,h as ye,J as Se,c3 as Gn,j as $n,Z as be,c4 as Hn,ai as qn,c5 as Kn,c6 as zn,aq as Jn,c7 as Qn,p as Yn,e as Ie,c8 as Wn}from"./index-D_qRPRIi.js";import{n as B}from"./mui-CyP-P4av.js";import{u as xe}from"./useTaskManagerAccess-Rxke8A9H.js";import{U as Xn}from"./AccountMappingScreen-B400AyQJ.js";import{t as et,A as nt}from"./AddressScreen-Cbo3iSD8.js";import V from"./NotFoundScreen-BHAnIkPW.js";import{g as tt}from"./analyticsHelper-xKlm2_zz.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-BVXryUGP.js";import{C as st}from"./CompanyPassportScreen-DSUfEnP2.js";import{M as R}from"./MobileAppDrawer-Bm1u6Ken.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-fWgBKuNg.js";import{q as le}from"./QBOConnectionScreen-Dcslm4FM.js";import{B as lt}from"./BillPayApprovalRoutes-LmedJ5XD.js";import{R as ct}from"./ReimbursementApprovalRoutes-C0yLDyE9.js";import"./recharts-CZKBTuPa.js";import"./analytics-B06OpwA-.js";import"./plaid-C0aCR9wu.js";import"./dnd-CimhpTrK.js";import"./stripe-cKAAJElX.js";import"./lottie-2qUppQdg.js";import"./lexical-BbBoQdpc.js";import"./pdf-BENieWk6.js";import"./utils-Bycom664.js";import"./accountMappingHelper-Djr6f8Xt.js";import"./routePaths-D20OKXnM.js";import"./InboxNotificationsProvider-CMdsyY0A.js";import"./empty-B4WpR10s.js";import"./pdf-lib-CLkFJB86.js";import"./index-Bmwrrrme.js";import"./url-SRUWz_6t.js";import"./index-H-kll8aI.js";import"./decodeURIComponentSafe-Buybgpqw.js";import"./ReimbursementApprovalRuleDetailScreen-C95Tlh44.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="de5a5311-2f40-4caa-af94-97a6eb42f372",e._sentryDebugIdIdentifier="sentry-dbid-de5a5311-2f40-4caa-af94-97a6eb42f372")}catch{}})();const dt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-y3zMPGKB.js";import{a as d}from"./sentry-Jm7O5sR
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ut=H((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(X(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Ln),pt=()=>{const e=V(),l=q(),o=R(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>Pe(g))),{isApprovalRulesV3Enabled:y,isLoading:m}=Nn(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=L();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,y)))}),[t,u,m,y,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
9
+ `,ut=q((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(W(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Ln),pt=()=>{const e=O(),l=H(),o=_(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>Pe(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=Nn(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=L();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-y3zMPGKB.js";import{a as d}from"./sentry-Jm7O5sR
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,mt=H((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:_e(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(W(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Fe(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ze(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=V(),l=q(),o=R(),{tenantEmailDomain:i}=N(),r=L(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(F.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(F.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,y]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),b=De(m,r?.loggedInUserRoleMap),E=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Re(m.userRole),P=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,j=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,M=Se(m,t,s),D=Me(m,r?.loggedInUserRoleMap)&&M,{isCardsHidden:I}=ye(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(y(!0),o(Te(!1)))}),[h,o,p]);const _=A=>{u(A)};return b||P||E||D?a.jsxs(gt,{children:[a.jsx(T,{isAppContentDrawerOpen:c,handleDrawerToggle:_}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:P,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:j,onClickMenuIcon:()=>{_(!0)}})]}):a.jsx(O,{})},ht=B.div`
17
+ `,mt=q((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Te(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(X(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Fe(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ze(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=O(),l=H(),o=_(),{tenantEmailDomain:i}=N(),r=L(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(F.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(F.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),b=De(m,r?.loggedInUserRoleMap),E=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&_e(m.userRole),P=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,j=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,M=ye(m,t,s),D=Me(m,r?.loggedInUserRoleMap)&&M,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Re(!1)))}),[h,o,p]);const T=A=>{u(A)};return b||P||E||D?a.jsxs(gt,{children:[a.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:T}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:P,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:j,onClickMenuIcon:()=>{T(!0)}})]}):a.jsx(V,{})},ht=B.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-y3zMPGKB.js";import{a as d}from"./sentry-Jm7O5sR
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Ct=H((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Ve(e,o),{uiState:t}=n,s=(X(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(W(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(Ke(n))},updateCardPaymentModalState:n=>{e(He({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(qe(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Le(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Ne({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(qn),St=()=>{const e=V(),l=q(),o=R(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((j=>w(j))),y=C((j=>j.cardPaymentViewState)),m=C((j=>j.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(y.addCardPaymentSourceStatus.fetchState),b=y.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=L();d.useEffect((()=>{E!=null&&o(Oe(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o($()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o($())}),[p,b]);const P=j=>{n(j)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:P}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{P(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},Q="external_integrations",yt=H((function(e){const l=Je(e,Q);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,Y("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const y="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(y)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(We(t,s,Y(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Xe(t,Y("payments"),s))},onNotifyMe:s=>{K.trackIntegrationsNotifyMeClicked("Settings",s),e(Qe(Q,s,r))}}}))(Kn),bt=()=>{const e=Hn(),l=V(),o=R(),{tenantEmailDomain:i}=N(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),y=L(),m=X(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(Q))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o($()))}),[p,o]);const E=I=>{t(I)},g=C((I=>Ye(I,u))),P=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:j,onAddPlaidAccount:M,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return y?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(T,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(yt,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:j,onAddPlaidAccount:M,onReLoginPlaidAccount:D,plaidConnectionDetails:P})]}):a.jsx(ne,{fetchState:s})},It=B.div`
25
+ `,Ct=q((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Oe(e,o),{uiState:t}=n,s=(W(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:K}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(X(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(Ke(n))},updateCardPaymentModalState:n=>{e(qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(He(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Le(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Ne({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=O(),l=H(),o=_(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((j=>w(j))),S=C((j=>j.cardPaymentViewState)),m=C((j=>j.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=L();d.useEffect((()=>{E!=null&&o(Ve(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o($()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o($())}),[p,b]);const P=j=>{n(j)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:P}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{P(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},Y="external_integrations",St=q((function(e){const l=Qe(e,Y);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,J("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Xe(t,s,J(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(We(t,J("payments"),s))},onNotifyMe:s=>{K.trackIntegrationsNotifyMeClicked("Settings",s),e(Ye(Y,s,r))}}}))(Kn),bt=()=>{const e=qn(),l=O(),o=_(),{tenantEmailDomain:i}=N(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),S=L(),m=W(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(Y))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o($()))}),[p,o]);const E=I=>{t(I)},g=C((I=>Je(I,u))),P=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:j,onAddPlaidAccount:M,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:j,onAddPlaidAccount:M,onReLoginPlaidAccount:D,plaidConnectionDetails:P})]}):a.jsx(ne,{fetchState:s})},It=B.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -38,7 +38,7 @@ import{j as a}from"./liveblocks-y3zMPGKB.js";import{a as d}from"./sentry-Jm7O5sR
38
38
  flex-direction: column;
39
39
  align-items: center;
40
40
  background-color: ${e=>e.theme.colors.grey4};
41
- `,Et=()=>{const e=R(),{tenantEmailDomain:l}=N(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),y=d.useCallback((p=>{e(W(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(T,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:y,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
41
+ `,Et=()=>{const e=_(),{tenantEmailDomain:l}=N(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(X(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(R,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
42
42
  display: flex;
43
43
  height: 100%;
44
44
  width: 100%;
@@ -46,4 +46,4 @@ import{j as a}from"./liveblocks-y3zMPGKB.js";import{a as d}from"./sentry-Jm7O5sR
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,ce=({appContent:e})=>{const l=R(),o=V(),i=q(),[r,n]=d.useState(!1),t=C((S=>w(S))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:y}=u(F.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(F.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((S=>rn(S))),E=fe(t),g=he(m,t),P=!g&&b,j=Se(t,y,m),{isCardsHidden:M}=ye(t?.tenantId),D=!j||M,{areTenantIdsInSync:I}=Yn();d.useEffect((()=>{I&&l(ln(c,P))}),[c,l,P,I]);const x=C((S=>cn(S,P))),_=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=S=>{n(S)};return a.jsxs(kt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Jn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{U(!0)},isLoading:_,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:S=>{const Z=(function(ke,je){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${je}`),z})(s,S),Ee=Qn(i.state?.pathnameStackToGoBack,i.pathname);o(Z,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:S=>{const Z={...x.myProfileLocalData,phone:S};l(oe({localData:Z})),l(mn(S,"MyProfile"))},onResendOtp:S=>{l(gn(S,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(S,Z)=>{l(un(S,Z,"MyProfile"))},onVerifyOtpSuccess:S=>{S!=null&&v.saveZeniOtpToken(S),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:S=>{l(oe({localData:S}))}})]})};function jt(){const e=R(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>Sn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:y}=xe(u),[m,p]=d.useState(!1),b=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(yn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(bn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),P=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const j=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),M=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,S)=>{e(jn({eventId:f,channel:re(U),enabled:S}))}),[e]),I=d.useCallback(((f,U)=>{e(Pn({groupId:f,frequency:vn(U)}))}),[e]),x=d.useCallback(((f,U,S)=>{e(wn({groupId:f,channel:re(U),enabled:S}))}),[e]),_=d.useMemo((()=>{if(y&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[y,h,t,s,D,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(Dn()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(T,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Xn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:P,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:j,resetUpdateStatus:M,taskNotifications:_,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>w(b))),n=L(),t=Ie(),s=R(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(F.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),y=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||y!==!0?Rn(r)?a.jsxs(J,{children:[Mn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Wn,{})}),Tn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),_n(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Zn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Fn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),On(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(St,{})}),Vn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),y&&a.jsx(k,{path:"notifications",element:a.jsx(jt,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]}):a.jsx(J,{children:a.jsx(k,{path:"*",element:a.jsx(O,{})})}):null}function Pt(e){return a.jsxs(J,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(O,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]})}export{da as default};
49
+ `,ce=({appContent:e})=>{const l=_(),o=O(),i=H(),[r,n]=d.useState(!1),t=C((y=>w(y))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(F.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(F.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),P=!g&&b,j=ye(t,S,m),{isCardsHidden:M}=Se(t?.tenantId),D=!j||M,{areTenantIdsInSync:I}=Jn();d.useEffect((()=>{I&&l(ln(c,P))}),[c,l,P,I]);const x=C((y=>cn(y,P))),T=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Qn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{U(!0)},isLoading:T,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const Z=(function(ke,je){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${je}`),z})(s,y),Ee=Yn(i.state?.pathnameStackToGoBack,i.pathname);o(Z,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const Z={...x.myProfileLocalData,phone:y};l(oe({localData:Z})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,Z)=>{l(un(y,Z,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&v.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function jt(){const e=_(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),b=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(bn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),P=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const j=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),M=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,y)=>{e(jn({eventId:f,channel:re(U),enabled:y}))}),[e]),I=d.useCallback(((f,U)=>{e(Pn({groupId:f,frequency:vn(U)}))}),[e]),x=d.useCallback(((f,U,y)=>{e(wn({groupId:f,channel:re(U),enabled:y}))}),[e]),T=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,D,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(Dn()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(R,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Wn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:P,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:j,resetUpdateStatus:M,taskNotifications:T,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>w(b))),n=L(),t=Ie(),s=_(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(F.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?_n(r)?a.jsxs(Q,{children:[Mn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Xn,{})}),Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Tn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Zn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Fn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Vn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),On(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(jt,{})}),a.jsx(k,{path:"*",element:a.jsx(V,{})})]}):a.jsx(Q,{children:a.jsx(k,{path:"*",element:a.jsx(V,{})})}):null}function Pt(e){return a.jsxs(Q,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(V,{})}),a.jsx(k,{path:"*",element:a.jsx(V,{})})]})}export{da as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-y3zMPGKB.js";import{h as X,g as Q,u as ee,i as W,j as v,N as j,l as G,t as Qe}from"./core-BwK6FGJd.js";import{bJ as en,fE as F,cG as nn,HD as $,YK as tn,YN as an,uS as ne,uG as te,my as ae,BA as R,YP as Ce,gF as Ye,gE as We,gD as Ge,YQ as sn,HM as on,Mg as he,M7 as Ie,M4 as Ae,LO as J,Ma as _e,Md as ke,Mj as ve,C2 as Pe,gZ as cn,cB as rn,dZ as un,dY as dn,dh as ln,bt as pn,cu as Fe,YR as mn,KO as de,Lq as yn,YS as fn,bK as gn,NB as le,Np as Sn,YT as bn,YU as Cn,NF as hn,NJ as In,YV as je,Bt as An,S5 as _n,Of as be,P4 as pe,YW as kn,YX as vn,YY as Pn,YZ as He,Y_ as Tn,V9 as En,X$ as Dn,Vo as Un,Y$ as Ke,LS as On,Vp as wn,LW as Fn,Z0 as we,Op as qe,mG as Vn,uJ as Je,BC as xn,bE as Ne,BO as Re,cE as Bn,Z1 as Xe,NY as jn,NZ as Nn,O1 as Rn,Z2 as Ln,Oi as Le,Z3 as Mn,Z4 as zn,Z5 as Zn,Z6 as $n,gU as Yn,IX as Wn,Z7 as Gn,J0 as Hn,I$ as Kn}from"./zeni-epic-state-BugXGzus.js";import{ai as Te,U as ie,O as me,c as q,E as Ee,z as E,a8 as se,k as D,a7 as De,T as Y,bP as qn,ae as oe,bQ as V,bi as Ve,bR as Jn,bS as Xn,bT as Qn,o as Be,bU as et,p as Me,aG as ze,a1 as nt,ab as tt,bV as at,bW as it,bX as st,w as ot}from"./index-CavSpTx-.js";import{a as h}from"./sentry-Jm7O5sR0.js";import{n as xe,D as ct,S as rt}from"./mui-CxIkaR9n.js";import{u as ut,B as Oe}from"./BusinessVerificationPageScreen-DlH1zL57.js";import{M as ye}from"./MobileAppDrawer-Ce8Zx46w.js";import N from"./NotFoundScreen-Duy6T6m3.js";import{a as Ze}from"./analyticsHelper-sj9huSc9.js";import{d as $e}from"./routePaths-D5zGcGZG.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]="2d5edab0-1dc6-408e-9a0b-71c6f98aeb8f",e._sentryDebugIdIdentifier="sentry-dbid-2d5edab0-1dc6-408e-9a0b-71c6f98aeb8f")}catch{}})();const dt=xe.div`
1
+ import{j as u}from"./liveblocks-BXyXenK7.js";import{h as Q,g as X,u as ee,i as W,j as v,N as j,l as G,t as Xe}from"./core-Bl4MLhFi.js";import{bJ as en,fE as F,cG as nn,HF as $,YM as tn,YP as an,uS as ne,uG as te,my as ae,BC as R,YR as Ce,gF as Ye,gE as We,gD as Ge,YS as sn,HO as on,Mi as he,M9 as Ie,M6 as Ae,LQ as J,Mc as _e,Mf as ke,Ml as ve,C4 as Pe,gZ as cn,cB as rn,dZ as un,dY as dn,dh as ln,bt as pn,cu as Fe,YT as mn,KQ as de,Ls as yn,YU as fn,bK as gn,ND as le,Nr as Sn,YV as bn,YW as Cn,NH as hn,NL as In,YX as je,Bv as An,S7 as _n,Oh as be,P6 as pe,YY as kn,YZ as vn,Y_ as Pn,Y$ as He,Z0 as Tn,Vb as En,Y1 as Dn,Vq as Un,Z1 as qe,LU as wn,Vr as On,LY as Fn,Z2 as Oe,Or as Ke,mG as Vn,uJ as Je,BE as xn,bE as Ne,BQ as Re,cE as Bn,Z3 as Qe,N_ as jn,N$ as Nn,O3 as Rn,Z4 as Ln,Ok as Le,Z5 as Mn,Z6 as zn,Z7 as Zn,Z8 as $n,gU as Yn,IZ as Wn,Z9 as Gn,J2 as Hn,J1 as qn}from"./zeni-epic-state-UM7IPCLf.js";import{ai as Te,U as ie,N as me,d as K,c as Ee,z as E,a8 as se,k as D,a7 as De,S as Y,bP as Kn,ae as oe,bQ as V,bi as Ve,bR as Jn,bS as Qn,bT as Xn,o as Be,bU as et,p as Me,aG as ze,a1 as nt,ab as tt,bV as at,bW as it,bX as st,w as ot}from"./index-D_qRPRIi.js";import{a as h}from"./sentry-D4svnzxK.js";import{n as xe,D as ct,S as rt}from"./mui-CyP-P4av.js";import{u as ut,B as we}from"./BusinessVerificationPageScreen-BVXryUGP.js";import{M as ye}from"./MobileAppDrawer-Bm1u6Ken.js";import N from"./NotFoundScreen-BHAnIkPW.js";import{a as Ze}from"./analyticsHelper-xKlm2_zz.js";import{d as $e}from"./routePaths-D20OKXnM.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]="7e95a5e2-e56a-4464-ac57-403eaa98a834",e._sentryDebugIdIdentifier="sentry-dbid-7e95a5e2-e56a-4464-ac57-403eaa98a834")}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-y3zMPGKB.js";import{h as X,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=G((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(J(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(Ge(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(We(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(Ye(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]))}}}))(qn),pt=()=>{const e=Te(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=en(n?.loggedInUserRoleMap),{useFeatureGate:l}=me(),{isFeatureEnabled:s}=l(q.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(q.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(Y.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,Yt=e=>`/${e}/cards`,Wt=e=>`/${e}/cards/setup`,Gt=e=>`/${e}/cards/onboard`,Ht=(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)),qt=(e,o,a)=>!e||!o||a.fetchState==="Completed",mt=(e,o,a,t)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:a,isCreditCardEnabled:t}),Jt=(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,Xt=(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=G((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(J(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(J(t,"charge_cards")):i===!0&&c===!1&&e(J(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))}}}))(Jn),St=()=>{const e=Te(),o=X(),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(q.isDebitCardFeatureEnabled),{isFeatureEnabled:_}=s(q.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(q.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=s(q.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,H]=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=>{H(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(Y.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=G((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(J(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(Ge(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(We(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(Ye(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=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=W(),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(Y.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,Yt=e=>`/${e}/cards`,Wt=e=>`/${e}/cards/setup`,Gt=e=>`/${e}/cards/onboard`,Ht=(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},qt=(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}),Jt=(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,Qt=(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,Xt=(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=G((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(J(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(J(t,"charge_cards")):i===!0&&c===!1&&e(J(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))}}}))(Jn),St=()=>{const e=Te(),o=Q(),a=X(),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(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),O=Fe(n?.loggedInUserRoleMap),[ce,H]=h.useState(!1),[q,re]=h.useState(!1),Z=v((L=>L.chargeCardSetupViewState.fetchState)),B=E.getSignedInUserTenant(r)?.companyId??i.companyId,w=E.getSignedInUser(),Ue=L=>{H(L)},fe=v((L=>mn(L,B)));if(w==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{q||Z!=="Not-Started"||B==null?q||Z!=="Completed"||B==null||i.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(de(B,!1,!0)):(re(!0),t(de(B,!0)))}),[q,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(Y.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:O})]}):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-y3zMPGKB.js";import{h as X,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=G((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(J(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=X(),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}=Xn(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(Y.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=G((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:H,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:H,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(Je(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onResendOtp:s=>{e(We(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(Ye(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(Vn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(qe())},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=X(),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=He(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(Y.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return U.trackPageLoaded(Y.Event.reimbursementBusinessVerification);default:return U.trackPageLoaded(Y.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=G((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=Xe(e,t),c=He(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(J(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(qe())},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=X(),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=>Xe(O,w))),H=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"||H||B||!a.pathname.includes("setup")||p(!0)}),[A,H,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:H,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Pt=xe(rt)`
17
+ `,Ct=G((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(J(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))}}}))(Xn),ht=()=>{const e=Te(),o=Q(),a=X(),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}=Qn(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(Y.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=G((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"?qe(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:O,transactionVolume:ce,transactionVolumeDescription:H,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:B,usNexus:w,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:O,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:H,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:B,usNexus:w,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(Je(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onResendOtp:s=>{e(We(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(Ye(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(Vn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=On(s.documentType);c!=null&&e(Fn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(wn({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))}}}))(et),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=Q(),r=X(),n=ee(),[i]=Xe(),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=He(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(Y.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return U.trackPageLoaded(Y.Event.reimbursementBusinessVerification);default:return U.trackPageLoaded(Y.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=G((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=Qe(e,t),c=He(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,_=qe(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(J(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(Oe())}}}))(at),vt=()=>{const e=Te(),o=Q(),a=X(),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((w=>w.treasurySetupViewState.fetchState)),U=v((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),M=v((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),x=v((w=>w.treasuryDetailState.transactionsState?.fetchState)),z=v((w=>F(w))),O=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=v((w=>Qe(w,O))),H=ce.isAtomicAccountExists,q=E.getSignedInUser(),re=w=>{d(w)};if(q==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||A!=="Not-Started"||O==null||(f(!0),t(be(O,!0,!1)))}),[y,A,O,t]),h.useEffect((()=>{P||U!=="Not-Started"||O==null||(b(!0),t(jn()))}),[P,U,O,t]),h.useEffect((()=>{m||M!=="Not-Started"||O==null||(C(!0),t(Nn()))}),[m,M,O,t]),h.useEffect((()=>{k||x!=="Not-Started"||O==null||(T(!0),t(Rn(!0)))}),[k,x,O,t]);const Z=z.companyTreasuryInfo?.info?.businessVerificationStatus?.code,B=Z==="pending_review"||Z==="verified";return h.useEffect((()=>{c||A!=="Completed"||H||B||!a.pathname.includes("setup")||p(!0)}),[A,H,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(Oe()),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:w=>w.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Oe()),o("../setup")}})})}),u.jsx(kt,{navigate:o,location:a,companyId:O,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:_.maxInsuredAmount,isAllocationDone:H,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=G((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(J(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=X(),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(Y.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=G((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(J(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=Q(),a=X(),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(Y.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-y3zMPGKB.js";import{h as X,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=G((function(e,o){const a=F(e),t=E.getSignedInUser(),r=a.tenantId,n={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""};return{internationalOnboardingDetails:Gn(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(Hn(o.companyId))},onCancelClick:()=>{a("../setup")},updateFilesEntity:t=>{e(ae({files:t}))},onDeleteFile:t=>{e(te(t))},onDeleteFileList:t=>{e(Je(t))},onEditFileName:(t,r)=>{e(ne(t,r.split(".")[0]))}}}))(st),Ot=()=>{const e=X(),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(q.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=>Yn(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(Y.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=G((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,Xt as a,ea as b,yt as c,ft as d,mt as e,aa as f,Ht as g,Yt as h,Jt as i,Qt as j,ia as k,qt as l,Kt as m,Wt as n,Gt as o,$t as p,sa as s};
29
+ `,Ut=G((function(e,o){const a=F(e),t=E.getSignedInUser(),r=a.tenantId,n={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""};return{internationalOnboardingDetails:Gn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:D}}),(function(e,o){const{navigate:a}=o;return{onFormDataChange:t=>{e(qn(t))},onSubmitClick:()=>{e(Hn(o.companyId))},onCancelClick:()=>{a("../setup")},updateFilesEntity:t=>{e(ae({files:t}))},onDeleteFile:t=>{e(te(t))},onDeleteFileList:t=>{e(Je(t))},onEditFileName:(t,r)=>{e(ne(t,r.split(".")[0]))}}}))(st),wt=()=>{const e=Q(),o=X(),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(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=>Yn(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(Y.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}})},Ot=G((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(we,{productType:s}):a?u.jsx(j,{to:"../"}):u.jsx(N,{});case"international-wire":return o?u.jsx(wt,{}):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(we,{productType:s}):u.jsx(N,{}):t?u.jsx(ht,{}):u.jsx(N,{});case"zeni_accounts":return c==="verification"?r?u.jsx(we,{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(we,{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(Ot,{...e,companyId:a,...t})}export{na as A,ta as P,oa as S,Qt as a,ea as b,yt as c,ft as d,mt as e,aa as f,Ht as g,Yt as h,Jt as i,Xt as j,ia as k,Kt as l,qt as m,Wt as n,Gt as o,$t as p,sa as s};
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-BXyXenK7.js";import{a as u,R as x,q as A}from"./sentry-D4svnzxK.js";import{u as z,h as D,j as l,g as M,N as j,l as P}from"./core-Bl4MLhFi.js";import{u as O,z as s,c as F,k as w,G as N,Q as _,S as B,T as $,X as V,Y as q,Z as v}from"./index-D_qRPRIi.js";import{fE as J,TK as K,U2 as Q,gh as R,gj as W,U7 as G,gT as H,di as X,U8 as U,U9 as Y,Ua as Z,b$ as y}from"./zeni-epic-state-UM7IPCLf.js";import"./mui-CyP-P4av.js";import{u as ee}from"./useDeviceId-4WJY9vuN.js";import{f as te}from"./analyticsHelper-xKlm2_zz.js";import{t as ne}from"./getLocaleForTenant-NAFAfy2t.js";import"./recharts-CZKBTuPa.js";import"./analytics-B06OpwA-.js";import"./plaid-C0aCR9wu.js";import"./dnd-CimhpTrK.js";import"./stripe-cKAAJElX.js";import"./lottie-2qUppQdg.js";import"./lexical-BbBoQdpc.js";import"./pdf-BENieWk6.js";import"./utils-Bycom664.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]="818aba5f-f4fb-413b-9cd8-750977e5f82d",t._sentryDebugIdIdentifier="sentry-dbid-818aba5f-f4fb-413b-9cd8-750977e5f82d")}catch{}})();const ie=P((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(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(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(Y(n,a)))},clearSignInError:()=>{t(U())}}}))(q),ae=x.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=O(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:b,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=>J(e))),I=l((e=>K(e))),m=M(),E=F().mode,C=m.state?.magicLinkExpired,T=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.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(Q(I.tenantsInOrder),o.zeniSessionId),R(o.userId,o.zeniSessionId,r.tenantId),i(W(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),N.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),H().then((()=>{const e=V();e!=null&&_(e)})),setTimeout((()=>{w.trackLogin(B.Event.loginSuccess,o.authProvider??"google",X(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 f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!T,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&k!=null?f.jsx($,{onClose:()=>i(U()),unlockDate:k}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-BXyXenK7.js";import{a as i}from"./sentry-D4svnzxK.js";import{u as f,g as l,N as u}from"./core-Bl4MLhFi.js";import{z as n,k as a,S as m,a7 as p}from"./index-D_qRPRIi.js";import{gW as g,Uo as y}from"./zeni-epic-state-UM7IPCLf.js";import{n as b}from"./mui-CyP-P4av.js";import"./recharts-CZKBTuPa.js";import"./analytics-B06OpwA-.js";import"./plaid-C0aCR9wu.js";import"./dnd-CimhpTrK.js";import"./stripe-cKAAJElX.js";import"./lottie-2qUppQdg.js";import"./lexical-BbBoQdpc.js";import"./pdf-BENieWk6.js";import"./utils-Bycom664.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a53797a8-91e3-4d0c-93be-d47a37c15cf6",e._sentryDebugIdIdentifier="sentry-dbid-a53797a8-91e3-4d0c-93be-d47a37c15cf6")}catch{}})();function N(){const e=f(),t=l(),o=i.useRef(!1),c=n.isSignedIn(),r=t.state?.message==="logout"||c;return i.useEffect((()=>{if(r&&!o.current){o.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[r,e]),r?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.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: ${e=>e.theme.colors.grey4};
9
+ `;export{N as default};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-y3zMPGKB.js";import{a as f}from"./sentry-Jm7O5sR0.js";import{h as pa,u as Ta,g as fa,k as ga,j as F,i as _a,l as ma}from"./core-BwK6FGJd.js";import{aK as Da,aL as ba,z as x,O as Sa,c as G,as as Ea,a8 as ha,k as ya,T as Aa,e7 as Ca,p as R,a4 as Ga}from"./index-CavSpTx-.js";import{fE as Ia,a1R as H,QT as B,a1S as J,a1N as Ba,Qf as M,a1T as Ka,Qn as W,PZ as va,PB as La,QU as V,a1U as q,gg as wa,QK as Ra,QP as Ua,QC as Pa,QA as X,QQ as Fa,Qx as ja,a1V as xa,a1W as Oa,a1X as Na,a1Y as Qa,a1Z as I,dw as $a,dv as Za,a1_ as za,PW as Ma}from"./zeni-epic-state-BugXGzus.js";import{n as Wa}from"./mui-CxIkaR9n.js";import{u as Va}from"./useAskAiCfoHostNavButtonProps-DQ3F86Nw.js";import{M as qa}from"./MobileAppDrawer-Ce8Zx46w.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]="2f1e33e4-c7c4-47dd-9aba-0f6ea75fa494",e._sentryDebugIdIdentifier="sentry-dbid-2f1e33e4-c7c4-47dd-9aba-0f6ea75fa494")}catch{}})();const d={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"},Xa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),Ya=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),U=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Ha=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 o={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(o.is_private=a.is_private),U(a.assignees)&&(o.assignees=a.assignees),U(a.direct_assignees)&&(o.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(o.created_by=a.created_by),U(a.task_group_ids)&&(o.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(o.name=a.name),typeof a.parent_task_id=="string"&&(o.parent_task_id=a.parent_task_id),o},Ja=e=>{if(e==null||typeof e!="object")return null;const a=e;return U(a.task_ids)?{task_ids:a.task_ids}:null},pe=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},ae=e=>{const{events:a,onEvent:n,onSubscribed:o}=e,i=Da(),g=f.useRef(n),l=f.useRef(o),_=f.useRef(0);f.useEffect((()=>{g.current=n}),[n]),f.useEffect((()=>{l.current=o}),[o]);const t=f.useMemo((()=>[...a].sort().join("|")),[a]);f.useEffect((()=>{if(i==null||a.length===0)return;const s=[],p=new Set,S=()=>{if(l.current==null)return;const m=Date.now();m-_.current<5e3||(_.current=m,l.current())};return a.forEach((m=>{const[D,b]=ba(m);if(b==="")return;const h=i.channel(D),y=T=>{g.current(b,T)};let k;if(h?.subscribed===!0){if(k=h,k.bind(b,y),!p.has(D)){p.add(D),S();const T=()=>{S()};k.bind("pusher:subscription_succeeded",T),s.push((()=>{k.unbind("pusher:subscription_succeeded",T)}))}s.push((()=>{h.unbind(b,y)}))}else{if(k=h??i.subscribe(D),k.bind(b,y),!p.has(D)){p.add(D);const T=()=>{S()};k.bind("pusher:subscription_succeeded",T),s.push((()=>{k.unbind("pusher:subscription_succeeded",T)}))}s.push((()=>{k.unbind(b,y)}))}})),()=>{s.forEach((m=>m()))}}),[i,t])},ee=Wa.div`
1
+ import{j as C}from"./liveblocks-BXyXenK7.js";import{a as f}from"./sentry-D4svnzxK.js";import{h as pa,u as Ta,g as fa,k as ga,j as F,i as _a,l as ma}from"./core-Bl4MLhFi.js";import{aK as Da,aL as ba,z as $,N as Sa,d as G,as as Ea,a8 as ha,k as ya,S as Aa,e7 as Ca,p as R,a4 as Ga}from"./index-D_qRPRIi.js";import{fE as Ia,a1S as H,QV as B,a1T as J,a1O as Ba,Qh as M,a1U as va,Qp as V,P$ as Ka,PD as La,QW as W,a1V as Y,gg as wa,QM as Ra,QR as Ua,QE as Pa,QC as q,QS as Fa,Qz as ja,a1W as $a,a1X as xa,a1Y as Na,a1Z as Oa,a1_ as I,dw as Qa,dv as za,a1$ as Za,PY as Ma}from"./zeni-epic-state-UM7IPCLf.js";import{n as Va}from"./mui-CyP-P4av.js";import{u as Wa}from"./useAskAiCfoHostNavButtonProps-DYVVwney.js";import{M as Ya}from"./MobileAppDrawer-Bm1u6Ken.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]="d76a5be4-3c6e-4a15-abf2-0a4e5e6a1d79",e._sentryDebugIdIdentifier="sentry-dbid-d76a5be4-3c6e-4a15-abf2-0a4e5e6a1d79")}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}`)),Xa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),U=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Ha=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 o={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(o.is_private=a.is_private),U(a.assignees)&&(o.assignees=a.assignees),U(a.direct_assignees)&&(o.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(o.created_by=a.created_by),U(a.task_group_ids)&&(o.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(o.name=a.name),typeof a.parent_task_id=="string"&&(o.parent_task_id=a.parent_task_id),o},Ja=e=>{if(e==null||typeof e!="object")return null;const a=e;return U(a.task_ids)?{task_ids:a.task_ids}:null},pe=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},ae=e=>{const{events:a,onEvent:n,onSubscribed:o}=e,i=Da(),g=f.useRef(n),l=f.useRef(o),_=f.useRef(0);f.useEffect((()=>{g.current=n}),[n]),f.useEffect((()=>{l.current=o}),[o]);const t=f.useMemo((()=>[...a].sort().join("|")),[a]);f.useEffect((()=>{if(i==null||a.length===0)return;const s=[],p=new Set,S=()=>{if(l.current==null)return;const m=Date.now();m-_.current<5e3||(_.current=m,l.current())};return a.forEach((m=>{const[D,b]=ba(m);if(b==="")return;const h=i.channel(D),y=T=>{g.current(b,T)};let k;if(h?.subscribed===!0){if(k=h,k.bind(b,y),!p.has(D)){p.add(D),S();const T=()=>{S()};k.bind("pusher:subscription_succeeded",T),s.push((()=>{k.unbind("pusher:subscription_succeeded",T)}))}s.push((()=>{h.unbind(b,y)}))}else{if(k=h??i.subscribe(D),k.bind(b,y),!p.has(D)){p.add(D);const T=()=>{S()};k.bind("pusher:subscription_succeeded",T),s.push((()=>{k.unbind("pusher:subscription_succeeded",T)}))}s.push((()=>{k.unbind(b,y)}))}})),()=>{s.forEach((m=>m()))}}),[i,t])},ee=Va.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as C}from"./liveblocks-y3zMPGKB.js";import{a as f}from"./sentry-Jm7O5sR
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,te=ma((function(e,a){const n=H(e,a.isTaskTemplatesEnabled),{taskGroupId:o}=a,i=o!=null&&o!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((t=>({...t,tasks:t.tasks.filter((s=>s.taskGroupIds.includes(o)))}))).filter((t=>t.tasks.length>0))}:n,g=Ba(e),l=x.isZeniUser(),_=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:i,tagListView:g,localData:i.localData,isTaskTemplatesEnabled:a.isTaskTemplatesEnabled,isZeniUser:l,subTaskCreateStatus:_}}),(function(e,a){const{navigate:n,currentTenant:o,location:i,isTaskTemplatesEnabled:g}=a,{tenantEmailDomain:l}=o,{groupByKey:_}=a.uiState;return{onTaskManagementRowClick:t=>{const s=Y(l,t),p=R(i.state?.pathnameStackToGoBack,i.pathname);n(s,{state:{pathnameStackToGoBack:p}})},onReloadTasks:()=>{e(B(!0,g))},onTabChange:t=>{e(Qa(t))},onParentTaskClick:t=>{const s=Y(l,t);window.open(s,"_blank","noopener")},bulkUpdateTasks:(t,s)=>{e(X(t,null,s))},onNewTaskClick:()=>{if(a.localData.defaultTaskGroupId!=null){const t=j(l,a.localData.defaultTaskGroupId),s=R(i.state?.pathnameStackToGoBack,i.pathname);n(t,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(t,s)=>{e(q({uiState:{sortKey:t,sortOrder:s}}))},onFiltersChange:t=>{e(Na({filters:t}))},onSearchTextChanged:t=>{e(Oa({searchText:t}))},onReloadCards:()=>{e(B(!0,g))},onBackClick:()=>{if(i.state?.message==="triggerBackClick"){const t=Ga(i.state?.pathnameStackToGoBack),s=t.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:t.newStack}})}else n("../")},updateLocalData:t=>{e(xa({localData:t}))},resetLocalData:()=>{e(J({taskGroupById:a.taskGroupState.taskGroupById}))},handleCreateGroup:t=>{e(ja(a.localData.newTaskGroupName,t))},assignGroupToTasks:t=>{e(X(a.localData.selectedTaskIds,t,Fa(a.uiState.groupByKey,t)))},onDeleteTaskGroup:t=>{e(Pa(t))},onAddNewTaskToTaskGroup:t=>{if(a.localData.defaultTaskGroupId!=null){const s=ne(_,t);e(M({taskDetailLocalData:s}));const p=j(l,a.uiState.groupByKey==="groupName"?t:a.localData.defaultTaskGroupId),S=R(i.state?.pathnameStackToGoBack,i.pathname);n(p,{state:{pathnameStackToGoBack:S,message:"comingFromTaskListPage"}})}},onDragNDrop:(t,s)=>{e(Ua(a.localData.selectedTaskIds.length>0?a.localData.selectedTaskIds:[t],s))},onTaskGroupRename:(t,s)=>{e(Ra(t,s))},onTimeSpentUpdate:(t,s)=>{e(V({task:t,updates:s}))},onShowToast:t=>{e(wa(t))},onGroupByFilterChange:t=>{e(q({uiState:{groupByKey:t}}))},updateTask:(t,s)=>{e(V({task:t,updates:s}))},onCreateTagClick:(t,s)=>{e(La(t,s))},onSubtaskCreation:(t,s)=>{e(va({...s,parentTaskId:t}))},handleGroupTemplateClick:t=>{e(W(t,[]))},handleGroupTemplateTaskClick:(t,s)=>{e(W(t,[s]))},handleNewTaskInitialization:t=>{if(e(M({taskDetailLocalData:{...Ka,name:t}})),a.localData.defaultTaskGroupId!=null){const s=j(l,a.localData.defaultTaskGroupId),p=R(i.state?.pathnameStackToGoBack,i.pathname);n(s,{state:{pathnameStackToGoBack:p,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:t=>{n(`/${l}/tasks/group/${t}`)},onQuickResponsesClick:()=>{n(`/${l}/tasks/quick-responses`)}}}))(Ca);function se(){const e=pa(),a=Ta(),n=fa(),o=x.getSignedInUser(),i=x.isZeniUser(),g=ga(),l=F((u=>Ia(u))),{taskGroupId:_}=_a(),{useFeatureGate:t}=Sa(),{isFeatureEnabled:s}=t(G.isTaskTemplatesEnabled),{isFeatureEnabled:p}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:S}=t(G.isTaskCategorizationEnabled),{isFeatureEnabled:m}=t(G.isTaskBulkResolutionEnabled),{isFeatureEnabled:D}=t(G.isTaskGroupAssigneesEnabled),{isFeatureEnabled:b}=t(G.isTaskRecurringParentEnabled),[h,y]=f.useState(!1),k=F((u=>H(u,s))),T=F((u=>u.taskGroupState)),K=k.fetchState,{isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea}=Va({mobileExploreReferrer:"Task Checklist"});Ea({isDataReady:K==="Completed"}),f.useEffect((()=>{a(B(!1,s))}),[l?.tenantId,a,s]);const ta=f.useMemo((()=>{const u=[d.TASK_CREATED,d.TASK_UPDATED,d.TASKS_BULK_UPDATED,d.TASKS_BULK_DELETED],A=[d.TASK_CREATED,d.TASK_UPDATED,d.TASK_SNOOZE_RESURFACED,d.TASKS_BULK_UPDATED];return[...Xa(l?.companyId,u),...Ya(o?.userId,A)]}),[l?.companyId,o?.userId]);if(ae({events:ta,onEvent:(u,A)=>{switch(u){case d.TASK_CREATED:case d.TASK_UPDATED:{const r=Ha(A);if(r!=null){const w=g.getState(),O=r.task_id,E=O!=null?w.taskState.taskByID?.[O]:void 0,P=E!=null;if(!i)if(r.is_private===!0){if(!P)return}else{const v=o?.userId,L=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&L.add(r.created_by),!(v!=null&&L.has(v))&&!P)return}if(u===d.TASK_UPDATED&&P&&E!=null&&Array.isArray(r.task_group_ids)){const v=new Set(Object.values(w.taskGroupState.taskGroupById??{}).filter((c=>c!=null&&!c.isDeleted)).map((c=>c.id))),L=(E.taskGroupIds??[]).filter((c=>v.has(c))),N=(r.task_group_ids??[]).filter((c=>v.has(c))),sa=L.length===N.length&&L.every((c=>N.includes(c))),Q=E.taskGroupIds??[],$=r.task_group_ids??[],na=Q.length!==$.length||!Q.every((c=>$.includes(c))),oa=(c,ca)=>{const Z=c??[],z=ca??[];if(Z.length!==z.length)return!1;const da=new Set(z);return Z.every((ka=>da.has(ka)))},ra=r.name==null||r.name===E.name,ia=r.is_private==null||r.is_private===E.isPrivate,la=r.assignees==null||oa(r.assignees,E.assignees),ua=r.direct_assignees==null;if(sa&&na&&ra&&ia&&la&&ua)return}}return void a(B(!0,s))}case d.TASKS_BULK_DELETED:{const r=Ja(A);return r==null?void 0:void r.task_ids.forEach((w=>a(Ma(w))))}case d.TASKS_BULK_UPDATED:case d.TASK_SNOOZE_RESURFACED:return void a(B(!0,s))}},onSubscribed:()=>{a(B(!0,s))}}),f.useEffect((()=>{K==="Completed"&&a(J({taskGroupById:T.taskGroupById}))}),[K,T.taskGroupById]),o==null)throw Error("Can't access task list page without signing in...");return C.jsxs(C.Fragment,{children:[K==="Completed"?C.jsx(ha,{analytics:ya,onLoad:u=>(A=>A.trackPageLoaded(Aa.Event.taskListPage))(u)}):null,C.jsxs(ee,{children:[C.jsx(qa,{isAppContentDrawerOpen:h,handleDrawerToggle:u=>{y(u)}}),C.jsx(te,{location:n,navigate:e,currentTenant:l,taskGroupId:_,taskGroupState:T,localData:k.localData,uiState:k.uiState,isTaskTemplatesEnabled:s,taskListFetchState:K,isTaskCategorizationEnabled:S,isTaskCannedResponsesEnabled:p,isTaskBulkResolutionEnabled:m,isTaskGroupAssigneesEnabled:D,isTaskRecurringParentEnabled:b,isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea})]})]})}const Y=(e,a)=>`/${e}/tasks/${encodeURIComponent(a)}`,j=(e,a)=>`/${e}/tasks/new/${a}`,ne=(e,a)=>{if(e==="assignee"){const n=a.split(",");return{...I.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=$a(a);return{...I.taskDetailLocalData,priority:n}}if(e==="status"){const n=Za(a);return{...I.taskDetailLocalData,status:n}}if(e==="tag"){const n=a.split(",");return{...I.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=za(a);return{...I.taskDetailLocalData,dueDate:n}}return{...I.taskDetailLocalData}},Te=Object.freeze(Object.defineProperty({__proto__:null,default:se},Symbol.toStringTag,{value:"Module"}));export{d as T,Ya as a,Xa as b,Ja as c,Ha as d,se as e,Te as f,pe as t,ae as u};
9
+ `,te=ma((function(e,a){const n=H(e,a.isTaskTemplatesEnabled),{taskGroupId:o}=a,i=o!=null&&o!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((t=>({...t,tasks:t.tasks.filter((s=>s.taskGroupIds.includes(o)))}))).filter((t=>t.tasks.length>0))}:n,g=Ba(e),l=$.isZeniUser(),_=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:i,tagListView:g,localData:i.localData,isTaskTemplatesEnabled:a.isTaskTemplatesEnabled,isZeniUser:l,subTaskCreateStatus:_}}),(function(e,a){const{navigate:n,currentTenant:o,location:i,isTaskTemplatesEnabled:g}=a,{tenantEmailDomain:l}=o,{groupByKey:_}=a.uiState;return{onTaskManagementRowClick:t=>{const s=X(l,t),p=R(i.state?.pathnameStackToGoBack,i.pathname);n(s,{state:{pathnameStackToGoBack:p}})},onReloadTasks:()=>{e(B(!0,g))},onTabChange:t=>{e(Oa(t))},onParentTaskClick:t=>{const s=X(l,t);window.open(s,"_blank","noopener")},bulkUpdateTasks:(t,s)=>{e(q(t,null,s))},onNewTaskClick:()=>{if(a.localData.defaultTaskGroupId!=null){const t=j(l,a.localData.defaultTaskGroupId),s=R(i.state?.pathnameStackToGoBack,i.pathname);n(t,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(t,s)=>{e(Y({uiState:{sortKey:t,sortOrder:s}}))},onFiltersChange:t=>{e(Na({filters:t}))},onSearchTextChanged:t=>{e(xa({searchText:t}))},onReloadCards:()=>{e(B(!0,g))},onBackClick:()=>{if(i.state?.message==="triggerBackClick"){const t=Ga(i.state?.pathnameStackToGoBack),s=t.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:t.newStack}})}else n("../")},updateLocalData:t=>{e($a({localData:t}))},resetLocalData:()=>{e(J({taskGroupById:a.taskGroupState.taskGroupById}))},handleCreateGroup:t=>{e(ja(a.localData.newTaskGroupName,t))},assignGroupToTasks:t=>{e(q(a.localData.selectedTaskIds,t,Fa(a.uiState.groupByKey,t)))},onDeleteTaskGroup:t=>{e(Pa(t))},onAddNewTaskToTaskGroup:t=>{if(a.localData.defaultTaskGroupId!=null){const s=ne(_,t);e(M({taskDetailLocalData:s}));const p=j(l,a.uiState.groupByKey==="groupName"?t:a.localData.defaultTaskGroupId),S=R(i.state?.pathnameStackToGoBack,i.pathname);n(p,{state:{pathnameStackToGoBack:S,message:"comingFromTaskListPage"}})}},onDragNDrop:(t,s)=>{e(Ua(a.localData.selectedTaskIds.length>0?a.localData.selectedTaskIds:[t],s))},onTaskGroupRename:(t,s)=>{e(Ra(t,s))},onTimeSpentUpdate:(t,s)=>{e(W({task:t,updates:s}))},onShowToast:t=>{e(wa(t))},onGroupByFilterChange:t=>{e(Y({uiState:{groupByKey:t}}))},updateTask:(t,s)=>{e(W({task:t,updates:s}))},onCreateTagClick:(t,s)=>{e(La(t,s))},onSubtaskCreation:(t,s)=>{e(Ka({...s,parentTaskId:t}))},handleGroupTemplateClick:t=>{e(V(t,[]))},handleGroupTemplateTaskClick:(t,s)=>{e(V(t,[s]))},handleNewTaskInitialization:t=>{if(e(M({taskDetailLocalData:{...va,name:t}})),a.localData.defaultTaskGroupId!=null){const s=j(l,a.localData.defaultTaskGroupId),p=R(i.state?.pathnameStackToGoBack,i.pathname);n(s,{state:{pathnameStackToGoBack:p,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:t=>{n(`/${l}/tasks/group/${t}`)},onQuickResponsesClick:()=>{n(`/${l}/tasks/quick-responses`)}}}))(Ca);function se(){const e=pa(),a=Ta(),n=fa(),o=$.getSignedInUser(),i=$.isZeniUser(),g=ga(),l=F((u=>Ia(u))),{taskGroupId:_}=_a(),{useFeatureGate:t}=Sa(),{isFeatureEnabled:s}=t(G.isTaskTemplatesEnabled),{isFeatureEnabled:p}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:S}=t(G.isTaskCategorizationEnabled),{isFeatureEnabled:m}=t(G.isTaskBulkResolutionEnabled),{isFeatureEnabled:D}=t(G.isTaskGroupAssigneesEnabled),{isFeatureEnabled:b}=t(G.isTaskRecurringParentEnabled),[h,y]=f.useState(!1),k=F((u=>H(u,s))),T=F((u=>u.taskGroupState)),v=k.fetchState,{isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea}=Wa({mobileExploreReferrer:"Task Checklist"});Ea({isDataReady:v==="Completed"}),f.useEffect((()=>{a(B(!1,s))}),[l?.tenantId,a,s]);const ta=f.useMemo((()=>{const u=[c.TASK_CREATED,c.TASK_UPDATED,c.TASKS_BULK_UPDATED,c.TASKS_BULK_DELETED],A=[c.TASK_CREATED,c.TASK_UPDATED,c.TASK_SNOOZE_RESURFACED,c.TASKS_BULK_UPDATED];return[...qa(l?.companyId,u),...Xa(o?.userId,A)]}),[l?.companyId,o?.userId]);if(ae({events:ta,onEvent:(u,A)=>{switch(u){case c.TASK_CREATED:case c.TASK_UPDATED:{const r=Ha(A);if(r!=null){const w=g.getState(),x=r.task_id,E=x!=null?w.taskState.taskByID?.[x]:void 0,P=E!=null;if(!i)if(r.is_private===!0){if(!P)return}else{const K=o?.userId,L=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&L.add(r.created_by),!(K!=null&&L.has(K))&&!P)return}if(u===c.TASK_UPDATED&&P&&E!=null&&Array.isArray(r.task_group_ids)){const K=new Set(Object.values(w.taskGroupState.taskGroupById??{}).filter((d=>d!=null&&!d.isDeleted)).map((d=>d.id))),L=(E.taskGroupIds??[]).filter((d=>K.has(d))),N=(r.task_group_ids??[]).filter((d=>K.has(d))),sa=L.length===N.length&&L.every((d=>N.includes(d))),O=E.taskGroupIds??[],Q=r.task_group_ids??[],na=O.length!==Q.length||!O.every((d=>Q.includes(d))),oa=(d,da)=>{const z=d??[],Z=da??[];if(z.length!==Z.length)return!1;const ca=new Set(Z);return z.every((ka=>ca.has(ka)))},ra=r.name==null||r.name===E.name,ia=r.is_private==null||r.is_private===E.isPrivate,la=r.assignees==null||oa(r.assignees,E.assignees),ua=r.direct_assignees==null;if(sa&&na&&ra&&ia&&la&&ua)return}}return void a(B(!0,s))}case c.TASKS_BULK_DELETED:{const r=Ja(A);return r==null?void 0:void r.task_ids.forEach((w=>a(Ma(w))))}case c.TASKS_BULK_UPDATED:case c.TASK_SNOOZE_RESURFACED:return void a(B(!0,s))}},onSubscribed:()=>{a(B(!0,s))}}),f.useEffect((()=>{v==="Completed"&&a(J({taskGroupById:T.taskGroupById}))}),[v,T.taskGroupById]),o==null)throw Error("Can't access task list page without signing in...");return C.jsxs(C.Fragment,{children:[v==="Completed"?C.jsx(ha,{analytics:ya,onLoad:u=>(A=>A.trackPageLoaded(Aa.Event.taskListPage))(u)}):null,C.jsxs(ee,{children:[C.jsx(Ya,{isAppContentDrawerOpen:h,handleDrawerToggle:u=>{y(u)}}),C.jsx(te,{location:n,navigate:e,currentTenant:l,taskGroupId:_,taskGroupState:T,localData:k.localData,uiState:k.uiState,isTaskTemplatesEnabled:s,taskListFetchState:v,isTaskCategorizationEnabled:S,isTaskCannedResponsesEnabled:p,isTaskBulkResolutionEnabled:m,isTaskGroupAssigneesEnabled:D,isTaskRecurringParentEnabled:b,isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea})]})]})}const X=(e,a)=>`/${e}/tasks/${encodeURIComponent(a)}`,j=(e,a)=>`/${e}/tasks/new/${a}`,ne=(e,a)=>{if(e==="assignee"){const n=a.split(",");return{...I.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Qa(a);return{...I.taskDetailLocalData,priority:n}}if(e==="status"){const n=za(a);return{...I.taskDetailLocalData,status:n}}if(e==="tag"){const n=a.split(",");return{...I.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=Za(a);return{...I.taskDetailLocalData,dueDate:n}}return{...I.taskDetailLocalData}},Te=Object.freeze(Object.defineProperty({__proto__:null,default:se},Symbol.toStringTag,{value:"Module"}));export{c as T,Xa as a,qa as b,Ja as c,Ha as d,se as e,Te as f,pe as t,ae as u};
@@ -0,0 +1,9 @@
1
+ import{j as r}from"./liveblocks-BXyXenK7.js";import de from"./NotFoundScreen-BHAnIkPW.js";import{a as k}from"./sentry-D4svnzxK.js";import{h as Y,u as ee,j as b,g as ue,i as ke,N as pe,l as me,n as Se,o as E}from"./core-Bl4MLhFi.js";import{PQ as ae,PT as fe,PN as Te,ZG as ge,fE as te,a1O as se,Qd as g,Q5 as T,PK as he,QJ as Ee,QC as be,a1P as ne,gg as oe,a1Q as V,PG as Ie,PD as De,uS as Ce,uG as Ge,my as _e,Q3 as ye,a1R as Pe,QW as Re,P$ as Ue,Qo as xe,Ql as Be,PW as we,Qi as ve,Qh as Ae}from"./zeni-epic-state-UM7IPCLf.js";import{z as y,e5 as je,E as Fe,N as Le,d as G,a4 as ie,p as _,a8 as Ke,k as q,S as $e,e6 as Qe,Z as M,ae as Ne}from"./index-D_qRPRIi.js";import{n as Oe}from"./mui-CyP-P4av.js";import{u as Ze}from"./useInitialThreadRequest-R2hAErYY.js";import{M as ze}from"./MobileAppDrawer-Bm1u6Ken.js";import{b as Ve,a as qe,u as Me,T as f,t as Je,c as J,d as W,e as We}from"./TaskListScreen-BBXffRbT.js";import"./recharts-CZKBTuPa.js";import"./analytics-B06OpwA-.js";import"./plaid-C0aCR9wu.js";import"./dnd-CimhpTrK.js";import"./stripe-cKAAJElX.js";import"./lottie-2qUppQdg.js";import"./lexical-BbBoQdpc.js";import"./pdf-BENieWk6.js";import"./utils-Bycom664.js";import"./InboxNotificationsProvider-CMdsyY0A.js";import"./useTaskManagerAccess-Rxke8A9H.js";import"./useAskAiCfoHostNavButtonProps-DYVVwney.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]="784a441d-3dde-42d4-8fec-4c2c0bc251ff",e._sentryDebugIdIdentifier="sentry-dbid-784a441d-3dde-42d4-8fec-4c2c0bc251ff")}catch{}})();function He(){const e=Y(),a=ee(),n=y.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:d}=b((o=>o.cannedResponsesState)),u=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(je,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:u,onSave:m})}const L=e=>e?.taskState?.taskByID,j=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},Xe=ge([j,(e,a)=>{const n=j(e,a),c=L(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=j(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 H,X=[];const Ye=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),d=te(e),u=Xe(e,a.taskId),m=s.taskGroupId??c,t=m!=null?V(e.taskGroupState,m):void 0,o=y.getSignedInUser(),I=d.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:I??""},x=se(e),{tenantEmailDomain:B}=d,P=s.recurringSourceTaskId,w=P!=null?`${M.appUrl}/${B}/tasks/${encodeURIComponent(P)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:y.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==H&&(H=h,X=Object.values(h)),X),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:w,tagListView:x,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>V(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:u,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:d,taskGroupId:u}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(Ae({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(ve(n,t??u))},onArchiveTaskClick:()=>{a.taskId!=null&&e(we(a.taskId))},onSnoozeTask:(t,o)=>{e(Be(t,o))},onUnsnoozeTask:t=>{e(xe(t))},onCreateSubtask:(t,o)=>{e(Ue({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(Re({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(d.state?.pathnameStackToGoBack,d.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(d.state?.pathnameStackToGoBack,d.pathname)}})},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const t=ie(d.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=U(m),o=_(d.state?.pathnameStackToGoBack,d.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(Pe({taskId:n}))},onDeleteTaskClick:()=>{e(ye(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`)}}}))(Qe);function F(){const e=Y(),a=ee(),n=ue(),c=Fe(),{taskId:s,taskGroupId:d}=ke(),u=b((i=>te(i))),m=Ze(u?.companyId),{useFeatureGate:t}=Le(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:I}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:x}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:B}=t(G.isTaskGroupAssigneesEnabled),[P,w]=k.useState(!1),[h,S]=k.useState(!1),[K,re]=k.useState(!1),[$,v]=k.useState(!1),C=k.useRef(!1),R=b((i=>i.taskListState.updateTasksFetchState.fetchState)),Q=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=y.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[...Ve(u?.companyId,i),...qe(O,l)]}),[u?.companyId,O]);Me({events:ce,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(i,l)=>{if(s!=null)switch(i){case f.TASK_CREATED:{W(l)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=W(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=J(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=J(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),u?.tenantEmailDomain!=null&&e(U(u.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{Je(l)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||Q.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,Q.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($)if(R!=="In-Progress"){if(C.current){if(R==="Error")return v(!1),void(C.current=!1);if(R==="Completed"){v(!1),C.current=!1;const{tenantEmailDomain:i}=u;if(n.state?.message==="triggerBackClick"){const l=ie(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=U(i);e(l,{state:{pathnameStackToGoBack:_(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[$,R,u,n,e]);const Z=b((i=>ne(i,s))),A=Z.fetchState,z=y.getSignedInUser();if(z==null)throw Error("Can't access task detail page without signing in...");if(A==="Error"&&Z.error?.code===400){const{tenantEmailDomain:i}=u,l=U(i),p=_(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[A==="Completed"?r.jsx(Ke,{analytics:q,onLoad:i=>(l=>l.trackPageLoaded($e.Event.taskDetailPage))(i)}):null,r.jsxs(ea,{children:[r.jsx(ze,{isAppContentDrawerOpen:P,handleDrawerToggle:i=>{w(i)}}),r.jsx(Ye,{analytics:q,currentTenant:u,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:z,navigate:e,taskGroupId:d,taskId:s,taskDetailFetchState:A,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:x,isTaskGroupAssigneesEnabled:B})]})]})}const ea=Oe.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: ${e=>e.theme.colors.grey4};
9
+ `,U=e=>`/${e}/tasks`;function Da(){return r.jsxs(Se,{children:[r.jsx(E,{path:"/new",element:r.jsx(F,{})}),r.jsx(E,{path:"/new/:taskGroupId",element:r.jsx(F,{})}),r.jsx(E,{path:"/group/:taskGroupId",element:r.jsx(We,{})}),r.jsx(E,{path:"/quick-responses",element:r.jsx(He,{})}),r.jsx(E,{path:"/:taskId",element:r.jsx(F,{})}),r.jsx(E,{path:"*",element:r.jsx(de,{})})]})}export{Da as default};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-BXyXenK7.js";import i from"./NotFoundScreen-BHAnIkPW.js";import{T as r}from"./TransactionDetailScreen-DcuSfVKO.js";import"./sentry-D4svnzxK.js";import{n as a,o as e}from"./core-Bl4MLhFi.js";import"./zeni-epic-state-UM7IPCLf.js";import"./recharts-CZKBTuPa.js";import"./index-D_qRPRIi.js";import"./mui-CyP-P4av.js";import"./analytics-B06OpwA-.js";import"./plaid-C0aCR9wu.js";import"./dnd-CimhpTrK.js";import"./stripe-cKAAJElX.js";import"./lottie-2qUppQdg.js";import"./lexical-BbBoQdpc.js";import"./pdf-BENieWk6.js";import"./utils-Bycom664.js";import"./useAskAiCfoHostNavButtonProps-DYVVwney.js";import"./decodeURIComponentSafe-Buybgpqw.js";import"./useInitialThreadRequest-R2hAErYY.js";import"./routePaths-D20OKXnM.js";import"./expenseAutomationHelper-CkBJgYs_.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};