@zeniai/web-app-ui 5.1.24-dev → 5.1.25-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/assets/AddressRoutes-BB0ro6wv.js +1 -0
  2. package/dist/assets/{AddressScreen-Csre8zO2.js → AddressScreen-t45pXVvS.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-C5oCZlS4.js → AiCfoScreen-7mHfCmdb.js} +1 -1
  4. package/dist/assets/BillPayApprovalRoutes-DbZZgApj.js +1 -0
  5. package/dist/assets/{BillPayRoutes-DjcCRuED.js → BillPayRoutes-DGHURUBB.js} +27 -27
  6. package/dist/assets/{BusinessVerificationPageScreen-e2XdUw9z.js → BusinessVerificationPageScreen-DRR9km69.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-Jy5HjNAq.js → ChargeCardRoutes-DSSh6FmN.js} +11 -11
  8. package/dist/assets/{CompanyPassportScreen-D8V0b6yZ.js → CompanyPassportScreen-03cd6rew.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-CUXkV4cL.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-DxioIAXi.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-CJBZR08A.js +23 -0
  12. package/dist/assets/{DashboardRoutes-Crdrh0ru.js → DashboardRoutes-BWWut7Lp.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-CrS-vGpL.js → DefaultTenantHome-D0x0VK8i.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-By9DmOyv.js +18 -0
  15. package/dist/assets/DrawerScreen-DHM1klM-.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-CETjyGK7.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-BMCXnpCB.js +25 -0
  18. package/dist/assets/{FeaturePreviewScreen-DX8d8ftd.js → FeaturePreviewScreen-4ttP8nOi.js} +1 -1
  19. package/dist/assets/HubSpotOAuthCallbackScreen-CNkM-iq3.js +1 -0
  20. package/dist/assets/MagicLinkRoutes-BKlgQ_Ie.js +72 -0
  21. package/dist/assets/MagicLinkSignInScreen-CQoHv1Ew.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-ztL55BFc.js → MobileAppDrawer-Biso_61t.js} +1 -1
  23. package/dist/assets/NotFoundScreen-C0-Skng9.js +1 -0
  24. package/dist/assets/{NotificationRoutes-CKq0wqeI.js → NotificationRoutes-D9fJ9SYM.js} +1 -1
  25. package/dist/assets/OAuthConsentScreen-C9NM67kC.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-DTh6WUET.js +1 -0
  27. package/dist/assets/PeopleRoutes-CfzOn3nZ.js +22 -0
  28. package/dist/assets/PerformanceRoutes-BRNqvpgs.js +1 -0
  29. package/dist/assets/{Preview-DvwNtgYT.js → Preview-CmzR2zNp.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-B4aVoacL.js → QBOConnectionScreen-CmHLrNN0.js} +1 -1
  31. package/dist/assets/ReferralListScreen-DGyOm6sF.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-CCftKChl.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-B6hhKpnv.js → ReimbursementApprovalRuleDetailScreen-DYLPHNtr.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-DqOur3Qw.js → ReimbursementRoutes-B0uSlLog.js} +5 -5
  35. package/dist/assets/{ReportsRoutes-DhxXl2sZ.js → ReportsRoutes-RqLKE5WA.js} +1 -1
  36. package/dist/assets/RewardsRoutes-COd7r8nd.js +1 -0
  37. package/dist/assets/ScreenRoutes-nOndy_UK.js +2 -0
  38. package/dist/assets/{SettingsRoutes-Txvmet51.js → SettingsRoutes-CzU-HcCn.js} +8 -8
  39. package/dist/assets/{SetupPagesScreen-CW4TDHQ1.js → SetupPagesScreen-Bi9C_-FR.js} +5 -5
  40. package/dist/assets/{SignInScreen-LFx-lhED.js → SignInScreen-BfWJdDbb.js} +1 -1
  41. package/dist/assets/SignOutScreen-DqrJH-ux.js +9 -0
  42. package/dist/assets/{TaskListScreen-gDLwnqUy.js → TaskListScreen-Bwwbd5X8.js} +2 -2
  43. package/dist/assets/TaskRoutes-CBdj5pZX.js +9 -0
  44. package/dist/assets/{TransactionDetailRoutes-3fJlcVH_.js → TransactionDetailRoutes-BtVYAo59.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-C05AQBgs.js → TransactionDetailScreen-BxH3gBsf.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-B7M8rc9_.js → TransactionListRoutes-DaBzUpfC.js} +1 -1
  47. package/dist/assets/TreasuryRoutes-opcOBJb-.js +37 -0
  48. package/dist/assets/{VendorsRoutes-C3bYBpA7.js → VendorsRoutes-Fq7EQRDW.js} +27 -27
  49. package/dist/assets/WiseConfirmationScreen-C3f57wCu.js +12 -0
  50. package/dist/assets/ZeniAccountRoutes-2E4c7VWB.js +57 -0
  51. package/dist/assets/ZeniAccountStatementScreen-CgW4jBMr.js +9 -0
  52. package/dist/assets/{accountMappingHelper-BeLxsEhj.js → accountMappingHelper-EVwRyhXo.js} +1 -1
  53. package/dist/assets/{analytics-Dcb_7Yrn.js → analytics-DyffXLrl.js} +1 -1
  54. package/dist/assets/{analyticsHelper-Bgdq7lAB.js → analyticsHelper-tq4PT7c_.js} +1 -1
  55. package/dist/assets/{core-B01_r_a6.js → core-DYij5xsh.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-BOkChgPc.js → decodeURIComponentSafe-CSUd4Wt5.js} +1 -1
  57. package/dist/assets/{dnd-aIvu8cuo.js → dnd-BU-7caEQ.js} +1 -1
  58. package/dist/assets/{empty-DLWGhBLz.js → empty-Bz6RdLl6.js} +1 -1
  59. package/dist/assets/{empty-DP7Qtv_6.js → empty-zLrsqSwy.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-mC3LqJrg.js → emptyVideoElement-Cxq76LDO.js} +1 -1
  61. package/dist/assets/{epic-U_1X8d7m.js → epic-knsZntkZ.js} +1 -1
  62. package/dist/assets/getLocaleForTenant-DwUbw-k6.js +1 -0
  63. package/dist/assets/{index-CKvoU8sU.js → index-3OE7eXoF.js} +1 -1
  64. package/dist/assets/{index-BAIA3LT3.js → index-44V9br91.js} +1 -1
  65. package/dist/assets/{index-b9cGMwNO.js → index-BCP41PwF.js} +13079 -12886
  66. package/dist/assets/{index-B9Boa_Td.js → index-BdURJOvl.js} +2 -2
  67. package/dist/assets/{index-HFOJdDTm.js → index-C2zxt7CG.js} +1 -1
  68. package/dist/assets/{index-C7ZZYs3m.js → index-C90tJyPI.js} +1 -1
  69. package/dist/assets/{index-DEwFeJzq.js → index-CeyemrXI.js} +1 -1
  70. package/dist/assets/{index-fiqC8vZO.js → index-hKAQTJHr.js} +1 -1
  71. package/dist/assets/{lexical-CSRsdQQS.js → lexical-eKqIIoQI.js} +1 -1
  72. package/dist/assets/{liveblocks-CnWjJuBt.js → liveblocks-BiGkkGoP.js} +1 -1
  73. package/dist/assets/{lottie-DUONjUug.js → lottie-CCiYx5dW.js} +1 -1
  74. package/dist/assets/{mui-DRaG-BlK.js → mui-CdvNR06J.js} +1 -1
  75. package/dist/assets/{pathToGoBack-3jAhRKQN.js → pathToGoBack-DzYXGaMH.js} +1 -1
  76. package/dist/assets/{pdf-UaypZdKm.js → pdf-05F57jtv.js} +3 -3
  77. package/dist/assets/{pdf-lib-t9AAxY-T.js → pdf-lib-CUEF9aFq.js} +1 -1
  78. package/dist/assets/{plaid-VN7yDnB4.js → plaid-CsGNESZa.js} +1 -1
  79. package/dist/assets/{pusher-UqFP2KpO.js → pusher-C7xS39FJ.js} +1 -1
  80. package/dist/assets/{react-r8LsJVdm.js → react-BcY5rxQv.js} +1 -1
  81. package/dist/assets/{react-DNgryaI2.js → react-Ce6YQI4l.js} +1 -1
  82. package/dist/assets/{react-B_Uab5TB.js → react-CltIT5UZ.js} +1 -1
  83. package/dist/assets/{react-YISROtP4.js → react-D3qjGIuX.js} +1 -1
  84. package/dist/assets/{react-CFhlJXGh.js → react-hPevf4CC.js} +1 -1
  85. package/dist/assets/{react-CqO-0SNq.js → react-i6kyX3or.js} +1 -1
  86. package/dist/assets/{recharts-q0doAU-l.js → recharts-D0oa1BQl.js} +1 -1
  87. package/dist/assets/{routePaths-Sv0e7DY5.js → routePaths-jIme_4o7.js} +1 -1
  88. package/dist/assets/{sentry-1cGDtjwd.js → sentry-DQGl2YSn.js} +1 -1
  89. package/dist/assets/{url-C9c3hZCp.js → url-DJZEEGtj.js} +1 -1
  90. package/dist/assets/{url-C_w1-pX_.js → url-DRf0E0e8.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BtVPWNXS.js → useAiCfoDashboardSuggestedQuestionsChips-Duk5q7Ch.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-CVdued0l.js +1 -0
  93. package/dist/assets/{useDeviceId-DJ_jocMS.js → useDeviceId-Dsh8klAH.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-C9kyf2mS.js → useInitialThreadRequest-Du_koxHd.js} +1 -1
  95. package/dist/assets/{utils-Y2cylN27.js → utils-BCjesvPZ.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-Oei_yMio.js → withTransactionSidePanel-DYnpLjtY.js} +3 -3
  97. package/dist/assets/{zeni-epic-state-BFnJgXOA.js → zeni-epic-state-YenBAkdY.js} +4 -4
  98. package/dist/index.html +1 -1
  99. package/package.json +2 -2
  100. package/dist/assets/AddressRoutes-DocR07FY.js +0 -1
  101. package/dist/assets/BillPayApprovalRoutes-DcGG_cef.js +0 -1
  102. package/dist/assets/ConnectionAuthScreen-B37X59g8.js +0 -11
  103. package/dist/assets/CustomerOnboardingAuthScreen-C_QbqgZM.js +0 -1
  104. package/dist/assets/CustomerOnboardingRoutes-CmcaDbTa.js +0 -23
  105. package/dist/assets/DomesticWireDetailScreen-DuxbN0zG.js +0 -18
  106. package/dist/assets/DrawerScreen-k4ejNFVF.js +0 -1
  107. package/dist/assets/EntityDetailRoutes-Cz3bqJps.js +0 -1
  108. package/dist/assets/ExpenseAutomationRoutes-DUQvgVgE.js +0 -25
  109. package/dist/assets/HubSpotOAuthCallbackScreen-xn6NQAqC.js +0 -1
  110. package/dist/assets/MagicLinkRoutes-DQ4uoRpD.js +0 -72
  111. package/dist/assets/MagicLinkSignInScreen-DrGW2O8V.js +0 -12
  112. package/dist/assets/NotFoundScreen-CbugOr9O.js +0 -1
  113. package/dist/assets/OAuthConsentScreen-CEU5OZgL.js +0 -1
  114. package/dist/assets/PandLWithForecastRoutes-B-40q3h2.js +0 -1
  115. package/dist/assets/PeopleRoutes-CLPVeXV_.js +0 -22
  116. package/dist/assets/PerformanceRoutes-BRxTGeZG.js +0 -1
  117. package/dist/assets/ReferralListScreen-wo-BFaOS.js +0 -5
  118. package/dist/assets/ReimbursementApprovalRoutes-CwwWIVRR.js +0 -1
  119. package/dist/assets/RewardsRoutes-U6P7PAVH.js +0 -1
  120. package/dist/assets/ScreenRoutes-_YOcQOAn.js +0 -2
  121. package/dist/assets/SignOutScreen-Cj8XXvng.js +0 -9
  122. package/dist/assets/TaskRoutes-DSsGgBGN.js +0 -9
  123. package/dist/assets/TreasuryRoutes-DRGM_rOp.js +0 -37
  124. package/dist/assets/WiseConfirmationScreen-CCLyRCEQ.js +0 -12
  125. package/dist/assets/ZeniAccountRoutes-Q8kxFpOw.js +0 -57
  126. package/dist/assets/ZeniAccountStatementScreen-CeoDjC-C.js +0 -9
  127. package/dist/assets/getLocaleForTenant-BIDDVgBq.js +0 -1
  128. package/dist/assets/useAskAiCfoHostNavButtonProps-C1fOlGC9.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-CnWjJuBt.js";import{a as p}from"./sentry-1cGDtjwd.js";import{h as _,g as T,u as k,j as h,n as B,i as F,o as Q,p as I}from"./core-B01_r_a6.js";import{bn as xe,eP as j,gN as de,Lw as Ee,pD as Ae,jG as ue,lZ as we,gP as je,Ly as Pe,Lx as ke,NX as ve,xQ as De,Cj as Me,Nw as Ue,NF as _e,c2 as ee,cH as Re,cI as Te,JD as Be,NY as Fe,JE as Oe,wg as Ve,NZ as Le,Ez as Ne,B$ as $e,BS as pe,BP as Ke,wk as ge,BV as me,BY as fe,C2 as ne,sR as te,wj as ze,ji as W,jl as he,N_ as Je,km as Ge,wz as Ze,Kr as qe,Ks as He,jg as Ye,N$ as Qe,jj as We,q5 as Xe,O0 as en,O1 as nn,q9 as tn,gx as an,JM as Y,gm as sn,gt as on,JN as cn,ww as rn,O2 as ln,O3 as dn,Cg as un,eY as be,e_ as Se,O4 as pn,fA as gn,JW as mn,wv as oe,fF as ie,fE as fn,wu as hn,fD as bn,fC as Sn,O5 as Cn,f1 as Ce,O6 as yn,O7 as In,wC as xn,wt as ce,O8 as En,fi as An,wq as wn,bV as jn,c1 as Pn,c0 as kn,bW as vn,b_ as Dn,bZ as Mn,bY as Un,b$ as _n,bX as Rn}from"./zeni-epic-state-BFnJgXOA.js";import{S as ae,c as M,z as E,af as ye,bI as Tn,d as K,f as Bn,k as O,B as se,bJ as Fn,bK as On,aq as Vn,i as Ie,bL as Ln,bM as Nn,bN as $n,a9 as Kn,V as zn,bO as Jn,r as Gn,bP as Zn}from"./index-b9cGMwNO.js";import{n as U}from"./mui-DRaG-BlK.js";import{M as v}from"./MobileAppDrawer-ztL55BFc.js";import{a as N,g as $,m as qn}from"./accountMappingHelper-BeLxsEhj.js";import{t as Hn,A as Yn}from"./AddressScreen-Csre8zO2.js";import R from"./NotFoundScreen-CbugOr9O.js";import{g as Qn}from"./analyticsHelper-Bgdq7lAB.js";import{B as Wn}from"./BusinessVerificationPageScreen-e2XdUw9z.js";import{C as Xn}from"./CompanyPassportScreen-D8V0b6yZ.js";import{q as re}from"./QBOConnectionScreen-B4aVoacL.js";import{B as et}from"./BillPayApprovalRoutes-DcGG_cef.js";import{R as nt}from"./ReimbursementApprovalRoutes-CwwWIVRR.js";import"./recharts-q0doAU-l.js";import"./analytics-Dcb_7Yrn.js";import"./plaid-VN7yDnB4.js";import"./dnd-aIvu8cuo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DUONjUug.js";import"./lexical-CSRsdQQS.js";import"./pdf-UaypZdKm.js";import"./utils-Y2cylN27.js";import"./routePaths-Sv0e7DY5.js";import"./empty-DP7Qtv_6.js";import"./pdf-lib-t9AAxY-T.js";import"./index-HFOJdDTm.js";import"./url-C_w1-pX_.js";import"./index-CKvoU8sU.js";import"./decodeURIComponentSafe-BOkChgPc.js";import"./ReimbursementApprovalRuleDetailScreen-B6hhKpnv.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="234b4c36-6986-4131-8a9b-82ff7c115715",e._sentryDebugIdIdentifier="sentry-dbid-234b4c36-6986-4131-8a9b-82ff7c115715")}catch{}})();const tt=U.div`
1
+ import{j as a}from"./liveblocks-BiGkkGoP.js";import{a as p}from"./sentry-DQGl2YSn.js";import{h as _,g as R,u as v,j as h,n as B,i as O,o as W,p as I}from"./core-DYij5xsh.js";import{bn as xe,eQ as j,gO as de,Lx as Ee,pE as Ae,jH as ue,l_ as we,gQ as je,Lz as ke,Ly as ve,NY as Pe,xR as De,Ck as Ue,Nx as Me,NG as _e,c2 as ee,cH as Te,cI as Re,JE as Be,NZ as Oe,JF as Fe,wh as Ve,N_ as Le,EA as Ne,C0 as $e,BT as pe,BQ as Ke,wl as ge,BW as me,BZ as fe,C3 as ne,sS as te,wk as Ge,jj as X,jm as he,N$ as ze,kn as Je,wA as Ze,Ks as He,Kt as Qe,jh as qe,O0 as We,jk as Xe,q6 as Ye,O1 as en,O2 as nn,qa as tn,gy as an,JN as q,gn as sn,gu as on,JO as cn,wx as rn,O3 as ln,O4 as dn,Ch as un,eZ as be,e$ as Se,O5 as pn,fB as gn,JX as mn,ww as oe,fG as ie,fF as fn,wv as hn,fE as bn,fD as Sn,O6 as Cn,f2 as Ce,O7 as yn,O8 as In,wD as xn,wu as ce,O9 as En,fj as An,wr as wn,bV as jn,c1 as kn,c0 as vn,bW as Pn,b_ as Dn,bZ as Un,bY as Mn,b$ as _n,bX as Tn}from"./zeni-epic-state-YenBAkdY.js";import{n as ae,c as U,z as E,af as ye,bI as Rn,d as K,f as Bn,A as F,B as se,bJ as On,bK as Fn,aq as Vn,i as Ie,bL as Ln,bM as Nn,bN as $n,a9 as Kn,W as Gn,bO as zn,r as Jn,bP as Zn}from"./index-BCP41PwF.js";import{n as M}from"./mui-CdvNR06J.js";import{M as P}from"./MobileAppDrawer-Biso_61t.js";import{a as N,g as $,m as Hn}from"./accountMappingHelper-EVwRyhXo.js";import{t as Qn,A as qn}from"./AddressScreen-t45pXVvS.js";import T from"./NotFoundScreen-C0-Skng9.js";import{g as Wn}from"./analyticsHelper-tq4PT7c_.js";import{B as Xn}from"./BusinessVerificationPageScreen-DRR9km69.js";import{C as Yn}from"./CompanyPassportScreen-03cd6rew.js";import{q as re}from"./QBOConnectionScreen-CmHLrNN0.js";import{B as et}from"./BillPayApprovalRoutes-DbZZgApj.js";import{R as nt}from"./ReimbursementApprovalRoutes-CCftKChl.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./routePaths-jIme_4o7.js";import"./empty-zLrsqSwy.js";import"./pdf-lib-CUEF9aFq.js";import"./index-C2zxt7CG.js";import"./url-DRf0E0e8.js";import"./index-3OE7eXoF.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";import"./ReimbursementApprovalRuleDetailScreen-DYLPHNtr.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="b29a118c-8236-41f4-9c2d-7c94ec7ebef1",e._sentryDebugIdIdentifier="sentry-dbid-b29a118c-8236-41f4-9c2d-7c94ec7ebef1")}catch{}})();const tt=M.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-CnWjJuBt.js";import{a as p}from"./sentry-1cGDtjw
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,at=B(function(e,s){return{accountMappingView:s.accountMappingView,isFiling1099FeatureEnabled:s.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:s.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:ue(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ae(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,s){const{navigate:o,location:l,isFiling1099FeatureEnabled:i}=s;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:g}=n,{incomeAccount:f,expenseAccount:m}=t,{billPayAccount:r}=c,{reimbursementsAccount:x}=u,{prepaidExpensesAccount:C,fixedAssetsAccount:w,accruedExpensesAccount:S}=d,{bankAccount:y,expenseCategory1099:V}=g,A=N(s.accountMappingView.incomeAccountList,f.selectedOption),z=N(s.accountMappingView.expenseAccountList,m.selectedOption),J=N(s.accountMappingView.billPayAccountList,r.selectedOption),G=N(s.accountMappingView.reimbursementsAccountList,x.selectedOption),L=$(s.accountMappingView.prepaidExpensesAccountList,C.selectedOptions),b=$(s.accountMappingView.fixedAssetsAccountList,w.selectedOptions),D=$(s.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Z=$(s.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),q=qn(s.accountMappingView.expenseAccounts1099FilingAccountList,V),H={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:z?.accountId,selectedBillPayAccountId:J?.accountId,selectedReimbursementsAccountId:G?.accountId,selectedPrepaidExpensesAccountIds:L.map(P=>P.accountId),selectedFixedAssetsAccountIds:b.map(P=>P.accountId),selectedAccruedExpensesAccountIds:D.map(P=>P.accountId),selectedBankAccounts1099FilingAccountIds:Z.map(P=>P.accountId),selectedExpenseAccounts1099FilingAccountIds:q};e(ke({data:H}))},onBackClick:()=>{ye(l)===!1?(o("../../dashboard"),e(Pe())):e(de())},onSaveClick:()=>{e(je()),i&&K.track(Bn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(we(s.currentTenant.companyId,n))}}})(Tn),st=()=>{const e=_(),s=T(),o=k(),{useFeatureGate:l}=ae(),{isFeatureEnabled:i}=l(M.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=l(M.isScheduledJEAccruedExpensesFeatureEnabled),t=E.getSignedInUser(),c=xe(t),u=h(C=>j(C)),[d,g]=p.useState(!1),[f,m]=p.useState(!1);p.useEffect(()=>{d===!1&&(o(de()),g(!0))},[d]);const r=h(C=>Ee(C)),x=C=>{m(C)};return a.jsxs(tt,{children:[a.jsx(v,{isAppContentDrawerOpen:f,handleDrawerToggle:x}),a.jsx(at,{currentTenant:u,navigate:e,accountMappingView:r,isFiling1099FeatureEnabled:i&&c,isAccruedExpensesFeatureEnabled:n,location:s,isSettings:ye(s),onClickMenuIcon:()=>x(!0)})]})},ot=U.div`
9
+ `,at=B(function(e,s){return{accountMappingView:s.accountMappingView,isFiling1099FeatureEnabled:s.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:s.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:ue(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ae(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,s){const{navigate:o,location:l,isFiling1099FeatureEnabled:i}=s;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:g}=n,{incomeAccount:f,expenseAccount:m}=t,{billPayAccount:r}=c,{reimbursementsAccount:x}=u,{prepaidExpensesAccount:C,fixedAssetsAccount:w,accruedExpensesAccount:S}=d,{bankAccount:y,expenseCategory1099:V}=g,A=N(s.accountMappingView.incomeAccountList,f.selectedOption),G=N(s.accountMappingView.expenseAccountList,m.selectedOption),z=N(s.accountMappingView.billPayAccountList,r.selectedOption),J=N(s.accountMappingView.reimbursementsAccountList,x.selectedOption),L=$(s.accountMappingView.prepaidExpensesAccountList,C.selectedOptions),b=$(s.accountMappingView.fixedAssetsAccountList,w.selectedOptions),D=$(s.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Z=$(s.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),H=Hn(s.accountMappingView.expenseAccounts1099FilingAccountList,V),Q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:G?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:J?.accountId,selectedPrepaidExpensesAccountIds:L.map(k=>k.accountId),selectedFixedAssetsAccountIds:b.map(k=>k.accountId),selectedAccruedExpensesAccountIds:D.map(k=>k.accountId),selectedBankAccounts1099FilingAccountIds:Z.map(k=>k.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(ve({data:Q}))},onBackClick:()=>{ye(l)===!1?(o("../../dashboard"),e(ke())):e(de())},onSaveClick:()=>{e(je()),i&&K.track(Bn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(we(s.currentTenant.companyId,n))}}})(Rn),st=()=>{const e=_(),s=R(),o=v(),{useFeatureGate:l}=ae(),{isFeatureEnabled:i}=l(U.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=l(U.isScheduledJEAccruedExpensesFeatureEnabled),t=E.getSignedInUser(),c=xe(t),u=h(C=>j(C)),[d,g]=p.useState(!1),[f,m]=p.useState(!1);p.useEffect(()=>{d===!1&&(o(de()),g(!0))},[d]);const r=h(C=>Ee(C)),x=C=>{m(C)};return a.jsxs(tt,{children:[a.jsx(P,{isAppContentDrawerOpen:f,handleDrawerToggle:x}),a.jsx(at,{currentTenant:u,navigate:e,accountMappingView:r,isFiling1099FeatureEnabled:i&&c,isAccruedExpensesFeatureEnabled:n,location:s,isSettings:ye(s),onClickMenuIcon:()=>x(!0)})]})},ot=M.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-CnWjJuBt.js";import{a as p}from"./sentry-1cGDtjw
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,it=B(function(e,s){const o=j(e),l=Ue(e),i=_e(e),n=s.roleMap.bill_pay_admin;return{isDisabled:(ee(o?.userRole??[])||n)&&"readonly",billpayApprovalView:l,remiApproverView:i,analytics:K}},function(e,s){const{navigate:o,currentTenant:l}=s;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Fn),ct=()=>{const e=_(),s=T(),o=k(),{tenantEmailDomain:l}=F(),[i,n]=p.useState(!1),[t,c]=p.useState(!1),[u,d]=p.useState(!1),g=h(S=>j(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),m=h(S=>S.remiSetupApproverViewState.fetchState),r=h(S=>ve(S)),x=g.companyId??E.getSignedInUserTenant(l)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const C=O();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),o(De(!0)))},[u,f,o]),p.useEffect(()=>{t||m!=="Not-Started"||(c(!0),o(Me(!0)))},[t,m,o]);const w=S=>{n(S)};return C?.loggedInUserRoleMap!=null?a.jsxs(ot,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:w}),a.jsx(it,{navigate:e,location:s,companyId:x,currentTenant:g,roleMap:C.loggedInUserRoleMap,onClickMenuIcon:()=>{w(!0)}})]}):a.jsx(se,{fetchState:r.fetchState})},rt=U.div`
17
+ `,it=B(function(e,s){const o=j(e),l=Me(e),i=_e(e),n=s.roleMap.bill_pay_admin;return{isDisabled:(ee(o?.userRole??[])||n)&&"readonly",billpayApprovalView:l,remiApproverView:i,analytics:K}},function(e,s){const{navigate:o,currentTenant:l}=s;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(On),ct=()=>{const e=_(),s=R(),o=v(),{tenantEmailDomain:l}=O(),[i,n]=p.useState(!1),[t,c]=p.useState(!1),[u,d]=p.useState(!1),g=h(S=>j(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),m=h(S=>S.remiSetupApproverViewState.fetchState),r=h(S=>Pe(S)),x=g.companyId??E.getSignedInUserTenant(l)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const C=F();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),o(De(!0)))},[u,f,o]),p.useEffect(()=>{t||m!=="Not-Started"||(c(!0),o(Ue(!0)))},[t,m,o]);const w=S=>{n(S)};return C?.loggedInUserRoleMap!=null?a.jsxs(ot,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:w}),a.jsx(it,{navigate:e,location:s,companyId:x,currentTenant:g,roleMap:C.loggedInUserRoleMap,onClickMenuIcon:()=>{w(!0)}})]}):a.jsx(se,{fetchState:r.fetchState})},rt=M.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-CnWjJuBt.js";import{a as p}from"./sentry-1cGDtjw
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,lt=B(function(e,s){const{companyId:o,isZeniAccountEnabled:l,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:c}=s,u=j(e);return{bankSetupView:Le(e,o,n,t,l,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}},function(e,s){const{navigate:o,currentTenant:l,companyId:i}=s;return{onFetchLinkTokenClick:(n,t,c)=>{e(te(t,n,c))},onEstablishConnectionClick:(n,t,c)=>{e(ne(n,i,t,c))},onUpdatePaymentAccountStatus:(n,t,c,u,d)=>{e(fe(n,t,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,t,c,u)=>{e(me(!1,n,u,c,t))},onEstablishConnectionSuccess:(n,t)=>{e(ge(t,n))},onUpdateAccountClick:(n,t,c,u,d)=>{e(d==="paymentAccount"?pe(n,t,c,u):Ke(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,c)=>{e($e(i,t,n,c))},onRemoveConnection:n=>{e(Ne(n))},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(On),dt=()=>{const e=_(),s=T(),o=k(),{tenantEmailDomain:l}=F(),i=O(),[n,t]=p.useState(!1),[c,u]=p.useState(!1),d=h(y=>j(y)),g=h(y=>y.settingsViewState.bankConnection.fetchState),f=Re(d,i?.loggedInUserRoleMap),m=Te(d,i?.loggedInUserRoleMap),r=Be(d,i?.loggedInUserRoleMap),x=Fe(d,i?.loggedInUserRoleMap),C=Oe(d,i?.loggedInUserRoleMap),w=d.companyId??E.getSignedInUserTenant(l)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||g==="Completed"||(u(!0),o(Ve(!1)))},[c,o,g]);const S=y=>{t(y)};return f||r||m||C?a.jsxs(rt,{children:[a.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),a.jsx(lt,{navigate:e,location:s,companyId:w,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:m,isZeniAccountEnabled:r,isChargeCardEnabled:C,isTreasuryEnabled:x,onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(R,{})},ut=U.div`
25
+ `,lt=B(function(e,s){const{companyId:o,isZeniAccountEnabled:l,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:c}=s,u=j(e);return{bankSetupView:Le(e,o,n,t,l,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}},function(e,s){const{navigate:o,currentTenant:l,companyId:i}=s;return{onFetchLinkTokenClick:(n,t,c)=>{e(te(t,n,c))},onEstablishConnectionClick:(n,t,c)=>{e(ne(n,i,t,c))},onUpdatePaymentAccountStatus:(n,t,c,u,d)=>{e(fe(n,t,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,t,c,u)=>{e(me(!1,n,u,c,t))},onEstablishConnectionSuccess:(n,t)=>{e(ge(t,n))},onUpdateAccountClick:(n,t,c,u,d)=>{e(d==="paymentAccount"?pe(n,t,c,u):Ke(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,c)=>{e($e(i,t,n,c))},onRemoveConnection:n=>{e(Ne(n))},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Fn),dt=()=>{const e=_(),s=R(),o=v(),{tenantEmailDomain:l}=O(),i=F(),[n,t]=p.useState(!1),[c,u]=p.useState(!1),d=h(y=>j(y)),g=h(y=>y.settingsViewState.bankConnection.fetchState),f=Te(d,i?.loggedInUserRoleMap),m=Re(d,i?.loggedInUserRoleMap),r=Be(d,i?.loggedInUserRoleMap),x=Oe(d,i?.loggedInUserRoleMap),C=Fe(d,i?.loggedInUserRoleMap),w=d.companyId??E.getSignedInUserTenant(l)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||g==="Completed"||(u(!0),o(Ve(!1)))},[c,o,g]);const S=y=>{t(y)};return f||r||m||C?a.jsxs(rt,{children:[a.jsx(P,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),a.jsx(lt,{navigate:e,location:s,companyId:w,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:m,isZeniAccountEnabled:r,isChargeCardEnabled:C,isTreasuryEnabled:x,onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(T,{})},ut=M.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -30,7 +30,7 @@ import{j as a}from"./liveblocks-CnWjJuBt.js";import{a as p}from"./sentry-1cGDtjw
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,pt=B(function(e,s){const{companyId:o}=s,l=j(e),i=s.roleMap.bill_pay_admin,n=Je(e,o),{uiState:t}=n,c=(ee(l?.userRole??[])||i)&&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:Ie.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:l.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:K}},function(e,s){const{navigate:o,currentTenant:l,companyId:i}=s;return{onFetchLinkTokenClick:(n,t)=>{e(te("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ge("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,c)=>{e(fe(n,t,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(me(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(pe(n,t,"billing","billing_setup"))},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(he(n))},handleConfirmCardSetupIntent:n=>{e(We(n))},updateCardPaymentModalState:n=>{e(Qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,c)=>{e(Ye(n,t,c))},handleFetchPaymentSources:()=>{e(W())},resetCardPaymentViewState:()=>{e(He())},handleResetCardPaymentErrorStatuses:()=>{e(qe())},onBillingAddressSave:n=>{e(Ze(n))},onAddressEditHandler:n=>{if(n!=null){const t=Hn(n);e(Ge({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(Ln),gt=()=>{const e=_(),s=T(),o=k(),{tenantEmailDomain:l}=F(),[i,n]=p.useState(!1),[t,c]=p.useState(!1),[u,d]=p.useState(!1),g=h(y=>j(y)),f=h(y=>y.cardPaymentViewState),m=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),r=Vn(f.addCardPaymentSourceStatus.fetchState),x=f.addCardPaymentSourceStatus.fetchState,C=g.companyId??E.getSignedInUserTenant(l)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=O();p.useEffect(()=>{C!=null&&o(ze(C,!1))},[C,o]),p.useEffect(()=>{t||(c(!0),o(W()))},[t,o]),p.useEffect(()=>{u||(he(["card"]),d(!0))},[u]),p.useEffect(()=>{r==="In-Progress"&&x==="Completed"&&o(W())},[r,x]);const S=y=>{n(y)};return w?.loggedInUserRoleMap!=null?a.jsxs(ut,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),a.jsx(pt,{navigate:e,location:s,companyId:C,currentTenant:g,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:Ie.googleMapsAPIKey})]}):a.jsx(se,{fetchState:m})},X="external_integrations",mt=B(function(e){const s=nn(e,X);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(s.map(o=>o.additionalInfo).filter(o=>o!=null))}},function(e,s){const{navigate:o,integrationsView:l,signedInUserEmail:i,tenantEmailDomain:n,tenantId:t}=s;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{l.integrations.refreshQBO.fetchState!=="In-Progress"&&e(rn())},onSaveChargeBeeCredentials:(c,u)=>{const d=l.externalConnections?.revenue?.find(g=>g.connectionName==="chargebee")?.connectionId;d!=null&&e(on(t,d,Y("revenue"),cn("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const d=l.externalConnections?.revenue?.find(g=>g.connectionName==="hubspot")?.connectionId;if(d!=null){const g=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:d,redirect_uri:g,tenant_id:t}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(g)}`}},onDisconnect:(c,u)=>{e(sn(t,c,Y(u)))},onSaveConnectorCredentials:c=>{e(an(t,Y("payments"),c))},onNotifyMe:c=>{e(tn(X,c,i))}}})(Nn),ft=()=>{const e=_(),s=k(),{tenantEmailDomain:o}=F(),[l,i]=p.useState(!1),n=h(r=>r.tenantState.fetchState),t=h(r=>j(r)),c=t.companyId??E.getSignedInUserTenant(o)?.companyId,u=E.getSignedInUser(),d=O(),g=ee(t.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{s(Xe(X))},[s]);const f=r=>{i(r)},m=h(r=>en(r,c));return d?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(v,{isAppContentDrawerOpen:l,handleDrawerToggle:f}),a.jsx(mt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:g,integrationsView:m,signedInUserEmail:u.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??o??"",tenantId:t.tenantId,saveChargeBeeState:m.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:m.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:m.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:m.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:m.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(m.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([r,x])=>[r,x?.message])),deleteConnectionState:m.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:m.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):a.jsx(se,{fetchState:n})},ht=U.div`
33
+ `,pt=B(function(e,s){const{companyId:o}=s,l=j(e),i=s.roleMap.bill_pay_admin,n=ze(e,o),{uiState:t}=n,c=(ee(l?.userRole??[])||i)&&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:Ie.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:l.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:K}},function(e,s){const{navigate:o,currentTenant:l,companyId:i}=s;return{onFetchLinkTokenClick:(n,t)=>{e(te("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ge("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,c)=>{e(fe(n,t,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(me(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(pe(n,t,"billing","billing_setup"))},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(he(n))},handleConfirmCardSetupIntent:n=>{e(Xe(n))},updateCardPaymentModalState:n=>{e(We({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,c)=>{e(qe(n,t,c))},handleFetchPaymentSources:()=>{e(X())},resetCardPaymentViewState:()=>{e(Qe())},handleResetCardPaymentErrorStatuses:()=>{e(He())},onBillingAddressSave:n=>{e(Ze(n))},onAddressEditHandler:n=>{if(n!=null){const t=Qn(n);e(Je({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(Ln),gt=()=>{const e=_(),s=R(),o=v(),{tenantEmailDomain:l}=O(),[i,n]=p.useState(!1),[t,c]=p.useState(!1),[u,d]=p.useState(!1),g=h(y=>j(y)),f=h(y=>y.cardPaymentViewState),m=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),r=Vn(f.addCardPaymentSourceStatus.fetchState),x=f.addCardPaymentSourceStatus.fetchState,C=g.companyId??E.getSignedInUserTenant(l)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=F();p.useEffect(()=>{C!=null&&o(Ge(C,!1))},[C,o]),p.useEffect(()=>{t||(c(!0),o(X()))},[t,o]),p.useEffect(()=>{u||(he(["card"]),d(!0))},[u]),p.useEffect(()=>{r==="In-Progress"&&x==="Completed"&&o(X())},[r,x]);const S=y=>{n(y)};return w?.loggedInUserRoleMap!=null?a.jsxs(ut,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),a.jsx(pt,{navigate:e,location:s,companyId:C,currentTenant:g,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:Ie.googleMapsAPIKey})]}):a.jsx(se,{fetchState:m})},Y="external_integrations",mt=B(function(e){const s=nn(e,Y);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(s.map(o=>o.additionalInfo).filter(o=>o!=null))}},function(e,s){const{navigate:o,integrationsView:l,signedInUserEmail:i,tenantEmailDomain:n,tenantId:t}=s;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{l.integrations.refreshQBO.fetchState!=="In-Progress"&&e(rn())},onSaveChargeBeeCredentials:(c,u)=>{const d=l.externalConnections?.revenue?.find(g=>g.connectionName==="chargebee")?.connectionId;d!=null&&e(on(t,d,q("revenue"),cn("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const d=l.externalConnections?.revenue?.find(g=>g.connectionName==="hubspot")?.connectionId;if(d!=null){const g=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:d,redirect_uri:g,tenant_id:t}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(g)}`}},onDisconnect:(c,u)=>{e(sn(t,c,q(u)))},onSaveConnectorCredentials:c=>{e(an(t,q("payments"),c))},onNotifyMe:c=>{e(tn(Y,c,i))}}})(Nn),ft=()=>{const e=_(),s=v(),{tenantEmailDomain:o}=O(),[l,i]=p.useState(!1),n=h(r=>r.tenantState.fetchState),t=h(r=>j(r)),c=t.companyId??E.getSignedInUserTenant(o)?.companyId,u=E.getSignedInUser(),d=F(),g=ee(t.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{s(Ye(Y))},[s]);const f=r=>{i(r)},m=h(r=>en(r,c));return d?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(P,{isAppContentDrawerOpen:l,handleDrawerToggle:f}),a.jsx(mt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:g,integrationsView:m,signedInUserEmail:u.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??o??"",tenantId:t.tenantId,saveChargeBeeState:m.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:m.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:m.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:m.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:m.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(m.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([r,x])=>[r,x?.message])),deleteConnectionState:m.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:m.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):a.jsx(se,{fetchState:n})},ht=M.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -38,7 +38,7 @@ import{j as a}from"./liveblocks-CnWjJuBt.js";import{a as p}from"./sentry-1cGDtjw
38
38
  flex-direction: column;
39
39
  align-items: center;
40
40
  background-color: ${e=>e.theme.colors.grey4};
41
- `,bt=U.div`
41
+ `,bt=M.div`
42
42
  display: flex;
43
43
  height: 100%;
44
44
  width: 100%;
@@ -46,7 +46,7 @@ import{j as a}from"./liveblocks-CnWjJuBt.js";import{a as p}from"./sentry-1cGDtjw
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,St=()=>{const e=k(),{tenantEmailDomain:s}=F(),[o,l]=p.useState(!1),i=h(r=>j(r)).companyId??E.getSignedInUserTenant(s)?.companyId,n=E.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=h(r=>ln(r,n.userId)),c=h(r=>dn(r,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,d=r=>{l(r)},g=p.useCallback(r=>{e(te("user_reimbursement_account",r))},[]),f=p.useCallback(r=>{e(ne(r,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(un(n.userId))},[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(bt,{children:[a.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),a.jsx($n,{plaidConnectionDetails:u,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:g,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},Ct=U.div`
49
+ `,St=()=>{const e=v(),{tenantEmailDomain:s}=O(),[o,l]=p.useState(!1),i=h(r=>j(r)).companyId??E.getSignedInUserTenant(s)?.companyId,n=E.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=h(r=>ln(r,n.userId)),c=h(r=>dn(r,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,d=r=>{l(r)},g=p.useCallback(r=>{e(te("user_reimbursement_account",r))},[]),f=p.useCallback(r=>{e(ne(r,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(un(n.userId))},[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(bt,{children:[a.jsx(P,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),a.jsx($n,{plaidConnectionDetails:u,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:g,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},Ct=M.div`
50
50
  display: flex;
51
51
  height: 100%;
52
52
  width: 100%;
@@ -54,4 +54,4 @@ import{j as a}from"./liveblocks-CnWjJuBt.js";import{a as p}from"./sentry-1cGDtjw
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,le=({appContent:e})=>{const s=k(),o=_(),l=T(),[i,n]=p.useState(!1),t=h(b=>j(b)),{tenantEmailDomain:c}=t,u=t.companyId??E.getSignedInUserTenant(c)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:g}=d(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(M.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=d(M.isDebitCardFeatureEnabled),{isFeatureEnabled:r}=d(M.isTreasuryEnabled),x=h(b=>ue(b)),C=be(t),w=Se(m,t),S=!w&&x,y=Kn(t,f,m),{areTenantIdsInSync:V}=zn();p.useEffect(()=>{V&&s(pn(u,S))},[u,s,S,V]);const A=h(b=>gn(b,S)),z=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||u==null,J=mn(t),G=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,L=b=>{n(b)};return a.jsxs(Ct,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:L}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Jn,{myProfileView:A,isAccountingClassesEnabled:x,isReimbursementDisabled:G===!1,isZeniAccountsDisabled:g===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:r===!1,isLiteRoleDisabled:J===!1,onClickMenuIcon:()=>{L(!0)},isLoading:z,isBankingOnlyTenant:w,isCardsOnlyTenant:C,onAddressClick:b=>{const D=function(q,H){let P=`/${q}/settings/my_profile`;return P=P.concat(`/new/${H}`),P}(c,b),Z=Gn(l.state?.pathnameStackToGoBack,l.pathname);o(D,{state:{pathnameStackToGoBack:Z}})},onGetOtp:b=>{const D={...A.myProfileLocalData,phone:b};s(oe({localData:D})),s(Sn(b,"MyProfile"))},onResendOtp:b=>{s(bn(b,"MyProfile"))},onCancelClick:()=>{s(hn())},onSaveClick:()=>{s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{s(fn(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&E.saveZeniOtpToken(b),s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{s(oe({localData:b}))}})]})};function yt(){const e=k(),s=h(r=>j(r)).companyId,o=h(r=>Cn(r)),l=h(r=>Ce(r)),i=E.getSignedInUser(),[n,t]=p.useState(!1),c=p.useCallback(r=>{t(r)},[]),u=p.useCallback(r=>{e(yn(r))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(In({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),g=p.useCallback(()=>{e(xn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const r=l.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(r,s))},[s,l.notificationSettings.monthEndInsightsNotificationSettings.enabled]),m=p.useCallback(()=>{e(En())},[]);return p.useEffect(()=>{if(l.fetchState==="Completed"&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"){const r=l.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(r,s))}},[o.fetchState,s,l.notificationSettings.monthEndInsightsNotificationSettings.enabled,l.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),a.jsx(Zn,{notificationSettingsView:o,onFormDataChange:u,onCancel:d,onSave:g,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:m})]})}function na(e){const[s,o]=p.useState(!1),l=h(r=>Ce(r)),i=h(r=>j(r)),n=O(),t=E.getSignedInUser(),c=k(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(M.isDebitCardFeatureEnabled),g=t?.userEmail==null||l.fetchState!=="Completed"||An(l.notificationSettings,t.userEmail,d,i);p.useEffect(()=>{l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&s===!1&&(o(!0),c(wn()))},[l.fetchState,s]);const f=Se(d,i),m=be(i);return l.fetchState!=="In-Progress"&&l.fetchState!=="Not-Started"||g!==!0?jn(i)?a.jsxs(Q,{children:[Pn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"accounting/*",element:a.jsx(st,{})}),kn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"approval_rules/*",element:a.jsx(It,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),vn(i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"my_bank_connections",element:a.jsx(St,{})}),Dn(i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"bank_connections",element:a.jsx(dt,{})}),Mn(i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"business_verification",element:a.jsx(Wn,{productType:f?"zeni_accounts":m?"charge_cards":Qn(i,n?.loggedInUserRoleMap)})}),Un(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"company_details",element:a.jsx(Xn,{})}),_n(n?.loggedInUserRole??[],i)&&a.jsx(I,{path:"billing",element:a.jsx(gt,{})}),Rn(n?.loggedInUserRole??[],d,i)&&a.jsx(I,{path:"integrations",element:a.jsx(ft,{})}),a.jsx(I,{path:"my_profile/new/:addressType",element:a.jsx(le,{appContent:a.jsx(Yn,{isSubPage:!1})})}),a.jsx(I,{path:"my_profile",element:a.jsx(le,{})}),g&&a.jsx(I,{path:"notifications",element:a.jsx(yt,{})}),a.jsx(I,{path:"*",element:a.jsx(R,{})})]}):a.jsx(Q,{children:a.jsx(I,{path:"*",element:a.jsx(R,{})})}):null}function It(e){return a.jsxs(Q,{children:[a.jsx(I,{path:"/",element:a.jsx(ct,{})}),a.jsx(I,{path:"bills/approval-rules/*",element:a.jsx(et,{})}),a.jsx(I,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(nt,{}):a.jsx(R,{})}),a.jsx(I,{path:"*",element:a.jsx(R,{})})]})}export{na as default};
57
+ `,le=({appContent:e})=>{const s=v(),o=_(),l=R(),[i,n]=p.useState(!1),t=h(b=>j(b)),{tenantEmailDomain:c}=t,u=t.companyId??E.getSignedInUserTenant(c)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:g}=d(U.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(U.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=d(U.isDebitCardFeatureEnabled),{isFeatureEnabled:r}=d(U.isTreasuryEnabled),x=h(b=>ue(b)),C=be(t),w=Se(m,t),S=!w&&x,y=Kn(t,f,m),{areTenantIdsInSync:V}=Gn();p.useEffect(()=>{V&&s(pn(u,S))},[u,s,S,V]);const A=h(b=>gn(b,S)),G=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||u==null,z=mn(t),J=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,L=b=>{n(b)};return a.jsxs(Ct,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:L}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(zn,{myProfileView:A,isAccountingClassesEnabled:x,isReimbursementDisabled:J===!1,isZeniAccountsDisabled:g===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:r===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{L(!0)},isLoading:G,isBankingOnlyTenant:w,isCardsOnlyTenant:C,onAddressClick:b=>{const D=function(H,Q){let k=`/${H}/settings/my_profile`;return k=k.concat(`/new/${Q}`),k}(c,b),Z=Jn(l.state?.pathnameStackToGoBack,l.pathname);o(D,{state:{pathnameStackToGoBack:Z}})},onGetOtp:b=>{const D={...A.myProfileLocalData,phone:b};s(oe({localData:D})),s(Sn(b,"MyProfile"))},onResendOtp:b=>{s(bn(b,"MyProfile"))},onCancelClick:()=>{s(hn())},onSaveClick:()=>{s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{s(fn(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&E.saveZeniOtpToken(b),s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{s(oe({localData:b}))}})]})};function yt(){const e=v(),s=h(r=>j(r)).companyId,o=h(r=>Cn(r)),l=h(r=>Ce(r)),i=E.getSignedInUser(),[n,t]=p.useState(!1),c=p.useCallback(r=>{t(r)},[]),u=p.useCallback(r=>{e(yn(r))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(In({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),g=p.useCallback(()=>{e(xn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const r=l.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(r,s))},[s,l.notificationSettings.monthEndInsightsNotificationSettings.enabled]),m=p.useCallback(()=>{e(En())},[]);return p.useEffect(()=>{if(l.fetchState==="Completed"&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"){const r=l.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(r,s))}},[o.fetchState,s,l.notificationSettings.monthEndInsightsNotificationSettings.enabled,l.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(P,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),a.jsx(Zn,{notificationSettingsView:o,onFormDataChange:u,onCancel:d,onSave:g,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:m})]})}function na(e){const[s,o]=p.useState(!1),l=h(r=>Ce(r)),i=h(r=>j(r)),n=F(),t=E.getSignedInUser(),c=v(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(U.isDebitCardFeatureEnabled),g=t?.userEmail==null||l.fetchState!=="Completed"||An(l.notificationSettings,t.userEmail,d,i);p.useEffect(()=>{l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&s===!1&&(o(!0),c(wn()))},[l.fetchState,s]);const f=Se(d,i),m=be(i);return l.fetchState!=="In-Progress"&&l.fetchState!=="Not-Started"||g!==!0?jn(i)?a.jsxs(W,{children:[kn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"accounting/*",element:a.jsx(st,{})}),vn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"approval_rules/*",element:a.jsx(It,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Pn(i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"my_bank_connections",element:a.jsx(St,{})}),Dn(i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"bank_connections",element:a.jsx(dt,{})}),Un(i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"business_verification",element:a.jsx(Xn,{productType:f?"zeni_accounts":m?"charge_cards":Wn(i,n?.loggedInUserRoleMap)})}),Mn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&a.jsx(I,{path:"company_details",element:a.jsx(Yn,{})}),_n(n?.loggedInUserRole??[],i)&&a.jsx(I,{path:"billing",element:a.jsx(gt,{})}),Tn(n?.loggedInUserRole??[],d,i)&&a.jsx(I,{path:"integrations",element:a.jsx(ft,{})}),a.jsx(I,{path:"my_profile/new/:addressType",element:a.jsx(le,{appContent:a.jsx(qn,{isSubPage:!1})})}),a.jsx(I,{path:"my_profile",element:a.jsx(le,{})}),g&&a.jsx(I,{path:"notifications",element:a.jsx(yt,{})}),a.jsx(I,{path:"*",element:a.jsx(T,{})})]}):a.jsx(W,{children:a.jsx(I,{path:"*",element:a.jsx(T,{})})}):null}function It(e){return a.jsxs(W,{children:[a.jsx(I,{path:"/",element:a.jsx(ct,{})}),a.jsx(I,{path:"bills/approval-rules/*",element:a.jsx(et,{})}),a.jsx(I,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(nt,{}):a.jsx(T,{})}),a.jsx(I,{path:"*",element:a.jsx(T,{})})]})}export{na as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-CnWjJuBt.js";import{h as Q,g as Y,u as X,i as G,j as E,N as j,n as W,s as Ye}from"./core-B01_r_a6.js";import{bF as Xe,cl as Ie,Nk as ye,eP as x,cx as en,x$ as Z,xQ as nn,Nw as tn,Nz as an,qo as ee,qc as ne,ke as te,sn as z,NB as Ae,fE as $e,fD as Ge,fC as We,NC as sn,y8 as on,B$ as ke,BS as _e,BP as ve,BG as K,BV as Pe,BY as Ee,C2 as we,sR as De,fT as cn,cs as rn,e_ as un,eY as dn,eZ as ln,bs as pn,ND as mn,AI as le,Bk as yn,NE as fn,bG as gn,Df as pe,Cj as Sn,NF as bn,NG as hn,Dj as Cn,Dn as In,sg as An,HM as kn,DU as Ce,EN as me,NH as _n,NI as vn,NJ as Pn,NK as He,NL as En,Ke as wn,MJ as Dn,Kq as Tn,NM as qe,NN as Fe,E6 as Ke,km as Un,qf as Je,sp as On,bE as Ne,sB as je,cv as Bn,NO as Qe,fh as Fn,DC as xn,DG as Vn,NP as Nn,DX as Re,NQ as jn,NR as Rn,NS as zn,NT as Ln,fM as Mn,zj as Zn,NU as $n,zo as Gn,zn as Wn}from"./zeni-epic-state-BFnJgXOA.js";import{k as ae,S as ie,c as de,h as Te,aN as J,z as w,w as se,d as D,B as Ue,f as $,bx as Hn,at as oe,by as V,bz as qn,bA as Kn,af as Ve,bB as Jn,r as ze,au as Le,J as Qn,A as Yn,bC as Xn,bD as et,bE as nt,a7 as tt}from"./index-b9cGMwNO.js";import{a as C}from"./sentry-1cGDtjwd.js";import{n as xe,D as at,S as it}from"./mui-DRaG-BlK.js";import{M as fe}from"./MobileAppDrawer-ztL55BFc.js";import R from"./NotFoundScreen-CbugOr9O.js";import{a as Me}from"./analyticsHelper-Bgdq7lAB.js";import{d as Ze}from"./routePaths-Sv0e7DY5.js";import{B as Be}from"./BusinessVerificationPageScreen-e2XdUw9z.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]="9fed627b-f14b-4b09-8783-a8df948df118",e._sentryDebugIdIdentifier="sentry-dbid-9fed627b-f14b-4b09-8783-a8df948df118")}catch{}})();const st=xe.div`
1
+ import{j as u}from"./liveblocks-BiGkkGoP.js";import{h as J,g as Y,u as X,i as H,j as E,N as j,n as W,s as Ye}from"./core-DYij5xsh.js";import{bF as Xe,cl as Ie,Nl as ye,eQ as x,cx as en,y0 as Z,xR as nn,Nx as tn,NA as an,qp as ee,qd as ne,kf as te,so as z,NC as Ae,fF as $e,fE as He,fD as We,ND as sn,y9 as on,C0 as ke,BT as _e,BQ as ve,BH as K,BW as Pe,BZ as Ee,C3 as De,sS as we,fU as cn,cs as rn,e$ as un,eZ as dn,e_ as ln,bs as pn,NE as mn,AJ as le,Bl as yn,NF as fn,bG as gn,Dg as pe,Ck as Sn,NG as bn,NH as hn,Dk as Cn,Do as In,sh as An,HN as kn,DV as Ce,EO as me,NI as _n,NJ as vn,NK as Pn,NL as Ge,NM as En,Kf as Dn,MK as wn,Kr as Tn,NN as qe,NO as Fe,E7 as Ke,kn as Un,qg as Qe,sq as On,bE as Ne,sC as je,cv as Bn,NP as Je,fi as Fn,DD as xn,DH as Vn,NQ as Nn,DY as Re,NR as jn,NS as Rn,NT as zn,NU as Ln,fN as Mn,zk as Zn,NV as $n,zp as Hn,zo as Wn}from"./zeni-epic-state-YenBAkdY.js";import{A as ae,n as ie,c as de,h as Te,aN as Q,z as D,x as se,d as w,B as Ue,f as $,bx as Gn,at as oe,by as V,bz as qn,bA as Kn,af as Ve,bB as Qn,r as ze,au as Le,k as Jn,y as Yn,bC as Xn,bD as et,bE as nt,a7 as tt}from"./index-BCP41PwF.js";import{a as C}from"./sentry-DQGl2YSn.js";import{n as xe,D as at,S as it}from"./mui-CdvNR06J.js";import{M as fe}from"./MobileAppDrawer-Biso_61t.js";import R from"./NotFoundScreen-C0-Skng9.js";import{a as Me}from"./analyticsHelper-tq4PT7c_.js";import{d as Ze}from"./routePaths-jIme_4o7.js";import{B as Be}from"./BusinessVerificationPageScreen-DRR9km69.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]="fb5c2207-024f-4728-b438-091e24102661",e._sentryDebugIdIdentifier="sentry-dbid-fb5c2207-024f-4728-b438-091e24102661")}catch{}})();const st=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-CnWjJuBt.js";import{h as Q,g as Y,u as X,i as G,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ot=W(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=x(e),n=tn(e),i=w.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=an(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Z(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(De("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(Z(a,!0))},onEnableBillPayClick:()=>{e(K(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"bill_pay","bill_pay_setup"):ve("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(a))},onAcceptUpdatedTOSSuccess:()=>{e(Z(a,!0))},onGetOtp:(n,i)=>{e(We(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Hn),ct=()=>{const e=Q(),o=Y(),t=X(),{tenantEmailDomain:a}=G(),c=ae(),n=Xe(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=ie(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),y=Te(),{configValue:I}=s(J.zeniAccountsConfig),d=ye(I),[m,S]=C.useState(!1),v=C.useRef(!1),[g,f]=C.useState(!1),P=E(B=>B.billPaySetupViewState.fetchState),A=E(B=>x(B)),_=E(B=>B.billPaySetupApproverViewState.fetchState),b=A.companyId??w.getSignedInUserTenant(a)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const k=!!A.companyBillPayInfo?.info?.isBillPayTOSAccepted,h=en(c?.loggedInUserRoleMap);C.useEffect(()=>{v.current||P!=="Not-Started"||b==null?v.current||P!=="Completed"||b==null||A.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(v.current=!0,t(Z(b,!1,!0))):(v.current=!0,t(Z(b,!0)))},[P,b,t]),C.useEffect(()=>{g||_!=="Not-Started"||(f(!0),t(nn(!0)))},[g,_,t]);const T=B=>{S(B)};if(k===!1||h&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(k===!0&&c?.loggedInUserRoleMap!=null){const B=U=>U.trackPageLoaded($.Event.billPaySetup);return u.jsxs(st,{children:[u.jsx(se,{analytics:D,onLoad:U=>B(U)}),u.jsx(fe,{isAppContentDrawerOpen:m,handleDrawerToggle:T}),u.jsx(ot,{navigate:e,location:o,companyId:b,currentTenant:A,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{T(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},Rt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,zt=e=>`/${e}/cards`,Lt=e=>`/${e}/cards/setup`,Mt=e=>`/${e}/cards/onboard`,Zt=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},$t=(e,o)=>e.find(t=>t.id===o),Gt=(e,o,t)=>!e||!o||t.fetchState==="Completed",rt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Wt=(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,Ht=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:V(a.limit.amount),creditAccountAvailableAmount:V(a.available.amount),creditAccountSpentAmount:V(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:V(c.remainingAmountDue.amount)}:void 0,qt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>V(n.accountBalance.available.amount)),debitCardsSpend:V(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Kt=(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,Jt=80,Qt=80,Yt=e=>e.companyId??w.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,ut=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,dt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),Xt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,ea=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),lt=W(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=x(e),l=w.getSignedInUser(),s=i.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:D,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:y,businessVerificationStatus:I}=o;return{onBusinessVerificationSectionClick:()=>{D.trackCardsVerifyIdentityCompanyDetailsClick(y,p,I?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onFetchLinkTokenClick:(d,m)=>{e(De("charge_card_setup",d,m))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,m,S)=>{e(Ee(d,m,"charge_cards","charge_card_setup",S))},onUpdatePaymentAccountLoginStatus:(d,m)=>{e(Pe(!1,d,"charge_cards","charge_card_setup",m))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{D.trackCardsEnableCardsClick(y,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(K(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(K(a,"charge_cards")):i===!0&&r===!1&&e(K(a,"debit_cards"))},onUpdateChargeCardClick:(d,m,S)=>{const v=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(f=>f.accountId===d);D.trackCardsZeniCashAccountChangeClick(y,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(S==="paymentAccount"?_e(d,m,"charge_cards","charge_card_setup"):ve("charge_card_setup",d,m))},onUpdatePrimaryFundingAccount:(d,m)=>{const S=n.allFundingAccounts.find(f=>f.id===d),v=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(f=>f.id===d)+1;D.trackCardsPaymentAccountChangeClick(y,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:S?.label??"",newPaymentAccountBalance:V(S?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:S?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,m))},onEnableChargeCardSuccess:()=>{e(fn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,m)=>{e(Ae({officerType:d,fileIds:m}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(te({files:d}))},onDeleteFile:d=>{e(ne(d))},onEditFileName:(d,m)=>{e(ee(d,m.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(yn(a,d))}}})(qn),pt=()=>{const e=Q(),o=Y(),t=X(),{tenantEmailDomain:a}=G(),c=ae(),n=E(L=>x(L)),{useDynamicConfig:i,useFeatureGate:l}=ie(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(J.zeniAccountsConfig),{configValue:p}=i(J.zeniCardsConfig),y=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:I}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=l(de.isEarlyPayFeatureEnabled),S=E(L=>cn(L,n.companyId)),v=rn(S.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,P=un(I,n),A=ut({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:P}),_=dn(n),b=ln(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,h=dt({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:d,isBookKeepingTenant:b,isDebitCardProductVisible:A,chargeCardsCreditAccountLimit:k}),T=A&&h===!1,B=A===!1&&h,U=ye(r),F=pn(c?.loggedInUserRoleMap),ce=Ie(c?.loggedInUserRoleMap),[H,ge]=C.useState(!1),[q,re]=C.useState(!1),M=E(L=>L.chargeCardSetupViewState.fetchState),N=w.getSignedInUserTenant(a)?.companyId??n.companyId,O=w.getSignedInUser(),Oe=L=>{ge(L)},Se=E(L=>mn(L,N));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||M!=="Not-Started"||N==null?q||M!=="Completed"||N==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(N,!1,!0)):(re(!0),t(le(N,!0)))},[q,M,N,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=rt(h,A,f,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded($.Event.cardsSetupVisited),D.trackCardsCardSetupView(v,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:H,handleDrawerToggle:Oe}),u.jsx(lt,{autoPayThreshold:y,navigate:e,location:o,companyId:N,currentTenant:n,isEarlyPayEnabled:m,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:F,isDebitCardOnlyEnabled:T,isCreditCardOnlyEnabled:B,chargeCardSetUpView:Se,isCreditCardProductVisible:h,isDebitCardFeatureEnabled:A,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:f,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:v,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:ce,accountsPromoConfig:U})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},mt=xe.div`
9
+ `,ot=W(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=x(e),n=tn(e),i=D.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=an(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Z(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(we("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(De(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(Z(a,!0))},onEnableBillPayClick:()=>{e(K(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"bill_pay","bill_pay_setup"):ve("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(a))},onAcceptUpdatedTOSSuccess:()=>{e(Z(a,!0))},onGetOtp:(n,i)=>{e(We(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(He(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Gn),ct=()=>{const e=J(),o=Y(),t=X(),{tenantEmailDomain:a}=H(),c=ae(),n=Xe(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=ie(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),y=Te(),{configValue:I}=s(Q.zeniAccountsConfig),d=ye(I),[m,S]=C.useState(!1),v=C.useRef(!1),[g,f]=C.useState(!1),P=E(B=>B.billPaySetupViewState.fetchState),A=E(B=>x(B)),_=E(B=>B.billPaySetupApproverViewState.fetchState),b=A.companyId??D.getSignedInUserTenant(a)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const k=!!A.companyBillPayInfo?.info?.isBillPayTOSAccepted,h=en(c?.loggedInUserRoleMap);C.useEffect(()=>{v.current||P!=="Not-Started"||b==null?v.current||P!=="Completed"||b==null||A.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(v.current=!0,t(Z(b,!1,!0))):(v.current=!0,t(Z(b,!0)))},[P,b,t]),C.useEffect(()=>{g||_!=="Not-Started"||(f(!0),t(nn(!0)))},[g,_,t]);const T=B=>{S(B)};if(k===!1||h&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(k===!0&&c?.loggedInUserRoleMap!=null){const B=U=>U.trackPageLoaded($.Event.billPaySetup);return u.jsxs(st,{children:[u.jsx(se,{analytics:w,onLoad:U=>B(U)}),u.jsx(fe,{isAppContentDrawerOpen:m,handleDrawerToggle:T}),u.jsx(ot,{navigate:e,location:o,companyId:b,currentTenant:A,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{T(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},Rt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,zt=e=>`/${e}/cards`,Lt=e=>`/${e}/cards/setup`,Mt=e=>`/${e}/cards/onboard`,Zt=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},$t=(e,o)=>e.find(t=>t.id===o),Ht=(e,o,t)=>!e||!o||t.fetchState==="Completed",rt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Wt=(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,Gt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:V(a.limit.amount),creditAccountAvailableAmount:V(a.available.amount),creditAccountSpentAmount:V(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:V(c.remainingAmountDue.amount)}:void 0,qt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>V(n.accountBalance.available.amount)),debitCardsSpend:V(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Kt=(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,Qt=80,Jt=80,Yt=e=>e.companyId??D.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,ut=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,dt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),Xt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,ea=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),lt=W(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=x(e),l=D.getSignedInUser(),s=i.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:y,businessVerificationStatus:I}=o;return{onBusinessVerificationSectionClick:()=>{w.trackCardsVerifyIdentityCompanyDetailsClick(y,p,I?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onFetchLinkTokenClick:(d,m)=>{e(we("charge_card_setup",d,m))},onEstablishConnectionClick:d=>{e(De(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,m,S)=>{e(Ee(d,m,"charge_cards","charge_card_setup",S))},onUpdatePaymentAccountLoginStatus:(d,m)=>{e(Pe(!1,d,"charge_cards","charge_card_setup",m))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{w.trackCardsEnableCardsClick(y,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(K(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(K(a,"charge_cards")):i===!0&&r===!1&&e(K(a,"debit_cards"))},onUpdateChargeCardClick:(d,m,S)=>{const v=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(f=>f.accountId===d);w.trackCardsZeniCashAccountChangeClick(y,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(S==="paymentAccount"?_e(d,m,"charge_cards","charge_card_setup"):ve("charge_card_setup",d,m))},onUpdatePrimaryFundingAccount:(d,m)=>{const S=n.allFundingAccounts.find(f=>f.id===d),v=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(f=>f.id===d)+1;w.trackCardsPaymentAccountChangeClick(y,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:S?.label??"",newPaymentAccountBalance:V(S?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:S?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,m))},onEnableChargeCardSuccess:()=>{e(fn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,m)=>{e(Ae({officerType:d,fileIds:m}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(te({files:d}))},onDeleteFile:d=>{e(ne(d))},onEditFileName:(d,m)=>{e(ee(d,m.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(yn(a,d))}}})(qn),pt=()=>{const e=J(),o=Y(),t=X(),{tenantEmailDomain:a}=H(),c=ae(),n=E(L=>x(L)),{useDynamicConfig:i,useFeatureGate:l}=ie(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(Q.zeniAccountsConfig),{configValue:p}=i(Q.zeniCardsConfig),y=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:I}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=l(de.isEarlyPayFeatureEnabled),S=E(L=>cn(L,n.companyId)),v=rn(S.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,P=un(I,n),A=ut({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:P}),_=dn(n),b=ln(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,h=dt({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:d,isBookKeepingTenant:b,isDebitCardProductVisible:A,chargeCardsCreditAccountLimit:k}),T=A&&h===!1,B=A===!1&&h,U=ye(r),F=pn(c?.loggedInUserRoleMap),ce=Ie(c?.loggedInUserRoleMap),[G,ge]=C.useState(!1),[q,re]=C.useState(!1),M=E(L=>L.chargeCardSetupViewState.fetchState),N=D.getSignedInUserTenant(a)?.companyId??n.companyId,O=D.getSignedInUser(),Oe=L=>{ge(L)},Se=E(L=>mn(L,N));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||M!=="Not-Started"||N==null?q||M!=="Completed"||N==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(N,!1,!0)):(re(!0),t(le(N,!0)))},[q,M,N,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=rt(h,A,f,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:()=>{w.trackPageLoaded($.Event.cardsSetupVisited),w.trackCardsCardSetupView(v,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:G,handleDrawerToggle:Oe}),u.jsx(lt,{autoPayThreshold:y,navigate:e,location:o,companyId:N,currentTenant:n,isEarlyPayEnabled:m,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:F,isDebitCardOnlyEnabled:T,isCreditCardOnlyEnabled:B,chargeCardSetUpView:Se,isCreditCardProductVisible:h,isDebitCardFeatureEnabled:A,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:f,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:v,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:ce,accountsPromoConfig:U})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},mt=xe.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-CnWjJuBt.js";import{h as Q,g as Y,u as X,i as G,
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,yt=W(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=x(e),n=bn(e),i=hn(e,a),l=w.getSignedInUser(),s=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&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",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:r,denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,description:d}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(Cn(a)),D.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(De("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(K(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"reimbursement","reimbursement_setup"):ve("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"reimbursement_setup",n,i))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Kn),ft=()=>{const e=Q(),o=Y(),t=X(),{tenantEmailDomain:a}=G(),c=ae(),{useDynamicConfig:n}=ie(),i=Te(),{configValue:l}=n(J.zeniAccountsConfig),s=ye(l),r=gn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[y,I]=C.useState(!1),d=C.useRef(!1),[m,S]=C.useState(!1),v=E(b=>b.remiSetupViewState.fetchState),g=E(b=>x(b)),f=E(b=>b.remiSetupApproverViewState.fetchState),P=w.getSignedInUserTenant(a)?.companyId??g.companyId,A=w.getSignedInUser(),_=b=>{I(b)};if(A==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||v!=="Not-Started"||P==null?d.current||v!=="Completed"||P==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(P,!1,!0))):(d.current=!0,t(pe(P,!0)))},[v,P,t]),C.useEffect(()=>{m||f!=="Not-Started"||(S(!0),t(Sn(!0)))},[m,f,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const b=k=>k.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:D,onLoad:k=>b(k)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:_}),u.jsx(yt,{navigate:e,location:o,companyId:P,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{_(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},gt=W(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=x(e),n=w.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=wn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Dn(e.companyConfigState),p=Tn(e.userRoleConfigState),y=a==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:y}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:i}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:s=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:y,companyLegalName:I,companyTaxId:d,companyWebsite:m,companyPhone:S,primaryContactEmail:v,primaryContactName:g,primaryContactUserId:f,primaryContactSyncToken:P,syncToken:A,fileIds:_,incDate:b,typeOfIncorporation:k,stateOfIncorporation:h,sourceOfFunds:T,companySubIndustry:B,countriesOfOperations:U,companySourceOfFunds:F,companySourceOfFundsDescription:ce,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:M,regulatedStatusDescription:N,usNexus:O,usNexusTypes:Oe}=s,Se=y?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:I,taxIdOrEIN:d,website:m!=""&&m!=null?Bn(m):void 0,phone:S,syncToken:A,fileIds:_,incDate:b!=null?Ne(b?.toString()):b,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",sourceOfFunds:T?.selectedOption??"",companySubIndustry:B?.selectedOption??"",countriesOfOperations:U?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:F?.selectedOption??"",companySourceOfFundsDescription:ce,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:M??"",regulatedStatusDescription:N,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:f,firstName:g.firstName,lastName:g.lastName,email:v,syncToken:P};e(je({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:y,userId:I,name:d,email:m,nationalityCountryCode:S,ssn:v,dob:g,phone:f,syncToken:P,selectDocument:A,role:_,ownership:b,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:T,fileIds:B}=p;let U;return A.selectDocumentType==="driverLicense"?U="driving_license":A.selectDocumentType==="passport"?U="passport":A.selectDocumentType==="stateId"?U="id_document":A.selectDocumentType==="ssnCard"&&(U="social_security_card"),{officerType:y,userId:I,firstName:d.firstName,lastName:d.lastName,email:m,ssn:v,nationalityCountryCode:S?.selectedOption!=null?Le(S.selectedOption):void 0,phone:f,birthday:g!=null?Ne(g?.toString()):g,syncToken:P,titleAtCompany:_.selectedOption,ownershipInCompany:b,documentTypeSelectedForVerification:U,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:T,fileIds:B,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(je({officers:r}))},onSaveDetailsClick:s=>{e(z(t,s,a))},onSendForVerificationClick:s=>{e(z(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I={};y.forEach((d,m)=>{I[m]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I=Object.fromEntries(y.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onBackClick:()=>{e(On({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onDeleteFileList:s=>{e(Je(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onGetOtp:s=>{e(We(s,"SpendManagementSetup"))},onResendOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(Un({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(Fe())}}})(Jn),St=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Q(),c=Y(),n=X(),[i]=Ye(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:y}=G(),I=ae(),{useDynamicConfig:d}=ie(),m=Te(),{configValue:S}=d(J.zeniAccountsConfig),v=ye(S),g=E(h=>{switch(e){case"zeni_accounts":return h.zeniAccountSetupViewState.fetchState;case"reimbursement":return h.remiSetupViewState.fetchState;case"charge_cards":return h.chargeCardSetupViewState.fetchState;case"zeni_treasury":return h.treasurySetupViewState.fetchState;default:return h.billPaySetupViewState.fetchState}}),f=E(h=>h.companyConfigState.fetchState),P=E(h=>h.userRoleConfigState.fetchState),A=E(h=>x(h)),_=A.companyId??w.getSignedInUserTenant(y)?.companyId;if(C.useEffect(()=>{f==="Not-Started"&&n(An()),P==="Not-Started"&&n(kn(!0))},[f,P,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&_!=null)switch(p(!0),e){case"zeni_accounts":n(me(_,!0));break;case"zeni_treasury":n(Ce(_,!0));break;case"reimbursement":n(pe(_,!0));break;case"charge_cards":n(le(_,!0));break;default:n(Z(_,!0))}},[r,g,_,n]),w.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let b;switch(e){case"zeni_accounts":b=A.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":b=A.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":b=A.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||A.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":b=A.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:b=A.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=E(h=>{let T;switch(e){case"zeni_accounts":T=En(h,_);break;case"zeni_treasury":T=He(h,_);break;case"charge_cards":T=Pn(h,_);break;case"reimbursement":T=vn(h,_);break;default:T=_n(h,_)}return T});return b===!1?null:k.fetchState==="Completed"&&b===!0&&I?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:h=>(T=>{switch(e){case"zeni_accounts":return T.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return T.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return T.trackPageLoaded($.Event.billPayBusinessVerification,Ve(c)?"Settings":void 0)}})(h)}),u.jsx(gt,{businessVerificationDetails:k,navigate:a,location:c,companyId:_,analytics:D,currentTenant:A,productType:e,roleMap:I.loggedInUserRoleMap,isSettings:Ve(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:v.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})},bt={overlayWidth:new Yn(100,100,59)},ht=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=x(e),i=w.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Qe(e,a),p=He(e,a),y=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",I=Nn(e),d=I.transactions,m=qe(e),S=I.accountSummary?.totalBalance?.amount,v=d.length===0||S===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:m,isFirstTransfer:v,isDisabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(zn(s))},onBusinessVerificationSectionClick:(s,r)=>{let p="../verification";s&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Ce(a,!1,!0))},onFetchLinkTokenClick:(s,r)=>{e(De("treasury_setup",s,r))},onEstablishConnectionClick:s=>{e(we(s,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,r,p)=>{e(Ee(s,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,r)=>{e(Pe(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(K(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?_e(s,r,"zeni_treasury","treasury_setup"):ve("treasury_setup",s,r))},onUpdatePrimaryFundingAccount:(s,r)=>{e(ke(a,"treasury_setup",s,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,r)=>{e(Ae({officerType:s,fileIds:r}))},onSendForVerificationClick:(s,r)=>{if(e(z(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(Re(!1))}r===!0&&e(Ke())},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(Rn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(jn(s))},onConfirmFundAllocation:()=>{e(Re(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Fe())}}})(Xn),Ct=()=>{const e=Q(),o=Y(),t=X(),a=Te(),c=Qn(),{tenantEmailDomain:n}=G(),{useDynamicConfig:i}=ie(),l=ae(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:y}=i(J.zeniAccountsConfig),I=ye(y),[d,m]=C.useState(!1),[S,v]=C.useState(!1),[g,f]=C.useState(!1),[P,A]=C.useState(!1),[_,b]=C.useState(!1),k=E(O=>O.treasurySetupViewState.fetchState),h=E(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),T=E(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),B=E(O=>O.treasuryDetailState.transactionsState?.fetchState),U=E(O=>x(O)),F=w.getSignedInUserTenant(n)?.companyId??U.companyId,ce=E(O=>Qe(O,F)),H=ce.isAtomicAccountExists,ge=!!U.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=w.getSignedInUser(),re=O=>{m(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{S||k!=="Not-Started"||F==null||(v(!0),t(Ce(F,!0,!1)))},[S,k,F,t]),C.useEffect(()=>{g||h!=="Not-Started"||F==null||(f(!0),t(Fn()))},[g,h,F,t]),C.useEffect(()=>{P||T!=="Not-Started"||F==null||(A(!0),t(xn()))},[P,T,F,t]),C.useEffect(()=>{_||B!=="Not-Started"||F==null||(b(!0),t(Vn(!0)))},[_,B,F,t]);const M=U.companyTreasuryInfo?.info?.businessVerificationStatus?.code,N=M==="pending_review"||M==="verified";return C.useEffect(()=>{s||k!=="Completed"||H||N||!o.pathname.includes("setup")||r(!0)},[k,H,N]),U.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(at,{onClose:()=>{t(Fe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:bt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(It,{onClick:O=>O.stopPropagation(),children:u.jsx(St,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Fe()),e("../setup")}})})}),u.jsx(ht,{navigate:e,location:o,companyId:F,currentTenant:U,isUserZeniAccountsAdmin:p,accountsPromoConfig:I,isAccountsEnabled:ge,isAllocationDone:H,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},It=xe(it)`
17
+ `,yt=W(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=x(e),n=bn(e),i=hn(e,a),l=D.getSignedInUser(),s=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&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",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:r,denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,description:d}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(Cn(a)),w.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(we("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(De(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(K(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"reimbursement","reimbursement_setup"):ve("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"reimbursement_setup",n,i))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Kn),ft=()=>{const e=J(),o=Y(),t=X(),{tenantEmailDomain:a}=H(),c=ae(),{useDynamicConfig:n}=ie(),i=Te(),{configValue:l}=n(Q.zeniAccountsConfig),s=ye(l),r=gn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[y,I]=C.useState(!1),d=C.useRef(!1),[m,S]=C.useState(!1),v=E(b=>b.remiSetupViewState.fetchState),g=E(b=>x(b)),f=E(b=>b.remiSetupApproverViewState.fetchState),P=D.getSignedInUserTenant(a)?.companyId??g.companyId,A=D.getSignedInUser(),_=b=>{I(b)};if(A==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||v!=="Not-Started"||P==null?d.current||v!=="Completed"||P==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(P,!1,!0))):(d.current=!0,t(pe(P,!0)))},[v,P,t]),C.useEffect(()=>{m||f!=="Not-Started"||(S(!0),t(Sn(!0)))},[m,f,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const b=k=>k.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:w,onLoad:k=>b(k)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:_}),u.jsx(yt,{navigate:e,location:o,companyId:P,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{_(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},gt=W(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=x(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Dn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=wn(e.companyConfigState),p=Tn(e.userRoleConfigState),y=a==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:y}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:i}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:s=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:y,companyLegalName:I,companyTaxId:d,companyWebsite:m,companyPhone:S,primaryContactEmail:v,primaryContactName:g,primaryContactUserId:f,primaryContactSyncToken:P,syncToken:A,fileIds:_,incDate:b,typeOfIncorporation:k,stateOfIncorporation:h,sourceOfFunds:T,companySubIndustry:B,countriesOfOperations:U,companySourceOfFunds:F,companySourceOfFundsDescription:ce,transactionVolume:G,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:M,regulatedStatusDescription:N,usNexus:O,usNexusTypes:Oe}=s,Se=y?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:I,taxIdOrEIN:d,website:m!=""&&m!=null?Bn(m):void 0,phone:S,syncToken:A,fileIds:_,incDate:b!=null?Ne(b?.toString()):b,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",sourceOfFunds:T?.selectedOption??"",companySubIndustry:B?.selectedOption??"",countriesOfOperations:U?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:F?.selectedOption??"",companySourceOfFundsDescription:ce,transactionVolume:G?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:M??"",regulatedStatusDescription:N,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:f,firstName:g.firstName,lastName:g.lastName,email:v,syncToken:P};e(je({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:y,userId:I,name:d,email:m,nationalityCountryCode:S,ssn:v,dob:g,phone:f,syncToken:P,selectDocument:A,role:_,ownership:b,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:T,fileIds:B}=p;let U;return A.selectDocumentType==="driverLicense"?U="driving_license":A.selectDocumentType==="passport"?U="passport":A.selectDocumentType==="stateId"?U="id_document":A.selectDocumentType==="ssnCard"&&(U="social_security_card"),{officerType:y,userId:I,firstName:d.firstName,lastName:d.lastName,email:m,ssn:v,nationalityCountryCode:S?.selectedOption!=null?Le(S.selectedOption):void 0,phone:f,birthday:g!=null?Ne(g?.toString()):g,syncToken:P,titleAtCompany:_.selectedOption,ownershipInCompany:b,documentTypeSelectedForVerification:U,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:T,fileIds:B,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(je({officers:r}))},onSaveDetailsClick:s=>{e(z(t,s,a))},onSendForVerificationClick:s=>{e(z(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I={};y.forEach((d,m)=>{I[m]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I=Object.fromEntries(y.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onBackClick:()=>{e(On({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onDeleteFileList:s=>{e(Qe(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onGetOtp:s=>{e(We(s,"SpendManagementSetup"))},onResendOtp:s=>{e(He(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(Un({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(Fe())}}})(Qn),St=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=J(),c=Y(),n=X(),[i]=Ye(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:y}=H(),I=ae(),{useDynamicConfig:d}=ie(),m=Te(),{configValue:S}=d(Q.zeniAccountsConfig),v=ye(S),g=E(h=>{switch(e){case"zeni_accounts":return h.zeniAccountSetupViewState.fetchState;case"reimbursement":return h.remiSetupViewState.fetchState;case"charge_cards":return h.chargeCardSetupViewState.fetchState;case"zeni_treasury":return h.treasurySetupViewState.fetchState;default:return h.billPaySetupViewState.fetchState}}),f=E(h=>h.companyConfigState.fetchState),P=E(h=>h.userRoleConfigState.fetchState),A=E(h=>x(h)),_=A.companyId??D.getSignedInUserTenant(y)?.companyId;if(C.useEffect(()=>{f==="Not-Started"&&n(An()),P==="Not-Started"&&n(kn(!0))},[f,P,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&_!=null)switch(p(!0),e){case"zeni_accounts":n(me(_,!0));break;case"zeni_treasury":n(Ce(_,!0));break;case"reimbursement":n(pe(_,!0));break;case"charge_cards":n(le(_,!0));break;default:n(Z(_,!0))}},[r,g,_,n]),D.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let b;switch(e){case"zeni_accounts":b=A.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":b=A.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":b=A.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||A.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":b=A.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:b=A.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=E(h=>{let T;switch(e){case"zeni_accounts":T=En(h,_);break;case"zeni_treasury":T=Ge(h,_);break;case"charge_cards":T=Pn(h,_);break;case"reimbursement":T=vn(h,_);break;default:T=_n(h,_)}return T});return b===!1?null:k.fetchState==="Completed"&&b===!0&&I?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:h=>(T=>{switch(e){case"zeni_accounts":return T.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return T.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return T.trackPageLoaded($.Event.billPayBusinessVerification,Ve(c)?"Settings":void 0)}})(h)}),u.jsx(gt,{businessVerificationDetails:k,navigate:a,location:c,companyId:_,analytics:w,currentTenant:A,productType:e,roleMap:I.loggedInUserRoleMap,isSettings:Ve(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:v.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})},bt={overlayWidth:new Yn(100,100,59)},ht=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=x(e),i=D.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Je(e,a),p=Ge(e,a),y=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",I=Nn(e),d=I.transactions,m=qe(e),S=I.accountSummary?.totalBalance?.amount,v=d.length===0||S===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:m,isFirstTransfer:v,isDisabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(zn(s))},onBusinessVerificationSectionClick:(s,r)=>{let p="../verification";s&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Ce(a,!1,!0))},onFetchLinkTokenClick:(s,r)=>{e(we("treasury_setup",s,r))},onEstablishConnectionClick:s=>{e(De(s,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,r,p)=>{e(Ee(s,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,r)=>{e(Pe(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(K(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?_e(s,r,"zeni_treasury","treasury_setup"):ve("treasury_setup",s,r))},onUpdatePrimaryFundingAccount:(s,r)=>{e(ke(a,"treasury_setup",s,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,r)=>{e(Ae({officerType:s,fileIds:r}))},onSendForVerificationClick:(s,r)=>{if(e(z(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(Re(!1))}r===!0&&e(Ke())},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(Rn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(jn(s))},onConfirmFundAllocation:()=>{e(Re(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Fe())}}})(Xn),Ct=()=>{const e=J(),o=Y(),t=X(),a=Te(),c=Jn(),{tenantEmailDomain:n}=H(),{useDynamicConfig:i}=ie(),l=ae(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:y}=i(Q.zeniAccountsConfig),I=ye(y),[d,m]=C.useState(!1),[S,v]=C.useState(!1),[g,f]=C.useState(!1),[P,A]=C.useState(!1),[_,b]=C.useState(!1),k=E(O=>O.treasurySetupViewState.fetchState),h=E(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),T=E(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),B=E(O=>O.treasuryDetailState.transactionsState?.fetchState),U=E(O=>x(O)),F=D.getSignedInUserTenant(n)?.companyId??U.companyId,ce=E(O=>Je(O,F)),G=ce.isAtomicAccountExists,ge=!!U.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=D.getSignedInUser(),re=O=>{m(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{S||k!=="Not-Started"||F==null||(v(!0),t(Ce(F,!0,!1)))},[S,k,F,t]),C.useEffect(()=>{g||h!=="Not-Started"||F==null||(f(!0),t(Fn()))},[g,h,F,t]),C.useEffect(()=>{P||T!=="Not-Started"||F==null||(A(!0),t(xn()))},[P,T,F,t]),C.useEffect(()=>{_||B!=="Not-Started"||F==null||(b(!0),t(Vn(!0)))},[_,B,F,t]);const M=U.companyTreasuryInfo?.info?.businessVerificationStatus?.code,N=M==="pending_review"||M==="verified";return C.useEffect(()=>{s||k!=="Completed"||G||N||!o.pathname.includes("setup")||r(!0)},[k,G,N]),U.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(at,{onClose:()=>{t(Fe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:bt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(It,{onClick:O=>O.stopPropagation(),children:u.jsx(St,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Fe()),e("../setup")}})})}),u.jsx(ht,{navigate:e,location:o,companyId:F,currentTenant:U,isUserZeniAccountsAdmin:p,accountsPromoConfig:I,isAccountsEnabled:ge,isAllocationDone:G,analytics:w,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},It=xe(it)`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  flex-direction: column;
21
- `,At=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=x(e),n=w.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Ln(e,a),r=t&&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:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(De("account_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(K(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"zeni_accounts","account_setup"):ve("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))}}})(et),kt=()=>{const e=Q(),o=Y(),t=X(),{tenantEmailDomain:a}=G(),{useDynamicConfig:c}=ie(),n=ae(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(J.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[y,I]=C.useState(!1),d=E(f=>f.zeniAccountSetupViewState.fetchState),m=E(f=>x(f)),S=w.getSignedInUserTenant(a)?.companyId??m.companyId,v=w.getSignedInUser(),g=f=>{p(f)};if(v==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{y||d!=="Not-Started"||S==null?y||d!=="Completed"||S==null||m.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(S,!1,!0)):(I(!0),t(me(S,!0)))},[y,d,S,t]),m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const f=P=>P.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:P=>f(P)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(At,{navigate:e,location:o,companyId:S,currentTenant:m,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=xe.div`
21
+ `,At=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=x(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Ln(e,a),r=t&&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:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(we("account_setup",n,i))},onEstablishConnectionClick:n=>{e(De(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(K(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"zeni_accounts","account_setup"):ve("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))}}})(et),kt=()=>{const e=J(),o=Y(),t=X(),{tenantEmailDomain:a}=H(),{useDynamicConfig:c}=ie(),n=ae(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(Q.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[y,I]=C.useState(!1),d=E(f=>f.zeniAccountSetupViewState.fetchState),m=E(f=>x(f)),S=D.getSignedInUserTenant(a)?.companyId??m.companyId,v=D.getSignedInUser(),g=f=>{p(f)};if(v==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{y||d!=="Not-Started"||S==null?y||d!=="Completed"||S==null||m.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(S,!1,!0)):(I(!0),t(me(S,!0)))},[y,d,S,t]),m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const f=P=>P.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:P=>f(P)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(At,{navigate:e,location:o,companyId:S,currentTenant:m,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=xe.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-CnWjJuBt.js";import{h as Q,g as Y,u as X,i as G,
26
26
  flex-direction: column;
27
27
  align-items: center;
28
28
  background-color: ${e=>e.theme.colors.grey4};
29
- `,vt=W(function(e,o){const t=x(e),a=w.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:$n(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:D}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Wn(a))},onSubmitClick:()=>{e(Gn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(te({files:a}))},onDeleteFile:a=>{e(ne(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(ee(a,c.split(".")[0]))}}})(nt),Pt=()=>{const e=Q(),o=Y(),t=X(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=G(),p=ae(),{useFeatureGate:y}=ie(),{isFeatureEnabled:I}=y(de.isBillPayLocalCurrencyFeatureEnabled),d=E(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),m=E(k=>k.billPaySetupViewState.fetchState),S=E(k=>x(k)),v=Te(),g=S.companyId??w.getSignedInUserTenant(r)?.companyId,f=E(k=>Mn(k.companyState,S.companyId)),P=f?.company.companyBillPayInfo.internationalWireOnboardingStatus,A=P?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t(Zn(g)))},[a,d,g,t]),C.useEffect(()=>{n||m!=="Not-Started"||g==null||(i(!0),t(Z(g,!0)))},[m,n,g,t]),w.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const _=S.companyBillPayInfo?.info?.isBillPayTOSAccepted,b=k=>{s(k)};return _===!1?u.jsx(j,{to:"../promo"}):_===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(se,{analytics:D,onLoad:k=>(h=>h.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(k)}),Ve(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:b}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:D,currentTenant:S,roleMap:p.loggedInUserRoleMap,isFormReadonly:A,isLocalCurrencyEnabled:I})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:v.colors.grey5}})},Et=W(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(Ce(t,!0,!0));break;default:e(Z(t,!0,!0))}}}}})(tt(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:r}=e;switch(s){case"bill_pay":switch(r){case"verification":return o?u.jsx(Be,{productType:s}):t?u.jsx(j,{to:"../"}):u.jsx(R,{});case"international-wire":return o?u.jsx(Pt,{}):t?u.jsx(j,{to:"../"}):u.jsx(R,{});default:return o?u.jsx(ct,{}):t?u.jsx(j,{to:"../"}):u.jsx(R,{})}case"reimbursement":return r==="verification"?a?u.jsx(Be,{productType:s}):u.jsx(R,{}):a?u.jsx(ft,{}):u.jsx(R,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Be,{productType:"zeni_accounts"}):u.jsx(R,{}):c?u.jsx(kt,{}):u.jsx(R,{});case"zeni_treasury":return n===!0?u.jsx(Ct,{}):u.jsx(R,{});case"charge_cards":return r==="verification"?i?u.jsx(Be,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(R,{}):i?u.jsx(pt,{}):l?u.jsx(j,{to:"../"}):u.jsx(R,{})}}));function na(e){const{tenantEmailDomain:o}=G(),t=E(c=>x(c)).companyId??w.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,i)=>{i.onEventReceived(c)}};if(w.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Et,{...e,companyId:t,...a})}export{Jt as A,Qt as P,na as S,Ht as a,Kt as b,ut as c,dt as d,rt as e,Yt as f,Zt as g,zt as h,Wt as i,qt as j,Xt as k,Gt as l,$t as m,Lt as n,Mt as o,Rt as p,ea as s};
29
+ `,vt=W(function(e,o){const t=x(e),a=D.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:$n(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:w}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Wn(a))},onSubmitClick:()=>{e(Hn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(te({files:a}))},onDeleteFile:a=>{e(ne(a))},onDeleteFileList:a=>{e(Qe(a))},onEditFileName:(a,c)=>{e(ee(a,c.split(".")[0]))}}})(nt),Pt=()=>{const e=J(),o=Y(),t=X(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=H(),p=ae(),{useFeatureGate:y}=ie(),{isFeatureEnabled:I}=y(de.isBillPayLocalCurrencyFeatureEnabled),d=E(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),m=E(k=>k.billPaySetupViewState.fetchState),S=E(k=>x(k)),v=Te(),g=S.companyId??D.getSignedInUserTenant(r)?.companyId,f=E(k=>Mn(k.companyState,S.companyId)),P=f?.company.companyBillPayInfo.internationalWireOnboardingStatus,A=P?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t(Zn(g)))},[a,d,g,t]),C.useEffect(()=>{n||m!=="Not-Started"||g==null||(i(!0),t(Z(g,!0)))},[m,n,g,t]),D.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const _=S.companyBillPayInfo?.info?.isBillPayTOSAccepted,b=k=>{s(k)};return _===!1?u.jsx(j,{to:"../promo"}):_===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(se,{analytics:w,onLoad:k=>(h=>h.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(k)}),Ve(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:b}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:w,currentTenant:S,roleMap:p.loggedInUserRoleMap,isFormReadonly:A,isLocalCurrencyEnabled:I})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:v.colors.grey5}})},Et=W(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(Ce(t,!0,!0));break;default:e(Z(t,!0,!0))}}}}})(tt(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:r}=e;switch(s){case"bill_pay":switch(r){case"verification":return o?u.jsx(Be,{productType:s}):t?u.jsx(j,{to:"../"}):u.jsx(R,{});case"international-wire":return o?u.jsx(Pt,{}):t?u.jsx(j,{to:"../"}):u.jsx(R,{});default:return o?u.jsx(ct,{}):t?u.jsx(j,{to:"../"}):u.jsx(R,{})}case"reimbursement":return r==="verification"?a?u.jsx(Be,{productType:s}):u.jsx(R,{}):a?u.jsx(ft,{}):u.jsx(R,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Be,{productType:"zeni_accounts"}):u.jsx(R,{}):c?u.jsx(kt,{}):u.jsx(R,{});case"zeni_treasury":return n===!0?u.jsx(Ct,{}):u.jsx(R,{});case"charge_cards":return r==="verification"?i?u.jsx(Be,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(R,{}):i?u.jsx(pt,{}):l?u.jsx(j,{to:"../"}):u.jsx(R,{})}}));function na(e){const{tenantEmailDomain:o}=H(),t=E(c=>x(c)).companyId??D.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,i)=>{i.onEventReceived(c)}};if(D.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Et,{...e,companyId:t,...a})}export{Qt as A,Jt as P,na as S,Gt as a,Kt as b,ut as c,dt as d,rt as e,Yt as f,Zt as g,zt as h,Wt as i,qt as j,Xt as k,Ht as l,$t as m,Lt as n,Mt as o,Rt as p,ea as s};
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-CnWjJuBt.js";import{a as u,b as T,q as A}from"./sentry-1cGDtjwd.js";import{u as D,h as z,j as c,g as J,N as M,n as O}from"./core-B01_r_a6.js";import{u as P,z as s,h as j,d as E,D as _,e as F,f as B,X as N,g as q,_ as V,i as v}from"./index-b9cGMwNO.js";import{eP as W,Jq as $,Jr as X,eW as G,fn as H,Jw as K,fL as Q,cT as R,Jx as b,Jy as Y,Jz as Z,bT as y}from"./zeni-epic-state-BFnJgXOA.js";import"./mui-DRaG-BlK.js";import{u as ee}from"./useDeviceId-DJ_jocMS.js";import{f as te}from"./analyticsHelper-Bgdq7lAB.js";import{t as ne}from"./getLocaleForTenant-BIDDVgBq.js";import"./recharts-q0doAU-l.js";import"./analytics-Dcb_7Yrn.js";import"./plaid-VN7yDnB4.js";import"./dnd-aIvu8cuo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DUONjUug.js";import"./lexical-CSRsdQQS.js";import"./pdf-UaypZdKm.js";import"./utils-Y2cylN27.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]="99b5412f-755f-440c-92dc-c0ae2b784640",t._sentryDebugIdIdentifier="sentry-dbid-99b5412f-755f-440c-92dc-c0ae2b784640")}catch{}})();const ie=O(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},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 l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),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(b())}}})(V),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:x,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),L=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>W(e)),I=c(e=>$(e)),m=J(),w=j().mode,C=m.state?.magicLinkExpired,U=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[h.fetchState,l]),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(X(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),Q().then(()=>{const e=q();e!=null&&F(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))},2e3))},[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(M,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),x===!0&&k!=null?f.jsx(N,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-BiGkkGoP.js";import{a as u,b as T,q as A}from"./sentry-DQGl2YSn.js";import{u as z,h as D,j as c,g as M,N as J,n as P}from"./core-DYij5xsh.js";import{u as j,z as s,h as F,d as E,D as O,e as _,f as B,K as N,g as V,R as $,i as v}from"./index-BCP41PwF.js";import{eQ as q,Jr as K,Js as Q,eX as R,fo as W,Jx as H,fM as X,cT as G,Jy as b,Jz as Y,JA as Z,bT as y}from"./zeni-epic-state-YenBAkdY.js";import"./mui-CdvNR06J.js";import{u as ee}from"./useDeviceId-Dsh8klAH.js";import{f as te}from"./analyticsHelper-tq4PT7c_.js";import{t as ne}from"./getLocaleForTenant-DwUbw-k6.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="89ef3f14-0ecd-4a1b-baf4-38c91b26f173",t._sentryDebugIdIdentifier="sentry-dbid-89ef3f14-0ecd-4a1b-baf4-38c91b26f173")}catch{}})();const ie=P(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},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 l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),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(b())}}})($),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:x,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),L=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>q(e)),I=c(e=>K(e)),m=M(),w=F().mode,C=m.state?.magicLinkExpired,U=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[h.fetchState,l]),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(H("Completed")),O.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),X().then(()=>{const e=V();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",G(r.productSettings))},2e3))},[S,p,L,o,r,I,w,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:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),x===!0&&k!=null?f.jsx(N,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-BiGkkGoP.js";import{a}from"./sentry-DQGl2YSn.js";import{u,g as m,h as p,N as g}from"./core-DYij5xsh.js";import{z as d,B as y,t as h,d as c,f as b}from"./index-BCP41PwF.js";import{fR as x,fS as I,JP as j}from"./zeni-epic-state-YenBAkdY.js";import{n as w}from"./mui-CdvNR06J.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="ef5ed0c3-d878-414d-9e45-314d9bcac27c",e._sentryDebugIdIdentifier="sentry-dbid-ef5ed0c3-d878-414d-9e45-314d9bcac27c")}catch{}})();function $(){const e=u(),t=m(),i=p(),n=a.useRef(!1),f=d.isSignedIn(),r=t.state?.message==="logout",o=r||f;return a.useEffect(()=>{o&&!n.current&&(n.current=!0,setTimeout(()=>{try{d.clearAll(),e(x()),e(I(!1)),j(),h.reset(),c.trackLogout(b.Event.logoutSuccess),c.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const v=w.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{$ as default};
@@ -1,4 +1,4 @@
1
- import{j as p}from"./liveblocks-CnWjJuBt.js";import{a as g}from"./sentry-1cGDtjwd.js";import{h as K,u as z,g as _,j as b,i as O,n as V}from"./core-B01_r_a6.js";import{z as Q,S as W,c as d,Z,w as M,d as q,f as J,cQ as X,r as f,p as Y}from"./index-b9cGMwNO.js";import{eP as H,QN as R,Gs as S,QO as x,QJ as aa,FQ as E,QP as ea,FY as I,Fi as ta,Gt as B,QQ as w,gT as sa,Gj as oa,Go as na,Gb as ia,G9 as L,Gp as la,G6 as ra,QR as ka,QS as ca,QT as ua,QU as pa,QV as T,ec as da,QW as Ta,QX as ma}from"./zeni-epic-state-BFnJgXOA.js";import{n as ga}from"./mui-DRaG-BlK.js";import{u as fa}from"./useAskAiCfoHostNavButtonProps-C1fOlGC9.js";import{M as Ga}from"./MobileAppDrawer-ztL55BFc.js";import"./recharts-q0doAU-l.js";import"./analytics-Dcb_7Yrn.js";import"./plaid-VN7yDnB4.js";import"./dnd-aIvu8cuo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DUONjUug.js";import"./lexical-CSRsdQQS.js";import"./pdf-UaypZdKm.js";import"./utils-Y2cylN27.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]="5e2b8feb-4e5a-46da-8341-259999022744",e._sentryDebugIdIdentifier="sentry-dbid-5e2b8feb-4e5a-46da-8341-259999022744")}catch{}})();const ha=ga.div`
1
+ import{j as p}from"./liveblocks-BiGkkGoP.js";import{a as g}from"./sentry-DQGl2YSn.js";import{h as v,u as K,g as Z,j as b,i as z,n as V}from"./core-DYij5xsh.js";import{z as R,n as W,c as d,Z as q,x as M,d as O,f as X,cQ as Y,r as f,p as H}from"./index-BCP41PwF.js";import{eQ as J,QR as Q,Gt as y,QS as x,QN as aa,FR as S,QT as ea,FZ as I,Fj as ta,Gu as B,QU as w,gU as sa,Gk as oa,Gp as na,Gc as ia,Ga as L,Gq as la,G7 as ra,QV as ka,QW as ca,QX as ua,QY as pa,QZ as m,ec as da,Q_ as ma,Q$ as Ta}from"./zeni-epic-state-YenBAkdY.js";import{n as ga}from"./mui-CdvNR06J.js";import{u as fa}from"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import{M as Ga}from"./MobileAppDrawer-Biso_61t.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="3f6b4174-1e1f-453b-9988-55a1332e8878",e._sentryDebugIdIdentifier="sentry-dbid-3f6b4174-1e1f-453b-9988-55a1332e8878")}catch{}})();const ha=ga.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as p}from"./liveblocks-CnWjJuBt.js";import{a as g}from"./sentry-1cGDtjw
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Da=V(function(e,t){const o=R(e,t.isTaskTemplatesEnabled),{taskGroupId:k}=t,i=k!=null&&k!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(k))})).filter(l=>l.tasks.length>0)}:o,u=aa(e),n=Q.isZeniUser();return{taskListView:i,tagListView:u,localData:i.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:n}},function(e,t){const{navigate:o,currentTenant:k,location:i,isTaskTemplatesEnabled:u}=t,{tenantEmailDomain:n}=k,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=F(n,a),c=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:c}})},onReloadTasks:()=>{e(S(!0,u))},onTabChange:a=>{e(pa(a))},onParentTaskClick:a=>{const s=F(n,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(L(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=C(n,t.localData.defaultTaskGroupId),s=f(i.state?.pathnameStackToGoBack,i.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(w({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ua({filters:a}))},onSearchTextChanged:a=>{e(ca({searchText:a}))},onReloadCards:()=>{e(S(!0,u))},onBackClick:()=>{if(i.state?.message==="triggerBackClick"){const a=Y(i.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(ka({localData:a}))},resetLocalData:()=>{e(x({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ra(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(L(t.localData.selectedTaskIds,a,la(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(ia(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=ba(l,a);e(E({taskDetailLocalData:s}));const c=C(n,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),G=f(i.state?.pathnameStackToGoBack,i.pathname);o(c,{state:{pathnameStackToGoBack:G,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(na(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(oa(a,s))},onTimeSpentUpdate:(a,s)=>{e(B({task:a,updates:s}))},onShowToast:a=>{e(sa(a))},onGroupByFilterChange:a=>{e(w({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(B({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(ta(a,s))},handleGroupTemplateClick:a=>{e(I(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(I(a,[s]))},handleNewTaskInitialization:a=>{if(e(E({taskDetailLocalData:{...ea,name:a}})),t.localData.defaultTaskGroupId!=null){const s=C(n,t.localData.defaultTaskGroupId),c=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:c,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${n}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${n}/tasks/quick-responses`)}}})(X);function Ua(){const e=K(),t=z(),o=_(),k=Q.getSignedInUser(),i=b(r=>H(r)),{taskGroupId:u}=O(),{useFeatureGate:n}=W(),{isFeatureEnabled:l}=n(d.isTaskTemplatesEnabled),{isFeatureEnabled:a}=n(d.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=n(d.isTaskCategorizationEnabled),{isFeatureEnabled:c}=n(d.isTaskBulkResolutionEnabled),{isFeatureEnabled:G}=n(d.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=n(d.isTaskRecurringParentEnabled),[y,P]=g.useState(!1),[j,N]=g.useState(!1),h=b(r=>R(r,l)),D=b(r=>r.taskGroupState),m=h.fetchState,{isAiCfoAccessEnabled:$,onAskAiCfoClick:U}=fa({mobileExploreReferrer:"Task Checklist"});if(Z({isDataReady:m==="Completed"}),g.useEffect(()=>{y||(P(!0),t(S(!1,l)))},[y,t]),g.useEffect(()=>{m==="Completed"&&t(x({taskGroupById:D.taskGroupById}))},[m,D.taskGroupById]),k==null)throw Error("Can't access task list page without signing in...");return p.jsxs(p.Fragment,{children:[m==="Completed"?p.jsx(M,{analytics:q,onLoad:r=>(v=>v.trackPageLoaded(J.Event.taskListPage))(r)}):null,p.jsxs(ha,{children:[p.jsx(Ga,{isAppContentDrawerOpen:j,handleDrawerToggle:r=>{N(r)}}),p.jsx(Da,{location:o,navigate:e,currentTenant:i,taskGroupId:u,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:m,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:c,isTaskGroupAssigneesEnabled:G,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:$,onAskAiCfoClick:U})]})]})}const F=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,C=(e,t)=>`/${e}/tasks/new/${t}`,ba=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...T.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=da(t);return{...T.taskDetailLocalData,priority:o}}if(e==="status"){const o=Ta(t);return{...T.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...T.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=ma(t);return{...T.taskDetailLocalData,dueDate:o}}return{...T.taskDetailLocalData}};export{Ua as default};
9
+ `,Da=V(function(e,t){const o=Q(e,t.isTaskTemplatesEnabled),{taskGroupId:k}=t,i=k!=null&&k!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(k))})).filter(l=>l.tasks.length>0)}:o,u=aa(e),n=R.isZeniUser();return{taskListView:i,tagListView:u,localData:i.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:n}},function(e,t){const{navigate:o,currentTenant:k,location:i,isTaskTemplatesEnabled:u}=t,{tenantEmailDomain:n}=k,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=F(n,a),c=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:c}})},onReloadTasks:()=>{e(y(!0,u))},onTabChange:a=>{e(pa(a))},onParentTaskClick:a=>{const s=F(n,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(L(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=C(n,t.localData.defaultTaskGroupId),s=f(i.state?.pathnameStackToGoBack,i.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(w({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ua({filters:a}))},onSearchTextChanged:a=>{e(ca({searchText:a}))},onReloadCards:()=>{e(y(!0,u))},onBackClick:()=>{if(i.state?.message==="triggerBackClick"){const a=H(i.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(ka({localData:a}))},resetLocalData:()=>{e(x({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ra(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(L(t.localData.selectedTaskIds,a,la(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(ia(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=ba(l,a);e(S({taskDetailLocalData:s}));const c=C(n,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),G=f(i.state?.pathnameStackToGoBack,i.pathname);o(c,{state:{pathnameStackToGoBack:G,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(na(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(oa(a,s))},onTimeSpentUpdate:(a,s)=>{e(B({task:a,updates:s}))},onShowToast:a=>{e(sa(a))},onGroupByFilterChange:a=>{e(w({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(B({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(ta(a,s))},handleGroupTemplateClick:a=>{e(I(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(I(a,[s]))},handleNewTaskInitialization:a=>{if(e(S({taskDetailLocalData:{...ea,name:a}})),t.localData.defaultTaskGroupId!=null){const s=C(n,t.localData.defaultTaskGroupId),c=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:c,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${n}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${n}/tasks/quick-responses`)}}})(Y);function Ua(){const e=v(),t=K(),o=Z(),k=R.getSignedInUser(),i=b(r=>J(r)),{taskGroupId:u}=z(),{useFeatureGate:n}=W(),{isFeatureEnabled:l}=n(d.isTaskTemplatesEnabled),{isFeatureEnabled:a}=n(d.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=n(d.isTaskCategorizationEnabled),{isFeatureEnabled:c}=n(d.isTaskBulkResolutionEnabled),{isFeatureEnabled:G}=n(d.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=n(d.isTaskRecurringParentEnabled),[E,P]=g.useState(!1),[$,j]=g.useState(!1),h=b(r=>Q(r,l)),D=b(r=>r.taskGroupState),T=h.fetchState,{isAiCfoAccessEnabled:N,onAskAiCfoClick:U}=fa({mobileExploreReferrer:"Task Checklist"});if(q({isDataReady:T==="Completed"}),g.useEffect(()=>{E||(P(!0),t(y(!1,l)))},[E,t]),g.useEffect(()=>{T==="Completed"&&t(x({taskGroupById:D.taskGroupById}))},[T,D.taskGroupById]),k==null)throw Error("Can't access task list page without signing in...");return p.jsxs(p.Fragment,{children:[T==="Completed"?p.jsx(M,{analytics:O,onLoad:r=>(_=>_.trackPageLoaded(X.Event.taskListPage))(r)}):null,p.jsxs(ha,{children:[p.jsx(Ga,{isAppContentDrawerOpen:$,handleDrawerToggle:r=>{j(r)}}),p.jsx(Da,{location:o,navigate:e,currentTenant:i,taskGroupId:u,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:T,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:c,isTaskGroupAssigneesEnabled:G,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:N,onAskAiCfoClick:U})]})]})}const F=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,C=(e,t)=>`/${e}/tasks/new/${t}`,ba=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...m.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=da(t);return{...m.taskDetailLocalData,priority:o}}if(e==="status"){const o=ma(t);return{...m.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...m.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=Ta(t);return{...m.taskDetailLocalData,dueDate:o}}return{...m.taskDetailLocalData}};export{Ua as default};
@@ -0,0 +1,9 @@
1
+ import{j as n}from"./liveblocks-BiGkkGoP.js";import se from"./NotFoundScreen-C0-Skng9.js";import{a as c}from"./sentry-DQGl2YSn.js";import{h as O,u as _,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-DYij5xsh.js";import{Fw as M,Fz as le,Ft as de,eQ as Z,QN as H,FN as Y,Fq as pe,Gh as ue,Ga as ke,QO as W,QP as q,Fm as me,Fj as fe,qp as ge,qd as he,kf as Se,FH as Ie,QQ as Te,FY as be,FV as Ee,FC as Ge,FS as Ce,FR as Fe}from"./zeni-epic-state-YenBAkdY.js";import{z as C,cO as De,v as xe,n as je,c as b,p as X,r as w,x as ye,d as z,f as we,cP as ve,i as V,at as Re}from"./index-BCP41PwF.js";import{n as Pe}from"./mui-CdvNR06J.js";import{u as Be}from"./useInitialThreadRequest-Du_koxHd.js";import{M as Ue}from"./MobileAppDrawer-Biso_61t.js";import Le from"./TaskListScreen-Bwwbd5X8.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./useAskAiCfoHostNavButtonProps-CVdued0l.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]="1071aa7d-3416-445e-b248-585ae1a6f1a8",e._sentryDebugIdIdentifier="sentry-dbid-1071aa7d-3416-445e-b248-585ae1a6f1a8")}catch{}})();function Ne(){const e=O(),t=_(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(M())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(De,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let Q,A=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=W(e,t.taskId),d=Z(e),l=r.taskGroupId??u,k=l!=null?q(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=H(e),{tenantEmailDomain:F}=d,E=r.recurringSourceTaskId,D=E!=null?`${V.appUrl}/${F}/tasks/${encodeURIComponent(E)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==Q&&(Q=I,A=Object.values(I)),A),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Re.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:D,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>q(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(Fe({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=v(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(Y(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(M())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function y(){const e=O(),t=_(),s=ne(),u=xe(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Z(i)),k=Be(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:F}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[D,I]=c.useState(!1),[p,J]=c.useState(!1),[R,K]=c.useState(!1),[P,ee]=c.useState(!1),[B,x]=c.useState(!1),T=c.useRef(!1),G=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>H(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(J(!0),t(Y(!1,r)))},[p,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(K(!0),t(pe()))},[R,t,U.fetchState]),c.useEffect(()=>{P||L==="Completed"||(ee(!0),t(ue()))},[P,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),x(!0))},[t,r]);c.useEffect(()=>{if(B)if(G!=="In-Progress"){if(T.current){if(G==="Error")return x(!1),void(T.current=!1);if(G==="Completed"){x(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=v(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[B,G,l,s,e]);const N=g(i=>W(i,r)),j=N.fetchState,$=C.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&N.error?.code===400){const{tenantEmailDomain:i}=l,m=v(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(ye,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(qe,{children:[n.jsx(Ue,{isAppContentDrawerOpen:D,handleDrawerToggle:i=>{I(i)}}),n.jsx($e,{analytics:z,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:F,isTaskGroupAssigneesEnabled:E})]})]})}const qe=Pe.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
+ `,v=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(y,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(y,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx(Ne,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(y,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-CnWjJuBt.js";import i from"./NotFoundScreen-CbugOr9O.js";import{T as r}from"./TransactionDetailScreen-C05AQBgs.js";import"./sentry-1cGDtjwd.js";import{o as a,p as o}from"./core-B01_r_a6.js";import"./zeni-epic-state-BFnJgXOA.js";import"./recharts-q0doAU-l.js";import"./index-b9cGMwNO.js";import"./mui-DRaG-BlK.js";import"./analytics-Dcb_7Yrn.js";import"./plaid-VN7yDnB4.js";import"./dnd-aIvu8cuo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DUONjUug.js";import"./lexical-CSRsdQQS.js";import"./pdf-UaypZdKm.js";import"./utils-Y2cylN27.js";import"./useAskAiCfoHostNavButtonProps-C1fOlGC9.js";import"./decodeURIComponentSafe-BOkChgPc.js";import"./routePaths-Sv0e7DY5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8f33aac6-3389-4f99-92e2-514bb2135525",e._sentryDebugIdIdentifier="sentry-dbid-8f33aac6-3389-4f99-92e2-514bb2135525")}catch{}})();function k(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
1
+ import{j as t}from"./liveblocks-BiGkkGoP.js";import i from"./NotFoundScreen-C0-Skng9.js";import{T as r}from"./TransactionDetailScreen-BxH3gBsf.js";import"./sentry-DQGl2YSn.js";import{o as a,p as o}from"./core-DYij5xsh.js";import"./zeni-epic-state-YenBAkdY.js";import"./recharts-D0oa1BQl.js";import"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";import"./routePaths-jIme_4o7.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8f33aac6-3389-4f99-92e2-514bb2135525",e._sentryDebugIdIdentifier="sentry-dbid-8f33aac6-3389-4f99-92e2-514bb2135525")}catch{}})();function k(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};