@zeniai/web-app-ui 5.0.66-qa → 5.0.67-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/assets/AddressRoutes-cN2hvu5k.js +1 -0
  2. package/dist/assets/{AddressScreen-BAjnEp-X.js → AddressScreen-Cdrj5W4-.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-BHXlYJhk.js → AiCfoScreen-B-1grS8G.js} +3 -3
  4. package/dist/assets/{BillPayApprovalRoutes-CzGAg-RT.js → BillPayApprovalRoutes-CYVk-fEO.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BrT44OKb.js → BillPayRoutes-DDC6qHPH.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DxAzWOOG.js → BusinessVerificationPageScreen-Cc1IIWeU.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-Bz9nItR4.js → ChargeCardRoutes-WudejbU5.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-QZ_mGMd4.js → CompanyPassportScreen-BKSfyJ-l.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-CpuUuu-_.js → ConnectionAuthScreen-_imXUbd-.js} +2 -2
  10. package/dist/assets/CustomerOnboardingAuthScreen-CEMPHR45.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-BfehFPND.js → CustomerOnboardingRoutes-F1vVB2Sv.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-eN0rJLLD.js → DashboardRoutes-BRu36Tfy.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-CcXzOxRp.js → DefaultTenantHome-DfbzoS5K.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-BcnlrXA2.js → DomesticWireDetailScreen-ZGxx9s_z.js} +3 -3
  15. package/dist/assets/DrawerScreen-CNcA0NWW.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-BmYxwbUk.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes--daJtdEl.js → ExpenseAutomationRoutes-BlEicy7A.js} +3 -3
  18. package/dist/assets/FeaturePreviewScreen-Ck2p6Gja.js +1 -0
  19. package/dist/assets/{MagicLinkRoutes-RaFYANW2.js → MagicLinkRoutes-DWwHzbiU.js} +1 -1
  20. package/dist/assets/MagicLinkSignInScreen-BSZMqjA8.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-DeylJyoS.js → MobileAppDrawer-DlNmDt_G.js} +1 -1
  22. package/dist/assets/NotFoundScreen-Bn00COMT.js +1 -0
  23. package/dist/assets/{NotificationRoutes-BRIAt45r.js → NotificationRoutes-DKQO1vhK.js} +1 -1
  24. package/dist/assets/{OAuthConsentScreen-SSJxi6bW.js → OAuthConsentScreen-DgYck1Vm.js} +1 -1
  25. package/dist/assets/PandLWithForecastRoutes-CBeCFkpZ.js +1 -0
  26. package/dist/assets/{PeopleRoutes-CdSAFFKy.js → PeopleRoutes-Bx6vvHyi.js} +1 -1
  27. package/dist/assets/PerformanceRoutes-Dzf_Gbv_.js +1 -0
  28. package/dist/assets/{Preview-BHNHm504.js → Preview-CX-Kq6YO.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-CxOACLF0.js → QBOConnectionScreen-Ik56pHVf.js} +1 -1
  30. package/dist/assets/{ReferralListScreen-C4TUE7u-.js → ReferralListScreen-CQbl2UNi.js} +2 -2
  31. package/dist/assets/ReimbursementApprovalRoutes-DODnS_H8.js +1 -0
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DHJfikzO.js → ReimbursementApprovalRuleDetailScreen-D47IilTw.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-CEvVhZii.js → ReimbursementRoutes-CPirKpDw.js} +4 -4
  34. package/dist/assets/{ReportsRoutes-BfvsU1EY.js → ReportsRoutes-Bt0cxiUC.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-Cio16rVo.js → RewardsRoutes-DPjrSm5w.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-Bdf3ftuj.js → ScreenRoutes-BzreoX2P.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-B0yuOT8Q.js → SettingsRoutes-BUAI7US9.js} +8 -8
  38. package/dist/assets/{SetupPagesScreen-Cescu0d2.js → SetupPagesScreen-CIwH3ZZF.js} +1 -1
  39. package/dist/assets/{SignInScreen-CsSIJ__Q.js → SignInScreen-Bt9puaku.js} +1 -1
  40. package/dist/assets/SignOutScreen-CM2ECVcQ.js +9 -0
  41. package/dist/assets/{TaskListScreen-CxNhJaSH.js → TaskListScreen-ByuOJ-7H.js} +2 -2
  42. package/dist/assets/{TaskRoutes-BSrgrKDO.js → TaskRoutes-QKzr6xVQ.js} +1 -1
  43. package/dist/assets/TransactionDetailRoutes-DMctD9qf.js +1 -0
  44. package/dist/assets/{TransactionDetailScreen-BS1m1uHz.js → TransactionDetailScreen-nBKG_H4f.js} +2 -2
  45. package/dist/assets/{TransactionListRoutes-Dt5XVEa1.js → TransactionListRoutes-BB1zFFVN.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-66dAv4dI.js → TreasuryRoutes-dG47aDHP.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-C_EbMO1S.js → VendorsRoutes-CvbRdyyA.js} +1 -1
  48. package/dist/assets/WiseConfirmationScreen-Df9zLzqA.js +12 -0
  49. package/dist/assets/{ZeniAccountRoutes-CTB93z0S.js → ZeniAccountRoutes-BhBRZUQz.js} +11 -11
  50. package/dist/assets/{ZeniAccountStatementScreen-DmzWGfwC.js → ZeniAccountStatementScreen-BbT_F5EY.js} +2 -2
  51. package/dist/assets/{accountMappingHelper-BHhQdza1.js → accountMappingHelper-l5KQkq0O.js} +1 -1
  52. package/dist/assets/{analytics-DQCQhWLc.js → analytics-DwbKC7qV.js} +1 -1
  53. package/dist/assets/{analyticsHelper-DUWn4fSe.js → analyticsHelper-tcwBG-lH.js} +1 -1
  54. package/dist/assets/{core-j0LqCeu3.js → core-DxYppZiZ.js} +1 -1
  55. package/dist/assets/{decodeURIComponentSafe-DFYfbcv3.js → decodeURIComponentSafe-B26owMY4.js} +1 -1
  56. package/dist/assets/{dnd-DAo38rm8.js → dnd-rWx_BA4U.js} +1 -1
  57. package/dist/assets/{index-4NAZbGj1.js → empty-DNik0LMv.js} +1 -1
  58. package/dist/assets/{empty-CK9odIeO.js → empty-DULS5Nrn.js} +1 -1
  59. package/dist/assets/{emptyVideoElement-C-uPKIxs.js → emptyVideoElement-mPx-9nkL.js} +1 -1
  60. package/dist/assets/{epic-DSNvXFJG.js → epic-S-I_KsoV.js} +1 -1
  61. package/dist/assets/{getLocaleForTenant-BLNl-Ho3.js → getLocaleForTenant-ClNmnFx1.js} +1 -1
  62. package/dist/assets/{index-cC6roLBs.js → index-BL-5UCyS.js} +1 -1
  63. package/dist/assets/{empty-Ca3lmO0X.js → index-Bwjy1Btm.js} +1 -1
  64. package/dist/assets/{index-71d39Q7D.js → index-C8TMxWTj.js} +2 -2
  65. package/dist/assets/{index-CZgerGBH.js → index-CVOKCo3k.js} +1 -1
  66. package/dist/assets/{index-CFtYCyfm.js → index-DPw038da.js} +7 -7
  67. package/dist/assets/index-DYHaARhd.js +2 -0
  68. package/dist/assets/{index-BX6ANtNh.js → index-GW-ogFZi.js} +1 -1
  69. package/dist/assets/index-dNGgc_CZ.js +1 -0
  70. package/dist/assets/{lexical-D-QBA09y.js → lexical-DPitEa2C.js} +1 -1
  71. package/dist/assets/{liveblocks-C3aHR2ug.js → liveblocks-BqO7Df-p.js} +1 -1
  72. package/dist/assets/{lottie-CAFVLjo0.js → lottie-B5P7nQ0g.js} +1 -1
  73. package/dist/assets/{mui-D78cc8iD.js → mui-DdrzQvkp.js} +1 -1
  74. package/dist/assets/{pathToGoBack-Dzva26FJ.js → pathToGoBack-D8OnmrBJ.js} +1 -1
  75. package/dist/assets/{pdf-C20YOa73.js → pdf-BeAAQRBu.js} +3 -3
  76. package/dist/assets/{pdf-lib-bl9YSMz9.js → pdf-lib-CHquFnr8.js} +1 -1
  77. package/dist/assets/{plaid-DsDYZOgp.js → plaid-DOFGuYBC.js} +1 -1
  78. package/dist/assets/{pusher-l3ERSdYl.js → pusher-BNXqMhSN.js} +1 -1
  79. package/dist/assets/{react-YfQWR1Yb.js → react--drtz5zi.js} +1 -1
  80. package/dist/assets/{react-oAtqdYpb.js → react-BaDxvM18.js} +1 -1
  81. package/dist/assets/{react-9NHYx8CN.js → react-BpFOakYv.js} +1 -1
  82. package/dist/assets/{react-DJWA5bIH.js → react-C840tf_D.js} +1 -1
  83. package/dist/assets/{react-Cf73dofS.js → react-CRUVsP_a.js} +1 -1
  84. package/dist/assets/{react-CslKeU46.js → react-CYhWGyVz.js} +1 -1
  85. package/dist/assets/{recharts-B0MOj05b.js → recharts-BucGjD65.js} +1 -1
  86. package/dist/assets/{routePaths-D7CLql-E.js → routePaths-CgcmkaKJ.js} +1 -1
  87. package/dist/assets/{sentry-cQZrhfVh.js → sentry-DS2EspaF.js} +1 -1
  88. package/dist/assets/{url-Oh4YprMm.js → url--J2koNP1.js} +1 -1
  89. package/dist/assets/url-C9We36rv.js +1 -0
  90. package/dist/assets/useAskAiCfoHostNavButtonProps-DpRKl1_2.js +1 -0
  91. package/dist/assets/{useDeviceId-CE3ipTvl.js → useDeviceId-CsxMPdAN.js} +1 -1
  92. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.js → useFetchSuggestedQuestionsWhenReady-k6PyaabR.js} +1 -1
  93. package/dist/assets/useInitialThreadRequest-Wi13xyTC.js +1 -0
  94. package/dist/assets/{utils-BBuNXoTI.js → utils-B6prU8As.js} +1 -1
  95. package/dist/assets/{withTransactionSidePanel-BbFtF7db.js → withTransactionSidePanel-jaVwinxd.js} +1 -1
  96. package/dist/assets/{zeni-epic-state-DiQZjsue.js → zeni-epic-state-CXLj5Oko.js} +6 -6
  97. package/dist/index.html +1 -1
  98. package/package.json +2 -2
  99. package/dist/assets/AddressRoutes-ZBiq4EJc.js +0 -1
  100. package/dist/assets/CustomerOnboardingAuthScreen-CfmQ932p.js +0 -1
  101. package/dist/assets/DrawerScreen-I-2xB5eA.js +0 -1
  102. package/dist/assets/EntityDetailRoutes-BhPGNOQf.js +0 -1
  103. package/dist/assets/FeaturePreviewScreen-BD0F_lti.js +0 -1
  104. package/dist/assets/MagicLinkSignInScreen-B-f7LLOR.js +0 -12
  105. package/dist/assets/NotFoundScreen-BeCKiN3K.js +0 -1
  106. package/dist/assets/PandLWithForecastRoutes-D5ZL-4Av.js +0 -1
  107. package/dist/assets/PerformanceRoutes-CH31J9F9.js +0 -1
  108. package/dist/assets/ReimbursementApprovalRoutes-BsXJVvJR.js +0 -1
  109. package/dist/assets/SignOutScreen-B9jFNEAZ.js +0 -9
  110. package/dist/assets/TransactionDetailRoutes-Cd8hk8fd.js +0 -1
  111. package/dist/assets/WiseConfirmationScreen-B1r4FA9z.js +0 -12
  112. package/dist/assets/index-B2tWZgTJ.js +0 -1
  113. package/dist/assets/url-BbfnqyeH.js +0 -1
  114. package/dist/assets/useAskAiCfoHostNavButtonProps-CLV01Vra.js +0 -1
  115. package/dist/assets/useInitialThreadRequest-kL3BFKKo.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-C3aHR2ug.js";import{a as u}from"./sentry-cQZrhfVh.js";import{j as T,u as B,h as P,g as m,k as R,l as _,n as X,o as C}from"./core-j0LqCeu3.js";import{bn as Ie,eO as w,gw as ce,KF as Ce,J1 as xe,jr as le,lK as Ee,gy as Ae,KH as je,KG as we,N4 as ke,x3 as Pe,By as ve,MF as De,MO as Me,c1 as re,cG as Ue,cH as Te,IN as Fe,N5 as Be,IO as Re,vv as _e,N6 as Ve,DO as Oe,Be as Le,B5 as de,B2 as Ne,vz as ue,B8 as pe,Bb as ge,Bh as W,s6 as Y,vy as $e,j3 as q,j6 as me,N7 as Ge,k7 as Ke,vO as ze,JA as Je,JB as Ze,j1 as He,N8 as Qe,j4 as Xe,N9 as qe,vL as We,Na as Ye,Nb as en,Bv as nn,eS as fe,eU as he,Nc as tn,fw as an,J2 as sn,vK as te,fB as ae,fA as on,vJ as cn,fz as ln,fy as rn,Nd as dn,eX as be,Ne as un,Nf as pn,vR as gn,vI as se,Ng as mn,fd as fn,vF as hn,bU as bn,c0 as Sn,b$ as yn,bV as In,bZ as Cn,bY as xn,bX as En,b_ as An,bW as jn}from"./zeni-epic-state-DiQZjsue.js";import{C as ee,$ as M,z as x,ac as Se,bC as wn,c as G,f as kn,I as V,B as ne,bD as Pn,bE as vn,an as Dn,i as ye,bF as Mn,bG as Un,bH as Tn,a6 as Fn,O as Bn,bI as Rn,s as _n,bJ as Vn}from"./index-CFtYCyfm.js";import{n as U}from"./mui-D78cc8iD.js";import{M as v}from"./MobileAppDrawer-DeylJyoS.js";import{a as N,g as $,m as On}from"./accountMappingHelper-BHhQdza1.js";import{t as Ln,A as Nn}from"./AddressScreen-BAjnEp-X.js";import F from"./NotFoundScreen-BeCKiN3K.js";import{g as $n}from"./analyticsHelper-DUWn4fSe.js";import{B as Gn}from"./BusinessVerificationPageScreen-DxAzWOOG.js";import{C as Kn}from"./CompanyPassportScreen-QZ_mGMd4.js";import{q as oe}from"./QBOConnectionScreen-CxOACLF0.js";import{B as zn}from"./BillPayApprovalRoutes-CzGAg-RT.js";import{R as Jn}from"./ReimbursementApprovalRoutes-BsXJVvJR.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.js";import"./routePaths-D7CLql-E.js";import"./empty-CK9odIeO.js";import"./pdf-lib-bl9YSMz9.js";import"./index-BX6ANtNh.js";import"./url-Oh4YprMm.js";import"./index-B2tWZgTJ.js";import"./decodeURIComponentSafe-DFYfbcv3.js";import"./ReimbursementApprovalRuleDetailScreen-DHJfikzO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="222842c4-45af-4be1-b878-c2f76a613c69",e._sentryDebugIdIdentifier="sentry-dbid-222842c4-45af-4be1-b878-c2f76a613c69")}catch{}})();const Zn=U.div`
1
+ import{j as t}from"./liveblocks-BqO7Df-p.js";import{a as u}from"./sentry-DS2EspaF.js";import{j as T,u as B,h as P,g as m,k as R,l as _,n as X,o as C}from"./core-DxYppZiZ.js";import{bn as Ie,eO as w,gw as ce,KF as Ce,J2 as xe,jr as le,lK as Ee,gy as Ae,KH as je,KG as we,N4 as ke,x3 as Pe,By as ve,MF as De,MO as Ue,c1 as re,cG as Me,cH as Te,IN as Fe,N5 as Be,IO as Re,vv as _e,N6 as Ve,DO as Oe,Be as Le,B5 as de,B2 as Ne,vz as ue,B8 as pe,Bb as ge,Bh as W,s6 as Y,vy as $e,j3 as q,j6 as me,N7 as Ge,k7 as Ke,vO as ze,JA as Je,JB as Ze,j1 as He,N8 as Qe,j4 as Xe,N9 as qe,vL as We,Na as Ye,Nb as en,Bv as nn,eS as fe,eU as he,Nc as tn,fw as an,J3 as sn,vK as te,fB as ae,fA as on,vJ as cn,fz as ln,fy as rn,Nd as dn,eX as be,Ne as un,Nf as pn,vR as gn,vI as se,Ng as mn,fd as fn,vF as hn,bU as bn,c0 as Sn,b$ as yn,bV as In,bZ as Cn,bY as xn,bX as En,b_ as An,bW as jn}from"./zeni-epic-state-CXLj5Oko.js";import{C as ee,$ as U,z as x,ac as Se,bC as wn,c as G,f as kn,I as V,B as ne,bD as Pn,bE as vn,an as Dn,i as ye,bF as Un,bG as Mn,bH as Tn,a6 as Fn,U as Bn,bI as Rn,s as _n,bJ as Vn}from"./index-DPw038da.js";import{n as M}from"./mui-DdrzQvkp.js";import{M as v}from"./MobileAppDrawer-DlNmDt_G.js";import{a as N,g as $,m as On}from"./accountMappingHelper-l5KQkq0O.js";import{t as Ln,A as Nn}from"./AddressScreen-Cdrj5W4-.js";import F from"./NotFoundScreen-Bn00COMT.js";import{g as $n}from"./analyticsHelper-tcwBG-lH.js";import{B as Gn}from"./BusinessVerificationPageScreen-Cc1IIWeU.js";import{C as Kn}from"./CompanyPassportScreen-BKSfyJ-l.js";import{q as oe}from"./QBOConnectionScreen-Ik56pHVf.js";import{B as zn}from"./BillPayApprovalRoutes-CYVk-fEO.js";import{R as Jn}from"./ReimbursementApprovalRoutes-DODnS_H8.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";import"./routePaths-CgcmkaKJ.js";import"./empty-DULS5Nrn.js";import"./pdf-lib-CHquFnr8.js";import"./index-GW-ogFZi.js";import"./url--J2koNP1.js";import"./index-dNGgc_CZ.js";import"./decodeURIComponentSafe-B26owMY4.js";import"./ReimbursementApprovalRuleDetailScreen-D47IilTw.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="363ca02e-ded7-49f3-bed6-f9793a628e94",e._sentryDebugIdIdentifier="sentry-dbid-363ca02e-ded7-49f3-bed6-f9793a628e94")}catch{}})();const Zn=M.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as t}from"./liveblocks-C3aHR2ug.js";import{a as u}from"./sentry-cQZrhfV
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Hn=R(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:le(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:xe(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,location:c,isFiling1099FeatureEnabled:o}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:s,billsAccountSection:r,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:f}=n,{incomeAccount:b,expenseAccount:g}=s,{billPayAccount:l}=r,{reimbursementsAccount:E}=p,{prepaidExpensesAccount:y,fixedAssetsAccount:j,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:O}=f,A=N(a.accountMappingView.incomeAccountList,b.selectedOption),K=N(a.accountMappingView.expenseAccountList,g.selectedOption),z=N(a.accountMappingView.billPayAccountList,l.selectedOption),J=N(a.accountMappingView.reimbursementsAccountList,E.selectedOption),L=$(a.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),h=$(a.accountMappingView.fixedAssetsAccountList,j.selectedOptions),D=$(a.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Z=$(a.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),H=On(a.accountMappingView.expenseAccounts1099FilingAccountList,O),Q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:K?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:J?.accountId,selectedPrepaidExpensesAccountIds:L.map(k=>k.accountId),selectedFixedAssetsAccountIds:h.map(k=>k.accountId),selectedAccruedExpensesAccountIds:D.map(k=>k.accountId),selectedBankAccounts1099FilingAccountIds:Z.map(k=>k.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(we({data:Q}))},onBackClick:()=>{Se(c)===!1?(i("../../dashboard"),e(je())):e(ce())},onSaveClick:()=>{e(Ae()),o&&G.track(kn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ee(a.currentTenant.companyId,n))}}})(wn),Qn=()=>{const e=T(),a=B(),i=P(),{useFeatureGate:c}=ee(),{isFeatureEnabled:o}=c(M.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(M.isScheduledJEAccruedExpensesFeatureEnabled),s=x.getSignedInUser(),r=Ie(s),p=m(y=>w(y)),[d,f]=u.useState(!1),[b,g]=u.useState(!1);u.useEffect(()=>{d===!1&&(i(ce()),f(!0))},[d]);const l=m(y=>Ce(y)),E=y=>{g(y)};return t.jsxs(Zn,{children:[t.jsx(v,{isAppContentDrawerOpen:b,handleDrawerToggle:E}),t.jsx(Hn,{currentTenant:p,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:o&&r,isAccruedExpensesFeatureEnabled:n,location:a,isSettings:Se(a),onClickMenuIcon:()=>E(!0)})]})},Xn=U.div`
9
+ `,Hn=R(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:le(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:xe(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,location:c,isFiling1099FeatureEnabled:o}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:s,billsAccountSection:r,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:f}=n,{incomeAccount:b,expenseAccount:g}=s,{billPayAccount:l}=r,{reimbursementsAccount:E}=p,{prepaidExpensesAccount:y,fixedAssetsAccount:j,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:O}=f,A=N(a.accountMappingView.incomeAccountList,b.selectedOption),K=N(a.accountMappingView.expenseAccountList,g.selectedOption),z=N(a.accountMappingView.billPayAccountList,l.selectedOption),J=N(a.accountMappingView.reimbursementsAccountList,E.selectedOption),L=$(a.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),h=$(a.accountMappingView.fixedAssetsAccountList,j.selectedOptions),D=$(a.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Z=$(a.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),H=On(a.accountMappingView.expenseAccounts1099FilingAccountList,O),Q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:K?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:J?.accountId,selectedPrepaidExpensesAccountIds:L.map(k=>k.accountId),selectedFixedAssetsAccountIds:h.map(k=>k.accountId),selectedAccruedExpensesAccountIds:D.map(k=>k.accountId),selectedBankAccounts1099FilingAccountIds:Z.map(k=>k.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(we({data:Q}))},onBackClick:()=>{Se(c)===!1?(i("../../dashboard"),e(je())):e(ce())},onSaveClick:()=>{e(Ae()),o&&G.track(kn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ee(a.currentTenant.companyId,n))}}})(wn),Qn=()=>{const e=T(),a=B(),i=P(),{useFeatureGate:c}=ee(),{isFeatureEnabled:o}=c(U.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(U.isScheduledJEAccruedExpensesFeatureEnabled),s=x.getSignedInUser(),r=Ie(s),p=m(y=>w(y)),[d,f]=u.useState(!1),[b,g]=u.useState(!1);u.useEffect(()=>{d===!1&&(i(ce()),f(!0))},[d]);const l=m(y=>Ce(y)),E=y=>{g(y)};return t.jsxs(Zn,{children:[t.jsx(v,{isAppContentDrawerOpen:b,handleDrawerToggle:E}),t.jsx(Hn,{currentTenant:p,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:o&&r,isAccruedExpensesFeatureEnabled:n,location:a,isSettings:Se(a),onClickMenuIcon:()=>E(!0)})]})},Xn=M.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as t}from"./liveblocks-C3aHR2ug.js";import{a as u}from"./sentry-cQZrhfV
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,qn=R(function(e,a){const i=w(e),c=De(e),o=Me(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(re(i?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:o,analytics:G}},function(e,a){const{navigate:i,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{i("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{i("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(Pn),Wn=()=>{const e=T(),a=B(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(S=>w(S)),b=m(S=>S.billPaySetupApproverViewState.fetchState),g=m(S=>S.remiSetupApproverViewState.fetchState),l=m(S=>ke(S)),E=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=V();u.useEffect(()=>{p||b!=="Not-Started"||(d(!0),i(Pe(!0)))},[p,b,i]),u.useEffect(()=>{s||g!=="Not-Started"||(r(!0),i(ve(!0)))},[s,g,i]);const j=S=>{n(S)};return y?.loggedInUserRoleMap!=null?t.jsxs(Xn,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:j}),t.jsx(qn,{navigate:e,location:a,companyId:E,currentTenant:f,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)}})]}):t.jsx(ne,{fetchState:l.fetchState})},Yn=U.div`
17
+ `,qn=R(function(e,a){const i=w(e),c=De(e),o=Ue(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(re(i?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:o,analytics:G}},function(e,a){const{navigate:i,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{i("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{i("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(Pn),Wn=()=>{const e=T(),a=B(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(S=>w(S)),b=m(S=>S.billPaySetupApproverViewState.fetchState),g=m(S=>S.remiSetupApproverViewState.fetchState),l=m(S=>ke(S)),E=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=V();u.useEffect(()=>{p||b!=="Not-Started"||(d(!0),i(Pe(!0)))},[p,b,i]),u.useEffect(()=>{s||g!=="Not-Started"||(r(!0),i(ve(!0)))},[s,g,i]);const j=S=>{n(S)};return y?.loggedInUserRoleMap!=null?t.jsxs(Xn,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:j}),t.jsx(qn,{navigate:e,location:a,companyId:E,currentTenant:f,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)}})]}):t.jsx(ne,{fetchState:l.fetchState})},Yn=M.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as t}from"./liveblocks-C3aHR2ug.js";import{a as u}from"./sentry-cQZrhfV
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,et=R(function(e,a){const{companyId:i,isZeniAccountEnabled:c,isChargeCardEnabled:o,isBillPayEnabled:n,isRemiEnabled:s,isTreasuryEnabled:r}=a,p=w(e);return{bankSetupView:Ve(e,i,n,s,c,o,r),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:G}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s,r)=>{e(Y(s,n,r))},onEstablishConnectionClick:(n,s,r)=>{e(W(n,o,s,r))},onUpdatePaymentAccountStatus:(n,s,r,p,d)=>{e(ge(n,s,d,p,r))},onUpdatePaymentAccountLoginStatus:(n,s,r,p)=>{e(pe(!1,n,p,r,s))},onEstablishConnectionSuccess:(n,s)=>{e(ue(s,n))},onUpdateAccountClick:(n,s,r,p,d)=>{e(d==="paymentAccount"?de(n,s,r,p):Ne(p,n,s))},onUpdatePrimaryFundingAccount:(n,s,r)=>{e(Le(o,s,n,r))},onRemoveConnection:n=>{e(Oe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(vn),nt=()=>{const e=T(),a=B(),i=P(),{tenantEmailDomain:c}=_(),o=V(),[n,s]=u.useState(!1),[r,p]=u.useState(!1),d=m(I=>w(I)),f=m(I=>I.settingsViewState.bankConnection.fetchState),b=Ue(d,o?.loggedInUserRoleMap),g=Te(d,o?.loggedInUserRoleMap),l=Fe(d,o?.loggedInUserRoleMap),E=Be(d,o?.loggedInUserRoleMap),y=Re(d,o?.loggedInUserRoleMap),j=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{r||f==="Completed"||(p(!0),i(_e(!1)))},[r,i,f]);const S=I=>{s(I)};return b||l||g||y?t.jsxs(Yn,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),t.jsx(et,{navigate:e,location:a,companyId:j,currentTenant:d,roleMap:o.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:y,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):t.jsx(F,{})},tt=U.div`
25
+ `,et=R(function(e,a){const{companyId:i,isZeniAccountEnabled:c,isChargeCardEnabled:o,isBillPayEnabled:n,isRemiEnabled:s,isTreasuryEnabled:r}=a,p=w(e);return{bankSetupView:Ve(e,i,n,s,c,o,r),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:G}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s,r)=>{e(Y(s,n,r))},onEstablishConnectionClick:(n,s,r)=>{e(W(n,o,s,r))},onUpdatePaymentAccountStatus:(n,s,r,p,d)=>{e(ge(n,s,d,p,r))},onUpdatePaymentAccountLoginStatus:(n,s,r,p)=>{e(pe(!1,n,p,r,s))},onEstablishConnectionSuccess:(n,s)=>{e(ue(s,n))},onUpdateAccountClick:(n,s,r,p,d)=>{e(d==="paymentAccount"?de(n,s,r,p):Ne(p,n,s))},onUpdatePrimaryFundingAccount:(n,s,r)=>{e(Le(o,s,n,r))},onRemoveConnection:n=>{e(Oe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(vn),nt=()=>{const e=T(),a=B(),i=P(),{tenantEmailDomain:c}=_(),o=V(),[n,s]=u.useState(!1),[r,p]=u.useState(!1),d=m(I=>w(I)),f=m(I=>I.settingsViewState.bankConnection.fetchState),b=Me(d,o?.loggedInUserRoleMap),g=Te(d,o?.loggedInUserRoleMap),l=Fe(d,o?.loggedInUserRoleMap),E=Be(d,o?.loggedInUserRoleMap),y=Re(d,o?.loggedInUserRoleMap),j=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{r||f==="Completed"||(p(!0),i(_e(!1)))},[r,i,f]);const S=I=>{s(I)};return b||l||g||y?t.jsxs(Yn,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),t.jsx(et,{navigate:e,location:a,companyId:j,currentTenant:d,roleMap:o.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:y,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):t.jsx(F,{})},tt=M.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -30,7 +30,7 @@ import{j as t}from"./liveblocks-C3aHR2ug.js";import{a as u}from"./sentry-cQZrhfV
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,at=R(function(e,a){const{companyId:i}=a,c=w(e),o=a.roleMap.bill_pay_admin,n=Ge(e,i),{uiState:s}=n,r=(re(c?.userRole??[])||o)&&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:s,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:G}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s)=>{e(Y("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(W(n,o,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,r)=>{e(ge(n,s,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(pe(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(de(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(Xe(n))},updateCardPaymentModalState:n=>{e(Qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,s,r)=>{e(He(n,s,r))},handleFetchPaymentSources:()=>{e(q())},resetCardPaymentViewState:()=>{e(Ze())},handleResetCardPaymentErrorStatuses:()=>{e(Je())},onBillingAddressSave:n=>{e(ze(n))},onAddressEditHandler:n=>{if(n!=null){const s=Ln(n);e(Ke({addressType:"subscription_billing_address",addressToCreate:s}))}}}})(Mn),st=()=>{const e=T(),a=B(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(I=>w(I)),b=m(I=>I.cardPaymentViewState),g=m(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Dn(b.addCardPaymentSourceStatus.fetchState),E=b.addCardPaymentSourceStatus.fetchState,y=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const j=V();u.useEffect(()=>{y!=null&&i($e(y,!1))},[y,i]),u.useEffect(()=>{s||(r(!0),i(q()))},[s,i]),u.useEffect(()=>{p||(me(["card"]),d(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&i(q())},[l,E]);const S=I=>{n(I)};return j?.loggedInUserRoleMap!=null?t.jsxs(tt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:S}),t.jsx(at,{navigate:e,location:a,companyId:y,currentTenant:f,roleMap:j.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:ye.googleMapsAPIKey})]}):t.jsx(ne,{fetchState:g})},ot=R(function(){return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,integrationsView:c,tenantEmailDomain:o}=a;return{onBackClick:()=>{i("../")},onNavigateToDashboard:()=>{i("../dashboard")},onReconnectQBO:()=>{oe.init("/connection/auth",o),oe.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(We())}}})(Un),it=()=>{const e=T(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(g=>g.tenantState.fetchState),n=m(g=>w(g)),s=n.companyId??x.getSignedInUserTenant(a)?.companyId,r=x.getSignedInUser(),p=V(),d=p?.loggedInUserRole.includes("admin")===!0;if(r==null)throw Error("Can't access Integrations page without signing in...");const f=g=>{c(g)},b=m(g=>qe(g,s));return p?.loggedInUserRoleMap!=null?t.jsxs(ct,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:f}),t.jsx(ot,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:d,integrationsView:b,isLoading:o==="In-Progress",tenantEmailDomain:n.tenantEmailDomain})]}):t.jsx(ne,{fetchState:o})},ct=U.div`
33
+ `,at=R(function(e,a){const{companyId:i}=a,c=w(e),o=a.roleMap.bill_pay_admin,n=Ge(e,i),{uiState:s}=n,r=(re(c?.userRole??[])||o)&&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:s,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:G}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s)=>{e(Y("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(W(n,o,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,r)=>{e(ge(n,s,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(pe(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(de(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(Xe(n))},updateCardPaymentModalState:n=>{e(Qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,s,r)=>{e(He(n,s,r))},handleFetchPaymentSources:()=>{e(q())},resetCardPaymentViewState:()=>{e(Ze())},handleResetCardPaymentErrorStatuses:()=>{e(Je())},onBillingAddressSave:n=>{e(ze(n))},onAddressEditHandler:n=>{if(n!=null){const s=Ln(n);e(Ke({addressType:"subscription_billing_address",addressToCreate:s}))}}}})(Un),st=()=>{const e=T(),a=B(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(I=>w(I)),b=m(I=>I.cardPaymentViewState),g=m(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Dn(b.addCardPaymentSourceStatus.fetchState),E=b.addCardPaymentSourceStatus.fetchState,y=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const j=V();u.useEffect(()=>{y!=null&&i($e(y,!1))},[y,i]),u.useEffect(()=>{s||(r(!0),i(q()))},[s,i]),u.useEffect(()=>{p||(me(["card"]),d(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&i(q())},[l,E]);const S=I=>{n(I)};return j?.loggedInUserRoleMap!=null?t.jsxs(tt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:S}),t.jsx(at,{navigate:e,location:a,companyId:y,currentTenant:f,roleMap:j.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:ye.googleMapsAPIKey})]}):t.jsx(ne,{fetchState:g})},ot=R(function(){return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,integrationsView:c,tenantEmailDomain:o}=a;return{onBackClick:()=>{i("../")},onNavigateToDashboard:()=>{i("../dashboard")},onReconnectQBO:()=>{oe.init("/connection/auth",o),oe.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(We())}}})(Mn),it=()=>{const e=T(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(g=>g.tenantState.fetchState),n=m(g=>w(g)),s=n.companyId??x.getSignedInUserTenant(a)?.companyId,r=x.getSignedInUser(),p=V(),d=p?.loggedInUserRole.includes("admin")===!0;if(r==null)throw Error("Can't access Integrations page without signing in...");const f=g=>{c(g)},b=m(g=>qe(g,s));return p?.loggedInUserRoleMap!=null?t.jsxs(ct,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:f}),t.jsx(ot,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:d,integrationsView:b,isLoading:o==="In-Progress",tenantEmailDomain:n.tenantEmailDomain})]}):t.jsx(ne,{fetchState:o})},ct=M.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -38,7 +38,7 @@ import{j as t}from"./liveblocks-C3aHR2ug.js";import{a as u}from"./sentry-cQZrhfV
38
38
  flex-direction: column;
39
39
  align-items: center;
40
40
  background-color: ${e=>e.theme.colors.grey4};
41
- `,lt=U.div`
41
+ `,lt=M.div`
42
42
  display: flex;
43
43
  height: 100%;
44
44
  width: 100%;
@@ -46,7 +46,7 @@ import{j as t}from"./liveblocks-C3aHR2ug.js";import{a as u}from"./sentry-cQZrhfV
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,rt=()=>{const e=P(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(l=>w(l)).companyId??x.getSignedInUserTenant(a)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const s=m(l=>Ye(l,n.userId)),r=m(l=>en(l,o,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=r,d=l=>{c(l)},f=u.useCallback(l=>{e(Y("user_reimbursement_account",l))},[]),b=u.useCallback(l=>{e(W(l,o,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&e(nn(n.userId))},[n.userId,s.fetchState]);const g=s.fetchState==="Not-Started"||s.fetchState==="In-Progress";return t.jsxs(lt,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:d}),t.jsx(Tn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:s,onFetchLinkTokenClick:f,onEstablishConnectionClick:b,onClickMenuIcon:()=>{d(!0)}})]})},dt=U.div`
49
+ `,rt=()=>{const e=P(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(l=>w(l)).companyId??x.getSignedInUserTenant(a)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const s=m(l=>Ye(l,n.userId)),r=m(l=>en(l,o,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=r,d=l=>{c(l)},f=u.useCallback(l=>{e(Y("user_reimbursement_account",l))},[]),b=u.useCallback(l=>{e(W(l,o,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&e(nn(n.userId))},[n.userId,s.fetchState]);const g=s.fetchState==="Not-Started"||s.fetchState==="In-Progress";return t.jsxs(lt,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:d}),t.jsx(Tn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:s,onFetchLinkTokenClick:f,onEstablishConnectionClick:b,onClickMenuIcon:()=>{d(!0)}})]})},dt=M.div`
50
50
  display: flex;
51
51
  height: 100%;
52
52
  width: 100%;
@@ -54,4 +54,4 @@ import{j as t}from"./liveblocks-C3aHR2ug.js";import{a as u}from"./sentry-cQZrhfV
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,ie=({appContent:e})=>{const a=P(),i=T(),c=B(),[o,n]=u.useState(!1),s=m(h=>w(h)),{tenantEmailDomain:r}=s,p=s.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ee(),{isFeatureEnabled:f}=d(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(M.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(M.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(M.isTreasuryEnabled),E=m(h=>le(h)),y=fe(s),j=he(g,s),S=!j&&E,I=Fn(s,b,g),{areTenantIdsInSync:O}=Bn();u.useEffect(()=>{O&&a(tn(p,S))},[p,a,S,O]);const A=m(h=>an(h,S)),K=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||p==null,z=sn(s),J=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,L=h=>{n(h)};return t.jsxs(dt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:L}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(Rn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:J===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{L(!0)},isLoading:K,isBankingOnlyTenant:j,isCardsOnlyTenant:y,onAddressClick:h=>{const D=function(H,Q){let k=`/${H}/settings/my_profile`;return k=k.concat(`/new/${Q}`),k}(r,h),Z=_n(c.state?.pathnameStackToGoBack,c.pathname);i(D,{state:{pathnameStackToGoBack:Z}})},onGetOtp:h=>{const D={...A.myProfileLocalData,phone:h};a(te({localData:D})),a(rn(h,"MyProfile"))},onResendOtp:h=>{a(ln(h,"MyProfile"))},onCancelClick:()=>{a(cn())},onSaveClick:()=>{a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(h,D)=>{a(on(h,D,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&x.saveZeniOtpToken(h),a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{a(te({localData:h}))}})]})};function ut(){const e=P(),a=m(l=>w(l)).companyId,i=m(l=>dn(l)),c=m(l=>be(l)),o=x.getSignedInUser(),[n,s]=u.useState(!1),r=u.useCallback(l=>{s(l)},[]),p=u.useCallback(l=>{e(un(l))},[]),d=u.useCallback(()=>{o?.userEmail!=null&&e(pn({loggedInUserEmail:o.userEmail}))},[o?.userEmail]),f=u.useCallback(()=>{e(gn())},[]);if(o==null)throw Error("Can't access Notification Settings page without signing in...");const b=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(mn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))}},[i.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),t.jsxs(t.Fragment,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),t.jsx(Vn,{notificationSettingsView:i,onFormDataChange:p,onCancel:d,onSave:f,onClickMenuIcon:()=>{r(!0)},signedInUser:o,onRefresh:b,resetUpdateStatus:g})]})}function Jt(e){const[a,i]=u.useState(!1),c=m(l=>be(l)),o=m(l=>w(l)),n=V(),s=x.getSignedInUser(),r=P(),{useFeatureGate:p}=ee(),{isFeatureEnabled:d}=p(M.isDebitCardFeatureEnabled),f=s?.userEmail==null||c.fetchState!=="Completed"||fn(c.notificationSettings,s.userEmail,d,o);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(i(!0),r(hn()))},[c.fetchState,a]);const b=he(d,o),g=fe(o);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?bn(o)?t.jsxs(X,{children:[Sn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"accounting/*",element:t.jsx(Qn,{})}),yn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"approval_rules/*",element:t.jsx(pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),In(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"my_bank_connections",element:t.jsx(rt,{})}),Cn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"bank_connections",element:t.jsx(nt,{})}),xn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"business_verification",element:t.jsx(Gn,{productType:b?"zeni_accounts":g?"charge_cards":$n(o,n?.loggedInUserRoleMap)})}),En(n?.loggedInUserRole??[],o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"company_details",element:t.jsx(Kn,{})}),An(n?.loggedInUserRole??[],o)&&t.jsx(C,{path:"billing",element:t.jsx(st,{})}),jn(n?.loggedInUserRole??[],d,o)&&t.jsx(C,{path:"integrations",element:t.jsx(it,{})}),t.jsx(C,{path:"my_profile/new/:addressType",element:t.jsx(ie,{appContent:t.jsx(Nn,{isSubPage:!1})})}),t.jsx(C,{path:"my_profile",element:t.jsx(ie,{})}),f&&t.jsx(C,{path:"notifications",element:t.jsx(ut,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]}):t.jsx(X,{children:t.jsx(C,{path:"*",element:t.jsx(F,{})})}):null}function pt(e){return t.jsxs(X,{children:[t.jsx(C,{path:"/",element:t.jsx(Wn,{})}),t.jsx(C,{path:"bills/approval-rules/*",element:t.jsx(zn,{})}),t.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?t.jsx(Jn,{}):t.jsx(F,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]})}export{Jt as default};
57
+ `,ie=({appContent:e})=>{const a=P(),i=T(),c=B(),[o,n]=u.useState(!1),s=m(h=>w(h)),{tenantEmailDomain:r}=s,p=s.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ee(),{isFeatureEnabled:f}=d(U.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(U.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(U.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(U.isTreasuryEnabled),E=m(h=>le(h)),y=fe(s),j=he(g,s),S=!j&&E,I=Fn(s,b,g),{areTenantIdsInSync:O}=Bn();u.useEffect(()=>{O&&a(tn(p,S))},[p,a,S,O]);const A=m(h=>an(h,S)),K=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||p==null,z=sn(s),J=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,L=h=>{n(h)};return t.jsxs(dt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:L}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(Rn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:J===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{L(!0)},isLoading:K,isBankingOnlyTenant:j,isCardsOnlyTenant:y,onAddressClick:h=>{const D=function(H,Q){let k=`/${H}/settings/my_profile`;return k=k.concat(`/new/${Q}`),k}(r,h),Z=_n(c.state?.pathnameStackToGoBack,c.pathname);i(D,{state:{pathnameStackToGoBack:Z}})},onGetOtp:h=>{const D={...A.myProfileLocalData,phone:h};a(te({localData:D})),a(rn(h,"MyProfile"))},onResendOtp:h=>{a(ln(h,"MyProfile"))},onCancelClick:()=>{a(cn())},onSaveClick:()=>{a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(h,D)=>{a(on(h,D,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&x.saveZeniOtpToken(h),a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{a(te({localData:h}))}})]})};function ut(){const e=P(),a=m(l=>w(l)).companyId,i=m(l=>dn(l)),c=m(l=>be(l)),o=x.getSignedInUser(),[n,s]=u.useState(!1),r=u.useCallback(l=>{s(l)},[]),p=u.useCallback(l=>{e(un(l))},[]),d=u.useCallback(()=>{o?.userEmail!=null&&e(pn({loggedInUserEmail:o.userEmail}))},[o?.userEmail]),f=u.useCallback(()=>{e(gn())},[]);if(o==null)throw Error("Can't access Notification Settings page without signing in...");const b=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(mn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))}},[i.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),t.jsxs(t.Fragment,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),t.jsx(Vn,{notificationSettingsView:i,onFormDataChange:p,onCancel:d,onSave:f,onClickMenuIcon:()=>{r(!0)},signedInUser:o,onRefresh:b,resetUpdateStatus:g})]})}function Jt(e){const[a,i]=u.useState(!1),c=m(l=>be(l)),o=m(l=>w(l)),n=V(),s=x.getSignedInUser(),r=P(),{useFeatureGate:p}=ee(),{isFeatureEnabled:d}=p(U.isDebitCardFeatureEnabled),f=s?.userEmail==null||c.fetchState!=="Completed"||fn(c.notificationSettings,s.userEmail,d,o);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(i(!0),r(hn()))},[c.fetchState,a]);const b=he(d,o),g=fe(o);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?bn(o)?t.jsxs(X,{children:[Sn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"accounting/*",element:t.jsx(Qn,{})}),yn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"approval_rules/*",element:t.jsx(pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),In(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"my_bank_connections",element:t.jsx(rt,{})}),Cn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"bank_connections",element:t.jsx(nt,{})}),xn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"business_verification",element:t.jsx(Gn,{productType:b?"zeni_accounts":g?"charge_cards":$n(o,n?.loggedInUserRoleMap)})}),En(n?.loggedInUserRole??[],o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"company_details",element:t.jsx(Kn,{})}),An(n?.loggedInUserRole??[],o)&&t.jsx(C,{path:"billing",element:t.jsx(st,{})}),jn(n?.loggedInUserRole??[],d,o)&&t.jsx(C,{path:"integrations",element:t.jsx(it,{})}),t.jsx(C,{path:"my_profile/new/:addressType",element:t.jsx(ie,{appContent:t.jsx(Nn,{isSubPage:!1})})}),t.jsx(C,{path:"my_profile",element:t.jsx(ie,{})}),f&&t.jsx(C,{path:"notifications",element:t.jsx(ut,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]}):t.jsx(X,{children:t.jsx(C,{path:"*",element:t.jsx(F,{})})}):null}function pt(e){return t.jsxs(X,{children:[t.jsx(C,{path:"/",element:t.jsx(Wn,{})}),t.jsx(C,{path:"bills/approval-rules/*",element:t.jsx(zn,{})}),t.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?t.jsx(Jn,{}):t.jsx(F,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]})}export{Jt as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-C3aHR2ug.js";import{j as X,u as Q,h as Y,l as W,g as E,N as M,k as G,q as Qe}from"./core-j0LqCeu3.js";import{bE as Ye,ck as Ie,Mt as ye,eO as x,cw as en,xe as Z,x3 as nn,MF as tn,MI as an,pF as ee,pt as ne,j$ as te,rE as N,MK as Ae,fA as $e,fz as We,fy as Ge,ML as sn,xn as on,Be as ke,B5 as _e,B2 as ve,AV as K,B8 as Pe,Bb as Ee,Bh as we,s6 as Te,fP as cn,cr as rn,eU as un,eS as dn,eT as ln,bs as pn,MM as mn,zX as le,Az as yn,MN as fn,bF as gn,Cu as pe,By as Sn,MO as bn,MP as hn,Cy as Cn,CC as In,rx as An,GW as kn,D7 as Ce,E0 as me,MQ as _n,MR as vn,MS as Pn,MT as He,MU as En,Jn as wn,LS as Tn,Jz as Dn,MV as qe,MW as Fe,Dl as Ke,k7 as Un,pw as Je,rG as On,bD as je,rS as Me,cu as Bn,MX as Xe,fc as Fn,CR as xn,CV as Vn,MY as jn,Da as Re,MZ as Mn,M_ as Rn,M$ as Nn,N0 as zn,fI as Ln,yy as Zn,N1 as $n,yD as Wn,yC as Gn}from"./zeni-epic-state-DiQZjsue.js";import{I as ae,C as ie,$ as de,m as De,aK as J,z as T,x as se,c as w,B as Ue,f as $,br as Hn,aq as oe,bs as V,bt as qn,bu as Kn,ac as Ve,bv as Jn,s as Ne,ar as ze,Z as Xn,A as Qn,bw as Yn,bx as et,by as nt,a3 as tt}from"./index-CFtYCyfm.js";import{a as C}from"./sentry-cQZrhfVh.js";import{n as xe,D as at,S as it}from"./mui-D78cc8iD.js";import{M as fe}from"./MobileAppDrawer-DeylJyoS.js";import R from"./NotFoundScreen-BeCKiN3K.js";import{a as Le}from"./analyticsHelper-DUWn4fSe.js";import{c as Ze}from"./routePaths-D7CLql-E.js";import{B as Be}from"./BusinessVerificationPageScreen-DxAzWOOG.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]="788abef6-ce78-427e-b250-8c68fd953857",e._sentryDebugIdIdentifier="sentry-dbid-788abef6-ce78-427e-b250-8c68fd953857")}catch{}})();const st=xe.div`
1
+ import{j as u}from"./liveblocks-BqO7Df-p.js";import{j as X,u as Q,h as Y,l as W,g as E,N as M,k as G,q as Qe}from"./core-DxYppZiZ.js";import{bE as Ye,ck as Ie,Mt as ye,eO as x,cw as en,xe as Z,x3 as nn,MF as tn,MI as an,pF as ee,pt as ne,j$ as te,rE as N,MK as Ae,fA as $e,fz as We,fy as Ge,ML as sn,xn as on,Be as ke,B5 as _e,B2 as ve,AV as K,B8 as Pe,Bb as Ee,Bh as we,s6 as Te,fP as cn,cr as rn,eU as un,eS as dn,eT as ln,bs as pn,MM as mn,zX as le,Az as yn,MN as fn,bF as gn,Cu as pe,By as Sn,MO as bn,MP as hn,Cy as Cn,CC as In,rx as An,GW as kn,D7 as Ce,E0 as me,MQ as _n,MR as vn,MS as Pn,MT as He,MU as En,Jn as wn,LS as Tn,Jz as Dn,MV as qe,MW as Fe,Dl as Ke,k7 as Un,pw as Je,rG as On,bD as je,rS as Me,cu as Bn,MX as Xe,fc as Fn,CR as xn,CV as Vn,MY as jn,Da as Re,MZ as Mn,M_ as Rn,M$ as Nn,N0 as zn,fI as Ln,yy as Zn,N1 as $n,yD as Wn,yC as Gn}from"./zeni-epic-state-CXLj5Oko.js";import{I as ae,C as ie,$ as de,m as De,aK as J,z as T,x as se,c as w,B as Ue,f as $,br as Hn,aq as oe,bs as V,bt as qn,bu as Kn,ac as Ve,bv as Jn,s as Ne,ar as ze,Z as Xn,A as Qn,bw as Yn,bx as et,by as nt,a3 as tt}from"./index-DPw038da.js";import{a as C}from"./sentry-DS2EspaF.js";import{n as xe,D as at,S as it}from"./mui-DdrzQvkp.js";import{M as fe}from"./MobileAppDrawer-DlNmDt_G.js";import R from"./NotFoundScreen-Bn00COMT.js";import{a as Le}from"./analyticsHelper-tcwBG-lH.js";import{c as Ze}from"./routePaths-CgcmkaKJ.js";import{B as Be}from"./BusinessVerificationPageScreen-Cc1IIWeU.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]="8eec9993-5338-47d9-9061-94442cf11ca0",e._sentryDebugIdIdentifier="sentry-dbid-8eec9993-5338-47d9-9061-94442cf11ca0")}catch{}})();const st=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-C3aHR2ug.js";import{a as u,b as T,q as A}from"./sentry-cQZrhfVh.js";import{h as D,j as z,g as d,u as M,N as O,k as P}from"./core-j0LqCeu3.js";import{u as j,z as s,m as B,c as E,D as F,e as _,f as N,g as G,h as H,G as J,i as v}from"./index-CFtYCyfm.js";import{eO as V,IA as $,IB as q,eP as W,fi as K,IG as Q,fH as R,cT as X,IH as y,II as Y,IJ as Z,bS as b}from"./zeni-epic-state-DiQZjsue.js";import"./mui-D78cc8iD.js";import{u as ee}from"./useDeviceId-CE3ipTvl.js";import{f as te}from"./analyticsHelper-DUWn4fSe.js";import{t as ne}from"./getLocaleForTenant-BLNl-Ho3.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.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]="9f751a9e-b6a8-42ab-9f1c-f91cb6f755c7",t._sentryDebugIdIdentifier="sentry-dbid-9f751a9e-b6a8-42ab-9f1c-f91cb6f755c7")}catch{}})();const ie=P(function(t,i){const c=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:c,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:c,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:b(l),sourceUri:b(c.state!=null?c.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=c.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(y())}}})(J),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),c=z(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=d(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=d(e=>e.tenantState),p=d(e=>e.tenantState.fetchState),L=d(e=>e.tenantState.activeTenantFetchState.fetchState),I=d(e=>e.tenantState.signInState),o=d(e=>e.tenantState.loggedInUser),r=d(e=>V(e)),S=d(e=>$(e)),m=M(),w=B().mode,U=m.state?.magicLinkExpired,x=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(()=>{I!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(q(S.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(K(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(Q("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,S.tenantsInOrder),R().then(()=>{const e=H();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",X(r.productSettings))},2e3))},[I,p,L,o,r,S,w,m.state,i]),I==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:c,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(G,{onClose:()=>i(y()),unlockDate:k}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-BqO7Df-p.js";import{a as u,b as T,q as A}from"./sentry-DS2EspaF.js";import{h as D,j as z,g as c,u as M,N as O,k as P}from"./core-DxYppZiZ.js";import{u as j,z as s,m as B,c as E,D as F,e as _,f as N,g as G,h as H,G as J,i as v}from"./index-DPw038da.js";import{eO as V,IA as $,IB as q,eP as W,fi as K,IG as Q,fH as R,cT as X,IH as C,II as Y,IJ as Z,bS as y}from"./zeni-epic-state-CXLj5Oko.js";import"./mui-DdrzQvkp.js";import{u as ee}from"./useDeviceId-CsxMPdAN.js";import{f as te}from"./analyticsHelper-tcwBG-lH.js";import{t as ne}from"./getLocaleForTenant-ClNmnFx1.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.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]="35f0105c-ecea-48d0-876c-88f0797d9d3c",t._sentryDebugIdIdentifier="sentry-dbid-35f0105c-ecea-48d0-876c-88f0797d9d3c")}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(C())}}})(J),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:U,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),L=c(e=>e.tenantState.activeTenantFetchState.fetchState),I=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>V(e)),S=c(e=>$(e)),m=M(),w=B().mode,b=m.state?.magicLinkExpired,x=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(()=>{I!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(q(S.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(K(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(Q("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,S.tenantsInOrder),R().then(()=>{const e=H();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",X(r.productSettings))},2e3))},[I,p,L,o,r,S,w,m.state,i]),I==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!b,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&k!=null?f.jsx(G,{onClose:()=>i(C()),unlockDate:k}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-BqO7Df-p.js";import{a as n}from"./sentry-DS2EspaF.js";import{h as u,u as m,j as p,N as g}from"./core-DxYppZiZ.js";import{z as f,B as b,t as y,c,f as h}from"./index-DPw038da.js";import{fM as I,fN as x,IW as j}from"./zeni-epic-state-CXLj5Oko.js";import{n as w}from"./mui-DdrzQvkp.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.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]="b354cbd7-0302-4a59-8b6f-5ca4fa80abae",e._sentryDebugIdIdentifier="sentry-dbid-b354cbd7-0302-4a59-8b6f-5ca4fa80abae")}catch{}})();function W(){const e=u(),t=m(),a=p(),i=n.useRef(!1),d=f.isSignedIn(),r=t.state?.message==="logout",o=r||d;return n.useEffect(()=>{o&&!i.current&&(i.current=!0,setTimeout(()=>{try{f.clearAll(),e(I()),e(x(!1)),j(),y.reset(),c.trackLogout(h.Event.logoutSuccess),c.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||a("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(b,{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{W as default};
@@ -1,4 +1,4 @@
1
- import{j as p}from"./liveblocks-C3aHR2ug.js";import{a as g}from"./sentry-cQZrhfVh.js";import{j as _,h as z,u as O,g as G,l as M,k as Q}from"./core-j0LqCeu3.js";import{z as P,C as V,$ as d,x as W,c as Z,f as q,cJ as J,s as f,p as H}from"./index-CFtYCyfm.js";import{eO as X,PK as R,Fy as E,PL as x,PG as Y,E_ as S,PM as aa,F2 as I,Ex as ea,Fz as B,PN as F,gD as ta,Fp as sa,Fu as oa,Fh as na,Ff as w,Fv as ia,Fc as la,PO as ra,PP as ca,PQ as ka,PR as ua,PS as m,ea as pa,PT as da,PU as ma}from"./zeni-epic-state-DiQZjsue.js";import{n as Ta}from"./mui-D78cc8iD.js";import{u as ga}from"./useAskAiCfoHostNavButtonProps-CLV01Vra.js";import{c as fa}from"./useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.js";import{M as ha}from"./MobileAppDrawer-DeylJyoS.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.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]="c988a58f-5971-4147-a13b-6f4bd1b2116c",e._sentryDebugIdIdentifier="sentry-dbid-c988a58f-5971-4147-a13b-6f4bd1b2116c")}catch{}})();const Da=Ta.div`
1
+ import{j as p}from"./liveblocks-BqO7Df-p.js";import{a as g}from"./sentry-DS2EspaF.js";import{j as _,h as z,u as O,g as b,l as M,k as Q}from"./core-DxYppZiZ.js";import{z as P,C as V,$ as d,x as W,c as Z,f as q,cJ as J,s as f,p as H}from"./index-DPw038da.js";import{eO as X,PK as R,Fy as E,PL as x,PG as Y,E_ as S,PM as aa,F2 as I,Ex as ea,Fz as B,PN as F,gD as ta,Fp as sa,Fu as oa,Fh as na,Ff as w,Fv as ia,Fc as la,PO as ra,PP as ca,PQ as ka,PR as ua,PS as m,ea as pa,PT as da,PU as ma}from"./zeni-epic-state-CXLj5Oko.js";import{n as Ta}from"./mui-DdrzQvkp.js";import{u as ga}from"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import{c as fa}from"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import{M as ha}from"./MobileAppDrawer-DlNmDt_G.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.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]="10e56675-a14b-4c62-80a5-227e647e7678",e._sentryDebugIdIdentifier="sentry-dbid-10e56675-a14b-4c62-80a5-227e647e7678")}catch{}})();const Da=Ta.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as p}from"./liveblocks-C3aHR2ug.js";import{a as g}from"./sentry-cQZrhfV
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ba=Q(function(e,t){const o=R(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,i=c!=null&&c!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(c))})).filter(l=>l.tasks.length>0)}:o,u=Y(e),n=P.isZeniUser();return{taskListView:i,tagListView:u,localData:i.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:n}},function(e,t){const{navigate:o,currentTenant:c,location:i,isTaskTemplatesEnabled:u}=t,{tenantEmailDomain:n}=c,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(n,a),k=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(E(!0,u))},onTabChange:a=>{e(ua(a))},onParentTaskClick:a=>{const s=L(n,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(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(F({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ka({filters:a}))},onSearchTextChanged:a=>{e(ca({searchText:a}))},onReloadCards:()=>{e(E(!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(ra({localData:a}))},resetLocalData:()=>{e(x({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(la(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(w(t.localData.selectedTaskIds,a,ia(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(na(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=Ga(l,a);e(S({taskDetailLocalData:s}));const k=C(n,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),h=f(i.state?.pathnameStackToGoBack,i.pathname);o(k,{state:{pathnameStackToGoBack:h,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(oa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(sa(a,s))},onTimeSpentUpdate:(a,s)=>{e(B({task:a,updates:s}))},onShowToast:a=>{e(ta(a))},onGroupByFilterChange:a=>{e(F({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(B({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(ea(a,s))},handleGroupTemplateClick:a=>{e(I(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(I(a,[s]))},handleNewTaskInitialization:a=>{if(e(S({taskDetailLocalData:{...aa,name:a}})),t.localData.defaultTaskGroupId!=null){const s=C(n,t.localData.defaultTaskGroupId),k=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${n}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${n}/tasks/quick-responses`)}}})(J);function Ka(){const e=_(),t=z(),o=O(),c=P.getSignedInUser(),i=G(r=>X(r)),{taskGroupId:u}=M(),{useFeatureGate:n}=V(),{isFeatureEnabled:l}=n(d.isTaskTemplatesEnabled),{isFeatureEnabled:a}=n(d.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=n(d.isTaskCategorizationEnabled),{isFeatureEnabled:k}=n(d.isTaskBulkResolutionEnabled),{isFeatureEnabled:h}=n(d.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=n(d.isTaskRecurringParentEnabled),[y,$]=g.useState(!1),[N,j]=g.useState(!1),D=G(r=>R(r,l)),b=G(r=>r.taskGroupState),T=D.fetchState,{isAiCfoAccessEnabled:v,onAskAiCfoClick:U}=ga({mobileExploreReferrer:"Task Checklist"});if(fa({isDataReady:T==="Completed"}),g.useEffect(()=>{y||($(!0),t(E(!1,l)))},[y,t]),g.useEffect(()=>{T==="Completed"&&t(x({taskGroupById:b.taskGroupById}))},[T,b.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return p.jsxs(p.Fragment,{children:[T==="Completed"?p.jsx(W,{analytics:Z,onLoad:r=>(K=>K.trackPageLoaded(q.Event.taskListPage))(r)}):null,p.jsxs(Da,{children:[p.jsx(ha,{isAppContentDrawerOpen:N,handleDrawerToggle:r=>{j(r)}}),p.jsx(ba,{location:o,navigate:e,currentTenant:i,taskGroupId:u,taskGroupState:b,localData:D.localData,uiState:D.uiState,isTaskTemplatesEnabled:l,taskListFetchState:T,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:k,isTaskGroupAssigneesEnabled:h,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:v,onAskAiCfoClick:U})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,C=(e,t)=>`/${e}/tasks/new/${t}`,Ga=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...m.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=pa(t);return{...m.taskDetailLocalData,priority:o}}if(e==="status"){const o=da(t);return{...m.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...m.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=ma(t);return{...m.taskDetailLocalData,dueDate:o}}return{...m.taskDetailLocalData}};export{Ka as default};
9
+ `,Ga=Q(function(e,t){const o=R(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,i=c!=null&&c!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(c))})).filter(l=>l.tasks.length>0)}:o,u=Y(e),n=P.isZeniUser();return{taskListView:i,tagListView:u,localData:i.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:n}},function(e,t){const{navigate:o,currentTenant:c,location:i,isTaskTemplatesEnabled:u}=t,{tenantEmailDomain:n}=c,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(n,a),k=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(E(!0,u))},onTabChange:a=>{e(ua(a))},onParentTaskClick:a=>{const s=L(n,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(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(F({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ka({filters:a}))},onSearchTextChanged:a=>{e(ca({searchText:a}))},onReloadCards:()=>{e(E(!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(ra({localData:a}))},resetLocalData:()=>{e(x({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(la(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(w(t.localData.selectedTaskIds,a,ia(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(na(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=ba(l,a);e(S({taskDetailLocalData:s}));const k=C(n,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),h=f(i.state?.pathnameStackToGoBack,i.pathname);o(k,{state:{pathnameStackToGoBack:h,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(oa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(sa(a,s))},onTimeSpentUpdate:(a,s)=>{e(B({task:a,updates:s}))},onShowToast:a=>{e(ta(a))},onGroupByFilterChange:a=>{e(F({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(B({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(ea(a,s))},handleGroupTemplateClick:a=>{e(I(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(I(a,[s]))},handleNewTaskInitialization:a=>{if(e(S({taskDetailLocalData:{...aa,name:a}})),t.localData.defaultTaskGroupId!=null){const s=C(n,t.localData.defaultTaskGroupId),k=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${n}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${n}/tasks/quick-responses`)}}})(J);function Ka(){const e=_(),t=z(),o=O(),c=P.getSignedInUser(),i=b(r=>X(r)),{taskGroupId:u}=M(),{useFeatureGate:n}=V(),{isFeatureEnabled:l}=n(d.isTaskTemplatesEnabled),{isFeatureEnabled:a}=n(d.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=n(d.isTaskCategorizationEnabled),{isFeatureEnabled:k}=n(d.isTaskBulkResolutionEnabled),{isFeatureEnabled:h}=n(d.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=n(d.isTaskRecurringParentEnabled),[y,$]=g.useState(!1),[N,j]=g.useState(!1),D=b(r=>R(r,l)),G=b(r=>r.taskGroupState),T=D.fetchState,{isAiCfoAccessEnabled:v,onAskAiCfoClick:U}=ga({mobileExploreReferrer:"Task Checklist"});if(fa({isDataReady:T==="Completed"}),g.useEffect(()=>{y||($(!0),t(E(!1,l)))},[y,t]),g.useEffect(()=>{T==="Completed"&&t(x({taskGroupById:G.taskGroupById}))},[T,G.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return p.jsxs(p.Fragment,{children:[T==="Completed"?p.jsx(W,{analytics:Z,onLoad:r=>(K=>K.trackPageLoaded(q.Event.taskListPage))(r)}):null,p.jsxs(Da,{children:[p.jsx(ha,{isAppContentDrawerOpen:N,handleDrawerToggle:r=>{j(r)}}),p.jsx(Ga,{location:o,navigate:e,currentTenant:i,taskGroupId:u,taskGroupState:G,localData:D.localData,uiState:D.uiState,isTaskTemplatesEnabled:l,taskListFetchState:T,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:k,isTaskGroupAssigneesEnabled:h,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:v,onAskAiCfoClick:U})]})]})}const L=(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=pa(t);return{...m.taskDetailLocalData,priority:o}}if(e==="status"){const o=da(t);return{...m.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...m.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=ma(t);return{...m.taskDetailLocalData,dueDate:o}}return{...m.taskDetailLocalData}};export{Ka as default};
@@ -1,4 +1,4 @@
1
- import{j as n}from"./liveblocks-C3aHR2ug.js";import se from"./NotFoundScreen-BeCKiN3K.js";import{a as c}from"./sentry-cQZrhfVh.js";import{j as _,h as H,g,u as ne,l as oe,N as ie,k as re,n as ce,o as f}from"./core-j0LqCeu3.js";import{FC as M,FF as le,FI as de,eO as Z,PG as J,EW as W,EE as pe,Fm as ue,Ff as ke,PH as K,PI as z,EA as me,Ex as fe,pF as ge,pt as he,j$ as Se,EM as Ie,PJ as Ee,ER as Te,EO as be,EH as Ce,E$ as Ge,E_ as De}from"./zeni-epic-state-DiQZjsue.js";import{z as G,cH as xe,H as je,C as ye,$ as T,p as X,s as F,x as Fe,c as A,f as we,cI as ve,i as O,aq as Re}from"./index-CFtYCyfm.js";import{n as Pe}from"./mui-D78cc8iD.js";import{u as Be}from"./useInitialThreadRequest-kL3BFKKo.js";import{M as Ue}from"./MobileAppDrawer-DeylJyoS.js";import Le from"./TaskListScreen-CxNhJaSH.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.js";import"./useAskAiCfoHostNavButtonProps-CLV01Vra.js";import"./useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.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]="d3ce916f-dfb1-4b61-baf2-0065f88487cd",e._sentryDebugIdIdentifier="sentry-dbid-d3ce916f-dfb1-4b61-baf2-0065f88487cd")}catch{}})();function $e(){const e=_(),t=H(),s=G.getSignedInUser(),{cannedResponses:d,fetchState:r,saveFetchState:p}=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(xe,{cannedResponses:d,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:p==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let V,q=[];const Ne=re(function(e,t){const{location:s,taskGroupId:d}=t,r=K(e,t.taskId),p=Z(e),l=d!=null?z(e.taskGroupState,d):void 0,k=G.getSignedInUser(),a=p.tenantId,o={userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:a??""},h=J(e),{tenantEmailDomain:S}=p,b=r.recurringSourceTaskId,D=b!=null?`${O.appUrl}/${S}/tasks/${encodeURIComponent(b)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:o,isZeniUser:G.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==V&&(V=I,q=Object.values(I)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Re.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${O.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:D,tagListView:h,taskGroupName:d!=null&&l!=null&&l.isDefault===!1?l.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(u=>z(e.taskGroupState,u)).filter(u=>u!=null&&!u.isDeleted).map(u=>({id:u.id,name:u.name,isDefault:u.isDefault}))}},function(e,t){const{taskId:s,navigate:d,currentTenant:r,location:p,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(be(a,o))},onUnsnoozeTask:a=>{e(Te(a))},onDismissClick:()=>{if(p.state?.message==="triggerBackClick"){const a=X(p.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";d(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=w(k),o=F(p.state?.pathnameStackToGoBack,p.pathname);d(a,{state:{pathnameStackToGoBack:o}})}e(Ee({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(W(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(M())},onManageTemplatesClick:()=>{d(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function y(){const e=_(),t=H(),s=ne(),d=je(),{taskId:r,taskGroupId:p}=oe(),l=g(i=>Z(i)),k=Be(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(T.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(T.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(T.isTaskCannedResponsesEnabled),{isFeatureEnabled:b}=a(T.isTaskRecurringParentEnabled),{isFeatureEnabled:D}=a(T.isTaskGroupAssigneesEnabled),[I,u]=c.useState(!1),[v,Y]=c.useState(!1),[R,Q]=c.useState(!1),[P,ee]=c.useState(!1),[B,x]=c.useState(!1),E=c.useRef(!1),C=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>J(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{v||(Y(!0),t(W(!1,r)))},[v,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(Q(!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&&(E.current=!1,t(ke([r],null,{isArchived:!1})),x(!0))},[t,r]);c.useEffect(()=>{if(B)if(C!=="In-Progress"){if(E.current){if(C==="Error")return x(!1),void(E.current=!1);if(C==="Completed"){x(!1),E.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=w(i);e(m,{state:{pathnameStackToGoBack:F(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else E.current=!0},[B,C,l,s,e]);const $=g(i=>K(i,r)),j=$.fetchState,N=G.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=w(i),te=F(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(Fe,{analytics:A,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:I,handleDrawerToggle:i=>{u(i)}}),n.jsx(Ne,{analytics:A,currentTenant:l,handleZeniLogoClick:()=>{d.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:p,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:b,isTaskGroupAssigneesEnabled:D})]})]})}const ze=Pe.div`
1
+ import{j as n}from"./liveblocks-BqO7Df-p.js";import se from"./NotFoundScreen-Bn00COMT.js";import{a as c}from"./sentry-DS2EspaF.js";import{j as _,h as H,g,u as ne,l as oe,N as ie,k as re,n as ce,o as f}from"./core-DxYppZiZ.js";import{FC as M,FF as le,FI as de,eO as Z,PG as J,EW as W,EE as pe,Fm as ue,Ff as ke,PH as K,PI as z,EA as me,Ex as fe,pF as ge,pt as he,j$ as Se,EM as Ie,PJ as Ee,ER as Te,EO as be,EH as Ce,E$ as Ge,E_ as De}from"./zeni-epic-state-CXLj5Oko.js";import{z as G,cH as xe,H as je,C as ye,$ as T,p as X,s as F,x as Fe,c as A,f as we,cI as ve,i as O,aq as Re}from"./index-DPw038da.js";import{n as Pe}from"./mui-DdrzQvkp.js";import{u as Be}from"./useInitialThreadRequest-Wi13xyTC.js";import{M as Ue}from"./MobileAppDrawer-DlNmDt_G.js";import Le from"./TaskListScreen-ByuOJ-7H.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";import"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.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]="ea1b0d81-aded-41d6-a68e-3d720c1f0a5a",e._sentryDebugIdIdentifier="sentry-dbid-ea1b0d81-aded-41d6-a68e-3d720c1f0a5a")}catch{}})();function $e(){const e=_(),t=H(),s=G.getSignedInUser(),{cannedResponses:d,fetchState:r,saveFetchState:p}=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(xe,{cannedResponses:d,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:p==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let V,q=[];const Ne=re(function(e,t){const{location:s,taskGroupId:d}=t,r=K(e,t.taskId),p=Z(e),l=d!=null?z(e.taskGroupState,d):void 0,k=G.getSignedInUser(),a=p.tenantId,o={userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:a??""},h=J(e),{tenantEmailDomain:S}=p,b=r.recurringSourceTaskId,D=b!=null?`${O.appUrl}/${S}/tasks/${encodeURIComponent(b)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:o,isZeniUser:G.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==V&&(V=I,q=Object.values(I)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Re.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${O.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:D,tagListView:h,taskGroupName:d!=null&&l!=null&&l.isDefault===!1?l.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(u=>z(e.taskGroupState,u)).filter(u=>u!=null&&!u.isDeleted).map(u=>({id:u.id,name:u.name,isDefault:u.isDefault}))}},function(e,t){const{taskId:s,navigate:d,currentTenant:r,location:p,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(be(a,o))},onUnsnoozeTask:a=>{e(Te(a))},onDismissClick:()=>{if(p.state?.message==="triggerBackClick"){const a=X(p.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";d(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=w(k),o=F(p.state?.pathnameStackToGoBack,p.pathname);d(a,{state:{pathnameStackToGoBack:o}})}e(Ee({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(W(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(M())},onManageTemplatesClick:()=>{d(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function y(){const e=_(),t=H(),s=ne(),d=je(),{taskId:r,taskGroupId:p}=oe(),l=g(i=>Z(i)),k=Be(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(T.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(T.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(T.isTaskCannedResponsesEnabled),{isFeatureEnabled:b}=a(T.isTaskRecurringParentEnabled),{isFeatureEnabled:D}=a(T.isTaskGroupAssigneesEnabled),[I,u]=c.useState(!1),[v,Y]=c.useState(!1),[R,Q]=c.useState(!1),[P,ee]=c.useState(!1),[B,x]=c.useState(!1),E=c.useRef(!1),C=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>J(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{v||(Y(!0),t(W(!1,r)))},[v,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(Q(!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&&(E.current=!1,t(ke([r],null,{isArchived:!1})),x(!0))},[t,r]);c.useEffect(()=>{if(B)if(C!=="In-Progress"){if(E.current){if(C==="Error")return x(!1),void(E.current=!1);if(C==="Completed"){x(!1),E.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=w(i);e(m,{state:{pathnameStackToGoBack:F(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else E.current=!0},[B,C,l,s,e]);const $=g(i=>K(i,r)),j=$.fetchState,N=G.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=w(i),te=F(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(Fe,{analytics:A,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:I,handleDrawerToggle:i=>{u(i)}}),n.jsx(Ne,{analytics:A,currentTenant:l,handleZeniLogoClick:()=>{d.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:p,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:b,isTaskGroupAssigneesEnabled:D})]})]})}const ze=Pe.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-BqO7Df-p.js";import i from"./NotFoundScreen-Bn00COMT.js";import{T as r}from"./TransactionDetailScreen-nBKG_H4f.js";import"./sentry-DS2EspaF.js";import{n as a,o}from"./core-DxYppZiZ.js";import"./zeni-epic-state-CXLj5Oko.js";import"./recharts-BucGjD65.js";import"./index-DPw038da.js";import"./mui-DdrzQvkp.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";import"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import"./decodeURIComponentSafe-B26owMY4.js";import"./routePaths-CgcmkaKJ.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]="50e87735-4ba7-4a09-8438-0ea2bea3d928",e._sentryDebugIdIdentifier="sentry-dbid-50e87735-4ba7-4a09-8438-0ea2bea3d928")}catch{}})();function q(){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{q as default};
@@ -1,5 +1,5 @@
1
- import{j as I}from"./liveblocks-C3aHR2ug.js";import{a as d}from"./sentry-cQZrhfVh.js";import{h as j,g as S,u as re,j as le,l as de,N as Re,k as ze}from"./core-j0LqCeu3.js";import{bn as je,eO as H,cP as ue,bv as me,pk as Y,JN as B,KO as pe,KP as J,Kb as he,jC as fe,KQ as ge,Kg as Z,Kh as Q,kr as Se,GO as X,JH as _,jw as Te,ju as ye,jG as Ke,KR as $e,KS as Me,t9 as z,jB as ve,G9 as Ee,cU as We,cV as qe,KT as He,JG as Ye,KU as Je,td as Ze,KV as Qe,KW as Xe,KX as ea,KY as aa,KZ as ta,jF as na,K_ as oa,K$ as sa,JI as ia,L0 as ca,L1 as ra,L2 as la,G3 as da,FT as ua,Gl as ma,jH as pa,GP as ie,G0 as ha}from"./zeni-epic-state-DiQZjsue.js";import{z as De,C as ee,$ as V,aK as Ce,m as fa,Z as ga,aL as Sa,A as Ta,p as W,I as ya,aM as va,s as q,c as be,aN as Ea,aq as Da,U as M}from"./index-CFtYCyfm.js";import{n as Ca,S as ba,D as Ia}from"./mui-D78cc8iD.js";import{u as ka}from"./useAskAiCfoHostNavButtonProps-CLV01Vra.js";import{c as Ua}from"./useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.js";import{d as Ie}from"./decodeURIComponentSafe-DFYfbcv3.js";import{h as ke,g as Aa,d as xa,b as _a}from"./routePaths-D7CLql-E.js";import{t as Va}from"./utils-BBuNXoTI.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="79c4077e-37da-4f3c-9aa4-ec460c2564ad",a._sentryDebugIdIdentifier="sentry-dbid-79c4077e-37da-4f3c-9aa4-ec460c2564ad")}catch{}})();const ae=()=>{const a=De.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(V.isChainOfThoughtEnabled);return d.useMemo(()=>je(a)&&s,[a,s])};function Ue(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Ja(a,e){const s=j(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>H(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:T}=t(V.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:b}=t(V.isExpenseAutomationEnabled),{configValue:h}=n(Ce.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,k=ae(),y=d.useMemo(()=>({id:a,type:Y(e)}),[a,e]),m=S(u=>B(u,y)),C=S(u=>{const N=B(u,y)?.transactionDetailLocalData.vendorUpdates?.id;return N==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[N]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Ue(m?.transaction):void 0,[m?.fetchState,m?.transaction]),E=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),U=S(u=>J(u)),L=S(u=>{if(p!=null)return he(u.trendWithTransactionsState,p,"TransactionDetail")}),K=o.company?.companyInfo.firstMonthOfFY??1,$=S(u=>fe(u.accountState,u.accountListState,"accountList")),[w,P]=d.useState(!1),[F,v]=d.useState(!1),[c,O]=d.useState(!1);d.useEffect(()=>{P(!1),v(!1),O(!1)},[a,e]);const D=d.useCallback(()=>{P(!1),v(!1)},[]),[A,x]=d.useState(!1),G=L?.selectedPeriod?.timePeriod;return d.useEffect(()=>{c||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),O(!0)),p!=null&&(!i||l&&g===!1)&&(w?F||E==null||(v(!0),s(X(p,"TransactionDetail",{timeframe:"month",timePeriod:G??E}))):(s(Z()),s(Q()),P(!0),s(Se(p))))},[s,c,m?.fetchState,m?.transaction,p,i,l,g,w,F,E,G]),d.useEffect(()=>{U.newVendorState?.vendorDetailLocalData?.vendorName!=null?x(!0):x(!1)},[U.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(_("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:b,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:k,selectedTransaction:y,transactionDetail:m,vendorSaveStatus:C,tranEntity:p,defaultTrendTransactionTimePeriod:E,vendorViewDetails:U,uiState:L,firstMonthOfFY:K,uncategorizedAccounts:$,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:A,setIsCreateVendorDrawerOpen:x}}const La={overlayWidth:new Ta(100,100,58)},Pa=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=fa(),i=ga(),l=j(),g=S(h=>J(h)),T=()=>{t()},b={vendorDetailView:n??g,onSaveSuccess:()=>{l(ye()),l(Ke("Not-Started")),s()},onSaveVendor:e,onCancelClick:T,saveVendorDetailLocalData:h=>{l(Te({vendorId:void 0,localData:h}))}};return I.jsx(Ia,{anchor:"right",open:a,PaperProps:{style:{width:La.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:T,children:I.jsx(Ba,{onClick:h=>h.stopPropagation(),children:I.jsx(Sa,{...b})})})},Ba=Ca(ba)`
1
+ import{j as I}from"./liveblocks-BqO7Df-p.js";import{a as d}from"./sentry-DS2EspaF.js";import{h as j,g as S,u as re,j as le,l as de,N as Re,k as ze}from"./core-DxYppZiZ.js";import{bn as je,eO as H,cP as ue,bv as me,pk as Y,JN as B,KO as pe,KP as J,Kb as he,jC as fe,KQ as ge,Kg as X,Kh as Z,kr as Se,GO as Q,JH as _,jw as Te,ju as ye,jG as Ke,KR as $e,KS as Me,t9 as z,jB as ve,G9 as Ee,cU as We,cV as qe,KT as He,JG as Ye,KU as Je,td as Xe,KV as Ze,KW as Qe,KX as ea,KY as aa,KZ as ta,jF as na,K_ as oa,K$ as sa,JI as ia,L0 as ca,L1 as ra,L2 as la,G3 as da,FT as ua,Gl as ma,jH as pa,GP as ie,G0 as ha}from"./zeni-epic-state-CXLj5Oko.js";import{z as be,C as ee,$ as V,aK as De,m as fa,Z as ga,aL as Sa,A as Ta,p as W,I as ya,aM as va,s as q,c as Ce,aN as Ea,aq as ba,X as M}from"./index-DPw038da.js";import{n as Da,S as Ca,D as Ia}from"./mui-DdrzQvkp.js";import{u as ka}from"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import{c as Ua}from"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import{d as Ie}from"./decodeURIComponentSafe-B26owMY4.js";import{h as ke,g as Aa,d as xa,b as _a}from"./routePaths-CgcmkaKJ.js";import{t as Va}from"./utils-B6prU8As.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="6bb835dc-aeaf-42e8-bd2e-1fb2a49e15c8",a._sentryDebugIdIdentifier="sentry-dbid-6bb835dc-aeaf-42e8-bd2e-1fb2a49e15c8")}catch{}})();const ae=()=>{const a=be.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(V.isChainOfThoughtEnabled);return d.useMemo(()=>je(a)&&s,[a,s])};function Ue(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Ja(a,e){const s=j(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>H(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:T}=t(V.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:C}=t(V.isExpenseAutomationEnabled),{configValue:h}=n(De.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,k=ae(),y=d.useMemo(()=>({id:a,type:Y(e)}),[a,e]),m=S(u=>B(u,y)),D=S(u=>{const N=B(u,y)?.transactionDetailLocalData.vendorUpdates?.id;return N==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[N]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Ue(m?.transaction):void 0,[m?.fetchState,m?.transaction]),E=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),U=S(u=>J(u)),L=S(u=>{if(p!=null)return he(u.trendWithTransactionsState,p,"TransactionDetail")}),K=o.company?.companyInfo.firstMonthOfFY??1,$=S(u=>fe(u.accountState,u.accountListState,"accountList")),[w,P]=d.useState(!1),[F,v]=d.useState(!1),[c,O]=d.useState(!1);d.useEffect(()=>{P(!1),v(!1),O(!1)},[a,e]);const b=d.useCallback(()=>{P(!1),v(!1)},[]),[A,x]=d.useState(!1),G=L?.selectedPeriod?.timePeriod;return d.useEffect(()=>{c||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),O(!0)),p!=null&&(!i||l&&g===!1)&&(w?F||E==null||(v(!0),s(Q(p,"TransactionDetail",{timeframe:"month",timePeriod:G??E}))):(s(X()),s(Z()),P(!0),s(Se(p))))},[s,c,m?.fetchState,m?.transaction,p,i,l,g,w,F,E,G]),d.useEffect(()=>{U.newVendorState?.vendorDetailLocalData?.vendorName!=null?x(!0):x(!1)},[U.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(_("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:C,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:k,selectedTransaction:y,transactionDetail:m,vendorSaveStatus:D,tranEntity:p,defaultTrendTransactionTimePeriod:E,vendorViewDetails:U,uiState:L,firstMonthOfFY:K,uncategorizedAccounts:$,resetTrendIsFetchedStates:b,isCreateVendorDrawerOpen:A,setIsCreateVendorDrawerOpen:x}}const La={overlayWidth:new Ta(100,100,58)},Pa=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=fa(),i=ga(),l=j(),g=S(h=>J(h)),T=()=>{t()},C={vendorDetailView:n??g,onSaveSuccess:()=>{l(ye()),l(Ke("Not-Started")),s()},onSaveVendor:e,onCancelClick:T,saveVendorDetailLocalData:h=>{l(Te({vendorId:void 0,localData:h}))}};return I.jsx(Ia,{anchor:"right",open:a,PaperProps:{style:{width:La.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:T,children:I.jsx(Ba,{onClick:h=>h.stopPropagation(),children:I.jsx(Sa,{...C})})})},Ba=Da(Ca)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,wa=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=re(),n=le(),o=j(),i=ae(),{transactionTypeEncoded:l,transactionId:g}=de(),T=e??g,b=s??Ie(l??"");let h;ke(T,b)&&(h={id:T,type:Y(b)});const f=h!=null?S(y=>B(y,h)):void 0,k=()=>{const y=W(t.state?.pathnameStackToGoBack),m=y.poppedPathname??((C=2)=>{let p="../";for(let E=0;E<C;E++)p=`${p}../`;return p})(1);n(m,{state:{pathnameStackToGoBack:y.newStack}})};return{transactionId:h,onSaveVendor:()=>{o(ve(h,void 0))},onSaveSuccess:()=>{if(f!=null&&f?.transaction&&f?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&f?.transactionDetailLocalData.vendorUpdates?.id!=null){const y=f?.transactionDetailLocalData.vendorUpdates,m={id:f?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:f?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:y?.name,qboId:f?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:f?.transaction?.id,type:f?.transaction?.type},transaction:f?.transaction,lineIds:f?.transaction?.lines?.map(p=>p.id)??[]};o(z(m,f?.transaction?.amount.amount,C,!1,!1,i))}k()},onCancel:()=>{h!=null&&o($e({transactionId:h})),o(ye()),o(Me()),a(!0),k()}}},Fa=ze(function(a,e){const s=B(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=De.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=He(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,g=Ye(a,"common"),T=H(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${M}/transaction_attachment`,transactionAttachmentsEndpointToFetch:T.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${M}/transaction_attachments_accounting_provider`:`${M}/transaction_attachments`,attachmentUploadEndpoint:`${Da.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:be,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:g},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(_("common")),e.onBackClick!=null)return void e.onBackClick();const t=W(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ae(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(ha({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(Z()),a(Q());const n=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(_a(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(ie(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(X(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(ie(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?ve(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):pa({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(_("common"))},onUploadAttachmentAttachment:t=>{a(ma(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(ua(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(da({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(la(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,g)=>{a(ra(t,n,o,i,l,g))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(ca({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=W(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=Va(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${Aa(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${xa(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(Ee(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(ia({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(_("common"))},onCancelAutoComplete:()=>{a(_("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(z(t,n,o,i,!1,s))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(sa(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(oa(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(na({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(z(o,i,l,!1,!1,s)),a(Te({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const g=e.transaction,T=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(g.type??"")}/${g.id}/vendor/create`,{state:{pathnameStackToGoBack:T}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(ta({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(z(o,i,l,!1,!1,s))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(aa({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ea(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(Xe(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(Qe({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(Ze(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(Je(t,n,o))}}})(Ea);function Za(){const a=le(),e=j(),s=re(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=ya(),i=S(r=>H(r)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),g=i.userRole!=null&&ue(i.userRole),T=i.userRole!=null&&me(i.userRole),{isFeatureEnabled:b}=t(V.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=t(V.isExpenseAutomationEnabled),{configValue:f}=n(Ce.enableUncategorizedExpenseCategory),k=f?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:y,transactionTypeEncoded:m,transactionId:C}=de(),[p,E]=d.useState(!1),U=Ie(m??""),L=ke(C,U),K=S(r=>r.transactionVendorViewState),$=ae(),{isFeatureEnabled:w}=t(V.isTransactionCommentingEnabled),P=o?.currentTenant?.companyId,F=o?.currentTenant?.companyName;let v;L&&(v={id:C,type:Y(U)});const c=v!=null?S(r=>B(r,v)):void 0,O=c?.transactionDetailLocalData.vendorUpdates?.id!=null?K.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=c?.fetchState==="Completed"?Ue(c?.transaction):void 0,A=S(r=>D!=null?pe(r.customerIncomeState,r.vendorExpenseState,r.trendState,D,"month"):void 0),x=S(r=>J(r)),G=S(r=>D!=null?he(r.trendWithTransactionsState,D,"TransactionDetail"):void 0),u=i.company?.companyInfo.firstMonthOfFY??1,N=S(r=>fe(r.accountState,r.accountListState,"accountList")),[xe,te]=d.useState(!1),[_e,ne]=d.useState(!1),[Ve,Le]=d.useState(!1),oe=()=>{te(!1),ne(!1)},Pe=va();d.useEffect(()=>{if(v!=null&&c!=null&&c.fetchState==="Not-Started")e(Ee(v)),oe();else if(v!=null&&c!=null&&c.fetchState==="Error"){const r=q(s.state?.pathnameStackToGoBack,s.pathname),R={pathnameStackToGoBack:r,message:"pageNotFound",origin:"transaction_detail"};Pe&&(R.message="expenseAutomation",R.origin="transaction_categorization",R.pathnameStackToGoBack=r),a("page-not-found",{replace:!0,state:R})}},[v]),d.useEffect(()=>{Ve||c==null||c.transaction==null||(e(ge({id:c.transaction.id,type:c.transaction.type})),Le(!0)),D==null&&c?.fetchState==="Completed"&&ce(c?.transaction),D!=null&&(!l||g&&T===!1)&&(xe?_e||A==null||(ne(!0),e(X(D,"TransactionDetail",{timeframe:"month",timePeriod:G?.selectedPeriod?.timePeriod??A}))):(e(Z()),e(Q()),ce(c?.transaction),te(!0),e(Se(D))))},[c?.fetchState,c?.transaction,A,l]),d.useEffect(()=>{x.newVendorState?.vendorDetailLocalData?.vendorName!=null?E(!0):E(!1)},[x.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{e(_("common"))},[]);const Be=[m,C].filter(r=>r!=null),{transactionId:se,onSaveVendor:we,onSaveSuccess:Fe,onCancel:Oe}=wa({closeDrawerHandler:r=>{E(!1),a(r?"../":"../..")}}),{isAiCfoAccessEnabled:Ge,onAskAiCfoClick:Ne}=ka({mobileExploreReferrer:"Transaction Details"});return Ua({isDataReady:c?.fetchState==="Completed"}),L?I.jsxs(I.Fragment,{children:[se!=null&&p&&I.jsx(Pa,{isOpen:p,transactionId:se,onSaveVendor:we,onSaveSuccess:Fe,onCancel:Oe}),I.jsx(Fa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:y,location:s,navigate:a,selectedTransaction:v,entity:D,isCOTEnabled:$,defaultTrendTransactionTimePeriod:A,resetTrendIsFetchedStates:oe,transaction:c?.transaction,uncategorizedAccounts:N,vendorSaveStatus:O,isVendorBulkUpdateOnTransactionEnabled:b,isExpenseAutomationEnabled:h,isUncategorizedExpenseCategoryEnabled:k,isAiCfoAccessEnabled:Ge,onAskAiCfoClick:Ne,isTransactionCommentingEnabled:w,companyId:P,companyName:F})]}):I.jsx(Re,{to:Ae(Be.length)})}const Ae=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},ce=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=Oa(a),t=Ga(a);be.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},Oa=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},Ga=a=>We(a)===!0?a.customer?.name??"":qe(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{Pa as C,Za as T,wa as a,Fa as b,ae as c,Ja as u};
5
+ `,wa=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=re(),n=le(),o=j(),i=ae(),{transactionTypeEncoded:l,transactionId:g}=de(),T=e??g,C=s??Ie(l??"");let h;ke(T,C)&&(h={id:T,type:Y(C)});const f=h!=null?S(y=>B(y,h)):void 0,k=()=>{const y=W(t.state?.pathnameStackToGoBack),m=y.poppedPathname??((D=2)=>{let p="../";for(let E=0;E<D;E++)p=`${p}../`;return p})(1);n(m,{state:{pathnameStackToGoBack:y.newStack}})};return{transactionId:h,onSaveVendor:()=>{o(ve(h,void 0))},onSaveSuccess:()=>{if(f!=null&&f?.transaction&&f?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&f?.transactionDetailLocalData.vendorUpdates?.id!=null){const y=f?.transactionDetailLocalData.vendorUpdates,m={id:f?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:f?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:y?.name,qboId:f?.transactionDetailLocalData.vendorUpdates?.qboId??""},D={transactionId:{id:f?.transaction?.id,type:f?.transaction?.type},transaction:f?.transaction,lineIds:f?.transaction?.lines?.map(p=>p.id)??[]};o(z(m,f?.transaction?.amount.amount,D,!1,!1,i))}k()},onCancel:()=>{h!=null&&o($e({transactionId:h})),o(ye()),o(Me()),a(!0),k()}}},Fa=ze(function(a,e){const s=B(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=be.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=He(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,g=Ye(a,"common"),T=H(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${M}/transaction_attachment`,transactionAttachmentsEndpointToFetch:T.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${M}/transaction_attachments_accounting_provider`:`${M}/transaction_attachments`,attachmentUploadEndpoint:`${ba.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:Ce,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:g},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(_("common")),e.onBackClick!=null)return void e.onBackClick();const t=W(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ae(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(ha({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(X()),a(Z());const n=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(_a(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(ie(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(Q(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(ie(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?ve(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):pa({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(_("common"))},onUploadAttachmentAttachment:t=>{a(ma(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(ua(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(da({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(la(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,g)=>{a(ra(t,n,o,i,l,g))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(ca({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=W(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=Va(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${Aa(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${xa(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(Ee(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(ia({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(_("common"))},onCancelAutoComplete:()=>{a(_("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(z(t,n,o,i,!1,s))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(sa(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(oa(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(na({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(z(o,i,l,!1,!1,s)),a(Te({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const g=e.transaction,T=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(g.type??"")}/${g.id}/vendor/create`,{state:{pathnameStackToGoBack:T}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(ta({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(z(o,i,l,!1,!1,s))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(aa({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ea(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(Qe(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(Ze({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(Xe(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(Je(t,n,o))}}})(Ea);function Xa(){const a=le(),e=j(),s=re(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=ya(),i=S(r=>H(r)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),g=i.userRole!=null&&ue(i.userRole),T=i.userRole!=null&&me(i.userRole),{isFeatureEnabled:C}=t(V.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=t(V.isExpenseAutomationEnabled),{configValue:f}=n(De.enableUncategorizedExpenseCategory),k=f?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:y,transactionTypeEncoded:m,transactionId:D}=de(),[p,E]=d.useState(!1),U=Ie(m??""),L=ke(D,U),K=S(r=>r.transactionVendorViewState),$=ae(),{isFeatureEnabled:w}=t(V.isTransactionCommentingEnabled),P=o?.currentTenant?.companyId,F=o?.currentTenant?.companyName;let v;L&&(v={id:D,type:Y(U)});const c=v!=null?S(r=>B(r,v)):void 0,O=c?.transactionDetailLocalData.vendorUpdates?.id!=null?K.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",b=c?.fetchState==="Completed"?Ue(c?.transaction):void 0,A=S(r=>b!=null?pe(r.customerIncomeState,r.vendorExpenseState,r.trendState,b,"month"):void 0),x=S(r=>J(r)),G=S(r=>b!=null?he(r.trendWithTransactionsState,b,"TransactionDetail"):void 0),u=i.company?.companyInfo.firstMonthOfFY??1,N=S(r=>fe(r.accountState,r.accountListState,"accountList")),[xe,te]=d.useState(!1),[_e,ne]=d.useState(!1),[Ve,Le]=d.useState(!1),oe=()=>{te(!1),ne(!1)},Pe=va();d.useEffect(()=>{if(v!=null&&c!=null&&c.fetchState==="Not-Started")e(Ee(v)),oe();else if(v!=null&&c!=null&&c.fetchState==="Error"){const r=q(s.state?.pathnameStackToGoBack,s.pathname),R={pathnameStackToGoBack:r,message:"pageNotFound",origin:"transaction_detail"};Pe&&(R.message="expenseAutomation",R.origin="transaction_categorization",R.pathnameStackToGoBack=r),a("page-not-found",{replace:!0,state:R})}},[v]),d.useEffect(()=>{Ve||c==null||c.transaction==null||(e(ge({id:c.transaction.id,type:c.transaction.type})),Le(!0)),b==null&&c?.fetchState==="Completed"&&ce(c?.transaction),b!=null&&(!l||g&&T===!1)&&(xe?_e||A==null||(ne(!0),e(Q(b,"TransactionDetail",{timeframe:"month",timePeriod:G?.selectedPeriod?.timePeriod??A}))):(e(X()),e(Z()),ce(c?.transaction),te(!0),e(Se(b))))},[c?.fetchState,c?.transaction,A,l]),d.useEffect(()=>{x.newVendorState?.vendorDetailLocalData?.vendorName!=null?E(!0):E(!1)},[x.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{e(_("common"))},[]);const Be=[m,D].filter(r=>r!=null),{transactionId:se,onSaveVendor:we,onSaveSuccess:Fe,onCancel:Oe}=wa({closeDrawerHandler:r=>{E(!1),a(r?"../":"../..")}}),{isAiCfoAccessEnabled:Ge,onAskAiCfoClick:Ne}=ka({mobileExploreReferrer:"Transaction Details"});return Ua({isDataReady:c?.fetchState==="Completed"}),L?I.jsxs(I.Fragment,{children:[se!=null&&p&&I.jsx(Pa,{isOpen:p,transactionId:se,onSaveVendor:we,onSaveSuccess:Fe,onCancel:Oe}),I.jsx(Fa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:y,location:s,navigate:a,selectedTransaction:v,entity:b,isCOTEnabled:$,defaultTrendTransactionTimePeriod:A,resetTrendIsFetchedStates:oe,transaction:c?.transaction,uncategorizedAccounts:N,vendorSaveStatus:O,isVendorBulkUpdateOnTransactionEnabled:C,isExpenseAutomationEnabled:h,isUncategorizedExpenseCategoryEnabled:k,isAiCfoAccessEnabled:Ge,onAskAiCfoClick:Ne,isTransactionCommentingEnabled:w,companyId:P,companyName:F})]}):I.jsx(Re,{to:Ae(Be.length)})}const Ae=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},ce=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=Oa(a),t=Ga(a);Ce.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},Oa=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},Ga=a=>We(a)===!0?a.customer?.name??"":qe(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{Pa as C,Xa as T,wa as a,Fa as b,ae as c,Ja as u};
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-C3aHR2ug.js";import{j as J,u as R,h as U,l as H,g as z,N as j,k as Q,n as Ae,o as I}from"./core-j0LqCeu3.js";import{eO as $,iQ as T,O9 as K,GF as ue,bq as ie,Oa as he,jr as Z,Kd as W,Ob as se,Oc as Se,bD as Y,GC as me,Od as ke,Oe as re,Of as be,Og as pe,Oh as Ie,Oi as ve,Oj as de,HS as xe,bn as Ye}from"./zeni-epic-state-DiQZjsue.js";import{D as X,c as C,c7 as ee,s as w,p as te,C as fe,$ as q,O as Ee,z as Pe}from"./index-CFtYCyfm.js";import"./mui-D78cc8iD.js";import{a as y}from"./sentry-cQZrhfVh.js";import{w as ae}from"./withTransactionSidePanel-BbFtF7db.js";import{p as ne,b as ce}from"./routePaths-D7CLql-E.js";import{u as Le}from"./utils-BBuNXoTI.js";import{d as L}from"./decodeURIComponentSafe-DFYfbcv3.js";import{Z as ze}from"./ZeniAccountStatementScreen-DmzWGfwC.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./useAskAiCfoHostNavButtonProps-CLV01Vra.js";import"./useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.js";import"./TransactionDetailScreen-BS1m1uHz.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="735fe802-f4e0-47e5-a5b9-8007b390fe1c",a._sentryDebugIdIdentifier="sentry-dbid-735fe802-f4e0-47e5-a5b9-8007b390fe1c")}catch{}})();const Oe=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],_=a=>Le(a),je=Q(function(a,e){const t=he(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,_(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:Z(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=X.getLocalizedStrings(),s=_(e.selectedAccount.tranListType),r=Be(t,n,c,s,e.bookCloseDate);C.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(se({uiState:{dateRange:r},type:_(e.selectedAccount.tranListType)})),a(ue(s,T(r),!1,s==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(T(r))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(se({uiState:{scrollYOffset:t},type:_(e.selectedAccount.tranListType)}))}}})(ee),G=ae(function({...a}){const e=J(),t=R(),n=U(),c=t.pathname.split("/").find(d=>Oe.includes(d)),o=c??"uncategorized-expense",{tenantEmailDomain:s}=H(),r=X.getLocalizedStrings(),{accountType:p,title:A,subTitle:h}=Ce(o),S="month",k=z(d=>$(d)),D=k.company?.companyInfo.firstMonthOfFY??1,{dataAvailable:g,initialTimeframeTick:v}=Me(o,D,k.bookCloseDate),[E,M]=y.useState(!1),[x,B]=y.useState(void 0),l=y.useMemo(()=>{const d=T(v);return{tranListType:o,accountType:K(p),title:A,subTitle:h,timeframe:S,period:d}},[o,S,p,g]);y.useEffect(()=>{if(!E&&l!=null){M(!0),C.trackTransactionList(void 0,void 0,void 0,l.title);const d=_(l.tranListType);n(ue(d,l.period,!0,d==="missingReceipts"?r.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[E,l,n]);let P=l;return l!=null&&x!=null&&(P={...l,period:x}),c==null||P==null?i.jsx(j,{to:"../"}):i.jsx(je,{firstMonthOfFY:D,tenantEmailDomain:s,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:g,navigate:e,selectedAccount:P,referrerType:o,bookCloseDate:k.bookCloseDate,onSelectedTimePeriodChange:d=>B(d),...a})}),Ce=a=>{let e="",t="",n="";const c=X.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=c.uncategorizedTransactionList.income.title,n=c.uncategorizedTransactionList.income.subTitle;break;case"uncategorized-expense":e="expenses",t=c.uncategorizedTransactionList.expense.title,n=c.uncategorizedTransactionList.expense.subTitle;break;case"miscategorized-expense":e="expenses",t=c.miscategorizedTransactionList.expense.title,n=c.miscategorizedTransactionList.expense.subTitle;break;case"miscategorized-income":e="income",t=c.miscategorizedTransactionList.income.title,n=c.miscategorizedTransactionList.income.subTitle;break;case"missing-receipts":t=c.uncategorizedTransactionList.missingReceipt.title,n=c.uncategorizedTransactionList.missingReceipt.subTitle}return{accountType:e,title:t,subTitle:n}},Me=(a,e,t)=>{const n=ie();let c=ie().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ne(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Be=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Fe=Q(function(a,e){const t=ke(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:Z(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Te();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),C.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(me(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ee),Ge=ae(function({referrerType:a,...e}){const t=J(),n=R(),c=U(),{tenantEmailDomain:o,accountTypeEncoded:s,accountIdEncoded:r,classIdEncoded:p,timeframe:A,startDate:h,endDate:S,titleEncoded:k}=H(),D=L(s??""),g=L(r??""),v=L(p??""),E=L(k??""),M=z(f=>Se(f.transactionListState,g,D,v)),[x,B]=y.useState(!1),[l,P]=y.useState(void 0),d=z(f=>$(f)),V=d.company?.companyInfo.firstMonthOfFY??1;let u;const m=_e(D,g,v,A,h,S,E);if(m){const f={startDate:Y(h,"YYYY-MM-DD"),endDate:Y(S,"YYYY-MM-DD")},N=we(M?.dateRange,f);u={accountId:g,accountType:K(D),classId:v,title:E,timeframe:A,period:N}}y.useEffect(()=>{x||u==null||(B(!0),C.trackTransactionList(u.accountId,void 0,a,u.title),c(me(u.accountId,u.accountType,u.classId,u.period)))},[x,u,c]);let O=u;u!=null&&l!=null&&(O={...u,period:l});const F=[s,r,p,A,h,S,k].filter(f=>f!=null);return m&&O!=null?i.jsx(Fe,{firstMonthOfFY:V,tenantEmailDomain:o,location:n,navigate:t,selectedAccount:O,referrerType:a,onSelectedTimePeriodChange:f=>P(f),...e}):i.jsx(j,{to:Te(F.length)})}),Te=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},_e=(a,e,t,n,c,o,s)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&s!=null,we=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),Re=Q(function(a,e){const t=Ie(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ve(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:Z(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??De();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),C.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(pe(e.selectedAccount.accountId,e.selectedAccount.accountType,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=Ne(e.tenantEmailDomain),n=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ee),le=ae(function({referrerType:a,...e}){const t=J(),n=R(),c=U(),{tenantEmailDomain:o,accountTypeEncoded:s,accountIdEncoded:r,timeframe:p,startDate:A,endDate:h,titleEncoded:S,excludeSubAccounts:k}=H(),D=L(s??""),g=L(r??""),v=L(S??""),E=!(k!=null&&k==="exclude_subaccounts"),M=z(b=>be(b.transactionListState,g,D)),[x,B]=y.useState(!1),[l,P]=y.useState(void 0),d=z(b=>$(b)),V=d.company?.featuresActivationInfo.connectedAccountProvider==="unit",u=d.company?.companyInfo.firstMonthOfFY??1;let m;const O=$e(D,g,p,A,h,v);if(O){const b={startDate:Y(A,"YYYY-MM-DD"),endDate:Y(h,"YYYY-MM-DD")},ye=Ve(M?.dateRange,b);m={accountId:g,accountType:K(D),title:v,timeframe:p,period:ye}}let F=m;m!=null&&l!=null&&(F={...m,period:l});const{useFeatureGate:f}=fe(),{isFeatureEnabled:N}=f(q.isTransactionCommentingEnabled),{areTenantIdsInSync:oe}=Ee();y.useEffect(()=>{!x&&m!=null&&oe&&(B(!0),C.trackTransactionList(m.accountId,void 0,a,m.title),c(pe(m.accountId,m.accountType,m.period,void 0,!1,E)))},[x,m,c,oe]);const ge=[s,r,p,A,h,S].filter(b=>b!=null);return O&&F!=null?i.jsx(Re,{firstMonthOfFY:u,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:V,isTransactionCommentingEnabled:N,selectedAccount:F,referrerType:a,onSelectedTimePeriodChange:b=>P(b),...e}):i.jsx(j,{to:De(ge.length)})}),De=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},$e=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,Ve=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),Ne=a=>`/${a}/transactions/${xe}/statements`;function pt(){const a=R().state?.referrer,e=Pe.getSignedInUser(),t=Ye(e),{useFeatureGate:n}=fe(),{isFeatureEnabled:c}=n(q.isExpenseAutomationEnabled),o=z(p=>p.expenseAutomationViewState.selectedPeriodByTenantId)[z(p=>$(p)).tenantId],{isFeatureEnabled:s}=n(q.isExpenseAutomationEnabledV2),r=s||c&&t;return i.jsxs(Ae,{children:[i.jsx(I,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:i.jsx(le,{referrerType:a})}),i.jsx(I,{path:"/zeni-clearing-account/statements",element:i.jsx(ze,{})}),i.jsx(I,{path:"/*",element:i.jsx(le,{referrerType:a})}),i.jsx(I,{path:"/uncategorized-income/*",element:i.jsx(G,{})}),i.jsx(I,{path:"/uncategorized-expense/*",element:r?i.jsx(j,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(G,{})}),i.jsx(I,{path:"/miscategorized-income/*",element:i.jsx(G,{})}),i.jsx(I,{path:"/miscategorized-expense/*",element:r?i.jsx(j,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(G,{})}),i.jsx(I,{path:"/missing-receipts/*",element:r?i.jsx(j,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):i.jsx(G,{})}),i.jsx(I,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:i.jsx(Ge,{referrerType:a})})]})}export{pt as default};
1
+ import{j as i}from"./liveblocks-BqO7Df-p.js";import{j as J,u as R,h as U,l as H,g as z,N as O,k as Q,n as Ae,o as I}from"./core-DxYppZiZ.js";import{eO as $,iQ as T,O9 as K,GF as ue,bq as ie,Oa as he,jr as Z,Kd as W,Ob as se,Oc as Se,bD as Y,GC as me,Od as ke,Oe as re,Of as be,Og as pe,Oh as Ie,Oi as ve,Oj as de,HS as xe,bn as Ye}from"./zeni-epic-state-CXLj5Oko.js";import{D as X,c as C,c7 as ee,s as w,p as te,C as fe,$ as q,U as Ee,z as Pe}from"./index-DPw038da.js";import"./mui-DdrzQvkp.js";import{a as y}from"./sentry-DS2EspaF.js";import{w as ae}from"./withTransactionSidePanel-jaVwinxd.js";import{p as ne,b as ce}from"./routePaths-CgcmkaKJ.js";import{u as Le}from"./utils-B6prU8As.js";import{d as L}from"./decodeURIComponentSafe-B26owMY4.js";import{Z as ze}from"./ZeniAccountStatementScreen-BbT_F5EY.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import"./TransactionDetailScreen-nBKG_H4f.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="d45aa02a-2588-4cdd-b7b6-c3b0fd33948c",a._sentryDebugIdIdentifier="sentry-dbid-d45aa02a-2588-4cdd-b7b6-c3b0fd33948c")}catch{}})();const je=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],_=a=>Le(a),Oe=Q(function(a,e){const t=he(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,_(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:Z(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=X.getLocalizedStrings(),s=_(e.selectedAccount.tranListType),r=Be(t,n,c,s,e.bookCloseDate);C.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(se({uiState:{dateRange:r},type:_(e.selectedAccount.tranListType)})),a(ue(s,T(r),!1,s==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(T(r))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(se({uiState:{scrollYOffset:t},type:_(e.selectedAccount.tranListType)}))}}})(ee),G=ae(function({...a}){const e=J(),t=R(),n=U(),c=t.pathname.split("/").find(d=>je.includes(d)),o=c??"uncategorized-expense",{tenantEmailDomain:s}=H(),r=X.getLocalizedStrings(),{accountType:p,title:A,subTitle:h}=Ce(o),S="month",k=z(d=>$(d)),D=k.company?.companyInfo.firstMonthOfFY??1,{dataAvailable:g,initialTimeframeTick:v}=Me(o,D,k.bookCloseDate),[E,M]=y.useState(!1),[x,B]=y.useState(void 0),l=y.useMemo(()=>{const d=T(v);return{tranListType:o,accountType:K(p),title:A,subTitle:h,timeframe:S,period:d}},[o,S,p,g]);y.useEffect(()=>{if(!E&&l!=null){M(!0),C.trackTransactionList(void 0,void 0,void 0,l.title);const d=_(l.tranListType);n(ue(d,l.period,!0,d==="missingReceipts"?r.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[E,l,n]);let P=l;return l!=null&&x!=null&&(P={...l,period:x}),c==null||P==null?i.jsx(O,{to:"../"}):i.jsx(Oe,{firstMonthOfFY:D,tenantEmailDomain:s,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:g,navigate:e,selectedAccount:P,referrerType:o,bookCloseDate:k.bookCloseDate,onSelectedTimePeriodChange:d=>B(d),...a})}),Ce=a=>{let e="",t="",n="";const c=X.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=c.uncategorizedTransactionList.income.title,n=c.uncategorizedTransactionList.income.subTitle;break;case"uncategorized-expense":e="expenses",t=c.uncategorizedTransactionList.expense.title,n=c.uncategorizedTransactionList.expense.subTitle;break;case"miscategorized-expense":e="expenses",t=c.miscategorizedTransactionList.expense.title,n=c.miscategorizedTransactionList.expense.subTitle;break;case"miscategorized-income":e="income",t=c.miscategorizedTransactionList.income.title,n=c.miscategorizedTransactionList.income.subTitle;break;case"missing-receipts":t=c.uncategorizedTransactionList.missingReceipt.title,n=c.uncategorizedTransactionList.missingReceipt.subTitle}return{accountType:e,title:t,subTitle:n}},Me=(a,e,t)=>{const n=ie();let c=ie().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ne(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Be=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Fe=Q(function(a,e){const t=ke(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:Z(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Te();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),C.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(me(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ee),Ge=ae(function({referrerType:a,...e}){const t=J(),n=R(),c=U(),{tenantEmailDomain:o,accountTypeEncoded:s,accountIdEncoded:r,classIdEncoded:p,timeframe:A,startDate:h,endDate:S,titleEncoded:k}=H(),D=L(s??""),g=L(r??""),v=L(p??""),E=L(k??""),M=z(f=>Se(f.transactionListState,g,D,v)),[x,B]=y.useState(!1),[l,P]=y.useState(void 0),d=z(f=>$(f)),V=d.company?.companyInfo.firstMonthOfFY??1;let u;const m=_e(D,g,v,A,h,S,E);if(m){const f={startDate:Y(h,"YYYY-MM-DD"),endDate:Y(S,"YYYY-MM-DD")},N=we(M?.dateRange,f);u={accountId:g,accountType:K(D),classId:v,title:E,timeframe:A,period:N}}y.useEffect(()=>{x||u==null||(B(!0),C.trackTransactionList(u.accountId,void 0,a,u.title),c(me(u.accountId,u.accountType,u.classId,u.period)))},[x,u,c]);let j=u;u!=null&&l!=null&&(j={...u,period:l});const F=[s,r,p,A,h,S,k].filter(f=>f!=null);return m&&j!=null?i.jsx(Fe,{firstMonthOfFY:V,tenantEmailDomain:o,location:n,navigate:t,selectedAccount:j,referrerType:a,onSelectedTimePeriodChange:f=>P(f),...e}):i.jsx(O,{to:Te(F.length)})}),Te=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},_e=(a,e,t,n,c,o,s)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&s!=null,we=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),Re=Q(function(a,e){const t=Ie(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ve(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:Z(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??De();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),C.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(pe(e.selectedAccount.accountId,e.selectedAccount.accountType,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=Ne(e.tenantEmailDomain),n=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ee),le=ae(function({referrerType:a,...e}){const t=J(),n=R(),c=U(),{tenantEmailDomain:o,accountTypeEncoded:s,accountIdEncoded:r,timeframe:p,startDate:A,endDate:h,titleEncoded:S,excludeSubAccounts:k}=H(),D=L(s??""),g=L(r??""),v=L(S??""),E=!(k!=null&&k==="exclude_subaccounts"),M=z(b=>be(b.transactionListState,g,D)),[x,B]=y.useState(!1),[l,P]=y.useState(void 0),d=z(b=>$(b)),V=d.company?.featuresActivationInfo.connectedAccountProvider==="unit",u=d.company?.companyInfo.firstMonthOfFY??1;let m;const j=$e(D,g,p,A,h,v);if(j){const b={startDate:Y(A,"YYYY-MM-DD"),endDate:Y(h,"YYYY-MM-DD")},ye=Ve(M?.dateRange,b);m={accountId:g,accountType:K(D),title:v,timeframe:p,period:ye}}let F=m;m!=null&&l!=null&&(F={...m,period:l});const{useFeatureGate:f}=fe(),{isFeatureEnabled:N}=f(q.isTransactionCommentingEnabled),{areTenantIdsInSync:oe}=Ee();y.useEffect(()=>{!x&&m!=null&&oe&&(B(!0),C.trackTransactionList(m.accountId,void 0,a,m.title),c(pe(m.accountId,m.accountType,m.period,void 0,!1,E)))},[x,m,c,oe]);const ge=[s,r,p,A,h,S].filter(b=>b!=null);return j&&F!=null?i.jsx(Re,{firstMonthOfFY:u,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:V,isTransactionCommentingEnabled:N,selectedAccount:F,referrerType:a,onSelectedTimePeriodChange:b=>P(b),...e}):i.jsx(O,{to:De(ge.length)})}),De=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},$e=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,Ve=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),Ne=a=>`/${a}/transactions/${xe}/statements`;function pt(){const a=R().state?.referrer,e=Pe.getSignedInUser(),t=Ye(e),{useFeatureGate:n}=fe(),{isFeatureEnabled:c}=n(q.isExpenseAutomationEnabled),o=z(p=>p.expenseAutomationViewState.selectedPeriodByTenantId)[z(p=>$(p)).tenantId],{isFeatureEnabled:s}=n(q.isExpenseAutomationEnabledV2),r=s||c&&t;return i.jsxs(Ae,{children:[i.jsx(I,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:i.jsx(le,{referrerType:a})}),i.jsx(I,{path:"/zeni-clearing-account/statements",element:i.jsx(ze,{})}),i.jsx(I,{path:"/*",element:i.jsx(le,{referrerType:a})}),i.jsx(I,{path:"/uncategorized-income/*",element:i.jsx(G,{})}),i.jsx(I,{path:"/uncategorized-expense/*",element:r?i.jsx(O,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(G,{})}),i.jsx(I,{path:"/miscategorized-income/*",element:i.jsx(G,{})}),i.jsx(I,{path:"/miscategorized-expense/*",element:r?i.jsx(O,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(G,{})}),i.jsx(I,{path:"/missing-receipts/*",element:r?i.jsx(O,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):i.jsx(G,{})}),i.jsx(I,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:i.jsx(Ge,{referrerType:a})})]})}export{pt as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-C3aHR2ug.js";import{j as L,u as B,h as M,l as O,g as f,N as U,k as V,n as xe,o as k}from"./core-j0LqCeu3.js";import{cl as N,eO as D,MX as P,D7 as ae,fc as Z,CR as ne,MZ as we,Da as Te,MV as Ie,MW as se,Nb as Ce,Bh as ke,s6 as je,M$ as be,Dl as Ae,MY as re,cO as H,wc as oe,eS as Ee,eU as ve,O6 as De,O7 as Fe,CS as Ue,O8 as Le,CT as Be,D0 as Me,bv as Pe,bE as Re,cw as Oe,bF as Ve,ck as Ne,fb as _e,bs as $e,IC as ze,cj as Ge}from"./zeni-epic-state-DiQZjsue.js";import{I as _,an as We,z as A,x as $,c as j,c0 as Ze,c1 as He,c2 as W,Z as q,m as qe,O as Je,C as ie,$ as v,A as Ke,B as Qe,c3 as Xe,aq as J,s as Ye,c4 as et,p as K,c5 as tt,k as X,c6 as at,a6 as nt}from"./index-CFtYCyfm.js";import{D as st,n as R,S as rt}from"./mui-D78cc8iD.js";import ot from"./NotFoundScreen-BeCKiN3K.js";import{S as Y}from"./SetupPagesScreen-Cescu0d2.js";import{a as d}from"./sentry-cQZrhfVh.js";import{u as it}from"./useAskAiCfoHostNavButtonProps-CLV01Vra.js";import{c as ct}from"./useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.js";import{M as ce}from"./MobileAppDrawer-DeylJyoS.js";import{F as lt}from"./FeaturePreviewScreen-BD0F_lti.js";import{a as ee}from"./analyticsHelper-DUWn4fSe.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.js";import"./routePaths-D7CLql-E.js";import"./BusinessVerificationPageScreen-DxAzWOOG.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="d9194380-fba8-4a9e-a568-f077f08f62fd",t._sentryDebugIdIdentifier="sentry-dbid-d9194380-fba8-4a9e-a568-f077f08f62fd")}catch{}})();const ut=V(function(t,a){const{companyId:n}=a;return{treasurySetupView:P(t,n),analytics:j}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(Te(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}})(Ze);function dt(){const t=L(),a=B(),n=M(),{tenantEmailDomain:o}=O(),p=_(),r=f(C=>C.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=We(r),s=N(p?.loggedInUserRoleMap),[c,i]=d.useState(!1),[y,I]=d.useState(!1),[u,l]=d.useState(!1),g=f(C=>D(C)),h=A.getSignedInUserTenant(o)?.companyId??g.companyId,w=A.getSignedInUser(),S=f(C=>P(C,h)),T=f(C=>C.treasurySetupViewState.fetchState),x=f(C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(w==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{c||T!=="Not-Started"||h==null||(i(!0),n(ae(h,!0,!1)))},[c,T,h,n]),d.useEffect(()=>{u||F!=="Not-Started"||h==null||(l(!0),n(Z()))},[u,F,h,n]),d.useEffect(()=>{y||x!=="Not-Started"||h==null||(I(!0),n(ne()))},[y,x,h,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(U,{to:"../promo"});const E=g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||T!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx($,{analytics:j,onLoad:()=>{}}),e.jsx(ut,{navigate:t,location:a,companyId:h,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const pt=V(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:Ce(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:P(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{W(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{W(a.analytics,"confirm",r,m,"Transfer"),t(Ae())},onSaveChangesToLocalStore:s=>{t(be(s))},onFetchLinkTokenClick:s=>{t(je("treasury_setup",s))},onEstablishConnectionClick:s=>{t(ke(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(He),mt=({isFirstTransfer:t})=>{const a=L(),{tenantEmailDomain:n}=O(),o=M(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[c,i]=d.useState(!1),[y,I]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),l=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),g=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),h=f(x=>D(x)),w=A.getSignedInUserTenant(n)?.companyId??h.companyId,S=f(x=>Ie(x)),T=f(x=>P(x,w));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||w==null||(s(!0),o(ae(w,!0,!1)))},[m,u,w,o]),d.useEffect(()=>{c||l!=="Not-Started"||w==null||(i(!0),o(Z()))},[c,l,w,o]),d.useEffect(()=>{y||g!=="Not-Started"||w==null||(I(!0),o(ne()))},[y,g,w,o]),e.jsxs(e.Fragment,{children:[e.jsx($,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{analytics:j,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:h,treasurySetupView:T,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{W(j,"review",S.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},ft=R.div`
1
+ import{j as e}from"./liveblocks-BqO7Df-p.js";import{j as L,u as B,h as M,l as O,g as f,N as U,k as V,n as xe,o as k}from"./core-DxYppZiZ.js";import{cl as N,eO as D,MX as P,D7 as ae,fc as Z,CR as ne,MZ as we,Da as Te,MV as Ie,MW as se,Nb as Ce,Bh as ke,s6 as je,M$ as be,Dl as Ae,MY as re,cO as H,wc as oe,eS as Ee,eU as ve,O6 as De,O7 as Fe,CS as Ue,O8 as Le,CT as Be,D0 as Me,bv as Pe,bE as Re,cw as Oe,bF as Ve,ck as Ne,fb as _e,bs as $e,IC as ze,cj as Ge}from"./zeni-epic-state-CXLj5Oko.js";import{I as _,an as We,z as A,x as $,c as j,c0 as Ze,c1 as He,c2 as W,Z as q,m as qe,U as Je,C as ie,$ as v,A as Ke,B as Qe,c3 as Xe,aq as J,s as Ye,c4 as et,p as K,c5 as tt,k as X,c6 as at,a6 as nt}from"./index-DPw038da.js";import{D as st,n as R,S as rt}from"./mui-DdrzQvkp.js";import ot from"./NotFoundScreen-Bn00COMT.js";import{S as Y}from"./SetupPagesScreen-CIwH3ZZF.js";import{a as d}from"./sentry-DS2EspaF.js";import{u as it}from"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import{c as ct}from"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import{M as ce}from"./MobileAppDrawer-DlNmDt_G.js";import{F as lt}from"./FeaturePreviewScreen-Ck2p6Gja.js";import{a as ee}from"./analyticsHelper-tcwBG-lH.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";import"./routePaths-CgcmkaKJ.js";import"./BusinessVerificationPageScreen-Cc1IIWeU.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="c022ab64-e714-48e1-8d40-c3d57ae344a8",t._sentryDebugIdIdentifier="sentry-dbid-c022ab64-e714-48e1-8d40-c3d57ae344a8")}catch{}})();const ut=V(function(t,a){const{companyId:n}=a;return{treasurySetupView:P(t,n),analytics:j}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(Te(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}})(Ze);function dt(){const t=L(),a=B(),n=M(),{tenantEmailDomain:o}=O(),p=_(),r=f(C=>C.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=We(r),s=N(p?.loggedInUserRoleMap),[c,i]=d.useState(!1),[y,I]=d.useState(!1),[u,l]=d.useState(!1),g=f(C=>D(C)),h=A.getSignedInUserTenant(o)?.companyId??g.companyId,w=A.getSignedInUser(),S=f(C=>P(C,h)),T=f(C=>C.treasurySetupViewState.fetchState),x=f(C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(w==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{c||T!=="Not-Started"||h==null||(i(!0),n(ae(h,!0,!1)))},[c,T,h,n]),d.useEffect(()=>{u||F!=="Not-Started"||h==null||(l(!0),n(Z()))},[u,F,h,n]),d.useEffect(()=>{y||x!=="Not-Started"||h==null||(I(!0),n(ne()))},[y,x,h,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(U,{to:"../promo"});const E=g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||T!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx($,{analytics:j,onLoad:()=>{}}),e.jsx(ut,{navigate:t,location:a,companyId:h,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const pt=V(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:Ce(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:P(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{W(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{W(a.analytics,"confirm",r,m,"Transfer"),t(Ae())},onSaveChangesToLocalStore:s=>{t(be(s))},onFetchLinkTokenClick:s=>{t(je("treasury_setup",s))},onEstablishConnectionClick:s=>{t(ke(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(He),mt=({isFirstTransfer:t})=>{const a=L(),{tenantEmailDomain:n}=O(),o=M(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[c,i]=d.useState(!1),[y,I]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),l=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),g=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),h=f(x=>D(x)),w=A.getSignedInUserTenant(n)?.companyId??h.companyId,S=f(x=>Ie(x)),T=f(x=>P(x,w));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||w==null||(s(!0),o(ae(w,!0,!1)))},[m,u,w,o]),d.useEffect(()=>{c||l!=="Not-Started"||w==null||(i(!0),o(Z()))},[c,l,w,o]),d.useEffect(()=>{y||g!=="Not-Started"||w==null||(I(!0),o(ne()))},[y,g,w,o]),e.jsxs(e.Fragment,{children:[e.jsx($,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{analytics:j,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:h,treasurySetupView:T,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{W(j,"review",S.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},ft=R.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-C3aHR2ug.js";import{a as g}from"./sentry-cQZrhfVh.js";import{j as M,u as Y,l as J,g as S,k as K,h as z,n as at,o as B,N as G}from"./core-j0LqCeu3.js";import{eO as L,JD as Ee,JE as Re,fP as X,cr as be,cs as Ie,uN as St,JF as nt,uR as zt,HJ as ee,jr as te,uL as Yt,uF as qt,JG as Ue,ux as Ht,uw as Wt,uq as Qt,uC as Zt,uS as Xt,JH as he,JI as Ne,uy as ea,JJ as pe,eZ as ft,v5 as gt,u_ as vt,JK as xt,nU as Tt,uV as yt,uT as Dt,JL as Ct,vc as Et,v9 as bt,uW as It,vb as Me,G9 as kt,JM as ta,JN as aa,cu as na,JO as sa,JP as oa,JQ as me,JR as ie,JS as ke,HK as Ke,vr as ye,HI as De,ve as wt,uO as Ge,JT as la,HL as H,JU as $e,uI as ia,JV as ca,JW as da,JX as ze,JY as Ye,JZ as qe,J_ as He,vl as we,J$ as At,v2 as jt,K0 as ra,K1 as ua,K2 as ha,K3 as pa,K4 as ma,K5 as Sa,K6 as fa,K7 as ga,si as va,sj as xa,GP as je,K8 as Ta,K9 as ya,iQ as Fe,bq as Da,Ka as Ca,Kb as Ea,kp as ba,ky as Ia,GO as Pe,bD as st,Kc as Ft,Gu as Pt,Kd as ka,Ke as wa,Kf as Aa,kA as ja,Kg as ot,Kh as lt,Ki as it,Kj as ct,Kk as Fa,kw as Pa,Kl as _a,kz as Va,Km as La,Kn as _t,H9 as Vt,jP as Ba,Ko as Oa,Kp as _e,Kq as Lt,H7 as Bt,xE as Ja,Kr as Ra,Ks as Ua,k7 as Ot,Kt as Na,Ku as Ma,Hl as Ka,p_ as Ga,Kv as Jt,Kw as dt,Hi as Ve,Kx as rt,Ky as $a,Hn as za,Kz as Ya,KA as qa,KB as Ha,KC as Wa,KD as Qa,q1 as Za,KE as Xa,HM as en,KF as tn,H0 as Le,gy as an,KG as nn,KH as sn,gw as on,KI as ln,KJ as cn,xI as dn,KK as rn,KL as un,KM as hn,KN as pn,jT as mn,bn as Sn,eU as fn,eS as gn}from"./zeni-epic-state-DiQZjsue.js";import{z as R,an as Be,B as Rt,x as Q,c as j,U as Z,at as vn,s as N,D as Ce,H as ce,au as We,av as xn,aw as Tn,p as Qe,ax as yn,m as Dn,Z as de,A as Ze,C as ae,$,ay as Cn,i as Xe,az as En,aA as Ut,O as bn,aB as In,I as kn,aC as wn,aq as Nt,aD as An,d as W,S as jn,F as Mt,J as Fn,aE as Pn,aF as _n,f as et,aG as Vn,aH as Ln,E as Bn,aI as On,aJ as Jn}from"./index-CFtYCyfm.js";import{n as U,D as Rn,S as Kt}from"./mui-D78cc8iD.js";import{t as Un,A as Nn}from"./AddressScreen-BAjnEp-X.js";import le from"./NotFoundScreen-BeCKiN3K.js";import{F as Mn}from"./FeaturePreviewScreen-BD0F_lti.js";import{b as q,v as tt,c as Kn}from"./routePaths-D7CLql-E.js";import{p as Gt}from"./pathToGoBack-Dzva26FJ.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CLV01Vra.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.js";import{M as ge}from"./MobileAppDrawer-DeylJyoS.js";import{D as Gn}from"./DrawerScreen-I-2xB5eA.js";import{g as $n,m as zn}from"./accountMappingHelper-BHhQdza1.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="b6bbd894-d11e-4386-a9ed-c813a8e650f4",e._sentryDebugIdIdentifier="sentry-dbid-b6bbd894-d11e-4386-a9ed-c813a8e650f4")}catch{}})();const Yn=Ce.getLocalizedStrings(),qn=K(function(e,a){const s=Re(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}},function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(nt({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(nt({selectedTransaction:void 0})),e(zt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,c=N(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(vn),Hn=({setShouldNavigateBack:e})=>{const a=M(),s=Y(),{scheduleDetailId:t,tenantEmailDomain:n}=J(),{scheduleType:o}=J();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>L(f)),r=Ee(o)??"accrued_expenses",h=R.getSignedInUser();if(h==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S(f=>Re(f,r)),m=i.selectedJELinkRowIndex,d=S(f=>X(f,c.companyId)),u=Be(i.updateStatus.fetchState);g.useEffect(()=>{u==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[u,i.updateStatus.fetchState]),g.useEffect(()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]),g.useEffect(()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})},[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const p=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Rt,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[p===!0?l.jsx(Q,{analytics:j,onLoad:()=>{Wn(i,r,d)}}):null,l.jsx(qn,{signedInUser:h,attachmentEndPoint:`${Z}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:r,navigate:a,analytics:j,controllerUserDetails:d,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},$t=e=>{const a=Yn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Wn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,r=c.some(m=>m.isRecommendedTransaction===!0),h=be(s.controllers),i=Ie(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...$t(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:r,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:h,controllerUserIds:i})},Qn=U.div`
1
+ import{j as l}from"./liveblocks-BqO7Df-p.js";import{a as g}from"./sentry-DS2EspaF.js";import{j as M,u as Y,l as J,g as S,k as K,h as z,n as at,o as B,N as G}from"./core-DxYppZiZ.js";import{eO as L,JD as Ee,JE as Re,fP as X,cr as be,cs as Ie,uN as St,JF as nt,uR as zt,HJ as ee,jr as te,uL as Yt,uF as qt,JG as Ue,ux as Ht,uw as Wt,uq as Qt,uC as Zt,uS as Xt,JH as he,JI as Ne,uy as ea,JJ as pe,eZ as ft,v5 as gt,u_ as vt,JK as xt,nU as Tt,uV as yt,uT as Dt,JL as Ct,vc as Et,v9 as bt,uW as It,vb as Me,G9 as kt,JM as ta,JN as aa,cu as na,JO as sa,JP as oa,JQ as me,JR as ie,JS as ke,HK as Ke,vr as ye,HI as De,ve as wt,uO as Ge,JT as la,HL as H,JU as $e,uI as ia,JV as ca,JW as da,JX as ze,JY as Ye,JZ as qe,J_ as He,vl as we,J$ as At,v2 as jt,K0 as ra,K1 as ua,K2 as ha,K3 as pa,K4 as ma,K5 as Sa,K6 as fa,K7 as ga,si as va,sj as xa,GP as je,K8 as Ta,K9 as ya,iQ as Fe,bq as Da,Ka as Ca,Kb as Ea,kp as ba,ky as Ia,GO as Pe,bD as st,Kc as Ft,Gu as Pt,Kd as ka,Ke as wa,Kf as Aa,kA as ja,Kg as ot,Kh as lt,Ki as it,Kj as ct,Kk as Fa,kw as Pa,Kl as _a,kz as Va,Km as La,Kn as _t,H9 as Vt,jP as Ba,Ko as Oa,Kp as _e,Kq as Lt,H7 as Bt,xE as Ja,Kr as Ra,Ks as Ua,k7 as Ot,Kt as Na,Ku as Ma,Hl as Ka,p_ as Ga,Kv as Jt,Kw as dt,Hi as Ve,Kx as rt,Ky as $a,Hn as za,Kz as Ya,KA as qa,KB as Ha,KC as Wa,KD as Qa,q1 as Za,KE as Xa,HM as en,KF as tn,H0 as Le,gy as an,KG as nn,KH as sn,gw as on,KI as ln,KJ as cn,xI as dn,KK as rn,KL as un,KM as hn,KN as pn,jT as mn,bn as Sn,eU as fn,eS as gn}from"./zeni-epic-state-CXLj5Oko.js";import{z as R,an as Be,B as Rt,x as Q,c as j,X as Z,at as vn,s as N,D as Ce,H as ce,au as We,av as xn,aw as Tn,p as Qe,ax as yn,m as Dn,Z as de,A as Ze,C as ae,$,ay as Cn,i as Xe,az as En,aA as Ut,U as bn,aB as In,I as kn,aC as wn,aq as Nt,aD as An,d as W,S as jn,F as Mt,J as Fn,aE as Pn,aF as _n,f as et,aG as Vn,aH as Ln,E as Bn,aI as On,aJ as Jn}from"./index-DPw038da.js";import{n as U,D as Rn,S as Kt}from"./mui-DdrzQvkp.js";import{t as Un,A as Nn}from"./AddressScreen-Cdrj5W4-.js";import le from"./NotFoundScreen-Bn00COMT.js";import{F as Mn}from"./FeaturePreviewScreen-Ck2p6Gja.js";import{b as q,v as tt,c as Kn}from"./routePaths-CgcmkaKJ.js";import{p as Gt}from"./pathToGoBack-D8OnmrBJ.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import{M as ge}from"./MobileAppDrawer-DlNmDt_G.js";import{D as Gn}from"./DrawerScreen-CNcA0NWW.js";import{g as $n,m as zn}from"./accountMappingHelper-l5KQkq0O.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="a5975762-b9be-4919-9704-948690eaf0e1",e._sentryDebugIdIdentifier="sentry-dbid-a5975762-b9be-4919-9704-948690eaf0e1")}catch{}})();const Yn=Ce.getLocalizedStrings(),qn=K(function(e,a){const s=Re(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}},function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(nt({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(nt({selectedTransaction:void 0})),e(zt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,c=N(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(vn),Hn=({setShouldNavigateBack:e})=>{const a=M(),s=Y(),{scheduleDetailId:t,tenantEmailDomain:n}=J(),{scheduleType:o}=J();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>L(f)),r=Ee(o)??"accrued_expenses",h=R.getSignedInUser();if(h==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S(f=>Re(f,r)),m=i.selectedJELinkRowIndex,d=S(f=>X(f,c.companyId)),u=Be(i.updateStatus.fetchState);g.useEffect(()=>{u==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[u,i.updateStatus.fetchState]),g.useEffect(()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]),g.useEffect(()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})},[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const p=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Rt,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[p===!0?l.jsx(Q,{analytics:j,onLoad:()=>{Wn(i,r,d)}}):null,l.jsx(qn,{signedInUser:h,attachmentEndPoint:`${Z}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:r,navigate:a,analytics:j,controllerUserDetails:d,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},$t=e=>{const a=Yn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Wn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,r=c.some(m=>m.isRecommendedTransaction===!0),h=be(s.controllers),i=Ie(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...$t(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:r,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:h,controllerUserIds:i})},Qn=U.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -0,0 +1,12 @@
1
+ import{j as o}from"./liveblocks-BqO7Df-p.js";import{a as c}from"./sentry-DS2EspaF.js";import{q as u,h,g as y,N as I}from"./core-DxYppZiZ.js";import{IV as b,eP as w,yZ as x}from"./zeni-epic-state-CXLj5Oko.js";import{z as l,B as j,F as S,J as D}from"./index-DPw038da.js";import{n as f}from"./mui-DdrzQvkp.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.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]="0c9e5d42-5dc9-47c4-82c9-329d772a109b",e._sentryDebugIdIdentifier="sentry-dbid-0c9e5d42-5dc9-47c4-82c9-329d772a109b")}catch{}})();const V=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",g=e.get("profileId")??"",[n,p]=c.useState(!1),a=h(),i=y(m=>b(m)),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(I,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),c.useEffect(()=>{n||(p(!0),a(x(t,g,s)))},[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(j,{fetchState:"In-Progress"}))},E=f.div`
2
+ display: flex;
3
+ width: 100%;
4
+ height: 100vh;
5
+ flex-direction: row;
6
+ justify-content: center;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey5};
9
+ `,_=f(D.LargeRegular)`
10
+ display: flex;
11
+ color: ${S.important};
12
+ `;export{V as default};