@zeniai/web-app-ui 5.3.31-prod → 5.3.32-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist/assets/AccountMappingScreen-Dst-9gUw.js +9 -0
  2. package/dist/assets/AddressRoutes-O-cTW9EV.js +1 -0
  3. package/dist/assets/{AddressScreen-lw7TKwyq.js → AddressScreen-LFBV9KsX.js} +2 -2
  4. package/dist/assets/{AiCfoScreen-DCL1Hzq-.js → AiCfoScreen-N1tWqaxl.js} +1 -1
  5. package/dist/assets/{AppDrawer-BIgFOgvw.js → AppDrawer-DmTC2F7R.js} +3 -3
  6. package/dist/assets/{BillPayApprovalRoutes-CXiRj9PG.js → BillPayApprovalRoutes-sbvXc3_Z.js} +1 -1
  7. package/dist/assets/{BillPayRoutes-DOVyvcf4.js → BillPayRoutes-Cf4T_cOn.js} +18 -18
  8. package/dist/assets/BusinessVerificationPageScreen--LjYD0BK.js +9 -0
  9. package/dist/assets/{CardsAiCfoScreen-yIiz5h6K.js → CardsAiCfoScreen-p_ZDfSVk.js} +2 -2
  10. package/dist/assets/{ChargeCardRoutes-DiWZ-ZiS.js → ChargeCardRoutes-DWtJK7tn.js} +7 -7
  11. package/dist/assets/CompanyPassportScreen-Cr55ZhHa.js +1 -0
  12. package/dist/assets/ConnectionAuthScreen-D-vDZGov.js +11 -0
  13. package/dist/assets/CustomerOnboardingAuthScreen-Cs_F35vo.js +1 -0
  14. package/dist/assets/CustomerOnboardingRoutes-deFe2P-n.js +30 -0
  15. package/dist/assets/{DashboardRoutes-DHewAcPg.js → DashboardRoutes-DmGJojZS.js} +3 -3
  16. package/dist/assets/{DefaultTenantHome-BqNVIe7c.js → DefaultTenantHome-CWi1XNJj.js} +1 -1
  17. package/dist/assets/DomesticWireDetailScreen-D5RLzOT3.js +18 -0
  18. package/dist/assets/{DrawerScreen-C-8KLRJM.js → DrawerScreen-DVJ1nhu5.js} +1 -1
  19. package/dist/assets/EntityDetailRoutes-DJgrP2Nz.js +1 -0
  20. package/dist/assets/{ExpenseAutomationRoutes-eoCnwcrW.js → ExpenseAutomationRoutes-OyBtxM5J.js} +4 -4
  21. package/dist/assets/FeaturePreviewScreen-BhrA_knX.js +1 -0
  22. package/dist/assets/HubSpotOAuthCallbackScreen-Dm5LF-fb.js +1 -0
  23. package/dist/assets/{InboxNotificationsProvider-5qCqmUI8.js → InboxNotificationsProvider-DBc6Mphu.js} +1 -1
  24. package/dist/assets/{InvoicingRoutes-CBnQHbV_.js → InvoicingRoutes-B1FBFxmX.js} +2 -2
  25. package/dist/assets/{MagicLinkRoutes-eKUojX66.js → MagicLinkRoutes-70CKQAmw.js} +7 -7
  26. package/dist/assets/MagicLinkSignInScreen-CC7wdqci.js +12 -0
  27. package/dist/assets/MobileAppDrawer-BtnNKdri.js +1 -0
  28. package/dist/assets/NotFoundScreen-DjDyDYWZ.js +1 -0
  29. package/dist/assets/NotificationRoutes-Jy_Q0gUN.js +1 -0
  30. package/dist/assets/OAuthConsentScreen-DB2EvPsq.js +1 -0
  31. package/dist/assets/{PandLWithForecastRoutes-CXuH6-lq.js → PandLWithForecastRoutes-DHCQWgYM.js} +1 -1
  32. package/dist/assets/{PaymentLinkScreen-Cb7u9fKa.js → PaymentLinkScreen-nMdnk521.js} +4 -4
  33. package/dist/assets/PeopleRoutes-rPdm-Ydn.js +22 -0
  34. package/dist/assets/PerformanceRoutes-CF0jBH_I.js +1 -0
  35. package/dist/assets/{Preview-CJfcRzEF.js → Preview-C_55fm97.js} +1 -1
  36. package/dist/assets/QBOConnectionScreen-Dlky0ESM.js +100 -0
  37. package/dist/assets/ReimbursementApprovalRoutes-Bf9cBzdf.js +1 -0
  38. package/dist/assets/ReimbursementApprovalRuleDetailScreen-XQSOHGYn.js +1 -0
  39. package/dist/assets/ReimbursementRoutes-CgvBDllF.js +68 -0
  40. package/dist/assets/{ReportsRoutes-DiYTJu27.js → ReportsRoutes-BMuQOI7M.js} +1 -1
  41. package/dist/assets/RewardsRoutes-CF7hyIJJ.js +1 -0
  42. package/dist/assets/ScreenRoutes-vV1s5761.js +2 -0
  43. package/dist/assets/{SettingsRoutes-BACEcxdy.js → SettingsRoutes-6XcFcNwI.js} +7 -7
  44. package/dist/assets/{SetupPagesScreen-BjTv-gJ-.js → SetupPagesScreen-BxDIT7Xu.js} +5 -5
  45. package/dist/assets/SignInScreen-UcqpfzAX.js +1 -0
  46. package/dist/assets/SignOutScreen-14vW04Vy.js +9 -0
  47. package/dist/assets/TaskListScreen-CwNgkHwd.js +9 -0
  48. package/dist/assets/TaskRoutes-uBt2S29g.js +9 -0
  49. package/dist/assets/TransactionDetailRoutes-Burs226A.js +1 -0
  50. package/dist/assets/{TransactionDetailScreen-CYqaDKU1.js → TransactionDetailScreen-2kUyCbFm.js} +2 -2
  51. package/dist/assets/TransactionListRoutes-Dm5jOGqp.js +1 -0
  52. package/dist/assets/TreasuryRoutes-C3nO4w9n.js +37 -0
  53. package/dist/assets/{VendorsRoutes-DHhjevDF.js → VendorsRoutes-zeljYW53.js} +20 -20
  54. package/dist/assets/WiseConfirmationScreen-BBqG7Bw5.js +12 -0
  55. package/dist/assets/{ZeniAccountRoutes-BI1Dy1bu.js → ZeniAccountRoutes-Dl9FUScI.js} +9 -9
  56. package/dist/assets/ZeniAccountStatementScreen-BjcRzB88.js +9 -0
  57. package/dist/assets/{accountMappingHelper-B06MQSKH.js → accountMappingHelper-ZLBxLrOl.js} +1 -1
  58. package/dist/assets/{analytics-DZ_IK-Kq.js → analytics-DHBkdK00.js} +1 -1
  59. package/dist/assets/{analyticsHelper-CcegxGUw.js → analyticsHelper-C8sM1z8L.js} +1 -1
  60. package/dist/assets/{core-BZ1rdEBJ.js → core-DuNHGHBC.js} +1 -1
  61. package/dist/assets/{decodeURIComponentSafe-Bqc80Z_5.js → decodeURIComponentSafe-CcNRl55W.js} +1 -1
  62. package/dist/assets/{dnd-DzXS-Yl8.js → dnd-DKR3QBLX.js} +1 -1
  63. package/dist/assets/{empty-AsM4qApo.js → empty-BA0WbUFe.js} +1 -1
  64. package/dist/assets/{empty-cCNdrc28.js → empty-DRiI770H.js} +1 -1
  65. package/dist/assets/{emptyVideoElement-Rzrwu9a7.js → emptyVideoElement-h3Sv0Oh_.js} +1 -1
  66. package/dist/assets/epic-leJAVePQ.js +2 -0
  67. package/dist/assets/{expenseAutomationHelper-L0bEaNW0.js → expenseAutomationHelper-DGi7tuOw.js} +1 -1
  68. package/dist/assets/{getLocaleForTenant-pNMINwIt.js → getLocaleForTenant-D1jcEP43.js} +1 -1
  69. package/dist/assets/{index-BtxI1s-C.js → index-B21g9_qj.js} +1 -1
  70. package/dist/assets/{index-CD2K4LCZ.js → index-CFb8siio.js} +1 -1
  71. package/dist/assets/{index-CTFYwhi_.js → index-CxkwDRG8.js} +31275 -30310
  72. package/dist/assets/{index-DUwNnz-H.js → index-DRythsNE.js} +1 -1
  73. package/dist/assets/{index-s3SqlTSi.js → index-DgXVMYGv.js} +1 -1
  74. package/dist/assets/{index-BCqMFJBd.js → index-DplrRYRh.js} +1 -1
  75. package/dist/assets/{index-C2_5ePPm.js → index-bPK7WXlx.js} +2 -2
  76. package/dist/assets/{index-D6ajdYmw.js → index-y1KlwLzp.js} +1 -1
  77. package/dist/assets/{lexical-CXbrQPvX.js → lexical-CcqvVKiN.js} +1 -1
  78. package/dist/assets/{liveblocks-BlM-yJIK.js → liveblocks-BkTNzfNi.js} +1 -1
  79. package/dist/assets/{lottie-BRnok4t-.js → lottie-DACJJNY9.js} +1 -1
  80. package/dist/assets/{mui-BFHFLIBn.js → mui-DaLeH41l.js} +1 -1
  81. package/dist/assets/{pathToGoBack-3nPRQATL.js → pathToGoBack-CmznLvKE.js} +1 -1
  82. package/dist/assets/{pdf-CCE45QO9.js → pdf-BjtwR-dW.js} +3 -3
  83. package/dist/assets/{pdf-lib-C7pdf7jS.js → pdf-lib-oygBYinp.js} +1 -1
  84. package/dist/assets/{plaid-B4PUsiXy.js → plaid-BVNoSR_u.js} +1 -1
  85. package/dist/assets/{pusher-CXiKJSqU.js → pusher-Db4sFIYV.js} +1 -1
  86. package/dist/assets/{react-DSLLCnPg.js → react-1oTTb5wo.js} +1 -1
  87. package/dist/assets/{react-B1sjzw5V.js → react-CEkBTHgm.js} +1 -1
  88. package/dist/assets/{react-BS78iUa1.js → react-CMoOPPDa.js} +1 -1
  89. package/dist/assets/{react-CfJUXWQ6.js → react-CNf8hG5M.js} +1 -1
  90. package/dist/assets/{react-DyJyDxfJ.js → react-CYKQo_kF.js} +1 -1
  91. package/dist/assets/{react-DP4ZD9OQ.js → react-eY-XTCmQ.js} +1 -1
  92. package/dist/assets/{recharts-Cp8vAfrX.js → recharts-CkuQpH_L.js} +1 -1
  93. package/dist/assets/{routePaths-B_N5gTZd.js → routePaths-CKTfFzY9.js} +1 -1
  94. package/dist/assets/{sentry-CoUvtkTT.js → sentry-CNLjKkQW.js} +1 -1
  95. package/dist/assets/{url-CnOwCc5F.js → url-C3nvEZls.js} +1 -1
  96. package/dist/assets/url-CaYHIgYK.js +6 -0
  97. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-RsZy7Pno.js → useAiCfoDashboardSuggestedQuestionsChips-BnMQqj78.js} +1 -1
  98. package/dist/assets/useAskAiCfoHostNavButtonProps-D-XiURTy.js +1 -0
  99. package/dist/assets/{useChargeCardPusherEvents-BUm4XlrP.js → useChargeCardPusherEvents-B74EcXIV.js} +1 -1
  100. package/dist/assets/{useDeviceId-Cm20XW3g.js → useDeviceId-J3kskmrp.js} +1 -1
  101. package/dist/assets/useEmailConnectResultRefresh-F2D_LM69.js +1 -0
  102. package/dist/assets/{useInitialThreadRequest-DLJzdGrt.js → useInitialThreadRequest-DANB6KeB.js} +1 -1
  103. package/dist/assets/useTaskManagerAccess-CgZlooKP.js +1 -0
  104. package/dist/assets/utils-BN2UhEgk.js +36 -0
  105. package/dist/assets/{withTransactionSidePanel-DeFt4H26.js → withTransactionSidePanel-CbsHNOl9.js} +2 -2
  106. package/dist/assets/{zeni-epic-state-CRmviUHA.js → zeni-epic-state-IKQP0lNP.js} +3 -3
  107. package/dist/index.html +1 -1
  108. package/package.json +2 -2
  109. package/dist/assets/AccountMappingScreen-D5SnfpgG.js +0 -9
  110. package/dist/assets/AddressRoutes-DxNwOKyW.js +0 -1
  111. package/dist/assets/BusinessVerificationPageScreen-B3ZQAAhl.js +0 -9
  112. package/dist/assets/CompanyPassportScreen-CZzl3z9T.js +0 -1
  113. package/dist/assets/ConnectionAuthScreen-C42jakDq.js +0 -11
  114. package/dist/assets/CustomerOnboardingAuthScreen-C14qTLI_.js +0 -1
  115. package/dist/assets/CustomerOnboardingRoutes-O_YOoRN1.js +0 -30
  116. package/dist/assets/DomesticWireDetailScreen-CFzZ2YyI.js +0 -18
  117. package/dist/assets/EntityDetailRoutes-0kc30WGx.js +0 -1
  118. package/dist/assets/FeaturePreviewScreen-gRTJmh4o.js +0 -1
  119. package/dist/assets/HubSpotOAuthCallbackScreen-D8IxiMzs.js +0 -1
  120. package/dist/assets/MagicLinkSignInScreen-D9n4aCxk.js +0 -12
  121. package/dist/assets/MobileAppDrawer-Cwqn_b45.js +0 -1
  122. package/dist/assets/NotFoundScreen-75_Gn0cI.js +0 -1
  123. package/dist/assets/NotificationRoutes-BrErGUvj.js +0 -1
  124. package/dist/assets/OAuthConsentScreen-CicUQ_O4.js +0 -1
  125. package/dist/assets/PeopleRoutes-DbLiKITu.js +0 -22
  126. package/dist/assets/PerformanceRoutes-Cs1f1cGn.js +0 -1
  127. package/dist/assets/QBOConnectionScreen-DMWIfg2I.js +0 -100
  128. package/dist/assets/ReimbursementApprovalRoutes-D6JXZy7H.js +0 -1
  129. package/dist/assets/ReimbursementApprovalRuleDetailScreen-DfsoUCdz.js +0 -1
  130. package/dist/assets/ReimbursementRoutes-wJV0bMxF.js +0 -68
  131. package/dist/assets/RewardsRoutes-hsuwRKfr.js +0 -1
  132. package/dist/assets/ScreenRoutes-Dd_1LkfX.js +0 -2
  133. package/dist/assets/SignInScreen-uIYYM64L.js +0 -1
  134. package/dist/assets/SignOutScreen-CDaf30dp.js +0 -9
  135. package/dist/assets/TaskListScreen-J9jUMTBb.js +0 -9
  136. package/dist/assets/TaskRoutes-t8wf1y1X.js +0 -9
  137. package/dist/assets/TransactionDetailRoutes-Cfne4xm1.js +0 -1
  138. package/dist/assets/TransactionListRoutes-CowKNLk5.js +0 -1
  139. package/dist/assets/TreasuryRoutes-Dt8Cgba2.js +0 -37
  140. package/dist/assets/WiseConfirmationScreen-BluQRSGS.js +0 -12
  141. package/dist/assets/ZeniAccountStatementScreen-y7BZNAye.js +0 -9
  142. package/dist/assets/epic-Bave6uHn.js +0 -2
  143. package/dist/assets/url-DpG-51AL.js +0 -6
  144. package/dist/assets/useAskAiCfoHostNavButtonProps-fRSEHozy.js +0 -1
  145. package/dist/assets/useEmailConnectResultRefresh-BHeKh6Ep.js +0 -1
  146. package/dist/assets/useTaskManagerAccess-D9-djiWT.js +0 -1
  147. package/dist/assets/utils-BKpHrBI5.js +0 -36
@@ -1 +0,0 @@
1
- import{j as r}from"./liveblocks-BlM-yJIK.js";import _ from"./NotFoundScreen-75_Gn0cI.js";import{a as p}from"./sentry-CoUvtkTT.js";import{h as C,g as D,u as V,j as u,N as k,l as B,n as Y,o as g}from"./core-BZ1rdEBJ.js";import{fB as E,Y1 as h,Yi as w,MI as U,ME as L,MH as m,Mx as N,YH as M,MB as H,MK as K}from"./zeni-epic-state-CRmviUHA.js";import{z as T,w as $,c7 as q,q as O,bQ as z,c8 as Q}from"./index-CTFYwhi_.js";import"./mui-BFHFLIBn.js";import{u as F,R as x}from"./ReimbursementApprovalRuleDetailScreen-DfsoUCdz.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="7f5bcb72-0a83-4f3f-9a78-48ea7a9f86f9",e._sentryDebugIdIdentifier="sentry-dbid-7f5bcb72-0a83-4f3f-9a78-48ea7a9f86f9")}catch{}})();const j="reimbursement-approval-rule-update",G=B((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(M(!1))},onBackClick:()=>{O(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!1))},onEditRuleClick:t=>{t!=null?(e(m(t)),n(`./${t}/edit`)):(e(m()),n("./new"))}}}))($(q)),J=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>h(o))),b=u((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(R(!0),a(m())),s("./new"))}),[v,d,a]);const f={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(o,y,I)=>{o.endsWith(j)&&I.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(G,{currentTenant:c,location:n,navigate:s,...f})},A="reimbursement-approval-rule-update",P=B((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(M(!1))},onBackClick:()=>{O(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!0))},onEditRuleClick:t=>{t!=null?(e(m(t)),n(`./${t}/edit`)):(e(m()),n("./new"))},onReorderRules:t=>{e(K(t,!0))}}}))($(Q)),X=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=z(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(J,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),f=u((i=>E(i))),o=u((i=>h(i)));F();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(R(!0),a(H(!1,!0)))}),[v,b,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(c(!0),a(m())),s("./new"))}),[S,o,a]);const I={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${A}`]:[],eventCallback:(i,ee,W)=>{i.endsWith(A)&&W.onApprovalRulesEventReceived(i)}};return f?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(P,{currentTenant:f,location:n,navigate:s,isLoading:e,...I})};function le(){return r.jsxs(Y,{children:[r.jsx(g,{path:"/",element:r.jsx(X,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(_,{})})]})}export{le as R};
@@ -1 +0,0 @@
1
- import{j as h}from"./liveblocks-BlM-yJIK.js";import{a as f}from"./sentry-CoUvtkTT.js";import{u as U,j as g,h as C,g as O,i as V,l as k}from"./core-BZ1rdEBJ.js";import{m5 as L,Yi as w,Y1 as _,MA as B,MN as j,MI as A,MJ as E,Yj as N,fB as Y,MH as z}from"./zeni-epic-state-CRmviUHA.js";import{z as F,E as P,a5 as M,b_ as H,q as $,bQ as J,b$ as K}from"./index-CTFYwhi_.js";import"./mui-BFHFLIBn.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="0f59af4c-4d2c-41c4-9543-8d4263a05bc5",e._sentryDebugIdIdentifier="sentry-dbid-0f59af4c-4d2c-41c4-9543-8d4263a05bc5")}catch{}})();function Q(){const e=U(),s=f.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))}),[p,t,e])}const W=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return s.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const b=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),R=u.actors.selectedNonUsers.map((m=>{const y=(I=m.value,N(I)==null);var I;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=b.concat(R);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(H);function G(){const e=C(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>w(n))),l=g((n=>_(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(B(!0)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(M,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(W,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function pe(e){return N(e)==null}const X=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:i,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:_(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((y=>{const I=y.actorKind?.selectedOption,q=y.selectedRole?.selectedNonUsers??[];let D=[];I==="role"?D=q.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):I==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((T=>({type:"user",subType:void 0,userId:T.userId,idType:"user",isImplicitActor:!1}))));const x=y.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const b=v?.selection.selectedOptions??[];b.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:b});const R=S?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:i,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(K);function ne(){const e=g((t=>Y(t))),{isApprovalRulesV3Enabled:s}=J(e?.tenantId);return s?h.jsx(Z,{}):h.jsx(G,{})}function Z(){const e=C(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>w(n))),l=g((n=>_(n))),[a,d]=f.useState(!1);if(Q(),f.useEffect((()=>{a||(d(!0),s(B(!1)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(M,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,pe as i,Q as u};
@@ -1,68 +0,0 @@
1
- import{j as s}from"./liveblocks-BlM-yJIK.js";import{u as ae,j as A,h as J,g as K,i as ie,N as M,l as ee,q as ct,n as dt,o as w}from"./core-BZ1rdEBJ.js";import{fB as V,ME as ut,ZO as ge,c7 as he,LK as Ue,lQ as pt,LZ as ce,LY as de,ZP as bt,bn as fe,gS as _e,ZQ as gt,UM as ht,lF as Pe,UN as Ce,UO as ft,kr as St,XP as It,kG as yt,Ly as Rt,Bf as At,ky as kt,Mj as Me,ZR as $e,ZS as Ee,ZT as vt,ZU as Ct,ZV as Et,M3 as we,kM as wt,XY as xt,LX as Bt,LI as Tt,ZW as Dt,LH as jt,ZX as Ft,LP as xe,M7 as Lt,M6 as Ut,M2 as _t,ZY as Ne,Rh as Pt,bo as Mt,LS as $t,MB as Nt,ZZ as Zt,Z_ as Ot,Mf as zt,Mc as Be,Xj as Gt,LF as Vt,Z$ as Ze,N2 as Te,Na as Ht,_0 as Wt,_1 as Y,_2 as Xt,_3 as Oe,_4 as Yt,_5 as ze,_6 as Ge,Mr as ue,bu as qt,bK as Se,cL as Ie,dV as Ve,dU as He,_7 as Kt,gd as Qt,Xw as Jt,_8 as en,_9 as We,XA as tn,Yi as nn,_a as an,YH as sn,N7 as De,N6 as on,_b as rn,_c as ln,_d as mn,_e as cn,_f as dn,Y2 as un,MZ as pn,N1 as bn,bq as gn,bJ as hn,cF as fn,ct as Sn,bt as In,Tc as yn,d6 as Rn,d9 as An,d8 as kn,cE as vn}from"./zeni-epic-state-CRmviUHA.js";import{bQ as Cn,c as Xe,$ as Ye,I as oe,d as x,z as _,cP as qe,a6 as re,k as C,aW as je,K as F,ac as se,ad as En,G as Ke,cQ as wn,p as q,aq as Qe,cR as xn,U as le,cS as Bn,ao as Tn,a9 as Dn,a5 as ye,S as Je,w as jn,by as Fn,at as Ln,ag as Un,E as et,cT as _n,h as Pn}from"./index-CTFYwhi_.js";import{n as $,S as Mn}from"./mui-BFHFLIBn.js";import pe from"./NotFoundScreen-75_Gn0cI.js";import{S as Fe}from"./SetupPagesScreen-BjTv-gJ-.js";import{F as tt}from"./FeaturePreviewScreen-gRTJmh4o.js";import{a as h}from"./sentry-CoUvtkTT.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-fRSEHozy.js";import{u as nt}from"./useInitialThreadRequest-DLJzdGrt.js";import{D as $n}from"./DrawerScreen-C-8KLRJM.js";import{M as at}from"./MobileAppDrawer-Cwqn_b45.js";import{F as Nn}from"./ScreenRoutes-Dd_1LkfX.js";import{R as Zn}from"./ReimbursementApprovalRoutes-D6JXZy7H.js";import"./recharts-Cp8vAfrX.js";import"./analytics-DZ_IK-Kq.js";import"./plaid-B4PUsiXy.js";import"./dnd-DzXS-Yl8.js";import"./stripe-cKAAJElX.js";import"./lottie-BRnok4t-.js";import"./lexical-CXbrQPvX.js";import"./pdf-CCE45QO9.js";import"./utils-BKpHrBI5.js";import"./BusinessVerificationPageScreen-B3ZQAAhl.js";import"./routePaths-B_N5gTZd.js";import"./analyticsHelper-CcegxGUw.js";import"./InboxNotificationsProvider-5qCqmUI8.js";import"./useTaskManagerAccess-D9-djiWT.js";import"./getLocaleForTenant-pNMINwIt.js";import"./ReimbursementApprovalRuleDetailScreen-DfsoUCdz.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]="596a9cf9-8f5a-47dc-9165-f95f5bcd5c3b",e._sentryDebugIdIdentifier="sentry-dbid-596a9cf9-8f5a-47dc-9165-f95f5bcd5c3b")}catch{}})();const st=e=>`/${e}/reimbursements`,On=e=>h.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},h.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:X,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Ke.getLocalizedStrings(),zn=ee((function(e,t){const n=t.currentTenant?.companyId,r=bt(e.plaidAccountViewState,"user_reimbursement_account"),c=_.getSignedInUser(),d=fe(c),m=r.plaidConnectionDetails,o=_e(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),b=gt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,f=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,f=c?.userId===l.createdBy?.userId);const B=e.entityAutoCompleteState?.autoCompleteText?.common,u=ht(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:B,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:f,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=_.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(de(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(xe(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(_t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ut())},clearRemiSaveStatus:()=>{e(Lt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(xe(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(we(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ee({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ce({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(Ee({}));const i=st(o),l=q(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Me(n)))},onSaveBankAccount:()=>{a?.userId&&e(kt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(At("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(yt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(St({fetchState:"Not-Started"})),e(It())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ft({searchString:i,entityType:l,searchOrigin:"common"})):e(Ce("common"))},onCancelAutoComplete:()=>{e(Ce("common"))}}}}))(wn);function Le(){const e=J(),t=ae(),n=K(),{reimbursementId:r}=ie(),c=Xe(),d=Ye(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=oe(),{isFeatureEnabled:b}=l(x.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:f}=l(x.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:B,onAskAiCfoClick:u}=Re({mobileExploreReferrer:"Reimbursement Details"}),T=K().pathname,D=T.includes("edit"),j=T.includes("reimbursement/new"),[k,v]=h.useState(!1),E=_.getSignedInUser(),I=A((p=>V(p))),g=A((p=>ge(p,r))),L=nt(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=he(I?.userRole??[]);(function(){const p=ae(),N=A((Q=>V(Q))),Z=N?.tenantId,{isApprovalRulesV3Enabled:O,isLoading:H}=Cn(Z),W=A((Q=>Q.remiSetupApproverViewState.fetchState));h.useEffect((()=>{Z==null||H||W==="Not-Started"&&p(ut(!0,!1,!1,O))}),[Z,H,O,W,p])})(),h.useEffect((()=>{(j&&!k||D&&!k&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(v(!0),t(Ue(!1,b,y,r)))}));const P=A((p=>pt(p.accountState,p.accountListState,"reimbursementAccountList")));if(E==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(Gn,{windowSize:d,children:[s.jsx(re,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Hn,{children:s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:X.upload,single:ne.dropReceipt.single,or:X.texts.or,multiple:ne.dropReceipt.multiple,receipts:X.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Wn,{children:[s.jsx(Xn,{onClick:()=>o(!1),children:s.jsx(On,{})}),s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:X.upload,single:ne.dropReceipt.single,or:X.texts.or,multiple:ne.dropReceipt.multiple,receipts:X.texts.receipts2}})]}):null,s.jsx(Yn,{windowSize:d,children:s.jsx(zn,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:f,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:c,uncategorizedAccounts:P,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:B,onAskAiCfoClick:u})})]})}const Gn=$.div`
2
- display: flex;
3
- position: relative;
4
- height: 100vh;
5
- flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
6
- background-color: ${e=>e.theme.colors.grey4};
7
- `,Vn=$.div`
8
- position: fixed;
9
- top: 0;
10
- left: 0;
11
- right: 0;
12
- bottom: 0;
13
- background-color: ${En.overlayBackgroundBlack};
14
- z-index: 5;
15
- `,Hn=$.div`
16
- position: absolute;
17
- top: 0;
18
- left: 0;
19
- width: 42%;
20
- height: 100%;
21
- z-index: 6;
22
- display: flex;
23
- background-color: transparent;
24
- overflow: hidden;
25
- `,Wn=$.div`
26
- position: fixed;
27
- top: 0;
28
- left: 0;
29
- right: 0;
30
- bottom: 0;
31
- z-index: 11;
32
- display: flex;
33
- flex-direction: column;
34
- overflow-y: auto;
35
- background-color: ${e=>e.theme.colors.grey4};
36
- `,Xn=$.button`
37
- align-self: flex-end;
38
- background: none;
39
- border: none;
40
- cursor: pointer;
41
- padding: ${F.sp2} ${F.sp3};
42
- line-height: 1;
43
- color: ${e=>e.theme.colors.hero};
44
- &:hover {
45
- color: ${e=>e.theme.colors.primary};
46
- }
47
- svg {
48
- width: ${F.sp4};
49
- height: ${F.sp4};
50
- }
51
- `,Yn=$.div`
52
- display: flex;
53
- flex-direction: column;
54
- width: 100%;
55
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,qn=ee((function(e,t){const n=Ne(e,t.reimbursementId),r=_.getSignedInUser(),c=fe(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Zt(n.remiActivities,Ot(t.currentTenant),r));const i=he(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e($e());const a=st(o),i=q(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Vt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Gt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Be(n,a.type,"")):e(Be(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=q(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{C.trackReimbursementDeleteReimbursement(n),e(Me(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(xn);function Kn(){const e=J(),t=ae(),n=K(),r=n.hash.substring(1),c=Xe(),{reimbursementId:d}=ie(),m=_.getSignedInUser(),o=A((R=>V(R))),a=A((R=>Ne(R,d??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=nt(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Re({mobileExploreReferrer:"Reimbursement Details"});Qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:f}=oe(),{isFeatureEnabled:B}=f(x.isLimitedCategoryForReimbursement),[u,T]=h.useState(!1),[D,j]=h.useState(!1),[k,v]=h.useState(!1),{isFeatureEnabled:E}=f(x.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=f(x.isShowDeletedReimbursementsFeatureEnabled),g=A((R=>ge(R,d??""))),L=Pt(o),U=Mt(o.userRole),P=a.fetchState;if(h.useEffect((()=>{u||d==null?u==1&&P==="Error"&&e("page-not-found",{replace:!0}):(T(!0),t($t(d,!1,I)))}),[u,d,t,P]),h.useEffect((()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?v(!1):v(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find((R=>R.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,L,m]),h.useEffect((()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(j(!0),t(Ue(!1,B,I,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))}),[D,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(M,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(qe,{}):s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:C,onLoad:R=>(p=>{d!=null&&p.trackReimbursementReimbursementDetails(d)})(R)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:E,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:k,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Qn=ee((function(e,t){return{remisReviewView:Ze(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(Y())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Ht());break;case"approve":e(Te("approved",r??""));break;case"reject":e(Te("rejected",r??""))}}}}))(Bn);function Jn({tenantEmailDomain:e}){const t=J(),n=A((m=>m.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=A((m=>Ze(m))),c=le(),d=c?.loggedInUserRole?.includes("admin")===!0;return h.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Qn,{navigate:t,analytics:C,isAdmin:d,tenantEmailDomain:e})}const G=tn(),it="bulk-operation-update",be="reimbursement-approval-rule-update",{spendManagement:ea,common:me}=Ke.getLocalizedStrings(),ta=ea.reimbursement.bulkActions,na=$.div`
57
- display: flex;
58
- min-height: 100%;
59
- width: 100%;
60
- flex: 1 1 auto;
61
- flex-direction: column;
62
- align-items: center;
63
- background-color: ${e=>e.theme.colors.grey4};
64
- `,aa=ee((function(e,t){const n=Ge(e,G,t.isBulkActionEnabled);let r=n.allSubTabs;const c=_.getSignedInUser(),d=fe(c),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((f=>f!=="deleted")));const b=n.fetchState,y=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((f=>f.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:d,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:G,spendManagementEndPoint:`${Ln}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(Y()),e(Oe(o))},onSubtabChange:o=>{e(Y()),e(ze(o))},onTransactionClick:(o,a)=>{const i=oa(m,o,a),l=q(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=ia(m),a=q(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;C?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=q(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&C.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&C.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(ue(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(Y())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(De("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(De("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(be)&&e(sn(!1))},onEventReceived:o=>{o===it&&e(an())}}}))(jn(Fn));function sa(){const e=J(),t=ae(),n=K(),r=n.state,c=Ye(),[d,m]=h.useState(null),o=ct("/:tenantEmailDomain/reimbursements/bulk-review")!=null;h.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Xt(r.tab.toString());S!=null?t(Oe(S)):console.log("Warning:Not a valid remiListTab");const z=Yt(r.subTab.toString());z!=null?t(ze(z)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(Y())}}),[]);const{useFeatureGate:a}=oe(),{isFeatureEnabled:i}=a(x.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(x.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(x.isReimbursementCommentingEnabled),{isFeatureEnabled:f}=a(x.isReimbursementBulkActionEnabled),B=_.getSignedInUser(),u=A((S=>V(S))),[T,D]=h.useState(!1),[j,k]=h.useState(!1),v=le(),E=v?.loggedInUserRole?.includes("admin")===!0,I=A((S=>Ge(S,G,f))),{areTenantIdsInSync:g}=Tn(),L=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:P}=Re({mobileExploreReferrer:"Reimbursement List"});if(Qe({isDataReady:L==="Completed"}),h.useEffect((()=>{!j&&g&&(k(!0),t(ue(G,!0,l,!1,!0)))}),[j,G,t,g]),B==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&qt(u),p=Se(v?.loggedInUserRoleMap),N=Ie(v?.loggedInUserRoleMap),Z=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,O=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,H=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,W=A((S=>_e(S.companyState,u.companyId))),Q=W?.company.featuresActivationInfo.connectedAccountProvider,Ae=S=>{D(S)},{isFeatureEnabled:ot}=a(x.isDebitCardFeatureEnabled),rt=Ve(ot,u),lt=He(u),{remisProcessed:te,remisProcessing:ke}=A((S=>Kt(S)));h.useEffect((()=>{te===ke&&d!=null&&(t(Qt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:te>1?me.texts.reports2:ta.report},{variableName:"_has_",variableValue:te>1?me.texts.have:me.texts.has},{variableName:"_action_",variableValue:Jt(d)}]})),t(en()),setTimeout((()=>{t(ue(G,!0,l,!1,!0,!0))}),3e3),m(null))}),[te,ke]);const mt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${it}`,`private-encrypted-${u.companyId}.${be}`]:[],eventCallback:(S,z,ve)=>{S.endsWith(be)?ve.onReimbursementApprovalRulesEventReceived?.(S):z.entity_type==="reimbursement"&&(m(z.operation_type),ve.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?rt===!0||lt===!0?s.jsx(tt,{}):O&&(!R||p)||N&&Z?s.jsxs(s.Fragment,{children:[L==="Completed"?s.jsx(re,{analytics:C,onLoad:S=>(z=>z.trackPageLoaded(Je.Event.reimbursementHome))(S)}):null,s.jsx(at,{isAppContentDrawerOpen:T,handleDrawerToggle:Ae}),s.jsxs(na,{windowSize:c,children:[s.jsx($n,{isOpen:o,drawerLeftMargin:new Dn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(Y())},children:s.jsx(ra,{onClick:S=>S.stopPropagation(),children:s.jsx(Jn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(aa,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:G,isAdmin:E,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{Ae(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:Q,isBulkActionEnabled:f,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:P,...mt})]})]}):H&&p?s.jsx(M,{to:"../setup"}):v!=null&&We(u,v.loggedInUserRoleMap)?s.jsx(M,{to:"../promo"}):s.jsx(ye,{fetchState:"In-Progress"}):s.jsx(pe,{})}const ia=e=>`/${e}/reimbursements/setup`,oa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ra=$(Mn)`
65
- display: flex;
66
- min-height: 100%;
67
- flex-direction: column;
68
- `,la=ee((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:C,videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(_n),ma=()=>{const e=Un(),t=J(),n=K(),{tenantEmailDomain:r}=ie(),c=et(),[d,m]=h.useState(!1),o=A((k=>V(k))),a=_.getSignedInUserTenant(r)?.companyId??o.companyId,i=_.getSignedInUser(),l=o.userRoleId,b=!!o.userRole?.includes("reimbursements_user"),y=le(),f=Se(y?.loggedInUserRoleMap),B=Ie(y?.loggedInUserRoleMap),u=!!o.userReimbursementInfo?.isReimbursementTOSAccepted,T=!!o.companyReimbursementInfo?.info?.isReimbursementEnabled,D=!!o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=k=>{m(k)};if(i==null)throw Error("Can't access reimbursement promo page without signing in...");return T&&B&&u?s.jsx(M,{to:"../../../reimbursements"}):D&&f?s.jsx(M,{to:"../../reimbursements/setup"}):o.companyReimbursementInfo&&!D||o.userReimbursementInfo&&B&&u===!1?s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:C,onLoad:k=>(v=>v.trackPageLoaded(Je.Event.reimbursementPromoPage))(k)}),s.jsx(at,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(la,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:o.userReimbursementInfo,userRoleId:l,isEmployee:b,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:c.colors.grey5}})};function Za(){const e=A((W=>V(W))),t=le(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=et(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=oe(),{isFeatureEnabled:o}=m(x.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(x.isDebitCardFeatureEnabled),i=Ve(a,e),l=He(e),b=e?.userRole!=null&&gn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),f=fn(t?.loggedInUserRoleMap),B=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=Se(t?.loggedInUserRoleMap),T=B&&u,D=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,j=D&&Sn(t?.loggedInUserRoleMap),k=Pn(e,o,a)&&!b,v=k&&In(t?.loggedInUserRoleMap),E=yn(t?.loggedInUserRoleMap),I=Rn(t?.loggedInUserRoleMap),g=An(t?.loggedInUserRoleMap),L=D&&I,U=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,P=kn(t?.loggedInUserRoleMap),R=vn(t?.loggedInUserRoleMap),p=Ie(t?.loggedInUserRoleMap),N=k&&P,{tenantEmailDomain:Z}=ie(),O=K(),H=n===!0&&(u||p&&d);return s.jsxs(dt,{children:[O.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(w,{path:"verification",element:s.jsx(Fe,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:f,isReimbursementAdminLevelAccess:T,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:v,isUserHasOnlyCardAccess:E,productType:"reimbursement",type:"verification"})}),s.jsx(w,{path:"setup",element:s.jsx(Fe,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:f,isReimbursementAdminLevelAccess:T,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:v,isUserHasOnlyCardAccess:E,productType:"reimbursement",type:"setup"})}),s.jsx(w,{path:"promo",element:s.jsx(ma,{})}),s.jsx(w,{path:"approval-rules/*",element:T?s.jsx(Zn,{}):s.jsx(Nn,{showZeniAccountRoute:L,isUserHasBillPayAccess:R,isUserHasReimbursementAccess:p,showTreasuryRoute:U,isTenantBankingOnly:i,showChargeCardRoute:N,tenantEmailDomain:Z??""})}),H&&s.jsx(w,{path:"*",element:s.jsx(sa,{})}),(i===!0||l===!0)&&s.jsx(w,{path:"/*",element:s.jsx(tt,{})}),t!=null&&We(e,t?.loggedInUserRoleMap)&&s.jsx(w,{path:"*",element:s.jsx(M,{to:"../promo"})}),c&&u&&s.jsx(w,{path:"*",element:s.jsx(M,{to:"../setup"})})]}):O.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(w,{path:"new",element:s.jsx(Le,{})}),s.jsx(w,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(w,{path:":reimbursementId/edit",element:s.jsx(Le,{})}),s.jsx(w,{path:"*",element:s.jsx(pe,{})})]}):s.jsx(w,{path:"*",element:s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${F.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(w,{path:"*",element:s.jsx(pe,{})})]})}export{Za as default};
@@ -1 +0,0 @@
1
- import{j as a}from"./liveblocks-BlM-yJIK.js";import{z as j,a6 as C,k as u,S as N,d_ as k,I as E,d as I}from"./index-CTFYwhi_.js";import"./mui-BFHFLIBn.js";import g from"./NotFoundScreen-75_Gn0cI.js";import{a as c}from"./sentry-CoUvtkTT.js";import{u as D,j as h,h as F,g as L,l as _,n as P,o as f,N as y}from"./core-BZ1rdEBJ.js";import{fB as T,a0P as w,a0Q as p,CS as U,pF as V,a0R as Q,CQ as R}from"./zeni-epic-state-CRmviUHA.js";import"./recharts-Cp8vAfrX.js";import"./analytics-DZ_IK-Kq.js";import"./plaid-B4PUsiXy.js";import"./dnd-DzXS-Yl8.js";import"./stripe-cKAAJElX.js";import"./lottie-BRnok4t-.js";import"./lexical-CXbrQPvX.js";import"./pdf-CCE45QO9.js";import"./utils-BKpHrBI5.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]="a7060fbc-0d3a-4a60-a2f2-40af1748ad1e",e._sentryDebugIdIdentifier="sentry-dbid-a7060fbc-0d3a-4a60-a2f2-40af1748ad1e")}catch{}})();const z=_((function(e,t){const n=w(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=j.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(R())},onUpdateInviteFormLocalData:s=>{e(Q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(k),B=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>T(o))),l=F(),x=L(),d=j.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>w(o))),S=d?.firstName!=null?d.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(U()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const b=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(C,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(N.Event.inviteEmailViewed))(o)}):null,a.jsx(z,{navigate:l,location:x,currentTenant:r,companyName:b,userName:S,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=E(),{isFeatureEnabled:t}=e(I.isReferralFeatureEnabled);return a.jsxs(P,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-75_Gn0cI.js","assets/sentry-CoUvtkTT.js","assets/core-BZ1rdEBJ.js","assets/zeni-epic-state-CRmviUHA.js","assets/index-CTFYwhi_.js","assets/mui-BFHFLIBn.js","assets/analytics-DZ_IK-Kq.js","assets/utils-BKpHrBI5.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-DHewAcPg.js","assets/withTransactionSidePanel-DeFt4H26.js","assets/useAskAiCfoHostNavButtonProps-fRSEHozy.js","assets/TransactionDetailScreen-CYqaDKU1.js","assets/decodeURIComponentSafe-Bqc80Z_5.js","assets/useInitialThreadRequest-DLJzdGrt.js","assets/routePaths-B_N5gTZd.js","assets/expenseAutomationHelper-L0bEaNW0.js","assets/analyticsHelper-CcegxGUw.js","assets/CompanyPassportScreen-CZzl3z9T.js","assets/MobileAppDrawer-Cwqn_b45.js","assets/InboxNotificationsProvider-5qCqmUI8.js","assets/useTaskManagerAccess-D9-djiWT.js","assets/useAiCfoDashboardSuggestedQuestionsChips-RsZy7Pno.js","assets/FeaturePreviewScreen-gRTJmh4o.js","assets/BillPayRoutes-DOVyvcf4.js","assets/AddressScreen-lw7TKwyq.js","assets/DomesticWireDetailScreen-CFzZ2YyI.js","assets/BusinessVerificationPageScreen-B3ZQAAhl.js","assets/DrawerScreen-C-8KLRJM.js","assets/SetupPagesScreen-BjTv-gJ-.js","assets/BillPayApprovalRoutes-CXiRj9PG.js","assets/ReimbursementApprovalRuleDetailScreen-DfsoUCdz.js","assets/getLocaleForTenant-pNMINwIt.js","assets/ReimbursementRoutes-wJV0bMxF.js","assets/ReimbursementApprovalRoutes-D6JXZy7H.js","assets/TransactionListRoutes-CowKNLk5.js","assets/ZeniAccountStatementScreen-y7BZNAye.js","assets/SettingsRoutes-BACEcxdy.js","assets/AccountMappingScreen-D5SnfpgG.js","assets/QBOConnectionScreen-DMWIfg2I.js","assets/empty-AsM4qApo.js","assets/index-BCqMFJBd.js","assets/url-DpG-51AL.js","assets/index-s3SqlTSi.js","assets/accountMappingHelper-B06MQSKH.js","assets/useEmailConnectResultRefresh-BHeKh6Ep.js","assets/ReportsRoutes-DiYTJu27.js","assets/ChargeCardRoutes-DiWZ-ZiS.js","assets/useChargeCardPusherEvents-BUm4XlrP.js","assets/PeopleRoutes-DbLiKITu.js","assets/ExpenseAutomationRoutes-eoCnwcrW.js","assets/TreasuryRoutes-Dt8Cgba2.js","assets/VendorsRoutes-DHhjevDF.js","assets/pathToGoBack-3nPRQATL.js","assets/ZeniAccountRoutes-BI1Dy1bu.js","assets/AddressRoutes-DxNwOKyW.js","assets/PandLWithForecastRoutes-CXuH6-lq.js","assets/CustomerOnboardingRoutes-O_YOoRN1.js","assets/TransactionDetailRoutes-Cfne4xm1.js","assets/EntityDetailRoutes-0kc30WGx.js","assets/InvoicingRoutes-CBnQHbV_.js","assets/NotificationRoutes-BrErGUvj.js","assets/PerformanceRoutes-Cs1f1cGn.js","assets/RewardsRoutes-hsuwRKfr.js","assets/TaskRoutes-t8wf1y1X.js","assets/TaskListScreen-J9jUMTBb.js","assets/AiCfoScreen-DCL1Hzq-.js","assets/CardsAiCfoScreen-yIiz5h6K.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as cs,fB as ms,dV as _s,dU as Es,A3 as hs,de as ps,gG as gs,g5 as xs,db as pe,cF as Rs,gj as Is,cx as js,bE as Ts,br as As,T9 as fs,v as bs,Tb as Ds,bq as ys,Tc as Cs,bK as vs,bJ as Os,bt as Us,ct as Ps,Td as ws,Te as Fs,d6 as Ls,d9 as Vs,d8 as ks,cE as Hs,cL as Bs,pw as ge,ge as xe,gV as Ss,gg as Re,gI as Ie,gJ as je,gh as Ns}from"./zeni-epic-state-CRmviUHA.js";import{j as e}from"./liveblocks-BlM-yJIK.js";import{a as P}from"./sentry-CoUvtkTT.js";import{N as u,u as Ms,h as Zs,i as Gs,g as $s,j as $,q as Te,n as zs,o as t}from"./core-BZ1rdEBJ.js";import{N as l,E as qs,u as Ys,z as D,I as Ws,f as Js,F as Ks,d as M,h as Qs,O as Xs,U as en,L as F,G as Ae,t as _,P as sn,Q as nn,k as ne}from"./index-CTFYwhi_.js";import"./mui-BFHFLIBn.js";import{f as fe}from"./analyticsHelper-CcegxGUw.js";import{t as tn}from"./getLocaleForTenant-pNMINwIt.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},A=new a.Error().stack;A&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[A]="446f9218-71e7-4aec-a00d-c248ced2b7ef",a._sentryDebugIdIdentifier="sentry-dbid-446f9218-71e7-4aec-a00d-c248ced2b7ef")}catch{}})();const an=l((()=>s((()=>import("./NotFoundScreen-75_Gn0cI.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),on=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/reimbursements`}),rn=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/bills`}),be=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/treasury`}),De=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/checking`}),ye=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/cards`}),y=({showZeniAccountRoute:a,isUserHasBillPayAccess:A,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(V===!0){if(a)return e.jsx(De,{tenantEmailDomain:v});if(i)return e.jsx(be,{tenantEmailDomain:v});if(O)return e.jsx(ye,{tenantEmailDomain:v})}return a?e.jsx(De,{tenantEmailDomain:v}):i?e.jsx(be,{tenantEmailDomain:v}):O?e.jsx(ye,{tenantEmailDomain:v}):A?e.jsx(rn,{tenantEmailDomain:v}):B?e.jsx(on,{tenantEmailDomain:v}):e.jsx(an,{})},ln={dashboard:()=>s((()=>import("./DashboardRoutes-DHewAcPg.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,0,17,18,19,20,21,22,23,8])),bills:()=>s((()=>import("./BillPayRoutes-DOVyvcf4.js")),__vite__mapDeps([24,1,2,3,4,5,6,7,25,0,26,11,14,27,15,19,20,21,28,23,29,17,30,31,32,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-wJV0bMxF.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,11,14,28,34,31,32,8])),transactions:()=>s((()=>import("./TransactionListRoutes-CowKNLk5.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])),settings:()=>s((()=>import("./SettingsRoutes-BACEcxdy.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,21,38,19,20,39,40,41,42,43,13,44,25,0,17,27,15,18,45,30,31,34,8])),reports:()=>s((()=>import("./ReportsRoutes-DiYTJu27.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-DiWZ-ZiS.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])),people:()=>s((()=>import("./PeopleRoutes-DbLiKITu.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-eoCnwcrW.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,10,44,28,8])),treasury:()=>s((()=>import("./TreasuryRoutes-Dt8Cgba2.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])),vendors:()=>s((()=>import("./VendorsRoutes-DHhjevDF.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,25,0,23,53,15,11,19,20,21,28,44,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-BI1Dy1bu.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,26,25,11,36,8]))},un=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],te=a=>{"requestIdleCallback"in window?requestIdleCallback(a):setTimeout(a,100)},dn=l((()=>s((()=>import("./ReportsRoutes-DiYTJu27.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])))),cn=l((()=>s((()=>import("./AddressRoutes-DxNwOKyW.js")),__vite__mapDeps([55,1,2,3,25,4,5,6,7,0,8])))),mn=l((()=>s((()=>import("./PeopleRoutes-DbLiKITu.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])))),_n=l((()=>s((()=>import("./PandLWithForecastRoutes-CXuH6-lq.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,0,23,11,14,15,19,20,21,8])))),En=l((()=>s((()=>import("./CustomerOnboardingRoutes-O_YOoRN1.js")),__vite__mapDeps([57,1,2,3,25,4,5,6,7,0,39,40,41,42,43,13,45,48,8])))),hn=l((()=>s((()=>import("./VendorsRoutes-DHhjevDF.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,25,0,23,53,15,11,19,20,21,28,44,8])))),pn=l((()=>s((()=>import("./TransactionDetailRoutes-Cfne4xm1.js")),__vite__mapDeps([58,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-0kc30WGx.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,10,11,12,14,15,16,8])))),gn=l((()=>s((()=>import("./DashboardRoutes-DHewAcPg.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,0,17,18,19,20,21,22,23,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-DOVyvcf4.js")),__vite__mapDeps([24,1,2,3,4,5,6,7,25,0,26,11,14,27,15,19,20,21,28,23,29,17,30,31,32,8])))),xn=l((()=>s((()=>import("./SettingsRoutes-BACEcxdy.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,21,38,19,20,39,40,41,42,43,13,44,25,0,17,27,15,18,45,30,31,34,8])))),Rn=l((()=>s((()=>import("./InvoicingRoutes-CBnQHbV_.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,25,0,19,20,21,39,40,41,42,43,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-wJV0bMxF.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,11,14,28,34,31,32,8])))),In=l((()=>s((()=>import("./ZeniAccountRoutes-BI1Dy1bu.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,26,25,11,36,8])))),jn=l((()=>s((()=>import("./TreasuryRoutes-Dt8Cgba2.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])))),Tn=l((()=>s((()=>import("./TransactionListRoutes-CowKNLk5.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])))),An=l((()=>s((()=>import("./ChargeCardRoutes-DiWZ-ZiS.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])))),fn=l((()=>s((()=>import("./NotificationRoutes-BrErGUvj.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,11,21,8])))),bn=l((()=>s((()=>import("./PerformanceRoutes-Cs1f1cGn.js")),__vite__mapDeps([62,1,2,3,0,4,5,6,7,11,19,20,21,8])))),Dn=l((()=>s((()=>import("./ExpenseAutomationRoutes-eoCnwcrW.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,10,44,28,8])))),yn=l((()=>s((()=>import("./RewardsRoutes-hsuwRKfr.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,0,8])))),Cn=l((()=>s((()=>import("./TaskRoutes-t8wf1y1X.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,14,19,20,21,65,11,8])))),vn=l((()=>s((()=>import("./AiCfoScreen-DCL1Hzq-.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,22,53,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-yIiz5h6K.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,8])))),C=l((()=>s((()=>import("./NotFoundScreen-75_Gn0cI.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),On=l((()=>s((()=>import("./TaskListScreen-J9jUMTBb.js").then((a=>a.f))),__vite__mapDeps([65,1,2,3,4,5,6,7,11,19,20,21,8])))),Un=({isDashboardAccess:a,showZeniAccountRoute:A,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(O===!0){if(A)return e.jsx(u,{to:"checking"});if(V)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):a?e.jsx(u,{to:"dashboard"}):A?e.jsx(u,{to:"checking"}):V?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/dashboard`}),Sn=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:a}){const A=Ms(),B=Zs(),{tenantEmailDomain:i}=Gs(),V=qs().mode,{setLoading:O,clearAllLoading:v,clearLoading:k}=Ys(),f=D.getSignedInUserTenant(i)?.tenantId,j=D.getSignedInUser(),J=cs(j),z=$s(),[L,we]=P.useState(!1),r=$((o=>ms(o))),{useFeatureGate:S}=Ws(),Z=Js(),ae=Ks(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=S(M.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=S(M.isDebitCardFeatureEnabled),T=$((o=>o.tenantState.fetchState)),p=$((o=>o.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?_s(oe,r):void 0,K=p==="Completed"||T==="Completed"?Es(r):void 0,re=p==="Completed"||T==="Completed"?hs(r)&&!ps(r):void 0,ke=Qs(r,Ve,oe),{isCardsHidden:He}=Xs(r?.tenantId),Be=!ke||!!He,{isFeatureEnabled:Se}=S(M.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=S(M.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=S(M.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||nn==="DEV",q=$((o=>gs(o)));if(i!=null){const o=D.getSignedInUserTenant(i);j!=null&&o!=null&&fe(j,r,V)}const G={tenantId:f,userId:j?.userId,sessionId:j?.zeniSessionId},ie=xs(),h=en(),Ze=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),Ge=Rs(h?.loggedInUserRoleMap),X=Te("/:tenantEmailDomain/onboarding/*")!==null,ee=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),$e=$((o=>G.tenantId!=null?Is(o,G.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),a(i)}),[i]),P.useEffect((()=>{if(ee!=null&&f!=null){const o=ee.params.selectedPeriod;if(o!=null){const b=o.split("-");if(b.length===2){const d=js(Number(b[0])),n=Number(b[1]),c=Ts(`01-${d<10?`0${d}`:d}-${n}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),N=As();c.isAfter(N,"month")===!1?A(fs(f,{month:d,year:n})):B(`/${i}/month_end_close_checks/review`)}}}}),[ee,f]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,G,ie,j,A,D]),P.useLayoutEffect((()=>{!bs(ie,G)&&D.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,b,d,n){if(xe(b?.userId,b?.zeniSessionId,o.tenantId),d(Ss(!0)),d(Re(o.tenantId)),o.tenantId!=null&&_.clearTenant(o.tenantId),o.tenantId!=null){const c=D.getSignedInUserTenantWithId(o.tenantId);n&&Ae.updateAppLocaleID(tn(n)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}o.userId!=null?ne.identify(o.userId,{tenant_id:o.tenantId}):ne.resetUserIdentity()})(G,j,A,$e))}),[f]),P.useEffect((()=>{D.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,b,d,n,c,N,H){if(d==null&&n==null)return void console.warn("There is no current tenant selected!!");const Y=n!=null&&c?.zeniSessionId!=null,ls=d==null||d.tenantId!==n,us=d!=null&&d.excludedResources==null,ds=d!=null&&d.externalConnections==null;if(Y&&ls){H(Re(n));const W=D.getSignedInUserTenantWithId(n);W?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(W?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,n),_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),H(Ie(c.userId,n))),_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),H(je(c.userId,n)))}else Y&&us&&_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),H(Ie(c.userId,n))),Y&&ds&&_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),H(je(c.userId,n)));if(Y){ne.identify(c.userId,{tenant_id:n});const W=n==null||n!=null&&(b==="Completed"||b==="Error");o==="Completed"||b!=="Not-Started"&&b!=="Error"||n==null||!_.shouldFetchActiveTenant(n)||(_.markActiveTenantFetchStarted(n),N(F.TENANT_FETCHING),H(Ns(c.userId,n,c.zeniSessionId))),W&&(o==="Not-Started"||o==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(ge(c.userId,c.zeniSessionId)))}})(T,p,r,f,j,O,A))}),[f,p]),P.useEffect((()=>{D.isSignedIn()&&T==="Completed"&&q.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),D.saveSignedInUserTenants(Ds(q.tenantsBaseInOrder)),j!=null&&fe(j,r,V,void 0,q.tenantsBaseInOrder))}),[q,T,r,j]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&f!=null?(v(),_.markActiveTenantFetchCompleted(f)):p==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,f,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(o=un,b=3e3){setTimeout((()=>{const d=n=>{if(n>=o.length)return;const c=o[n],N=ln[c];N!=null?N().then((()=>te((()=>d(n+1))))).catch((()=>te((()=>d(n+1))))):d(n+1)};te((()=>d(0)))}),b)})())}),[p,L]);const U=r?.userRole!=null&&ys(r?.userRole),{isFeatureEnabled:ze}=S(M.isReferralFeatureEnabled),qe=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ye=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Be&&!U,We=Cs(h?.loggedInUserRoleMap),Je=r.externalConnections?.accounting[0]?.isValid,Ke=r.externalConnections?.fetchState==="Completed",se=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&vs(h?.loggedInUserRoleMap),_e=Fe&&!U,Qe=Le&&!U,Xe=ue&&Os(h?.loggedInUserRoleMap),es=de&&Us(h?.loggedInUserRoleMap),ss=_e&&Ps(h?.loggedInUserRoleMap),ns=ws(h?.loggedInUserRoleMap),ts=Fs(h?.loggedInUserRoleMap),as=Ls(h?.loggedInUserRoleMap),os=Vs(h?.loggedInUserRoleMap),rs=ks(h?.loggedInUserRoleMap),g=Hs(h?.loggedInUserRoleMap),x=Bs(h?.loggedInUserRoleMap),Ee=ue&&g,he=ce&&x,R=_e&&as,I=Qe&&os,m=de&&rs,is=r.excludedResources?.resources?.find((o=>o.resource==="/invites"))!=null||Ge===!0||We===!0||ns===!0||ts===!0;return D.isSignedIn()?f==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(j!=null&&T!=="In-Progress"&&A(ge(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(se===!0||J&&!X)&&Ke&&Je!==!0&&E===!1&&K===!1&&re===!1?(a(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||se!==!0||X||J?!L||se!==!1||X||J?L&&r?.userRole&&E!=null&&K!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(zs,{children:e.jsxs(t,{element:e.jsx(sn,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Un,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,isTenantCardsOnly:K,showChargeCardRoute:m})}),e.jsx(t,{path:"dashboard/*",element:w?e.jsx(gn,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reports/*",element:w?e.jsx(dn,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"people/*",element:is||w?e.jsx(mn,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"forecast/*",element:w?e.jsx(_n,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(En,{})}),e.jsx(t,{path:"transaction/*",element:w&&U===!1||qe||Ye?e.jsx(pn,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"transactions/*",element:w&&U===!1?e.jsx(Tn,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"customer/*",element:w&&U===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isTenantBankingOnly:E,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"vendor/*",element:w&&U===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"tasks",element:e.jsx(On,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(Cn,{})}),e.jsx(t,{path:"address/*",element:Xe||me||ss||es?e.jsx(cn,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"checking/*",element:R?e.jsx(In,{}):e.jsx(C,{})}),e.jsx(t,{path:"treasury/*",element:I?e.jsx(jn,{}):e.jsx(C,{})}),e.jsx(t,{path:"performance",element:ae===!0?e.jsx(bn,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ae===!0&&U===!1?e.jsx(Dn,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(t,{path:"notifications/*",element:e.jsx(fn,{})}),e.jsx(t,{path:"vendors/*",element:Ze?e.jsx(hn,{}):e.jsx(C,{})}),e.jsx(t,{path:"bill/*",element:Ee?e.jsx(ve,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"bills/*",element:Ee?e.jsx(ve,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"settings/*",element:Se?e.jsx(xn,{hasAdminLevelAccess:me}):e.jsx(C,{})}),e.jsx(t,{path:"invoicing/*",element:Me?e.jsx(Rn,{}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask",element:m&&Z?e.jsx(Ue,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ue,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"cards/*",element:m?e.jsx(An,{}):e.jsx(C,{})}),e.jsx(t,{path:"rewards/*",element:ze?e.jsx(yn,{}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Z?e.jsx(vn,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"*",element:e.jsx(C,{})})]})}):null:(a(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(a(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),a(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{y as F,Sn as S};
@@ -1 +0,0 @@
1
- import{j as u}from"./liveblocks-BlM-yJIK.js";import{a as f,R as x,q as A}from"./sentry-CoUvtkTT.js";import{u as z,h as D,j as l,g as M,N as j,l as O}from"./core-BZ1rdEBJ.js";import{u as P,z as s,E as _,k as w,G as B,R as F,S as N,T as R,V,W,X as v}from"./index-CTFYwhi_.js";import{fB as X,SX as $,Tb as q,ge as J,gg as G,Tg as H,gR as K,df as Q,Th as T,Ti as Y,Tj as Z,b_ as y}from"./zeni-epic-state-CRmviUHA.js";import"./mui-BFHFLIBn.js";import{u as ee}from"./useDeviceId-Cm20XW3g.js";import{f as te}from"./analyticsHelper-CcegxGUw.js";import{t as ne}from"./getLocaleForTenant-pNMINwIt.js";import"./recharts-Cp8vAfrX.js";import"./analytics-DZ_IK-Kq.js";import"./plaid-B4PUsiXy.js";import"./dnd-DzXS-Yl8.js";import"./stripe-cKAAJElX.js";import"./lottie-BRnok4t-.js";import"./lexical-CXbrQPvX.js";import"./pdf-CCE45QO9.js";import"./utils-BKpHrBI5.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]="aa5b7564-a919-4761-81c1-26a63756f22d",t._sentryDebugIdIdentifier="sentry-dbid-aa5b7564-a919-4761-81c1-26a63756f22d")}catch{}})();const ie=O((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Y(n,a)))},clearSignInError:()=>{t(T())}}}))(W),ae=x.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=P(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:b,accountUnlockTime:k}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>X(e))),I=l((e=>$(e))),m=M(),E=_().mode,C=m.state?.magicLinkExpired,U=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),f.useEffect((()=>{t(void 0)}),[]),f.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(q(I.tenantsInOrder),o.zeniSessionId),J(o.userId,o.zeniSessionId,r.tenantId),i(G(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),K().then((()=>{const e=V();e!=null&&F(e)})),setTimeout((()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",Q(r.productSettings))}),2e3))}),[S,p,L,o,r,I,E,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(j,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&k!=null?u.jsx(R,{onClose:()=>i(T()),unlockDate:k}):null]})}export{ve as default};
@@ -1,9 +0,0 @@
1
- import{j as s}from"./liveblocks-BlM-yJIK.js";import{a as i}from"./sentry-CoUvtkTT.js";import{u as l,g as d,N as u}from"./core-BZ1rdEBJ.js";import{z as n,k as a,S as m,a5 as p}from"./index-CTFYwhi_.js";import{gU as g,Tx as y}from"./zeni-epic-state-CRmviUHA.js";import{n as b}from"./mui-BFHFLIBn.js";import"./recharts-Cp8vAfrX.js";import"./analytics-DZ_IK-Kq.js";import"./plaid-B4PUsiXy.js";import"./dnd-DzXS-Yl8.js";import"./stripe-cKAAJElX.js";import"./lottie-BRnok4t-.js";import"./lexical-CXbrQPvX.js";import"./pdf-CCE45QO9.js";import"./utils-BKpHrBI5.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]="f63f29c7-2bf9-45ec-94b2-1a28354962a9",e._sentryDebugIdIdentifier="sentry-dbid-f63f29c7-2bf9-45ec-94b2-1a28354962a9")}catch{}})();function N(){const e=l(),t=d(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(c){console.error("Error during sign out:",c)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `;export{N as default};
@@ -1,9 +0,0 @@
1
- import{j as C}from"./liveblocks-BlM-yJIK.js";import{a as T}from"./sentry-CoUvtkTT.js";import{h as pa,u as fa,g as Ta,k as ga,j as F,i as _a,l as ma}from"./core-BZ1rdEBJ.js";import{aI as ba,aJ as Da,z as $,I as Sa,d as G,aq as ha,a6 as Ea,k as ya,S as Aa,e1 as Ca,p as w,a2 as Ga}from"./index-CTFYwhi_.js";import{fB as Ia,a0W as Y,Q6 as B,a0X as H,a0S as Ba,Pu as Q,a0Y as va,PC as W,Pc as Ka,OQ as La,Q7 as q,a0Z as V,gd as Pa,PZ as wa,Q2 as Ra,PR as Ua,PP as J,Q3 as Fa,PM as ja,a0_ as $a,a0$ as xa,a10 as Oa,a11 as Na,a12 as I,dt as Za,ds as za,a13 as Ma,P9 as Qa}from"./zeni-epic-state-CRmviUHA.js";import{n as Wa}from"./mui-BFHFLIBn.js";import{u as qa}from"./useAskAiCfoHostNavButtonProps-fRSEHozy.js";import{M as Va}from"./MobileAppDrawer-Cwqn_b45.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]="ebe7f48d-9921-4930-a0f3-3fb72864b653",e._sentryDebugIdIdentifier="sentry-dbid-ebe7f48d-9921-4930-a0f3-3fb72864b653")}catch{}})();const c={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},Ja=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),Xa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),R=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Ya=e=>{if(e==null||typeof e!="object")return null;const a=e,n=typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null;if(n==null||typeof a.tenant_id!="string"||typeof a.event_type!="string")return null;const o={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(o.is_private=a.is_private),R(a.assignees)&&(o.assignees=a.assignees),R(a.direct_assignees)&&(o.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(o.created_by=a.created_by),R(a.task_group_ids)&&(o.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(o.name=a.name),typeof a.parent_task_id=="string"&&(o.parent_task_id=a.parent_task_id),o},Ha=e=>{if(e==null||typeof e!="object")return null;const a=e;return R(a.task_ids)?{task_ids:a.task_ids}:null},pe=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},ae=e=>{const{events:a,onEvent:n,onSubscribed:o}=e,i=ba(),g=T.useRef(n),l=T.useRef(o),_=T.useRef(0);T.useEffect((()=>{g.current=n}),[n]),T.useEffect((()=>{l.current=o}),[o]);const t=T.useMemo((()=>[...a].sort().join("|")),[a]);T.useEffect((()=>{if(i==null||a.length===0)return;const s=[],p=new Set,S=()=>{if(l.current==null)return;const m=Date.now();m-_.current<5e3||(_.current=m,l.current())};return a.forEach((m=>{const[b,D]=Da(m);if(D==="")return;const E=i.channel(b),y=f=>{g.current(D,f)};let k;if(E?.subscribed===!0){if(k=E,k.bind(D,y),!p.has(b)){p.add(b),S();const f=()=>{S()};k.bind("pusher:subscription_succeeded",f),s.push((()=>{k.unbind("pusher:subscription_succeeded",f)}))}s.push((()=>{E.unbind(D,y)}))}else{if(k=E??i.subscribe(b),k.bind(D,y),!p.has(b)){p.add(b);const f=()=>{S()};k.bind("pusher:subscription_succeeded",f),s.push((()=>{k.unbind("pusher:subscription_succeeded",f)}))}s.push((()=>{k.unbind(D,y)}))}})),()=>{s.forEach((m=>m()))}}),[i,t])},ee=Wa.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,te=ma((function(e,a){const n=Y(e,a.isTaskTemplatesEnabled),{taskGroupId:o}=a,i=o!=null&&o!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((t=>({...t,tasks:t.tasks.filter((s=>s.taskGroupIds.includes(o)))}))).filter((t=>t.tasks.length>0))}:n,g=Ba(e),l=$.isZeniUser(),_=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:i,tagListView:g,localData:i.localData,isTaskTemplatesEnabled:a.isTaskTemplatesEnabled,isZeniUser:l,subTaskCreateStatus:_}}),(function(e,a){const{navigate:n,currentTenant:o,location:i,isTaskTemplatesEnabled:g}=a,{tenantEmailDomain:l}=o,{groupByKey:_}=a.uiState;return{onTaskManagementRowClick:t=>{const s=X(l,t),p=w(i.state?.pathnameStackToGoBack,i.pathname);n(s,{state:{pathnameStackToGoBack:p}})},onReloadTasks:()=>{e(B(!0,g))},onTabChange:t=>{e(Na(t))},onParentTaskClick:t=>{const s=X(l,t);window.open(s,"_blank","noopener")},bulkUpdateTasks:(t,s)=>{e(J(t,null,s))},onNewTaskClick:()=>{if(a.localData.defaultTaskGroupId!=null){const t=j(l,a.localData.defaultTaskGroupId),s=w(i.state?.pathnameStackToGoBack,i.pathname);n(t,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(t,s)=>{e(V({uiState:{sortKey:t,sortOrder:s}}))},onFiltersChange:t=>{e(Oa({filters:t}))},onSearchTextChanged:t=>{e(xa({searchText:t}))},onReloadCards:()=>{e(B(!0,g))},onBackClick:()=>{if(i.state?.message==="triggerBackClick"){const t=Ga(i.state?.pathnameStackToGoBack),s=t.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:t.newStack}})}else n("../")},updateLocalData:t=>{e($a({localData:t}))},resetLocalData:()=>{e(H({taskGroupById:a.taskGroupState.taskGroupById}))},handleCreateGroup:t=>{e(ja(a.localData.newTaskGroupName,t))},assignGroupToTasks:t=>{e(J(a.localData.selectedTaskIds,t,Fa(a.uiState.groupByKey,t)))},onDeleteTaskGroup:t=>{e(Ua(t))},onAddNewTaskToTaskGroup:t=>{if(a.localData.defaultTaskGroupId!=null){const s=ne(_,t);e(Q({taskDetailLocalData:s}));const p=j(l,a.uiState.groupByKey==="groupName"?t:a.localData.defaultTaskGroupId),S=w(i.state?.pathnameStackToGoBack,i.pathname);n(p,{state:{pathnameStackToGoBack:S,message:"comingFromTaskListPage"}})}},onDragNDrop:(t,s)=>{e(Ra(a.localData.selectedTaskIds.length>0?a.localData.selectedTaskIds:[t],s))},onTaskGroupRename:(t,s)=>{e(wa(t,s))},onTimeSpentUpdate:(t,s)=>{e(q({task:t,updates:s}))},onShowToast:t=>{e(Pa(t))},onGroupByFilterChange:t=>{e(V({uiState:{groupByKey:t}}))},updateTask:(t,s)=>{e(q({task:t,updates:s}))},onCreateTagClick:(t,s)=>{e(La(t,s))},onSubtaskCreation:(t,s)=>{e(Ka({...s,parentTaskId:t}))},handleGroupTemplateClick:t=>{e(W(t,[]))},handleGroupTemplateTaskClick:(t,s)=>{e(W(t,[s]))},handleNewTaskInitialization:t=>{if(e(Q({taskDetailLocalData:{...va,name:t}})),a.localData.defaultTaskGroupId!=null){const s=j(l,a.localData.defaultTaskGroupId),p=w(i.state?.pathnameStackToGoBack,i.pathname);n(s,{state:{pathnameStackToGoBack:p,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:t=>{n(`/${l}/tasks/group/${t}`)},onQuickResponsesClick:()=>{n(`/${l}/tasks/quick-responses`)}}}))(Ca);function se(){const e=pa(),a=fa(),n=Ta(),o=$.getSignedInUser(),i=$.isZeniUser(),g=ga(),l=F((u=>Ia(u))),{taskGroupId:_}=_a(),{useFeatureGate:t}=Sa(),{isFeatureEnabled:s}=t(G.isTaskTemplatesEnabled),{isFeatureEnabled:p}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:S}=t(G.isTaskCategorizationEnabled),{isFeatureEnabled:m}=t(G.isTaskBulkResolutionEnabled),{isFeatureEnabled:b}=t(G.isTaskGroupAssigneesEnabled),{isFeatureEnabled:D}=t(G.isTaskRecurringParentEnabled),[E,y]=T.useState(!1),k=F((u=>Y(u,s))),f=F((u=>u.taskGroupState)),v=k.fetchState,{isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea}=qa({mobileExploreReferrer:"Task Checklist"});ha({isDataReady:v==="Completed"}),T.useEffect((()=>{a(B(!1,s))}),[l?.tenantId,a,s]);const ta=T.useMemo((()=>{const u=[c.TASK_CREATED,c.TASK_UPDATED,c.TASKS_BULK_UPDATED,c.TASKS_BULK_DELETED],A=[c.TASK_CREATED,c.TASK_UPDATED,c.TASK_SNOOZE_RESURFACED,c.TASKS_BULK_UPDATED];return[...Ja(l?.companyId,u),...Xa(o?.userId,A)]}),[l?.companyId,o?.userId]);if(ae({events:ta,onEvent:(u,A)=>{switch(u){case c.TASK_CREATED:case c.TASK_UPDATED:{const r=Ya(A);if(r!=null){const P=g.getState(),x=r.task_id,h=x!=null?P.taskState.taskByID?.[x]:void 0,U=h!=null;if(!i)if(r.is_private===!0){if(!U)return}else{const K=o?.userId,L=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&L.add(r.created_by),!(K!=null&&L.has(K))&&!U)return}if(u===c.TASK_UPDATED&&U&&h!=null&&Array.isArray(r.task_group_ids)){const K=new Set(Object.values(P.taskGroupState.taskGroupById??{}).filter((d=>d!=null&&!d.isDeleted)).map((d=>d.id))),L=(h.taskGroupIds??[]).filter((d=>K.has(d))),O=(r.task_group_ids??[]).filter((d=>K.has(d))),sa=L.length===O.length&&L.every((d=>O.includes(d))),N=h.taskGroupIds??[],Z=r.task_group_ids??[],na=N.length!==Z.length||!N.every((d=>Z.includes(d))),oa=(d,da)=>{const z=d??[],M=da??[];if(z.length!==M.length)return!1;const ca=new Set(M);return z.every((ka=>ca.has(ka)))},ra=r.name==null||r.name===h.name,ia=r.is_private==null||r.is_private===h.isPrivate,la=r.assignees==null||oa(r.assignees,h.assignees),ua=r.direct_assignees==null;if(sa&&na&&ra&&ia&&la&&ua)return}}return void a(B(!0,s))}case c.TASKS_BULK_DELETED:{const r=Ha(A);return r==null?void 0:void r.task_ids.forEach((P=>a(Qa(P))))}case c.TASKS_BULK_UPDATED:case c.TASK_SNOOZE_RESURFACED:return void a(B(!0,s))}},onSubscribed:()=>{a(B(!0,s))}}),T.useEffect((()=>{v==="Completed"&&a(H({taskGroupById:f.taskGroupById}))}),[v,f.taskGroupById]),o==null)throw Error("Can't access task list page without signing in...");return C.jsxs(C.Fragment,{children:[v==="Completed"?C.jsx(Ea,{analytics:ya,onLoad:u=>(A=>A.trackPageLoaded(Aa.Event.taskListPage))(u)}):null,C.jsxs(ee,{children:[C.jsx(Va,{isAppContentDrawerOpen:E,handleDrawerToggle:u=>{y(u)}}),C.jsx(te,{location:n,navigate:e,currentTenant:l,taskGroupId:_,taskGroupState:f,localData:k.localData,uiState:k.uiState,isTaskTemplatesEnabled:s,taskListFetchState:v,isTaskCategorizationEnabled:S,isTaskCannedResponsesEnabled:p,isTaskBulkResolutionEnabled:m,isTaskGroupAssigneesEnabled:b,isTaskRecurringParentEnabled:D,isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea})]})]})}const X=(e,a)=>`/${e}/tasks/${encodeURIComponent(a)}`,j=(e,a)=>`/${e}/tasks/new/${a}`,ne=(e,a)=>{if(e==="assignee"){const n=a.split(",");return{...I.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Za(a);return{...I.taskDetailLocalData,priority:n}}if(e==="status"){const n=za(a);return{...I.taskDetailLocalData,status:n}}if(e==="tag"){const n=a.split(",");return{...I.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=Ma(a);return{...I.taskDetailLocalData,dueDate:n}}return{...I.taskDetailLocalData}},fe=Object.freeze(Object.defineProperty({__proto__:null,default:se},Symbol.toStringTag,{value:"Module"}));export{c as T,Xa as a,Ja as b,Ha as c,Ya as d,se as e,fe as f,pe as t,ae as u};
@@ -1,9 +0,0 @@
1
- import{j as r}from"./liveblocks-BlM-yJIK.js";import de from"./NotFoundScreen-75_Gn0cI.js";import{a as k}from"./sentry-CoUvtkTT.js";import{h as J,u as ee,j as E,g as ue,i as ke,N as pe,l as me,n as Se,o as b}from"./core-BZ1rdEBJ.js";import{P1 as ae,P4 as fe,O_ as Te,YN as ge,fB as te,a0S as se,Pq as g,Pi as T,OX as he,PW as be,PP as Ee,a0T as ne,gd as oe,a0U as Z,OT as Ie,OQ as De,u1 as Ce,tR as Ge,md as Pe,Pg as _e,a0V as ye,Q7 as Re,Pc as Ue,PB as Be,Py as xe,P7 as ve,Pv as we,Pu as Ae}from"./zeni-epic-state-CRmviUHA.js";import{z as _,d$ as je,c as Fe,I as Le,d as G,a2 as ie,p as P,a6 as Ke,k as M,S as $e,e0 as Oe,X as Q,ac as Ne}from"./index-CTFYwhi_.js";import{n as Ve}from"./mui-BFHFLIBn.js";import{u as ze}from"./useInitialThreadRequest-DLJzdGrt.js";import{M as qe}from"./MobileAppDrawer-Cwqn_b45.js";import{b as Ze,a as Me,u as Qe,T as f,t as We,c as W,d as X,e as Xe}from"./TaskListScreen-J9jUMTBb.js";import"./recharts-Cp8vAfrX.js";import"./analytics-DZ_IK-Kq.js";import"./plaid-B4PUsiXy.js";import"./dnd-DzXS-Yl8.js";import"./stripe-cKAAJElX.js";import"./lottie-BRnok4t-.js";import"./lexical-CXbrQPvX.js";import"./pdf-CCE45QO9.js";import"./utils-BKpHrBI5.js";import"./InboxNotificationsProvider-5qCqmUI8.js";import"./useTaskManagerAccess-D9-djiWT.js";import"./useAskAiCfoHostNavButtonProps-fRSEHozy.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]="3db9fd63-e5e6-40c9-aa83-3c5833b754de",e._sentryDebugIdIdentifier="sentry-dbid-3db9fd63-e5e6-40c9-aa83-3c5833b754de")}catch{}})();function Ye(){const e=J(),a=ee(),n=_.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:d}=E((o=>o.cannedResponsesState)),u=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,I,D)=>{a(fe({name:o,content:I,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(Te({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(je,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:u,onSave:m})}const L=e=>e?.taskState?.taskByID,j=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},He=ge([j,(e,a)=>{const n=j(e,a),c=L(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=j(e,a),c=L(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let Y,H=[];const Je=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),d=te(e),u=He(e,a.taskId),m=s.taskGroupId??c,t=m!=null?Z(e.taskGroupState,m):void 0,o=_.getSignedInUser(),I=d.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:I??""},B=se(e),{tenantEmailDomain:x}=d,y=s.recurringSourceTaskId,v=y!=null?`${Q.appUrl}/${x}/tasks/${encodeURIComponent(y)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:_.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==Y&&(Y=h,H=Object.values(h)),H),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Ne.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${Q.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:v,tagListView:B,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>Z(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:u,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:d,taskGroupId:u}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(Ae({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(we(n,t??u))},onArchiveTaskClick:()=>{a.taskId!=null&&e(ve(a.taskId))},onSnoozeTask:(t,o)=>{e(xe(t,o))},onUnsnoozeTask:t=>{e(Be(t))},onCreateSubtask:(t,o)=>{e(Ue({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(Re({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:P(d.state?.pathnameStackToGoBack,d.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:P(d.state?.pathnameStackToGoBack,d.pathname)}})},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const t=ie(d.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=U(m),o=P(d.state?.pathnameStackToGoBack,d.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(ye({taskId:n}))},onDeleteTaskClick:()=>{e(_e(n))},updateFilesEntity:t=>{e(Pe({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(g(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ie(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))(Oe);function F(){const e=J(),a=ee(),n=ue(),c=Fe(),{taskId:s,taskGroupId:d}=ke(),u=E((i=>te(i))),m=ze(u?.companyId),{useFeatureGate:t}=Le(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:I}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:B}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:x}=t(G.isTaskGroupAssigneesEnabled),[y,v]=k.useState(!1),[h,S]=k.useState(!1),[K,re]=k.useState(!1),[$,w]=k.useState(!1),C=k.useRef(!1),R=E((i=>i.taskListState.updateTasksFetchState.fetchState)),O=E((i=>se(i))),N=E((i=>i.taskGroupViewState.fetchState));k.useEffect((()=>{a(g(!1,s)),s!=null&&a(T(s))}),[a,s]);const V=_.getSignedInUser()?.userId,ce=k.useMemo((()=>{const i=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],l=[...i,f.TASK_SNOOZE_RESURFACED];return[...Ze(u?.companyId,i),...Me(V,l)]}),[u?.companyId,V]);Qe({events:ce,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(i,l)=>{if(s!=null)switch(i){case f.TASK_CREATED:{X(l)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=X(l);if(p==null)break;p.task_id===s?(a(g(!0,s)),a(T(s))):p.parent_task_id===s&&a(T(s));break}case f.TASKS_BULK_UPDATED:{const p=W(l);if(p==null)break;p.task_ids.includes(s)&&a(g(!0,s)),a(T(s));break}case f.TASKS_BULK_DELETED:{const p=W(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),u?.tenantEmailDomain!=null&&e(U(u.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{We(l)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||O.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,O.fetchState]),k.useEffect((()=>{K||N==="Completed"||(re(!0),a(be()))}),[K,a,N]);const le=k.useCallback((()=>{s!=null&&(C.current=!1,a(Ee([s],null,{isArchived:!1})),w(!0))}),[a,s]);k.useEffect((()=>{if($)if(R!=="In-Progress"){if(C.current){if(R==="Error")return w(!1),void(C.current=!1);if(R==="Completed"){w(!1),C.current=!1;const{tenantEmailDomain:i}=u;if(n.state?.message==="triggerBackClick"){const l=ie(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=U(i);e(l,{state:{pathnameStackToGoBack:P(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[$,R,u,n,e]);const z=E((i=>ne(i,s))),A=z.fetchState,q=_.getSignedInUser();if(q==null)throw Error("Can't access task detail page without signing in...");if(A==="Error"&&z.error?.code===400){const{tenantEmailDomain:i}=u,l=U(i),p=P(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[A==="Completed"?r.jsx(Ke,{analytics:M,onLoad:i=>(l=>l.trackPageLoaded($e.Event.taskDetailPage))(i)}):null,r.jsxs(ea,{children:[r.jsx(qe,{isAppContentDrawerOpen:y,handleDrawerToggle:i=>{v(i)}}),r.jsx(Je,{analytics:M,currentTenant:u,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:q,navigate:e,taskGroupId:d,taskId:s,taskDetailFetchState:A,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:B,isTaskGroupAssigneesEnabled:x})]})]})}const ea=Ve.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,U=e=>`/${e}/tasks`;function Da(){return r.jsxs(Se,{children:[r.jsx(b,{path:"/new",element:r.jsx(F,{})}),r.jsx(b,{path:"/new/:taskGroupId",element:r.jsx(F,{})}),r.jsx(b,{path:"/group/:taskGroupId",element:r.jsx(Xe,{})}),r.jsx(b,{path:"/quick-responses",element:r.jsx(Ye,{})}),r.jsx(b,{path:"/:taskId",element:r.jsx(F,{})}),r.jsx(b,{path:"*",element:r.jsx(de,{})})]})}export{Da as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-BlM-yJIK.js";import i from"./NotFoundScreen-75_Gn0cI.js";import{T as r}from"./TransactionDetailScreen-CYqaDKU1.js";import"./sentry-CoUvtkTT.js";import{n as a,o}from"./core-BZ1rdEBJ.js";import"./zeni-epic-state-CRmviUHA.js";import"./recharts-Cp8vAfrX.js";import"./index-CTFYwhi_.js";import"./mui-BFHFLIBn.js";import"./analytics-DZ_IK-Kq.js";import"./plaid-B4PUsiXy.js";import"./dnd-DzXS-Yl8.js";import"./stripe-cKAAJElX.js";import"./lottie-BRnok4t-.js";import"./lexical-CXbrQPvX.js";import"./pdf-CCE45QO9.js";import"./utils-BKpHrBI5.js";import"./useAskAiCfoHostNavButtonProps-fRSEHozy.js";import"./decodeURIComponentSafe-Bqc80Z_5.js";import"./useInitialThreadRequest-DLJzdGrt.js";import"./routePaths-B_N5gTZd.js";import"./expenseAutomationHelper-L0bEaNW0.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]="9520d72a-46e5-44e2-9697-a97671635162",e._sentryDebugIdIdentifier="sentry-dbid-9520d72a-46e5-44e2-9697-a97671635162")}catch{}})();function z(){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{z as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-BlM-yJIK.js";import{h as Q,g as N,u as W,i as X,j as h,N as U,l as Z,n as Me,o as C}from"./core-BZ1rdEBJ.js";import{fB as H,tg as ee,kV as p,et as te,R4 as Se,br as pe,_E as Be,lF as ae,Vj as ne,_F as fe,_G as Fe,bE as k,R0 as ge,_H as Le,_I as Te,_J as Oe,R3 as he,_K as _e,_L as De,_M as Ge,_N as Ie,_O as ze,_P as we,_Q as ye,Sg as Re}from"./zeni-epic-state-CRmviUHA.js";import{I as ce,d as q,k as L,G as ke,da as oe,p as w,a2 as se,ao as $e,F as Ve}from"./index-CTFYwhi_.js";import"./mui-BFHFLIBn.js";import{a as y}from"./sentry-CoUvtkTT.js";import{w as ie}from"./withTransactionSidePanel-DeFt4H26.js";import{p as re,c as de}from"./routePaths-B_N5gTZd.js";import{x as Je}from"./utils-BKpHrBI5.js";import{d as j}from"./decodeURIComponentSafe-Bqc80Z_5.js";import{Z as qe}from"./ZeniAccountStatementScreen-y7BZNAye.js";import"./recharts-Cp8vAfrX.js";import"./analytics-DZ_IK-Kq.js";import"./plaid-B4PUsiXy.js";import"./dnd-DzXS-Yl8.js";import"./stripe-cKAAJElX.js";import"./lottie-BRnok4t-.js";import"./lexical-CXbrQPvX.js";import"./pdf-CCE45QO9.js";import"./useAskAiCfoHostNavButtonProps-fRSEHozy.js";import"./TransactionDetailScreen-CYqaDKU1.js";import"./useInitialThreadRequest-DLJzdGrt.js";import"./expenseAutomationHelper-L0bEaNW0.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]="d2dda858-06f7-4700-89b2-d272be9b7dbf",a._sentryDebugIdIdentifier="sentry-dbid-d2dda858-06f7-4700-89b2-d272be9b7dbf")}catch{}})();const Ne=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>Je(a),Ye=()=>{const{common:a,uncategorizedTransactionList:e}=ke.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},Ue=Z((function(a,e){const t=Be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=J(e.selectedAccount.tranListType),d=Qe(t,n,c,o,e.bookCloseDate);L.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(fe({uiState:{dateRange:d},type:J(e.selectedAccount.tranListType)})),a(Se(o,p(d),!1,o==="missingReceipts"?Ye():void 0)),e.onSelectedTimePeriodChange(p(d))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(oe),V=ie((function({...a}){const e=Q(),t=N(),n=W(),c=t.pathname.split("/").find((l=>Ne.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=X(),{accountType:Y,title:b,subTitle:A}=He(o),f="month",T=h((l=>H(l))),v=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ce(),{isFeatureEnabled:g}=S(q.isProjectsTransactionsEnabled),I=h((l=>ee(l)))&&g,{dataAvailable:x,initialTimeframeTick:O}=Ke(o,v,T.bookCloseDate),[P,_]=y.useState(!1),[E,G]=y.useState(void 0),u=y.useMemo((()=>{const l=p(O);return{tranListType:o,accountType:te(Y),title:b,subTitle:A,timeframe:f,period:l}}),[o,f,Y,x]);y.useEffect((()=>{if(!P&&u!=null){_(!0),L.trackTransactionList(void 0,void 0,void 0,u.title);const l=J(u.tranListType);n(Se(l,u.period,!0,l==="missingReceipts"?Ye():void 0))}}),[P,u,n]);let M=u;return u!=null&&E!=null&&(M={...u,period:E}),c==null||M==null?s.jsx(U,{to:"../"}):s.jsx(Ue,{firstMonthOfFY:v,tenantEmailDomain:d,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:x,navigate:e,showProjectField:I,selectedAccount:M,referrerType:o,bookCloseDate:T.bookCloseDate,onSelectedTimePeriodChange:l=>G(l),...a})})),He=a=>{let e="",t="";const n=ke.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.common.texts.uncategorizedExpenses;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.common.texts.receipts}return{accountType:e,title:t,subTitle:""}},Ke=(a,e,t)=>{const n=pe();let c=pe().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:re(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Qe=(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},We=Z((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??be();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),Xe=ie((function({referrerType:a,...e}){const t=Q(),n=N(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,classIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=X(),S=j(d??""),g=j(Y??""),I=j(b??""),x=j(v??""),O=h((r=>Fe(r.transactionListState,g,S,I))),[P,_]=y.useState(!1),[E,G]=y.useState(void 0),u=h((r=>H(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(q.isProjectsTransactionsEnabled),z=h((r=>ee(r)))&&m;let i;const F=Ze(S,g,I,A,f,T,x);if(F){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},$=et(O?.dateRange,r);i={accountId:g,accountType:te(S),classId:I,title:x,timeframe:A,period:$}}y.useEffect((()=>{P||i==null||(_(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(ge(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const R=[d,Y,b,A,f,T,v].filter((r=>r!=null));return F&&B!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:z,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>G(r),...e}):s.jsx(U,{to:be(R.length)})})),be=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ze=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),tt=Z((function(a,e){const t=_e(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ve();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(he(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=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,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),at=ie((function({referrerType:a,...e}){const t=Q(),n=N(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,projectIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=X(),S=j(d??""),g=j(Y??""),I=j(b??""),x=j(v??""),O=h((r=>Oe(r.transactionListState,g,S,I))),[P,_]=y.useState(!1),[E,G]=y.useState(void 0),u=h((r=>H(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(q.isProjectsTransactionsEnabled),z=h((r=>ee(r)))&&m;let i;const F=nt(S,g,I,A,f,T,x);if(F){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},$=ct(O?.dateRange,r);i={accountId:g,accountType:te(S),projectId:I,title:x,timeframe:A,period:$}}y.useEffect((()=>{P||i==null||(_(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const R=[d,Y,b,A,f,T,v].filter((r=>r!=null));return F&&B!=null?s.jsx(tt,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:z,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>G(r),...e}):s.jsx(U,{to:ve(R.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},nt=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,ct=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ot=Z((function(a,e){const t=ze(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&we(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Pe();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Ie(e.selectedAccount.accountId,e.selectedAccount.accountType,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=rt(e.tenantEmailDomain),n=w(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),Ae=ie((function({referrerType:a,...e}){const t=Q(),n=N(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,timeframe:b,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:v}=X(),S=j(d??""),g=j(Y??""),I=j(T??""),x=!(v!=null&&v==="exclude_subaccounts"),O=h((D=>Ge(D.transactionListState,g,S))),[P,_]=y.useState(!1),[E,G]=y.useState(void 0),u=h((D=>H(D))),M=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const z=st(S,g,b,A,f,I);if(z){const D={startDate:k(A,"YYYY-MM-DD"),endDate:k(f,"YYYY-MM-DD")},le=it(O?.dateRange,D);m={accountId:g,accountType:te(S),title:I,timeframe:b,period:le}}let i=m;m!=null&&E!=null&&(i={...m,period:E});const{useFeatureGate:F}=ce(),{isFeatureEnabled:B}=F(q.isTransactionCommentingEnabled),R=y.useCallback(((D,le)=>{if(o==null)return;const me=D.url.split(`/${o}/`)[1];if(me==null)return;const[je,xe]=me.split("?"),K=new URLSearchParams(xe??"");K.set("view","full"),K.set("thread_id",le),K.set("entity_type",D.entityType);const Ce=w(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${je}?${K.toString()}`,{state:{pathnameStackToGoBack:Ce}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:r}=F(q.isProjectsTransactionsEnabled),$=h((D=>ee(D)))&&r,{areTenantIdsInSync:ue}=$e();y.useEffect((()=>{!P&&m!=null&&ue&&(_(!0),L.trackTransactionList(m.accountId,void 0,a,m.title),c(Ie(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[P,m,c,ue]);const Ee=[d,Y,b,A,f,T].filter((D=>D!=null));return z&&i!=null?s.jsx(ot,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:M,isTransactionCommentingEnabled:B,onCommentThreadClick:R,showProjectField:$,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>G(D),...e}):s.jsx(U,{to:Pe(Ee.length)})})),Pe=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},st=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&k(n,"YYYY-MM-DD").isValid()&&k(c,"YYYY-MM-DD").isValid()&&o!=null,it=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),rt=a=>`/${a}/transactions/${Re}/statements`;function Mt(){const a=N().state?.referrer,e=h((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[h((n=>H(n))).tenantId],t=Ve();return s.jsxs(Me,{children:[s.jsx(C,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Ae,{referrerType:a})}),s.jsx(C,{path:"/zeni-clearing-account/statements",element:s.jsx(qe,{})}),s.jsx(C,{path:"/*",element:s.jsx(Ae,{referrerType:a})}),s.jsx(C,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/uncategorized-expense/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/miscategorized-expense/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/missing-receipts/*",element:t?s.jsx(U,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(C,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Xe,{referrerType:a})}),s.jsx(C,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(at,{referrerType:a})})]})}export{Mt as default};
@@ -1,37 +0,0 @@
1
- import{j as e}from"./liveblocks-BlM-yJIK.js";import{h as L,g as F,u as B,i as V,j as y,N as D,l as M,n as Te,o as k}from"./core-BZ1rdEBJ.js";import{cu as O,fB as v,Yb as U,Nu as ae,Nb as Z,Nc as ne,Yd as Ie,Nx as we,Y9 as Ce,Ya as se,Yp as ke,Ly as je,Bf as Ae,Yf as be,NE as Ee,Yc as re,d9 as q,FL as oe,dU as ve,dV as De,_B as Le,_C as Fe,Nd as Be,_D as Ue,Ne as Pe,Nn as Re,bq as Ne,bJ as Ve,cF as Me,bK as Oe,ct as _e,bt as ze,Tc as $e,cs as Ge}from"./zeni-epic-state-CRmviUHA.js";import{U as _,j as Ye,z as E,a6 as z,k as A,d3 as Ze,d4 as qe,d5 as Y,$ as H,E as He,ao as Ke,aq as We,I as ie,d as R,a9 as Je,a5 as Qe,d6 as Xe,ac as K,p as et,d7 as tt,a2 as W,d8 as at,ag as nt,Z as Q,d9 as st,h as rt}from"./index-CTFYwhi_.js";import{D as ot,n as N,S as it}from"./mui-BFHFLIBn.js";import ct from"./NotFoundScreen-75_Gn0cI.js";import{S as X}from"./SetupPagesScreen-BjTv-gJ-.js";import{a as p}from"./sentry-CoUvtkTT.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-fRSEHozy.js";import{u as ut}from"./useInitialThreadRequest-DLJzdGrt.js";import{M as ce}from"./MobileAppDrawer-Cwqn_b45.js";import{F as dt}from"./FeaturePreviewScreen-gRTJmh4o.js";import{a as ee}from"./analyticsHelper-CcegxGUw.js";import"./recharts-Cp8vAfrX.js";import"./analytics-DZ_IK-Kq.js";import"./plaid-B4PUsiXy.js";import"./dnd-DzXS-Yl8.js";import"./stripe-cKAAJElX.js";import"./lottie-BRnok4t-.js";import"./lexical-CXbrQPvX.js";import"./pdf-CCE45QO9.js";import"./utils-BKpHrBI5.js";import"./BusinessVerificationPageScreen-B3ZQAAhl.js";import"./routePaths-B_N5gTZd.js";import"./InboxNotificationsProvider-5qCqmUI8.js";import"./useTaskManagerAccess-D9-djiWT.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]="2f110050-1c73-47f5-9398-73528f4e69ca",t._sentryDebugIdIdentifier="sentry-dbid-2f110050-1c73-47f5-9398-73528f4e69ca")}catch{}})();const pt=M((function(t,a){const{companyId:n}=a;return{treasurySetupView:U(t,n),analytics:A}}),(function(t,a){const{navigate:n,analytics:o,treasurySetupView:i}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=i.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(we(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Ie(r))}}}))(Ze);function mt(){const t=L(),a=F(),n=B(),{tenantEmailDomain:o}=V(),i=_(),r=y((w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=Ye(r),s=O(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[S,T]=p.useState(!1),[l,u]=p.useState(!1),x=y((w=>v(w))),f=E.getSignedInUserTenant(o)?.companyId??x.companyId,C=E.getSignedInUser(),h=y((w=>U(w,f))),g=y((w=>w.treasurySetupViewState.fetchState)),j=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),I=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{d||g!=="Not-Started"||f==null||(c(!0),n(ae(f,!0,!1)))}),[d,g,f,n]),p.useEffect((()=>{l||I!=="Not-Started"||f==null||(u(!0),n(Z()))}),[l,I,f,n]),p.useEffect((()=>{S||j!=="Not-Started"||f==null||(T(!0),n(ne()))}),[S,j,f,n]),p.useEffect((()=>{m==="In-Progress"&&r==="Completed"&&t("../")}),[m,r,t]),x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(z,{analytics:A,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:P,isReadOnly:!s,treasurySetupView:h,analytics:A})]})}const ft=M((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:U(t,n)}}),(function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:i}=a,r=o.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{Y(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Y(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(be(s))},onFetchLinkTokenClick:s=>{t(Ae("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(qe),yt=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:o}=V(),i=B(),[r,m]=p.useState(!1),[s,d]=p.useState(!1),[c,S]=p.useState(!1),[T,l]=p.useState(!1),u=y((I=>I.treasurySetupViewState.fetchState)),x=y((I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((I=>v(I))),h=E.getSignedInUserTenant(o)?.companyId??C.companyId,g=y((I=>Ce(I))),j=y((I=>U(I,h)));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||h==null||(d(!0),i(ae(h,!0,!1)))}),[s,u,h,i]),p.useEffect((()=>{c||x!=="Not-Started"||h==null||(S(!0),i(Z()))}),[c,x,h,i]),p.useEffect((()=>{T||f!=="Not-Started"||h==null||(l(!0),i(ne()))}),[T,f,h,i]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:A,onLoad:()=>{}}),e.jsx(ft,{analytics:A,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:r,maxInsuredAmount:5e5,onReviewClick:()=>{Y(A,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},gt=N.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${t=>t.theme.colors.grey4};
9
- `,St={overlayWidth:new Je(100,100,48)},ht=M((function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:U(t,o),downloadEndPoint:`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}}),(function(t,a){const{navigate:n,currentTenant:o,location:i,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:d=>{let c="page-not-found";d==="editPortfolio"?c=xt(s):d==="statements"?c=Tt(s):d==="taxLetter"?c=It(s):d==="settings"&&(c=wt(s));const S=et(i.state?.pathnameStackToGoBack,i.pathname);n(c,{state:{pathnameStackToGoBack:S}})},onColumnSortConfigChanged:(d,c)=>{t(Le({uiState:{sortKey:d,sortOrder:c}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}}))(Xe);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=F(),o=L(),i=B(),r=H(),m=He(),s=y((b=>v(b))),{tenantEmailDomain:d}=V(),c=s.companyId??E.getSignedInUserTenant(d)?.companyId,[S,T]=p.useState(!1),l=y((b=>re(b))),u=l.fetchState,x=l.accountSummary?.totalBalance?.amount,f=y((b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus)),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=_(),g=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,j=O(h?.loggedInUserRoleMap),I=q(h?.loggedInUserRoleMap),{areTenantIdsInSync:P}=Ke();p.useEffect((()=>{u==="Not-Started"&&!S&&P&&(T(!0),i(oe(!0)))}),[S,i,u,P]),p.useEffect((()=>{l.transactionsFetchState.fetchState==="Completed"&&l.transactions.length===0&&!n.pathname.includes("transfer")&&j&&o("./transfer")}),[l.transactionsFetchState.fetchState,l.transactions.length,n.pathname,j,o]);const w=()=>{o("..")},[le,ue]=p.useState(!1),J=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});We({isDataReady:u==="Completed"});const{useFeatureGate:$}=ie(),{isFeatureEnabled:me}=$(R.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=$(R.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=$(R.isTreasuryCommentingEnabled),ge=ut(c,{clearParams:u==="Completed"&&f?.fetchState==="Completed"}),Se=ve(s),he=De(me,s);if(Se===!0&&he!==!0)return e.jsx(dt,{});if(C){const b=f?.fetchState!=="Completed"||l.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[l.accountSummaryFetchState.fetchState==="Completed"&&f?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:A,onLoad:()=>{}}):null,e.jsx(ot,{onClose:w,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:St.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(Ct,{onClick:xe=>xe.stopPropagation(),children:[t===!0?e.jsx(yt,{isFirstTransfer:l.transactions.length===0||x===0,isTransactionsLoaded:l.transactionsFetchState.fetchState!=="In-Progress"&&l.transactionsFetchState.fetchState!=="Not-Started"}):null,a===!0?e.jsx(mt,{}):null]})}),e.jsxs(gt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:J}),e.jsx(ht,{treasuryDetailsView:l,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:c,analytics:A,isTreasuryCommentingEnabled:ye,handleDrawerToggle:J,initialOpenThreadRequest:ge,isLoading:b,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return g&&j?e.jsx(D,{to:"../setup"}):s.companyTreasuryInfo?.info&&!g&&I?e.jsx(D,{to:"../promo",state:n.state}):e.jsx(Qe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const xt=t=>`/${t}/treasury/edit-portfolio`,Tt=t=>`/${t}/treasury/statements`,It=t=>`/${t}/treasury/tax-letter`,wt=t=>`/${t}/treasury/setup`,Ct=N(it)`
10
- display: flex;
11
- min-height: 100%;
12
- flex-direction: column;
13
- `,kt=N.div`
14
- display: flex;
15
- height: 100vh;
16
- width: 100%;
17
- flex: 1 1 auto;
18
- flex-direction: column;
19
- align-items: center;
20
- background-color: ${t=>t.theme.colors.grey4};
21
- `;function jt(){const t=L(),a=B(),n=H(),o=F(),i=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Fe(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Be(!1)))}),[r,s.fetchState,a]);const d=E.getSignedInUser(),c=y((u=>v(u))),S={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access statements page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(kt,{windowSize:n,children:e.jsx(tt,{currentTenantCompanyName:T,statementListView:s,isLoading:l,onBackClick:()=>{const u=W(o.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const At=N.div`
22
- display: flex;
23
- height: 100vh;
24
- width: 100%;
25
- flex: 1 1 auto;
26
- flex-direction: column;
27
- align-items: center;
28
- background-color: ${t=>t.theme.colors.grey4};
29
- `;function bt(){const t=L(),a=H(),n=F(),o=B(),i=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Ue(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Pe(!1)))}),[r,s.fetchState,o]);const d=E.getSignedInUser(),c=y((u=>v(u))),S={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access tax letter page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(At,{windowSize:a,children:e.jsx(at,{currentTenantCompanyName:T,taxLetterListView:s,isLoading:l,onBackClick:()=>{const u=W(n.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const Et=M((function(t,a){const{companyId:n}=a,o=U(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),(function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Re(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:i=>{n(i?"..":"../setup",{relative:"path"})}}}))(st),vt=()=>{const t=nt(),a=L(),n=F(),o=B(),{tenantEmailDomain:i}=V(),[r,m]=p.useState(!1),s=y((g=>v(g))),[d,c]=p.useState(!1),S=y((g=>g.treasurySetupViewState.treasuryFundsDetails?.fetchStatus));p.useEffect((()=>{d||S?.fetchState!=="Not-Started"||T==null||(c(!0),o(Z()))}),[S,o]);const T=E.getSignedInUserTenant(i)?.companyId??s.companyId,l=E.getSignedInUser(),u=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=g=>{m(g)};if(l==null)throw Error("Can't access treasury promo page without signing in...");const f=_(),C=O(f?.loggedInUserRoleMap),h=q(f?.loggedInUserRoleMap);if(u&&C)return e.jsx(D,{to:"../../treasury/setup"});if(s.company?.companyTreasuryInfo&&(!u&&C||h)){if(n.state?.message==="activation"){const g=W(n.state?.pathnameStackToGoBack);a(n.pathname,{state:{...n.state,message:void 0,pathnameStackToGoBack:g.newStack}})}return S?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(Q,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:A,onLoad:g=>(j=>j.trackTreasuryPromoView("Treasury Promo Page"))(g)}),e.jsx(ce,{isAppContentDrawerOpen:r,handleDrawerToggle:x}),e.jsx(Et,{analytics:A,navigate:a,companyId:T,meetingUrl:t("treasury_promo"),onClickMenuIcon:()=>{x(!0)}})]})}return e.jsx(te,{children:e.jsx(Q,{size:"ExtraLarge",start:!0})})},te=N.div`
30
- display: flex;
31
- width: 100%;
32
- height: 100%;
33
- flex-direction: row;
34
- justify-content: center;
35
- align-items: center;
36
- background-color: ${t=>t.theme.colors.grey5};
37
- `;function aa(){const t=F(),a=y((g=>v(g))),{useFeatureGate:n}=ie(),o=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",i=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=q(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Ne(a?.userRole),d=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ve(r?.loggedInUserRoleMap),c=Me(r?.loggedInUserRoleMap),S=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Oe(r?.loggedInUserRoleMap),T=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!s&&_e(r?.loggedInUserRoleMap),l=o&&!s&&O(r?.loggedInUserRoleMap),{isFeatureEnabled:u}=n(R.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=n(R.isDebitCardFeatureEnabled),f=rt(a,u,x)&&!s&&ze(r?.loggedInUserRoleMap),C=$e(r?.loggedInUserRoleMap),h=Ge(r?.loggedInUserRoleMap);return e.jsxs(Te,{children:[h?null:e.jsx(k,{path:"setup",element:e.jsx(X,{isBillPayAdminLevelAccess:d,isReimbursementAdminLevelAccess:S,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,isUserHasOnlyBillPayAccess:c,productType:"zeni_treasury",type:"setup"})}),h?null:e.jsx(k,{path:"verification",element:e.jsx(X,{isBillPayAdminLevelAccess:d,isUserHasOnlyBillPayAccess:c,isReimbursementAdminLevelAccess:S,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(vt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(bt,{})}),o?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(G,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),l?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(G,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(G,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ct,{})})]}):i&&l?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{aa as default};
@@ -1,12 +0,0 @@
1
- import{j as o}from"./liveblocks-BlM-yJIK.js";import{a as f}from"./sentry-CoUvtkTT.js";import{t as u,u as h,j as y,N as I}from"./core-BZ1rdEBJ.js";import{Tu as b,ge as w,IB as j}from"./zeni-epic-state-CRmviUHA.js";import{z as l,a5 as x,ad as S,ae as D}from"./index-CTFYwhi_.js";import{n as c}from"./mui-BFHFLIBn.js";import"./recharts-Cp8vAfrX.js";import"./analytics-DZ_IK-Kq.js";import"./plaid-B4PUsiXy.js";import"./dnd-DzXS-Yl8.js";import"./stripe-cKAAJElX.js";import"./lottie-BRnok4t-.js";import"./lexical-CXbrQPvX.js";import"./pdf-CCE45QO9.js";import"./utils-BKpHrBI5.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]="ea41ccea-5f53-4bd9-9774-3f8e93475442",e._sentryDebugIdIdentifier="sentry-dbid-ea41ccea-5f53-4bd9-9774-3f8e93475442")}catch{}})();const F=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",g=e.get("profileId")??"",[n,p]=f.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),f.useEffect((()=>{n||(p(!0),a(j(t,g,s)))}),[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(T,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=c.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
- `,T=c(D.LargeRegular)`
10
- display: flex;
11
- color: ${S.important};
12
- `;export{F as default};
@@ -1,9 +0,0 @@
1
- import{j as i}from"./liveblocks-BlM-yJIK.js";import{a as u}from"./sentry-CoUvtkTT.js";import{h as x,u as $,g as j,i as B,j as p}from"./core-BZ1rdEBJ.js";import{Sg as s,Sf as v,_z as z,fB as C,_A as E}from"./zeni-epic-state-CRmviUHA.js";import{$ as T,ac as g,E as _,z as D,a5 as L,d2 as P,a2 as N}from"./index-CTFYwhi_.js";import{n as U}from"./mui-BFHFLIBn.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]="4e6b1f95-9ca1-4b93-95c0-f5ff21527dcf",e._sentryDebugIdIdentifier="sentry-dbid-4e6b1f95-9ca1-4b93-95c0-f5ff21527dcf")}catch{}})();const A=U.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
- `;function H(){const e=x(),n=$(),d=T(),f=j();let{accountId:a}=B(),l=`${g.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${a}`;a==null&&f.pathname.includes(`${s}/statements`)&&(a=s,l=`${g.bankingMicroServiceBaseUrl}/1.0/${s}`);const[m,h]=u.useState(!1),y=_();u.useEffect((()=>{m||(h(!0),n(v(a??"",!1)))}),[m,n]);const o=p((t=>z(t,a??""))),b=()=>{const t=N(f.state?.pathnameStackToGoBack),k=t.poppedPathname??"..";e(k,{state:{pathnameStackToGoBack:t.newStack}})},c=D.getSignedInUser(),r=p((t=>C(t))),I={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:r.tenantId??""},w=E(a??"")===!0?s:o.zeniAccountDetail?.accountLast4??"",S=r.company?.companyInfo.companyLegalName??r.companyName;if(c==null)throw Error("Can't access address page without signing in...");return o.fetchState!=="Completed"?i.jsx(L,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}}):i.jsx(A,{windowSize:d,children:i.jsx(P,{currentTenantCompanyName:S,statementListView:o,accountLast4:w,onBackClick:b,authParams:I,downloadEndPoint:l})})}export{H as Z};